@thready-web/dsh-bot-plugin 0.1.0-beta.11 → 0.1.0-beta.12

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 (54) hide show
  1. package/README.md +19 -2
  2. package/dist/approvals.js +19 -1
  3. package/dist/canvas-compose.js +73 -0
  4. package/dist/canvas-http.js +131 -0
  5. package/dist/canvas-store.js +227 -6
  6. package/dist/canvas-tools.js +199 -30
  7. package/dist/card-log.js +216 -0
  8. package/dist/context.js +5 -3
  9. package/dist/deleting.js +54 -0
  10. package/dist/desk-ledger.js +18 -0
  11. package/dist/desk.js +30 -5
  12. package/dist/http-plugin.js +2 -1
  13. package/dist/http.js +200 -4
  14. package/dist/inbox.js +24 -2
  15. package/dist/index.js +65 -13
  16. package/dist/questions.js +10 -0
  17. package/dist/runtime-registry.js +20 -0
  18. package/dist/session-delete-job.js +77 -0
  19. package/dist/session-files.js +33 -1
  20. package/dist/session-wipe.js +204 -0
  21. package/dist/store.js +46 -3
  22. package/dist/triggers.js +8 -0
  23. package/dist/work-admit.js +9 -20
  24. package/dist/work-child.js +27 -10
  25. package/dist/work-ledger.js +5 -1
  26. package/dist/work-mock.js +10 -0
  27. package/dist/work-tickets.js +5 -3
  28. package/dist/work-tools.js +11 -9
  29. package/dist/work-worker.js +240 -6
  30. package/dist/worker-handles.js +33 -0
  31. package/dist/workspace-files.js +98 -17
  32. package/package.json +1 -1
  33. package/public/assets/{SourceEditor-uu0G7jsM.js → SourceEditor-BjtoMvcX.js} +3 -3
  34. package/public/assets/{cssMode-C5DAFF5H.js → cssMode--96PQtWh.js} +1 -1
  35. package/public/assets/{freemarker2-DExNwSiZ.js → freemarker2-Bz-HlISL.js} +1 -1
  36. package/public/assets/{handlebars-BK7YAvpQ.js → handlebars-D9ScJ8AM.js} +1 -1
  37. package/public/assets/{html-CdDm_zae.js → html-Czc0jojJ.js} +1 -1
  38. package/public/assets/{htmlMode-CLdn9oa1.js → htmlMode-CCww5Z1w.js} +1 -1
  39. package/public/assets/index-DRCgKxWk.css +1 -0
  40. package/public/assets/index-ztUdW074.js +72 -0
  41. package/public/assets/{javascript-mLl83_3W.js → javascript-B-yRZSiz.js} +1 -1
  42. package/public/assets/{jsonMode-B1-bihFd.js → jsonMode-ASWsY833.js} +1 -1
  43. package/public/assets/{liquid-Cv8m0HUb.js → liquid-BGoox2vJ.js} +1 -1
  44. package/public/assets/{mdx-Q12b91rL.js → mdx-DHgvnl_U.js} +1 -1
  45. package/public/assets/{python-Kda811W0.js → python-BJvVD30_.js} +1 -1
  46. package/public/assets/{razor-CRuCpdOW.js → razor-0PwR35mu.js} +1 -1
  47. package/public/assets/{tsMode-BGHcz-M3.js → tsMode-3ETp8Gdh.js} +1 -1
  48. package/public/assets/{typescript-Db1e0DCT.js → typescript-BT0iTK6K.js} +1 -1
  49. package/public/assets/{xml-H3zzFmnd.js → xml-BTaNc_uT.js} +1 -1
  50. package/public/assets/{yaml-BQrKvmTF.js → yaml-Dr7LW3tK.js} +1 -1
  51. package/public/index.html +2 -2
  52. package/skills/ui/ui-design/SKILL.md +11 -5
  53. package/public/assets/index-BB-QDSf2.css +0 -1
  54. package/public/assets/index-CsX-_qbo.js +0 -62
@@ -1,62 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SourceEditor-uu0G7jsM.js","assets/SourceEditor-CJwK846Z.css"])))=>i.map(i=>d[i]);
2
- (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function r(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(o){if(o.ep)return;o.ep=!0;const u=r(o);fetch(o.href,u)}})();function Rb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xd={exports:{}},ms={};var Gy;function MS(){if(Gy)return ms;Gy=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(a,o,u){var c=null;if(u!==void 0&&(c=""+u),o.key!==void 0&&(c=""+o.key),"key"in o){u={};for(var h in o)h!=="key"&&(u[h]=o[h])}else u=o;return o=u.ref,{$$typeof:t,type:a,key:c,ref:o!==void 0?o:null,props:u}}return ms.Fragment=i,ms.jsx=r,ms.jsxs=r,ms}var Qy;function qS(){return Qy||(Qy=1,xd.exports=MS()),xd.exports}var m=qS(),wd={exports:{}},Ue={};var Xy;function DS(){if(Xy)return Ue;Xy=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),w=Symbol.for("react.view_transition"),x=Symbol.iterator;function S(z){return z===null||typeof z!="object"?null:(z=x&&z[x]||z["@@iterator"],typeof z=="function"?z:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,E={};function q(z,ne,J){this.props=z,this.context=ne,this.refs=E,this.updater=J||T}q.prototype.isReactComponent={},q.prototype.setState=function(z,ne){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,ne,"setState")},q.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function B(){}B.prototype=q.prototype;function ee(z,ne,J){this.props=z,this.context=ne,this.refs=E,this.updater=J||T}var X=ee.prototype=new B;X.constructor=ee,C(X,q.prototype),X.isPureReactComponent=!0;var O=Array.isArray;function Y(){}var K={H:null,A:null,T:null,S:null},se=Object.prototype.hasOwnProperty;function _(z,ne,J){var ae=J.ref;return{$$typeof:t,type:z,key:ne,ref:ae!==void 0?ae:null,props:J}}function G(z,ne){return _(z.type,ne,z.props)}function te(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function Te(z){var ne={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(J){return ne[J]})}var xe=/\/+/g;function fe(z,ne){return typeof z=="object"&&z!==null&&z.key!=null?Te(""+z.key):ne.toString(36)}function re(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(Y,Y):(z.status="pending",z.then(function(ne){z.status==="pending"&&(z.status="fulfilled",z.value=ne)},function(ne){z.status==="pending"&&(z.status="rejected",z.reason=ne)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function ue(z,ne,J,ae,Oe){var be=typeof z;(be==="undefined"||be==="boolean")&&(z=null);var we=!1;if(z===null)we=!0;else switch(be){case"bigint":case"string":case"number":we=!0;break;case"object":switch(z.$$typeof){case t:case i:we=!0;break;case v:return we=z._init,ue(we(z._payload),ne,J,ae,Oe)}}if(we)return Oe=Oe(z),we=ae===""?"."+fe(z,0):ae,O(Oe)?(J="",we!=null&&(J=we.replace(xe,"$&/")+"/"),ue(Oe,ne,J,"",function(We){return We})):Oe!=null&&(te(Oe)&&(Oe=G(Oe,J+(Oe.key==null||z&&z.key===Oe.key?"":(""+Oe.key).replace(xe,"$&/")+"/")+we)),ne.push(Oe)),1;we=0;var P=ae===""?".":ae+":";if(O(z))for(var ye=0;ye<z.length;ye++)ae=z[ye],be=P+fe(ae,ye),we+=ue(ae,ne,J,be,Oe);else if(ye=S(z),typeof ye=="function")for(z=ye.call(z),ye=0;!(ae=z.next()).done;)ae=ae.value,be=P+fe(ae,ye++),we+=ue(ae,ne,J,be,Oe);else if(be==="object"){if(typeof z.then=="function")return ue(re(z),ne,J,ae,Oe);throw ne=String(z),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return we}function ge(z,ne,J){if(z==null)return z;var ae=[],Oe=0;return ue(z,ae,"","",function(be){return ne.call(J,be,Oe++)}),ae}function me(z){if(z._status===-1){var ne=z._result,J=ne();J.then(function(ae){(z._status===0||z._status===-1)&&(z._status=1,z._result=ae,J.status===void 0&&(J.status="fulfilled",J.value=ae))},function(ae){(z._status===0||z._status===-1)&&(z._status=2,z._result=ae,J.status===void 0&&(J.status="rejected",J.reason=ae))}),z._status===-1&&(z._status=0,z._result=J)}if(z._status===1)return z._result.default;throw z._result}var A=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)};function Ee(z){var ne=K.T,J={};J.types=ne!==null?ne.types:null,K.T=J;try{var ae=z(),Oe=K.S;Oe!==null&&Oe(J,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(Y,A)}catch(be){A(be)}finally{ne!==null&&J.types!==null&&(ne.types=J.types),K.T=ne}}function Be(z){var ne=K.T;if(ne!==null){var J=ne.types;J===null?ne.types=[z]:J.indexOf(z)===-1&&J.push(z)}else Ee(Be.bind(null,z))}var M={map:ge,forEach:function(z,ne,J){ge(z,function(){ne.apply(this,arguments)},J)},count:function(z){var ne=0;return ge(z,function(){ne++}),ne},toArray:function(z){return ge(z,function(ne){return ne})||[]},only:function(z){if(!te(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return Ue.Activity=y,Ue.Children=M,Ue.Component=q,Ue.Fragment=r,Ue.Profiler=o,Ue.PureComponent=ee,Ue.StrictMode=a,Ue.Suspense=g,Ue.ViewTransition=w,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(z){return K.H.useMemoCache(z)}},Ue.addTransitionType=Be,Ue.cache=function(z){return function(){return z.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(z,ne,J){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var ae=C({},z.props),Oe=z.key;if(ne!=null)for(be in ne.key!==void 0&&(Oe=""+ne.key),ne)!se.call(ne,be)||be==="key"||be==="__self"||be==="__source"||be==="ref"&&ne.ref===void 0||(ae[be]=ne[be]);var be=arguments.length-2;if(be===1)ae.children=J;else if(1<be){for(var we=Array(be),P=0;P<be;P++)we[P]=arguments[P+2];ae.children=we}return _(z.type,Oe,ae)},Ue.createContext=function(z){return z={$$typeof:c,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:u,_context:z},z},Ue.createElement=function(z,ne,J){var ae,Oe={},be=null;if(ne!=null)for(ae in ne.key!==void 0&&(be=""+ne.key),ne)se.call(ne,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(Oe[ae]=ne[ae]);var we=arguments.length-2;if(we===1)Oe.children=J;else if(1<we){for(var P=Array(we),ye=0;ye<we;ye++)P[ye]=arguments[ye+2];Oe.children=P}if(z&&z.defaultProps)for(ae in we=z.defaultProps,we)Oe[ae]===void 0&&(Oe[ae]=we[ae]);return _(z,be,Oe)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(z){return{$$typeof:h,render:z}},Ue.isValidElement=te,Ue.lazy=function(z){return{$$typeof:v,_payload:{_status:-1,_result:z},_init:me}},Ue.memo=function(z,ne){return{$$typeof:p,type:z,compare:ne===void 0?null:ne}},Ue.startTransition=Ee,Ue.unstable_useCacheRefresh=function(){return K.H.useCacheRefresh()},Ue.use=function(z){return K.H.use(z)},Ue.useActionState=function(z,ne,J){return K.H.useActionState(z,ne,J)},Ue.useCallback=function(z,ne){return K.H.useCallback(z,ne)},Ue.useContext=function(z){return K.H.useContext(z)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(z,ne){return K.H.useDeferredValue(z,ne)},Ue.useEffect=function(z,ne){return K.H.useEffect(z,ne)},Ue.useEffectEvent=function(z){return K.H.useEffectEvent(z)},Ue.useId=function(){return K.H.useId()},Ue.useImperativeHandle=function(z,ne,J){return K.H.useImperativeHandle(z,ne,J)},Ue.useInsertionEffect=function(z,ne){return K.H.useInsertionEffect(z,ne)},Ue.useLayoutEffect=function(z,ne){return K.H.useLayoutEffect(z,ne)},Ue.useMemo=function(z,ne){return K.H.useMemo(z,ne)},Ue.useOptimistic=function(z,ne){return K.H.useOptimistic(z,ne)},Ue.useReducer=function(z,ne,J){return K.H.useReducer(z,ne,J)},Ue.useRef=function(z){return K.H.useRef(z)},Ue.useState=function(z){return K.H.useState(z)},Ue.useSyncExternalStore=function(z,ne,J){return K.H.useSyncExternalStore(z,ne,J)},Ue.useTransition=function(){return K.H.useTransition()},Ue.version="19.3.1",Ue}var Zy;function wh(){return Zy||(Zy=1,wd.exports=DS()),wd.exports}var j=wh();const R4=Rb(j);var Sd={exports:{}},ps={},kd={exports:{}},Ed={};var Ky;function LS(){return Ky||(Ky=1,(function(t){function i(re,ue){var ge=re.length;re.push(ue);e:for(;0<ge;){var me=ge-1>>>1,A=re[me];if(0<o(A,ue))re[me]=ue,re[ge]=A,ge=me;else break e}}function r(re){return re.length===0?null:re[0]}function a(re){if(re.length===0)return null;var ue=re[0],ge=re.pop();if(ge!==ue){re[0]=ge;e:for(var me=0,A=re.length,Ee=A>>>1;me<Ee;){var Be=2*(me+1)-1,M=re[Be],z=Be+1,ne=re[z];if(0>o(M,ge))z<A&&0>o(ne,M)?(re[me]=ne,re[z]=ge,me=z):(re[me]=M,re[Be]=ge,me=Be);else if(z<A&&0>o(ne,ge))re[me]=ne,re[z]=ge,me=z;else break e}}return ue}function o(re,ue){var ge=re.sortIndex-ue.sortIndex;return ge!==0?ge:re.id-ue.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var c=Date,h=c.now();t.unstable_now=function(){return c.now()-h}}var g=[],p=[],v=1,y=null,w=3,x=!1,S=!1,T=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function ee(re){for(var ue=r(p);ue!==null;){if(ue.callback===null)a(p);else if(ue.startTime<=re)a(p),ue.sortIndex=ue.expirationTime,i(g,ue);else break;ue=r(p)}}function X(re){if(T=!1,ee(re),!S)if(r(g)!==null)S=!0,O||(O=!0,te());else{var ue=r(p);ue!==null&&fe(X,ue.startTime-re)}}var O=!1,Y=-1,K=5,se=-1;function _(){return C?!0:!(t.unstable_now()-se<K)}function G(){if(C=!1,O){var re=t.unstable_now();se=re;var ue=!0;try{e:{S=!1,T&&(T=!1,q(Y),Y=-1),x=!0;var ge=w;try{t:{for(ee(re),y=r(g);y!==null&&!(y.expirationTime>re&&_());){var me=y.callback;if(typeof me=="function"){y.callback=null,w=y.priorityLevel;var A=me(y.expirationTime<=re);if(re=t.unstable_now(),typeof A=="function"){y.callback=A,ee(re),ue=!0;break t}y===r(g)&&a(g),ee(re)}else a(g);y=r(g)}if(y!==null)ue=!0;else{var Ee=r(p);Ee!==null&&fe(X,Ee.startTime-re),ue=!1}}break e}finally{y=null,w=ge,x=!1}ue=void 0}}finally{ue?te():O=!1}}}var te;if(typeof B=="function")te=function(){B(G)};else if(typeof MessageChannel<"u"){var Te=new MessageChannel,xe=Te.port2;Te.port1.onmessage=G,te=function(){xe.postMessage(null)}}else te=function(){E(G,0)};function fe(re,ue){Y=E(function(){re(t.unstable_now())},ue)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(re){re.callback=null},t.unstable_forceFrameRate=function(re){0>re||125<re?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<re?Math.floor(1e3/re):5},t.unstable_getCurrentPriorityLevel=function(){return w},t.unstable_next=function(re){switch(w){case 1:case 2:case 3:var ue=3;break;default:ue=w}var ge=w;w=ue;try{return re()}finally{w=ge}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(re,ue){switch(re){case 1:case 2:case 3:case 4:case 5:break;default:re=3}var ge=w;w=re;try{return ue()}finally{w=ge}},t.unstable_scheduleCallback=function(re,ue,ge){var me=t.unstable_now();switch(typeof ge=="object"&&ge!==null?(ge=ge.delay,ge=typeof ge=="number"&&0<ge?me+ge:me):ge=me,re){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=ge+A,re={id:v++,callback:ue,priorityLevel:re,startTime:ge,expirationTime:A,sortIndex:-1},ge>me?(re.sortIndex=ge,i(p,re),r(g)===null&&re===r(p)&&(T?(q(Y),Y=-1):T=!0,fe(X,ge-me))):(re.sortIndex=A,i(g,re),S||x||(S=!0,O||(O=!0,te()))),re},t.unstable_shouldYield=_,t.unstable_wrapCallback=function(re){var ue=w;return function(){var ge=w;w=ue;try{return re.apply(this,arguments)}finally{w=ge}}}})(Ed)),Ed}var $y;function BS(){return $y||($y=1,kd.exports=LS()),kd.exports}var Td={exports:{}},gn={};var Jy;function US(){if(Jy)return gn;Jy=1;var t=wh();function i(v){var y="https://react.dev/errors/"+v;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)y+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+v+"; visit "+y+" 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(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal"),u=Symbol.for("react.recoverable"),c=Symbol.for("react.optimistic_key");function h(v,y,w){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:x===c?c:""+x,children:v,containerInfo:y,implementation:w}}var g=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(v,y){if(v==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,gn.browser=function(v){return{$$typeof:u,_reason:v}},gn.createPortal=function(v,y){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(i(299));return h(v,y,null,w)},gn.flushSync=function(v){var y=g.T,w=a.p;try{if(g.T=null,a.p=2,v)return v()}finally{g.T=y,a.p=w,a.d.f()}},gn.preconnect=function(v,y){typeof v=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,a.d.C(v,y))},gn.prefetchDNS=function(v){typeof v=="string"&&a.d.D(v)},gn.preinit=function(v,y){if(typeof v=="string"&&y&&typeof y.as=="string"){var w=y.as,x=p(w,y.crossOrigin),S=typeof y.integrity=="string"?y.integrity:void 0,T=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;w==="style"?a.d.S(v,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:x,integrity:S,fetchPriority:T}):w==="script"&&a.d.X(v,{crossOrigin:x,integrity:S,fetchPriority:T,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},gn.preinitModule=function(v,y){if(typeof v=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var w=p(y.as,y.crossOrigin);a.d.M(v,{crossOrigin:w,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}}else y==null&&a.d.M(v)},gn.preload=function(v,y){if(typeof v=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var w=y.as,x=p(w,y.crossOrigin);a.d.L(v,w,{crossOrigin:x,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},gn.preloadModule=function(v,y){if(typeof v=="string")if(y){var w=p(y.as,y.crossOrigin);a.d.m(v,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:w,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}else a.d.m(v)},gn.requestFormReset=function(v){a.d.r(v)},gn.unstable_batchedUpdates=function(v,y){return v(y)},gn.useFormState=function(v,y,w){return g.H.useFormState(v,y,w)},gn.useFormStatus=function(){return g.H.useHostTransitionStatus()},gn.version="19.3.1",gn}var Py;function _b(){if(Py)return Td.exports;Py=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(i){console.error(i)}}return t(),Td.exports=US(),Td.exports}var Wy;function HS(){if(Wy)return ps;Wy=1;var t=BS(),i=wh(),r=_b();function a(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){for(var n=e,l=n;l&&!l.alternate;)n=l,(n.flags&4098)!==0&&(e=n.return),l=n.return;for(;n.return;)n=n.return;return n.tag===3?e:null}function c(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function h(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function g(e){if(u(e)!==e)throw Error(a(188))}function p(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(a(188));return n!==e?null:e}for(var l=e,s=n;;){var f=l.return;if(f===null)break;var d=f.alternate;if(d===null){if(s=f.return,s!==null){l=s;continue}break}if(f.child===d.child){for(d=f.child;d;){if(d===l)return g(f),e;if(d===s)return g(f),n;d=d.sibling}throw Error(a(188))}if(l.return!==s.return)l=f,s=d;else{for(var b=!1,k=f.child;k;){if(k===l){b=!0,l=f,s=d;break}if(k===s){b=!0,s=f,l=d;break}k=k.sibling}if(!b){for(k=d.child;k;){if(k===l){b=!0,l=d,s=f;break}if(k===s){b=!0,s=d,l=f;break}k=k.sibling}if(!b)throw Error(a(189))}}if(l.alternate!==s)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?e:n}function v(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=v(e),n!==null)return n;e=e.sibling}return null}function y(e,n,l,s,f,d){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&l(e,s,f,d)||(e.tag!==22||e.memoizedState===null)&&(n||e.tag!==5&&e.tag!==27)&&y(e.child,n,l,s,f,d))return!0;e=e.sibling}return!1}function w(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 n=!1;for(e=e.return;e!==null&&(e.tag===4&&(n=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return n}function S(e){var n=[null,null],l=w(e);return l===null||T(n,e,l.child,{foundSelf:!1}),n}function T(e,n,l,s){for(;l!==null;){if(l===n)s.foundSelf=!0;else if(l.tag===5||l.tag===27||l.tag===6){if(s.foundSelf)return e[1]=l,!0;e[0]=l}else if((l.tag!==22||l.memoizedState===null)&&T(e,n,l.child,s))return!0;l=l.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,q=null;function B(e,n,l){return e===l?!0:e===n?(E=e,!0):!1}function ee(e,n,l){return e===l?(q=e,!1):e===n?(q!==null&&(E=e),!0):!1}function X(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,n,l){for(var s=0,f=e;f;f=l(f))s++;f=0;for(var d=n;d;d=l(d))f++;for(;0<s-f;)e=l(e),s--;for(;0<f-s;)n=l(n),f--;for(;s--;){if(e===n||n!==null&&e===n.alternate)return e;e=l(e),n=l(n)}return null}var Y=Object.assign,K=Symbol.for("react.element"),se=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),te=Symbol.for("react.strict_mode"),Te=Symbol.for("react.profiler"),xe=Symbol.for("react.consumer"),fe=Symbol.for("react.context"),re=Symbol.for("react.forward_ref"),ue=Symbol.for("react.suspense"),ge=Symbol.for("react.suspense_list"),me=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),Ee=Symbol.for("react.activity"),Be=Symbol.for("react.legacy_hidden"),M=Symbol.for("react.memo_cache_sentinel"),z=Symbol.for("react.view_transition"),ne=Symbol.for("react.recoverable"),J=Symbol.iterator;function ae(e){return e===null||typeof e!="object"?null:(e=J&&e[J]||e["@@iterator"],typeof e=="function"?e:null)}var Oe=Symbol.for("react.client.reference");function be(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case G:return"Fragment";case Te:return"Profiler";case te:return"StrictMode";case ue:return"Suspense";case ge:return"SuspenseList";case Ee:return"Activity";case z:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case _:return"Portal";case fe:return e.displayName||"Context";case xe:return(e._context.displayName||"Context")+".Consumer";case re:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case me:return n=e.displayName||null,n!==null?n:be(e.type)||"Memo";case A:n=e._payload,e=e._init;try{return be(e(n))}catch{}}return null}var we=Array.isArray,P=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,We={pending:!1,data:null,method:null,action:null},et=[],Ne=-1;function tt(e){return{current:e}}function $e(e){0>Ne||(e.current=et[Ne],et[Ne]=null,Ne--)}function Ie(e,n){Ne++,et[Ne]=e.current,e.current=n}var Me=tt(null),Qe=tt(null),vt=tt(null),he=tt(null);function Le(e,n){switch(Ie(vt,n),Ie(Qe,e),Ie(Me,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?ey(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=ey(n),e=ty(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$e(Me),Ie(Me,e)}function bt(){$e(Me),$e(Qe),$e(vt)}function bn(e){var n=e.memoizedState;n!==null&&(aa._currentValue=n.memoizedState,Ie(he,e)),n=Me.current;var l=ty(n,e.type);n!==l&&(Ie(Qe,e),Ie(Me,l))}function Lt(e){Qe.current===e&&($e(Me),$e(Qe)),he.current===e&&($e(he),aa._currentValue=We)}var Z,ce;function Se(e){if(Z===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);Z=n&&n[1]||"",ce=-1<l.stack.indexOf(`
3
- at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
4
- `+Z+e+ce}var Ce=!1;function Tt(e,n){if(!e||Ce)return"";Ce=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(ve){var L=ve}Reflect.construct(e,[],le)}else{try{le.call()}catch(ve){L=ve}le=!1;try{var F=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),le=!0,new e}finally{le&&(F!==void 0?Object.defineProperty(e.prototype,"props",F):delete e.prototype.props)}}}else{try{throw Error()}catch(ve){L=ve}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(ve){if(ve&&L&&typeof ve.stack=="string")return[ve.stack,L.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=s.DetermineComponentFrameRoot(),b=d[0],k=d[1];if(b&&k){var R=b.split(`
5
- `),H=k.split(`
6
- `);for(f=s=0;s<R.length&&!R[s].includes("DetermineComponentFrameRoot");)s++;for(;f<H.length&&!H[f].includes("DetermineComponentFrameRoot");)f++;if(s===R.length||f===H.length)for(s=R.length-1,f=H.length-1;1<=s&&0<=f&&R[s]!==H[f];)f--;for(;1<=s&&0<=f;s--,f--)if(R[s]!==H[f]){if(s!==1||f!==1)do if(s--,f--,0>f||R[s]!==H[f]){var Q=`
7
- `+R[s].replace(" at new "," at ");return e.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",e.displayName)),Q}while(1<=s&&0<=f);break}}}finally{Ce=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Se(l):""}function je(e,n){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se("Lazy");case 13:return e.child!==n&&n!==null?Se("Suspense Fallback"):Se("Suspense");case 19:return Se("SuspenseList");case 0:case 15:return Tt(e.type,!1);case 11:return Tt(e.type.render,!1);case 1:return Tt(e.type,!0);case 31:return Se("Activity");case 30:return Se("ViewTransition");default:return""}}function Ge(e){try{var n="",l=null;do n+=je(e,l),l=e,e=e.return;while(e);return n}catch(s){return`
8
- Error generating stack: `+s.message+`
9
- `+s.stack}}var Rt=Object.prototype.hasOwnProperty,Gt=t.unstable_scheduleCallback,on=t.unstable_cancelCallback,Sn=t.unstable_shouldYield,Ri=t.unstable_requestPaint,qt=t.unstable_now,Xe=t.unstable_getCurrentPriorityLevel,Wt=t.unstable_ImmediatePriority,un=t.unstable_UserBlockingPriority,Fn=t.unstable_NormalPriority,_i=t.unstable_LowPriority,$=t.unstable_IdlePriority,oe=t.log,mt=t.unstable_setDisableYieldValue,_t=null,ft=null;function Yt(e){if(typeof oe=="function"&&mt(e),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(_t,e)}catch{}}var Ut=Math.clz32?Math.clz32:ec,_l=Math.log,zl=Math.LN2;function ec(e){return e>>>=0,e===0?32:31-(_l(e)/zl|0)|0}var vr=256,zi=262144,br=4194304;function Gn(e){var n=e&42;if(n!==0)return n;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 Ml(e,n,l){var s=e.pendingLanes;if(s===0)return 0;var f=0,d=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var k=s&134217727;return k!==0?(s=k&~d,s!==0?f=Gn(s):(b&=k,b!==0?f=Gn(b):l||(l=k&~e,l!==0&&(f=Gn(l))))):(k=s&~d,k!==0?f=Gn(k):b!==0?f=Gn(b):l||(l=s&~e,l!==0&&(f=Gn(l)))),f===0?0:n!==0&&n!==f&&(n&d)===0&&(d=f&-f,l=n&-n,d>=l||d===32&&(l&4194048)!==0)?n:f}function ql(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Dl(e,n){(n&8)!==0&&(n|=n&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=n;0<l;){var s=31-Ut(l),f=1<<s;n|=e[s],l&=~f}return n}function tc(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ga(){var e=br;return br<<=1,(br&62914560)===0&&(br=4194304),e}function Ll(e){for(var n=[],l=0;31>l;l++)n.push(e);return n}function $i(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ys(e,n,l,s,f,d){var b=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var k=e.entanglements,R=e.expirationTimes,H=e.hiddenUpdates;for(l=b&~l;0<l;){var Q=31-Ut(l),le=1<<Q;k[Q]=0,R[Q]=-1;var L=H[Q];if(L!==null)for(H[Q]=null,Q=0;Q<L.length;Q++){var F=L[Q];F!==null&&(F.lane&=-536870913)}l&=~le}s!==0&&xr(e,s,0),d!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=d&~(b&~n))}function xr(e,n,l){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Ut(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|l&261930}function ya(e,n){var l=e.entangledLanes|=n;for(e=e.entanglements;l;){var s=31-Ut(l),f=1<<s;f&n|e[s]&n&&(e[s]|=n),l&=~f}}function wr(e,n){var l=n&-n;return l=(l&42)!==0?1:Bl(l),(l&(e.suspendedLanes|n))!==0?0:l}function Bl(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 Sr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ul(){var e=ye.p;return e!==0?e:(e=window.event,e===void 0?32:By(e.type))}function Hl(e,n){var l=ye.p;try{return ye.p=e,n()}finally{ye.p=l}}var Mn=Math.random().toString(36).slice(2),Qt="__reactFiber$"+Mn,en="__reactProps$"+Mn,hi="__reactContainer$"+Mn,mi="__reactEvents$"+Mn,va="__reactListeners$"+Mn,nc="__reactHandles$"+Mn,pi="__reactResources$"+Mn,Il="__reactMarker$"+Mn,Ji="__reactLoad$"+Mn;function Mi(e){delete e[Qt],delete e[en],delete e[va],delete e[nc]}function qi(e){var n;if(n=e[Qt])return n;for(var l=e.parentNode;l;){if(n=l[hi]||l[Qt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(e=vy(e);e!==null;){if(l=e[Qt])return l;e=vy(e)}return n}e=l,l=e.parentNode}return null}function Pi(e){if(e=e[Qt]||e[hi]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Vl(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function qn(e){var n=e[pi];return n||(n=e[pi]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Xt(e){e[Il]=!0}function ba(e){e[Ji]=void 0}var xa=new Set,Wi={};function Ht(e,n){gi(e,n),gi(e+"Capture",n)}function gi(e,n){for(Wi[e]=n,e=0;e<n.length;e++)xa.add(n[e])}var Fs=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]*$"),wa={},Sa={};function Jh(e){return Rt.call(Sa,e)?!0:Rt.call(wa,e)?!1:Fs.test(e)?Sa[e]=!0:(wa[e]=!0,!1)}var st=!1;function ti(){var e=st;return st=!1,e}function el(e,n,l){if(Jh(n))if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,l)}}function kr(e,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,l)}}function ln(e,n,l,s){if(s===null)e.removeAttribute(l);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(n,l,s)}}function cn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ni(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Gs(e,n,l){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var f=s.get,d=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(b){l=""+b,d.call(this,b)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Yl(e){if(!e._valueTracker){var n=ni(e)?"checked":"value";e._valueTracker=Gs(e,n,""+e[n])}}function Er(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),s="";return e&&(s=ni(e)?e.checked?"true":"false":e.value),e=s,e!==l?(n.setValue(e),!0):!1}var ka=/[\n"\\]/g;function kn(e){return e.replace(ka,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Ea(e,n,l,s,f,d,b,k){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),n!=null?b==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+cn(n)):e.value!==""+cn(n)&&(e.value=""+cn(n)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),n!=null?b==="number"&&e.value==n?ja(e,cn(e.value)):ja(e,cn(n)):l!=null?ja(e,cn(l)):s!=null&&e.removeAttribute("value"),f==null&&d!=null&&(e.defaultChecked=!!d),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.name=""+cn(k):e.removeAttribute("name")}function Ta(e,n,l,s,f,d,b,k){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),n!=null||l!=null){if(!(d!=="submit"&&d!=="reset"||n!=null)){Yl(e);return}l=l!=null?""+cn(l):"",n=n!=null?""+cn(n):l,k||n===e.value||(e.value=n),e.defaultValue=n}s=s??f,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=k?e.checked:!!s,e.defaultChecked=!!s,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),Yl(e)}function ja(e,n){e.defaultValue!==""+n&&(e.defaultValue=""+n)}function tl(e,n,l,s){if(e=e.options,n){n={};for(var f=0;f<l.length;f++)n["$"+l[f]]=!0;for(l=0;l<e.length;l++)f=n.hasOwnProperty("$"+e[l].value),e[l].selected!==f&&(e[l].selected=f),f&&s&&(e[l].defaultSelected=!0)}else{for(l=""+cn(l),n=null,f=0;f<e.length;f++){if(e[f].value===l){e[f].selected=!0,s&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function Qs(e,n,l){if(n!=null&&(n=""+cn(n),n!==e.value&&(e.value=n),l==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=l!=null?""+cn(l):""}function Xs(e,n,l,s){if(n==null){if(s!=null){if(l!=null)throw Error(a(92));if(we(s)){if(1<s.length)throw Error(a(93));s=s[0]}l=s}l==null&&(l=""),n=l}l=cn(n),e.defaultValue=l,s=e.textContent,s===l&&s!==""&&s!==null&&(e.value=s),Yl(e)}function nl(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var Zs=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 Ca(e,n,l){var s=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,l):typeof l!="number"||l===0||Zs.has(n)?n==="float"?e.cssFloat=l:e[n]=(""+l).trim():e[n]=l+"px"}function Ks(e,n,l){if(n!=null&&typeof n!="object")throw Error(a(62));if(e=e.style,l!=null){for(var s in l)!l.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="",st=!0);for(var f in n)s=n[f],n.hasOwnProperty(f)&&l[f]!==s&&(Ca(e,f,s),st=!0)}else for(var d in n)n.hasOwnProperty(d)&&Ca(e,d,n[d])}function Tr(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 $s=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"]]),ic=/^[\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 jr(e){return ic.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function xn(){}var Js=null;function Cr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var il=null,Di=null;function N(e){var n=Pi(e);if(n&&(e=n.stateNode)){var l=e[en]||null;e:switch(e=n.stateNode,n.type){case"input":if(Ea(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+kn(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var s=l[n];if(s!==e&&s.form===e.form){var f=s[en]||null;if(!f)throw Error(a(90));Ea(s,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<l.length;n++)s=l[n],s.form===e.form&&Er(s)}break e;case"textarea":Qs(e,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&tl(e,!!l.multiple,n,!1)}}}var I=!1;function W(e,n,l){if(I)return e(n,l);I=!0;try{var s=e(n);return s}finally{if(I=!1,(il!==null||Di!==null)&&(Ko(),il&&(n=il,e=Di,Di=il=null,N(n),e)))for(n=0;n<e.length;n++)N(e[n])}}function pe(e,n){var l=e.stateNode;if(l===null)return null;var s=l[en]||null;if(s===null)return null;l=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(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(l&&typeof l!="function")throw Error(a(231,n,typeof l));return l}var _e=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Re=!1;if(_e)try{var Ze={};Object.defineProperty(Ze,"passive",{get:function(){Re=!0}}),window.addEventListener("test",Ze,Ze),window.removeEventListener("test",Ze,Ze)}catch{Re=!1}var dt=null,ht=null,lt=null;function wt(){if(lt)return lt;var e,n=ht,l=n.length,s,f="value"in dt?dt.value:dt.textContent,d=f.length;for(e=0;e<l&&n[e]===f[e];e++);var b=l-e;for(s=1;s<=b&&n[l-s]===f[d-s];s++);return lt=f.slice(e,1<s?1-s:void 0)}function gt(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function jt(){return!0}function ii(){return!1}function tn(e){function n(l,s,f,d,b){this._reactName=l,this._targetInst=f,this.type=s,this.nativeEvent=d,this.target=b,this.currentTarget=null;for(var k in e)e.hasOwnProperty(k)&&(l=e[k],this[k]=l?l(d):d[k]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?jt:ii,this.isPropagationStopped=ii,this}return Y(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=jt)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=jt)},persist:function(){},isPersistent:jt}),n}var ll={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ps=tn(ll),Na=Y({},ll,{view:0,detail:0}),r1=tn(Na),lc,rc,Aa,Ws=Y({},Na,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sc,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!==Aa&&(Aa&&e.type==="mousemove"?(lc=e.screenX-Aa.screenX,rc=e.screenY-Aa.screenY):rc=lc=0,Aa=e),lc)},movementY:function(e){return"movementY"in e?e.movementY:rc}}),Ph=tn(Ws),a1=Y({},Ws,{dataTransfer:0}),s1=tn(a1),o1=Y({},Na,{relatedTarget:0}),ac=tn(o1),u1=Y({},ll,{animationName:0,elapsedTime:0,pseudoElement:0}),c1=tn(u1),f1=Y({},ll,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),d1=tn(f1),h1=Y({},ll,{data:0}),Wh=tn(h1),m1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},p1={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"},g1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function y1(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=g1[e])?!!n[e]:!1}function sc(){return y1}var v1=Y({},Na,{key:function(e){if(e.key){var n=m1[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=gt(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?p1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sc,charCode:function(e){return e.type==="keypress"?gt(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?gt(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),b1=tn(v1),x1=Y({},Ws,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),em=tn(x1),w1=Y({},ll,{submitter:0}),S1=tn(w1),k1=Y({},Na,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sc}),E1=tn(k1),T1=Y({},ll,{propertyName:0,elapsedTime:0,pseudoElement:0}),j1=tn(T1),C1=Y({},Ws,{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}),N1=tn(C1),A1=Y({},ll,{newState:0,oldState:0,source:0}),O1=tn(A1),R1=[9,13,27,32],oc=_e&&"CompositionEvent"in window,Oa=null;_e&&"documentMode"in document&&(Oa=document.documentMode);var _1=_e&&"TextEvent"in window&&!Oa,tm=_e&&(!oc||Oa&&8<Oa&&11>=Oa),nm=" ",im=!1;function lm(e,n){switch(e){case"keyup":return R1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nr=!1;function z1(e,n){switch(e){case"compositionend":return rm(n);case"keypress":return n.which!==32?null:(im=!0,nm);case"textInput":return e=n.data,e===nm&&im?null:e;default:return null}}function M1(e,n){if(Nr)return e==="compositionend"||!oc&&lm(e,n)?(e=wt(),lt=ht=dt=null,Nr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return tm&&n.locale!=="ko"?null:n.data;default:return null}}var q1={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 am(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!q1[e.type]:n==="textarea"}function sm(e,n,l,s){il?Di?Di.push(s):Di=[s]:il=s,n=tu(n,"onChange"),0<n.length&&(l=new Ps("onChange","change",null,l,s),e.push({event:l,listeners:n}))}var Ra=null,_a=null;function D1(e){Zg(e,0)}function eo(e){var n=Vl(e);if(Er(n))return e}function om(e,n){if(e==="change")return n}var um=!1;if(_e){var uc;if(_e){var cc="oninput"in document;if(!cc){var cm=document.createElement("div");cm.setAttribute("oninput","return;"),cc=typeof cm.oninput=="function"}uc=cc}else uc=!1;um=uc&&(!document.documentMode||9<document.documentMode)}function fm(){Ra&&(Ra.detachEvent("onpropertychange",dm),_a=Ra=null)}function dm(e){if(e.propertyName==="value"&&eo(_a)){var n=[];sm(n,_a,e,Cr(e)),W(D1,n)}}function L1(e,n,l){e==="focusin"?(fm(),Ra=n,_a=l,Ra.attachEvent("onpropertychange",dm)):e==="focusout"&&fm()}function B1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return eo(_a)}function U1(e,n){if(e==="click")return eo(n)}function H1(e,n){if(e==="input"||e==="change")return eo(n)}function I1(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Dn=typeof Object.is=="function"?Object.is:I1;function za(e,n){if(Dn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var l=Object.keys(e),s=Object.keys(n);if(l.length!==s.length)return!1;for(s=0;s<l.length;s++){var f=l[s];if(!Rt.call(n,f)||!Dn(e[f],n[f]))return!1}return!0}function fc(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 hm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mm(e,n){var l=hm(e);e=0;for(var s;l;){if(l.nodeType===3){if(s=e+l.textContent.length,e<=n&&s>=n)return{node:l,offset:n-e};e=s}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=hm(l)}}function pm(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?pm(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function gm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=fc(e.document);n instanceof e.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)e=n.contentWindow;else break;n=fc(e.document)}return n}function dc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var V1=_e&&"documentMode"in document&&11>=document.documentMode,Ar=null,hc=null,Ma=null,mc=!1;function ym(e,n,l){var s=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;mc||Ar==null||Ar!==fc(s)||(s=Ar,"selectionStart"in s&&dc(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}),Ma&&za(Ma,s)||(Ma=s,s=tu(hc,"onSelect"),0<s.length&&(n=new Ps("onSelect","select",null,n,l),e.push({event:n,listeners:s}),n.target=Ar)))}function Fl(e,n){var l={};return l[e.toLowerCase()]=n.toLowerCase(),l["Webkit"+e]="webkit"+n,l["Moz"+e]="moz"+n,l}var Or={animationend:Fl("Animation","AnimationEnd"),animationiteration:Fl("Animation","AnimationIteration"),animationstart:Fl("Animation","AnimationStart"),transitionrun:Fl("Transition","TransitionRun"),transitionstart:Fl("Transition","TransitionStart"),transitioncancel:Fl("Transition","TransitionCancel"),transitionend:Fl("Transition","TransitionEnd")},pc={},vm={};_e&&(vm=document.createElement("div").style,"AnimationEvent"in window||(delete Or.animationend.animation,delete Or.animationiteration.animation,delete Or.animationstart.animation),"TransitionEvent"in window||delete Or.transitionend.transition);function Gl(e){if(pc[e])return pc[e];if(!Or[e])return e;var n=Or[e],l;for(l in n)if(n.hasOwnProperty(l)&&l in vm)return pc[e]=n[l];return e}var bm=Gl("animationend"),xm=Gl("animationiteration"),wm=Gl("animationstart"),Y1=Gl("transitionrun"),F1=Gl("transitionstart"),G1=Gl("transitioncancel"),Sm=Gl("transitionend"),km=new Map,gc="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(" ");gc.push("scrollEnd");function li(e,n){km.set(e,n),Ht(n,[e])}var Q1=0;function Li(e,n){if(e.name!=null&&e.name!=="auto")return e.name;if(n.autoName!==null)return n.autoName;e=oi.identifierPrefix;var l=Q1++;return e="_"+e+"t_"+l.toString(32)+"_",n.autoName=e}function Em(e){if(e==null||typeof e=="string")return e;var n=null,l=$r;if(l!==null)for(var s=0;s<l.length;s++){var f=e[l[s]];if(f!=null){if(f==="none")return"none";n=n==null?f:n+(" "+f)}}return n??e.default}function Bi(e,n){return e=Em(e),n=Em(n),n==null?e==="auto"?null:e:n==="auto"?null:n}var to=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Qn=[],Rr=0,yc=0;function no(){for(var e=Rr,n=yc=Rr=0;n<e;){var l=Qn[n];Qn[n++]=null;var s=Qn[n];Qn[n++]=null;var f=Qn[n];Qn[n++]=null;var d=Qn[n];if(Qn[n++]=null,s!==null&&f!==null){var b=s.pending;b===null?f.next=f:(f.next=b.next,b.next=f),s.pending=f}d!==0&&Tm(l,f,d)}}function io(e,n,l,s){Qn[Rr++]=e,Qn[Rr++]=n,Qn[Rr++]=l,Qn[Rr++]=s,yc|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function vc(e,n,l,s){return io(e,n,l,s),lo(e)}function Ql(e,n){return io(e,null,null,n),lo(e)}function Tm(e,n,l){e.lanes|=l;var s=e.alternate;s!==null&&(s.lanes|=l);for(var f=!1,d=e.return;d!==null;)d.childLanes|=l,s=d.alternate,s!==null&&(s.childLanes|=l),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(f=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,f&&n!==null&&(f=31-Ut(l),e=d.hiddenUpdates,s=e[f],s===null?e[f]=[n]:s.push(n),n.lane=l|536870912),d):null}function lo(e){if(50<ns)throw ns=0,Zo=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var _r={};function X1(e,n,l,s){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Cn(e,n,l,s){return new X1(e,n,l,s)}function bc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ui(e,n){var l=e.alternate;return l===null?(l=Cn(e.tag,n,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=n,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&1206910976,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,n=e.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function jm(e,n){e.flags&=1206910978;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,n=l.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function ro(e,n,l,s,f,d){var b=0;if(s=e,typeof s=="function")bc(s)&&(b=1);else if(typeof s=="string")b=wS(e,l,Me.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(s){case Ee:return e=Cn(31,l,n,f),e.elementType=Ee,e.lanes=d,e;case G:return Xl(l.children,f,d,n);case te:b=8,f|=24;break;case Te:return e=Cn(12,l,n,f|2),e.elementType=Te,e.lanes=d,e;case ue:return e=Cn(13,l,n,f),e.elementType=ue,e.lanes=d,e;case ge:return e=Cn(19,l,n,f),e.elementType=ge,e.lanes=d,e;case Be:case z:return e=f|32,e=Cn(30,l,n,e),e.elementType=z,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 fe:b=10;break e;case xe:b=9;break e;case re:b=11;break e;case me:b=14;break e;case A:b=16,s=null;break e}b=29,l=Error(a(130,e===null?"null":typeof e,"")),s=null}return n=Cn(b,l,n,f),n.elementType=e,n.type=s,n.lanes=d,n}function Xl(e,n,l,s){return e=Cn(7,e,s,n),e.lanes=l,e}function xc(e,n,l){return e=Cn(6,e,null,n),e.lanes=l,e}function Cm(e){var n=Cn(18,null,null,0);return n.stateNode=e,n}function wc(e,n,l){return n=Cn(4,e.children!==null?e.children:[],e.key,n),n.lanes=l,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Nm=new WeakMap;function Xn(e,n){if(typeof e=="object"&&e!==null){var l=Nm.get(e);return l!==void 0?l:(n={value:e,source:n,stack:Ge(n)},Nm.set(e,n),n)}return{value:e,source:n,stack:Ge(n)}}var zr=[],Mr=0,ao=null,qa=0,Zn=[],Kn=0,rl=null,yi=1,vi="";function Hi(e,n){zr[Mr++]=qa,zr[Mr++]=ao,ao=e,qa=n}function Am(e,n,l){Zn[Kn++]=yi,Zn[Kn++]=vi,Zn[Kn++]=rl,rl=e;var s=yi;e=vi;var f=32-Ut(s)-1;s&=~(1<<f),l+=1;var d=32-Ut(n)+f;if(30<d){var b=f-f%5;d=(s&(1<<b)-1).toString(32),s>>=b,f-=b,yi=1<<32-Ut(n)+f|l<<f|s,vi=d+e}else yi=1<<d|l<<f|s,vi=e}function so(e){e.return!==null&&(Hi(e,1),Am(e,1,0))}function Sc(e){for(;e===ao;)ao=zr[--Mr],zr[Mr]=null,qa=zr[--Mr],zr[Mr]=null;for(;e===rl;)rl=Zn[--Kn],Zn[Kn]=null,vi=Zn[--Kn],Zn[Kn]=null,yi=Zn[--Kn],Zn[Kn]=null}function Om(e,n){Zn[Kn++]=yi,Zn[Kn++]=vi,Zn[Kn++]=rl,yi=n.id,vi=n.overflow,rl=e}var rn=null,zt=null,Je=!1,al=null,$n=!1,kc=Error(a(519));function sl(e){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Da(Xn(n,e)),kc}function Rm(e){var n=e.stateNode,l=e.type,s=e.memoizedProps;switch(n[Qt]=e,n[en]=s,l){case"dialog":it("cancel",n),it("close",n);break;case"iframe":case"object":case"embed":it("load",n);break;case"video":case"audio":for(l=0;l<ls.length;l++)it(ls[l],n);break;case"source":it("error",n);break;case"img":case"image":case"link":it("error",n),it("load",n);break;case"details":it("toggle",n);break;case"input":it("invalid",n),Ta(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":it("invalid",n);break;case"textarea":it("invalid",n),Xs(n,s.value,s.defaultValue,s.children)}l=s.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||s.suppressHydrationWarning===!0||Pg(n.textContent,l)?(s.popover!=null&&(it("beforetoggle",n),it("toggle",n)),s.onScroll!=null&&it("scroll",n),s.onScrollEnd!=null&&it("scrollend",n),s.onClick!=null&&(n.onclick=xn),n=!0):n=!1,n||sl(e,!0)}function oo(e){for(rn=e.return;rn;)switch(rn.tag){case 5:case 31:case 13:$n=!1;return;case 27:case 3:$n=!0;return;default:rn=rn.return}}function qr(e){if(e!==rn)return!1;if(!Je)return oo(e),Je=!0,!1;var n=e.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||ed(e.type,e.memoizedProps)),l=!l),l&&zt&&sl(e),oo(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));zt=yy(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));zt=yy(e)}else n===27?(n=zt,kl(e.type)?(e=ud,ud=null,zt=e):zt=n):zt=rn?Pn(e.stateNode.nextSibling):null;return!0}function Zl(){zt=rn=null,Je=!1}function Ec(){var e=al;return e!==null&&(On===null?On=e:On.push.apply(On,e),al=null),e}function Da(e){al===null?al=[e]:al.push(e)}var Tc=tt(null),Kl=null,Ii=null;function ol(e,n,l){Ie(Tc,n._currentValue),n._currentValue=l}function Vi(e){e._currentValue=Tc.current,$e(Tc)}function uo(e,n,l){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===l)break;e=e.return}}function jc(e,n,l,s){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var d=f.dependencies;if(d!==null){var b=f.child;d=d.firstContext;e:for(;d!==null;){var k=d;d=f;for(var R=0;R<n.length;R++)if(k.context===n[R]){d.lanes|=l,k=d.alternate,k!==null&&(k.lanes|=l),uo(d.return,l,e),s||(b=null);break e}d=k.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(a(341));b.lanes|=l,d=b.alternate,d!==null&&(d.lanes|=l),uo(b,l,e),b=null}else f.tag===13&&f.memoizedState!==null&&f.memoizedState.dehydrated===null?(f.lanes|=l,b=f.alternate,b!==null&&(b.lanes|=l),uo(f.return,l,e),b=f.child,b=b!==null?b.sibling:null):b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===e){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function $l(e,n,l,s){e=null;for(var f=n,d=!1;f!==null;){if(!d){if((f.flags&524288)!==0)d=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var b=f.alternate;if(b===null)throw Error(a(387));if(b=b.memoizedProps,b!==null){var k=f.type;Dn(f.pendingProps.value,b.value)||(e!==null?e.push(k):e=[k])}}else if(f===he.current){if(b=f.alternate,b===null)throw Error(a(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(aa):e=[aa])}f=f.return}return e!==null&&jc(n,e,l,s),n.flags|=262144,e!==null}function co(e){for(e=e.firstContext;e!==null;){if(!Dn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Jl(e){Kl=e,Ii=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function fn(e){return _m(Kl,e)}function fo(e,n){return Kl===null&&Jl(e),_m(e,n)}function _m(e,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Ii===null){if(e===null)throw Error(a(308));Ii=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Ii=Ii.next=n;return l}var Z1=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(l,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(l){return l()})}},K1=t.unstable_scheduleCallback,$1=t.unstable_NormalPriority,Zt={$$typeof:fe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Cc(){return{controller:new Z1,data:new Map,refCount:0}}function La(e){e.refCount--,e.refCount===0&&K1($1,function(){e.controller.abort()})}function zm(e,n){if((e.pendingLanes&4194048)!==0){var l=e.transitionTypes;for(l===null&&(l=e.transitionTypes=[]),e=0;e<n.length;e++){var s=n[e];l.indexOf(s)===-1&&l.push(s)}}}var Ba=null;function J1(e){var n=e.transitionTypes;return e.transitionTypes=null,n}var Ua=null,Nc=0,Pl=0,Dr=null;function P1(e,n){if(Ua===null){var l=Ua=[];Nc=0,Pl=Gf(),Dr={status:"pending",value:void 0,then:function(s){l.push(s)}}}return Nc++,n.then(Mm,Mm),n}function Mm(){if(--Nc===0&&(Ba=null,Ua!==null)){Dr!==null&&(Dr.status="fulfilled");var e=Ua;Ua=null,Pl=0,Dr=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function W1(e,n){var l=[],s={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var f=0;f<l.length;f++)(0,l[f])(n)},function(f){for(s.status="rejected",s.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),s}var qm=P.S;P.S=function(e,n){if(Cg=qt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&P1(e,n),Ba!==null)for(var l=ea;l!==null;)zm(l,Ba),l=l.next;if(l=e.types,l!==null){for(var s=ea;s!==null;)zm(s,l),s=s.next;if(Pl!==0){s=Ba,s===null&&(s=Ba=[]);for(var f=0;f<l.length;f++){var d=l[f];s.indexOf(d)===-1&&s.push(d)}}}qm!==null&&qm(e,n)};var Wl=tt(null);function Ac(){var e=Wl.current;return e!==null?e:Nt.pooledCache}function ho(e,n){n===null?Ie(Wl,Wl.current):Ie(Wl,n.pool)}function Dm(){var e=Ac();return e===null?null:{parent:Zt._currentValue,pool:e}}var Lr=Error(a(460)),Oc=Error(a(474)),mo=Error(a(542)),po={then:function(){}};function Lm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Bm(e,n,l){switch(l=e[l],l===void 0?e.push(n):l!==n&&(n.then(xn,xn),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Hm(e),e===void 0&&!("reason"in n)?Error(a(600)):e;default:if(typeof n.status=="string")n.then(xn,xn);else{if(e=Nt,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=s}},function(s){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Hm(e),e}throw tr=n,Lr}}function er(e){try{var n=e._init;return n(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(tr=l,Lr):l}}var tr=null;function Um(){if(tr===null)throw Error(a(459));var e=tr;return tr=null,e}function Hm(e){if(e===Lr||e===mo)throw Error(a(483))}var Br=null,Ha=0;function go(e){var n=Ha;return Ha+=1,Br===null&&(Br=[]),Bm(Br,e,n)}function ul(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function yo(e,n){throw n.$$typeof===K?Error(a(525)):(e=Object.prototype.toString.call(n),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Im(e){function n(U,D){if(e){var V=U.deletions;V===null?(U.deletions=[D],U.flags|=16):V.push(D)}}function l(U,D){if(!e)return null;for(;D!==null;)n(U,D),D=D.sibling;return null}function s(U){for(var D=new Map;U!==null;)U.key===null?D.set(U.index,U):D.set(U.key,U),U=U.sibling;return D}function f(U,D){return U=Ui(U,D),U.index=0,U.sibling=null,U}function d(U,D,V){return U.index=V,e?(V=U.alternate,V!==null?(V=V.index,V<D?(U.flags|=2,D):V):(U.flags|=134217730,D)):(U.flags|=1048576,D)}function b(U){return e&&U.alternate===null&&(U.flags|=134217730),U}function k(U,D,V,ie){return D===null||D.tag!==6?(D=xc(V,U.mode,ie),D.return=U,D):(D=f(D,V),D.return=U,D)}function R(U,D,V,ie){var ke=V.type;return ke===G?(U=Q(U,D,V.props.children,ie,V.key),ul(U,V),U):D!==null&&(D.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===A&&er(ke)===D.type)?(D=f(D,V.props),ul(D,V),D.return=U,D):(D=ro(V.type,V.key,V.props,null,U.mode,ie),ul(D,V),D.return=U,D)}function H(U,D,V,ie){return D===null||D.tag!==4||D.stateNode.containerInfo!==V.containerInfo||D.stateNode.implementation!==V.implementation?(D=wc(V,U.mode,ie),D.return=U,D):(D=f(D,V.children||[]),D.return=U,D)}function Q(U,D,V,ie,ke){return D===null||D.tag!==7?(D=Xl(V,U.mode,ie,ke),D.return=U,D):(D=f(D,V),D.return=U,D)}function le(U,D,V){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=xc(""+D,U.mode,V),D.return=U,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case se:return V=ro(D.type,D.key,D.props,null,U.mode,V),ul(V,D),V.return=U,V;case _:return D=wc(D,U.mode,V),D.return=U,D;case A:return D=er(D),le(U,D,V)}if(we(D)||ae(D))return D=Xl(D,U.mode,V,null),D.return=U,D;if(typeof D.then=="function")return le(U,go(D),V);if(D.$$typeof===fe)return le(U,fo(U,D),V);yo(U,D)}return null}function L(U,D,V,ie){var ke=D!==null?D.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return ke!==null?null:k(U,D,""+V,ie);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case se:return V.key===ke?R(U,D,V,ie):null;case _:return V.key===ke?H(U,D,V,ie):null;case A:return V=er(V),L(U,D,V,ie)}if(we(V)||ae(V))return ke!==null?null:Q(U,D,V,ie,null);if(typeof V.then=="function")return L(U,D,go(V),ie);if(V.$$typeof===fe)return L(U,D,fo(U,V),ie);yo(U,V)}return null}function F(U,D,V,ie,ke){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return U=U.get(V)||null,k(D,U,""+ie,ke);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case se:return U=U.get(ie.key===null?V:ie.key)||null,R(D,U,ie,ke);case _:return U=U.get(ie.key===null?V:ie.key)||null,H(D,U,ie,ke);case A:return ie=er(ie),F(U,D,V,ie,ke)}if(we(ie)||ae(ie))return U=U.get(V)||null,Q(D,U,ie,ke,null);if(typeof ie.then=="function")return F(U,D,V,go(ie),ke);if(ie.$$typeof===fe)return F(U,D,V,fo(D,ie),ke);yo(D,ie)}return null}function ve(U,D,V,ie){for(var ke=null,at=null,ze=D,De=D=0,Jt=null;ze!==null&&De<V.length;De++){ze.index>De?(Jt=ze,ze=null):Jt=ze.sibling;var ct=L(U,ze,V[De],ie);if(ct===null){ze===null&&(ze=Jt);break}e&&ze&&ct.alternate===null&&n(U,ze),D=d(ct,D,De),at===null?ke=ct:at.sibling=ct,at=ct,ze=Jt}if(De===V.length)return l(U,ze),Je&&Hi(U,De),ke;if(ze===null){for(;De<V.length;De++)ze=le(U,V[De],ie),ze!==null&&(D=d(ze,D,De),at===null?ke=ze:at.sibling=ze,at=ze);return Je&&Hi(U,De),ke}for(ze=s(ze);De<V.length;De++)Jt=F(ze,U,De,V[De],ie),Jt!==null&&(e&&(ct=Jt.alternate,ct!==null&&ze.delete(ct.key===null?De:ct.key)),D=d(Jt,D,De),at===null?ke=Jt:at.sibling=Jt,at=Jt);return e&&ze.forEach(function(Nl){return n(U,Nl)}),Je&&Hi(U,De),ke}function Ae(U,D,V,ie){if(V==null)throw Error(a(151));for(var ke=null,at=null,ze=D,De=D=0,Jt=null,ct=V.next();ze!==null&&!ct.done;De++,ct=V.next()){ze.index>De?(Jt=ze,ze=null):Jt=ze.sibling;var Nl=L(U,ze,ct.value,ie);if(Nl===null){ze===null&&(ze=Jt);break}e&&ze&&Nl.alternate===null&&n(U,ze),D=d(Nl,D,De),at===null?ke=Nl:at.sibling=Nl,at=Nl,ze=Jt}if(ct.done)return l(U,ze),Je&&Hi(U,De),ke;if(ze===null){for(;!ct.done;De++,ct=V.next())ct=le(U,ct.value,ie),ct!==null&&(D=d(ct,D,De),at===null?ke=ct:at.sibling=ct,at=ct);return Je&&Hi(U,De),ke}for(ze=s(ze);!ct.done;De++,ct=V.next())ct=F(ze,U,De,ct.value,ie),ct!==null&&(e&&(Jt=ct.alternate,Jt!==null&&ze.delete(Jt.key===null?De:Jt.key)),D=d(ct,D,De),at===null?ke=ct:at.sibling=ct,at=ct);return e&&ze.forEach(function(zS){return n(U,zS)}),Je&&Hi(U,De),ke}function Ye(U,D,V,ie){if(typeof V=="object"&&V!==null&&V.type===G&&V.key===null&&V.props.ref===void 0&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case se:e:{for(var ke=V.key;D!==null;){if(D.key===ke){if(ke=V.type,ke===G){if(D.tag===7){l(U,D.sibling),ie=f(D,V.props.children),ul(ie,V),ie.return=U,U=ie;break e}}else if(D.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===A&&er(ke)===D.type){l(U,D.sibling),ie=f(D,V.props),ul(ie,V),ie.return=U,U=ie;break e}l(U,D);break}else n(U,D);D=D.sibling}V.type===G?(ie=Xl(V.props.children,U.mode,ie,V.key),ul(ie,V),ie.return=U,U=ie):(ie=ro(V.type,V.key,V.props,null,U.mode,ie),ul(ie,V),ie.return=U,U=ie)}return b(U);case _:e:{for(ke=V.key;D!==null;){if(D.key===ke)if(D.tag===4&&D.stateNode.containerInfo===V.containerInfo&&D.stateNode.implementation===V.implementation){l(U,D.sibling),ie=f(D,V.children||[]),ie.return=U,U=ie;break e}else{l(U,D);break}else n(U,D);D=D.sibling}ie=wc(V,U.mode,ie),ie.return=U,U=ie}return b(U);case A:return V=er(V),Ye(U,D,V,ie)}if(we(V))return ve(U,D,V,ie);if(ae(V)){if(ke=ae(V),typeof ke!="function")throw Error(a(150));return V=ke.call(V),Ae(U,D,V,ie)}if(typeof V.then=="function")return Ye(U,D,go(V),ie);if(V.$$typeof===fe)return Ye(U,D,fo(U,V),ie);yo(U,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,D!==null&&D.tag===6?(l(U,D.sibling),ie=f(D,V),ie.return=U,U=ie):(l(U,D),ie=xc(V,U.mode,ie),ie.return=U,U=ie),b(U)):l(U,D)}return function(U,D,V,ie){try{Ha=0;var ke=Ye(U,D,V,ie);return Br=null,ke}catch(ze){if(ze===Lr||ze===mo)throw ze;var at=Cn(29,ze,null,U.mode);return at.lanes=ie,at.return=U,at}}}var nr=Im(!0),Vm=Im(!1),cl=!1;function Rc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _c(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function fl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function dl(e,n,l){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(yt&2)!==0){var f=s.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),s.pending=n,n=lo(e),Tm(e,null,l),n}return io(e,s,n,l),lo(e)}function Ia(e,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,l|=s,n.lanes=l,ya(e,l)}}function zc(e,n){var l=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,l===s)){var f=null,d=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};d===null?f=d=b:d=d.next=b,l=l.next}while(l!==null);d===null?f=d=n:d=d.next=n}else f=d=n;l={baseState:s.baseState,firstBaseUpdate:f,lastBaseUpdate:d,shared:s.shared,callbacks:s.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=n:e.next=n,l.lastBaseUpdate=n}var Mc=!1;function Va(){if(Mc){var e=Dr;if(e!==null)throw e}}function Ya(e,n,l,s){Mc=!1;var f=e.updateQueue;cl=!1;var d=f.firstBaseUpdate,b=f.lastBaseUpdate,k=f.shared.pending;if(k!==null){f.shared.pending=null;var R=k,H=R.next;R.next=null,b===null?d=H:b.next=H,b=R;var Q=e.alternate;Q!==null&&(Q=Q.updateQueue,k=Q.lastBaseUpdate,k!==b&&(k===null?Q.firstBaseUpdate=H:k.next=H,Q.lastBaseUpdate=R))}if(d!==null){var le=f.baseState;b=0,Q=H=R=null,k=d;do{var L=k.lane&-536870913,F=L!==k.lane;if(F?(rt&L)===L:(s&L)===L){L!==0&&L===Pl&&(Mc=!0),Q!==null&&(Q=Q.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var ve=e,Ae=k;L=n;var Ye=l;switch(Ae.tag){case 1:if(ve=Ae.payload,typeof ve=="function"){le=ve.call(Ye,le,L);break e}le=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Ae.payload,L=typeof ve=="function"?ve.call(Ye,le,L):ve,L==null)break e;le=Y({},le,L);break e;case 2:cl=!0}}L=k.callback,L!==null&&(e.flags|=64,F&&(e.flags|=8192),F=f.callbacks,F===null?f.callbacks=[L]:F.push(L))}else F={lane:L,tag:k.tag,payload:k.payload,callback:k.callback,next:null},Q===null?(H=Q=F,R=le):Q=Q.next=F,b|=L;if(k=k.next,k===null){if(k=f.shared.pending,k===null)break;F=k,k=F.next,F.next=null,f.lastBaseUpdate=F,f.shared.pending=null}}while(!0);Q===null&&(R=le),f.baseState=R,f.firstBaseUpdate=H,f.lastBaseUpdate=Q,d===null&&(f.shared.lanes=0),bl|=b,e.lanes=b,e.memoizedState=le}}function Ym(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function Fm(e,n){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Ym(l[e],n)}var hl=tt(null),vo=tt(0);function Gm(e,n){e=Xi,Ie(vo,e),Ie(hl,n),Xi=e|n.baseLanes}function qc(){Ie(vo,Xi),Ie(hl,hl.current)}function Dc(){Xi=vo.current,$e(hl),$e(vo)}var dn=tt(null),wn=null;function ml(e){var n=e.alternate;Ie(hn,hn.current&1),Ie(dn,e),wn===null&&(n===null||hl.current!==null||n.memoizedState!==null)&&(wn=e)}function Lc(e){Ie(hn,hn.current),Ie(dn,e),wn===null&&(wn=e)}function Qm(e){e.tag===22?(Ie(hn,hn.current),Ie(dn,e),wn===null&&(wn=e)):pl()}function pl(){Ie(hn,hn.current),Ie(dn,dn.current)}function Ln(e){$e(dn),wn===e&&(wn=null),$e(hn)}var hn=tt(0);function Fa(e,n){Ie(dn,dn.current),Ie(hn,n)}function Bc(e){$e(hn),$e(dn),wn===e&&(wn=null)}function bo(e){for(var n=e;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||sd(l)||od(l)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!=="independent"){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Yi=0,Ve=null,Ct=null,Kt=null,xo=!1,Ur=!1,ir=!1,wo=0,Ga=0,Hr=null,ew=0;function It(){throw Error(a(321))}function Uc(e,n){if(n===null)return!1;for(var l=0;l<n.length&&l<e.length;l++)if(!Dn(e[l],n[l]))return!1;return!0}function Hc(e,n,l,s,f,d){return Yi=d,Ve=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,P.H=e===null||e.memoizedState===null?Ap:Op,ir=!1,d=l(s,f),ir=!1,Ur&&(d=Zm(n,l,s,f)),Xm(e),d}function Xm(e){P.H=No;var n=Ct!==null&&Ct.next!==null;if(Yi=0,Kt=Ct=Ve=null,xo=!1,Ga=0,Hr=null,n)throw Error(a(300));e===null||$t||(e=e.dependencies,e!==null&&co(e)&&($t=!0))}function Zm(e,n,l,s){Ve=e;var f=0;do{if(Ur&&(Hr=null),Ga=0,Ur=!1,25<=f)throw Error(a(301));if(f+=1,Kt=Ct=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}P.H=ow,d=n(l,s)}while(Ur);return d}function tw(){var e=P.H,n=e.useState()[0];return n=typeof n.then=="function"?Qa(n):n,e=e.useState()[0],(Ct!==null?Ct.memoizedState:null)!==e&&(Ve.flags|=1024),n}function Ic(){var e=wo!==0;return wo=0,e}function Vc(e,n,l){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l}function Yc(e){if(xo){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}xo=!1}Yi=0,Kt=Ct=Ve=null,Ur=!1,Ga=wo=0,Hr=null}function En(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?Ve.memoizedState=Kt=e:Kt=Kt.next=e,Kt}function Ft(){if(Ct===null){var e=Ve.alternate;e=e!==null?e.memoizedState:null}else e=Ct.next;var n=Kt===null?Ve.memoizedState:Kt.next;if(n!==null)Kt=n,Ct=e;else{if(e===null)throw Ve.alternate===null?Error(a(467)):Error(a(310));Ct=e,e={memoizedState:Ct.memoizedState,baseState:Ct.baseState,baseQueue:Ct.baseQueue,queue:Ct.queue,next:null},Kt===null?Ve.memoizedState=Kt=e:Kt=Kt.next=e}return Kt}function So(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qa(e){var n=Ga;return Ga+=1,Hr===null&&(Hr=[]),e=Bm(Hr,e,n),n=Ve,(Kt===null?n.memoizedState:Kt.next)===null&&(n=n.alternate,P.H=n===null||n.memoizedState===null?Ap:Op),e}function ko(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Qa(e);if(e.$$typeof===ne)return;if(e.$$typeof===fe)return fn(e)}throw Error(a(438,String(e)))}function Fc(e){var n=null,l=Ve.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var s=Ve.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=So(),Ve.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(e),s=0;s<e;s++)l[s]=M;return n.index++,l}function Fi(e,n){return typeof n=="function"?n(e):n}function Eo(e){var n=Ft();return Gc(n,Ct,e)}function Gc(e,n,l){var s=e.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=l;var f=e.baseQueue,d=s.pending;if(d!==null){if(f!==null){var b=f.next;f.next=d.next,d.next=b}n.baseQueue=f=d,s.pending=null}if(d=e.baseState,f===null)e.memoizedState=d;else{n=f.next;var k=b=null,R=null,H=n,Q=!1;do{var le=H.lane&-536870913;if(le!==H.lane?(rt&le)===le:(Yi&le)===le){var L=H.revertLane;if(L===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),le===Pl&&(Q=!0);else if((Yi&L)===L){H=H.next,L===Pl&&(Q=!0);continue}else le={lane:0,revertLane:H.revertLane,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},R===null?(k=R=le,b=d):R=R.next=le,Ve.lanes|=L,bl|=L;le=H.action,ir&&l(d,le),d=H.hasEagerState?H.eagerState:l(d,le)}else L={lane:le,revertLane:H.revertLane,gesture:H.gesture,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},R===null?(k=R=L,b=d):R=R.next=L,Ve.lanes|=le,bl|=le;H=H.next}while(H!==null&&H!==n);if(R===null?b=d:R.next=k,!Dn(d,e.memoizedState)&&($t=!0,Q&&(l=Dr,l!==null)))throw l;e.memoizedState=d,e.baseState=b,e.baseQueue=R,s.lastRenderedState=d}return f===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Qc(e){var n=Ft(),l=n.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=e;var s=l.dispatch,f=l.pending,d=n.memoizedState;if(f!==null){l.pending=null;var b=f=f.next;do d=e(d,b.action),b=b.next;while(b!==f);Dn(d,n.memoizedState)||($t=!0),n.memoizedState=d,n.baseQueue===null&&(n.baseState=d),l.lastRenderedState=d}return[d,s]}function Km(e,n,l){var s=Ve,f=Ft(),d=Je;if(d){if(l===void 0)throw Error(a(407));l=l()}else l=n();var b=!Dn((Ct||f).memoizedState,l);if(b&&(f.memoizedState=l,$t=!0),f=f.queue,Kc(Pm.bind(null,s,f,e),[e]),e=f.getSnapshot!==n||b||Kt!==null&&(Kt.memoizedState.tag&1)!==0,Ir(e?9:8,{destroy:void 0},Jm.bind(null,s,f,l,n),null),e){if(s.flags|=2048,Nt===null)throw Error(a(349));d||(Yi&127)!==0||$m(s,n,l)}return l}function $m(e,n,l){e.flags|=16384,e={getSnapshot:n,value:l},n=Ve.updateQueue,n===null?(n=So(),Ve.updateQueue=n,n.stores=[e]):(l=n.stores,l===null?n.stores=[e]:l.push(e))}function Jm(e,n,l,s){n.value=l,n.getSnapshot=s,Wm(n)&&ep(e)}function Pm(e,n,l){return l(function(){Wm(n)&&ep(e)})}function Wm(e){var n=e.getSnapshot;e=e.value;try{var l=n();return!Dn(e,l)}catch{return!0}}function ep(e){var n=Ql(e,2);n!==null&&Rn(n,e,2)}function Xc(e){var n=En();if(typeof e=="function"){var l=e;if(e=l(),ir){Yt(!0);try{l()}finally{Yt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:e},n}function tp(e,n,l,s){return e.baseState=l,Gc(e,Ct,typeof s=="function"?s:Fi)}function nw(e,n,l,s,f){if(Co(e))throw Error(a(485));if(e=n.action,e!==null){var d={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){d.listeners.push(b)}};P.T!==null?l(!0):d.isTransition=!1,s(d),l=n.pending,l===null?(d.next=n.pending=d,np(n,d)):(d.next=l.next,n.pending=l.next=d)}}function np(e,n){var l=n.action,s=n.payload,f=e.state;if(n.isTransition){var d=P.T,b={};b.types=d!==null?d.types:null,P.T=b;try{var k=l(f,s),R=P.S;R!==null&&R(b,k),ip(e,n,k)}catch(H){Zc(e,n,H)}finally{d!==null&&b.types!==null&&(d.types=b.types),P.T=d}}else try{d=l(f,s),ip(e,n,d)}catch(H){Zc(e,n,H)}}function ip(e,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(s){lp(e,n,s)},function(s){return Zc(e,n,s)}):lp(e,n,l)}function lp(e,n,l){n.status="fulfilled",n.value=l,rp(n),e.state=l,n=e.pending,n!==null&&(l=n.next,l===n?e.pending=null:(l=l.next,n.next=l,np(e,l)))}function Zc(e,n,l){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=l,rp(n),n=n.next;while(n!==s)}e.action=null}function rp(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function ap(e,n){return n}function sp(e,n){if(Je){var l=Nt.formState;if(l!==null){e:{var s=Ve;if(Je){if(zt){t:{for(var f=zt,d=$n;f.nodeType!==8;){if(!d){f=null;break t}if(f=Pn(f.nextSibling),f===null){f=null;break t}}d=f.data,f=d==="F!"||d==="F"?f:null}if(f){zt=Pn(f.nextSibling),s=f.data==="F!";break e}}sl(s)}s=!1}s&&(n=l[0])}}return l=En(),l.memoizedState=l.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ap,lastRenderedState:n},l.queue=s,l=jp.bind(null,Ve,s),s.dispatch=l,s=Xc(!1),d=ef.bind(null,Ve,!1,s.queue),s=En(),f={state:n,dispatch:null,action:e,pending:null},s.queue=f,l=nw.bind(null,Ve,f,d,l),f.dispatch=l,s.memoizedState=e,[n,l,!1]}function op(e){var n=Ft();return up(n,Ct,e)}function up(e,n,l){if(n=Gc(e,n,ap)[0],e=Eo(Fi)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=Qa(n)}catch(b){throw b===Lr?mo:b}else s=n;n=Ft();var f=n.queue,d=f.dispatch;return l!==n.memoizedState&&(Ve.flags|=2048,Ir(9,{destroy:void 0},iw.bind(null,f,l),null)),[s,d,e]}function iw(e,n){e.action=n}function cp(e){var n=Ft(),l=Ct;if(l!==null)return up(n,l,e);Ft(),n=n.memoizedState,l=Ft();var s=l.queue.dispatch;return l.memoizedState=e,[n,s,!1]}function Ir(e,n,l,s){return e={tag:e,create:l,deps:s,inst:n,next:null},n=Ve.updateQueue,n===null&&(n=So(),Ve.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=e.next=e:(s=l.next,l.next=e,e.next=s,n.lastEffect=e),e}function fp(){return Ft().memoizedState}function To(e,n,l,s){var f=En();Ve.flags|=e,f.memoizedState=Ir(1|n,{destroy:void 0},l,s===void 0?null:s)}function jo(e,n,l,s){var f=Ft();s=s===void 0?null:s;var d=f.memoizedState.inst;Ct!==null&&s!==null&&Uc(s,Ct.memoizedState.deps)?f.memoizedState=Ir(n,d,l,s):(Ve.flags|=e,f.memoizedState=Ir(1|n,d,l,s))}function dp(e,n){To(8390656,8,e,n)}function Kc(e,n){jo(2048,8,e,n)}function lw(e){Ve.flags|=4;var n=Ve.updateQueue;if(n===null)n=So(),Ve.updateQueue=n,n.events=[e];else{var l=n.events;l===null?n.events=[e]:l.push(e)}}function hp(e){var n=Ft().memoizedState;return lw({ref:n,nextImpl:e}),function(){if((yt&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}function mp(e,n){return jo(4,2,e,n)}function pp(e,n){return jo(4,4,e,n)}function gp(e,n){if(typeof n=="function"){e=e();var l=n(e);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function yp(e,n,l){l=l!=null?l.concat([e]):null,jo(4,4,gp.bind(null,n,e),l)}function $c(){}function vp(e,n){var l=Ft();n=n===void 0?null:n;var s=l.memoizedState;return n!==null&&Uc(n,s[1])?s[0]:(l.memoizedState=[e,n],e)}function bp(e,n){var l=Ft();n=n===void 0?null:n;var s=l.memoizedState;if(n!==null&&Uc(n,s[1]))return s[0];if(s=e(),ir){Yt(!0);try{e()}finally{Yt(!1)}}return l.memoizedState=[s,n],s}function Jc(e,n,l){return l===void 0||(Yi&1073741824)!==0&&(rt&261930)===0?e.memoizedState=n:(e.memoizedState=l,e=Ag(),Ve.lanes|=e,bl|=e,l)}function xp(e,n,l,s){return Dn(l,n)?l:hl.current!==null?(e=Jc(e,l,s),Dn(e,n)||($t=!0),e):(Yi&106)===0||(Yi&1073741824)!==0&&(rt&261930)===0?($t=!0,e.memoizedState=l):(e=Ag(),Ve.lanes|=e,bl|=e,n)}function wp(e,n,l,s,f){var d=ye.p;ye.p=d!==0&&8>d?d:8;var b=P.T,k={};k.types=b!==null?b.types:null,P.T=k,ef(e,!1,n,l);try{var R=f(),H=P.S;if(H!==null&&H(k,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var Q=W1(R,s);Xa(e,n,Q,In(e))}else Xa(e,n,s,In(e))}catch(le){Xa(e,n,{then:function(){},status:"rejected",reason:le},In())}finally{ye.p=d,b!==null&&k.types!==null&&(b.types=k.types),P.T=b}}function rw(){}function Pc(e,n,l,s){if(e.tag!==5)throw Error(a(476));var f=Sp(e).queue;wp(e,f,n,We,l===null?rw:function(){return kp(e),l(s)})}function Sp(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:We,baseState:We,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:We},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:l},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function kp(e){var n=Sp(e);n.next===null&&(n=e.alternate.memoizedState),Xa(e,n.next.queue,{},In())}function Wc(){return fn(aa)}function Ep(){return Ft().memoizedState}function Tp(){return Ft().memoizedState}function aw(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var l=In();e=fl(l);var s=dl(n,e,l);s!==null&&(Rn(s,n,l),Ia(s,n,l)),n={cache:Cc()},e.payload=n;return}n=n.return}}function sw(e,n,l){var s=In();l={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Co(e)?Cp(n,l):(l=vc(e,n,l,s),l!==null&&(Rn(l,e,s),Np(l,n,s)))}function jp(e,n,l){var s=In();Xa(e,n,l,s)}function Xa(e,n,l,s){var f={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Co(e))Cp(n,f);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=n.lastRenderedReducer,d!==null))try{var b=n.lastRenderedState,k=d(b,l);if(f.hasEagerState=!0,f.eagerState=k,Dn(k,b))return io(e,n,f,0),Nt===null&&no(),!1}catch{}if(l=vc(e,n,f,s),l!==null)return Rn(l,e,s),Np(l,n,s),!0}return!1}function ef(e,n,l,s){if(s={lane:2,revertLane:Gf(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Co(e)){if(n)throw Error(a(479))}else n=vc(e,l,s,2),n!==null&&Rn(n,e,2)}function Co(e){var n=e.alternate;return e===Ve||n!==null&&n===Ve}function Cp(e,n){Ur=xo=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function Np(e,n,l){if((l&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,l|=s,n.lanes=l,ya(e,l)}}var No={readContext:fn,use:ko,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It,useEffectEvent:It},Ap={readContext:fn,use:ko,useCallback:function(e,n){return En().memoizedState=[e,n===void 0?null:n],e},useContext:fn,useEffect:dp,useImperativeHandle:function(e,n,l){l=l!=null?l.concat([e]):null,To(4194308,4,gp.bind(null,n,e),l)},useLayoutEffect:function(e,n){return To(4194308,4,e,n)},useInsertionEffect:function(e,n){To(4,2,e,n)},useMemo:function(e,n){var l=En();n=n===void 0?null:n;var s=e();if(ir){Yt(!0);try{e()}finally{Yt(!1)}}return l.memoizedState=[s,n],s},useReducer:function(e,n,l){var s=En();if(l!==void 0){var f=l(n);if(ir){Yt(!0);try{l(n)}finally{Yt(!1)}}}else f=n;return s.memoizedState=s.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},s.queue=e,e=e.dispatch=sw.bind(null,Ve,e),[s.memoizedState,e]},useRef:function(e){var n=En();return e={current:e},n.memoizedState=e},useState:function(e){e=Xc(e);var n=e.queue,l=jp.bind(null,Ve,n);return n.dispatch=l,[e.memoizedState,l]},useDebugValue:$c,useDeferredValue:function(e,n){var l=En();return Jc(l,e,n)},useTransition:function(){var e=Xc(!1);return e=wp.bind(null,Ve,e.queue,!0,!1),En().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,l){var s=Ve,f=En();if(Je){if(l===void 0)throw Error(a(407));l=l()}else{if(l=n(),Nt===null)throw Error(a(349));(rt&127)!==0||$m(s,n,l)}f.memoizedState=l;var d={value:l,getSnapshot:n};return f.queue=d,dp(Pm.bind(null,s,d,e),[e]),s.flags|=2048,Ir(9,{destroy:void 0},Jm.bind(null,s,d,l,n),null),l},useId:function(){var e=En(),n=Nt.identifierPrefix;if(Je){var l=vi,s=yi;l=(s&~(1<<32-Ut(s)-1)).toString(32)+l,n="_"+n+"R_"+l,l=wo++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=ew++,n="_"+n+"r_"+l.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Wc,useFormState:sp,useActionState:sp,useOptimistic:function(e){var n=En();n.memoizedState=n.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=ef.bind(null,Ve,!0,l),l.dispatch=n,[e,n]},useMemoCache:Fc,useCacheRefresh:function(){return En().memoizedState=aw.bind(null,Ve)},useEffectEvent:function(e){var n=En(),l={impl:e};return n.memoizedState=l,function(){if((yt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Op={readContext:fn,use:ko,useCallback:vp,useContext:fn,useEffect:Kc,useImperativeHandle:yp,useInsertionEffect:mp,useLayoutEffect:pp,useMemo:bp,useReducer:Eo,useRef:fp,useState:function(){return Eo(Fi)},useDebugValue:$c,useDeferredValue:function(e,n){var l=Ft();return xp(l,Ct.memoizedState,e,n)},useTransition:function(){var e=Eo(Fi)[0],n=Ft().memoizedState;return[typeof e=="boolean"?e:Qa(e),n]},useSyncExternalStore:Km,useId:Ep,useHostTransitionStatus:Wc,useFormState:op,useActionState:op,useOptimistic:function(e,n){var l=Ft();return tp(l,Ct,e,n)},useMemoCache:Fc,useCacheRefresh:Tp,useEffectEvent:hp},ow={readContext:fn,use:ko,useCallback:vp,useContext:fn,useEffect:Kc,useImperativeHandle:yp,useInsertionEffect:mp,useLayoutEffect:pp,useMemo:bp,useReducer:Qc,useRef:fp,useState:function(){return Qc(Fi)},useDebugValue:$c,useDeferredValue:function(e,n){var l=Ft();return Ct===null?Jc(l,e,n):xp(l,Ct.memoizedState,e,n)},useTransition:function(){var e=Qc(Fi)[0],n=Ft().memoizedState;return[typeof e=="boolean"?e:Qa(e),n]},useSyncExternalStore:Km,useId:Ep,useHostTransitionStatus:Wc,useFormState:cp,useActionState:cp,useOptimistic:function(e,n){var l=Ft();return Ct!==null?tp(l,Ct,e,n):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Fc,useCacheRefresh:Tp,useEffectEvent:hp};function tf(e,n,l,s){n=e.memoizedState,l=l(s,n),l=l==null?n:Y({},n,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var nf={enqueueSetState:function(e,n,l){e=e._reactInternals;var s=In(),f=fl(s);f.payload=n,l!=null&&(f.callback=l),n=dl(e,f,s),n!==null&&(Rn(n,e,s),Ia(n,e,s))},enqueueReplaceState:function(e,n,l){e=e._reactInternals;var s=In(),f=fl(s);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=dl(e,f,s),n!==null&&(Rn(n,e,s),Ia(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var l=In(),s=fl(l);s.tag=2,n!=null&&(s.callback=n),n=dl(e,s,l),n!==null&&(Rn(n,e,l),Ia(n,e,l))}};function Rp(e,n,l,s,f,d,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,d,b):n.prototype&&n.prototype.isPureReactComponent?!za(l,s)||!za(f,d):!0}function _p(e,n,l,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,s),n.state!==e&&nf.enqueueReplaceState(n,n.state,null)}function lr(e,n){var l=n;if("ref"in n){l={};for(var s in n)s!=="ref"&&(l[s]=n[s])}if(e=e.defaultProps){l===n&&(l=Y({},l));for(var f in e)l[f]===void 0&&(l[f]=e[f])}return l}function zp(e){to(e)}function Mp(e){console.error(e)}function qp(e){to(e)}function Ao(e,n){try{var l=e.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function Dp(e,n,l){try{var s=e.onCaughtError;s(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function lf(e,n,l){return l=fl(l),l.tag=3,l.payload={element:null},l.callback=function(){Ao(e,n)},l}function Lp(e){return e=fl(e),e.tag=3,e}function Bp(e,n,l,s){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var d=s.value;e.payload=function(){return f(d)},e.callback=function(){Dp(n,l,s)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Dp(n,l,s),typeof f!="function"&&(xl===null?xl=new Set([this]):xl.add(this));var k=s.stack;this.componentDidCatch(s.value,{componentStack:k!==null?k:""})})}function uw(e,n,l,s,f){if(l.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=l.alternate,n!==null&&$l(n,l,f,!0),l=dn.current,l!==null){switch(l.tag){case 31:case 13:case 19:return wn===null?$o():l.alternate===null&&Vt===0&&(Vt=3),l.flags&=-257,l.flags|=65536,l.lanes=f,s===po?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([s]):n.add(s),Vf(e,s,f)),!1;case 22:return l.flags|=65536,s===po?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([s]):l.add(s)),Vf(e,s,f)),!1}throw Error(a(435,l.tag))}return Vf(e,s,f),$o(),!1}if(Je)return n=dn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,s!==kc&&(e=Error(a(422),{cause:s}),Da(Xn(e,l)))):(s!==kc&&(n=Error(a(423),{cause:s}),Da(Xn(n,l))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,s=Xn(s,l),f=lf(e.stateNode,s,f),zc(e,f),Vt!==4&&(Vt=2)),!1;var d=Error(a(520),{cause:s});if(d=Xn(d,l),ts===null?ts=[d]:ts.push(d),Vt!==4&&(Vt=2),n===null)return!0;s=Xn(s,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,e=f&-f,l.lanes|=e,e=lf(l.stateNode,s,e),zc(l,e),!1;case 1:if(n=l.type,d=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(xl===null||!xl.has(d))))return l.flags|=65536,f&=-f,l.lanes|=f,f=Lp(f),Bp(f,e,l,s),zc(l,f),!1;break;case 22:if(l.memoizedState!==null)return l.flags|=65536,!1}l=l.return}while(l!==null);return!1}var rf=Error(a(461)),$t=!1;function nn(e,n,l,s){n.child=e===null?Vm(n,null,l,s):nr(n,e.child,l,s)}function Up(e,n,l,s,f){l=l.render;var d=n.ref;if("ref"in s){var b={};for(var k in s)k!=="ref"&&(b[k]=s[k])}else b=s;return Jl(n),s=Hc(e,n,l,b,d,f),k=Ic(),e!==null&&!$t?(Vc(e,n,f),Gi(e,n,f)):(Je&&k&&so(n),n.flags|=1,nn(e,n,s,f),n.child)}function Hp(e,n,l,s,f){if(e===null){var d=l.type;return typeof d=="function"&&!bc(d)&&d.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=d,Ip(e,n,d,s,f)):(e=ro(l.type,null,s,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(d=e.child,!hf(e,f)){var b=d.memoizedProps;if(l=l.compare,l=l!==null?l:za,l(b,s)&&e.ref===n.ref)return Gi(e,n,f)}return n.flags|=1,e=Ui(d,s),e.ref=n.ref,e.return=n,n.child=e}function Ip(e,n,l,s,f){if(e!==null){var d=e.memoizedProps;if(za(d,s)&&e.ref===n.ref)if($t=!1,n.pendingProps=s=d,hf(e,f))(e.flags&131072)!==0&&($t=!0);else return n.lanes=e.lanes,Gi(e,n,f)}return af(e,n,l,s,f)}function Vp(e,n,l,s){var f=s.children,d=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((n.flags&128)!==0){if(d=d!==null?d.baseLanes|l:l,e!==null){for(s=n.child=e.child,f=0;s!==null;)f=f|s.lanes|s.childLanes,s=s.sibling;s=f&~d}else s=0,n.child=null;return Yp(e,n,d,l,s)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&ho(n,d!==null?d.cachePool:null),d!==null?Gm(n,d):qc(),Qm(n);else return s=n.lanes=536870912,Yp(e,n,d!==null?d.baseLanes|l:l,l,s)}else d!==null?(ho(n,d.cachePool),Gm(n,d),pl(),n.memoizedState=null):(e!==null&&ho(n,null),qc(),pl());return nn(e,n,f,l),n.child}function Za(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Yp(e,n,l,s,f){var d=Ac();return d=d===null?null:{parent:Zt._currentValue,pool:d},n.memoizedState={baseLanes:l,cachePool:d},e!==null&&ho(n,null),qc(),Qm(n),e!==null&&$l(e,n,s,!0),n.childLanes=f,null}function Oo(e,n){return n=Ro({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Fp(e,n,l){return nr(n,e.child,null,l),e=Oo(n,n.pendingProps),e.flags|=2,Ln(n),n.memoizedState=null,e}function cw(e,n,l){var s=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Je){if(s.mode==="hidden")return e=Oo(n,s),n.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Za(null,e);if(Lc(n),(e=zt)?(e=gy(e,$n),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:rl!==null?{id:yi,overflow:vi}:null,retryLane:536870912,hydrationErrors:null},l=Cm(e),l.return=n,n.child=l,rn=n,zt=null)):e=null,e===null)throw sl(n);return n.lanes=536870912,null}return Oo(n,s)}var d=e.memoizedState;if(d!==null){var b=d.dehydrated;if(Lc(n),f)if(n.flags&256)n.flags&=-257,n=Fp(e,n,l);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(a(558));else if($t||$l(e,n,l,!1),f=(l&e.childLanes)!==0,$t||f){if(hl.current===null){if(s=Nt,s!==null&&(b=wr(s,l),b!==0&&b!==d.retryLane))throw d.retryLane=b,Ql(e,b),Rn(s,e,b),rf;$o()}n=Fp(e,n,l)}else e=d.treeContext,zt=Pn(b.nextSibling),rn=n,Je=!0,al=null,$n=!1,e!==null&&Om(n,e),n=Oo(n,s),n.flags|=134221824;return n}return e=Ui(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Vr(e,n){var l=n.ref;if(l===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(e===null||e.ref!==l)&&(n.flags|=4194816)}}function af(e,n,l,s,f){return Jl(n),l=Hc(e,n,l,s,void 0,f),s=Ic(),e!==null&&!$t?(Vc(e,n,f),Gi(e,n,f)):(Je&&s&&so(n),n.flags|=1,nn(e,n,l,f),n.child)}function Gp(e,n,l,s,f,d){return Jl(n),n.updateQueue=null,l=Zm(n,s,l,f),Xm(e),s=Ic(),e!==null&&!$t?(Vc(e,n,d),Gi(e,n,d)):(Je&&s&&so(n),n.flags|=1,nn(e,n,l,d),n.child)}function Qp(e,n,l,s,f){if(Jl(n),n.stateNode===null){var d=_r,b=l.contextType;typeof b=="object"&&b!==null&&(d=fn(b)),d=new l(s,d),n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=nf,n.stateNode=d,d._reactInternals=n,d=n.stateNode,d.props=s,d.state=n.memoizedState,d.refs={},Rc(n),b=l.contextType,d.context=typeof b=="object"&&b!==null?fn(b):_r,d.state=n.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(tf(n,l,b,s),d.state=n.memoizedState),typeof l.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&&nf.enqueueReplaceState(d,d.state,null),Ya(n,s,d,f),Va(),d.state=n.memoizedState),typeof d.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){d=n.stateNode;var k=n.memoizedProps,R=lr(l,k);d.props=R;var H=d.context,Q=l.contextType;b=_r,typeof Q=="object"&&Q!==null&&(b=fn(Q));var le=l.getDerivedStateFromProps;Q=typeof le=="function"||typeof d.getSnapshotBeforeUpdate=="function",k=n.pendingProps!==k,Q||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(k||H!==b)&&_p(n,d,s,b),cl=!1;var L=n.memoizedState;d.state=L,Ya(n,s,d,f),Va(),H=n.memoizedState,k||L!==H||cl?(typeof le=="function"&&(tf(n,l,le,s),H=n.memoizedState),(R=cl||Rp(n,l,R,s,L,H,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"&&(n.flags|=4194308)):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=H),d.props=s,d.state=H,d.context=b,s=R):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{d=n.stateNode,_c(e,n),b=n.memoizedProps,Q=lr(l,b),d.props=Q,le=n.pendingProps,L=d.context,H=l.contextType,R=_r,typeof H=="object"&&H!==null&&(R=fn(H)),k=l.getDerivedStateFromProps,(H=typeof k=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==le||L!==R)&&_p(n,d,s,R),cl=!1,L=n.memoizedState,d.state=L,Ya(n,s,d,f),Va();var F=n.memoizedState;b!==le||L!==F||cl||e!==null&&e.dependencies!==null&&co(e.dependencies)?(typeof k=="function"&&(tf(n,l,k,s),F=n.memoizedState),(Q=cl||Rp(n,l,Q,s,L,F,R)||e!==null&&e.dependencies!==null&&co(e.dependencies))?(H||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,F,R),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,F,R)),typeof d.componentDidUpdate=="function"&&(n.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&L===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&L===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=F),d.props=s,d.state=F,d.context=R,s=Q):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&L===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&L===e.memoizedState||(n.flags|=1024),s=!1)}return d=s,Vr(e,n),s=(n.flags&128)!==0,d||s?(d=n.stateNode,l=s&&typeof l.getDerivedStateFromError!="function"?null:d.render(),n.flags|=1,e!==null&&s?(n.child=nr(n,e.child,null,f),n.child=nr(n,null,l,f)):nn(e,n,l,f),n.memoizedState=d.state,e=n.child):e=Gi(e,n,f),e}function Xp(e,n,l,s){return Zl(),n.flags|=256,nn(e,n,l,s),n.child}var sf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function of(e){return{baseLanes:e,cachePool:Dm()}}function uf(e,n,l){return e=e!==null?e.childLanes&~l:0,n&&(e|=Hn),e}function Zp(e,n,l){var s=n.pendingProps,f=!1,d=(n.flags&128)!==0,b;if((b=d)||(b=e!==null&&e.memoizedState===null?!1:(hn.current&2)!==0),b&&(f=!0,n.flags&=-129),b=(n.flags&32)!==0,n.flags&=-33,e===null){if(Je){if(f?ml(n):pl(),(e=zt)?(e=gy(e,$n),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:rl!==null?{id:yi,overflow:vi}:null,retryLane:536870912,hydrationErrors:null},l=Cm(e),l.return=n,n.child=l,rn=n,zt=null)):e=null,e===null)throw sl(n);return od(e)?n.lanes=32:n.lanes=536870912,null}return d=s.children,s=s.fallback,f?(pl(),f=n.mode,d=Ro({mode:"hidden",children:d},f),s=Xl(s,f,l,null),d.return=n,s.return=n,d.sibling=s,n.child=d,s=n.child,s.memoizedState=of(l),s.childLanes=uf(e,b,l),n.memoizedState=sf,Za(null,s)):(ml(n),cf(n,d))}var k=e.memoizedState;if(k!==null){var R=k.dehydrated;if(R!==null)return fw(e,n,d,b,s,R,k,l)}return f?(pl(),f=s.fallback,d=n.mode,k=e.child,R=k.sibling,s=Ui(k,{mode:"hidden",children:s.children}),s.subtreeFlags=k.subtreeFlags&1206910976,R!==null?f=Ui(R,f):(f=Xl(f,d,l,null),f.flags|=2),f.return=n,s.return=n,s.sibling=f,n.child=s,Za(null,s),s=n.child,f=e.child.memoizedState,f===null?f=of(l):(d=f.cachePool,d!==null?(k=Zt._currentValue,d=d.parent!==k?{parent:k,pool:k}:d):d=Dm(),f={baseLanes:f.baseLanes|l,cachePool:d}),s.memoizedState=f,s.childLanes=uf(e,b,l),n.memoizedState=sf,Za(e.child,s)):(ml(n),l=e.child,e=l.sibling,l=Ui(l,{mode:"visible",children:s.children}),l.return=n,l.sibling=null,e!==null&&(b=n.deletions,b===null?(n.deletions=[e],n.flags|=16):b.push(e)),n.child=l,n.memoizedState=null,l)}function cf(e,n){return n=Ro({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Ro(e,n){return e=Cn(22,e,null,n),e.lanes=0,e}function _o(e,n,l){return nr(n,e.child,null,l),e=cf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function fw(e,n,l,s,f,d,b,k){if(l)return n.flags&256?(ml(n),n.flags&=-257,_o(e,n,k)):n.memoizedState!==null?(pl(),n.child=e.child,n.flags|=128,null):(pl(),d=f.fallback,b=n.mode,f=Ro({mode:"visible",children:f.children},b),d=Xl(d,b,k,null),d.flags|=2,f.return=n,d.return=n,f.sibling=d,n.child=f,nr(n,e.child,null,k),f=n.child,f.memoizedState=of(k),f.childLanes=uf(e,s,k),n.memoizedState=sf,Za(null,f));if(ml(n),od(d)){if(s=d.nextSibling&&d.nextSibling.dataset,s)var R=s.dgst;return s=R,s!==""&&(f=Error(a(419)),f.stack="",f.digest=s,Da({value:f,source:null,stack:null})),_o(e,n,k)}if($t||$l(e,n,k,!1),s=(k&e.childLanes)!==0,$t||s){if(hl.current!==null)return _o(e,n,k);if(s=Nt,s!==null&&(f=wr(s,k),f!==0&&f!==b.retryLane))throw b.retryLane=f,Ql(e,f),Rn(s,e,f),rf;return sd(d)||$o(),_o(e,n,k)}return sd(d)?(n.flags|=192,n.child=e.child,null):(e=b.treeContext,zt=Pn(d.nextSibling),rn=n,Je=!0,al=null,$n=!1,e!==null&&Om(n,e),n=cf(n,f.children),n.flags|=134221824,n)}function Kp(e,n,l){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),uo(e.return,n,l)}function $p(e){for(var n=null;e!==null;){var l=e.alternate;l!==null&&bo(l)===null&&(n=e),e=e.sibling}return n}function zo(e,n,l,s,f,d){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:l,tailMode:f,treeForkCount:d}:(b.isBackwards=n,b.rendering=null,b.renderingStartTime=0,b.last=s,b.tail=l,b.tailMode=f,b.treeForkCount=d)}function ff(e){var n=e.child;for(e.child=null;n!==null;){var l=n.sibling;n.sibling=e.child,e.child=n,n=l}}function df(e,n,l){var s=n.pendingProps,f=s.revealOrder,d=s.tail;s=s.children;var b=hn.current;if(n.flags&128)return Fa(n,b),null;var k=(b&2)!==0;if(k?(b=b&1|2,n.flags|=128):b&=1,Fa(n,b),f==="backwards"&&e!==null?(ff(e),nn(e,n,s,l),ff(e)):nn(e,n,s,l),s=Je?qa:0,!k&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Kp(e,l,n);else if(e.tag===19)Kp(e,l,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"backwards":l=$p(n.child),l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null,ff(n)),zo(n,!0,f,null,d,s);break;case"unstable_legacy-backwards":for(l=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&bo(e)===null){n.child=f;break}e=f.sibling,f.sibling=l,l=f,f=e}zo(n,!0,l,null,d,s);break;case"together":zo(n,!1,null,null,void 0,s);break;case"independent":n.memoizedState=null;break;default:l=$p(n.child),l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),zo(n,!1,f,l,d,s)}return n.child}function Jp(e,n,l){var s=n.pendingProps;return ol(n,n.type,s.value),nn(e,n,s.children,l),n.child}function Gi(e,n,l){if(e!==null&&(n.dependencies=e.dependencies),bl|=n.lanes,(l&n.childLanes)===0)if(e!==null){if($l(e,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(a(153));if(n.child!==null){for(e=n.child,l=Ui(e,e.pendingProps),n.child=l,l.return=n;e.sibling!==null;)e=e.sibling,l=l.sibling=Ui(e,e.pendingProps),l.return=n;l.sibling=null}return n.child}function hf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&co(e)))}function dw(e,n,l){switch(n.tag){case 3:Le(n,n.stateNode.containerInfo),ol(n,Zt,e.memoizedState.cache),Zl();break;case 27:case 5:bn(n);break;case 4:Le(n,n.stateNode.containerInfo);break;case 10:ol(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Lc(n),null;break;case 13:var s=n.memoizedState;if(s!==null){if(s.dehydrated!==null)return ml(n),n.flags|=128,null;s=$l(e,n,l,!1);var f=n.child.childLanes;return s||(l&f)!==0?Zp(e,n,l):(ml(n),e=Gi(e,n,l),e!==null?e.sibling:null)}ml(n);break;case 19:if(n.flags&128)return df(e,n,l);if(f=(e.flags&128)!==0,s=(l&n.childLanes)!==0,s||($l(e,n,l,!1),s=(l&n.childLanes)!==0),f){if(s)return df(e,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Fa(n,hn.current),s)break;return null;case 22:return n.lanes=0,Vp(e,n,l,n.pendingProps);case 24:ol(n,Zt,e.memoizedState.cache)}return Gi(e,n,l)}function Pp(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps)$t=!0;else{if(!hf(e,l)&&(n.flags&128)===0)return $t=!1,dw(e,n,l);$t=(e.flags&131072)!==0}else $t=!1,Je&&(n.flags&1048576)!==0&&Am(n,qa,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=er(n.elementType),n.type=e,typeof e=="function")bc(e)?(s=lr(e,s),n.tag=1,n=Qp(null,n,e,s,l)):(n.tag=0,n=af(null,n,e,s,l));else{if(e!=null){var f=e.$$typeof;if(f===re){n.tag=11,n=Up(null,n,e,s,l);break e}else if(f===me){n.tag=14,n=Hp(null,n,e,s,l);break e}else if(f===fe){n.tag=10,n.type=e,n=Jp(null,n,l);break e}}throw n=be(e)||e,Error(a(306,n,""))}}return n;case 0:return af(e,n,n.type,n.pendingProps,l);case 1:return s=n.type,f=lr(s,n.pendingProps),Qp(e,n,s,f,l);case 3:e:{if(Le(n,n.stateNode.containerInfo),e===null)throw Error(a(387));s=n.pendingProps;var d=n.memoizedState;f=d.element,_c(e,n),Ya(n,s,null,l);var b=n.memoizedState;if(s=b.cache,ol(n,Zt,s),s!==d.cache&&jc(n,[Zt],l,!0),Va(),s=b.element,d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:b.cache},n.updateQueue.baseState=d,n.memoizedState=d,n.flags&256){n=Xp(e,n,s,l);break e}else if(s!==f){f=Xn(Error(a(424)),n),Da(f),n=Xp(e,n,s,l);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,zt=Pn(e.firstChild),rn=n,Je=!0,al=null,$n=!0,l=Vm(n,null,s,l),n.child=l;l;)l.flags=l.flags&-3|134221824,l=l.sibling;else{if(Zl(),s===f){n=Gi(e,n,l);break e}nn(e,n,s,l)}n=n.child}return n;case 26:return Vr(e,n),e===null?(l=ky(n.type,null,n.pendingProps,null))?n.memoizedState=l:Je||(n.stateNode=ny(n.type,n.pendingProps,vt.current,n)):n.memoizedState=ky(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return bn(n),e===null&&Je&&(s=n.stateNode=by(n.type,n.pendingProps,vt.current),rn=n,$n=!0,f=zt,kl(n.type)?(ud=f,zt=Pn(s.firstChild)):zt=f),nn(e,n,n.pendingProps.children,l),Vr(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Je&&((f=s=zt)&&(s=aS(s,n.type,n.pendingProps,$n),s!==null?(n.stateNode=s,rn=n,zt=Pn(s.firstChild),$n=!1,f=!0):f=!1),f||sl(n)),bn(n),f=n.type,d=n.pendingProps,b=e!==null?e.memoizedProps:null,s=d.children,ed(f,d)?s=null:b!==null&&ed(f,b)&&(n.flags|=32),n.memoizedState!==null&&(f=Hc(e,n,tw,null,null,l),aa._currentValue=f),Vr(e,n),nn(e,n,s,l),n.child;case 6:return e===null&&Je&&((e=l=zt)&&(l=sS(l,n.pendingProps,$n),l!==null?(n.stateNode=l,rn=n,zt=null,e=!0):e=!1),e||sl(n)),null;case 13:return Zp(e,n,l);case 4:return Le(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=nr(n,null,s,l):nn(e,n,s,l),n.child;case 11:return Up(e,n,n.type,n.pendingProps,l);case 7:return s=n.pendingProps,Vr(e,n),nn(e,n,s,l),n.child;case 8:return nn(e,n,n.pendingProps.children,l),n.child;case 12:return nn(e,n,n.pendingProps.children,l),n.child;case 10:return Jp(e,n,l);case 9:return f=n.type._context,s=n.pendingProps.children,Jl(n),f=fn(f),s=s(f),n.flags|=1,nn(e,n,s,l),n.child;case 14:return Hp(e,n,n.type,n.pendingProps,l);case 15:return Ip(e,n,n.type,n.pendingProps,l);case 19:return df(e,n,l);case 31:return cw(e,n,l);case 22:return Vp(e,n,l,n.pendingProps);case 24:return Jl(n),s=fn(Zt),e===null?(f=Ac(),f===null&&(f=Nt,d=Cc(),f.pooledCache=d,d.refCount++,d!==null&&(f.pooledCacheLanes|=l),f=d),n.memoizedState={parent:s,cache:f},Rc(n),ol(n,Zt,f)):((e.lanes&l)!==0&&(_c(e,n),Ya(n,null,null,l),Va()),f=e.memoizedState,d=n.memoizedState,f.parent!==s?(f={parent:s,cache:s},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),ol(n,Zt,s)):(s=d.cache,ol(n,Zt,s),s!==f.cache&&jc(n,[Zt],l,!0))),nn(e,n,n.pendingProps.children,l),n.child;case 30:return n.stateNode===null&&(n.stateNode={autoName:null,paired:null,clones:null,ref:null}),s=n.pendingProps,s.name!=null&&s.name!=="auto"?n.flags|=e===null?18882560:18874368:Je&&so(n),e!==null&&e.memoizedProps.name!==s.name?n.flags|=4194816:Vr(e,n),nn(e,n,s.children,l),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function Qi(e){e.flags|=4}function mf(e,n,l,s,f){var d;if((d=(e.mode&32)!==0)&&(d=l===null?Cy(n,s):Cy(n,s)&&(s.src!==l.src||s.srcSet!==l.srcSet)),d){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(zg())e.flags|=8192;else throw tr=po,Oc}else e.flags&=-16777217}function Wp(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ny(n))if(zg())e.flags|=8192;else throw tr=po,Oc}function Mo(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?ga():536870912,e.lanes|=n,Xr|=n)}function Ka(e,n){if(!Je)switch(e.tailMode){case"visible":break;case"collapsed":for(var l=e.tail,s=null;l!==null;)l.alternate!==null&&(s=l),l=l.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null;break;default:for(n=e.tail,l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?e.tail=null:l.sibling=null}}function Mt(e){var n=e.alternate!==null&&e.alternate.child===e.child,l=0,s=0;if(n)for(var f=e.child;f!==null;)l|=f.lanes|f.childLanes,s|=f.subtreeFlags&1206910976,s|=f.flags&1206910976,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)l|=f.lanes|f.childLanes,s|=f.subtreeFlags,s|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=s,e.childLanes=l,n}function hw(e,n,l){var s=n.pendingProps;switch(Sc(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(n),null;case 1:return Mt(n),null;case 3:return l=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Vi(Zt),bt(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(qr(n)?Qi(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Ec())),Mt(n),null;case 26:var f=n.type,d=n.memoizedState;return e===null?(Qi(n),d!==null?(Mt(n),Wp(n,d)):(Mt(n),mf(n,f,null,s,l))):d?d!==e.memoizedState?(Qi(n),Mt(n),Wp(n,d)):(Mt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Qi(n),Mt(n),mf(n,f,e,s,l)),null;case 27:if(Lt(n),l=vt.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Qi(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return Mt(n),n.subtreeFlags&=-33554433,null}e=Me.current,qr(n)?Rm(n):(e=by(f,s,l),n.stateNode=e,Qi(n))}return Mt(n),n.subtreeFlags&=-33554433,null;case 5:if(Lt(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Qi(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return Mt(n),n.subtreeFlags&=-33554433,null}if(d=Me.current,qr(n))Rm(n);else{var b=as(vt.current);switch(d){case 1:d=b.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:d=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":d=b.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":d=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);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(f,{is:s.is}):b.createElement(f)}}d[Qt]=n,d[en]=s;e:for(b=n.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===n)break e;for(;b.sibling===null;){if(b.return===null||b.return===n)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}n.stateNode=d;e:switch(pn(d,f,s),f){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Qi(n)}}return Mt(n),n.subtreeFlags&=-33554433,mf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,l),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Qi(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(a(166));if(e=vt.current,qr(n)){if(e=n.stateNode,l=n.memoizedProps,s=null,f=rn,f!==null)switch(f.tag){case 27:case 5:s=f.memoizedProps}e[Qt]=n,e=!!(e.nodeValue===l||s!==null&&s.suppressHydrationWarning===!0||Pg(e.nodeValue,l)),e||sl(n,!0)}else e=as(e).createTextNode(s),e[Qt]=n,n.stateNode=e}return Mt(n),null;case 31:if(l=n.memoizedState,e===null||e.memoizedState!==null){if(s=qr(n),l!==null){if(e===null){if(!s)throw Error(a(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[Qt]=n}else Zl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Mt(n),e=!1}else l=Ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return n.flags&256?(Ln(n),n):(Ln(n),null);if((n.flags&128)!==0)throw Error(a(558))}return Mt(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=qr(n),s!==null&&s.dehydrated!==null){if(e===null){if(!f)throw Error(a(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));f[Qt]=n}else Zl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Mt(n),f=!1}else f=Ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Ln(n),n):(Ln(n),null)}return Ln(n),(n.flags&128)!==0?(n.lanes=l,n):(l=s!==null,e=e!==null&&e.memoizedState!==null,l&&(s=n.child,f=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(f=s.alternate.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==f&&(s.flags|=2048)),l!==e&&l&&(n.child.flags|=8192),Mo(n,n.updateQueue),Mt(n),null);case 4:return bt(),e===null&&Kf(n.stateNode.containerInfo),n.flags|=67108864,Mt(n),null;case 10:return Vi(n.type),Mt(n),null;case 19:if(Bc(n),s=n.memoizedState,s===null)return Mt(n),null;if(f=(n.flags&128)!==0,d=s.rendering,d===null)if(f)Ka(s,!1);else{if(Vt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(d=bo(e),d!==null){for(n.flags|=128,Ka(s,!1),e=d.updateQueue,n.updateQueue=e,Mo(n,e),n.subtreeFlags=0,e=l,l=n.child;l!==null;)jm(l,e),l=l.sibling;return Fa(n,hn.current&1|2),Je&&Hi(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&qt()>Qo&&(n.flags|=128,f=!0,Ka(s,!1),n.lanes=4194304)}else{if(!f)if(e=bo(d),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,Mo(n,e),Ka(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!d.alternate&&!Je)return Mt(n),null}else 2*qt()-s.renderingStartTime>Qo&&l!==536870912&&(n.flags|=128,f=!0,Ka(s,!1),n.lanes=4194304);s.isBackwards?(d.sibling=n.child,n.child=d):(e=s.last,e!==null?e.sibling=d:n.child=d,s.last=d)}if(s.tail!==null){e=s.tail;e:{for(l=e;l!==null;){if(l.alternate!==null){l=!1;break e}l=l.sibling}l=!0}return s.rendering=e,s.tail=e.sibling,s.renderingStartTime=qt(),e.sibling=null,d=hn.current,d=f?d&1|2:d&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!l||Je?Fa(n,d):(l=d,Ie(dn,n),Ie(hn,l),wn===null&&(wn=n)),Je&&Hi(n,s.treeForkCount),e}return Mt(n),null;case 22:case 23:return Ln(n),Dc(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(l&536870912)!==0&&(n.flags&128)===0&&(Mt(n),n.subtreeFlags&6&&(n.flags|=8192)):Mt(n),l=n.updateQueue,l!==null&&Mo(n,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==l&&(n.flags|=2048),e!==null&&$e(Wl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Vi(Zt),Mt(n),null;case 25:return null;case 30:return n.flags|=33554432,Mt(n),null}throw Error(a(156,n.tag))}function mw(e,n){switch(Sc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Vi(Zt),bt(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Lt(n),null;case 31:if(n.memoizedState!==null){if(Ln(n),n.alternate===null)throw Error(a(340));Zl()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Ln(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(a(340));Zl()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Bc(n),e=n.flags,e&65536?(n.flags=e&-65537|128,e=n.memoizedState,e!==null&&(e.rendering=null,e.tail=null),n.flags|=4,n):null;case 4:return bt(),null;case 10:return Vi(n.type),null;case 22:case 23:return Ln(n),Dc(),e!==null&&$e(Wl),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Vi(Zt),null;case 25:return null;default:return null}}function eg(e,n){switch(Sc(n),n.tag){case 3:Vi(Zt),bt();break;case 26:case 27:case 5:Lt(n);break;case 4:bt();break;case 31:n.memoizedState!==null&&Ln(n);break;case 13:Ln(n);break;case 19:Bc(n);break;case 10:Vi(n.type);break;case 22:case 23:Ln(n),Dc(),e!==null&&$e(Wl);break;case 24:Vi(Zt)}}function $a(e,n){try{var l=n.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var f=s.next;l=f;do{if((l.tag&e)===e){s=void 0;var d=l.create,b=l.inst;s=d(),b.destroy=s}l=l.next}while(l!==f)}}catch(k){kt(n,n.return,k)}}function gl(e,n,l){try{var s=n.updateQueue,f=s!==null?s.lastEffect:null;if(f!==null){var d=f.next;s=d;do{if((s.tag&e)===e){var b=s.inst,k=b.destroy;if(k!==void 0){b.destroy=void 0,f=n;var R=l,H=k;try{H()}catch(Q){kt(f,R,Q)}}}s=s.next}while(s!==d)}}catch(Q){kt(n,n.return,Q)}}function tg(e){var n=e.updateQueue;if(n!==null){var l=e.stateNode;try{Fm(n,l)}catch(s){kt(e,e.return,s)}}}function ng(e,n,l){l.props=lr(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(s){kt(e,n,s)}}function bi(e,n){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:var f=e.stateNode,d=Li(e.memoizedProps,f);(f.ref===null||f.ref.name!==d)&&(f.ref=uy(d)),s=f.ref;break;case 7:if(e.stateNode===null){var b=new Vn(e);y(e.child,!1,lS,b,void 0,void 0),e.stateNode=b}s=e.stateNode;break;default:s=e.stateNode}typeof l=="function"?e.refCleanup=l(s):l.current=s}}catch(k){kt(e,n,k)}}function mn(e,n){var l=e.ref,s=e.refCleanup;if(l!==null)if(typeof s=="function")try{s()}catch(f){kt(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){kt(e,n,f)}else l.current=null}function qo(e,n){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&n!==null)for(var l=0;l<n.length;l++)py(e.stateNode,n[l])}function ig(e){for(var n=e.return;n!==null&&(gf(n)&&py(e.stateNode,n.stateNode),!pf(n));)n=n.return}function Ja(e){for(var n=e.return;n!==null&&(gf(n)&&rS(e.stateNode,n.stateNode),!pf(n));)n=n.return}function pf(e){return e.tag===5||e.tag===3||e.tag===27}function gf(e){return e&&e.tag===7&&e.stateNode!==null}function yf(e){var n=e.type,l=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&s.focus();break e;case"img":l.src?s.src=l.src:l.srcSet&&(s.srcset=l.srcSet)}}catch(f){kt(e,e.return,f)}}function vf(e,n,l){try{var s=e.stateNode;Hw(s,e.type,l,n),s[en]=n}catch(f){kt(e,e.return,f)}}function lg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&kl(e.type)||e.tag===4}function bf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lg(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&&kl(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 xf(e,n,l,s){var f=e.tag;if(f===5||f===6)f=e.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(f,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(f),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=xn)),qo(e,s),st=!0;else if(f!==4&&(f===27&&(qo(e,s),s=null,kl(e.type)&&(l=e.stateNode,n=null)),e=e.child,e!==null))for(xf(e,n,l,s),e=e.sibling;e!==null;)xf(e,n,l,s),e=e.sibling}function Do(e,n,l,s){var f=e.tag;if(f===5||f===6)f=e.stateNode,n?l.insertBefore(f,n):l.appendChild(f),qo(e,s),st=!0;else if(f!==4&&(f===27&&(qo(e,s),s=null,kl(e.type)&&(l=e.stateNode)),e=e.child,e!==null))for(Do(e,n,l,s),e=e.sibling;e!==null;)Do(e,n,l,s),e=e.sibling}function rg(e){var n=e.stateNode,l=e.memoizedProps;try{for(var s=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);pn(n,s,l),n[Qt]=e,n[en]=l}catch(d){kt(e,e.return,d)}}var Lo=!1,Bn=null;function ag(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Lo=!0)}var xi=null;function sg(){var e=xi;return xi=null,e}var Nn=0;function Yr(e,n,l,s,f){return Nn=0,og(e.child,n,l,s,f)}function og(e,n,l,s,f){for(var d=!1;e!==null;){if(e.tag===5){var b=e.stateNode;if(s!==null){var k=id(b);s.push(k),k.view&&(d=!0)}else d||id(b).view&&(d=!0);Lo=!0,sy(b,Nn===0?n:n+"_"+Nn,l),Nn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&f||og(e.child,n,l,s,f)&&(d=!0));e=e.sibling}return d}function wi(e,n){for(;e!==null;)e.tag===5?oy(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&n||wi(e.child,n)),e=e.sibling}function Bo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Bo(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var n=e.memoizedProps;if(n.name==null||n.name==="auto")throw Error(a(544));var l=n.name;n=Bi(n.default,n.share),n!=="none"&&(Yr(e,l,n,null,!1)||wi(e.child,!1))}e=e.sibling}}function wf(e,n){if(e.tag===30){var l=e.stateNode,s=e.memoizedProps,f=Li(s,l),d=Bi(s.default,l.paired?s.share:s.enter);d!=="none"?Yr(e,f,d,null,!1)?(Bo(e),l.paired||n||Jr(e,s.onEnter)):wi(e.child,!1):Bo(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)wf(e,n),e=e.sibling;else Bo(e)}function Sf(e){if(Bn!==null&&Bn.size!==0){var n=Bn;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 l=e.memoizedProps,s=l.name;if(s!=null&&s!=="auto"){var f=n.get(s);if(f!==void 0){var d=Bi(l.default,l.share);if(d!=="none"&&(Yr(e,s,d,null,!1)?(d=e.stateNode,f.paired=d,d.paired=f,Jr(e,l.onShare)):wi(e.child,!1)),n.delete(s),n.size===0)break}}}Sf(e)}e=e.sibling}}}function kf(e){if(e.tag===30){var n=e.memoizedProps,l=Li(n,e.stateNode),s=Bn!==null?Bn.get(l):void 0,f=Bi(n.default,s!==void 0?n.share:n.exit);f!=="none"&&(Yr(e,l,f,null,!1)?s!==void 0?(f=e.stateNode,s.paired=f,f.paired=s,Bn.delete(l),Jr(e,n.onShare)):Jr(e,n.onExit):wi(e.child,!1)),Bn!==null&&Sf(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)kf(e),e=e.sibling;else Bn!==null&&Sf(e)}function ug(e){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,l=Li(n,e.stateNode);n=Bi(n.default,n.update),e.flags&=-5,n!=="none"&&Yr(e,l,n,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&ug(e);e=e.sibling}}function Ef(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 n=e.stateNode;n.paired!==null&&(n.paired=null,wi(e.child,!1))}Ef(e)}e=e.sibling}}function Uo(e){if(e.tag===30)e.stateNode.paired=null,wi(e.child,!1),Ef(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Uo(e),e=e.sibling;else Ef(e)}function cg(e){for(e=e.child;e!==null;)e.tag===30?wi(e.child,!1):(e.subtreeFlags&33554432)!==0&&cg(e),e=e.sibling}function Tf(e,n,l,s,f,d,b){for(var k=!1;n!==null;){if(n.tag===5){var R=n.stateNode;if(d!==null&&Nn<d.length){var H=d[Nn],Q=id(R);(H.view||Q.view)&&(k=!0);var le;if(le=(e.flags&4)===0)if(Q.clip)le=!0;else{le=H.rect;var L=Q.rect;le=le.y!==L.y||le.x!==L.x||le.height!==L.height||le.width!==L.width}le&&(e.flags|=4),Q.abs?Q=!H.abs:(H=H.rect,Q=Q.rect,Q=H.height!==Q.height||H.width!==Q.width),Q&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&sy(R,Nn===0?l:l+"_"+Nn,f),k&&(e.flags&4)!==0||(xi===null&&(xi=[]),xi.push(R,Nn===0?s:s+"_"+Nn,n.memoizedProps)),Nn++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&b?e.flags|=n.flags&32:Tf(e,n.child,l,s,f,d,b)&&(k=!0));n=n.sibling}return k}function fg(e,n){for(e=e.child;e!==null;){if(e.tag===30){var l=e.memoizedProps,s=e.stateNode,f=Li(l,s),d=Bi(l.default,l.update),b;b=e.memoizedState,e.memoizedState=null,s=e;var k=e.child;Nn=0,f=Tf(s,k,f,f,d,b,!1),(e.flags&4)!==0&&f&&Jr(e,l.onUpdate)}else(e.subtreeFlags&33554432)!==0&&fg(e);e=e.sibling}}var an=!1,xt=!1,Si=!1,jf=!1,dg=typeof WeakSet=="function"?WeakSet:Set,sn=null,ki=!1,Pa=!1,Ho=!1,Cf=!1;function pw(e,n,l){if(e=e.containerInfo,Pf=sa,e=gm(e),dc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var f=s.getSelection&&s.getSelection();if(f&&f.rangeCount!==0){s=f.anchorNode;var d=f.anchorOffset,b=f.focusNode;f=f.focusOffset;try{s.nodeType,b.nodeType}catch{s=null;break e}var k=0,R=-1,H=-1,Q=0,le=0,L=e,F=null;t:for(;;){for(var ve;L!==s||d!==0&&L.nodeType!==3||(R=k+d),L!==b||f!==0&&L.nodeType!==3||(H=k+f),L.nodeType===3&&(k+=L.nodeValue.length),(ve=L.firstChild)!==null;)F=L,L=ve;for(;;){if(L===e)break t;if(F===s&&++Q===d&&(R=k),F===b&&++le===f&&(H=k),(ve=L.nextSibling)!==null)break;L=F,F=L.parentNode}L=ve}s=R===-1||H===-1?null:{start:R,end:H}}else s=null}s=s||{start:0,end:0}}else s=null;for(Wf={focusedElem:e,selectionRange:s},sa=!1,l=(l&335544064)===l,sn=n,n=l?9270:1024;sn!==null;){if(e=sn,l&&(s=e.deletions,s!==null))for(d=0;d<s.length;d++)l&&kf(s[d]);if(e.alternate===null&&(e.flags&2)!==0)l&&ag(e),Io(l);else{if(e.tag===22){if(s=e.alternate,e.memoizedState!==null){s!==null&&s.memoizedState===null&&l&&kf(s),Io(l);continue}else if(s!==null&&s.memoizedState!==null){l&&ag(e),Io(l);continue}}s=e.child,(e.subtreeFlags&n)!==0&&s!==null?(s.return=e,sn=s):(l&&ug(e),Io(l))}}Bn=null}function Io(e){for(;sn!==null;){var n=sn,l=e,s=n.alternate,f=n.flags;switch(n.tag){case 0:case 11:case 15:break;case 1:if((f&1024)!==0&&s!==null){l=void 0,f=s.memoizedProps,s=s.memoizedState;var d=n.stateNode;try{var b=lr(n.type,f);l=d.getSnapshotBeforeUpdate(b,s),d.__reactInternalSnapshotBeforeUpdate=l}catch(k){kt(n,n.return,k)}}break;case 3:if((f&1024)!==0){if(s=n.stateNode.containerInfo,l=s.nodeType,l===9)ad(s);else if(l===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":ad(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:l&&s!==null&&(l=Li(s.memoizedProps,s.stateNode),f=n.memoizedProps,f=Bi(f.default,f.update),f!=="none"&&Yr(s,l,f,s.memoizedState=[],!0));break;default:if((f&1024)!==0)throw Error(a(163))}if(s=n.sibling,s!==null){s.return=n.return,sn=s;break}sn=n.return}}function hg(e,n,l){var s=l.flags;switch(l.tag){case 0:case 11:case 15:Ei(e,l),s&4&&$a(5,l);break;case 1:if(Ei(e,l),s&4)if(e=l.stateNode,n===null)try{e.componentDidMount()}catch(b){kt(l,l.return,b)}else{var f=lr(l.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(b){kt(l,l.return,b)}}s&64&&tg(l),s&512&&bi(l,l.return);break;case 3:if(Ei(e,l),s&64&&(e=l.updateQueue,e!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{Fm(e,n)}catch(b){kt(l,l.return,b)}}break;case 27:n===null&&s&4&&rg(l);case 26:case 5:Ei(e,l),n===null&&s&4&&yf(l),s&512&&bi(l,l.return);break;case 12:Ei(e,l);break;case 31:Ei(e,l),s&4&&yg(e,l);break;case 13:Ei(e,l),s&4&&vg(e,l),s&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Cw.bind(null,l),oS(e,l))));break;case 22:if(s=l.memoizedState!==null||an,!s){var d=n!==null&&n.memoizedState!==null||xt;n=an,f=xt,an=s,(xt=d)&&!f?(s=2,(l.subtreeFlags&8772)!==0&&(s|=1),si(e,l,s)):Ei(e,l),an=n,xt=f}break;case 30:Ei(e,l),s&512&&bi(l,l.return);break;case 7:s&512&&bi(l,l.return);default:Ei(e,l)}}function Nf(e,n){for(e=e.child;e!==null;)mg(e,n),e=e.sibling}function mg(e,n){switch(e.tag){case 5:case 26:try{var l=e.stateNode;if(n){var s=l.style;typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"}else{var f=e.stateNode,d=e.memoizedProps.style,b=d!=null&&d.hasOwnProperty("display")?d.display:null;f.style.display=b==null||typeof b=="boolean"?"":(""+b).trim()}}catch(R){kt(e,e.return,R)}Af(e,n);break;case 6:try{e.stateNode.nodeValue=n?"":e.memoizedProps,st=!0}catch(R){kt(e,e.return,R)}break;case 18:try{var k=e.stateNode;n?ay(k,!0):ay(e.stateNode,!1)}catch(R){kt(e,e.return,R)}break;case 22:case 23:e.memoizedState===null&&Nf(e,n);break;default:Nf(e,n)}}function Af(e,n){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var l=e,s=n;switch(l.tag){case 4:mg(l,s);break e;case 22:l.memoizedState===null&&Af(l,s);break e;default:Af(l,s)}}e=e.sibling}}function pg(e){var n=e.alternate;n!==null&&(e.alternate=null,pg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Mi(n)),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 Dt=null,An=!1;function ri(e,n,l){for(l=l.child;l!==null;)gg(e,n,l),l=l.sibling}function gg(e,n,l){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(_t,l)}catch{}switch(l.tag){case 26:xt||mn(l,n),ri(e,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&!xt&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:xt||mn(l,n),Ja(l);var s=Dt,f=An;kl(l.type)&&(Dt=l.stateNode,An=!1),ri(e,n,l),xy(l.stateNode,l.type,l.memoizedProps),Dt=s,An=f;break;case 5:xt||mn(l,n),Ja(l);case 6:if(l.tag===6&&Ja(l),s=Dt,f=An,Dt=null,ri(e,n,l),Dt=s,An=f,Dt!==null)if(An)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(l.stateNode),st=!0}catch(d){kt(l,n,d)}else try{Dt.removeChild(l.stateNode),st=!0}catch(d){kt(l,n,d)}break;case 18:Dt!==null&&(An?(e=Dt,ry(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),oa(e)):ry(Dt,l.stateNode));break;case 4:s=Dt,f=An,Dt=l.stateNode.containerInfo,An=!0,ri(e,n,l),Dt=s,An=f;break;case 0:case 11:case 14:case 15:gl(2,l,n),xt||gl(4,l,n),ri(e,n,l);break;case 1:xt||(mn(l,n),s=l.stateNode,typeof s.componentWillUnmount=="function"&&ng(l,n,s)),ri(e,n,l);break;case 21:ri(e,n,l);break;case 22:xt=(s=xt)||l.memoizedState!==null,ri(e,n,l),xt=s;break;case 30:mn(l,n),ri(e,n,l);break;case 7:xt||mn(l,n),ri(e,n,l);break;default:ri(e,n,l)}}function yg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{oa(e)}catch(l){kt(n,n.return,l)}}}function vg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{oa(e)}catch(l){kt(n,n.return,l)}}function gw(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new dg),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new dg),n;default:throw Error(a(435,e.tag))}}function Vo(e,n){var l=gw(e);n.forEach(function(s){if(!l.has(s)){l.add(s);var f=Nw.bind(null,e,s);s.then(f,f)}})}function Tn(e,n,l){var s=n.deletions;if(s!==null)for(var f=0;f<s.length;f++){var d=s[f],b=e,k=n,R=k;e:for(;R!==null;){switch(R.tag){case 27:if(kl(R.type)){Dt=R.stateNode,An=!1;break e}break;case 5:Dt=R.stateNode,An=!1;break e;case 3:case 4:Dt=R.stateNode.containerInfo,An=!0;break e}R=R.return}if(Dt===null)throw Error(a(160));gg(b,k,d),Dt=null,An=!1,b=d.alternate,b!==null&&(b.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)bg(n,e,l),n=n.sibling}var ai=null;function bg(e,n,l){var s=e.alternate,f=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(f&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}Tn(n,e,l),jn(e),f&4&&(gl(3,e,e.return),$a(3,e),gl(5,e,e.return));break;case 1:Tn(n,e,l),jn(e),f&512&&(xt||s===null||mn(s,s.return)),f&64&&an&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?n:l.concat(n))));break;case 26:if(d=ai,Tn(n,e,l),jn(e),f&512&&(xt||s===null||mn(s,s.return)),f&4)if(f=s!==null?s.memoizedState:null,l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null)if(an)e.stateNode=ny(e.type,e.memoizedProps,n.containerInfo,e);else{e:{n=e.type,l=e.memoizedProps,f=d.ownerDocument||d;t:switch(n){case"title":s=f.getElementsByTagName("title")[0],(!s||s[Il]||s[Qt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=f.createElement(n),f.head.insertBefore(s,f.querySelector("head > title"))),pn(s,n,l),s[Qt]=e,Xt(s),n=s;break e;case"link":if(d=jy("link","href",f).get(n+(l.href||""))){for(b=0;b<d.length;b++)if(s=d[b],s.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&s.getAttribute("rel")===(l.rel==null?null:l.rel)&&s.getAttribute("title")===(l.title==null?null:l.title)&&s.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){d.splice(b,1);break t}}s=f.createElement(n),pn(s,n,l),f.head.appendChild(s);break;case"meta":if(d=jy("meta","content",f).get(n+(l.content||""))){for(b=0;b<d.length;b++)if(s=d[b],s.getAttribute("content")===(l.content==null?null:""+l.content)&&s.getAttribute("name")===(l.name==null?null:l.name)&&s.getAttribute("property")===(l.property==null?null:l.property)&&s.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&s.getAttribute("charset")===(l.charSet==null?null:l.charSet)){d.splice(b,1);break t}}s=f.createElement(n),pn(s,n,l),f.head.appendChild(s);break;default:throw Error(a(468,n))}s[Qt]=e,Xt(s),n=s}e.stateNode=n}else an||hd(d,e.type,e.stateNode);else e.stateNode=Ty(d,l,e.memoizedProps);else f!==l?(f===null?(n=s.stateNode,n===null||xt||n.parentNode.removeChild(n)):f.count--,l===null?an||hd(d,e.type,e.stateNode):Ty(d,l,e.memoizedProps)):l===null&&e.stateNode!==null&&vf(e,e.memoizedProps,s.memoizedProps);break;case 27:Tn(n,e,l),jn(e),f&512&&(xt||s===null||mn(s,s.return)),s!==null&&f&4&&vf(e,e.memoizedProps,s.memoizedProps);break;case 5:if(d=Si,Si=!1,Tn(n,e,l),Si=d,jn(e),f&512&&(xt||s===null||mn(s,s.return)),e.flags&32){n=e.stateNode;try{nl(n,""),st=!0}catch(Q){kt(e,e.return,Q)}}f&4&&e.stateNode!=null&&(n=e.memoizedProps,vf(e,n,s!==null?s.memoizedProps:n)),f&1024&&(jf=!0);break;case 6:if(Tn(n,e,l),jn(e),f&4){if(e.stateNode===null)throw Error(a(162));n=e.memoizedProps,l=e.stateNode;try{l.nodeValue=n,st=!0}catch(Q){kt(e,e.return,Q)}}break;case 3:if(st=!1,iu=null,d=ai,ai=ss(n.containerInfo),Tn(n,e,l),ai=d,jn(e),f&4&&s!==null&&s.memoizedState.isDehydrated)try{oa(n.containerInfo)}catch(Q){kt(e,e.return,Q)}jf&&(jf=!1,xg(e)),st=!1;break;case 4:f=Si,Si=an,s=ti(),d=ai,ai=ss(e.stateNode.containerInfo),Tn(n,e,l),jn(e),ai=d,st&&Pa&&(Ho=!0),st=s,Si=f;break;case 12:Tn(n,e,l),jn(e);break;case 31:Tn(n,e,l),jn(e),f&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Vo(e,n)));break;case 13:Tn(n,e,l),jn(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Go=qt()),f&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Vo(e,n)));break;case 22:d=e.memoizedState!==null,b=s!==null&&s.memoizedState!==null;var k=an,R=xt,H=Si;an=k||d,Si=H||d,xt=R||b,Tn(n,e,l),xt=R,Si=H,an=k,jn(e),f&8192&&(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,!d||s===null||b||an||xt||(n=b||xt,l=an,s=xt,an=d||an,xt=n,yl(e,2),an=l,xt=s),!d&&Si||Nf(e,d)),f&4&&(n=e.updateQueue,n!==null&&(l=n.retryQueue,l!==null&&(n.retryQueue=null,Vo(e,l))));break;case 19:Tn(n,e,l),jn(e),f&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Vo(e,n)));break;case 30:f&512&&(xt||s===null||mn(s,s.return)),f=ti(),d=Pa,b=(l&335544064)===l,k=e.memoizedProps,Pa=b&&Bi(k.default,k.update)!=="none",Tn(n,e,l),jn(e),b&&s!==null&&st&&(e.flags|=4),Pa=d,st=f;break;case 21:break;case 7:f&512&&(xt||s===null||mn(s,s.return)),s&&s.stateNode!==null&&(s.stateNode._fragmentFiber=e);default:Tn(n,e,l),jn(e)}}function jn(e){var n=e.flags;if(n&2){try{for(var l,s=e.return;s!==null;){if(lg(s)){l=s;break}s=s.return}s=null;for(var f=e.return;f!==null;){if(gf(f)){var d=f.stateNode;s===null?s=[d]:s.push(d)}if(pf(f))break;f=f.return}var b=s;if(l==null)throw Error(a(160));switch(l.tag){case 27:var k=l.stateNode,R=bf(e);Do(e,R,k,b);break;case 5:var H=l.stateNode;l.flags&32&&(nl(H,""),l.flags&=-33);var Q=bf(e);Do(e,Q,H,b);break;case 3:case 4:var le=l.stateNode.containerInfo,L=bf(e);xf(e,L,le,b);break;default:throw Error(a(161))}}catch(F){kt(e,e.return,F)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function xg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;xg(n),n.tag===5&&n.flags&1024&&(n=n.stateNode,sa=!0,n.reset(),sa=!1),e=e.sibling}}function Fr(e,n){if(n.subtreeFlags&9270)for(n=n.child;n!==null;)wg(n,e),n=n.sibling;else fg(n)}function wg(e,n){var l=e.alternate;if(l===null)wf(e,!1);else switch(e.tag){case 3:if(Cf=ki=!1,sg(),Fr(n,e),!ki&&!Ho){if(e=xi,e!==null)for(var s=0;s<e.length;s+=3){l=e[s];var f=e[s+1];oy(l,e[s+2]),l=l.ownerDocument.documentElement,l!==null&&l.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+f+")"})}e=n.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"})),Cf=!0}xi=null;break;case 5:Fr(n,e);break;case 4:s=ki,ki=!1,Fr(n,e),ki&&(Ho=!0),ki=s;break;case 22:e.memoizedState===null&&(l.memoizedState!==null?wf(e,!1):Fr(n,e));break;case 30:s=ki,f=sg(),ki=!1,Fr(n,e),ki&&(e.flags|=4);var d=e.memoizedProps,b=e.stateNode;n=Li(d,b),b=Li(l.memoizedProps,b);var k=Bi(d.default,d.update);k==="none"?n=!1:(d=l.memoizedState,l.memoizedState=null,l=e.child,Nn=0,n=Tf(e,l,n,b,k,d,!0),Nn!==(d===null?0:d.length)&&(e.flags|=32)),(e.flags&4)!==0&&n?(Jr(e,e.memoizedProps.onUpdate),xi=f):f!==null&&(f.push.apply(f,xi),xi=f),ki=(e.flags&32)!==0?!0:s;break;default:Fr(n,e)}}function Ei(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)hg(e,n.alternate,n),n=n.sibling}function yl(e,n){for(e=e.child;e!==null;){var l=e,s=n;switch(l.tag){case 0:case 11:case 14:case 15:gl(4,l,l.return),yl(l,s);break;case 1:mn(l,l.return);var f=l.stateNode;typeof f.componentWillUnmount=="function"&&ng(l,l.return,f),yl(l,s);break;case 27:(s&2)!==0&&xy(l.stateNode,l.type,l.memoizedProps);case 5:mn(l,l.return),l.tag!==5&&l.tag!==27||Ja(l),yl(l,s);break;case 6:Ja(l);break;case 26:mn(l,l.return),f=l.stateNode,l.memoizedState!==null||f===null||xt||f.parentNode.removeChild(f),yl(l,s);break;case 22:l.memoizedState===null&&yl(l,s);break;case 30:mn(l,l.return),yl(l,s);break;case 7:mn(l,l.return);default:yl(l,s)}e=e.sibling}}function si(e,n,l){for(l=(n.subtreeFlags&8772)!==0?l:l&-2,n=n.child;n!==null;){var s=n.alternate,f=e,d=n,b=d.flags,k=(l&1)!==0;switch(d.tag){case 0:case 11:case 15:si(f,d,l),$a(4,d);break;case 1:if(si(f,d,l),s=d,f=s.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(Q){kt(s,s.return,Q)}if(s=d,f=s.updateQueue,f!==null){var R=s.stateNode;try{var H=f.shared.hiddenCallbacks;if(H!==null)for(f.shared.hiddenCallbacks=null,f=0;f<H.length;f++)Ym(H[f],R)}catch(Q){kt(s,s.return,Q)}}k&&b&64&&tg(d),bi(d,d.return);break;case 27:(l&2)!==0&&rg(d);case 5:d.tag!==5&&d.tag!==27||ig(d),si(f,d,l),k&&s===null&&b&4&&yf(d),bi(d,d.return);break;case 6:ig(d);break;case 26:R=d.stateNode,d.memoizedState!==null||R===null||an||hd(ss(R.ownerDocument),d.type,R),si(f,d,l),k&&s===null&&b&4&&yf(d),bi(d,d.return);break;case 12:si(f,d,l);break;case 31:si(f,d,l),k&&b&4&&yg(f,d);break;case 13:si(f,d,l),k&&b&4&&vg(f,d);break;case 22:d.memoizedState===null&&si(f,d,l),bi(d,d.return);break;case 30:si(f,d,l),bi(d,d.return);break;case 7:bi(d,d.return);default:si(f,d,l)}n=n.sibling}}function Of(e,n){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&La(l))}function Rf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&La(e))}function Jn(e,n,l,s){var f=(l&335544064)===l;if(n.subtreeFlags&(f?10262:10256))for(n=n.child;n!==null;)Sg(e,n,l,s),n=n.sibling;else f&&cg(n)}function Sg(e,n,l,s){var f=(l&335544064)===l;f&&n.alternate===null&&n.return!==null&&n.return.alternate!==null&&Uo(n);var d=n.flags;switch(n.tag){case 0:case 11:case 15:Jn(e,n,l,s),d&2048&&$a(9,n);break;case 1:Jn(e,n,l,s);break;case 3:Jn(e,n,l,s),f&&Cf&&(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,n.alternate!==null&&(d=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==d&&(n.refCount++,d!=null&&La(d)));break;case 12:if(d&2048){Jn(e,n,l,s),d=n.stateNode;try{var b=n.memoizedProps,k=b.id,R=b.onPostCommit;typeof R=="function"&&R(k,n.alternate===null?"mount":"update",d.passiveEffectDuration,-0)}catch(H){kt(n,n.return,H)}}else Jn(e,n,l,s);break;case 31:Jn(e,n,l,s);break;case 13:Jn(e,n,l,s);break;case 23:break;case 22:b=n.stateNode,k=n.alternate,n.memoizedState!==null?(f&&k!==null&&k.memoizedState===null&&Uo(k),b._visibility&2?Jn(e,n,l,s):Wa(e,n)):(f&&k!==null&&k.memoizedState!==null&&Uo(n),b._visibility&2?Jn(e,n,l,s):(b._visibility|=2,Gr(e,n,l,s,(n.subtreeFlags&10256)!==0||!1))),d&2048&&Of(k,n);break;case 24:Jn(e,n,l,s),d&2048&&Rf(n.alternate,n);break;case 30:f&&(d=n.alternate,d!==null&&(wi(d.child,!0),wi(n.child,!0))),Jn(e,n,l,s);break;default:Jn(e,n,l,s)}}function Gr(e,n,l,s,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var d=e,b=n,k=l,R=s,H=b.flags;switch(b.tag){case 0:case 11:case 15:Gr(d,b,k,R,f),$a(8,b);break;case 23:break;case 22:var Q=b.stateNode;b.memoizedState!==null?Q._visibility&2?Gr(d,b,k,R,f):Wa(d,b):(Q._visibility|=2,Gr(d,b,k,R,f)),f&&H&2048&&Of(b.alternate,b);break;case 24:Gr(d,b,k,R,f),f&&H&2048&&Rf(b.alternate,b);break;default:Gr(d,b,k,R,f)}n=n.sibling}}function Wa(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=e,s=n,f=s.flags;switch(s.tag){case 22:Wa(l,s),f&2048&&Of(s.alternate,s);break;case 24:Wa(l,s),f&2048&&Rf(s.alternate,s);break;default:Wa(l,s)}n=n.sibling}}var rr=8192;function ar(e,n,l){if(e.subtreeFlags&rr)for(e=e.child;e!==null;)kg(e,n,l),e=e.sibling}function kg(e,n,l){switch(e.tag){case 26:ar(e,n,l),e.flags&rr&&(e.memoizedState!==null?SS(l,ai,e.memoizedState,e.memoizedProps):(e=e.stateNode,(n&335544128)===n&&Oy(l,e)));break;case 5:ar(e,n,l),e.flags&rr&&(e=e.stateNode,(n&335544128)===n&&Oy(l,e));break;case 3:case 4:var s=ai;ai=ss(e.stateNode.containerInfo),ar(e,n,l),ai=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=rr,rr=16777216,ar(e,n,l),rr=s):ar(e,n,l));break;case 30:if((e.flags&rr)!==0&&(s=e.memoizedProps.name,s!=null&&s!=="auto")){var f=e.stateNode;f.paired=null,Bn===null&&(Bn=new Map),Bn.set(s,f)}ar(e,n,l);break;default:ar(e,n,l)}}function Eg(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function es(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];sn=s,jg(s,e)}Eg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Tg(e),e=e.sibling}function Tg(e){switch(e.tag){case 0:case 11:case 15:es(e),e.flags&2048&&gl(9,e,e.return);break;case 3:es(e);break;case 12:es(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Yo(e)):es(e);break;default:es(e)}}function Yo(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];sn=s,jg(s,e)}Eg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:gl(8,n,n.return),Yo(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,Yo(n));break;default:Yo(n)}e=e.sibling}}function jg(e,n){for(;sn!==null;){var l=sn;switch(l.tag){case 0:case 11:case 15:gl(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var s=l.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:La(l.memoizedState.cache)}if(s=l.child,s!==null)s.return=l,sn=s;else e:for(l=e;sn!==null;){s=sn;var f=s.sibling,d=s.return;if(pg(s),s===l){sn=null;break e}if(f!==null){f.return=d,sn=f;break e}sn=d}}}var yw={getCacheForType:function(e){var n=fn(Zt),l=n.data.get(e);return l===void 0&&(l=e(),n.data.set(e,l)),l},cacheSignal:function(){return fn(Zt).controller.signal}},vw=typeof WeakMap=="function"?WeakMap:Map,yt=0,Nt=null,nt=null,rt=0,St=0,Un=null,vl=!1,Qr=!1,_f=!1,Xi=0,Vt=0,bl=0,sr=0,Fo=0,Hn=0,Xr=0,ts=null,On=null,zf=!1,Go=0,Cg=0,Qo=1/0,Xo=null,xl=null,Bt=0,oi=null,or=null,Ti=0,Mf=0,qf=null,Ng=null,Zr=null,Kr=null,$r=null,ns=0,Zo=null;function In(){return(yt&2)!==0&&rt!==0?rt&-rt:P.T!==null?Gf():Ul()}function Ag(){if(Hn===0)if((rt&536870912)===0||Je){var e=zi;zi<<=1,(zi&3932160)===0&&(zi=262144),Hn=e}else Hn=536870912;return e=dn.current,e!==null&&(e.flags|=32),Hn}function Jr(e,n){if(n!=null){var l=e.stateNode,s=l.ref;s===null&&(s=l.ref=uy(Li(e.memoizedProps,l))),Kr===null&&(Kr=[]),Kr.push(n.bind(null,s))}}function Rn(e,n,l){(e===Nt&&(St===2||St===9)||e.cancelPendingCommit!==null)&&(Pr(e,0),wl(e,rt,Hn,!1)),$i(e,l),((yt&2)===0||e!==Nt)&&(e===Nt&&((yt&2)===0&&(sr|=l),Vt===4&&wl(e,rt,Hn,!1)),ji(e))}function Og(e,n,l){if((yt&6)!==0)throw Error(a(327));var s=!l&&(n&127)===0&&(n&e.expiredLanes)===0||ql(e,n),f=s?ww(e,n):Lf(e,n,!0),d=s;do{if(f===0){Qr&&!s&&wl(e,n,0,!1);break}else{if(l=e.current.alternate,d&&!bw(l)){f=Lf(e,n,!1),d=!1;continue}if(f===2){if(d=n,e.errorRecoveryDisabledLanes&d)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){n=b;e:{var k=e;f=ts;var R=k.current.memoizedState.isDehydrated;if(R&&(Pr(k,b).flags|=256),b=Lf(k,b,!1),b!==2&&b!==6){if(_f&&!R){k.errorRecoveryDisabledLanes|=d,sr|=d,f=4;break e}d=On,On=f,d!==null&&(On===null?On=d:On.push.apply(On,d))}f=b}if(d=!1,f!==2)continue}}if(f===1){Pr(e,0),wl(e,n,0,!0);break}e:{switch(s=e,d=f,d){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n&&(n&62914560)!==n)break;case 6:wl(s,n,Hn,!vl);break e;case 2:On=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(f=Go+300-qt(),10<f)){if(wl(s,n,Hn,!vl),Ml(s,0,!0)!==0)break e;Ti=n,s.timeoutHandle=nd(Rg.bind(null,s,l,On,Xo,zf,n,Hn,sr,Xr,vl,d,"Throttled",-0,0),f);break e}Rg(s,l,On,Xo,zf,n,Hn,sr,Xr,vl,d,null,-0,0)}}break}while(!0);ji(e)}function Rg(e,n,l,s,f,d,b,k,R,H,Q,le,L,F){e.timeoutHandle=-1;var ve=n.subtreeFlags,Ae=(d&335544064)===d;if(le=null,(Ae||ve&8192||(ve&16785408)===16785408)&&(le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xn},Bn=null,kg(n,d,le),Ae&&(ve=le,Ae=e.containerInfo,Ae=(Ae.nodeType===9?Ae:Ae.ownerDocument).__reactViewTransition,Ae!=null&&(ve.count++,ve.waitingForViewTransition=!0,ve=cs.bind(ve),Ae.finished.then(ve,ve))),ve=(d&62914560)===d?Go-qt():(d&4194048)===d?Cg-qt():0,ve=kS(le,ve),ve!==null)){Ti=d,e.cancelPendingCommit=ve(Ug.bind(null,e,n,d,l,s,f,b,k,R,H,Q,le,null,L,F)),wl(e,d,b,!H);return}Ug(e,n,d,l,s,f,b,k,R,H,Q,le)}function bw(e){for(var n=e;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var s=0;s<l.length;s++){var f=l[s],d=f.getSnapshot;f=f.value;try{if(!Dn(d(),f))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function wl(e,n,l,s){n=Dl(e,n),n&=~Fo,n&=~sr,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var f=n;0<f;){var d=31-Ut(f),b=1<<d;s[d]=-1,f&=~b}l!==0&&xr(e,l,n)}function Ko(){return(yt&6)===0?(is(0),!1):!0}function Df(){if(nt!==null){if(St===0)var e=nt.return;else e=nt,Ii=Kl=null,Yc(e),Br=null,Ha=0,e=nt;for(;e!==null;)eg(e.alternate,e),e=e.return;nt=null}}function Pr(e,n){var l=e.timeoutHandle;return l!==-1&&(e.timeoutHandle=-1,Yw(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Ti=0,Df(),Nt=e,nt=l=Ui(e.current,null),rt=n,St=0,Un=null,vl=!1,Qr=ql(e,n),_f=!1,Xr=Hn=Fo=sr=bl=Vt=0,On=ts=null,zf=!1,Xi=Dl(e,n),no(),l}function _g(e,n){Ve=null,P.H=No,n===Lr||n===mo?(n=Um(),St=3):n===Oc?(n=Um(),St=4):St=n===rf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Un=n,nt===null&&(Vt=1,Ao(e,Xn(n,e.current)))}function zg(){var e=dn.current;return e===null?!0:(rt&4194048)===rt?wn===null:(rt&62914560)===rt||(rt&536870912)!==0?e===wn:!1}function Mg(){var e=P.H;return P.H=No,e===null?No:e}function qg(){var e=P.A;return P.A=yw,e}function $o(){Vt=4,vl||(rt&4194048)!==rt&&dn.current!==null||(Qr=!0),(bl&134217727)===0&&(sr&134217727)===0||Nt===null||wl(Nt,rt,Hn,!1)}function Lf(e,n,l){var s=yt;yt|=2;var f=Mg(),d=qg();(Nt!==e||rt!==n)&&(Xo=null,Pr(e,n)),n=!1;var b=Vt;e:do try{if(St!==0&&nt!==null){var k=nt,R=Un;switch(St){case 8:Df(),b=6;break e;case 3:case 2:case 9:case 6:dn.current===null&&(n=!0);var H=St;if(St=0,Un=null,Wr(e,k,R,H),l&&Qr){b=0;break e}break;default:H=St,St=0,Un=null,Wr(e,k,R,H)}}xw(),b=Vt;break}catch(Q){_g(e,Q)}while(!0);return n&&e.shellSuspendCounter++,Ii=Kl=null,yt=s,P.H=f,P.A=d,nt===null&&(Nt=null,rt=0,no()),b}function xw(){for(;nt!==null;)Dg(nt)}function ww(e,n){var l=yt;yt|=2;var s=Mg(),f=qg();Nt!==e||rt!==n?(Xo=null,Qo=qt()+500,Pr(e,n)):Qr=ql(e,n);e:do try{if(St!==0&&nt!==null){n=nt;var d=Un;t:switch(St){case 1:St=0,Un=null,Wr(e,n,d,1);break;case 2:case 9:if(Lm(d)){St=0,Un=null,Lg(n);break}n=function(){St!==2&&St!==9||Nt!==e||(St=7),ji(e)},d.then(n,n);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:Lm(d)?(St=0,Un=null,Lg(n)):(St=0,Un=null,Wr(e,n,d,7));break;case 5:var b=null;switch(nt.tag){case 26:b=nt.memoizedState;case 5:case 27:var k=nt;if(b?Ny(b):k.stateNode.complete){St=0,Un=null;var R=k.sibling;if(R!==null)nt=R;else{var H=k.return;H!==null?(nt=H,Jo(H)):nt=null}break t}}St=0,Un=null,Wr(e,n,d,5);break;case 6:St=0,Un=null,Wr(e,n,d,6);break;case 8:Df(),Vt=6;break e;default:throw Error(a(462))}}Sw();break}catch(Q){_g(e,Q)}while(!0);return Ii=Kl=null,P.H=s,P.A=f,yt=l,nt!==null?0:(Nt=null,rt=0,no(),Vt)}function Sw(){for(;nt!==null&&!Sn();)Dg(nt)}function Dg(e){var n=Pp(e.alternate,e,Xi);e.memoizedProps=e.pendingProps,n===null?Jo(e):nt=n}function Lg(e){var n=e,l=n.alternate;switch(n.tag){case 15:case 0:n=Gp(l,n,n.pendingProps,n.type,void 0,rt);break;case 11:n=Gp(l,n,n.pendingProps,n.type.render,n.ref,rt);break;case 5:Yc(n);var s=n;s===rn&&(Je?(oo(s),s.tag===5&&s.stateNode!=null&&(zt=s.stateNode)):(oo(s),Je=!0));default:eg(l,n),n=nt=jm(n,Xi),n=Pp(l,n,Xi)}e.memoizedProps=e.pendingProps,n===null?Jo(e):nt=n}function Wr(e,n,l,s){Ii=Kl=null,Yc(n),Br=null,Ha=0;var f=n.return;try{if(uw(e,f,n,l,rt)){Vt=1,Ao(e,Xn(l,e.current)),nt=null;return}}catch(d){if(f!==null)throw nt=f,d;Vt=1,Ao(e,Xn(l,e.current)),nt=null;return}n.flags&32768?(Je||s===1?e=!0:Qr||(rt&536870912)!==0?e=!1:(vl=e=!0,(s===2||s===9||s===3||s===6)&&(s=dn.current,s!==null&&s.tag===13&&(s.flags|=16384))),Bg(n,e)):Jo(n)}function Jo(e){var n=e;do{if((n.flags&32768)!==0){Bg(n,vl);return}e=n.return;var l=hw(n.alternate,n,Xi);if(l!==null){nt=l;return}if(n=n.sibling,n!==null){nt=n;return}nt=n=e}while(n!==null);Vt===0&&(Vt=5)}function Bg(e,n){do{var l=mw(e.alternate,e);if(l!==null){l.flags&=32767,nt=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(e=e.sibling,e!==null)){nt=e;return}nt=e=l}while(e!==null);Vt=6,nt=null}function Ug(e,n,l,s,f,d,b,k,R,H,Q,le){e.cancelPendingCommit=null;do Po();while(Bt!==0);if((yt&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));e===Nt&&(nt=Nt=null,rt=0),or=n,oi=e,Ti=l,qf=f,Ng=s,kw(e,n,l,b,k,R,le)}}function kw(e,n,l,s,f,d,b){var k=n.lanes|n.childLanes;if(Mf=k,k|=yc,Ys(e,l,k,s,f,d),Kr=null,(l&335544064)===l?($r=J1(e),s=10262):($r=null,s=10256),(n.subtreeFlags&s)!==0||(n.flags&s)!==0?(e.callbackNode=null,e.callbackPriority=0,Aw(Fn,function(){return If(),null})):(e.callbackNode=null,e.callbackPriority=0),Lo=!1,s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=P.T,P.T=null,f=ye.p,ye.p=2,d=yt,yt|=4;try{pw(e,n,l)}finally{yt=d,ye.p=f,P.T=s}}Bt=1,Lo?Zr=Kw(b,e.containerInfo,$r,Bf,Uf,Tw,Hf,If,Ew):(Bf(),Uf(),Hf())}function Ew(e){if(Bt!==0){var n=oi.onRecoverableError;n(e,{componentStack:null})}}function Tw(){Bt===3&&(Bt=0,wg(or,oi),Bt=4)}function Bf(){if(Bt===1){Bt=0;var e=oi,n=or,l=Ti,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=P.T,P.T=null;var f=ye.p;ye.p=2;var d=yt;yt|=4;try{Pa=Ho=!1,bg(n,e,l),l=Wf;var b=gm(e.containerInfo),k=l.focusedElem,R=l.selectionRange;if(b!==k&&k&&k.ownerDocument&&pm(k.ownerDocument.documentElement,k)){if(R!==null&&dc(k)){var H=R.start,Q=R.end;if(Q===void 0&&(Q=H),"selectionStart"in k)k.selectionStart=H,k.selectionEnd=Math.min(Q,k.value.length);else{var le=k.ownerDocument||document,L=le&&le.defaultView||window;if(L.getSelection){var F=L.getSelection(),ve=k.textContent.length,Ae=Math.min(R.start,ve),Ye=R.end===void 0?Ae:Math.min(R.end,ve);!F.extend&&Ae>Ye&&(b=Ye,Ye=Ae,Ae=b);var U=mm(k,Ae),D=mm(k,Ye);if(U&&D&&(F.rangeCount!==1||F.anchorNode!==U.node||F.anchorOffset!==U.offset||F.focusNode!==D.node||F.focusOffset!==D.offset)){var V=le.createRange();V.setStart(U.node,U.offset),F.removeAllRanges(),Ae>Ye?(F.addRange(V),F.extend(D.node,D.offset)):(V.setEnd(D.node,D.offset),F.addRange(V))}}}}for(le=[],F=k;F=F.parentNode;)F.nodeType===1&&le.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<le.length;k++){var ie=le[k];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}sa=!!Pf,Wf=Pf=null}finally{yt=d,ye.p=f,P.T=s}}e.current=n,Bt=2}}function Uf(){if(Bt===2){Bt=0;var e=oi,n=or,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=P.T,P.T=null;var s=ye.p;ye.p=2;var f=yt;yt|=4;try{hg(e,n.alternate,n)}finally{yt=f,ye.p=s,P.T=l}}Bt=3}}function Hf(){if(Bt===4||Bt===3){Bt=0;var e=Zr;Zr=null,Ri();var n=oi,l=or,s=Ti,f=Ng,d=(s&335544064)===s?10262:10256;if((l.subtreeFlags&d)!==0||(l.flags&d)!==0?Bt=5:(Bt=0,or=oi=null,Hg(n,n.pendingLanes)),d=n.pendingLanes,d===0&&(xl=null),Sr(s),l=l.stateNode,ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(_t,l,void 0,(l.current.flags&128)===128)}catch{}if(f!==null){l=P.T,d=ye.p,ye.p=2,P.T=null;try{for(var b=n.onRecoverableError,k=0;k<f.length;k++){var R=f[k];b(R.value,{componentStack:R.stack})}}finally{P.T=l,ye.p=d}}if(f=Kr,b=$r,$r=null,f!==null&&(Kr=null,b===null&&(b=[]),e!==null))for(R=0;R<f.length;R++)l=(0,f[R])(b),l!==void 0&&e.finished.finally(l);(Ti&3)!==0&&Po(),ji(n),d=n.pendingLanes,(s&261930)!==0&&(d&42)!==0?n===Zo?ns++:(ns=0,Zo=n):(ns=0,Zo=null),is(0)}}function Hg(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,La(n)))}function Po(){return Zr!==null&&(Zr.skipTransition(),Zr=null),Bf(),Uf(),Hf(),If()}function If(){if(Bt!==5)return!1;var e=oi,n=Mf;Mf=0;var l=Sr(Ti),s=P.T,f=ye.p;try{ye.p=32>l?32:l,P.T=null,l=qf,qf=null;var d=oi,b=Ti;if(Bt=0,or=oi=null,Ti=0,(yt&6)!==0)throw Error(a(331));var k=yt;if(yt|=4,Tg(d.current),Sg(d,d.current,b,l),yt=k,is(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(_t,d)}catch{}return!0}finally{ye.p=f,P.T=s,Hg(e,n)}}function Ig(e,n,l){n=Xn(l,n),n=lf(e.stateNode,n,2),e=dl(e,n,2),e!==null&&($i(e,2),ji(e))}function kt(e,n,l){if(e.tag===3)Ig(e,e,l);else for(;n!==null;){if(n.tag===3){Ig(n,e,l);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(xl===null||!xl.has(s))){e=Xn(l,e),l=Lp(2),s=dl(n,l,2),s!==null&&(Bp(l,s,n,e),$i(s,2),ji(s));break}}n=n.return}}function Vf(e,n,l){var s=e.pingCache;if(s===null){s=e.pingCache=new vw;var f=new Set;s.set(n,f)}else f=s.get(n),f===void 0&&(f=new Set,s.set(n,f));f.has(l)||(_f=!0,f.add(l),e=jw.bind(null,e,n,l),n.then(e,e))}function jw(e,n,l){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Nt===e&&(rt&l)===l&&((Vt===4||Vt===3&&(rt&62914560)===rt&&300>qt()-Go)&&(yt&2)===0?Pr(e,0):Fo|=l,Xr===rt&&(Xr=0)),ji(e)}function Vg(e,n){n===0&&(n=ga()),e=Ql(e,n),e!==null&&($i(e,n),ji(e))}function Cw(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),Vg(e,l)}function Nw(e,n){var l=0;switch(e.tag){case 31:case 13:var s=e.stateNode,f=e.memoizedState;f!==null&&(l=f.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(n),Vg(e,l)}function Aw(e,n){return Gt(e,n)}var ea=null,ta=null,Yf=!1,Wo=!1,Ff=!1,Sl=0;function ji(e){e!==ta&&e.next===null&&(ta===null?ea=ta=e:ta=ta.next=e),Wo=!0,Yf||(Yf=!0,Rw())}function is(e,n){if(!Ff&&Wo){Ff=!0;do for(var l=!1,s=ea;s!==null;){if(e!==0){var f=s.pendingLanes;if(f===0)var d=0;else{var b=s.suspendedLanes,k=s.pingedLanes;d=(1<<31-Ut(42|e)+1)-1,d&=f&~(b&~k),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(l=!0,Qg(s,d))}else d=rt,d=Ml(s,s===Nt?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||ql(s,d)||(l=!0,Qg(s,d));s=s.next}while(l);Ff=!1}}function Ow(){Yg()}function Yg(){Wo=Yf=!1;var e=0;Sl!==0&&Vw()&&(e=Sl);for(var n=qt(),l=null,s=ea;s!==null;){var f=s.next,d=Fg(s,n);d===0?(s.next=null,l===null?ea=f:l.next=f,f===null&&(ta=l)):(l=s,(e!==0||(d&3)!==0)&&(Wo=!0)),s=f}Bt!==0&&Bt!==5||is(e),Sl!==0&&(Sl=0)}function Fg(e,n){for(var l=e.suspendedLanes,s=e.pingedLanes,f=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var b=31-Ut(d),k=1<<b,R=f[b];R===-1?((k&l)===0||(k&s)!==0)&&(f[b]=tc(k,n)):R<=n&&(e.expiredLanes|=k),d&=~k}if(n=Nt,l=rt,l=Ml(e,e===n?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,l===0||e===n&&(St===2||St===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&on(s),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||ql(e,l)){if(n=l&-l,n===e.callbackPriority)return n;switch(s!==null&&on(s),Sr(l)){case 2:case 8:l=un;break;case 32:l=Fn;break;case 268435456:l=$;break;default:l=Fn}return s=Gg.bind(null,e),l=Gt(l,s),e.callbackPriority=n,e.callbackNode=l,n}return s!==null&&s!==null&&on(s),e.callbackPriority=2,e.callbackNode=null,2}function Gg(e,n){if(Bt!==0&&Bt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Po()&&e.callbackNode!==l)return null;var s=rt;return s=Ml(e,e===Nt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Og(e,s,n),Fg(e,qt()),e.callbackNode!=null&&e.callbackNode===l?Gg.bind(null,e):null)}function Qg(e,n){if(Po())return null;Og(e,n,!0)}function Rw(){Fw(function(){(yt&6)!==0?Gt(Wt,Ow):Yg()})}function Gf(){if(Sl===0){var e=Pl;e===0&&(e=vr,vr<<=1,(vr&261888)===0&&(vr=256)),Sl=e}return Sl}function Xg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:jr(e)}function _w(e,n,l,s,f){if(n==="submit"&&l&&l.stateNode===f){var d=Xg((f[en]||null).action),b=s.submitter;b&&(n=(n=b[en]||null)?Xg(n.formAction):b.getAttribute("formAction"),n!==null&&(d=n,b=null));var k=new Ps("action","action",null,s,f);e.push({event:k,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Sl!==0){var R=new FormData(f,b);Pc(l,{pending:!0,data:R,method:f.method,action:d},null,R)}}else typeof d=="function"&&(k.preventDefault(),R=new FormData(f,b),Pc(l,{pending:!0,data:R,method:f.method,action:d},d,R))},currentTarget:f}]})}}for(var Qf=0;Qf<gc.length;Qf++){var Xf=gc[Qf],zw=Xf.toLowerCase(),Mw=Xf[0].toUpperCase()+Xf.slice(1);li(zw,"on"+Mw)}li(bm,"onAnimationEnd"),li(xm,"onAnimationIteration"),li(wm,"onAnimationStart"),li("dblclick","onDoubleClick"),li("focusin","onFocus"),li("focusout","onBlur"),li(Y1,"onTransitionRun"),li(F1,"onTransitionStart"),li(G1,"onTransitionCancel"),li(Sm,"onTransitionEnd"),gi("onMouseEnter",["mouseout","mouseover"]),gi("onMouseLeave",["mouseout","mouseover"]),gi("onPointerEnter",["pointerout","pointerover"]),gi("onPointerLeave",["pointerout","pointerover"]),Ht("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ht("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ht("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ht("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ht("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ht("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ls="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(" "),qw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ls));function Zg(e,n){n=(n&4)!==0;for(var l=0;l<e.length;l++){var s=e[l],f=s.event;s=s.listeners;e:{var d=void 0;if(n)for(var b=s.length-1;0<=b;b--){var k=s[b],R=k.instance,H=k.currentTarget;if(k=k.listener,R!==d&&f.isPropagationStopped())break e;d=k,f.currentTarget=H;try{d(f)}catch(Q){to(Q)}f.currentTarget=null,d=R}else for(b=0;b<s.length;b++){if(k=s[b],R=k.instance,H=k.currentTarget,k=k.listener,R!==d&&f.isPropagationStopped())break e;d=k,f.currentTarget=H;try{d(f)}catch(Q){to(Q)}f.currentTarget=null,d=R}}}}function it(e,n){var l=n[mi];l===void 0&&(l=n[mi]=new Set);var s=e+"__bubble";l.has(s)||(Kg(n,e,2,!1),l.add(s))}function Zf(e,n,l){var s=0;n&&(s|=4),Kg(l,e,s,n)}var eu="_reactListening"+Math.random().toString(36).slice(2);function Kf(e){if(!e[eu]){e[eu]=!0,xa.forEach(function(l){l!=="selectionchange"&&(qw.has(l)||Zf(l,!1,e),Zf(l,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[eu]||(n[eu]=!0,Zf("selectionchange",!1,n))}}function Kg(e,n,l,s){switch(By(n)){case 2:var f=CS;break;case 8:f=NS;break;default:f=pd}l=f.bind(null,n,l,e),f=void 0,!Re||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),s?f!==void 0?e.addEventListener(n,l,{capture:!0,passive:f}):e.addEventListener(n,l,!0):f!==void 0?e.addEventListener(n,l,{passive:f}):e.addEventListener(n,l,!1)}function $f(e,n,l,s,f){var d=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var b=s.tag;if(b===3||b===4){var k=s.stateNode.containerInfo;if(k===f)break;if(b===4)for(b=s.return;b!==null;){var R=b.tag;if((R===3||R===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;k!==null;){if(b=qi(k),b===null)return;if(R=b.tag,R===5||R===6||R===26||R===27){s=d=b;continue e}k=k.parentNode}}s=s.return}W(function(){var H=d,Q=Cr(l),le=[];e:{var L=km.get(e);if(L!==void 0){var F=Ps,ve=e;switch(e){case"keypress":if(gt(l)===0)break e;case"keydown":case"keyup":F=b1;break;case"focusin":ve="focus",F=ac;break;case"focusout":ve="blur",F=ac;break;case"beforeblur":case"afterblur":F=ac;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":F=Ph;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=s1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=E1;break;case bm:case xm:case wm:F=c1;break;case Sm:F=j1;break;case"scroll":case"scrollend":F=r1;break;case"wheel":F=N1;break;case"copy":case"cut":case"paste":F=d1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=em;break;case"submit":F=S1;break;case"toggle":case"beforetoggle":F=O1}var Ae=(n&4)!==0,Ye=!Ae&&(e==="scroll"||e==="scrollend"),U=Ae?L!==null?L+"Capture":null:L;Ae=[];for(var D=H,V;D!==null;){var ie=D;if(V=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||V===null||U===null||(ie=pe(D,U),ie!=null&&Ae.push(rs(D,ie,V))),Ye)break;D=D.return}0<Ae.length&&(L=new F(L,ve,null,l,Q),le.push({event:L,listeners:Ae}))}}if((n&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",F&&l!==Js&&(ve=l.relatedTarget||l.fromElement)&&(qi(ve)||ve[hi]))break e;(L||F)&&(ve=Q.window===Q?Q:(F=Q.ownerDocument)?F.defaultView||F.parentWindow:window,L?(F=l.relatedTarget||l.toElement,L=H,F=F?qi(F):null,F!==null&&(Ye=u(F),Ae=F.tag,F!==Ye||Ae!==5&&Ae!==27&&Ae!==6)&&(F=null)):(L=null,F=H),L!==F&&(Ae=Ph,ie="onMouseLeave",U="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(Ae=em,ie="onPointerLeave",U="onPointerEnter",D="pointer"),Ye=L==null?ve:Vl(L),V=F==null?ve:Vl(F),ve=new Ae(ie,D+"leave",L,l,Q),ve.target=Ye,ve.relatedTarget=V,ie=null,qi(Q)===H&&(Ae=new Ae(U,D+"enter",F,l,Q),Ae.target=V,Ae.relatedTarget=Ye,ie=Ae),Ye=ie,Ae=L&&F?O(L,F,Dw):null,L!==null&&$g(le,ve,L,Ae,!1),F!==null&&Ye!==null&&$g(le,Ye,F,Ae,!0)))}e:{if(L=H?Vl(H):window,F=L.nodeName&&L.nodeName.toLowerCase(),F==="select"||F==="input"&&L.type==="file")var ke=om;else if(am(L))if(um)ke=H1;else{ke=B1;var at=L1}else F=L.nodeName,!F||F.toLowerCase()!=="input"||L.type!=="checkbox"&&L.type!=="radio"?H&&Tr(H.elementType)&&(ke=om):ke=U1;if(ke&&(ke=ke(e,H))){sm(le,ke,l,Q);break e}at&&at(e,L,H)}switch(at=H?Vl(H):window,e){case"focusin":(am(at)||at.contentEditable==="true")&&(Ar=at,hc=H,Ma=null);break;case"focusout":Ma=hc=Ar=null;break;case"mousedown":mc=!0;break;case"contextmenu":case"mouseup":case"dragend":mc=!1,ym(le,l,Q);break;case"selectionchange":if(V1)break;case"keydown":case"keyup":ym(le,l,Q)}var ze;if(oc)e:{switch(e){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else Nr?lm(e,l)&&(De="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(De="onCompositionStart");De&&(tm&&l.locale!=="ko"&&(Nr||De!=="onCompositionStart"?De==="onCompositionEnd"&&Nr&&(ze=wt()):(dt=Q,ht="value"in dt?dt.value:dt.textContent,Nr=!0)),at=tu(H,De),0<at.length&&(De=new Wh(De,e,null,l,Q),le.push({event:De,listeners:at}),ze?De.data=ze:(ze=rm(l),ze!==null&&(De.data=ze)))),(ze=_1?z1(e,l):M1(e,l))&&(De=tu(H,"onBeforeInput"),0<De.length&&(at=new Wh("onBeforeInput","beforeinput",null,l,Q),le.push({event:at,listeners:De}),at.data=ze)),_w(le,e,H,l,Q)}Zg(le,n)})}function rs(e,n,l){return{instance:e,listener:n,currentTarget:l}}function tu(e,n){for(var l=n+"Capture",s=[];e!==null;){var f=e,d=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||d===null||(f=pe(e,l),f!=null&&s.unshift(rs(e,f,d)),f=pe(e,n),f!=null&&s.push(rs(e,f,d))),e.tag===3)return s;e=e.return}return[]}function Dw(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $g(e,n,l,s,f){for(var d=n._reactName,b=[];l!==null&&l!==s;){var k=l,R=k.alternate,H=k.stateNode;if(k=k.tag,R!==null&&R===s)break;k!==5&&k!==26&&k!==27||H===null||(R=H,f?(H=pe(l,d),H!=null&&b.unshift(rs(l,H,R))):f||(H=pe(l,d),H!=null&&b.push(rs(l,H,R)))),l=l.return}b.length!==0&&e.push({event:n,listeners:b})}var Lw=/\r\n?/g,Bw=/\u0000|\uFFFD/g;function Jg(e){return(typeof e=="string"?e:""+e).replace(Lw,`
10
- `).replace(Bw,"")}function Pg(e,n){return n=Jg(n),Jg(e)===n}function Et(e,n,l,s,f,d){switch(l){case"children":if(typeof s=="string")n==="body"||n==="textarea"&&s===""||nl(e,s);else if(typeof s=="number"||typeof s=="bigint")n!=="body"&&nl(e,""+s);else return;break;case"className":kr(e,"class",s);break;case"tabIndex":kr(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":kr(e,l,s);break;case"style":Ks(e,s,d);return;case"data":if(n!=="object"){kr(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||l!=="href")){e.removeAttribute(l);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(l);break}s=jr(s),e.setAttribute(l,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(l==="formAction"?(n!=="input"&&Et(e,n,"name",f.name,f,null),Et(e,n,"formEncType",f.formEncType,f,null),Et(e,n,"formMethod",f.formMethod,f,null),Et(e,n,"formTarget",f.formTarget,f,null)):(Et(e,n,"encType",f.encType,f,null),Et(e,n,"method",f.method,f,null),Et(e,n,"target",f.target,f,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(l);break}s=jr(s),e.setAttribute(l,s);break;case"onClick":s!=null&&(e.onclick=xn);return;case"onScroll":s!=null&&it("scroll",e);return;case"onScrollEnd":s!=null&&it("scrollend",e);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(l=s.__html,l!=null){if(f.children!=null)throw Error(a(60));d?.__html!==l&&(e.innerHTML=l)}}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}l=jr(s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(l,s):e.removeAttribute(l);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(l,""):e.removeAttribute(l);break;case"capture":case"download":s===!0?e.setAttribute(l,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(l,s):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(l,s):e.removeAttribute(l);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(l):e.setAttribute(l,s);break;case"popover":it("beforetoggle",e),it("toggle",e),el(e,"popover",s);break;case"xlinkActuate":ln(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ln(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ln(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ln(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ln(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ln(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ln(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ln(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ln(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":el(e,"is",s);break;case"innerText":case"textContent":return;default:if(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")l=$s.get(l)||l,el(e,l,s);else return}st=!0}function Jf(e,n,l,s,f,d){switch(l){case"style":Ks(e,s,d);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(l=s.__html,l!=null){if(f.children!=null)throw Error(a(60));d?.__html!==l&&(e.innerHTML=l)}}break;case"children":if(typeof s=="string")nl(e,s);else if(typeof s=="number"||typeof s=="bigint")nl(e,""+s);else return;break;case"onScroll":s!=null&&it("scroll",e);return;case"onScrollEnd":s!=null&&it("scrollend",e);return;case"onClick":s!=null&&(e.onclick=xn);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Wi.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),d=l.slice(2,f?l.length-7:void 0),n=e[en]||null,n=n!=null?n[l]:null,typeof n=="function"&&e.removeEventListener(d,n,f),typeof s=="function")){typeof n!="function"&&n!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(d,s,f);break e}st=!0,l in e?e[l]=s:s===!0?e.setAttribute(l,""):el(e,l,s)}return}st=!0}function pn(e,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":it("error",e),it("load",e);var s=!1,f=!1,d;for(d in l)if(l.hasOwnProperty(d)){var b=l[d];if(b!=null)switch(d){case"src":s=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Et(e,n,d,b,l,null)}}f&&Et(e,n,"srcSet",l.srcSet,l,null),s&&Et(e,n,"src",l.src,l,null);return;case"input":it("invalid",e);var k=d=b=f=null,R=null,H=null;for(s in l)if(l.hasOwnProperty(s)){var Q=l[s];if(Q!=null)switch(s){case"name":f=Q;break;case"type":b=Q;break;case"checked":R=Q;break;case"defaultChecked":H=Q;break;case"value":d=Q;break;case"defaultValue":k=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,n));break;default:Et(e,n,s,Q,l,null)}}Ta(e,d,k,R,H,b,f,!1);return;case"select":it("invalid",e),s=b=d=null;for(f in l)if(l.hasOwnProperty(f)&&(k=l[f],k!=null))switch(f){case"value":d=k;break;case"defaultValue":b=k;break;case"multiple":s=k;default:Et(e,n,f,k,l,null)}n=d,l=b,e.multiple=!!s,n!=null?tl(e,!!s,n,!1):l!=null&&tl(e,!!s,l,!0);return;case"textarea":it("invalid",e),d=f=s=null;for(b in l)if(l.hasOwnProperty(b)&&(k=l[b],k!=null))switch(b){case"value":s=k;break;case"defaultValue":f=k;break;case"children":d=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(a(91));break;default:Et(e,n,b,k,l,null)}Xs(e,s,f,d);return;case"option":for(R in l)l.hasOwnProperty(R)&&(s=l[R],s!=null)&&(R==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":Et(e,n,R,s,l,null));return;case"dialog":it("beforetoggle",e),it("toggle",e),it("cancel",e),it("close",e);break;case"iframe":case"object":it("load",e);break;case"video":case"audio":for(s=0;s<ls.length;s++)it(ls[s],e);break;case"image":it("error",e),it("load",e);break;case"details":it("toggle",e);break;case"embed":case"source":case"link":it("error",e),it("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(H in l)if(l.hasOwnProperty(H)&&(s=l[H],s!=null))switch(H){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Et(e,n,H,s,l,null)}return;default:if(Tr(n)){for(Q in l)l.hasOwnProperty(Q)&&(s=l[Q],s!==void 0&&Jf(e,n,Q,s,l,void 0));return}}for(k in l)l.hasOwnProperty(k)&&(s=l[k],s!=null&&Et(e,n,k,s,l,null))}var Uw={};function Hw(e,n,l,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,d=null,b=null,k=null,R=null,H=null,Q=null;for(F in l){var le=l[F];if(l.hasOwnProperty(F)&&le!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":R=le;default:s.hasOwnProperty(F)||Et(e,n,F,null,s,le)}}for(var L in s){var F=s[L];if(le=l[L],s.hasOwnProperty(L)&&(F!=null||le!=null))switch(L){case"type":F!==le&&(st=!0),d=F;break;case"name":F!==le&&(st=!0),f=F;break;case"checked":F!==le&&(st=!0),H=F;break;case"defaultChecked":F!==le&&(st=!0),Q=F;break;case"value":F!==le&&(st=!0),b=F;break;case"defaultValue":F!==le&&(st=!0),k=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(a(137,n));break;default:F!==le&&Et(e,n,L,F,s,le)}}Ea(e,b,k,R,H,Q,d,f);return;case"select":F=b=k=L=null;for(d in l)if(R=l[d],l.hasOwnProperty(d)&&R!=null)switch(d){case"value":break;case"multiple":F=R;default:s.hasOwnProperty(d)||Et(e,n,d,null,s,R)}for(f in s)if(d=s[f],R=l[f],s.hasOwnProperty(f)&&(d!=null||R!=null))switch(f){case"value":d!==R&&(st=!0),L=d;break;case"defaultValue":d!==R&&(st=!0),k=d;break;case"multiple":d!==R&&(st=!0),b=d;default:d!==R&&Et(e,n,f,d,s,R)}n=k,l=b,s=F,L!=null?tl(e,!!l,L,!1):!!s!=!!l&&(n!=null?tl(e,!!l,n,!0):tl(e,!!l,l?[]:"",!1));return;case"textarea":F=L=null;for(k in l)if(f=l[k],l.hasOwnProperty(k)&&f!=null&&!s.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Et(e,n,k,null,s,f)}for(b in s)if(f=s[b],d=l[b],s.hasOwnProperty(b)&&(f!=null||d!=null))switch(b){case"value":f!==d&&(st=!0),L=f;break;case"defaultValue":f!==d&&(st=!0),F=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==d&&Et(e,n,b,f,s,d)}Qs(e,L,F);return;case"option":for(var ve in l)L=l[ve],l.hasOwnProperty(ve)&&L!=null&&!s.hasOwnProperty(ve)&&(ve==="selected"?e.selected=!1:Et(e,n,ve,null,s,L));for(R in s)L=s[R],F=l[R],s.hasOwnProperty(R)&&L!==F&&(L!=null||F!=null)&&(R==="selected"?(L!==F&&(st=!0),e.selected=L&&typeof L!="function"&&typeof L!="symbol"):Et(e,n,R,L,s,F));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 Ae in l)L=l[Ae],l.hasOwnProperty(Ae)&&L!=null&&!s.hasOwnProperty(Ae)&&Et(e,n,Ae,null,s,L);for(H in s)if(L=s[H],F=l[H],s.hasOwnProperty(H)&&L!==F&&(L!=null||F!=null))switch(H){case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(a(137,n));break;default:Et(e,n,H,L,s,F)}return;default:if(Tr(n)){for(var Ye in l)L=l[Ye],l.hasOwnProperty(Ye)&&L!==void 0&&!s.hasOwnProperty(Ye)&&Jf(e,n,Ye,void 0,s,L);for(Q in s)L=s[Q],F=l[Q],!s.hasOwnProperty(Q)||L===F||L===void 0&&F===void 0||Jf(e,n,Q,L,s,F);return}}for(var U in l)L=l[U],l.hasOwnProperty(U)&&L!=null&&!s.hasOwnProperty(U)&&Et(e,n,U,null,s,L);for(le in s)L=s[le],F=l[le],!s.hasOwnProperty(le)||L===F||L==null&&F==null||Et(e,n,le,L,s,F)}function Wg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Iw(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,l=performance.getEntriesByType("resource"),s=0;s<l.length;s++){var f=l[s],d=f.transferSize,b=f.initiatorType,k=f.duration;if(d&&k&&Wg(b)){for(b=0,k=f.responseEnd,s+=1;s<l.length;s++){var R=l[s],H=R.startTime;if(H>k)break;var Q=R.transferSize,le=R.initiatorType;Q&&Wg(le)&&(R=R.responseEnd,b+=Q*(R<k?1:(k-H)/(R-H)))}if(--s,n+=8*(d+b)/(f.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Pf=null,Wf=null;function as(e){return e.nodeType===9?e:e.ownerDocument}function ey(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 ty(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function ny(e,n,l,s){return l=as(l).createElement(e),l[Qt]=s,l[en]=n,pn(l,e,n),Xt(l),l}function ed(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var td=null;function Vw(){var e=window.event;return e&&e.type==="popstate"?e===td?!1:(td=e,!0):(td=null,!1)}var nd=typeof setTimeout=="function"?setTimeout:void 0,Yw=typeof clearTimeout=="function"?clearTimeout:void 0,iy=typeof Promise=="function"?Promise:void 0,ly=typeof requestAnimationFrame=="function"?requestAnimationFrame:nd,Fw=typeof queueMicrotask=="function"?queueMicrotask:typeof iy<"u"?function(e){return iy.resolve(null).then(e).catch(Gw)}:nd;function Gw(e){setTimeout(function(){throw e})}function kl(e){return e==="head"}function ry(e,n){var l=n,s=0;do{var f=l.nextSibling;if(e.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(s===0){e.removeChild(f),oa(n);return}s--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")s++;else if(l==="html")cd(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,cd(l);for(var d=l.firstChild;d;){var b=d.nextSibling,k=d.nodeName;d[Il]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&d.rel.toLowerCase()==="stylesheet"||l.removeChild(d),d=b}}else l==="body"&&cd(e.ownerDocument.body);l=f}while(l);oa(n)}function ay(e,n){var l=e;e=0;do{var s=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),s&&s.nodeType===8)if(l=s.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=s}while(l)}function sy(e,n,l){if(n=CSS.escape(n)!==n?"r-"+btoa(n).replace(/=/g,""):n,e.style.viewTransitionName=n,l!=null&&(e.style.viewTransitionClass=l),l=getComputedStyle(e),l.display==="inline"){if(n=e.getClientRects(),n.length===1)var s=1;else for(var f=s=0;f<n.length;f++){var d=n[f];0<d.width&&0<d.height&&s++}s===1&&(e=e.style,e.display=n.length===1?"inline-block":"block",e.marginTop="-"+l.paddingTop,e.marginBottom="-"+l.paddingBottom)}}function oy(e,n){e=e.style,n=n.style;var l=n!=null?n.hasOwnProperty("viewTransitionName")?n.viewTransitionName:n.hasOwnProperty("view-transition-name")?n["view-transition-name"]:null:null;e.viewTransitionName=l==null||typeof l=="boolean"?"":(""+l).trim(),l=n!=null?n.hasOwnProperty("viewTransitionClass")?n.viewTransitionClass:n.hasOwnProperty("view-transition-class")?n["view-transition-class"]:null:null,e.viewTransitionClass=l==null||typeof l=="boolean"?"":(""+l).trim(),e.display==="inline-block"&&(n==null?e.display=e.margin="":(l=n.display,e.display=l==null||typeof l=="boolean"?"":l,l=n.margin,l!=null?e.margin=l:(l=n.hasOwnProperty("marginTop")?n.marginTop:n["margin-top"],e.marginTop=l==null||typeof l=="boolean"?"":l,n=n.hasOwnProperty("marginBottom")?n.marginBottom:n["margin-bottom"],e.marginBottom=n==null||typeof n=="boolean"?"":n)))}function Qw(e,n,l){return l=l.ownerDocument.defaultView,{rect:e,abs:n.position==="absolute"||n.position==="fixed",clip:n.clipPath!=="none"||n.overflow!=="visible"||n.filter!=="none"||n.mask!=="none"||n.mask!=="none"||n.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=l.innerHeight&&e.left<=l.innerWidth}}function id(e){var n=e.getBoundingClientRect(),l=getComputedStyle(e);return Qw(n,l,e)}function Xw(e){return e.documentElement.clientHeight}function Zw(e){this.addEventListener("load",e),this.addEventListener("error",e)}function Kw(e,n,l,s,f,d,b,k,R){var H=n.nodeType===9?n:n.ownerDocument;try{var Q=H.startViewTransition({update:function(){var L=H.defaultView,F=L.navigation&&L.navigation.transition,ve=H.fonts.status;s();var Ae=[];if(ve==="loaded"&&(Xw(H),H.fonts.status==="loading"&&Ae.push(H.fonts.ready)),ve=Ae.length,e!==null)for(var Ye=e.suspenseyImages,U=0,D=0;D<Ye.length;D++){var V=Ye[D];if(!V.complete){var ie=V.getBoundingClientRect();if(0<ie.bottom&&0<ie.right&&ie.top<L.innerHeight&&ie.left<L.innerWidth){if(U+=Ay(V),U>lu){Ae.length=ve;break}V=new Promise(Zw.bind(V)),Ae.push(V)}}}if(0<Ae.length)return L=Promise.race([Promise.all(Ae),new Promise(function(ke){return setTimeout(ke,500)})]).then(f,f),(F?Promise.allSettled([F.finished,L]):L).then(d,d);if(f(),F)return F.finished.then(d,d);d()},types:l});H.__reactViewTransition=Q;var le=[];return Q.ready.then(function(){for(var L=H.documentElement.getAnimations({subtree:!0}),F=0;F<L.length;F++){var ve=L[F],Ae=ve.effect,Ye=Ae.pseudoElement;if(Ye!=null&&Ye.startsWith("::view-transition")){le.push(ve),ve=Ae.getKeyframes();for(var U=Ye=void 0,D=!0,V=0;V<ve.length;V++){var ie=ve[V],ke=ie.width;if(Ye===void 0)Ye=ke;else if(Ye!==ke){D=!1;break}if(ke=ie.height,U===void 0)U=ke;else if(U!==ke){D=!1;break}delete ie.width,delete ie.height,ie.transform==="none"&&delete ie.transform}D&&Ye!==void 0&&U!==void 0&&(Ae.setKeyframes(ve),D=getComputedStyle(Ae.target,Ae.pseudoElement),D.width!==Ye||D.height!==U)&&(D=ve[0],D.width=Ye,D.height=U,D=ve[ve.length-1],D.width=Ye,D.height=U,Ae.setKeyframes(ve))}}b()},function(L){H.__reactViewTransition===Q&&(H.__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&&R(L)}finally{s(),f(),b()}}),Q.finished.finally(function(){for(var L=0;L<le.length;L++)le[L].cancel();H.__reactViewTransition===Q&&(H.__reactViewTransition=null),k()}),Q}catch{return s(),f(),b(),null}}function ur(e,n){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+n+")"}ur.prototype.animate=function(e,n){return n=typeof n=="number"?{duration:n}:Y({},n),n.pseudoElement=this._selector,this._scope.animate(e,n)},ur.prototype.getAnimations=function(){for(var e=this._scope,n=this._selector,l=e.getAnimations({subtree:!0}),s=[],f=0;f<l.length;f++){var d=l[f].effect;d!==null&&d.target===e&&d.pseudoElement===n&&s.push(l[f])}return s},ur.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function uy(e){return{name:e,group:new ur("group",e),imagePair:new ur("image-pair",e),old:new ur("old",e),new:new ur("new",e)}}function Vn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Vn.prototype.addEventListener=function(e,n,l){var s=null,f=null;if(!(l!=null&&typeof l!="boolean"&&(s=l.signal||null,s!==null&&s.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var d=this._eventListeners;if(fy(d,e,n,l)===-1){var b=this,k=n;l!=null&&typeof l!="boolean"&&l.once===!0&&(k=function(R){b.removeEventListener(e,n,l),typeof n=="function"?n.call(this,R):n.handleEvent(R)}),s!==null&&(f=b.removeEventListener.bind(b,e,n,l),s.addEventListener("abort",f,{once:!0}),f=s.removeEventListener.bind(s,"abort",f)),s=na(l),d.push({type:e,listener:n,optionsOrUseCapture:l,attachedListener:k,cleanup:f}),y(this._fragmentFiber.child,!1,$w,e,k,s)}this._eventListeners=d}};function $w(e,n,l,s){return C(e).addEventListener(n,l,s),!1}Vn.prototype.removeEventListener=function(e,n,l){var s=this._eventListeners;if(s!==null&&(n=fy(s,e,n,l),n!==-1)){var f=s[n];l=f.attachedListener;var d=f.cleanup;f=na(f.optionsOrUseCapture),y(this._fragmentFiber.child,!1,Jw,e,l,f),s.splice(n,1),d!==null&&d()}};function Jw(e,n,l,s){return C(e).removeEventListener(n,l,s),!1}function na(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function cy(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function fy(e,n,l,s){if(e.length===0)return-1;s=cy(s);for(var f=0;f<e.length;f++){var d=e[f];if(d.type===n&&d.listener===l&&cy(d.optionsOrUseCapture)===s)return f}return-1}Vn.prototype.dispatchEvent=function(e){var n=w(this._fragmentFiber);if(n===null)return!0;n=C(n);var l=this._eventListeners;if(l!==null&&0<l.length||!e.bubbles){var s=n.nodeType===9?n.createComment(""):document.createTextNode("");if(l)for(var f=0;f<l.length;f++){var d=l[f];s.addEventListener(d.type,d.attachedListener,na(d.optionsOrUseCapture))}if(n.appendChild(s),e=s.dispatchEvent(e),l)for(f=0;f<l.length;f++)d=l[f],s.removeEventListener(d.type,d.attachedListener,na(d.optionsOrUseCapture));return n.removeChild(s),e}return n.dispatchEvent(e)},Vn.prototype.focus=function(e){y(this._fragmentFiber.child,!0,dy,e,void 0,void 0)};function dy(e,n){return e.tag===6?!1:(e=C(e),uS(e,n))}Vn.prototype.focusLast=function(e){var n=[];y(this._fragmentFiber.child,!0,ld,n,void 0,void 0);for(var l=n.length-1;0<=l&&!dy(n[l],e);l--);};function ld(e,n){return n.push(e),!1}Vn.prototype.blur=function(){var e=w(this._fragmentFiber);e!==null&&(e=C(e),e=as(e).activeElement,e!==null&&y(this._fragmentFiber.child,!1,Pw,e,void 0,void 0))};function Pw(e,n){return e.tag===6?!1:(e=C(e),e===n||e.contains(n)?(n.blur(),!0):!1)}Vn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),y(this._fragmentFiber.child,!1,Ww,e,void 0,void 0)};function Ww(e,n){return e.tag===6||(e=C(e),n.observe(e)),!1}Vn.prototype.unobserveUsing=function(e){var n=this._observers;if(n!==null&&n.has(e)){n.delete(e),y(this._fragmentFiber.child,!1,eS,e,void 0,void 0);for(var l=n=0;l<ui.length;l++){var s=ui[l];s.fragmentInstance===this&&s.observer===e?e.unobserve(s.instance):ui[n++]=s}ui.length=n}};function eS(e,n){return e.tag===6||(e=C(e),n.unobserve(e)),!1}var ui=[],rd=!1;function tS(e,n,l){ui.push({fragmentInstance:e,observer:n,instance:l}),rd||(rd=!0,cS(function(){rd=!1;var s=ui;ui=[];for(var f=0;f<s.length;f++){var d=s[f];d.observer.unobserve(d.instance)}}))}Vn.prototype.getClientRects=function(){var e=[];return y(this._fragmentFiber.child,!1,nS,e,void 0,void 0),e};function nS(e,n){if(e.tag===6){e=e.stateNode;var l=e.ownerDocument.createRange();l.selectNodeContents(e),n.push.apply(n,l.getClientRects())}else e=C(e),n.push.apply(n,e.getClientRects());return!1}Vn.prototype.getRootNode=function(e){var n=w(this._fragmentFiber);return n===null?this:C(n).getRootNode(e)},Vn.prototype.compareDocumentPosition=function(e){var n=w(this._fragmentFiber);if(n===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var l=[];y(this._fragmentFiber.child,!1,ld,l,void 0,void 0);var s=C(n);if(l.length===0){if(l=s,x(this._fragmentFiber)){e:{for(n=this._fragmentFiber.return;n!==null;){if(n.tag===4){n=n.stateNode.containerInfo;break e}if(n.tag===3||n.tag===5||n.tag===27)break;n=n.return}n=null}n!=null&&(l=n)}n=this._fragmentFiber;var f=s=l.compareDocumentPosition(e);return l===e?f=Node.DOCUMENT_POSITION_CONTAINS:s&Node.DOCUMENT_POSITION_CONTAINED_BY&&(l=S(n)[1],l===null?f=Node.DOCUMENT_POSITION_PRECEDING:(e=C(l).compareDocumentPosition(e),f=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),f|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}n=C(l[0]),f=C(l[l.length-1]);var d=x(this._fragmentFiber)?n.parentElement:s;if(d==null)return Node.DOCUMENT_POSITION_DISCONNECTED;s=d.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_CONTAINED_BY,d=d.compareDocumentPosition(f)&Node.DOCUMENT_POSITION_CONTAINED_BY;var b=n.compareDocumentPosition(e),k=f.compareDocumentPosition(e),R=b&Node.DOCUMENT_POSITION_CONTAINED_BY||k&Node.DOCUMENT_POSITION_CONTAINED_BY;return k=s&&d&&b&Node.DOCUMENT_POSITION_FOLLOWING&&k&Node.DOCUMENT_POSITION_PRECEDING,n=s&&n===e||d&&f===e||R||k?Node.DOCUMENT_POSITION_CONTAINED_BY:!s&&n===e||!d&&f===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:b,n&Node.DOCUMENT_POSITION_DISCONNECTED||n&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||iS(n,this._fragmentFiber,l[0],l[l.length-1],e)?n:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function iS(e,n,l,s,f){var d=qi(f);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(l=!!d)e:{for(;d!==null;){if(d.tag===7&&(d===n||d.alternate===n)){l=!0;break e}d=d.return}l=!1}return l}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(d===null)return d=f.ownerDocument,f===d||f===d.documentElement||f===d.body;e:{for(d=n,n=w(n);d!==null;){if(!(d.tag!==5&&d.tag!==3&&d.tag!==27||d!==n&&d.alternate!==n)){d=!0;break e}d=d.return}d=!1}return d}return e&Node.DOCUMENT_POSITION_PRECEDING?((n=!!d)&&!(n=d===l)&&(n=O(l,d,X),n===null?n=!1:(y(n,!0,B,d,l),d=E,E=null,n=d!==null)),n):e&Node.DOCUMENT_POSITION_FOLLOWING?((n=!!d)&&!(n=d===s)&&(n=O(s,d,X),n===null?n=!1:(y(n,!0,ee,d,s),d=E,q=E=null,n=d!==null)),n):!1}function hy(e,n){var l=e.ownerDocument.createRange();l.selectNodeContents(e),e=l.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,n?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Vn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(a(566));var n=[];y(this._fragmentFiber.child,!1,ld,n,void 0,void 0);var l=e!==!1;if(n.length===0){var s=S(this._fragmentFiber);if(s=l?s[1]||s[0]||w(this._fragmentFiber):s[0]||s[1],s===null)return;if(s.tag===6){e=C(s),hy(e,l);return}if(s=C(s),s.nodeType!==9){if(s.nodeType===11){l="host"in s?s.host:null,l!==null&&l.scrollIntoView(e);return}s.scrollIntoView(e)}}for(s=l?n.length-1:0;s!==(l?-1:n.length);){var f=n[s];f.tag===6?(f=C(f),hy(f,l)):C(f).scrollIntoView(e),s+=l?-1:1}};function lS(e,n){return e=C(e),my(e,n),!1}function my(e,n){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(n)}function py(e,n){var l=n._eventListeners;if(l!==null)for(var s=0;s<l.length;s++){var f=l[s];e.addEventListener(f.type,f.attachedListener,na(f.optionsOrUseCapture))}e.nodeType!==3&&(l=n._observers,l!==null&&l.forEach(function(d){for(var b=0,k=0;k<ui.length;k++){var R=ui[k];(R.fragmentInstance!==n||R.observer!==d||R.instance!==e)&&(ui[b++]=R)}ui.length=b,d.observe(e)}),my(e,n))}function rS(e,n){var l=n._eventListeners;if(l!==null)for(var s=0;s<l.length;s++){var f=l[s];e.removeEventListener(f.type,f.attachedListener,na(f.optionsOrUseCapture))}e.nodeType!==3&&(l=n._observers,l!==null&&l.forEach(function(d){typeof d.rootMargin=="string"?tS(n,d,e):d.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(n))}function ad(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":ad(l),Mi(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function aS(e,n,l,s){for(;e.nodeType===1;){var f=l;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Il])switch(n){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!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var d=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=Pn(e.nextSibling),e===null)break}return null}function sS(e,n,l){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Pn(e.nextSibling),e===null))return null;return e}function gy(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Pn(e.nextSibling),e===null))return null;return e}function sd(e){return e.data==="$?"||e.data==="$~"}function od(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function oS(e,n){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||l.readyState!=="loading")n();else{var s=function(){n(),l.removeEventListener("DOMContentLoaded",s)};l.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Pn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var ud=null;function yy(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(n===0)return Pn(e.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}e=e.nextSibling}return null}function vy(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return e;n--}else l!=="/$"&&l!=="/&"||n++}e=e.previousSibling}return null}function uS(e,n){function l(){s=!0}if(e.ownerDocument.activeElement===e)return!0;var s=!1;try{e.ownerDocument.addEventListener("focus",l,!0),(e.focus||HTMLElement.prototype.focus).call(e,n)}finally{e.ownerDocument.removeEventListener("focus",l,!0)}return s}function cS(e){ly(function(){ly(function(n){return e(n)})})}function by(e,n,l){switch(n=as(l),e){case"html":if(e=n.documentElement,!e)throw Error(a(452));return e;case"head":if(e=n.head,!e)throw Error(a(453));return e;case"body":if(e=n.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function xy(e,n,l){for(var s in l){var f=l[s];l.hasOwnProperty(s)&&f!=null&&Et(e,n,s,null,Uw,f)}l.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===xn&&(e.onclick=null),Mi(e)}function cd(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Mi(e)}var Wn=new Map,wy=new Set;function ss(e){if(typeof e.getRootNode=="function"){var n=e.getRootNode();if(n.nodeType===9||n.nodeType===11)return n}return e.nodeType===9?e:e.ownerDocument}var Zi=ye.d;ye.d={f:fS,r:dS,D:hS,C:mS,L:pS,m:gS,X:vS,S:yS,M:bS};function fS(){var e=Zi.f(),n=Ko();return e||n}function dS(e){var n=Pi(e);n!==null&&n.tag===5&&n.type==="form"?kp(n):Zi.r(e)}var ia=typeof document>"u"?null:document;function Sy(e,n,l){var s=ia;if(s&&typeof n=="string"&&n){var f=kn(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),wy.has(f)||(wy.add(f),e={rel:e,crossOrigin:l,href:n},s.querySelector(f)===null&&(n=s.createElement("link"),pn(n,"link",e),Xt(n),s.head.appendChild(n)))}}function hS(e){Zi.D(e),Sy("dns-prefetch",e,null)}function mS(e,n){Zi.C(e,n),Sy("preconnect",e,n)}function pS(e,n,l){Zi.L(e,n,l);var s=ia;if(s&&e&&n){var f='link[rel="preload"][as="'+kn(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+kn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+kn(l.imageSizes)+'"]')):f+='[href="'+kn(e)+'"]';var d=f;switch(n){case"style":d=la(e);break;case"script":d=ra(e)}if(!(Wn.has(d)||(e=Y({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:e,as:n},l),Wn.set(d,e),s.querySelector(f)!==null||n==="style"&&s.querySelector(os(d))||n==="script"&&s.querySelector(us(d))))){var b=s.createElement("link");pn(b,"link",e),n==="style"&&(b[Ji]=!0,b.onload=b.onerror=function(){ba(b)}),Xt(b),s.head.appendChild(b)}}}function gS(e,n){Zi.m(e,n);var l=ia;if(l&&e){var s=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+kn(s)+'"][href="'+kn(e)+'"]',d=f;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=ra(e)}if(!Wn.has(d)&&(e=Y({rel:"modulepreload",href:e},n),Wn.set(d,e),l.querySelector(f)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(us(d)))return}s=l.createElement("link"),pn(s,"link",e),Xt(s),l.head.appendChild(s)}}}function yS(e,n,l){Zi.S(e,n,l);var s=ia;if(s&&e){var f=qn(s).hoistableStyles,d=la(e);n=n||"default";var b=f.get(d);if(!b){var k={loading:0,preload:null};if(b=s.querySelector(os(d)))k.loading=5;else{e=Y({rel:"stylesheet",href:e,"data-precedence":n},l),(l=Wn.get(d))&&fd(e,l);var R=b=s.createElement("link");Xt(R),pn(R,"link",e),R._p=new Promise(function(H,Q){R.onload=H,R.onerror=Q}),R.addEventListener("load",function(){k.loading|=1}),R.addEventListener("error",function(){k.loading|=2}),k.loading|=4,nu(b,n,s)}b={type:"stylesheet",instance:b,count:1,state:k},f.set(d,b)}}}function vS(e,n){Zi.X(e,n);var l=ia;if(l&&e){var s=qn(l).hoistableScripts,f=ra(e),d=s.get(f);d||(d=l.querySelector(us(f)),d||(e=Y({src:e,async:!0},n),(n=Wn.get(f))&&dd(e,n),d=l.createElement("script"),Xt(d),pn(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(f,d))}}function bS(e,n){Zi.M(e,n);var l=ia;if(l&&e){var s=qn(l).hoistableScripts,f=ra(e),d=s.get(f);d||(d=l.querySelector(us(f)),d||(e=Y({src:e,async:!0,type:"module"},n),(n=Wn.get(f))&&dd(e,n),d=l.createElement("script"),Xt(d),pn(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(f,d))}}function ky(e,n,l,s){var f=(f=vt.current)?ss(f):null;if(!f)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(l=la(l.href),n=qn(f).hoistableStyles,s=n.get(l),s||(s={type:"style",instance:null,count:0,state:null},n.set(l,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=la(l.href);var d=qn(f).hoistableStyles,b=d.get(e);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,b),(d=f.querySelector(os(e)))?d._p||(b.instance=d,b.state.loading=5):(d=Wn.get(e),d||(d={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Wn.set(e,d)),xS(f,e,d,b.state))),n&&s===null)throw Error(a(528,""));return b}if(n&&s!==null)throw Error(a(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(l=ra(l),n=qn(f).hoistableScripts,s=n.get(l),s||(s={type:"script",instance:null,count:0,state:null},n.set(l,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function la(e){return'href="'+kn(e)+'"'}function os(e){return'link[rel="stylesheet"]['+e+"]"}function Ey(e){return Y({},e,{"data-precedence":e.precedence,precedence:null})}function xS(e,n,l,s){if(n=e.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[Ji]!==!0){s.loading=1;return}}else n=e.createElement("link"),n[Ji]=!0,n.onload=n.onerror=ba.bind(null,n),pn(n,"link",l),Xt(n),e.head.appendChild(n);s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2})}function ra(e){return'[src="'+kn(e)+'"]'}function us(e){return"script[async]"+e}function Ty(e,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+kn(l.href)+'"]');if(s)return n.instance=s,Xt(s),s;var f=Y({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Xt(s),pn(s,"style",f),nu(s,l.precedence,e),n.instance=s;case"stylesheet":f=la(l.href);var d=e.querySelector(os(f));if(d)return n.state.loading|=4,n.instance=d,Xt(d),d;s=Ey(l),(f=Wn.get(f))&&fd(s,f),d=(e.ownerDocument||e).createElement("link"),Xt(d);var b=d;return b._p=new Promise(function(k,R){b.onload=k,b.onerror=R}),pn(d,"link",s),n.state.loading|=4,nu(d,l.precedence,e),n.instance=d;case"script":return d=ra(l.src),(f=e.querySelector(us(d)))?(n.instance=f,Xt(f),f):(s=l,(f=Wn.get(d))&&(s=Y({},l),dd(s,f)),e=e.ownerDocument||e,f=e.createElement("script"),Xt(f),pn(f,"link",s),e.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,nu(s,l.precedence,e));return n.instance}function nu(e,n,l){for(var s=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=s.length?s[s.length-1]:null,d=f,b=0;b<s.length;b++){var k=s[b];if(k.dataset.precedence===n)d=k;else if(d!==f)break}d?d.parentNode.insertBefore(e,d.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(e,n.firstChild))}function fd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function dd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var iu=null;function jy(e,n,l){if(iu===null){var s=new Map,f=iu=new Map;f.set(l,s)}else f=iu,s=f.get(l),s||(s=new Map,f.set(l,s));if(s.has(e))return s;for(s.set(e,null),l=l.getElementsByTagName(e),f=0;f<l.length;f++){var d=l[f];if(!(d[Il]||d[Qt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var b=d.getAttribute(n)||"";b=e+b;var k=s.get(b);k?k.push(d):s.set(b,[d])}}return s}function hd(e,n,l){e=e.ownerDocument||e,e.head.insertBefore(l,n==="title"?e.querySelector("head > title"):null)}function wS(e,n,l){if(l===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Cy(e,n){return e==="img"&&n.src!=null&&n.src!==""&&n.onLoad==null&&n.loading!=="lazy"}function Ny(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ay(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Oy(e,n){typeof n.decode=="function"&&(e.imgCount++,n.complete||(e.imgBytes+=Ay(n),e.suspenseyImages.push(n)),e=ES.bind(e),n.decode().then(e,e))}function SS(e,n,l,s){if(l.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=la(s.href),d=n.querySelector(os(f));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=cs.bind(e),n.then(e,e)),l.state.loading|=4,l.instance=d,Xt(d);return}d=n.ownerDocument||n,s=Ey(s),(f=Wn.get(f))&&fd(s,f),d=d.createElement("link"),Xt(d);var b=d;b._p=new Promise(function(k,R){b.onload=k,b.onerror=R}),pn(d,"link",s),l.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=cs.bind(e),n.addEventListener("load",l),n.addEventListener("error",l))}}var lu=0;function kS(e,n){return e.stylesheets&&e.count===0&&au(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var s=setTimeout(function(){if(e.stylesheets&&au(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+n);0<e.imgBytes&&lu===0&&(lu=62500*Iw());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&au(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>lu?50:800)+n);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(f)}}:null}function Ry(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)au(e,e.stylesheets);else if(e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}}}function cs(){this.count--,Ry(this)}function ES(){this.imgCount--,Ry(this)}var ru=null;function au(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ru=new Map,n.forEach(TS,e),ru=null,cs.call(e))}function TS(e,n){if(!(n.state.loading&4)){var l=ru.get(e);if(l)var s=l.get(null);else{l=new Map,ru.set(e,l);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<f.length;d++){var b=f[d];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(l.set(b.dataset.precedence,b),s=b)}s&&l.set(null,s)}f=n.instance,b=f.getAttribute("data-precedence"),d=l.get(b)||s,d===s&&l.set(null,f),l.set(b,f),this.count++,s=cs.bind(this),f.addEventListener("load",s),f.addEventListener("error",s),d?d.parentNode.insertBefore(f,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),n.state.loading|=4}}var aa={$$typeof:fe,Provider:null,Consumer:null,_currentValue:We,_currentValue2:We,_threadCount:0};function jS(e,n,l,s,f,d,b,k,R){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=Ll(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ll(0),this.hiddenUpdates=Ll(null),this.identifierPrefix=s,this.onUncaughtError=f,this.onCaughtError=d,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.transitionTypes=null,this.incompleteTransitions=new Map}function _y(e,n,l,s,f,d,b,k,R,H,Q,le){return e=new jS(e,n,l,b,R,H,Q,le,k),n=1,d===!0&&(n|=24),d=Cn(3,null,null,n),e.current=d,d.stateNode=e,n=Cc(),n.refCount++,e.pooledCache=n,n.refCount++,d.memoizedState={element:s,isDehydrated:l,cache:n},Rc(d),e}function zy(e){return e?(e=_r,e):_r}function My(e,n,l,s,f,d){f=zy(f),s.context===null?s.context=f:s.pendingContext=f,s=fl(n),s.payload={element:l},d=d===void 0?null:d,d!==null&&(s.callback=d),l=dl(e,s,n),l!==null&&(Rn(l,e,n),Ia(l,e,n))}function qy(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<n?l:n}}function md(e,n){qy(e,n),(e=e.alternate)&&qy(e,n)}function Dy(e){if(e.tag===13||e.tag===31){var n=Ql(e,67108864);n!==null&&Rn(n,e,67108864),md(e,67108864)}}function Ly(e){if(e.tag===13||e.tag===31){var n=In();n=Bl(n);var l=Ql(e,n);l!==null&&Rn(l,e,n),md(e,n)}}var sa=!0;function CS(e,n,l,s){var f=P.T;P.T=null;var d=ye.p;try{ye.p=2,pd(e,n,l,s)}finally{ye.p=d,P.T=f}}function NS(e,n,l,s){var f=P.T;P.T=null;var d=ye.p;try{ye.p=8,pd(e,n,l,s)}finally{ye.p=d,P.T=f}}function pd(e,n,l,s){if(sa){var f=gd(s);if(f===null)$f(e,n,s,su,l),Uy(e,s);else if(OS(f,e,n,l,s))s.stopPropagation();else if(Uy(e,s),n&4&&-1<AS.indexOf(e)){for(;f!==null;){var d=Pi(f);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var b=Gn(d.pendingLanes);if(b!==0){var k=d;for(k.pendingLanes|=2,k.entangledLanes|=2;b;){var R=1<<31-Ut(b);k.entanglements[1]|=R,b&=~R}ji(d),(yt&6)===0&&(Qo=qt()+500,is(0))}}break;case 31:case 13:k=Ql(d,2),k!==null&&Rn(k,d,2),Ko(),md(d,2)}if(d=gd(s),d===null&&$f(e,n,s,su,l),d===f)break;f=d}f!==null&&s.stopPropagation()}else $f(e,n,s,null,l)}}function gd(e){return e=Cr(e),yd(e)}var su=null;function yd(e){if(su=null,e=qi(e),e!==null){var n=u(e);if(n===null)e=null;else{var l=n.tag;if(l===13){if(e=c(n),e!==null)return e;e=null}else if(l===31){if(e=h(n),e!==null)return e;e=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return su=e,null}function By(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(Xe()){case Wt:return 2;case un:return 8;case Fn:case _i:return 32;case $:return 268435456;default:return 32}default:return 32}}var vd=!1,El=null,Tl=null,jl=null,fs=new Map,ds=new Map,Cl=[],AS="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 Uy(e,n){switch(e){case"focusin":case"focusout":El=null;break;case"dragenter":case"dragleave":Tl=null;break;case"mouseover":case"mouseout":jl=null;break;case"pointerover":case"pointerout":fs.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":ds.delete(n.pointerId)}}function hs(e,n,l,s,f,d){return e===null||e.nativeEvent!==d?(e={blockedOn:n,domEventName:l,eventSystemFlags:s,nativeEvent:d,targetContainers:[f]},n!==null&&(n=Pi(n),n!==null&&Dy(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function OS(e,n,l,s,f){switch(n){case"focusin":return El=hs(El,e,n,l,s,f),!0;case"dragenter":return Tl=hs(Tl,e,n,l,s,f),!0;case"mouseover":return jl=hs(jl,e,n,l,s,f),!0;case"pointerover":var d=f.pointerId;return fs.set(d,hs(fs.get(d)||null,e,n,l,s,f)),!0;case"gotpointercapture":return d=f.pointerId,ds.set(d,hs(ds.get(d)||null,e,n,l,s,f)),!0}return!1}function Hy(e){var n=qi(e.target);if(n!==null){var l=u(n);if(l!==null){if(n=l.tag,n===13){if(n=c(l),n!==null){e.blockedOn=n,Hl(e.priority,function(){Ly(l)});return}}else if(n===31){if(n=h(l),n!==null){e.blockedOn=n,Hl(e.priority,function(){Ly(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ou(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var l=gd(e.nativeEvent);if(l===null){l=e.nativeEvent;var s=new l.constructor(l.type,l);Js=s,l.target.dispatchEvent(s),Js=null}else return n=Pi(l),n!==null&&Dy(n),e.blockedOn=l,!1;n.shift()}return!0}function Iy(e,n,l){ou(e)&&l.delete(n)}function RS(){vd=!1,El!==null&&ou(El)&&(El=null),Tl!==null&&ou(Tl)&&(Tl=null),jl!==null&&ou(jl)&&(jl=null),fs.forEach(Iy),ds.forEach(Iy)}function uu(e,n){e.blockedOn===n&&(e.blockedOn=null,vd||(vd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,RS)))}var cu=null;function Vy(e){cu!==e&&(cu=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){cu===e&&(cu=null);for(var n=0;n<e.length;n+=3){var l=e[n],s=e[n+1],f=e[n+2];if(typeof s!="function"){if(yd(s||l)===null)continue;break}var d=Pi(l);d!==null&&(e.splice(n,3),n-=3,Pc(d,{pending:!0,data:f,method:l.method,action:s},s,f))}}))}function oa(e){function n(R){return uu(R,e)}El!==null&&uu(El,e),Tl!==null&&uu(Tl,e),jl!==null&&uu(jl,e),fs.forEach(n),ds.forEach(n);for(var l=0;l<Cl.length;l++){var s=Cl[l];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Cl.length&&(l=Cl[0],l.blockedOn===null);)Hy(l),l.blockedOn===null&&Cl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(s=0;s<l.length;s+=3){var f=l[s],d=l[s+1],b=f[en]||null;if(typeof d=="function")b||Vy(l);else if(b){var k=null;if(d&&d.hasAttribute("formAction")){if(f=d,b=d[en]||null)k=b.formAction;else if(yd(f)!==null)continue}else k=b.action;typeof k=="function"?l[s+1]=k:(l.splice(s,3),s-=3),Vy(l)}}}function Yy(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(b){return f=b})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),s||setTimeout(l,20)}function l(){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,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function bd(e){this._internalRoot=e}fu.prototype.render=bd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var l=n.current,s=In();My(l,s,e,n,null,null)},fu.prototype.unmount=bd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;My(e.current,2,null,e,null,null),Ko(),n[hi]=null}};function fu(e){this._internalRoot=e}fu.prototype.unstable_scheduleHydration=function(e){if(e){var n=Ul();e={blockedOn:null,target:e,priority:n};for(var l=0;l<Cl.length&&n!==0&&n<Cl[l].priority;l++);Cl.splice(l,0,e),l===0&&Hy(e)}};var Fy=i.version;if(Fy!=="19.3.1")throw Error(a(527,Fy,"19.3.1"));ye.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=p(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var _S={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var du=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!du.isDisabled&&du.supportsFiber)try{_t=du.inject(_S),ft=du}catch{}}return ps.createRoot=function(e,n){if(!o(e))throw Error(a(299));var l=!1,s="",f=zp,d=Mp,b=qp;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError)),n=_y(e,1,!1,null,null,l,s,null,f,d,b,Yy),e[hi]=n.current,Kf(e),new bd(n)},ps.hydrateRoot=function(e,n,l){if(!o(e))throw Error(a(299));var s=!1,f="",d=zp,b=Mp,k=qp,R=null;return l!=null&&(l.unstable_strictMode===!0&&(s=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(d=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(k=l.onRecoverableError),l.formState!==void 0&&(R=l.formState)),n=_y(e,1,!0,n,l??null,s,f,R,d,b,k,Yy),n.context=zy(null),l=n.current,s=In(),s=Bl(s),f=fl(s),f.callback=null,dl(l,f,s),l=s,n.current.lanes=l,$i(n,l),ji(n),e[hi]=n.current,Kf(e),new fu(n)},ps.version="19.3.1",ps}var ev;function IS(){if(ev)return Sd.exports;ev=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(i){console.error(i)}}return t(),Sd.exports=HS(),Sd.exports}var VS=IS();async function Fe(t,i){const r=await fetch("/dsh-bot/api"+t,{...i,headers:{accept:"application/json",...i?.headers??{}}}),a=await r.json().catch(()=>({}));return{status:r.status,body:a&&typeof a=="object"?a:{}}}async function Ni(t,i){const r=await fetch(t,{...i,headers:{accept:"application/json",...i?.headers??{}}}),a=await r.json().catch(()=>({}));return{status:r.status,body:a&&typeof a=="object"?a:{}}}function zb(t,i){return typeof t.message=="string"&&t.message!==""?t.message:i}const YS=/^(?:Name|名字)\s*[::]\s*(.+?)\s*$/i,FS=/^(?:Style|风格)\s*[::]\s*(.+?)\s*$/i,GS=/^(?:Task|任务)\s*[::]\s*(.+?)\s*$/i;function QS(t,i,r){const a=[];return t.trim()!==""&&a.push(`Name: ${t.trim()}`),i.trim()!==""&&a.push(`Style: ${i.trim()}`),r.trim()!==""&&a.push(`Task: ${r.trim()}`),a.join(`
11
-
12
- `)}function XS(t){const i={name:"",style:"",task:""};for(const r of t.split(`
13
- `)){const a=YS.exec(r),o=FS.exec(r),u=GS.exec(r);a&&i.name===""?i.name=a[1]??"":o&&i.style===""?i.style=o[1]??"":u&&i.task===""&&(i.task=u[1]??"")}return i}const ZS={"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)"},KS={"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":"(空结果)"},Mb={en:ZS,zh:KS},$S={"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"},JS={"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":"来源"},qb={en:$S,zh:JS},PS={"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.","scroll.latest":"Jump to latest","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."},WS={"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":"这个会话还没有消息。","scroll.latest":"回到最新","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":"无法读取会话是否仍在运行"},Db={en:PS,zh:WS},ek={"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."},tk={"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":"没有送出。"},Lb={en:ek,zh:tk},nk={"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"},ik={"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":"主运行时不可达"},Bb={en:nk,zh:ik},lk={"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"},rk={"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":"已记录决定"},Ub={en:lk,zh:rk},ak={"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."},sk={"approval.title":"工具许可","approval.allowOnce":"允许一次","approval.reject":"拒绝","approval.waiting":"等待你的回答","approval.allowed":"已允许一次","approval.rejected":"已拒绝","approval.cancelled":"这个请求已被取消。","approval.failed":"这个请求未能完成。","approval.submitFailed":"决定未能提交。"},Hb={en:ak,zh:sk},ok={"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"},uk={"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":"自动审阅"},Ib={en:ok,zh:uk},ck={"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"},fk={"auth.title":"授权","auth.open":"凭据","auth.empty":"当前没有可进行的授权流程。","auth.start":"开始","auth.writeVault":"写入保险库","auth.cancel":"取消","auth.secretMask":"••••••••","auth.unavailable":"此主机未提供官方授权。","auth.failed":"授权未能完成。","auth.close":"关闭"},Vb={en:ck,zh:fk},dk={"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"},hk={"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":"关闭"},Yb={en:dk,zh:hk},mk={"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"},pk={"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} 毫秒"},Fb={en:mk,zh:pk},Gb={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":"重试图片"}},gk={"memory.open":"Memory","memory.title":"Memory","memory.close":"Close","memory.search":"Search memory","memory.scope":"Scope","memory.scope.all":"All scopes","memory.scope.user":"User","memory.scope.session":"Session","memory.scope.work":"Work ticket","memory.scope.skill":"Skill","memory.lifecycle":"Lifecycle","memory.lifecycle.all":"Any lifecycle","memory.lifecycle.active":"Active","memory.lifecycle.corrected":"Corrected","memory.lifecycle.forgotten":"Forgotten","memory.lifecycle.candidate":"Candidate","memory.kind":"Type","memory.type.all":"All types","memory.type.persona":"Persona","memory.type.profile":"User profile","memory.type.fact":"Fact","memory.type.episodic":"Episode","memory.type.procedural":"Procedure","memory.type.state":"Working state","memory.type.skill":"Skill","memory.empty":"Nothing matches these filters.","memory.loading":"Reading memory…","memory.failed":"Memory could not be read.","memory.denied":"Sign in to read memory.","memory.refresh":"Refresh","memory.more":"More","memory.capped":"Only the most recent entries are shown.","memory.readonly":"This view is read-only. Corrections and forgetting still go through the existing tools.","memory.frame":"Context frame","memory.frame.none":"No frozen context frame yet.","memory.frame.unselected":"Do not compare","memory.frame.option":"Revision {revision}","memory.frame.hint":"A frame is a frozen view revision. The snapshot does not store a turn number.","memory.frame.note":"This frame has no context manifest, so the citation form is unknown.","memory.cite.unknown":"Unknown","memory.cite.full":"Full text","memory.cite.summary":"Summary","memory.cite.index":"Index","memory.cite.recall":"Tool recall","memory.cite.absent":"Not cited","memory.cite.reason.no_manifest":"The snapshot only has a hash and a presence bit, so full text, summary, and index cannot be told apart.","memory.cite.reason.no_frame":"Choose a context frame before reading citation.","memory.source":"Source","memory.source.user":"User statement","memory.source.model":"Model write","memory.source.system":"System migration","memory.source.tool":"Tool import","memory.source.unknown":"Unknown","memory.source.unrecorded":"Not recorded","memory.source.created":"Created {time}","memory.source.updated":"Updated {time}","memory.chain":"Corrections","memory.changes":"Changes","memory.tombstone":"Forgotten. The text stays hidden.","memory.version":"Version {version}","memory.profile.empty":"No attributes were recorded.","memory.episode.participants":"Participants: not recorded","memory.procedure.empty":"No steps were recorded.","memory.state.goal":"Goal","memory.state.blockers":"Blocked","memory.state.next":"Next","memory.state.empty":"No goal is recorded.","memory.skill.loadUnknown":"Full text load: unknown","memory.skill.binding":"Skill file · {scope}","memory.skill.public":"Public","memory.skill.private":"Private","memory.skill.disabled":"Disabled","memory.skill.enabled":"Enabled","memory.body.hidden":"The text stays hidden.","memory.body.mismatch":"The stored text does not match its hash, so it stays hidden.","memory.body.absent":"No text is stored.","memory.detail.close":"Close detail","memory.missing":"Not recorded","memory.priority":"Priority {priority}","memory.note":"Note","memory.back":"Back to the list","memory.tool.foundations_remember":"Remember","memory.tool.foundations_correct":"Correct","memory.tool.foundations_forget":"Forget","memory.tool.foundations_state_update":"Update working state"},yk={"memory.open":"记忆","memory.title":"记忆","memory.close":"关闭","memory.search":"搜索记忆","memory.scope":"作用域","memory.scope.all":"全部作用域","memory.scope.user":"用户级","memory.scope.session":"会话级","memory.scope.work":"工作票级","memory.scope.skill":"技能级","memory.lifecycle":"生命周期","memory.lifecycle.all":"全部状态","memory.lifecycle.active":"活跃","memory.lifecycle.corrected":"已更正","memory.lifecycle.forgotten":"已遗忘","memory.lifecycle.candidate":"待确认","memory.kind":"类型","memory.type.all":"全部类型","memory.type.persona":"人格","memory.type.profile":"用户画像","memory.type.fact":"稳定事实","memory.type.episodic":"情景记忆","memory.type.procedural":"过程记忆","memory.type.state":"工作状态","memory.type.skill":"技能","memory.empty":"没有符合这些筛选的记忆。","memory.loading":"正在读取记忆…","memory.failed":"记忆没有读出来。","memory.denied":"需要登录后才能查看记忆。","memory.refresh":"刷新","memory.more":"更多","memory.capped":"只显示最近的一部分。","memory.readonly":"这里只读。更正和遗忘仍走原来的工具。","memory.frame":"上下文帧","memory.frame.none":"还没有冻结过的上下文帧。","memory.frame.unselected":"不对照","memory.frame.option":"修订 {revision}","memory.frame.hint":"对照的是冻结时的视图修订。快照里没有轮次号。","memory.frame.note":"这一帧没有上下文清单,所以引用形式是未知。","memory.cite.unknown":"未知","memory.cite.full":"全文","memory.cite.summary":"摘要","memory.cite.index":"索引","memory.cite.recall":"工具召回","memory.cite.absent":"未引用","memory.cite.reason.no_manifest":"旧快照只有哈希和存在位,分不清全文、摘要还是索引。","memory.cite.reason.no_frame":"先选择一个上下文帧,才能判断引用。","memory.source":"来源","memory.source.user":"用户陈述","memory.source.model":"模型写入","memory.source.system":"系统迁移","memory.source.tool":"工具导入","memory.source.unknown":"未知","memory.source.unrecorded":"历史未记录","memory.source.created":"创建于 {time}","memory.source.updated":"更新于 {time}","memory.chain":"更正链","memory.changes":"变更","memory.tombstone":"已遗忘。正文不显示。","memory.version":"版本 {version}","memory.profile.empty":"没有记录到的属性。","memory.episode.participants":"参与者:历史未记录","memory.procedure.empty":"没有记录到的步骤。","memory.state.goal":"当前目标","memory.state.blockers":"阻塞","memory.state.next":"下一步","memory.state.empty":"没有记录到的目标。","memory.skill.loadUnknown":"全文是否已 load:未知","memory.skill.binding":"技能文件 · {scope}","memory.skill.public":"公开","memory.skill.private":"私有","memory.skill.disabled":"已停用","memory.skill.enabled":"已启用","memory.body.hidden":"正文不显示。","memory.body.mismatch":"正文和哈希对不上,所以不显示。","memory.body.absent":"没有正文。","memory.detail.close":"关闭详情","memory.missing":"未记录","memory.priority":"优先级 {priority}","memory.note":"附注","memory.back":"返回列表","memory.tool.foundations_remember":"记住","memory.tool.foundations_correct":"更正","memory.tool.foundations_forget":"遗忘","memory.tool.foundations_state_update":"更新工作状态"},Qb={en:gk,zh:yk},Xb={en:{"canvas.open":"Open design preview","canvas.close":"Close design preview","canvas.card":"Design preview","canvas.revision":"Version {revision}","canvas.preview":"Preview","canvas.stable":"In use","canvas.failed":"Failed","canvas.loading":"Checking this revision…","canvas.error":"This revision could not be shown. The previous one is still open.","canvas.retry":"Retry","canvas.adopt":"Use this version","canvas.adopted":"This version is in use","canvas.device.desktop":"Desktop","canvas.device.tablet":"Tablet","canvas.device.phone":"Phone","canvas.devices":"Devices","canvas.versions":"Versions","canvas.reset":"Reset","canvas.reset.hint":"Back to this version's first page","canvas.unavailable":"Design previews could not be loaded."},zh:{"canvas.open":"打开设计预览","canvas.close":"关闭设计预览","canvas.card":"设计预览","canvas.revision":"版本 {revision}","canvas.preview":"预览","canvas.stable":"使用中","canvas.failed":"失败","canvas.loading":"正在核对这个版本…","canvas.error":"这个版本无法显示,仍停留在上一版。","canvas.retry":"重试","canvas.adopt":"采用这个版本","canvas.adopted":"这个版本已采用","canvas.device.desktop":"桌面","canvas.device.tablet":"平板","canvas.device.phone":"手机","canvas.devices":"设备","canvas.versions":"版本","canvas.reset":"重置","canvas.reset.hint":"回到这一版的入口页","canvas.unavailable":"设计预览无法加载。"}},vk={...Bb.en,...Db.en,...Lb.en,...qb.en,...Fb.en,...Mb.en,...Ub.en,...Hb.en,...Ib.en,...Vb.en,...Yb.en,...Gb.en,...Qb.en,...Xb.en},bk={...Bb.zh,...Db.zh,...Lb.zh,...qb.zh,...Fb.zh,...Mb.zh,...Ub.zh,...Hb.zh,...Ib.zh,...Vb.zh,...Yb.zh,...Gb.zh,...Qb.zh,...Xb.zh},tv={en:vk,zh:bk},Zb="dsh-bot.locale";function xk(){try{const t=localStorage.getItem(Zb);if(t==="en"||t==="zh")return t}catch{}return"en"}function wk(t){try{localStorage.setItem(Zb,t)}catch{}typeof document<"u"&&(document.documentElement.lang=t==="zh"?"zh-CN":"en")}function Kb(t,i,r){const a=tv[t][i]??tv.en[i];return r?a.replace(/\{(\w+)\}/g,(o,u)=>r[u]??""):a}function Ai(t,i){return Kb("en",t,i)}const Sk={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 kk(t,i,r=Ai){const a=Sk[t];return a?r(a):i}const $b=j.createContext({locale:"en",setLocale:()=>{},t:Ai});function Ek({children:t}){const[i,r]=j.useState(()=>xk()),a=j.useCallback(c=>{wk(c),r(c)},[]),o=j.useCallback((c,h)=>Kb(i,c,h),[i]),u=j.useMemo(()=>({locale:i,setLocale:a,t:o}),[i,a,o]);return m.jsx($b.Provider,{value:u,children:t})}function Ke(){return j.useContext($b)}const Tk={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"},jk=new Set(["delivered","cancelled"]),Ck=new Set(["accepted","enqueued","started","needs_user","waiting_budget"]);function Jb(t,i=Ai){const r=Tk[t];return r?i(r):t}function Pb(t){return t.replace(/^\uFEFF/,"").trimStart().startsWith("[foundations:ticket]")}function Sh(t){const i=t.replace(/^\uFEFF/,"").replace(/\r\n/g,`
14
- `).trimStart();if(!i.startsWith("[foundations:briefing]"))return null;const r=i.slice(22).replace(/^\n/,""),a=r.indexOf(`
15
- ---
16
- `);if(a<0)return null;const o=[],u={};for(const p of r.slice(0,a).split(`
17
- `)){const v=/^(briefing_revision|budget_wall_ms|budget_max_tokens|material_sha256):\s*(.*)$/.exec(p);v?.[1]?u[v[1]]=(v[2]??"").trim():p.trim()!==""&&o.push(p.trim())}const c=Number(u.briefing_revision),h=Number(u.budget_wall_ms),g=Number(u.budget_max_tokens);return{revision:Number.isFinite(c)&&c>0?c:1,wallMs:Number.isFinite(h)&&h>0?h:null,maxTokens:Number.isFinite(g)&&g>0?g:null,material:u.material_sha256??"",notes:o,body:r.slice(a+5).trim(),cancel:o.some(p=>p.startsWith("This is a cancellation note")||p.startsWith("这是取消说明"))}}function dr(t){return t.startsWith("worker-")&&t.length>7}function Nk(t){return dr(t)?t.slice(7):""}function Ak(t){const i=t.signals;if(!i||typeof i!="object"||Array.isArray(i))return{};const r={};for(const[a,o]of Object.entries(i))r[a]=Array.isArray(o)?o.filter(u=>typeof u=="string"):[];return r}function Ok(t){const i=t.cards;if(!i||typeof i!="object"||Array.isArray(i))return{};const r={};for(const[a,o]of Object.entries(i))r[a]=_k({cards:o});return r}function Rk(t){const i=t.work&&typeof t.work=="object"&&!Array.isArray(t.work)?t.work:t;return!("signals"in i)&&!("cards"in i)?null:{signals:Ak(i),cards:Ok(i)}}function _k(t){return Array.isArray(t.cards)?t.cards.flatMap(i=>{if(!i||typeof i!="object")return[];const r=i,a=typeof r.summary=="string"?r.summary:"",o=zk(r,a);return o?[o]:[]}):[]}function zk(t,i="",r=Ai){const a=t.ticket;if(!a||typeof a!="object")return null;const o=a;if(typeof o.id!="string"||typeof o.status!="string")return null;const u=Array.isArray(t.attempts)?t.attempts:[],c=typeof o.active_attempt_id=="string"?o.active_attempt_id:"",h=u.find(w=>w&&typeof w=="object"&&w.id===c),g=Array.isArray(t.events)?t.events.flatMap(Vk):[],p=typeof o.child_session_id=="string"?o.child_session_id:"";let v=o.waiting_budget===!0;if(typeof o.budget_json=="string")try{v||=JSON.parse(o.budget_json).quota?.waiting===!0}catch{}const y=i.trim()||r("work.ticket");return{id:o.id,status:v&&["started","enqueued"].includes(o.status)?"waiting_budget":o.status,revision:typeof o.briefing_revision=="number"?o.briefing_revision:1,summary:y,childSessionId:p.startsWith("worker-")?p:null,startedAt:typeof h?.started_at=="string"?h.started_at:null,events:g}}function Wb(t){const i=t.filter(a=>!jk.has(a.status)),r=t.find(a=>a.status==="delivered");return r?[...i,r]:i}function ex(t){return t.some(i=>Ck.has(i.status))}function nv(t,i,r=!1){return r?!1:t&&!ex(i)}const Mk=new Set(["accepted","enqueued","started"]);function qk(t,i=!1){if(i)return"run";let r=!1,a=!1;for(const o of t)o.status==="delivered"||o.status==="cancelled"||(o.status==="needs_user"||o.status==="waiting_budget"?r=!0:Mk.has(o.status)&&(a=!0));return r?"wait":a?"run":null}function jd(t,i=Date.now(),r=Ai){const a=t.filter(c=>c.status==="started");if(a.length>1)return r("work.preview.startedMany",{count:String(a.length)});const o=ix(t);if(!o||o.status==="ready")return"";const u=Jb(o.status,r);if(o.status==="started"){const c=nx(o.startedAt,i);return c?`${u} · ${c}`:u}return u}function Dk(t,i=Ai){if(t.filter(o=>o.status==="started").length>1)return i("work.placeholder.many");const a=ix(t);return a?a.status==="started"?i("work.placeholder.started"):a.status==="waiting_budget"?i("work.fact.waitingBudget"):a.status==="needs_user"?i("work.placeholder.needsUser"):a.status==="ready"?i("work.placeholder.ready"):a.status==="failed"?i("work.placeholder.failed"):null:null}function Lk(t,i,r=Ai){const a=[r("work.fact.revision",{revision:String(t.revision)})];if(t.status==="accepted"&&a.push(r("work.fact.accepted")),t.status==="enqueued"&&a.push(r("work.fact.enqueued")),t.status==="started"){const u=nx(t.startedAt,i);u&&a.push(r("work.fact.elapsed",{time:u})),a.push(r("work.fact.wall"))}t.status==="waiting_budget"&&a.push(r("work.fact.waitingBudget")),t.status==="needs_user"&&a.push(r("work.fact.needsUser")),t.status==="ready"&&a.push(r("work.fact.ready")),t.status==="delivered"&&a.push(r("work.fact.delivered")),t.status==="failed"&&a.push(r("work.fact.failed")),t.revision>1&&(t.status==="enqueued"||t.status==="accepted")&&(a.push(r("work.fact.sameWorker")),a.push(r("work.fact.restart")));const o=Ik(t);return o&&a.push(o),a}function Bk(t){const i=t.events.filter(r=>r.kind==="question"&&r.text.trim()!=="");if(t.status==="needs_user")return{text:i.filter(a=>a.revision===t.revision&&a.applyStatus!=="stale").at(-1)?.text??"",stale:!1};if(t.revision>1&&(t.status==="enqueued"||t.status==="accepted"||t.status==="started")){const r=[...i].reverse().find(a=>a.applyStatus==="stale");if(r)return{text:r.text,stale:!0}}return null}function ju(t){return t==="foundations_dispatch"||t==="foundations_dispatch_canvas"}function tx(t){if(!ju(t.name)||t.result.trim()==="")return null;const i=kh(t.result);return i?i.ok===!1?null:typeof i.ticketId=="string"&&i.ticketId!==""?i.ticketId:null:/"ticketId"\s*:\s*"([^"]+)"/.exec(t.result)?.[1]??null}function Uk(t){if(!ju(t.name)||t.result.trim()==="")return!1;const i=kh(t.result);return i?i.ok===!1&&i.code==="BUDGET":t.result.includes('"BUDGET"')||/concurrency limit/i.test(t.result)}function Hk(t,i=Ai){const r=kh(t);return r&&typeof r.message=="string"&&r.message!==""?r.message:i("work.budgetFallback")}function nx(t,i){if(!t)return"";const r=Date.parse(t);if(!Number.isFinite(r))return"";const a=Math.max(0,Math.floor((i-r)/1e3)),o=Math.floor(a/60),u=a%60;return`${o}:${String(u).padStart(2,"0")}`}function ix(t){const i=Wb(t),r=["waiting_budget","needs_user","started","enqueued","accepted","ready","failed"];for(const a of r){const o=i.find(u=>u.status===a);if(o)return o}return i[0]??null}function Ik(t){return t.events.filter(r=>r.kind==="progress"&&r.applyStatus==="applied"&&r.revision===t.revision&&r.text.trim()!=="").at(-1)?.text??""}function Vk(t){if(!t||typeof t!="object")return[];const i=t;return typeof i.event_id!="string"||typeof i.kind!="string"?[]:[{eventId:i.event_id,kind:i.kind,applyStatus:typeof i.apply_status=="string"?i.apply_status:"",revision:typeof i.briefing_revision=="number"?i.briefing_revision:0,text:typeof i.text=="string"?i.text:""}]}function kh(t){try{const i=JSON.parse(t);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}const Yk="modulepreload",Fk=function(t){return"/dsh-bot/"+t},iv={},Gk=function(i,r,a){let o=Promise.resolve();if(r&&r.length>0){let g=function(p){return Promise.all(p.map(v=>Promise.resolve(v).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),h=c?.nonce||c?.getAttribute("nonce");o=g(r.map(p=>{if(p=Fk(p),p in iv)return;iv[p]=!0;const v=p.endsWith(".css"),y=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${y}`))return;const w=document.createElement("link");if(w.rel=v?"stylesheet":Yk,v||(w.as="script"),w.crossOrigin="",w.href=p,h&&w.setAttribute("nonce",h),document.head.appendChild(w),v)return new Promise((x,S)=>{w.addEventListener("load",x),w.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${p}`)))})}))}function u(c){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=c,window.dispatchEvent(h),!h.defaultPrevented)throw c}return o.then(c=>{for(const h of c||[])h.status==="rejected"&&u(h.reason);return i().catch(u)})};var Ds=_b();const lx=1120,xs=268,Cd=220,lv=400,rx=320,ax=960,Ns=640;function ha(t){return Number.isFinite(t)?Math.min(ax,Math.max(rx,Math.round(t))):Ns}function sx(t){return Math.max(0,(t-Math.min(lx,t))/2)}function wu(t){const i=sx(t);return{drawer:0,reserve:0,sidebar:xs,inset:i,insetRight:i,overlap:!1}}function rv(t,i){const r=Math.min(ax,Math.max(rx,i)),a=Math.min(lx,t),o=sx(t),u=Cd+lv;if(r<=o)return{drawer:r,reserve:0,sidebar:xs,inset:o,insetRight:o,overlap:!1};const c=Math.max(0,o-(r-o)),h=t-c-r;if(h<u)return{drawer:r,reserve:Math.max(0,t-u),sidebar:Cd,inset:0,insetRight:0,overlap:!0};const g=Math.max(0,a-h),p=Math.max(0,a-xs-lv),v=Math.max(0,xs-Cd),y=p+v,w=y===0?0:Math.min(p,g*p/y),x=Math.min(v,Math.max(0,g-w));return{drawer:r,reserve:r,sidebar:xs-x,inset:c,insetRight:0,overlap:!1}}let ca=null;function Su(t){const i=document.documentElement;i.style.setProperty("--files-inset",`${t.inset}px`),i.style.setProperty("--files-inset-right",`${t.insetRight}px`),i.style.setProperty("--files-reserve",`${t.reserve}px`),i.style.setProperty("--files-sidebar",`${t.sidebar}px`)}function av(t){if(ca!==t)return;ca=null,document.documentElement.classList.remove("files-push","files-closing","files-resizing"),Su(wu(0))}function ox(t){const{present:i,narrow:r,motion:a,width:o,resizing:u,viewport:c}=t,h=j.useRef(Symbol("drawer")),g=j.useRef(!1),p=j.useRef(i),v=j.useRef(a);p.current=i,v.current=a,j.useLayoutEffect(()=>{const y=document.documentElement,w=h.current;if(!i||r){g.current=!1,av(w);return}if(a==="out"&&ca!==null&&ca!==w){g.current=!1;return}ca=w;const x=a==="out"?wu(c):rv(c,o);if(y.classList.add("files-push"),y.classList.toggle("files-closing",a==="out"),y.classList.toggle("files-resizing",u),!g.current&&a!=="out"){g.current=!0,y.classList.add("files-resizing"),Su(wu(c));let S=!1;const T=requestAnimationFrame(()=>{if(S=!0,ca!==w||(y.classList.remove("files-resizing"),!p.current))return;const C=v.current==="out"?wu(window.innerWidth):rv(window.innerWidth,o);Su(C)});return()=>{cancelAnimationFrame(T),S||(g.current=!1)}}g.current=!0,Su(x)},[i,r,a,o,u,c]),j.useEffect(()=>()=>{g.current=!1,av(h.current)},[])}function _4(t){const i=t.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"}[i]??"plaintext"}function Qk(t){const i=t.split(".").pop()?.toLowerCase()??"";return i==="md"||i==="markdown"}function Xk(t,i){const r={};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Zk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Kk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$k={};function sv(t,i){return($k.jsx?Kk:Zk).test(t)}const Jk=/[ \t\n\f\r]/g;function Pk(t){return typeof t=="object"?t.type==="text"?ov(t.value):!1:ov(t)}function ov(t){return t.replace(Jk,"")===""}class Ls{constructor(i,r,a){this.normal=r,this.property=i,a&&(this.space=a)}}Ls.prototype.normal={};Ls.prototype.property={};Ls.prototype.space=void 0;function ux(t,i){const r={},a={};for(const o of t)Object.assign(r,o.property),Object.assign(a,o.normal);return new Ls(r,a,i)}function Pd(t){return t.toLowerCase()}class zn{constructor(i,r){this.attribute=r,this.property=i}}zn.prototype.attribute="";zn.prototype.booleanish=!1;zn.prototype.boolean=!1;zn.prototype.commaOrSpaceSeparated=!1;zn.prototype.commaSeparated=!1;zn.prototype.defined=!1;zn.prototype.mustUseProperty=!1;zn.prototype.number=!1;zn.prototype.overloadedBoolean=!1;zn.prototype.property="";zn.prototype.spaceSeparated=!1;zn.prototype.space=void 0;let Wk=0;const He=yr(),Pt=yr(),Wd=yr(),de=yr(),At=yr(),pr=yr(),Yn=yr();function yr(){return 2**++Wk}const eh=Object.freeze(Object.defineProperty({__proto__:null,boolean:He,booleanish:Pt,commaOrSpaceSeparated:Yn,commaSeparated:pr,number:de,overloadedBoolean:Wd,spaceSeparated:At},Symbol.toStringTag,{value:"Module"})),Nd=Object.keys(eh);class Eh extends zn{constructor(i,r,a,o){let u=-1;if(super(i,r),uv(this,"space",o),typeof a=="number")for(;++u<Nd.length;){const c=Nd[u];uv(this,Nd[u],(a&eh[c])===eh[c])}}}Eh.prototype.defined=!0;function uv(t,i,r){r&&(t[i]=r)}function ma(t){const i={},r={};for(const[a,o]of Object.entries(t.properties)){const u=new Eh(a,t.transform(t.attributes||{},a),o,t.space);t.mustUseProperty&&t.mustUseProperty.includes(a)&&(u.mustUseProperty=!0),i[a]=u,r[Pd(a)]=a,r[Pd(u.attribute)]=a}return new Ls(i,r,t.space)}const cx=ma({properties:{ariaActiveDescendant:null,ariaAtomic:Pt,ariaAutoComplete:null,ariaBusy:Pt,ariaChecked:Pt,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:At,ariaCurrent:null,ariaDescribedBy:At,ariaDetails:null,ariaDisabled:Pt,ariaDropEffect:At,ariaErrorMessage:null,ariaExpanded:Pt,ariaFlowTo:At,ariaGrabbed:Pt,ariaHasPopup:null,ariaHidden:Pt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:At,ariaLevel:de,ariaLive:null,ariaModal:Pt,ariaMultiLine:Pt,ariaMultiSelectable:Pt,ariaOrientation:null,ariaOwns:At,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:Pt,ariaReadOnly:Pt,ariaRelevant:null,ariaRequired:Pt,ariaRoleDescription:At,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:Pt,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(t,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function fx(t,i){return i in t?t[i]:i}function dx(t,i){return fx(t,i.toLowerCase())}const eE=ma({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:pr,acceptCharset:At,accessKey:At,action:null,allow:null,allowFullScreen:He,allowPaymentRequest:He,allowUserMedia:He,alpha:He,alt:null,as:null,async:He,autoCapitalize:null,autoComplete:At,autoFocus:He,autoPlay:He,blocking:At,capture:null,charSet:null,checked:He,cite:null,className:At,closedBy:null,colorSpace:null,cols:de,colSpan:de,command:null,commandFor:null,content:null,contentEditable:Pt,controls:He,controlsList:At,coords:de|pr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:He,defer:He,dir:null,dirName:null,disabled:He,download:Wd,draggable:Pt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:He,formTarget:null,headers:At,height:de,hidden:Wd,high:de,href:null,hrefLang:null,htmlFor:At,httpEquiv:At,id:null,imageSizes:null,imageSrcSet:null,inert:He,inputMode:null,integrity:null,is:null,isMap:He,itemId:null,itemProp:At,itemRef:At,itemScope:He,itemType:At,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:He,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:He,muted:He,name:null,nonce:null,noModule:He,noValidate:He,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:He,optimum:de,pattern:null,ping:At,placeholder:null,playsInline:He,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:He,referrerPolicy:null,rel:At,required:He,reversed:He,rows:de,rowSpan:de,sandbox:At,scope:null,scoped:He,seamless:He,selected:He,shadowRootClonable:He,shadowRootCustomElementRegistry:He,shadowRootDelegatesFocus:He,shadowRootMode:null,shadowRootSerializable:He,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:Pt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:He,useMap:null,value:Pt,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:At,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:He,declare:He,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:He,noHref:He,noShade:He,noWrap:He,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:Pt,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:He,disablePictureInPicture:He,disableRemotePlayback:He,exportParts:pr,part:At,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:dx}),tE=ma({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:Yn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:At,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:He,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:pr,g2:pr,glyphName:pr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:Yn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,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:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:At,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Yn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Yn,rev:Yn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Yn,requiredFeatures:Yn,requiredFonts:Yn,requiredFormats:Yn,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:Yn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Yn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Yn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:fx}),hx=ma({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,i){return"xlink:"+i.slice(5).toLowerCase()}}),mx=ma({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:dx}),px=ma({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,i){return"xml:"+i.slice(3).toLowerCase()}}),nE={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"},iE=/[A-Z]/g,cv=/-[a-z]/g,lE=/^data[-\w.:]+$/i;function rE(t,i){const r=Pd(i);let a=i,o=zn;if(r in t.normal)return t.property[t.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&lE.test(i)){if(i.charAt(4)==="-"){const u=i.slice(5).replace(cv,sE);a="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=i.slice(4);if(!cv.test(u)){let c=u.replace(iE,aE);c.charAt(0)!=="-"&&(c="-"+c),i="data"+c}}o=Eh}return new o(a,i)}function aE(t){return"-"+t.toLowerCase()}function sE(t){return t.charAt(1).toUpperCase()}const oE=ux([cx,eE,hx,mx,px],"html"),Th=ux([cx,tE,hx,mx,px],"svg");function uE(t){return t.join(" ").trim()}var fv=/\/\*(?:[^*]|\*(?!\/))*\*\//g,cE=/\n/g,fE=/^\s*/,dE=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,hE=/^:\s*/,mE=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,pE=/^[;\s]*/,gE=`
18
- `,dv="/",hv="*",gs="",yE="comment",vE="declaration";function bE(t,i){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];i=i||{};var r=1,a=1;function o(S){var T=S.match(cE);T&&(r+=T.length);var C=S.lastIndexOf(gE);a=~C?S.length-C:a+S.length}function u(){var S={line:r,column:a};return function(T){return T.position=new c(S),p(),T}}function c(S){this.start=S,this.end={line:r,column:a},this.source=i.source}c.prototype.content=t;function h(S){var T=new Error(i.source+":"+r+":"+a+": "+S);if(T.reason=S,T.filename=i.source,T.line=r,T.column=a,T.source=t,!i.silent)throw T}function g(S){var T=S.exec(t);if(T){var C=T[0];return o(C),t=t.slice(C.length),T}}function p(){g(fE)}function v(S){for(var T;T=y();)S.push(T);return S}function y(){var S=u();if(!(dv!=t.charAt(0)||hv!=t.charAt(1))){for(var T=2;gs!=t.charAt(T)&&(hv!=t.charAt(T)||dv!=t.charAt(T+1));)++T;if(T+=2,gs===t.charAt(T-1))return h("End of comment missing");var C=t.slice(2,T-2);return a+=2,o(C),t=t.slice(T),a+=2,S({type:yE,comment:C})}}function w(){var S=u(),T=g(dE);if(T){if(y(),!g(hE))return h("property missing ':'");var C=g(mE),E=S({type:vE,property:T[0].replace(fv,gs).trim(),value:C?C[0].replace(fv,gs).trim():gs});return g(pE),E}}function x(){var S=[];v(S);for(var T;T=w();)S.push(T),v(S);return S}return p(),x()}function xE(t,i){let r=null;if(!t||typeof t!="string")return r;const a=bE(t),o=typeof i=="function";return a.forEach(u=>{if(u.type!=="declaration")return;const{property:c,value:h}=u;o?i(c,h,u):h&&(r=r??{},r[c]=h)}),r}const gx=yx("end"),jh=yx("start");function yx(t){return i;function i(r){const a=r&&r.position&&r.position[t]||{};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 wE(t){const i=jh(t),r=gx(t);if(i&&r)return{start:i,end:r}}function Ss(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?mv(t.position):"start"in t||"end"in t?mv(t):"line"in t||"column"in t?th(t):""}function th(t){return pv(t&&t.line)+":"+pv(t&&t.column)}function mv(t){return th(t&&t.start)+"-"+th(t&&t.end)}function pv(t){return t&&typeof t=="number"?t:1}class Iu extends Error{constructor(i,r,a){super(),typeof r=="string"&&(a=r,r=void 0);let o="",u={},c=!1;if(r&&("line"in r&&"column"in r?u={place:r}:"start"in r&&"end"in r?u={place:r}:"type"in r?u={ancestors:[r],place:r.position}:u={...r}),typeof i=="string"?o=i:!u.cause&&i&&(c=!0,o=i.message,u.cause=i),!u.ruleId&&!u.source&&typeof a=="string"){const g=a.indexOf(":");g===-1?u.ruleId=a:(u.source=a.slice(0,g),u.ruleId=a.slice(g+1))}if(!u.place&&u.ancestors){const g=u.ancestors[u.ancestors.length-1];g&&(u.place=g.position)}const h=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=h?h.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=h?h.line:void 0,this.name=Ss(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=c&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Object.defineProperties(Iu.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 Ch={}.hasOwnProperty,SE=new Map,kE=/[A-Z]/g,EE=/-([a-z])/g,TE=new Set(["table","tbody","thead","tfoot","tr"]),jE=new Set(["td","th"]),vx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function CE(t,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=i.filePath||void 0;let a;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=qE(r,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=ME(r,i.jsx,i.jsxs)}const o={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:a,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?Th:oE,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},u=bx(o,t,void 0);return u&&typeof u!="string"?u:o.create(t,o.Fragment,{children:u||void 0},void 0)}function bx(t,i,r){if(i.type==="element")return NE(t,i,r);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return AE(t,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return RE(t,i,r);if(i.type==="mdxjsEsm")return OE(t,i);if(i.type==="root")return _E(t,i,r);if(i.type==="text")return zE(t,i)}function NE(t,i,r){const a=t.schema;let o=a;i.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=Th,t.schema=o),t.ancestors.push(i);const u=wx(t,i.tagName,!1),c=DE(t,i);let h=Ah(t,i);return TE.has(i.tagName)&&(h=h.filter(function(g){return typeof g=="string"?!Pk(g):!0})),xx(t,c,u,i),Nh(c,h),t.ancestors.pop(),t.schema=a,t.create(i,u,c,r)}function AE(t,i){if(i.data&&i.data.estree&&t.evaluater){const a=i.data.estree.body[0];return a.type,t.evaluater.evaluateExpression(a.expression)}As(t,i.position)}function OE(t,i){if(i.data&&i.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(i.data.estree);As(t,i.position)}function RE(t,i,r){const a=t.schema;let o=a;i.name==="svg"&&a.space==="html"&&(o=Th,t.schema=o),t.ancestors.push(i);const u=i.name===null?t.Fragment:wx(t,i.name,!0),c=LE(t,i),h=Ah(t,i);return xx(t,c,u,i),Nh(c,h),t.ancestors.pop(),t.schema=a,t.create(i,u,c,r)}function _E(t,i,r){const a={};return Nh(a,Ah(t,i)),t.create(i,t.Fragment,a,r)}function zE(t,i){return i.value}function xx(t,i,r,a){typeof r!="string"&&r!==t.Fragment&&t.passNode&&(i.node=a)}function Nh(t,i){if(i.length>0){const r=i.length>1?i:i[0];r&&(t.children=r)}}function ME(t,i,r){return a;function a(o,u,c,h){const p=Array.isArray(c.children)?r:i;return h?p(u,c,h):p(u,c)}}function qE(t,i){return r;function r(a,o,u,c){const h=Array.isArray(u.children),g=jh(a);return i(o,u,c,h,{columnNumber:g?g.column-1:void 0,fileName:t,lineNumber:g?g.line:void 0},void 0)}}function DE(t,i){const r={};let a,o;for(o in i.properties)if(o!=="children"&&Ch.call(i.properties,o)){const u=BE(t,o,i.properties[o]);if(u){const[c,h]=u;t.tableCellAlignToStyle&&c==="align"&&typeof h=="string"&&jE.has(i.tagName)?a=h:r[c]=h}}if(a){const u=r.style||(r.style={});u[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return r}function LE(t,i){const r={};for(const a of i.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&t.evaluater){const u=a.data.estree.body[0];u.type;const c=u.expression;c.type;const h=c.properties[0];h.type,Object.assign(r,t.evaluater.evaluateExpression(h.argument))}else As(t,i.position);else{const{name:o}=a;let u;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&t.evaluater){const h=a.value.data.estree.body[0];h.type,u=t.evaluater.evaluateExpression(h.expression)}else As(t,i.position);else u=a.value===null?!0:a.value;r[o]=u}return r}function Ah(t,i){const r=[];let a=-1;const o=t.passKeys?new Map:SE;for(;++a<i.children.length;){const u=i.children[a];let c;if(t.passKeys){const g=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(g){const p=o.get(g)||0;c=g+"-"+p,o.set(g,p+1)}}const h=bx(t,u,c);h!==void 0&&r.push(h)}return r}function BE(t,i,r){if(r==null||typeof r=="number"&&Number.isNaN(r))return;const a=rE(t.schema,i);return Array.isArray(r)&&(r=a.commaSeparated?Xk(r):uE(r)),a.property==="style"?["style",typeof r=="object"?t.stylePropertyNameCase==="dom"?r:HE(r):UE(t,String(r))]:[t.elementAttributeNameCase==="react"&&a.space?nE[a.property]||a.property:a.attribute,r]}function UE(t,i){const r={};try{xE(i,function(a,o){if(a&&o){let u=a;u.slice(0,2)!=="--"&&(u=u.toLowerCase(),t.stylePropertyNameCase==="dom"&&(u.slice(0,4)==="-ms-"&&(u=u.slice(1)),u=u.replace(EE,YE))),r[u]=o}})}catch(a){if(t.ignoreInvalidStyle)return{};const o=a,u=new Iu("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=t.filePath||void 0,u.url=vx+"#cannot-parse-style-attribute",u}return r}function wx(t,i,r){let a;if(!r)a={type:"Literal",value:i};else if(i.includes(".")){const o=i.split(".");let u=-1,c;for(;++u<o.length;){const h=sv(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};c=c?{type:"MemberExpression",object:c,property:h,computed:!!(u&&h.type==="Literal"),optional:!1}:h}a=c}else a=sv(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(a.type==="Literal"){const o=a.value;return Ch.call(t.components,o)?t.components[o]:o}if(t.evaluater)return t.evaluater.evaluateExpression(a);As(t)}function As(t,i){const r=new Iu("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=vx+"#cannot-handle-mdx-estrees-without-createevaluater",r}function HE(t){const i={};let r;for(r in t)Ch.call(t,r)&&(i[IE(r)]=t[r]);return i}function IE(t){if(t.slice(0,2)==="--")return t;let i=t.replace(kE,VE);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function VE(t){return"-"+t.toLowerCase()}function YE(t,i){return i.toUpperCase()}const Ad={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"]},FE={};function Vu(t,i){const r=FE,a=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Sx(t,a,o)}function Sx(t,i,r){if(GE(t)){if("value"in t)return t.type==="html"&&!r?"":t.value;if(i&&"alt"in t&&t.alt)return t.alt;if("children"in t)return gv(t.children,i,r)}return Array.isArray(t)?gv(t,i,r):""}function gv(t,i,r){const a=[];let o=-1;for(;++o<t.length;)a[o]=Sx(t[o],i,r);return a.join("")}function GE(t){return!!(t&&typeof t=="object")}const yv=document.createElement("i");function Oh(t){const i="&"+t+";";yv.innerHTML=i;const r=yv.textContent;return r.charCodeAt(r.length-1)===59&&t!=="semi"||r===i?!1:r}function fi(t,i,r,a){const o=t.length;let u=0,c;if(i<0?i=-i>o?0:o+i:i=i>o?o:i,r=r>0?r:0,a.length<1e4)c=Array.from(a),c.unshift(i,r),t.splice(...c);else for(r&&t.splice(i,r);u<a.length;)c=a.slice(u,u+1e4),c.unshift(i,0),t.splice(...c),u+=1e4,i+=1e4}function ei(t,i){return t.length>0?(fi(t,t.length,0,i),t):i}const vv={}.hasOwnProperty;function kx(t){const i={};let r=-1;for(;++r<t.length;)QE(i,t[r]);return i}function QE(t,i){let r;for(r in i){const o=(vv.call(t,r)?t[r]:void 0)||(t[r]={}),u=i[r];let c;if(u)for(c in u){vv.call(o,c)||(o[c]=[]);const h=u[c];XE(o[c],Array.isArray(h)?h:h?[h]:[])}}}function XE(t,i){let r=-1;const a=[];for(;++r<i.length;)(i[r].add==="after"?t:a).push(i[r]);fi(t,0,0,a)}function Ex(t,i){const r=Number.parseInt(t,i);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 di(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yn=Rl(/[A-Za-z]/),vn=Rl(/[\dA-Za-z]/),ZE=Rl(/[#-'*+\--9=?A-Z^-~]/);function Cu(t){return t!==null&&(t<32||t===127)}const nh=Rl(/\d/),KE=Rl(/[\dA-Fa-f]/),Tx=Rl(/[!-/:-@[-`{-~]/);function qe(t){return t!==null&&t<-2}function Ot(t){return t!==null&&(t<0||t===32)}function Pe(t){return t===-2||t===-1||t===32}const Bs=Rl(new RegExp("\\p{P}|\\p{S}","u")),gr=Rl(/\s/);function Rl(t){return i;function i(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function pa(t){const i=[];let r=-1,a=0,o=0;for(;++r<t.length;){const u=t.charCodeAt(r);let c="";if(u===37&&vn(t.charCodeAt(r+1))&&vn(t.charCodeAt(r+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(c=String.fromCharCode(u));else if(u>55295&&u<57344){const h=t.charCodeAt(r+1);u<56320&&h>56319&&h<57344?(c=String.fromCharCode(u,h),o=1):c="�"}else c=String.fromCharCode(u);c&&(i.push(t.slice(a,r),encodeURIComponent(c)),a=r+o+1,c=""),o&&(r+=o,o=0)}return i.join("")+t.slice(a)}function pt(t,i,r,a){const o=a?a-1:1/0;let u=0;return c;function c(g){return Pe(g)?(t.enter(r),h(g)):i(g)}function h(g){return Pe(g)&&u++<o?(t.consume(g),h):(t.exit(r),i(g))}}function jx(t,i,r,a,o,u){let c=0;return h;function h(v){return Pe(v)?(t.enter(a),g(v)):p(v)}function g(v){return Pe(v)&&c<u?(t.consume(v),c++,g):(t.exit(a),p(v))}function p(v){return c>=o?i(v):r(v)}}const $E={tokenize:JE};function JE(t){const i=t.attempt(this.parser.constructs.contentInitial,a,o);let r;return i;function a(h){if(h===null){t.consume(h);return}return t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),pt(t,i,"linePrefix")}function o(h){return t.enter("paragraph"),u(h)}function u(h){const g=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=g),r=g,c(h)}function c(h){if(h===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(h);return}return qe(h)?(t.consume(h),t.exit("chunkText"),u):(t.consume(h),c)}}let Nu=class{constructor(){this.index=new Map,this.map=[]}add(i,r,a){bv(this,i,r,a,!1)}addBefore(i,r,a){bv(this,i,r,a,!0)}consume(i){if(this.map.sort(function(u,c){return u[0]-c[0]}),this.map.length===0)return;let r=this.map.length;const a=[];for(;r>0;)r-=1,a.push(i.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),i.length=this.map[r][0];a.push(i.slice()),i.length=0;let o=a.pop();for(;o;){for(const u of o)i.push(u);o=a.pop()}this.map.length=0,this.index.clear()}};function bv(t,i,r,a,o){if(r===0&&a.length===0)return;const u=t.index.get(i);if(u){u[1]+=r,o?(a.push(...u[2]),u[2]=a):u[2].push(...a);return}const c=[i,r,a];t.map.push(c),t.index.set(i,c)}const PE={tokenize:WE},xv={tokenize:eT};function WE(t){const i=this,r=[];let a=0,o,u,c;return h;function h(B){if(a<r.length){const ee=r[a];return i.containerState=ee[1],t.attempt(ee[0].continuation,g,p)(B)}return p(B)}function g(B){if(a++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,o&&q();const ee=i.events.length;let X=ee,O;for(;X--;)if(i.events[X][0]==="exit"&&i.events[X][1].type==="chunkFlow"){O=i.events[X][1].end;break}E(a);let Y=ee;for(;Y<i.events.length;)i.events[Y][1].end={...O},Y++;const K=new Nu;return K.add(X+1,0,i.events.slice(ee)),K.add(ee,Y-ee,[]),K.consume(i.events),p(B)}return h(B)}function p(B){if(a===r.length){if(!o)return w(B);if(o.currentConstruct&&o.currentConstruct.concrete)return S(B);i.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return i.containerState={},t.check(xv,v,y)(B)}function v(B){return o&&q(),E(a),w(B)}function y(B){return i.parser.lazy[i.now().line]=a!==r.length,c=i.now().offset,S(B)}function w(B){return i.containerState={},t.attempt(xv,x,S)(B)}function x(B){return a++,r.push([i.currentConstruct,i.containerState]),w(B)}function S(B){if(B===null){o&&q(),E(0),t.consume(B);return}return o=o||i.parser.flow(i.now()),t.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),T(B)}function T(B){if(B===null){C(t.exit("chunkFlow"),!0),E(0),t.consume(B);return}return qe(B)?(t.consume(B),C(t.exit("chunkFlow")),a=0,i.interrupt=void 0,h):(t.consume(B),T)}function C(B,ee){const X=i.sliceStream(B);if(ee&&X.push(null),B.previous=u,u&&(u.next=B),u=B,o.defineSkip(B.start),o.write(X),i.parser.lazy[B.start.line]){let O=o.events.length;for(;O--;)if(o.events[O][1].start.offset<c&&(!o.events[O][1].end||o.events[O][1].end.offset>c))return;const Y=i.events.length;let K=Y,se,_;for(;K--;)if(i.events[K][0]==="exit"&&i.events[K][1].type==="chunkFlow"){if(se){_=i.events[K][1].end;break}se=!0}for(E(a),O=Y;O<i.events.length;)i.events[O][1].end={..._},O++;const G=new Nu;G.add(K+1,0,i.events.slice(Y)),G.add(Y,O-Y,[]),G.consume(i.events)}}function E(B){let ee=r.length;for(;ee-- >B;){const X=r[ee];i.containerState=X[1],X[0].exit.call(i,t)}r.length=B}function q(){o.write([null]),u=void 0,o=void 0,i.containerState._closeFlow=void 0}}function eT(t,i,r){return pt(t,t.attempt(this.parser.constructs.document,i,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ol(t){if(t===null||Ot(t)||gr(t))return 1;if(Bs(t))return 2}function Yu(t,i,r){const a=[];let o=-1;for(;++o<t.length;){const u=t[o].resolveAll;u&&!a.includes(u)&&(i=u(i,r),a.push(u))}return i}const ih={name:"attention",resolveAll:tT,tokenize:nT};function tT(t,i){let r=-1,a;for(;++r<t.length;)if(t[r][0]==="enter"&&t[r][1].type==="attentionSequence"&&t[r][1]._close){let o=r;for(;o--;)if(t[o][0]==="exit"&&t[o][1].type==="attentionSequence"&&t[o][1]._open&&i.sliceSerialize(t[o][1]).charCodeAt(0)===i.sliceSerialize(t[r][1]).charCodeAt(0)){if((t[o][1]._close||t[r][1]._open)&&(t[r][1].end.offset-t[r][1].start.offset)%3&&!((t[o][1].end.offset-t[o][1].start.offset+t[r][1].end.offset-t[r][1].start.offset)%3))continue;const u=t[o][1].end.offset-t[o][1].start.offset>1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1,c={...t[o][1].end},h={...t[r][1].start};wv(c,-u),wv(h,u);const g={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...t[o][1].end}},p={type:u>1?"strongSequence":"emphasisSequence",start:{...t[r][1].start},end:h},v={type:u>1?"strongText":"emphasisText",start:{...t[o][1].end},end:{...t[r][1].start}},y={type:u>1?"strong":"emphasis",start:{...g.start},end:{...p.end}};t[o][1].end={...g.start},t[r][1].start={...p.end},a=[],t[o][1].end.offset-t[o][1].start.offset&&(a=ei(a,[["enter",t[o][1],i],["exit",t[o][1],i]])),a=ei(a,[["enter",y,i],["enter",g,i],["exit",g,i],["enter",v,i]]),a=ei(a,Yu(i.parser.constructs.insideSpan.null,t.slice(o+1,r),i)),a=ei(a,[["exit",v,i],["enter",p,i],["exit",p,i],["exit",y,i]]);let w=0;t[r][1].end.offset-t[r][1].start.offset&&(w=2,a=ei(a,[["enter",t[r][1],i],["exit",t[r][1],i]])),fi(t,o-1,r-o+3,a),r=o+a.length-w-2;break}}for(r=-1;++r<t.length;)t[r][1].type==="attentionSequence"&&(t[r][1].type="data");return t}function nT(t,i){const r=this.parser.constructs.attentionMarkers.null,a=this.previous,o=Ol(a);let u;return c;function c(g){return u=g,t.enter("attentionSequence"),h(g)}function h(g){if(g===u)return t.consume(g),h;const p=t.exit("attentionSequence"),v=Ol(g),y=!v||v===2&&o||r.includes(g)&&g!==42&&g!==95,w=!o||o===2&&v||r.includes(a)&&a!==42&&a!==95;return p._open=!!(u===42?y:y&&(o||!w)),p._close=!!(u===42?w:w&&(v||!y)),i(g)}}function wv(t,i){t.column+=i,t.offset+=i,t._bufferIndex+=i}const iT={name:"autolink",tokenize:lT};function lT(t,i,r){let a=0;return o;function o(x){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),u}function u(x){return yn(x)?(t.consume(x),c):x===64?r(x):p(x)}function c(x){return x===43||x===45||x===46||vn(x)?(a=1,h(x)):p(x)}function h(x){return x===58?(t.consume(x),a=0,g):(x===43||x===45||x===46||vn(x))&&a++<32?(t.consume(x),h):(a=0,p(x))}function g(x){return x===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),i):x===null||x===32||x===60||Cu(x)?r(x):(t.consume(x),g)}function p(x){return x===64?(t.consume(x),v):ZE(x)?(t.consume(x),p):r(x)}function v(x){return vn(x)?y(x):r(x)}function y(x){return x===46?(t.consume(x),a=0,v):x===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),i):w(x)}function w(x){if((x===45||vn(x))&&a++<63){const S=x===45?w:y;return t.consume(x),S}return r(x)}}const Us={partial:!0,tokenize:rT};function rT(t,i,r){return a;function a(u){return Pe(u)?pt(t,o,"linePrefix")(u):o(u)}function o(u){return u===null||qe(u)?i(u):r(u)}}const Cx={continuation:{tokenize:sT},exit:oT,name:"blockQuote",tokenize:aT};function aT(t,i,r){const a=this;return o;function o(c){if(c===62){const h=a.containerState;return h.open||(t.enter("blockQuote",{_container:!0}),h.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(c),t.exit("blockQuoteMarker"),u}return r(c)}function u(c){return Pe(c)?(t.enter("blockQuotePrefixWhitespace"),t.consume(c),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),i):(t.exit("blockQuotePrefix"),i(c))}}function sT(t,i,r){const a=this;return o;function o(c){return Pe(c)?pt(t,u,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):u(c)}function u(c){return t.attempt(Cx,i,r)(c)}}function oT(t){t.exit("blockQuote")}const Nx={name:"characterEscape",tokenize:uT};function uT(t,i,r){return a;function a(u){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(u),t.exit("escapeMarker"),o}function o(u){return Tx(u)?(t.enter("characterEscapeValue"),t.consume(u),t.exit("characterEscapeValue"),t.exit("characterEscape"),i):r(u)}}const Ax={name:"characterReference",tokenize:cT};function cT(t,i,r){const a=this;let o=0,u,c;return h;function h(y){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(y),t.exit("characterReferenceMarker"),g}function g(y){return y===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(y),t.exit("characterReferenceMarkerNumeric"),p):(t.enter("characterReferenceValue"),u=31,c=vn,v(y))}function p(y){return y===88||y===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(y),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),u=6,c=KE,v):(t.enter("characterReferenceValue"),u=7,c=nh,v(y))}function v(y){if(y===59&&o){const w=t.exit("characterReferenceValue");return c===vn&&!Oh(a.sliceSerialize(w))?r(y):(t.enter("characterReferenceMarker"),t.consume(y),t.exit("characterReferenceMarker"),t.exit("characterReference"),i)}return c(y)&&o++<u?(t.consume(y),v):r(y)}}const lh={partial:!0,tokenize:fT};function fT(t,i,r){const a=this;return o;function o(c){return c===null?r(c):(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),u)}function u(c){return a.parser.lazy[a.now().line]?r(c):i(c)}}const Sv={concrete:!0,name:"codeFenced",tokenize:dT};function dT(t,i,r){const a=this,o={partial:!0,tokenize:X};let u=0,c=0,h;return g;function g(O){return p(O)}function p(O){const Y=a.events[a.events.length-1];return u=Y&&Y[1].type==="linePrefix"?Y[2].sliceSerialize(Y[1],!0).length:0,h=O,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),v(O)}function v(O){return O===h?(c++,t.consume(O),v):c<3?r(O):(t.exit("codeFencedFenceSequence"),Pe(O)?pt(t,y,"whitespace")(O):y(O))}function y(O){return O===null||qe(O)?(t.exit("codeFencedFence"),a.interrupt?i(O):t.check(lh,T,ee)(O)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),w(O))}function w(O){return O===null||qe(O)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),y(O)):Pe(O)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),pt(t,x,"whitespace")(O)):O===96&&O===h?r(O):(t.consume(O),w)}function x(O){return O===null||qe(O)?y(O):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),S(O))}function S(O){return O===null||qe(O)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),y(O)):O===96&&O===h?r(O):(t.consume(O),S)}function T(O){return t.attempt(o,ee,C)(O)}function C(O){return t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),E}function E(O){return u>0&&Pe(O)?pt(t,q,"linePrefix",u+1)(O):q(O)}function q(O){return O===null||qe(O)?t.check(lh,T,ee)(O):(t.enter("codeFlowValue"),B(O))}function B(O){return O===null||qe(O)?(t.exit("codeFlowValue"),q(O)):(t.consume(O),B)}function ee(O){return t.exit("codeFenced"),i(O)}function X(O,Y,K){let se=0;return _;function _(fe){return O.enter("lineEnding"),O.consume(fe),O.exit("lineEnding"),G}function G(fe){return O.enter("codeFencedFence"),Pe(fe)?pt(O,te,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(fe):te(fe)}function te(fe){return fe===h?(O.enter("codeFencedFenceSequence"),Te(fe)):K(fe)}function Te(fe){return fe===h?(se++,O.consume(fe),Te):se>=c?(O.exit("codeFencedFenceSequence"),Pe(fe)?pt(O,xe,"whitespace")(fe):xe(fe)):K(fe)}function xe(fe){return fe===null||qe(fe)?(O.exit("codeFencedFence"),Y(fe)):K(fe)}}}const Od={name:"codeIndented",tokenize:mT},hT={partial:!0,tokenize:pT};function mT(t,i,r){return a;function a(h){return t.enter("codeIndented"),jx(t,o,r,"linePrefix",4,4)(h)}function o(h){return h===null?c(h):qe(h)?t.attempt(hT,o,c)(h):(t.enter("codeFlowValue"),u(h))}function u(h){return h===null||qe(h)?(t.exit("codeFlowValue"),o(h)):(t.consume(h),u)}function c(h){return t.exit("codeIndented"),i(h)}}function pT(t,i,r){const a=this;return o;function o(c){return a.parser.lazy[a.now().line]?r(c):qe(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),o):jx(t,i,u,"linePrefix",4,4)(c)}function u(c){return qe(c)?o(c):r(c)}}const gT={name:"codeText",previous:vT,resolve:yT,tokenize:bT};function yT(t){let i=t.length-4,r=3,a,o;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[i][1].type==="lineEnding"||t[i][1].type==="space")){for(a=r;++a<i;)if(t[a][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[i][1].type="codeTextPadding",r+=2,i-=2;break}}for(a=r-1,i++;++a<=i;)o===void 0?a!==i&&t[a][1].type!=="lineEnding"&&(o=a):(a===i||t[a][1].type==="lineEnding")&&(t[o][1].type="codeTextData",a!==o+2&&(t[o][1].end=t[a-1][1].end,t.splice(o+2,a-o-2),i-=a-o-2,a=o+2),o=void 0);return t}function vT(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function bT(t,i,r){let a=0,o,u;return c;function c(y){return t.enter("codeText"),t.enter("codeTextSequence"),h(y)}function h(y){return y===96?(t.consume(y),a++,h):(t.exit("codeTextSequence"),g(y))}function g(y){return y===null?r(y):y===32?(t.enter("space"),t.consume(y),t.exit("space"),g):y===96?(u=t.enter("codeTextSequence"),o=0,v(y)):qe(y)?(t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),g):(t.enter("codeTextData"),p(y))}function p(y){return y===null||y===32||y===96||qe(y)?(t.exit("codeTextData"),g(y)):(t.consume(y),p)}function v(y){return y===96?(t.consume(y),o++,v):o===a?(t.exit("codeTextSequence"),t.exit("codeText"),i(y)):(u.type="codeTextData",p(y))}}class xT{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,r){const a=r??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(i,a):i>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(i,r,a){const o=r||0;this.setCursor(Math.trunc(i));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return a&&ys(this.left,a),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),ys(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),ys(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const r=this.left.splice(i,Number.POSITIVE_INFINITY);ys(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);ys(this.left,r.reverse())}}}function ys(t,i){let r=0;if(i.length<1e4)t.push(...i);else for(;r<i.length;)t.push(...i.slice(r,r+1e4)),r+=1e4}function Ox(t){const i={};let r=-1,a,o,u,c,h,g,p;const v=new xT(t);for(;++r<v.length;){for(;r in i;)r=i[r];if(a=v.get(r),r&&a[1].type==="chunkFlow"&&v.get(r-1)[1].type==="listItemPrefix"&&(g=a[1]._tokenizer.events,u=0,u<g.length&&g[u][1].type==="lineEndingBlank"&&(u+=2),u<g.length&&g[u][1].type==="content"))for(;++u<g.length&&g[u][1].type!=="content";)g[u][1].type==="chunkText"&&(g[u][1]._isInFirstContentOfListItem=!0,u++);if(a[0]==="enter")a[1].contentType&&(Object.assign(i,wT(v,r)),r=i[r],p=!0);else if(a[1]._container){for(u=r,o=void 0;u--;)if(c=v.get(u),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(o&&(v.get(o)[1].type="lineEndingBlank"),c[1].type="lineEnding",o=u);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;o&&(a[1].end={...v.get(o)[1].start},h=v.slice(o,r),h.unshift(a),v.splice(o,r-o+1,h))}}return fi(t,0,Number.POSITIVE_INFINITY,v.slice(0)),!p}function wT(t,i){const r=t.get(i)[1],a=t.get(i)[2];let o=i-1;const u=[];let c=r._tokenizer;c||(c=a.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const h=c.events,g=[],p={};let v,y,w=-1,x=r,S=0,T=0;const C=[T];for(;x;){for(;t.get(++o)[1]!==x;);u.push(o),x._tokenizer||(v=a.sliceStream(x),x.next||v.push(null),y&&c.defineSkip(x.start),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(v),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),y=x,x=x.next}for(x=r;++w<h.length;)h[w][0]==="exit"&&h[w-1][0]==="enter"&&h[w][1].type===h[w-1][1].type&&h[w][1].start.line!==h[w][1].end.line&&(T=w+1,C.push(T),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(c.events=[],x?(x._tokenizer=void 0,x.previous=void 0):C.pop(),w=C.length;w--;){const E=h.slice(C[w],C[w+1]),q=u.pop();g.push([q,q+E.length-1]),t.splice(q,2,E)}for(g.reverse(),w=-1;++w<g.length;)p[S+g[w][0]]=S+g[w][1],S+=g[w][1]-g[w][0]-1;return p}const ST={resolve:ET,tokenize:TT},kT={partial:!0,tokenize:jT};function ET(t){return Ox(t),t}function TT(t,i){let r;return a;function a(h){return t.enter("content"),r=t.enter("chunkContent",{contentType:"content"}),o(h)}function o(h){return h===null?u(h):qe(h)?t.check(kT,c,u)(h):(t.consume(h),o)}function u(h){return t.exit("chunkContent"),t.exit("content"),i(h)}function c(h){return t.consume(h),t.exit("chunkContent"),r.next=t.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function jT(t,i,r){const a=this;return o;function o(c){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),pt(t,u,"linePrefix")}function u(c){if(c===null||qe(c))return r(c);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?i(c):t.interrupt(a.parser.constructs.flow,r,i)(c)}}function Rx(t,i,r,a,o,u,c,h,g){const p=g||Number.POSITIVE_INFINITY;let v=0;return y;function y(E){return E===60?(t.enter(a),t.enter(o),t.enter(u),t.consume(E),t.exit(u),w):E===null||E===32||E===41||Cu(E)?r(E):(t.enter(a),t.enter(c),t.enter(h),t.enter("chunkString",{contentType:"string"}),T(E))}function w(E){return E===62?(t.enter(u),t.consume(E),t.exit(u),t.exit(o),t.exit(a),i):(t.enter(h),t.enter("chunkString",{contentType:"string"}),x(E))}function x(E){return E===62?(t.exit("chunkString"),t.exit(h),w(E)):E===null||E===60||qe(E)?r(E):(t.consume(E),E===92?S:x)}function S(E){return E===60||E===62||E===92?(t.consume(E),x):x(E)}function T(E){return!v&&(E===null||E===41||Ot(E))?(t.exit("chunkString"),t.exit(h),t.exit(c),t.exit(a),i(E)):v<p&&E===40?(t.consume(E),v++,T):E===41?(t.consume(E),v--,T):E===null||E===32||E===40||Cu(E)?r(E):(t.consume(E),E===92?C:T)}function C(E){return E===40||E===41||E===92?(t.consume(E),T):T(E)}}function _x(t,i,r,a,o,u){const c=this;let h=0,g;return p;function p(x){return t.enter(a),t.enter(o),t.consume(x),t.exit(o),t.enter(u),v}function v(x){return h>999||x===null||x===91||x===93&&!g||x===94&&!h&&"_hiddenFootnoteSupport"in c.parser.constructs?r(x):x===93?(t.exit(u),t.enter(o),t.consume(x),t.exit(o),t.exit(a),i):qe(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),v):(t.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===null||x===91||x===93||qe(x)||h++>999?(t.exit("chunkString"),v(x)):(t.consume(x),g||(g=!Pe(x)),x===92?w:y)}function w(x){return x===91||x===92||x===93?(t.consume(x),h++,y):y(x)}}function zx(t,i,r,a,o,u){let c;return h;function h(w){return w===34||w===39||w===40?(t.enter(a),t.enter(o),t.consume(w),t.exit(o),c=w===40?41:w,g):r(w)}function g(w){return w===c?(t.enter(o),t.consume(w),t.exit(o),t.exit(a),i):(t.enter(u),p(w))}function p(w){return w===c?(t.exit(u),g(c)):w===null?r(w):qe(w)?(t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),pt(t,p,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),v(w))}function v(w){return w===c||w===null||qe(w)?(t.exit("chunkString"),p(w)):(t.consume(w),w===92?y:v)}function y(w){return w===c||w===92?(t.consume(w),v):v(w)}}function ks(t,i){let r;return a;function a(o){return qe(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r=!0,a):Pe(o)?pt(t,a,r?"linePrefix":"lineSuffix")(o):i(o)}}const CT={name:"definition",tokenize:AT},NT={partial:!0,tokenize:OT};function AT(t,i,r){const a=this;let o;return u;function u(x){return t.enter("definition"),c(x)}function c(x){return _x.call(a,t,h,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function h(x){return o=di(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),x===58?(t.enter("definitionMarker"),t.consume(x),t.exit("definitionMarker"),g):r(x)}function g(x){return Ot(x)?ks(t,p)(x):p(x)}function p(x){return Rx(t,v,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function v(x){return t.attempt(NT,y,y)(x)}function y(x){return Pe(x)?pt(t,w,"whitespace")(x):w(x)}function w(x){return x===null||qe(x)?(t.exit("definition"),a.parser.defined.push(o),i(x)):r(x)}}function OT(t,i,r){return a;function a(h){return Ot(h)?ks(t,o)(h):r(h)}function o(h){return zx(t,u,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function u(h){return Pe(h)?pt(t,c,"whitespace")(h):c(h)}function c(h){return h===null||qe(h)?i(h):r(h)}}const RT={name:"hardBreakEscape",tokenize:_T};function _T(t,i,r){return a;function a(u){return t.enter("hardBreakEscape"),t.consume(u),o}function o(u){return qe(u)?(t.exit("hardBreakEscape"),i(u)):r(u)}}const zT={name:"headingAtx",resolve:MT,tokenize:qT};function MT(t,i){let r=t.length-2,a=3;if(t[a][1].type==="whitespace"&&(a+=2),r-2>a&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(a===r-1||r-4>a&&t[r-2][1].type==="whitespace")&&(r-=a+1===r?2:4),r>a){const o={type:"atxHeadingText",start:t[a][1].start,end:t[r][1].end},u={type:"chunkText",start:t[a][1].start,end:t[r][1].end,contentType:"text"};fi(t,a,r-a+1,[["enter",o,i],["enter",u,i],["exit",u,i],["exit",o,i]])}return t}function qT(t,i,r){let a=0;return o;function o(v){return t.enter("atxHeading"),u(v)}function u(v){return t.enter("atxHeadingSequence"),c(v)}function c(v){return v===35&&a++<6?(t.consume(v),c):v===null||Ot(v)?(t.exit("atxHeadingSequence"),h(v)):r(v)}function h(v){return v===35?(t.enter("atxHeadingSequence"),g(v)):v===null||qe(v)?(t.exit("atxHeading"),i(v)):Pe(v)?pt(t,h,"whitespace")(v):(t.enter("atxHeadingText"),p(v))}function g(v){return v===35?(t.consume(v),g):(t.exit("atxHeadingSequence"),h(v))}function p(v){return v===null||v===35||Ot(v)?(t.exit("atxHeadingText"),h(v)):(t.consume(v),p)}}const Mx=["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"],rh=["pre","script","style","textarea"],DT={concrete:!0,name:"htmlFlow",resolveTo:BT,tokenize:UT},LT={partial:!0,tokenize:HT};function BT(t){let i=t.length;for(;i--&&!(t[i][0]==="enter"&&t[i][1].type==="htmlFlow"););return i>1&&t[i-2][1].type==="linePrefix"&&(t[i][1].start=t[i-2][1].start,t[i+1][1].start=t[i-2][1].start,t.splice(i-2,2)),t}function UT(t,i,r){const a=this;let o,u,c,h,g;return p;function p(M){return v(M)}function v(M){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(M),y}function y(M){return M===33?(t.consume(M),w):M===47?(t.consume(M),u=!0,T):M===63?(t.consume(M),o=3,a.interrupt?i:A):yn(M)?(t.consume(M),c=String.fromCharCode(M),C):r(M)}function w(M){return M===45?(t.consume(M),o=2,x):M===91?(t.consume(M),o=5,h=0,S):yn(M)?(t.consume(M),o=4,a.interrupt?i:A):r(M)}function x(M){return M===45?(t.consume(M),a.interrupt?i:A):r(M)}function S(M){const z="CDATA[";return M===z.charCodeAt(h++)?(t.consume(M),h===z.length?a.interrupt?i:te:S):r(M)}function T(M){return yn(M)?(t.consume(M),c=String.fromCharCode(M),C):r(M)}function C(M){if(M===null||M===47||M===62||Ot(M)){const z=M===47,ne=c.toLowerCase();return!z&&!u&&rh.includes(ne)?(o=1,a.interrupt?i(M):te(M)):Mx.includes(c.toLowerCase())?(o=6,z?(t.consume(M),E):a.interrupt?i(M):te(M)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?r(M):u?q(M):B(M))}return M===45||vn(M)?(t.consume(M),c+=String.fromCharCode(M),C):r(M)}function E(M){return M===62?(t.consume(M),a.interrupt?i:te):r(M)}function q(M){return Pe(M)?(t.consume(M),q):_(M)}function B(M){return M===47?(t.consume(M),_):M===58||M===95||yn(M)?(t.consume(M),ee):Pe(M)?(t.consume(M),B):_(M)}function ee(M){return M===45||M===46||M===58||M===95||vn(M)?(t.consume(M),ee):X(M)}function X(M){return M===61?(t.consume(M),O):Pe(M)?(t.consume(M),X):B(M)}function O(M){return M===null||M===60||M===61||M===62||M===96?r(M):M===34||M===39?(t.consume(M),g=M,Y):Pe(M)?(t.consume(M),O):K(M)}function Y(M){return M===g?(t.consume(M),g=null,se):M===null||qe(M)?r(M):(t.consume(M),Y)}function K(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||Ot(M)?X(M):(t.consume(M),K)}function se(M){return M===47||M===62||Pe(M)?B(M):r(M)}function _(M){return M===62?(t.consume(M),G):r(M)}function G(M){return M===null||qe(M)?te(M):Pe(M)?(t.consume(M),G):r(M)}function te(M){return M===45&&o===2?(t.consume(M),re):M===60&&o===1?(t.consume(M),ue):M===62&&o===4?(t.consume(M),Ee):M===63&&o===3?(t.consume(M),A):M===93&&o===5?(t.consume(M),me):qe(M)&&(o===6||o===7)?(t.exit("htmlFlowData"),t.check(LT,Be,Te)(M)):M===null||qe(M)?(t.exit("htmlFlowData"),Te(M)):(t.consume(M),te)}function Te(M){return t.check(lh,xe,Be)(M)}function xe(M){return t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),fe}function fe(M){return M===null||qe(M)?Te(M):(t.enter("htmlFlowData"),te(M))}function re(M){return M===45?(t.consume(M),A):te(M)}function ue(M){return M===47?(t.consume(M),c="",ge):te(M)}function ge(M){if(M===62){const z=c.toLowerCase();return rh.includes(z)?(t.consume(M),Ee):te(M)}return yn(M)&&c.length<8?(t.consume(M),c+=String.fromCharCode(M),ge):te(M)}function me(M){return M===93?(t.consume(M),A):te(M)}function A(M){return M===62?(t.consume(M),Ee):M===45&&o===2?(t.consume(M),A):te(M)}function Ee(M){return M===null||qe(M)?(t.exit("htmlFlowData"),Be(M)):(t.consume(M),Ee)}function Be(M){return t.exit("htmlFlow"),i(M)}}function HT(t,i,r){return a;function a(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(Us,i,r)}}const IT={name:"htmlText",tokenize:VT};function VT(t,i,r){const a=this;let o,u,c;return h;function h(A){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(A),g}function g(A){return A===33?(t.consume(A),p):A===47?(t.consume(A),X):A===63?(t.consume(A),B):yn(A)?(t.consume(A),K):r(A)}function p(A){return A===45?(t.consume(A),v):A===91?(t.consume(A),u=0,S):yn(A)?(t.consume(A),q):r(A)}function v(A){return A===45?(t.consume(A),x):r(A)}function y(A){return A===null?r(A):A===45?(t.consume(A),w):qe(A)?(c=y,ue(A)):(t.consume(A),y)}function w(A){return A===45?(t.consume(A),x):y(A)}function x(A){return A===62?re(A):A===45?w(A):y(A)}function S(A){const Ee="CDATA[";return A===Ee.charCodeAt(u++)?(t.consume(A),u===Ee.length?T:S):r(A)}function T(A){return A===null?r(A):A===93?(t.consume(A),C):qe(A)?(c=T,ue(A)):(t.consume(A),T)}function C(A){return A===93?(t.consume(A),E):T(A)}function E(A){return A===62?re(A):A===93?(t.consume(A),E):T(A)}function q(A){return A===null||A===62?re(A):qe(A)?(c=q,ue(A)):(t.consume(A),q)}function B(A){return A===null?r(A):A===63?(t.consume(A),ee):qe(A)?(c=B,ue(A)):(t.consume(A),B)}function ee(A){return A===62?re(A):B(A)}function X(A){return yn(A)?(t.consume(A),O):r(A)}function O(A){return A===45||vn(A)?(t.consume(A),O):Y(A)}function Y(A){return qe(A)?(c=Y,ue(A)):Pe(A)?(t.consume(A),Y):re(A)}function K(A){return A===45||vn(A)?(t.consume(A),K):A===47||A===62||Ot(A)?se(A):r(A)}function se(A){return A===47?(t.consume(A),re):A===58||A===95||yn(A)?(t.consume(A),_):qe(A)?(c=se,ue(A)):Pe(A)?(t.consume(A),se):re(A)}function _(A){return A===45||A===46||A===58||A===95||vn(A)?(t.consume(A),_):G(A)}function G(A){return A===61?(t.consume(A),te):qe(A)?(c=G,ue(A)):Pe(A)?(t.consume(A),G):se(A)}function te(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(t.consume(A),o=A,Te):qe(A)?(c=te,ue(A)):Pe(A)?(t.consume(A),te):(t.consume(A),xe)}function Te(A){return A===o?(t.consume(A),o=void 0,fe):A===null?r(A):qe(A)?(c=Te,ue(A)):(t.consume(A),Te)}function xe(A){return A===null||A===34||A===39||A===60||A===61||A===96?r(A):A===47||A===62||Ot(A)?se(A):(t.consume(A),xe)}function fe(A){return A===47||A===62||Ot(A)?se(A):r(A)}function re(A){return A===62?(t.consume(A),t.exit("htmlTextData"),t.exit("htmlText"),i):r(A)}function ue(A){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),ge}function ge(A){return Pe(A)?pt(t,me,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):me(A)}function me(A){return t.enter("htmlTextData"),c(A)}}const Rh={name:"labelEnd",resolveAll:QT,resolveTo:XT,tokenize:ZT},YT={tokenize:KT},FT={tokenize:$T},GT={tokenize:JT};function QT(t){let i=-1;const r=[];for(;++i<t.length;){const a=t[i][1];if(r.push(t[i]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const o=a.type==="labelImage"?4:2;a.type="data",i+=o}}return t.length!==r.length&&fi(t,0,t.length,r),t}function XT(t,i){let r=t.length,a=0,o,u,c;for(;r--;){const v=t[r][1];if(o){if(v.type==="link"||v.type==="labelLink"&&v._inactive)break;t[r][0]==="enter"&&v.type==="labelLink"&&(v._inactive=!0)}else if(u){if(t[r][0]==="enter"&&(v.type==="labelImage"||v.type==="labelLink")&&!v._balanced&&(o=r,v.type!=="labelLink")){a=2;break}}else v.type==="labelEnd"&&(u=r)}const h={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},g={type:"label",start:{...t[o][1].start},end:{...t[u][1].end}},p={type:"labelText",start:{...t[o+a+2][1].end},end:{...t[u-2][1].start}};return c=[["enter",h,i],["enter",g,i]],c=ei(c,t.slice(o+1,o+a+3)),c=ei(c,[["enter",p,i]]),c=ei(c,Yu(i.parser.constructs.insideSpan.null,t.slice(o+a+4,u-3),i)),c=ei(c,[["exit",p,i],t[u-2],t[u-1],["exit",g,i]]),c=ei(c,t.slice(u+1)),c=ei(c,[["exit",h,i]]),fi(t,o,t.length,c),t}function ZT(t,i,r){const a=this,o=a._labelStarts;let u,c;if(o){for(;o.length>0&&o[o.length-1]._balanced;)o.pop();u=o[o.length-1]}return h;function h(w){return u?u._inactive?y(w):(c=a.parser.defined.includes(di(a.sliceSerialize({start:u.end,end:a.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(w),t.exit("labelMarker"),t.exit("labelEnd"),g):r(w)}function g(w){return w===40?t.attempt(YT,v,c?v:y)(w):w===91?t.attempt(FT,v,c?p:y)(w):c?v(w):y(w)}function p(w){return t.attempt(GT,v,y)(w)}function v(w){return o.pop(),i(w)}function y(w){return u._balanced=!0,r(w)}}function KT(t,i,r){return a;function a(y){return t.enter("resource"),t.enter("resourceMarker"),t.consume(y),t.exit("resourceMarker"),o}function o(y){return Ot(y)?ks(t,u)(y):u(y)}function u(y){return y===41?v(y):Rx(t,c,h,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function c(y){return Ot(y)?ks(t,g)(y):v(y)}function h(y){return r(y)}function g(y){return y===34||y===39||y===40?zx(t,p,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):v(y)}function p(y){return Ot(y)?ks(t,v)(y):v(y)}function v(y){return y===41?(t.enter("resourceMarker"),t.consume(y),t.exit("resourceMarker"),t.exit("resource"),i):r(y)}}function $T(t,i,r){const a=this;return o;function o(h){return _x.call(a,t,u,c,"reference","referenceMarker","referenceString")(h)}function u(h){return a.parser.defined.includes(di(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?i(h):r(h)}function c(h){return r(h)}}function JT(t,i,r){return a;function a(u){return t.enter("reference"),t.enter("referenceMarker"),t.consume(u),t.exit("referenceMarker"),o}function o(u){return u===93?(t.enter("referenceMarker"),t.consume(u),t.exit("referenceMarker"),t.exit("reference"),i):r(u)}}const PT={name:"labelStartImage",resolveAll:Rh.resolveAll,tokenize:WT};function WT(t,i,r){const a=this;let o;return u;function u(g){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(g),t.exit("labelImageMarker"),c}function c(g){return g===91?(t.enter("labelMarker"),t.consume(g),t.exit("labelMarker"),o=t.exit("labelImage"),h):r(g)}function h(g){return g===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(g):(a._labelStarts=a._labelStarts||[],a._labelStarts.push(o),i(g))}}const ej={name:"labelStartLink",resolveAll:Rh.resolveAll,tokenize:tj};function tj(t,i,r){const a=this;let o;return u;function u(h){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(h),t.exit("labelMarker"),o=t.exit("labelLink"),c}function c(h){return h===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(h):(a._labelStarts=a._labelStarts||[],a._labelStarts.push(o),i(h))}}const Rd={name:"lineEnding",tokenize:nj};function nj(t,i){return r;function r(a){return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),pt(t,i,"linePrefix")}}const ku={name:"thematicBreak",tokenize:ij};function ij(t,i,r){let a=0,o;return u;function u(p){return t.enter("thematicBreak"),c(p)}function c(p){return o=p,h(p)}function h(p){return p===o?(t.enter("thematicBreakSequence"),g(p)):a>=3&&(p===null||qe(p))?(t.exit("thematicBreak"),i(p)):r(p)}function g(p){return p===o?(t.consume(p),a++,g):(t.exit("thematicBreakSequence"),Pe(p)?pt(t,h,"whitespace")(p):h(p))}}const _n={continuation:{tokenize:sj},exit:uj,name:"list",tokenize:aj},lj={partial:!0,tokenize:cj},rj={partial:!0,tokenize:oj};function aj(t,i,r){const a=this,o=a.events[a.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,c=0;return h;function h(x){const S=a.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||x===a.containerState.marker:nh(x)){if(a.containerState.type||(a.containerState.type=S,t.enter(S,{_container:!0})),S==="listUnordered")return t.enter("listItemPrefix"),x===42||x===45?t.check(ku,r,p)(x):p(x);if(!a.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),g(x)}return r(x)}function g(x){return nh(x)&&++c<10?(t.consume(x),g):(!a.interrupt||c<2)&&(a.containerState.marker?x===a.containerState.marker:x===41||x===46)?(t.exit("listItemValue"),p(x)):r(x)}function p(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||x,t.check(Us,a.interrupt?r:v,t.attempt(lj,w,y))}function v(x){return a.containerState.initialBlankLine=!0,u++,w(x)}function y(x){return Pe(x)?(t.enter("listItemPrefixWhitespace"),t.consume(x),t.exit("listItemPrefixWhitespace"),w):r(x)}function w(x){return a.containerState.size=u+a.sliceSerialize(t.exit("listItemPrefix"),!0).length,i(x)}}function sj(t,i,r){const a=this;return a.containerState._closeFlow=void 0,t.check(Us,o,u);function o(h){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,pt(t,i,"listItemIndent",a.containerState.size+1)(h)}function u(h){return a.containerState.furtherBlankLines||!Pe(h)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(h)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,t.attempt(rj,i,c)(h))}function c(h){return a.containerState._closeFlow=!0,a.interrupt=void 0,pt(t,t.attempt(_n,i,r),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function oj(t,i,r){const a=this;return pt(t,o,"listItemIndent",a.containerState.size+1);function o(u){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?i(u):r(u)}}function uj(t){t.exit(this.containerState.type)}function cj(t,i,r){const a=this;return pt(t,o,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const c=a.events[a.events.length-1];return!Pe(u)&&c&&c[1].type==="listItemPrefixWhitespace"?i(u):r(u)}}const kv={name:"setextUnderline",resolveTo:fj,tokenize:dj};function fj(t,i){const r=new Nu;let a=t.length,o,u,c;for(;a--;)if(t[a][0]==="enter"){if(t[a][1].type==="content"){o=a;break}t[a][1].type==="paragraph"&&(u=a)}else t[a][1].type==="content"&&r.add(a,1,[]),!c&&t[a][1].type==="definition"&&(c=a);const h={type:"setextHeading",start:{...t[o][1].start},end:{...t[t.length-1][1].end}};return t[u][1].type="setextHeadingText",c?(r.add(u,0,[["enter",h,i]]),r.add(c+1,0,[["exit",t[o][1],i]]),t[o][1].end={...t[c][1].end}):t[o][1]=h,r.add(t.length,0,[["exit",h,i]]),r.consume(t),t}function dj(t,i,r){const a=this;let o;return u;function u(p){let v=a.events.length,y;for(;v--;)if(a.events[v][1].type!=="lineEnding"&&a.events[v][1].type!=="linePrefix"&&a.events[v][1].type!=="content"){y=a.events[v][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||y)?(t.enter("setextHeadingLine"),o=p,c(p)):r(p)}function c(p){return t.enter("setextHeadingLineSequence"),h(p)}function h(p){return p===o?(t.consume(p),h):(t.exit("setextHeadingLineSequence"),Pe(p)?pt(t,g,"lineSuffix")(p):g(p))}function g(p){return p===null||qe(p)?(t.exit("setextHeadingLine"),i(p)):r(p)}}const hj={tokenize:mj};function mj(t){const i=this,r=t.attempt(Us,a,t.attempt(this.parser.constructs.flowInitial,o,pt(t,t.attempt(this.parser.constructs.flow,o,t.attempt(ST,o)),"linePrefix")));return r;function a(u){if(u===null){t.consume(u);return}return t.enter("lineEndingBlank"),t.consume(u),t.exit("lineEndingBlank"),i.currentConstruct=void 0,r}function o(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),i.currentConstruct=void 0,r}}const pj={resolveAll:Dx()},gj=qx("string"),yj=qx("text");function qx(t){return{resolveAll:Dx(t==="text"?vj:void 0),tokenize:i};function i(r){const a=this,o=this.parser.constructs[t],u=r.attempt(o,c,h);return c;function c(v){return p(v)?u(v):h(v)}function h(v){if(v===null){r.consume(v);return}return r.enter("data"),r.consume(v),g}function g(v){return p(v)?(r.exit("data"),u(v)):(r.consume(v),g)}function p(v){if(v===null)return!0;const y=o[v];let w=-1;if(y)for(;++w<y.length;){const x=y[w];if(!x.previous||x.previous.call(a,a.previous))return!0}return!1}}}function Dx(t){return i;function i(r,a){let o=-1,u;for(;++o<=r.length;)u===void 0?r[o]&&r[o][1].type==="data"&&(u=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==u+2&&(r[u][1].end=r[o-1][1].end,r.splice(u+2,o-u-2),o=u+2),u=void 0);return t?t(r,a):r}}function vj(t,i){const r=new Nu;let a=0;for(;++a<=t.length;)if((a===t.length||t[a][1].type==="lineEnding")&&t[a-1][1].type==="data"){const o=t[a-1][1],u=i.sliceStream(o);let c=u.length,h=-1,g=0,p;for(;c--;){const v=u[c];if(typeof v=="string"){for(h=v.length;v.charCodeAt(h-1)===32;)g++,h--;if(h)break;h=-1}else if(v===-2)p=!0,g++;else if(v!==-1){c++;break}}if(i._contentTypeTextTrailing&&a===t.length&&(g=0),g){const v={type:a===t.length||p||g<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?h:o.start._bufferIndex+h,_index:o.start._index+c,line:o.end.line,column:o.end.column-g,offset:o.end.offset-g},end:{...o.end}};o.end={...v.start},o.start.offset===o.end.offset?Object.assign(o,v):r.add(a,0,[["enter",v,i],["exit",v,i]])}a++}return r.consume(t),t}const bj={42:_n,43:_n,45:_n,48:_n,49:_n,50:_n,51:_n,52:_n,53:_n,54:_n,55:_n,56:_n,57:_n,62:Cx},xj={91:CT},wj={[-2]:Od,[-1]:Od,32:Od},Sj={35:zT,42:ku,45:[kv,ku],60:DT,61:kv,95:ku,96:Sv,126:Sv},kj={38:Ax,92:Nx},Ej={[-5]:Rd,[-4]:Rd,[-3]:Rd,33:PT,38:Ax,42:ih,60:[iT,IT],91:ej,92:[RT,Nx],93:Rh,95:ih,96:gT},Tj={null:[ih,pj]},jj={null:[42,95]},Cj={null:[]},Nj=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:jj,contentInitial:xj,disable:Cj,document:bj,flow:Sj,flowInitial:wj,insideSpan:Tj,string:kj,text:Ej},Symbol.toStringTag,{value:"Module"}));function Aj(t,i,r){let a={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},u=[];let c=[],h=[];const g={attempt:Y(X),check:Y(O),consume:q,enter:B,exit:ee,interrupt:Y(O,{interrupt:!0})},p={code:null,containerState:{},defineSkip:T,events:[],now:S,parser:t,previous:null,sliceSerialize:w,sliceStream:x,write:y};let v=i.tokenize.call(p,g);return i.resolveAll&&u.push(i),p;function y(G){return c=ei(c,G),C(),c[c.length-1]!==null?[]:(K(i,0),p.events=Yu(u,p.events,p),p.events)}function w(G,te){return Rj(x(G),te)}function x(G){return Oj(c,G)}function S(){const{_bufferIndex:G,_index:te,line:Te,column:xe,offset:fe}=a;return{_bufferIndex:G,_index:te,line:Te,column:xe,offset:fe}}function T(G){o[G.line]=G.column,_()}function C(){for(;a._index<c.length;){const G=c[a._index];if(typeof G=="string"){const te=a._index;for(a._bufferIndex<0&&(a._bufferIndex=0);a._index===te&&a._bufferIndex<G.length;)E(G.charCodeAt(a._bufferIndex))}else E(G)}}function E(G){v=v(G)}function q(G){qe(G)?(a.line++,a.column=1,a.offset+=G===-3?2:1,_()):G!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),p.previous=G}function B(G,te){const Te=te||{};return Te.type=G,Te.start=S(),p.events.push(["enter",Te,p]),h.push(Te),Te}function ee(G){const te=h.pop();return te.end=S(),p.events.push(["exit",te,p]),te}function X(G,te){K(G,te.from)}function O(G,te){te.restore()}function Y(G,te){return Te;function Te(xe,fe,re){let ue,ge,me,A;return Array.isArray(xe)?Be(xe):"tokenize"in xe?Be([xe]):Ee(xe);function Ee(J){return ae;function ae(Oe){const be=Oe!==null&&J[Oe],we=Oe!==null&&J.null,P=[...Array.isArray(be)?be:be?[be]:[],...Array.isArray(we)?we:we?[we]:[]];return Be(P)(Oe)}}function Be(J){return ue=J,ge=0,J.length===0?re:M(J[ge])}function M(J){return ae;function ae(Oe){return A=se(),me=J,J.partial||(p.currentConstruct=J),J.name&&p.parser.constructs.disable.null.includes(J.name)?ne():J.tokenize.call(te?Object.assign(Object.create(p),te):p,g,z,ne)(Oe)}}function z(J){return G(me,A),fe}function ne(J){return A.restore(),++ge<ue.length?M(ue[ge]):re}}}function K(G,te){G.resolveAll&&!u.includes(G)&&u.push(G),G.resolve&&fi(p.events,te,p.events.length-te,G.resolve(p.events.slice(te),p)),G.resolveTo&&(p.events=G.resolveTo(p.events,p))}function se(){const G=S(),te=p.previous,Te=p.currentConstruct,xe=p.events.length,fe=Array.from(h);return{from:xe,restore:re};function re(){a=G,p.previous=te,p.currentConstruct=Te,p.events.length=xe,h=fe,_()}}function _(){a.line in o&&a.column<2&&(a.column=o[a.line],a.offset+=o[a.line]-1)}}function Oj(t,i){const r=i.start._index,a=i.start._bufferIndex,o=i.end._index,u=i.end._bufferIndex;let c;if(r===o)c=[t[r].slice(a,u)];else{if(c=t.slice(r,o),a>-1){const h=c[0];typeof h=="string"?c[0]=h.slice(a):c.shift()}u>0&&c.push(t[o].slice(0,u))}return c}function Rj(t,i){let r=-1;const a=[];let o;for(;++r<t.length;){const u=t[r];let c;if(typeof u=="string")c=u;else switch(u){case-5:{c="\r";break}case-4:{c=`
19
- `;break}case-3:{c=`\r
20
- `;break}case-2:{c=i?" ":" ";break}case-1:{if(!i&&o)continue;c=" ";break}default:c=String.fromCharCode(u)}o=u===-2,a.push(c)}return a.join("")}function _j(t){const a={constructs:kx([Nj,...(t||{}).extensions||[]]),content:o($E),defined:[],document:o(PE),flow:o(hj),lazy:{},string:o(gj),text:o(yj)};return a;function o(u){return c;function c(h){return Aj(a,u,h)}}}function zj(t){for(;!Ox(t););return t}const Ev=/[\0\t\n\r]/g;function Mj(){let t=1,i="",r=!0,a;return o;function o(u,c,h){u=i+(typeof u=="string"?u.toString():new TextDecoder(c||void 0).decode(u));const g=[];let p=0;for(i="",r&&(u.charCodeAt(0)===65279&&p++,r=void 0);p<u.length;){Ev.lastIndex=p;const v=Ev.exec(u),y=v&&v.index!==void 0?v.index:u.length,w=u.charCodeAt(y);if(!v){i=u.slice(p);break}if(w===10&&p===y&&a)g.push(-3),a=void 0;else switch(a&&(g.push(-5),a=void 0),p<y&&(g.push(u.slice(p,y)),t+=y-p),w){case 0:{g.push(65533),t++;break}case 9:{const x=Math.ceil(t/4)*4;for(g.push(-2);t++<x;)g.push(-1);break}case 10:{g.push(-4),t=1;break}default:a=!0,t=1}p=y+1}return h&&(a&&g.push(-5),i&&g.push(i),g.push(null)),g}}const qj=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Dj(t){return t.replace(qj,Lj)}function Lj(t,i,r){if(i)return i;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),u=o===120||o===88;return Ex(r.slice(u?2:1),u?16:10)}return Oh(r)||t}const Lx={}.hasOwnProperty;function Bj(t,i,r){return i&&typeof i=="object"&&(r=i,i=void 0),Uj(r)(zj(_j(r).document().write(Mj()(t,i,!0))))}function Uj(t){const i={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(Qe),autolinkProtocol:_,autolinkEmail:_,atxHeading:c(tt),blockQuote:c(P),characterEscape:_,characterReference:_,codeFenced:c(ye),codeFencedFenceInfo:h,codeFencedFenceMeta:h,codeIndented:c(ye,h),codeText:c(We,h),codeTextData:_,data:_,codeFlowValue:_,definition:c(et),definitionDestinationString:h,definitionLabelString:h,definitionTitleString:h,emphasis:c(Ne),hardBreakEscape:c($e),hardBreakTrailing:c($e),htmlFlow:c(Ie,h),htmlFlowData:_,htmlText:c(Ie,h),htmlTextData:_,image:c(Me),label:h,link:c(Qe),listItem:c(he),listItemValue:x,listOrdered:c(vt,w),listUnordered:c(vt),paragraph:c(Le),reference:z,referenceString:h,resourceDestinationString:h,resourceTitleString:h,setextHeading:c(tt),strong:c(bt),thematicBreak:c(Lt)},exit:{atxHeading:p(),atxHeadingSequence:O,autolink:p(),autolinkEmail:we,autolinkProtocol:be,blockQuote:p(),characterEscapeValue:G,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:ae,characterReference:Oe,codeFenced:p(E),codeFencedFence:C,codeFencedFenceInfo:S,codeFencedFenceMeta:T,codeFlowValue:G,codeIndented:p(q),codeText:p(re),codeTextData:G,data:G,definition:p(),definitionDestinationString:X,definitionLabelString:B,definitionTitleString:ee,emphasis:p(),hardBreakEscape:p(Te),hardBreakTrailing:p(Te),htmlFlow:p(xe),htmlFlowData:G,htmlText:p(fe),htmlTextData:G,image:p(ge),label:A,labelText:me,lineEnding:te,link:p(ue),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:ne,resourceDestinationString:Ee,resourceTitleString:Be,resource:M,setextHeading:p(se),setextHeadingLineSequence:K,setextHeadingText:Y,strong:p(),thematicBreak:p()}};Bx(i,(t||{}).mdastExtensions||[]);const r={};return a;function a(Z){let ce={type:"root",children:[],position:void 0};const Se={stack:[ce],tokenStack:[],config:i,enter:g,exit:v,buffer:h,resume:y,data:r},Ce=[],Tt=[];let je=-1;for(;++je<Z.length;)if(Tt.push(Z[je]),Z[je][1].type==="listOrdered"||Z[je][1].type==="listUnordered")if(Z[je][0]==="enter")Ce.push(Tt.length-1);else{const Ge=Ce.pop();u(Tt,Ge)}for(Z=Tt,je=-1;++je<Z.length;){const Ge=i[Z[je][0]];Z[je][0]==="enter"&&i.beforeEnter.length>0&&o(i.beforeEnter,{...Se,sliceSerialize:Z[je][2].sliceSerialize},Z[je][1]),Lx.call(Ge,Z[je][1].type)&&Ge[Z[je][1].type].call({...Se,sliceSerialize:Z[je][2].sliceSerialize},Z[je][1]),Z[je][0]==="exit"&&i.afterExit.length>0&&o(i.afterExit,{...Se,sliceSerialize:Z[je][2].sliceSerialize},Z[je][1])}if(Se.tokenStack.length>0){const Ge=Se.tokenStack[Se.tokenStack.length-1];(Ge[1]||Tv).call(Se,void 0,Ge[0])}for(ce.position={start:Al(Z.length>0?Z[0][1].start:{line:1,column:1,offset:0}),end:Al(Z.length>0?Z[Z.length-2][1].end:{line:1,column:1,offset:0})},je=-1;++je<i.transforms.length;)ce=i.transforms[je](ce)||ce;return ce}function o(Z,ce,Se){let Ce=-1;for(;++Ce<Z.length;)Z[Ce].call(ce,Se)}function u(Z,ce){const Se=Z.length-1;let Ce=ce-1,Tt=-1,je=!1,Ge,Rt,Gt,on;const Sn=[];for(;++Ce<=Se;){const Xe=Z[Ce];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?Tt++:Tt--,on=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(Ge&&!on&&!Tt&&!Gt&&(Gt=Ce),on=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:on=void 0}if(!Tt&&Xe[0]==="enter"&&Xe[1].type==="listItemPrefix"||Tt===-1&&Xe[0]==="exit"&&(Xe[1].type==="listUnordered"||Xe[1].type==="listOrdered")){if(Ge){let Wt=Ce;for(Rt=void 0;Wt--;){const un=Z[Wt];if(un[1].type==="lineEnding"||un[1].type==="lineEndingBlank"){if(un[0]==="exit")continue;Rt&&(Z[Rt][1].type="lineEndingBlank",je=!0),un[1].type="lineEnding",Rt=Wt}else if(!(un[1].type==="linePrefix"||un[1].type==="blockQuotePrefix"||un[1].type==="blockQuotePrefixWhitespace"||un[1].type==="blockQuoteMarker"||un[1].type==="listItemIndent"))break}Gt&&(!Rt||Gt<Rt)&&(Ge._spread=!0),Ge.end=Object.assign({},Rt?Z[Rt][1].start:Xe[1].end),Sn.push({at:Rt||Ce,event:["exit",Ge,Xe[2]]})}if(Xe[1].type==="listItemPrefix"){const Wt={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};Ge=Wt,Sn.push({at:Ce,event:["enter",Wt,Xe[2]]}),Gt=void 0,on=!0}}}const Ri=Z.splice(ce);let qt=0;for(Ce=-1;++Ce<Ri.length;){for(;qt<Sn.length&&Sn[qt].at===ce+Ce;)Z.push(Sn[qt++].event);Z.push(Ri[Ce])}Z[ce][1]._spread=je}function c(Z,ce){return Se;function Se(Ce){g.call(this,Z(Ce),Ce),ce&&ce.call(this,Ce)}}function h(){this.stack.push({type:"fragment",children:[]})}function g(Z,ce,Se){this.stack[this.stack.length-1].children.push(Z),this.stack.push(Z),this.tokenStack.push([ce,Se||void 0]),Z.position={start:Al(ce.start),end:void 0}}function p(Z){return ce;function ce(Se){Z&&Z.call(this,Se),v.call(this,Se)}}function v(Z,ce){const Se=this.stack.pop(),Ce=this.tokenStack.pop();if(!Ce)throw new Error("Cannot close `"+Z.type+"` ("+Ss({start:Z.start,end:Z.end})+"): it’s not open");Ce[0].type!==Z.type&&(ce?ce.call(this,Z,Ce[0]):(Ce[1]||Tv).call(this,Z,Ce[0])),Se.position.end=Al(Z.end)}function y(){return Vu(this.stack.pop())}function w(){this.data.expectingFirstListItemValue=!0}function x(Z){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(Z),10),this.data.expectingFirstListItemValue=void 0}}function S(){const Z=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=Z}function T(){const Z=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=Z}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const Z=this.resume(),ce=this.stack[this.stack.length-1];ce.value=Z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function q(){const Z=this.resume(),ce=this.stack[this.stack.length-1];ce.value=Z.replace(/(\r?\n|\r)$/g,"")}function B(Z){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.label=ce,Se.identifier=di(this.sliceSerialize(Z)).toLowerCase()}function ee(){const Z=this.resume(),ce=this.stack[this.stack.length-1];ce.title=Z}function X(){const Z=this.resume(),ce=this.stack[this.stack.length-1];ce.url=Z}function O(Z){const ce=this.stack[this.stack.length-1];if(!ce.depth){const Se=this.sliceSerialize(Z).length;ce.depth=Se}}function Y(){this.data.setextHeadingSlurpLineEnding=!0}function K(Z){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(Z).codePointAt(0)===61?1:2}function se(){this.data.setextHeadingSlurpLineEnding=void 0}function _(Z){const Se=this.stack[this.stack.length-1].children;let Ce=Se[Se.length-1];(!Ce||Ce.type!=="text")&&(Ce=bn(),Ce.position={start:Al(Z.start),end:void 0},Se.push(Ce)),this.stack.push(Ce)}function G(Z){const ce=this.stack.pop();ce.value+=this.sliceSerialize(Z),ce.position.end=Al(Z.end)}function te(Z){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Se=ce.children[ce.children.length-1];Se.position.end=Al(Z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(ce.type)&&(_.call(this,Z),G.call(this,Z))}function Te(){this.data.atHardBreak=!0}function xe(){const Z=this.resume(),ce=this.stack[this.stack.length-1];ce.value=Z}function fe(){const Z=this.resume(),ce=this.stack[this.stack.length-1];ce.value=Z}function re(){const Z=this.resume(),ce=this.stack[this.stack.length-1];ce.value=Z}function ue(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=ce,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function ge(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=ce,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function me(Z){const ce=this.sliceSerialize(Z),Se=this.stack[this.stack.length-2];Se.label=Dj(ce),Se.identifier=di(ce).toLowerCase()}function A(){const Z=this.stack[this.stack.length-1],ce=this.resume(),Se=this.stack[this.stack.length-1];if(this.data.inReference=!0,Se.type==="link"){const Ce=Z.children;Se.children=Ce}else Se.alt=ce}function Ee(){const Z=this.resume(),ce=this.stack[this.stack.length-1];ce.url=Z}function Be(){const Z=this.resume(),ce=this.stack[this.stack.length-1];ce.title=Z}function M(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function ne(Z){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.label=ce,Se.identifier=di(this.sliceSerialize(Z)).toLowerCase(),this.data.referenceType="full"}function J(Z){this.data.characterReferenceType=Z.type}function ae(Z){const ce=this.sliceSerialize(Z),Se=this.data.characterReferenceType;let Ce;Se?(Ce=Ex(ce,Se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=Oh(ce);const Tt=this.stack[this.stack.length-1];Tt.value+=Ce}function Oe(Z){const ce=this.stack.pop();ce.position.end=Al(Z.end)}function be(Z){G.call(this,Z);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(Z)}function we(Z){G.call(this,Z);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(Z)}function P(){return{type:"blockquote",children:[],position:void 0}}function ye(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function We(){return{type:"inlineCode",value:"",position:void 0}}function et(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function Ne(){return{type:"emphasis",children:[],position:void 0}}function tt(){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 Me(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function Qe(){return{type:"link",title:null,url:"",children:[],position:void 0}}function vt(Z){return{type:"list",ordered:Z.type==="listOrdered",start:null,spread:Z._spread,children:[],position:void 0}}function he(Z){return{type:"listItem",spread:Z._spread,checked:null,children:[],position:void 0}}function Le(){return{type:"paragraph",children:[],position:void 0}}function bt(){return{type:"strong",children:[],position:void 0}}function bn(){return{type:"text",value:"",position:void 0}}function Lt(){return{type:"thematicBreak",position:void 0}}}function Al(t){return{line:t.line,column:t.column,offset:t.offset}}function Bx(t,i){let r=-1;for(;++r<i.length;){const a=i[r];Array.isArray(a)?Bx(t,a):Hj(t,a)}}function Hj(t,i){let r;for(r in i)if(Lx.call(i,r))switch(r){case"canContainEols":{const a=i[r];a&&t[r].push(...a);break}case"transforms":{const a=i[r];a&&t[r].push(...a);break}case"afterExit":case"beforeEnter":{const a=i[r];a&&t[r].push(a);break}case"enter":case"exit":{const a=i[r];a&&Object.assign(t[r],a);break}}}function Tv(t,i){throw t?new Error("Cannot close `"+t.type+"` ("+Ss({start:t.start,end:t.end})+"): a different token (`"+i.type+"`, "+Ss({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Ss({start:i.start,end:i.end})+") is still open")}function Ij(t){const i=this;i.parser=r;function r(a){return Bj(a,{...i.data("settings"),...t,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function Vj(t,i){const r={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(i),!0)};return t.patch(i,r),t.applyData(i,r)}function Yj(t,i){const r={type:"element",tagName:"br",properties:{},children:[]};return t.patch(i,r),[t.applyData(i,r),{type:"text",value:`
21
- `}]}function Fj(t,i){const r=i.value?i.value+`
22
- `:"",a={},o=i.lang?i.lang.split(/\s+/):[];o.length>0&&(a.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:a,children:[{type:"text",value:r}]};return i.meta&&(u.data={meta:i.meta}),t.patch(i,u),u=t.applyData(i,u),u={type:"element",tagName:"pre",properties:{},children:[u]},t.patch(i,u),u}function Gj(t,i){const r={type:"element",tagName:"del",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function Qj(t,i){const r={type:"element",tagName:"em",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function Xj(t,i){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",a=String(i.identifier).toUpperCase(),o=pa(a.toLowerCase()),u=t.footnoteOrder.indexOf(a);let c,h=t.footnoteCounts.get(a);h===void 0?(h=0,t.footnoteOrder.push(a),c=t.footnoteOrder.length):c=u+1,h+=1,t.footnoteCounts.set(a,h);const g={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(h>1?"-"+h:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};t.patch(i,g);const p={type:"element",tagName:"sup",properties:{},children:[g]};return t.patch(i,p),t.applyData(i,p)}function Zj(t,i){const r={type:"element",tagName:"h"+i.depth,properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function Kj(t,i){if(t.options.allowDangerousHtml){const r={type:"raw",value:i.value};return t.patch(i,r),t.applyData(i,r)}}function Ux(t,i){const r=i.referenceType;let a="]";if(r==="collapsed"?a+="[]":r==="full"&&(a+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+a}];const o=t.all(i),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const c=o[o.length-1];return c&&c.type==="text"?c.value+=a:o.push({type:"text",value:a}),o}function $j(t,i){const r=String(i.identifier).toUpperCase(),a=t.definitionById.get(r);if(!a)return Ux(t,i);const o={src:pa(a.url||""),alt:i.alt};a.title!==null&&a.title!==void 0&&(o.title=a.title);const u={type:"element",tagName:"img",properties:o,children:[]};return t.patch(i,u),t.applyData(i,u)}function Jj(t,i){const r={src:pa(i.url)};i.alt!==null&&i.alt!==void 0&&(r.alt=i.alt),i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"img",properties:r,children:[]};return t.patch(i,a),t.applyData(i,a)}function Pj(t,i){const r={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};t.patch(i,r);const a={type:"element",tagName:"code",properties:{},children:[r]};return t.patch(i,a),t.applyData(i,a)}function Wj(t,i){const r=String(i.identifier).toUpperCase(),a=t.definitionById.get(r);if(!a)return Ux(t,i);const o={href:pa(a.url||"")};a.title!==null&&a.title!==void 0&&(o.title=a.title);const u={type:"element",tagName:"a",properties:o,children:t.all(i)};return t.patch(i,u),t.applyData(i,u)}function eC(t,i){const r={href:pa(i.url)};i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"a",properties:r,children:t.all(i)};return t.patch(i,a),t.applyData(i,a)}function tC(t,i,r){const a=t.all(i),o=r?nC(r):Hx(i),u={},c=[];if(typeof i.checked=="boolean"){const v=a[0];let y;v&&v.type==="element"&&v.tagName==="p"?y=v:(y={type:"element",tagName:"p",properties:{},children:[]},a.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let h=-1;for(;++h<a.length;){const v=a[h];(o||h!==0||v.type!=="element"||v.tagName!=="p")&&c.push({type:"text",value:`
23
- `}),v.type==="element"&&v.tagName==="p"&&!o?c.push(...v.children):c.push(v)}const g=a[a.length-1];g&&(o||g.type!=="element"||g.tagName!=="p")&&c.push({type:"text",value:`
24
- `});const p={type:"element",tagName:"li",properties:u,children:c};return t.patch(i,p),t.applyData(i,p)}function nC(t){let i=!1;if(t.type==="list"){i=t.spread||!1;const r=t.children;let a=-1;for(;!i&&++a<r.length;)i=Hx(r[a])}return i}function Hx(t){const i=t.spread;return i??t.children.length>1}function iC(t,i){const r={},a=t.all(i);let o=-1;for(typeof i.start=="number"&&i.start!==1&&(r.start=i.start);++o<a.length;){const c=a[o];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const u={type:"element",tagName:i.ordered?"ol":"ul",properties:r,children:t.wrap(a,!0)};return t.patch(i,u),t.applyData(i,u)}function lC(t,i){const r={type:"element",tagName:"p",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function rC(t,i){const r={type:"root",children:t.wrap(t.all(i))};return t.patch(i,r),t.applyData(i,r)}function aC(t,i){const r={type:"element",tagName:"strong",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function sC(t,i){const r=t.all(i),a=r.shift(),o=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:t.wrap([a],!0)};t.patch(i.children[0],c),o.push(c)}if(r.length>0){const c={type:"element",tagName:"tbody",properties:{},children:t.wrap(r,!0)},h=jh(i.children[1]),g=gx(i.children[i.children.length-1]);h&&g&&(c.position={start:h,end:g}),o.push(c)}const u={type:"element",tagName:"table",properties:{},children:t.wrap(o,!0)};return t.patch(i,u),t.applyData(i,u)}function oC(t,i,r){const a=r?r.children:void 0,u=(a?a.indexOf(i):1)===0?"th":"td",c=r&&r.type==="table"?r.align:void 0,h=c?c.length:i.children.length;let g=-1;const p=[];for(;++g<h;){const y=i.children[g],w={},x=c?c[g]:void 0;x&&(w.align=x);let S={type:"element",tagName:u,properties:w,children:[]};y&&(S.children=t.all(y),t.patch(y,S),S=t.applyData(y,S)),p.push(S)}const v={type:"element",tagName:"tr",properties:{},children:t.wrap(p,!0)};return t.patch(i,v),t.applyData(i,v)}function uC(t,i){const r={type:"element",tagName:"td",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}const jv=9,Cv=32;function cC(t){const i=String(t),r=/\r?\n|\r/g;let a=r.exec(i),o=0;const u=[];for(;a;)u.push(Nv(i.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=r.exec(i);return u.push(Nv(i.slice(o),o>0,!1)),u.join("")}function Nv(t,i,r){let a=0,o=t.length;if(i){let u=t.codePointAt(a);for(;u===jv||u===Cv;)a++,u=t.codePointAt(a)}if(r){let u=t.codePointAt(o-1);for(;u===jv||u===Cv;)o--,u=t.codePointAt(o-1)}return o>a?t.slice(a,o):""}function fC(t,i){const r={type:"text",value:cC(String(i.value))};return t.patch(i,r),t.applyData(i,r)}function dC(t,i){const r={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(i,r),t.applyData(i,r)}const hC={blockquote:Vj,break:Yj,code:Fj,delete:Gj,emphasis:Qj,footnoteReference:Xj,heading:Zj,html:Kj,imageReference:$j,image:Jj,inlineCode:Pj,linkReference:Wj,link:eC,listItem:tC,list:iC,paragraph:lC,root:rC,strong:aC,table:sC,tableCell:uC,tableRow:oC,text:fC,thematicBreak:dC,toml:hu,yaml:hu,definition:hu,footnoteDefinition:hu};function hu(){}const Ix=-1,Fu=0,Es=1,Au=2,_h=3,zh=4,Mh=5,qh=6,Vx=7,Yx=8,{defineProperty:mC}=Object,Fx=typeof self=="object"?self:globalThis,Av=(t,i)=>{switch(t){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+t)}return new Fx[t](i)},pC=(t,i)=>{const r=(o,u)=>(t.set(u,o),o),a=o=>{if(t.has(o))return t.get(o);const[u,c]=i[o];switch(u){case Fu:case Ix:return r(c,o);case Es:{const h=r([],o);for(const g of c)h.push(a(g));return h}case Au:{const h=r({},o);for(const[g,p]of c){const v=a(g),y=a(p);v==="__proto__"?mC(h,v,{value:y,configurable:!0,enumerable:!0,writable:!0}):h[v]=y}return h}case _h:return r(new Date(c),o);case zh:{const{source:h,flags:g}=c;return r(new RegExp(h,g),o)}case Mh:{const h=r(new Map,o);for(const[g,p]of c)h.set(a(g),a(p));return h}case qh:{const h=r(new Set,o);for(const g of c)h.add(a(g));return h}case Vx:{const{name:h,message:g}=c;return r(typeof Fx[h]=="function"?Av(h,g):new Error(g),o)}case Yx:return r(BigInt(c),o);case"BigInt":return r(Object(BigInt(c)),o);case"ArrayBuffer":return r(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:h}=new Uint8Array(c);return r(new DataView(h),c)}case"-0":return-0}return r(Av(u,c),o)};return a},Ov=t=>pC(new Map,t)(0),hr="",{toString:gC}={},{keys:yC,is:vC}=Object,vs=t=>{const i=typeof t;if(i!=="object"||!t)return[Fu,i];const r=gC.call(t).slice(8,-1);switch(r){case"Array":return[Es,hr];case"Object":return[Au,hr];case"Date":return[_h,hr];case"RegExp":return[zh,hr];case"Map":return[Mh,hr];case"Set":return[qh,hr];case"DataView":return[Es,r]}return r.includes("Array")?[Es,r]:t instanceof Error?[Vx,t.name||"Error"]:[Au,r]},mu=([t,i])=>t===Fu&&(i==="function"||i==="symbol"),bC=(t,i,r,a)=>{const o=(c,h)=>{const g=a.push(c)-1;return r.set(h,g),g},u=c=>{if(r.has(c))return r.get(c);let[h,g]=vs(c);switch(h){case Fu:{let v=c;switch(g){case"bigint":h=Yx,v=c.toString();break;case"number":if(!c&&vC(c,-0))return a.push(["-0"])-1;break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+g);v=null;break;case"undefined":return o([Ix],c)}return o([h,v],c)}case Es:{if(g){let w=c;return g==="DataView"?w=new Uint8Array(c.buffer):g==="ArrayBuffer"&&(w=new Uint8Array(c)),o([g,[...w]],c)}const v=[],y=o([h,v],c);for(const w of c)v.push(u(w));return y}case Au:{if(g)switch(g){case"BigInt":return o([g,c.toString()],c);case"Boolean":case"Number":case"String":return o([g,c.valueOf()],c)}if(i&&"toJSON"in c)return u(c.toJSON());const v=[],y=o([h,v],c);for(const w of yC(c))(t||!mu(vs(c[w])))&&v.push([u(w),u(c[w])]);return y}case _h:return o([h,isNaN(c.getTime())?hr:c.toISOString()],c);case zh:{const{source:v,flags:y}=c;return o([h,{source:v,flags:y}],c)}case Mh:{const v=[],y=o([h,v],c);for(const[w,x]of c)(t||!(mu(vs(w))||mu(vs(x))))&&v.push([u(w),u(x)]);return y}case qh:{const v=[],y=o([h,v],c);for(const w of c)(t||!mu(vs(w)))&&v.push(u(w));return y}}const{message:p}=c;return o([h,{name:g,message:p}],c)};return u},Rv=(t,{json:i,lossy:r}={})=>{const a=[];return bC(!(i||r),!!i,new Map,a)(t),a},Ou=typeof structuredClone=="function"?(t,i)=>i&&("json"in i||"lossy"in i)?Ov(Rv(t,i)):structuredClone(t):(t,i)=>Ov(Rv(t,i));function xC(t,i){const r=[{type:"text",value:"↩"}];return i>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),r}function wC(t,i){return"Back to reference "+(t+1)+(i>1?"-"+i:"")}function SC(t){const i=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=t.options.footnoteBackContent||xC,a=t.options.footnoteBackLabel||wC,o=t.options.footnoteLabel||"Footnotes",u=t.options.footnoteLabelTagName||"h2",c=t.options.footnoteLabelProperties||{className:["sr-only"]},h=[];let g=-1;for(;++g<t.footnoteOrder.length;){const p=t.footnoteById.get(t.footnoteOrder[g]);if(!p)continue;const v=t.all(p),y=String(p.identifier).toUpperCase(),w=pa(y.toLowerCase());let x=0;const S=[],T=t.footnoteCounts.get(y);for(;T!==void 0&&++x<=T;){S.length>0&&S.push({type:"text",value:" "});let q=typeof r=="string"?r:r(g,x);typeof q=="string"&&(q={type:"text",value:q}),S.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+w+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(g,x),className:["data-footnote-backref"]},children:Array.isArray(q)?q:[q]})}const C=v[v.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const q=C.children[C.children.length-1];q&&q.type==="text"?q.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...S)}else v.push(...S);const E={type:"element",tagName:"li",properties:{id:i+"fn-"+w},children:t.wrap(v,!0)};t.patch(p,E),h.push(E)}if(h.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Ou(c),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
25
- `},{type:"element",tagName:"ol",properties:{},children:t.wrap(h,!0)},{type:"text",value:`
26
- `}]}}const Gu=(function(t){if(t==null)return jC;if(typeof t=="function")return Qu(t);if(typeof t=="object")return Array.isArray(t)?kC(t):EC(t);if(typeof t=="string")return TC(t);throw new Error("Expected function, string, or object as test")});function kC(t){const i=[];let r=-1;for(;++r<t.length;)i[r]=Gu(t[r]);return Qu(a);function a(...o){let u=-1;for(;++u<i.length;)if(i[u].apply(this,o))return!0;return!1}}function EC(t){const i=t;return Qu(r);function r(a){const o=a;let u;for(u in t)if(o[u]!==i[u])return!1;return!0}}function TC(t){return Qu(i);function i(r){return r&&r.type===t}}function Qu(t){return i;function i(r,a,o){return!!(CC(r)&&t.call(this,r,typeof a=="number"?a:void 0,o||void 0))}}function jC(){return!0}function CC(t){return t!==null&&typeof t=="object"&&"type"in t}const Gx=[],NC=!0,Ts=!1,ah="skip";function sh(t,i,r,a){if(!t||typeof t!="object")throw new Error("Unexpected value `"+t+"` for `tree`, expected node");let o=!0,u,c,h,g;if(typeof r=="function"||r&&typeof r=="object"?(u=i,c=r,a&&(o=!1)):(c=i,r&&(o=!1)),typeof c=="function")h=c;else if(c&&typeof c=="object"){if(!(c.enter===null||c.enter===void 0))if(typeof c.enter=="function")h=c.enter;else throw new Error("Unexpected value `"+c.enter+"` for `visitors.enter`, expected optional visitor");if(typeof c.exit=="function")g=c.exit;else throw new Error("Unexpected value `"+c.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+c+"` for `enter` or `visitors`, expected visitor or object with visitors");const p=Gu(u),v=o?1:-1;y(t,void 0,[])();function y(w,x,S){const T=w&&typeof w=="object"?w:{};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 ("+(w.type+(E?"<"+E+">":""))+")"})}return C;function C(){const E=!u||p(w,x,S[S.length-1]||void 0);let q=Gx;if(h&&E&&(q=_v(h(w,S,x)),q[0]===Ts))return q;if("children"in w&&w.children){const B=w;if(B.children&&q[0]!==ah){let ee=(o?-1:B.children.length)+v;const X=[...S,B];for(;ee>-1&&ee<B.children.length;){const O=B.children[ee],Y=y(O,ee,X)();if(Y[0]===Ts)return Y;ee=typeof Y[1]=="number"?Y[1]:ee+v}}}if(g&&E){const B=_v(g(w,S,x));if(B[0]===ah)throw new Error("Unexpected value `"+B[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(B[0]===Ts||typeof B[1]=="number")return B}return q}}}function _v(t){return Array.isArray(t)?t:typeof t=="number"?[NC,t]:t==null?Gx:[t]}function Xu(t,i,r,a){let o,u,c;u=i,c=r,typeof u=="function"?sh(t,o,oh(u),c):sh(t,o,AC(u),c)}function AC(t){return!t||typeof t!="object"?t:{enter:typeof t.enter=="function"?oh(t.enter):t.enter,exit:typeof t.exit=="function"?oh(t.exit):t.exit}}function oh(t){return i;function i(r,a,o){return t(r,o,a[a.length-1])}}const uh={}.hasOwnProperty,OC={};function RC(t,i){const r=i||OC,a=new Map,o=new Map,u=new Map,c={...hC,...r.handlers},h={all:p,applyData:zC,definitionById:a,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:c,one:g,options:r,patch:_C,wrap:qC};return Xu(t,function(v){if(v.type==="definition"||v.type==="footnoteDefinition"){const y=v.type==="definition"?a:o,w=String(v.identifier).toUpperCase();y.has(w)||y.set(w,v)}}),h;function g(v,y){const w=v.type,x=h.handlers[w];if(uh.call(h.handlers,w)&&x)return x(h,v,y);if(h.options.passThrough&&h.options.passThrough.includes(w)){if("children"in v){const{children:T,...C}=v,E=Ou(C);return E.children=h.all(v),E}return Ou(v)}return(h.options.unknownHandler||MC)(h,v,y)}function p(v){const y=[];if("children"in v){const w=v.children;let x=-1;for(;++x<w.length;){const S=h.one(w[x],v);if(S){if(x&&w[x-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=zv(S.value)),!Array.isArray(S)&&S.type==="element")){const T=S.children[0];T&&T.type==="text"&&(T.value=zv(T.value))}Array.isArray(S)?y.push(...S):y.push(S)}}}return y}}function _C(t,i){t.position&&(i.position=wE(t))}function zC(t,i){let r=i;if(t&&t.data){const a=t.data.hName,o=t.data.hChildren,u=t.data.hProperties;if(typeof a=="string")if(r.type==="element")r.tagName=a;else{const c="children"in r?r.children:[r];r={type:"element",tagName:a,properties:{},children:c}}r.type==="element"&&u&&Object.assign(r.properties,Ou(u)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function MC(t,i){const r=i.data||{},a="value"in i&&!(uh.call(r,"hProperties")||uh.call(r,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:t.all(i)};return t.patch(i,a),t.applyData(i,a)}function qC(t,i){const r=[];let a=-1;for(i&&r.push({type:"text",value:`
27
- `});++a<t.length;)a&&r.push({type:"text",value:`
28
- `}),r.push(t[a]);return i&&t.length>0&&r.push({type:"text",value:`
29
- `}),r}function zv(t){let i=0,r=t.charCodeAt(i);for(;r===9||r===32;)i++,r=t.charCodeAt(i);return t.slice(i)}function Mv(t,i){const r=RC(t,i),a=r.one(t,void 0),o=SC(r),u=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
30
- `},o),u}function DC(t,i){return t&&"run"in t?async function(r,a){const o=Mv(r,{file:a,...i});await t.run(o,a)}:function(r,a){return Mv(r,{file:a,...t||i})}}function qv(t){if(t)throw t}var _d,Dv;function LC(){if(Dv)return _d;Dv=1;var t=Object.prototype.hasOwnProperty,i=Object.prototype.toString,r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(p){return typeof Array.isArray=="function"?Array.isArray(p):i.call(p)==="[object Array]"},u=function(p){if(!p||i.call(p)!=="[object Object]")return!1;var v=t.call(p,"constructor"),y=p.constructor&&p.constructor.prototype&&t.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!v&&!y)return!1;var w;for(w in p);return typeof w>"u"||t.call(p,w)},c=function(p,v){r&&v.name==="__proto__"?r(p,v.name,{enumerable:!0,configurable:!0,value:v.newValue,writable:!0}):p[v.name]=v.newValue},h=function(p,v){if(v==="__proto__")if(t.call(p,v)){if(a)return a(p,v).value}else return;return p[v]};return _d=function g(){var p,v,y,w,x,S,T=arguments[0],C=1,E=arguments.length,q=!1;for(typeof T=="boolean"&&(q=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(v in p)y=h(T,v),w=h(p,v),T!==w&&(q&&w&&(u(w)||(x=o(w)))?(x?(x=!1,S=y&&o(y)?y:[]):S=y&&u(y)?y:{},c(T,{name:v,newValue:g(q,S,w)})):typeof w<"u"&&c(T,{name:v,newValue:w}));return T},_d}var BC=LC();const zd=Rb(BC);function ch(t){if(typeof t!="object"||t===null)return!1;const i=Object.getPrototypeOf(t);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function UC(){const t=[],i={run:r,use:a};return i;function r(...o){let u=-1;const c=o.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);h(null,...o);function h(g,...p){const v=t[++u];let y=-1;if(g){c(g);return}for(;++y<o.length;)(p[y]===null||p[y]===void 0)&&(p[y]=o[y]);o=p,v?HC(v,h)(...p):c(null,...p)}}function a(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return t.push(o),i}}function HC(t,i){let r;return a;function a(...c){const h=t.length>c.length;let g;h&&c.push(o);try{g=t.apply(this,c)}catch(p){const v=p;if(h&&r)throw v;return o(v)}h||(g&&g.then&&typeof g.then=="function"?g.then(u,o):g instanceof Error?o(g):u(g))}function o(c,...h){r||(r=!0,i(c,...h))}function u(c){o(null,c)}}const Ci={basename:IC,dirname:VC,extname:YC,join:FC,sep:"/"};function IC(t,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');Hs(t);let r=0,a=-1,o=t.length,u;if(i===void 0||i.length===0||i.length>t.length){for(;o--;)if(t.codePointAt(o)===47){if(u){r=o+1;break}}else a<0&&(u=!0,a=o+1);return a<0?"":t.slice(r,a)}if(i===t)return"";let c=-1,h=i.length-1;for(;o--;)if(t.codePointAt(o)===47){if(u){r=o+1;break}}else c<0&&(u=!0,c=o+1),h>-1&&(t.codePointAt(o)===i.codePointAt(h--)?h<0&&(a=o):(h=-1,a=c));return r===a?a=c:a<0&&(a=t.length),t.slice(r,a)}function VC(t){if(Hs(t),t.length===0)return".";let i=-1,r=t.length,a;for(;--r;)if(t.codePointAt(r)===47){if(a){i=r;break}}else a||(a=!0);return i<0?t.codePointAt(0)===47?"/":".":i===1&&t.codePointAt(0)===47?"//":t.slice(0,i)}function YC(t){Hs(t);let i=t.length,r=-1,a=0,o=-1,u=0,c;for(;i--;){const h=t.codePointAt(i);if(h===47){if(c){a=i+1;break}continue}r<0&&(c=!0,r=i+1),h===46?o<0?o=i:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||r<0||u===0||u===1&&o===r-1&&o===a+1?"":t.slice(o,r)}function FC(...t){let i=-1,r;for(;++i<t.length;)Hs(t[i]),t[i]&&(r=r===void 0?t[i]:r+"/"+t[i]);return r===void 0?".":GC(r)}function GC(t){Hs(t);const i=t.codePointAt(0)===47;let r=QC(t,!i);return r.length===0&&!i&&(r="."),r.length>0&&t.codePointAt(t.length-1)===47&&(r+="/"),i?"/"+r:r}function QC(t,i){let r="",a=0,o=-1,u=0,c=-1,h,g;for(;++c<=t.length;){if(c<t.length)h=t.codePointAt(c);else{if(h===47)break;h=47}if(h===47){if(!(o===c-1||u===1))if(o!==c-1&&u===2){if(r.length<2||a!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(g=r.lastIndexOf("/"),g!==r.length-1){g<0?(r="",a=0):(r=r.slice(0,g),a=r.length-1-r.lastIndexOf("/")),o=c,u=0;continue}}else if(r.length>0){r="",a=0,o=c,u=0;continue}}i&&(r=r.length>0?r+"/..":"..",a=2)}else r.length>0?r+="/"+t.slice(o+1,c):r=t.slice(o+1,c),a=c-o-1;o=c,u=0}else h===46&&u>-1?u++:u=-1}return r}function Hs(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const XC={cwd:ZC};function ZC(){return"/"}function fh(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function KC(t){if(typeof t=="string")t=new URL(t);else if(!fh(t)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(t.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return $C(t)}function $C(t){if(t.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 i=t.pathname;let r=-1;for(;++r<i.length;)if(i.codePointAt(r)===37&&i.codePointAt(r+1)===50){const a=i.codePointAt(r+2);if(a===70||a===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(i)}const Md=["history","path","basename","stem","extname","dirname"];class Qx{constructor(i){let r;i?fh(i)?r={path:i}:typeof i=="string"||JC(i)?r={value:i}:r=i:r={},this.cwd="cwd"in r?"":XC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Md.length;){const u=Md[a];u in r&&r[u]!==void 0&&r[u]!==null&&(this[u]=u==="history"?[...r[u]]:r[u])}let o;for(o in r)Md.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?Ci.basename(this.path):void 0}set basename(i){Dd(i,"basename"),qd(i,"basename"),this.path=Ci.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Ci.dirname(this.path):void 0}set dirname(i){Lv(this.basename,"dirname"),this.path=Ci.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Ci.extname(this.path):void 0}set extname(i){if(qd(i,"extname"),Lv(this.dirname,"extname"),i){if(i.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(i.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ci.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){fh(i)&&(i=KC(i)),Dd(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Ci.basename(this.path,this.extname):void 0}set stem(i){Dd(i,"stem"),qd(i,"stem"),this.path=Ci.join(this.dirname||"",i+(this.extname||""))}fail(i,r,a){const o=this.message(i,r,a);throw o.fatal=!0,o}info(i,r,a){const o=this.message(i,r,a);return o.fatal=void 0,o}message(i,r,a){const o=new Iu(i,r,a);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function qd(t,i){if(t&&t.includes(Ci.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Ci.sep+"`")}function Dd(t,i){if(!t)throw new Error("`"+i+"` cannot be empty")}function Lv(t,i){if(!t)throw new Error("Setting `"+i+"` requires `path` to be set too")}function JC(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const PC=(function(t){const a=this.constructor.prototype,o=a[t],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,a),u}),WC={}.hasOwnProperty;class Dh extends PC{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=UC()}copy(){const i=new Dh;let r=-1;for(;++r<this.attachers.length;){const a=this.attachers[r];i.use(...a)}return i.data(zd(!0,{},this.namespace)),i}data(i,r){return typeof i=="string"?arguments.length===2?(Ud("data",this.frozen),this.namespace[i]=r,this):WC.call(this.namespace,i)&&this.namespace[i]||void 0:i?(Ud("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const o=r.call(i,...a);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const r=pu(i),a=this.parser||this.Parser;return Ld("parse",a),a(String(r),r)}process(i,r){const a=this;return this.freeze(),Ld("process",this.parser||this.Parser),Bd("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(u,c){const h=pu(i),g=a.parse(h);a.run(g,h,function(v,y,w){if(v||!y||!w)return p(v);const x=y,S=a.stringify(x,w);nN(S)?w.value=S:w.result=S,p(v,w)});function p(v,y){v||!y?c(v):u?u(y):r(void 0,y)}}}processSync(i){let r=!1,a;return this.freeze(),Ld("processSync",this.parser||this.Parser),Bd("processSync",this.compiler||this.Compiler),this.process(i,o),Uv("processSync","process",r),a;function o(u,c){r=!0,qv(u),a=c}}run(i,r,a){Bv(i),this.freeze();const o=this.transformers;return!a&&typeof r=="function"&&(a=r,r=void 0),a?u(void 0,a):new Promise(u);function u(c,h){const g=pu(r);o.run(i,g,p);function p(v,y,w){const x=y||i;v?h(v):c?c(x):a(void 0,x,w)}}}runSync(i,r){let a=!1,o;return this.run(i,r,u),Uv("runSync","run",a),o;function u(c,h){qv(c),o=h,a=!0}}stringify(i,r){this.freeze();const a=pu(r),o=this.compiler||this.Compiler;return Bd("stringify",o),Bv(i),o(i,a)}use(i,...r){const a=this.attachers,o=this.namespace;if(Ud("use",this.frozen),i!=null)if(typeof i=="function")g(i,r);else if(typeof i=="object")Array.isArray(i)?h(i):c(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function u(p){if(typeof p=="function")g(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[v,...y]=p;g(v,y)}else c(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function c(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&&(o.settings=zd(!0,o.settings,p.settings))}function h(p){let v=-1;if(p!=null)if(Array.isArray(p))for(;++v<p.length;){const y=p[v];u(y)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function g(p,v){let y=-1,w=-1;for(;++y<a.length;)if(a[y][0]===p){w=y;break}if(w===-1)a.push([p,...v]);else if(v.length>0){let[x,...S]=v;const T=a[w][1];ch(T)&&ch(x)&&(x=zd(!0,T,x)),a[w]=[p,x,...S]}}}}const eN=new Dh().freeze();function Ld(t,i){if(typeof i!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Bd(t,i){if(typeof i!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Ud(t,i){if(i)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Bv(t){if(!ch(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Uv(t,i,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+i+"` instead")}function pu(t){return tN(t)?t:new Qx(t)}function tN(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function nN(t){return typeof t=="string"||iN(t)}function iN(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const lN="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Hv=[],Iv={allowDangerousHtml:!0},rN=/^(https?|ircs?|mailto|xmpp)$/i,aN=[{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 sN(t){const i=oN(t),r=uN(t);return cN(i.runSync(i.parse(r),r),t)}function oN(t){const i=t.rehypePlugins||Hv,r=t.remarkPlugins||Hv,a=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Iv}:Iv;return eN().use(Ij).use(r).use(DC,a).use(i)}function uN(t){const i=t.children||"",r=new Qx;return typeof i=="string"&&(r.value=i),r}function cN(t,i){const r=i.allowedElements,a=i.allowElement,o=i.components,u=i.disallowedElements,c=i.skipHtml,h=i.unwrapDisallowed,g=i.urlTransform||fN;for(const v of aN)Object.hasOwn(i,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+lN+v.id,void 0);return Xu(t,p),CE(t,{Fragment:m.Fragment,components:o,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function p(v,y,w){if(v.type==="raw"&&w&&typeof y=="number")return c?w.children.splice(y,1):w.children[y]={type:"text",value:v.value},y;if(v.type==="element"){let x;for(x in Ad)if(Object.hasOwn(Ad,x)&&Object.hasOwn(v.properties,x)){const S=v.properties[x],T=Ad[x];(T===null||T.includes(v.tagName))&&(v.properties[x]=g(String(S||""),x,v))}}if(v.type==="element"){let x=r?!r.includes(v.tagName):u?u.includes(v.tagName):!1;if(!x&&a&&typeof y=="number"&&(x=!a(v,y,w)),x&&w&&typeof y=="number")return h&&v.children?w.children.splice(y,1,...v.children):w.children.splice(y,1),y}}}function fN(t){const i=t.indexOf(":"),r=t.indexOf("?"),a=t.indexOf("#"),o=t.indexOf("/");return i===-1||o!==-1&&i>o||r!==-1&&i>r||a!==-1&&i>a||rN.test(t.slice(0,i))?t:""}function Vv(t,i){const r=String(t);if(typeof i!="string")throw new TypeError("Expected character");let a=0,o=r.indexOf(i);for(;o!==-1;)a++,o=r.indexOf(i,o+i.length);return a}function dN(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function hN(t,i,r){const o=Gu((r||{}).ignore||[]),u=mN(i);let c=-1;for(;++c<u.length;)sh(t,h);function h(p,v,y){if(p.type==="text"&&typeof y=="number")return g(p,v,y);if(o(p,y,v[v.length-1]))return ah}function g(p,v,y){const w=v[v.length-1],x=u[c][0],S=u[c][1];let T=0,C=!1,E=[];x.lastIndex=0;let q=x.exec(p.value);for(;q;){const ee=q.index,X={index:q.index,input:q.input,stack:[...v,p]};let O=S(...q,X);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1)x.lastIndex=ee+1;else{if(T!==ee&&B({type:"text",value:p.value.slice(T,ee)}),Array.isArray(O))for(const Y of O)B(Y);else O&&B(O);T=ee+q[0].length,C=!0}if(!x.global)break;q=x.exec(p.value)}return C?(T<p.value.length&&B({type:"text",value:p.value.slice(T)}),w.children.splice(y,1,...E)):E=[p],y+E.length;function B(ee){const X=E[E.length-1];X&&X.type==="text"&&ee.type==="text"?X.value+=ee.value:E.push(ee)}}}function mN(t){if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const i=[],r=!t[0]||Array.isArray(t[0])?t:[t];let a=-1;for(;++a<r.length;){const o=r[a];i.push([pN(o[0]),gN(o[1])])}return i}function pN(t){return typeof t=="string"?new RegExp(dN(t),"g"):t}function gN(t){return typeof t=="function"?t:function(){return t}}const Hd="phrasing",Id=["autolink","link","image","label"];function yN(){return{transforms:[EN],enter:{literalAutolink:bN,literalAutolinkEmail:Vd,literalAutolinkHttp:Vd,literalAutolinkWww:Vd},exit:{literalAutolink:kN,literalAutolinkEmail:SN,literalAutolinkHttp:xN,literalAutolinkWww:wN}}}function vN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Hd,notInConstruct:Id},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Hd,notInConstruct:Id},{character:":",before:"[ps]",after:"\\/",inConstruct:Hd,notInConstruct:Id}]}}function bN(t){this.enter({type:"link",title:null,url:"",children:[],position:void 0},t)}function Vd(t){this.config.enter.autolinkProtocol.call(this,t)}function xN(t){this.config.exit.autolinkProtocol.call(this,t)}function wN(t){this.config.exit.data.call(this,t);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(t)}function SN(t){this.config.exit.autolinkEmail.call(this,t)}function kN(t){this.exit(t)}function EN(t){hN(t,[[new RegExp("(?<![\\da-z])(https?:\\/\\/|www(?=\\.))([\\w-]*\\.[\\w\\-.]*)([^\\t\\n\\r ]*)","gi"),TN],[new RegExp("(?<![\\w+\\-.@])xmpp:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)(\\/(?:[\\w\\-/]|\\.(?=[\\dA-Za-z]))*)?","g"),NN],[new RegExp("(?<![\\w+\\-.@])mailto:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),CN],[new RegExp("(?<![\\w+\\-.]|(?:^|[^\\d@A-Za-z])(?:mailto|xmpp):)([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),jN]],{ignore:["link","linkReference"]})}function TN(t,i,r,a,o){if(!RN(o))return!1;let u="";if(/^w/i.test(i)&&(r=i+r,i="",u="http://"),Bs(r.charCodeAt(0))||!AN(r))return!1;const c=ON(r+a),h={type:"link",title:null,url:u+i+c[0],children:[{type:"text",value:i+c[0],position:void 0}],position:void 0};return c[1]?[h,{type:"text",value:c[1],position:void 0}]:h}function jN(t,i,r){return/[\d\-_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+r,children:[{type:"text",value:i+"@"+r,position:void 0}],position:void 0}}function CN(t,i,r){if(/[\d\-_]$/.test(r))return!1;const a="mailto:"+i+"@"+r;return{type:"link",title:null,url:a,children:[{type:"text",value:a,position:void 0}],position:void 0}}function NN(t,i,r,a,o){if(/[\d\-_]$/.test(r)||a&&(!/[A-Za-z]$/.test(a)||o.input.charAt(o.index+t.length)==="@"))return!1;const u="xmpp:"+i+"@"+r+(a||"");return{type:"link",title:null,url:u,children:[{type:"text",value:u,position:void 0}],position:void 0}}function AN(t){const i=t.split(".");return!(i.length<2||i[i.length-1]&&(/_/.test(i[i.length-1])||!/[\dA-Za-z]/.test(i[i.length-1]))||i[i.length-2]&&(/_/.test(i[i.length-2])||!/[\dA-Za-z]/.test(i[i.length-2])))}function ON(t){let i=t.length;for(;i>0;){const c=t.charCodeAt(i-1);if(c===33||c===34||c===38||c===39||c===41||c===44||c===46||c===58||c===59||c===60||c===62||c===63||c===93||c===125)i--;else break}if(i===t.length)return[t,void 0];let r=t.slice(i);t=t.slice(0,i);let a=r.indexOf(")");const o=Vv(t,"(");let u=Vv(t,")");for(;a!==-1&&o>u;)t+=r.slice(0,a+1),r=r.slice(a+1),a=r.indexOf(")"),u++;return[t,r]}function RN(t){const i=t.input.charCodeAt(t.index-1);return t.index===0||gr(i)||Bs(i)}Xx.peek=HN;function _N(){this.buffer()}function zN(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function MN(){this.buffer()}function qN(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function DN(t){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=di(this.sliceSerialize(t)).toLowerCase(),r.label=i}function LN(t){this.exit(t)}function BN(t){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=di(this.sliceSerialize(t)).toLowerCase(),r.label=i}function UN(t){this.exit(t)}function HN(){return"["}function Xx(t,i,r,a){const o=r.createTracker(a);let u=o.move("[^");const c=r.enter("footnoteReference"),h=r.enter("reference");return u+=o.move(r.safe(r.associationId(t),{after:"]",before:u})),h(),c(),u+=o.move("]"),u}function IN(){return{enter:{gfmFootnoteCallString:_N,gfmFootnoteCall:zN,gfmFootnoteDefinitionLabelString:MN,gfmFootnoteDefinition:qN},exit:{gfmFootnoteCallString:DN,gfmFootnoteCall:LN,gfmFootnoteDefinitionLabelString:BN,gfmFootnoteDefinition:UN}}}function VN(t){let i=!1;return t&&t.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:r,footnoteReference:Xx},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(a,o,u,c){const h=u.createTracker(c);let g=h.move("[^");const p=u.enter("footnoteDefinition"),v=u.enter("label");return g+=h.move(u.safe(u.associationId(a),{before:g,after:"]"})),v(),g+=h.move("]:"),a.children&&a.children.length>0&&(h.shift(4),g+=h.move((i?`
31
- `:" ")+u.indentLines(u.containerFlow(a,h.current()),i?Zx:YN))),p(),g}}function YN(t,i,r){return i===0?t:Zx(t,i,r)}function Zx(t,i,r){return(r?"":" ")+t}const FN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Lh.attention=KN;Lh.peek=$N;function GN(){return{canContainEols:["delete"],enter:{strikethrough:XN},exit:{strikethrough:ZN}}}function QN(){return{handlers:{delete:Lh},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:FN}]}}function XN(t){this.enter({type:"delete",children:[],position:void 0},t)}function ZN(t){this.exit(t)}function Lh(t,i,r,a){const o=r.createTracker(a),u=r.stack.includes("strikethrough")?"~":"~~",c=r.enter("strikethrough");let h=o.move(u);return h+=r.containerPhrasing(t,{...o.current(),before:h,after:"~"}),h+=o.move(u),c(),h}function KN(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function $N(){return"~"}function JN(t){return t.length}function PN(t,i){const r=i||{},a=(r.align||[]).concat(),o=r.stringLength||JN,u=[],c=[],h=[],g=[];let p=0,v=-1;for(;++v<t.length;){const T=[],C=[];let E=-1;for(t[v].length>p&&(p=t[v].length);++E<t[v].length;){const q=WN(t[v][E]);if(r.alignDelimiters!==!1){const B=o(q);C[E]=B,(g[E]===void 0||B>g[E])&&(g[E]=B)}T.push(q)}c[v]=T,h[v]=C}let y=-1;if(typeof a=="object"&&"length"in a)for(;++y<p;)u[y]=Yv(a[y]);else{const T=Yv(a);for(;++y<p;)u[y]=T}y=-1;const w=[],x=[];for(;++y<p;){const T=u[y];let C="",E="";T===99?(C=":",E=":"):T===108?C=":":T===114&&(E=":");let q=r.alignDelimiters===!1?1:Math.max(1,g[y]-C.length-E.length);const B=C+"-".repeat(q)+E;r.alignDelimiters!==!1&&(q=C.length+q+E.length,q>g[y]&&(g[y]=q),x[y]=q),w[y]=B}c.splice(1,0,w),h.splice(1,0,x),v=-1;const S=[];for(;++v<c.length;){const T=c[v],C=h[v],E=r.fillRows===!1?Math.max(1,c[v===1?0:v].length):p;y=-1;const q=[];for(;++y<E;){const B=T[y]||"";let ee="",X="";if(r.alignDelimiters!==!1){const O=g[y]-(C[y]||0),Y=u[y];if(Y===114)ee=" ".repeat(O);else if(Y===99){const K=O/2;O%2?(ee=" ".repeat(K+.5),X=" ".repeat(K-.5)):(ee=" ".repeat(K),X=ee)}else X=" ".repeat(O)}r.delimiterStart!==!1&&!y&&q.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&B==="")&&(r.delimiterStart!==!1||y)&&q.push(" "),r.alignDelimiters!==!1&&q.push(ee),q.push(B),r.alignDelimiters!==!1&&q.push(X),r.padding!==!1&&q.push(" "),(r.delimiterEnd!==!1||y!==E-1)&&q.push("|")}S.push(r.delimiterEnd===!1?q.join("").replace(/ +$/,""):q.join(""))}return S.join(`
32
- `)}function WN(t){return t==null?"":String(t)}function Yv(t){const i=typeof t=="string"?t.codePointAt(0):0;return i===67||i===99?99:i===76||i===108?108:i===82||i===114?114:0}const eA=Gu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function tA(t,i,r,a){const o=r.enter("blockquote"),u=r.createTracker(a);u.move("> "),u.shift(2);const c=r.indentLines(r.containerFlow(t,u.current()),nA);return o(),c}function nA(t,i,r){return">"+(r?"":" ")+t}function iA(t,i){return Fv(t,i.inConstruct,!0)&&!Fv(t,i.notInConstruct,!1)}function Fv(t,i,r){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return r;let a=-1;for(;++a<i.length;)if(t.includes(i[a]))return!0;return!1}function Gv(t,i,r,a){let o=-1;for(;++o<r.unsafe.length;){const u=r.unsafe[o];if(u.character===`
33
- `&&!u.before&&!u.after&&iA(r.stack,u))return/[\t ]/.test(a.before)?"":" "}return`\\
34
- `}function lA(t,i){const r=String(t);let a=r.indexOf(i),o=a,u=0,c=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===o?++u>c&&(c=u):u=1,o=a+i.length,a=r.indexOf(i,o);return c}function rA(t,i){return!!(i.options.fences===!1&&t.value&&!t.lang&&/[^\n\r ]/.test(t.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(t.value))}function aA(t){const i=t.options.fence||"`";if(i!=="`"&&i!=="~")throw new Error("Cannot serialize code with `"+i+"` for `options.fence`, expected `` ` `` or `~`");return i}function sA(t,i,r,a){const o=aA(r),u=t.value||"";if(rA(t,r)){const y=r.enter("codeIndented"),w=r.indentLines(u,oA);return y(),w}const c=r.createTracker(a),h=o.repeat(Math.max(lA(u,o)+1,3)),g=r.enter("codeFenced"),p=o==="`"?"GraveAccent":"Tilde";let v=c.move(h);if(t.lang){const y=r.enter(`codeFencedLang${p}`);v+=c.move(r.safe(t.lang,{before:v,after:" ",encode:["`"],...c.current()})),y()}if(t.lang&&t.meta){const y=r.enter(`codeFencedMeta${p}`);v+=c.move(" "),v+=c.move(r.safe(t.meta,{before:v,after:`
35
- `,encode:["`"],...c.current()})),y()}return v+=c.move(`
36
- `),u&&(v+=c.move(u+`
37
- `)),v+=c.move(h),g(),v}function oA(t,i,r){return(r?"":" ")+t}function Bh(t){const i=t.options.quote||'"';if(i!=='"'&&i!=="'")throw new Error("Cannot serialize title with `"+i+"` for `options.quote`, expected `\"`, or `'`");return i}function uA(t,i,r,a){const o=Bh(r),u=o==='"'?"Quote":"Apostrophe",c=r.enter("definition");let h=r.enter("label");const g=r.createTracker(a);let p=g.move("[");return p+=g.move(r.safe(r.associationId(t),{before:p,after:"]",...g.current()})),p+=g.move("]: "),h(),!t.url||/[\0- \u007F]/.test(t.url)?(h=r.enter("destinationLiteral"),p+=g.move("<"),p+=g.move(r.safe(t.url,{before:p,after:">",...g.current()})),p+=g.move(">")):(h=r.enter("destinationRaw"),p+=g.move(r.safe(t.url,{before:p,after:t.title?" ":`
38
- `,...g.current()}))),h(),t.title&&(h=r.enter(`title${u}`),p+=g.move(" "+o),p+=g.move(r.safe(t.title,{before:p,after:o,...g.current()})),p+=g.move(o),h()),c(),p}function cA(t){const i=t.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}function Ru(t){const i=t.codePointAt(0);return i===void 0?"":String.fromCodePoint(i)}function da(t){const i=t.codePointAt(t.length-2);return i!==void 0&&i>65535?t.slice(-2):t.slice(-1)}function Kx(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Qv(t,i,r){const a=Ol(t),o=Ol(i);return a===void 0?o===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function fA(t){if(t.charCodeAt(0)!==60)return;const i=t.charCodeAt(1);if(i===33){const h=t.charCodeAt(2);return h===45?2:h===91?5:yn(h)?4:void 0}if(i===63)return 3;const r=i===47,a=r?2:1;let o=a,u=t.charCodeAt(o);if(!yn(u))return;for(;u===45||vn(u);)u=t.charCodeAt(++o);const c=t.slice(a,o).toLowerCase();return!r&&u!==47&&rh.includes(c)?1:Mx.includes(c)?6:7}const $x=new Map([["*",!1],["_",!0]]);function dA(t,i,r){const a=new Set;for(const u of t){const c=r.get(u);if(c&&u.attention&&i.some(h=>h.attention===u.attention))for(const h of c.tokens)a.add(h.attention)}const o=[];for(const u of t)u.attention&&a.delete(u.attention)&&o.push(u.attention);return o.reverse(),o}function Jx(t,i,r){const a=[],o=new Map,u=new Map;let c=0;for(;c<t.length;){if(!t[c].attention){c++;continue}const h=t[c].value.charAt(0),g=$x.get(h);let p=c+1;for(;p<t.length&&t[p].attention&&t[p].value.charAt(0)===h;)p++;const v=c?t[c-1].value:i,y=Ol(v.charCodeAt(v.length-1)),w=Ol((p<t.length?t[p].value:r).charCodeAt(0)),x=!w||w===2&&!!y,S=!y||y===2&&!!w,T={tokens:t.slice(c,p),markers:[],start:0,end:0,open:g?x&&(!!y||!S):x,close:g?S&&(!!w||!x):S,split:g!==void 0};for(const C of T.tokens){o.set(C,[...T.tokens]),u.set(C,T);let E=C.value.length;for(;E--;)T.markers.push(C)}T.end=T.markers.length,a.push(T),c=p}for(mA(a,o),c=-1;++c<t.length;){const h=o.get(t[c]);if(h)return{attention:dA(t,h,u),index:c}}}function gu(t,i){const r=t[i?0:t.length-1];if(!r||r.attention)return;const a=i?Ru(r.value):da(r.value),o=Kx(a.codePointAt(0));if(i)r.value=o+r.value.slice(a.length);else{let u=r.value.slice(0,r.value.length-a.length),c=0;for(;u.charCodeAt(u.length-1-c)===92;)c++;c%2&&(u+="\\"),r.value=u+o}}function hA(t,i,r,a,o){for(const u of r.attention){const c=i.get(u)||u.sequences[0];for(const h of u.sequences){if(h===c)continue;const g=new Map(i);g.set(u,h);const p=Zu(t,g,a,o),v=Jx(p,a,o);if(!v||v.index>r.index)return{chosen:g,mistake:v,tokens:p}}}}function mA(t,i){const r=new Map;for(const a of t){const o=a.tokens[0].value.charAt(0);let u=r.get(o);u||(u=[],r.set(o,u));let c=a.close?u.length:0;for(;c--&&a.start<a.end;){const h=u[c],g=h.end-h.start,p=a.end-a.start;if(a.split?(h.close||a.open)&&p%3&&!((g+p)%3):g!==h.markers.length||g!==p)continue;const v=a.split?g>1&&p>1?2:1:p,y=h.markers.slice(h.end-v,h.end),w=a.markers.slice(a.start,a.start+v),x=y[0],S=w[0];if(x===y[v-1]&&x.value.length===v&&S===w[v-1]&&S.value.length===v&&x.attention===S.attention)i.delete(x),i.delete(S);else{const T=[...new Set([...y,...w])];for(const C of T){const E=i.get(C);E&&E.push(...T)}}h.end-=v,a.start+=v,h.start===h.end&&u.splice(c,1),c=u.length}a.open&&a.start<a.end&&u.push(a)}}function pA(t,i,r){if(i.length===0)throw new Error("Cannot serialize `"+t+"` as attention without markers, expected one or more markers");if(r.length===0)throw new Error("Cannot serialize `"+t+"` as attention without sizes, expected one or more sizes");for(const o of r)if(!Number.isSafeInteger(o)||o<1)throw new Error("Cannot serialize `"+t+"` as attention with `"+o+"` as size, expected positive integer");const a=[];for(const o of i){if(o.length!==1)throw new Error("Cannot serialize `"+t+"` as attention with `"+o+"` as marker, expected a single ascii character");if(!Tx(o.charCodeAt(0)))throw new Error("Cannot serialize `"+t+"` as attention with `"+o+"` as marker, expected ascii punctuation");for(const u of r)a.push(o.repeat(u))}return a}function gA(t,i,r){const a=i.indexStack,o=t.children||[],u=[];let c=-1,h=r.before;a.push(-1);let g=i.createTracker(r);for(;++c<o.length;){const p=o[c];let v;if(a[a.length-1]=c,c+1<o.length){let x=i.handle.handlers[o[c+1].type];x&&x.peek&&(x=x.peek),v=x?Ru(x(o[c+1],t,i,{before:"",after:"",...g.current()})):""}else v=r.after;const y=u[u.length-1];typeof y=="string"&&(h==="\r"||h===`
39
- `)&&p.type==="html"&&fA(p.value)!==7&&(u[u.length-1]=y.replace(/(\r?\n|\r)$/," "),h=" ",g=i.createTracker(r),g.move(Ku(u,r.before,r.after)));const w=i.handle.handlers[p.type];if(w&&w.attention){const x=Uh(p,w.attention,i,g);if(!x)continue;u.push(x),h=da(x.sequences[0])}else{const x=i.handle(p,t,i,{...g.current(),after:v,before:h});if(!x)continue;g.move(x),u.push(x),h=da(x)}}return a.pop(),u}function Uh(t,i,r,a){const{construct:o,markers:u,sizes:c}=i(t,r),h=pA(t.type,u,c),g=h[0],p=r.enter(o),v=r.createTracker(a.current());v.move(g);const y=gA(t,r,{...v.current(),before:g,after:g});if(p(),y.length!==0)return a.move(g),a.move(Ku(y,g,g)),a.move(g),{children:y,sequences:h}}function Xv(t,i,r,a){let o=Zu(t,i,r,a),u=Jx(o,r,a);for(;u;){const c=hA(t,i,u,r,a);if(!c)return;i=c.chosen,o=c.tokens,u=c.mistake}return o}function Px(t,i,r,a){let o=r,u=-1;for(;++u<t.length;){const c=t[u];if(typeof c=="string"){o="";continue}const h=u===t.length-1?a:"",g=c.sequences.find(function(p){const v=p.charAt(0);return v!==o.charAt(0)&&v!==h.charAt(0)||t.length===1&&$x.has(v)&&p.length>r.length})||c.sequences[0];g!==c.sequences[0]&&i.set(c,g),Px(c.children,i,g,g),o=g}}function Zu(t,i,r,a){const o=[];let u,c=da(r),h=-1;for(;++h<t.length;){const g=t[h];if(typeof g=="string"){const B={value:g,attention:void 0};u&&u===Ru(g)&&gu([B],!0),u=void 0,o.push(B),B.value&&(c=da(B.value));continue}const p=i.get(g)||g.sequences[0],v=p.charAt(0),y=t[h+1],w=c,x=Ru(y===void 0?a:typeof y=="string"?y:i.get(y)||y.sequences[0]),S=Zu(g.children,i,p,p),T=S[0].value,C=Qv(w.charCodeAt(w.length-1),T.charCodeAt(0),v);C.inside&&gu(S,!0);const E=da(S[S.length-1].value),q=Qv(x.charCodeAt(0),E.charCodeAt(E.length-1),v);q.inside&&gu(S,!1),C.outside&&w!==`
40
- `&&w!=="\r"&&gu(o,!1),q.outside&&(u=x),o.push({value:p,attention:g},...S,{value:p,attention:g}),c=p.charAt(p.length-1)}return o}function Ku(t,i,r){const a=new Map;Px(t,a,i,r);const o=(a.size>0?Xv(t,a,i,r):void 0)||Xv(t,new Map,i,r)||Zu(t,new Map,i,r);let u="";for(const c of o)u+=c.value;return u}Hh.attention=Wx;Hh.peek=yA;function Hh(t,i,r,a){const o=r.enter("phrasing"),u=Uh(t,Wx,r,r.createTracker(a)),c=u?Ku([u],a.before,a.after):"";return o(),c}function Wx(t,i){return{construct:"emphasis",markers:cA(i)==="*"?["*","_"]:["_","*"],sizes:[1]}}function yA(t,i,r){return r.options.emphasis||"*"}function vA(t,i){let r=!1;return Xu(t,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return r=!0,Ts}),!!((!t.depth||t.depth<3)&&Vu(t)&&(i.options.setext||r))}function bA(t,i,r,a){const o=Math.max(Math.min(6,t.depth||1),1),u=r.createTracker(a);if(vA(t,r)){const y=r.enter("headingSetext"),w=r.enter("phrasing"),x=r.containerPhrasing(t,{...u.current(),before:`
41
- `,after:`
42
- `});return w(),y(),x+`
43
- `+(o===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
44
- `))+1))}const c="#".repeat(o),h=r.enter("headingAtx"),g=r.enter("phrasing");u.move(c+" ");let p=r.containerPhrasing(t,{before:"# ",after:`
45
- `,...u.current()});const v=p.charCodeAt(0);return(v===9||v===32)&&(p=Kx(v)+p.slice(1)),p=p?c+" "+p:c,r.options.closeAtx&&(p+=" "+c),g(),h(),p}e0.peek=xA;function e0(t){return t.value||""}function xA(){return"<"}t0.peek=wA;function t0(t,i,r,a){const o=Bh(r),u=o==='"'?"Quote":"Apostrophe",c=r.enter("image");let h=r.enter("label");const g=r.createTracker(a);let p=g.move("![");return p+=g.move(r.safe(t.alt,{before:p,after:"]",...g.current()})),p+=g.move("]("),h(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(h=r.enter("destinationLiteral"),p+=g.move("<"),p+=g.move(r.safe(t.url,{before:p,after:">",...g.current()})),p+=g.move(">")):(h=r.enter("destinationRaw"),p+=g.move(r.safe(t.url,{before:p,after:t.title?" ":")",...g.current()}))),h(),t.title&&(h=r.enter(`title${u}`),p+=g.move(" "+o),p+=g.move(r.safe(t.title,{before:p,after:o,...g.current()})),p+=g.move(o),h()),p+=g.move(")"),c(),p}function wA(){return"!"}n0.peek=SA;function n0(t,i,r,a){const o=t.referenceType,u=r.enter("imageReference");let c=r.enter("label");const h=r.createTracker(a);let g=h.move("![");const p=r.safe(t.alt,{before:g,after:"]",...h.current()});g+=h.move(p+"]["),c();const v=r.stack;r.stack=v.filter(function(w){return w!=="phrasing"}),c=r.enter("reference");const y=r.safe(r.associationId(t),{before:g,after:"]",...h.current()});return c(),r.stack=v,u(),o==="full"||!p||p!==y?g+=h.move(y+"]"):o==="shortcut"?g=g.slice(0,-1):g+=h.move("]"),g}function SA(){return"!"}i0.peek=kA;function i0(t,i,r){let a=t.value||"",o="`",u=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(a);)o+="`";for(/[^\n\r ]/.test(a)&&(/^[\n\r ]/.test(a)&&/[\n\r ]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++u<r.unsafe.length;){const c=r.unsafe[u],h=r.compilePattern(c);if(!c.atBreak)continue;let g;for(;g=h.exec(a);){let p=g.index;a.charCodeAt(p)===10&&a.charCodeAt(p-1)===13&&p--,a=a.slice(0,p)+" "+a.slice(g.index+1)}}return o+a+o}function kA(){return"`"}function l0(t,i){const r=Vu(t);return!!(!i.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(r===t.url||"mailto:"+r===t.url)&&/^[a-z][+\-.a-z]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}r0.peek=EA;function r0(t,i,r,a){const o=Bh(r),u=o==='"'?"Quote":"Apostrophe",c=r.createTracker(a);if(l0(t,r)){const S=r.stack;r.stack=S.filter(function(E){return E!=="phrasing"});const T=r.enter("autolink");let C=c.move("<");return C+=c.move(r.containerPhrasing(t,{before:C,after:">",...c.current()})),C+=c.move(">"),T(),r.stack=S,C}const h=r.enter("link");let g=r.enter("label"),p=c.move("[");const v=r.containerPhrasing(t,{before:p,after:"](",...c.current()});p+=c.move(v),g(),p+=c.move("](");const y=/[\0- \u007F]/.test(t.url),w=a.before.charAt(a.before.length-1);let x=t.title||void 0;if(!x&&!y&&(w===`
46
- `||w==="\r")){let S=0;for(;S<v.length&&v.charCodeAt(S)!==93;)S+=v.charCodeAt(S)===92?2:1;v.charCodeAt(S+1)===58&&(x="")}return!t.url&&typeof x=="string"||y?(g=r.enter("destinationLiteral"),p+=c.move("<"),p+=c.move(r.safe(t.url,{before:p,after:">",...c.current()})),p+=c.move(">")):(g=r.enter("destinationRaw"),p+=c.move(r.safe(t.url,{before:p,after:typeof x=="string"?" ":")",...c.current()}))),g(),typeof x=="string"&&(g=r.enter(`title${u}`),p+=c.move(" "+o),p+=c.move(r.safe(x,{before:p,after:o,...c.current()})),p+=c.move(o),g()),p+=c.move(")"),h(),p}function EA(t,i,r){return l0(t,r)?"<":"["}a0.peek=TA;function a0(t,i,r,a){const o=t.referenceType,u=r.enter("linkReference");let c=r.enter("label");const h=r.createTracker(a);let g=h.move("[");const p=r.containerPhrasing(t,{before:g,after:"]",...h.current()});g+=h.move(p+"]["),c();const v=r.stack;r.stack=v.filter(function(w){return w!=="phrasing"}),c=r.enter("reference");const y=r.safe(r.associationId(t),{before:g,after:"]",...h.current()});return c(),r.stack=v,u(),o==="full"||!p||p!==y?g+=h.move(y+"]"):o==="shortcut"?g=g.slice(0,-1):g+=h.move("]"),g}function TA(){return"["}function Ih(t){const i=t.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function jA(t){const i=Ih(t),r=t.options.bulletOther;if(!r)return i==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+r+"`) to be different");return r}function CA(t){const i=t.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function s0(t){const i=t.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function NA(t,i,r,a){const o=r.enter("list"),u=r.bulletCurrent;let c=t.ordered?CA(r):Ih(r);const h=t.ordered?c==="."?")":".":jA(r);let g=i&&r.bulletLastUsed?c===r.bulletLastUsed:!1;if(!t.ordered){const v=t.children?t.children[0]:void 0;if((c==="*"||c==="-")&&v&&(!v.children||!v.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&&(g=!0),s0(r)===c&&v){let y=-1;for(;++y<t.children.length;){const w=t.children[y];if(w&&w.type==="listItem"&&w.children&&w.children[0]&&w.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(c=h),r.bulletCurrent=c;const p=r.containerFlow(t,a);return r.bulletLastUsed=c,r.bulletCurrent=u,o(),p}function AA(t){const i=t.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function OA(t,i,r,a){const o=AA(r);let u=r.bulletCurrent||Ih(r);i&&i.type==="list"&&i.ordered&&(u=(typeof i.start=="number"&&i.start>-1?i.start:1)+(r.options.incrementListMarker===!1?0:i.children.indexOf(t))+u);let c=u.length+1;(o==="tab"||o==="mixed"&&(i&&i.type==="list"&&i.spread||t.spread))&&(c=Math.ceil(c/4)*4);const h=r.createTracker(a);h.move(u+" ".repeat(c-u.length)),h.shift(c);const g=r.enter("listItem"),p=r.indentLines(r.containerFlow(t,h.current()),v);return g(),p;function v(y,w,x){return w?(x?"":" ".repeat(c))+y:(x?u:u+" ".repeat(c-u.length))+y}}function RA(t,i,r,a){const o=r.enter("paragraph"),u=r.enter("phrasing"),c=r.containerPhrasing(t,a);return u(),o(),c}function _A(t,i,r,a){if(!t.children.some(function(h){return eA(h)}))return r.containerFlow(t,a);const u=r.enter("phrasing"),c=r.containerPhrasing(t,a);return u(),c}function zA(t){const i=t.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}Vh.attention=o0;Vh.peek=MA;function Vh(t,i,r,a){const o=r.enter("phrasing"),u=Uh(t,o0,r,r.createTracker(a)),c=u?Ku([u],a.before,a.after):"";return o(),c}function o0(t,i){return{construct:"strong",markers:zA(i)==="*"?["*","_"]:["_","*"],sizes:[2]}}function MA(t,i,r){return r.options.strong||"*"}function qA(t,i,r,a){const o=i?i.children:[],u=r.indexStack[r.indexStack.length-1];return r.safe(t.value,{...a,afterNode:o[u+1],beforeNode:o[u-1]})}function DA(t){const i=t.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function LA(t,i,r){const a=(s0(r)+(r.options.ruleSpaces?" ":"")).repeat(DA(r));return r.options.ruleSpaces?a.slice(0,-1):a}const dh={blockquote:tA,break:Gv,code:sA,definition:uA,emphasis:Hh,hardBreak:Gv,heading:bA,html:e0,image:t0,imageReference:n0,inlineCode:i0,link:r0,linkReference:a0,list:NA,listItem:OA,paragraph:RA,root:_A,strong:Vh,text:qA,thematicBreak:LA};function BA(){return{enter:{table:UA,tableData:Zv,tableHeader:Zv,tableRow:IA},exit:{codeText:VA,table:HA,tableData:Yd,tableHeader:Yd,tableRow:Yd}}}function UA(t){const i=t._align;this.enter({type:"table",align:i.map(function(r){return r==="none"?null:r}),children:[],position:void 0},t),this.data.inTable=!0}function HA(t){this.exit(t),this.data.inTable=void 0}function IA(t){this.enter({type:"tableRow",children:[],position:void 0},t)}function Yd(t){this.exit(t)}function Zv(t){this.enter({type:"tableCell",children:[],position:void 0},t)}function VA(t){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,YA));const r=this.stack[this.stack.length-1];r.type,r.value=i,this.exit(t)}function YA(t,i){return i==="|"?i:t}function FA(t){const i=t||{},{tableCellPadding:r,tablePipeAlign:a,stringLength:o}=i,u=r?" ":"|";return{handlers:{inlineCode:w,table:c,tableCell:g,tableRow:h},join:[GA],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 c(x,S,T,C){const E=v(x,T,C),q=E[0];if(q){let B=x.align?x.align.length:0,ee=-1;if(!B)for(;++ee<E.length;)E[ee].length>B&&(B=E[ee].length);for(;q.length<B;)q.push("")}return p(E,x.align)}function h(x,S,T,C){const E=y(x,T,C),q=p([E]);return q.slice(0,q.indexOf(`
48
- `))}function g(x,S,T,C){const E=T.enter("tableCell"),q=T.enter("phrasing"),B=T.containerPhrasing(x,{...C,before:u,after:u});return q(),E(),B}function p(x,S){return PN(x,{align:S,alignDelimiters:a,fillRows:!1,padding:r,stringLength:o})}function v(x,S,T){const{children:C}=x;let E=-1;const q=[],B=S.enter("table");for(;++E<C.length;)q[E]=y(C[E],S,T);return B(),q}function y(x,S,T){const{children:C}=x;let E=-1;const q=[],B=S.enter("tableRow");for(;++E<C.length;)q[E]=g(C[E],x,S,T);return B(),q}function w(x,S,T){const C=dh.inlineCode(x,S,T);if(!T.stack.includes("tableCell"))return C;const E=[];let q=0,B=C.indexOf("|");for(;B!==-1;){let ee=B;for(;ee>q&&C.charCodeAt(ee-1)===92;)ee--;E.push(C.slice(q,B)),(B-ee)%2===0&&E.push("\\"),q=B,B=C.indexOf("|",B+1)}return E.push(C.slice(q)),E.join("")}}function GA(t,i,r,a){if(t.type==="table"&&r.type==="listItem"&&r.spread===!1&&(i.type==="definition"||i.type==="heading"&&QA(i,a)||i.type==="paragraph"||i.type==="table"))return 1}function QA(t,i){let r=!1;return Xu(t,function(a){if(a.type==="break"||"value"in a&&/\r?\n|\r/.test(a.value))return r=!0,Ts}),!!((!t.depth||t.depth<3)&&Vu(t)&&(i.options.setext||r))}function XA(){return{exit:{taskListCheckValueChecked:Kv,taskListCheckValueUnchecked:Kv,paragraph:KA}}}function ZA(){return{handlers:{paragraph:$A},join:[JA]}}function Kv(t){const i=this.stack[this.stack.length-2];i.type,i.checked=t.type==="taskListCheckValueChecked"}function KA(t){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const a=r.children[0];if(a&&a.type==="text"){const o=i.children;let u=-1,c;for(;++u<o.length;){const h=o[u];if(h.type==="paragraph"){c=h;break}}c===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(t)}function $A(t,i,r,a){if(!i||i.type!=="listItem"||u0(i)!==t)return dh.paragraph(t,i,r,a);const o="["+(i.checked?"x":" ")+"] ",u=r.createTracker(a);u.move(o);const c=dh.paragraph(t.children.length>0?t:{type:"paragraph",children:[{type:"text",value:" "}]},i,r,{...a,...u.current()});return o+c}function JA(t,i,r){if(!(t.type==="definition"&&r.type==="listItem"))return;const a=u0(r);if(a&&r.children.indexOf(t)<r.children.indexOf(a))return 0}function u0(t){if(typeof t.checked=="boolean")for(const i of t.children){if(i.type==="paragraph")return i;if(i.type!=="definition")return}}function PA(){return[yN(),IN(),GN(),BA(),XA()]}function WA(t){return{extensions:[vN(),VN(t),QN(),FA(t),ZA()]}}const e2={tokenize:a2,partial:!0},c0={tokenize:s2,partial:!0},f0={tokenize:o2,partial:!0},d0={tokenize:u2,partial:!0},t2={tokenize:c2,partial:!0},h0={name:"wwwAutolink",tokenize:l2,previous:p0},m0={name:"protocolAutolink",tokenize:r2,previous:g0},Ki={name:"emailAutolink",tokenize:i2,previous:y0},Oi={};function n2(){return{text:Oi}}let cr=48;for(;cr<123;)Oi[cr]=Ki,cr++,cr===58?cr=65:cr===91&&(cr=97);Oi[43]=Ki;Oi[45]=Ki;Oi[46]=Ki;Oi[95]=Ki;Oi[72]=[Ki,m0];Oi[104]=[Ki,m0];Oi[87]=[Ki,h0];Oi[119]=[Ki,h0];function i2(t,i,r){const a=this;let o,u;return c;function c(y){return!hh(y)||!y0.call(a,a.previous)||Yh(a.events)?r(y):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),h(y))}function h(y){return hh(y)?(t.consume(y),h):y===64?(t.consume(y),g):r(y)}function g(y){return y===46?t.check(t2,v,p)(y):y===45||y===95||vn(y)?(u=!0,t.consume(y),g):v(y)}function p(y){return t.consume(y),o=!0,g}function v(y){return u&&o&&yn(a.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),i(y)):r(y)}}function l2(t,i,r){const a=this;return o;function o(c){return c!==87&&c!==119||!p0.call(a,a.previous)||Yh(a.events)?r(c):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(e2,t.attempt(c0,t.attempt(f0,u),r),r)(c))}function u(c){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),i(c)}}function r2(t,i,r){const a=this;let o="",u=!1;return c;function c(y){return(y===72||y===104)&&g0.call(a,a.previous)&&!Yh(a.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),o+=String.fromCodePoint(y),t.consume(y),h):r(y)}function h(y){if(yn(y)&&o.length<5)return o+=String.fromCodePoint(y),t.consume(y),h;if(y===58){const w=o.toLowerCase();if(w==="http"||w==="https")return t.consume(y),g}return r(y)}function g(y){return y===47?(t.consume(y),u?p:(u=!0,g)):r(y)}function p(y){return y===null||Cu(y)||Ot(y)||gr(y)||Bs(y)?r(y):t.attempt(c0,t.attempt(f0,v),r)(y)}function v(y){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),i(y)}}function a2(t,i,r){let a=0;return o;function o(c){return(c===87||c===119)&&a<3?(a++,t.consume(c),o):c===46&&a===3?(t.consume(c),u):r(c)}function u(c){return c===null?r(c):i(c)}}function s2(t,i,r){let a,o,u;return c;function c(p){return p===46||p===95?t.check(d0,g,h)(p):p===null||Ot(p)||gr(p)||p!==45&&Bs(p)?g(p):(u=!0,t.consume(p),c)}function h(p){return p===95?a=!0:(o=a,a=void 0),t.consume(p),c}function g(p){return o||a||!u?r(p):i(p)}}function o2(t,i){let r=0,a=0;return o;function o(c){return c===40?(r++,t.consume(c),o):c===41&&a<r?u(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?t.check(d0,i,u)(c):c===null||Ot(c)||gr(c)?i(c):(t.consume(c),o)}function u(c){return c===41&&a++,t.consume(c),o}}function u2(t,i,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?(t.consume(h),a):h===38?(t.consume(h),u):h===93?(t.consume(h),o):h===60||h===null||Ot(h)||gr(h)?i(h):r(h)}function o(h){return h===null||h===40||h===91||Ot(h)||gr(h)?i(h):a(h)}function u(h){return yn(h)?c(h):r(h)}function c(h){return h===59?(t.consume(h),a):yn(h)?(t.consume(h),c):r(h)}}function c2(t,i,r){return a;function a(u){return t.consume(u),o}function o(u){return vn(u)?r(u):i(u)}}function p0(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Ot(t)}function g0(t){return!yn(t)}function y0(t){return!(t===47||hh(t))}function hh(t){return t===43||t===45||t===46||t===95||vn(t)}function Yh(t){let i=t.length,r=!1;for(;i--;){const a=t[i][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){r=!0;break}if(a._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const f2={tokenize:b2,partial:!0};function d2(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:g2,continuation:{tokenize:y2},exit:v2}},text:{91:{name:"gfmFootnoteCall",tokenize:p2},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:h2,resolveTo:m2}}}}function h2(t,i,r){const a=this;let o=a.events.length;const u=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;o--;){const g=a.events[o][1];if(g.type==="labelImage"){c=g;break}if(g.type==="gfmFootnoteCall"||g.type==="labelLink"||g.type==="label"||g.type==="image"||g.type==="link")break}return h;function h(g){if(!c||!c._balanced)return r(g);const p=di(a.sliceSerialize({start:c.end,end:a.now()}));return p.codePointAt(0)!==94||!u.includes(p.slice(1))?r(g):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),i(g))}}function m2(t,i){let r=t.length;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},t[t.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},h=[t[r+1],t[r+2],["enter",a,i],t[r+3],t[r+4],["enter",o,i],["exit",o,i],["enter",u,i],["enter",c,i],["exit",c,i],["exit",u,i],t[t.length-2],t[t.length-1],["exit",a,i]];return t.splice(r,t.length-r+1,...h),t}function p2(t,i,r){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u=0,c;return h;function h(y){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(y),t.exit("gfmFootnoteCallLabelMarker"),g}function g(y){return y!==94?r(y):(t.enter("gfmFootnoteCallMarker"),t.consume(y),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",p)}function p(y){if(u>999||y===93&&!c||y===null||y===91||Ot(y))return r(y);if(y===93){t.exit("chunkString");const w=t.exit("gfmFootnoteCallString");return o.includes(di(a.sliceSerialize(w)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(y),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),i):r(y)}return Ot(y)||(c=!0),u++,t.consume(y),y===92?v:p}function v(y){return y===91||y===92||y===93?(t.consume(y),u++,p):p(y)}}function g2(t,i,r){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u,c=0,h;return g;function g(S){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(S),t.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(S){return S===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(S),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",v):r(S)}function v(S){if(c>999||S===93&&!h||S===null||S===91||Ot(S))return r(S);if(S===93){t.exit("chunkString");const T=t.exit("gfmFootnoteDefinitionLabelString");return u=di(a.sliceSerialize(T)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(S),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),w}return Ot(S)||(h=!0),c++,t.consume(S),S===92?y:v}function y(S){return S===91||S===92||S===93?(t.consume(S),c++,v):v(S)}function w(S){return S===58?(t.enter("definitionMarker"),t.consume(S),t.exit("definitionMarker"),o.includes(u)||o.push(u),pt(t,x,"gfmFootnoteDefinitionWhitespace")):r(S)}function x(S){return i(S)}}function y2(t,i,r){return t.check(Us,i,t.attempt(f2,i,r))}function v2(t){t.exit("gfmFootnoteDefinition")}function b2(t,i,r){const a=this;return pt(t,o,"gfmFootnoteDefinitionIndent",5);function o(u){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?i(u):r(u)}}function x2(t){let r=(t||{}).singleTilde;const a={name:"strikethrough",tokenize:u,resolveAll:o};return r==null&&(r=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function o(c,h){let g=-1;for(;++g<c.length;)if(c[g][0]==="enter"&&c[g][1].type==="strikethroughSequenceTemporary"&&c[g][1]._close){let p=g;for(;p--;)if(c[p][0]==="exit"&&c[p][1].type==="strikethroughSequenceTemporary"&&c[p][1]._open&&c[g][1].end.offset-c[g][1].start.offset===c[p][1].end.offset-c[p][1].start.offset){c[g][1].type="strikethroughSequence",c[p][1].type="strikethroughSequence";const v={type:"strikethrough",start:Object.assign({},c[p][1].start),end:Object.assign({},c[g][1].end)},y={type:"strikethroughText",start:Object.assign({},c[p][1].end),end:Object.assign({},c[g][1].start)},w=[["enter",v,h],["enter",c[p][1],h],["exit",c[p][1],h],["enter",y,h]],x=h.parser.constructs.insideSpan.null;x&&fi(w,w.length,0,Yu(x,c.slice(p+1,g),h)),fi(w,w.length,0,[["exit",y,h],["enter",c[g][1],h],["exit",c[g][1],h],["exit",v,h]]),fi(c,p-1,g-p+3,w),g=p+w.length-2;break}}for(g=-1;++g<c.length;)c[g][1].type==="strikethroughSequenceTemporary"&&(c[g][1].type="data");return c}function u(c,h,g){const p=this.previous,v=this.events;let y=0;return w;function w(S){return p===126&&v[v.length-1][1].type!=="characterEscape"?g(S):(c.enter("strikethroughSequenceTemporary"),x(S))}function x(S){const T=Ol(p);if(S===126)return y>1?g(S):(c.consume(S),y++,x);if(y<2&&!r)return g(S);const C=c.exit("strikethroughSequenceTemporary"),E=Ol(S);return C._open=!E||E===2&&!!T,C._close=!T||T===2&&!!E,h(S)}}}class w2{constructor(){this.map=[],this.index=new Map}add(i,r,a){S2(this,i,r,a)}consume(i){if(this.map.sort(function(u,c){return u[0]-c[0]}),this.map.length===0)return;let r=this.map.length;const a=[];for(;r>0;)r-=1,a.push(i.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),i.length=this.map[r][0];a.push(i.slice()),i.length=0;let o=a.pop();for(;o;){for(const u of o)i.push(u);o=a.pop()}this.map.length=0,this.index.clear()}}function S2(t,i,r,a){if(r===0&&a.length===0)return;const o=t.index.get(i);if(o){o[1]+=r,o[2].push(...a);return}const u=[i,r,a];t.map.push(u),t.index.set(i,u)}function k2(t,i){let r=!1;const a=[];for(;i<t.length;){const o=t[i];if(r){if(o[0]==="enter")o[1].type==="tableContent"&&a.push(t[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(t[i-1][1].type==="tableDelimiterMarker"){const u=a.length-1;a[u]=a[u]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(r=!0);i+=1}return a}function E2(){return{flow:{null:{name:"table",tokenize:T2,resolveAll:j2}}}}function T2(t,i,r){const a=this;let o=0,u=0,c;return h;function h(_){let G=a.events.length-1;for(;G>-1;){const{type:xe}=a.events[G][1];if(xe==="lineEnding"||xe==="linePrefix")G--;else break}const te=G>-1?a.events[G][1].type:null,Te=te==="tableHead"||te==="tableRow"?O:g;return Te===O&&a.parser.lazy[a.now().line]?r(_):Te(_)}function g(_){return t.enter("tableHead"),t.enter("tableRow"),p(_)}function p(_){return _===124||(c=!0,u+=1),v(_)}function v(_){return _===null?r(_):qe(_)?u>1?(u=0,a.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),x):r(_):Pe(_)?pt(t,v,"whitespace")(_):(u+=1,c&&(c=!1,o+=1),_===124?(t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),c=!0,v):(t.enter("data"),y(_)))}function y(_){return _===null||_===124||Ot(_)?(t.exit("data"),v(_)):(t.consume(_),_===92?w:y)}function w(_){return _===92||_===124?(t.consume(_),y):y(_)}function x(_){return a.interrupt=!1,a.parser.lazy[a.now().line]?r(_):(t.enter("tableDelimiterRow"),c=!1,Pe(_)?pt(t,S,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):S(_))}function S(_){return _===45||_===58?C(_):_===124?(c=!0,t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),T):X(_)}function T(_){return Pe(_)?pt(t,C,"whitespace")(_):C(_)}function C(_){return _===58?(u+=1,c=!0,t.enter("tableDelimiterMarker"),t.consume(_),t.exit("tableDelimiterMarker"),E):_===45?(u+=1,E(_)):_===null||qe(_)?ee(_):X(_)}function E(_){return _===45?(t.enter("tableDelimiterFiller"),q(_)):X(_)}function q(_){return _===45?(t.consume(_),q):_===58?(c=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(_),t.exit("tableDelimiterMarker"),B):(t.exit("tableDelimiterFiller"),B(_))}function B(_){return Pe(_)?pt(t,ee,"whitespace")(_):ee(_)}function ee(_){return _===124?S(_):_===null||qe(_)?!c||o!==u?X(_):(t.exit("tableDelimiterRow"),t.exit("tableHead"),i(_)):X(_)}function X(_){return r(_)}function O(_){return t.enter("tableRow"),Y(_)}function Y(_){return _===124?(t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),Y):_===null||qe(_)?(t.exit("tableRow"),i(_)):Pe(_)?pt(t,Y,"whitespace")(_):(t.enter("data"),K(_))}function K(_){return _===null||_===124||Ot(_)?(t.exit("data"),Y(_)):(t.consume(_),_===92?se:K)}function se(_){return _===92||_===124?(t.consume(_),K):K(_)}}function j2(t,i){let r=-1,a=!0,o=0,u=[0,0,0,0],c=[0,0,0,0],h=!1,g=0,p,v,y;const w=new w2;for(;++r<t.length;){const x=t[r],S=x[1];x[0]==="enter"?S.type==="tableHead"?(h=!1,g!==0&&($v(w,i,g,p,v),v=void 0,g=0),p={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},w.add(r,0,[["enter",p,i]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(a=!0,y=void 0,u=[0,0,0,0],c=[0,r+1,0,0],h&&(h=!1,v={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},w.add(r,0,[["enter",v,i]])),o=S.type==="tableDelimiterRow"?2:v?3:1):o&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(u[1]!==0&&(c[0]=c[1],y=yu(w,i,u,o,void 0,y),u=[0,0,0,0]),c[2]=r)):S.type==="tableCellDivider"&&(a?a=!1:(u[1]!==0&&(c[0]=c[1],y=yu(w,i,u,o,void 0,y)),u=c,c=[u[1],r,0,0])):S.type==="tableHead"?(h=!0,g=r):S.type==="tableRow"||S.type==="tableDelimiterRow"?(g=r,u[1]!==0?(c[0]=c[1],y=yu(w,i,u,o,r,y)):c[1]!==0&&(y=yu(w,i,c,o,r,y)),o=0):o&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(c[3]=r)}for(g!==0&&$v(w,i,g,p,v),w.consume(i.events),r=-1;++r<i.events.length;){const x=i.events[r];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=k2(i.events,r))}return t}function yu(t,i,r,a,o,u){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",h="tableContent";r[0]!==0&&(u.end=Object.assign({},ua(i.events,r[0])),t.add(r[0],0,[["exit",u,i]]));const g=ua(i.events,r[1]);if(u={type:c,start:Object.assign({},g),end:Object.assign({},g)},t.add(r[1],0,[["enter",u,i]]),r[2]!==0){const p=ua(i.events,r[2]),v=ua(i.events,r[3]),y={type:h,start:Object.assign({},p),end:Object.assign({},v)};if(t.add(r[2],0,[["enter",y,i]]),a!==2){const w=i.events[r[2]],x=i.events[r[3]];if(w[1].end=Object.assign({},x[1].end),w[1].type="chunkText",w[1].contentType="text",r[3]>r[2]+1){const S=r[2]+1,T=r[3]-r[2]-1;t.add(S,T,[])}}t.add(r[3]+1,0,[["exit",y,i]])}return o!==void 0&&(u.end=Object.assign({},ua(i.events,o)),t.add(o,0,[["exit",u,i]]),u=void 0),u}function $v(t,i,r,a,o){const u=[],c=ua(i.events,r);o&&(o.end=Object.assign({},c),u.push(["exit",o,i])),a.end=Object.assign({},c),u.push(["exit",a,i]),t.add(r+1,0,u)}function ua(t,i){const r=t[i],a=r[0]==="enter"?"start":"end";return r[1][a]}const C2={name:"tasklistCheck",tokenize:A2};function N2(){return{text:{91:C2}}}function A2(t,i,r){const a=this;return o;function o(g){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?r(g):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(g),t.exit("taskListCheckMarker"),u)}function u(g){return Ot(g)?(t.enter("taskListCheckValueUnchecked"),t.consume(g),t.exit("taskListCheckValueUnchecked"),c):g===88||g===120?(t.enter("taskListCheckValueChecked"),t.consume(g),t.exit("taskListCheckValueChecked"),c):r(g)}function c(g){return g===93?(t.enter("taskListCheckMarker"),t.consume(g),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),h):r(g)}function h(g){return qe(g)?i(g):Pe(g)?t.check({tokenize:O2},i,r)(g):r(g)}}function O2(t,i,r){return pt(t,a,"whitespace");function a(o){return o===null?r(o):i(o)}}function R2(t){return kx([n2(),d2(),x2(t),E2(),N2()])}const _2={};function z2(t){const i=this,r=t||_2,a=i.data(),o=a.micromarkExtensions||(a.micromarkExtensions=[]),u=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);o.push(R2(r)),u.push(PA()),c.push(WA(r))}function v0(t=128){const i=new Set,r=new Set,a=()=>{for(const o of r)o()};return{has:o=>i.has(o),fail(o){i.has(o)||o.length>4096||(i.add(o),i.size>t&&i.delete(i.values().next().value),a())},retry(o){i.delete(o)&&a()},subscribe(o){return r.add(o),()=>{r.delete(o)}}}}const b0=j.createContext(null);function M2({children:t}){const[i]=j.useState(v0);return m.jsx(b0.Provider,{value:i,children:t})}function q2({src:t,alt:i="",title:r}){const{t:a}=Ke(),o=j.useContext(b0),[u]=j.useState(v0),c=o??u,h=j.useSyncExternalStore(c.subscribe,()=>c.has(t??""),()=>!1),[g,p]=j.useState(null),v=h||g===t,[y,w]=j.useState(!1),[x,S]=j.useState(!1),T=j.useRef(null),C=j.useRef(null),E=j.useRef(null),q=j.useRef(null),B=i||a("image.untitled");j.useEffect(()=>{if(!y||v)return;const O=document.activeElement instanceof HTMLElement?document.activeElement:null,Y=document.body.style.overflow;document.body.style.overflow="hidden",C.current?.focus();const K=_=>{if(_.key==="Escape"&&(_.preventDefault(),_.stopPropagation(),w(!1)),_.key!=="Tab")return;const G=[...T.current?.querySelectorAll('button, [href], [tabindex="0"]')??[]],te=G[0],Te=G.at(-1);_.shiftKey&&(document.activeElement===te||!T.current?.contains(document.activeElement))?(_.preventDefault(),Te?.focus()):!_.shiftKey&&(document.activeElement===Te||!T.current?.contains(document.activeElement))&&(_.preventDefault(),te?.focus())},se=_=>{T.current?.contains(_.target)||C.current?.focus()};return document.addEventListener("keydown",K,!0),document.addEventListener("focusin",se),()=>{document.removeEventListener("keydown",K,!0),document.removeEventListener("focusin",se),document.body.style.overflow=Y,O?.isConnected?O.focus():E.current?.focus()}},[y,v]),j.useEffect(()=>{S(!1),w(!1)},[t]);function ee(){S(O=>!O),q.current&&(q.current.scrollLeft=0,q.current.scrollTop=0)}function X(){t&&(c.fail(t),p(t)),w(!1)}if(!t||v){const O=t?.split(/[?#]/)[0]?.split("/").at(-1);return m.jsxs("span",{className:"image-unavailable",role:"status",children:[m.jsx("strong",{children:i||O||a("image.untitled")}),m.jsx("span",{children:a("image.unavailable")}),t&&m.jsx("button",{ref:E,type:"button",onClick:()=>{w(!1),p(null),c.retry(t)},children:a("image.retry")})]})}return m.jsxs(m.Fragment,{children:[m.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":a("image.open",{name:B}),"aria-haspopup":"dialog","aria-expanded":y,title:a("image.open",{name:B}),onClick:()=>{S(!1),w(!0)},children:[m.jsx("img",{className:"image-preview-thumbnail",src:t,alt:i,title:r,loading:"lazy",onError:X}),m.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a("image.enlarge")})]}),y&&Ds.createPortal(m.jsx("div",{className:"image-lightbox",onClick:O=>{O.target===O.currentTarget&&w(!1)},children:m.jsxs("div",{ref:T,className:"image-lightbox-dialog",role:"dialog","aria-modal":"true","aria-label":B,children:[m.jsxs("header",{className:"image-lightbox-toolbar",children:[m.jsx("span",{className:"image-lightbox-name",title:B,children:B}),m.jsx("button",{type:"button",onClick:ee,"aria-pressed":x,children:a(x?"image.fit":"image.original")}),m.jsx("button",{ref:C,type:"button",onClick:()=>w(!1),"aria-label":a("image.close"),children:a("image.close")})]}),m.jsx("div",{ref:q,className:x?"image-lightbox-stage original":"image-lightbox-stage",tabIndex:0,role:"region","aria-label":a(x?"image.scroll":"image.fit"),children:m.jsx("img",{src:t,alt:i,title:r,draggable:!1,onError:X})})]})}),document.body)]})}function D2({text:t,language:i}){const[r,a]=j.useState(!1);return m.jsxs("div",{className:"code-block",children:[m.jsxs("div",{className:"code-banner",children:[m.jsx("span",{className:"code-lang",children:i||"Code block"}),m.jsx("button",{type:"button",className:"code-copy","aria-label":r?"Copied":"Copy",onClick:()=>{navigator.clipboard.writeText(t).then(()=>{a(!0),window.setTimeout(()=>a(!1),1e3)})},children:r?"Copied":"Copy"})]}),m.jsx("pre",{children:m.jsx("code",{children:t})})]})}function L2({children:t}){const i=j.Children.toArray(t)[0];if(j.isValidElement(i)){const r=i,a=String(r.props.children??"").replace(/\n$/,""),o=/language-([\w-]+)/.exec(r.props.className??"");return m.jsx(D2,{text:a,language:o?.[1]})}return m.jsx("pre",{children:t})}function B2(t){if(!t||/^[a-z][a-z0-9+.-]*:/i.test(t)||t.startsWith("#")||t.startsWith("//")||t.startsWith("?"))return null;const i=t.indexOf("#"),r=i<0?t:t.slice(0,i);if(r.includes("?"))return null;let a;try{a=decodeURIComponent(r)}catch{return null}const o=/:(\d+)$/.exec(a);if(o&&(a=a.slice(0,-o[0].length)),!a||/[\u0000-\u001f\\]/.test(a)||a.split("/").includes(".."))return null;const u=o?Number(o[1]):void 0;return u!=null&&Number.isSafeInteger(u)&&u>0?{path:a,line:u}:{path:a}}const mh=j.createContext({streaming:!1}),U2={pre:L2,img({src:t,alt:i,title:r}){const{resolveImage:a}=j.useContext(mh),o=typeof t=="string"?a?.(t):void 0,u=typeof t=="string"&&t!==""&&!/^(?:[a-z][a-z0-9+.-]*:|\/|#|\?)/i.test(t);return m.jsx(q2,{src:o??(u?`/dsh-bot/${t.replace(/^\.\//,"")}`:t||void 0),alt:i,title:r})},code({className:t,children:i}){return m.jsx("code",{className:t,children:i})},table({children:t}){return m.jsx("div",{className:"table-scroll",children:m.jsx("table",{children:t})})},a({href:t,children:i,node:r}){const{streaming:a,onOpenFile:o}=j.useContext(mh),{t:u}=Ke();if(r?.children.some(h=>h.type==="element"&&h.tagName==="img"))return m.jsxs("span",{className:"image-preview-linked",children:[i,m.jsx("a",{href:t,target:"_blank",rel:"noreferrer",children:u("image.openLink")})]});const c=a?null:B2(t);return c&&o?m.jsx("button",{type:"button",className:"file-mention",title:c.path,onClick:()=>o(c.path,c.line),children:i}):m.jsx("a",{href:t,target:"_blank",rel:"noreferrer",children:i})}};function H2(t,i){if(!i)return t;const r=t.match(/```/g);return r&&r.length%2===1?`${t}
49
- \`\`\``:t}function Is({text:t,streaming:i=!1,onOpenFile:r,resolveImage:a}){const o=j.useMemo(()=>({streaming:i,onOpenFile:r,resolveImage:a}),[i,r,a]);return m.jsx(mh.Provider,{value:o,children:m.jsx("div",{className:i?"markdown streaming":"markdown",children:m.jsx(sN,{remarkPlugins:[z2],components:U2,children:H2(t,i)})})})}const I2=j.lazy(()=>Gk(()=>import("./SourceEditor-uu0G7jsM.js").then(t=>t.S),__vite__mapDeps([0,1]))),V2=50*1024*1024,x0="dsh-bot.files-drawer-width";function Y2(){try{const t=localStorage.getItem(x0);return t==null||t===""?Ns:ha(Number(t))}catch{return Ns}}function F2(t){try{localStorage.setItem(x0,String(t))}catch{}}function G2({open:t,sessionId:i,focus:r,onClose:a}){const{t:o}=Ke(),[u,c]=j.useState(null),[h,g]=j.useState("workspace"),[p,v]=j.useState(""),[y,w]=j.useState([]),[x,S]=j.useState("loading"),[T,C]=j.useState(""),[E,q]=j.useState(null),[B,ee]=j.useState(0),[X,O]=j.useState(Y2),Y=j.useRef(X),[K,se]=j.useState(!1),[_,G]=j.useState(()=>window.innerWidth),[te,Te]=j.useState(()=>window.matchMedia("(max-width: 800px)").matches),[xe,fe]=j.useState(t),[re,ue]=j.useState(t?"in":"out"),[ge,me]=j.useState(),[A,Ee]=j.useState(""),[Be,M]=j.useState(!1),[z,ne]=j.useState(null),[J,ae]=j.useState(!1),[Oe,be]=j.useState(!1),[we,P]=j.useState(null),[ye,We]=j.useState(""),et=j.useRef(0),Ne=j.useRef(null),tt=j.useRef(""),$e=j.useRef(!0),Ie=j.useRef(0),Me=j.useRef(r),Qe=j.useRef(xe),vt=j.useRef(re);Me.current=r,Qe.current=xe,vt.current=re,j.useEffect(()=>()=>{$e.current=!1,tt.current&&URL.revokeObjectURL(tt.current)},[]),j.useEffect(()=>{if(t){fe(!0),ue("in");return}if(Qe.current){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){fe(!1);return}ue("out")}},[t]),j.useEffect(()=>{const $=window.matchMedia("(max-width: 800px)"),oe=()=>Te($.matches);return $.addEventListener("change",oe),()=>$.removeEventListener("change",oe)},[]),j.useEffect(()=>{const $=()=>G(window.innerWidth);return window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)},[]);const he=ha(X);ox({present:xe,narrow:te,motion:re,width:he,resizing:K,viewport:_}),j.useEffect(()=>{const $=oe=>{if(oe.key==="Escape"){if(z&&we==null){ne(null);return}a()}};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[a,z,we]),j.useEffect(()=>{if(!t)return;const $=new AbortController;return c(null),Me.current||(v(""),q(null),C("")),Fe(`/files/roots?sessionId=${encodeURIComponent(i)}`,{signal:$.signal}).then(oe=>{if($.signal.aborted)return;const mt=typeof oe.body.workspace=="string"?oe.body.workspace:null,_t=typeof oe.body.home=="string"?oe.body.home:null,ft=typeof oe.body.workspaceReason=="string"?oe.body.workspaceReason:"";c({workspace:mt,workspaceReason:ft,home:_t}),!Me.current&&(mt?(g("workspace"),v(mt)):_t?(g("home"),v(_t)):(S("error"),C(o(ft==="overlap"?"files.overlap":"files.missing"))))}).catch(()=>{$.signal.aborted||(S("error"),C(o("files.failed")))}),()=>$.abort()},[t,i,o]),j.useEffect(()=>{if(!t||!r||!u)return;const $=X2(u.workspace,r.path);if(!$){S("error"),C(u.workspaceReason==="overlap"?o("files.overlap"):o("files.missing"));return}const oe=++Ie.current,mt=new AbortController,_t=$.split("/").filter(Boolean).at(-1)??$,ft=Z2($,u.workspace,u.home);return me(r.line),C(""),ft&&g(ft),Fe(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent($)}`,{signal:mt.signal}).then(Yt=>{if(!(oe!==Ie.current||!$e.current)){if(Yt.status===200&&Array.isArray(Yt.body.items)){me(void 0),Ee(""),q(null),S("loading"),(Yt.body.root==="workspace"||Yt.body.root==="home")&&g(Yt.body.root),v(typeof Yt.body.path=="string"?Yt.body.path:$);return}return Ee($),v(K2($)),Z($,_t,0,oe)}}).catch(()=>{oe!==Ie.current||!$e.current||mt.signal.aborted||q({kind:"error",path:$,name:_t})}),()=>mt.abort()},[t,r,u,i,o]),j.useEffect(()=>{if(!p)return;const $=new AbortController;return S("loading"),C(""),Fe(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(p)}`,{signal:$.signal}).then(oe=>{if($.signal.aborted)return;if(oe.status!==200||!Array.isArray(oe.body.items)){w([]),S("error"),C(vu(oe.body.error,o));return}const mt=typeof oe.body.path=="string"?oe.body.path:p;w(oe.body.items.filter(P2)),S("ready"),(oe.body.root==="workspace"||oe.body.root==="home")&&g(oe.body.root),mt!==p&&v(mt)}).catch(()=>{$.signal.aborted||(S("error"),C(o("files.failed")))}),()=>$.abort()},[p,i,B,o]);function Le($){tt.current&&URL.revokeObjectURL(tt.current),tt.current=$}function bt($){const oe=$==="workspace"?u?.workspace:u?.home;oe&&(g($),q(null),ne(null),oe!==p&&(S("loading"),v(oe)))}async function bn($){const oe=ph(p,$.name);if($.kind==="file"){await Z(oe,$.name,$.size);return}if($.kind==="link"){const mt=await Fe(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(oe)}`);if(!$e.current)return;if(mt.status!==200){if(mt.body.error==="not_directory"){await Z(oe,$.name,$.size);return}C(vu(mt.body.error,o));return}q(null),S("loading"),v(typeof mt.body.path=="string"?mt.body.path:oe);return}q(null),S("loading"),v(oe)}async function Lt($){const oe=await Fe(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent($)}`);if($e.current){if(oe.status===200&&Array.isArray(oe.body.items)){q(null),S("loading"),(oe.body.root==="workspace"||oe.body.root==="home")&&g(oe.body.root),v(typeof oe.body.path=="string"?oe.body.path:$);return}if(oe.body.error==="not_directory"){const mt=$.split("/").filter(Boolean).at(-1)??$;await Z($,mt,0);return}C(vu(oe.body.error,o))}}async function Z($,oe,mt,_t=++Ie.current){const ft=()=>$e.current&&_t===Ie.current;q({kind:"loading",path:$,name:oe});const Yt=tO(oe);if(Yt){try{const _l=await fetch(_u(i,$));if(!ft())return;if(!_l.ok){q({kind:"error",path:$,name:oe});return}const zl=URL.createObjectURL(new Blob([await _l.arrayBuffer()],{type:Yt}));if(!ft()){URL.revokeObjectURL(zl);return}Le(zl),q({kind:"image",path:$,name:oe,url:zl})}catch{ft()&&q({kind:"error",path:$,name:oe})}return}const Ut=await Fe(`/files/text?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent($)}`);if(ft()){if(Ut.status===415||Ut.body.error==="binary"){q({kind:"binary",path:$,name:oe,size:mt});return}if(Ut.status!==200||typeof Ut.body.text!="string"){q({kind:"error",path:$,name:oe});return}q({kind:"text",path:$,name:oe,text:Ut.body.text,eof:Ut.body.eof!==!1})}}function ce($){if(we==null){if($.size>V2){C(o("files.tooLarge")),ne(null);return}C(""),ae(!1),be(!1),P(null),ne($)}}async function Se(){if(!(!z||!p||we!=null)){P(0),C("");try{const $=await iO(i,p,z,J,P);if(!$e.current)return;if($.status===409){be(!0),C(o("files.exists")),P(null);return}if($.status!==201||typeof $.body.path!="string"){C(vu($.body.error,o)),P(null);return}ne(null),P(null),ee(oe=>oe+1)}catch{if(!$e.current)return;C(o("files.failed")),P(null)}}}const Ce=j.useRef(null),Tt=j.useRef(0),[je,Ge]=j.useState(null),[Rt,Gt]=j.useState(!1);j.useEffect(()=>{let $=null;if(E?E.kind!=="loading"&&($={kind:"file",key:`file:${E.path}`,path:p,root:h,preview:E}):p&&x!=="loading"&&($=x==="error"?{kind:"list",key:`dir:${p}`,path:p,root:h,items:[],error:T||o("files.failed")}:{kind:"list",key:`dir:${p}`,path:p,root:h,items:y,error:""}),!$){!p&&!E&&(Ce.current=null,Ge(null)),Gt(!1);return}const oe=Ce.current;if(oe?.key===$.key){if(oe.root===$.root&&oe.path===$.path&&(oe.kind==="file"&&$.kind==="file"?oe.preview===$.preview:oe.kind==="list"&&$.kind==="list"&&oe.items===$.items&&oe.error===$.error))return;Ce.current=$,Ge($);return}if(!oe||window.matchMedia("(prefers-reduced-motion: reduce)").matches){Ce.current=$,Ge($),Gt(!1);return}const mt=++Tt.current;Gt(!0);const _t=window.setTimeout(()=>{Tt.current===mt&&(Ce.current=$,Ge($),Gt(!1))},200);return()=>window.clearTimeout(_t)},[E,y,x,p,h,T,o]),j.useEffect(()=>{const $=je?.kind==="file"&&je.preview.kind==="image",oe=E?.kind==="image"||E?.kind==="loading";$||oe||!tt.current||(URL.revokeObjectURL(tt.current),tt.current="")},[je,E]);const on=je?.root??h,Sn=je?.path||p,Ri=on==="workspace"?u?.workspace:u?.home,qt=Ri?J2(Ri,Sn):[],Xe=je?.kind==="file"?{name:je.preview.name,path:je.preview.path}:null,Wt=je?.kind==="list"?je.error:"";function un($){navigator.clipboard.writeText($).then(()=>{We($),window.setTimeout(()=>We(oe=>oe===$?"":oe),1e3)})}const Fn=z!=null&&(Oe||y.some($=>$.name===z.name)),_i=we!=null;return xe?Ds.createPortal(m.jsxs("div",{className:te?`files-drawer narrow files-drawer-${re}`:`files-drawer files-drawer-${re}${K?" resizing":""}`,style:te?void 0:{width:he},role:"dialog","aria-label":o("files.title"),onAnimationEnd:$=>{$.target!==$.currentTarget||$.animationName!=="files-drawer-out"||vt.current==="out"&&fe(!1)},onDragEnter:$=>{$.preventDefault(),et.current+=1,M(!0)},onDragOver:$=>$.preventDefault(),onDragLeave:()=>{et.current-=1,et.current<=0&&(et.current=0,M(!1))},onDrop:$=>{$.preventDefault(),et.current=0,M(!1);const oe=$.dataTransfer.files[0];oe&&ce(oe)},children:[te?null:m.jsx("div",{className:"files-resize",onPointerDown:$=>{$.preventDefault(),$.currentTarget.setPointerCapture($.pointerId),se(!0);const oe=_t=>{const ft=ha(window.innerWidth-_t.clientX);Y.current=ft,O(ft)},mt=()=>{se(!1),F2(Y.current),window.removeEventListener("pointermove",oe),window.removeEventListener("pointerup",mt)};window.addEventListener("pointermove",oe),window.addEventListener("pointerup",mt)}}),m.jsxs("header",{className:"files-head",children:[m.jsx("button",{type:"button",className:"files-icon-btn","aria-label":o("file.close"),onClick:a,children:m.jsx(lO,{})}),m.jsxs("div",{className:"files-roots",role:"tablist",children:[m.jsx("button",{type:"button",role:"tab",className:"files-icon-btn","aria-selected":on==="home","aria-label":o("files.home"),disabled:!u?.home,title:u?.home||void 0,onClick:()=>bt("home"),children:m.jsx(sO,{})}),m.jsx("button",{type:"button",role:"tab",className:"files-icon-btn","aria-selected":on==="workspace","aria-label":o("files.workspace"),disabled:!u?.workspace,title:u?.workspace??(u?.workspaceReason==="overlap"?o("files.overlap"):void 0),onClick:()=>bt("workspace"),children:m.jsx(aO,{})})]}),m.jsxs("nav",{className:"files-crumbs","aria-label":o("files.title"),children:[qt.length>0||Xe?m.jsx("span",{"aria-hidden":"true",children:"/"}):null,qt.map(($,oe)=>m.jsxs("span",{children:[oe>0?m.jsx("span",{"aria-hidden":"true",children:"/"}):null,m.jsx("button",{type:"button",title:$.path,onClick:()=>{$.path===p&&!E||(q(null),$.path!==p&&(S("loading"),v($.path)))},children:$.name})]},$.path)),Xe?m.jsxs("span",{children:[qt.length>0?m.jsx("span",{"aria-hidden":"true",children:"/"}):null,m.jsx("span",{className:"files-crumb-current",title:Xe.path,children:Xe.name})]}):null,Sn?m.jsx("button",{type:"button",className:"files-icon-btn files-crumb-copy","aria-label":o("files.pathHint"),title:ye===(Xe?.path||Sn)?o("files.copied"):o("files.pathHint"),onClick:()=>un(Xe?.path||Sn),children:ye===(Xe?.path||Sn)?m.jsx(k0,{}):m.jsx(S0,{})}):null]}),m.jsx("button",{type:"button",className:"files-icon-btn files-upload","aria-label":o("files.upload"),title:o("files.upload"),disabled:!p||_i,onClick:()=>Ne.current?.click(),children:m.jsx(cO,{})}),m.jsx("input",{ref:Ne,type:"file",hidden:!0,onChange:$=>{const oe=$.target.files?.[0];$.target.value="",oe&&ce(oe)}})]}),T&&T!==Wt?m.jsx("p",{className:"files-notice",children:T}):null,Be?m.jsx("div",{className:"files-drop",children:o("files.drop")}):null,m.jsx("div",{className:"files-body",children:je?m.jsx("div",{className:Rt?"files-stage out":"files-stage in",children:je.kind==="file"?m.jsx(Q2,{preview:je.preview,sessionId:i,line:je.preview.path===A?ge:void 0,onOpenPath:$=>{Lt($)}}):je.error?m.jsx("p",{className:"files-status",children:je.error}):je.items.length===0?m.jsxs("div",{className:"files-empty",children:[m.jsx("span",{className:"files-empty-mark","aria-hidden":"true",children:m.jsx(rO,{})}),m.jsx("p",{children:o("files.empty")})]}):m.jsxs("div",{className:"files-table",role:"table",children:[m.jsxs("div",{className:"files-row files-columns",role:"row",children:[m.jsx("span",{role:"columnheader",children:o("files.name")}),m.jsx("span",{className:"files-col-type",role:"columnheader",children:o("files.type")}),m.jsx("span",{className:"files-col-size",role:"columnheader",children:o("files.size")}),m.jsx("span",{className:"files-col-time",role:"columnheader",children:o("files.modified")}),m.jsx("span",{})]}),je.items.map($=>m.jsxs("div",{className:"files-row",role:"row",children:[m.jsxs("button",{type:"button",className:"files-name",onClick:()=>{bn($)},children:[m.jsx("span",{className:$.kind==="dir"?"files-mark dir":"files-mark",children:eO($.kind)}),m.jsx("span",{children:$.name})]}),m.jsx("span",{className:"files-col-type",children:W2($,o)}),m.jsx("span",{className:"files-col-size",children:$.kind==="file"?gh($.size):"—"}),m.jsx("span",{className:"files-col-time",children:nO($.mtime)}),m.jsx("span",{className:"files-row-actions",children:$.kind==="file"?m.jsxs("a",{className:"files-action",href:_u(i,ph(p,$.name)),children:[m.jsx(E0,{}),o("files.download")]}):null})]},$.name))]})}):x==="loading"?m.jsx("p",{className:"files-status",children:o("files.loading")}):null}),z?m.jsxs("div",{className:"files-confirm",children:[m.jsx("p",{children:o("files.confirm")}),m.jsxs("p",{className:"files-confirm-name",children:[m.jsx("strong",{children:z.name}),m.jsx("span",{children:gh(z.size)})]}),m.jsx("p",{className:"files-confirm-dest",children:p}),_i?m.jsxs("div",{className:"files-progress",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round((we??0)*100),children:[m.jsx("div",{style:{width:`${Math.round((we??0)*100)}%`}}),m.jsx("span",{children:o("files.uploading")})]}):null,Fn?m.jsxs("label",{className:"files-check",children:[m.jsx("input",{type:"checkbox",checked:J,disabled:_i,onChange:$=>ae($.target.checked)}),o("files.overwrite")]}):null,m.jsxs("div",{className:"files-confirm-actions",children:[m.jsx("button",{type:"button",disabled:_i,onClick:()=>ne(null),children:o("files.cancel")}),m.jsx("button",{type:"button",className:"primary",disabled:_i||Fn&&!J,onClick:()=>{Se()},children:o("files.upload")})]})]}):null]}),document.body):null}function Q2({preview:t,sessionId:i,line:r,onOpenPath:a}){const{t:o}=Ke(),u=t.kind==="text"&&Qk(t.name),[c,h]=j.useState(u&&r==null?"preview":"source"),[g,p]=j.useState(!1);if(j.useEffect(()=>{h(u&&r==null?"preview":"source"),p(!1)},[t.path,u,r]),t.kind==="loading")return m.jsx("p",{className:"files-status",children:o("file.loading")});if(t.kind==="error")return m.jsx("p",{className:"files-status",children:o("file.error")});const v=t.kind==="text"?t.text:"",y=t.kind==="text"?t.eof:!0,w=t.kind==="text"&&(!u||c==="source");return m.jsxs("div",{className:"files-preview",children:[m.jsx("div",{className:"files-preview-bar",children:m.jsxs("span",{children:[u?m.jsxs("span",{role:"group","aria-label":o("files.previewMode"),children:[m.jsxs("button",{type:"button",className:"files-action","aria-pressed":c==="preview",onClick:()=>h("preview"),children:[m.jsx(oO,{}),o("files.previewMode")]}),m.jsxs("button",{type:"button",className:"files-action","aria-pressed":c==="source",onClick:()=>h("source"),children:[m.jsx(uO,{}),o("files.sourceMode")]})]}):null,t.kind==="text"?m.jsxs("button",{type:"button",className:"files-action",onClick:()=>{navigator.clipboard.writeText(v).then(()=>{p(!0),window.setTimeout(()=>p(!1),1e3)})},children:[g?m.jsx(k0,{}):m.jsx(S0,{}),o(g?"files.copied":"files.copy")]}):null,m.jsxs("a",{className:"files-action",href:_u(i,t.path),children:[m.jsx(E0,{}),o("files.download")]})]})}),t.kind==="image"?m.jsx("div",{className:"files-image",children:m.jsx("img",{src:t.url,alt:t.name})}):t.kind==="binary"?m.jsxs("p",{className:"files-status",children:[o("files.binary")," ",gh(t.size)]}):w?m.jsxs(m.Fragment,{children:[m.jsx(j.Suspense,{fallback:m.jsx("p",{className:"files-status",children:o("file.loading")}),children:m.jsx(I2,{text:v,name:t.name,line:r})}),y?null:m.jsx("p",{className:"file-modal-note",children:o("files.truncated")})]}):m.jsxs("div",{className:"files-markdown",children:[m.jsx(Is,{text:v,onOpenFile:x=>{const S=x.startsWith("/")?x:w0(t.path,x);S&&a(S)},resolveImage:x=>$2(i,t.path,x)}),y?null:m.jsx("p",{className:"file-modal-note",children:o("files.truncated")})]})]})}function X2(t,i){const r=i.replace(/^\.\//,"");return r.startsWith("/")?r:t?ph(t,r):null}function Z2(t,i,r){return i&&(t===i||t.startsWith(`${i}/`))?"workspace":r&&(t===r||t.startsWith(`${r}/`))?"home":null}function K2(t){const i=t.lastIndexOf("/");return i<=0?"/":t.slice(0,i)}function $2(t,i,r){if(/^[a-z][a-z0-9+.-]*:/i.test(r)||r.startsWith("//")||r.startsWith("#"))return;const a=r.startsWith("/")?r:w0(i,r);if(a)return`${_u(t,a)}&inline=1`}function w0(t,i){const r=t.slice(0,t.lastIndexOf("/")),a=r===""?[]:r.split("/").filter(Boolean),o=r.startsWith("/")?[...a]:a;for(const u of i.split("/"))if(!(u===""||u===".")){if(u===".."){if(o.length===0)return null;o.pop();continue}o.push(u)}return o.length===0?null:`/${o.join("/")}`}function J2(t,i){if(!i.startsWith(t))return[];const r=(t==="/"?i.slice(1):i.slice(t.length).replace(/^\//,"")).split("/").filter(Boolean),a=[];let o=t;for(const u of r)o=o==="/"?`/${u}`:`${o}/${u}`,a.push({name:u,path:o});return a}function ph(t,i){return t==="/"?`/${i}`:`${t.replace(/\/$/,"")}/${i}`}function _u(t,i){return`/dsh-bot/api/files/raw?sessionId=${encodeURIComponent(t)}&path=${encodeURIComponent(i)}`}function P2(t){if(!t||typeof t!="object")return!1;const i=t;return typeof i.name=="string"&&(i.kind==="dir"||i.kind==="file"||i.kind==="link")&&typeof i.size=="number"&&typeof i.mtime=="string"}function vu(t,i){return i(t==="denied"?"files.denied":t==="missing"?"files.missing":t==="binary"?"files.binary":t==="exists"?"files.exists":t==="too_large"?"files.tooLarge":t==="overlap"?"files.overlap":"files.failed")}function W2(t,i){if(t.kind==="dir")return i("files.folder");if(t.kind==="link")return i("files.link");const r=t.name.includes(".")?t.name.split(".").pop()??"":"";return r?r.toUpperCase():i("files.file")}function eO(t){return t==="dir"?"▸":t==="link"?"↗":"·"}function tO(t){const i=t.split(".").pop()?.toLowerCase()??"";return i==="jpg"||i==="jpeg"?"image/jpeg":i==="png"?"image/png":i==="gif"?"image/gif":i==="webp"?"image/webp":null}function gh(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(t<10*1024?1:0)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function nO(t){const i=new Date(t);if(Number.isNaN(i.getTime()))return"";const r=String(i.getHours()).padStart(2,"0"),a=String(i.getMinutes()).padStart(2,"0");return`${i.getMonth()+1}/${i.getDate()} ${r}:${a}`}function iO(t,i,r,a,o){const u=`/dsh-bot/api/files?sessionId=${encodeURIComponent(t)}&dir=${encodeURIComponent(i)}&name=${encodeURIComponent(r.name)}&overwrite=${a?"1":"0"}`;return new Promise((c,h)=>{const g=new XMLHttpRequest;g.open("POST",u),g.setRequestHeader("content-type","application/octet-stream"),g.upload.onprogress=p=>{p.lengthComputable&&p.total>0&&o(p.loaded/p.total)},g.onload=()=>{let p={};try{const v=JSON.parse(g.responseText);v&&typeof v=="object"&&(p=v)}catch{p={}}c({status:g.status,body:p})},g.onerror=()=>h(new Error("failed")),g.send(r)})}function lO(){return m.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:m.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 rO(){return m.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:m.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 aO(){return m.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:m.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 sO(){return m.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:m.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 S0(){return m.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:m.jsx("path",{d:"M6 4.2h6.2v8.2H6zM4.2 11.6H3.6V2.8h6.6V4",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}function k0(){return m.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:m.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 E0(){return m.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:m.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 oO(){return m.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[m.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"}),m.jsx("circle",{cx:"8",cy:"8",r:"1.6",fill:"none",stroke:"currentColor",strokeWidth:"1.3"})]})}function uO(){return m.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:m.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 cO(){return m.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:m.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 fO({onClose:t,onCreated:i}){const[r,a]=j.useState(""),[o,u]=j.useState(""),[c,h]=j.useState(""),[g,p]=j.useState(!1),[v,y]=j.useState(""),{locale:w,setLocale:x,t:S}=Ke();function T(E){a(E)}async function C(){if(g)return;const E=r.trim();if(E===""){y(S("new.nameRequired"));return}p(!0),y("");const q=await Fe("/sessions",{method:"POST",headers:{"content-type":"application/json","idempotency-key":crypto.randomUUID()},body:JSON.stringify({name:E})}),B=typeof q.body.sessionId=="string"?q.body.sessionId:"";if(!B){const Y=q.body.upstream;y(Y?.message||String(q.body.error||S("new.createFailed"))),p(!1);return}const ee=QS(E,o,c),X=await Ni("/dsh-bot/api/sessions/open",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:B,personaText:ee,idempotencyKey:crypto.randomUUID()})}),O=X.body.ok===!0?S("new.created",{name:E}):zb(X.body,S("new.personaFailed"));i(B,O,E)}return m.jsx("div",{className:"setup-mask",role:"presentation",onMouseDown:t,children:m.jsxs("form",{className:"setup-card",role:"dialog","aria-labelledby":"new-session-title",onMouseDown:E=>E.stopPropagation(),onSubmit:E=>{E.preventDefault(),C()},children:[m.jsxs("div",{className:"setup-head",children:[m.jsx("h2",{id:"new-session-title",children:S("new.title")}),m.jsx("button",{type:"button",className:"setup-close","aria-label":S("new.close"),onClick:t,children:"×"})]}),m.jsx("p",{className:"setup-lead",children:S("new.lead")}),m.jsx("label",{htmlFor:"setup-name",children:S("new.name")}),m.jsx("input",{id:"setup-name",value:r,placeholder:S("new.namePlaceholder"),onChange:E=>T(E.target.value)}),m.jsx("label",{htmlFor:"setup-style",children:S("new.style")}),m.jsx("input",{id:"setup-style",value:o,placeholder:S("new.stylePlaceholder"),onChange:E=>u(E.target.value)}),m.jsx("label",{htmlFor:"setup-task",children:S("new.task")}),m.jsx("textarea",{id:"setup-task",rows:3,value:c,placeholder:S("new.taskPlaceholder"),onChange:E=>h(E.target.value)}),v?m.jsx("p",{className:"setup-error",children:v}):null,m.jsxs("div",{className:"setup-actions",children:[m.jsx("button",{type:"button",onClick:()=>x(w==="en"?"zh":"en"),children:S("lang.switch")}),m.jsx("button",{type:"button",onClick:t,children:S("new.cancel")}),m.jsx("button",{type:"submit",className:"primary",disabled:g||r.trim()==="",children:S(g?"new.creating":"new.create")})]})]})})}function dO(t,i){const{t:r}=Ke(),[a,o]=j.useState("");return j.useEffect(()=>{if(t===""){o("");return}let u=!1;return(async()=>{const c=await Ni(`/dsh-bot/api/status?sessionId=${encodeURIComponent(t)}`),h=await Ni(`/dsh-bot/api/memory?sessionId=${encodeURIComponent(t)}`);if(u||c.body.ok!==!0)return;const g=c.body.binding;if((g&&typeof g=="object"?g.kind:c.body.kind)!=="bot"){o(r("basis.plain"));return}const v=typeof c.body.personaText=="string"?c.body.personaText.trim():"",y=XS(v),w=[y.name,y.style,y.task].filter(T=>T!=="").join(" · "),S=(Array.isArray(h.body.facts)?h.body.facts:[]).filter(T=>T&&typeof T=="object"&&T.status==="active").length;o(S>0?r("basis.facts",{head:w||"BOT",count:String(S)}):w||"BOT")})(),()=>{u=!0}},[t,i,r]),a}function $u(t){const i=t.replace(/\r\n/g,`
50
- `);if(!i.startsWith("[foundations:message]"))return null;const r=i.slice(21).replace(/^\n/,""),a=r.indexOf(`
51
- ---
52
- `);if(a<0)return null;const o={},u=[];for(const c of r.slice(0,a).split(`
53
- `)){const h=/^(id|from|correlation|causation|hop):\s*(.*)$/.exec(c);h?.[1]?o[h[1]]=(h[2]??"").trim():c.trim()!==""&&u.push(c.trim())}return o.from?{id:o.id??"",from:o.from,correlation:o.correlation??"",causation:o.causation??"",hop:o.hop??"",note:u.join(" "),body:r.slice(a+5).trim()}:null}function T0(t,i){return i!==""&&i!==t?i:t.startsWith("session-")&&t.length>18?`${t.slice(0,12)}…${t.slice(-4)}`:t}const hO=new Set(["foundations_send","foundations_reply"]);function j0(t){const i=[];for(const r of t){if(r.kind==="user"){const o=$u(r.text);if(!o)continue;i.push({kind:"in",id:r.id,seq:r.seq,time:r.time,mail:o});continue}if(r.kind!=="tool"||!hO.has(r.name))continue;const a=yO(r);a&&i.push(a)}return i.sort((r,a)=>r.seq-a.seq||(r.kind===a.kind?0:r.kind==="in"?-1:1)),i}function mO(t){const i=j0(t);if(!i.some(o=>o.kind==="in"))return t.slice();const a=new Set(i.filter(o=>o.kind==="out").map(o=>o.id));return t.filter(o=>!a.has(o.id))}function pO(t,i){const r=t.filter(u=>u.kind==="in"),a=r.at(-1);if(!a)return null;const o=a.mail.body.replace(/\s+/g," ").trim();return{who:i(a.mail.from)||"BOT",preview:o.length>72?`${o.slice(0,71)}…`:o,count:r.length}}function gO(t,i){if(t.target)return t.target;if(!t.correlation)return"";for(let r=i.length-1;r>=0;r-=1){const a=i[r];if(!(!a||a.seq>t.seq)&&a.kind==="in"&&a.mail.correlation===t.correlation)return a.mail.from}return""}function yO(t){let i;try{const a=JSON.parse(t.args);if(!a||typeof a!="object"||Array.isArray(a))return null;i=a}catch{return null}const r=typeof i.text=="string"?i.text.trim():"";return r?{kind:"out",id:t.id,seq:t.seq,text:r,target:typeof i.targetSessionId=="string"?i.targetSessionId:"",correlation:typeof i.correlationId=="string"?i.correlationId:""}:null}function vO({mail:t,label:i,onOpenFile:r}){const{t:a}=Ke(),o=T0(t.from,i),u=/^\d+$/.test(t.hop)?t.hop:"",c=[t.id?`id ${t.id}`:"",`from ${t.from}`,t.correlation?`correlation ${t.correlation}`:"",t.causation?`causation ${t.causation}`:""].filter(Boolean).join(`
54
- `);return m.jsxs("article",{className:"mail-card",children:[m.jsxs("header",{className:"mail-head",children:[m.jsx("span",{className:"bot-badge",children:"BOT"}),m.jsxs("span",{className:"mail-who",children:[m.jsx("strong",{children:o}),m.jsx("span",{children:a("inbox.received")})]}),u?m.jsx("span",{className:"mail-hop",children:a("inbox.hop",{hop:u})}):null]}),t.body?m.jsx("div",{className:"mail-body",children:m.jsx(Is,{text:t.body,onOpenFile:r})}):null,m.jsx("p",{className:"mail-note",children:a("inbox.lead")}),c?m.jsxs("details",{className:"mail-details",children:[m.jsx("summary",{children:a("inbox.source")}),m.jsx("pre",{children:c})]}):null]})}function bO({who:t,preview:i,time:r,mark:a,onOpen:o}){const{t:u}=Ke(),c=i||u("inbox.received");return m.jsxs("div",{className:"inbox-line","data-turn":a,children:[m.jsxs("button",{type:"button",className:"inbox-entry",onClick:o,"aria-label":u("inbox.open",{who:t,line:c}),children:[m.jsx("span",{className:"inbox-icon",children:m.jsx(EO,{})}),m.jsxs("span",{className:"inbox-copy",children:[m.jsx("strong",{children:t}),m.jsx("span",{children:c})]})]}),r?m.jsx("time",{children:r}):null]})}function xO({items:t,botLabel:i,onOpenFile:r}){const{locale:a}=Ke();return m.jsxs("div",{className:"bot-chat",children:[m.jsx(SO,{}),t.length===0?m.jsx(kO,{}):null,t.map(o=>o.kind==="in"?m.jsxs("div",{className:"mail-row",children:[m.jsx(vO,{mail:o.mail,label:i(o.mail.from),onOpenFile:r}),zu(o.time,a)?m.jsx("time",{children:zu(o.time,a)}):null]},o.id):m.jsx(wO,{item:o,items:t,botLabel:i},o.id))]})}function wO({item:t,items:i,botLabel:r}){const{t:a,locale:o}=Ke(),u=gO(t,i),c=u?T0(u,r(u)):a("inbox.other");return m.jsxs("div",{className:"bot-out",children:[m.jsx("div",{className:"user-bubble",children:t.text}),m.jsx("span",{children:a("inbox.sentTo",{name:c})}),zu(t.time,o)?m.jsx("time",{children:zu(t.time,o)}):null]})}function SO(){const{t}=Ke();return m.jsx("p",{className:"bot-chat-lead",children:t("inbox.lead")})}function kO(){const{t}=Ke();return m.jsx("p",{className:"empty-thread",children:t("inbox.empty")})}function zu(t,i){if(!t)return"";const r=new Date(t);return Number.isNaN(r.getTime())?"":r.toLocaleTimeString(i==="zh"?"zh-CN":"en",{hour:"2-digit",minute:"2-digit"})}function EO(){return m.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[m.jsx("path",{d:"M4 13.2 6.4 5.5h11.2L20 13.2",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),m.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 TO({root:t,marks:i,busyId:r}){const a=j.useRef(null),[o,u]=j.useState(i.at(-1)?.id??""),[c,h]=j.useState(null),[g,p]=j.useState({top:!1,bottom:!1}),v=i.map(x=>x.id).join("\0");j.useEffect(()=>{const x=t.current;if(!x||i.length<2)return;const S=()=>{const T=x.getBoundingClientRect().top,C=x.scrollHeight-x.scrollTop-x.clientHeight<48;let E=i[0]?.id??"";if(C)E=i.at(-1)?.id??E;else for(const q of i){const B=x.querySelector(`[data-turn="${CSS.escape(q.id)}"]`);B instanceof HTMLElement&&B.getBoundingClientRect().top-T<=36&&(E=q.id)}u(q=>q===E?q:E)};return S(),x.addEventListener("scroll",S,{passive:!0}),()=>x.removeEventListener("scroll",S)},[t,i,v]),j.useEffect(()=>{const x=a.current,S=x?.querySelector('[aria-current="true"]');if(!x||!S)return;const T=S.offsetTop-(x.clientHeight-S.offsetHeight)/2;x.scrollTop=Math.max(0,T);const C=x.scrollTop>1,E=x.scrollTop<x.scrollHeight-x.clientHeight-1;p(q=>q.top===C&&q.bottom===E?q:{top:C,bottom:E})},[o,v]);const{t:y}=Ke();if(i.length<2)return null;const w=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;return m.jsx("nav",{ref:a,className:["turn-rail",g.top?"fade-top":"",g.bottom?"fade-bottom":""].filter(Boolean).join(" "),"aria-label":y("turn.rail"),onMouseLeave:()=>h(null),children:i.map((x,S)=>{const T=x.id===o;return m.jsx("button",{type:"button",className:["turn-mark",T?"active":"",x.id===c?"preview":"",x.id===r?"busy":""].filter(Boolean).join(" "),"aria-current":T?"true":void 0,"aria-label":y("turn.jump",{index:String(S+1)}),onMouseEnter:()=>h(x.id),onFocus:()=>h(x.id),onBlur:()=>h(C=>C===x.id?null:C),onClick:()=>{t.current?.querySelector(`[data-turn="${CSS.escape(x.id)}"]`)?.scrollIntoView({block:"start",behavior:w?"auto":"smooth"})}},x.id)})})}function jO(t){let i=!1,r=t.visible!==!1,a=!1,o=!1,u=!1,c=0,h=0,g="",p=!1,v=()=>{},y=null;function w(C){const E=JSON.stringify(C);E!==g&&(g=E,p=t.active?.(C)===!0,t.apply(C))}function x(){if(v(),i||!r)return;const C=a?6e4:p?1500:Math.min(15e3,2e3*2**Math.min(h,3));v=t.schedule(()=>{S()},C)}async function S(){if(i||!r)return;if(o){u=!0;return}v(),o=!0;const C=c;y=new AbortController;const E=y,q=t.schedule(()=>E.abort(),1e4);try{const B=await t.fetch(y.signal);!i&&r&&C===c&&w(B),h=Math.min(h+1,3)}catch{h=Math.min(h+1,3)}finally{q(),o=!1,u?(u=!1,S()):x()}}const T={ingest(C){i||!r||(c++,a=!0,h=0,w(C),x())},disconnected(){a=!1,h=0,x()},setVisible(C){r!==C&&(r=C,C||(a=!1),c++,v(),y?.abort(),r&&(h=0,S()))},close(){i=!0,c++,v(),y?.abort()},refresh:S};return S(),T}function C0(t,i=Date.now){let r=null,a=0,o=null,u=0;const c={invalidate(){u++,r=null},get(){if(r&&i()-a<3e4)return Promise.resolve(r);if(o)return o;const h=u,g=t().then(p=>h!==u?(o=null,c.get()):(h===u&&(r=p,a=i()),p)).finally(()=>{o===g&&(o=null)});return o=g,g}};return c}const js=new Set(["preparing","waiting","running","worker"]),N0=new Set([...js,"background"]),CO=/(?:password|passwd|passphrase|secret|token|api[-_]?key|authorization|cookie|credential|private[-_]?key)/i;function ut(t){if(/^\s*[\[{]/.test(t))try{const i=JSON.parse(t);if(i&&typeof i=="object")return JSON.stringify(Mu(i),null,2)}catch{}return t.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 Mu(t){return Array.isArray(t)?t.map(Mu):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([i,r])=>[i,CO.test(i)?"[REDACTED]":Mu(r)])):typeof t=="string"?ut(t):t}function NO(t){try{return JSON.stringify(Mu(JSON.parse(t)),null,2)}catch{return ut(t)}}function Os(t){try{const i=JSON.parse(t);return i&&typeof i=="object"&&!Array.isArray(i)?i:{}}catch{return{}}}function Fh(t){return["bash","shell","pwsh","powershell"].includes(t.toLowerCase())}function Ju(t,i,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(Fh(t)){if(/^\[stopped: .+\]$/m.test(i))return"cancelled";if(/^\[(?:timed out after .+|killed by signal: .+|sandbox: .+)\]$/m.test(i))return"failed";const o=/^\[exit code: (-?\d+)\]$/m.exec(i);if(o)return Number(o[1])!==0?"failed":"succeeded";if(/^started background job \S+/m.test(i)||/^\[still running after \d+ms; moved to background job .+\]$/m.test(i))return"background"}return"succeeded"}function Gh(t){return t.status?t.status:t.resultReceived||t.result!==""?Ju(t.name,t.result,t.error):t.running?"waiting":"unknown"}const AO={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 Jv(t,i=Ai){return i(AO[t])}function Cs(t,i,r=[]){const a=Os(t.args),o=Os(t.result),u=Fh(t.name),c=u&&typeof a.command=="string"?ut(a.command):"",h=typeof a.description=="string"?ut(a.description):"",g=t.meta&&typeof t.meta=="object"?t.meta:{},p=typeof g.cwd=="string"?g.cwd:typeof a.workdir=="string"?a.workdir:i,v=typeof g.cwd=="string"||!p||p.startsWith("/")||!i?p:i.replace(/\/$/,"")+"/"+p,y=v?ut(v):"",w=typeof o.ticketId=="string"?o.ticketId:"",x=r.find(E=>E.id===w);let S=Gh(t);x&&ju(t.name)?S=x.status==="failed"?"failed":x.status==="cancelled"?"cancelled":x.status==="delivered"?"succeeded":"worker":ju(t.name)&&S==="succeeded"&&w&&(S="worker");const T=t.name==="todo_write"&&Array.isArray(a.todos)?a.todos.flatMap(E=>{if(!E||typeof E!="object")return[];const q=E;return typeof q.content=="string"&&typeof q.status=="string"?[{content:ut(q.content),status:q.status}]:[]}):[],C=u?/^\[exit code: (-?\d+)\]$/m.exec(t.result):null;return{status:S,command:c,description:h,cwd:y,cwdSource:typeof g.cwd=="string"?"recorded":typeof a.workdir=="string"?"requested":"session",todos:T,title:t.name==="todo_write"?"todo_write":ut(t.name),args:NO(t.args),output:ut(t.result),exitCode:C?Number(C[1]):null,ticket:x,ticketId:w,latestReport:x?.events.filter(E=>E.revision===x.revision&&E.applyStatus!=="stale").at(-1)?.text??"",jobId:u?/(?:^started background job |moved to background job )([^\s\]]+)/m.exec(t.result)?.[1]??"":""}}const OO="ask_user_question";function A0(t){return t.replace(/-/g,"_").toLowerCase()===OO}function RO(t,i=!1){const r=t.match(/^(.*?)\s*[\((]\s*(Recommended|推荐|建議)\s*[\))]\s*$/i);return{label:t,displayLabel:r?.[1]?.trim()?r[1].trim():t,recommended:i||!!r}}function Fd(t,i,r=""){return t?i.startsWith("zh")&&typeof t.zh=="string"&&t.zh!==""?t.zh:typeof t[i]=="string"&&t[i]!==""?t[i]:t.en||r:r}function _O(t){if(!t||typeof t!="object")return;const i=t;if(i.kind==="plan-review"&&typeof i.approve=="string"){const r={kind:"plan-review",approve:i.approve};return typeof i.callId=="string"&&i.callId!==""&&(r.callId=i.callId),r}if(i.kind==="approval"&&typeof i.approve=="string"&&typeof i.reject=="string"){const r={kind:"approval",approve:i.approve,reject:i.reject};if(typeof i.always=="string"&&i.always!==""&&(r.always=i.always),i.subject&&typeof i.subject=="object"){const a=i.subject;typeof a.name=="string"&&a.name!==""&&(r.subject={name:a.name},typeof a.icon=="string"&&a.icon!==""&&(r.subject.icon=a.icon))}if(i.display&&typeof i.display=="object"){const a=i.display,o=Gd(a.question);if(o){r.display={question:o};const u=Gd(a.detail);u&&(r.display.detail=u);const c=Gd(a.approve);c&&(r.display.approve=c)}}return r}}function Gd(t){if(!t||typeof t!="object"||typeof t.en!="string")return;const i={en:t.en};for(const[r,a]of Object.entries(t))typeof a=="string"&&(i[r]=a);return i}function O0(t){const i=t[0];if(!i||t.length!==1||i.multiSelect||i.intent?.kind!=="plan-review")return;const r=i.options.find(o=>o.label===i.intent?.approve);if(!r)return;const a=i.options.find(o=>o.label!==r.label);if(!(i.options.length>2))return{item:i,approve:r,decline:a,plan:i.detail}}function R0(t){const i=t[0];if(!i||t.length!==1||i.multiSelect||i.intent?.kind!=="approval")return;const r=i.intent,a=i.options.find(c=>c.label===r.approve),o=i.options.find(c=>c.label===r.reject);if(!a||!o)return;const u=r.always?i.options.find(c=>c.label===r.always):void 0;return{item:i,intent:r,approve:a,reject:o,always:u}}function mr(t){return typeof t=="string"?t:""}function zO(t){return Array.isArray(t)?t.flatMap(i=>{if(!i||typeof i!="object")return[];const r=i;return typeof r.label!="string"?[]:[{label:r.label,description:mr(r.description),recommended:r.recommended===!0}]}):[]}function MO(t){return Array.isArray(t)?t.flatMap((i,r)=>{if(!i||typeof i!="object")return[];const a=i,o=mr(a.question);if(!o)return[];const u=mr(a.id);return[{id:u===""?`question-${r+1}`:u,question:o,detail:mr(a.detail),header:mr(a.header),options:zO(a.options),multiSelect:a.multi_select===!0||a.multiSelect===!0,intent:_O(a.intent)}]}):[]}function qO(t){const i=new Map,r=Os(t),a=Array.isArray(r.answers)?r.answers:Array.isArray(r)?r:[];for(const o of a){if(!o||typeof o!="object")continue;const u=o,c=mr(u.id);if(!c)continue;const h=Array.isArray(u.selected)?u.selected.flatMap(g=>typeof g=="string"?[g]:[]):[];i.set(c,{selected:h,custom:mr(u.custom)})}return i}function DO(t){const i=t.errorCode??"";return/ASK_ABORTED|ABORT|CANCEL/i.test(i)||/aborted before the user answered/i.test(t.result)}function _0(t){if(!t)return!1;const i=Os(t);return!!(i&&i.pending===!0)}function LO(t){return _0(t.result)?!1:!!(t.resultReceived||t.result!==""||t.error||t.errorCode)}function BO(t){const i=t.timeout;if(!(typeof i!="number"||!Number.isFinite(i)||i<=0))return i>1e3?i:i*1e3}function Vs(t){if(!A0(t.name))return null;const i=Os(t.args),r=MO(i.questions),a=qO(t.result),o=DO(t),u=_0(t.result),c=LO(t),h=c&&t.error&&!o,g=u?"continued":c?o?"aborted":h?"failed":"answered":"open",p=BO(i),v=u?"continued":g==="open"&&p?"counting":"none",y=r.map(S=>{const T=a.get(S.id),C=T?.selected??[],E=T?.custom??"";return{...S,selected:C,custom:E,skipped:g==="answered"&&C.length===0&&!E}}),w=y.find(S=>S.header)?.header||y[0]?.question||t.name,x=O0(y)?"plan-review":R0(y)?"approval":"question";return{callId:t.callId,state:g,wait:v,timeoutMs:p,title:w,questions:y,presentation:x}}function z0(t){return t==="open"||t==="continued"}const UO=new Set(["accepted","enqueued","started","needs_user","ready"]),HO=new Set(["delivered","failed","cancelled"]),IO={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"},VO={accepted:"activity.ticket.scheduling",enqueued:"activity.ticket.scheduling",started:"activity.status.worker",needs_user:"activity.ticket.needsUser",ready:"activity.ticket.ready"};function yh(t){const{segments:i,drafting:r,currentTurn:a,tickets:o=[],t:u=Ai}=t,c=[],h=[],g=new Set,p=w=>a==null||w===a,v=w=>u(IO[w]);for(const w of i){if(w.kind!=="tool")continue;const x=Cs(w,void 0,o),S=Vs(w);if(S&&z0(S.state)&&r&&p(w.turn)){c.push({text:u("question.waiting"),moving:!0});continue}if(x.status==="worker"&&x.ticket)continue;if(x.status==="worker"&&x.ticketId){if(g.has(x.ticketId))continue;g.add(x.ticketId)}const T=x.description||x.command||x.title,C={text:`${v(x.status)}: ${T}`,moving:x.status!=="background"};if(x.status==="background"){r&&p(w.turn)&&h.push(C);continue}js.has(x.status)&&(!r||!p(w.turn)||c.push(C))}t.pendingApprovals?.some(w=>w.state==="open")&&c.push({text:u("approval.waiting"),moving:!0});for(const w of o){if(g.has(w.id)||HO.has(w.status)||!UO.has(w.status))continue;g.add(w.id);const x=VO[w.status];x&&c.push({text:`${u(x)}: ${w.summary}`,moving:["accepted","enqueued","started"].includes(w.status)})}let y=c.find(w=>w.text===u("question.waiting"))??c.at(-1);if(c.length>1&&y&&(y={text:`${u("activity.pendingCount",{count:String(c.length)})} · ${y.text}`,moving:c.some(w=>w.moving)}),!y&&h.length&&(y=h.at(-1)),!y&&r){const w=i.filter(x=>p(x.turn));y=w.some(x=>x.kind==="think"&&x.running)?{text:u("activity.thinking"),moving:!0}:w.some(x=>x.kind==="assistant"&&x.streaming)?{text:u("bot.replying"),moving:!0}:{text:u("activity.waitingModel"),moving:!0}}if(!y)return null;if(t.connectionPhase&&t.connectionPhase!=="live"){const w=["restoring","connecting","syncing"].includes(t.connectionPhase);y={text:u("activity.staleSummary",{phase:u(w?"activity.syncing":"activity.connectionUnavailable"),text:y.text}),moving:!1}}return{...y,text:ut(y.text).replace(/\s+/g," ").trim()}}function YO(t){const{t:i}=Ke(),r=yh({...t,t:i}),[a,o]=j.useState(()=>typeof document>"u"||document.visibilityState!=="hidden");return j.useEffect(()=>{const u=()=>o(document.visibilityState!=="hidden");return document.addEventListener("visibilitychange",u),u(),()=>document.removeEventListener("visibilitychange",u)},[]),r?m.jsxs("div",{className:"composer-activity",role:"status","aria-live":"polite","aria-atomic":"true","data-moving":r.moving&&a?"true":"false",children:[m.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:m.jsx("path",{d:"M3 4h10M3 8h10M3 12h6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})}),m.jsx("span",{className:"composer-activity-text",title:r.text,children:r.text})]}):null}const M0=["persona","profile","fact","episodic","procedural","state","skill"];function FO(t){return t==="full"?"full":t==="summary"||t==="truncated"?"summary":t==="index"?"index":t==="recall"||t==="tool"?"recall":t==="absent"||t==="none"||t==="uncited"?"absent":"unknown"}function q0(t){const i=t.chain?.map(a=>a.tombstone||a.lifecycle==="forgotten"?{...a,summary:"",tombstone:!0}:a);return t.tombstone||t.lifecycle==="forgotten"?{...t,tombstone:!0,title:t.type==="skill"?t.title:"",summary:"",body:null,bodyState:"hidden",attributes:[],steps:[],goal:"",blockers:[],next:"",...i?{chain:i}:{}}:i?{...t,chain:i}:t}function Pv(t){return Array.isArray(t.entities)?t.entities.flatMap(i=>{const r=D0(i);return r?[q0(r)]:[]}):[]}function GO(t){const i=D0(t.entity);return i?q0(i):null}function QO(t){if(!Array.isArray(t.frames))return[];const i=[];for(const r of t.frames){if(!r||typeof r!="object")continue;const a=r;typeof a.revision=="number"&&i.push({revision:a.revision,frozenAt:typeof a.frozenAt=="string"?a.frozenAt:"",presence:typeof a.presence=="string"?a.presence:"",hasManifest:a.hasManifest===!0})}return i}function XO(t){if(!Array.isArray(t.citations))return[];const i=[];for(const r of t.citations){if(!r||typeof r!="object")continue;const a=r;typeof a.id=="string"&&i.push({id:a.id,form:FO(a.form),reason:typeof a.reason=="string"?a.reason:"no_manifest"})}return i}function D0(t){if(!t||typeof t!="object"||Array.isArray(t))return null;const i=t;return typeof i.id!="string"||!ZO(i.type)?null:i}function ZO(t){return typeof t=="string"&&M0.includes(t)}const L0="dsh-bot.memory-drawer-width",Qh={persona:"memory.type.persona",profile:"memory.type.profile",fact:"memory.type.fact",episodic:"memory.type.episodic",procedural:"memory.type.procedural",state:"memory.type.state",skill:"memory.type.skill"},KO={user:"memory.scope.user",session:"memory.scope.session",work:"memory.scope.work",skill:"memory.scope.skill"},B0={active:"memory.lifecycle.active",corrected:"memory.lifecycle.corrected",forgotten:"memory.lifecycle.forgotten",candidate:"memory.lifecycle.candidate"};function $O(){try{const t=localStorage.getItem(L0);return t==null||t===""?Ns:ha(Number(t))}catch{return Ns}}function JO(t){try{localStorage.setItem(L0,String(t))}catch{}}function PO({open:t,sessionId:i,onClose:r}){const{t:a}=Ke(),[o,u]=j.useState(""),[c,h]=j.useState(""),[g,p]=j.useState("all"),[v,y]=j.useState("all"),[w,x]=j.useState("all"),[S,T]=j.useState([]),[C,E]=j.useState(null),[q,B]=j.useState(!1),[ee,X]=j.useState([]),[O,Y]=j.useState("auto"),[K,se]=j.useState([]),[_,G]=j.useState(null),[te,Te]=j.useState(null),[xe,fe]=j.useState(!0),[re,ue]=j.useState(""),[ge,me]=j.useState(0),[A,Ee]=j.useState($O),Be=j.useRef(A),[M,z]=j.useState(!1),[ne,J]=j.useState(()=>window.innerWidth),[ae,Oe]=j.useState(()=>window.matchMedia("(max-width: 800px)").matches),[be,we]=j.useState(t),[P,ye]=j.useState(t?"in":"out"),We=j.useRef(be),et=j.useRef(P);We.current=be,et.current=P;const Ne=ha(A);ox({present:be,narrow:ae,motion:P,width:Ne,resizing:M,viewport:ne}),j.useEffect(()=>{if(t){we(!0),ye("in");return}if(We.current){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){we(!1);return}ye("out")}},[t]),j.useEffect(()=>{const he=window.matchMedia("(max-width: 800px)"),Le=()=>Oe(he.matches);return he.addEventListener("change",Le),()=>he.removeEventListener("change",Le)},[]),j.useEffect(()=>{const he=()=>J(window.innerWidth);return window.addEventListener("resize",he),()=>window.removeEventListener("resize",he)},[]),j.useEffect(()=>{u(""),h(""),G(null),Te(null),Y("auto"),T([]),X([]),se([]),E(null)},[i]),j.useEffect(()=>{const he=setTimeout(()=>h(o.trim()),200);return()=>clearTimeout(he)},[o]),j.useEffect(()=>{if(!t)return;let he=!1;return fe(!0),ue(""),Ni(Wv(i,{query:c,scope:g,lifecycle:v,type:w},null)).then(Le=>{if(!he){if(Le.status!==200||Le.body.ok===!1){T([]),E(null),ue(eb(Le.status,a)),fe(!1);return}T(Pv(Le.body)),E(typeof Le.body.nextCursor=="string"?Le.body.nextCursor:null),B(Le.body.capped===!0),fe(!1)}}),()=>{he=!0}},[t,i,c,g,v,w,ge,a]),j.useEffect(()=>{if(!t)return;let he=!1;return Ni(`/dsh-bot/api/memory/frames?sessionId=${encodeURIComponent(i)}`).then(Le=>{he||Le.body.ok===!1||X(QO(Le.body))}),()=>{he=!0}},[t,i,ge]);const tt=O==="none"?null:O==="auto"?ee[0]?.revision??null:O,$e=S.map(he=>he.id).join(",");j.useEffect(()=>{if(!t||tt==null||$e===""){se([]);return}let he=!1;const Le=new URLSearchParams({sessionId:i,revision:String(tt),ids:$e});return Ni(`/dsh-bot/api/memory/context?${Le}`).then(bt=>{he||bt.body.ok===!1||se(XO(bt.body))}),()=>{he=!0}},[t,i,tt,$e]),j.useEffect(()=>{if(!t||_==null){Te(null);return}let he=!1;const Le=new URLSearchParams({sessionId:i});return Ni(`/dsh-bot/api/memory/entities/${encodeURIComponent(_)}?${Le}`).then(bt=>{he||Te(bt.body.ok===!1?null:GO(bt.body))}),()=>{he=!0}},[t,i,_,ge]),j.useEffect(()=>{if(!be)return;const he=Le=>{if(Le.key==="Escape"){if(_!=null){G(null);return}r()}};return document.addEventListener("keydown",he),()=>document.removeEventListener("keydown",he)},[be,_,r]);async function Ie(){if(C==null)return;const he=await Ni(Wv(i,{query:c,scope:g,lifecycle:v,type:w},C));if(he.status!==200||he.body.ok===!1){ue(eb(he.status,a));return}T(Le=>[...Le,...Pv(he.body)]),E(typeof he.body.nextCursor=="string"?he.body.nextCursor:null)}const Me=S.find(he=>he.id===_)??null,Qe=te&&te.id===_?te:Me,vt=he=>tt==null?null:K.find(Le=>Le.id===he)??{id:he,form:"unknown",reason:"no_manifest"};return be?Ds.createPortal(m.jsxs("div",{className:ae?`files-drawer narrow files-drawer-${P}`:`files-drawer files-drawer-${P}${M?" resizing":""}`,style:ae?void 0:{width:Ne},role:"dialog","aria-label":a("memory.title"),onAnimationEnd:he=>{he.target!==he.currentTarget||he.animationName!=="files-drawer-out"||et.current==="out"&&we(!1)},children:[ae?null:m.jsx("div",{className:"files-resize",onPointerDown:he=>{he.preventDefault(),he.currentTarget.setPointerCapture(he.pointerId),z(!0);const Le=bn=>{const Lt=ha(window.innerWidth-bn.clientX);Be.current=Lt,Ee(Lt)},bt=()=>{z(!1),JO(Be.current),window.removeEventListener("pointermove",Le),window.removeEventListener("pointerup",bt)};window.addEventListener("pointermove",Le),window.addEventListener("pointerup",bt)}}),m.jsxs("header",{className:"files-head",children:[m.jsx("button",{type:"button",className:"files-icon-btn","aria-label":a("memory.close"),onClick:r,children:m.jsx(lR,{})}),m.jsxs("nav",{className:"files-crumbs","aria-label":a("memory.title"),children:[m.jsx("button",{type:"button",onClick:()=>G(null),children:a("memory.title")}),Qe?m.jsxs("span",{children:[m.jsx("span",{"aria-hidden":"true",children:"/"}),m.jsx("span",{className:"files-crumb-current",children:U0(Qe,a("memory.missing"))})]}):null]}),m.jsx("button",{type:"button",className:"files-icon-btn files-upload","aria-label":a("memory.refresh"),onClick:()=>me(he=>he+1),children:m.jsx(rR,{})})]}),Qe?null:m.jsxs("div",{className:"memory-bar",children:[m.jsx("input",{className:"memory-search",value:o,placeholder:a("memory.search"),"aria-label":a("memory.search"),onChange:he=>u(he.target.value)}),m.jsxs("select",{"aria-label":a("memory.scope"),value:g,onChange:he=>p(he.target.value),children:[m.jsx("option",{value:"all",children:a("memory.scope.all")}),m.jsx("option",{value:"user",children:a("memory.scope.user")}),m.jsx("option",{value:"session",children:a("memory.scope.session")}),m.jsx("option",{value:"work",children:a("memory.scope.work")}),m.jsx("option",{value:"skill",children:a("memory.scope.skill")})]}),m.jsxs("select",{"aria-label":a("memory.lifecycle"),value:v,onChange:he=>y(he.target.value),children:[m.jsx("option",{value:"all",children:a("memory.lifecycle.all")}),m.jsx("option",{value:"active",children:a("memory.lifecycle.active")}),m.jsx("option",{value:"corrected",children:a("memory.lifecycle.corrected")}),m.jsx("option",{value:"forgotten",children:a("memory.lifecycle.forgotten")}),m.jsx("option",{value:"candidate",children:a("memory.lifecycle.candidate")})]}),m.jsxs("select",{"aria-label":a("memory.kind"),value:w,onChange:he=>x(he.target.value),children:[m.jsx("option",{value:"all",children:a("memory.type.all")}),M0.map(he=>m.jsx("option",{value:he,children:a(Qh[he])},he))]}),ee.length===0?m.jsx("span",{className:"memory-note",children:a("memory.frame.none")}):m.jsxs("select",{id:"memory-frame","aria-label":a("memory.frame"),title:a("memory.frame.hint"),value:tt==null?"none":String(tt),onChange:he=>{const Le=he.target.value;Y(Le==="none"?"none":Number(Le))},children:[m.jsx("option",{value:"none",children:a("memory.frame.unselected")}),ee.map(he=>m.jsx("option",{value:he.revision,children:a("memory.frame.option",{revision:String(he.revision)})},he.revision))]})]}),m.jsx("div",{className:"files-body",children:m.jsx("div",{className:"files-stage in",children:Qe?m.jsx(eR,{entity:Qe,citation:vt(Qe.id),sourceReady:te?.id===Qe.id,t:a,onClose:()=>G(null),onSelect:G}):re?m.jsx("p",{className:"files-status memory-error",children:re}):xe&&S.length===0?m.jsx("p",{className:"files-status",children:a("memory.loading")}):S.length===0?m.jsxs("div",{className:"files-empty",children:[m.jsx("span",{className:"files-empty-mark","aria-hidden":"true",children:m.jsx(aR,{})}),m.jsx("p",{children:a("memory.empty")})]}):m.jsxs(m.Fragment,{children:[tt!=null?m.jsx("p",{className:"memory-note",children:a("memory.frame.note")}):null,q?m.jsx("p",{className:"memory-note",children:a("memory.capped")}):null,m.jsxs("div",{className:"files-table",role:"table",children:[m.jsxs("div",{className:"files-row files-columns memory-row",role:"row",children:[m.jsx("span",{role:"columnheader",children:a("files.name")}),m.jsx("span",{className:"files-col-type",role:"columnheader",children:a("memory.kind")}),m.jsx("span",{className:"files-col-size",role:"columnheader",children:a("memory.lifecycle")}),m.jsx("span",{className:"files-col-time",role:"columnheader",children:a("files.modified")})]}),S.map(he=>m.jsx(WO,{entity:he,selected:he.id===_,t:a,onSelect:G},he.id))]}),C?m.jsx("button",{type:"button",className:"memory-more",onClick:()=>{Ie()},children:a("memory.more")}):null,m.jsx("p",{className:"memory-readonly",children:a("memory.readonly")})]})})})]}),document.body):null}function WO({entity:t,selected:i,t:r,onSelect:a}){const o=t.tombstone?r("memory.tombstone"):U0(t,r("memory.missing"));return m.jsxs("div",{className:"files-row memory-row",role:"row",children:[m.jsxs("button",{type:"button",className:"files-name","aria-pressed":i,onClick:()=>a(t.id),children:[m.jsx(iR,{type:t.type}),m.jsx("span",{children:o})]}),m.jsx("span",{className:"files-col-type",children:r(Qh[t.type])}),m.jsx("span",{className:"files-col-size",children:r(B0[t.lifecycle])}),m.jsx("span",{className:"files-col-time",title:cR(t.updatedAt),children:Rs(t.updatedAt,r("memory.missing"))})]})}function eR({entity:t,citation:i,sourceReady:r,t:a,onClose:o,onSelect:u}){const c=!t.tombstone&&t.bodyState==="visible"&&typeof t.body=="string"&&t.body.trim()!==t.summary.trim();return m.jsxs("div",{className:`files-preview memory-doc memory-doc-${t.type}`,children:[m.jsxs("div",{className:"files-preview-bar",children:[m.jsxs("span",{children:[a(Qh[t.type]),m.jsx("span",{"aria-hidden":"true",children:" · "}),a(KO[t.scope]),m.jsx("span",{"aria-hidden":"true",children:" · "}),a(B0[t.lifecycle])]}),m.jsxs("span",{children:[i?m.jsx("span",{className:`memory-cite memory-cite-${i.form}`,children:a(H0(i.form))}):null,m.jsx("button",{type:"button",onClick:o,children:a("memory.back")})]})]}),m.jsxs("div",{className:"files-markdown",children:[m.jsx(tR,{entity:t,citation:i,t:a}),t.type==="episodic"&&!t.tombstone?m.jsx("p",{className:"memory-participants",children:a("memory.episode.participants")}):null,c?m.jsx("pre",{className:"memory-body",children:t.body}):null,t.bodyState==="hidden"?m.jsx("p",{className:"memory-body-note",children:a("memory.body.hidden")}):null,t.bodyState==="mismatch"?m.jsx("p",{className:"memory-body-note",children:a("memory.body.mismatch")}):null,t.bodyState==="absent"?m.jsx("p",{className:"memory-body-note",children:a("memory.body.absent")}):null,t.note?m.jsxs("p",{className:"memory-note-line",children:[m.jsx("span",{children:a("memory.note")}),t.note]}):null,r?m.jsx(nR,{source:t.source,t:a}):null,i?m.jsx("p",{className:"memory-cite-reason",children:a(sR(i.reason))}):null,t.chain&&t.chain.length>1?m.jsxs("section",{className:"memory-chain",children:[m.jsx("h5",{children:a("memory.chain")}),m.jsx("ul",{children:t.chain.map(h=>m.jsx("li",{children:m.jsx("button",{type:"button",disabled:h.id===t.id,onClick:()=>u(h.id),children:h.tombstone?a("memory.tombstone"):h.summary||h.id})},h.id))})]}):null,t.changes&&t.changes.length>0?m.jsxs("section",{className:"memory-changes",children:[m.jsx("h5",{children:a("memory.changes")}),m.jsx("ul",{children:t.changes.map(h=>m.jsxs("li",{children:[uR(h.tool,a)," · ",Rs(h.at,a("memory.missing"))]},h.id))})]}):null]})]})}function tR({entity:t,citation:i,t:r}){if(t.tombstone)return m.jsx("p",{className:"memory-tombstone",children:r("memory.tombstone")});if(t.type==="persona")return m.jsxs("div",{className:"memory-persona",children:[t.versionLabel?m.jsx("p",{className:"memory-version",children:r("memory.version",{version:t.versionLabel})}):null,t.title?m.jsx("p",{className:"memory-persona-title",children:t.title}):null,t.summary&&t.summary!==t.title?m.jsx("p",{className:"memory-excerpt",children:t.summary}):null]});if(t.type==="profile")return t.attributes&&t.attributes.length>0?m.jsx("dl",{className:"memory-attributes",children:t.attributes.map(o=>m.jsxs("div",{children:[m.jsx("dt",{children:o.name}),m.jsx("dd",{children:o.value})]},`${o.name}:${o.value}`))}):m.jsx("p",{className:"memory-profile-empty",children:t.summary||r("memory.profile.empty")});if(t.type==="fact")return m.jsxs("div",{className:"memory-fact",children:[m.jsx("p",{className:"memory-proposition",children:t.summary||r("memory.missing")}),t.priority!=null?m.jsx("p",{className:"memory-priority",children:r("memory.priority",{priority:String(t.priority)})}):null]});if(t.type==="episodic")return m.jsxs("div",{className:"memory-episode",children:[m.jsx("time",{dateTime:t.updatedAt??void 0,children:Rs(t.updatedAt,r("memory.missing"))}),t.title?m.jsx("p",{className:"memory-scene-title",children:t.title}):null,m.jsx("p",{className:"memory-scene",children:t.summary||r("memory.missing")})]});if(t.type==="procedural")return t.steps&&t.steps.length>0?m.jsx("ol",{className:"memory-steps",children:t.steps.map((o,u)=>m.jsx("li",{children:o},`${u}:${o}`))}):m.jsx("p",{className:"memory-procedure-empty",children:r("memory.procedure.empty")});if(t.type==="state")return m.jsxs("div",{className:"memory-state",children:[m.jsxs("p",{className:"memory-goal",children:[m.jsx("span",{children:r("memory.state.goal")}),t.goal||r("memory.missing")]}),m.jsxs("div",{className:"memory-blockers",children:[m.jsx("span",{children:r("memory.state.blockers")}),t.blockers&&t.blockers.length>0?m.jsx("ul",{children:t.blockers.map(o=>m.jsx("li",{children:o},o))}):m.jsx("p",{children:r("memory.missing")})]}),m.jsxs("p",{className:"memory-next",children:[m.jsx("span",{children:r("memory.state.next")}),t.next||r("memory.missing")]})]});const a=t.bindingScope==="private"?r("memory.skill.private"):r("memory.skill.public");return m.jsxs("div",{className:"memory-skill",children:[m.jsx("p",{className:"memory-skill-name",children:t.title}),t.summary?m.jsx("p",{className:"memory-skill-summary",children:t.summary}):null,m.jsx("p",{className:"memory-skill-load",children:r(i?H0(i.form):"memory.skill.loadUnknown")}),t.bindingScope?m.jsx("p",{className:"memory-skill-file",children:r("memory.skill.binding",{scope:a})}):null,t.enabled===!1?m.jsx("p",{className:"memory-skill-flag",children:r("memory.skill.disabled")}):null]})}function nR({source:t,t:i}){return t?.recorded?m.jsxs("section",{className:"memory-source",children:[m.jsx("h5",{children:i("memory.source")}),m.jsx("p",{children:i(oR(t.creator))}),t.createdAt?m.jsx("p",{children:i("memory.source.created",{time:Rs(t.createdAt,i("memory.missing"))})}):null,t.updatedAt?m.jsx("p",{children:i("memory.source.updated",{time:Rs(t.updatedAt,i("memory.missing"))})}):null]}):m.jsxs("section",{className:"memory-source",children:[m.jsx("h5",{children:i("memory.source")}),m.jsx("p",{children:i("memory.source.unrecorded")})]})}function iR({type:t}){return m.jsx("span",{className:"files-mark memory-mark","aria-hidden":"true",children:m.jsxs("svg",{viewBox:"0 0 16 16",children:[t==="persona"?m.jsxs(m.Fragment,{children:[m.jsx("circle",{cx:"8",cy:"5.4",r:"2.1",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),m.jsx("path",{d:"M3.6 13.2c.7-2.3 2.3-3.4 4.4-3.4s3.7 1.1 4.4 3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]}):null,t==="profile"?m.jsx("path",{d:"M4 3.6h8v8.8H4zM6.2 6.4h3.6M6.2 8.6h3.6M6.2 10.8h2.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round",strokeLinecap:"round"}):null,t==="fact"?m.jsx("path",{d:"M4 5.2h8M4 8h8M4 10.8h5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}):null,t==="episodic"?m.jsxs(m.Fragment,{children:[m.jsx("circle",{cx:"8",cy:"8",r:"4.6",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),m.jsx("path",{d:"M8 5.6V8l2 1.3",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]}):null,t==="procedural"?m.jsx("path",{d:"M4.2 4.6h7.6M4.2 8h7.6M4.2 11.4h7.6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}):null,t==="state"?m.jsxs(m.Fragment,{children:[m.jsx("circle",{cx:"8",cy:"8",r:"4.6",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),m.jsx("circle",{cx:"8",cy:"8",r:"1.3",fill:"currentColor"})]}):null,t==="skill"?m.jsx("path",{d:"M5.2 3.4v9.2M10.8 3.4v9.2M3.4 6h9.2M3.4 10h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}):null]})})}function lR(){return m.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:m.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 rR(){return m.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[m.jsx("path",{d:"M13.2 8a5.2 5.2 0 1 1-1.4-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),m.jsx("path",{d:"M13.4 2.6V5.2H10.8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function aR(){return m.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[m.jsx("path",{d:"M5 6.5h14v11H5z",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),m.jsx("path",{d:"M8 10.5h8M8 13.5h5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function U0(t,i){if(t.tombstone)return i;if(t.type==="persona")return t.title||t.summary||i;if(t.type==="profile"){const r=t.attributes?.[0];return r?`${r.name} ${r.value}`:t.summary||i}return t.type==="fact"?t.summary||i:t.type==="episodic"?t.title||t.summary||i:t.type==="procedural"?t.steps?.[0]||t.summary||i:t.type==="state"?t.goal||t.summary||i:t.title||t.summary||i}function Wv(t,i,r){const a=new URLSearchParams({sessionId:t});return i.query!==""&&a.set("q",i.query),i.scope!=="all"&&a.set("scope",i.scope),i.lifecycle!=="all"&&a.set("lifecycle",i.lifecycle),i.type!=="all"&&a.set("type",i.type),r&&a.set("cursor",r),`/dsh-bot/api/memory/entities?${a}`}function eb(t,i){return i(t===401||t===403?"memory.denied":"memory.failed")}function H0(t){return t==="full"?"memory.cite.full":t==="summary"?"memory.cite.summary":t==="index"?"memory.cite.index":t==="recall"?"memory.cite.recall":t==="absent"?"memory.cite.absent":"memory.cite.unknown"}function sR(t){return t==="no_frame"?"memory.cite.reason.no_frame":"memory.cite.reason.no_manifest"}function oR(t){return t==="user"?"memory.source.user":t==="model"?"memory.source.model":t==="system"?"memory.source.system":t==="tool"?"memory.source.tool":"memory.source.unknown"}function uR(t,i){return t==="foundations_remember"?i("memory.tool.foundations_remember"):t==="foundations_correct"?i("memory.tool.foundations_correct"):t==="foundations_forget"?i("memory.tool.foundations_forget"):t==="foundations_state_update"?i("memory.tool.foundations_state_update"):t}function Rs(t,i){if(!t)return i;const r=new Date(t);if(Number.isNaN(r.getTime()))return i;const a=String(r.getHours()).padStart(2,"0"),o=String(r.getMinutes()).padStart(2,"0");return`${r.getMonth()+1}/${r.getDate()} ${a}:${o}`}function cR(t){if(!t)return;const i=new Date(t);if(!Number.isNaN(i.getTime()))return i.toLocaleString()}function fR(t,i){const r=new Map(i.map(u=>[u.id,u.status])),a=new Map,o=[];for(const u of t)if(dR(u,r)){if(!u.ticketId){o.push(u);continue}a.set(u.ticketId,u)}return{byTicket:a,loose:o}}function dR(t,i){if(t.previewRevision==null)return!1;if(!t.ticketId)return!0;const r=i.get(t.ticketId);return r==null?!0:r==="delivered"}function tb(){return{revision:null,files:new Map}}async function hR(t){const i=new Uint8Array(t.byteLength);i.set(t);const r=await crypto.subtle.digest("SHA-256",i);return`sha256:${[...new Uint8Array(r)].map(o=>o.toString(16).padStart(2,"0")).join("")}`}function mR(t,i){return i.kind!=="delta"||t.revision==null||i.baseRevision==null||i.baseRevision!==t.revision||i.revision!==t.revision+1?{mode:"snapshot",paths:i.manifest.map(o=>o.path)}:{mode:"delta",paths:i.manifest.filter(o=>{const u=t.files.get(o.path);return!u||u.hash!==o.hash||u.bytes.byteLength!==o.bytes}).map(o=>o.path)}}async function pR(t,i,r){const a=new Map;for(const o of i.manifest){const u=t.files.get(o.path),c=r.get(o.path)??(u&&u.hash===o.hash?u.bytes:void 0);if(!c)return{ok:!1,cache:t,error:`missing ${o.path}`};if(c.byteLength!==o.bytes)return{ok:!1,cache:t,error:`size ${o.path}`};const h=await hR(c);if(h!==o.hash)return{ok:!1,cache:t,error:`hash ${o.path}`};a.set(o.path,{hash:h,type:o.type,bytes:c})}return a.has(i.entry)?{ok:!0,cache:{revision:i.revision,files:a}}:{ok:!1,cache:t,error:"missing entry"}}async function gR(t,i,r){const a=mR(t,i),o=new Map;try{for(const u of a.paths)o.set(u,await r(u))}catch(u){return{ok:!1,cache:t,error:u instanceof Error?u.message:"fetch failed"}}if(a.mode==="snapshot"){for(const u of i.manifest)if(!o.has(u.path))return{ok:!1,cache:t,error:`incomplete snapshot ${u.path}`}}return pR(t,i,o)}function yR(t,i){return i.ok?i.src:t}const nb=[{id:"desktop",width:1280,label:"canvas.device.desktop"},{id:"tablet",width:768,label:"canvas.device.tablet"},{id:"phone",width:390,label:"canvas.device.phone"}],vR={byTicket:new Map,loose:[],open:t=>{}},I0=j.createContext(vR);function V0(){return j.useContext(I0)}function bR({title:t,revisions:i,activeRevision:r,phase:a,error:o,src:u,onSelect:c,onRetry:h,onAdopt:g,onClose:p}){const{t:v}=Ke(),y=j.useRef(null),w=j.useRef(null),x=j.useRef(null),S=j.useRef(p);S.current=p;const[T,C]=j.useState("desktop"),E=t||v("canvas.card"),q=i.find(X=>X.revision===r)??null,B=nb.find(X=>X.id===T)?.width??1280;j.useEffect(()=>{const X=document.activeElement instanceof HTMLElement?document.activeElement:null,O=document.body.style.overflow;document.body.style.overflow="hidden",w.current?.focus();const Y=K=>{if(K.key==="Escape"){K.preventDefault(),K.stopPropagation(),S.current();return}if(K.key!=="Tab")return;const se=[...y.current?.querySelectorAll('button, iframe, [href], [tabindex="0"]')??[]],_=se[0],G=se.at(-1);K.shiftKey&&(document.activeElement===_||!y.current?.contains(document.activeElement))?(K.preventDefault(),G?.focus()):!K.shiftKey&&(document.activeElement===G||!y.current?.contains(document.activeElement))&&(K.preventDefault(),_?.focus())};return document.addEventListener("keydown",Y,!0),()=>{document.removeEventListener("keydown",Y,!0),document.body.style.overflow=O,X?.isConnected&&X.focus()}},[]),j.useEffect(()=>{x.current&&u&&(x.current.src=u)},[u]);const ee=()=>{const X=x.current;if(!X||!u)return;const O=`${u}${u.includes("?")?"&":"?"}r=${Date.now()}`;try{X.contentWindow?.location.replace(new URL(O,window.location.href).href)}catch{X.src=O}};return Ds.createPortal(m.jsx("div",{className:"canvas-modal",onClick:X=>{X.target===X.currentTarget&&p()},children:m.jsxs("div",{ref:y,className:"canvas-dialog",role:"dialog","aria-modal":"true","aria-label":E,children:[m.jsxs("header",{className:"canvas-toolbar",children:[m.jsxs("div",{className:"canvas-toolbar-title",children:[m.jsx("strong",{className:"canvas-name",title:E,children:E}),m.jsx("button",{ref:w,type:"button",className:"canvas-close","aria-label":v("canvas.close"),onClick:p,children:m.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:m.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})})]}),m.jsxs("div",{className:"canvas-toolbar-controls",children:[m.jsx("button",{type:"button",className:"canvas-reset",title:v("canvas.reset.hint"),onClick:ee,disabled:!u,children:v("canvas.reset")}),m.jsx("div",{className:"canvas-segment",role:"group","aria-label":v("canvas.devices"),children:nb.map(X=>m.jsx("button",{type:"button","aria-pressed":T===X.id,onClick:()=>C(X.id),children:v(X.label)},X.id))}),m.jsx("div",{className:"canvas-segment canvas-versions",role:"group","aria-label":v("canvas.versions"),children:i.map(X=>m.jsxs("button",{type:"button","aria-pressed":X.revision===r,disabled:X.status==="failed",title:X.error??v("canvas.revision",{revision:String(X.revision)}),onClick:()=>c(X.revision),children:[v("canvas.revision",{revision:String(X.revision)}),m.jsx("span",{className:"canvas-version-status",children:v(xR(X.status))})]},X.revision))}),m.jsx("button",{type:"button",className:"canvas-adopt",onClick:g,disabled:q?.status!=="preview"||a==="loading",children:q?.status==="stable"?v("canvas.adopted"):v("canvas.adopt")})]})]}),m.jsxs("div",{className:"canvas-stage",children:[a==="loading"?m.jsx("p",{className:"canvas-status",children:v("canvas.loading")}):null,a==="error"?m.jsxs("p",{className:"canvas-status",role:"alert",children:[m.jsx("span",{children:o||v("canvas.error")}),m.jsx("button",{type:"button",onClick:h,children:v("canvas.retry")})]}):null,u?m.jsx("div",{className:"canvas-frame",style:{width:`min(100%, ${B}px)`},children:m.jsx("iframe",{ref:x,title:E,sandbox:"",referrerPolicy:"no-referrer"})}):null]})]})}),document.body)}function xR(t){return t==="stable"?"canvas.stable":t==="failed"?"canvas.failed":"canvas.preview"}function ib(t,i,r){return`/dsh-bot/canvas-media/${t}/${i}/${r.split("/").map(a=>encodeURIComponent(a)).join("/")}`}function lb(t){return Array.isArray(t.canvases)?t.canvases.flatMap(i=>{if(!i||typeof i!="object")return[];const r=i;return typeof r.id!="string"?[]:[{id:r.id,title:typeof r.title=="string"?r.title:"",ticketId:typeof r.ticketId=="string"?r.ticketId:null,previewRevision:typeof r.previewRevision=="number"?r.previewRevision:null,stableRevision:typeof r.stableRevision=="number"?r.stableRevision:null}]}):[]}function rb(t){return Array.isArray(t.revisions)?t.revisions.flatMap(i=>{if(!i||typeof i!="object")return[];const r=i;if(typeof r.revision!="number")return[];const a=r.status==="stable"||r.status==="failed"?r.status:"preview";return[{revision:r.revision,kind:typeof r.kind=="string"?r.kind:"",status:a,entry:typeof r.entry=="string"?r.entry:null,error:typeof r.error=="string"?r.error:null}]}):[]}function wR(t){if(t.kind!=="snapshot"&&t.kind!=="delta"||typeof t.revision!="number"||typeof t.entry!="string"||!Array.isArray(t.manifest))return null;const i=t.manifest.flatMap(r=>{if(!r||typeof r!="object")return[];const a=r;return typeof a.path!="string"||typeof a.hash!="string"||typeof a.bytes!="number"?[]:typeof a.type!="string"?[]:[{path:a.path,hash:a.hash,bytes:a.bytes,type:a.type}]});return i.length!==t.manifest.length?null:{kind:t.kind,revision:t.revision,baseRevision:typeof t.baseRevision=="number"?t.baseRevision:null,entry:t.entry,manifest:i}}function vh({item:t,onOpen:i}){const{t:r}=Ke();return m.jsxs("button",{type:"button",className:"canvas-card","aria-haspopup":"dialog",onClick:i,children:[m.jsx("span",{children:t.title||r("canvas.card")}),m.jsx("small",{children:t.previewRevision!=null?r("canvas.revision",{revision:String(t.previewRevision)}):r("canvas.open")})]})}function SR({sessionId:t,pulse:i,tickets:r,children:a}){const{t:o}=Ke(),[u,c]=j.useState([]),[h,g]=j.useState(!1),[p,v]=j.useState(null),[y,w]=j.useState([]),[x,S]=j.useState(null),[T,C]=j.useState("idle"),[E,q]=j.useState(""),[B,ee]=j.useState(""),X=j.useRef(tb()),O=j.useRef(null),Y=j.useRef(0),K=u.find(xe=>xe.id===p)??null,se=K?.previewRevision??K?.stableRevision??null,_=j.useRef(async()=>{});j.useEffect(()=>{v(null),c([]),g(!1)},[t]),j.useEffect(()=>{if(!t)return;let xe=!1;const fe=async()=>{const ue=await Fe(`/canvas?sessionId=${encodeURIComponent(t)}`);if(!xe){if(ue.status!==200){g(!0);return}g(!1),c(lb(ue.body))}};fe();const re=window.setInterval(()=>{fe()},6e4);return()=>{xe=!0,window.clearInterval(re)}},[t,i]),j.useEffect(()=>{if(!p)return;let xe=!1;return Fe(`/canvas/${p}`).then(fe=>{xe||fe.status!==200||w(rb(fe.body))}),()=>{xe=!0}},[p,i,se]),j.useEffect(()=>{if(!(!p||se==null))return _.current(p,se),()=>{Y.current+=1}},[p,se]);async function G(xe,fe){const re=++Y.current;O.current!==xe&&(O.current=xe,X.current=tb(),ee("")),C("loading"),q("");const ue=await Fe(`/canvas/${xe}/token`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({revision:fe})});if(re!==Y.current)return;const ge=ue.body.token;if(ue.status!==200||typeof ge!="string"){C("error"),q(o("canvas.error"));return}const me=await Fe(`/canvas/${xe}/revisions/${fe}`);if(re!==Y.current)return;const A=me.status===200?wR(me.body):null;if(!A){C("error"),q(o("canvas.error"));return}const Ee=await gR(X.current,A,async Be=>{const M=await fetch(ib(ge,fe,Be),{credentials:"omit",cache:"no-store"});if(!M.ok)throw new Error(o("canvas.error"));return new Uint8Array(await M.arrayBuffer())});if(re===Y.current){if(!Ee.ok){X.current=Ee.cache,C("error"),q(o("canvas.error"));return}X.current=Ee.cache,ee(Be=>yR(Be,{ok:!0,src:ib(ge,A.revision,A.entry)})),S(A.revision),C("ready")}}_.current=G;const te=j.useMemo(()=>fR(u,r),[u,r]),Te=j.useMemo(()=>({byTicket:te.byTicket,loose:te.loose,open:xe=>v(xe)}),[te.byTicket,te.loose]);return m.jsxs(I0.Provider,{value:Te,children:[a,h?m.jsx("p",{className:"canvas-list-error",children:o("canvas.unavailable")}):null,K?m.jsx(bR,{title:K.title,revisions:y,activeRevision:x,phase:T,error:E,src:B,onSelect:xe=>{G(K.id,xe)},onRetry:()=>{x!=null?G(K.id,x):se!=null&&G(K.id,se)},onAdopt:()=>{x!=null&&Fe(`/canvas/${K.id}/adopt`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({revision:x})}).then(xe=>{xe.status===200&&(Fe(`/canvas/${K.id}`).then(fe=>{fe.status===200&&w(rb(fe.body))}),Fe(`/canvas?sessionId=${encodeURIComponent(t)}`).then(fe=>{fe.status===200&&c(lb(fe.body))}))})},onClose:()=>v(null)}):null]})}function Y0(t,i){return t==="workspace-write"?i("permission.preset.workspaceWrite"):t==="read-only"||t==="readonly"?i("permission.preset.readOnly"):t==="danger-full-access"?i("permission.preset.fullAccess"):t==="auto"?i("permission.preset.auto"):t}function ab(t,i,r){const a=Y0(t,r);return a!==t?a:i&&i!==""?i:t}function Xh({title:t,closeLabel:i,onClose:r,children:a,className:o}){j.useEffect(()=>{if(typeof document>"u")return;const c=document.body.style.overflow;document.body.style.overflow="hidden";const h=g=>{g.key==="Escape"&&r()};return document.addEventListener("keydown",h),()=>{document.body.style.overflow=c,document.removeEventListener("keydown",h)}},[r]);const u=m.jsxs("div",{className:o?`settings-drawer ${o}`:"settings-drawer",children:[m.jsx("div",{className:"settings-drawer-mask",onClick:r}),m.jsxs("div",{className:"settings-drawer-sheet",role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,children:[m.jsx("div",{className:"settings-drawer-handle","aria-hidden":"true"}),m.jsxs("div",{className:"settings-head",children:[m.jsx("h3",{children:t}),m.jsx("button",{type:"button",className:"user-question-skip",onClick:r,children:i})]}),m.jsx("div",{className:"settings-drawer-body",children:a})]})]});return typeof document>"u"||!document.body?u:Ds.createPortal(u,document.body)}function kR({sessionId:t,current:i,onClose:r,onChanged:a}){const{t:o}=Ke(),[u,c]=j.useState(null),[h,g]=j.useState(null),[p,v]=j.useState(""),[y,w]=j.useState(!1);j.useEffect(()=>{Fe(`/permissions?sessionId=${encodeURIComponent(t)}`).then(E=>c(E.body))},[t]);async function x(E){w(!0),v("");try{const q=await Fe("/permissions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:t,name:E})});if(q.status===200&&q.body.ok!==!1){c(q.body),g(null),typeof q.body.currentValue=="string"&&a?.(q.body.currentValue);return}v(typeof q.body.message=="string"?q.body.message:o("permission.failed"))}catch{v(o("permission.failed"))}finally{w(!1)}}function S(E){if(!(E.value===u?.currentValue||E.value==="custom")){if(E.value==="danger-full-access"||E.value==="auto"){g(E);return}x(E.value)}}const T=u?.options??[],C=T.find(E=>E.value===(u?.currentValue??i));return m.jsxs(Xh,{title:o("permission.title"),closeLabel:o("permission.close"),onClose:r,children:[u&&u.available===!1?m.jsx("p",{className:"user-question-hint",children:o("permission.unavailable")}):null,u?.currentValue||i?m.jsxs("p",{className:"user-question-hint",children:[o("permission.current"),":"," ",ab(u?.currentValue??i??"",C?.name,o)||"—"]}):null,m.jsx("ul",{className:"user-question-options",children:T.map(E=>m.jsx("li",{children:m.jsxs("button",{type:"button",className:E.value===u?.currentValue?"user-question-option selected":"user-question-option",disabled:y||E.value==="custom",onClick:()=>S(E),children:[m.jsx("span",{className:"user-question-option-label",children:ab(E.value,E.name,o)}),E.description?m.jsx("span",{className:"user-question-option-desc",children:E.description}):null]})},E.value))}),h?m.jsxs("div",{className:"settings-confirm",children:[m.jsx("p",{className:"user-question-text",children:o("permission.confirmTitle")}),m.jsx("p",{className:"user-question-hint",children:h.value==="auto"?o("permission.confirmAuto"):o("permission.confirmFull")}),m.jsxs("div",{className:"user-question-row",children:[m.jsx("button",{type:"button",className:"user-question-skip",disabled:y,onClick:()=>g(null),children:o("permission.cancel")}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:y,onClick:()=>{x(h.value)},children:o("permission.confirm")})]})]}):null,p?m.jsx("p",{className:"user-question-status exception",children:p}):null]})}function ER({onClose:t,authorization:i,catalog:r}){const{t:a}=Ke(),[o,u]=j.useState(!0),[c,h]=j.useState([]),[g,p]=j.useState([]),[v,y]=j.useState([]),[w,x]=j.useState({}),[S,T]=j.useState(""),[C,E]=j.useState(!1),[q]=j.useState(()=>C0(async()=>{const _=await Fe("/authorization");if(_.status!==200)throw new Error("Authorization catalog unavailable");return _.body})),B=r??q,ee=j.useRef(!0),X=j.useRef(0);async function O(_=!1){if(document.hidden)return;_&&B.invalidate();const G=++X.current;try{const te=await B.get();if(!ee.current||G!==X.current)return;u(te.available!==!1),h(Array.isArray(te.entries)?te.entries:[]),i||(p(Array.isArray(te.notices)?te.notices:[]),y(Array.isArray(te.prompts)?te.prompts:[]))}catch{ee.current&&G===X.current&&T(a("auth.failed"))}}j.useEffect(()=>{i&&(u(i.available!==!1),(Array.isArray(i.prompts)&&i.prompts.length>0||Array.isArray(i.inFlight)&&i.inFlight.length>0)&&E(!1),p(Array.isArray(i.notices)?i.notices:[]),y(Array.isArray(i.prompts)?i.prompts:[]))},[i]),j.useEffect(()=>{ee.current=!0,O();const _=()=>{document.hidden||O(!0)},G=window.setInterval(()=>{O()},3e4);return document.addEventListener("visibilitychange",_),()=>{ee.current=!1,X.current++,window.clearInterval(G),document.removeEventListener("visibilitychange",_)}},[B,i?.catalogRevision]);async function Y(_,G){E(!0),T("");try{const te=await Fe("/authorization/begin",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:_.key,method:G})});(te.status!==200||te.body.ok===!1)&&T(typeof te.body.message=="string"?te.body.message:a("auth.failed")),await O(!0)}catch{T(a("auth.failed"))}finally{E(!1)}}async function K(_,G=!1,te){E(!0),T("");try{const Te=await Fe("/authorization/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({promptId:_.promptId,value:G?void 0:te??w[_.promptId]??"",declined:G})});(Te.status!==200||Te.body.ok===!1)&&T(typeof Te.body.message=="string"?Te.body.message:a("auth.failed")),await O(!0)}catch{T(a("auth.failed"))}finally{E(!1)}}async function se(_){E(!0);try{await Fe("/authorization/cancel",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:_.key})}),await O(!0)}finally{E(!1)}}return m.jsxs(Xh,{title:a("auth.title"),closeLabel:a("auth.close"),onClose:t,children:[o?null:m.jsx("p",{className:"user-question-hint",children:a("auth.unavailable")}),o&&c.length===0&&v.length===0?m.jsx("p",{className:"user-question-hint",children:a("auth.empty")}):null,g.map((_,G)=>m.jsxs("p",{className:"user-question-hint",children:[_.message,_.code?` · ${_.code}`:"",_.url?m.jsxs(m.Fragment,{children:[" ",m.jsx("a",{href:_.url,target:"_blank",rel:"noreferrer",children:_.url})]}):null]},`${_.message}-${G}`)),v.map(_=>m.jsxs("article",{className:"user-question",children:[m.jsx("p",{className:"user-question-text",children:_.message}),_.kind==="select"?m.jsx("ul",{className:"user-question-options",children:(_.options??[]).map(G=>m.jsx("li",{children:m.jsxs("button",{type:"button",className:"user-question-option",disabled:C,onClick:()=>{K(_,!1,G.id)},children:[m.jsx("span",{className:"user-question-option-label",children:G.label}),G.description?m.jsx("span",{className:"user-question-option-desc",children:G.description}):null]})},G.id))}):_.kind==="secret"?m.jsxs("label",{className:"user-question-custom",children:[m.jsx("span",{className:"user-question-secret",children:a("auth.secretMask")}),m.jsx("input",{type:"text",className:"user-question-secret-input",autoComplete:"off",autoCorrect:"off",spellCheck:!1,value:w[_.promptId]??"",placeholder:_.placeholder,disabled:C,onChange:G=>x(te=>({...te,[_.promptId]:G.target.value}))})]}):m.jsx("label",{className:"user-question-custom",children:m.jsx("input",{type:"text",value:w[_.promptId]??"",placeholder:_.placeholder,disabled:C,onChange:G=>x(te=>({...te,[_.promptId]:G.target.value}))})}),m.jsxs("div",{className:"user-question-row",children:[m.jsx("button",{type:"button",className:"user-question-skip",disabled:C,onClick:()=>{K(_,!0)},children:a("auth.cancel")}),_.kind!=="select"?m.jsx("button",{type:"button",className:"user-question-submit",disabled:C||_.kind!=="secret"&&!(w[_.promptId]??"").trim(),onClick:()=>{K(_)},children:a("auth.writeVault")}):null]})]},_.promptId)),c.map(_=>{const G={..._,inFlight:_.inFlight||Array.isArray(i?.inFlight)&&i.inFlight.some(te=>JSON.stringify(te)===JSON.stringify(_.key))};return m.jsxs("article",{className:"user-question",children:[m.jsx("p",{className:"user-question-text",children:G.label}),m.jsxs("div",{className:"user-question-row",children:[G.methods.map(te=>m.jsx("button",{type:"button",className:"user-question-submit",disabled:C||G.inFlight,onClick:()=>{Y(G,te.id)},children:te.label||a("auth.start")},te.id)),G.inFlight?m.jsx("button",{type:"button",className:"user-question-skip",disabled:C,onClick:()=>{se(G)},children:a("auth.cancel")}):null]})]},JSON.stringify(G.key))}),S?m.jsx("p",{className:"user-question-status exception",children:S}):null]})}function TR({onClose:t}){const{t:i,locale:r}=Ke(),[a,o]=j.useState(!1),[u,c]=j.useState(!1),[h,g]=j.useState(null),[p,v]=j.useState([]),[y,w]=j.useState([]),[x,S]=j.useState(""),[T,C]=j.useState(!1);async function E(){const B=await Fe(`/cua?locale=${encodeURIComponent(r)}`);c(!0),o(B.body.available===!0);const ee=B.body.systemStatus;g(ee&&typeof ee=="object"?ee:null);const X=B.body.applications;if(X&&typeof X=="object"){const O=X;v(Array.isArray(O.allowedApps)?O.allowedApps:[]),w(Array.isArray(O.blockedApps)?O.blockedApps:[])}}j.useEffect(()=>{E()},[r]);async function q(B,ee={}){C(!0),S("");try{const X=await Fe("/cua",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:B,locale:r,...ee})});(X.status!==200||X.body.ok===!1)&&S(typeof X.body.message=="string"?X.body.message:i("cua.failed")),await E()}catch{S(i("cua.failed"))}finally{C(!1)}}return u&&!a?null:m.jsxs(Xh,{title:i("cua.title"),closeLabel:i("cua.close"),onClose:t,children:[m.jsx("h4",{className:"user-question-header",children:i("cua.system")}),["accessibility","screenRecording"].map(B=>m.jsxs("div",{className:"user-question-row",children:[m.jsxs("p",{className:"user-question-text",children:[i(B==="accessibility"?"cua.accessibility":"cua.screenRecording"),m.jsx("span",{className:"user-question-hint",children:h?.[B]?i("cua.granted"):i("cua.missing")})]}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:T,onClick:()=>{q("requestPermission",{permission:B})},children:i("cua.request")}),m.jsx("button",{type:"button",className:"user-question-skip",disabled:T,onClick:()=>{q("openSettings",{permission:B})},children:i("cua.openSettings")})]},B)),m.jsx("h4",{className:"user-question-header",children:i("cua.grants")}),p.length===0?m.jsx("p",{className:"user-question-hint",children:i("cua.emptyGrants")}):null,p.map(B=>m.jsxs("div",{className:"user-question-row",children:[m.jsx("p",{className:"user-question-text",children:B.name}),m.jsx("button",{type:"button",className:"user-question-skip",disabled:T,onClick:()=>{q("revoke",{id:B.id})},children:i("cua.revoke")})]},B.id)),m.jsx("h4",{className:"user-question-header",children:i("cua.blocked")}),y.length===0?m.jsx("p",{className:"user-question-hint",children:i("cua.emptyBlocked")}):null,y.map(B=>m.jsxs("div",{className:"user-question-row",children:[m.jsx("p",{className:"user-question-text",children:B.name}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:T,onClick:()=>{q("retryApproval",{id:B.id})},children:i("cua.askAgain")})]},B.id)),x?m.jsx("p",{className:"user-question-status exception",children:x}):null]})}function jR(t){const i=[],r=new Set;for(const a of t){if(a.kind==="user"){i.push({id:a.id});continue}const o=a.turn??-1;r.has(o)||(r.add(o),i.push({id:`turn:${o}`}))}return i}function F0(t){return Array.isArray(t)?t.filter(i=>i?.type==="text"&&typeof i.text=="string").map(i=>i.text??"").join(`
55
- `).trim():""}function Zh(t){const i=t.message;return i&&typeof i=="object"?i:Array.isArray(t.content)||typeof t.toolCallId=="string"?t:null}function qu(t){if(typeof t=="string")return t;if(t&&typeof t=="object")try{return JSON.stringify(t)}catch{return""}return""}function ot(t){return typeof t=="number"?t:void 0}function CR(t){if(!t||typeof t!="object")return null;const i=t;if(i.kind==="error"){const r=typeof i.error?.message=="string"&&i.error.message!==""?i.error.message:"This turn failed",a=typeof i.error?.code=="string"?i.error.code:void 0;return{message:r,...a?{code:a}:{}}}return i.kind==="interrupted"?{message:"The DSH process exited before this turn finished.",code:"INTERRUPTED"}:i.kind==="aborted"&&i.reason?.kind==="hook"&&i.reason.reason==="deepseek-account/signed-out"?{message:"Stopped because you signed out of DeepSeek.",code:"ACCOUNT_SIGNED_OUT"}:null}function Pu(t,i){return`${t??""}:${i??""}`}function _s(t){return t.sort((i,r)=>i.seq-r.seq)}function NR(t,i){const r=t.findIndex(a=>a.kind==="user"&&a.optimistic&&a.text.trim()===i.text.trim());if(r>=0){const a=t.slice(),o=a[r];return!o||o.kind!=="user"?t:(a[r]={...o,optimistic:!1,time:i.time??o.time,seq:i.seq,turn:i.turn},a)}return _s([...t,i])}function AR(t,i){const r=i.trim();if(!r)return"";try{const a=JSON.parse(r),o=typeof a.command=="string"?a.command:"",u=typeof a.description=="string"?a.description:"",c=["path","file_path","file","target_file","target"].map(g=>a[g]).find(g=>typeof g=="string"),h=typeof a.query=="string"?a.query:typeof a.pattern=="string"?a.pattern:typeof a.prompt=="string"?a.prompt:"";return(o||(typeof c=="string"?c:"")||h||u||t).replace(/\s+/g," ").trim()}catch{return r.replace(/\s+/g," ").trim()}}function G0(t){const i=[];let r=[],a=0;const o=()=>{r.length!==0&&(i.push({type:"activity",id:`activity:${a++}`,segments:r}),r=[])};for(const u of t)u.kind==="assistant"?(o(),i.push({type:"text",segment:u})):u.kind==="tool"&&A0(u.name)?(o(),i.push({type:"question",segment:u})):(u.kind==="think"||u.kind==="tool")&&r.push(u);return o(),i}function OR(t){let i;try{const o=JSON.parse(t.args);if(!o||typeof o!="object")return null;i=o}catch{return null}const r=t.name.toLowerCase(),a=RR(i,["file_path","path","file"]);if(!a)return null;if(r==="write"){const o=typeof i.content=="string"?i.content:"",u=Du(o).map(c=>({kind:"add",text:c}));return sb(a,o.length,u,u.length,0)}if(r==="edit"||r==="apply_patch"||r==="str_replace_editor"){const o=typeof i.old_string=="string"?i.old_string:typeof i.old_str=="string"?i.old_str:null,u=typeof i.new_string=="string"?i.new_string:typeof i.new_str=="string"?i.new_str:typeof i.content=="string"?i.content:typeof i.file_text=="string"?i.file_text:"",c=o==null||o===""?Du(u).map(p=>({kind:"add",text:p})):_R(o,u),h=c.filter(p=>p.kind==="add").length,g=c.filter(p=>p.kind==="del").length;return sb(a,u.length,c,h,g)}return null}function sb(t,i,r,a,o){const u=t.split("/").filter(Boolean).at(-1)??t;return{path:t,name:u,language:zR(u),kilobytes:Math.max(1,Math.ceil(i/1024)),added:a,removed:o,lines:r}}function RR(t,i){for(const r of i){const a=t[r];if(typeof a=="string"&&a.trim())return a.trim()}return""}function Du(t){return t===""?[]:(t.endsWith(`
56
- `)?t.slice(0,-1):t).split(`
57
- `)}function _R(t,i){const r=Du(t),a=Du(i);if(r.length>180||a.length>180)return[...r.map(v=>({kind:"del",text:v})),...a.map(v=>({kind:"add",text:v}))];const o=r.length+1,u=a.length+1,c=Array.from({length:o},()=>Array(u).fill(0));for(let v=r.length-1;v>=0;v-=1)for(let y=a.length-1;y>=0;y-=1){const w=c[v],x=c[v+1];!w||!x||(w[y]=r[v]===a[y]?(x[y+1]??0)+1:Math.max(x[y]??0,w[y+1]??0))}const h=[];let g=0,p=0;for(;g<r.length&&p<a.length;)r[g]===a[p]?(h.push({kind:"context",text:r[g]??""}),g+=1,p+=1):(c[g+1]?.[p]??0)>=(c[g]?.[p+1]??0)?(h.push({kind:"del",text:r[g]??""}),g+=1):(h.push({kind:"add",text:a[p]??""}),p+=1);for(;g<r.length;)h.push({kind:"del",text:r[g]??""}),g+=1;for(;p<a.length;)h.push({kind:"add",text:a[p]??""}),p+=1;return h}function zR(t){const i=t.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"}[i]??""}function MR(t){return(t.split(`
58
- `).map(r=>r.trim()).find(Boolean)??"").replaceAll("**","")}function Q0(t,i){const r=t.findIndex(y=>y.kind==="tool"&&y.callId===i.callId);if(r<0)return _s([...t,i]);const a=t[r];if(!a||a.kind!=="tool")return t;const o=t.slice(),u=a.resultReceived===!0||i.resultReceived===!0,h=i.resultReceived&&(!a.resultReceived||(i.resultSeq??-1)>(a.resultSeq??-1))?i:a,p=i.callReceived&&(!a.callReceived||(i.callSeq??-1)>(a.callSeq??-1))?i:a,v=(p.name!=="tool"?p.name:i.name)||a.name;return o[r]={...a,seq:!a.callReceived&&a.resultReceived&&i.callReceived?Math.min(a.seq,i.seq):a.seq,id:`tool:${i.callId}`,name:v,args:p.callReceived?p.args:i.args||a.args,callReceived:a.callReceived||i.callReceived,callSeq:p.callSeq,requestedAt:p.requestedAt,resultReceived:u,result:u?h.result:"",error:u?h.error:!1,errorCode:h.errorCode,meta:h.meta,resultSeq:h.resultSeq,settledAt:h.settledAt,status:u?Ju(v,h.result,h.error,h.errorCode):i.status??a.status,running:!u&&(i.running||a.running),turn:a.turn??i.turn,step:a.step??i.step},_s(o)}function qR(t,i,r,a,o,u){const c=`live:${i}:`,h=t.segments.filter(v=>v.id.startsWith(c));let g=t.segments.filter(v=>!v.id.startsWith(c)||v.kind==="tool"&&(v.callReceived||v.resultReceived));const p=[];for(const v of r){const y=a+v.index/100;if(v.kind==="reasoning"&&v.text.trim())p.push({kind:"think",id:`${c}think:${v.index}`,text:v.text,running:!0,seq:y,turn:o,step:u});else if(v.kind==="text"&&v.text)p.push({kind:"assistant",id:`${c}text:${v.index}`,text:v.text,streaming:!0,seq:y,turn:o,step:u});else if(v.kind==="tool-call"&&(v.name||v.args||v.id)){const w=v.id||`${c}tool:${v.index}`,x=[...g,...h].find(T=>T.kind==="tool"&&T.callId===w),S=g.findIndex(T=>T.kind==="tool"&&T.callId===w);if(S>=0){const T=g[S];if(T&&T.kind==="tool"&&!T.callReceived&&!T.resultReceived){const C=g.slice();C[S]={...T,name:v.name||T.name,args:v.args||T.args,running:T.resultReceived?!1:T.running,status:T.resultReceived||T.callReceived?T.status:"preparing"},g=C}}else p.push({kind:"tool",id:`${c}tool:${v.index}`,callId:w,name:v.name||x?.name||"tool",args:v.args||x?.args||"",result:x?.result??"",error:x?.error??!1,running:!x?.resultReceived,status:x?.status??"preparing",resultReceived:x?.resultReceived,seq:x?.seq??y,turn:o,step:u})}}return _s([...g,...p])}function X0(t,i,r){const a=t.find(o=>o.index===i);return a?a.kind===r?t:t.map(o=>o.index===i?{...o,kind:r}:o):[...t,{index:i,kind:r,text:"",id:"",name:"",args:""}].sort((o,u)=>o.index-u.index)}function bu(t,i,r,a){return X0(t,i,r).map(u=>u.index===i?a({...u,kind:r}):u)}function DR(t,i){const r=ot(i.index)??0,a=typeof i.type=="string"?i.type:"";if(a==="block-start"){const o=i.blockType==="reasoning"||i.blockType==="tool-call"||i.blockType==="text"?i.blockType:"text";return X0(t,r,o)}if(a==="text-delta"||a==="text-chunks"){const o=typeof i.text=="string"?i.text:ob(i.texts);return bu(t,r,"text",u=>({...u,text:u.text+o}))}if(a==="reasoning-delta"||a==="reasoning-chunks"){const o=typeof i.text=="string"?i.text:ob(i.texts);return bu(t,r,"reasoning",u=>({...u,text:u.text+o}))}if(a==="tool-call-delta"||a==="tool-call-chunks"){const o=typeof i.argumentsDelta=="string"?i.argumentsDelta:qu(i.args??i.arguments);return bu(t,r,"tool-call",u=>({...u,id:typeof i.id=="string"&&i.id?i.id:u.id,name:typeof i.name=="string"&&i.name?i.name:u.name,args:a==="tool-call-chunks"&&o?o:u.args+o}))}if(a==="block-end"&&i.block&&typeof i.block=="object"){const o=i.block,u=o.type==="reasoning"||o.type==="tool-call"||o.type==="text"?o.type:"text";return bu(t,r,u,c=>({...c,kind:u,text:typeof o.text=="string"?o.text:c.text,id:o.id||c.id,name:o.name||c.name,args:qu(o.arguments)||c.args}))}return t}function ob(t){return Array.isArray(t)?t.filter(i=>typeof i=="string").join(""):""}function Z0(t,i){const r=i.data??{},a=r.chunk;if(!a||typeof a!="object")return t;const o=ot(r.turn),u=ot(r.step),c=Pu(o,u),h=t.live[c]??{seq:i.seq??0,blocks:[]},g=DR(h.blocks,a),p={...t.live,[c]:{seq:h.seq||i.seq||0,blocks:g}},v=h.seq||i.seq||0;return{...t,live:p,drafting:!0,turn:o??t.turn,segments:qR({...t},c,g,v,o,u)}}function K0(t,i){const r=i.data??{},a=Zh(r),o=a?.content??[],u=ot(r.turn),c=ot(r.step),h=Pu(u,c),g={...t.live};delete g[h];let p=t.segments.filter(y=>!y.id.startsWith(`live:${h}:`));p=p.filter(y=>!((y.kind==="think"||y.kind==="assistant")&&y.turn===u&&y.step===c));const v=i.seq??0;return o.forEach((y,w)=>{const x=v+w/100;if(y.type==="reasoning"&&y.text?.trim())p.push({kind:"think",id:`think:${h}:${w}`,text:y.text,running:!1,seq:x,turn:u,step:c});else if(y.type==="text"&&y.text)p.push({kind:"assistant",id:`text:${h}:${w}`,text:y.text,streaming:!1,time:i.time,seq:x,turn:u,step:c,messageId:a?.id});else if(y.type==="tool-call"){const S=y.id||`call:${h}:${w}`,T=p.find(C=>C.kind==="tool"&&C.callId===S);p=p.filter(C=>!(C.kind==="tool"&&C.callId===S)),p.push({...T?.kind==="tool"?T:{},kind:"tool",id:`tool:${S}`,callId:S,name:T?.kind==="tool"&&T.callReceived?T.name:y.name||(T?.kind==="tool"?T.name:"")||"tool",args:T?.kind==="tool"&&T.callReceived?T.args:qu(y.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?Ju(y.name||T.name,T.result,T.error,T.errorCode):T.status:"preparing",seq:x,turn:u,step:c})}}),{...t,live:g,segments:_s(p)}}function LR(t,i){const r=i.data??{},a=typeof r.callId=="string"?r.callId:"";if(!a)return t;const o=ot(r.turn),u=ot(r.step);return{...t,segments:Q0(t.segments,{kind:"tool",id:`tool:${a}`,callId:a,name:typeof r.name=="string"?r.name:"tool",args:qu(r.arguments),status:t.turnEnds?.[o??-1]?"unknown":"waiting",callReceived:!0,callSeq:i.seq,requestedAt:i.time,result:"",error:!1,running:!0,seq:i.seq??Number.MAX_SAFE_INTEGER,turn:o,step:u})}}function BR(t,i){const r=i.data??{},a=Zh(r),o=a?.toolCallId??(typeof r.callId=="string"?r.callId:"");if(!o)return t;const u=F0(a?.content),c=ot(r.turn),h=ot(r.step),g=t.segments.find(p=>p.kind==="tool"&&p.callId===o);return{...t,segments:Q0(t.segments,{kind:"tool",id:`tool:${o}`,callId:o,name:g?.kind==="tool"?g.name:"tool",args:g?.kind==="tool"?g.args:"",result:u,resultReceived:!0,resultSeq:i.seq,settledAt:i.time,meta:r.meta,errorCode:typeof r.error?.code=="string"?r.error.code:void 0,status:Ju(g?.kind==="tool"?g.name:"tool",u,a?.isError===!0,typeof r.error?.code=="string"?r.error.code:void 0),error:a?.isError===!0,running:!1,seq:g?.seq??i.seq??Number.MAX_SAFE_INTEGER,turn:c??(g?.kind==="tool"?g.turn:void 0),step:h??(g?.kind==="tool"?g.step:void 0)})}}function UR(t){if(!t||typeof t!="object")return null;const i=t,r=i.value;if(r&&typeof r=="object"&&!Array.isArray(r)){const a=r;if(typeof a.type=="string")return a}return typeof i.type=="string"?i:null}function $0(t,i){let r=i;for(const a of t.segments)a.seq>r&&(r=a.seq);return r+.5}function HR(t){if(!Array.isArray(t))return[];const i=[];for(const r of t){if(!r||typeof r!="object")continue;const a=r;if(a.type==="chunk"&&a.chunk&&typeof a.chunk=="object"){i.push({time:ot(a.time)??0,chunk:a.chunk});continue}const o=ot(a.index)??0,u=Array.isArray(a.texts)?a.texts:Array.isArray(a.args)?a.args:null;if(!u)continue;let c=ot(a.time0)??0;const h=Array.isArray(a.dt)?a.dt:[];u.forEach((g,p)=>{p>0&&(c+=ot(h[p-1])??0);const v=typeof g=="string"?g:"";a.type==="text-chunks"?i.push({time:c,chunk:{type:"text-delta",index:o,text:v}}):a.type==="reasoning-chunks"?i.push({time:c,chunk:{type:"reasoning-delta",index:o,text:v}}):a.type==="tool-call-chunks"&&i.push({time:c,chunk:{type:"tool-call-delta",index:o,id:typeof a.id=="string"?a.id:"",...typeof a.name=="string"?{name:a.name}:{},argumentsDelta:v}})})}return i}function J0(t,i,r,a,o,u){return Z0(t,{seq:u,data:{turn:i,step:r,chunk:o}})}function bh(t,i,r,a=!1){const o=Pu(i,r),u={...t.live};return delete u[o],{...t,live:u,segments:t.segments.filter(c=>c.id.startsWith(`live:${o}:`)?c.kind==="tool"&&(c.callReceived===!0||c.resultReceived===!0):!(a&&c.kind!=="user"&&c.turn===i&&c.step===r&&(c.kind==="assistant"||c.kind==="think")))}}function IR(t,i){const r=t.streamAttempt;if(!r||i.surfaceOp!=null&&i.surfaceOp!=="append")return!1;const a=i.data??{};return ot(a.turn)!==r.turn||ot(a.step)!==r.step?!1:i.seq==null||i.seq>r.startedAfterSeq}function ws(t){const i=t.pendingAssistant;return{...i?K0(t,i):t,pendingAssistant:null,streamAttempt:null}}function VR(t,i,r){return{...t,streamAttempt:null,pendingAssistant:null,segments:t.segments.map(a=>a.kind==="user"||a.turn!==i||a.step!==r?a:a.kind==="think"?{...a,running:!1}:a.kind==="tool"?{...a,running:!1,status:a.resultReceived||!N0.has(Gh(a))?a.status:"unknown"}:a.kind==="assistant"?{...a,streaming:!1}:a)}}function P0(t,i,r){return!!t.turnEnds?.[i]||t.segments.some(a=>a.kind!=="user"&&a.turn===i&&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 YR(t,i){const r=ot(i.revision)??t.streamRevision;if(r<t.streamRevision)return t;let a={...t,streamRevision:r};const o=i.activeAttempt;if(!o||typeof o!="object")return{...a,streamAttempt:null};const u=o,c=typeof u.attemptId=="string"?u.attemptId:"",h=ot(u.turn),g=ot(u.step),p=ot(u.startedAfterSeq)??r;if(!c||h==null||g==null)return{...a,streamAttempt:null};if(P0(a,h,g))return{...a,streamAttempt:null};a=bh(a,h,g);const v=HR(u.stream),y=Math.min(ot(u.nextIndex)??v.length,v.length),w=$0(a,p);for(let x=0;x<y;x+=1){const S=v[x];S&&(a=J0(a,h,g,S.time,S.chunk,w))}return{...a,drafting:y>0||a.drafting,streamAttempt:{attemptId:c,turn:h,step:g,nextIndex:y,startedAfterSeq:p}}}function FR(t,i){const r=typeof i.type=="string"?i.type:"",a=ot(i.revision),o=typeof i.attemptId=="string"?i.attemptId:"";if(a==null||!o||a<=t.streamRevision)return t;if(r==="start"){const c=ot(i.turn),h=ot(i.step);if(c==null||h==null||P0(t,c,h))return t;const g=t.pendingAssistant?ws(t):t;return{...bh(g,c,h,!0),drafting:!0,streamRevision:a,streamAttempt:{attemptId:o,turn:c,step:h,nextIndex:0,startedAfterSeq:ot(i.startedAfterSeq)??t.streamRevision}}}if(a!==t.streamRevision+1)return{...ws(t),streamRevision:a};const u=t.streamAttempt;if(!u||t.turnEnds?.[u.turn]||u.attemptId!==o)return{...t,streamRevision:a};if(r==="chunk"){const c=ot(i.index),h=i.chunk;if(c==null||!h||typeof h!="object")return{...t,streamRevision:a};if(c!==u.nextIndex)return{...ws(t),streamRevision:a};const g=Pu(u.turn,u.step),p=t.live[g]?.seq||$0(t,u.startedAfterSeq);return{...J0(t,u.turn,u.step,ot(i.time)??0,h,p),streamRevision:a,streamAttempt:{...u,nextIndex:u.nextIndex+1}}}if(r==="end"){const c=i.outcome&&typeof i.outcome=="object"?i.outcome:{},h={...t,streamRevision:a};if(c.kind==="abandoned"){const g={...h,segments:h.segments.map(v=>v.kind==="tool"&&!v.callReceived&&!v.resultReceived&&v.turn===u.turn&&v.step===u.step?{...v,id:`tool:${v.callId}`,running:!1,status:"cancelled"}:v)};return{...bh(g,u.turn,u.step),streamAttempt:null,pendingAssistant:null}}return c.kind==="committed"&&c.eventType==="assistant/message"?{...ws(h),streamRevision:a}:{...VR(h,u.turn,u.step),streamRevision:a}}return{...t,streamRevision:a}}function GR(t,i,r=!1){const a=ot(t.pendingAssistant?.data?.turn),o=t.pendingAssistant&&(i==null||a===i)?ws(t):t,u=Object.fromEntries(Object.entries(o.live).filter(([c])=>!c.startsWith(`${i??""}:`)));return{...o,live:u,segments:o.segments.filter(c=>!(typeof i=="number"&&c.id.startsWith(`live:${i}:`))||c.kind==="tool").map(c=>c.turn!==i?c:c.kind==="think"?{...c,running:!1}:c.kind==="tool"?{...c,running:!1,status:c.resultReceived||!N0.has(Gh(c))?c.status:r&&!c.callReceived?"cancelled":"unknown"}:c.kind==="assistant"?{...c,streaming:!1}:c)}}function QR(t,i){const r=i.projections,a=r&&typeof r=="object"?r.values??{}:{},o={...t};typeof a.title=="string"&&(o.title=a.title);const u=a.modelSelection&&typeof a.modelSelection=="object"?a.modelSelection.lastUsed:void 0;u?.model&&(o.model=u.model);const c=a.permissions;if(c&&typeof c=="object"){const g=c,p=g.currentValue??g.preset??g.sandbox;typeof p=="string"&&(o.preset=p)}const h=a.sessionStats;if(h&&typeof h=="object"){const g=h.turns,p=h.steps;typeof g=="number"&&(o.turns=g),typeof p=="number"&&(o.steps=p)}return o}function XR(t,i){if(typeof i.type!="string")return t;let r=t;const a=i.data??{};if(i.type==="session/title"&&typeof a.title=="string"){const o=a.source&&typeof a.source=="object"?a.source.kind:"";return r.title&&o!=="provider"||(r={...r,title:a.title}),r}if(i.type==="request/context"){const o=typeof a.model=="string"?a.model:"";return o&&(r={...r,model:o}),r}if(i.type==="turn/start"){const o=ot(a.turn);return r={...r,drafting:!0,turn:o??r.turn,turnStartedAt:typeof i.time=="number"?i.time:Date.now()},r}if(i.type==="turn/end"){const o=ot(a.turn)??r.turn,u={...r.completed};o!=null&&r.turn===o&&r.turnStartedAt!=null&&typeof i.time=="number"&&(u[o]=Math.max(1,Math.round((i.time-r.turnStartedAt)/1e3)));const c=o==null?null:CR(a.reason),h=c==null||o==null?r.failures:{...r.failures,[o]:c},g=a.reason&&typeof a.reason=="object"&&typeof a.reason.kind=="string"?a.reason.kind:"",p=o==null?r.turnEnds??{}:{...r.turnEnds??{},[o]:g||r.turnEnds?.[o]||"ended"};return r=GR(r,o,g==="aborted"),r={...r,drafting:r.turn===o?!1:r.drafting,completed:u,failures:h,turnEnds:p,turnStartedAt:r.turn===o?null:r.turnStartedAt},r}if(i.type==="llm/retry"){const o=ot(a.turn),u=typeof a.retryId=="string"?a.retryId:"",c=ot(a.retry);if(o==null||u===""||c==null)return r;const h=a.failure&&typeof a.failure=="object"?a.failure:{},g={retryId:u,retry:c,maxRetries:ot(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[o]??[];return r={...r,retries:{...r.retries,[o]:[...p.filter(v=>v.retryId!==u||v.retry!==c),g]}},r}if(i.type==="llm/retry-started"){const o=ot(a.turn),u=typeof a.retryId=="string"?a.retryId:"",c=ot(a.retry);if(o==null||u===""||c==null)return r;const h=r.retries[o];return h&&(r={...r,retries:{...r.retries,[o]:h.map(g=>g.retryId===u&&g.retry===c?{...g,state:"started"}:g)}}),r}if(i.type==="assistant/live-chunk")return r=Z0(r,i),r;if(i.type==="user/message"){const o=Zh(a);if(!o||o.source?.kind!=="user")return r;const u=F0(o.content);return u&&(r={...r,segments:NR(r.segments,{kind:"user",id:`user:${i.seq??u}`,text:u,time:i.time,seq:i.seq??Number.MAX_SAFE_INTEGER,turn:ot(a.turn)})}),r}return i.type==="assistant/message"?(IR(r,i)?r={...r,pendingAssistant:i}:r=K0(r,i),r):i.type==="tool/call"?(r=LR(r,i),r):(i.type==="tool/result"&&(r=BR(r,i)),r)}function ZR(t,i){const r=UR(i)??(i&&typeof i=="object"?i:null);if(!r)return t;let a=t;if(r.type==="snapshot"){a=QR(a,r);const o=r.assistantStream;o&&typeof o=="object"&&(a=YR(a,o))}if(r.type==="assistant-stream"){const o=r.frame;o&&typeof o=="object"&&(a=FR(a,o))}return a}function KR(t){for(let i=t.length-1;i>=0;i-=1){const r=t[i];if(!r||r.kind==="user"&&Pb(r.text))continue;const a=r.kind==="user"?$u(r.text):null,o=r.kind==="user"?Sh(r.text):null,c=(a?a.body:o?.body?o.body:r.kind==="user"||r.kind==="assistant"?r.text:r.kind==="tool"?r.result||AR(r.name,r.args):MR(r.text)).replace(/```[\s\S]*?```/g," ").replace(/^#{1,6}\s+/gm,"").replace(/[|*_`>]/g," ").replace(/\s+/g," ").trim();if(c)return c.slice(0,80)}return""}function Lu(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function ub(t,i){if(!Lu(t))return;if(i==="ticket.id"){const a=t.ticket;if(!Lu(a))return;const o=a.id;return typeof o=="string"&&o!==""?o:void 0}const r=t[i];if(typeof r=="string"&&r!=="")return r;if(typeof r=="number"&&Number.isFinite(r))return String(r)}function zs(t,i){if(!Lu(i)||i.t!=="v"&&i.t!=="o"&&i.t!=="l")return t;const r=i;return r.t==="v"?r.v:r.t==="o"?$R(t,r):JR(t,r)}function $R(t,i){const r=Lu(t)?{...t}:{};for(const a of i.d??[])delete r[a];for(const[a,o]of Object.entries(i.s))r[a]=zs(r[a],o);return r}function JR(t,i){const r=i.id,a=Array.isArray(t)?t.slice():[],o=new Set(i.d??[]),u=[],c=new Map;for(const g of a){const p=ub(g,r);p!==void 0&&o.has(p)||(p!==void 0&&c.set(p,u.length),u.push(g))}for(const[g,p]of Object.entries(i.s??{})){const v=c.get(g);if(v===void 0){u.push(zs(void 0,p));continue}u[v]=zs(u[v],p)}if(!i.order)return u;const h=new Map;for(const g of u){const p=ub(g,r);p!==void 0&&h.set(p,g)}return i.order.filter(g=>h.has(g)).map(g=>h.get(g))}const PR=1,WR=500,e3={minMessages:50,minTurns:2},t3=500,n3=2e3,i3=256*1024,l3=6,r3=3,a3=5e3,s3=8*1024*1024,o3=2e3,u3=500,c3=1e4,Qd=3,W0=64*1024*1024,e1="/api/dsh-bot/log/range",f3="/api/dsh-bot/log/manifest",d3="/api/dsh-bot/log/chunk",h3="/api/session/events",m3=3e3,p3=3e4,g3=1e3,y3=15e3;class v3{appliedSeq;headSeq=null;pending=new Map;pendingBytes=0;constructor(i=-1){this.appliedSeq=i}setHead(i){(this.headSeq==null||i>this.headSeq)&&(this.headSeq=i)}push(i){const r=[];for(const u of i)if(!(typeof u.seq!="number"||!Number.isFinite(u.seq))&&!(u.seq<=this.appliedSeq)){if(u.seq===this.appliedSeq+1){r.push(u),this.appliedSeq=u.seq,this.flushPending(r);continue}this.pending.has(u.seq)||(this.pending.set(u.seq,u),this.pendingBytes+=cb(u))}let a=null;(this.pending.size>a3||this.pendingBytes>s3)&&(a={afterSeq:this.appliedSeq,dropped:this.pending.size},this.pending.clear(),this.pendingBytes=0);const o=this.nextGap();return{delivered:r,gapTo:o,overflow:a}}flushPending(i){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-cb(r)),i.push(r),this.appliedSeq=r.seq}}nextGap(){if(this.pending.size===0)return null;let i=Number.POSITIVE_INFINITY;for(const r of this.pending.keys())r<i&&(i=r);return Number.isFinite(i)?i:null}}function cb(t){return 64+(typeof t.type=="string"?t.type.length:0)}function fa(t,i){return{kind:"session",sessionId:t}}function fb(t){const i=t.addressOf??(a=>fa(a)),r=t.openingMessages??PR;return{kind:"ws-follow",open(a,o,u){return new Promise(c=>{const h=typeof location<"u"&&location.protocol==="https:"?"wss:":"ws:",g=typeof location<"u"?location.host:"127.0.0.1",p=t.url??`${h}//${g}/api/remote.mux`,v=(t.websocket??(C=>new WebSocket(C)))(p),y=`follow-${Math.random().toString(36).slice(2)}`;let w=!1;const x=()=>!w&&v.readyState===1,S=C=>{if(!w){w=!0,u.removeEventListener("abort",T);try{v.close()}catch{}c(C)}},T=()=>S({ok:!1,retryable:!1,code:"ABORTED"});u.addEventListener("abort",T),v.addEventListener("open",()=>{u.aborted||v.send(JSON.stringify({type:"open",streamId:y,endpoint:"session/follow",payload:{args:{request:{address:i(a.sessionId),maxMessages:r,assistantStream:!0,activate:!0}}}}))}),v.addEventListener("message",C=>{let E;try{E=JSON.parse(String(C.data))}catch{return}if(E.streamId===y){if(E.type==="error"){S({ok:!1,retryable:!0,code:"FOLLOW_ERROR",message:E.error?.message});return}if(E.type==="end"){S({ok:!0,throughSeq:-1});return}E.type==="item"&&b3(E.value,o,x)}}),v.addEventListener("close",()=>S({ok:!1,retryable:!0,code:"FOLLOW_CLOSED"})),v.addEventListener("error",()=>S({ok:!1,retryable:!0,code:"FOLLOW_ERROR"}))})}}}function b3(t,i,r){const a=t1(t);if(!a)return;if(a.type==="snapshot"){const u=typeof a.cursor=="number"?a.cursor:-1,c=Ms(a.records),h=c.length>0?Math.min(...c.map(p=>p.seq)):u+1,g=a.hasMore===!0;i.opened({firstSeq:h,cursor:u,hasMore:g,...r?{alive:r}:{}}),i.head(u),c.length&&i.events(c),i.ephemeral(a);return}if(a.type==="assistant-stream"){i.ephemeral(a);return}const o=Ms(a);o.length&&i.events(o)}function t1(t){if(!t||typeof t!="object")return null;const i=t;if(typeof i.type=="string"&&(i.type==="snapshot"||i.type==="assistant-stream"||i.type==="event"))return i;const r=i.value;return r&&typeof r=="object"&&!Array.isArray(r)?t1(r):i}function Ms(t){const i=[];return Eu(t,i),i.sort((r,a)=>r.seq-a.seq)}function Eu(t,i){if(!t)return;if(Array.isArray(t)){for(const o of t)Eu(o,i);return}if(typeof t!="object")return;const r=t;if(r.event&&typeof r.event=="object"){const o=db(r.event);o&&i.push(o);return}const a=db(r);a&&i.push(a),Array.isArray(r.records)&&Eu(r.records,i),Array.isArray(r.events)&&Eu(r.events,i)}function db(t){if(!t||typeof t!="object")return null;const i=t;return typeof i.type!="string"||typeof i.seq!="number"?null:{type:i.type,seq:i.seq,time:typeof i.time=="number"?i.time:0,data:i.data,...i.surfaceOp!==void 0?{surfaceOp:i.surfaceOp}:{},...i.sourceEventSeqs!==void 0?{sourceEventSeqs:i.sourceEventSeqs}:{}}}function hb(t={}){const i=t.fetch??fetch,r=t.url??e1;return{kind:"plugin-range",async fetch(a,o,u){if(a.throughSeq<=a.afterSeq)return{ok:!0,throughSeq:a.throughSeq};let c=a.afterSeq;try{for(;!u.aborted;){const h=new URLSearchParams({sessionId:a.sessionId,afterSeq:String(c),throughSeq:String(a.throughSeq),limit:String(t3)}),g=await i(`${r}?${h}`,{method:"GET",credentials:"same-origin",signal:u,headers:{accept:"application/json"}});if(g.status===404)return{ok:!1,retryable:!1,code:"ENHANCE_UNAVAILABLE"};if(!g.ok)return{ok:!1,retryable:g.status>=500,code:"RANGE_ERROR",message:`HTTP ${g.status}`};const p=await g.json(),v=Ms(p.events);if(v.length&&o.events(v,{throughSeq:a.throughSeq}),p.nextAfterSeq==null)return{ok:!0,throughSeq:a.throughSeq};if(p.nextAfterSeq<=c)return{ok:!1,retryable:!0,code:"RANGE_STALLED"};c=p.nextAfterSeq}return{ok:!1,retryable:!1,code:"ABORTED"}}catch(h){return u.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!1,retryable:!0,code:"RANGE_ERROR",message:h instanceof Error?h.message:String(h)}}}}}async function x3(t=fetch,i=e1,r){try{return(await t(i,{method:"HEAD",credentials:"same-origin",signal:r})).ok}catch{return!1}}const w3=t=>{if(typeof document>"u"||typeof window>"u")return()=>{};let i=document.visibilityState==="hidden"?Date.now():null;const r=()=>i==null?0:Math.max(0,Date.now()-i),a=()=>{if(document.visibilityState==="hidden"){i==null&&(i=Date.now());return}const g=r();i=null,t({reason:"visible",hiddenMs:g})},o=()=>{i==null&&(i=Date.now())},u=g=>{const p=r();i=null,t({reason:"pageshow",hiddenMs:p,persisted:g.persisted})},c=()=>t({reason:"online",hiddenMs:r()}),h=()=>{if(document.visibilityState==="hidden")return;const g=r();i=null,t({reason:"focus",hiddenMs:g})};return document.addEventListener("visibilitychange",a),window.addEventListener("pagehide",o),window.addEventListener("pageshow",u),window.addEventListener("online",c),window.addEventListener("focus",h),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("pagehide",o),window.removeEventListener("pageshow",u),window.removeEventListener("online",c),window.removeEventListener("focus",h)}};function S3(){return typeof document<"u"&&document.visibilityState==="hidden"}function mb(t){return{open(i,r){return k3(t,i,r??{})}}}function k3(t,i,r){const a=new AbortController,o=new Set,u=new Set,c=new Set;let h={phase:"restoring",appliedSeq:-1,headSeq:null,lag:null,fraction:null},g;const p=new Promise(P=>{g=P});let v=!1;const y=P=>{v||(v=!0,g(P))};let w=[],x=!1,S=null;const T=t.raf??(typeof requestAnimationFrame=="function"?requestAnimationFrame:P=>setTimeout(P,0)),C=t.cancelRaf??(typeof cancelAnimationFrame=="function"?cancelAnimationFrame:clearTimeout),E=()=>{S!=null&&(S.kind==="timer"?clearTimeout(S.id):C(S.id),S=null)},q=t.wait??T3,B=t.random??Math.random,ee=t.now??Date.now,X=t.isHidden??S3,O=()=>{if(S=null,w.length===0)return;const P=w;w=[];const ye={events:P,fromCache:x};x=!1;for(const We of o)We(ye)},Y=()=>{E(),O()},K=(P,ye=!1)=>{if(P.length===0||(ye&&(x=!0),w.push(...P),S!=null))return;const We={kind:X()?"timer":"raf",id:null};S=We,We.id=We.kind==="timer"?setTimeout(O,0):T(O)},se=P=>{h={...h,...P,lag:(P.headSeq??h.headSeq)==null||(P.appliedSeq??h.appliedSeq)==null?P.lag??h.lag:(P.headSeq??h.headSeq)-(P.appliedSeq??h.appliedSeq)};for(const ye of c)ye(h)};let _=0,G=!1,te=0,Te=!0,xe=null,fe=!1,re=null,ue=null,ge=!1,me=ee(),A=Number.NEGATIVE_INFINITY;const Ee=async P=>{if(a.signal.aborted)return;if(fe){fe=!1;return}const ye=new AbortController;xe=ye;const We=()=>ye.abort();a.signal.addEventListener("abort",We,{once:!0});try{await q(P,ye.signal)}catch{}finally{a.signal.removeEventListener("abort",We),xe===ye&&(xe=null)}},Be=()=>{const P=ge;return ge=!1,P},M=P=>{if(!Te||a.signal.aborted)return;Y();const ye=ee(),We=ue?ue():!0,et=ye-me>=p3,Ne=!We||P.reason==="online"||P.persisted===!0||P.hiddenMs>=m3||P.reason!=="focus"&&et;if(te=0,_=0,G=!1,xe){xe.abort();return}if(!re){fe=!0;return}Ne&&(ye-A<g3||(A=ye,re.signal.aborted||(ge=!0,re.abort())))};z();async function z(){try{await ne()}finally{Te=!1,we()}}async function ne(){const P=await t.checkpoint.getCursor(i);let ye=P?.appliedSeq??-1;const We=await t.checkpoint.readEvents(i,-1),et=E3(We,-1).filter(Me=>Me.seq<=ye||ye<0);ye<0&&et.length&&(ye=et[et.length-1].seq);const Ne=new v3(ye);P?.headSeq!=null&&Ne.setHead(P.headSeq),et.length&&K(et,!0),se({phase:"connecting",appliedSeq:Ne.appliedSeq,headSeq:Ne.headSeq});let tt=r.enhancement==="off"?!1:await J();const $e=()=>({events(Me){const Qe=Ne.push(Me);Ne.headSeq!=null&&Ne.appliedSeq>Ne.headSeq&&Ne.setHead(Ne.appliedSeq),Qe.delivered.length&&(K(Qe.delivered),t.checkpoint.putEvents(i,Qe.delivered),t.checkpoint.setCursor(i,Ne.appliedSeq,Ne.headSeq)),se({appliedSeq:Ne.appliedSeq,headSeq:Ne.headSeq,fraction:h.fraction}),Qe.overflow},head(Me){Ne.setHead(Me),se({headSeq:Ne.headSeq,appliedSeq:Ne.appliedSeq})},progress(Me){const Qe=Me.total&&Me.total>0?Math.min(1,Me.loaded/Me.total):null;se({fraction:Qe,appliedSeq:Ne.appliedSeq,headSeq:Ne.headSeq})},ephemeral(Me){for(const Qe of u)Qe(Me)},opened(){}}),Ie=async(Me,Qe,vt)=>{if(Qe<=Me)return{ok:!0,throughSeq:Qe};se({phase:"syncing",fraction:h.fraction});const he=Qe-Me,Le=$e(),bt=tt&&t.cdc!=null&&(he>n3||he*128>i3);if(tt&&t.range!=null&&!bt&&t.range){const Lt=await t.range.fetch({sessionId:i,afterSeq:Me,throughSeq:Qe},Le,vt);if(Lt.ok||vt.aborted)return Lt;tt=!1}else if(bt&&t.cdc){const Lt=await t.cdc.fetch({sessionId:i,afterSeq:Me,throughSeq:Qe},Le,vt);if(Lt.ok||vt.aborted)return Lt;tt=!1}return t.page.fetch({sessionId:i,afterSeq:Ne.appliedSeq,throughSeq:Qe},Le,vt)};for(;!a.signal.aborted;){if(G){se({phase:"stalled",appliedSeq:Ne.appliedSeq,headSeq:Ne.headSeq,fraction:null});const je=new AbortController,Ge=()=>je.abort();a.signal.addEventListener("abort",Ge);const Rt=Ne.headSeq??Ne.appliedSeq,Gt=await t.page.fetch({sessionId:i,afterSeq:Ne.appliedSeq,throughSeq:Math.max(Rt,Ne.appliedSeq)},$e(),je.signal);a.signal.removeEventListener("abort",Ge),Gt.ok&&Ne.headSeq!=null&&Ne.appliedSeq>=Ne.headSeq&&(se({phase:"live",appliedSeq:Ne.appliedSeq,headSeq:Ne.headSeq,fraction:null,error:void 0}),y({ok:!0,caughtUpTo:Ne.appliedSeq})),te+=1;const on=xu(te,B);await Ee(Math.min(on,o3)),G=_>=Qd}if(a.signal.aborted)break;se({phase:h.phase==="restoring"?"connecting":h.phase==="live"?"syncing":"connecting"});const Me=new AbortController;re=Me,ue=null;const Qe=()=>Me.abort();a.signal.addEventListener("abort",Qe);const vt=()=>{a.signal.removeEventListener("abort",Qe),Me.abort(),re===Me&&(re=null,ue=null)};let he=null;const Le=$e(),bt=()=>{re===Me&&(me=ee())},bn={events(je,Ge){bt(),Le.events(je,Ge)},head(je){bt(),Le.head(je)},progress:Le.progress,ephemeral(je){bt(),Le.ephemeral(je)},opened(je){bt(),he=je,re===Me&&(ue=je.alive??null),Ne.setHead(je.cursor),se({headSeq:je.cursor,appliedSeq:Ne.appliedSeq,phase:"syncing"})}},Lt=t.follow.open({sessionId:i},bn,Me.signal),Z=await Promise.race([Lt.then(je=>({kind:"done",outcome:je})),j3(()=>he!=null,Me.signal,q).then(()=>({kind:"opened"}))]),ce=he;if(Z.kind==="done"||ce==null||Me.signal.aborted){if(vt(),a.signal.aborted)break;if(Be())continue;_+=1,_>=Qd&&(G=!0),te+=1,await Ee(xu(te,B));continue}_=0,te=0;const Se=ce.firstSeq-1,Ce=await Ie(Ne.appliedSeq,Se,Me.signal);if(Me.signal.aborted){if(vt(),a.signal.aborted)break;Be();continue}if(!Ce.ok&&!Ce.retryable){se({phase:"error",error:{code:Ce.code,message:Ce.message??Ce.code,retrying:!1},appliedSeq:Ne.appliedSeq,headSeq:Ne.headSeq}),y({ok:!1,code:Ce.code,message:Ce.message??Ce.code}),vt();break}if(!Ce.ok){vt(),se({phase:"stalled",error:{code:Ce.code,message:Ce.message??Ce.code,retrying:!0},appliedSeq:Ne.appliedSeq,headSeq:Ne.headSeq}),te+=1,await Ee(xu(te,B));continue}se({phase:"live",appliedSeq:Ne.appliedSeq,headSeq:Ne.headSeq,fraction:null,error:void 0}),Ne.appliedSeq>=Se&&y({ok:!0,caughtUpTo:Ne.appliedSeq});const Tt=await Lt;if(vt(),a.signal.aborted)break;Be()||Tt.ok||(_+=1,_>=Qd&&(G=!0),se({phase:"stalled",error:{code:Tt.code,message:Tt.message??Tt.code,retrying:!0}}),te+=1,await Ee(xu(te,B)))}h.phase!=="error"&&se({phase:"closed"}),E()}async function J(){return r.enhancement==="off"||!t.cdc&&!t.range?!1:t.probe?t.probe():x3()}const ae=(t.onResume??w3)(M),Oe=t.livenessMs===void 0?y3:t.livenessMs;let be=null;Oe!==!1&&Oe>0&&(be=setInterval(()=>{X()||!re||!ue||ue()||M({reason:"liveness",hiddenMs:0})},Oe),be.unref?.());function we(){be!=null&&clearInterval(be),be=null}return{onBatch(P){return o.add(P),()=>o.delete(P)},onEphemeral(P){return u.add(P),()=>u.delete(P)},onStatus(P){return c.add(P),P(h),()=>c.delete(P)},get status(){return h},ready:p,close(){ae(),we(),a.abort(),E(),se({phase:"closed"})}}}function E3(t,i){const r=[...t].sort((u,c)=>u.seq-c.seq),a=[];let o=i+1;for(const u of r)if(!(u.seq<o)){if(u.seq!==o)break;a.push(u),o=u.seq+1}return a}function xu(t,i){return Math.min(c3,u3*2**Math.max(0,t-1))*(.5+i()*.5)}function T3(t,i){return new Promise((r,a)=>{const o=setTimeout(()=>{i.removeEventListener("abort",u),r()},t),u=()=>{clearTimeout(o),a(new DOMException("Aborted","AbortError"))};i.aborted?u():i.addEventListener("abort",u,{once:!0})})}async function j3(t,i,r){for(;!t()&&!i.aborted;)await r(5,i).catch(()=>{})}function pb(t={}){const i=t.addressOf??(u=>fa(u)),r=t.fetch??fetch,a=t.url??h3,o=t.maxMessages??WR;return{kind:"official-page",async fetch(u,c,h){if(u.throughSeq<=u.afterSeq)return{ok:!0,throughSeq:u.throughSeq};let g=u.throughSeq+1,p=0;const v=u.throughSeq-u.afterSeq;c.progress({loaded:0,total:v,unit:"events"});try{for(;!h.aborted;){const y=await C3(r,a,{address:i(u.sessionId),throughSeq:u.throughSeq,beforeSeq:g,maxMessages:o,turnWindow:e3},h);if(!y.ok)return y;const w=Ms(y.records);w.length&&c.events(w,{throughSeq:u.throughSeq}),p+=w.length,c.progress({loaded:p,total:v,unit:"events"});const x=w.reduce((S,T)=>Math.min(S,T.seq),Number.POSITIVE_INFINITY);if(!y.hasMore||!Number.isFinite(x)||x<=u.afterSeq+1)break;if(x>=g)return{ok:!1,retryable:!0,code:"PAGE_STALLED",message:"Official page did not move."};g=x}return h.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!0,throughSeq:u.throughSeq}}catch(y){return h.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!1,retryable:!0,code:"PAGE_ERROR",message:y instanceof Error?y.message:String(y)}}}}}async function C3(t,i,r,a){const o=await t(i,{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 u=null;try{u=await o.json()}catch{u=null}if(!o.ok||u?.result?.ok===!1)return{ok:!1,retryable:o.status>=500||o.status===0,code:"PAGE_ERROR",message:u?.result?.error?.message??`session/events HTTP ${o.status}`};const c=u?.result?.value??u?.result??u;return{ok:!0,records:c?.records??c?.events??c,hasMore:c?.hasMore===!0,cursor:c?.cursor}}async function gb(t){const i=await crypto.subtle.digest("SHA-256",t);return[...new Uint8Array(i)].map(r=>r.toString(16).padStart(2,"0")).join("")}function yb(t){const i=t.fetch??fetch,r=t.concurrency??l3,a=t.retries??r3,o=t.manifestUrl??f3,u=t.chunkUrl??d3,c=t.wait??R3;return{kind:"cdc-snapshot",async fetch(h,g,p){if(h.throughSeq<=h.afterSeq)return{ok:!0,throughSeq:h.throughSeq};const v=new AbortController,y=()=>v.abort();p.addEventListener("abort",y);try{const w=await N3(i,o,h,v.signal);return w.ok?await A3({manifest:w.value,afterSeq:h.afterSeq,throughSeq:h.throughSeq,sink:g,cache:t.cache,fetchImpl:i,chunkUrl:u,concurrency:r,retries:a,wait:c,signal:v.signal}):w}catch(w){return p.aborted||v.signal.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!1,retryable:!0,code:"CDC_ERROR",message:w instanceof Error?w.message:String(w)}}finally{p.removeEventListener("abort",y),v.signal.aborted||v.abort()}}}}async function N3(t,i,r,a){const o=new URLSearchParams({sessionId:r.sessionId,throughSeq:String(r.throughSeq),afterSeq:String(r.afterSeq)}),u=await t(`${i}?${o}`,{method:"GET",credentials:"same-origin",signal:a,headers:{accept:"application/json"}});if(u.status===404)return{ok:!1,retryable:!1,code:"ENHANCE_UNAVAILABLE"};if(!u.ok)return{ok:!1,retryable:u.status>=500,code:"CDC_MANIFEST",message:`HTTP ${u.status}`};const c=await u.json();return Array.isArray(c.chunks)?{ok:!0,value:c}:{ok:!1,retryable:!0,code:"CDC_MANIFEST"}}async function A3(t){const i=[...t.manifest.chunks].sort((C,E)=>C.fromSeq-E.fromSeq),r=new Map;let a=0;const o=t.manifest.totalSize;t.sink.progress({loaded:a,total:o,unit:"bytes"}),t.sink.head(t.manifest.throughSeq);let u=0;const c=()=>{for(;u<i.length;){const C=i[u];if(!C||!r.has(C.fromSeq))break;const E=(r.get(C.fromSeq)??[]).filter(q=>q.seq>t.afterSeq&&q.seq<=t.throughSeq);E.length&&t.sink.events(E,{throughSeq:t.throughSeq}),u+=1}},h=[];for(const C of i){const E=await t.cache.getChunk(C.hash);E&&await gb(E)===C.hash?(r.set(C.fromSeq,vb(E)),a+=C.bytes,t.sink.progress({loaded:a,total:o,unit:"bytes"}),c()):h.push(C)}if(h.length===0)return c(),{ok:!0,throughSeq:t.throughSeq};let g=0,p=0,v=null,y=null;const w=()=>{const C=y;y=null,C?.()},x=()=>new Promise(C=>{if(p===0){C();return}y=C}),S=async C=>{for(let E=0;E<t.retries;E+=1){if(t.signal.aborted||v)return;try{const q=await O3(t.fetchImpl,t.chunkUrl,t.manifest.sessionId,C,t.signal);if(await gb(q)!==C.hash)throw new Error("hash mismatch");await t.cache.putChunk(C.hash,q),r.set(C.fromSeq,vb(q)),a+=C.bytes,t.sink.progress({loaded:a,total:o,unit:"bytes"}),c();return}catch(q){if(t.signal.aborted||v)return;if(E+1>=t.retries){v={ok:!1,retryable:!0,code:"CDC_CHUNK_FAILED",message:q instanceof Error?q.message:String(q)};return}await t.wait(50*2**E,t.signal).catch(()=>{})}}},T=()=>{for(;!v&&!t.signal.aborted&&p<t.concurrency&&g<h.length;){const C=h[g];if(g+=1,!C)break;p+=1,S(C).finally(()=>{p-=1,w()})}};for(T();p>0&&!t.signal.aborted;)T(),p>0&&await x();return t.signal.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:v||(c(),{ok:!0,throughSeq:t.throughSeq})}async function O3(t,i,r,a,o){const u=new URLSearchParams({sessionId:r,fromSeq:String(a.fromSeq),toSeq:String(a.toSeq),hash:a.hash}),c=await t(`${i}?${u}`,{method:"GET",credentials:"same-origin",signal:o});if(c.status===404)throw Object.assign(new Error("not found"),{code:"ENHANCE_UNAVAILABLE",status:404});if(!c.ok)throw new Error(`HTTP ${c.status}`);return new Uint8Array(await c.arrayBuffer())}function vb(t){const i=new TextDecoder().decode(t),r=[];for(const a of i.split(`
59
- `))if(a.trim()!=="")try{r.push(...Ms(JSON.parse(a)))}catch{}return r.sort((a,o)=>a.seq-o.seq)}function R3(t,i){return new Promise((r,a)=>{const o=setTimeout(()=>{i.removeEventListener("abort",u),r()},t),u=()=>{clearTimeout(o),a(new DOMException("Aborted","AbortError"))};i.aborted?u():i.addEventListener("abort",u,{once:!0})})}const _3="dsh-bot",z3=2,M3=["log_chunks","log_events","log_cursors"];function q3(t){const i=globalThis.indexedDB;return i?new Promise(r=>{let a=!1;const o=u=>{a||(a=!0,r(u))};try{const u=i.open(_3,z3);u.onupgradeneeded=c=>{const h=u.result;if(c.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"})}},u.onblocked=()=>o({ok:!1,reason:"blocked"}),u.onsuccess=()=>{const c=u.result;if(c.onversionchange=()=>c.close(),!M3.every(h=>c.objectStoreNames.contains(h))){c.close(),o({ok:!1,reason:"unavailable"});return}o({ok:!0,db:c})},u.onerror=()=>o({ok:!1,reason:"unavailable"})}catch{o({ok:!1,reason:"unavailable"})}}):Promise.resolve({ok:!1,reason:"unavailable"})}function D3(){const t=new Map,i=new Map,r=new Map;let a=0;const o=()=>{const u=[...r.entries()].sort((c,h)=>c[1].lastUsed-h[1].lastUsed);for(;a>W0&&u.length>0;){const c=u.shift();if(!c)break;r.delete(c[0]),a-=c[1].bytes.byteLength}};return{mode:"memory",async getCursor(u){return t.get(u)??null},async setCursor(u,c,h){const g=t.get(u),p=g?Math.max(g.appliedSeq,c):c,v=h==null?g?.headSeq??null:Math.max(g?.headSeq??h,h);t.set(u,{appliedSeq:p,headSeq:v})},async putEvents(u,c){const h=i.get(u)??new Map;for(const g of c)h.set(g.seq,g);i.set(u,h)},async readEvents(u,c=-1){const h=i.get(u);return h?[...h.values()].filter(g=>g.seq>c).sort((g,p)=>g.seq-p.seq):[]},async getChunk(u){const c=r.get(u);return c?(c.lastUsed=Date.now(),c.bytes):null},async putChunk(u,c){const h=r.get(u);h&&(a-=h.bytes.byteLength),r.set(u,{bytes:c,lastUsed:Date.now()}),a+=c.byteLength,o()}}}async function bb(t){const i=await B3(t);if(i.ok!==!0)return D3();const r=i.db;return{mode:"idb",async getCursor(a){return fr(r,"log_cursors","readonly",o=>ci(o.get(a))).then(o=>o?{appliedSeq:o.appliedSeq,headSeq:o.headSeq??null}:null)},async setCursor(a,o,u){await fr(r,"log_cursors","readwrite",async c=>{const h=await ci(c.get(a)),g=h?Math.max(h.appliedSeq,o):o,p=u==null?h?.headSeq??null:Math.max(h?.headSeq??u,u);await ci(c.put({sessionId:a,appliedSeq:g,headSeq:p,updatedAt:Date.now()}))})},async putEvents(a,o){await fr(r,"log_events","readwrite",async u=>{for(const c of o)await ci(u.put({sessionId:a,seq:c.seq,event:c}))})},async readEvents(a,o=-1){return(await fr(r,"log_events","readonly",c=>{const h=c.index("bySession");return ci(h.getAll(a))})).map(c=>c.event).filter(c=>c&&c.seq>o).sort((c,h)=>c.seq-h.seq)},async getChunk(a){const o=await fr(r,"log_chunks","readonly",u=>ci(u.get(a)));return o?.bytes?(fr(r,"log_chunks","readwrite",u=>ci(u.put({...o,lastUsed:Date.now()},a))),o.bytes):null},async putChunk(a,o){await fr(r,"log_chunks","readwrite",async u=>{await ci(u.put({bytes:o,lastUsed:Date.now()},a)),await L3(u)})}}}async function L3(t){const i=t.index("byLastUsed"),r=await ci(i.getAll()),a=await ci(i.getAllKeys());let o=r.reduce((u,c)=>u+(c.bytes?.byteLength??0),0);for(let u=0;u<r.length&&o>W0;u+=1){const c=a[u],h=r[u];c==null||!h||(o-=h.bytes.byteLength,await ci(t.delete(c)))}}function B3(t){try{return q3(t)}catch{return Promise.resolve({ok:!1,reason:"unavailable"})}}function fr(t,i,r,a){return new Promise((o,u)=>{const c=t.transaction(i,r),h=c.objectStore(i);Promise.resolve(a(h)).then(o,u),c.onerror=()=>u(c.error)})}function ci(t){return new Promise((i,r)=>{t.onsuccess=()=>i(t.result),t.onerror=()=>r(t.error)})}function U3(t,i){const r=Math.max(0,Math.min(i,t.length)),a=/(?:^|\s)@([^\s@()]*)$/.exec(t.slice(0,r));if(!a||a.index==null)return null;const o=a[1]??"";return{start:a.index+a[0].length-o.length-1,query:o}}function H3(t){return t.replace(/[@()\r\n]/g," ").replace(/\s+/g," ").trim()||"Untitled"}function I3(t,i){return`@${H3(t)} (${i})`}function V3(t,i,r,a,o){const u=Math.max(0,Math.min(i,t.length)),c=`${I3(a,o)} `;return{text:t.slice(0,r)+c+t.slice(u),cursor:r+c.length}}function Y3(t,i){const r=i.trim().toLowerCase();return t.filter(a=>r===""?!0:a.label.toLowerCase().includes(r)||a.sessionId.toLowerCase().includes(r)).slice(0,8)}const Xd=()=>({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 Bu(t,i,r){return kk(t,i,r)}function F3({active:t,progress:i}){const{t:r}=Ke(),[a,o]=j.useState(t),[u,c]=j.useState(!1);if(j.useEffect(()=>{if(t){o(!0);return}c(!1)},[t]),j.useEffect(()=>{if(!a||!t)return;const p=window.requestAnimationFrame(()=>c(!0));return()=>window.cancelAnimationFrame(p)},[a,t]),j.useEffect(()=>{if(t||!a)return;const p=window.setTimeout(()=>o(!1),280);return()=>window.clearTimeout(p)},[t,a]),!a)return null;const h=i!=null&&i.total>0,g=h?Math.min(100,Math.round(i.loaded/i.total*100)):0;return m.jsx("div",{className:u?"chunk-loading visible":"chunk-loading",role:"status",children:m.jsxs("div",{className:"chunk-loading-card",children:[m.jsx("p",{children:m.jsx("span",{className:"shimmer",children:h?r("load.messagesPct",{pct:String(g)}):r("load.messages")})}),m.jsx("div",{className:"chunk-progress-track",role:"progressbar","aria-valuemin":0,"aria-valuemax":h?i.total:1,"aria-valuenow":h?i.loaded:0,"aria-label":r("load.aria"),children:m.jsx("div",{className:h?"chunk-progress-fill":"chunk-progress-fill indeterminate",style:h?{width:`${g}%`}:void 0})})]})})}function xb({signal:t}){const{t:i}=Ke();if(!t)return null;const r=t==="wait";return m.jsx("span",{className:r?"bot-dot wait":"bot-dot",role:"img","aria-label":i(r?"bot.waiting":"bot.running")})}function G3(t){const i=[];return t.turns!=null&&i.push(`${t.turns} turns`),t.steps!=null&&i.push(`${t.steps} steps`),i.join(" · ")}function Q3({health:t,usage:i,execution:r,model:a}){const{t:o}=Ke(),u=t?.primary?.reachable===!0,c=i&&"code"in i&&typeof i.code=="string"?i.code:"";return m.jsxs("div",{className:"status",children:[m.jsx("p",{children:o(u?"health.up":"health.down")}),a?m.jsx("p",{className:"muted",children:a}):null,m.jsx("p",{className:r.ready?"":"muted",children:r.ready?o("health.modelReady"):Bu(r.reason,r.reason,o)}),m.jsx("p",{className:i?.connected?"":"muted",children:i?.connected?o("health.usageReady"):Bu(c,i?.error||o("health.usageOff"),o)}),m.jsx("p",{className:"muted",children:o("health.sameSession")})]})}function X3(){return m.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[m.jsx("circle",{cx:"11",cy:"11",r:"6.25",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),m.jsx("path",{d:"M16 16.5L20 20.5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]})}function wb(){return m.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:m.jsx("path",{d:"M12 5v14M5 12h14",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})}function Z3({preset:t}){return t==="read-only"||t==="readonly"||t==="danger-full-access"||t==="auto"?m.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[m.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"}),t==="danger-full-access"?m.jsx("path",{d:"M8 4.4V9.9M8 10.8V11.8",fill:"none",stroke:"currentColor"}):null,t==="read-only"||t==="readonly"?m.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]}):m.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[m.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"}),m.jsx("path",{d:"M5.26 6.6H10.74M5.26 9.87H8.33",fill:"none",stroke:"currentColor"}),m.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 n1(){return m.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:m.jsx("path",{d:"M12 17V7M7 11.5L12 6.5l5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function Wu({open:t,children:i,className:r}){const[a,o]=j.useState(t),[u,c]=j.useState(t);j.useLayoutEffect(()=>{if(t){o(!0);const p=requestAnimationFrame(()=>c(!0));return()=>cancelAnimationFrame(p)}c(!1),window.matchMedia("(prefers-reduced-motion: reduce)").matches&&o(!1)},[t]);function h(p){p.target!==p.currentTarget||p.propertyName!=="grid-template-rows"||t||o(!1)}const g=["coll-container",u?"expand":"",r].filter(Boolean).join(" ");return m.jsx("div",{className:g,onTransitionEnd:h,children:m.jsx("div",{children:a?i:null})})}function i1({ticket:t,now:i,onSupply:r,onOpen:a}){const{t:o}=Ke(),[u,c]=j.useState(""),[h,g]=j.useState(""),[p,v]=j.useState(!1),y=Bk(t),w=t.status==="started"||t.status==="needs_user";return m.jsxs("article",{className:"work-card",children:[m.jsxs("header",{children:[m.jsx("h3",{children:t.summary}),t.status==="ready"?null:m.jsx("span",{className:w?"work-status live":"work-status",children:Jb(t.status,o)})]}),Lk(t,i,o).map(x=>m.jsx("p",{children:x},x)),t.childSessionId?m.jsx("button",{type:"button",className:"work-open",onClick:()=>a(t.childSessionId??""),children:o("work.openWorker")}):null,y?m.jsx("p",{className:y.stale?"stale":"work-question",children:y.text||o("work.questionEmpty")}):null,y?.stale?m.jsx("p",{className:"work-quiet",children:o("work.questionStale")}):null,t.status==="needs_user"?m.jsxs("form",{className:"work-reply",onSubmit:x=>{x.preventDefault();const S=u.trim();!S||p||(v(!0),g(""),r(t.id,S).then(T=>{v(!1),T?g(T):c("")}))},children:[m.jsxs("label",{children:[m.jsx("span",{children:o("work.answerLabel")}),m.jsx("textarea",{value:u,rows:2,disabled:p,onChange:x=>c(x.target.value)})]}),h?m.jsx("p",{className:"work-error",children:h}):null,m.jsx("button",{type:"submit",disabled:p||u.trim()==="",children:o("work.answerSubmit")})]}):null]})}function K3({briefing:t,time:i,mark:r,onOpenFile:a}){const{t:o}=Ke(),[u,c]=j.useState(!1),h=t.body.split(`
60
- `).map(p=>p.trim()).find(Boolean)??"",g=[t.wallMs!=null?o("work.duration",{value:$3(t.wallMs,o)}):"",t.maxTokens!=null?`token ${t.maxTokens.toLocaleString("en-US")}`:"",t.material?o("work.material",{hash:t.material.slice(0,8)}):""].filter(Boolean);return m.jsxs("div",{className:"briefing-row","data-turn":r,children:[m.jsxs("article",{className:u?"briefing-card open":"briefing-card",children:[m.jsxs("button",{type:"button",className:"briefing-toggle","aria-expanded":u,onClick:()=>c(p=>!p),children:[m.jsx("span",{className:"briefing-title",children:t.cancel?o("work.cancelTitle"):o("work.taskTitle")}),m.jsx("span",{className:"briefing-rev",children:o("work.generation",{revision:String(t.revision)})}),m.jsx(J3,{}),h&&!u?m.jsx("span",{className:"briefing-preview",children:h}):null]}),m.jsx(Wu,{open:u,children:m.jsxs("div",{className:"briefing-body",children:[t.body?m.jsx(Is,{text:t.body,onOpenFile:a}):null,g.length?m.jsx("p",{className:"briefing-facts",children:g.join(" · ")}):null,t.notes.map(p=>m.jsx("p",{className:"briefing-note",children:p},p))]})})]}),i?m.jsx("time",{children:i}):null]})}function $3(t,i){return t%6e4===0?i("work.minutes",{count:String(t/6e4)}):t%1e3===0?i("work.seconds",{count:String(t/1e3)}):i("work.milliseconds",{count:String(t)})}function J3(){return m.jsx("svg",{className:"briefing-chevron",viewBox:"0 0 16 16","aria-hidden":"true",children:m.jsx("path",{d:"M4 6.5L8 10.5L12 6.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function P3({text:t}){return m.jsx("p",{className:"work-refused",children:t})}function W3({segment:t}){const[i,r]=j.useState(!1),{t:a}=Ke();return m.jsxs("div",{className:"official-row","data-variant":"think","data-segment":t.id,children:[m.jsxs("button",{type:"button",className:"official-title","aria-expanded":i,onClick:()=>r(!i),children:[m.jsxs("span",{className:"official-leading",children:[m.jsx(r4,{}),m.jsx(Uu,{})]}),m.jsx("span",{className:"official-label",children:t.running?a("activity.thinking"):a("activity.reasoning")})]}),m.jsx(Wu,{open:i,children:m.jsx("div",{className:"think-body",children:ut(t.text)})})]})}function e4({segments:t,pending:i=!1,tickets:r=[],cwd:a,connectionPhase:o}){const{t:u}=Ke(),c=i||t.some(w=>w.kind==="think"?w.running:js.has(Cs(w,a,r).status)),h=t.filter(w=>w.kind==="tool").map(w=>Cs(w,a,r).status),g=[[u("activity.count.active"),h.filter(w=>js.has(w)).length],[u("activity.count.failed"),h.filter(w=>w==="failed").length],[u("activity.count.cancelled"),h.filter(w=>w==="cancelled").length],[u("activity.count.unknown"),h.filter(w=>w==="unknown").length]].filter(([,w])=>Number(w)>0).map(([w,x])=>`${w} ${x}`).join(" · "),[p,v]=j.useState(()=>c),y=o!=null&&o!=="live";return m.jsxs("section",{className:p?"activity-group open":"activity-group","aria-label":u("activity.title"),"data-state":c?"running":"settled","data-activity-start":t[0]?.id,children:[m.jsxs("button",{type:"button",className:"official-title","aria-expanded":p,onClick:()=>v(w=>!w),children:[m.jsxs("span",{className:"official-leading",children:[m.jsx(xh,{}),m.jsx(Uu,{})]}),m.jsx("span",{className:"official-label",children:t.length===1?u("activity.titleOne"):u("activity.titleWithCount",{count:String(t.length)})}),g?m.jsx("span",{className:"activity-status",children:g}):null,y?m.jsx("span",{className:"activity-status",children:["restoring","connecting","syncing"].includes(o??"")?u("activity.resyncing"):u("activity.connectionLastKnown")}):null]}),m.jsx(Wu,{open:p,children:m.jsxs("div",{className:"activity-body",children:[i&&!t.some(w=>w.kind==="think"?w.running:js.has(Cs(w,a,r).status))?m.jsx("p",{className:"activity-note",children:u("activity.generating")}):null,t.map(w=>w.kind==="think"?m.jsx(W3,{segment:w},w.id):m.jsx(t4,{segment:w,cwd:a,tickets:r,stale:y},w.callId))]})})]})}function t4(t){const[i,r]=j.useState(!1),[a,o]=j.useState(!1);return m.jsx(n4,{...t,open:i,argsOpen:a,onToggle:()=>r(u=>!u),onArgsToggle:()=>o(u=>!u)})}function n4({segment:t,cwd:i,tickets:r=[],stale:a=!1,open:o,argsOpen:u,onToggle:c,onArgsToggle:h}){const g=j.useId(),{t:p,locale:v}=Ke(),y=Cs(t,i,r),w=OR({...t,args:y.args,result:y.output}),x=Fh(t.name)?p("activity.runCommand"):y.title,S=y.description||(y.todos.length?p("activity.updatePlan"):"")||(y.ticket?ut(y.ticket.summary):"")||w?.name||x,T=["failed","cancelled","unknown"].includes(y.status);return m.jsx(Sb,{className:"official-row tool-activity",status:y.status,segmentId:t.id,open:o,onToggle:c,panelId:`${g}-tool`,title:m.jsxs(m.Fragment,{children:[m.jsxs("span",{className:"official-leading",children:[m.jsx(xh,{}),m.jsx(Uu,{})]}),m.jsx("span",{className:"official-label",children:S}),T?m.jsxs("span",{className:"activity-status",children:[Jv(y.status,p),a?p("activity.lastKnownSuffix"):""]}):null]}),children:m.jsxs("div",{className:"activity-detail",children:[y.status!=="succeeded"&&!T?m.jsxs("p",{className:"activity-note",children:[Jv(y.status,p),a?p("activity.lastKnownSuffix"):""]}):null,y.todos.length?m.jsxs("p",{className:"activity-note",children:[y.todos.filter(C=>C.status==="completed").length,"/",y.todos.length," ",p("activity.planComplete")]}):null,m.jsxs("div",{className:"activity-facts",children:[y.title," · ",ut(t.callId)]}),y.command?m.jsxs("div",{className:"activity-command",children:[m.jsx(Tu,{text:y.command}),m.jsx("pre",{children:y.command})]}):null,y.cwd?m.jsxs("p",{className:"activity-facts",children:[y.cwdSource==="recorded"?p("activity.cwdRecorded"):y.cwdSource==="requested"?p("activity.cwdRequested"):p("activity.cwdSessionDefault"),": ",y.cwd]}):null,y.status==="waiting"?m.jsx("p",{className:"activity-note",children:p("activity.callRequested")}):null,y.jobId?m.jsxs("p",{className:"activity-facts",children:["Job: ",ut(y.jobId)," · ",p("activity.jobRegistered")]}):null,y.ticketId?m.jsxs("p",{className:"activity-facts",children:["Ticket: ",ut(y.ticketId)," ",y.ticket?.childSessionId?`· Worker: ${ut(y.ticket.childSessionId)}`:""]}):null,y.latestReport?m.jsxs("p",{className:"activity-note",children:[p("activity.latestReport")," (v",y.ticket?.revision,"): ",ut(y.latestReport)]}):null,y.todos.length?m.jsx("ul",{className:"activity-todos",children:y.todos.map((C,E)=>m.jsxs("li",{children:[m.jsx("span",{children:C.status})," ",C.content]},E))}):null,t.requestedAt!=null?m.jsxs("p",{className:"activity-facts",children:[p("activity.callRecorded"),":"," ",new Date(t.requestedAt).toLocaleString(v==="zh"?"zh-CN":"en"),t.settledAt!=null?` · ${p("activity.callWait")}: ${Math.max(0,t.settledAt-t.requestedAt)}ms`:""]}):null,y.exitCode!=null?m.jsxs("p",{className:"activity-facts",children:["Exit: ",y.exitCode]}):null,w?m.jsx(i4,{change:w}):null,m.jsx(Sb,{className:"official-row activity-arguments",open:u,onToggle:h,panelId:`${g}-args`,title:m.jsxs(m.Fragment,{children:[m.jsxs("span",{className:"official-leading",children:[m.jsx(xh,{}),m.jsx(Uu,{})]}),m.jsx("span",{className:"official-label",children:p("activity.fullArgs")})]}),trailing:u?m.jsx(Tu,{text:y.args}):null,children:m.jsx("pre",{children:y.args||"{}"})}),t.resultReceived||t.result?m.jsxs("div",{className:"activity-output",children:[m.jsxs("div",{className:"activity-block-head",children:[m.jsx("span",{children:p("activity.toolResult")}),m.jsx(Tu,{text:y.output})]}),m.jsx("pre",{children:y.output||p("activity.emptyResult")})]}):null]})})}function Sb({className:t,status:i,segmentId:r,open:a,onToggle:o,panelId:u,title:c,trailing:h,children:g}){return m.jsxs("div",{className:`${t}${a?" open":""}`,"data-state":i,"data-segment":r,children:[m.jsx("button",{type:"button",className:"official-title","aria-expanded":a,"aria-controls":u,onClick:p=>{p.stopPropagation(),o()},children:c}),h,m.jsx("div",{id:u,className:"activity-panel",children:m.jsx(Wu,{open:a,children:g})})]})}function i4({change:t}){const i=t.lines.map(r=>`${r.kind==="del"?"- ":r.kind==="add"?"+ ":" "}${r.text}`).join(`
61
- `);return m.jsxs("div",{className:"diff-card","data-diff":"",children:[m.jsxs("div",{className:"diff-head",children:[m.jsxs("span",{className:"diff-heading",children:[m.jsx("span",{className:"diff-lang",children:t.language||"Code block"}),m.jsx("span",{className:"diff-file",children:t.name})]}),m.jsx(Tu,{text:i})]}),m.jsx("div",{className:"diff-body",children:t.lines.map((r,a)=>m.jsx("div",{className:l4(r.kind),children:r.text},a))})]})}function l4(t){return t==="add"?"diff-line added":t==="del"?"diff-line removed":"diff-line same"}function Tu({text:t}){const[i,r]=j.useState(!1);return m.jsx("button",{type:"button",className:"diff-copy","aria-label":i?"Copied":"Copy",onClick:a=>{a.stopPropagation(),navigator.clipboard.writeText(ut(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1e3)})},children:i?m.jsx(s4,{}):m.jsx(a4,{})})}function Uu(){return m.jsx("svg",{className:"chevron",viewBox:"0 0 16 16","aria-hidden":"true",children:m.jsx("path",{d:"M4 6.5L8 10.5L12 6.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function r4(){return m.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[m.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"}),m.jsx("path",{d:"M6.2 13.6h3.6",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function xh(){return m.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:m.jsx("path",{d:"M3.2 4.2h9.6M3.2 8h9.6M3.2 11.8h6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})})}function a4(){return m.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[m.jsx("rect",{x:"5.2",y:"5.2",width:"7.2",height:"7.6",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),m.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 s4(){return m.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:m.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 o4={aborted:"question.aborted",failed:"question.failed",answered:"question.answered"};function bs(t){return{selected:[...t.selected],custom:t.custom,skipped:t.skipped}}function u4(t){const i=Math.max(0,Math.ceil(t/1e3)),r=Math.floor(i/60),a=i%60;return r>0?`${r}:${String(a).padStart(2,"0")}`:`${a}s`}function c4({item:t,draft:i,interactive:r,disabled:a,onToggle:o}){const{t:u}=Ke();if(!t.options.length)return null;const c=new Set(i.selected);return m.jsx("ul",{className:"user-question-options",children:t.options.map(h=>{const g=c.has(h.label),p=RO(h.label,h.recommended),v=g?"user-question-option selected":"user-question-option",y=m.jsxs(m.Fragment,{children:[m.jsxs("span",{className:"user-question-option-label",children:[ut(h.label),p.recommended?m.jsx("span",{className:"user-question-badge",children:u("question.recommended")}):null]}),h.description?m.jsx("span",{className:"user-question-option-desc",children:ut(h.description)}):null]});return m.jsx("li",{children:r?m.jsx("button",{type:"button",className:v,"data-selected":g?"true":"false","aria-pressed":t.multiSelect?g:void 0,disabled:a,onClick:()=>o(h.label),children:y}):m.jsx("div",{className:v,"data-selected":g?"true":"false",children:y})},h.label)})})}function Kh({interactive:t,waitLabel:i,onTakeTime:r,busy:a}){const{t:o}=Ke();return i?m.jsxs("div",{className:"user-question-wait",children:[m.jsx("p",{className:"user-question-hint",children:i}),t&&i!==o("question.continued")&&i!==o("question.waitingNoTimer")?m.jsx("button",{type:"button",className:"user-question-skip",disabled:a,onClick:r,children:o("question.takeTime")}):null]}):null}function f4({segment:t,sessionId:i,onCompose:r,remainingMs:a,waitState:o}){const u=Vs(t);return u?u.presentation==="plan-review"?m.jsx(h4,{segment:t,sessionId:i,onCompose:r,remainingMs:a,waitState:o}):u.presentation==="approval"?m.jsx(m4,{segment:t,sessionId:i,remainingMs:a,waitState:o}):m.jsx(d4,{segment:t,sessionId:i,remainingMs:a,waitState:o}):null}function $h(t,i,r,a,o){const{t:u}=Ke(),c=!!(r&&z0(r.state)),[h,g]=j.useState(o==="waiting"||r?.wait==="waiting"),[p,v]=j.useState(o==="continued"||r?.state==="continued"),[y,w]=j.useState(a??r?.timeoutMs),x=j.useRef(null),S=(o==="counting"||r?.wait==="counting"||typeof(a??r?.timeoutMs)=="number")&&!h&&!p;j.useEffect(()=>{o==="waiting"&&g(!0),(o==="continued"||r?.state==="continued")&&v(!0),typeof a=="number"&&(x.current=Date.now()+a,w(a))},[a,o,r?.state]),j.useEffect(()=>{if(!c||!S)return;const E=a??y??r?.timeoutMs;if(typeof E!="number")return;x.current==null&&(x.current=Date.now()+E);const q=()=>{const ee=Math.max(0,(x.current??Date.now())-Date.now());return w(ee),ee<=0?(v(!0),t&&Fe("/questions/timeout",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:t,callId:i})}),!1):!0};if(!q())return;const B=window.setInterval(()=>{q()||window.clearInterval(B)},250);return()=>window.clearInterval(B)},[c,S,t,i,a,y,r?.timeoutMs]);async function T(){g(!0),x.current=null,t&&await Fe("/questions/take-time",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:t,callId:i})})}const C=p?u("question.continued"):h?u("question.waitingNoTimer"):S&&typeof y=="number"?u("question.remaining",{time:u4(y)}):null;return{answerable:c,held:h,continued:p,waitLabel:C,takeTime:T,markHeld:()=>g(!0)}}function d4({segment:t,sessionId:i,remainingMs:r,waitState:a}){const{t:o}=Ke(),u=Vs(t),c=$h(i,u.callId,u,r,a),[h,g]=j.useState({}),[p,v]=j.useState(!1),[y,w]=j.useState(""),x=u.questions,S=j.useMemo(()=>{const O={};for(const Y of x)O[Y.id]=h[Y.id]??bs(Y);return O},[h,x]),T=!!i&&c.answerable,C=x.length>1||x.some(O=>O.multiSelect||O.options.length===0);function E(O,Y){c.markHeld(),g(K=>{const se=x.find(G=>G.id===O),_=K[O]??(se?bs(se):{selected:[],custom:"",skipped:!1});return{...K,[O]:{..._,...Y}}})}async function q(O){if(!(!i||p)){v(!0),w("");try{const Y=await Fe("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,callId:u.callId,answers:O})});if(Y.status===200&&Y.body.ok!==!1||Y.status===409)return;const K=typeof Y.body.message=="string"?Y.body.message:o("question.submitFailed");w(K)}catch{w(o("question.submitFailed"))}finally{v(!1)}}}function B(O,Y){return Y.skipped?{id:O.id,selected:[]}:Y.custom.trim()&&(O.multiSelect||Y.selected.length===0||O.options.length===0)?O.multiSelect?{id:O.id,selected:Y.selected,custom:Y.custom}:{id:O.id,selected:[],custom:Y.custom}:Y.selected.length?{id:O.id,selected:[...Y.selected]}:null}function ee(){const O=x.map(Y=>B(Y,S[Y.id]??bs(Y)));if(O.some(Y=>Y==null)){w(o("question.incomplete"));return}q(O)}function X(O,Y){if(!T||p)return;if(!O.multiSelect&&x.length===1&&!S[O.id]?.custom){q([{id:O.id,selected:[Y]}]);return}const K=S[O.id]??bs(O),se=O.multiSelect?K.selected.includes(Y)?K.selected.filter(_=>_!==Y):[...K.selected,Y]:[Y];E(O.id,{selected:se,skipped:!1,custom:O.multiSelect?K.custom:""})}return m.jsxs("section",{className:"user-question-card","data-segment":t.id,"data-state":c.continued?"continued":u.state,"data-call":u.callId,"data-session":i||void 0,"data-kind":"question",children:[m.jsx(Kh,{interactive:T,waitLabel:c.waitLabel,onTakeTime:()=>{c.takeTime()},busy:p}),u.questions.map(O=>{const Y=S[O.id]??bs(O);return m.jsxs("article",{className:"user-question","data-question":O.id,children:[O.header?m.jsx("h3",{className:"user-question-header",children:ut(O.header)}):null,m.jsx("p",{className:"user-question-text",children:ut(O.question)}),O.detail?m.jsx("p",{className:"user-question-hint",children:ut(O.detail)}):null,O.multiSelect&&c.answerable?m.jsx("p",{className:"user-question-hint",children:o("question.multiSelect")}):null,m.jsx(c4,{item:O,draft:c.answerable?Y:{selected:O.selected,custom:O.custom,skipped:O.skipped},interactive:T,disabled:p,onToggle:K=>X(O,K)}),T?m.jsxs("div",{className:"user-question-actions",children:[m.jsxs("label",{className:"user-question-custom",children:[m.jsx("span",{children:o("question.customLabel")}),m.jsx("textarea",{value:Y.custom,disabled:p,rows:2,placeholder:o("question.customPlaceholder"),onChange:K=>E(O.id,{custom:K.target.value,skipped:!1})})]}),m.jsx("button",{type:"button",className:"user-question-skip",disabled:p,onClick:()=>{if(x.length===1){q([{id:O.id,selected:[]}]);return}E(O.id,{skipped:!0,selected:[],custom:""})},children:o("question.skip")})]}):null,!T&&O.custom?m.jsx("p",{className:"user-question-hint",children:o("question.custom",{text:ut(O.custom)})}):null,(O.skipped||Y.skipped)&&(u.state!=="open"||T)?m.jsx("p",{className:"user-question-hint",children:o("question.skipped")}):null]},O.id)}),T&&(C||x.some(O=>(S[O.id]?.custom??"").trim()!==""))?m.jsx("button",{type:"button",className:"user-question-submit",disabled:p,onClick:ee,children:o(p?"question.submitting":"question.submit")}):null,y?m.jsx("p",{className:"user-question-status exception",children:y}):null,!c.answerable&&u.state!=="open"&&u.state!=="continued"?m.jsx("p",{className:u.state==="answered"?"user-question-status":"user-question-status exception",children:o(o4[u.state])}):null]})}function h4({segment:t,sessionId:i,onCompose:r,remainingMs:a,waitState:o}){const{t:u}=Ke(),c=Vs(t),h=O0(c.questions),g=$h(i,c.callId,c,a,o),[p,v]=j.useState(!1),[y,w]=j.useState(""),[x,S]=j.useState(!1),[T,C]=j.useState(""),E=!!i&&g.answerable,q=h.item.selected[0],B=q===h.approve.label;async function ee(){if(!(!i||x)){S(!0),C("");try{const O=await Fe("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,callId:c.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:u("question.submitFailed"))}catch{C(u("question.submitFailed"))}finally{S(!1)}}}async function X(){if(!i||x)return;const O=y.trim();if(!O){C(u("question.changesNeeded"));return}S(!0),C("");try{const Y=await Fe("/questions/cancel",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,callId:c.callId})});if(Y.status===200&&Y.body.ok!==!1){r?.(O);return}if(Y.status===409){r?.(O);return}C(typeof Y.body.message=="string"?Y.body.message:u("question.submitFailed"))}catch{C(u("question.submitFailed"))}finally{S(!1)}}return m.jsxs("section",{className:"user-question-card","data-segment":t.id,"data-state":g.continued?"continued":c.state,"data-call":c.callId,"data-session":i||void 0,"data-kind":"plan-review",children:[m.jsx("h3",{className:"user-question-header",children:u("question.planTitle")}),m.jsx("p",{className:"user-question-text",children:ut(h.item.question)}),m.jsx(Kh,{interactive:E,waitLabel:g.waitLabel,onTakeTime:()=>{g.takeTime()},busy:x}),h.plan?p?m.jsx("div",{className:"user-question-plan",children:m.jsx(Is,{text:h.plan})}):m.jsx("p",{className:"user-question-hint",children:ut(h.plan).split(`
62
- `).filter(Boolean).slice(0,2).join(" ")}):null,h.plan?m.jsx("button",{type:"button",className:"user-question-skip",onClick:()=>v(O=>!O),children:u(p?"question.hidePlan":"question.viewFull")}):null,E?m.jsxs("div",{className:"user-question-actions",children:[m.jsxs("label",{className:"user-question-custom",children:[m.jsx("span",{children:u("question.changeComments")}),m.jsx("textarea",{value:y,disabled:x,rows:3,placeholder:u("question.changePlaceholder"),onChange:O=>{g.markHeld(),w(O.target.value)}})]}),m.jsxs("div",{className:"user-question-row",children:[m.jsx("button",{type:"button",className:"user-question-skip",disabled:x,onClick:()=>{X()},children:u("question.requestChanges")}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:x,onClick:()=>{ee()},children:u(x?"question.submitting":"question.approvePlan")})]})]}):q?m.jsx("p",{className:"user-question-status",children:B?u("question.approvePlan"):ut(q)}):c.state==="aborted"?m.jsx("p",{className:"user-question-status exception",children:u("question.aborted")}):c.state==="failed"?m.jsx("p",{className:"user-question-status exception",children:u("question.failed")}):null,T?m.jsx("p",{className:"user-question-status exception",children:T}):null]})}function m4({segment:t,sessionId:i,remainingMs:r,waitState:a}){const{t:o,locale:u}=Ke(),c=Vs(t),h=R0(c.questions),g=$h(i,c.callId,c,r,a),[p,v]=j.useState(!1),[y,w]=j.useState(""),x=!!i&&g.answerable,S=Fd(h.intent.display?.question,u,h.item.question),T=Fd(h.intent.display?.detail,u,h.item.detail),C=Fd(h.intent.display?.approve,u,h.approve.label),E=h.item.selected[0];async function q(B){if(!(!i||p)){v(!0),w("");try{const ee=await Fe("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,callId:c.callId,answers:[{id:h.item.id,selected:[B]}]})});if(ee.status===200&&ee.body.ok!==!1||ee.status===409)return;w(typeof ee.body.message=="string"?ee.body.message:o("question.submitFailed"))}catch{w(o("question.submitFailed"))}finally{v(!1)}}}return m.jsxs("section",{className:"user-question-card","data-segment":t.id,"data-state":g.continued?"continued":c.state,"data-call":c.callId,"data-session":i||void 0,"data-kind":"approval",children:[h.intent.subject?.name?m.jsx("h3",{className:"user-question-header",children:ut(h.intent.subject.name)}):null,m.jsx("p",{className:"user-question-text",children:ut(S)}),T?m.jsx("p",{className:"user-question-hint",children:ut(T)}):null,m.jsx(Kh,{interactive:x,waitLabel:g.waitLabel,onTakeTime:()=>{g.takeTime()},busy:p}),x?m.jsxs("div",{className:"user-question-row",children:[m.jsx("button",{type:"button",className:"user-question-skip",disabled:p,onClick:()=>{q(h.reject.label)},children:o("question.reject")}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:p,onClick:()=>{q(h.approve.label)},children:p?o("question.submitting"):ut(C)||o("question.allow")}),h.always?m.jsx("button",{type:"button",className:"user-question-submit",disabled:p,onClick:()=>{q(h.always.label)},children:o("question.alwaysAllow")}):null]}):E?m.jsx("p",{className:"user-question-status",children:o("question.approvalAnswered")}):c.state==="aborted"?m.jsx("p",{className:"user-question-status exception",children:o("question.aborted")}):c.state==="failed"?m.jsx("p",{className:"user-question-status exception",children:o("question.failed")}):null,y?m.jsx("p",{className:"user-question-status exception",children:y}):null]})}function Zd({approval:t,sessionId:i}){const{t:r,locale:a}=Ke(),[o,u]=j.useState(!1),[c,h]=j.useState(""),[g,p]=j.useState(t.state),v=!!i&&g==="open",y=a.startsWith("zh")&&t.displayReason?.zh?t.displayReason.zh:t.displayReason?.en||t.reason;async function w(S){if(!(!i||o)){u(!0),h("");try{const T=await Fe("/approvals/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,requestId:t.requestId,outcome:S})});if(T.status===200&&T.body.ok!==!1){p(S);return}if(T.status===409){p(S);return}h(typeof T.body.message=="string"?T.body.message:r("approval.submitFailed"))}catch{h(r("approval.submitFailed"))}finally{u(!1)}}}const x=g==="allowed-once"?r("approval.allowed"):g==="rejected"?r("approval.rejected"):g==="cancelled"?r("approval.cancelled"):g==="unavailable"?r("approval.failed"):null;return m.jsxs("section",{className:"user-question-card","data-kind":"tool-approval","data-state":g,"data-request":t.requestId,"data-session":i||void 0,children:[m.jsx("h3",{className:"user-question-header",children:r("approval.title")}),m.jsx("p",{className:"user-question-text",children:ut(t.toolName)}),y?m.jsx("p",{className:"user-question-hint",children:ut(y)}):null,v?m.jsxs("div",{className:"user-question-row",children:[m.jsx("button",{type:"button",className:"user-question-skip",disabled:o,onClick:()=>{w("rejected")},children:r("approval.reject")}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:o,onClick:()=>{w("allowed-once")},children:r(o?"question.submitting":"approval.allowOnce")})]}):x?m.jsx("p",{className:g==="allowed-once"?"user-question-status":"user-question-status exception",children:x}):null,c?m.jsx("p",{className:"user-question-status exception",children:c}):null]})}function kb(t){return t.type==="user"&&t.segment?`user:${t.segment.id}`:t.type==="turn"&&typeof t.turn=="number"?`turn:${t.turn}`:"start"}function p4(t,i,r,a){const o=new Map;for(const c of t){const h=r.get(c.id);h&&o.set(c.id,h)}const u=t[0];return u&&!r.has(u.id)&&!i.has(u.id)&&(r.set(u.id,a),o.set(u.id,a)),o}function g4(t,i,r,a){const o=new Map;for(const u of t){const c=r.get(u.id);if(c){o.set(u.id,c);continue}u.ticketId&&i.has(u.ticketId)||(r.set(u.id,a),o.set(u.id,a))}return o}function y4(t,i,r,a){for(const u of t){if(r.has(u.requestId))continue;const c=u.callId?i.get(u.callId):void 0;c!=null?r.set(u.requestId,{turn:c,callId:u.callId}):a>=0&&r.set(u.requestId,{turn:a})}const o=new Map;for(const u of t){const c=r.get(u.requestId);c&&o.set(u.requestId,c)}return o}function v4(t,i){if(!t)return"";const r=new Date(t);return Number.isNaN(r.getTime())?"":r.toLocaleTimeString(i==="zh"?"zh-CN":"en",{hour:"2-digit",minute:"2-digit"})}function b4({sessionId:t,segments:i,completed:r,failures:a,retries:o,turnEnds:u,tickets:c,now:h,canRetry:g,onRetry:p,onSupply:v,onOpenSession:y,onOpenFile:w,onOpenInbox:x,botLabel:S,chat:T=!1,cwd:C,connectionPhase:E,approvals:q=[],questionWaits:B,onCompose:ee}){const X=[];let O=null;const Y=()=>{O&&(O.segments.length||a[O.turn]||o[O.turn]?.length)&&X.push(O),O=null};for(const J of i){if(J.kind==="user"){Y(),Pb(J.text)||X.push({type:"user",segment:J});continue}const ae=J.turn??-1;(!O||O.turn!==ae)&&(Y(),O={type:"turn",turn:ae,seconds:r[ae],segments:[]}),O.segments.push(J)}Y();const K=new Set(X.flatMap(J=>J.type==="turn"?[J.turn]:[]));for(const J of Object.keys(a)){const ae=Number(J);K.has(ae)||X.push({type:"turn",turn:ae,seconds:r[ae],segments:[]})}const se=c.map(J=>({...J,summary:ut(J.summary),events:J.events.map(ae=>({...ae,text:ut(ae.text)}))})),_=new Map(se.map(J=>[J.id,J])),G=new Map;for(const J of X)if(J.type==="turn"){for(const ae of G0(J.segments))if(ae.type==="activity")for(const Oe of ae.segments){if(Oe.kind!=="tool")continue;const be=tx(Oe);be&&_.has(be)&&!G.has(be)&&G.set(be,Oe.id)}}const te=X.reduce((J,ae)=>ae.type==="turn"?Math.max(J,ae.turn):J,-1),Te=ex(c),xe=V0(),fe=j.useRef({sessionId:t,work:new Map,canvas:new Map,approval:new Map});fe.current.sessionId!==t&&(fe.current={sessionId:t,work:new Map,canvas:new Map,approval:new Map});const re=X.length>0?kb(X[X.length-1]):"start",ue=new Set(G.keys()),ge=p4(Wb(se),ue,fe.current.work,re);for(const[J,ae]of fe.current.work)_.has(J)&&ge.set(J,ae);const me=new Set;for(const J of ue)_.has(J)&&!ge.has(J)&&me.add(J);for(const J of ge.keys())_.has(J)&&me.add(J);const A=g4([...xe.loose,...xe.byTicket.values()],me,fe.current.canvas,re),Ee=new Map;for(const J of X)if(J.type==="turn")for(const ae of J.segments)ae.kind==="tool"&&ae.callId&&!Ee.has(ae.callId)&&Ee.set(ae.callId,J.turn);const Be=y4(q,Ee,fe.current.approval,te),M=new Map([...xe.loose,...xe.byTicket.values()].map(J=>[J.id,J])),z=J=>{const ae=xe.byTicket.get(J);return!ae||A.has(ae.id)?null:ae},ne=J=>{const ae=[...ge.entries()].filter(([,be])=>be===J).map(([be])=>be),Oe=[...A.entries()].filter(([,be])=>be===J).map(([be])=>be);return ae.length===0&&Oe.length===0?null:m.jsxs(j.Fragment,{children:[ae.map(be=>{const we=_.get(be);if(!we)return null;const P=z(be);return m.jsxs(j.Fragment,{children:[m.jsx(i1,{ticket:we,now:h,onSupply:v,onOpen:y}),P?m.jsx(vh,{item:P,onOpen:()=>xe.open(P.id)}):null]},we.id)}),Oe.map(be=>{const we=M.get(be);return we?m.jsx(vh,{item:we,onOpen:()=>xe.open(we.id)},we.id):null})]},`pin:${J}`)};return m.jsxs(m.Fragment,{children:[ne("start"),X.map((J,ae)=>m.jsxs(j.Fragment,{children:[J.type==="user"?m.jsx(x4,{segment:J.segment,botLabel:S,onOpenInbox:x,onOpenFile:w}):m.jsx(E4,{sessionId:t,cwd:C,connectionPhase:E,block:J,index:ae,blocks:X,failures:a,retries:o,turnEnds:u,latestTurn:te,background:Te,byId:_,anchorAt:G,now:h,canRetry:g,onRetry:p,onSupply:v,onOpenSession:y,onOpenFile:w,chat:T,approvals:q,approvalSpots:Be,questionWaits:B,onCompose:ee,skipTickets:ge,looseCanvasIds:A}),ne(kb(J))]},J.type==="user"?J.segment.id:`${t}:turn-${J.turn}`))]})}function x4({segment:t,botLabel:i,onOpenInbox:r,onOpenFile:a}){const o=$u(t.text),u=Sh(t.text),{locale:c}=Ke(),h=v4(t.time,c);if(u)return m.jsx(K3,{briefing:u,time:h,mark:t.id,onOpenFile:a});if(o){const g=pO([{kind:"in",id:t.id,seq:t.seq,time:t.time,mail:o}],i);return m.jsx(bO,{who:g?.who??"BOT",preview:g?.preview??"",time:h,mark:t.id,onOpen:r})}return m.jsxs("div",{className:"user-row","data-turn":t.id,children:[m.jsx("div",{className:"user-bubble",children:t.text}),h?m.jsx("time",{children:h}):null]})}function w4(t,i,r){for(let a=i-1;a>=0;a-=1){const o=t[a];if(o?.type==="user"&&o.segment&&o.segment.text.trim()!==""){if($u(o.segment.text)||Sh(o.segment.text))continue;if(o.segment.turn==null||o.segment.turn===r)return o.segment.text;break}}return""}function S4(t,i){return t.slice(i+1).some(r=>r.type==="user")}function k4({seconds:t,failure:i,retries:r,prompt:a,continued:o,canRetry:u,onRetry:c,showLabel:h}){const{t:g}=Ke(),[p,v]=j.useState(!1);if(!i&&r.length===0)return null;const y=p||o;return m.jsxs("div",{className:"turn-failure",children:[h?m.jsxs("p",{className:"turn-failed-label",children:["Failed",t!=null?m.jsxs(m.Fragment,{children:[" ","· ",m.jsxs("span",{className:"duration",children:[t,"s"]})]}):null]}):null,r.map(w=>m.jsxs("details",{className:"retry-row",open:w.state==="scheduled",children:[m.jsxs("summary",{children:[w.state==="started"?"Retried model request":"Retrying model request"," (",w.retry,"/",w.maxRetries??"∞",") · ",Math.max(1,Math.ceil(w.delayMs/1e3)),"s"]}),m.jsxs("p",{children:["Retry delay: ",Math.round(w.delayMs),"ms"]}),m.jsxs("p",{children:["Failure reason: ",w.message]})]},`${w.retryId}:${w.retry}`)),i?m.jsxs("p",{className:"turn-error",role:"status",children:[m.jsx("span",{className:"turn-error-title",children:"This turn failed"}),m.jsx("span",{children:i.message}),i.code?m.jsx("code",{children:i.code}):null]}):null,i&&a&&!y?m.jsx("button",{type:"button",className:"retry-turn",disabled:!u,onClick:()=>{v(!0),c(a)},children:g("bot.retry")}):null]})}function E4({sessionId:t,block:i,index:r,blocks:a,failures:o,retries:u,turnEnds:c,latestTurn:h,background:g,byId:p,anchorAt:v,now:y,canRetry:w,onRetry:x,onSupply:S,onOpenSession:T,onOpenFile:C,chat:E=!1,cwd:q,connectionPhase:B,approvals:ee=[],approvalSpots:X,questionWaits:O,onCompose:Y,skipTickets:K,looseCanvasIds:se}){const{t:_}=Ke(),G=V0(),te=G0(i.segments),Te=new Set,xe=me=>O?.[me]??O?.[`${t}:${me}`],fe=me=>ee.filter(A=>{const Ee=X.get(A.requestId);return!Ee||Ee.turn!==i.turn||!Ee.callId||!me.includes(Ee.callId)||Te.has(A.requestId)?!1:(Te.add(A.requestId),!0)}),re=()=>ee.filter(me=>{const A=X.get(me.requestId);return!A||A.turn!==i.turn||Te.has(me.requestId)?!1:(Te.add(me.requestId),!0)}),ue=te.some(me=>me.type==="activity"),ge=E&&c[i.turn]==="aborted"&&!o[i.turn]&&!(i.turn===h&&g);return m.jsx("div",{children:m.jsxs("div",{"data-turn":`turn:${i.turn}`,children:[te.map(me=>{if(me.type==="text")return m.jsx("div",{"data-segment":me.segment.id,className:me.segment.streaming?"assistant streaming":"assistant",children:m.jsx(Is,{text:me.segment.text,streaming:me.segment.streaming,onOpenFile:C})},me.segment.id);if(me.type==="question"){const Ee=xe(me.segment.callId);return m.jsxs(j.Fragment,{children:[m.jsx(f4,{segment:me.segment,sessionId:t,onCompose:Y,remainingMs:Ee?.remainingMs,waitState:Ee?.waitState}),fe([me.segment.callId]).map(Be=>m.jsx(Zd,{approval:Be,sessionId:t},Be.requestId))]},me.segment.id)}const A=me.segments.filter(Ee=>Ee.kind==="tool");return m.jsxs(j.Fragment,{children:[m.jsx(e4,{segments:me.segments,cwd:q,tickets:[...p.values()],connectionPhase:B}),fe(A.map(Ee=>Ee.callId)).map(Ee=>m.jsx(Zd,{approval:Ee,sessionId:t},Ee.requestId)),A.filter(Ee=>Uk(Ee)).map(Ee=>m.jsx(P3,{text:ut(Hk(Ee.result,_))},Ee.id)),A.flatMap(Ee=>{const Be=tx(Ee),M=Be?p.get(Be):void 0;if(!Be||!M||v.get(Be)!==Ee.id||K.has(Be))return[];const z=G.byTicket.get(M.id),ne=z&&se.has(z.id)?null:z;return[m.jsx(i1,{ticket:M,now:y,onSupply:S,onOpen:T},M.id),ne?m.jsx(vh,{item:ne,onOpen:()=>G.open(ne.id)},ne.id):null]})]},me.id)}),re().map(me=>m.jsx(Zd,{approval:me,sessionId:t},me.requestId)),ge?m.jsx("p",{className:"work-note",children:_("bot.stopped")}):null,m.jsx(k4,{seconds:i.seconds,failure:o[i.turn],retries:u[i.turn]??[],prompt:w4(a,r,i.turn),continued:S4(a,r),canRetry:w,onRetry:x,showLabel:!ue}),i.turn===h&&c[i.turn]==="aborted"&&g?m.jsx("p",{className:"work-note",children:_("bot.stoppedBackground")}):null]})})}const qs=8;function Eb(){return{following:!0,programmaticTop:null,suppressRejoin:!1,lastTop:null,lastHeight:null}}function Hu(t){return t.scrollHeight-t.scrollTop-t.clientHeight}function T4(t,i){return i.scrollTop<=1&&Hu(i)<=qs?!1:(t.following=!1,!0)}function j4(t){t.following=!1}function C4(t,i){const r=Hu(i),a=t.programmaticTop!=null&&Math.abs(i.scrollTop-t.programmaticTop)<=1;t.programmaticTop=null;const o=t.lastHeight!=null&&i.scrollHeight!==t.lastHeight,u=t.lastTop!=null&&i.scrollTop<t.lastTop-1,c=t.lastTop!=null&&i.scrollTop>t.lastTop+1;return!a&&!o&&u&&(t.following=!1),!t.following&&!t.suppressRejoin&&!a&&!o&&c&&r<=qs&&(t.following=!0),t.lastTop=i.scrollTop,t.lastHeight=i.scrollHeight,{following:t.following,detached:!t.following&&r>qs}}function Kd(t){return Math.max(0,t.scrollHeight-t.clientHeight)}function Tb(t,i){let r=i instanceof Element?i:i instanceof Node?i.parentElement:null;for(;r&&r!==t;){const a=getComputedStyle(r).overflowY;if((a==="auto"||a==="scroll"||a==="overlay")&&r.scrollHeight>r.clientHeight+1&&r.scrollTop>1)return!0;r=r.parentElement}return!1}function N4(t){const i=j.useRef(null),r=j.useRef(null),a=j.useRef(Eb()),o=j.useRef(!1),[u,c]=j.useState(!1),h=j.useCallback(v=>{if(!v){c(!1);return}const y=!a.current.following&&Hu(v)>qs;c(w=>w===y?w:y)},[]),g=j.useCallback(()=>{const v=i.current;if(!v||!a.current.following){h(v);return}const y=Kd(v);if(Math.abs(v.scrollTop-y)<=1){a.current.programmaticTop=null,h(v);return}a.current.programmaticTop=y,v.scrollTop=y,h(v)},[h]),p=j.useCallback((v="auto")=>{const y=i.current;if(a.current.following=!0,a.current.suppressRejoin=!1,c(!1),!y)return;const w=Kd(y),x=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(v==="smooth"&&!x&&y.scrollTop<w-1){o.current=!0,a.current.programmaticTop=null,y.scrollTo({top:w,behavior:"smooth"});return}o.current=!1,a.current.programmaticTop=w,y.scrollTop=w},[]);return j.useLayoutEffect(()=>{const v=Eb();a.current=v,o.current=!1,c(!1);const y=i.current;if(!y)return;const w=Kd(y);v.programmaticTop=w,v.lastTop=w,v.lastHeight=y.scrollHeight,y.scrollTop=w},[t]),j.useEffect(()=>{const v=i.current,y=r.current;if(!v||!y)return;const w=()=>{o.current&&(o.current=!1,a.current.suppressRejoin=!0,requestAnimationFrame(()=>{v.scrollTop=v.scrollTop,requestAnimationFrame(()=>{a.current.suppressRejoin=!1})}))},x=()=>{T4(a.current,v)&&(w(),h(v))},S=()=>{j4(a.current),w(),h(v)},T=()=>{const K=C4(a.current,v);K.following&&Hu(v)<=qs&&(o.current=!1),c(se=>se===K.detached?se:K.detached)},C=K=>{K.deltaY<0&&!Tb(v,K.target)&&x()};let E=0;const q=K=>{E=K.touches[0]?.clientY??0},B=K=>{const se=K.touches[0]?.clientY??E;se>E+8&&!Tb(v,K.target)&&x(),E=se},ee=K=>{if(K.altKey||K.metaKey||K.ctrlKey||K.shiftKey)return;const se=K.target;se instanceof HTMLInputElement||se instanceof HTMLTextAreaElement||se instanceof HTMLSelectElement||(K.key==="PageUp"||K.key==="ArrowUp"||K.key==="Home")&&x()},X=K=>{const se=K.target;se instanceof Element&&se.closest("button.official-title, summary")&&S()},O=()=>{const K=document.getSelection();if(!K||K.isCollapsed)return;const se=K.anchorNode;!se||!v.contains(se)||S()},Y=new ResizeObserver(()=>{g()});return Y.observe(y),v.addEventListener("scroll",T,{passive:!0}),v.addEventListener("wheel",C,{passive:!0}),v.addEventListener("touchstart",q,{passive:!0}),v.addEventListener("touchmove",B,{passive:!0}),v.addEventListener("keydown",ee),v.addEventListener("pointerdown",X),document.addEventListener("selectionchange",O),g(),()=>{Y.disconnect(),v.removeEventListener("scroll",T),v.removeEventListener("wheel",C),v.removeEventListener("touchstart",q),v.removeEventListener("touchmove",B),v.removeEventListener("keydown",ee),v.removeEventListener("pointerdown",X),document.removeEventListener("selectionchange",O)}},[t,h,g]),{scrollRef:i,contentRef:r,detached:u,pin:p,stickIfFollowing:g}}function jb({label:t,onClick:i}){return m.jsx("button",{type:"button",className:"jump-latest","aria-label":t,onClick:i,children:m.jsx(n1,{})})}function Cb(){const t=location.hash.replace(/^#\/?/,"").split("/");for(let i=0;i<t.length-1;i+=1){const r=t[i],a=t[i+1];if(r==="s"&&a)return decodeURIComponent(a)}return""}function Nb(t,i,r){if(!(r in i))return i;const a={...i};return delete a[r],sessionStorage.setItem(t,JSON.stringify(a)),a}function $d(t){try{const i=JSON.parse(sessionStorage.getItem(t)||"{}");return i&&typeof i=="object"?i:{}}catch{return{}}}function Ab(t){if(!t||typeof t!="object"||Array.isArray(t))return{};const i={};for(const[r,a]of Object.entries(t))typeof a=="string"&&a!==""&&(i[r]=a);return i}function Jd(t){fetch("/dsh-bot/api/sessions/previews",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(t),keepalive:!0})}function Ob(t){return(t??"").split("/").filter(Boolean).at(-1)??""}function A4(){return new Promise(t=>{const i=location.protocol==="https:"?"wss:":"ws:",r=new WebSocket(`${i}//${location.host}/api/remote.mux`),a=window.setTimeout(()=>{r.close(),t([])},4e3),o=u=>{window.clearTimeout(a),r.close(),t(u)};r.addEventListener("open",()=>{r.send(JSON.stringify({type:"open",streamId:"archive",endpoint:"workspace/follow",payload:{args:{}}}))}),r.addEventListener("message",u=>{try{const c=JSON.parse(String(u.data)),h=c.value?.type==="baseline"?c.value.value?.archivedSessionIds:void 0;if(!Array.isArray(h))return;o(h.filter(g=>typeof g=="string"))}catch{}}),r.addEventListener("error",()=>o([]))})}function O4(){const{t,locale:i,setLocale:r}=Ke(),[a,o]=j.useState(Cb),[u,c]=j.useState([]),[h,g]=j.useState(""),[p,v]=j.useState(""),[y,w]=j.useState(!1),[x,S]=j.useState(()=>$d("dsh-bot.titles")),[T,C]=j.useState(()=>$d("dsh-bot.previews")),[E,q]=j.useState(Xd),[B,ee]=j.useState(""),[X,O]=j.useState(null),[Y,K]=j.useState(a);Y!==a&&(K(a),q(Xd()));const[se,_]=j.useState(null),[G,te]=j.useState({ready:!1,reason:"loading"}),[Te,xe]=j.useState(null),[fe,re]=j.useState(null),[ue,ge]=j.useState(!1),[me,A]=j.useState(""),[Ee,Be]=j.useState(0),[M,z]=j.useState(0),[ne,J]=j.useState(""),[ae,Oe]=j.useState(""),[be,we]=j.useState(!1),[P,ye]=j.useState(null),[We,et]=j.useState(null),[Ne,tt]=j.useState([]),[$e,Ie]=j.useState({}),[Me,Qe]=j.useState(!1),[vt,he]=j.useState(!1),[Le,bt]=j.useState({}),[bn]=j.useState(()=>C0(async()=>{const N=await Fe("/authorization");if(N.status!==200)throw new Error("Authorization catalog unavailable");return{available:N.body.available,entries:N.body.entries}})),Lt=j.useRef(void 0),Z=j.useRef(null),[ce,Se]=j.useState(null),[Ce,Tt]=j.useState(0),[je,Ge]=j.useState(!1),[Rt,Gt]=j.useState(()=>new Set),[on,Sn]=j.useState(!1),[Ri,qt]=j.useState(!1),[Xe,Wt]=j.useState(!1),[un,Fn]=j.useState(""),[_i,$]=j.useState(0),[oe,mt]=j.useState(()=>new Set),[_t,ft]=j.useState({}),[Yt,Ut]=j.useState({}),[_l,zl]=j.useState(!1),[ec,vr]=j.useState({}),[zi,br]=j.useState(()=>Date.now()),[Gn,Ml]=j.useState(""),ql=dO(a,_i);j.useEffect(()=>{tt([]),Ie({});const N=jO({visible:!document.hidden,fetch:async W=>{const pe=await Fe(`/interactions?compact=1&sessionId=${encodeURIComponent(a)}`,{signal:W});if(pe.status!==200)throw new Error("Interactions unavailable");return pe.body},active:W=>{const pe=W;return!!(pe.questions?.length||pe.approvals?.some(_e=>_e.state==="open")||pe.authorization?.prompts?.length||pe.authorization?.inFlight?.length)},apply:W=>{const pe=W,_e=Array.isArray(pe.approvals)?pe.approvals:[];tt(_e);const Re={};if(Array.isArray(pe.questions))for(const wt of pe.questions)typeof wt.callId=="string"&&wt.callId!==""&&(Re[wt.callId]={remainingMs:wt.remainingMs,waitState:wt.waitState});Ie(Re);const Ze=pe.authorization,dt=Ze&&typeof Ze=="object"?Ze.prompts:[];he(Array.isArray(dt)&&dt.length>0);const ht=Ze&&typeof Ze=="object"?Ze:{},lt=JSON.stringify([ht.catalogRevision,ht.available]);Lt.current!==lt&&(Lt.current=lt,bn.invalidate()),bt(wt=>JSON.stringify(wt)===JSON.stringify(ht)?wt:ht)},schedule:(W,pe)=>{const _e=window.setTimeout(W,pe);return()=>window.clearTimeout(_e)}});Z.current=N;const I=()=>N.setVisible(!document.hidden);return document.addEventListener("visibilitychange",I),()=>{N.close(),Z.current===N&&(Z.current=null),document.removeEventListener("visibilitychange",I)}},[a,bn]),j.useEffect(()=>{Fe("/cua").then(N=>Qe(N.body.available===!0))},[]);const{scrollRef:Dl,contentRef:tc,detached:ga,pin:Ll,stickIfFollowing:$i}=N4(`${Xe?"bot":"main"}:${a}`),Ys=j.useRef(null),xr=j.useRef(null),ya=j.useRef(null),wr=j.useRef(null),Bl=j.useRef(new Set),Sr=j.useRef(0),Ul=j.useRef(new Map),Hl=j.useRef(0),Mn=j.useRef(new Map),Qt=j.useRef(!1),en=j.useRef(a),hi=j.useRef(null);en.current=a;function mi(N){return _t[N.sessionId]||x[N.sessionId]||N.title||Ob(N.cwd)||t("session.unnamed")}function va(N){const I=u.find(W=>W.sessionId===N);return I?mi(I):_t[N]||x[N]||""}const nc=j0(E.segments),pi=a!==""&&B!==a&&(X==null||X.phase==="restoring"||X.phase==="connecting"||X.phase==="syncing"&&B!==a),Il=X?.fraction!=null?{loaded:Math.round(X.fraction*1e3),total:1e3}:null,Ji=X?.phase==="syncing"&&X.fraction!=null,Mi=j.useMemo(()=>mO(E.segments),[E.segments]),qi=j.useMemo(()=>jR(Mi),[Mi]),Pi=a?mi({sessionId:a,cwd:u.find(N=>N.sessionId===a)?.cwd,title:E.title||null}):t("app.title"),Vl=a?`/#/s/${encodeURIComponent(a)}`:"/";function qn(N){Wt(!1),o(N),we(!1),Ge(!1),Se(null),_(null),Oe(""),Fn("");const I=N?`#/s/${encodeURIComponent(N)}`:"#/";location.hash!==I&&history.replaceState(null,"",I)}function Xt(N){if(!N||N===a)return;const I=a;Wt(!1),o(N),we(!1),Ge(!1),Se(null),_(null),Oe(""),Fn("");const W=`#/s/${encodeURIComponent(N)}`;location.hash!==W&&history.pushState({kind:"worker",owner:I},"",W)}function ba(){if(Wt(!1),we(!1),Ge(!1),Se(null),history.state?.kind==="worker"){history.back();return}Gn&&qn(Gn)}j.useEffect(()=>{let N=!1;return A4().then(I=>{N||Gt(new Set(I))}),()=>{N=!0}},[]);function xa(N){const I=Rk(N);I&&(vr(I.signals),Ut(I.cards),zl(!0));const W=N.desk;if(!W||typeof W!="object"||Array.isArray(W))return;const pe=W,_e=pe.sessions;if(_e&&typeof _e=="object"&&!Array.isArray(_e)){const ht=_e,lt=ht.result;if(lt?.ok!==!0)g(lt?.error?.message||String(ht.error||t("session.listUnavailable")));else if(g(""),c(Er(lt.value?.items)),wa(ht.previews),!Qt.current){Qt.current=!0;const wt=Ab(ht.previews),gt={};for(const[jt,ii]of Object.entries($d("dsh-bot.previews")))Bl.current.has(jt)||wt[jt]||!ii||(gt[jt]=ii);Object.keys(gt).length>0&&Jd({previews:gt})}}const Re=pe.bots;if(Re&&typeof Re=="object"&&!Array.isArray(Re)&&Re.ok===!0){const ht=Re,lt=Array.isArray(ht.bots)?ht.bots:[],wt=lt.flatMap(jt=>{if(!jt||typeof jt!="object")return[];const ii=jt.sessionId;return typeof ii=="string"?[ii]:[]}),gt={};for(const jt of lt){if(!jt||typeof jt!="object")continue;const ii=jt.sessionId,tn=jt.name;typeof ii=="string"&&typeof tn=="string"&&tn!==""&&(gt[ii]=tn)}if(wt.length===0&&Array.isArray(ht.sessionIds))for(const jt of ht.sessionIds)typeof jt=="string"&&wt.push(jt);mt(new Set(wt)),ft(gt)}const Ze=pe.health;if(Ze&&typeof Ze=="object"&&!Array.isArray(Ze)){const ht=Ze;xe(ht),ht.execution&&te({ready:ht.execution.ready===!0,reason:ht.execution.reason||(ht.execution.ready===!0?"":"catalog_unreadable")})}const dt=pe.usage;dt&&typeof dt=="object"&&!Array.isArray(dt)&&re(dt)}j.useEffect(()=>{let N=!1;return(async()=>{try{const I=await Fe("/sessions");if(N)return;const W=I.body.result;W?.ok===!0?(g(""),c(Er(W.value?.items)),wa(I.body.previews)):I.status!==200&&g(W?.error?.message||t("session.listUnavailable"))}catch{}try{const I=await Fe("/sessions/bots");if(N||I.body.ok!==!0)return;const W=Array.isArray(I.body.bots)?I.body.bots:[],pe=W.flatMap(Re=>{if(!Re||typeof Re!="object")return[];const Ze=Re.sessionId;return typeof Ze=="string"?[Ze]:[]}),_e={};for(const Re of W){if(!Re||typeof Re!="object")continue;const Ze=Re.sessionId,dt=Re.name;typeof Ze=="string"&&typeof dt=="string"&&dt!==""&&(_e[Ze]=dt)}if(pe.length===0&&Array.isArray(I.body.sessionIds))for(const Re of I.body.sessionIds)typeof Re=="string"&&pe.push(Re);mt(new Set(pe)),ft(_e)}catch{}})(),()=>{N=!0}},[]),j.useEffect(()=>{let N=!1,I=null,W=0,pe=2e3,_e,Re;const Ze=lt=>{let wt;try{wt=JSON.parse(String(lt.data))}catch{return null}return wt.ok===!0?wt:null},dt=()=>{if(I?.close(),_e=void 0,Re=void 0,N||document.hidden||typeof EventSource>"u")return;const lt=new EventSource(`/dsh-bot/api/live?sessionId=${encodeURIComponent(a)}`);I=lt,lt.addEventListener("interaction-error",()=>{!N&&I===lt&&Z.current?.disconnected()}),lt.addEventListener("interactions",wt=>{if(N||I!==lt)return;const gt=Ze(wt);gt?.sessionId===a&&(pe=2e3,Z.current?.ingest(gt))}),lt.addEventListener("canvas",wt=>{if(N||I!==lt)return;const gt=Ze(wt);!gt||!Array.isArray(gt.events)||gt.events.length===0||(pe=2e3,Tt(jt=>jt+1))}),lt.addEventListener("snapshot",wt=>{if(N||I!==lt)return;const gt=Ze(wt);gt&&(pe=2e3,gt.desk!==void 0&&(_e=gt.desk),gt.work!==void 0&&(Re=gt.work),xa(gt))}),lt.addEventListener("delta",wt=>{if(N||I!==lt)return;const gt=Ze(wt);if(!gt)return;const jt={ok:!0};gt.desk!==void 0&&_e!==void 0&&(_e=zs(_e,gt.desk),jt.desk=_e),gt.work!==void 0&&Re!==void 0&&(Re=zs(Re,gt.work),jt.work=Re),(jt.desk!==void 0||jt.work!==void 0)&&xa(jt)}),lt.addEventListener("error",()=>{N||I!==lt||(Z.current?.disconnected(),lt.close(),I===lt&&(I=null),W=window.setTimeout(dt,pe),pe=Math.min(15e3,pe*2))})},ht=()=>{window.clearTimeout(W),document.hidden?(I?.close(),I=null):(pe=2e3,dt())};return document.addEventListener("visibilitychange",ht),dt(),()=>{N=!0,document.removeEventListener("visibilitychange",ht),window.clearTimeout(W),I?.close()}},[a]),j.useEffect(()=>{const N=()=>{Wt(!1),we(!1),Ge(!1),Se(null),_(null),Oe(""),Fn(""),o(Cb())};return window.addEventListener("hashchange",N),()=>window.removeEventListener("hashchange",N)},[]),j.useEffect(()=>{let N=!1;return bb().then(W=>{N||(hi.current=mb({follow:fb({addressOf:pe=>fa(pe)}),page:pb({addressOf:pe=>fa(pe)}),cdc:yb({cache:W}),range:hb(),checkpoint:W}))}),()=>{N=!0}},[]),j.useEffect(()=>{if(!a){ee(""),O(null);return}q(Xd()),O(null);let N=!1,I=null;return(async()=>{const W=await bb();if(N)return;const pe=hi.current??mb({follow:fb({addressOf:Re=>fa(Re)}),page:pb({addressOf:Re=>fa(Re)}),cdc:yb({cache:W}),range:hb(),checkpoint:W});hi.current=pe;const _e=pe.open(a,{enhancement:"auto"});I=_e,_e.onBatch(Re=>{N||en.current!==a||(q(Ze=>{let dt=Ze;for(const ht of Re.events)dt=XR(dt,ht);return dt}),ee(a))}),_e.onEphemeral(Re=>{N||en.current!==a||q(Ze=>ZR(Ze,Re))}),_e.onStatus(Re=>{N||en.current!==a||(O(Re),(Re.phase==="live"||Re.phase==="stalled"||Re.phase==="error")&&ee(a))})})(),()=>{N=!0,I?.close()}},[a]),j.useEffect(()=>{!a||Y!==a||!E.title||_t[a]||S(N=>{if(N[a]===E.title)return N;const I={...N,[a]:E.title};return sessionStorage.setItem("dsh-bot.titles",JSON.stringify(I)),I})},[a,Y,E.title,_t]);const Wi=!!a&&oe.has(a),Ht=Wi&&_l?Yt[a]??[]:[],gi=Wi&&_l?a:"";j.useEffect(()=>{if(!a||!dr(a)){Ml("");return}let N=!1;const I=Nk(a);return Ni(`/dsh-bot/api/work/ticket?id=${encodeURIComponent(I)}`).then(W=>{if(N||W.body.ok!==!0||!W.body.ticket||typeof W.body.ticket!="object")return;const pe=W.body.ticket.owner_session_id;typeof pe=="string"&&Ml(pe)}),()=>{N=!0}},[a]);const Fs=Ht.some(N=>N.status==="started");j.useEffect(()=>{if(!Fs)return;const N=window.setInterval(()=>br(Date.now()),1e3);return()=>window.clearInterval(N)},[Fs]);function wa(N){const I=Ab(N);Object.keys(I).length!==0&&C(W=>{let pe=!1;const _e={...W};for(const[Re,Ze]of Object.entries(I))_e[Re]||(_e[Re]=Ze,pe=!0);return pe?(sessionStorage.setItem("dsh-bot.previews",JSON.stringify(_e)),_e):W})}function Sa(){window.clearTimeout(Hl.current),Hl.current=0;const N=[...Ul.current];if(Ul.current.clear(),N.length!==0){if(N.length===1){const[I,W]=N[0]??[];I&&W&&Jd({sessionId:I,preview:W});return}Jd({previews:Object.fromEntries(N)})}}j.useEffect(()=>()=>{Sa()},[]),j.useEffect(()=>{if(!a||Y!==a)return;const N=KR(E.segments);!N||Mn.current.get(a)===N||(Mn.current.set(a,N),C(I=>{if(I[a]===N)return I;const W={...I,[a]:N};return sessionStorage.setItem("dsh-bot.previews",JSON.stringify(W)),W}),Ul.current.set(a,N),window.clearTimeout(Hl.current),Hl.current=window.setTimeout(Sa,400))},[a,Y,E.segments]),j.useLayoutEffect(()=>{const N=wr.current;if(!N||!P)return;const I=N.getBoundingClientRect(),W=Math.max(8,Math.min(P.x,window.innerWidth-I.width-8)),pe=Math.max(8,Math.min(P.y,window.innerHeight-I.height-8));(W!==P.x||pe!==P.y)&&ye(_e=>_e&&{..._e,x:W,y:pe}),N.querySelector("button")?.focus()},[P]),j.useEffect(()=>{if(!P)return;const N=()=>ye(null),I=pe=>{const _e=pe.target;_e instanceof Node&&wr.current?.contains(_e)||N()},W=pe=>{pe.key==="Escape"&&N()};return document.addEventListener("pointerdown",I),document.addEventListener("keydown",W),document.addEventListener("scroll",N,!0),()=>{document.removeEventListener("pointerdown",I),document.removeEventListener("keydown",W),document.removeEventListener("scroll",N,!0)}},[P]),j.useEffect(()=>{if(!be)return;const N=W=>{const pe=W.target;pe instanceof Node&&ya.current?.contains(pe)||we(!1)},I=W=>{W.key==="Escape"&&we(!1)};return document.addEventListener("pointerdown",N),document.addEventListener("keydown",I),()=>{document.removeEventListener("pointerdown",N),document.removeEventListener("keydown",I)}},[be]),j.useEffect(()=>{Wt(!1)},[a]),j.useLayoutEffect(()=>{const N=Ys.current,I=Dl.current;if(!N||!I)return;const W=()=>{const _e=Number.parseFloat(getComputedStyle(N).getPropertyValue("--composer-fade"))||0,Re=N.hidden?0:Math.max(0,N.offsetHeight-_e);(Number.parseFloat(I.style.paddingBottom)||0)!==Re&&(I.style.paddingBottom=`${Re}px`,$i())};W();const pe=new ResizeObserver(W);return pe.observe(N),()=>{pe.disconnect(),I.style.paddingBottom=""}},[Xe,Dl,$i]);const st=j.useMemo(()=>{const N=p.trim().toLowerCase();return u.filter(I=>dr(I.sessionId)||Rt.has(I.sessionId)?!1:N?[mi(I),I.cwd??"",T[I.sessionId]??""].join(" ").toLowerCase().includes(N):!0)},[u,p,x,T,Rt,_t]).filter(N=>!N.blank),ti=j.useMemo(()=>{const N=p.trim().toLowerCase();return u.filter(I=>I.blank!==!0||dr(I.sessionId)?!1:N?[mi(I),I.cwd??""].join(" ").toLowerCase().includes(N):!0)},[u,p,x,_t]),el=on||p.trim()!=="",kr=j.useMemo(()=>!a||!oe.has(a)?[]:u.flatMap(N=>!oe.has(N.sessionId)||N.sessionId===a||Rt.has(N.sessionId)||dr(N.sessionId)?[]:[{sessionId:N.sessionId,label:mi(N)}]),[u,oe,a,Rt,_t,x]),ln=a&&oe.has(a)?U3(me,Ee):null,cn=ln?`${ln.start}:${ln.query}`:"",ni=ln?Y3(kr,ln.query):[],Gs=ln!=null&&ne!==cn,Yl=Math.min(M,Math.max(ni.length-1,0));j.useEffect(()=>{z(0)},[cn]);function Er(N){const I=Bl.current;return(N??[]).filter(W=>!I.has(W.sessionId))}function ka(N){Bl.current.add(N),Ul.current.delete(N),Mn.current.delete(N),c(I=>I.filter(W=>W.sessionId!==N)),Gt(I=>{const W=new Set(I);return W.delete(N),W}),S(I=>Nb("dsh-bot.titles",I,N)),C(I=>Nb("dsh-bot.previews",I,N)),mt(I=>{if(!I.has(N))return I;const W=new Set(I);return W.delete(N),W}),ft(I=>{if(!(N in I))return I;const W={...I};return delete W[N],W}),a===N&&qn("")}function kn(N,I){const W=new Set(Rt);for(const pe of I)W.add(pe);if(Array.isArray(N))for(const pe of N)typeof pe=="string"&&W.add(pe);Gt(W),I.includes(a)&&qn("")}async function Ea(N){const I=await Fe(`/sessions/${encodeURIComponent(N)}/archive`,{method:"POST"});if(I.status!==200){const W=I.body.upstream;g(W?.message||(I.body.error==="not_blank"?t("session.notBlankArchive"):t("session.archiveFailed")));return}g(""),kn(I.body.archivedSessionIds,[N])}function Ta(N,I){N.preventDefault(),ye({id:I,x:N.clientX,y:N.clientY})}async function ja(N){const I=await Fe(`/sessions/${encodeURIComponent(N)}/delete`,{method:"POST"});if(I.status!==200){const W=I.body.error,pe=typeof I.body.message=="string"?I.body.message:"";g(W==="running"?t("session.deleteRunning"):W==="attached"?t("session.deleteAttached"):pe||t("session.deleteFailed"));return}g(""),ka(N)}async function tl(){if(ti.length===0||!window.confirm(t("session.archiveConfirm",{count:String(ti.length)})))return;const N=[];let I=[];for(const W of ti){const pe=await Fe(`/sessions/${encodeURIComponent(W.sessionId)}/archive`,{method:"POST"});if(pe.status!==200){const _e=pe.body.upstream;g(_e?.message||t("session.archiveSomeFailed"));break}N.push(W.sessionId),I=pe.body.archivedSessionIds}N.length>0&&kn(I,N)}async function Qs(N){const I=u.find(_e=>_e.sessionId===N),W=x[N]||Ob(I?.cwd)||t("session.blankName");if(!window.confirm(t("session.purgeOneConfirm",{name:W})))return;const pe=await Fe(`/sessions/${encodeURIComponent(N)}/purge`,{method:"POST"});if(pe.status!==200){g(pe.body.error==="not_blank"?t("session.purgeNotBlank"):t("session.purgeFailed"));return}ka(N)}async function Xs(){const N=ti.filter(W=>W.blank===!0);if(N.length===0||!window.confirm(t("session.purgeAllConfirm",{count:String(N.length)})))return;const I=[];for(const W of N){if((await Fe(`/sessions/${encodeURIComponent(W.sessionId)}/purge`,{method:"POST"})).status!==200){g(t("session.purgeSomeFailed"));break}I.push(W.sessionId),ka(W.sessionId)}I.length}async function nl(N,I,W){qt(!1),W!==""&&(ft(Re=>({...Re,[N]:W})),mt(Re=>new Set([...Re,N])),S(Re=>{const Ze={...Re,[N]:W};return sessionStorage.setItem("dsh-bot.titles",JSON.stringify(Ze)),Ze}));const _e=(await Fe("/sessions")).body.result;c(Er(_e?.value?.items)),qn(N),Fn(I),$(Re=>Re+1)}function Zs(N,I){A(N),Be(I),window.requestAnimationFrame(()=>{const W=xr.current;W&&(W.focus(),W.setSelectionRange(I,I))})}function Ca(N){if(!ln)return;const I=V3(me,Ee,ln.start,N.label,N.sessionId);Zs(I.text,I.cursor)}function Ks(N="/"){we(!1),A(I=>{const W=I.replace(/\s+$/,"");return W===""?N==="/"?"/":`${N} `:`${W} ${N==="/"?"/":`${N} `}`}),window.requestAnimationFrame(()=>xr.current?.focus())}async function Tr(N){const I=se?.status==="accepted"&&E.drafting,W=gi===a?Ht:[];if(!a||!N||!G.ready||nv(I,W,oe.has(a)))return;Ll();const pe=E.drafting;A(""),Oe(""),Sr.current+=1;const _e=Number.MAX_SAFE_INTEGER-Sr.current;q(dt=>({...dt,drafting:!0,segments:[...dt.segments,{kind:"user",id:`optimistic:${_e}`,text:N,time:Date.now(),seq:_e,optimistic:!0}]}));const Re=await Fe("/tasks",{method:"POST",headers:{"content-type":"application/json","idempotency-key":crypto.randomUUID()},body:JSON.stringify({sessionId:a,text:N})}),Ze=Re.body.task;if(_(Ze??null),Re.status!==202){q(ht=>({...ht,drafting:pe?ht.drafting:!1,segments:ht.segments.filter(lt=>!(lt.kind==="user"&&lt.optimistic&&lt.text===N))}));const dt=Re.body.execution;Oe(dt?.reason||Bu(String(Re.body.error||""),t("composer.notSent"),t))}}async function $s(){const N=me.trim();N&&await Tr(N)}async function ic(N,I){const W=await Ni("/dsh-bot/api/work/supply",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:a,ticketId:N,text:I})});return W.status!==200||W.body.ok===!1?zb(W.body,t("composer.supplyFailed")):""}async function jr(){if(!se||se.status!=="accepted")return;const I=(await Fe(`/tasks/${se.id}/cancel?sessionId=${encodeURIComponent(se.sessionId??"")}`,{method:"POST"})).body.task??se;_(I),I.status==="cancelled"&&q(W=>({...W,drafting:!1}))}const xn=se?.status==="accepted"&&E.drafting,Cr=nv(xn,gi===a?Ht:[],Wi),il=!!a&&G.ready&&me.trim()!==""&&!Cr;function Di(N){if(!oe.has(N.sessionId))return null;const I=N.running===!0||N.sessionId===a&&(xn||E.drafting),W=N.sessionId===a&&gi===a?Ht:(ec[N.sessionId]??[]).map(pe=>({status:pe}));return qk(W,I)}return m.jsxs("div",{className:a?"shell in-chat":"shell",children:[m.jsxs("aside",{className:"side",children:[m.jsxs("div",{className:"side-top",children:[m.jsx("strong",{className:"brand",children:t("app.title")}),m.jsxs("span",{className:"side-actions",children:[m.jsx("button",{type:"button",className:"icon-btn","aria-label":t("session.search"),onClick:()=>w(N=>!N),children:m.jsx(X3,{})}),m.jsx("button",{type:"button",className:"icon-btn","aria-label":t("new.title"),onClick:()=>qt(!0),children:m.jsx(wb,{})})]})]}),y?m.jsx("input",{className:"filter",value:p,placeholder:t("session.searchPlaceholder"),onChange:N=>v(N.target.value)}):null,h?m.jsx("p",{className:"note",children:h}):null,un?m.jsx("p",{className:"note ok",children:un}):null,m.jsxs("ul",{className:"sessions",children:[st.length===0&&ti.length===0?m.jsx("li",{className:"empty",children:u.length?t("session.noMatch"):t("session.none")}):null,st.map(N=>{const I=mi(N);return m.jsx("li",{onContextMenu:W=>Ta(W,N.sessionId),children:m.jsxs("button",{type:"button",className:N.sessionId===a?"session selected":"session",title:N.cwd||N.sessionId,onClick:()=>qn(N.sessionId),children:[m.jsxs("span",{className:oe.has(N.sessionId)?"mark bot-mark":"mark",children:[oe.has(N.sessionId)?"BOT":Array.from(I)[0],m.jsx(xb,{signal:Di(N)})]}),m.jsxs("span",{className:"copy",children:[m.jsx("span",{className:"name",children:I}),m.jsx("span",{className:"preview",children:(N.sessionId===a?jd(Ht,zi,t):"")||T[N.sessionId]||(N.running?t("session.running"):"")})]})]})},N.sessionId)}),ti.length>0?m.jsxs("li",{className:"blank-head",children:[m.jsxs("button",{type:"button","aria-expanded":el,onClick:()=>Sn(N=>!N),children:[t(el?"session.hide":"session.show")," ",t("session.blankCount",{count:String(ti.length)})]}),m.jsx("button",{type:"button",onClick:()=>{tl()},children:t("session.archiveAll")}),m.jsx("button",{type:"button",onClick:()=>{Xs()},children:t("session.purgeAll")})]}):null,el?ti.map(N=>{const I=mi(N);return m.jsxs("li",{className:"session-row",onContextMenu:W=>Ta(W,N.sessionId),children:[m.jsxs("button",{type:"button",className:N.sessionId===a?"session selected":"session",title:N.cwd||N.sessionId,onClick:()=>qn(N.sessionId),children:[m.jsx("span",{className:oe.has(N.sessionId)?"mark bot-mark":"mark",children:oe.has(N.sessionId)?"BOT":Array.from(I)[0]}),m.jsxs("span",{className:"copy",children:[m.jsx("span",{className:"name",children:I}),m.jsx("span",{className:"preview",children:Rt.has(N.sessionId)?t("session.archived"):t("session.blank")})]})]}),Rt.has(N.sessionId)?null:m.jsx("button",{type:"button",className:"session-delete","aria-label":t("session.archiveLabel",{name:I}),onClick:()=>{Ea(N.sessionId)},children:t("session.archive")}),m.jsx("button",{type:"button",className:"session-delete purge","aria-label":t("session.purgeLabel",{name:I}),onClick:()=>{Qs(N.sessionId)},children:t("session.purge")})]},N.sessionId)}):null]}),ue?m.jsx(Q3,{health:Te,usage:fe,execution:G,model:E.model}):null,m.jsxs("div",{className:"me-row",children:[m.jsxs("button",{type:"button",className:"me",onClick:()=>ge(N=>!N),children:[m.jsx("span",{className:"mark me-mark",children:t("local.mark")}),m.jsx("span",{children:Te?.primary?.reachable===!1?t("local.down"):t("local.here")})]}),m.jsx("button",{type:"button",className:"lang-switch",onClick:()=>r(i==="en"?"zh":"en"),children:t("lang.switch")})]})]}),m.jsxs("section",{className:"chat",children:[m.jsxs("header",{className:"chat-head",children:[Xe?m.jsx("button",{type:"button",className:"bot-chat-back",onClick:()=>Wt(!1),children:t("nav.back")}):dr(a)?m.jsx("button",{type:"button",className:"back",onClick:ba,children:t("nav.back")}):m.jsx("button",{type:"button",className:"back",onClick:()=>{Ge(!1),Se(null),o("")},children:t("nav.sessions")}),a&&oe.has(a)?m.jsxs("span",{className:"bot-badge",children:["BOT",m.jsx(xb,{signal:Di({sessionId:a,running:u.find(N=>N.sessionId===a)?.running})})]}):null,m.jsx("h1",{children:Xe?t("nav.botMessages"):Pi}),!Xe&&jd(Ht,zi,t)?m.jsx("span",{className:"work-chip",children:jd(Ht,zi,t)}):null,a&&!Xe?m.jsx("button",{type:"button",className:"files-open","aria-pressed":We==="memory",onClick:()=>{if(We==="memory"){et(null);return}Ge(!1),Se(null),et("memory")},children:t("memory.open")}):null,a&&!Xe?m.jsx("button",{type:"button",className:"files-open","aria-pressed":je,onClick:()=>{if(je){Ge(!1),Se(null);return}et(N=>N==="memory"?null:N),Ge(!0)},children:t("files.open")}):null,m.jsx("a",{href:Vl,children:t("nav.official")})]}),dr(a)&&!Xe?m.jsxs("nav",{className:"work-crumb","aria-label":t("nav.where"),children:[m.jsx("button",{type:"button",onClick:ba,children:Gn&&va(Gn)||t("nav.mainSession")}),m.jsx("span",{"aria-hidden":"true",children:"/"}),m.jsx("span",{children:t("nav.worker")})]}):null,a&&!Xe?m.jsx("button",{type:"button",className:"basis",onClick:()=>{Ge(!1),Se(null),et("memory")},children:ql||t("memory.open")}):null,m.jsxs("div",{className:"chat-body",children:[m.jsx(F3,{active:pi||Ji,progress:Il}),ga&&Xe?m.jsx(jb,{label:t("scroll.latest"),onClick:()=>Ll("smooth")}):null,m.jsx("div",{className:"scroll",ref:Dl,"aria-busy":pi||Ji||void 0,children:m.jsxs("div",{className:"column",ref:tc,children:[a?null:m.jsx("p",{className:"empty-thread",children:t("nav.pick")}),a&&!pi&&!Ji&&!Xe&&Mi.length===0&&Ht.length===0?m.jsx("p",{className:"empty-thread",children:t("nav.empty")}):null,m.jsx(M2,{children:m.jsx(SR,{sessionId:!Xe&&!pi&&a?a:"",pulse:Ce,tickets:Ht,children:pi?null:Xe?m.jsx(xO,{items:nc,botLabel:va,onOpenFile:(N,I)=>{et(W=>W==="memory"?null:W),Se({path:N,line:I,token:Date.now()}),Ge(!0)}}):m.jsx(b4,{sessionId:a,cwd:u.find(N=>N.sessionId===a)?.cwd,connectionPhase:X?.phase,segments:Mi,approvals:Ne,questionWaits:$e,onCompose:N=>Zs(N,N.length),completed:E.completed,failures:E.failures,retries:E.retries,turnEnds:E.turnEnds,tickets:Ht,now:zi,canRetry:!!a&&G.ready&&!xn,onRetry:N=>{Tr(N)},onSupply:ic,onOpenSession:Xt,onOpenFile:(N,I)=>{et(W=>W==="memory"?null:W),Se({path:N,line:I,token:Date.now()}),Ge(!0)},onOpenInbox:()=>Wt(!0),botLabel:va,chat:Wi})})},a)]})}),Xe||pi?null:m.jsx(TO,{root:Dl,marks:qi,busyId:E.drafting&&E.turn!=null?`turn:${E.turn}`:void 0})]}),m.jsxs("div",{className:"composer-wrap",ref:Ys,hidden:Xe,children:[ga?m.jsx(jb,{label:t("scroll.latest"),onClick:()=>Ll("smooth")}):null,m.jsxs("form",{className:"column",onSubmit:N=>{N.preventDefault(),$s()},children:[a&&!pi?m.jsx(YO,{segments:E.segments,drafting:E.drafting,currentTurn:E.turn,tickets:Ht,connectionPhase:X?.phase,pendingApprovals:Ne}):null,m.jsxs("div",{className:"card",children:[Gs?m.jsx("div",{className:"mention-menu",role:"listbox","aria-label":t("composer.mention"),children:ni.length===0?m.jsx("p",{className:"mention-empty",children:t("composer.noBot")}):ni.map((N,I)=>m.jsxs("button",{type:"button",role:"option","aria-selected":I===Yl,className:I===Yl?"active":"",onMouseDown:W=>{W.preventDefault(),Ca(N)},children:[m.jsx("span",{className:"bot-badge",children:"BOT"}),m.jsx("span",{className:"mention-name",children:N.label})]},N.sessionId))}):null,m.jsx("textarea",{ref:xr,value:me,rows:1,placeholder:a?yh({segments:E.segments,drafting:E.drafting,currentTurn:E.turn,tickets:Ht,pendingApprovals:Ne,t})?.text===t("question.waiting")||yh({segments:E.segments,drafting:E.drafting,currentTurn:E.turn,tickets:Ht,pendingApprovals:Ne,t})?.text===t("approval.waiting")?t("question.waiting"):Dk(Ht,t)??(Wi&&xn?t("composer.interrupt"):oe.has(a)?t("composer.mentionHint"):t("composer.task")):t("composer.pick"),disabled:!a,onChange:N=>{A(N.target.value),Be(N.target.selectionStart??N.target.value.length)},onSelect:N=>Be(N.currentTarget.selectionStart??0),onKeyDown:N=>{if(!N.nativeEvent.isComposing){if(Gs&&ni.length>0){if(N.key==="ArrowDown"){N.preventDefault(),z(I=>(I+1)%ni.length);return}if(N.key==="ArrowUp"){N.preventDefault(),z(I=>(I-1+ni.length)%ni.length);return}if(N.key==="Enter"||N.key==="Tab"){N.preventDefault();const I=ni[Yl];I&&Ca(I);return}if(N.key==="Escape"){N.preventDefault(),J(cn);return}}N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),$s())}}}),m.jsxs("div",{className:"card-row",children:[m.jsxs("div",{className:"tools",ref:ya,children:[m.jsx("button",{type:"button",className:"add","aria-label":t("composer.add"),"aria-haspopup":"menu","aria-expanded":be,disabled:!a,onClick:()=>we(N=>!N),children:m.jsx(wb,{})}),be?m.jsxs("div",{className:"plus-menu",role:"menu",children:[m.jsx("button",{type:"button",role:"menuitem",onClick:()=>Ks(),children:t("composer.command")}),m.jsx("button",{type:"button",role:"menuitem",onClick:()=>{we(!1),Ge(!1),Se(null),et("memory")},children:t("memory.open")}),m.jsx("button",{type:"button",role:"menuitem",onClick:()=>{we(!1),et("permission")},children:t("permission.open")}),m.jsx("button",{type:"button",role:"menuitem",onClick:()=>{we(!1),et("authorization")},children:t("auth.open")}),Me?m.jsx("button",{type:"button",role:"menuitem",onClick:()=>{we(!1),et("cua")},children:t("cua.open")}):null,m.jsx("p",{className:"plus-note",children:t("composer.filesLater")})]}):null,E.preset?m.jsxs("button",{type:"button",className:"chip",onClick:()=>et("permission"),children:[m.jsx(Z3,{preset:E.preset}),Y0(E.preset,t)]}):null]}),m.jsxs("div",{className:"trailing",children:[E.model?m.jsx("span",{className:"model",children:E.model}):null,xn?m.jsx("button",{type:"button",className:"stop","aria-label":t("composer.cancel"),onClick:()=>{jr()},children:m.jsx("span",{className:"stop-icon"})}):null,Cr?null:m.jsx("button",{type:"submit",className:"send","aria-label":t("composer.send"),disabled:!il,children:m.jsx(n1,{})})]})]})]}),m.jsx("p",{className:"stats",children:ae||(G.ready?G3(E):Bu(G.reason,G.reason,t))})]})]})]}),We==="permission"&&a?m.jsx(kR,{sessionId:a,current:E.preset,onClose:()=>et(null),onChanged:()=>$(N=>N+1)}):null,We==="authorization"||vt&&We==null?m.jsx(ER,{authorization:Le,catalog:bn,onClose:()=>et(null)}):null,We==="cua"&&Me?m.jsx(TR,{onClose:()=>et(null)}):null,a?m.jsx(G2,{open:je,sessionId:a,focus:ce,onClose:()=>{Ge(!1),Se(null)}},a):null,a&&!Xe?m.jsx(PO,{open:We==="memory",sessionId:a,onClose:()=>et(null)}):null,P?m.jsx("div",{ref:wr,className:"session-menu",role:"menu","aria-label":t("session.menu"),style:{left:P.x,top:P.y},onContextMenu:N=>N.preventDefault(),children:m.jsx("button",{type:"button",role:"menuitem",onClick:()=>{const N=P.id;ye(null),ja(N)},children:t("session.delete")})}):null,Ri?m.jsx(fO,{onClose:()=>qt(!1),onCreated:(N,I,W)=>{nl(N,I,W)}}):null]})}const l1=document.querySelector("#root");if(!l1)throw new Error("missing root");VS.createRoot(l1).render(m.jsx(j.StrictMode,{children:m.jsx(Ek,{children:m.jsx(O4,{})})}));export{R4 as W,Gk as _,m as j,_4 as m,j as r,Ke as u};