@thready-web/dsh-bot-plugin 0.1.0-beta.8 → 0.1.0-beta.9

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 (102) hide show
  1. package/dist/desk.js +158 -1
  2. package/dist/http.js +42 -5
  3. package/dist/workspace-files.js +319 -0
  4. package/package.json +1 -1
  5. package/public/assets/SourceEditor-CJwK846Z.css +1 -0
  6. package/public/assets/SourceEditor-Cu3oRqA0.js +669 -0
  7. package/public/assets/abap-CRCWOmpq.js +1 -0
  8. package/public/assets/apex-DnsZk_dE.js +1 -0
  9. package/public/assets/azcli-1IWB1ccx.js +1 -0
  10. package/public/assets/bat-DPkNLes8.js +1 -0
  11. package/public/assets/bicep-Corcdgou.js +2 -0
  12. package/public/assets/cameligo-CGrWLZr3.js +1 -0
  13. package/public/assets/clojure-D9WOWImG.js +1 -0
  14. package/public/assets/codicon-DCmgc-ay.ttf +0 -0
  15. package/public/assets/coffee-B7EJu28W.js +1 -0
  16. package/public/assets/cpp-SEyurbux.js +1 -0
  17. package/public/assets/csharp-BoL64M5l.js +1 -0
  18. package/public/assets/csp-C46ZqvIl.js +1 -0
  19. package/public/assets/css-DQU6DXDx.js +3 -0
  20. package/public/assets/css.worker-DYpkewsP.js +79 -0
  21. package/public/assets/cssMode-FWS1gu61.js +4 -0
  22. package/public/assets/cypher-D84EuPTj.js +1 -0
  23. package/public/assets/dart-D8lhlL1r.js +1 -0
  24. package/public/assets/dockerfile-DLk6rpji.js +1 -0
  25. package/public/assets/ecl-BO6FnfXk.js +1 -0
  26. package/public/assets/editor.worker-B4pQIWZD.js +12 -0
  27. package/public/assets/elixir-BRjLKONM.js +1 -0
  28. package/public/assets/flow9-Cac8vKd7.js +1 -0
  29. package/public/assets/freemarker2-U6v7W5T8.js +3 -0
  30. package/public/assets/fsharp-fd1GTHhf.js +1 -0
  31. package/public/assets/go-O9LJTZXk.js +1 -0
  32. package/public/assets/graphql-LQdxqEYJ.js +1 -0
  33. package/public/assets/handlebars-Dz33dYnR.js +1 -0
  34. package/public/assets/hcl-DxDQ3s82.js +1 -0
  35. package/public/assets/html-Bg_jMpt6.js +1 -0
  36. package/public/assets/html.worker-tnXziJOq.js +456 -0
  37. package/public/assets/htmlMode-CzB3QL-e.js +4 -0
  38. package/public/assets/index-Ah9i9dFa.js +63 -0
  39. package/public/assets/index-PsHINv2D.css +1 -0
  40. package/public/assets/ini-BvajGCUy.js +1 -0
  41. package/public/assets/java-SYsfObOQ.js +1 -0
  42. package/public/assets/javascript-DMkhf8OX.js +1 -0
  43. package/public/assets/json.worker-aFakAbRR.js +44 -0
  44. package/public/assets/jsonMode-DRHhZtb7.js +10 -0
  45. package/public/assets/julia-DQXNmw_w.js +1 -0
  46. package/public/assets/kotlin-qQ0MG-9I.js +1 -0
  47. package/public/assets/less-GGFNNJHn.js +2 -0
  48. package/public/assets/lexon-Canl7DCW.js +1 -0
  49. package/public/assets/liquid-C-8-PQ92.js +1 -0
  50. package/public/assets/lua-D28Ae8-K.js +1 -0
  51. package/public/assets/m3-DPitgjJI.js +1 -0
  52. package/public/assets/markdown-B811l8j2.js +1 -0
  53. package/public/assets/mdx-z749XIEc.js +1 -0
  54. package/public/assets/mips-CdjsipkG.js +1 -0
  55. package/public/assets/msdax-CYqgjx_P.js +1 -0
  56. package/public/assets/mysql-BHd6q0vd.js +1 -0
  57. package/public/assets/objective-c-B1aVtJYH.js +1 -0
  58. package/public/assets/pascal-BhNW15KB.js +1 -0
  59. package/public/assets/pascaligo-5jv8CcQD.js +1 -0
  60. package/public/assets/perl-DlYyT36c.js +1 -0
  61. package/public/assets/pgsql-Dy0bjov7.js +1 -0
  62. package/public/assets/php-120yhfDK.js +1 -0
  63. package/public/assets/pla-CjnFlu4u.js +1 -0
  64. package/public/assets/postiats-CQpG440k.js +1 -0
  65. package/public/assets/powerquery-DdJtto1Z.js +1 -0
  66. package/public/assets/powershell-Bu_VLpJB.js +1 -0
  67. package/public/assets/protobuf-IBS6jZEB.js +2 -0
  68. package/public/assets/pug-kFxLfcjb.js +1 -0
  69. package/public/assets/python-BHKY4qLy.js +1 -0
  70. package/public/assets/qsharp-q7JyzKFN.js +1 -0
  71. package/public/assets/r-BIFz-_sK.js +1 -0
  72. package/public/assets/razor-CNY--QcM.js +1 -0
  73. package/public/assets/redis-CHOsPHWR.js +1 -0
  74. package/public/assets/redshift-CBifECDb.js +1 -0
  75. package/public/assets/restructuredtext-CghPJEOS.js +1 -0
  76. package/public/assets/ruby-CYWGW-b1.js +1 -0
  77. package/public/assets/rust-DMDD0SHb.js +1 -0
  78. package/public/assets/sb-BYAiYHFx.js +1 -0
  79. package/public/assets/scala-Bqvq8jcR.js +1 -0
  80. package/public/assets/scheme-Dhb-2j9p.js +1 -0
  81. package/public/assets/scss-CTwUZ5N7.js +3 -0
  82. package/public/assets/shell-CsDZo4DB.js +1 -0
  83. package/public/assets/solidity-CME5AdoB.js +1 -0
  84. package/public/assets/sophia-RYC1BQQz.js +1 -0
  85. package/public/assets/sparql-KEyrF7De.js +1 -0
  86. package/public/assets/sql-BdTr02Mf.js +1 -0
  87. package/public/assets/st-C7iG7M4S.js +1 -0
  88. package/public/assets/swift-D7IUmUK8.js +1 -0
  89. package/public/assets/systemverilog-DgMryOEJ.js +1 -0
  90. package/public/assets/tcl-PloMZuKG.js +1 -0
  91. package/public/assets/ts.worker-Bij5J2kb.js +51316 -0
  92. package/public/assets/tsMode-BdcCVhTZ.js +11 -0
  93. package/public/assets/twig-BfRIq3la.js +1 -0
  94. package/public/assets/typescript-BD5fPxu4.js +1 -0
  95. package/public/assets/typespec-CzxlYoT_.js +1 -0
  96. package/public/assets/vb-BwAE3J76.js +1 -0
  97. package/public/assets/wgsl-B_1kOXbF.js +298 -0
  98. package/public/assets/xml-DuYJr6Y5.js +1 -0
  99. package/public/assets/yaml-DMyywRAi.js +1 -0
  100. package/public/index.html +2 -2
  101. package/public/assets/index-BL0MiCSK.js +0 -63
  102. package/public/assets/index-DS3-wcOY.css +0 -1
@@ -0,0 +1,63 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SourceEditor-Cu3oRqA0.js","assets/SourceEditor-CJwK846Z.css"])))=>i.map(i=>d[i]);
2
+ (function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))a(u);new MutationObserver(u=>{for(const o of u)if(o.type==="childList")for(const f of o.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function r(u){const o={};return u.integrity&&(o.integrity=u.integrity),u.referrerPolicy&&(o.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?o.credentials="include":u.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(u){if(u.ep)return;u.ep=!0;const o=r(u);fetch(u.href,o)}})();function ob(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var cd={exports:{}},rs={};var Dy;function WS(){if(Dy)return rs;Dy=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function r(a,u,o){var f=null;if(o!==void 0&&(f=""+o),u.key!==void 0&&(f=""+u.key),"key"in u){o={};for(var h in u)h!=="key"&&(o[h]=u[h])}else o=u;return u=o.ref,{$$typeof:n,type:a,key:f,ref:u!==void 0?u:null,props:o}}return rs.Fragment=l,rs.jsx=r,rs.jsxs=r,rs}var Ly;function ew(){return Ly||(Ly=1,cd.exports=WS()),cd.exports}var v=ew(),fd={exports:{}},Me={};var By;function tw(){if(By)return Me;By=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),S=Symbol.for("react.view_transition"),x=Symbol.iterator;function k(q){return q===null||typeof q!="object"?null:(q=x&&q[x]||q["@@iterator"],typeof q=="function"?q:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,E={};function M(q,ne,fe){this.props=q,this.context=ne,this.refs=E,this.updater=fe||T}M.prototype.isReactComponent={},M.prototype.setState=function(q,ne){if(typeof q!="object"&&typeof q!="function"&&q!=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,q,ne,"setState")},M.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function H(){}H.prototype=M.prototype;function te(q,ne,fe){this.props=q,this.context=ne,this.refs=E,this.updater=fe||T}var ie=te.prototype=new H;ie.constructor=te,C(ie,M.prototype),ie.isPureReactComponent=!0;var O=Array.isArray;function X(){}var le={H:null,A:null,T:null,S:null},me=Object.prototype.hasOwnProperty;function _(q,ne,fe){var ye=fe.ref;return{$$typeof:n,type:q,key:ne,ref:ye!==void 0?ye:null,props:fe}}function K(q,ne){return _(q.type,ne,q.props)}function ee(q){return typeof q=="object"&&q!==null&&q.$$typeof===n}function Ee(q){var ne={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(fe){return ne[fe]})}var qe=/\/+/g;function re(q,ne){return typeof q=="object"&&q!==null&&q.key!=null?Ee(""+q.key):ne.toString(36)}function F(q){switch(q.status){case"fulfilled":return q.value;case"rejected":throw q.reason;default:switch(typeof q.status=="string"?q.then(X,X):(q.status="pending",q.then(function(ne){q.status==="pending"&&(q.status="fulfilled",q.value=ne)},function(ne){q.status==="pending"&&(q.status="rejected",q.reason=ne)})),q.status){case"fulfilled":return q.value;case"rejected":throw q.reason}}throw q}function ue(q,ne,fe,ye,Ce){var je=typeof q;(je==="undefined"||je==="boolean")&&(q=null);var we=!1;if(q===null)we=!0;else switch(je){case"bigint":case"string":case"number":we=!0;break;case"object":switch(q.$$typeof){case n:case l:we=!0;break;case y:return we=q._init,ue(we(q._payload),ne,fe,ye,Ce)}}if(we)return Ce=Ce(q),we=ye===""?"."+re(q,0):ye,O(Ce)?(fe="",we!=null&&(fe=we.replace(qe,"$&/")+"/"),ue(Ce,ne,fe,"",function(ut){return ut})):Ce!=null&&(ee(Ce)&&(Ce=K(Ce,fe+(Ce.key==null||q&&q.key===Ce.key?"":(""+Ce.key).replace(qe,"$&/")+"/")+we)),ne.push(Ce)),1;we=0;var J=ye===""?".":ye+":";if(O(q))for(var he=0;he<q.length;he++)ye=q[he],je=J+re(ye,he),we+=ue(ye,ne,fe,je,Ce);else if(he=k(q),typeof he=="function")for(q=he.call(q),he=0;!(ye=q.next()).done;)ye=ye.value,je=J+re(ye,he++),we+=ue(ye,ne,fe,je,Ce);else if(je==="object"){if(typeof q.then=="function")return ue(F(q),ne,fe,ye,Ce);throw ne=String(q),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return we}function ce(q,ne,fe){if(q==null)return q;var ye=[],Ce=0;return ue(q,ye,"","",function(je){return ne.call(fe,je,Ce++)}),ye}function Te(q){if(q._status===-1){var ne=q._result,fe=ne();fe.then(function(ye){(q._status===0||q._status===-1)&&(q._status=1,q._result=ye,fe.status===void 0&&(fe.status="fulfilled",fe.value=ye))},function(ye){(q._status===0||q._status===-1)&&(q._status=2,q._result=ye,fe.status===void 0&&(fe.status="rejected",fe.reason=ye))}),q._status===-1&&(q._status=0,q._result=fe)}if(q._status===1)return q._result.default;throw q._result}var N=typeof reportError=="function"?reportError:function(q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof q=="object"&&q!==null&&typeof q.message=="string"?String(q.message):String(q),error:q});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",q);return}console.error(q)};function lt(q){var ne=le.T,fe={};fe.types=ne!==null?ne.types:null,le.T=fe;try{var ye=q(),Ce=le.S;Ce!==null&&Ce(fe,ye),typeof ye=="object"&&ye!==null&&typeof ye.then=="function"&&ye.then(X,N)}catch(je){N(je)}finally{ne!==null&&fe.types!==null&&(ne.types=fe.types),le.T=ne}}function pt(q){var ne=le.T;if(ne!==null){var fe=ne.types;fe===null?ne.types=[q]:fe.indexOf(q)===-1&&fe.push(q)}else lt(pt.bind(null,q))}var R={map:ce,forEach:function(q,ne,fe){ce(q,function(){ne.apply(this,arguments)},fe)},count:function(q){var ne=0;return ce(q,function(){ne++}),ne},toArray:function(q){return ce(q,function(ne){return ne})||[]},only:function(q){if(!ee(q))throw Error("React.Children.only expected to receive a single React element child.");return q}};return Me.Activity=g,Me.Children=R,Me.Component=M,Me.Fragment=r,Me.Profiler=u,Me.PureComponent=te,Me.StrictMode=a,Me.Suspense=m,Me.ViewTransition=S,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=le,Me.__COMPILER_RUNTIME={__proto__:null,c:function(q){return le.H.useMemoCache(q)}},Me.addTransitionType=pt,Me.cache=function(q){return function(){return q.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(q,ne,fe){if(q==null)throw Error("The argument must be a React element, but you passed "+q+".");var ye=C({},q.props),Ce=q.key;if(ne!=null)for(je in ne.key!==void 0&&(Ce=""+ne.key),ne)!me.call(ne,je)||je==="key"||je==="__self"||je==="__source"||je==="ref"&&ne.ref===void 0||(ye[je]=ne[je]);var je=arguments.length-2;if(je===1)ye.children=fe;else if(1<je){for(var we=Array(je),J=0;J<je;J++)we[J]=arguments[J+2];ye.children=we}return _(q.type,Ce,ye)},Me.createContext=function(q){return q={$$typeof:f,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null},q.Provider=q,q.Consumer={$$typeof:o,_context:q},q},Me.createElement=function(q,ne,fe){var ye,Ce={},je=null;if(ne!=null)for(ye in ne.key!==void 0&&(je=""+ne.key),ne)me.call(ne,ye)&&ye!=="key"&&ye!=="__self"&&ye!=="__source"&&(Ce[ye]=ne[ye]);var we=arguments.length-2;if(we===1)Ce.children=fe;else if(1<we){for(var J=Array(we),he=0;he<we;he++)J[he]=arguments[he+2];Ce.children=J}if(q&&q.defaultProps)for(ye in we=q.defaultProps,we)Ce[ye]===void 0&&(Ce[ye]=we[ye]);return _(q,je,Ce)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(q){return{$$typeof:h,render:q}},Me.isValidElement=ee,Me.lazy=function(q){return{$$typeof:y,_payload:{_status:-1,_result:q},_init:Te}},Me.memo=function(q,ne){return{$$typeof:p,type:q,compare:ne===void 0?null:ne}},Me.startTransition=lt,Me.unstable_useCacheRefresh=function(){return le.H.useCacheRefresh()},Me.use=function(q){return le.H.use(q)},Me.useActionState=function(q,ne,fe){return le.H.useActionState(q,ne,fe)},Me.useCallback=function(q,ne){return le.H.useCallback(q,ne)},Me.useContext=function(q){return le.H.useContext(q)},Me.useDebugValue=function(){},Me.useDeferredValue=function(q,ne){return le.H.useDeferredValue(q,ne)},Me.useEffect=function(q,ne){return le.H.useEffect(q,ne)},Me.useEffectEvent=function(q){return le.H.useEffectEvent(q)},Me.useId=function(){return le.H.useId()},Me.useImperativeHandle=function(q,ne,fe){return le.H.useImperativeHandle(q,ne,fe)},Me.useInsertionEffect=function(q,ne){return le.H.useInsertionEffect(q,ne)},Me.useLayoutEffect=function(q,ne){return le.H.useLayoutEffect(q,ne)},Me.useMemo=function(q,ne){return le.H.useMemo(q,ne)},Me.useOptimistic=function(q,ne){return le.H.useOptimistic(q,ne)},Me.useReducer=function(q,ne,fe){return le.H.useReducer(q,ne,fe)},Me.useRef=function(q){return le.H.useRef(q)},Me.useState=function(q){return le.H.useState(q)},Me.useSyncExternalStore=function(q,ne,fe){return le.H.useSyncExternalStore(q,ne,fe)},Me.useTransition=function(){return le.H.useTransition()},Me.version="19.3.1",Me}var Uy;function fh(){return Uy||(Uy=1,fd.exports=tw()),fd.exports}var z=fh();const oz=ob(z);var dd={exports:{}},as={},hd={exports:{}},pd={};var Hy;function nw(){return Hy||(Hy=1,(function(n){function l(F,ue){var ce=F.length;F.push(ue);e:for(;0<ce;){var Te=ce-1>>>1,N=F[Te];if(0<u(N,ue))F[Te]=ue,F[ce]=N,ce=Te;else break e}}function r(F){return F.length===0?null:F[0]}function a(F){if(F.length===0)return null;var ue=F[0],ce=F.pop();if(ce!==ue){F[0]=ce;e:for(var Te=0,N=F.length,lt=N>>>1;Te<lt;){var pt=2*(Te+1)-1,R=F[pt],q=pt+1,ne=F[q];if(0>u(R,ce))q<N&&0>u(ne,R)?(F[Te]=ne,F[q]=ce,Te=q):(F[Te]=R,F[pt]=ce,Te=pt);else if(q<N&&0>u(ne,ce))F[Te]=ne,F[q]=ce,Te=q;else break e}}return ue}function u(F,ue){var ce=F.sortIndex-ue.sortIndex;return ce!==0?ce:F.id-ue.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var f=Date,h=f.now();n.unstable_now=function(){return f.now()-h}}var m=[],p=[],y=1,g=null,S=3,x=!1,k=!1,T=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function te(F){for(var ue=r(p);ue!==null;){if(ue.callback===null)a(p);else if(ue.startTime<=F)a(p),ue.sortIndex=ue.expirationTime,l(m,ue);else break;ue=r(p)}}function ie(F){if(T=!1,te(F),!k)if(r(m)!==null)k=!0,O||(O=!0,ee());else{var ue=r(p);ue!==null&&re(ie,ue.startTime-F)}}var O=!1,X=-1,le=5,me=-1;function _(){return C?!0:!(n.unstable_now()-me<le)}function K(){if(C=!1,O){var F=n.unstable_now();me=F;var ue=!0;try{e:{k=!1,T&&(T=!1,M(X),X=-1),x=!0;var ce=S;try{t:{for(te(F),g=r(m);g!==null&&!(g.expirationTime>F&&_());){var Te=g.callback;if(typeof Te=="function"){g.callback=null,S=g.priorityLevel;var N=Te(g.expirationTime<=F);if(F=n.unstable_now(),typeof N=="function"){g.callback=N,te(F),ue=!0;break t}g===r(m)&&a(m),te(F)}else a(m);g=r(m)}if(g!==null)ue=!0;else{var lt=r(p);lt!==null&&re(ie,lt.startTime-F),ue=!1}}break e}finally{g=null,S=ce,x=!1}ue=void 0}}finally{ue?ee():O=!1}}}var ee;if(typeof H=="function")ee=function(){H(K)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,qe=Ee.port2;Ee.port1.onmessage=K,ee=function(){qe.postMessage(null)}}else ee=function(){E(K,0)};function re(F,ue){X=E(function(){F(n.unstable_now())},ue)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(F){F.callback=null},n.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<F?Math.floor(1e3/F):5},n.unstable_getCurrentPriorityLevel=function(){return S},n.unstable_next=function(F){switch(S){case 1:case 2:case 3:var ue=3;break;default:ue=S}var ce=S;S=ue;try{return F()}finally{S=ce}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(F,ue){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var ce=S;S=F;try{return ue()}finally{S=ce}},n.unstable_scheduleCallback=function(F,ue,ce){var Te=n.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?Te+ce:Te):ce=Te,F){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=ce+N,F={id:y++,callback:ue,priorityLevel:F,startTime:ce,expirationTime:N,sortIndex:-1},ce>Te?(F.sortIndex=ce,l(p,F),r(m)===null&&F===r(p)&&(T?(M(X),X=-1):T=!0,re(ie,ce-Te))):(F.sortIndex=N,l(m,F),k||x||(k=!0,O||(O=!0,ee()))),F},n.unstable_shouldYield=_,n.unstable_wrapCallback=function(F){var ue=S;return function(){var ce=S;S=ue;try{return F.apply(this,arguments)}finally{S=ce}}}})(pd)),pd}var Iy;function iw(){return Iy||(Iy=1,hd.exports=nw()),hd.exports}var md={exports:{}},hn={};var Vy;function lw(){if(Vy)return hn;Vy=1;var n=fh();function l(y){var g="https://react.dev/errors/"+y;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)g+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+y+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(l(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},u=Symbol.for("react.portal"),o=Symbol.for("react.recoverable"),f=Symbol.for("react.optimistic_key");function h(y,g,S){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:x===f?f:""+x,children:y,containerInfo:g,implementation:S}}var m=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(y,g){if(y==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,hn.browser=function(y){return{$$typeof:o,_reason:y}},hn.createPortal=function(y,g){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(l(299));return h(y,g,null,S)},hn.flushSync=function(y){var g=m.T,S=a.p;try{if(m.T=null,a.p=2,y)return y()}finally{m.T=g,a.p=S,a.d.f()}},hn.preconnect=function(y,g){typeof y=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,a.d.C(y,g))},hn.prefetchDNS=function(y){typeof y=="string"&&a.d.D(y)},hn.preinit=function(y,g){if(typeof y=="string"&&g&&typeof g.as=="string"){var S=g.as,x=p(S,g.crossOrigin),k=typeof g.integrity=="string"?g.integrity:void 0,T=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;S==="style"?a.d.S(y,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:x,integrity:k,fetchPriority:T}):S==="script"&&a.d.X(y,{crossOrigin:x,integrity:k,fetchPriority:T,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},hn.preinitModule=function(y,g){if(typeof y=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var S=p(g.as,g.crossOrigin);a.d.M(y,{crossOrigin:S,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}}else g==null&&a.d.M(y)},hn.preload=function(y,g){if(typeof y=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var S=g.as,x=p(S,g.crossOrigin);a.d.L(y,S,{crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},hn.preloadModule=function(y,g){if(typeof y=="string")if(g){var S=p(g.as,g.crossOrigin);a.d.m(y,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:S,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}else a.d.m(y)},hn.requestFormReset=function(y){a.d.r(y)},hn.unstable_batchedUpdates=function(y,g){return y(g)},hn.useFormState=function(y,g,S){return m.H.useFormState(y,g,S)},hn.useFormStatus=function(){return m.H.useHostTransitionStatus()},hn.version="19.3.1",hn}var Yy;function cb(){if(Yy)return md.exports;Yy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),md.exports=lw(),md.exports}var Gy;function rw(){if(Gy)return as;Gy=1;var n=iw(),l=fh(),r=cb();function a(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,i=t;i&&!i.alternate;)t=i,(t.flags&4098)!==0&&(e=t.return),i=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(o(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(a(188));return t!==e?null:e}for(var i=e,s=t;;){var c=i.return;if(c===null)break;var d=c.alternate;if(d===null){if(s=c.return,s!==null){i=s;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===i)return m(c),e;if(d===s)return m(c),t;d=d.sibling}throw Error(a(188))}if(i.return!==s.return)i=c,s=d;else{for(var b=!1,w=c.child;w;){if(w===i){b=!0,i=c,s=d;break}if(w===s){b=!0,s=c,i=d;break}w=w.sibling}if(!b){for(w=d.child;w;){if(w===i){b=!0,i=d,s=c;break}if(w===s){b=!0,s=d,i=c;break}w=w.sibling}if(!b)throw Error(a(189))}}if(i.alternate!==s)throw Error(a(190))}if(i.tag!==3)throw Error(a(188));return i.stateNode.current===i?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}function g(e,t,i,s,c,d){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&i(e,s,c,d)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&g(e.child,t,i,s,c,d))return!0;e=e.sibling}return!1}function S(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function x(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function k(e){var t=[null,null],i=S(e);return i===null||T(t,e,i.child,{foundSelf:!1}),t}function T(e,t,i,s){for(;i!==null;){if(i===t)s.foundSelf=!0;else if(i.tag===5||i.tag===27||i.tag===6){if(s.foundSelf)return e[1]=i,!0;e[0]=i}else if((i.tag!==22||i.memoizedState===null)&&T(e,t,i.child,s))return!0;i=i.sibling}return!1}function C(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var E=null,M=null;function H(e,t,i){return e===i?!0:e===t?(E=e,!0):!1}function te(e,t,i){return e===i?(M=e,!1):e===t?(M!==null&&(E=e),!0):!1}function ie(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function O(e,t,i){for(var s=0,c=e;c;c=i(c))s++;c=0;for(var d=t;d;d=i(d))c++;for(;0<s-c;)e=i(e),s--;for(;0<c-s;)t=i(t),c--;for(;s--;){if(e===t||t!==null&&e===t.alternate)return e;e=i(e),t=i(t)}return null}var X=Object.assign,le=Symbol.for("react.element"),me=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),ee=Symbol.for("react.strict_mode"),Ee=Symbol.for("react.profiler"),qe=Symbol.for("react.consumer"),re=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),ue=Symbol.for("react.suspense"),ce=Symbol.for("react.suspense_list"),Te=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),lt=Symbol.for("react.activity"),pt=Symbol.for("react.legacy_hidden"),R=Symbol.for("react.memo_cache_sentinel"),q=Symbol.for("react.view_transition"),ne=Symbol.for("react.recoverable"),fe=Symbol.iterator;function ye(e){return e===null||typeof e!="object"?null:(e=fe&&e[fe]||e["@@iterator"],typeof e=="function"?e:null)}var Ce=Symbol.for("react.client.reference");function je(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case Ee:return"Profiler";case ee:return"StrictMode";case ue:return"Suspense";case ce:return"SuspenseList";case lt:return"Activity";case q:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case _:return"Portal";case re:return e.displayName||"Context";case qe:return(e._context.displayName||"Context")+".Consumer";case F:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Te:return t=e.displayName||null,t!==null?t:je(e.type)||"Memo";case N:t=e._payload,e=e._init;try{return je(e(t))}catch{}}return null}var we=Array.isArray,J=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ut={pending:!1,data:null,method:null,action:null},Et=[],ke=-1;function dt(e){return{current:e}}function $e(e){0>ke||(e.current=Et[ke],Et[ke]=null,ke--)}function Ie(e,t){ke++,Et[ke]=e.current,e.current=t}var Re=dt(null),st=dt(null),mt=dt(null),It=dt(null);function Mt(e,t){switch(Ie(mt,t),Ie(st,e),Ie(Re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Fg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Fg(t),e=Qg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$e(Re),Ie(Re,e)}function Ft(){$e(Re),$e(st),$e(mt)}function xn(e){var t=e.memoizedState;t!==null&&(Wr._currentValue=t.memoizedState,Ie(It,e)),t=Re.current;var i=Qg(t,e.type);t!==i&&(Ie(st,e),Ie(Re,i))}function Qt(e){st.current===e&&($e(Re),$e(st)),It.current===e&&($e(It),Wr._currentValue=ut)}var Z,ae;function ge(e){if(Z===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Z=t&&t[1]||"",ae=-1<i.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+Z+e+ae}var xe=!1;function Ve(e,t){if(!e||xe)return"";xe=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(de){var L=de}Reflect.construct(e,[],W)}else{try{W.call()}catch(de){L=de}W=!1;try{var Y=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),W=!0,new e}finally{W&&(Y!==void 0?Object.defineProperty(e.prototype,"props",Y):delete e.prototype.props)}}}else{try{throw Error()}catch(de){L=de}(W=e())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(de){if(de&&L&&typeof de.stack=="string")return[de.stack,L.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=s.DetermineComponentFrameRoot(),b=d[0],w=d[1];if(b&&w){var j=b.split(`
5
+ `),U=w.split(`
6
+ `);for(c=s=0;s<j.length&&!j[s].includes("DetermineComponentFrameRoot");)s++;for(;c<U.length&&!U[c].includes("DetermineComponentFrameRoot");)c++;if(s===j.length||c===U.length)for(s=j.length-1,c=U.length-1;1<=s&&0<=c&&j[s]!==U[c];)c--;for(;1<=s&&0<=c;s--,c--)if(j[s]!==U[c]){if(s!==1||c!==1)do if(s--,c--,0>c||j[s]!==U[c]){var Q=`
7
+ `+j[s].replace(" at new "," at ");return e.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",e.displayName)),Q}while(1<=s&&0<=c);break}}}finally{xe=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?ge(i):""}function Ne(e,t){switch(e.tag){case 26:case 27:case 5:return ge(e.type);case 16:return ge("Lazy");case 13:return e.child!==t&&t!==null?ge("Suspense Fallback"):ge("Suspense");case 19:return ge("SuspenseList");case 0:case 15:return Ve(e.type,!1);case 11:return Ve(e.type.render,!1);case 1:return Ve(e.type,!0);case 31:return ge("Activity");case 30:return ge("ViewTransition");default:return""}}function De(e){try{var t="",i=null;do t+=Ne(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
8
+ Error generating stack: `+s.message+`
9
+ `+s.stack}}var qt=Object.prototype.hasOwnProperty,Sn=n.unstable_scheduleCallback,en=n.unstable_cancelCallback,wn=n.unstable_shouldYield,Dt=n.unstable_requestPaint,bt=n.unstable_now,Lt=n.unstable_getCurrentPriorityLevel,Bt=n.unstable_ImmediatePriority,gn=n.unstable_UserBlockingPriority,_i=n.unstable_NormalPriority,tn=n.unstable_LowPriority,Dn=n.unstable_IdlePriority,G=n.log,se=n.unstable_setDisableYieldValue,Pe=null,Xe=null;function xt(e){if(typeof G=="function"&&se(e),Xe&&typeof Xe.setStrictMode=="function")try{Xe.setStrictMode(Pe,e)}catch{}}var St=Math.clz32?Math.clz32:mi,pi=Math.log,dr=Math.LN2;function mi(e){return e>>>=0,e===0?32:31-(pi(e)/dr|0)|0}var hr=256,qi=262144,zl=4194304;function gi(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function $i(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var c=0,d=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var w=s&134217727;return w!==0?(s=w&~d,s!==0?c=gi(s):(b&=w,b!==0?c=gi(b):i||(i=w&~e,i!==0&&(c=gi(i))))):(w=s&~d,w!==0?c=gi(w):b!==0?c=gi(b):i||(i=s&~e,i!==0&&(c=gi(i)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,i=t&-t,d>=i||d===32&&(i&4194048)!==0)?t:c}function Ri(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function sa(e,t){(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var s=31-St(i),c=1<<s;t|=e[s],i&=~c}return t}function ua(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 pr(){var e=zl;return zl<<=1,(zl&62914560)===0&&(zl=4194304),e}function mr(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function yi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gr(e,t,i,s,c,d){var b=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var w=e.entanglements,j=e.expirationTimes,U=e.hiddenUpdates;for(i=b&~i;0<i;){var Q=31-St(i),W=1<<Q;w[Q]=0,j[Q]=-1;var L=U[Q];if(L!==null)for(U[Q]=null,Q=0;Q<L.length;Q++){var Y=L[Q];Y!==null&&(Y.lane&=-536870913)}i&=~W}s!==0&&yr(e,s,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(b&~t))}function yr(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-St(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function oa(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-St(i),c=1<<s;c&t|e[s]&t&&(e[s]|=t),i&=~c}}function _l(e,t){var i=t&-t;return i=(i&42)!==0?1:ql(i),(i&(e.suspendedLanes|t))!==0?0:i}function ql(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ni(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function vr(){var e=he.p;return e!==0?e:(e=window.event,e===void 0?32:jy(e.type))}function zs(e,t){var i=he.p;try{return he.p=e,t()}finally{he.p=i}}var yn=Math.random().toString(36).slice(2),Pt="__reactFiber$"+yn,nn="__reactProps$"+yn,ii="__reactContainer$"+yn,_s="__reactEvents$"+yn,Io="__reactListeners$"+yn,Vo="__reactHandles$"+yn,Mi="__reactResources$"+yn,Rl="__reactMarker$"+yn,Ml="__reactLoad$"+yn;function Dl(e){delete e[Pt],delete e[nn],delete e[Io],delete e[Vo]}function Ln(e){var t;if(t=e[Pt])return t;for(var i=e.parentNode;i;){if(t=i[ii]||i[Pt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=oy(e);e!==null;){if(i=e[Pt])return i;e=oy(e)}return t}e=i,i=e.parentNode}return null}function Vt(e){if(e=e[Pt]||e[ii]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Di(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function Li(e){var t=e[Mi];return t||(t=e[Mi]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Yt(e){e[Rl]=!0}function ca(e){e[Ml]=void 0}var qs=new Set,Yo={};function vi(e,t){kn(e,t),kn(e+"Capture",t)}function kn(e,t){for(Yo[e]=t,e=0;e<t.length;e++)qs.add(t[e])}var fa=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]*$"),Rs={},li={};function da(e){return qt.call(li,e)?!0:qt.call(Rs,e)?!1:fa.test(e)?li[e]=!0:(Rs[e]=!0,!1)}var He=!1;function ha(){var e=He;return He=!1,e}function Pi(e,t,i){if(da(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,i)}}function Wi(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,i)}}function Bn(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,s)}}function vn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ms(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ds(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,d=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(b){i=""+b,d.call(this,b)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(b){i=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function pa(e){if(!e._valueTracker){var t=Ms(e)?"checked":"value";e._valueTracker=Ds(e,t,""+e[t])}}function Ls(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=Ms(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}var Go=/[\n"\\]/g;function Nn(e){return e.replace(Go,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ma(e,t,i,s,c,d,b,w){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+vn(t)):e.value!==""+vn(t)&&(e.value=""+vn(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?b==="number"&&e.value==t?br(e,vn(e.value)):br(e,vn(t)):i!=null?br(e,vn(i)):s!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+vn(w):e.removeAttribute("name")}function ga(e,t,i,s,c,d,b,w){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||i!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){pa(e);return}i=i!=null?""+vn(i):"",t=t!=null?""+vn(t):i,w||t===e.value||(e.value=t),e.defaultValue=t}s=s??c,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=w?e.checked:!!s,e.defaultChecked=!!s,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),pa(e)}function br(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function el(e,t,i,s){if(e=e.options,t){t={};for(var c=0;c<i.length;c++)t["$"+i[c]]=!0;for(i=0;i<e.length;i++)c=t.hasOwnProperty("$"+e[i].value),e[i].selected!==c&&(e[i].selected=c),c&&s&&(e[i].defaultSelected=!0)}else{for(i=""+vn(i),t=null,c=0;c<e.length;c++){if(e[c].value===i){e[c].selected=!0,s&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function ya(e,t,i){if(t!=null&&(t=""+vn(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+vn(i):""}function va(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(a(92));if(we(s)){if(1<s.length)throw Error(a(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=vn(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),pa(e)}function tl(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Fo=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 nl(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||Fo.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Qo(e,t,i){if(t!=null&&typeof t!="object")throw Error(a(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="",He=!0);for(var c in t)s=t[c],t.hasOwnProperty(c)&&i[c]!==s&&(nl(e,c,s),He=!0)}else for(var d in t)t.hasOwnProperty(d)&&nl(e,d,t[d])}function xr(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Xo=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"],["maskType","mask-type"],["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"]]),Bs=/^[\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 A(e){return Bs.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function I(){}var $=null;function pe(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Oe=null,Se=null;function We(e){var t=Vt(e);if(t&&(e=t.stateNode)){var i=e[nn]||null;e:switch(e=t.stateNode,t.type){case"input":if(ma(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Nn(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var c=s[nn]||null;if(!c)throw Error(a(90));ma(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&Ls(s)}break e;case"textarea":ya(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&el(e,!!i.multiple,t,!1)}}}var wt=!1;function ot(e,t,i){if(wt)return e(t,i);wt=!0;try{var s=e(t);return s}finally{if(wt=!1,(Oe!==null||Se!==null)&&(Bu(),Oe&&(t=Oe,e=Se,Se=Oe=null,We(t),e)))for(t=0;t<e.length;t++)We(e[t])}}function et(e,t){var i=e.stateNode;if(i===null)return null;var s=i[nn]||null;if(s===null)return null;i=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(a(231,t,typeof i));return i}var rt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jt=!1;if(rt)try{var Tt={};Object.defineProperty(Tt,"passive",{get:function(){jt=!0}}),window.addEventListener("test",Tt,Tt),window.removeEventListener("test",Tt,Tt)}catch{jt=!1}var sn=null,Ll=null,Us=null;function Ih(){if(Us)return Us;var e,t=Ll,i=t.length,s,c="value"in sn?sn.value:sn.textContent,d=c.length;for(e=0;e<i&&t[e]===c[e];e++);var b=i-e;for(s=1;s<=b&&t[i-s]===c[d-s];s++);return Us=c.slice(e,1<s?1-s:void 0)}function Hs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Is(){return!0}function Vh(){return!1}function En(e){function t(i,s,c,d,b){this._reactName=i,this._targetInst=c,this.type=s,this.nativeEvent=d,this.target=b,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(i=e[w],this[w]=i?i(d):d[w]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Is:Vh,this.isPropagationStopped=Vh,this}return X(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Is)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Is)},persist:function(){},isPersistent:Is}),t}var il={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vs=En(il),ba=X({},il,{view:0,detail:0}),E1=En(ba),Zo,Ko,xa,Ys=X({},ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$o,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==xa&&(xa&&e.type==="mousemove"?(Zo=e.screenX-xa.screenX,Ko=e.screenY-xa.screenY):Ko=Zo=0,xa=e),Zo)},movementY:function(e){return"movementY"in e?e.movementY:Ko}}),Yh=En(Ys),T1=X({},Ys,{dataTransfer:0}),A1=En(T1),C1=X({},ba,{relatedTarget:0}),Jo=En(C1),N1=X({},il,{animationName:0,elapsedTime:0,pseudoElement:0}),j1=En(N1),O1=X({},il,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),z1=En(O1),_1=X({},il,{data:0}),Gh=En(_1),q1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},R1={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"},M1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=M1[e])?!!t[e]:!1}function $o(){return D1}var L1=X({},ba,{key:function(e){if(e.key){var t=q1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?R1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$o,charCode:function(e){return e.type==="keypress"?Hs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),B1=En(L1),U1=X({},Ys,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fh=En(U1),H1=X({},il,{submitter:0}),I1=En(H1),V1=X({},ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$o}),Y1=En(V1),G1=X({},il,{propertyName:0,elapsedTime:0,pseudoElement:0}),F1=En(G1),Q1=X({},Ys,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),X1=En(Q1),Z1=X({},il,{newState:0,oldState:0,source:0}),K1=En(Z1),J1=[9,13,27,32],Po=rt&&"CompositionEvent"in window,Sa=null;rt&&"documentMode"in document&&(Sa=document.documentMode);var $1=rt&&"TextEvent"in window&&!Sa,Qh=rt&&(!Po||Sa&&8<Sa&&11>=Sa),Xh=" ",Zh=!1;function Kh(e,t){switch(e){case"keyup":return J1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sr=!1;function P1(e,t){switch(e){case"compositionend":return Jh(t);case"keypress":return t.which!==32?null:(Zh=!0,Xh);case"textInput":return e=t.data,e===Xh&&Zh?null:e;default:return null}}function W1(e,t){if(Sr)return e==="compositionend"||!Po&&Kh(e,t)?(e=Ih(),Us=Ll=sn=null,Sr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Qh&&t.locale!=="ko"?null:t.data;default:return null}}var ex={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 $h(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ex[e.type]:t==="textarea"}function Ph(e,t,i,s){Oe?Se?Se.push(s):Se=[s]:Oe=s,t=Gu(t,"onChange"),0<t.length&&(i=new Vs("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var wa=null,ka=null;function tx(e){Ug(e,0)}function Gs(e){var t=Di(e);if(Ls(t))return e}function Wh(e,t){if(e==="change")return t}var ep=!1;if(rt){var Wo;if(rt){var ec="oninput"in document;if(!ec){var tp=document.createElement("div");tp.setAttribute("oninput","return;"),ec=typeof tp.oninput=="function"}Wo=ec}else Wo=!1;ep=Wo&&(!document.documentMode||9<document.documentMode)}function np(){wa&&(wa.detachEvent("onpropertychange",ip),ka=wa=null)}function ip(e){if(e.propertyName==="value"&&Gs(ka)){var t=[];Ph(t,ka,e,pe(e)),ot(tx,t)}}function nx(e,t,i){e==="focusin"?(np(),wa=t,ka=i,wa.attachEvent("onpropertychange",ip)):e==="focusout"&&np()}function ix(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Gs(ka)}function lx(e,t){if(e==="click")return Gs(t)}function rx(e,t){if(e==="input"||e==="change")return Gs(t)}function ax(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Un=typeof Object.is=="function"?Object.is:ax;function Ea(e,t){if(Un(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var c=i[s];if(!qt.call(t,c)||!Un(e[c],t[c]))return!1}return!0}function tc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function lp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rp(e,t){var i=lp(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=lp(i)}}function ap(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ap(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function sp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=tc(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=tc(e.document)}return t}function nc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var sx=rt&&"documentMode"in document&&11>=document.documentMode,wr=null,ic=null,Ta=null,lc=!1;function up(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;lc||wr==null||wr!==tc(s)||(s=wr,"selectionStart"in s&&nc(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Ta&&Ea(Ta,s)||(Ta=s,s=Gu(ic,"onSelect"),0<s.length&&(t=new Vs("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=wr)))}function Bl(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var kr={animationend:Bl("Animation","AnimationEnd"),animationiteration:Bl("Animation","AnimationIteration"),animationstart:Bl("Animation","AnimationStart"),transitionrun:Bl("Transition","TransitionRun"),transitionstart:Bl("Transition","TransitionStart"),transitioncancel:Bl("Transition","TransitionCancel"),transitionend:Bl("Transition","TransitionEnd")},rc={},op={};rt&&(op=document.createElement("div").style,"AnimationEvent"in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),"TransitionEvent"in window||delete kr.transitionend.transition);function Ul(e){if(rc[e])return rc[e];if(!kr[e])return e;var t=kr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in op)return rc[e]=t[i];return e}var cp=Ul("animationend"),fp=Ul("animationiteration"),dp=Ul("animationstart"),ux=Ul("transitionrun"),ox=Ul("transitionstart"),cx=Ul("transitioncancel"),hp=Ul("transitionend"),pp=new Map,ac="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");ac.push("scrollEnd");function ri(e,t){pp.set(e,t),vi(t,[e])}var fx=0;function Bi(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=oi.identifierPrefix;var i=fx++;return e="_"+e+"t_"+i.toString(32)+"_",t.autoName=e}function mp(e){if(e==null||typeof e=="string")return e;var t=null,i=Yr;if(i!==null)for(var s=0;s<i.length;s++){var c=e[i[s]];if(c!=null){if(c==="none")return"none";t=t==null?c:t+(" "+c)}}return t??e.default}function Ui(e,t){return e=mp(e),t=mp(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Fs=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Xn=[],Er=0,sc=0;function Qs(){for(var e=Er,t=sc=Er=0;t<e;){var i=Xn[t];Xn[t++]=null;var s=Xn[t];Xn[t++]=null;var c=Xn[t];Xn[t++]=null;var d=Xn[t];if(Xn[t++]=null,s!==null&&c!==null){var b=s.pending;b===null?c.next=c:(c.next=b.next,b.next=c),s.pending=c}d!==0&&gp(i,c,d)}}function Xs(e,t,i,s){Xn[Er++]=e,Xn[Er++]=t,Xn[Er++]=i,Xn[Er++]=s,sc|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function uc(e,t,i,s){return Xs(e,t,i,s),Zs(e)}function Hl(e,t){return Xs(e,null,null,t),Zs(e)}function gp(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var c=!1,d=e.return;d!==null;)d.childLanes|=i,s=d.alternate,s!==null&&(s.childLanes|=i),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-St(i),e=d.hiddenUpdates,s=e[c],s===null?e[c]=[t]:s.push(t),t.lane=i|536870912),d):null}function Zs(e){if(50<Xa)throw Xa=0,Lu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Tr={};function dx(e,t,i,s){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(e,t,i,s){return new dx(e,t,i,s)}function oc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hi(e,t){var i=e.alternate;return i===null?(i=jn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&1206910976,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function yp(e,t){e.flags&=1206910978;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ks(e,t,i,s,c,d){var b=0;if(s=e,typeof s=="function")oc(s)&&(b=1);else if(typeof s=="string")b=HS(e,i,Re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(s){case lt:return e=jn(31,i,t,c),e.elementType=lt,e.lanes=d,e;case K:return Il(i.children,c,d,t);case ee:b=8,c|=24;break;case Ee:return e=jn(12,i,t,c|2),e.elementType=Ee,e.lanes=d,e;case ue:return e=jn(13,i,t,c),e.elementType=ue,e.lanes=d,e;case ce:return e=jn(19,i,t,c),e.elementType=ce,e.lanes=d,e;case pt:case q:return e=c|32,e=jn(30,i,t,e),e.elementType=q,e.lanes=d,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case re:b=10;break e;case qe:b=9;break e;case F:b=11;break e;case Te:b=14;break e;case N:b=16,s=null;break e}b=29,i=Error(a(130,e===null?"null":typeof e,"")),s=null}return t=jn(b,i,t,c),t.elementType=e,t.type=s,t.lanes=d,t}function Il(e,t,i,s){return e=jn(7,e,s,t),e.lanes=i,e}function cc(e,t,i){return e=jn(6,e,null,t),e.lanes=i,e}function vp(e){var t=jn(18,null,null,0);return t.stateNode=e,t}function fc(e,t,i){return t=jn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var bp=new WeakMap;function Zn(e,t){if(typeof e=="object"&&e!==null){var i=bp.get(e);return i!==void 0?i:(t={value:e,source:t,stack:De(t)},bp.set(e,t),t)}return{value:e,source:t,stack:De(t)}}var Ar=[],Cr=0,Js=null,Aa=0,Kn=[],Jn=0,ll=null,bi=1,xi="";function Ii(e,t){Ar[Cr++]=Aa,Ar[Cr++]=Js,Js=e,Aa=t}function xp(e,t,i){Kn[Jn++]=bi,Kn[Jn++]=xi,Kn[Jn++]=ll,ll=e;var s=bi;e=xi;var c=32-St(s)-1;s&=~(1<<c),i+=1;var d=32-St(t)+c;if(30<d){var b=c-c%5;d=(s&(1<<b)-1).toString(32),s>>=b,c-=b,bi=1<<32-St(t)+c|i<<c|s,xi=d+e}else bi=1<<d|i<<c|s,xi=e}function $s(e){e.return!==null&&(Ii(e,1),xp(e,1,0))}function dc(e){for(;e===Js;)Js=Ar[--Cr],Ar[Cr]=null,Aa=Ar[--Cr],Ar[Cr]=null;for(;e===ll;)ll=Kn[--Jn],Kn[Jn]=null,xi=Kn[--Jn],Kn[Jn]=null,bi=Kn[--Jn],Kn[Jn]=null}function Sp(e,t){Kn[Jn++]=bi,Kn[Jn++]=xi,Kn[Jn++]=ll,bi=t.id,xi=t.overflow,ll=e}var ln=null,Ot=null,Ye=!1,rl=null,$n=!1,hc=Error(a(519));function al(e){var t=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ca(Zn(t,e)),hc}function wp(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[Pt]=e,t[nn]=s,i){case"dialog":Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":case"embed":Qe("load",t);break;case"video":case"audio":for(i=0;i<Ka.length;i++)Qe(Ka[i],t);break;case"source":Qe("error",t);break;case"img":case"image":case"link":Qe("error",t),Qe("load",t);break;case"details":Qe("toggle",t);break;case"input":Qe("invalid",t),ga(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Qe("invalid",t);break;case"textarea":Qe("invalid",t),va(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||Yg(t.textContent,i)?(s.popover!=null&&(Qe("beforetoggle",t),Qe("toggle",t)),s.onScroll!=null&&Qe("scroll",t),s.onScrollEnd!=null&&Qe("scrollend",t),s.onClick!=null&&(t.onclick=I),t=!0):t=!1,t||al(e,!0)}function Ps(e){for(ln=e.return;ln;)switch(ln.tag){case 5:case 31:case 13:$n=!1;return;case 27:case 3:$n=!0;return;default:ln=ln.return}}function Nr(e){if(e!==ln)return!1;if(!Ye)return Ps(e),Ye=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Gf(e.type,e.memoizedProps)),i=!i),i&&Ot&&al(e),Ps(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Ot=uy(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Ot=uy(e)}else t===27?(t=Ot,wl(e.type)?(e=Wf,Wf=null,Ot=e):Ot=t):Ot=ln?Wn(e.stateNode.nextSibling):null;return!0}function Vl(){Ot=ln=null,Ye=!1}function pc(){var e=rl;return e!==null&&(_n===null?_n=e:_n.push.apply(_n,e),rl=null),e}function Ca(e){rl===null?rl=[e]:rl.push(e)}var mc=dt(null),Yl=null,Vi=null;function sl(e,t,i){Ie(mc,t._currentValue),t._currentValue=i}function Yi(e){e._currentValue=mc.current,$e(mc)}function Ws(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function gc(e,t,i,s){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var b=c.child;d=d.firstContext;e:for(;d!==null;){var w=d;d=c;for(var j=0;j<t.length;j++)if(w.context===t[j]){d.lanes|=i,w=d.alternate,w!==null&&(w.lanes|=i),Ws(d.return,i,e),s||(b=null);break e}d=w.next}}else if(c.tag===18){if(b=c.return,b===null)throw Error(a(341));b.lanes|=i,d=b.alternate,d!==null&&(d.lanes|=i),Ws(b,i,e),b=null}else c.tag===13&&c.memoizedState!==null&&c.memoizedState.dehydrated===null?(c.lanes|=i,b=c.alternate,b!==null&&(b.lanes|=i),Ws(c.return,i,e),b=c.child,b=b!==null?b.sibling:null):b=c.child;if(b!==null)b.return=c;else for(b=c;b!==null;){if(b===e){b=null;break}if(c=b.sibling,c!==null){c.return=b.return,b=c;break}b=b.return}c=b}}function Gl(e,t,i,s){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var b=c.alternate;if(b===null)throw Error(a(387));if(b=b.memoizedProps,b!==null){var w=c.type;Un(c.pendingProps.value,b.value)||(e!==null?e.push(w):e=[w])}}else if(c===It.current){if(b=c.alternate,b===null)throw Error(a(387));b.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Wr):e=[Wr])}c=c.return}return e!==null&&gc(t,e,i,s),t.flags|=262144,e!==null}function eu(e){for(e=e.firstContext;e!==null;){if(!Un(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Fl(e){Yl=e,Vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function un(e){return kp(Yl,e)}function tu(e,t){return Yl===null&&Fl(e),kp(e,t)}function kp(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Vi===null){if(e===null)throw Error(a(308));Vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vi=Vi.next=t;return i}var hx=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},px=n.unstable_scheduleCallback,mx=n.unstable_NormalPriority,Xt={$$typeof:re,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yc(){return{controller:new hx,data:new Map,refCount:0}}function Na(e){e.refCount--,e.refCount===0&&px(mx,function(){e.controller.abort()})}function Ep(e,t){if((e.pendingLanes&4194048)!==0){var i=e.transitionTypes;for(i===null&&(i=e.transitionTypes=[]),e=0;e<t.length;e++){var s=t[e];i.indexOf(s)===-1&&i.push(s)}}}var ja=null;function gx(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Oa=null,vc=0,Ql=0,jr=null;function yx(e,t){if(Oa===null){var i=Oa=[];vc=0,Ql=Mf(),jr={status:"pending",value:void 0,then:function(s){i.push(s)}}}return vc++,t.then(Tp,Tp),t}function Tp(){if(--vc===0&&(ja=null,Oa!==null)){jr!==null&&(jr.status="fulfilled");var e=Oa;Oa=null,Ql=0,jr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function vx(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(c){i.push(c)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var c=0;c<i.length;c++)(0,i[c])(t)},function(c){for(s.status="rejected",s.reason=c,c=0;c<i.length;c++)(0,i[c])(void 0)}),s}var Ap=J.S;J.S=function(e,t){if(vg=bt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&yx(e,t),ja!==null)for(var i=Xr;i!==null;)Ep(i,ja),i=i.next;if(i=e.types,i!==null){for(var s=Xr;s!==null;)Ep(s,i),s=s.next;if(Ql!==0){s=ja,s===null&&(s=ja=[]);for(var c=0;c<i.length;c++){var d=i[c];s.indexOf(d)===-1&&s.push(d)}}}Ap!==null&&Ap(e,t)};var Xl=dt(null);function bc(){var e=Xl.current;return e!==null?e:At.pooledCache}function nu(e,t){t===null?Ie(Xl,Xl.current):Ie(Xl,t.pool)}function Cp(){var e=bc();return e===null?null:{parent:Xt._currentValue,pool:e}}var Or=Error(a(460)),xc=Error(a(474)),iu=Error(a(542)),lu={then:function(){}};function Np(e){return e=e.status,e==="fulfilled"||e==="rejected"}function jp(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(I,I),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,zp(e),e===void 0&&!("reason"in t)?Error(a(600)):e;default:if(typeof t.status=="string")t.then(I,I);else{if(e=At,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=s}},function(s){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,zp(e),e}throw Kl=t,Or}}function Zl(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Kl=i,Or):i}}var Kl=null;function Op(){if(Kl===null)throw Error(a(459));var e=Kl;return Kl=null,e}function zp(e){if(e===Or||e===iu)throw Error(a(483))}var zr=null,za=0;function ru(e){var t=za;return za+=1,zr===null&&(zr=[]),jp(zr,e,t)}function ul(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function au(e,t){throw t.$$typeof===le?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function _p(e){function t(B,D){if(e){var V=B.deletions;V===null?(B.deletions=[D],B.flags|=16):V.push(D)}}function i(B,D){if(!e)return null;for(;D!==null;)t(B,D),D=D.sibling;return null}function s(B){for(var D=new Map;B!==null;)B.key===null?D.set(B.index,B):D.set(B.key,B),B=B.sibling;return D}function c(B,D){return B=Hi(B,D),B.index=0,B.sibling=null,B}function d(B,D,V){return B.index=V,e?(V=B.alternate,V!==null?(V=V.index,V<D?(B.flags|=2,D):V):(B.flags|=134217730,D)):(B.flags|=1048576,D)}function b(B){return e&&B.alternate===null&&(B.flags|=134217730),B}function w(B,D,V,P){return D===null||D.tag!==6?(D=cc(V,B.mode,P),D.return=B,D):(D=c(D,V),D.return=B,D)}function j(B,D,V,P){var ve=V.type;return ve===K?(B=Q(B,D,V.props.children,P,V.key),ul(B,V),B):D!==null&&(D.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===N&&Zl(ve)===D.type)?(D=c(D,V.props),ul(D,V),D.return=B,D):(D=Ks(V.type,V.key,V.props,null,B.mode,P),ul(D,V),D.return=B,D)}function U(B,D,V,P){return D===null||D.tag!==4||D.stateNode.containerInfo!==V.containerInfo||D.stateNode.implementation!==V.implementation?(D=fc(V,B.mode,P),D.return=B,D):(D=c(D,V.children||[]),D.return=B,D)}function Q(B,D,V,P,ve){return D===null||D.tag!==7?(D=Il(V,B.mode,P,ve),D.return=B,D):(D=c(D,V),D.return=B,D)}function W(B,D,V){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=cc(""+D,B.mode,V),D.return=B,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case me:return V=Ks(D.type,D.key,D.props,null,B.mode,V),ul(V,D),V.return=B,V;case _:return D=fc(D,B.mode,V),D.return=B,D;case N:return D=Zl(D),W(B,D,V)}if(we(D)||ye(D))return D=Il(D,B.mode,V,null),D.return=B,D;if(typeof D.then=="function")return W(B,ru(D),V);if(D.$$typeof===re)return W(B,tu(B,D),V);au(B,D)}return null}function L(B,D,V,P){var ve=D!==null?D.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return ve!==null?null:w(B,D,""+V,P);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case me:return V.key===ve?j(B,D,V,P):null;case _:return V.key===ve?U(B,D,V,P):null;case N:return V=Zl(V),L(B,D,V,P)}if(we(V)||ye(V))return ve!==null?null:Q(B,D,V,P,null);if(typeof V.then=="function")return L(B,D,ru(V),P);if(V.$$typeof===re)return L(B,D,tu(B,V),P);au(B,V)}return null}function Y(B,D,V,P,ve){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return B=B.get(V)||null,w(D,B,""+P,ve);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case me:return B=B.get(P.key===null?V:P.key)||null,j(D,B,P,ve);case _:return B=B.get(P.key===null?V:P.key)||null,U(D,B,P,ve);case N:return P=Zl(P),Y(B,D,V,P,ve)}if(we(P)||ye(P))return B=B.get(V)||null,Q(D,B,P,ve,null);if(typeof P.then=="function")return Y(B,D,V,ru(P),ve);if(P.$$typeof===re)return Y(B,D,V,tu(D,P),ve);au(D,P)}return null}function de(B,D,V,P){for(var ve=null,Ke=null,Ae=D,_e=D=0,Jt=null;Ae!==null&&_e<V.length;_e++){Ae.index>_e?(Jt=Ae,Ae=null):Jt=Ae.sibling;var at=L(B,Ae,V[_e],P);if(at===null){Ae===null&&(Ae=Jt);break}e&&Ae&&at.alternate===null&&t(B,Ae),D=d(at,D,_e),Ke===null?ve=at:Ke.sibling=at,Ke=at,Ae=Jt}if(_e===V.length)return i(B,Ae),Ye&&Ii(B,_e),ve;if(Ae===null){for(;_e<V.length;_e++)Ae=W(B,V[_e],P),Ae!==null&&(D=d(Ae,D,_e),Ke===null?ve=Ae:Ke.sibling=Ae,Ke=Ae);return Ye&&Ii(B,_e),ve}for(Ae=s(Ae);_e<V.length;_e++)Jt=Y(Ae,B,_e,V[_e],P),Jt!==null&&(e&&(at=Jt.alternate,at!==null&&Ae.delete(at.key===null?_e:at.key)),D=d(Jt,D,_e),Ke===null?ve=Jt:Ke.sibling=Jt,Ke=Jt);return e&&Ae.forEach(function(Cl){return t(B,Cl)}),Ye&&Ii(B,_e),ve}function be(B,D,V,P){if(V==null)throw Error(a(151));for(var ve=null,Ke=null,Ae=D,_e=D=0,Jt=null,at=V.next();Ae!==null&&!at.done;_e++,at=V.next()){Ae.index>_e?(Jt=Ae,Ae=null):Jt=Ae.sibling;var Cl=L(B,Ae,at.value,P);if(Cl===null){Ae===null&&(Ae=Jt);break}e&&Ae&&Cl.alternate===null&&t(B,Ae),D=d(Cl,D,_e),Ke===null?ve=Cl:Ke.sibling=Cl,Ke=Cl,Ae=Jt}if(at.done)return i(B,Ae),Ye&&Ii(B,_e),ve;if(Ae===null){for(;!at.done;_e++,at=V.next())at=W(B,at.value,P),at!==null&&(D=d(at,D,_e),Ke===null?ve=at:Ke.sibling=at,Ke=at);return Ye&&Ii(B,_e),ve}for(Ae=s(Ae);!at.done;_e++,at=V.next())at=Y(Ae,B,_e,at.value,P),at!==null&&(e&&(Jt=at.alternate,Jt!==null&&Ae.delete(Jt.key===null?_e:Jt.key)),D=d(at,D,_e),Ke===null?ve=at:Ke.sibling=at,Ke=at);return e&&Ae.forEach(function(PS){return t(B,PS)}),Ye&&Ii(B,_e),ve}function Ue(B,D,V,P){if(typeof V=="object"&&V!==null&&V.type===K&&V.key===null&&V.props.ref===void 0&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case me:e:{for(var ve=V.key;D!==null;){if(D.key===ve){if(ve=V.type,ve===K){if(D.tag===7){i(B,D.sibling),P=c(D,V.props.children),ul(P,V),P.return=B,B=P;break e}}else if(D.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===N&&Zl(ve)===D.type){i(B,D.sibling),P=c(D,V.props),ul(P,V),P.return=B,B=P;break e}i(B,D);break}else t(B,D);D=D.sibling}V.type===K?(P=Il(V.props.children,B.mode,P,V.key),ul(P,V),P.return=B,B=P):(P=Ks(V.type,V.key,V.props,null,B.mode,P),ul(P,V),P.return=B,B=P)}return b(B);case _:e:{for(ve=V.key;D!==null;){if(D.key===ve)if(D.tag===4&&D.stateNode.containerInfo===V.containerInfo&&D.stateNode.implementation===V.implementation){i(B,D.sibling),P=c(D,V.children||[]),P.return=B,B=P;break e}else{i(B,D);break}else t(B,D);D=D.sibling}P=fc(V,B.mode,P),P.return=B,B=P}return b(B);case N:return V=Zl(V),Ue(B,D,V,P)}if(we(V))return de(B,D,V,P);if(ye(V)){if(ve=ye(V),typeof ve!="function")throw Error(a(150));return V=ve.call(V),be(B,D,V,P)}if(typeof V.then=="function")return Ue(B,D,ru(V),P);if(V.$$typeof===re)return Ue(B,D,tu(B,V),P);au(B,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,D!==null&&D.tag===6?(i(B,D.sibling),P=c(D,V),P.return=B,B=P):(i(B,D),P=cc(V,B.mode,P),P.return=B,B=P),b(B)):i(B,D)}return function(B,D,V,P){try{za=0;var ve=Ue(B,D,V,P);return zr=null,ve}catch(Ae){if(Ae===Or||Ae===iu)throw Ae;var Ke=jn(29,Ae,null,B.mode);return Ke.lanes=P,Ke.return=B,Ke}}}var Jl=_p(!0),qp=_p(!1),ol=!1;function Sc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function cl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fl(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(ft&2)!==0){var c=s.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),s.pending=t,t=Zs(e),gp(e,null,i),t}return Xs(e,s,t,i),Zs(e)}function _a(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,oa(e,i)}}function kc(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var c=null,d=null;if(i=i.firstBaseUpdate,i!==null){do{var b={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};d===null?c=d=b:d=d.next=b,i=i.next}while(i!==null);d===null?c=d=t:d=d.next=t}else c=d=t;i={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Ec=!1;function qa(){if(Ec){var e=jr;if(e!==null)throw e}}function Ra(e,t,i,s){Ec=!1;var c=e.updateQueue;ol=!1;var d=c.firstBaseUpdate,b=c.lastBaseUpdate,w=c.shared.pending;if(w!==null){c.shared.pending=null;var j=w,U=j.next;j.next=null,b===null?d=U:b.next=U,b=j;var Q=e.alternate;Q!==null&&(Q=Q.updateQueue,w=Q.lastBaseUpdate,w!==b&&(w===null?Q.firstBaseUpdate=U:w.next=U,Q.lastBaseUpdate=j))}if(d!==null){var W=c.baseState;b=0,Q=U=j=null,w=d;do{var L=w.lane&-536870913,Y=L!==w.lane;if(Y?(Ze&L)===L:(s&L)===L){L!==0&&L===Ql&&(Ec=!0),Q!==null&&(Q=Q.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var de=e,be=w;L=t;var Ue=i;switch(be.tag){case 1:if(de=be.payload,typeof de=="function"){W=de.call(Ue,W,L);break e}W=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=be.payload,L=typeof de=="function"?de.call(Ue,W,L):de,L==null)break e;W=X({},W,L);break e;case 2:ol=!0}}L=w.callback,L!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=c.callbacks,Y===null?c.callbacks=[L]:Y.push(L))}else Y={lane:L,tag:w.tag,payload:w.payload,callback:w.callback,next:null},Q===null?(U=Q=Y,j=W):Q=Q.next=Y,b|=L;if(w=w.next,w===null){if(w=c.shared.pending,w===null)break;Y=w,w=Y.next,Y.next=null,c.lastBaseUpdate=Y,c.shared.pending=null}}while(!0);Q===null&&(j=W),c.baseState=j,c.firstBaseUpdate=U,c.lastBaseUpdate=Q,d===null&&(c.shared.lanes=0),vl|=b,e.lanes=b,e.memoizedState=W}}function Rp(e,t){if(typeof e!="function")throw Error(a(191,e));e.call(t)}function Mp(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Rp(i[e],t)}var dl=dt(null),su=dt(0);function Dp(e,t){e=Zi,Ie(su,e),Ie(dl,t),Zi=e|t.baseLanes}function Tc(){Ie(su,Zi),Ie(dl,dl.current)}function Ac(){Zi=su.current,$e(dl),$e(su)}var on=dt(null),bn=null;function hl(e){var t=e.alternate;Ie(cn,cn.current&1),Ie(on,e),bn===null&&(t===null||dl.current!==null||t.memoizedState!==null)&&(bn=e)}function Cc(e){Ie(cn,cn.current),Ie(on,e),bn===null&&(bn=e)}function Lp(e){e.tag===22?(Ie(cn,cn.current),Ie(on,e),bn===null&&(bn=e)):pl()}function pl(){Ie(cn,cn.current),Ie(on,on.current)}function Hn(e){$e(on),bn===e&&(bn=null),$e(cn)}var cn=dt(0);function Ma(e,t){Ie(on,on.current),Ie(cn,t)}function Nc(e){$e(cn),$e(on),bn===e&&(bn=null)}function uu(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||$f(i)||Pf(i)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Gi=0,Be=null,kt=null,Zt=null,ou=!1,_r=!1,$l=!1,cu=0,Da=0,qr=null,bx=0;function Ut(){throw Error(a(321))}function jc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Un(e[i],t[i]))return!1;return!0}function Oc(e,t,i,s,c,d){return Gi=d,Be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,J.H=e===null||e.memoizedState===null?xm:Sm,$l=!1,d=i(s,c),$l=!1,_r&&(d=Up(t,i,s,c)),Bp(e),d}function Bp(e){J.H=yu;var t=kt!==null&&kt.next!==null;if(Gi=0,Zt=kt=Be=null,ou=!1,Da=0,qr=null,t)throw Error(a(300));e===null||Kt||(e=e.dependencies,e!==null&&eu(e)&&(Kt=!0))}function Up(e,t,i,s){Be=e;var c=0;do{if(_r&&(qr=null),Da=0,_r=!1,25<=c)throw Error(a(301));if(c+=1,Zt=kt=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}J.H=Cx,d=t(i,s)}while(_r);return d}function xx(){var e=J.H,t=e.useState()[0];return t=typeof t.then=="function"?La(t):t,e=e.useState()[0],(kt!==null?kt.memoizedState:null)!==e&&(Be.flags|=1024),t}function zc(){var e=cu!==0;return cu=0,e}function _c(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function qc(e){if(ou){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ou=!1}Gi=0,Zt=kt=Be=null,_r=!1,Da=cu=0,qr=null}function Tn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zt===null?Be.memoizedState=Zt=e:Zt=Zt.next=e,Zt}function Gt(){if(kt===null){var e=Be.alternate;e=e!==null?e.memoizedState:null}else e=kt.next;var t=Zt===null?Be.memoizedState:Zt.next;if(t!==null)Zt=t,kt=e;else{if(e===null)throw Be.alternate===null?Error(a(467)):Error(a(310));kt=e,e={memoizedState:kt.memoizedState,baseState:kt.baseState,baseQueue:kt.baseQueue,queue:kt.queue,next:null},Zt===null?Be.memoizedState=Zt=e:Zt=Zt.next=e}return Zt}function fu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function La(e){var t=Da;return Da+=1,qr===null&&(qr=[]),e=jp(qr,e,t),t=Be,(Zt===null?t.memoizedState:Zt.next)===null&&(t=t.alternate,J.H=t===null||t.memoizedState===null?xm:Sm),e}function du(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return La(e);if(e.$$typeof===ne)return;if(e.$$typeof===re)return un(e)}throw Error(a(438,String(e)))}function Rc(e){var t=null,i=Be.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=Be.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=fu(),Be.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=R;return t.index++,i}function Fi(e,t){return typeof t=="function"?t(e):t}function hu(e){var t=Gt();return Mc(t,kt,e)}function Mc(e,t,i){var s=e.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=i;var c=e.baseQueue,d=s.pending;if(d!==null){if(c!==null){var b=c.next;c.next=d.next,d.next=b}t.baseQueue=c=d,s.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var w=b=null,j=null,U=t,Q=!1;do{var W=U.lane&-536870913;if(W!==U.lane?(Ze&W)===W:(Gi&W)===W){var L=U.revertLane;if(L===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),W===Ql&&(Q=!0);else if((Gi&L)===L){U=U.next,L===Ql&&(Q=!0);continue}else W={lane:0,revertLane:U.revertLane,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},j===null?(w=j=W,b=d):j=j.next=W,Be.lanes|=L,vl|=L;W=U.action,$l&&i(d,W),d=U.hasEagerState?U.eagerState:i(d,W)}else L={lane:W,revertLane:U.revertLane,gesture:U.gesture,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},j===null?(w=j=L,b=d):j=j.next=L,Be.lanes|=W,vl|=W;U=U.next}while(U!==null&&U!==t);if(j===null?b=d:j.next=w,!Un(d,e.memoizedState)&&(Kt=!0,Q&&(i=jr,i!==null)))throw i;e.memoizedState=d,e.baseState=b,e.baseQueue=j,s.lastRenderedState=d}return c===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Dc(e){var t=Gt(),i=t.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=e;var s=i.dispatch,c=i.pending,d=t.memoizedState;if(c!==null){i.pending=null;var b=c=c.next;do d=e(d,b.action),b=b.next;while(b!==c);Un(d,t.memoizedState)||(Kt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),i.lastRenderedState=d}return[d,s]}function Hp(e,t,i){var s=Be,c=Gt(),d=Ye;if(d){if(i===void 0)throw Error(a(407));i=i()}else i=t();var b=!Un((kt||c).memoizedState,i);if(b&&(c.memoizedState=i,Kt=!0),c=c.queue,Uc(Yp.bind(null,s,c,e),[e]),e=c.getSnapshot!==t||b||Zt!==null&&(Zt.memoizedState.tag&1)!==0,Rr(e?9:8,{destroy:void 0},Vp.bind(null,s,c,i,t),null),e){if(s.flags|=2048,At===null)throw Error(a(349));d||(Gi&127)!==0||Ip(s,t,i)}return i}function Ip(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Be.updateQueue,t===null?(t=fu(),Be.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Vp(e,t,i,s){t.value=i,t.getSnapshot=s,Gp(t)&&Fp(e)}function Yp(e,t,i){return i(function(){Gp(t)&&Fp(e)})}function Gp(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Un(e,i)}catch{return!0}}function Fp(e){var t=Hl(e,2);t!==null&&qn(t,e,2)}function Lc(e){var t=Tn();if(typeof e=="function"){var i=e;if(e=i(),$l){xt(!0);try{i()}finally{xt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:e},t}function Qp(e,t,i,s){return e.baseState=i,Mc(e,kt,typeof s=="function"?s:Fi)}function Sx(e,t,i,s,c){if(gu(e))throw Error(a(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){d.listeners.push(b)}};J.T!==null?i(!0):d.isTransition=!1,s(d),i=t.pending,i===null?(d.next=t.pending=d,Xp(t,d)):(d.next=i.next,t.pending=i.next=d)}}function Xp(e,t){var i=t.action,s=t.payload,c=e.state;if(t.isTransition){var d=J.T,b={};b.types=d!==null?d.types:null,J.T=b;try{var w=i(c,s),j=J.S;j!==null&&j(b,w),Zp(e,t,w)}catch(U){Bc(e,t,U)}finally{d!==null&&b.types!==null&&(d.types=b.types),J.T=d}}else try{d=i(c,s),Zp(e,t,d)}catch(U){Bc(e,t,U)}}function Zp(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){Kp(e,t,s)},function(s){return Bc(e,t,s)}):Kp(e,t,i)}function Kp(e,t,i){t.status="fulfilled",t.value=i,Jp(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Xp(e,i)))}function Bc(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,Jp(t),t=t.next;while(t!==s)}e.action=null}function Jp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $p(e,t){return t}function Pp(e,t){if(Ye){var i=At.formState;if(i!==null){e:{var s=Be;if(Ye){if(Ot){t:{for(var c=Ot,d=$n;c.nodeType!==8;){if(!d){c=null;break t}if(c=Wn(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){Ot=Wn(c.nextSibling),s=c.data==="F!";break e}}al(s)}s=!1}s&&(t=i[0])}}return i=Tn(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$p,lastRenderedState:t},i.queue=s,i=ym.bind(null,Be,s),s.dispatch=i,s=Lc(!1),d=Gc.bind(null,Be,!1,s.queue),s=Tn(),c={state:t,dispatch:null,action:e,pending:null},s.queue=c,i=Sx.bind(null,Be,c,d,i),c.dispatch=i,s.memoizedState=e,[t,i,!1]}function Wp(e){var t=Gt();return em(t,kt,e)}function em(e,t,i){if(t=Mc(e,t,$p)[0],e=hu(Fi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=La(t)}catch(b){throw b===Or?iu:b}else s=t;t=Gt();var c=t.queue,d=c.dispatch;return i!==t.memoizedState&&(Be.flags|=2048,Rr(9,{destroy:void 0},wx.bind(null,c,i),null)),[s,d,e]}function wx(e,t){e.action=t}function tm(e){var t=Gt(),i=kt;if(i!==null)return em(t,i,e);Gt(),t=t.memoizedState,i=Gt();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function Rr(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=Be.updateQueue,t===null&&(t=fu(),Be.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function nm(){return Gt().memoizedState}function pu(e,t,i,s){var c=Tn();Be.flags|=e,c.memoizedState=Rr(1|t,{destroy:void 0},i,s===void 0?null:s)}function mu(e,t,i,s){var c=Gt();s=s===void 0?null:s;var d=c.memoizedState.inst;kt!==null&&s!==null&&jc(s,kt.memoizedState.deps)?c.memoizedState=Rr(t,d,i,s):(Be.flags|=e,c.memoizedState=Rr(1|t,d,i,s))}function im(e,t){pu(8390656,8,e,t)}function Uc(e,t){mu(2048,8,e,t)}function kx(e){Be.flags|=4;var t=Be.updateQueue;if(t===null)t=fu(),Be.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function lm(e){var t=Gt().memoizedState;return kx({ref:t,nextImpl:e}),function(){if((ft&2)!==0)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function rm(e,t){return mu(4,2,e,t)}function am(e,t){return mu(4,4,e,t)}function sm(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function um(e,t,i){i=i!=null?i.concat([e]):null,mu(4,4,sm.bind(null,t,e),i)}function Hc(){}function om(e,t){var i=Gt();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&jc(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function cm(e,t){var i=Gt();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&jc(t,s[1]))return s[0];if(s=e(),$l){xt(!0);try{e()}finally{xt(!1)}}return i.memoizedState=[s,t],s}function Ic(e,t,i){return i===void 0||(Gi&1073741824)!==0&&(Ze&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=xg(),Be.lanes|=e,vl|=e,i)}function fm(e,t,i,s){return Un(i,t)?i:dl.current!==null?(e=Ic(e,i,s),Un(e,t)||(Kt=!0),e):(Gi&106)===0||(Gi&1073741824)!==0&&(Ze&261930)===0?(Kt=!0,e.memoizedState=i):(e=xg(),Be.lanes|=e,vl|=e,t)}function dm(e,t,i,s,c){var d=he.p;he.p=d!==0&&8>d?d:8;var b=J.T,w={};w.types=b!==null?b.types:null,J.T=w,Gc(e,!1,t,i);try{var j=c(),U=J.S;if(U!==null&&U(w,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var Q=vx(j,s);Ba(e,t,Q,Gn(e))}else Ba(e,t,s,Gn(e))}catch(W){Ba(e,t,{then:function(){},status:"rejected",reason:W},Gn())}finally{he.p=d,b!==null&&w.types!==null&&(b.types=w.types),J.T=b}}function Ex(){}function Vc(e,t,i,s){if(e.tag!==5)throw Error(a(476));var c=hm(e).queue;dm(e,c,t,ut,i===null?Ex:function(){return pm(e),i(s)})}function hm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ut,baseState:ut,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:ut},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function pm(e){var t=hm(e);t.next===null&&(t=e.alternate.memoizedState),Ba(e,t.next.queue,{},Gn())}function Yc(){return un(Wr)}function mm(){return Gt().memoizedState}function gm(){return Gt().memoizedState}function Tx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Gn();e=cl(i);var s=fl(t,e,i);s!==null&&(qn(s,t,i),_a(s,t,i)),t={cache:yc()},e.payload=t;return}t=t.return}}function Ax(e,t,i){var s=Gn();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},gu(e)?vm(t,i):(i=uc(e,t,i,s),i!==null&&(qn(i,e,s),bm(i,t,s)))}function ym(e,t,i){var s=Gn();Ba(e,t,i,s)}function Ba(e,t,i,s){var c={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(gu(e))vm(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var b=t.lastRenderedState,w=d(b,i);if(c.hasEagerState=!0,c.eagerState=w,Un(w,b))return Xs(e,t,c,0),At===null&&Qs(),!1}catch{}if(i=uc(e,t,c,s),i!==null)return qn(i,e,s),bm(i,t,s),!0}return!1}function Gc(e,t,i,s){if(s={lane:2,revertLane:Mf(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},gu(e)){if(t)throw Error(a(479))}else t=uc(e,i,s,2),t!==null&&qn(t,e,2)}function gu(e){var t=e.alternate;return e===Be||t!==null&&t===Be}function vm(e,t){_r=ou=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function bm(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,oa(e,i)}}var yu={readContext:un,use:du,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useLayoutEffect:Ut,useInsertionEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useSyncExternalStore:Ut,useId:Ut,useHostTransitionStatus:Ut,useFormState:Ut,useActionState:Ut,useOptimistic:Ut,useMemoCache:Ut,useCacheRefresh:Ut,useEffectEvent:Ut},xm={readContext:un,use:du,useCallback:function(e,t){return Tn().memoizedState=[e,t===void 0?null:t],e},useContext:un,useEffect:im,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,pu(4194308,4,sm.bind(null,t,e),i)},useLayoutEffect:function(e,t){return pu(4194308,4,e,t)},useInsertionEffect:function(e,t){pu(4,2,e,t)},useMemo:function(e,t){var i=Tn();t=t===void 0?null:t;var s=e();if($l){xt(!0);try{e()}finally{xt(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=Tn();if(i!==void 0){var c=i(t);if($l){xt(!0);try{i(t)}finally{xt(!1)}}}else c=t;return s.memoizedState=s.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},s.queue=e,e=e.dispatch=Ax.bind(null,Be,e),[s.memoizedState,e]},useRef:function(e){var t=Tn();return e={current:e},t.memoizedState=e},useState:function(e){e=Lc(e);var t=e.queue,i=ym.bind(null,Be,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Hc,useDeferredValue:function(e,t){var i=Tn();return Ic(i,e,t)},useTransition:function(){var e=Lc(!1);return e=dm.bind(null,Be,e.queue,!0,!1),Tn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Be,c=Tn();if(Ye){if(i===void 0)throw Error(a(407));i=i()}else{if(i=t(),At===null)throw Error(a(349));(Ze&127)!==0||Ip(s,t,i)}c.memoizedState=i;var d={value:i,getSnapshot:t};return c.queue=d,im(Yp.bind(null,s,d,e),[e]),s.flags|=2048,Rr(9,{destroy:void 0},Vp.bind(null,s,d,i,t),null),i},useId:function(){var e=Tn(),t=At.identifierPrefix;if(Ye){var i=xi,s=bi;i=(s&~(1<<32-St(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=cu++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=bx++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Yc,useFormState:Pp,useActionState:Pp,useOptimistic:function(e){var t=Tn();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Gc.bind(null,Be,!0,i),i.dispatch=t,[e,t]},useMemoCache:Rc,useCacheRefresh:function(){return Tn().memoizedState=Tx.bind(null,Be)},useEffectEvent:function(e){var t=Tn(),i={impl:e};return t.memoizedState=i,function(){if((ft&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}},Sm={readContext:un,use:du,useCallback:om,useContext:un,useEffect:Uc,useImperativeHandle:um,useInsertionEffect:rm,useLayoutEffect:am,useMemo:cm,useReducer:hu,useRef:nm,useState:function(){return hu(Fi)},useDebugValue:Hc,useDeferredValue:function(e,t){var i=Gt();return fm(i,kt.memoizedState,e,t)},useTransition:function(){var e=hu(Fi)[0],t=Gt().memoizedState;return[typeof e=="boolean"?e:La(e),t]},useSyncExternalStore:Hp,useId:mm,useHostTransitionStatus:Yc,useFormState:Wp,useActionState:Wp,useOptimistic:function(e,t){var i=Gt();return Qp(i,kt,e,t)},useMemoCache:Rc,useCacheRefresh:gm,useEffectEvent:lm},Cx={readContext:un,use:du,useCallback:om,useContext:un,useEffect:Uc,useImperativeHandle:um,useInsertionEffect:rm,useLayoutEffect:am,useMemo:cm,useReducer:Dc,useRef:nm,useState:function(){return Dc(Fi)},useDebugValue:Hc,useDeferredValue:function(e,t){var i=Gt();return kt===null?Ic(i,e,t):fm(i,kt.memoizedState,e,t)},useTransition:function(){var e=Dc(Fi)[0],t=Gt().memoizedState;return[typeof e=="boolean"?e:La(e),t]},useSyncExternalStore:Hp,useId:mm,useHostTransitionStatus:Yc,useFormState:tm,useActionState:tm,useOptimistic:function(e,t){var i=Gt();return kt!==null?Qp(i,kt,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Rc,useCacheRefresh:gm,useEffectEvent:lm};function Fc(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:X({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Qc={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=Gn(),c=cl(s);c.payload=t,i!=null&&(c.callback=i),t=fl(e,c,s),t!==null&&(qn(t,e,s),_a(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=Gn(),c=cl(s);c.tag=1,c.payload=t,i!=null&&(c.callback=i),t=fl(e,c,s),t!==null&&(qn(t,e,s),_a(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Gn(),s=cl(i);s.tag=2,t!=null&&(s.callback=t),t=fl(e,s,i),t!==null&&(qn(t,e,i),_a(t,e,i))}};function wm(e,t,i,s,c,d,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,d,b):t.prototype&&t.prototype.isPureReactComponent?!Ea(i,s)||!Ea(c,d):!0}function km(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&Qc.enqueueReplaceState(t,t.state,null)}function Pl(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=X({},i));for(var c in e)i[c]===void 0&&(i[c]=e[c])}return i}function Em(e){Fs(e)}function Tm(e){console.error(e)}function Am(e){Fs(e)}function vu(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Cm(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Xc(e,t,i){return i=cl(i),i.tag=3,i.payload={element:null},i.callback=function(){vu(e,t)},i}function Nm(e){return e=cl(e),e.tag=3,e}function jm(e,t,i,s){var c=i.type.getDerivedStateFromError;if(typeof c=="function"){var d=s.value;e.payload=function(){return c(d)},e.callback=function(){Cm(t,i,s)}}var b=i.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Cm(t,i,s),typeof c!="function"&&(bl===null?bl=new Set([this]):bl.add(this));var w=s.stack;this.componentDidCatch(s.value,{componentStack:w!==null?w:""})})}function Nx(e,t,i,s,c){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Gl(t,i,c,!0),i=on.current,i!==null){switch(i.tag){case 31:case 13:case 19:return bn===null?Uu():i.alternate===null&&Ht===0&&(Ht=3),i.flags&=-257,i.flags|=65536,i.lanes=c,s===lu?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),_f(e,s,c)),!1;case 22:return i.flags|=65536,s===lu?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),_f(e,s,c)),!1}throw Error(a(435,i.tag))}return _f(e,s,c),Uu(),!1}if(Ye)return t=on.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,s!==hc&&(e=Error(a(422),{cause:s}),Ca(Zn(e,i)))):(s!==hc&&(t=Error(a(423),{cause:s}),Ca(Zn(t,i))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,s=Zn(s,i),c=Xc(e.stateNode,s,c),kc(e,c),Ht!==4&&(Ht=2)),!1;var d=Error(a(520),{cause:s});if(d=Zn(d,i),Qa===null?Qa=[d]:Qa.push(d),Ht!==4&&(Ht=2),t===null)return!0;s=Zn(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=c&-c,i.lanes|=e,e=Xc(i.stateNode,s,e),kc(i,e),!1;case 1:if(t=i.type,d=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(bl===null||!bl.has(d))))return i.flags|=65536,c&=-c,i.lanes|=c,c=Nm(c),jm(c,e,i,s),kc(i,c),!1;break;case 22:if(i.memoizedState!==null)return i.flags|=65536,!1}i=i.return}while(i!==null);return!1}var Zc=Error(a(461)),Kt=!1;function Wt(e,t,i,s){t.child=e===null?qp(t,null,i,s):Jl(t,e.child,i,s)}function Om(e,t,i,s,c){i=i.render;var d=t.ref;if("ref"in s){var b={};for(var w in s)w!=="ref"&&(b[w]=s[w])}else b=s;return Fl(t),s=Oc(e,t,i,b,d,c),w=zc(),e!==null&&!Kt?(_c(e,t,c),Qi(e,t,c)):(Ye&&w&&$s(t),t.flags|=1,Wt(e,t,s,c),t.child)}function zm(e,t,i,s,c){if(e===null){var d=i.type;return typeof d=="function"&&!oc(d)&&d.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=d,_m(e,t,d,s,c)):(e=Ks(i.type,null,s,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!nf(e,c)){var b=d.memoizedProps;if(i=i.compare,i=i!==null?i:Ea,i(b,s)&&e.ref===t.ref)return Qi(e,t,c)}return t.flags|=1,e=Hi(d,s),e.ref=t.ref,e.return=t,t.child=e}function _m(e,t,i,s,c){if(e!==null){var d=e.memoizedProps;if(Ea(d,s)&&e.ref===t.ref)if(Kt=!1,t.pendingProps=s=d,nf(e,c))(e.flags&131072)!==0&&(Kt=!0);else return t.lanes=e.lanes,Qi(e,t,c)}return Kc(e,t,i,s,c)}function qm(e,t,i,s){var c=s.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|i:i,e!==null){for(s=t.child=e.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~d}else s=0,t.child=null;return Rm(e,t,d,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&nu(t,d!==null?d.cachePool:null),d!==null?Dp(t,d):Tc(),Lp(t);else return s=t.lanes=536870912,Rm(e,t,d!==null?d.baseLanes|i:i,i,s)}else d!==null?(nu(t,d.cachePool),Dp(t,d),pl(),t.memoizedState=null):(e!==null&&nu(t,null),Tc(),pl());return Wt(e,t,c,i),t.child}function Ua(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Rm(e,t,i,s,c){var d=bc();return d=d===null?null:{parent:Xt._currentValue,pool:d},t.memoizedState={baseLanes:i,cachePool:d},e!==null&&nu(t,null),Tc(),Lp(t),e!==null&&Gl(e,t,s,!0),t.childLanes=c,null}function bu(e,t){return t=xu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Mm(e,t,i){return Jl(t,e.child,null,i),e=bu(t,t.pendingProps),e.flags|=2,Hn(t),t.memoizedState=null,e}function jx(e,t,i){var s=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ye){if(s.mode==="hidden")return e=bu(t,s),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Ua(null,e);if(Cc(t),(e=Ot)?(e=sy(e,$n),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ll!==null?{id:bi,overflow:xi}:null,retryLane:536870912,hydrationErrors:null},i=vp(e),i.return=t,t.child=i,ln=t,Ot=null)):e=null,e===null)throw al(t);return t.lanes=536870912,null}return bu(t,s)}var d=e.memoizedState;if(d!==null){var b=d.dehydrated;if(Cc(t),c)if(t.flags&256)t.flags&=-257,t=Mm(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(Kt||Gl(e,t,i,!1),c=(i&e.childLanes)!==0,Kt||c){if(dl.current===null){if(s=At,s!==null&&(b=_l(s,i),b!==0&&b!==d.retryLane))throw d.retryLane=b,Hl(e,b),qn(s,e,b),Zc;Uu()}t=Mm(e,t,i)}else e=d.treeContext,Ot=Wn(b.nextSibling),ln=t,Ye=!0,rl=null,$n=!1,e!==null&&Sp(t,e),t=bu(t,s),t.flags|=134221824;return t}return e=Hi(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Mr(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(a(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Kc(e,t,i,s,c){return Fl(t),i=Oc(e,t,i,s,void 0,c),s=zc(),e!==null&&!Kt?(_c(e,t,c),Qi(e,t,c)):(Ye&&s&&$s(t),t.flags|=1,Wt(e,t,i,c),t.child)}function Dm(e,t,i,s,c,d){return Fl(t),t.updateQueue=null,i=Up(t,s,i,c),Bp(e),s=zc(),e!==null&&!Kt?(_c(e,t,d),Qi(e,t,d)):(Ye&&s&&$s(t),t.flags|=1,Wt(e,t,i,d),t.child)}function Lm(e,t,i,s,c){if(Fl(t),t.stateNode===null){var d=Tr,b=i.contextType;typeof b=="object"&&b!==null&&(d=un(b)),d=new i(s,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Qc,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=s,d.state=t.memoizedState,d.refs={},Sc(t),b=i.contextType,d.context=typeof b=="object"&&b!==null?un(b):Tr,d.state=t.memoizedState,b=i.getDerivedStateFromProps,typeof b=="function"&&(Fc(t,i,b,s),d.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(b=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),b!==d.state&&Qc.enqueueReplaceState(d,d.state,null),Ra(t,s,d,c),qa(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){d=t.stateNode;var w=t.memoizedProps,j=Pl(i,w);d.props=j;var U=d.context,Q=i.contextType;b=Tr,typeof Q=="object"&&Q!==null&&(b=un(Q));var W=i.getDerivedStateFromProps;Q=typeof W=="function"||typeof d.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,Q||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(w||U!==b)&&km(t,d,s,b),ol=!1;var L=t.memoizedState;d.state=L,Ra(t,s,d,c),qa(),U=t.memoizedState,w||L!==U||ol?(typeof W=="function"&&(Fc(t,i,W,s),U=t.memoizedState),(j=ol||wm(t,i,j,s,L,U,b))?(Q||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=U),d.props=s,d.state=U,d.context=b,s=j):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{d=t.stateNode,wc(e,t),b=t.memoizedProps,Q=Pl(i,b),d.props=Q,W=t.pendingProps,L=d.context,U=i.contextType,j=Tr,typeof U=="object"&&U!==null&&(j=un(U)),w=i.getDerivedStateFromProps,(U=typeof w=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==W||L!==j)&&km(t,d,s,j),ol=!1,L=t.memoizedState,d.state=L,Ra(t,s,d,c),qa();var Y=t.memoizedState;b!==W||L!==Y||ol||e!==null&&e.dependencies!==null&&eu(e.dependencies)?(typeof w=="function"&&(Fc(t,i,w,s),Y=t.memoizedState),(Q=ol||wm(t,i,Q,s,L,Y,j)||e!==null&&e.dependencies!==null&&eu(e.dependencies))?(U||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,Y,j),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,Y,j)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=Y),d.props=s,d.state=Y,d.context=j,s=Q):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),s=!1)}return d=s,Mr(e,t),s=(t.flags&128)!==0,d||s?(d=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&s?(t.child=Jl(t,e.child,null,c),t.child=Jl(t,null,i,c)):Wt(e,t,i,c),t.memoizedState=d.state,e=t.child):e=Qi(e,t,c),e}function Bm(e,t,i,s){return Vl(),t.flags|=256,Wt(e,t,i,s),t.child}var Jc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $c(e){return{baseLanes:e,cachePool:Cp()}}function Pc(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Yn),e}function Um(e,t,i){var s=t.pendingProps,c=!1,d=(t.flags&128)!==0,b;if((b=d)||(b=e!==null&&e.memoizedState===null?!1:(cn.current&2)!==0),b&&(c=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ye){if(c?hl(t):pl(),(e=Ot)?(e=sy(e,$n),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ll!==null?{id:bi,overflow:xi}:null,retryLane:536870912,hydrationErrors:null},i=vp(e),i.return=t,t.child=i,ln=t,Ot=null)):e=null,e===null)throw al(t);return Pf(e)?t.lanes=32:t.lanes=536870912,null}return d=s.children,s=s.fallback,c?(pl(),c=t.mode,d=xu({mode:"hidden",children:d},c),s=Il(s,c,i,null),d.return=t,s.return=t,d.sibling=s,t.child=d,s=t.child,s.memoizedState=$c(i),s.childLanes=Pc(e,b,i),t.memoizedState=Jc,Ua(null,s)):(hl(t),Wc(t,d))}var w=e.memoizedState;if(w!==null){var j=w.dehydrated;if(j!==null)return Ox(e,t,d,b,s,j,w,i)}return c?(pl(),c=s.fallback,d=t.mode,w=e.child,j=w.sibling,s=Hi(w,{mode:"hidden",children:s.children}),s.subtreeFlags=w.subtreeFlags&1206910976,j!==null?c=Hi(j,c):(c=Il(c,d,i,null),c.flags|=2),c.return=t,s.return=t,s.sibling=c,t.child=s,Ua(null,s),s=t.child,c=e.child.memoizedState,c===null?c=$c(i):(d=c.cachePool,d!==null?(w=Xt._currentValue,d=d.parent!==w?{parent:w,pool:w}:d):d=Cp(),c={baseLanes:c.baseLanes|i,cachePool:d}),s.memoizedState=c,s.childLanes=Pc(e,b,i),t.memoizedState=Jc,Ua(e.child,s)):(hl(t),i=e.child,e=i.sibling,i=Hi(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=i,t.memoizedState=null,i)}function Wc(e,t){return t=xu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function xu(e,t){return e=jn(22,e,null,t),e.lanes=0,e}function Su(e,t,i){return Jl(t,e.child,null,i),e=Wc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ox(e,t,i,s,c,d,b,w){if(i)return t.flags&256?(hl(t),t.flags&=-257,Su(e,t,w)):t.memoizedState!==null?(pl(),t.child=e.child,t.flags|=128,null):(pl(),d=c.fallback,b=t.mode,c=xu({mode:"visible",children:c.children},b),d=Il(d,b,w,null),d.flags|=2,c.return=t,d.return=t,c.sibling=d,t.child=c,Jl(t,e.child,null,w),c=t.child,c.memoizedState=$c(w),c.childLanes=Pc(e,s,w),t.memoizedState=Jc,Ua(null,c));if(hl(t),Pf(d)){if(s=d.nextSibling&&d.nextSibling.dataset,s)var j=s.dgst;return s=j,s!==""&&(c=Error(a(419)),c.stack="",c.digest=s,Ca({value:c,source:null,stack:null})),Su(e,t,w)}if(Kt||Gl(e,t,w,!1),s=(w&e.childLanes)!==0,Kt||s){if(dl.current!==null)return Su(e,t,w);if(s=At,s!==null&&(c=_l(s,w),c!==0&&c!==b.retryLane))throw b.retryLane=c,Hl(e,c),qn(s,e,c),Zc;return $f(d)||Uu(),Su(e,t,w)}return $f(d)?(t.flags|=192,t.child=e.child,null):(e=b.treeContext,Ot=Wn(d.nextSibling),ln=t,Ye=!0,rl=null,$n=!1,e!==null&&Sp(t,e),t=Wc(t,c.children),t.flags|=134221824,t)}function Hm(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Ws(e.return,t,i)}function Im(e){for(var t=null;e!==null;){var i=e.alternate;i!==null&&uu(i)===null&&(t=e),e=e.sibling}return t}function wu(e,t,i,s,c,d){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:c,treeForkCount:d}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=s,b.tail=i,b.tailMode=c,b.treeForkCount=d)}function ef(e){var t=e.child;for(e.child=null;t!==null;){var i=t.sibling;t.sibling=e.child,e.child=t,t=i}}function tf(e,t,i){var s=t.pendingProps,c=s.revealOrder,d=s.tail;s=s.children;var b=cn.current;if(t.flags&128)return Ma(t,b),null;var w=(b&2)!==0;if(w?(b=b&1|2,t.flags|=128):b&=1,Ma(t,b),c==="backwards"&&e!==null?(ef(e),Wt(e,t,s,i),ef(e)):Wt(e,t,s,i),s=Ye?Aa:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Hm(e,i,t);else if(e.tag===19)Hm(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"backwards":i=Im(t.child),i===null?(c=t.child,t.child=null):(c=i.sibling,i.sibling=null,ef(t)),wu(t,!0,c,null,d,s);break;case"unstable_legacy-backwards":for(i=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&uu(e)===null){t.child=c;break}e=c.sibling,c.sibling=i,i=c,c=e}wu(t,!0,i,null,d,s);break;case"together":wu(t,!1,null,null,void 0,s);break;case"independent":t.memoizedState=null;break;default:i=Im(t.child),i===null?(c=t.child,t.child=null):(c=i.sibling,i.sibling=null),wu(t,!1,c,i,d,s)}return t.child}function Vm(e,t,i){var s=t.pendingProps;return sl(t,t.type,s.value),Wt(e,t,s.children,i),t.child}function Qi(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),vl|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Gl(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,i=Hi(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Hi(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function nf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&eu(e)))}function zx(e,t,i){switch(t.tag){case 3:Mt(t,t.stateNode.containerInfo),sl(t,Xt,e.memoizedState.cache),Vl();break;case 27:case 5:xn(t);break;case 4:Mt(t,t.stateNode.containerInfo);break;case 10:sl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Cc(t),null;break;case 13:var s=t.memoizedState;if(s!==null){if(s.dehydrated!==null)return hl(t),t.flags|=128,null;s=Gl(e,t,i,!1);var c=t.child.childLanes;return s||(i&c)!==0?Um(e,t,i):(hl(t),e=Qi(e,t,i),e!==null?e.sibling:null)}hl(t);break;case 19:if(t.flags&128)return tf(e,t,i);if(c=(e.flags&128)!==0,s=(i&t.childLanes)!==0,s||(Gl(e,t,i,!1),s=(i&t.childLanes)!==0),c){if(s)return tf(e,t,i);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Ma(t,cn.current),s)break;return null;case 22:return t.lanes=0,qm(e,t,i,t.pendingProps);case 24:sl(t,Xt,e.memoizedState.cache)}return Qi(e,t,i)}function Ym(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Kt=!0;else{if(!nf(e,i)&&(t.flags&128)===0)return Kt=!1,zx(e,t,i);Kt=(e.flags&131072)!==0}else Kt=!1,Ye&&(t.flags&1048576)!==0&&xp(t,Aa,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Zl(t.elementType),t.type=e,typeof e=="function")oc(e)?(s=Pl(e,s),t.tag=1,t=Lm(null,t,e,s,i)):(t.tag=0,t=Kc(null,t,e,s,i));else{if(e!=null){var c=e.$$typeof;if(c===F){t.tag=11,t=Om(null,t,e,s,i);break e}else if(c===Te){t.tag=14,t=zm(null,t,e,s,i);break e}else if(c===re){t.tag=10,t.type=e,t=Vm(null,t,i);break e}}throw t=je(e)||e,Error(a(306,t,""))}}return t;case 0:return Kc(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,c=Pl(s,t.pendingProps),Lm(e,t,s,c,i);case 3:e:{if(Mt(t,t.stateNode.containerInfo),e===null)throw Error(a(387));s=t.pendingProps;var d=t.memoizedState;c=d.element,wc(e,t),Ra(t,s,null,i);var b=t.memoizedState;if(s=b.cache,sl(t,Xt,s),s!==d.cache&&gc(t,[Xt],i,!0),qa(),s=b.element,d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Bm(e,t,s,i);break e}else if(s!==c){c=Zn(Error(a(424)),t),Ca(c),t=Bm(e,t,s,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ot=Wn(e.firstChild),ln=t,Ye=!0,rl=null,$n=!0,i=qp(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|134221824,i=i.sibling;else{if(Vl(),s===c){t=Qi(e,t,i);break e}Wt(e,t,s,i)}t=t.child}return t;case 26:return Mr(e,t),e===null?(i=py(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ye||(t.stateNode=Xg(t.type,t.pendingProps,mt.current,t)):t.memoizedState=py(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return xn(t),e===null&&Ye&&(s=t.stateNode=cy(t.type,t.pendingProps,mt.current),ln=t,$n=!0,c=Ot,wl(t.type)?(Wf=c,Ot=Wn(s.firstChild)):Ot=c),Wt(e,t,t.pendingProps.children,i),Mr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ye&&((c=s=Ot)&&(s=TS(s,t.type,t.pendingProps,$n),s!==null?(t.stateNode=s,ln=t,Ot=Wn(s.firstChild),$n=!1,c=!0):c=!1),c||al(t)),xn(t),c=t.type,d=t.pendingProps,b=e!==null?e.memoizedProps:null,s=d.children,Gf(c,d)?s=null:b!==null&&Gf(c,b)&&(t.flags|=32),t.memoizedState!==null&&(c=Oc(e,t,xx,null,null,i),Wr._currentValue=c),Mr(e,t),Wt(e,t,s,i),t.child;case 6:return e===null&&Ye&&((e=i=Ot)&&(i=AS(i,t.pendingProps,$n),i!==null?(t.stateNode=i,ln=t,Ot=null,e=!0):e=!1),e||al(t)),null;case 13:return Um(e,t,i);case 4:return Mt(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Jl(t,null,s,i):Wt(e,t,s,i),t.child;case 11:return Om(e,t,t.type,t.pendingProps,i);case 7:return s=t.pendingProps,Mr(e,t),Wt(e,t,s,i),t.child;case 8:return Wt(e,t,t.pendingProps.children,i),t.child;case 12:return Wt(e,t,t.pendingProps.children,i),t.child;case 10:return Vm(e,t,i);case 9:return c=t.type._context,s=t.pendingProps.children,Fl(t),c=un(c),s=s(c),t.flags|=1,Wt(e,t,s,i),t.child;case 14:return zm(e,t,t.type,t.pendingProps,i);case 15:return _m(e,t,t.type,t.pendingProps,i);case 19:return tf(e,t,i);case 31:return jx(e,t,i);case 22:return qm(e,t,i,t.pendingProps);case 24:return Fl(t),s=un(Xt),e===null?(c=bc(),c===null&&(c=At,d=yc(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=i),c=d),t.memoizedState={parent:s,cache:c},Sc(t),sl(t,Xt,c)):((e.lanes&i)!==0&&(wc(e,t),Ra(t,null,null,i),qa()),c=e.memoizedState,d=t.memoizedState,c.parent!==s?(c={parent:s,cache:s},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),sl(t,Xt,s)):(s=d.cache,sl(t,Xt,s),s!==c.cache&&gc(t,[Xt],i,!0))),Wt(e,t,t.pendingProps.children,i),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),s=t.pendingProps,s.name!=null&&s.name!=="auto"?t.flags|=e===null?18882560:18874368:Ye&&$s(t),e!==null&&e.memoizedProps.name!==s.name?t.flags|=4194816:Mr(e,t),Wt(e,t,s.children,i),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Xi(e){e.flags|=4}function lf(e,t,i,s,c){var d;if((d=(e.mode&32)!==0)&&(d=i===null?vy(t,s):vy(t,s)&&(s.src!==i.src||s.srcSet!==i.srcSet)),d){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Eg())e.flags|=8192;else throw Kl=lu,xc}else e.flags&=-16777217}function Gm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!by(t))if(Eg())e.flags|=8192;else throw Kl=lu,xc}function ku(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?pr():536870912,e.lanes|=t,Hr|=t)}function Ha(e,t){if(!Ye)switch(e.tailMode){case"visible":break;case"collapsed":for(var i=e.tail,s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null;break;default:for(t=e.tail,i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null}}function zt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var c=e.child;c!==null;)i|=c.lanes|c.childLanes,s|=c.subtreeFlags&1206910976,s|=c.flags&1206910976,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)i|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function _x(e,t,i){var s=t.pendingProps;switch(dc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(t),null;case 1:return zt(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Yi(Xt),Ft(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Nr(t)?Xi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,pc())),zt(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(Xi(t),d!==null?(zt(t),Gm(t,d)):(zt(t),lf(t,c,null,s,i))):d?d!==e.memoizedState?(Xi(t),zt(t),Gm(t,d)):(zt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Xi(t),zt(t),lf(t,c,e,s,i)),null;case 27:if(Qt(t),i=mt.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Xi(t);else{if(!s){if(t.stateNode===null)throw Error(a(166));return zt(t),t.subtreeFlags&=-33554433,null}e=Re.current,Nr(t)?wp(t):(e=cy(c,s,i),t.stateNode=e,Xi(t))}return zt(t),t.subtreeFlags&=-33554433,null;case 5:if(Qt(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Xi(t);else{if(!s){if(t.stateNode===null)throw Error(a(166));return zt(t),t.subtreeFlags&=-33554433,null}if(d=Re.current,Nr(t))wp(t);else{var b=$a(mt.current);switch(d){case 1:d=b.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=b.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=b.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof s.is=="string"?b.createElement("select",{is:s.is}):b.createElement("select"),s.multiple?d.multiple=!0:s.size&&(d.size=s.size);break;default:d=typeof s.is=="string"?b.createElement(c,{is:s.is}):b.createElement(c)}}d[Pt]=t,d[nn]=s;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)d.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=d;e:switch(dn(d,c,s),c){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Xi(t)}}return zt(t),t.subtreeFlags&=-33554433,lf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Xi(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(a(166));if(e=mt.current,Nr(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,c=ln,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}e[Pt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||Yg(e.nodeValue,i)),e||al(t,!0)}else e=$a(e).createTextNode(s),e[Pt]=t,t.stateNode=e}return zt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Nr(t),i!==null){if(e===null){if(!s)throw Error(a(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[Pt]=t}else Vl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zt(t),e=!1}else i=pc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Hn(t),t):(Hn(t),null);if((t.flags&128)!==0)throw Error(a(558))}return zt(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Nr(t),s!==null&&s.dehydrated!==null){if(e===null){if(!c)throw Error(a(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));c[Pt]=t}else Vl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zt(t),c=!1}else c=pc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Hn(t),t):(Hn(t),null)}return Hn(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==c&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),ku(t,t.updateQueue),zt(t),null);case 4:return Ft(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,zt(t),null;case 10:return Yi(t.type),zt(t),null;case 19:if(Nc(t),s=t.memoizedState,s===null)return zt(t),null;if(c=(t.flags&128)!==0,d=s.rendering,d===null)if(c)Ha(s,!1);else{if(Ht!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=uu(e),d!==null){for(t.flags|=128,Ha(s,!1),e=d.updateQueue,t.updateQueue=e,ku(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)yp(i,e),i=i.sibling;return Ma(t,cn.current&1|2),Ye&&Ii(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&bt()>Mu&&(t.flags|=128,c=!0,Ha(s,!1),t.lanes=4194304)}else{if(!c)if(e=uu(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,ku(t,e),Ha(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!d.alternate&&!Ye)return zt(t),null}else 2*bt()-s.renderingStartTime>Mu&&i!==536870912&&(t.flags|=128,c=!0,Ha(s,!1),t.lanes=4194304);s.isBackwards?(d.sibling=t.child,t.child=d):(e=s.last,e!==null?e.sibling=d:t.child=d,s.last=d)}if(s.tail!==null){e=s.tail;e:{for(i=e;i!==null;){if(i.alternate!==null){i=!1;break e}i=i.sibling}i=!0}return s.rendering=e,s.tail=e.sibling,s.renderingStartTime=bt(),e.sibling=null,d=cn.current,d=c?d&1|2:d&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!i||Ye?Ma(t,d):(i=d,Ie(on,t),Ie(cn,i),bn===null&&(bn=t)),Ye&&Ii(t,s.treeForkCount),e}return zt(t),null;case 22:case 23:return Hn(t),Ac(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(zt(t),t.subtreeFlags&6&&(t.flags|=8192)):zt(t),i=t.updateQueue,i!==null&&ku(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&$e(Xl),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Yi(Xt),zt(t),null;case 25:return null;case 30:return t.flags|=33554432,zt(t),null}throw Error(a(156,t.tag))}function qx(e,t){switch(dc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(Xt),Ft(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Qt(t),null;case 31:if(t.memoizedState!==null){if(Hn(t),t.alternate===null)throw Error(a(340));Vl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Hn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Vl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Nc(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ft(),null;case 10:return Yi(t.type),null;case 22:case 23:return Hn(t),Ac(),e!==null&&$e(Xl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(Xt),null;case 25:return null;default:return null}}function Fm(e,t){switch(dc(t),t.tag){case 3:Yi(Xt),Ft();break;case 26:case 27:case 5:Qt(t);break;case 4:Ft();break;case 31:t.memoizedState!==null&&Hn(t);break;case 13:Hn(t);break;case 19:Nc(t);break;case 10:Yi(t.type);break;case 22:case 23:Hn(t),Ac(),e!==null&&$e(Xl);break;case 24:Yi(Xt)}}function Ia(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var c=s.next;i=c;do{if((i.tag&e)===e){s=void 0;var d=i.create,b=i.inst;s=d(),b.destroy=s}i=i.next}while(i!==c)}}catch(w){yt(t,t.return,w)}}function ml(e,t,i){try{var s=t.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var d=c.next;s=d;do{if((s.tag&e)===e){var b=s.inst,w=b.destroy;if(w!==void 0){b.destroy=void 0,c=t;var j=i,U=w;try{U()}catch(Q){yt(c,j,Q)}}}s=s.next}while(s!==d)}}catch(Q){yt(t,t.return,Q)}}function Qm(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Mp(t,i)}catch(s){yt(e,e.return,s)}}}function Xm(e,t,i){i.props=Pl(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){yt(e,t,s)}}function Si(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:var c=e.stateNode,d=Bi(e.memoizedProps,c);(c.ref===null||c.ref.name!==d)&&(c.ref=ey(d)),s=c.ref;break;case 7:if(e.stateNode===null){var b=new Fn(e);g(e.child,!1,kS,b,void 0,void 0),e.stateNode=b}s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(w){yt(e,t,w)}}function fn(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(c){yt(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(c){yt(e,t,c)}else i.current=null}function Eu(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var i=0;i<t.length;i++)ay(e.stateNode,t[i])}function Zm(e){for(var t=e.return;t!==null&&(af(t)&&ay(e.stateNode,t.stateNode),!rf(t));)t=t.return}function Va(e){for(var t=e.return;t!==null&&(af(t)&&ES(e.stateNode,t.stateNode),!rf(t));)t=t.return}function rf(e){return e.tag===5||e.tag===3||e.tag===27}function af(e){return e&&e.tag===7&&e.stateNode!==null}function sf(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(c){yt(e,e.return,c)}}function uf(e,t,i){try{var s=e.stateNode;rS(s,e.type,i,t),s[nn]=t}catch(c){yt(e,e.return,c)}}function Km(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wl(e.type)||e.tag===4}function of(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Km(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&wl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cf(e,t,i,s){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(c,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(c),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=I)),Eu(e,s),He=!0;else if(c!==4&&(c===27&&(Eu(e,s),s=null,wl(e.type)&&(i=e.stateNode,t=null)),e=e.child,e!==null))for(cf(e,t,i,s),e=e.sibling;e!==null;)cf(e,t,i,s),e=e.sibling}function Tu(e,t,i,s){var c=e.tag;if(c===5||c===6)c=e.stateNode,t?i.insertBefore(c,t):i.appendChild(c),Eu(e,s),He=!0;else if(c!==4&&(c===27&&(Eu(e,s),s=null,wl(e.type)&&(i=e.stateNode)),e=e.child,e!==null))for(Tu(e,t,i,s),e=e.sibling;e!==null;)Tu(e,t,i,s),e=e.sibling}function Jm(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);dn(t,s,i),t[Pt]=e,t[nn]=i}catch(d){yt(e,e.return,d)}}var Au=!1,In=null;function $m(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Au=!0)}var wi=null;function Pm(){var e=wi;return wi=null,e}var On=0;function Dr(e,t,i,s,c){return On=0,Wm(e.child,t,i,s,c)}function Wm(e,t,i,s,c){for(var d=!1;e!==null;){if(e.tag===5){var b=e.stateNode;if(s!==null){var w=Xf(b);s.push(w),w.view&&(d=!0)}else d||Xf(b).view&&(d=!0);Au=!0,Pg(b,On===0?t:t+"_"+On,i),On++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&c||Wm(e.child,t,i,s,c)&&(d=!0));e=e.sibling}return d}function ki(e,t){for(;e!==null;)e.tag===5?Wg(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||ki(e.child,t)),e=e.sibling}function Cu(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Cu(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(a(544));var i=t.name;t=Ui(t.default,t.share),t!=="none"&&(Dr(e,i,t,null,!1)||ki(e.child,!1))}e=e.sibling}}function ff(e,t){if(e.tag===30){var i=e.stateNode,s=e.memoizedProps,c=Bi(s,i),d=Ui(s.default,i.paired?s.share:s.enter);d!=="none"?Dr(e,c,d,null,!1)?(Cu(e),i.paired||t||Gr(e,s.onEnter)):ki(e.child,!1):Cu(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)ff(e,t),e=e.sibling;else Cu(e)}function df(e){if(In!==null&&In.size!==0){var t=In;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var i=e.memoizedProps,s=i.name;if(s!=null&&s!=="auto"){var c=t.get(s);if(c!==void 0){var d=Ui(i.default,i.share);if(d!=="none"&&(Dr(e,s,d,null,!1)?(d=e.stateNode,c.paired=d,d.paired=c,Gr(e,i.onShare)):ki(e.child,!1)),t.delete(s),t.size===0)break}}}df(e)}e=e.sibling}}}function hf(e){if(e.tag===30){var t=e.memoizedProps,i=Bi(t,e.stateNode),s=In!==null?In.get(i):void 0,c=Ui(t.default,s!==void 0?t.share:t.exit);c!=="none"&&(Dr(e,i,c,null,!1)?s!==void 0?(c=e.stateNode,s.paired=c,c.paired=s,In.delete(i),Gr(e,t.onShare)):Gr(e,t.onExit):ki(e.child,!1)),In!==null&&df(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)hf(e),e=e.sibling;else In!==null&&df(e)}function eg(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,i=Bi(t,e.stateNode);t=Ui(t.default,t.update),e.flags&=-5,t!=="none"&&Dr(e,i,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&eg(e);e=e.sibling}}function pf(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,ki(e.child,!1))}pf(e)}e=e.sibling}}function Nu(e){if(e.tag===30)e.stateNode.paired=null,ki(e.child,!1),pf(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Nu(e),e=e.sibling;else pf(e)}function tg(e){for(e=e.child;e!==null;)e.tag===30?ki(e.child,!1):(e.subtreeFlags&33554432)!==0&&tg(e),e=e.sibling}function mf(e,t,i,s,c,d,b){for(var w=!1;t!==null;){if(t.tag===5){var j=t.stateNode;if(d!==null&&On<d.length){var U=d[On],Q=Xf(j);(U.view||Q.view)&&(w=!0);var W;if(W=(e.flags&4)===0)if(Q.clip)W=!0;else{W=U.rect;var L=Q.rect;W=W.y!==L.y||W.x!==L.x||W.height!==L.height||W.width!==L.width}W&&(e.flags|=4),Q.abs?Q=!U.abs:(U=U.rect,Q=Q.rect,Q=U.height!==Q.height||U.width!==Q.width),Q&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Pg(j,On===0?i:i+"_"+On,c),w&&(e.flags&4)!==0||(wi===null&&(wi=[]),wi.push(j,On===0?s:s+"_"+On,t.memoizedProps)),On++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&b?e.flags|=t.flags&32:mf(e,t.child,i,s,c,d,b)&&(w=!0));t=t.sibling}return w}function ng(e,t){for(e=e.child;e!==null;){if(e.tag===30){var i=e.memoizedProps,s=e.stateNode,c=Bi(i,s),d=Ui(i.default,i.update),b;b=e.memoizedState,e.memoizedState=null,s=e;var w=e.child;On=0,c=mf(s,w,c,c,d,b,!1),(e.flags&4)!==0&&c&&Gr(e,i.onUpdate)}else(e.subtreeFlags&33554432)!==0&&ng(e);e=e.sibling}}var rn=!1,ht=!1,Ei=!1,gf=!1,ig=typeof WeakSet=="function"?WeakSet:Set,an=null,Ti=!1,Ya=!1,ju=!1,yf=!1;function Rx(e,t,i){if(e=e.containerInfo,Vf=ea,e=sp(e),nc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var d=c.anchorOffset,b=c.focusNode;c=c.focusOffset;try{s.nodeType,b.nodeType}catch{s=null;break e}var w=0,j=-1,U=-1,Q=0,W=0,L=e,Y=null;t:for(;;){for(var de;L!==s||d!==0&&L.nodeType!==3||(j=w+d),L!==b||c!==0&&L.nodeType!==3||(U=w+c),L.nodeType===3&&(w+=L.nodeValue.length),(de=L.firstChild)!==null;)Y=L,L=de;for(;;){if(L===e)break t;if(Y===s&&++Q===d&&(j=w),Y===b&&++W===c&&(U=w),(de=L.nextSibling)!==null)break;L=Y,Y=L.parentNode}L=de}s=j===-1||U===-1?null:{start:j,end:U}}else s=null}s=s||{start:0,end:0}}else s=null;for(Yf={focusedElem:e,selectionRange:s},ea=!1,i=(i&335544064)===i,an=t,t=i?9270:1024;an!==null;){if(e=an,i&&(s=e.deletions,s!==null))for(d=0;d<s.length;d++)i&&hf(s[d]);if(e.alternate===null&&(e.flags&2)!==0)i&&$m(e),Ou(i);else{if(e.tag===22){if(s=e.alternate,e.memoizedState!==null){s!==null&&s.memoizedState===null&&i&&hf(s),Ou(i);continue}else if(s!==null&&s.memoizedState!==null){i&&$m(e),Ou(i);continue}}s=e.child,(e.subtreeFlags&t)!==0&&s!==null?(s.return=e,an=s):(i&&eg(e),Ou(i))}}In=null}function Ou(e){for(;an!==null;){var t=an,i=e,s=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((c&1024)!==0&&s!==null){i=void 0,c=s.memoizedProps,s=s.memoizedState;var d=t.stateNode;try{var b=Pl(t.type,c);i=d.getSnapshotBeforeUpdate(b,s),d.__reactInternalSnapshotBeforeUpdate=i}catch(w){yt(t,t.return,w)}}break;case 3:if((c&1024)!==0){if(s=t.stateNode.containerInfo,i=s.nodeType,i===9)Jf(s);else if(i===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Jf(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:i&&s!==null&&(i=Bi(s.memoizedProps,s.stateNode),c=t.memoizedProps,c=Ui(c.default,c.update),c!=="none"&&Dr(s,i,c,s.memoizedState=[],!0));break;default:if((c&1024)!==0)throw Error(a(163))}if(s=t.sibling,s!==null){s.return=t.return,an=s;break}an=t.return}}function lg(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Ai(e,i),s&4&&Ia(5,i);break;case 1:if(Ai(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(b){yt(i,i.return,b)}else{var c=Pl(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){yt(i,i.return,b)}}s&64&&Qm(i),s&512&&Si(i,i.return);break;case 3:if(Ai(e,i),s&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{Mp(e,t)}catch(b){yt(i,i.return,b)}}break;case 27:t===null&&s&4&&Jm(i);case 26:case 5:Ai(e,i),t===null&&s&4&&sf(i),s&512&&Si(i,i.return);break;case 12:Ai(e,i);break;case 31:Ai(e,i),s&4&&ug(e,i);break;case 13:Ai(e,i),s&4&&og(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Qx.bind(null,i),CS(e,i))));break;case 22:if(s=i.memoizedState!==null||rn,!s){var d=t!==null&&t.memoizedState!==null||ht;t=rn,c=ht,rn=s,(ht=d)&&!c?(s=2,(i.subtreeFlags&8772)!==0&&(s|=1),ui(e,i,s)):Ai(e,i),rn=t,ht=c}break;case 30:Ai(e,i),s&512&&Si(i,i.return);break;case 7:s&512&&Si(i,i.return);default:Ai(e,i)}}function vf(e,t){for(e=e.child;e!==null;)rg(e,t),e=e.sibling}function rg(e,t){switch(e.tag){case 5:case 26:try{var i=e.stateNode;if(t){var s=i.style;typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"}else{var c=e.stateNode,d=e.memoizedProps.style,b=d!=null&&d.hasOwnProperty("display")?d.display:null;c.style.display=b==null||typeof b=="boolean"?"":(""+b).trim()}}catch(j){yt(e,e.return,j)}bf(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,He=!0}catch(j){yt(e,e.return,j)}break;case 18:try{var w=e.stateNode;t?$g(w,!0):$g(e.stateNode,!1)}catch(j){yt(e,e.return,j)}break;case 22:case 23:e.memoizedState===null&&vf(e,t);break;default:vf(e,t)}}function bf(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var i=e,s=t;switch(i.tag){case 4:rg(i,s);break e;case 22:i.memoizedState===null&&bf(i,s);break e;default:bf(i,s)}}e=e.sibling}}function ag(e){var t=e.alternate;t!==null&&(e.alternate=null,ag(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Dl(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var _t=null,zn=!1;function ai(e,t,i){for(i=i.child;i!==null;)sg(e,t,i),i=i.sibling}function sg(e,t,i){if(Xe&&typeof Xe.onCommitFiberUnmount=="function")try{Xe.onCommitFiberUnmount(Pe,i)}catch{}switch(i.tag){case 26:ht||fn(i,t),ai(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&!ht&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ht||fn(i,t),Va(i);var s=_t,c=zn;wl(i.type)&&(_t=i.stateNode,zn=!1),ai(e,t,i),fy(i.stateNode,i.type,i.memoizedProps),_t=s,zn=c;break;case 5:ht||fn(i,t),Va(i);case 6:if(i.tag===6&&Va(i),s=_t,c=zn,_t=null,ai(e,t,i),_t=s,zn=c,_t!==null)if(zn)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(i.stateNode),He=!0}catch(d){yt(i,t,d)}else try{_t.removeChild(i.stateNode),He=!0}catch(d){yt(i,t,d)}break;case 18:_t!==null&&(zn?(e=_t,Jg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),ta(e)):Jg(_t,i.stateNode));break;case 4:s=_t,c=zn,_t=i.stateNode.containerInfo,zn=!0,ai(e,t,i),_t=s,zn=c;break;case 0:case 11:case 14:case 15:ml(2,i,t),ht||ml(4,i,t),ai(e,t,i);break;case 1:ht||(fn(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&Xm(i,t,s)),ai(e,t,i);break;case 21:ai(e,t,i);break;case 22:ht=(s=ht)||i.memoizedState!==null,ai(e,t,i),ht=s;break;case 30:fn(i,t),ai(e,t,i);break;case 7:ht||fn(i,t),ai(e,t,i);break;default:ai(e,t,i)}}function ug(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ta(e)}catch(i){yt(t,t.return,i)}}}function og(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ta(e)}catch(i){yt(t,t.return,i)}}function Mx(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ig),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ig),t;default:throw Error(a(435,e.tag))}}function zu(e,t){var i=Mx(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var c=Xx.bind(null,e,s);s.then(c,c)}})}function An(e,t,i){var s=t.deletions;if(s!==null)for(var c=0;c<s.length;c++){var d=s[c],b=e,w=t,j=w;e:for(;j!==null;){switch(j.tag){case 27:if(wl(j.type)){_t=j.stateNode,zn=!1;break e}break;case 5:_t=j.stateNode,zn=!1;break e;case 3:case 4:_t=j.stateNode.containerInfo,zn=!0;break e}j=j.return}if(_t===null)throw Error(a(160));sg(b,w,d),_t=null,zn=!1,b=d.alternate,b!==null&&(b.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)cg(t,e,i),t=t.sibling}var si=null;function cg(e,t,i){var s=e.alternate,c=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(c&4&&(s=e.updateQueue,s=s!==null?s.events:null,s!==null))for(var d=0;d<s.length;d++){var b=s[d];b.ref.impl=b.nextImpl}An(t,e,i),Cn(e),c&4&&(ml(3,e,e.return),Ia(3,e),ml(5,e,e.return));break;case 1:An(t,e,i),Cn(e),c&512&&(ht||s===null||fn(s,s.return)),c&64&&rn&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?t:i.concat(t))));break;case 26:if(d=si,An(t,e,i),Cn(e),c&512&&(ht||s===null||fn(s,s.return)),c&4)if(c=s!==null?s.memoizedState:null,i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null)if(rn)e.stateNode=Xg(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,i=e.memoizedProps,c=d.ownerDocument||d;t:switch(t){case"title":s=c.getElementsByTagName("title")[0],(!s||s[Rl]||s[Pt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=c.createElement(t),c.head.insertBefore(s,c.querySelector("head > title"))),dn(s,t,i),s[Pt]=e,Yt(s),t=s;break e;case"link":if(d=yy("link","href",c).get(t+(i.href||""))){for(b=0;b<d.length;b++)if(s=d[b],s.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&s.getAttribute("rel")===(i.rel==null?null:i.rel)&&s.getAttribute("title")===(i.title==null?null:i.title)&&s.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){d.splice(b,1);break t}}s=c.createElement(t),dn(s,t,i),c.head.appendChild(s);break;case"meta":if(d=yy("meta","content",c).get(t+(i.content||""))){for(b=0;b<d.length;b++)if(s=d[b],s.getAttribute("content")===(i.content==null?null:""+i.content)&&s.getAttribute("name")===(i.name==null?null:i.name)&&s.getAttribute("property")===(i.property==null?null:i.property)&&s.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&s.getAttribute("charset")===(i.charSet==null?null:i.charSet)){d.splice(b,1);break t}}s=c.createElement(t),dn(s,t,i),c.head.appendChild(s);break;default:throw Error(a(468,t))}s[Pt]=e,Yt(s),t=s}e.stateNode=t}else rn||id(d,e.type,e.stateNode);else e.stateNode=gy(d,i,e.memoizedProps);else c!==i?(c===null?(t=s.stateNode,t===null||ht||t.parentNode.removeChild(t)):c.count--,i===null?rn||id(d,e.type,e.stateNode):gy(d,i,e.memoizedProps)):i===null&&e.stateNode!==null&&uf(e,e.memoizedProps,s.memoizedProps);break;case 27:An(t,e,i),Cn(e),c&512&&(ht||s===null||fn(s,s.return)),s!==null&&c&4&&uf(e,e.memoizedProps,s.memoizedProps);break;case 5:if(d=Ei,Ei=!1,An(t,e,i),Ei=d,Cn(e),c&512&&(ht||s===null||fn(s,s.return)),e.flags&32){t=e.stateNode;try{tl(t,""),He=!0}catch(Q){yt(e,e.return,Q)}}c&4&&e.stateNode!=null&&(t=e.memoizedProps,uf(e,t,s!==null?s.memoizedProps:t)),c&1024&&(gf=!0);break;case 6:if(An(t,e,i),Cn(e),c&4){if(e.stateNode===null)throw Error(a(162));t=e.memoizedProps,i=e.stateNode;try{i.nodeValue=t,He=!0}catch(Q){yt(e,e.return,Q)}}break;case 3:if(He=!1,Qu=null,d=si,si=Pa(t.containerInfo),An(t,e,i),si=d,Cn(e),c&4&&s!==null&&s.memoizedState.isDehydrated)try{ta(t.containerInfo)}catch(Q){yt(e,e.return,Q)}gf&&(gf=!1,fg(e)),He=!1;break;case 4:c=Ei,Ei=rn,s=ha(),d=si,si=Pa(e.stateNode.containerInfo),An(t,e,i),Cn(e),si=d,He&&Ya&&(ju=!0),He=s,Ei=c;break;case 12:An(t,e,i),Cn(e);break;case 31:An(t,e,i),Cn(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,zu(e,t)));break;case 13:An(t,e,i),Cn(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Ru=bt()),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,zu(e,t)));break;case 22:d=e.memoizedState!==null,b=s!==null&&s.memoizedState!==null;var w=rn,j=ht,U=Ei;rn=w||d,Ei=U||d,ht=j||b,An(t,e,i),ht=j,Ei=U,rn=w,Cn(e),c&8192&&(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,!d||s===null||b||rn||ht||(t=b||ht,i=rn,s=ht,rn=d||rn,ht=t,gl(e,2),rn=i,ht=s),!d&&Ei||vf(e,d)),c&4&&(t=e.updateQueue,t!==null&&(i=t.retryQueue,i!==null&&(t.retryQueue=null,zu(e,i))));break;case 19:An(t,e,i),Cn(e),c&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,zu(e,t)));break;case 30:c&512&&(ht||s===null||fn(s,s.return)),c=ha(),d=Ya,b=(i&335544064)===i,w=e.memoizedProps,Ya=b&&Ui(w.default,w.update)!=="none",An(t,e,i),Cn(e),b&&s!==null&&He&&(e.flags|=4),Ya=d,He=c;break;case 21:break;case 7:c&512&&(ht||s===null||fn(s,s.return)),s&&s.stateNode!==null&&(s.stateNode._fragmentFiber=e);default:An(t,e,i),Cn(e)}}function Cn(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(Km(s)){i=s;break}s=s.return}s=null;for(var c=e.return;c!==null;){if(af(c)){var d=c.stateNode;s===null?s=[d]:s.push(d)}if(rf(c))break;c=c.return}var b=s;if(i==null)throw Error(a(160));switch(i.tag){case 27:var w=i.stateNode,j=of(e);Tu(e,j,w,b);break;case 5:var U=i.stateNode;i.flags&32&&(tl(U,""),i.flags&=-33);var Q=of(e);Tu(e,Q,U,b);break;case 3:case 4:var W=i.stateNode.containerInfo,L=of(e);cf(e,L,W,b);break;default:throw Error(a(161))}}catch(Y){yt(e,e.return,Y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function fg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;fg(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,ea=!0,t.reset(),ea=!1),e=e.sibling}}function Lr(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)dg(t,e),t=t.sibling;else ng(t)}function dg(e,t){var i=e.alternate;if(i===null)ff(e,!1);else switch(e.tag){case 3:if(yf=Ti=!1,Pm(),Lr(t,e),!Ti&&!ju){if(e=wi,e!==null)for(var s=0;s<e.length;s+=3){i=e[s];var c=e[s+1];Wg(i,e[s+2]),i=i.ownerDocument.documentElement,i!==null&&i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+c+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),yf=!0}wi=null;break;case 5:Lr(t,e);break;case 4:s=Ti,Ti=!1,Lr(t,e),Ti&&(ju=!0),Ti=s;break;case 22:e.memoizedState===null&&(i.memoizedState!==null?ff(e,!1):Lr(t,e));break;case 30:s=Ti,c=Pm(),Ti=!1,Lr(t,e),Ti&&(e.flags|=4);var d=e.memoizedProps,b=e.stateNode;t=Bi(d,b),b=Bi(i.memoizedProps,b);var w=Ui(d.default,d.update);w==="none"?t=!1:(d=i.memoizedState,i.memoizedState=null,i=e.child,On=0,t=mf(e,i,t,b,w,d,!0),On!==(d===null?0:d.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Gr(e,e.memoizedProps.onUpdate),wi=c):c!==null&&(c.push.apply(c,wi),wi=c),Ti=(e.flags&32)!==0?!0:s;break;default:Lr(t,e)}}function Ai(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)lg(e,t.alternate,t),t=t.sibling}function gl(e,t){for(e=e.child;e!==null;){var i=e,s=t;switch(i.tag){case 0:case 11:case 14:case 15:ml(4,i,i.return),gl(i,s);break;case 1:fn(i,i.return);var c=i.stateNode;typeof c.componentWillUnmount=="function"&&Xm(i,i.return,c),gl(i,s);break;case 27:(s&2)!==0&&fy(i.stateNode,i.type,i.memoizedProps);case 5:fn(i,i.return),i.tag!==5&&i.tag!==27||Va(i),gl(i,s);break;case 6:Va(i);break;case 26:fn(i,i.return),c=i.stateNode,i.memoizedState!==null||c===null||ht||c.parentNode.removeChild(c),gl(i,s);break;case 22:i.memoizedState===null&&gl(i,s);break;case 30:fn(i,i.return),gl(i,s);break;case 7:fn(i,i.return);default:gl(i,s)}e=e.sibling}}function ui(e,t,i){for(i=(t.subtreeFlags&8772)!==0?i:i&-2,t=t.child;t!==null;){var s=t.alternate,c=e,d=t,b=d.flags,w=(i&1)!==0;switch(d.tag){case 0:case 11:case 15:ui(c,d,i),Ia(4,d);break;case 1:if(ui(c,d,i),s=d,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(Q){yt(s,s.return,Q)}if(s=d,c=s.updateQueue,c!==null){var j=s.stateNode;try{var U=c.shared.hiddenCallbacks;if(U!==null)for(c.shared.hiddenCallbacks=null,c=0;c<U.length;c++)Rp(U[c],j)}catch(Q){yt(s,s.return,Q)}}w&&b&64&&Qm(d),Si(d,d.return);break;case 27:(i&2)!==0&&Jm(d);case 5:d.tag!==5&&d.tag!==27||Zm(d),ui(c,d,i),w&&s===null&&b&4&&sf(d),Si(d,d.return);break;case 6:Zm(d);break;case 26:j=d.stateNode,d.memoizedState!==null||j===null||rn||id(Pa(j.ownerDocument),d.type,j),ui(c,d,i),w&&s===null&&b&4&&sf(d),Si(d,d.return);break;case 12:ui(c,d,i);break;case 31:ui(c,d,i),w&&b&4&&ug(c,d);break;case 13:ui(c,d,i),w&&b&4&&og(c,d);break;case 22:d.memoizedState===null&&ui(c,d,i),Si(d,d.return);break;case 30:ui(c,d,i),Si(d,d.return);break;case 7:Si(d,d.return);default:ui(c,d,i)}t=t.sibling}}function xf(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Na(i))}function Sf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Na(e))}function Pn(e,t,i,s){var c=(i&335544064)===i;if(t.subtreeFlags&(c?10262:10256))for(t=t.child;t!==null;)hg(e,t,i,s),t=t.sibling;else c&&tg(t)}function hg(e,t,i,s){var c=(i&335544064)===i;c&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Nu(t);var d=t.flags;switch(t.tag){case 0:case 11:case 15:Pn(e,t,i,s),d&2048&&Ia(9,t);break;case 1:Pn(e,t,i,s);break;case 3:Pn(e,t,i,s),c&&yf&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),d&2048&&(d=null,t.alternate!==null&&(d=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==d&&(t.refCount++,d!=null&&Na(d)));break;case 12:if(d&2048){Pn(e,t,i,s),d=t.stateNode;try{var b=t.memoizedProps,w=b.id,j=b.onPostCommit;typeof j=="function"&&j(w,t.alternate===null?"mount":"update",d.passiveEffectDuration,-0)}catch(U){yt(t,t.return,U)}}else Pn(e,t,i,s);break;case 31:Pn(e,t,i,s);break;case 13:Pn(e,t,i,s);break;case 23:break;case 22:b=t.stateNode,w=t.alternate,t.memoizedState!==null?(c&&w!==null&&w.memoizedState===null&&Nu(w),b._visibility&2?Pn(e,t,i,s):Ga(e,t)):(c&&w!==null&&w.memoizedState!==null&&Nu(t),b._visibility&2?Pn(e,t,i,s):(b._visibility|=2,Br(e,t,i,s,(t.subtreeFlags&10256)!==0||!1))),d&2048&&xf(w,t);break;case 24:Pn(e,t,i,s),d&2048&&Sf(t.alternate,t);break;case 30:c&&(d=t.alternate,d!==null&&(ki(d.child,!0),ki(t.child,!0))),Pn(e,t,i,s);break;default:Pn(e,t,i,s)}}function Br(e,t,i,s,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,b=t,w=i,j=s,U=b.flags;switch(b.tag){case 0:case 11:case 15:Br(d,b,w,j,c),Ia(8,b);break;case 23:break;case 22:var Q=b.stateNode;b.memoizedState!==null?Q._visibility&2?Br(d,b,w,j,c):Ga(d,b):(Q._visibility|=2,Br(d,b,w,j,c)),c&&U&2048&&xf(b.alternate,b);break;case 24:Br(d,b,w,j,c),c&&U&2048&&Sf(b.alternate,b);break;default:Br(d,b,w,j,c)}t=t.sibling}}function Ga(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,c=s.flags;switch(s.tag){case 22:Ga(i,s),c&2048&&xf(s.alternate,s);break;case 24:Ga(i,s),c&2048&&Sf(s.alternate,s);break;default:Ga(i,s)}t=t.sibling}}var Wl=8192;function er(e,t,i){if(e.subtreeFlags&Wl)for(e=e.child;e!==null;)pg(e,t,i),e=e.sibling}function pg(e,t,i){switch(e.tag){case 26:er(e,t,i),e.flags&Wl&&(e.memoizedState!==null?IS(i,si,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Sy(i,e)));break;case 5:er(e,t,i),e.flags&Wl&&(e=e.stateNode,(t&335544128)===t&&Sy(i,e));break;case 3:case 4:var s=si;si=Pa(e.stateNode.containerInfo),er(e,t,i),si=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Wl,Wl=16777216,er(e,t,i),Wl=s):er(e,t,i));break;case 30:if((e.flags&Wl)!==0&&(s=e.memoizedProps.name,s!=null&&s!=="auto")){var c=e.stateNode;c.paired=null,In===null&&(In=new Map),In.set(s,c)}er(e,t,i);break;default:er(e,t,i)}}function mg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Fa(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];an=s,yg(s,e)}mg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)gg(e),e=e.sibling}function gg(e){switch(e.tag){case 0:case 11:case 15:Fa(e),e.flags&2048&&ml(9,e,e.return);break;case 3:Fa(e);break;case 12:Fa(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,_u(e)):Fa(e);break;default:Fa(e)}}function _u(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];an=s,yg(s,e)}mg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ml(8,t,t.return),_u(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,_u(t));break;default:_u(t)}e=e.sibling}}function yg(e,t){for(;an!==null;){var i=an;switch(i.tag){case 0:case 11:case 15:ml(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Na(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,an=s;else e:for(i=e;an!==null;){s=an;var c=s.sibling,d=s.return;if(ag(s),s===i){an=null;break e}if(c!==null){c.return=d,an=c;break e}an=d}}}var Dx={getCacheForType:function(e){var t=un(Xt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return un(Xt).controller.signal}},Lx=typeof WeakMap=="function"?WeakMap:Map,ft=0,At=null,Fe=null,Ze=0,gt=0,Vn=null,yl=!1,Ur=!1,wf=!1,Zi=0,Ht=0,vl=0,tr=0,qu=0,Yn=0,Hr=0,Qa=null,_n=null,kf=!1,Ru=0,vg=0,Mu=1/0,Du=null,bl=null,Rt=0,oi=null,nr=null,Ci=0,Ef=0,Tf=null,bg=null,Ir=null,Vr=null,Yr=null,Xa=0,Lu=null;function Gn(){return(ft&2)!==0&&Ze!==0?Ze&-Ze:J.T!==null?Mf():vr()}function xg(){if(Yn===0)if((Ze&536870912)===0||Ye){var e=qi;qi<<=1,(qi&3932160)===0&&(qi=262144),Yn=e}else Yn=536870912;return e=on.current,e!==null&&(e.flags|=32),Yn}function Gr(e,t){if(t!=null){var i=e.stateNode,s=i.ref;s===null&&(s=i.ref=ey(Bi(e.memoizedProps,i))),Vr===null&&(Vr=[]),Vr.push(t.bind(null,s))}}function qn(e,t,i){(e===At&&(gt===2||gt===9)||e.cancelPendingCommit!==null)&&(Fr(e,0),xl(e,Ze,Yn,!1)),yi(e,i),((ft&2)===0||e!==At)&&(e===At&&((ft&2)===0&&(tr|=i),Ht===4&&xl(e,Ze,Yn,!1)),Ni(e))}function Sg(e,t,i){if((ft&6)!==0)throw Error(a(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Ri(e,t),c=s?Hx(e,t):Cf(e,t,!0),d=s;do{if(c===0){Ur&&!s&&xl(e,t,0,!1);break}else{if(i=e.current.alternate,d&&!Bx(i)){c=Cf(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var w=e;c=Qa;var j=w.current.memoizedState.isDehydrated;if(j&&(Fr(w,b).flags|=256),b=Cf(w,b,!1),b!==2&&b!==6){if(wf&&!j){w.errorRecoveryDisabledLanes|=d,tr|=d,c=4;break e}d=_n,_n=c,d!==null&&(_n===null?_n=d:_n.push.apply(_n,d))}c=b}if(d=!1,c!==2)continue}}if(c===1){Fr(e,0),xl(e,t,0,!0);break}e:{switch(s=e,d=c,d){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:xl(s,t,Yn,!yl);break e;case 2:_n=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(c=Ru+300-bt(),10<c)){if(xl(s,t,Yn,!yl),$i(s,0,!0)!==0)break e;Ci=t,s.timeoutHandle=Qf(wg.bind(null,s,i,_n,Du,kf,t,Yn,tr,Hr,yl,d,"Throttled",-0,0),c);break e}wg(s,i,_n,Du,kf,t,Yn,tr,Hr,yl,d,null,-0,0)}}break}while(!0);Ni(e)}function wg(e,t,i,s,c,d,b,w,j,U,Q,W,L,Y){e.timeoutHandle=-1;var de=t.subtreeFlags,be=(d&335544064)===d;if(W=null,(be||de&8192||(de&16785408)===16785408)&&(W={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:I},In=null,pg(t,d,W),be&&(de=W,be=e.containerInfo,be=(be.nodeType===9?be:be.ownerDocument).__reactViewTransition,be!=null&&(de.count++,de.waitingForViewTransition=!0,de=ts.bind(de),be.finished.then(de,de))),de=(d&62914560)===d?Ru-bt():(d&4194048)===d?vg-bt():0,de=VS(W,de),de!==null)){Ci=d,e.cancelPendingCommit=de(Og.bind(null,e,t,d,i,s,c,b,w,j,U,Q,W,null,L,Y)),xl(e,d,b,!U);return}Og(e,t,d,i,s,c,b,w,j,U,Q,W)}function Bx(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var c=i[s],d=c.getSnapshot;c=c.value;try{if(!Un(d(),c))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xl(e,t,i,s){t=sa(e,t),t&=~qu,t&=~tr,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var c=t;0<c;){var d=31-St(c),b=1<<d;s[d]=-1,c&=~b}i!==0&&yr(e,i,t)}function Bu(){return(ft&6)===0?(Za(0),!1):!0}function Af(){if(Fe!==null){if(gt===0)var e=Fe.return;else e=Fe,Vi=Yl=null,qc(e),zr=null,za=0,e=Fe;for(;e!==null;)Fm(e.alternate,e),e=e.return;Fe=null}}function Fr(e,t){var i=e.timeoutHandle;return i!==-1&&(e.timeoutHandle=-1,uS(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Ci=0,Af(),At=e,Fe=i=Hi(e.current,null),Ze=t,gt=0,Vn=null,yl=!1,Ur=Ri(e,t),wf=!1,Hr=Yn=qu=tr=vl=Ht=0,_n=Qa=null,kf=!1,Zi=sa(e,t),Qs(),i}function kg(e,t){Be=null,J.H=yu,t===Or||t===iu?(t=Op(),gt=3):t===xc?(t=Op(),gt=4):gt=t===Zc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Vn=t,Fe===null&&(Ht=1,vu(e,Zn(t,e.current)))}function Eg(){var e=on.current;return e===null?!0:(Ze&4194048)===Ze?bn===null:(Ze&62914560)===Ze||(Ze&536870912)!==0?e===bn:!1}function Tg(){var e=J.H;return J.H=yu,e===null?yu:e}function Ag(){var e=J.A;return J.A=Dx,e}function Uu(){Ht=4,yl||(Ze&4194048)!==Ze&&on.current!==null||(Ur=!0),(vl&134217727)===0&&(tr&134217727)===0||At===null||xl(At,Ze,Yn,!1)}function Cf(e,t,i){var s=ft;ft|=2;var c=Tg(),d=Ag();(At!==e||Ze!==t)&&(Du=null,Fr(e,t)),t=!1;var b=Ht;e:do try{if(gt!==0&&Fe!==null){var w=Fe,j=Vn;switch(gt){case 8:Af(),b=6;break e;case 3:case 2:case 9:case 6:on.current===null&&(t=!0);var U=gt;if(gt=0,Vn=null,Qr(e,w,j,U),i&&Ur){b=0;break e}break;default:U=gt,gt=0,Vn=null,Qr(e,w,j,U)}}Ux(),b=Ht;break}catch(Q){kg(e,Q)}while(!0);return t&&e.shellSuspendCounter++,Vi=Yl=null,ft=s,J.H=c,J.A=d,Fe===null&&(At=null,Ze=0,Qs()),b}function Ux(){for(;Fe!==null;)Cg(Fe)}function Hx(e,t){var i=ft;ft|=2;var s=Tg(),c=Ag();At!==e||Ze!==t?(Du=null,Mu=bt()+500,Fr(e,t)):Ur=Ri(e,t);e:do try{if(gt!==0&&Fe!==null){t=Fe;var d=Vn;t:switch(gt){case 1:gt=0,Vn=null,Qr(e,t,d,1);break;case 2:case 9:if(Np(d)){gt=0,Vn=null,Ng(t);break}t=function(){gt!==2&&gt!==9||At!==e||(gt=7),Ni(e)},d.then(t,t);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:Np(d)?(gt=0,Vn=null,Ng(t)):(gt=0,Vn=null,Qr(e,t,d,7));break;case 5:var b=null;switch(Fe.tag){case 26:b=Fe.memoizedState;case 5:case 27:var w=Fe;if(b?by(b):w.stateNode.complete){gt=0,Vn=null;var j=w.sibling;if(j!==null)Fe=j;else{var U=w.return;U!==null?(Fe=U,Hu(U)):Fe=null}break t}}gt=0,Vn=null,Qr(e,t,d,5);break;case 6:gt=0,Vn=null,Qr(e,t,d,6);break;case 8:Af(),Ht=6;break e;default:throw Error(a(462))}}Ix();break}catch(Q){kg(e,Q)}while(!0);return Vi=Yl=null,J.H=s,J.A=c,ft=i,Fe!==null?0:(At=null,Ze=0,Qs(),Ht)}function Ix(){for(;Fe!==null&&!wn();)Cg(Fe)}function Cg(e){var t=Ym(e.alternate,e,Zi);e.memoizedProps=e.pendingProps,t===null?Hu(e):Fe=t}function Ng(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Dm(i,t,t.pendingProps,t.type,void 0,Ze);break;case 11:t=Dm(i,t,t.pendingProps,t.type.render,t.ref,Ze);break;case 5:qc(t);var s=t;s===ln&&(Ye?(Ps(s),s.tag===5&&s.stateNode!=null&&(Ot=s.stateNode)):(Ps(s),Ye=!0));default:Fm(i,t),t=Fe=yp(t,Zi),t=Ym(i,t,Zi)}e.memoizedProps=e.pendingProps,t===null?Hu(e):Fe=t}function Qr(e,t,i,s){Vi=Yl=null,qc(t),zr=null,za=0;var c=t.return;try{if(Nx(e,c,t,i,Ze)){Ht=1,vu(e,Zn(i,e.current)),Fe=null;return}}catch(d){if(c!==null)throw Fe=c,d;Ht=1,vu(e,Zn(i,e.current)),Fe=null;return}t.flags&32768?(Ye||s===1?e=!0:Ur||(Ze&536870912)!==0?e=!1:(yl=e=!0,(s===2||s===9||s===3||s===6)&&(s=on.current,s!==null&&s.tag===13&&(s.flags|=16384))),jg(t,e)):Hu(t)}function Hu(e){var t=e;do{if((t.flags&32768)!==0){jg(t,yl);return}e=t.return;var i=_x(t.alternate,t,Zi);if(i!==null){Fe=i;return}if(t=t.sibling,t!==null){Fe=t;return}Fe=t=e}while(t!==null);Ht===0&&(Ht=5)}function jg(e,t){do{var i=qx(e.alternate,e);if(i!==null){i.flags&=32767,Fe=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Fe=e;return}Fe=e=i}while(e!==null);Ht=6,Fe=null}function Og(e,t,i,s,c,d,b,w,j,U,Q,W){e.cancelPendingCommit=null;do Iu();while(Rt!==0);if((ft&6)!==0)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));e===At&&(Fe=At=null,Ze=0),nr=t,oi=e,Ci=i,Tf=c,bg=s,Vx(e,t,i,b,w,j,W)}}function Vx(e,t,i,s,c,d,b){var w=t.lanes|t.childLanes;if(Ef=w,w|=sc,gr(e,i,w,s,c,d),Vr=null,(i&335544064)===i?(Yr=gx(e),s=10262):(Yr=null,s=10256),(t.subtreeFlags&s)!==0||(t.flags&s)!==0?(e.callbackNode=null,e.callbackPriority=0,Zx(_i,function(){return zf(),null})):(e.callbackNode=null,e.callbackPriority=0),Au=!1,s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=J.T,J.T=null,c=he.p,he.p=2,d=ft,ft|=4;try{Rx(e,t,i)}finally{ft=d,he.p=c,J.T=s}}Rt=1,Au?Ir=pS(b,e.containerInfo,Yr,Nf,jf,Gx,Of,zf,Yx):(Nf(),jf(),Of())}function Yx(e){if(Rt!==0){var t=oi.onRecoverableError;t(e,{componentStack:null})}}function Gx(){Rt===3&&(Rt=0,dg(nr,oi),Rt=4)}function Nf(){if(Rt===1){Rt=0;var e=oi,t=nr,i=Ci,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=J.T,J.T=null;var c=he.p;he.p=2;var d=ft;ft|=4;try{Ya=ju=!1,cg(t,e,i),i=Yf;var b=sp(e.containerInfo),w=i.focusedElem,j=i.selectionRange;if(b!==w&&w&&w.ownerDocument&&ap(w.ownerDocument.documentElement,w)){if(j!==null&&nc(w)){var U=j.start,Q=j.end;if(Q===void 0&&(Q=U),"selectionStart"in w)w.selectionStart=U,w.selectionEnd=Math.min(Q,w.value.length);else{var W=w.ownerDocument||document,L=W&&W.defaultView||window;if(L.getSelection){var Y=L.getSelection(),de=w.textContent.length,be=Math.min(j.start,de),Ue=j.end===void 0?be:Math.min(j.end,de);!Y.extend&&be>Ue&&(b=Ue,Ue=be,be=b);var B=rp(w,be),D=rp(w,Ue);if(B&&D&&(Y.rangeCount!==1||Y.anchorNode!==B.node||Y.anchorOffset!==B.offset||Y.focusNode!==D.node||Y.focusOffset!==D.offset)){var V=W.createRange();V.setStart(B.node,B.offset),Y.removeAllRanges(),be>Ue?(Y.addRange(V),Y.extend(D.node,D.offset)):(V.setEnd(D.node,D.offset),Y.addRange(V))}}}}for(W=[],Y=w;Y=Y.parentNode;)Y.nodeType===1&&W.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<W.length;w++){var P=W[w];P.element.scrollLeft=P.left,P.element.scrollTop=P.top}}ea=!!Vf,Yf=Vf=null}finally{ft=d,he.p=c,J.T=s}}e.current=t,Rt=2}}function jf(){if(Rt===2){Rt=0;var e=oi,t=nr,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=J.T,J.T=null;var s=he.p;he.p=2;var c=ft;ft|=4;try{lg(e,t.alternate,t)}finally{ft=c,he.p=s,J.T=i}}Rt=3}}function Of(){if(Rt===4||Rt===3){Rt=0;var e=Ir;Ir=null,Dt();var t=oi,i=nr,s=Ci,c=bg,d=(s&335544064)===s?10262:10256;if((i.subtreeFlags&d)!==0||(i.flags&d)!==0?Rt=5:(Rt=0,nr=oi=null,zg(t,t.pendingLanes)),d=t.pendingLanes,d===0&&(bl=null),ni(s),i=i.stateNode,Xe&&typeof Xe.onCommitFiberRoot=="function")try{Xe.onCommitFiberRoot(Pe,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=J.T,d=he.p,he.p=2,J.T=null;try{for(var b=t.onRecoverableError,w=0;w<c.length;w++){var j=c[w];b(j.value,{componentStack:j.stack})}}finally{J.T=i,he.p=d}}if(c=Vr,b=Yr,Yr=null,c!==null&&(Vr=null,b===null&&(b=[]),e!==null))for(j=0;j<c.length;j++)i=(0,c[j])(b),i!==void 0&&e.finished.finally(i);(Ci&3)!==0&&Iu(),Ni(t),d=t.pendingLanes,(s&261930)!==0&&(d&42)!==0?t===Lu?Xa++:(Xa=0,Lu=t):(Xa=0,Lu=null),Za(0)}}function zg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Na(t)))}function Iu(){return Ir!==null&&(Ir.skipTransition(),Ir=null),Nf(),jf(),Of(),zf()}function zf(){if(Rt!==5)return!1;var e=oi,t=Ef;Ef=0;var i=ni(Ci),s=J.T,c=he.p;try{he.p=32>i?32:i,J.T=null,i=Tf,Tf=null;var d=oi,b=Ci;if(Rt=0,nr=oi=null,Ci=0,(ft&6)!==0)throw Error(a(331));var w=ft;if(ft|=4,gg(d.current),hg(d,d.current,b,i),ft=w,Za(0,!1),Xe&&typeof Xe.onPostCommitFiberRoot=="function")try{Xe.onPostCommitFiberRoot(Pe,d)}catch{}return!0}finally{he.p=c,J.T=s,zg(e,t)}}function _g(e,t,i){t=Zn(i,t),t=Xc(e.stateNode,t,2),e=fl(e,t,2),e!==null&&(yi(e,2),Ni(e))}function yt(e,t,i){if(e.tag===3)_g(e,e,i);else for(;t!==null;){if(t.tag===3){_g(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(bl===null||!bl.has(s))){e=Zn(i,e),i=Nm(2),s=fl(t,i,2),s!==null&&(jm(i,s,t,e),yi(s,2),Ni(s));break}}t=t.return}}function _f(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new Lx;var c=new Set;s.set(t,c)}else c=s.get(t),c===void 0&&(c=new Set,s.set(t,c));c.has(i)||(wf=!0,c.add(i),e=Fx.bind(null,e,t,i),t.then(e,e))}function Fx(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,At===e&&(Ze&i)===i&&((Ht===4||Ht===3&&(Ze&62914560)===Ze&&300>bt()-Ru)&&(ft&2)===0?Fr(e,0):qu|=i,Hr===Ze&&(Hr=0)),Ni(e)}function qg(e,t){t===0&&(t=pr()),e=Hl(e,t),e!==null&&(yi(e,t),Ni(e))}function Qx(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),qg(e,i)}function Xx(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,c=e.memoizedState;c!==null&&(i=c.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(t),qg(e,i)}function Zx(e,t){return Sn(e,t)}var Xr=null,Zr=null,qf=!1,Vu=!1,Rf=!1,Sl=0;function Ni(e){e!==Zr&&e.next===null&&(Zr===null?Xr=Zr=e:Zr=Zr.next=e),Vu=!0,qf||(qf=!0,Jx())}function Za(e,t){if(!Rf&&Vu){Rf=!0;do for(var i=!1,s=Xr;s!==null;){if(e!==0){var c=s.pendingLanes;if(c===0)var d=0;else{var b=s.suspendedLanes,w=s.pingedLanes;d=(1<<31-St(42|e)+1)-1,d&=c&~(b&~w),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(i=!0,Lg(s,d))}else d=Ze,d=$i(s,s===At?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||Ri(s,d)||(i=!0,Lg(s,d));s=s.next}while(i);Rf=!1}}function Kx(){Rg()}function Rg(){Vu=qf=!1;var e=0;Sl!==0&&sS()&&(e=Sl);for(var t=bt(),i=null,s=Xr;s!==null;){var c=s.next,d=Mg(s,t);d===0?(s.next=null,i===null?Xr=c:i.next=c,c===null&&(Zr=i)):(i=s,(e!==0||(d&3)!==0)&&(Vu=!0)),s=c}Rt!==0&&Rt!==5||Za(e),Sl!==0&&(Sl=0)}function Mg(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var b=31-St(d),w=1<<b,j=c[b];j===-1?((w&i)===0||(w&s)!==0)&&(c[b]=ua(w,t)):j<=t&&(e.expiredLanes|=w),d&=~w}if(t=At,i=Ze,i=$i(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(gt===2||gt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&en(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Ri(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&en(s),ni(i)){case 2:case 8:i=gn;break;case 32:i=_i;break;case 268435456:i=Dn;break;default:i=_i}return s=Dg.bind(null,e),i=Sn(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&en(s),e.callbackPriority=2,e.callbackNode=null,2}function Dg(e,t){if(Rt!==0&&Rt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Iu()&&e.callbackNode!==i)return null;var s=Ze;return s=$i(e,e===At?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Sg(e,s,t),Mg(e,bt()),e.callbackNode!=null&&e.callbackNode===i?Dg.bind(null,e):null)}function Lg(e,t){if(Iu())return null;Sg(e,t,!0)}function Jx(){oS(function(){(ft&6)!==0?Sn(Bt,Kx):Rg()})}function Mf(){if(Sl===0){var e=Ql;e===0&&(e=hr,hr<<=1,(hr&261888)===0&&(hr=256)),Sl=e}return Sl}function Bg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:A(e)}function $x(e,t,i,s,c){if(t==="submit"&&i&&i.stateNode===c){var d=Bg((c[nn]||null).action),b=s.submitter;b&&(t=(t=b[nn]||null)?Bg(t.formAction):b.getAttribute("formAction"),t!==null&&(d=t,b=null));var w=new Vs("action","action",null,s,c);e.push({event:w,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Sl!==0){var j=new FormData(c,b);Vc(i,{pending:!0,data:j,method:c.method,action:d},null,j)}}else typeof d=="function"&&(w.preventDefault(),j=new FormData(c,b),Vc(i,{pending:!0,data:j,method:c.method,action:d},d,j))},currentTarget:c}]})}}for(var Df=0;Df<ac.length;Df++){var Lf=ac[Df],Px=Lf.toLowerCase(),Wx=Lf[0].toUpperCase()+Lf.slice(1);ri(Px,"on"+Wx)}ri(cp,"onAnimationEnd"),ri(fp,"onAnimationIteration"),ri(dp,"onAnimationStart"),ri("dblclick","onDoubleClick"),ri("focusin","onFocus"),ri("focusout","onBlur"),ri(ux,"onTransitionRun"),ri(ox,"onTransitionStart"),ri(cx,"onTransitionCancel"),ri(hp,"onTransitionEnd"),kn("onMouseEnter",["mouseout","mouseover"]),kn("onMouseLeave",["mouseout","mouseover"]),kn("onPointerEnter",["pointerout","pointerover"]),kn("onPointerLeave",["pointerout","pointerover"]),vi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),vi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),vi("onBeforeInput",["compositionend","keypress","textInput","paste"]),vi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),vi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),vi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ka="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(" "),eS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ka));function Ug(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],c=s.event;s=s.listeners;e:{var d=void 0;if(t)for(var b=s.length-1;0<=b;b--){var w=s[b],j=w.instance,U=w.currentTarget;if(w=w.listener,j!==d&&c.isPropagationStopped())break e;d=w,c.currentTarget=U;try{d(c)}catch(Q){Fs(Q)}c.currentTarget=null,d=j}else for(b=0;b<s.length;b++){if(w=s[b],j=w.instance,U=w.currentTarget,w=w.listener,j!==d&&c.isPropagationStopped())break e;d=w,c.currentTarget=U;try{d(c)}catch(Q){Fs(Q)}c.currentTarget=null,d=j}}}}function Qe(e,t){var i=t[_s];i===void 0&&(i=t[_s]=new Set);var s=e+"__bubble";i.has(s)||(Hg(t,e,2,!1),i.add(s))}function Bf(e,t,i){var s=0;t&&(s|=4),Hg(i,e,s,t)}var Yu="_reactListening"+Math.random().toString(36).slice(2);function Uf(e){if(!e[Yu]){e[Yu]=!0,qs.forEach(function(i){i!=="selectionchange"&&(eS.has(i)||Bf(i,!1,e),Bf(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yu]||(t[Yu]=!0,Bf("selectionchange",!1,t))}}function Hg(e,t,i,s){switch(jy(t)){case 2:var c=QS;break;case 8:c=XS;break;default:c=rd}i=c.bind(null,t,i,e),c=void 0,!jt||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),s?c!==void 0?e.addEventListener(t,i,{capture:!0,passive:c}):e.addEventListener(t,i,!0):c!==void 0?e.addEventListener(t,i,{passive:c}):e.addEventListener(t,i,!1)}function Hf(e,t,i,s,c){var d=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var b=s.tag;if(b===3||b===4){var w=s.stateNode.containerInfo;if(w===c)break;if(b===4)for(b=s.return;b!==null;){var j=b.tag;if((j===3||j===4)&&b.stateNode.containerInfo===c)return;b=b.return}for(;w!==null;){if(b=Ln(w),b===null)return;if(j=b.tag,j===5||j===6||j===26||j===27){s=d=b;continue e}w=w.parentNode}}s=s.return}ot(function(){var U=d,Q=pe(i),W=[];e:{var L=pp.get(e);if(L!==void 0){var Y=Vs,de=e;switch(e){case"keypress":if(Hs(i)===0)break e;case"keydown":case"keyup":Y=B1;break;case"focusin":de="focus",Y=Jo;break;case"focusout":de="blur",Y=Jo;break;case"beforeblur":case"afterblur":Y=Jo;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=Yh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=A1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=Y1;break;case cp:case fp:case dp:Y=j1;break;case hp:Y=F1;break;case"scroll":case"scrollend":Y=E1;break;case"wheel":Y=X1;break;case"copy":case"cut":case"paste":Y=z1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Fh;break;case"submit":Y=I1;break;case"toggle":case"beforetoggle":Y=K1}var be=(t&4)!==0,Ue=!be&&(e==="scroll"||e==="scrollend"),B=be?L!==null?L+"Capture":null:L;be=[];for(var D=U,V;D!==null;){var P=D;if(V=P.stateNode,P=P.tag,P!==5&&P!==26&&P!==27||V===null||B===null||(P=et(D,B),P!=null&&be.push(Ja(D,P,V))),Ue)break;D=D.return}0<be.length&&(L=new Y(L,de,null,i,Q),W.push({event:L,listeners:be}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",Y&&i!==$&&(de=i.relatedTarget||i.fromElement)&&(Ln(de)||de[ii]))break e;(L||Y)&&(de=Q.window===Q?Q:(Y=Q.ownerDocument)?Y.defaultView||Y.parentWindow:window,L?(Y=i.relatedTarget||i.toElement,L=U,Y=Y?Ln(Y):null,Y!==null&&(Ue=o(Y),be=Y.tag,Y!==Ue||be!==5&&be!==27&&be!==6)&&(Y=null)):(L=null,Y=U),L!==Y&&(be=Yh,P="onMouseLeave",B="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(be=Fh,P="onPointerLeave",B="onPointerEnter",D="pointer"),Ue=L==null?de:Di(L),V=Y==null?de:Di(Y),de=new be(P,D+"leave",L,i,Q),de.target=Ue,de.relatedTarget=V,P=null,Ln(Q)===U&&(be=new be(B,D+"enter",Y,i,Q),be.target=V,be.relatedTarget=Ue,P=be),Ue=P,be=L&&Y?O(L,Y,tS):null,L!==null&&Ig(W,de,L,be,!1),Y!==null&&Ue!==null&&Ig(W,Ue,Y,be,!0)))}e:{if(L=U?Di(U):window,Y=L.nodeName&&L.nodeName.toLowerCase(),Y==="select"||Y==="input"&&L.type==="file")var ve=Wh;else if($h(L))if(ep)ve=rx;else{ve=ix;var Ke=nx}else Y=L.nodeName,!Y||Y.toLowerCase()!=="input"||L.type!=="checkbox"&&L.type!=="radio"?U&&xr(U.elementType)&&(ve=Wh):ve=lx;if(ve&&(ve=ve(e,U))){Ph(W,ve,i,Q);break e}Ke&&Ke(e,L,U)}switch(Ke=U?Di(U):window,e){case"focusin":($h(Ke)||Ke.contentEditable==="true")&&(wr=Ke,ic=U,Ta=null);break;case"focusout":Ta=ic=wr=null;break;case"mousedown":lc=!0;break;case"contextmenu":case"mouseup":case"dragend":lc=!1,up(W,i,Q);break;case"selectionchange":if(sx)break;case"keydown":case"keyup":up(W,i,Q)}var Ae;if(Po)e:{switch(e){case"compositionstart":var _e="onCompositionStart";break e;case"compositionend":_e="onCompositionEnd";break e;case"compositionupdate":_e="onCompositionUpdate";break e}_e=void 0}else Sr?Kh(e,i)&&(_e="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(_e="onCompositionStart");_e&&(Qh&&i.locale!=="ko"&&(Sr||_e!=="onCompositionStart"?_e==="onCompositionEnd"&&Sr&&(Ae=Ih()):(sn=Q,Ll="value"in sn?sn.value:sn.textContent,Sr=!0)),Ke=Gu(U,_e),0<Ke.length&&(_e=new Gh(_e,e,null,i,Q),W.push({event:_e,listeners:Ke}),Ae?_e.data=Ae:(Ae=Jh(i),Ae!==null&&(_e.data=Ae)))),(Ae=$1?P1(e,i):W1(e,i))&&(_e=Gu(U,"onBeforeInput"),0<_e.length&&(Ke=new Gh("onBeforeInput","beforeinput",null,i,Q),W.push({event:Ke,listeners:_e}),Ke.data=Ae)),$x(W,e,U,i,Q)}Ug(W,t)})}function Ja(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Gu(e,t){for(var i=t+"Capture",s=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=et(e,i),c!=null&&s.unshift(Ja(e,c,d)),c=et(e,t),c!=null&&s.push(Ja(e,c,d))),e.tag===3)return s;e=e.return}return[]}function tS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ig(e,t,i,s,c){for(var d=t._reactName,b=[];i!==null&&i!==s;){var w=i,j=w.alternate,U=w.stateNode;if(w=w.tag,j!==null&&j===s)break;w!==5&&w!==26&&w!==27||U===null||(j=U,c?(U=et(i,d),U!=null&&b.unshift(Ja(i,U,j))):c||(U=et(i,d),U!=null&&b.push(Ja(i,U,j)))),i=i.return}b.length!==0&&e.push({event:t,listeners:b})}var nS=/\r\n?/g,iS=/\u0000|\uFFFD/g;function Vg(e){return(typeof e=="string"?e:""+e).replace(nS,`
10
+ `).replace(iS,"")}function Yg(e,t){return t=Vg(t),Vg(e)===t}function vt(e,t,i,s,c,d){switch(i){case"children":if(typeof s=="string")t==="body"||t==="textarea"&&s===""||tl(e,s);else if(typeof s=="number"||typeof s=="bigint")t!=="body"&&tl(e,""+s);else return;break;case"className":Wi(e,"class",s);break;case"tabIndex":Wi(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Wi(e,i,s);break;case"style":Qo(e,s,d);return;case"data":if(t!=="object"){Wi(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=A(s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(i,"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 d=="function"&&(i==="formAction"?(t!=="input"&&vt(e,t,"name",c.name,c,null),vt(e,t,"formEncType",c.formEncType,c,null),vt(e,t,"formMethod",c.formMethod,c,null),vt(e,t,"formTarget",c.formTarget,c,null)):(vt(e,t,"encType",c.encType,c,null),vt(e,t,"method",c.method,c,null),vt(e,t,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=A(s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=I);return;case"onScroll":s!=null&&Qe("scroll",e);return;case"onScrollEnd":s!=null&&Qe("scrollend",e);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(i=s.__html,i!=null){if(c.children!=null)throw Error(a(60));d?.__html!==i&&(e.innerHTML=i)}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=A(s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":Qe("beforetoggle",e),Qe("toggle",e),Pi(e,"popover",s);break;case"xlinkActuate":Bn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Bn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Bn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Bn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Bn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Bn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Pi(e,"is",s);break;case"innerText":case"textContent":return;default:if(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")i=Xo.get(i)||i,Pi(e,i,s);else return}He=!0}function If(e,t,i,s,c,d){switch(i){case"style":Qo(e,s,d);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(i=s.__html,i!=null){if(c.children!=null)throw Error(a(60));d?.__html!==i&&(e.innerHTML=i)}}break;case"children":if(typeof s=="string")tl(e,s);else if(typeof s=="number"||typeof s=="bigint")tl(e,""+s);else return;break;case"onScroll":s!=null&&Qe("scroll",e);return;case"onScrollEnd":s!=null&&Qe("scrollend",e);return;case"onClick":s!=null&&(e.onclick=I);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Yo.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(c=i.endsWith("Capture"),d=i.slice(2,c?i.length-7:void 0),t=e[nn]||null,t=t!=null?t[i]:null,typeof t=="function"&&e.removeEventListener(d,t,c),typeof s=="function")){typeof t!="function"&&t!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(d,s,c);break e}He=!0,i in e?e[i]=s:s===!0?e.setAttribute(i,""):Pi(e,i,s)}return}He=!0}function dn(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",e),Qe("load",e);var s=!1,c=!1,d;for(d in i)if(i.hasOwnProperty(d)){var b=i[d];if(b!=null)switch(d){case"src":s=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:vt(e,t,d,b,i,null)}}c&&vt(e,t,"srcSet",i.srcSet,i,null),s&&vt(e,t,"src",i.src,i,null);return;case"input":Qe("invalid",e);var w=d=b=c=null,j=null,U=null;for(s in i)if(i.hasOwnProperty(s)){var Q=i[s];if(Q!=null)switch(s){case"name":c=Q;break;case"type":b=Q;break;case"checked":j=Q;break;case"defaultChecked":U=Q;break;case"value":d=Q;break;case"defaultValue":w=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,t));break;default:vt(e,t,s,Q,i,null)}}ga(e,d,w,j,U,b,c,!1);return;case"select":Qe("invalid",e),s=b=d=null;for(c in i)if(i.hasOwnProperty(c)&&(w=i[c],w!=null))switch(c){case"value":d=w;break;case"defaultValue":b=w;break;case"multiple":s=w;default:vt(e,t,c,w,i,null)}t=d,i=b,e.multiple=!!s,t!=null?el(e,!!s,t,!1):i!=null&&el(e,!!s,i,!0);return;case"textarea":Qe("invalid",e),d=c=s=null;for(b in i)if(i.hasOwnProperty(b)&&(w=i[b],w!=null))switch(b){case"value":s=w;break;case"defaultValue":c=w;break;case"children":d=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(a(91));break;default:vt(e,t,b,w,i,null)}va(e,s,c,d);return;case"option":for(j in i)i.hasOwnProperty(j)&&(s=i[j],s!=null)&&(j==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":vt(e,t,j,s,i,null));return;case"dialog":Qe("beforetoggle",e),Qe("toggle",e),Qe("cancel",e),Qe("close",e);break;case"iframe":case"object":Qe("load",e);break;case"video":case"audio":for(s=0;s<Ka.length;s++)Qe(Ka[s],e);break;case"image":Qe("error",e),Qe("load",e);break;case"details":Qe("toggle",e);break;case"embed":case"source":case"link":Qe("error",e),Qe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(U in i)if(i.hasOwnProperty(U)&&(s=i[U],s!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:vt(e,t,U,s,i,null)}return;default:if(xr(t)){for(Q in i)i.hasOwnProperty(Q)&&(s=i[Q],s!==void 0&&If(e,t,Q,s,i,void 0));return}}for(w in i)i.hasOwnProperty(w)&&(s=i[w],s!=null&&vt(e,t,w,s,i,null))}var lS={};function rS(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,b=null,w=null,j=null,U=null,Q=null;for(Y in i){var W=i[Y];if(i.hasOwnProperty(Y)&&W!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":j=W;default:s.hasOwnProperty(Y)||vt(e,t,Y,null,s,W)}}for(var L in s){var Y=s[L];if(W=i[L],s.hasOwnProperty(L)&&(Y!=null||W!=null))switch(L){case"type":Y!==W&&(He=!0),d=Y;break;case"name":Y!==W&&(He=!0),c=Y;break;case"checked":Y!==W&&(He=!0),U=Y;break;case"defaultChecked":Y!==W&&(He=!0),Q=Y;break;case"value":Y!==W&&(He=!0),b=Y;break;case"defaultValue":Y!==W&&(He=!0),w=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,t));break;default:Y!==W&&vt(e,t,L,Y,s,W)}}ma(e,b,w,j,U,Q,d,c);return;case"select":Y=b=w=L=null;for(d in i)if(j=i[d],i.hasOwnProperty(d)&&j!=null)switch(d){case"value":break;case"multiple":Y=j;default:s.hasOwnProperty(d)||vt(e,t,d,null,s,j)}for(c in s)if(d=s[c],j=i[c],s.hasOwnProperty(c)&&(d!=null||j!=null))switch(c){case"value":d!==j&&(He=!0),L=d;break;case"defaultValue":d!==j&&(He=!0),w=d;break;case"multiple":d!==j&&(He=!0),b=d;default:d!==j&&vt(e,t,c,d,s,j)}t=w,i=b,s=Y,L!=null?el(e,!!i,L,!1):!!s!=!!i&&(t!=null?el(e,!!i,t,!0):el(e,!!i,i?[]:"",!1));return;case"textarea":Y=L=null;for(w in i)if(c=i[w],i.hasOwnProperty(w)&&c!=null&&!s.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:vt(e,t,w,null,s,c)}for(b in s)if(c=s[b],d=i[b],s.hasOwnProperty(b)&&(c!=null||d!=null))switch(b){case"value":c!==d&&(He=!0),L=c;break;case"defaultValue":c!==d&&(He=!0),Y=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(a(91));break;default:c!==d&&vt(e,t,b,c,s,d)}ya(e,L,Y);return;case"option":for(var de in i)L=i[de],i.hasOwnProperty(de)&&L!=null&&!s.hasOwnProperty(de)&&(de==="selected"?e.selected=!1:vt(e,t,de,null,s,L));for(j in s)L=s[j],Y=i[j],s.hasOwnProperty(j)&&L!==Y&&(L!=null||Y!=null)&&(j==="selected"?(L!==Y&&(He=!0),e.selected=L&&typeof L!="function"&&typeof L!="symbol"):vt(e,t,j,L,s,Y));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 be in i)L=i[be],i.hasOwnProperty(be)&&L!=null&&!s.hasOwnProperty(be)&&vt(e,t,be,null,s,L);for(U in s)if(L=s[U],Y=i[U],s.hasOwnProperty(U)&&L!==Y&&(L!=null||Y!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(a(137,t));break;default:vt(e,t,U,L,s,Y)}return;default:if(xr(t)){for(var Ue in i)L=i[Ue],i.hasOwnProperty(Ue)&&L!==void 0&&!s.hasOwnProperty(Ue)&&If(e,t,Ue,void 0,s,L);for(Q in s)L=s[Q],Y=i[Q],!s.hasOwnProperty(Q)||L===Y||L===void 0&&Y===void 0||If(e,t,Q,L,s,Y);return}}for(var B in i)L=i[B],i.hasOwnProperty(B)&&L!=null&&!s.hasOwnProperty(B)&&vt(e,t,B,null,s,L);for(W in s)L=s[W],Y=i[W],!s.hasOwnProperty(W)||L===Y||L==null&&Y==null||vt(e,t,W,L,s,Y)}function Gg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function aS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var c=i[s],d=c.transferSize,b=c.initiatorType,w=c.duration;if(d&&w&&Gg(b)){for(b=0,w=c.responseEnd,s+=1;s<i.length;s++){var j=i[s],U=j.startTime;if(U>w)break;var Q=j.transferSize,W=j.initiatorType;Q&&Gg(W)&&(j=j.responseEnd,b+=Q*(j<w?1:(w-U)/(j-U)))}if(--s,t+=8*(d+b)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Vf=null,Yf=null;function $a(e){return e.nodeType===9?e:e.ownerDocument}function Fg(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Qg(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Xg(e,t,i,s){return i=$a(i).createElement(e),i[Pt]=s,i[nn]=t,dn(i,e,t),Yt(i),i}function Gf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ff=null;function sS(){var e=window.event;return e&&e.type==="popstate"?e===Ff?!1:(Ff=e,!0):(Ff=null,!1)}var Qf=typeof setTimeout=="function"?setTimeout:void 0,uS=typeof clearTimeout=="function"?clearTimeout:void 0,Zg=typeof Promise=="function"?Promise:void 0,Kg=typeof requestAnimationFrame=="function"?requestAnimationFrame:Qf,oS=typeof queueMicrotask=="function"?queueMicrotask:typeof Zg<"u"?function(e){return Zg.resolve(null).then(e).catch(cS)}:Qf;function cS(e){setTimeout(function(){throw e})}function wl(e){return e==="head"}function Jg(e,t){var i=t,s=0;do{var c=i.nextSibling;if(e.removeChild(i),c&&c.nodeType===8)if(i=c.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(c),ta(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")ed(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,ed(i);for(var d=i.firstChild;d;){var b=d.nextSibling,w=d.nodeName;d[Rl]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&d.rel.toLowerCase()==="stylesheet"||i.removeChild(d),d=b}}else i==="body"&&ed(e.ownerDocument.body);i=c}while(i);ta(t)}function $g(e,t){var i=e;e=0;do{var s=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function Pg(e,t,i){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,i!=null&&(e.style.viewTransitionClass=i),i=getComputedStyle(e),i.display==="inline"){if(t=e.getClientRects(),t.length===1)var s=1;else for(var c=s=0;c<t.length;c++){var d=t[c];0<d.width&&0<d.height&&s++}s===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+i.paddingTop,e.marginBottom="-"+i.paddingBottom)}}function Wg(e,t){e=e.style,t=t.style;var i=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=i==null||typeof i=="boolean"?"":(""+i).trim(),i=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=i==null||typeof i=="boolean"?"":(""+i).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(i=t.display,e.display=i==null||typeof i=="boolean"?"":i,i=t.margin,i!=null?e.margin=i:(i=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=i==null||typeof i=="boolean"?"":i,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function fS(e,t,i){return i=i.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=i.innerHeight&&e.left<=i.innerWidth}}function Xf(e){var t=e.getBoundingClientRect(),i=getComputedStyle(e);return fS(t,i,e)}function dS(e){return e.documentElement.clientHeight}function hS(e){this.addEventListener("load",e),this.addEventListener("error",e)}function pS(e,t,i,s,c,d,b,w,j){var U=t.nodeType===9?t:t.ownerDocument;try{var Q=U.startViewTransition({update:function(){var L=U.defaultView,Y=L.navigation&&L.navigation.transition,de=U.fonts.status;s();var be=[];if(de==="loaded"&&(dS(U),U.fonts.status==="loading"&&be.push(U.fonts.ready)),de=be.length,e!==null)for(var Ue=e.suspenseyImages,B=0,D=0;D<Ue.length;D++){var V=Ue[D];if(!V.complete){var P=V.getBoundingClientRect();if(0<P.bottom&&0<P.right&&P.top<L.innerHeight&&P.left<L.innerWidth){if(B+=xy(V),B>Xu){be.length=de;break}V=new Promise(hS.bind(V)),be.push(V)}}}if(0<be.length)return L=Promise.race([Promise.all(be),new Promise(function(ve){return setTimeout(ve,500)})]).then(c,c),(Y?Promise.allSettled([Y.finished,L]):L).then(d,d);if(c(),Y)return Y.finished.then(d,d);d()},types:i});U.__reactViewTransition=Q;var W=[];return Q.ready.then(function(){for(var L=U.documentElement.getAnimations({subtree:!0}),Y=0;Y<L.length;Y++){var de=L[Y],be=de.effect,Ue=be.pseudoElement;if(Ue!=null&&Ue.startsWith("::view-transition")){W.push(de),de=be.getKeyframes();for(var B=Ue=void 0,D=!0,V=0;V<de.length;V++){var P=de[V],ve=P.width;if(Ue===void 0)Ue=ve;else if(Ue!==ve){D=!1;break}if(ve=P.height,B===void 0)B=ve;else if(B!==ve){D=!1;break}delete P.width,delete P.height,P.transform==="none"&&delete P.transform}D&&Ue!==void 0&&B!==void 0&&(be.setKeyframes(de),D=getComputedStyle(be.target,be.pseudoElement),D.width!==Ue||D.height!==B)&&(D=de[0],D.width=Ue,D.height=B,D=de[de.length-1],D.width=Ue,D.height=B,be.setKeyframes(de))}}b()},function(L){U.__reactViewTransition===Q&&(U.__reactViewTransition=null);try{typeof L=="object"&&L!==null&&L.name==="InvalidStateError"&&(L.message==="View transition was skipped because document visibility state is hidden."||L.message==="Skipping view transition because document visibility state has become hidden."||L.message==="Skipping view transition because viewport size changed."||L.message==="Transition was aborted because of invalid state")&&(L=null),L!==null&&j(L)}finally{s(),c(),b()}}),Q.finished.finally(function(){for(var L=0;L<W.length;L++)W[L].cancel();U.__reactViewTransition===Q&&(U.__reactViewTransition=null),w()}),Q}catch{return s(),c(),b(),null}}function ir(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}ir.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:X({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},ir.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,i=e.getAnimations({subtree:!0}),s=[],c=0;c<i.length;c++){var d=i[c].effect;d!==null&&d.target===e&&d.pseudoElement===t&&s.push(i[c])}return s},ir.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function ey(e){return{name:e,group:new ir("group",e),imagePair:new ir("image-pair",e),old:new ir("old",e),new:new ir("new",e)}}function Fn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fn.prototype.addEventListener=function(e,t,i){var s=null,c=null;if(!(i!=null&&typeof i!="boolean"&&(s=i.signal||null,s!==null&&s.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var d=this._eventListeners;if(ny(d,e,t,i)===-1){var b=this,w=t;i!=null&&typeof i!="boolean"&&i.once===!0&&(w=function(j){b.removeEventListener(e,t,i),typeof t=="function"?t.call(this,j):t.handleEvent(j)}),s!==null&&(c=b.removeEventListener.bind(b,e,t,i),s.addEventListener("abort",c,{once:!0}),c=s.removeEventListener.bind(s,"abort",c)),s=Kr(i),d.push({type:e,listener:t,optionsOrUseCapture:i,attachedListener:w,cleanup:c}),g(this._fragmentFiber.child,!1,mS,e,w,s)}this._eventListeners=d}};function mS(e,t,i,s){return C(e).addEventListener(t,i,s),!1}Fn.prototype.removeEventListener=function(e,t,i){var s=this._eventListeners;if(s!==null&&(t=ny(s,e,t,i),t!==-1)){var c=s[t];i=c.attachedListener;var d=c.cleanup;c=Kr(c.optionsOrUseCapture),g(this._fragmentFiber.child,!1,gS,e,i,c),s.splice(t,1),d!==null&&d()}};function gS(e,t,i,s){return C(e).removeEventListener(t,i,s),!1}function Kr(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function ty(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function ny(e,t,i,s){if(e.length===0)return-1;s=ty(s);for(var c=0;c<e.length;c++){var d=e[c];if(d.type===t&&d.listener===i&&ty(d.optionsOrUseCapture)===s)return c}return-1}Fn.prototype.dispatchEvent=function(e){var t=S(this._fragmentFiber);if(t===null)return!0;t=C(t);var i=this._eventListeners;if(i!==null&&0<i.length||!e.bubbles){var s=t.nodeType===9?t.createComment(""):document.createTextNode("");if(i)for(var c=0;c<i.length;c++){var d=i[c];s.addEventListener(d.type,d.attachedListener,Kr(d.optionsOrUseCapture))}if(t.appendChild(s),e=s.dispatchEvent(e),i)for(c=0;c<i.length;c++)d=i[c],s.removeEventListener(d.type,d.attachedListener,Kr(d.optionsOrUseCapture));return t.removeChild(s),e}return t.dispatchEvent(e)},Fn.prototype.focus=function(e){g(this._fragmentFiber.child,!0,iy,e,void 0,void 0)};function iy(e,t){return e.tag===6?!1:(e=C(e),NS(e,t))}Fn.prototype.focusLast=function(e){var t=[];g(this._fragmentFiber.child,!0,Zf,t,void 0,void 0);for(var i=t.length-1;0<=i&&!iy(t[i],e);i--);};function Zf(e,t){return t.push(e),!1}Fn.prototype.blur=function(){var e=S(this._fragmentFiber);e!==null&&(e=C(e),e=$a(e).activeElement,e!==null&&g(this._fragmentFiber.child,!1,yS,e,void 0,void 0))};function yS(e,t){return e.tag===6?!1:(e=C(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),g(this._fragmentFiber.child,!1,vS,e,void 0,void 0)};function vS(e,t){return e.tag===6||(e=C(e),t.observe(e)),!1}Fn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),g(this._fragmentFiber.child,!1,bS,e,void 0,void 0);for(var i=t=0;i<ci.length;i++){var s=ci[i];s.fragmentInstance===this&&s.observer===e?e.unobserve(s.instance):ci[t++]=s}ci.length=t}};function bS(e,t){return e.tag===6||(e=C(e),t.unobserve(e)),!1}var ci=[],Kf=!1;function xS(e,t,i){ci.push({fragmentInstance:e,observer:t,instance:i}),Kf||(Kf=!0,jS(function(){Kf=!1;var s=ci;ci=[];for(var c=0;c<s.length;c++){var d=s[c];d.observer.unobserve(d.instance)}}))}Fn.prototype.getClientRects=function(){var e=[];return g(this._fragmentFiber.child,!1,SS,e,void 0,void 0),e};function SS(e,t){if(e.tag===6){e=e.stateNode;var i=e.ownerDocument.createRange();i.selectNodeContents(e),t.push.apply(t,i.getClientRects())}else e=C(e),t.push.apply(t,e.getClientRects());return!1}Fn.prototype.getRootNode=function(e){var t=S(this._fragmentFiber);return t===null?this:C(t).getRootNode(e)},Fn.prototype.compareDocumentPosition=function(e){var t=S(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var i=[];g(this._fragmentFiber.child,!1,Zf,i,void 0,void 0);var s=C(t);if(i.length===0){if(i=s,x(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(i=t)}t=this._fragmentFiber;var c=s=i.compareDocumentPosition(e);return i===e?c=Node.DOCUMENT_POSITION_CONTAINS:s&Node.DOCUMENT_POSITION_CONTAINED_BY&&(i=k(t)[1],i===null?c=Node.DOCUMENT_POSITION_PRECEDING:(e=C(i).compareDocumentPosition(e),c=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),c|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=C(i[0]),c=C(i[i.length-1]);var d=x(this._fragmentFiber)?t.parentElement:s;if(d==null)return Node.DOCUMENT_POSITION_DISCONNECTED;s=d.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,d=d.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_CONTAINED_BY;var b=t.compareDocumentPosition(e),w=c.compareDocumentPosition(e),j=b&Node.DOCUMENT_POSITION_CONTAINED_BY||w&Node.DOCUMENT_POSITION_CONTAINED_BY;return w=s&&d&&b&Node.DOCUMENT_POSITION_FOLLOWING&&w&Node.DOCUMENT_POSITION_PRECEDING,t=s&&t===e||d&&c===e||j||w?Node.DOCUMENT_POSITION_CONTAINED_BY:!s&&t===e||!d&&c===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:b,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||wS(t,this._fragmentFiber,i[0],i[i.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function wS(e,t,i,s,c){var d=Ln(c);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(i=!!d)e:{for(;d!==null;){if(d.tag===7&&(d===t||d.alternate===t)){i=!0;break e}d=d.return}i=!1}return i}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(d===null)return d=c.ownerDocument,c===d||c===d.documentElement||c===d.body;e:{for(d=t,t=S(t);d!==null;){if(!(d.tag!==5&&d.tag!==3&&d.tag!==27||d!==t&&d.alternate!==t)){d=!0;break e}d=d.return}d=!1}return d}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!d)&&!(t=d===i)&&(t=O(i,d,ie),t===null?t=!1:(g(t,!0,H,d,i),d=E,E=null,t=d!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!d)&&!(t=d===s)&&(t=O(s,d,ie),t===null?t=!1:(g(t,!0,te,d,s),d=E,M=E=null,t=d!==null)),t):!1}function ly(e,t){var i=e.ownerDocument.createRange();i.selectNodeContents(e),e=i.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(a(566));var t=[];g(this._fragmentFiber.child,!1,Zf,t,void 0,void 0);var i=e!==!1;if(t.length===0){var s=k(this._fragmentFiber);if(s=i?s[1]||s[0]||S(this._fragmentFiber):s[0]||s[1],s===null)return;if(s.tag===6){e=C(s),ly(e,i);return}if(s=C(s),s.nodeType!==9){if(s.nodeType===11){i="host"in s?s.host:null,i!==null&&i.scrollIntoView(e);return}s.scrollIntoView(e)}}for(s=i?t.length-1:0;s!==(i?-1:t.length);){var c=t[s];c.tag===6?(c=C(c),ly(c,i)):C(c).scrollIntoView(e),s+=i?-1:1}};function kS(e,t){return e=C(e),ry(e,t),!1}function ry(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function ay(e,t){var i=t._eventListeners;if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];e.addEventListener(c.type,c.attachedListener,Kr(c.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(d){for(var b=0,w=0;w<ci.length;w++){var j=ci[w];(j.fragmentInstance!==t||j.observer!==d||j.instance!==e)&&(ci[b++]=j)}ci.length=b,d.observe(e)}),ry(e,t))}function ES(e,t){var i=t._eventListeners;if(i!==null)for(var s=0;s<i.length;s++){var c=i[s];e.removeEventListener(c.type,c.attachedListener,Kr(c.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(d){typeof d.rootMargin=="string"?xS(t,d,e):d.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Jf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Jf(i),Dl(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function TS(e,t,i,s){for(;e.nodeType===1;){var c=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Rl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=Wn(e.nextSibling),e===null)break}return null}function AS(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Wn(e.nextSibling),e===null))return null;return e}function sy(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Wn(e.nextSibling),e===null))return null;return e}function $f(e){return e.data==="$?"||e.data==="$~"}function Pf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function CS(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Wn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Wf=null;function uy(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Wn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function oy(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function NS(e,t){function i(){s=!0}if(e.ownerDocument.activeElement===e)return!0;var s=!1;try{e.ownerDocument.addEventListener("focus",i,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",i,!0)}return s}function jS(e){Kg(function(){Kg(function(t){return e(t)})})}function cy(e,t,i){switch(t=$a(i),e){case"html":if(e=t.documentElement,!e)throw Error(a(452));return e;case"head":if(e=t.head,!e)throw Error(a(453));return e;case"body":if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function fy(e,t,i){for(var s in i){var c=i[s];i.hasOwnProperty(s)&&c!=null&&vt(e,t,s,null,lS,c)}i.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===I&&(e.onclick=null),Dl(e)}function ed(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Dl(e)}var ei=new Map,dy=new Set;function Pa(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Ki=he.d;he.d={f:OS,r:zS,D:_S,C:qS,L:RS,m:MS,X:LS,S:DS,M:BS};function OS(){var e=Ki.f(),t=Bu();return e||t}function zS(e){var t=Vt(e);t!==null&&t.tag===5&&t.type==="form"?pm(t):Ki.r(e)}var Jr=typeof document>"u"?null:document;function hy(e,t,i){var s=Jr;if(s&&typeof t=="string"&&t){var c=Nn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof i=="string"&&(c+='[crossorigin="'+i+'"]'),dy.has(c)||(dy.add(c),e={rel:e,crossOrigin:i,href:t},s.querySelector(c)===null&&(t=s.createElement("link"),dn(t,"link",e),Yt(t),s.head.appendChild(t)))}}function _S(e){Ki.D(e),hy("dns-prefetch",e,null)}function qS(e,t){Ki.C(e,t),hy("preconnect",e,t)}function RS(e,t,i){Ki.L(e,t,i);var s=Jr;if(s&&e&&t){var c='link[rel="preload"][as="'+Nn(t)+'"]';t==="image"&&i&&i.imageSrcSet?(c+='[imagesrcset="'+Nn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(c+='[imagesizes="'+Nn(i.imageSizes)+'"]')):c+='[href="'+Nn(e)+'"]';var d=c;switch(t){case"style":d=$r(e);break;case"script":d=Pr(e)}if(!(ei.has(d)||(e=X({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),ei.set(d,e),s.querySelector(c)!==null||t==="style"&&s.querySelector(Wa(d))||t==="script"&&s.querySelector(es(d))))){var b=s.createElement("link");dn(b,"link",e),t==="style"&&(b[Ml]=!0,b.onload=b.onerror=function(){ca(b)}),Yt(b),s.head.appendChild(b)}}}function MS(e,t){Ki.m(e,t);var i=Jr;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Nn(s)+'"][href="'+Nn(e)+'"]',d=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Pr(e)}if(!ei.has(d)&&(e=X({rel:"modulepreload",href:e},t),ei.set(d,e),i.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(es(d)))return}s=i.createElement("link"),dn(s,"link",e),Yt(s),i.head.appendChild(s)}}}function DS(e,t,i){Ki.S(e,t,i);var s=Jr;if(s&&e){var c=Li(s).hoistableStyles,d=$r(e);t=t||"default";var b=c.get(d);if(!b){var w={loading:0,preload:null};if(b=s.querySelector(Wa(d)))w.loading=5;else{e=X({rel:"stylesheet",href:e,"data-precedence":t},i),(i=ei.get(d))&&td(e,i);var j=b=s.createElement("link");Yt(j),dn(j,"link",e),j._p=new Promise(function(U,Q){j.onload=U,j.onerror=Q}),j.addEventListener("load",function(){w.loading|=1}),j.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Fu(b,t,s)}b={type:"stylesheet",instance:b,count:1,state:w},c.set(d,b)}}}function LS(e,t){Ki.X(e,t);var i=Jr;if(i&&e){var s=Li(i).hoistableScripts,c=Pr(e),d=s.get(c);d||(d=i.querySelector(es(c)),d||(e=X({src:e,async:!0},t),(t=ei.get(c))&&nd(e,t),d=i.createElement("script"),Yt(d),dn(d,"link",e),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function BS(e,t){Ki.M(e,t);var i=Jr;if(i&&e){var s=Li(i).hoistableScripts,c=Pr(e),d=s.get(c);d||(d=i.querySelector(es(c)),d||(e=X({src:e,async:!0,type:"module"},t),(t=ei.get(c))&&nd(e,t),d=i.createElement("script"),Yt(d),dn(d,"link",e),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(c,d))}}function py(e,t,i,s){var c=(c=mt.current)?Pa(c):null;if(!c)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(i=$r(i.href),t=Li(c).hoistableStyles,s=t.get(i),s||(s={type:"style",instance:null,count:0,state:null},t.set(i,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=$r(i.href);var d=Li(c).hoistableStyles,b=d.get(e);if(b||(c=c.ownerDocument||c,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,b),(d=c.querySelector(Wa(e)))?d._p||(b.instance=d,b.state.loading=5):(d=ei.get(e),d||(d={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},ei.set(e,d)),US(c,e,d,b.state))),t&&s===null)throw Error(a(528,""));return b}if(t&&s!==null)throw Error(a(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(i=Pr(i),t=Li(c).hoistableScripts,s=t.get(i),s||(s={type:"script",instance:null,count:0,state:null},t.set(i,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function $r(e){return'href="'+Nn(e)+'"'}function Wa(e){return'link[rel="stylesheet"]['+e+"]"}function my(e){return X({},e,{"data-precedence":e.precedence,precedence:null})}function US(e,t,i,s){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Ml]!==!0){s.loading=1;return}}else t=e.createElement("link"),t[Ml]=!0,t.onload=t.onerror=ca.bind(null,t),dn(t,"link",i),Yt(t),e.head.appendChild(t);s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2})}function Pr(e){return'[src="'+Nn(e)+'"]'}function es(e){return"script[async]"+e}function gy(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Nn(i.href)+'"]');if(s)return t.instance=s,Yt(s),s;var c=X({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Yt(s),dn(s,"style",c),Fu(s,i.precedence,e),t.instance=s;case"stylesheet":c=$r(i.href);var d=e.querySelector(Wa(c));if(d)return t.state.loading|=4,t.instance=d,Yt(d),d;s=my(i),(c=ei.get(c))&&td(s,c),d=(e.ownerDocument||e).createElement("link"),Yt(d);var b=d;return b._p=new Promise(function(w,j){b.onload=w,b.onerror=j}),dn(d,"link",s),t.state.loading|=4,Fu(d,i.precedence,e),t.instance=d;case"script":return d=Pr(i.src),(c=e.querySelector(es(d)))?(t.instance=c,Yt(c),c):(s=i,(c=ei.get(d))&&(s=X({},i),nd(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),Yt(c),dn(c,"link",s),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(a(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Fu(s,i.precedence,e));return t.instance}function Fu(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,d=c,b=0;b<s.length;b++){var w=s[b];if(w.dataset.precedence===t)d=w;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function td(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function nd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Qu=null;function yy(e,t,i){if(Qu===null){var s=new Map,c=Qu=new Map;c.set(i,s)}else c=Qu,s=c.get(i),s||(s=new Map,c.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),c=0;c<i.length;c++){var d=i[c];if(!(d[Rl]||d[Pt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var b=d.getAttribute(t)||"";b=e+b;var w=s.get(b);w?w.push(d):s.set(b,[d])}}return s}function id(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function HS(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function vy(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function by(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function xy(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Sy(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=xy(t),e.suspenseyImages.push(t)),e=YS.bind(e),t.decode().then(e,e))}function IS(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var c=$r(s.href),d=t.querySelector(Wa(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ts.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=d,Yt(d);return}d=t.ownerDocument||t,s=my(s),(c=ei.get(c))&&td(s,c),d=d.createElement("link"),Yt(d);var b=d;b._p=new Promise(function(w,j){b.onload=w,b.onerror=j}),dn(d,"link",s),i.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=ts.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Xu=0;function VS(e,t){return e.stylesheets&&e.count===0&&Ku(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&Ku(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Xu===0&&(Xu=62500*aS());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ku(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Xu?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function wy(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Ku(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ts(){this.count--,wy(this)}function YS(){this.imgCount--,wy(this)}var Zu=null;function Ku(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zu=new Map,t.forEach(GS,e),Zu=null,ts.call(e))}function GS(e,t){if(!(t.state.loading&4)){var i=Zu.get(e);if(i)var s=i.get(null);else{i=new Map,Zu.set(e,i);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var b=c[d];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(i.set(b.dataset.precedence,b),s=b)}s&&i.set(null,s)}c=t.instance,b=c.getAttribute("data-precedence"),d=i.get(b)||s,d===s&&i.set(null,c),i.set(b,c),this.count++,s=ts.bind(this),c.addEventListener("load",s),c.addEventListener("error",s),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Wr={$$typeof:re,Provider:null,Consumer:null,_currentValue:ut,_currentValue2:ut,_threadCount:0};function FS(e,t,i,s,c,d,b,w,j){this.tag=1,this.containerInfo=e,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=mr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mr(0),this.hiddenUpdates=mr(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.transitionTypes=null,this.incompleteTransitions=new Map}function ky(e,t,i,s,c,d,b,w,j,U,Q,W){return e=new FS(e,t,i,b,j,U,Q,W,w),t=1,d===!0&&(t|=24),d=jn(3,null,null,t),e.current=d,d.stateNode=e,t=yc(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:s,isDehydrated:i,cache:t},Sc(d),e}function Ey(e){return e?(e=Tr,e):Tr}function Ty(e,t,i,s,c,d){c=Ey(c),s.context===null?s.context=c:s.pendingContext=c,s=cl(t),s.payload={element:i},d=d===void 0?null:d,d!==null&&(s.callback=d),i=fl(e,s,t),i!==null&&(qn(i,e,t),_a(i,e,t))}function Ay(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function ld(e,t){Ay(e,t),(e=e.alternate)&&Ay(e,t)}function Cy(e){if(e.tag===13||e.tag===31){var t=Hl(e,67108864);t!==null&&qn(t,e,67108864),ld(e,67108864)}}function Ny(e){if(e.tag===13||e.tag===31){var t=Gn();t=ql(t);var i=Hl(e,t);i!==null&&qn(i,e,t),ld(e,t)}}var ea=!0;function QS(e,t,i,s){var c=J.T;J.T=null;var d=he.p;try{he.p=2,rd(e,t,i,s)}finally{he.p=d,J.T=c}}function XS(e,t,i,s){var c=J.T;J.T=null;var d=he.p;try{he.p=8,rd(e,t,i,s)}finally{he.p=d,J.T=c}}function rd(e,t,i,s){if(ea){var c=ad(s);if(c===null)Hf(e,t,s,Ju,i),Oy(e,s);else if(KS(c,e,t,i,s))s.stopPropagation();else if(Oy(e,s),t&4&&-1<ZS.indexOf(e)){for(;c!==null;){var d=Vt(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var b=gi(d.pendingLanes);if(b!==0){var w=d;for(w.pendingLanes|=2,w.entangledLanes|=2;b;){var j=1<<31-St(b);w.entanglements[1]|=j,b&=~j}Ni(d),(ft&6)===0&&(Mu=bt()+500,Za(0))}}break;case 31:case 13:w=Hl(d,2),w!==null&&qn(w,d,2),Bu(),ld(d,2)}if(d=ad(s),d===null&&Hf(e,t,s,Ju,i),d===c)break;c=d}c!==null&&s.stopPropagation()}else Hf(e,t,s,null,i)}}function ad(e){return e=pe(e),sd(e)}var Ju=null;function sd(e){if(Ju=null,e=Ln(e),e!==null){var t=o(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=f(t),e!==null)return e;e=null}else if(i===31){if(e=h(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ju=e,null}function jy(e){switch(e){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Lt()){case Bt:return 2;case gn:return 8;case _i:case tn:return 32;case Dn:return 268435456;default:return 32}default:return 32}}var ud=!1,kl=null,El=null,Tl=null,ns=new Map,is=new Map,Al=[],ZS="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 Oy(e,t){switch(e){case"focusin":case"focusout":kl=null;break;case"dragenter":case"dragleave":El=null;break;case"mouseover":case"mouseout":Tl=null;break;case"pointerover":case"pointerout":ns.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":is.delete(t.pointerId)}}function ls(e,t,i,s,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:d,targetContainers:[c]},t!==null&&(t=Vt(t),t!==null&&Cy(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function KS(e,t,i,s,c){switch(t){case"focusin":return kl=ls(kl,e,t,i,s,c),!0;case"dragenter":return El=ls(El,e,t,i,s,c),!0;case"mouseover":return Tl=ls(Tl,e,t,i,s,c),!0;case"pointerover":var d=c.pointerId;return ns.set(d,ls(ns.get(d)||null,e,t,i,s,c)),!0;case"gotpointercapture":return d=c.pointerId,is.set(d,ls(is.get(d)||null,e,t,i,s,c)),!0}return!1}function zy(e){var t=Ln(e.target);if(t!==null){var i=o(t);if(i!==null){if(t=i.tag,t===13){if(t=f(i),t!==null){e.blockedOn=t,zs(e.priority,function(){Ny(i)});return}}else if(t===31){if(t=h(i),t!==null){e.blockedOn=t,zs(e.priority,function(){Ny(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function $u(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=ad(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);$=s,i.target.dispatchEvent(s),$=null}else return t=Vt(i),t!==null&&Cy(t),e.blockedOn=i,!1;t.shift()}return!0}function _y(e,t,i){$u(e)&&i.delete(t)}function JS(){ud=!1,kl!==null&&$u(kl)&&(kl=null),El!==null&&$u(El)&&(El=null),Tl!==null&&$u(Tl)&&(Tl=null),ns.forEach(_y),is.forEach(_y)}function Pu(e,t){e.blockedOn===t&&(e.blockedOn=null,ud||(ud=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,JS)))}var Wu=null;function qy(e){Wu!==e&&(Wu=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Wu===e&&(Wu=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],c=e[t+2];if(typeof s!="function"){if(sd(s||i)===null)continue;break}var d=Vt(i);d!==null&&(e.splice(t,3),t-=3,Vc(d,{pending:!0,data:c,method:i.method,action:s},s,c))}}))}function ta(e){function t(j){return Pu(j,e)}kl!==null&&Pu(kl,e),El!==null&&Pu(El,e),Tl!==null&&Pu(Tl,e),ns.forEach(t),is.forEach(t);for(var i=0;i<Al.length;i++){var s=Al[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Al.length&&(i=Al[0],i.blockedOn===null);)zy(i),i.blockedOn===null&&Al.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var c=i[s],d=i[s+1],b=c[nn]||null;if(typeof d=="function")b||qy(i);else if(b){var w=null;if(d&&d.hasAttribute("formAction")){if(c=d,b=d[nn]||null)w=b.formAction;else if(sd(c)!==null)continue}else w=b.action;typeof w=="function"?i[s+1]=w:(i.splice(s,3),s-=3),qy(i)}}}function Ry(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(b){return c=b})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function od(e){this._internalRoot=e}eo.prototype.render=od.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var i=t.current,s=Gn();Ty(i,s,e,t,null,null)},eo.prototype.unmount=od.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ty(e.current,2,null,e,null,null),Bu(),t[ii]=null}};function eo(e){this._internalRoot=e}eo.prototype.unstable_scheduleHydration=function(e){if(e){var t=vr();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Al.length&&t!==0&&t<Al[i].priority;i++);Al.splice(i,0,e),i===0&&zy(e)}};var My=l.version;if(My!=="19.3.1")throw Error(a(527,My,"19.3.1"));he.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=p(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var $S={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:J,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var to=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!to.isDisabled&&to.supportsFiber)try{Pe=to.inject($S),Xe=to}catch{}}return as.createRoot=function(e,t){if(!u(e))throw Error(a(299));var i=!1,s="",c=Em,d=Tm,b=Am;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=ky(e,1,!1,null,null,i,s,null,c,d,b,Ry),e[ii]=t.current,Uf(e),new od(t)},as.hydrateRoot=function(e,t,i){if(!u(e))throw Error(a(299));var s=!1,c="",d=Em,b=Tm,w=Am,j=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(d=i.onUncaughtError),i.onCaughtError!==void 0&&(b=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError),i.formState!==void 0&&(j=i.formState)),t=ky(e,1,!0,t,i??null,s,c,j,d,b,w,Ry),t.context=Ey(null),i=t.current,s=Gn(),s=ql(s),c=cl(s),c.callback=null,fl(i,c,s),i=s,t.current.lanes=i,yi(t,i),Ni(t),e[ii]=t.current,Uf(e),new eo(t)},as.version="19.3.1",as}var Fy;function aw(){if(Fy)return dd.exports;Fy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),dd.exports=rw(),dd.exports}var sw=aw();async function tt(n,l){const r=await fetch("/dsh-bot/api"+n,{...l,headers:{accept:"application/json",...l?.headers??{}}}),a=await r.json().catch(()=>({}));return{status:r.status,body:a&&typeof a=="object"?a:{}}}async function bs(n,l){const r=await fetch(n,{...l,headers:{accept:"application/json",...l?.headers??{}}}),a=await r.json().catch(()=>({}));return{status:r.status,body:a&&typeof a=="object"?a:{}}}function fb(n,l){return typeof n.message=="string"&&n.message!==""?n.message:l}const uw=/^(?:Name|名字)\s*[::]\s*(.+?)\s*$/i,ow=/^(?:Style|风格)\s*[::]\s*(.+?)\s*$/i,cw=/^(?:Task|任务)\s*[::]\s*(.+?)\s*$/i;function fw(n,l,r){const a=[];return n.trim()!==""&&a.push(`Name: ${n.trim()}`),l.trim()!==""&&a.push(`Style: ${l.trim()}`),r.trim()!==""&&a.push(`Task: ${r.trim()}`),a.join(`
11
+
12
+ `)}function dw(n){const l={name:"",style:"",task:""};for(const r of n.split(`
13
+ `)){const a=uw.exec(r),u=ow.exec(r),o=cw.exec(r);a&&l.name===""?l.name=a[1]??"":u&&l.style===""?l.style=u[1]??"":o&&l.task===""&&(l.task=o[1]??"")}return l}const hw={"activity.status.preparing":"Preparing call","activity.status.waiting":"Waiting for tool result","activity.status.running":"Running (confirmed)","activity.status.worker":"Waiting for Worker","activity.status.background":"Background job (last known)","activity.status.backgroundDetail":"Background job · last known state","activity.status.succeeded":"Completed","activity.status.failed":"Failed","activity.status.cancelled":"Cancelled","activity.status.unknown":"Outcome unknown","activity.ticket.scheduling":"Waiting for Worker scheduling","activity.ticket.needsUser":"Waiting for you","activity.ticket.ready":"Worker returned; awaiting review","activity.pendingCount":"{count} pending activities","activity.thinking":"Thinking","activity.reasoning":"Reasoning","activity.waitingModel":"Waiting for model response","activity.syncing":"Syncing","activity.connectionUnavailable":"Connection unavailable","activity.lastKnown":"last known","activity.lastKnownSuffix":" · last known","activity.staleSummary":"{phase} · last known: {text}","activity.count.active":"Active","activity.count.failed":"Failed","activity.count.cancelled":"Cancelled","activity.count.unknown":"Unknown","activity.title":"Activity","activity.titleOne":"1 action","activity.titleWithCount":"{count} actions","activity.resyncing":"Resyncing · last known state","activity.connectionLastKnown":"Connection unavailable · last known state","activity.generating":"Generating response; no new tool execution evidence","activity.runCommand":"Run command","activity.updatePlan":"Update plan","activity.planComplete":"complete (plan record)","activity.callRequested":"Call requested; process start not confirmed","activity.jobRegistered":"registered, not proof of completion or continued liveness","activity.latestReport":"Latest report","activity.cwdRecorded":"Recorded working directory","activity.cwdRequested":"Requested working directory","activity.cwdSessionDefault":"Session default directory (not execution confirmation)","activity.callRecorded":"Call recorded","activity.callWait":"Call wait","activity.fullArgs":"Full arguments (redacted)","activity.toolResult":"Tool result (redacted)","activity.emptyResult":"(empty result)"},pw={"activity.status.preparing":"准备调用","activity.status.waiting":"等待工具结果","activity.status.running":"执行中(已确认)","activity.status.worker":"等待 Worker","activity.status.background":"后台任务(最后已知)","activity.status.backgroundDetail":"后台任务 · 最后已知状态","activity.status.succeeded":"完成","activity.status.failed":"失败","activity.status.cancelled":"已取消","activity.status.unknown":"结果未知","activity.ticket.scheduling":"等待 Worker 调度","activity.ticket.needsUser":"等待用户","activity.ticket.ready":"Worker 已返回,待确认","activity.pendingCount":"{count} 项待完成活动","activity.thinking":"思考中","activity.reasoning":"思考记录","activity.waitingModel":"等待模型响应","activity.syncing":"正在同步","activity.connectionUnavailable":"连接不可用","activity.lastKnown":"最后已知","activity.lastKnownSuffix":" · 最后已知","activity.staleSummary":"{phase} · 最后已知: {text}","activity.count.active":"活动中","activity.count.failed":"失败","activity.count.cancelled":"取消","activity.count.unknown":"未知","activity.title":"活动","activity.titleOne":"1 个操作","activity.titleWithCount":"{count} 个操作","activity.resyncing":"正在恢复同步 · 最后已知状态","activity.connectionLastKnown":"连接不可用 · 最后已知状态","activity.generating":"正在生成回复;尚无新的工具执行证据","activity.runCommand":"执行命令","activity.updatePlan":"更新计划","activity.planComplete":"项完成(计划记录)","activity.callRequested":"已收到调用请求;尚无进程启动确认","activity.jobRegistered":"已登记,不代表完成或持续存活","activity.latestReport":"最新报告","activity.cwdRecorded":"执行记录目录","activity.cwdRequested":"请求目录","activity.cwdSessionDefault":"会话默认目录(非执行确认)","activity.callRecorded":"调用记录时间","activity.callWait":"调用等待耗时","activity.fullArgs":"完整参数(已脱敏)","activity.toolResult":"工具返回(已脱敏)","activity.emptyResult":"(空结果)"},db={en:hw,zh:pw},mw={"bot.waiting":"Waiting","bot.running":"Running","bot.stopped":"Stopped","bot.stoppedBackground":"This turn stopped. Background work is still running.","bot.retry":"Retry","bot.thinking":"Thinking","bot.replying":"Replying","bot.processed":"Done","bot.untitled":"Untitled","inbox.received":"sent a message","inbox.open":"Open bot messages, {who}: {line}","inbox.lead":"These are the words bots sent each other. They do not include the other bot's persona, memory, or permissions.","inbox.empty":"No bot messages yet.","inbox.other":"another bot","inbox.sentTo":"Sent to {name}","inbox.hop":"Hop {hop}","inbox.source":"Source"},gw={"bot.waiting":"等待操作","bot.running":"运行中","bot.stopped":"已停下","bot.stoppedBackground":"这一轮已经停下。后台还在跑。","bot.retry":"重试","bot.thinking":"正在想","bot.replying":"正在回复","bot.processed":"已处理","bot.untitled":"未命名","inbox.received":"发来一条消息","inbox.open":"打开 BOT 消息,{who}:{line}","inbox.lead":"这里是 BOT 之间传来的正文,不带对方的人格、记忆或权限。","inbox.empty":"还没有 BOT 消息。","inbox.other":"另一个 BOT","inbox.sentTo":"发给 {name}","inbox.hop":"第 {hop} 跳","inbox.source":"来源"},hb={en:mw,zh:gw},yw={"app.title":"DSH Bot","lang.switch":"中文","nav.back":"Back","nav.sessions":"Sessions","nav.botMessages":"Bot messages","nav.official":"Official client","nav.where":"Session location","nav.mainSession":"Main session","nav.worker":"Worker session","nav.pick":"Pick a session on the left, or create one.","nav.empty":"This session has no messages yet.","load.messages":"Loading messages…","load.messagesPct":"Loading messages… {pct}%","load.aria":"Loading messages","file.close":"Close","file.loading":"Reading the file…","files.open":"Files","files.title":"Files","files.workspace":"Workspace","files.home":"Home","files.refresh":"Refresh","files.upload":"Upload","files.download":"Download","files.pathHint":"Copy the path","files.empty":"This directory is empty.","files.loading":"Reading this directory…","files.folder":"Folder","files.link":"Link","files.file":"File","files.name":"Name","files.type":"Type","files.size":"Size","files.modified":"Modified","files.drop":"Drop the file to upload it here","files.confirm":"Upload this file into the current directory?","files.overwrite":"Replace the existing file","files.cancel":"Cancel","files.tooLarge":"Files larger than 50 MB are not uploaded.","files.denied":"This location is not available.","files.missing":"This location could not be found.","files.binary":"This file has no preview. Download it instead.","files.exists":"A file with this name is already here.","files.failed":"The file request failed.","files.overlap":"This workspace overlaps the runtime directory.","files.uploading":"Uploading…","files.truncated":"Only the first 1 MB is shown.","files.previewMode":"Preview","files.sourceMode":"Source","files.copy":"Copy","files.copied":"Copied","file.error":"This file could not be opened","file.truncated":"Only the first 2000 lines are shown.","turn.rail":"Turns","turn.jump":"Jump to item {index}","basis.plain":"Ordinary session","basis.facts":"{head} · {count} facts","health.up":"Runtime is reachable","health.down":"Runtime is unreachable","health.modelReady":"The model catalog is available. You can send.","health.loading":"Reading the model catalog.","health.noProvider":"No model provider is configured, so execution is off.","health.catalogUnreadable":"The model catalog could not be read.","health.usageReady":"The usage endpoint returned data.","health.usageOff":"Usage is not connected.","health.sameSession":"The official client is at the site root. This page is /dsh-bot/. It is the same session.","health.primaryUnready":"This process has not issued a session cookie yet.","health.primaryDown":"The runtime could not be reached.","health.usageMissing":"The usage plugin is not installed.","health.usageUpstream":"The usage upstream is unavailable.","health.sessionUnreadable":"Could not tell whether the session is still running."},vw={"app.title":"DSH Bot","lang.switch":"English","nav.back":"返回","nav.sessions":"会话","nav.botMessages":"BOT 消息","nav.official":"原生界面","nav.where":"会话位置","nav.mainSession":"主会话","nav.worker":"执行会话","nav.pick":"从左边选一个会话,或新建一个。","nav.empty":"这个会话还没有消息。","load.messages":"正在加载消息…","load.messagesPct":"正在加载消息… {pct}%","load.aria":"正在加载消息","file.close":"关闭","file.loading":"正在读取文件…","files.open":"文件","files.title":"文件","files.workspace":"工作区","files.home":"主目录","files.refresh":"刷新","files.upload":"上传","files.download":"下载","files.pathHint":"复制路径","files.empty":"这个目录是空的。","files.loading":"正在读取这个目录…","files.folder":"文件夹","files.link":"链接","files.file":"文件","files.name":"名称","files.type":"类型","files.size":"大小","files.modified":"修改","files.drop":"松开即可上传到当前目录","files.confirm":"把这个文件上传到当前目录?","files.overwrite":"覆盖已有的同名文件","files.cancel":"取消","files.tooLarge":"超过 50 MB 的文件不会上传。","files.denied":"这个位置不可用。","files.missing":"找不到这个位置。","files.binary":"这个文件不能预览,可以下载。","files.exists":"这里已经有同名文件。","files.failed":"文件请求失败。","files.overlap":"工作区与运行时目录重叠。","files.uploading":"正在上传…","files.truncated":"只显示了前 1 MB。","files.previewMode":"预览","files.sourceMode":"源码","files.copy":"复制","files.copied":"已复制","file.error":"无法打开此文件","file.truncated":"只显示了前 2000 行。","turn.rail":"回合","turn.jump":"跳到第 {index} 处","basis.plain":"普通会话","basis.facts":"{head} · {count} 条事实","health.up":"主运行时可达","health.down":"主运行时不可达","health.modelReady":"模型目录可用,可以发送。","health.loading":"正在读取模型目录。","health.noProvider":"未配置模型提供方,执行已禁用","health.catalogUnreadable":"无法读取模型目录。","health.usageReady":"用量接口已返回数据。","health.usageOff":"用量未接入","health.sameSession":"原生界面在站点根路径,这里是 /dsh-bot/。同一个会话。","health.primaryUnready":"主运行时尚未交出启动令牌","health.primaryDown":"主运行时不可达","health.usageMissing":"用量插件未接入","health.usageUpstream":"用量上游不可用","health.sessionUnreadable":"无法读取会话是否仍在运行"},pb={en:yw,zh:vw},bw={"composer.mention":"Mention a bot","composer.noBot":"No matching bot","composer.interrupt":"Sending interrupts this reply","composer.mentionHint":"Message, or type @ to mention another bot","composer.task":"Message, or describe a task","composer.pick":"Choose a session","composer.add":"Add a file or a command","composer.command":"Insert a command","composer.filesLater":"Attaching files is not available yet.","composer.cancel":"Cancel","composer.send":"Send","composer.notSent":"The task was not sent.","composer.supplyFailed":"Not sent."},xw={"composer.mention":"提及 BOT","composer.noBot":"没有匹配的 BOT","composer.interrupt":"发送会打断这一句","composer.mentionHint":"发消息,输入 @ 提及另一个 BOT","composer.task":"发消息,或描述一个任务","composer.pick":"选择一个会话","composer.add":"添加文件或调用指令","composer.command":"调用指令","composer.filesLater":"附带文件还不可用。","composer.cancel":"取消","composer.send":"发送","composer.notSent":"任务没有发送。","composer.supplyFailed":"没有送出。"},mb={en:bw,zh:xw},Sw={"new.title":"New bot","new.close":"Close","new.lead":"The name shows in the list and is the bot's own name. Style and task become its persona.","new.name":"Bot name","new.style":"Bot style","new.task":"Bot task","new.namePlaceholder":"for example: Guide","new.stylePlaceholder":"for example: brief and direct","new.taskPlaceholder":"for example: turn the user's notes into short sentences","new.cancel":"Cancel","new.create":"Create","new.creating":"Creating","new.nameRequired":"Write this bot's name first.","new.created":'Created "{name}".',"new.createFailed":"Could not create the session.","new.personaFailed":"The session was created, but the persona was not applied.","session.search":"Search sessions","session.searchPlaceholder":"Search sessions","session.none":"No sessions yet.","session.noMatch":"No matching sessions.","session.running":"In progress","session.blank":"Blank","session.archived":"Archived","session.hide":"Hide","session.show":"Show","session.blankCount":"Blank sessions · {count}","session.archiveAll":"Archive all","session.purgeAll":"Delete all","session.archive":"Archive","session.purge":"Delete","session.archiveLabel":"Archive blank session {name}","session.purgeLabel":"Delete blank session {name}","session.archiveConfirm":"Archive {count} blank sessions? Sessions that already have messages stay. You can restore archived sessions from the official client.","session.purgeOneConfirm":'Delete "{name}" permanently? The log is removed from disk and cannot be restored from the archive.',"session.purgeAllConfirm":"Permanently delete {count} blank sessions? Logs are removed from disk and cannot be restored. Sessions that already have messages stay.","session.notBlankArchive":"This session already has content, so it cannot be removed as a blank session.","session.archiveFailed":"Could not remove this blank session.","session.archiveSomeFailed":"Some blank sessions could not be removed.","session.purgeNotBlank":"Only a blank session can be deleted permanently.","session.purgeFailed":"Could not delete this session permanently.","session.purgeSomeFailed":"Some blank sessions could not be deleted permanently.","session.menu":"Session actions","session.delete":"Delete permanently","session.deleteRunning":"This session is still running. Wait until it finishes, then delete it.","session.deleteAttached":"This session is still open in the runtime. Leave it, then delete it.","session.deleteFailed":"Could not delete this session.","session.listUnavailable":"The session list is unavailable.","session.unnamed":"New session","session.blankName":"Blank session","local.mark":"Me","local.here":"This machine","local.down":"Runtime unreachable"},ww={"new.title":"新建 BOT","new.close":"关闭","new.lead":"名字会显示在左侧列表里,也是这个 bot 自己的名字。风格和任务写进它的人格。","new.name":"Bot 名字","new.style":"Bot 风格","new.task":"Bot 任务","new.namePlaceholder":"例如:狗子","new.stylePlaceholder":"例如:幽默风趣","new.taskPlaceholder":"例如:把用户的话写成短句","new.cancel":"取消","new.create":"创建","new.creating":"正在创建","new.nameRequired":"先写上这个 bot 的名字。","new.created":"已创建「{name}」。","new.createFailed":"未能创建会话","new.personaFailed":"会话已创建,人格没有套上。","session.search":"搜索会话","session.searchPlaceholder":"搜索会话","session.none":"还没有会话。","session.noMatch":"没有匹配的会话。","session.running":"进行中","session.blank":"空白","session.archived":"已归档","session.hide":"收起","session.show":"展开","session.blankCount":"空白会话 · {count}","session.archiveAll":"全部归档","session.purgeAll":"全部彻底删除","session.archive":"归档","session.purge":"彻底删除","session.archiveLabel":"归档空白会话 {name}","session.purgeLabel":"彻底删除空白会话 {name}","session.archiveConfirm":"归档 {count} 个空白会话?已经有消息的会话会保留。归档后可以在原生界面的已归档列表里恢复。","session.purgeOneConfirm":"彻底删除「{name}」?日志会从磁盘去掉,不能从已归档列表恢复。","session.purgeAllConfirm":"彻底删除 {count} 个空白会话?日志会从磁盘去掉,不能恢复。已经有消息的会话会保留。","session.notBlankArchive":"这个会话已经有内容,不能当作空白会话删除。","session.archiveFailed":"没能删除这个空白会话。","session.archiveSomeFailed":"有的空白会话没能删除。","session.purgeNotBlank":"只有空白会话可以彻底删除。","session.purgeFailed":"没能彻底删除这个会话。","session.purgeSomeFailed":"有的空白会话没能彻底删除。","session.menu":"会话操作","session.delete":"彻底删除","session.deleteRunning":"这个会话还在进行,等它结束后再删除。","session.deleteAttached":"这个会话还开在运行时里。先离开它,再彻底删除。","session.deleteFailed":"没能彻底删除这个会话。","session.listUnavailable":"会话列表不可用","session.unnamed":"新会话","session.blankName":"空白会话","local.mark":"本","local.here":"本机","local.down":"主运行时不可达"},gb={en:Sw,zh:ww},kw={"question.waiting":"Waiting for your answer","question.aborted":"This question was cancelled before you answered.","question.failed":"This question could not be completed.","question.skipped":"Skipped","question.answered":"Answered","question.multiSelect":"You can choose more than one option.","question.custom":"Other: {text}","question.customLabel":"Other","question.customPlaceholder":"Type a custom answer","question.skip":"Skip","question.submit":"Submit answers","question.submitting":"Submitting…","question.submitFailed":"The answer could not be submitted.","question.incomplete":"Answer or skip each question before submitting.","question.recommended":"Recommended","question.remaining":"{time} remaining","question.waitingNoTimer":"Waiting, no timer","question.takeTime":"Need more time","question.continued":"You can still answer","question.planTitle":"Plan review","question.viewFull":"View full plan","question.hidePlan":"Hide full plan","question.requestChanges":"Request changes","question.approvePlan":"Approve","question.changeComments":"What should change?","question.changePlaceholder":"Describe the changes you want","question.changesNeeded":"Please describe the changes you want.","question.allow":"Allow","question.reject":"Reject","question.alwaysAllow":"Always allow","question.approvalAnswered":"Decision recorded"},Ew={"question.waiting":"等待你的回答","question.aborted":"这个问题在回答前被取消了。","question.failed":"这个问题未能完成。","question.skipped":"已跳过","question.answered":"已回答","question.multiSelect":"可以选择多个选项。","question.custom":"其他:{text}","question.customLabel":"其他","question.customPlaceholder":"输入自定义回答","question.skip":"跳过","question.submit":"提交回答","question.submitting":"正在提交…","question.submitFailed":"回答未能提交。","question.incomplete":"请先回答或跳过每一项再提交。","question.recommended":"推荐","question.remaining":"剩余 {time}","question.waitingNoTimer":"等待中,无计时","question.takeTime":"再等一等","question.continued":"现在仍可以回答","question.planTitle":"计划审阅","question.viewFull":"查看完整计划","question.hidePlan":"收起完整计划","question.requestChanges":"请求修改","question.approvePlan":"批准","question.changeComments":"需要怎样修改?","question.changePlaceholder":"描述你希望改动的地方","question.changesNeeded":"请先描述你希望改动的地方。","question.allow":"允许","question.reject":"拒绝","question.alwaysAllow":"始终允许","question.approvalAnswered":"已记录决定"},yb={en:kw,zh:Ew},Tw={"approval.title":"Tool approval","approval.allowOnce":"Allow once","approval.reject":"Reject","approval.waiting":"Waiting for your answer","approval.allowed":"Allowed once","approval.rejected":"Rejected","approval.cancelled":"This request was cancelled.","approval.failed":"This request could not be completed.","approval.submitFailed":"The decision could not be submitted."},Aw={"approval.title":"工具许可","approval.allowOnce":"允许一次","approval.reject":"拒绝","approval.waiting":"等待你的回答","approval.allowed":"已允许一次","approval.rejected":"已拒绝","approval.cancelled":"这个请求已被取消。","approval.failed":"这个请求未能完成。","approval.submitFailed":"决定未能提交。"},vb={en:Tw,zh:Aw},Cw={"permission.title":"Permissions","permission.open":"Session permissions","permission.current":"Current preset","permission.confirmTitle":"Confirm this permission","permission.confirmFull":"Give this session full access?","permission.confirmAuto":"Turn on Auto for this session?","permission.confirm":"Confirm","permission.cancel":"Cancel","permission.unavailable":"Official permission presets are not available on this host.","permission.failed":"The permission could not be changed.","permission.close":"Close","permission.preset.readOnly":"Read Only","permission.preset.workspaceWrite":"Workspace Write","permission.preset.fullAccess":"Full access","permission.preset.auto":"Auto review"},Nw={"permission.title":"权限","permission.open":"会话权限","permission.current":"当前预设","permission.confirmTitle":"确认此项权限","permission.confirmFull":"为此会话开启完全访问?","permission.confirmAuto":"为此会话开启自动审阅?","permission.confirm":"确认","permission.cancel":"取消","permission.unavailable":"此主机未提供官方权限预设。","permission.failed":"权限未能更改。","permission.close":"关闭","permission.preset.readOnly":"只读","permission.preset.workspaceWrite":"工作区可写","permission.preset.fullAccess":"完全访问","permission.preset.auto":"自动审阅"},bb={en:Cw,zh:Nw},jw={"auth.title":"Authorization","auth.open":"Credentials","auth.empty":"No authorization flows are available.","auth.start":"Start","auth.writeVault":"Write to vault","auth.cancel":"Cancel","auth.secretMask":"••••••••","auth.unavailable":"Official authorization is not available on this host.","auth.failed":"Authorization could not be completed.","auth.close":"Close"},Ow={"auth.title":"授权","auth.open":"凭据","auth.empty":"当前没有可进行的授权流程。","auth.start":"开始","auth.writeVault":"写入保险库","auth.cancel":"取消","auth.secretMask":"••••••••","auth.unavailable":"此主机未提供官方授权。","auth.failed":"授权未能完成。","auth.close":"关闭"},xb={en:jw,zh:Ow},zw={"cua.title":"Computer Use permissions","cua.open":"Computer Use","cua.system":"System permissions","cua.accessibility":"Accessibility","cua.screenRecording":"Screen recording","cua.granted":"Granted","cua.missing":"Not granted","cua.request":"Request","cua.openSettings":"Open system settings","cua.grants":"Always-allow list","cua.blocked":"Refused applications","cua.revoke":"Revoke","cua.askAgain":"Ask again","cua.emptyGrants":"No saved application grants.","cua.emptyBlocked":"No refused applications.","cua.failed":"Computer Use permissions could not be updated.","cua.close":"Close"},_w={"cua.title":"计算机使用权限","cua.open":"计算机使用","cua.system":"系统权限","cua.accessibility":"辅助功能","cua.screenRecording":"屏幕录制","cua.granted":"已授予","cua.missing":"未授予","cua.request":"请求","cua.openSettings":"打开系统设置","cua.grants":"始终允许列表","cua.blocked":"已拒绝的应用","cua.revoke":"撤销","cua.askAgain":"再次询问","cua.emptyGrants":"没有已保存的应用授权。","cua.emptyBlocked":"没有已拒绝的应用。","cua.failed":"计算机使用权限未能更新。","cua.close":"关闭"},Sb={en:zw,zh:_w},qw={"work.status.accepted":"Accepted","work.status.enqueued":"Enqueued","work.status.started":"Started","work.status.waitingBudget":"Waiting for budget","work.fact.waitingBudget":"Worker admission is paused pending a sufficient budget grant. Waiting time does not consume runtime.","work.status.needs_user":"Needs you","work.status.ready":"Candidate","work.status.delivered":"Delivered","work.status.cancelled":"Cancelled","work.status.failed":"Failed","work.ticket":"Ticket","work.preview.startedMany":"Started · {count}","work.placeholder.many":"Background work is running. You can say something else.","work.placeholder.started":"Background work has started. You can say something else.","work.placeholder.needsUser":"This box is still an ordinary message. Answer the ticket on the card above.","work.placeholder.ready":"Send a message. The result becomes delivered only after the assistant writes it into the chat.","work.placeholder.failed":"This ticket has failed. You can say something else.","work.fact.revision":"Generation {revision}","work.fact.accepted":"The ticket is recorded and is not on the execution queue yet.","work.fact.enqueued":"It is on the execution queue. The worker has not seen the task yet.","work.fact.elapsed":"Elapsed {time}","work.fact.wall":"Background limit is 10 minutes.","work.fact.needsUser":"This round has ended.","work.fact.ready":"This is not the reply in the chat yet.","work.fact.delivered":"The text is in the assistant reply.","work.fact.failed":"This ticket has failed.","work.fact.sameWorker":"It is still the same worker session.","work.fact.restart":"It returns to started after the worker sees the task again.","work.budgetFallback":"This one was not accepted. Unfinished tickets already hit the host concurrency limit.","work.openWorker":"Open the worker session","work.questionEmpty":"The worker asked a question.","work.questionStale":"The previous question is void.","work.answerLabel":"Reply to this ticket","work.answerSubmit":"Reply to this ticket","work.cancelTitle":"Cancellation note","work.taskTitle":"Task","work.generation":"Generation {revision}","work.duration":"Duration {value}","work.material":"Material {hash}","work.minutes":"{count} min","work.seconds":"{count} s","work.milliseconds":"{count} ms"},Rw={"work.status.accepted":"已受理","work.status.enqueued":"已派工","work.status.started":"已开始","work.status.waitingBudget":"等待预算","work.fact.waitingBudget":"Worker 已暂停下一步,等待足够的新预算;等待时间不计入运行时长。","work.status.needs_user":"需要用户","work.status.ready":"候选","work.status.delivered":"已交付","work.status.cancelled":"已取消","work.status.failed":"失败","work.ticket":"工单","work.preview.startedMany":"已开始 · {count} 张","work.placeholder.many":"后台都在跑,可以直接说别的","work.placeholder.started":"后台已开始,可以直接说别的","work.placeholder.needsUser":"这里仍是普通消息。回答工单用上面的卡片","work.placeholder.ready":"发消息。结果要由助手写进对话,才会变成已交付","work.placeholder.failed":"这张工单已经失败,可以直接说别的","work.fact.revision":"第 {revision} 代","work.fact.accepted":"工单已记下,还没进入执行队列","work.fact.enqueued":"已进入执行队列,执行会话还没有看到任务","work.fact.elapsed":"已进行 {time}","work.fact.wall":"后台上限 10 分钟","work.fact.needsUser":"这一轮已经结束","work.fact.ready":"这还不是对话里的答复","work.fact.delivered":"正文在对话里的助手回复中","work.fact.failed":"这张工单已经失败","work.fact.sameWorker":"还是原来的执行会话","work.fact.restart":"执行会话再次看到任务后,才会回到已开始","work.budgetFallback":"这张没有接住。未结束工单已经达到宿主并发上限。","work.openWorker":"打开执行会话","work.questionEmpty":"执行会话问了一个问题。","work.questionStale":"上一问已作废","work.answerLabel":"对这张工单的回答","work.answerSubmit":"回复这张工单","work.cancelTitle":"取消说明","work.taskTitle":"执行任务","work.generation":"第 {revision} 代","work.duration":"时长 {value}","work.material":"材料 {hash}","work.minutes":"{count} 分钟","work.seconds":"{count} 秒","work.milliseconds":"{count} 毫秒"},wb={en:qw,zh:Rw},kb={en:{"image.untitled":"Image","image.open":"Preview image: {name}","image.enlarge":"Click to enlarge","image.fit":"Fit to screen","image.original":"Original size","image.close":"Close image preview","image.scroll":"Original image. Scroll to inspect details.","image.openLink":"Open image link","image.unavailable":"Image unavailable; the file may have been removed.","image.retry":"Retry image"},zh:{"image.untitled":"图片","image.open":"预览图片:{name}","image.enlarge":"点击放大","image.fit":"适应屏幕","image.original":"原始大小","image.close":"关闭图片预览","image.scroll":"原始图片,可滚动查看细节。","image.openLink":"打开图片链接","image.unavailable":"图片不可用,文件可能已被清理。","image.retry":"重试图片"}},Mw={...gb.en,...pb.en,...mb.en,...hb.en,...wb.en,...db.en,...yb.en,...vb.en,...bb.en,...xb.en,...Sb.en,...kb.en},Dw={...gb.zh,...pb.zh,...mb.zh,...hb.zh,...wb.zh,...db.zh,...yb.zh,...vb.zh,...bb.zh,...xb.zh,...Sb.zh,...kb.zh},Qy={en:Mw,zh:Dw},Eb="dsh-bot.locale";function Lw(){try{const n=localStorage.getItem(Eb);if(n==="en"||n==="zh")return n}catch{}return"en"}function Bw(n){try{localStorage.setItem(Eb,n)}catch{}typeof document<"u"&&(document.documentElement.lang=n==="zh"?"zh-CN":"en")}function Tb(n,l,r){const a=Qy[n][l]??Qy.en[l];return r?a.replace(/\{(\w+)\}/g,(u,o)=>r[o]??""):a}function Oi(n,l){return Tb("en",n,l)}const Uw={loading:"health.loading",no_provider:"health.noProvider",catalog_unreadable:"health.catalogUnreadable",primary_unready:"health.primaryUnready",primary_down:"health.primaryDown",usage_not_installed:"health.usageMissing",usage_unconfigured:"health.usageUpstream",session_unreadable:"health.sessionUnreadable"};function Hw(n,l,r=Oi){const a=Uw[n];return a?r(a):l}const Ab=z.createContext({locale:"en",setLocale:()=>{},t:Oi});function Iw({children:n}){const[l,r]=z.useState(()=>Lw()),a=z.useCallback(f=>{Bw(f),r(f)},[]),u=z.useCallback((f,h)=>Tb(l,f,h),[l]),o=z.useMemo(()=>({locale:l,setLocale:a,t:u}),[l,a,u]);return v.jsx(Ab.Provider,{value:o,children:n})}function Je(){return z.useContext(Ab)}const Vw={accepted:"work.status.accepted",enqueued:"work.status.enqueued",started:"work.status.started",waiting_budget:"work.status.waitingBudget",needs_user:"work.status.needs_user",ready:"work.status.ready",delivered:"work.status.delivered",cancelled:"work.status.cancelled",failed:"work.status.failed"},Yw=new Set(["delivered","cancelled"]),Gw=new Set(["accepted","enqueued","started","needs_user","waiting_budget"]);function Cb(n,l=Oi){const r=Vw[n];return r?l(r):n}function Nb(n){return n.replace(/^\uFEFF/,"").trimStart().startsWith("[foundations:ticket]")}function dh(n){const l=n.replace(/^\uFEFF/,"").replace(/\r\n/g,`
14
+ `).trimStart();if(!l.startsWith("[foundations:briefing]"))return null;const r=l.slice(22).replace(/^\n/,""),a=r.indexOf(`
15
+ ---
16
+ `);if(a<0)return null;const u=[],o={};for(const p of r.slice(0,a).split(`
17
+ `)){const y=/^(briefing_revision|budget_wall_ms|budget_max_tokens|material_sha256):\s*(.*)$/.exec(p);y?.[1]?o[y[1]]=(y[2]??"").trim():p.trim()!==""&&u.push(p.trim())}const f=Number(o.briefing_revision),h=Number(o.budget_wall_ms),m=Number(o.budget_max_tokens);return{revision:Number.isFinite(f)&&f>0?f:1,wallMs:Number.isFinite(h)&&h>0?h:null,maxTokens:Number.isFinite(m)&&m>0?m:null,material:o.material_sha256??"",notes:u,body:r.slice(a+5).trim(),cancel:u.some(p=>p.startsWith("This is a cancellation note")||p.startsWith("这是取消说明"))}}function ar(n){return n.startsWith("worker-")&&n.length>7}function Fw(n){return ar(n)?n.slice(7):""}function Qw(n){const l=n.signals;if(!l||typeof l!="object"||Array.isArray(l))return{};const r={};for(const[a,u]of Object.entries(l))r[a]=Array.isArray(u)?u.filter(o=>typeof o=="string"):[];return r}function Xw(n){const l=n.cards;if(!l||typeof l!="object"||Array.isArray(l))return{};const r={};for(const[a,u]of Object.entries(l))r[a]=Kw({cards:u});return r}function Zw(n){const l=n.work&&typeof n.work=="object"&&!Array.isArray(n.work)?n.work:n;return!("signals"in l)&&!("cards"in l)?null:{signals:Qw(l),cards:Xw(l)}}function Kw(n){return Array.isArray(n.cards)?n.cards.flatMap(l=>{if(!l||typeof l!="object")return[];const r=l,a=typeof r.summary=="string"?r.summary:"",u=Jw(r,a);return u?[u]:[]}):[]}function Jw(n,l="",r=Oi){const a=n.ticket;if(!a||typeof a!="object")return null;const u=a;if(typeof u.id!="string"||typeof u.status!="string")return null;const o=Array.isArray(n.attempts)?n.attempts:[],f=typeof u.active_attempt_id=="string"?u.active_attempt_id:"",h=o.find(S=>S&&typeof S=="object"&&S.id===f),m=Array.isArray(n.events)?n.events.flatMap(rk):[],p=typeof u.child_session_id=="string"?u.child_session_id:"";let y=u.waiting_budget===!0;if(typeof u.budget_json=="string")try{y||=JSON.parse(u.budget_json).quota?.waiting===!0}catch{}const g=l.trim()||r("work.ticket");return{id:u.id,status:y&&["started","enqueued"].includes(u.status)?"waiting_budget":u.status,revision:typeof u.briefing_revision=="number"?u.briefing_revision:1,summary:g,childSessionId:p.startsWith("worker-")?p:null,startedAt:typeof h?.started_at=="string"?h.started_at:null,events:m}}function jb(n){const l=n.filter(a=>!Yw.has(a.status)),r=n.find(a=>a.status==="delivered");return r?[...l,r]:l}function Ob(n){return n.some(l=>Gw.has(l.status))}function Xy(n,l,r=!1){return r?!1:n&&!Ob(l)}const $w=new Set(["accepted","enqueued","started"]);function Pw(n,l=!1){if(l)return"run";let r=!1,a=!1;for(const u of n)u.status==="delivered"||u.status==="cancelled"||(u.status==="needs_user"||u.status==="waiting_budget"?r=!0:$w.has(u.status)&&(a=!0));return r?"wait":a?"run":null}function gd(n,l=Date.now(),r=Oi){const a=n.filter(f=>f.status==="started");if(a.length>1)return r("work.preview.startedMany",{count:String(a.length)});const u=qb(n);if(!u||u.status==="ready")return"";const o=Cb(u.status,r);if(u.status==="started"){const f=_b(u.startedAt,l);return f?`${o} · ${f}`:o}return o}function Ww(n,l=Oi){if(n.filter(u=>u.status==="started").length>1)return l("work.placeholder.many");const a=qb(n);return a?a.status==="started"?l("work.placeholder.started"):a.status==="waiting_budget"?l("work.fact.waitingBudget"):a.status==="needs_user"?l("work.placeholder.needsUser"):a.status==="ready"?l("work.placeholder.ready"):a.status==="failed"?l("work.placeholder.failed"):null:null}function ek(n,l,r=Oi){const a=[r("work.fact.revision",{revision:String(n.revision)})];if(n.status==="accepted"&&a.push(r("work.fact.accepted")),n.status==="enqueued"&&a.push(r("work.fact.enqueued")),n.status==="started"){const o=_b(n.startedAt,l);o&&a.push(r("work.fact.elapsed",{time:o})),a.push(r("work.fact.wall"))}n.status==="waiting_budget"&&a.push(r("work.fact.waitingBudget")),n.status==="needs_user"&&a.push(r("work.fact.needsUser")),n.status==="ready"&&a.push(r("work.fact.ready")),n.status==="delivered"&&a.push(r("work.fact.delivered")),n.status==="failed"&&a.push(r("work.fact.failed")),n.revision>1&&(n.status==="enqueued"||n.status==="accepted")&&(a.push(r("work.fact.sameWorker")),a.push(r("work.fact.restart")));const u=lk(n);return u&&a.push(u),a}function tk(n){const l=n.events.filter(r=>r.kind==="question"&&r.text.trim()!=="");if(n.status==="needs_user")return{text:l.filter(a=>a.revision===n.revision&&a.applyStatus!=="stale").at(-1)?.text??"",stale:!1};if(n.revision>1&&(n.status==="enqueued"||n.status==="accepted"||n.status==="started")){const r=[...l].reverse().find(a=>a.applyStatus==="stale");if(r)return{text:r.text,stale:!0}}return null}function zb(n){if(n.name!=="foundations_dispatch"||n.result.trim()==="")return null;const l=hh(n.result);return l?l.ok===!1?null:typeof l.ticketId=="string"&&l.ticketId!==""?l.ticketId:null:/"ticketId"\s*:\s*"([^"]+)"/.exec(n.result)?.[1]??null}function nk(n){if(n.name!=="foundations_dispatch"||n.result.trim()==="")return!1;const l=hh(n.result);return l?l.ok===!1&&l.code==="BUDGET":n.result.includes('"BUDGET"')||/concurrency limit/i.test(n.result)}function ik(n,l=Oi){const r=hh(n);return r&&typeof r.message=="string"&&r.message!==""?r.message:l("work.budgetFallback")}function _b(n,l){if(!n)return"";const r=Date.parse(n);if(!Number.isFinite(r))return"";const a=Math.max(0,Math.floor((l-r)/1e3)),u=Math.floor(a/60),o=a%60;return`${u}:${String(o).padStart(2,"0")}`}function qb(n){const l=jb(n),r=["waiting_budget","needs_user","started","enqueued","accepted","ready","failed"];for(const a of r){const u=l.find(o=>o.status===a);if(u)return u}return l[0]??null}function lk(n){return n.events.filter(r=>r.kind==="progress"&&r.applyStatus==="applied"&&r.revision===n.revision&&r.text.trim()!=="").at(-1)?.text??""}function rk(n){if(!n||typeof n!="object")return[];const l=n;return typeof l.event_id!="string"||typeof l.kind!="string"?[]:[{eventId:l.event_id,kind:l.kind,applyStatus:typeof l.apply_status=="string"?l.apply_status:"",revision:typeof l.briefing_revision=="number"?l.briefing_revision:0,text:typeof l.text=="string"?l.text:""}]}function hh(n){try{const l=JSON.parse(n);return!l||typeof l!="object"||Array.isArray(l)?null:l}catch{return null}}const ak="modulepreload",sk=function(n){return"/dsh-bot/"+n},Zy={},uk=function(l,r,a){let u=Promise.resolve();if(r&&r.length>0){let m=function(p){return Promise.all(p.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=f?.nonce||f?.getAttribute("nonce");u=m(r.map(p=>{if(p=sk(p),p in Zy)return;Zy[p]=!0;const y=p.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const S=document.createElement("link");if(S.rel=y?"stylesheet":ak,y||(S.as="script"),S.crossOrigin="",S.href=p,h&&S.setAttribute("nonce",h),document.head.appendChild(S),y)return new Promise((x,k)=>{S.addEventListener("load",x),S.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${p}`)))})}))}function o(f){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=f,window.dispatchEvent(h),!h.defaultPrevented)throw f}return u.then(f=>{for(const h of f||[])h.status==="rejected"&&o(h.reason);return l().catch(o)})};var ph=cb();const Rb=1120,fs=268,yd=220,Ky=400,Mb=320,Db=960,Id=640;function Vd(n){return Number.isFinite(n)?Math.min(Db,Math.max(Mb,Math.round(n))):Id}function Lb(n){return Math.max(0,(n-Math.min(Rb,n))/2)}function no(n){const l=Lb(n);return{drawer:0,reserve:0,sidebar:fs,inset:l,insetRight:l,overlap:!1}}function Jy(n,l){const r=Math.min(Db,Math.max(Mb,l)),a=Math.min(Rb,n),u=Lb(n),o=yd+Ky;if(r<=u)return{drawer:r,reserve:0,sidebar:fs,inset:u,insetRight:u,overlap:!1};const f=Math.max(0,u-(r-u)),h=n-f-r;if(h<o)return{drawer:r,reserve:Math.max(0,n-o),sidebar:yd,inset:0,insetRight:0,overlap:!0};const m=Math.max(0,a-h),p=Math.max(0,a-fs-Ky),y=Math.max(0,fs-yd),g=p+y,S=g===0?0:Math.min(p,m*p/g),x=Math.min(y,Math.max(0,m-S));return{drawer:r,reserve:r,sidebar:fs-x,inset:f,insetRight:0,overlap:!1}}function cz(n){const l=n.split(".").pop()?.toLowerCase()??"";return{js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"html",htm:"html",css:"css",scss:"scss",md:"markdown",markdown:"markdown",py:"python",rs:"rust",go:"go",sh:"shell",bash:"shell",zsh:"shell",yaml:"yaml",yml:"yaml",toml:"toml",xml:"xml",svg:"xml",sql:"sql",java:"java",c:"c",h:"c",cc:"cpp",cpp:"cpp",rb:"ruby",ini:"ini",env:"ini",gitignore:"ini",lock:"ini"}[l]??"plaintext"}function ok(n){const l=n.split(".").pop()?.toLowerCase()??"";return l==="md"||l==="markdown"}function ck(n,l){const r={};return(n[n.length-1]===""?[...n,""]:n).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const fk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hk={};function $y(n,l){return(hk.jsx?dk:fk).test(n)}const pk=/[ \t\n\f\r]/g;function mk(n){return typeof n=="object"?n.type==="text"?Py(n.value):!1:Py(n)}function Py(n){return n.replace(pk,"")===""}class Ts{constructor(l,r,a){this.normal=r,this.property=l,a&&(this.space=a)}}Ts.prototype.normal={};Ts.prototype.property={};Ts.prototype.space=void 0;function Bb(n,l){const r={},a={};for(const u of n)Object.assign(r,u.property),Object.assign(a,u.normal);return new Ts(r,a,l)}function Yd(n){return n.toLowerCase()}class Mn{constructor(l,r){this.attribute=r,this.property=l}}Mn.prototype.attribute="";Mn.prototype.booleanish=!1;Mn.prototype.boolean=!1;Mn.prototype.commaOrSpaceSeparated=!1;Mn.prototype.commaSeparated=!1;Mn.prototype.defined=!1;Mn.prototype.mustUseProperty=!1;Mn.prototype.number=!1;Mn.prototype.overloadedBoolean=!1;Mn.prototype.property="";Mn.prototype.spaceSeparated=!1;Mn.prototype.space=void 0;let gk=0;const Le=fr(),$t=fr(),Gd=fr(),oe=fr(),Ct=fr(),or=fr(),Qn=fr();function fr(){return 2**++gk}const Fd=Object.freeze(Object.defineProperty({__proto__:null,boolean:Le,booleanish:$t,commaOrSpaceSeparated:Qn,commaSeparated:or,number:oe,overloadedBoolean:Gd,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),vd=Object.keys(Fd);class mh extends Mn{constructor(l,r,a,u){let o=-1;if(super(l,r),Wy(this,"space",u),typeof a=="number")for(;++o<vd.length;){const f=vd[o];Wy(this,vd[o],(a&Fd[f])===Fd[f])}}}mh.prototype.defined=!0;function Wy(n,l,r){r&&(n[l]=r)}function ra(n){const l={},r={};for(const[a,u]of Object.entries(n.properties)){const o=new mh(a,n.transform(n.attributes||{},a),u,n.space);n.mustUseProperty&&n.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),l[a]=o,r[Yd(a)]=a,r[Yd(o.attribute)]=a}return new Ts(l,r,n.space)}const Ub=ra({properties:{ariaActiveDescendant:null,ariaAtomic:$t,ariaAutoComplete:null,ariaBusy:$t,ariaChecked:$t,ariaColCount:oe,ariaColIndex:oe,ariaColSpan:oe,ariaControls:Ct,ariaCurrent:null,ariaDescribedBy:Ct,ariaDetails:null,ariaDisabled:$t,ariaDropEffect:Ct,ariaErrorMessage:null,ariaExpanded:$t,ariaFlowTo:Ct,ariaGrabbed:$t,ariaHasPopup:null,ariaHidden:$t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ct,ariaLevel:oe,ariaLive:null,ariaModal:$t,ariaMultiLine:$t,ariaMultiSelectable:$t,ariaOrientation:null,ariaOwns:Ct,ariaPlaceholder:null,ariaPosInSet:oe,ariaPressed:$t,ariaReadOnly:$t,ariaRelevant:null,ariaRequired:$t,ariaRoleDescription:Ct,ariaRowCount:oe,ariaRowIndex:oe,ariaRowSpan:oe,ariaSelected:$t,ariaSetSize:oe,ariaSort:null,ariaValueMax:oe,ariaValueMin:oe,ariaValueNow:oe,ariaValueText:null,role:null},transform(n,l){return l==="role"?l:"aria-"+l.slice(4).toLowerCase()}});function Hb(n,l){return l in n?n[l]:l}function Ib(n,l){return Hb(n,l.toLowerCase())}const yk=ra({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:or,acceptCharset:Ct,accessKey:Ct,action:null,allow:null,allowFullScreen:Le,allowPaymentRequest:Le,allowUserMedia:Le,alpha:Le,alt:null,as:null,async:Le,autoCapitalize:null,autoComplete:Ct,autoFocus:Le,autoPlay:Le,blocking:Ct,capture:null,charSet:null,checked:Le,cite:null,className:Ct,closedBy:null,colorSpace:null,cols:oe,colSpan:oe,command:null,commandFor:null,content:null,contentEditable:$t,controls:Le,controlsList:Ct,coords:oe|or,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Le,defer:Le,dir:null,dirName:null,disabled:Le,download:Gd,draggable:$t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Le,formTarget:null,headers:Ct,height:oe,hidden:Gd,high:oe,href:null,hrefLang:null,htmlFor:Ct,httpEquiv:Ct,id:null,imageSizes:null,imageSrcSet:null,inert:Le,inputMode:null,integrity:null,is:null,isMap:Le,itemId:null,itemProp:Ct,itemRef:Ct,itemScope:Le,itemType:Ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Le,low:oe,manifest:null,max:null,maxLength:oe,media:null,method:null,min:null,minLength:oe,multiple:Le,muted:Le,name:null,nonce:null,noModule:Le,noValidate:Le,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Le,optimum:oe,pattern:null,ping:Ct,placeholder:null,playsInline:Le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Le,referrerPolicy:null,rel:Ct,required:Le,reversed:Le,rows:oe,rowSpan:oe,sandbox:Ct,scope:null,scoped:Le,seamless:Le,selected:Le,shadowRootClonable:Le,shadowRootCustomElementRegistry:Le,shadowRootDelegatesFocus:Le,shadowRootMode:null,shadowRootSerializable:Le,shape:null,size:oe,sizes:null,slot:null,span:oe,spellCheck:$t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:oe,step:null,style:null,tabIndex:oe,target:null,title:null,translate:null,type:null,typeMustMatch:Le,useMap:null,value:$t,width:oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ct,axis:null,background:null,bgColor:null,border:oe,borderColor:null,bottomMargin:oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Le,declare:Le,event:null,face:null,frame:null,frameBorder:null,hSpace:oe,leftMargin:oe,link:null,longDesc:null,lowSrc:null,marginHeight:oe,marginWidth:oe,noResize:Le,noHref:Le,noShade:Le,noWrap:Le,object:null,profile:null,prompt:null,rev:null,rightMargin:oe,rules:null,scheme:null,scrolling:$t,standby:null,summary:null,text:null,topMargin:oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:oe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Le,disablePictureInPicture:Le,disableRemotePlayback:Le,exportParts:or,part:Ct,prefix:null,property:null,results:oe,security:null,unselectable:null},space:"html",transform:Ib}),vk=ra({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:oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:oe,amplitude:oe,arabicForm:null,ascent:oe,attributeName:null,attributeType:null,azimuth:oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:oe,by:null,calcMode:null,capHeight:oe,className:Ct,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:oe,diffuseConstant:oe,direction:null,display:null,dur:null,divisor:oe,dominantBaseline:null,download:Le,dx:null,dy:null,edgeMode:null,editable:null,elevation:oe,enableBackground:null,end:null,event:null,exponent:oe,externalResourcesRequired:null,fill:null,fillOpacity:oe,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:or,g2:or,glyphName:or,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:oe,horizOriginX:oe,horizOriginY:oe,id:null,ideographic:oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:oe,k:oe,k1:oe,k2:oe,k3:oe,k4:oe,kernelMatrix:Qn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:oe,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:oe,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:oe,overlineThickness:oe,paintOrder:null,panose1:null,path:null,pathLength:oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:oe,pointsAtY:oe,pointsAtZ:oe,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:oe,specularExponent:oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:oe,strikethroughThickness:oe,string:null,stroke:null,strokeDashArray:Qn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:oe,strokeOpacity:oe,strokeWidth:null,style:null,surfaceScale:oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qn,tabIndex:oe,tableValues:null,target:null,targetX:oe,targetY:oe,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:oe,underlineThickness:oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:oe,values:null,vAlphabetic:oe,vMathematical:oe,vectorEffect:null,vHanging:oe,vIdeographic:oe,version:null,vertAdvY:oe,vertOriginX:oe,vertOriginY:oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Hb}),Vb=ra({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,l){return"xlink:"+l.slice(5).toLowerCase()}}),Yb=ra({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ib}),Gb=ra({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,l){return"xml:"+l.slice(3).toLowerCase()}}),bk={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"},xk=/[A-Z]/g,ev=/-[a-z]/g,Sk=/^data[-\w.:]+$/i;function wk(n,l){const r=Yd(l);let a=l,u=Mn;if(r in n.normal)return n.property[n.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&Sk.test(l)){if(l.charAt(4)==="-"){const o=l.slice(5).replace(ev,Ek);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=l.slice(4);if(!ev.test(o)){let f=o.replace(xk,kk);f.charAt(0)!=="-"&&(f="-"+f),l="data"+f}}u=mh}return new u(a,l)}function kk(n){return"-"+n.toLowerCase()}function Ek(n){return n.charAt(1).toUpperCase()}const Tk=Bb([Ub,yk,Vb,Yb,Gb],"html"),gh=Bb([Ub,vk,Vb,Yb,Gb],"svg");function Ak(n){return n.join(" ").trim()}var tv=/\/\*(?:[^*]|\*(?!\/))*\*\//g,Ck=/\n/g,Nk=/^\s*/,jk=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ok=/^:\s*/,zk=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,_k=/^[;\s]*/,qk=`
18
+ `,nv="/",iv="*",ss="",Rk="comment",Mk="declaration";function Dk(n,l){if(typeof n!="string")throw new TypeError("First argument must be a string");if(!n)return[];l=l||{};var r=1,a=1;function u(k){var T=k.match(Ck);T&&(r+=T.length);var C=k.lastIndexOf(qk);a=~C?k.length-C:a+k.length}function o(){var k={line:r,column:a};return function(T){return T.position=new f(k),p(),T}}function f(k){this.start=k,this.end={line:r,column:a},this.source=l.source}f.prototype.content=n;function h(k){var T=new Error(l.source+":"+r+":"+a+": "+k);if(T.reason=k,T.filename=l.source,T.line=r,T.column=a,T.source=n,!l.silent)throw T}function m(k){var T=k.exec(n);if(T){var C=T[0];return u(C),n=n.slice(C.length),T}}function p(){m(Nk)}function y(k){for(var T;T=g();)k.push(T);return k}function g(){var k=o();if(!(nv!=n.charAt(0)||iv!=n.charAt(1))){for(var T=2;ss!=n.charAt(T)&&(iv!=n.charAt(T)||nv!=n.charAt(T+1));)++T;if(T+=2,ss===n.charAt(T-1))return h("End of comment missing");var C=n.slice(2,T-2);return a+=2,u(C),n=n.slice(T),a+=2,k({type:Rk,comment:C})}}function S(){var k=o(),T=m(jk);if(T){if(g(),!m(Ok))return h("property missing ':'");var C=m(zk),E=k({type:Mk,property:T[0].replace(tv,ss).trim(),value:C?C[0].replace(tv,ss).trim():ss});return m(_k),E}}function x(){var k=[];y(k);for(var T;T=S();)k.push(T),y(k);return k}return p(),x()}function Lk(n,l){let r=null;if(!n||typeof n!="string")return r;const a=Dk(n),u=typeof l=="function";return a.forEach(o=>{if(o.type!=="declaration")return;const{property:f,value:h}=o;u?l(f,h,o):h&&(r=r??{},r[f]=h)}),r}const Fb=Qb("end"),yh=Qb("start");function Qb(n){return l;function l(r){const a=r&&r.position&&r.position[n]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function Bk(n){const l=yh(n),r=Fb(n);if(l&&r)return{start:l,end:r}}function hs(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?lv(n.position):"start"in n||"end"in n?lv(n):"line"in n||"column"in n?Qd(n):""}function Qd(n){return rv(n&&n.line)+":"+rv(n&&n.column)}function lv(n){return Qd(n&&n.start)+"-"+Qd(n&&n.end)}function rv(n){return n&&typeof n=="number"?n:1}class No extends Error{constructor(l,r,a){super(),typeof r=="string"&&(a=r,r=void 0);let u="",o={},f=!1;if(r&&("line"in r&&"column"in r?o={place:r}:"start"in r&&"end"in r?o={place:r}:"type"in r?o={ancestors:[r],place:r.position}:o={...r}),typeof l=="string"?u=l:!o.cause&&l&&(f=!0,u=l.message,o.cause=l),!o.ruleId&&!o.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?o.ruleId=a:(o.source=a.slice(0,m),o.ruleId=a.slice(m+1))}if(!o.place&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const h=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=h?h.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=h?h.line:void 0,this.name=hs(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=f&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Object.defineProperties(No.prototype,{file:{configurable:!0,enumerable:!0,value:"",writable:!0},name:{configurable:!0,enumerable:!0,value:"",writable:!0},reason:{configurable:!0,enumerable:!0,value:"",writable:!0},message:{configurable:!0,enumerable:!0,value:"",writable:!0},stack:{configurable:!0,enumerable:!0,value:"",writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});const vh={}.hasOwnProperty,Uk=new Map,Hk=/[A-Z]/g,Ik=/-([a-z])/g,Vk=new Set(["table","tbody","thead","tfoot","tr"]),Yk=new Set(["td","th"]),Xb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Gk(n,l){if(!l||l.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=l.filePath||void 0;let a;if(l.development){if(typeof l.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=Pk(r,l.jsxDEV)}else{if(typeof l.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof l.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=$k(r,l.jsx,l.jsxs)}const u={Fragment:l.Fragment,ancestors:[],components:l.components||{},create:a,elementAttributeNameCase:l.elementAttributeNameCase||"react",evaluater:l.createEvaluater?l.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:l.ignoreInvalidStyle||!1,passKeys:l.passKeys!==!1,passNode:l.passNode||!1,schema:l.space==="svg"?gh:Tk,stylePropertyNameCase:l.stylePropertyNameCase||"dom",tableCellAlignToStyle:l.tableCellAlignToStyle!==!1},o=Zb(u,n,void 0);return o&&typeof o!="string"?o:u.create(n,u.Fragment,{children:o||void 0},void 0)}function Zb(n,l,r){if(l.type==="element")return Fk(n,l,r);if(l.type==="mdxFlowExpression"||l.type==="mdxTextExpression")return Qk(n,l);if(l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement")return Zk(n,l,r);if(l.type==="mdxjsEsm")return Xk(n,l);if(l.type==="root")return Kk(n,l,r);if(l.type==="text")return Jk(n,l)}function Fk(n,l,r){const a=n.schema;let u=a;l.tagName.toLowerCase()==="svg"&&a.space==="html"&&(u=gh,n.schema=u),n.ancestors.push(l);const o=Jb(n,l.tagName,!1),f=Wk(n,l);let h=xh(n,l);return Vk.has(l.tagName)&&(h=h.filter(function(m){return typeof m=="string"?!mk(m):!0})),Kb(n,f,o,l),bh(f,h),n.ancestors.pop(),n.schema=a,n.create(l,o,f,r)}function Qk(n,l){if(l.data&&l.data.estree&&n.evaluater){const a=l.data.estree.body[0];return a.type,n.evaluater.evaluateExpression(a.expression)}xs(n,l.position)}function Xk(n,l){if(l.data&&l.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(l.data.estree);xs(n,l.position)}function Zk(n,l,r){const a=n.schema;let u=a;l.name==="svg"&&a.space==="html"&&(u=gh,n.schema=u),n.ancestors.push(l);const o=l.name===null?n.Fragment:Jb(n,l.name,!0),f=eE(n,l),h=xh(n,l);return Kb(n,f,o,l),bh(f,h),n.ancestors.pop(),n.schema=a,n.create(l,o,f,r)}function Kk(n,l,r){const a={};return bh(a,xh(n,l)),n.create(l,n.Fragment,a,r)}function Jk(n,l){return l.value}function Kb(n,l,r,a){typeof r!="string"&&r!==n.Fragment&&n.passNode&&(l.node=a)}function bh(n,l){if(l.length>0){const r=l.length>1?l:l[0];r&&(n.children=r)}}function $k(n,l,r){return a;function a(u,o,f,h){const p=Array.isArray(f.children)?r:l;return h?p(o,f,h):p(o,f)}}function Pk(n,l){return r;function r(a,u,o,f){const h=Array.isArray(o.children),m=yh(a);return l(u,o,f,h,{columnNumber:m?m.column-1:void 0,fileName:n,lineNumber:m?m.line:void 0},void 0)}}function Wk(n,l){const r={};let a,u;for(u in l.properties)if(u!=="children"&&vh.call(l.properties,u)){const o=tE(n,u,l.properties[u]);if(o){const[f,h]=o;n.tableCellAlignToStyle&&f==="align"&&typeof h=="string"&&Yk.has(l.tagName)?a=h:r[f]=h}}if(a){const o=r.style||(r.style={});o[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return r}function eE(n,l){const r={};for(const a of l.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&n.evaluater){const o=a.data.estree.body[0];o.type;const f=o.expression;f.type;const h=f.properties[0];h.type,Object.assign(r,n.evaluater.evaluateExpression(h.argument))}else xs(n,l.position);else{const{name:u}=a;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&n.evaluater){const h=a.value.data.estree.body[0];h.type,o=n.evaluater.evaluateExpression(h.expression)}else xs(n,l.position);else o=a.value===null?!0:a.value;r[u]=o}return r}function xh(n,l){const r=[];let a=-1;const u=n.passKeys?new Map:Uk;for(;++a<l.children.length;){const o=l.children[a];let f;if(n.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const p=u.get(m)||0;f=m+"-"+p,u.set(m,p+1)}}const h=Zb(n,o,f);h!==void 0&&r.push(h)}return r}function tE(n,l,r){if(r==null||typeof r=="number"&&Number.isNaN(r))return;const a=wk(n.schema,l);return Array.isArray(r)&&(r=a.commaSeparated?ck(r):Ak(r)),a.property==="style"?["style",typeof r=="object"?n.stylePropertyNameCase==="dom"?r:iE(r):nE(n,String(r))]:[n.elementAttributeNameCase==="react"&&a.space?bk[a.property]||a.property:a.attribute,r]}function nE(n,l){const r={};try{Lk(l,function(a,u){if(a&&u){let o=a;o.slice(0,2)!=="--"&&(o=o.toLowerCase(),n.stylePropertyNameCase==="dom"&&(o.slice(0,4)==="-ms-"&&(o=o.slice(1)),o=o.replace(Ik,aE))),r[o]=u}})}catch(a){if(n.ignoreInvalidStyle)return{};const u=a,o=new No("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:u,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=n.filePath||void 0,o.url=Xb+"#cannot-parse-style-attribute",o}return r}function Jb(n,l,r){let a;if(!r)a={type:"Literal",value:l};else if(l.includes(".")){const u=l.split(".");let o=-1,f;for(;++o<u.length;){const h=$y(u[o])?{type:"Identifier",name:u[o]}:{type:"Literal",value:u[o]};f=f?{type:"MemberExpression",object:f,property:h,computed:!!(o&&h.type==="Literal"),optional:!1}:h}a=f}else a=$y(l)&&!/^[a-z]/.test(l)?{type:"Identifier",name:l}:{type:"Literal",value:l};if(a.type==="Literal"){const u=a.value;return vh.call(n.components,u)?n.components[u]:u}if(n.evaluater)return n.evaluater.evaluateExpression(a);xs(n)}function xs(n,l){const r=new No("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:l,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=n.filePath||void 0,r.url=Xb+"#cannot-handle-mdx-estrees-without-createevaluater",r}function iE(n){const l={};let r;for(r in n)vh.call(n,r)&&(l[lE(r)]=n[r]);return l}function lE(n){if(n.slice(0,2)==="--")return n;let l=n.replace(Hk,rE);return l.slice(0,3)==="ms-"&&(l="-"+l),l}function rE(n){return"-"+n.toLowerCase()}function aE(n,l){return l.toUpperCase()}const bd={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"]},sE={};function jo(n,l){const r=sE,a=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,u=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return $b(n,a,u)}function $b(n,l,r){if(uE(n)){if("value"in n)return n.type==="html"&&!r?"":n.value;if(l&&"alt"in n&&n.alt)return n.alt;if("children"in n)return av(n.children,l,r)}return Array.isArray(n)?av(n,l,r):""}function av(n,l,r){const a=[];let u=-1;for(;++u<n.length;)a[u]=$b(n[u],l,r);return a.join("")}function uE(n){return!!(n&&typeof n=="object")}const sv=document.createElement("i");function Sh(n){const l="&"+n+";";sv.innerHTML=l;const r=sv.textContent;return r.charCodeAt(r.length-1)===59&&n!=="semi"||r===l?!1:r}function di(n,l,r,a){const u=n.length;let o=0,f;if(l<0?l=-l>u?0:u+l:l=l>u?u:l,r=r>0?r:0,a.length<1e4)f=Array.from(a),f.unshift(l,r),n.splice(...f);else for(r&&n.splice(l,r);o<a.length;)f=a.slice(o,o+1e4),f.unshift(l,0),n.splice(...f),o+=1e4,l+=1e4}function ti(n,l){return n.length>0?(di(n,n.length,0,l),n):l}const uv={}.hasOwnProperty;function Pb(n){const l={};let r=-1;for(;++r<n.length;)oE(l,n[r]);return l}function oE(n,l){let r;for(r in l){const u=(uv.call(n,r)?n[r]:void 0)||(n[r]={}),o=l[r];let f;if(o)for(f in o){uv.call(u,f)||(u[f]=[]);const h=o[f];cE(u[f],Array.isArray(h)?h:h?[h]:[])}}}function cE(n,l){let r=-1;const a=[];for(;++r<l.length;)(l[r].add==="after"?n:a).push(l[r]);di(n,0,0,a)}function Wb(n,l){const r=Number.parseInt(n,l);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function hi(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pn=Ol(/[A-Za-z]/),mn=Ol(/[\dA-Za-z]/),fE=Ol(/[#-'*+\--9=?A-Z^-~]/);function mo(n){return n!==null&&(n<32||n===127)}const Xd=Ol(/\d/),dE=Ol(/[\dA-Fa-f]/),e0=Ol(/[!-/:-@[-`{-~]/);function ze(n){return n!==null&&n<-2}function Nt(n){return n!==null&&(n<0||n===32)}function Ge(n){return n===-2||n===-1||n===32}const As=Ol(new RegExp("\\p{P}|\\p{S}","u")),cr=Ol(/\s/);function Ol(n){return l;function l(r){return r!==null&&r>-1&&n.test(String.fromCharCode(r))}}function aa(n){const l=[];let r=-1,a=0,u=0;for(;++r<n.length;){const o=n.charCodeAt(r);let f="";if(o===37&&mn(n.charCodeAt(r+1))&&mn(n.charCodeAt(r+2)))u=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(f=String.fromCharCode(o));else if(o>55295&&o<57344){const h=n.charCodeAt(r+1);o<56320&&h>56319&&h<57344?(f=String.fromCharCode(o,h),u=1):f="�"}else f=String.fromCharCode(o);f&&(l.push(n.slice(a,r),encodeURIComponent(f)),a=r+u+1,f=""),u&&(r+=u,u=0)}return l.join("")+n.slice(a)}function ct(n,l,r,a){const u=a?a-1:1/0;let o=0;return f;function f(m){return Ge(m)?(n.enter(r),h(m)):l(m)}function h(m){return Ge(m)&&o++<u?(n.consume(m),h):(n.exit(r),l(m))}}function t0(n,l,r,a,u,o){let f=0;return h;function h(y){return Ge(y)?(n.enter(a),m(y)):p(y)}function m(y){return Ge(y)&&f<o?(n.consume(y),f++,m):(n.exit(a),p(y))}function p(y){return f>=u?l(y):r(y)}}const hE={tokenize:pE};function pE(n){const l=n.attempt(this.parser.constructs.contentInitial,a,u);let r;return l;function a(h){if(h===null){n.consume(h);return}return n.enter("lineEnding"),n.consume(h),n.exit("lineEnding"),ct(n,l,"linePrefix")}function u(h){return n.enter("paragraph"),o(h)}function o(h){const m=n.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=m),r=m,f(h)}function f(h){if(h===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(h);return}return ze(h)?(n.consume(h),n.exit("chunkText"),o):(n.consume(h),f)}}let go=class{constructor(){this.index=new Map,this.map=[]}add(l,r,a){ov(this,l,r,a,!1)}addBefore(l,r,a){ov(this,l,r,a,!0)}consume(l){if(this.map.sort(function(o,f){return o[0]-f[0]}),this.map.length===0)return;let r=this.map.length;const a=[];for(;r>0;)r-=1,a.push(l.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),l.length=this.map[r][0];a.push(l.slice()),l.length=0;let u=a.pop();for(;u;){for(const o of u)l.push(o);u=a.pop()}this.map.length=0,this.index.clear()}};function ov(n,l,r,a,u){if(r===0&&a.length===0)return;const o=n.index.get(l);if(o){o[1]+=r,u?(a.push(...o[2]),o[2]=a):o[2].push(...a);return}const f=[l,r,a];n.map.push(f),n.index.set(l,f)}const mE={tokenize:gE},cv={tokenize:yE};function gE(n){const l=this,r=[];let a=0,u,o,f;return h;function h(H){if(a<r.length){const te=r[a];return l.containerState=te[1],n.attempt(te[0].continuation,m,p)(H)}return p(H)}function m(H){if(a++,l.containerState._closeFlow){l.containerState._closeFlow=void 0,u&&M();const te=l.events.length;let ie=te,O;for(;ie--;)if(l.events[ie][0]==="exit"&&l.events[ie][1].type==="chunkFlow"){O=l.events[ie][1].end;break}E(a);let X=te;for(;X<l.events.length;)l.events[X][1].end={...O},X++;const le=new go;return le.add(ie+1,0,l.events.slice(te)),le.add(te,X-te,[]),le.consume(l.events),p(H)}return h(H)}function p(H){if(a===r.length){if(!u)return S(H);if(u.currentConstruct&&u.currentConstruct.concrete)return k(H);l.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return l.containerState={},n.check(cv,y,g)(H)}function y(H){return u&&M(),E(a),S(H)}function g(H){return l.parser.lazy[l.now().line]=a!==r.length,f=l.now().offset,k(H)}function S(H){return l.containerState={},n.attempt(cv,x,k)(H)}function x(H){return a++,r.push([l.currentConstruct,l.containerState]),S(H)}function k(H){if(H===null){u&&M(),E(0),n.consume(H);return}return u=u||l.parser.flow(l.now()),n.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:o}),T(H)}function T(H){if(H===null){C(n.exit("chunkFlow"),!0),E(0),n.consume(H);return}return ze(H)?(n.consume(H),C(n.exit("chunkFlow")),a=0,l.interrupt=void 0,h):(n.consume(H),T)}function C(H,te){const ie=l.sliceStream(H);if(te&&ie.push(null),H.previous=o,o&&(o.next=H),o=H,u.defineSkip(H.start),u.write(ie),l.parser.lazy[H.start.line]){let O=u.events.length;for(;O--;)if(u.events[O][1].start.offset<f&&(!u.events[O][1].end||u.events[O][1].end.offset>f))return;const X=l.events.length;let le=X,me,_;for(;le--;)if(l.events[le][0]==="exit"&&l.events[le][1].type==="chunkFlow"){if(me){_=l.events[le][1].end;break}me=!0}for(E(a),O=X;O<l.events.length;)l.events[O][1].end={..._},O++;const K=new go;K.add(le+1,0,l.events.slice(X)),K.add(X,O-X,[]),K.consume(l.events)}}function E(H){let te=r.length;for(;te-- >H;){const ie=r[te];l.containerState=ie[1],ie[0].exit.call(l,n)}r.length=H}function M(){u.write([null]),o=void 0,u=void 0,l.containerState._closeFlow=void 0}}function yE(n,l,r){return ct(n,n.attempt(this.parser.constructs.document,l,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function jl(n){if(n===null||Nt(n)||cr(n))return 1;if(As(n))return 2}function Oo(n,l,r){const a=[];let u=-1;for(;++u<n.length;){const o=n[u].resolveAll;o&&!a.includes(o)&&(l=o(l,r),a.push(o))}return l}const Zd={name:"attention",resolveAll:vE,tokenize:bE};function vE(n,l){let r=-1,a;for(;++r<n.length;)if(n[r][0]==="enter"&&n[r][1].type==="attentionSequence"&&n[r][1]._close){let u=r;for(;u--;)if(n[u][0]==="exit"&&n[u][1].type==="attentionSequence"&&n[u][1]._open&&l.sliceSerialize(n[u][1]).charCodeAt(0)===l.sliceSerialize(n[r][1]).charCodeAt(0)){if((n[u][1]._close||n[r][1]._open)&&(n[r][1].end.offset-n[r][1].start.offset)%3&&!((n[u][1].end.offset-n[u][1].start.offset+n[r][1].end.offset-n[r][1].start.offset)%3))continue;const o=n[u][1].end.offset-n[u][1].start.offset>1&&n[r][1].end.offset-n[r][1].start.offset>1?2:1,f={...n[u][1].end},h={...n[r][1].start};fv(f,-o),fv(h,o);const m={type:o>1?"strongSequence":"emphasisSequence",start:f,end:{...n[u][1].end}},p={type:o>1?"strongSequence":"emphasisSequence",start:{...n[r][1].start},end:h},y={type:o>1?"strongText":"emphasisText",start:{...n[u][1].end},end:{...n[r][1].start}},g={type:o>1?"strong":"emphasis",start:{...m.start},end:{...p.end}};n[u][1].end={...m.start},n[r][1].start={...p.end},a=[],n[u][1].end.offset-n[u][1].start.offset&&(a=ti(a,[["enter",n[u][1],l],["exit",n[u][1],l]])),a=ti(a,[["enter",g,l],["enter",m,l],["exit",m,l],["enter",y,l]]),a=ti(a,Oo(l.parser.constructs.insideSpan.null,n.slice(u+1,r),l)),a=ti(a,[["exit",y,l],["enter",p,l],["exit",p,l],["exit",g,l]]);let S=0;n[r][1].end.offset-n[r][1].start.offset&&(S=2,a=ti(a,[["enter",n[r][1],l],["exit",n[r][1],l]])),di(n,u-1,r-u+3,a),r=u+a.length-S-2;break}}for(r=-1;++r<n.length;)n[r][1].type==="attentionSequence"&&(n[r][1].type="data");return n}function bE(n,l){const r=this.parser.constructs.attentionMarkers.null,a=this.previous,u=jl(a);let o;return f;function f(m){return o=m,n.enter("attentionSequence"),h(m)}function h(m){if(m===o)return n.consume(m),h;const p=n.exit("attentionSequence"),y=jl(m),g=!y||y===2&&u||r.includes(m)&&m!==42&&m!==95,S=!u||u===2&&y||r.includes(a)&&a!==42&&a!==95;return p._open=!!(o===42?g:g&&(u||!S)),p._close=!!(o===42?S:S&&(y||!g)),l(m)}}function fv(n,l){n.column+=l,n.offset+=l,n._bufferIndex+=l}const xE={name:"autolink",tokenize:SE};function SE(n,l,r){let a=0;return u;function u(x){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(x),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),o}function o(x){return pn(x)?(n.consume(x),f):x===64?r(x):p(x)}function f(x){return x===43||x===45||x===46||mn(x)?(a=1,h(x)):p(x)}function h(x){return x===58?(n.consume(x),a=0,m):(x===43||x===45||x===46||mn(x))&&a++<32?(n.consume(x),h):(a=0,p(x))}function m(x){return x===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(x),n.exit("autolinkMarker"),n.exit("autolink"),l):x===null||x===32||x===60||mo(x)?r(x):(n.consume(x),m)}function p(x){return x===64?(n.consume(x),y):fE(x)?(n.consume(x),p):r(x)}function y(x){return mn(x)?g(x):r(x)}function g(x){return x===46?(n.consume(x),a=0,y):x===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(x),n.exit("autolinkMarker"),n.exit("autolink"),l):S(x)}function S(x){if((x===45||mn(x))&&a++<63){const k=x===45?S:g;return n.consume(x),k}return r(x)}}const Cs={partial:!0,tokenize:wE};function wE(n,l,r){return a;function a(o){return Ge(o)?ct(n,u,"linePrefix")(o):u(o)}function u(o){return o===null||ze(o)?l(o):r(o)}}const n0={continuation:{tokenize:EE},exit:TE,name:"blockQuote",tokenize:kE};function kE(n,l,r){const a=this;return u;function u(f){if(f===62){const h=a.containerState;return h.open||(n.enter("blockQuote",{_container:!0}),h.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),o}return r(f)}function o(f){return Ge(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),l):(n.exit("blockQuotePrefix"),l(f))}}function EE(n,l,r){const a=this;return u;function u(f){return Ge(f)?ct(n,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):o(f)}function o(f){return n.attempt(n0,l,r)(f)}}function TE(n){n.exit("blockQuote")}const i0={name:"characterEscape",tokenize:AE};function AE(n,l,r){return a;function a(o){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(o),n.exit("escapeMarker"),u}function u(o){return e0(o)?(n.enter("characterEscapeValue"),n.consume(o),n.exit("characterEscapeValue"),n.exit("characterEscape"),l):r(o)}}const l0={name:"characterReference",tokenize:CE};function CE(n,l,r){const a=this;let u=0,o,f;return h;function h(g){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(g),n.exit("characterReferenceMarker"),m}function m(g){return g===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(g),n.exit("characterReferenceMarkerNumeric"),p):(n.enter("characterReferenceValue"),o=31,f=mn,y(g))}function p(g){return g===88||g===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(g),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),o=6,f=dE,y):(n.enter("characterReferenceValue"),o=7,f=Xd,y(g))}function y(g){if(g===59&&u){const S=n.exit("characterReferenceValue");return f===mn&&!Sh(a.sliceSerialize(S))?r(g):(n.enter("characterReferenceMarker"),n.consume(g),n.exit("characterReferenceMarker"),n.exit("characterReference"),l)}return f(g)&&u++<o?(n.consume(g),y):r(g)}}const Kd={partial:!0,tokenize:NE};function NE(n,l,r){const a=this;return u;function u(f){return f===null?r(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),o)}function o(f){return a.parser.lazy[a.now().line]?r(f):l(f)}}const dv={concrete:!0,name:"codeFenced",tokenize:jE};function jE(n,l,r){const a=this,u={partial:!0,tokenize:ie};let o=0,f=0,h;return m;function m(O){return p(O)}function p(O){const X=a.events[a.events.length-1];return o=X&&X[1].type==="linePrefix"?X[2].sliceSerialize(X[1],!0).length:0,h=O,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),y(O)}function y(O){return O===h?(f++,n.consume(O),y):f<3?r(O):(n.exit("codeFencedFenceSequence"),Ge(O)?ct(n,g,"whitespace")(O):g(O))}function g(O){return O===null||ze(O)?(n.exit("codeFencedFence"),a.interrupt?l(O):n.check(Kd,T,te)(O)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),S(O))}function S(O){return O===null||ze(O)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),g(O)):Ge(O)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),ct(n,x,"whitespace")(O)):O===96&&O===h?r(O):(n.consume(O),S)}function x(O){return O===null||ze(O)?g(O):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),k(O))}function k(O){return O===null||ze(O)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),g(O)):O===96&&O===h?r(O):(n.consume(O),k)}function T(O){return n.attempt(u,te,C)(O)}function C(O){return n.enter("lineEnding"),n.consume(O),n.exit("lineEnding"),E}function E(O){return o>0&&Ge(O)?ct(n,M,"linePrefix",o+1)(O):M(O)}function M(O){return O===null||ze(O)?n.check(Kd,T,te)(O):(n.enter("codeFlowValue"),H(O))}function H(O){return O===null||ze(O)?(n.exit("codeFlowValue"),M(O)):(n.consume(O),H)}function te(O){return n.exit("codeFenced"),l(O)}function ie(O,X,le){let me=0;return _;function _(re){return O.enter("lineEnding"),O.consume(re),O.exit("lineEnding"),K}function K(re){return O.enter("codeFencedFence"),Ge(re)?ct(O,ee,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(re):ee(re)}function ee(re){return re===h?(O.enter("codeFencedFenceSequence"),Ee(re)):le(re)}function Ee(re){return re===h?(me++,O.consume(re),Ee):me>=f?(O.exit("codeFencedFenceSequence"),Ge(re)?ct(O,qe,"whitespace")(re):qe(re)):le(re)}function qe(re){return re===null||ze(re)?(O.exit("codeFencedFence"),X(re)):le(re)}}}const xd={name:"codeIndented",tokenize:zE},OE={partial:!0,tokenize:_E};function zE(n,l,r){return a;function a(h){return n.enter("codeIndented"),t0(n,u,r,"linePrefix",4,4)(h)}function u(h){return h===null?f(h):ze(h)?n.attempt(OE,u,f)(h):(n.enter("codeFlowValue"),o(h))}function o(h){return h===null||ze(h)?(n.exit("codeFlowValue"),u(h)):(n.consume(h),o)}function f(h){return n.exit("codeIndented"),l(h)}}function _E(n,l,r){const a=this;return u;function u(f){return a.parser.lazy[a.now().line]?r(f):ze(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),u):t0(n,l,o,"linePrefix",4,4)(f)}function o(f){return ze(f)?u(f):r(f)}}const qE={name:"codeText",previous:ME,resolve:RE,tokenize:DE};function RE(n){let l=n.length-4,r=3,a,u;if((n[r][1].type==="lineEnding"||n[r][1].type==="space")&&(n[l][1].type==="lineEnding"||n[l][1].type==="space")){for(a=r;++a<l;)if(n[a][1].type==="codeTextData"){n[r][1].type="codeTextPadding",n[l][1].type="codeTextPadding",r+=2,l-=2;break}}for(a=r-1,l++;++a<=l;)u===void 0?a!==l&&n[a][1].type!=="lineEnding"&&(u=a):(a===l||n[a][1].type==="lineEnding")&&(n[u][1].type="codeTextData",a!==u+2&&(n[u][1].end=n[a-1][1].end,n.splice(u+2,a-u-2),l-=a-u-2,a=u+2),u=void 0);return n}function ME(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function DE(n,l,r){let a=0,u,o;return f;function f(g){return n.enter("codeText"),n.enter("codeTextSequence"),h(g)}function h(g){return g===96?(n.consume(g),a++,h):(n.exit("codeTextSequence"),m(g))}function m(g){return g===null?r(g):g===32?(n.enter("space"),n.consume(g),n.exit("space"),m):g===96?(o=n.enter("codeTextSequence"),u=0,y(g)):ze(g)?(n.enter("lineEnding"),n.consume(g),n.exit("lineEnding"),m):(n.enter("codeTextData"),p(g))}function p(g){return g===null||g===32||g===96||ze(g)?(n.exit("codeTextData"),m(g)):(n.consume(g),p)}function y(g){return g===96?(n.consume(g),u++,y):u===a?(n.exit("codeTextSequence"),n.exit("codeText"),l(g)):(o.type="codeTextData",p(g))}}class LE{constructor(l){this.left=l?[...l]:[],this.right=[]}get(l){if(l<0||l>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+l+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return l<this.left.length?this.left[l]:this.right[this.right.length-l+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(l,r){const a=r??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(l,a):l>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-l+this.left.length).reverse():this.left.slice(l).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(l,r,a){const u=r||0;this.setCursor(Math.trunc(l));const o=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return a&&us(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(l){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(l)}pushMany(l){this.setCursor(Number.POSITIVE_INFINITY),us(this.left,l)}unshift(l){this.setCursor(0),this.right.push(l)}unshiftMany(l){this.setCursor(0),us(this.right,l.reverse())}setCursor(l){if(!(l===this.left.length||l>this.left.length&&this.right.length===0||l<0&&this.left.length===0))if(l<this.left.length){const r=this.left.splice(l,Number.POSITIVE_INFINITY);us(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-l,Number.POSITIVE_INFINITY);us(this.left,r.reverse())}}}function us(n,l){let r=0;if(l.length<1e4)n.push(...l);else for(;r<l.length;)n.push(...l.slice(r,r+1e4)),r+=1e4}function r0(n){const l={};let r=-1,a,u,o,f,h,m,p;const y=new LE(n);for(;++r<y.length;){for(;r in l;)r=l[r];if(a=y.get(r),r&&a[1].type==="chunkFlow"&&y.get(r-1)[1].type==="listItemPrefix"&&(m=a[1]._tokenizer.events,o=0,o<m.length&&m[o][1].type==="lineEndingBlank"&&(o+=2),o<m.length&&m[o][1].type==="content"))for(;++o<m.length&&m[o][1].type!=="content";)m[o][1].type==="chunkText"&&(m[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(l,BE(y,r)),r=l[r],p=!0);else if(a[1]._container){for(o=r,u=void 0;o--;)if(f=y.get(o),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(u&&(y.get(u)[1].type="lineEndingBlank"),f[1].type="lineEnding",u=o);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;u&&(a[1].end={...y.get(u)[1].start},h=y.slice(u,r),h.unshift(a),y.splice(u,r-u+1,h))}}return di(n,0,Number.POSITIVE_INFINITY,y.slice(0)),!p}function BE(n,l){const r=n.get(l)[1],a=n.get(l)[2];let u=l-1;const o=[];let f=r._tokenizer;f||(f=a.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const h=f.events,m=[],p={};let y,g,S=-1,x=r,k=0,T=0;const C=[T];for(;x;){for(;n.get(++u)[1]!==x;);o.push(u),x._tokenizer||(y=a.sliceStream(x),x.next||y.push(null),g&&f.defineSkip(x.start),x._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(y),x._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),g=x,x=x.next}for(x=r;++S<h.length;)h[S][0]==="exit"&&h[S-1][0]==="enter"&&h[S][1].type===h[S-1][1].type&&h[S][1].start.line!==h[S][1].end.line&&(T=S+1,C.push(T),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(f.events=[],x?(x._tokenizer=void 0,x.previous=void 0):C.pop(),S=C.length;S--;){const E=h.slice(C[S],C[S+1]),M=o.pop();m.push([M,M+E.length-1]),n.splice(M,2,E)}for(m.reverse(),S=-1;++S<m.length;)p[k+m[S][0]]=k+m[S][1],k+=m[S][1]-m[S][0]-1;return p}const UE={resolve:IE,tokenize:VE},HE={partial:!0,tokenize:YE};function IE(n){return r0(n),n}function VE(n,l){let r;return a;function a(h){return n.enter("content"),r=n.enter("chunkContent",{contentType:"content"}),u(h)}function u(h){return h===null?o(h):ze(h)?n.check(HE,f,o)(h):(n.consume(h),u)}function o(h){return n.exit("chunkContent"),n.exit("content"),l(h)}function f(h){return n.consume(h),n.exit("chunkContent"),r.next=n.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,u}}function YE(n,l,r){const a=this;return u;function u(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),ct(n,o,"linePrefix")}function o(f){if(f===null||ze(f))return r(f);const h=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(f):n.interrupt(a.parser.constructs.flow,r,l)(f)}}function a0(n,l,r,a,u,o,f,h,m){const p=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(E){return E===60?(n.enter(a),n.enter(u),n.enter(o),n.consume(E),n.exit(o),S):E===null||E===32||E===41||mo(E)?r(E):(n.enter(a),n.enter(f),n.enter(h),n.enter("chunkString",{contentType:"string"}),T(E))}function S(E){return E===62?(n.enter(o),n.consume(E),n.exit(o),n.exit(u),n.exit(a),l):(n.enter(h),n.enter("chunkString",{contentType:"string"}),x(E))}function x(E){return E===62?(n.exit("chunkString"),n.exit(h),S(E)):E===null||E===60||ze(E)?r(E):(n.consume(E),E===92?k:x)}function k(E){return E===60||E===62||E===92?(n.consume(E),x):x(E)}function T(E){return!y&&(E===null||E===41||Nt(E))?(n.exit("chunkString"),n.exit(h),n.exit(f),n.exit(a),l(E)):y<p&&E===40?(n.consume(E),y++,T):E===41?(n.consume(E),y--,T):E===null||E===32||E===40||mo(E)?r(E):(n.consume(E),E===92?C:T)}function C(E){return E===40||E===41||E===92?(n.consume(E),T):T(E)}}function s0(n,l,r,a,u,o){const f=this;let h=0,m;return p;function p(x){return n.enter(a),n.enter(u),n.consume(x),n.exit(u),n.enter(o),y}function y(x){return h>999||x===null||x===91||x===93&&!m||x===94&&!h&&"_hiddenFootnoteSupport"in f.parser.constructs?r(x):x===93?(n.exit(o),n.enter(u),n.consume(x),n.exit(u),n.exit(a),l):ze(x)?(n.enter("lineEnding"),n.consume(x),n.exit("lineEnding"),y):(n.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||x===91||x===93||ze(x)||h++>999?(n.exit("chunkString"),y(x)):(n.consume(x),m||(m=!Ge(x)),x===92?S:g)}function S(x){return x===91||x===92||x===93?(n.consume(x),h++,g):g(x)}}function u0(n,l,r,a,u,o){let f;return h;function h(S){return S===34||S===39||S===40?(n.enter(a),n.enter(u),n.consume(S),n.exit(u),f=S===40?41:S,m):r(S)}function m(S){return S===f?(n.enter(u),n.consume(S),n.exit(u),n.exit(a),l):(n.enter(o),p(S))}function p(S){return S===f?(n.exit(o),m(f)):S===null?r(S):ze(S)?(n.enter("lineEnding"),n.consume(S),n.exit("lineEnding"),ct(n,p,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===f||S===null||ze(S)?(n.exit("chunkString"),p(S)):(n.consume(S),S===92?g:y)}function g(S){return S===f||S===92?(n.consume(S),y):y(S)}}function ps(n,l){let r;return a;function a(u){return ze(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),r=!0,a):Ge(u)?ct(n,a,r?"linePrefix":"lineSuffix")(u):l(u)}}const GE={name:"definition",tokenize:QE},FE={partial:!0,tokenize:XE};function QE(n,l,r){const a=this;let u;return o;function o(x){return n.enter("definition"),f(x)}function f(x){return s0.call(a,n,h,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function h(x){return u=hi(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),x===58?(n.enter("definitionMarker"),n.consume(x),n.exit("definitionMarker"),m):r(x)}function m(x){return Nt(x)?ps(n,p)(x):p(x)}function p(x){return a0(n,y,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function y(x){return n.attempt(FE,g,g)(x)}function g(x){return Ge(x)?ct(n,S,"whitespace")(x):S(x)}function S(x){return x===null||ze(x)?(n.exit("definition"),a.parser.defined.push(u),l(x)):r(x)}}function XE(n,l,r){return a;function a(h){return Nt(h)?ps(n,u)(h):r(h)}function u(h){return u0(n,o,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function o(h){return Ge(h)?ct(n,f,"whitespace")(h):f(h)}function f(h){return h===null||ze(h)?l(h):r(h)}}const ZE={name:"hardBreakEscape",tokenize:KE};function KE(n,l,r){return a;function a(o){return n.enter("hardBreakEscape"),n.consume(o),u}function u(o){return ze(o)?(n.exit("hardBreakEscape"),l(o)):r(o)}}const JE={name:"headingAtx",resolve:$E,tokenize:PE};function $E(n,l){let r=n.length-2,a=3;if(n[a][1].type==="whitespace"&&(a+=2),r-2>a&&n[r][1].type==="whitespace"&&(r-=2),n[r][1].type==="atxHeadingSequence"&&(a===r-1||r-4>a&&n[r-2][1].type==="whitespace")&&(r-=a+1===r?2:4),r>a){const u={type:"atxHeadingText",start:n[a][1].start,end:n[r][1].end},o={type:"chunkText",start:n[a][1].start,end:n[r][1].end,contentType:"text"};di(n,a,r-a+1,[["enter",u,l],["enter",o,l],["exit",o,l],["exit",u,l]])}return n}function PE(n,l,r){let a=0;return u;function u(y){return n.enter("atxHeading"),o(y)}function o(y){return n.enter("atxHeadingSequence"),f(y)}function f(y){return y===35&&a++<6?(n.consume(y),f):y===null||Nt(y)?(n.exit("atxHeadingSequence"),h(y)):r(y)}function h(y){return y===35?(n.enter("atxHeadingSequence"),m(y)):y===null||ze(y)?(n.exit("atxHeading"),l(y)):Ge(y)?ct(n,h,"whitespace")(y):(n.enter("atxHeadingText"),p(y))}function m(y){return y===35?(n.consume(y),m):(n.exit("atxHeadingSequence"),h(y))}function p(y){return y===null||y===35||Nt(y)?(n.exit("atxHeadingText"),h(y)):(n.consume(y),p)}}const o0=["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"],Jd=["pre","script","style","textarea"],WE={concrete:!0,name:"htmlFlow",resolveTo:tT,tokenize:nT},eT={partial:!0,tokenize:iT};function tT(n){let l=n.length;for(;l--&&!(n[l][0]==="enter"&&n[l][1].type==="htmlFlow"););return l>1&&n[l-2][1].type==="linePrefix"&&(n[l][1].start=n[l-2][1].start,n[l+1][1].start=n[l-2][1].start,n.splice(l-2,2)),n}function nT(n,l,r){const a=this;let u,o,f,h,m;return p;function p(R){return y(R)}function y(R){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(R),g}function g(R){return R===33?(n.consume(R),S):R===47?(n.consume(R),o=!0,T):R===63?(n.consume(R),u=3,a.interrupt?l:N):pn(R)?(n.consume(R),f=String.fromCharCode(R),C):r(R)}function S(R){return R===45?(n.consume(R),u=2,x):R===91?(n.consume(R),u=5,h=0,k):pn(R)?(n.consume(R),u=4,a.interrupt?l:N):r(R)}function x(R){return R===45?(n.consume(R),a.interrupt?l:N):r(R)}function k(R){const q="CDATA[";return R===q.charCodeAt(h++)?(n.consume(R),h===q.length?a.interrupt?l:ee:k):r(R)}function T(R){return pn(R)?(n.consume(R),f=String.fromCharCode(R),C):r(R)}function C(R){if(R===null||R===47||R===62||Nt(R)){const q=R===47,ne=f.toLowerCase();return!q&&!o&&Jd.includes(ne)?(u=1,a.interrupt?l(R):ee(R)):o0.includes(f.toLowerCase())?(u=6,q?(n.consume(R),E):a.interrupt?l(R):ee(R)):(u=7,a.interrupt&&!a.parser.lazy[a.now().line]?r(R):o?M(R):H(R))}return R===45||mn(R)?(n.consume(R),f+=String.fromCharCode(R),C):r(R)}function E(R){return R===62?(n.consume(R),a.interrupt?l:ee):r(R)}function M(R){return Ge(R)?(n.consume(R),M):_(R)}function H(R){return R===47?(n.consume(R),_):R===58||R===95||pn(R)?(n.consume(R),te):Ge(R)?(n.consume(R),H):_(R)}function te(R){return R===45||R===46||R===58||R===95||mn(R)?(n.consume(R),te):ie(R)}function ie(R){return R===61?(n.consume(R),O):Ge(R)?(n.consume(R),ie):H(R)}function O(R){return R===null||R===60||R===61||R===62||R===96?r(R):R===34||R===39?(n.consume(R),m=R,X):Ge(R)?(n.consume(R),O):le(R)}function X(R){return R===m?(n.consume(R),m=null,me):R===null||ze(R)?r(R):(n.consume(R),X)}function le(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||Nt(R)?ie(R):(n.consume(R),le)}function me(R){return R===47||R===62||Ge(R)?H(R):r(R)}function _(R){return R===62?(n.consume(R),K):r(R)}function K(R){return R===null||ze(R)?ee(R):Ge(R)?(n.consume(R),K):r(R)}function ee(R){return R===45&&u===2?(n.consume(R),F):R===60&&u===1?(n.consume(R),ue):R===62&&u===4?(n.consume(R),lt):R===63&&u===3?(n.consume(R),N):R===93&&u===5?(n.consume(R),Te):ze(R)&&(u===6||u===7)?(n.exit("htmlFlowData"),n.check(eT,pt,Ee)(R)):R===null||ze(R)?(n.exit("htmlFlowData"),Ee(R)):(n.consume(R),ee)}function Ee(R){return n.check(Kd,qe,pt)(R)}function qe(R){return n.enter("lineEnding"),n.consume(R),n.exit("lineEnding"),re}function re(R){return R===null||ze(R)?Ee(R):(n.enter("htmlFlowData"),ee(R))}function F(R){return R===45?(n.consume(R),N):ee(R)}function ue(R){return R===47?(n.consume(R),f="",ce):ee(R)}function ce(R){if(R===62){const q=f.toLowerCase();return Jd.includes(q)?(n.consume(R),lt):ee(R)}return pn(R)&&f.length<8?(n.consume(R),f+=String.fromCharCode(R),ce):ee(R)}function Te(R){return R===93?(n.consume(R),N):ee(R)}function N(R){return R===62?(n.consume(R),lt):R===45&&u===2?(n.consume(R),N):ee(R)}function lt(R){return R===null||ze(R)?(n.exit("htmlFlowData"),pt(R)):(n.consume(R),lt)}function pt(R){return n.exit("htmlFlow"),l(R)}}function iT(n,l,r){return a;function a(u){return n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),n.attempt(Cs,l,r)}}const lT={name:"htmlText",tokenize:rT};function rT(n,l,r){const a=this;let u,o,f;return h;function h(N){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(N),m}function m(N){return N===33?(n.consume(N),p):N===47?(n.consume(N),ie):N===63?(n.consume(N),H):pn(N)?(n.consume(N),le):r(N)}function p(N){return N===45?(n.consume(N),y):N===91?(n.consume(N),o=0,k):pn(N)?(n.consume(N),M):r(N)}function y(N){return N===45?(n.consume(N),x):r(N)}function g(N){return N===null?r(N):N===45?(n.consume(N),S):ze(N)?(f=g,ue(N)):(n.consume(N),g)}function S(N){return N===45?(n.consume(N),x):g(N)}function x(N){return N===62?F(N):N===45?S(N):g(N)}function k(N){const lt="CDATA[";return N===lt.charCodeAt(o++)?(n.consume(N),o===lt.length?T:k):r(N)}function T(N){return N===null?r(N):N===93?(n.consume(N),C):ze(N)?(f=T,ue(N)):(n.consume(N),T)}function C(N){return N===93?(n.consume(N),E):T(N)}function E(N){return N===62?F(N):N===93?(n.consume(N),E):T(N)}function M(N){return N===null||N===62?F(N):ze(N)?(f=M,ue(N)):(n.consume(N),M)}function H(N){return N===null?r(N):N===63?(n.consume(N),te):ze(N)?(f=H,ue(N)):(n.consume(N),H)}function te(N){return N===62?F(N):H(N)}function ie(N){return pn(N)?(n.consume(N),O):r(N)}function O(N){return N===45||mn(N)?(n.consume(N),O):X(N)}function X(N){return ze(N)?(f=X,ue(N)):Ge(N)?(n.consume(N),X):F(N)}function le(N){return N===45||mn(N)?(n.consume(N),le):N===47||N===62||Nt(N)?me(N):r(N)}function me(N){return N===47?(n.consume(N),F):N===58||N===95||pn(N)?(n.consume(N),_):ze(N)?(f=me,ue(N)):Ge(N)?(n.consume(N),me):F(N)}function _(N){return N===45||N===46||N===58||N===95||mn(N)?(n.consume(N),_):K(N)}function K(N){return N===61?(n.consume(N),ee):ze(N)?(f=K,ue(N)):Ge(N)?(n.consume(N),K):me(N)}function ee(N){return N===null||N===60||N===61||N===62||N===96?r(N):N===34||N===39?(n.consume(N),u=N,Ee):ze(N)?(f=ee,ue(N)):Ge(N)?(n.consume(N),ee):(n.consume(N),qe)}function Ee(N){return N===u?(n.consume(N),u=void 0,re):N===null?r(N):ze(N)?(f=Ee,ue(N)):(n.consume(N),Ee)}function qe(N){return N===null||N===34||N===39||N===60||N===61||N===96?r(N):N===47||N===62||Nt(N)?me(N):(n.consume(N),qe)}function re(N){return N===47||N===62||Nt(N)?me(N):r(N)}function F(N){return N===62?(n.consume(N),n.exit("htmlTextData"),n.exit("htmlText"),l):r(N)}function ue(N){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(N),n.exit("lineEnding"),ce}function ce(N){return Ge(N)?ct(n,Te,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):Te(N)}function Te(N){return n.enter("htmlTextData"),f(N)}}const wh={name:"labelEnd",resolveAll:oT,resolveTo:cT,tokenize:fT},aT={tokenize:dT},sT={tokenize:hT},uT={tokenize:pT};function oT(n){let l=-1;const r=[];for(;++l<n.length;){const a=n[l][1];if(r.push(n[l]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const u=a.type==="labelImage"?4:2;a.type="data",l+=u}}return n.length!==r.length&&di(n,0,n.length,r),n}function cT(n,l){let r=n.length,a=0,u,o,f;for(;r--;){const y=n[r][1];if(u){if(y.type==="link"||y.type==="labelLink"&&y._inactive)break;n[r][0]==="enter"&&y.type==="labelLink"&&(y._inactive=!0)}else if(o){if(n[r][0]==="enter"&&(y.type==="labelImage"||y.type==="labelLink")&&!y._balanced&&(u=r,y.type!=="labelLink")){a=2;break}}else y.type==="labelEnd"&&(o=r)}const h={type:n[u][1].type==="labelLink"?"link":"image",start:{...n[u][1].start},end:{...n[n.length-1][1].end}},m={type:"label",start:{...n[u][1].start},end:{...n[o][1].end}},p={type:"labelText",start:{...n[u+a+2][1].end},end:{...n[o-2][1].start}};return f=[["enter",h,l],["enter",m,l]],f=ti(f,n.slice(u+1,u+a+3)),f=ti(f,[["enter",p,l]]),f=ti(f,Oo(l.parser.constructs.insideSpan.null,n.slice(u+a+4,o-3),l)),f=ti(f,[["exit",p,l],n[o-2],n[o-1],["exit",m,l]]),f=ti(f,n.slice(o+1)),f=ti(f,[["exit",h,l]]),di(n,u,n.length,f),n}function fT(n,l,r){const a=this,u=a._labelStarts;let o,f;if(u){for(;u.length>0&&u[u.length-1]._balanced;)u.pop();o=u[u.length-1]}return h;function h(S){return o?o._inactive?g(S):(f=a.parser.defined.includes(hi(a.sliceSerialize({start:o.end,end:a.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(S),n.exit("labelMarker"),n.exit("labelEnd"),m):r(S)}function m(S){return S===40?n.attempt(aT,y,f?y:g)(S):S===91?n.attempt(sT,y,f?p:g)(S):f?y(S):g(S)}function p(S){return n.attempt(uT,y,g)(S)}function y(S){return u.pop(),l(S)}function g(S){return o._balanced=!0,r(S)}}function dT(n,l,r){return a;function a(g){return n.enter("resource"),n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),u}function u(g){return Nt(g)?ps(n,o)(g):o(g)}function o(g){return g===41?y(g):a0(n,f,h,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function f(g){return Nt(g)?ps(n,m)(g):y(g)}function h(g){return r(g)}function m(g){return g===34||g===39||g===40?u0(n,p,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function p(g){return Nt(g)?ps(n,y)(g):y(g)}function y(g){return g===41?(n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),n.exit("resource"),l):r(g)}}function hT(n,l,r){const a=this;return u;function u(h){return s0.call(a,n,o,f,"reference","referenceMarker","referenceString")(h)}function o(h){return a.parser.defined.includes(hi(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?l(h):r(h)}function f(h){return r(h)}}function pT(n,l,r){return a;function a(o){return n.enter("reference"),n.enter("referenceMarker"),n.consume(o),n.exit("referenceMarker"),u}function u(o){return o===93?(n.enter("referenceMarker"),n.consume(o),n.exit("referenceMarker"),n.exit("reference"),l):r(o)}}const mT={name:"labelStartImage",resolveAll:wh.resolveAll,tokenize:gT};function gT(n,l,r){const a=this;let u;return o;function o(m){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(m),n.exit("labelImageMarker"),f}function f(m){return m===91?(n.enter("labelMarker"),n.consume(m),n.exit("labelMarker"),u=n.exit("labelImage"),h):r(m)}function h(m){return m===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(m):(a._labelStarts=a._labelStarts||[],a._labelStarts.push(u),l(m))}}const yT={name:"labelStartLink",resolveAll:wh.resolveAll,tokenize:vT};function vT(n,l,r){const a=this;let u;return o;function o(h){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(h),n.exit("labelMarker"),u=n.exit("labelLink"),f}function f(h){return h===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(h):(a._labelStarts=a._labelStarts||[],a._labelStarts.push(u),l(h))}}const Sd={name:"lineEnding",tokenize:bT};function bT(n,l){return r;function r(a){return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),ct(n,l,"linePrefix")}}const fo={name:"thematicBreak",tokenize:xT};function xT(n,l,r){let a=0,u;return o;function o(p){return n.enter("thematicBreak"),f(p)}function f(p){return u=p,h(p)}function h(p){return p===u?(n.enter("thematicBreakSequence"),m(p)):a>=3&&(p===null||ze(p))?(n.exit("thematicBreak"),l(p)):r(p)}function m(p){return p===u?(n.consume(p),a++,m):(n.exit("thematicBreakSequence"),Ge(p)?ct(n,h,"whitespace")(p):h(p))}}const Rn={continuation:{tokenize:ET},exit:AT,name:"list",tokenize:kT},ST={partial:!0,tokenize:CT},wT={partial:!0,tokenize:TT};function kT(n,l,r){const a=this,u=a.events[a.events.length-1];let o=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,f=0;return h;function h(x){const k=a.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||x===a.containerState.marker:Xd(x)){if(a.containerState.type||(a.containerState.type=k,n.enter(k,{_container:!0})),k==="listUnordered")return n.enter("listItemPrefix"),x===42||x===45?n.check(fo,r,p)(x):p(x);if(!a.interrupt||x===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),m(x)}return r(x)}function m(x){return Xd(x)&&++f<10?(n.consume(x),m):(!a.interrupt||f<2)&&(a.containerState.marker?x===a.containerState.marker:x===41||x===46)?(n.exit("listItemValue"),p(x)):r(x)}function p(x){return n.enter("listItemMarker"),n.consume(x),n.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||x,n.check(Cs,a.interrupt?r:y,n.attempt(ST,S,g))}function y(x){return a.containerState.initialBlankLine=!0,o++,S(x)}function g(x){return Ge(x)?(n.enter("listItemPrefixWhitespace"),n.consume(x),n.exit("listItemPrefixWhitespace"),S):r(x)}function S(x){return a.containerState.size=o+a.sliceSerialize(n.exit("listItemPrefix"),!0).length,l(x)}}function ET(n,l,r){const a=this;return a.containerState._closeFlow=void 0,n.check(Cs,u,o);function u(h){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,ct(n,l,"listItemIndent",a.containerState.size+1)(h)}function o(h){return a.containerState.furtherBlankLines||!Ge(h)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,f(h)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,n.attempt(wT,l,f)(h))}function f(h){return a.containerState._closeFlow=!0,a.interrupt=void 0,ct(n,n.attempt(Rn,l,r),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function TT(n,l,r){const a=this;return ct(n,u,"listItemIndent",a.containerState.size+1);function u(o){const f=a.events[a.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===a.containerState.size?l(o):r(o)}}function AT(n){n.exit(this.containerState.type)}function CT(n,l,r){const a=this;return ct(n,u,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(o){const f=a.events[a.events.length-1];return!Ge(o)&&f&&f[1].type==="listItemPrefixWhitespace"?l(o):r(o)}}const hv={name:"setextUnderline",resolveTo:NT,tokenize:jT};function NT(n,l){const r=new go;let a=n.length,u,o,f;for(;a--;)if(n[a][0]==="enter"){if(n[a][1].type==="content"){u=a;break}n[a][1].type==="paragraph"&&(o=a)}else n[a][1].type==="content"&&r.add(a,1,[]),!f&&n[a][1].type==="definition"&&(f=a);const h={type:"setextHeading",start:{...n[u][1].start},end:{...n[n.length-1][1].end}};return n[o][1].type="setextHeadingText",f?(r.add(o,0,[["enter",h,l]]),r.add(f+1,0,[["exit",n[u][1],l]]),n[u][1].end={...n[f][1].end}):n[u][1]=h,r.add(n.length,0,[["exit",h,l]]),r.consume(n),n}function jT(n,l,r){const a=this;let u;return o;function o(p){let y=a.events.length,g;for(;y--;)if(a.events[y][1].type!=="lineEnding"&&a.events[y][1].type!=="linePrefix"&&a.events[y][1].type!=="content"){g=a.events[y][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(n.enter("setextHeadingLine"),u=p,f(p)):r(p)}function f(p){return n.enter("setextHeadingLineSequence"),h(p)}function h(p){return p===u?(n.consume(p),h):(n.exit("setextHeadingLineSequence"),Ge(p)?ct(n,m,"lineSuffix")(p):m(p))}function m(p){return p===null||ze(p)?(n.exit("setextHeadingLine"),l(p)):r(p)}}const OT={tokenize:zT};function zT(n){const l=this,r=n.attempt(Cs,a,n.attempt(this.parser.constructs.flowInitial,u,ct(n,n.attempt(this.parser.constructs.flow,u,n.attempt(UE,u)),"linePrefix")));return r;function a(o){if(o===null){n.consume(o);return}return n.enter("lineEndingBlank"),n.consume(o),n.exit("lineEndingBlank"),l.currentConstruct=void 0,r}function u(o){if(o===null){n.consume(o);return}return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),l.currentConstruct=void 0,r}}const _T={resolveAll:f0()},qT=c0("string"),RT=c0("text");function c0(n){return{resolveAll:f0(n==="text"?MT:void 0),tokenize:l};function l(r){const a=this,u=this.parser.constructs[n],o=r.attempt(u,f,h);return f;function f(y){return p(y)?o(y):h(y)}function h(y){if(y===null){r.consume(y);return}return r.enter("data"),r.consume(y),m}function m(y){return p(y)?(r.exit("data"),o(y)):(r.consume(y),m)}function p(y){if(y===null)return!0;const g=u[y];let S=-1;if(g)for(;++S<g.length;){const x=g[S];if(!x.previous||x.previous.call(a,a.previous))return!0}return!1}}}function f0(n){return l;function l(r,a){let u=-1,o;for(;++u<=r.length;)o===void 0?r[u]&&r[u][1].type==="data"&&(o=u,u++):(!r[u]||r[u][1].type!=="data")&&(u!==o+2&&(r[o][1].end=r[u-1][1].end,r.splice(o+2,u-o-2),u=o+2),o=void 0);return n?n(r,a):r}}function MT(n,l){const r=new go;let a=0;for(;++a<=n.length;)if((a===n.length||n[a][1].type==="lineEnding")&&n[a-1][1].type==="data"){const u=n[a-1][1],o=l.sliceStream(u);let f=o.length,h=-1,m=0,p;for(;f--;){const y=o[f];if(typeof y=="string"){for(h=y.length;y.charCodeAt(h-1)===32;)m++,h--;if(h)break;h=-1}else if(y===-2)p=!0,m++;else if(y!==-1){f++;break}}if(l._contentTypeTextTrailing&&a===n.length&&(m=0),m){const y={type:a===n.length||p||m<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:f?h:u.start._bufferIndex+h,_index:u.start._index+f,line:u.end.line,column:u.end.column-m,offset:u.end.offset-m},end:{...u.end}};u.end={...y.start},u.start.offset===u.end.offset?Object.assign(u,y):r.add(a,0,[["enter",y,l],["exit",y,l]])}a++}return r.consume(n),n}const DT={42:Rn,43:Rn,45:Rn,48:Rn,49:Rn,50:Rn,51:Rn,52:Rn,53:Rn,54:Rn,55:Rn,56:Rn,57:Rn,62:n0},LT={91:GE},BT={[-2]:xd,[-1]:xd,32:xd},UT={35:JE,42:fo,45:[hv,fo],60:WE,61:hv,95:fo,96:dv,126:dv},HT={38:l0,92:i0},IT={[-5]:Sd,[-4]:Sd,[-3]:Sd,33:mT,38:l0,42:Zd,60:[xE,lT],91:yT,92:[ZE,i0],93:wh,95:Zd,96:qE},VT={null:[Zd,_T]},YT={null:[42,95]},GT={null:[]},FT=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:YT,contentInitial:LT,disable:GT,document:DT,flow:UT,flowInitial:BT,insideSpan:VT,string:HT,text:IT},Symbol.toStringTag,{value:"Module"}));function QT(n,l,r){let a={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const u={},o=[];let f=[],h=[];const m={attempt:X(ie),check:X(O),consume:M,enter:H,exit:te,interrupt:X(O,{interrupt:!0})},p={code:null,containerState:{},defineSkip:T,events:[],now:k,parser:n,previous:null,sliceSerialize:S,sliceStream:x,write:g};let y=l.tokenize.call(p,m);return l.resolveAll&&o.push(l),p;function g(K){return f=ti(f,K),C(),f[f.length-1]!==null?[]:(le(l,0),p.events=Oo(o,p.events,p),p.events)}function S(K,ee){return ZT(x(K),ee)}function x(K){return XT(f,K)}function k(){const{_bufferIndex:K,_index:ee,line:Ee,column:qe,offset:re}=a;return{_bufferIndex:K,_index:ee,line:Ee,column:qe,offset:re}}function T(K){u[K.line]=K.column,_()}function C(){for(;a._index<f.length;){const K=f[a._index];if(typeof K=="string"){const ee=a._index;for(a._bufferIndex<0&&(a._bufferIndex=0);a._index===ee&&a._bufferIndex<K.length;)E(K.charCodeAt(a._bufferIndex))}else E(K)}}function E(K){y=y(K)}function M(K){ze(K)?(a.line++,a.column=1,a.offset+=K===-3?2:1,_()):K!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===f[a._index].length&&(a._bufferIndex=-1,a._index++)),p.previous=K}function H(K,ee){const Ee=ee||{};return Ee.type=K,Ee.start=k(),p.events.push(["enter",Ee,p]),h.push(Ee),Ee}function te(K){const ee=h.pop();return ee.end=k(),p.events.push(["exit",ee,p]),ee}function ie(K,ee){le(K,ee.from)}function O(K,ee){ee.restore()}function X(K,ee){return Ee;function Ee(qe,re,F){let ue,ce,Te,N;return Array.isArray(qe)?pt(qe):"tokenize"in qe?pt([qe]):lt(qe);function lt(fe){return ye;function ye(Ce){const je=Ce!==null&&fe[Ce],we=Ce!==null&&fe.null,J=[...Array.isArray(je)?je:je?[je]:[],...Array.isArray(we)?we:we?[we]:[]];return pt(J)(Ce)}}function pt(fe){return ue=fe,ce=0,fe.length===0?F:R(fe[ce])}function R(fe){return ye;function ye(Ce){return N=me(),Te=fe,fe.partial||(p.currentConstruct=fe),fe.name&&p.parser.constructs.disable.null.includes(fe.name)?ne():fe.tokenize.call(ee?Object.assign(Object.create(p),ee):p,m,q,ne)(Ce)}}function q(fe){return K(Te,N),re}function ne(fe){return N.restore(),++ce<ue.length?R(ue[ce]):F}}}function le(K,ee){K.resolveAll&&!o.includes(K)&&o.push(K),K.resolve&&di(p.events,ee,p.events.length-ee,K.resolve(p.events.slice(ee),p)),K.resolveTo&&(p.events=K.resolveTo(p.events,p))}function me(){const K=k(),ee=p.previous,Ee=p.currentConstruct,qe=p.events.length,re=Array.from(h);return{from:qe,restore:F};function F(){a=K,p.previous=ee,p.currentConstruct=Ee,p.events.length=qe,h=re,_()}}function _(){a.line in u&&a.column<2&&(a.column=u[a.line],a.offset+=u[a.line]-1)}}function XT(n,l){const r=l.start._index,a=l.start._bufferIndex,u=l.end._index,o=l.end._bufferIndex;let f;if(r===u)f=[n[r].slice(a,o)];else{if(f=n.slice(r,u),a>-1){const h=f[0];typeof h=="string"?f[0]=h.slice(a):f.shift()}o>0&&f.push(n[u].slice(0,o))}return f}function ZT(n,l){let r=-1;const a=[];let u;for(;++r<n.length;){const o=n[r];let f;if(typeof o=="string")f=o;else switch(o){case-5:{f="\r";break}case-4:{f=`
19
+ `;break}case-3:{f=`\r
20
+ `;break}case-2:{f=l?" ":" ";break}case-1:{if(!l&&u)continue;f=" ";break}default:f=String.fromCharCode(o)}u=o===-2,a.push(f)}return a.join("")}function KT(n){const a={constructs:Pb([FT,...(n||{}).extensions||[]]),content:u(hE),defined:[],document:u(mE),flow:u(OT),lazy:{},string:u(qT),text:u(RT)};return a;function u(o){return f;function f(h){return QT(a,o,h)}}}function JT(n){for(;!r0(n););return n}const pv=/[\0\t\n\r]/g;function $T(){let n=1,l="",r=!0,a;return u;function u(o,f,h){o=l+(typeof o=="string"?o.toString():new TextDecoder(f||void 0).decode(o));const m=[];let p=0;for(l="",r&&(o.charCodeAt(0)===65279&&p++,r=void 0);p<o.length;){pv.lastIndex=p;const y=pv.exec(o),g=y&&y.index!==void 0?y.index:o.length,S=o.charCodeAt(g);if(!y){l=o.slice(p);break}if(S===10&&p===g&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),p<g&&(m.push(o.slice(p,g)),n+=g-p),S){case 0:{m.push(65533),n++;break}case 9:{const x=Math.ceil(n/4)*4;for(m.push(-2);n++<x;)m.push(-1);break}case 10:{m.push(-4),n=1;break}default:a=!0,n=1}p=g+1}return h&&(a&&m.push(-5),l&&m.push(l),m.push(null)),m}}const PT=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function WT(n){return n.replace(PT,eA)}function eA(n,l,r){if(l)return l;if(r.charCodeAt(0)===35){const u=r.charCodeAt(1),o=u===120||u===88;return Wb(r.slice(o?2:1),o?16:10)}return Sh(r)||n}const d0={}.hasOwnProperty;function tA(n,l,r){return l&&typeof l=="object"&&(r=l,l=void 0),nA(r)(JT(KT(r).document().write($T()(n,l,!0))))}function nA(n){const l={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:f(st),autolinkProtocol:_,autolinkEmail:_,atxHeading:f(dt),blockQuote:f(J),characterEscape:_,characterReference:_,codeFenced:f(he),codeFencedFenceInfo:h,codeFencedFenceMeta:h,codeIndented:f(he,h),codeText:f(ut,h),codeTextData:_,data:_,codeFlowValue:_,definition:f(Et),definitionDestinationString:h,definitionLabelString:h,definitionTitleString:h,emphasis:f(ke),hardBreakEscape:f($e),hardBreakTrailing:f($e),htmlFlow:f(Ie,h),htmlFlowData:_,htmlText:f(Ie,h),htmlTextData:_,image:f(Re),label:h,link:f(st),listItem:f(It),listItemValue:x,listOrdered:f(mt,S),listUnordered:f(mt),paragraph:f(Mt),reference:q,referenceString:h,resourceDestinationString:h,resourceTitleString:h,setextHeading:f(dt),strong:f(Ft),thematicBreak:f(Qt)},exit:{atxHeading:p(),atxHeadingSequence:O,autolink:p(),autolinkEmail:we,autolinkProtocol:je,blockQuote:p(),characterEscapeValue:K,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ye,characterReference:Ce,codeFenced:p(E),codeFencedFence:C,codeFencedFenceInfo:k,codeFencedFenceMeta:T,codeFlowValue:K,codeIndented:p(M),codeText:p(F),codeTextData:K,data:K,definition:p(),definitionDestinationString:ie,definitionLabelString:H,definitionTitleString:te,emphasis:p(),hardBreakEscape:p(Ee),hardBreakTrailing:p(Ee),htmlFlow:p(qe),htmlFlowData:K,htmlText:p(re),htmlTextData:K,image:p(ce),label:N,labelText:Te,lineEnding:ee,link:p(ue),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:ne,resourceDestinationString:lt,resourceTitleString:pt,resource:R,setextHeading:p(me),setextHeadingLineSequence:le,setextHeadingText:X,strong:p(),thematicBreak:p()}};h0(l,(n||{}).mdastExtensions||[]);const r={};return a;function a(Z){let ae={type:"root",children:[],position:void 0};const ge={stack:[ae],tokenStack:[],config:l,enter:m,exit:y,buffer:h,resume:g,data:r},xe=[],Ve=[];let Ne=-1;for(;++Ne<Z.length;)if(Ve.push(Z[Ne]),Z[Ne][1].type==="listOrdered"||Z[Ne][1].type==="listUnordered")if(Z[Ne][0]==="enter")xe.push(Ve.length-1);else{const De=xe.pop();o(Ve,De)}for(Z=Ve,Ne=-1;++Ne<Z.length;){const De=l[Z[Ne][0]];Z[Ne][0]==="enter"&&l.beforeEnter.length>0&&u(l.beforeEnter,{...ge,sliceSerialize:Z[Ne][2].sliceSerialize},Z[Ne][1]),d0.call(De,Z[Ne][1].type)&&De[Z[Ne][1].type].call({...ge,sliceSerialize:Z[Ne][2].sliceSerialize},Z[Ne][1]),Z[Ne][0]==="exit"&&l.afterExit.length>0&&u(l.afterExit,{...ge,sliceSerialize:Z[Ne][2].sliceSerialize},Z[Ne][1])}if(ge.tokenStack.length>0){const De=ge.tokenStack[ge.tokenStack.length-1];(De[1]||mv).call(ge,void 0,De[0])}for(ae.position={start:Nl(Z.length>0?Z[0][1].start:{line:1,column:1,offset:0}),end:Nl(Z.length>0?Z[Z.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<l.transforms.length;)ae=l.transforms[Ne](ae)||ae;return ae}function u(Z,ae,ge){let xe=-1;for(;++xe<Z.length;)Z[xe].call(ae,ge)}function o(Z,ae){const ge=Z.length-1;let xe=ae-1,Ve=-1,Ne=!1,De,qt,Sn,en;const wn=[];for(;++xe<=ge;){const Lt=Z[xe];switch(Lt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Lt[0]==="enter"?Ve++:Ve--,en=void 0;break}case"lineEndingBlank":{Lt[0]==="enter"&&(De&&!en&&!Ve&&!Sn&&(Sn=xe),en=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:en=void 0}if(!Ve&&Lt[0]==="enter"&&Lt[1].type==="listItemPrefix"||Ve===-1&&Lt[0]==="exit"&&(Lt[1].type==="listUnordered"||Lt[1].type==="listOrdered")){if(De){let Bt=xe;for(qt=void 0;Bt--;){const gn=Z[Bt];if(gn[1].type==="lineEnding"||gn[1].type==="lineEndingBlank"){if(gn[0]==="exit")continue;qt&&(Z[qt][1].type="lineEndingBlank",Ne=!0),gn[1].type="lineEnding",qt=Bt}else if(!(gn[1].type==="linePrefix"||gn[1].type==="blockQuotePrefix"||gn[1].type==="blockQuotePrefixWhitespace"||gn[1].type==="blockQuoteMarker"||gn[1].type==="listItemIndent"))break}Sn&&(!qt||Sn<qt)&&(De._spread=!0),De.end=Object.assign({},qt?Z[qt][1].start:Lt[1].end),wn.push({at:qt||xe,event:["exit",De,Lt[2]]})}if(Lt[1].type==="listItemPrefix"){const Bt={type:"listItem",_spread:!1,start:Object.assign({},Lt[1].start),end:void 0};De=Bt,wn.push({at:xe,event:["enter",Bt,Lt[2]]}),Sn=void 0,en=!0}}}const Dt=Z.splice(ae);let bt=0;for(xe=-1;++xe<Dt.length;){for(;bt<wn.length&&wn[bt].at===ae+xe;)Z.push(wn[bt++].event);Z.push(Dt[xe])}Z[ae][1]._spread=Ne}function f(Z,ae){return ge;function ge(xe){m.call(this,Z(xe),xe),ae&&ae.call(this,xe)}}function h(){this.stack.push({type:"fragment",children:[]})}function m(Z,ae,ge){this.stack[this.stack.length-1].children.push(Z),this.stack.push(Z),this.tokenStack.push([ae,ge||void 0]),Z.position={start:Nl(ae.start),end:void 0}}function p(Z){return ae;function ae(ge){Z&&Z.call(this,ge),y.call(this,ge)}}function y(Z,ae){const ge=this.stack.pop(),xe=this.tokenStack.pop();if(!xe)throw new Error("Cannot close `"+Z.type+"` ("+hs({start:Z.start,end:Z.end})+"): it’s not open");xe[0].type!==Z.type&&(ae?ae.call(this,Z,xe[0]):(xe[1]||mv).call(this,Z,xe[0])),ge.position.end=Nl(Z.end)}function g(){return jo(this.stack.pop())}function S(){this.data.expectingFirstListItemValue=!0}function x(Z){if(this.data.expectingFirstListItemValue){const ae=this.stack[this.stack.length-2];ae.start=Number.parseInt(this.sliceSerialize(Z),10),this.data.expectingFirstListItemValue=void 0}}function k(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.lang=Z}function T(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.meta=Z}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.value=Z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function M(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.value=Z.replace(/(\r?\n|\r)$/g,"")}function H(Z){const ae=this.resume(),ge=this.stack[this.stack.length-1];ge.label=ae,ge.identifier=hi(this.sliceSerialize(Z)).toLowerCase()}function te(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.title=Z}function ie(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.url=Z}function O(Z){const ae=this.stack[this.stack.length-1];if(!ae.depth){const ge=this.sliceSerialize(Z).length;ae.depth=ge}}function X(){this.data.setextHeadingSlurpLineEnding=!0}function le(Z){const ae=this.stack[this.stack.length-1];ae.depth=this.sliceSerialize(Z).codePointAt(0)===61?1:2}function me(){this.data.setextHeadingSlurpLineEnding=void 0}function _(Z){const ge=this.stack[this.stack.length-1].children;let xe=ge[ge.length-1];(!xe||xe.type!=="text")&&(xe=xn(),xe.position={start:Nl(Z.start),end:void 0},ge.push(xe)),this.stack.push(xe)}function K(Z){const ae=this.stack.pop();ae.value+=this.sliceSerialize(Z),ae.position.end=Nl(Z.end)}function ee(Z){const ae=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ge=ae.children[ae.children.length-1];ge.position.end=Nl(Z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&l.canContainEols.includes(ae.type)&&(_.call(this,Z),K.call(this,Z))}function Ee(){this.data.atHardBreak=!0}function qe(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.value=Z}function re(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.value=Z}function F(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.value=Z}function ue(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=ae,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function ce(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=ae,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function Te(Z){const ae=this.sliceSerialize(Z),ge=this.stack[this.stack.length-2];ge.label=WT(ae),ge.identifier=hi(ae).toLowerCase()}function N(){const Z=this.stack[this.stack.length-1],ae=this.resume(),ge=this.stack[this.stack.length-1];if(this.data.inReference=!0,ge.type==="link"){const xe=Z.children;ge.children=xe}else ge.alt=ae}function lt(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.url=Z}function pt(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.title=Z}function R(){this.data.inReference=void 0}function q(){this.data.referenceType="collapsed"}function ne(Z){const ae=this.resume(),ge=this.stack[this.stack.length-1];ge.label=ae,ge.identifier=hi(this.sliceSerialize(Z)).toLowerCase(),this.data.referenceType="full"}function fe(Z){this.data.characterReferenceType=Z.type}function ye(Z){const ae=this.sliceSerialize(Z),ge=this.data.characterReferenceType;let xe;ge?(xe=Wb(ae,ge==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):xe=Sh(ae);const Ve=this.stack[this.stack.length-1];Ve.value+=xe}function Ce(Z){const ae=this.stack.pop();ae.position.end=Nl(Z.end)}function je(Z){K.call(this,Z);const ae=this.stack[this.stack.length-1];ae.url=this.sliceSerialize(Z)}function we(Z){K.call(this,Z);const ae=this.stack[this.stack.length-1];ae.url="mailto:"+this.sliceSerialize(Z)}function J(){return{type:"blockquote",children:[],position:void 0}}function he(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function ut(){return{type:"inlineCode",value:"",position:void 0}}function Et(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function ke(){return{type:"emphasis",children:[],position:void 0}}function dt(){return{type:"heading",depth:0,children:[],position:void 0}}function $e(){return{type:"break",position:void 0}}function Ie(){return{type:"html",value:"",position:void 0}}function Re(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function st(){return{type:"link",title:null,url:"",children:[],position:void 0}}function mt(Z){return{type:"list",ordered:Z.type==="listOrdered",start:null,spread:Z._spread,children:[],position:void 0}}function It(Z){return{type:"listItem",spread:Z._spread,checked:null,children:[],position:void 0}}function Mt(){return{type:"paragraph",children:[],position:void 0}}function Ft(){return{type:"strong",children:[],position:void 0}}function xn(){return{type:"text",value:"",position:void 0}}function Qt(){return{type:"thematicBreak",position:void 0}}}function Nl(n){return{line:n.line,column:n.column,offset:n.offset}}function h0(n,l){let r=-1;for(;++r<l.length;){const a=l[r];Array.isArray(a)?h0(n,a):iA(n,a)}}function iA(n,l){let r;for(r in l)if(d0.call(l,r))switch(r){case"canContainEols":{const a=l[r];a&&n[r].push(...a);break}case"transforms":{const a=l[r];a&&n[r].push(...a);break}case"afterExit":case"beforeEnter":{const a=l[r];a&&n[r].push(a);break}case"enter":case"exit":{const a=l[r];a&&Object.assign(n[r],a);break}}}function mv(n,l){throw n?new Error("Cannot close `"+n.type+"` ("+hs({start:n.start,end:n.end})+"): a different token (`"+l.type+"`, "+hs({start:l.start,end:l.end})+") is open"):new Error("Cannot close document, a token (`"+l.type+"`, "+hs({start:l.start,end:l.end})+") is still open")}function lA(n){const l=this;l.parser=r;function r(a){return tA(a,{...l.data("settings"),...n,extensions:l.data("micromarkExtensions")||[],mdastExtensions:l.data("fromMarkdownExtensions")||[]})}}function rA(n,l){const r={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(l),!0)};return n.patch(l,r),n.applyData(l,r)}function aA(n,l){const r={type:"element",tagName:"br",properties:{},children:[]};return n.patch(l,r),[n.applyData(l,r),{type:"text",value:`
21
+ `}]}function sA(n,l){const r=l.value?l.value+`
22
+ `:"",a={},u=l.lang?l.lang.split(/\s+/):[];u.length>0&&(a.className=["language-"+u[0]]);let o={type:"element",tagName:"code",properties:a,children:[{type:"text",value:r}]};return l.meta&&(o.data={meta:l.meta}),n.patch(l,o),o=n.applyData(l,o),o={type:"element",tagName:"pre",properties:{},children:[o]},n.patch(l,o),o}function uA(n,l){const r={type:"element",tagName:"del",properties:{},children:n.all(l)};return n.patch(l,r),n.applyData(l,r)}function oA(n,l){const r={type:"element",tagName:"em",properties:{},children:n.all(l)};return n.patch(l,r),n.applyData(l,r)}function cA(n,l){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",a=String(l.identifier).toUpperCase(),u=aa(a.toLowerCase()),o=n.footnoteOrder.indexOf(a);let f,h=n.footnoteCounts.get(a);h===void 0?(h=0,n.footnoteOrder.push(a),f=n.footnoteOrder.length):f=o+1,h+=1,n.footnoteCounts.set(a,h);const m={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+u,id:r+"fnref-"+u+(h>1?"-"+h:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(l,m);const p={type:"element",tagName:"sup",properties:{},children:[m]};return n.patch(l,p),n.applyData(l,p)}function fA(n,l){const r={type:"element",tagName:"h"+l.depth,properties:{},children:n.all(l)};return n.patch(l,r),n.applyData(l,r)}function dA(n,l){if(n.options.allowDangerousHtml){const r={type:"raw",value:l.value};return n.patch(l,r),n.applyData(l,r)}}function p0(n,l){const r=l.referenceType;let a="]";if(r==="collapsed"?a+="[]":r==="full"&&(a+="["+(l.label||l.identifier)+"]"),l.type==="imageReference")return[{type:"text",value:"!["+l.alt+a}];const u=n.all(l),o=u[0];o&&o.type==="text"?o.value="["+o.value:u.unshift({type:"text",value:"["});const f=u[u.length-1];return f&&f.type==="text"?f.value+=a:u.push({type:"text",value:a}),u}function hA(n,l){const r=String(l.identifier).toUpperCase(),a=n.definitionById.get(r);if(!a)return p0(n,l);const u={src:aa(a.url||""),alt:l.alt};a.title!==null&&a.title!==void 0&&(u.title=a.title);const o={type:"element",tagName:"img",properties:u,children:[]};return n.patch(l,o),n.applyData(l,o)}function pA(n,l){const r={src:aa(l.url)};l.alt!==null&&l.alt!==void 0&&(r.alt=l.alt),l.title!==null&&l.title!==void 0&&(r.title=l.title);const a={type:"element",tagName:"img",properties:r,children:[]};return n.patch(l,a),n.applyData(l,a)}function mA(n,l){const r={type:"text",value:l.value.replace(/\r?\n|\r/g," ")};n.patch(l,r);const a={type:"element",tagName:"code",properties:{},children:[r]};return n.patch(l,a),n.applyData(l,a)}function gA(n,l){const r=String(l.identifier).toUpperCase(),a=n.definitionById.get(r);if(!a)return p0(n,l);const u={href:aa(a.url||"")};a.title!==null&&a.title!==void 0&&(u.title=a.title);const o={type:"element",tagName:"a",properties:u,children:n.all(l)};return n.patch(l,o),n.applyData(l,o)}function yA(n,l){const r={href:aa(l.url)};l.title!==null&&l.title!==void 0&&(r.title=l.title);const a={type:"element",tagName:"a",properties:r,children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}function vA(n,l,r){const a=n.all(l),u=r?bA(r):m0(l),o={},f=[];if(typeof l.checked=="boolean"){const y=a[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:l.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let h=-1;for(;++h<a.length;){const y=a[h];(u||h!==0||y.type!=="element"||y.tagName!=="p")&&f.push({type:"text",value:`
23
+ `}),y.type==="element"&&y.tagName==="p"&&!u?f.push(...y.children):f.push(y)}const m=a[a.length-1];m&&(u||m.type!=="element"||m.tagName!=="p")&&f.push({type:"text",value:`
24
+ `});const p={type:"element",tagName:"li",properties:o,children:f};return n.patch(l,p),n.applyData(l,p)}function bA(n){let l=!1;if(n.type==="list"){l=n.spread||!1;const r=n.children;let a=-1;for(;!l&&++a<r.length;)l=m0(r[a])}return l}function m0(n){const l=n.spread;return l??n.children.length>1}function xA(n,l){const r={},a=n.all(l);let u=-1;for(typeof l.start=="number"&&l.start!==1&&(r.start=l.start);++u<a.length;){const f=a[u];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const o={type:"element",tagName:l.ordered?"ol":"ul",properties:r,children:n.wrap(a,!0)};return n.patch(l,o),n.applyData(l,o)}function SA(n,l){const r={type:"element",tagName:"p",properties:{},children:n.all(l)};return n.patch(l,r),n.applyData(l,r)}function wA(n,l){const r={type:"root",children:n.wrap(n.all(l))};return n.patch(l,r),n.applyData(l,r)}function kA(n,l){const r={type:"element",tagName:"strong",properties:{},children:n.all(l)};return n.patch(l,r),n.applyData(l,r)}function EA(n,l){const r=n.all(l),a=r.shift(),u=[];if(a){const f={type:"element",tagName:"thead",properties:{},children:n.wrap([a],!0)};n.patch(l.children[0],f),u.push(f)}if(r.length>0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(r,!0)},h=yh(l.children[1]),m=Fb(l.children[l.children.length-1]);h&&m&&(f.position={start:h,end:m}),u.push(f)}const o={type:"element",tagName:"table",properties:{},children:n.wrap(u,!0)};return n.patch(l,o),n.applyData(l,o)}function TA(n,l,r){const a=r?r.children:void 0,o=(a?a.indexOf(l):1)===0?"th":"td",f=r&&r.type==="table"?r.align:void 0,h=f?f.length:l.children.length;let m=-1;const p=[];for(;++m<h;){const g=l.children[m],S={},x=f?f[m]:void 0;x&&(S.align=x);let k={type:"element",tagName:o,properties:S,children:[]};g&&(k.children=n.all(g),n.patch(g,k),k=n.applyData(g,k)),p.push(k)}const y={type:"element",tagName:"tr",properties:{},children:n.wrap(p,!0)};return n.patch(l,y),n.applyData(l,y)}function AA(n,l){const r={type:"element",tagName:"td",properties:{},children:n.all(l)};return n.patch(l,r),n.applyData(l,r)}const gv=9,yv=32;function CA(n){const l=String(n),r=/\r?\n|\r/g;let a=r.exec(l),u=0;const o=[];for(;a;)o.push(vv(l.slice(u,a.index),u>0,!0),a[0]),u=a.index+a[0].length,a=r.exec(l);return o.push(vv(l.slice(u),u>0,!1)),o.join("")}function vv(n,l,r){let a=0,u=n.length;if(l){let o=n.codePointAt(a);for(;o===gv||o===yv;)a++,o=n.codePointAt(a)}if(r){let o=n.codePointAt(u-1);for(;o===gv||o===yv;)u--,o=n.codePointAt(u-1)}return u>a?n.slice(a,u):""}function NA(n,l){const r={type:"text",value:CA(String(l.value))};return n.patch(l,r),n.applyData(l,r)}function jA(n,l){const r={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(l,r),n.applyData(l,r)}const OA={blockquote:rA,break:aA,code:sA,delete:uA,emphasis:oA,footnoteReference:cA,heading:fA,html:dA,imageReference:hA,image:pA,inlineCode:mA,linkReference:gA,link:yA,listItem:vA,list:xA,paragraph:SA,root:wA,strong:kA,table:EA,tableCell:AA,tableRow:TA,text:NA,thematicBreak:jA,toml:io,yaml:io,definition:io,footnoteDefinition:io};function io(){}const g0=-1,zo=0,ms=1,yo=2,kh=3,Eh=4,Th=5,Ah=6,y0=7,v0=8,{defineProperty:zA}=Object,b0=typeof self=="object"?self:globalThis,bv=(n,l)=>{switch(n){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+n)}return new b0[n](l)},_A=(n,l)=>{const r=(u,o)=>(n.set(o,u),u),a=u=>{if(n.has(u))return n.get(u);const[o,f]=l[u];switch(o){case zo:case g0:return r(f,u);case ms:{const h=r([],u);for(const m of f)h.push(a(m));return h}case yo:{const h=r({},u);for(const[m,p]of f){const y=a(m),g=a(p);y==="__proto__"?zA(h,y,{value:g,configurable:!0,enumerable:!0,writable:!0}):h[y]=g}return h}case kh:return r(new Date(f),u);case Eh:{const{source:h,flags:m}=f;return r(new RegExp(h,m),u)}case Th:{const h=r(new Map,u);for(const[m,p]of f)h.set(a(m),a(p));return h}case Ah:{const h=r(new Set,u);for(const m of f)h.add(a(m));return h}case y0:{const{name:h,message:m}=f;return r(typeof b0[h]=="function"?bv(h,m):new Error(m),u)}case v0:return r(BigInt(f),u);case"BigInt":return r(Object(BigInt(f)),u);case"ArrayBuffer":return r(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:h}=new Uint8Array(f);return r(new DataView(h),f)}case"-0":return-0}return r(bv(o,f),u)};return a},xv=n=>_A(new Map,n)(0),sr="",{toString:qA}={},{keys:RA,is:MA}=Object,os=n=>{const l=typeof n;if(l!=="object"||!n)return[zo,l];const r=qA.call(n).slice(8,-1);switch(r){case"Array":return[ms,sr];case"Object":return[yo,sr];case"Date":return[kh,sr];case"RegExp":return[Eh,sr];case"Map":return[Th,sr];case"Set":return[Ah,sr];case"DataView":return[ms,r]}return r.includes("Array")?[ms,r]:n instanceof Error?[y0,n.name||"Error"]:[yo,r]},lo=([n,l])=>n===zo&&(l==="function"||l==="symbol"),DA=(n,l,r,a)=>{const u=(f,h)=>{const m=a.push(f)-1;return r.set(h,m),m},o=f=>{if(r.has(f))return r.get(f);let[h,m]=os(f);switch(h){case zo:{let y=f;switch(m){case"bigint":h=v0,y=f.toString();break;case"number":if(!f&&MA(f,-0))return a.push(["-0"])-1;break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return u([g0],f)}return u([h,y],f)}case ms:{if(m){let S=f;return m==="DataView"?S=new Uint8Array(f.buffer):m==="ArrayBuffer"&&(S=new Uint8Array(f)),u([m,[...S]],f)}const y=[],g=u([h,y],f);for(const S of f)y.push(o(S));return g}case yo:{if(m)switch(m){case"BigInt":return u([m,f.toString()],f);case"Boolean":case"Number":case"String":return u([m,f.valueOf()],f)}if(l&&"toJSON"in f)return o(f.toJSON());const y=[],g=u([h,y],f);for(const S of RA(f))(n||!lo(os(f[S])))&&y.push([o(S),o(f[S])]);return g}case kh:return u([h,isNaN(f.getTime())?sr:f.toISOString()],f);case Eh:{const{source:y,flags:g}=f;return u([h,{source:y,flags:g}],f)}case Th:{const y=[],g=u([h,y],f);for(const[S,x]of f)(n||!(lo(os(S))||lo(os(x))))&&y.push([o(S),o(x)]);return g}case Ah:{const y=[],g=u([h,y],f);for(const S of f)(n||!lo(os(S)))&&y.push(o(S));return g}}const{message:p}=f;return u([h,{name:m,message:p}],f)};return o},Sv=(n,{json:l,lossy:r}={})=>{const a=[];return DA(!(l||r),!!l,new Map,a)(n),a},vo=typeof structuredClone=="function"?(n,l)=>l&&("json"in l||"lossy"in l)?xv(Sv(n,l)):structuredClone(n):(n,l)=>xv(Sv(n,l));function LA(n,l){const r=[{type:"text",value:"↩"}];return l>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(l)}]}),r}function BA(n,l){return"Back to reference "+(n+1)+(l>1?"-"+l:"")}function UA(n){const l=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",r=n.options.footnoteBackContent||LA,a=n.options.footnoteBackLabel||BA,u=n.options.footnoteLabel||"Footnotes",o=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},h=[];let m=-1;for(;++m<n.footnoteOrder.length;){const p=n.footnoteById.get(n.footnoteOrder[m]);if(!p)continue;const y=n.all(p),g=String(p.identifier).toUpperCase(),S=aa(g.toLowerCase());let x=0;const k=[],T=n.footnoteCounts.get(g);for(;T!==void 0&&++x<=T;){k.length>0&&k.push({type:"text",value:" "});let M=typeof r=="string"?r:r(m,x);typeof M=="string"&&(M={type:"text",value:M}),k.push({type:"element",tagName:"a",properties:{href:"#"+l+"fnref-"+S+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,x),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const C=y[y.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const M=C.children[C.children.length-1];M&&M.type==="text"?M.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...k)}else y.push(...k);const E={type:"element",tagName:"li",properties:{id:l+"fn-"+S},children:n.wrap(y,!0)};n.patch(p,E),h.push(E)}if(h.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...vo(f),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
25
+ `},{type:"element",tagName:"ol",properties:{},children:n.wrap(h,!0)},{type:"text",value:`
26
+ `}]}}const _o=(function(n){if(n==null)return YA;if(typeof n=="function")return qo(n);if(typeof n=="object")return Array.isArray(n)?HA(n):IA(n);if(typeof n=="string")return VA(n);throw new Error("Expected function, string, or object as test")});function HA(n){const l=[];let r=-1;for(;++r<n.length;)l[r]=_o(n[r]);return qo(a);function a(...u){let o=-1;for(;++o<l.length;)if(l[o].apply(this,u))return!0;return!1}}function IA(n){const l=n;return qo(r);function r(a){const u=a;let o;for(o in n)if(u[o]!==l[o])return!1;return!0}}function VA(n){return qo(l);function l(r){return r&&r.type===n}}function qo(n){return l;function l(r,a,u){return!!(GA(r)&&n.call(this,r,typeof a=="number"?a:void 0,u||void 0))}}function YA(){return!0}function GA(n){return n!==null&&typeof n=="object"&&"type"in n}const x0=[],FA=!0,gs=!1,$d="skip";function Pd(n,l,r,a){if(!n||typeof n!="object")throw new Error("Unexpected value `"+n+"` for `tree`, expected node");let u=!0,o,f,h,m;if(typeof r=="function"||r&&typeof r=="object"?(o=l,f=r,a&&(u=!1)):(f=l,r&&(u=!1)),typeof f=="function")h=f;else if(f&&typeof f=="object"){if(!(f.enter===null||f.enter===void 0))if(typeof f.enter=="function")h=f.enter;else throw new Error("Unexpected value `"+f.enter+"` for `visitors.enter`, expected optional visitor");if(typeof f.exit=="function")m=f.exit;else throw new Error("Unexpected value `"+f.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+f+"` for `enter` or `visitors`, expected visitor or object with visitors");const p=_o(o),y=u?1:-1;g(n,void 0,[])();function g(S,x,k){const T=S&&typeof S=="object"?S:{};if(typeof T.type=="string"){const E=typeof T.tagName=="string"?T.tagName:typeof T.name=="string"?T.name:void 0;Object.defineProperty(C,"name",{value:"node ("+(S.type+(E?"<"+E+">":""))+")"})}return C;function C(){const E=!o||p(S,x,k[k.length-1]||void 0);let M=x0;if(h&&E&&(M=wv(h(S,k,x)),M[0]===gs))return M;if("children"in S&&S.children){const H=S;if(H.children&&M[0]!==$d){let te=(u?-1:H.children.length)+y;const ie=[...k,H];for(;te>-1&&te<H.children.length;){const O=H.children[te],X=g(O,te,ie)();if(X[0]===gs)return X;te=typeof X[1]=="number"?X[1]:te+y}}}if(m&&E){const H=wv(m(S,k,x));if(H[0]===$d)throw new Error("Unexpected value `"+H[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(H[0]===gs||typeof H[1]=="number")return H}return M}}}function wv(n){return Array.isArray(n)?n:typeof n=="number"?[FA,n]:n==null?x0:[n]}function Ro(n,l,r,a){let u,o,f;o=l,f=r,typeof o=="function"?Pd(n,u,Wd(o),f):Pd(n,u,QA(o),f)}function QA(n){return!n||typeof n!="object"?n:{enter:typeof n.enter=="function"?Wd(n.enter):n.enter,exit:typeof n.exit=="function"?Wd(n.exit):n.exit}}function Wd(n){return l;function l(r,a,u){return n(r,u,a[a.length-1])}}const eh={}.hasOwnProperty,XA={};function ZA(n,l){const r=l||XA,a=new Map,u=new Map,o=new Map,f={...OA,...r.handlers},h={all:p,applyData:JA,definitionById:a,footnoteById:u,footnoteCounts:o,footnoteOrder:[],handlers:f,one:m,options:r,patch:KA,wrap:PA};return Ro(n,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?a:u,S=String(y.identifier).toUpperCase();g.has(S)||g.set(S,y)}}),h;function m(y,g){const S=y.type,x=h.handlers[S];if(eh.call(h.handlers,S)&&x)return x(h,y,g);if(h.options.passThrough&&h.options.passThrough.includes(S)){if("children"in y){const{children:T,...C}=y,E=vo(C);return E.children=h.all(y),E}return vo(y)}return(h.options.unknownHandler||$A)(h,y,g)}function p(y){const g=[];if("children"in y){const S=y.children;let x=-1;for(;++x<S.length;){const k=h.one(S[x],y);if(k){if(x&&S[x-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=kv(k.value)),!Array.isArray(k)&&k.type==="element")){const T=k.children[0];T&&T.type==="text"&&(T.value=kv(T.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function KA(n,l){n.position&&(l.position=Bk(n))}function JA(n,l){let r=l;if(n&&n.data){const a=n.data.hName,u=n.data.hChildren,o=n.data.hProperties;if(typeof a=="string")if(r.type==="element")r.tagName=a;else{const f="children"in r?r.children:[r];r={type:"element",tagName:a,properties:{},children:f}}r.type==="element"&&o&&Object.assign(r.properties,vo(o)),"children"in r&&r.children&&u!==null&&u!==void 0&&(r.children=u)}return r}function $A(n,l){const r=l.data||{},a="value"in l&&!(eh.call(r,"hProperties")||eh.call(r,"hChildren"))?{type:"text",value:l.value}:{type:"element",tagName:"div",properties:{},children:n.all(l)};return n.patch(l,a),n.applyData(l,a)}function PA(n,l){const r=[];let a=-1;for(l&&r.push({type:"text",value:`
27
+ `});++a<n.length;)a&&r.push({type:"text",value:`
28
+ `}),r.push(n[a]);return l&&n.length>0&&r.push({type:"text",value:`
29
+ `}),r}function kv(n){let l=0,r=n.charCodeAt(l);for(;r===9||r===32;)l++,r=n.charCodeAt(l);return n.slice(l)}function Ev(n,l){const r=ZA(n,l),a=r.one(n,void 0),u=UA(r),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return u&&o.children.push({type:"text",value:`
30
+ `},u),o}function WA(n,l){return n&&"run"in n?async function(r,a){const u=Ev(r,{file:a,...l});await n.run(u,a)}:function(r,a){return Ev(r,{file:a,...n||l})}}function Tv(n){if(n)throw n}var wd,Av;function eC(){if(Av)return wd;Av=1;var n=Object.prototype.hasOwnProperty,l=Object.prototype.toString,r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,u=function(p){return typeof Array.isArray=="function"?Array.isArray(p):l.call(p)==="[object Array]"},o=function(p){if(!p||l.call(p)!=="[object Object]")return!1;var y=n.call(p,"constructor"),g=p.constructor&&p.constructor.prototype&&n.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!y&&!g)return!1;var S;for(S in p);return typeof S>"u"||n.call(p,S)},f=function(p,y){r&&y.name==="__proto__"?r(p,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):p[y.name]=y.newValue},h=function(p,y){if(y==="__proto__")if(n.call(p,y)){if(a)return a(p,y).value}else return;return p[y]};return wd=function m(){var p,y,g,S,x,k,T=arguments[0],C=1,E=arguments.length,M=!1;for(typeof T=="boolean"&&(M=T,T=arguments[1]||{},C=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});C<E;++C)if(p=arguments[C],p!=null)for(y in p)g=h(T,y),S=h(p,y),T!==S&&(M&&S&&(o(S)||(x=u(S)))?(x?(x=!1,k=g&&u(g)?g:[]):k=g&&o(g)?g:{},f(T,{name:y,newValue:m(M,k,S)})):typeof S<"u"&&f(T,{name:y,newValue:S}));return T},wd}var tC=eC();const kd=ob(tC);function th(n){if(typeof n!="object"||n===null)return!1;const l=Object.getPrototypeOf(n);return(l===null||l===Object.prototype||Object.getPrototypeOf(l)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function nC(){const n=[],l={run:r,use:a};return l;function r(...u){let o=-1;const f=u.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);h(null,...u);function h(m,...p){const y=n[++o];let g=-1;if(m){f(m);return}for(;++g<u.length;)(p[g]===null||p[g]===void 0)&&(p[g]=u[g]);u=p,y?iC(y,h)(...p):f(null,...p)}}function a(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return n.push(u),l}}function iC(n,l){let r;return a;function a(...f){const h=n.length>f.length;let m;h&&f.push(u);try{m=n.apply(this,f)}catch(p){const y=p;if(h&&r)throw y;return u(y)}h||(m&&m.then&&typeof m.then=="function"?m.then(o,u):m instanceof Error?u(m):o(m))}function u(f,...h){r||(r=!0,l(f,...h))}function o(f){u(null,f)}}const ji={basename:lC,dirname:rC,extname:aC,join:sC,sep:"/"};function lC(n,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');Ns(n);let r=0,a=-1,u=n.length,o;if(l===void 0||l.length===0||l.length>n.length){for(;u--;)if(n.codePointAt(u)===47){if(o){r=u+1;break}}else a<0&&(o=!0,a=u+1);return a<0?"":n.slice(r,a)}if(l===n)return"";let f=-1,h=l.length-1;for(;u--;)if(n.codePointAt(u)===47){if(o){r=u+1;break}}else f<0&&(o=!0,f=u+1),h>-1&&(n.codePointAt(u)===l.codePointAt(h--)?h<0&&(a=u):(h=-1,a=f));return r===a?a=f:a<0&&(a=n.length),n.slice(r,a)}function rC(n){if(Ns(n),n.length===0)return".";let l=-1,r=n.length,a;for(;--r;)if(n.codePointAt(r)===47){if(a){l=r;break}}else a||(a=!0);return l<0?n.codePointAt(0)===47?"/":".":l===1&&n.codePointAt(0)===47?"//":n.slice(0,l)}function aC(n){Ns(n);let l=n.length,r=-1,a=0,u=-1,o=0,f;for(;l--;){const h=n.codePointAt(l);if(h===47){if(f){a=l+1;break}continue}r<0&&(f=!0,r=l+1),h===46?u<0?u=l:o!==1&&(o=1):u>-1&&(o=-1)}return u<0||r<0||o===0||o===1&&u===r-1&&u===a+1?"":n.slice(u,r)}function sC(...n){let l=-1,r;for(;++l<n.length;)Ns(n[l]),n[l]&&(r=r===void 0?n[l]:r+"/"+n[l]);return r===void 0?".":uC(r)}function uC(n){Ns(n);const l=n.codePointAt(0)===47;let r=oC(n,!l);return r.length===0&&!l&&(r="."),r.length>0&&n.codePointAt(n.length-1)===47&&(r+="/"),l?"/"+r:r}function oC(n,l){let r="",a=0,u=-1,o=0,f=-1,h,m;for(;++f<=n.length;){if(f<n.length)h=n.codePointAt(f);else{if(h===47)break;h=47}if(h===47){if(!(u===f-1||o===1))if(u!==f-1&&o===2){if(r.length<2||a!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(m=r.lastIndexOf("/"),m!==r.length-1){m<0?(r="",a=0):(r=r.slice(0,m),a=r.length-1-r.lastIndexOf("/")),u=f,o=0;continue}}else if(r.length>0){r="",a=0,u=f,o=0;continue}}l&&(r=r.length>0?r+"/..":"..",a=2)}else r.length>0?r+="/"+n.slice(u+1,f):r=n.slice(u+1,f),a=f-u-1;u=f,o=0}else h===46&&o>-1?o++:o=-1}return r}function Ns(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const cC={cwd:fC};function fC(){return"/"}function nh(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function dC(n){if(typeof n=="string")n=new URL(n);else if(!nh(n)){const l=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw l.code="ERR_INVALID_ARG_TYPE",l}if(n.protocol!=="file:"){const l=new TypeError("The URL must be of scheme file");throw l.code="ERR_INVALID_URL_SCHEME",l}return hC(n)}function hC(n){if(n.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const l=n.pathname;let r=-1;for(;++r<l.length;)if(l.codePointAt(r)===37&&l.codePointAt(r+1)===50){const a=l.codePointAt(r+2);if(a===70||a===102){const u=new TypeError("File URL path must not include encoded / characters");throw u.code="ERR_INVALID_FILE_URL_PATH",u}}return decodeURIComponent(l)}const Ed=["history","path","basename","stem","extname","dirname"];class S0{constructor(l){let r;l?nh(l)?r={path:l}:typeof l=="string"||pC(l)?r={value:l}:r=l:r={},this.cwd="cwd"in r?"":cC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Ed.length;){const o=Ed[a];o in r&&r[o]!==void 0&&r[o]!==null&&(this[o]=o==="history"?[...r[o]]:r[o])}let u;for(u in r)Ed.includes(u)||(this[u]=r[u])}get basename(){return typeof this.path=="string"?ji.basename(this.path):void 0}set basename(l){Ad(l,"basename"),Td(l,"basename"),this.path=ji.join(this.dirname||"",l)}get dirname(){return typeof this.path=="string"?ji.dirname(this.path):void 0}set dirname(l){Cv(this.basename,"dirname"),this.path=ji.join(l||"",this.basename)}get extname(){return typeof this.path=="string"?ji.extname(this.path):void 0}set extname(l){if(Td(l,"extname"),Cv(this.dirname,"extname"),l){if(l.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(l.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ji.join(this.dirname,this.stem+(l||""))}get path(){return this.history[this.history.length-1]}set path(l){nh(l)&&(l=dC(l)),Ad(l,"path"),this.path!==l&&this.history.push(l)}get stem(){return typeof this.path=="string"?ji.basename(this.path,this.extname):void 0}set stem(l){Ad(l,"stem"),Td(l,"stem"),this.path=ji.join(this.dirname||"",l+(this.extname||""))}fail(l,r,a){const u=this.message(l,r,a);throw u.fatal=!0,u}info(l,r,a){const u=this.message(l,r,a);return u.fatal=void 0,u}message(l,r,a){const u=new No(l,r,a);return this.path&&(u.name=this.path+":"+u.name,u.file=this.path),u.fatal=!1,this.messages.push(u),u}toString(l){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(l||void 0).decode(this.value)}}function Td(n,l){if(n&&n.includes(ji.sep))throw new Error("`"+l+"` cannot be a path: did not expect `"+ji.sep+"`")}function Ad(n,l){if(!n)throw new Error("`"+l+"` cannot be empty")}function Cv(n,l){if(!n)throw new Error("Setting `"+l+"` requires `path` to be set too")}function pC(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const mC=(function(n){const a=this.constructor.prototype,u=a[n],o=function(){return u.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),gC={}.hasOwnProperty;class Ch extends mC{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=nC()}copy(){const l=new Ch;let r=-1;for(;++r<this.attachers.length;){const a=this.attachers[r];l.use(...a)}return l.data(kd(!0,{},this.namespace)),l}data(l,r){return typeof l=="string"?arguments.length===2?(jd("data",this.frozen),this.namespace[l]=r,this):gC.call(this.namespace,l)&&this.namespace[l]||void 0:l?(jd("data",this.frozen),this.namespace=l,this):this.namespace}freeze(){if(this.frozen)return this;const l=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const u=r.call(l,...a);typeof u=="function"&&this.transformers.use(u)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(l){this.freeze();const r=ro(l),a=this.parser||this.Parser;return Cd("parse",a),a(String(r),r)}process(l,r){const a=this;return this.freeze(),Cd("process",this.parser||this.Parser),Nd("process",this.compiler||this.Compiler),r?u(void 0,r):new Promise(u);function u(o,f){const h=ro(l),m=a.parse(h);a.run(m,h,function(y,g,S){if(y||!g||!S)return p(y);const x=g,k=a.stringify(x,S);bC(k)?S.value=k:S.result=k,p(y,S)});function p(y,g){y||!g?f(y):o?o(g):r(void 0,g)}}}processSync(l){let r=!1,a;return this.freeze(),Cd("processSync",this.parser||this.Parser),Nd("processSync",this.compiler||this.Compiler),this.process(l,u),jv("processSync","process",r),a;function u(o,f){r=!0,Tv(o),a=f}}run(l,r,a){Nv(l),this.freeze();const u=this.transformers;return!a&&typeof r=="function"&&(a=r,r=void 0),a?o(void 0,a):new Promise(o);function o(f,h){const m=ro(r);u.run(l,m,p);function p(y,g,S){const x=g||l;y?h(y):f?f(x):a(void 0,x,S)}}}runSync(l,r){let a=!1,u;return this.run(l,r,o),jv("runSync","run",a),u;function o(f,h){Tv(f),u=h,a=!0}}stringify(l,r){this.freeze();const a=ro(r),u=this.compiler||this.Compiler;return Nd("stringify",u),Nv(l),u(l,a)}use(l,...r){const a=this.attachers,u=this.namespace;if(jd("use",this.frozen),l!=null)if(typeof l=="function")m(l,r);else if(typeof l=="object")Array.isArray(l)?h(l):f(l);else throw new TypeError("Expected usable value, not `"+l+"`");return this;function o(p){if(typeof p=="function")m(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[y,...g]=p;m(y,g)}else f(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function f(p){if(!("plugins"in p)&&!("settings"in p))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");h(p.plugins),p.settings&&(u.settings=kd(!0,u.settings,p.settings))}function h(p){let y=-1;if(p!=null)if(Array.isArray(p))for(;++y<p.length;){const g=p[y];o(g)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function m(p,y){let g=-1,S=-1;for(;++g<a.length;)if(a[g][0]===p){S=g;break}if(S===-1)a.push([p,...y]);else if(y.length>0){let[x,...k]=y;const T=a[S][1];th(T)&&th(x)&&(x=kd(!0,T,x)),a[S]=[p,x,...k]}}}}const yC=new Ch().freeze();function Cd(n,l){if(typeof l!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Nd(n,l){if(typeof l!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function jd(n,l){if(l)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Nv(n){if(!th(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function jv(n,l,r){if(!r)throw new Error("`"+n+"` finished async. Use `"+l+"` instead")}function ro(n){return vC(n)?n:new S0(n)}function vC(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function bC(n){return typeof n=="string"||xC(n)}function xC(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const SC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ov=[],zv={allowDangerousHtml:!0},wC=/^(https?|ircs?|mailto|xmpp)$/i,kC=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function EC(n){const l=TC(n),r=AC(n);return CC(l.runSync(l.parse(r),r),n)}function TC(n){const l=n.rehypePlugins||Ov,r=n.remarkPlugins||Ov,a=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...zv}:zv;return yC().use(lA).use(r).use(WA,a).use(l)}function AC(n){const l=n.children||"",r=new S0;return typeof l=="string"&&(r.value=l),r}function CC(n,l){const r=l.allowedElements,a=l.allowElement,u=l.components,o=l.disallowedElements,f=l.skipHtml,h=l.unwrapDisallowed,m=l.urlTransform||NC;for(const y of kC)Object.hasOwn(l,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+SC+y.id,void 0);return Ro(n,p),Gk(n,{Fragment:v.Fragment,components:u,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function p(y,g,S){if(y.type==="raw"&&S&&typeof g=="number")return f?S.children.splice(g,1):S.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let x;for(x in bd)if(Object.hasOwn(bd,x)&&Object.hasOwn(y.properties,x)){const k=y.properties[x],T=bd[x];(T===null||T.includes(y.tagName))&&(y.properties[x]=m(String(k||""),x,y))}}if(y.type==="element"){let x=r?!r.includes(y.tagName):o?o.includes(y.tagName):!1;if(!x&&a&&typeof g=="number"&&(x=!a(y,g,S)),x&&S&&typeof g=="number")return h&&y.children?S.children.splice(g,1,...y.children):S.children.splice(g,1),g}}}function NC(n){const l=n.indexOf(":"),r=n.indexOf("?"),a=n.indexOf("#"),u=n.indexOf("/");return l===-1||u!==-1&&l>u||r!==-1&&l>r||a!==-1&&l>a||wC.test(n.slice(0,l))?n:""}function _v(n,l){const r=String(n);if(typeof l!="string")throw new TypeError("Expected character");let a=0,u=r.indexOf(l);for(;u!==-1;)a++,u=r.indexOf(l,u+l.length);return a}function jC(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function OC(n,l,r){const u=_o((r||{}).ignore||[]),o=zC(l);let f=-1;for(;++f<o.length;)Pd(n,h);function h(p,y,g){if(p.type==="text"&&typeof g=="number")return m(p,y,g);if(u(p,g,y[y.length-1]))return $d}function m(p,y,g){const S=y[y.length-1],x=o[f][0],k=o[f][1];let T=0,C=!1,E=[];x.lastIndex=0;let M=x.exec(p.value);for(;M;){const te=M.index,ie={index:M.index,input:M.input,stack:[...y,p]};let O=k(...M,ie);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1)x.lastIndex=te+1;else{if(T!==te&&H({type:"text",value:p.value.slice(T,te)}),Array.isArray(O))for(const X of O)H(X);else O&&H(O);T=te+M[0].length,C=!0}if(!x.global)break;M=x.exec(p.value)}return C?(T<p.value.length&&H({type:"text",value:p.value.slice(T)}),S.children.splice(g,1,...E)):E=[p],g+E.length;function H(te){const ie=E[E.length-1];ie&&ie.type==="text"&&te.type==="text"?ie.value+=te.value:E.push(te)}}}function zC(n){if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const l=[],r=!n[0]||Array.isArray(n[0])?n:[n];let a=-1;for(;++a<r.length;){const u=r[a];l.push([_C(u[0]),qC(u[1])])}return l}function _C(n){return typeof n=="string"?new RegExp(jC(n),"g"):n}function qC(n){return typeof n=="function"?n:function(){return n}}const Od="phrasing",zd=["autolink","link","image","label"];function RC(){return{transforms:[IC],enter:{literalAutolink:DC,literalAutolinkEmail:_d,literalAutolinkHttp:_d,literalAutolinkWww:_d},exit:{literalAutolink:HC,literalAutolinkEmail:UC,literalAutolinkHttp:LC,literalAutolinkWww:BC}}}function MC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Od,notInConstruct:zd},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Od,notInConstruct:zd},{character:":",before:"[ps]",after:"\\/",inConstruct:Od,notInConstruct:zd}]}}function DC(n){this.enter({type:"link",title:null,url:"",children:[],position:void 0},n)}function _d(n){this.config.enter.autolinkProtocol.call(this,n)}function LC(n){this.config.exit.autolinkProtocol.call(this,n)}function BC(n){this.config.exit.data.call(this,n);const l=this.stack[this.stack.length-1];l.type,l.url="http://"+this.sliceSerialize(n)}function UC(n){this.config.exit.autolinkEmail.call(this,n)}function HC(n){this.exit(n)}function IC(n){OC(n,[[new RegExp("(?<![\\da-z])(https?:\\/\\/|www(?=\\.))([\\w-]*\\.[\\w\\-.]*)([^\\t\\n\\r ]*)","gi"),VC],[new RegExp("(?<![\\w+\\-.@])xmpp:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)(\\/(?:[\\w\\-/]|\\.(?=[\\dA-Za-z]))*)?","g"),FC],[new RegExp("(?<![\\w+\\-.@])mailto:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),GC],[new RegExp("(?<![\\w+\\-.]|(?:^|[^\\d@A-Za-z])(?:mailto|xmpp):)([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),YC]],{ignore:["link","linkReference"]})}function VC(n,l,r,a,u){if(!ZC(u))return!1;let o="";if(/^w/i.test(l)&&(r=l+r,l="",o="http://"),As(r.charCodeAt(0))||!QC(r))return!1;const f=XC(r+a),h={type:"link",title:null,url:o+l+f[0],children:[{type:"text",value:l+f[0],position:void 0}],position:void 0};return f[1]?[h,{type:"text",value:f[1],position:void 0}]:h}function YC(n,l,r){return/[\d\-_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+l+"@"+r,children:[{type:"text",value:l+"@"+r,position:void 0}],position:void 0}}function GC(n,l,r){if(/[\d\-_]$/.test(r))return!1;const a="mailto:"+l+"@"+r;return{type:"link",title:null,url:a,children:[{type:"text",value:a,position:void 0}],position:void 0}}function FC(n,l,r,a,u){if(/[\d\-_]$/.test(r)||a&&(!/[A-Za-z]$/.test(a)||u.input.charAt(u.index+n.length)==="@"))return!1;const o="xmpp:"+l+"@"+r+(a||"");return{type:"link",title:null,url:o,children:[{type:"text",value:o,position:void 0}],position:void 0}}function QC(n){const l=n.split(".");return!(l.length<2||l[l.length-1]&&(/_/.test(l[l.length-1])||!/[\dA-Za-z]/.test(l[l.length-1]))||l[l.length-2]&&(/_/.test(l[l.length-2])||!/[\dA-Za-z]/.test(l[l.length-2])))}function XC(n){let l=n.length;for(;l>0;){const f=n.charCodeAt(l-1);if(f===33||f===34||f===38||f===39||f===41||f===44||f===46||f===58||f===59||f===60||f===62||f===63||f===93||f===125)l--;else break}if(l===n.length)return[n,void 0];let r=n.slice(l);n=n.slice(0,l);let a=r.indexOf(")");const u=_v(n,"(");let o=_v(n,")");for(;a!==-1&&u>o;)n+=r.slice(0,a+1),r=r.slice(a+1),a=r.indexOf(")"),o++;return[n,r]}function ZC(n){const l=n.input.charCodeAt(n.index-1);return n.index===0||cr(l)||As(l)}w0.peek=iN;function KC(){this.buffer()}function JC(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function $C(){this.buffer()}function PC(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function WC(n){const l=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=hi(this.sliceSerialize(n)).toLowerCase(),r.label=l}function eN(n){this.exit(n)}function tN(n){const l=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=hi(this.sliceSerialize(n)).toLowerCase(),r.label=l}function nN(n){this.exit(n)}function iN(){return"["}function w0(n,l,r,a){const u=r.createTracker(a);let o=u.move("[^");const f=r.enter("footnoteReference"),h=r.enter("reference");return o+=u.move(r.safe(r.associationId(n),{after:"]",before:o})),h(),f(),o+=u.move("]"),o}function lN(){return{enter:{gfmFootnoteCallString:KC,gfmFootnoteCall:JC,gfmFootnoteDefinitionLabelString:$C,gfmFootnoteDefinition:PC},exit:{gfmFootnoteCallString:WC,gfmFootnoteCall:eN,gfmFootnoteDefinitionLabelString:tN,gfmFootnoteDefinition:nN}}}function rN(n){let l=!1;return n&&n.firstLineBlank&&(l=!0),{handlers:{footnoteDefinition:r,footnoteReference:w0},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(a,u,o,f){const h=o.createTracker(f);let m=h.move("[^");const p=o.enter("footnoteDefinition"),y=o.enter("label");return m+=h.move(o.safe(o.associationId(a),{before:m,after:"]"})),y(),m+=h.move("]:"),a.children&&a.children.length>0&&(h.shift(4),m+=h.move((l?`
31
+ `:" ")+o.indentLines(o.containerFlow(a,h.current()),l?k0:aN))),p(),m}}function aN(n,l,r){return l===0?n:k0(n,l,r)}function k0(n,l,r){return(r?"":" ")+n}const sN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Nh.attention=dN;Nh.peek=hN;function uN(){return{canContainEols:["delete"],enter:{strikethrough:cN},exit:{strikethrough:fN}}}function oN(){return{handlers:{delete:Nh},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:sN}]}}function cN(n){this.enter({type:"delete",children:[],position:void 0},n)}function fN(n){this.exit(n)}function Nh(n,l,r,a){const u=r.createTracker(a),o=r.stack.includes("strikethrough")?"~":"~~",f=r.enter("strikethrough");let h=u.move(o);return h+=r.containerPhrasing(n,{...u.current(),before:h,after:"~"}),h+=u.move(o),f(),h}function dN(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function hN(){return"~"}function pN(n){return n.length}function mN(n,l){const r=l||{},a=(r.align||[]).concat(),u=r.stringLength||pN,o=[],f=[],h=[],m=[];let p=0,y=-1;for(;++y<n.length;){const T=[],C=[];let E=-1;for(n[y].length>p&&(p=n[y].length);++E<n[y].length;){const M=gN(n[y][E]);if(r.alignDelimiters!==!1){const H=u(M);C[E]=H,(m[E]===void 0||H>m[E])&&(m[E]=H)}T.push(M)}f[y]=T,h[y]=C}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<p;)o[g]=qv(a[g]);else{const T=qv(a);for(;++g<p;)o[g]=T}g=-1;const S=[],x=[];for(;++g<p;){const T=o[g];let C="",E="";T===99?(C=":",E=":"):T===108?C=":":T===114&&(E=":");let M=r.alignDelimiters===!1?1:Math.max(1,m[g]-C.length-E.length);const H=C+"-".repeat(M)+E;r.alignDelimiters!==!1&&(M=C.length+M+E.length,M>m[g]&&(m[g]=M),x[g]=M),S[g]=H}f.splice(1,0,S),h.splice(1,0,x),y=-1;const k=[];for(;++y<f.length;){const T=f[y],C=h[y],E=r.fillRows===!1?Math.max(1,f[y===1?0:y].length):p;g=-1;const M=[];for(;++g<E;){const H=T[g]||"";let te="",ie="";if(r.alignDelimiters!==!1){const O=m[g]-(C[g]||0),X=o[g];if(X===114)te=" ".repeat(O);else if(X===99){const le=O/2;O%2?(te=" ".repeat(le+.5),ie=" ".repeat(le-.5)):(te=" ".repeat(le),ie=te)}else ie=" ".repeat(O)}r.delimiterStart!==!1&&!g&&M.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&H==="")&&(r.delimiterStart!==!1||g)&&M.push(" "),r.alignDelimiters!==!1&&M.push(te),M.push(H),r.alignDelimiters!==!1&&M.push(ie),r.padding!==!1&&M.push(" "),(r.delimiterEnd!==!1||g!==E-1)&&M.push("|")}k.push(r.delimiterEnd===!1?M.join("").replace(/ +$/,""):M.join(""))}return k.join(`
32
+ `)}function gN(n){return n==null?"":String(n)}function qv(n){const l=typeof n=="string"?n.codePointAt(0):0;return l===67||l===99?99:l===76||l===108?108:l===82||l===114?114:0}const yN=_o(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vN(n,l,r,a){const u=r.enter("blockquote"),o=r.createTracker(a);o.move("> "),o.shift(2);const f=r.indentLines(r.containerFlow(n,o.current()),bN);return u(),f}function bN(n,l,r){return">"+(r?"":" ")+n}function xN(n,l){return Rv(n,l.inConstruct,!0)&&!Rv(n,l.notInConstruct,!1)}function Rv(n,l,r){if(typeof l=="string"&&(l=[l]),!l||l.length===0)return r;let a=-1;for(;++a<l.length;)if(n.includes(l[a]))return!0;return!1}function Mv(n,l,r,a){let u=-1;for(;++u<r.unsafe.length;){const o=r.unsafe[u];if(o.character===`
33
+ `&&!o.before&&!o.after&&xN(r.stack,o))return/[\t ]/.test(a.before)?"":" "}return`\\
34
+ `}function SN(n,l){const r=String(n);let a=r.indexOf(l),u=a,o=0,f=0;if(typeof l!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===u?++o>f&&(f=o):o=1,u=a+l.length,a=r.indexOf(l,u);return f}function wN(n,l){return!!(l.options.fences===!1&&n.value&&!n.lang&&/[^\n\r ]/.test(n.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(n.value))}function kN(n){const l=n.options.fence||"`";if(l!=="`"&&l!=="~")throw new Error("Cannot serialize code with `"+l+"` for `options.fence`, expected `` ` `` or `~`");return l}function EN(n,l,r,a){const u=kN(r),o=n.value||"";if(wN(n,r)){const g=r.enter("codeIndented"),S=r.indentLines(o,TN);return g(),S}const f=r.createTracker(a),h=u.repeat(Math.max(SN(o,u)+1,3)),m=r.enter("codeFenced"),p=u==="`"?"GraveAccent":"Tilde";let y=f.move(h);if(n.lang){const g=r.enter(`codeFencedLang${p}`);y+=f.move(r.safe(n.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(n.lang&&n.meta){const g=r.enter(`codeFencedMeta${p}`);y+=f.move(" "),y+=f.move(r.safe(n.meta,{before:y,after:`
35
+ `,encode:["`"],...f.current()})),g()}return y+=f.move(`
36
+ `),o&&(y+=f.move(o+`
37
+ `)),y+=f.move(h),m(),y}function TN(n,l,r){return(r?"":" ")+n}function jh(n){const l=n.options.quote||'"';if(l!=='"'&&l!=="'")throw new Error("Cannot serialize title with `"+l+"` for `options.quote`, expected `\"`, or `'`");return l}function AN(n,l,r,a){const u=jh(r),o=u==='"'?"Quote":"Apostrophe",f=r.enter("definition");let h=r.enter("label");const m=r.createTracker(a);let p=m.move("[");return p+=m.move(r.safe(r.associationId(n),{before:p,after:"]",...m.current()})),p+=m.move("]: "),h(),!n.url||/[\0- \u007F]/.test(n.url)?(h=r.enter("destinationLiteral"),p+=m.move("<"),p+=m.move(r.safe(n.url,{before:p,after:">",...m.current()})),p+=m.move(">")):(h=r.enter("destinationRaw"),p+=m.move(r.safe(n.url,{before:p,after:n.title?" ":`
38
+ `,...m.current()}))),h(),n.title&&(h=r.enter(`title${o}`),p+=m.move(" "+u),p+=m.move(r.safe(n.title,{before:p,after:u,...m.current()})),p+=m.move(u),h()),f(),p}function CN(n){const l=n.options.emphasis||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize emphasis with `"+l+"` for `options.emphasis`, expected `*`, or `_`");return l}function bo(n){const l=n.codePointAt(0);return l===void 0?"":String.fromCodePoint(l)}function la(n){const l=n.codePointAt(n.length-2);return l!==void 0&&l>65535?n.slice(-2):n.slice(-1)}function E0(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Dv(n,l,r){const a=jl(n),u=jl(l);return a===void 0?u===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===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}}function NN(n){if(n.charCodeAt(0)!==60)return;const l=n.charCodeAt(1);if(l===33){const h=n.charCodeAt(2);return h===45?2:h===91?5:pn(h)?4:void 0}if(l===63)return 3;const r=l===47,a=r?2:1;let u=a,o=n.charCodeAt(u);if(!pn(o))return;for(;o===45||mn(o);)o=n.charCodeAt(++u);const f=n.slice(a,u).toLowerCase();return!r&&o!==47&&Jd.includes(f)?1:o0.includes(f)?6:7}const T0=new Map([["*",!1],["_",!0]]);function jN(n,l,r){const a=new Set;for(const o of n){const f=r.get(o);if(f&&o.attention&&l.some(h=>h.attention===o.attention))for(const h of f.tokens)a.add(h.attention)}const u=[];for(const o of n)o.attention&&a.delete(o.attention)&&u.push(o.attention);return u.reverse(),u}function A0(n,l,r){const a=[],u=new Map,o=new Map;let f=0;for(;f<n.length;){if(!n[f].attention){f++;continue}const h=n[f].value.charAt(0),m=T0.get(h);let p=f+1;for(;p<n.length&&n[p].attention&&n[p].value.charAt(0)===h;)p++;const y=f?n[f-1].value:l,g=jl(y.charCodeAt(y.length-1)),S=jl((p<n.length?n[p].value:r).charCodeAt(0)),x=!S||S===2&&!!g,k=!g||g===2&&!!S,T={tokens:n.slice(f,p),markers:[],start:0,end:0,open:m?x&&(!!g||!k):x,close:m?k&&(!!S||!x):k,split:m!==void 0};for(const C of T.tokens){u.set(C,[...T.tokens]),o.set(C,T);let E=C.value.length;for(;E--;)T.markers.push(C)}T.end=T.markers.length,a.push(T),f=p}for(zN(a,u),f=-1;++f<n.length;){const h=u.get(n[f]);if(h)return{attention:jN(n,h,o),index:f}}}function ao(n,l){const r=n[l?0:n.length-1];if(!r||r.attention)return;const a=l?bo(r.value):la(r.value),u=E0(a.codePointAt(0));if(l)r.value=u+r.value.slice(a.length);else{let o=r.value.slice(0,r.value.length-a.length),f=0;for(;o.charCodeAt(o.length-1-f)===92;)f++;f%2&&(o+="\\"),r.value=o+u}}function ON(n,l,r,a,u){for(const o of r.attention){const f=l.get(o)||o.sequences[0];for(const h of o.sequences){if(h===f)continue;const m=new Map(l);m.set(o,h);const p=Mo(n,m,a,u),y=A0(p,a,u);if(!y||y.index>r.index)return{chosen:m,mistake:y,tokens:p}}}}function zN(n,l){const r=new Map;for(const a of n){const u=a.tokens[0].value.charAt(0);let o=r.get(u);o||(o=[],r.set(u,o));let f=a.close?o.length:0;for(;f--&&a.start<a.end;){const h=o[f],m=h.end-h.start,p=a.end-a.start;if(a.split?(h.close||a.open)&&p%3&&!((m+p)%3):m!==h.markers.length||m!==p)continue;const y=a.split?m>1&&p>1?2:1:p,g=h.markers.slice(h.end-y,h.end),S=a.markers.slice(a.start,a.start+y),x=g[0],k=S[0];if(x===g[y-1]&&x.value.length===y&&k===S[y-1]&&k.value.length===y&&x.attention===k.attention)l.delete(x),l.delete(k);else{const T=[...new Set([...g,...S])];for(const C of T){const E=l.get(C);E&&E.push(...T)}}h.end-=y,a.start+=y,h.start===h.end&&o.splice(f,1),f=o.length}a.open&&a.start<a.end&&o.push(a)}}function _N(n,l,r){if(l.length===0)throw new Error("Cannot serialize `"+n+"` as attention without markers, expected one or more markers");if(r.length===0)throw new Error("Cannot serialize `"+n+"` as attention without sizes, expected one or more sizes");for(const u of r)if(!Number.isSafeInteger(u)||u<1)throw new Error("Cannot serialize `"+n+"` as attention with `"+u+"` as size, expected positive integer");const a=[];for(const u of l){if(u.length!==1)throw new Error("Cannot serialize `"+n+"` as attention with `"+u+"` as marker, expected a single ascii character");if(!e0(u.charCodeAt(0)))throw new Error("Cannot serialize `"+n+"` as attention with `"+u+"` as marker, expected ascii punctuation");for(const o of r)a.push(u.repeat(o))}return a}function qN(n,l,r){const a=l.indexStack,u=n.children||[],o=[];let f=-1,h=r.before;a.push(-1);let m=l.createTracker(r);for(;++f<u.length;){const p=u[f];let y;if(a[a.length-1]=f,f+1<u.length){let x=l.handle.handlers[u[f+1].type];x&&x.peek&&(x=x.peek),y=x?bo(x(u[f+1],n,l,{before:"",after:"",...m.current()})):""}else y=r.after;const g=o[o.length-1];typeof g=="string"&&(h==="\r"||h===`
39
+ `)&&p.type==="html"&&NN(p.value)!==7&&(o[o.length-1]=g.replace(/(\r?\n|\r)$/," "),h=" ",m=l.createTracker(r),m.move(Do(o,r.before,r.after)));const S=l.handle.handlers[p.type];if(S&&S.attention){const x=Oh(p,S.attention,l,m);if(!x)continue;o.push(x),h=la(x.sequences[0])}else{const x=l.handle(p,n,l,{...m.current(),after:y,before:h});if(!x)continue;m.move(x),o.push(x),h=la(x)}}return a.pop(),o}function Oh(n,l,r,a){const{construct:u,markers:o,sizes:f}=l(n,r),h=_N(n.type,o,f),m=h[0],p=r.enter(u),y=r.createTracker(a.current());y.move(m);const g=qN(n,r,{...y.current(),before:m,after:m});if(p(),g.length!==0)return a.move(m),a.move(Do(g,m,m)),a.move(m),{children:g,sequences:h}}function Lv(n,l,r,a){let u=Mo(n,l,r,a),o=A0(u,r,a);for(;o;){const f=ON(n,l,o,r,a);if(!f)return;l=f.chosen,u=f.tokens,o=f.mistake}return u}function C0(n,l,r,a){let u=r,o=-1;for(;++o<n.length;){const f=n[o];if(typeof f=="string"){u="";continue}const h=o===n.length-1?a:"",m=f.sequences.find(function(p){const y=p.charAt(0);return y!==u.charAt(0)&&y!==h.charAt(0)||n.length===1&&T0.has(y)&&p.length>r.length})||f.sequences[0];m!==f.sequences[0]&&l.set(f,m),C0(f.children,l,m,m),u=m}}function Mo(n,l,r,a){const u=[];let o,f=la(r),h=-1;for(;++h<n.length;){const m=n[h];if(typeof m=="string"){const H={value:m,attention:void 0};o&&o===bo(m)&&ao([H],!0),o=void 0,u.push(H),H.value&&(f=la(H.value));continue}const p=l.get(m)||m.sequences[0],y=p.charAt(0),g=n[h+1],S=f,x=bo(g===void 0?a:typeof g=="string"?g:l.get(g)||g.sequences[0]),k=Mo(m.children,l,p,p),T=k[0].value,C=Dv(S.charCodeAt(S.length-1),T.charCodeAt(0),y);C.inside&&ao(k,!0);const E=la(k[k.length-1].value),M=Dv(x.charCodeAt(0),E.charCodeAt(E.length-1),y);M.inside&&ao(k,!1),C.outside&&S!==`
40
+ `&&S!=="\r"&&ao(u,!1),M.outside&&(o=x),u.push({value:p,attention:m},...k,{value:p,attention:m}),f=p.charAt(p.length-1)}return u}function Do(n,l,r){const a=new Map;C0(n,a,l,r);const u=(a.size>0?Lv(n,a,l,r):void 0)||Lv(n,new Map,l,r)||Mo(n,new Map,l,r);let o="";for(const f of u)o+=f.value;return o}zh.attention=N0;zh.peek=RN;function zh(n,l,r,a){const u=r.enter("phrasing"),o=Oh(n,N0,r,r.createTracker(a)),f=o?Do([o],a.before,a.after):"";return u(),f}function N0(n,l){return{construct:"emphasis",markers:CN(l)==="*"?["*","_"]:["_","*"],sizes:[1]}}function RN(n,l,r){return r.options.emphasis||"*"}function MN(n,l){let r=!1;return Ro(n,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return r=!0,gs}),!!((!n.depth||n.depth<3)&&jo(n)&&(l.options.setext||r))}function DN(n,l,r,a){const u=Math.max(Math.min(6,n.depth||1),1),o=r.createTracker(a);if(MN(n,r)){const g=r.enter("headingSetext"),S=r.enter("phrasing"),x=r.containerPhrasing(n,{...o.current(),before:`
41
+ `,after:`
42
+ `});return S(),g(),x+`
43
+ `+(u===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
44
+ `))+1))}const f="#".repeat(u),h=r.enter("headingAtx"),m=r.enter("phrasing");o.move(f+" ");let p=r.containerPhrasing(n,{before:"# ",after:`
45
+ `,...o.current()});const y=p.charCodeAt(0);return(y===9||y===32)&&(p=E0(y)+p.slice(1)),p=p?f+" "+p:f,r.options.closeAtx&&(p+=" "+f),m(),h(),p}j0.peek=LN;function j0(n){return n.value||""}function LN(){return"<"}O0.peek=BN;function O0(n,l,r,a){const u=jh(r),o=u==='"'?"Quote":"Apostrophe",f=r.enter("image");let h=r.enter("label");const m=r.createTracker(a);let p=m.move("![");return p+=m.move(r.safe(n.alt,{before:p,after:"]",...m.current()})),p+=m.move("]("),h(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(h=r.enter("destinationLiteral"),p+=m.move("<"),p+=m.move(r.safe(n.url,{before:p,after:">",...m.current()})),p+=m.move(">")):(h=r.enter("destinationRaw"),p+=m.move(r.safe(n.url,{before:p,after:n.title?" ":")",...m.current()}))),h(),n.title&&(h=r.enter(`title${o}`),p+=m.move(" "+u),p+=m.move(r.safe(n.title,{before:p,after:u,...m.current()})),p+=m.move(u),h()),p+=m.move(")"),f(),p}function BN(){return"!"}z0.peek=UN;function z0(n,l,r,a){const u=n.referenceType,o=r.enter("imageReference");let f=r.enter("label");const h=r.createTracker(a);let m=h.move("![");const p=r.safe(n.alt,{before:m,after:"]",...h.current()});m+=h.move(p+"]["),f();const y=r.stack;r.stack=y.filter(function(S){return S!=="phrasing"}),f=r.enter("reference");const g=r.safe(r.associationId(n),{before:m,after:"]",...h.current()});return f(),r.stack=y,o(),u==="full"||!p||p!==g?m+=h.move(g+"]"):u==="shortcut"?m=m.slice(0,-1):m+=h.move("]"),m}function UN(){return"!"}_0.peek=HN;function _0(n,l,r){let a=n.value||"",u="`",o=-1;for(;new RegExp("(^|[^`])"+u+"([^`]|$)").test(a);)u+="`";for(/[^\n\r ]/.test(a)&&(/^[\n\r ]/.test(a)&&/[\n\r ]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<r.unsafe.length;){const f=r.unsafe[o],h=r.compilePattern(f);if(!f.atBreak)continue;let m;for(;m=h.exec(a);){let p=m.index;a.charCodeAt(p)===10&&a.charCodeAt(p-1)===13&&p--,a=a.slice(0,p)+" "+a.slice(m.index+1)}}return u+a+u}function HN(){return"`"}function q0(n,l){const r=jo(n);return!!(!l.options.resourceLink&&n.url&&!n.title&&n.children&&n.children.length===1&&n.children[0].type==="text"&&(r===n.url||"mailto:"+r===n.url)&&/^[a-z][+\-.a-z]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))}R0.peek=IN;function R0(n,l,r,a){const u=jh(r),o=u==='"'?"Quote":"Apostrophe",f=r.createTracker(a);if(q0(n,r)){const k=r.stack;r.stack=k.filter(function(E){return E!=="phrasing"});const T=r.enter("autolink");let C=f.move("<");return C+=f.move(r.containerPhrasing(n,{before:C,after:">",...f.current()})),C+=f.move(">"),T(),r.stack=k,C}const h=r.enter("link");let m=r.enter("label"),p=f.move("[");const y=r.containerPhrasing(n,{before:p,after:"](",...f.current()});p+=f.move(y),m(),p+=f.move("](");const g=/[\0- \u007F]/.test(n.url),S=a.before.charAt(a.before.length-1);let x=n.title||void 0;if(!x&&!g&&(S===`
46
+ `||S==="\r")){let k=0;for(;k<y.length&&y.charCodeAt(k)!==93;)k+=y.charCodeAt(k)===92?2:1;y.charCodeAt(k+1)===58&&(x="")}return!n.url&&typeof x=="string"||g?(m=r.enter("destinationLiteral"),p+=f.move("<"),p+=f.move(r.safe(n.url,{before:p,after:">",...f.current()})),p+=f.move(">")):(m=r.enter("destinationRaw"),p+=f.move(r.safe(n.url,{before:p,after:typeof x=="string"?" ":")",...f.current()}))),m(),typeof x=="string"&&(m=r.enter(`title${o}`),p+=f.move(" "+u),p+=f.move(r.safe(x,{before:p,after:u,...f.current()})),p+=f.move(u),m()),p+=f.move(")"),h(),p}function IN(n,l,r){return q0(n,r)?"<":"["}M0.peek=VN;function M0(n,l,r,a){const u=n.referenceType,o=r.enter("linkReference");let f=r.enter("label");const h=r.createTracker(a);let m=h.move("[");const p=r.containerPhrasing(n,{before:m,after:"]",...h.current()});m+=h.move(p+"]["),f();const y=r.stack;r.stack=y.filter(function(S){return S!=="phrasing"}),f=r.enter("reference");const g=r.safe(r.associationId(n),{before:m,after:"]",...h.current()});return f(),r.stack=y,o(),u==="full"||!p||p!==g?m+=h.move(g+"]"):u==="shortcut"?m=m.slice(0,-1):m+=h.move("]"),m}function VN(){return"["}function _h(n){const l=n.options.bullet||"*";if(l!=="*"&&l!=="+"&&l!=="-")throw new Error("Cannot serialize items with `"+l+"` for `options.bullet`, expected `*`, `+`, or `-`");return l}function YN(n){const l=_h(n),r=n.options.bulletOther;if(!r)return l==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===l)throw new Error("Expected `bullet` (`"+l+"`) and `bulletOther` (`"+r+"`) to be different");return r}function GN(n){const l=n.options.bulletOrdered||".";if(l!=="."&&l!==")")throw new Error("Cannot serialize items with `"+l+"` for `options.bulletOrdered`, expected `.` or `)`");return l}function D0(n){const l=n.options.rule||"*";if(l!=="*"&&l!=="-"&&l!=="_")throw new Error("Cannot serialize rules with `"+l+"` for `options.rule`, expected `*`, `-`, or `_`");return l}function FN(n,l,r,a){const u=r.enter("list"),o=r.bulletCurrent;let f=n.ordered?GN(r):_h(r);const h=n.ordered?f==="."?")":".":YN(r);let m=l&&r.bulletLastUsed?f===r.bulletLastUsed:!1;if(!n.ordered){const y=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&y&&(!y.children||!y.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(m=!0),D0(r)===f&&y){let g=-1;for(;++g<n.children.length;){const S=n.children[g];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(f=h),r.bulletCurrent=f;const p=r.containerFlow(n,a);return r.bulletLastUsed=f,r.bulletCurrent=o,u(),p}function QN(n){const l=n.options.listItemIndent||"one";if(l!=="tab"&&l!=="one"&&l!=="mixed")throw new Error("Cannot serialize items with `"+l+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return l}function XN(n,l,r,a){const u=QN(r);let o=r.bulletCurrent||_h(r);l&&l.type==="list"&&l.ordered&&(o=(typeof l.start=="number"&&l.start>-1?l.start:1)+(r.options.incrementListMarker===!1?0:l.children.indexOf(n))+o);let f=o.length+1;(u==="tab"||u==="mixed"&&(l&&l.type==="list"&&l.spread||n.spread))&&(f=Math.ceil(f/4)*4);const h=r.createTracker(a);h.move(o+" ".repeat(f-o.length)),h.shift(f);const m=r.enter("listItem"),p=r.indentLines(r.containerFlow(n,h.current()),y);return m(),p;function y(g,S,x){return S?(x?"":" ".repeat(f))+g:(x?o:o+" ".repeat(f-o.length))+g}}function ZN(n,l,r,a){const u=r.enter("paragraph"),o=r.enter("phrasing"),f=r.containerPhrasing(n,a);return o(),u(),f}function KN(n,l,r,a){if(!n.children.some(function(h){return yN(h)}))return r.containerFlow(n,a);const o=r.enter("phrasing"),f=r.containerPhrasing(n,a);return o(),f}function JN(n){const l=n.options.strong||"*";if(l!=="*"&&l!=="_")throw new Error("Cannot serialize strong with `"+l+"` for `options.strong`, expected `*`, or `_`");return l}qh.attention=L0;qh.peek=$N;function qh(n,l,r,a){const u=r.enter("phrasing"),o=Oh(n,L0,r,r.createTracker(a)),f=o?Do([o],a.before,a.after):"";return u(),f}function L0(n,l){return{construct:"strong",markers:JN(l)==="*"?["*","_"]:["_","*"],sizes:[2]}}function $N(n,l,r){return r.options.strong||"*"}function PN(n,l,r,a){const u=l?l.children:[],o=r.indexStack[r.indexStack.length-1];return r.safe(n.value,{...a,afterNode:u[o+1],beforeNode:u[o-1]})}function WN(n){const l=n.options.ruleRepetition||3;if(l<3)throw new Error("Cannot serialize rules with repetition `"+l+"` for `options.ruleRepetition`, expected `3` or more");return l}function e2(n,l,r){const a=(D0(r)+(r.options.ruleSpaces?" ":"")).repeat(WN(r));return r.options.ruleSpaces?a.slice(0,-1):a}const ih={blockquote:vN,break:Mv,code:EN,definition:AN,emphasis:zh,hardBreak:Mv,heading:DN,html:j0,image:O0,imageReference:z0,inlineCode:_0,link:R0,linkReference:M0,list:FN,listItem:XN,paragraph:ZN,root:KN,strong:qh,text:PN,thematicBreak:e2};function t2(){return{enter:{table:n2,tableData:Bv,tableHeader:Bv,tableRow:l2},exit:{codeText:r2,table:i2,tableData:qd,tableHeader:qd,tableRow:qd}}}function n2(n){const l=n._align;this.enter({type:"table",align:l.map(function(r){return r==="none"?null:r}),children:[],position:void 0},n),this.data.inTable=!0}function i2(n){this.exit(n),this.data.inTable=void 0}function l2(n){this.enter({type:"tableRow",children:[],position:void 0},n)}function qd(n){this.exit(n)}function Bv(n){this.enter({type:"tableCell",children:[],position:void 0},n)}function r2(n){let l=this.resume();this.data.inTable&&(l=l.replace(/\\([\\|])/g,a2));const r=this.stack[this.stack.length-1];r.type,r.value=l,this.exit(n)}function a2(n,l){return l==="|"?l:n}function s2(n){const l=n||{},{tableCellPadding:r,tablePipeAlign:a,stringLength:u}=l,o=r?" ":"|";return{handlers:{inlineCode:S,table:f,tableCell:m,tableRow:h},join:[u2],unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
47
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}]};function f(x,k,T,C){const E=y(x,T,C),M=E[0];if(M){let H=x.align?x.align.length:0,te=-1;if(!H)for(;++te<E.length;)E[te].length>H&&(H=E[te].length);for(;M.length<H;)M.push("")}return p(E,x.align)}function h(x,k,T,C){const E=g(x,T,C),M=p([E]);return M.slice(0,M.indexOf(`
48
+ `))}function m(x,k,T,C){const E=T.enter("tableCell"),M=T.enter("phrasing"),H=T.containerPhrasing(x,{...C,before:o,after:o});return M(),E(),H}function p(x,k){return mN(x,{align:k,alignDelimiters:a,fillRows:!1,padding:r,stringLength:u})}function y(x,k,T){const{children:C}=x;let E=-1;const M=[],H=k.enter("table");for(;++E<C.length;)M[E]=g(C[E],k,T);return H(),M}function g(x,k,T){const{children:C}=x;let E=-1;const M=[],H=k.enter("tableRow");for(;++E<C.length;)M[E]=m(C[E],x,k,T);return H(),M}function S(x,k,T){const C=ih.inlineCode(x,k,T);if(!T.stack.includes("tableCell"))return C;const E=[];let M=0,H=C.indexOf("|");for(;H!==-1;){let te=H;for(;te>M&&C.charCodeAt(te-1)===92;)te--;E.push(C.slice(M,H)),(H-te)%2===0&&E.push("\\"),M=H,H=C.indexOf("|",H+1)}return E.push(C.slice(M)),E.join("")}}function u2(n,l,r,a){if(n.type==="table"&&r.type==="listItem"&&r.spread===!1&&(l.type==="definition"||l.type==="heading"&&o2(l,a)||l.type==="paragraph"||l.type==="table"))return 1}function o2(n,l){let r=!1;return Ro(n,function(a){if(a.type==="break"||"value"in a&&/\r?\n|\r/.test(a.value))return r=!0,gs}),!!((!n.depth||n.depth<3)&&jo(n)&&(l.options.setext||r))}function c2(){return{exit:{taskListCheckValueChecked:Uv,taskListCheckValueUnchecked:Uv,paragraph:d2}}}function f2(){return{handlers:{paragraph:h2},join:[p2]}}function Uv(n){const l=this.stack[this.stack.length-2];l.type,l.checked=n.type==="taskListCheckValueChecked"}function d2(n){const l=this.stack[this.stack.length-2];if(l&&l.type==="listItem"&&typeof l.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const a=r.children[0];if(a&&a.type==="text"){const u=l.children;let o=-1,f;for(;++o<u.length;){const h=u[o];if(h.type==="paragraph"){f=h;break}}f===r&&(a.value=a.value.slice(1),a.value.length===0?r.children.shift():r.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,r.position.start={...a.position.start}))}}this.exit(n)}function h2(n,l,r,a){if(!l||l.type!=="listItem"||B0(l)!==n)return ih.paragraph(n,l,r,a);const u="["+(l.checked?"x":" ")+"] ",o=r.createTracker(a);o.move(u);const f=ih.paragraph(n.children.length>0?n:{type:"paragraph",children:[{type:"text",value:" "}]},l,r,{...a,...o.current()});return u+f}function p2(n,l,r){if(!(n.type==="definition"&&r.type==="listItem"))return;const a=B0(r);if(a&&r.children.indexOf(n)<r.children.indexOf(a))return 0}function B0(n){if(typeof n.checked=="boolean")for(const l of n.children){if(l.type==="paragraph")return l;if(l.type!=="definition")return}}function m2(){return[RC(),lN(),uN(),t2(),c2()]}function g2(n){return{extensions:[MC(),rN(n),oN(),s2(n),f2()]}}const y2={tokenize:k2,partial:!0},U0={tokenize:E2,partial:!0},H0={tokenize:T2,partial:!0},I0={tokenize:A2,partial:!0},v2={tokenize:C2,partial:!0},V0={name:"wwwAutolink",tokenize:S2,previous:G0},Y0={name:"protocolAutolink",tokenize:w2,previous:F0},Ji={name:"emailAutolink",tokenize:x2,previous:Q0},zi={};function b2(){return{text:zi}}let lr=48;for(;lr<123;)zi[lr]=Ji,lr++,lr===58?lr=65:lr===91&&(lr=97);zi[43]=Ji;zi[45]=Ji;zi[46]=Ji;zi[95]=Ji;zi[72]=[Ji,Y0];zi[104]=[Ji,Y0];zi[87]=[Ji,V0];zi[119]=[Ji,V0];function x2(n,l,r){const a=this;let u,o;return f;function f(g){return!lh(g)||!Q0.call(a,a.previous)||Rh(a.events)?r(g):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),h(g))}function h(g){return lh(g)?(n.consume(g),h):g===64?(n.consume(g),m):r(g)}function m(g){return g===46?n.check(v2,y,p)(g):g===45||g===95||mn(g)?(o=!0,n.consume(g),m):y(g)}function p(g){return n.consume(g),u=!0,m}function y(g){return o&&u&&pn(a.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),l(g)):r(g)}}function S2(n,l,r){const a=this;return u;function u(f){return f!==87&&f!==119||!G0.call(a,a.previous)||Rh(a.events)?r(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(y2,n.attempt(U0,n.attempt(H0,o),r),r)(f))}function o(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),l(f)}}function w2(n,l,r){const a=this;let u="",o=!1;return f;function f(g){return(g===72||g===104)&&F0.call(a,a.previous)&&!Rh(a.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),u+=String.fromCodePoint(g),n.consume(g),h):r(g)}function h(g){if(pn(g)&&u.length<5)return u+=String.fromCodePoint(g),n.consume(g),h;if(g===58){const S=u.toLowerCase();if(S==="http"||S==="https")return n.consume(g),m}return r(g)}function m(g){return g===47?(n.consume(g),o?p:(o=!0,m)):r(g)}function p(g){return g===null||mo(g)||Nt(g)||cr(g)||As(g)?r(g):n.attempt(U0,n.attempt(H0,y),r)(g)}function y(g){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),l(g)}}function k2(n,l,r){let a=0;return u;function u(f){return(f===87||f===119)&&a<3?(a++,n.consume(f),u):f===46&&a===3?(n.consume(f),o):r(f)}function o(f){return f===null?r(f):l(f)}}function E2(n,l,r){let a,u,o;return f;function f(p){return p===46||p===95?n.check(I0,m,h)(p):p===null||Nt(p)||cr(p)||p!==45&&As(p)?m(p):(o=!0,n.consume(p),f)}function h(p){return p===95?a=!0:(u=a,a=void 0),n.consume(p),f}function m(p){return u||a||!o?r(p):l(p)}}function T2(n,l){let r=0,a=0;return u;function u(f){return f===40?(r++,n.consume(f),u):f===41&&a<r?o(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?n.check(I0,l,o)(f):f===null||Nt(f)||cr(f)?l(f):(n.consume(f),u)}function o(f){return f===41&&a++,n.consume(f),u}}function A2(n,l,r){return a;function a(h){return h===33||h===34||h===39||h===41||h===42||h===44||h===46||h===58||h===59||h===63||h===95||h===126?(n.consume(h),a):h===38?(n.consume(h),o):h===93?(n.consume(h),u):h===60||h===null||Nt(h)||cr(h)?l(h):r(h)}function u(h){return h===null||h===40||h===91||Nt(h)||cr(h)?l(h):a(h)}function o(h){return pn(h)?f(h):r(h)}function f(h){return h===59?(n.consume(h),a):pn(h)?(n.consume(h),f):r(h)}}function C2(n,l,r){return a;function a(o){return n.consume(o),u}function u(o){return mn(o)?r(o):l(o)}}function G0(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||Nt(n)}function F0(n){return!pn(n)}function Q0(n){return!(n===47||lh(n))}function lh(n){return n===43||n===45||n===46||n===95||mn(n)}function Rh(n){let l=n.length,r=!1;for(;l--;){const a=n[l][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){r=!0;break}if(a._gfmAutolinkLiteralWalkedInto){r=!1;break}}return n.length>0&&!r&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const N2={tokenize:D2,partial:!0};function j2(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:q2,continuation:{tokenize:R2},exit:M2}},text:{91:{name:"gfmFootnoteCall",tokenize:_2},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:O2,resolveTo:z2}}}}function O2(n,l,r){const a=this;let u=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let f;for(;u--;){const m=a.events[u][1];if(m.type==="labelImage"){f=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return h;function h(m){if(!f||!f._balanced)return r(m);const p=hi(a.sliceSerialize({start:f.end,end:a.now()}));return p.codePointAt(0)!==94||!o.includes(p.slice(1))?r(m):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(m),n.exit("gfmFootnoteCallLabelMarker"),l(m))}}function z2(n,l){let r=n.length;for(;r--;)if(n[r][1].type==="labelImage"&&n[r][0]==="enter"){n[r][1];break}n[r+1][1].type="data",n[r+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},n[r+3][1].start),end:Object.assign({},n[n.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},n[r+3][1].end),end:Object.assign({},n[r+3][1].end)};u.end.column++,u.end.offset++,u.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},u.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},h=[n[r+1],n[r+2],["enter",a,l],n[r+3],n[r+4],["enter",u,l],["exit",u,l],["enter",o,l],["enter",f,l],["exit",f,l],["exit",o,l],n[n.length-2],n[n.length-1],["exit",a,l]];return n.splice(r,n.length-r+1,...h),n}function _2(n,l,r){const a=this,u=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,f;return h;function h(g){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?r(g):(n.enter("gfmFootnoteCallMarker"),n.consume(g),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",p)}function p(g){if(o>999||g===93&&!f||g===null||g===91||Nt(g))return r(g);if(g===93){n.exit("chunkString");const S=n.exit("gfmFootnoteCallString");return u.includes(hi(a.sliceSerialize(S)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),l):r(g)}return Nt(g)||(f=!0),o++,n.consume(g),g===92?y:p}function y(g){return g===91||g===92||g===93?(n.consume(g),o++,p):p(g)}}function q2(n,l,r){const a=this,u=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,f=0,h;return m;function m(k){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(k){return k===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",y):r(k)}function y(k){if(f>999||k===93&&!h||k===null||k===91||Nt(k))return r(k);if(k===93){n.exit("chunkString");const T=n.exit("gfmFootnoteDefinitionLabelString");return o=hi(a.sliceSerialize(T)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),S}return Nt(k)||(h=!0),f++,n.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(n.consume(k),f++,y):y(k)}function S(k){return k===58?(n.enter("definitionMarker"),n.consume(k),n.exit("definitionMarker"),u.includes(o)||u.push(o),ct(n,x,"gfmFootnoteDefinitionWhitespace")):r(k)}function x(k){return l(k)}}function R2(n,l,r){return n.check(Cs,l,n.attempt(N2,l,r))}function M2(n){n.exit("gfmFootnoteDefinition")}function D2(n,l,r){const a=this;return ct(n,u,"gfmFootnoteDefinitionIndent",5);function u(o){const f=a.events[a.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?l(o):r(o)}}function L2(n){let r=(n||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:u};return r==null&&(r=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function u(f,h){let m=-1;for(;++m<f.length;)if(f[m][0]==="enter"&&f[m][1].type==="strikethroughSequenceTemporary"&&f[m][1]._close){let p=m;for(;p--;)if(f[p][0]==="exit"&&f[p][1].type==="strikethroughSequenceTemporary"&&f[p][1]._open&&f[m][1].end.offset-f[m][1].start.offset===f[p][1].end.offset-f[p][1].start.offset){f[m][1].type="strikethroughSequence",f[p][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},f[p][1].start),end:Object.assign({},f[m][1].end)},g={type:"strikethroughText",start:Object.assign({},f[p][1].end),end:Object.assign({},f[m][1].start)},S=[["enter",y,h],["enter",f[p][1],h],["exit",f[p][1],h],["enter",g,h]],x=h.parser.constructs.insideSpan.null;x&&di(S,S.length,0,Oo(x,f.slice(p+1,m),h)),di(S,S.length,0,[["exit",g,h],["enter",f[m][1],h],["exit",f[m][1],h],["exit",y,h]]),di(f,p-1,m-p+3,S),m=p+S.length-2;break}}for(m=-1;++m<f.length;)f[m][1].type==="strikethroughSequenceTemporary"&&(f[m][1].type="data");return f}function o(f,h,m){const p=this.previous,y=this.events;let g=0;return S;function S(k){return p===126&&y[y.length-1][1].type!=="characterEscape"?m(k):(f.enter("strikethroughSequenceTemporary"),x(k))}function x(k){const T=jl(p);if(k===126)return g>1?m(k):(f.consume(k),g++,x);if(g<2&&!r)return m(k);const C=f.exit("strikethroughSequenceTemporary"),E=jl(k);return C._open=!E||E===2&&!!T,C._close=!T||T===2&&!!E,h(k)}}}class B2{constructor(){this.map=[],this.index=new Map}add(l,r,a){U2(this,l,r,a)}consume(l){if(this.map.sort(function(o,f){return o[0]-f[0]}),this.map.length===0)return;let r=this.map.length;const a=[];for(;r>0;)r-=1,a.push(l.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),l.length=this.map[r][0];a.push(l.slice()),l.length=0;let u=a.pop();for(;u;){for(const o of u)l.push(o);u=a.pop()}this.map.length=0,this.index.clear()}}function U2(n,l,r,a){if(r===0&&a.length===0)return;const u=n.index.get(l);if(u){u[1]+=r,u[2].push(...a);return}const o=[l,r,a];n.map.push(o),n.index.set(l,o)}function H2(n,l){let r=!1;const a=[];for(;l<n.length;){const u=n[l];if(r){if(u[0]==="enter")u[1].type==="tableContent"&&a.push(n[l+1][1].type==="tableDelimiterMarker"?"left":"none");else if(u[1].type==="tableContent"){if(n[l-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(u[1].type==="tableDelimiterRow")break}else u[0]==="enter"&&u[1].type==="tableDelimiterRow"&&(r=!0);l+=1}return a}function I2(){return{flow:{null:{name:"table",tokenize:V2,resolveAll:Y2}}}}function V2(n,l,r){const a=this;let u=0,o=0,f;return h;function h(_){let K=a.events.length-1;for(;K>-1;){const{type:qe}=a.events[K][1];if(qe==="lineEnding"||qe==="linePrefix")K--;else break}const ee=K>-1?a.events[K][1].type:null,Ee=ee==="tableHead"||ee==="tableRow"?O:m;return Ee===O&&a.parser.lazy[a.now().line]?r(_):Ee(_)}function m(_){return n.enter("tableHead"),n.enter("tableRow"),p(_)}function p(_){return _===124||(f=!0,o+=1),y(_)}function y(_){return _===null?r(_):ze(_)?o>1?(o=0,a.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(_),n.exit("lineEnding"),x):r(_):Ge(_)?ct(n,y,"whitespace")(_):(o+=1,f&&(f=!1,u+=1),_===124?(n.enter("tableCellDivider"),n.consume(_),n.exit("tableCellDivider"),f=!0,y):(n.enter("data"),g(_)))}function g(_){return _===null||_===124||Nt(_)?(n.exit("data"),y(_)):(n.consume(_),_===92?S:g)}function S(_){return _===92||_===124?(n.consume(_),g):g(_)}function x(_){return a.interrupt=!1,a.parser.lazy[a.now().line]?r(_):(n.enter("tableDelimiterRow"),f=!1,Ge(_)?ct(n,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):k(_))}function k(_){return _===45||_===58?C(_):_===124?(f=!0,n.enter("tableCellDivider"),n.consume(_),n.exit("tableCellDivider"),T):ie(_)}function T(_){return Ge(_)?ct(n,C,"whitespace")(_):C(_)}function C(_){return _===58?(o+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(_),n.exit("tableDelimiterMarker"),E):_===45?(o+=1,E(_)):_===null||ze(_)?te(_):ie(_)}function E(_){return _===45?(n.enter("tableDelimiterFiller"),M(_)):ie(_)}function M(_){return _===45?(n.consume(_),M):_===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(_),n.exit("tableDelimiterMarker"),H):(n.exit("tableDelimiterFiller"),H(_))}function H(_){return Ge(_)?ct(n,te,"whitespace")(_):te(_)}function te(_){return _===124?k(_):_===null||ze(_)?!f||u!==o?ie(_):(n.exit("tableDelimiterRow"),n.exit("tableHead"),l(_)):ie(_)}function ie(_){return r(_)}function O(_){return n.enter("tableRow"),X(_)}function X(_){return _===124?(n.enter("tableCellDivider"),n.consume(_),n.exit("tableCellDivider"),X):_===null||ze(_)?(n.exit("tableRow"),l(_)):Ge(_)?ct(n,X,"whitespace")(_):(n.enter("data"),le(_))}function le(_){return _===null||_===124||Nt(_)?(n.exit("data"),X(_)):(n.consume(_),_===92?me:le)}function me(_){return _===92||_===124?(n.consume(_),le):le(_)}}function Y2(n,l){let r=-1,a=!0,u=0,o=[0,0,0,0],f=[0,0,0,0],h=!1,m=0,p,y,g;const S=new B2;for(;++r<n.length;){const x=n[r],k=x[1];x[0]==="enter"?k.type==="tableHead"?(h=!1,m!==0&&(Hv(S,l,m,p,y),y=void 0,m=0),p={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},S.add(r,0,[["enter",p,l]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(a=!0,g=void 0,o=[0,0,0,0],f=[0,r+1,0,0],h&&(h=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},S.add(r,0,[["enter",y,l]])),u=k.type==="tableDelimiterRow"?2:y?3:1):u&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(a=!1,f[2]===0&&(o[1]!==0&&(f[0]=f[1],g=so(S,l,o,u,void 0,g),o=[0,0,0,0]),f[2]=r)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(f[0]=f[1],g=so(S,l,o,u,void 0,g)),o=f,f=[o[1],r,0,0])):k.type==="tableHead"?(h=!0,m=r):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=r,o[1]!==0?(f[0]=f[1],g=so(S,l,o,u,r,g)):f[1]!==0&&(g=so(S,l,f,u,r,g)),u=0):u&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(f[3]=r)}for(m!==0&&Hv(S,l,m,p,y),S.consume(l.events),r=-1;++r<l.events.length;){const x=l.events[r];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=H2(l.events,r))}return n}function so(n,l,r,a,u,o){const f=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",h="tableContent";r[0]!==0&&(o.end=Object.assign({},na(l.events,r[0])),n.add(r[0],0,[["exit",o,l]]));const m=na(l.events,r[1]);if(o={type:f,start:Object.assign({},m),end:Object.assign({},m)},n.add(r[1],0,[["enter",o,l]]),r[2]!==0){const p=na(l.events,r[2]),y=na(l.events,r[3]),g={type:h,start:Object.assign({},p),end:Object.assign({},y)};if(n.add(r[2],0,[["enter",g,l]]),a!==2){const S=l.events[r[2]],x=l.events[r[3]];if(S[1].end=Object.assign({},x[1].end),S[1].type="chunkText",S[1].contentType="text",r[3]>r[2]+1){const k=r[2]+1,T=r[3]-r[2]-1;n.add(k,T,[])}}n.add(r[3]+1,0,[["exit",g,l]])}return u!==void 0&&(o.end=Object.assign({},na(l.events,u)),n.add(u,0,[["exit",o,l]]),o=void 0),o}function Hv(n,l,r,a,u){const o=[],f=na(l.events,r);u&&(u.end=Object.assign({},f),o.push(["exit",u,l])),a.end=Object.assign({},f),o.push(["exit",a,l]),n.add(r+1,0,o)}function na(n,l){const r=n[l],a=r[0]==="enter"?"start":"end";return r[1][a]}const G2={name:"tasklistCheck",tokenize:Q2};function F2(){return{text:{91:G2}}}function Q2(n,l,r){const a=this;return u;function u(m){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?r(m):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(m),n.exit("taskListCheckMarker"),o)}function o(m){return Nt(m)?(n.enter("taskListCheckValueUnchecked"),n.consume(m),n.exit("taskListCheckValueUnchecked"),f):m===88||m===120?(n.enter("taskListCheckValueChecked"),n.consume(m),n.exit("taskListCheckValueChecked"),f):r(m)}function f(m){return m===93?(n.enter("taskListCheckMarker"),n.consume(m),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),h):r(m)}function h(m){return ze(m)?l(m):Ge(m)?n.check({tokenize:X2},l,r)(m):r(m)}}function X2(n,l,r){return ct(n,a,"whitespace");function a(u){return u===null?r(u):l(u)}}function Z2(n){return Pb([b2(),j2(),L2(n),I2(),F2()])}const K2={};function J2(n){const l=this,r=n||K2,a=l.data(),u=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),f=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);u.push(Z2(r)),o.push(m2()),f.push(g2(r))}function X0(n=128){const l=new Set,r=new Set,a=()=>{for(const u of r)u()};return{has:u=>l.has(u),fail(u){l.has(u)||u.length>4096||(l.add(u),l.size>n&&l.delete(l.values().next().value),a())},retry(u){l.delete(u)&&a()},subscribe(u){return r.add(u),()=>{r.delete(u)}}}}const Z0=z.createContext(null);function $2({children:n}){const[l]=z.useState(X0);return v.jsx(Z0.Provider,{value:l,children:n})}function P2({src:n,alt:l="",title:r}){const{t:a}=Je(),u=z.useContext(Z0),[o]=z.useState(X0),f=u??o,h=z.useSyncExternalStore(f.subscribe,()=>f.has(n??""),()=>!1),[m,p]=z.useState(null),y=h||m===n,[g,S]=z.useState(!1),[x,k]=z.useState(!1),T=z.useRef(null),C=z.useRef(null),E=z.useRef(null),M=z.useRef(null),H=l||a("image.untitled");z.useEffect(()=>{if(!g||y)return;const O=document.activeElement instanceof HTMLElement?document.activeElement:null,X=document.body.style.overflow;document.body.style.overflow="hidden",C.current?.focus();const le=_=>{if(_.key==="Escape"&&(_.preventDefault(),_.stopPropagation(),S(!1)),_.key!=="Tab")return;const K=[...T.current?.querySelectorAll('button, [href], [tabindex="0"]')??[]],ee=K[0],Ee=K.at(-1);_.shiftKey&&(document.activeElement===ee||!T.current?.contains(document.activeElement))?(_.preventDefault(),Ee?.focus()):!_.shiftKey&&(document.activeElement===Ee||!T.current?.contains(document.activeElement))&&(_.preventDefault(),ee?.focus())},me=_=>{T.current?.contains(_.target)||C.current?.focus()};return document.addEventListener("keydown",le,!0),document.addEventListener("focusin",me),()=>{document.removeEventListener("keydown",le,!0),document.removeEventListener("focusin",me),document.body.style.overflow=X,O?.isConnected?O.focus():E.current?.focus()}},[g,y]),z.useEffect(()=>{k(!1),S(!1)},[n]);function te(){k(O=>!O),M.current&&(M.current.scrollLeft=0,M.current.scrollTop=0)}function ie(){n&&(f.fail(n),p(n)),S(!1)}if(!n||y){const O=n?.split(/[?#]/)[0]?.split("/").at(-1);return v.jsxs("span",{className:"image-unavailable",role:"status",children:[v.jsx("strong",{children:l||O||a("image.untitled")}),v.jsx("span",{children:a("image.unavailable")}),n&&v.jsx("button",{ref:E,type:"button",onClick:()=>{S(!1),p(null),f.retry(n)},children:a("image.retry")})]})}return v.jsxs(v.Fragment,{children:[v.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":a("image.open",{name:H}),"aria-haspopup":"dialog","aria-expanded":g,title:a("image.open",{name:H}),onClick:()=>{k(!1),S(!0)},children:[v.jsx("img",{className:"image-preview-thumbnail",src:n,alt:l,title:r,loading:"lazy",onError:ie}),v.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a("image.enlarge")})]}),g&&ph.createPortal(v.jsx("div",{className:"image-lightbox",onClick:O=>{O.target===O.currentTarget&&S(!1)},children:v.jsxs("div",{ref:T,className:"image-lightbox-dialog",role:"dialog","aria-modal":"true","aria-label":H,children:[v.jsxs("header",{className:"image-lightbox-toolbar",children:[v.jsx("span",{className:"image-lightbox-name",title:H,children:H}),v.jsx("button",{type:"button",onClick:te,"aria-pressed":x,children:a(x?"image.fit":"image.original")}),v.jsx("button",{ref:C,type:"button",onClick:()=>S(!1),"aria-label":a("image.close"),children:a("image.close")})]}),v.jsx("div",{ref:M,className:x?"image-lightbox-stage original":"image-lightbox-stage",tabIndex:0,role:"region","aria-label":a(x?"image.scroll":"image.fit"),children:v.jsx("img",{src:n,alt:l,title:r,draggable:!1,onError:ie})})]})}),document.body)]})}function W2({text:n,language:l}){const[r,a]=z.useState(!1);return v.jsxs("div",{className:"code-block",children:[v.jsxs("div",{className:"code-banner",children:[v.jsx("span",{className:"code-lang",children:l||"Code block"}),v.jsx("button",{type:"button",className:"code-copy","aria-label":r?"Copied":"Copy",onClick:()=>{navigator.clipboard.writeText(n).then(()=>{a(!0),window.setTimeout(()=>a(!1),1e3)})},children:r?"Copied":"Copy"})]}),v.jsx("pre",{children:v.jsx("code",{children:n})})]})}function ej({children:n}){const l=z.Children.toArray(n)[0];if(z.isValidElement(l)){const r=l,a=String(r.props.children??"").replace(/\n$/,""),u=/language-([\w-]+)/.exec(r.props.className??"");return v.jsx(W2,{text:a,language:u?.[1]})}return v.jsx("pre",{children:n})}function tj(n){if(!n||/^[a-z][a-z0-9+.-]*:/i.test(n)||n.startsWith("#")||n.startsWith("//")||n.startsWith("?"))return null;const l=n.indexOf("#"),r=l<0?n:n.slice(0,l);if(r.includes("?"))return null;let a;try{a=decodeURIComponent(r)}catch{return null}const u=/:(\d+)$/.exec(a);if(u&&(a=a.slice(0,-u[0].length)),!a||/[\u0000-\u001f\\]/.test(a)||a.split("/").includes(".."))return null;const o=u?Number(u[1]):void 0;return o!=null&&Number.isSafeInteger(o)&&o>0?{path:a,line:o}:{path:a}}const rh=z.createContext({streaming:!1}),nj={pre:ej,img({src:n,alt:l,title:r}){const{resolveImage:a}=z.useContext(rh),u=typeof n=="string"?a?.(n):void 0,o=typeof n=="string"&&n!==""&&!/^(?:[a-z][a-z0-9+.-]*:|\/|#|\?)/i.test(n);return v.jsx(P2,{src:u??(o?`/dsh-bot/${n.replace(/^\.\//,"")}`:n||void 0),alt:l,title:r})},code({className:n,children:l}){return v.jsx("code",{className:n,children:l})},table({children:n}){return v.jsx("div",{className:"table-scroll",children:v.jsx("table",{children:n})})},a({href:n,children:l,node:r}){const{streaming:a,onOpenFile:u}=z.useContext(rh),{t:o}=Je();if(r?.children.some(h=>h.type==="element"&&h.tagName==="img"))return v.jsxs("span",{className:"image-preview-linked",children:[l,v.jsx("a",{href:n,target:"_blank",rel:"noreferrer",children:o("image.openLink")})]});const f=a?null:tj(n);return f&&u?v.jsx("button",{type:"button",className:"file-mention",title:f.path,onClick:()=>u(f.path,f.line),children:l}):v.jsx("a",{href:n,target:"_blank",rel:"noreferrer",children:l})}};function ij(n,l){if(!l)return n;const r=n.match(/```/g);return r&&r.length%2===1?`${n}
49
+ \`\`\``:n}function js({text:n,streaming:l=!1,onOpenFile:r,resolveImage:a}){const u=z.useMemo(()=>({streaming:l,onOpenFile:r,resolveImage:a}),[l,r,a]);return v.jsx(rh.Provider,{value:u,children:v.jsx("div",{className:l?"markdown streaming":"markdown",children:v.jsx(EC,{remarkPlugins:[J2],components:nj,children:ij(n,l)})})})}const lj=z.lazy(()=>uk(()=>import("./SourceEditor-Cu3oRqA0.js").then(n=>n.S),__vite__mapDeps([0,1]))),rj=50*1024*1024,K0="dsh-bot.files-drawer-width";function aj(){try{const n=localStorage.getItem(K0);return n==null||n===""?Id:Vd(Number(n))}catch{return Id}}function sj(n){try{localStorage.setItem(K0,String(n))}catch{}}function uj({open:n,sessionId:l,focus:r,onClose:a}){const{t:u}=Je(),[o,f]=z.useState(null),[h,m]=z.useState("workspace"),[p,y]=z.useState(""),[g,S]=z.useState([]),[x,k]=z.useState("loading"),[T,C]=z.useState(""),[E,M]=z.useState(null),[H,te]=z.useState(0),[ie,O]=z.useState(aj),X=z.useRef(ie),[le,me]=z.useState(!1),[_,K]=z.useState(()=>window.innerWidth),[ee,Ee]=z.useState(()=>window.matchMedia("(max-width: 800px)").matches),[qe,re]=z.useState(n),[F,ue]=z.useState(n?"in":"out"),[ce,Te]=z.useState(),[N,lt]=z.useState(""),[pt,R]=z.useState(!1),[q,ne]=z.useState(null),[fe,ye]=z.useState(!1),[Ce,je]=z.useState(!1),[we,J]=z.useState(null),[he,ut]=z.useState(""),Et=z.useRef(0),ke=z.useRef(null),dt=z.useRef(""),$e=z.useRef(!0),Ie=z.useRef(0),Re=z.useRef(r),st=z.useRef(qe),mt=z.useRef(F),It=z.useRef(!1);Re.current=r,st.current=qe,mt.current=F,z.useEffect(()=>()=>{$e.current=!1,dt.current&&URL.revokeObjectURL(dt.current)},[]),z.useEffect(()=>{if(n){re(!0),ue("in");return}if(st.current){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){re(!1);return}ue("out")}},[n]),z.useEffect(()=>{const G=window.matchMedia("(max-width: 800px)"),se=()=>Ee(G.matches);return G.addEventListener("change",se),()=>G.removeEventListener("change",se)},[]),z.useEffect(()=>{const G=()=>K(window.innerWidth);return window.addEventListener("resize",G),()=>window.removeEventListener("resize",G)},[]);const Mt=Vd(ie);z.useLayoutEffect(()=>{const G=document.documentElement,se=Xe=>{G.style.setProperty("--files-inset",`${Xe.inset}px`),G.style.setProperty("--files-inset-right",`${Xe.insetRight}px`),G.style.setProperty("--files-reserve",`${Xe.reserve}px`),G.style.setProperty("--files-sidebar",`${Xe.sidebar}px`)};if(!qe||ee){It.current=!1,G.classList.remove("files-push","files-closing","files-resizing"),se(no(0));return}const Pe=F==="out"?no(_):Jy(_,Mt);if(G.classList.add("files-push"),G.classList.toggle("files-closing",F==="out"),G.classList.toggle("files-resizing",le),!It.current&&F!=="out"){It.current=!0,G.classList.add("files-resizing"),se(no(_));let Xe=!1;const xt=requestAnimationFrame(()=>{if(Xe=!0,G.classList.remove("files-resizing"),!st.current)return;const St=mt.current==="out"?no(window.innerWidth):Jy(window.innerWidth,Mt);se(St)});return()=>{cancelAnimationFrame(xt),Xe||(It.current=!1)}}It.current=!0,se(Pe)},[qe,ee,F,Mt,le,_]),z.useEffect(()=>()=>{const G=document.documentElement;G.classList.remove("files-push","files-closing","files-resizing"),G.style.setProperty("--files-inset","0px"),G.style.setProperty("--files-inset-right","0px"),G.style.setProperty("--files-reserve","0px"),G.style.setProperty("--files-sidebar","268px")},[]),z.useEffect(()=>{const G=se=>{if(se.key==="Escape"){if(q&&we==null){ne(null);return}a()}};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[a,q,we]),z.useEffect(()=>{if(!n)return;const G=new AbortController;return f(null),Re.current||(y(""),M(null),C("")),tt(`/files/roots?sessionId=${encodeURIComponent(l)}`,{signal:G.signal}).then(se=>{if(G.signal.aborted)return;const Pe=typeof se.body.workspace=="string"?se.body.workspace:null,Xe=typeof se.body.home=="string"?se.body.home:null,xt=typeof se.body.workspaceReason=="string"?se.body.workspaceReason:"";f({workspace:Pe,workspaceReason:xt,home:Xe}),!Re.current&&(Pe?(m("workspace"),y(Pe)):Xe?(m("home"),y(Xe)):(k("error"),C(u(xt==="overlap"?"files.overlap":"files.missing"))))}).catch(()=>{G.signal.aborted||(k("error"),C(u("files.failed")))}),()=>G.abort()},[n,l,u]),z.useEffect(()=>{if(!n||!r||!o)return;const G=cj(o.workspace,r.path);if(!G){k("error"),C(o.workspaceReason==="overlap"?u("files.overlap"):u("files.missing"));return}const se=++Ie.current,Pe=new AbortController,Xe=G.split("/").filter(Boolean).at(-1)??G,xt=fj(G,o.workspace,o.home);return Te(r.line),C(""),xt&&m(xt),tt(`/files?sessionId=${encodeURIComponent(l)}&path=${encodeURIComponent(G)}`,{signal:Pe.signal}).then(St=>{if(!(se!==Ie.current||!$e.current)){if(St.status===200&&Array.isArray(St.body.items)){Te(void 0),lt(""),M(null),k("loading"),(St.body.root==="workspace"||St.body.root==="home")&&m(St.body.root),y(typeof St.body.path=="string"?St.body.path:G);return}return lt(G),y(dj(G)),ae(G,Xe,0,se)}}).catch(()=>{se!==Ie.current||!$e.current||Pe.signal.aborted||M({kind:"error",path:G,name:Xe})}),()=>Pe.abort()},[n,r,o,l,u]),z.useEffect(()=>{if(!p)return;const G=new AbortController;return k("loading"),C(""),tt(`/files?sessionId=${encodeURIComponent(l)}&path=${encodeURIComponent(p)}`,{signal:G.signal}).then(se=>{if(G.signal.aborted)return;if(se.status!==200||!Array.isArray(se.body.items)){S([]),k("error"),C(uo(se.body.error,u));return}const Pe=typeof se.body.path=="string"?se.body.path:p;S(se.body.items.filter(mj)),k("ready"),(se.body.root==="workspace"||se.body.root==="home")&&m(se.body.root),Pe!==p&&y(Pe)}).catch(()=>{G.signal.aborted||(k("error"),C(u("files.failed")))}),()=>G.abort()},[p,l,H,u]);function Ft(G){dt.current&&URL.revokeObjectURL(dt.current),dt.current=G}function xn(G){const se=G==="workspace"?o?.workspace:o?.home;se&&(m(G),M(null),ne(null),se!==p&&(k("loading"),y(se)))}async function Qt(G){const se=ah(p,G.name);if(G.kind==="file"){await ae(se,G.name,G.size);return}if(G.kind==="link"){const Pe=await tt(`/files?sessionId=${encodeURIComponent(l)}&path=${encodeURIComponent(se)}`);if(!$e.current)return;if(Pe.status!==200){if(Pe.body.error==="not_directory"){await ae(se,G.name,G.size);return}C(uo(Pe.body.error,u));return}M(null),k("loading"),y(typeof Pe.body.path=="string"?Pe.body.path:se);return}M(null),k("loading"),y(se)}async function Z(G){const se=await tt(`/files?sessionId=${encodeURIComponent(l)}&path=${encodeURIComponent(G)}`);if($e.current){if(se.status===200&&Array.isArray(se.body.items)){M(null),k("loading"),(se.body.root==="workspace"||se.body.root==="home")&&m(se.body.root),y(typeof se.body.path=="string"?se.body.path:G);return}if(se.body.error==="not_directory"){const Pe=G.split("/").filter(Boolean).at(-1)??G;await ae(G,Pe,0);return}C(uo(se.body.error,u))}}async function ae(G,se,Pe,Xe=++Ie.current){const xt=()=>$e.current&&Xe===Ie.current;M({kind:"loading",path:G,name:se});const St=vj(se);if(St){try{const dr=await fetch(xo(l,G));if(!xt())return;if(!dr.ok){M({kind:"error",path:G,name:se});return}const mi=URL.createObjectURL(new Blob([await dr.arrayBuffer()],{type:St}));if(!xt()){URL.revokeObjectURL(mi);return}Ft(mi),M({kind:"image",path:G,name:se,url:mi})}catch{xt()&&M({kind:"error",path:G,name:se})}return}const pi=await tt(`/files/text?sessionId=${encodeURIComponent(l)}&path=${encodeURIComponent(G)}`);if(xt()){if(pi.status===415||pi.body.error==="binary"){M({kind:"binary",path:G,name:se,size:Pe});return}if(pi.status!==200||typeof pi.body.text!="string"){M({kind:"error",path:G,name:se});return}M({kind:"text",path:G,name:se,text:pi.body.text,eof:pi.body.eof!==!1})}}function ge(G){if(we==null){if(G.size>rj){C(u("files.tooLarge")),ne(null);return}C(""),ye(!1),je(!1),J(null),ne(G)}}async function xe(){if(!(!q||!p||we!=null)){J(0),C("");try{const G=await xj(l,p,q,fe,J);if(!$e.current)return;if(G.status===409){je(!0),C(u("files.exists")),J(null);return}if(G.status!==201||typeof G.body.path!="string"){C(uo(G.body.error,u)),J(null);return}ne(null),J(null),te(se=>se+1)}catch{if(!$e.current)return;C(u("files.failed")),J(null)}}}const Ve=z.useRef(null),Ne=z.useRef(0),[De,qt]=z.useState(null),[Sn,en]=z.useState(!1);z.useEffect(()=>{let G=null;if(E?E.kind!=="loading"&&(G={kind:"file",key:`file:${E.path}`,path:p,root:h,preview:E}):p&&x!=="loading"&&(G=x==="error"?{kind:"list",key:`dir:${p}`,path:p,root:h,items:[],error:T||u("files.failed")}:{kind:"list",key:`dir:${p}`,path:p,root:h,items:g,error:""}),!G){!p&&!E&&(Ve.current=null,qt(null)),en(!1);return}const se=Ve.current;if(se?.key===G.key){if(se.root===G.root&&se.path===G.path&&(se.kind==="file"&&G.kind==="file"?se.preview===G.preview:se.kind==="list"&&G.kind==="list"&&se.items===G.items&&se.error===G.error))return;Ve.current=G,qt(G);return}if(!se||window.matchMedia("(prefers-reduced-motion: reduce)").matches){Ve.current=G,qt(G),en(!1);return}const Pe=++Ne.current;en(!0);const Xe=window.setTimeout(()=>{Ne.current===Pe&&(Ve.current=G,qt(G),en(!1))},200);return()=>window.clearTimeout(Xe)},[E,g,x,p,h,T,u]),z.useEffect(()=>{const G=De?.kind==="file"&&De.preview.kind==="image",se=E?.kind==="image"||E?.kind==="loading";G||se||!dt.current||(URL.revokeObjectURL(dt.current),dt.current="")},[De,E]);const wn=De?.root??h,Dt=De?.path||p,bt=wn==="workspace"?o?.workspace:o?.home,Lt=bt?pj(bt,Dt):[],Bt=De?.kind==="file"?{name:De.preview.name,path:De.preview.path}:null,gn=De?.kind==="list"?De.error:"";function _i(G){navigator.clipboard.writeText(G).then(()=>{ut(G),window.setTimeout(()=>ut(se=>se===G?"":se),1e3)})}const tn=q!=null&&(Ce||g.some(G=>G.name===q.name)),Dn=we!=null;return qe?ph.createPortal(v.jsxs("div",{className:ee?`files-drawer narrow files-drawer-${F}`:`files-drawer files-drawer-${F}${le?" resizing":""}`,style:ee?void 0:{width:Mt},role:"dialog","aria-label":u("files.title"),onAnimationEnd:G=>{G.target!==G.currentTarget||G.animationName!=="files-drawer-out"||mt.current==="out"&&re(!1)},onDragEnter:G=>{G.preventDefault(),Et.current+=1,R(!0)},onDragOver:G=>G.preventDefault(),onDragLeave:()=>{Et.current-=1,Et.current<=0&&(Et.current=0,R(!1))},onDrop:G=>{G.preventDefault(),Et.current=0,R(!1);const se=G.dataTransfer.files[0];se&&ge(se)},children:[ee?null:v.jsx("div",{className:"files-resize",onPointerDown:G=>{G.preventDefault(),G.currentTarget.setPointerCapture(G.pointerId),me(!0);const se=Xe=>{const xt=Vd(window.innerWidth-Xe.clientX);X.current=xt,O(xt)},Pe=()=>{me(!1),sj(X.current),window.removeEventListener("pointermove",se),window.removeEventListener("pointerup",Pe)};window.addEventListener("pointermove",se),window.addEventListener("pointerup",Pe)}}),v.jsxs("header",{className:"files-head",children:[v.jsx("button",{type:"button",className:"files-icon-btn","aria-label":u("file.close"),onClick:a,children:v.jsx(Sj,{})}),v.jsxs("div",{className:"files-roots",role:"tablist",children:[v.jsx("button",{type:"button",role:"tab",className:"files-icon-btn","aria-selected":wn==="home","aria-label":u("files.home"),disabled:!o?.home,title:o?.home||void 0,onClick:()=>xn("home"),children:v.jsx(Ej,{})}),v.jsx("button",{type:"button",role:"tab",className:"files-icon-btn","aria-selected":wn==="workspace","aria-label":u("files.workspace"),disabled:!o?.workspace,title:o?.workspace??(o?.workspaceReason==="overlap"?u("files.overlap"):void 0),onClick:()=>xn("workspace"),children:v.jsx(kj,{})})]}),v.jsxs("nav",{className:"files-crumbs","aria-label":u("files.title"),children:[Lt.length>0||Bt?v.jsx("span",{"aria-hidden":"true",children:"/"}):null,Lt.map((G,se)=>v.jsxs("span",{children:[se>0?v.jsx("span",{"aria-hidden":"true",children:"/"}):null,v.jsx("button",{type:"button",title:G.path,onClick:()=>{G.path===p&&!E||(M(null),G.path!==p&&(k("loading"),y(G.path)))},children:G.name})]},G.path)),Bt?v.jsxs("span",{children:[Lt.length>0?v.jsx("span",{"aria-hidden":"true",children:"/"}):null,v.jsx("span",{className:"files-crumb-current",title:Bt.path,children:Bt.name})]}):null,Dt?v.jsx("button",{type:"button",className:"files-icon-btn files-crumb-copy","aria-label":u("files.pathHint"),title:he===(Bt?.path||Dt)?u("files.copied"):u("files.pathHint"),onClick:()=>_i(Bt?.path||Dt),children:he===(Bt?.path||Dt)?v.jsx(P0,{}):v.jsx($0,{})}):null]}),v.jsx("button",{type:"button",className:"files-icon-btn files-upload","aria-label":u("files.upload"),title:u("files.upload"),disabled:!p||Dn,onClick:()=>ke.current?.click(),children:v.jsx(Cj,{})}),v.jsx("input",{ref:ke,type:"file",hidden:!0,onChange:G=>{const se=G.target.files?.[0];G.target.value="",se&&ge(se)}})]}),T&&T!==gn?v.jsx("p",{className:"files-notice",children:T}):null,pt?v.jsx("div",{className:"files-drop",children:u("files.drop")}):null,v.jsx("div",{className:"files-body",children:De?v.jsx("div",{className:Sn?"files-stage out":"files-stage in",children:De.kind==="file"?v.jsx(oj,{preview:De.preview,sessionId:l,line:De.preview.path===N?ce:void 0,onOpenPath:G=>{Z(G)}}):De.error?v.jsx("p",{className:"files-status",children:De.error}):De.items.length===0?v.jsxs("div",{className:"files-empty",children:[v.jsx("span",{className:"files-empty-mark","aria-hidden":"true",children:v.jsx(wj,{})}),v.jsx("p",{children:u("files.empty")})]}):v.jsxs("div",{className:"files-table",role:"table",children:[v.jsxs("div",{className:"files-row files-columns",role:"row",children:[v.jsx("span",{role:"columnheader",children:u("files.name")}),v.jsx("span",{className:"files-col-type",role:"columnheader",children:u("files.type")}),v.jsx("span",{className:"files-col-size",role:"columnheader",children:u("files.size")}),v.jsx("span",{className:"files-col-time",role:"columnheader",children:u("files.modified")}),v.jsx("span",{})]}),De.items.map(G=>v.jsxs("div",{className:"files-row",role:"row",children:[v.jsxs("button",{type:"button",className:"files-name",onClick:()=>{Qt(G)},children:[v.jsx("span",{className:G.kind==="dir"?"files-mark dir":"files-mark",children:yj(G.kind)}),v.jsx("span",{children:G.name})]}),v.jsx("span",{className:"files-col-type",children:gj(G,u)}),v.jsx("span",{className:"files-col-size",children:G.kind==="file"?sh(G.size):"—"}),v.jsx("span",{className:"files-col-time",children:bj(G.mtime)}),v.jsx("span",{className:"files-row-actions",children:G.kind==="file"?v.jsxs("a",{className:"files-action",href:xo(l,ah(p,G.name)),children:[v.jsx(W0,{}),u("files.download")]}):null})]},G.name))]})}):x==="loading"?v.jsx("p",{className:"files-status",children:u("files.loading")}):null}),q?v.jsxs("div",{className:"files-confirm",children:[v.jsx("p",{children:u("files.confirm")}),v.jsxs("p",{className:"files-confirm-name",children:[v.jsx("strong",{children:q.name}),v.jsx("span",{children:sh(q.size)})]}),v.jsx("p",{className:"files-confirm-dest",children:p}),Dn?v.jsxs("div",{className:"files-progress",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round((we??0)*100),children:[v.jsx("div",{style:{width:`${Math.round((we??0)*100)}%`}}),v.jsx("span",{children:u("files.uploading")})]}):null,tn?v.jsxs("label",{className:"files-check",children:[v.jsx("input",{type:"checkbox",checked:fe,disabled:Dn,onChange:G=>ye(G.target.checked)}),u("files.overwrite")]}):null,v.jsxs("div",{className:"files-confirm-actions",children:[v.jsx("button",{type:"button",disabled:Dn,onClick:()=>ne(null),children:u("files.cancel")}),v.jsx("button",{type:"button",className:"primary",disabled:Dn||tn&&!fe,onClick:()=>{xe()},children:u("files.upload")})]})]}):null]}),document.body):null}function oj({preview:n,sessionId:l,line:r,onOpenPath:a}){const{t:u}=Je(),o=n.kind==="text"&&ok(n.name),[f,h]=z.useState(o&&r==null?"preview":"source"),[m,p]=z.useState(!1);if(z.useEffect(()=>{h(o&&r==null?"preview":"source"),p(!1)},[n.path,o,r]),n.kind==="loading")return v.jsx("p",{className:"files-status",children:u("file.loading")});if(n.kind==="error")return v.jsx("p",{className:"files-status",children:u("file.error")});const y=n.kind==="text"?n.text:"",g=n.kind==="text"?n.eof:!0,S=n.kind==="text"&&(!o||f==="source");return v.jsxs("div",{className:"files-preview",children:[v.jsx("div",{className:"files-preview-bar",children:v.jsxs("span",{children:[o?v.jsxs("span",{role:"group","aria-label":u("files.previewMode"),children:[v.jsxs("button",{type:"button",className:"files-action","aria-pressed":f==="preview",onClick:()=>h("preview"),children:[v.jsx(Tj,{}),u("files.previewMode")]}),v.jsxs("button",{type:"button",className:"files-action","aria-pressed":f==="source",onClick:()=>h("source"),children:[v.jsx(Aj,{}),u("files.sourceMode")]})]}):null,n.kind==="text"?v.jsxs("button",{type:"button",className:"files-action",onClick:()=>{navigator.clipboard.writeText(y).then(()=>{p(!0),window.setTimeout(()=>p(!1),1e3)})},children:[m?v.jsx(P0,{}):v.jsx($0,{}),u(m?"files.copied":"files.copy")]}):null,v.jsxs("a",{className:"files-action",href:xo(l,n.path),children:[v.jsx(W0,{}),u("files.download")]})]})}),n.kind==="image"?v.jsx("div",{className:"files-image",children:v.jsx("img",{src:n.url,alt:n.name})}):n.kind==="binary"?v.jsxs("p",{className:"files-status",children:[u("files.binary")," ",sh(n.size)]}):S?v.jsxs(v.Fragment,{children:[v.jsx(z.Suspense,{fallback:v.jsx("p",{className:"files-status",children:u("file.loading")}),children:v.jsx(lj,{text:y,name:n.name,line:r})}),g?null:v.jsx("p",{className:"file-modal-note",children:u("files.truncated")})]}):v.jsxs("div",{className:"files-markdown",children:[v.jsx(js,{text:y,onOpenFile:x=>{const k=x.startsWith("/")?x:J0(n.path,x);k&&a(k)},resolveImage:x=>hj(l,n.path,x)}),g?null:v.jsx("p",{className:"file-modal-note",children:u("files.truncated")})]})]})}function cj(n,l){const r=l.replace(/^\.\//,"");return r.startsWith("/")?r:n?ah(n,r):null}function fj(n,l,r){return l&&(n===l||n.startsWith(`${l}/`))?"workspace":r&&(n===r||n.startsWith(`${r}/`))?"home":null}function dj(n){const l=n.lastIndexOf("/");return l<=0?"/":n.slice(0,l)}function hj(n,l,r){if(/^[a-z][a-z0-9+.-]*:/i.test(r)||r.startsWith("//")||r.startsWith("#"))return;const a=r.startsWith("/")?r:J0(l,r);if(a)return`${xo(n,a)}&inline=1`}function J0(n,l){const r=n.slice(0,n.lastIndexOf("/")),a=r===""?[]:r.split("/").filter(Boolean),u=r.startsWith("/")?[...a]:a;for(const o of l.split("/"))if(!(o===""||o===".")){if(o===".."){if(u.length===0)return null;u.pop();continue}u.push(o)}return u.length===0?null:`/${u.join("/")}`}function pj(n,l){if(!l.startsWith(n))return[];const r=(n==="/"?l.slice(1):l.slice(n.length).replace(/^\//,"")).split("/").filter(Boolean),a=[];let u=n;for(const o of r)u=u==="/"?`/${o}`:`${u}/${o}`,a.push({name:o,path:u});return a}function ah(n,l){return n==="/"?`/${l}`:`${n.replace(/\/$/,"")}/${l}`}function xo(n,l){return`/dsh-bot/api/files/raw?sessionId=${encodeURIComponent(n)}&path=${encodeURIComponent(l)}`}function mj(n){if(!n||typeof n!="object")return!1;const l=n;return typeof l.name=="string"&&(l.kind==="dir"||l.kind==="file"||l.kind==="link")&&typeof l.size=="number"&&typeof l.mtime=="string"}function uo(n,l){return l(n==="denied"?"files.denied":n==="missing"?"files.missing":n==="binary"?"files.binary":n==="exists"?"files.exists":n==="too_large"?"files.tooLarge":n==="overlap"?"files.overlap":"files.failed")}function gj(n,l){if(n.kind==="dir")return l("files.folder");if(n.kind==="link")return l("files.link");const r=n.name.includes(".")?n.name.split(".").pop()??"":"";return r?r.toUpperCase():l("files.file")}function yj(n){return n==="dir"?"▸":n==="link"?"↗":"·"}function vj(n){const l=n.split(".").pop()?.toLowerCase()??"";return l==="jpg"||l==="jpeg"?"image/jpeg":l==="png"?"image/png":l==="gif"?"image/gif":l==="webp"?"image/webp":null}function sh(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(n<10*1024?1:0)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function bj(n){const l=new Date(n);if(Number.isNaN(l.getTime()))return"";const r=String(l.getHours()).padStart(2,"0"),a=String(l.getMinutes()).padStart(2,"0");return`${l.getMonth()+1}/${l.getDate()} ${r}:${a}`}function xj(n,l,r,a,u){const o=`/dsh-bot/api/files?sessionId=${encodeURIComponent(n)}&dir=${encodeURIComponent(l)}&name=${encodeURIComponent(r.name)}&overwrite=${a?"1":"0"}`;return new Promise((f,h)=>{const m=new XMLHttpRequest;m.open("POST",o),m.setRequestHeader("content-type","application/octet-stream"),m.upload.onprogress=p=>{p.lengthComputable&&p.total>0&&u(p.loaded/p.total)},m.onload=()=>{let p={};try{const y=JSON.parse(m.responseText);y&&typeof y=="object"&&(p=y)}catch{p={}}f({status:m.status,body:p})},m.onerror=()=>h(new Error("failed")),m.send(r)})}function Sj(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M4.2 4.2L11.8 11.8M11.8 4.2L4.2 11.8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function wj(){return v.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:v.jsx("path",{d:"M3.2 7.4c0-.9.7-1.6 1.6-1.6h4.4l1.6 1.7h8.4c.9 0 1.6.7 1.6 1.6v8.5c0 .9-.7 1.6-1.6 1.6H4.8c-.9 0-1.6-.7-1.6-1.6V7.4z",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})})}function kj(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M1.8 5.1c0-.6.5-1.1 1.1-1.1h3.2l1.2 1.4h5.8c.6 0 1.1.5 1.1 1.1v5.9c0 .6-.5 1.1-1.1 1.1H2.9c-.6 0-1.1-.5-1.1-1.1V5.1z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}function Ej(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M2.2 7.2 8 2.7l5.8 4.5V13H10V9.3H6V13H2.2V7.2z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}function $0(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M6 4.2h6.2v8.2H6zM4.2 11.6H3.6V2.8h6.6V4",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}function P0(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M3.4 8.2 6.4 11.2 12.6 4.8",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function W0(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M8 2.6v6.2M5.2 6.4 8 9.2l2.8-2.8M3.2 12.6h9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function Tj(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("path",{d:"M1.6 8s2.2-3.3 6.4-3.3S14.4 8 14.4 8s-2.2 3.3-6.4 3.3S1.6 8 1.6 8z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),v.jsx("circle",{cx:"8",cy:"8",r:"1.6",fill:"none",stroke:"currentColor",strokeWidth:"1.3"})]})}function Aj(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M6 4.4 2.8 8 6 11.6M10 4.4 13.2 8 10 11.6",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function Cj(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M8 2.6v6.1M5.2 5.3 8 2.6l2.8 2.7M3.2 9.1V12.4h9.6V9.1",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function Nj({onClose:n,onCreated:l}){const[r,a]=z.useState(""),[u,o]=z.useState(""),[f,h]=z.useState(""),[m,p]=z.useState(!1),[y,g]=z.useState(""),{locale:S,setLocale:x,t:k}=Je();function T(E){a(E)}async function C(){if(m)return;const E=r.trim();if(E===""){g(k("new.nameRequired"));return}p(!0),g("");const M=await tt("/sessions",{method:"POST",headers:{"content-type":"application/json","idempotency-key":crypto.randomUUID()},body:JSON.stringify({name:E})}),H=typeof M.body.sessionId=="string"?M.body.sessionId:"";if(!H){const X=M.body.upstream;g(X?.message||String(M.body.error||k("new.createFailed"))),p(!1);return}const te=fw(E,u,f),ie=await bs("/dsh-bot/api/sessions/open",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:H,personaText:te,idempotencyKey:crypto.randomUUID()})}),O=ie.body.ok===!0?k("new.created",{name:E}):fb(ie.body,k("new.personaFailed"));l(H,O,E)}return v.jsx("div",{className:"setup-mask",role:"presentation",onMouseDown:n,children:v.jsxs("form",{className:"setup-card",role:"dialog","aria-labelledby":"new-session-title",onMouseDown:E=>E.stopPropagation(),onSubmit:E=>{E.preventDefault(),C()},children:[v.jsxs("div",{className:"setup-head",children:[v.jsx("h2",{id:"new-session-title",children:k("new.title")}),v.jsx("button",{type:"button",className:"setup-close","aria-label":k("new.close"),onClick:n,children:"×"})]}),v.jsx("p",{className:"setup-lead",children:k("new.lead")}),v.jsx("label",{htmlFor:"setup-name",children:k("new.name")}),v.jsx("input",{id:"setup-name",value:r,placeholder:k("new.namePlaceholder"),onChange:E=>T(E.target.value)}),v.jsx("label",{htmlFor:"setup-style",children:k("new.style")}),v.jsx("input",{id:"setup-style",value:u,placeholder:k("new.stylePlaceholder"),onChange:E=>o(E.target.value)}),v.jsx("label",{htmlFor:"setup-task",children:k("new.task")}),v.jsx("textarea",{id:"setup-task",rows:3,value:f,placeholder:k("new.taskPlaceholder"),onChange:E=>h(E.target.value)}),y?v.jsx("p",{className:"setup-error",children:y}):null,v.jsxs("div",{className:"setup-actions",children:[v.jsx("button",{type:"button",onClick:()=>x(S==="en"?"zh":"en"),children:k("lang.switch")}),v.jsx("button",{type:"button",onClick:n,children:k("new.cancel")}),v.jsx("button",{type:"submit",className:"primary",disabled:m||r.trim()==="",children:k(m?"new.creating":"new.create")})]})]})})}function jj(n,l){const{t:r}=Je(),[a,u]=z.useState("");return z.useEffect(()=>{if(n===""){u("");return}let o=!1;return(async()=>{const f=await bs(`/dsh-bot/api/status?sessionId=${encodeURIComponent(n)}`),h=await bs(`/dsh-bot/api/memory?sessionId=${encodeURIComponent(n)}`);if(o||f.body.ok!==!0)return;const m=f.body.binding;if((m&&typeof m=="object"?m.kind:f.body.kind)!=="bot"){u(r("basis.plain"));return}const y=typeof f.body.personaText=="string"?f.body.personaText.trim():"",g=dw(y),S=[g.name,g.style,g.task].filter(T=>T!=="").join(" · "),k=(Array.isArray(h.body.facts)?h.body.facts:[]).filter(T=>T&&typeof T=="object"&&T.status==="active").length;u(k>0?r("basis.facts",{head:S||"BOT",count:String(k)}):S||"BOT")})(),()=>{o=!0}},[n,l,r]),a}function Lo(n){const l=n.replace(/\r\n/g,`
50
+ `);if(!l.startsWith("[foundations:message]"))return null;const r=l.slice(21).replace(/^\n/,""),a=r.indexOf(`
51
+ ---
52
+ `);if(a<0)return null;const u={},o=[];for(const f of r.slice(0,a).split(`
53
+ `)){const h=/^(id|from|correlation|causation|hop):\s*(.*)$/.exec(f);h?.[1]?u[h[1]]=(h[2]??"").trim():f.trim()!==""&&o.push(f.trim())}return u.from?{id:u.id??"",from:u.from,correlation:u.correlation??"",causation:u.causation??"",hop:u.hop??"",note:o.join(" "),body:r.slice(a+5).trim()}:null}function e1(n,l){return l!==""&&l!==n?l:n.startsWith("session-")&&n.length>18?`${n.slice(0,12)}…${n.slice(-4)}`:n}const Oj=new Set(["foundations_send","foundations_reply"]);function t1(n){const l=[];for(const r of n){if(r.kind==="user"){const u=Lo(r.text);if(!u)continue;l.push({kind:"in",id:r.id,seq:r.seq,time:r.time,mail:u});continue}if(r.kind!=="tool"||!Oj.has(r.name))continue;const a=Rj(r);a&&l.push(a)}return l.sort((r,a)=>r.seq-a.seq||(r.kind===a.kind?0:r.kind==="in"?-1:1)),l}function zj(n){const l=t1(n);if(!l.some(u=>u.kind==="in"))return n.slice();const a=new Set(l.filter(u=>u.kind==="out").map(u=>u.id));return n.filter(u=>!a.has(u.id))}function _j(n,l){const r=n.filter(o=>o.kind==="in"),a=r.at(-1);if(!a)return null;const u=a.mail.body.replace(/\s+/g," ").trim();return{who:l(a.mail.from)||"BOT",preview:u.length>72?`${u.slice(0,71)}…`:u,count:r.length}}function qj(n,l){if(n.target)return n.target;if(!n.correlation)return"";for(let r=l.length-1;r>=0;r-=1){const a=l[r];if(!(!a||a.seq>n.seq)&&a.kind==="in"&&a.mail.correlation===n.correlation)return a.mail.from}return""}function Rj(n){let l;try{const a=JSON.parse(n.args);if(!a||typeof a!="object"||Array.isArray(a))return null;l=a}catch{return null}const r=typeof l.text=="string"?l.text.trim():"";return r?{kind:"out",id:n.id,seq:n.seq,text:r,target:typeof l.targetSessionId=="string"?l.targetSessionId:"",correlation:typeof l.correlationId=="string"?l.correlationId:""}:null}function Mj({mail:n,label:l,onOpenFile:r}){const{t:a}=Je(),u=e1(n.from,l),o=/^\d+$/.test(n.hop)?n.hop:"",f=[n.id?`id ${n.id}`:"",`from ${n.from}`,n.correlation?`correlation ${n.correlation}`:"",n.causation?`causation ${n.causation}`:""].filter(Boolean).join(`
54
+ `);return v.jsxs("article",{className:"mail-card",children:[v.jsxs("header",{className:"mail-head",children:[v.jsx("span",{className:"bot-badge",children:"BOT"}),v.jsxs("span",{className:"mail-who",children:[v.jsx("strong",{children:u}),v.jsx("span",{children:a("inbox.received")})]}),o?v.jsx("span",{className:"mail-hop",children:a("inbox.hop",{hop:o})}):null]}),n.body?v.jsx("div",{className:"mail-body",children:v.jsx(js,{text:n.body,onOpenFile:r})}):null,v.jsx("p",{className:"mail-note",children:a("inbox.lead")}),f?v.jsxs("details",{className:"mail-details",children:[v.jsx("summary",{children:a("inbox.source")}),v.jsx("pre",{children:f})]}):null]})}function Dj({who:n,preview:l,time:r,mark:a,onOpen:u}){const{t:o}=Je(),f=l||o("inbox.received");return v.jsxs("div",{className:"inbox-line","data-turn":a,children:[v.jsxs("button",{type:"button",className:"inbox-entry",onClick:u,"aria-label":o("inbox.open",{who:n,line:f}),children:[v.jsx("span",{className:"inbox-icon",children:v.jsx(Ij,{})}),v.jsxs("span",{className:"inbox-copy",children:[v.jsx("strong",{children:n}),v.jsx("span",{children:f})]})]}),r?v.jsx("time",{children:r}):null]})}function Lj({items:n,botLabel:l,onOpenFile:r}){const{locale:a}=Je();return v.jsxs("div",{className:"bot-chat",children:[v.jsx(Uj,{}),n.length===0?v.jsx(Hj,{}):null,n.map(u=>u.kind==="in"?v.jsxs("div",{className:"mail-row",children:[v.jsx(Mj,{mail:u.mail,label:l(u.mail.from),onOpenFile:r}),So(u.time,a)?v.jsx("time",{children:So(u.time,a)}):null]},u.id):v.jsx(Bj,{item:u,items:n,botLabel:l},u.id))]})}function Bj({item:n,items:l,botLabel:r}){const{t:a,locale:u}=Je(),o=qj(n,l),f=o?e1(o,r(o)):a("inbox.other");return v.jsxs("div",{className:"bot-out",children:[v.jsx("div",{className:"user-bubble",children:n.text}),v.jsx("span",{children:a("inbox.sentTo",{name:f})}),So(n.time,u)?v.jsx("time",{children:So(n.time,u)}):null]})}function Uj(){const{t:n}=Je();return v.jsx("p",{className:"bot-chat-lead",children:n("inbox.lead")})}function Hj(){const{t:n}=Je();return v.jsx("p",{className:"empty-thread",children:n("inbox.empty")})}function So(n,l){if(!n)return"";const r=new Date(n);return Number.isNaN(r.getTime())?"":r.toLocaleTimeString(l==="zh"?"zh-CN":"en",{hour:"2-digit",minute:"2-digit"})}function Ij(){return v.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[v.jsx("path",{d:"M4 13.2 6.4 5.5h11.2L20 13.2",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),v.jsx("path",{d:"M4 13.2h4.1l1.1 2h5.6l1.1-2H20V19a1.4 1.4 0 0 1-1.4 1.4H5.4A1.4 1.4 0 0 1 4 19Z",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})]})}function Vj({root:n,marks:l,busyId:r}){const a=z.useRef(null),[u,o]=z.useState(l.at(-1)?.id??""),[f,h]=z.useState(null),[m,p]=z.useState({top:!1,bottom:!1}),y=l.map(x=>x.id).join("\0");z.useEffect(()=>{const x=n.current;if(!x||l.length<2)return;const k=()=>{const T=x.getBoundingClientRect().top,C=x.scrollHeight-x.scrollTop-x.clientHeight<48;let E=l[0]?.id??"";if(C)E=l.at(-1)?.id??E;else for(const M of l){const H=x.querySelector(`[data-turn="${CSS.escape(M.id)}"]`);H instanceof HTMLElement&&H.getBoundingClientRect().top-T<=36&&(E=M.id)}o(M=>M===E?M:E)};return k(),x.addEventListener("scroll",k,{passive:!0}),()=>x.removeEventListener("scroll",k)},[n,l,y]),z.useEffect(()=>{const x=a.current,k=x?.querySelector('[aria-current="true"]');if(!x||!k)return;const T=k.offsetTop-(x.clientHeight-k.offsetHeight)/2;x.scrollTop=Math.max(0,T);const C=x.scrollTop>1,E=x.scrollTop<x.scrollHeight-x.clientHeight-1;p(M=>M.top===C&&M.bottom===E?M:{top:C,bottom:E})},[u,y]);const{t:g}=Je();if(l.length<2)return null;const S=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;return v.jsx("nav",{ref:a,className:["turn-rail",m.top?"fade-top":"",m.bottom?"fade-bottom":""].filter(Boolean).join(" "),"aria-label":g("turn.rail"),onMouseLeave:()=>h(null),children:l.map((x,k)=>{const T=x.id===u;return v.jsx("button",{type:"button",className:["turn-mark",T?"active":"",x.id===f?"preview":"",x.id===r?"busy":""].filter(Boolean).join(" "),"aria-current":T?"true":void 0,"aria-label":g("turn.jump",{index:String(k+1)}),onMouseEnter:()=>h(x.id),onFocus:()=>h(x.id),onBlur:()=>h(C=>C===x.id?null:C),onClick:()=>{n.current?.querySelector(`[data-turn="${CSS.escape(x.id)}"]`)?.scrollIntoView({block:"start",behavior:S?"auto":"smooth"})}},x.id)})})}function Yj(n){let l=!1,r=n.visible!==!1,a=!1,u=!1,o=!1,f=0,h=0,m="",p=!1,y=()=>{},g=null;function S(C){const E=JSON.stringify(C);E!==m&&(m=E,p=n.active?.(C)===!0,n.apply(C))}function x(){if(y(),l||!r)return;const C=a?6e4:p?1500:Math.min(15e3,2e3*2**Math.min(h,3));y=n.schedule(()=>{k()},C)}async function k(){if(l||!r)return;if(u){o=!0;return}y(),u=!0;const C=f;g=new AbortController;const E=g,M=n.schedule(()=>E.abort(),1e4);try{const H=await n.fetch(g.signal);!l&&r&&C===f&&S(H),h=Math.min(h+1,3)}catch{h=Math.min(h+1,3)}finally{M(),u=!1,o?(o=!1,k()):x()}}const T={ingest(C){l||!r||(f++,a=!0,h=0,S(C),x())},disconnected(){a=!1,h=0,x()},setVisible(C){r!==C&&(r=C,C||(a=!1),f++,y(),g?.abort(),r&&(h=0,k()))},close(){l=!0,f++,y(),g?.abort()},refresh:k};return k(),T}function n1(n,l=Date.now){let r=null,a=0,u=null,o=0;const f={invalidate(){o++,r=null},get(){if(r&&l()-a<3e4)return Promise.resolve(r);if(u)return u;const h=o,m=n().then(p=>h!==o?(u=null,f.get()):(h===o&&(r=p,a=l()),p)).finally(()=>{u===m&&(u=null)});return u=m,m}};return f}const ys=new Set(["preparing","waiting","running","worker"]),i1=new Set([...ys,"background"]),Gj=/(?:password|passwd|passphrase|secret|token|api[-_]?key|authorization|cookie|credential|private[-_]?key)/i;function it(n){if(/^\s*[\[{]/.test(n))try{const l=JSON.parse(n);if(l&&typeof l=="object")return JSON.stringify(wo(l),null,2)}catch{}return n.replace(/\x1b\[[0-?]*[ -/]*[@-~]/g,"").replace(/-----BEGIN [^-]*PRIVATE KEY-----[\s\S]*?(?:-----END [^-]*PRIVATE KEY-----|$)/g,"[REDACTED PRIVATE KEY]").replace(/(https?:\/\/)[^\s/@]+:[^\s/@]+@/gi,"$1[REDACTED]@").replace(/\b(Bearer|Basic)\s+[A-Za-z0-9+/_.=~-]+/gi,"$1 [REDACTED]").replace(/\b(?:sk-|gh[pousr]_|github_pat_|xox[baprs]-)[A-Za-z0-9_-]+/g,"[REDACTED]").replace(/("[^"\n]*(?:password|passwd|passphrase|secret|token|api[-_]?key|authorization|cookie|credential|private[-_]?key)[^"\n]*"\s*:\s*)("(?:\\.|[^"\\])*"?|[^,}\n]+)/gi,'$1"[REDACTED]"').replace(/((?:--)?[A-Za-z_][A-Za-z0-9_-]*(?:password|passwd|secret|token|api[-_]?key|authorization|cookie|credential)[A-Za-z0-9_-]*\s*(?:=|:\s*|\s+))('[^']*'?|"(?:\\.|[^"\\])*"?|[^\s,;]+)/gi,"$1[REDACTED]").replace(/((?:--)?(?:password|passwd|secret|token|api[-_]?key|authorization|cookie|credential)\s*(?:=|:\s*|\s+))('[^']*'?|"(?:\\.|[^"\\])*"?|[^\s,;]+)/gi,"$1[REDACTED]")}function wo(n){return Array.isArray(n)?n.map(wo):n&&typeof n=="object"?Object.fromEntries(Object.entries(n).map(([l,r])=>[l,Gj.test(l)?"[REDACTED]":wo(r)])):typeof n=="string"?it(n):n}function Fj(n){try{return JSON.stringify(wo(JSON.parse(n)),null,2)}catch{return it(n)}}function Ss(n){try{const l=JSON.parse(n);return l&&typeof l=="object"&&!Array.isArray(l)?l:{}}catch{return{}}}function Mh(n){return["bash","shell","pwsh","powershell"].includes(n.toLowerCase())}function Bo(n,l,r,a=""){if(/^TOOL_(NOT_STARTED|OUTCOME_UNKNOWN)$/.test(a))return"unknown";if(/ABORT|CANCEL/i.test(a))return"cancelled";if(r)return"failed";if(Mh(n)){if(/^\[stopped: .+\]$/m.test(l))return"cancelled";if(/^\[(?:timed out after .+|killed by signal: .+|sandbox: .+)\]$/m.test(l))return"failed";const u=/^\[exit code: (-?\d+)\]$/m.exec(l);if(u)return Number(u[1])!==0?"failed":"succeeded";if(/^started background job \S+/m.test(l)||/^\[still running after \d+ms; moved to background job .+\]$/m.test(l))return"background"}return"succeeded"}function Dh(n){return n.status?n.status:n.resultReceived||n.result!==""?Bo(n.name,n.result,n.error):n.running?"waiting":"unknown"}const Qj={preparing:"activity.status.preparing",waiting:"activity.status.waiting",running:"activity.status.running",worker:"activity.status.worker",background:"activity.status.backgroundDetail",succeeded:"activity.status.succeeded",failed:"activity.status.failed",cancelled:"activity.status.cancelled",unknown:"activity.status.unknown"};function Iv(n,l=Oi){return l(Qj[n])}function vs(n,l,r=[]){const a=Ss(n.args),u=Ss(n.result),o=Mh(n.name),f=o&&typeof a.command=="string"?it(a.command):"",h=typeof a.description=="string"?it(a.description):"",m=n.meta&&typeof n.meta=="object"?n.meta:{},p=typeof m.cwd=="string"?m.cwd:typeof a.workdir=="string"?a.workdir:l,y=typeof m.cwd=="string"||!p||p.startsWith("/")||!l?p:l.replace(/\/$/,"")+"/"+p,g=y?it(y):"",S=typeof u.ticketId=="string"?u.ticketId:"",x=r.find(E=>E.id===S);let k=Dh(n);x&&n.name==="foundations_dispatch"?k=x.status==="failed"?"failed":x.status==="cancelled"?"cancelled":x.status==="delivered"?"succeeded":"worker":n.name==="foundations_dispatch"&&k==="succeeded"&&S&&(k="worker");const T=n.name==="todo_write"&&Array.isArray(a.todos)?a.todos.flatMap(E=>{if(!E||typeof E!="object")return[];const M=E;return typeof M.content=="string"&&typeof M.status=="string"?[{content:it(M.content),status:M.status}]:[]}):[],C=o?/^\[exit code: (-?\d+)\]$/m.exec(n.result):null;return{status:k,command:f,description:h,cwd:g,cwdSource:typeof m.cwd=="string"?"recorded":typeof a.workdir=="string"?"requested":"session",todos:T,title:n.name==="todo_write"?"todo_write":it(n.name),args:Fj(n.args),output:it(n.result),exitCode:C?Number(C[1]):null,ticket:x,ticketId:S,latestReport:x?.events.filter(E=>E.revision===x.revision&&E.applyStatus!=="stale").at(-1)?.text??"",jobId:o?/(?:^started background job |moved to background job )([^\s\]]+)/m.exec(n.result)?.[1]??"":""}}const Xj="ask_user_question";function l1(n){return n.replace(/-/g,"_").toLowerCase()===Xj}function Zj(n,l=!1){const r=n.match(/^(.*?)\s*[\((]\s*(Recommended|推荐|建議)\s*[\))]\s*$/i);return{label:n,displayLabel:r?.[1]?.trim()?r[1].trim():n,recommended:l||!!r}}function Rd(n,l,r=""){return n?l.startsWith("zh")&&typeof n.zh=="string"&&n.zh!==""?n.zh:typeof n[l]=="string"&&n[l]!==""?n[l]:n.en||r:r}function Kj(n){if(!n||typeof n!="object")return;const l=n;if(l.kind==="plan-review"&&typeof l.approve=="string"){const r={kind:"plan-review",approve:l.approve};return typeof l.callId=="string"&&l.callId!==""&&(r.callId=l.callId),r}if(l.kind==="approval"&&typeof l.approve=="string"&&typeof l.reject=="string"){const r={kind:"approval",approve:l.approve,reject:l.reject};if(typeof l.always=="string"&&l.always!==""&&(r.always=l.always),l.subject&&typeof l.subject=="object"){const a=l.subject;typeof a.name=="string"&&a.name!==""&&(r.subject={name:a.name},typeof a.icon=="string"&&a.icon!==""&&(r.subject.icon=a.icon))}if(l.display&&typeof l.display=="object"){const a=l.display,u=Md(a.question);if(u){r.display={question:u};const o=Md(a.detail);o&&(r.display.detail=o);const f=Md(a.approve);f&&(r.display.approve=f)}}return r}}function Md(n){if(!n||typeof n!="object"||typeof n.en!="string")return;const l={en:n.en};for(const[r,a]of Object.entries(n))typeof a=="string"&&(l[r]=a);return l}function r1(n){const l=n[0];if(!l||n.length!==1||l.multiSelect||l.intent?.kind!=="plan-review")return;const r=l.options.find(u=>u.label===l.intent?.approve);if(!r)return;const a=l.options.find(u=>u.label!==r.label);if(!(l.options.length>2))return{item:l,approve:r,decline:a,plan:l.detail}}function a1(n){const l=n[0];if(!l||n.length!==1||l.multiSelect||l.intent?.kind!=="approval")return;const r=l.intent,a=l.options.find(f=>f.label===r.approve),u=l.options.find(f=>f.label===r.reject);if(!a||!u)return;const o=r.always?l.options.find(f=>f.label===r.always):void 0;return{item:l,intent:r,approve:a,reject:u,always:o}}function ur(n){return typeof n=="string"?n:""}function Jj(n){return Array.isArray(n)?n.flatMap(l=>{if(!l||typeof l!="object")return[];const r=l;return typeof r.label!="string"?[]:[{label:r.label,description:ur(r.description),recommended:r.recommended===!0}]}):[]}function $j(n){return Array.isArray(n)?n.flatMap((l,r)=>{if(!l||typeof l!="object")return[];const a=l,u=ur(a.question);if(!u)return[];const o=ur(a.id);return[{id:o===""?`question-${r+1}`:o,question:u,detail:ur(a.detail),header:ur(a.header),options:Jj(a.options),multiSelect:a.multi_select===!0||a.multiSelect===!0,intent:Kj(a.intent)}]}):[]}function Pj(n){const l=new Map,r=Ss(n),a=Array.isArray(r.answers)?r.answers:Array.isArray(r)?r:[];for(const u of a){if(!u||typeof u!="object")continue;const o=u,f=ur(o.id);if(!f)continue;const h=Array.isArray(o.selected)?o.selected.flatMap(m=>typeof m=="string"?[m]:[]):[];l.set(f,{selected:h,custom:ur(o.custom)})}return l}function Wj(n){const l=n.errorCode??"";return/ASK_ABORTED|ABORT|CANCEL/i.test(l)||/aborted before the user answered/i.test(n.result)}function s1(n){if(!n)return!1;const l=Ss(n);return!!(l&&l.pending===!0)}function eO(n){return s1(n.result)?!1:!!(n.resultReceived||n.result!==""||n.error||n.errorCode)}function tO(n){const l=n.timeout;if(!(typeof l!="number"||!Number.isFinite(l)||l<=0))return l>1e3?l:l*1e3}function Os(n){if(!l1(n.name))return null;const l=Ss(n.args),r=$j(l.questions),a=Pj(n.result),u=Wj(n),o=s1(n.result),f=eO(n),h=f&&n.error&&!u,m=o?"continued":f?u?"aborted":h?"failed":"answered":"open",p=tO(l),y=o?"continued":m==="open"&&p?"counting":"none",g=r.map(k=>{const T=a.get(k.id),C=T?.selected??[],E=T?.custom??"";return{...k,selected:C,custom:E,skipped:m==="answered"&&C.length===0&&!E}}),S=g.find(k=>k.header)?.header||g[0]?.question||n.name,x=r1(g)?"plan-review":a1(g)?"approval":"question";return{callId:n.callId,state:m,wait:y,timeoutMs:p,title:S,questions:g,presentation:x}}function u1(n){return n==="open"||n==="continued"}const nO=new Set(["accepted","enqueued","started","needs_user","ready"]),iO=new Set(["delivered","failed","cancelled"]),lO={preparing:"activity.status.preparing",waiting:"activity.status.waiting",running:"activity.status.running",worker:"activity.status.worker",background:"activity.status.background",succeeded:"activity.status.succeeded",failed:"activity.status.failed",cancelled:"activity.status.cancelled",unknown:"activity.status.unknown"},rO={accepted:"activity.ticket.scheduling",enqueued:"activity.ticket.scheduling",started:"activity.status.worker",needs_user:"activity.ticket.needsUser",ready:"activity.ticket.ready"};function uh(n){const{segments:l,drafting:r,currentTurn:a,tickets:u=[],t:o=Oi}=n,f=[],h=[],m=new Set,p=S=>a==null||S===a,y=S=>o(lO[S]);for(const S of l){if(S.kind!=="tool")continue;const x=vs(S,void 0,u),k=Os(S);if(k&&u1(k.state)&&r&&p(S.turn)){f.push({text:o("question.waiting"),moving:!0});continue}if(x.status==="worker"&&x.ticket)continue;if(x.status==="worker"&&x.ticketId){if(m.has(x.ticketId))continue;m.add(x.ticketId)}const T=x.description||x.command||x.title,C={text:`${y(x.status)}: ${T}`,moving:x.status!=="background"};if(x.status==="background"){r&&p(S.turn)&&h.push(C);continue}ys.has(x.status)&&(!r||!p(S.turn)||f.push(C))}n.pendingApprovals?.some(S=>S.state==="open")&&f.push({text:o("approval.waiting"),moving:!0});for(const S of u){if(m.has(S.id)||iO.has(S.status)||!nO.has(S.status))continue;m.add(S.id);const x=rO[S.status];x&&f.push({text:`${o(x)}: ${S.summary}`,moving:["accepted","enqueued","started"].includes(S.status)})}let g=f.find(S=>S.text===o("question.waiting"))??f.at(-1);if(f.length>1&&g&&(g={text:`${o("activity.pendingCount",{count:String(f.length)})} · ${g.text}`,moving:f.some(S=>S.moving)}),!g&&h.length&&(g=h.at(-1)),!g&&r){const S=l.filter(x=>p(x.turn));g=S.some(x=>x.kind==="think"&&x.running)?{text:o("activity.thinking"),moving:!0}:S.some(x=>x.kind==="assistant"&&x.streaming)?{text:o("bot.replying"),moving:!0}:{text:o("activity.waitingModel"),moving:!0}}if(!g)return null;if(n.connectionPhase&&n.connectionPhase!=="live"){const S=["restoring","connecting","syncing"].includes(n.connectionPhase);g={text:o("activity.staleSummary",{phase:o(S?"activity.syncing":"activity.connectionUnavailable"),text:g.text}),moving:!1}}return{...g,text:it(g.text).replace(/\s+/g," ").trim()}}function aO(n){const{t:l}=Je(),r=uh({...n,t:l}),[a,u]=z.useState(()=>typeof document>"u"||document.visibilityState!=="hidden");return z.useEffect(()=>{const o=()=>u(document.visibilityState!=="hidden");return document.addEventListener("visibilitychange",o),o(),()=>document.removeEventListener("visibilitychange",o)},[]),r?v.jsxs("div",{className:"composer-activity",role:"status","aria-live":"polite","aria-atomic":"true","data-moving":r.moving&&a?"true":"false",children:[v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M3 4h10M3 8h10M3 12h6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})}),v.jsx("span",{className:"composer-activity-text",title:r.text,children:r.text})]}):null}function o1(n,l){return n==="workspace-write"?l("permission.preset.workspaceWrite"):n==="read-only"||n==="readonly"?l("permission.preset.readOnly"):n==="danger-full-access"?l("permission.preset.fullAccess"):n==="auto"?l("permission.preset.auto"):n}function Vv(n,l,r){const a=o1(n,r);return a!==n?a:l&&l!==""?l:n}function Lh({title:n,closeLabel:l,onClose:r,children:a}){z.useEffect(()=>{if(typeof document>"u")return;const o=document.body.style.overflow;document.body.style.overflow="hidden";const f=h=>{h.key==="Escape"&&r()};return document.addEventListener("keydown",f),()=>{document.body.style.overflow=o,document.removeEventListener("keydown",f)}},[r]);const u=v.jsxs("div",{className:"settings-drawer",children:[v.jsx("div",{className:"settings-drawer-mask",onClick:r}),v.jsxs("div",{className:"settings-drawer-sheet",role:"dialog","aria-modal":"true","aria-label":n,tabIndex:-1,children:[v.jsx("div",{className:"settings-drawer-handle","aria-hidden":"true"}),v.jsxs("div",{className:"settings-head",children:[v.jsx("h3",{children:n}),v.jsx("button",{type:"button",className:"user-question-skip",onClick:r,children:l})]}),v.jsx("div",{className:"settings-drawer-body",children:a})]})]});return typeof document>"u"||!document.body?u:ph.createPortal(u,document.body)}function sO({sessionId:n,current:l,onClose:r,onChanged:a}){const{t:u}=Je(),[o,f]=z.useState(null),[h,m]=z.useState(null),[p,y]=z.useState(""),[g,S]=z.useState(!1);z.useEffect(()=>{tt(`/permissions?sessionId=${encodeURIComponent(n)}`).then(E=>f(E.body))},[n]);async function x(E){S(!0),y("");try{const M=await tt("/permissions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:n,name:E})});if(M.status===200&&M.body.ok!==!1){f(M.body),m(null),typeof M.body.currentValue=="string"&&a?.(M.body.currentValue);return}y(typeof M.body.message=="string"?M.body.message:u("permission.failed"))}catch{y(u("permission.failed"))}finally{S(!1)}}function k(E){if(!(E.value===o?.currentValue||E.value==="custom")){if(E.value==="danger-full-access"||E.value==="auto"){m(E);return}x(E.value)}}const T=o?.options??[],C=T.find(E=>E.value===(o?.currentValue??l));return v.jsxs(Lh,{title:u("permission.title"),closeLabel:u("permission.close"),onClose:r,children:[o&&o.available===!1?v.jsx("p",{className:"user-question-hint",children:u("permission.unavailable")}):null,o?.currentValue||l?v.jsxs("p",{className:"user-question-hint",children:[u("permission.current"),":"," ",Vv(o?.currentValue??l??"",C?.name,u)||"—"]}):null,v.jsx("ul",{className:"user-question-options",children:T.map(E=>v.jsx("li",{children:v.jsxs("button",{type:"button",className:E.value===o?.currentValue?"user-question-option selected":"user-question-option",disabled:g||E.value==="custom",onClick:()=>k(E),children:[v.jsx("span",{className:"user-question-option-label",children:Vv(E.value,E.name,u)}),E.description?v.jsx("span",{className:"user-question-option-desc",children:E.description}):null]})},E.value))}),h?v.jsxs("div",{className:"settings-confirm",children:[v.jsx("p",{className:"user-question-text",children:u("permission.confirmTitle")}),v.jsx("p",{className:"user-question-hint",children:h.value==="auto"?u("permission.confirmAuto"):u("permission.confirmFull")}),v.jsxs("div",{className:"user-question-row",children:[v.jsx("button",{type:"button",className:"user-question-skip",disabled:g,onClick:()=>m(null),children:u("permission.cancel")}),v.jsx("button",{type:"button",className:"user-question-submit",disabled:g,onClick:()=>{x(h.value)},children:u("permission.confirm")})]})]}):null,p?v.jsx("p",{className:"user-question-status exception",children:p}):null]})}function uO({onClose:n,authorization:l,catalog:r}){const{t:a}=Je(),[u,o]=z.useState(!0),[f,h]=z.useState([]),[m,p]=z.useState([]),[y,g]=z.useState([]),[S,x]=z.useState({}),[k,T]=z.useState(""),[C,E]=z.useState(!1),[M]=z.useState(()=>n1(async()=>{const _=await tt("/authorization");if(_.status!==200)throw new Error("Authorization catalog unavailable");return _.body})),H=r??M,te=z.useRef(!0),ie=z.useRef(0);async function O(_=!1){if(document.hidden)return;_&&H.invalidate();const K=++ie.current;try{const ee=await H.get();if(!te.current||K!==ie.current)return;o(ee.available!==!1),h(Array.isArray(ee.entries)?ee.entries:[]),l||(p(Array.isArray(ee.notices)?ee.notices:[]),g(Array.isArray(ee.prompts)?ee.prompts:[]))}catch{te.current&&K===ie.current&&T(a("auth.failed"))}}z.useEffect(()=>{l&&(o(l.available!==!1),(Array.isArray(l.prompts)&&l.prompts.length>0||Array.isArray(l.inFlight)&&l.inFlight.length>0)&&E(!1),p(Array.isArray(l.notices)?l.notices:[]),g(Array.isArray(l.prompts)?l.prompts:[]))},[l]),z.useEffect(()=>{te.current=!0,O();const _=()=>{document.hidden||O(!0)},K=window.setInterval(()=>{O()},3e4);return document.addEventListener("visibilitychange",_),()=>{te.current=!1,ie.current++,window.clearInterval(K),document.removeEventListener("visibilitychange",_)}},[H,l?.catalogRevision]);async function X(_,K){E(!0),T("");try{const ee=await tt("/authorization/begin",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:_.key,method:K})});(ee.status!==200||ee.body.ok===!1)&&T(typeof ee.body.message=="string"?ee.body.message:a("auth.failed")),await O(!0)}catch{T(a("auth.failed"))}finally{E(!1)}}async function le(_,K=!1,ee){E(!0),T("");try{const Ee=await tt("/authorization/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({promptId:_.promptId,value:K?void 0:ee??S[_.promptId]??"",declined:K})});(Ee.status!==200||Ee.body.ok===!1)&&T(typeof Ee.body.message=="string"?Ee.body.message:a("auth.failed")),await O(!0)}catch{T(a("auth.failed"))}finally{E(!1)}}async function me(_){E(!0);try{await tt("/authorization/cancel",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:_.key})}),await O(!0)}finally{E(!1)}}return v.jsxs(Lh,{title:a("auth.title"),closeLabel:a("auth.close"),onClose:n,children:[u?null:v.jsx("p",{className:"user-question-hint",children:a("auth.unavailable")}),u&&f.length===0&&y.length===0?v.jsx("p",{className:"user-question-hint",children:a("auth.empty")}):null,m.map((_,K)=>v.jsxs("p",{className:"user-question-hint",children:[_.message,_.code?` · ${_.code}`:"",_.url?v.jsxs(v.Fragment,{children:[" ",v.jsx("a",{href:_.url,target:"_blank",rel:"noreferrer",children:_.url})]}):null]},`${_.message}-${K}`)),y.map(_=>v.jsxs("article",{className:"user-question",children:[v.jsx("p",{className:"user-question-text",children:_.message}),_.kind==="select"?v.jsx("ul",{className:"user-question-options",children:(_.options??[]).map(K=>v.jsx("li",{children:v.jsxs("button",{type:"button",className:"user-question-option",disabled:C,onClick:()=>{le(_,!1,K.id)},children:[v.jsx("span",{className:"user-question-option-label",children:K.label}),K.description?v.jsx("span",{className:"user-question-option-desc",children:K.description}):null]})},K.id))}):_.kind==="secret"?v.jsxs("label",{className:"user-question-custom",children:[v.jsx("span",{className:"user-question-secret",children:a("auth.secretMask")}),v.jsx("input",{type:"text",className:"user-question-secret-input",autoComplete:"off",autoCorrect:"off",spellCheck:!1,value:S[_.promptId]??"",placeholder:_.placeholder,disabled:C,onChange:K=>x(ee=>({...ee,[_.promptId]:K.target.value}))})]}):v.jsx("label",{className:"user-question-custom",children:v.jsx("input",{type:"text",value:S[_.promptId]??"",placeholder:_.placeholder,disabled:C,onChange:K=>x(ee=>({...ee,[_.promptId]:K.target.value}))})}),v.jsxs("div",{className:"user-question-row",children:[v.jsx("button",{type:"button",className:"user-question-skip",disabled:C,onClick:()=>{le(_,!0)},children:a("auth.cancel")}),_.kind!=="select"?v.jsx("button",{type:"button",className:"user-question-submit",disabled:C||_.kind!=="secret"&&!(S[_.promptId]??"").trim(),onClick:()=>{le(_)},children:a("auth.writeVault")}):null]})]},_.promptId)),f.map(_=>{const K={..._,inFlight:_.inFlight||Array.isArray(l?.inFlight)&&l.inFlight.some(ee=>JSON.stringify(ee)===JSON.stringify(_.key))};return v.jsxs("article",{className:"user-question",children:[v.jsx("p",{className:"user-question-text",children:K.label}),v.jsxs("div",{className:"user-question-row",children:[K.methods.map(ee=>v.jsx("button",{type:"button",className:"user-question-submit",disabled:C||K.inFlight,onClick:()=>{X(K,ee.id)},children:ee.label||a("auth.start")},ee.id)),K.inFlight?v.jsx("button",{type:"button",className:"user-question-skip",disabled:C,onClick:()=>{me(K)},children:a("auth.cancel")}):null]})]},JSON.stringify(K.key))}),k?v.jsx("p",{className:"user-question-status exception",children:k}):null]})}function oO({onClose:n}){const{t:l,locale:r}=Je(),[a,u]=z.useState(!1),[o,f]=z.useState(!1),[h,m]=z.useState(null),[p,y]=z.useState([]),[g,S]=z.useState([]),[x,k]=z.useState(""),[T,C]=z.useState(!1);async function E(){const H=await tt(`/cua?locale=${encodeURIComponent(r)}`);f(!0),u(H.body.available===!0);const te=H.body.systemStatus;m(te&&typeof te=="object"?te:null);const ie=H.body.applications;if(ie&&typeof ie=="object"){const O=ie;y(Array.isArray(O.allowedApps)?O.allowedApps:[]),S(Array.isArray(O.blockedApps)?O.blockedApps:[])}}z.useEffect(()=>{E()},[r]);async function M(H,te={}){C(!0),k("");try{const ie=await tt("/cua",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:H,locale:r,...te})});(ie.status!==200||ie.body.ok===!1)&&k(typeof ie.body.message=="string"?ie.body.message:l("cua.failed")),await E()}catch{k(l("cua.failed"))}finally{C(!1)}}return o&&!a?null:v.jsxs(Lh,{title:l("cua.title"),closeLabel:l("cua.close"),onClose:n,children:[v.jsx("h4",{className:"user-question-header",children:l("cua.system")}),["accessibility","screenRecording"].map(H=>v.jsxs("div",{className:"user-question-row",children:[v.jsxs("p",{className:"user-question-text",children:[l(H==="accessibility"?"cua.accessibility":"cua.screenRecording"),v.jsx("span",{className:"user-question-hint",children:h?.[H]?l("cua.granted"):l("cua.missing")})]}),v.jsx("button",{type:"button",className:"user-question-submit",disabled:T,onClick:()=>{M("requestPermission",{permission:H})},children:l("cua.request")}),v.jsx("button",{type:"button",className:"user-question-skip",disabled:T,onClick:()=>{M("openSettings",{permission:H})},children:l("cua.openSettings")})]},H)),v.jsx("h4",{className:"user-question-header",children:l("cua.grants")}),p.length===0?v.jsx("p",{className:"user-question-hint",children:l("cua.emptyGrants")}):null,p.map(H=>v.jsxs("div",{className:"user-question-row",children:[v.jsx("p",{className:"user-question-text",children:H.name}),v.jsx("button",{type:"button",className:"user-question-skip",disabled:T,onClick:()=>{M("revoke",{id:H.id})},children:l("cua.revoke")})]},H.id)),v.jsx("h4",{className:"user-question-header",children:l("cua.blocked")}),g.length===0?v.jsx("p",{className:"user-question-hint",children:l("cua.emptyBlocked")}):null,g.map(H=>v.jsxs("div",{className:"user-question-row",children:[v.jsx("p",{className:"user-question-text",children:H.name}),v.jsx("button",{type:"button",className:"user-question-submit",disabled:T,onClick:()=>{M("retryApproval",{id:H.id})},children:l("cua.askAgain")})]},H.id)),x?v.jsx("p",{className:"user-question-status exception",children:x}):null]})}function cO(n){const l=[],r=new Set;for(const a of n){if(a.kind==="user"){l.push({id:a.id});continue}const u=a.turn??-1;r.has(u)||(r.add(u),l.push({id:`turn:${u}`}))}return l}function c1(n){return Array.isArray(n)?n.filter(l=>l?.type==="text"&&typeof l.text=="string").map(l=>l.text??"").join(`
55
+ `).trim():""}function Bh(n){const l=n.message;return l&&typeof l=="object"?l:Array.isArray(n.content)||typeof n.toolCallId=="string"?n:null}function ko(n){if(typeof n=="string")return n;if(n&&typeof n=="object")try{return JSON.stringify(n)}catch{return""}return""}function nt(n){return typeof n=="number"?n:void 0}function fO(n){if(!n||typeof n!="object")return null;const l=n;if(l.kind==="error"){const r=typeof l.error?.message=="string"&&l.error.message!==""?l.error.message:"This turn failed",a=typeof l.error?.code=="string"?l.error.code:void 0;return{message:r,...a?{code:a}:{}}}return l.kind==="interrupted"?{message:"The DSH process exited before this turn finished.",code:"INTERRUPTED"}:l.kind==="aborted"&&l.reason?.kind==="hook"&&l.reason.reason==="deepseek-account/signed-out"?{message:"Stopped because you signed out of DeepSeek.",code:"ACCOUNT_SIGNED_OUT"}:null}function Uo(n,l){return`${n??""}:${l??""}`}function ws(n){return n.sort((l,r)=>l.seq-r.seq)}function dO(n,l){const r=n.findIndex(a=>a.kind==="user"&&a.optimistic&&a.text.trim()===l.text.trim());if(r>=0){const a=n.slice(),u=a[r];return!u||u.kind!=="user"?n:(a[r]={...u,optimistic:!1,time:l.time??u.time,seq:l.seq,turn:l.turn},a)}return ws([...n,l])}function hO(n,l){const r=l.trim();if(!r)return"";try{const a=JSON.parse(r),u=typeof a.command=="string"?a.command:"",o=typeof a.description=="string"?a.description:"",f=["path","file_path","file","target_file","target"].map(m=>a[m]).find(m=>typeof m=="string"),h=typeof a.query=="string"?a.query:typeof a.pattern=="string"?a.pattern:typeof a.prompt=="string"?a.prompt:"";return(u||(typeof f=="string"?f:"")||h||o||n).replace(/\s+/g," ").trim()}catch{return r.replace(/\s+/g," ").trim()}}function f1(n){const l=[];let r=[],a=0;const u=()=>{r.length!==0&&(l.push({type:"activity",id:`activity:${a++}`,segments:r}),r=[])};for(const o of n)o.kind==="assistant"?(u(),l.push({type:"text",segment:o})):o.kind==="tool"&&l1(o.name)?(u(),l.push({type:"question",segment:o})):(o.kind==="think"||o.kind==="tool")&&r.push(o);return u(),l}function pO(n){let l;try{const u=JSON.parse(n.args);if(!u||typeof u!="object")return null;l=u}catch{return null}const r=n.name.toLowerCase(),a=mO(l,["file_path","path","file"]);if(!a)return null;if(r==="write"){const u=typeof l.content=="string"?l.content:"",o=Eo(u).map(f=>({kind:"add",text:f}));return Yv(a,u.length,o,o.length,0)}if(r==="edit"||r==="apply_patch"||r==="str_replace_editor"){const u=typeof l.old_string=="string"?l.old_string:typeof l.old_str=="string"?l.old_str:null,o=typeof l.new_string=="string"?l.new_string:typeof l.new_str=="string"?l.new_str:typeof l.content=="string"?l.content:typeof l.file_text=="string"?l.file_text:"",f=u==null||u===""?Eo(o).map(p=>({kind:"add",text:p})):gO(u,o),h=f.filter(p=>p.kind==="add").length,m=f.filter(p=>p.kind==="del").length;return Yv(a,o.length,f,h,m)}return null}function Yv(n,l,r,a,u){const o=n.split("/").filter(Boolean).at(-1)??n;return{path:n,name:o,language:yO(o),kilobytes:Math.max(1,Math.ceil(l/1024)),added:a,removed:u,lines:r}}function mO(n,l){for(const r of l){const a=n[r];if(typeof a=="string"&&a.trim())return a.trim()}return""}function Eo(n){return n===""?[]:(n.endsWith(`
56
+ `)?n.slice(0,-1):n).split(`
57
+ `)}function gO(n,l){const r=Eo(n),a=Eo(l);if(r.length>180||a.length>180)return[...r.map(y=>({kind:"del",text:y})),...a.map(y=>({kind:"add",text:y}))];const u=r.length+1,o=a.length+1,f=Array.from({length:u},()=>Array(o).fill(0));for(let y=r.length-1;y>=0;y-=1)for(let g=a.length-1;g>=0;g-=1){const S=f[y],x=f[y+1];!S||!x||(S[g]=r[y]===a[g]?(x[g+1]??0)+1:Math.max(x[g]??0,S[g+1]??0))}const h=[];let m=0,p=0;for(;m<r.length&&p<a.length;)r[m]===a[p]?(h.push({kind:"context",text:r[m]??""}),m+=1,p+=1):(f[m+1]?.[p]??0)>=(f[m]?.[p+1]??0)?(h.push({kind:"del",text:r[m]??""}),m+=1):(h.push({kind:"add",text:a[p]??""}),p+=1);for(;m<r.length;)h.push({kind:"del",text:r[m]??""}),m+=1;for(;p<a.length;)h.push({kind:"add",text:a[p]??""}),p+=1;return h}function yO(n){const l=n.split(".").pop()?.toLowerCase()??"";return{py:"python",ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",md:"markdown",css:"css",html:"html",json:"json",sh:"bash",yml:"yaml",yaml:"yaml",go:"go",rs:"rust",rb:"ruby"}[l]??""}function vO(n){return(n.split(`
58
+ `).map(r=>r.trim()).find(Boolean)??"").replaceAll("**","")}function d1(n,l){const r=n.findIndex(g=>g.kind==="tool"&&g.callId===l.callId);if(r<0)return ws([...n,l]);const a=n[r];if(!a||a.kind!=="tool")return n;const u=n.slice(),o=a.resultReceived===!0||l.resultReceived===!0,h=l.resultReceived&&(!a.resultReceived||(l.resultSeq??-1)>(a.resultSeq??-1))?l:a,p=l.callReceived&&(!a.callReceived||(l.callSeq??-1)>(a.callSeq??-1))?l:a,y=(p.name!=="tool"?p.name:l.name)||a.name;return u[r]={...a,seq:!a.callReceived&&a.resultReceived&&l.callReceived?Math.min(a.seq,l.seq):a.seq,id:`tool:${l.callId}`,name:y,args:p.callReceived?p.args:l.args||a.args,callReceived:a.callReceived||l.callReceived,callSeq:p.callSeq,requestedAt:p.requestedAt,resultReceived:o,result:o?h.result:"",error:o?h.error:!1,errorCode:h.errorCode,meta:h.meta,resultSeq:h.resultSeq,settledAt:h.settledAt,status:o?Bo(y,h.result,h.error,h.errorCode):l.status??a.status,running:!o&&(l.running||a.running),turn:a.turn??l.turn,step:a.step??l.step},ws(u)}function bO(n,l,r,a,u,o){const f=`live:${l}:`,h=n.segments.filter(y=>y.id.startsWith(f));let m=n.segments.filter(y=>!y.id.startsWith(f)||y.kind==="tool"&&(y.callReceived||y.resultReceived));const p=[];for(const y of r){const g=a+y.index/100;if(y.kind==="reasoning"&&y.text.trim())p.push({kind:"think",id:`${f}think:${y.index}`,text:y.text,running:!0,seq:g,turn:u,step:o});else if(y.kind==="text"&&y.text)p.push({kind:"assistant",id:`${f}text:${y.index}`,text:y.text,streaming:!0,seq:g,turn:u,step:o});else if(y.kind==="tool-call"&&(y.name||y.args||y.id)){const S=y.id||`${f}tool:${y.index}`,x=[...m,...h].find(T=>T.kind==="tool"&&T.callId===S),k=m.findIndex(T=>T.kind==="tool"&&T.callId===S);if(k>=0){const T=m[k];if(T&&T.kind==="tool"&&!T.callReceived&&!T.resultReceived){const C=m.slice();C[k]={...T,name:y.name||T.name,args:y.args||T.args,running:T.resultReceived?!1:T.running,status:T.resultReceived||T.callReceived?T.status:"preparing"},m=C}}else p.push({kind:"tool",id:`${f}tool:${y.index}`,callId:S,name:y.name||x?.name||"tool",args:y.args||x?.args||"",result:x?.result??"",error:x?.error??!1,running:!x?.resultReceived,status:x?.status??"preparing",resultReceived:x?.resultReceived,seq:x?.seq??g,turn:u,step:o})}}return ws([...m,...p])}function h1(n,l,r){const a=n.find(u=>u.index===l);return a?a.kind===r?n:n.map(u=>u.index===l?{...u,kind:r}:u):[...n,{index:l,kind:r,text:"",id:"",name:"",args:""}].sort((u,o)=>u.index-o.index)}function oo(n,l,r,a){return h1(n,l,r).map(o=>o.index===l?a({...o,kind:r}):o)}function xO(n,l){const r=nt(l.index)??0,a=typeof l.type=="string"?l.type:"";if(a==="block-start"){const u=l.blockType==="reasoning"||l.blockType==="tool-call"||l.blockType==="text"?l.blockType:"text";return h1(n,r,u)}if(a==="text-delta"||a==="text-chunks"){const u=typeof l.text=="string"?l.text:Gv(l.texts);return oo(n,r,"text",o=>({...o,text:o.text+u}))}if(a==="reasoning-delta"||a==="reasoning-chunks"){const u=typeof l.text=="string"?l.text:Gv(l.texts);return oo(n,r,"reasoning",o=>({...o,text:o.text+u}))}if(a==="tool-call-delta"||a==="tool-call-chunks"){const u=typeof l.argumentsDelta=="string"?l.argumentsDelta:ko(l.args??l.arguments);return oo(n,r,"tool-call",o=>({...o,id:typeof l.id=="string"&&l.id?l.id:o.id,name:typeof l.name=="string"&&l.name?l.name:o.name,args:a==="tool-call-chunks"&&u?u:o.args+u}))}if(a==="block-end"&&l.block&&typeof l.block=="object"){const u=l.block,o=u.type==="reasoning"||u.type==="tool-call"||u.type==="text"?u.type:"text";return oo(n,r,o,f=>({...f,kind:o,text:typeof u.text=="string"?u.text:f.text,id:u.id||f.id,name:u.name||f.name,args:ko(u.arguments)||f.args}))}return n}function Gv(n){return Array.isArray(n)?n.filter(l=>typeof l=="string").join(""):""}function p1(n,l){const r=l.data??{},a=r.chunk;if(!a||typeof a!="object")return n;const u=nt(r.turn),o=nt(r.step),f=Uo(u,o),h=n.live[f]??{seq:l.seq??0,blocks:[]},m=xO(h.blocks,a),p={...n.live,[f]:{seq:h.seq||l.seq||0,blocks:m}},y=h.seq||l.seq||0;return{...n,live:p,drafting:!0,turn:u??n.turn,segments:bO({...n},f,m,y,u,o)}}function m1(n,l){const r=l.data??{},a=Bh(r),u=a?.content??[],o=nt(r.turn),f=nt(r.step),h=Uo(o,f),m={...n.live};delete m[h];let p=n.segments.filter(g=>!g.id.startsWith(`live:${h}:`));p=p.filter(g=>!((g.kind==="think"||g.kind==="assistant")&&g.turn===o&&g.step===f));const y=l.seq??0;return u.forEach((g,S)=>{const x=y+S/100;if(g.type==="reasoning"&&g.text?.trim())p.push({kind:"think",id:`think:${h}:${S}`,text:g.text,running:!1,seq:x,turn:o,step:f});else if(g.type==="text"&&g.text)p.push({kind:"assistant",id:`text:${h}:${S}`,text:g.text,streaming:!1,time:l.time,seq:x,turn:o,step:f,messageId:a?.id});else if(g.type==="tool-call"){const k=g.id||`call:${h}:${S}`,T=p.find(C=>C.kind==="tool"&&C.callId===k);p=p.filter(C=>!(C.kind==="tool"&&C.callId===k)),p.push({...T?.kind==="tool"?T:{},kind:"tool",id:`tool:${k}`,callId:k,name:T?.kind==="tool"&&T.callReceived?T.name:g.name||(T?.kind==="tool"?T.name:"")||"tool",args:T?.kind==="tool"&&T.callReceived?T.args:ko(g.arguments)||(T?.kind==="tool"?T.args:""),result:T?.kind==="tool"?T.result:"",error:T?.kind==="tool"?T.error:!1,running:T?.kind==="tool"?T.running&&!T.resultReceived:!0,status:T?.kind==="tool"?T.resultReceived?Bo(g.name||T.name,T.result,T.error,T.errorCode):T.status:"preparing",seq:x,turn:o,step:f})}}),{...n,live:m,segments:ws(p)}}function SO(n,l){const r=l.data??{},a=typeof r.callId=="string"?r.callId:"";if(!a)return n;const u=nt(r.turn),o=nt(r.step);return{...n,segments:d1(n.segments,{kind:"tool",id:`tool:${a}`,callId:a,name:typeof r.name=="string"?r.name:"tool",args:ko(r.arguments),status:n.turnEnds?.[u??-1]?"unknown":"waiting",callReceived:!0,callSeq:l.seq,requestedAt:l.time,result:"",error:!1,running:!0,seq:l.seq??Number.MAX_SAFE_INTEGER,turn:u,step:o})}}function wO(n,l){const r=l.data??{},a=Bh(r),u=a?.toolCallId??(typeof r.callId=="string"?r.callId:"");if(!u)return n;const o=c1(a?.content),f=nt(r.turn),h=nt(r.step),m=n.segments.find(p=>p.kind==="tool"&&p.callId===u);return{...n,segments:d1(n.segments,{kind:"tool",id:`tool:${u}`,callId:u,name:m?.kind==="tool"?m.name:"tool",args:m?.kind==="tool"?m.args:"",result:o,resultReceived:!0,resultSeq:l.seq,settledAt:l.time,meta:r.meta,errorCode:typeof r.error?.code=="string"?r.error.code:void 0,status:Bo(m?.kind==="tool"?m.name:"tool",o,a?.isError===!0,typeof r.error?.code=="string"?r.error.code:void 0),error:a?.isError===!0,running:!1,seq:m?.seq??l.seq??Number.MAX_SAFE_INTEGER,turn:f??(m?.kind==="tool"?m.turn:void 0),step:h??(m?.kind==="tool"?m.step:void 0)})}}function kO(n){if(!n||typeof n!="object")return null;const l=n,r=l.value;if(r&&typeof r=="object"&&!Array.isArray(r)){const a=r;if(typeof a.type=="string")return a}return typeof l.type=="string"?l:null}function g1(n,l){let r=l;for(const a of n.segments)a.seq>r&&(r=a.seq);return r+.5}function EO(n){if(!Array.isArray(n))return[];const l=[];for(const r of n){if(!r||typeof r!="object")continue;const a=r;if(a.type==="chunk"&&a.chunk&&typeof a.chunk=="object"){l.push({time:nt(a.time)??0,chunk:a.chunk});continue}const u=nt(a.index)??0,o=Array.isArray(a.texts)?a.texts:Array.isArray(a.args)?a.args:null;if(!o)continue;let f=nt(a.time0)??0;const h=Array.isArray(a.dt)?a.dt:[];o.forEach((m,p)=>{p>0&&(f+=nt(h[p-1])??0);const y=typeof m=="string"?m:"";a.type==="text-chunks"?l.push({time:f,chunk:{type:"text-delta",index:u,text:y}}):a.type==="reasoning-chunks"?l.push({time:f,chunk:{type:"reasoning-delta",index:u,text:y}}):a.type==="tool-call-chunks"&&l.push({time:f,chunk:{type:"tool-call-delta",index:u,id:typeof a.id=="string"?a.id:"",...typeof a.name=="string"?{name:a.name}:{},argumentsDelta:y}})})}return l}function y1(n,l,r,a,u,o){return p1(n,{seq:o,data:{turn:l,step:r,chunk:u}})}function oh(n,l,r,a=!1){const u=Uo(l,r),o={...n.live};return delete o[u],{...n,live:o,segments:n.segments.filter(f=>f.id.startsWith(`live:${u}:`)?f.kind==="tool"&&(f.callReceived===!0||f.resultReceived===!0):!(a&&f.kind!=="user"&&f.turn===l&&f.step===r&&(f.kind==="assistant"||f.kind==="think")))}}function TO(n,l){const r=n.streamAttempt;if(!r||l.surfaceOp!=null&&l.surfaceOp!=="append")return!1;const a=l.data??{};return nt(a.turn)!==r.turn||nt(a.step)!==r.step?!1:l.seq==null||l.seq>r.startedAfterSeq}function ds(n){const l=n.pendingAssistant;return{...l?m1(n,l):n,pendingAssistant:null,streamAttempt:null}}function AO(n,l,r){return{...n,streamAttempt:null,pendingAssistant:null,segments:n.segments.map(a=>a.kind==="user"||a.turn!==l||a.step!==r?a:a.kind==="think"?{...a,running:!1}:a.kind==="tool"?{...a,running:!1,status:a.resultReceived||!i1.has(Dh(a))?a.status:"unknown"}:a.kind==="assistant"?{...a,streaming:!1}:a)}}function v1(n,l,r){return!!n.turnEnds?.[l]||n.segments.some(a=>a.kind!=="user"&&a.turn===l&&a.step===r&&(a.kind==="tool"?a.callReceived||a.resultReceived:a.kind==="assistant"?!a.id.startsWith("live:")&&!a.streaming:a.kind==="think"&&!a.id.startsWith("live:")&&!a.running))}function CO(n,l){const r=nt(l.revision)??n.streamRevision;if(r<n.streamRevision)return n;let a={...n,streamRevision:r};const u=l.activeAttempt;if(!u||typeof u!="object")return{...a,streamAttempt:null};const o=u,f=typeof o.attemptId=="string"?o.attemptId:"",h=nt(o.turn),m=nt(o.step),p=nt(o.startedAfterSeq)??r;if(!f||h==null||m==null)return{...a,streamAttempt:null};if(v1(a,h,m))return{...a,streamAttempt:null};a=oh(a,h,m);const y=EO(o.stream),g=Math.min(nt(o.nextIndex)??y.length,y.length),S=g1(a,p);for(let x=0;x<g;x+=1){const k=y[x];k&&(a=y1(a,h,m,k.time,k.chunk,S))}return{...a,drafting:g>0||a.drafting,streamAttempt:{attemptId:f,turn:h,step:m,nextIndex:g,startedAfterSeq:p}}}function NO(n,l){const r=typeof l.type=="string"?l.type:"",a=nt(l.revision),u=typeof l.attemptId=="string"?l.attemptId:"";if(a==null||!u||a<=n.streamRevision)return n;if(r==="start"){const f=nt(l.turn),h=nt(l.step);if(f==null||h==null||v1(n,f,h))return n;const m=n.pendingAssistant?ds(n):n;return{...oh(m,f,h,!0),drafting:!0,streamRevision:a,streamAttempt:{attemptId:u,turn:f,step:h,nextIndex:0,startedAfterSeq:nt(l.startedAfterSeq)??n.streamRevision}}}if(a!==n.streamRevision+1)return{...ds(n),streamRevision:a};const o=n.streamAttempt;if(!o||n.turnEnds?.[o.turn]||o.attemptId!==u)return{...n,streamRevision:a};if(r==="chunk"){const f=nt(l.index),h=l.chunk;if(f==null||!h||typeof h!="object")return{...n,streamRevision:a};if(f!==o.nextIndex)return{...ds(n),streamRevision:a};const m=Uo(o.turn,o.step),p=n.live[m]?.seq||g1(n,o.startedAfterSeq);return{...y1(n,o.turn,o.step,nt(l.time)??0,h,p),streamRevision:a,streamAttempt:{...o,nextIndex:o.nextIndex+1}}}if(r==="end"){const f=l.outcome&&typeof l.outcome=="object"?l.outcome:{},h={...n,streamRevision:a};if(f.kind==="abandoned"){const m={...h,segments:h.segments.map(y=>y.kind==="tool"&&!y.callReceived&&!y.resultReceived&&y.turn===o.turn&&y.step===o.step?{...y,id:`tool:${y.callId}`,running:!1,status:"cancelled"}:y)};return{...oh(m,o.turn,o.step),streamAttempt:null,pendingAssistant:null}}return f.kind==="committed"&&f.eventType==="assistant/message"?{...ds(h),streamRevision:a}:{...AO(h,o.turn,o.step),streamRevision:a}}return{...n,streamRevision:a}}function jO(n,l,r=!1){const a=nt(n.pendingAssistant?.data?.turn),u=n.pendingAssistant&&(l==null||a===l)?ds(n):n,o=Object.fromEntries(Object.entries(u.live).filter(([f])=>!f.startsWith(`${l??""}:`)));return{...u,live:o,segments:u.segments.filter(f=>!(typeof l=="number"&&f.id.startsWith(`live:${l}:`))||f.kind==="tool").map(f=>f.turn!==l?f:f.kind==="think"?{...f,running:!1}:f.kind==="tool"?{...f,running:!1,status:f.resultReceived||!i1.has(Dh(f))?f.status:r&&!f.callReceived?"cancelled":"unknown"}:f.kind==="assistant"?{...f,streaming:!1}:f)}}function OO(n,l){const r=l.projections,a=r&&typeof r=="object"?r.values??{}:{},u={...n};typeof a.title=="string"&&(u.title=a.title);const o=a.modelSelection&&typeof a.modelSelection=="object"?a.modelSelection.lastUsed:void 0;o?.model&&(u.model=o.model);const f=a.permissions;if(f&&typeof f=="object"){const m=f,p=m.currentValue??m.preset??m.sandbox;typeof p=="string"&&(u.preset=p)}const h=a.sessionStats;if(h&&typeof h=="object"){const m=h.turns,p=h.steps;typeof m=="number"&&(u.turns=m),typeof p=="number"&&(u.steps=p)}return u}function zO(n,l){if(typeof l.type!="string")return n;let r=n;const a=l.data??{};if(l.type==="session/title"&&typeof a.title=="string"){const u=a.source&&typeof a.source=="object"?a.source.kind:"";return r.title&&u!=="provider"||(r={...r,title:a.title}),r}if(l.type==="request/context"){const u=typeof a.model=="string"?a.model:"";return u&&(r={...r,model:u}),r}if(l.type==="turn/start"){const u=nt(a.turn);return r={...r,drafting:!0,turn:u??r.turn,turnStartedAt:typeof l.time=="number"?l.time:Date.now()},r}if(l.type==="turn/end"){const u=nt(a.turn)??r.turn,o={...r.completed};u!=null&&r.turn===u&&r.turnStartedAt!=null&&typeof l.time=="number"&&(o[u]=Math.max(1,Math.round((l.time-r.turnStartedAt)/1e3)));const f=u==null?null:fO(a.reason),h=f==null||u==null?r.failures:{...r.failures,[u]:f},m=a.reason&&typeof a.reason=="object"&&typeof a.reason.kind=="string"?a.reason.kind:"",p=u==null?r.turnEnds??{}:{...r.turnEnds??{},[u]:m||r.turnEnds?.[u]||"ended"};return r=jO(r,u,m==="aborted"),r={...r,drafting:r.turn===u?!1:r.drafting,completed:o,failures:h,turnEnds:p,turnStartedAt:r.turn===u?null:r.turnStartedAt},r}if(l.type==="llm/retry"){const u=nt(a.turn),o=typeof a.retryId=="string"?a.retryId:"",f=nt(a.retry);if(u==null||o===""||f==null)return r;const h=a.failure&&typeof a.failure=="object"?a.failure:{},m={retryId:o,retry:f,maxRetries:nt(a.maxRetries)??null,delayMs:typeof a.delayMs=="number"?a.delayMs:0,message:typeof h.message=="string"?h.message:"Request failed.",...typeof h.code=="string"?{code:h.code}:{},state:"scheduled"},p=r.retries[u]??[];return r={...r,retries:{...r.retries,[u]:[...p.filter(y=>y.retryId!==o||y.retry!==f),m]}},r}if(l.type==="llm/retry-started"){const u=nt(a.turn),o=typeof a.retryId=="string"?a.retryId:"",f=nt(a.retry);if(u==null||o===""||f==null)return r;const h=r.retries[u];return h&&(r={...r,retries:{...r.retries,[u]:h.map(m=>m.retryId===o&&m.retry===f?{...m,state:"started"}:m)}}),r}if(l.type==="assistant/live-chunk")return r=p1(r,l),r;if(l.type==="user/message"){const u=Bh(a);if(!u||u.source?.kind!=="user")return r;const o=c1(u.content);return o&&(r={...r,segments:dO(r.segments,{kind:"user",id:`user:${l.seq??o}`,text:o,time:l.time,seq:l.seq??Number.MAX_SAFE_INTEGER,turn:nt(a.turn)})}),r}return l.type==="assistant/message"?(TO(r,l)?r={...r,pendingAssistant:l}:r=m1(r,l),r):l.type==="tool/call"?(r=SO(r,l),r):(l.type==="tool/result"&&(r=wO(r,l)),r)}function _O(n,l){const r=kO(l)??(l&&typeof l=="object"?l:null);if(!r)return n;let a=n;if(r.type==="snapshot"){a=OO(a,r);const u=r.assistantStream;u&&typeof u=="object"&&(a=CO(a,u))}if(r.type==="assistant-stream"){const u=r.frame;u&&typeof u=="object"&&(a=NO(a,u))}return a}function qO(n){for(let l=n.length-1;l>=0;l-=1){const r=n[l];if(!r||r.kind==="user"&&Nb(r.text))continue;const a=r.kind==="user"?Lo(r.text):null,u=r.kind==="user"?dh(r.text):null,f=(a?a.body:u?.body?u.body:r.kind==="user"||r.kind==="assistant"?r.text:r.kind==="tool"?r.result||hO(r.name,r.args):vO(r.text)).replace(/```[\s\S]*?```/g," ").replace(/^#{1,6}\s+/gm,"").replace(/[|*_`>]/g," ").replace(/\s+/g," ").trim();if(f)return f.slice(0,80)}return""}function To(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function Fv(n,l){if(!To(n))return;if(l==="ticket.id"){const a=n.ticket;if(!To(a))return;const u=a.id;return typeof u=="string"&&u!==""?u:void 0}const r=n[l];if(typeof r=="string"&&r!=="")return r;if(typeof r=="number"&&Number.isFinite(r))return String(r)}function ks(n,l){if(!To(l)||l.t!=="v"&&l.t!=="o"&&l.t!=="l")return n;const r=l;return r.t==="v"?r.v:r.t==="o"?RO(n,r):MO(n,r)}function RO(n,l){const r=To(n)?{...n}:{};for(const a of l.d??[])delete r[a];for(const[a,u]of Object.entries(l.s))r[a]=ks(r[a],u);return r}function MO(n,l){const r=l.id,a=Array.isArray(n)?n.slice():[],u=new Set(l.d??[]),o=[],f=new Map;for(const m of a){const p=Fv(m,r);p!==void 0&&u.has(p)||(p!==void 0&&f.set(p,o.length),o.push(m))}for(const[m,p]of Object.entries(l.s??{})){const y=f.get(m);if(y===void 0){o.push(ks(void 0,p));continue}o[y]=ks(o[y],p)}if(!l.order)return o;const h=new Map;for(const m of o){const p=Fv(m,r);p!==void 0&&h.set(p,m)}return l.order.filter(m=>h.has(m)).map(m=>h.get(m))}const DO=1,LO=500,BO={minMessages:50,minTurns:2},UO=500,HO=2e3,IO=256*1024,VO=6,YO=3,GO=5e3,FO=8*1024*1024,QO=2e3,XO=500,ZO=1e4,Dd=3,b1=64*1024*1024,x1="/api/dsh-bot/log/range",KO="/api/dsh-bot/log/manifest",JO="/api/dsh-bot/log/chunk",$O="/api/session/events",PO=3e3,WO=3e4,e3=1e3,t3=15e3;class n3{appliedSeq;headSeq=null;pending=new Map;pendingBytes=0;constructor(l=-1){this.appliedSeq=l}setHead(l){(this.headSeq==null||l>this.headSeq)&&(this.headSeq=l)}push(l){const r=[];for(const o of l)if(!(typeof o.seq!="number"||!Number.isFinite(o.seq))&&!(o.seq<=this.appliedSeq)){if(o.seq===this.appliedSeq+1){r.push(o),this.appliedSeq=o.seq,this.flushPending(r);continue}this.pending.has(o.seq)||(this.pending.set(o.seq,o),this.pendingBytes+=Qv(o))}let a=null;(this.pending.size>GO||this.pendingBytes>FO)&&(a={afterSeq:this.appliedSeq,dropped:this.pending.size},this.pending.clear(),this.pendingBytes=0);const u=this.nextGap();return{delivered:r,gapTo:u,overflow:a}}flushPending(l){for(;this.pending.has(this.appliedSeq+1);){const r=this.pending.get(this.appliedSeq+1);if(this.pending.delete(this.appliedSeq+1),!r)break;this.pendingBytes=Math.max(0,this.pendingBytes-Qv(r)),l.push(r),this.appliedSeq=r.seq}}nextGap(){if(this.pending.size===0)return null;let l=Number.POSITIVE_INFINITY;for(const r of this.pending.keys())r<l&&(l=r);return Number.isFinite(l)?l:null}}function Qv(n){return 64+(typeof n.type=="string"?n.type.length:0)}function ia(n,l){return{kind:"session",sessionId:n}}function Xv(n){const l=n.addressOf??(a=>ia(a)),r=n.openingMessages??DO;return{kind:"ws-follow",open(a,u,o){return new Promise(f=>{const h=typeof location<"u"&&location.protocol==="https:"?"wss:":"ws:",m=typeof location<"u"?location.host:"127.0.0.1",p=n.url??`${h}//${m}/api/remote.mux`,y=(n.websocket??(C=>new WebSocket(C)))(p),g=`follow-${Math.random().toString(36).slice(2)}`;let S=!1;const x=()=>!S&&y.readyState===1,k=C=>{if(!S){S=!0,o.removeEventListener("abort",T);try{y.close()}catch{}f(C)}},T=()=>k({ok:!1,retryable:!1,code:"ABORTED"});o.addEventListener("abort",T),y.addEventListener("open",()=>{o.aborted||y.send(JSON.stringify({type:"open",streamId:g,endpoint:"session/follow",payload:{args:{request:{address:l(a.sessionId),maxMessages:r,assistantStream:!0,activate:!0}}}}))}),y.addEventListener("message",C=>{let E;try{E=JSON.parse(String(C.data))}catch{return}if(E.streamId===g){if(E.type==="error"){k({ok:!1,retryable:!0,code:"FOLLOW_ERROR",message:E.error?.message});return}if(E.type==="end"){k({ok:!0,throughSeq:-1});return}E.type==="item"&&i3(E.value,u,x)}}),y.addEventListener("close",()=>k({ok:!1,retryable:!0,code:"FOLLOW_CLOSED"})),y.addEventListener("error",()=>k({ok:!1,retryable:!0,code:"FOLLOW_ERROR"}))})}}}function i3(n,l,r){const a=S1(n);if(!a)return;if(a.type==="snapshot"){const o=typeof a.cursor=="number"?a.cursor:-1,f=Es(a.records),h=f.length>0?Math.min(...f.map(p=>p.seq)):o+1,m=a.hasMore===!0;l.opened({firstSeq:h,cursor:o,hasMore:m,...r?{alive:r}:{}}),l.head(o),f.length&&l.events(f),l.ephemeral(a);return}if(a.type==="assistant-stream"){l.ephemeral(a);return}const u=Es(a);u.length&&l.events(u)}function S1(n){if(!n||typeof n!="object")return null;const l=n;if(typeof l.type=="string"&&(l.type==="snapshot"||l.type==="assistant-stream"||l.type==="event"))return l;const r=l.value;return r&&typeof r=="object"&&!Array.isArray(r)?S1(r):l}function Es(n){const l=[];return ho(n,l),l.sort((r,a)=>r.seq-a.seq)}function ho(n,l){if(!n)return;if(Array.isArray(n)){for(const u of n)ho(u,l);return}if(typeof n!="object")return;const r=n;if(r.event&&typeof r.event=="object"){const u=Zv(r.event);u&&l.push(u);return}const a=Zv(r);a&&l.push(a),Array.isArray(r.records)&&ho(r.records,l),Array.isArray(r.events)&&ho(r.events,l)}function Zv(n){if(!n||typeof n!="object")return null;const l=n;return typeof l.type!="string"||typeof l.seq!="number"?null:{type:l.type,seq:l.seq,time:typeof l.time=="number"?l.time:0,data:l.data,...l.surfaceOp!==void 0?{surfaceOp:l.surfaceOp}:{},...l.sourceEventSeqs!==void 0?{sourceEventSeqs:l.sourceEventSeqs}:{}}}function Kv(n={}){const l=n.fetch??fetch,r=n.url??x1;return{kind:"plugin-range",async fetch(a,u,o){if(a.throughSeq<=a.afterSeq)return{ok:!0,throughSeq:a.throughSeq};let f=a.afterSeq;try{for(;!o.aborted;){const h=new URLSearchParams({sessionId:a.sessionId,afterSeq:String(f),throughSeq:String(a.throughSeq),limit:String(UO)}),m=await l(`${r}?${h}`,{method:"GET",credentials:"same-origin",signal:o,headers:{accept:"application/json"}});if(m.status===404)return{ok:!1,retryable:!1,code:"ENHANCE_UNAVAILABLE"};if(!m.ok)return{ok:!1,retryable:m.status>=500,code:"RANGE_ERROR",message:`HTTP ${m.status}`};const p=await m.json(),y=Es(p.events);if(y.length&&u.events(y,{throughSeq:a.throughSeq}),p.nextAfterSeq==null)return{ok:!0,throughSeq:a.throughSeq};if(p.nextAfterSeq<=f)return{ok:!1,retryable:!0,code:"RANGE_STALLED"};f=p.nextAfterSeq}return{ok:!1,retryable:!1,code:"ABORTED"}}catch(h){return o.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!1,retryable:!0,code:"RANGE_ERROR",message:h instanceof Error?h.message:String(h)}}}}}async function l3(n=fetch,l=x1,r){try{return(await n(l,{method:"HEAD",credentials:"same-origin",signal:r})).ok}catch{return!1}}const r3=n=>{if(typeof document>"u"||typeof window>"u")return()=>{};let l=document.visibilityState==="hidden"?Date.now():null;const r=()=>l==null?0:Math.max(0,Date.now()-l),a=()=>{if(document.visibilityState==="hidden"){l==null&&(l=Date.now());return}const m=r();l=null,n({reason:"visible",hiddenMs:m})},u=()=>{l==null&&(l=Date.now())},o=m=>{const p=r();l=null,n({reason:"pageshow",hiddenMs:p,persisted:m.persisted})},f=()=>n({reason:"online",hiddenMs:r()}),h=()=>{if(document.visibilityState==="hidden")return;const m=r();l=null,n({reason:"focus",hiddenMs:m})};return document.addEventListener("visibilitychange",a),window.addEventListener("pagehide",u),window.addEventListener("pageshow",o),window.addEventListener("online",f),window.addEventListener("focus",h),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("pagehide",u),window.removeEventListener("pageshow",o),window.removeEventListener("online",f),window.removeEventListener("focus",h)}};function a3(){return typeof document<"u"&&document.visibilityState==="hidden"}function Jv(n){return{open(l,r){return s3(n,l,r??{})}}}function s3(n,l,r){const a=new AbortController,u=new Set,o=new Set,f=new Set;let h={phase:"restoring",appliedSeq:-1,headSeq:null,lag:null,fraction:null},m;const p=new Promise(J=>{m=J});let y=!1;const g=J=>{y||(y=!0,m(J))};let S=[],x=!1,k=null;const T=n.raf??(typeof requestAnimationFrame=="function"?requestAnimationFrame:J=>setTimeout(J,0)),C=n.cancelRaf??(typeof cancelAnimationFrame=="function"?cancelAnimationFrame:clearTimeout),E=()=>{k!=null&&(k.kind==="timer"?clearTimeout(k.id):C(k.id),k=null)},M=n.wait??o3,H=n.random??Math.random,te=n.now??Date.now,ie=n.isHidden??a3,O=()=>{if(k=null,S.length===0)return;const J=S;S=[];const he={events:J,fromCache:x};x=!1;for(const ut of u)ut(he)},X=()=>{E(),O()},le=(J,he=!1)=>{if(J.length===0||(he&&(x=!0),S.push(...J),k!=null))return;const ut={kind:ie()?"timer":"raf",id:null};k=ut,ut.id=ut.kind==="timer"?setTimeout(O,0):T(O)},me=J=>{h={...h,...J,lag:(J.headSeq??h.headSeq)==null||(J.appliedSeq??h.appliedSeq)==null?J.lag??h.lag:(J.headSeq??h.headSeq)-(J.appliedSeq??h.appliedSeq)};for(const he of f)he(h)};let _=0,K=!1,ee=0,Ee=!0,qe=null,re=!1,F=null,ue=null,ce=!1,Te=te(),N=Number.NEGATIVE_INFINITY;const lt=async J=>{if(a.signal.aborted)return;if(re){re=!1;return}const he=new AbortController;qe=he;const ut=()=>he.abort();a.signal.addEventListener("abort",ut,{once:!0});try{await M(J,he.signal)}catch{}finally{a.signal.removeEventListener("abort",ut),qe===he&&(qe=null)}},pt=()=>{const J=ce;return ce=!1,J},R=J=>{if(!Ee||a.signal.aborted)return;X();const he=te(),ut=ue?ue():!0,Et=he-Te>=WO,ke=!ut||J.reason==="online"||J.persisted===!0||J.hiddenMs>=PO||J.reason!=="focus"&&Et;if(ee=0,_=0,K=!1,qe){qe.abort();return}if(!F){re=!0;return}ke&&(he-N<e3||(N=he,F.signal.aborted||(ce=!0,F.abort())))};q();async function q(){try{await ne()}finally{Ee=!1,we()}}async function ne(){const J=await n.checkpoint.getCursor(l);let he=J?.appliedSeq??-1;const ut=await n.checkpoint.readEvents(l,-1),Et=u3(ut,-1).filter(Re=>Re.seq<=he||he<0);he<0&&Et.length&&(he=Et[Et.length-1].seq);const ke=new n3(he);J?.headSeq!=null&&ke.setHead(J.headSeq),Et.length&&le(Et,!0),me({phase:"connecting",appliedSeq:ke.appliedSeq,headSeq:ke.headSeq});let dt=r.enhancement==="off"?!1:await fe();const $e=()=>({events(Re){const st=ke.push(Re);ke.headSeq!=null&&ke.appliedSeq>ke.headSeq&&ke.setHead(ke.appliedSeq),st.delivered.length&&(le(st.delivered),n.checkpoint.putEvents(l,st.delivered),n.checkpoint.setCursor(l,ke.appliedSeq,ke.headSeq)),me({appliedSeq:ke.appliedSeq,headSeq:ke.headSeq,fraction:h.fraction}),st.overflow},head(Re){ke.setHead(Re),me({headSeq:ke.headSeq,appliedSeq:ke.appliedSeq})},progress(Re){const st=Re.total&&Re.total>0?Math.min(1,Re.loaded/Re.total):null;me({fraction:st,appliedSeq:ke.appliedSeq,headSeq:ke.headSeq})},ephemeral(Re){for(const st of o)st(Re)},opened(){}}),Ie=async(Re,st,mt)=>{if(st<=Re)return{ok:!0,throughSeq:st};me({phase:"syncing",fraction:h.fraction});const It=st-Re,Mt=$e(),Ft=dt&&n.cdc!=null&&(It>HO||It*128>IO);if(dt&&n.range!=null&&!Ft&&n.range){const Qt=await n.range.fetch({sessionId:l,afterSeq:Re,throughSeq:st},Mt,mt);if(Qt.ok||mt.aborted)return Qt;dt=!1}else if(Ft&&n.cdc){const Qt=await n.cdc.fetch({sessionId:l,afterSeq:Re,throughSeq:st},Mt,mt);if(Qt.ok||mt.aborted)return Qt;dt=!1}return n.page.fetch({sessionId:l,afterSeq:ke.appliedSeq,throughSeq:st},Mt,mt)};for(;!a.signal.aborted;){if(K){me({phase:"stalled",appliedSeq:ke.appliedSeq,headSeq:ke.headSeq,fraction:null});const Ne=new AbortController,De=()=>Ne.abort();a.signal.addEventListener("abort",De);const qt=ke.headSeq??ke.appliedSeq,Sn=await n.page.fetch({sessionId:l,afterSeq:ke.appliedSeq,throughSeq:Math.max(qt,ke.appliedSeq)},$e(),Ne.signal);a.signal.removeEventListener("abort",De),Sn.ok&&ke.headSeq!=null&&ke.appliedSeq>=ke.headSeq&&(me({phase:"live",appliedSeq:ke.appliedSeq,headSeq:ke.headSeq,fraction:null,error:void 0}),g({ok:!0,caughtUpTo:ke.appliedSeq})),ee+=1;const en=co(ee,H);await lt(Math.min(en,QO)),K=_>=Dd}if(a.signal.aborted)break;me({phase:h.phase==="restoring"?"connecting":h.phase==="live"?"syncing":"connecting"});const Re=new AbortController;F=Re,ue=null;const st=()=>Re.abort();a.signal.addEventListener("abort",st);const mt=()=>{a.signal.removeEventListener("abort",st),Re.abort(),F===Re&&(F=null,ue=null)};let It=null;const Mt=$e(),Ft=()=>{F===Re&&(Te=te())},xn={events(Ne,De){Ft(),Mt.events(Ne,De)},head(Ne){Ft(),Mt.head(Ne)},progress:Mt.progress,ephemeral(Ne){Ft(),Mt.ephemeral(Ne)},opened(Ne){Ft(),It=Ne,F===Re&&(ue=Ne.alive??null),ke.setHead(Ne.cursor),me({headSeq:Ne.cursor,appliedSeq:ke.appliedSeq,phase:"syncing"})}},Qt=n.follow.open({sessionId:l},xn,Re.signal),Z=await Promise.race([Qt.then(Ne=>({kind:"done",outcome:Ne})),c3(()=>It!=null,Re.signal,M).then(()=>({kind:"opened"}))]),ae=It;if(Z.kind==="done"||ae==null||Re.signal.aborted){if(mt(),a.signal.aborted)break;if(pt())continue;_+=1,_>=Dd&&(K=!0),ee+=1,await lt(co(ee,H));continue}_=0,ee=0;const ge=ae.firstSeq-1,xe=await Ie(ke.appliedSeq,ge,Re.signal);if(Re.signal.aborted){if(mt(),a.signal.aborted)break;pt();continue}if(!xe.ok&&!xe.retryable){me({phase:"error",error:{code:xe.code,message:xe.message??xe.code,retrying:!1},appliedSeq:ke.appliedSeq,headSeq:ke.headSeq}),g({ok:!1,code:xe.code,message:xe.message??xe.code}),mt();break}if(!xe.ok){mt(),me({phase:"stalled",error:{code:xe.code,message:xe.message??xe.code,retrying:!0},appliedSeq:ke.appliedSeq,headSeq:ke.headSeq}),ee+=1,await lt(co(ee,H));continue}me({phase:"live",appliedSeq:ke.appliedSeq,headSeq:ke.headSeq,fraction:null,error:void 0}),ke.appliedSeq>=ge&&g({ok:!0,caughtUpTo:ke.appliedSeq});const Ve=await Qt;if(mt(),a.signal.aborted)break;pt()||Ve.ok||(_+=1,_>=Dd&&(K=!0),me({phase:"stalled",error:{code:Ve.code,message:Ve.message??Ve.code,retrying:!0}}),ee+=1,await lt(co(ee,H)))}h.phase!=="error"&&me({phase:"closed"}),E()}async function fe(){return r.enhancement==="off"||!n.cdc&&!n.range?!1:n.probe?n.probe():l3()}const ye=(n.onResume??r3)(R),Ce=n.livenessMs===void 0?t3:n.livenessMs;let je=null;Ce!==!1&&Ce>0&&(je=setInterval(()=>{ie()||!F||!ue||ue()||R({reason:"liveness",hiddenMs:0})},Ce),je.unref?.());function we(){je!=null&&clearInterval(je),je=null}return{onBatch(J){return u.add(J),()=>u.delete(J)},onEphemeral(J){return o.add(J),()=>o.delete(J)},onStatus(J){return f.add(J),J(h),()=>f.delete(J)},get status(){return h},ready:p,close(){ye(),we(),a.abort(),E(),me({phase:"closed"})}}}function u3(n,l){const r=[...n].sort((o,f)=>o.seq-f.seq),a=[];let u=l+1;for(const o of r)if(!(o.seq<u)){if(o.seq!==u)break;a.push(o),u=o.seq+1}return a}function co(n,l){return Math.min(ZO,XO*2**Math.max(0,n-1))*(.5+l()*.5)}function o3(n,l){return new Promise((r,a)=>{const u=setTimeout(()=>{l.removeEventListener("abort",o),r()},n),o=()=>{clearTimeout(u),a(new DOMException("Aborted","AbortError"))};l.aborted?o():l.addEventListener("abort",o,{once:!0})})}async function c3(n,l,r){for(;!n()&&!l.aborted;)await r(5,l).catch(()=>{})}function $v(n={}){const l=n.addressOf??(o=>ia(o)),r=n.fetch??fetch,a=n.url??$O,u=n.maxMessages??LO;return{kind:"official-page",async fetch(o,f,h){if(o.throughSeq<=o.afterSeq)return{ok:!0,throughSeq:o.throughSeq};let m=o.throughSeq+1,p=0;const y=o.throughSeq-o.afterSeq;f.progress({loaded:0,total:y,unit:"events"});try{for(;!h.aborted;){const g=await f3(r,a,{address:l(o.sessionId),throughSeq:o.throughSeq,beforeSeq:m,maxMessages:u,turnWindow:BO},h);if(!g.ok)return g;const S=Es(g.records);S.length&&f.events(S,{throughSeq:o.throughSeq}),p+=S.length,f.progress({loaded:p,total:y,unit:"events"});const x=S.reduce((k,T)=>Math.min(k,T.seq),Number.POSITIVE_INFINITY);if(!g.hasMore||!Number.isFinite(x)||x<=o.afterSeq+1)break;if(x>=m)return{ok:!1,retryable:!0,code:"PAGE_STALLED",message:"Official page did not move."};m=x}return h.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!0,throughSeq:o.throughSeq}}catch(g){return h.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!1,retryable:!0,code:"PAGE_ERROR",message:g instanceof Error?g.message:String(g)}}}}}async function f3(n,l,r,a){const u=await n(l,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},credentials:"same-origin",signal:a,body:JSON.stringify({type:"client-request",rpcId:crypto.randomUUID(),method:"session/events",payload:{args:{request:r}}})});let o=null;try{o=await u.json()}catch{o=null}if(!u.ok||o?.result?.ok===!1)return{ok:!1,retryable:u.status>=500||u.status===0,code:"PAGE_ERROR",message:o?.result?.error?.message??`session/events HTTP ${u.status}`};const f=o?.result?.value??o?.result??o;return{ok:!0,records:f?.records??f?.events??f,hasMore:f?.hasMore===!0,cursor:f?.cursor}}async function Pv(n){const l=await crypto.subtle.digest("SHA-256",n);return[...new Uint8Array(l)].map(r=>r.toString(16).padStart(2,"0")).join("")}function Wv(n){const l=n.fetch??fetch,r=n.concurrency??VO,a=n.retries??YO,u=n.manifestUrl??KO,o=n.chunkUrl??JO,f=n.wait??m3;return{kind:"cdc-snapshot",async fetch(h,m,p){if(h.throughSeq<=h.afterSeq)return{ok:!0,throughSeq:h.throughSeq};const y=new AbortController,g=()=>y.abort();p.addEventListener("abort",g);try{const S=await d3(l,u,h,y.signal);return S.ok?await h3({manifest:S.value,afterSeq:h.afterSeq,throughSeq:h.throughSeq,sink:m,cache:n.cache,fetchImpl:l,chunkUrl:o,concurrency:r,retries:a,wait:f,signal:y.signal}):S}catch(S){return p.aborted||y.signal.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!1,retryable:!0,code:"CDC_ERROR",message:S instanceof Error?S.message:String(S)}}finally{p.removeEventListener("abort",g),y.signal.aborted||y.abort()}}}}async function d3(n,l,r,a){const u=new URLSearchParams({sessionId:r.sessionId,throughSeq:String(r.throughSeq),afterSeq:String(r.afterSeq)}),o=await n(`${l}?${u}`,{method:"GET",credentials:"same-origin",signal:a,headers:{accept:"application/json"}});if(o.status===404)return{ok:!1,retryable:!1,code:"ENHANCE_UNAVAILABLE"};if(!o.ok)return{ok:!1,retryable:o.status>=500,code:"CDC_MANIFEST",message:`HTTP ${o.status}`};const f=await o.json();return Array.isArray(f.chunks)?{ok:!0,value:f}:{ok:!1,retryable:!0,code:"CDC_MANIFEST"}}async function h3(n){const l=[...n.manifest.chunks].sort((C,E)=>C.fromSeq-E.fromSeq),r=new Map;let a=0;const u=n.manifest.totalSize;n.sink.progress({loaded:a,total:u,unit:"bytes"}),n.sink.head(n.manifest.throughSeq);let o=0;const f=()=>{for(;o<l.length;){const C=l[o];if(!C||!r.has(C.fromSeq))break;const E=(r.get(C.fromSeq)??[]).filter(M=>M.seq>n.afterSeq&&M.seq<=n.throughSeq);E.length&&n.sink.events(E,{throughSeq:n.throughSeq}),o+=1}},h=[];for(const C of l){const E=await n.cache.getChunk(C.hash);E&&await Pv(E)===C.hash?(r.set(C.fromSeq,eb(E)),a+=C.bytes,n.sink.progress({loaded:a,total:u,unit:"bytes"}),f()):h.push(C)}if(h.length===0)return f(),{ok:!0,throughSeq:n.throughSeq};let m=0,p=0,y=null,g=null;const S=()=>{const C=g;g=null,C?.()},x=()=>new Promise(C=>{if(p===0){C();return}g=C}),k=async C=>{for(let E=0;E<n.retries;E+=1){if(n.signal.aborted||y)return;try{const M=await p3(n.fetchImpl,n.chunkUrl,n.manifest.sessionId,C,n.signal);if(await Pv(M)!==C.hash)throw new Error("hash mismatch");await n.cache.putChunk(C.hash,M),r.set(C.fromSeq,eb(M)),a+=C.bytes,n.sink.progress({loaded:a,total:u,unit:"bytes"}),f();return}catch(M){if(n.signal.aborted||y)return;if(E+1>=n.retries){y={ok:!1,retryable:!0,code:"CDC_CHUNK_FAILED",message:M instanceof Error?M.message:String(M)};return}await n.wait(50*2**E,n.signal).catch(()=>{})}}},T=()=>{for(;!y&&!n.signal.aborted&&p<n.concurrency&&m<h.length;){const C=h[m];if(m+=1,!C)break;p+=1,k(C).finally(()=>{p-=1,S()})}};for(T();p>0&&!n.signal.aborted;)T(),p>0&&await x();return n.signal.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:y||(f(),{ok:!0,throughSeq:n.throughSeq})}async function p3(n,l,r,a,u){const o=new URLSearchParams({sessionId:r,fromSeq:String(a.fromSeq),toSeq:String(a.toSeq),hash:a.hash}),f=await n(`${l}?${o}`,{method:"GET",credentials:"same-origin",signal:u});if(f.status===404)throw Object.assign(new Error("not found"),{code:"ENHANCE_UNAVAILABLE",status:404});if(!f.ok)throw new Error(`HTTP ${f.status}`);return new Uint8Array(await f.arrayBuffer())}function eb(n){const l=new TextDecoder().decode(n),r=[];for(const a of l.split(`
59
+ `))if(a.trim()!=="")try{r.push(...Es(JSON.parse(a)))}catch{}return r.sort((a,u)=>a.seq-u.seq)}function m3(n,l){return new Promise((r,a)=>{const u=setTimeout(()=>{l.removeEventListener("abort",o),r()},n),o=()=>{clearTimeout(u),a(new DOMException("Aborted","AbortError"))};l.aborted?o():l.addEventListener("abort",o,{once:!0})})}const g3="dsh-bot",y3=2,v3=["log_chunks","log_events","log_cursors"];function b3(n){const l=globalThis.indexedDB;return l?new Promise(r=>{let a=!1;const u=o=>{a||(a=!0,r(o))};try{const o=l.open(g3,y3);o.onupgradeneeded=f=>{const h=o.result;if(f.oldVersion<2){for(const p of["chunks","events"])h.objectStoreNames.contains(p)&&h.deleteObjectStore(p);h.objectStoreNames.contains("log_chunks")||h.createObjectStore("log_chunks").createIndex("byLastUsed","lastUsed"),h.objectStoreNames.contains("log_events")||h.createObjectStore("log_events",{keyPath:["sessionId","seq"]}).createIndex("bySession","sessionId"),h.objectStoreNames.contains("log_cursors")||h.createObjectStore("log_cursors",{keyPath:"sessionId"})}},o.onblocked=()=>u({ok:!1,reason:"blocked"}),o.onsuccess=()=>{const f=o.result;if(f.onversionchange=()=>f.close(),!v3.every(h=>f.objectStoreNames.contains(h))){f.close(),u({ok:!1,reason:"unavailable"});return}u({ok:!0,db:f})},o.onerror=()=>u({ok:!1,reason:"unavailable"})}catch{u({ok:!1,reason:"unavailable"})}}):Promise.resolve({ok:!1,reason:"unavailable"})}function x3(){const n=new Map,l=new Map,r=new Map;let a=0;const u=()=>{const o=[...r.entries()].sort((f,h)=>f[1].lastUsed-h[1].lastUsed);for(;a>b1&&o.length>0;){const f=o.shift();if(!f)break;r.delete(f[0]),a-=f[1].bytes.byteLength}};return{mode:"memory",async getCursor(o){return n.get(o)??null},async setCursor(o,f,h){const m=n.get(o),p=m?Math.max(m.appliedSeq,f):f,y=h==null?m?.headSeq??null:Math.max(m?.headSeq??h,h);n.set(o,{appliedSeq:p,headSeq:y})},async putEvents(o,f){const h=l.get(o)??new Map;for(const m of f)h.set(m.seq,m);l.set(o,h)},async readEvents(o,f=-1){const h=l.get(o);return h?[...h.values()].filter(m=>m.seq>f).sort((m,p)=>m.seq-p.seq):[]},async getChunk(o){const f=r.get(o);return f?(f.lastUsed=Date.now(),f.bytes):null},async putChunk(o,f){const h=r.get(o);h&&(a-=h.bytes.byteLength),r.set(o,{bytes:f,lastUsed:Date.now()}),a+=f.byteLength,u()}}}async function tb(n){const l=await w3(n);if(l.ok!==!0)return x3();const r=l.db;return{mode:"idb",async getCursor(a){return rr(r,"log_cursors","readonly",u=>fi(u.get(a))).then(u=>u?{appliedSeq:u.appliedSeq,headSeq:u.headSeq??null}:null)},async setCursor(a,u,o){await rr(r,"log_cursors","readwrite",async f=>{const h=await fi(f.get(a)),m=h?Math.max(h.appliedSeq,u):u,p=o==null?h?.headSeq??null:Math.max(h?.headSeq??o,o);await fi(f.put({sessionId:a,appliedSeq:m,headSeq:p,updatedAt:Date.now()}))})},async putEvents(a,u){await rr(r,"log_events","readwrite",async o=>{for(const f of u)await fi(o.put({sessionId:a,seq:f.seq,event:f}))})},async readEvents(a,u=-1){return(await rr(r,"log_events","readonly",f=>{const h=f.index("bySession");return fi(h.getAll(a))})).map(f=>f.event).filter(f=>f&&f.seq>u).sort((f,h)=>f.seq-h.seq)},async getChunk(a){const u=await rr(r,"log_chunks","readonly",o=>fi(o.get(a)));return u?.bytes?(rr(r,"log_chunks","readwrite",o=>fi(o.put({...u,lastUsed:Date.now()},a))),u.bytes):null},async putChunk(a,u){await rr(r,"log_chunks","readwrite",async o=>{await fi(o.put({bytes:u,lastUsed:Date.now()},a)),await S3(o)})}}}async function S3(n){const l=n.index("byLastUsed"),r=await fi(l.getAll()),a=await fi(l.getAllKeys());let u=r.reduce((o,f)=>o+(f.bytes?.byteLength??0),0);for(let o=0;o<r.length&&u>b1;o+=1){const f=a[o],h=r[o];f==null||!h||(u-=h.bytes.byteLength,await fi(n.delete(f)))}}function w3(n){try{return b3(n)}catch{return Promise.resolve({ok:!1,reason:"unavailable"})}}function rr(n,l,r,a){return new Promise((u,o)=>{const f=n.transaction(l,r),h=f.objectStore(l);Promise.resolve(a(h)).then(u,o),f.onerror=()=>o(f.error)})}function fi(n){return new Promise((l,r)=>{n.onsuccess=()=>l(n.result),n.onerror=()=>r(n.error)})}function k3(n,l){const r=Math.max(0,Math.min(l,n.length)),a=/(?:^|\s)@([^\s@()]*)$/.exec(n.slice(0,r));if(!a||a.index==null)return null;const u=a[1]??"";return{start:a.index+a[0].length-u.length-1,query:u}}function E3(n){return n.replace(/[@()\r\n]/g," ").replace(/\s+/g," ").trim()||"Untitled"}function T3(n,l){return`@${E3(n)} (${l})`}function A3(n,l,r,a,u){const o=Math.max(0,Math.min(l,n.length)),f=`${T3(a,u)} `;return{text:n.slice(0,r)+f+n.slice(o),cursor:r+f.length}}function C3(n,l){const r=l.trim().toLowerCase();return n.filter(a=>r===""?!0:a.label.toLowerCase().includes(r)||a.sessionId.toLowerCase().includes(r)).slice(0,8)}const Ld=()=>({segments:[],live:{},activity:"",completed:{},failures:{},retries:{},title:"",model:"",preset:"",turns:null,steps:null,drafting:!1,turn:null,turnStartedAt:null,streamAttempt:null,streamRevision:0,pendingAssistant:null,turnEnds:{}});function Ao(n,l,r){return Hw(n,l,r)}function N3({active:n,progress:l}){const{t:r}=Je(),[a,u]=z.useState(n),[o,f]=z.useState(!1);if(z.useEffect(()=>{if(n){u(!0);return}f(!1)},[n]),z.useEffect(()=>{if(!a||!n)return;const p=window.requestAnimationFrame(()=>f(!0));return()=>window.cancelAnimationFrame(p)},[a,n]),z.useEffect(()=>{if(n||!a)return;const p=window.setTimeout(()=>u(!1),280);return()=>window.clearTimeout(p)},[n,a]),!a)return null;const h=l!=null&&l.total>0,m=h?Math.min(100,Math.round(l.loaded/l.total*100)):0;return v.jsx("div",{className:o?"chunk-loading visible":"chunk-loading",role:"status",children:v.jsxs("div",{className:"chunk-loading-card",children:[v.jsx("p",{children:v.jsx("span",{className:"shimmer",children:h?r("load.messagesPct",{pct:String(m)}):r("load.messages")})}),v.jsx("div",{className:"chunk-progress-track",role:"progressbar","aria-valuemin":0,"aria-valuemax":h?l.total:1,"aria-valuenow":h?l.loaded:0,"aria-label":r("load.aria"),children:v.jsx("div",{className:h?"chunk-progress-fill":"chunk-progress-fill indeterminate",style:h?{width:`${m}%`}:void 0})})]})})}function nb({signal:n}){const{t:l}=Je();if(!n)return null;const r=n==="wait";return v.jsx("span",{className:r?"bot-dot wait":"bot-dot",role:"img","aria-label":l(r?"bot.waiting":"bot.running")})}function j3(n){const l=[];return n.turns!=null&&l.push(`${n.turns} turns`),n.steps!=null&&l.push(`${n.steps} steps`),l.join(" · ")}function O3({health:n,usage:l,execution:r,model:a}){const{t:u}=Je(),o=n?.primary?.reachable===!0,f=l&&"code"in l&&typeof l.code=="string"?l.code:"";return v.jsxs("div",{className:"status",children:[v.jsx("p",{children:u(o?"health.up":"health.down")}),a?v.jsx("p",{className:"muted",children:a}):null,v.jsx("p",{className:r.ready?"":"muted",children:r.ready?u("health.modelReady"):Ao(r.reason,r.reason,u)}),v.jsx("p",{className:l?.connected?"":"muted",children:l?.connected?u("health.usageReady"):Ao(f,l?.error||u("health.usageOff"),u)}),v.jsx("p",{className:"muted",children:u("health.sameSession")})]})}function z3(){return v.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[v.jsx("circle",{cx:"11",cy:"11",r:"6.25",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),v.jsx("path",{d:"M16 16.5L20 20.5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]})}function ib(){return v.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:v.jsx("path",{d:"M12 5v14M5 12h14",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})}function _3({preset:n}){return n==="read-only"||n==="readonly"||n==="danger-full-access"||n==="auto"?v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("path",{d:"M6.6 2.15C7.5 1.81 8.5 1.81 9.4 2.15L13.92 3.84V7.12C13.92 11.61 10.56 13.6 8 14.58C5.44 13.6 2.08 11.61 2.08 7.12V3.84L6.6 2.15Z",fill:"none",stroke:"currentColor",strokeLinejoin:"round"}),n==="danger-full-access"?v.jsx("path",{d:"M8 4.4V9.9M8 10.8V11.8",fill:"none",stroke:"currentColor"}):null,n==="read-only"||n==="readonly"?v.jsx("path",{d:"M5.09 8.14L7.18 10.24C7.27 10.32 7.4 10.31 7.48 10.23L11.51 5.61",fill:"none",stroke:"currentColor"}):null]}):v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("path",{d:"M6.42 1.68C7.44 1.3 8.56 1.3 9.58 1.68L14.1 3.38C14.29 3.45 14.42 3.63 14.42 3.84V6.49L9.23 2.62C8.44 2.32 7.56 2.32 6.77 2.62L2.58 4.19V7.12C2.58 11.18 5.52 13.06 8 14.04C8.28 13.93 8.56 13.81 8.84 13.67C9.07 13.95 9.33 14.19 9.62 14.41C9.12 14.66 8.64 14.87 8.18 15.04C8.06 15.09 7.94 15.09 7.82 15.04C5.22 14.05 1.58 11.94 1.58 7.12V3.84C1.58 3.63 1.7 3.45 1.9 3.38L6.42 1.68Z",fill:"currentColor"}),v.jsx("path",{d:"M5.26 6.6H10.74M5.26 9.87H8.33",fill:"none",stroke:"currentColor"}),v.jsx("path",{d:"M10.03 13.22C12.15 11.95 14.58 8.9 14.78 8.64C14.41 8.37 13.68 7.83 13.5 8.1C12.4 9.72 11.31 11.34 10.21 12.95C10.15 13.04 10.09 13.13 10.03 13.22Z",fill:"currentColor"})]})}function q3(){return v.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:v.jsx("path",{d:"M12 17V7M7 11.5L12 6.5l5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ho({open:n,children:l,className:r}){const[a,u]=z.useState(n),[o,f]=z.useState(n);z.useLayoutEffect(()=>{if(n){u(!0);const p=requestAnimationFrame(()=>f(!0));return()=>cancelAnimationFrame(p)}f(!1),window.matchMedia("(prefers-reduced-motion: reduce)").matches&&u(!1)},[n]);function h(p){p.target!==p.currentTarget||p.propertyName!=="grid-template-rows"||n||u(!1)}const m=["coll-container",o?"expand":"",r].filter(Boolean).join(" ");return v.jsx("div",{className:m,onTransitionEnd:h,children:v.jsx("div",{children:a?l:null})})}function w1({ticket:n,now:l,onSupply:r,onOpen:a}){const{t:u}=Je(),[o,f]=z.useState(""),[h,m]=z.useState(""),[p,y]=z.useState(!1),g=tk(n),S=n.status==="started"||n.status==="needs_user";return v.jsxs("article",{className:"work-card",children:[v.jsxs("header",{children:[v.jsx("h3",{children:n.summary}),n.status==="ready"?null:v.jsx("span",{className:S?"work-status live":"work-status",children:Cb(n.status,u)})]}),ek(n,l,u).map(x=>v.jsx("p",{children:x},x)),n.childSessionId?v.jsx("button",{type:"button",className:"work-open",onClick:()=>a(n.childSessionId??""),children:u("work.openWorker")}):null,g?v.jsx("p",{className:g.stale?"stale":"work-question",children:g.text||u("work.questionEmpty")}):null,g?.stale?v.jsx("p",{className:"work-quiet",children:u("work.questionStale")}):null,n.status==="needs_user"?v.jsxs("form",{className:"work-reply",onSubmit:x=>{x.preventDefault();const k=o.trim();!k||p||(y(!0),m(""),r(n.id,k).then(T=>{y(!1),T?m(T):f("")}))},children:[v.jsxs("label",{children:[v.jsx("span",{children:u("work.answerLabel")}),v.jsx("textarea",{value:o,rows:2,disabled:p,onChange:x=>f(x.target.value)})]}),h?v.jsx("p",{className:"work-error",children:h}):null,v.jsx("button",{type:"submit",disabled:p||o.trim()==="",children:u("work.answerSubmit")})]}):null]})}function R3({briefing:n,time:l,mark:r,onOpenFile:a}){const{t:u}=Je(),[o,f]=z.useState(!1),h=n.body.split(`
60
+ `).map(p=>p.trim()).find(Boolean)??"",m=[n.wallMs!=null?u("work.duration",{value:M3(n.wallMs,u)}):"",n.maxTokens!=null?`token ${n.maxTokens.toLocaleString("en-US")}`:"",n.material?u("work.material",{hash:n.material.slice(0,8)}):""].filter(Boolean);return v.jsxs("div",{className:"briefing-row","data-turn":r,children:[v.jsxs("article",{className:o?"briefing-card open":"briefing-card",children:[v.jsxs("button",{type:"button",className:"briefing-toggle","aria-expanded":o,onClick:()=>f(p=>!p),children:[v.jsx("span",{className:"briefing-title",children:n.cancel?u("work.cancelTitle"):u("work.taskTitle")}),v.jsx("span",{className:"briefing-rev",children:u("work.generation",{revision:String(n.revision)})}),v.jsx(D3,{}),h&&!o?v.jsx("span",{className:"briefing-preview",children:h}):null]}),v.jsx(Ho,{open:o,children:v.jsxs("div",{className:"briefing-body",children:[n.body?v.jsx(js,{text:n.body,onOpenFile:a}):null,m.length?v.jsx("p",{className:"briefing-facts",children:m.join(" · ")}):null,n.notes.map(p=>v.jsx("p",{className:"briefing-note",children:p},p))]})})]}),l?v.jsx("time",{children:l}):null]})}function M3(n,l){return n%6e4===0?l("work.minutes",{count:String(n/6e4)}):n%1e3===0?l("work.seconds",{count:String(n/1e3)}):l("work.milliseconds",{count:String(n)})}function D3(){return v.jsx("svg",{className:"briefing-chevron",viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M4 6.5L8 10.5L12 6.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function L3({text:n}){return v.jsx("p",{className:"work-refused",children:n})}function B3({segment:n}){const[l,r]=z.useState(!1),{t:a}=Je();return v.jsxs("div",{className:"official-row","data-variant":"think","data-segment":n.id,children:[v.jsxs("button",{type:"button",className:"official-title","aria-expanded":l,onClick:()=>r(!l),children:[v.jsxs("span",{className:"official-leading",children:[v.jsx(G3,{}),v.jsx(Co,{})]}),v.jsx("span",{className:"official-label",children:n.running?a("activity.thinking"):a("activity.reasoning")})]}),v.jsx(Ho,{open:l,children:v.jsx("div",{className:"think-body",children:it(n.text)})})]})}function U3({segments:n,pending:l=!1,tickets:r=[],cwd:a,connectionPhase:u}){const{t:o}=Je(),f=l||n.some(S=>S.kind==="think"?S.running:ys.has(vs(S,a,r).status)),h=n.filter(S=>S.kind==="tool").map(S=>vs(S,a,r).status),m=[[o("activity.count.active"),h.filter(S=>ys.has(S)).length],[o("activity.count.failed"),h.filter(S=>S==="failed").length],[o("activity.count.cancelled"),h.filter(S=>S==="cancelled").length],[o("activity.count.unknown"),h.filter(S=>S==="unknown").length]].filter(([,S])=>Number(S)>0).map(([S,x])=>`${S} ${x}`).join(" · "),[p,y]=z.useState(()=>f),g=u!=null&&u!=="live";return v.jsxs("section",{className:p?"activity-group open":"activity-group","aria-label":o("activity.title"),"data-state":f?"running":"settled","data-activity-start":n[0]?.id,children:[v.jsxs("button",{type:"button",className:"official-title","aria-expanded":p,onClick:()=>y(S=>!S),children:[v.jsxs("span",{className:"official-leading",children:[v.jsx(ch,{}),v.jsx(Co,{})]}),v.jsx("span",{className:"official-label",children:n.length===1?o("activity.titleOne"):o("activity.titleWithCount",{count:String(n.length)})}),m?v.jsx("span",{className:"activity-status",children:m}):null,g?v.jsx("span",{className:"activity-status",children:["restoring","connecting","syncing"].includes(u??"")?o("activity.resyncing"):o("activity.connectionLastKnown")}):null]}),v.jsx(Ho,{open:p,children:v.jsxs("div",{className:"activity-body",children:[l&&!n.some(S=>S.kind==="think"?S.running:ys.has(vs(S,a,r).status))?v.jsx("p",{className:"activity-note",children:o("activity.generating")}):null,n.map(S=>S.kind==="think"?v.jsx(B3,{segment:S},S.id):v.jsx(H3,{segment:S,cwd:a,tickets:r,stale:g},S.callId))]})})]})}function H3(n){const[l,r]=z.useState(!1),[a,u]=z.useState(!1);return v.jsx(I3,{...n,open:l,argsOpen:a,onToggle:()=>r(o=>!o),onArgsToggle:()=>u(o=>!o)})}function I3({segment:n,cwd:l,tickets:r=[],stale:a=!1,open:u,argsOpen:o,onToggle:f,onArgsToggle:h}){const m=z.useId(),{t:p,locale:y}=Je(),g=vs(n,l,r),S=pO({...n,args:g.args,result:g.output}),x=Mh(n.name)?p("activity.runCommand"):g.title,k=g.description||(g.todos.length?p("activity.updatePlan"):"")||(g.ticket?it(g.ticket.summary):"")||S?.name||x,T=["failed","cancelled","unknown"].includes(g.status);return v.jsx(lb,{className:"official-row tool-activity",status:g.status,segmentId:n.id,open:u,onToggle:f,panelId:`${m}-tool`,title:v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"official-leading",children:[v.jsx(ch,{}),v.jsx(Co,{})]}),v.jsx("span",{className:"official-label",children:k}),T?v.jsxs("span",{className:"activity-status",children:[Iv(g.status,p),a?p("activity.lastKnownSuffix"):""]}):null]}),children:v.jsxs("div",{className:"activity-detail",children:[g.status!=="succeeded"&&!T?v.jsxs("p",{className:"activity-note",children:[Iv(g.status,p),a?p("activity.lastKnownSuffix"):""]}):null,g.todos.length?v.jsxs("p",{className:"activity-note",children:[g.todos.filter(C=>C.status==="completed").length,"/",g.todos.length," ",p("activity.planComplete")]}):null,v.jsxs("div",{className:"activity-facts",children:[g.title," · ",it(n.callId)]}),g.command?v.jsxs("div",{className:"activity-command",children:[v.jsx(po,{text:g.command}),v.jsx("pre",{children:g.command})]}):null,g.cwd?v.jsxs("p",{className:"activity-facts",children:[g.cwdSource==="recorded"?p("activity.cwdRecorded"):g.cwdSource==="requested"?p("activity.cwdRequested"):p("activity.cwdSessionDefault"),": ",g.cwd]}):null,g.status==="waiting"?v.jsx("p",{className:"activity-note",children:p("activity.callRequested")}):null,g.jobId?v.jsxs("p",{className:"activity-facts",children:["Job: ",it(g.jobId)," · ",p("activity.jobRegistered")]}):null,g.ticketId?v.jsxs("p",{className:"activity-facts",children:["Ticket: ",it(g.ticketId)," ",g.ticket?.childSessionId?`· Worker: ${it(g.ticket.childSessionId)}`:""]}):null,g.latestReport?v.jsxs("p",{className:"activity-note",children:[p("activity.latestReport")," (v",g.ticket?.revision,"): ",it(g.latestReport)]}):null,g.todos.length?v.jsx("ul",{className:"activity-todos",children:g.todos.map((C,E)=>v.jsxs("li",{children:[v.jsx("span",{children:C.status})," ",C.content]},E))}):null,n.requestedAt!=null?v.jsxs("p",{className:"activity-facts",children:[p("activity.callRecorded"),":"," ",new Date(n.requestedAt).toLocaleString(y==="zh"?"zh-CN":"en"),n.settledAt!=null?` · ${p("activity.callWait")}: ${Math.max(0,n.settledAt-n.requestedAt)}ms`:""]}):null,g.exitCode!=null?v.jsxs("p",{className:"activity-facts",children:["Exit: ",g.exitCode]}):null,S?v.jsx(V3,{change:S}):null,v.jsx(lb,{className:"official-row activity-arguments",open:o,onToggle:h,panelId:`${m}-args`,title:v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"official-leading",children:[v.jsx(ch,{}),v.jsx(Co,{})]}),v.jsx("span",{className:"official-label",children:p("activity.fullArgs")})]}),trailing:o?v.jsx(po,{text:g.args}):null,children:v.jsx("pre",{children:g.args||"{}"})}),n.resultReceived||n.result?v.jsxs("div",{className:"activity-output",children:[v.jsxs("div",{className:"activity-block-head",children:[v.jsx("span",{children:p("activity.toolResult")}),v.jsx(po,{text:g.output})]}),v.jsx("pre",{children:g.output||p("activity.emptyResult")})]}):null]})})}function lb({className:n,status:l,segmentId:r,open:a,onToggle:u,panelId:o,title:f,trailing:h,children:m}){return v.jsxs("div",{className:`${n}${a?" open":""}`,"data-state":l,"data-segment":r,children:[v.jsx("button",{type:"button",className:"official-title","aria-expanded":a,"aria-controls":o,onClick:p=>{p.stopPropagation(),u()},children:f}),h,v.jsx("div",{id:o,className:"activity-panel",children:v.jsx(Ho,{open:a,children:m})})]})}function V3({change:n}){const l=n.lines.map(r=>`${r.kind==="del"?"- ":r.kind==="add"?"+ ":" "}${r.text}`).join(`
61
+ `);return v.jsxs("div",{className:"diff-card","data-diff":"",children:[v.jsxs("div",{className:"diff-head",children:[v.jsxs("span",{className:"diff-heading",children:[v.jsx("span",{className:"diff-lang",children:n.language||"Code block"}),v.jsx("span",{className:"diff-file",children:n.name})]}),v.jsx(po,{text:l})]}),v.jsx("div",{className:"diff-body",children:n.lines.map((r,a)=>v.jsx("div",{className:Y3(r.kind),children:r.text},a))})]})}function Y3(n){return n==="add"?"diff-line added":n==="del"?"diff-line removed":"diff-line same"}function po({text:n}){const[l,r]=z.useState(!1);return v.jsx("button",{type:"button",className:"diff-copy","aria-label":l?"Copied":"Copy",onClick:a=>{a.stopPropagation(),navigator.clipboard.writeText(it(n)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1e3)})},children:l?v.jsx(Q3,{}):v.jsx(F3,{})})}function Co(){return v.jsx("svg",{className:"chevron",viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M4 6.5L8 10.5L12 6.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function G3(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("path",{d:"M8 1.8c2.8 0 5 2 5 4.6 0 1.6-.8 3-2 3.8-.4.3-.6.7-.6 1.1V12H5.6v-.7c0-.4-.2-.8-.6-1.1-1.2-.8-2-2.2-2-3.8 0-2.6 2.2-4.6 5-4.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),v.jsx("path",{d:"M6.2 13.6h3.6",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function ch(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M3.2 4.2h9.6M3.2 8h9.6M3.2 11.8h6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})})}function F3(){return v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[v.jsx("rect",{x:"5.2",y:"5.2",width:"7.2",height:"7.6",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),v.jsx("path",{d:"M10.2 5.2V3.8A1.3 1.3 0 0 0 8.9 2.5H3.8A1.3 1.3 0 0 0 2.5 3.8v5.1A1.3 1.3 0 0 0 3.8 10.2H5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"})]})}function Q3(){return v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:v.jsx("path",{d:"M3.5 8.2L6.4 11.1L12.5 4.8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const X3={aborted:"question.aborted",failed:"question.failed",answered:"question.answered"};function cs(n){return{selected:[...n.selected],custom:n.custom,skipped:n.skipped}}function Z3(n){const l=Math.max(0,Math.ceil(n/1e3)),r=Math.floor(l/60),a=l%60;return r>0?`${r}:${String(a).padStart(2,"0")}`:`${a}s`}function K3({item:n,draft:l,interactive:r,disabled:a,onToggle:u}){const{t:o}=Je();if(!n.options.length)return null;const f=new Set(l.selected);return v.jsx("ul",{className:"user-question-options",children:n.options.map(h=>{const m=f.has(h.label),p=Zj(h.label,h.recommended),y=m?"user-question-option selected":"user-question-option",g=v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"user-question-option-label",children:[it(h.label),p.recommended?v.jsx("span",{className:"user-question-badge",children:o("question.recommended")}):null]}),h.description?v.jsx("span",{className:"user-question-option-desc",children:it(h.description)}):null]});return v.jsx("li",{children:r?v.jsx("button",{type:"button",className:y,"data-selected":m?"true":"false","aria-pressed":n.multiSelect?m:void 0,disabled:a,onClick:()=>u(h.label),children:g}):v.jsx("div",{className:y,"data-selected":m?"true":"false",children:g})},h.label)})})}function Uh({interactive:n,waitLabel:l,onTakeTime:r,busy:a}){const{t:u}=Je();return l?v.jsxs("div",{className:"user-question-wait",children:[v.jsx("p",{className:"user-question-hint",children:l}),n&&l!==u("question.continued")&&l!==u("question.waitingNoTimer")?v.jsx("button",{type:"button",className:"user-question-skip",disabled:a,onClick:r,children:u("question.takeTime")}):null]}):null}function J3({segment:n,sessionId:l,onCompose:r,remainingMs:a,waitState:u}){const o=Os(n);return o?o.presentation==="plan-review"?v.jsx(P3,{segment:n,sessionId:l,onCompose:r,remainingMs:a,waitState:u}):o.presentation==="approval"?v.jsx(W3,{segment:n,sessionId:l,remainingMs:a,waitState:u}):v.jsx($3,{segment:n,sessionId:l,remainingMs:a,waitState:u}):null}function Hh(n,l,r,a,u){const{t:o}=Je(),f=!!(r&&u1(r.state)),[h,m]=z.useState(u==="waiting"||r?.wait==="waiting"),[p,y]=z.useState(u==="continued"||r?.state==="continued"),[g,S]=z.useState(a??r?.timeoutMs),x=z.useRef(null),k=(u==="counting"||r?.wait==="counting"||typeof(a??r?.timeoutMs)=="number")&&!h&&!p;z.useEffect(()=>{u==="waiting"&&m(!0),(u==="continued"||r?.state==="continued")&&y(!0),typeof a=="number"&&(x.current=Date.now()+a,S(a))},[a,u,r?.state]),z.useEffect(()=>{if(!f||!k)return;const E=a??g??r?.timeoutMs;if(typeof E!="number")return;x.current==null&&(x.current=Date.now()+E);const M=()=>{const te=Math.max(0,(x.current??Date.now())-Date.now());return S(te),te<=0?(y(!0),n&&tt("/questions/timeout",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:n,callId:l})}),!1):!0};if(!M())return;const H=window.setInterval(()=>{M()||window.clearInterval(H)},250);return()=>window.clearInterval(H)},[f,k,n,l,a,g,r?.timeoutMs]);async function T(){m(!0),x.current=null,n&&await tt("/questions/take-time",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:n,callId:l})})}const C=p?o("question.continued"):h?o("question.waitingNoTimer"):k&&typeof g=="number"?o("question.remaining",{time:Z3(g)}):null;return{answerable:f,held:h,continued:p,waitLabel:C,takeTime:T,markHeld:()=>m(!0)}}function $3({segment:n,sessionId:l,remainingMs:r,waitState:a}){const{t:u}=Je(),o=Os(n),f=Hh(l,o.callId,o,r,a),[h,m]=z.useState({}),[p,y]=z.useState(!1),[g,S]=z.useState(""),x=o.questions,k=z.useMemo(()=>{const O={};for(const X of x)O[X.id]=h[X.id]??cs(X);return O},[h,x]),T=!!l&&f.answerable,C=x.length>1||x.some(O=>O.multiSelect||O.options.length===0);function E(O,X){f.markHeld(),m(le=>{const me=x.find(K=>K.id===O),_=le[O]??(me?cs(me):{selected:[],custom:"",skipped:!1});return{...le,[O]:{..._,...X}}})}async function M(O){if(!(!l||p)){y(!0),S("");try{const X=await tt("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:l,callId:o.callId,answers:O})});if(X.status===200&&X.body.ok!==!1||X.status===409)return;const le=typeof X.body.message=="string"?X.body.message:u("question.submitFailed");S(le)}catch{S(u("question.submitFailed"))}finally{y(!1)}}}function H(O,X){return X.skipped?{id:O.id,selected:[]}:X.custom.trim()&&(O.multiSelect||X.selected.length===0||O.options.length===0)?O.multiSelect?{id:O.id,selected:X.selected,custom:X.custom}:{id:O.id,selected:[],custom:X.custom}:X.selected.length?{id:O.id,selected:[...X.selected]}:null}function te(){const O=x.map(X=>H(X,k[X.id]??cs(X)));if(O.some(X=>X==null)){S(u("question.incomplete"));return}M(O)}function ie(O,X){if(!T||p)return;if(!O.multiSelect&&x.length===1&&!k[O.id]?.custom){M([{id:O.id,selected:[X]}]);return}const le=k[O.id]??cs(O),me=O.multiSelect?le.selected.includes(X)?le.selected.filter(_=>_!==X):[...le.selected,X]:[X];E(O.id,{selected:me,skipped:!1,custom:O.multiSelect?le.custom:""})}return v.jsxs("section",{className:"user-question-card","data-segment":n.id,"data-state":f.continued?"continued":o.state,"data-call":o.callId,"data-session":l||void 0,"data-kind":"question",children:[v.jsx(Uh,{interactive:T,waitLabel:f.waitLabel,onTakeTime:()=>{f.takeTime()},busy:p}),o.questions.map(O=>{const X=k[O.id]??cs(O);return v.jsxs("article",{className:"user-question","data-question":O.id,children:[O.header?v.jsx("h3",{className:"user-question-header",children:it(O.header)}):null,v.jsx("p",{className:"user-question-text",children:it(O.question)}),O.detail?v.jsx("p",{className:"user-question-hint",children:it(O.detail)}):null,O.multiSelect&&f.answerable?v.jsx("p",{className:"user-question-hint",children:u("question.multiSelect")}):null,v.jsx(K3,{item:O,draft:f.answerable?X:{selected:O.selected,custom:O.custom,skipped:O.skipped},interactive:T,disabled:p,onToggle:le=>ie(O,le)}),T?v.jsxs("div",{className:"user-question-actions",children:[v.jsxs("label",{className:"user-question-custom",children:[v.jsx("span",{children:u("question.customLabel")}),v.jsx("textarea",{value:X.custom,disabled:p,rows:2,placeholder:u("question.customPlaceholder"),onChange:le=>E(O.id,{custom:le.target.value,skipped:!1})})]}),v.jsx("button",{type:"button",className:"user-question-skip",disabled:p,onClick:()=>{if(x.length===1){M([{id:O.id,selected:[]}]);return}E(O.id,{skipped:!0,selected:[],custom:""})},children:u("question.skip")})]}):null,!T&&O.custom?v.jsx("p",{className:"user-question-hint",children:u("question.custom",{text:it(O.custom)})}):null,(O.skipped||X.skipped)&&(o.state!=="open"||T)?v.jsx("p",{className:"user-question-hint",children:u("question.skipped")}):null]},O.id)}),T&&(C||x.some(O=>(k[O.id]?.custom??"").trim()!==""))?v.jsx("button",{type:"button",className:"user-question-submit",disabled:p,onClick:te,children:u(p?"question.submitting":"question.submit")}):null,g?v.jsx("p",{className:"user-question-status exception",children:g}):null,!f.answerable&&o.state!=="open"&&o.state!=="continued"?v.jsx("p",{className:o.state==="answered"?"user-question-status":"user-question-status exception",children:u(X3[o.state])}):null]})}function P3({segment:n,sessionId:l,onCompose:r,remainingMs:a,waitState:u}){const{t:o}=Je(),f=Os(n),h=r1(f.questions),m=Hh(l,f.callId,f,a,u),[p,y]=z.useState(!1),[g,S]=z.useState(""),[x,k]=z.useState(!1),[T,C]=z.useState(""),E=!!l&&m.answerable,M=h.item.selected[0],H=M===h.approve.label;async function te(){if(!(!l||x)){k(!0),C("");try{const O=await tt("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:l,callId:f.callId,answers:[{id:h.item.id,selected:[h.approve.label]}]})});if(O.status===200&&O.body.ok!==!1||O.status===409)return;C(typeof O.body.message=="string"?O.body.message:o("question.submitFailed"))}catch{C(o("question.submitFailed"))}finally{k(!1)}}}async function ie(){if(!l||x)return;const O=g.trim();if(!O){C(o("question.changesNeeded"));return}k(!0),C("");try{const X=await tt("/questions/cancel",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:l,callId:f.callId})});if(X.status===200&&X.body.ok!==!1){r?.(O);return}if(X.status===409){r?.(O);return}C(typeof X.body.message=="string"?X.body.message:o("question.submitFailed"))}catch{C(o("question.submitFailed"))}finally{k(!1)}}return v.jsxs("section",{className:"user-question-card","data-segment":n.id,"data-state":m.continued?"continued":f.state,"data-call":f.callId,"data-session":l||void 0,"data-kind":"plan-review",children:[v.jsx("h3",{className:"user-question-header",children:o("question.planTitle")}),v.jsx("p",{className:"user-question-text",children:it(h.item.question)}),v.jsx(Uh,{interactive:E,waitLabel:m.waitLabel,onTakeTime:()=>{m.takeTime()},busy:x}),h.plan?p?v.jsx("div",{className:"user-question-plan",children:v.jsx(js,{text:h.plan})}):v.jsx("p",{className:"user-question-hint",children:it(h.plan).split(`
62
+ `).filter(Boolean).slice(0,2).join(" ")}):null,h.plan?v.jsx("button",{type:"button",className:"user-question-skip",onClick:()=>y(O=>!O),children:o(p?"question.hidePlan":"question.viewFull")}):null,E?v.jsxs("div",{className:"user-question-actions",children:[v.jsxs("label",{className:"user-question-custom",children:[v.jsx("span",{children:o("question.changeComments")}),v.jsx("textarea",{value:g,disabled:x,rows:3,placeholder:o("question.changePlaceholder"),onChange:O=>{m.markHeld(),S(O.target.value)}})]}),v.jsxs("div",{className:"user-question-row",children:[v.jsx("button",{type:"button",className:"user-question-skip",disabled:x,onClick:()=>{ie()},children:o("question.requestChanges")}),v.jsx("button",{type:"button",className:"user-question-submit",disabled:x,onClick:()=>{te()},children:o(x?"question.submitting":"question.approvePlan")})]})]}):M?v.jsx("p",{className:"user-question-status",children:H?o("question.approvePlan"):it(M)}):f.state==="aborted"?v.jsx("p",{className:"user-question-status exception",children:o("question.aborted")}):f.state==="failed"?v.jsx("p",{className:"user-question-status exception",children:o("question.failed")}):null,T?v.jsx("p",{className:"user-question-status exception",children:T}):null]})}function W3({segment:n,sessionId:l,remainingMs:r,waitState:a}){const{t:u,locale:o}=Je(),f=Os(n),h=a1(f.questions),m=Hh(l,f.callId,f,r,a),[p,y]=z.useState(!1),[g,S]=z.useState(""),x=!!l&&m.answerable,k=Rd(h.intent.display?.question,o,h.item.question),T=Rd(h.intent.display?.detail,o,h.item.detail),C=Rd(h.intent.display?.approve,o,h.approve.label),E=h.item.selected[0];async function M(H){if(!(!l||p)){y(!0),S("");try{const te=await tt("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:l,callId:f.callId,answers:[{id:h.item.id,selected:[H]}]})});if(te.status===200&&te.body.ok!==!1||te.status===409)return;S(typeof te.body.message=="string"?te.body.message:u("question.submitFailed"))}catch{S(u("question.submitFailed"))}finally{y(!1)}}}return v.jsxs("section",{className:"user-question-card","data-segment":n.id,"data-state":m.continued?"continued":f.state,"data-call":f.callId,"data-session":l||void 0,"data-kind":"approval",children:[h.intent.subject?.name?v.jsx("h3",{className:"user-question-header",children:it(h.intent.subject.name)}):null,v.jsx("p",{className:"user-question-text",children:it(k)}),T?v.jsx("p",{className:"user-question-hint",children:it(T)}):null,v.jsx(Uh,{interactive:x,waitLabel:m.waitLabel,onTakeTime:()=>{m.takeTime()},busy:p}),x?v.jsxs("div",{className:"user-question-row",children:[v.jsx("button",{type:"button",className:"user-question-skip",disabled:p,onClick:()=>{M(h.reject.label)},children:u("question.reject")}),v.jsx("button",{type:"button",className:"user-question-submit",disabled:p,onClick:()=>{M(h.approve.label)},children:p?u("question.submitting"):it(C)||u("question.allow")}),h.always?v.jsx("button",{type:"button",className:"user-question-submit",disabled:p,onClick:()=>{M(h.always.label)},children:u("question.alwaysAllow")}):null]}):E?v.jsx("p",{className:"user-question-status",children:u("question.approvalAnswered")}):f.state==="aborted"?v.jsx("p",{className:"user-question-status exception",children:u("question.aborted")}):f.state==="failed"?v.jsx("p",{className:"user-question-status exception",children:u("question.failed")}):null,g?v.jsx("p",{className:"user-question-status exception",children:g}):null]})}function Bd({approval:n,sessionId:l}){const{t:r,locale:a}=Je(),[u,o]=z.useState(!1),[f,h]=z.useState(""),[m,p]=z.useState(n.state),y=!!l&&m==="open",g=a.startsWith("zh")&&n.displayReason?.zh?n.displayReason.zh:n.displayReason?.en||n.reason;async function S(k){if(!(!l||u)){o(!0),h("");try{const T=await tt("/approvals/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:l,requestId:n.requestId,outcome:k})});if(T.status===200&&T.body.ok!==!1){p(k);return}if(T.status===409){p(k);return}h(typeof T.body.message=="string"?T.body.message:r("approval.submitFailed"))}catch{h(r("approval.submitFailed"))}finally{o(!1)}}}const x=m==="allowed-once"?r("approval.allowed"):m==="rejected"?r("approval.rejected"):m==="cancelled"?r("approval.cancelled"):m==="unavailable"?r("approval.failed"):null;return v.jsxs("section",{className:"user-question-card","data-kind":"tool-approval","data-state":m,"data-request":n.requestId,"data-session":l||void 0,children:[v.jsx("h3",{className:"user-question-header",children:r("approval.title")}),v.jsx("p",{className:"user-question-text",children:it(n.toolName)}),g?v.jsx("p",{className:"user-question-hint",children:it(g)}):null,y?v.jsxs("div",{className:"user-question-row",children:[v.jsx("button",{type:"button",className:"user-question-skip",disabled:u,onClick:()=>{S("rejected")},children:r("approval.reject")}),v.jsx("button",{type:"button",className:"user-question-submit",disabled:u,onClick:()=>{S("allowed-once")},children:r(u?"question.submitting":"approval.allowOnce")})]}):x?v.jsx("p",{className:m==="allowed-once"?"user-question-status":"user-question-status exception",children:x}):null,f?v.jsx("p",{className:"user-question-status exception",children:f}):null]})}function ez(n,l){if(!n)return"";const r=new Date(n);return Number.isNaN(r.getTime())?"":r.toLocaleTimeString(l==="zh"?"zh-CN":"en",{hour:"2-digit",minute:"2-digit"})}function tz({sessionId:n,segments:l,completed:r,failures:a,retries:u,turnEnds:o,tickets:f,now:h,canRetry:m,onRetry:p,onSupply:y,onOpenSession:g,onOpenFile:S,onOpenInbox:x,botLabel:k,chat:T=!1,cwd:C,connectionPhase:E,approvals:M=[],questionWaits:H,onCompose:te}){const ie=[];let O=null;const X=()=>{O&&(O.segments.length||a[O.turn]||u[O.turn]?.length)&&ie.push(O),O=null};for(const re of l){if(re.kind==="user"){X(),Nb(re.text)||ie.push({type:"user",segment:re});continue}const F=re.turn??-1;(!O||O.turn!==F)&&(X(),O={type:"turn",turn:F,seconds:r[F],segments:[]}),O.segments.push(re)}X();const le=new Set(ie.flatMap(re=>re.type==="turn"?[re.turn]:[]));for(const re of Object.keys(a)){const F=Number(re);le.has(F)||ie.push({type:"turn",turn:F,seconds:r[F],segments:[]})}const me=f.map(re=>({...re,summary:it(re.summary),events:re.events.map(F=>({...F,text:it(F.text)}))})),_=jb(me),K=new Map(me.map(re=>[re.id,re])),ee=new Map;for(const re of ie)if(re.type==="turn"){for(const F of f1(re.segments))if(F.type==="activity")for(const ue of F.segments){if(ue.kind!=="tool")continue;const ce=zb(ue);ce&&K.has(ce)&&!ee.has(ce)&&ee.set(ce,ue.id)}}const Ee=ie.reduce((re,F)=>F.type==="turn"?Math.max(re,F.turn):re,-1),qe=Ob(f);return v.jsxs(v.Fragment,{children:[ie.map((re,F)=>re.type==="user"?v.jsx(nz,{segment:re.segment,botLabel:k,onOpenInbox:x,onOpenFile:S},re.segment.id):v.jsx(az,{sessionId:n,cwd:C,connectionPhase:E,block:re,index:F,blocks:ie,failures:a,retries:u,turnEnds:o,latestTurn:Ee,background:qe,byId:K,anchorAt:ee,now:h,canRetry:m,onRetry:p,onSupply:y,onOpenSession:g,onOpenFile:S,chat:T,approvals:M,questionWaits:H,onCompose:te,trailingApprovals:F===ie.length-1},`${n}:turn-${re.turn}`)),_.filter(re=>!ee.has(re.id)).map(re=>v.jsx(w1,{ticket:re,now:h,onSupply:y,onOpen:g},re.id))]})}function nz({segment:n,botLabel:l,onOpenInbox:r,onOpenFile:a}){const u=Lo(n.text),o=dh(n.text),{locale:f}=Je(),h=ez(n.time,f);if(o)return v.jsx(R3,{briefing:o,time:h,mark:n.id,onOpenFile:a});if(u){const m=_j([{kind:"in",id:n.id,seq:n.seq,time:n.time,mail:u}],l);return v.jsx(Dj,{who:m?.who??"BOT",preview:m?.preview??"",time:h,mark:n.id,onOpen:r})}return v.jsxs("div",{className:"user-row","data-turn":n.id,children:[v.jsx("div",{className:"user-bubble",children:n.text}),h?v.jsx("time",{children:h}):null]})}function iz(n,l,r){for(let a=l-1;a>=0;a-=1){const u=n[a];if(u?.type==="user"&&u.segment&&u.segment.text.trim()!==""){if(Lo(u.segment.text)||dh(u.segment.text))continue;if(u.segment.turn==null||u.segment.turn===r)return u.segment.text;break}}return""}function lz(n,l){return n.slice(l+1).some(r=>r.type==="user")}function rz({seconds:n,failure:l,retries:r,prompt:a,continued:u,canRetry:o,onRetry:f,showLabel:h}){const{t:m}=Je(),[p,y]=z.useState(!1);if(!l&&r.length===0)return null;const g=p||u;return v.jsxs("div",{className:"turn-failure",children:[h?v.jsxs("p",{className:"turn-failed-label",children:["Failed",n!=null?v.jsxs(v.Fragment,{children:[" ","· ",v.jsxs("span",{className:"duration",children:[n,"s"]})]}):null]}):null,r.map(S=>v.jsxs("details",{className:"retry-row",open:S.state==="scheduled",children:[v.jsxs("summary",{children:[S.state==="started"?"Retried model request":"Retrying model request"," (",S.retry,"/",S.maxRetries??"∞",") · ",Math.max(1,Math.ceil(S.delayMs/1e3)),"s"]}),v.jsxs("p",{children:["Retry delay: ",Math.round(S.delayMs),"ms"]}),v.jsxs("p",{children:["Failure reason: ",S.message]})]},`${S.retryId}:${S.retry}`)),l?v.jsxs("p",{className:"turn-error",role:"status",children:[v.jsx("span",{className:"turn-error-title",children:"This turn failed"}),v.jsx("span",{children:l.message}),l.code?v.jsx("code",{children:l.code}):null]}):null,l&&a&&!g?v.jsx("button",{type:"button",className:"retry-turn",disabled:!o,onClick:()=>{y(!0),f(a)},children:m("bot.retry")}):null]})}function az({sessionId:n,block:l,index:r,blocks:a,failures:u,retries:o,turnEnds:f,latestTurn:h,background:m,byId:p,anchorAt:y,now:g,canRetry:S,onRetry:x,onSupply:k,onOpenSession:T,onOpenFile:C,chat:E=!1,cwd:M,connectionPhase:H,approvals:te=[],questionWaits:ie,onCompose:O,trailingApprovals:X=!1}){const{t:le}=Je(),me=f1(l.segments),_=new Set,K=F=>ie?.[F]??ie?.[`${n}:${F}`],ee=F=>te.filter(ue=>_.has(ue.requestId)?!1:ue.callId&&F.includes(ue.callId)?(_.add(ue.requestId),!0):!1),Ee=()=>X?te.filter(F=>_.has(F.requestId)?!1:(_.add(F.requestId),!0)):[],qe=me.some(F=>F.type==="activity"),re=E&&f[l.turn]==="aborted"&&!u[l.turn]&&!(l.turn===h&&m);return v.jsx("div",{children:v.jsxs("div",{"data-turn":`turn:${l.turn}`,children:[me.map(F=>{if(F.type==="text")return v.jsx("div",{"data-segment":F.segment.id,className:F.segment.streaming?"assistant streaming":"assistant",children:v.jsx(js,{text:F.segment.text,streaming:F.segment.streaming,onOpenFile:C})},F.segment.id);if(F.type==="question"){const ce=K(F.segment.callId);return v.jsxs(z.Fragment,{children:[v.jsx(J3,{segment:F.segment,sessionId:n,onCompose:O,remainingMs:ce?.remainingMs,waitState:ce?.waitState}),ee([F.segment.callId]).map(Te=>v.jsx(Bd,{approval:Te,sessionId:n},Te.requestId))]},F.segment.id)}const ue=F.segments.filter(ce=>ce.kind==="tool");return v.jsxs(z.Fragment,{children:[v.jsx(U3,{segments:F.segments,cwd:M,tickets:[...p.values()],connectionPhase:H}),ee(ue.map(ce=>ce.callId)).map(ce=>v.jsx(Bd,{approval:ce,sessionId:n},ce.requestId)),ue.filter(ce=>nk(ce)).map(ce=>v.jsx(L3,{text:it(ik(ce.result,le))},ce.id)),ue.flatMap(ce=>{const Te=zb(ce),N=Te?p.get(Te):void 0;return!Te||!N||y.get(Te)!==ce.id?[]:[v.jsx(w1,{ticket:N,now:g,onSupply:k,onOpen:T},N.id)]})]},F.id)}),Ee().map(F=>v.jsx(Bd,{approval:F,sessionId:n},F.requestId)),re?v.jsx("p",{className:"work-note",children:le("bot.stopped")}):null,v.jsx(rz,{seconds:l.seconds,failure:u[l.turn],retries:o[l.turn]??[],prompt:iz(a,r,l.turn),continued:lz(a,r),canRetry:S,onRetry:x,showLabel:!qe}),l.turn===h&&f[l.turn]==="aborted"&&m?v.jsx("p",{className:"work-note",children:le("bot.stoppedBackground")}):null]})})}function rb(){const n=location.hash.replace(/^#\/?/,"").split("/");for(let l=0;l<n.length-1;l+=1){const r=n[l],a=n[l+1];if(r==="s"&&a)return decodeURIComponent(a)}return""}function ab(n,l,r){if(!(r in l))return l;const a={...l};return delete a[r],sessionStorage.setItem(n,JSON.stringify(a)),a}function Ud(n){try{const l=JSON.parse(sessionStorage.getItem(n)||"{}");return l&&typeof l=="object"?l:{}}catch{return{}}}function sb(n){if(!n||typeof n!="object"||Array.isArray(n))return{};const l={};for(const[r,a]of Object.entries(n))typeof a=="string"&&a!==""&&(l[r]=a);return l}function Hd(n){fetch("/dsh-bot/api/sessions/previews",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(n),keepalive:!0})}function ub(n){return(n??"").split("/").filter(Boolean).at(-1)??""}function sz(){return new Promise(n=>{const l=location.protocol==="https:"?"wss:":"ws:",r=new WebSocket(`${l}//${location.host}/api/remote.mux`),a=window.setTimeout(()=>{r.close(),n([])},4e3),u=o=>{window.clearTimeout(a),r.close(),n(o)};r.addEventListener("open",()=>{r.send(JSON.stringify({type:"open",streamId:"archive",endpoint:"workspace/follow",payload:{args:{}}}))}),r.addEventListener("message",o=>{try{const f=JSON.parse(String(o.data)),h=f.value?.type==="baseline"?f.value.value?.archivedSessionIds:void 0;if(!Array.isArray(h))return;u(h.filter(m=>typeof m=="string"))}catch{}}),r.addEventListener("error",()=>u([]))})}function uz(){const{t:n,locale:l,setLocale:r}=Je(),[a,u]=z.useState(rb),[o,f]=z.useState([]),[h,m]=z.useState(""),[p,y]=z.useState(""),[g,S]=z.useState(!1),[x,k]=z.useState(()=>Ud("dsh-bot.titles")),[T,C]=z.useState(()=>Ud("dsh-bot.previews")),[E,M]=z.useState(Ld),[H,te]=z.useState(""),[ie,O]=z.useState(null),[X,le]=z.useState(a);X!==a&&(le(a),M(Ld()));const[me,_]=z.useState(null),[K,ee]=z.useState({ready:!1,reason:"loading"}),[Ee,qe]=z.useState(null),[re,F]=z.useState(null),[ue,ce]=z.useState(!1),[Te,N]=z.useState(""),[lt,pt]=z.useState(0),[R,q]=z.useState(0),[ne,fe]=z.useState(""),[ye,Ce]=z.useState(""),[je,we]=z.useState(!1),[J,he]=z.useState(null),[ut,Et]=z.useState(null),[ke,dt]=z.useState([]),[$e,Ie]=z.useState({}),[Re,st]=z.useState(!1),[mt,It]=z.useState(!1),[Mt,Ft]=z.useState({}),[xn]=z.useState(()=>n1(async()=>{const A=await tt("/authorization");if(A.status!==200)throw new Error("Authorization catalog unavailable");return{available:A.body.available,entries:A.body.entries}})),Qt=z.useRef(void 0),Z=z.useRef(null),[ae,ge]=z.useState(null),[xe,Ve]=z.useState(!1),[Ne,De]=z.useState(()=>new Set),[qt,Sn]=z.useState(!1),[en,wn]=z.useState(!1),[Dt,bt]=z.useState(!1),[Lt,Bt]=z.useState(""),[gn,_i]=z.useState(0),[tn,Dn]=z.useState(()=>new Set),[G,se]=z.useState({}),[Pe,Xe]=z.useState({}),[xt,St]=z.useState(!1),[pi,dr]=z.useState({}),[mi,hr]=z.useState(()=>Date.now()),[qi,zl]=z.useState(""),gi=jj(a,gn);z.useEffect(()=>{dt([]),Ie({});const A=Yj({visible:!document.hidden,fetch:async $=>{const pe=await tt(`/interactions?compact=1&sessionId=${encodeURIComponent(a)}`,{signal:$});if(pe.status!==200)throw new Error("Interactions unavailable");return pe.body},active:$=>{const pe=$;return!!(pe.questions?.length||pe.approvals?.some(Oe=>Oe.state==="open")||pe.authorization?.prompts?.length||pe.authorization?.inFlight?.length)},apply:$=>{const pe=$,Oe=Array.isArray(pe.approvals)?pe.approvals:[];dt(Oe);const Se={};if(Array.isArray(pe.questions))for(const rt of pe.questions)typeof rt.callId=="string"&&rt.callId!==""&&(Se[rt.callId]={remainingMs:rt.remainingMs,waitState:rt.waitState});Ie(Se);const We=pe.authorization,wt=We&&typeof We=="object"?We.prompts:[];It(Array.isArray(wt)&&wt.length>0);const ot=We&&typeof We=="object"?We:{},et=JSON.stringify([ot.catalogRevision,ot.available]);Qt.current!==et&&(Qt.current=et,xn.invalidate()),Ft(rt=>JSON.stringify(rt)===JSON.stringify(ot)?rt:ot)},schedule:($,pe)=>{const Oe=window.setTimeout($,pe);return()=>window.clearTimeout(Oe)}});Z.current=A;const I=()=>A.setVisible(!document.hidden);return document.addEventListener("visibilitychange",I),()=>{A.close(),Z.current===A&&(Z.current=null),document.removeEventListener("visibilitychange",I)}},[a,xn]),z.useEffect(()=>{tt("/cua").then(A=>st(A.body.available===!0))},[]);const $i=z.useRef(null),Ri=z.useRef(null),sa=z.useRef(null),ua=z.useRef(null),pr=z.useRef(new Set),mr=z.useRef(0),yi=z.useRef(new Map),gr=z.useRef(0),yr=z.useRef(new Map),oa=z.useRef(!1),_l=z.useRef(a),ql=z.useRef(null);_l.current=a;function ni(A){return G[A.sessionId]||x[A.sessionId]||A.title||ub(A.cwd)||n("session.unnamed")}function vr(A){const I=o.find($=>$.sessionId===A);return I?ni(I):G[A]||x[A]||""}const zs=t1(E.segments),yn=a!==""&&H!==a&&(ie==null||ie.phase==="restoring"||ie.phase==="connecting"||ie.phase==="syncing"&&H!==a),Pt=ie?.fraction!=null?{loaded:Math.round(ie.fraction*1e3),total:1e3}:null,nn=ie?.phase==="syncing"&&ie.fraction!=null,ii=z.useMemo(()=>zj(E.segments),[E.segments]),_s=z.useMemo(()=>cO(ii),[ii]),Io=a?ni({sessionId:a,cwd:o.find(A=>A.sessionId===a)?.cwd,title:E.title||null}):n("app.title"),Vo=a?`/#/s/${encodeURIComponent(a)}`:"/";function Mi(A){bt(!1),u(A),we(!1),Ve(!1),ge(null),_(null),Ce(""),Bt("");const I=A?`#/s/${encodeURIComponent(A)}`:"#/";location.hash!==I&&history.replaceState(null,"",I)}function Rl(A){if(!A||A===a)return;const I=a;bt(!1),u(A),we(!1),Ve(!1),ge(null),_(null),Ce(""),Bt("");const $=`#/s/${encodeURIComponent(A)}`;location.hash!==$&&history.pushState({kind:"worker",owner:I},"",$)}function Ml(){if(bt(!1),we(!1),Ve(!1),ge(null),history.state?.kind==="worker"){history.back();return}qi&&Mi(qi)}z.useEffect(()=>{let A=!1;return sz().then(I=>{A||De(new Set(I))}),()=>{A=!0}},[]);function Dl(A){const I=Zw(A);I&&(dr(I.signals),Xe(I.cards),St(!0));const $=A.desk;if(!$||typeof $!="object"||Array.isArray($))return;const pe=$,Oe=pe.sessions;if(Oe&&typeof Oe=="object"&&!Array.isArray(Oe)){const ot=Oe,et=ot.result;if(et?.ok!==!0)m(et?.error?.message||String(ot.error||n("session.listUnavailable")));else if(m(""),f(Wi(et.value?.items)),Yt(ot.previews),!oa.current){oa.current=!0;const rt=sb(ot.previews),jt={};for(const[Tt,sn]of Object.entries(Ud("dsh-bot.previews")))pr.current.has(Tt)||rt[Tt]||!sn||(jt[Tt]=sn);Object.keys(jt).length>0&&Hd({previews:jt})}}const Se=pe.bots;if(Se&&typeof Se=="object"&&!Array.isArray(Se)&&Se.ok===!0){const ot=Se,et=Array.isArray(ot.bots)?ot.bots:[],rt=et.flatMap(Tt=>{if(!Tt||typeof Tt!="object")return[];const sn=Tt.sessionId;return typeof sn=="string"?[sn]:[]}),jt={};for(const Tt of et){if(!Tt||typeof Tt!="object")continue;const sn=Tt.sessionId,Ll=Tt.name;typeof sn=="string"&&typeof Ll=="string"&&Ll!==""&&(jt[sn]=Ll)}if(rt.length===0&&Array.isArray(ot.sessionIds))for(const Tt of ot.sessionIds)typeof Tt=="string"&&rt.push(Tt);Dn(new Set(rt)),se(jt)}const We=pe.health;if(We&&typeof We=="object"&&!Array.isArray(We)){const ot=We;qe(ot),ot.execution&&ee({ready:ot.execution.ready===!0,reason:ot.execution.reason||(ot.execution.ready===!0?"":"catalog_unreadable")})}const wt=pe.usage;wt&&typeof wt=="object"&&!Array.isArray(wt)&&F(wt)}z.useEffect(()=>{let A=!1;return(async()=>{try{const I=await tt("/sessions");if(A)return;const $=I.body.result;$?.ok===!0?(m(""),f(Wi($.value?.items)),Yt(I.body.previews)):I.status!==200&&m($?.error?.message||n("session.listUnavailable"))}catch{}try{const I=await tt("/sessions/bots");if(A||I.body.ok!==!0)return;const $=Array.isArray(I.body.bots)?I.body.bots:[],pe=$.flatMap(Se=>{if(!Se||typeof Se!="object")return[];const We=Se.sessionId;return typeof We=="string"?[We]:[]}),Oe={};for(const Se of $){if(!Se||typeof Se!="object")continue;const We=Se.sessionId,wt=Se.name;typeof We=="string"&&typeof wt=="string"&&wt!==""&&(Oe[We]=wt)}if(pe.length===0&&Array.isArray(I.body.sessionIds))for(const Se of I.body.sessionIds)typeof Se=="string"&&pe.push(Se);Dn(new Set(pe)),se(Oe)}catch{}})(),()=>{A=!0}},[]),z.useEffect(()=>{let A=!1,I=null,$=0,pe=2e3,Oe,Se;const We=et=>{let rt;try{rt=JSON.parse(String(et.data))}catch{return null}return rt.ok===!0?rt:null},wt=()=>{if(I?.close(),Oe=void 0,Se=void 0,A||document.hidden||typeof EventSource>"u")return;const et=new EventSource(`/dsh-bot/api/live?sessionId=${encodeURIComponent(a)}`);I=et,et.addEventListener("interaction-error",()=>{!A&&I===et&&Z.current?.disconnected()}),et.addEventListener("interactions",rt=>{if(A||I!==et)return;const jt=We(rt);jt?.sessionId===a&&(pe=2e3,Z.current?.ingest(jt))}),et.addEventListener("snapshot",rt=>{if(A||I!==et)return;const jt=We(rt);jt&&(pe=2e3,jt.desk!==void 0&&(Oe=jt.desk),jt.work!==void 0&&(Se=jt.work),Dl(jt))}),et.addEventListener("delta",rt=>{if(A||I!==et)return;const jt=We(rt);if(!jt)return;const Tt={ok:!0};jt.desk!==void 0&&Oe!==void 0&&(Oe=ks(Oe,jt.desk),Tt.desk=Oe),jt.work!==void 0&&Se!==void 0&&(Se=ks(Se,jt.work),Tt.work=Se),(Tt.desk!==void 0||Tt.work!==void 0)&&Dl(Tt)}),et.addEventListener("error",()=>{A||I!==et||(Z.current?.disconnected(),et.close(),I===et&&(I=null),$=window.setTimeout(wt,pe),pe=Math.min(15e3,pe*2))})},ot=()=>{window.clearTimeout($),document.hidden?(I?.close(),I=null):(pe=2e3,wt())};return document.addEventListener("visibilitychange",ot),wt(),()=>{A=!0,document.removeEventListener("visibilitychange",ot),window.clearTimeout($),I?.close()}},[a]),z.useEffect(()=>{const A=()=>{bt(!1),we(!1),Ve(!1),ge(null),_(null),Ce(""),Bt(""),u(rb())};return window.addEventListener("hashchange",A),()=>window.removeEventListener("hashchange",A)},[]),z.useEffect(()=>{let A=!1;return tb().then($=>{A||(ql.current=Jv({follow:Xv({addressOf:pe=>ia(pe)}),page:$v({addressOf:pe=>ia(pe)}),cdc:Wv({cache:$}),range:Kv(),checkpoint:$}))}),()=>{A=!0}},[]),z.useEffect(()=>{if(!a){te(""),O(null);return}M(Ld()),O(null);let A=!1,I=null;return(async()=>{const $=await tb();if(A)return;const pe=ql.current??Jv({follow:Xv({addressOf:Se=>ia(Se)}),page:$v({addressOf:Se=>ia(Se)}),cdc:Wv({cache:$}),range:Kv(),checkpoint:$});ql.current=pe;const Oe=pe.open(a,{enhancement:"auto"});I=Oe,Oe.onBatch(Se=>{A||_l.current!==a||(M(We=>{let wt=We;for(const ot of Se.events)wt=zO(wt,ot);return wt}),te(a))}),Oe.onEphemeral(Se=>{A||_l.current!==a||M(We=>_O(We,Se))}),Oe.onStatus(Se=>{A||_l.current!==a||(O(Se),(Se.phase==="live"||Se.phase==="stalled"||Se.phase==="error")&&te(a))})})(),()=>{A=!0,I?.close()}},[a]),z.useEffect(()=>{!a||X!==a||!E.title||G[a]||k(A=>{if(A[a]===E.title)return A;const I={...A,[a]:E.title};return sessionStorage.setItem("dsh-bot.titles",JSON.stringify(I)),I})},[a,X,E.title,G]);const Ln=!!a&&tn.has(a),Vt=Ln&&xt?Pe[a]??[]:[],Di=Ln&&xt?a:"";z.useEffect(()=>{if(!a||!ar(a)){zl("");return}let A=!1;const I=Fw(a);return bs(`/dsh-bot/api/work/ticket?id=${encodeURIComponent(I)}`).then($=>{if(A||$.body.ok!==!0||!$.body.ticket||typeof $.body.ticket!="object")return;const pe=$.body.ticket.owner_session_id;typeof pe=="string"&&zl(pe)}),()=>{A=!0}},[a]);const Li=Vt.some(A=>A.status==="started");z.useEffect(()=>{if(!Li)return;const A=window.setInterval(()=>hr(Date.now()),1e3);return()=>window.clearInterval(A)},[Li]);function Yt(A){const I=sb(A);Object.keys(I).length!==0&&C($=>{let pe=!1;const Oe={...$};for(const[Se,We]of Object.entries(I))Oe[Se]||(Oe[Se]=We,pe=!0);return pe?(sessionStorage.setItem("dsh-bot.previews",JSON.stringify(Oe)),Oe):$})}function ca(){window.clearTimeout(gr.current),gr.current=0;const A=[...yi.current];if(yi.current.clear(),A.length!==0){if(A.length===1){const[I,$]=A[0]??[];I&&$&&Hd({sessionId:I,preview:$});return}Hd({previews:Object.fromEntries(A)})}}z.useEffect(()=>()=>{ca()},[]),z.useEffect(()=>{if(!a||X!==a)return;const A=qO(E.segments);!A||yr.current.get(a)===A||(yr.current.set(a,A),C(I=>{if(I[a]===A)return I;const $={...I,[a]:A};return sessionStorage.setItem("dsh-bot.previews",JSON.stringify($)),$}),yi.current.set(a,A),window.clearTimeout(gr.current),gr.current=window.setTimeout(ca,400))},[a,X,E.segments]),z.useLayoutEffect(()=>{const A=ua.current;if(!A||!J)return;const I=A.getBoundingClientRect(),$=Math.max(8,Math.min(J.x,window.innerWidth-I.width-8)),pe=Math.max(8,Math.min(J.y,window.innerHeight-I.height-8));($!==J.x||pe!==J.y)&&he(Oe=>Oe&&{...Oe,x:$,y:pe}),A.querySelector("button")?.focus()},[J]),z.useEffect(()=>{if(!J)return;const A=()=>he(null),I=pe=>{const Oe=pe.target;Oe instanceof Node&&ua.current?.contains(Oe)||A()},$=pe=>{pe.key==="Escape"&&A()};return document.addEventListener("pointerdown",I),document.addEventListener("keydown",$),document.addEventListener("scroll",A,!0),()=>{document.removeEventListener("pointerdown",I),document.removeEventListener("keydown",$),document.removeEventListener("scroll",A,!0)}},[J]),z.useEffect(()=>{if(!je)return;const A=$=>{const pe=$.target;pe instanceof Node&&sa.current?.contains(pe)||we(!1)},I=$=>{$.key==="Escape"&&we(!1)};return document.addEventListener("pointerdown",A),document.addEventListener("keydown",I),()=>{document.removeEventListener("pointerdown",A),document.removeEventListener("keydown",I)}},[je]),z.useEffect(()=>{bt(!1)},[a]);const qs=Vt.map(A=>`${A.id}:${A.status}:${A.revision}`).join(`
63
+ `);z.useEffect(()=>{const A=$i.current;A&&(A.scrollTop=A.scrollHeight)},[E.segments,E.drafting,E.activity,a,Dt,qs]);const vi=z.useMemo(()=>{const A=p.trim().toLowerCase();return o.filter(I=>ar(I.sessionId)||Ne.has(I.sessionId)?!1:A?[ni(I),I.cwd??"",T[I.sessionId]??""].join(" ").toLowerCase().includes(A):!0)},[o,p,x,T,Ne,G]).filter(A=>!A.blank),kn=z.useMemo(()=>{const A=p.trim().toLowerCase();return o.filter(I=>I.blank!==!0||ar(I.sessionId)?!1:A?[ni(I),I.cwd??""].join(" ").toLowerCase().includes(A):!0)},[o,p,x,G]),fa=qt||p.trim()!=="",Rs=z.useMemo(()=>!a||!tn.has(a)?[]:o.flatMap(A=>!tn.has(A.sessionId)||A.sessionId===a||Ne.has(A.sessionId)||ar(A.sessionId)?[]:[{sessionId:A.sessionId,label:ni(A)}]),[o,tn,a,Ne,G,x]),li=a&&tn.has(a)?k3(Te,lt):null,da=li?`${li.start}:${li.query}`:"",He=li?C3(Rs,li.query):[],ha=li!=null&&ne!==da,Pi=Math.min(R,Math.max(He.length-1,0));z.useEffect(()=>{q(0)},[da]);function Wi(A){const I=pr.current;return(A??[]).filter($=>!I.has($.sessionId))}function Bn(A){pr.current.add(A),yi.current.delete(A),yr.current.delete(A),f(I=>I.filter($=>$.sessionId!==A)),De(I=>{const $=new Set(I);return $.delete(A),$}),k(I=>ab("dsh-bot.titles",I,A)),C(I=>ab("dsh-bot.previews",I,A)),Dn(I=>{if(!I.has(A))return I;const $=new Set(I);return $.delete(A),$}),se(I=>{if(!(A in I))return I;const $={...I};return delete $[A],$}),a===A&&Mi("")}function vn(A,I){const $=new Set(Ne);for(const pe of I)$.add(pe);if(Array.isArray(A))for(const pe of A)typeof pe=="string"&&$.add(pe);De($),I.includes(a)&&Mi("")}async function Ms(A){const I=await tt(`/sessions/${encodeURIComponent(A)}/archive`,{method:"POST"});if(I.status!==200){const $=I.body.upstream;m($?.message||(I.body.error==="not_blank"?n("session.notBlankArchive"):n("session.archiveFailed")));return}m(""),vn(I.body.archivedSessionIds,[A])}function Ds(A,I){A.preventDefault(),he({id:I,x:A.clientX,y:A.clientY})}async function pa(A){const I=await tt(`/sessions/${encodeURIComponent(A)}/delete`,{method:"POST"});if(I.status!==200){const $=I.body.error,pe=typeof I.body.message=="string"?I.body.message:"";m($==="running"?n("session.deleteRunning"):$==="attached"?n("session.deleteAttached"):pe||n("session.deleteFailed"));return}m(""),Bn(A)}async function Ls(){if(kn.length===0||!window.confirm(n("session.archiveConfirm",{count:String(kn.length)})))return;const A=[];let I=[];for(const $ of kn){const pe=await tt(`/sessions/${encodeURIComponent($.sessionId)}/archive`,{method:"POST"});if(pe.status!==200){const Oe=pe.body.upstream;m(Oe?.message||n("session.archiveSomeFailed"));break}A.push($.sessionId),I=pe.body.archivedSessionIds}A.length>0&&vn(I,A)}async function Go(A){const I=o.find(Oe=>Oe.sessionId===A),$=x[A]||ub(I?.cwd)||n("session.blankName");if(!window.confirm(n("session.purgeOneConfirm",{name:$})))return;const pe=await tt(`/sessions/${encodeURIComponent(A)}/purge`,{method:"POST"});if(pe.status!==200){m(pe.body.error==="not_blank"?n("session.purgeNotBlank"):n("session.purgeFailed"));return}Bn(A)}async function Nn(){const A=kn.filter($=>$.blank===!0);if(A.length===0||!window.confirm(n("session.purgeAllConfirm",{count:String(A.length)})))return;const I=[];for(const $ of A){if((await tt(`/sessions/${encodeURIComponent($.sessionId)}/purge`,{method:"POST"})).status!==200){m(n("session.purgeSomeFailed"));break}I.push($.sessionId),Bn($.sessionId)}I.length}async function ma(A,I,$){wn(!1),$!==""&&(se(Se=>({...Se,[A]:$})),Dn(Se=>new Set([...Se,A])),k(Se=>{const We={...Se,[A]:$};return sessionStorage.setItem("dsh-bot.titles",JSON.stringify(We)),We}));const Oe=(await tt("/sessions")).body.result;f(Wi(Oe?.value?.items)),Mi(A),Bt(I),_i(Se=>Se+1)}function ga(A,I){N(A),pt(I),window.requestAnimationFrame(()=>{const $=Ri.current;$&&($.focus(),$.setSelectionRange(I,I))})}function br(A){if(!li)return;const I=A3(Te,lt,li.start,A.label,A.sessionId);ga(I.text,I.cursor)}function el(A="/"){we(!1),N(I=>{const $=I.replace(/\s+$/,"");return $===""?A==="/"?"/":`${A} `:`${$} ${A==="/"?"/":`${A} `}`}),window.requestAnimationFrame(()=>Ri.current?.focus())}async function ya(A){const I=me?.status==="accepted"&&E.drafting,$=Di===a?Vt:[];if(!a||!A||!K.ready||Xy(I,$,tn.has(a)))return;const pe=E.drafting;N(""),Ce(""),mr.current+=1;const Oe=Number.MAX_SAFE_INTEGER-mr.current;M(wt=>({...wt,drafting:!0,segments:[...wt.segments,{kind:"user",id:`optimistic:${Oe}`,text:A,time:Date.now(),seq:Oe,optimistic:!0}]}));const Se=await tt("/tasks",{method:"POST",headers:{"content-type":"application/json","idempotency-key":crypto.randomUUID()},body:JSON.stringify({sessionId:a,text:A})}),We=Se.body.task;if(_(We??null),Se.status!==202){M(ot=>({...ot,drafting:pe?ot.drafting:!1,segments:ot.segments.filter(et=>!(et.kind==="user"&&et.optimistic&&et.text===A))}));const wt=Se.body.execution;Ce(wt?.reason||Ao(String(Se.body.error||""),n("composer.notSent"),n))}}async function va(){const A=Te.trim();A&&await ya(A)}async function tl(A,I){const $=await bs("/dsh-bot/api/work/supply",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:a,ticketId:A,text:I})});return $.status!==200||$.body.ok===!1?fb($.body,n("composer.supplyFailed")):""}async function Fo(){if(!me||me.status!=="accepted")return;const I=(await tt(`/tasks/${me.id}/cancel?sessionId=${encodeURIComponent(me.sessionId??"")}`,{method:"POST"})).body.task??me;_(I),I.status==="cancelled"&&M($=>({...$,drafting:!1}))}const nl=me?.status==="accepted"&&E.drafting,xr=Xy(nl,Di===a?Vt:[],Ln),Xo=!!a&&K.ready&&Te.trim()!==""&&!xr;function Bs(A){if(!tn.has(A.sessionId))return null;const I=A.running===!0||A.sessionId===a&&(nl||E.drafting),$=A.sessionId===a&&Di===a?Vt:(pi[A.sessionId]??[]).map(pe=>({status:pe}));return Pw($,I)}return v.jsxs("div",{className:a?"shell in-chat":"shell",children:[v.jsxs("aside",{className:"side",children:[v.jsxs("div",{className:"side-top",children:[v.jsx("strong",{className:"brand",children:n("app.title")}),v.jsxs("span",{className:"side-actions",children:[v.jsx("button",{type:"button",className:"icon-btn","aria-label":n("session.search"),onClick:()=>S(A=>!A),children:v.jsx(z3,{})}),v.jsx("button",{type:"button",className:"icon-btn","aria-label":n("new.title"),onClick:()=>wn(!0),children:v.jsx(ib,{})})]})]}),g?v.jsx("input",{className:"filter",value:p,placeholder:n("session.searchPlaceholder"),onChange:A=>y(A.target.value)}):null,h?v.jsx("p",{className:"note",children:h}):null,Lt?v.jsx("p",{className:"note ok",children:Lt}):null,v.jsxs("ul",{className:"sessions",children:[vi.length===0&&kn.length===0?v.jsx("li",{className:"empty",children:o.length?n("session.noMatch"):n("session.none")}):null,vi.map(A=>{const I=ni(A);return v.jsx("li",{onContextMenu:$=>Ds($,A.sessionId),children:v.jsxs("button",{type:"button",className:A.sessionId===a?"session selected":"session",title:A.cwd||A.sessionId,onClick:()=>Mi(A.sessionId),children:[v.jsxs("span",{className:tn.has(A.sessionId)?"mark bot-mark":"mark",children:[tn.has(A.sessionId)?"BOT":Array.from(I)[0],v.jsx(nb,{signal:Bs(A)})]}),v.jsxs("span",{className:"copy",children:[v.jsx("span",{className:"name",children:I}),v.jsx("span",{className:"preview",children:(A.sessionId===a?gd(Vt,mi,n):"")||T[A.sessionId]||(A.running?n("session.running"):"")})]})]})},A.sessionId)}),kn.length>0?v.jsxs("li",{className:"blank-head",children:[v.jsxs("button",{type:"button","aria-expanded":fa,onClick:()=>Sn(A=>!A),children:[n(fa?"session.hide":"session.show")," ",n("session.blankCount",{count:String(kn.length)})]}),v.jsx("button",{type:"button",onClick:()=>{Ls()},children:n("session.archiveAll")}),v.jsx("button",{type:"button",onClick:()=>{Nn()},children:n("session.purgeAll")})]}):null,fa?kn.map(A=>{const I=ni(A);return v.jsxs("li",{className:"session-row",onContextMenu:$=>Ds($,A.sessionId),children:[v.jsxs("button",{type:"button",className:A.sessionId===a?"session selected":"session",title:A.cwd||A.sessionId,onClick:()=>Mi(A.sessionId),children:[v.jsx("span",{className:tn.has(A.sessionId)?"mark bot-mark":"mark",children:tn.has(A.sessionId)?"BOT":Array.from(I)[0]}),v.jsxs("span",{className:"copy",children:[v.jsx("span",{className:"name",children:I}),v.jsx("span",{className:"preview",children:Ne.has(A.sessionId)?n("session.archived"):n("session.blank")})]})]}),Ne.has(A.sessionId)?null:v.jsx("button",{type:"button",className:"session-delete","aria-label":n("session.archiveLabel",{name:I}),onClick:()=>{Ms(A.sessionId)},children:n("session.archive")}),v.jsx("button",{type:"button",className:"session-delete purge","aria-label":n("session.purgeLabel",{name:I}),onClick:()=>{Go(A.sessionId)},children:n("session.purge")})]},A.sessionId)}):null]}),ue?v.jsx(O3,{health:Ee,usage:re,execution:K,model:E.model}):null,v.jsxs("div",{className:"me-row",children:[v.jsxs("button",{type:"button",className:"me",onClick:()=>ce(A=>!A),children:[v.jsx("span",{className:"mark me-mark",children:n("local.mark")}),v.jsx("span",{children:Ee?.primary?.reachable===!1?n("local.down"):n("local.here")})]}),v.jsx("button",{type:"button",className:"lang-switch",onClick:()=>r(l==="en"?"zh":"en"),children:n("lang.switch")})]})]}),v.jsxs("section",{className:"chat",children:[v.jsxs("header",{className:"chat-head",children:[Dt?v.jsx("button",{type:"button",className:"bot-chat-back",onClick:()=>bt(!1),children:n("nav.back")}):ar(a)?v.jsx("button",{type:"button",className:"back",onClick:Ml,children:n("nav.back")}):v.jsx("button",{type:"button",className:"back",onClick:()=>{Ve(!1),ge(null),u("")},children:n("nav.sessions")}),a&&tn.has(a)?v.jsxs("span",{className:"bot-badge",children:["BOT",v.jsx(nb,{signal:Bs({sessionId:a,running:o.find(A=>A.sessionId===a)?.running})})]}):null,v.jsx("h1",{children:Dt?n("nav.botMessages"):Io}),!Dt&&gd(Vt,mi,n)?v.jsx("span",{className:"work-chip",children:gd(Vt,mi,n)}):null,a&&!Dt?v.jsx("button",{type:"button",className:"files-open","aria-pressed":xe,onClick:()=>{if(xe){Ve(!1),ge(null);return}Ve(!0)},children:n("files.open")}):null,v.jsx("a",{href:Vo,children:n("nav.official")})]}),ar(a)&&!Dt?v.jsxs("nav",{className:"work-crumb","aria-label":n("nav.where"),children:[v.jsx("button",{type:"button",onClick:Ml,children:qi&&vr(qi)||n("nav.mainSession")}),v.jsx("span",{"aria-hidden":"true",children:"/"}),v.jsx("span",{children:n("nav.worker")})]}):null,gi&&!Dt?v.jsx("p",{className:"basis",children:gi}):null,v.jsxs("div",{className:"chat-body",children:[v.jsx(N3,{active:yn||nn,progress:Pt}),v.jsx("div",{className:"scroll",ref:$i,"aria-busy":yn||nn||void 0,children:v.jsxs("div",{className:"column",children:[a?null:v.jsx("p",{className:"empty-thread",children:n("nav.pick")}),a&&!yn&&!nn&&!Dt&&ii.length===0&&Vt.length===0?v.jsx("p",{className:"empty-thread",children:n("nav.empty")}):null,v.jsx($2,{children:yn?null:Dt?v.jsx(Lj,{items:zs,botLabel:vr,onOpenFile:(A,I)=>{ge({path:A,line:I,token:Date.now()}),Ve(!0)}}):v.jsx(tz,{sessionId:a,cwd:o.find(A=>A.sessionId===a)?.cwd,connectionPhase:ie?.phase,segments:ii,approvals:ke,questionWaits:$e,onCompose:A=>ga(A,A.length),completed:E.completed,failures:E.failures,retries:E.retries,turnEnds:E.turnEnds,tickets:Vt,now:mi,canRetry:!!a&&K.ready&&!nl,onRetry:A=>{ya(A)},onSupply:tl,onOpenSession:Rl,onOpenFile:(A,I)=>{ge({path:A,line:I,token:Date.now()}),Ve(!0)},onOpenInbox:()=>bt(!0),botLabel:vr,chat:Ln})},a)]})}),Dt||yn?null:v.jsx(Vj,{root:$i,marks:_s,busyId:E.drafting&&E.turn!=null?`turn:${E.turn}`:void 0})]}),v.jsx("div",{className:"composer-wrap",hidden:Dt,children:v.jsxs("form",{className:"column",onSubmit:A=>{A.preventDefault(),va()},children:[a&&!yn?v.jsx(aO,{segments:E.segments,drafting:E.drafting,currentTurn:E.turn,tickets:Vt,connectionPhase:ie?.phase,pendingApprovals:ke}):null,v.jsxs("div",{className:"card",children:[ha?v.jsx("div",{className:"mention-menu",role:"listbox","aria-label":n("composer.mention"),children:He.length===0?v.jsx("p",{className:"mention-empty",children:n("composer.noBot")}):He.map((A,I)=>v.jsxs("button",{type:"button",role:"option","aria-selected":I===Pi,className:I===Pi?"active":"",onMouseDown:$=>{$.preventDefault(),br(A)},children:[v.jsx("span",{className:"bot-badge",children:"BOT"}),v.jsx("span",{className:"mention-name",children:A.label})]},A.sessionId))}):null,v.jsx("textarea",{ref:Ri,value:Te,rows:1,placeholder:a?uh({segments:E.segments,drafting:E.drafting,currentTurn:E.turn,tickets:Vt,pendingApprovals:ke,t:n})?.text===n("question.waiting")||uh({segments:E.segments,drafting:E.drafting,currentTurn:E.turn,tickets:Vt,pendingApprovals:ke,t:n})?.text===n("approval.waiting")?n("question.waiting"):Ww(Vt,n)??(Ln&&nl?n("composer.interrupt"):tn.has(a)?n("composer.mentionHint"):n("composer.task")):n("composer.pick"),disabled:!a,onChange:A=>{N(A.target.value),pt(A.target.selectionStart??A.target.value.length)},onSelect:A=>pt(A.currentTarget.selectionStart??0),onKeyDown:A=>{if(!A.nativeEvent.isComposing){if(ha&&He.length>0){if(A.key==="ArrowDown"){A.preventDefault(),q(I=>(I+1)%He.length);return}if(A.key==="ArrowUp"){A.preventDefault(),q(I=>(I-1+He.length)%He.length);return}if(A.key==="Enter"||A.key==="Tab"){A.preventDefault();const I=He[Pi];I&&br(I);return}if(A.key==="Escape"){A.preventDefault(),fe(da);return}}A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),va())}}}),v.jsxs("div",{className:"card-row",children:[v.jsxs("div",{className:"tools",ref:sa,children:[v.jsx("button",{type:"button",className:"add","aria-label":n("composer.add"),"aria-haspopup":"menu","aria-expanded":je,disabled:!a,onClick:()=>we(A=>!A),children:v.jsx(ib,{})}),je?v.jsxs("div",{className:"plus-menu",role:"menu",children:[v.jsx("button",{type:"button",role:"menuitem",onClick:()=>el(),children:n("composer.command")}),v.jsx("button",{type:"button",role:"menuitem",onClick:()=>{we(!1),Et("permission")},children:n("permission.open")}),v.jsx("button",{type:"button",role:"menuitem",onClick:()=>{we(!1),Et("authorization")},children:n("auth.open")}),Re?v.jsx("button",{type:"button",role:"menuitem",onClick:()=>{we(!1),Et("cua")},children:n("cua.open")}):null,v.jsx("p",{className:"plus-note",children:n("composer.filesLater")})]}):null,E.preset?v.jsxs("button",{type:"button",className:"chip",onClick:()=>Et("permission"),children:[v.jsx(_3,{preset:E.preset}),o1(E.preset,n)]}):null]}),v.jsxs("div",{className:"trailing",children:[E.model?v.jsx("span",{className:"model",children:E.model}):null,nl?v.jsx("button",{type:"button",className:"stop","aria-label":n("composer.cancel"),onClick:()=>{Fo()},children:v.jsx("span",{className:"stop-icon"})}):null,xr?null:v.jsx("button",{type:"submit",className:"send","aria-label":n("composer.send"),disabled:!Xo,children:v.jsx(q3,{})})]})]})]}),v.jsx("p",{className:"stats",children:ye||(K.ready?j3(E):Ao(K.reason,K.reason,n))})]})})]}),ut==="permission"&&a?v.jsx(sO,{sessionId:a,current:E.preset,onClose:()=>Et(null),onChanged:()=>_i(A=>A+1)}):null,ut==="authorization"||mt&&ut==null?v.jsx(uO,{authorization:Mt,catalog:xn,onClose:()=>Et(null)}):null,ut==="cua"&&Re?v.jsx(oO,{onClose:()=>Et(null)}):null,a?v.jsx(uj,{open:xe,sessionId:a,focus:ae,onClose:()=>{Ve(!1),ge(null)}},a):null,J?v.jsx("div",{ref:ua,className:"session-menu",role:"menu","aria-label":n("session.menu"),style:{left:J.x,top:J.y},onContextMenu:A=>A.preventDefault(),children:v.jsx("button",{type:"button",role:"menuitem",onClick:()=>{const A=J.id;he(null),pa(A)},children:n("session.delete")})}):null,en?v.jsx(Nj,{onClose:()=>wn(!1),onCreated:(A,I,$)=>{ma(A,I,$)}}):null]})}const k1=document.querySelector("#root");if(!k1)throw new Error("missing root");sw.createRoot(k1).render(v.jsx(z.StrictMode,{children:v.jsx(Iw,{children:v.jsx(uz,{})})}));export{oz as W,uk as _,v as j,cz as m,z as r,Je as u};