@seele00/seele-work 0.1.113 → 0.1.115

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/release-manifest.json +127 -127
  5. package/web/dist/assets/{abnfDiagram-VRR7QNED-CTFNTHtM.js → abnfDiagram-VRR7QNED-BznoD0Lm.js} +1 -1
  6. package/web/dist/assets/{arc-DS3EJOfQ.js → arc-DrfvPR5-.js} +1 -1
  7. package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-9BTL3Ju3.js → architectureDiagram-ZJ3FMSHR-BIWU2ZoJ.js} +1 -1
  8. package/web/dist/assets/{blockDiagram-677ZJIJ3-CxNwI3Xj.js → blockDiagram-677ZJIJ3-CcilVBUv.js} +1 -1
  9. package/web/dist/assets/{c4Diagram-LMCZKHZV-C5g2eUlL.js → c4Diagram-LMCZKHZV-Ds1JT5S_.js} +1 -1
  10. package/web/dist/assets/channel-A1UMcAC0.js +1 -0
  11. package/web/dist/assets/{chunk-2Q5K7J3B-DLiVoZwr.js → chunk-2Q5K7J3B-DZLd1Hlo.js} +1 -1
  12. package/web/dist/assets/{chunk-32BRIVSS-BaP4nKH_.js → chunk-32BRIVSS-BPSc9jg-.js} +1 -1
  13. package/web/dist/assets/{chunk-5VM5RSS4-CvQNZGgw.js → chunk-5VM5RSS4-BNWa6Bkc.js} +1 -1
  14. package/web/dist/assets/{chunk-EX3LRPZG-DtrgZU5v.js → chunk-EX3LRPZG-snAcpgvp.js} +1 -1
  15. package/web/dist/assets/{chunk-JWPE2WC7-D4nWpDMu.js → chunk-JWPE2WC7-iwbuJCua.js} +1 -1
  16. package/web/dist/assets/{chunk-MOJQB5TN-BWEHq24P.js → chunk-MOJQB5TN-hmq2Zcsd.js} +1 -1
  17. package/web/dist/assets/{chunk-RYQCIY6F-vtxLm7z0.js → chunk-RYQCIY6F-BBZTpl2e.js} +1 -1
  18. package/web/dist/assets/{chunk-V7JOEXUC-llCgx7fN.js → chunk-V7JOEXUC-DnymQaov.js} +1 -1
  19. package/web/dist/assets/{chunk-VR4S4FIN-6uhuz7-D.js → chunk-VR4S4FIN-NdGWbR25.js} +1 -1
  20. package/web/dist/assets/{chunk-XXDRQBXY-CsMCPwks.js → chunk-XXDRQBXY-Dhvr7_mG.js} +1 -1
  21. package/web/dist/assets/classDiagram-OUVF2IWQ-CNYTG0Ha.js +1 -0
  22. package/web/dist/assets/classDiagram-v2-EOCWNBFH-CNYTG0Ha.js +1 -0
  23. package/web/dist/assets/{core-bqmd5bjk.js → core-BF5llM8f.js} +1 -1
  24. package/web/dist/assets/{cose-bilkent-JH36ORCC-CeuPKvzZ.js → cose-bilkent-JH36ORCC-DzCsJvsc.js} +1 -1
  25. package/web/dist/assets/{cynefin-VYW2F7L2-Fo6bLIsl.js → cynefin-VYW2F7L2-DlsNo9y9.js} +1 -1
  26. package/web/dist/assets/{cynefinDiagram-TSTJHNR4-CSawoxKX.js → cynefinDiagram-TSTJHNR4-V8pO_qny.js} +1 -1
  27. package/web/dist/assets/{dagre-VKFMJZFB-D9Xhs7On.js → dagre-VKFMJZFB-Ciu9Jsem.js} +1 -1
  28. package/web/dist/assets/{diagram-FQU43EPY-DB6cN00s.js → diagram-FQU43EPY-CpT2siCh.js} +1 -1
  29. package/web/dist/assets/{diagram-G47NLZAW-DNjwGU89.js → diagram-G47NLZAW-h08K7mqu.js} +1 -1
  30. package/web/dist/assets/{diagram-NH7WQ7WH-C3vQfyZ-.js → diagram-NH7WQ7WH-CiA9sSVA.js} +1 -1
  31. package/web/dist/assets/{diagram-OA4YK3LP-D0hZJ12O.js → diagram-OA4YK3LP-DRXGJozV.js} +1 -1
  32. package/web/dist/assets/{diagram-WEI45ONY-C0WVplc9.js → diagram-WEI45ONY-C0MLOEPh.js} +1 -1
  33. package/web/dist/assets/{ebnfDiagram-CCIWWBDH-Cn3Px4hL.js → ebnfDiagram-CCIWWBDH-tT3kOeA1.js} +1 -1
  34. package/web/dist/assets/{erDiagram-Q63AITRT-BepZUHQn.js → erDiagram-Q63AITRT-BROQV7aY.js} +1 -1
  35. package/web/dist/assets/{flowDiagram-23GEKE2U-V3omTqUp.js → flowDiagram-23GEKE2U-BytpY8yV.js} +1 -1
  36. package/web/dist/assets/{ganttDiagram-NO4QXBWP-Cy_CoUKz.js → ganttDiagram-NO4QXBWP-RP59RuiL.js} +1 -1
  37. package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-WhcXyRXe.js → gitGraphDiagram-IHSO6WYX-BjW8VCe5.js} +1 -1
  38. package/web/dist/assets/index-LegF7h-j.js +131 -0
  39. package/web/dist/assets/{infoDiagram-FWYZ7A6U-gZwwoFtB.js → infoDiagram-FWYZ7A6U-hg3kCypu.js} +1 -1
  40. package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-J8gxmrVV.js → ishikawaDiagram-FXEZZL3T-BNUkZmLa.js} +1 -1
  41. package/web/dist/assets/{journeyDiagram-5HDEW3XC-PAvt63QU.js → journeyDiagram-5HDEW3XC-B_cfbmjn.js} +1 -1
  42. package/web/dist/assets/{kanban-definition-HUTT4EX6-BYxCMhgE.js → kanban-definition-HUTT4EX6-CNzRQY89.js} +1 -1
  43. package/web/dist/assets/{linear-AosVMPOw.js → linear-GupbBVC_.js} +1 -1
  44. package/web/dist/assets/{mermaid.core-Ci_ONQ9q.js → mermaid.core-72tyvrGd.js} +4 -4
  45. package/web/dist/assets/{mindmap-definition-LN4V7U3C-Cz93df7q.js → mindmap-definition-LN4V7U3C-DLkMgvo9.js} +1 -1
  46. package/web/dist/assets/{pegDiagram-2B236MQR-BYDLv35r.js → pegDiagram-2B236MQR-BWlGN_B-.js} +1 -1
  47. package/web/dist/assets/{pieDiagram-ENE6RG2P-DWhhF7Hn.js → pieDiagram-ENE6RG2P-BpxH7AyE.js} +1 -1
  48. package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-MMJJt6nx.js → quadrantDiagram-ABIIQ3AL-UHFaa-Uq.js} +1 -1
  49. package/web/dist/assets/{railroadDiagram-RFXS5EU6-DPlzTzo3.js → railroadDiagram-RFXS5EU6-CaCM6A4P.js} +1 -1
  50. package/web/dist/assets/{requirementDiagram-TGXJPOKE-CQyfc0-y.js → requirementDiagram-TGXJPOKE-P0egLdk_.js} +1 -1
  51. package/web/dist/assets/{sankeyDiagram-HTMAVEWB-BcHtyC1S.js → sankeyDiagram-HTMAVEWB-ApMSCFzh.js} +1 -1
  52. package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-DNYEIkZM.js → sequenceDiagram-DBY2YBRQ-CzkgyZ5i.js} +1 -1
  53. package/web/dist/assets/{sizeCapture-X5ZJPWSS-CKIvFl0J.js → sizeCapture-X5ZJPWSS-mZb3Jlg0.js} +1 -1
  54. package/web/dist/assets/{stateDiagram-2N3HPSRC-Bj_EvZzb.js → stateDiagram-2N3HPSRC-CLKDnmXp.js} +1 -1
  55. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-ByWB-lIl.js +1 -0
  56. package/web/dist/assets/{swimlanes-5IMT3BWC-DcyNtdoo.js → swimlanes-5IMT3BWC-BH4YCu5p.js} +2 -2
  57. package/web/dist/assets/swimlanesDiagram-G3AALYLV-BP7JTJtV.js +8 -0
  58. package/web/dist/assets/{timeline-definition-FHXFAJF6-BPciKKRW.js → timeline-definition-FHXFAJF6-DlhWbZMp.js} +1 -1
  59. package/web/dist/assets/{vennDiagram-L72KCM5P-DLI8MwWc.js → vennDiagram-L72KCM5P-m9AgJz3w.js} +1 -1
  60. package/web/dist/assets/{wardleyDiagram-EHGQE667-CCQNQxnJ.js → wardleyDiagram-EHGQE667-BC8I7zNh.js} +1 -1
  61. package/web/dist/assets/{xychartDiagram-FW5EYKEG-BAiR6SbB.js → xychartDiagram-FW5EYKEG-DE8e1d1c.js} +1 -1
  62. package/web/dist/index.html +1 -1
  63. package/web/dist/assets/channel-C6DgvyR9.js +0 -1
  64. package/web/dist/assets/classDiagram-OUVF2IWQ-DgAdMh5n.js +0 -1
  65. package/web/dist/assets/classDiagram-v2-EOCWNBFH-DgAdMh5n.js +0 -1
  66. package/web/dist/assets/index-CwPe0GUY.js +0 -131
  67. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-DEtbmzxr.js +0 -1
  68. package/web/dist/assets/swimlanesDiagram-G3AALYLV-DvBxqz5a.js +0 -8
@@ -0,0 +1,131 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js"])))=>i.map(i=>d[i]);
2
+ var $k=Object.defineProperty;var Gk=(e,i,a)=>i in e?$k(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a;var Lc=(e,i,a)=>Gk(e,typeof i!="symbol"?i+"":i,a);(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))r(u);new MutationObserver(u=>{for(const c of u)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function a(u){const c={};return u.integrity&&(c.integrity=u.integrity),u.referrerPolicy&&(c.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?c.credentials="include":u.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(u){if(u.ep)return;u.ep=!0;const c=a(u);fetch(u.href,c)}})();const Vk="modulepreload",Fk=function(e,i){return new URL(e,i).href},jy={},Tt=function(i,a,r){let u=Promise.resolve();if(a&&a.length>0){let d=function(b){return Promise.all(b.map(x=>Promise.resolve(x).then(S=>({status:"fulfilled",value:S}),S=>({status:"rejected",reason:S}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),m=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));u=d(a.map(b=>{if(b=Fk(b,r),b in jy)return;jy[b]=!0;const x=b.endsWith(".css"),S=x?'[rel="stylesheet"]':"";if(!!r)for(let R=p.length-1;R>=0;R--){const $=p[R];if($.href===b&&(!x||$.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${S}`))return;const E=document.createElement("link");if(E.rel=x?"stylesheet":Vk,x||(E.as="script"),E.crossOrigin="",E.href=b,m&&E.setAttribute("nonce",m),document.head.appendChild(E),x)return new Promise((R,$)=>{E.addEventListener("load",R),E.addEventListener("error",()=>$(new Error(`Unable to preload CSS for ${b}`)))})}))}function c(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return u.then(d=>{for(const p of d||[])p.status==="rejected"&&c(p.reason);return i().catch(c)})};function jb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zf={exports:{}},Vo={};/**
3
+ * @license React
4
+ * react-jsx-runtime.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var Cy;function Yk(){if(Cy)return Vo;Cy=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function a(r,u,c){var d=null;if(c!==void 0&&(d=""+c),u.key!==void 0&&(d=""+u.key),"key"in u){c={};for(var p in u)p!=="key"&&(c[p]=u[p])}else c=u;return u=c.ref,{$$typeof:e,type:r,key:d,ref:u!==void 0?u:null,props:c}}return Vo.Fragment=i,Vo.jsx=a,Vo.jsxs=a,Vo}var Ty;function Pk(){return Ty||(Ty=1,Zf.exports=Yk()),Zf.exports}var s=Pk(),Jf={exports:{}},Be={};/**
11
+ * @license React
12
+ * react.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var Ey;function Wk(){if(Ey)return Be;Ey=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),S=Symbol.iterator;function w(A){return A===null||typeof A!="object"?null:(A=S&&A[S]||A["@@iterator"],typeof A=="function"?A:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,$={};function M(A,z,C){this.props=A,this.context=z,this.refs=$,this.updater=C||E}M.prototype.isReactComponent={},M.prototype.setState=function(A,z){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,z,"setState")},M.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function H(){}H.prototype=M.prototype;function q(A,z,C){this.props=A,this.context=z,this.refs=$,this.updater=C||E}var F=q.prototype=new H;F.constructor=q,R(F,M.prototype),F.isPureReactComponent=!0;var ie=Array.isArray;function N(){}var K={H:null,A:null,T:null,S:null},ae=Object.prototype.hasOwnProperty;function J(A,z,C){var W=C.ref;return{$$typeof:e,type:A,key:z,ref:W!==void 0?W:null,props:C}}function I(A,z){return J(A.type,z,A.props)}function te(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function ue(A){var z={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(C){return z[C]})}var Ce=/\/+/g;function xe(A,z){return typeof A=="object"&&A!==null&&A.key!=null?ue(""+A.key):z.toString(36)}function ce(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(N,N):(A.status="pending",A.then(function(z){A.status==="pending"&&(A.status="fulfilled",A.value=z)},function(z){A.status==="pending"&&(A.status="rejected",A.reason=z)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function V(A,z,C,W,he){var ge=typeof A;(ge==="undefined"||ge==="boolean")&&(A=null);var Se=!1;if(A===null)Se=!0;else switch(ge){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(A.$$typeof){case e:case i:Se=!0;break;case b:return Se=A._init,V(Se(A._payload),z,C,W,he)}}if(Se)return he=he(A),Se=W===""?"."+xe(A,0):W,ie(he)?(C="",Se!=null&&(C=Se.replace(Ce,"$&/")+"/"),V(he,z,C,"",function(vt){return vt})):he!=null&&(te(he)&&(he=I(he,C+(he.key==null||A&&A.key===he.key?"":(""+he.key).replace(Ce,"$&/")+"/")+Se)),z.push(he)),1;Se=0;var oe=W===""?".":W+":";if(ie(A))for(var Oe=0;Oe<A.length;Oe++)W=A[Oe],ge=oe+xe(W,Oe),Se+=V(W,z,C,ge,he);else if(Oe=w(A),typeof Oe=="function")for(A=Oe.call(A),Oe=0;!(W=A.next()).done;)W=W.value,ge=oe+xe(W,Oe++),Se+=V(W,z,C,ge,he);else if(ge==="object"){if(typeof A.then=="function")return V(ce(A),z,C,W,he);throw z=String(A),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return Se}function se(A,z,C){if(A==null)return A;var W=[],he=0;return V(A,W,"","",function(ge){return z.call(C,ge,he++)}),W}function we(A){if(A._status===-1){var z=A._result;z=z(),z.then(function(C){(A._status===0||A._status===-1)&&(A._status=1,A._result=C)},function(C){(A._status===0||A._status===-1)&&(A._status=2,A._result=C)}),A._status===-1&&(A._status=0,A._result=z)}if(A._status===1)return A._result.default;throw A._result}var Me=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},O={map:se,forEach:function(A,z,C){se(A,function(){z.apply(this,arguments)},C)},count:function(A){var z=0;return se(A,function(){z++}),z},toArray:function(A){return se(A,function(z){return z})||[]},only:function(A){if(!te(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return Be.Activity=x,Be.Children=O,Be.Component=M,Be.Fragment=a,Be.Profiler=u,Be.PureComponent=q,Be.StrictMode=r,Be.Suspense=g,Be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K,Be.__COMPILER_RUNTIME={__proto__:null,c:function(A){return K.H.useMemoCache(A)}},Be.cache=function(A){return function(){return A.apply(null,arguments)}},Be.cacheSignal=function(){return null},Be.cloneElement=function(A,z,C){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var W=R({},A.props),he=A.key;if(z!=null)for(ge in z.key!==void 0&&(he=""+z.key),z)!ae.call(z,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&z.ref===void 0||(W[ge]=z[ge]);var ge=arguments.length-2;if(ge===1)W.children=C;else if(1<ge){for(var Se=Array(ge),oe=0;oe<ge;oe++)Se[oe]=arguments[oe+2];W.children=Se}return J(A.type,he,W)},Be.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:c,_context:A},A},Be.createElement=function(A,z,C){var W,he={},ge=null;if(z!=null)for(W in z.key!==void 0&&(ge=""+z.key),z)ae.call(z,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(he[W]=z[W]);var Se=arguments.length-2;if(Se===1)he.children=C;else if(1<Se){for(var oe=Array(Se),Oe=0;Oe<Se;Oe++)oe[Oe]=arguments[Oe+2];he.children=oe}if(A&&A.defaultProps)for(W in Se=A.defaultProps,Se)he[W]===void 0&&(he[W]=Se[W]);return J(A,ge,he)},Be.createRef=function(){return{current:null}},Be.forwardRef=function(A){return{$$typeof:p,render:A}},Be.isValidElement=te,Be.lazy=function(A){return{$$typeof:b,_payload:{_status:-1,_result:A},_init:we}},Be.memo=function(A,z){return{$$typeof:m,type:A,compare:z===void 0?null:z}},Be.startTransition=function(A){var z=K.T,C={};K.T=C;try{var W=A(),he=K.S;he!==null&&he(C,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(N,Me)}catch(ge){Me(ge)}finally{z!==null&&C.types!==null&&(z.types=C.types),K.T=z}},Be.unstable_useCacheRefresh=function(){return K.H.useCacheRefresh()},Be.use=function(A){return K.H.use(A)},Be.useActionState=function(A,z,C){return K.H.useActionState(A,z,C)},Be.useCallback=function(A,z){return K.H.useCallback(A,z)},Be.useContext=function(A){return K.H.useContext(A)},Be.useDebugValue=function(){},Be.useDeferredValue=function(A,z){return K.H.useDeferredValue(A,z)},Be.useEffect=function(A,z){return K.H.useEffect(A,z)},Be.useEffectEvent=function(A){return K.H.useEffectEvent(A)},Be.useId=function(){return K.H.useId()},Be.useImperativeHandle=function(A,z,C){return K.H.useImperativeHandle(A,z,C)},Be.useInsertionEffect=function(A,z){return K.H.useInsertionEffect(A,z)},Be.useLayoutEffect=function(A,z){return K.H.useLayoutEffect(A,z)},Be.useMemo=function(A,z){return K.H.useMemo(A,z)},Be.useOptimistic=function(A,z){return K.H.useOptimistic(A,z)},Be.useReducer=function(A,z,C){return K.H.useReducer(A,z,C)},Be.useRef=function(A){return K.H.useRef(A)},Be.useState=function(A){return K.H.useState(A)},Be.useSyncExternalStore=function(A,z,C){return K.H.useSyncExternalStore(A,z,C)},Be.useTransition=function(){return K.H.useTransition()},Be.version="19.2.7",Be}var Ay;function oh(){return Ay||(Ay=1,Jf.exports=Wk()),Jf.exports}var D=oh(),ep={exports:{}},Fo={},tp={exports:{}},np={};/**
19
+ * @license React
20
+ * scheduler.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var Ny;function Kk(){return Ny||(Ny=1,(function(e){function i(V,se){var we=V.length;V.push(se);e:for(;0<we;){var Me=we-1>>>1,O=V[Me];if(0<u(O,se))V[Me]=se,V[we]=O,we=Me;else break e}}function a(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var se=V[0],we=V.pop();if(we!==se){V[0]=we;e:for(var Me=0,O=V.length,A=O>>>1;Me<A;){var z=2*(Me+1)-1,C=V[z],W=z+1,he=V[W];if(0>u(C,we))W<O&&0>u(he,C)?(V[Me]=he,V[W]=we,Me=W):(V[Me]=C,V[z]=we,Me=z);else if(W<O&&0>u(he,we))V[Me]=he,V[W]=we,Me=W;else break e}}return se}function u(V,se){var we=V.sortIndex-se.sortIndex;return we!==0?we: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,S=3,w=!1,E=!1,R=!1,$=!1,M=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;function F(V){for(var se=a(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=a(m)}}function ie(V){if(R=!1,F(V),!E)if(a(g)!==null)E=!0,N||(N=!0,ue());else{var se=a(m);se!==null&&ce(ie,se.startTime-V)}}var N=!1,K=-1,ae=5,J=-1;function I(){return $?!0:!(e.unstable_now()-J<ae)}function te(){if($=!1,N){var V=e.unstable_now();J=V;var se=!0;try{e:{E=!1,R&&(R=!1,H(K),K=-1),w=!0;var we=S;try{t:{for(F(V),x=a(g);x!==null&&!(x.expirationTime>V&&I());){var Me=x.callback;if(typeof Me=="function"){x.callback=null,S=x.priorityLevel;var O=Me(x.expirationTime<=V);if(V=e.unstable_now(),typeof O=="function"){x.callback=O,F(V),se=!0;break t}x===a(g)&&r(g),F(V)}else r(g);x=a(g)}if(x!==null)se=!0;else{var A=a(m);A!==null&&ce(ie,A.startTime-V),se=!1}}break e}finally{x=null,S=we,w=!1}se=void 0}}finally{se?ue():N=!1}}}var ue;if(typeof q=="function")ue=function(){q(te)};else if(typeof MessageChannel<"u"){var Ce=new MessageChannel,xe=Ce.port2;Ce.port1.onmessage=te,ue=function(){xe.postMessage(null)}}else ue=function(){M(te,0)};function ce(V,se){K=M(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 S},e.unstable_next=function(V){switch(S){case 1:case 2:case 3:var se=3;break;default:se=S}var we=S;S=se;try{return V()}finally{S=we}},e.unstable_requestPaint=function(){$=!0},e.unstable_runWithPriority=function(V,se){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var we=S;S=V;try{return se()}finally{S=we}},e.unstable_scheduleCallback=function(V,se,we){var Me=e.unstable_now();switch(typeof we=="object"&&we!==null?(we=we.delay,we=typeof we=="number"&&0<we?Me+we:Me):we=Me,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=we+O,V={id:b++,callback:se,priorityLevel:V,startTime:we,expirationTime:O,sortIndex:-1},we>Me?(V.sortIndex=we,i(m,V),a(g)===null&&V===a(m)&&(R?(H(K),K=-1):R=!0,ce(ie,we-Me))):(V.sortIndex=O,i(g,V),E||w||(E=!0,N||(N=!0,ue()))),V},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(V){var se=S;return function(){var we=S;S=se;try{return V.apply(this,arguments)}finally{S=we}}}})(np)),np}var Dy;function Xk(){return Dy||(Dy=1,tp.exports=Kk()),tp.exports}var ip={exports:{}},fn={};/**
27
+ * @license React
28
+ * react-dom.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var Ry;function Qk(){if(Ry)return fn;Ry=1;var e=oh();function i(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(i(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},u=Symbol.for("react.portal");function c(g,m,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:g,containerInfo:m,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return fn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,fn.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)},fn.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()}},fn.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))},fn.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},fn.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin),S=typeof m.integrity=="string"?m.integrity:void 0,w=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?r.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:S,fetchPriority:w}):b==="script"&&r.d.X(g,{crossOrigin:x,integrity:S,fetchPriority:w,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},fn.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)},fn.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})}},fn.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)},fn.requestFormReset=function(g){r.d.r(g)},fn.unstable_batchedUpdates=function(g,m){return g(m)},fn.useFormState=function(g,m,b){return d.H.useFormState(g,m,b)},fn.useFormStatus=function(){return d.H.useHostTransitionStatus()},fn.version="19.2.7",fn}var _y;function Zk(){if(_y)return ip.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(),ip.exports=Qk(),ip.exports}/**
35
+ * @license React
36
+ * react-dom-client.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var My;function Jk(){if(My)return Fo;My=1;var e=Xk(),i=oh(),a=Zk();function r(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var n=t,l=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(l=n.return),t=n.return;while(t)}return n.tag===3?l:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function m(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(r(188));return n!==t?null:t}for(var l=t,o=n;;){var f=l.return;if(f===null)break;var h=f.alternate;if(h===null){if(o=f.return,o!==null){l=o;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===l)return g(f),t;if(h===o)return g(f),n;h=h.sibling}throw Error(r(188))}if(l.return!==o.return)l=f,o=h;else{for(var v=!1,T=f.child;T;){if(T===l){v=!0,l=f,o=h;break}if(T===o){v=!0,o=f,l=h;break}T=T.sibling}if(!v){for(T=h.child;T;){if(T===l){v=!0,l=h,o=f;break}if(T===o){v=!0,o=h,l=f;break}T=T.sibling}if(!v)throw Error(r(189))}}if(l.alternate!==o)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?t:n}function b(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=b(t),n!==null)return n;t=t.sibling}return null}var x=Object.assign,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),q=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function ue(t){return t===null||typeof t!="object"?null:(t=te&&t[te]||t["@@iterator"],typeof t=="function"?t:null)}var Ce=Symbol.for("react.client.reference");function xe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ce?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case R:return"Fragment";case M:return"Profiler";case $:return"StrictMode";case ie:return"Suspense";case N:return"SuspenseList";case J:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case q:return t.displayName||"Context";case H:return(t._context.displayName||"Context")+".Consumer";case F:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case K:return n=t.displayName||null,n!==null?n:xe(t.type)||"Memo";case ae:n=t._payload,t=t._init;try{return xe(t(n))}catch{}}return null}var ce=Array.isArray,V=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,we={pending:!1,data:null,method:null,action:null},Me=[],O=-1;function A(t){return{current:t}}function z(t){0>O||(t.current=Me[O],Me[O]=null,O--)}function C(t,n){O++,Me[O]=t.current,t.current=n}var W=A(null),he=A(null),ge=A(null),Se=A(null);function oe(t,n){switch(C(ge,n),C(he,t),C(W,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Pg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Pg(n),t=Wg(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}z(W),C(W,t)}function Oe(){z(W),z(he),z(ge)}function vt(t){t.memoizedState!==null&&C(Se,t);var n=W.current,l=Wg(n,t.type);n!==l&&(C(he,t),C(W,l))}function St(t){he.current===t&&(z(W),z(he)),Se.current===t&&(z(Se),qo._currentValue=we)}var vn,Ke;function mt(t){if(vn===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);vn=n&&n[1]||"",Ke=-1<l.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+vn+t+Ke}var nn=!1;function wn(t,n){if(!t||nn)return"";nn=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Q){var X=Q}Reflect.construct(t,[],re)}else{try{re.call()}catch(Q){X=Q}t.call(re.prototype)}}else{try{throw Error()}catch(Q){X=Q}(re=t())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(Q){if(Q&&X&&typeof Q.stack=="string")return[Q.stack,X.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),v=h[0],T=h[1];if(v&&T){var L=v.split(`
45
+ `),P=T.split(`
46
+ `);for(f=o=0;o<L.length&&!L[o].includes("DetermineComponentFrameRoot");)o++;for(;f<P.length&&!P[f].includes("DetermineComponentFrameRoot");)f++;if(o===L.length||f===P.length)for(o=L.length-1,f=P.length-1;1<=o&&0<=f&&L[o]!==P[f];)f--;for(;1<=o&&0<=f;o--,f--)if(L[o]!==P[f]){if(o!==1||f!==1)do if(o--,f--,0>f||L[o]!==P[f]){var ee=`
47
+ `+L[o].replace(" at new "," at ");return t.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",t.displayName)),ee}while(1<=o&&0<=f);break}}}finally{nn=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?mt(l):""}function Ie(t,n){switch(t.tag){case 26:case 27:case 5:return mt(t.type);case 16:return mt("Lazy");case 13:return t.child!==n&&n!==null?mt("Suspense Fallback"):mt("Suspense");case 19:return mt("SuspenseList");case 0:case 15:return wn(t.type,!1);case 11:return wn(t.type.render,!1);case 1:return wn(t.type,!0);case 31:return mt("Activity");default:return""}}function It(t){try{var n="",l=null;do n+=Ie(t,l),l=t,t=t.return;while(t);return n}catch(o){return`
48
+ Error generating stack: `+o.message+`
49
+ `+o.stack}}var jt=Object.prototype.hasOwnProperty,$t=e.unstable_scheduleCallback,Mi=e.unstable_cancelCallback,xi=e.unstable_shouldYield,zl=e.unstable_requestPaint,Ct=e.unstable_now,ia=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Ne=e.unstable_NormalPriority,qe=e.unstable_LowPriority,Xe=e.unstable_IdlePriority,Gt=e.log,ei=e.unstable_setDisableYieldValue,Kt=null,Et=null;function Xt(t){if(typeof Gt=="function"&&ei(t),Et&&typeof Et.setStrictMode=="function")try{Et.setStrictMode(Kt,t)}catch{}}var rt=Math.clz32?Math.clz32:yd,At=Math.log,kn=Math.LN2;function yd(t){return t>>>=0,t===0?32:31-(At(t)/kn|0)|0}var Ll=256,Er=262144,Ar=4194304;function aa(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 Il(t,n,l){var o=t.pendingLanes;if(o===0)return 0;var f=0,h=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var T=o&134217727;return T!==0?(o=T&~h,o!==0?f=aa(o):(v&=T,v!==0?f=aa(v):l||(l=T&~t,l!==0&&(f=aa(l))))):(T=o&~h,T!==0?f=aa(T):v!==0?f=aa(v):l||(l=o&~t,l!==0&&(f=aa(l)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,l=n&-n,h>=l||h===32&&(l&4194048)!==0)?n:f}function Ha(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function _s(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 Sn(){var t=Ar;return Ar<<=1,(Ar&62914560)===0&&(Ar=4194304),t}function Oi(t){for(var n=[],l=0;31>l;l++)n.push(t);return n}function ct(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ul(t,n,l,o,f,h){var v=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var T=t.entanglements,L=t.expirationTimes,P=t.hiddenUpdates;for(l=v&~l;0<l;){var ee=31-rt(l),re=1<<ee;T[ee]=0,L[ee]=-1;var X=P[ee];if(X!==null)for(P[ee]=null,ee=0;ee<X.length;ee++){var Q=X[ee];Q!==null&&(Q.lane&=-536870913)}l&=~re}o!==0&&Ms(t,o,0),h!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=h&~(v&~n))}function Ms(t,n,l){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-rt(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|l&261930}function $a(t,n){var l=t.entangledLanes|=n;for(t=t.entanglements;l;){var o=31-rt(l),f=1<<o;f&n|t[o]&n&&(t[o]|=n),l&=~f}}function Os(t,n){var l=n&-n;return l=(l&42)!==0?1:la(l),(l&(t.suspendedLanes|n))!==0?0:l}function la(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 zs(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ls(){var t=se.p;return t!==0?t:(t=window.event,t===void 0?32:yy(t.type))}function xu(t,n){var l=se.p;try{return se.p=t,n()}finally{se.p=l}}var bi=Math.random().toString(36).slice(2),Vt="__reactFiber$"+bi,Qt="__reactProps$"+bi,Ga="__reactContainer$"+bi,ra="__reactEvents$"+bi,Va="__reactListeners$"+bi,Fa="__reactHandles$"+bi,sa="__reactResources$"+bi,ti="__reactMarker$"+bi;function Bl(t){delete t[Vt],delete t[Qt],delete t[ra],delete t[Va],delete t[Fa]}function vi(t){var n=t[Vt];if(n)return n;for(var l=t.parentNode;l;){if(n=l[Ga]||l[Vt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(t=ty(t);t!==null;){if(l=t[Vt])return l;t=ty(t)}return n}t=l,l=t.parentNode}return null}function Ya(t){if(t=t[Vt]||t[Ga]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function wi(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function zi(t){var n=t[sa];return n||(n=t[sa]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Nt(t){t[ti]=!0}var Nr=new Set,Dr={};function oa(t,n){ua(t,n),ua(t+"Capture",n)}function ua(t,n){for(Dr[t]=n,t=0;t<n.length;t++)Nr.add(n[t])}var Li=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]*$"),Rr={},Is={};function xd(t){return jt.call(Is,t)?!0:jt.call(Rr,t)?!1:Li.test(t)?Is[t]=!0:(Rr[t]=!0,!1)}function _r(t,n,l){if(xd(n))if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+l)}}function ca(t,n,l){if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+l)}}function ni(t,n,l,o){if(o===null)t.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(n,l,""+o)}}function an(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function bu(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function vu(t,n,l){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,h=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return f.call(this)},set:function(v){l=""+v,h.call(this,v)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function ii(t){if(!t._valueTracker){var n=bu(t)?"checked":"value";t._valueTracker=vu(t,n,""+t[n])}}function Ii(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var l=n.getValue(),o="";return t&&(o=bu(t)?t.checked?"true":"false":t.value),t=o,t!==l?(n.setValue(t),!0):!1}function Mr(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 Ui=/[\n"\\]/g;function Zt(t){return t.replace(Ui,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Or(t,n,l,o,f,h,v,T){t.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.type=v:t.removeAttribute("type"),n!=null?v==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+an(n)):t.value!==""+an(n)&&(t.value=""+an(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?qn(t,v,an(n)):l!=null?qn(t,v,an(l)):o!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?t.name=""+an(T):t.removeAttribute("name")}function ai(t,n,l,o,f,h,v,T){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),n!=null||l!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){ii(t);return}l=l!=null?""+an(l):"",n=n!=null?""+an(n):l,T||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=T?t.checked:!!o,t.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),ii(t)}function qn(t,n,l){n==="number"&&Mr(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function jn(t,n,l,o){if(t=t.options,n){n={};for(var f=0;f<l.length;f++)n["$"+l[f]]=!0;for(l=0;l<t.length;l++)f=n.hasOwnProperty("$"+t[l].value),t[l].selected!==f&&(t[l].selected=f),f&&o&&(t[l].defaultSelected=!0)}else{for(l=""+an(l),n=null,f=0;f<t.length;f++){if(t[f].value===l){t[f].selected=!0,o&&(t[f].defaultSelected=!0);return}n!==null||t[f].disabled||(n=t[f])}n!==null&&(n.selected=!0)}}function Us(t,n,l){if(n!=null&&(n=""+an(n),n!==t.value&&(t.value=n),l==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=l!=null?""+an(l):""}function Pa(t,n,l,o){if(n==null){if(o!=null){if(l!=null)throw Error(r(92));if(ce(o)){if(1<o.length)throw Error(r(93));o=o[0]}l=o}l==null&&(l=""),n=l}l=an(n),t.defaultValue=l,o=t.textContent,o===l&&o!==""&&o!==null&&(t.value=o),ii(t)}function da(t,n){if(n){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=n;return}}t.textContent=n}var zr=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 wu(t,n,l){var o=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,l):typeof l!="number"||l===0||zr.has(n)?n==="float"?t.cssFloat=l:t[n]=(""+l).trim():t[n]=l+"px"}function ql(t,n,l){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,l!=null){for(var o in l)!l.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var f in n)o=n[f],n.hasOwnProperty(f)&&l[f]!==o&&wu(t,f,o)}else for(var h in n)n.hasOwnProperty(h)&&wu(t,h,n[h])}function fa(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 Bs=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"]]),qs=/^[\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 Hl(t){return qs.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Cn(){}var Tn=null;function li(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Bi=null,ri=null;function Lr(t){var n=Ya(t);if(n&&(t=n.stateNode)){var l=t[Qt]||null;e:switch(t=n.stateNode,n.type){case"input":if(Or(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Zt(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var o=l[n];if(o!==t&&o.form===t.form){var f=o[Qt]||null;if(!f)throw Error(r(90));Or(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<l.length;n++)o=l[n],o.form===t.form&&Ii(o)}break e;case"textarea":Us(t,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&jn(t,!!l.multiple,n,!1)}}}var $l=!1;function ku(t,n,l){if($l)return t(n,l);$l=!0;try{var o=t(n);return o}finally{if($l=!1,(Bi!==null||ri!==null)&&(hc(),Bi&&(n=Bi,t=ri,ri=Bi=null,Lr(n),t)))for(n=0;n<t.length;n++)Lr(t[n])}}function pa(t,n){var l=t.stateNode;if(l===null)return null;var o=l[Qt]||null;if(o===null)return null;l=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(r(231,n,typeof l));return l}var si=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hs=!1;if(si)try{var Hn={};Object.defineProperty(Hn,"passive",{get:function(){Hs=!0}}),window.addEventListener("test",Hn,Hn),window.removeEventListener("test",Hn,Hn)}catch{Hs=!1}var qi=null,$s=null,Ir=null;function Gs(){if(Ir)return Ir;var t,n=$s,l=n.length,o,f="value"in qi?qi.value:qi.textContent,h=f.length;for(t=0;t<l&&n[t]===f[t];t++);var v=l-t;for(o=1;o<=v&&n[l-o]===f[h-o];o++);return Ir=f.slice(t,1<o?1-o:void 0)}function ha(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 Ur(){return!1}function Mt(t){function n(l,o,f,h,v){this._reactName=l,this._targetInst=f,this.type=o,this.nativeEvent=h,this.target=v,this.currentTarget=null;for(var T in t)t.hasOwnProperty(T)&&(l=t[T],this[T]=l?l(h):h[T]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Gl:Ur,this.isPropagationStopped=Ur,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Gl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Gl)},persist:function(){},isPersistent:Gl}),n}var oi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vl=Mt(oi),ki=x({},oi,{view:0,detail:0}),Vs=Mt(ki),Fl,Yl,ma,ga=x({},ki,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ql,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!==ma&&(ma&&t.type==="mousemove"?(Fl=t.screenX-ma.screenX,Yl=t.screenY-ma.screenY):Yl=Fl=0,ma=t),Fl)},movementY:function(t){return"movementY"in t?t.movementY:Yl}}),Fs=Mt(ga),Pl=x({},ga,{dataTransfer:0}),Wl=Mt(Pl),Br=x({},ki,{relatedTarget:0}),Wa=Mt(Br),Kl=x({},oi,{animationName:0,elapsedTime:0,pseudoElement:0}),Ka=Mt(Kl),Xa=x({},oi,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Hi=Mt(Xa),En=x({},oi,{data:0}),gn=Mt(En),Qa={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xl={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"},qr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hr(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=qr[t])?!!n[t]:!1}function Ql(){return Hr}var Ys=x({},ki,{key:function(t){if(t.key){var n=Qa[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=ha(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Xl[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ql,charCode:function(t){return t.type==="keypress"?ha(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ha(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Re=Mt(Ys),Su=x({},ga,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$n=Mt(Su),Ot=x({},ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ql}),Ps=Mt(Ot),Zl=x({},oi,{propertyName:0,elapsedTime:0,pseudoElement:0}),at=Mt(Zl),Za=x({},ga,{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}),$r=Mt(Za),Jl=x({},oi,{newState:0,oldState:0}),er=Mt(Jl),Ws=[9,13,27,32],Si=si&&"CompositionEvent"in window,tr=null;si&&"documentMode"in document&&(tr=document.documentMode);var bd=si&&"TextEvent"in window&&!tr,Ja=si&&(!Si||tr&&8<tr&&11>=tr),Ks=" ",Gr=!1;function Vr(t,n){switch(t){case"keyup":return Ws.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nr(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var el=!1;function ju(t,n){switch(t){case"compositionend":return nr(n);case"keypress":return n.which!==32?null:(Gr=!0,Ks);case"textInput":return t=n.data,t===Ks&&Gr?null:t;default:return null}}function Xs(t,n){if(el)return t==="compositionend"||!Si&&Vr(t,n)?(t=Gs(),Ir=$s=qi=null,el=!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 Ja&&n.locale!=="ko"?null:n.data;default:return null}}var Fr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Cu(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Fr[t.type]:n==="textarea"}function tl(t,n,l,o){Bi?ri?ri.push(o):ri=[o]:Bi=o,n=wc(n,"onChange"),0<n.length&&(l=new Vl("onChange","change",null,l,o),t.push({event:l,listeners:n}))}var ir=null,ar=null;function vd(t){Hg(t,0)}function nl(t){var n=wi(t);if(Ii(n))return t}function $i(t,n){if(t==="change")return n}var il=!1;if(si){var ke;if(si){var al="oninput"in document;if(!al){var ll=document.createElement("div");ll.setAttribute("oninput","return;"),al=typeof ll.oninput=="function"}ke=al}else ke=!1;il=ke&&(!document.documentMode||9<document.documentMode)}function Qs(){ir&&(ir.detachEvent("onpropertychange",Yr),ar=ir=null)}function Yr(t){if(t.propertyName==="value"&&nl(ar)){var n=[];tl(n,ar,t,li(t)),ku(vd,n)}}function Zs(t,n,l){t==="focusin"?(Qs(),ir=n,ar=l,ir.attachEvent("onpropertychange",Yr)):t==="focusout"&&Qs()}function wd(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return nl(ar)}function ln(t,n){if(t==="click")return nl(n)}function kd(t,n){if(t==="input"||t==="change")return nl(n)}function Sd(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Jt=typeof Object.is=="function"?Object.is:Sd;function lr(t,n){if(Jt(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var l=Object.keys(t),o=Object.keys(n);if(l.length!==o.length)return!1;for(o=0;o<l.length;o++){var f=l[o];if(!jt.call(n,f)||!Jt(t[f],n[f]))return!1}return!0}function Js(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Pr(t,n){var l=Js(t);t=0;for(var o;l;){if(l.nodeType===3){if(o=t+l.textContent.length,t<=n&&o>=n)return{node:l,offset:n-t};t=o}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Js(l)}}function Tu(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Tu(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Eu(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Mr(t.document);n instanceof t.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)t=n.contentWindow;else break;n=Mr(t.document)}return n}function rl(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 eo=si&&"documentMode"in document&&11>=document.documentMode,Gi=null,to=null,ya=null,no=!1;function Au(t,n,l){var o=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;no||Gi==null||Gi!==Mr(o)||(o=Gi,"selectionStart"in o&&rl(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}),ya&&lr(ya,o)||(ya=o,o=wc(to,"onSelect"),0<o.length&&(n=new Vl("onSelect","select",null,n,l),t.push({event:n,listeners:o}),n.target=Gi)))}function ji(t,n){var l={};return l[t.toLowerCase()]=n.toLowerCase(),l["Webkit"+t]="webkit"+n,l["Moz"+t]="moz"+n,l}var xa={animationend:ji("Animation","AnimationEnd"),animationiteration:ji("Animation","AnimationIteration"),animationstart:ji("Animation","AnimationStart"),transitionrun:ji("Transition","TransitionRun"),transitionstart:ji("Transition","TransitionStart"),transitioncancel:ji("Transition","TransitionCancel"),transitionend:ji("Transition","TransitionEnd")},io={},Nu={};si&&(Nu=document.createElement("div").style,"AnimationEvent"in window||(delete xa.animationend.animation,delete xa.animationiteration.animation,delete xa.animationstart.animation),"TransitionEvent"in window||delete xa.transitionend.transition);function Vi(t){if(io[t])return io[t];if(!xa[t])return t;var n=xa[t],l;for(l in n)if(n.hasOwnProperty(l)&&l in Nu)return io[t]=n[l];return t}var Du=Vi("animationend"),Ru=Vi("animationiteration"),_u=Vi("animationstart"),jd=Vi("transitionrun"),Cd=Vi("transitionstart"),Td=Vi("transitioncancel"),Mu=Vi("transitionend"),Ou=new Map,ao="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(" ");ao.push("scrollEnd");function Gn(t,n){Ou.set(t,n),oa(n,[t])}var Wr=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)},An=[],sl=0,lo=0;function Kr(){for(var t=sl,n=lo=sl=0;n<t;){var l=An[n];An[n++]=null;var o=An[n];An[n++]=null;var f=An[n];An[n++]=null;var h=An[n];if(An[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&&zu(l,f,h)}}function Xr(t,n,l,o){An[sl++]=t,An[sl++]=n,An[sl++]=l,An[sl++]=o,lo|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function ro(t,n,l,o){return Xr(t,n,l,o),rr(t)}function ba(t,n){return Xr(t,null,null,n),rr(t)}function zu(t,n,l){t.lanes|=l;var o=t.alternate;o!==null&&(o.lanes|=l);for(var f=!1,h=t.return;h!==null;)h.childLanes|=l,o=h.alternate,o!==null&&(o.childLanes|=l),h.tag===22&&(t=h.stateNode,t===null||t._visibility&1||(f=!0)),t=h,h=h.return;return t.tag===3?(h=t.stateNode,f&&n!==null&&(f=31-rt(l),t=h.hiddenUpdates,o=t[f],o===null?t[f]=[n]:o.push(n),n.lane=l|536870912),h):null}function rr(t){if(50<Mo)throw Mo=0,kf=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var en={};function Lu(t,n,l,o){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(t,n,l,o){return new Lu(t,n,l,o)}function va(t){return t=t.prototype,!(!t||!t.isReactComponent)}function rn(t,n){var l=t.alternate;return l===null?(l=cn(t.tag,n,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=n,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,n=t.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function Iu(t,n){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,n=l.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Qr(t,n,l,o,f,h){var v=0;if(o=t,typeof t=="function")va(t)&&(v=1);else if(typeof t=="string")v=Dk(t,l,W.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case J:return t=cn(31,l,n,f),t.elementType=J,t.lanes=h,t;case R:return wa(l.children,f,h,n);case $:v=8,f|=24;break;case M:return t=cn(12,l,n,f|2),t.elementType=M,t.lanes=h,t;case ie:return t=cn(13,l,n,f),t.elementType=ie,t.lanes=h,t;case N:return t=cn(19,l,n,f),t.elementType=N,t.lanes=h,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case q:v=10;break e;case H:v=9;break e;case F:v=11;break e;case K:v=14;break e;case ae:v=16,o=null;break e}v=29,l=Error(r(130,t===null?"null":typeof t,"")),o=null}return n=cn(v,l,n,f),n.elementType=t,n.type=o,n.lanes=h,n}function wa(t,n,l,o){return t=cn(7,t,o,n),t.lanes=l,t}function so(t,n,l){return t=cn(6,t,null,n),t.lanes=l,t}function Uu(t){var n=cn(18,null,null,0);return n.stateNode=t,n}function Zr(t,n,l){return n=cn(4,t.children!==null?t.children:[],t.key,n),n.lanes=l,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Bu=new WeakMap;function yn(t,n){if(typeof t=="object"&&t!==null){var l=Bu.get(t);return l!==void 0?l:(n={value:t,source:n,stack:It(n)},Bu.set(t,n),n)}return{value:t,source:n,stack:It(n)}}var ka=[],ol=0,Jr=null,sr=0,Ft=[],sn=0,Fi=null,ui=1,Vn="";function Ci(t,n){ka[ol++]=sr,ka[ol++]=Jr,Jr=t,sr=n}function oo(t,n,l){Ft[sn++]=ui,Ft[sn++]=Vn,Ft[sn++]=Fi,Fi=t;var o=ui;t=Vn;var f=32-rt(o)-1;o&=~(1<<f),l+=1;var h=32-rt(n)+f;if(30<h){var v=f-f%5;h=(o&(1<<v)-1).toString(32),o>>=v,f-=v,ui=1<<32-rt(n)+f|l<<f|o,Vn=h+t}else ui=1<<h|l<<f|o,Vn=t}function uo(t){t.return!==null&&(Ci(t,1),oo(t,1,0))}function co(t){for(;t===Jr;)Jr=ka[--ol],ka[ol]=null,sr=ka[--ol],ka[ol]=null;for(;t===Fi;)Fi=Ft[--sn],Ft[sn]=null,Vn=Ft[--sn],Ft[sn]=null,ui=Ft[--sn],Ft[sn]=null}function qu(t,n){Ft[sn++]=ui,Ft[sn++]=Vn,Ft[sn++]=Fi,ui=n.id,Vn=n.overflow,Fi=t}var Yt=null,gt=null,Fe=!1,Yi=null,Nn=!1,fo=Error(r(519));function Pi(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Sa(yn(n,t)),fo}function Hu(t){var n=t.stateNode,l=t.type,o=t.memoizedProps;switch(n[Vt]=t,n[Qt]=o,l){case"dialog":Pe("cancel",n),Pe("close",n);break;case"iframe":case"object":case"embed":Pe("load",n);break;case"video":case"audio":for(l=0;l<zo.length;l++)Pe(zo[l],n);break;case"source":Pe("error",n);break;case"img":case"image":case"link":Pe("error",n),Pe("load",n);break;case"details":Pe("toggle",n);break;case"input":Pe("invalid",n),ai(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Pe("invalid",n);break;case"textarea":Pe("invalid",n),Pa(n,o.value,o.defaultValue,o.children)}l=o.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||o.suppressHydrationWarning===!0||Fg(n.textContent,l)?(o.popover!=null&&(Pe("beforetoggle",n),Pe("toggle",n)),o.onScroll!=null&&Pe("scroll",n),o.onScrollEnd!=null&&Pe("scrollend",n),o.onClick!=null&&(n.onclick=Cn),n=!0):n=!1,n||Pi(t,!0)}function $u(t){for(Yt=t.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:Nn=!1;return;case 27:case 3:Nn=!0;return;default:Yt=Yt.return}}function ul(t){if(t!==Yt)return!1;if(!Fe)return $u(t),Fe=!0,!1;var n=t.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||If(t.type,t.memoizedProps)),l=!l),l&&gt&&Pi(t),$u(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));gt=ey(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));gt=ey(t)}else n===27?(n=gt,kl(t.type)?(t=$f,$f=null,gt=t):gt=n):gt=Yt?hi(t.stateNode.nextSibling):null;return!0}function ci(){gt=Yt=null,Fe=!1}function po(){var t=Yi;return t!==null&&(zn===null?zn=t:zn.push.apply(zn,t),Yi=null),t}function Sa(t){Yi===null?Yi=[t]:Yi.push(t)}var ho=A(null),ja=null,Dn=null;function Wi(t,n,l){C(ho,n._currentValue),n._currentValue=l}function dn(t){t._currentValue=ho.current,z(ho)}function or(t,n,l){for(;t!==null;){var o=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),t===l)break;t=t.return}}function es(t,n,l,o){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var h=f.dependencies;if(h!==null){var v=f.child;h=h.firstContext;e:for(;h!==null;){var T=h;h=f;for(var L=0;L<n.length;L++)if(T.context===n[L]){h.lanes|=l,T=h.alternate,T!==null&&(T.lanes|=l),or(h.return,l,t),o||(v=null);break e}h=T.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(r(341));v.lanes|=l,h=v.alternate,h!==null&&(h.lanes|=l),or(v,l,t),v=null}else v=f.child;if(v!==null)v.return=f;else for(v=f;v!==null;){if(v===t){v=null;break}if(f=v.sibling,f!==null){f.return=v.return,v=f;break}v=v.return}f=v}}function Ca(t,n,l,o){t=null;for(var f=n,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var v=f.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var T=f.type;Jt(f.pendingProps.value,v.value)||(t!==null?t.push(T):t=[T])}}else if(f===Se.current){if(v=f.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(qo):t=[qo])}f=f.return}t!==null&&es(n,t,l,o),n.flags|=262144}function ur(t){for(t=t.firstContext;t!==null;){if(!Jt(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Fn(t){ja=t,Dn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Pt(t){return Gu(ja,t)}function ts(t,n){return ja===null&&Fn(t),Gu(t,n)}function Gu(t,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Dn===null){if(t===null)throw Error(r(308));Dn=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else Dn=Dn.next=n;return l}var ns=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(l,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(l){return l()})}},Ed=e.unstable_scheduleCallback,Vu=e.unstable_NormalPriority,Dt={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ta(){return{controller:new ns,data:new Map,refCount:0}}function Ti(t){t.refCount--,t.refCount===0&&Ed(Vu,function(){t.controller.abort()})}var Ei=null,mo=0,cl=0,dl=null;function st(t,n){if(Ei===null){var l=Ei=[];mo=0,cl=Af(),dl={status:"pending",value:void 0,then:function(o){l.push(o)}}}return mo++,n.then(Ai,Ai),n}function Ai(){if(--mo===0&&Ei!==null){dl!==null&&(dl.status="fulfilled");var t=Ei;Ei=null,cl=0,dl=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function Ad(t,n){var l=[],o={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var f=0;f<l.length;f++)(0,l[f])(n)},function(f){for(o.status="rejected",o.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),o}var Rn=V.S;V.S=function(t,n){mg=Ct(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&st(t,n),Rn!==null&&Rn(t,n)};var Ea=A(null);function di(){var t=Ea.current;return t!==null?t:yt.pooledCache}function is(t,n){n===null?C(Ea,Ea.current):C(Ea,n.pool)}function Fu(){var t=di();return t===null?null:{parent:Dt._currentValue,pool:t}}var fl=Error(r(460)),cr=Error(r(474)),as=Error(r(542)),ls={then:function(){}};function Yu(t){return t=t.status,t==="fulfilled"||t==="rejected"}function go(t,n,l){switch(l=t[l],l===void 0?t.push(n):l!==n&&(n.then(Cn,Cn),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,y(t),t;default:if(typeof n.status=="string")n.then(Cn,Cn);else{if(t=yt,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=o}},function(o){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,y(t),t}throw Xi=n,fl}}function Ki(t){try{var n=t._init;return n(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Xi=l,fl):l}}var Xi=null;function yo(){if(Xi===null)throw Error(r(459));var t=Xi;return Xi=null,t}function y(t){if(t===fl||t===as)throw Error(r(483))}var k=null,j=0;function _(t){var n=j;return j+=1,k===null&&(k=[]),go(k,t,n)}function U(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Z(t,n){throw n.$$typeof===S?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function fe(t){function n(G,B){if(t){var Y=G.deletions;Y===null?(G.deletions=[B],G.flags|=16):Y.push(B)}}function l(G,B){if(!t)return null;for(;B!==null;)n(G,B),B=B.sibling;return null}function o(G){for(var B=new Map;G!==null;)G.key!==null?B.set(G.key,G):B.set(G.index,G),G=G.sibling;return B}function f(G,B){return G=rn(G,B),G.index=0,G.sibling=null,G}function h(G,B,Y){return G.index=Y,t?(Y=G.alternate,Y!==null?(Y=Y.index,Y<B?(G.flags|=67108866,B):Y):(G.flags|=67108866,B)):(G.flags|=1048576,B)}function v(G){return t&&G.alternate===null&&(G.flags|=67108866),G}function T(G,B,Y,le){return B===null||B.tag!==6?(B=so(Y,G.mode,le),B.return=G,B):(B=f(B,Y),B.return=G,B)}function L(G,B,Y,le){var _e=Y.type;return _e===R?ee(G,B,Y.props.children,le,Y.key):B!==null&&(B.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===ae&&Ki(_e)===B.type)?(B=f(B,Y.props),U(B,Y),B.return=G,B):(B=Qr(Y.type,Y.key,Y.props,null,G.mode,le),U(B,Y),B.return=G,B)}function P(G,B,Y,le){return B===null||B.tag!==4||B.stateNode.containerInfo!==Y.containerInfo||B.stateNode.implementation!==Y.implementation?(B=Zr(Y,G.mode,le),B.return=G,B):(B=f(B,Y.children||[]),B.return=G,B)}function ee(G,B,Y,le,_e){return B===null||B.tag!==7?(B=wa(Y,G.mode,le,_e),B.return=G,B):(B=f(B,Y),B.return=G,B)}function re(G,B,Y){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=so(""+B,G.mode,Y),B.return=G,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case w:return Y=Qr(B.type,B.key,B.props,null,G.mode,Y),U(Y,B),Y.return=G,Y;case E:return B=Zr(B,G.mode,Y),B.return=G,B;case ae:return B=Ki(B),re(G,B,Y)}if(ce(B)||ue(B))return B=wa(B,G.mode,Y,null),B.return=G,B;if(typeof B.then=="function")return re(G,_(B),Y);if(B.$$typeof===q)return re(G,ts(G,B),Y);Z(G,B)}return null}function X(G,B,Y,le){var _e=B!==null?B.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return _e!==null?null:T(G,B,""+Y,le);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:return Y.key===_e?L(G,B,Y,le):null;case E:return Y.key===_e?P(G,B,Y,le):null;case ae:return Y=Ki(Y),X(G,B,Y,le)}if(ce(Y)||ue(Y))return _e!==null?null:ee(G,B,Y,le,null);if(typeof Y.then=="function")return X(G,B,_(Y),le);if(Y.$$typeof===q)return X(G,B,ts(G,Y),le);Z(G,Y)}return null}function Q(G,B,Y,le,_e){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return G=G.get(Y)||null,T(B,G,""+le,_e);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case w:return G=G.get(le.key===null?Y:le.key)||null,L(B,G,le,_e);case E:return G=G.get(le.key===null?Y:le.key)||null,P(B,G,le,_e);case ae:return le=Ki(le),Q(G,B,Y,le,_e)}if(ce(le)||ue(le))return G=G.get(Y)||null,ee(B,G,le,_e,null);if(typeof le.then=="function")return Q(G,B,Y,_(le),_e);if(le.$$typeof===q)return Q(G,B,Y,ts(B,le),_e);Z(B,le)}return null}function Te(G,B,Y,le){for(var _e=null,nt=null,De=B,Ge=B=0,Ze=null;De!==null&&Ge<Y.length;Ge++){De.index>Ge?(Ze=De,De=null):Ze=De.sibling;var it=X(G,De,Y[Ge],le);if(it===null){De===null&&(De=Ze);break}t&&De&&it.alternate===null&&n(G,De),B=h(it,B,Ge),nt===null?_e=it:nt.sibling=it,nt=it,De=Ze}if(Ge===Y.length)return l(G,De),Fe&&Ci(G,Ge),_e;if(De===null){for(;Ge<Y.length;Ge++)De=re(G,Y[Ge],le),De!==null&&(B=h(De,B,Ge),nt===null?_e=De:nt.sibling=De,nt=De);return Fe&&Ci(G,Ge),_e}for(De=o(De);Ge<Y.length;Ge++)Ze=Q(De,G,Ge,Y[Ge],le),Ze!==null&&(t&&Ze.alternate!==null&&De.delete(Ze.key===null?Ge:Ze.key),B=h(Ze,B,Ge),nt===null?_e=Ze:nt.sibling=Ze,nt=Ze);return t&&De.forEach(function(El){return n(G,El)}),Fe&&Ci(G,Ge),_e}function Le(G,B,Y,le){if(Y==null)throw Error(r(151));for(var _e=null,nt=null,De=B,Ge=B=0,Ze=null,it=Y.next();De!==null&&!it.done;Ge++,it=Y.next()){De.index>Ge?(Ze=De,De=null):Ze=De.sibling;var El=X(G,De,it.value,le);if(El===null){De===null&&(De=Ze);break}t&&De&&El.alternate===null&&n(G,De),B=h(El,B,Ge),nt===null?_e=El:nt.sibling=El,nt=El,De=Ze}if(it.done)return l(G,De),Fe&&Ci(G,Ge),_e;if(De===null){for(;!it.done;Ge++,it=Y.next())it=re(G,it.value,le),it!==null&&(B=h(it,B,Ge),nt===null?_e=it:nt.sibling=it,nt=it);return Fe&&Ci(G,Ge),_e}for(De=o(De);!it.done;Ge++,it=Y.next())it=Q(De,G,Ge,it.value,le),it!==null&&(t&&it.alternate!==null&&De.delete(it.key===null?Ge:it.key),B=h(it,B,Ge),nt===null?_e=it:nt.sibling=it,nt=it);return t&&De.forEach(function(Hk){return n(G,Hk)}),Fe&&Ci(G,Ge),_e}function ht(G,B,Y,le){if(typeof Y=="object"&&Y!==null&&Y.type===R&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:e:{for(var _e=Y.key;B!==null;){if(B.key===_e){if(_e=Y.type,_e===R){if(B.tag===7){l(G,B.sibling),le=f(B,Y.props.children),le.return=G,G=le;break e}}else if(B.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===ae&&Ki(_e)===B.type){l(G,B.sibling),le=f(B,Y.props),U(le,Y),le.return=G,G=le;break e}l(G,B);break}else n(G,B);B=B.sibling}Y.type===R?(le=wa(Y.props.children,G.mode,le,Y.key),le.return=G,G=le):(le=Qr(Y.type,Y.key,Y.props,null,G.mode,le),U(le,Y),le.return=G,G=le)}return v(G);case E:e:{for(_e=Y.key;B!==null;){if(B.key===_e)if(B.tag===4&&B.stateNode.containerInfo===Y.containerInfo&&B.stateNode.implementation===Y.implementation){l(G,B.sibling),le=f(B,Y.children||[]),le.return=G,G=le;break e}else{l(G,B);break}else n(G,B);B=B.sibling}le=Zr(Y,G.mode,le),le.return=G,G=le}return v(G);case ae:return Y=Ki(Y),ht(G,B,Y,le)}if(ce(Y))return Te(G,B,Y,le);if(ue(Y)){if(_e=ue(Y),typeof _e!="function")throw Error(r(150));return Y=_e.call(Y),Le(G,B,Y,le)}if(typeof Y.then=="function")return ht(G,B,_(Y),le);if(Y.$$typeof===q)return ht(G,B,ts(G,Y),le);Z(G,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,B!==null&&B.tag===6?(l(G,B.sibling),le=f(B,Y),le.return=G,G=le):(l(G,B),le=so(Y,G.mode,le),le.return=G,G=le),v(G)):l(G,B)}return function(G,B,Y,le){try{j=0;var _e=ht(G,B,Y,le);return k=null,_e}catch(De){if(De===fl||De===as)throw De;var nt=cn(29,De,null,G.mode);return nt.lanes=le,nt.return=G,nt}finally{}}}var je=fe(!0),be=fe(!1),ve=!1;function dt(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function et(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 fi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ni(t,n,l){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(lt&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=rr(t),zu(t,null,l),n}return Xr(t,o,n,l),rr(t)}function xo(t,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,l|=o,n.lanes=l,$a(t,l)}}function Nd(t,n){var l=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,l===o)){var f=null,h=null;if(l=l.firstBaseUpdate,l!==null){do{var v={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};h===null?f=h=v:h=h.next=v,l=l.next}while(l!==null);h===null?f=h=n:h=h.next=n}else f=h=n;l={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=n:t.next=n,l.lastBaseUpdate=n}var Dd=!1;function bo(){if(Dd){var t=dl;if(t!==null)throw t}}function vo(t,n,l,o){Dd=!1;var f=t.updateQueue;ve=!1;var h=f.firstBaseUpdate,v=f.lastBaseUpdate,T=f.shared.pending;if(T!==null){f.shared.pending=null;var L=T,P=L.next;L.next=null,v===null?h=P:v.next=P,v=L;var ee=t.alternate;ee!==null&&(ee=ee.updateQueue,T=ee.lastBaseUpdate,T!==v&&(T===null?ee.firstBaseUpdate=P:T.next=P,ee.lastBaseUpdate=L))}if(h!==null){var re=f.baseState;v=0,ee=P=L=null,T=h;do{var X=T.lane&-536870913,Q=X!==T.lane;if(Q?(Qe&X)===X:(o&X)===X){X!==0&&X===cl&&(Dd=!0),ee!==null&&(ee=ee.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var Te=t,Le=T;X=n;var ht=l;switch(Le.tag){case 1:if(Te=Le.payload,typeof Te=="function"){re=Te.call(ht,re,X);break e}re=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Le.payload,X=typeof Te=="function"?Te.call(ht,re,X):Te,X==null)break e;re=x({},re,X);break e;case 2:ve=!0}}X=T.callback,X!==null&&(t.flags|=64,Q&&(t.flags|=8192),Q=f.callbacks,Q===null?f.callbacks=[X]:Q.push(X))}else Q={lane:X,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ee===null?(P=ee=Q,L=re):ee=ee.next=Q,v|=X;if(T=T.next,T===null){if(T=f.shared.pending,T===null)break;Q=T,T=Q.next,Q.next=null,f.lastBaseUpdate=Q,f.shared.pending=null}}while(!0);ee===null&&(L=re),f.baseState=L,f.firstBaseUpdate=P,f.lastBaseUpdate=ee,h===null&&(f.shared.lanes=0),yl|=v,t.lanes=v,t.memoizedState=re}}function qh(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function Hh(t,n){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)qh(l[t],n)}var rs=A(null),Pu=A(0);function $h(t,n){t=La,C(Pu,t),C(rs,n),La=t|n.baseLanes}function Rd(){C(Pu,La),C(rs,rs.current)}function _d(){La=Pu.current,z(rs),z(Pu)}var Yn=A(null),pi=null;function pl(t){var n=t.alternate;C(zt,zt.current&1),C(Yn,t),pi===null&&(n===null||rs.current!==null||n.memoizedState!==null)&&(pi=t)}function Md(t){C(zt,zt.current),C(Yn,t),pi===null&&(pi=t)}function Gh(t){t.tag===22?(C(zt,zt.current),C(Yn,t),pi===null&&(pi=t)):hl()}function hl(){C(zt,zt.current),C(Yn,Yn.current)}function Pn(t){z(Yn),pi===t&&(pi=null),z(zt)}var zt=A(0);function Wu(t){for(var n=t;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||qf(l)||Hf(l)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Aa=0,He=null,ft=null,Ut=null,Ku=!1,ss=!1,dr=!1,Xu=0,wo=0,os=null,Rw=0;function Rt(){throw Error(r(321))}function Od(t,n){if(n===null)return!1;for(var l=0;l<n.length&&l<t.length;l++)if(!Jt(t[l],n[l]))return!1;return!0}function zd(t,n,l,o,f,h){return Aa=h,He=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,V.H=t===null||t.memoizedState===null?Tm:Xd,dr=!1,h=l(o,f),dr=!1,ss&&(h=Fh(n,l,o,f)),Vh(t),h}function Vh(t){V.H=jo;var n=ft!==null&&ft.next!==null;if(Aa=0,Ut=ft=He=null,Ku=!1,wo=0,os=null,n)throw Error(r(300));t===null||Bt||(t=t.dependencies,t!==null&&ur(t)&&(Bt=!0))}function Fh(t,n,l,o){He=t;var f=0;do{if(ss&&(os=null),wo=0,ss=!1,25<=f)throw Error(r(301));if(f+=1,Ut=ft=null,t.updateQueue!=null){var h=t.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}V.H=Em,h=n(l,o)}while(ss);return h}function _w(){var t=V.H,n=t.useState()[0];return n=typeof n.then=="function"?ko(n):n,t=t.useState()[0],(ft!==null?ft.memoizedState:null)!==t&&(He.flags|=1024),n}function Ld(){var t=Xu!==0;return Xu=0,t}function Id(t,n,l){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~l}function Ud(t){if(Ku){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Ku=!1}Aa=0,Ut=ft=He=null,ss=!1,wo=Xu=0,os=null}function xn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?He.memoizedState=Ut=t:Ut=Ut.next=t,Ut}function Lt(){if(ft===null){var t=He.alternate;t=t!==null?t.memoizedState:null}else t=ft.next;var n=Ut===null?He.memoizedState:Ut.next;if(n!==null)Ut=n,ft=t;else{if(t===null)throw He.alternate===null?Error(r(467)):Error(r(310));ft=t,t={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},Ut===null?He.memoizedState=Ut=t:Ut=Ut.next=t}return Ut}function Qu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(t){var n=wo;return wo+=1,os===null&&(os=[]),t=go(os,t,n),n=He,(Ut===null?n.memoizedState:Ut.next)===null&&(n=n.alternate,V.H=n===null||n.memoizedState===null?Tm:Xd),t}function Zu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ko(t);if(t.$$typeof===q)return Pt(t)}throw Error(r(438,String(t)))}function Bd(t){var n=null,l=He.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var o=He.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=Qu(),He.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(t),o=0;o<t;o++)l[o]=I;return n.index++,l}function Na(t,n){return typeof n=="function"?n(t):n}function Ju(t){var n=Lt();return qd(n,ft,t)}function qd(t,n,l){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=l;var f=t.baseQueue,h=o.pending;if(h!==null){if(f!==null){var v=f.next;f.next=h.next,h.next=v}n.baseQueue=f=h,o.pending=null}if(h=t.baseState,f===null)t.memoizedState=h;else{n=f.next;var T=v=null,L=null,P=n,ee=!1;do{var re=P.lane&-536870913;if(re!==P.lane?(Qe&re)===re:(Aa&re)===re){var X=P.revertLane;if(X===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),re===cl&&(ee=!0);else if((Aa&X)===X){P=P.next,X===cl&&(ee=!0);continue}else re={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},L===null?(T=L=re,v=h):L=L.next=re,He.lanes|=X,yl|=X;re=P.action,dr&&l(h,re),h=P.hasEagerState?P.eagerState:l(h,re)}else X={lane:re,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},L===null?(T=L=X,v=h):L=L.next=X,He.lanes|=re,yl|=re;P=P.next}while(P!==null&&P!==n);if(L===null?v=h:L.next=T,!Jt(h,t.memoizedState)&&(Bt=!0,ee&&(l=dl,l!==null)))throw l;t.memoizedState=h,t.baseState=v,t.baseQueue=L,o.lastRenderedState=h}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Hd(t){var n=Lt(),l=n.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=t;var o=l.dispatch,f=l.pending,h=n.memoizedState;if(f!==null){l.pending=null;var v=f=f.next;do h=t(h,v.action),v=v.next;while(v!==f);Jt(h,n.memoizedState)||(Bt=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),l.lastRenderedState=h}return[h,o]}function Yh(t,n,l){var o=He,f=Lt(),h=Fe;if(h){if(l===void 0)throw Error(r(407));l=l()}else l=n();var v=!Jt((ft||f).memoizedState,l);if(v&&(f.memoizedState=l,Bt=!0),f=f.queue,Vd(Kh.bind(null,o,f,t),[t]),f.getSnapshot!==n||v||Ut!==null&&Ut.memoizedState.tag&1){if(o.flags|=2048,us(9,{destroy:void 0},Wh.bind(null,o,f,l,n),null),yt===null)throw Error(r(349));h||(Aa&127)!==0||Ph(o,n,l)}return l}function Ph(t,n,l){t.flags|=16384,t={getSnapshot:n,value:l},n=He.updateQueue,n===null?(n=Qu(),He.updateQueue=n,n.stores=[t]):(l=n.stores,l===null?n.stores=[t]:l.push(t))}function Wh(t,n,l,o){n.value=l,n.getSnapshot=o,Xh(n)&&Qh(t)}function Kh(t,n,l){return l(function(){Xh(n)&&Qh(t)})}function Xh(t){var n=t.getSnapshot;t=t.value;try{var l=n();return!Jt(t,l)}catch{return!0}}function Qh(t){var n=ba(t,2);n!==null&&Ln(n,t,2)}function $d(t){var n=xn();if(typeof t=="function"){var l=t;if(t=l(),dr){Xt(!0);try{l()}finally{Xt(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:t},n}function Zh(t,n,l,o){return t.baseState=l,qd(t,ft,typeof o=="function"?o:Na)}function Mw(t,n,l,o,f){if(nc(t))throw Error(r(485));if(t=n.action,t!==null){var h={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){h.listeners.push(v)}};V.T!==null?l(!0):h.isTransition=!1,o(h),l=n.pending,l===null?(h.next=n.pending=h,Jh(n,h)):(h.next=l.next,n.pending=l.next=h)}}function Jh(t,n){var l=n.action,o=n.payload,f=t.state;if(n.isTransition){var h=V.T,v={};V.T=v;try{var T=l(f,o),L=V.S;L!==null&&L(v,T),em(t,n,T)}catch(P){Gd(t,n,P)}finally{h!==null&&v.types!==null&&(h.types=v.types),V.T=h}}else try{h=l(f,o),em(t,n,h)}catch(P){Gd(t,n,P)}}function em(t,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(o){tm(t,n,o)},function(o){return Gd(t,n,o)}):tm(t,n,l)}function tm(t,n,l){n.status="fulfilled",n.value=l,nm(n),t.state=l,n=t.pending,n!==null&&(l=n.next,l===n?t.pending=null:(l=l.next,n.next=l,Jh(t,l)))}function Gd(t,n,l){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=l,nm(n),n=n.next;while(n!==o)}t.action=null}function nm(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function im(t,n){return n}function am(t,n){if(Fe){var l=yt.formState;if(l!==null){e:{var o=He;if(Fe){if(gt){t:{for(var f=gt,h=Nn;f.nodeType!==8;){if(!h){f=null;break t}if(f=hi(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){gt=hi(f.nextSibling),o=f.data==="F!";break e}}Pi(o)}o=!1}o&&(n=l[0])}}return l=xn(),l.memoizedState=l.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:im,lastRenderedState:n},l.queue=o,l=Sm.bind(null,He,o),o.dispatch=l,o=$d(!1),h=Kd.bind(null,He,!1,o.queue),o=xn(),f={state:n,dispatch:null,action:t,pending:null},o.queue=f,l=Mw.bind(null,He,f,h,l),f.dispatch=l,o.memoizedState=t,[n,l,!1]}function lm(t){var n=Lt();return rm(n,ft,t)}function rm(t,n,l){if(n=qd(t,n,im)[0],t=Ju(Na)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=ko(n)}catch(v){throw v===fl?as:v}else o=n;n=Lt();var f=n.queue,h=f.dispatch;return l!==n.memoizedState&&(He.flags|=2048,us(9,{destroy:void 0},Ow.bind(null,f,l),null)),[o,h,t]}function Ow(t,n){t.action=n}function sm(t){var n=Lt(),l=ft;if(l!==null)return rm(n,l,t);Lt(),n=n.memoizedState,l=Lt();var o=l.queue.dispatch;return l.memoizedState=t,[n,o,!1]}function us(t,n,l,o){return t={tag:t,create:l,deps:o,inst:n,next:null},n=He.updateQueue,n===null&&(n=Qu(),He.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=t.next=t:(o=l.next,l.next=t,t.next=o,n.lastEffect=t),t}function om(){return Lt().memoizedState}function ec(t,n,l,o){var f=xn();He.flags|=t,f.memoizedState=us(1|n,{destroy:void 0},l,o===void 0?null:o)}function tc(t,n,l,o){var f=Lt();o=o===void 0?null:o;var h=f.memoizedState.inst;ft!==null&&o!==null&&Od(o,ft.memoizedState.deps)?f.memoizedState=us(n,h,l,o):(He.flags|=t,f.memoizedState=us(1|n,h,l,o))}function um(t,n){ec(8390656,8,t,n)}function Vd(t,n){tc(2048,8,t,n)}function zw(t){He.flags|=4;var n=He.updateQueue;if(n===null)n=Qu(),He.updateQueue=n,n.events=[t];else{var l=n.events;l===null?n.events=[t]:l.push(t)}}function cm(t){var n=Lt().memoizedState;return zw({ref:n,nextImpl:t}),function(){if((lt&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function dm(t,n){return tc(4,2,t,n)}function fm(t,n){return tc(4,4,t,n)}function pm(t,n){if(typeof n=="function"){t=t();var l=n(t);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function hm(t,n,l){l=l!=null?l.concat([t]):null,tc(4,4,pm.bind(null,n,t),l)}function Fd(){}function mm(t,n){var l=Lt();n=n===void 0?null:n;var o=l.memoizedState;return n!==null&&Od(n,o[1])?o[0]:(l.memoizedState=[t,n],t)}function gm(t,n){var l=Lt();n=n===void 0?null:n;var o=l.memoizedState;if(n!==null&&Od(n,o[1]))return o[0];if(o=t(),dr){Xt(!0);try{t()}finally{Xt(!1)}}return l.memoizedState=[o,n],o}function Yd(t,n,l){return l===void 0||(Aa&1073741824)!==0&&(Qe&261930)===0?t.memoizedState=n:(t.memoizedState=l,t=yg(),He.lanes|=t,yl|=t,l)}function ym(t,n,l,o){return Jt(l,n)?l:rs.current!==null?(t=Yd(t,l,o),Jt(t,n)||(Bt=!0),t):(Aa&42)===0||(Aa&1073741824)!==0&&(Qe&261930)===0?(Bt=!0,t.memoizedState=l):(t=yg(),He.lanes|=t,yl|=t,n)}function xm(t,n,l,o,f){var h=se.p;se.p=h!==0&&8>h?h:8;var v=V.T,T={};V.T=T,Kd(t,!1,n,l);try{var L=f(),P=V.S;if(P!==null&&P(T,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var ee=Ad(L,o);So(t,n,ee,Xn(t))}else So(t,n,o,Xn(t))}catch(re){So(t,n,{then:function(){},status:"rejected",reason:re},Xn())}finally{se.p=h,v!==null&&T.types!==null&&(v.types=T.types),V.T=v}}function Lw(){}function Pd(t,n,l,o){if(t.tag!==5)throw Error(r(476));var f=bm(t).queue;xm(t,f,n,we,l===null?Lw:function(){return vm(t),l(o)})}function bm(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:we,baseState:we,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:we},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Na,lastRenderedState:l},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function vm(t){var n=bm(t);n.next===null&&(n=t.alternate.memoizedState),So(t,n.next.queue,{},Xn())}function Wd(){return Pt(qo)}function wm(){return Lt().memoizedState}function km(){return Lt().memoizedState}function Iw(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var l=Xn();t=fi(l);var o=Ni(n,t,l);o!==null&&(Ln(o,n,l),xo(o,n,l)),n={cache:Ta()},t.payload=n;return}n=n.return}}function Uw(t,n,l){var o=Xn();l={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},nc(t)?jm(n,l):(l=ro(t,n,l,o),l!==null&&(Ln(l,t,o),Cm(l,n,o)))}function Sm(t,n,l){var o=Xn();So(t,n,l,o)}function So(t,n,l,o){var f={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(nc(t))jm(n,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var v=n.lastRenderedState,T=h(v,l);if(f.hasEagerState=!0,f.eagerState=T,Jt(T,v))return Xr(t,n,f,0),yt===null&&Kr(),!1}catch{}finally{}if(l=ro(t,n,f,o),l!==null)return Ln(l,t,o),Cm(l,n,o),!0}return!1}function Kd(t,n,l,o){if(o={lane:2,revertLane:Af(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},nc(t)){if(n)throw Error(r(479))}else n=ro(t,l,o,2),n!==null&&Ln(n,t,2)}function nc(t){var n=t.alternate;return t===He||n!==null&&n===He}function jm(t,n){ss=Ku=!0;var l=t.pending;l===null?n.next=n:(n.next=l.next,l.next=n),t.pending=n}function Cm(t,n,l){if((l&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,l|=o,n.lanes=l,$a(t,l)}}var jo={readContext:Pt,use:Zu,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};jo.useEffectEvent=Rt;var Tm={readContext:Pt,use:Zu,useCallback:function(t,n){return xn().memoizedState=[t,n===void 0?null:n],t},useContext:Pt,useEffect:um,useImperativeHandle:function(t,n,l){l=l!=null?l.concat([t]):null,ec(4194308,4,pm.bind(null,n,t),l)},useLayoutEffect:function(t,n){return ec(4194308,4,t,n)},useInsertionEffect:function(t,n){ec(4,2,t,n)},useMemo:function(t,n){var l=xn();n=n===void 0?null:n;var o=t();if(dr){Xt(!0);try{t()}finally{Xt(!1)}}return l.memoizedState=[o,n],o},useReducer:function(t,n,l){var o=xn();if(l!==void 0){var f=l(n);if(dr){Xt(!0);try{l(n)}finally{Xt(!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=Uw.bind(null,He,t),[o.memoizedState,t]},useRef:function(t){var n=xn();return t={current:t},n.memoizedState=t},useState:function(t){t=$d(t);var n=t.queue,l=Sm.bind(null,He,n);return n.dispatch=l,[t.memoizedState,l]},useDebugValue:Fd,useDeferredValue:function(t,n){var l=xn();return Yd(l,t,n)},useTransition:function(){var t=$d(!1);return t=xm.bind(null,He,t.queue,!0,!1),xn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,l){var o=He,f=xn();if(Fe){if(l===void 0)throw Error(r(407));l=l()}else{if(l=n(),yt===null)throw Error(r(349));(Qe&127)!==0||Ph(o,n,l)}f.memoizedState=l;var h={value:l,getSnapshot:n};return f.queue=h,um(Kh.bind(null,o,h,t),[t]),o.flags|=2048,us(9,{destroy:void 0},Wh.bind(null,o,h,l,n),null),l},useId:function(){var t=xn(),n=yt.identifierPrefix;if(Fe){var l=Vn,o=ui;l=(o&~(1<<32-rt(o)-1)).toString(32)+l,n="_"+n+"R_"+l,l=Xu++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=Rw++,n="_"+n+"r_"+l.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Wd,useFormState:am,useActionState:am,useOptimistic:function(t){var n=xn();n.memoizedState=n.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=Kd.bind(null,He,!0,l),l.dispatch=n,[t,n]},useMemoCache:Bd,useCacheRefresh:function(){return xn().memoizedState=Iw.bind(null,He)},useEffectEvent:function(t){var n=xn(),l={impl:t};return n.memoizedState=l,function(){if((lt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},Xd={readContext:Pt,use:Zu,useCallback:mm,useContext:Pt,useEffect:Vd,useImperativeHandle:hm,useInsertionEffect:dm,useLayoutEffect:fm,useMemo:gm,useReducer:Ju,useRef:om,useState:function(){return Ju(Na)},useDebugValue:Fd,useDeferredValue:function(t,n){var l=Lt();return ym(l,ft.memoizedState,t,n)},useTransition:function(){var t=Ju(Na)[0],n=Lt().memoizedState;return[typeof t=="boolean"?t:ko(t),n]},useSyncExternalStore:Yh,useId:wm,useHostTransitionStatus:Wd,useFormState:lm,useActionState:lm,useOptimistic:function(t,n){var l=Lt();return Zh(l,ft,t,n)},useMemoCache:Bd,useCacheRefresh:km};Xd.useEffectEvent=cm;var Em={readContext:Pt,use:Zu,useCallback:mm,useContext:Pt,useEffect:Vd,useImperativeHandle:hm,useInsertionEffect:dm,useLayoutEffect:fm,useMemo:gm,useReducer:Hd,useRef:om,useState:function(){return Hd(Na)},useDebugValue:Fd,useDeferredValue:function(t,n){var l=Lt();return ft===null?Yd(l,t,n):ym(l,ft.memoizedState,t,n)},useTransition:function(){var t=Hd(Na)[0],n=Lt().memoizedState;return[typeof t=="boolean"?t:ko(t),n]},useSyncExternalStore:Yh,useId:wm,useHostTransitionStatus:Wd,useFormState:sm,useActionState:sm,useOptimistic:function(t,n){var l=Lt();return ft!==null?Zh(l,ft,t,n):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Bd,useCacheRefresh:km};Em.useEffectEvent=cm;function Qd(t,n,l,o){n=t.memoizedState,l=l(o,n),l=l==null?n:x({},n,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Zd={enqueueSetState:function(t,n,l){t=t._reactInternals;var o=Xn(),f=fi(o);f.payload=n,l!=null&&(f.callback=l),n=Ni(t,f,o),n!==null&&(Ln(n,t,o),xo(n,t,o))},enqueueReplaceState:function(t,n,l){t=t._reactInternals;var o=Xn(),f=fi(o);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=Ni(t,f,o),n!==null&&(Ln(n,t,o),xo(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var l=Xn(),o=fi(l);o.tag=2,n!=null&&(o.callback=n),n=Ni(t,o,l),n!==null&&(Ln(n,t,l),xo(n,t,l))}};function Am(t,n,l,o,f,h,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,h,v):n.prototype&&n.prototype.isPureReactComponent?!lr(l,o)||!lr(f,h):!0}function Nm(t,n,l,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,o),n.state!==t&&Zd.enqueueReplaceState(n,n.state,null)}function fr(t,n){var l=n;if("ref"in n){l={};for(var o in n)o!=="ref"&&(l[o]=n[o])}if(t=t.defaultProps){l===n&&(l=x({},l));for(var f in t)l[f]===void 0&&(l[f]=t[f])}return l}function Dm(t){Wr(t)}function Rm(t){console.error(t)}function _m(t){Wr(t)}function ic(t,n){try{var l=t.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Mm(t,n,l){try{var o=t.onCaughtError;o(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Jd(t,n,l){return l=fi(l),l.tag=3,l.payload={element:null},l.callback=function(){ic(t,n)},l}function Om(t){return t=fi(t),t.tag=3,t}function zm(t,n,l,o){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var h=o.value;t.payload=function(){return f(h)},t.callback=function(){Mm(n,l,o)}}var v=l.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){Mm(n,l,o),typeof f!="function"&&(xl===null?xl=new Set([this]):xl.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})})}function Bw(t,n,l,o,f){if(l.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=l.alternate,n!==null&&Ca(n,l,f,!0),l=Yn.current,l!==null){switch(l.tag){case 31:case 13:return pi===null?mc():l.alternate===null&&_t===0&&(_t=3),l.flags&=-257,l.flags|=65536,l.lanes=f,o===ls?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([o]):n.add(o),Cf(t,o,f)),!1;case 22:return l.flags|=65536,o===ls?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([o]):l.add(o)),Cf(t,o,f)),!1}throw Error(r(435,l.tag))}return Cf(t,o,f),mc(),!1}if(Fe)return n=Yn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==fo&&(t=Error(r(422),{cause:o}),Sa(yn(t,l)))):(o!==fo&&(n=Error(r(423),{cause:o}),Sa(yn(n,l))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=yn(o,l),f=Jd(t.stateNode,o,f),Nd(t,f),_t!==4&&(_t=2)),!1;var h=Error(r(520),{cause:o});if(h=yn(h,l),_o===null?_o=[h]:_o.push(h),_t!==4&&(_t=2),n===null)return!0;o=yn(o,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,t=f&-f,l.lanes|=t,t=Jd(l.stateNode,o,t),Nd(l,t),!1;case 1:if(n=l.type,h=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(xl===null||!xl.has(h))))return l.flags|=65536,f&=-f,l.lanes|=f,f=Om(f),zm(f,t,l,o),Nd(l,f),!1}l=l.return}while(l!==null);return!1}var ef=Error(r(461)),Bt=!1;function on(t,n,l,o){n.child=t===null?be(n,null,l,o):je(n,t.child,l,o)}function Lm(t,n,l,o,f){l=l.render;var h=n.ref;if("ref"in o){var v={};for(var T in o)T!=="ref"&&(v[T]=o[T])}else v=o;return Fn(n),o=zd(t,n,l,v,h,f),T=Ld(),t!==null&&!Bt?(Id(t,n,f),Da(t,n,f)):(Fe&&T&&uo(n),n.flags|=1,on(t,n,o,f),n.child)}function Im(t,n,l,o,f){if(t===null){var h=l.type;return typeof h=="function"&&!va(h)&&h.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=h,Um(t,n,h,o,f)):(t=Qr(l.type,null,o,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(h=t.child,!uf(t,f)){var v=h.memoizedProps;if(l=l.compare,l=l!==null?l:lr,l(v,o)&&t.ref===n.ref)return Da(t,n,f)}return n.flags|=1,t=rn(h,o),t.ref=n.ref,t.return=n,n.child=t}function Um(t,n,l,o,f){if(t!==null){var h=t.memoizedProps;if(lr(h,o)&&t.ref===n.ref)if(Bt=!1,n.pendingProps=o=h,uf(t,f))(t.flags&131072)!==0&&(Bt=!0);else return n.lanes=t.lanes,Da(t,n,f)}return tf(t,n,l,o,f)}function Bm(t,n,l,o){var f=o.children,h=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|l:l,t!==null){for(o=n.child=t.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~h}else o=0,n.child=null;return qm(t,n,h,l,o)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&is(n,h!==null?h.cachePool:null),h!==null?$h(n,h):Rd(),Gh(n);else return o=n.lanes=536870912,qm(t,n,h!==null?h.baseLanes|l:l,l,o)}else h!==null?(is(n,h.cachePool),$h(n,h),hl(),n.memoizedState=null):(t!==null&&is(n,null),Rd(),hl());return on(t,n,f,l),n.child}function Co(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function qm(t,n,l,o,f){var h=di();return h=h===null?null:{parent:Dt._currentValue,pool:h},n.memoizedState={baseLanes:l,cachePool:h},t!==null&&is(n,null),Rd(),Gh(n),t!==null&&Ca(t,n,o,!0),n.childLanes=f,null}function ac(t,n){return n=rc({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Hm(t,n,l){return je(n,t.child,null,l),t=ac(n,n.pendingProps),t.flags|=2,Pn(n),n.memoizedState=null,t}function qw(t,n,l){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Fe){if(o.mode==="hidden")return t=ac(n,o),n.lanes=536870912,Co(null,t);if(Md(n),(t=gt)?(t=Jg(t,Nn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Fi!==null?{id:ui,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},l=Uu(t),l.return=n,n.child=l,Yt=n,gt=null)):t=null,t===null)throw Pi(n);return n.lanes=536870912,null}return ac(n,o)}var h=t.memoizedState;if(h!==null){var v=h.dehydrated;if(Md(n),f)if(n.flags&256)n.flags&=-257,n=Hm(t,n,l);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(Bt||Ca(t,n,l,!1),f=(l&t.childLanes)!==0,Bt||f){if(o=yt,o!==null&&(v=Os(o,l),v!==0&&v!==h.retryLane))throw h.retryLane=v,ba(t,v),Ln(o,t,v),ef;mc(),n=Hm(t,n,l)}else t=h.treeContext,gt=hi(v.nextSibling),Yt=n,Fe=!0,Yi=null,Nn=!1,t!==null&&qu(n,t),n=ac(n,o),n.flags|=4096;return n}return t=rn(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function lc(t,n){var l=n.ref;if(l===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(t===null||t.ref!==l)&&(n.flags|=4194816)}}function tf(t,n,l,o,f){return Fn(n),l=zd(t,n,l,o,void 0,f),o=Ld(),t!==null&&!Bt?(Id(t,n,f),Da(t,n,f)):(Fe&&o&&uo(n),n.flags|=1,on(t,n,l,f),n.child)}function $m(t,n,l,o,f,h){return Fn(n),n.updateQueue=null,l=Fh(n,o,l,f),Vh(t),o=Ld(),t!==null&&!Bt?(Id(t,n,h),Da(t,n,h)):(Fe&&o&&uo(n),n.flags|=1,on(t,n,l,h),n.child)}function Gm(t,n,l,o,f){if(Fn(n),n.stateNode===null){var h=en,v=l.contextType;typeof v=="object"&&v!==null&&(h=Pt(v)),h=new l(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Zd,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},dt(n),v=l.contextType,h.context=typeof v=="object"&&v!==null?Pt(v):en,h.state=n.memoizedState,v=l.getDerivedStateFromProps,typeof v=="function"&&(Qd(n,l,v,o),h.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(v=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),v!==h.state&&Zd.enqueueReplaceState(h,h.state,null),vo(n,o,h,f),bo(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){h=n.stateNode;var T=n.memoizedProps,L=fr(l,T);h.props=L;var P=h.context,ee=l.contextType;v=en,typeof ee=="object"&&ee!==null&&(v=Pt(ee));var re=l.getDerivedStateFromProps;ee=typeof re=="function"||typeof h.getSnapshotBeforeUpdate=="function",T=n.pendingProps!==T,ee||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(T||P!==v)&&Nm(n,h,o,v),ve=!1;var X=n.memoizedState;h.state=X,vo(n,o,h,f),bo(),P=n.memoizedState,T||X!==P||ve?(typeof re=="function"&&(Qd(n,l,re,o),P=n.memoizedState),(L=ve||Am(n,l,L,o,X,P,v))?(ee||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=P),h.props=o,h.state=P,h.context=v,o=L):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,et(t,n),v=n.memoizedProps,ee=fr(l,v),h.props=ee,re=n.pendingProps,X=h.context,P=l.contextType,L=en,typeof P=="object"&&P!==null&&(L=Pt(P)),T=l.getDerivedStateFromProps,(P=typeof T=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v!==re||X!==L)&&Nm(n,h,o,L),ve=!1,X=n.memoizedState,h.state=X,vo(n,o,h,f),bo();var Q=n.memoizedState;v!==re||X!==Q||ve||t!==null&&t.dependencies!==null&&ur(t.dependencies)?(typeof T=="function"&&(Qd(n,l,T,o),Q=n.memoizedState),(ee=ve||Am(n,l,ee,o,X,Q,L)||t!==null&&t.dependencies!==null&&ur(t.dependencies))?(P||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,Q,L),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,Q,L)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&X===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&X===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=Q),h.props=o,h.state=Q,h.context=L,o=ee):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&X===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&X===t.memoizedState||(n.flags|=1024),o=!1)}return h=o,lc(t,n),o=(n.flags&128)!==0,h||o?(h=n.stateNode,l=o&&typeof l.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,t!==null&&o?(n.child=je(n,t.child,null,f),n.child=je(n,null,l,f)):on(t,n,l,f),n.memoizedState=h.state,t=n.child):t=Da(t,n,f),t}function Vm(t,n,l,o){return ci(),n.flags|=256,on(t,n,l,o),n.child}var nf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function af(t){return{baseLanes:t,cachePool:Fu()}}function lf(t,n,l){return t=t!==null?t.childLanes&~l:0,n&&(t|=Kn),t}function Fm(t,n,l){var o=n.pendingProps,f=!1,h=(n.flags&128)!==0,v;if((v=h)||(v=t!==null&&t.memoizedState===null?!1:(zt.current&2)!==0),v&&(f=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,t===null){if(Fe){if(f?pl(n):hl(),(t=gt)?(t=Jg(t,Nn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Fi!==null?{id:ui,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},l=Uu(t),l.return=n,n.child=l,Yt=n,gt=null)):t=null,t===null)throw Pi(n);return Hf(t)?n.lanes=32:n.lanes=536870912,null}var T=o.children;return o=o.fallback,f?(hl(),f=n.mode,T=rc({mode:"hidden",children:T},f),o=wa(o,f,l,null),T.return=n,o.return=n,T.sibling=o,n.child=T,o=n.child,o.memoizedState=af(l),o.childLanes=lf(t,v,l),n.memoizedState=nf,Co(null,o)):(pl(n),rf(n,T))}var L=t.memoizedState;if(L!==null&&(T=L.dehydrated,T!==null)){if(h)n.flags&256?(pl(n),n.flags&=-257,n=sf(t,n,l)):n.memoizedState!==null?(hl(),n.child=t.child,n.flags|=128,n=null):(hl(),T=o.fallback,f=n.mode,o=rc({mode:"visible",children:o.children},f),T=wa(T,f,l,null),T.flags|=2,o.return=n,T.return=n,o.sibling=T,n.child=o,je(n,t.child,null,l),o=n.child,o.memoizedState=af(l),o.childLanes=lf(t,v,l),n.memoizedState=nf,n=Co(null,o));else if(pl(n),Hf(T)){if(v=T.nextSibling&&T.nextSibling.dataset,v)var P=v.dgst;v=P,o=Error(r(419)),o.stack="",o.digest=v,Sa({value:o,source:null,stack:null}),n=sf(t,n,l)}else if(Bt||Ca(t,n,l,!1),v=(l&t.childLanes)!==0,Bt||v){if(v=yt,v!==null&&(o=Os(v,l),o!==0&&o!==L.retryLane))throw L.retryLane=o,ba(t,o),Ln(v,t,o),ef;qf(T)||mc(),n=sf(t,n,l)}else qf(T)?(n.flags|=192,n.child=t.child,n=null):(t=L.treeContext,gt=hi(T.nextSibling),Yt=n,Fe=!0,Yi=null,Nn=!1,t!==null&&qu(n,t),n=rf(n,o.children),n.flags|=4096);return n}return f?(hl(),T=o.fallback,f=n.mode,L=t.child,P=L.sibling,o=rn(L,{mode:"hidden",children:o.children}),o.subtreeFlags=L.subtreeFlags&65011712,P!==null?T=rn(P,T):(T=wa(T,f,l,null),T.flags|=2),T.return=n,o.return=n,o.sibling=T,n.child=o,Co(null,o),o=n.child,T=t.child.memoizedState,T===null?T=af(l):(f=T.cachePool,f!==null?(L=Dt._currentValue,f=f.parent!==L?{parent:L,pool:L}:f):f=Fu(),T={baseLanes:T.baseLanes|l,cachePool:f}),o.memoizedState=T,o.childLanes=lf(t,v,l),n.memoizedState=nf,Co(t.child,o)):(pl(n),l=t.child,t=l.sibling,l=rn(l,{mode:"visible",children:o.children}),l.return=n,l.sibling=null,t!==null&&(v=n.deletions,v===null?(n.deletions=[t],n.flags|=16):v.push(t)),n.child=l,n.memoizedState=null,l)}function rf(t,n){return n=rc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function rc(t,n){return t=cn(22,t,null,n),t.lanes=0,t}function sf(t,n,l){return je(n,t.child,null,l),t=rf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Ym(t,n,l){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),or(t.return,n,l)}function of(t,n,l,o,f,h){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:l,tailMode:f,treeForkCount:h}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=l,v.tailMode=f,v.treeForkCount=h)}function Pm(t,n,l){var o=n.pendingProps,f=o.revealOrder,h=o.tail;o=o.children;var v=zt.current,T=(v&2)!==0;if(T?(v=v&1|2,n.flags|=128):v&=1,C(zt,v),on(t,n,o,l),o=Fe?sr:0,!T&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Ym(t,l,n);else if(t.tag===19)Ym(t,l,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"forwards":for(l=n.child,f=null;l!==null;)t=l.alternate,t!==null&&Wu(t)===null&&(f=l),l=l.sibling;l=f,l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),of(n,!1,f,l,h,o);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=n.child,n.child=null;f!==null;){if(t=f.alternate,t!==null&&Wu(t)===null){n.child=f;break}t=f.sibling,f.sibling=l,l=f,f=t}of(n,!0,l,null,h,o);break;case"together":of(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function Da(t,n,l){if(t!==null&&(n.dependencies=t.dependencies),yl|=n.lanes,(l&n.childLanes)===0)if(t!==null){if(Ca(t,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(r(153));if(n.child!==null){for(t=n.child,l=rn(t,t.pendingProps),n.child=l,l.return=n;t.sibling!==null;)t=t.sibling,l=l.sibling=rn(t,t.pendingProps),l.return=n;l.sibling=null}return n.child}function uf(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&ur(t)))}function Hw(t,n,l){switch(n.tag){case 3:oe(n,n.stateNode.containerInfo),Wi(n,Dt,t.memoizedState.cache),ci();break;case 27:case 5:vt(n);break;case 4:oe(n,n.stateNode.containerInfo);break;case 10:Wi(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Md(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(pl(n),n.flags|=128,null):(l&n.child.childLanes)!==0?Fm(t,n,l):(pl(n),t=Da(t,n,l),t!==null?t.sibling:null);pl(n);break;case 19:var f=(t.flags&128)!==0;if(o=(l&n.childLanes)!==0,o||(Ca(t,n,l,!1),o=(l&n.childLanes)!==0),f){if(o)return Pm(t,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),C(zt,zt.current),o)break;return null;case 22:return n.lanes=0,Bm(t,n,l,n.pendingProps);case 24:Wi(n,Dt,t.memoizedState.cache)}return Da(t,n,l)}function Wm(t,n,l){if(t!==null)if(t.memoizedProps!==n.pendingProps)Bt=!0;else{if(!uf(t,l)&&(n.flags&128)===0)return Bt=!1,Hw(t,n,l);Bt=(t.flags&131072)!==0}else Bt=!1,Fe&&(n.flags&1048576)!==0&&oo(n,sr,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=Ki(n.elementType),n.type=t,typeof t=="function")va(t)?(o=fr(t,o),n.tag=1,n=Gm(null,n,t,o,l)):(n.tag=0,n=tf(null,n,t,o,l));else{if(t!=null){var f=t.$$typeof;if(f===F){n.tag=11,n=Lm(null,n,t,o,l);break e}else if(f===K){n.tag=14,n=Im(null,n,t,o,l);break e}}throw n=xe(t)||t,Error(r(306,n,""))}}return n;case 0:return tf(t,n,n.type,n.pendingProps,l);case 1:return o=n.type,f=fr(o,n.pendingProps),Gm(t,n,o,f,l);case 3:e:{if(oe(n,n.stateNode.containerInfo),t===null)throw Error(r(387));o=n.pendingProps;var h=n.memoizedState;f=h.element,et(t,n),vo(n,o,null,l);var v=n.memoizedState;if(o=v.cache,Wi(n,Dt,o),o!==h.cache&&es(n,[Dt],l,!0),bo(),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=Vm(t,n,o,l);break e}else if(o!==f){f=yn(Error(r(424)),n),Sa(f),n=Vm(t,n,o,l);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(gt=hi(t.firstChild),Yt=n,Fe=!0,Yi=null,Nn=!0,l=be(n,null,o,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(ci(),o===f){n=Da(t,n,l);break e}on(t,n,o,l)}n=n.child}return n;case 26:return lc(t,n),t===null?(l=ly(n.type,null,n.pendingProps,null))?n.memoizedState=l:Fe||(l=n.type,t=n.pendingProps,o=kc(ge.current).createElement(l),o[Vt]=n,o[Qt]=t,un(o,l,t),Nt(o),n.stateNode=o):n.memoizedState=ly(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return vt(n),t===null&&Fe&&(o=n.stateNode=ny(n.type,n.pendingProps,ge.current),Yt=n,Nn=!0,f=gt,kl(n.type)?($f=f,gt=hi(o.firstChild)):gt=f),on(t,n,n.pendingProps.children,l),lc(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Fe&&((f=o=gt)&&(o=yk(o,n.type,n.pendingProps,Nn),o!==null?(n.stateNode=o,Yt=n,gt=hi(o.firstChild),Nn=!1,f=!0):f=!1),f||Pi(n)),vt(n),f=n.type,h=n.pendingProps,v=t!==null?t.memoizedProps:null,o=h.children,If(f,h)?o=null:v!==null&&If(f,v)&&(n.flags|=32),n.memoizedState!==null&&(f=zd(t,n,_w,null,null,l),qo._currentValue=f),lc(t,n),on(t,n,o,l),n.child;case 6:return t===null&&Fe&&((t=l=gt)&&(l=xk(l,n.pendingProps,Nn),l!==null?(n.stateNode=l,Yt=n,gt=null,t=!0):t=!1),t||Pi(n)),null;case 13:return Fm(t,n,l);case 4:return oe(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=je(n,null,o,l):on(t,n,o,l),n.child;case 11:return Lm(t,n,n.type,n.pendingProps,l);case 7:return on(t,n,n.pendingProps,l),n.child;case 8:return on(t,n,n.pendingProps.children,l),n.child;case 12:return on(t,n,n.pendingProps.children,l),n.child;case 10:return o=n.pendingProps,Wi(n,n.type,o.value),on(t,n,o.children,l),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,Fn(n),f=Pt(f),o=o(f),n.flags|=1,on(t,n,o,l),n.child;case 14:return Im(t,n,n.type,n.pendingProps,l);case 15:return Um(t,n,n.type,n.pendingProps,l);case 19:return Pm(t,n,l);case 31:return qw(t,n,l);case 22:return Bm(t,n,l,n.pendingProps);case 24:return Fn(n),o=Pt(Dt),t===null?(f=di(),f===null&&(f=yt,h=Ta(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=l),f=h),n.memoizedState={parent:o,cache:f},dt(n),Wi(n,Dt,f)):((t.lanes&l)!==0&&(et(t,n),vo(n,null,null,l),bo()),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),Wi(n,Dt,o)):(o=h.cache,Wi(n,Dt,o),o!==f.cache&&es(n,[Dt],l,!0))),on(t,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function Ra(t){t.flags|=4}function cf(t,n,l,o,f){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(wg())t.flags|=8192;else throw Xi=ls,cr}else t.flags&=-16777217}function Km(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!cy(n))if(wg())t.flags|=8192;else throw Xi=ls,cr}function sc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Sn():536870912,t.lanes|=n,ps|=n)}function To(t,n){if(!Fe)switch(t.tailMode){case"hidden":n=t.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var o=null;l!==null;)l.alternate!==null&&(o=l),l=l.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function wt(t){var n=t.alternate!==null&&t.alternate.child===t.child,l=0,o=0;if(n)for(var f=t.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=o,t.childLanes=l,n}function $w(t,n,l){var o=n.pendingProps;switch(co(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(n),null;case 1:return wt(n),null;case 3:return l=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),dn(Dt),Oe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(ul(n)?Ra(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,po())),wt(n),null;case 26:var f=n.type,h=n.memoizedState;return t===null?(Ra(n),h!==null?(wt(n),Km(n,h)):(wt(n),cf(n,f,null,o,l))):h?h!==t.memoizedState?(Ra(n),wt(n),Km(n,h)):(wt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&Ra(n),wt(n),cf(n,f,t,o,l)),null;case 27:if(St(n),l=ge.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Ra(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return wt(n),null}t=W.current,ul(n)?Hu(n):(t=ny(f,o,l),n.stateNode=t,Ra(n))}return wt(n),null;case 5:if(St(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Ra(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return wt(n),null}if(h=W.current,ul(n))Hu(n);else{var v=kc(ge.current);switch(h){case 1:h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=v.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?v.createElement("select",{is:o.is}):v.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?v.createElement(f,{is:o.is}):v.createElement(f)}}h[Vt]=n,h[Qt]=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(un(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&&Ra(n)}}return wt(n),cf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,l),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&Ra(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(r(166));if(t=ge.current,ul(n)){if(t=n.stateNode,l=n.memoizedProps,o=null,f=Yt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[Vt]=n,t=!!(t.nodeValue===l||o!==null&&o.suppressHydrationWarning===!0||Fg(t.nodeValue,l)),t||Pi(n,!0)}else t=kc(t).createTextNode(o),t[Vt]=n,n.stateNode=t}return wt(n),null;case 31:if(l=n.memoizedState,t===null||t.memoizedState!==null){if(o=ul(n),l!==null){if(t===null){if(!o)throw Error(r(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[Vt]=n}else ci(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;wt(n),t=!1}else l=po(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return n.flags&256?(Pn(n),n):(Pn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return wt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=ul(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[Vt]=n}else ci(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;wt(n),f=!1}else f=po(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Pn(n),n):(Pn(n),null)}return Pn(n),(n.flags&128)!==0?(n.lanes=l,n):(l=o!==null,t=t!==null&&t.memoizedState!==null,l&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==f&&(o.flags|=2048)),l!==t&&l&&(n.child.flags|=8192),sc(n,n.updateQueue),wt(n),null);case 4:return Oe(),t===null&&_f(n.stateNode.containerInfo),wt(n),null;case 10:return dn(n.type),wt(n),null;case 19:if(z(zt),o=n.memoizedState,o===null)return wt(n),null;if(f=(n.flags&128)!==0,h=o.rendering,h===null)if(f)To(o,!1);else{if(_t!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=Wu(t),h!==null){for(n.flags|=128,To(o,!1),t=h.updateQueue,n.updateQueue=t,sc(n,t),n.subtreeFlags=0,t=l,l=n.child;l!==null;)Iu(l,t),l=l.sibling;return C(zt,zt.current&1|2),Fe&&Ci(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Ct()>fc&&(n.flags|=128,f=!0,To(o,!1),n.lanes=4194304)}else{if(!f)if(t=Wu(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,sc(n,t),To(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Fe)return wt(n),null}else 2*Ct()-o.renderingStartTime>fc&&l!==536870912&&(n.flags|=128,f=!0,To(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(t=o.last,t!==null?t.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ct(),t.sibling=null,l=zt.current,C(zt,f?l&1|2:l&1),Fe&&Ci(n,o.treeForkCount),t):(wt(n),null);case 22:case 23:return Pn(n),_d(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(l&536870912)!==0&&(n.flags&128)===0&&(wt(n),n.subtreeFlags&6&&(n.flags|=8192)):wt(n),l=n.updateQueue,l!==null&&sc(n,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==l&&(n.flags|=2048),t!==null&&z(Ea),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),dn(Dt),wt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function Gw(t,n){switch(co(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return dn(Dt),Oe(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return St(n),null;case 31:if(n.memoizedState!==null){if(Pn(n),n.alternate===null)throw Error(r(340));ci()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Pn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));ci()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return z(zt),null;case 4:return Oe(),null;case 10:return dn(n.type),null;case 22:case 23:return Pn(n),_d(),t!==null&&z(Ea),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return dn(Dt),null;case 25:return null;default:return null}}function Xm(t,n){switch(co(n),n.tag){case 3:dn(Dt),Oe();break;case 26:case 27:case 5:St(n);break;case 4:Oe();break;case 31:n.memoizedState!==null&&Pn(n);break;case 13:Pn(n);break;case 19:z(zt);break;case 10:dn(n.type);break;case 22:case 23:Pn(n),_d(),t!==null&&z(Ea);break;case 24:dn(Dt)}}function Eo(t,n){try{var l=n.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var f=o.next;l=f;do{if((l.tag&t)===t){o=void 0;var h=l.create,v=l.inst;o=h(),v.destroy=o}l=l.next}while(l!==f)}}catch(T){ut(n,n.return,T)}}function ml(t,n,l){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var h=f.next;o=h;do{if((o.tag&t)===t){var v=o.inst,T=v.destroy;if(T!==void 0){v.destroy=void 0,f=n;var L=l,P=T;try{P()}catch(ee){ut(f,L,ee)}}}o=o.next}while(o!==h)}}catch(ee){ut(n,n.return,ee)}}function Qm(t){var n=t.updateQueue;if(n!==null){var l=t.stateNode;try{Hh(n,l)}catch(o){ut(t,t.return,o)}}}function Zm(t,n,l){l.props=fr(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(o){ut(t,n,o)}}function Ao(t,n){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof l=="function"?t.refCleanup=l(o):l.current=o}}catch(f){ut(t,n,f)}}function Qi(t,n){var l=t.ref,o=t.refCleanup;if(l!==null)if(typeof o=="function")try{o()}catch(f){ut(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){ut(t,n,f)}else l.current=null}function Jm(t){var n=t.type,l=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&o.focus();break e;case"img":l.src?o.src=l.src:l.srcSet&&(o.srcset=l.srcSet)}}catch(f){ut(t,t.return,f)}}function df(t,n,l){try{var o=t.stateNode;dk(o,t.type,l,n),o[Qt]=n}catch(f){ut(t,t.return,f)}}function eg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&kl(t.type)||t.tag===4}function ff(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||eg(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&&kl(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 pf(t,n,l){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(t),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=Cn));else if(o!==4&&(o===27&&kl(t.type)&&(l=t.stateNode,n=null),t=t.child,t!==null))for(pf(t,n,l),t=t.sibling;t!==null;)pf(t,n,l),t=t.sibling}function oc(t,n,l){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?l.insertBefore(t,n):l.appendChild(t);else if(o!==4&&(o===27&&kl(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(oc(t,n,l),t=t.sibling;t!==null;)oc(t,n,l),t=t.sibling}function tg(t){var n=t.stateNode,l=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);un(n,o,l),n[Vt]=t,n[Qt]=l}catch(h){ut(t,t.return,h)}}var _a=!1,qt=!1,hf=!1,ng=typeof WeakSet=="function"?WeakSet:Set,tn=null;function Vw(t,n){if(t=t.containerInfo,zf=Nc,t=Eu(t),rl(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var o=l.getSelection&&l.getSelection();if(o&&o.rangeCount!==0){l=o.anchorNode;var f=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{l.nodeType,h.nodeType}catch{l=null;break e}var v=0,T=-1,L=-1,P=0,ee=0,re=t,X=null;t:for(;;){for(var Q;re!==l||f!==0&&re.nodeType!==3||(T=v+f),re!==h||o!==0&&re.nodeType!==3||(L=v+o),re.nodeType===3&&(v+=re.nodeValue.length),(Q=re.firstChild)!==null;)X=re,re=Q;for(;;){if(re===t)break t;if(X===l&&++P===f&&(T=v),X===h&&++ee===o&&(L=v),(Q=re.nextSibling)!==null)break;re=X,X=re.parentNode}re=Q}l=T===-1||L===-1?null:{start:T,end:L}}else l=null}l=l||{start:0,end:0}}else l=null;for(Lf={focusedElem:t,selectionRange:l},Nc=!1,tn=n;tn!==null;)if(n=tn,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,tn=t;else for(;tn!==null;){switch(n=tn,h=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)f=t[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&h!==null){t=void 0,l=n,f=h.memoizedProps,h=h.memoizedState,o=l.stateNode;try{var Te=fr(l.type,f);t=o.getSnapshotBeforeUpdate(Te,h),o.__reactInternalSnapshotBeforeUpdate=t}catch(Le){ut(l,l.return,Le)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,l=t.nodeType,l===9)Bf(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Bf(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 ig(t,n,l){var o=l.flags;switch(l.tag){case 0:case 11:case 15:Oa(t,l),o&4&&Eo(5,l);break;case 1:if(Oa(t,l),o&4)if(t=l.stateNode,n===null)try{t.componentDidMount()}catch(v){ut(l,l.return,v)}else{var f=fr(l.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(v){ut(l,l.return,v)}}o&64&&Qm(l),o&512&&Ao(l,l.return);break;case 3:if(Oa(t,l),o&64&&(t=l.updateQueue,t!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{Hh(t,n)}catch(v){ut(l,l.return,v)}}break;case 27:n===null&&o&4&&tg(l);case 26:case 5:Oa(t,l),n===null&&o&4&&Jm(l),o&512&&Ao(l,l.return);break;case 12:Oa(t,l);break;case 31:Oa(t,l),o&4&&rg(t,l);break;case 13:Oa(t,l),o&4&&sg(t,l),o&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=Jw.bind(null,l),bk(t,l))));break;case 22:if(o=l.memoizedState!==null||_a,!o){n=n!==null&&n.memoizedState!==null||qt,f=_a;var h=qt;_a=o,(qt=n)&&!h?za(t,l,(l.subtreeFlags&8772)!==0):Oa(t,l),_a=f,qt=h}break;case 30:break;default:Oa(t,l)}}function ag(t){var n=t.alternate;n!==null&&(t.alternate=null,ag(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Bl(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var kt=null,_n=!1;function Ma(t,n,l){for(l=l.child;l!==null;)lg(t,n,l),l=l.sibling}function lg(t,n,l){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(Kt,l)}catch{}switch(l.tag){case 26:qt||Qi(l,n),Ma(t,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:qt||Qi(l,n);var o=kt,f=_n;kl(l.type)&&(kt=l.stateNode,_n=!1),Ma(t,n,l),Io(l.stateNode),kt=o,_n=f;break;case 5:qt||Qi(l,n);case 6:if(o=kt,f=_n,kt=null,Ma(t,n,l),kt=o,_n=f,kt!==null)if(_n)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(l.stateNode)}catch(h){ut(l,n,h)}else try{kt.removeChild(l.stateNode)}catch(h){ut(l,n,h)}break;case 18:kt!==null&&(_n?(t=kt,Qg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),ws(t)):Qg(kt,l.stateNode));break;case 4:o=kt,f=_n,kt=l.stateNode.containerInfo,_n=!0,Ma(t,n,l),kt=o,_n=f;break;case 0:case 11:case 14:case 15:ml(2,l,n),qt||ml(4,l,n),Ma(t,n,l);break;case 1:qt||(Qi(l,n),o=l.stateNode,typeof o.componentWillUnmount=="function"&&Zm(l,n,o)),Ma(t,n,l);break;case 21:Ma(t,n,l);break;case 22:qt=(o=qt)||l.memoizedState!==null,Ma(t,n,l),qt=o;break;default:Ma(t,n,l)}}function rg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ws(t)}catch(l){ut(n,n.return,l)}}}function sg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ws(t)}catch(l){ut(n,n.return,l)}}function Fw(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new ng),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new ng),n;default:throw Error(r(435,t.tag))}}function uc(t,n){var l=Fw(t);n.forEach(function(o){if(!l.has(o)){l.add(o);var f=ek.bind(null,t,o);o.then(f,f)}})}function Mn(t,n){var l=n.deletions;if(l!==null)for(var o=0;o<l.length;o++){var f=l[o],h=t,v=n,T=v;e:for(;T!==null;){switch(T.tag){case 27:if(kl(T.type)){kt=T.stateNode,_n=!1;break e}break;case 5:kt=T.stateNode,_n=!1;break e;case 3:case 4:kt=T.stateNode.containerInfo,_n=!0;break e}T=T.return}if(kt===null)throw Error(r(160));lg(h,v,f),kt=null,_n=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)og(n,t),n=n.sibling}var Di=null;function og(t,n){var l=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Mn(n,t),On(t),o&4&&(ml(3,t,t.return),Eo(3,t),ml(5,t,t.return));break;case 1:Mn(n,t),On(t),o&512&&(qt||l===null||Qi(l,l.return)),o&64&&_a&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?o:l.concat(o))));break;case 26:var f=Di;if(Mn(n,t),On(t),o&512&&(qt||l===null||Qi(l,l.return)),o&4){var h=l!==null?l.memoizedState:null;if(o=t.memoizedState,l===null)if(o===null)if(t.stateNode===null){e:{o=t.type,l=t.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":h=f.getElementsByTagName("title")[0],(!h||h[ti]||h[Vt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(o),f.head.insertBefore(h,f.querySelector("head > title"))),un(h,o,l),h[Vt]=t,Nt(h),o=h;break e;case"link":var v=oy("link","href",f).get(o+(l.href||""));if(v){for(var T=0;T<v.length;T++)if(h=v[T],h.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&h.getAttribute("rel")===(l.rel==null?null:l.rel)&&h.getAttribute("title")===(l.title==null?null:l.title)&&h.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){v.splice(T,1);break t}}h=f.createElement(o),un(h,o,l),f.head.appendChild(h);break;case"meta":if(v=oy("meta","content",f).get(o+(l.content||""))){for(T=0;T<v.length;T++)if(h=v[T],h.getAttribute("content")===(l.content==null?null:""+l.content)&&h.getAttribute("name")===(l.name==null?null:l.name)&&h.getAttribute("property")===(l.property==null?null:l.property)&&h.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&h.getAttribute("charset")===(l.charSet==null?null:l.charSet)){v.splice(T,1);break t}}h=f.createElement(o),un(h,o,l),f.head.appendChild(h);break;default:throw Error(r(468,o))}h[Vt]=t,Nt(h),o=h}t.stateNode=o}else uy(f,t.type,t.stateNode);else t.stateNode=sy(f,o,t.memoizedProps);else h!==o?(h===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):h.count--,o===null?uy(f,t.type,t.stateNode):sy(f,o,t.memoizedProps)):o===null&&t.stateNode!==null&&df(t,t.memoizedProps,l.memoizedProps)}break;case 27:Mn(n,t),On(t),o&512&&(qt||l===null||Qi(l,l.return)),l!==null&&o&4&&df(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Mn(n,t),On(t),o&512&&(qt||l===null||Qi(l,l.return)),t.flags&32){f=t.stateNode;try{da(f,"")}catch(Te){ut(t,t.return,Te)}}o&4&&t.stateNode!=null&&(f=t.memoizedProps,df(t,f,l!==null?l.memoizedProps:f)),o&1024&&(hf=!0);break;case 6:if(Mn(n,t),On(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,l=t.stateNode;try{l.nodeValue=o}catch(Te){ut(t,t.return,Te)}}break;case 3:if(Cc=null,f=Di,Di=Sc(n.containerInfo),Mn(n,t),Di=f,On(t),o&4&&l!==null&&l.memoizedState.isDehydrated)try{ws(n.containerInfo)}catch(Te){ut(t,t.return,Te)}hf&&(hf=!1,ug(t));break;case 4:o=Di,Di=Sc(t.stateNode.containerInfo),Mn(n,t),On(t),Di=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,uc(t,o)));break;case 13:Mn(n,t),On(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(dc=Ct()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,uc(t,o)));break;case 22:f=t.memoizedState!==null;var L=l!==null&&l.memoizedState!==null,P=_a,ee=qt;if(_a=P||f,qt=ee||L,Mn(n,t),qt=ee,_a=P,On(t),o&8192)e:for(n=t.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(l===null||L||_a||qt||pr(t)),l=null,n=t;;){if(n.tag===5||n.tag===26){if(l===null){L=l=n;try{if(h=L.stateNode,f)v=h.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{T=L.stateNode;var re=L.memoizedProps.style,X=re!=null&&re.hasOwnProperty("display")?re.display:null;T.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(Te){ut(L,L.return,Te)}}}else if(n.tag===6){if(l===null){L=n;try{L.stateNode.nodeValue=f?"":L.memoizedProps}catch(Te){ut(L,L.return,Te)}}}else if(n.tag===18){if(l===null){L=n;try{var Q=L.stateNode;f?Zg(Q,!0):Zg(L.stateNode,!1)}catch(Te){ut(L,L.return,Te)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;l===n&&(l=null),n=n.return}l===n&&(l=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=t.updateQueue,o!==null&&(l=o.retryQueue,l!==null&&(o.retryQueue=null,uc(t,l))));break;case 19:Mn(n,t),On(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,uc(t,o)));break;case 30:break;case 21:break;default:Mn(n,t),On(t)}}function On(t){var n=t.flags;if(n&2){try{for(var l,o=t.return;o!==null;){if(eg(o)){l=o;break}o=o.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var f=l.stateNode,h=ff(t);oc(t,h,f);break;case 5:var v=l.stateNode;l.flags&32&&(da(v,""),l.flags&=-33);var T=ff(t);oc(t,T,v);break;case 3:case 4:var L=l.stateNode.containerInfo,P=ff(t);pf(t,P,L);break;default:throw Error(r(161))}}catch(ee){ut(t,t.return,ee)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function ug(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;ug(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Oa(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)ig(t,n.alternate,n),n=n.sibling}function pr(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:ml(4,n,n.return),pr(n);break;case 1:Qi(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&Zm(n,n.return,l),pr(n);break;case 27:Io(n.stateNode);case 26:case 5:Qi(n,n.return),pr(n);break;case 22:n.memoizedState===null&&pr(n);break;case 30:pr(n);break;default:pr(n)}t=t.sibling}}function za(t,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,f=t,h=n,v=h.flags;switch(h.tag){case 0:case 11:case 15:za(f,h,l),Eo(4,h);break;case 1:if(za(f,h,l),o=h,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(P){ut(o,o.return,P)}if(o=h,f=o.updateQueue,f!==null){var T=o.stateNode;try{var L=f.shared.hiddenCallbacks;if(L!==null)for(f.shared.hiddenCallbacks=null,f=0;f<L.length;f++)qh(L[f],T)}catch(P){ut(o,o.return,P)}}l&&v&64&&Qm(h),Ao(h,h.return);break;case 27:tg(h);case 26:case 5:za(f,h,l),l&&o===null&&v&4&&Jm(h),Ao(h,h.return);break;case 12:za(f,h,l);break;case 31:za(f,h,l),l&&v&4&&rg(f,h);break;case 13:za(f,h,l),l&&v&4&&sg(f,h);break;case 22:h.memoizedState===null&&za(f,h,l),Ao(h,h.return);break;case 30:break;default:za(f,h,l)}n=n.sibling}}function mf(t,n){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Ti(l))}function gf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Ti(t))}function Ri(t,n,l,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)cg(t,n,l,o),n=n.sibling}function cg(t,n,l,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:Ri(t,n,l,o),f&2048&&Eo(9,n);break;case 1:Ri(t,n,l,o);break;case 3:Ri(t,n,l,o),f&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Ti(t)));break;case 12:if(f&2048){Ri(t,n,l,o),t=n.stateNode;try{var h=n.memoizedProps,v=h.id,T=h.onPostCommit;typeof T=="function"&&T(v,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(L){ut(n,n.return,L)}}else Ri(t,n,l,o);break;case 31:Ri(t,n,l,o);break;case 13:Ri(t,n,l,o);break;case 23:break;case 22:h=n.stateNode,v=n.alternate,n.memoizedState!==null?h._visibility&2?Ri(t,n,l,o):No(t,n):h._visibility&2?Ri(t,n,l,o):(h._visibility|=2,cs(t,n,l,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&mf(v,n);break;case 24:Ri(t,n,l,o),f&2048&&gf(n.alternate,n);break;default:Ri(t,n,l,o)}}function cs(t,n,l,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=t,v=n,T=l,L=o,P=v.flags;switch(v.tag){case 0:case 11:case 15:cs(h,v,T,L,f),Eo(8,v);break;case 23:break;case 22:var ee=v.stateNode;v.memoizedState!==null?ee._visibility&2?cs(h,v,T,L,f):No(h,v):(ee._visibility|=2,cs(h,v,T,L,f)),f&&P&2048&&mf(v.alternate,v);break;case 24:cs(h,v,T,L,f),f&&P&2048&&gf(v.alternate,v);break;default:cs(h,v,T,L,f)}n=n.sibling}}function No(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=t,o=n,f=o.flags;switch(o.tag){case 22:No(l,o),f&2048&&mf(o.alternate,o);break;case 24:No(l,o),f&2048&&gf(o.alternate,o);break;default:No(l,o)}n=n.sibling}}var Do=8192;function ds(t,n,l){if(t.subtreeFlags&Do)for(t=t.child;t!==null;)dg(t,n,l),t=t.sibling}function dg(t,n,l){switch(t.tag){case 26:ds(t,n,l),t.flags&Do&&t.memoizedState!==null&&Rk(l,Di,t.memoizedState,t.memoizedProps);break;case 5:ds(t,n,l);break;case 3:case 4:var o=Di;Di=Sc(t.stateNode.containerInfo),ds(t,n,l),Di=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Do,Do=16777216,ds(t,n,l),Do=o):ds(t,n,l));break;default:ds(t,n,l)}}function fg(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 Ro(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];tn=o,hg(o,t)}fg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)pg(t),t=t.sibling}function pg(t){switch(t.tag){case 0:case 11:case 15:Ro(t),t.flags&2048&&ml(9,t,t.return);break;case 3:Ro(t);break;case 12:Ro(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,cc(t)):Ro(t);break;default:Ro(t)}}function cc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];tn=o,hg(o,t)}fg(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:ml(8,n,n.return),cc(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,cc(n));break;default:cc(n)}t=t.sibling}}function hg(t,n){for(;tn!==null;){var l=tn;switch(l.tag){case 0:case 11:case 15:ml(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var o=l.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Ti(l.memoizedState.cache)}if(o=l.child,o!==null)o.return=l,tn=o;else e:for(l=t;tn!==null;){o=tn;var f=o.sibling,h=o.return;if(ag(o),o===l){tn=null;break e}if(f!==null){f.return=h,tn=f;break e}tn=h}}}var Yw={getCacheForType:function(t){var n=Pt(Dt),l=n.data.get(t);return l===void 0&&(l=t(),n.data.set(t,l)),l},cacheSignal:function(){return Pt(Dt).controller.signal}},Pw=typeof WeakMap=="function"?WeakMap:Map,lt=0,yt=null,Ye=null,Qe=0,ot=0,Wn=null,gl=!1,fs=!1,yf=!1,La=0,_t=0,yl=0,hr=0,xf=0,Kn=0,ps=0,_o=null,zn=null,bf=!1,dc=0,mg=0,fc=1/0,pc=null,xl=null,Wt=0,bl=null,hs=null,Ia=0,vf=0,wf=null,gg=null,Mo=0,kf=null;function Xn(){return(lt&2)!==0&&Qe!==0?Qe&-Qe:V.T!==null?Af():Ls()}function yg(){if(Kn===0)if((Qe&536870912)===0||Fe){var t=Er;Er<<=1,(Er&3932160)===0&&(Er=262144),Kn=t}else Kn=536870912;return t=Yn.current,t!==null&&(t.flags|=32),Kn}function Ln(t,n,l){(t===yt&&(ot===2||ot===9)||t.cancelPendingCommit!==null)&&(ms(t,0),vl(t,Qe,Kn,!1)),ct(t,l),((lt&2)===0||t!==yt)&&(t===yt&&((lt&2)===0&&(hr|=l),_t===4&&vl(t,Qe,Kn,!1)),Zi(t))}function xg(t,n,l){if((lt&6)!==0)throw Error(r(327));var o=!l&&(n&127)===0&&(n&t.expiredLanes)===0||Ha(t,n),f=o?Xw(t,n):jf(t,n,!0),h=o;do{if(f===0){fs&&!o&&vl(t,n,0,!1);break}else{if(l=t.current.alternate,h&&!Ww(l)){f=jf(t,n,!1),h=!1;continue}if(f===2){if(h=n,t.errorRecoveryDisabledLanes&h)var v=0;else v=t.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var T=t;f=_o;var L=T.current.memoizedState.isDehydrated;if(L&&(ms(T,v).flags|=256),v=jf(T,v,!1),v!==2){if(yf&&!L){T.errorRecoveryDisabledLanes|=h,hr|=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){ms(t,0),vl(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:vl(o,n,Kn,!gl);break e;case 2:zn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=dc+300-Ct(),10<f)){if(vl(o,n,Kn,!gl),Il(o,0,!0)!==0)break e;Ia=n,o.timeoutHandle=Kg(bg.bind(null,o,l,zn,pc,bf,n,Kn,hr,ps,gl,h,"Throttled",-0,0),f);break e}bg(o,l,zn,pc,bf,n,Kn,hr,ps,gl,h,null,-0,0)}}break}while(!0);Zi(t)}function bg(t,n,l,o,f,h,v,T,L,P,ee,re,X,Q){if(t.timeoutHandle=-1,re=n.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Cn},dg(n,h,re);var Te=(h&62914560)===h?dc-Ct():(h&4194048)===h?mg-Ct():0;if(Te=_k(re,Te),Te!==null){Ia=h,t.cancelPendingCommit=Te(Eg.bind(null,t,n,h,l,o,f,v,T,L,ee,re,null,X,Q)),vl(t,h,v,!P);return}}Eg(t,n,h,l,o,f,v,T,L)}function Ww(t){for(var n=t;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var o=0;o<l.length;o++){var f=l[o],h=f.getSnapshot;f=f.value;try{if(!Jt(h(),f))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function vl(t,n,l,o){n&=~xf,n&=~hr,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var f=n;0<f;){var h=31-rt(f),v=1<<h;o[h]=-1,f&=~v}l!==0&&Ms(t,l,n)}function hc(){return(lt&6)===0?(Oo(0),!1):!0}function Sf(){if(Ye!==null){if(ot===0)var t=Ye.return;else t=Ye,Dn=ja=null,Ud(t),k=null,j=0,t=Ye;for(;t!==null;)Xm(t.alternate,t),t=t.return;Ye=null}}function ms(t,n){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,hk(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Ia=0,Sf(),yt=t,Ye=l=rn(t.current,null),Qe=n,ot=0,Wn=null,gl=!1,fs=Ha(t,n),yf=!1,ps=Kn=xf=hr=yl=_t=0,zn=_o=null,bf=!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 La=n,Kr(),l}function vg(t,n){He=null,V.H=jo,n===fl||n===as?(n=yo(),ot=3):n===cr?(n=yo(),ot=4):ot=n===ef?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Wn=n,Ye===null&&(_t=1,ic(t,yn(n,t.current)))}function wg(){var t=Yn.current;return t===null?!0:(Qe&4194048)===Qe?pi===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?t===pi:!1}function kg(){var t=V.H;return V.H=jo,t===null?jo:t}function Sg(){var t=V.A;return V.A=Yw,t}function mc(){_t=4,gl||(Qe&4194048)!==Qe&&Yn.current!==null||(fs=!0),(yl&134217727)===0&&(hr&134217727)===0||yt===null||vl(yt,Qe,Kn,!1)}function jf(t,n,l){var o=lt;lt|=2;var f=kg(),h=Sg();(yt!==t||Qe!==n)&&(pc=null,ms(t,n)),n=!1;var v=_t;e:do try{if(ot!==0&&Ye!==null){var T=Ye,L=Wn;switch(ot){case 8:Sf(),v=6;break e;case 3:case 2:case 9:case 6:Yn.current===null&&(n=!0);var P=ot;if(ot=0,Wn=null,gs(t,T,L,P),l&&fs){v=0;break e}break;default:P=ot,ot=0,Wn=null,gs(t,T,L,P)}}Kw(),v=_t;break}catch(ee){vg(t,ee)}while(!0);return n&&t.shellSuspendCounter++,Dn=ja=null,lt=o,V.H=f,V.A=h,Ye===null&&(yt=null,Qe=0,Kr()),v}function Kw(){for(;Ye!==null;)jg(Ye)}function Xw(t,n){var l=lt;lt|=2;var o=kg(),f=Sg();yt!==t||Qe!==n?(pc=null,fc=Ct()+500,ms(t,n)):fs=Ha(t,n);e:do try{if(ot!==0&&Ye!==null){n=Ye;var h=Wn;t:switch(ot){case 1:ot=0,Wn=null,gs(t,n,h,1);break;case 2:case 9:if(Yu(h)){ot=0,Wn=null,Cg(n);break}n=function(){ot!==2&&ot!==9||yt!==t||(ot=7),Zi(t)},h.then(n,n);break e;case 3:ot=7;break e;case 4:ot=5;break e;case 7:Yu(h)?(ot=0,Wn=null,Cg(n)):(ot=0,Wn=null,gs(t,n,h,7));break;case 5:var v=null;switch(Ye.tag){case 26:v=Ye.memoizedState;case 5:case 27:var T=Ye;if(v?cy(v):T.stateNode.complete){ot=0,Wn=null;var L=T.sibling;if(L!==null)Ye=L;else{var P=T.return;P!==null?(Ye=P,gc(P)):Ye=null}break t}}ot=0,Wn=null,gs(t,n,h,5);break;case 6:ot=0,Wn=null,gs(t,n,h,6);break;case 8:Sf(),_t=6;break e;default:throw Error(r(462))}}Qw();break}catch(ee){vg(t,ee)}while(!0);return Dn=ja=null,V.H=o,V.A=f,lt=l,Ye!==null?0:(yt=null,Qe=0,Kr(),_t)}function Qw(){for(;Ye!==null&&!xi();)jg(Ye)}function jg(t){var n=Wm(t.alternate,t,La);t.memoizedProps=t.pendingProps,n===null?gc(t):Ye=n}function Cg(t){var n=t,l=n.alternate;switch(n.tag){case 15:case 0:n=$m(l,n,n.pendingProps,n.type,void 0,Qe);break;case 11:n=$m(l,n,n.pendingProps,n.type.render,n.ref,Qe);break;case 5:Ud(n);default:Xm(l,n),n=Ye=Iu(n,La),n=Wm(l,n,La)}t.memoizedProps=t.pendingProps,n===null?gc(t):Ye=n}function gs(t,n,l,o){Dn=ja=null,Ud(n),k=null,j=0;var f=n.return;try{if(Bw(t,f,n,l,Qe)){_t=1,ic(t,yn(l,t.current)),Ye=null;return}}catch(h){if(f!==null)throw Ye=f,h;_t=1,ic(t,yn(l,t.current)),Ye=null;return}n.flags&32768?(Fe||o===1?t=!0:fs||(Qe&536870912)!==0?t=!1:(gl=t=!0,(o===2||o===9||o===3||o===6)&&(o=Yn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Tg(n,t)):gc(n)}function gc(t){var n=t;do{if((n.flags&32768)!==0){Tg(n,gl);return}t=n.return;var l=$w(n.alternate,n,La);if(l!==null){Ye=l;return}if(n=n.sibling,n!==null){Ye=n;return}Ye=n=t}while(n!==null);_t===0&&(_t=5)}function Tg(t,n){do{var l=Gw(t.alternate,t);if(l!==null){l.flags&=32767,Ye=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(t=t.sibling,t!==null)){Ye=t;return}Ye=t=l}while(t!==null);_t=6,Ye=null}function Eg(t,n,l,o,f,h,v,T,L){t.cancelPendingCommit=null;do yc();while(Wt!==0);if((lt&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));if(h=n.lanes|n.childLanes,h|=lo,Ul(t,l,h,v,T,L),t===yt&&(Ye=yt=null,Qe=0),hs=n,bl=t,Ia=l,vf=h,wf=f,gg=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,tk(Ne,function(){return _g(),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=lt,lt|=4;try{Vw(t,n,l)}finally{lt=v,se.p=f,V.T=o}}Wt=1,Ag(),Ng(),Dg()}}function Ag(){if(Wt===1){Wt=0;var t=bl,n=hs,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=V.T,V.T=null;var o=se.p;se.p=2;var f=lt;lt|=4;try{og(n,t);var h=Lf,v=Eu(t.containerInfo),T=h.focusedElem,L=h.selectionRange;if(v!==T&&T&&T.ownerDocument&&Tu(T.ownerDocument.documentElement,T)){if(L!==null&&rl(T)){var P=L.start,ee=L.end;if(ee===void 0&&(ee=P),"selectionStart"in T)T.selectionStart=P,T.selectionEnd=Math.min(ee,T.value.length);else{var re=T.ownerDocument||document,X=re&&re.defaultView||window;if(X.getSelection){var Q=X.getSelection(),Te=T.textContent.length,Le=Math.min(L.start,Te),ht=L.end===void 0?Le:Math.min(L.end,Te);!Q.extend&&Le>ht&&(v=ht,ht=Le,Le=v);var G=Pr(T,Le),B=Pr(T,ht);if(G&&B&&(Q.rangeCount!==1||Q.anchorNode!==G.node||Q.anchorOffset!==G.offset||Q.focusNode!==B.node||Q.focusOffset!==B.offset)){var Y=re.createRange();Y.setStart(G.node,G.offset),Q.removeAllRanges(),Le>ht?(Q.addRange(Y),Q.extend(B.node,B.offset)):(Y.setEnd(B.node,B.offset),Q.addRange(Y))}}}}for(re=[],Q=T;Q=Q.parentNode;)Q.nodeType===1&&re.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<re.length;T++){var le=re[T];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Nc=!!zf,Lf=zf=null}finally{lt=f,se.p=o,V.T=l}}t.current=n,Wt=2}}function Ng(){if(Wt===2){Wt=0;var t=bl,n=hs,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=V.T,V.T=null;var o=se.p;se.p=2;var f=lt;lt|=4;try{ig(t,n.alternate,n)}finally{lt=f,se.p=o,V.T=l}}Wt=3}}function Dg(){if(Wt===4||Wt===3){Wt=0,zl();var t=bl,n=hs,l=Ia,o=gg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Wt=5:(Wt=0,hs=bl=null,Rg(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(xl=null),zs(l),n=n.stateNode,Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(Kt,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 T=o[v];h(T.value,{componentStack:T.stack})}}finally{V.T=n,se.p=f}}(Ia&3)!==0&&yc(),Zi(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===kf?Mo++:(Mo=0,kf=t):Mo=0,Oo(0)}}function Rg(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Ti(n)))}function yc(){return Ag(),Ng(),Dg(),_g()}function _g(){if(Wt!==5)return!1;var t=bl,n=vf;vf=0;var l=zs(Ia),o=V.T,f=se.p;try{se.p=32>l?32:l,V.T=null,l=wf,wf=null;var h=bl,v=Ia;if(Wt=0,hs=bl=null,Ia=0,(lt&6)!==0)throw Error(r(331));var T=lt;if(lt|=4,pg(h.current),cg(h,h.current,v,l),lt=T,Oo(0,!1),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(Kt,h)}catch{}return!0}finally{se.p=f,V.T=o,Rg(t,n)}}function Mg(t,n,l){n=yn(l,n),n=Jd(t.stateNode,n,2),t=Ni(t,n,2),t!==null&&(ct(t,2),Zi(t))}function ut(t,n,l){if(t.tag===3)Mg(t,t,l);else for(;n!==null;){if(n.tag===3){Mg(n,t,l);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(xl===null||!xl.has(o))){t=yn(l,t),l=Om(2),o=Ni(n,l,2),o!==null&&(zm(l,o,n,t),ct(o,2),Zi(o));break}}n=n.return}}function Cf(t,n,l){var o=t.pingCache;if(o===null){o=t.pingCache=new Pw;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(l)||(yf=!0,f.add(l),t=Zw.bind(null,t,n,l),n.then(t,t))}function Zw(t,n,l){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,yt===t&&(Qe&l)===l&&(_t===4||_t===3&&(Qe&62914560)===Qe&&300>Ct()-dc?(lt&2)===0&&ms(t,0):xf|=l,ps===Qe&&(ps=0)),Zi(t)}function Og(t,n){n===0&&(n=Sn()),t=ba(t,n),t!==null&&(ct(t,n),Zi(t))}function Jw(t){var n=t.memoizedState,l=0;n!==null&&(l=n.retryLane),Og(t,l)}function ek(t,n){var l=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(l=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(n),Og(t,l)}function tk(t,n){return $t(t,n)}var xc=null,ys=null,Tf=!1,bc=!1,Ef=!1,wl=0;function Zi(t){t!==ys&&t.next===null&&(ys===null?xc=ys=t:ys=ys.next=t),bc=!0,Tf||(Tf=!0,ik())}function Oo(t,n){if(!Ef&&bc){Ef=!0;do for(var l=!1,o=xc;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var v=o.suspendedLanes,T=o.pingedLanes;h=(1<<31-rt(42|t)+1)-1,h&=f&~(v&~T),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(l=!0,Ug(o,h))}else h=Qe,h=Il(o,o===yt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||Ha(o,h)||(l=!0,Ug(o,h));o=o.next}while(l);Ef=!1}}function nk(){zg()}function zg(){bc=Tf=!1;var t=0;wl!==0&&pk()&&(t=wl);for(var n=Ct(),l=null,o=xc;o!==null;){var f=o.next,h=Lg(o,n);h===0?(o.next=null,l===null?xc=f:l.next=f,f===null&&(ys=l)):(l=o,(t!==0||(h&3)!==0)&&(bc=!0)),o=f}Wt!==0&&Wt!==5||Oo(t),wl!==0&&(wl=0)}function Lg(t,n){for(var l=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0<h;){var v=31-rt(h),T=1<<v,L=f[v];L===-1?((T&l)===0||(T&o)!==0)&&(f[v]=_s(T,n)):L<=n&&(t.expiredLanes|=T),h&=~T}if(n=yt,l=Qe,l=Il(t,t===n?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,l===0||t===n&&(ot===2||ot===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&Mi(o),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||Ha(t,l)){if(n=l&-l,n===t.callbackPriority)return n;switch(o!==null&&Mi(o),zs(l)){case 2:case 8:l=de;break;case 32:l=Ne;break;case 268435456:l=Xe;break;default:l=Ne}return o=Ig.bind(null,t),l=$t(l,o),t.callbackPriority=n,t.callbackNode=l,n}return o!==null&&o!==null&&Mi(o),t.callbackPriority=2,t.callbackNode=null,2}function Ig(t,n){if(Wt!==0&&Wt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(yc()&&t.callbackNode!==l)return null;var o=Qe;return o=Il(t,t===yt?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(xg(t,o,n),Lg(t,Ct()),t.callbackNode!=null&&t.callbackNode===l?Ig.bind(null,t):null)}function Ug(t,n){if(yc())return null;xg(t,n,!0)}function ik(){mk(function(){(lt&6)!==0?$t(ne,nk):zg()})}function Af(){if(wl===0){var t=cl;t===0&&(t=Ll,Ll<<=1,(Ll&261888)===0&&(Ll=256)),wl=t}return wl}function Bg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Hl(""+t)}function qg(t,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,t.id&&l.setAttribute("form",t.id),n.parentNode.insertBefore(l,n),t=new FormData(t),l.parentNode.removeChild(l),t}function ak(t,n,l,o,f){if(n==="submit"&&l&&l.stateNode===f){var h=Bg((f[Qt]||null).action),v=o.submitter;v&&(n=(n=v[Qt]||null)?Bg(n.formAction):v.getAttribute("formAction"),n!==null&&(h=n,v=null));var T=new Vl("action","action",null,o,f);t.push({event:T,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(wl!==0){var L=v?qg(f,v):new FormData(f);Pd(l,{pending:!0,data:L,method:f.method,action:h},null,L)}}else typeof h=="function"&&(T.preventDefault(),L=v?qg(f,v):new FormData(f),Pd(l,{pending:!0,data:L,method:f.method,action:h},h,L))},currentTarget:f}]})}}for(var Nf=0;Nf<ao.length;Nf++){var Df=ao[Nf],lk=Df.toLowerCase(),rk=Df[0].toUpperCase()+Df.slice(1);Gn(lk,"on"+rk)}Gn(Du,"onAnimationEnd"),Gn(Ru,"onAnimationIteration"),Gn(_u,"onAnimationStart"),Gn("dblclick","onDoubleClick"),Gn("focusin","onFocus"),Gn("focusout","onBlur"),Gn(jd,"onTransitionRun"),Gn(Cd,"onTransitionStart"),Gn(Td,"onTransitionCancel"),Gn(Mu,"onTransitionEnd"),ua("onMouseEnter",["mouseout","mouseover"]),ua("onMouseLeave",["mouseout","mouseover"]),ua("onPointerEnter",["pointerout","pointerover"]),ua("onPointerLeave",["pointerout","pointerover"]),oa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),oa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),oa("onBeforeInput",["compositionend","keypress","textInput","paste"]),oa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),oa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),oa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zo="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(" "),sk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zo));function Hg(t,n){n=(n&4)!==0;for(var l=0;l<t.length;l++){var o=t[l],f=o.event;o=o.listeners;e:{var h=void 0;if(n)for(var v=o.length-1;0<=v;v--){var T=o[v],L=T.instance,P=T.currentTarget;if(T=T.listener,L!==h&&f.isPropagationStopped())break e;h=T,f.currentTarget=P;try{h(f)}catch(ee){Wr(ee)}f.currentTarget=null,h=L}else for(v=0;v<o.length;v++){if(T=o[v],L=T.instance,P=T.currentTarget,T=T.listener,L!==h&&f.isPropagationStopped())break e;h=T,f.currentTarget=P;try{h(f)}catch(ee){Wr(ee)}f.currentTarget=null,h=L}}}}function Pe(t,n){var l=n[ra];l===void 0&&(l=n[ra]=new Set);var o=t+"__bubble";l.has(o)||($g(n,t,2,!1),l.add(o))}function Rf(t,n,l){var o=0;n&&(o|=4),$g(l,t,o,n)}var vc="_reactListening"+Math.random().toString(36).slice(2);function _f(t){if(!t[vc]){t[vc]=!0,Nr.forEach(function(l){l!=="selectionchange"&&(sk.has(l)||Rf(l,!1,t),Rf(l,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[vc]||(n[vc]=!0,Rf("selectionchange",!1,n))}}function $g(t,n,l,o){switch(yy(n)){case 2:var f=zk;break;case 8:f=Lk;break;default:f=Pf}l=f.bind(null,n,l,t),f=void 0,!Hs||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),o?f!==void 0?t.addEventListener(n,l,{capture:!0,passive:f}):t.addEventListener(n,l,!0):f!==void 0?t.addEventListener(n,l,{passive:f}):t.addEventListener(n,l,!1)}function Mf(t,n,l,o,f){var h=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var T=o.stateNode.containerInfo;if(T===f)break;if(v===4)for(v=o.return;v!==null;){var L=v.tag;if((L===3||L===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;T!==null;){if(v=vi(T),v===null)return;if(L=v.tag,L===5||L===6||L===26||L===27){o=h=v;continue e}T=T.parentNode}}o=o.return}ku(function(){var P=h,ee=li(l),re=[];e:{var X=Ou.get(t);if(X!==void 0){var Q=Vl,Te=t;switch(t){case"keypress":if(ha(l)===0)break e;case"keydown":case"keyup":Q=Re;break;case"focusin":Te="focus",Q=Wa;break;case"focusout":Te="blur",Q=Wa;break;case"beforeblur":case"afterblur":Q=Wa;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=Fs;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=Wl;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=Ps;break;case Du:case Ru:case _u:Q=Ka;break;case Mu:Q=at;break;case"scroll":case"scrollend":Q=Vs;break;case"wheel":Q=$r;break;case"copy":case"cut":case"paste":Q=Hi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=$n;break;case"toggle":case"beforetoggle":Q=er}var Le=(n&4)!==0,ht=!Le&&(t==="scroll"||t==="scrollend"),G=Le?X!==null?X+"Capture":null:X;Le=[];for(var B=P,Y;B!==null;){var le=B;if(Y=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||Y===null||G===null||(le=pa(B,G),le!=null&&Le.push(Lo(B,le,Y))),ht)break;B=B.return}0<Le.length&&(X=new Q(X,Te,null,l,ee),re.push({event:X,listeners:Le}))}}if((n&7)===0){e:{if(X=t==="mouseover"||t==="pointerover",Q=t==="mouseout"||t==="pointerout",X&&l!==Tn&&(Te=l.relatedTarget||l.fromElement)&&(vi(Te)||Te[Ga]))break e;if((Q||X)&&(X=ee.window===ee?ee:(X=ee.ownerDocument)?X.defaultView||X.parentWindow:window,Q?(Te=l.relatedTarget||l.toElement,Q=P,Te=Te?vi(Te):null,Te!==null&&(ht=c(Te),Le=Te.tag,Te!==ht||Le!==5&&Le!==27&&Le!==6)&&(Te=null)):(Q=null,Te=P),Q!==Te)){if(Le=Fs,le="onMouseLeave",G="onMouseEnter",B="mouse",(t==="pointerout"||t==="pointerover")&&(Le=$n,le="onPointerLeave",G="onPointerEnter",B="pointer"),ht=Q==null?X:wi(Q),Y=Te==null?X:wi(Te),X=new Le(le,B+"leave",Q,l,ee),X.target=ht,X.relatedTarget=Y,le=null,vi(ee)===P&&(Le=new Le(G,B+"enter",Te,l,ee),Le.target=Y,Le.relatedTarget=ht,le=Le),ht=le,Q&&Te)t:{for(Le=ok,G=Q,B=Te,Y=0,le=G;le;le=Le(le))Y++;le=0;for(var _e=B;_e;_e=Le(_e))le++;for(;0<Y-le;)G=Le(G),Y--;for(;0<le-Y;)B=Le(B),le--;for(;Y--;){if(G===B||B!==null&&G===B.alternate){Le=G;break t}G=Le(G),B=Le(B)}Le=null}else Le=null;Q!==null&&Gg(re,X,Q,Le,!1),Te!==null&&ht!==null&&Gg(re,ht,Te,Le,!0)}}e:{if(X=P?wi(P):window,Q=X.nodeName&&X.nodeName.toLowerCase(),Q==="select"||Q==="input"&&X.type==="file")var nt=$i;else if(Cu(X))if(il)nt=kd;else{nt=wd;var De=Zs}else Q=X.nodeName,!Q||Q.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?P&&fa(P.elementType)&&(nt=$i):nt=ln;if(nt&&(nt=nt(t,P))){tl(re,nt,l,ee);break e}De&&De(t,X,P),t==="focusout"&&P&&X.type==="number"&&P.memoizedProps.value!=null&&qn(X,"number",X.value)}switch(De=P?wi(P):window,t){case"focusin":(Cu(De)||De.contentEditable==="true")&&(Gi=De,to=P,ya=null);break;case"focusout":ya=to=Gi=null;break;case"mousedown":no=!0;break;case"contextmenu":case"mouseup":case"dragend":no=!1,Au(re,l,ee);break;case"selectionchange":if(eo)break;case"keydown":case"keyup":Au(re,l,ee)}var Ge;if(Si)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 el?Vr(t,l)&&(Ze="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ze="onCompositionStart");Ze&&(Ja&&l.locale!=="ko"&&(el||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&el&&(Ge=Gs()):(qi=ee,$s="value"in qi?qi.value:qi.textContent,el=!0)),De=wc(P,Ze),0<De.length&&(Ze=new gn(Ze,t,null,l,ee),re.push({event:Ze,listeners:De}),Ge?Ze.data=Ge:(Ge=nr(l),Ge!==null&&(Ze.data=Ge)))),(Ge=bd?ju(t,l):Xs(t,l))&&(Ze=wc(P,"onBeforeInput"),0<Ze.length&&(De=new gn("onBeforeInput","beforeinput",null,l,ee),re.push({event:De,listeners:Ze}),De.data=Ge)),ak(re,t,P,l,ee)}Hg(re,n)})}function Lo(t,n,l){return{instance:t,listener:n,currentTarget:l}}function wc(t,n){for(var l=n+"Capture",o=[];t!==null;){var f=t,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=pa(t,l),f!=null&&o.unshift(Lo(t,f,h)),f=pa(t,n),f!=null&&o.push(Lo(t,f,h))),t.tag===3)return o;t=t.return}return[]}function ok(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Gg(t,n,l,o,f){for(var h=n._reactName,v=[];l!==null&&l!==o;){var T=l,L=T.alternate,P=T.stateNode;if(T=T.tag,L!==null&&L===o)break;T!==5&&T!==26&&T!==27||P===null||(L=P,f?(P=pa(l,h),P!=null&&v.unshift(Lo(l,P,L))):f||(P=pa(l,h),P!=null&&v.push(Lo(l,P,L)))),l=l.return}v.length!==0&&t.push({event:n,listeners:v})}var uk=/\r\n?/g,ck=/\u0000|\uFFFD/g;function Vg(t){return(typeof t=="string"?t:""+t).replace(uk,`
50
+ `).replace(ck,"")}function Fg(t,n){return n=Vg(n),Vg(t)===n}function pt(t,n,l,o,f,h){switch(l){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||da(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&da(t,""+o);break;case"className":ca(t,"class",o);break;case"tabIndex":ca(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":ca(t,l,o);break;case"style":ql(t,o,h);break;case"data":if(n!=="object"){ca(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||l!=="href")){t.removeAttribute(l);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(l);break}o=Hl(""+o),t.setAttribute(l,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(l==="formAction"?(n!=="input"&&pt(t,n,"name",f.name,f,null),pt(t,n,"formEncType",f.formEncType,f,null),pt(t,n,"formMethod",f.formMethod,f,null),pt(t,n,"formTarget",f.formTarget,f,null)):(pt(t,n,"encType",f.encType,f,null),pt(t,n,"method",f.method,f,null),pt(t,n,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(l);break}o=Hl(""+o),t.setAttribute(l,o);break;case"onClick":o!=null&&(t.onclick=Cn);break;case"onScroll":o!=null&&Pe("scroll",t);break;case"onScrollEnd":o!=null&&Pe("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}l=Hl(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,""+o):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":o===!0?t.setAttribute(l,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,o):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(l,o):t.removeAttribute(l);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(l):t.setAttribute(l,o);break;case"popover":Pe("beforetoggle",t),Pe("toggle",t),_r(t,"popover",o);break;case"xlinkActuate":ni(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":ni(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":ni(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":ni(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":ni(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":ni(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":ni(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":ni(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":ni(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":_r(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Bs.get(l)||l,_r(t,l,o))}}function Of(t,n,l,o,f,h){switch(l){case"style":ql(t,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"children":typeof o=="string"?da(t,o):(typeof o=="number"||typeof o=="bigint")&&da(t,""+o);break;case"onScroll":o!=null&&Pe("scroll",t);break;case"onScrollEnd":o!=null&&Pe("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Cn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Dr.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),n=l.slice(2,f?l.length-7:void 0),h=t[Qt]||null,h=h!=null?h[l]:null,typeof h=="function"&&t.removeEventListener(n,h,f),typeof o=="function")){typeof h!="function"&&h!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(n,o,f);break e}l in t?t[l]=o:o===!0?t.setAttribute(l,""):_r(t,l,o)}}}function un(t,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",t),Pe("load",t);var o=!1,f=!1,h;for(h in l)if(l.hasOwnProperty(h)){var v=l[h];if(v!=null)switch(h){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:pt(t,n,h,v,l,null)}}f&&pt(t,n,"srcSet",l.srcSet,l,null),o&&pt(t,n,"src",l.src,l,null);return;case"input":Pe("invalid",t);var T=h=v=f=null,L=null,P=null;for(o in l)if(l.hasOwnProperty(o)){var ee=l[o];if(ee!=null)switch(o){case"name":f=ee;break;case"type":v=ee;break;case"checked":L=ee;break;case"defaultChecked":P=ee;break;case"value":h=ee;break;case"defaultValue":T=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(r(137,n));break;default:pt(t,n,o,ee,l,null)}}ai(t,h,T,L,P,v,f,!1);return;case"select":Pe("invalid",t),o=v=h=null;for(f in l)if(l.hasOwnProperty(f)&&(T=l[f],T!=null))switch(f){case"value":h=T;break;case"defaultValue":v=T;break;case"multiple":o=T;default:pt(t,n,f,T,l,null)}n=h,l=v,t.multiple=!!o,n!=null?jn(t,!!o,n,!1):l!=null&&jn(t,!!o,l,!0);return;case"textarea":Pe("invalid",t),h=f=o=null;for(v in l)if(l.hasOwnProperty(v)&&(T=l[v],T!=null))switch(v){case"value":o=T;break;case"defaultValue":f=T;break;case"children":h=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:pt(t,n,v,T,l,null)}Pa(t,o,f,h);return;case"option":for(L in l)if(l.hasOwnProperty(L)&&(o=l[L],o!=null))switch(L){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:pt(t,n,L,o,l,null)}return;case"dialog":Pe("beforetoggle",t),Pe("toggle",t),Pe("cancel",t),Pe("close",t);break;case"iframe":case"object":Pe("load",t);break;case"video":case"audio":for(o=0;o<zo.length;o++)Pe(zo[o],t);break;case"image":Pe("error",t),Pe("load",t);break;case"details":Pe("toggle",t);break;case"embed":case"source":case"link":Pe("error",t),Pe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(P in l)if(l.hasOwnProperty(P)&&(o=l[P],o!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:pt(t,n,P,o,l,null)}return;default:if(fa(n)){for(ee in l)l.hasOwnProperty(ee)&&(o=l[ee],o!==void 0&&Of(t,n,ee,o,l,void 0));return}}for(T in l)l.hasOwnProperty(T)&&(o=l[T],o!=null&&pt(t,n,T,o,l,null))}function dk(t,n,l,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,v=null,T=null,L=null,P=null,ee=null;for(Q in l){var re=l[Q];if(l.hasOwnProperty(Q)&&re!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":L=re;default:o.hasOwnProperty(Q)||pt(t,n,Q,null,o,re)}}for(var X in o){var Q=o[X];if(re=l[X],o.hasOwnProperty(X)&&(Q!=null||re!=null))switch(X){case"type":h=Q;break;case"name":f=Q;break;case"checked":P=Q;break;case"defaultChecked":ee=Q;break;case"value":v=Q;break;case"defaultValue":T=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,n));break;default:Q!==re&&pt(t,n,X,Q,o,re)}}Or(t,v,T,L,P,ee,h,f);return;case"select":Q=v=T=X=null;for(h in l)if(L=l[h],l.hasOwnProperty(h)&&L!=null)switch(h){case"value":break;case"multiple":Q=L;default:o.hasOwnProperty(h)||pt(t,n,h,null,o,L)}for(f in o)if(h=o[f],L=l[f],o.hasOwnProperty(f)&&(h!=null||L!=null))switch(f){case"value":X=h;break;case"defaultValue":T=h;break;case"multiple":v=h;default:h!==L&&pt(t,n,f,h,o,L)}n=T,l=v,o=Q,X!=null?jn(t,!!l,X,!1):!!o!=!!l&&(n!=null?jn(t,!!l,n,!0):jn(t,!!l,l?[]:"",!1));return;case"textarea":Q=X=null;for(T in l)if(f=l[T],l.hasOwnProperty(T)&&f!=null&&!o.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:pt(t,n,T,null,o,f)}for(v in o)if(f=o[v],h=l[v],o.hasOwnProperty(v)&&(f!=null||h!=null))switch(v){case"value":X=f;break;case"defaultValue":Q=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==h&&pt(t,n,v,f,o,h)}Us(t,X,Q);return;case"option":for(var Te in l)if(X=l[Te],l.hasOwnProperty(Te)&&X!=null&&!o.hasOwnProperty(Te))switch(Te){case"selected":t.selected=!1;break;default:pt(t,n,Te,null,o,X)}for(L in o)if(X=o[L],Q=l[L],o.hasOwnProperty(L)&&X!==Q&&(X!=null||Q!=null))switch(L){case"selected":t.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:pt(t,n,L,X,o,Q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Le in l)X=l[Le],l.hasOwnProperty(Le)&&X!=null&&!o.hasOwnProperty(Le)&&pt(t,n,Le,null,o,X);for(P in o)if(X=o[P],Q=l[P],o.hasOwnProperty(P)&&X!==Q&&(X!=null||Q!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(137,n));break;default:pt(t,n,P,X,o,Q)}return;default:if(fa(n)){for(var ht in l)X=l[ht],l.hasOwnProperty(ht)&&X!==void 0&&!o.hasOwnProperty(ht)&&Of(t,n,ht,void 0,o,X);for(ee in o)X=o[ee],Q=l[ee],!o.hasOwnProperty(ee)||X===Q||X===void 0&&Q===void 0||Of(t,n,ee,X,o,Q);return}}for(var G in l)X=l[G],l.hasOwnProperty(G)&&X!=null&&!o.hasOwnProperty(G)&&pt(t,n,G,null,o,X);for(re in o)X=o[re],Q=l[re],!o.hasOwnProperty(re)||X===Q||X==null&&Q==null||pt(t,n,re,X,o,Q)}function Yg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function fk(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,l=performance.getEntriesByType("resource"),o=0;o<l.length;o++){var f=l[o],h=f.transferSize,v=f.initiatorType,T=f.duration;if(h&&T&&Yg(v)){for(v=0,T=f.responseEnd,o+=1;o<l.length;o++){var L=l[o],P=L.startTime;if(P>T)break;var ee=L.transferSize,re=L.initiatorType;ee&&Yg(re)&&(L=L.responseEnd,v+=ee*(L<T?1:(T-P)/(L-P)))}if(--o,n+=8*(h+v)/(f.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var zf=null,Lf=null;function kc(t){return t.nodeType===9?t:t.ownerDocument}function Pg(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 Wg(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 If(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 Uf=null;function pk(){var t=window.event;return t&&t.type==="popstate"?t===Uf?!1:(Uf=t,!0):(Uf=null,!1)}var Kg=typeof setTimeout=="function"?setTimeout:void 0,hk=typeof clearTimeout=="function"?clearTimeout:void 0,Xg=typeof Promise=="function"?Promise:void 0,mk=typeof queueMicrotask=="function"?queueMicrotask:typeof Xg<"u"?function(t){return Xg.resolve(null).then(t).catch(gk)}:Kg;function gk(t){setTimeout(function(){throw t})}function kl(t){return t==="head"}function Qg(t,n){var l=n,o=0;do{var f=l.nextSibling;if(t.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(o===0){t.removeChild(f),ws(n);return}o--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")o++;else if(l==="html")Io(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,Io(l);for(var h=l.firstChild;h;){var v=h.nextSibling,T=h.nodeName;h[ti]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&h.rel.toLowerCase()==="stylesheet"||l.removeChild(h),h=v}}else l==="body"&&Io(t.ownerDocument.body);l=f}while(l);ws(n)}function Zg(t,n){var l=t;t=0;do{var o=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),o&&o.nodeType===8)if(l=o.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=o}while(l)}function Bf(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Bf(l),Bl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function yk(t,n,l,o){for(;t.nodeType===1;){var f=l;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[ti])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=hi(t.nextSibling),t===null)break}return null}function xk(t,n,l){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=hi(t.nextSibling),t===null))return null;return t}function Jg(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=hi(t.nextSibling),t===null))return null;return t}function qf(t){return t.data==="$?"||t.data==="$~"}function Hf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function bk(t,n){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||l.readyState!=="loading")n();else{var o=function(){n(),l.removeEventListener("DOMContentLoaded",o)};l.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function hi(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 ey(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(n===0)return hi(t.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}t=t.nextSibling}return null}function ty(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return t;n--}else l!=="/$"&&l!=="/&"||n++}t=t.previousSibling}return null}function ny(t,n,l){switch(n=kc(l),t){case"html":if(t=n.documentElement,!t)throw Error(r(452));return t;case"head":if(t=n.head,!t)throw Error(r(453));return t;case"body":if(t=n.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function Io(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Bl(t)}var mi=new Map,iy=new Set;function Sc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ua=se.d;se.d={f:vk,r:wk,D:kk,C:Sk,L:jk,m:Ck,X:Ek,S:Tk,M:Ak};function vk(){var t=Ua.f(),n=hc();return t||n}function wk(t){var n=Ya(t);n!==null&&n.tag===5&&n.type==="form"?vm(n):Ua.r(t)}var xs=typeof document>"u"?null:document;function ay(t,n,l){var o=xs;if(o&&typeof n=="string"&&n){var f=Zt(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),iy.has(f)||(iy.add(f),t={rel:t,crossOrigin:l,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),un(n,"link",t),Nt(n),o.head.appendChild(n)))}}function kk(t){Ua.D(t),ay("dns-prefetch",t,null)}function Sk(t,n){Ua.C(t,n),ay("preconnect",t,n)}function jk(t,n,l){Ua.L(t,n,l);var o=xs;if(o&&t&&n){var f='link[rel="preload"][as="'+Zt(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Zt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Zt(l.imageSizes)+'"]')):f+='[href="'+Zt(t)+'"]';var h=f;switch(n){case"style":h=bs(t);break;case"script":h=vs(t)}mi.has(h)||(t=x({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:t,as:n},l),mi.set(h,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(Uo(h))||n==="script"&&o.querySelector(Bo(h))||(n=o.createElement("link"),un(n,"link",t),Nt(n),o.head.appendChild(n)))}}function Ck(t,n){Ua.m(t,n);var l=xs;if(l&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Zt(o)+'"][href="'+Zt(t)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=vs(t)}if(!mi.has(h)&&(t=x({rel:"modulepreload",href:t},n),mi.set(h,t),l.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Bo(h)))return}o=l.createElement("link"),un(o,"link",t),Nt(o),l.head.appendChild(o)}}}function Tk(t,n,l){Ua.S(t,n,l);var o=xs;if(o&&t){var f=zi(o).hoistableStyles,h=bs(t);n=n||"default";var v=f.get(h);if(!v){var T={loading:0,preload:null};if(v=o.querySelector(Uo(h)))T.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":n},l),(l=mi.get(h))&&Gf(t,l);var L=v=o.createElement("link");Nt(L),un(L,"link",t),L._p=new Promise(function(P,ee){L.onload=P,L.onerror=ee}),L.addEventListener("load",function(){T.loading|=1}),L.addEventListener("error",function(){T.loading|=2}),T.loading|=4,jc(v,n,o)}v={type:"stylesheet",instance:v,count:1,state:T},f.set(h,v)}}}function Ek(t,n){Ua.X(t,n);var l=xs;if(l&&t){var o=zi(l).hoistableScripts,f=vs(t),h=o.get(f);h||(h=l.querySelector(Bo(f)),h||(t=x({src:t,async:!0},n),(n=mi.get(f))&&Vf(t,n),h=l.createElement("script"),Nt(h),un(h,"link",t),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function Ak(t,n){Ua.M(t,n);var l=xs;if(l&&t){var o=zi(l).hoistableScripts,f=vs(t),h=o.get(f);h||(h=l.querySelector(Bo(f)),h||(t=x({src:t,async:!0,type:"module"},n),(n=mi.get(f))&&Vf(t,n),h=l.createElement("script"),Nt(h),un(h,"link",t),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function ly(t,n,l,o){var f=(f=ge.current)?Sc(f):null;if(!f)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(n=bs(l.href),l=zi(f).hoistableStyles,o=l.get(n),o||(o={type:"style",instance:null,count:0,state:null},l.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=bs(l.href);var h=zi(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(Uo(t)))&&!h._p&&(v.instance=h,v.state.loading=5),mi.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},mi.set(t,l),h||Nk(f,t,l,v.state))),n&&o===null)throw Error(r(528,""));return v}if(n&&o!==null)throw Error(r(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=vs(l),l=zi(f).hoistableScripts,o=l.get(n),o||(o={type:"script",instance:null,count:0,state:null},l.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function bs(t){return'href="'+Zt(t)+'"'}function Uo(t){return'link[rel="stylesheet"]['+t+"]"}function ry(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function Nk(t,n,l,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),un(n,"link",l),Nt(n),t.head.appendChild(n))}function vs(t){return'[src="'+Zt(t)+'"]'}function Bo(t){return"script[async]"+t}function sy(t,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+Zt(l.href)+'"]');if(o)return n.instance=o,Nt(o),o;var f=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Nt(o),un(o,"style",f),jc(o,l.precedence,t),n.instance=o;case"stylesheet":f=bs(l.href);var h=t.querySelector(Uo(f));if(h)return n.state.loading|=4,n.instance=h,Nt(h),h;o=ry(l),(f=mi.get(f))&&Gf(o,f),h=(t.ownerDocument||t).createElement("link"),Nt(h);var v=h;return v._p=new Promise(function(T,L){v.onload=T,v.onerror=L}),un(h,"link",o),n.state.loading|=4,jc(h,l.precedence,t),n.instance=h;case"script":return h=vs(l.src),(f=t.querySelector(Bo(h)))?(n.instance=f,Nt(f),f):(o=l,(f=mi.get(h))&&(o=x({},l),Vf(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),Nt(f),un(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,jc(o,l.precedence,t));return n.instance}function jc(t,n,l){for(var o=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,h=f,v=0;v<o.length;v++){var T=o[v];if(T.dataset.precedence===n)h=T;else if(h!==f)break}h?h.parentNode.insertBefore(t,h.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(t,n.firstChild))}function Gf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Vf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Cc=null;function oy(t,n,l){if(Cc===null){var o=new Map,f=Cc=new Map;f.set(l,o)}else f=Cc,o=f.get(l),o||(o=new Map,f.set(l,o));if(o.has(t))return o;for(o.set(t,null),l=l.getElementsByTagName(t),f=0;f<l.length;f++){var h=l[f];if(!(h[ti]||h[Vt]||t==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var v=h.getAttribute(n)||"";v=t+v;var T=o.get(v);T?T.push(h):o.set(v,[h])}}return o}function uy(t,n,l){t=t.ownerDocument||t,t.head.insertBefore(l,n==="title"?t.querySelector("head > title"):null)}function Dk(t,n,l){if(l===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function cy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Rk(t,n,l,o){if(l.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=bs(o.href),h=n.querySelector(Uo(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Tc.bind(t),n.then(t,t)),l.state.loading|=4,l.instance=h,Nt(h);return}h=n.ownerDocument||n,o=ry(o),(f=mi.get(f))&&Gf(o,f),h=h.createElement("link"),Nt(h);var v=h;v._p=new Promise(function(T,L){v.onload=T,v.onerror=L}),un(h,"link",o),l.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Tc.bind(t),n.addEventListener("load",l),n.addEventListener("error",l))}}var Ff=0;function _k(t,n){return t.stylesheets&&t.count===0&&Ac(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var o=setTimeout(function(){if(t.stylesheets&&Ac(t,t.stylesheets),t.unsuspend){var h=t.unsuspend;t.unsuspend=null,h()}},6e4+n);0<t.imgBytes&&Ff===0&&(Ff=62500*fk());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ac(t,t.stylesheets),t.unsuspend)){var h=t.unsuspend;t.unsuspend=null,h()}},(t.imgBytes>Ff?50:800)+n);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function Tc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ac(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ec=null;function Ac(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ec=new Map,n.forEach(Mk,t),Ec=null,Tc.call(t))}function Mk(t,n){if(!(n.state.loading&4)){var l=Ec.get(t);if(l)var o=l.get(null);else{l=new Map,Ec.set(t,l);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var v=f[h];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(l.set(v.dataset.precedence,v),o=v)}o&&l.set(null,o)}f=n.instance,v=f.getAttribute("data-precedence"),h=l.get(v)||o,h===o&&l.set(null,f),l.set(v,f),this.count++,o=Tc.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 qo={$$typeof:q,Provider:null,Consumer:null,_currentValue:we,_currentValue2:we,_threadCount:0};function Ok(t,n,l,o,f,h,v,T,L){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Oi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oi(0),this.hiddenUpdates=Oi(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 dy(t,n,l,o,f,h,v,T,L,P,ee,re){return t=new Ok(t,n,l,v,L,P,ee,re,T),n=1,h===!0&&(n|=24),h=cn(3,null,null,n),t.current=h,h.stateNode=t,n=Ta(),n.refCount++,t.pooledCache=n,n.refCount++,h.memoizedState={element:o,isDehydrated:l,cache:n},dt(h),t}function fy(t){return t?(t=en,t):en}function py(t,n,l,o,f,h){f=fy(f),o.context===null?o.context=f:o.pendingContext=f,o=fi(n),o.payload={element:l},h=h===void 0?null:h,h!==null&&(o.callback=h),l=Ni(t,o,n),l!==null&&(Ln(l,t,n),xo(l,t,n))}function hy(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<n?l:n}}function Yf(t,n){hy(t,n),(t=t.alternate)&&hy(t,n)}function my(t){if(t.tag===13||t.tag===31){var n=ba(t,67108864);n!==null&&Ln(n,t,67108864),Yf(t,67108864)}}function gy(t){if(t.tag===13||t.tag===31){var n=Xn();n=la(n);var l=ba(t,n);l!==null&&Ln(l,t,n),Yf(t,n)}}var Nc=!0;function zk(t,n,l,o){var f=V.T;V.T=null;var h=se.p;try{se.p=2,Pf(t,n,l,o)}finally{se.p=h,V.T=f}}function Lk(t,n,l,o){var f=V.T;V.T=null;var h=se.p;try{se.p=8,Pf(t,n,l,o)}finally{se.p=h,V.T=f}}function Pf(t,n,l,o){if(Nc){var f=Wf(o);if(f===null)Mf(t,n,o,Dc,l),xy(t,o);else if(Uk(f,t,n,l,o))o.stopPropagation();else if(xy(t,o),n&4&&-1<Ik.indexOf(t)){for(;f!==null;){var h=Ya(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var v=aa(h.pendingLanes);if(v!==0){var T=h;for(T.pendingLanes|=2,T.entangledLanes|=2;v;){var L=1<<31-rt(v);T.entanglements[1]|=L,v&=~L}Zi(h),(lt&6)===0&&(fc=Ct()+500,Oo(0))}}break;case 31:case 13:T=ba(h,2),T!==null&&Ln(T,h,2),hc(),Yf(h,2)}if(h=Wf(o),h===null&&Mf(t,n,o,Dc,l),h===f)break;f=h}f!==null&&o.stopPropagation()}else Mf(t,n,o,null,l)}}function Wf(t){return t=li(t),Kf(t)}var Dc=null;function Kf(t){if(Dc=null,t=vi(t),t!==null){var n=c(t);if(n===null)t=null;else{var l=n.tag;if(l===13){if(t=d(n),t!==null)return t;t=null}else if(l===31){if(t=p(n),t!==null)return t;t=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Dc=t,null}function yy(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(ia()){case ne:return 2;case de:return 8;case Ne:case qe:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var Xf=!1,Sl=null,jl=null,Cl=null,Ho=new Map,$o=new Map,Tl=[],Ik="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 xy(t,n){switch(t){case"focusin":case"focusout":Sl=null;break;case"dragenter":case"dragleave":jl=null;break;case"mouseover":case"mouseout":Cl=null;break;case"pointerover":case"pointerout":Ho.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":$o.delete(n.pointerId)}}function Go(t,n,l,o,f,h){return t===null||t.nativeEvent!==h?(t={blockedOn:n,domEventName:l,eventSystemFlags:o,nativeEvent:h,targetContainers:[f]},n!==null&&(n=Ya(n),n!==null&&my(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function Uk(t,n,l,o,f){switch(n){case"focusin":return Sl=Go(Sl,t,n,l,o,f),!0;case"dragenter":return jl=Go(jl,t,n,l,o,f),!0;case"mouseover":return Cl=Go(Cl,t,n,l,o,f),!0;case"pointerover":var h=f.pointerId;return Ho.set(h,Go(Ho.get(h)||null,t,n,l,o,f)),!0;case"gotpointercapture":return h=f.pointerId,$o.set(h,Go($o.get(h)||null,t,n,l,o,f)),!0}return!1}function by(t){var n=vi(t.target);if(n!==null){var l=c(n);if(l!==null){if(n=l.tag,n===13){if(n=d(l),n!==null){t.blockedOn=n,xu(t.priority,function(){gy(l)});return}}else if(n===31){if(n=p(l),n!==null){t.blockedOn=n,xu(t.priority,function(){gy(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Rc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var l=Wf(t.nativeEvent);if(l===null){l=t.nativeEvent;var o=new l.constructor(l.type,l);Tn=o,l.target.dispatchEvent(o),Tn=null}else return n=Ya(l),n!==null&&my(n),t.blockedOn=l,!1;n.shift()}return!0}function vy(t,n,l){Rc(t)&&l.delete(n)}function Bk(){Xf=!1,Sl!==null&&Rc(Sl)&&(Sl=null),jl!==null&&Rc(jl)&&(jl=null),Cl!==null&&Rc(Cl)&&(Cl=null),Ho.forEach(vy),$o.forEach(vy)}function _c(t,n){t.blockedOn===n&&(t.blockedOn=null,Xf||(Xf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Bk)))}var Mc=null;function wy(t){Mc!==t&&(Mc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Mc===t&&(Mc=null);for(var n=0;n<t.length;n+=3){var l=t[n],o=t[n+1],f=t[n+2];if(typeof o!="function"){if(Kf(o||l)===null)continue;break}var h=Ya(l);h!==null&&(t.splice(n,3),n-=3,Pd(h,{pending:!0,data:f,method:l.method,action:o},o,f))}}))}function ws(t){function n(L){return _c(L,t)}Sl!==null&&_c(Sl,t),jl!==null&&_c(jl,t),Cl!==null&&_c(Cl,t),Ho.forEach(n),$o.forEach(n);for(var l=0;l<Tl.length;l++){var o=Tl[l];o.blockedOn===t&&(o.blockedOn=null)}for(;0<Tl.length&&(l=Tl[0],l.blockedOn===null);)by(l),l.blockedOn===null&&Tl.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(o=0;o<l.length;o+=3){var f=l[o],h=l[o+1],v=f[Qt]||null;if(typeof h=="function")v||wy(l);else if(v){var T=null;if(h&&h.hasAttribute("formAction")){if(f=h,v=h[Qt]||null)T=v.formAction;else if(Kf(f)!==null)continue}else T=v.action;typeof T=="function"?l[o+1]=T:(l.splice(o,3),o-=3),wy(l)}}}function ky(){function t(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),o||setTimeout(l,20)}function l(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Qf(t){this._internalRoot=t}Oc.prototype.render=Qf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var l=n.current,o=Xn();py(l,o,t,n,null,null)},Oc.prototype.unmount=Qf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;py(t.current,2,null,t,null,null),hc(),n[Ga]=null}};function Oc(t){this._internalRoot=t}Oc.prototype.unstable_scheduleHydration=function(t){if(t){var n=Ls();t={blockedOn:null,target:t,priority:n};for(var l=0;l<Tl.length&&n!==0&&n<Tl[l].priority;l++);Tl.splice(l,0,t),l===0&&by(t)}};var Sy=i.version;if(Sy!=="19.2.7")throw Error(r(527,Sy,"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 qk={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zc.isDisabled&&zc.supportsFiber)try{Kt=zc.inject(qk),Et=zc}catch{}}return Fo.createRoot=function(t,n){if(!u(t))throw Error(r(299));var l=!1,o="",f=Dm,h=Rm,v=_m;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=dy(t,1,!1,null,null,l,o,null,f,h,v,ky),t[Ga]=n.current,_f(t),new Qf(n)},Fo.hydrateRoot=function(t,n,l){if(!u(t))throw Error(r(299));var o=!1,f="",h=Dm,v=Rm,T=_m,L=null;return l!=null&&(l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(h=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(T=l.onRecoverableError),l.formState!==void 0&&(L=l.formState)),n=dy(t,1,!0,n,l??null,o,f,L,h,v,T,ky),n.context=fy(null),l=n.current,o=Xn(),o=la(o),f=fi(o),f.callback=null,Ni(l,f,o),l=o,n.current.lanes=l,ct(n,l),Zi(n),t[Ga]=n.current,_f(t),new Oc(n)},Fo.version="19.2.7",Fo}var Oy;function eS(){if(Oy)return ep.exports;Oy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),ep.exports=Jk(),ep.exports}var tS=eS();function nS(e,i){const a=i||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const iS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,aS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lS={};function zy(e,i){return(lS.jsx?aS:iS).test(e)}const rS=/[ \t\n\f\r]/g;function sS(e){return typeof e=="object"?e.type==="text"?Ly(e.value):!1:Ly(e)}function Ly(e){return e.replace(rS,"")===""}class mu{constructor(i,a,r){this.normal=a,this.property=i,r&&(this.space=r)}}mu.prototype.normal={};mu.prototype.property={};mu.prototype.space=void 0;function Cb(e,i){const a={},r={};for(const u of e)Object.assign(a,u.property),Object.assign(r,u.normal);return new mu(a,r,i)}function Up(e){return e.toLowerCase()}class Bn{constructor(i,a){this.attribute=a,this.property=i}}Bn.prototype.attribute="";Bn.prototype.booleanish=!1;Bn.prototype.boolean=!1;Bn.prototype.commaOrSpaceSeparated=!1;Bn.prototype.commaSeparated=!1;Bn.prototype.defined=!1;Bn.prototype.mustUseProperty=!1;Bn.prototype.number=!1;Bn.prototype.overloadedBoolean=!1;Bn.prototype.property="";Bn.prototype.spaceSeparated=!1;Bn.prototype.space=void 0;let oS=0;const Ue=Cr(),Ht=Cr(),Bp=Cr(),pe=Cr(),xt=Cr(),vr=Cr(),Qn=Cr();function Cr(){return 2**++oS}const qp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:Ht,commaOrSpaceSeparated:Qn,commaSeparated:vr,number:pe,overloadedBoolean:Bp,spaceSeparated:xt},Symbol.toStringTag,{value:"Module"})),ap=Object.keys(qp);class uh extends Bn{constructor(i,a,r,u){let c=-1;if(super(i,a),Iy(this,"space",u),typeof r=="number")for(;++c<ap.length;){const d=ap[c];Iy(this,ap[c],(r&qp[d])===qp[d])}}}uh.prototype.defined=!0;function Iy(e,i,a){a&&(e[i]=a)}function Ds(e){const i={},a={};for(const[r,u]of Object.entries(e.properties)){const c=new uh(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),i[r]=c,a[Up(r)]=r,a[Up(c.attribute)]=r}return new mu(i,a,e.space)}const Tb=Ds({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:xt,ariaCurrent:null,ariaDescribedBy:xt,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:xt,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:xt,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xt,ariaLevel:pe,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:xt,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:xt,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:Ht,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function Eb(e,i){return i in e?e[i]:i}function Ab(e,i){return Eb(e,i.toLowerCase())}const uS=Ds({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:vr,acceptCharset:xt,accessKey:xt,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alpha:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:xt,autoFocus:Ue,autoPlay:Ue,blocking:xt,capture:null,charSet:null,checked:Ue,cite:null,className:xt,closedBy:null,colorSpace:null,cols:pe,colSpan:pe,command:null,commandFor:null,content:null,contentEditable:Ht,controls:Ue,controlsList:xt,coords:pe|vr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:Bp,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:xt,height:pe,hidden:Bp,high:pe,href:null,hrefLang:null,htmlFor:xt,httpEquiv:xt,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:xt,itemRef:xt,itemScope:Ue,itemType:xt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ue,optimum:pe,pattern:null,ping:xt,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:xt,required:Ue,reversed:Ue,rows:pe,rowSpan:pe,sandbox:xt,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootCustomElementRegistry:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shadowRootSerializable:Ue,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:Ht,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Ht,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xt,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:Ht,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ue,disablePictureInPicture:Ue,disableRemotePlayback:Ue,exportParts:vr,part:xt,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:Ab}),cS=Ds({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Qn,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:xt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:vr,g2:vr,glyphName:vr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:Qn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qn,rev:Qn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qn,requiredFeatures:Qn,requiredFonts:Qn,requiredFormats:Qn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:Qn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qn,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Eb}),Nb=Ds({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()}}),Db=Ds({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ab}),Rb=Ds({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),dS={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"},fS=/[A-Z]/g,Uy=/-[a-z]/g,pS=/^data[-\w.:]+$/i;function hS(e,i){const a=Up(i);let r=i,u=Bn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&pS.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(Uy,gS);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!Uy.test(c)){let d=c.replace(fS,mS);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}u=uh}return new u(r,i)}function mS(e){return"-"+e.toLowerCase()}function gS(e){return e.charAt(1).toUpperCase()}const yS=Cb([Tb,uS,Nb,Db,Rb],"html"),ch=Cb([Tb,cS,Nb,Db,Rb],"svg");function xS(e){return e.join(" ").trim()}var ks={},lp,By;function bS(){if(By)return lp;By=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,p=/^\s+|\s+$/g,g=`
51
+ `,m="/",b="*",x="",S="comment",w="declaration";function E($,M){if(typeof $!="string")throw new TypeError("First argument must be a string");if(!$)return[];M=M||{};var H=1,q=1;function F(xe){var ce=xe.match(i);ce&&(H+=ce.length);var V=xe.lastIndexOf(g);q=~V?xe.length-V:q+xe.length}function ie(){var xe={line:H,column:q};return function(ce){return ce.position=new N(xe),J(),ce}}function N(xe){this.start=xe,this.end={line:H,column:q},this.source=M.source}N.prototype.content=$;function K(xe){var ce=new Error(M.source+":"+H+":"+q+": "+xe);if(ce.reason=xe,ce.filename=M.source,ce.line=H,ce.column=q,ce.source=$,!M.silent)throw ce}function ae(xe){var ce=xe.exec($);if(ce){var V=ce[0];return F(V),$=$.slice(V.length),ce}}function J(){ae(a)}function I(xe){var ce;for(xe=xe||[];ce=te();)ce!==!1&&xe.push(ce);return xe}function te(){var xe=ie();if(!(m!=$.charAt(0)||b!=$.charAt(1))){for(var ce=2;x!=$.charAt(ce)&&(b!=$.charAt(ce)||m!=$.charAt(ce+1));)++ce;if(ce+=2,x===$.charAt(ce-1))return K("End of comment missing");var V=$.slice(2,ce-2);return q+=2,F(V),$=$.slice(ce),q+=2,xe({type:S,comment:V})}}function ue(){var xe=ie(),ce=ae(r);if(ce){if(te(),!ae(u))return K("property missing ':'");var V=ae(c),se=xe({type:w,property:R(ce[0].replace(e,x)),value:V?R(V[0].replace(e,x)):x});return ae(d),se}}function Ce(){var xe=[];I(xe);for(var ce;ce=ue();)ce!==!1&&(xe.push(ce),I(xe));return xe}return J(),Ce()}function R($){return $?$.replace(p,x):x}return lp=E,lp}var qy;function vS(){if(qy)return ks;qy=1;var e=ks&&ks.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ks,"__esModule",{value:!0}),ks.default=a;const i=e(bS());function a(r,u){let c=null;if(!r||typeof r!="string")return c;const d=(0,i.default)(r),p=typeof u=="function";return d.forEach(g=>{if(g.type!=="declaration")return;const{property:m,value:b}=g;p?u(m,b,g):b&&(c=c||{},c[m]=b)}),c}return ks}var Yo={},Hy;function wS(){if(Hy)return Yo;Hy=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,c=function(m){return!m||a.test(m)||e.test(m)},d=function(m,b){return b.toUpperCase()},p=function(m,b){return"".concat(b,"-")},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 Yo.camelCase=g,Yo}var Po,$y;function kS(){if($y)return Po;$y=1;var e=Po&&Po.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},i=e(vS()),a=wS();function r(u,c){var d={};return!u||typeof u!="string"||(0,i.default)(u,function(p,g){p&&g&&(d[(0,a.camelCase)(p,c)]=g)}),d}return r.default=r,Po=r,Po}var SS=kS();const jS=jb(SS),_b=Mb("end"),dh=Mb("start");function Mb(e){return i;function i(a){const r=a&&a.position&&a.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function CS(e){const i=dh(e),a=_b(e);if(i&&a)return{start:i,end:a}}function lu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Gy(e.position):"start"in e||"end"in e?Gy(e):"line"in e||"column"in e?Hp(e):""}function Hp(e){return Vy(e&&e.line)+":"+Vy(e&&e.column)}function Gy(e){return Hp(e&&e.start)+"-"+Hp(e&&e.end)}function Vy(e){return e&&typeof e=="number"?e:1}class mn extends Error{constructor(i,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let u="",c={},d=!1;if(a&&("line"in a&&"column"in a?c={place:a}:"start"in a&&"end"in a?c={place:a}:"type"in a?c={ancestors:[a],place:a.position}:c={...a}),typeof i=="string"?u=i:!c.cause&&i&&(d=!0,u=i.message,c.cause=i),!c.ruleId&&!c.source&&typeof r=="string"){const g=r.indexOf(":");g===-1?c.ruleId=r:(c.source=r.slice(0,g),c.ruleId=r.slice(g+1))}if(!c.place&&c.ancestors&&c.ancestors){const g=c.ancestors[c.ancestors.length-1];g&&(c.place=g.position)}const p=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=p?p.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=p?p.line:void 0,this.name=lu(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=d&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}mn.prototype.file="";mn.prototype.name="";mn.prototype.reason="";mn.prototype.message="";mn.prototype.stack="";mn.prototype.column=void 0;mn.prototype.line=void 0;mn.prototype.ancestors=void 0;mn.prototype.cause=void 0;mn.prototype.fatal=void 0;mn.prototype.place=void 0;mn.prototype.ruleId=void 0;mn.prototype.source=void 0;const fh={}.hasOwnProperty,TS=new Map,ES=/[A-Z]/g,AS=new Set(["table","tbody","thead","tfoot","tr"]),NS=new Set(["td","th"]),Ob="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function DS(e,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=i.filePath||void 0;let r;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=US(a,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=IS(a,i.jsx,i.jsxs)}const u={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:r,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?ch:yS,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=zb(u,e,void 0);return c&&typeof c!="string"?c:u.create(e,u.Fragment,{children:c||void 0},void 0)}function zb(e,i,a){if(i.type==="element")return RS(e,i,a);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return _S(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return OS(e,i,a);if(i.type==="mdxjsEsm")return MS(e,i);if(i.type==="root")return zS(e,i,a);if(i.type==="text")return LS(e,i)}function RS(e,i,a){const r=e.schema;let u=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=ch,e.schema=u),e.ancestors.push(i);const c=Ib(e,i.tagName,!1),d=BS(e,i);let p=hh(e,i);return AS.has(i.tagName)&&(p=p.filter(function(g){return typeof g=="string"?!sS(g):!0})),Lb(e,d,c,i),ph(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function _S(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)}pu(e,i.position)}function MS(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);pu(e,i.position)}function OS(e,i,a){const r=e.schema;let u=r;i.name==="svg"&&r.space==="html"&&(u=ch,e.schema=u),e.ancestors.push(i);const c=i.name===null?e.Fragment:Ib(e,i.name,!0),d=qS(e,i),p=hh(e,i);return Lb(e,d,c,i),ph(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function zS(e,i,a){const r={};return ph(r,hh(e,i)),e.create(i,e.Fragment,r,a)}function LS(e,i){return i.value}function Lb(e,i,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(i.node=r)}function ph(e,i){if(i.length>0){const a=i.length>1?i:i[0];a&&(e.children=a)}}function IS(e,i,a){return r;function r(u,c,d,p){const m=Array.isArray(d.children)?a:i;return p?m(c,d,p):m(c,d)}}function US(e,i){return a;function a(r,u,c,d){const p=Array.isArray(c.children),g=dh(r);return i(u,c,d,p,{columnNumber:g?g.column-1:void 0,fileName:e,lineNumber:g?g.line:void 0},void 0)}}function BS(e,i){const a={};let r,u;for(u in i.properties)if(u!=="children"&&fh.call(i.properties,u)){const c=HS(e,u,i.properties[u]);if(c){const[d,p]=c;e.tableCellAlignToStyle&&d==="align"&&typeof p=="string"&&NS.has(i.tagName)?r=p:a[d]=p}}if(r){const c=a.style||(a.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function qS(e,i){const a={};for(const r of i.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const c=r.data.estree.body[0];c.type;const d=c.expression;d.type;const p=d.properties[0];p.type,Object.assign(a,e.evaluater.evaluateExpression(p.argument))}else pu(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 pu(e,i.position);else c=r.value===null?!0:r.value;a[u]=c}return a}function hh(e,i){const a=[];let r=-1;const u=e.passKeys?new Map:TS;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=zb(e,c,d);p!==void 0&&a.push(p)}return a}function HS(e,i,a){const r=hS(e.schema,i);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?nS(a):xS(a)),r.property==="style"){let u=typeof a=="object"?a:$S(e,String(a));return e.stylePropertyNameCase==="css"&&(u=GS(u)),["style",u]}return[e.elementAttributeNameCase==="react"&&r.space?dS[r.property]||r.property:r.attribute,a]}}function $S(e,i){try{return jS(i,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,u=new mn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=e.filePath||void 0,u.url=Ob+"#cannot-parse-style-attribute",u}}function Ib(e,i,a){let r;if(!a)r={type:"Literal",value:i};else if(i.includes(".")){const u=i.split(".");let c=-1,d;for(;++c<u.length;){const p=zy(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=zy(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const u=r.value;return fh.call(e.components,u)?e.components[u]:u}if(e.evaluater)return e.evaluater.evaluateExpression(r);pu(e)}function pu(e,i){const a=new mn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Ob+"#cannot-handle-mdx-estrees-without-createevaluater",a}function GS(e){const i={};let a;for(a in e)fh.call(e,a)&&(i[VS(a)]=e[a]);return i}function VS(e){let i=e.replace(ES,FS);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function FS(e){return"-"+e.toLowerCase()}const rp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},YS={};function mh(e,i){const a=YS,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,u=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return Ub(e,r,u)}function Ub(e,i,a){if(PS(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Fy(e.children,i,a)}return Array.isArray(e)?Fy(e,i,a):""}function Fy(e,i,a){const r=[];let u=-1;for(;++u<e.length;)r[u]=Ub(e[u],i,a);return r.join("")}function PS(e){return!!(e&&typeof e=="object")}const Yy=document.createElement("i");function gh(e){const i="&"+e+";";Yy.innerHTML=i;const a=Yy.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===i?!1:a}function Zn(e,i,a,r){const u=e.length;let c=0,d;if(i<0?i=-i>u?0:u+i:i=i>u?u:i,a=a>0?a:0,r.length<1e4)d=Array.from(r),d.unshift(i,a),e.splice(...d);else for(a&&e.splice(i,a);c<r.length;)d=r.slice(c,c+1e4),d.unshift(i,0),e.splice(...d),c+=1e4,i+=1e4}function gi(e,i){return e.length>0?(Zn(e,e.length,0,i),e):i}const Py={}.hasOwnProperty;function Bb(e){const i={};let a=-1;for(;++a<e.length;)WS(i,e[a]);return i}function WS(e,i){let a;for(a in i){const u=(Py.call(e,a)?e[a]:void 0)||(e[a]={}),c=i[a];let d;if(c)for(d in c){Py.call(u,d)||(u[d]=[]);const p=c[d];KS(u[d],Array.isArray(p)?p:p?[p]:[])}}}function KS(e,i){let a=-1;const r=[];for(;++a<i.length;)(i[a].add==="after"?e:r).push(i[a]);Zn(e,0,0,r)}function qb(e,i){const a=Number.parseInt(e,i);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function _i(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bn=Ol(/[A-Za-z]/),hn=Ol(/[\dA-Za-z]/),XS=Ol(/[#-'*+\--9=?A-Z^-~]/);function td(e){return e!==null&&(e<32||e===127)}const $p=Ol(/\d/),QS=Ol(/[\dA-Fa-f]/),ZS=Ol(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function bt(e){return e!==null&&(e<0||e===32)}function We(e){return e===-2||e===-1||e===32}const ud=Ol(new RegExp("\\p{P}|\\p{S}","u")),wr=Ol(/\s/);function Ol(e){return i;function i(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Rs(e){const i=[];let a=-1,r=0,u=0;for(;++a<e.length;){const c=e.charCodeAt(a);let d="";if(c===37&&hn(e.charCodeAt(a+1))&&hn(e.charCodeAt(a+2)))u=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(d=String.fromCharCode(c));else if(c>55295&&c<57344){const p=e.charCodeAt(a+1);c<56320&&p>56319&&p<57344?(d=String.fromCharCode(c,p),u=1):d="�"}else d=String.fromCharCode(c);d&&(i.push(e.slice(r,a),encodeURIComponent(d)),r=a+u+1,d=""),u&&(a+=u,u=0)}return i.join("")+e.slice(r)}function tt(e,i,a,r){const u=r?r-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(g){return We(g)?(e.enter(a),p(g)):i(g)}function p(g){return We(g)&&c++<u?(e.consume(g),p):(e.exit(a),i(g))}}const JS={tokenize:ej};function ej(e){const i=e.attempt(this.parser.constructs.contentInitial,r,u);let a;return i;function r(p){if(p===null){e.consume(p);return}return e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),tt(e,i,"linePrefix")}function u(p){return e.enter("paragraph"),c(p)}function c(p){const g=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=g),a=g,d(p)}function d(p){if(p===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(p);return}return ze(p)?(e.consume(p),e.exit("chunkText"),c):(e.consume(p),d)}}const tj={tokenize:nj},Wy={tokenize:ij};function nj(e){const i=this,a=[];let r=0,u,c,d;return p;function p(q){if(r<a.length){const F=a[r];return i.containerState=F[1],e.attempt(F[0].continuation,g,m)(q)}return m(q)}function g(q){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,u&&H();const F=i.events.length;let ie=F,N;for(;ie--;)if(i.events[ie][0]==="exit"&&i.events[ie][1].type==="chunkFlow"){N=i.events[ie][1].end;break}M(r);let K=F;for(;K<i.events.length;)i.events[K][1].end={...N},K++;return Zn(i.events,ie+1,0,i.events.slice(F)),i.events.length=K,m(q)}return p(q)}function m(q){if(r===a.length){if(!u)return S(q);if(u.currentConstruct&&u.currentConstruct.concrete)return E(q);i.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(Wy,b,x)(q)}function b(q){return u&&H(),M(r),S(q)}function x(q){return i.parser.lazy[i.now().line]=r!==a.length,d=i.now().offset,E(q)}function S(q){return i.containerState={},e.attempt(Wy,w,E)(q)}function w(q){return r++,a.push([i.currentConstruct,i.containerState]),S(q)}function E(q){if(q===null){u&&H(),M(0),e.consume(q);return}return u=u||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:c}),R(q)}function R(q){if(q===null){$(e.exit("chunkFlow"),!0),M(0),e.consume(q);return}return ze(q)?(e.consume(q),$(e.exit("chunkFlow")),r=0,i.interrupt=void 0,p):(e.consume(q),R)}function $(q,F){const ie=i.sliceStream(q);if(F&&ie.push(null),q.previous=c,c&&(c.next=q),c=q,u.defineSkip(q.start),u.write(ie),i.parser.lazy[q.start.line]){let N=u.events.length;for(;N--;)if(u.events[N][1].start.offset<d&&(!u.events[N][1].end||u.events[N][1].end.offset>d))return;const K=i.events.length;let ae=K,J,I;for(;ae--;)if(i.events[ae][0]==="exit"&&i.events[ae][1].type==="chunkFlow"){if(J){I=i.events[ae][1].end;break}J=!0}for(M(r),N=K;N<i.events.length;)i.events[N][1].end={...I},N++;Zn(i.events,ae+1,0,i.events.slice(K)),i.events.length=N}}function M(q){let F=a.length;for(;F-- >q;){const ie=a[F];i.containerState=ie[1],ie[0].exit.call(i,e)}a.length=q}function H(){u.write([null]),c=void 0,u=void 0,i.containerState._closeFlow=void 0}}function ij(e,i,a){return tt(e,e.attempt(this.parser.constructs.document,i,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function As(e){if(e===null||bt(e)||wr(e))return 1;if(ud(e))return 2}function cd(e,i,a){const r=[];let u=-1;for(;++u<e.length;){const c=e[u].resolveAll;c&&!r.includes(c)&&(i=c(i,a),r.push(c))}return i}const Gp={name:"attention",resolveAll:aj,tokenize:lj};function aj(e,i){let a=-1,r,u,c,d,p,g,m,b;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(r=a;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&i.sliceSerialize(e[r][1]).charCodeAt(0)===i.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[r][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;g=e[r][1].end.offset-e[r][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const x={...e[r][1].end},S={...e[a][1].start};Ky(x,-g),Ky(S,g),d={type:g>1?"strongSequence":"emphasisSequence",start:x,end:{...e[r][1].end}},p={type:g>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:S},c={type:g>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[a][1].start}},u={type:g>1?"strong":"emphasis",start:{...d.start},end:{...p.end}},e[r][1].end={...d.start},e[a][1].start={...p.end},m=[],e[r][1].end.offset-e[r][1].start.offset&&(m=gi(m,[["enter",e[r][1],i],["exit",e[r][1],i]])),m=gi(m,[["enter",u,i],["enter",d,i],["exit",d,i],["enter",c,i]]),m=gi(m,cd(i.parser.constructs.insideSpan.null,e.slice(r+1,a),i)),m=gi(m,[["exit",c,i],["enter",p,i],["exit",p,i],["exit",u,i]]),e[a][1].end.offset-e[a][1].start.offset?(b=2,m=gi(m,[["enter",e[a][1],i],["exit",e[a][1],i]])):b=0,Zn(e,r-1,a-r+3,m),a=r+m.length-b-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function lj(e,i){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,u=As(r);let c;return d;function d(g){return c=g,e.enter("attentionSequence"),p(g)}function p(g){if(g===c)return e.consume(g),p;const m=e.exit("attentionSequence"),b=As(g),x=!b||b===2&&u||a.includes(g),S=!u||u===2&&b||a.includes(r);return m._open=!!(c===42?x:x&&(u||!S)),m._close=!!(c===42?S:S&&(b||!x)),i(g)}}function Ky(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const rj={name:"autolink",tokenize:sj};function sj(e,i,a){let r=0;return u;function u(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(w){return bn(w)?(e.consume(w),d):w===64?a(w):m(w)}function d(w){return w===43||w===45||w===46||hn(w)?(r=1,p(w)):m(w)}function p(w){return w===58?(e.consume(w),r=0,g):(w===43||w===45||w===46||hn(w))&&r++<32?(e.consume(w),p):(r=0,m(w))}function g(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):w===null||w===32||w===60||td(w)?a(w):(e.consume(w),g)}function m(w){return w===64?(e.consume(w),b):XS(w)?(e.consume(w),m):a(w)}function b(w){return hn(w)?x(w):a(w)}function x(w){return w===46?(e.consume(w),r=0,b):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):S(w)}function S(w){if((w===45||hn(w))&&r++<63){const E=w===45?S:x;return e.consume(w),E}return a(w)}}const gu={partial:!0,tokenize:oj};function oj(e,i,a){return r;function r(c){return We(c)?tt(e,u,"linePrefix")(c):u(c)}function u(c){return c===null||ze(c)?i(c):a(c)}}const Hb={continuation:{tokenize:cj},exit:dj,name:"blockQuote",tokenize:uj};function uj(e,i,a){const r=this;return u;function u(d){if(d===62){const p=r.containerState;return p.open||(e.enter("blockQuote",{_container:!0}),p.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),c}return a(d)}function c(d){return We(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(d))}}function cj(e,i,a){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(Hb,i,a)(d)}}function dj(e){e.exit("blockQuote")}const $b={name:"characterEscape",tokenize:fj};function fj(e,i,a){return r;function r(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),u}function u(c){return ZS(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):a(c)}}const Gb={name:"characterReference",tokenize:pj};function pj(e,i,a){const r=this;let u=0,c,d;return p;function p(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),g}function g(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,d=hn,b(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=QS,b):(e.enter("characterReferenceValue"),c=7,d=$p,b(x))}function b(x){if(x===59&&u){const S=e.exit("characterReferenceValue");return d===hn&&!gh(r.sliceSerialize(S))?a(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return d(x)&&u++<c?(e.consume(x),b):a(x)}}const Xy={partial:!0,tokenize:mj},Qy={concrete:!0,name:"codeFenced",tokenize:hj};function hj(e,i,a){const r=this,u={partial:!0,tokenize:ie};let c=0,d=0,p;return g;function g(N){return m(N)}function m(N){const K=r.events[r.events.length-1];return c=K&&K[1].type==="linePrefix"?K[2].sliceSerialize(K[1],!0).length:0,p=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(N)}function b(N){return N===p?(d++,e.consume(N),b):d<3?a(N):(e.exit("codeFencedFenceSequence"),We(N)?tt(e,x,"whitespace")(N):x(N))}function x(N){return N===null||ze(N)?(e.exit("codeFencedFence"),r.interrupt?i(N):e.check(Xy,R,F)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),S(N))}function S(N){return N===null||ze(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(N)):We(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tt(e,w,"whitespace")(N)):N===96&&N===p?a(N):(e.consume(N),S)}function w(N){return N===null||ze(N)?x(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(N))}function E(N){return N===null||ze(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(N)):N===96&&N===p?a(N):(e.consume(N),E)}function R(N){return e.attempt(u,F,$)(N)}function $(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),M}function M(N){return c>0&&We(N)?tt(e,H,"linePrefix",c+1)(N):H(N)}function H(N){return N===null||ze(N)?e.check(Xy,R,F)(N):(e.enter("codeFlowValue"),q(N))}function q(N){return N===null||ze(N)?(e.exit("codeFlowValue"),H(N)):(e.consume(N),q)}function F(N){return e.exit("codeFenced"),i(N)}function ie(N,K,ae){let J=0;return I;function I(ce){return N.enter("lineEnding"),N.consume(ce),N.exit("lineEnding"),te}function te(ce){return N.enter("codeFencedFence"),We(ce)?tt(N,ue,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ce):ue(ce)}function ue(ce){return ce===p?(N.enter("codeFencedFenceSequence"),Ce(ce)):ae(ce)}function Ce(ce){return ce===p?(J++,N.consume(ce),Ce):J>=d?(N.exit("codeFencedFenceSequence"),We(ce)?tt(N,xe,"whitespace")(ce):xe(ce)):ae(ce)}function xe(ce){return ce===null||ze(ce)?(N.exit("codeFencedFence"),K(ce)):ae(ce)}}}function mj(e,i,a){const r=this;return u;function u(d){return d===null?a(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c)}function c(d){return r.parser.lazy[r.now().line]?a(d):i(d)}}const sp={name:"codeIndented",tokenize:yj},gj={partial:!0,tokenize:xj};function yj(e,i,a){const r=this;return u;function u(m){return e.enter("codeIndented"),tt(e,c,"linePrefix",5)(m)}function c(m){const b=r.events[r.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?d(m):a(m)}function d(m){return m===null?g(m):ze(m)?e.attempt(gj,d,g)(m):(e.enter("codeFlowValue"),p(m))}function p(m){return m===null||ze(m)?(e.exit("codeFlowValue"),d(m)):(e.consume(m),p)}function g(m){return e.exit("codeIndented"),i(m)}}function xj(e,i,a){const r=this;return u;function u(d){return r.parser.lazy[r.now().line]?a(d):ze(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):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):ze(d)?u(d):a(d)}}const bj={name:"codeText",previous:wj,resolve:vj,tokenize:kj};function vj(e){let i=e.length-4,a=3,r,u;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(r=a;++r<i;)if(e[r][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[i][1].type="codeTextPadding",a+=2,i-=2;break}}for(r=a-1,i++;++r<=i;)u===void 0?r!==i&&e[r][1].type!=="lineEnding"&&(u=r):(r===i||e[r][1].type==="lineEnding")&&(e[u][1].type="codeTextData",r!==u+2&&(e[u][1].end=e[r-1][1].end,e.splice(u+2,r-u-2),i-=r-u-2,r=u+2),u=void 0);return e}function wj(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function kj(e,i,a){let r=0,u,c;return d;function d(x){return e.enter("codeText"),e.enter("codeTextSequence"),p(x)}function p(x){return x===96?(e.consume(x),r++,p):(e.exit("codeTextSequence"),g(x))}function g(x){return x===null?a(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),g):x===96?(c=e.enter("codeTextSequence"),u=0,b(x)):ze(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||ze(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 Sj{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,a){const r=a??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(i,r):i>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(i,a,r){const u=a||0;this.setCursor(Math.trunc(i));const c=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return r&&Wo(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),Wo(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),Wo(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const a=this.left.splice(i,Number.POSITIVE_INFINITY);Wo(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);Wo(this.left,a.reverse())}}}function Wo(e,i){let a=0;if(i.length<1e4)e.push(...i);else for(;a<i.length;)e.push(...i.slice(a,a+1e4)),a+=1e4}function Vb(e){const i={};let a=-1,r,u,c,d,p,g,m;const b=new Sj(e);for(;++a<b.length;){for(;a in i;)a=i[a];if(r=b.get(a),a&&r[1].type==="chunkFlow"&&b.get(a-1)[1].type==="listItemPrefix"&&(g=r[1]._tokenizer.events,c=0,c<g.length&&g[c][1].type==="lineEndingBlank"&&(c+=2),c<g.length&&g[c][1].type==="content"))for(;++c<g.length&&g[c][1].type!=="content";)g[c][1].type==="chunkText"&&(g[c][1]._isInFirstContentOfListItem=!0,c++);if(r[0]==="enter")r[1].contentType&&(Object.assign(i,jj(b,a)),a=i[a],m=!0);else if(r[1]._container){for(c=a,u=void 0;c--;)if(d=b.get(c),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(u&&(b.get(u)[1].type="lineEndingBlank"),d[1].type="lineEnding",u=c);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;u&&(r[1].end={...b.get(u)[1].start},p=b.slice(u,a),p.unshift(r),b.splice(u,a-u+1,p))}}return Zn(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function jj(e,i){const a=e.get(i)[1],r=e.get(i)[2];let u=i-1;const c=[];let d=a._tokenizer;d||(d=r.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const p=d.events,g=[],m={};let b,x,S=-1,w=a,E=0,R=0;const $=[R];for(;w;){for(;e.get(++u)[1]!==w;);c.push(u),w._tokenizer||(b=r.sliceStream(w),w.next||b.push(null),x&&d.defineSkip(w.start),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(b),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),x=w,w=w.next}for(w=a;++S<p.length;)p[S][0]==="exit"&&p[S-1][0]==="enter"&&p[S][1].type===p[S-1][1].type&&p[S][1].start.line!==p[S][1].end.line&&(R=S+1,$.push(R),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(d.events=[],w?(w._tokenizer=void 0,w.previous=void 0):$.pop(),S=$.length;S--;){const M=p.slice($[S],$[S+1]),H=c.pop();g.push([H,H+M.length-1]),e.splice(H,2,M)}for(g.reverse(),S=-1;++S<g.length;)m[E+g[S][0]]=E+g[S][1],E+=g[S][1]-g[S][0]-1;return m}const Cj={resolve:Ej,tokenize:Aj},Tj={partial:!0,tokenize:Nj};function Ej(e){return Vb(e),e}function Aj(e,i){let a;return r;function r(p){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),u(p)}function u(p){return p===null?c(p):ze(p)?e.check(Tj,d,c)(p):(e.consume(p),u)}function c(p){return e.exit("chunkContent"),e.exit("content"),i(p)}function d(p){return e.consume(p),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,u}}function Nj(e,i,a){const r=this;return u;function u(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),tt(e,c,"linePrefix")}function c(d){if(d===null||ze(d))return a(d);const p=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):e.interrupt(r.parser.constructs.flow,a,i)(d)}}function Fb(e,i,a,r,u,c,d,p,g){const m=g||Number.POSITIVE_INFINITY;let b=0;return x;function x(M){return M===60?(e.enter(r),e.enter(u),e.enter(c),e.consume(M),e.exit(c),S):M===null||M===32||M===41||td(M)?a(M):(e.enter(r),e.enter(d),e.enter(p),e.enter("chunkString",{contentType:"string"}),R(M))}function S(M){return M===62?(e.enter(c),e.consume(M),e.exit(c),e.exit(u),e.exit(r),i):(e.enter(p),e.enter("chunkString",{contentType:"string"}),w(M))}function w(M){return M===62?(e.exit("chunkString"),e.exit(p),S(M)):M===null||M===60||ze(M)?a(M):(e.consume(M),M===92?E:w)}function E(M){return M===60||M===62||M===92?(e.consume(M),w):w(M)}function R(M){return!b&&(M===null||M===41||bt(M))?(e.exit("chunkString"),e.exit(p),e.exit(d),e.exit(r),i(M)):b<m&&M===40?(e.consume(M),b++,R):M===41?(e.consume(M),b--,R):M===null||M===32||M===40||td(M)?a(M):(e.consume(M),M===92?$:R)}function $(M){return M===40||M===41||M===92?(e.consume(M),R):R(M)}}function Yb(e,i,a,r,u,c){const d=this;let p=0,g;return m;function m(w){return e.enter(r),e.enter(u),e.consume(w),e.exit(u),e.enter(c),b}function b(w){return p>999||w===null||w===91||w===93&&!g||w===94&&!p&&"_hiddenFootnoteSupport"in d.parser.constructs?a(w):w===93?(e.exit(c),e.enter(u),e.consume(w),e.exit(u),e.exit(r),i):ze(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),x(w))}function x(w){return w===null||w===91||w===93||ze(w)||p++>999?(e.exit("chunkString"),b(w)):(e.consume(w),g||(g=!We(w)),w===92?S:x)}function S(w){return w===91||w===92||w===93?(e.consume(w),p++,x):x(w)}}function Pb(e,i,a,r,u,c){let d;return p;function p(S){return S===34||S===39||S===40?(e.enter(r),e.enter(u),e.consume(S),e.exit(u),d=S===40?41:S,g):a(S)}function g(S){return S===d?(e.enter(u),e.consume(S),e.exit(u),e.exit(r),i):(e.enter(c),m(S))}function m(S){return S===d?(e.exit(c),g(d)):S===null?a(S):ze(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),tt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(S))}function b(S){return S===d||S===null||ze(S)?(e.exit("chunkString"),m(S)):(e.consume(S),S===92?x:b)}function x(S){return S===d||S===92?(e.consume(S),b):b(S)}}function ru(e,i){let a;return r;function r(u){return ze(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a=!0,r):We(u)?tt(e,r,a?"linePrefix":"lineSuffix")(u):i(u)}}const Dj={name:"definition",tokenize:_j},Rj={partial:!0,tokenize:Mj};function _j(e,i,a){const r=this;let u;return c;function c(w){return e.enter("definition"),d(w)}function d(w){return Yb.call(r,e,p,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function p(w){return u=_i(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),g):a(w)}function g(w){return bt(w)?ru(e,m)(w):m(w)}function m(w){return Fb(e,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function b(w){return e.attempt(Rj,x,x)(w)}function x(w){return We(w)?tt(e,S,"whitespace")(w):S(w)}function S(w){return w===null||ze(w)?(e.exit("definition"),r.parser.defined.push(u),i(w)):a(w)}}function Mj(e,i,a){return r;function r(p){return bt(p)?ru(e,u)(p):a(p)}function u(p){return Pb(e,c,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(p)}function c(p){return We(p)?tt(e,d,"whitespace")(p):d(p)}function d(p){return p===null||ze(p)?i(p):a(p)}}const Oj={name:"hardBreakEscape",tokenize:zj};function zj(e,i,a){return r;function r(c){return e.enter("hardBreakEscape"),e.consume(c),u}function u(c){return ze(c)?(e.exit("hardBreakEscape"),i(c)):a(c)}}const Lj={name:"headingAtx",resolve:Ij,tokenize:Uj};function Ij(e,i){let a=e.length-2,r=3,u,c;return e[r][1].type==="whitespace"&&(r+=2),a-2>r&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&e[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r&&(u={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},c={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"},Zn(e,r,a-r+1,[["enter",u,i],["enter",c,i],["exit",c,i],["exit",u,i]])),e}function Uj(e,i,a){let r=0;return u;function u(b){return e.enter("atxHeading"),c(b)}function c(b){return e.enter("atxHeadingSequence"),d(b)}function d(b){return b===35&&r++<6?(e.consume(b),d):b===null||bt(b)?(e.exit("atxHeadingSequence"),p(b)):a(b)}function p(b){return b===35?(e.enter("atxHeadingSequence"),g(b)):b===null||ze(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||bt(b)?(e.exit("atxHeadingText"),p(b)):(e.consume(b),m)}}const Bj=["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"],Zy=["pre","script","style","textarea"],qj={concrete:!0,name:"htmlFlow",resolveTo:Gj,tokenize:Vj},Hj={partial:!0,tokenize:Yj},$j={partial:!0,tokenize:Fj};function Gj(e){let i=e.length;for(;i--&&!(e[i][0]==="enter"&&e[i][1].type==="htmlFlow"););return i>1&&e[i-2][1].type==="linePrefix"&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e}function Vj(e,i,a){const r=this;let u,c,d,p,g;return m;function m(C){return b(C)}function b(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),x}function x(C){return C===33?(e.consume(C),S):C===47?(e.consume(C),c=!0,R):C===63?(e.consume(C),u=3,r.interrupt?i:O):bn(C)?(e.consume(C),d=String.fromCharCode(C),$):a(C)}function S(C){return C===45?(e.consume(C),u=2,w):C===91?(e.consume(C),u=5,p=0,E):bn(C)?(e.consume(C),u=4,r.interrupt?i:O):a(C)}function w(C){return C===45?(e.consume(C),r.interrupt?i:O):a(C)}function E(C){const W="CDATA[";return C===W.charCodeAt(p++)?(e.consume(C),p===W.length?r.interrupt?i:ue:E):a(C)}function R(C){return bn(C)?(e.consume(C),d=String.fromCharCode(C),$):a(C)}function $(C){if(C===null||C===47||C===62||bt(C)){const W=C===47,he=d.toLowerCase();return!W&&!c&&Zy.includes(he)?(u=1,r.interrupt?i(C):ue(C)):Bj.includes(d.toLowerCase())?(u=6,W?(e.consume(C),M):r.interrupt?i(C):ue(C)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(C):c?H(C):q(C))}return C===45||hn(C)?(e.consume(C),d+=String.fromCharCode(C),$):a(C)}function M(C){return C===62?(e.consume(C),r.interrupt?i:ue):a(C)}function H(C){return We(C)?(e.consume(C),H):I(C)}function q(C){return C===47?(e.consume(C),I):C===58||C===95||bn(C)?(e.consume(C),F):We(C)?(e.consume(C),q):I(C)}function F(C){return C===45||C===46||C===58||C===95||hn(C)?(e.consume(C),F):ie(C)}function ie(C){return C===61?(e.consume(C),N):We(C)?(e.consume(C),ie):q(C)}function N(C){return C===null||C===60||C===61||C===62||C===96?a(C):C===34||C===39?(e.consume(C),g=C,K):We(C)?(e.consume(C),N):ae(C)}function K(C){return C===g?(e.consume(C),g=null,J):C===null||ze(C)?a(C):(e.consume(C),K)}function ae(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||bt(C)?ie(C):(e.consume(C),ae)}function J(C){return C===47||C===62||We(C)?q(C):a(C)}function I(C){return C===62?(e.consume(C),te):a(C)}function te(C){return C===null||ze(C)?ue(C):We(C)?(e.consume(C),te):a(C)}function ue(C){return C===45&&u===2?(e.consume(C),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),Me):ze(C)&&(u===6||u===7)?(e.exit("htmlFlowData"),e.check(Hj,z,Ce)(C)):C===null||ze(C)?(e.exit("htmlFlowData"),Ce(C)):(e.consume(C),ue)}function Ce(C){return e.check($j,xe,z)(C)}function xe(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),ce}function ce(C){return C===null||ze(C)?Ce(C):(e.enter("htmlFlowData"),ue(C))}function V(C){return C===45?(e.consume(C),O):ue(C)}function se(C){return C===47?(e.consume(C),d="",we):ue(C)}function we(C){if(C===62){const W=d.toLowerCase();return Zy.includes(W)?(e.consume(C),A):ue(C)}return bn(C)&&d.length<8?(e.consume(C),d+=String.fromCharCode(C),we):ue(C)}function Me(C){return C===93?(e.consume(C),O):ue(C)}function O(C){return C===62?(e.consume(C),A):C===45&&u===2?(e.consume(C),O):ue(C)}function A(C){return C===null||ze(C)?(e.exit("htmlFlowData"),z(C)):(e.consume(C),A)}function z(C){return e.exit("htmlFlow"),i(C)}}function Fj(e,i,a){const r=this;return u;function u(d){return ze(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):a(d)}function c(d){return r.parser.lazy[r.now().line]?a(d):i(d)}}function Yj(e,i,a){return r;function r(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(gu,i,a)}}const Pj={name:"htmlText",tokenize:Wj};function Wj(e,i,a){const r=this;let u,c,d;return p;function p(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),g}function g(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),ie):O===63?(e.consume(O),q):bn(O)?(e.consume(O),ae):a(O)}function m(O){return O===45?(e.consume(O),b):O===91?(e.consume(O),c=0,E):bn(O)?(e.consume(O),H):a(O)}function b(O){return O===45?(e.consume(O),w):a(O)}function x(O){return O===null?a(O):O===45?(e.consume(O),S):ze(O)?(d=x,se(O)):(e.consume(O),x)}function S(O){return O===45?(e.consume(O),w):x(O)}function w(O){return O===62?V(O):O===45?S(O):x(O)}function E(O){const A="CDATA[";return O===A.charCodeAt(c++)?(e.consume(O),c===A.length?R:E):a(O)}function R(O){return O===null?a(O):O===93?(e.consume(O),$):ze(O)?(d=R,se(O)):(e.consume(O),R)}function $(O){return O===93?(e.consume(O),M):R(O)}function M(O){return O===62?V(O):O===93?(e.consume(O),M):R(O)}function H(O){return O===null||O===62?V(O):ze(O)?(d=H,se(O)):(e.consume(O),H)}function q(O){return O===null?a(O):O===63?(e.consume(O),F):ze(O)?(d=q,se(O)):(e.consume(O),q)}function F(O){return O===62?V(O):q(O)}function ie(O){return bn(O)?(e.consume(O),N):a(O)}function N(O){return O===45||hn(O)?(e.consume(O),N):K(O)}function K(O){return ze(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||bt(O)?J(O):a(O)}function J(O){return O===47?(e.consume(O),V):O===58||O===95||bn(O)?(e.consume(O),I):ze(O)?(d=J,se(O)):We(O)?(e.consume(O),J):V(O)}function I(O){return O===45||O===46||O===58||O===95||hn(O)?(e.consume(O),I):te(O)}function te(O){return O===61?(e.consume(O),ue):ze(O)?(d=te,se(O)):We(O)?(e.consume(O),te):J(O)}function ue(O){return O===null||O===60||O===61||O===62||O===96?a(O):O===34||O===39?(e.consume(O),u=O,Ce):ze(O)?(d=ue,se(O)):We(O)?(e.consume(O),ue):(e.consume(O),xe)}function Ce(O){return O===u?(e.consume(O),u=void 0,ce):O===null?a(O):ze(O)?(d=Ce,se(O)):(e.consume(O),Ce)}function xe(O){return O===null||O===34||O===39||O===60||O===61||O===96?a(O):O===47||O===62||bt(O)?J(O):(e.consume(O),xe)}function ce(O){return O===47||O===62||bt(O)?J(O):a(O)}function V(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):a(O)}function se(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),we}function we(O){return We(O)?tt(e,Me,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):Me(O)}function Me(O){return e.enter("htmlTextData"),d(O)}}const yh={name:"labelEnd",resolveAll:Zj,resolveTo:Jj,tokenize:e0},Kj={tokenize:t0},Xj={tokenize:n0},Qj={tokenize:i0};function Zj(e){let i=-1;const a=[];for(;++i<e.length;){const r=e[i][1];if(a.push(e[i]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const u=r.type==="labelImage"?4:2;r.type="data",i+=u}}return e.length!==a.length&&Zn(e,0,e.length,a),e}function Jj(e,i){let a=e.length,r=0,u,c,d,p;for(;a--;)if(u=e[a][1],c){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;e[a][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(d){if(e[a][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(c=a,u.type!=="labelLink")){r=2;break}}else u.type==="labelEnd"&&(d=a);const g={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},b={type:"labelText",start:{...e[c+r+2][1].end},end:{...e[d-2][1].start}};return p=[["enter",g,i],["enter",m,i]],p=gi(p,e.slice(c+1,c+r+3)),p=gi(p,[["enter",b,i]]),p=gi(p,cd(i.parser.constructs.insideSpan.null,e.slice(c+r+4,d-3),i)),p=gi(p,[["exit",b,i],e[d-2],e[d-1],["exit",m,i]]),p=gi(p,e.slice(d+1)),p=gi(p,[["exit",g,i]]),Zn(e,c,e.length,p),e}function e0(e,i,a){const r=this;let u=r.events.length,c,d;for(;u--;)if((r.events[u][1].type==="labelImage"||r.events[u][1].type==="labelLink")&&!r.events[u][1]._balanced){c=r.events[u][1];break}return p;function p(S){return c?c._inactive?x(S):(d=r.parser.defined.includes(_i(r.sliceSerialize({start:c.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(S),e.exit("labelMarker"),e.exit("labelEnd"),g):a(S)}function g(S){return S===40?e.attempt(Kj,b,d?b:x)(S):S===91?e.attempt(Xj,b,d?m:x)(S):d?b(S):x(S)}function m(S){return e.attempt(Qj,b,x)(S)}function b(S){return i(S)}function x(S){return c._balanced=!0,a(S)}}function t0(e,i,a){return r;function r(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),u}function u(x){return bt(x)?ru(e,c)(x):c(x)}function c(x){return x===41?b(x):Fb(e,d,p,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function d(x){return bt(x)?ru(e,g)(x):b(x)}function p(x){return a(x)}function g(x){return x===34||x===39||x===40?Pb(e,m,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):b(x)}function m(x){return bt(x)?ru(e,b)(x):b(x)}function b(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),i):a(x)}}function n0(e,i,a){const r=this;return u;function u(p){return Yb.call(r,e,c,d,"reference","referenceMarker","referenceString")(p)}function c(p){return r.parser.defined.includes(_i(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(p):a(p)}function d(p){return a(p)}}function i0(e,i,a){return r;function r(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),u}function u(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),i):a(c)}}const a0={name:"labelStartImage",resolveAll:yh.resolveAll,tokenize:l0};function l0(e,i,a){const r=this;return u;function u(p){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(p),e.exit("labelImageMarker"),c}function c(p){return p===91?(e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelImage"),d):a(p)}function d(p){return p===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(p):i(p)}}const r0={name:"labelStartLink",resolveAll:yh.resolveAll,tokenize:s0};function s0(e,i,a){const r=this;return u;function u(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),c}function c(d){return d===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(d):i(d)}}const op={name:"lineEnding",tokenize:o0};function o0(e,i){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),tt(e,i,"linePrefix")}}const Xc={name:"thematicBreak",tokenize:u0};function u0(e,i,a){let r=0,u;return c;function c(m){return e.enter("thematicBreak"),d(m)}function d(m){return u=m,p(m)}function p(m){return m===u?(e.enter("thematicBreakSequence"),g(m)):r>=3&&(m===null||ze(m))?(e.exit("thematicBreak"),i(m)):a(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:p0},exit:m0,name:"list",tokenize:f0},c0={partial:!0,tokenize:g0},d0={partial:!0,tokenize:h0};function f0(e,i,a){const r=this,u=r.events[r.events.length-1];let c=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,d=0;return p;function p(w){const E=r.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!r.containerState.marker||w===r.containerState.marker:$p(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(Xc,a,m)(w):m(w);if(!r.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),g(w)}return a(w)}function g(w){return $p(w)&&++d<10?(e.consume(w),g):(!r.interrupt||d<2)&&(r.containerState.marker?w===r.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),m(w)):a(w)}function m(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||w,e.check(gu,r.interrupt?a:b,e.attempt(c0,S,x))}function b(w){return r.containerState.initialBlankLine=!0,c++,S(w)}function x(w){return We(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),S):a(w)}function S(w){return r.containerState.size=c+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(w)}}function p0(e,i,a){const r=this;return r.containerState._closeFlow=void 0,e.check(gu,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(d0,i,d)(p))}function d(p){return r.containerState._closeFlow=!0,r.interrupt=void 0,tt(e,e.attempt(In,i,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p)}}function h0(e,i,a){const r=this;return tt(e,u,"listItemIndent",r.containerState.size+1);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===r.containerState.size?i(c):a(c)}}function m0(e){e.exit(this.containerState.type)}function g0(e,i,a){const r=this;return tt(e,u,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(c){const d=r.events[r.events.length-1];return!We(c)&&d&&d[1].type==="listItemPrefixWhitespace"?i(c):a(c)}}const Jy={name:"setextUnderline",resolveTo:y0,tokenize:x0};function y0(e,i){let a=e.length,r,u,c;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){r=a;break}e[a][1].type==="paragraph"&&(u=a)}else e[a][1].type==="content"&&e.splice(a,1),!c&&e[a][1].type==="definition"&&(c=a);const d={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[u][1].type="setextHeadingText",c?(e.splice(u,0,["enter",d,i]),e.splice(c+1,0,["exit",e[r][1],i]),e[r][1].end={...e[c][1].end}):e[r][1]=d,e.push(["exit",d,i]),e}function x0(e,i,a){const r=this;let u;return c;function c(m){let b=r.events.length,x;for(;b--;)if(r.events[b][1].type!=="lineEnding"&&r.events[b][1].type!=="linePrefix"&&r.events[b][1].type!=="content"){x=r.events[b][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||x)?(e.enter("setextHeadingLine"),u=m,d(m)):a(m)}function d(m){return e.enter("setextHeadingLineSequence"),p(m)}function p(m){return m===u?(e.consume(m),p):(e.exit("setextHeadingLineSequence"),We(m)?tt(e,g,"lineSuffix")(m):g(m))}function g(m){return m===null||ze(m)?(e.exit("setextHeadingLine"),i(m)):a(m)}}const b0={tokenize:v0};function v0(e){const i=this,a=e.attempt(gu,r,e.attempt(this.parser.constructs.flowInitial,u,tt(e,e.attempt(this.parser.constructs.flow,u,e.attempt(Cj,u)),"linePrefix")));return a;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),i.currentConstruct=void 0,a}function u(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),i.currentConstruct=void 0,a}}const w0={resolveAll:Kb()},k0=Wb("string"),S0=Wb("text");function Wb(e){return{resolveAll:Kb(e==="text"?j0:void 0),tokenize:i};function i(a){const r=this,u=this.parser.constructs[e],c=a.attempt(u,d,p);return d;function d(b){return m(b)?c(b):p(b)}function p(b){if(b===null){a.consume(b);return}return a.enter("data"),a.consume(b),g}function g(b){return m(b)?(a.exit("data"),c(b)):(a.consume(b),g)}function m(b){if(b===null)return!0;const x=u[b];let S=-1;if(x)for(;++S<x.length;){const w=x[S];if(!w.previous||w.previous.call(r,r.previous))return!0}return!1}}}function Kb(e){return i;function i(a,r){let u=-1,c;for(;++u<=a.length;)c===void 0?a[u]&&a[u][1].type==="data"&&(c=u,u++):(!a[u]||a[u][1].type!=="data")&&(u!==c+2&&(a[c][1].end=a[u-1][1].end,a.splice(c+2,u-c-2),u=c+2),c=void 0);return e?e(a,r):a}}function j0(e,i){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const r=e[a-1][1],u=i.sliceStream(r);let c=u.length,d=-1,p=0,g;for(;c--;){const m=u[c];if(typeof m=="string"){for(d=m.length;m.charCodeAt(d-1)===32;)p++,d--;if(d)break;d=-1}else if(m===-2)g=!0,p++;else if(m!==-1){c++;break}}if(i._contentTypeTextTrailing&&a===e.length&&(p=0),p){const m={type:a===e.length||g||p<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:r.start._bufferIndex+d,_index:r.start._index+c,line:r.end.line,column:r.end.column-p,offset:r.end.offset-p},end:{...r.end}};r.end={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(e.splice(a,0,["enter",m,i],["exit",m,i]),a+=2)}a++}return e}const 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:Hb},T0={91:Dj},E0={[-2]:sp,[-1]:sp,32:sp},A0={35:Lj,42:Xc,45:[Jy,Xc],60:qj,61:Jy,95:Xc,96:Qy,126:Qy},N0={38:Gb,92:$b},D0={[-5]:op,[-4]:op,[-3]:op,33:a0,38:Gb,42:Gp,60:[rj,Pj],91:r0,92:[Oj,$b],93:yh,95:Gp,96:bj},R0={null:[Gp,w0]},_0={null:[42,95]},M0={null:[]},O0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:_0,contentInitial:T0,disable:M0,document:C0,flow:A0,flowInitial:E0,insideSpan:R0,string:N0,text:D0},Symbol.toStringTag,{value:"Module"}));function z0(e,i,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const u={},c=[];let d=[],p=[];const g={attempt:K(ie),check:K(N),consume:H,enter:q,exit:F,interrupt:K(N,{interrupt:!0})},m={code:null,containerState:{},defineSkip:R,events:[],now:E,parser:e,previous:null,sliceSerialize:S,sliceStream:w,write:x};let b=i.tokenize.call(m,g);return i.resolveAll&&c.push(i),m;function x(te){return d=gi(d,te),$(),d[d.length-1]!==null?[]:(ae(i,0),m.events=cd(c,m.events,m),m.events)}function S(te,ue){return I0(w(te),ue)}function w(te){return L0(d,te)}function E(){const{_bufferIndex:te,_index:ue,line:Ce,column:xe,offset:ce}=r;return{_bufferIndex:te,_index:ue,line:Ce,column:xe,offset:ce}}function R(te){u[te.line]=te.column,I()}function $(){let te;for(;r._index<d.length;){const ue=d[r._index];if(typeof ue=="string")for(te=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===te&&r._bufferIndex<ue.length;)M(ue.charCodeAt(r._bufferIndex));else M(ue)}}function M(te){b=b(te)}function H(te){ze(te)?(r.line++,r.column=1,r.offset+=te===-3?2:1,I()):te!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===d[r._index].length&&(r._bufferIndex=-1,r._index++)),m.previous=te}function q(te,ue){const Ce=ue||{};return Ce.type=te,Ce.start=E(),m.events.push(["enter",Ce,m]),p.push(Ce),Ce}function F(te){const ue=p.pop();return ue.end=E(),m.events.push(["exit",ue,m]),ue}function ie(te,ue){ae(te,ue.from)}function N(te,ue){ue.restore()}function K(te,ue){return Ce;function Ce(xe,ce,V){let se,we,Me,O;return Array.isArray(xe)?z(xe):"tokenize"in xe?z([xe]):A(xe);function A(ge){return Se;function Se(oe){const Oe=oe!==null&&ge[oe],vt=oe!==null&&ge.null,St=[...Array.isArray(Oe)?Oe:Oe?[Oe]:[],...Array.isArray(vt)?vt:vt?[vt]:[]];return z(St)(oe)}}function z(ge){return se=ge,we=0,ge.length===0?V:C(ge[we])}function C(ge){return Se;function Se(oe){return O=J(),Me=ge,ge.partial||(m.currentConstruct=ge),ge.name&&m.parser.constructs.disable.null.includes(ge.name)?he():ge.tokenize.call(ue?Object.assign(Object.create(m),ue):m,g,W,he)(oe)}}function W(ge){return te(Me,O),ce}function he(ge){return O.restore(),++we<se.length?C(se[we]):V}}}function ae(te,ue){te.resolveAll&&!c.includes(te)&&c.push(te),te.resolve&&Zn(m.events,ue,m.events.length-ue,te.resolve(m.events.slice(ue),m)),te.resolveTo&&(m.events=te.resolveTo(m.events,m))}function J(){const te=E(),ue=m.previous,Ce=m.currentConstruct,xe=m.events.length,ce=Array.from(p);return{from:xe,restore:V};function V(){r=te,m.previous=ue,m.currentConstruct=Ce,m.events.length=xe,p=ce,I()}}function I(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function L0(e,i){const a=i.start._index,r=i.start._bufferIndex,u=i.end._index,c=i.end._bufferIndex;let d;if(a===u)d=[e[a].slice(r,c)];else{if(d=e.slice(a,u),r>-1){const p=d[0];typeof p=="string"?d[0]=p.slice(r):d.shift()}c>0&&d.push(e[u].slice(0,c))}return d}function I0(e,i){let a=-1;const r=[];let u;for(;++a<e.length;){const c=e[a];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
52
+ `;break}case-3:{d=`\r
53
+ `;break}case-2:{d=i?" ":" ";break}case-1:{if(!i&&u)continue;d=" ";break}default:d=String.fromCharCode(c)}u=c===-2,r.push(d)}return r.join("")}function U0(e){const r={constructs:Bb([O0,...(e||{}).extensions||[]]),content:u(JS),defined:[],document:u(tj),flow:u(b0),lazy:{},string:u(k0),text:u(S0)};return r;function u(c){return d;function d(p){return z0(r,c,p)}}}function B0(e){for(;!Vb(e););return e}const ex=/[\0\t\n\r]/g;function q0(){let e=1,i="",a=!0,r;return u;function u(c,d,p){const g=[];let m,b,x,S,w;for(c=i+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),x=0,i="",a&&(c.charCodeAt(0)===65279&&x++,a=void 0);x<c.length;){if(ex.lastIndex=x,m=ex.exec(c),S=m&&m.index!==void 0?m.index:c.length,w=c.charCodeAt(S),!m){i=c.slice(x);break}if(w===10&&x===S&&r)g.push(-3),r=void 0;else switch(r&&(g.push(-5),r=void 0),x<S&&(g.push(c.slice(x,S)),e+=S-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=S+1}return p&&(r&&g.push(-5),i&&g.push(i),g.push(null)),g}}const H0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function $0(e){return e.replace(H0,G0)}function G0(e,i,a){if(i)return i;if(a.charCodeAt(0)===35){const u=a.charCodeAt(1),c=u===120||u===88;return qb(a.slice(c?2:1),c?16:10)}return gh(a)||e}const Xb={}.hasOwnProperty;function V0(e,i,a){return i&&typeof i=="object"&&(a=i,i=void 0),F0(a)(B0(U0(a).document().write(q0()(e,i,!0))))}function F0(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(jt),autolinkProtocol:J,autolinkEmail:J,atxHeading:c(nn),blockQuote:c(vt),characterEscape:J,characterReference:J,codeFenced:c(St),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(St,d),codeText:c(vn,d),codeTextData:J,data:J,codeFlowValue:J,definition:c(Ke),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(mt),hardBreakEscape:c(wn),hardBreakTrailing:c(wn),htmlFlow:c(Ie,d),htmlFlowData:J,htmlText:c(Ie,d),htmlTextData:J,image:c(It),label:d,link:c(jt),listItem:c(Mi),listItemValue:S,listOrdered:c($t,x),listUnordered:c($t),paragraph:c(xi),reference:C,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(nn),strong:c(zl),thematicBreak:c(ia)},exit:{atxHeading:g(),atxHeadingSequence:ie,autolink:g(),autolinkEmail:Oe,autolinkProtocol:oe,blockQuote:g(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:ge,characterReference:Se,codeFenced:g($),codeFencedFence:R,codeFencedFenceInfo:w,codeFencedFenceMeta:E,codeFlowValue:I,codeIndented:g(M),codeText:g(ce),codeTextData:I,data:I,definition:g(),definitionDestinationString:F,definitionLabelString:H,definitionTitleString:q,emphasis:g(),hardBreakEscape:g(ue),hardBreakTrailing:g(ue),htmlFlow:g(Ce),htmlFlowData:I,htmlText:g(xe),htmlTextData:I,image:g(se),label:Me,labelText:we,lineEnding:te,link:g(V),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:W,resourceDestinationString:O,resourceTitleString:A,resource:z,setextHeading:g(ae),setextHeadingLineSequence:K,setextHeadingText:N,strong:g(),thematicBreak:g()}};Qb(i,(e||{}).mdastExtensions||[]);const a={};return r;function r(ne){let de={type:"root",children:[]};const Ne={stack:[de],tokenStack:[],config:i,enter:p,exit:m,buffer:d,resume:b,data:a},qe=[];let Xe=-1;for(;++Xe<ne.length;)if(ne[Xe][1].type==="listOrdered"||ne[Xe][1].type==="listUnordered")if(ne[Xe][0]==="enter")qe.push(Xe);else{const Gt=qe.pop();Xe=u(ne,Gt,Xe)}for(Xe=-1;++Xe<ne.length;){const Gt=i[ne[Xe][0]];Xb.call(Gt,ne[Xe][1].type)&&Gt[ne[Xe][1].type].call(Object.assign({sliceSerialize:ne[Xe][2].sliceSerialize},Ne),ne[Xe][1])}if(Ne.tokenStack.length>0){const Gt=Ne.tokenStack[Ne.tokenStack.length-1];(Gt[1]||tx).call(Ne,void 0,Gt[0])}for(de.position={start:Al(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:Al(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<i.transforms.length;)de=i.transforms[Xe](de)||de;return de}function u(ne,de,Ne){let qe=de-1,Xe=-1,Gt=!1,ei,Kt,Et,Xt;for(;++qe<=Ne;){const rt=ne[qe];switch(rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rt[0]==="enter"?Xe++:Xe--,Xt=void 0;break}case"lineEndingBlank":{rt[0]==="enter"&&(ei&&!Xt&&!Xe&&!Et&&(Et=qe),Xt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Xt=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(ei){let At=qe;for(Kt=void 0;At--;){const kn=ne[At];if(kn[1].type==="lineEnding"||kn[1].type==="lineEndingBlank"){if(kn[0]==="exit")continue;Kt&&(ne[Kt][1].type="lineEndingBlank",Gt=!0),kn[1].type="lineEnding",Kt=At}else if(!(kn[1].type==="linePrefix"||kn[1].type==="blockQuotePrefix"||kn[1].type==="blockQuotePrefixWhitespace"||kn[1].type==="blockQuoteMarker"||kn[1].type==="listItemIndent"))break}Et&&(!Kt||Et<Kt)&&(ei._spread=!0),ei.end=Object.assign({},Kt?ne[Kt][1].start:rt[1].end),ne.splice(Kt||qe,0,["exit",ei,rt[2]]),qe++,Ne++}if(rt[1].type==="listItemPrefix"){const At={type:"listItem",_spread:!1,start:Object.assign({},rt[1].start),end:void 0};ei=At,ne.splice(qe,0,["enter",At,rt[2]]),qe++,Ne++,Et=void 0,Xt=!0}}}return ne[de][1]._spread=Gt,Ne}function c(ne,de){return Ne;function Ne(qe){p.call(this,ne(qe),qe),de&&de.call(this,qe)}}function d(){this.stack.push({type:"fragment",children:[]})}function p(ne,de,Ne){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([de,Ne||void 0]),ne.position={start:Al(de.start),end:void 0}}function g(ne){return de;function de(Ne){ne&&ne.call(this,Ne),m.call(this,Ne)}}function m(ne,de){const Ne=this.stack.pop(),qe=this.tokenStack.pop();if(qe)qe[0].type!==ne.type&&(de?de.call(this,ne,qe[0]):(qe[1]||tx).call(this,ne,qe[0]));else throw new Error("Cannot close `"+ne.type+"` ("+lu({start:ne.start,end:ne.end})+"): it’s not open");Ne.position.end=Al(ne.end)}function b(){return mh(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function S(ne){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.lang=ne}function E(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.meta=ne}function R(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function $(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function M(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne.replace(/(\r?\n|\r)$/g,"")}function H(ne){const de=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=de,Ne.identifier=_i(this.sliceSerialize(ne)).toLowerCase()}function q(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.title=ne}function F(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.url=ne}function ie(ne){const de=this.stack[this.stack.length-1];if(!de.depth){const Ne=this.sliceSerialize(ne).length;de.depth=Ne}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function K(ne){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function ae(){this.data.setextHeadingSlurpLineEnding=void 0}function J(ne){const Ne=this.stack[this.stack.length-1].children;let qe=Ne[Ne.length-1];(!qe||qe.type!=="text")&&(qe=Ct(),qe.position={start:Al(ne.start),end:void 0},Ne.push(qe)),this.stack.push(qe)}function I(ne){const de=this.stack.pop();de.value+=this.sliceSerialize(ne),de.position.end=Al(ne.end)}function te(ne){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ne=de.children[de.children.length-1];Ne.position.end=Al(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(de.type)&&(J.call(this,ne),I.call(this,ne))}function ue(){this.data.atHardBreak=!0}function Ce(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function xe(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function ce(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function V(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=de,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function se(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=de,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function we(ne){const de=this.sliceSerialize(ne),Ne=this.stack[this.stack.length-2];Ne.label=$0(de),Ne.identifier=_i(de).toLowerCase()}function Me(){const ne=this.stack[this.stack.length-1],de=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){const qe=ne.children;Ne.children=qe}else Ne.alt=de}function O(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.url=ne}function A(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.title=ne}function z(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function W(ne){const de=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=de,Ne.identifier=_i(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function he(ne){this.data.characterReferenceType=ne.type}function ge(ne){const de=this.sliceSerialize(ne),Ne=this.data.characterReferenceType;let qe;Ne?(qe=qb(de,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):qe=gh(de);const Xe=this.stack[this.stack.length-1];Xe.value+=qe}function Se(ne){const de=this.stack.pop();de.position.end=Al(ne.end)}function oe(ne){I.call(this,ne);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(ne)}function Oe(ne){I.call(this,ne);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(ne)}function vt(){return{type:"blockquote",children:[]}}function St(){return{type:"code",lang:null,meta:null,value:""}}function vn(){return{type:"inlineCode",value:""}}function Ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function mt(){return{type:"emphasis",children:[]}}function nn(){return{type:"heading",depth:0,children:[]}}function wn(){return{type:"break"}}function Ie(){return{type:"html",value:""}}function It(){return{type:"image",title:null,url:"",alt:null}}function jt(){return{type:"link",title:null,url:"",children:[]}}function $t(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function Mi(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function xi(){return{type:"paragraph",children:[]}}function zl(){return{type:"strong",children:[]}}function Ct(){return{type:"text",value:""}}function ia(){return{type:"thematicBreak"}}}function Al(e){return{line:e.line,column:e.column,offset:e.offset}}function Qb(e,i){let a=-1;for(;++a<i.length;){const r=i[a];Array.isArray(r)?Qb(e,r):Y0(e,r)}}function Y0(e,i){let a;for(a in i)if(Xb.call(i,a))switch(a){case"canContainEols":{const r=i[a];r&&e[a].push(...r);break}case"transforms":{const r=i[a];r&&e[a].push(...r);break}case"enter":case"exit":{const r=i[a];r&&Object.assign(e[a],r);break}}}function tx(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+lu({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+lu({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+lu({start:i.start,end:i.end})+") is still open")}function P0(e){const i=this;i.parser=a;function a(r){return V0(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function W0(e,i){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,a),e.applyData(i,a)}function K0(e,i){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,a),[e.applyData(i,a),{type:"text",value:`
54
+ `}]}function X0(e,i){const a=i.value?i.value+`
55
+ `:"",r={},u=i.lang?i.lang.split(/\s+/):[];u.length>0&&(r.className=["language-"+u[0]]);let c={type:"element",tagName:"code",properties:r,children:[{type:"text",value:a}]};return i.meta&&(c.data={meta:i.meta}),e.patch(i,c),c=e.applyData(i,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(i,c),c}function Q0(e,i){const a={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function Z0(e,i){const a={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function J0(e,i){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),u=Rs(r.toLowerCase()),c=e.footnoteOrder.indexOf(r);let d,p=e.footnoteCounts.get(r);p===void 0?(p=0,e.footnoteOrder.push(r),d=e.footnoteOrder.length):d=c+1,p+=1,e.footnoteCounts.set(r,p);const g={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+u,id:a+"fnref-"+u+(p>1?"-"+p:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(i,g);const m={type:"element",tagName:"sup",properties:{},children:[g]};return e.patch(i,m),e.applyData(i,m)}function e1(e,i){const a={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function t1(e,i){if(e.options.allowDangerousHtml){const a={type:"raw",value:i.value};return e.patch(i,a),e.applyData(i,a)}}function Zb(e,i){const a=i.referenceType;let r="]";if(a==="collapsed"?r+="[]":a==="full"&&(r+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+r}];const u=e.all(i),c=u[0];c&&c.type==="text"?c.value="["+c.value:u.unshift({type:"text",value:"["});const d=u[u.length-1];return d&&d.type==="text"?d.value+=r:u.push({type:"text",value:r}),u}function n1(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Zb(e,i);const u={src:Rs(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 i1(e,i){const a={src:Rs(i.url)};i.alt!==null&&i.alt!==void 0&&(a.alt=i.alt),i.title!==null&&i.title!==void 0&&(a.title=i.title);const r={type:"element",tagName:"img",properties:a,children:[]};return e.patch(i,r),e.applyData(i,r)}function a1(e,i){const a={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,a);const r={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(i,r),e.applyData(i,r)}function l1(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Zb(e,i);const u={href:Rs(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 r1(e,i){const a={href:Rs(i.url)};i.title!==null&&i.title!==void 0&&(a.title=i.title);const r={type:"element",tagName:"a",properties:a,children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function s1(e,i,a){const r=e.all(i),u=a?o1(a):Jb(i),c={},d=[];if(typeof i.checked=="boolean"){const b=r[0];let x;b&&b.type==="element"&&b.tagName==="p"?x=b:(x={type:"element",tagName:"p",properties:{},children:[]},r.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let p=-1;for(;++p<r.length;){const b=r[p];(u||p!==0||b.type!=="element"||b.tagName!=="p")&&d.push({type:"text",value:`
56
+ `}),b.type==="element"&&b.tagName==="p"&&!u?d.push(...b.children):d.push(b)}const g=r[r.length-1];g&&(u||g.type!=="element"||g.tagName!=="p")&&d.push({type:"text",value:`
57
+ `});const m={type:"element",tagName:"li",properties:c,children:d};return e.patch(i,m),e.applyData(i,m)}function o1(e){let i=!1;if(e.type==="list"){i=e.spread||!1;const a=e.children;let r=-1;for(;!i&&++r<a.length;)i=Jb(a[r])}return i}function Jb(e){const i=e.spread;return i??e.children.length>1}function u1(e,i){const a={},r=e.all(i);let u=-1;for(typeof i.start=="number"&&i.start!==1&&(a.start=i.start);++u<r.length;){const d=r[u];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const c={type:"element",tagName:i.ordered?"ol":"ul",properties:a,children:e.wrap(r,!0)};return e.patch(i,c),e.applyData(i,c)}function c1(e,i){const a={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function d1(e,i){const a={type:"root",children:e.wrap(e.all(i))};return e.patch(i,a),e.applyData(i,a)}function f1(e,i){const a={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function p1(e,i){const a=e.all(i),r=a.shift(),u=[];if(r){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(i.children[0],d),u.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},p=dh(i.children[1]),g=_b(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 h1(e,i,a){const r=a?a.children:void 0,c=(r?r.indexOf(i):1)===0?"th":"td",d=a&&a.type==="table"?a.align:void 0,p=d?d.length:i.children.length;let g=-1;const m=[];for(;++g<p;){const x=i.children[g],S={},w=d?d[g]:void 0;w&&(S.align=w);let E={type:"element",tagName:c,properties:S,children:[]};x&&(E.children=e.all(x),e.patch(x,E),E=e.applyData(x,E)),m.push(E)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(i,b),e.applyData(i,b)}function m1(e,i){const a={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}const nx=9,ix=32;function g1(e){const i=String(e),a=/\r?\n|\r/g;let r=a.exec(i),u=0;const c=[];for(;r;)c.push(ax(i.slice(u,r.index),u>0,!0),r[0]),u=r.index+r[0].length,r=a.exec(i);return c.push(ax(i.slice(u),u>0,!1)),c.join("")}function ax(e,i,a){let r=0,u=e.length;if(i){let c=e.codePointAt(r);for(;c===nx||c===ix;)r++,c=e.codePointAt(r)}if(a){let c=e.codePointAt(u-1);for(;c===nx||c===ix;)u--,c=e.codePointAt(u-1)}return u>r?e.slice(r,u):""}function y1(e,i){const a={type:"text",value:g1(String(i.value))};return e.patch(i,a),e.applyData(i,a)}function x1(e,i){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,a),e.applyData(i,a)}const b1={blockquote:W0,break:K0,code:X0,delete:Q0,emphasis:Z0,footnoteReference:J0,heading:e1,html:t1,imageReference:n1,image:i1,inlineCode:a1,linkReference:l1,link:r1,listItem:s1,list:u1,paragraph:c1,root:d1,strong:f1,table:p1,tableCell:m1,tableRow:h1,text:y1,thematicBreak:x1,toml:Ic,yaml:Ic,definition:Ic,footnoteDefinition:Ic};function Ic(){}const ev=-1,dd=0,su=1,nd=2,xh=3,bh=4,vh=5,wh=6,tv=7,nv=8,v1=typeof self=="object"?self:globalThis,lx=(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 v1[e](i)},w1=(e,i)=>{const a=(u,c)=>(e.set(c,u),u),r=u=>{if(e.has(u))return e.get(u);const[c,d]=i[u];switch(c){case dd:case ev:return a(d,u);case su:{const p=a([],u);for(const g of d)p.push(r(g));return p}case nd:{const p=a({},u);for(const[g,m]of d)p[r(g)]=r(m);return p}case xh:return a(new Date(d),u);case bh:{const{source:p,flags:g}=d;return a(new RegExp(p,g),u)}case vh:{const p=a(new Map,u);for(const[g,m]of d)p.set(r(g),r(m));return p}case wh:{const p=a(new Set,u);for(const g of d)p.add(r(g));return p}case tv:{const{name:p,message:g}=d;return a(lx(p,g),u)}case nv:return a(BigInt(d),u);case"BigInt":return a(Object(BigInt(d)),u);case"ArrayBuffer":return a(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:p}=new Uint8Array(d);return a(new DataView(p),d)}}return a(lx(c,d),u)};return r},rx=e=>w1(new Map,e)(0),yr="",{toString:k1}={},{keys:S1}=Object,Ko=e=>{const i=typeof e;if(i!=="object"||!e)return[dd,i];const a=k1.call(e).slice(8,-1);switch(a){case"Array":return[su,yr];case"Object":return[nd,yr];case"Date":return[xh,yr];case"RegExp":return[bh,yr];case"Map":return[vh,yr];case"Set":return[wh,yr];case"DataView":return[su,a]}return a.includes("Array")?[su,a]:a.includes("Error")?[tv,a]:[nd,a]},Uc=([e,i])=>e===dd&&(i==="function"||i==="symbol"),j1=(e,i,a,r)=>{const u=(d,p)=>{const g=r.push(d)-1;return a.set(p,g),g},c=d=>{if(a.has(d))return a.get(d);let[p,g]=Ko(d);switch(p){case dd:{let b=d;switch(g){case"bigint":p=nv,b=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+g);b=null;break;case"undefined":return u([ev],d)}return u([p,b],d)}case su:{if(g){let S=d;return g==="DataView"?S=new Uint8Array(d.buffer):g==="ArrayBuffer"&&(S=new Uint8Array(d)),u([g,[...S]],d)}const b=[],x=u([p,b],d);for(const S of d)b.push(c(S));return x}case nd:{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 S of S1(d))(e||!Uc(Ko(d[S])))&&b.push([c(S),c(d[S])]);return x}case xh:return u([p,isNaN(d.getTime())?yr:d.toISOString()],d);case bh:{const{source:b,flags:x}=d;return u([p,{source:b,flags:x}],d)}case vh:{const b=[],x=u([p,b],d);for(const[S,w]of d)(e||!(Uc(Ko(S))||Uc(Ko(w))))&&b.push([c(S),c(w)]);return x}case wh:{const b=[],x=u([p,b],d);for(const S of d)(e||!Uc(Ko(S)))&&b.push(c(S));return x}}const{message:m}=d;return u([p,{name:g,message:m}],d)};return c},sx=(e,{json:i,lossy:a}={})=>{const r=[];return j1(!(i||a),!!i,new Map,r)(e),r},id=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?rx(sx(e,i)):structuredClone(e):(e,i)=>rx(sx(e,i));function C1(e,i){const a=[{type:"text",value:"↩"}];return i>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),a}function T1(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function E1(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||C1,r=e.options.footnoteBackLabel||T1,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(),S=Rs(x.toLowerCase());let w=0;const E=[],R=e.footnoteCounts.get(x);for(;R!==void 0&&++w<=R;){E.length>0&&E.push({type:"text",value:" "});let H=typeof a=="string"?a:a(g,w);typeof H=="string"&&(H={type:"text",value:H}),E.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+S+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(g,w),className:["data-footnote-backref"]},children:Array.isArray(H)?H:[H]})}const $=b[b.length-1];if($&&$.type==="element"&&$.tagName==="p"){const H=$.children[$.children.length-1];H&&H.type==="text"?H.value+=" ":$.children.push({type:"text",value:" "}),$.children.push(...E)}else b.push(...E);const M={type:"element",tagName:"li",properties:{id:i+"fn-"+S},children:e.wrap(b,!0)};e.patch(m,M),p.push(M)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...id(d),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
58
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(p,!0)},{type:"text",value:`
59
+ `}]}}const fd=(function(e){if(e==null)return R1;if(typeof e=="function")return pd(e);if(typeof e=="object")return Array.isArray(e)?A1(e):N1(e);if(typeof e=="string")return D1(e);throw new Error("Expected function, string, or object as test")});function A1(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=fd(e[a]);return pd(r);function r(...u){let c=-1;for(;++c<i.length;)if(i[c].apply(this,u))return!0;return!1}}function N1(e){const i=e;return pd(a);function a(r){const u=r;let c;for(c in e)if(u[c]!==i[c])return!1;return!0}}function D1(e){return pd(i);function i(a){return a&&a.type===e}}function pd(e){return i;function i(a,r,u){return!!(_1(a)&&e.call(this,a,typeof r=="number"?r:void 0,u||void 0))}}function R1(){return!0}function _1(e){return e!==null&&typeof e=="object"&&"type"in e}const iv=[],M1=!0,Vp=!1,O1="skip";function av(e,i,a,r){let u;typeof i=="function"&&typeof a!="function"?(r=a,a=i):u=i;const c=fd(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(S,"name",{value:"node ("+(g.type+(w?"<"+w+">":""))+")"})}return S;function S(){let w=iv,E,R,$;if((!i||c(g,m,b[b.length-1]||void 0))&&(w=z1(a(g,b)),w[0]===Vp))return w;if("children"in g&&g.children){const M=g;if(M.children&&w[0]!==O1)for(R=(r?M.children.length:-1)+d,$=b.concat(M);R>-1&&R<M.children.length;){const H=M.children[R];if(E=p(H,R,$)(),E[0]===Vp)return E;R=typeof E[1]=="number"?E[1]:R+d}}return w}}}function z1(e){return Array.isArray(e)?e:typeof e=="number"?[M1,e]:e==null?iv:[e]}function kh(e,i,a,r){let u,c,d;typeof i=="function"&&typeof a!="function"?(c=void 0,d=i,u=a):(c=i,d=a,u=r),av(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 Fp={}.hasOwnProperty,L1={};function I1(e,i){const a=i||L1,r=new Map,u=new Map,c=new Map,d={...b1,...a.handlers},p={all:m,applyData:B1,definitionById:r,footnoteById:u,footnoteCounts:c,footnoteOrder:[],handlers:d,one:g,options:a,patch:U1,wrap:H1};return kh(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const x=b.type==="definition"?r:u,S=String(b.identifier).toUpperCase();x.has(S)||x.set(S,b)}}),p;function g(b,x){const S=b.type,w=p.handlers[S];if(Fp.call(p.handlers,S)&&w)return w(p,b,x);if(p.options.passThrough&&p.options.passThrough.includes(S)){if("children"in b){const{children:R,...$}=b,M=id($);return M.children=p.all(b),M}return id(b)}return(p.options.unknownHandler||q1)(p,b,x)}function m(b){const x=[];if("children"in b){const S=b.children;let w=-1;for(;++w<S.length;){const E=p.one(S[w],b);if(E){if(w&&S[w-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=ox(E.value)),!Array.isArray(E)&&E.type==="element")){const R=E.children[0];R&&R.type==="text"&&(R.value=ox(R.value))}Array.isArray(E)?x.push(...E):x.push(E)}}}return x}}function U1(e,i){e.position&&(i.position=CS(e))}function B1(e,i){let a=i;if(e&&e.data){const r=e.data.hName,u=e.data.hChildren,c=e.data.hProperties;if(typeof r=="string")if(a.type==="element")a.tagName=r;else{const d="children"in a?a.children:[a];a={type:"element",tagName:r,properties:{},children:d}}a.type==="element"&&c&&Object.assign(a.properties,id(c)),"children"in a&&a.children&&u!==null&&u!==void 0&&(a.children=u)}return a}function q1(e,i){const a=i.data||{},r="value"in i&&!(Fp.call(a,"hProperties")||Fp.call(a,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function H1(e,i){const a=[];let r=-1;for(i&&a.push({type:"text",value:`
60
+ `});++r<e.length;)r&&a.push({type:"text",value:`
61
+ `}),a.push(e[r]);return i&&e.length>0&&a.push({type:"text",value:`
62
+ `}),a}function ox(e){let i=0,a=e.charCodeAt(i);for(;a===9||a===32;)i++,a=e.charCodeAt(i);return e.slice(i)}function ux(e,i){const a=I1(e,i),r=a.one(e,void 0),u=E1(a),c=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return u&&c.children.push({type:"text",value:`
63
+ `},u),c}function $1(e,i){return e&&"run"in e?async function(a,r){const u=ux(a,{file:r,...i});await e.run(u,r)}:function(a,r){return ux(a,{file:r,...e||i})}}function cx(e){if(e)throw e}var up,dx;function G1(){if(dx)return up;dx=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,u=function(m){return typeof Array.isArray=="function"?Array.isArray(m):i.call(m)==="[object Array]"},c=function(m){if(!m||i.call(m)!=="[object Object]")return!1;var b=e.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!b&&!x)return!1;var S;for(S in m);return typeof S>"u"||e.call(m,S)},d=function(m,b){a&&b.name==="__proto__"?a(m,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):m[b.name]=b.newValue},p=function(m,b){if(b==="__proto__")if(e.call(m,b)){if(r)return r(m,b).value}else return;return m[b]};return up=function g(){var m,b,x,S,w,E,R=arguments[0],$=1,M=arguments.length,H=!1;for(typeof R=="boolean"&&(H=R,R=arguments[1]||{},$=2),(R==null||typeof R!="object"&&typeof R!="function")&&(R={});$<M;++$)if(m=arguments[$],m!=null)for(b in m)x=p(R,b),S=p(m,b),R!==S&&(H&&S&&(c(S)||(w=u(S)))?(w?(w=!1,E=x&&u(x)?x:[]):E=x&&c(x)?x:{},d(R,{name:b,newValue:g(H,E,S)})):typeof S<"u"&&d(R,{name:b,newValue:S}));return R},up}var V1=G1();const cp=jb(V1);function Yp(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function F1(){const e=[],i={run:a,use:r};return i;function a(...u){let c=-1;const d=u.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);p(null,...u);function p(g,...m){const b=e[++c];let x=-1;if(g){d(g);return}for(;++x<u.length;)(m[x]===null||m[x]===void 0)&&(m[x]=u[x]);u=m,b?Y1(b,p)(...m):d(null,...m)}}function r(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return e.push(u),i}}function Y1(e,i){let a;return r;function r(...d){const p=e.length>d.length;let g;p&&d.push(u);try{g=e.apply(this,d)}catch(m){const b=m;if(p&&a)throw b;return u(b)}p||(g&&g.then&&typeof g.then=="function"?g.then(c,u):g instanceof Error?u(g):c(g))}function u(d,...p){a||(a=!0,i(d,...p))}function c(d){u(null,d)}}const Ji={basename:P1,dirname:W1,extname:K1,join:X1,sep:"/"};function P1(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');yu(e);let a=0,r=-1,u=e.length,c;if(i===void 0||i.length===0||i.length>e.length){for(;u--;)if(e.codePointAt(u)===47){if(c){a=u+1;break}}else r<0&&(c=!0,r=u+1);return r<0?"":e.slice(a,r)}if(i===e)return"";let d=-1,p=i.length-1;for(;u--;)if(e.codePointAt(u)===47){if(c){a=u+1;break}}else d<0&&(c=!0,d=u+1),p>-1&&(e.codePointAt(u)===i.codePointAt(p--)?p<0&&(r=u):(p=-1,r=d));return a===r?r=d:r<0&&(r=e.length),e.slice(a,r)}function W1(e){if(yu(e),e.length===0)return".";let i=-1,a=e.length,r;for(;--a;)if(e.codePointAt(a)===47){if(r){i=a;break}}else r||(r=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function K1(e){yu(e);let i=e.length,a=-1,r=0,u=-1,c=0,d;for(;i--;){const p=e.codePointAt(i);if(p===47){if(d){r=i+1;break}continue}a<0&&(d=!0,a=i+1),p===46?u<0?u=i:c!==1&&(c=1):u>-1&&(c=-1)}return u<0||a<0||c===0||c===1&&u===a-1&&u===r+1?"":e.slice(u,a)}function X1(...e){let i=-1,a;for(;++i<e.length;)yu(e[i]),e[i]&&(a=a===void 0?e[i]:a+"/"+e[i]);return a===void 0?".":Q1(a)}function Q1(e){yu(e);const i=e.codePointAt(0)===47;let a=Z1(e,!i);return a.length===0&&!i&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),i?"/"+a:a}function Z1(e,i){let a="",r=0,u=-1,c=0,d=-1,p,g;for(;++d<=e.length;){if(d<e.length)p=e.codePointAt(d);else{if(p===47)break;p=47}if(p===47){if(!(u===d-1||c===1))if(u!==d-1&&c===2){if(a.length<2||r!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(g=a.lastIndexOf("/"),g!==a.length-1){g<0?(a="",r=0):(a=a.slice(0,g),r=a.length-1-a.lastIndexOf("/")),u=d,c=0;continue}}else if(a.length>0){a="",r=0,u=d,c=0;continue}}i&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+e.slice(u+1,d):a=e.slice(u+1,d),r=d-u-1;u=d,c=0}else p===46&&c>-1?c++:c=-1}return a}function yu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const J1={cwd:eC};function eC(){return"/"}function Pp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function tC(e){if(typeof e=="string")e=new URL(e);else if(!Pp(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 nC(e)}function nC(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const i=e.pathname;let a=-1;for(;++a<i.length;)if(i.codePointAt(a)===37&&i.codePointAt(a+1)===50){const r=i.codePointAt(a+2);if(r===70||r===102){const u=new TypeError("File URL path must not include encoded / characters");throw u.code="ERR_INVALID_FILE_URL_PATH",u}}return decodeURIComponent(i)}const dp=["history","path","basename","stem","extname","dirname"];class lv{constructor(i){let a;i?Pp(i)?a={path:i}:typeof i=="string"||iC(i)?a={value:i}:a=i:a={},this.cwd="cwd"in a?"":J1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<dp.length;){const c=dp[r];c in a&&a[c]!==void 0&&a[c]!==null&&(this[c]=c==="history"?[...a[c]]:a[c])}let u;for(u in a)dp.includes(u)||(this[u]=a[u])}get basename(){return typeof this.path=="string"?Ji.basename(this.path):void 0}set basename(i){pp(i,"basename"),fp(i,"basename"),this.path=Ji.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Ji.dirname(this.path):void 0}set dirname(i){fx(this.basename,"dirname"),this.path=Ji.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Ji.extname(this.path):void 0}set extname(i){if(fp(i,"extname"),fx(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=Ji.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){Pp(i)&&(i=tC(i)),pp(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Ji.basename(this.path,this.extname):void 0}set stem(i){pp(i,"stem"),fp(i,"stem"),this.path=Ji.join(this.dirname||"",i+(this.extname||""))}fail(i,a,r){const u=this.message(i,a,r);throw u.fatal=!0,u}info(i,a,r){const u=this.message(i,a,r);return u.fatal=void 0,u}message(i,a,r){const u=new mn(i,a,r);return this.path&&(u.name=this.path+":"+u.name,u.file=this.path),u.fatal=!1,this.messages.push(u),u}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function fp(e,i){if(e&&e.includes(Ji.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Ji.sep+"`")}function pp(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function fx(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function iC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const aC=(function(e){const r=this.constructor.prototype,u=r[e],c=function(){return u.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),lC={}.hasOwnProperty;class Sh extends aC{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=F1()}copy(){const i=new Sh;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];i.use(...r)}return i.data(cp(!0,{},this.namespace)),i}data(i,a){return typeof i=="string"?arguments.length===2?(gp("data",this.frozen),this.namespace[i]=a,this):lC.call(this.namespace,i)&&this.namespace[i]||void 0:i?(gp("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const u=a.call(i,...r);typeof u=="function"&&this.transformers.use(u)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const a=Bc(i),r=this.parser||this.Parser;return hp("parse",r),r(String(a),a)}process(i,a){const r=this;return this.freeze(),hp("process",this.parser||this.Parser),mp("process",this.compiler||this.Compiler),a?u(void 0,a):new Promise(u);function u(c,d){const p=Bc(i),g=r.parse(p);r.run(g,p,function(b,x,S){if(b||!x||!S)return m(b);const w=x,E=r.stringify(w,S);oC(E)?S.value=E:S.result=E,m(b,S)});function m(b,x){b||!x?d(b):c?c(x):a(void 0,x)}}}processSync(i){let a=!1,r;return this.freeze(),hp("processSync",this.parser||this.Parser),mp("processSync",this.compiler||this.Compiler),this.process(i,u),hx("processSync","process",a),r;function u(c,d){a=!0,cx(c),r=d}}run(i,a,r){px(i),this.freeze();const u=this.transformers;return!r&&typeof a=="function"&&(r=a,a=void 0),r?c(void 0,r):new Promise(c);function c(d,p){const g=Bc(a);u.run(i,g,m);function m(b,x,S){const w=x||i;b?p(b):d?d(w):r(void 0,w,S)}}}runSync(i,a){let r=!1,u;return this.run(i,a,c),hx("runSync","run",r),u;function c(d,p){cx(d),u=p,r=!0}}stringify(i,a){this.freeze();const r=Bc(a),u=this.compiler||this.Compiler;return mp("stringify",u),px(i),u(i,r)}use(i,...a){const r=this.attachers,u=this.namespace;if(gp("use",this.frozen),i!=null)if(typeof i=="function")g(i,a);else if(typeof i=="object")Array.isArray(i)?p(i):d(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function c(m){if(typeof m=="function")g(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[b,...x]=m;g(b,x)}else d(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function d(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");p(m.plugins),m.settings&&(u.settings=cp(!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,S=-1;for(;++x<r.length;)if(r[x][0]===m){S=x;break}if(S===-1)r.push([m,...b]);else if(b.length>0){let[w,...E]=b;const R=r[S][1];Yp(R)&&Yp(w)&&(w=cp(!0,R,w)),r[S]=[m,w,...E]}}}}const rC=new Sh().freeze();function hp(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function mp(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function gp(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 px(e){if(!Yp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function hx(e,i,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function Bc(e){return sC(e)?e:new lv(e)}function sC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function oC(e){return typeof e=="string"||uC(e)}function uC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",mx=[],gx={allowDangerousHtml:!0},dC=/^(https?|ircs?|mailto|xmpp)$/i,fC=[{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 pC(e){const i=hC(e),a=mC(e);return gC(i.runSync(i.parse(a),a),e)}function hC(e){const i=e.rehypePlugins||mx,a=e.remarkPlugins||mx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...gx}:gx;return rC().use(P0).use(a).use($1,r).use(i)}function mC(e){const i=e.children||"",a=new lv;return typeof i=="string"&&(a.value=i),a}function gC(e,i){const a=i.allowedElements,r=i.allowElement,u=i.components,c=i.disallowedElements,d=i.skipHtml,p=i.unwrapDisallowed,g=i.urlTransform||yC;for(const b of fC)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+cC+b.id,void 0);return kh(e,m),DS(e,{Fragment:s.Fragment,components:u,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function m(b,x,S){if(b.type==="raw"&&S&&typeof x=="number")return d?S.children.splice(x,1):S.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let w;for(w in rp)if(Object.hasOwn(rp,w)&&Object.hasOwn(b.properties,w)){const E=b.properties[w],R=rp[w];(R===null||R.includes(b.tagName))&&(b.properties[w]=g(String(E||""),w,b))}}if(b.type==="element"){let w=a?!a.includes(b.tagName):c?c.includes(b.tagName):!1;if(!w&&r&&typeof x=="number"&&(w=!r(b,x,S)),w&&S&&typeof x=="number")return p&&b.children?S.children.splice(x,1,...b.children):S.children.splice(x,1),x}}}function yC(e){const i=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),u=e.indexOf("/");return i===-1||u!==-1&&i>u||a!==-1&&i>a||r!==-1&&i>r||dC.test(e.slice(0,i))?e:""}function yx(e,i){const a=String(e);if(typeof i!="string")throw new TypeError("Expected character");let r=0,u=a.indexOf(i);for(;u!==-1;)r++,u=a.indexOf(i,u+i.length);return r}function xC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function bC(e,i,a){const u=fd((a||{}).ignore||[]),c=vC(i);let d=-1;for(;++d<c.length;)av(e,"text",p);function p(m,b){let x=-1,S;for(;++x<b.length;){const w=b[x],E=S?S.children:void 0;if(u(w,E?E.indexOf(w):void 0,S))return;S=w}if(S)return g(m,b)}function g(m,b){const x=b[b.length-1],S=c[d][0],w=c[d][1];let E=0;const $=x.children.indexOf(m);let M=!1,H=[];S.lastIndex=0;let q=S.exec(m.value);for(;q;){const F=q.index,ie={index:q.index,input:q.input,stack:[...b,m]};let N=w(...q,ie);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?S.lastIndex=F+1:(E!==F&&H.push({type:"text",value:m.value.slice(E,F)}),Array.isArray(N)?H.push(...N):N&&H.push(N),E=F+q[0].length,M=!0),!S.global)break;q=S.exec(m.value)}return M?(E<m.value.length&&H.push({type:"text",value:m.value.slice(E)}),x.children.splice($,1,...H)):H=[m],$+H.length}}function vC(e){const i=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<a.length;){const u=a[r];i.push([wC(u[0]),kC(u[1])])}return i}function wC(e){return typeof e=="string"?new RegExp(xC(e),"g"):e}function kC(e){return typeof e=="function"?e:function(){return e}}const yp="phrasing",xp=["autolink","link","image","label"];function SC(){return{transforms:[DC],enter:{literalAutolink:CC,literalAutolinkEmail:bp,literalAutolinkHttp:bp,literalAutolinkWww:bp},exit:{literalAutolink:NC,literalAutolinkEmail:AC,literalAutolinkHttp:TC,literalAutolinkWww:EC}}}function jC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:yp,notInConstruct:xp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:yp,notInConstruct:xp},{character:":",before:"[ps]",after:"\\/",inConstruct:yp,notInConstruct:xp}]}}function CC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function bp(e){this.config.enter.autolinkProtocol.call(this,e)}function TC(e){this.config.exit.autolinkProtocol.call(this,e)}function EC(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 AC(e){this.config.exit.autolinkEmail.call(this,e)}function NC(e){this.exit(e)}function DC(e){bC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,RC],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),_C]],{ignore:["link","linkReference"]})}function RC(e,i,a,r,u){let c="";if(!rv(u)||(/^w/i.test(i)&&(a=i+a,i="",c="http://"),!MC(a)))return!1;const d=OC(a+r);if(!d[0])return!1;const p={type:"link",title:null,url:c+i+d[0],children:[{type:"text",value:i+d[0]}]};return d[1]?[p,{type:"text",value:d[1]}]:p}function _C(e,i,a,r){return!rv(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+a,children:[{type:"text",value:i+"@"+a}]}}function MC(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 OC(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let a=i[0],r=a.indexOf(")");const u=yx(e,"(");let c=yx(e,")");for(;r!==-1&&u>c;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),c++;return[e,a]}function rv(e,i){const a=e.input.charCodeAt(e.index-1);return(e.index===0||wr(a)||ud(a))&&(!i||a!==47)}sv.peek=GC;function zC(){this.buffer()}function LC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function IC(){this.buffer()}function UC(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function BC(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=_i(this.sliceSerialize(e)).toLowerCase(),a.label=i}function qC(e){this.exit(e)}function HC(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=_i(this.sliceSerialize(e)).toLowerCase(),a.label=i}function $C(e){this.exit(e)}function GC(){return"["}function sv(e,i,a,r){const u=a.createTracker(r);let c=u.move("[^");const d=a.enter("footnoteReference"),p=a.enter("reference");return c+=u.move(a.safe(a.associationId(e),{after:"]",before:c})),p(),d(),c+=u.move("]"),c}function VC(){return{enter:{gfmFootnoteCallString:zC,gfmFootnoteCall:LC,gfmFootnoteDefinitionLabelString:IC,gfmFootnoteDefinition:UC},exit:{gfmFootnoteCallString:BC,gfmFootnoteCall:qC,gfmFootnoteDefinitionLabelString:HC,gfmFootnoteDefinition:$C}}}function FC(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:a,footnoteReference:sv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,u,c,d){const p=c.createTracker(d);let g=p.move("[^");const m=c.enter("footnoteDefinition"),b=c.enter("label");return g+=p.move(c.safe(c.associationId(r),{before:g,after:"]"})),b(),g+=p.move("]:"),r.children&&r.children.length>0&&(p.shift(4),g+=p.move((i?`
64
+ `:" ")+c.indentLines(c.containerFlow(r,p.current()),i?ov:YC))),m(),g}}function YC(e,i,a){return i===0?e:ov(e,i,a)}function ov(e,i,a){return(a?"":" ")+e}const PC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];uv.peek=ZC;function WC(){return{canContainEols:["delete"],enter:{strikethrough:XC},exit:{strikethrough:QC}}}function KC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:PC}],handlers:{delete:uv}}}function XC(e){this.enter({type:"delete",children:[]},e)}function QC(e){this.exit(e)}function uv(e,i,a,r){const u=a.createTracker(r),c=a.enter("strikethrough");let d=u.move("~~");return d+=a.containerPhrasing(e,{...u.current(),before:d,after:"~"}),d+=u.move("~~"),c(),d}function ZC(){return"~"}function JC(e){return e.length}function eT(e,i){const a=i||{},r=(a.align||[]).concat(),u=a.stringLength||JC,c=[],d=[],p=[],g=[];let m=0,b=-1;for(;++b<e.length;){const R=[],$=[];let M=-1;for(e[b].length>m&&(m=e[b].length);++M<e[b].length;){const H=tT(e[b][M]);if(a.alignDelimiters!==!1){const q=u(H);$[M]=q,(g[M]===void 0||q>g[M])&&(g[M]=q)}R.push(H)}d[b]=R,p[b]=$}let x=-1;if(typeof r=="object"&&"length"in r)for(;++x<m;)c[x]=xx(r[x]);else{const R=xx(r);for(;++x<m;)c[x]=R}x=-1;const S=[],w=[];for(;++x<m;){const R=c[x];let $="",M="";R===99?($=":",M=":"):R===108?$=":":R===114&&(M=":");let H=a.alignDelimiters===!1?1:Math.max(1,g[x]-$.length-M.length);const q=$+"-".repeat(H)+M;a.alignDelimiters!==!1&&(H=$.length+H+M.length,H>g[x]&&(g[x]=H),w[x]=H),S[x]=q}d.splice(1,0,S),p.splice(1,0,w),b=-1;const E=[];for(;++b<d.length;){const R=d[b],$=p[b];x=-1;const M=[];for(;++x<m;){const H=R[x]||"";let q="",F="";if(a.alignDelimiters!==!1){const ie=g[x]-($[x]||0),N=c[x];N===114?q=" ".repeat(ie):N===99?ie%2?(q=" ".repeat(ie/2+.5),F=" ".repeat(ie/2-.5)):(q=" ".repeat(ie/2),F=q):F=" ".repeat(ie)}a.delimiterStart!==!1&&!x&&M.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&H==="")&&(a.delimiterStart!==!1||x)&&M.push(" "),a.alignDelimiters!==!1&&M.push(q),M.push(H),a.alignDelimiters!==!1&&M.push(F),a.padding!==!1&&M.push(" "),(a.delimiterEnd!==!1||x!==m-1)&&M.push("|")}E.push(a.delimiterEnd===!1?M.join("").replace(/ +$/,""):M.join(""))}return E.join(`
65
+ `)}function tT(e){return e==null?"":String(e)}function xx(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 nT(e,i,a,r){const u=a.enter("blockquote"),c=a.createTracker(r);c.move("> "),c.shift(2);const d=a.indentLines(a.containerFlow(e,c.current()),iT);return u(),d}function iT(e,i,a){return">"+(a?"":" ")+e}function aT(e,i){return bx(e,i.inConstruct,!0)&&!bx(e,i.notInConstruct,!1)}function bx(e,i,a){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return a;let r=-1;for(;++r<i.length;)if(e.includes(i[r]))return!0;return!1}function vx(e,i,a,r){let u=-1;for(;++u<a.unsafe.length;)if(a.unsafe[u].character===`
66
+ `&&aT(a.stack,a.unsafe[u]))return/[ \t]/.test(r.before)?"":" ";return`\\
67
+ `}function lT(e,i){const a=String(e);let r=a.indexOf(i),u=r,c=0,d=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===u?++c>d&&(d=c):c=1,u=r+i.length,r=a.indexOf(i,u);return d}function rT(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 sT(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 oT(e,i,a,r){const u=sT(a),c=e.value||"",d=u==="`"?"GraveAccent":"Tilde";if(rT(e,a)){const x=a.enter("codeIndented"),S=a.indentLines(c,uT);return x(),S}const p=a.createTracker(r),g=u.repeat(Math.max(lT(c,u)+1,3)),m=a.enter("codeFenced");let b=p.move(g);if(e.lang){const x=a.enter(`codeFencedLang${d}`);b+=p.move(a.safe(e.lang,{before:b,after:" ",encode:["`"],...p.current()})),x()}if(e.lang&&e.meta){const x=a.enter(`codeFencedMeta${d}`);b+=p.move(" "),b+=p.move(a.safe(e.meta,{before:b,after:`
68
+ `,encode:["`"],...p.current()})),x()}return b+=p.move(`
69
+ `),c&&(b+=p.move(c+`
70
+ `)),b+=p.move(g),m(),b}function uT(e,i,a){return(a?"":" ")+e}function jh(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 cT(e,i,a,r){const u=jh(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("definition");let p=a.enter("label");const g=a.createTracker(r);let m=g.move("[");return m+=g.move(a.safe(a.associationId(e),{before:m,after:"]",...g.current()})),m+=g.move("]: "),p(),!e.url||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=a.enter("destinationRaw"),m+=g.move(a.safe(e.url,{before:m,after:e.title?" ":`
71
+ `,...g.current()}))),p(),e.title&&(p=a.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(a.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),d(),m}function dT(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 hu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ad(e,i,a){const r=As(e),u=As(i);return r===void 0?u===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}cv.peek=fT;function cv(e,i,a,r){const u=dT(a),c=a.enter("emphasis"),d=a.createTracker(r),p=d.move(u);let g=d.move(a.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=ad(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=hu(m)+g.slice(1));const x=g.charCodeAt(g.length-1),S=ad(r.after.charCodeAt(0),x,u);S.inside&&(g=g.slice(0,-1)+hu(x));const w=d.move(u);return c(),a.attentionEncodeSurroundingInfo={after:S.outside,before:b.outside},p+g+w}function fT(e,i,a){return a.options.emphasis||"*"}function pT(e,i){let a=!1;return kh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,Vp}),!!((!e.depth||e.depth<3)&&mh(e)&&(i.options.setext||a))}function hT(e,i,a,r){const u=Math.max(Math.min(6,e.depth||1),1),c=a.createTracker(r);if(pT(e,a)){const b=a.enter("headingSetext"),x=a.enter("phrasing"),S=a.containerPhrasing(e,{...c.current(),before:`
72
+ `,after:`
73
+ `});return x(),b(),S+`
74
+ `+(u===1?"=":"-").repeat(S.length-(Math.max(S.lastIndexOf("\r"),S.lastIndexOf(`
75
+ `))+1))}const d="#".repeat(u),p=a.enter("headingAtx"),g=a.enter("phrasing");c.move(d+" ");let m=a.containerPhrasing(e,{before:"# ",after:`
76
+ `,...c.current()});return/^[\t ]/.test(m)&&(m=hu(m.charCodeAt(0))+m.slice(1)),m=m?d+" "+m:d,a.options.closeAtx&&(m+=" "+d),g(),p(),m}dv.peek=mT;function dv(e){return e.value||""}function mT(){return"<"}fv.peek=gT;function fv(e,i,a,r){const u=jh(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("image");let p=a.enter("label");const g=a.createTracker(r);let m=g.move("![");return m+=g.move(a.safe(e.alt,{before:m,after:"]",...g.current()})),m+=g.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=a.enter("destinationRaw"),m+=g.move(a.safe(e.url,{before:m,after:e.title?" ":")",...g.current()}))),p(),e.title&&(p=a.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(a.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),m+=g.move(")"),d(),m}function gT(){return"!"}pv.peek=yT;function pv(e,i,a,r){const u=e.referenceType,c=a.enter("imageReference");let d=a.enter("label");const p=a.createTracker(r);let g=p.move("![");const m=a.safe(e.alt,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function yT(){return"!"}hv.peek=xT;function hv(e,i,a){let r=e.value||"",u="`",c=-1;for(;new RegExp("(^|[^`])"+u+"([^`]|$)").test(r);)u+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++c<a.unsafe.length;){const d=a.unsafe[c],p=a.compilePattern(d);let g;if(d.atBreak)for(;g=p.exec(r);){let m=g.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(g.index+1)}}return u+r+u}function xT(){return"`"}function mv(e,i){const a=mh(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}gv.peek=bT;function gv(e,i,a,r){const u=jh(a),c=u==='"'?"Quote":"Apostrophe",d=a.createTracker(r);let p,g;if(mv(e,a)){const b=a.stack;a.stack=[],p=a.enter("autolink");let x=d.move("<");return x+=d.move(a.containerPhrasing(e,{before:x,after:">",...d.current()})),x+=d.move(">"),p(),a.stack=b,x}p=a.enter("link"),g=a.enter("label");let m=d.move("[");return m+=d.move(a.containerPhrasing(e,{before:m,after:"](",...d.current()})),m+=d.move("]("),g(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(g=a.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(a.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(g=a.enter("destinationRaw"),m+=d.move(a.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),g(),e.title&&(g=a.enter(`title${c}`),m+=d.move(" "+u),m+=d.move(a.safe(e.title,{before:m,after:u,...d.current()})),m+=d.move(u),g()),m+=d.move(")"),p(),m}function bT(e,i,a){return mv(e,a)?"<":"["}yv.peek=vT;function yv(e,i,a,r){const u=e.referenceType,c=a.enter("linkReference");let d=a.enter("label");const p=a.createTracker(r);let g=p.move("[");const m=a.containerPhrasing(e,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function vT(){return"["}function Ch(e){const i=e.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function wT(e){const i=Ch(e),a=e.options.bulletOther;if(!a)return i==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+a+"`) to be different");return a}function kT(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 xv(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 ST(e,i,a,r){const u=a.enter("list"),c=a.bulletCurrent;let d=e.ordered?kT(a):Ch(a);const p=e.ordered?d==="."?")":".":wT(a);let g=i&&a.bulletLastUsed?d===a.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&b&&(!b.children||!b.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(g=!0),xv(a)===d&&b){let x=-1;for(;++x<e.children.length;){const S=e.children[x];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(d=p),a.bulletCurrent=d;const m=a.containerFlow(e,r);return a.bulletLastUsed=d,a.bulletCurrent=c,u(),m}function jT(e){const i=e.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function CT(e,i,a,r){const u=jT(a);let c=a.bulletCurrent||Ch(a);i&&i.type==="list"&&i.ordered&&(c=(typeof i.start=="number"&&i.start>-1?i.start:1)+(a.options.incrementListMarker===!1?0:i.children.indexOf(e))+c);let d=c.length+1;(u==="tab"||u==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(d=Math.ceil(d/4)*4);const p=a.createTracker(r);p.move(c+" ".repeat(d-c.length)),p.shift(d);const g=a.enter("listItem"),m=a.indentLines(a.containerFlow(e,p.current()),b);return g(),m;function b(x,S,w){return S?(w?"":" ".repeat(d))+x:(w?c:c+" ".repeat(d-c.length))+x}}function TT(e,i,a,r){const u=a.enter("paragraph"),c=a.enter("phrasing"),d=a.containerPhrasing(e,r);return c(),u(),d}const ET=fd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function AT(e,i,a,r){return(e.children.some(function(d){return ET(d)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function NT(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}bv.peek=DT;function bv(e,i,a,r){const u=NT(a),c=a.enter("strong"),d=a.createTracker(r),p=d.move(u+u);let g=d.move(a.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=ad(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=hu(m)+g.slice(1));const x=g.charCodeAt(g.length-1),S=ad(r.after.charCodeAt(0),x,u);S.inside&&(g=g.slice(0,-1)+hu(x));const w=d.move(u+u);return c(),a.attentionEncodeSurroundingInfo={after:S.outside,before:b.outside},p+g+w}function DT(e,i,a){return a.options.strong||"*"}function RT(e,i,a,r){return a.safe(e.value,r)}function _T(e){const i=e.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function MT(e,i,a){const r=(xv(a)+(a.options.ruleSpaces?" ":"")).repeat(_T(a));return a.options.ruleSpaces?r.slice(0,-1):r}const vv={blockquote:nT,break:vx,code:oT,definition:cT,emphasis:cv,hardBreak:vx,heading:hT,html:dv,image:fv,imageReference:pv,inlineCode:hv,link:gv,linkReference:yv,list:ST,listItem:CT,paragraph:TT,root:AT,strong:bv,text:RT,thematicBreak:MT};function OT(){return{enter:{table:zT,tableData:wx,tableHeader:wx,tableRow:IT},exit:{codeText:UT,table:LT,tableData:vp,tableHeader:vp,tableRow:vp}}}function zT(e){const i=e._align;this.enter({type:"table",align:i.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function LT(e){this.exit(e),this.data.inTable=void 0}function IT(e){this.enter({type:"tableRow",children:[]},e)}function vp(e){this.exit(e)}function wx(e){this.enter({type:"tableCell",children:[]},e)}function UT(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,BT));const a=this.stack[this.stack.length-1];a.type,a.value=i,this.exit(e)}function BT(e,i){return i==="|"?i:e}function qT(e){const i=e||{},a=i.tableCellPadding,r=i.tablePipeAlign,u=i.stringLength,c=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
77
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:S,table:d,tableCell:g,tableRow:p}};function d(w,E,R,$){return m(b(w,R,$),w.align)}function p(w,E,R,$){const M=x(w,R,$),H=m([M]);return H.slice(0,H.indexOf(`
78
+ `))}function g(w,E,R,$){const M=R.enter("tableCell"),H=R.enter("phrasing"),q=R.containerPhrasing(w,{...$,before:c,after:c});return H(),M(),q}function m(w,E){return eT(w,{align:E,alignDelimiters:r,padding:a,stringLength:u})}function b(w,E,R){const $=w.children;let M=-1;const H=[],q=E.enter("table");for(;++M<$.length;)H[M]=x($[M],E,R);return q(),H}function x(w,E,R){const $=w.children;let M=-1;const H=[],q=E.enter("tableRow");for(;++M<$.length;)H[M]=g($[M],w,E,R);return q(),H}function S(w,E,R){let $=vv.inlineCode(w,E,R);return R.stack.includes("tableCell")&&($=$.replace(/\|/g,"\\$&")),$}}function HT(){return{exit:{taskListCheckValueChecked:kx,taskListCheckValueUnchecked:kx,paragraph:GT}}}function $T(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:VT}}}function kx(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function GT(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const r=a.children[0];if(r&&r.type==="text"){const u=i.children;let c=-1,d;for(;++c<u.length;){const p=u[c];if(p.type==="paragraph"){d=p;break}}d===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function VT(e,i,a,r){const u=e.children[0],c=typeof e.checked=="boolean"&&u&&u.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",p=a.createTracker(r);c&&p.move(d);let g=vv.listItem(e,i,a,{...r,...p.current()});return c&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),g;function m(b){return b+d}}function FT(){return[SC(),VC(),WC(),OT(),HT()]}function YT(e){return{extensions:[jC(),FC(e),KC(),qT(e),$T()]}}const PT={tokenize:JT,partial:!0},wv={tokenize:eE,partial:!0},kv={tokenize:tE,partial:!0},Sv={tokenize:nE,partial:!0},WT={tokenize:iE,partial:!0},jv={name:"wwwAutolink",tokenize:QT,previous:Tv},Cv={name:"protocolAutolink",tokenize:ZT,previous:Ev},qa={name:"emailAutolink",tokenize:XT,previous:Av},na={};function KT(){return{text:na}}let mr=48;for(;mr<123;)na[mr]=qa,mr++,mr===58?mr=65:mr===91&&(mr=97);na[43]=qa;na[45]=qa;na[46]=qa;na[95]=qa;na[72]=[qa,Cv];na[104]=[qa,Cv];na[87]=[qa,jv];na[119]=[qa,jv];function XT(e,i,a){const r=this;let u,c;return d;function d(x){return!Wp(x)||!Av.call(r,r.previous)||Th(r.events)?a(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),p(x))}function p(x){return Wp(x)?(e.consume(x),p):x===64?(e.consume(x),g):a(x)}function g(x){return x===46?e.check(WT,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&&bn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(x)):a(x)}}function QT(e,i,a){const r=this;return u;function u(d){return d!==87&&d!==119||!Tv.call(r,r.previous)||Th(r.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(PT,e.attempt(wv,e.attempt(kv,c),a),a)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function ZT(e,i,a){const r=this;let u="",c=!1;return d;function d(x){return(x===72||x===104)&&Ev.call(r,r.previous)&&!Th(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(x),e.consume(x),p):a(x)}function p(x){if(bn(x)&&u.length<5)return u+=String.fromCodePoint(x),e.consume(x),p;if(x===58){const S=u.toLowerCase();if(S==="http"||S==="https")return e.consume(x),g}return a(x)}function g(x){return x===47?(e.consume(x),c?m:(c=!0,g)):a(x)}function m(x){return x===null||td(x)||bt(x)||wr(x)||ud(x)?a(x):e.attempt(wv,e.attempt(kv,b),a)(x)}function b(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(x)}}function JT(e,i,a){let r=0;return u;function u(d){return(d===87||d===119)&&r<3?(r++,e.consume(d),u):d===46&&r===3?(e.consume(d),c):a(d)}function c(d){return d===null?a(d):i(d)}}function eE(e,i,a){let r,u,c;return d;function d(m){return m===46||m===95?e.check(Sv,g,p)(m):m===null||bt(m)||wr(m)||m!==45&&ud(m)?g(m):(c=!0,e.consume(m),d)}function p(m){return m===95?r=!0:(u=r,r=void 0),e.consume(m),d}function g(m){return u||r||!c?a(m):i(m)}}function tE(e,i){let a=0,r=0;return u;function u(d){return d===40?(a++,e.consume(d),u):d===41&&r<a?c(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(Sv,i,c)(d):d===null||bt(d)||wr(d)?i(d):(e.consume(d),u)}function c(d){return d===41&&r++,e.consume(d),u}}function nE(e,i,a){return r;function r(p){return p===33||p===34||p===39||p===41||p===42||p===44||p===46||p===58||p===59||p===63||p===95||p===126?(e.consume(p),r):p===38?(e.consume(p),c):p===93?(e.consume(p),u):p===60||p===null||bt(p)||wr(p)?i(p):a(p)}function u(p){return p===null||p===40||p===91||bt(p)||wr(p)?i(p):r(p)}function c(p){return bn(p)?d(p):a(p)}function d(p){return p===59?(e.consume(p),r):bn(p)?(e.consume(p),d):a(p)}}function iE(e,i,a){return r;function r(c){return e.consume(c),u}function u(c){return hn(c)?a(c):i(c)}}function Tv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||bt(e)}function Ev(e){return!bn(e)}function Av(e){return!(e===47||Wp(e))}function Wp(e){return e===43||e===45||e===46||e===95||hn(e)}function Th(e){let i=e.length,a=!1;for(;i--;){const r=e[i][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const aE={tokenize:fE,partial:!0};function lE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:uE,continuation:{tokenize:cE},exit:dE}},text:{91:{name:"gfmFootnoteCall",tokenize:oE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:rE,resolveTo:sE}}}}function rE(e,i,a){const r=this;let u=r.events.length;const c=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let d;for(;u--;){const g=r.events[u][1];if(g.type==="labelImage"){d=g;break}if(g.type==="gfmFootnoteCall"||g.type==="labelLink"||g.type==="label"||g.type==="image"||g.type==="link")break}return p;function p(g){if(!d||!d._balanced)return a(g);const m=_i(r.sliceSerialize({start:d.end,end:r.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?a(g):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),i(g))}}function sE(e,i){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};u.end.column++,u.end.offset++,u.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},u.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},p=[e[a+1],e[a+2],["enter",r,i],e[a+3],e[a+4],["enter",u,i],["exit",u,i],["enter",c,i],["enter",d,i],["exit",d,i],["exit",c,i],e[e.length-2],e[e.length-1],["exit",r,i]];return e.splice(a,e.length-a+1,...p),e}function oE(e,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c=0,d;return p;function p(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),g}function g(x){return x!==94?a(x):(e.enter("gfmFootnoteCallMarker"),e.consume(x),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(x){if(c>999||x===93&&!d||x===null||x===91||bt(x))return a(x);if(x===93){e.exit("chunkString");const S=e.exit("gfmFootnoteCallString");return u.includes(_i(r.sliceSerialize(S)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):a(x)}return bt(x)||(d=!0),c++,e.consume(x),x===92?b:m}function b(x){return x===91||x===92||x===93?(e.consume(x),c++,m):m(x)}}function uE(e,i,a){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):a(E)}function b(E){if(d>999||E===93&&!p||E===null||E===91||bt(E))return a(E);if(E===93){e.exit("chunkString");const R=e.exit("gfmFootnoteDefinitionLabelString");return c=_i(r.sliceSerialize(R)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),S}return bt(E)||(p=!0),d++,e.consume(E),E===92?x:b}function x(E){return E===91||E===92||E===93?(e.consume(E),d++,b):b(E)}function S(E){return E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),u.includes(c)||u.push(c),tt(e,w,"gfmFootnoteDefinitionWhitespace")):a(E)}function w(E){return i(E)}}function cE(e,i,a){return e.check(gu,i,e.attempt(aE,i,a))}function dE(e){e.exit("gfmFootnoteDefinition")}function fE(e,i,a){const r=this;return tt(e,u,"gfmFootnoteDefinitionIndent",5);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?i(c):a(c)}}function pE(e){let a=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:c,resolveAll:u};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function u(d,p){let g=-1;for(;++g<d.length;)if(d[g][0]==="enter"&&d[g][1].type==="strikethroughSequenceTemporary"&&d[g][1]._close){let m=g;for(;m--;)if(d[m][0]==="exit"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._open&&d[g][1].end.offset-d[g][1].start.offset===d[m][1].end.offset-d[m][1].start.offset){d[g][1].type="strikethroughSequence",d[m][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},d[m][1].start),end:Object.assign({},d[g][1].end)},x={type:"strikethroughText",start:Object.assign({},d[m][1].end),end:Object.assign({},d[g][1].start)},S=[["enter",b,p],["enter",d[m][1],p],["exit",d[m][1],p],["enter",x,p]],w=p.parser.constructs.insideSpan.null;w&&Zn(S,S.length,0,cd(w,d.slice(m+1,g),p)),Zn(S,S.length,0,[["exit",x,p],["enter",d[g][1],p],["exit",d[g][1],p],["exit",b,p]]),Zn(d,m-1,g-m+3,S),g=m+S.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 S;function S(E){return m===126&&b[b.length-1][1].type!=="characterEscape"?g(E):(d.enter("strikethroughSequenceTemporary"),w(E))}function w(E){const R=As(m);if(E===126)return x>1?g(E):(d.consume(E),x++,w);if(x<2&&!a)return g(E);const $=d.exit("strikethroughSequenceTemporary"),M=As(E);return $._open=!M||M===2&&!!R,$._close=!R||R===2&&!!M,p(E)}}}class hE{constructor(){this.map=[]}add(i,a,r){mE(this,i,a,r)}consume(i){if(this.map.sort(function(c,d){return c[0]-d[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(i.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),i.length=this.map[a][0];r.push(i.slice()),i.length=0;let u=r.pop();for(;u;){for(const c of u)i.push(c);u=r.pop()}this.map.length=0}}function mE(e,i,a,r){let u=0;if(!(a===0&&r.length===0)){for(;u<e.map.length;){if(e.map[u][0]===i){e.map[u][1]+=a,e.map[u][2].push(...r);return}u+=1}e.map.push([i,a,r])}}function gE(e,i){let a=!1;const r=[];for(;i<e.length;){const u=e[i];if(a){if(u[0]==="enter")u[1].type==="tableContent"&&r.push(e[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(u[1].type==="tableContent"){if(e[i-1][1].type==="tableDelimiterMarker"){const c=r.length-1;r[c]=r[c]==="left"?"center":"right"}}else if(u[1].type==="tableDelimiterRow")break}else u[0]==="enter"&&u[1].type==="tableDelimiterRow"&&(a=!0);i+=1}return r}function yE(){return{flow:{null:{name:"table",tokenize:xE,resolveAll:bE}}}}function xE(e,i,a){const r=this;let u=0,c=0,d;return p;function p(I){let te=r.events.length-1;for(;te>-1;){const xe=r.events[te][1].type;if(xe==="lineEnding"||xe==="linePrefix")te--;else break}const ue=te>-1?r.events[te][1].type:null,Ce=ue==="tableHead"||ue==="tableRow"?N:g;return Ce===N&&r.parser.lazy[r.now().line]?a(I):Ce(I)}function g(I){return e.enter("tableHead"),e.enter("tableRow"),m(I)}function m(I){return I===124||(d=!0,c+=1),b(I)}function b(I){return I===null?a(I):ze(I)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),w):a(I):We(I)?tt(e,b,"whitespace")(I):(c+=1,d&&(d=!1,u+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),x(I)))}function x(I){return I===null||I===124||bt(I)?(e.exit("data"),b(I)):(e.consume(I),I===92?S:x)}function S(I){return I===92||I===124?(e.consume(I),x):x(I)}function w(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(I):(e.enter("tableDelimiterRow"),d=!1,We(I)?tt(e,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):E(I))}function E(I){return I===45||I===58?$(I):I===124?(d=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),R):ie(I)}function R(I){return We(I)?tt(e,$,"whitespace")(I):$(I)}function $(I){return I===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),M):I===45?(c+=1,M(I)):I===null||ze(I)?F(I):ie(I)}function M(I){return I===45?(e.enter("tableDelimiterFiller"),H(I)):ie(I)}function H(I){return I===45?(e.consume(I),H):I===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),q):(e.exit("tableDelimiterFiller"),q(I))}function q(I){return We(I)?tt(e,F,"whitespace")(I):F(I)}function F(I){return I===124?E(I):I===null||ze(I)?!d||u!==c?ie(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(I)):ie(I)}function ie(I){return a(I)}function N(I){return e.enter("tableRow"),K(I)}function K(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),K):I===null||ze(I)?(e.exit("tableRow"),i(I)):We(I)?tt(e,K,"whitespace")(I):(e.enter("data"),ae(I))}function ae(I){return I===null||I===124||bt(I)?(e.exit("data"),K(I)):(e.consume(I),I===92?J:ae)}function J(I){return I===92||I===124?(e.consume(I),ae):ae(I)}}function bE(e,i){let a=-1,r=!0,u=0,c=[0,0,0,0],d=[0,0,0,0],p=!1,g=0,m,b,x;const S=new hE;for(;++a<e.length;){const w=e[a],E=w[1];w[0]==="enter"?E.type==="tableHead"?(p=!1,g!==0&&(Sx(S,i,g,m,b),b=void 0,g=0),m={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},S.add(a,0,[["enter",m,i]])):E.type==="tableRow"||E.type==="tableDelimiterRow"?(r=!0,x=void 0,c=[0,0,0,0],d=[0,a+1,0,0],p&&(p=!1,b={type:"tableBody",start:Object.assign({},E.start),end:Object.assign({},E.end)},S.add(a,0,[["enter",b,i]])),u=E.type==="tableDelimiterRow"?2:b?3:1):u&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],x=qc(S,i,c,u,void 0,x),c=[0,0,0,0]),d[2]=a)):E.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],x=qc(S,i,c,u,void 0,x)),c=d,d=[c[1],a,0,0])):E.type==="tableHead"?(p=!0,g=a):E.type==="tableRow"||E.type==="tableDelimiterRow"?(g=a,c[1]!==0?(d[0]=d[1],x=qc(S,i,c,u,a,x)):d[1]!==0&&(x=qc(S,i,d,u,a,x)),u=0):u&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(d[3]=a)}for(g!==0&&Sx(S,i,g,m,b),S.consume(i.events),a=-1;++a<i.events.length;){const w=i.events[a];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=gE(i.events,a))}return e}function qc(e,i,a,r,u,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",p="tableContent";a[0]!==0&&(c.end=Object.assign({},Ss(i.events,a[0])),e.add(a[0],0,[["exit",c,i]]));const g=Ss(i.events,a[1]);if(c={type:d,start:Object.assign({},g),end:Object.assign({},g)},e.add(a[1],0,[["enter",c,i]]),a[2]!==0){const m=Ss(i.events,a[2]),b=Ss(i.events,a[3]),x={type:p,start:Object.assign({},m),end:Object.assign({},b)};if(e.add(a[2],0,[["enter",x,i]]),r!==2){const S=i.events[a[2]],w=i.events[a[3]];if(S[1].end=Object.assign({},w[1].end),S[1].type="chunkText",S[1].contentType="text",a[3]>a[2]+1){const E=a[2]+1,R=a[3]-a[2]-1;e.add(E,R,[])}}e.add(a[3]+1,0,[["exit",x,i]])}return u!==void 0&&(c.end=Object.assign({},Ss(i.events,u)),e.add(u,0,[["exit",c,i]]),c=void 0),c}function Sx(e,i,a,r,u){const c=[],d=Ss(i.events,a);u&&(u.end=Object.assign({},d),c.push(["exit",u,i])),r.end=Object.assign({},d),c.push(["exit",r,i]),e.add(a+1,0,c)}function Ss(e,i){const a=e[i],r=a[0]==="enter"?"start":"end";return a[1][r]}const vE={name:"tasklistCheck",tokenize:kE};function wE(){return{text:{91:vE}}}function kE(e,i,a){const r=this;return u;function u(g){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(g):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),c)}function c(g){return bt(g)?(e.enter("taskListCheckValueUnchecked"),e.consume(g),e.exit("taskListCheckValueUnchecked"),d):g===88||g===120?(e.enter("taskListCheckValueChecked"),e.consume(g),e.exit("taskListCheckValueChecked"),d):a(g)}function d(g){return g===93?(e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),p):a(g)}function p(g){return ze(g)?i(g):We(g)?e.check({tokenize:SE},i,a)(g):a(g)}}function SE(e,i,a){return tt(e,r,"whitespace");function r(u){return u===null?a(u):i(u)}}function jE(e){return Bb([KT(),lE(),pE(e),yE(),wE()])}const CE={};function TE(e){const i=this,a=e||CE,r=i.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(jE(a)),c.push(FT()),d.push(YT(a))}function EE(e){const i=new Map;for(const a of e){if(!a.turnId)continue;if(a.event==="server.wakeup.started"){i.set(a.turnId,"wakeup");continue}if(a.event!=="server.turn")continue;const r=NE(a.data);i.set(a.turnId,typeof r.source=="string"?r.source:"web")}return i}function ou(e,i){return!!(i&&e.includes(i))}function AE(e){var a;if((e==null?void 0:e.status)!=="failed")return null;const i=(a=e.error)==null?void 0:a.trim();return i?{turnId:e.id,content:i,createdAt:e.finishedAt??e.startedAt}:null}function NE(e){return e&&typeof e=="object"?e:{}}const DE=["summary","message","status","instruction","description","reason","error","text"],jx=96,RE=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),_E=new Set(["server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),ME=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),Nv=new Set(["item/commandExecution/terminalInteraction"]),OE=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function zE(e){if(e.event!=="codex.notification")return!1;const i=ta(e.data);return typeof i.method=="string"&&Nv.has(i.method)}function LE(e){if(_E.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||RE.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const i=ta(e.data),a=typeof i.method=="string"?i.method:"",r=ta(i.params),u=ta(r.item),c=typeof u.type=="string"?u.type:"";return!a.startsWith("item/")||Nv.has(a)||a.endsWith("/delta")||a.endsWith("/outputDelta")||ME.has(c)?null:a}function Dv(e,i){const a=i.replace(/^input:/,""),r=(e==null?void 0:e.trim())??"";return!r||r===i||r===a?OE.get(a)??Rv(a):r}function kr(e,i=[]){const a=ta(e),u=[...i,...DE.map(c=>uu(a[c]))].map(c=>(c==null?void 0:c.replace(/\s+/g," ").trim())??"").find(Boolean);return u?u.length<=jx?u:`${u.slice(0,jx-3)}...`:"查看详情"}function Kp(e,i=new Map){const a=ta(e),r=typeof a.unreadCount=="number"&&a.unreadCount>0?Math.floor(a.unreadCount):0,c=(Array.isArray(a.senderWorkspaceIds)?Array.from(new Set(a.senderWorkspaceIds.filter(g=>typeof g=="string").map(g=>g.trim()).filter(Boolean))):[]).map(g=>i.get(g)??g),d="Messages",p=[r>0?String(r):"",c.length>0?`from ${c.join(", ")}`:""].filter(Boolean).join(" ");return{title:d,detail:kr({},[p])}}function IE(e){const i=ta(e),a=Array.isArray(i.offers)?i.offers.map(ta).filter(c=>Object.keys(c).length>0):[],r=a.map(c=>{var d;return(d=uu(c.previewText))==null?void 0:d.trim()}).filter(c=>!!c),u=a.length;return{title:u===1?"New input available":`${u} new inputs available`,detail:kr({},r.slice(0,2)),meta:u===1?"preview":`${u} previews`}}function UE(e){const i=ta(e),a=uu(i.actionType)??"",r=ta(i.payload);return a==="seele_wakeup"||a==="seele_workspace_schedule_wakeup"?{title:(uu(r.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:kr(r,[uu(r.instruction)]),meta:"after turn"}:{title:"Action requested",detail:kr(r,[Rv(a||"agent action")]),meta:"after turn"}}function Rv(e){const a=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return a?a.charAt(0).toUpperCase()+a.slice(1):"System event"}function uu(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function ta(e){return e&&typeof e=="object"?e:{}}function Xp(e){const i=Qp(e);return(Array.isArray(i.changes)?i.changes:[]).flatMap(r=>{const u=Qp(r);if(typeof u.path!="string"||!u.path.trim())return[];const c=$E(u.kind),d=typeof u.diff=="string"?u.diff:"",p=HE(d,c);return[{path:u.path,kind:c,additions:p.additions,deletions:p.deletions}]})}function _v(e,i){const a=Tx(e),r=Tx(i??"").replace(/\/+$/,"");return r&&(a===r||a.startsWith(`${r}/`))?a.slice(r.length+1)||".":a}function BE(e,i){if(e.length===0)return"File changed";const a=_v(e[0].path,i);return e.length===1?a:`${a} +${e.length-1}`}function qE(e){return e.reduce((i,a)=>({additions:i.additions+a.additions,deletions:i.deletions+a.deletions}),{additions:0,deletions:0})}function HE(e,i){if(!e)return{additions:0,deletions:0};if(i==="add")return{additions:Cx(e),deletions:0};if(i==="delete")return{additions:0,deletions:Cx(e)};let a=0,r=0;for(const u of e.split(`
79
+ `))u.startsWith("+")&&!u.startsWith("+++")?a+=1:u.startsWith("-")&&!u.startsWith("---")&&(r+=1);return{additions:a,deletions:r}}function Cx(e){const i=e.split(`
80
+ `).length;return e.endsWith(`
81
+ `)?Math.max(0,i-1):i}function $E(e){const i=Qp(e);return i.type==="add"?"add":i.type==="delete"?"delete":i.type==="move"||typeof i.move_path=="string"?"move":"update"}function Tx(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function Qp(e){return e&&typeof e=="object"?e:{}}const Eh=["low","medium","high","xhigh"],GE=["none","minimal",...Eh,"max"];function Ts(e){const i=e.trim();return i?{minimal:"Minimal",none:"None",low:"Low",medium:"Medium",high:"High",xhigh:"Extra high",max:"Max",ultra:"Ultra"}[i]??i:"Use model default"}function Ex(e,i){const a=Sr(e),r=Sr(i==null?void 0:i.defaultReasoningEffort);return a?a===r?`${Ts(a)} (model default)`:Ts(a):r?`Auto (model default: ${Ts(r)})`:"Auto (follow model default)"}function VE(e,i=""){const a=Sr(e==null?void 0:e.defaultReasoningEffort),r=[];if(!e){r.push({value:"",label:"Use model default"});const p=Sr(i);return p&&Ov(p)&&r.push({value:p,label:`${Ts(p)} (configured)`}),r}const c=(Mv(e)??Eh).filter(p=>!Zp(p));a&&!Zp(a)&&!c.includes(a)&&c.unshift(a),a&&c.includes(a)||r.push({value:"",label:"Use model default"});for(const p of c)r.push({value:p===a?"":p,label:p===a?`${Ts(p)} (model default)`:Ts(p)});return r}function Ax(e,i){const a=Sr(e);if(!a||Zp(a))return"";const r=Sr(i==null?void 0:i.defaultReasoningEffort);if(r&&a===r)return"";if(!i)return Ov(a)?a:"";const u=Mv(i);return u!==null?u.includes(a)?a:"":Eh.includes(a)?a:""}function FE(e,i,a){return a||e!==i?e:null}function Mv(e){if(!Array.isArray(e==null?void 0:e.supportedReasoningEfforts))return null;const i=[];for(const a of e.supportedReasoningEfforts){const r=Sr(a==null?void 0:a.reasoningEffort);r&&!i.includes(r)&&i.push(r)}return i}function Sr(e){return typeof e=="string"?e.trim():""}function Zp(e){return e.toLowerCase()==="ultra"}function Ov(e){return GE.includes(e)}function YE(e,i){return{textareaDisabled:!1,sendDisabled:i||!e.trim()}}function PE(e,i){return e.hasConversation?e.messageSubmitting?"blocked":e.hasActiveTurn||e.hasConfirmedCurrentTurn?i&&!e.complexTaskActive?"queue-turn":"steer-turn":"start-turn":"create-workspace"}function WE(e){return e.key!=="Enter"||!e.metaKey&&!e.ctrlKey||e.isComposing?null:{forceNewTurn:e.shiftKey}}function Nx(e,i){return e.conversationId===i.conversationId&&e.version===i.version}function KE(e,i,a){return e===401&&!a&&i==="authentication_required"?"reauthenticate":"ignore"}const Dx=15e3,Rx=[1e3,2e3,5e3,1e4,15e3];function XE(e){return!e.workspaceRunning||e.streamLeaseActive||e.controllerActive?{kind:"none"}:e.currentTurnAbsent?e.retryAt!==null&&e.now>=e.retryAt?{kind:"probe",waitMs:Dx}:{kind:"none"}:{kind:"probe",waitMs:Dx}}function QE(e){const i=Math.min(Math.max(1,Math.floor(e))-1,Rx.length-1);return Rx[i]}function ZE(e){const i=_x(e),a=_x(i.conversation),r=i.workspaceStatus??i.status??a.status;return r==="idle"||r==="error"||r==="done"||r==="initialization_failed"?r:"done"}function _x(e){return e&&typeof e=="object"?e:{}}function JE(e,i,a){return a?"running":e==="running"||e==="error"?e:i==="scheduled"?"waiting":e}function Jn(e,i){if(!e.deploymentId||!e.userId||!i)throw new Error("Browser storage requires deployment, user, and preference identities.");return["seele","v1",encodeURIComponent(e.deploymentId),encodeURIComponent(e.userId),encodeURIComponent(i)].join(":")}function Ah(e,i){const a=[],r=new Set;for(const u of[...e,...i])r.has(u)||(r.add(u),a.push(u));return a}function Mx(e,i,a){return Ah([i,...e.filter(r=>r!==i)],a)}function eA(e,i){return e.filter(a=>a!==i)}function tA(e,i){return i??e}function nA(e,i){return e==="saved"||i==="accept"?"saved":"declined"}const iA=/^[a-z][a-z\d+.-]*:/i,aA=/^L([1-9]\d*)(?:C([1-9]\d*))?$/i;function lA(e,i){const a=e.trim();if(!a||a.startsWith("#")||a.startsWith("?")||a.startsWith("/api/")||iA.test(a))return null;const r=a.indexOf("#"),u=r>=0?a.slice(0,r):a,c=r>=0?a.slice(r+1):"",d=u.indexOf("?"),p=d>=0?u.slice(0,d):u,g=rA(p);if(!g)return null;const m=c.match(aA);return{path:zv(g,i),...m?{line:Number(m[1])}:{},...m!=null&&m[2]?{column:Number(m[2])}:{}}}function zv(e,i){const a=e.replace(/\\/g,"/"),r=i.replace(/\\/g,"/").replace(/\/+$/,"");return a===r||!a.startsWith(`${r}/`)?a:a.slice(r.length+1)}function rA(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/^\.\//,"");return i||null}const Jp="seele:authentication-required",eh="seele:deployment-status-required",Lv=12,sA=3e3,Iv="activeWorkspaceId",Nh="workspaceOrder",Uv="workspaceGroupOrder",Bv="workspaceDrafts",qv="collapsedWorkspaceGroups",Hv="sidebarWidth",Ox=5,zx=275,oA=236,uA=420,Lx="default",Ix=300,cA=3,dA=10,fA=2,pA=13,hA=1.65,mA=20,gA=900;class ea extends Error{constructor(a,r,u,c){super(a);Lc(this,"detail");Lc(this,"status");Lc(this,"body");this.name="DetailedHttpError",this.detail=r,this.status=u,this.body=c}}const yA=[{value:"workspace-write",label:"Workspace"},{value:"danger-full-access",label:"System"}],Xo={id:null,kind:"source",name:"",description:"",purpose:"",attention:"tracked",refreshPolicy:"manual",status:"draft",sourceCluesText:"",requiredEnvText:""};function Dh(){var e;return((e=document.querySelector('meta[name="seele-public-base-path"]'))==null?void 0:e.content.replace(/\/?$/,"/"))??"/"}function ye(e){return`${Dh()}api/${e.replace(/^\/+/,"")}`}async function pn(e,i){const a=await e.text().catch(()=>""),r=`Request failed with ${e.status}`,u=[`${i.method??"GET"} ${i.url}`,`HTTP ${e.status} ${e.statusText||""}`.trim(),a?`Response: ${a}`:"Response: <empty>"].join(`
82
+ `);return new ea(r,u,e.status,a)}function Ve(e){return e instanceof ea?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function gr(e){const i=Ve(e);return i.detail?{message:i.message,detail:i.detail}:i.message}async function Ae(e,i){if(!e.ok)throw await pn(e,i)}function xA(e){return e instanceof ea&&e.status===410&&e.body.includes('"turn_not_active"')}function bA(e){return e instanceof ea&&e.status===409&&e.body.includes('"turn_not_running"')}function vA(e){return e instanceof ea&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function Ux(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function wA(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 Rh(e){return Math.max(oA,Math.min(uA,Math.round(e)))}function kA(e){try{const i=window.localStorage.getItem(Jn(e,Hv)),a=i?Number.parseInt(i,10):Number.NaN;return Number.isFinite(a)?Rh(a):zx}catch{return zx}}function SA(e,i){try{window.localStorage.setItem(Jn(e,Hv),String(Rh(i)))}catch{}}function wp(e){$v(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function jA(e,i=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=i}function CA(e){if(!e)return;const i=window.getComputedStyle(e),a=parseFloat(i.lineHeight)||24,r=parseFloat(i.paddingTop)||0,u=parseFloat(i.paddingBottom)||0,c=a*cA+r+u,d=a*dA+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 TA(e){const i=e.split(/\r\n|\r|\n/).length;return Math.min(fA,Math.max(1,i+1))}function EA(e){return Math.ceil(TA(e)*pA*hA+mA)}function $v(e,i){const a=e.style.scrollBehavior;e.style.scrollBehavior="auto",i(),e.style.scrollBehavior=a}function AA(e){const i=e.getBoundingClientRect(),a=i.bottom-32,r=Array.from(e.querySelectorAll(".turn-group[data-turn-id]")),u=[...r].reverse().find(d=>{const p=d.getBoundingClientRect();return p.top<=a&&p.bottom>=i.top})??r[r.length-1]??null;if(!(u!=null&&u.dataset.turnId))return{anchorOffset:null,anchorTurnId:null};const c=u.getBoundingClientRect();return{anchorOffset:a-c.top,anchorTurnId:u.dataset.turnId}}function NA(e,i){return i?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(a=>a.dataset.turnId===i)??null:null}function Bx(e,i){$v(e,()=>{const a=NA(e,i.anchorTurnId);if(a&&i.anchorOffset!==null){const u=e.getBoundingClientRect().bottom-32,d=a.getBoundingClientRect().top-(u-i.anchorOffset);Math.abs(d)>.5&&(e.scrollTop+=d);return}e.scrollTop=Math.max(0,e.scrollHeight-i.previousScrollHeight)})}function DA(e,i){let a=!1;const r=e.querySelector(".stream-inner")??e,u=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{a||Bx(e,i)});Bx(e,i),u==null||u.observe(r);const c=window.setTimeout(d,1200);function d(){a||(a=!0,u==null||u.disconnect(),window.clearTimeout(c))}return d}function RA(e){try{return window.localStorage.getItem(Jn(e,Iv))}catch{return null}}function kp(e,i){const a=Jn(e,Iv);try{i?window.localStorage.setItem(a,i):window.localStorage.removeItem(a)}catch{}}function js(e){try{const i=window.localStorage.getItem(Jn(e,Nh)),a=i?JSON.parse(i):[];return Array.isArray(a)?a.filter(r=>typeof r=="string"):[]}catch{return[]}}function Gv(e){try{const i=window.localStorage.getItem(Jn(e,Uv)),a=i?JSON.parse(i):[];return Array.isArray(a)?a.filter(r=>typeof r=="string"):[]}catch{return[]}}function Vv(e,i){try{window.localStorage.setItem(Jn(e,Uv),JSON.stringify(i))}catch{}}function Jo(e,i){try{window.localStorage.setItem(Jn(e,Nh),JSON.stringify(i))}catch{}}function Fv(e){try{const i=window.localStorage.getItem(Jn(e,Bv)),a=i?JSON.parse(i):{};return!a||typeof a!="object"||Array.isArray(a)?{}:Object.fromEntries(Object.entries(a).filter(r=>typeof r[0]=="string"&&typeof r[1]=="string"))}catch{return{}}}function _A(e,i){return i?Fv(e)[i]??"":""}function Sp(e,i,a){if(i)try{const r=Fv(e);a?r[i]=a:delete r[i],window.localStorage.setItem(Jn(e,Bv),JSON.stringify(r))}catch{}}function MA(e){try{const i=window.localStorage.getItem(Jn(e,qv)),a=i?JSON.parse(i):[];return new Set(Array.isArray(a)?a.filter(r=>typeof r=="string"):[])}catch{return new Set}}function jp(e,i){try{window.localStorage.setItem(Jn(e,qv),JSON.stringify(Array.from(i)))}catch{}}function Nl(e,i){const a=js(e);if(a.length===0)return i;const r=new Map(a.map((u,c)=>[u,c]));return[...i].sort((u,c)=>{const d=r.get(u.id),p=r.get(c.id);return d!==void 0&&p!==void 0?d-p:d!==void 0?-1:p!==void 0?1:0})}function Hc(e,i){const a=Gv(e);if(a.length===0)return i;const r=new Map(a.map((u,c)=>[u,c]));return[...i].sort((u,c)=>{const d=r.get(u.id),p=r.get(c.id);return d!==void 0&&p!==void 0?d-p:d!==void 0?-1:p!==void 0?1:u.createdAt.localeCompare(c.createdAt)})}function $c(e,i){const a=js(e),r=Ah(a,i.map(u=>u.id));JSON.stringify(r)!==JSON.stringify(a)&&Jo(e,r)}function Cp(e,i){const a=new Set(i.map(c=>c.id)),r=Gv(e).filter(c=>a.has(c)),u=i.map(c=>c.id).filter(c=>!r.includes(c));Vv(e,[...r,...u])}function OA(e,i){const a=e.getBoundingClientRect(),r=a.top+a.height/2;return i<r?"before":"after"}function zA(e,i,a,r){if(i===a)return e;const u=e.findIndex(b=>b.id===i),c=e.findIndex(b=>b.id===a);if(u===-1||c===-1)return e;const d=[...e],[p]=d.splice(u,1),g=d.findIndex(b=>b.id===a),m=r==="before"?g:g+1;return d.splice(m,0,p),d}function LA(e,i,a){if(i===a)return e;const r=e.findIndex(g=>g.id===i),u=e.findIndex(g=>g.id===a);if(r===-1||u===-1)return e;const c=[...e],[d]=c.splice(r,1),p=c.findIndex(g=>g.id===a);return c.splice(p+1,0,d),c}function IA({authEnabled:e,currentUser:i,deploymentId:a,onLogout:r}){var go,Ki,Xi,yo;const u=D.useMemo(()=>({deploymentId:a,userId:i.id}),[a,i.id]),[c,d]=D.useState(""),[p,g]=D.useState(new Set),[m,b]=D.useState([]),[x,S]=D.useState([]),[w,E]=D.useState(null),[R,$]=D.useState(null),[M,H]=D.useState("simple"),[q,F]=D.useState(null),[ie,N]=D.useState(null),[K,ae]=D.useState(null),[J,I]=D.useState(!1),[te,ue]=D.useState(!1),[Ce,xe]=D.useState({}),[ce,V]=D.useState({}),[se,we]=D.useState(null),[Me,O]=D.useState([]),[A,z]=D.useState(null),[C,W]=D.useState(!1),[he,ge]=D.useState(null),[Se,oe]=D.useState("checking"),[Oe,vt]=D.useState(null),[St,vn]=D.useState(!1),[Ke,mt]=D.useState(null),[nn,wn]=D.useState(!1),[Ie,It]=D.useState(null),[jt,$t]=D.useState(!1),[Mi,xi]=D.useState([]),[zl,Ct]=D.useState([]),[ia,ne]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[de,Ne]=D.useState({profuseNotificationEnabled:!0,publicUrl:null}),[qe,Xe]=D.useState([]),[Gt,ei]=D.useState(null),[Kt,Et]=D.useState(null),[Xt,rt]=D.useState(!1),[At,kn]=D.useState(null),[yd,Ll]=D.useState(!1),[Er,Ar]=D.useState(null),[aa,Il]=D.useState(!1),[Ha,_s]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[Sn,Oi]=D.useState("global"),[ct,Ul]=D.useState(null),[Ms,$a]=D.useState(null),[Os,la]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[zs,Ls]=D.useState({memory:"",items:[]}),[xu,bi]=D.useState({memory:"",items:[]}),[Vt,Qt]=D.useState({memory:"",items:[]}),[Ga,ra]=D.useState([]),[Va,Fa]=D.useState(Xo),[sa,ti]=D.useState({description:"",key:"",value:""}),[Bl,vi]=D.useState(null),[Ya,wi]=D.useState(()=>new Set),[zi,Nt]=D.useState(!1),[Nr,Dr]=D.useState(!1),[oa,ua]=D.useState(!1),[Li,Rr]=D.useState(null),[Is,xd]=D.useState(!0),[_r,ca]=D.useState(!1),[ni,an]=D.useState(!1),[bu,vu]=D.useState(!1),[ii,Ii]=D.useState(null),[Mr,Ui]=D.useState(null),[Zt,Or]=D.useState(null),[ai,qn]=D.useState(null),[jn,Us]=D.useState(null),[Pa,da]=D.useState(null),[zr,wu]=D.useState(()=>new Set),[ql,fa]=D.useState(null),[Bs,qs]=D.useState(null),[Hl,Cn]=D.useState(null),[Tn,li]=D.useState(null),[Bi,ri]=D.useState(null),[Lr,$l]=D.useState(()=>MA(u)),[ku,pa]=D.useState(()=>kA(u)),[si,Hs]=D.useState(230),[Hn,qi]=D.useState(()=>Date.now()),[$s,Ir]=D.useState(0),Gs=D.useRef(null),ha=D.useRef(null),Gl=D.useRef(null),Ur=D.useRef(null),Mt=D.useRef(null),oi=D.useRef(!0),Vl=D.useRef(null),ki=D.useRef(null),Vs=D.useRef(null),Fl=D.useRef(new Set),Yl=D.useRef(!1),ma=D.useRef([]),ga=D.useRef(null),Fs=D.useRef(null),Pl=D.useRef(new Map),Wl=D.useRef(new Map),Br=D.useRef(new Set),Wa=D.useRef(new Map),Kl=D.useRef(new Map),Ka=D.useRef(new Map),Xa=D.useRef(new Set),Hi=D.useRef(null),En=D.useRef(new Map),gn=D.useRef(new Map),Qa=D.useRef(new Map),Xl=D.useRef(new Set),qr=D.useRef(null),Hr=D.useRef(null),Ql=D.useRef(!1),Ys=D.useRef(!1),Re=m.find(y=>y.id===w),Su=(Re==null?void 0:Re.unreadTurnCount)??0,$n=m.find(y=>y.id===Li),Ot=m.find(y=>y.id===ct),Ps=m.find(y=>y.id===ql),Zl=D.useMemo(()=>{const k=Hc(u,x.length>0?x:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(U=>({id:U.id,title:U.title,conversations:[]})),j=new Map(k.map(U=>[U.id,U])),_=k[0];for(const U of m)(j.get(U.groupId)??_).conversations.push(U);return k.filter(U=>U.conversations.length>0||U.id!=="default")},[m,x]),at=w!==null?Ce[w]:null,Za=(at==null?void 0:at.messages)??[],$r=(at==null?void 0:at.events)??[],Jl=eR(JD($r),w?ce[w]:null),er=jw(Jl),Ws=(at==null?void 0:at.status)??(Re==null?void 0:Re.status)??"idle",Si=sh(Re,Ws),tr=Li!==null?((go=Ce[Li])==null?void 0:go.status)??($n==null?void 0:$n.status)??"idle":"idle",bd=sh($n,tr),Ja=w?gn.current.get(w)??null:null,Ks=D.useMemo(()=>new Map(m.map(y=>[y.id,y.title])),[m]),Gr=D.useMemo(()=>RN(Za,$r,(at==null?void 0:at.turns)??[],(at==null?void 0:at.timelineNodes)??[],Ja,Ks),[Ja,at==null?void 0:at.timelineNodes,at==null?void 0:at.turns,$r,Za,Ks]),Vr=D.useMemo(()=>new Set(Za.filter(y=>y.origin==="clone"&&y.turnId).map(y=>y.turnId)),[Za]),nr=w!==null&&zr.has(w),el=w!==null&&p.has(w),ju=YE(c,el),Xs=Ja?(Ki=Gr.find(y=>ou(y.turnIds,Ja)))==null?void 0:Ki.activity:null,Fr=Si==="running"||Si==="initializing"||nr?Xs&&!qD(Xs)?Xs:{title:Si==="initializing"?"Initializing clone":"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,Cu=!Fr&&Si==="waiting"&&(Re!=null&&Re.nextWakeup)?{title:"Scheduled wakeup",detail:od(Re.nextWakeup,Hn),createdAt:Re.nextWakeup.wakeAt,tone:"waiting"}:null,tl=Fr??Cu,ir=D.useMemo(()=>ZD(Object.values(Ce)),[Ce]),ar=mb(he,ir);D.useEffect(()=>{wd(),Sd()},[]),D.useEffect(()=>()=>{Mt.current!==null&&window.clearTimeout(Mt.current)},[]),D.useEffect(()=>{Jt(!1),Jt(!0);const y=window.setInterval(()=>{Jt(!0)},300*1e3);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{const y=window.setInterval(()=>qi(Date.now()),1e3);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{Xl.current=zr},[zr]),D.useEffect(()=>{ga.current=w},[w]),D.useLayoutEffect(()=>{const y=Fs.current;if(Fs.current=w,!w||y===w)return;const k=window.requestAnimationFrame(()=>{const j=Ur.current;j&&!j.disabled&&!document.querySelector('[aria-modal="true"]')&&j.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(k)},[w]),D.useEffect(()=>{ma.current=m},[m]),D.useEffect(()=>{const y=Jn(u,Nh),k=j=>{j.key===y&&b(_=>Nl(u,_))};return window.addEventListener("storage",k),()=>window.removeEventListener("storage",k)},[u]),D.useEffect(()=>{w&&kp(u,w)},[w,u]),D.useLayoutEffect(()=>{if(!w||Su<=0)return;let y=!1;const k=async()=>{if(document.visibilityState==="visible"){b(_=>_.map(U=>U.id===w?{...U,unreadTurnCount:0}:U));try{await U2(w)}catch(_){y||console.error(_)}}},j=()=>void k();return k(),document.addEventListener("visibilitychange",j),()=>{y=!0,document.removeEventListener("visibilitychange",j)}},[w,Su]),D.useEffect(()=>{H("simple"),$(null),w&&(en(w),cn(w))},[w]),D.useEffect(()=>{const y=window.setInterval(()=>void kd(),sA);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{d(_A(u,w))},[w]),D.useEffect(()=>{if(!w)return;const y=XE({workspaceRunning:Ws==="running",streamLeaseActive:nr,controllerActive:En.current.has(w),currentTurnAbsent:Br.current.has(w),retryAt:Kl.current.get(w)??null,now:Date.now()});y.kind==="probe"&&ur(w,{waitMs:y.waitMs})},[w,nr,$s,Ws]),D.useEffect(()=>()=>{for(const y of Ka.current.values())window.clearTimeout(y);Ka.current.clear()},[]),D.useEffect(()=>{if(!w)return;let y=!1;return cD(w).then(k=>{y||V(j=>({...j,[w]:k}))}).catch(k=>console.error(k)),()=>{y=!0}},[w]),D.useEffect(()=>{!w&&Sn==="workspace"&&Oi("global")},[w,Sn]),D.useEffect(()=>{var y;if(jt){if(!ct&&w){Ul(w);return}ct&&!m.some(k=>k.id===ct)&&Ul(w??((y=m[0])==null?void 0:y.id)??null)}},[w,m,jt,ct]),D.useEffect(()=>{if(!jt||i.role!=="admin")return;const y=window.setInterval(()=>void ji(),5e3);return()=>window.clearInterval(y)},[i.role,jt]),D.useEffect(()=>{!jt||Sn!=="workspace"||Qt({memory:(Ot==null?void 0:Ot.memory)??"",items:(Ot==null?void 0:Ot.memoryItems)??[]})},[Sn,jt,Ot==null?void 0:Ot.id,Ot==null?void 0:Ot.memory,Ot==null?void 0:Ot.memoryItems]),D.useEffect(()=>{if(!zi)return;w&&Pr(w);const y=k=>{k.key==="Escape"&&Nt(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[w,zi]),D.useEffect(()=>{if(!jt)return;const y=k=>{k.key==="Escape"&&$t(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[jt]),D.useEffect(()=>{var k;if(!Nr)return;if(Li&&!m.some(j=>j.id===Li)){Rr(w??((k=m[0])==null?void 0:k.id)??null);return}const y=j=>{j.key==="Escape"&&(ii?Ii(null):Dr(!1))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[w,Nr,ii,Li,m]),D.useEffect(()=>{if(!ai)return;Us(null);const y=k=>{k.key==="Escape"&&qn(null)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[ai]),D.useLayoutEffect(()=>{CA(Ur.current)},[c]),D.useLayoutEffect(()=>{const y=Gl.current;if(!y)return;const k=()=>{const _=y.getBoundingClientRect();Hs(Math.ceil(_.height+44))};k();const j=typeof ResizeObserver>"u"?null:new ResizeObserver(k);return j==null||j.observe(y),window.addEventListener("resize",k),()=>{j==null||j.disconnect(),window.removeEventListener("resize",k)}},[]),D.useLayoutEffect(()=>{var Z,fe;const y=ha.current;if(!y)return;const k=Vl.current!==w;Vl.current=w,k&&((Z=Hi.current)==null||Z.call(Hi),Hi.current=null);const j=ki.current;if(j&&j.conversationId===w){(fe=Hi.current)==null||fe.call(Hi),Hi.current=DA(y,j),ki.current=null,oi.current=!1;return}if(!k&&!oi.current)return;oi.current=!0,wp(y);const _=requestAnimationFrame(()=>wp(y)),U=window.setTimeout(()=>wp(y),120);return()=>{cancelAnimationFrame(_),window.clearTimeout(U)}},[w,$r.length,Za.length]);async function vd(){var k;const y=ha.current;y&&(oi.current=jA(y),!(!w||!((k=at==null?void 0:at.history)!=null&&k.hasMoreBefore))&&(at.loadingOlder||Fl.current.has(w)||y.scrollTop>96||await so(w)))}function nl(y){var j,_;if(y.history)return y.history;const k=((j=y.timelineNodes)==null?void 0:j.filter(U=>U.parentId===null).reduce((U,Z)=>U===null||Z.timelineAt<U.timelineAt||Z.timelineAt===U.timelineAt&&Z.sequence<U.sequence?Z:U,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:((_=y.messages[0])==null?void 0:_.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 $i(y){const k=new URL(y.url,window.location.href).toString();await navigator.clipboard.writeText(k),Us(y.url)}async function il(y,k){await navigator.clipboard.writeText(k),da(y),Mt.current!==null&&window.clearTimeout(Mt.current),Mt.current=window.setTimeout(()=>{da(null),Mt.current=null},1800)}function ke(y,k,j){const _=Date.now();Or({id:_,tone:y,text:k,detail:j}),window.setTimeout(()=>{Or(U=>(U==null?void 0:U.id)===_?null:U)},j?8e3:2400)}function al(y){const k=Ka.current.get(y);k!==void 0&&(window.clearTimeout(k),Ka.current.delete(y))}function ll(y){Br.current.delete(y),Wa.current.delete(y),Kl.current.delete(y),Xa.current.delete(y),al(y)}function Qs(y){Br.current.add(y),Wa.current.delete(y),Kl.current.delete(y),Xa.current.delete(y),al(y)}function Yr(y){Br.current.add(y),Xa.current.delete(y);const k=(Wa.current.get(y)??0)+1;Wa.current.set(y,k);const j=QE(k);Kl.current.set(y,Date.now()+j),al(y);const _=window.setTimeout(()=>{Ka.current.delete(y),Ir(U=>U+1)},j);Ka.current.set(y,_)}function Zs(y,k){k!=="running"&&ll(y)}async function wd(){try{const[y,k]=await Promise.all([lb(),sb()]);oe("connected");const j=Hc(u,k);if(S(j),Cp(u,j),y.length>0){const _=Nl(u,y),U=RA(u),Z=_.find(fe=>fe.id===U)??_[0];b(_),$c(u,_),E(Z.id);return}b([]),kp(u,null),E(null)}catch(y){console.error(y),oe("error")}}async function ln(){const[y,k]=await Promise.all([lb(),sb()]);for(const U of y)Zs(U.id,U.status);const j=Nl(u,y),_=Hc(u,k);S(_),Cp(u,_),b(j),$c(u,j)}async function kd(){if(!Yl.current){Yl.current=!0;try{const y=await O2(),k=ma.current,j=new Set(k.map(be=>be.id)),_=new Set(y.map(be=>be.id));if(j.size!==_.size||[...j].some(be=>!_.has(be))){await ln(),oe("connected");return}const U=ga.current;for(const be of y)Zs(be.id,be.status);const Z=new Map(y.map(be=>[be.id,be])),fe=U?Z.get(U)??null:null,je=Nl(u,k.map(be=>{const ve=Z.get(be.id);return ve?{...be,status:ve.status,statusError:ve.statusError,nextWakeup:ve.nextWakeup,unreadTurnCount:ve.unreadTurnCount,updatedAt:ve.updatedAt}:be}));b(je),$c(u,je),oe("connected"),fe&&!Xl.current.has(fe.id)&&st(fe.id,be=>({...be,status:fe.status}))}catch(y){console.error(y),oe("error")}finally{Yl.current=!1}}}async function Sd(){try{const y=await DD();oe("connected"),we(y.version)}catch(y){console.error(y),oe("error")}}async function Jt(y){try{const k=await RD(y);k&&ge(j=>mb(j,k))}catch(k){console.error("runtime rate-limit refresh failed",k)}}async function lr(){try{const y=await $2();xi(y),oe("connected")}catch(y){console.error(y),oe("error")}}async function Js(y){try{const k=await G2(y);Ct(k),oe("connected")}catch(k){console.error(k),Ct([]),oe("error")}}async function Pr(y){try{const k=await V2(y);ra(k),oe("connected")}catch(k){console.error(k),ra([]),oe("error")}}async function Tu(y){try{const k=await F2();ne(k),_s(k),y||($a(null),la(k)),oe("connected")}catch(k){console.error(k),oe("error")}}async function Eu(){if(i.role==="admin")try{Ne(await Y2()),oe("connected")}catch(y){console.error(y),oe("error")}}async function rl(y=!0){try{const k=await tD(y);Xe(k.models),oe("connected"),k.refreshing&&window.setTimeout(()=>void rl(!1),1e3)}catch(k){console.error(k),Xe([]),oe("error")}}async function eo(){try{const y=await W2();ei(y.codexVersion),Et(y.codexReleasedAt),oe("connected")}catch(y){console.error(y),ei(null),Et(null),oe("error")}}async function Gi(y=!1){y&&Il(!0);try{const k=await nD(y);kn(k.job),Ar(k.latest),oe("connected"),k.job&&k.job.status!=="running"&&Vs.current===k.job.id&&(Vs.current=null,k.job.status==="succeeded"?(await Promise.all([rl(),eo()]),ke("success",`Codex CLI updated to ${gd(k.job.currentVersion)}`)):ke("error","Codex CLI update failed",k.job.error??void 0))}catch(k){console.error(k),oe("error")}finally{y&&Il(!1)}}async function to(){Ll(!0);try{const y=await iD();Vs.current=y.id,kn(y),oe("connected")}catch(y){console.error(y);const k=Ve(y);ke("error","Unable to start Codex CLI update",k.detail??k.message)}finally{Ll(!1)}}D.useEffect(()=>{if(!Xt||(At==null?void 0:At.status)!=="running")return;const y=window.setInterval(()=>void Gi(),1e3);return()=>window.clearInterval(y)},[Xt,At==null?void 0:At.id,At==null?void 0:At.status]);async function ya(y){try{const k=await aD(y);$a(k),la(k.effective),oe("connected")}catch(k){console.error(k),$a(null),oe("error")}}async function no(){try{const y=await lD();Ls(y),bi(y),oe("connected")}catch(y){console.error(y),oe("error")}}async function Au(){if(i.role!=="admin"){O([]);return}try{O(await TR()),oe("connected")}catch(y){console.error(y),oe("error")}}async function ji(){if(i.role!=="admin"){z(null);return}W(!0);try{z(await P2()),oe("connected")}catch(y){console.error(y),oe("error")}finally{W(!1)}}async function xa(y=ct){const k=[lr(),Tu(y),eo(),rl(),no()];i.role==="admin"&&(k.push(Au()),k.push(ji()),k.push(Eu())),y&&(k.push(en(y)),k.push(ya(y)),k.push(Js(y)),k.push(Pr(y))),await Promise.all(k)}function io(){var k;const y=w??((k=m[0])==null?void 0:k.id)??null;ue(!1),Ul(y),Oi(i.role==="admin"?"global":y?"workspace":"global"),$t(!0),xa(y)}function Nu(){var k;const y=w??((k=m[0])==null?void 0:k.id)??null;Ul(y),Oi(y?"workspace":"global"),$t(!0),xa(y)}function Vi(){var k;ue(!1);const y=w??((k=m[0])==null?void 0:k.id)??null;Rr(y),Ui(null),Ii(null),Dr(!0),y&&Du(y)}async function Du(y){try{const k=await cw(y);if(!k||k.status!=="running")return;ca(!0);const j=await dw(y,k);Ui(j),await en(y),await ln(),j.warmupTurnId&&Fn(y,j.warmupTurnId),ke("success","Full-history runtime reset completed")}catch(k){const j=Ve(k);ke("error","Full-history runtime reset failed",j.message)}finally{ca(!1)}}function Ru(y){Ul(y),Oi("workspace"),en(y),ya(y),Js(y),Pr(y),Fa(Xo)}async function _u(y){y.preventDefault();try{if(Sn==="workspace"&&ct){const k=(Ot==null?void 0:Ot.status)==="running",j=await cb(ct,pD(Os,ia,Ms));$a(j.settings),la(j.settings.effective),Rn(j.conversation),ke("success","Workspace settings saved",k?"The current turn keeps its existing settings. Changes apply from the next turn.":void 0)}else{const k=await rD(Ha);ne(k),_s(k),ct&&await ya(ct),ke("success","Global settings saved")}oe("connected")}catch(k){console.error(k),oe("error");const j=Ve(k);ke("error","Failed to save runtime settings",j.detail??j.message)}}async function jd(y){try{const k=await sD(y);Ne(k),oe("connected"),ke("success","Deployment settings saved")}catch(k){console.error(k),oe("error");const j=Ve(k);throw ke("error","Failed to save deployment settings",j.detail??j.message),k}}async function Cd(){var j;const y=$n;if(!y){ke("error","No workspace selected");return}const k=((j=Ce[y.id])==null?void 0:j.status)??y.status;if(k==="running"||k==="initializing"){ke("error","Stop the running turn before resetting runtime");return}vu(!0),Ui(null);try{const _=await fb(y.id);Ii(_),oe("connected")}catch(_){console.error(_),oe("error");const U=Ve(_);ke("error","Failed to preview runtime reset",U.detail??U.message)}finally{vu(!1)}}async function Td(y){const k=$n,j=ii;if(!k||!j||j.conversationId!==k.id){ke("error","Reset preview is required");return}an(!0),Ui(null);try{const _=await db(k.id,{warmup:Is,previewFingerprint:j.fingerprint,selectedEntryIds:y});Ui(_),Ii(null),oe("connected"),await en(k.id),await ln(),_.warmupTurnId&&Fn(k.id,_.warmupTurnId),ke("success","Runtime thread reset")}catch(_){console.error(_),oe("error");const U=Ve(_);ke("error","Failed to reset runtime thread",U.detail??U.message)}finally{an(!1)}}async function Mu(){var _;const y=$n;if(!y){ke("error","No workspace selected");return}const k=((_=Ce[y.id])==null?void 0:_.status)??y.status;if(k==="running"||k==="initializing"){ke("error","Stop the running turn before clearing context");return}if(window.confirm(`Start "${y.title}" from a blank context?
83
+
84
+ This clears Workspace Memory and creates a new Codex thread without restored history. Workspace files, Timeline, metadata, and Base Memory remain intact.`)){ca(!0),Ui(null);try{const U=await fb(y.id),Z=await db(y.id,{warmup:!1,previewFingerprint:U.fingerprint,selectedEntryIds:[],clearWorkspaceMemory:!0,saveSelection:!1});Ui(Z),Ii(null),ct===y.id&&Qt({memory:"",items:[]}),oe("connected"),await en(y.id),await ln(),ke("success","Workspace started from blank context")}catch(U){console.error(U),oe("error");const Z=Ve(U);ke("error","Failed to clear workspace context",Z.detail??Z.message)}finally{ca(!1)}}}async function Ou(y){const k=$n,j=ii;if(!k||!j||j.conversationId!==k.id)throw new Error("Reset preview is no longer current.");try{await oD(k.id,{previewFingerprint:j.fingerprint,selectedEntryIds:y}),oe("connected")}catch(_){console.error(_),oe("error");const U=Ve(_);throw ke("error","Failed to save reset defaults",U.detail??U.message),_}}async function ao(y,k){try{const j=await cb(y,{[k]:null});$a(j.settings),la(j.settings.effective),Rn(j.conversation),oe("connected"),ke("success","Workspace override reset")}catch(j){console.error(j),oe("error"),ke("error","Failed to reset workspace override")}}async function Gn(y){try{const k=await vD({memory:bD(y),items:y});return Ls(k),bi(k),oe("connected"),ke("success","Base memory saved"),k.items}catch(k){throw console.error(k),oe("error"),ke("error","Failed to save memory"),k}}async function Wr(y,k){try{const j=await Wc(y,{memoryItems:k});return Rn(j),Qt({memory:j.memory,items:j.memoryItems}),oe("connected"),ke("success","Workspace memory saved"),j.memoryItems}catch(j){throw console.error(j),oe("error"),ke("error","Failed to save memory"),j}}async function An(y){y.preventDefault();const k=sa.key.trim();if(k)try{if(Sn==="workspace"&&ct){const j=await kD(ct,k,sa.value,sa.description);Ct(_=>[..._.filter(U=>U.key!==j.variable.key),j.variable].sort((U,Z)=>U.key.localeCompare(Z.key))),Rn(j.conversation)}else{const j=await wD(k,sa.value,sa.description);xi(_=>[..._.filter(U=>U.key!==j.key),j].sort((U,Z)=>U.key.localeCompare(Z.key)))}ke("success",Sn==="workspace"?"Workspace environment saved":"Base environment saved"),ti({description:"",key:"",value:""}),vi(null),wi(j=>{const _=new Set(j);return _.delete(k),_}),oe("connected")}catch(j){console.error(j),oe("error"),ke("error","Failed to save environment")}}async function sl(y){try{if(Sn==="workspace"&&ct){const k=await TD(ct,y);Ct(j=>j.filter(_=>_.key!==y)),Rn(k)}else await CD(y),xi(k=>k.filter(j=>j.key!==y));Bl===y&&(ti({description:"",key:"",value:""}),vi(null),wi(k=>{const j=new Set(k);return j.delete(y),j})),oe("connected"),ke("success",Sn==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(k){console.error(k),oe("error"),ke("error","Failed to delete environment")}}async function lo(y,k){if(k.preventDefault(),!Va.name.trim()){ke("error","Knowledge name is required");return}const j=hD(Va);try{const _=Va.id?await AD(y,Va.id,j):await ED(y,j);ra(U=>[...U.filter(Z=>Z.id!==_.id),_].sort(pb)),Fa(Xo),oe("connected"),ke("success","Workspace knowledge saved")}catch(_){console.error(_),oe("error"),ke("error","Failed to save workspace knowledge")}}async function Kr(y,k){try{await ND(y,k),ra(j=>j.filter(_=>_.id!==k)),Va.id===k&&Fa(Xo),oe("connected"),ke("success","Workspace knowledge deleted")}catch(j){console.error(j),oe("error"),ke("error","Failed to delete workspace knowledge")}}function Xr(y){Oi("workspace"),Fa(mD(y))}function ro(y){ti({description:y.description,key:y.key,value:""}),vi(y.key),wi(k=>{const j=new Set(k);return j.delete(y.key),j}),rr(y.key,{preserveTypedValue:!0})}function ba(){const y=Bl;ti({description:"",key:"",value:""}),vi(null),y&&wi(k=>{const j=new Set(k);return j.delete(y),j})}async function zu(y){await rr(y)}async function rr(y,k={}){try{const j=Sn==="workspace"&&ct?await jD(ct,y):await SD(y);ti(_=>_.key===y&&(!k.preserveTypedValue||_.value.length===0)?{..._,value:j}:_),wi(_=>new Set(_).add(y)),oe("connected")}catch(j){console.error(j),oe("error")}}async function en(y){const k=await zp(y);mo(k)}async function Lu(y){try{const k=await zp(y);dl(k)}catch(k){console.warn("Failed to synchronize timeline before turn stream",k)}}async function cn(y){try{$(await MD(y))}catch(k){console.error(k)}}async function va(y){if(w)try{const k=await zD(w,y);$(y==="end"?null:k),y==="end"&&H("simple"),ke("success",y==="start"?"Complex task started":`Task ${y} accepted`),(y==="start"||y==="resume")&&ur(w,{waitMs:15e3}),await ln()}catch(k){ke("error","Complex task control failed",Ve(k).detail??Ve(k).message)}}async function rn(y){if(w)try{F(await OD(w,y))}catch(k){const j=Ve(k);ke("error","Failed to load complex task",j.detail??j.message)}}function Iu(){Re&&ae({sourceId:Re.id,name:`${Re.title} - Clone`,groupId:Re.groupId})}async function Qr(y){if(y.preventDefault(),!(!K||!K.name.trim())){I(!0);try{const k=await LD(K.sourceId,K.name.trim(),K.groupId);b(j=>{const _=[k.conversation,...j];return Jo(u,Mx(js(u),k.conversation.id,_.map(U=>U.id))),Nl(u,_)}),E(k.conversation.id),ae(null),ue(!1),ke(k.error?"error":"success",k.error?"Clone created, initialization failed":"Workspace cloned",k.error??void 0)}catch(k){ke("error","Clone failed",Ve(k).detail??Ve(k).message)}finally{I(!1)}}}async function wa(){if(Re)try{const y=await ID(Re.id);Rn(y.conversation),ke(y.error?"error":"success",y.error?"Clone retry failed":"Clone initialization restarted",y.error??void 0)}catch(y){ke("error","Clone retry failed",Ve(y).detail??Ve(y).message)}}async function so(y,k={}){var be,ve,dt;const j=Ce[y],_=(be=j==null?void 0:j.history)==null?void 0:be.oldestTimelineAt,U=(ve=j==null?void 0:j.history)==null?void 0:ve.oldestTimelineSequence,Z=_&&U!==null&&U!==void 0?`${_}|${U}`:U==null?(dt=j==null?void 0:j.history)==null?void 0:dt.oldestMessageCreatedAt:String(U),fe=ha.current;if(!Z||!fe)return;if(k.preserveAnchor??!0){const et=AA(fe);ki.current={anchorOffset:et.anchorOffset,conversationId:y,previousScrollHeight:fe.scrollHeight,anchorTurnId:et.anchorTurnId}}else ki.current=null;Fl.current.add(y),st(y,et=>({...et,loadingOlder:!0}));try{const et=await zp(y,{before:Z,limit:Lv});cl(et)}catch(et){console.error(et),ki.current=null}finally{Fl.current.delete(y),st(y,et=>({...et,loadingOlder:!1}))}}async function Uu(y,k){const j=await _D(y,k||void 0);b(_=>{const U=[j,..._];return Jo(u,Mx(js(u),j.id,U.map(Z=>Z.id))),Nl(u,U)}),E(j.id),ue(!1)}function Zr(y){y!==ga.current&&(xe(k=>{if(!(y in k))return k;const j={...k};return delete j[y],j}),E(y))}function Bu(){ue(!1),It({mode:"create",groupId:null,title:""})}function yn(y){It({mode:"rename",groupId:y.id,title:y.title})}function ka(){var y;ue(!1),vt({mode:"create",conversationId:null,title:"",groupId:(Re==null?void 0:Re.groupId)??((y=x[0])==null?void 0:y.id)})}async function ol(y){var k;if(y.status!=="running"){wn(!0);try{await BD(y.id),xe(_=>{const U={..._};return delete U[y.id],U});const j=ma.current.filter(_=>_.id!==y.id);if(Jo(u,eA(js(u),y.id)),Sp(u,y.id,""),b(j),w===y.id){const _=((k=j[0])==null?void 0:k.id)??null;kp(u,_),E(_)}(Oe==null?void 0:Oe.conversationId)===y.id&&Ft(),mt(null),ke("success","Workspace moved to recycle")}catch(j){const _=Ve(j);ke("error","Failed to move workspace to recycle",_.detail??_.message)}finally{wn(!1)}}}async function Jr(y){if(!(y.id===Lx||!window.confirm(`Delete group "${y.title}"?
85
+
86
+ Workspaces in this group will move to Default.`)))try{const j=await H2(y.id),_=Hc(u,j.groups);S(_),Cp(u,_);const U=Nl(u,j.conversations);b(U),$c(u,U),$l(Z=>{const fe=new Set(Z);return fe.delete(y.id),jp(u,fe),fe})}catch(j){console.error(j)}}function sr(y){vt({mode:"rename",conversationId:y.id,title:y.title})}function Ft(){vn(!1),vt(null)}function sn(){It(null)}async function Fi(y,k){const j=k.trim(),_=m.find(Z=>Z.id===y);if(!_||!j||j===_.title){Ft();return}const U=await Wc(y,{title:j});Rn(U),Ft()}function ui(y){return y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement}function Vn(y){return y instanceof Element&&!!y.closest("input, button")}function Ci(y,k){const j=document.elementFromPoint(y,k);return j instanceof HTMLElement?j.closest(".session-item[data-workspace-id]"):null}function oo(y,k){const j=document.elementFromPoint(y,k);return j instanceof HTMLElement?j.closest(".workspace-group[data-group-id]"):null}function uo(y,k,j){const _=Ci(k,j),U=_==null?void 0:_.dataset.workspaceId;if(_&&U&&U!==y){li({kind:"workspace",id:U,position:OA(_,j)});return}const Z=oo(k,j),fe=Z==null?void 0:Z.dataset.groupId;if(!fe){li(null);return}li({kind:"group",id:fe})}function co(y,k){Vn(y.target)||(y.currentTarget.setPointerCapture(y.pointerId),qr.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY})}function qu(y,k){const j=qr.current;if(!j||j.id!==k||j.pointerId!==y.pointerId)return;const _=Math.hypot(y.clientX-j.startX,y.clientY-j.startY);if(ql!==k){if(_<Ox)return;fa(k),li(null)}y.preventDefault(),ri({x:y.clientX,y:y.clientY}),uo(k,y.clientX,y.clientY)}async function Yt(y,k){var fe;y.preventDefault(),y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),qr.current=null;const j=ql===k;j&&(Ql.current=!0);const _=Tn;if(!j||!_){fa(null),li(null),ri(null);return}const U=m.find(je=>je.id===k),Z=_.kind==="group"?_.id:(fe=m.find(je=>je.id===_.id))==null?void 0:fe.groupId;if(!U||!Z){fa(null),li(null),ri(null);return}if(b(je=>{const be=_.kind==="workspace"?zA(je.map(ve=>ve.id===k?{...ve,groupId:Z}:ve),k,_.id,_.position):[...je.filter(ve=>ve.id!==k),{...U,groupId:Z}];return Jo(u,Ah(be.map(ve=>ve.id),js(u))),be}),U.groupId!==Z)try{const je=await Wc(k,{groupId:Z});Rn(je)}catch(je){console.error(je),await ln()}fa(null),li(null),ri(null)}function gt(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),qr.current=null,fa(null),li(null),ri(null)}function Fe(y,k){y.currentTarget.setPointerCapture(y.pointerId),Hr.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY}}function Yi(y,k){const j=Hr.current;if(!j||j.id!==k||j.pointerId!==y.pointerId)return;const _=Math.hypot(y.clientX-j.startX,y.clientY-j.startY);if(Bs!==k){if(_<Ox)return;qs(k),Cn(null)}y.preventDefault();const U=oo(y.clientX,y.clientY),Z=U==null?void 0:U.dataset.groupId;Cn(Z&&Z!==k?Z:null)}function Nn(y,k){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const j=Bs===k;j&&(y.preventDefault(),Ys.current=!0);const _=Hl;j&&_&&S(U=>{const Z=LA(U,k,_);return Vv(u,Z.map(fe=>fe.id)),Z}),Hr.current=null,qs(null),Cn(null)}function fo(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Hr.current=null,qs(null),Cn(null)}function Pi(y){const k=y.target.value;vt(j=>j&&{...j,title:k})}function Hu(y){const k=y.target.value;vt(j=>j&&{...j,groupId:k})}function $u(y){const k=y.target.value;It(j=>j&&{...j,title:k})}async function ul(y){if(y.preventDefault(),!Oe)return;const k=Oe.title.trim();if(k){vn(!0);try{if(Oe.mode==="create"){await Uu(k,Oe.groupId),Ft();return}Oe.conversationId&&await Fi(Oe.conversationId,k)}catch(j){console.error(j);const _=Ve(j);ke("error",Oe.mode==="create"?"Failed to create workspace":"Failed to rename workspace",_.detail??_.message)}finally{vn(!1)}}}function ci(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),Ft())}async function po(y){if(y.preventDefault(),!Ie)return;const k=Ie.title.trim();if(k)try{if(Ie.mode==="rename"){if(!Ie.groupId)return;const _=await q2(Ie.groupId,{title:k});S(U=>U.map(Z=>Z.id===_.id?_:Z)),sn();return}const j=await B2(k);S(_=>[..._,j]),$l(_=>{const U=new Set(_);return U.delete(j.id),jp(u,U),U}),sn()}catch(j){console.error(j)}}function Sa(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),sn())}async function ho(y){y.preventDefault(),await es()}function ja(y){w&&Pl.current.set(w,(Pl.current.get(w)??0)+1),d(y),Sp(u,w,y)}function Dn(y,k,j){const _={conversationId:y,version:j};if(!Nx(_,{conversationId:y,version:Pl.current.get(y)??0}))return;Sp(u,y,"");const U=ga.current;U&&Nx(_,{conversationId:U,version:Pl.current.get(U)??0})&&d(Z=>Z.trim()===k?"":Z)}function Wi(y){if(Wl.current.has(y))return null;const k=Symbol(y);return Wl.current.set(y,k),g(j=>{const _=new Set(j);return _.add(y),_}),k}function dn(y,k){Wl.current.get(y)===k&&(Wl.current.delete(y),g(j=>{const _=new Set(j);return _.delete(y),_}))}function or(y){const k=Ve(y);ke("error","Message was not confirmed",`${k.message}. Your text is still in the composer and can be retried.`)}async function es(y={}){const k=c.trim();if(!k)return;const j=w,_=PE({hasConversation:j!==null,messageSubmitting:j!==null&&Wl.current.has(j),hasActiveTurn:j!==null&&gn.current.has(j),hasConfirmedCurrentTurn:j!==null&&Xa.current.has(j),complexTaskActive:!!R},!!y.forceNewTurn);if(_==="create-workspace"){ka();return}if(_==="blocked"||!j)return;const U=Pl.current.get(j)??0,Z=Wi(j);if(!Z)return;if(_==="queue-turn"){await Pt(j,k,U,Z);return}if(_==="steer-turn"){await ts(j,k,U,Z);return}const fe=`local-${Date.now()}`;st(j,be=>({...be,messages:[...be.messages,{id:fe,role:"user",content:k,createdAt:new Date().toISOString()}],status:"running"})),Ai(j,"running"),di(j,!0);let je=!1;try{let be=null;const ve=ye(`conversations/${j}/turns`),dt=await fetch(ve,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,workMode:M})});if(dt.ok){const et=await dt.json();if(!et.turnId)throw new Error("Turn did not return a turn id");if(be=et.turnId,(M==="complex"||R)&&(cn(j),H("simple")),!et.message)throw new Error("Turn did not return the persisted message");ns(j,fe,et.message,be),je=!0,Dn(j,k,U)}else{const et=await wA(dt);if(et){be=et;const fi=await Gu(j,et,k);if(!fi.ok)throw await pn(fi,{method:"POST",url:ye(`conversations/${j}/turns/${et}/steer`)});const Ni=await fi.json();if(!Ni.message)throw new Error("Steer did not return the persisted message");ns(j,fe,Ni.message,et),je=!0,Dn(j,k,U)}else throw await pn(dt,{method:"POST",url:ve})}if(!be)throw await pn(dt,{method:"POST",url:ve});Fn(j,be),dn(j,Z)}catch(be){je||or(be);const ve=vA(be);ve&&ke("error","Reset thread required",R?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."),st(j,dt=>({...dt,status:"error",messages:je?dt.messages:dt.messages.filter(et=>et.id!==fe),events:[...dt.events,{id:dt.events.length+1,event:"client.error",data:ve?{message:"Reset thread required",detail:R?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."}:gr(be),createdAt:new Date().toISOString()}]})),Ai(j,"error"),di(j,!1),await ln()}finally{dn(j,Z)}}async function Ca(y){const k=Qa.current.get(y)??[];if(k.length===0)return;const[j,..._]=k;Qa.current.set(y,_),await Fn(y,j)}async function ur(y,k={}){if(Xl.current.has(y)||En.current.has(y))return;al(y),Kl.current.delete(y);const j=new AbortController;En.current.set(y,j),di(y,!0);try{const _=k.waitMs?`?waitMs=${k.waitMs}`:"",U=ye(`conversations/${y}/turns/current/events${_}`),Z=await fetch(U,{signal:j.signal});if(!Z.ok||!Z.body)throw await pn(Z,{method:"GET",url:U});ll(y),Xa.current.add(y),await Lu(y),await bb(Z.body,fe=>{const je=Zx(fe,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);je.turnId&&!gn.current.has(y)&&gn.current.set(y,je.turnId),st(y,ve=>({...ve,status:Kc(je)??ve.status,events:Qx(ve.events,je)}));const be=Kc(je);be&&Ai(y,be)}),await en(y),await ln()}catch(_){if(!eb(_)){if(bA(_)){En.current.get(y)===j&&Yr(y);return}st(y,U=>({...U,status:"error",events:[...U.events,{id:U.events.length+1,event:"client.error",data:gr(_),createdAt:new Date().toISOString()}]}))}}finally{En.current.get(y)===j&&(Xa.current.delete(y),gn.current.delete(y),En.current.delete(y),di(y,!1),await Ca(y))}}async function Fn(y,k,j={}){const _=gn.current.get(y);if(_===k)return;if(_||En.current.has(y)){const Z=Qa.current.get(y)??[];Z.includes(k)||Qa.current.set(y,[...Z,k]);return}ll(y);const U=new AbortController;En.current.set(y,U),gn.current.set(y,k),di(y,!0);try{const Z=ye(`conversations/${y}/turns/${k}/events`),fe=await fetch(Z,{signal:U.signal});if(!fe.ok||!fe.body)throw await pn(fe,{method:"GET",url:Z});await Lu(y),await bb(fe.body,je=>{const be=Zx(je,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);st(y,dt=>({...dt,status:Kc(be)??dt.status,events:Qx(dt.events,be)}));const ve=Kc(be);ve&&Ai(y,ve)}),await en(y),await ln()}catch(Z){if(!eb(Z)){if(j.recovered&&xA(Z)){await en(y),await ln();return}st(y,fe=>({...fe,status:"error",events:[...fe.events,{id:fe.events.length+1,event:"client.error",data:gr(Z),createdAt:new Date().toISOString()}]}))}}finally{En.current.get(y)===U&&(gn.current.get(y)===k&&gn.current.delete(y),En.current.delete(y),di(y,!1),await Ca(y))}}async function Pt(y,k,j,_){let U=!1;const Z=`local-queued-${Date.now()}`;st(y,fe=>({...fe,messages:[...fe.messages,{id:Z,role:"user",content:k,createdAt:new Date().toISOString()}]}));try{const fe=ye(`conversations/${y}/turns`),je=await fetch(fe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,mode:"queue",workMode:M})});if(!je.ok)throw await pn(je,{method:"POST",url:fe});const be=await je.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");ns(y,Z,be.message,be.turnId),U=!0,Dn(y,k,j),Fn(y,be.turnId),dn(y,_),await ln(),ke("success",be.queuePosition?`Queued as next turn (${be.queuePosition})`:"Started new turn")}catch(fe){U||or(fe),st(y,je=>({...je,messages:U?je.messages:je.messages.filter(be=>be.id!==Z),events:[...je.events,{id:je.events.length+1,event:"client.error",data:gr(fe),createdAt:new Date().toISOString()}]}))}finally{dn(y,_)}}async function ts(y,k,j,_){const U=gn.current.get(y);let Z=!1;const fe=`local-steer-${Date.now()}`;st(y,je=>({...je,messages:[...je.messages,{id:fe,role:"user",content:k,createdAt:new Date().toISOString(),turnId:U??null}],status:"running"}));try{const je=ye(U?`conversations/${y}/turns/${U}/steer`:`conversations/${y}/turns/steer`),be=await fetch(je,Ux(k));if(!be.ok)throw await pn(be,{method:"POST",url:je});const ve=await be.json();if(!ve.message)throw new Error("Steer did not return the persisted message");ns(y,fe,ve.message,U),Z=!0,Dn(y,k,j),dn(y,_)}catch(je){or(je),st(y,be=>({...be,messages:Z?be.messages:be.messages.filter(ve=>ve.id!==fe),events:[...be.events,{id:be.events.length+1,event:"client.error",data:gr(je),createdAt:new Date().toISOString()}]}))}finally{dn(y,_)}}async function Gu(y,k,j){return fetch(ye(`conversations/${y}/turns/${k}/steer`),Ux(j))}function ns(y,k,j,_){st(y,U=>({...U,messages:Ap(U.messages.filter(Z=>Z.id!==k),[{...j,turnId:_??j.turnId??null}])}))}async function Ed(){var _;if(!w||Si!=="running"&&Si!=="initializing"&&!nr)return;const y=w,k=Si,j=`client-stop-${Date.now()}`;Qs(y),(_=En.current.get(y))==null||_.abort(),gn.current.delete(y),Qa.current.delete(y),di(y,!1),st(y,U=>({...U,status:"done",events:[...U.events,{id:j,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),Ai(y,"done");try{const U=await Vu(y);ll(y),st(y,Z=>({...Z,status:U})),Ai(y,U),Promise.all([en(y),ln()]).catch(Z=>{console.warn("Failed to refresh workspace after Stop",Z)})}catch(U){Yr(y),st(y,fe=>({...fe,status:k==="initializing"?"initializing":"running",events:[...fe.events.filter(je=>je.id!==j),{id:fe.events.length+1,event:"client.error",data:gr(U),createdAt:new Date().toISOString()}]})),Ai(y,k==="initializing"?"initializing":"running");const Z=Ve(U);ke("error","Stop failed",Z.detail??Z.message);try{await ln()}catch(fe){console.warn("Failed to refresh workspace after Stop failed",fe)}}}async function Vu(y){const k=ye(`conversations/${y}/turns/interrupt`),j=await fetch(k,{method:"POST"});if(!j.ok)throw await pn(j,{method:"POST",url:k});return ZE(await j.json().catch(()=>null))}async function Dt(){var _;const y=$n;if(!y){ke("error","No workspace selected");return}if(!window.confirm(`Force stop and repair "${y.title}"?
87
+
88
+ This cancels every current or queued turn and the active complex task, kills its runtime, and repairs scheduler state. Future scheduled wakeups are preserved.`))return;const j=y.id;an(!0),Qs(j),(_=En.current.get(j))==null||_.abort(),gn.current.delete(j),Qa.current.delete(j),di(j,!1);try{const U=await Vu(j);ll(j),st(j,Z=>({...Z,status:U})),Ai(j,U),await en(j),await ln(),ke("success","Workspace stopped and repaired")}catch(U){Yr(j);const Z=Ve(U);ke("error","Force stop failed",Z.detail??Z.message);try{await ln()}catch(fe){console.warn("Failed to refresh workspace after force Stop failed",fe)}}finally{an(!1)}}async function Ta(y,k){if(!w||!y.approvalTurnId||y.approvalRequestId===void 0)return;const j=w;try{const _=ye(`conversations/${j}/turns/${y.approvalTurnId}/approvals/${encodeURIComponent(String(y.approvalRequestId))}`),U=await fetch(_,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k})});if(!U.ok)throw await pn(U,{method:"POST",url:_});st(j,Z=>({...Z,events:[...Z.events,{id:Z.events.length+1,event:"server.approval.decision",data:{requestId:y.approvalRequestId,decision:k,source:"client"},createdAt:new Date().toISOString()}]}))}catch(_){st(j,Z=>({...Z,events:[...Z.events,{id:Z.events.length+1,event:"client.error",data:gr(_),createdAt:new Date().toISOString()}]}));const U=Ve(_);ke("error","Failed to respond to approval",U.detail??U.message)}}async function Ti(y,k,j){const _=w,U=y.workspaceChangeProposalId??y.responsibilityProposalId;if(!_||!U)return!1;try{const Z=ye(`conversations/${_}/workspace-change-proposals/${encodeURIComponent(U)}`),fe=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,payload:k==="accept"?j??y.workspaceChangePayload:void 0})});if(!fe.ok)throw await pn(fe,{method:"POST",url:Z});const je=await fe.json(),be=tA(k,je.decision),ve=be==="accept"?je.payload??j??y.workspaceChangePayload:null;return Rn(je.conversation),st(_,dt=>({...dt,events:[...dt.events,{id:`${y.id}:${be}`,event:"server.workspace_change.decision",data:{proposalId:U,changeType:y.workspaceChangeType??"responsibility",decision:be,payload:ve},createdAt:new Date().toISOString()}]})),ke("success",be==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(Z){console.error(Z);const fe=Ve(Z);return ke("error","Failed to respond to workspace change proposal",fe.detail??fe.message),!1}}async function Ei(y,k,j){const _=w;if(!(!_||!y.knowledgeProposalId))try{let U;if(k==="accept")try{U=JSON.parse(j??y.body)}catch{ke("error","Knowledge proposal JSON is invalid");return}const Z=ye(`conversations/${_}/knowledge-proposals/${encodeURIComponent(y.knowledgeProposalId)}`),fe=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,knowledge:U})});if(!fe.ok)throw await pn(fe,{method:"POST",url:Z});const je=await fe.json();ra([...je.items??[]].sort(pb)),st(_,be=>({...be,events:[...be.events,{id:`${y.id}:${k}`,event:"server.knowledge.decision",data:{proposalId:y.knowledgeProposalId,decision:k,knowledge:k==="accept"?je.item:null},createdAt:new Date().toISOString()}]})),ke("success",k==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(U){console.error(U);const Z=Ve(U);ke("error","Failed to respond to knowledge proposal",Z.detail??Z.message)}}function mo(y){Zs(y.id,y.status),Ad(y),xe(k=>{const j=k[y.id],_=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:Fc(_,(j==null?void 0:j.events)??[]),timelineNodes:Dp(y.timelineNodes??[],(j==null?void 0:j.timelineNodes)??[]),turns:Np(y.turns??[],(j==null?void 0:j.turns)??[]),contextVersions:y.contextVersions??[],status:y.status,history:nl(y),loadingOlder:!1,fullEventTurnIds:(j==null?void 0:j.fullEventTurnIds)??new Set,loadingEventTurnIds:(j==null?void 0:j.loadingEventTurnIds)??new Set}}})}function cl(y){const k=nl(y);st(y.id,j=>{var _,U,Z;return{...j,messages:Ap(y.messages,j.messages),timelineNodes:Dp(y.timelineNodes??[],j.timelineNodes),turns:Np(y.turns??[],j.turns),events:Fc(y.events.map(fe=>({id:fe.id,turnId:fe.turnId,seq:fe.seq,event:fe.event,data:fe.data,createdAt:fe.createdAt})),j.events),contextVersions:(((_=y.contextVersions)==null?void 0:_.length)??0)>0?y.contextVersions??[]:j.contextVersions,history:{...k,loadedMessageCount:k.loadedMessageCount+(((U=j.history)==null?void 0:U.loadedMessageCount)??j.messages.length),loadedEventCount:k.loadedEventCount+(((Z=j.history)==null?void 0:Z.loadedEventCount)??j.events.length)},loadingOlder:!1}})}function dl(y){const k=nl(y),j=y.events.map(_=>({id:_.id,turnId:_.turnId,seq:_.seq,event:_.event,data:_.data,createdAt:_.createdAt}));st(y.id,_=>{var U,Z,fe;return{..._,messages:Ap(_.messages,y.messages),timelineNodes:Dp(_.timelineNodes,y.timelineNodes??[]),turns:Np(_.turns,y.turns??[]),events:Fc(j,_.events),contextVersions:(((U=y.contextVersions)==null?void 0:U.length)??0)>0?y.contextVersions??[]:_.contextVersions,status:y.status,history:{..._.history??k,messageTotal:k.messageTotal,eventTotal:k.eventTotal,loadedMessageCount:Math.max(((Z=_.history)==null?void 0:Z.loadedMessageCount)??_.messages.length,_.messages.length,y.messages.length),loadedEventCount:Math.max(((fe=_.history)==null?void 0:fe.loadedEventCount)??_.events.length,_.events.length,y.events.length)},loadingOlder:!1}})}function st(y,k){xe(j=>{const _=j[y]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...j,[y]:k(_)}})}function Ai(y,k){b(j=>j.map(_=>_.id===y?{..._,status:k,updatedAt:new Date().toISOString()}:_))}function Ad(y){Rn(y)}function Rn(y){b(k=>Nl(u,k.map(j=>j.id===y.id?{...j,...y}:j)))}async function Ea(y,k){const j=k.filter(_=>{const U=Ce[y];return U&&!U.fullEventTurnIds.has(_)&&!U.loadingEventTurnIds.has(_)});if(j.length!==0){st(y,_=>{const U=new Set(_.loadingEventTurnIds);for(const Z of j)U.add(Z);return{..._,loadingEventTurnIds:U}});try{const _=await Promise.all(j.map(U=>UD(y,U)));st(y,U=>{const Z=new Set(U.fullEventTurnIds),fe=new Set(U.loadingEventTurnIds),je=_.flatMap((be,ve)=>{const dt=j[ve];return Z.add(dt),fe.delete(dt),be.map(et=>({id:et.id,turnId:et.turnId,seq:et.seq,event:et.event,data:et.data,createdAt:et.createdAt}))});return{...U,events:Fc(U.events,je),fullEventTurnIds:Z,loadingEventTurnIds:fe}})}catch(_){console.error(_),st(y,U=>{const Z=new Set(U.loadingEventTurnIds);for(const fe of j)Z.delete(fe);return{...U,loadingEventTurnIds:Z}}),ke("error","Failed to load process details")}}}function di(y,k){const j=new Set(Xl.current);k?j.add(y):j.delete(y),Xl.current=j,wu(_=>{const U=new Set(_);return k?U.add(y):U.delete(y),U})}function is(y){const k=WE({key:y.key,metaKey:y.metaKey,ctrlKey:y.ctrlKey,shiftKey:y.shiftKey,isComposing:y.nativeEvent.isComposing});k&&(y.preventDefault(),es({forceNewTurn:k.forceNewTurn}))}function Fu(y){$l(k=>{const j=new Set(k);return j.has(y)?j.delete(y):j.add(y),jp(u,j),j})}function fl(y){var k;return JE(y.status,(k=y.nextWakeup)==null?void 0:k.status,zr.has(y.id))}function cr(y){var _;const k=(_=Gs.current)==null?void 0:_.getBoundingClientRect(),j=k?y-k.left:y;return Rh(j)}function as(y){y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId),pa(cr(y.clientX))}function ls(y){y.currentTarget.hasPointerCapture(y.pointerId)&&(y.preventDefault(),pa(cr(y.clientX)))}function Yu(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const k=cr(y.clientX);pa(k),SA(u,k)}return s.jsxs("main",{className:`shell${te?" mobile-sidebar-open":""}`,ref:Gs,style:{"--sidebar-width":`${ku}px`},children:[s.jsxs("aside",{className:"sidebar",children:[s.jsxs("div",{className:"sidebar-header",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"eyebrow brand-line",children:[s.jsx("span",{children:"Seele"}),se?i.role==="admin"?s.jsxs("a",{"aria-label":`Open Seele Host control for Work v${se}`,className:"work-version-link",href:`${Dh()}admin/host`,title:"Open Seele Host control: versions, restart, and logs",children:["v",se,s.jsx("span",{"aria-hidden":"true",children:"↗"})]}):s.jsxs("span",{children:["v",se]}):null,s.jsx("span",{"aria-label":kb(Se),className:`backend-status ${Se}`,"data-label":kb(Se)})]}),s.jsxs("div",{className:"sidebar-title-row",children:[s.jsx("h2",{children:"Workspaces"}),e?s.jsx("button",{"aria-label":`Sign out ${i.username}`,className:"sign-out-button",onClick:r,title:`Sign out ${i.username}`,type:"button",children:"Sign out"}):null]})]}),s.jsxs("div",{className:"sidebar-header-actions",children:[s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-dismiss",onClick:()=>ue(!1),title:"Close workspace list",type:"button",children:"×"}),s.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:ka,children:"+"})]})]}),s.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:Zl.map(y=>s.jsxs("section",{className:["workspace-group",Bs===y.id?"dragging":"",Hl===y.id?"drop-after":"",(Tn==null?void 0:Tn.kind)==="group"&&Tn.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":!Lr.has(y.id),className:"workspace-group-toggle",onClick:k=>{if(Ys.current){k.preventDefault(),Ys.current=!1;return}Fu(y.id)},onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),yn(y)},onPointerCancel:fo,onPointerDown:k=>Fe(k,y.id),onPointerMove:k=>Yi(k,y.id),onPointerUp:k=>Nn(k,y.id),type:"button",children:[s.jsx("span",{className:Lr.has(y.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),s.jsx("span",{onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),yn(y)},title:"Double-click to rename",children:y.title})]}),y.id!==Lx?s.jsx("button",{"aria-label":`Delete group ${y.title}`,className:"workspace-group-delete",onClick:k=>{k.stopPropagation(),Jr(y)},title:"Delete group",type:"button",children:"×"}):null]}),Lr.has(y.id)?null:s.jsx("div",{className:"workspace-group-items",children:y.conversations.map(k=>{const j=fl(k);return s.jsxs("div",{className:["session-item",k.id===w?"active":"",k.id===ql?"dragging":"",(Tn==null?void 0:Tn.kind)==="workspace"&&Tn.id===k.id?`drop-${Tn.position}`:""].filter(Boolean).join(" "),"data-workspace-id":k.id,onClick:_=>{if(Ql.current){_.preventDefault(),Ql.current=!1;return}Zr(k.id),ue(!1)},onDoubleClick:_=>{Vn(_.target)||(_.preventDefault(),sr(k))},onKeyDown:_=>{ui(_.target)||_.key==="Enter"&&(Zr(k.id),ue(!1))},onPointerCancel:gt,onPointerDown:_=>co(_,k.id),onPointerMove:_=>qu(_,k.id),onPointerUp:_=>Yt(_,k.id),role:"button",tabIndex:0,children:[s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{"aria-label":ed(j,k.nextWakeup,Hn),className:`session-status ${j}`,title:ed(j,k.nextWakeup,Hn)}),s.jsx("span",{className:"session-title",title:"Double-click to rename",children:k.title}),j==="waiting"&&k.nextWakeup?s.jsx("span",{className:"session-countdown",title:ed(j,k.nextWakeup,Hn),children:od(k.nextWakeup,Hn)}):null,k.unreadTurnCount>0?s.jsx("span",{"aria-label":`${k.unreadTurnCount} unread turns`,className:"session-unread",title:`${k.unreadTurnCount} unread turns`,children:k.unreadTurnCount>99?"99+":k.unreadTurnCount}):null,j!=="running"?s.jsx("button",{"aria-label":`Delete ${k.title}`,className:"session-delete",onClick:_=>{_.stopPropagation(),mt(k)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),s.jsxs("span",{className:"session-workspace",title:k.workspacePath,children:["workspaces/",Es(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:io,type:"button",children:s.jsx(nb,{})}),s.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:Bu,type:"button",children:s.jsx(T2,{})}),s.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{ua(!0),ue(!1)},type:"button",children:s.jsx(Qc,{})}),s.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:Vi,type:"button",children:s.jsx(E2,{})}),s.jsx(NN,{usage:ar})]})})]}),s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>ue(!1),tabIndex:te?0:-1,type:"button"}),s.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:as,onPointerMove:ls,onPointerUp:Yu,role:"separator",tabIndex:0}),Ps&&Bi?s.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${Bi.x+12}px, ${Bi.y+10}px, 0)`},children:[s.jsx("span",{className:"workspace-drag-title",children:Ps.title}),s.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",Es(Ps.id)]})]}):null,Oe?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:ci,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:ci,onSubmit:y=>void ul(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),s.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:Pi,onKeyDown:ci,value:Oe.title}),Oe.mode==="create"?s.jsxs(s.Fragment,{children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group",children:"Group"}),s.jsx("select",{id:"workspace-group",onChange:Hu,onKeyDown:ci,value:Oe.groupId??((Xi=x[0])==null?void 0:Xi.id)??"",children:x.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:Ft,children:"Cancel"}),s.jsx("button",{disabled:St,type:"submit",children:St?"Saving...":Oe.mode==="create"?"Create":"Save"})]})]})}):null,Ie?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Sa,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:Sa,onSubmit:y=>void po(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:$u,onKeyDown:Sa,value:Ie.title}),s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:sn,children:"Cancel"}),s.jsx("button",{type:"submit",children:Ie.mode==="create"?"Create":"Save"})]})]})}):null,jt?s.jsx(GA,{currentUser:i,conversations:m,editingEnvironmentKey:Bl,deploymentSettings:de,environmentDraft:sa,globalEnvironment:Mi,workspaceEnvironment:zl,memorySettings:zs,memorySettingsDraft:xu,workspaceMemoryDraft:Vt,runtimeSettings:ia,runtimeModels:qe,runtimeCodexVersion:Gt,runtimeCodexReleasedAt:Kt,runtimeCodexUpdating:(At==null?void 0:At.status)==="running",runtimeSettingsDraft:Ha,runtimeSettingsScope:Sn,settingsWorkspace:Ot,settingsWorkspaceId:ct,systemDiagnostics:A,systemDiagnosticsLoading:C,workspaceGroups:Zl,workspaceRuntimeSettings:Ms,workspaceRuntimeSettingsDraft:Os,managedUsers:Me,onCancelEnvironmentEdit:ba,onClose:()=>$t(!1),onCreateUser:async y=>{const k=await ER(y);O(j=>[...j,k]),ke("success","User created")},onDeleteUser:async y=>{await NR(y),O(k=>k.filter(j=>j.id!==y)),ke("success","User deleted")},onSaveDeploymentSettings:jd,onDeleteEnvironment:y=>void sl(y),onDraftChange:ti,onEditEnvironment:ro,onRevealEnvironmentValue:y=>void zu(y),onSaveBaseMemoryItems:y=>Gn(y),onSaveResponsibility:async(y,k)=>{try{const j=await Wc(y,{responsibility:k});return Rn(j),oe("connected"),ke("success","Workspace responsibility saved"),j.responsibility}catch(j){throw console.error(j),oe("error"),ke("error","Failed to save workspace responsibility"),j}},onSaveWorkspaceMemoryItems:y=>ct?Wr(ct,y):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:_s,onCodexAccountSwitched:async()=>{ke("success","Codex account switched"),(await Dw()).codexAccountsReady&&await Promise.all([Jt(!0),rl(!0),eo()])},onUpdateCodexCli:()=>{rt(!0),Gi(!0)},onRuntimeScopeChange:Oi,onSettingsWorkspaceChange:Ru,onSubmitRuntimeSettings:y=>void _u(y),onWorkspaceRuntimeDraftChange:la,onWorkspaceRuntimeReset:y=>ct?void ao(ct,y):void 0,revealedEnvironmentKeys:Ya,onSubmitEnvironment:y=>void An(y),onRefreshSystemDiagnostics:()=>void ji(),onUpdateUser:async(y,k)=>{const j=await AR(y,k);O(_=>_.map(U=>U.id===j.id?j:U)),ke("success","User updated")}}):null,Xt?s.jsx($A,{currentReleasedAt:Kt,currentVersion:Gt,job:At,latest:Er,latestChecking:aa,starting:yd,onClose:()=>rt(!1),onRefresh:()=>void Gi(),onStart:()=>void to()}):null,zi&&Re?s.jsx(UA,{conversation:Re,clockNow:Hn,knowledgeDraft:Va,workspaceKnowledge:Ga,tokenUsage:Jl,onCancelKnowledgeEdit:()=>Fa(Xo),onDeleteKnowledge:y=>void Kr(Re.id,y),onEditKnowledge:Xr,onKnowledgeDraftChange:Fa,onSubmitKnowledge:y=>void lo(Re.id,y),onClose:()=>Nt(!1)}):null,oa?s.jsx(BA,{conversations:m,onClose:()=>ua(!1),workspaceGroups:Zl}):null,Nr?s.jsx(qA,{busy:_r||ni,conversation:$n??null,conversationId:Li,forceStopBusy:ni,preview:(ii==null?void 0:ii.conversationId)===Li?ii:null,previewLoading:bu,result:Mr,status:bd,warmup:Is,workspaceGroups:Zl,onClose:()=>Dr(!1),onCancelResetPreview:()=>Ii(null),onForceStop:()=>void Dt(),onPreviewReset:()=>void Cd(),onStartBlankContext:()=>void Mu(),onResetRuntime:y=>void Td(y),onSaveResetSelection:Ou,onWorkspaceChange:y=>{Rr(y),Ui(null),Ii(null)},onWarmupChange:xd}):null,K?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!J&&ae(null),children:s.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:Qr,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:()=>ae(null),type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{autoFocus:!0,value:K.name,onChange:y=>ae(k=>k&&{...k,name:y.target.value})})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Group"}),s.jsx("select",{value:K.groupId,onChange:y=>ae(k=>k&&{...k,groupId:y.target.value}),children:Zl.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:J,onClick:()=>ae(null),type:"button",children:"Cancel"}),s.jsx("button",{disabled:J||!K.name.trim(),type:"submit",children:J?"Cloning...":"Clone"})]})]})}):null,q?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>F(null),children:s.jsxs("section",{"aria-labelledby":"complex-task-detail-title","aria-modal":"true",className:"dialog-card task-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"complex-task-detail-title",children:q.title}),s.jsxs("p",{children:[wb(q.status),q.startedAt&&q.finishedAt?` · ${xR(q.startedAt,q.finishedAt)}`:""]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>F(null),type:"button",children:"×"})]}),s.jsxs("div",{className:"complex-task-detail task-record-detail",children:[s.jsxs("div",{children:[s.jsx("small",{children:"Objective"}),s.jsx("p",{children:q.objective??"No objective recorded."})]}),s.jsxs("div",{children:[s.jsx("small",{children:q.status==="completed"?"Final plan":"Current plan"}),q.currentPlan?s.jsx("article",{className:"message assistant complex-task-plan-preview",children:s.jsx("div",{className:"message-main",children:s.jsx("div",{className:"message-body",children:Rl(q.currentPlan.planMarkdown,Re)})})}):s.jsx("p",{children:"No plan recorded."})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Goal"}),s.jsx("dd",{children:q.codexGoalStatus??"not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Plan versions"}),s.jsx("dd",{children:q.planVersions.length})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:q.startedAt?$e(q.startedAt):"—"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Finished"}),s.jsx("dd",{children:q.finishedAt?$e(q.finishedAt):"—"})]})]})]}),s.jsx("footer",{children:s.jsx("button",{className:"secondary",onClick:()=>F(null),type:"button",children:"Close"})})]})}):null,ie?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>N(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:ie.title}),s.jsx("p",{children:$e(ie.createdAt)})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>N(null),type:"button",children:"×"})]}),s.jsx("div",{className:"system-event-detail-content",children:s.jsx(iu,{content:ie.fullDetail??ie.detail??"No additional details.",conversation:Re,streaming:!1,onPreviewArtifact:qn,onCopyArtifactUrl:$i,copiedArtifactUrl:jn})}),s.jsxs("footer",{children:[ie.linkedTaskId?s.jsx("button",{onClick:()=>{const y=ie.linkedTaskId;N(null),rn(y)},type:"button",children:"View task"}):null,s.jsx("button",{className:"secondary",onClick:()=>N(null),type:"button",children:"Close"})]})]})}):null,Ke?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>{nn||mt(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:nn,onClick:()=>mt(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Move ",s.jsx("strong",{children:Ke.title})," to recycle?"]}),s.jsx("code",{children:Ke.workspacePath}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:nn,onClick:()=>mt(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:nn,onClick:()=>void ol(Ke),type:"button",children:nn?"Moving...":"Move to recycle"})]})]})}):null,Zt?s.jsxs("div",{className:`app-toast ${Zt.tone}`,role:"status",children:[s.jsx("strong",{children:Zt.text}),Zt.detail?s.jsx("pre",{children:Zt.detail}):null]}):null,s.jsxs("section",{className:"conversation",children:[s.jsxs("header",{className:"topbar",children:[s.jsxs("div",{className:"topbar-main",children:[s.jsx("button",{"aria-label":"Show workspaces",className:"mobile-workspace-menu",onClick:()=>ue(!0),title:"Workspaces",type:"button",children:s.jsx(C2,{})}),s.jsxs("div",{className:"topbar-heading",children:[s.jsx("div",{className:"topbar-title-row",children:s.jsx("h1",{children:(Re==null?void 0:Re.title)??"New workspace"})}),Re?s.jsxs("p",{className:"topbar-workspace",children:["workspaces/",Es(Re.id)]}):null]})]}),s.jsx("div",{className:"topbar-actions",children:Re?s.jsxs(s.Fragment,{children:[Re.threadUpgradeRequired?s.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:Vi,title:`当前 Thread 工具集已过期(${Re.threadCapabilityVersion} / ${Re.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:s.jsx(uw,{})}):null,s.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:Iu,title:"Clone workspace",type:"button",children:s.jsx(j2,{})}),s.jsxs("button",{className:`context-button has-usage ${Bh(er??0)}`,onClick:()=>Nt(!0),style:{"--context-usage":`${md(er??0)}%`},title:Jl&&er!==null?`Context ${Math.round(er)}% · ${Un(Jl.totalTokens)} / ${Jc(Jl.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[s.jsx("span",{children:"Context"}),s.jsxs("strong",{children:[Math.round(er??0),"%"]})]}),s.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:Nu,title:"Workspace settings",type:"button",children:s.jsx(nb,{})})]}):null})]}),R?s.jsxs("section",{className:`complex-task-bar ${R.status}`,children:[s.jsxs("button",{className:"complex-task-summary",onClick:()=>void rn(R.id),title:"View complex task details",type:"button",children:[s.jsx("span",{className:"complex-task-kicker",children:"Complex task"}),s.jsx("strong",{children:R.title}),s.jsx("span",{className:"complex-task-state",children:wb(R.status)}),s.jsx("span",{className:"complex-task-duration",children:yR(R,Hn)})]}),s.jsxs("div",{className:"complex-task-actions",children:[Ip(R.status,"discussing","ready","replanning")?s.jsx("button",{disabled:!R.objective||!R.currentPlan,onClick:()=>void va("start"),title:R.objective&&R.currentPlan?"Start this complex task":"A complete candidate plan is required before starting",type:"button",children:"Start"}):null,R.status==="active"?s.jsx("button",{onClick:()=>void va("pause"),type:"button",children:"Pause"}):null,Ip(R.status,"paused","waiting","blocked")?s.jsx("button",{onClick:()=>void va("resume"),type:"button",children:"Resume"}):null,Ip(R.status,"active","paused","waiting","blocked")?s.jsx("button",{className:"secondary",onClick:()=>void va("replan"),type:"button",children:"Replan"}):null,s.jsx("button",{className:"quiet danger",onClick:()=>void va("end"),type:"button",children:"End task"})]})]}):null,(Re==null?void 0:Re.status)==="initialization_failed"&&Re.cloneLineage?s.jsxs("div",{className:"clone-initialization-error",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Clone initialization failed"}),s.jsx("span",{children:Re.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),s.jsx("button",{onClick:()=>void wa(),type:"button",children:"Retry with a clean thread"})]}):null,s.jsx("div",{className:"stream",onScroll:()=>void vd(),ref:ha,style:{scrollPaddingBottom:si},children:s.jsxs("div",{className:"stream-inner",style:{paddingBottom:si},children:[Za.length===0?s.jsx("div",{className:"empty-state",children:s.jsx("h2",{children:"Start a workspace"})}):null,s.jsxs("section",{className:"message-log","aria-label":"Conversation messages",children:[Re!=null&&Re.cloneLineage&&Vr.size>0?s.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[s.jsxs("strong",{children:["Inherited from ",Re.cloneLineage.sourceWorkspaceTitle]}),s.jsxs("span",{children:["through ",$e(Re.cloneLineage.snapshotAt)," · ",Re.cloneLineage.importedMessageCount," messages"]})]}):null,(yo=at==null?void 0:at.history)!=null&&yo.hasMoreBefore?s.jsx("div",{className:"history-loader",children:at.loadingOlder?"Loading earlier messages...":"Scroll up for earlier messages"}):null,Gr.map((y,k)=>{var fe,je,be;const j=((fe=y.user)==null?void 0:fe.type)==="system",_=y.turnIds.some(ve=>Vr.has(ve)),U=Gr[k+1],Z=_&&(!U||!U.turnIds.some(ve=>Vr.has(ve)));return s.jsxs(D.Fragment,{children:[s.jsxs("section",{className:`turn-group${_?" clone-history-turn":""}`,"data-turn-id":y.id,children:[y.user?s.jsxs("div",{className:`turn-panel ${j?"system-turn":"user-turn"}`,children:[eu(y.user,Re,qn,$i,jn,Ta,Ti,Ei,rn,N),s.jsx(tu,{copied:Pa===`${j?"system":"user"}-${y.id}-bottom`,content:nu(y.user),id:`${j?"system":"user"}-${y.id}-bottom`,timestamp:y.user.createdAt,variant:"outside",onCopy:il})]}):null,y.followupUsers.length>0?s.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:y.followupUsers.map(ve=>s.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[s.jsx("span",{className:"followup-user-label",children:"Added while running"}),eu(ve,Re,qn,$i,jn,Ta,Ti,Ei,rn,N),s.jsx(tu,{copied:Pa===`user-${ve.id}-bottom`,content:nu(ve),id:`user-${ve.id}-bottom`,timestamp:ve.createdAt,variant:"outside",onCopy:il})]},ve.id))}):null,(je=y.acceptedSystemInputs)==null?void 0:je.map(ve=>s.jsxs("div",{className:"turn-panel system-turn",children:[eu(ve,Re,qn,$i,jn,Ta,Ti,Ei,rn,N),s.jsx(tu,{copied:Pa===`system-${ve.id}-bottom`,content:nu(ve),id:`system-${ve.id}-bottom`,timestamp:ve.createdAt,variant:"outside",onCopy:il})]},ve.id)),y.agentItems.length>0?s.jsx(mN,{group:y,conversation:Re,allowProcessView:!_,copiedFooter:Pa===`agent-${y.id}-bottom`,copiedArtifactUrl:jn,running:!_&&ou(y.turnIds,Ja),onCopyArtifactUrl:$i,onCopyBubble:il,onPreviewArtifact:qn,onLoadProcessDetails:ve=>Re&&!_?Ea(Re.id,ve):void 0,onRespondApproval:Ta,onRespondWorkspaceChangeProposal:Ti,onRespondKnowledgeProposal:Ei,onOpenComplexTask:rn,onOpenSystemEvent:N}):null,(be=y.trailingSystemItems)==null?void 0:be.map(ve=>s.jsxs("div",{className:"turn-panel system-turn",children:[eu(ve,Re,qn,$i,jn,Ta,Ti,Ei,rn,N),s.jsx(tu,{copied:Pa===`system-${ve.id}-bottom`,content:nu(ve),id:`system-${ve.id}-bottom`,timestamp:ve.createdAt,variant:"outside",onCopy:il})]},ve.id))]}),Z?s.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},y.id)})]})]})}),s.jsxs("form",{className:"composer",onSubmit:ho,ref:Gl,children:[tl?s.jsxs("div",{className:`global-activity ${tl.tone??"running"}`,children:[Fr?s.jsx("button",{"aria-label":"Stop current workspace activity",className:"turn-stop activity-stop",onClick:()=>void Ed(),title:"Stop current workspace activity",type:"button",children:s.jsx(xN,{})}):s.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),s.jsxs("div",{className:"global-activity-text",children:[s.jsx("span",{children:tl.title}),tl.detail?s.jsx("small",{children:tl.detail}):null]}),Fr?s.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,s.jsxs("div",{className:"composer-panel",children:[s.jsxs("button",{"aria-label":R?"Complex task mode is locked while a task is in progress":"Toggle complex task mode","aria-pressed":!!R||M==="complex",className:`complex-mode-button ${R||M==="complex"?"active":""}`,disabled:!!R,onClick:()=>H(y=>y==="complex"?"simple":"complex"),title:R?"End the current complex task before switching back":M==="complex"?"Complex task mode on":"Complex task mode off",type:"button",children:[s.jsx(Pv,{}),s.jsx("span",{className:"complex-mode-tooltip",role:"tooltip",children:R?"Complex task active":M==="complex"?"Complex task mode on":"Complex task mode off"})]}),s.jsx("textarea",{disabled:ju.textareaDisabled,onChange:y=>ja(y.target.value),onKeyDown:is,placeholder:"Cmd/Ctrl + Enter",ref:Ur,value:c}),s.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:ju.sendDisabled,type:"submit",children:[s.jsx(bN,{}),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"]})]})]})]})]}),ai?s.jsx("div",{className:"artifact-lightbox",onClick:()=>qn(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:()=>qn(null),type:"button",children:"×"}),s.jsx("img",{alt:ai.name,src:ai.url}),s.jsxs("figcaption",{children:[s.jsx("span",{children:ai.name}),s.jsxs("div",{className:"artifact-lightbox-actions",children:[s.jsx("a",{href:ai.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),s.jsx("button",{onClick:()=>void $i(ai),type:"button",children:jn===ai.url?"Copied":"Copy URL"})]})]})]})}):null]})]})}function UA({conversation:e,clockNow:i,knowledgeDraft:a,workspaceKnowledge:r,tokenUsage:u,onCancelKnowledgeEdit:c,onDeleteKnowledge:d,onEditKnowledge:p,onKnowledgeDraftChange:g,onSubmitKnowledge:m,onClose:b}){const[x,S]=D.useState("overview"),[w,E]=D.useState(!1),[R,$]=D.useState(!1),[M,H]=D.useState(null),[q,F]=D.useState(null),[ie,N]=D.useState(!1),[K,ae]=D.useState(null),[J,I]=D.useState(null),[te,ue]=D.useState(!1),[Ce,xe]=D.useState(null),[ce,V]=D.useState(null),se=jw(u),we=sh(e,e.status),Me=M?aR(M):null;D.useEffect(()=>{E(!1),H(null),F(null),ae(null),I(null),xe(null),V(null)},[e.id]),D.useEffect(()=>{x==="additionalContext"&&!K&&A()},[x,K]),D.useEffect(()=>{x==="compactions"&&!Ce&&z()},[x,Ce]);const O=()=>{E(!0),$(!0),F(null),uD(e.id).then(C=>H(C)).catch(C=>{const W=Ve(C);F(W.detail?`${W.message}
89
+ ${W.detail}`:W.message)}).finally(()=>$(!1))},A=()=>{N(!0),I(null),dD(e.id).then(C=>ae(C)).catch(C=>{const W=Ve(C);I(W.detail?`${W.message}
90
+ ${W.detail}`:W.message)}).finally(()=>N(!1))},z=()=>{ue(!0),V(null),fD(e.id).then(C=>xe(C)).catch(C=>{const W=Ve(C);V(W.detail?`${W.message}
91
+ ${W.detail}`:W.message)}).finally(()=>ue(!1))};return s.jsx("div",{className:"context-panel-overlay workspace-context-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Workspace context",className:"context-panel workspace-context-panel",onClick:C=>C.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header workspace-context-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Workspace Context"}),s.jsx("p",{children:"Long-lived context assets and observable state for this workspace."})]}),s.jsx("button",{"aria-label":"Close context panel",onClick:b,type:"button",children:"×"})]}),s.jsxs("div",{className:"workspace-context-body",children:[s.jsxs("nav",{className:"settings-nav workspace-context-nav","aria-label":"Workspace context sections",children:[s.jsxs("button",{className:x==="overview"?"active":void 0,onClick:()=>S("overview"),type:"button",children:[s.jsx("span",{children:"Overview"}),s.jsx("small",{children:"Identity + state"})]}),s.jsxs("button",{className:x==="responsibility"?"active":void 0,onClick:()=>S("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Long-lived role"})]}),s.jsxs("button",{className:x==="knowledge"?"active":void 0,onClick:()=>S("knowledge"),type:"button",children:[s.jsx("span",{children:"Knowledge"}),s.jsx("small",{children:"Sources + skills"})]}),s.jsxs("button",{className:x==="runtime"?"active":void 0,onClick:()=>S("runtime"),type:"button",children:[s.jsx("span",{children:"Runtime View"}),s.jsx("small",{children:"Thread + tokens"})]}),s.jsxs("button",{className:x==="compactions"?"active":void 0,onClick:()=>S("compactions"),type:"button",children:[s.jsx("span",{children:"Compactions"}),s.jsx("small",{children:"Context history"})]}),s.jsxs("button",{className:x==="additionalContext"?"active":void 0,onClick:()=>S("additionalContext"),type:"button",children:[s.jsx("span",{children:"Additional Context"}),s.jsx("small",{children:"Injected keys"})]})]}),s.jsx("div",{className:"workspace-context-content",children:x==="overview"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:`context-card wide workspace-status-detail ${we}`,children:[s.jsx("h3",{children:"Current Status"}),s.jsx(Je,{label:"Status",value:ed(we,e.nextWakeup,i)}),e.nextWakeup?s.jsxs(s.Fragment,{children:[s.jsx(Je,{label:"Wakeup state",value:e.nextWakeup.status}),s.jsx(Je,{label:"Wake at",value:fu(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?s.jsx(Je,{label:"Remaining",value:od(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/${Es(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:Rl(e.responsibility,e)}):s.jsx("p",{className:"context-muted",children:"No approved responsibility is configured yet."})]}),s.jsxs("section",{className:"context-card wide",children:[s.jsx("h3",{children:"Knowledge Index"}),s.jsx(Yv,{items:r,onDelete:d,onEdit:C=>{p(C),S("knowledge")}})]})]}):x==="responsibility"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Responsibility"}),s.jsx("p",{children:"User-approved long-lived role for this workspace. Edit it from Settings in workspace scope."})]})}),e.responsibility.trim()?s.jsx("div",{className:"context-card context-markdown-preview",children:Rl(e.responsibility,e)}):s.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):x==="knowledge"?s.jsx(lN,{draft:a,items:r,scope:"workspace",workspaceName:e.title,onCancel:c,onDelete:d,onDraftChange:g,onEdit:p,onSubmit:m}):x==="runtime"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Runtime"}),s.jsx(Je,{label:"Runtime thread",value:e.codexThreadId??"not started",mono:!0}),s.jsxs("div",{className:"thread-read-actions",children:[s.jsx("button",{disabled:R,onClick:O,type:"button",children:R?"Reading...":"Read Codex thread"}),w?s.jsx("button",{disabled:R,onClick:()=>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 ${Bh(se)}`,children:s.jsx("span",{style:{width:`${md(se)}%`}})}):null,s.jsx(Je,{label:"Input / output",value:`${Jc(u.inputTokens)} / ${Jc(u.outputTokens)}`,mono:!0}),s.jsx(Je,{label:"Reasoning",value:Jc(u.reasoningOutputTokens),mono:!0}),s.jsxs("p",{className:"context-muted",children:["Updated ",$e(u.createdAt),"."]})]}):s.jsx("p",{className:"context-muted",children:"No token usage event has been observed in the loaded event window yet."})]}),w?s.jsxs("section",{className:"context-card wide thread-read-panel",children:[s.jsx("h3",{children:"Runtime thread profile"}),s.jsx("p",{className:"context-muted",children:"One-time live thread/read response from Codex app-server. Seele does not persist this profile result."}),R?s.jsx("p",{className:"context-muted",children:"Reading Codex thread..."}):q?s.jsx("pre",{className:"thread-read-error",children:q}):M?s.jsxs(s.Fragment,{children:[Me?s.jsx(fN,{summary:Me}):null,s.jsxs("details",{className:"thread-read-raw",open:!0,children:[s.jsx("summary",{children:"Raw thread/read JSON"}),s.jsx("pre",{className:"thread-read-dump",children:JSON.stringify(M,null,2)})]})]}):s.jsx("p",{className:"context-muted",children:"No thread/read result loaded yet."})]}):null]}):x==="compactions"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Context Compactions"}),s.jsx("p",{children:"Compaction history recorded for the current runtime thread."})]}),s.jsx("button",{className:"context-refresh-button",disabled:te,onClick:z,type:"button",children:te?"Refreshing...":"Refresh"})]}),ce?s.jsx("pre",{className:"thread-read-error",children:ce}):te&&!Ce?s.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):Ce!=null&&Ce.length?s.jsx("div",{className:"context-compaction-list",children:Ce.map(C=>s.jsxs("article",{className:"context-compaction-item",children:[s.jsxs("div",{className:"context-compaction-heading",children:[s.jsx("time",{children:$e(C.completedAt??C.usageObservedAt??C.startedAt??"")}),s.jsx("span",{className:`context-compaction-status ${C.status}`,children:C.status==="completed"?"Completed":"Running"})]}),s.jsx("dl",{className:"context-compaction-facts",children:QD(C).map(W=>s.jsxs("div",{children:[s.jsx("dt",{children:W.label}),s.jsx("dd",{children:W.value})]},W.label))}),s.jsxs("small",{children:[Ml(C.id),C.turnId?` · turn ${Ml(C.turnId)}`:""]})]},C.id))}):s.jsx("p",{className:"context-card context-muted",children:"No compaction records yet."})]}):s.jsxs("section",{className:"context-tab-surface thread-read-panel",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Additional Context"}),s.jsx("p",{children:"One-time live render of the application additionalContext for this workspace. Seele does not persist this preview result."})]})}),ie?s.jsx("p",{className:"context-card context-muted",children:"Rendering additionalContext..."}):J?s.jsx("pre",{className:"thread-read-error",children:J}):K?s.jsx(cN,{preview:K,refreshing:ie,onRefresh:A}):s.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function BA({conversations:e,onClose:i,workspaceGroups:a}){var O;const[r,u]=D.useState([]),[c,d]=D.useState("active"),[p,g]=D.useState(null),[m,b]=D.useState([]),[x,S]=D.useState(!0),[w,E]=D.useState(null),[R,$]=D.useState(null),[M,H]=D.useState(!1),[q,F]=D.useState(!1),[ie,N]=D.useState(new Set),[K,ae]=D.useState({title:"",publicDescription:"",ownerWorkspaceId:((O=e[0])==null?void 0:O.id)??"",participantWorkspaceIds:[]}),J=r.find(A=>A.id===p)??null,I=D.useMemo(()=>new Map(e.map(A=>[A.id,A.title])),[e]),te=r.filter(A=>c==="archived"?A.status==="archived":A.status!=="archived"),ue=a.map(A=>({...A,conversations:A.conversations.filter(z=>z.id!==K.ownerWorkspaceId)})).filter(A=>A.conversations.length>0),Ce=()=>{var A;ae({title:"",publicDescription:"",ownerWorkspaceId:((A=e[0])==null?void 0:A.id)??"",participantWorkspaceIds:[]}),N(new Set),$("create")},xe=()=>{!J||J.status!=="active"||(ae({title:J.title,publicDescription:J.publicDescription,ownerWorkspaceId:J.ownerWorkspaceId,participantWorkspaceIds:J.members.filter(A=>A.role==="participant"&&A.status==="active").map(A=>A.workspaceId)}),N(new Set),$("edit"))},ce=async(A,z=c)=>{var C;S(!0),E(null);try{const W=await rb();u(W);const he=W.filter(Se=>z==="archived"?Se.status==="archived":Se.status!=="archived"),ge=(A&&he.some(Se=>Se.id===A)?A:null)??(p&&he.some(Se=>Se.id===p)?p:((C=he[0])==null?void 0:C.id)??null);g(ge),b(ge?await Pc(ge):[])}catch(W){E(W instanceof ea?W.detail:W instanceof Error?W.message:String(W))}finally{S(!1)}};D.useEffect(()=>{ce()},[]),D.useEffect(()=>{const A=window.setInterval(()=>{(async()=>{try{const z=await rb();u(z),p&&z.some(C=>C.id===p)&&b(await Pc(p))}catch{}})()},1e4);return()=>window.clearInterval(A)},[p]);const V=async A=>{g(A),E(null);try{b(await Pc(A))}catch(z){E(z instanceof ea?z.detail:z instanceof Error?z.message:String(z))}},se=async A=>{var C;if(A===c)return;d(A),E(null);const z=((C=r.find(W=>A==="archived"?W.status==="archived":W.status!=="archived"))==null?void 0:C.id)??null;if(g(z),!z){b([]);return}try{b(await Pc(z))}catch(W){E(W instanceof ea?W.detail:W instanceof Error?W.message:String(W))}},we=async A=>{var z;if(A.preventDefault(),!(!K.title.trim()||!K.ownerWorkspaceId)){F(!0),E(null);try{const C=R==="edit"&&J?await L2(J.id,{expectedVersion:J.version,title:K.title.trim(),publicDescription:K.publicDescription.trim(),participantWorkspaceIds:K.participantWorkspaceIds}):await z2({...K,title:K.title.trim(),publicDescription:K.publicDescription.trim()});d("active"),$(null),ae({title:"",publicDescription:"",ownerWorkspaceId:((z=e[0])==null?void 0:z.id)??"",participantWorkspaceIds:[]}),await ce(C.id,"active")}catch(C){E(C instanceof ea?C.detail:C instanceof Error?C.message:String(C))}finally{F(!1)}}},Me=async()=>{if(!(!J||J.status!=="active")){F(!0),E(null);try{const A=await I2(J.id,J.version);H(!1),d("active"),await ce(void 0,"active")}catch(A){E(A instanceof ea?A.detail:A instanceof Error?A.message:String(A))}finally{F(!1)}}};return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:i,role:"presentation",children:s.jsxs("section",{"aria-label":"工作空间协作",className:"context-panel collaboration-panel",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header collaboration-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"协作"}),s.jsx("p",{children:"在明确选择的工作空间之间建立持久、定向的 Topic 通信。"})]}),s.jsxs("div",{className:"collaboration-header-actions",children:[s.jsx("button",{"aria-label":"新建 Topic",className:"memory-icon-button collaboration-new-topic",onClick:Ce,title:"新建 Topic",type:"button",children:"+"}),s.jsx("button",{"aria-label":"关闭协作",className:"icon-button",onClick:i,type:"button",children:"×"})]})]}),w?s.jsx("div",{className:"collaboration-error",children:w}):null,s.jsxs("div",{className:"collaboration-body",children:[s.jsxs("nav",{className:"collaboration-topic-list","aria-label":"协作 Topics",children:[s.jsxs("div",{className:"collaboration-topic-tabs",role:"tablist","aria-label":"Topic 列表范围",children:[s.jsx("button",{"aria-selected":c==="active",className:c==="active"?"active":void 0,onClick:()=>void se("active"),role:"tab",type:"button",children:"当前"}),s.jsx("button",{"aria-selected":c==="archived",className:c==="archived"?"active":void 0,onClick:()=>void se("archived"),role:"tab",type:"button",children:"已归档"})]}),x?s.jsx("p",{children:"正在加载..."}):te.length===0?s.jsx("p",{children:c==="archived"?"还没有已归档 Topic。":"还没有当前 Topic。"}):te.map(A=>s.jsxs("button",{className:`collaboration-topic-entry${A.id===p?" active":""}`,onClick:()=>void V(A.id),type:"button",children:[s.jsx("span",{children:A.title}),s.jsxs("small",{children:[A.members.length," 个工作空间 · ",A.status]})]},A.id))]}),s.jsx("main",{className:"collaboration-topic-detail",children:J?s.jsxs(s.Fragment,{children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:J.title}),s.jsx("p",{children:J.publicDescription||"没有公开描述。"})]}),s.jsxs("div",{className:"collaboration-topic-actions",children:[s.jsx("span",{children:J.status}),J.status==="active"?s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`编辑 Topic ${J.title}`,className:"memory-icon-button",onClick:xe,title:"编辑",type:"button",children:s.jsx(hd,{})}),s.jsx("button",{"aria-label":`归档 Topic ${J.title}`,className:"memory-icon-button",onClick:()=>H(!0),title:"归档",type:"button",children:s.jsx(A2,{})})]}):null]})]}),s.jsx("div",{className:"collaboration-members",children:J.members.filter(A=>A.status==="active").map(A=>s.jsxs("span",{children:[A.workspaceTitleSnapshot,s.jsx("small",{children:A.role})]},`${A.workspaceId}-${A.membershipVersion}`))}),s.jsx("div",{className:"collaboration-message-list",children:m.length===0?s.jsx("p",{children:"还没有消息。"}):m.map(A=>s.jsxs("article",{children:[s.jsxs("header",{children:[s.jsx("strong",{children:A.senderTitleSnapshot}),s.jsx("span",{children:A.recipientWorkspaceIds.includes("ALL")?"发给全部参与者":`发给 ${fw(A.recipientWorkspaceIds.map(z=>I.get(z)??Ml(z)))}`}),s.jsx("time",{children:$e(A.createdAt)})]}),s.jsx("div",{className:"markdown-body",children:Rl(A.contentMarkdown,void 0)})]},A.id))})]}):s.jsx("div",{className:"collaboration-empty",children:"选择或新建一个 Topic。"})})]}),R?s.jsx("div",{className:"collaboration-create-overlay",role:"presentation",onClick:()=>!q&&$(null),children:s.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:A=>A.stopPropagation(),onSubmit:we,children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:R==="edit"?"编辑 Topic":"新建 Topic"}),s.jsx("p",{children:R==="edit"?"调整公开信息与参与工作空间。":"明确选择本次通信的 owner 与参与者。"})]}),s.jsx("button",{"aria-label":"关闭 Topic 编辑",className:"icon-button",onClick:()=>$(null),type:"button",children:"×"})]}),s.jsxs("label",{children:["标题",s.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:K.title,onChange:A=>ae(z=>({...z,title:A.target.value}))})]}),s.jsxs("label",{children:["公开描述",s.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:K.publicDescription,onChange:A=>ae(z=>({...z,publicDescription:A.target.value}))})]}),s.jsxs("label",{children:["Owner 工作空间",s.jsx("select",{disabled:R==="edit",value:K.ownerWorkspaceId,onChange:A=>ae(z=>({...z,ownerWorkspaceId:A.target.value,participantWorkspaceIds:z.participantWorkspaceIds.filter(C=>C!==A.target.value)})),children:a.map(A=>s.jsx("optgroup",{label:A.title,children:A.conversations.map(z=>s.jsx("option",{value:z.id,children:z.title},z.id))},A.id))})]}),s.jsxs("fieldset",{className:"collaboration-participant-groups",children:[s.jsx("legend",{children:"参与工作空间"}),s.jsxs("div",{className:"collaboration-participant-toolbar",children:[s.jsxs("span",{children:[K.participantWorkspaceIds.length," 个已选择"]}),s.jsxs("div",{children:[s.jsx("button",{onClick:()=>N(new Set),type:"button",children:"全部展开"}),s.jsx("button",{onClick:()=>N(new Set(ue.map(A=>A.id))),type:"button",children:"全部收起"})]})]}),ue.map(A=>{const z=A.conversations,C=z.filter(he=>K.participantWorkspaceIds.includes(he.id)).length,W=ie.has(A.id);return s.jsxs("section",{className:"collaboration-participant-group",children:[s.jsxs("header",{children:[s.jsxs("button",{"aria-expanded":!W,className:"collaboration-group-toggle",onClick:()=>N(he=>{const ge=new Set(he);return ge.has(A.id)?ge.delete(A.id):ge.add(A.id),ge}),type:"button",children:[s.jsx("span",{"aria-hidden":"true",className:W?void 0:"expanded",children:"›"}),s.jsx("strong",{children:A.title}),s.jsxs("small",{children:[C,"/",z.length]})]}),s.jsxs("label",{title:`选择 ${A.title} 全部工作空间`,children:[s.jsx("input",{checked:C===z.length,onChange:()=>ae(he=>{const ge=z.map(oe=>oe.id),Se=new Set(he.participantWorkspaceIds);return ge.every(oe=>Se.has(oe))?ge.forEach(oe=>Se.delete(oe)):ge.forEach(oe=>Se.add(oe)),{...he,participantWorkspaceIds:Array.from(Se)}}),type:"checkbox"}),s.jsx("span",{children:"全选"})]})]}),W?null:s.jsx("div",{children:z.map(he=>s.jsxs("label",{className:"collaboration-participant-option",children:[s.jsx("input",{checked:K.participantWorkspaceIds.includes(he.id),onChange:ge=>ae(Se=>({...Se,participantWorkspaceIds:ge.target.checked?[...Se.participantWorkspaceIds,he.id]:Se.participantWorkspaceIds.filter(oe=>oe!==he.id)})),type:"checkbox"}),s.jsx("span",{children:he.title})]},he.id))})]},A.id)})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:q,onClick:()=>$(null),type:"button",children:"取消"}),s.jsx("button",{disabled:q||!K.title.trim()||!K.ownerWorkspaceId,type:"submit",children:q?"正在保存...":R==="edit"?"保存":"创建 Topic"})]})]})}):null,M&&J?s.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!q&&H(!1),role:"presentation",children:s.jsxs("section",{"aria-label":"归档 Topic",className:"dialog-card collaboration-archive-dialog",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"归档 Topic"}),s.jsx("p",{children:"归档后保留历史消息,但工作空间不能再向此 Topic 发送新消息。"})]}),s.jsx("button",{"aria-label":"关闭归档确认",className:"icon-button",onClick:()=>H(!1),type:"button",children:"×"})]}),s.jsx("strong",{children:J.title}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:q,onClick:()=>H(!1),type:"button",children:"取消"}),s.jsx("button",{className:"danger",disabled:q,onClick:()=>void Me(),type:"button",children:q?"正在归档...":"归档"})]})]})}):null]})})}function qA({busy:e,conversation:i,conversationId:a,forceStopBusy:r,preview:u,previewLoading:c,result:d,status:p,warmup:g,workspaceGroups:m,onCancelResetPreview:b,onClose:x,onForceStop:S,onPreviewReset:w,onStartBlankContext:E,onResetRuntime:R,onSaveResetSelection:$,onWorkspaceChange:M,onWarmupChange:H}){const q=!i||e||p==="running"||p==="initializing";return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:x,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele console",className:"context-panel console-panel",onClick:F=>F.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header console-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Console"}),s.jsx("p",{children:"Control actions for the selected workspace runtime."})]}),s.jsxs("div",{className:"console-header-actions",children:[s.jsxs("label",{className:"console-workspace-picker",children:[s.jsx("span",{children:"Workspace"}),s.jsx("select",{disabled:e,onChange:F=>M(F.target.value),value:a??"",children:m.map(F=>s.jsx("optgroup",{label:F.title,children:F.conversations.map(ie=>s.jsxs("option",{value:ie.id,children:[ie.title," · workspaces/",Es(ie.id)]},ie.id))},F.id))})]}),s.jsx("button",{"aria-label":"Close console",onClick:x,type:"button",children:"×"})]})]}),s.jsx("div",{className:"console-body",children:s.jsxs("section",{className:"console-card",children:[s.jsxs("div",{className:"console-card-heading",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Runtime"}),s.jsx("p",{children:"Reset only replaces the Codex runtime thread. Seele workspace history, metadata, and files remain intact."})]}),s.jsx("span",{className:`console-status ${p}`,children:p})]}),s.jsxs("dl",{className:"console-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsx("dd",{children:(i==null?void 0:i.title)??"No workspace selected"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"ID"}),s.jsx("dd",{children:i?`workspaces/${Es(i.id)}`:"-"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Thread"}),s.jsx("dd",{children:(i==null?void 0:i.codexThreadId)??"Not created"})]})]}),s.jsxs("label",{className:"console-toggle",children:[s.jsx("input",{checked:g,onChange:F=>H(F.target.checked),type:"checkbox"}),s.jsxs("span",{children:["Run a warmup turn after reset",s.jsx("small",{children:"The workspace will receive a system wakeup to re-orient itself after the thread is rebuilt."})]})]}),s.jsxs("div",{className:"console-actions",children:[s.jsx("button",{className:"danger",disabled:!i||r,onClick:S,title:"Kill the workspace runtime and repair every non-terminal scheduler state",type:"button",children:r?"Stopping & repairing...":"Force stop & repair"}),s.jsx("button",{className:"danger",disabled:q||c,onClick:w,type:"button",children:c?"Preparing preview...":"Preview runtime reset"}),s.jsx("button",{disabled:q||c,onClick:E,type:"button",children:"Clear memory & start blank"}),p==="running"||p==="initializing"?s.jsx("span",{children:"Force stop the active workspace operation before resetting."}):null]}),d?s.jsxs("div",{className:"console-result",children:[s.jsx("strong",{children:d.workspaceMemoryCleared?"Blank workspace context ready":"Runtime reset completed"}),s.jsxs("span",{children:[d.injectedItemCount," visible history items injected"]}),d.historyCompactionCount>0?s.jsxs("span",{children:["Full history processed in ",d.historyBatchCount," chronological batches with ",d.historyCompactionCount," native compactions"]}):null,d.workspaceMemoryCleared?s.jsx("span",{children:"Workspace Memory cleared; Base Memory retained"}):null,s.jsxs("span",{children:["New thread: ",d.newThreadId]}),d.warmupTurnId?s.jsxs("span",{children:["Warmup turn: ",d.warmupTurnId]}):null]}):null]})}),u?s.jsx(HA,{busy:e,preview:u,warmup:g,onCancel:b,onConfirm:R,onSaveSelection:$}):null]})})}function HA({busy:e,preview:i,warmup:a,onCancel:r,onConfirm:u,onSaveSelection:c}){const[d,p]=D.useState(()=>new Set(i.entries.filter(I=>I.includedByDefault).map(I=>I.id))),[g,m]=D.useState(!1),[b,x]=D.useState(!1),[S,w]=D.useState(null),E=D.useRef(null),R=i.entries.filter(I=>d.has(I.id)),$=R.filter(I=>I.role==="user").length,M=R.length-$,H=i.entries.filter(I=>I.topicRelation!==null).map(I=>I.id),q=H.filter(I=>d.has(I)).length,F=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 ie=e||b;async function N(I){x(!0),w(null);try{await c(i.entries.filter(te=>I.has(te.id)).map(te=>te.id)),p(I)}catch(te){w(Ve(te).message)}finally{x(!1)}}function K(I,te){const ue=new Set(d);te?ue.add(I):ue.delete(I),N(ue)}function ae(){const I=new Set(d);H.forEach(te=>I.add(te)),N(I)}function J(){const I=new Set(d);H.forEach(te=>{I.has(te)?I.delete(te):I.add(te)}),N(I)}return s.jsx("div",{className:`reset-preview-overlay ${g?"expanded":""}`,onClick:ie?void 0:r,role:"presentation",children:s.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${g?"expanded":""}`,onClick:I=>I.stopPropagation(),role:"dialog",children:[s.jsxs("header",{className:"reset-preview-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Confirm runtime reset"}),s.jsx("p",{children:"The new thread will process the selected original messages in chronological batches. Each batch is compacted natively before the next batch is injected; the old thread context is never reused."})]}),s.jsxs("div",{className:"reset-preview-header-actions",children:[s.jsx("button",{"aria-label":g?"Restore reset preview size":"Expand reset preview",onClick:()=>m(I=>!I),title:g?"Restore size":"Expand",type:"button",children:g?"⊡":"⛶"}),s.jsx("button",{"aria-label":"Close reset preview",disabled:ie,onClick:r,type:"button",children:"×"})]})]}),s.jsxs("div",{className:"reset-preview-summary",children:[s.jsxs("label",{className:"reset-preview-select-all",children:[s.jsx("input",{checked:F,disabled:ie||i.entries.length===0,onChange:I=>void N(I.target.checked?new Set(i.entries.map(te=>te.id)):new Set),ref:E,type:"checkbox"}),s.jsxs("span",{children:[d.size," of ",i.entries.length," selected"]})]}),s.jsxs("span",{children:[$," user"]}),s.jsxs("span",{children:[M," assistant"]}),H.length>0?s.jsxs("div",{className:"reset-preview-topic-actions",children:[s.jsxs("span",{children:[q," of ",H.length," Topic input + response"]}),s.jsx("button",{disabled:ie||q===H.length,onClick:ae,type:"button",children:"Select Topic turns"}),s.jsx("button",{disabled:ie,onClick:J,type:"button",children:"Invert Topic turns"})]}):null,s.jsxs("span",{children:[i.historyBatchCount," planned batch",i.historyBatchCount===1?"":"es"]}),s.jsxs("span",{children:["~",i.estimatedTokenCount.toLocaleString()," source tokens"]}),s.jsx("span",{children:a?"Warmup enabled":"No warmup"}),b?s.jsx("span",{children:"Saving defaults..."}):null,S?s.jsx("span",{className:"reset-preview-selection-error",children:S}):null]}),s.jsx("div",{className:"reset-preview-list",children:i.entries.length>0?i.entries.map((I,te)=>s.jsxs("article",{className:`reset-preview-item ${I.role} ${d.has(I.id)?"":"excluded"}`,children:[s.jsxs("header",{children:[s.jsxs("label",{children:[s.jsx("input",{"aria-label":`Include ${I.role} message ${te+1}`,checked:d.has(I.id),disabled:ie,onChange:ue=>K(I.id,ue.target.checked),type:"checkbox"}),s.jsx("span",{children:te+1})]}),s.jsx("strong",{children:I.role}),I.topicRelation?s.jsxs("span",{className:"reset-preview-topic-badge",children:["Topic ",I.topicRelation]}):null,s.jsx("time",{dateTime:I.createdAt,children:$e(I.createdAt)})]}),s.jsx("pre",{children:I.content})]},I.id)):s.jsx("p",{className:"reset-preview-empty",children:"No visible history will be injected."})}),s.jsxs("footer",{className:"reset-preview-actions",children:[s.jsxs("small",{children:["Preview fingerprint: ",i.fingerprint.slice(0,12)]}),s.jsxs("div",{children:[s.jsx("button",{disabled:ie,onClick:r,type:"button",children:"Cancel"}),s.jsx("button",{className:"danger",disabled:ie,onClick:()=>u(i.entries.filter(I=>d.has(I.id)).map(I=>I.id)),type:"button",children:e?"Rebuilding and compacting...":"Confirm full-history reset"})]})]})]})})}function $A({currentReleasedAt:e,currentVersion:i,job:a,latest:r,latestChecking:u,starting:c,onClose:d,onRefresh:p,onStart:g}){const m=(a==null?void 0:a.currentVersion)??i,b=r!=null&&r.version&&dR(r.version,m)?cR(r.version):null;return D.useEffect(()=>{const x=S=>{S.key==="Escape"&&d()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[d]),s.jsx("div",{className:"codex-update-overlay",onClick:d,role:"presentation",children:s.jsxs("section",{"aria-label":"Codex CLI update",className:"codex-update-panel",onClick:x=>x.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex CLI update"}),s.jsx("p",{children:"Managed by Seele in the instance runtime directory."})]}),s.jsx("button",{"aria-label":"Close Codex CLI update",onClick:d,type:"button",children:"×"})]}),s.jsxs("dl",{className:"codex-update-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Status"}),s.jsx("dd",{className:a?`status-${a.status}`:void 0,children:(a==null?void 0:a.status)??"Not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsx("dd",{children:rh(m,(a==null?void 0:a.codexReleasedAt)??e)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Latest"}),s.jsxs("dd",{title:(r==null?void 0:r.error)??void 0,children:[u?"Checking...":r!=null&&r.version?rh(r.version,r.releasedAt):r!=null&&r.error?"Check failed":"Not checked",b?s.jsx("a",{className:"codex-release-notes-link",href:b,rel:"noreferrer",target:"_blank",children:"Release notes"}):null]})]}),a?s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:$e(a.startedAt)})]}):null]}),r!=null&&r.error?s.jsxs("p",{className:"codex-latest-error",children:["Latest version check: ",r.error]}):null,s.jsx("div",{className:"codex-update-log",role:"log","aria-live":"polite",children:a!=null&&a.logs.length?a.logs.map((x,S)=>s.jsxs("div",{className:`log-${x.stream}`,children:[s.jsx("time",{children:uR(x.at)}),s.jsx("span",{children:x.text})]},`${x.at}-${S}`)):s.jsx("p",{children:"No update logs yet."})}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",onClick:p,type:"button",children:"Refresh"}),s.jsx("button",{disabled:c||(a==null?void 0:a.status)==="running",onClick:g,type:"button",children:c?"Starting...":(a==null?void 0:a.status)==="running"?"Updating...":a?"Run again":"Start update"})]})]})})}function GA({currentUser:e,conversations:i,deploymentSettings:a,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,workspaceEnvironment:d,memorySettings:p,memorySettingsDraft:g,managedUsers:m,workspaceMemoryDraft:b,runtimeSettings:x,runtimeModels:S,runtimeCodexVersion:w,runtimeCodexReleasedAt:E,runtimeCodexUpdating:R,runtimeSettingsDraft:$,runtimeSettingsScope:M,settingsWorkspace:H,settingsWorkspaceId:q,systemDiagnostics:F,systemDiagnosticsLoading:ie,workspaceGroups:N,workspaceRuntimeSettings:K,workspaceRuntimeSettingsDraft:ae,onCancelEnvironmentEdit:J,onClose:I,onCreateUser:te,onDeleteUser:ue,onDeleteEnvironment:Ce,onDraftChange:xe,onEditEnvironment:ce,onSaveBaseMemoryItems:V,onSaveDeploymentSettings:se,onSaveResponsibility:we,onSaveWorkspaceMemoryItems:Me,onRevealEnvironmentValue:O,onRuntimeDraftChange:A,onCodexAccountSwitched:z,onUpdateCodexCli:C,onRuntimeScopeChange:W,onSettingsWorkspaceChange:he,onSubmitRuntimeSettings:ge,onSubmitEnvironment:Se,onRefreshSystemDiagnostics:oe,onUpdateUser:Oe,onWorkspaceRuntimeDraftChange:vt,onWorkspaceRuntimeReset:St,revealedEnvironmentKeys:vn}){const[Ke,mt]=D.useState("model"),[nn,wn]=D.useState(!1),[Ie,It]=D.useState(null),[jt,$t]=D.useState(!1),[Mi,xi]=D.useState((H==null?void 0:H.responsibility)??""),[zl,Ct]=D.useState(!1),ia=D.useRef(null),ne=M==="workspace"?Object.values((K==null?void 0:K.sources)??{}).filter(de=>de==="workspace").length:0;return D.useEffect(()=>{M==="global"&&$t(!1)},[M]),D.useEffect(()=>{xi((H==null?void 0:H.responsibility)??"")},[H==null?void 0:H.id,H==null?void 0:H.responsibility]),D.useEffect(()=>{if(!jt)return;const de=qe=>{var Gt;const Xe=qe.target;Xe instanceof Node&&((Gt=ia.current)!=null&&Gt.contains(Xe))||$t(!1)},Ne=qe=>{qe.key==="Escape"&&$t(!1)};return document.addEventListener("pointerdown",de,!0),document.addEventListener("keydown",Ne,!0),()=>{document.removeEventListener("pointerdown",de,!0),document.removeEventListener("keydown",Ne,!0)}},[jt]),s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:I,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:de=>de.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header settings-panel-header",children:[s.jsxs("div",{className:"settings-panel-title",children:[s.jsx("h2",{children:"Settings"}),Ke!=="system"&&Ke!=="users"&&Ke!=="accounts"&&Ke!=="deployment"?s.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[e.role==="admin"?s.jsx("button",{"aria-checked":M==="global",className:M==="global"?"active":void 0,onClick:()=>W("global"),role:"radio",type:"button",children:"Global"}):null,s.jsxs("div",{className:"settings-workspace-picker",ref:ia,children:[s.jsx("button",{"aria-checked":M==="workspace","aria-expanded":M==="workspace"?jt:void 0,"aria-label":M==="workspace"?"Settings workspace target":void 0,className:M==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:i.length===0,onClick:()=>{if(M!=="workspace"){W("workspace");return}$t(de=>!de)},role:"radio",type:"button",children:M==="workspace"?s.jsxs(s.Fragment,{children:[s.jsxs("span",{children:["Workspace: ",(H==null?void 0:H.title)??"Select workspace"]}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),M==="workspace"&&jt?s.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:N.map(de=>s.jsxs("div",{className:"settings-workspace-menu-group",children:[s.jsx("div",{className:"settings-workspace-menu-heading",children:de.title}),de.conversations.map(Ne=>s.jsxs("button",{"aria-selected":Ne.id===q,className:Ne.id===q?"selected":void 0,onClick:()=>{he(Ne.id),$t(!1)},role:"option",type:"button",children:[s.jsx("span",{children:Ne.title}),s.jsxs("small",{children:["workspaces/",Ne.id]})]},Ne.id))]},de.id))}):null]})]}):null]}),s.jsx("div",{className:"settings-header-actions",children:s.jsx("button",{"aria-label":"Close settings panel",onClick:I,type:"button",children:"×"})})]}),s.jsxs("div",{className:"settings-body",children:[s.jsxs("nav",{className:"settings-nav","aria-label":"Settings sections",children:[s.jsxs("button",{className:Ke==="model"?"active":void 0,onClick:()=>mt("model"),type:"button",children:[s.jsx("span",{children:"Runtime"}),s.jsx("small",{children:"Effective settings"})]}),s.jsxs("button",{className:Ke==="responsibility"?"active":void 0,onClick:()=>mt("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Workspace role"})]}),s.jsxs("button",{className:Ke==="memory"?"active":void 0,onClick:()=>mt("memory"),type:"button",children:[s.jsx("span",{children:"Memory"}),s.jsx("small",{children:"Base + workspace context"})]}),s.jsxs("button",{className:Ke==="environment"?"active":void 0,onClick:()=>mt("environment"),type:"button",children:[s.jsx("span",{children:"Environment"}),s.jsx("small",{children:"Base + workspace variables"})]}),e.role==="admin"?s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:Ke==="accounts"?"active":void 0,onClick:()=>mt("accounts"),type:"button",children:[s.jsx("span",{children:"Codex Accounts"}),s.jsx("small",{children:"Cloud login + active account"})]}),s.jsxs("button",{className:Ke==="deployment"?"active":void 0,onClick:()=>mt("deployment"),type:"button",children:[s.jsx("span",{children:"Deployment"}),s.jsx("small",{children:"Local integrations"})]}),s.jsxs("button",{onClick:()=>{window.location.assign(`${Dh()}admin/host`)},type:"button",children:[s.jsx("span",{children:"Work Operations"}),s.jsx("small",{children:"Versions, restart, logs"})]}),s.jsxs("button",{className:Ke==="system"?"active":void 0,onClick:()=>mt("system"),type:"button",children:[s.jsx("span",{children:"System"}),s.jsx("small",{children:"Runtime + resources"})]}),s.jsxs("button",{className:Ke==="users"?"active":void 0,onClick:()=>mt("users"),type:"button",children:[s.jsx("span",{children:"Users"}),s.jsx("small",{children:"Access + roles"})]})]}):null]}),s.jsxs("section",{className:"settings-content",children:[Ke!=="system"&&Ke!=="users"&&Ke!=="accounts"&&Ke!=="deployment"?s.jsxs("div",{className:`settings-scope-banner ${M==="workspace"?"workspace":"global"}`,children:[s.jsx("strong",{children:M==="workspace"?"Editing workspace custom settings":"Editing global settings"}),s.jsx("span",{children:M==="workspace"?`${(H==null?void 0:H.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}):null,Ke==="system"?s.jsx(VA,{conversations:i,diagnostics:F,loading:ie,onRefresh:oe}):Ke==="users"?s.jsx(ZA,{currentUser:e,users:m,onCreate:te,onDelete:ue,onUpdate:Oe}):Ke==="accounts"?s.jsx(QA,{onSwitched:z}):Ke==="deployment"?s.jsx(JA,{settings:a,onSave:se}):Ke==="model"?s.jsx(eN,{draft:M==="workspace"?ae:$,globalSettings:x,models:S,codexVersion:w,codexReleasedAt:E,codexUpdating:R,scope:M,workspaceOverrideCount:ne,settings:M==="workspace"?(K==null?void 0:K.effective)??ae:x,workspaceSettings:K,onDraftChange:M==="workspace"?vt:A,onResetWorkspaceSetting:St,onSubmit:ge,onUpdateCodexCli:C}):Ke==="responsibility"?s.jsx(PA,{draft:Mi,saving:zl,scope:M,workspace:H,onDraftChange:xi,onSubmit:de=>{de.preventDefault(),de.stopPropagation(),!(M!=="workspace"||!H)&&(Ct(!0),we(H.id,Mi).then(Ne=>xi(Ne)).finally(()=>Ct(!1)))}}):Ke==="memory"?s.jsx(tN,{baseSettings:p,scope:M,workspaceSettings:b,workspaceName:H==null?void 0:H.title,onSaveBaseItems:V,onSaveWorkspaceItems:Me}):s.jsx(aN,{deleteConfirmKey:Ie,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,scope:M,workspaceEnvironment:d,valueVisible:nn,onCancelEnvironmentEdit:J,onDeleteConfirmChange:It,onDeleteEnvironment:Ce,onDraftChange:xe,onEditEnvironment:ce,onRevealEnvironmentValue:O,onSubmitEnvironment:Se,onValueVisibleChange:wn,revealedEnvironmentKeys:vn})]})]})]})})}function VA({conversations:e,diagnostics:i,loading:a,onRefresh:r}){const u=(i==null?void 0:i.runtime.pool)??null,c=D.useMemo(()=>(i==null?void 0:i.systemLogs)??[],[i]),[d,p]=D.useState(!1),g=D.useMemo(()=>new Map(e.map(w=>[w.id,w.title])),[e]),m=D.useMemo(()=>i?JSON.stringify({generatedAt:i.generatedAt,app:i.app,systemLogs:c},null,2):"",[i,c]),b=async()=>{m&&(await navigator.clipboard.writeText(m),p(!0),window.setTimeout(()=>p(!1),1800))},x=()=>{if(!m||!i)return;const w=URL.createObjectURL(new Blob([m],{type:"application/json"})),E=document.createElement("a");E.href=w,E.download=`seele-system-log-${i.generatedAt.replaceAll(":","-").replaceAll(".","-")}.json`,E.click(),URL.revokeObjectURL(w)},S=()=>{if(!i||!c.length)return;const w=c[0],E=c.slice(0,5).map(q=>`- ${fu(q.createdAt)} · ${q.level.toUpperCase()} · ${q.event} · ${q.summary}`).join(`
92
+ `),R=JSON.stringify(w,null,2),$=["## Environment","",`- Seele: ${i.app.version}`,`- Runtime: ${i.app.runtime}`,`- Report generated: ${fu(i.generatedAt)}`,"","## Latest incident","","```json",R.slice(0,2500),"```","","## Recent system log","",E,"","_Generated by Seele System Log. Attach the downloaded JSON report when more history is needed._"].join(`
93
+ `),M=`[System Log] ${w.summary}`.slice(0,180),H=new URL("https://github.com/seele-labs/seele-work/issues/new");H.searchParams.set("title",M),H.searchParams.set("body",$),window.open(H.toString(),"_blank","noopener,noreferrer")};return s.jsxs("section",{className:"system-information-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"System"}),s.jsx("p",{children:"Read-only runtime and resource information managed by Seele."})]}),s.jsx("button",{className:"system-information-refresh",disabled:a,onClick:r,type:"button",children:a?"Refreshing...":"Refresh"})]}),u?s.jsxs(s.Fragment,{children:[s.jsxs("dl",{className:"system-information-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"LRU pool target"}),s.jsxs("dd",{children:[Un(u.maxRetainedRuntimes)," runtimes"]}),s.jsx("small",{children:u.capacitySource==="system_memory"?"Idle runtimes are released by least recent use":"Fallback target because system memory was unavailable"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Retention policy"}),s.jsxs("dd",{children:["LRU · ",Lp(u.maxIdleSeconds*1e3)," max idle"]}),s.jsx("small",{children:"Only idle runtimes are eligible for eviction"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current pool"}),s.jsxs("dd",{children:[u.activeRuntimeCount," active · ",u.idleRuntimeCount," idle"]}),s.jsxs("small",{children:[u.retainedRuntimeCount," retained runtimes"]})]})]}),s.jsxs("section",{className:"system-runtime-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"Workspace runtimes"}),s.jsx("p",{children:"Active workspaces and idle runtimes currently retained for reuse."})]}),s.jsx("time",{dateTime:i==null?void 0:i.generatedAt,children:i?$e(i.generatedAt):""})]}),u.workspaces.length>0?s.jsxs("div",{className:"system-runtime-table",children:[s.jsxs("div",{className:"system-runtime-table-header",children:[s.jsx("span",{children:"Workspace"}),s.jsx("span",{children:"Status"}),s.jsx("span",{children:"Runtime"}),s.jsx("span",{children:"Age"})]}),u.workspaces.map(w=>s.jsxs("div",{className:"system-runtime-row",children:[s.jsxs("div",{children:[s.jsx("strong",{children:g.get(w.workspaceId)??w.workspaceId}),s.jsx("small",{children:w.workspaceId})]}),s.jsx("span",{className:`system-runtime-state ${w.turnId?"active":"idle"}`,children:w.lifecycle==="shutting_down"?"Shutting down":w.turnId?"Active":"Idle"}),s.jsxs("div",{children:[s.jsx("span",{children:w.turnId?w.state:"Retained"}),s.jsx("small",{children:w.pid===null?"PID unavailable":`PID ${w.pid}`})]}),s.jsx("span",{children:w.idleMs===null?Lp(w.uptimeMs):`${Lp(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(Lh,{})}),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(FA,{})}),s.jsx("button",{"aria-label":"Report system log issue",className:"icon-button",disabled:!c.length,onClick:S,title:"Report issue to seele-labs/seele-work",type:"button",children:s.jsx(YA,{})}),d?s.jsx("small",{children:"Copied"}):null]})]}),c.length?s.jsx("div",{className:"system-log-entries",children:c.map(w=>s.jsxs("details",{className:`system-log-entry ${w.level}`,children:[s.jsxs("summary",{children:[s.jsx("span",{className:"system-log-level",children:w.level}),s.jsxs("span",{children:[s.jsx("strong",{children:w.summary}),s.jsxs("small",{children:[w.component," · ",fu(w.createdAt)]})]})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Event"}),s.jsx("dd",{children:w.event})]}),w.workspaceId?s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsxs("dd",{children:[g.get(w.workspaceId)??w.workspaceId," · ",w.workspaceId]})]}):null,w.turnId?s.jsxs("div",{children:[s.jsx("dt",{children:"Turn"}),s.jsx("dd",{children:w.turnId})]}):null,w.runtimeId?s.jsxs("div",{children:[s.jsx("dt",{children:"Runtime"}),s.jsx("dd",{children:w.runtimeId})]}):null]}),s.jsx("pre",{children:JSON.stringify(w.detail,null,2)})]},w.id))}):s.jsx("div",{className:"system-runtime-empty",children:"No warnings or errors have been recorded."})]})]}):s.jsx("div",{className:"system-runtime-empty",children:a?"Loading system information...":"System information is unavailable."})]})}function FA(){return s.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:s.jsx("path",{d:"M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"})})}function YA(){return s.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"M12 7v6m0 4h.01"})]})}function PA({draft:e,saving:i,scope:a,workspace:r,onDraftChange:u,onSubmit:c}){const d=a==="workspace";return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Responsibility"}),s.jsx("p",{children:"Workspace-specific long-lived role. This is content context, so it is only editable in workspace scope."})]})}),d&&r?s.jsxs("form",{className:"settings-responsibility-form",onSubmit:c,children:[s.jsxs("label",{children:[s.jsx("span",{children:r.title}),s.jsx("textarea",{"aria-label":"Workspace responsibility",onChange:p=>u(p.target.value),placeholder:"Describe this workspace's durable role, scope, and long-term responsibilities.",rows:14,value:e})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:i,type:"submit",children:i?"Saving...":"Save responsibility"})})]}):s.jsx("section",{className:"settings-readonly-block",children:s.jsxs("div",{children:[s.jsx("strong",{children:"Workspace-only setting"}),s.jsx("span",{children:"Switch the header scope to Workspace and choose a workspace to edit its responsibility."})]})})]})}function WA({usage:e}){return s.jsx("div",{"aria-label":"Codex account usage",className:"codex-account-usage",children:[...e.windows].sort((i,a)=>i.windowDurationMins-a.windowDurationMins).map(i=>{const a=md(i.usedPercent),r=Kv(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:Ew(a)})]}),s.jsx("span",{"aria-hidden":"true",className:"codex-account-usage-track",children:s.jsx("span",{style:{width:`${a}%`}})}),s.jsxs("small",{children:["Resets ",Aw(i.resetsAt)]})]},`${i.windowDurationMins}:${i.resetsAt}`)})})}function KA(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 QA({onSwitched:e}){var A;const[i,a]=D.useState(null),[r,u]=D.useState(!0),[c,d]=D.useState(!1),[p,g]=D.useState(!1),[m,b]=D.useState(""),[x,S]=D.useState(!1),[w,E]=D.useState(""),[R,$]=D.useState(null),[M,H]=D.useState(null),[q,F]=D.useState(""),[ie,N]=D.useState(null),[K,ae]=D.useState(null),[J,I]=D.useState(!1);async function te(){var C;const z=await ob();a(z),((C=z.login)==null?void 0:C.status)==="pending"&&($(z.login),S(!0))}async function ue(z){d(!0),b("");try{a(await ub(z))}catch(C){b(Ve(C).message)}finally{d(!1)}}D.useEffect(()=>{let z=!1;return ob().then(C=>{var W;z||(a(C),((W=C.login)==null?void 0:W.status)==="pending"&&($(C.login),S(!0)),C.accounts.length>0&&(d(!0),ub(!1).then(he=>{z||a(he)}).catch(he=>{z||b(Ve(he).message)}).finally(()=>{z||d(!1)})))}).catch(C=>{z||b(Ve(C).message)}).finally(()=>{z||u(!1)}),()=>{z=!0}},[]),D.useEffect(()=>{if(!R||R.status!=="pending")return;let z=!1;const C=window.setInterval(()=>{X2(R.id).then(async W=>{z||($(W),W.status!=="pending"&&(window.clearInterval(C),W.status==="succeeded"&&a(he=>{if(!he||!W.account)return he;const ge=he.accounts.some(Se=>{var oe;return Se.id===((oe=W.account)==null?void 0:oe.id)})?he.accounts.map(Se=>{var oe;return Se.id===((oe=W.account)==null?void 0:oe.id)?W.account:Se}):[...he.accounts,W.account];return{...he,accounts:ge}})))}).catch(W=>{z||b(Ve(W).message)})},1e3);return()=>{z=!0,window.clearInterval(C)}},[R==null?void 0:R.id,R==null?void 0:R.status]);function Ce(){E(""),$(null),b(""),I(!1),S(!0)}async function xe(z){z.preventDefault(),g(!0),b("");try{$(await K2(w.trim()))}catch(C){b(Ve(C).message)}finally{g(!1)}}async function ce(){if(!R||R.status!=="pending"){S(!1);return}g(!0),b("");try{const z=await Q2(R.id);$(z),S(!1)}catch(z){b(Ve(z).message)}finally{g(!1)}}function V(z){H(z),F(z.name),b("")}async function se(z){if(z.preventDefault(),!M)return;const C=q.trim();if(!C||C===M.name){H(null);return}g(!0),b("");try{await Z2(M.id,C),await te(),H(null)}catch(W){b(Ve(W).message)}finally{g(!1)}}async function we(){var z;if(ie){g(!0),b("");try{const C=await eD(ie.id);a(C),N(null),await e()}catch(C){const W=Ve(C);b((z=W.detail)!=null&&z.includes('"runtime_busy"')?"Codex runtime is busy. Stop all active work before switching accounts.":W.detail??W.message)}finally{g(!1)}}}async function Me(){if(K){g(!0),b("");try{await J2(K.id),await te(),ae(null)}catch(z){b(Ve(z).detail??Ve(z).message)}finally{g(!1)}}}const O=(i==null?void 0:i.accounts)??[];return s.jsxs("section",{className:"settings-section codex-accounts-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex Accounts"}),s.jsx("p",{children:"Manage the cloud-owned Codex logins. Every deployment uses the same globally active account; workspaces do not bind to accounts."})]}),s.jsxs("div",{className:"codex-account-toolbar",children:[s.jsx("button",{className:"codex-account-add",disabled:p||c||O.length===0,onClick:()=>void ue(!0),type:"button",children:c?"Refreshing...":"Refresh details"}),s.jsx("button",{className:"codex-account-add",disabled:p||c||(R==null?void 0:R.status)==="pending",onClick:Ce,type:"button",children:"Add account"})]})]}),s.jsxs("div",{className:"codex-account-policy",children:[s.jsx("strong",{children:"Cloud-wide active account"}),s.jsx("span",{children:"Switching requires the cloud runtime to be idle. The cloud publishes the selected credential; members pause new work and apply it after any active turn finishes. There is no per-deployment selection."})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,r?s.jsx("p",{className:"settings-note",children:"Loading Codex accounts..."}):null,!r&&O.length===0?s.jsx("p",{className:"settings-note",children:"No persisted Codex account. Add one with the official device login flow."}):null,s.jsx("div",{className:"codex-account-list",children:O.map(z=>{var Oe,vt;const C=(i==null?void 0:i.activeAccountId)===z.id,W=(Oe=i==null?void 0:i.accountDetails)==null?void 0:Oe[z.id],he=((vt=i==null?void 0:i.accountIssues)==null?void 0:vt[z.id])??[],ge=he.length>0,Se=he.some(St=>["missing_credential","invalid_credential","credential_unreadable"].includes(St.code)),oe=[z.email,KA(z.accountType),XA(z.planType)].filter(St=>!!St);return s.jsxs("article",{className:`codex-account-card${C?" active":""}${ge?" issue":""}`,children:[s.jsxs("div",{className:"codex-account-main",children:[s.jsxs("div",{className:"codex-account-title",children:[s.jsx("strong",{children:z.name}),C?s.jsx("span",{className:"codex-account-active",children:"Active"}):null,ge?s.jsx("span",{className:"codex-account-warning",children:"Needs attention"}):null]}),s.jsx("small",{children:oe.join(" · ")||`Added ${$e(z.createdAt)}`}),ge?s.jsx("div",{className:"codex-account-issues",role:"status",children:he.map(St=>s.jsx("span",{children:St.message},St.code))}):null,W!=null&&W.usage?s.jsx(WA,{usage:W.usage}):s.jsx("span",{className:"codex-account-usage-empty",children:c?"Reading account usage...":"Usage unavailable"}),W?s.jsx("small",{className:W.error?"codex-account-detail-error":"codex-account-refreshed",children:W.error?`Refresh issue: ${W.error}`:`Updated ${$e(W.refreshedAt)}`}):null]}),s.jsxs("div",{className:"codex-account-actions",children:[s.jsx("button",{disabled:p||c||Se,onClick:()=>V(z),title:Se?"Sign in again or delete this account to replace its credential.":void 0,type:"button",children:ge?"Repair & rename":"Rename"}),s.jsx("button",{disabled:p||c||C||ge,onClick:()=>{b(""),N(z)},type:"button",children:C?"In use":ge?"Unavailable":"Switch"}),s.jsx("button",{className:"danger",disabled:p||c||C,onClick:()=>{b(""),ae(z)},type:"button",children:"Delete"})]})]},z.id)})}),M?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&H(null),role:"presentation",children:s.jsxs("form",{"aria-label":"Rename Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void se(z),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Rename Codex Account"}),s.jsx("button",{"aria-label":"Close account rename",className:"memory-icon-button",disabled:p,onClick:()=>H(null),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"This name is only a Seele label. It does not change the Codex login or credential."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{"aria-label":"Codex account name",autoFocus:!0,maxLength:80,onChange:z=>F(z.target.value),value:q})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>H(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!q.trim(),type:"submit",children:p?"Saving...":"Save"})]})]})}):null,x?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&!R&&S(!1),role:"presentation",children:R?s.jsxs("section",{"aria-label":"Complete Codex account login",className:"memory-delete-dialog codex-account-login-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:R.status==="succeeded"?"Account Added":"Complete Codex Login"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",disabled:p,onClick:()=>void ce(),type:"button",children:"×"})]}),R.status==="pending"?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Open the official Codex device page and enter this one-time code."}),s.jsxs("div",{className:"codex-device-code",children:[s.jsx("strong",{children:R.userCode}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText(R.userCode),I(!0),window.setTimeout(()=>I(!1),1500)},type:"button",children:J?"Copied":"Copy code"})]}),s.jsx("a",{href:R.verificationUrl,rel:"noreferrer",target:"_blank",children:"Open Codex device login"}),s.jsx("small",{className:"codex-login-waiting",children:"Waiting for Codex to confirm the login..."})]}):R.status==="succeeded"?s.jsxs("p",{children:[s.jsx("strong",{children:((A=R.account)==null?void 0:A.name)??R.accountName})," is persisted on the cloud and ready to synchronize. It was not activated automatically."]}):s.jsx("p",{className:"memory-editor-error",children:R.error??"Codex login was cancelled."}),s.jsx("div",{className:"memory-delete-actions",children:s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>void ce(),type:"button",children:R.status==="pending"?"Cancel login":"Close"})})]}):s.jsxs("form",{"aria-label":"Add Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void xe(z),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Add Codex Account"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",onClick:()=>S(!1),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"Seele creates the login profile on the cloud. Completing login shares it with every deployment but does not make it active."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{autoFocus:!0,maxLength:80,onChange:z=>E(z.target.value),placeholder:"For example: Codex backup",value:w})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>S(!1),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!w.trim(),type:"submit",children:p?"Starting...":"Continue"})]})]})}):null,ie?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&N(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:()=>N(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Switch cloud-wide execution to ",s.jsx("strong",{children:ie.name}),"? The cloud runtime must be idle. Member deployments finish active turns, pause new work, and then install this credential; workspace threads and memory stay unchanged."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>N(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p,onClick:()=>void we(),type:"button",children:p?"Switching...":"Stop and switch"})]})]})}):null,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: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: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 Me(),type:"button",children:p?"Deleting...":"Delete"})]})]})}):null]})}function ZA({currentUser:e,users:i,onCreate:a,onDelete:r,onUpdate:u}){const c={username:"",password:"",role:"user",active:!0},[d,p]=D.useState(null),[g,m]=D.useState(c),[b,x]=D.useState(!1),[S,w]=D.useState(null),[E,R]=D.useState("");function $(){m(c),R(""),p("new")}function M(F){m({username:F.username,password:"",role:F.role,active:F.active}),R(""),p(F)}function H(){b||(p(null),R(""))}async function q(F){if(F.preventDefault(),!!d){x(!0),R("");try{d==="new"?await a({username:g.username.trim(),password:g.password,role:g.role}):await u(d.id,{username:g.username.trim(),password:g.password||void 0,role:g.role,active:g.active}),p(null)}catch(ie){R(Ve(ie).message)}finally{x(!1)}}}return s.jsxs("section",{className:"settings-section user-management-section",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Users"}),s.jsx("p",{children:"Manage sign-in access and Seele roles."})]})}),s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add user",className:"memory-icon-button",onClick:$,title:"Add user",type:"button",children:"+"})}),s.jsxs("div",{className:"user-list",children:[i.map(F=>s.jsxs("div",{className:"user-list-item",children:[s.jsxs("div",{className:"user-list-main",children:[s.jsxs("div",{children:[s.jsx("strong",{children:F.username}),F.id===e.id?s.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),s.jsxs("small",{children:["Created ",$e(F.createdAt)]})]}),s.jsx("span",{className:`user-role-badge role-${F.role}`,children:F.role}),s.jsx("span",{className:`user-status ${F.active?"active":"disabled"}`,children:F.active?"Active":"Disabled"}),s.jsxs("div",{className:"user-row-actions",children:[s.jsx("button",{"aria-label":`Edit user ${F.username}`,className:"memory-icon-button",onClick:()=>M(F),title:"Edit",type:"button",children:s.jsx(hd,{})}),s.jsx("button",{"aria-label":`Delete user ${F.username}`,className:"memory-icon-button memory-item-delete",disabled:F.id===e.id,onClick:()=>{R(""),w(F)},title:"Delete",type:"button",children:"×"})]})]},F.id)),i.length===0?s.jsx("p",{className:"settings-note",children:"No users are configured."}):null]}),d?s.jsx("div",{className:"memory-editor-overlay",onClick:H,role:"presentation",children:s.jsxs("form",{"aria-label":d==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:F=>F.stopPropagation(),onSubmit:F=>void q(F),children:[s.jsxs("header",{children:[s.jsx("strong",{children:d==="new"?"Add User":"Edit User"}),s.jsx("button",{"aria-label":"Close user editor",className:"memory-icon-button",onClick:H,title:"Close",type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:F=>m(ie=>({...ie,username:F.target.value})),placeholder:"Sign-in username",value:g.username})]}),s.jsxs("label",{children:[s.jsx("span",{children:d==="new"?"Initial password":"New password"}),s.jsx("input",{autoComplete:"new-password",minLength:8,onChange:F=>m(ie=>({...ie,password:F.target.value})),placeholder:d==="new"?"At least 8 characters":"Leave blank to keep the current password",type:"password",value:g.password})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Role"}),s.jsxs("select",{disabled:d!=="new"&&d.id===e.id,onChange:F=>m(ie=>({...ie,role:F.target.value==="admin"?"admin":"user"})),value:g.role,children:[s.jsx("option",{value:"user",children:"User"}),s.jsx("option",{value:"admin",children:"Admin"})]})]}),d!=="new"?s.jsxs("label",{className:"user-editor-active",children:[s.jsx("input",{checked:g.active,disabled:d.id===e.id,onChange:F=>m(ie=>({...ie,active:F.target.checked})),type:"checkbox"}),s.jsx("span",{children:"Account active"})]}):null,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,S?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>w(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete user",className:"memory-delete-dialog",onClick:F=>F.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete User"}),s.jsx("button",{"aria-label":"Close delete user confirmation",className:"memory-icon-button",onClick:()=>w(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:S.username}),". Users that own workspaces must be disabled instead."]}),E?s.jsx("p",{className:"memory-editor-error",children:E}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>w(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",onClick:()=>{r(S.id).then(()=>w(null)).catch(F=>R(Ve(F).message))},type:"button",children:"Delete"})]})]})}):null]})}function JA({settings:e,onSave:i}){const[a,r]=D.useState(e),[u,c]=D.useState(!1);return D.useEffect(()=>r(e),[e]),s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Deployment"}),s.jsx("p",{children:"Settings stored only on this Seele instance. Cloud synchronization does not copy or overwrite them."})]})}),s.jsxs("form",{className:"settings-form",onSubmit:d=>{d.preventDefault(),c(!0),i(a).finally(()=>c(!1))},children:[s.jsxs("label",{className:"settings-field settings-field-wide",children:[s.jsxs("span",{children:[s.jsx("strong",{children:"Public URL"}),s.jsx("small",{children:"The externally reachable main URL of this deployment. Seele uses it when publishing callback links to external systems."})]}),s.jsx("input",{"aria-label":"Public URL of this deployment",onChange:d=>r({...a,publicUrl:d.target.value||null}),placeholder:"https://profuse.antgroup-inc.cn/codex/yishao-0/",type:"url",value:a.publicUrl||""})]}),s.jsxs("label",{className:"settings-toggle-field",children:[s.jsxs("span",{children:[s.jsx("strong",{children:"Profuse notification"}),s.jsx("small",{children:"Send DingTalk notifications from this deployment when a turn finishes or fails. Keep this off where the Profuse endpoint is unreachable."})]}),s.jsx("input",{"aria-label":"Enable Profuse notification on this deployment",checked:a.profuseNotificationEnabled,onChange:d=>r({...a,profuseNotificationEnabled:d.target.checked}),type:"checkbox"})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:u,type:"submit",children:u?"Saving...":"Save deployment settings"})})]})]})}function eN({codexReleasedAt:e,codexVersion:i,codexUpdating:a,draft:r,globalSettings:u,models:c,scope:d,settings:p,workspaceOverrideCount:g,workspaceSettings:m,onDraftChange:b,onResetWorkspaceSetting:x,onSubmit:S,onUpdateCodexCli:w}){var F;const E=d==="workspace",R=au(r.model,c),$=au(u.model,c),M=au(p.model,c),H=Ax(r.reasoningEffort,R),q=VE(R,r.reasoningEffort);return D.useEffect(()=>{R&&H!==r.reasoningEffort&&b({...r,reasoningEffort:H})},[r,R,H,b]),s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Runtime"}),s.jsx("p",{children:"Configure global defaults or override them for the selected workspace. Running turns keep the settings they started with."})]}),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:S,children:[s.jsxs("label",{className:Vc(E,Dl(r.model,u.model,m==null?void 0:m.sources.model)),children:[s.jsx(Gc,{globalValue:yb(u.model,c),isWorkspaceScope:E,label:"Model",settingKey:"model",source:Dl(r.model,u.model,m==null?void 0:m.sources.model),onReset:x}),s.jsx(Tp,{"aria-label":"Runtime model",onChange:ie=>{const N=au(ie,c);b({...r,model:ie,reasoningEffort:Ax(r.reasoningEffort,N)})},options:fR(c,r.model),value:r.model||((F=c.find(ie=>ie.isDefault))==null?void 0:F.model)||""})]}),s.jsxs("label",{className:Vc(E,Dl(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort)),children:[s.jsx(Gc,{globalValue:Ex(u.reasoningEffort,$),isWorkspaceScope:E,label:"Reasoning effort",settingKey:"reasoningEffort",source:Dl(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort),onReset:x}),s.jsx(Tp,{"aria-label":"Runtime reasoning effort",onChange:ie=>b({...r,reasoningEffort:ie}),options:q,value:H})]}),s.jsxs("label",{className:Vc(E,Dl(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox)),children:[s.jsx(Gc,{globalValue:vb(u.sandbox),isWorkspaceScope:E,label:"Permission mode",settingKey:"sandbox",source:Dl(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox),onReset:x}),s.jsx(Tp,{"aria-label":"Permission mode",onChange:ie=>b({...r,sandbox:ie}),options:yA,value:r.sandbox})]}),s.jsxs("label",{className:Vc(E,Dl(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(Gc,{globalValue:u.fastMode?"On":"Off",isWorkspaceScope:E,label:"Fast mode",settingKey:"fastMode",source:Dl(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),onReset:x}),s.jsx("small",{children:"1.5x speed with higher Codex credit consumption"})]}),s.jsx("input",{"aria-label":"Enable Fast mode",checked:r.fastMode,onChange:ie=>b({...r,fastMode:ie.target.checked}),type:"checkbox"})]}),s.jsxs("dl",{className:"runtime-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsxs("dd",{children:["Model ",yb(p.model,c),", reasoning"," ",Ex(p.reasoningEffort,M),", Fast mode"," ",p.fastMode?"on":"off",", permission"," ",vb(p.sandbox),"."]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex CLI"}),s.jsxs("dd",{className:"runtime-version-value",children:[s.jsx("span",{children:rh(i,e)}),s.jsx("button",{className:"runtime-update-button",disabled:a,onClick:w,type:"button",children:a?"Updating...":"Check update"})]})]})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{type:"submit",children:E?"Save workspace overrides":"Save global runtime"})})]})]})}function Gc({globalValue:e,isWorkspaceScope:i,label:a,settingKey:r,source:u,onReset:c}){const d=i&&u==="workspace";return s.jsxs("span",{className:"runtime-field-label",children:[s.jsx("span",{children:a}),i?s.jsxs("span",{className:"runtime-field-meta",children:[s.jsx("span",{className:d?"override":"inherited",children:d?"Workspace override":`Inherited: ${e}`}),d?s.jsx("button",{type:"button",onClick:()=>c(r),children:"Reset"}):null]}):null]})}function Tp({"aria-label":e,onChange:i,options:a,value:r}){const[u,c]=D.useState(!1),d=D.useRef(null),p=a.find(g=>g.value===r)??a[0]??null;return D.useEffect(()=>{if(!u)return;function g(b){var x;(x=d.current)!=null&&x.contains(b.target)||c(!1)}function m(b){b.key==="Escape"&&c(!1)}return document.addEventListener("pointerdown",g,!0),document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("pointerdown",g,!0),document.removeEventListener("keydown",m,!0)}},[u]),s.jsxs("div",{className:"runtime-select",ref:d,children:[s.jsxs("button",{"aria-expanded":u,"aria-label":e,className:"runtime-select-trigger",onClick:()=>c(g=>!g),type:"button",children:[s.jsx("span",{children:(p==null?void 0:p.label)??r}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}),u?s.jsx("div",{className:"runtime-select-menu",role:"listbox",children:a.map(g=>s.jsx("button",{"aria-selected":g.value===r,className:g.value===r?"selected":void 0,onClick:()=>{i(g.value),c(!1)},role:"option",type:"button",children:g.label},g.value||"default"))}):null]})}function Dl(e,i,a){return e!==i?"workspace":a}function Vc(e,i,a="settings-wide-field"){return[a,e?"workspace-scoped":"",e&&i==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function tN({baseSettings:e,scope:i,workspaceSettings:a,workspaceName:r,onSaveBaseItems:u,onSaveWorkspaceItems:c}){const d=i==="workspace",p=d?a.items:e.items,g=d?c:u;return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:d?"Workspace Memory":"Base Memory"}),s.jsx("p",{children:d?"Workspace memory applies only to the selected workspace. Use stable English keys; values may be Chinese, plain text, or Markdown.":"Base memory applies to every workspace. Use stable English keys; values may be Chinese, plain text, or Markdown."})]})}),d?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Memory"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(iN,{emptyText:"No base memory is configured.",items:e.items,readonly:!0})]}):null,s.jsx("div",{className:"memory-manager-shell",children:s.jsx(nN,{ariaLabel:d?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:p,onSaveItems:g,title:""})})]})}function nN({ariaLabel:e,emptyText:i,items:a,onSaveItems:r,title:u}){var K;const[c,d]=D.useState(du(a)),[p,g]=D.useState(null),[m,b]=D.useState({key:"",value:""}),[x,S]=D.useState(null),[w,E]=D.useState(null),[R,$]=D.useState(null);D.useEffect(()=>{d(du(a))},[a]),D.useEffect(()=>{if(p===null)return;const ae=J=>{J.key==="Escape"&&(F(),E(null))};return document.addEventListener("keydown",ae),()=>document.removeEventListener("keydown",ae)},[p]);async function M(ae,J){$(J);try{const I=await r(ae);return d(du(I)),I}finally{$(null)}}function H(){E(null),S(null),b({key:"",value:""}),g("new")}function q(ae){const J=c[ae];J&&(E(null),S(null),b({...J}),g(ae))}function F(){g(null),S(null),b({key:"",value:""})}async function ie(ae){const J=c[ae],I=(J==null?void 0:J.key)||`${ae}`;await M(c.filter((te,ue)=>ue!==ae),`delete:${I}`),E(null)}async function N(ae){ae.preventDefault(),ae.stopPropagation();const J=m.key.trim(),I=xD(J);if(I){S(I);return}const te=m.value.trim();if(!te){S("Value is required.");return}const ue=p==="new"?-1:p;if(c.some((xe,ce)=>ce!==ue&&xe.key.trim()===J)){S(`Key "${J}" already exists. Each memory key must be unique.`);return}const Ce={...m,key:J,value:te};p==="new"?await M([...c,Ce],"add"):typeof p=="number"&&await M(c.map((xe,ce)=>ce===p?Ce:xe),`save:${p}`),F()}return s.jsxs("section",{className:"memory-items-manager","aria-label":e,children:[s.jsxs("div",{className:u?"memory-items-editor-header":"memory-items-editor-header actions-only",children:[u?s.jsx("span",{children:u}):null,s.jsx("button",{"aria-label":"Add memory item",className:"memory-icon-button",title:"Add",type:"button",onClick:H,children:"+"})]}),c.length?s.jsx("div",{className:"memory-items-grid",children:c.map((ae,J)=>s.jsxs("div",{className:"memory-item-display",children:[s.jsxs("pre",{"aria-label":`Memory item ${ae.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${ae.key}>`}),`
94
+ `,s.jsx("span",{children:ae.value}),`
95
+ `,s.jsx("span",{className:"memory-tag",children:`</${ae.key}>`})]}),s.jsxs("div",{className:"memory-item-actions",children:[s.jsx("button",{"aria-label":`Edit memory item ${ae.key||J+1}`,className:"memory-icon-button memory-item-edit",disabled:R!==null,title:"Edit",type:"button",onClick:()=>q(J),children:"✎"}),s.jsx("button",{"aria-label":`Delete memory item ${ae.key||J+1}`,className:"memory-icon-button memory-item-delete",disabled:R!==null,title:"Delete",type:"button",onClick:()=>E(J),children:"×"})]})]},`${J}-${ae.key}`))}):s.jsx("p",{className:"settings-note",children:i}),p!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:F,role:"presentation",children:s.jsxs("form",{"aria-label":p==="new"?"Add memory item":"Edit memory item",className:"memory-editor-popover",onClick:ae=>ae.stopPropagation(),onSubmit:ae=>void N(ae),children:[s.jsxs("header",{children:[s.jsx("strong",{children:p==="new"?"Add Memory":"Edit Memory"}),s.jsx("button",{"aria-label":"Close memory editor",className:"memory-icon-button",title:"Close",type:"button",onClick:F,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:ae=>b(J=>({...J,key:ae.target.value})),placeholder:"Stable technical key used as the injected tag name",value:m.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value · up to 1000 tokens"}),s.jsx("textarea",{onChange:ae=>b(J=>({...J,value:ae.target.value})),placeholder:"Memory content injected under this key",rows:10,value:m.value})]}),x?s.jsx("p",{className:"memory-editor-error",children:x}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{"aria-label":"Cancel memory edit",className:"memory-dialog-button",type:"button",onClick:F,children:"Cancel"}),s.jsx("button",{"aria-label":"Save memory item",className:"memory-dialog-button primary",disabled:R!==null,type:"submit",children:R==="add"||R!=null&&R.startsWith("save:")?"Saving...":"Save"})]})]})}):null,w!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>E(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete memory item",className:"memory-delete-dialog",onClick:ae=>ae.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Memory"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>E(null),children:"×"})]}),s.jsxs("p",{children:["Delete"," ",s.jsx("code",{children:((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:R!==null,type:"button",onClick:()=>E(null),children:"Cancel"}),s.jsx("button",{"aria-label":"Confirm delete",className:"memory-dialog-button danger",disabled:R!==null,type:"button",onClick:()=>void ie(w),children:"Delete"})]})]})}):null]})}function iN({emptyText:e,items:i}){const a=du(i);return a.length?s.jsx("div",{className:"memory-items-list",children:a.map(r=>s.jsx("div",{className:"memory-item-display memory-item-readonly",children:s.jsxs("pre",{"aria-label":`Memory item ${r.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${r.key}>`}),`
96
+ `,s.jsx("span",{children:r.value}),`
97
+ `,s.jsx("span",{className:"memory-tag",children:`</${r.key}>`})]})},r.key))}):s.jsx("p",{className:"settings-note",children:e})}function aN({deleteConfirmKey:e,editingEnvironmentKey:i,environmentDraft:a,globalEnvironment:r,scope:u,workspaceEnvironment:c,valueVisible:d,onCancelEnvironmentEdit:p,onDeleteConfirmChange:g,onDeleteEnvironment:m,onDraftChange:b,onEditEnvironment:x,onRevealEnvironmentValue:S,onSubmitEnvironment:w,onValueVisibleChange:E,revealedEnvironmentKeys:R}){const $=i!==null&&R.has(i),M=u==="workspace",H=M?c:r,[q,F]=D.useState(!1);function ie(){p(),b({description:"",key:"",value:""}),E(!1),F(!0)}function N(J){x(J),E(!1),F(!0)}function K(){F(!1),p(),E(!1)}function ae(J){w(J),F(!1)}return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:M?"Workspace Environment":"Base Environment"}),s.jsx("p",{children:M?"Workspace variables are stored in this workspace and are merged with base variables for new runs.":"Base variables are injected into every new workspace run. Existing runs keep the environment they started with."})]})}),M?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Environment"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(qx,{emptyText:"No base environment variables are configured.",readonly:!0,variables:r})]}):null,s.jsxs("section",{className:"environment-manager",children:[s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add environment variable",className:"memory-icon-button",title:"Add",type:"button",onClick:ie,children:"+"})}),s.jsx(qx,{emptyText:M?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:J=>g(J),onEdit:N,variables:H})]}),q?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:J=>J.stopPropagation(),onSubmit:ae,children:[s.jsxs("header",{children:[s.jsx("strong",{children:i?"Edit Environment":"Add Environment"}),s.jsx("button",{"aria-label":"Close environment editor",className:"memory-icon-button",title:"Close",type:"button",onClick: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:J=>b({...a,key:J.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:a.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value"}),s.jsxs("span",{className:"environment-value-field",children:[s.jsx("input",{"aria-label":"Environment variable value",autoComplete:"off",onChange:J=>b({...a,value:J.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:d?"text":"password",value:a.value}),s.jsx("button",{"aria-label":d?"Hide value":"Show value",onClick:()=>{if(i&&!$&&!a.value){S(i),E(!0);return}E(!d)},title:d?"Hide value":"Show value",type:"button",children:d?s.jsx(D2,{}):s.jsx(N2,{})})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Description"}),s.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:J=>b({...a,description:J.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:a.description})]}),s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:K,children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:!a.key.trim(),type:"submit",children:"Save"})]})]})}):null,e?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>g(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:J=>J.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Environment"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>g(null),children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("code",{children:e}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:()=>g(null),children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(e),g(null)},children:"Delete"})]})]})}):null]})}function qx({emptyText:e,onDelete:i,onEdit:a,readonly:r=!1,variables:u}){return u.length===0?s.jsx("p",{className:"settings-note",children:e}):s.jsx("div",{className:r?"environment-list readonly":"environment-list",children:u.map(c=>s.jsxs("div",{className:r?"environment-row readonly":"environment-row",children:[s.jsxs("div",{className:"environment-row-main",children:[s.jsxs("pre",{"aria-label":`Environment variable ${c.key}`,children:[s.jsx("span",{className:"memory-tag",children:c.key}),"=",c.hasValue?"••••••":"",c.description?s.jsx("span",{className:"environment-comment",children:` # ${c.description}`}):null]}),s.jsxs("span",{children:[c.hasValue?"configured":"empty"," · updated"," ",$e(c.updatedAt)]})]}),r?s.jsx("span",{className:"environment-readonly-tag",children:"read-only"}):s.jsxs("div",{className:"environment-row-actions",children:[s.jsx("button",{"aria-label":`Edit ${c.key}`,className:"memory-icon-button memory-item-edit",onClick:()=>a==null?void 0:a(c),title:"Edit",type:"button",children:"✎"}),s.jsx("button",{"aria-label":`Delete ${c.key}`,className:"memory-icon-button memory-item-delete",onClick:()=>i==null?void 0:i(c.key),title:"Delete",type:"button",children:"×"})]})]},c.key))})}function Yv({items:e,onDelete:i,onEdit:a}){const[r,u]=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:rN(p.kind)}),s.jsx("span",{className:uN(p.status),children:sN(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," · ",oN(p.refreshPolicy)," · updated ",$e(p.updatedAt)]})]}),s.jsx("div",{className:"environment-row-actions",children:r===p.id?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"danger",onClick:()=>{i(p.id),u(null)},type:"button",children:"Delete"}),s.jsx("button",{onClick:()=>u(null),type:"button",children:"Cancel"})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`Check ${p.name}`,onClick:()=>d(p.id),title:"Check or refresh through workspace",type:"button",children:"↻"}),s.jsx("button",{"aria-label":`Edit ${p.name}`,onClick:()=>a(p),title:"Edit knowledge",type:"button",children:s.jsx(hd,{})}),s.jsx("button",{"aria-label":`Delete ${p.name}`,onClick:()=>u(p.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},p.id))})}function lN({draft:e,items:i,scope:a,workspaceName:r,onCancel:u,onDelete:c,onDraftChange:d,onEdit:p,onSubmit:g}){return a==="workspace"?s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.jsxs("p",{children:["Long-lived source-backed material for ",r??"this workspace",". The workspace should create and maintain these assets itself when it digests external material. You mainly review status, delete stale items, or trigger a future refresh/check."]})]})}),s.jsx(Yv,{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 rN(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function sN(e){return e.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function oN(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function uN(e){return e==="ready"?"knowledge-status ready":e==="needs_credentials"||e==="invalid_credentials"||e==="needs_fetch_method"?"knowledge-status warning":e==="stale_signal"?"knowledge-status stale":"knowledge-status"}function Je({label:e,value:i,mono:a=!1}){return s.jsxs("div",{className:"context-field",children:[s.jsx("span",{children:e}),s.jsx("strong",{className:a?"mono":void 0,title:i,children:i})]})}function cN({onRefresh:e,preview:i,refreshing:a}){const r=["workspace_identity","workspace_environment","rendering"],u=D.useMemo(()=>Object.entries(i.context).map(([d,p])=>[d,dN(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(Hx(d)))==null||p.scrollIntoView({behavior:"smooth",block:"start"})};return s.jsxs("div",{className:"additional-context-preview",children:[s.jsx("div",{className:"additional-context-header",children:s.jsxs("div",{className:"additional-context-meta",children:[s.jsxs("span",{children:["Generated ",$e(i.generatedAt)]}),s.jsxs("span",{children:[Un(u.length)," keys"]}),s.jsx("button",{disabled:a,onClick:e,type:"button",children:a?"Rendering...":"Refresh"})]})}),s.jsxs("div",{className:"additional-context-toc",children:[s.jsx("button",{"aria-label":"Additional context outline",type:"button",children:"☰"}),s.jsx("div",{className:"additional-context-toc-menu",children:u.map(([d])=>s.jsx("button",{onClick:()=>c(d),type:"button",children:d},d))})]}),s.jsx("div",{className:"additional-context-list",children:u.map(([d,p])=>s.jsxs("section",{className:"additional-context-item",id:Hx(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 Hx(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function dN(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 fN({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:Zo(e.createdAt)}),s.jsx(Je,{label:"Updated",value:Zo(e.updatedAt)}),s.jsx(Je,{label:"Recency",value:Zo(e.recencyAt)}),s.jsx(Je,{label:"Turns",value:Un(e.turnCount),mono:!0}),s.jsx(Je,{label:"Items",value:Un(e.itemCount),mono:!0}),s.jsx(Je,{label:"User / agent",value:`${Un(e.userMessageCount)} / ${Un(e.agentMessageCount)}`,mono:!0}),s.jsx(Je,{label:"Compactions",value:`${Un(e.compactionCount)} / ${Un(e.contextCompactionCount)} context`,mono:!0}),s.jsx(Je,{label:"CWD",value:e.cwd,mono:!0}),s.jsx(Je,{label:"Path",value:e.path,mono:!0})]}),e.preview?s.jsxs("details",{className:"thread-read-preview",children:[s.jsx("summary",{children:"Preview"}),s.jsx("p",{children:e.preview})]}):null,s.jsxs("section",{className:"thread-read-turns",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Turns"}),s.jsxs("span",{children:[e.turns.length," turn",e.turns.length===1?"":"s"]})]}),s.jsx("div",{className:"thread-read-turn-list",children:e.turns.map((i,a)=>s.jsxs("details",{className:"thread-read-turn",children:[s.jsxs("summary",{children:[s.jsxs("code",{children:["turn ",a+1]}),s.jsx("span",{title:i.id,children:i.id}),s.jsxs("small",{children:[i.status," · ",i.itemCount," item",i.itemCount===1?"":"s"]})]}),s.jsxs("div",{className:"thread-read-turn-detail",children:[s.jsxs("div",{className:"thread-read-turn-fields",children:[s.jsx(Je,{label:"Status",value:i.status}),s.jsx(Je,{label:"Items view",value:i.itemsView}),s.jsx(Je,{label:"Started",value:Zo(i.startedAt)}),s.jsx(Je,{label:"Completed",value:Zo(i.completedAt)}),s.jsx(Je,{label:"Duration",value:i.durationMs===null?"unknown":Ns(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 eu(e,i,a,r,u,c,d,p,g,m){var b,x,S,w;if(e.type==="assistantText")return s.jsx("article",{className:`message assistant${e.streaming?" streaming":""}`,"data-hover-time":$e(e.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:"Seele"}),s.jsx("time",{dateTime:e.createdAt,children:e.streaming?"streaming":$e(e.createdAt)})]}),s.jsx("div",{className:"message-body",children:s.jsx(iu,{content:e.content,conversation:i,streaming:e.streaming,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="turnError")return s.jsxs("article",{className:"turn-error-result","data-hover-time":$e(e.createdAt),role:"alert",children:[s.jsx("strong",{children:"Task failed"}),s.jsx(Jx,{content:e.content})]});if(e.type==="message")return s.jsx("article",{className:`message ${e.message.role}`,"data-hover-time":$e(e.message.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:vR(e.message.role)}),s.jsx("time",{dateTime:e.message.createdAt,children:$e(e.message.createdAt)})]}),s.jsx("div",{className:"message-body",children:e.message.role==="user"?s.jsx(Jx,{content:e.message.content}):s.jsx(iu,{content:e.message.content,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="system"){if((b=e.topicMessages)!=null&&b.length)return s.jsx("div",{className:"topic-input-list",children:e.topicMessages.map(R=>s.jsx("article",{className:"message topic-input","data-hover-time":$e(R.createdAt),children:s.jsxs("div",{className:"topic-message-bubble topic-input-bubble",children:[s.jsxs("header",{className:"topic-input-header",children:[s.jsxs("span",{className:"topic-input-sender",children:["From ",R.senderName]}),s.jsx("time",{dateTime:R.createdAt,children:$e(R.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(iu,{content:R.contentMarkdown,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})},R.id))});const E=kr({},[e.detail]);return s.jsx("article",{className:"message system","data-hover-time":$e(e.createdAt),children:s.jsx("div",{className:"message-main",children:s.jsxs("button",{className:`system-message-body system-message-link${e.visualKind?` ${e.visualKind}`:""}`,onClick:()=>m==null?void 0:m(e),type:"button",children:[e.visualKind==="topic"?s.jsx("span",{className:"system-message-icon",children:s.jsx(Qc,{})}):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(Wv,{description:e.tool.body,icon:s.jsx(Pv,{}),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(jN,{tool:e.tool,onRespondApproval:c}):e.tool.kind==="file"&&((x=e.tool.fileChanges)!=null&&x.length)?s.jsx(kN,{conversation:i,tool:e.tool}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?s.jsx(vN,{conversation:i,tool:e.tool,onRespond:d}):e.tool.kind==="knowledge"?s.jsx(wN,{tool:e.tool,onRespond:p}):e.tool.kind==="collaboration"&&e.tool.topicAction==="send"?s.jsxs("details",{className:"tool-card collaboration topic-output","data-hover-time":$e(e.tool.createdAt),title:$e(e.tool.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[s.jsx("span",{className:"tool-card-kind-icon",children:s.jsx(Qc,{})}),s.jsx("span",{children:e.tool.title})]}),e.tool.meta?s.jsx("small",{children:e.tool.meta}):null]}),s.jsxs("div",{className:"topic-message-bubble topic-output-bubble",children:[s.jsxs("header",{className:"topic-input-header",children:[s.jsxs("span",{className:"topic-input-sender",children:["To ",e.tool.topicRecipientLabel??"Topic"]}),s.jsx("time",{dateTime:e.tool.createdAt,children:$e(e.tool.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(iu,{content:e.tool.topicMessageContent??e.tool.output??"",conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]}),(S=e.tool.rawEvents)!=null&&S.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]}):s.jsxs("details",{className:`tool-card ${e.tool.kind}`,"data-hover-time":$e(e.tool.createdAt),title:$e(e.tool.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[e.tool.kind==="collaboration"?s.jsx("span",{className:"tool-card-kind-icon",children:s.jsx(Qc,{})}):null,s.jsx("span",{children:e.tool.title})]}),e.tool.meta?s.jsx("small",{children:e.tool.meta}):null]}),s.jsx("code",{children:e.tool.body}),e.tool.output?s.jsx("pre",{children:e.tool.output}):null,(w=e.tool.rawEvents)!=null&&w.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]})}function $x(e){return e.type==="message"||e.type==="turnError"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&pN(e.tool)}function pN(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 hN(e){const i=[],a=[];for(const r of e)r.type==="tool"&&(r.tool.kind==="collaboration"&&r.tool.topicAction==="send"||r.tool.kind==="workspaceChange"||r.tool.kind==="responsibility")?a.push(r):i.push(r);return[...i,...a]}function mN({group:e,conversation:i,allowProcessView:a=!0,copiedFooter:r,copiedArtifactUrl:u,running:c,onCopyArtifactUrl:d,onCopyBubble:p,onLoadProcessDetails:g,onPreviewArtifact:m,onRespondApproval:b,onRespondWorkspaceChangeProposal:x,onRespondKnowledgeProposal:S,onOpenComplexTask:w,onOpenSystemEvent:E}){const R=hN(e.agentItems.filter($x)),$=e.agentItems.some(te=>!$x(te)),M=a&&($||e.turnIds.length>0),H=c?"process":"result",[q,F]=D.useState(H),[ie,N]=D.useState(!1),K=q==="result"?R:e.agentItems,ae=EN(K);D.useEffect(()=>{ie||F(H)},[H,ie]);const J=c||M||e.stopped,I=s.jsxs(s.Fragment,{children:[J?s.jsx("div",{className:"turn-panel-controls",children:c?s.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):M?s.jsx("button",{"aria-label":q==="result"?"Show process":"Show result",className:"turn-view-toggle",title:q==="result"?"Show process":"Show result",type:"button",onClick:()=>{N(!0),F(te=>te==="result"?(g(e.turnIds),"process"):"result")},children:q==="result"?s.jsx(gN,{}):s.jsx(yN,{})}):null}):null,K.map(te=>s.jsx(D.Fragment,{children:eu(te,i,m,d,u,b,x,S,w,E)},te.id)),q==="result"&&K.length===0?s.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":$?"No reliable final answer captured":"No result yet"}):null,s.jsx(tu,{copied:r,content:ae,id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:AN(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:J?"stopped-turn-body has-controls":"stopped-turn-body",children:I})]}):s.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",J?"has-controls":""].filter(Boolean).join(" "),children:I})}function gN(){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 yN(){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 xN(){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 Pv(){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 bN(){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 Wv({className:e="",description:i,icon:a,onClick:r,timestamp:u,title:c,trailing:d,visibleTitle:p}){return s.jsxs("button",{className:`tool-card file compact-timeline-link ${e}`.trim(),"data-hover-time":$e(u),onClick:r,title:c,type:"button",children:[s.jsx("span",{className:"compact-timeline-link-icon",children:a}),s.jsxs("span",{className:"compact-timeline-link-copy",children:[s.jsx("strong",{children:p}),s.jsx("small",{children:i})]}),d?s.jsx("span",{className:"compact-timeline-link-trailing",children:d}):null]})}function vN({conversation:e,tool:i,onRespond:a}){var $;const r=Ee(($=i.workspaceChangePayload)==null?void 0:$.content)||i.body,[u,c]=D.useState(r),[d,p]=D.useState(null),[g,m]=D.useState("source"),[b,x]=D.useState(!1),S=!!(i.workspaceChangeProposalId??i.responsibilityProposalId),w=i.meta==="saved"||i.meta==="declined"?i.meta:S?"pending":"preparing",E=w==="pending";D.useEffect(()=>{c(r)},[r]);async function R(M){p(M);try{await a(i,M,M==="accept"?{content:u}:void 0)&&x(!1)}finally{p(null)}}return s.jsxs(s.Fragment,{children:[s.jsx(Wv,{className:"responsibility-request-link",description:"Workspace responsibility",icon:s.jsx(hd,{}),onClick:()=>x(!0),timestamp:i.createdAt,title:"View workspace change request",trailing:s.jsx("span",{className:`responsibility-request-status ${w}`,children:w}),visibleTitle:i.title}),b?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!d&&x(!1),children:s.jsxs("section",{"aria-labelledby":`responsibility-proposal-${i.id}`,"aria-modal":"true",className:"dialog-card responsibility-proposal-dialog",onMouseDown:M=>M.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:`responsibility-proposal-${i.id}`,children:i.title}),s.jsxs("p",{children:["Workspace change · ",$e(i.createdAt)]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!d,onClick:()=>x(!1),type:"button",children:"×"})]}),s.jsxs("div",{className:"responsibility-proposal-dialog-body",children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Proposed responsibility"}),s.jsx("p",{children:S?"Review or edit the Markdown before applying it to future turns.":"The proposal becomes actionable after the current turn completes."})]}),s.jsx("span",{children:w})]}),i.responsibilityReason?s.jsx("p",{className:"responsibility-proposal-reason",children:i.responsibilityReason}):null,E?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":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:M=>c(M.target.value),rows:12,value:u}):s.jsx("div",{className:"message-body responsibility-markdown-preview",children:Rl(u,e)})]}):s.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:Rl(u,e)})]}),s.jsx("footer",{className:"responsibility-proposal-dialog-actions",children:E?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"secondary reject",disabled:!!d,type:"button",onClick:()=>void R("decline"),children:d==="decline"?"Rejecting...":"Reject"}),s.jsx("button",{className:"approve",disabled:!!d,type:"button",onClick:()=>void R("accept"),children:d==="accept"?"Saving...":"Save"})]}):s.jsx("button",{className:"secondary",onClick:()=>x(!1),type:"button",children:"Close"})})]})}):null]})}function wN({tool:e,onRespond:i}){const[a,r]=D.useState(e.body),[u,c]=D.useState(null),[d,p]=D.useState("source"),g=e.meta==="saved"||e.meta==="declined"?e.meta:"pending",m=g==="pending",b=Gx(a);return D.useEffect(()=>{r(e.body)},[e.body]),s.jsxs("article",{className:"tool-card responsibility knowledge-proposal","data-hover-time":$e(e.createdAt),title:$e(e.createdAt),children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:e.title}),s.jsx("p",{children:"Long-term knowledge changes require approval. Keep one item as a reusable source or skill, not a tiny note."})]}),s.jsx("span",{children:g})]}),m?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":d==="source",className:d==="source"?"active":"",role:"tab",type:"button",onClick:()=>p("source"),children:"JSON"}),s.jsx("button",{"aria-selected":d==="preview",className:d==="preview"?"active":"",role:"tab",type:"button",onClick:()=>p("preview"),children:"Preview"})]}),d==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace knowledge",className:"responsibility-proposal-body",disabled:!!u,onChange:x=>r(x.target.value),rows:10,value:a}):b?s.jsx(Vx,{value:b}):s.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):b?s.jsx(Vx,{value:b,saved:!0}):s.jsx("pre",{className:"knowledge-proposal-raw",children:a}),m?s.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[s.jsx("button",{className:"approve",disabled:!!u,type:"button",onClick:()=>{Gx(a)&&(c("accept"),Promise.resolve(i(e,"accept",a)).finally(()=>c(null)))},children:u==="accept"?"Saving...":"Save"}),s.jsx("button",{className:"reject",disabled:!!u,type:"button",onClick:()=>{c("decline"),Promise.resolve(i(e,"decline",a)).finally(()=>c(null))},children:u==="decline"?"Rejecting...":"Reject"})]}):null]})}function Gx(e){try{const i=JSON.parse(e);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}function Ep(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function Vx({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:Ep(e.name)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Purpose"}),s.jsx("dd",{children:Ep(e.purpose)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Content"}),s.jsx("dd",{children:Ep(e.content??e.description)})]})]})})}function kN({conversation:e,tool:i}){var d;const a=i.fileChanges??[],r=e==null?void 0:e.workspacePath,u=qE(a),c=i.meta==="started"||i.meta==="running";return s.jsxs("details",{className:`tool-card file${c?" running":" done"}`,"data-hover-time":$e(i.createdAt),title:$e(i.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[s.jsx("span",{className:"file-change-indicator","aria-hidden":"true"}),s.jsx("span",{className:"file-change-title",children:BE(a,r)})]}),s.jsx(Fx,{additions:u.additions,deletions:u.deletions,running:c})]}),s.jsx("div",{className:"file-change-list",children:a.map((p,g)=>s.jsxs("div",{className:"file-change-row",children:[s.jsx("span",{className:"file-change-kind",children:SN(p.kind)}),s.jsx("code",{title:p.path,children:_v(p.path,r)}),s.jsx(Fx,{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 Fx({additions:e,deletions:i,running:a=!1}){return s.jsxs("span",{className:"file-change-stats",children:[a?s.jsx("small",{children:"editing"}):null,e>0?s.jsxs("span",{className:"file-change-additions",children:["+",e]}):null,i>0?s.jsxs("span",{className:"file-change-deletions",children:["-",i]}):null]})}function SN(e){switch(e){case"add":return"A";case"delete":return"D";case"move":return"R";default:return"M"}}function jN({tool:e,onRespondApproval:i}){var S;const a=FD(e),[r,u]=D.useState(!1),[c,d]=D.useState("script"),p=a==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,g=rd(e.body)?null:e.body,m=g?XD(g):null,b=m?`${CN(a)} · ${m}`:a==="running"?"Running script":a==="approval"?"Waiting for approval":"Command",x=YD(e,a);return s.jsxs("article",{className:`tool-card command ${a}`,"data-hover-time":$e(e.createdAt),title:$e(e.createdAt),children:[s.jsxs("div",{className:"tool-command-bar",children:[s.jsxs("button",{"aria-expanded":r,className:"tool-command-toggle",type:"button",onClick:()=>u(w=>!w),children:[s.jsx("span",{className:"tool-command-indicator","aria-hidden":"true"}),s.jsx("span",{children:b}),s.jsx("small",{className:"tool-command-badge",children:x})]}),r?s.jsxs("div",{className:"tool-command-tabs",role:"tablist","aria-label":"Command details",children:[s.jsx("button",{"aria-selected":c==="script",role:"tab",type:"button",onClick:()=>d("script"),children:"Script"}),s.jsx("button",{"aria-selected":c==="result",role:"tab",type:"button",onClick:()=>d("result"),children:"Result"}),(S=e.rawEvents)!=null&&S.length?s.jsx("button",{"aria-selected":c==="raw",role:"tab",type:"button",onClick:()=>d("raw"),children:"Raw"}):null]}):null,p?s.jsxs("div",{className:"tool-approval-actions",children:[s.jsx("button",{className:"approve",type:"button",onClick:()=>i(e,"accept"),children:"Approve"}),s.jsx("button",{className:"reject",type:"button",onClick:()=>i(e,"decline"),children:"Reject"})]}):null]}),r?c==="script"?s.jsx("div",{className:"tool-tab-panel",role:"tabpanel",children:g?s.jsx(Yx,{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:PD(e,a)}),e.output?s.jsx(Yx,{content:e.output}):s.jsx("p",{className:"tool-output-pending",children:a==="running"?"Waiting for output...":a==="approval"?"Waiting for approval before running.":e.meta??"No output"})]}):s.jsx(TN,{events:e.rawEvents??[]}):null]})}function CN(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function Yx({content:e}){const[i,a]=D.useState(!1),r=KD(e,Ix);return s.jsxs("div",{className:"tool-content-block",children:[s.jsx("pre",{className:"tool-content-code",children:i?e:WD(e,Ix)}),r?s.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>a(u=>!u),children:i?"Collapse":"Show all"}):null]})}function TN({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 tu({copied:e,content:i,id:a,notice:r,timestamp:u,variant:c,onCopy:d}){return i.trim()?s.jsxs("footer",{className:`turn-panel-footer ${c}${r?" has-notice":""}`,children:[r?s.jsx("span",{"aria-label":`Notification failed: ${r}`,className:"turn-panel-footer-notice",role:"img",title:r,children:s.jsx(uw,{})}):null,s.jsx("time",{dateTime:u,children:$e(u)}),s.jsx("button",{"aria-label":e?"Copied markdown":"Copy markdown",onClick:()=>d(a,i),title:e?"Copied":"Copy",type:"button",children:e?s.jsx("span",{"aria-hidden":"true",children:"Copied"}):s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})})]}):null}function nu(e){return e.type==="message"?e.message.role==="user"?e.message.content:jr(e.message.content):e.type==="assistantText"?jr(e.content):e.type==="turnError"?`Task failed
98
+
99
+ ${e.content}`:e.type==="system"?[e.title,e.fullDetail??e.detail].filter(i=>!!(i!=null&&i.trim())).join(`
100
+
101
+ `):""}function EN(e){return e.map(nu).filter(i=>i.trim()).join(`
102
+
103
+ `)}function AN(e){for(let i=e.length-1;i>=0;i-=1){const a=e[i];if(a.type!=="tool")return a.createdAt}return new Date().toISOString()}function NN({usage:e}){return e?s.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:e.windows.map(i=>s.jsx(DN,{label:Kv(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 Kv(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function DN({label:e,window:i}){const a=md(i.usedPercent),r=Bh(a),u=`${e} usage ${Ew(a)} · resets ${Aw(i.resetsAt)}`;return s.jsx("span",{"aria-label":u,className:`usage-indicator ${r}`,"data-tooltip":u,role:"status",style:{"--usage-level":`${a}%`},tabIndex:0,children:s.jsxs("strong",{children:[Math.round(a),"%"]})})}function RN(e,i,a,r,u,c){const d=[...e].sort(cu),p=new Map(r.filter(N=>N.parentId===null&&N.nodeType==="agent_turn"&&N.turnId!==null).map(N=>[N.turnId,N.sequence])),g=new Map(r.filter(N=>N.parentId===null&&N.nodeType==="agent_turn"&&N.turnId!==null).map(N=>[N.turnId,N.timelineAt])),m=new Map(r.filter(N=>N.nodeType==="user_message"&&N.entityId!==null).map(N=>[N.entityId,N.sequence])),b=new Map(r.filter(N=>N.nodeType==="user_message"&&N.entityId!==null).map(N=>[N.entityId,N.timelineAt])),x=r.filter(N=>N.parentId===null&&N.nodeType==="system_event"),S=x.filter(N=>N.turnId!==null&&N.subtype.startsWith("input:")),w=x.filter(N=>!S.includes(N)),E=new Set(x.flatMap(N=>N.turnId?[N.turnId]:[])),R=EE(i),$=new Map(a.map(N=>[N.id,N])),M=r.filter(N=>N.parentId===null&&N.nodeType==="agent_turn"&&N.turnId!==null).map(N=>N.turnId),q=[...new Set(r.length>0?[...M,...u?[u]:[]]:[...a.map(N=>N.id),...d.flatMap(N=>N.turnId?[N.turnId]:[]),...i.flatMap(N=>N.turnId?[N.turnId]:[])])].map(N=>{var Ke,mt,nn,wn;const K=$.get(N),ae=d.filter(Ie=>Ie.turnId===N),J=ae.filter(Ie=>Ie.role==="user").sort((Ie,It)=>{const jt=b.get(Ie.id)??Ie.createdAt,$t=b.get(It.id)??It.createdAt;return jt.localeCompare($t)||cu(Ie,It)}),I=ae.filter(Ie=>Ie.role==="assistant"),te=i.filter(Ie=>Ie.turnId===N).sort(cu),ue=`turn:${N}`,Ce=r.filter(Ie=>Ie.parentId===ue).sort((Ie,It)=>Ie.sequence-It.sequence),xe=(K==null?void 0:K.origin)??R.get(N),ce=S.filter(Ie=>Ie.turnId===N).sort((Ie,It)=>Ie.timelineAt.localeCompare(It.timelineAt)||Ie.sequence-It.sequence).map(Ie=>Px(Ie,void 0,c)),V=xe==="timeline_event"?[]:r.length>0?qN(Ce,te,ou([N],u),c):Qv(te,ou([N],u),c),se=I.map(Qo),we=Ce.find(Ie=>Ie.subtype==="server.complex_task.plan_updated"),Me=te.find(Ie=>Ie.event==="server.complex_task.plan_updated"),O=(we==null?void 0:we.detail)??(Me==null?void 0:Me.data),A=me(me(O).task),z=me(A.currentPlan),C=Ee(z.planMarkdown),W=zN(BN(V,se),C),he=AE(K);he&&W.push({id:`turn-error-${he.turnId}`,type:"turnError",createdAt:he.createdAt,content:he.content});const ge=te.find(Ie=>Ie.event==="server.wakeup.started"),Se=me(ge==null?void 0:ge.data),oe=typeof Se.instruction=="string"?Se.instruction.trim():"",Oe=xe==="timeline_event"?te[0]:void 0,vt=E.has(N)?null:Oe?Xv(Oe,(K==null?void 0:K.startedAt)??new Date(0).toISOString()):LN(xe)?{id:`system-${N}`,type:"system",createdAt:(K==null?void 0:K.startedAt)??((Ke=te[0])==null?void 0:Ke.createdAt)??new Date(0).toISOString(),title:IN(xe??"system"),detail:UN(xe??"system",oe),fullDetail:oe||void 0}:null,St=e2(te),vn=(J[0]?b.get(J[0].id):(mt=S.find(Ie=>Ie.turnId===N))==null?void 0:mt.timelineAt)??g.get(N)??(K==null?void 0:K.startedAt)??((nn=ae[0])==null?void 0:nn.createdAt)??((wn=te[0])==null?void 0:wn.createdAt)??new Date(0).toISOString();return{id:`turn-${N}`,turnIds:[N],user:vt??(J[0]?Qo(J[0]):null),followupUsers:J.slice(1).map(Qo),acceptedSystemInputs:ce,agentItems:W,activity:St??(ou([N],u)?{id:-1,title:W.some(Ie=>Ie.type==="assistantText"&&Ie.streaming)?"Writing response":"Working",createdAt:vn,tone:"running"}:null),notificationFailure:JN(te),stopped:te.some(Jv),trailingSystemItems:[],sortAt:vn,sortSequence:p.get(N)??null}}),F=d.filter(N=>!N.turnId);q.push(...F.map(N=>({id:`message-${N.id}`,turnIds:[],user:N.role==="user"?Qo(N):null,followupUsers:[],agentItems:N.role==="assistant"?[Qo(N)]:[],activity:null,notificationFailure:null,stopped:!1,sortAt:b.get(N.id)??N.createdAt,sortSequence:m.get(N.id)??null})));const ie=new Map(i.map(N=>[String(N.id),N]));return q.push(...w.map(N=>({id:N.id,turnIds:[],user:Px(N,N.entityType==="event"&&N.entityId?ie.get(N.entityId):void 0,c),followupUsers:[],agentItems:[],activity:null,notificationFailure:null,stopped:!1,trailingSystemItems:[],sortAt:N.timelineAt,sortSequence:N.sequence}))),q.sort((N,K)=>{const ae=N.sortAt.localeCompare(K.sortAt);return ae!==0?ae:N.sortSequence!==null||K.sortSequence!==null?(N.sortSequence??Number.MAX_SAFE_INTEGER)-(K.sortSequence??Number.MAX_SAFE_INTEGER):0}).map(({sortAt:N,...K})=>K)}function Px(e,i,a){var g,m;if(i||e.entityType==="event")return Xv(i??nh(e),e.createdAt);const r=me(e.detail);if(e.subtype==="input:collaboration_notice"||e.subtype==="input:topic_message"){const b=Kp(r,a),x=_N(r.messages,a),S=Array.isArray(r.senderWorkspaceIds)?r.senderWorkspaceIds.filter(E=>typeof E=="string"&&E.trim().length>0):[],w=typeof r.unreadCount=="number"?r.unreadCount:0;return{id:e.id,type:"system",createdAt:e.createdAt,title:b.title,detail:b.detail,visualKind:"topic",topicMessages:x,fullDetail:[`## ${b.title}`,"","**Unread**","",String(w),"","**From**","",S.length>0?S.map(E=>{const R=a.get(E)??E;return`${br(R)} (\`${E}\`)`}).join(", "):"Unknown"].join(`
104
+ `)}}const u=Ee(r.complexTaskId)||Ee(me(r.task).id)||void 0,c=Dv(e.title,e.subtype),d=kr(r,[e.summary,e.contentMarkdown]),p=[`## ${br(c)}`,"",((g=e.contentMarkdown)==null?void 0:g.trim())||((m=e.summary)==null?void 0:m.trim())||"",Object.keys(r).length>0?["","```json",JSON.stringify(r,null,2),"```"].join(`
105
+ `):""].filter(Boolean).join(`
106
+ `);return{id:e.id,type:"system",createdAt:e.createdAt,title:c,detail:d,fullDetail:p||void 0,linkedTaskId:u}}function _N(e,i){if(!Array.isArray(e))return[];const a=new Set,r=[];for(const u of e){const c=me(u),d=Ee(c.id),p=Ee(c.senderWorkspaceId),g=Ee(c.contentMarkdown).trim(),m=Ee(c.createdAt);!d||a.has(d)||!p||!g||!m||(a.add(d),r.push({id:d,senderWorkspaceId:p,senderName:i.get(p)??(Ee(c.senderTitleSnapshot)||p),contentMarkdown:g,createdAt:m}))}return r}function Xv(e,i){return e.event==="server.collaboration.topic_created"?MN(e,i):ON(e,i)}function MN(e,i){const a=me(me(e.data).topic),r=Ee(a.title).trim()||"Untitled Topic",u=Ee(a.publicDescription).trim()||"未填写描述",c=Array.isArray(a.members)?a.members.map(me):[],d=Ee(a.ownerWorkspaceId),p=c.find(x=>Ee(x.role)==="owner"||Ee(x.workspaceId)===d),g=Ee(p==null?void 0:p.workspaceTitleSnapshot).trim()||"Unknown workspace",m=c.filter(x=>Ee(x.role)!=="owner"&&Ee(x.status)==="active"),b=m.length?m.map(x=>{const S=Ee(x.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${br(S)} (\`${Ee(x.workspaceId)}\`)`}):["无"];return{id:`collaboration-topic-created-${e.id}`,type:"system",createdAt:e.createdAt??i,title:"Created",detail:r,visualKind:"topic",fullDetail:["## Topic 已创建","","**名称**","",br(r),"","**描述**","",br(u),"","**Owner Workspace**","",`${br(g)} (\`${d}\`)`,"","**协作 Workspace**","",...b].join(`
107
+ `)}}function ON(e,i){const a=me(e.data),r=th(e.data),u=Dv(void 0,e.event);return{id:`system-event-${e.id}`,type:"system",createdAt:e.createdAt??i,title:u,detail:kr(a),visualKind:e.event.startsWith("server.collaboration.")?"topic":void 0,fullDetail:[`## ${br(u)}`,"","**Event**","",`\`${e.event}\``,"","```json",JSON.stringify(r??null,null,2),"```"].join(`
108
+ `)}}function th(e,i=""){return Array.isArray(e)?e.map(a=>th(a)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,r])=>[a,th(r,a)])):typeof e=="string"&&(i==="wakeAt"||i==="wake_at")&&fu(e)||e}function zN(e,i){const a=i.trim();return a?e.filter(r=>r.type==="assistantText"?jr(r.content).trim()!==a:r.type==="message"&&r.message.role==="assistant"?jr(r.message.content).trim()!==a:!0):e}function LN(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function IN(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function UN(e,i){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":i?vw(i,20):"Auto resumed"}function BN(e,i){if(e.some(u=>u.type==="assistantText"))return ld(e);if(i.length===0)return e;const a=[...i],r=[];for(const u of e)u.type==="tool"&&Oh(u.tool)&&Mh(a,u.tool)||r.push(u);return ld([...r,...a])}function qN(e,i,a,r){var g;const u=new Map(i.filter(m=>m.id!==void 0).map(m=>[String(m.id),m])),c=new Map,d=new Set;for(const m of e){const b=HN(m,i,u);b.length>0&&d.add(m.id);for(const x of b)c.set(Ba(x),x)}if(a)for(const m of i)$N(e,m)||c.set(Ba(m),m);else if(i.length>0&&!e.some(m=>m.phase==="process"))for(const m of i)c.set(Ba(m),m);const p=Qv([...c.values()].sort(cu),a,r);for(const m of e)if(!d.has(m.id)){if(m.nodeType==="agent_text"&&m.subtype!=="final_answer"&&((g=m.contentMarkdown)!=null&&g.trim())){p.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:GN(m),itemId:m.entityType==="codex_item"?m.entityId??void 0:void 0,streaming:a&&m.status==="running"});continue}m.nodeType==="operation"&&p.push({id:m.id,type:"tool",createdAt:m.createdAt,tool:VN(m,r)})}return ld(p)}function HN(e,i,a){if(e.entityType==="event"&&e.entityId){const r=a.get(e.entityId);return r&&e.phase==="process"&&e.status==="running"?[r]:[nh(e)]}if(e.entityType==="codex_item"&&e.entityId){const r=i.filter(u=>_h(u)===e.entityId);return r.length>0?r:[nh(e)]}return[]}function nh(e){const i=me(e.detail),a=e.subtype==="server.collaboration.message_staged"&&e.phase==="result"?e.status==="failed"?"server.collaboration.message_rejected":Ee(i.messageId)?"server.collaboration.message_sent":e.subtype:e.subtype;return{id:e.entityId??e.id,turnId:e.turnId,seq:e.sequence,event:e.entityType==="codex_item"?"codex.notification":a,data:e.detail,createdAt:e.updatedAt||e.createdAt}}function $N(e,i){const a=i.id===void 0?null:String(i.id),r=_h(i);return e.some(u=>a!==null&&u.entityType==="event"&&u.entityId===a||r!==null&&u.entityType==="codex_item"&&u.entityId===r)}function _h(e){if(e.event!=="codex.notification")return null;const i=me(e.data),a=me(i.params),r=me(a.item);return Ee(r.id)||Ee(a.itemId)||null}function GN(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function VN(e,i){var r,u;const a=me(e.detail);return{id:e.id,kind:e.status==="failed"?"error":"activity",title:e.subtype==="input:collaboration_notice"?Kp(a,i).title:e.title||ww(e.subtype),body:e.subtype==="input:collaboration_notice"?Kp(a,i).detail:((r=e.summary)==null?void 0:r.trim())||((u=e.contentMarkdown)==null?void 0:u.trim())||hw(a),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function Qv(e,i,a){const r=[],u=new Map,c=new Map,d=new Map;for(const p of e){if(p.event==="server.workspace_change.decision"||p.event==="server.responsibility.decision"){PN(r,p);continue}if(p.event==="server.knowledge.decision"){WN(r,p);continue}if(Jv(p)){ZN(r);continue}if(p.event==="server.steer"){const E=me(p.data),R=typeof E.message=="string"?E.message.trim():"";r.push({id:`steer-${p.id}`,type:"steerMarker",createdAt:p.createdAt??new Date().toISOString(),content:R||"Additional input",messageId:typeof E.messageId=="string"?E.messageId:void 0});continue}const g=mR(p.data);g!=null&&g.itemId&&d.set(g.itemId,g.phase);const m=hR(p.data);if(m!=null&&m.text){const E=m.itemId?d.get(m.itemId)??m.phase:m.phase,R=m.itemId??`phase:${E}`,$=`${u.get(R)??""}${m.text}`,M=lw($),H=c.get(R)??"",q=M.startsWith(H)?M.slice(H.length):M;if(u.set(R,$),c.set(R,M),q){const F=r[r.length-1];(F==null?void 0:F.type)==="assistantText"&&XN(F,m.itemId,E)?(F.content+=q,F.itemId=F.itemId??m.itemId,F.streamKey=F.streamKey??R,F.streaming=i):r.push({id:`assistant-event-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:q,phase:E,itemId:m.itemId,streamKey:R,streaming:i})}continue}const b=gR(p.data);if(b!=null&&b.text){const E=jr(b.text),R=b.itemId??`phase:${b.phase}`,$=QN(r,b.itemId,b.phase);if($>=0){const M=r[$];M.type==="assistantText"&&(E?(M.content=E,M.phase=b.phase,M.itemId=M.itemId??b.itemId,M.streamKey=M.streamKey??R,M.streaming=!1,YN(r,$,b.itemId)):r.splice($,1))}else E&&r.push({id:`assistant-completed-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:E,phase:b.phase,itemId:b.itemId,streamKey:R,streaming:!1});continue}const x=HD(p,a);if(x){x.rawEvents=[p];const E=Kx(r,x);if(E>=0){Xx(r[E],x);continue}if(Oh(x)&&Mh(r,x)||x.kind==="command"&&x.meta==="running"&&rd(x.body))continue;r.push({id:`tool-${x.id}`,type:"tool",createdAt:x.createdAt,tool:x});continue}const S=$D(p);if(S){S.rawEvents=[p];const E=Kx(r,S);if(E>=0){Xx(r[E],S);continue}r.push({id:`tool-${S.id}`,type:"tool",createdAt:S.createdAt,tool:S});continue}if(zE(p)){FN(r,p);continue}const w=GD(p);w&&(w.rawEvents=[p],r.push({id:`tool-${w.id}`,type:"tool",createdAt:w.createdAt,tool:w}))}return ld(r)}function FN(e,i){const a=_h(i);if(a)for(let r=e.length-1;r>=0;r-=1){const u=e[r];if(!(u.type!=="tool"||u.tool.itemId!==a)){u.tool={...u.tool,rawEvents:ew(u.tool.rawEvents,[i])};return}}}function YN(e,i,a){if(a)for(let r=e.length-1;r>i;r-=1){const u=e[r];u.type==="assistantText"&&u.itemId===a&&e.splice(r,1)}}function PN(e,i){const a=me(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=me(a.payload),d=Ee(c.content)||(typeof a.responsibility=="string"?a.responsibility:void 0);if(!(!r||u!=="accept"&&u!=="decline"))for(let p=e.length-1;p>=0;p-=1){const g=e[p];if(g.type==="tool"&&(g.tool.kind==="responsibility"||g.tool.kind==="workspaceChange")&&(g.tool.workspaceChangeProposalId===r||g.tool.responsibilityProposalId===r)){const m=nA(g.tool.meta,u);g.tool={...g.tool,title:m==="saved"?"Workspace change applied":"Workspace change declined",meta:m,body:m==="saved"?d??g.tool.body:g.tool.body,workspaceChangePayload:m==="saved"&&Object.keys(c).length>0?c:g.tool.workspaceChangePayload};return}}}function WN(e,i){const a=me(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=me(a.knowledge);if(!(!r||u!=="accept"&&u!=="decline"))for(let d=e.length-1;d>=0;d-=1){const p=e[d];if(p.type==="tool"&&p.tool.kind==="knowledge"&&p.tool.knowledgeProposalId===r){p.tool={...p.tool,title:u==="accept"?"Knowledge saved":"Knowledge proposal declined",meta:u==="accept"?"saved":"declined",body:u==="accept"&&Object.keys(c).length>0?JSON.stringify(c,null,2):p.tool.body};return}}}function Mh(e,i){const a=Zv(i);if(typeof a!="number")return!1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Wx(d,i))continue;const p=jr(d.content);p!==d.content&&(e[c]={...d,content:p})}let r=0,u=-1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Wx(d,i))continue;u=c;const p=r,g=p+d.content.length;if(r=g,a>=g)continue;const m=Math.max(0,Math.min(d.content.length,a-p)),b=d.content.slice(0,m).trimEnd(),x=d.content.slice(m).trimStart(),S=[];return b&&S.push({...d,id:`${d.id}:before-tool-${i.id}`,content:b,pinnedToResult:!0}),S.push({id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),x&&S.push({...d,id:`${d.id}:after-tool-${i.id}`,content:x,pinnedToResult:!0}),e.splice(c,1,...S),!0}if(u>=0&&a>=r){const c=e[u];return(c==null?void 0:c.type)==="assistantText"&&(e[u]={...c,pinnedToResult:!0}),e.splice(u+1,0,{id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),!0}return!1}function Wx(e,i){return!i.anchorStreamKey||e.streamKey===i.anchorStreamKey}function ld(e){const i=[],a=[];for(const c of e){if(c.type==="tool"&&Oh(c.tool)){i.push(c.tool);continue}a.push(c)}const r=[...a],u=[];for(const c of i)Mh(r,c)||u.push({id:`tool-${c.id}`,type:"tool",createdAt:c.createdAt,tool:c});return KN([...u,...r])}function Oh(e){return typeof Zv(e)=="number"}function Zv(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function KN(e){const i=[];for(let a=0;a<e.length;a+=1){const r=e[a],u=e[a+1];if((r==null?void 0:r.type)==="tool"&&r.tool.kind==="responsibility"&&typeof r.tool.responsibilityAnchorOffset!="number"&&(u==null?void 0:u.type)==="assistantText"){i.push({...u,pinnedToResult:!0}),i.push(r),a+=1;continue}i.push(r)}return i}function XN(e,i,a){return e.type!=="assistantText"?!1:e.itemId&&i?e.itemId===i:e.itemId||i?!1:e.phase===a}function QN(e,i,a){if(i){const r=e.findIndex(u=>u.type==="assistantText"&&u.itemId===i);if(r>=0)return r}for(let r=e.length-1;r>=0;r-=1){const u=e[r];if(u.type==="assistantText"&&u.streaming&&(!i||!u.itemId)&&(u.phase===a||u.phase==="unknown"||a==="unknown"))return r}return-1}function Jv(e){return e.event==="server.stop"||e.event==="server.stopped"}function ZN(e){for(const i of e)i.type==="tool"&&i.tool.kind==="command"&&i.tool.meta==="running"&&(i.tool={...i.tool,title:"Command stopped",meta:"stopped"})}function JN(e){for(let i=e.length-1;i>=0;i-=1){const a=e[i];if(a.event!=="server.notification.failed")continue;const r=me(a.data);return typeof r.message=="string"?r.message:"Notification failed"}return null}function e2(e){for(let i=e.length-1;i>=0;i-=1){const a=kw(e[i]);if(a)return a}return null}function Kx(e,i){for(let a=e.length-1;a>=0;a-=1){const r=e[a];if(r.type==="tool"&&r.tool.kind===i.kind&&(i.itemId&&r.tool.itemId===i.itemId||r.tool.body===i.body&&r.tool.meta==="running"))return a}return-1}function Xx(e,i){if(e.type!=="tool")return;const a=e.tool.kind==="command"&&e.tool.meta!=="running"&&i.meta==="running",r=e.tool.kind==="command"&&i.kind==="command"&&rd(i.body)&&!rd(e.tool.body);e.tool={...e.tool,...i,id:e.tool.id,createdAt:e.tool.createdAt,title:a?e.tool.title:i.title,body:r?e.tool.body:i.body,meta:a?e.tool.meta:i.meta,output:iR(e.tool.output,i.output),topicRecipientLabel:i.topicRecipientLabel??e.tool.topicRecipientLabel,topicMessageContent:i.topicMessageContent??e.tool.topicMessageContent,rawEvents:ew(e.tool.rawEvents,i.rawEvents)}}function ew(e,i){const a=[...e??[],...i??[]];if(a.length===0)return;const r=new Set;return a.filter(u=>{const c=Ba(u);return r.has(c)?!1:(r.add(c),!0)})}function Qo(e){return{id:`message-${e.id}`,type:"message",createdAt:e.createdAt,message:e}}function Ap(e,i){const a=new Set,r=[...e,...i].filter(u=>a.has(u.id)?!1:(a.add(u.id),!0));return r.filter(u=>tw(u)?!r.some(c=>t2(c,u)):!0)}function Np(e,i){const a=new Map;for(const r of[...e,...i])a.set(r.id,r);return[...a.values()].sort((r,u)=>Date.parse(r.startedAt)-Date.parse(u.startedAt))}function Dp(e,i){const a=new Map;for(const r of[...e,...i])a.set(r.id,r);return[...a.values()].sort((r,u)=>r.timelineAt.localeCompare(u.timelineAt)||r.sequence-u.sequence)}function tw(e){return e.id.startsWith("local-")}function t2(e,i){if(tw(e)||e.role!==i.role||e.content.trim()!==i.content.trim())return!1;const a=Date.parse(e.createdAt),r=Date.parse(i.createdAt);return Number.isNaN(a)||Number.isNaN(r)?!1:Math.abs(a-r)<=12e4}function Fc(e,i){const a=new Map,r=new Map;for(const c of[...e,...i]){const d=Ba(c);r.has(d)||r.set(d,r.size),a.set(d,c)}return[...a.values()].sort((c,d)=>{const p=nw(c,d);return p!==0?p:(r.get(Ba(c))??0)-(r.get(Ba(d))??0)})}function Qx(e,i){const a=Ba(i),r=e.findIndex(c=>Ba(c)===a);if(r<0)return[...e,i];if(n2(e[r],i))return e;const u=[...e];return u[r]=i,u}function n2(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 Ba(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function cu(e,i){const a=nw(e,i);return a!==0?a:i2(e.id,i.id)}function nw(e,i){if(e.turnId&&i.turnId&&e.turnId===i.turnId&&typeof e.seq=="number"&&typeof i.seq=="number"&&e.seq!==i.seq)return e.seq-i.seq;const a=Date.parse(e.createdAt??""),r=Date.parse(i.createdAt??"");return!Number.isNaN(a)&&!Number.isNaN(r)&&a!==r?a-r:Number.isNaN(a)!==Number.isNaN(r)?Number.isNaN(a)?1:-1:0}function i2(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 Zx(e,i){const a=me(e.data);return typeof a.__seq=="number"&&typeof a.__createdAt=="string"&&Object.prototype.hasOwnProperty.call(a,"payload")?{id:typeof a.__eventId=="string"?a.__eventId:`stream:${a.__turnId??"unknown"}:${a.__seq}`,turnId:typeof a.__turnId=="string"?a.__turnId:null,seq:a.__seq,event:e.event,data:a.payload,createdAt:a.__createdAt}:{id:i,turnId:e.turnId??null,event:e.event,data:e.data,createdAt:e.createdAt??new Date().toISOString()}}const iu=D.memo(function({content:i,conversation:a,streaming:r,onPreviewArtifact:u,onCopyArtifactUrl:c,copiedArtifactUrl:d}){const p=r?lw(i):jr(i),g=a&&!r?d2(p,a):[];return s.jsxs(s.Fragment,{children:[r?s.jsx(r2,{content:p,conversation:a}):Rl(p,a),g.length>0?s.jsx("div",{className:"artifact-preview-list",children:g.map(m=>s.jsx(c2,{artifact:m,onPreview:u,onCopyUrl:c,copied:d===m.url},m.id))}):null]})},a2);function a2(e,i){var a,r,u,c;return e.content===i.content&&e.streaming===i.streaming&&e.copiedArtifactUrl===i.copiedArtifactUrl&&((a=e.conversation)==null?void 0:a.id)===((r=i.conversation)==null?void 0:r.id)&&((u=e.conversation)==null?void 0:u.workspacePath)===((c=i.conversation)==null?void 0:c.workspacePath)}function Jx({content:e}){return s.jsx("div",{className:"plain-message-content",children:e})}const l2=2;function r2({content:e,conversation:i}){const a=D.useRef(null),[r,u]=D.useState(null),{committedBlocks:c,activeBlock:d}=s2(e);return D.useLayoutEffect(()=>{const p=a.current;if(!p)return;const g=parseFloat(window.getComputedStyle(p).lineHeight)||28,m=p.scrollHeight;u(b=>{const x=g*l2,S=Math.min(m,x);return b!==null&&S<=b?b:S})},[e]),s.jsxs("div",{className:"streaming-message-content",ref:a,style:r===null?void 0:{minHeight:r},children:[c.map((p,g)=>s.jsx(D.Fragment,{children:Rl(p,i)},`${g}:${p.length}`)),d?s.jsx("p",{className:"streaming-active-line",children:d}):null]})}function s2(e){const i=u2(e),a=i>0?e.slice(0,i):"",r=e.slice(i);return{committedBlocks:o2(a),activeBlock:r}}function o2(e){const i=[];let a=0,r=!1,u=!1;const c=e.match(/[^\n]*(?:\n|$)/g)??[];let d=0;for(const p of c){if(!p)continue;const g=p.trim(),m=d;if(d+=p.length,/^\s*(```|~~~)/.test(p)){r=!r,r||(Yc(i,e.slice(a,d)),a=d);continue}if(r)continue;if(/^\s*\|.*\|\s*$/.test(p)||/^\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(p)){u=!0;continue}u&&(Yc(i,e.slice(a,m)),a=m,u=!1),g===""&&(Yc(i,e.slice(a,d)),a=d)}return a<e.length&&Yc(i,e.slice(a)),i}function Yc(e,i){i.trim()&&e.push(i)}function u2(e){const i=e.lastIndexOf(`
109
+ `);if(i<0)return 0;const a=[0];for(let u=0;u<e.length;u+=1)e[u]===`
110
+ `&&u+1<e.length&&a.push(u+1);let r=-1;for(const u of a){const c=e.indexOf(`
111
+ `,u),d=e.slice(u,c===-1?e.length:c);/^\s*(```|~~~)/.test(d)&&(r=r===-1?u:-1)}return r>=0?r:i+1}function c2({artifact:e,onPreview:i,onCopyUrl:a,copied:r}){return e?s.jsxs("figure",{className:"artifact-preview",children:[s.jsx("button",{className:"artifact-preview-media",onClick:()=>i(e),type:"button",children:s.jsx("img",{alt:e.name,src:e.url})}),s.jsxs("figcaption",{children:[s.jsx("span",{children:e.name}),s.jsxs("div",{className:"artifact-preview-actions",children:[s.jsx("button",{onClick:()=>i(e),type:"button",children:"Preview"}),s.jsx("a",{href:e.url,rel:"noreferrer",target:"_blank",children:"Open"}),s.jsx("button",{onClick:()=>a(e),type:"button",children:r?"Copied":"Copy"})]})]})]}):null}function d2(e,i){const a=new Map;for(const r of f2(e)){const u=iw(r);if(u){const c=aw(u).toLowerCase(),d=a.get(c);(!d||m2(u,d))&&a.set(c,u)}}return Array.from(a.values()).map(r=>p2(r,i)).filter(r=>r!==null)}function f2(e){const i=[],a=/!\[[^\]]*]\(([^)]+)\)/g,r=/\[[^\]]+]\(([^)]+)\)/g,u=/(?:artifact|preview|image|file)\s*:\s*(`?[^`\n]+?\.(?:svg|png|jpe?g|webp|gif)`?)/gim;for(const c of[a,r,u]){let d;for(;(d=c.exec(e))!==null;)i.push(d[1])}return i}function p2(e,i){const a=iw(e);if(!a||!h2(a))return null;const r=zv(a,i.workspacePath);return{id:`${i.id}:${r}`,path:r,name:aw(r),url:ye(`conversations/${i.id}/files?path=${encodeURIComponent(r)}`)}}function iw(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return i||null}function h2(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function aw(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function m2(e,i){return e.startsWith("/")&&!i.startsWith("/")?!0:e.length>i.length}function jr(e){return e.trim()}function lw(e){return e.trim()}function eb(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function g2(e){return{a({children:i,href:a}){if(!a)return s.jsx(s.Fragment,{children:i});const r=/^[a-z][a-z\d+.-]*:/i.test(a),u=!r&&e?y2(a,e):null,c=u??a,d=r||!!u;return s.jsx("a",{className:"markdown-link",href:c,rel:d?"noreferrer":void 0,target:d?"_blank":void 0,children:i})},img(){return null},pre({children:i}){const a=b2(i);return a?zh(a.language)==="mermaid"?s.jsx(v2,{code:a.code}):s.jsx(S2,{code:a.code,language:a.language}):s.jsx("pre",{children:i})},table({children:i}){return s.jsx("div",{className:"markdown-table-wrap",children:s.jsx("table",{className:"markdown-table",children:i})})},td({align:i,children:a}){return s.jsx("td",{style:tb(i),children:a})},th({align:i,children:a}){return s.jsx("th",{style:tb(i),children:a})}}}function y2(e,i){if(!e||e.startsWith("#")||e.startsWith("/api/")||e.startsWith("?"))return null;const a=lA(e,i.workspacePath);if(!a)return null;const r=a.line?`#L${a.line}${a.column?`C${a.column}`:""}`:"";return`${ye(`conversations/${i.id}/files?path=${encodeURIComponent(a.path)}`)}${r}`}function tb(e){return e&&e!=="char"?{textAlign:e}:void 0}function Rl(e,i){const a=x2(e);return s.jsx(pC,{components:g2(i),remarkPlugins:[TE],skipHtml:!0,children:a})}function x2(e){return e.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
112
+ $2`)}function b2(e){var c;const i=D.Children.toArray(e),a=i.length===1&&D.isValidElement(i[0])?i[0]:null;if(!a||a.type!=="code")return null;const u=((c=(a.props.className??"").match(/(?:^|\s)language-([^\s]+)/))==null?void 0:c[1])??"";return{code:ih(a.props.children).replace(/\n$/,""),language:u}}function ih(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(ih).join(""):D.isValidElement(e)?ih(e.props.children):""}const rw="github-light",Rp=new Map,_p=new Map;let Mp=null,Op=null;const sw=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function zh(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 ow(e){const i=zh(e);return!i||i==="text"||i==="txt"?"text":sw.has(i)?i:"text"}function v2({code:e}){const a=`seele-mermaid-${D.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[r,u]=D.useState(!1),[c,d]=D.useState(()=>_p.get(e)??null),[p,g]=D.useState(null);D.useEffect(()=>{let b=!1,x;const S=_p.get(e);return S?(d(S),g(null),()=>{b=!0}):(g(null),d(null),w2(a,e).then(w=>{b||(x!==void 0&&window.clearTimeout(x),_p.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)},gA)}}),()=>{b=!0,x!==void 0&&window.clearTimeout(x)})},[e,a]);async function m(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:`mermaid-block${p?" error":""}`,children:[s.jsx("span",{className:"code-block-kind",children:"mermaid"}),s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied Mermaid source":"Copy Mermaid source",className:r?"copied":"",onClick:()=>void m(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Lh,{})})}),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 w2(e,i){return(await(await k2()).render(e,i)).svg}function k2(){return Op||(Op=Tt(()=>import("./mermaid.core-72tyvrGd.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})),Op}function S2({code:e,language:i,reserveHeight:a=!1}){const[r,u]=D.useState(!1),[c,d]=D.useState(()=>{if(!ab(i))return null;const m=ib(e,i);return Rp.get(m)??null}),p=a?{"--code-block-min-height":`${EA(e)}px`}:void 0;D.useEffect(()=>{let m=!1;if(!ab(i))return d(null),()=>{m=!0};const b=ib(e,i),x=Rp.get(b);return x?(d(x),()=>{m=!0}):(d(null),R2(e,i).then(S=>{Rp.set(b,S),m||d(S)}).catch(S=>{console.warn("Failed to highlight code block",S),m||d(null)}),()=>{m=!0})},[e,i]);async function 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(Lh,{})})}),c?s.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:c}}):s.jsx("pre",{children:s.jsx("code",{children:e})})]})}function Lh(){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 j2(){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 uw(){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 C2(){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 T2(){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 nb(){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 E2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("rect",{height:"16",rx:"2.6",stroke:"currentColor",strokeWidth:"1.8",width:"18",x:"3",y:"4"}),s.jsx("path",{d:"m7 9 3 3-3 3M12.5 15h4.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.9"})]})}function Qc(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"17",viewBox:"0 0 24 24",width:"17",children:[s.jsx("circle",{cx:"7",cy:"12",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"7",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"17",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("path",{d:"m9.2 10.9 5.6-2.8M9.2 13.1l5.6 2.8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function hd(){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 A2(){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 N2(){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 D2(){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 ib(e,i){return`${rw}:${ow(i)}:${e}`}function ab(e){const i=zh(e);return!!i&&sw.has(i)}async function R2(e,i){return(await _2()).codeToHtml(e,{lang:ow(i),theme:rw})}function _2(){return Mp||(Mp=M2()),Mp}async function M2(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:i},{default:a},{default:r},{default:u},{default:c},{default:d},{default:p},{default:g},{default:m},{default:b},{default:x},{default:S},{default:w},{default:E},{default:R},{default:$},{default:M},{default:H},{default:q},{default:F},{default:ie}]=await Promise.all([Tt(()=>import("./core-BF5llM8f.js"),[],import.meta.url),Tt(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),Tt(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),Tt(()=>import("./bash-BELqPA7S.js").then(N=>N.b),[],import.meta.url),Tt(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),Tt(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),Tt(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),Tt(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),Tt(()=>import("./java-CylS5w8V.js"),[],import.meta.url),Tt(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),Tt(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),Tt(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),Tt(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),Tt(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),Tt(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),Tt(()=>import("./bash-BELqPA7S.js").then(N=>N.s),[],import.meta.url),Tt(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),Tt(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),Tt(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),Tt(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),Tt(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),Tt(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:i(),themes:[a],langs:[r,u,c,d,p,g,m,b,x,S,w,E,R,$,M,H,q,F,ie]})}async function lb(){const e=ye("conversations"),i=await fetch(e);return await Ae(i,{url:e}),(await i.json()).conversations}async function O2(){const e=ye("workspace-states"),i=await fetch(e);return await Ae(i,{url:e}),(await i.json()).workspaces}async function rb(){const e=ye("collaboration/topics"),i=await fetch(e);return await Ae(i,{url:e}),(await i.json()).topics}async function Pc(e){const i=ye(`collaboration/topics/${e}/messages?limit=100`),a=await fetch(i);return await Ae(a,{url:i}),(await a.json()).messages}async function z2(e){const i=ye("collaboration/topics"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ae(a,{method:"POST",url:i}),(await a.json()).topic}async function L2(e,i){const a=ye(`collaboration/topics/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Ae(r,{method:"PATCH",url:a}),(await r.json()).topic}async function I2(e,i){const a=ye(`collaboration/topics/${e}/archive`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:i})});return await Ae(r,{method:"POST",url:a}),(await r.json()).topic}async function U2(e){const i=ye(`conversations/${e}/read`),a=await fetch(i,{method:"POST"});await Ae(a,{method:"POST",url:i})}async function sb(){const e=ye("workspace-groups"),i=await fetch(e);return await Ae(i,{url:e}),(await i.json()).groups}async function B2(e){const i=ye("workspace-groups"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await Ae(a,{method:"POST",url:i}),(await a.json()).group}async function q2(e,i){const a=ye(`workspace-groups/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Ae(r,{method:"PATCH",url:a}),(await r.json()).group}async function H2(e){const i=ye(`workspace-groups/${e}`),a=await fetch(i,{method:"DELETE"});return await Ae(a,{method:"DELETE",url:i}),await a.json()}async function $2(){const e=ye("settings/environment"),i=await fetch(e);return await Ae(i,{url:e}),(await i.json()).variables}async function G2(e){const i=ye(`conversations/${e}/settings/environment`),a=await fetch(i);return await Ae(a,{url:i}),(await a.json()).variables}async function V2(e){const i=ye(`conversations/${e}/knowledge`),a=await fetch(i);return await Ae(a,{url:i}),(await a.json()).items}async function F2(){const e=ye("settings/runtime"),i=await fetch(e);return await Ae(i,{url:e}),(await i.json()).settings}async function Y2(){const e=ye("settings/deployment"),i=await fetch(e);return await Ae(i,{url:e}),(await i.json()).settings}async function P2(){const e=ye("diagnostics"),i=await fetch(e);return await Ae(i,{url:e}),await i.json()}async function W2(){const e=ye("settings/runtime/codex"),i=await fetch(e);return await Ae(i,{url:e}),await i.json()}async function ob(){const e=ye("settings/runtime/accounts"),i=await fetch(e);await Ae(i,{url:e});const a=await i.json();return Tr(),a}async function ub(e=!1){const i=ye(`settings/runtime/accounts/refresh${e?"?force=1":""}`),a=await fetch(i,{method:"POST"});await Ae(a,{method:"POST",url:i});const r=await a.json();return Tr(),r}async function K2(e){const i=ye("settings/runtime/accounts"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});await Ae(a,{method:"POST",url:i});const r=await a.json();return r.login.status==="succeeded"&&Tr(),r.login}async function X2(e){const i=ye(`settings/runtime/accounts/login/${e}`),a=await fetch(i);return await Ae(a,{url:i}),(await a.json()).login}async function Q2(e){const i=ye(`settings/runtime/accounts/login/${e}/cancel`),a=await fetch(i,{method:"POST"});return await Ae(a,{method:"POST",url:i}),(await a.json()).login}async function Z2(e,i){const a=ye(`settings/runtime/accounts/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});await Ae(r,{method:"PATCH",url:a});const u=await r.json();return Tr(),u.account}async function J2(e){const i=ye(`settings/runtime/accounts/${e}`),a=await fetch(i,{method:"DELETE"});await Ae(a,{method:"DELETE",url:i}),Tr()}async function eD(e){const i=ye(`settings/runtime/accounts/${e}/switch`),a=await fetch(i,{method:"POST"});await Ae(a,{method:"POST",url:i});const r=await a.json();return Tr(),r}async function tD(e=!0){const i=ye(`settings/runtime/models?refresh=${e?"1":"0"}`),a=await fetch(i);return await Ae(a,{url:i}),await a.json()}async function nD(e=!1){const i=ye(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),a=await fetch(i);return await Ae(a,{url:i}),await a.json()}async function iD(){const e=ye("settings/runtime/codex/update"),i=await fetch(e,{method:"POST"});return await Ae(i,{method:"POST",url:e}),(await i.json()).job}async function aD(e){const i=ye(`conversations/${e}/settings/runtime`),a=await fetch(i);return await Ae(a,{url:i}),(await a.json()).settings}async function lD(){const e=ye("settings/memory"),i=await fetch(e);return await Ae(i,{url:e}),await i.json()}async function rD(e){const i=ye("settings/runtime"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ae(a,{method:"PUT",url:i}),(await a.json()).settings}async function sD(e){const i=ye("settings/deployment"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ae(a,{method:"PUT",url:i}),(await a.json()).settings}async function cb(e,i){const a=ye(`conversations/${e}/settings/runtime`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Ae(r,{method:"PUT",url:a}),await r.json()}async function db(e,i){const a=ye(`conversations/${e}/runtime/reset`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Ae(r,{method:"POST",url:a});const u=(await r.json()).job;return dw(e,u)}async function cw(e){const i=ye(`conversations/${e}/runtime/reset`),a=await fetch(i);return await Ae(a,{url:i}),(await a.json()).job}async function dw(e,i){let a=i;const r=Date.now()+1800*1e3;for(;a.status==="running";){if(Date.now()>=r)throw new Error("Full-history reset is still running after 30 minutes. Reopen Console to check the workspace before retrying.");await new Promise(c=>window.setTimeout(c,1e3));const u=await cw(e);if(!u||u.id!==a.id)throw new Error("The runtime reset job is no longer available.");a=u}if(a.status==="failed"||a.status==="cancelled"||!a.result)throw new Error(a.error??"Full-history reset failed.");return a.result}async function fb(e){const i=ye(`conversations/${e}/runtime/reset-preview`),a=await fetch(i);return await Ae(a,{url:i}),await a.json()}async function oD(e,i){const a=ye(`conversations/${e}/runtime/reset-selection`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Ae(r,{method:"PUT",url:a})}async function uD(e){const i=ye(`conversations/${e}/runtime/thread-read`),a=await fetch(i);return await Ae(a,{url:i}),(await a.json()).result}async function cD(e){const i=ye(`conversations/${e}/runtime/token-usage`),a=await fetch(i);await Ae(a,{url:i});const r=await a.json();return r.event?Sw(r.event):null}async function dD(e){const i=ye(`conversations/${e}/runtime/additional-context`),a=await fetch(i);return await Ae(a,{url:i}),await a.json()}async function fD(e){const i=ye(`conversations/${e}/runtime/compactions`),a=await fetch(i);return await Ae(a,{url:i}),(await a.json()).compactions}function pD(e,i,a){return{model:e.model===i.model?null:e.model,reasoningEffort:FE(e.reasoningEffort,i.reasoningEffort,(a==null?void 0:a.sources.reasoningEffort)==="workspace"),fastMode:e.fastMode===i.fastMode?null:e.fastMode,sandbox:e.sandbox===i.sandbox?null:e.sandbox}}function hD(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:gD(e.sourceCluesText),requiredEnv:yD(e.requiredEnvText)}}function mD(e){return{id:e.id,kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceCluesText:e.sourceClues.map(i=>`${i.type}: ${i.value}`).join(`
113
+ `),requiredEnvText:e.fetch.requiredEnv.map(i=>i.description?`${i.key} - ${i.description}`:i.key).join(`
114
+ `)}}function gD(e){const i=new Date().toISOString();return e.split(/\r?\n/).map(a=>a.trim()).filter(Boolean).map(a=>{const r=a.match(/^([a-zA-Z][\w-]{0,31})\s*:\s*(.+)$/);return{type:r?r[1].toLowerCase():"text",value:r?r[2].trim():a,providedBy:"user",providedAt:i}})}function yD(e){return e.split(/\r?\n/).map(i=>i.trim()).filter(Boolean).map(i=>{const[a,...r]=i.split(/\s+-\s+/);return{key:a.trim().toUpperCase(),description:r.join(" - ").trim()}}).filter(i=>/^[A-Z_][A-Z0-9_]*$/.test(i.key))}function pb(e,i){const a=hb(i.attention)-hb(e.attention);return a!==0?a:i.updatedAt.localeCompare(e.updatedAt)}function hb(e){return e==="watch"?2:e==="tracked"?1:0}function du(e){return e.map(i=>({key:i.key??"",value:i.value??"",updatedAt:i.updatedAt}))}function xD(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 bD(e){return du(e).filter(i=>i.key.trim()&&i.value.trim()).map(i=>`${i.key.trim()}: ${i.value.trim()}`).join(`
115
+ `)}async function vD(e){const i=ye("settings/memory"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ae(a,{method:"PUT",url:i}),await a.json()}async function wD(e,i,a){const r=ye("settings/environment"),u=await fetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,key:e,value:i})});return await Ae(u,{method:"PUT",url:r}),(await u.json()).variable}async function kD(e,i,a,r){const u=ye(`conversations/${e}/settings/environment`),c=await fetch(u,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:r,key:i,value:a})});return await Ae(c,{method:"PUT",url:u}),await c.json()}async function SD(e){const i=ye(`settings/environment/${encodeURIComponent(e)}/reveal`),a=await fetch(i);return await Ae(a,{url:i}),(await a.json()).variable.value}async function jD(e,i){const a=ye(`conversations/${e}/settings/environment/${encodeURIComponent(i)}/reveal`),r=await fetch(a);return await Ae(r,{url:a}),(await r.json()).variable.value}async function CD(e){const i=ye(`settings/environment/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});await Ae(a,{method:"DELETE",url:i})}async function TD(e,i){const a=ye(`conversations/${e}/settings/environment/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});return await Ae(r,{method:"DELETE",url:a}),(await r.json()).conversation}async function ED(e,i){const a=ye(`conversations/${e}/knowledge`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Ae(r,{method:"POST",url:a}),(await r.json()).item}async function AD(e,i,a){const r=ye(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),u=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});return await Ae(u,{method:"PATCH",url:r}),(await u.json()).item}async function ND(e,i){const a=ye(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});await Ae(r,{method:"DELETE",url:a})}async function DD(){const e=ye("meta"),i=await fetch(e);return await Ae(i,{url:e}),await i.json()}async function RD(e){const i=ye(`settings/runtime/rate-limits?refresh=${e?"1":"0"}`),a=await fetch(i);return await Ae(a,{url:i}),(await a.json()).usage??null}async function _D(e,i){const a=ye("conversations"),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:i})});return await Ae(r,{method:"POST",url:a}),(await r.json()).conversation}async function MD(e){const i=ye(`conversations/${e}/complex-task`),a=await fetch(i);return await Ae(a,{url:i}),(await a.json()).task}async function OD(e,i){const a=ye(`conversations/${e}/complex-tasks/${encodeURIComponent(i)}`),r=await fetch(a);return await Ae(r,{url:a}),(await r.json()).task}async function zD(e,i){const a=ye(`conversations/${e}/complex-task/${i}`),r=await fetch(a,{method:"POST"});return await Ae(r,{method:"POST",url:a}),(await r.json()).task}async function LD(e,i,a){const r=ye(`conversations/${e}/clone`),u=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,groupId:a})});return await Ae(u,{method:"POST",url:r}),await u.json()}async function ID(e){const i=ye(`conversations/${e}/clone/retry`),a=await fetch(i,{method:"POST"});return await Ae(a,{method:"POST",url:i}),await a.json()}async function zp(e,i={}){const a=new URLSearchParams;a.set("limit",String(i.limit??Lv)),i.before&&a.set("before",i.before);const r=ye(`conversations/${e}?${a}`),u=await fetch(r);return await Ae(u,{url:r}),(await u.json()).conversation}async function UD(e,i){const a=ye(`conversations/${e}/turns/${i}/history-events`),r=await fetch(a);return await Ae(r,{url:a}),(await r.json()).events}async function Wc(e,i){const a=ye(`conversations/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Ae(r,{method:"PATCH",url:a}),(await r.json()).conversation}async function BD(e){const i=ye(`conversations/${e}`),a=await fetch(i,{method:"DELETE"});await Ae(a,{method:"DELETE",url:i})}function qD(e){return e.title==="Phase boundary recommended"||e.title==="Long run in progress"}function fw(e){return e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} +${e.length-3}`}function HD(e,i){if(e.event==="server.error"||e.event==="client.error")return{id:e.id,kind:"error",title:"Error",body:oR(e.data),createdAt:e.createdAt??new Date().toISOString()};if(e.event==="server.collaboration.message_staged"||e.event==="server.collaboration.message_sent"||e.event==="server.collaboration.message_rejected"){const c=me(e.data),d=Ee(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=Ee(c.audience),x=Ee(c.recipientWorkspaceId),S=x?[x]:Array.isArray(c.recipientWorkspaceIds)?c.recipientWorkspaceIds.filter($=>typeof $=="string"):Array.isArray(c.recipients)?c.recipients.filter($=>typeof $=="string"):[],w=S.filter($=>$!=="ALL").map($=>i.get($)).filter($=>!!$);let E="Topic";w.length>0?E=fw(w):S.length===1?E=S[0]==="ALL"?"Topic participants":Ml(S[0]):S.length>1?E=`${S.length} workspaces`:b==="public"||b==="all"?E="Topic participants":b==="owner"&&(E="Topic owner");const R=Ee(c.topicId);return{id:e.id,kind:"collaboration",title:`Send to ${E}`,body:R?`Topic ${Ml(R)}`:"Topic",createdAt:e.createdAt??new Date().toISOString(),itemId:d||`legacy-topic-message:${p}`,meta:g?"pending send":m?"done":"failed",output:g||m?Ee(c.contentMarkdown)||void 0:Ee(c.reason)||void 0,topicAction:"send",topicRecipientLabel:E,topicMessageContent:(g||m)&&Ee(c.contentMarkdown)||void 0}}}if(e.event==="codex.input_request"||e.event==="codex.input_or_approval_request"){const c=me(e.data);if(e.event==="codex.input_request"||c.method==="item/tool/requestUserInput"){const d=me(c.params),g=(Array.isArray(d.questions)?d.questions:[]).map(m=>{const b=me(m),x=typeof b.question=="string"?b.question:"Please provide the missing information.",S=Array.isArray(b.options)?b.options.map(w=>{const E=me(w);return typeof E.label=="string"?`- ${E.label}${typeof E.description=="string"?`: ${E.description}`:""}`:""}).filter(Boolean).join(`
116
+ `):"";return S?`${x}
117
+
118
+ ${S}`:x}).join(`
119
+
120
+ `);return{id:e.id,kind:"activity",title:"Seele needs input",body:g||"Please answer in the main input box to continue.",createdAt:e.createdAt??new Date().toISOString(),meta:"waiting for reply"}}}if(e.event==="server.agent_action.staged"){const c=me(e.data);if(Ee(c.actionType)==="seele_workspace_change"){const p=me(c.payload),g=me(p.payload),m=Ee(p.type)||"workspace";return{id:e.id,kind:"workspaceChange",title:"Preparing workspace change",body:xw(m,g),createdAt:e.createdAt??new Date().toISOString(),itemId:Ee(c.toolCallId)||void 0,meta:"pending turn",workspaceChangeType:m,workspaceChangePayload:g}}const d=UE(c);return{id:e.id,kind:"activity",title:d.title,body:d.detail,createdAt:e.createdAt??new Date().toISOString(),itemId:Ee(c.toolCallId)||void 0,meta:d.meta}}if(e.event==="server.workspace_inbox.offered"){const c=IE(e.data);return{id:e.id,kind:"activity",title:c.title,body:c.detail,createdAt:e.createdAt??new Date().toISOString(),meta:c.meta}}if(e.event==="codex.dynamic_tool_request"){const c=me(e.data),d=me(c.params),p=Ee(d.tool)||"dynamic tool",g=me(d.arguments);return{id:e.id,kind:p==="seele_topics"?"collaboration":p==="seele_workspace_change"?"workspaceChange":"activity",title:gw(p,!1,g),body:yw(p,g),createdAt:e.createdAt??new Date().toISOString(),itemId:Ee(d.callId)||void 0,meta:"running",topicAction:p==="seele_topics"?pw(g.action):void 0,workspaceChangeType:p==="seele_workspace_change"&&Ee(g.type)||void 0,workspaceChangePayload:p==="seele_workspace_change"?me(g.payload):void 0}}if(e.event==="server.workspace_change.proposed"||e.event==="server.responsibility.proposed"){const c=me(e.data),d=me(c.payload),p=Ee(d.content)||Ee(c.responsibility);return{id:e.id,kind:"workspaceChange",title:"Workspace change proposed",body:p,createdAt:e.createdAt??new Date().toISOString(),itemId:Ee(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:Ee(c.changeType)||"responsibility",workspaceChangePayload:Object.keys(d).length>0?d:{content:p}}}if(e.event==="server.knowledge.proposed"){const c=me(e.data),d=me(c.knowledge);return{id:e.id,kind:"knowledge",title:c.action==="update"?"Knowledge update proposed":"Knowledge creation proposed",body:JSON.stringify(d,null,2),createdAt:e.createdAt??new Date().toISOString(),meta:"pending",knowledgeProposalId:String(e.id),knowledgeAnchorOffset:typeof c.anchorOffset=="number"?c.anchorOffset:void 0}}if(e.event==="server.complex_task.plan_updated"){const c=me(e.data),d=me(c.task),p=me(d.currentPlan),g=me(c.update),m=Ee(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:Ee(d.id)||void 0,meta:b}}if(e.event==="server.complex_task.plan_update_failed"){const c=me(e.data);return{id:e.id,kind:"error",title:"Plan update failed",body:Ee(c.reason)||"The proposed Plan change could not be applied.",createdAt:e.createdAt??new Date().toISOString(),meta:"not applied"}}if(e.event==="runtime.command.started"||e.event==="runtime.command.completed"){const c=me(e.data),d=e.event==="runtime.command.completed",p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:d?p!==null&&p!==0?"Command failed":"Command completed":"Seele ran command",body:typeof c.command=="string"?Zc(c.command):"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?p!==null?`exit ${p}`:"done":"running",output:d&&typeof c.output=="string"&&c.output?c.output:void 0}}if(e.event==="runtime.compaction.started"||e.event==="runtime.compaction.completed"){const c=me(e.data),d=e.event==="runtime.compaction.completed";return{id:e.id,kind:"activity",title:d?"Context compacted":"Compacting context",body:ah(c,d),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?"done":"running"}}if(e.event==="codex.server_request"){const c=me(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=sR(c.requestId),p=me(c.params),g=typeof p.command=="string"?p.command:"command";return{id:e.id,kind:"command",title:"Command waiting for approval",body:g,createdAt:e.createdAt??new Date().toISOString(),itemId:typeof p.itemId=="string"?p.itemId:void 0,meta:"approval",approvalRequestId:d??void 0,approvalTurnId:typeof e.turnId=="string"?e.turnId:typeof p.turnId=="string"?p.turnId:void 0,approvalReason:typeof p.reason=="string"?p.reason:void 0}}}if(e.event!=="codex.notification")return null;const a=me(e.data),r=a.method,u=me(a.params);if(r==="item/started"){const c=me(u.item);if(c.type==="commandExecution"){const p=c.status==="inProgress"&&c.processId===null;return{id:e.id,kind:"command",title:p?"Command waiting for approval":"Seele ran command",body:Zc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p?"approval":"running"}}const d=Xp(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:Ee(c.id)||void 0,meta:"started",fileChanges:d}}if(r==="item/completed"){const c=me(u.item);if(c.type==="commandExecution"){const p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:p!==null&&p!==0?"Command failed":"Command completed",body:Zc(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=Xp(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:Ee(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 $D(e){if(e.event!=="codex.notification")return null;const i=me(e.data),a=i.method;if(a!=="item/started"&&a!=="item/completed")return null;const r=me(i.params),u=me(r.item),c=typeof u.type=="string"?u.type:"item";if(mw(c)||Cw(u))return null;const d=a==="item/completed",p=me(u.arguments),g=c==="dynamicToolCall"&&typeof u.tool=="string"?u.tool:null;return{id:e.id,kind:g==="seele_topics"?"collaboration":g==="seele_workspace_change"?"workspaceChange":"activity",title:g?gw(g,d,p):d?`Finished ${_l(c)}`:`Working on ${_l(c)}`,body:g?yw(g,p):bw(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?VD(u):"running",topicAction:g==="seele_topics"?pw(p.action):void 0,workspaceChangeType:g==="seele_workspace_change"&&Ee(p.type)||void 0,workspaceChangePayload:g==="seele_workspace_change"?me(p.payload):void 0}}function pw(e){return e==="read"||e==="history"||e==="send"?e:void 0}function GD(e){if(kw(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=LE(e);return i?{id:e.id,kind:"activity",title:ww(i),body:hw(e.data),createdAt:e.createdAt??new Date().toISOString(),meta:"event"}:null}function hw(e){const i=me(e);for(const a of["title","message","description","status","reason"])if(typeof i[a]=="string"&&i[a].trim())return vw(i[a].trim(),180);return"Event details are available"}function mw(e){return["agentMessage","assistantMessage","commandExecution","message","reasoning","plan","systemMessage","userMessage"].includes(e)}function VD(e){return e.status==="failed"||e.status==="error"?"failed":e.status==="cancelled"||e.status==="canceled"?"stopped":"done"}function _l(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function gw(e,i,a){if(e==="seele_topics")switch(Ee(a.action)){case"read":return"Read messages";case"history":return"Review history";case"send":return"Send message";default:return i?"Operation completed":"Working"}if(e==="seele_wakeup"){const u=Ee(a.action)==="cancel";return i?u?"Wakeup cancellation requested":"Wakeup requested":u?"Requesting wakeup cancellation":"Requesting wakeup"}if(e==="seele_workspace_change")return i?"Workspace change proposed":"Preparing workspace change";const r=_l(e);return i?`Finished ${r}`:`Running ${r}`}function yw(e,i){if(e==="seele_topics"){const a=Ee(i.topicId);return a?`Topic ${Ml(a)}`:"Topic"}if(e==="seele_wakeup")return Ee(i.instruction)||(Ee(i.action)==="cancel"?"Cancel the current wakeup":"Schedule the current wakeup");if(e==="seele_workspace_change"){const a=Ee(i.type)||"workspace";return xw(a,me(i.payload))}return _l(e)}function xw(e,i){return e==="responsibility"?Ee(i.content)||"Workspace responsibility":JSON.stringify(i,null,2)}function bw(e,i){for(const a of["title","name","description","text","summary"])if(typeof e[a]=="string"&&e[a].trim())return Cs(e[a].trim(),160);return typeof e.id=="string"?`${_l(i)} ${Ml(e.id)}`:_l(i)}function FD(e){var a;if(e.meta==="running")return"running";if(e.meta==="approval")return"approval";if(e.meta==="stopped")return"stopped";const i=(a=e.meta)==null?void 0:a.match(/^exit\s+(-?\d+)$/);return i?Number(i[1])===0?"done":"failed":"done"}function YD(e,i){return i==="running"?"running":i==="approval"?"approval":i==="stopped"?"stopped":i==="failed"?e.meta??"failed":"ok"}function PD(e,i){var r;if(i==="running")return"Command is still running.";if(i==="approval")return"Waiting for approval before running.";if(i==="stopped")return"Command was stopped.";const a=(r=e.meta)==null?void 0:r.match(/^exit\s+(-?\d+)$/);return a?`Exit code: ${a[1]}`:i==="failed"?"Command failed.":"Command completed."}function WD(e,i){const a=e.split(/\r?\n/),u=a.slice(0,i).join(`
121
+ `);return a.length>i?`${u}
122
+ ...`:u}function KD(e,i){return e?e.split(/\r?\n/).filter(a=>a.trim()).length>i:!1}function rd(e){return/^call_[A-Za-z0-9]+$/.test(e)||e==="command"}function XD(e){const i=e.trim();return!i||i.includes(`
123
+ `)?null:Cs(i,120)}function Cs(e,i){if(e.length<=i)return e;const a=Math.max(8,Math.floor((i-3)/2));return`${e.slice(0,a)}...${e.slice(-a)}`}function vw(e,i){return e.length<=i?e:`${e.slice(0,Math.max(1,i-3))}...`}function ww(e){const a=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return a?a.charAt(0).toUpperCase()+a.slice(1):"System event"}function kw(e){const i=e.createdAt??new Date().toISOString();if(e.event==="server.status"){const c=me(e.data);if(c.status==="initialized")return{id:e.id,title:"Connected to Seele runtime",createdAt:i,tone:"done"};if(c.status==="turn_started")return{id:e.id,title:"Turn started",createdAt:i,tone:"running"};if(c.status==="archived_thread_replaced")return{id:e.id,title:"Started a fresh runtime thread",detail:typeof c.archivedThreadId=="string"?`archived ${Ml(c.archivedThreadId)}`:void 0,createdAt:i,tone:"warning"}}if(e.event==="server.stopped"||e.event==="server.stop")return{id:e.id,title:"Stopped current run",createdAt:i,tone:"error"};if(e.event==="runtime.worker_stale")return{id:e.id,title:"Runtime appears stalled",detail:"No runtime signal for a while",createdAt:i,tone:"warning"};if(e.event==="runtime.worker_recovered")return{id:e.id,title:"Runtime resumed",createdAt:i,tone:"running"};if(e.event==="runtime.compaction.started"){const c=me(e.data);return{id:e.id,title:"Codex compacting context",detail:ah(c,!1),createdAt:i,tone:"running"}}if(e.event==="runtime.compaction.completed"){const c=me(e.data);return{id:e.id,title:"Codex context compacted",detail:ah(c,!0),createdAt:i,tone:"done"}}if(e.event==="server.turn.long_running")return{id:e.id,title:"Long run in progress",detail:"Consider splitting into a wakeup phase",createdAt:i,tone:"warning"};if(e.event==="server.turn.phase_boundary_recommended"){const c=me(e.data);return{id:e.id,title:"Phase boundary recommended",detail:typeof c.operationCount=="number"?`${c.operationCount} operations in this turn`:"Many operations in this turn",createdAt:i,tone:"warning"}}if(e.event==="server.wakeup.started"){const c=me(e.data);return{id:e.id,title:"Scheduled wakeup resumed",detail:typeof c.instruction=="string"?Cs(c.instruction,96):void 0,createdAt:i,tone:"running"}}if(e.event==="codex.server_request"){const c=me(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=me(c.params);return{id:e.id,title:"Waiting for approval",detail:typeof d.command=="string"?Cs(d.command,96):"Command needs confirmation",createdAt:i,tone:"warning"}}}if(e.event!=="codex.notification")return null;const a=me(e.data),r=a.method,u=me(a.params);if(r==="item/started"||r==="item/completed"){const c=me(u.item),d=typeof c.type=="string"?c.type:"item",p=r==="item/completed";if(d==="commandExecution")return{id:e.id,title:p?"Command completed":"Running command",detail:Cs(Zc(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=Cw(c);if(g)return{id:e.id,title:p?"File update finished":"Editing file",detail:Cs(g,96),createdAt:i,tone:p?"done":"running"};if(!mw(d))return{id:e.id,title:p?`Finished ${_l(d)}`:`Working on ${_l(d)}`,detail:bw(c,d),createdAt:i,tone:p?"done":"running"}}if(r==="thread/status/changed"){const c=me(u.status),d=Array.isArray(c.activeFlags)?c.activeFlags:[];if(c.type==="active"&&d.some(p=>p==="waitingOnApproval"))return{id:e.id,title:"Waiting for approval",detail:"Command needs confirmation",createdAt:i,tone:"warning"}}if(r==="turn/started")return{id:e.id,title:"Seele started working",createdAt:i,tone:"running"};if(r==="turn/completed"){const c=me(u.turn);return{id:e.id,title:"Turn completed",detail:typeof c.durationMs=="number"?Ns(c.durationMs):void 0,createdAt:i,tone:"done"}}if(r==="hook/started"||r==="hook/completed"){const c=me(u.run),d=typeof c.eventName=="string"?c.eventName:"hook";return{id:e.id,title:r==="hook/started"?`Running ${gb(d)}`:`Finished ${gb(d)}`,detail:typeof c.durationMs=="number"?Ns(c.durationMs):void 0,createdAt:i,tone:r==="hook/started"?"running":"done"}}return null}function ah(e,i){const a=sd(e.before),r=sd(e.after),u=[];if(i){const c=typeof e.durationMs=="number"?e.durationMs:null;u.push(c===null?"Completed":`Completed in ${Ns(c)}`)}else u.push("Codex triggered");if(a&&r){u.push(`context ${xr(a)} → ${xr(r)}`);const c=a.totalTokens-r.totalTokens;c>0&&u.push(`released ~${Ih(c)} tokens`)}else a&&u.push(`context ${xr(a)}`);return u.join(" · ")}function QD(e){const i=sd(e.before),a=sd(e.after),r=i&&a?i.totalTokens-a.totalTokens:null;let u="Unavailable";return i&&a?u=`${xr(i)} → ${xr(a)}`:i?u=`${xr(i)} → unavailable`:a&&(u=`unavailable → ${xr(a)}`),[{label:"Trigger",value:e.trigger==="codex"?"Codex automatic":e.trigger??"Unavailable"},{label:"Duration",value:e.durationMs===null?"Unavailable":Ns(e.durationMs)},{label:"Context",value:u},{label:"Released",value:r===null?"Unavailable":r>0?`~${Ih(r)} tokens`:"No decrease observed"}]}function sd(e){const i=me(e);return typeof i.totalTokens=="number"?{totalTokens:i.totalTokens,modelContextWindow:typeof i.modelContextWindow=="number"?i.modelContextWindow:null}:null}function xr(e){return e.modelContextWindow&&e.modelContextWindow>0?`${Math.round(e.totalTokens/e.modelContextWindow*100)}%`:`${Ih(e.totalTokens)} tokens`}function Ih(e){return new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(Math.max(0,e))}function ZD(e){let i=null;for(const a of e)for(const r of a.events){const u=tR(r);u&&(!i||Date.parse(u.updatedAt)>Date.parse(i.updatedAt))&&(i=u)}return i}function mb(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.updatedAt)>Date.parse(i.updatedAt))?a:i,null)}function JD(e){let i=null;for(const a of e){const r=Sw(a);r&&(!i||cu(a,i)>0)&&(i=r)}return i}function Sw(e){if(e.event!=="codex.notification")return null;const i=me(e.data);if(i.method!=="thread/tokenUsage/updated")return null;const a=me(i.params),r=me(a.tokenUsage),u=me(r.last),c=me(r.total),d=Object.keys(u).length>0?u:c,p=yi(d.totalTokens);return p===null?null:{totalTokens:p,inputTokens:yi(d.inputTokens),cachedInputTokens:yi(d.cachedInputTokens),outputTokens:yi(d.outputTokens),reasoningOutputTokens:yi(d.reasoningOutputTokens),modelContextWindow:yi(r.modelContextWindow),createdAt:e.createdAt??new Date().toISOString()}}function eR(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.createdAt)>Date.parse(i.createdAt))?a:i,null)}function jw(e){return e!=null&&e.modelContextWindow&&e.modelContextWindow>0?e.totalTokens/e.modelContextWindow*100:null}function tR(e){if(e.event!=="codex.notification")return null;const i=me(e.data);if(i.method!=="account/rateLimits/updated")return null;const a=me(i.params),r=me(a.rateLimits),u=[r.primary,r.secondary].map(c=>nR(c)).filter(c=>c!==null);return u.length===0?null:{windows:u,updatedAt:e.createdAt??new Date().toISOString()}}function nR(e){const i=me(e);return typeof i.usedPercent!="number"||typeof i.resetsAt!="number"||typeof i.windowDurationMins!="number"?null:{usedPercent:i.usedPercent,resetsAt:i.resetsAt,windowDurationMins:i.windowDurationMins}}function iR(e,i){return e?!i||e===i?e:i.startsWith(e)?i:`${e}${i}`:i}function Zc(e){return typeof e=="string"?e:Array.isArray(e)?e.map(i=>String(i)).join(" "):"command"}function Cw(e){var a;const i=e.path??e.file??e.filename;return typeof i=="string"?i:((a=Xp(e)[0])==null?void 0:a.path)??null}function me(e){return e&&typeof e=="object"?e:{}}function yi(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function Ee(e){return typeof e=="string"?e:""}function br(e){return e.replace(/([\\`*_[\]<>])/g,"\\$1")}function aR(e){const i=me(e),a=me(i.thread);if(!Object.keys(a).length)return null;const r=Array.isArray(a.turns)?a.turns:[],u=[];let c=0,d=0,p=0,g=0,m=0;return r.forEach((b,x)=>{const S=me(b),w=Ee(S.id)||`turn-${x+1}`,E=Array.isArray(S.items)?S.items:[];c+=E.length,u.push(lR(S,w)),E.forEach(R=>{const $=me(R),M=Ee($.type);M==="userMessage"?d+=1:M==="agentMessage"?p+=1:M==="compaction"?g+=1:M==="contextCompaction"&&(m+=1)})}),{id:Ee(a.id),sessionId:Ee(a.sessionId),status:Tw(a.status),source:Uh(a.source),cwd:Ee(a.cwd),path:Ee(a.path),preview:Ee(a.preview),createdAt:yi(a.createdAt),updatedAt:yi(a.updatedAt),recencyAt:yi(a.recencyAt),turnCount:r.length,itemCount:c,userMessageCount:d,agentMessageCount:p,compactionCount:g,contextCompactionCount:m,turns:u}}function lR(e,i){const a=Array.isArray(e.items)?e.items:[],r=Array.from(new Set(a.map(c=>Ee(me(c).type)).filter(c=>c.length>0))).join(", "),u=rR(a.map(c=>lh(c)).filter(Boolean).join(" "),220);return{id:i,status:Tw(e.status),itemsView:Ee(e.itemsView)||"unknown",itemCount:a.length,startedAt:yi(e.startedAt),completedAt:yi(e.completedAt),durationMs:yi(e.durationMs),itemTypes:r,preview:u,raw:e}}function lh(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(lh).filter(Boolean).join(`
124
+ `);if(!e||typeof e!="object")return"";const i=e,a=Ee(i.text),r=lh(i.content);return[a,r].filter(Boolean).join(`
125
+ `)}function Tw(e){const i=me(e);return Ee(i.type)||Uh(e)}function rR(e,i){const a=e.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}...`:a}function Zo(e){return e===null?"unknown":$e(e*1e3)}function sR(e){return typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()?e:null}function Uh(e){if(typeof e=="string")return e;const i=JSON.stringify(e);return i.length>180?`${i.slice(0,180)}...`:i}function oR(e){if(typeof e=="string")return e;const i=me(e),a=typeof i.message=="string"?i.message:null,r=typeof i.detail=="string"?i.detail:null;return a&&r?`${a}
126
+
127
+ ${r}`:a||r||Uh(e)}function gb(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function Ns(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(e<1e4?1:0)}s`}function Lp(e){if(e<6e4)return Ns(e);const i=Math.floor(e/6e4);if(i<60)return`${i}m`;const a=Math.floor(i/60),r=i%60;return r===0?`${a}h`:`${a}h ${r}m`}function Ew(e){return`${Math.round(e)}%`}function Un(e){return new Intl.NumberFormat("en-US").format(e)}function Jc(e){return e===null?"unknown":Un(e)}function md(e){return Math.max(0,Math.min(100,Math.round(e)))}function Bh(e){return e>=100?"exhausted":e>=90?"danger":e>=75?"warning":"healthy"}function Aw(e){return $e(e*1e3)}function $e(e){const i=typeof e=="number"?new Date(e):new Date(e);if(Number.isNaN(i.getTime()))return"";const a={timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},r=new Intl.DateTimeFormat("en-CA",a).formatToParts(i),u=c=>{var d;return((d=r.find(p=>p.type===c))==null?void 0:d.value)??""};return`${u("month")}/${u("day")} ${u("hour")}:${u("minute")}:${u("second")}`}function fu(e){const i=$e(e);return i?`${i} UTC+08:00`:""}function uR(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 yb(e,i){const a=au(e,i);return a?`${a.displayName}${a.isDefault?" (default)":""}`:e||"Unavailable"}function au(e,i){return e?i.find(a=>a.model===e)??null:i.find(a=>a.isDefault)??i[0]??null}function gd(e){return e?e.replace(/^codex-cli\s+/i,""):"Unavailable"}function rh(e,i){const a=gd(e);return i?`${a} (${$e(i)})`:a}function cR(e){return`https://github.com/openai/codex/releases/tag/rust-v${encodeURIComponent(gd(e))}`}function dR(e,i){const a=xb(e),r=xb(i);if(!a||!r)return!1;for(let u=0;u<a.core.length;u+=1)if(a.core[u]!==r.core[u])return a.core[u]>r.core[u];return a.prerelease===r.prerelease?!1:a.prerelease?r.prerelease?a.prerelease.localeCompare(r.prerelease,void 0,{numeric:!0})>0:!1:!0}function xb(e){if(!e)return null;const i=gd(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 fR(e,i){const a=e.map(r=>({value:r.model,label:`${r.displayName}${r.isDefault?" (default)":""}`}));return i&&!e.some(r=>r.model===i)&&a.push({value:i,label:`${i} (unavailable)`}),a.length===0&&a.push({value:"",label:"Models unavailable"}),a}async function bb(e,i){const a=e.getReader(),r=new TextDecoder;let u="";for(;;){const{done:c,value:d}=await a.read();if(c)break;u+=r.decode(d,{stream:!0});const p=u.split(`
128
+
129
+ `);u=p.pop()??"";for(const g of p){const m=pR(g);m&&i(m)}}}function pR(e){const i=e.split(`
130
+ `),a=i.find(d=>d.startsWith("event: ")),r=i.filter(d=>d.startsWith("data: ")).map(d=>d.slice(6));if(!a||r.length===0)return null;const u=a.slice(7),c=r.join(`
131
+ `);try{return{event:u,data:JSON.parse(c)}}catch{return{event:u,data:c}}}function hR(e){var r,u,c,d,p;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/agentMessage/delta"&&i.method!=="item/plan/delta")return null;const a=((r=i.params)==null?void 0:r.delta)??((u=i.params)==null?void 0:u.text)??"";return a?{text:a,phase:i.method==="item/plan/delta"?"final_answer":((c=i.params)==null?void 0:c.phase)==="commentary"||((d=i.params)==null?void 0:d.phase)==="final_answer"?i.params.phase:"unknown",itemId:(p=i.params)==null?void 0:p.itemId}:null}function mR(e){var r;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/started")return null;const a=(r=i.params)==null?void 0:r.item;return(a==null?void 0:a.type)!=="agentMessage"&&(a==null?void 0:a.type)!=="plan"?null:{itemId:a.id,phase:a.type==="plan"?"final_answer":a.phase==="commentary"||a.phase==="final_answer"?a.phase:"unknown"}}function gR(e){var r;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/completed")return null;const a=(r=i.params)==null?void 0:r.item;return(a==null?void 0:a.type)!=="agentMessage"&&(a==null?void 0:a.type)!=="plan"||!a.text?null:{itemId:a.id,text:a.text,phase:a.type==="plan"?"final_answer":a.phase==="commentary"||a.phase==="final_answer"?a.phase:"unknown"}}function Kc(e){var a,r,u,c;if(e.event==="server.error"||e.event==="client.error")return"error";if(!e.data||typeof e.data!="object")return null;const i=e.data;return i.method==="thread/status/changed"&&((r=(a=i.params)==null?void 0:a.status)==null?void 0:r.type)==="idle"?"done":i.method==="turn/completed"?(c=(u=i.params)==null?void 0:u.turn)!=null&&c.error?"error":"done":null}function Es(e){return e.length<=6?e:e.slice(0,6)}function Ml(e){return e.slice(0,8)}function vb(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function wb(e){return{discussing:"Planning",ready:"Planning",active:"Running",paused:"Paused",waiting:"Waiting",replanning:"Planning",blocked:"Blocked",completed:"Completed",cancelled:"Cancelled"}[e]}function Ip(e,...i){return i.includes(e)}function yR(e,i){const a=Date.parse(e.startedAt??e.createdAt),r=e.finishedAt?Date.parse(e.finishedAt):i;if(!Number.isFinite(a)||!Number.isFinite(r))return"";const u=Math.max(0,Math.floor((r-a)/1e3));if(u<60)return`${u}s`;const c=Math.floor(u/60);return c<60?`${c}m`:`${Math.floor(c/60)}h ${c%60}m`}function xR(e,i){const a=Date.parse(e),r=Date.parse(i);if(!Number.isFinite(a)||!Number.isFinite(r))return"Goal completed";const u=Math.max(0,Math.floor((r-a)/1e3));if(u<60)return`${u}s`;const c=Math.floor(u/60);return c<60?`${c}m`:`${Math.floor(c/60)}h ${c%60}m`}function sh(e,i){var a;return i==="running"||i==="error"?i:((a=e==null?void 0:e.nextWakeup)==null?void 0:a.status)==="scheduled"?"waiting":i}function bR(e,i){return`waiting ${od(e,i)}`}function od(e,i){const a=Date.parse(e.wakeAt);if(Number.isNaN(a))return"waiting";const r=Math.max(0,Math.ceil((a-i)/1e3));if(r<60)return`${r}s`;const u=Math.ceil(r/60);if(u<60)return`${u}m`;const c=Math.ceil(u/60);return c<24?`${c}h`:`${Math.ceil(c/24)}d`}function ed(e,i=null,a=Date.now()){if(e==="waiting")return i?bR(i,a):"waiting";switch(e){case"done":return"idle";case"running":return"running";case"error":return"error";case"initializing":return"initializing";case"initialization_failed":return"initialization failed";case"idle":return"idle"}}function kb(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function vR(e){return e==="assistant"?"Seele":"You"}const wR=document.getElementById("root"),Nw=window.__seeleCodexRoot??tS.createRoot(wR);window.__seeleCodexRoot=Nw;DR();Nw.render(s.jsx(D.StrictMode,{children:s.jsx(kR,{})}));function kR(){const[e,i]=D.useState(null),[a,r]=D.useState(null),[u,c]=D.useState(""),[d,p]=D.useState(""),[g,m]=D.useState("admin"),[b,x]=D.useState(""),[S,w]=D.useState(!1),[E,R]=D.useState("");D.useEffect(()=>{let H=!1,q=0;const F=async()=>{try{const ie=await Sb();if(H)return;i(ie),p("")}catch{if(H)return;p("Reconnecting to Seele..."),q=window.setTimeout(F,2e3)}};return F(),()=>{H=!0,window.clearTimeout(q)}},[]),D.useEffect(()=>{let H=!1,q=0;const F=async()=>{try{const N=await Dw();if(H)return;r(N),c(""),q=window.setTimeout(F,N.status==="authorized"&&N.configurationReady&&N.codexAccountsReady?3e4:3e3)}catch{if(H)return;c("Unable to reach Seele."),q=window.setTimeout(F,3e3)}},ie=()=>{window.clearTimeout(q),F()};return window.addEventListener(eh,ie),F(),()=>{H=!0,window.clearTimeout(q),window.removeEventListener(eh,ie)}},[]),D.useEffect(()=>{const H=()=>{i({enabled:!0,authenticated:!1,user:null}),x(""),R("Your session has expired. Sign in again.")};return window.addEventListener(Jp,H),()=>window.removeEventListener(Jp,H)},[]);async function $(H){H.preventDefault(),w(!0),R("");try{const q=await fetch(ye("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:g,password:b})});if(!q.ok){R(q.status===401?"Incorrect username or password.":q.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}x(""),i(await Sb())}catch{R("Unable to reach Seele.")}finally{w(!1)}}async function M(){await fetch(ye("auth/logout"),{method:"POST"}).catch(()=>{}),i({enabled:!0,authenticated:!1,user:null})}if(a&&(a.status!=="authorized"||!a.configurationReady||!a.codexAccountsReady))return s.jsx(SR,{authorization:a});if(!e||!a)return s.jsx("main",{className:"auth-shell",children:s.jsx("span",{className:"auth-loading",children:u||d||"Loading Seele..."})});if(!e.enabled||e.authenticated){const H=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return s.jsx(IA,{authEnabled:e.enabled,currentUser:H,deploymentId:a.deploymentId,onLogout:M},`${a.deploymentId}:${H.id}`)}return s.jsx("main",{className:"auth-shell",children:s.jsxs("section",{className:"auth-panel",children:[s.jsxs("header",{children:[s.jsx("p",{children:"Seele"}),s.jsx("h1",{children:"Sign in"})]}),s.jsxs("form",{onSubmit:$,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:H=>m(H.target.value),value:g})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{autoComplete:"current-password",onChange:H=>x(H.target.value),type:"password",value:b})]}),E?s.jsx("p",{className:"auth-error",role:"alert",children:E}):null,s.jsx("button",{disabled:S||!g||!b,type:"submit",children:S?"Signing in...":"Sign in"})]})]})})}function SR({authorization:e}){const i={starting:{title:"Checking deployment authorization",body:"Seele is contacting its configured cloud service."},pending:{title:"Waiting for cloud approval",body:"A cloud administrator must authorize this deployment before it can be used."},revoked:{title:"Deployment access revoked",body:"This deployment is disabled until a cloud administrator authorizes it again."},unavailable:{title:"Cloud authorization unavailable",body:"Seele will keep retrying. Business APIs and the runtime remain paused."},authorized:{title:"Deployment authorized",body:"Seele is ready."}},a=e.status==="authorized"&&!e.configurationReady?{title:"Synchronizing global configuration",body:"Seele is applying the current cloud configuration before the deployment becomes available."}:e.status==="authorized"&&!e.codexAccountsReady?{title:"Synchronizing Codex accounts",body:"Seele is installing the cloud account credentials before the deployment becomes available."}:i[e.status];return s.jsx("main",{className:"deployment-shell",children:s.jsxs("section",{className:"deployment-panel deployment-waiting-panel",children:[s.jsx("div",{className:`deployment-status-mark is-${e.status}`,"aria-hidden":"true"}),s.jsx("p",{className:"deployment-kicker",children:"Seele deployment"}),s.jsx("h1",{children:a.title}),s.jsx("p",{className:"deployment-lead",children:a.body}),s.jsxs("dl",{className:"deployment-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Deployment ID"}),s.jsx("dd",{children:s.jsx("code",{children:e.deploymentId})})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Name"}),s.jsx("dd",{children:e.name})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Cloud"}),s.jsx("dd",{children:e.cloudUrl})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Last checked"}),s.jsx("dd",{children:e.lastCheckedAt?CR(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:jR(e.cloudUrl),children:"Open cloud deployment management"}),s.jsx("p",{className:"deployment-retry-note",children:"Authorization is checked automatically."})]})})}function jR(e){return`${e.replace(/\/+$/,"")}/admin/deployments`}function CR(e){const i=Date.parse(e);return Number.isNaN(i)?e:new Date(i).toLocaleString()}async function Dw(){const e=await fetch(ye("deployment/authorization"));if(!e.ok)throw new Error(`Deployment authorization request failed: ${e.status}`);return e.json()}async function Sb(){const e=await fetch(ye("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function TR(){const e=ye("admin/users"),i=await fetch(e);if(!i.ok)throw await pn(i,{url:e});return(await i.json()).users}async function ER(e){const i=ye("admin/users"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!a.ok)throw await pn(a,{method:"POST",url:i});return(await a.json()).user}async function AR(e,i){const a=ye(`admin/users/${encodeURIComponent(e)}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await pn(r,{method:"PATCH",url:a});return(await r.json()).user}async function NR(e){const i=ye(`admin/users/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});if(!a.ok)throw await pn(a,{method:"DELETE",url:i})}function DR(){if(window.__seeleAuthFetchInstalled)return;const e=window.fetch.bind(window);window.fetch=async(...i)=>{const a=await e(...i),r=typeof i[0]=="string"?i[0]:i[0]instanceof URL?i[0].toString():i[0].url;if(a.status===401){const u=await a.clone().json().then(c=>c&&typeof c=="object"&&"error"in c?c.error:void 0).catch(()=>{});KE(a.status,u,r.includes("/api/auth/"))==="reauthenticate"&&window.dispatchEvent(new Event(Jp))}return a.status===503&&r.includes("/api/")&&Tr(),a},window.__seeleAuthFetchInstalled=!0}function Tr(){window.dispatchEvent(new Event(eh))}export{Tt as _,nS as a,xS as b,yx as c,hS as f,jb as g,yS as h,ch as s,sS as w};