@thready-web/dsh-bot-plugin 0.1.0-beta.14 → 0.1.0-beta.15
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.
- package/package.json +1 -1
- package/public/assets/{SourceEditor-D5hkHEda.js → SourceEditor-BO-dBzgs.js} +3 -3
- package/public/assets/{cssMode-BnFhgVEg.js → cssMode-DS6FrlOm.js} +1 -1
- package/public/assets/{freemarker2-CZnj0JQj.js → freemarker2-CGb0OuSj.js} +1 -1
- package/public/assets/{handlebars-DphCsr4u.js → handlebars-CUN0Cg4v.js} +1 -1
- package/public/assets/{html-OCowmZFv.js → html-CaIExM4O.js} +1 -1
- package/public/assets/{htmlMode-CoLh_9Z9.js → htmlMode-Dhe_MncL.js} +1 -1
- package/public/assets/index-y0M-tjxv.js +72 -0
- package/public/assets/{javascript-iZ7A5Jj8.js → javascript-DWKDEiw7.js} +1 -1
- package/public/assets/{jsonMode-Di_cLA3H.js → jsonMode-DUsRTm16.js} +1 -1
- package/public/assets/{liquid-CiQRe5pn.js → liquid-8f0k7Cew.js} +1 -1
- package/public/assets/{mdx-DN_t25k0.js → mdx-DwiR07zG.js} +1 -1
- package/public/assets/{python-BjuxmwHR.js → python-BUXAkB2e.js} +1 -1
- package/public/assets/{razor-8ivZBBa_.js → razor-8WRmhi1w.js} +1 -1
- package/public/assets/{tsMode-Bd30jXnV.js → tsMode-Ckwe9Xvg.js} +1 -1
- package/public/assets/{typescript-yjXIK0i2.js → typescript-6GBBBhTx.js} +1 -1
- package/public/assets/{xml-SwYrmBdL.js → xml-BOrtj3K3.js} +1 -1
- package/public/assets/{yaml-B5ynY56t.js → yaml-YMA-FldX.js} +1 -1
- package/public/index.html +1 -1
- package/public/assets/index-FZCH-ncM.js +0 -72
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SourceEditor-BO-dBzgs.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 Yb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kd={exports:{}},Es={};var tv;function WS(){if(tv)return Es;tv=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 Es.Fragment=i,Es.jsx=r,Es.jsxs=r,Es}var nv;function ek(){return nv||(nv=1,kd.exports=WS()),kd.exports}var m=ek(),Ed={exports:{}},Fe={};var iv;function tk(){if(iv)return Fe;iv=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"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),g=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(){}},N=Object.assign,j={};function M(z,te,ue){this.props=z,this.context=te,this.refs=j,this.updater=ue||T}M.prototype.isReactComponent={},M.prototype.setState=function(z,te){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,te,"setState")},M.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function B(){}B.prototype=M.prototype;function K(z,te,ue){this.props=z,this.context=te,this.refs=j,this.updater=ue||T}var ee=K.prototype=new B;ee.constructor=K,N(ee,M.prototype),ee.isPureReactComponent=!0;var A=Array.isArray;function D(){}var Y={H:null,A:null,T:null,S:null},le=Object.prototype.hasOwnProperty;function O(z,te,ue){var ve=ue.ref;return{$$typeof:t,type:z,key:te,ref:ve!==void 0?ve:null,props:ue}}function V(z,te){return O(z.type,te,z.props)}function Z(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function ke(z){var te={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(ue){return te[ue]})}var oe=/\/+/g;function ge(z,te){return typeof z=="object"&&z!==null&&z.key!=null?ke(""+z.key):te.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(D,D):(z.status="pending",z.then(function(te){z.status==="pending"&&(z.status="fulfilled",z.value=te)},function(te){z.status==="pending"&&(z.status="rejected",z.reason=te)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function ce(z,te,ue,ve,ze){var ye=typeof z;(ye==="undefined"||ye==="boolean")&&(z=null);var be=!1;if(z===null)be=!0;else switch(ye){case"bigint":case"string":case"number":be=!0;break;case"object":switch(z.$$typeof){case t:case i:be=!0;break;case v:return be=z._init,ce(be(z._payload),te,ue,ve,ze)}}if(be)return ze=ze(z),be=ve===""?"."+ge(z,0):ve,A(ze)?(ue="",be!=null&&(ue=be.replace(oe,"$&/")+"/"),ce(ze,te,ue,"",function(We){return We})):ze!=null&&(Z(ze)&&(ze=V(ze,ue+(ze.key==null||z&&z.key===ze.key?"":(""+ze.key).replace(oe,"$&/")+"/")+be)),te.push(ze)),1;be=0;var P=ve===""?".":ve+":";if(A(z))for(var he=0;he<z.length;he++)ve=z[he],ye=P+ge(ve,he),be+=ce(ve,te,ue,ye,ze);else if(he=S(z),typeof he=="function")for(z=he.call(z),he=0;!(ve=z.next()).done;)ve=ve.value,ye=P+ge(ve,he++),be+=ce(ve,te,ue,ye,ze);else if(ye==="object"){if(typeof z.then=="function")return ce(re(z),te,ue,ve,ze);throw te=String(z),Error("Objects are not valid as a React child (found: "+(te==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":te)+"). If you meant to render a collection of children, use an array instead.")}return be}function xe(z,te,ue){if(z==null)return z;var ve=[],ze=0;return ce(z,ve,"","",function(ye){return te.call(ue,ye,ze++)}),ve}function Te(z){if(z._status===-1){var te=z._result,ue=te();ue.then(function(ve){(z._status===0||z._status===-1)&&(z._status=1,z._result=ve,ue.status===void 0&&(ue.status="fulfilled",ue.value=ve))},function(ve){(z._status===0||z._status===-1)&&(z._status=2,z._result=ve,ue.status===void 0&&(ue.status="rejected",ue.reason=ve))}),z._status===-1&&(z._status=0,z._result=ue)}if(z._status===1)return z._result.default;throw z._result}var R=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var te=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(te))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)};function Ke(z){var te=Y.T,ue={};ue.types=te!==null?te.types:null,Y.T=ue;try{var ve=z(),ze=Y.S;ze!==null&&ze(ue,ve),typeof ve=="object"&&ve!==null&&typeof ve.then=="function"&&ve.then(D,R)}catch(ye){R(ye)}finally{te!==null&&ue.types!==null&&(te.types=ue.types),Y.T=te}}function Ie(z){var te=Y.T;if(te!==null){var ue=te.types;ue===null?te.types=[z]:ue.indexOf(z)===-1&&ue.push(z)}else Ke(Ie.bind(null,z))}var q={map:xe,forEach:function(z,te,ue){xe(z,function(){te.apply(this,arguments)},ue)},count:function(z){var te=0;return xe(z,function(){te++}),te},toArray:function(z){return xe(z,function(te){return te})||[]},only:function(z){if(!Z(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return Fe.Activity=g,Fe.Children=q,Fe.Component=M,Fe.Fragment=r,Fe.Profiler=o,Fe.PureComponent=K,Fe.StrictMode=a,Fe.Suspense=p,Fe.ViewTransition=w,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Y,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(z){return Y.H.useMemoCache(z)}},Fe.addTransitionType=Ie,Fe.cache=function(z){return function(){return z.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(z,te,ue){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var ve=N({},z.props),ze=z.key;if(te!=null)for(ye in te.key!==void 0&&(ze=""+te.key),te)!le.call(te,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&te.ref===void 0||(ve[ye]=te[ye]);var ye=arguments.length-2;if(ye===1)ve.children=ue;else if(1<ye){for(var be=Array(ye),P=0;P<ye;P++)be[P]=arguments[P+2];ve.children=be}return O(z.type,ze,ve)},Fe.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},Fe.createElement=function(z,te,ue){var ve,ze={},ye=null;if(te!=null)for(ve in te.key!==void 0&&(ye=""+te.key),te)le.call(te,ve)&&ve!=="key"&&ve!=="__self"&&ve!=="__source"&&(ze[ve]=te[ve]);var be=arguments.length-2;if(be===1)ze.children=ue;else if(1<be){for(var P=Array(be),he=0;he<be;he++)P[he]=arguments[he+2];ze.children=P}if(z&&z.defaultProps)for(ve in be=z.defaultProps,be)ze[ve]===void 0&&(ze[ve]=be[ve]);return O(z,ye,ze)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(z){return{$$typeof:h,render:z}},Fe.isValidElement=Z,Fe.lazy=function(z){return{$$typeof:v,_payload:{_status:-1,_result:z},_init:Te}},Fe.memo=function(z,te){return{$$typeof:y,type:z,compare:te===void 0?null:te}},Fe.startTransition=Ke,Fe.unstable_useCacheRefresh=function(){return Y.H.useCacheRefresh()},Fe.use=function(z){return Y.H.use(z)},Fe.useActionState=function(z,te,ue){return Y.H.useActionState(z,te,ue)},Fe.useCallback=function(z,te){return Y.H.useCallback(z,te)},Fe.useContext=function(z){return Y.H.useContext(z)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(z,te){return Y.H.useDeferredValue(z,te)},Fe.useEffect=function(z,te){return Y.H.useEffect(z,te)},Fe.useEffectEvent=function(z){return Y.H.useEffectEvent(z)},Fe.useId=function(){return Y.H.useId()},Fe.useImperativeHandle=function(z,te,ue){return Y.H.useImperativeHandle(z,te,ue)},Fe.useInsertionEffect=function(z,te){return Y.H.useInsertionEffect(z,te)},Fe.useLayoutEffect=function(z,te){return Y.H.useLayoutEffect(z,te)},Fe.useMemo=function(z,te){return Y.H.useMemo(z,te)},Fe.useOptimistic=function(z,te){return Y.H.useOptimistic(z,te)},Fe.useReducer=function(z,te,ue){return Y.H.useReducer(z,te,ue)},Fe.useRef=function(z){return Y.H.useRef(z)},Fe.useState=function(z){return Y.H.useState(z)},Fe.useSyncExternalStore=function(z,te,ue){return Y.H.useSyncExternalStore(z,te,ue)},Fe.useTransition=function(){return Y.H.useTransition()},Fe.version="19.3.1",Fe}var rv;function Nh(){return rv||(rv=1,Ed.exports=tk()),Ed.exports}var E=Nh();const iz=Yb(E);var jd={exports:{}},js={},Td={exports:{}},Nd={};var lv;function nk(){return lv||(lv=1,(function(t){function i(re,ce){var xe=re.length;re.push(ce);e:for(;0<xe;){var Te=xe-1>>>1,R=re[Te];if(0<o(R,ce))re[Te]=ce,re[xe]=R,xe=Te;else break e}}function r(re){return re.length===0?null:re[0]}function a(re){if(re.length===0)return null;var ce=re[0],xe=re.pop();if(xe!==ce){re[0]=xe;e:for(var Te=0,R=re.length,Ke=R>>>1;Te<Ke;){var Ie=2*(Te+1)-1,q=re[Ie],z=Ie+1,te=re[z];if(0>o(q,xe))z<R&&0>o(te,q)?(re[Te]=te,re[z]=xe,Te=z):(re[Te]=q,re[Ie]=xe,Te=Ie);else if(z<R&&0>o(te,xe))re[Te]=te,re[z]=xe,Te=z;else break e}}return ce}function o(re,ce){var xe=re.sortIndex-ce.sortIndex;return xe!==0?xe:re.id-ce.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 p=[],y=[],v=1,g=null,w=3,x=!1,S=!1,T=!1,N=!1,j=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function K(re){for(var ce=r(y);ce!==null;){if(ce.callback===null)a(y);else if(ce.startTime<=re)a(y),ce.sortIndex=ce.expirationTime,i(p,ce);else break;ce=r(y)}}function ee(re){if(T=!1,K(re),!S)if(r(p)!==null)S=!0,A||(A=!0,Z());else{var ce=r(y);ce!==null&&ge(ee,ce.startTime-re)}}var A=!1,D=-1,Y=5,le=-1;function O(){return N?!0:!(t.unstable_now()-le<Y)}function V(){if(N=!1,A){var re=t.unstable_now();le=re;var ce=!0;try{e:{S=!1,T&&(T=!1,M(D),D=-1),x=!0;var xe=w;try{t:{for(K(re),g=r(p);g!==null&&!(g.expirationTime>re&&O());){var Te=g.callback;if(typeof Te=="function"){g.callback=null,w=g.priorityLevel;var R=Te(g.expirationTime<=re);if(re=t.unstable_now(),typeof R=="function"){g.callback=R,K(re),ce=!0;break t}g===r(p)&&a(p),K(re)}else a(p);g=r(p)}if(g!==null)ce=!0;else{var Ke=r(y);Ke!==null&&ge(ee,Ke.startTime-re),ce=!1}}break e}finally{g=null,w=xe,x=!1}ce=void 0}}finally{ce?Z():A=!1}}}var Z;if(typeof B=="function")Z=function(){B(V)};else if(typeof MessageChannel<"u"){var ke=new MessageChannel,oe=ke.port2;ke.port1.onmessage=V,Z=function(){oe.postMessage(null)}}else Z=function(){j(V,0)};function ge(re,ce){D=j(function(){re(t.unstable_now())},ce)}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"):Y=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 ce=3;break;default:ce=w}var xe=w;w=ce;try{return re()}finally{w=xe}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(re,ce){switch(re){case 1:case 2:case 3:case 4:case 5:break;default:re=3}var xe=w;w=re;try{return ce()}finally{w=xe}},t.unstable_scheduleCallback=function(re,ce,xe){var Te=t.unstable_now();switch(typeof xe=="object"&&xe!==null?(xe=xe.delay,xe=typeof xe=="number"&&0<xe?Te+xe:Te):xe=Te,re){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=xe+R,re={id:v++,callback:ce,priorityLevel:re,startTime:xe,expirationTime:R,sortIndex:-1},xe>Te?(re.sortIndex=xe,i(y,re),r(p)===null&&re===r(y)&&(T?(M(D),D=-1):T=!0,ge(ee,xe-Te))):(re.sortIndex=R,i(p,re),S||x||(S=!0,A||(A=!0,Z()))),re},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(re){var ce=w;return function(){var xe=w;w=ce;try{return re.apply(this,arguments)}finally{w=xe}}}})(Nd)),Nd}var av;function ik(){return av||(av=1,Td.exports=nk()),Td.exports}var Cd={exports:{}},yn={};var sv;function rk(){if(sv)return yn;sv=1;var t=Nh();function i(v){var g="https://react.dev/errors/"+v;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)g+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+v+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(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,g,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:g,implementation:w}}var p=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(v,g){if(v==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return yn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,yn.browser=function(v){return{$$typeof:u,_reason:v}},yn.createPortal=function(v,g){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(i(299));return h(v,g,null,w)},yn.flushSync=function(v){var g=p.T,w=a.p;try{if(p.T=null,a.p=2,v)return v()}finally{p.T=g,a.p=w,a.d.f()}},yn.preconnect=function(v,g){typeof v=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,a.d.C(v,g))},yn.prefetchDNS=function(v){typeof v=="string"&&a.d.D(v)},yn.preinit=function(v,g){if(typeof v=="string"&&g&&typeof g.as=="string"){var w=g.as,x=y(w,g.crossOrigin),S=typeof g.integrity=="string"?g.integrity:void 0,T=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;w==="style"?a.d.S(v,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:x,integrity:S,fetchPriority:T}):w==="script"&&a.d.X(v,{crossOrigin:x,integrity:S,fetchPriority:T,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},yn.preinitModule=function(v,g){if(typeof v=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var w=y(g.as,g.crossOrigin);a.d.M(v,{crossOrigin:w,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}}else g==null&&a.d.M(v)},yn.preload=function(v,g){if(typeof v=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var w=g.as,x=y(w,g.crossOrigin);a.d.L(v,w,{crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},yn.preloadModule=function(v,g){if(typeof v=="string")if(g){var w=y(g.as,g.crossOrigin);a.d.m(v,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:w,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}else a.d.m(v)},yn.requestFormReset=function(v){a.d.r(v)},yn.unstable_batchedUpdates=function(v,g){return v(g)},yn.useFormState=function(v,g,w){return p.H.useFormState(v,g,w)},yn.useFormStatus=function(){return p.H.useHostTransitionStatus()},yn.version="19.3.1",yn}var ov;function Fb(){if(ov)return Cd.exports;ov=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(),Cd.exports=rk(),Cd.exports}var uv;function lk(){if(uv)return js;uv=1;var t=ik(),i=Nh(),r=Fb();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 p(e){if(u(e)!==e)throw Error(a(188))}function y(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 p(f),e;if(d===s)return p(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 g(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)&&g(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 N(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 j=null,M=null;function B(e,n,l){return e===l?!0:e===n?(j=e,!0):!1}function K(e,n,l){return e===l?(M=e,!1):e===n?(M!==null&&(j=e),!0):!1}function ee(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 A(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 D=Object.assign,Y=Symbol.for("react.element"),le=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),ke=Symbol.for("react.profiler"),oe=Symbol.for("react.consumer"),ge=Symbol.for("react.context"),re=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),xe=Symbol.for("react.suspense_list"),Te=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),Ke=Symbol.for("react.activity"),Ie=Symbol.for("react.legacy_hidden"),q=Symbol.for("react.memo_cache_sentinel"),z=Symbol.for("react.view_transition"),te=Symbol.for("react.recoverable"),ue=Symbol.iterator;function ve(e){return e===null||typeof e!="object"?null:(e=ue&&e[ue]||e["@@iterator"],typeof e=="function"?e:null)}var ze=Symbol.for("react.client.reference");function ye(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ze?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case ke:return"Profiler";case Z:return"StrictMode";case ce:return"Suspense";case xe:return"SuspenseList";case Ke:return"Activity";case z:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case O:return"Portal";case ge:return e.displayName||"Context";case oe: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 Te:return n=e.displayName||null,n!==null?n:ye(e.type)||"Memo";case R:n=e._payload,e=e._init;try{return ye(e(n))}catch{}}return null}var be=Array.isArray,P=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,We={pending:!1,data:null,method:null,action:null},dt=[],Ee=-1;function De(e){return{current:e}}function Me(e){0>Ee||(e.current=dt[Ee],dt[Ee]=null,Ee--)}function Ve(e,n){Ee++,dt[Ee]=e.current,e.current=n}var Ae=De(null),Ue=De(null),nt=De(null),ae=De(null);function Be(e,n){switch(Ve(nt,n),Ve(Ue,e),Ve(Ae,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?cg(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=cg(n),e=fg(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Me(Ae),Ve(Ae,e)}function ut(){Me(Ae),Me(Ue),Me(nt)}function Kt(e){var n=e.memoizedState;n!==null&&(ca._currentValue=n.memoizedState,Ve(ae,e)),n=Ae.current;var l=fg(n,e.type);n!==l&&(Ve(Ue,e),Ve(Ae,l))}function Bt(e){Ue.current===e&&(Me(Ae),Me(Ue)),ae.current===e&&(Me(ae),ca._currentValue=We)}var Q,se;function _e(e){if(Q===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);Q=n&&n[1]||"",se=-1<l.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+Q+e+se}var Ne=!1;function we(e,n){if(!e||Ne)return"";Ne=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(Se){var U=Se}Reflect.construct(e,[],ie)}else{try{ie.call()}catch(Se){U=Se}ie=!1;try{var $=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ie=!0,new e}finally{ie&&($!==void 0?Object.defineProperty(e.prototype,"props",$):delete e.prototype.props)}}}else{try{throw Error()}catch(Se){U=Se}(ie=e())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(Se){if(Se&&U&&typeof Se.stack=="string")return[Se.stack,U.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 _=b.split(`
|
|
5
|
+
`),I=k.split(`
|
|
6
|
+
`);for(f=s=0;s<_.length&&!_[s].includes("DetermineComponentFrameRoot");)s++;for(;f<I.length&&!I[f].includes("DetermineComponentFrameRoot");)f++;if(s===_.length||f===I.length)for(s=_.length-1,f=I.length-1;1<=s&&0<=f&&_[s]!==I[f];)f--;for(;1<=s&&0<=f;s--,f--)if(_[s]!==I[f]){if(s!==1||f!==1)do if(s--,f--,0>f||_[s]!==I[f]){var X=`
|
|
7
|
+
`+_[s].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=s&&0<=f);break}}}finally{Ne=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?_e(l):""}function pe(e,n){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e("Lazy");case 13:return e.child!==n&&n!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return _e("Activity");case 30:return _e("ViewTransition");default:return""}}function Le(e){try{var n="",l=null;do n+=pe(e,l),l=e,e=e.return;while(e);return n}catch(s){return`
|
|
8
|
+
Error generating stack: `+s.message+`
|
|
9
|
+
`+s.stack}}var Je=Object.prototype.hasOwnProperty,lt=t.unstable_scheduleCallback,bt=t.unstable_cancelCallback,gt=t.unstable_shouldYield,wn=t.unstable_requestPaint,Nt=t.unstable_now,Ct=t.unstable_getCurrentPriorityLevel,ht=t.unstable_ImmediatePriority,Ft=t.unstable_UserBlockingPriority,hi=t.unstable_NormalPriority,Fn=t.unstable_LowPriority,J=t.unstable_IdlePriority,me=t.log,Et=t.unstable_setDisableYieldValue,vt=null,at=null;function Mt(e){if(typeof me=="function"&&Et(e),at&&typeof at.setStrictMode=="function")try{at.setStrictMode(vt,e)}catch{}}var jt=Math.clz32?Math.clz32:qn,gl=Math.log,nr=Math.LN2;function qn(e){return e>>>=0,e===0?32:31-(gl(e)/nr|0)|0}var Oi=256,ni=262144,zi=4194304;function Mi(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 vl(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=Mi(s):(b&=k,b!==0?f=Mi(b):l||(l=k&~e,l!==0&&(f=Mi(l))))):(k=s&~d,k!==0?f=Mi(k):b!==0?f=Mi(b):l||(l=s&~e,l!==0&&(f=Mi(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 ir(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Qs(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-jt(l),f=1<<s;n|=e[s],l&=~f}return n}function lc(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 Zs(){var e=zi;return zi<<=1,(zi&62914560)===0&&(zi=4194304),e}function rr(e){for(var n=[],l=0;31>l;l++)n.push(e);return n}function Dr(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bl(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,_=e.expirationTimes,I=e.hiddenUpdates;for(l=b&~l;0<l;){var X=31-jt(l),ie=1<<X;k[X]=0,_[X]=-1;var U=I[X];if(U!==null)for(I[X]=null,X=0;X<U.length;X++){var $=U[X];$!==null&&($.lane&=-536870913)}l&=~ie}s!==0&&ka(e,s,0),d!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=d&~(b&~n))}function ka(e,n,l){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-jt(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|l&261930}function Ks(e,n){var l=e.entangledLanes|=n;for(e=e.entanglements;l;){var s=31-jt(l),f=1<<s;f&n|e[s]&n&&(e[s]|=n),l&=~f}}function Ea(e,n){var l=n&-n;return l=(l&42)!==0?1:Lr(l),(l&(e.suspendedLanes|n))!==0?0:l}function Lr(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 xl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function wl(){var e=he.p;return e!==0?e:(e=window.event,e===void 0?32:Qg(e.type))}function Sl(e,n){var l=he.p;try{return he.p=e,n()}finally{he.p=l}}var Gn=Math.random().toString(36).slice(2),$t="__reactFiber$"+Gn,ln="__reactProps$"+Gn,mi="__reactContainer$"+Gn,ja="__reactEvents$"+Gn,kl="__reactListeners$"+Gn,Ta="__reactHandles$"+Gn,lr="__reactResources$"+Gn,qi="__reactMarker$"+Gn,El="__reactLoad$"+Gn;function ii(e){delete e[$t],delete e[ln],delete e[kl],delete e[Ta]}function Di(e){var n;if(n=e[$t])return n;for(var l=e.parentNode;l;){if(n=l[mi]||l[$t]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(e=Cg(e);e!==null;){if(l=e[$t])return l;e=Cg(e)}return n}e=l,l=e.parentNode}return null}function Li(e){if(e=e[$t]||e[mi]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function pi(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function ar(e){var n=e[lr];return n||(n=e[lr]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Pt(e){e[qi]=!0}function Js(e){e[El]=void 0}var Br=new Set,Ps={};function yi(e,n){Bi(e,n),Bi(e+"Capture",n)}function Bi(e,n){for(Ps[e]=n,e=0;e<n.length;e++)Br.add(n[e])}var Ur=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]*$"),cn={},jl={};function Ws(e){return Je.call(jl,e)?!0:Je.call(cn,e)?!1:Ur.test(e)?jl[e]=!0:(cn[e]=!0,!1)}var ct=!1;function Na(){var e=ct;return ct=!1,e}function Ca(e,n,l){if(Ws(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 Hr(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 ri(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 Xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Tl(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function gi(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 Nl(e){if(!e._valueTracker){var n=Tl(e)?"checked":"value";e._valueTracker=gi(e,n,""+e[n])}}function Cl(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),s="";return e&&(s=Tl(e)?e.checked?"true":"false":e.value),e=s,e!==l?(n.setValue(e),!0):!1}var Aa=/[\n"\\]/g;function jn(e){return e.replace(Aa,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Ra(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=""+Xt(n)):e.value!==""+Xt(n)&&(e.value=""+Xt(n)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),n!=null?b==="number"&&e.value==n?Al(e,Xt(e.value)):Al(e,Xt(n)):l!=null?Al(e,Xt(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=""+Xt(k):e.removeAttribute("name")}function _a(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)){Nl(e);return}l=l!=null?""+Xt(l):"",n=n!=null?""+Xt(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),Nl(e)}function Al(e,n){e.defaultValue!==""+n&&(e.defaultValue=""+n)}function Ui(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=""+Xt(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 Oa(e,n,l){if(n!=null&&(n=""+Xt(n),n!==e.value&&(e.value=n),l==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=l!=null?""+Xt(l):""}function za(e,n,l,s){if(n==null){if(s!=null){if(l!=null)throw Error(a(92));if(be(s)){if(1<s.length)throw Error(a(93));s=s[0]}l=s}l==null&&(l=""),n=l}l=Xt(n),e.defaultValue=l,s=e.textContent,s===l&&s!==""&&s!==null&&(e.value=s),Nl(e)}function sr(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var eo=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 Ma(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||eo.has(n)?n==="float"?e.cssFloat=l:e[n]=(""+l).trim():e[n]=l+"px"}function to(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]="",ct=!0);for(var f in n)s=n[f],n.hasOwnProperty(f)&&l[f]!==s&&(Ma(e,f,s),ct=!0)}else for(var d in n)n.hasOwnProperty(d)&&Ma(e,d,n[d])}function Rl(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 no=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"]]),ac=/^[\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 _l(e){return ac.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function bn(){}var qa=null;function Da(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Hi=null,Ii=null;function La(e){var n=Li(e);if(n&&(e=n.stateNode)){var l=e[ln]||null;e:switch(e=n.stateNode,n.type){case"input":if(Ra(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="'+jn(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var s=l[n];if(s!==e&&s.form===e.form){var f=s[ln]||null;if(!f)throw Error(a(90));Ra(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&&Cl(s)}break e;case"textarea":Oa(e,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&Ui(e,!!l.multiple,n,!1)}}}var C=!1;function G(e,n,l){if(C)return e(n,l);C=!0;try{var s=e(n);return s}finally{if(C=!1,(Hi!==null||Ii!==null)&&(eu(),Hi&&(n=Hi,e=Ii,Ii=Hi=null,La(n),e)))for(n=0;n<e.length;n++)La(e[n])}}function W(e,n){var l=e.stateNode;if(l===null)return null;var s=l[ln]||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 de=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oe=!1;if(de)try{var je={};Object.defineProperty(je,"passive",{get:function(){Oe=!0}}),window.addEventListener("test",je,je),window.removeEventListener("test",je,je)}catch{Oe=!1}var $e=null,Ot=null,mt=null;function pt(){if(mt)return mt;var e,n=Ot,l=n.length,s,f="value"in $e?$e.value:$e.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 mt=f.slice(e,1<s?1-s:void 0)}function wt(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 St(){return!0}function Ut(){return!1}function Vt(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)?St:Ut,this.isPropagationStopped=Ut,this}return D(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=St)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=St)},persist:function(){},isPersistent:St}),n}var $n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},io=Vt($n),Ba=D({},$n,{view:0,detail:0}),E1=Vt(Ba),sc,oc,Ua,ro=D({},Ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cc,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!==Ua&&(Ua&&e.type==="mousemove"?(sc=e.screenX-Ua.screenX,oc=e.screenY-Ua.screenY):oc=sc=0,Ua=e),sc)},movementY:function(e){return"movementY"in e?e.movementY:oc}}),om=Vt(ro),j1=D({},ro,{dataTransfer:0}),T1=Vt(j1),N1=D({},Ba,{relatedTarget:0}),uc=Vt(N1),C1=D({},$n,{animationName:0,elapsedTime:0,pseudoElement:0}),A1=Vt(C1),R1=D({},$n,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_1=Vt(R1),O1=D({},$n,{data:0}),um=Vt(O1),z1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},M1={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"},q1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D1(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=q1[e])?!!n[e]:!1}function cc(){return D1}var L1=D({},Ba,{key:function(e){if(e.key){var n=z1[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=wt(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?M1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cc,charCode:function(e){return e.type==="keypress"?wt(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?wt(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),B1=Vt(L1),U1=D({},ro,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cm=Vt(U1),H1=D({},$n,{submitter:0}),I1=Vt(H1),V1=D({},Ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cc}),Y1=Vt(V1),F1=D({},$n,{propertyName:0,elapsedTime:0,pseudoElement:0}),G1=Vt(F1),$1=D({},ro,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),X1=Vt($1),Q1=D({},$n,{newState:0,oldState:0,source:0}),Z1=Vt(Q1),K1=[9,13,27,32],fc=de&&"CompositionEvent"in window,Ha=null;de&&"documentMode"in document&&(Ha=document.documentMode);var J1=de&&"TextEvent"in window&&!Ha,fm=de&&(!fc||Ha&&8<Ha&&11>=Ha),dm=" ",hm=!1;function mm(e,n){switch(e){case"keyup":return K1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ol=!1;function P1(e,n){switch(e){case"compositionend":return pm(n);case"keypress":return n.which!==32?null:(hm=!0,dm);case"textInput":return e=n.data,e===dm&&hm?null:e;default:return null}}function W1(e,n){if(Ol)return e==="compositionend"||!fc&&mm(e,n)?(e=pt(),mt=Ot=$e=null,Ol=!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 fm&&n.locale!=="ko"?null:n.data;default:return null}}var ew={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 ym(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!ew[e.type]:n==="textarea"}function gm(e,n,l,s){Hi?Ii?Ii.push(s):Ii=[s]:Hi=s,n=au(n,"onChange"),0<n.length&&(l=new io("onChange","change",null,l,s),e.push({event:l,listeners:n}))}var Ia=null,Va=null;function tw(e){rg(e,0)}function lo(e){var n=pi(e);if(Cl(n))return e}function vm(e,n){if(e==="change")return n}var bm=!1;if(de){var dc;if(de){var hc="oninput"in document;if(!hc){var xm=document.createElement("div");xm.setAttribute("oninput","return;"),hc=typeof xm.oninput=="function"}dc=hc}else dc=!1;bm=dc&&(!document.documentMode||9<document.documentMode)}function wm(){Ia&&(Ia.detachEvent("onpropertychange",Sm),Va=Ia=null)}function Sm(e){if(e.propertyName==="value"&&lo(Va)){var n=[];gm(n,Va,e,Da(e)),G(tw,n)}}function nw(e,n,l){e==="focusin"?(wm(),Ia=n,Va=l,Ia.attachEvent("onpropertychange",Sm)):e==="focusout"&&wm()}function iw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return lo(Va)}function rw(e,n){if(e==="click")return lo(n)}function lw(e,n){if(e==="input"||e==="change")return lo(n)}function aw(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Dn=typeof Object.is=="function"?Object.is:aw;function Ya(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(!Je.call(n,f)||!Dn(e[f],n[f]))return!1}return!0}function mc(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 km(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Em(e,n){var l=km(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=km(l)}}function jm(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?jm(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Tm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=mc(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=mc(e.document)}return n}function pc(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 sw=de&&"documentMode"in document&&11>=document.documentMode,zl=null,yc=null,Fa=null,gc=!1;function Nm(e,n,l){var s=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;gc||zl==null||zl!==mc(s)||(s=zl,"selectionStart"in s&&pc(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}),Fa&&Ya(Fa,s)||(Fa=s,s=au(yc,"onSelect"),0<s.length&&(n=new io("onSelect","select",null,n,l),e.push({event:n,listeners:s}),n.target=zl)))}function Ir(e,n){var l={};return l[e.toLowerCase()]=n.toLowerCase(),l["Webkit"+e]="webkit"+n,l["Moz"+e]="moz"+n,l}var Ml={animationend:Ir("Animation","AnimationEnd"),animationiteration:Ir("Animation","AnimationIteration"),animationstart:Ir("Animation","AnimationStart"),transitionrun:Ir("Transition","TransitionRun"),transitionstart:Ir("Transition","TransitionStart"),transitioncancel:Ir("Transition","TransitionCancel"),transitionend:Ir("Transition","TransitionEnd")},vc={},Cm={};de&&(Cm=document.createElement("div").style,"AnimationEvent"in window||(delete Ml.animationend.animation,delete Ml.animationiteration.animation,delete Ml.animationstart.animation),"TransitionEvent"in window||delete Ml.transitionend.transition);function Vr(e){if(vc[e])return vc[e];if(!Ml[e])return e;var n=Ml[e],l;for(l in n)if(n.hasOwnProperty(l)&&l in Cm)return vc[e]=n[l];return e}var Am=Vr("animationend"),Rm=Vr("animationiteration"),_m=Vr("animationstart"),ow=Vr("transitionrun"),uw=Vr("transitionstart"),cw=Vr("transitioncancel"),Om=Vr("transitionend"),zm=new Map,bc="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(" ");bc.push("scrollEnd");function li(e,n){zm.set(e,n),yi(n,[e])}var fw=0;function Vi(e,n){if(e.name!=null&&e.name!=="auto")return e.name;if(n.autoName!==null)return n.autoName;e=ui.identifierPrefix;var l=fw++;return e="_"+e+"t_"+l.toString(32)+"_",n.autoName=e}function Mm(e){if(e==null||typeof e=="string")return e;var n=null,l=ea;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 Yi(e,n){return e=Mm(e),n=Mm(n),n==null?e==="auto"?null:e:n==="auto"?null:n}var ao=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)},Xn=[],ql=0,xc=0;function so(){for(var e=ql,n=xc=ql=0;n<e;){var l=Xn[n];Xn[n++]=null;var s=Xn[n];Xn[n++]=null;var f=Xn[n];Xn[n++]=null;var d=Xn[n];if(Xn[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&&qm(l,f,d)}}function oo(e,n,l,s){Xn[ql++]=e,Xn[ql++]=n,Xn[ql++]=l,Xn[ql++]=s,xc|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function wc(e,n,l,s){return oo(e,n,l,s),uo(e)}function Yr(e,n){return oo(e,null,null,n),uo(e)}function qm(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-jt(l),e=d.hiddenUpdates,s=e[f],s===null?e[f]=[n]:s.push(n),n.lane=l|536870912),d):null}function uo(e){if(50<ds)throw ds=0,Wo=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Dl={};function dw(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 Tn(e,n,l,s){return new dw(e,n,l,s)}function Sc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fi(e,n){var l=e.alternate;return l===null?(l=Tn(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 Dm(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 co(e,n,l,s,f,d){var b=0;if(s=e,typeof s=="function")Sc(s)&&(b=1);else if(typeof s=="string")b=HS(e,l,Ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(s){case Ke:return e=Tn(31,l,n,f),e.elementType=Ke,e.lanes=d,e;case V:return Fr(l.children,f,d,n);case Z:b=8,f|=24;break;case ke:return e=Tn(12,l,n,f|2),e.elementType=ke,e.lanes=d,e;case ce:return e=Tn(13,l,n,f),e.elementType=ce,e.lanes=d,e;case xe:return e=Tn(19,l,n,f),e.elementType=xe,e.lanes=d,e;case Ie:case z:return e=f|32,e=Tn(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 ge:b=10;break e;case oe:b=9;break e;case re:b=11;break e;case Te:b=14;break e;case R:b=16,s=null;break e}b=29,l=Error(a(130,e===null?"null":typeof e,"")),s=null}return n=Tn(b,l,n,f),n.elementType=e,n.type=s,n.lanes=d,n}function Fr(e,n,l,s){return e=Tn(7,e,s,n),e.lanes=l,e}function kc(e,n,l){return e=Tn(6,e,null,n),e.lanes=l,e}function Lm(e){var n=Tn(18,null,null,0);return n.stateNode=e,n}function Ec(e,n,l){return n=Tn(4,e.children!==null?e.children:[],e.key,n),n.lanes=l,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Bm=new WeakMap;function Qn(e,n){if(typeof e=="object"&&e!==null){var l=Bm.get(e);return l!==void 0?l:(n={value:e,source:n,stack:Le(n)},Bm.set(e,n),n)}return{value:e,source:n,stack:Le(n)}}var Ll=[],Bl=0,fo=null,Ga=0,Zn=[],Kn=0,or=null,vi=1,bi="";function Gi(e,n){Ll[Bl++]=Ga,Ll[Bl++]=fo,fo=e,Ga=n}function Um(e,n,l){Zn[Kn++]=vi,Zn[Kn++]=bi,Zn[Kn++]=or,or=e;var s=vi;e=bi;var f=32-jt(s)-1;s&=~(1<<f),l+=1;var d=32-jt(n)+f;if(30<d){var b=f-f%5;d=(s&(1<<b)-1).toString(32),s>>=b,f-=b,vi=1<<32-jt(n)+f|l<<f|s,bi=d+e}else vi=1<<d|l<<f|s,bi=e}function ho(e){e.return!==null&&(Gi(e,1),Um(e,1,0))}function jc(e){for(;e===fo;)fo=Ll[--Bl],Ll[Bl]=null,Ga=Ll[--Bl],Ll[Bl]=null;for(;e===or;)or=Zn[--Kn],Zn[Kn]=null,bi=Zn[--Kn],Zn[Kn]=null,vi=Zn[--Kn],Zn[Kn]=null}function Hm(e,n){Zn[Kn++]=vi,Zn[Kn++]=bi,Zn[Kn++]=or,vi=n.id,bi=n.overflow,or=e}var sn=null,Ht=null,et=!1,ur=null,Jn=!1,Tc=Error(a(519));function cr(e){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw $a(Qn(n,e)),Tc}function Im(e){var n=e.stateNode,l=e.type,s=e.memoizedProps;switch(n[$t]=e,n[ln]=s,l){case"dialog":rt("cancel",n),rt("close",n);break;case"iframe":case"object":case"embed":rt("load",n);break;case"video":case"audio":for(l=0;l<ms.length;l++)rt(ms[l],n);break;case"source":rt("error",n);break;case"img":case"image":case"link":rt("error",n),rt("load",n);break;case"details":rt("toggle",n);break;case"input":rt("invalid",n),_a(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":rt("invalid",n);break;case"textarea":rt("invalid",n),za(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||og(n.textContent,l)?(s.popover!=null&&(rt("beforetoggle",n),rt("toggle",n)),s.onScroll!=null&&rt("scroll",n),s.onScrollEnd!=null&&rt("scrollend",n),s.onClick!=null&&(n.onclick=bn),n=!0):n=!1,n||cr(e,!0)}function mo(e){for(sn=e.return;sn;)switch(sn.tag){case 5:case 31:case 13:Jn=!1;return;case 27:case 3:Jn=!0;return;default:sn=sn.return}}function Ul(e){if(e!==sn)return!1;if(!et)return mo(e),et=!0,!1;var n=e.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||id(e.type,e.memoizedProps)),l=!l),l&&Ht&&cr(e),mo(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Ht=Ng(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Ht=Ng(e)}else n===27?(n=Ht,Tr(e.type)?(e=dd,dd=null,Ht=e):Ht=n):Ht=sn?Wn(e.stateNode.nextSibling):null;return!0}function Gr(){Ht=sn=null,et=!1}function Nc(){var e=ur;return e!==null&&(An===null?An=e:An.push.apply(An,e),ur=null),e}function $a(e){ur===null?ur=[e]:ur.push(e)}var Cc=De(null),$r=null,$i=null;function fr(e,n,l){Ve(Cc,n._currentValue),n._currentValue=l}function Xi(e){e._currentValue=Cc.current,Me(Cc)}function po(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 Ac(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 _=0;_<n.length;_++)if(k.context===n[_]){d.lanes|=l,k=d.alternate,k!==null&&(k.lanes|=l),po(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),po(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),po(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 Xr(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===ae.current){if(b=f.alternate,b===null)throw Error(a(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(ca):e=[ca])}f=f.return}return e!==null&&Ac(n,e,l,s),n.flags|=262144,e!==null}function yo(e){for(e=e.firstContext;e!==null;){if(!Dn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qr(e){$r=e,$i=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function fn(e){return Vm($r,e)}function go(e,n){return $r===null&&Qr(e),Vm(e,n)}function Vm(e,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},$i===null){if(e===null)throw Error(a(308));$i=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else $i=$i.next=n;return l}var hw=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()})}},mw=t.unstable_scheduleCallback,pw=t.unstable_NormalPriority,Wt={$$typeof:ge,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rc(){return{controller:new hw,data:new Map,refCount:0}}function Xa(e){e.refCount--,e.refCount===0&&mw(pw,function(){e.controller.abort()})}function Ym(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 Qa=null;function yw(e){var n=e.transitionTypes;return e.transitionTypes=null,n}var Za=null,_c=0,Zr=0,Hl=null;function gw(e,n){if(Za===null){var l=Za=[];_c=0,Zr=Qf(),Hl={status:"pending",value:void 0,then:function(s){l.push(s)}}}return _c++,n.then(Fm,Fm),n}function Fm(){if(--_c===0&&(Qa=null,Za!==null)){Hl!==null&&(Hl.status="fulfilled");var e=Za;Za=null,Zr=0,Hl=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function vw(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 Gm=P.S;P.S=function(e,n){if(Ly=Nt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&gw(e,n),Qa!==null)for(var l=ra;l!==null;)Ym(l,Qa),l=l.next;if(l=e.types,l!==null){for(var s=ra;s!==null;)Ym(s,l),s=s.next;if(Zr!==0){s=Qa,s===null&&(s=Qa=[]);for(var f=0;f<l.length;f++){var d=l[f];s.indexOf(d)===-1&&s.push(d)}}}Gm!==null&&Gm(e,n)};var Kr=De(null);function Oc(){var e=Kr.current;return e!==null?e:qt.pooledCache}function vo(e,n){n===null?Ve(Kr,Kr.current):Ve(Kr,n.pool)}function $m(){var e=Oc();return e===null?null:{parent:Wt._currentValue,pool:e}}var Il=Error(a(460)),zc=Error(a(474)),bo=Error(a(542)),xo={then:function(){}};function Xm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Qm(e,n,l){switch(l=e[l],l===void 0?e.push(n):l!==n&&(n.then(bn,bn),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Km(e),e===void 0&&!("reason"in n)?Error(a(600)):e;default:if(typeof n.status=="string")n.then(bn,bn);else{if(e=qt,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,Km(e),e}throw Pr=n,Il}}function Jr(e){try{var n=e._init;return n(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Pr=l,Il):l}}var Pr=null;function Zm(){if(Pr===null)throw Error(a(459));var e=Pr;return Pr=null,e}function Km(e){if(e===Il||e===bo)throw Error(a(483))}var Vl=null,Ka=0;function wo(e){var n=Ka;return Ka+=1,Vl===null&&(Vl=[]),Qm(Vl,e,n)}function dr(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function So(e,n){throw n.$$typeof===Y?Error(a(525)):(e=Object.prototype.toString.call(n),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Jm(e){function n(H,L){if(e){var F=H.deletions;F===null?(H.deletions=[L],H.flags|=16):F.push(L)}}function l(H,L){if(!e)return null;for(;L!==null;)n(H,L),L=L.sibling;return null}function s(H){for(var L=new Map;H!==null;)H.key===null?L.set(H.index,H):L.set(H.key,H),H=H.sibling;return L}function f(H,L){return H=Fi(H,L),H.index=0,H.sibling=null,H}function d(H,L,F){return H.index=F,e?(F=H.alternate,F!==null?(F=F.index,F<L?(H.flags|=2,L):F):(H.flags|=134217730,L)):(H.flags|=1048576,L)}function b(H){return e&&H.alternate===null&&(H.flags|=134217730),H}function k(H,L,F,ne){return L===null||L.tag!==6?(L=kc(F,H.mode,ne),L.return=H,L):(L=f(L,F),L.return=H,L)}function _(H,L,F,ne){var Ce=F.type;return Ce===V?(H=X(H,L,F.props.children,ne,F.key),dr(H,F),H):L!==null&&(L.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===R&&Jr(Ce)===L.type)?(L=f(L,F.props),dr(L,F),L.return=H,L):(L=co(F.type,F.key,F.props,null,H.mode,ne),dr(L,F),L.return=H,L)}function I(H,L,F,ne){return L===null||L.tag!==4||L.stateNode.containerInfo!==F.containerInfo||L.stateNode.implementation!==F.implementation?(L=Ec(F,H.mode,ne),L.return=H,L):(L=f(L,F.children||[]),L.return=H,L)}function X(H,L,F,ne,Ce){return L===null||L.tag!==7?(L=Fr(F,H.mode,ne,Ce),L.return=H,L):(L=f(L,F),L.return=H,L)}function ie(H,L,F){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=kc(""+L,H.mode,F),L.return=H,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case le:return F=co(L.type,L.key,L.props,null,H.mode,F),dr(F,L),F.return=H,F;case O:return L=Ec(L,H.mode,F),L.return=H,L;case R:return L=Jr(L),ie(H,L,F)}if(be(L)||ve(L))return L=Fr(L,H.mode,F,null),L.return=H,L;if(typeof L.then=="function")return ie(H,wo(L),F);if(L.$$typeof===ge)return ie(H,go(H,L),F);So(H,L)}return null}function U(H,L,F,ne){var Ce=L!==null?L.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return Ce!==null?null:k(H,L,""+F,ne);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case le:return F.key===Ce?_(H,L,F,ne):null;case O:return F.key===Ce?I(H,L,F,ne):null;case R:return F=Jr(F),U(H,L,F,ne)}if(be(F)||ve(F))return Ce!==null?null:X(H,L,F,ne,null);if(typeof F.then=="function")return U(H,L,wo(F),ne);if(F.$$typeof===ge)return U(H,L,go(H,F),ne);So(H,F)}return null}function $(H,L,F,ne,Ce){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return H=H.get(F)||null,k(L,H,""+ne,Ce);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case le:return H=H.get(ne.key===null?F:ne.key)||null,_(L,H,ne,Ce);case O:return H=H.get(ne.key===null?F:ne.key)||null,I(L,H,ne,Ce);case R:return ne=Jr(ne),$(H,L,F,ne,Ce)}if(be(ne)||ve(ne))return H=H.get(F)||null,X(L,H,ne,Ce,null);if(typeof ne.then=="function")return $(H,L,F,wo(ne),Ce);if(ne.$$typeof===ge)return $(H,L,F,go(L,ne),Ce);So(L,ne)}return null}function Se(H,L,F,ne){for(var Ce=null,ot=null,qe=L,Ye=L=0,nn=null;qe!==null&&Ye<F.length;Ye++){qe.index>Ye?(nn=qe,qe=null):nn=qe.sibling;var yt=U(H,qe,F[Ye],ne);if(yt===null){qe===null&&(qe=nn);break}e&&qe&&yt.alternate===null&&n(H,qe),L=d(yt,L,Ye),ot===null?Ce=yt:ot.sibling=yt,ot=yt,qe=nn}if(Ye===F.length)return l(H,qe),et&&Gi(H,Ye),Ce;if(qe===null){for(;Ye<F.length;Ye++)qe=ie(H,F[Ye],ne),qe!==null&&(L=d(qe,L,Ye),ot===null?Ce=qe:ot.sibling=qe,ot=qe);return et&&Gi(H,Ye),Ce}for(qe=s(qe);Ye<F.length;Ye++)nn=$(qe,H,Ye,F[Ye],ne),nn!==null&&(e&&(yt=nn.alternate,yt!==null&&qe.delete(yt.key===null?Ye:yt.key)),L=d(nn,L,Ye),ot===null?Ce=nn:ot.sibling=nn,ot=nn);return e&&qe.forEach(function(_r){return n(H,_r)}),et&&Gi(H,Ye),Ce}function Re(H,L,F,ne){if(F==null)throw Error(a(151));for(var Ce=null,ot=null,qe=L,Ye=L=0,nn=null,yt=F.next();qe!==null&&!yt.done;Ye++,yt=F.next()){qe.index>Ye?(nn=qe,qe=null):nn=qe.sibling;var _r=U(H,qe,yt.value,ne);if(_r===null){qe===null&&(qe=nn);break}e&&qe&&_r.alternate===null&&n(H,qe),L=d(_r,L,Ye),ot===null?Ce=_r:ot.sibling=_r,ot=_r,qe=nn}if(yt.done)return l(H,qe),et&&Gi(H,Ye),Ce;if(qe===null){for(;!yt.done;Ye++,yt=F.next())yt=ie(H,yt.value,ne),yt!==null&&(L=d(yt,L,Ye),ot===null?Ce=yt:ot.sibling=yt,ot=yt);return et&&Gi(H,Ye),Ce}for(qe=s(qe);!yt.done;Ye++,yt=F.next())yt=$(qe,H,Ye,yt.value,ne),yt!==null&&(e&&(nn=yt.alternate,nn!==null&&qe.delete(nn.key===null?Ye:nn.key)),L=d(yt,L,Ye),ot===null?Ce=yt:ot.sibling=yt,ot=yt);return e&&qe.forEach(function(PS){return n(H,PS)}),et&&Gi(H,Ye),Ce}function Qe(H,L,F,ne){if(typeof F=="object"&&F!==null&&F.type===V&&F.key===null&&F.props.ref===void 0&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case le:e:{for(var Ce=F.key;L!==null;){if(L.key===Ce){if(Ce=F.type,Ce===V){if(L.tag===7){l(H,L.sibling),ne=f(L,F.props.children),dr(ne,F),ne.return=H,H=ne;break e}}else if(L.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===R&&Jr(Ce)===L.type){l(H,L.sibling),ne=f(L,F.props),dr(ne,F),ne.return=H,H=ne;break e}l(H,L);break}else n(H,L);L=L.sibling}F.type===V?(ne=Fr(F.props.children,H.mode,ne,F.key),dr(ne,F),ne.return=H,H=ne):(ne=co(F.type,F.key,F.props,null,H.mode,ne),dr(ne,F),ne.return=H,H=ne)}return b(H);case O:e:{for(Ce=F.key;L!==null;){if(L.key===Ce)if(L.tag===4&&L.stateNode.containerInfo===F.containerInfo&&L.stateNode.implementation===F.implementation){l(H,L.sibling),ne=f(L,F.children||[]),ne.return=H,H=ne;break e}else{l(H,L);break}else n(H,L);L=L.sibling}ne=Ec(F,H.mode,ne),ne.return=H,H=ne}return b(H);case R:return F=Jr(F),Qe(H,L,F,ne)}if(be(F))return Se(H,L,F,ne);if(ve(F)){if(Ce=ve(F),typeof Ce!="function")throw Error(a(150));return F=Ce.call(F),Re(H,L,F,ne)}if(typeof F.then=="function")return Qe(H,L,wo(F),ne);if(F.$$typeof===ge)return Qe(H,L,go(H,F),ne);So(H,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,L!==null&&L.tag===6?(l(H,L.sibling),ne=f(L,F),ne.return=H,H=ne):(l(H,L),ne=kc(F,H.mode,ne),ne.return=H,H=ne),b(H)):l(H,L)}return function(H,L,F,ne){try{Ka=0;var Ce=Qe(H,L,F,ne);return Vl=null,Ce}catch(qe){if(qe===Il||qe===bo)throw qe;var ot=Tn(29,qe,null,H.mode);return ot.lanes=ne,ot.return=H,ot}}}var Wr=Jm(!0),Pm=Jm(!1),hr=!1;function Mc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qc(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 mr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function pr(e,n,l){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(kt&2)!==0){var f=s.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),s.pending=n,n=uo(e),qm(e,null,l),n}return oo(e,s,n,l),uo(e)}function Ja(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,Ks(e,l)}}function Dc(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 Lc=!1;function Pa(){if(Lc){var e=Hl;if(e!==null)throw e}}function Wa(e,n,l,s){Lc=!1;var f=e.updateQueue;hr=!1;var d=f.firstBaseUpdate,b=f.lastBaseUpdate,k=f.shared.pending;if(k!==null){f.shared.pending=null;var _=k,I=_.next;_.next=null,b===null?d=I:b.next=I,b=_;var X=e.alternate;X!==null&&(X=X.updateQueue,k=X.lastBaseUpdate,k!==b&&(k===null?X.firstBaseUpdate=I:k.next=I,X.lastBaseUpdate=_))}if(d!==null){var ie=f.baseState;b=0,X=I=_=null,k=d;do{var U=k.lane&-536870913,$=U!==k.lane;if($?(st&U)===U:(s&U)===U){U!==0&&U===Zr&&(Lc=!0),X!==null&&(X=X.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Se=e,Re=k;U=n;var Qe=l;switch(Re.tag){case 1:if(Se=Re.payload,typeof Se=="function"){ie=Se.call(Qe,ie,U);break e}ie=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Re.payload,U=typeof Se=="function"?Se.call(Qe,ie,U):Se,U==null)break e;ie=D({},ie,U);break e;case 2:hr=!0}}U=k.callback,U!==null&&(e.flags|=64,$&&(e.flags|=8192),$=f.callbacks,$===null?f.callbacks=[U]:$.push(U))}else $={lane:U,tag:k.tag,payload:k.payload,callback:k.callback,next:null},X===null?(I=X=$,_=ie):X=X.next=$,b|=U;if(k=k.next,k===null){if(k=f.shared.pending,k===null)break;$=k,k=$.next,$.next=null,f.lastBaseUpdate=$,f.shared.pending=null}}while(!0);X===null&&(_=ie),f.baseState=_,f.firstBaseUpdate=I,f.lastBaseUpdate=X,d===null&&(f.shared.lanes=0),Sr|=b,e.lanes=b,e.memoizedState=ie}}function Wm(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function ep(e,n){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Wm(l[e],n)}var yr=De(null),ko=De(0);function tp(e,n){e=Pi,Ve(ko,e),Ve(yr,n),Pi=e|n.baseLanes}function Bc(){Ve(ko,Pi),Ve(yr,yr.current)}function Uc(){Pi=ko.current,Me(yr),Me(ko)}var dn=De(null),xn=null;function gr(e){var n=e.alternate;Ve(hn,hn.current&1),Ve(dn,e),xn===null&&(n===null||yr.current!==null||n.memoizedState!==null)&&(xn=e)}function Hc(e){Ve(hn,hn.current),Ve(dn,e),xn===null&&(xn=e)}function np(e){e.tag===22?(Ve(hn,hn.current),Ve(dn,e),xn===null&&(xn=e)):vr()}function vr(){Ve(hn,hn.current),Ve(dn,dn.current)}function Ln(e){Me(dn),xn===e&&(xn=null),Me(hn)}var hn=De(0);function es(e,n){Ve(dn,dn.current),Ve(hn,n)}function Ic(e){Me(hn),Me(dn),xn===e&&(xn=null)}function Eo(e){for(var n=e;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||cd(l)||fd(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 Qi=0,Xe=null,zt=null,en=null,jo=!1,Yl=!1,el=!1,To=0,ts=0,Fl=null,bw=0;function Qt(){throw Error(a(321))}function Vc(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 Yc(e,n,l,s,f,d){return Qi=d,Xe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,P.H=e===null||e.memoizedState===null?Up:Hp,el=!1,d=l(s,f),el=!1,Yl&&(d=rp(n,l,s,f)),ip(e),d}function ip(e){P.H=zo;var n=zt!==null&&zt.next!==null;if(Qi=0,en=zt=Xe=null,jo=!1,ts=0,Fl=null,n)throw Error(a(300));e===null||tn||(e=e.dependencies,e!==null&&yo(e)&&(tn=!0))}function rp(e,n,l,s){Xe=e;var f=0;do{if(Yl&&(Fl=null),ts=0,Yl=!1,25<=f)throw Error(a(301));if(f+=1,en=zt=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=Nw,d=n(l,s)}while(Yl);return d}function xw(){var e=P.H,n=e.useState()[0];return n=typeof n.then=="function"?ns(n):n,e=e.useState()[0],(zt!==null?zt.memoizedState:null)!==e&&(Xe.flags|=1024),n}function Fc(){var e=To!==0;return To=0,e}function Gc(e,n,l){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l}function $c(e){if(jo){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}jo=!1}Qi=0,en=zt=Xe=null,Yl=!1,ts=To=0,Fl=null}function Sn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return en===null?Xe.memoizedState=en=e:en=en.next=e,en}function Jt(){if(zt===null){var e=Xe.alternate;e=e!==null?e.memoizedState:null}else e=zt.next;var n=en===null?Xe.memoizedState:en.next;if(n!==null)en=n,zt=e;else{if(e===null)throw Xe.alternate===null?Error(a(467)):Error(a(310));zt=e,e={memoizedState:zt.memoizedState,baseState:zt.baseState,baseQueue:zt.baseQueue,queue:zt.queue,next:null},en===null?Xe.memoizedState=en=e:en=en.next=e}return en}function No(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ns(e){var n=ts;return ts+=1,Fl===null&&(Fl=[]),e=Qm(Fl,e,n),n=Xe,(en===null?n.memoizedState:en.next)===null&&(n=n.alternate,P.H=n===null||n.memoizedState===null?Up:Hp),e}function Co(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ns(e);if(e.$$typeof===te)return;if(e.$$typeof===ge)return fn(e)}throw Error(a(438,String(e)))}function Xc(e){var n=null,l=Xe.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var s=Xe.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=No(),Xe.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]=q;return n.index++,l}function Zi(e,n){return typeof n=="function"?n(e):n}function Ao(e){var n=Jt();return Qc(n,zt,e)}function Qc(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,_=null,I=n,X=!1;do{var ie=I.lane&-536870913;if(ie!==I.lane?(st&ie)===ie:(Qi&ie)===ie){var U=I.revertLane;if(U===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null}),ie===Zr&&(X=!0);else if((Qi&U)===U){I=I.next,U===Zr&&(X=!0);continue}else ie={lane:0,revertLane:I.revertLane,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},_===null?(k=_=ie,b=d):_=_.next=ie,Xe.lanes|=U,Sr|=U;ie=I.action,el&&l(d,ie),d=I.hasEagerState?I.eagerState:l(d,ie)}else U={lane:ie,revertLane:I.revertLane,gesture:I.gesture,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},_===null?(k=_=U,b=d):_=_.next=U,Xe.lanes|=ie,Sr|=ie;I=I.next}while(I!==null&&I!==n);if(_===null?b=d:_.next=k,!Dn(d,e.memoizedState)&&(tn=!0,X&&(l=Hl,l!==null)))throw l;e.memoizedState=d,e.baseState=b,e.baseQueue=_,s.lastRenderedState=d}return f===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Zc(e){var n=Jt(),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)||(tn=!0),n.memoizedState=d,n.baseQueue===null&&(n.baseState=d),l.lastRenderedState=d}return[d,s]}function lp(e,n,l){var s=Xe,f=Jt(),d=et;if(d){if(l===void 0)throw Error(a(407));l=l()}else l=n();var b=!Dn((zt||f).memoizedState,l);if(b&&(f.memoizedState=l,tn=!0),f=f.queue,Pc(op.bind(null,s,f,e),[e]),e=f.getSnapshot!==n||b||en!==null&&(en.memoizedState.tag&1)!==0,Gl(e?9:8,{destroy:void 0},sp.bind(null,s,f,l,n),null),e){if(s.flags|=2048,qt===null)throw Error(a(349));d||(Qi&127)!==0||ap(s,n,l)}return l}function ap(e,n,l){e.flags|=16384,e={getSnapshot:n,value:l},n=Xe.updateQueue,n===null?(n=No(),Xe.updateQueue=n,n.stores=[e]):(l=n.stores,l===null?n.stores=[e]:l.push(e))}function sp(e,n,l,s){n.value=l,n.getSnapshot=s,up(n)&&cp(e)}function op(e,n,l){return l(function(){up(n)&&cp(e)})}function up(e){var n=e.getSnapshot;e=e.value;try{var l=n();return!Dn(e,l)}catch{return!0}}function cp(e){var n=Yr(e,2);n!==null&&Rn(n,e,2)}function Kc(e){var n=Sn();if(typeof e=="function"){var l=e;if(e=l(),el){Mt(!0);try{l()}finally{Mt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zi,lastRenderedState:e},n}function fp(e,n,l,s){return e.baseState=l,Qc(e,zt,typeof s=="function"?s:Zi)}function ww(e,n,l,s,f){if(Oo(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,dp(n,d)):(d.next=l.next,n.pending=l.next=d)}}function dp(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),_=P.S;_!==null&&_(b,k),hp(e,n,k)}catch(I){Jc(e,n,I)}finally{d!==null&&b.types!==null&&(d.types=b.types),P.T=d}}else try{d=l(f,s),hp(e,n,d)}catch(I){Jc(e,n,I)}}function hp(e,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(s){mp(e,n,s)},function(s){return Jc(e,n,s)}):mp(e,n,l)}function mp(e,n,l){n.status="fulfilled",n.value=l,pp(n),e.state=l,n=e.pending,n!==null&&(l=n.next,l===n?e.pending=null:(l=l.next,n.next=l,dp(e,l)))}function Jc(e,n,l){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=l,pp(n),n=n.next;while(n!==s)}e.action=null}function pp(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function yp(e,n){return n}function gp(e,n){if(et){var l=qt.formState;if(l!==null){e:{var s=Xe;if(et){if(Ht){t:{for(var f=Ht,d=Jn;f.nodeType!==8;){if(!d){f=null;break t}if(f=Wn(f.nextSibling),f===null){f=null;break t}}d=f.data,f=d==="F!"||d==="F"?f:null}if(f){Ht=Wn(f.nextSibling),s=f.data==="F!";break e}}cr(s)}s=!1}s&&(n=l[0])}}return l=Sn(),l.memoizedState=l.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yp,lastRenderedState:n},l.queue=s,l=Dp.bind(null,Xe,s),s.dispatch=l,s=Kc(!1),d=rf.bind(null,Xe,!1,s.queue),s=Sn(),f={state:n,dispatch:null,action:e,pending:null},s.queue=f,l=ww.bind(null,Xe,f,d,l),f.dispatch=l,s.memoizedState=e,[n,l,!1]}function vp(e){var n=Jt();return bp(n,zt,e)}function bp(e,n,l){if(n=Qc(e,n,yp)[0],e=Ao(Zi)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=ns(n)}catch(b){throw b===Il?bo:b}else s=n;n=Jt();var f=n.queue,d=f.dispatch;return l!==n.memoizedState&&(Xe.flags|=2048,Gl(9,{destroy:void 0},Sw.bind(null,f,l),null)),[s,d,e]}function Sw(e,n){e.action=n}function xp(e){var n=Jt(),l=zt;if(l!==null)return bp(n,l,e);Jt(),n=n.memoizedState,l=Jt();var s=l.queue.dispatch;return l.memoizedState=e,[n,s,!1]}function Gl(e,n,l,s){return e={tag:e,create:l,deps:s,inst:n,next:null},n=Xe.updateQueue,n===null&&(n=No(),Xe.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 wp(){return Jt().memoizedState}function Ro(e,n,l,s){var f=Sn();Xe.flags|=e,f.memoizedState=Gl(1|n,{destroy:void 0},l,s===void 0?null:s)}function _o(e,n,l,s){var f=Jt();s=s===void 0?null:s;var d=f.memoizedState.inst;zt!==null&&s!==null&&Vc(s,zt.memoizedState.deps)?f.memoizedState=Gl(n,d,l,s):(Xe.flags|=e,f.memoizedState=Gl(1|n,d,l,s))}function Sp(e,n){Ro(8390656,8,e,n)}function Pc(e,n){_o(2048,8,e,n)}function kw(e){Xe.flags|=4;var n=Xe.updateQueue;if(n===null)n=No(),Xe.updateQueue=n,n.events=[e];else{var l=n.events;l===null?n.events=[e]:l.push(e)}}function kp(e){var n=Jt().memoizedState;return kw({ref:n,nextImpl:e}),function(){if((kt&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}function Ep(e,n){return _o(4,2,e,n)}function jp(e,n){return _o(4,4,e,n)}function Tp(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 Np(e,n,l){l=l!=null?l.concat([e]):null,_o(4,4,Tp.bind(null,n,e),l)}function Wc(){}function Cp(e,n){var l=Jt();n=n===void 0?null:n;var s=l.memoizedState;return n!==null&&Vc(n,s[1])?s[0]:(l.memoizedState=[e,n],e)}function Ap(e,n){var l=Jt();n=n===void 0?null:n;var s=l.memoizedState;if(n!==null&&Vc(n,s[1]))return s[0];if(s=e(),el){Mt(!0);try{e()}finally{Mt(!1)}}return l.memoizedState=[s,n],s}function ef(e,n,l){return l===void 0||(Qi&1073741824)!==0&&(st&261930)===0?e.memoizedState=n:(e.memoizedState=l,e=Uy(),Xe.lanes|=e,Sr|=e,l)}function Rp(e,n,l,s){return Dn(l,n)?l:yr.current!==null?(e=ef(e,l,s),Dn(e,n)||(tn=!0),e):(Qi&106)===0||(Qi&1073741824)!==0&&(st&261930)===0?(tn=!0,e.memoizedState=l):(e=Uy(),Xe.lanes|=e,Sr|=e,n)}function _p(e,n,l,s,f){var d=he.p;he.p=d!==0&&8>d?d:8;var b=P.T,k={};k.types=b!==null?b.types:null,P.T=k,rf(e,!1,n,l);try{var _=f(),I=P.S;if(I!==null&&I(k,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var X=vw(_,s);is(e,n,X,In(e))}else is(e,n,s,In(e))}catch(ie){is(e,n,{then:function(){},status:"rejected",reason:ie},In())}finally{he.p=d,b!==null&&k.types!==null&&(b.types=k.types),P.T=b}}function Ew(){}function tf(e,n,l,s){if(e.tag!==5)throw Error(a(476));var f=Op(e).queue;_p(e,f,n,We,l===null?Ew:function(){return zp(e),l(s)})}function Op(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:Zi,lastRenderedState:We},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zi,lastRenderedState:l},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function zp(e){var n=Op(e);n.next===null&&(n=e.alternate.memoizedState),is(e,n.next.queue,{},In())}function nf(){return fn(ca)}function Mp(){return Jt().memoizedState}function qp(){return Jt().memoizedState}function jw(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var l=In();e=mr(l);var s=pr(n,e,l);s!==null&&(Rn(s,n,l),Ja(s,n,l)),n={cache:Rc()},e.payload=n;return}n=n.return}}function Tw(e,n,l){var s=In();l={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Oo(e)?Lp(n,l):(l=wc(e,n,l,s),l!==null&&(Rn(l,e,s),Bp(l,n,s)))}function Dp(e,n,l){var s=In();is(e,n,l,s)}function is(e,n,l,s){var f={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Oo(e))Lp(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 oo(e,n,f,0),qt===null&&so(),!1}catch{}if(l=wc(e,n,f,s),l!==null)return Rn(l,e,s),Bp(l,n,s),!0}return!1}function rf(e,n,l,s){if(s={lane:2,revertLane:Qf(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Oo(e)){if(n)throw Error(a(479))}else n=wc(e,l,s,2),n!==null&&Rn(n,e,2)}function Oo(e){var n=e.alternate;return e===Xe||n!==null&&n===Xe}function Lp(e,n){Yl=jo=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function Bp(e,n,l){if((l&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,l|=s,n.lanes=l,Ks(e,l)}}var zo={readContext:fn,use:Co,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt,useHostTransitionStatus:Qt,useFormState:Qt,useActionState:Qt,useOptimistic:Qt,useMemoCache:Qt,useCacheRefresh:Qt,useEffectEvent:Qt},Up={readContext:fn,use:Co,useCallback:function(e,n){return Sn().memoizedState=[e,n===void 0?null:n],e},useContext:fn,useEffect:Sp,useImperativeHandle:function(e,n,l){l=l!=null?l.concat([e]):null,Ro(4194308,4,Tp.bind(null,n,e),l)},useLayoutEffect:function(e,n){return Ro(4194308,4,e,n)},useInsertionEffect:function(e,n){Ro(4,2,e,n)},useMemo:function(e,n){var l=Sn();n=n===void 0?null:n;var s=e();if(el){Mt(!0);try{e()}finally{Mt(!1)}}return l.memoizedState=[s,n],s},useReducer:function(e,n,l){var s=Sn();if(l!==void 0){var f=l(n);if(el){Mt(!0);try{l(n)}finally{Mt(!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=Tw.bind(null,Xe,e),[s.memoizedState,e]},useRef:function(e){var n=Sn();return e={current:e},n.memoizedState=e},useState:function(e){e=Kc(e);var n=e.queue,l=Dp.bind(null,Xe,n);return n.dispatch=l,[e.memoizedState,l]},useDebugValue:Wc,useDeferredValue:function(e,n){var l=Sn();return ef(l,e,n)},useTransition:function(){var e=Kc(!1);return e=_p.bind(null,Xe,e.queue,!0,!1),Sn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,l){var s=Xe,f=Sn();if(et){if(l===void 0)throw Error(a(407));l=l()}else{if(l=n(),qt===null)throw Error(a(349));(st&127)!==0||ap(s,n,l)}f.memoizedState=l;var d={value:l,getSnapshot:n};return f.queue=d,Sp(op.bind(null,s,d,e),[e]),s.flags|=2048,Gl(9,{destroy:void 0},sp.bind(null,s,d,l,n),null),l},useId:function(){var e=Sn(),n=qt.identifierPrefix;if(et){var l=bi,s=vi;l=(s&~(1<<32-jt(s)-1)).toString(32)+l,n="_"+n+"R_"+l,l=To++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=bw++,n="_"+n+"r_"+l.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:nf,useFormState:gp,useActionState:gp,useOptimistic:function(e){var n=Sn();n.memoizedState=n.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=rf.bind(null,Xe,!0,l),l.dispatch=n,[e,n]},useMemoCache:Xc,useCacheRefresh:function(){return Sn().memoizedState=jw.bind(null,Xe)},useEffectEvent:function(e){var n=Sn(),l={impl:e};return n.memoizedState=l,function(){if((kt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Hp={readContext:fn,use:Co,useCallback:Cp,useContext:fn,useEffect:Pc,useImperativeHandle:Np,useInsertionEffect:Ep,useLayoutEffect:jp,useMemo:Ap,useReducer:Ao,useRef:wp,useState:function(){return Ao(Zi)},useDebugValue:Wc,useDeferredValue:function(e,n){var l=Jt();return Rp(l,zt.memoizedState,e,n)},useTransition:function(){var e=Ao(Zi)[0],n=Jt().memoizedState;return[typeof e=="boolean"?e:ns(e),n]},useSyncExternalStore:lp,useId:Mp,useHostTransitionStatus:nf,useFormState:vp,useActionState:vp,useOptimistic:function(e,n){var l=Jt();return fp(l,zt,e,n)},useMemoCache:Xc,useCacheRefresh:qp,useEffectEvent:kp},Nw={readContext:fn,use:Co,useCallback:Cp,useContext:fn,useEffect:Pc,useImperativeHandle:Np,useInsertionEffect:Ep,useLayoutEffect:jp,useMemo:Ap,useReducer:Zc,useRef:wp,useState:function(){return Zc(Zi)},useDebugValue:Wc,useDeferredValue:function(e,n){var l=Jt();return zt===null?ef(l,e,n):Rp(l,zt.memoizedState,e,n)},useTransition:function(){var e=Zc(Zi)[0],n=Jt().memoizedState;return[typeof e=="boolean"?e:ns(e),n]},useSyncExternalStore:lp,useId:Mp,useHostTransitionStatus:nf,useFormState:xp,useActionState:xp,useOptimistic:function(e,n){var l=Jt();return zt!==null?fp(l,zt,e,n):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Xc,useCacheRefresh:qp,useEffectEvent:kp};function lf(e,n,l,s){n=e.memoizedState,l=l(s,n),l=l==null?n:D({},n,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var af={enqueueSetState:function(e,n,l){e=e._reactInternals;var s=In(),f=mr(s);f.payload=n,l!=null&&(f.callback=l),n=pr(e,f,s),n!==null&&(Rn(n,e,s),Ja(n,e,s))},enqueueReplaceState:function(e,n,l){e=e._reactInternals;var s=In(),f=mr(s);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=pr(e,f,s),n!==null&&(Rn(n,e,s),Ja(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var l=In(),s=mr(l);s.tag=2,n!=null&&(s.callback=n),n=pr(e,s,l),n!==null&&(Rn(n,e,l),Ja(n,e,l))}};function Ip(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?!Ya(l,s)||!Ya(f,d):!0}function Vp(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&&af.enqueueReplaceState(n,n.state,null)}function tl(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=D({},l));for(var f in e)l[f]===void 0&&(l[f]=e[f])}return l}function Yp(e){ao(e)}function Fp(e){console.error(e)}function Gp(e){ao(e)}function Mo(e,n){try{var l=e.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function $p(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 sf(e,n,l){return l=mr(l),l.tag=3,l.payload={element:null},l.callback=function(){Mo(e,n)},l}function Xp(e){return e=mr(e),e.tag=3,e}function Qp(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(){$p(n,l,s)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){$p(n,l,s),typeof f!="function"&&(kr===null?kr=new Set([this]):kr.add(this));var k=s.stack;this.componentDidCatch(s.value,{componentStack:k!==null?k:""})})}function Cw(e,n,l,s,f){if(l.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=l.alternate,n!==null&&Xr(n,l,f,!0),l=dn.current,l!==null){switch(l.tag){case 31:case 13:case 19:return xn===null?tu():l.alternate===null&&Zt===0&&(Zt=3),l.flags&=-257,l.flags|=65536,l.lanes=f,s===xo?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([s]):n.add(s),Gf(e,s,f)),!1;case 22:return l.flags|=65536,s===xo?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)),Gf(e,s,f)),!1}throw Error(a(435,l.tag))}return Gf(e,s,f),tu(),!1}if(et)return n=dn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,s!==Tc&&(e=Error(a(422),{cause:s}),$a(Qn(e,l)))):(s!==Tc&&(n=Error(a(423),{cause:s}),$a(Qn(n,l))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,s=Qn(s,l),f=sf(e.stateNode,s,f),Dc(e,f),Zt!==4&&(Zt=2)),!1;var d=Error(a(520),{cause:s});if(d=Qn(d,l),fs===null?fs=[d]:fs.push(d),Zt!==4&&(Zt=2),n===null)return!0;s=Qn(s,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,e=f&-f,l.lanes|=e,e=sf(l.stateNode,s,e),Dc(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"&&(kr===null||!kr.has(d))))return l.flags|=65536,f&=-f,l.lanes|=f,f=Xp(f),Qp(f,e,l,s),Dc(l,f),!1;break;case 22:if(l.memoizedState!==null)return l.flags|=65536,!1}l=l.return}while(l!==null);return!1}var of=Error(a(461)),tn=!1;function an(e,n,l,s){n.child=e===null?Pm(n,null,l,s):Wr(n,e.child,l,s)}function Zp(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 Qr(n),s=Yc(e,n,l,b,d,f),k=Fc(),e!==null&&!tn?(Gc(e,n,f),Ki(e,n,f)):(et&&k&&ho(n),n.flags|=1,an(e,n,s,f),n.child)}function Kp(e,n,l,s,f){if(e===null){var d=l.type;return typeof d=="function"&&!Sc(d)&&d.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=d,Jp(e,n,d,s,f)):(e=co(l.type,null,s,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(d=e.child,!yf(e,f)){var b=d.memoizedProps;if(l=l.compare,l=l!==null?l:Ya,l(b,s)&&e.ref===n.ref)return Ki(e,n,f)}return n.flags|=1,e=Fi(d,s),e.ref=n.ref,e.return=n,n.child=e}function Jp(e,n,l,s,f){if(e!==null){var d=e.memoizedProps;if(Ya(d,s)&&e.ref===n.ref)if(tn=!1,n.pendingProps=s=d,yf(e,f))(e.flags&131072)!==0&&(tn=!0);else return n.lanes=e.lanes,Ki(e,n,f)}return uf(e,n,l,s,f)}function Pp(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 Wp(e,n,d,l,s)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&vo(n,d!==null?d.cachePool:null),d!==null?tp(n,d):Bc(),np(n);else return s=n.lanes=536870912,Wp(e,n,d!==null?d.baseLanes|l:l,l,s)}else d!==null?(vo(n,d.cachePool),tp(n,d),vr(),n.memoizedState=null):(e!==null&&vo(n,null),Bc(),vr());return an(e,n,f,l),n.child}function rs(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Wp(e,n,l,s,f){var d=Oc();return d=d===null?null:{parent:Wt._currentValue,pool:d},n.memoizedState={baseLanes:l,cachePool:d},e!==null&&vo(n,null),Bc(),np(n),e!==null&&Xr(e,n,s,!0),n.childLanes=f,null}function qo(e,n){return n=Do({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function ey(e,n,l){return Wr(n,e.child,null,l),e=qo(n,n.pendingProps),e.flags|=2,Ln(n),n.memoizedState=null,e}function Aw(e,n,l){var s=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(et){if(s.mode==="hidden")return e=qo(n,s),n.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},rs(null,e);if(Hc(n),(e=Ht)?(e=Tg(e,Jn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:or!==null?{id:vi,overflow:bi}:null,retryLane:536870912,hydrationErrors:null},l=Lm(e),l.return=n,n.child=l,sn=n,Ht=null)):e=null,e===null)throw cr(n);return n.lanes=536870912,null}return qo(n,s)}var d=e.memoizedState;if(d!==null){var b=d.dehydrated;if(Hc(n),f)if(n.flags&256)n.flags&=-257,n=ey(e,n,l);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(a(558));else if(tn||Xr(e,n,l,!1),f=(l&e.childLanes)!==0,tn||f){if(yr.current===null){if(s=qt,s!==null&&(b=Ea(s,l),b!==0&&b!==d.retryLane))throw d.retryLane=b,Yr(e,b),Rn(s,e,b),of;tu()}n=ey(e,n,l)}else e=d.treeContext,Ht=Wn(b.nextSibling),sn=n,et=!0,ur=null,Jn=!1,e!==null&&Hm(n,e),n=qo(n,s),n.flags|=134221824;return n}return e=Fi(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function $l(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 uf(e,n,l,s,f){return Qr(n),l=Yc(e,n,l,s,void 0,f),s=Fc(),e!==null&&!tn?(Gc(e,n,f),Ki(e,n,f)):(et&&s&&ho(n),n.flags|=1,an(e,n,l,f),n.child)}function ty(e,n,l,s,f,d){return Qr(n),n.updateQueue=null,l=rp(n,s,l,f),ip(e),s=Fc(),e!==null&&!tn?(Gc(e,n,d),Ki(e,n,d)):(et&&s&&ho(n),n.flags|=1,an(e,n,l,d),n.child)}function ny(e,n,l,s,f){if(Qr(n),n.stateNode===null){var d=Dl,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=af,n.stateNode=d,d._reactInternals=n,d=n.stateNode,d.props=s,d.state=n.memoizedState,d.refs={},Mc(n),b=l.contextType,d.context=typeof b=="object"&&b!==null?fn(b):Dl,d.state=n.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(lf(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&&af.enqueueReplaceState(d,d.state,null),Wa(n,s,d,f),Pa(),d.state=n.memoizedState),typeof d.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){d=n.stateNode;var k=n.memoizedProps,_=tl(l,k);d.props=_;var I=d.context,X=l.contextType;b=Dl,typeof X=="object"&&X!==null&&(b=fn(X));var ie=l.getDerivedStateFromProps;X=typeof ie=="function"||typeof d.getSnapshotBeforeUpdate=="function",k=n.pendingProps!==k,X||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(k||I!==b)&&Vp(n,d,s,b),hr=!1;var U=n.memoizedState;d.state=U,Wa(n,s,d,f),Pa(),I=n.memoizedState,k||U!==I||hr?(typeof ie=="function"&&(lf(n,l,ie,s),I=n.memoizedState),(_=hr||Ip(n,l,_,s,U,I,b))?(X||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=I),d.props=s,d.state=I,d.context=b,s=_):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{d=n.stateNode,qc(e,n),b=n.memoizedProps,X=tl(l,b),d.props=X,ie=n.pendingProps,U=d.context,I=l.contextType,_=Dl,typeof I=="object"&&I!==null&&(_=fn(I)),k=l.getDerivedStateFromProps,(I=typeof k=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==ie||U!==_)&&Vp(n,d,s,_),hr=!1,U=n.memoizedState,d.state=U,Wa(n,s,d,f),Pa();var $=n.memoizedState;b!==ie||U!==$||hr||e!==null&&e.dependencies!==null&&yo(e.dependencies)?(typeof k=="function"&&(lf(n,l,k,s),$=n.memoizedState),(X=hr||Ip(n,l,X,s,U,$,_)||e!==null&&e.dependencies!==null&&yo(e.dependencies))?(I||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,$,_),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,$,_)),typeof d.componentDidUpdate=="function"&&(n.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&U===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&U===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=$),d.props=s,d.state=$,d.context=_,s=X):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&U===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&U===e.memoizedState||(n.flags|=1024),s=!1)}return d=s,$l(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=Wr(n,e.child,null,f),n.child=Wr(n,null,l,f)):an(e,n,l,f),n.memoizedState=d.state,e=n.child):e=Ki(e,n,f),e}function iy(e,n,l,s){return Gr(),n.flags|=256,an(e,n,l,s),n.child}var cf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ff(e){return{baseLanes:e,cachePool:$m()}}function df(e,n,l){return e=e!==null?e.childLanes&~l:0,n&&(e|=Hn),e}function ry(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(et){if(f?gr(n):vr(),(e=Ht)?(e=Tg(e,Jn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:or!==null?{id:vi,overflow:bi}:null,retryLane:536870912,hydrationErrors:null},l=Lm(e),l.return=n,n.child=l,sn=n,Ht=null)):e=null,e===null)throw cr(n);return fd(e)?n.lanes=32:n.lanes=536870912,null}return d=s.children,s=s.fallback,f?(vr(),f=n.mode,d=Do({mode:"hidden",children:d},f),s=Fr(s,f,l,null),d.return=n,s.return=n,d.sibling=s,n.child=d,s=n.child,s.memoizedState=ff(l),s.childLanes=df(e,b,l),n.memoizedState=cf,rs(null,s)):(gr(n),hf(n,d))}var k=e.memoizedState;if(k!==null){var _=k.dehydrated;if(_!==null)return Rw(e,n,d,b,s,_,k,l)}return f?(vr(),f=s.fallback,d=n.mode,k=e.child,_=k.sibling,s=Fi(k,{mode:"hidden",children:s.children}),s.subtreeFlags=k.subtreeFlags&1206910976,_!==null?f=Fi(_,f):(f=Fr(f,d,l,null),f.flags|=2),f.return=n,s.return=n,s.sibling=f,n.child=s,rs(null,s),s=n.child,f=e.child.memoizedState,f===null?f=ff(l):(d=f.cachePool,d!==null?(k=Wt._currentValue,d=d.parent!==k?{parent:k,pool:k}:d):d=$m(),f={baseLanes:f.baseLanes|l,cachePool:d}),s.memoizedState=f,s.childLanes=df(e,b,l),n.memoizedState=cf,rs(e.child,s)):(gr(n),l=e.child,e=l.sibling,l=Fi(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 hf(e,n){return n=Do({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Do(e,n){return e=Tn(22,e,null,n),e.lanes=0,e}function Lo(e,n,l){return Wr(n,e.child,null,l),e=hf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Rw(e,n,l,s,f,d,b,k){if(l)return n.flags&256?(gr(n),n.flags&=-257,Lo(e,n,k)):n.memoizedState!==null?(vr(),n.child=e.child,n.flags|=128,null):(vr(),d=f.fallback,b=n.mode,f=Do({mode:"visible",children:f.children},b),d=Fr(d,b,k,null),d.flags|=2,f.return=n,d.return=n,f.sibling=d,n.child=f,Wr(n,e.child,null,k),f=n.child,f.memoizedState=ff(k),f.childLanes=df(e,s,k),n.memoizedState=cf,rs(null,f));if(gr(n),fd(d)){if(s=d.nextSibling&&d.nextSibling.dataset,s)var _=s.dgst;return s=_,s!==""&&(f=Error(a(419)),f.stack="",f.digest=s,$a({value:f,source:null,stack:null})),Lo(e,n,k)}if(tn||Xr(e,n,k,!1),s=(k&e.childLanes)!==0,tn||s){if(yr.current!==null)return Lo(e,n,k);if(s=qt,s!==null&&(f=Ea(s,k),f!==0&&f!==b.retryLane))throw b.retryLane=f,Yr(e,f),Rn(s,e,f),of;return cd(d)||tu(),Lo(e,n,k)}return cd(d)?(n.flags|=192,n.child=e.child,null):(e=b.treeContext,Ht=Wn(d.nextSibling),sn=n,et=!0,ur=null,Jn=!1,e!==null&&Hm(n,e),n=hf(n,f.children),n.flags|=134221824,n)}function ly(e,n,l){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),po(e.return,n,l)}function ay(e){for(var n=null;e!==null;){var l=e.alternate;l!==null&&Eo(l)===null&&(n=e),e=e.sibling}return n}function Bo(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 mf(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 pf(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 es(n,b),null;var k=(b&2)!==0;if(k?(b=b&1|2,n.flags|=128):b&=1,es(n,b),f==="backwards"&&e!==null?(mf(e),an(e,n,s,l),mf(e)):an(e,n,s,l),s=et?Ga:0,!k&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ly(e,l,n);else if(e.tag===19)ly(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=ay(n.child),l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null,mf(n)),Bo(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&&Eo(e)===null){n.child=f;break}e=f.sibling,f.sibling=l,l=f,f=e}Bo(n,!0,l,null,d,s);break;case"together":Bo(n,!1,null,null,void 0,s);break;case"independent":n.memoizedState=null;break;default:l=ay(n.child),l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),Bo(n,!1,f,l,d,s)}return n.child}function sy(e,n,l){var s=n.pendingProps;return fr(n,n.type,s.value),an(e,n,s.children,l),n.child}function Ki(e,n,l){if(e!==null&&(n.dependencies=e.dependencies),Sr|=n.lanes,(l&n.childLanes)===0)if(e!==null){if(Xr(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=Fi(e,e.pendingProps),n.child=l,l.return=n;e.sibling!==null;)e=e.sibling,l=l.sibling=Fi(e,e.pendingProps),l.return=n;l.sibling=null}return n.child}function yf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&yo(e)))}function _w(e,n,l){switch(n.tag){case 3:Be(n,n.stateNode.containerInfo),fr(n,Wt,e.memoizedState.cache),Gr();break;case 27:case 5:Kt(n);break;case 4:Be(n,n.stateNode.containerInfo);break;case 10:fr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Hc(n),null;break;case 13:var s=n.memoizedState;if(s!==null){if(s.dehydrated!==null)return gr(n),n.flags|=128,null;s=Xr(e,n,l,!1);var f=n.child.childLanes;return s||(l&f)!==0?ry(e,n,l):(gr(n),e=Ki(e,n,l),e!==null?e.sibling:null)}gr(n);break;case 19:if(n.flags&128)return pf(e,n,l);if(f=(e.flags&128)!==0,s=(l&n.childLanes)!==0,s||(Xr(e,n,l,!1),s=(l&n.childLanes)!==0),f){if(s)return pf(e,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),es(n,hn.current),s)break;return null;case 22:return n.lanes=0,Pp(e,n,l,n.pendingProps);case 24:fr(n,Wt,e.memoizedState.cache)}return Ki(e,n,l)}function oy(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps)tn=!0;else{if(!yf(e,l)&&(n.flags&128)===0)return tn=!1,_w(e,n,l);tn=(e.flags&131072)!==0}else tn=!1,et&&(n.flags&1048576)!==0&&Um(n,Ga,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=Jr(n.elementType),n.type=e,typeof e=="function")Sc(e)?(s=tl(e,s),n.tag=1,n=ny(null,n,e,s,l)):(n.tag=0,n=uf(null,n,e,s,l));else{if(e!=null){var f=e.$$typeof;if(f===re){n.tag=11,n=Zp(null,n,e,s,l);break e}else if(f===Te){n.tag=14,n=Kp(null,n,e,s,l);break e}else if(f===ge){n.tag=10,n.type=e,n=sy(null,n,l);break e}}throw n=ye(e)||e,Error(a(306,n,""))}}return n;case 0:return uf(e,n,n.type,n.pendingProps,l);case 1:return s=n.type,f=tl(s,n.pendingProps),ny(e,n,s,f,l);case 3:e:{if(Be(n,n.stateNode.containerInfo),e===null)throw Error(a(387));s=n.pendingProps;var d=n.memoizedState;f=d.element,qc(e,n),Wa(n,s,null,l);var b=n.memoizedState;if(s=b.cache,fr(n,Wt,s),s!==d.cache&&Ac(n,[Wt],l,!0),Pa(),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=iy(e,n,s,l);break e}else if(s!==f){f=Qn(Error(a(424)),n),$a(f),n=iy(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,Ht=Wn(e.firstChild),sn=n,et=!0,ur=null,Jn=!0,l=Pm(n,null,s,l),n.child=l;l;)l.flags=l.flags&-3|134221824,l=l.sibling;else{if(Gr(),s===f){n=Ki(e,n,l);break e}an(e,n,s,l)}n=n.child}return n;case 26:return $l(e,n),e===null?(l=zg(n.type,null,n.pendingProps,null))?n.memoizedState=l:et||(n.stateNode=dg(n.type,n.pendingProps,nt.current,n)):n.memoizedState=zg(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Kt(n),e===null&&et&&(s=n.stateNode=Ag(n.type,n.pendingProps,nt.current),sn=n,Jn=!0,f=Ht,Tr(n.type)?(dd=f,Ht=Wn(s.firstChild)):Ht=f),an(e,n,n.pendingProps.children,l),$l(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&et&&((f=s=Ht)&&(s=jS(s,n.type,n.pendingProps,Jn),s!==null?(n.stateNode=s,sn=n,Ht=Wn(s.firstChild),Jn=!1,f=!0):f=!1),f||cr(n)),Kt(n),f=n.type,d=n.pendingProps,b=e!==null?e.memoizedProps:null,s=d.children,id(f,d)?s=null:b!==null&&id(f,b)&&(n.flags|=32),n.memoizedState!==null&&(f=Yc(e,n,xw,null,null,l),ca._currentValue=f),$l(e,n),an(e,n,s,l),n.child;case 6:return e===null&&et&&((e=l=Ht)&&(l=TS(l,n.pendingProps,Jn),l!==null?(n.stateNode=l,sn=n,Ht=null,e=!0):e=!1),e||cr(n)),null;case 13:return ry(e,n,l);case 4:return Be(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=Wr(n,null,s,l):an(e,n,s,l),n.child;case 11:return Zp(e,n,n.type,n.pendingProps,l);case 7:return s=n.pendingProps,$l(e,n),an(e,n,s,l),n.child;case 8:return an(e,n,n.pendingProps.children,l),n.child;case 12:return an(e,n,n.pendingProps.children,l),n.child;case 10:return sy(e,n,l);case 9:return f=n.type._context,s=n.pendingProps.children,Qr(n),f=fn(f),s=s(f),n.flags|=1,an(e,n,s,l),n.child;case 14:return Kp(e,n,n.type,n.pendingProps,l);case 15:return Jp(e,n,n.type,n.pendingProps,l);case 19:return pf(e,n,l);case 31:return Aw(e,n,l);case 22:return Pp(e,n,l,n.pendingProps);case 24:return Qr(n),s=fn(Wt),e===null?(f=Oc(),f===null&&(f=qt,d=Rc(),f.pooledCache=d,d.refCount++,d!==null&&(f.pooledCacheLanes|=l),f=d),n.memoizedState={parent:s,cache:f},Mc(n),fr(n,Wt,f)):((e.lanes&l)!==0&&(qc(e,n),Wa(n,null,null,l),Pa()),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),fr(n,Wt,s)):(s=d.cache,fr(n,Wt,s),s!==f.cache&&Ac(n,[Wt],l,!0))),an(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:et&&ho(n),e!==null&&e.memoizedProps.name!==s.name?n.flags|=4194816:$l(e,n),an(e,n,s.children,l),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function Ji(e){e.flags|=4}function gf(e,n,l,s,f){var d;if((d=(e.mode&32)!==0)&&(d=l===null?Lg(n,s):Lg(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(Yy())e.flags|=8192;else throw Pr=xo,zc}else e.flags&=-16777217}function uy(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Bg(n))if(Yy())e.flags|=8192;else throw Pr=xo,zc}function Uo(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Zs():536870912,e.lanes|=n,Jl|=n)}function ls(e,n){if(!et)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 It(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 Ow(e,n,l){var s=n.pendingProps;switch(jc(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(n),null;case 1:return It(n),null;case 3:return l=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Xi(Wt),ut(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ul(n)?Ji(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Nc())),It(n),null;case 26:var f=n.type,d=n.memoizedState;return e===null?(Ji(n),d!==null?(It(n),uy(n,d)):(It(n),gf(n,f,null,s,l))):d?d!==e.memoizedState?(Ji(n),It(n),uy(n,d)):(It(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Ji(n),It(n),gf(n,f,e,s,l)),null;case 27:if(Bt(n),l=nt.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Ji(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return It(n),n.subtreeFlags&=-33554433,null}e=Ae.current,Ul(n)?Im(n):(e=Ag(f,s,l),n.stateNode=e,Ji(n))}return It(n),n.subtreeFlags&=-33554433,null;case 5:if(Bt(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Ji(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return It(n),n.subtreeFlags&=-33554433,null}if(d=Ae.current,Ul(n))Im(n);else{var b=ys(nt.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[$t]=n,d[ln]=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&&Ji(n)}}return It(n),n.subtreeFlags&=-33554433,gf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,l),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Ji(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(a(166));if(e=nt.current,Ul(n)){if(e=n.stateNode,l=n.memoizedProps,s=null,f=sn,f!==null)switch(f.tag){case 27:case 5:s=f.memoizedProps}e[$t]=n,e=!!(e.nodeValue===l||s!==null&&s.suppressHydrationWarning===!0||og(e.nodeValue,l)),e||cr(n,!0)}else e=ys(e).createTextNode(s),e[$t]=n,n.stateNode=e}return It(n),null;case 31:if(l=n.memoizedState,e===null||e.memoizedState!==null){if(s=Ul(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[$t]=n}else Gr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;It(n),e=!1}else l=Nc(),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 It(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=Ul(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[$t]=n}else Gr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;It(n),f=!1}else f=Nc(),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),Uo(n,n.updateQueue),It(n),null);case 4:return ut(),e===null&&Pf(n.stateNode.containerInfo),n.flags|=67108864,It(n),null;case 10:return Xi(n.type),It(n),null;case 19:if(Ic(n),s=n.memoizedState,s===null)return It(n),null;if(f=(n.flags&128)!==0,d=s.rendering,d===null)if(f)ls(s,!1);else{if(Zt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(d=Eo(e),d!==null){for(n.flags|=128,ls(s,!1),e=d.updateQueue,n.updateQueue=e,Uo(n,e),n.subtreeFlags=0,e=l,l=n.child;l!==null;)Dm(l,e),l=l.sibling;return es(n,hn.current&1|2),et&&Gi(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&Nt()>Jo&&(n.flags|=128,f=!0,ls(s,!1),n.lanes=4194304)}else{if(!f)if(e=Eo(d),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,Uo(n,e),ls(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!d.alternate&&!et)return It(n),null}else 2*Nt()-s.renderingStartTime>Jo&&l!==536870912&&(n.flags|=128,f=!0,ls(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=Nt(),e.sibling=null,d=hn.current,d=f?d&1|2:d&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!l||et?es(n,d):(l=d,Ve(dn,n),Ve(hn,l),xn===null&&(xn=n)),et&&Gi(n,s.treeForkCount),e}return It(n),null;case 22:case 23:return Ln(n),Uc(),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&&(It(n),n.subtreeFlags&6&&(n.flags|=8192)):It(n),l=n.updateQueue,l!==null&&Uo(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&&Me(Kr),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Xi(Wt),It(n),null;case 25:return null;case 30:return n.flags|=33554432,It(n),null}throw Error(a(156,n.tag))}function zw(e,n){switch(jc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Xi(Wt),ut(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Bt(n),null;case 31:if(n.memoizedState!==null){if(Ln(n),n.alternate===null)throw Error(a(340));Gr()}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));Gr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Ic(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 ut(),null;case 10:return Xi(n.type),null;case 22:case 23:return Ln(n),Uc(),e!==null&&Me(Kr),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Xi(Wt),null;case 25:return null;default:return null}}function cy(e,n){switch(jc(n),n.tag){case 3:Xi(Wt),ut();break;case 26:case 27:case 5:Bt(n);break;case 4:ut();break;case 31:n.memoizedState!==null&&Ln(n);break;case 13:Ln(n);break;case 19:Ic(n);break;case 10:Xi(n.type);break;case 22:case 23:Ln(n),Uc(),e!==null&&Me(Kr);break;case 24:Xi(Wt)}}function as(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){Rt(n,n.return,k)}}function br(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 _=l,I=k;try{I()}catch(X){Rt(f,_,X)}}}s=s.next}while(s!==d)}}catch(X){Rt(n,n.return,X)}}function fy(e){var n=e.updateQueue;if(n!==null){var l=e.stateNode;try{ep(n,l)}catch(s){Rt(e,e.return,s)}}}function dy(e,n,l){l.props=tl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(s){Rt(e,n,s)}}function xi(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=Vi(e.memoizedProps,f);(f.ref===null||f.ref.name!==d)&&(f.ref=bg(d)),s=f.ref;break;case 7:if(e.stateNode===null){var b=new Vn(e);g(e.child,!1,kS,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){Rt(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){Rt(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){Rt(e,n,f)}else l.current=null}function Ho(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++)jg(e.stateNode,n[l])}function hy(e){for(var n=e.return;n!==null&&(bf(n)&&jg(e.stateNode,n.stateNode),!vf(n));)n=n.return}function ss(e){for(var n=e.return;n!==null&&(bf(n)&&ES(e.stateNode,n.stateNode),!vf(n));)n=n.return}function vf(e){return e.tag===5||e.tag===3||e.tag===27}function bf(e){return e&&e.tag===7&&e.stateNode!==null}function xf(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){Rt(e,e.return,f)}}function wf(e,n,l){try{var s=e.stateNode;lS(s,e.type,l,n),s[ln]=n}catch(f){Rt(e,e.return,f)}}function my(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Tr(e.type)||e.tag===4}function Sf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||my(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&&Tr(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 kf(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=bn)),Ho(e,s),ct=!0;else if(f!==4&&(f===27&&(Ho(e,s),s=null,Tr(e.type)&&(l=e.stateNode,n=null)),e=e.child,e!==null))for(kf(e,n,l,s),e=e.sibling;e!==null;)kf(e,n,l,s),e=e.sibling}function Io(e,n,l,s){var f=e.tag;if(f===5||f===6)f=e.stateNode,n?l.insertBefore(f,n):l.appendChild(f),Ho(e,s),ct=!0;else if(f!==4&&(f===27&&(Ho(e,s),s=null,Tr(e.type)&&(l=e.stateNode)),e=e.child,e!==null))for(Io(e,n,l,s),e=e.sibling;e!==null;)Io(e,n,l,s),e=e.sibling}function py(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[$t]=e,n[ln]=l}catch(d){Rt(e,e.return,d)}}var Vo=!1,Bn=null;function yy(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Vo=!0)}var wi=null;function gy(){var e=wi;return wi=null,e}var Nn=0;function Xl(e,n,l,s,f){return Nn=0,vy(e.child,n,l,s,f)}function vy(e,n,l,s,f){for(var d=!1;e!==null;){if(e.tag===5){var b=e.stateNode;if(s!==null){var k=ad(b);s.push(k),k.view&&(d=!0)}else d||ad(b).view&&(d=!0);Vo=!0,gg(b,Nn===0?n:n+"_"+Nn,l),Nn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&f||vy(e.child,n,l,s,f)&&(d=!0));e=e.sibling}return d}function Si(e,n){for(;e!==null;)e.tag===5?vg(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&n||Si(e.child,n)),e=e.sibling}function Yo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Yo(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=Yi(n.default,n.share),n!=="none"&&(Xl(e,l,n,null,!1)||Si(e.child,!1))}e=e.sibling}}function Ef(e,n){if(e.tag===30){var l=e.stateNode,s=e.memoizedProps,f=Vi(s,l),d=Yi(s.default,l.paired?s.share:s.enter);d!=="none"?Xl(e,f,d,null,!1)?(Yo(e),l.paired||n||ta(e,s.onEnter)):Si(e.child,!1):Yo(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Ef(e,n),e=e.sibling;else Yo(e)}function jf(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=Yi(l.default,l.share);if(d!=="none"&&(Xl(e,s,d,null,!1)?(d=e.stateNode,f.paired=d,d.paired=f,ta(e,l.onShare)):Si(e.child,!1)),n.delete(s),n.size===0)break}}}jf(e)}e=e.sibling}}}function Tf(e){if(e.tag===30){var n=e.memoizedProps,l=Vi(n,e.stateNode),s=Bn!==null?Bn.get(l):void 0,f=Yi(n.default,s!==void 0?n.share:n.exit);f!=="none"&&(Xl(e,l,f,null,!1)?s!==void 0?(f=e.stateNode,s.paired=f,f.paired=s,Bn.delete(l),ta(e,n.onShare)):ta(e,n.onExit):Si(e.child,!1)),Bn!==null&&jf(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Tf(e),e=e.sibling;else Bn!==null&&jf(e)}function by(e){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,l=Vi(n,e.stateNode);n=Yi(n.default,n.update),e.flags&=-5,n!=="none"&&Xl(e,l,n,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&by(e);e=e.sibling}}function Nf(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,Si(e.child,!1))}Nf(e)}e=e.sibling}}function Fo(e){if(e.tag===30)e.stateNode.paired=null,Si(e.child,!1),Nf(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Fo(e),e=e.sibling;else Nf(e)}function xy(e){for(e=e.child;e!==null;)e.tag===30?Si(e.child,!1):(e.subtreeFlags&33554432)!==0&&xy(e),e=e.sibling}function Cf(e,n,l,s,f,d,b){for(var k=!1;n!==null;){if(n.tag===5){var _=n.stateNode;if(d!==null&&Nn<d.length){var I=d[Nn],X=ad(_);(I.view||X.view)&&(k=!0);var ie;if(ie=(e.flags&4)===0)if(X.clip)ie=!0;else{ie=I.rect;var U=X.rect;ie=ie.y!==U.y||ie.x!==U.x||ie.height!==U.height||ie.width!==U.width}ie&&(e.flags|=4),X.abs?X=!I.abs:(I=I.rect,X=X.rect,X=I.height!==X.height||I.width!==X.width),X&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&gg(_,Nn===0?l:l+"_"+Nn,f),k&&(e.flags&4)!==0||(wi===null&&(wi=[]),wi.push(_,Nn===0?s:s+"_"+Nn,n.memoizedProps)),Nn++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&b?e.flags|=n.flags&32:Cf(e,n.child,l,s,f,d,b)&&(k=!0));n=n.sibling}return k}function wy(e,n){for(e=e.child;e!==null;){if(e.tag===30){var l=e.memoizedProps,s=e.stateNode,f=Vi(l,s),d=Yi(l.default,l.update),b;b=e.memoizedState,e.memoizedState=null,s=e;var k=e.child;Nn=0,f=Cf(s,k,f,f,d,b,!1),(e.flags&4)!==0&&f&&ta(e,l.onUpdate)}else(e.subtreeFlags&33554432)!==0&&wy(e);e=e.sibling}}var on=!1,Tt=!1,ki=!1,Af=!1,Sy=typeof WeakSet=="function"?WeakSet:Set,un=null,Ei=!1,os=!1,Go=!1,Rf=!1;function Mw(e,n,l){if(e=e.containerInfo,td=fa,e=Tm(e),pc(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,_=-1,I=-1,X=0,ie=0,U=e,$=null;t:for(;;){for(var Se;U!==s||d!==0&&U.nodeType!==3||(_=k+d),U!==b||f!==0&&U.nodeType!==3||(I=k+f),U.nodeType===3&&(k+=U.nodeValue.length),(Se=U.firstChild)!==null;)$=U,U=Se;for(;;){if(U===e)break t;if($===s&&++X===d&&(_=k),$===b&&++ie===f&&(I=k),(Se=U.nextSibling)!==null)break;U=$,$=U.parentNode}U=Se}s=_===-1||I===-1?null:{start:_,end:I}}else s=null}s=s||{start:0,end:0}}else s=null;for(nd={focusedElem:e,selectionRange:s},fa=!1,l=(l&335544064)===l,un=n,n=l?9270:1024;un!==null;){if(e=un,l&&(s=e.deletions,s!==null))for(d=0;d<s.length;d++)l&&Tf(s[d]);if(e.alternate===null&&(e.flags&2)!==0)l&&yy(e),$o(l);else{if(e.tag===22){if(s=e.alternate,e.memoizedState!==null){s!==null&&s.memoizedState===null&&l&&Tf(s),$o(l);continue}else if(s!==null&&s.memoizedState!==null){l&&yy(e),$o(l);continue}}s=e.child,(e.subtreeFlags&n)!==0&&s!==null?(s.return=e,un=s):(l&&by(e),$o(l))}}Bn=null}function $o(e){for(;un!==null;){var n=un,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=tl(n.type,f);l=d.getSnapshotBeforeUpdate(b,s),d.__reactInternalSnapshotBeforeUpdate=l}catch(k){Rt(n,n.return,k)}}break;case 3:if((f&1024)!==0){if(s=n.stateNode.containerInfo,l=s.nodeType,l===9)ud(s);else if(l===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":ud(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=Vi(s.memoizedProps,s.stateNode),f=n.memoizedProps,f=Yi(f.default,f.update),f!=="none"&&Xl(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,un=s;break}un=n.return}}function ky(e,n,l){var s=l.flags;switch(l.tag){case 0:case 11:case 15:ji(e,l),s&4&&as(5,l);break;case 1:if(ji(e,l),s&4)if(e=l.stateNode,n===null)try{e.componentDidMount()}catch(b){Rt(l,l.return,b)}else{var f=tl(l.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Rt(l,l.return,b)}}s&64&&fy(l),s&512&&xi(l,l.return);break;case 3:if(ji(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{ep(e,n)}catch(b){Rt(l,l.return,b)}}break;case 27:n===null&&s&4&&py(l);case 26:case 5:ji(e,l),n===null&&s&4&&xf(l),s&512&&xi(l,l.return);break;case 12:ji(e,l);break;case 31:ji(e,l),s&4&&Ny(e,l);break;case 13:ji(e,l),s&4&&Cy(e,l),s&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=$w.bind(null,l),NS(e,l))));break;case 22:if(s=l.memoizedState!==null||on,!s){var d=n!==null&&n.memoizedState!==null||Tt;n=on,f=Tt,on=s,(Tt=d)&&!f?(s=2,(l.subtreeFlags&8772)!==0&&(s|=1),oi(e,l,s)):ji(e,l),on=n,Tt=f}break;case 30:ji(e,l),s&512&&xi(l,l.return);break;case 7:s&512&&xi(l,l.return);default:ji(e,l)}}function _f(e,n){for(e=e.child;e!==null;)Ey(e,n),e=e.sibling}function Ey(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(_){Rt(e,e.return,_)}Of(e,n);break;case 6:try{e.stateNode.nodeValue=n?"":e.memoizedProps,ct=!0}catch(_){Rt(e,e.return,_)}break;case 18:try{var k=e.stateNode;n?yg(k,!0):yg(e.stateNode,!1)}catch(_){Rt(e,e.return,_)}break;case 22:case 23:e.memoizedState===null&&_f(e,n);break;default:_f(e,n)}}function Of(e,n){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var l=e,s=n;switch(l.tag){case 4:Ey(l,s);break e;case 22:l.memoizedState===null&&Of(l,s);break e;default:Of(l,s)}}e=e.sibling}}function jy(e){var n=e.alternate;n!==null&&(e.alternate=null,jy(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&ii(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 Yt=null,Cn=!1;function ai(e,n,l){for(l=l.child;l!==null;)Ty(e,n,l),l=l.sibling}function Ty(e,n,l){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(vt,l)}catch{}switch(l.tag){case 26:Tt||mn(l,n),ai(e,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&!Tt&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Tt||mn(l,n),ss(l);var s=Yt,f=Cn;Tr(l.type)&&(Yt=l.stateNode,Cn=!1),ai(e,n,l),Rg(l.stateNode,l.type,l.memoizedProps),Yt=s,Cn=f;break;case 5:Tt||mn(l,n),ss(l);case 6:if(l.tag===6&&ss(l),s=Yt,f=Cn,Yt=null,ai(e,n,l),Yt=s,Cn=f,Yt!==null)if(Cn)try{(Yt.nodeType===9?Yt.body:Yt.nodeName==="HTML"?Yt.ownerDocument.body:Yt).removeChild(l.stateNode),ct=!0}catch(d){Rt(l,n,d)}else try{Yt.removeChild(l.stateNode),ct=!0}catch(d){Rt(l,n,d)}break;case 18:Yt!==null&&(Cn?(e=Yt,pg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),da(e)):pg(Yt,l.stateNode));break;case 4:s=Yt,f=Cn,Yt=l.stateNode.containerInfo,Cn=!0,ai(e,n,l),Yt=s,Cn=f;break;case 0:case 11:case 14:case 15:br(2,l,n),Tt||br(4,l,n),ai(e,n,l);break;case 1:Tt||(mn(l,n),s=l.stateNode,typeof s.componentWillUnmount=="function"&&dy(l,n,s)),ai(e,n,l);break;case 21:ai(e,n,l);break;case 22:Tt=(s=Tt)||l.memoizedState!==null,ai(e,n,l),Tt=s;break;case 30:mn(l,n),ai(e,n,l);break;case 7:Tt||mn(l,n),ai(e,n,l);break;default:ai(e,n,l)}}function Ny(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{da(e)}catch(l){Rt(n,n.return,l)}}}function Cy(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{da(e)}catch(l){Rt(n,n.return,l)}}function qw(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Sy),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Sy),n;default:throw Error(a(435,e.tag))}}function Xo(e,n){var l=qw(e);n.forEach(function(s){if(!l.has(s)){l.add(s);var f=Xw.bind(null,e,s);s.then(f,f)}})}function kn(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,_=k;e:for(;_!==null;){switch(_.tag){case 27:if(Tr(_.type)){Yt=_.stateNode,Cn=!1;break e}break;case 5:Yt=_.stateNode,Cn=!1;break e;case 3:case 4:Yt=_.stateNode.containerInfo,Cn=!0;break e}_=_.return}if(Yt===null)throw Error(a(160));Ty(b,k,d),Yt=null,Cn=!1,b=d.alternate,b!==null&&(b.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Ay(n,e,l),n=n.sibling}var si=null;function Ay(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}kn(n,e,l),En(e),f&4&&(br(3,e,e.return),as(3,e),br(5,e,e.return));break;case 1:kn(n,e,l),En(e),f&512&&(Tt||s===null||mn(s,s.return)),f&64&&on&&(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=si,kn(n,e,l),En(e),f&512&&(Tt||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(on)e.stateNode=dg(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[qi]||s[$t]||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[$t]=e,Pt(s),n=s;break e;case"link":if(d=Dg("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=Dg("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[$t]=e,Pt(s),n=s}e.stateNode=n}else on||yd(d,e.type,e.stateNode);else e.stateNode=qg(d,l,e.memoizedProps);else f!==l?(f===null?(n=s.stateNode,n===null||Tt||n.parentNode.removeChild(n)):f.count--,l===null?on||yd(d,e.type,e.stateNode):qg(d,l,e.memoizedProps)):l===null&&e.stateNode!==null&&wf(e,e.memoizedProps,s.memoizedProps);break;case 27:kn(n,e,l),En(e),f&512&&(Tt||s===null||mn(s,s.return)),s!==null&&f&4&&wf(e,e.memoizedProps,s.memoizedProps);break;case 5:if(d=ki,ki=!1,kn(n,e,l),ki=d,En(e),f&512&&(Tt||s===null||mn(s,s.return)),e.flags&32){n=e.stateNode;try{sr(n,""),ct=!0}catch(X){Rt(e,e.return,X)}}f&4&&e.stateNode!=null&&(n=e.memoizedProps,wf(e,n,s!==null?s.memoizedProps:n)),f&1024&&(Af=!0);break;case 6:if(kn(n,e,l),En(e),f&4){if(e.stateNode===null)throw Error(a(162));n=e.memoizedProps,l=e.stateNode;try{l.nodeValue=n,ct=!0}catch(X){Rt(e,e.return,X)}}break;case 3:if(ct=!1,ou=null,d=si,si=gs(n.containerInfo),kn(n,e,l),si=d,En(e),f&4&&s!==null&&s.memoizedState.isDehydrated)try{da(n.containerInfo)}catch(X){Rt(e,e.return,X)}Af&&(Af=!1,Ry(e)),ct=!1;break;case 4:f=ki,ki=on,s=Na(),d=si,si=gs(e.stateNode.containerInfo),kn(n,e,l),En(e),si=d,ct&&os&&(Go=!0),ct=s,ki=f;break;case 12:kn(n,e,l),En(e);break;case 31:kn(n,e,l),En(e),f&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Xo(e,n)));break;case 13:kn(n,e,l),En(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Ko=Nt()),f&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Xo(e,n)));break;case 22:d=e.memoizedState!==null,b=s!==null&&s.memoizedState!==null;var k=on,_=Tt,I=ki;on=k||d,ki=I||d,Tt=_||b,kn(n,e,l),Tt=_,ki=I,on=k,En(e),f&8192&&(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,!d||s===null||b||on||Tt||(n=b||Tt,l=on,s=Tt,on=d||on,Tt=n,xr(e,2),on=l,Tt=s),!d&&ki||_f(e,d)),f&4&&(n=e.updateQueue,n!==null&&(l=n.retryQueue,l!==null&&(n.retryQueue=null,Xo(e,l))));break;case 19:kn(n,e,l),En(e),f&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Xo(e,n)));break;case 30:f&512&&(Tt||s===null||mn(s,s.return)),f=Na(),d=os,b=(l&335544064)===l,k=e.memoizedProps,os=b&&Yi(k.default,k.update)!=="none",kn(n,e,l),En(e),b&&s!==null&&ct&&(e.flags|=4),os=d,ct=f;break;case 21:break;case 7:f&512&&(Tt||s===null||mn(s,s.return)),s&&s.stateNode!==null&&(s.stateNode._fragmentFiber=e);default:kn(n,e,l),En(e)}}function En(e){var n=e.flags;if(n&2){try{for(var l,s=e.return;s!==null;){if(my(s)){l=s;break}s=s.return}s=null;for(var f=e.return;f!==null;){if(bf(f)){var d=f.stateNode;s===null?s=[d]:s.push(d)}if(vf(f))break;f=f.return}var b=s;if(l==null)throw Error(a(160));switch(l.tag){case 27:var k=l.stateNode,_=Sf(e);Io(e,_,k,b);break;case 5:var I=l.stateNode;l.flags&32&&(sr(I,""),l.flags&=-33);var X=Sf(e);Io(e,X,I,b);break;case 3:case 4:var ie=l.stateNode.containerInfo,U=Sf(e);kf(e,U,ie,b);break;default:throw Error(a(161))}}catch($){Rt(e,e.return,$)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Ry(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Ry(n),n.tag===5&&n.flags&1024&&(n=n.stateNode,fa=!0,n.reset(),fa=!1),e=e.sibling}}function Ql(e,n){if(n.subtreeFlags&9270)for(n=n.child;n!==null;)_y(n,e),n=n.sibling;else wy(n)}function _y(e,n){var l=e.alternate;if(l===null)Ef(e,!1);else switch(e.tag){case 3:if(Rf=Ei=!1,gy(),Ql(n,e),!Ei&&!Go){if(e=wi,e!==null)for(var s=0;s<e.length;s+=3){l=e[s];var f=e[s+1];vg(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"})),Rf=!0}wi=null;break;case 5:Ql(n,e);break;case 4:s=Ei,Ei=!1,Ql(n,e),Ei&&(Go=!0),Ei=s;break;case 22:e.memoizedState===null&&(l.memoizedState!==null?Ef(e,!1):Ql(n,e));break;case 30:s=Ei,f=gy(),Ei=!1,Ql(n,e),Ei&&(e.flags|=4);var d=e.memoizedProps,b=e.stateNode;n=Vi(d,b),b=Vi(l.memoizedProps,b);var k=Yi(d.default,d.update);k==="none"?n=!1:(d=l.memoizedState,l.memoizedState=null,l=e.child,Nn=0,n=Cf(e,l,n,b,k,d,!0),Nn!==(d===null?0:d.length)&&(e.flags|=32)),(e.flags&4)!==0&&n?(ta(e,e.memoizedProps.onUpdate),wi=f):f!==null&&(f.push.apply(f,wi),wi=f),Ei=(e.flags&32)!==0?!0:s;break;default:Ql(n,e)}}function ji(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)ky(e,n.alternate,n),n=n.sibling}function xr(e,n){for(e=e.child;e!==null;){var l=e,s=n;switch(l.tag){case 0:case 11:case 14:case 15:br(4,l,l.return),xr(l,s);break;case 1:mn(l,l.return);var f=l.stateNode;typeof f.componentWillUnmount=="function"&&dy(l,l.return,f),xr(l,s);break;case 27:(s&2)!==0&&Rg(l.stateNode,l.type,l.memoizedProps);case 5:mn(l,l.return),l.tag!==5&&l.tag!==27||ss(l),xr(l,s);break;case 6:ss(l);break;case 26:mn(l,l.return),f=l.stateNode,l.memoizedState!==null||f===null||Tt||f.parentNode.removeChild(f),xr(l,s);break;case 22:l.memoizedState===null&&xr(l,s);break;case 30:mn(l,l.return),xr(l,s);break;case 7:mn(l,l.return);default:xr(l,s)}e=e.sibling}}function oi(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:oi(f,d,l),as(4,d);break;case 1:if(oi(f,d,l),s=d,f=s.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(X){Rt(s,s.return,X)}if(s=d,f=s.updateQueue,f!==null){var _=s.stateNode;try{var I=f.shared.hiddenCallbacks;if(I!==null)for(f.shared.hiddenCallbacks=null,f=0;f<I.length;f++)Wm(I[f],_)}catch(X){Rt(s,s.return,X)}}k&&b&64&&fy(d),xi(d,d.return);break;case 27:(l&2)!==0&&py(d);case 5:d.tag!==5&&d.tag!==27||hy(d),oi(f,d,l),k&&s===null&&b&4&&xf(d),xi(d,d.return);break;case 6:hy(d);break;case 26:_=d.stateNode,d.memoizedState!==null||_===null||on||yd(gs(_.ownerDocument),d.type,_),oi(f,d,l),k&&s===null&&b&4&&xf(d),xi(d,d.return);break;case 12:oi(f,d,l);break;case 31:oi(f,d,l),k&&b&4&&Ny(f,d);break;case 13:oi(f,d,l),k&&b&4&&Cy(f,d);break;case 22:d.memoizedState===null&&oi(f,d,l),xi(d,d.return);break;case 30:oi(f,d,l),xi(d,d.return);break;case 7:xi(d,d.return);default:oi(f,d,l)}n=n.sibling}}function zf(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&&Xa(l))}function Mf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Xa(e))}function Pn(e,n,l,s){var f=(l&335544064)===l;if(n.subtreeFlags&(f?10262:10256))for(n=n.child;n!==null;)Oy(e,n,l,s),n=n.sibling;else f&&xy(n)}function Oy(e,n,l,s){var f=(l&335544064)===l;f&&n.alternate===null&&n.return!==null&&n.return.alternate!==null&&Fo(n);var d=n.flags;switch(n.tag){case 0:case 11:case 15:Pn(e,n,l,s),d&2048&&as(9,n);break;case 1:Pn(e,n,l,s);break;case 3:Pn(e,n,l,s),f&&Rf&&(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&&Xa(d)));break;case 12:if(d&2048){Pn(e,n,l,s),d=n.stateNode;try{var b=n.memoizedProps,k=b.id,_=b.onPostCommit;typeof _=="function"&&_(k,n.alternate===null?"mount":"update",d.passiveEffectDuration,-0)}catch(I){Rt(n,n.return,I)}}else Pn(e,n,l,s);break;case 31:Pn(e,n,l,s);break;case 13:Pn(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&&Fo(k),b._visibility&2?Pn(e,n,l,s):us(e,n)):(f&&k!==null&&k.memoizedState!==null&&Fo(n),b._visibility&2?Pn(e,n,l,s):(b._visibility|=2,Zl(e,n,l,s,(n.subtreeFlags&10256)!==0||!1))),d&2048&&zf(k,n);break;case 24:Pn(e,n,l,s),d&2048&&Mf(n.alternate,n);break;case 30:f&&(d=n.alternate,d!==null&&(Si(d.child,!0),Si(n.child,!0))),Pn(e,n,l,s);break;default:Pn(e,n,l,s)}}function Zl(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,_=s,I=b.flags;switch(b.tag){case 0:case 11:case 15:Zl(d,b,k,_,f),as(8,b);break;case 23:break;case 22:var X=b.stateNode;b.memoizedState!==null?X._visibility&2?Zl(d,b,k,_,f):us(d,b):(X._visibility|=2,Zl(d,b,k,_,f)),f&&I&2048&&zf(b.alternate,b);break;case 24:Zl(d,b,k,_,f),f&&I&2048&&Mf(b.alternate,b);break;default:Zl(d,b,k,_,f)}n=n.sibling}}function us(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:us(l,s),f&2048&&zf(s.alternate,s);break;case 24:us(l,s),f&2048&&Mf(s.alternate,s);break;default:us(l,s)}n=n.sibling}}var nl=8192;function il(e,n,l){if(e.subtreeFlags&nl)for(e=e.child;e!==null;)zy(e,n,l),e=e.sibling}function zy(e,n,l){switch(e.tag){case 26:il(e,n,l),e.flags&nl&&(e.memoizedState!==null?IS(l,si,e.memoizedState,e.memoizedProps):(e=e.stateNode,(n&335544128)===n&&Hg(l,e)));break;case 5:il(e,n,l),e.flags&nl&&(e=e.stateNode,(n&335544128)===n&&Hg(l,e));break;case 3:case 4:var s=si;si=gs(e.stateNode.containerInfo),il(e,n,l),si=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=nl,nl=16777216,il(e,n,l),nl=s):il(e,n,l));break;case 30:if((e.flags&nl)!==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)}il(e,n,l);break;default:il(e,n,l)}}function My(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 cs(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];un=s,Dy(s,e)}My(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)qy(e),e=e.sibling}function qy(e){switch(e.tag){case 0:case 11:case 15:cs(e),e.flags&2048&&br(9,e,e.return);break;case 3:cs(e);break;case 12:cs(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Qo(e)):cs(e);break;default:cs(e)}}function Qo(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];un=s,Dy(s,e)}My(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:br(8,n,n.return),Qo(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,Qo(n));break;default:Qo(n)}e=e.sibling}}function Dy(e,n){for(;un!==null;){var l=un;switch(l.tag){case 0:case 11:case 15:br(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:Xa(l.memoizedState.cache)}if(s=l.child,s!==null)s.return=l,un=s;else e:for(l=e;un!==null;){s=un;var f=s.sibling,d=s.return;if(jy(s),s===l){un=null;break e}if(f!==null){f.return=d,un=f;break e}un=d}}}var Dw={getCacheForType:function(e){var n=fn(Wt),l=n.data.get(e);return l===void 0&&(l=e(),n.data.set(e,l)),l},cacheSignal:function(){return fn(Wt).controller.signal}},Lw=typeof WeakMap=="function"?WeakMap:Map,kt=0,qt=null,it=null,st=0,At=0,Un=null,wr=!1,Kl=!1,qf=!1,Pi=0,Zt=0,Sr=0,rl=0,Zo=0,Hn=0,Jl=0,fs=null,An=null,Df=!1,Ko=0,Ly=0,Jo=1/0,Po=null,kr=null,Gt=0,ui=null,ll=null,Ti=0,Lf=0,Bf=null,By=null,Pl=null,Wl=null,ea=null,ds=0,Wo=null;function In(){return(kt&2)!==0&&st!==0?st&-st:P.T!==null?Qf():wl()}function Uy(){if(Hn===0)if((st&536870912)===0||et){var e=ni;ni<<=1,(ni&3932160)===0&&(ni=262144),Hn=e}else Hn=536870912;return e=dn.current,e!==null&&(e.flags|=32),Hn}function ta(e,n){if(n!=null){var l=e.stateNode,s=l.ref;s===null&&(s=l.ref=bg(Vi(e.memoizedProps,l))),Wl===null&&(Wl=[]),Wl.push(n.bind(null,s))}}function Rn(e,n,l){(e===qt&&(At===2||At===9)||e.cancelPendingCommit!==null)&&(na(e,0),Er(e,st,Hn,!1)),Dr(e,l),((kt&2)===0||e!==qt)&&(e===qt&&((kt&2)===0&&(rl|=l),Zt===4&&Er(e,st,Hn,!1)),Ni(e))}function Hy(e,n,l){if((kt&6)!==0)throw Error(a(327));var s=!l&&(n&127)===0&&(n&e.expiredLanes)===0||ir(e,n),f=s?Hw(e,n):Hf(e,n,!0),d=s;do{if(f===0){Kl&&!s&&Er(e,n,0,!1);break}else{if(l=e.current.alternate,d&&!Bw(l)){f=Hf(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=fs;var _=k.current.memoizedState.isDehydrated;if(_&&(na(k,b).flags|=256),b=Hf(k,b,!1),b!==2&&b!==6){if(qf&&!_){k.errorRecoveryDisabledLanes|=d,rl|=d,f=4;break e}d=An,An=f,d!==null&&(An===null?An=d:An.push.apply(An,d))}f=b}if(d=!1,f!==2)continue}}if(f===1){na(e,0),Er(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:Er(s,n,Hn,!wr);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(f=Ko+300-Nt(),10<f)){if(Er(s,n,Hn,!wr),vl(s,0,!0)!==0)break e;Ti=n,s.timeoutHandle=ld(Iy.bind(null,s,l,An,Po,Df,n,Hn,rl,Jl,wr,d,"Throttled",-0,0),f);break e}Iy(s,l,An,Po,Df,n,Hn,rl,Jl,wr,d,null,-0,0)}}break}while(!0);Ni(e)}function Iy(e,n,l,s,f,d,b,k,_,I,X,ie,U,$){e.timeoutHandle=-1;var Se=n.subtreeFlags,Re=(d&335544064)===d;if(ie=null,(Re||Se&8192||(Se&16785408)===16785408)&&(ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bn},Bn=null,zy(n,d,ie),Re&&(Se=ie,Re=e.containerInfo,Re=(Re.nodeType===9?Re:Re.ownerDocument).__reactViewTransition,Re!=null&&(Se.count++,Se.waitingForViewTransition=!0,Se=xs.bind(Se),Re.finished.then(Se,Se))),Se=(d&62914560)===d?Ko-Nt():(d&4194048)===d?Ly-Nt():0,Se=VS(ie,Se),Se!==null)){Ti=d,e.cancelPendingCommit=Se(Zy.bind(null,e,n,d,l,s,f,b,k,_,I,X,ie,null,U,$)),Er(e,d,b,!I);return}Zy(e,n,d,l,s,f,b,k,_,I,X,ie)}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 Er(e,n,l,s){n=Qs(e,n),n&=~Zo,n&=~rl,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var f=n;0<f;){var d=31-jt(f),b=1<<d;s[d]=-1,f&=~b}l!==0&&ka(e,l,n)}function eu(){return(kt&6)===0?(hs(0),!1):!0}function Uf(){if(it!==null){if(At===0)var e=it.return;else e=it,$i=$r=null,$c(e),Vl=null,Ka=0,e=it;for(;e!==null;)cy(e.alternate,e),e=e.return;it=null}}function na(e,n){var l=e.timeoutHandle;return l!==-1&&(e.timeoutHandle=-1,oS(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Ti=0,Uf(),qt=e,it=l=Fi(e.current,null),st=n,At=0,Un=null,wr=!1,Kl=ir(e,n),qf=!1,Jl=Hn=Zo=rl=Sr=Zt=0,An=fs=null,Df=!1,Pi=Qs(e,n),so(),l}function Vy(e,n){Xe=null,P.H=zo,n===Il||n===bo?(n=Zm(),At=3):n===zc?(n=Zm(),At=4):At=n===of?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Un=n,it===null&&(Zt=1,Mo(e,Qn(n,e.current)))}function Yy(){var e=dn.current;return e===null?!0:(st&4194048)===st?xn===null:(st&62914560)===st||(st&536870912)!==0?e===xn:!1}function Fy(){var e=P.H;return P.H=zo,e===null?zo:e}function Gy(){var e=P.A;return P.A=Dw,e}function tu(){Zt=4,wr||(st&4194048)!==st&&dn.current!==null||(Kl=!0),(Sr&134217727)===0&&(rl&134217727)===0||qt===null||Er(qt,st,Hn,!1)}function Hf(e,n,l){var s=kt;kt|=2;var f=Fy(),d=Gy();(qt!==e||st!==n)&&(Po=null,na(e,n)),n=!1;var b=Zt;e:do try{if(At!==0&&it!==null){var k=it,_=Un;switch(At){case 8:Uf(),b=6;break e;case 3:case 2:case 9:case 6:dn.current===null&&(n=!0);var I=At;if(At=0,Un=null,ia(e,k,_,I),l&&Kl){b=0;break e}break;default:I=At,At=0,Un=null,ia(e,k,_,I)}}Uw(),b=Zt;break}catch(X){Vy(e,X)}while(!0);return n&&e.shellSuspendCounter++,$i=$r=null,kt=s,P.H=f,P.A=d,it===null&&(qt=null,st=0,so()),b}function Uw(){for(;it!==null;)$y(it)}function Hw(e,n){var l=kt;kt|=2;var s=Fy(),f=Gy();qt!==e||st!==n?(Po=null,Jo=Nt()+500,na(e,n)):Kl=ir(e,n);e:do try{if(At!==0&&it!==null){n=it;var d=Un;t:switch(At){case 1:At=0,Un=null,ia(e,n,d,1);break;case 2:case 9:if(Xm(d)){At=0,Un=null,Xy(n);break}n=function(){At!==2&&At!==9||qt!==e||(At=7),Ni(e)},d.then(n,n);break e;case 3:At=7;break e;case 4:At=5;break e;case 7:Xm(d)?(At=0,Un=null,Xy(n)):(At=0,Un=null,ia(e,n,d,7));break;case 5:var b=null;switch(it.tag){case 26:b=it.memoizedState;case 5:case 27:var k=it;if(b?Bg(b):k.stateNode.complete){At=0,Un=null;var _=k.sibling;if(_!==null)it=_;else{var I=k.return;I!==null?(it=I,nu(I)):it=null}break t}}At=0,Un=null,ia(e,n,d,5);break;case 6:At=0,Un=null,ia(e,n,d,6);break;case 8:Uf(),Zt=6;break e;default:throw Error(a(462))}}Iw();break}catch(X){Vy(e,X)}while(!0);return $i=$r=null,P.H=s,P.A=f,kt=l,it!==null?0:(qt=null,st=0,so(),Zt)}function Iw(){for(;it!==null&&!gt();)$y(it)}function $y(e){var n=oy(e.alternate,e,Pi);e.memoizedProps=e.pendingProps,n===null?nu(e):it=n}function Xy(e){var n=e,l=n.alternate;switch(n.tag){case 15:case 0:n=ty(l,n,n.pendingProps,n.type,void 0,st);break;case 11:n=ty(l,n,n.pendingProps,n.type.render,n.ref,st);break;case 5:$c(n);var s=n;s===sn&&(et?(mo(s),s.tag===5&&s.stateNode!=null&&(Ht=s.stateNode)):(mo(s),et=!0));default:cy(l,n),n=it=Dm(n,Pi),n=oy(l,n,Pi)}e.memoizedProps=e.pendingProps,n===null?nu(e):it=n}function ia(e,n,l,s){$i=$r=null,$c(n),Vl=null,Ka=0;var f=n.return;try{if(Cw(e,f,n,l,st)){Zt=1,Mo(e,Qn(l,e.current)),it=null;return}}catch(d){if(f!==null)throw it=f,d;Zt=1,Mo(e,Qn(l,e.current)),it=null;return}n.flags&32768?(et||s===1?e=!0:Kl||(st&536870912)!==0?e=!1:(wr=e=!0,(s===2||s===9||s===3||s===6)&&(s=dn.current,s!==null&&s.tag===13&&(s.flags|=16384))),Qy(n,e)):nu(n)}function nu(e){var n=e;do{if((n.flags&32768)!==0){Qy(n,wr);return}e=n.return;var l=Ow(n.alternate,n,Pi);if(l!==null){it=l;return}if(n=n.sibling,n!==null){it=n;return}it=n=e}while(n!==null);Zt===0&&(Zt=5)}function Qy(e,n){do{var l=zw(e.alternate,e);if(l!==null){l.flags&=32767,it=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(e=e.sibling,e!==null)){it=e;return}it=e=l}while(e!==null);Zt=6,it=null}function Zy(e,n,l,s,f,d,b,k,_,I,X,ie){e.cancelPendingCommit=null;do iu();while(Gt!==0);if((kt&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));e===qt&&(it=qt=null,st=0),ll=n,ui=e,Ti=l,Bf=f,By=s,Vw(e,n,l,b,k,_,ie)}}function Vw(e,n,l,s,f,d,b){var k=n.lanes|n.childLanes;if(Lf=k,k|=xc,bl(e,l,k,s,f,d),Wl=null,(l&335544064)===l?(ea=yw(e),s=10262):(ea=null,s=10256),(n.subtreeFlags&s)!==0||(n.flags&s)!==0?(e.callbackNode=null,e.callbackPriority=0,Qw(hi,function(){return Ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Vo=!1,s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=P.T,P.T=null,f=he.p,he.p=2,d=kt,kt|=4;try{Mw(e,n,l)}finally{kt=d,he.p=f,P.T=s}}Gt=1,Vo?Pl=mS(b,e.containerInfo,ea,If,Vf,Fw,Yf,Ff,Yw):(If(),Vf(),Yf())}function Yw(e){if(Gt!==0){var n=ui.onRecoverableError;n(e,{componentStack:null})}}function Fw(){Gt===3&&(Gt=0,_y(ll,ui),Gt=4)}function If(){if(Gt===1){Gt=0;var e=ui,n=ll,l=Ti,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=P.T,P.T=null;var f=he.p;he.p=2;var d=kt;kt|=4;try{os=Go=!1,Ay(n,e,l),l=nd;var b=Tm(e.containerInfo),k=l.focusedElem,_=l.selectionRange;if(b!==k&&k&&k.ownerDocument&&jm(k.ownerDocument.documentElement,k)){if(_!==null&&pc(k)){var I=_.start,X=_.end;if(X===void 0&&(X=I),"selectionStart"in k)k.selectionStart=I,k.selectionEnd=Math.min(X,k.value.length);else{var ie=k.ownerDocument||document,U=ie&&ie.defaultView||window;if(U.getSelection){var $=U.getSelection(),Se=k.textContent.length,Re=Math.min(_.start,Se),Qe=_.end===void 0?Re:Math.min(_.end,Se);!$.extend&&Re>Qe&&(b=Qe,Qe=Re,Re=b);var H=Em(k,Re),L=Em(k,Qe);if(H&&L&&($.rangeCount!==1||$.anchorNode!==H.node||$.anchorOffset!==H.offset||$.focusNode!==L.node||$.focusOffset!==L.offset)){var F=ie.createRange();F.setStart(H.node,H.offset),$.removeAllRanges(),Re>Qe?($.addRange(F),$.extend(L.node,L.offset)):(F.setEnd(L.node,L.offset),$.addRange(F))}}}}for(ie=[],$=k;$=$.parentNode;)$.nodeType===1&&ie.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<ie.length;k++){var ne=ie[k];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}fa=!!td,nd=td=null}finally{kt=d,he.p=f,P.T=s}}e.current=n,Gt=2}}function Vf(){if(Gt===2){Gt=0;var e=ui,n=ll,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=P.T,P.T=null;var s=he.p;he.p=2;var f=kt;kt|=4;try{ky(e,n.alternate,n)}finally{kt=f,he.p=s,P.T=l}}Gt=3}}function Yf(){if(Gt===4||Gt===3){Gt=0;var e=Pl;Pl=null,wn();var n=ui,l=ll,s=Ti,f=By,d=(s&335544064)===s?10262:10256;if((l.subtreeFlags&d)!==0||(l.flags&d)!==0?Gt=5:(Gt=0,ll=ui=null,Ky(n,n.pendingLanes)),d=n.pendingLanes,d===0&&(kr=null),xl(s),l=l.stateNode,at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(vt,l,void 0,(l.current.flags&128)===128)}catch{}if(f!==null){l=P.T,d=he.p,he.p=2,P.T=null;try{for(var b=n.onRecoverableError,k=0;k<f.length;k++){var _=f[k];b(_.value,{componentStack:_.stack})}}finally{P.T=l,he.p=d}}if(f=Wl,b=ea,ea=null,f!==null&&(Wl=null,b===null&&(b=[]),e!==null))for(_=0;_<f.length;_++)l=(0,f[_])(b),l!==void 0&&e.finished.finally(l);(Ti&3)!==0&&iu(),Ni(n),d=n.pendingLanes,(s&261930)!==0&&(d&42)!==0?n===Wo?ds++:(ds=0,Wo=n):(ds=0,Wo=null),hs(0)}}function Ky(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Xa(n)))}function iu(){return Pl!==null&&(Pl.skipTransition(),Pl=null),If(),Vf(),Yf(),Ff()}function Ff(){if(Gt!==5)return!1;var e=ui,n=Lf;Lf=0;var l=xl(Ti),s=P.T,f=he.p;try{he.p=32>l?32:l,P.T=null,l=Bf,Bf=null;var d=ui,b=Ti;if(Gt=0,ll=ui=null,Ti=0,(kt&6)!==0)throw Error(a(331));var k=kt;if(kt|=4,qy(d.current),Oy(d,d.current,b,l),kt=k,hs(0,!1),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(vt,d)}catch{}return!0}finally{he.p=f,P.T=s,Ky(e,n)}}function Jy(e,n,l){n=Qn(l,n),n=sf(e.stateNode,n,2),e=pr(e,n,2),e!==null&&(Dr(e,2),Ni(e))}function Rt(e,n,l){if(e.tag===3)Jy(e,e,l);else for(;n!==null;){if(n.tag===3){Jy(n,e,l);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(kr===null||!kr.has(s))){e=Qn(l,e),l=Xp(2),s=pr(n,l,2),s!==null&&(Qp(l,s,n,e),Dr(s,2),Ni(s));break}}n=n.return}}function Gf(e,n,l){var s=e.pingCache;if(s===null){s=e.pingCache=new Lw;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)||(qf=!0,f.add(l),e=Gw.bind(null,e,n,l),n.then(e,e))}function Gw(e,n,l){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,qt===e&&(st&l)===l&&((Zt===4||Zt===3&&(st&62914560)===st&&300>Nt()-Ko)&&(kt&2)===0?na(e,0):Zo|=l,Jl===st&&(Jl=0)),Ni(e)}function Py(e,n){n===0&&(n=Zs()),e=Yr(e,n),e!==null&&(Dr(e,n),Ni(e))}function $w(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),Py(e,l)}function Xw(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),Py(e,l)}function Qw(e,n){return lt(e,n)}var ra=null,la=null,$f=!1,ru=!1,Xf=!1,jr=0;function Ni(e){e!==la&&e.next===null&&(la===null?ra=la=e:la=la.next=e),ru=!0,$f||($f=!0,Kw())}function hs(e,n){if(!Xf&&ru){Xf=!0;do for(var l=!1,s=ra;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-jt(42|e)+1)-1,d&=f&~(b&~k),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(l=!0,ng(s,d))}else d=st,d=vl(s,s===qt?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||ir(s,d)||(l=!0,ng(s,d));s=s.next}while(l);Xf=!1}}function Zw(){Wy()}function Wy(){ru=$f=!1;var e=0;jr!==0&&sS()&&(e=jr);for(var n=Nt(),l=null,s=ra;s!==null;){var f=s.next,d=eg(s,n);d===0?(s.next=null,l===null?ra=f:l.next=f,f===null&&(la=l)):(l=s,(e!==0||(d&3)!==0)&&(ru=!0)),s=f}Gt!==0&&Gt!==5||hs(e),jr!==0&&(jr=0)}function eg(e,n){for(var l=e.suspendedLanes,s=e.pingedLanes,f=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var b=31-jt(d),k=1<<b,_=f[b];_===-1?((k&l)===0||(k&s)!==0)&&(f[b]=lc(k,n)):_<=n&&(e.expiredLanes|=k),d&=~k}if(n=qt,l=st,l=vl(e,e===n?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,l===0||e===n&&(At===2||At===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&bt(s),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||ir(e,l)){if(n=l&-l,n===e.callbackPriority)return n;switch(s!==null&&bt(s),xl(l)){case 2:case 8:l=Ft;break;case 32:l=hi;break;case 268435456:l=J;break;default:l=hi}return s=tg.bind(null,e),l=lt(l,s),e.callbackPriority=n,e.callbackNode=l,n}return s!==null&&s!==null&&bt(s),e.callbackPriority=2,e.callbackNode=null,2}function tg(e,n){if(Gt!==0&&Gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(iu()&&e.callbackNode!==l)return null;var s=st;return s=vl(e,e===qt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Hy(e,s,n),eg(e,Nt()),e.callbackNode!=null&&e.callbackNode===l?tg.bind(null,e):null)}function ng(e,n){if(iu())return null;Hy(e,n,!0)}function Kw(){uS(function(){(kt&6)!==0?lt(ht,Zw):Wy()})}function Qf(){if(jr===0){var e=Zr;e===0&&(e=Oi,Oi<<=1,(Oi&261888)===0&&(Oi=256)),jr=e}return jr}function ig(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_l(e)}function Jw(e,n,l,s,f){if(n==="submit"&&l&&l.stateNode===f){var d=ig((f[ln]||null).action),b=s.submitter;b&&(n=(n=b[ln]||null)?ig(n.formAction):b.getAttribute("formAction"),n!==null&&(d=n,b=null));var k=new io("action","action",null,s,f);e.push({event:k,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(jr!==0){var _=new FormData(f,b);tf(l,{pending:!0,data:_,method:f.method,action:d},null,_)}}else typeof d=="function"&&(k.preventDefault(),_=new FormData(f,b),tf(l,{pending:!0,data:_,method:f.method,action:d},d,_))},currentTarget:f}]})}}for(var Zf=0;Zf<bc.length;Zf++){var Kf=bc[Zf],Pw=Kf.toLowerCase(),Ww=Kf[0].toUpperCase()+Kf.slice(1);li(Pw,"on"+Ww)}li(Am,"onAnimationEnd"),li(Rm,"onAnimationIteration"),li(_m,"onAnimationStart"),li("dblclick","onDoubleClick"),li("focusin","onFocus"),li("focusout","onBlur"),li(ow,"onTransitionRun"),li(uw,"onTransitionStart"),li(cw,"onTransitionCancel"),li(Om,"onTransitionEnd"),Bi("onMouseEnter",["mouseout","mouseover"]),Bi("onMouseLeave",["mouseout","mouseover"]),Bi("onPointerEnter",["pointerout","pointerover"]),Bi("onPointerLeave",["pointerout","pointerover"]),yi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),yi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),yi("onBeforeInput",["compositionend","keypress","textInput","paste"]),yi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),yi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),yi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ms="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),eS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ms));function rg(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],_=k.instance,I=k.currentTarget;if(k=k.listener,_!==d&&f.isPropagationStopped())break e;d=k,f.currentTarget=I;try{d(f)}catch(X){ao(X)}f.currentTarget=null,d=_}else for(b=0;b<s.length;b++){if(k=s[b],_=k.instance,I=k.currentTarget,k=k.listener,_!==d&&f.isPropagationStopped())break e;d=k,f.currentTarget=I;try{d(f)}catch(X){ao(X)}f.currentTarget=null,d=_}}}}function rt(e,n){var l=n[ja];l===void 0&&(l=n[ja]=new Set);var s=e+"__bubble";l.has(s)||(lg(n,e,2,!1),l.add(s))}function Jf(e,n,l){var s=0;n&&(s|=4),lg(l,e,s,n)}var lu="_reactListening"+Math.random().toString(36).slice(2);function Pf(e){if(!e[lu]){e[lu]=!0,Br.forEach(function(l){l!=="selectionchange"&&(eS.has(l)||Jf(l,!1,e),Jf(l,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[lu]||(n[lu]=!0,Jf("selectionchange",!1,n))}}function lg(e,n,l,s){switch(Qg(n)){case 2:var f=$S;break;case 8:f=XS;break;default:f=vd}l=f.bind(null,n,l,e),f=void 0,!Oe||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 Wf(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 _=b.tag;if((_===3||_===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;k!==null;){if(b=Di(k),b===null)return;if(_=b.tag,_===5||_===6||_===26||_===27){s=d=b;continue e}k=k.parentNode}}s=s.return}G(function(){var I=d,X=Da(l),ie=[];e:{var U=zm.get(e);if(U!==void 0){var $=io,Se=e;switch(e){case"keypress":if(wt(l)===0)break e;case"keydown":case"keyup":$=B1;break;case"focusin":Se="focus",$=uc;break;case"focusout":Se="blur",$=uc;break;case"beforeblur":case"afterblur":$=uc;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":$=om;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=T1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=Y1;break;case Am:case Rm:case _m:$=A1;break;case Om:$=G1;break;case"scroll":case"scrollend":$=E1;break;case"wheel":$=X1;break;case"copy":case"cut":case"paste":$=_1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=cm;break;case"submit":$=I1;break;case"toggle":case"beforetoggle":$=Z1}var Re=(n&4)!==0,Qe=!Re&&(e==="scroll"||e==="scrollend"),H=Re?U!==null?U+"Capture":null:U;Re=[];for(var L=I,F;L!==null;){var ne=L;if(F=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||F===null||H===null||(ne=W(L,H),ne!=null&&Re.push(ps(L,ne,F))),Qe)break;L=L.return}0<Re.length&&(U=new $(U,Se,null,l,X),ie.push({event:U,listeners:Re}))}}if((n&7)===0){e:{if($=e==="mouseover"||e==="pointerover",U=e==="mouseout"||e==="pointerout",$&&l!==qa&&(Se=l.relatedTarget||l.fromElement)&&(Di(Se)||Se[mi]))break e;(U||$)&&(Se=X.window===X?X:($=X.ownerDocument)?$.defaultView||$.parentWindow:window,U?($=l.relatedTarget||l.toElement,U=I,$=$?Di($):null,$!==null&&(Qe=u($),Re=$.tag,$!==Qe||Re!==5&&Re!==27&&Re!==6)&&($=null)):(U=null,$=I),U!==$&&(Re=om,ne="onMouseLeave",H="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Re=cm,ne="onPointerLeave",H="onPointerEnter",L="pointer"),Qe=U==null?Se:pi(U),F=$==null?Se:pi($),Se=new Re(ne,L+"leave",U,l,X),Se.target=Qe,Se.relatedTarget=F,ne=null,Di(X)===I&&(Re=new Re(H,L+"enter",$,l,X),Re.target=F,Re.relatedTarget=Qe,ne=Re),Qe=ne,Re=U&&$?A(U,$,tS):null,U!==null&&ag(ie,Se,U,Re,!1),$!==null&&Qe!==null&&ag(ie,Qe,$,Re,!0)))}e:{if(U=I?pi(I):window,$=U.nodeName&&U.nodeName.toLowerCase(),$==="select"||$==="input"&&U.type==="file")var Ce=vm;else if(ym(U))if(bm)Ce=lw;else{Ce=iw;var ot=nw}else $=U.nodeName,!$||$.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?I&&Rl(I.elementType)&&(Ce=vm):Ce=rw;if(Ce&&(Ce=Ce(e,I))){gm(ie,Ce,l,X);break e}ot&&ot(e,U,I)}switch(ot=I?pi(I):window,e){case"focusin":(ym(ot)||ot.contentEditable==="true")&&(zl=ot,yc=I,Fa=null);break;case"focusout":Fa=yc=zl=null;break;case"mousedown":gc=!0;break;case"contextmenu":case"mouseup":case"dragend":gc=!1,Nm(ie,l,X);break;case"selectionchange":if(sw)break;case"keydown":case"keyup":Nm(ie,l,X)}var qe;if(fc)e:{switch(e){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else Ol?mm(e,l)&&(Ye="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ye="onCompositionStart");Ye&&(fm&&l.locale!=="ko"&&(Ol||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&Ol&&(qe=pt()):($e=X,Ot="value"in $e?$e.value:$e.textContent,Ol=!0)),ot=au(I,Ye),0<ot.length&&(Ye=new um(Ye,e,null,l,X),ie.push({event:Ye,listeners:ot}),qe?Ye.data=qe:(qe=pm(l),qe!==null&&(Ye.data=qe)))),(qe=J1?P1(e,l):W1(e,l))&&(Ye=au(I,"onBeforeInput"),0<Ye.length&&(ot=new um("onBeforeInput","beforeinput",null,l,X),ie.push({event:ot,listeners:Ye}),ot.data=qe)),Jw(ie,e,I,l,X)}rg(ie,n)})}function ps(e,n,l){return{instance:e,listener:n,currentTarget:l}}function au(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=W(e,l),f!=null&&s.unshift(ps(e,f,d)),f=W(e,n),f!=null&&s.push(ps(e,f,d))),e.tag===3)return s;e=e.return}return[]}function tS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ag(e,n,l,s,f){for(var d=n._reactName,b=[];l!==null&&l!==s;){var k=l,_=k.alternate,I=k.stateNode;if(k=k.tag,_!==null&&_===s)break;k!==5&&k!==26&&k!==27||I===null||(_=I,f?(I=W(l,d),I!=null&&b.unshift(ps(l,I,_))):f||(I=W(l,d),I!=null&&b.push(ps(l,I,_)))),l=l.return}b.length!==0&&e.push({event:n,listeners:b})}var nS=/\r\n?/g,iS=/\u0000|\uFFFD/g;function sg(e){return(typeof e=="string"?e:""+e).replace(nS,`
|
|
10
|
+
`).replace(iS,"")}function og(e,n){return n=sg(n),sg(e)===n}function _t(e,n,l,s,f,d){switch(l){case"children":if(typeof s=="string")n==="body"||n==="textarea"&&s===""||sr(e,s);else if(typeof s=="number"||typeof s=="bigint")n!=="body"&&sr(e,""+s);else return;break;case"className":Hr(e,"class",s);break;case"tabIndex":Hr(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Hr(e,l,s);break;case"style":to(e,s,d);return;case"data":if(n!=="object"){Hr(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=_l(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"&&_t(e,n,"name",f.name,f,null),_t(e,n,"formEncType",f.formEncType,f,null),_t(e,n,"formMethod",f.formMethod,f,null),_t(e,n,"formTarget",f.formTarget,f,null)):(_t(e,n,"encType",f.encType,f,null),_t(e,n,"method",f.method,f,null),_t(e,n,"target",f.target,f,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(l);break}s=_l(s),e.setAttribute(l,s);break;case"onClick":s!=null&&(e.onclick=bn);return;case"onScroll":s!=null&&rt("scroll",e);return;case"onScrollEnd":s!=null&&rt("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=_l(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":rt("beforetoggle",e),rt("toggle",e),Ca(e,"popover",s);break;case"xlinkActuate":ri(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ri(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ri(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ri(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ri(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ri(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ri(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ri(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ri(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ca(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=no.get(l)||l,Ca(e,l,s);else return}ct=!0}function ed(e,n,l,s,f,d){switch(l){case"style":to(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")sr(e,s);else if(typeof s=="number"||typeof s=="bigint")sr(e,""+s);else return;break;case"onScroll":s!=null&&rt("scroll",e);return;case"onScrollEnd":s!=null&&rt("scrollend",e);return;case"onClick":s!=null&&(e.onclick=bn);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Ps.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[ln]||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}ct=!0,l in e?e[l]=s:s===!0?e.setAttribute(l,""):Ca(e,l,s)}return}ct=!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":rt("error",e),rt("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:_t(e,n,d,b,l,null)}}f&&_t(e,n,"srcSet",l.srcSet,l,null),s&&_t(e,n,"src",l.src,l,null);return;case"input":rt("invalid",e);var k=d=b=f=null,_=null,I=null;for(s in l)if(l.hasOwnProperty(s)){var X=l[s];if(X!=null)switch(s){case"name":f=X;break;case"type":b=X;break;case"checked":_=X;break;case"defaultChecked":I=X;break;case"value":d=X;break;case"defaultValue":k=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(a(137,n));break;default:_t(e,n,s,X,l,null)}}_a(e,d,k,_,I,b,f,!1);return;case"select":rt("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:_t(e,n,f,k,l,null)}n=d,l=b,e.multiple=!!s,n!=null?Ui(e,!!s,n,!1):l!=null&&Ui(e,!!s,l,!0);return;case"textarea":rt("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:_t(e,n,b,k,l,null)}za(e,s,f,d);return;case"option":for(_ in l)l.hasOwnProperty(_)&&(s=l[_],s!=null)&&(_==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":_t(e,n,_,s,l,null));return;case"dialog":rt("beforetoggle",e),rt("toggle",e),rt("cancel",e),rt("close",e);break;case"iframe":case"object":rt("load",e);break;case"video":case"audio":for(s=0;s<ms.length;s++)rt(ms[s],e);break;case"image":rt("error",e),rt("load",e);break;case"details":rt("toggle",e);break;case"embed":case"source":case"link":rt("error",e),rt("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(I in l)if(l.hasOwnProperty(I)&&(s=l[I],s!=null))switch(I){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:_t(e,n,I,s,l,null)}return;default:if(Rl(n)){for(X in l)l.hasOwnProperty(X)&&(s=l[X],s!==void 0&&ed(e,n,X,s,l,void 0));return}}for(k in l)l.hasOwnProperty(k)&&(s=l[k],s!=null&&_t(e,n,k,s,l,null))}var rS={};function lS(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,_=null,I=null,X=null;for($ in l){var ie=l[$];if(l.hasOwnProperty($)&&ie!=null)switch($){case"checked":break;case"value":break;case"defaultValue":_=ie;default:s.hasOwnProperty($)||_t(e,n,$,null,s,ie)}}for(var U in s){var $=s[U];if(ie=l[U],s.hasOwnProperty(U)&&($!=null||ie!=null))switch(U){case"type":$!==ie&&(ct=!0),d=$;break;case"name":$!==ie&&(ct=!0),f=$;break;case"checked":$!==ie&&(ct=!0),I=$;break;case"defaultChecked":$!==ie&&(ct=!0),X=$;break;case"value":$!==ie&&(ct=!0),b=$;break;case"defaultValue":$!==ie&&(ct=!0),k=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(a(137,n));break;default:$!==ie&&_t(e,n,U,$,s,ie)}}Ra(e,b,k,_,I,X,d,f);return;case"select":$=b=k=U=null;for(d in l)if(_=l[d],l.hasOwnProperty(d)&&_!=null)switch(d){case"value":break;case"multiple":$=_;default:s.hasOwnProperty(d)||_t(e,n,d,null,s,_)}for(f in s)if(d=s[f],_=l[f],s.hasOwnProperty(f)&&(d!=null||_!=null))switch(f){case"value":d!==_&&(ct=!0),U=d;break;case"defaultValue":d!==_&&(ct=!0),k=d;break;case"multiple":d!==_&&(ct=!0),b=d;default:d!==_&&_t(e,n,f,d,s,_)}n=k,l=b,s=$,U!=null?Ui(e,!!l,U,!1):!!s!=!!l&&(n!=null?Ui(e,!!l,n,!0):Ui(e,!!l,l?[]:"",!1));return;case"textarea":$=U=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:_t(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&&(ct=!0),U=f;break;case"defaultValue":f!==d&&(ct=!0),$=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==d&&_t(e,n,b,f,s,d)}Oa(e,U,$);return;case"option":for(var Se in l)U=l[Se],l.hasOwnProperty(Se)&&U!=null&&!s.hasOwnProperty(Se)&&(Se==="selected"?e.selected=!1:_t(e,n,Se,null,s,U));for(_ in s)U=s[_],$=l[_],s.hasOwnProperty(_)&&U!==$&&(U!=null||$!=null)&&(_==="selected"?(U!==$&&(ct=!0),e.selected=U&&typeof U!="function"&&typeof U!="symbol"):_t(e,n,_,U,s,$));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 Re in l)U=l[Re],l.hasOwnProperty(Re)&&U!=null&&!s.hasOwnProperty(Re)&&_t(e,n,Re,null,s,U);for(I in s)if(U=s[I],$=l[I],s.hasOwnProperty(I)&&U!==$&&(U!=null||$!=null))switch(I){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(a(137,n));break;default:_t(e,n,I,U,s,$)}return;default:if(Rl(n)){for(var Qe in l)U=l[Qe],l.hasOwnProperty(Qe)&&U!==void 0&&!s.hasOwnProperty(Qe)&&ed(e,n,Qe,void 0,s,U);for(X in s)U=s[X],$=l[X],!s.hasOwnProperty(X)||U===$||U===void 0&&$===void 0||ed(e,n,X,U,s,$);return}}for(var H in l)U=l[H],l.hasOwnProperty(H)&&U!=null&&!s.hasOwnProperty(H)&&_t(e,n,H,null,s,U);for(ie in s)U=s[ie],$=l[ie],!s.hasOwnProperty(ie)||U===$||U==null&&$==null||_t(e,n,ie,U,s,$)}function ug(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function aS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,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&&ug(b)){for(b=0,k=f.responseEnd,s+=1;s<l.length;s++){var _=l[s],I=_.startTime;if(I>k)break;var X=_.transferSize,ie=_.initiatorType;X&&ug(ie)&&(_=_.responseEnd,b+=X*(_<k?1:(k-I)/(_-I)))}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 td=null,nd=null;function ys(e){return e.nodeType===9?e:e.ownerDocument}function cg(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 fg(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 dg(e,n,l,s){return l=ys(l).createElement(e),l[$t]=s,l[ln]=n,pn(l,e,n),Pt(l),l}function id(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 rd=null;function sS(){var e=window.event;return e&&e.type==="popstate"?e===rd?!1:(rd=e,!0):(rd=null,!1)}var ld=typeof setTimeout=="function"?setTimeout:void 0,oS=typeof clearTimeout=="function"?clearTimeout:void 0,hg=typeof Promise=="function"?Promise:void 0,mg=typeof requestAnimationFrame=="function"?requestAnimationFrame:ld,uS=typeof queueMicrotask=="function"?queueMicrotask:typeof hg<"u"?function(e){return hg.resolve(null).then(e).catch(cS)}:ld;function cS(e){setTimeout(function(){throw e})}function Tr(e){return e==="head"}function pg(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),da(n);return}s--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")s++;else if(l==="html")hd(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,hd(l);for(var d=l.firstChild;d;){var b=d.nextSibling,k=d.nodeName;d[qi]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&d.rel.toLowerCase()==="stylesheet"||l.removeChild(d),d=b}}else l==="body"&&hd(e.ownerDocument.body);l=f}while(l);da(n)}function yg(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 gg(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 vg(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 fS(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 ad(e){var n=e.getBoundingClientRect(),l=getComputedStyle(e);return fS(n,l,e)}function dS(e){return e.documentElement.clientHeight}function hS(e){this.addEventListener("load",e),this.addEventListener("error",e)}function mS(e,n,l,s,f,d,b,k,_){var I=n.nodeType===9?n:n.ownerDocument;try{var X=I.startViewTransition({update:function(){var U=I.defaultView,$=U.navigation&&U.navigation.transition,Se=I.fonts.status;s();var Re=[];if(Se==="loaded"&&(dS(I),I.fonts.status==="loading"&&Re.push(I.fonts.ready)),Se=Re.length,e!==null)for(var Qe=e.suspenseyImages,H=0,L=0;L<Qe.length;L++){var F=Qe[L];if(!F.complete){var ne=F.getBoundingClientRect();if(0<ne.bottom&&0<ne.right&&ne.top<U.innerHeight&&ne.left<U.innerWidth){if(H+=Ug(F),H>uu){Re.length=Se;break}F=new Promise(hS.bind(F)),Re.push(F)}}}if(0<Re.length)return U=Promise.race([Promise.all(Re),new Promise(function(Ce){return setTimeout(Ce,500)})]).then(f,f),($?Promise.allSettled([$.finished,U]):U).then(d,d);if(f(),$)return $.finished.then(d,d);d()},types:l});I.__reactViewTransition=X;var ie=[];return X.ready.then(function(){for(var U=I.documentElement.getAnimations({subtree:!0}),$=0;$<U.length;$++){var Se=U[$],Re=Se.effect,Qe=Re.pseudoElement;if(Qe!=null&&Qe.startsWith("::view-transition")){ie.push(Se),Se=Re.getKeyframes();for(var H=Qe=void 0,L=!0,F=0;F<Se.length;F++){var ne=Se[F],Ce=ne.width;if(Qe===void 0)Qe=Ce;else if(Qe!==Ce){L=!1;break}if(Ce=ne.height,H===void 0)H=Ce;else if(H!==Ce){L=!1;break}delete ne.width,delete ne.height,ne.transform==="none"&&delete ne.transform}L&&Qe!==void 0&&H!==void 0&&(Re.setKeyframes(Se),L=getComputedStyle(Re.target,Re.pseudoElement),L.width!==Qe||L.height!==H)&&(L=Se[0],L.width=Qe,L.height=H,L=Se[Se.length-1],L.width=Qe,L.height=H,Re.setKeyframes(Se))}}b()},function(U){I.__reactViewTransition===X&&(I.__reactViewTransition=null);try{typeof U=="object"&&U!==null&&U.name==="InvalidStateError"&&(U.message==="View transition was skipped because document visibility state is hidden."||U.message==="Skipping view transition because document visibility state has become hidden."||U.message==="Skipping view transition because viewport size changed."||U.message==="Transition was aborted because of invalid state")&&(U=null),U!==null&&_(U)}finally{s(),f(),b()}}),X.finished.finally(function(){for(var U=0;U<ie.length;U++)ie[U].cancel();I.__reactViewTransition===X&&(I.__reactViewTransition=null),k()}),X}catch{return s(),f(),b(),null}}function al(e,n){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+n+")"}al.prototype.animate=function(e,n){return n=typeof n=="number"?{duration:n}:D({},n),n.pseudoElement=this._selector,this._scope.animate(e,n)},al.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},al.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function bg(e){return{name:e,group:new al("group",e),imagePair:new al("image-pair",e),old:new al("old",e),new:new al("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(wg(d,e,n,l)===-1){var b=this,k=n;l!=null&&typeof l!="boolean"&&l.once===!0&&(k=function(_){b.removeEventListener(e,n,l),typeof n=="function"?n.call(this,_):n.handleEvent(_)}),s!==null&&(f=b.removeEventListener.bind(b,e,n,l),s.addEventListener("abort",f,{once:!0}),f=s.removeEventListener.bind(s,"abort",f)),s=aa(l),d.push({type:e,listener:n,optionsOrUseCapture:l,attachedListener:k,cleanup:f}),g(this._fragmentFiber.child,!1,pS,e,k,s)}this._eventListeners=d}};function pS(e,n,l,s){return N(e).addEventListener(n,l,s),!1}Vn.prototype.removeEventListener=function(e,n,l){var s=this._eventListeners;if(s!==null&&(n=wg(s,e,n,l),n!==-1)){var f=s[n];l=f.attachedListener;var d=f.cleanup;f=aa(f.optionsOrUseCapture),g(this._fragmentFiber.child,!1,yS,e,l,f),s.splice(n,1),d!==null&&d()}};function yS(e,n,l,s){return N(e).removeEventListener(n,l,s),!1}function aa(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function xg(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function wg(e,n,l,s){if(e.length===0)return-1;s=xg(s);for(var f=0;f<e.length;f++){var d=e[f];if(d.type===n&&d.listener===l&&xg(d.optionsOrUseCapture)===s)return f}return-1}Vn.prototype.dispatchEvent=function(e){var n=w(this._fragmentFiber);if(n===null)return!0;n=N(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,aa(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,aa(d.optionsOrUseCapture));return n.removeChild(s),e}return n.dispatchEvent(e)},Vn.prototype.focus=function(e){g(this._fragmentFiber.child,!0,Sg,e,void 0,void 0)};function Sg(e,n){return e.tag===6?!1:(e=N(e),CS(e,n))}Vn.prototype.focusLast=function(e){var n=[];g(this._fragmentFiber.child,!0,sd,n,void 0,void 0);for(var l=n.length-1;0<=l&&!Sg(n[l],e);l--);};function sd(e,n){return n.push(e),!1}Vn.prototype.blur=function(){var e=w(this._fragmentFiber);e!==null&&(e=N(e),e=ys(e).activeElement,e!==null&&g(this._fragmentFiber.child,!1,gS,e,void 0,void 0))};function gS(e,n){return e.tag===6?!1:(e=N(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),g(this._fragmentFiber.child,!1,vS,e,void 0,void 0)};function vS(e,n){return e.tag===6||(e=N(e),n.observe(e)),!1}Vn.prototype.unobserveUsing=function(e){var n=this._observers;if(n!==null&&n.has(e)){n.delete(e),g(this._fragmentFiber.child,!1,bS,e,void 0,void 0);for(var l=n=0;l<ci.length;l++){var s=ci[l];s.fragmentInstance===this&&s.observer===e?e.unobserve(s.instance):ci[n++]=s}ci.length=n}};function bS(e,n){return e.tag===6||(e=N(e),n.unobserve(e)),!1}var ci=[],od=!1;function xS(e,n,l){ci.push({fragmentInstance:e,observer:n,instance:l}),od||(od=!0,AS(function(){od=!1;var s=ci;ci=[];for(var f=0;f<s.length;f++){var d=s[f];d.observer.unobserve(d.instance)}}))}Vn.prototype.getClientRects=function(){var e=[];return g(this._fragmentFiber.child,!1,wS,e,void 0,void 0),e};function wS(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=N(e),n.push.apply(n,e.getClientRects());return!1}Vn.prototype.getRootNode=function(e){var n=w(this._fragmentFiber);return n===null?this:N(n).getRootNode(e)},Vn.prototype.compareDocumentPosition=function(e){var n=w(this._fragmentFiber);if(n===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var l=[];g(this._fragmentFiber.child,!1,sd,l,void 0,void 0);var s=N(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=N(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=N(l[0]),f=N(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),_=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||_||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||SS(n,this._fragmentFiber,l[0],l[l.length-1],e)?n:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function SS(e,n,l,s,f){var d=Di(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=A(l,d,ee),n===null?n=!1:(g(n,!0,B,d,l),d=j,j=null,n=d!==null)),n):e&Node.DOCUMENT_POSITION_FOLLOWING?((n=!!d)&&!(n=d===s)&&(n=A(s,d,ee),n===null?n=!1:(g(n,!0,K,d,s),d=j,M=j=null,n=d!==null)),n):!1}function kg(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=[];g(this._fragmentFiber.child,!1,sd,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=N(s),kg(e,l);return}if(s=N(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=N(f),kg(f,l)):N(f).scrollIntoView(e),s+=l?-1:1}};function kS(e,n){return e=N(e),Eg(e,n),!1}function Eg(e,n){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(n)}function jg(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,aa(f.optionsOrUseCapture))}e.nodeType!==3&&(l=n._observers,l!==null&&l.forEach(function(d){for(var b=0,k=0;k<ci.length;k++){var _=ci[k];(_.fragmentInstance!==n||_.observer!==d||_.instance!==e)&&(ci[b++]=_)}ci.length=b,d.observe(e)}),Eg(e,n))}function ES(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,aa(f.optionsOrUseCapture))}e.nodeType!==3&&(l=n._observers,l!==null&&l.forEach(function(d){typeof d.rootMargin=="string"?xS(n,d,e):d.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(n))}function ud(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":ud(l),ii(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function jS(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[qi])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=Wn(e.nextSibling),e===null)break}return null}function TS(e,n,l){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Wn(e.nextSibling),e===null))return null;return e}function Tg(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Wn(e.nextSibling),e===null))return null;return e}function cd(e){return e.data==="$?"||e.data==="$~"}function fd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function NS(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 Wn(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 dd=null;function Ng(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(n===0)return Wn(e.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}e=e.nextSibling}return null}function Cg(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 CS(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 AS(e){mg(function(){mg(function(n){return e(n)})})}function Ag(e,n,l){switch(n=ys(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 Rg(e,n,l){for(var s in l){var f=l[s];l.hasOwnProperty(s)&&f!=null&&_t(e,n,s,null,rS,f)}l.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===bn&&(e.onclick=null),ii(e)}function hd(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);ii(e)}var ei=new Map,_g=new Set;function gs(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 Wi=he.d;he.d={f:RS,r:_S,D:OS,C:zS,L:MS,m:qS,X:LS,S:DS,M:BS};function RS(){var e=Wi.f(),n=eu();return e||n}function _S(e){var n=Li(e);n!==null&&n.tag===5&&n.type==="form"?zp(n):Wi.r(e)}var sa=typeof document>"u"?null:document;function Og(e,n,l){var s=sa;if(s&&typeof n=="string"&&n){var f=jn(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),_g.has(f)||(_g.add(f),e={rel:e,crossOrigin:l,href:n},s.querySelector(f)===null&&(n=s.createElement("link"),pn(n,"link",e),Pt(n),s.head.appendChild(n)))}}function OS(e){Wi.D(e),Og("dns-prefetch",e,null)}function zS(e,n){Wi.C(e,n),Og("preconnect",e,n)}function MS(e,n,l){Wi.L(e,n,l);var s=sa;if(s&&e&&n){var f='link[rel="preload"][as="'+jn(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+jn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+jn(l.imageSizes)+'"]')):f+='[href="'+jn(e)+'"]';var d=f;switch(n){case"style":d=oa(e);break;case"script":d=ua(e)}if(!(ei.has(d)||(e=D({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:e,as:n},l),ei.set(d,e),s.querySelector(f)!==null||n==="style"&&s.querySelector(vs(d))||n==="script"&&s.querySelector(bs(d))))){var b=s.createElement("link");pn(b,"link",e),n==="style"&&(b[El]=!0,b.onload=b.onerror=function(){Js(b)}),Pt(b),s.head.appendChild(b)}}}function qS(e,n){Wi.m(e,n);var l=sa;if(l&&e){var s=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+jn(s)+'"][href="'+jn(e)+'"]',d=f;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=ua(e)}if(!ei.has(d)&&(e=D({rel:"modulepreload",href:e},n),ei.set(d,e),l.querySelector(f)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(bs(d)))return}s=l.createElement("link"),pn(s,"link",e),Pt(s),l.head.appendChild(s)}}}function DS(e,n,l){Wi.S(e,n,l);var s=sa;if(s&&e){var f=ar(s).hoistableStyles,d=oa(e);n=n||"default";var b=f.get(d);if(!b){var k={loading:0,preload:null};if(b=s.querySelector(vs(d)))k.loading=5;else{e=D({rel:"stylesheet",href:e,"data-precedence":n},l),(l=ei.get(d))&&md(e,l);var _=b=s.createElement("link");Pt(_),pn(_,"link",e),_._p=new Promise(function(I,X){_.onload=I,_.onerror=X}),_.addEventListener("load",function(){k.loading|=1}),_.addEventListener("error",function(){k.loading|=2}),k.loading|=4,su(b,n,s)}b={type:"stylesheet",instance:b,count:1,state:k},f.set(d,b)}}}function LS(e,n){Wi.X(e,n);var l=sa;if(l&&e){var s=ar(l).hoistableScripts,f=ua(e),d=s.get(f);d||(d=l.querySelector(bs(f)),d||(e=D({src:e,async:!0},n),(n=ei.get(f))&&pd(e,n),d=l.createElement("script"),Pt(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){Wi.M(e,n);var l=sa;if(l&&e){var s=ar(l).hoistableScripts,f=ua(e),d=s.get(f);d||(d=l.querySelector(bs(f)),d||(e=D({src:e,async:!0,type:"module"},n),(n=ei.get(f))&&pd(e,n),d=l.createElement("script"),Pt(d),pn(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(f,d))}}function zg(e,n,l,s){var f=(f=nt.current)?gs(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=oa(l.href),n=ar(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=oa(l.href);var d=ar(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(vs(e)))?d._p||(b.instance=d,b.state.loading=5):(d=ei.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},ei.set(e,d)),US(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=ua(l),n=ar(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 oa(e){return'href="'+jn(e)+'"'}function vs(e){return'link[rel="stylesheet"]['+e+"]"}function Mg(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function US(e,n,l,s){if(n=e.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[El]!==!0){s.loading=1;return}}else n=e.createElement("link"),n[El]=!0,n.onload=n.onerror=Js.bind(null,n),pn(n,"link",l),Pt(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 ua(e){return'[src="'+jn(e)+'"]'}function bs(e){return"script[async]"+e}function qg(e,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+jn(l.href)+'"]');if(s)return n.instance=s,Pt(s),s;var f=D({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Pt(s),pn(s,"style",f),su(s,l.precedence,e),n.instance=s;case"stylesheet":f=oa(l.href);var d=e.querySelector(vs(f));if(d)return n.state.loading|=4,n.instance=d,Pt(d),d;s=Mg(l),(f=ei.get(f))&&md(s,f),d=(e.ownerDocument||e).createElement("link"),Pt(d);var b=d;return b._p=new Promise(function(k,_){b.onload=k,b.onerror=_}),pn(d,"link",s),n.state.loading|=4,su(d,l.precedence,e),n.instance=d;case"script":return d=ua(l.src),(f=e.querySelector(bs(d)))?(n.instance=f,Pt(f),f):(s=l,(f=ei.get(d))&&(s=D({},l),pd(s,f)),e=e.ownerDocument||e,f=e.createElement("script"),Pt(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,su(s,l.precedence,e));return n.instance}function su(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 md(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function pd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var ou=null;function Dg(e,n,l){if(ou===null){var s=new Map,f=ou=new Map;f.set(l,s)}else f=ou,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[qi]||d[$t]||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 yd(e,n,l){e=e.ownerDocument||e,e.head.insertBefore(l,n==="title"?e.querySelector("head > title"):null)}function HS(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 Lg(e,n){return e==="img"&&n.src!=null&&n.src!==""&&n.onLoad==null&&n.loading!=="lazy"}function Bg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ug(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Hg(e,n){typeof n.decode=="function"&&(e.imgCount++,n.complete||(e.imgBytes+=Ug(n),e.suspenseyImages.push(n)),e=YS.bind(e),n.decode().then(e,e))}function IS(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=oa(s.href),d=n.querySelector(vs(f));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=xs.bind(e),n.then(e,e)),l.state.loading|=4,l.instance=d,Pt(d);return}d=n.ownerDocument||n,s=Mg(s),(f=ei.get(f))&&md(s,f),d=d.createElement("link"),Pt(d);var b=d;b._p=new Promise(function(k,_){b.onload=k,b.onerror=_}),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=xs.bind(e),n.addEventListener("load",l),n.addEventListener("error",l))}}var uu=0;function VS(e,n){return e.stylesheets&&e.count===0&&fu(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var s=setTimeout(function(){if(e.stylesheets&&fu(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+n);0<e.imgBytes&&uu===0&&(uu=62500*aS());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fu(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>uu?50:800)+n);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(f)}}:null}function Ig(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)fu(e,e.stylesheets);else if(e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}}}function xs(){this.count--,Ig(this)}function YS(){this.imgCount--,Ig(this)}var cu=null;function fu(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,cu=new Map,n.forEach(FS,e),cu=null,xs.call(e))}function FS(e,n){if(!(n.state.loading&4)){var l=cu.get(e);if(l)var s=l.get(null);else{l=new Map,cu.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=xs.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 ca={$$typeof:ge,Provider:null,Consumer:null,_currentValue:We,_currentValue2:We,_threadCount:0};function GS(e,n,l,s,f,d,b,k,_){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=rr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rr(0),this.hiddenUpdates=rr(null),this.identifierPrefix=s,this.onUncaughtError=f,this.onCaughtError=d,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.transitionTypes=null,this.incompleteTransitions=new Map}function Vg(e,n,l,s,f,d,b,k,_,I,X,ie){return e=new GS(e,n,l,b,_,I,X,ie,k),n=1,d===!0&&(n|=24),d=Tn(3,null,null,n),e.current=d,d.stateNode=e,n=Rc(),n.refCount++,e.pooledCache=n,n.refCount++,d.memoizedState={element:s,isDehydrated:l,cache:n},Mc(d),e}function Yg(e){return e?(e=Dl,e):Dl}function Fg(e,n,l,s,f,d){f=Yg(f),s.context===null?s.context=f:s.pendingContext=f,s=mr(n),s.payload={element:l},d=d===void 0?null:d,d!==null&&(s.callback=d),l=pr(e,s,n),l!==null&&(Rn(l,e,n),Ja(l,e,n))}function Gg(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<n?l:n}}function gd(e,n){Gg(e,n),(e=e.alternate)&&Gg(e,n)}function $g(e){if(e.tag===13||e.tag===31){var n=Yr(e,67108864);n!==null&&Rn(n,e,67108864),gd(e,67108864)}}function Xg(e){if(e.tag===13||e.tag===31){var n=In();n=Lr(n);var l=Yr(e,n);l!==null&&Rn(l,e,n),gd(e,n)}}var fa=!0;function $S(e,n,l,s){var f=P.T;P.T=null;var d=he.p;try{he.p=2,vd(e,n,l,s)}finally{he.p=d,P.T=f}}function XS(e,n,l,s){var f=P.T;P.T=null;var d=he.p;try{he.p=8,vd(e,n,l,s)}finally{he.p=d,P.T=f}}function vd(e,n,l,s){if(fa){var f=bd(s);if(f===null)Wf(e,n,s,du,l),Zg(e,s);else if(ZS(f,e,n,l,s))s.stopPropagation();else if(Zg(e,s),n&4&&-1<QS.indexOf(e)){for(;f!==null;){var d=Li(f);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var b=Mi(d.pendingLanes);if(b!==0){var k=d;for(k.pendingLanes|=2,k.entangledLanes|=2;b;){var _=1<<31-jt(b);k.entanglements[1]|=_,b&=~_}Ni(d),(kt&6)===0&&(Jo=Nt()+500,hs(0))}}break;case 31:case 13:k=Yr(d,2),k!==null&&Rn(k,d,2),eu(),gd(d,2)}if(d=bd(s),d===null&&Wf(e,n,s,du,l),d===f)break;f=d}f!==null&&s.stopPropagation()}else Wf(e,n,s,null,l)}}function bd(e){return e=Da(e),xd(e)}var du=null;function xd(e){if(du=null,e=Di(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 du=e,null}function Qg(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(Ct()){case ht:return 2;case Ft:return 8;case hi:case Fn:return 32;case J:return 268435456;default:return 32}default:return 32}}var wd=!1,Nr=null,Cr=null,Ar=null,ws=new Map,Ss=new Map,Rr=[],QS="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 Zg(e,n){switch(e){case"focusin":case"focusout":Nr=null;break;case"dragenter":case"dragleave":Cr=null;break;case"mouseover":case"mouseout":Ar=null;break;case"pointerover":case"pointerout":ws.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ss.delete(n.pointerId)}}function ks(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=Li(n),n!==null&&$g(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function ZS(e,n,l,s,f){switch(n){case"focusin":return Nr=ks(Nr,e,n,l,s,f),!0;case"dragenter":return Cr=ks(Cr,e,n,l,s,f),!0;case"mouseover":return Ar=ks(Ar,e,n,l,s,f),!0;case"pointerover":var d=f.pointerId;return ws.set(d,ks(ws.get(d)||null,e,n,l,s,f)),!0;case"gotpointercapture":return d=f.pointerId,Ss.set(d,ks(Ss.get(d)||null,e,n,l,s,f)),!0}return!1}function Kg(e){var n=Di(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,Sl(e.priority,function(){Xg(l)});return}}else if(n===31){if(n=h(l),n!==null){e.blockedOn=n,Sl(e.priority,function(){Xg(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 hu(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var l=bd(e.nativeEvent);if(l===null){l=e.nativeEvent;var s=new l.constructor(l.type,l);qa=s,l.target.dispatchEvent(s),qa=null}else return n=Li(l),n!==null&&$g(n),e.blockedOn=l,!1;n.shift()}return!0}function Jg(e,n,l){hu(e)&&l.delete(n)}function KS(){wd=!1,Nr!==null&&hu(Nr)&&(Nr=null),Cr!==null&&hu(Cr)&&(Cr=null),Ar!==null&&hu(Ar)&&(Ar=null),ws.forEach(Jg),Ss.forEach(Jg)}function mu(e,n){e.blockedOn===n&&(e.blockedOn=null,wd||(wd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,KS)))}var pu=null;function Pg(e){pu!==e&&(pu=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){pu===e&&(pu=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(xd(s||l)===null)continue;break}var d=Li(l);d!==null&&(e.splice(n,3),n-=3,tf(d,{pending:!0,data:f,method:l.method,action:s},s,f))}}))}function da(e){function n(_){return mu(_,e)}Nr!==null&&mu(Nr,e),Cr!==null&&mu(Cr,e),Ar!==null&&mu(Ar,e),ws.forEach(n),Ss.forEach(n);for(var l=0;l<Rr.length;l++){var s=Rr[l];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Rr.length&&(l=Rr[0],l.blockedOn===null);)Kg(l),l.blockedOn===null&&Rr.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[ln]||null;if(typeof d=="function")b||Pg(l);else if(b){var k=null;if(d&&d.hasAttribute("formAction")){if(f=d,b=d[ln]||null)k=b.formAction;else if(xd(f)!==null)continue}else k=b.action;typeof k=="function"?l[s+1]=k:(l.splice(s,3),s-=3),Pg(l)}}}function Wg(){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 Sd(e){this._internalRoot=e}yu.prototype.render=Sd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var l=n.current,s=In();Fg(l,s,e,n,null,null)},yu.prototype.unmount=Sd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Fg(e.current,2,null,e,null,null),eu(),n[mi]=null}};function yu(e){this._internalRoot=e}yu.prototype.unstable_scheduleHydration=function(e){if(e){var n=wl();e={blockedOn:null,target:e,priority:n};for(var l=0;l<Rr.length&&n!==0&&n<Rr[l].priority;l++);Rr.splice(l,0,e),l===0&&Kg(e)}};var ev=i.version;if(ev!=="19.3.1")throw Error(a(527,ev,"19.3.1"));he.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=y(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var JS={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gu.isDisabled&&gu.supportsFiber)try{vt=gu.inject(JS),at=gu}catch{}}return js.createRoot=function(e,n){if(!o(e))throw Error(a(299));var l=!1,s="",f=Yp,d=Fp,b=Gp;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=Vg(e,1,!1,null,null,l,s,null,f,d,b,Wg),e[mi]=n.current,Pf(e),new Sd(n)},js.hydrateRoot=function(e,n,l){if(!o(e))throw Error(a(299));var s=!1,f="",d=Yp,b=Fp,k=Gp,_=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&&(_=l.formState)),n=Vg(e,1,!0,n,l??null,s,f,_,d,b,k,Wg),n.context=Yg(null),l=n.current,s=In(),s=Lr(s),f=mr(s),f.callback=null,pr(l,f,s),l=s,n.current.lanes=l,Dr(n,l),Ni(n),e[mi]=n.current,Pf(e),new yu(n)},js.version="19.3.1",js}var cv;function ak(){if(cv)return jd.exports;cv=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(),jd.exports=lk(),jd.exports}var sk=ak(),ml=Fb();async function Pe(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:{}}}function ok(t){const i=t.trim();if(i==="")return null;try{const r=JSON.parse(i);return!r||typeof r.phase!="string"||typeof r.percent!="number"?null:{phase:r.phase,percent:r.percent,...typeof r.error=="string"?{error:r.error}:{},...Array.isArray(r.deletedSessionIds)?{deletedSessionIds:r.deletedSessionIds.filter(a=>typeof a=="string")}:{}}}catch{return null}}async function uk(t,i){const r=t.body?.getReader();if(!r){const c=await t.text();return Ad(c,i)}const a=new TextDecoder;let o="",u=null;for(;;){const c=await r.read();o+=a.decode(c.value??new Uint8Array,{stream:!c.done});const h=o.split(`
|
|
11
|
+
`);if(o=h.pop()??"",u=Ad(h.join(`
|
|
12
|
+
`),i)??u,c.done)break}return Ad(o,i)??u}function Ad(t,i){let r=null;for(const a of t.split(`
|
|
13
|
+
`)){const o=ok(a);o&&(r=o,i(o))}return r}const ck=1,fk=500,dk={minMessages:50,minTurns:2},hk=500,mk=2e3,pk=256*1024,yk=6,gk=3,vk=5e3,bk=8*1024*1024,xk=2e3,wk=500,Sk=1e4,Rd=3,Gb=64*1024*1024,$b="/api/dsh-bot/log/range",kk="/api/dsh-bot/log/manifest",Ek="/api/dsh-bot/log/chunk",jk="/api/session/events",Tk=3e3,Nk=3e4,Ck=1e3,Ak=15e3,Rk="dsh-bot",_k=2,Ok=["log_chunks","log_events","log_cursors"];function zk(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(Rk,_k);u.onupgradeneeded=c=>{const h=u.result;if(c.oldVersion<2){for(const y of["chunks","events"])h.objectStoreNames.contains(y)&&h.deleteObjectStore(y);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(),!Ok.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 Mk(){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>Gb&&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 p=t.get(u),y=p?Math.max(p.appliedSeq,c):c,v=h==null?p?.headSeq??null:Math.max(p?.headSeq??h,h);t.set(u,{appliedSeq:y,headSeq:v})},async putEvents(u,c){const h=i.get(u)??new Map;for(const p of c)h.set(p.seq,p);i.set(u,h)},async readEvents(u,c=-1){const h=i.get(u);return h?[...h.values()].filter(p=>p.seq>c).sort((p,y)=>p.seq-y.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 fv(t){const i=await Xb(t);if(i.ok!==!0)return Mk();const r=i.db;return{mode:"idb",async getCursor(a){return er(r,"log_cursors","readonly",o=>On(o.get(a))).then(o=>o?{appliedSeq:o.appliedSeq,headSeq:o.headSeq??null}:null)},async setCursor(a,o,u){await er(r,"log_cursors","readwrite",async c=>{const h=await On(c.get(a)),p=h?Math.max(h.appliedSeq,o):o,y=u==null?h?.headSeq??null:Math.max(h?.headSeq??u,u);await On(c.put({sessionId:a,appliedSeq:p,headSeq:y,updatedAt:Date.now()}))})},async putEvents(a,o){await er(r,"log_events","readwrite",async u=>{for(const c of o)await On(u.put({sessionId:a,seq:c.seq,event:c}))})},async readEvents(a,o=-1){return(await er(r,"log_events","readonly",c=>{const h=c.index("bySession");return On(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 er(r,"log_chunks","readonly",u=>On(u.get(a)));return o?.bytes?(er(r,"log_chunks","readwrite",u=>On(u.put({...o,lastUsed:Date.now()},a))),o.bytes):null},async putChunk(a,o){await er(r,"log_chunks","readwrite",async u=>{await On(u.put({bytes:o,lastUsed:Date.now()},a)),await qk(u)})}}}async function qk(t){const i=t.index("byLastUsed"),r=await On(i.getAll()),a=await On(i.getAllKeys());let o=r.reduce((u,c)=>u+(c.bytes?.byteLength??0),0);for(let u=0;u<r.length&&o>Gb;u+=1){const c=a[u],h=r[u];c==null||!h||(o-=h.bytes.byteLength,await On(t.delete(c)))}}async function Dk(t,i){const r=await Xb(i);if(r.ok!==!0)return;const a=r.db;try{await er(a,"log_events","readwrite",async o=>{const u=o.index("bySession");for(const c of t){const h=await On(u.getAll(c));for(const p of h)!p||p.sessionId!==c||await On(o.delete([p.sessionId,p.seq]))}}),await er(a,"log_cursors","readwrite",async o=>{for(const u of t)await On(o.delete(u))})}finally{a.close()}}function Xb(t){try{return zk(t)}catch{return Promise.resolve({ok:!1,reason:"unavailable"})}}function er(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 On(t){return new Promise((i,r)=>{t.onsuccess=()=>i(t.result),t.onerror=()=>r(t.error)})}async function Ai(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 Qb(t,i){return typeof t.message=="string"&&t.message!==""?t.message:i}const Lk=/^(?:Name|名字)\s*[::]\s*(.+?)\s*$/i,Bk=/^(?:Style|风格)\s*[::]\s*(.+?)\s*$/i,Uk=/^(?:Task|任务)\s*[::]\s*(.+?)\s*$/i;function Hk(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(`
|
|
14
|
+
|
|
15
|
+
`)}function Ik(t){const i={name:"",style:"",task:""};for(const r of t.split(`
|
|
16
|
+
`)){const a=Lk.exec(r),o=Bk.exec(r),u=Uk.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 Vk={"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","activity.toolResult":"Tool result","activity.emptyResult":"(empty result)"},Yk={"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":"(空结果)"},Zb={en:Vk,zh:Yk},Fk={"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"},Gk={"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":"来源"},Kb={en:Fk,zh:Gk},$k={"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."},Xk={"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":"无法读取会话是否仍在运行"},Jb={en:$k,zh:Xk},Qk={"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."},Zk={"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":"没有送出。"},Pb={en:Qk,zh:Zk},Kk={"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.","new.kickoff":"Hello.","new.turnFailed":"The bot was created, but the first turn did not start.","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.deleteProgress":"Deleting this bot","session.deleteFence":"Locking this bot","session.deleteStop":"Stopping conversations","session.deleteIdle":"Confirming the conversations have stopped","session.deleteStore":"Deleting memory, skills, and tickets","session.deleteCanvas":"Deleting canvases","session.deleteFiles":"Deleting logs","session.deleteCache":"Clearing this browser cache","session.deleteDone":"Deleted","session.deleteRetry":"Retry","session.deleteBusy":"A conversation was still running. This bot stays locked. Retry the delete.","session.deleteUnreadable":"The session list could not be read. This bot stays locked. Retry the delete.","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"},Jk={"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":"会话已创建,人格没有套上。","new.kickoff":"你好。","new.turnFailed":"Bot 已创建,但第一轮对话没有开始。","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.deleteProgress":"正在删除这个 bot","session.deleteFence":"正在锁定这个 bot","session.deleteStop":"正在停止进行中的对话","session.deleteIdle":"正在确认对话已经结束","session.deleteStore":"正在删除记忆、技能和工单","session.deleteCanvas":"正在删除 canvas","session.deleteFiles":"正在删除日志","session.deleteCache":"正在清理本机缓存","session.deleteDone":"已删除","session.deleteRetry":"重试","session.deleteBusy":"还有对话没能停下来。这个 bot 保持锁定,不能再开始新对话。可以重试删除。","session.deleteUnreadable":"读不到会话列表。这个 bot 保持锁定。可以重试删除。","session.listUnavailable":"会话列表不可用","session.unnamed":"新会话","session.blankName":"空白会话","local.mark":"本","local.here":"本机","local.down":"主运行时不可达"},Wb={en:Kk,zh:Jk},Pk={"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"},Wk={"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":"已记录决定"},ex={en:Pk,zh:Wk},eE={"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."},tE={"approval.title":"工具许可","approval.allowOnce":"允许一次","approval.reject":"拒绝","approval.waiting":"等待你的回答","approval.allowed":"已允许一次","approval.rejected":"已拒绝","approval.cancelled":"这个请求已被取消。","approval.failed":"这个请求未能完成。","approval.submitFailed":"决定未能提交。"},tx={en:eE,zh:tE},nE={"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","permission.defaultTitle":"Default for new sessions","permission.defaultHelp":"Fully allow is the starting default. It gives a new main session broad file access and runs tools without an approval prompt. A worker created from a main session inherits that main session's current permission, including its sandbox and approval policy. Saving a choice here changes only main sessions created afterward. A session that already exists, including one whose permission you set by hand, keeps that permission. A worker that was already created keeps the permission it inherited.","permission.confirmDefaultFull":"New main sessions will start with full access. This is broad: files outside the workspace can be changed, and approval prompts are skipped."},iE={"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":"自动审阅","permission.defaultTitle":"新会话的默认权限","permission.defaultHelp":"一开始的默认是完全允许。新的主会话会得到很宽的文件访问,工具执行前不再询问。从主会话创建的 Worker 会继承该主会话当时的权限,包括沙箱和审批。在这里保存的选择只作用于之后新建的主会话。已经存在的会话,包括你单独改过权限的会话,都保持原来的权限。已经创建的 Worker 保持创建时继承的权限。","permission.confirmDefaultFull":"之后新建的主会话会从完全允许开始。这是很宽的权限:工作区以外的文件也可以改,并且不再弹出审批。"},nx={en:nE,zh:iE},rE={"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"},lE={"auth.title":"授权","auth.open":"凭据","auth.empty":"当前没有可进行的授权流程。","auth.start":"开始","auth.writeVault":"写入保险库","auth.cancel":"取消","auth.secretMask":"••••••••","auth.unavailable":"此主机未提供官方授权。","auth.failed":"授权未能完成。","auth.close":"关闭"},ix={en:rE,zh:lE},aE={"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"},sE={"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":"关闭"},rx={en:aE,zh:sE},oE={"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"},uE={"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} 毫秒"},lx={en:oE,zh:uE},ax={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":"重试图片"}},cE={"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"},fE={"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":"更新工作状态"},sx={en:cE,zh:fE},ox={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.select":"Select","canvas.mention":"Mention","canvas.path":"Element path","canvas.removeMention":"Remove mention","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.select":"选择","canvas.mention":"提到输入","canvas.path":"元素路径","canvas.removeMention":"移除提及","canvas.unavailable":"设计预览无法加载。"}},dE={...Wb.en,...Jb.en,...Pb.en,...Kb.en,...lx.en,...Zb.en,...ex.en,...tx.en,...nx.en,...ix.en,...rx.en,...ax.en,...sx.en,...ox.en},hE={...Wb.zh,...Jb.zh,...Pb.zh,...Kb.zh,...lx.zh,...Zb.zh,...ex.zh,...tx.zh,...nx.zh,...ix.zh,...rx.zh,...ax.zh,...sx.zh,...ox.zh},dv={en:dE,zh:hE},hv=new Set;function mE(t){return hv.add(t),()=>{hv.delete(t)}}const ux="dsh-bot.locale";function pE(){try{const t=localStorage.getItem(ux);if(t==="en"||t==="zh")return t}catch{}return"en"}function yE(t){try{localStorage.setItem(ux,t)}catch{}typeof document<"u"&&(document.documentElement.lang=t==="zh"?"zh-CN":"en")}function cx(t,i,r){const a=dv[t][i]??dv.en[i];return r?a.replace(/\{(\w+)\}/g,(o,u)=>r[u]??""):a}function Ri(t,i){return cx("en",t,i)}const gE={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 vE(t,i,r=Ri){const a=gE[t];return a?r(a):i}const fx=E.createContext({locale:"en",setLocale:()=>{},t:Ri});function bE({children:t}){const[i,r]=E.useState(()=>pE()),[a,o]=E.useState(0),u=E.useCallback(p=>{yE(p),r(p)},[]);E.useEffect(()=>mE(()=>o(p=>p+1)),[]);const c=E.useCallback((p,y)=>cx(i,p,y),[i,a]),h=E.useMemo(()=>({locale:i,setLocale:u,t:c}),[i,u,c]);return m.jsx(fx.Provider,{value:h,children:t})}function Ze(){return E.useContext(fx)}const xE={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"},wE=new Set(["delivered","cancelled"]),SE=new Set(["accepted","enqueued","started","needs_user","waiting_budget"]);function dx(t,i=Ri){const r=xE[t];return r?i(r):t}function hx(t){return t.replace(/^\uFEFF/,"").trimStart().startsWith("[foundations:ticket]")}function Ch(t){const i=t.replace(/^\uFEFF/,"").replace(/\r\n/g,`
|
|
17
|
+
`).trimStart();if(!i.startsWith("[foundations:briefing]"))return null;const r=i.slice(22).replace(/^\n/,""),a=r.indexOf(`
|
|
18
|
+
---
|
|
19
|
+
`);if(a<0)return null;const o=[],u={};for(const y of r.slice(0,a).split(`
|
|
20
|
+
`)){const v=/^(briefing_revision|budget_wall_ms|budget_max_tokens|material_sha256):\s*(.*)$/.exec(y);v?.[1]?u[v[1]]=(v[2]??"").trim():y.trim()!==""&&o.push(y.trim())}const c=Number(u.briefing_revision),h=Number(u.budget_wall_ms),p=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(p)&&p>0?p:null,material:u.material_sha256??"",notes:o,body:r.slice(a+5).trim(),cancel:o.some(y=>y.startsWith("This is a cancellation note")||y.startsWith("这是取消说明"))}}function ha(t){return t.startsWith("worker-")&&t.length>7}function kE(t){return ha(t)?t.slice(7):""}function EE(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 jE(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]=NE({cards:o});return r}function TE(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:EE(i),cards:jE(i)}}function NE(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=CE(r,a);return o?[o]:[]}):[]}function CE(t,i="",r=Ri){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),p=Array.isArray(t.events)?t.events.flatMap(BE):[],y=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 g=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:g,childSessionId:y.startsWith("worker-")?y:null,startedAt:typeof h?.started_at=="string"?h.started_at:null,events:p}}function AE(t){const i=t.filter(a=>!wE.has(a.status)),r=t.find(a=>a.status==="delivered");return r?[...i,r]:i}function mx(t){return t.some(i=>SE.has(i.status))}function mv(t,i,r=!1){return r?!1:t&&!mx(i)}const RE=new Set(["accepted","enqueued","started"]);function _E(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:RE.has(o.status)&&(a=!0));return r?"wait":a?"run":null}function _d(t,i=Date.now(),r=Ri){const a=t.filter(c=>c.status==="started");if(a.length>1)return r("work.preview.startedMany",{count:String(a.length)});const o=gx(t);if(!o||o.status==="ready")return"";const u=dx(o.status,r);if(o.status==="started"){const c=yx(o.startedAt,i);return c?`${u} · ${c}`:u}return u}function OE(t,i=Ri){if(t.filter(o=>o.status==="started").length>1)return i("work.placeholder.many");const a=gx(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 zE(t,i,r=Ri){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=yx(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=LE(t);return o&&a.push(o),a}function ME(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 px(t){return t==="foundations_dispatch"||t==="foundations_dispatch_canvas"}function qE(t){if(!px(t.name)||t.result.trim()==="")return!1;const i=vx(t.result);return i?i.ok===!1&&i.code==="BUDGET":t.result.includes('"BUDGET"')||/concurrency limit/i.test(t.result)}function DE(t,i=Ri){const r=vx(t);return r&&typeof r.message=="string"&&r.message!==""?r.message:i("work.budgetFallback")}function yx(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 gx(t){const i=AE(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 LE(t){return t.events.filter(r=>r.kind==="progress"&&r.applyStatus==="applied"&&r.revision===t.revision&&r.text.trim()!=="").at(-1)?.text??""}function BE(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 vx(t){try{const i=JSON.parse(t);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}function _u(t,i,r){return vE(t,i,r)}function UE({active:t,progress:i}){const{t:r}=Ze(),[a,o]=E.useState(t),[u,c]=E.useState(!1);if(E.useEffect(()=>{if(t){o(!0);return}c(!1)},[t]),E.useEffect(()=>{if(!a||!t)return;const y=window.requestAnimationFrame(()=>c(!0));return()=>window.cancelAnimationFrame(y)},[a,t]),E.useEffect(()=>{if(t||!a)return;const y=window.setTimeout(()=>o(!1),280);return()=>window.clearTimeout(y)},[t,a]),!a)return null;const h=i!=null&&i.total>0,p=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(p)}):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:`${p}%`}:void 0})})]})})}function pv({signal:t}){const{t:i}=Ze();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 HE(t){const i=[];return t.turns!=null&&i.push(`${t.turns} turns`),t.steps!=null&&i.push(`${t.steps} steps`),i.join(" · ")}function IE({health:t,usage:i,execution:r,model:a}){const{t:o}=Ze(),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"):_u(r.reason,r.reason,o)}),m.jsx("p",{className:i?.connected?"":"muted",children:i?.connected?o("health.usageReady"):_u(c,i?.error||o("health.usageOff"),o)}),m.jsx("p",{className:"muted",children:o("health.sameSession")})]})}function VE(){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 bx(){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 YE({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 xx(){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"})})}const Ou=8,wx=56;function yv(){return{following:!0,programmaticTop:null,suppressRejoin:!1,lastTop:null,lastHeight:null}}function zu(t){return t.scrollHeight-t.scrollTop-t.clientHeight}function FE(t,i){return i.scrollTop<=1&&zu(i)<=Ou?!1:(t.following=!1,!0)}function GE(t){t.following=!1}function $E(t,i){const r=zu(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<=wx&&(t.following=!0),t.lastTop=i.scrollTop,t.lastHeight=i.scrollHeight,{following:t.following,detached:!t.following&&r>Ou}}function Od(t){return Math.max(0,t.scrollHeight-t.clientHeight)}function gv(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 XE(t){const i=E.useRef(null),r=E.useRef(null),a=E.useRef(yv()),o=E.useRef(!1),[u,c]=E.useState(!1),h=E.useCallback(v=>{if(!v){c(!1);return}const g=!a.current.following&&zu(v)>Ou;c(w=>w===g?w:g)},[]),p=E.useCallback(()=>{const v=i.current;if(!v||!a.current.following){h(v);return}const g=Od(v);if(Math.abs(v.scrollTop-g)<=1){a.current.programmaticTop=null,h(v);return}a.current.programmaticTop=g,v.scrollTop=g,h(v)},[h]),y=E.useCallback((v="auto")=>{const g=i.current;if(a.current.following=!0,a.current.suppressRejoin=!1,c(!1),!g)return;const w=Od(g),x=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(v==="smooth"&&!x&&g.scrollTop<w-1){o.current=!0,a.current.programmaticTop=null,g.scrollTo({top:w,behavior:"smooth"});return}o.current=!1,a.current.programmaticTop=w,g.scrollTop=w},[]);return E.useLayoutEffect(()=>{const v=yv();a.current=v,o.current=!1,c(!1);const g=i.current;if(!g)return;const w=Od(g);v.programmaticTop=w,v.lastTop=w,v.lastHeight=g.scrollHeight,g.scrollTop=w},[t]),E.useEffect(()=>{const v=i.current,g=r.current;if(!v||!g)return;const w=()=>{o.current&&(o.current=!1,a.current.suppressRejoin=!0,requestAnimationFrame(()=>{v.scrollTop=v.scrollTop,requestAnimationFrame(()=>{a.current.suppressRejoin=!1})}))},x=()=>{FE(a.current,v)&&(w(),h(v))},S=()=>{GE(a.current),w(),h(v)},T=()=>{const Y=$E(a.current,v);Y.following&&zu(v)<=Ou&&(o.current=!1),c(le=>le===Y.detached?le:Y.detached)},N=Y=>{Y.deltaY<0&&!gv(v,Y.target)&&x()};let j=0;const M=Y=>{j=Y.touches[0]?.clientY??0},B=Y=>{const le=Y.touches[0]?.clientY??j;le>j+8&&!gv(v,Y.target)&&x(),j=le},K=Y=>{if(Y.altKey||Y.metaKey||Y.ctrlKey||Y.shiftKey)return;const le=Y.target;le instanceof HTMLInputElement||le instanceof HTMLTextAreaElement||le instanceof HTMLSelectElement||(Y.key==="PageUp"||Y.key==="ArrowUp"||Y.key==="Home")&&x()},ee=Y=>{const le=Y.target;le instanceof Element&&le.closest("button.official-title, summary")&&S()},A=()=>{const Y=document.getSelection();if(!Y||Y.isCollapsed)return;const le=Y.anchorNode;!le||!v.contains(le)||S()},D=new ResizeObserver(()=>{p()});return D.observe(g),v.addEventListener("scroll",T,{passive:!0}),v.addEventListener("wheel",N,{passive:!0}),v.addEventListener("touchstart",M,{passive:!0}),v.addEventListener("touchmove",B,{passive:!0}),v.addEventListener("keydown",K),v.addEventListener("pointerdown",ee),document.addEventListener("selectionchange",A),p(),()=>{D.disconnect(),v.removeEventListener("scroll",T),v.removeEventListener("wheel",N),v.removeEventListener("touchstart",M),v.removeEventListener("touchmove",B),v.removeEventListener("keydown",K),v.removeEventListener("pointerdown",ee),document.removeEventListener("selectionchange",A)}},[t,h,p]),{scrollRef:i,contentRef:r,detached:u,pin:y,stickIfFollowing:p}}const QE=E.forwardRef(function({scrollKey:i,header:r,beforeBody:a,busy:o=!1,progress:u=null,jumpInBody:c=!1,composerHidden:h=!1,composerLift:p=!1,scrollClassName:y,markReadonly:v=!1,rail:g,composer:w,children:x},S){const{t:T}=Ze(),{scrollRef:N,contentRef:j,detached:M,pin:B,stickIfFollowing:K}=XE(i),ee=E.useRef(null);E.useImperativeHandle(S,()=>({pin:B}),[B]),E.useLayoutEffect(()=>{const D=ee.current,Y=N.current;if(!D||!Y)return;const le=()=>{const V=Number.parseFloat(getComputedStyle(D).getPropertyValue("--composer-fade"))||0,ke=(D.hidden?0:Math.max(0,D.offsetHeight-V))+wx;(Number.parseFloat(Y.style.paddingBottom)||0)!==ke&&(Y.style.paddingBottom=`${ke}px`,K())};le();const O=new ResizeObserver(le);return O.observe(D),()=>{O.disconnect(),Y.style.paddingBottom=""}},[i,h,p,N,K]);const A=M?m.jsx(KE,{label:T("scroll.latest"),onClick:()=>B("smooth")}):null;return m.jsxs("section",{className:"chat",children:[r,a,m.jsxs("div",{className:"chat-body",children:[m.jsx(UE,{active:o,progress:u}),c?A:null,m.jsx("div",{className:y?`scroll ${y}`:"scroll",ref:N,"data-readonly":v?"true":void 0,"aria-busy":o||void 0,children:m.jsx("div",{className:"column",ref:j,children:x})}),g?.(N)]}),m.jsxs(JE,{ref:ee,lift:p,hidden:h,children:[c?null:A,w]})]})});function ZE({onSubmit:t,activity:i,chips:r,mentions:a,textareaRef:o,value:u,placeholder:c,disabled:h=!1,readOnly:p=!1,onChange:y,onSelect:v,onKeyDown:g,toolsRef:w,addDisabled:x=!1,addExpanded:S=!1,onAdd:T,addMenu:N,permission:j,model:M,showStop:B=!1,stopDisabled:K=!1,onStop:ee,showSend:A=!0,sendDisabled:D=!1,stats:Y}){const{t:le}=Ze(),O=h||p;function V(Z){Z.preventDefault(),!O&&t?.()}return m.jsxs("form",{className:"column",onSubmit:V,children:[i,m.jsxs("div",{className:"card",children:[r,a,m.jsx("textarea",{ref:Z=>{o&&(o.current=Z)},value:u,rows:1,placeholder:c,disabled:h||p,readOnly:p,"aria-label":p?c:void 0,onChange:Z=>y?.(Z.target.value,Z.target.selectionStart??Z.target.value.length),onSelect:Z=>v?.(Z.currentTarget.selectionStart??0),onKeyDown:g}),m.jsxs("div",{className:"card-row",children:[m.jsxs("div",{className:"tools",ref:Z=>{w&&(w.current=Z)},children:[m.jsx("button",{type:"button",className:"add","aria-label":le("composer.add"),"aria-haspopup":T?"menu":void 0,"aria-expanded":T?S:void 0,disabled:O||x,onClick:T,children:m.jsx(bx,{})}),O?null:N,O?null:j]}),m.jsxs("div",{className:"trailing",children:[M?m.jsx("span",{className:"model",children:M}):null,B?m.jsx("button",{type:"button",className:"stop","aria-label":le("composer.cancel"),disabled:O||K,onClick:ee,children:m.jsx("span",{className:"stop-icon"})}):null,A?m.jsx("button",{type:"submit",className:"send","aria-label":le("composer.send"),disabled:O||D,children:m.jsx(xx,{})}):null]})]})]}),Y?m.jsx("p",{className:"stats",children:Y}):null]})}function KE({label:t,onClick:i}){return m.jsx("button",{type:"button",className:"jump-latest","aria-label":t,onClick:i,children:m.jsx(xx,{})})}const JE=E.forwardRef(function({lift:i,hidden:r,children:a},o){const[u,c]=E.useState(null);E.useLayoutEffect(()=>{if(!i)return;const p=document.querySelector("section.chat"),y=()=>{const v=p?.getBoundingClientRect();v&&c({left:v.left,width:v.width})};return y(),window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[i]);const h=m.jsx("div",{ref:o,className:i?"composer-wrap lifted":"composer-wrap",hidden:r,style:i&&u?{left:u.left,width:u.width,right:"auto"}:void 0,children:a});return i&&u?ml.createPortal(h,document.body):h}),PE="modulepreload",WE=function(t){return"/dsh-bot/"+t},vv={},ej=function(i,r,a){let o=Promise.resolve();if(r&&r.length>0){let p=function(y){return Promise.all(y.map(v=>Promise.resolve(v).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),h=c?.nonce||c?.getAttribute("nonce");o=p(r.map(y=>{if(y=WE(y),y in vv)return;vv[y]=!0;const v=y.endsWith(".css"),g=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${g}`))return;const w=document.createElement("link");if(w.rel=v?"stylesheet":PE,v||(w.as="script"),w.crossOrigin="",w.href=y,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 ${y}`)))})}))}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)})},Sx=1120,Rs=268,zd=220,bv=400,kx=320,Ex=960,Ds=640;function va(t){return Number.isFinite(t)?Math.min(Ex,Math.max(kx,Math.round(t))):Ds}function jx(t){return Math.max(0,(t-Math.min(Sx,t))/2)}function Tu(t){const i=jx(t);return{drawer:0,reserve:0,sidebar:Rs,inset:i,insetRight:i,overlap:!1}}function xv(t,i){const r=Math.min(Ex,Math.max(kx,i)),a=Math.min(Sx,t),o=jx(t),u=zd+bv;if(r<=o)return{drawer:r,reserve:0,sidebar:Rs,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:zd,inset:0,insetRight:0,overlap:!0};const p=Math.max(0,a-h),y=Math.max(0,a-Rs-bv),v=Math.max(0,Rs-zd),g=y+v,w=g===0?0:Math.min(y,p*y/g),x=Math.min(v,Math.max(0,p-w));return{drawer:r,reserve:r,sidebar:Rs-x,inset:c,insetRight:0,overlap:!1}}function wv(t){return t.workspace?{kind:"path",root:"workspace",path:t.workspace}:t.home?{kind:"path",root:"home",path:t.home}:t.workspaceReason==="overlap"?{kind:"unavailable",notice:"files.overlap"}:t.workspaceReason==="forbidden"?{kind:"unavailable",notice:"files.denied"}:{kind:"unavailable",notice:"files.missing"}}let pa=null;function Nu(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 Sv(t){if(pa!==t)return;pa=null,document.documentElement.classList.remove("files-push","files-closing","files-resizing"),Nu(Tu(0))}function Tx(t){const{present:i,narrow:r,motion:a,width:o,resizing:u,viewport:c}=t,h=E.useRef(Symbol("drawer")),p=E.useRef(!1),y=E.useRef(i),v=E.useRef(a);y.current=i,v.current=a,E.useLayoutEffect(()=>{const g=document.documentElement,w=h.current;if(!i||r){p.current=!1,Sv(w);return}if(a==="out"&&pa!==null&&pa!==w){p.current=!1;return}pa=w;const x=a==="out"?Tu(c):xv(c,o);if(g.classList.add("files-push"),g.classList.toggle("files-closing",a==="out"),g.classList.toggle("files-resizing",u),!p.current&&a!=="out"){p.current=!0,g.classList.add("files-resizing"),Nu(Tu(c));let S=!1;const T=requestAnimationFrame(()=>{if(S=!0,pa!==w||(g.classList.remove("files-resizing"),!y.current))return;const N=v.current==="out"?Tu(window.innerWidth):xv(window.innerWidth,o);Nu(N)});return()=>{cancelAnimationFrame(T),S||(p.current=!1)}}p.current=!0,Nu(x)},[i,r,a,o,u,c]),E.useEffect(()=>()=>{p.current=!1,Sv(h.current)},[])}function rz(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 tj(t){const i=t.split(".").pop()?.toLowerCase()??"";return i==="md"||i==="markdown"}function nj(t,i){const r={};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const ij=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lj={};function kv(t,i){return(lj.jsx?rj:ij).test(t)}const aj=/[ \t\n\f\r]/g;function sj(t){return typeof t=="object"?t.type==="text"?Ev(t.value):!1:Ev(t)}function Ev(t){return t.replace(aj,"")===""}class Vs{constructor(i,r,a){this.normal=r,this.property=i,a&&(this.space=a)}}Vs.prototype.normal={};Vs.prototype.property={};Vs.prototype.space=void 0;function Nx(t,i){const r={},a={};for(const o of t)Object.assign(r,o.property),Object.assign(a,o.normal);return new Vs(r,a,i)}function nh(t){return t.toLowerCase()}class Mn{constructor(i,r){this.attribute=r,this.property=i}}Mn.prototype.attribute="";Mn.prototype.booleanish=!1;Mn.prototype.boolean=!1;Mn.prototype.commaOrSpaceSeparated=!1;Mn.prototype.commaSeparated=!1;Mn.prototype.defined=!1;Mn.prototype.mustUseProperty=!1;Mn.prototype.number=!1;Mn.prototype.overloadedBoolean=!1;Mn.prototype.property="";Mn.prototype.spaceSeparated=!1;Mn.prototype.space=void 0;let oj=0;const Ge=pl(),rn=pl(),ih=pl(),fe=pl(),Dt=pl(),fl=pl(),Yn=pl();function pl(){return 2**++oj}const rh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ge,booleanish:rn,commaOrSpaceSeparated:Yn,commaSeparated:fl,number:fe,overloadedBoolean:ih,spaceSeparated:Dt},Symbol.toStringTag,{value:"Module"})),Md=Object.keys(rh);class Ah extends Mn{constructor(i,r,a,o){let u=-1;if(super(i,r),jv(this,"space",o),typeof a=="number")for(;++u<Md.length;){const c=Md[u];jv(this,Md[u],(a&rh[c])===rh[c])}}}Ah.prototype.defined=!0;function jv(t,i,r){r&&(t[i]=r)}function wa(t){const i={},r={};for(const[a,o]of Object.entries(t.properties)){const u=new Ah(a,t.transform(t.attributes||{},a),o,t.space);t.mustUseProperty&&t.mustUseProperty.includes(a)&&(u.mustUseProperty=!0),i[a]=u,r[nh(a)]=a,r[nh(u.attribute)]=a}return new Vs(i,r,t.space)}const Cx=wa({properties:{ariaActiveDescendant:null,ariaAtomic:rn,ariaAutoComplete:null,ariaBusy:rn,ariaChecked:rn,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:Dt,ariaCurrent:null,ariaDescribedBy:Dt,ariaDetails:null,ariaDisabled:rn,ariaDropEffect:Dt,ariaErrorMessage:null,ariaExpanded:rn,ariaFlowTo:Dt,ariaGrabbed:rn,ariaHasPopup:null,ariaHidden:rn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Dt,ariaLevel:fe,ariaLive:null,ariaModal:rn,ariaMultiLine:rn,ariaMultiSelectable:rn,ariaOrientation:null,ariaOwns:Dt,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:rn,ariaReadOnly:rn,ariaRelevant:null,ariaRequired:rn,ariaRoleDescription:Dt,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:rn,ariaSetSize:fe,ariaSort:null,ariaValueMax:fe,ariaValueMin:fe,ariaValueNow:fe,ariaValueText:null,role:null},transform(t,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function Ax(t,i){return i in t?t[i]:i}function Rx(t,i){return Ax(t,i.toLowerCase())}const uj=wa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fl,acceptCharset:Dt,accessKey:Dt,action:null,allow:null,allowFullScreen:Ge,allowPaymentRequest:Ge,allowUserMedia:Ge,alpha:Ge,alt:null,as:null,async:Ge,autoCapitalize:null,autoComplete:Dt,autoFocus:Ge,autoPlay:Ge,blocking:Dt,capture:null,charSet:null,checked:Ge,cite:null,className:Dt,closedBy:null,colorSpace:null,cols:fe,colSpan:fe,command:null,commandFor:null,content:null,contentEditable:rn,controls:Ge,controlsList:Dt,coords:fe|fl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ge,defer:Ge,dir:null,dirName:null,disabled:Ge,download:ih,draggable:rn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ge,formTarget:null,headers:Dt,height:fe,hidden:ih,high:fe,href:null,hrefLang:null,htmlFor:Dt,httpEquiv:Dt,id:null,imageSizes:null,imageSrcSet:null,inert:Ge,inputMode:null,integrity:null,is:null,isMap:Ge,itemId:null,itemProp:Dt,itemRef:Dt,itemScope:Ge,itemType:Dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ge,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:Ge,muted:Ge,name:null,nonce:null,noModule:Ge,noValidate:Ge,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:Ge,optimum:fe,pattern:null,ping:Dt,placeholder:null,playsInline:Ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ge,referrerPolicy:null,rel:Dt,required:Ge,reversed:Ge,rows:fe,rowSpan:fe,sandbox:Dt,scope:null,scoped:Ge,seamless:Ge,selected:Ge,shadowRootClonable:Ge,shadowRootCustomElementRegistry:Ge,shadowRootDelegatesFocus:Ge,shadowRootMode:null,shadowRootSerializable:Ge,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:rn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:fe,step:null,style:null,tabIndex:fe,target:null,title:null,translate:null,type:null,typeMustMatch:Ge,useMap:null,value:rn,width:fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Dt,axis:null,background:null,bgColor:null,border:fe,borderColor:null,bottomMargin:fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ge,declare:Ge,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:Ge,noHref:Ge,noShade:Ge,noWrap:Ge,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:rn,standby:null,summary:null,text:null,topMargin:fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:fe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ge,disablePictureInPicture:Ge,disableRemotePlayback:Ge,exportParts:fl,part:Dt,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:Rx}),cj=wa({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:fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:fe,amplitude:fe,arabicForm:null,ascent:fe,attributeName:null,attributeType:null,azimuth:fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:fe,by:null,calcMode:null,capHeight:fe,className:Dt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:fe,diffuseConstant:fe,direction:null,display:null,dur:null,divisor:fe,dominantBaseline:null,download:Ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:fe,enableBackground:null,end:null,event:null,exponent:fe,externalResourcesRequired:null,fill:null,fillOpacity:fe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fl,g2:fl,glyphName:fl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:fe,horizOriginX:fe,horizOriginY:fe,id:null,ideographic:fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:fe,k:fe,k1:fe,k2:fe,k3:fe,k4:fe,kernelMatrix:Yn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:fe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:fe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:fe,overlineThickness:fe,paintOrder:null,panose1:null,path:null,pathLength:fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Dt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:fe,pointsAtY:fe,pointsAtZ:fe,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:fe,specularExponent:fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:fe,strikethroughThickness:fe,string:null,stroke:null,strokeDashArray:Yn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:fe,strokeOpacity:fe,strokeWidth:null,style:null,surfaceScale:fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Yn,tabIndex:fe,tableValues:null,target:null,targetX:fe,targetY:fe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Yn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:fe,underlineThickness:fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:fe,values:null,vAlphabetic:fe,vMathematical:fe,vectorEffect:null,vHanging:fe,vIdeographic:fe,version:null,vertAdvY:fe,vertOriginX:fe,vertOriginY:fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ax}),_x=wa({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()}}),Ox=wa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Rx}),zx=wa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,i){return"xml:"+i.slice(3).toLowerCase()}}),fj={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"},dj=/[A-Z]/g,Tv=/-[a-z]/g,hj=/^data[-\w.:]+$/i;function mj(t,i){const r=nh(i);let a=i,o=Mn;if(r in t.normal)return t.property[t.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&hj.test(i)){if(i.charAt(4)==="-"){const u=i.slice(5).replace(Tv,yj);a="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=i.slice(4);if(!Tv.test(u)){let c=u.replace(dj,pj);c.charAt(0)!=="-"&&(c="-"+c),i="data"+c}}o=Ah}return new o(a,i)}function pj(t){return"-"+t.toLowerCase()}function yj(t){return t.charAt(1).toUpperCase()}const gj=Nx([Cx,uj,_x,Ox,zx],"html"),Rh=Nx([Cx,cj,_x,Ox,zx],"svg");function vj(t){return t.join(" ").trim()}var Nv=/\/\*(?:[^*]|\*(?!\/))*\*\//g,bj=/\n/g,xj=/^\s*/,wj=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Sj=/^:\s*/,kj=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,Ej=/^[;\s]*/,jj=`
|
|
21
|
+
`,Cv="/",Av="*",Ts="",Tj="comment",Nj="declaration";function Cj(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(bj);T&&(r+=T.length);var N=S.lastIndexOf(jj);a=~N?S.length-N:a+S.length}function u(){var S={line:r,column:a};return function(T){return T.position=new c(S),y(),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 p(S){var T=S.exec(t);if(T){var N=T[0];return o(N),t=t.slice(N.length),T}}function y(){p(xj)}function v(S){for(var T;T=g();)S.push(T);return S}function g(){var S=u();if(!(Cv!=t.charAt(0)||Av!=t.charAt(1))){for(var T=2;Ts!=t.charAt(T)&&(Av!=t.charAt(T)||Cv!=t.charAt(T+1));)++T;if(T+=2,Ts===t.charAt(T-1))return h("End of comment missing");var N=t.slice(2,T-2);return a+=2,o(N),t=t.slice(T),a+=2,S({type:Tj,comment:N})}}function w(){var S=u(),T=p(wj);if(T){if(g(),!p(Sj))return h("property missing ':'");var N=p(kj),j=S({type:Nj,property:T[0].replace(Nv,Ts).trim(),value:N?N[0].replace(Nv,Ts).trim():Ts});return p(Ej),j}}function x(){var S=[];v(S);for(var T;T=w();)S.push(T),v(S);return S}return y(),x()}function Aj(t,i){let r=null;if(!t||typeof t!="string")return r;const a=Cj(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 Mx=qx("end"),_h=qx("start");function qx(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 Rj(t){const i=_h(t),r=Mx(t);if(i&&r)return{start:i,end:r}}function Os(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Rv(t.position):"start"in t||"end"in t?Rv(t):"line"in t||"column"in t?lh(t):""}function lh(t){return _v(t&&t.line)+":"+_v(t&&t.column)}function Rv(t){return lh(t&&t.start)+"-"+lh(t&&t.end)}function _v(t){return t&&typeof t=="number"?t:1}class Gu 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 p=a.indexOf(":");p===-1?u.ruleId=a:(u.source=a.slice(0,p),u.ruleId=a.slice(p+1))}if(!u.place&&u.ancestors){const p=u.ancestors[u.ancestors.length-1];p&&(u.place=p.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=Os(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(Gu.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 Oh={}.hasOwnProperty,_j=new Map,Oj=/[A-Z]/g,zj=/-([a-z])/g,Mj=new Set(["table","tbody","thead","tfoot","tr"]),qj=new Set(["td","th"]),Dx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Dj(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=Fj(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=Yj(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"?Rh:gj,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},u=Lx(o,t,void 0);return u&&typeof u!="string"?u:o.create(t,o.Fragment,{children:u||void 0},void 0)}function Lx(t,i,r){if(i.type==="element")return Lj(t,i,r);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return Bj(t,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return Hj(t,i,r);if(i.type==="mdxjsEsm")return Uj(t,i);if(i.type==="root")return Ij(t,i,r);if(i.type==="text")return Vj(t,i)}function Lj(t,i,r){const a=t.schema;let o=a;i.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=Rh,t.schema=o),t.ancestors.push(i);const u=Ux(t,i.tagName,!1),c=Gj(t,i);let h=Mh(t,i);return Mj.has(i.tagName)&&(h=h.filter(function(p){return typeof p=="string"?!sj(p):!0})),Bx(t,c,u,i),zh(c,h),t.ancestors.pop(),t.schema=a,t.create(i,u,c,r)}function Bj(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)}Ls(t,i.position)}function Uj(t,i){if(i.data&&i.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(i.data.estree);Ls(t,i.position)}function Hj(t,i,r){const a=t.schema;let o=a;i.name==="svg"&&a.space==="html"&&(o=Rh,t.schema=o),t.ancestors.push(i);const u=i.name===null?t.Fragment:Ux(t,i.name,!0),c=$j(t,i),h=Mh(t,i);return Bx(t,c,u,i),zh(c,h),t.ancestors.pop(),t.schema=a,t.create(i,u,c,r)}function Ij(t,i,r){const a={};return zh(a,Mh(t,i)),t.create(i,t.Fragment,a,r)}function Vj(t,i){return i.value}function Bx(t,i,r,a){typeof r!="string"&&r!==t.Fragment&&t.passNode&&(i.node=a)}function zh(t,i){if(i.length>0){const r=i.length>1?i:i[0];r&&(t.children=r)}}function Yj(t,i,r){return a;function a(o,u,c,h){const y=Array.isArray(c.children)?r:i;return h?y(u,c,h):y(u,c)}}function Fj(t,i){return r;function r(a,o,u,c){const h=Array.isArray(u.children),p=_h(a);return i(o,u,c,h,{columnNumber:p?p.column-1:void 0,fileName:t,lineNumber:p?p.line:void 0},void 0)}}function Gj(t,i){const r={};let a,o;for(o in i.properties)if(o!=="children"&&Oh.call(i.properties,o)){const u=Xj(t,o,i.properties[o]);if(u){const[c,h]=u;t.tableCellAlignToStyle&&c==="align"&&typeof h=="string"&&qj.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 $j(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 Ls(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 Ls(t,i.position);else u=a.value===null?!0:a.value;r[o]=u}return r}function Mh(t,i){const r=[];let a=-1;const o=t.passKeys?new Map:_j;for(;++a<i.children.length;){const u=i.children[a];let c;if(t.passKeys){const p=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(p){const y=o.get(p)||0;c=p+"-"+y,o.set(p,y+1)}}const h=Lx(t,u,c);h!==void 0&&r.push(h)}return r}function Xj(t,i,r){if(r==null||typeof r=="number"&&Number.isNaN(r))return;const a=mj(t.schema,i);return Array.isArray(r)&&(r=a.commaSeparated?nj(r):vj(r)),a.property==="style"?["style",typeof r=="object"?t.stylePropertyNameCase==="dom"?r:Zj(r):Qj(t,String(r))]:[t.elementAttributeNameCase==="react"&&a.space?fj[a.property]||a.property:a.attribute,r]}function Qj(t,i){const r={};try{Aj(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(zj,Pj))),r[u]=o}})}catch(a){if(t.ignoreInvalidStyle)return{};const o=a,u=new Gu("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=Dx+"#cannot-parse-style-attribute",u}return r}function Ux(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=kv(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=kv(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(a.type==="Literal"){const o=a.value;return Oh.call(t.components,o)?t.components[o]:o}if(t.evaluater)return t.evaluater.evaluateExpression(a);Ls(t)}function Ls(t,i){const r=new Gu("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=Dx+"#cannot-handle-mdx-estrees-without-createevaluater",r}function Zj(t){const i={};let r;for(r in t)Oh.call(t,r)&&(i[Kj(r)]=t[r]);return i}function Kj(t){if(t.slice(0,2)==="--")return t;let i=t.replace(Oj,Jj);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function Jj(t){return"-"+t.toLowerCase()}function Pj(t,i){return i.toUpperCase()}const qd={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"]},Wj={};function $u(t,i){const r=Wj,a=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Hx(t,a,o)}function Hx(t,i,r){if(eT(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 Ov(t.children,i,r)}return Array.isArray(t)?Ov(t,i,r):""}function Ov(t,i,r){const a=[];let o=-1;for(;++o<t.length;)a[o]=Hx(t[o],i,r);return a.join("")}function eT(t){return!!(t&&typeof t=="object")}const zv=document.createElement("i");function qh(t){const i="&"+t+";";zv.innerHTML=i;const r=zv.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 ti(t,i){return t.length>0?(fi(t,t.length,0,i),t):i}const Mv={}.hasOwnProperty;function Ix(t){const i={};let r=-1;for(;++r<t.length;)tT(i,t[r]);return i}function tT(t,i){let r;for(r in i){const o=(Mv.call(t,r)?t[r]:void 0)||(t[r]={}),u=i[r];let c;if(u)for(c in u){Mv.call(o,c)||(o[c]=[]);const h=u[c];nT(o[c],Array.isArray(h)?h:h?[h]:[])}}}function nT(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 Vx(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 gn=qr(/[A-Za-z]/),vn=qr(/[\dA-Za-z]/),iT=qr(/[#-'*+\--9=?A-Z^-~]/);function Mu(t){return t!==null&&(t<32||t===127)}const ah=qr(/\d/),rT=qr(/[\dA-Fa-f]/),Yx=qr(/[!-/:-@[-`{-~]/);function He(t){return t!==null&&t<-2}function Lt(t){return t!==null&&(t<0||t===32)}function tt(t){return t===-2||t===-1||t===32}const Ys=qr(new RegExp("\\p{P}|\\p{S}","u")),dl=qr(/\s/);function qr(t){return i;function i(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function Sa(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 xt(t,i,r,a){const o=a?a-1:1/0;let u=0;return c;function c(p){return tt(p)?(t.enter(r),h(p)):i(p)}function h(p){return tt(p)&&u++<o?(t.consume(p),h):(t.exit(r),i(p))}}function Fx(t,i,r,a,o,u){let c=0;return h;function h(v){return tt(v)?(t.enter(a),p(v)):y(v)}function p(v){return tt(v)&&c<u?(t.consume(v),c++,p):(t.exit(a),y(v))}function y(v){return c>=o?i(v):r(v)}}const lT={tokenize:aT};function aT(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"),xt(t,i,"linePrefix")}function o(h){return t.enter("paragraph"),u(h)}function u(h){const p=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=p),r=p,c(h)}function c(h){if(h===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(h);return}return He(h)?(t.consume(h),t.exit("chunkText"),u):(t.consume(h),c)}}let qu=class{constructor(){this.index=new Map,this.map=[]}add(i,r,a){qv(this,i,r,a,!1)}addBefore(i,r,a){qv(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 qv(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 sT={tokenize:oT},Dv={tokenize:uT};function oT(t){const i=this,r=[];let a=0,o,u,c;return h;function h(B){if(a<r.length){const K=r[a];return i.containerState=K[1],t.attempt(K[0].continuation,p,y)(B)}return y(B)}function p(B){if(a++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,o&&M();const K=i.events.length;let ee=K,A;for(;ee--;)if(i.events[ee][0]==="exit"&&i.events[ee][1].type==="chunkFlow"){A=i.events[ee][1].end;break}j(a);let D=K;for(;D<i.events.length;)i.events[D][1].end={...A},D++;const Y=new qu;return Y.add(ee+1,0,i.events.slice(K)),Y.add(K,D-K,[]),Y.consume(i.events),y(B)}return h(B)}function y(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(Dv,v,g)(B)}function v(B){return o&&M(),j(a),w(B)}function g(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(Dv,x,S)(B)}function x(B){return a++,r.push([i.currentConstruct,i.containerState]),w(B)}function S(B){if(B===null){o&&M(),j(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){N(t.exit("chunkFlow"),!0),j(0),t.consume(B);return}return He(B)?(t.consume(B),N(t.exit("chunkFlow")),a=0,i.interrupt=void 0,h):(t.consume(B),T)}function N(B,K){const ee=i.sliceStream(B);if(K&&ee.push(null),B.previous=u,u&&(u.next=B),u=B,o.defineSkip(B.start),o.write(ee),i.parser.lazy[B.start.line]){let A=o.events.length;for(;A--;)if(o.events[A][1].start.offset<c&&(!o.events[A][1].end||o.events[A][1].end.offset>c))return;const D=i.events.length;let Y=D,le,O;for(;Y--;)if(i.events[Y][0]==="exit"&&i.events[Y][1].type==="chunkFlow"){if(le){O=i.events[Y][1].end;break}le=!0}for(j(a),A=D;A<i.events.length;)i.events[A][1].end={...O},A++;const V=new qu;V.add(Y+1,0,i.events.slice(D)),V.add(D,A-D,[]),V.consume(i.events)}}function j(B){let K=r.length;for(;K-- >B;){const ee=r[K];i.containerState=ee[1],ee[0].exit.call(i,t)}r.length=B}function M(){o.write([null]),u=void 0,o=void 0,i.containerState._closeFlow=void 0}}function uT(t,i,r){return xt(t,t.attempt(this.parser.constructs.document,i,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function zr(t){if(t===null||Lt(t)||dl(t))return 1;if(Ys(t))return 2}function Xu(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 sh={name:"attention",resolveAll:cT,tokenize:fT};function cT(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};Lv(c,-u),Lv(h,u);const p={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...t[o][1].end}},y={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}},g={type:u>1?"strong":"emphasis",start:{...p.start},end:{...y.end}};t[o][1].end={...p.start},t[r][1].start={...y.end},a=[],t[o][1].end.offset-t[o][1].start.offset&&(a=ti(a,[["enter",t[o][1],i],["exit",t[o][1],i]])),a=ti(a,[["enter",g,i],["enter",p,i],["exit",p,i],["enter",v,i]]),a=ti(a,Xu(i.parser.constructs.insideSpan.null,t.slice(o+1,r),i)),a=ti(a,[["exit",v,i],["enter",y,i],["exit",y,i],["exit",g,i]]);let w=0;t[r][1].end.offset-t[r][1].start.offset&&(w=2,a=ti(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 fT(t,i){const r=this.parser.constructs.attentionMarkers.null,a=this.previous,o=zr(a);let u;return c;function c(p){return u=p,t.enter("attentionSequence"),h(p)}function h(p){if(p===u)return t.consume(p),h;const y=t.exit("attentionSequence"),v=zr(p),g=!v||v===2&&o||r.includes(p)&&p!==42&&p!==95,w=!o||o===2&&v||r.includes(a)&&a!==42&&a!==95;return y._open=!!(u===42?g:g&&(o||!w)),y._close=!!(u===42?w:w&&(v||!g)),i(p)}}function Lv(t,i){t.column+=i,t.offset+=i,t._bufferIndex+=i}const dT={name:"autolink",tokenize:hT};function hT(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 gn(x)?(t.consume(x),c):x===64?r(x):y(x)}function c(x){return x===43||x===45||x===46||vn(x)?(a=1,h(x)):y(x)}function h(x){return x===58?(t.consume(x),a=0,p):(x===43||x===45||x===46||vn(x))&&a++<32?(t.consume(x),h):(a=0,y(x))}function p(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||Mu(x)?r(x):(t.consume(x),p)}function y(x){return x===64?(t.consume(x),v):iT(x)?(t.consume(x),y):r(x)}function v(x){return vn(x)?g(x):r(x)}function g(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:g;return t.consume(x),S}return r(x)}}const Fs={partial:!0,tokenize:mT};function mT(t,i,r){return a;function a(u){return tt(u)?xt(t,o,"linePrefix")(u):o(u)}function o(u){return u===null||He(u)?i(u):r(u)}}const Gx={continuation:{tokenize:yT},exit:gT,name:"blockQuote",tokenize:pT};function pT(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 tt(c)?(t.enter("blockQuotePrefixWhitespace"),t.consume(c),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),i):(t.exit("blockQuotePrefix"),i(c))}}function yT(t,i,r){const a=this;return o;function o(c){return tt(c)?xt(t,u,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):u(c)}function u(c){return t.attempt(Gx,i,r)(c)}}function gT(t){t.exit("blockQuote")}const $x={name:"characterEscape",tokenize:vT};function vT(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 Yx(u)?(t.enter("characterEscapeValue"),t.consume(u),t.exit("characterEscapeValue"),t.exit("characterEscape"),i):r(u)}}const Xx={name:"characterReference",tokenize:bT};function bT(t,i,r){const a=this;let o=0,u,c;return h;function h(g){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(g),t.exit("characterReferenceMarker"),p}function p(g){return g===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(g),t.exit("characterReferenceMarkerNumeric"),y):(t.enter("characterReferenceValue"),u=31,c=vn,v(g))}function y(g){return g===88||g===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(g),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),u=6,c=rT,v):(t.enter("characterReferenceValue"),u=7,c=ah,v(g))}function v(g){if(g===59&&o){const w=t.exit("characterReferenceValue");return c===vn&&!qh(a.sliceSerialize(w))?r(g):(t.enter("characterReferenceMarker"),t.consume(g),t.exit("characterReferenceMarker"),t.exit("characterReference"),i)}return c(g)&&o++<u?(t.consume(g),v):r(g)}}const oh={partial:!0,tokenize:xT};function xT(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 Bv={concrete:!0,name:"codeFenced",tokenize:wT};function wT(t,i,r){const a=this,o={partial:!0,tokenize:ee};let u=0,c=0,h;return p;function p(A){return y(A)}function y(A){const D=a.events[a.events.length-1];return u=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,h=A,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),v(A)}function v(A){return A===h?(c++,t.consume(A),v):c<3?r(A):(t.exit("codeFencedFenceSequence"),tt(A)?xt(t,g,"whitespace")(A):g(A))}function g(A){return A===null||He(A)?(t.exit("codeFencedFence"),a.interrupt?i(A):t.check(oh,T,K)(A)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),w(A))}function w(A){return A===null||He(A)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),g(A)):tt(A)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),xt(t,x,"whitespace")(A)):A===96&&A===h?r(A):(t.consume(A),w)}function x(A){return A===null||He(A)?g(A):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),S(A))}function S(A){return A===null||He(A)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),g(A)):A===96&&A===h?r(A):(t.consume(A),S)}function T(A){return t.attempt(o,K,N)(A)}function N(A){return t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),j}function j(A){return u>0&&tt(A)?xt(t,M,"linePrefix",u+1)(A):M(A)}function M(A){return A===null||He(A)?t.check(oh,T,K)(A):(t.enter("codeFlowValue"),B(A))}function B(A){return A===null||He(A)?(t.exit("codeFlowValue"),M(A)):(t.consume(A),B)}function K(A){return t.exit("codeFenced"),i(A)}function ee(A,D,Y){let le=0;return O;function O(ge){return A.enter("lineEnding"),A.consume(ge),A.exit("lineEnding"),V}function V(ge){return A.enter("codeFencedFence"),tt(ge)?xt(A,Z,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ge):Z(ge)}function Z(ge){return ge===h?(A.enter("codeFencedFenceSequence"),ke(ge)):Y(ge)}function ke(ge){return ge===h?(le++,A.consume(ge),ke):le>=c?(A.exit("codeFencedFenceSequence"),tt(ge)?xt(A,oe,"whitespace")(ge):oe(ge)):Y(ge)}function oe(ge){return ge===null||He(ge)?(A.exit("codeFencedFence"),D(ge)):Y(ge)}}}const Dd={name:"codeIndented",tokenize:kT},ST={partial:!0,tokenize:ET};function kT(t,i,r){return a;function a(h){return t.enter("codeIndented"),Fx(t,o,r,"linePrefix",4,4)(h)}function o(h){return h===null?c(h):He(h)?t.attempt(ST,o,c)(h):(t.enter("codeFlowValue"),u(h))}function u(h){return h===null||He(h)?(t.exit("codeFlowValue"),o(h)):(t.consume(h),u)}function c(h){return t.exit("codeIndented"),i(h)}}function ET(t,i,r){const a=this;return o;function o(c){return a.parser.lazy[a.now().line]?r(c):He(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),o):Fx(t,i,u,"linePrefix",4,4)(c)}function u(c){return He(c)?o(c):r(c)}}const jT={name:"codeText",previous:NT,resolve:TT,tokenize:CT};function TT(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 NT(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function CT(t,i,r){let a=0,o,u;return c;function c(g){return t.enter("codeText"),t.enter("codeTextSequence"),h(g)}function h(g){return g===96?(t.consume(g),a++,h):(t.exit("codeTextSequence"),p(g))}function p(g){return g===null?r(g):g===32?(t.enter("space"),t.consume(g),t.exit("space"),p):g===96?(u=t.enter("codeTextSequence"),o=0,v(g)):He(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),p):(t.enter("codeTextData"),y(g))}function y(g){return g===null||g===32||g===96||He(g)?(t.exit("codeTextData"),p(g)):(t.consume(g),y)}function v(g){return g===96?(t.consume(g),o++,v):o===a?(t.exit("codeTextSequence"),t.exit("codeText"),i(g)):(u.type="codeTextData",y(g))}}class AT{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&&Ns(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),Ns(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),Ns(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);Ns(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);Ns(this.left,r.reverse())}}}function Ns(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 Qx(t){const i={};let r=-1,a,o,u,c,h,p,y;const v=new AT(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"&&(p=a[1]._tokenizer.events,u=0,u<p.length&&p[u][1].type==="lineEndingBlank"&&(u+=2),u<p.length&&p[u][1].type==="content"))for(;++u<p.length&&p[u][1].type!=="content";)p[u][1].type==="chunkText"&&(p[u][1]._isInFirstContentOfListItem=!0,u++);if(a[0]==="enter")a[1].contentType&&(Object.assign(i,RT(v,r)),r=i[r],y=!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)),!y}function RT(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,p=[],y={};let v,g,w=-1,x=r,S=0,T=0;const N=[T];for(;x;){for(;t.get(++o)[1]!==x;);u.push(o),x._tokenizer||(v=a.sliceStream(x),x.next||v.push(null),g&&c.defineSkip(x.start),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(v),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=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,N.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):N.pop(),w=N.length;w--;){const j=h.slice(N[w],N[w+1]),M=u.pop();p.push([M,M+j.length-1]),t.splice(M,2,j)}for(p.reverse(),w=-1;++w<p.length;)y[S+p[w][0]]=S+p[w][1],S+=p[w][1]-p[w][0]-1;return y}const _T={resolve:zT,tokenize:MT},OT={partial:!0,tokenize:qT};function zT(t){return Qx(t),t}function MT(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):He(h)?t.check(OT,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 qT(t,i,r){const a=this;return o;function o(c){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),xt(t,u,"linePrefix")}function u(c){if(c===null||He(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 Zx(t,i,r,a,o,u,c,h,p){const y=p||Number.POSITIVE_INFINITY;let v=0;return g;function g(j){return j===60?(t.enter(a),t.enter(o),t.enter(u),t.consume(j),t.exit(u),w):j===null||j===32||j===41||Mu(j)?r(j):(t.enter(a),t.enter(c),t.enter(h),t.enter("chunkString",{contentType:"string"}),T(j))}function w(j){return j===62?(t.enter(u),t.consume(j),t.exit(u),t.exit(o),t.exit(a),i):(t.enter(h),t.enter("chunkString",{contentType:"string"}),x(j))}function x(j){return j===62?(t.exit("chunkString"),t.exit(h),w(j)):j===null||j===60||He(j)?r(j):(t.consume(j),j===92?S:x)}function S(j){return j===60||j===62||j===92?(t.consume(j),x):x(j)}function T(j){return!v&&(j===null||j===41||Lt(j))?(t.exit("chunkString"),t.exit(h),t.exit(c),t.exit(a),i(j)):v<y&&j===40?(t.consume(j),v++,T):j===41?(t.consume(j),v--,T):j===null||j===32||j===40||Mu(j)?r(j):(t.consume(j),j===92?N:T)}function N(j){return j===40||j===41||j===92?(t.consume(j),T):T(j)}}function Kx(t,i,r,a,o,u){const c=this;let h=0,p;return y;function y(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&&!p||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):He(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),v):(t.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||x===91||x===93||He(x)||h++>999?(t.exit("chunkString"),v(x)):(t.consume(x),p||(p=!tt(x)),x===92?w:g)}function w(x){return x===91||x===92||x===93?(t.consume(x),h++,g):g(x)}}function Jx(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,p):r(w)}function p(w){return w===c?(t.enter(o),t.consume(w),t.exit(o),t.exit(a),i):(t.enter(u),y(w))}function y(w){return w===c?(t.exit(u),p(c)):w===null?r(w):He(w)?(t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),xt(t,y,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),v(w))}function v(w){return w===c||w===null||He(w)?(t.exit("chunkString"),y(w)):(t.consume(w),w===92?g:v)}function g(w){return w===c||w===92?(t.consume(w),v):v(w)}}function zs(t,i){let r;return a;function a(o){return He(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r=!0,a):tt(o)?xt(t,a,r?"linePrefix":"lineSuffix")(o):i(o)}}const DT={name:"definition",tokenize:BT},LT={partial:!0,tokenize:UT};function BT(t,i,r){const a=this;let o;return u;function u(x){return t.enter("definition"),c(x)}function c(x){return Kx.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"),p):r(x)}function p(x){return Lt(x)?zs(t,y)(x):y(x)}function y(x){return Zx(t,v,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function v(x){return t.attempt(LT,g,g)(x)}function g(x){return tt(x)?xt(t,w,"whitespace")(x):w(x)}function w(x){return x===null||He(x)?(t.exit("definition"),a.parser.defined.push(o),i(x)):r(x)}}function UT(t,i,r){return a;function a(h){return Lt(h)?zs(t,o)(h):r(h)}function o(h){return Jx(t,u,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function u(h){return tt(h)?xt(t,c,"whitespace")(h):c(h)}function c(h){return h===null||He(h)?i(h):r(h)}}const HT={name:"hardBreakEscape",tokenize:IT};function IT(t,i,r){return a;function a(u){return t.enter("hardBreakEscape"),t.consume(u),o}function o(u){return He(u)?(t.exit("hardBreakEscape"),i(u)):r(u)}}const VT={name:"headingAtx",resolve:YT,tokenize:FT};function YT(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 FT(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||Lt(v)?(t.exit("atxHeadingSequence"),h(v)):r(v)}function h(v){return v===35?(t.enter("atxHeadingSequence"),p(v)):v===null||He(v)?(t.exit("atxHeading"),i(v)):tt(v)?xt(t,h,"whitespace")(v):(t.enter("atxHeadingText"),y(v))}function p(v){return v===35?(t.consume(v),p):(t.exit("atxHeadingSequence"),h(v))}function y(v){return v===null||v===35||Lt(v)?(t.exit("atxHeadingText"),h(v)):(t.consume(v),y)}}const Px=["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"],uh=["pre","script","style","textarea"],GT={concrete:!0,name:"htmlFlow",resolveTo:XT,tokenize:QT},$T={partial:!0,tokenize:ZT};function XT(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 QT(t,i,r){const a=this;let o,u,c,h,p;return y;function y(q){return v(q)}function v(q){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(q),g}function g(q){return q===33?(t.consume(q),w):q===47?(t.consume(q),u=!0,T):q===63?(t.consume(q),o=3,a.interrupt?i:R):gn(q)?(t.consume(q),c=String.fromCharCode(q),N):r(q)}function w(q){return q===45?(t.consume(q),o=2,x):q===91?(t.consume(q),o=5,h=0,S):gn(q)?(t.consume(q),o=4,a.interrupt?i:R):r(q)}function x(q){return q===45?(t.consume(q),a.interrupt?i:R):r(q)}function S(q){const z="CDATA[";return q===z.charCodeAt(h++)?(t.consume(q),h===z.length?a.interrupt?i:Z:S):r(q)}function T(q){return gn(q)?(t.consume(q),c=String.fromCharCode(q),N):r(q)}function N(q){if(q===null||q===47||q===62||Lt(q)){const z=q===47,te=c.toLowerCase();return!z&&!u&&uh.includes(te)?(o=1,a.interrupt?i(q):Z(q)):Px.includes(c.toLowerCase())?(o=6,z?(t.consume(q),j):a.interrupt?i(q):Z(q)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?r(q):u?M(q):B(q))}return q===45||vn(q)?(t.consume(q),c+=String.fromCharCode(q),N):r(q)}function j(q){return q===62?(t.consume(q),a.interrupt?i:Z):r(q)}function M(q){return tt(q)?(t.consume(q),M):O(q)}function B(q){return q===47?(t.consume(q),O):q===58||q===95||gn(q)?(t.consume(q),K):tt(q)?(t.consume(q),B):O(q)}function K(q){return q===45||q===46||q===58||q===95||vn(q)?(t.consume(q),K):ee(q)}function ee(q){return q===61?(t.consume(q),A):tt(q)?(t.consume(q),ee):B(q)}function A(q){return q===null||q===60||q===61||q===62||q===96?r(q):q===34||q===39?(t.consume(q),p=q,D):tt(q)?(t.consume(q),A):Y(q)}function D(q){return q===p?(t.consume(q),p=null,le):q===null||He(q)?r(q):(t.consume(q),D)}function Y(q){return q===null||q===34||q===39||q===47||q===60||q===61||q===62||q===96||Lt(q)?ee(q):(t.consume(q),Y)}function le(q){return q===47||q===62||tt(q)?B(q):r(q)}function O(q){return q===62?(t.consume(q),V):r(q)}function V(q){return q===null||He(q)?Z(q):tt(q)?(t.consume(q),V):r(q)}function Z(q){return q===45&&o===2?(t.consume(q),re):q===60&&o===1?(t.consume(q),ce):q===62&&o===4?(t.consume(q),Ke):q===63&&o===3?(t.consume(q),R):q===93&&o===5?(t.consume(q),Te):He(q)&&(o===6||o===7)?(t.exit("htmlFlowData"),t.check($T,Ie,ke)(q)):q===null||He(q)?(t.exit("htmlFlowData"),ke(q)):(t.consume(q),Z)}function ke(q){return t.check(oh,oe,Ie)(q)}function oe(q){return t.enter("lineEnding"),t.consume(q),t.exit("lineEnding"),ge}function ge(q){return q===null||He(q)?ke(q):(t.enter("htmlFlowData"),Z(q))}function re(q){return q===45?(t.consume(q),R):Z(q)}function ce(q){return q===47?(t.consume(q),c="",xe):Z(q)}function xe(q){if(q===62){const z=c.toLowerCase();return uh.includes(z)?(t.consume(q),Ke):Z(q)}return gn(q)&&c.length<8?(t.consume(q),c+=String.fromCharCode(q),xe):Z(q)}function Te(q){return q===93?(t.consume(q),R):Z(q)}function R(q){return q===62?(t.consume(q),Ke):q===45&&o===2?(t.consume(q),R):Z(q)}function Ke(q){return q===null||He(q)?(t.exit("htmlFlowData"),Ie(q)):(t.consume(q),Ke)}function Ie(q){return t.exit("htmlFlow"),i(q)}}function ZT(t,i,r){return a;function a(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(Fs,i,r)}}const KT={name:"htmlText",tokenize:JT};function JT(t,i,r){const a=this;let o,u,c;return h;function h(R){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(R),p}function p(R){return R===33?(t.consume(R),y):R===47?(t.consume(R),ee):R===63?(t.consume(R),B):gn(R)?(t.consume(R),Y):r(R)}function y(R){return R===45?(t.consume(R),v):R===91?(t.consume(R),u=0,S):gn(R)?(t.consume(R),M):r(R)}function v(R){return R===45?(t.consume(R),x):r(R)}function g(R){return R===null?r(R):R===45?(t.consume(R),w):He(R)?(c=g,ce(R)):(t.consume(R),g)}function w(R){return R===45?(t.consume(R),x):g(R)}function x(R){return R===62?re(R):R===45?w(R):g(R)}function S(R){const Ke="CDATA[";return R===Ke.charCodeAt(u++)?(t.consume(R),u===Ke.length?T:S):r(R)}function T(R){return R===null?r(R):R===93?(t.consume(R),N):He(R)?(c=T,ce(R)):(t.consume(R),T)}function N(R){return R===93?(t.consume(R),j):T(R)}function j(R){return R===62?re(R):R===93?(t.consume(R),j):T(R)}function M(R){return R===null||R===62?re(R):He(R)?(c=M,ce(R)):(t.consume(R),M)}function B(R){return R===null?r(R):R===63?(t.consume(R),K):He(R)?(c=B,ce(R)):(t.consume(R),B)}function K(R){return R===62?re(R):B(R)}function ee(R){return gn(R)?(t.consume(R),A):r(R)}function A(R){return R===45||vn(R)?(t.consume(R),A):D(R)}function D(R){return He(R)?(c=D,ce(R)):tt(R)?(t.consume(R),D):re(R)}function Y(R){return R===45||vn(R)?(t.consume(R),Y):R===47||R===62||Lt(R)?le(R):r(R)}function le(R){return R===47?(t.consume(R),re):R===58||R===95||gn(R)?(t.consume(R),O):He(R)?(c=le,ce(R)):tt(R)?(t.consume(R),le):re(R)}function O(R){return R===45||R===46||R===58||R===95||vn(R)?(t.consume(R),O):V(R)}function V(R){return R===61?(t.consume(R),Z):He(R)?(c=V,ce(R)):tt(R)?(t.consume(R),V):le(R)}function Z(R){return R===null||R===60||R===61||R===62||R===96?r(R):R===34||R===39?(t.consume(R),o=R,ke):He(R)?(c=Z,ce(R)):tt(R)?(t.consume(R),Z):(t.consume(R),oe)}function ke(R){return R===o?(t.consume(R),o=void 0,ge):R===null?r(R):He(R)?(c=ke,ce(R)):(t.consume(R),ke)}function oe(R){return R===null||R===34||R===39||R===60||R===61||R===96?r(R):R===47||R===62||Lt(R)?le(R):(t.consume(R),oe)}function ge(R){return R===47||R===62||Lt(R)?le(R):r(R)}function re(R){return R===62?(t.consume(R),t.exit("htmlTextData"),t.exit("htmlText"),i):r(R)}function ce(R){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),xe}function xe(R){return tt(R)?xt(t,Te,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):Te(R)}function Te(R){return t.enter("htmlTextData"),c(R)}}const Dh={name:"labelEnd",resolveAll:tN,resolveTo:nN,tokenize:iN},PT={tokenize:rN},WT={tokenize:lN},eN={tokenize:aN};function tN(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 nN(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}},p={type:"label",start:{...t[o][1].start},end:{...t[u][1].end}},y={type:"labelText",start:{...t[o+a+2][1].end},end:{...t[u-2][1].start}};return c=[["enter",h,i],["enter",p,i]],c=ti(c,t.slice(o+1,o+a+3)),c=ti(c,[["enter",y,i]]),c=ti(c,Xu(i.parser.constructs.insideSpan.null,t.slice(o+a+4,u-3),i)),c=ti(c,[["exit",y,i],t[u-2],t[u-1],["exit",p,i]]),c=ti(c,t.slice(u+1)),c=ti(c,[["exit",h,i]]),fi(t,o,t.length,c),t}function iN(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?g(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"),p):r(w)}function p(w){return w===40?t.attempt(PT,v,c?v:g)(w):w===91?t.attempt(WT,v,c?y:g)(w):c?v(w):g(w)}function y(w){return t.attempt(eN,v,g)(w)}function v(w){return o.pop(),i(w)}function g(w){return u._balanced=!0,r(w)}}function rN(t,i,r){return a;function a(g){return t.enter("resource"),t.enter("resourceMarker"),t.consume(g),t.exit("resourceMarker"),o}function o(g){return Lt(g)?zs(t,u)(g):u(g)}function u(g){return g===41?v(g):Zx(t,c,h,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return Lt(g)?zs(t,p)(g):v(g)}function h(g){return r(g)}function p(g){return g===34||g===39||g===40?Jx(t,y,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):v(g)}function y(g){return Lt(g)?zs(t,v)(g):v(g)}function v(g){return g===41?(t.enter("resourceMarker"),t.consume(g),t.exit("resourceMarker"),t.exit("resource"),i):r(g)}}function lN(t,i,r){const a=this;return o;function o(h){return Kx.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 aN(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 sN={name:"labelStartImage",resolveAll:Dh.resolveAll,tokenize:oN};function oN(t,i,r){const a=this;let o;return u;function u(p){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(p),t.exit("labelImageMarker"),c}function c(p){return p===91?(t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),o=t.exit("labelImage"),h):r(p)}function h(p){return p===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(p):(a._labelStarts=a._labelStarts||[],a._labelStarts.push(o),i(p))}}const uN={name:"labelStartLink",resolveAll:Dh.resolveAll,tokenize:cN};function cN(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 Ld={name:"lineEnding",tokenize:fN};function fN(t,i){return r;function r(a){return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),xt(t,i,"linePrefix")}}const Cu={name:"thematicBreak",tokenize:dN};function dN(t,i,r){let a=0,o;return u;function u(y){return t.enter("thematicBreak"),c(y)}function c(y){return o=y,h(y)}function h(y){return y===o?(t.enter("thematicBreakSequence"),p(y)):a>=3&&(y===null||He(y))?(t.exit("thematicBreak"),i(y)):r(y)}function p(y){return y===o?(t.consume(y),a++,p):(t.exit("thematicBreakSequence"),tt(y)?xt(t,h,"whitespace")(y):h(y))}}const _n={continuation:{tokenize:yN},exit:vN,name:"list",tokenize:pN},hN={partial:!0,tokenize:bN},mN={partial:!0,tokenize:gN};function pN(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:ah(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(Cu,r,y)(x):y(x);if(!a.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),p(x)}return r(x)}function p(x){return ah(x)&&++c<10?(t.consume(x),p):(!a.interrupt||c<2)&&(a.containerState.marker?x===a.containerState.marker:x===41||x===46)?(t.exit("listItemValue"),y(x)):r(x)}function y(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||x,t.check(Fs,a.interrupt?r:v,t.attempt(hN,w,g))}function v(x){return a.containerState.initialBlankLine=!0,u++,w(x)}function g(x){return tt(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 yN(t,i,r){const a=this;return a.containerState._closeFlow=void 0,t.check(Fs,o,u);function o(h){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,xt(t,i,"listItemIndent",a.containerState.size+1)(h)}function u(h){return a.containerState.furtherBlankLines||!tt(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(mN,i,c)(h))}function c(h){return a.containerState._closeFlow=!0,a.interrupt=void 0,xt(t,t.attempt(_n,i,r),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function gN(t,i,r){const a=this;return xt(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 vN(t){t.exit(this.containerState.type)}function bN(t,i,r){const a=this;return xt(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!tt(u)&&c&&c[1].type==="listItemPrefixWhitespace"?i(u):r(u)}}const Uv={name:"setextUnderline",resolveTo:xN,tokenize:wN};function xN(t,i){const r=new qu;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 wN(t,i,r){const a=this;let o;return u;function u(y){let v=a.events.length,g;for(;v--;)if(a.events[v][1].type!=="lineEnding"&&a.events[v][1].type!=="linePrefix"&&a.events[v][1].type!=="content"){g=a.events[v][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(t.enter("setextHeadingLine"),o=y,c(y)):r(y)}function c(y){return t.enter("setextHeadingLineSequence"),h(y)}function h(y){return y===o?(t.consume(y),h):(t.exit("setextHeadingLineSequence"),tt(y)?xt(t,p,"lineSuffix")(y):p(y))}function p(y){return y===null||He(y)?(t.exit("setextHeadingLine"),i(y)):r(y)}}const SN={tokenize:kN};function kN(t){const i=this,r=t.attempt(Fs,a,t.attempt(this.parser.constructs.flowInitial,o,xt(t,t.attempt(this.parser.constructs.flow,o,t.attempt(_T,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 EN={resolveAll:e0()},jN=Wx("string"),TN=Wx("text");function Wx(t){return{resolveAll:e0(t==="text"?NN: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 y(v)?u(v):h(v)}function h(v){if(v===null){r.consume(v);return}return r.enter("data"),r.consume(v),p}function p(v){return y(v)?(r.exit("data"),u(v)):(r.consume(v),p)}function y(v){if(v===null)return!0;const g=o[v];let w=-1;if(g)for(;++w<g.length;){const x=g[w];if(!x.previous||x.previous.call(a,a.previous))return!0}return!1}}}function e0(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 NN(t,i){const r=new qu;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,p=0,y;for(;c--;){const v=u[c];if(typeof v=="string"){for(h=v.length;v.charCodeAt(h-1)===32;)p++,h--;if(h)break;h=-1}else if(v===-2)y=!0,p++;else if(v!==-1){c++;break}}if(i._contentTypeTextTrailing&&a===t.length&&(p=0),p){const v={type:a===t.length||y||p<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?h:o.start._bufferIndex+h,_index:o.start._index+c,line:o.end.line,column:o.end.column-p,offset:o.end.offset-p},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 CN={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:Gx},AN={91:DT},RN={[-2]:Dd,[-1]:Dd,32:Dd},_N={35:VT,42:Cu,45:[Uv,Cu],60:GT,61:Uv,95:Cu,96:Bv,126:Bv},ON={38:Xx,92:$x},zN={[-5]:Ld,[-4]:Ld,[-3]:Ld,33:sN,38:Xx,42:sh,60:[dT,KT],91:uN,92:[HT,$x],93:Dh,95:sh,96:jT},MN={null:[sh,EN]},qN={null:[42,95]},DN={null:[]},LN=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:qN,contentInitial:AN,disable:DN,document:CN,flow:_N,flowInitial:RN,insideSpan:MN,string:ON,text:zN},Symbol.toStringTag,{value:"Module"}));function BN(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 p={attempt:D(ee),check:D(A),consume:M,enter:B,exit:K,interrupt:D(A,{interrupt:!0})},y={code:null,containerState:{},defineSkip:T,events:[],now:S,parser:t,previous:null,sliceSerialize:w,sliceStream:x,write:g};let v=i.tokenize.call(y,p);return i.resolveAll&&u.push(i),y;function g(V){return c=ti(c,V),N(),c[c.length-1]!==null?[]:(Y(i,0),y.events=Xu(u,y.events,y),y.events)}function w(V,Z){return HN(x(V),Z)}function x(V){return UN(c,V)}function S(){const{_bufferIndex:V,_index:Z,line:ke,column:oe,offset:ge}=a;return{_bufferIndex:V,_index:Z,line:ke,column:oe,offset:ge}}function T(V){o[V.line]=V.column,O()}function N(){for(;a._index<c.length;){const V=c[a._index];if(typeof V=="string"){const Z=a._index;for(a._bufferIndex<0&&(a._bufferIndex=0);a._index===Z&&a._bufferIndex<V.length;)j(V.charCodeAt(a._bufferIndex))}else j(V)}}function j(V){v=v(V)}function M(V){He(V)?(a.line++,a.column=1,a.offset+=V===-3?2:1,O()):V!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),y.previous=V}function B(V,Z){const ke=Z||{};return ke.type=V,ke.start=S(),y.events.push(["enter",ke,y]),h.push(ke),ke}function K(V){const Z=h.pop();return Z.end=S(),y.events.push(["exit",Z,y]),Z}function ee(V,Z){Y(V,Z.from)}function A(V,Z){Z.restore()}function D(V,Z){return ke;function ke(oe,ge,re){let ce,xe,Te,R;return Array.isArray(oe)?Ie(oe):"tokenize"in oe?Ie([oe]):Ke(oe);function Ke(ue){return ve;function ve(ze){const ye=ze!==null&&ue[ze],be=ze!==null&&ue.null,P=[...Array.isArray(ye)?ye:ye?[ye]:[],...Array.isArray(be)?be:be?[be]:[]];return Ie(P)(ze)}}function Ie(ue){return ce=ue,xe=0,ue.length===0?re:q(ue[xe])}function q(ue){return ve;function ve(ze){return R=le(),Te=ue,ue.partial||(y.currentConstruct=ue),ue.name&&y.parser.constructs.disable.null.includes(ue.name)?te():ue.tokenize.call(Z?Object.assign(Object.create(y),Z):y,p,z,te)(ze)}}function z(ue){return V(Te,R),ge}function te(ue){return R.restore(),++xe<ce.length?q(ce[xe]):re}}}function Y(V,Z){V.resolveAll&&!u.includes(V)&&u.push(V),V.resolve&&fi(y.events,Z,y.events.length-Z,V.resolve(y.events.slice(Z),y)),V.resolveTo&&(y.events=V.resolveTo(y.events,y))}function le(){const V=S(),Z=y.previous,ke=y.currentConstruct,oe=y.events.length,ge=Array.from(h);return{from:oe,restore:re};function re(){a=V,y.previous=Z,y.currentConstruct=ke,y.events.length=oe,h=ge,O()}}function O(){a.line in o&&a.column<2&&(a.column=o[a.line],a.offset+=o[a.line]-1)}}function UN(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 HN(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=`
|
|
22
|
+
`;break}case-3:{c=`\r
|
|
23
|
+
`;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 IN(t){const a={constructs:Ix([LN,...(t||{}).extensions||[]]),content:o(lT),defined:[],document:o(sT),flow:o(SN),lazy:{},string:o(jN),text:o(TN)};return a;function o(u){return c;function c(h){return BN(a,u,h)}}}function VN(t){for(;!Qx(t););return t}const Hv=/[\0\t\n\r]/g;function YN(){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 p=[];let y=0;for(i="",r&&(u.charCodeAt(0)===65279&&y++,r=void 0);y<u.length;){Hv.lastIndex=y;const v=Hv.exec(u),g=v&&v.index!==void 0?v.index:u.length,w=u.charCodeAt(g);if(!v){i=u.slice(y);break}if(w===10&&y===g&&a)p.push(-3),a=void 0;else switch(a&&(p.push(-5),a=void 0),y<g&&(p.push(u.slice(y,g)),t+=g-y),w){case 0:{p.push(65533),t++;break}case 9:{const x=Math.ceil(t/4)*4;for(p.push(-2);t++<x;)p.push(-1);break}case 10:{p.push(-4),t=1;break}default:a=!0,t=1}y=g+1}return h&&(a&&p.push(-5),i&&p.push(i),p.push(null)),p}}const FN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function GN(t){return t.replace(FN,$N)}function $N(t,i,r){if(i)return i;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),u=o===120||o===88;return Vx(r.slice(u?2:1),u?16:10)}return qh(r)||t}const t0={}.hasOwnProperty;function XN(t,i,r){return i&&typeof i=="object"&&(r=i,i=void 0),QN(r)(VN(IN(r).document().write(YN()(t,i,!0))))}function QN(t){const i={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(Ue),autolinkProtocol:O,autolinkEmail:O,atxHeading:c(De),blockQuote:c(P),characterEscape:O,characterReference:O,codeFenced:c(he),codeFencedFenceInfo:h,codeFencedFenceMeta:h,codeIndented:c(he,h),codeText:c(We,h),codeTextData:O,data:O,codeFlowValue:O,definition:c(dt),definitionDestinationString:h,definitionLabelString:h,definitionTitleString:h,emphasis:c(Ee),hardBreakEscape:c(Me),hardBreakTrailing:c(Me),htmlFlow:c(Ve,h),htmlFlowData:O,htmlText:c(Ve,h),htmlTextData:O,image:c(Ae),label:h,link:c(Ue),listItem:c(ae),listItemValue:x,listOrdered:c(nt,w),listUnordered:c(nt),paragraph:c(Be),reference:z,referenceString:h,resourceDestinationString:h,resourceTitleString:h,setextHeading:c(De),strong:c(ut),thematicBreak:c(Bt)},exit:{atxHeading:y(),atxHeadingSequence:A,autolink:y(),autolinkEmail:be,autolinkProtocol:ye,blockQuote:y(),characterEscapeValue:V,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:ve,characterReference:ze,codeFenced:y(j),codeFencedFence:N,codeFencedFenceInfo:S,codeFencedFenceMeta:T,codeFlowValue:V,codeIndented:y(M),codeText:y(re),codeTextData:V,data:V,definition:y(),definitionDestinationString:ee,definitionLabelString:B,definitionTitleString:K,emphasis:y(),hardBreakEscape:y(ke),hardBreakTrailing:y(ke),htmlFlow:y(oe),htmlFlowData:V,htmlText:y(ge),htmlTextData:V,image:y(xe),label:R,labelText:Te,lineEnding:Z,link:y(ce),listItem:y(),listOrdered:y(),listUnordered:y(),paragraph:y(),referenceString:te,resourceDestinationString:Ke,resourceTitleString:Ie,resource:q,setextHeading:y(le),setextHeadingLineSequence:Y,setextHeadingText:D,strong:y(),thematicBreak:y()}};n0(i,(t||{}).mdastExtensions||[]);const r={};return a;function a(Q){let se={type:"root",children:[],position:void 0};const _e={stack:[se],tokenStack:[],config:i,enter:p,exit:v,buffer:h,resume:g,data:r},Ne=[],we=[];let pe=-1;for(;++pe<Q.length;)if(we.push(Q[pe]),Q[pe][1].type==="listOrdered"||Q[pe][1].type==="listUnordered")if(Q[pe][0]==="enter")Ne.push(we.length-1);else{const Le=Ne.pop();u(we,Le)}for(Q=we,pe=-1;++pe<Q.length;){const Le=i[Q[pe][0]];Q[pe][0]==="enter"&&i.beforeEnter.length>0&&o(i.beforeEnter,{..._e,sliceSerialize:Q[pe][2].sliceSerialize},Q[pe][1]),t0.call(Le,Q[pe][1].type)&&Le[Q[pe][1].type].call({..._e,sliceSerialize:Q[pe][2].sliceSerialize},Q[pe][1]),Q[pe][0]==="exit"&&i.afterExit.length>0&&o(i.afterExit,{..._e,sliceSerialize:Q[pe][2].sliceSerialize},Q[pe][1])}if(_e.tokenStack.length>0){const Le=_e.tokenStack[_e.tokenStack.length-1];(Le[1]||Iv).call(_e,void 0,Le[0])}for(se.position={start:Or(Q.length>0?Q[0][1].start:{line:1,column:1,offset:0}),end:Or(Q.length>0?Q[Q.length-2][1].end:{line:1,column:1,offset:0})},pe=-1;++pe<i.transforms.length;)se=i.transforms[pe](se)||se;return se}function o(Q,se,_e){let Ne=-1;for(;++Ne<Q.length;)Q[Ne].call(se,_e)}function u(Q,se){const _e=Q.length-1;let Ne=se-1,we=-1,pe=!1,Le,Je,lt,bt;const gt=[];for(;++Ne<=_e;){const Ct=Q[Ne];switch(Ct[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ct[0]==="enter"?we++:we--,bt=void 0;break}case"lineEndingBlank":{Ct[0]==="enter"&&(Le&&!bt&&!we&&!lt&&(lt=Ne),bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:bt=void 0}if(!we&&Ct[0]==="enter"&&Ct[1].type==="listItemPrefix"||we===-1&&Ct[0]==="exit"&&(Ct[1].type==="listUnordered"||Ct[1].type==="listOrdered")){if(Le){let ht=Ne;for(Je=void 0;ht--;){const Ft=Q[ht];if(Ft[1].type==="lineEnding"||Ft[1].type==="lineEndingBlank"){if(Ft[0]==="exit")continue;Je&&(Q[Je][1].type="lineEndingBlank",pe=!0),Ft[1].type="lineEnding",Je=ht}else if(!(Ft[1].type==="linePrefix"||Ft[1].type==="blockQuotePrefix"||Ft[1].type==="blockQuotePrefixWhitespace"||Ft[1].type==="blockQuoteMarker"||Ft[1].type==="listItemIndent"))break}lt&&(!Je||lt<Je)&&(Le._spread=!0),Le.end=Object.assign({},Je?Q[Je][1].start:Ct[1].end),gt.push({at:Je||Ne,event:["exit",Le,Ct[2]]})}if(Ct[1].type==="listItemPrefix"){const ht={type:"listItem",_spread:!1,start:Object.assign({},Ct[1].start),end:void 0};Le=ht,gt.push({at:Ne,event:["enter",ht,Ct[2]]}),lt=void 0,bt=!0}}}const wn=Q.splice(se);let Nt=0;for(Ne=-1;++Ne<wn.length;){for(;Nt<gt.length&>[Nt].at===se+Ne;)Q.push(gt[Nt++].event);Q.push(wn[Ne])}Q[se][1]._spread=pe}function c(Q,se){return _e;function _e(Ne){p.call(this,Q(Ne),Ne),se&&se.call(this,Ne)}}function h(){this.stack.push({type:"fragment",children:[]})}function p(Q,se,_e){this.stack[this.stack.length-1].children.push(Q),this.stack.push(Q),this.tokenStack.push([se,_e||void 0]),Q.position={start:Or(se.start),end:void 0}}function y(Q){return se;function se(_e){Q&&Q.call(this,_e),v.call(this,_e)}}function v(Q,se){const _e=this.stack.pop(),Ne=this.tokenStack.pop();if(!Ne)throw new Error("Cannot close `"+Q.type+"` ("+Os({start:Q.start,end:Q.end})+"): it’s not open");Ne[0].type!==Q.type&&(se?se.call(this,Q,Ne[0]):(Ne[1]||Iv).call(this,Q,Ne[0])),_e.position.end=Or(Q.end)}function g(){return $u(this.stack.pop())}function w(){this.data.expectingFirstListItemValue=!0}function x(Q){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(Q),10),this.data.expectingFirstListItemValue=void 0}}function S(){const Q=this.resume(),se=this.stack[this.stack.length-1];se.lang=Q}function T(){const Q=this.resume(),se=this.stack[this.stack.length-1];se.meta=Q}function N(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const Q=this.resume(),se=this.stack[this.stack.length-1];se.value=Q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function M(){const Q=this.resume(),se=this.stack[this.stack.length-1];se.value=Q.replace(/(\r?\n|\r)$/g,"")}function B(Q){const se=this.resume(),_e=this.stack[this.stack.length-1];_e.label=se,_e.identifier=di(this.sliceSerialize(Q)).toLowerCase()}function K(){const Q=this.resume(),se=this.stack[this.stack.length-1];se.title=Q}function ee(){const Q=this.resume(),se=this.stack[this.stack.length-1];se.url=Q}function A(Q){const se=this.stack[this.stack.length-1];if(!se.depth){const _e=this.sliceSerialize(Q).length;se.depth=_e}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function Y(Q){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(Q).codePointAt(0)===61?1:2}function le(){this.data.setextHeadingSlurpLineEnding=void 0}function O(Q){const _e=this.stack[this.stack.length-1].children;let Ne=_e[_e.length-1];(!Ne||Ne.type!=="text")&&(Ne=Kt(),Ne.position={start:Or(Q.start),end:void 0},_e.push(Ne)),this.stack.push(Ne)}function V(Q){const se=this.stack.pop();se.value+=this.sliceSerialize(Q),se.position.end=Or(Q.end)}function Z(Q){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=se.children[se.children.length-1];_e.position.end=Or(Q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(se.type)&&(O.call(this,Q),V.call(this,Q))}function ke(){this.data.atHardBreak=!0}function oe(){const Q=this.resume(),se=this.stack[this.stack.length-1];se.value=Q}function ge(){const Q=this.resume(),se=this.stack[this.stack.length-1];se.value=Q}function re(){const Q=this.resume(),se=this.stack[this.stack.length-1];se.value=Q}function ce(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=se,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function xe(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=se,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function Te(Q){const se=this.sliceSerialize(Q),_e=this.stack[this.stack.length-2];_e.label=GN(se),_e.identifier=di(se).toLowerCase()}function R(){const Q=this.stack[this.stack.length-1],se=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const Ne=Q.children;_e.children=Ne}else _e.alt=se}function Ke(){const Q=this.resume(),se=this.stack[this.stack.length-1];se.url=Q}function Ie(){const Q=this.resume(),se=this.stack[this.stack.length-1];se.title=Q}function q(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function te(Q){const se=this.resume(),_e=this.stack[this.stack.length-1];_e.label=se,_e.identifier=di(this.sliceSerialize(Q)).toLowerCase(),this.data.referenceType="full"}function ue(Q){this.data.characterReferenceType=Q.type}function ve(Q){const se=this.sliceSerialize(Q),_e=this.data.characterReferenceType;let Ne;_e?(Ne=Vx(se,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ne=qh(se);const we=this.stack[this.stack.length-1];we.value+=Ne}function ze(Q){const se=this.stack.pop();se.position.end=Or(Q.end)}function ye(Q){V.call(this,Q);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(Q)}function be(Q){V.call(this,Q);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(Q)}function P(){return{type:"blockquote",children:[],position:void 0}}function he(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function We(){return{type:"inlineCode",value:"",position:void 0}}function dt(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function Ee(){return{type:"emphasis",children:[],position:void 0}}function De(){return{type:"heading",depth:0,children:[],position:void 0}}function Me(){return{type:"break",position:void 0}}function Ve(){return{type:"html",value:"",position:void 0}}function Ae(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function Ue(){return{type:"link",title:null,url:"",children:[],position:void 0}}function nt(Q){return{type:"list",ordered:Q.type==="listOrdered",start:null,spread:Q._spread,children:[],position:void 0}}function ae(Q){return{type:"listItem",spread:Q._spread,checked:null,children:[],position:void 0}}function Be(){return{type:"paragraph",children:[],position:void 0}}function ut(){return{type:"strong",children:[],position:void 0}}function Kt(){return{type:"text",value:"",position:void 0}}function Bt(){return{type:"thematicBreak",position:void 0}}}function Or(t){return{line:t.line,column:t.column,offset:t.offset}}function n0(t,i){let r=-1;for(;++r<i.length;){const a=i[r];Array.isArray(a)?n0(t,a):ZN(t,a)}}function ZN(t,i){let r;for(r in i)if(t0.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 Iv(t,i){throw t?new Error("Cannot close `"+t.type+"` ("+Os({start:t.start,end:t.end})+"): a different token (`"+i.type+"`, "+Os({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Os({start:i.start,end:i.end})+") is still open")}function KN(t){const i=this;i.parser=r;function r(a){return XN(a,{...i.data("settings"),...t,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function JN(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 PN(t,i){const r={type:"element",tagName:"br",properties:{},children:[]};return t.patch(i,r),[t.applyData(i,r),{type:"text",value:`
|
|
24
|
+
`}]}function WN(t,i){const r=i.value?i.value+`
|
|
25
|
+
`:"",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 eC(t,i){const r={type:"element",tagName:"del",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function tC(t,i){const r={type:"element",tagName:"em",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function nC(t,i){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",a=String(i.identifier).toUpperCase(),o=Sa(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 p={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,p);const y={type:"element",tagName:"sup",properties:{},children:[p]};return t.patch(i,y),t.applyData(i,y)}function iC(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 rC(t,i){if(t.options.allowDangerousHtml){const r={type:"raw",value:i.value};return t.patch(i,r),t.applyData(i,r)}}function i0(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 lC(t,i){const r=String(i.identifier).toUpperCase(),a=t.definitionById.get(r);if(!a)return i0(t,i);const o={src:Sa(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 aC(t,i){const r={src:Sa(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 sC(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 oC(t,i){const r=String(i.identifier).toUpperCase(),a=t.definitionById.get(r);if(!a)return i0(t,i);const o={href:Sa(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 uC(t,i){const r={href:Sa(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 cC(t,i,r){const a=t.all(i),o=r?fC(r):r0(i),u={},c=[];if(typeof i.checked=="boolean"){const v=a[0];let g;v&&v.type==="element"&&v.tagName==="p"?g=v:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked: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:`
|
|
26
|
+
`}),v.type==="element"&&v.tagName==="p"&&!o?c.push(...v.children):c.push(v)}const p=a[a.length-1];p&&(o||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
|
|
27
|
+
`});const y={type:"element",tagName:"li",properties:u,children:c};return t.patch(i,y),t.applyData(i,y)}function fC(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=r0(r[a])}return i}function r0(t){const i=t.spread;return i??t.children.length>1}function dC(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 hC(t,i){const r={type:"element",tagName:"p",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function mC(t,i){const r={type:"root",children:t.wrap(t.all(i))};return t.patch(i,r),t.applyData(i,r)}function pC(t,i){const r={type:"element",tagName:"strong",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function yC(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=_h(i.children[1]),p=Mx(i.children[i.children.length-1]);h&&p&&(c.position={start:h,end:p}),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 gC(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 p=-1;const y=[];for(;++p<h;){const g=i.children[p],w={},x=c?c[p]:void 0;x&&(w.align=x);let S={type:"element",tagName:u,properties:w,children:[]};g&&(S.children=t.all(g),t.patch(g,S),S=t.applyData(g,S)),y.push(S)}const v={type:"element",tagName:"tr",properties:{},children:t.wrap(y,!0)};return t.patch(i,v),t.applyData(i,v)}function vC(t,i){const r={type:"element",tagName:"td",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}const Vv=9,Yv=32;function bC(t){const i=String(t),r=/\r?\n|\r/g;let a=r.exec(i),o=0;const u=[];for(;a;)u.push(Fv(i.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=r.exec(i);return u.push(Fv(i.slice(o),o>0,!1)),u.join("")}function Fv(t,i,r){let a=0,o=t.length;if(i){let u=t.codePointAt(a);for(;u===Vv||u===Yv;)a++,u=t.codePointAt(a)}if(r){let u=t.codePointAt(o-1);for(;u===Vv||u===Yv;)o--,u=t.codePointAt(o-1)}return o>a?t.slice(a,o):""}function xC(t,i){const r={type:"text",value:bC(String(i.value))};return t.patch(i,r),t.applyData(i,r)}function wC(t,i){const r={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(i,r),t.applyData(i,r)}const SC={blockquote:JN,break:PN,code:WN,delete:eC,emphasis:tC,footnoteReference:nC,heading:iC,html:rC,imageReference:lC,image:aC,inlineCode:sC,linkReference:oC,link:uC,listItem:cC,list:dC,paragraph:hC,root:mC,strong:pC,table:yC,tableCell:vC,tableRow:gC,text:xC,thematicBreak:wC,toml:vu,yaml:vu,definition:vu,footnoteDefinition:vu};function vu(){}const l0=-1,Qu=0,Ms=1,Du=2,Lh=3,Bh=4,Uh=5,Hh=6,a0=7,s0=8,{defineProperty:kC}=Object,o0=typeof self=="object"?self:globalThis,Gv=(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 o0[t](i)},EC=(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 Qu:case l0:return r(c,o);case Ms:{const h=r([],o);for(const p of c)h.push(a(p));return h}case Du:{const h=r({},o);for(const[p,y]of c){const v=a(p),g=a(y);v==="__proto__"?kC(h,v,{value:g,configurable:!0,enumerable:!0,writable:!0}):h[v]=g}return h}case Lh:return r(new Date(c),o);case Bh:{const{source:h,flags:p}=c;return r(new RegExp(h,p),o)}case Uh:{const h=r(new Map,o);for(const[p,y]of c)h.set(a(p),a(y));return h}case Hh:{const h=r(new Set,o);for(const p of c)h.add(a(p));return h}case a0:{const{name:h,message:p}=c;return r(typeof o0[h]=="function"?Gv(h,p):new Error(p),o)}case s0: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(Gv(u,c),o)};return a},$v=t=>EC(new Map,t)(0),ul="",{toString:jC}={},{keys:TC,is:NC}=Object,Cs=t=>{const i=typeof t;if(i!=="object"||!t)return[Qu,i];const r=jC.call(t).slice(8,-1);switch(r){case"Array":return[Ms,ul];case"Object":return[Du,ul];case"Date":return[Lh,ul];case"RegExp":return[Bh,ul];case"Map":return[Uh,ul];case"Set":return[Hh,ul];case"DataView":return[Ms,r]}return r.includes("Array")?[Ms,r]:t instanceof Error?[a0,t.name||"Error"]:[Du,r]},bu=([t,i])=>t===Qu&&(i==="function"||i==="symbol"),CC=(t,i,r,a)=>{const o=(c,h)=>{const p=a.push(c)-1;return r.set(h,p),p},u=c=>{if(r.has(c))return r.get(c);let[h,p]=Cs(c);switch(h){case Qu:{let v=c;switch(p){case"bigint":h=s0,v=c.toString();break;case"number":if(!c&&NC(c,-0))return a.push(["-0"])-1;break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+p);v=null;break;case"undefined":return o([l0],c)}return o([h,v],c)}case Ms:{if(p){let w=c;return p==="DataView"?w=new Uint8Array(c.buffer):p==="ArrayBuffer"&&(w=new Uint8Array(c)),o([p,[...w]],c)}const v=[],g=o([h,v],c);for(const w of c)v.push(u(w));return g}case Du:{if(p)switch(p){case"BigInt":return o([p,c.toString()],c);case"Boolean":case"Number":case"String":return o([p,c.valueOf()],c)}if(i&&"toJSON"in c)return u(c.toJSON());const v=[],g=o([h,v],c);for(const w of TC(c))(t||!bu(Cs(c[w])))&&v.push([u(w),u(c[w])]);return g}case Lh:return o([h,isNaN(c.getTime())?ul:c.toISOString()],c);case Bh:{const{source:v,flags:g}=c;return o([h,{source:v,flags:g}],c)}case Uh:{const v=[],g=o([h,v],c);for(const[w,x]of c)(t||!(bu(Cs(w))||bu(Cs(x))))&&v.push([u(w),u(x)]);return g}case Hh:{const v=[],g=o([h,v],c);for(const w of c)(t||!bu(Cs(w)))&&v.push(u(w));return g}}const{message:y}=c;return o([h,{name:p,message:y}],c)};return u},Xv=(t,{json:i,lossy:r}={})=>{const a=[];return CC(!(i||r),!!i,new Map,a)(t),a},Lu=typeof structuredClone=="function"?(t,i)=>i&&("json"in i||"lossy"in i)?$v(Xv(t,i)):structuredClone(t):(t,i)=>$v(Xv(t,i));function AC(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 RC(t,i){return"Back to reference "+(t+1)+(i>1?"-"+i:"")}function _C(t){const i=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=t.options.footnoteBackContent||AC,a=t.options.footnoteBackLabel||RC,o=t.options.footnoteLabel||"Footnotes",u=t.options.footnoteLabelTagName||"h2",c=t.options.footnoteLabelProperties||{className:["sr-only"]},h=[];let p=-1;for(;++p<t.footnoteOrder.length;){const y=t.footnoteById.get(t.footnoteOrder[p]);if(!y)continue;const v=t.all(y),g=String(y.identifier).toUpperCase(),w=Sa(g.toLowerCase());let x=0;const S=[],T=t.footnoteCounts.get(g);for(;T!==void 0&&++x<=T;){S.length>0&&S.push({type:"text",value:" "});let M=typeof r=="string"?r:r(p,x);typeof M=="string"&&(M={type:"text",value:M}),S.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+w+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(p,x),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const N=v[v.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const M=N.children[N.children.length-1];M&&M.type==="text"?M.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...S)}else v.push(...S);const j={type:"element",tagName:"li",properties:{id:i+"fn-"+w},children:t.wrap(v,!0)};t.patch(y,j),h.push(j)}if(h.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Lu(c),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
28
|
+
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(h,!0)},{type:"text",value:`
|
|
29
|
+
`}]}}const Zu=(function(t){if(t==null)return qC;if(typeof t=="function")return Ku(t);if(typeof t=="object")return Array.isArray(t)?OC(t):zC(t);if(typeof t=="string")return MC(t);throw new Error("Expected function, string, or object as test")});function OC(t){const i=[];let r=-1;for(;++r<t.length;)i[r]=Zu(t[r]);return Ku(a);function a(...o){let u=-1;for(;++u<i.length;)if(i[u].apply(this,o))return!0;return!1}}function zC(t){const i=t;return Ku(r);function r(a){const o=a;let u;for(u in t)if(o[u]!==i[u])return!1;return!0}}function MC(t){return Ku(i);function i(r){return r&&r.type===t}}function Ku(t){return i;function i(r,a,o){return!!(DC(r)&&t.call(this,r,typeof a=="number"?a:void 0,o||void 0))}}function qC(){return!0}function DC(t){return t!==null&&typeof t=="object"&&"type"in t}const u0=[],LC=!0,qs=!1,ch="skip";function fh(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,p;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")p=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 y=Zu(u),v=o?1:-1;g(t,void 0,[])();function g(w,x,S){const T=w&&typeof w=="object"?w:{};if(typeof T.type=="string"){const j=typeof T.tagName=="string"?T.tagName:typeof T.name=="string"?T.name:void 0;Object.defineProperty(N,"name",{value:"node ("+(w.type+(j?"<"+j+">":""))+")"})}return N;function N(){const j=!u||y(w,x,S[S.length-1]||void 0);let M=u0;if(h&&j&&(M=Qv(h(w,S,x)),M[0]===qs))return M;if("children"in w&&w.children){const B=w;if(B.children&&M[0]!==ch){let K=(o?-1:B.children.length)+v;const ee=[...S,B];for(;K>-1&&K<B.children.length;){const A=B.children[K],D=g(A,K,ee)();if(D[0]===qs)return D;K=typeof D[1]=="number"?D[1]:K+v}}}if(p&&j){const B=Qv(p(w,S,x));if(B[0]===ch)throw new Error("Unexpected value `"+B[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(B[0]===qs||typeof B[1]=="number")return B}return M}}}function Qv(t){return Array.isArray(t)?t:typeof t=="number"?[LC,t]:t==null?u0:[t]}function Ju(t,i,r,a){let o,u,c;u=i,c=r,typeof u=="function"?fh(t,o,dh(u),c):fh(t,o,BC(u),c)}function BC(t){return!t||typeof t!="object"?t:{enter:typeof t.enter=="function"?dh(t.enter):t.enter,exit:typeof t.exit=="function"?dh(t.exit):t.exit}}function dh(t){return i;function i(r,a,o){return t(r,o,a[a.length-1])}}const hh={}.hasOwnProperty,UC={};function HC(t,i){const r=i||UC,a=new Map,o=new Map,u=new Map,c={...SC,...r.handlers},h={all:y,applyData:VC,definitionById:a,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:c,one:p,options:r,patch:IC,wrap:FC};return Ju(t,function(v){if(v.type==="definition"||v.type==="footnoteDefinition"){const g=v.type==="definition"?a:o,w=String(v.identifier).toUpperCase();g.has(w)||g.set(w,v)}}),h;function p(v,g){const w=v.type,x=h.handlers[w];if(hh.call(h.handlers,w)&&x)return x(h,v,g);if(h.options.passThrough&&h.options.passThrough.includes(w)){if("children"in v){const{children:T,...N}=v,j=Lu(N);return j.children=h.all(v),j}return Lu(v)}return(h.options.unknownHandler||YC)(h,v,g)}function y(v){const g=[];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)?g.push(...S):g.push(S)}}}return g}}function IC(t,i){t.position&&(i.position=Rj(t))}function VC(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,Lu(u)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function YC(t,i){const r=i.data||{},a="value"in i&&!(hh.call(r,"hProperties")||hh.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 FC(t,i){const r=[];let a=-1;for(i&&r.push({type:"text",value:`
|
|
30
|
+
`});++a<t.length;)a&&r.push({type:"text",value:`
|
|
31
|
+
`}),r.push(t[a]);return i&&t.length>0&&r.push({type:"text",value:`
|
|
32
|
+
`}),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 Kv(t,i){const r=HC(t,i),a=r.one(t,void 0),o=_C(r),u=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
|
|
33
|
+
`},o),u}function GC(t,i){return t&&"run"in t?async function(r,a){const o=Kv(r,{file:a,...i});await t.run(o,a)}:function(r,a){return Kv(r,{file:a,...t||i})}}function Jv(t){if(t)throw t}var Bd,Pv;function $C(){if(Pv)return Bd;Pv=1;var t=Object.prototype.hasOwnProperty,i=Object.prototype.toString,r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(y){return typeof Array.isArray=="function"?Array.isArray(y):i.call(y)==="[object Array]"},u=function(y){if(!y||i.call(y)!=="[object Object]")return!1;var v=t.call(y,"constructor"),g=y.constructor&&y.constructor.prototype&&t.call(y.constructor.prototype,"isPrototypeOf");if(y.constructor&&!v&&!g)return!1;var w;for(w in y);return typeof w>"u"||t.call(y,w)},c=function(y,v){r&&v.name==="__proto__"?r(y,v.name,{enumerable:!0,configurable:!0,value:v.newValue,writable:!0}):y[v.name]=v.newValue},h=function(y,v){if(v==="__proto__")if(t.call(y,v)){if(a)return a(y,v).value}else return;return y[v]};return Bd=function p(){var y,v,g,w,x,S,T=arguments[0],N=1,j=arguments.length,M=!1;for(typeof T=="boolean"&&(M=T,T=arguments[1]||{},N=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});N<j;++N)if(y=arguments[N],y!=null)for(v in y)g=h(T,v),w=h(y,v),T!==w&&(M&&w&&(u(w)||(x=o(w)))?(x?(x=!1,S=g&&o(g)?g:[]):S=g&&u(g)?g:{},c(T,{name:v,newValue:p(M,S,w)})):typeof w<"u"&&c(T,{name:v,newValue:w}));return T},Bd}var XC=$C();const Ud=Yb(XC);function mh(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 QC(){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(p,...y){const v=t[++u];let g=-1;if(p){c(p);return}for(;++g<o.length;)(y[g]===null||y[g]===void 0)&&(y[g]=o[g]);o=y,v?ZC(v,h)(...y):c(null,...y)}}function a(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return t.push(o),i}}function ZC(t,i){let r;return a;function a(...c){const h=t.length>c.length;let p;h&&c.push(o);try{p=t.apply(this,c)}catch(y){const v=y;if(h&&r)throw v;return o(v)}h||(p&&p.then&&typeof p.then=="function"?p.then(u,o):p instanceof Error?o(p):u(p))}function o(c,...h){r||(r=!0,i(c,...h))}function u(c){o(null,c)}}const Ci={basename:KC,dirname:JC,extname:PC,join:WC,sep:"/"};function KC(t,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');Gs(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 JC(t){if(Gs(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 PC(t){Gs(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 WC(...t){let i=-1,r;for(;++i<t.length;)Gs(t[i]),t[i]&&(r=r===void 0?t[i]:r+"/"+t[i]);return r===void 0?".":eA(r)}function eA(t){Gs(t);const i=t.codePointAt(0)===47;let r=tA(t,!i);return r.length===0&&!i&&(r="."),r.length>0&&t.codePointAt(t.length-1)===47&&(r+="/"),i?"/"+r:r}function tA(t,i){let r="",a=0,o=-1,u=0,c=-1,h,p;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(p=r.lastIndexOf("/"),p!==r.length-1){p<0?(r="",a=0):(r=r.slice(0,p),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 Gs(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const nA={cwd:iA};function iA(){return"/"}function ph(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function rA(t){if(typeof t=="string")t=new URL(t);else if(!ph(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 lA(t)}function lA(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 Hd=["history","path","basename","stem","extname","dirname"];class c0{constructor(i){let r;i?ph(i)?r={path:i}:typeof i=="string"||aA(i)?r={value:i}:r=i:r={},this.cwd="cwd"in r?"":nA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Hd.length;){const u=Hd[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)Hd.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?Ci.basename(this.path):void 0}set basename(i){Vd(i,"basename"),Id(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){Wv(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(Id(i,"extname"),Wv(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){ph(i)&&(i=rA(i)),Vd(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){Vd(i,"stem"),Id(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 Gu(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 Id(t,i){if(t&&t.includes(Ci.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Ci.sep+"`")}function Vd(t,i){if(!t)throw new Error("`"+i+"` cannot be empty")}function Wv(t,i){if(!t)throw new Error("Setting `"+i+"` requires `path` to be set too")}function aA(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const sA=(function(t){const a=this.constructor.prototype,o=a[t],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,a),u}),oA={}.hasOwnProperty;class Ih extends sA{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=QC()}copy(){const i=new Ih;let r=-1;for(;++r<this.attachers.length;){const a=this.attachers[r];i.use(...a)}return i.data(Ud(!0,{},this.namespace)),i}data(i,r){return typeof i=="string"?arguments.length===2?(Gd("data",this.frozen),this.namespace[i]=r,this):oA.call(this.namespace,i)&&this.namespace[i]||void 0:i?(Gd("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=xu(i),a=this.parser||this.Parser;return Yd("parse",a),a(String(r),r)}process(i,r){const a=this;return this.freeze(),Yd("process",this.parser||this.Parser),Fd("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(u,c){const h=xu(i),p=a.parse(h);a.run(p,h,function(v,g,w){if(v||!g||!w)return y(v);const x=g,S=a.stringify(x,w);fA(S)?w.value=S:w.result=S,y(v,w)});function y(v,g){v||!g?c(v):u?u(g):r(void 0,g)}}}processSync(i){let r=!1,a;return this.freeze(),Yd("processSync",this.parser||this.Parser),Fd("processSync",this.compiler||this.Compiler),this.process(i,o),tb("processSync","process",r),a;function o(u,c){r=!0,Jv(u),a=c}}run(i,r,a){eb(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 p=xu(r);o.run(i,p,y);function y(v,g,w){const x=g||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),tb("runSync","run",a),o;function u(c,h){Jv(c),o=h,a=!0}}stringify(i,r){this.freeze();const a=xu(r),o=this.compiler||this.Compiler;return Fd("stringify",o),eb(i),o(i,a)}use(i,...r){const a=this.attachers,o=this.namespace;if(Gd("use",this.frozen),i!=null)if(typeof i=="function")p(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(y){if(typeof y=="function")p(y,[]);else if(typeof y=="object")if(Array.isArray(y)){const[v,...g]=y;p(v,g)}else c(y);else throw new TypeError("Expected usable value, not `"+y+"`")}function c(y){if(!("plugins"in y)&&!("settings"in y))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(y.plugins),y.settings&&(o.settings=Ud(!0,o.settings,y.settings))}function h(y){let v=-1;if(y!=null)if(Array.isArray(y))for(;++v<y.length;){const g=y[v];u(g)}else throw new TypeError("Expected a list of plugins, not `"+y+"`")}function p(y,v){let g=-1,w=-1;for(;++g<a.length;)if(a[g][0]===y){w=g;break}if(w===-1)a.push([y,...v]);else if(v.length>0){let[x,...S]=v;const T=a[w][1];mh(T)&&mh(x)&&(x=Ud(!0,T,x)),a[w]=[y,x,...S]}}}}const uA=new Ih().freeze();function Yd(t,i){if(typeof i!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Fd(t,i){if(typeof i!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Gd(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 eb(t){if(!mh(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function tb(t,i,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+i+"` instead")}function xu(t){return cA(t)?t:new c0(t)}function cA(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function fA(t){return typeof t=="string"||dA(t)}function dA(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const hA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",nb=[],ib={allowDangerousHtml:!0},mA=/^(https?|ircs?|mailto|xmpp)$/i,pA=[{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 yA(t){const i=gA(t),r=vA(t);return bA(i.runSync(i.parse(r),r),t)}function gA(t){const i=t.rehypePlugins||nb,r=t.remarkPlugins||nb,a=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...ib}:ib;return uA().use(KN).use(r).use(GC,a).use(i)}function vA(t){const i=t.children||"",r=new c0;return typeof i=="string"&&(r.value=i),r}function bA(t,i){const r=i.allowedElements,a=i.allowElement,o=i.components,u=i.disallowedElements,c=i.skipHtml,h=i.unwrapDisallowed,p=i.urlTransform||f0;for(const v of pA)Object.hasOwn(i,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+hA+v.id,void 0);return Ju(t,y),Dj(t,{Fragment:m.Fragment,components:o,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function y(v,g,w){if(v.type==="raw"&&w&&typeof g=="number")return c?w.children.splice(g,1):w.children[g]={type:"text",value:v.value},g;if(v.type==="element"){let x;for(x in qd)if(Object.hasOwn(qd,x)&&Object.hasOwn(v.properties,x)){const S=v.properties[x],T=qd[x];(T===null||T.includes(v.tagName))&&(v.properties[x]=p(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 g=="number"&&(x=!a(v,g,w)),x&&w&&typeof g=="number")return h&&v.children?w.children.splice(g,1,...v.children):w.children.splice(g,1),g}}}function f0(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||mA.test(t.slice(0,i))?t:""}function rb(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 xA(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wA(t,i,r){const o=Zu((r||{}).ignore||[]),u=SA(i);let c=-1;for(;++c<u.length;)fh(t,h);function h(y,v,g){if(y.type==="text"&&typeof g=="number")return p(y,v,g);if(o(y,g,v[v.length-1]))return ch}function p(y,v,g){const w=v[v.length-1],x=u[c][0],S=u[c][1];let T=0,N=!1,j=[];x.lastIndex=0;let M=x.exec(y.value);for(;M;){const K=M.index,ee={index:M.index,input:M.input,stack:[...v,y]};let A=S(...M,ee);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1)x.lastIndex=K+1;else{if(T!==K&&B({type:"text",value:y.value.slice(T,K)}),Array.isArray(A))for(const D of A)B(D);else A&&B(A);T=K+M[0].length,N=!0}if(!x.global)break;M=x.exec(y.value)}return N?(T<y.value.length&&B({type:"text",value:y.value.slice(T)}),w.children.splice(g,1,...j)):j=[y],g+j.length;function B(K){const ee=j[j.length-1];ee&&ee.type==="text"&&K.type==="text"?ee.value+=K.value:j.push(K)}}}function SA(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([kA(o[0]),EA(o[1])])}return i}function kA(t){return typeof t=="string"?new RegExp(xA(t),"g"):t}function EA(t){return typeof t=="function"?t:function(){return t}}const $d="phrasing",Xd=["autolink","link","image","label"];function jA(){return{transforms:[OA],enter:{literalAutolink:NA,literalAutolinkEmail:Qd,literalAutolinkHttp:Qd,literalAutolinkWww:Qd},exit:{literalAutolink:_A,literalAutolinkEmail:RA,literalAutolinkHttp:CA,literalAutolinkWww:AA}}}function TA(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:$d,notInConstruct:Xd},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:$d,notInConstruct:Xd},{character:":",before:"[ps]",after:"\\/",inConstruct:$d,notInConstruct:Xd}]}}function NA(t){this.enter({type:"link",title:null,url:"",children:[],position:void 0},t)}function Qd(t){this.config.enter.autolinkProtocol.call(this,t)}function CA(t){this.config.exit.autolinkProtocol.call(this,t)}function AA(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 RA(t){this.config.exit.autolinkEmail.call(this,t)}function _A(t){this.exit(t)}function OA(t){wA(t,[[new RegExp("(?<![\\da-z])(https?:\\/\\/|www(?=\\.))([\\w-]*\\.[\\w\\-.]*)([^\\t\\n\\r ]*)","gi"),zA],[new RegExp("(?<![\\w+\\-.@])xmpp:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)(\\/(?:[\\w\\-/]|\\.(?=[\\dA-Za-z]))*)?","g"),DA],[new RegExp("(?<![\\w+\\-.@])mailto:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),qA],[new RegExp("(?<![\\w+\\-.]|(?:^|[^\\d@A-Za-z])(?:mailto|xmpp):)([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),MA]],{ignore:["link","linkReference"]})}function zA(t,i,r,a,o){if(!UA(o))return!1;let u="";if(/^w/i.test(i)&&(r=i+r,i="",u="http://"),Ys(r.charCodeAt(0))||!LA(r))return!1;const c=BA(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 MA(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 qA(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 DA(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 LA(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 BA(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=rb(t,"(");let u=rb(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 UA(t){const i=t.input.charCodeAt(t.index-1);return t.index===0||dl(i)||Ys(i)}d0.peek=QA;function HA(){this.buffer()}function IA(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function VA(){this.buffer()}function YA(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function FA(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 GA(t){this.exit(t)}function $A(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 XA(t){this.exit(t)}function QA(){return"["}function d0(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 ZA(){return{enter:{gfmFootnoteCallString:HA,gfmFootnoteCall:IA,gfmFootnoteDefinitionLabelString:VA,gfmFootnoteDefinition:YA},exit:{gfmFootnoteCallString:FA,gfmFootnoteCall:GA,gfmFootnoteDefinitionLabelString:$A,gfmFootnoteDefinition:XA}}}function KA(t){let i=!1;return t&&t.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:r,footnoteReference:d0},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(a,o,u,c){const h=u.createTracker(c);let p=h.move("[^");const y=u.enter("footnoteDefinition"),v=u.enter("label");return p+=h.move(u.safe(u.associationId(a),{before:p,after:"]"})),v(),p+=h.move("]:"),a.children&&a.children.length>0&&(h.shift(4),p+=h.move((i?`
|
|
34
|
+
`:" ")+u.indentLines(u.containerFlow(a,h.current()),i?h0:JA))),y(),p}}function JA(t,i,r){return i===0?t:h0(t,i,r)}function h0(t,i,r){return(r?"":" ")+t}const PA=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Vh.attention=i2;Vh.peek=r2;function WA(){return{canContainEols:["delete"],enter:{strikethrough:t2},exit:{strikethrough:n2}}}function e2(){return{handlers:{delete:Vh},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:PA}]}}function t2(t){this.enter({type:"delete",children:[],position:void 0},t)}function n2(t){this.exit(t)}function Vh(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 i2(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function r2(){return"~"}function l2(t){return t.length}function a2(t,i){const r=i||{},a=(r.align||[]).concat(),o=r.stringLength||l2,u=[],c=[],h=[],p=[];let y=0,v=-1;for(;++v<t.length;){const T=[],N=[];let j=-1;for(t[v].length>y&&(y=t[v].length);++j<t[v].length;){const M=s2(t[v][j]);if(r.alignDelimiters!==!1){const B=o(M);N[j]=B,(p[j]===void 0||B>p[j])&&(p[j]=B)}T.push(M)}c[v]=T,h[v]=N}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<y;)u[g]=lb(a[g]);else{const T=lb(a);for(;++g<y;)u[g]=T}g=-1;const w=[],x=[];for(;++g<y;){const T=u[g];let N="",j="";T===99?(N=":",j=":"):T===108?N=":":T===114&&(j=":");let M=r.alignDelimiters===!1?1:Math.max(1,p[g]-N.length-j.length);const B=N+"-".repeat(M)+j;r.alignDelimiters!==!1&&(M=N.length+M+j.length,M>p[g]&&(p[g]=M),x[g]=M),w[g]=B}c.splice(1,0,w),h.splice(1,0,x),v=-1;const S=[];for(;++v<c.length;){const T=c[v],N=h[v],j=r.fillRows===!1?Math.max(1,c[v===1?0:v].length):y;g=-1;const M=[];for(;++g<j;){const B=T[g]||"";let K="",ee="";if(r.alignDelimiters!==!1){const A=p[g]-(N[g]||0),D=u[g];if(D===114)K=" ".repeat(A);else if(D===99){const Y=A/2;A%2?(K=" ".repeat(Y+.5),ee=" ".repeat(Y-.5)):(K=" ".repeat(Y),ee=K)}else ee=" ".repeat(A)}r.delimiterStart!==!1&&!g&&M.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&B==="")&&(r.delimiterStart!==!1||g)&&M.push(" "),r.alignDelimiters!==!1&&M.push(K),M.push(B),r.alignDelimiters!==!1&&M.push(ee),r.padding!==!1&&M.push(" "),(r.delimiterEnd!==!1||g!==j-1)&&M.push("|")}S.push(r.delimiterEnd===!1?M.join("").replace(/ +$/,""):M.join(""))}return S.join(`
|
|
35
|
+
`)}function s2(t){return t==null?"":String(t)}function lb(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 o2=Zu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function u2(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()),c2);return o(),c}function c2(t,i,r){return">"+(r?"":" ")+t}function f2(t,i){return ab(t,i.inConstruct,!0)&&!ab(t,i.notInConstruct,!1)}function ab(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 sb(t,i,r,a){let o=-1;for(;++o<r.unsafe.length;){const u=r.unsafe[o];if(u.character===`
|
|
36
|
+
`&&!u.before&&!u.after&&f2(r.stack,u))return/[\t ]/.test(a.before)?"":" "}return`\\
|
|
37
|
+
`}function d2(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 h2(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 m2(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 p2(t,i,r,a){const o=m2(r),u=t.value||"";if(h2(t,r)){const g=r.enter("codeIndented"),w=r.indentLines(u,y2);return g(),w}const c=r.createTracker(a),h=o.repeat(Math.max(d2(u,o)+1,3)),p=r.enter("codeFenced"),y=o==="`"?"GraveAccent":"Tilde";let v=c.move(h);if(t.lang){const g=r.enter(`codeFencedLang${y}`);v+=c.move(r.safe(t.lang,{before:v,after:" ",encode:["`"],...c.current()})),g()}if(t.lang&&t.meta){const g=r.enter(`codeFencedMeta${y}`);v+=c.move(" "),v+=c.move(r.safe(t.meta,{before:v,after:`
|
|
38
|
+
`,encode:["`"],...c.current()})),g()}return v+=c.move(`
|
|
39
|
+
`),u&&(v+=c.move(u+`
|
|
40
|
+
`)),v+=c.move(h),p(),v}function y2(t,i,r){return(r?"":" ")+t}function Yh(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 g2(t,i,r,a){const o=Yh(r),u=o==='"'?"Quote":"Apostrophe",c=r.enter("definition");let h=r.enter("label");const p=r.createTracker(a);let y=p.move("[");return y+=p.move(r.safe(r.associationId(t),{before:y,after:"]",...p.current()})),y+=p.move("]: "),h(),!t.url||/[\0- \u007F]/.test(t.url)?(h=r.enter("destinationLiteral"),y+=p.move("<"),y+=p.move(r.safe(t.url,{before:y,after:">",...p.current()})),y+=p.move(">")):(h=r.enter("destinationRaw"),y+=p.move(r.safe(t.url,{before:y,after:t.title?" ":`
|
|
41
|
+
`,...p.current()}))),h(),t.title&&(h=r.enter(`title${u}`),y+=p.move(" "+o),y+=p.move(r.safe(t.title,{before:y,after:o,...p.current()})),y+=p.move(o),h()),c(),y}function v2(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 Bu(t){const i=t.codePointAt(0);return i===void 0?"":String.fromCodePoint(i)}function ga(t){const i=t.codePointAt(t.length-2);return i!==void 0&&i>65535?t.slice(-2):t.slice(-1)}function m0(t){return"&#x"+t.toString(16).toUpperCase()+";"}function ob(t,i,r){const a=zr(t),o=zr(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 b2(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:gn(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(!gn(u))return;for(;u===45||vn(u);)u=t.charCodeAt(++o);const c=t.slice(a,o).toLowerCase();return!r&&u!==47&&uh.includes(c)?1:Px.includes(c)?6:7}const p0=new Map([["*",!1],["_",!0]]);function x2(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 y0(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),p=p0.get(h);let y=c+1;for(;y<t.length&&t[y].attention&&t[y].value.charAt(0)===h;)y++;const v=c?t[c-1].value:i,g=zr(v.charCodeAt(v.length-1)),w=zr((y<t.length?t[y].value:r).charCodeAt(0)),x=!w||w===2&&!!g,S=!g||g===2&&!!w,T={tokens:t.slice(c,y),markers:[],start:0,end:0,open:p?x&&(!!g||!S):x,close:p?S&&(!!w||!x):S,split:p!==void 0};for(const N of T.tokens){o.set(N,[...T.tokens]),u.set(N,T);let j=N.value.length;for(;j--;)T.markers.push(N)}T.end=T.markers.length,a.push(T),c=y}for(S2(a,o),c=-1;++c<t.length;){const h=o.get(t[c]);if(h)return{attention:x2(t,h,u),index:c}}}function wu(t,i){const r=t[i?0:t.length-1];if(!r||r.attention)return;const a=i?Bu(r.value):ga(r.value),o=m0(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 w2(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 p=new Map(i);p.set(u,h);const y=Pu(t,p,a,o),v=y0(y,a,o);if(!v||v.index>r.index)return{chosen:p,mistake:v,tokens:y}}}}function S2(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],p=h.end-h.start,y=a.end-a.start;if(a.split?(h.close||a.open)&&y%3&&!((p+y)%3):p!==h.markers.length||p!==y)continue;const v=a.split?p>1&&y>1?2:1:y,g=h.markers.slice(h.end-v,h.end),w=a.markers.slice(a.start,a.start+v),x=g[0],S=w[0];if(x===g[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([...g,...w])];for(const N of T){const j=i.get(N);j&&j.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 k2(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(!Yx(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 E2(t,i,r){const a=i.indexStack,o=t.children||[],u=[];let c=-1,h=r.before;a.push(-1);let p=i.createTracker(r);for(;++c<o.length;){const y=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?Bu(x(o[c+1],t,i,{before:"",after:"",...p.current()})):""}else v=r.after;const g=u[u.length-1];typeof g=="string"&&(h==="\r"||h===`
|
|
42
|
+
`)&&y.type==="html"&&b2(y.value)!==7&&(u[u.length-1]=g.replace(/(\r?\n|\r)$/," "),h=" ",p=i.createTracker(r),p.move(Wu(u,r.before,r.after)));const w=i.handle.handlers[y.type];if(w&&w.attention){const x=Fh(y,w.attention,i,p);if(!x)continue;u.push(x),h=ga(x.sequences[0])}else{const x=i.handle(y,t,i,{...p.current(),after:v,before:h});if(!x)continue;p.move(x),u.push(x),h=ga(x)}}return a.pop(),u}function Fh(t,i,r,a){const{construct:o,markers:u,sizes:c}=i(t,r),h=k2(t.type,u,c),p=h[0],y=r.enter(o),v=r.createTracker(a.current());v.move(p);const g=E2(t,r,{...v.current(),before:p,after:p});if(y(),g.length!==0)return a.move(p),a.move(Wu(g,p,p)),a.move(p),{children:g,sequences:h}}function ub(t,i,r,a){let o=Pu(t,i,r,a),u=y0(o,r,a);for(;u;){const c=w2(t,i,u,r,a);if(!c)return;i=c.chosen,o=c.tokens,u=c.mistake}return o}function g0(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:"",p=c.sequences.find(function(y){const v=y.charAt(0);return v!==o.charAt(0)&&v!==h.charAt(0)||t.length===1&&p0.has(v)&&y.length>r.length})||c.sequences[0];p!==c.sequences[0]&&i.set(c,p),g0(c.children,i,p,p),o=p}}function Pu(t,i,r,a){const o=[];let u,c=ga(r),h=-1;for(;++h<t.length;){const p=t[h];if(typeof p=="string"){const B={value:p,attention:void 0};u&&u===Bu(p)&&wu([B],!0),u=void 0,o.push(B),B.value&&(c=ga(B.value));continue}const y=i.get(p)||p.sequences[0],v=y.charAt(0),g=t[h+1],w=c,x=Bu(g===void 0?a:typeof g=="string"?g:i.get(g)||g.sequences[0]),S=Pu(p.children,i,y,y),T=S[0].value,N=ob(w.charCodeAt(w.length-1),T.charCodeAt(0),v);N.inside&&wu(S,!0);const j=ga(S[S.length-1].value),M=ob(x.charCodeAt(0),j.charCodeAt(j.length-1),v);M.inside&&wu(S,!1),N.outside&&w!==`
|
|
43
|
+
`&&w!=="\r"&&wu(o,!1),M.outside&&(u=x),o.push({value:y,attention:p},...S,{value:y,attention:p}),c=y.charAt(y.length-1)}return o}function Wu(t,i,r){const a=new Map;g0(t,a,i,r);const o=(a.size>0?ub(t,a,i,r):void 0)||ub(t,new Map,i,r)||Pu(t,new Map,i,r);let u="";for(const c of o)u+=c.value;return u}Gh.attention=v0;Gh.peek=j2;function Gh(t,i,r,a){const o=r.enter("phrasing"),u=Fh(t,v0,r,r.createTracker(a)),c=u?Wu([u],a.before,a.after):"";return o(),c}function v0(t,i){return{construct:"emphasis",markers:v2(i)==="*"?["*","_"]:["_","*"],sizes:[1]}}function j2(t,i,r){return r.options.emphasis||"*"}function T2(t,i){let r=!1;return Ju(t,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return r=!0,qs}),!!((!t.depth||t.depth<3)&&$u(t)&&(i.options.setext||r))}function N2(t,i,r,a){const o=Math.max(Math.min(6,t.depth||1),1),u=r.createTracker(a);if(T2(t,r)){const g=r.enter("headingSetext"),w=r.enter("phrasing"),x=r.containerPhrasing(t,{...u.current(),before:`
|
|
44
|
+
`,after:`
|
|
45
|
+
`});return w(),g(),x+`
|
|
46
|
+
`+(o===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
47
|
+
`))+1))}const c="#".repeat(o),h=r.enter("headingAtx"),p=r.enter("phrasing");u.move(c+" ");let y=r.containerPhrasing(t,{before:"# ",after:`
|
|
48
|
+
`,...u.current()});const v=y.charCodeAt(0);return(v===9||v===32)&&(y=m0(v)+y.slice(1)),y=y?c+" "+y:c,r.options.closeAtx&&(y+=" "+c),p(),h(),y}b0.peek=C2;function b0(t){return t.value||""}function C2(){return"<"}x0.peek=A2;function x0(t,i,r,a){const o=Yh(r),u=o==='"'?"Quote":"Apostrophe",c=r.enter("image");let h=r.enter("label");const p=r.createTracker(a);let y=p.move("![");return y+=p.move(r.safe(t.alt,{before:y,after:"]",...p.current()})),y+=p.move("]("),h(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(h=r.enter("destinationLiteral"),y+=p.move("<"),y+=p.move(r.safe(t.url,{before:y,after:">",...p.current()})),y+=p.move(">")):(h=r.enter("destinationRaw"),y+=p.move(r.safe(t.url,{before:y,after:t.title?" ":")",...p.current()}))),h(),t.title&&(h=r.enter(`title${u}`),y+=p.move(" "+o),y+=p.move(r.safe(t.title,{before:y,after:o,...p.current()})),y+=p.move(o),h()),y+=p.move(")"),c(),y}function A2(){return"!"}w0.peek=R2;function w0(t,i,r,a){const o=t.referenceType,u=r.enter("imageReference");let c=r.enter("label");const h=r.createTracker(a);let p=h.move("![");const y=r.safe(t.alt,{before:p,after:"]",...h.current()});p+=h.move(y+"]["),c();const v=r.stack;r.stack=v.filter(function(w){return w!=="phrasing"}),c=r.enter("reference");const g=r.safe(r.associationId(t),{before:p,after:"]",...h.current()});return c(),r.stack=v,u(),o==="full"||!y||y!==g?p+=h.move(g+"]"):o==="shortcut"?p=p.slice(0,-1):p+=h.move("]"),p}function R2(){return"!"}S0.peek=_2;function S0(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 p;for(;p=h.exec(a);){let y=p.index;a.charCodeAt(y)===10&&a.charCodeAt(y-1)===13&&y--,a=a.slice(0,y)+" "+a.slice(p.index+1)}}return o+a+o}function _2(){return"`"}function k0(t,i){const r=$u(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))}E0.peek=O2;function E0(t,i,r,a){const o=Yh(r),u=o==='"'?"Quote":"Apostrophe",c=r.createTracker(a);if(k0(t,r)){const S=r.stack;r.stack=S.filter(function(j){return j!=="phrasing"});const T=r.enter("autolink");let N=c.move("<");return N+=c.move(r.containerPhrasing(t,{before:N,after:">",...c.current()})),N+=c.move(">"),T(),r.stack=S,N}const h=r.enter("link");let p=r.enter("label"),y=c.move("[");const v=r.containerPhrasing(t,{before:y,after:"](",...c.current()});y+=c.move(v),p(),y+=c.move("](");const g=/[\0- \u007F]/.test(t.url),w=a.before.charAt(a.before.length-1);let x=t.title||void 0;if(!x&&!g&&(w===`
|
|
49
|
+
`||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"||g?(p=r.enter("destinationLiteral"),y+=c.move("<"),y+=c.move(r.safe(t.url,{before:y,after:">",...c.current()})),y+=c.move(">")):(p=r.enter("destinationRaw"),y+=c.move(r.safe(t.url,{before:y,after:typeof x=="string"?" ":")",...c.current()}))),p(),typeof x=="string"&&(p=r.enter(`title${u}`),y+=c.move(" "+o),y+=c.move(r.safe(x,{before:y,after:o,...c.current()})),y+=c.move(o),p()),y+=c.move(")"),h(),y}function O2(t,i,r){return k0(t,r)?"<":"["}j0.peek=z2;function j0(t,i,r,a){const o=t.referenceType,u=r.enter("linkReference");let c=r.enter("label");const h=r.createTracker(a);let p=h.move("[");const y=r.containerPhrasing(t,{before:p,after:"]",...h.current()});p+=h.move(y+"]["),c();const v=r.stack;r.stack=v.filter(function(w){return w!=="phrasing"}),c=r.enter("reference");const g=r.safe(r.associationId(t),{before:p,after:"]",...h.current()});return c(),r.stack=v,u(),o==="full"||!y||y!==g?p+=h.move(g+"]"):o==="shortcut"?p=p.slice(0,-1):p+=h.move("]"),p}function z2(){return"["}function $h(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 M2(t){const i=$h(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 q2(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 T0(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 D2(t,i,r,a){const o=r.enter("list"),u=r.bulletCurrent;let c=t.ordered?q2(r):$h(r);const h=t.ordered?c==="."?")":".":M2(r);let p=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&&(p=!0),T0(r)===c&&v){let g=-1;for(;++g<t.children.length;){const w=t.children[g];if(w&&w.type==="listItem"&&w.children&&w.children[0]&&w.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(c=h),r.bulletCurrent=c;const y=r.containerFlow(t,a);return r.bulletLastUsed=c,r.bulletCurrent=u,o(),y}function L2(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 B2(t,i,r,a){const o=L2(r);let u=r.bulletCurrent||$h(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 p=r.enter("listItem"),y=r.indentLines(r.containerFlow(t,h.current()),v);return p(),y;function v(g,w,x){return w?(x?"":" ".repeat(c))+g:(x?u:u+" ".repeat(c-u.length))+g}}function U2(t,i,r,a){const o=r.enter("paragraph"),u=r.enter("phrasing"),c=r.containerPhrasing(t,a);return u(),o(),c}function H2(t,i,r,a){if(!t.children.some(function(h){return o2(h)}))return r.containerFlow(t,a);const u=r.enter("phrasing"),c=r.containerPhrasing(t,a);return u(),c}function I2(t){const i=t.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}Xh.attention=N0;Xh.peek=V2;function Xh(t,i,r,a){const o=r.enter("phrasing"),u=Fh(t,N0,r,r.createTracker(a)),c=u?Wu([u],a.before,a.after):"";return o(),c}function N0(t,i){return{construct:"strong",markers:I2(i)==="*"?["*","_"]:["_","*"],sizes:[2]}}function V2(t,i,r){return r.options.strong||"*"}function Y2(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 F2(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 G2(t,i,r){const a=(T0(r)+(r.options.ruleSpaces?" ":"")).repeat(F2(r));return r.options.ruleSpaces?a.slice(0,-1):a}const yh={blockquote:u2,break:sb,code:p2,definition:g2,emphasis:Gh,hardBreak:sb,heading:N2,html:b0,image:x0,imageReference:w0,inlineCode:S0,link:E0,linkReference:j0,list:D2,listItem:B2,paragraph:U2,root:H2,strong:Xh,text:Y2,thematicBreak:G2};function $2(){return{enter:{table:X2,tableData:cb,tableHeader:cb,tableRow:Z2},exit:{codeText:K2,table:Q2,tableData:Zd,tableHeader:Zd,tableRow:Zd}}}function X2(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 Q2(t){this.exit(t),this.data.inTable=void 0}function Z2(t){this.enter({type:"tableRow",children:[],position:void 0},t)}function Zd(t){this.exit(t)}function cb(t){this.enter({type:"tableCell",children:[],position:void 0},t)}function K2(t){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,J2));const r=this.stack[this.stack.length-1];r.type,r.value=i,this.exit(t)}function J2(t,i){return i==="|"?i:t}function P2(t){const i=t||{},{tableCellPadding:r,tablePipeAlign:a,stringLength:o}=i,u=r?" ":"|";return{handlers:{inlineCode:w,table:c,tableCell:p,tableRow:h},join:[W2],unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
50
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}]};function c(x,S,T,N){const j=v(x,T,N),M=j[0];if(M){let B=x.align?x.align.length:0,K=-1;if(!B)for(;++K<j.length;)j[K].length>B&&(B=j[K].length);for(;M.length<B;)M.push("")}return y(j,x.align)}function h(x,S,T,N){const j=g(x,T,N),M=y([j]);return M.slice(0,M.indexOf(`
|
|
51
|
+
`))}function p(x,S,T,N){const j=T.enter("tableCell"),M=T.enter("phrasing"),B=T.containerPhrasing(x,{...N,before:u,after:u});return M(),j(),B}function y(x,S){return a2(x,{align:S,alignDelimiters:a,fillRows:!1,padding:r,stringLength:o})}function v(x,S,T){const{children:N}=x;let j=-1;const M=[],B=S.enter("table");for(;++j<N.length;)M[j]=g(N[j],S,T);return B(),M}function g(x,S,T){const{children:N}=x;let j=-1;const M=[],B=S.enter("tableRow");for(;++j<N.length;)M[j]=p(N[j],x,S,T);return B(),M}function w(x,S,T){const N=yh.inlineCode(x,S,T);if(!T.stack.includes("tableCell"))return N;const j=[];let M=0,B=N.indexOf("|");for(;B!==-1;){let K=B;for(;K>M&&N.charCodeAt(K-1)===92;)K--;j.push(N.slice(M,B)),(B-K)%2===0&&j.push("\\"),M=B,B=N.indexOf("|",B+1)}return j.push(N.slice(M)),j.join("")}}function W2(t,i,r,a){if(t.type==="table"&&r.type==="listItem"&&r.spread===!1&&(i.type==="definition"||i.type==="heading"&&eR(i,a)||i.type==="paragraph"||i.type==="table"))return 1}function eR(t,i){let r=!1;return Ju(t,function(a){if(a.type==="break"||"value"in a&&/\r?\n|\r/.test(a.value))return r=!0,qs}),!!((!t.depth||t.depth<3)&&$u(t)&&(i.options.setext||r))}function tR(){return{exit:{taskListCheckValueChecked:fb,taskListCheckValueUnchecked:fb,paragraph:iR}}}function nR(){return{handlers:{paragraph:rR},join:[lR]}}function fb(t){const i=this.stack[this.stack.length-2];i.type,i.checked=t.type==="taskListCheckValueChecked"}function iR(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 rR(t,i,r,a){if(!i||i.type!=="listItem"||C0(i)!==t)return yh.paragraph(t,i,r,a);const o="["+(i.checked?"x":" ")+"] ",u=r.createTracker(a);u.move(o);const c=yh.paragraph(t.children.length>0?t:{type:"paragraph",children:[{type:"text",value:" "}]},i,r,{...a,...u.current()});return o+c}function lR(t,i,r){if(!(t.type==="definition"&&r.type==="listItem"))return;const a=C0(r);if(a&&r.children.indexOf(t)<r.children.indexOf(a))return 0}function C0(t){if(typeof t.checked=="boolean")for(const i of t.children){if(i.type==="paragraph")return i;if(i.type!=="definition")return}}function aR(){return[jA(),ZA(),WA(),$2(),tR()]}function sR(t){return{extensions:[TA(),KA(t),e2(),P2(t),nR()]}}const oR={tokenize:mR,partial:!0},A0={tokenize:pR,partial:!0},R0={tokenize:yR,partial:!0},_0={tokenize:gR,partial:!0},uR={tokenize:vR,partial:!0},O0={name:"wwwAutolink",tokenize:dR,previous:M0},z0={name:"protocolAutolink",tokenize:hR,previous:q0},tr={name:"emailAutolink",tokenize:fR,previous:D0},_i={};function cR(){return{text:_i}}let sl=48;for(;sl<123;)_i[sl]=tr,sl++,sl===58?sl=65:sl===91&&(sl=97);_i[43]=tr;_i[45]=tr;_i[46]=tr;_i[95]=tr;_i[72]=[tr,z0];_i[104]=[tr,z0];_i[87]=[tr,O0];_i[119]=[tr,O0];function fR(t,i,r){const a=this;let o,u;return c;function c(g){return!gh(g)||!D0.call(a,a.previous)||Qh(a.events)?r(g):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),h(g))}function h(g){return gh(g)?(t.consume(g),h):g===64?(t.consume(g),p):r(g)}function p(g){return g===46?t.check(uR,v,y)(g):g===45||g===95||vn(g)?(u=!0,t.consume(g),p):v(g)}function y(g){return t.consume(g),o=!0,p}function v(g){return u&&o&&gn(a.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),i(g)):r(g)}}function dR(t,i,r){const a=this;return o;function o(c){return c!==87&&c!==119||!M0.call(a,a.previous)||Qh(a.events)?r(c):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(oR,t.attempt(A0,t.attempt(R0,u),r),r)(c))}function u(c){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),i(c)}}function hR(t,i,r){const a=this;let o="",u=!1;return c;function c(g){return(g===72||g===104)&&q0.call(a,a.previous)&&!Qh(a.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),o+=String.fromCodePoint(g),t.consume(g),h):r(g)}function h(g){if(gn(g)&&o.length<5)return o+=String.fromCodePoint(g),t.consume(g),h;if(g===58){const w=o.toLowerCase();if(w==="http"||w==="https")return t.consume(g),p}return r(g)}function p(g){return g===47?(t.consume(g),u?y:(u=!0,p)):r(g)}function y(g){return g===null||Mu(g)||Lt(g)||dl(g)||Ys(g)?r(g):t.attempt(A0,t.attempt(R0,v),r)(g)}function v(g){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),i(g)}}function mR(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 pR(t,i,r){let a,o,u;return c;function c(y){return y===46||y===95?t.check(_0,p,h)(y):y===null||Lt(y)||dl(y)||y!==45&&Ys(y)?p(y):(u=!0,t.consume(y),c)}function h(y){return y===95?a=!0:(o=a,a=void 0),t.consume(y),c}function p(y){return o||a||!u?r(y):i(y)}}function yR(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(_0,i,u)(c):c===null||Lt(c)||dl(c)?i(c):(t.consume(c),o)}function u(c){return c===41&&a++,t.consume(c),o}}function gR(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||Lt(h)||dl(h)?i(h):r(h)}function o(h){return h===null||h===40||h===91||Lt(h)||dl(h)?i(h):a(h)}function u(h){return gn(h)?c(h):r(h)}function c(h){return h===59?(t.consume(h),a):gn(h)?(t.consume(h),c):r(h)}}function vR(t,i,r){return a;function a(u){return t.consume(u),o}function o(u){return vn(u)?r(u):i(u)}}function M0(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Lt(t)}function q0(t){return!gn(t)}function D0(t){return!(t===47||gh(t))}function gh(t){return t===43||t===45||t===46||t===95||vn(t)}function Qh(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 bR={tokenize:NR,partial:!0};function xR(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:ER,continuation:{tokenize:jR},exit:TR}},text:{91:{name:"gfmFootnoteCall",tokenize:kR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:wR,resolveTo:SR}}}}function wR(t,i,r){const a=this;let o=a.events.length;const u=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;o--;){const p=a.events[o][1];if(p.type==="labelImage"){c=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return h;function h(p){if(!c||!c._balanced)return r(p);const y=di(a.sliceSerialize({start:c.end,end:a.now()}));return y.codePointAt(0)!==94||!u.includes(y.slice(1))?r(p):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(p),t.exit("gfmFootnoteCallLabelMarker"),i(p))}}function SR(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 kR(t,i,r){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u=0,c;return h;function h(g){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),p}function p(g){return g!==94?r(g):(t.enter("gfmFootnoteCallMarker"),t.consume(g),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",y)}function y(g){if(u>999||g===93&&!c||g===null||g===91||Lt(g))return r(g);if(g===93){t.exit("chunkString");const w=t.exit("gfmFootnoteCallString");return o.includes(di(a.sliceSerialize(w)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),i):r(g)}return Lt(g)||(c=!0),u++,t.consume(g),g===92?v:y}function v(g){return g===91||g===92||g===93?(t.consume(g),u++,y):y(g)}}function ER(t,i,r){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u,c=0,h;return p;function p(S){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(S),t.exit("gfmFootnoteDefinitionLabelMarker"),y}function y(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||Lt(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 Lt(S)||(h=!0),c++,t.consume(S),S===92?g:v}function g(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),xt(t,x,"gfmFootnoteDefinitionWhitespace")):r(S)}function x(S){return i(S)}}function jR(t,i,r){return t.check(Fs,i,t.attempt(bR,i,r))}function TR(t){t.exit("gfmFootnoteDefinition")}function NR(t,i,r){const a=this;return xt(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 CR(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 p=-1;for(;++p<c.length;)if(c[p][0]==="enter"&&c[p][1].type==="strikethroughSequenceTemporary"&&c[p][1]._close){let y=p;for(;y--;)if(c[y][0]==="exit"&&c[y][1].type==="strikethroughSequenceTemporary"&&c[y][1]._open&&c[p][1].end.offset-c[p][1].start.offset===c[y][1].end.offset-c[y][1].start.offset){c[p][1].type="strikethroughSequence",c[y][1].type="strikethroughSequence";const v={type:"strikethrough",start:Object.assign({},c[y][1].start),end:Object.assign({},c[p][1].end)},g={type:"strikethroughText",start:Object.assign({},c[y][1].end),end:Object.assign({},c[p][1].start)},w=[["enter",v,h],["enter",c[y][1],h],["exit",c[y][1],h],["enter",g,h]],x=h.parser.constructs.insideSpan.null;x&&fi(w,w.length,0,Xu(x,c.slice(y+1,p),h)),fi(w,w.length,0,[["exit",g,h],["enter",c[p][1],h],["exit",c[p][1],h],["exit",v,h]]),fi(c,y-1,p-y+3,w),p=y+w.length-2;break}}for(p=-1;++p<c.length;)c[p][1].type==="strikethroughSequenceTemporary"&&(c[p][1].type="data");return c}function u(c,h,p){const y=this.previous,v=this.events;let g=0;return w;function w(S){return y===126&&v[v.length-1][1].type!=="characterEscape"?p(S):(c.enter("strikethroughSequenceTemporary"),x(S))}function x(S){const T=zr(y);if(S===126)return g>1?p(S):(c.consume(S),g++,x);if(g<2&&!r)return p(S);const N=c.exit("strikethroughSequenceTemporary"),j=zr(S);return N._open=!j||j===2&&!!T,N._close=!T||T===2&&!!j,h(S)}}}class AR{constructor(){this.map=[],this.index=new Map}add(i,r,a){RR(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 RR(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 _R(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 OR(){return{flow:{null:{name:"table",tokenize:zR,resolveAll:MR}}}}function zR(t,i,r){const a=this;let o=0,u=0,c;return h;function h(O){let V=a.events.length-1;for(;V>-1;){const{type:oe}=a.events[V][1];if(oe==="lineEnding"||oe==="linePrefix")V--;else break}const Z=V>-1?a.events[V][1].type:null,ke=Z==="tableHead"||Z==="tableRow"?A:p;return ke===A&&a.parser.lazy[a.now().line]?r(O):ke(O)}function p(O){return t.enter("tableHead"),t.enter("tableRow"),y(O)}function y(O){return O===124||(c=!0,u+=1),v(O)}function v(O){return O===null?r(O):He(O)?u>1?(u=0,a.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),x):r(O):tt(O)?xt(t,v,"whitespace")(O):(u+=1,c&&(c=!1,o+=1),O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),c=!0,v):(t.enter("data"),g(O)))}function g(O){return O===null||O===124||Lt(O)?(t.exit("data"),v(O)):(t.consume(O),O===92?w:g)}function w(O){return O===92||O===124?(t.consume(O),g):g(O)}function x(O){return a.interrupt=!1,a.parser.lazy[a.now().line]?r(O):(t.enter("tableDelimiterRow"),c=!1,tt(O)?xt(t,S,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):S(O))}function S(O){return O===45||O===58?N(O):O===124?(c=!0,t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),T):ee(O)}function T(O){return tt(O)?xt(t,N,"whitespace")(O):N(O)}function N(O){return O===58?(u+=1,c=!0,t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),j):O===45?(u+=1,j(O)):O===null||He(O)?K(O):ee(O)}function j(O){return O===45?(t.enter("tableDelimiterFiller"),M(O)):ee(O)}function M(O){return O===45?(t.consume(O),M):O===58?(c=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),B):(t.exit("tableDelimiterFiller"),B(O))}function B(O){return tt(O)?xt(t,K,"whitespace")(O):K(O)}function K(O){return O===124?S(O):O===null||He(O)?!c||o!==u?ee(O):(t.exit("tableDelimiterRow"),t.exit("tableHead"),i(O)):ee(O)}function ee(O){return r(O)}function A(O){return t.enter("tableRow"),D(O)}function D(O){return O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),D):O===null||He(O)?(t.exit("tableRow"),i(O)):tt(O)?xt(t,D,"whitespace")(O):(t.enter("data"),Y(O))}function Y(O){return O===null||O===124||Lt(O)?(t.exit("data"),D(O)):(t.consume(O),O===92?le:Y)}function le(O){return O===92||O===124?(t.consume(O),Y):Y(O)}}function MR(t,i){let r=-1,a=!0,o=0,u=[0,0,0,0],c=[0,0,0,0],h=!1,p=0,y,v,g;const w=new AR;for(;++r<t.length;){const x=t[r],S=x[1];x[0]==="enter"?S.type==="tableHead"?(h=!1,p!==0&&(db(w,i,p,y,v),v=void 0,p=0),y={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},w.add(r,0,[["enter",y,i]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(a=!0,g=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],g=Su(w,i,u,o,void 0,g),u=[0,0,0,0]),c[2]=r)):S.type==="tableCellDivider"&&(a?a=!1:(u[1]!==0&&(c[0]=c[1],g=Su(w,i,u,o,void 0,g)),u=c,c=[u[1],r,0,0])):S.type==="tableHead"?(h=!0,p=r):S.type==="tableRow"||S.type==="tableDelimiterRow"?(p=r,u[1]!==0?(c[0]=c[1],g=Su(w,i,u,o,r,g)):c[1]!==0&&(g=Su(w,i,c,o,r,g)),o=0):o&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(c[3]=r)}for(p!==0&&db(w,i,p,y,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=_R(i.events,r))}return t}function Su(t,i,r,a,o,u){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",h="tableContent";r[0]!==0&&(u.end=Object.assign({},ma(i.events,r[0])),t.add(r[0],0,[["exit",u,i]]));const p=ma(i.events,r[1]);if(u={type:c,start:Object.assign({},p),end:Object.assign({},p)},t.add(r[1],0,[["enter",u,i]]),r[2]!==0){const y=ma(i.events,r[2]),v=ma(i.events,r[3]),g={type:h,start:Object.assign({},y),end:Object.assign({},v)};if(t.add(r[2],0,[["enter",g,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",g,i]])}return o!==void 0&&(u.end=Object.assign({},ma(i.events,o)),t.add(o,0,[["exit",u,i]]),u=void 0),u}function db(t,i,r,a,o){const u=[],c=ma(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 ma(t,i){const r=t[i],a=r[0]==="enter"?"start":"end";return r[1][a]}const qR={name:"tasklistCheck",tokenize:LR};function DR(){return{text:{91:qR}}}function LR(t,i,r){const a=this;return o;function o(p){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?r(p):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(p),t.exit("taskListCheckMarker"),u)}function u(p){return Lt(p)?(t.enter("taskListCheckValueUnchecked"),t.consume(p),t.exit("taskListCheckValueUnchecked"),c):p===88||p===120?(t.enter("taskListCheckValueChecked"),t.consume(p),t.exit("taskListCheckValueChecked"),c):r(p)}function c(p){return p===93?(t.enter("taskListCheckMarker"),t.consume(p),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),h):r(p)}function h(p){return He(p)?i(p):tt(p)?t.check({tokenize:BR},i,r)(p):r(p)}}function BR(t,i,r){return xt(t,a,"whitespace");function a(o){return o===null?r(o):i(o)}}function UR(t){return Ix([cR(),xR(),CR(t),OR(),DR()])}const HR={};function IR(t){const i=this,r=t||HR,a=i.data(),o=a.micromarkExtensions||(a.micromarkExtensions=[]),u=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);o.push(UR(r)),u.push(aR()),c.push(sR(r))}const VR="cnv_[A-Za-z0-9_-]{16}",YR="[1-9]\\d{0,8}",Zh="[A-Za-z0-9_-]+(?:\\/[A-Za-z0-9_-]+)*\\.html",Kh="[A-Za-z][A-Za-z0-9_-]{0,64}",FR=new RegExp(`^canvas:(${VR})(?:@(${YR}))?(?:/(${Zh}))?(?:#(${Kh}))?$`),GR=new RegExp(`^(${Zh})(?:#(${Kh}))?$`);function ec(t){return new RegExp(`^${Zh}$`).test(t)}function vh(t){return new RegExp(`^${Kh}$`).test(t)}function $R(t,i){return L0(t)?t:i(t)}function L0(t){if(!t)return null;const i=FR.exec(t);if(!i)return null;const r=i[2]?Number(i[2]):null;return{canvasId:i[1]??"",revision:r!=null&&Number.isSafeInteger(r)?r:null,page:i[3]??null,anchor:i[4]??null}}function XR(t){const i=GR.exec(t);return i?.[1]?{page:i[1],anchor:i[2]??null}:null}const QR=new Set(["tbody","thead","tfoot"]),ZR=/^(\d+):([a-z][a-z0-9-]*)$/;function KR(t){return(t??"").replace(/\s+/g," ").trim().slice(0,120)}function B0(t,i=null){const r={tag:t.tagName.toLowerCase(),classes:t.classList?[...t.classList]:[],text:KR(t.textContent),rawChildren:[],parent:i};for(let a=0;a<t.children.length;a++)r.rawChildren.push(B0(t.children[a],r));return r}function JR(t){const i=[];for(const r of t.rawChildren)t.tag==="table"&&QR.has(r.tag)?i.push(...r.rawChildren):i.push(r);return i}function PR(t){if(t==="")return[];if(t.length>500||t.includes("//"))return null;const i=t.split("/"),r=[];for(const a of i){const o=ZR.exec(a);if(!o)return null;const u=Number(o[1]);if(!Number.isInteger(u)||u>1e4||String(u)!==o[1])return null;r.push({index:u,tag:o[2]})}return r}function WR(t){return t.map(i=>`${i.index}:${i.tag}`).join("/")}function e_(t,i){const r=PR(i);if(!r)return null;const a=[{path:"",tag:t.tag,classes:t.classes}],o=[];let u=t;for(const c of r){const h=JR(u)[c.index];if(!h||h.tag!==c.tag)return null;o.push(c),u=h,a.push({path:WR(o),tag:h.tag,classes:h.classes})}return{node:u,breadcrumb:a}}function t_(t,i){const r=e_(t,i);if(!r)return null;const a=r.node.text.slice(0,80),o=a.length>42?`${a.slice(0,42)}…`:a;return{path:i,tag:r.node.tag,classes:r.node.classes,text:a,breadcrumb:r.breadcrumb,label:o?`${r.node.tag} · ${o}`:r.node.tag}}const n_=/\[canvas-target canvas=(cnv_[A-Za-z0-9_-]{16}) rev=([1-9]\d{0,8}) path=(\.|[0-9]+:[a-z][a-z0-9-]*(?:\/[0-9]+:[a-z][a-z0-9-]*)*) tag=([a-z][a-z0-9-]*)\]([^[\]]*)\[\/canvas-target\]/g;function i_(t,i,r,a){const o=t.replace(/\s+/g," ").trim(),u=o.length>18?`${o.slice(0,18)}…`:o,c=a.replace(/\s+/g," ").trim(),h=c.length>12?`${c.slice(0,12)}…`:c,p=h?`${r} · ${h}`:r;return u?`${u} · ${i} · ${p}`:`${i} · ${p}`}function r_(t){const i=t.label.replace(/[[\]\r\n]/g," ").replace(/\s+/g," ").trim(),r=t.path===""?".":t.path;return`[canvas-target canvas=${t.canvasId} rev=${t.revision} path=${r} tag=${t.tag}]${i}[/canvas-target]`}function U0(t){const i=[];return{text:t.replace(n_,(a,o,u,c,h,p)=>(i.push({canvasId:o,revision:Number(u),path:c==="."?"":c,tag:h,label:p.trim()}),"")).replace(/\n{3,}/g,`
|
|
52
|
+
|
|
53
|
+
`).trim(),chips:i}}const l_=new Set(["accepted","enqueued","started"]);function a_(t,i){const r=new Map(i.map(u=>[u.id,u.status])),a=new Map,o=[];for(const u of t)if(s_(u,r)){if(!u.ticketId){o.push(u);continue}a.set(u.ticketId,u)}return{byTicket:a,loose:o}}function s_(t,i){if(t.previewRevision==null)return!1;if(!t.ticketId)return!0;const r=i.get(t.ticketId);return r==null?!0:!l_.has(r)}function hb(){return{revision:null,files:new Map}}async function o_(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 u_(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 c_(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 o_(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 f_(t,i,r){const a=u_(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 c_(t,i,o)}function d_(t,i){return i.ok?i.src:t}const mb=[{id:"desktop",width:1280,label:"canvas.device.desktop"},{id:"tablet",width:768,label:"canvas.device.tablet"},{id:"phone",width:390,label:"canvas.device.phone"}],h_={byTicket:new Map,loose:[],open:(t,i)=>{}},H0=E.createContext(h_);function I0(){return E.useContext(H0)}const ol="canvas-inspect",m_=150;function pb(){return typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia("(prefers-reduced-motion: reduce)").matches?!1:typeof HTMLElement<"u"&&typeof HTMLElement.prototype.animate=="function"}function p_({title:t,revisions:i,activeRevision:r,phase:a,error:o,src:u,canvasId:c,onSelect:h,onRetry:p,onAdopt:y,onClose:v,origin:g=null,onOpened:w,onMention:x,routeStamp:S=0,routePage:T=null,routeAnchor:N=null}){const{t:j}=Ze(),M=E.useRef(null),B=E.useRef(null),K=E.useRef(null),ee=E.useRef(v);ee.current=v;const A=E.useRef(w);A.current=w;const D=E.useRef(()=>{}),[Y,le]=E.useState(pb()?"prepare":"settled"),[O,V]=E.useState("center center"),Z=E.useRef(Y);Z.current=Y;const ke=E.useRef(!1),oe=E.useRef(null),[ge,re]=E.useState("desktop"),[ce,xe]=E.useState(!1),[Te,R]=E.useState(""),[Ke,Ie]=E.useState(""),[q,z]=E.useState(null),[te,ue]=E.useState(null),ve=E.useRef(0),[ze,ye]=E.useState(null),[be,P]=E.useState(null),[he,We]=E.useState(0),dt=E.useRef(null),Ee=E.useRef(x),De=E.useRef(c),Me=E.useRef(r),Ve=E.useRef("");ke.current=ce,Ve.current=Te,oe.current=be,dt.current=ze,Ee.current=x,De.current=c,Me.current=r;const Ae=T&&ec(T)?T:null,Ue=N&&vh(N)?N:null,nt=S>0&&S!==ve.current;u!==Ke?(Ie(u),R(u?b_():""),u!==""&&(S>0&&(ve.current=S),z(S>0?Ae:null),ue(S>0?Ue:null),xe(!1),P(null),We(0))):nt&&u&&(ve.current=S,z(Ae),ue(Ue),xe(!1),P(null));const ae=q??yb(u),Be=v_(u,Te,ae,he,te),ut=g_(u,ae),Kt=t||j("canvas.card"),Bt=i.find(we=>we.revision===r)??null,Q=mb.find(we=>we.id===ge)?.width??1280,se=()=>{if(Z.current!=="leave"){if(!pb()){ee.current();return}Z.current="leave",le("leave")}};D.current=se,E.useLayoutEffect(()=>{if(Y!=="prepare")return;const we=M.current;if(we&&g){const pe=we.getBoundingClientRect();V(`${g.x-pe.left}px ${g.y-pe.top}px`)}else V("center center");le("enter")},[Y,g]),E.useEffect(()=>{if(Y!=="enter")return;const we=M.current;let pe=!1;const Le=()=>{pe||(pe=!0,le(bt=>bt==="enter"?"settled":bt))};if(!we){Le();return}const Je=bt=>{bt.target===we&&bt.animationName==="canvas-zoom-in"&&Le()};we.addEventListener("animationend",Je);const lt=window.setTimeout(Le,260);return()=>{we.removeEventListener("animationend",Je),window.clearTimeout(lt)}},[Y]),E.useEffect(()=>{Y==="settled"&&A.current?.()},[Y]),E.useEffect(()=>{if(Y!=="leave")return;const we=M.current;let pe=!1;const Le=()=>{pe||(pe=!0,ee.current())};if(!we){Le();return}const Je=bt=>{bt.target===we&&bt.animationName==="canvas-zoom-out"&&Le()};we.addEventListener("animationend",Je);const lt=window.setTimeout(Le,280);return()=>{we.removeEventListener("animationend",Je),window.clearTimeout(lt)}},[Y]),E.useEffect(()=>{const we=document.activeElement instanceof HTMLElement?document.activeElement:null,pe=document.body.style.overflow;document.body.style.overflow="hidden",B.current?.focus();const Le=Je=>{if(Je.key==="Escape"){if(ke.current){Je.preventDefault(),Je.stopPropagation(),xe(!1);const wn=K.current?.contentWindow,Nt=Ve.current;wn&&typeof wn.postMessage=="function"&&Nt&&wn.postMessage({dsh:ol,nonce:Nt,type:"disarm"},"*");return}Je.preventDefault(),Je.stopPropagation(),D.current();return}if(Je.key!=="Tab")return;const lt=[...M.current?.querySelectorAll('button, iframe, [href], [tabindex="0"]')??[]],bt=lt[0],gt=lt.at(-1);Je.shiftKey&&(document.activeElement===bt||!M.current?.contains(document.activeElement))?(Je.preventDefault(),gt?.focus()):!Je.shiftKey&&(document.activeElement===gt||!M.current?.contains(document.activeElement))&&(Je.preventDefault(),bt?.focus())};return document.addEventListener("keydown",Le,!0),()=>{document.removeEventListener("keydown",Le,!0),document.body.style.overflow=pe,we?.isConnected&&we.focus()}},[]),E.useEffect(()=>{if(Y!=="settled"||!ut)return;let we=!1;return fetch(ut,{credentials:"omit",cache:"no-store"}).then(pe=>pe.ok?pe.text():Promise.reject(new Error("load"))).then(pe=>{we||ye(B0(new DOMParser().parseFromString(pe,"text/html").body))}).catch(()=>{we||ye(null)}),()=>{we=!0}},[Y,ut]),E.useEffect(()=>{if(!Te)return;const we=pe=>{if(pe.source!==K.current?.contentWindow)return;const Le=pe.data;if(!Le||Le.dsh!==ol||Le.nonce!==Te)return;if(Le.type==="open"&&typeof Le.path=="string"){const ht=XR(Le.path);if(!ht)return;z(Ft=>Ft===ht.page||Ft==null&&ht.page===yb(u)?Ft:ht.page),ue(ht.anchor),P(null),ye(null);return}if(!ke.current)return;if(Le.type==="ready"){const ht=oe.current;ht!=null&&K.current?.contentWindow?.postMessage({dsh:ol,nonce:Te,type:"pin",path:ht},"*");return}if(Le.type!=="select"||typeof Le.path!="string")return;const Je=dt.current,lt=Je?t_(Je,Le.path):null,bt=De.current,gt=Me.current;if(!lt||!bt||gt==null)return;P(Le.path);const wn=x_(K.current,Le.rect),Nt=i_(Kt,j("canvas.revision",{revision:String(gt)}),lt.tag,lt.text),Ct={canvasId:bt,revision:gt,path:lt.path,tag:lt.tag,label:Nt};w_(wn,Nt).then(()=>Ee.current?.(Ct))};return window.addEventListener("message",we),()=>window.removeEventListener("message",we)},[Te,u,j,Kt]);const _e=()=>{xe(!1),P(null),z(null),ue(null),We(Date.now())},Ne=we=>{const pe=K.current?.contentWindow;!pe||typeof pe.postMessage!="function"||!Te||pe.postMessage({dsh:ol,nonce:Te,type:we},"*")};return ml.createPortal(m.jsx("div",{className:Y==="leave"?"canvas-modal leaving":"canvas-modal",onClick:we=>{we.target===we.currentTarget&&se()},children:m.jsxs("div",{ref:M,className:`canvas-dialog ${Y}`,style:{transformOrigin:O},role:"dialog","aria-modal":"true","aria-label":Kt,children:[m.jsxs("header",{className:"canvas-toolbar",children:[m.jsxs("div",{className:"canvas-toolbar-title",children:[m.jsx("strong",{className:"canvas-name",title:Kt,children:Kt}),m.jsx("button",{ref:B,type:"button",className:"canvas-close","aria-label":j("canvas.close"),onClick:se,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:j("canvas.reset.hint"),onClick:_e,disabled:!u,children:j("canvas.reset")}),m.jsx("button",{type:"button",className:ce?"canvas-select on":"canvas-select","aria-pressed":ce,"aria-label":j("canvas.select"),title:j("canvas.select"),disabled:!u,onClick:()=>{if(ce){xe(!1),Ne("disarm");return}xe(!0),Ne("arm")},children:m.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[m.jsx("rect",{x:"6.4",y:"6.4",width:"11",height:"11",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6"}),m.jsx("path",{className:"cursor",d:"M1.8 1.4 2.15 9.2 4.6 6.8 6.7 11.4 8 10.8 5.9 6.2 9.2 6.4Z",fill:"currentColor"})]})}),m.jsx("div",{className:"canvas-segment",role:"group","aria-label":j("canvas.devices"),children:mb.map(we=>m.jsx("button",{type:"button","aria-pressed":ge===we.id,onClick:()=>re(we.id),children:j(we.label)},we.id))}),m.jsx("div",{className:"canvas-segment canvas-versions",role:"group","aria-label":j("canvas.versions"),children:i.map(we=>m.jsxs("button",{type:"button","aria-pressed":we.revision===r,disabled:we.status==="failed",title:we.error??j("canvas.revision",{revision:String(we.revision)}),onClick:()=>h(we.revision),children:[j("canvas.revision",{revision:String(we.revision)}),m.jsx("span",{className:"canvas-version-status",children:j(y_(we.status))})]},we.revision))}),m.jsx("button",{type:"button",className:"canvas-adopt",onClick:y,disabled:Bt?.status!=="preview"||a==="loading",children:Bt?.status==="stable"?j("canvas.adopted"):j("canvas.adopt")})]})]}),m.jsxs("div",{className:"canvas-stage",children:[a==="loading"?m.jsx("p",{className:"canvas-status",children:j("canvas.loading")}):null,a==="error"?m.jsxs("p",{className:"canvas-status",role:"alert",children:[m.jsx("span",{children:o||j("canvas.error")}),m.jsx("button",{type:"button",onClick:p,children:j("canvas.retry")})]}):null,Y==="settled"&&u?m.jsx("div",{className:"canvas-frame",style:{width:`min(100%, ${Q}px)`},children:m.jsx("iframe",{ref:K,title:Kt,sandbox:"allow-scripts",referrerPolicy:"no-referrer",src:Be||void 0,onLoad:()=>{if(!Te)return;const we=K.current?.contentWindow;!we||typeof we.postMessage!="function"||(we.postMessage({dsh:ol,nonce:Te,type:"hello"},"*"),te&&vh(te)&&we.postMessage({dsh:ol,nonce:Te,type:"focus",anchor:te},"*"),ke.current&&we.postMessage({dsh:ol,nonce:Te,type:"arm"},"*"))}})}):null]})]})}),document.body)}function y_(t){return t==="stable"?"canvas.stable":t==="failed"?"canvas.failed":"canvas.preview"}function yb(t){const r=/^\/dsh-bot\/canvas-media\/[A-Za-z0-9_-]{20,128}\/[1-9]\d{0,8}\/(.+)$/.exec(t.split("?")[0]??"")?.[1]??"";return ec(r)?r:"index.html"}function g_(t,i){const r=/^(\/dsh-bot\/canvas-media\/[A-Za-z0-9_-]{20,128}\/[1-9]\d{0,8}\/)/.exec(t.split("?")[0]??"");return!r||!ec(i)?t:`${r[1]}${i}`}function v_(t,i,r,a,o){const u=/^\/dsh-bot\/canvas-media\/([A-Za-z0-9_-]{20,128})\/([1-9]\d{0,8})\//.exec(t.split("?")[0]??"");if(!u||!i||!ec(r))return"";const c=`/dsh-bot/canvas-inspect/${u[1]}/${u[2]}/${r}?nonce=${encodeURIComponent(i)}`,h=a?`${c}&r=${a}`:c;return o&&vh(o)?`${h}#${o}`:h}function b_(){const t=new Uint8Array(16);return crypto.getRandomValues(t),[...t].map(i=>i.toString(16).padStart(2,"0")).join("")}function x_(t,i){if(!t||!i||typeof i!="object")return null;const r=i;if(typeof r.x!="number"||typeof r.y!="number"||typeof r.width!="number"||typeof r.height!="number")return null;const a=t.getBoundingClientRect();return new DOMRect(a.left+r.x,a.top+r.y,r.width,r.height)}function w_(t,i){const r=document.querySelector(".composer-wrap .card");if(!t||!r||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return Promise.resolve();const a=r.getBoundingClientRect(),o=Math.min(Math.max(t.width,120),240),u=28,c=t.left+Math.min(t.width,240)/2-o/2,h=t.top+Math.min(t.height,36)/2-u/2,p=document.createElement("div");return p.className="canvas-fly",p.textContent=i,p.style.left=`${c}px`,p.style.top=`${h}px`,p.style.width=`${o}px`,document.body.append(p),p.animate([{transform:"translate(0px, 0px) scale(1)",opacity:.96},{transform:`translate(${a.left+16-c}px, ${a.top+8-h}px) scale(0.86)`,opacity:1}],{duration:560,easing:"cubic-bezier(0.2, 0.8, 0.2, 1)",fill:"forwards"}).finished.then(()=>p.remove(),()=>p.remove())}function gb(t,i,r){return`/dsh-bot/canvas-media/${t}/${i}/${r.split("/").map(a=>encodeURIComponent(a)).join("/")}`}function vb(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 bb(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 S_(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 k_({item:t,onOpen:i}){const{t:r}=Ze();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 E_({sessionId:t,pulse:i,tickets:r,onMention:a,onActive:o,dismiss:u=0,children:c}){const{t:h}=Ze(),[p,y]=E.useState([]),[v,g]=E.useState(!1),[w,x]=E.useState(null),S=E.useRef(null);S.current=w;const[T,N]=E.useState(!1),[j,M]=E.useState(null),B=E.useRef(0),K=E.useRef(null),[ee,A]=E.useState(null),[D,Y]=E.useState([]),[le,O]=E.useState(null),[V,Z]=E.useState("idle"),[ke,oe]=E.useState(""),[ge,re]=E.useState(""),ce=E.useRef(hb()),xe=E.useRef(null),Te=E.useRef(0),[R,Ke]=E.useState(u);u!==R&&(Ke(u),u>0&&x(null));const Ie=p.find(ye=>ye.id===w)??null,z=(j&&j.id===w&&j.revision!=null?j.revision:null)??Ie?.previewRevision??Ie?.stableRevision??null,te=E.useRef(async()=>{});E.useEffect(()=>{const ye=be=>{be.detail!==0&&(K.current={x:be.clientX,y:be.clientY,at:performance.now()})};return document.addEventListener("click",ye,!0),()=>document.removeEventListener("click",ye,!0)},[]),E.useEffect(()=>{x(null),y([]),g(!1)},[t]),E.useEffect(()=>{o?.(w!=null)},[w,o]),E.useEffect(()=>()=>o?.(!1),[o]),E.useEffect(()=>{if(!t)return;let ye=!1;const be=async()=>{const he=await Pe(`/canvas?sessionId=${encodeURIComponent(t)}`);if(!ye){if(he.status!==200){g(!0);return}g(!1),y(vb(he.body))}};be();const P=window.setInterval(()=>{be()},6e4);return()=>{ye=!0,window.clearInterval(P)}},[t,i]),E.useEffect(()=>{if(!w)return;let ye=!1;return Pe(`/canvas/${w}`).then(be=>{ye||be.status!==200||Y(bb(be.body))}),()=>{ye=!0}},[w,i,z]),E.useEffect(()=>{if(!(!w||!T||z==null))return te.current(w,z),()=>{Te.current+=1}},[w,z,T]);async function ue(ye,be){const P=++Te.current;xe.current!==ye&&(xe.current=ye,ce.current=hb(),re("")),Z("loading"),oe("");const he=await Pe(`/canvas/${ye}/token`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({revision:be})});if(P!==Te.current)return;const We=he.body.token;if(he.status!==200||typeof We!="string"){Z("error"),oe(h("canvas.error"));return}const dt=await Pe(`/canvas/${ye}/revisions/${be}`);if(P!==Te.current)return;const Ee=dt.status===200?S_(dt.body):null;if(!Ee){Z("error"),oe(h("canvas.error"));return}const De=await f_(ce.current,Ee,async Me=>{const Ve=await fetch(gb(We,be,Me),{credentials:"omit",cache:"no-store"});if(!Ve.ok)throw new Error(h("canvas.error"));return new Uint8Array(await Ve.arrayBuffer())});if(P===Te.current){if(!De.ok){ce.current=De.cache,Z("error"),oe(h("canvas.error"));return}ce.current=De.cache,re(Me=>d_(Me,{ok:!0,src:gb(We,Ee.revision,Ee.entry)})),O(Ee.revision),Z("ready")}}te.current=ue;const ve=E.useMemo(()=>a_(p,r),[p,r]),ze=E.useMemo(()=>({byTicket:ve.byTicket,loose:ve.loose,open:(ye,be)=>{const P=K.current,he=P!=null&&performance.now()-P.at<m_;A(he?{x:P.x,y:P.y}:null),S.current==null&&(N(!1),re(""),Z("idle")),B.current+=1,M({id:ye,stamp:B.current,revision:be?.revision??null,page:be?.page??null,anchor:be?.anchor??null}),x(ye)}}),[ve.byTicket,ve.loose]);return m.jsxs(H0.Provider,{value:ze,children:[c,v?m.jsx("p",{className:"canvas-list-error",children:h("canvas.unavailable")}):null,Ie?m.jsx(p_,{title:Ie.title,revisions:D,activeRevision:le,phase:V,error:ke,src:ge,onSelect:ye=>{ue(Ie.id,ye)},onRetry:()=>{le!=null?ue(Ie.id,le):z!=null&&ue(Ie.id,z)},onAdopt:()=>{le!=null&&Pe(`/canvas/${Ie.id}/adopt`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({revision:le})}).then(ye=>{ye.status===200&&(Pe(`/canvas/${Ie.id}`).then(be=>{be.status===200&&Y(bb(be.body))}),Pe(`/canvas?sessionId=${encodeURIComponent(t)}`).then(be=>{be.status===200&&y(vb(be.body))}))})},onClose:()=>x(null),origin:ee,onOpened:()=>N(!0),canvasId:Ie.id,onMention:a,routeStamp:j?.id===Ie.id?j.stamp:0,routePage:j?.id===Ie.id?j.page:null,routeAnchor:j?.id===Ie.id?j.anchor:null}):null]})}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 Y0=E.createContext(null);function j_({children:t}){const[i]=E.useState(V0);return m.jsx(Y0.Provider,{value:i,children:t})}function T_({src:t,alt:i="",title:r}){const{t:a}=Ze(),o=E.useContext(Y0),[u]=E.useState(V0),c=o??u,h=E.useSyncExternalStore(c.subscribe,()=>c.has(t??""),()=>!1),[p,y]=E.useState(null),v=h||p===t,[g,w]=E.useState(!1),[x,S]=E.useState(!1),T=E.useRef(null),N=E.useRef(null),j=E.useRef(null),M=E.useRef(null),B=i||a("image.untitled");E.useEffect(()=>{if(!g||v)return;const A=document.activeElement instanceof HTMLElement?document.activeElement:null,D=document.body.style.overflow;document.body.style.overflow="hidden",N.current?.focus();const Y=O=>{if(O.key==="Escape"&&(O.preventDefault(),O.stopPropagation(),w(!1)),O.key!=="Tab")return;const V=[...T.current?.querySelectorAll('button, [href], [tabindex="0"]')??[]],Z=V[0],ke=V.at(-1);O.shiftKey&&(document.activeElement===Z||!T.current?.contains(document.activeElement))?(O.preventDefault(),ke?.focus()):!O.shiftKey&&(document.activeElement===ke||!T.current?.contains(document.activeElement))&&(O.preventDefault(),Z?.focus())},le=O=>{T.current?.contains(O.target)||N.current?.focus()};return document.addEventListener("keydown",Y,!0),document.addEventListener("focusin",le),()=>{document.removeEventListener("keydown",Y,!0),document.removeEventListener("focusin",le),document.body.style.overflow=D,A?.isConnected?A.focus():j.current?.focus()}},[g,v]),E.useEffect(()=>{S(!1),w(!1)},[t]);function K(){S(A=>!A),M.current&&(M.current.scrollLeft=0,M.current.scrollTop=0)}function ee(){t&&(c.fail(t),y(t)),w(!1)}if(!t||v){const A=t?.split(/[?#]/)[0]?.split("/").at(-1);return m.jsxs("span",{className:"image-unavailable",role:"status",children:[m.jsx("strong",{children:i||A||a("image.untitled")}),m.jsx("span",{children:a("image.unavailable")}),t&&m.jsx("button",{ref:j,type:"button",onClick:()=>{w(!1),y(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":g,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:ee}),m.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a("image.enlarge")})]}),g&&ml.createPortal(m.jsx("div",{className:"image-lightbox",onClick:A=>{A.target===A.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:K,"aria-pressed":x,children:a(x?"image.fit":"image.original")}),m.jsx("button",{ref:N,type:"button",onClick:()=>w(!1),"aria-label":a("image.close"),children:a("image.close")})]}),m.jsx("div",{ref:M,className:x?"image-lightbox-stage original":"image-lightbox-stage",tabIndex:0,role:"region","aria-label":a(x?"image.scroll":"image.fit"),children:m.jsx("img",{src:t,alt:i,title:r,draggable:!1,onError:ee})})]})}),document.body)]})}function N_({text:t,language:i}){const[r,a]=E.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 C_({children:t}){const i=E.Children.toArray(t)[0];if(E.isValidElement(i)){const r=i,a=String(r.props.children??"").replace(/\n$/,""),o=/language-([\w-]+)/.exec(r.props.className??"");return m.jsx(N_,{text:a,language:o?.[1]})}return m.jsx("pre",{children:t})}function A_(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 bh=E.createContext({streaming:!1}),R_={pre:C_,img({src:t,alt:i,title:r}){const{resolveImage:a}=E.useContext(bh),o=typeof t=="string"?a?.(t):void 0,u=typeof t=="string"&&t!==""&&!/^(?:[a-z][a-z0-9+.-]*:|\/|#|\?)/i.test(t);return m.jsx(T_,{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}=E.useContext(bh),u=I0(),{t:c}=Ze();if(r?.children.some(y=>y.type==="element"&&y.tagName==="img"))return m.jsxs("span",{className:"image-preview-linked",children:[i,m.jsx("a",{href:t,target:"_blank",rel:"noreferrer",children:c("image.openLink")})]});const h=a?null:L0(t);if(h){if(![...u.byTicket.values(),...u.loose].some(g=>g.id===h.canvasId))return m.jsx(m.Fragment,{children:i});const v=[h.page,h.anchor?`#${h.anchor}`:""].filter(Boolean).join("");return m.jsx("button",{type:"button",className:"file-mention",title:v?`${h.canvasId} ${v}`:h.canvasId,onClick:()=>u.open(h.canvasId,{revision:h.revision,page:h.page,anchor:h.anchor}),children:i})}const p=a?null:A_(t);return p&&o?m.jsx("button",{type:"button",className:"file-mention",title:p.path,onClick:()=>o(p.path,p.line),children:i}):m.jsx("a",{href:t,target:"_blank",rel:"noreferrer",children:i})}};function __(t,i){if(!i)return t;const r=t.match(/```/g);return r&&r.length%2===1?`${t}
|
|
54
|
+
\`\`\``:t}function $s({text:t,streaming:i=!1,onOpenFile:r,resolveImage:a}){const o=E.useMemo(()=>({streaming:i,onOpenFile:r,resolveImage:a}),[i,r,a]);return m.jsx(bh.Provider,{value:o,children:m.jsx("div",{className:i?"markdown streaming":"markdown",children:m.jsx(yA,{remarkPlugins:[IR],components:R_,urlTransform:u=>$R(u,f0),children:__(t,i)})})})}const O_=E.lazy(()=>ej(()=>import("./SourceEditor-BO-dBzgs.js").then(t=>t.S),__vite__mapDeps([0,1]))),z_=50*1024*1024,F0="dsh-bot.files-drawer-width";function M_(){try{const t=localStorage.getItem(F0);return t==null||t===""?Ds:va(Number(t))}catch{return Ds}}function q_(t){try{localStorage.setItem(F0,String(t))}catch{}}function D_({open:t,sessionId:i,focus:r,onClose:a}){const{t:o}=Ze(),[u,c]=E.useState(null),[h,p]=E.useState("workspace"),[y,v]=E.useState(""),[g,w]=E.useState([]),[x,S]=E.useState("loading"),[T,N]=E.useState(""),[j,M]=E.useState(null),[B,K]=E.useState(0),[ee,A]=E.useState(M_),D=E.useRef(ee),[Y,le]=E.useState(!1),[O,V]=E.useState(()=>window.innerWidth),[Z,ke]=E.useState(()=>window.matchMedia("(max-width: 800px)").matches),[oe,ge]=E.useState(t),[re,ce]=E.useState(t?"in":"out"),[xe,Te]=E.useState(),[R,Ke]=E.useState(""),[Ie,q]=E.useState(!1),[z,te]=E.useState(null),[ue,ve]=E.useState(!1),[ze,ye]=E.useState(!1),[be,P]=E.useState(null),[he,We]=E.useState(""),dt=E.useRef(0),Ee=E.useRef(null),De=E.useRef(""),Me=E.useRef(!0),Ve=E.useRef(0),Ae=E.useRef(r),Ue=E.useRef(oe),nt=E.useRef(re);Ae.current=r,Ue.current=oe,nt.current=re,E.useEffect(()=>()=>{Me.current=!1,De.current&&URL.revokeObjectURL(De.current)},[]),E.useEffect(()=>{if(t){ge(!0),ce("in");return}if(Ue.current){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){ge(!1);return}ce("out")}},[t]),E.useEffect(()=>{const J=window.matchMedia("(max-width: 800px)"),me=()=>ke(J.matches);return J.addEventListener("change",me),()=>J.removeEventListener("change",me)},[]),E.useEffect(()=>{const J=()=>V(window.innerWidth);return window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)},[]);const ae=va(ee);Tx({present:oe,narrow:Z,motion:re,width:ae,resizing:Y,viewport:O}),E.useEffect(()=>{const J=me=>{if(me.key==="Escape"){if(z&&be==null){te(null);return}a()}};return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[a,z,be]),E.useEffect(()=>{if(!t)return;const J=new AbortController;return c(null),Ae.current||(v(""),M(null),N("")),Pe(`/files/roots?sessionId=${encodeURIComponent(i)}`,{signal:J.signal}).then(me=>{if(J.signal.aborted)return;const Et=typeof me.body.workspace=="string"?me.body.workspace:null,vt=typeof me.body.home=="string"?me.body.home:null,at=typeof me.body.workspaceReason=="string"?me.body.workspaceReason:"",Mt=typeof me.body.homeReason=="string"?me.body.homeReason:"";if(c({workspace:Et,workspaceReason:at,home:vt,homeReason:Mt}),Ae.current)return;const jt=wv({workspace:Et,home:vt,workspaceReason:at});jt.kind==="path"?(p(jt.root),v(jt.path)):(S("error"),N(o(jt.notice)))}).catch(()=>{J.signal.aborted||(S("error"),N(o("files.failed")))}),()=>J.abort()},[t,i,o]),E.useEffect(()=>{if(!t||!r||!u)return;const J=B_(u.workspace,r.path);if(!J){const Mt=wv(u);S("error"),N(o(Mt.kind==="unavailable"?Mt.notice:"files.missing"));return}const me=++Ve.current,Et=new AbortController,vt=J.split("/").filter(Boolean).at(-1)??J,at=U_(J,u.workspace,u.home);return Te(r.line),N(""),at&&p(at),Pe(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(J)}`,{signal:Et.signal}).then(Mt=>{if(!(me!==Ve.current||!Me.current)){if(Mt.status===200&&Array.isArray(Mt.body.items)){Te(void 0),Ke(""),M(null),S("loading"),(Mt.body.root==="workspace"||Mt.body.root==="home")&&p(Mt.body.root),v(typeof Mt.body.path=="string"?Mt.body.path:J);return}return Ke(J),v(H_(J)),Q(J,vt,0,me)}}).catch(()=>{me!==Ve.current||!Me.current||Et.signal.aborted||M({kind:"error",path:J,name:vt})}),()=>Et.abort()},[t,r,u,i,o]),E.useEffect(()=>{if(!y)return;const J=new AbortController;return S("loading"),N(""),Pe(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(y)}`,{signal:J.signal}).then(me=>{if(J.signal.aborted)return;if(me.status!==200||!Array.isArray(me.body.items)){w([]),S("error"),N(ku(me.body.error,o));return}const Et=typeof me.body.path=="string"?me.body.path:y;w(me.body.items.filter(Y_)),S("ready"),(me.body.root==="workspace"||me.body.root==="home")&&p(me.body.root),Et!==y&&v(Et)}).catch(()=>{J.signal.aborted||(S("error"),N(o("files.failed")))}),()=>J.abort()},[y,i,B,o]);function Be(J){De.current&&URL.revokeObjectURL(De.current),De.current=J}function ut(J){const me=J==="workspace"?u?.workspace:u?.home;me&&(p(J),M(null),te(null),me!==y&&(S("loading"),v(me)))}async function Kt(J){const me=xh(y,J.name);if(J.kind==="file"){await Q(me,J.name,J.size);return}if(J.kind==="link"){const Et=await Pe(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(me)}`);if(!Me.current)return;if(Et.status!==200){if(Et.body.error==="not_directory"){await Q(me,J.name,J.size);return}N(ku(Et.body.error,o));return}M(null),S("loading"),v(typeof Et.body.path=="string"?Et.body.path:me);return}M(null),S("loading"),v(me)}async function Bt(J){const me=await Pe(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(J)}`);if(Me.current){if(me.status===200&&Array.isArray(me.body.items)){M(null),S("loading"),(me.body.root==="workspace"||me.body.root==="home")&&p(me.body.root),v(typeof me.body.path=="string"?me.body.path:J);return}if(me.body.error==="not_directory"){const Et=J.split("/").filter(Boolean).at(-1)??J;await Q(J,Et,0);return}N(ku(me.body.error,o))}}async function Q(J,me,Et,vt=++Ve.current){const at=()=>Me.current&&vt===Ve.current;M({kind:"loading",path:J,name:me});const Mt=$_(me);if(Mt){try{const gl=await fetch(Uu(i,J));if(!at())return;if(!gl.ok){M({kind:"error",path:J,name:me});return}const nr=URL.createObjectURL(new Blob([await gl.arrayBuffer()],{type:Mt}));if(!at()){URL.revokeObjectURL(nr);return}Be(nr),M({kind:"image",path:J,name:me,url:nr})}catch{at()&&M({kind:"error",path:J,name:me})}return}const jt=await Pe(`/files/text?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(J)}`);if(at()){if(jt.status===415||jt.body.error==="binary"){M({kind:"binary",path:J,name:me,size:Et});return}if(jt.status!==200||typeof jt.body.text!="string"){M({kind:"error",path:J,name:me});return}M({kind:"text",path:J,name:me,text:jt.body.text,eof:jt.body.eof!==!1})}}function se(J){if(be==null){if(J.size>z_){N(o("files.tooLarge")),te(null);return}N(""),ve(!1),ye(!1),P(null),te(J)}}async function _e(){if(!(!z||!y||be!=null)){P(0),N("");try{const J=await Q_(i,y,z,ue,P);if(!Me.current)return;if(J.status===409){ye(!0),N(o("files.exists")),P(null);return}if(J.status!==201||typeof J.body.path!="string"){N(ku(J.body.error,o)),P(null);return}te(null),P(null),K(me=>me+1)}catch{if(!Me.current)return;N(o("files.failed")),P(null)}}}const Ne=E.useRef(null),we=E.useRef(0),[pe,Le]=E.useState(null),[Je,lt]=E.useState(!1);E.useEffect(()=>{let J=null;if(j?j.kind!=="loading"&&(J={kind:"file",key:`file:${j.path}`,path:y,root:h,preview:j}):y&&x!=="loading"&&(J=x==="error"?{kind:"list",key:`dir:${y}`,path:y,root:h,items:[],error:T||o("files.failed")}:{kind:"list",key:`dir:${y}`,path:y,root:h,items:g,error:""}),!J){!y&&!j&&(Ne.current=null,Le(null)),lt(!1);return}const me=Ne.current;if(me?.key===J.key){if(me.root===J.root&&me.path===J.path&&(me.kind==="file"&&J.kind==="file"?me.preview===J.preview:me.kind==="list"&&J.kind==="list"&&me.items===J.items&&me.error===J.error))return;Ne.current=J,Le(J);return}if(!me||window.matchMedia("(prefers-reduced-motion: reduce)").matches){Ne.current=J,Le(J),lt(!1);return}const Et=++we.current;lt(!0);const vt=window.setTimeout(()=>{we.current===Et&&(Ne.current=J,Le(J),lt(!1))},200);return()=>window.clearTimeout(vt)},[j,g,x,y,h,T,o]),E.useEffect(()=>{const J=pe?.kind==="file"&&pe.preview.kind==="image",me=j?.kind==="image"||j?.kind==="loading";J||me||!De.current||(URL.revokeObjectURL(De.current),De.current="")},[pe,j]);const bt=pe?.root??h,gt=pe?.path||y,wn=bt==="workspace"?u?.workspace:u?.home,Nt=wn?V_(wn,gt):[],Ct=pe?.kind==="file"?{name:pe.preview.name,path:pe.preview.path}:null,ht=pe?.kind==="list"?pe.error:"";function Ft(J){navigator.clipboard.writeText(J).then(()=>{We(J),window.setTimeout(()=>We(me=>me===J?"":me),1e3)})}const hi=z!=null&&(ze||g.some(J=>J.name===z.name)),Fn=be!=null;return oe?ml.createPortal(m.jsxs("div",{className:Z?`files-drawer narrow files-drawer-${re}`:`files-drawer files-drawer-${re}${Y?" resizing":""}`,style:Z?void 0:{width:ae},role:"dialog","aria-label":o("files.title"),onAnimationEnd:J=>{J.target!==J.currentTarget||J.animationName!=="files-drawer-out"||nt.current==="out"&&ge(!1)},onDragEnter:J=>{J.preventDefault(),dt.current+=1,q(!0)},onDragOver:J=>J.preventDefault(),onDragLeave:()=>{dt.current-=1,dt.current<=0&&(dt.current=0,q(!1))},onDrop:J=>{J.preventDefault(),dt.current=0,q(!1);const me=J.dataTransfer.files[0];me&&se(me)},children:[Z?null:m.jsx("div",{className:"files-resize",onPointerDown:J=>{J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId),le(!0);const me=vt=>{const at=va(window.innerWidth-vt.clientX);D.current=at,A(at)},Et=()=>{le(!1),q_(D.current),window.removeEventListener("pointermove",me),window.removeEventListener("pointerup",Et)};window.addEventListener("pointermove",me),window.addEventListener("pointerup",Et)}}),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(Z_,{})}),m.jsxs("div",{className:"files-roots",role:"tablist",children:[m.jsx("button",{type:"button",role:"tab",className:"files-icon-btn","aria-selected":bt==="home","aria-label":o("files.home"),disabled:!u?.home,title:u?.home||xb(u?.homeReason,o),onClick:()=>ut("home"),children:m.jsx(P_,{})}),m.jsx("button",{type:"button",role:"tab",className:"files-icon-btn","aria-selected":bt==="workspace","aria-label":o("files.workspace"),disabled:!u?.workspace,title:u?.workspace??xb(u?.workspaceReason,o),onClick:()=>ut("workspace"),children:m.jsx(J_,{})})]}),m.jsxs("nav",{className:"files-crumbs","aria-label":o("files.title"),children:[Nt.length>0||Ct?m.jsx("span",{"aria-hidden":"true",children:"/"}):null,Nt.map((J,me)=>m.jsxs("span",{children:[me>0?m.jsx("span",{"aria-hidden":"true",children:"/"}):null,m.jsx("button",{type:"button",title:J.path,onClick:()=>{J.path===y&&!j||(M(null),J.path!==y&&(S("loading"),v(J.path)))},children:J.name})]},J.path)),Ct?m.jsxs("span",{children:[Nt.length>0?m.jsx("span",{"aria-hidden":"true",children:"/"}):null,m.jsx("span",{className:"files-crumb-current",title:Ct.path,children:Ct.name})]}):null,gt?m.jsx("button",{type:"button",className:"files-icon-btn files-crumb-copy","aria-label":o("files.pathHint"),title:he===(Ct?.path||gt)?o("files.copied"):o("files.pathHint"),onClick:()=>Ft(Ct?.path||gt),children:he===(Ct?.path||gt)?m.jsx(X0,{}):m.jsx($0,{})}):null]}),m.jsx("button",{type:"button",className:"files-icon-btn files-upload","aria-label":o("files.upload"),title:o("files.upload"),disabled:!y||Fn,onClick:()=>Ee.current?.click(),children:m.jsx(t4,{})}),m.jsx("input",{ref:Ee,type:"file",hidden:!0,onChange:J=>{const me=J.target.files?.[0];J.target.value="",me&&se(me)}})]}),T&&T!==ht?m.jsx("p",{className:"files-notice",children:T}):null,Ie?m.jsx("div",{className:"files-drop",children:o("files.drop")}):null,m.jsx("div",{className:"files-body",children:pe?m.jsx("div",{className:Je?"files-stage out":"files-stage in",children:pe.kind==="file"?m.jsx(L_,{preview:pe.preview,sessionId:i,line:pe.preview.path===R?xe:void 0,onOpenPath:J=>{Bt(J)}}):pe.error?m.jsx("p",{className:"files-status",children:pe.error}):pe.items.length===0?m.jsxs("div",{className:"files-empty",children:[m.jsx("span",{className:"files-empty-mark","aria-hidden":"true",children:m.jsx(K_,{})}),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",{})]}),pe.items.map(J=>m.jsxs("div",{className:"files-row",role:"row",children:[m.jsxs("button",{type:"button",className:"files-name",onClick:()=>{Kt(J)},children:[m.jsx("span",{className:J.kind==="dir"?"files-mark dir":"files-mark",children:G_(J.kind)}),m.jsx("span",{children:J.name})]}),m.jsx("span",{className:"files-col-type",children:F_(J,o)}),m.jsx("span",{className:"files-col-size",children:J.kind==="file"?wh(J.size):"—"}),m.jsx("span",{className:"files-col-time",children:X_(J.mtime)}),m.jsx("span",{className:"files-row-actions",children:J.kind==="file"?m.jsxs("a",{className:"files-action",href:Uu(i,xh(y,J.name)),children:[m.jsx(Q0,{}),o("files.download")]}):null})]},J.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:wh(z.size)})]}),m.jsx("p",{className:"files-confirm-dest",children:y}),Fn?m.jsxs("div",{className:"files-progress",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round((be??0)*100),children:[m.jsx("div",{style:{width:`${Math.round((be??0)*100)}%`}}),m.jsx("span",{children:o("files.uploading")})]}):null,hi?m.jsxs("label",{className:"files-check",children:[m.jsx("input",{type:"checkbox",checked:ue,disabled:Fn,onChange:J=>ve(J.target.checked)}),o("files.overwrite")]}):null,m.jsxs("div",{className:"files-confirm-actions",children:[m.jsx("button",{type:"button",disabled:Fn,onClick:()=>te(null),children:o("files.cancel")}),m.jsx("button",{type:"button",className:"primary",disabled:Fn||hi&&!ue,onClick:()=>{_e()},children:o("files.upload")})]})]}):null]}),document.body):null}function L_({preview:t,sessionId:i,line:r,onOpenPath:a}){const{t:o}=Ze(),u=t.kind==="text"&&tj(t.name),[c,h]=E.useState(u&&r==null?"preview":"source"),[p,y]=E.useState(!1);if(E.useEffect(()=>{h(u&&r==null?"preview":"source"),y(!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:"",g=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(W_,{}),o("files.previewMode")]}),m.jsxs("button",{type:"button",className:"files-action","aria-pressed":c==="source",onClick:()=>h("source"),children:[m.jsx(e4,{}),o("files.sourceMode")]})]}):null,t.kind==="text"?m.jsxs("button",{type:"button",className:"files-action",onClick:()=>{navigator.clipboard.writeText(v).then(()=>{y(!0),window.setTimeout(()=>y(!1),1e3)})},children:[p?m.jsx(X0,{}):m.jsx($0,{}),o(p?"files.copied":"files.copy")]}):null,m.jsxs("a",{className:"files-action",href:Uu(i,t.path),children:[m.jsx(Q0,{}),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")," ",wh(t.size)]}):w?m.jsxs(m.Fragment,{children:[m.jsx(E.Suspense,{fallback:m.jsx("p",{className:"files-status",children:o("file.loading")}),children:m.jsx(O_,{text:v,name:t.name,line:r})}),g?null:m.jsx("p",{className:"file-modal-note",children:o("files.truncated")})]}):m.jsxs("div",{className:"files-markdown",children:[m.jsx($s,{text:v,onOpenFile:x=>{const S=x.startsWith("/")?x:G0(t.path,x);S&&a(S)},resolveImage:x=>I_(i,t.path,x)}),g?null:m.jsx("p",{className:"file-modal-note",children:o("files.truncated")})]})]})}function xb(t,i){if(t==="overlap")return i("files.overlap");if(t==="forbidden"||t==="invalid")return i("files.denied");if(t==="missing")return i("files.missing")}function B_(t,i){const r=i.replace(/^\.\//,"");return r.startsWith("/")?r:t?xh(t,r):null}function U_(t,i,r){return i&&(t===i||t.startsWith(`${i}/`))?"workspace":r&&(t===r||t.startsWith(`${r}/`))?"home":null}function H_(t){const i=t.lastIndexOf("/");return i<=0?"/":t.slice(0,i)}function I_(t,i,r){if(/^[a-z][a-z0-9+.-]*:/i.test(r)||r.startsWith("//")||r.startsWith("#"))return;const a=r.startsWith("/")?r:G0(i,r);if(a)return`${Uu(t,a)}&inline=1`}function G0(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 V_(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 xh(t,i){return t==="/"?`/${i}`:`${t.replace(/\/$/,"")}/${i}`}function Uu(t,i){return`/dsh-bot/api/files/raw?sessionId=${encodeURIComponent(t)}&path=${encodeURIComponent(i)}`}function Y_(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 ku(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 F_(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 G_(t){return t==="dir"?"▸":t==="link"?"↗":"·"}function $_(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 wh(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 X_(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 Q_(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 p=new XMLHttpRequest;p.open("POST",u),p.setRequestHeader("content-type","application/octet-stream"),p.upload.onprogress=y=>{y.lengthComputable&&y.total>0&&o(y.loaded/y.total)},p.onload=()=>{let y={};try{const v=JSON.parse(p.responseText);v&&typeof v=="object"&&(y=v)}catch{y={}}c({status:p.status,body:y})},p.onerror=()=>h(new Error("failed")),p.send(r)})}function Z_(){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 K_(){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 J_(){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 P_(){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 $0(){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 X0(){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 Q0(){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 W_(){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 e4(){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 t4(){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 n4({onClose:t,onCreated:i}){const[r,a]=E.useState(""),[o,u]=E.useState(""),[c,h]=E.useState(""),[p,y]=E.useState(!1),[v,g]=E.useState(""),{locale:w,setLocale:x,t:S}=Ze();function T(j){a(j)}async function N(){if(p)return;const j=r.trim();if(j===""){g(S("new.nameRequired"));return}y(!0),g("");const M=await Pe("/sessions",{method:"POST",headers:{"content-type":"application/json","idempotency-key":crypto.randomUUID()},body:JSON.stringify({name:j})}),B=typeof M.body.sessionId=="string"?M.body.sessionId:"";if(!B){const Y=M.body.upstream;g(Y?.message||String(M.body.error||S("new.createFailed"))),y(!1);return}const K=Hk(j,o,c),ee=await Ai("/dsh-bot/api/sessions/open",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:B,personaText:K,idempotencyKey:crypto.randomUUID()})});if(ee.body.ok!==!0){g(Qb(ee.body,S("new.personaFailed"))),y(!1);return}const A=c.trim()||S("new.kickoff"),D=await Pe("/tasks",{method:"POST",headers:{"content-type":"application/json","idempotency-key":crypto.randomUUID()},body:JSON.stringify({sessionId:B,text:A})});if(D.status!==202){const Y=D.body.execution,le=D.body.task;g(Y?.reason||le?.reason||S("new.turnFailed")),y(!1);return}i(B,S("new.created",{name:j}),j)}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:j=>j.stopPropagation(),onSubmit:j=>{j.preventDefault(),N()},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:j=>T(j.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:j=>u(j.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:j=>h(j.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:p||r.trim()==="",children:S(p?"new.creating":"new.create")})]})]})})}function i4(t,i){const{t:r}=Ze(),[a,o]=E.useState("");return E.useEffect(()=>{if(t===""){o("");return}let u=!1;return(async()=>{const c=await Ai(`/dsh-bot/api/status?sessionId=${encodeURIComponent(t)}`),h=await Ai(`/dsh-bot/api/memory?sessionId=${encodeURIComponent(t)}`);if(u||c.body.ok!==!0)return;const p=c.body.binding;if((p&&typeof p=="object"?p.kind:c.body.kind)!=="bot"){o(r("basis.plain"));return}const v=typeof c.body.personaText=="string"?c.body.personaText.trim():"",g=Ik(v),w=[g.name,g.style,g.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 tc(t){const i=t.replace(/\r\n/g,`
|
|
55
|
+
`);if(!i.startsWith("[foundations:message]"))return null;const r=i.slice(21).replace(/^\n/,""),a=r.indexOf(`
|
|
56
|
+
---
|
|
57
|
+
`);if(a<0)return null;const o={},u=[];for(const c of r.slice(0,a).split(`
|
|
58
|
+
`)){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 Z0(t,i){return i!==""&&i!==t?i:t.startsWith("session-")&&t.length>18?`${t.slice(0,12)}…${t.slice(-4)}`:t}const r4=new Set(["foundations_send","foundations_reply"]);function K0(t){const i=[];for(const r of t){if(r.kind==="user"){const o=tc(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"||!r4.has(r.name))continue;const a=o4(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 l4(t){const i=K0(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 a4(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 s4(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 o4(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 u4({mail:t,label:i,onOpenFile:r}){const{t:a}=Ze(),o=Z0(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(`
|
|
59
|
+
`);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($s,{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 c4({who:t,preview:i,time:r,mark:a,onOpen:o}){const{t:u}=Ze(),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(p4,{})}),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 f4({items:t,botLabel:i,onOpenFile:r}){const{locale:a}=Ze();return m.jsxs("div",{className:"bot-chat",children:[m.jsx(h4,{}),t.length===0?m.jsx(m4,{}):null,t.map(o=>o.kind==="in"?m.jsxs("div",{className:"mail-row",children:[m.jsx(u4,{mail:o.mail,label:i(o.mail.from),onOpenFile:r}),Hu(o.time,a)?m.jsx("time",{children:Hu(o.time,a)}):null]},o.id):m.jsx(d4,{item:o,items:t,botLabel:i},o.id))]})}function d4({item:t,items:i,botLabel:r}){const{t:a,locale:o}=Ze(),u=s4(t,i),c=u?Z0(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})}),Hu(t.time,o)?m.jsx("time",{children:Hu(t.time,o)}):null]})}function h4(){const{t}=Ze();return m.jsx("p",{className:"bot-chat-lead",children:t("inbox.lead")})}function m4(){const{t}=Ze();return m.jsx("p",{className:"empty-thread",children:t("inbox.empty")})}function Hu(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 p4(){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 y4({root:t,marks:i,busyId:r}){const a=E.useRef(null),[o,u]=E.useState(i.at(-1)?.id??""),[c,h]=E.useState(null),[p,y]=E.useState({top:!1,bottom:!1}),v=i.map(x=>x.id).join("\0");E.useEffect(()=>{const x=t.current;if(!x||i.length<2)return;const S=()=>{const T=x.getBoundingClientRect().top,N=x.scrollHeight-x.scrollTop-x.clientHeight<48;let j=i[0]?.id??"";if(N)j=i.at(-1)?.id??j;else for(const M of i){const B=x.querySelector(`[data-turn="${CSS.escape(M.id)}"]`);B instanceof HTMLElement&&B.getBoundingClientRect().top-T<=36&&(j=M.id)}u(M=>M===j?M:j)};return S(),x.addEventListener("scroll",S,{passive:!0}),()=>x.removeEventListener("scroll",S)},[t,i,v]),E.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 N=x.scrollTop>1,j=x.scrollTop<x.scrollHeight-x.clientHeight-1;y(M=>M.top===N&&M.bottom===j?M:{top:N,bottom:j})},[o,v]);const{t:g}=Ze();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",p.top?"fade-top":"",p.bottom?"fade-bottom":""].filter(Boolean).join(" "),"aria-label":g("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":g("turn.jump",{index:String(S+1)}),onMouseEnter:()=>h(x.id),onFocus:()=>h(x.id),onBlur:()=>h(N=>N===x.id?null:N),onClick:()=>{t.current?.querySelector(`[data-turn="${CSS.escape(x.id)}"]`)?.scrollIntoView({block:"start",behavior:w?"auto":"smooth"})}},x.id)})})}function g4(t){let i=!1,r=t.visible!==!1,a=!1,o=!1,u=!1,c=0,h=0,p="",y=!1,v=()=>{},g=null;function w(N){const j=JSON.stringify(N);j!==p&&(p=j,y=t.active?.(N)===!0,t.apply(N))}function x(){if(v(),i||!r)return;const N=a?6e4:y?1500:Math.min(15e3,2e3*2**Math.min(h,3));v=t.schedule(()=>{S()},N)}async function S(){if(i||!r)return;if(o){u=!0;return}v(),o=!0;const N=c;g=new AbortController;const j=g,M=t.schedule(()=>j.abort(),1e4);try{const B=await t.fetch(g.signal);!i&&r&&N===c&&w(B),h=Math.min(h+1,3)}catch{h=Math.min(h+1,3)}finally{M(),o=!1,u?(u=!1,S()):x()}}const T={ingest(N){i||!r||(c++,a=!0,h=0,w(N),x())},disconnected(){a=!1,h=0,x()},setVisible(N){r!==N&&(r=N,N||(a=!1),c++,v(),g?.abort(),r&&(h=0,S()))},close(){i=!0,c++,v(),g?.abort()},refresh:S};return S(),T}function J0(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,p=t().then(y=>h!==u?(o=null,c.get()):(h===u&&(r=y,a=i()),y)).finally(()=>{o===p&&(o=null)});return o=p,p}};return c}const Bs=new Set(["preparing","waiting","running","worker"]),P0=new Set([...Bs,"background"]);function v4(t){try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}}function hl(t){try{const i=JSON.parse(t);return i&&typeof i=="object"&&!Array.isArray(i)?i:{}}catch{return{}}}function Jh(t){return["bash","shell","pwsh","powershell"].includes(t.toLowerCase())}function nc(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(Jh(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 Ph(t){return t.status?t.status:t.resultReceived||t.result!==""?nc(t.name,t.result,t.error):t.running?"waiting":"unknown"}const b4={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 wb(t,i=Ri){return i(b4[t])}function Wh(t,i=[]){const r=Ph(t);if(!px(t.name))return r;const a=hl(t.result).ticketId,o=typeof a=="string"?a:"",u=o?i.find(c=>c.id===o):void 0;return u?u.status==="failed"?"failed":u.status==="cancelled"?"cancelled":u.status==="delivered"?"succeeded":"worker":r==="succeeded"&&o?"worker":r}function Sh(t){return typeof t=="number"&&Number.isInteger(t)&&t>=1?t:null}function Mr(t){return t.split(/[/\\]/).map(r=>r.trim()).filter(Boolean).at(-1)??t}function zn(t){return typeof t=="string"?(t.split(`
|
|
60
|
+
`)[0]??"").trim():""}function x4(t){if(!t||typeof t!="object"||Array.isArray(t))return null;const i=t,r=Sh(i.offset),a=typeof i.totalLines=="number"&&Number.isInteger(i.totalLines)&&i.totalLines>=0?i.totalLines:null;if(r==null||!Array.isArray(i.lines))return null;const o=[];for(const p of i.lines){if(!p||typeof p!="object"||Array.isArray(p))return null;const y=p.number;if(typeof y!="number"||!Number.isInteger(y)||y<1)return null;o.push(y)}const u=o[0]??r,c=o.at(-1)??Math.max(0,r-1);return{path:typeof i.path=="string"?i.path.trim():"",start:u,end:c,total:a}}function w4(t){const i=/<path>([^<]*)<\/path>/.exec(t)?.[1]?.trim()??"",r=/\(Showing lines (\d+)-(\d+) of (\d+)\./.exec(t);if(r)return{path:i,start:Number(r[1]),end:Number(r[2]),total:Number(r[3])};const a=/\(Output capped\. Showing lines (\d+)-(\d+)\./.exec(t);if(a)return{path:i,start:Number(a[1]),end:Number(a[2]),total:null};const o=/\(End of file - total (\d+) lines\)/.exec(t);if(o){const u=Number(o[1]);return{path:i,start:u===0?0:1,end:u,total:u}}return null}const W0=[];function yl(t,i,r){let a=null;return W0.push({names:new Set(t),present:(o,u)=>{const c=i(o,u);return c==null?null:{text:r(c),view:()=>a?.(c)??null}}}),{show(o){a=o}}}function Sb(t,i){return i<t||i<1?"":t===i?`L${t}`:`L${t}-${i}`}function ba(t){return t===""?0:t.replace(/\n$/,"").split(`
|
|
61
|
+
`).length}function S4(t){return t.length<=3?t.join(", "):`${t[0]} + ${t.length-1} files`}function kb(t,i){const r=i.map(a=>t[a]).find(a=>typeof a=="string");return typeof r=="string"?r:""}function e1(t,i){return[t>0?`+${t}`:"",i>0?`-${i}`:""].filter(r=>r!=="").join(" ")}const k4=yl(["read"],(t,i)=>{const r=zn(i.file_path)||zn(i.path),a=x4(t.meta)??(t.result?w4(t.result):null),o=a?.path||r;if(!o)return null;let u="";if(a&&a.end>=a.start)u=Sb(a.start,a.end);else{const c=Sh(i.offset),h=Sh(i.limit);h!=null?u=Sb(c??1,(c??1)+h-1):c!=null&&(u=`L${c}`)}return{path:Mr(o),span:u}},t=>[t.path?`Read ${t.path}`:"Read",t.span].filter(i=>i!=="").join(" ")),E4=yl(["edit","apply_patch","str_replace_editor"],(t,i)=>{const r=zn(i.file_path)||zn(i.path);return r?{path:Mr(r),added:ba(kb(i,["new_string","new_str","content","file_text"])),removed:ba(kb(i,["old_string","old_str"]))}:null},t=>["Edit",t.path,e1(t.added,t.removed)].filter(i=>i!=="").join(" ")),j4=yl(["write"],(t,i)=>{const r=zn(i.file_path)||zn(i.path);return r?{path:Mr(r),added:ba(typeof i.content=="string"?i.content:"")}:null},t=>["Write",t.path,t.added>0?`+${t.added}`:""].filter(i=>i!=="").join(" ")),T4=yl(["grep"],(t,i)=>{const r=zn(i.pattern)||zn(i.query);return r?{pattern:r.length>48?`${r.slice(0,48)}…`:r,where:Mr(zn(i.path)||zn(i.glob))}:null},t=>["Grep",t.pattern,t.where?`in ${t.where}`:""].filter(i=>i!=="").join(" ")),N4=yl(["canvas_read"],(t,i)=>({path:Mr(zn(i.path))}),t=>t.path?`canvas_read ${t.path}`:"canvas_read files"),C4=yl(["canvas_edit"],(t,i)=>{const r=zn(i.path);return r?{path:Mr(r),added:ba(typeof i.replacement=="string"?i.replacement:""),removed:ba(typeof i.old=="string"?i.old:"")}:null},t=>["canvas_edit",t.path,e1(t.added,t.removed)].filter(i=>i!=="").join(" ")),A4=yl(["canvas_write"],(t,i)=>{const r=Array.isArray(i.files)?i.files:[],a=[];let o=0,u=0;for(const p of r){if(!p||typeof p!="object")continue;const y=p,v=zn(y.path);v&&(a.push(Mr(v)),typeof y.text=="string"&&(o+=1,u+=ba(y.text)))}const c=Array.isArray(i.remove)?i.remove.flatMap(p=>{const y=typeof p=="string"?zn(p):"";return y?[Mr(y)]:[]}):[];if(a.length===0&&c.length===0)return null;const h=c.slice(0,2).join(", ");return{files:S4(a),added:a.length===1&&o===1&&u>0?u:null,remove:c.length===0?"":`${h}${c.length>2?` +${c.length-2}`:""}`}},t=>["canvas_write",t.files,t.added!=null&&t.added>0?`+${t.added}`:"",t.remove?`remove ${t.remove}`:""].filter(i=>i!=="").join(" "));function R4(t){const i=t.name.toLowerCase(),r=hl(t.args);for(const a of W0){if(!a.names.has(i))continue;const o=a.present(t,r);if(o)return o}return null}function _4(t){return t.text}function t1(t,i,r=[]){const a=hl(t.args),o=hl(t.result),u=Jh(t.name),c=u&&typeof a.command=="string"?a.command:"",h=typeof a.description=="string"?a.description:"",p=t.meta&&typeof t.meta=="object"?t.meta:{},y=typeof p.cwd=="string"?p.cwd:typeof a.workdir=="string"?a.workdir:i,g=(typeof p.cwd=="string"||!y||y.startsWith("/")||!i?y:i.replace(/\/$/,"")+"/"+y)??"",w=typeof o.ticketId=="string"?o.ticketId:"",x=r.find(j=>j.id===w),S=Wh(t,r),T=t.name==="todo_write"&&Array.isArray(a.todos)?a.todos.flatMap(j=>{if(!j||typeof j!="object")return[];const M=j;return typeof M.content=="string"&&typeof M.status=="string"?[{content:M.content,status:M.status}]:[]}):[],N=u?/^\[exit code: (-?\d+)\]$/m.exec(t.result):null;return{status:S,command:c,description:h,cwd:g,cwdSource:typeof p.cwd=="string"?"recorded":typeof a.workdir=="string"?"requested":"session",todos:T,title:t.name==="todo_write"?"todo_write":t.name,detail:R4(t),args:v4(t.args),output:t.result,exitCode:N?Number(N[1]):null,ticket:x,ticketId:w,latestReport:x?.events.filter(j=>j.revision===x.revision&&j.applyStatus!=="stale").at(-1)?.text??"",jobId:u?/(?:^started background job |moved to background job )([^\s\]]+)/m.exec(t.result)?.[1]??"":""}}const O4="ask_user_question";function em(t){return t.replace(/-/g,"_").toLowerCase()===O4}function z4(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 Kd(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 M4(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=Jd(a.question);if(o){r.display={question:o};const u=Jd(a.detail);u&&(r.display.detail=u);const c=Jd(a.approve);c&&(r.display.approve=c)}}return r}}function Jd(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 n1(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 i1(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 cl(t){return typeof t=="string"?t:""}function q4(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:cl(r.description),recommended:r.recommended===!0}]}):[]}function D4(t){return Array.isArray(t)?t.flatMap((i,r)=>{if(!i||typeof i!="object")return[];const a=i,o=cl(a.question);if(!o)return[];const u=cl(a.id);return[{id:u===""?`question-${r+1}`:u,question:o,detail:cl(a.detail),header:cl(a.header),options:q4(a.options),multiSelect:a.multi_select===!0||a.multiSelect===!0,intent:M4(a.intent)}]}):[]}function L4(t){const i=new Map,r=hl(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=cl(u.id);if(!c)continue;const h=Array.isArray(u.selected)?u.selected.flatMap(p=>typeof p=="string"?[p]:[]):[];i.set(c,{selected:h,custom:cl(u.custom)})}return i}function B4(t){const i=t.errorCode??"";return/ASK_ABORTED|ABORT|CANCEL/i.test(i)||/aborted before the user answered/i.test(t.result)}function r1(t){if(!t)return!1;const i=hl(t);return!!(i&&i.pending===!0)}function U4(t){return r1(t.result)?!1:!!(t.resultReceived||t.result!==""||t.error||t.errorCode)}function H4(t){const i=t.timeout;if(!(typeof i!="number"||!Number.isFinite(i)||i<=0))return i>1e3?i:i*1e3}function Xs(t){if(!em(t.name))return null;const i=hl(t.args),r=D4(i.questions),a=L4(t.result),o=B4(t),u=r1(t.result),c=U4(t),h=c&&t.error&&!o,p=u?"continued":c?o?"aborted":h?"failed":"answered":"open",y=H4(i),v=u?"continued":p==="open"&&y?"counting":"none",g=r.map(S=>{const T=a.get(S.id),N=T?.selected??[],j=T?.custom??"";return{...S,selected:N,custom:j,skipped:p==="answered"&&N.length===0&&!j}}),w=g.find(S=>S.header)?.header||g[0]?.question||t.name,x=n1(g)?"plan-review":i1(g)?"approval":"question";return{callId:t.callId,state:p,wait:v,timeoutMs:y,title:w,questions:g,presentation:x}}function l1(t){return t==="open"||t==="continued"}const I4=new Set(["accepted","enqueued","started","needs_user","ready"]),V4=new Set(["delivered","failed","cancelled"]),Y4={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"},F4={accepted:"activity.ticket.scheduling",enqueued:"activity.ticket.scheduling",started:"activity.status.worker",needs_user:"activity.ticket.needsUser",ready:"activity.ticket.ready"};function kh(t){const{segments:i,drafting:r,currentTurn:a,tickets:o=[],t:u=Ri}=t,c=[],h=[],p=new Set,y=w=>a==null||w===a,v=w=>u(Y4[w]);for(const w of i){if(w.kind!=="tool")continue;if(em(w.name)){const j=Xs(w);if(j&&l1(j.state)&&r&&y(w.turn)){c.push({text:u("question.waiting"),moving:!0});continue}}const x=Wh(w,o);if(x!=="background"&&!Bs.has(x))continue;const S=t1(w,void 0,o);if(S.status==="worker"&&S.ticket)continue;if(S.status==="worker"&&S.ticketId){if(p.has(S.ticketId))continue;p.add(S.ticketId)}const T=S.description||S.command||(S.detail?_4(S.detail):S.title),N={text:`${v(S.status)}: ${T}`,moving:S.status!=="background"};if(S.status==="background"){r&&y(w.turn)&&h.push(N);continue}Bs.has(S.status)&&(!r||!y(w.turn)||c.push(N))}t.pendingApprovals?.some(w=>w.state==="open")&&c.push({text:u("approval.waiting"),moving:!0});for(const w of o){if(p.has(w.id)||V4.has(w.status)||!I4.has(w.status))continue;p.add(w.id);const x=F4[w.status];x&&c.push({text:`${u(x)}: ${w.summary}`,moving:["accepted","enqueued","started"].includes(w.status)})}let g=c.find(w=>w.text===u("question.waiting"))??c.at(-1);if(c.length>1&&g&&(g={text:`${u("activity.pendingCount",{count:String(c.length)})} · ${g.text}`,moving:c.some(w=>w.moving)}),!g&&h.length&&(g=h.at(-1)),!g&&r){const w=i.filter(x=>y(x.turn));g=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(!g)return null;if(t.connectionPhase&&t.connectionPhase!=="live"){const w=["restoring","connecting","syncing"].includes(t.connectionPhase);g={text:u("activity.staleSummary",{phase:u(w?"activity.syncing":"activity.connectionUnavailable"),text:g.text}),moving:!1}}return{...g,text:g.text.replace(/\s+/g," ").trim()}}function G4(t){const{t:i}=Ze(),r=kh({...t,t:i}),[a,o]=E.useState(()=>typeof document>"u"||document.visibilityState!=="hidden");return E.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 a1=["persona","profile","fact","episodic","procedural","state","skill"];function $4(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 s1(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 Eb(t){return Array.isArray(t.entities)?t.entities.flatMap(i=>{const r=o1(i);return r?[s1(r)]:[]}):[]}function X4(t){const i=o1(t.entity);return i?s1(i):null}function Q4(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 Z4(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:$4(a.form),reason:typeof a.reason=="string"?a.reason:"no_manifest"})}return i}function o1(t){if(!t||typeof t!="object"||Array.isArray(t))return null;const i=t;return typeof i.id!="string"||!K4(i.type)?null:i}function K4(t){return typeof t=="string"&&a1.includes(t)}const u1="dsh-bot.memory-drawer-width",tm={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"},J4={user:"memory.scope.user",session:"memory.scope.session",work:"memory.scope.work",skill:"memory.scope.skill"},c1={active:"memory.lifecycle.active",corrected:"memory.lifecycle.corrected",forgotten:"memory.lifecycle.forgotten",candidate:"memory.lifecycle.candidate"};function P4(){try{const t=localStorage.getItem(u1);return t==null||t===""?Ds:va(Number(t))}catch{return Ds}}function W4(t){try{localStorage.setItem(u1,String(t))}catch{}}function eO({open:t,sessionId:i,onClose:r}){const{t:a}=Ze(),[o,u]=E.useState(""),[c,h]=E.useState(""),[p,y]=E.useState("all"),[v,g]=E.useState("all"),[w,x]=E.useState("all"),[S,T]=E.useState([]),[N,j]=E.useState(null),[M,B]=E.useState(!1),[K,ee]=E.useState([]),[A,D]=E.useState("auto"),[Y,le]=E.useState([]),[O,V]=E.useState(null),[Z,ke]=E.useState(null),[oe,ge]=E.useState(!0),[re,ce]=E.useState(""),[xe,Te]=E.useState(0),[R,Ke]=E.useState(P4),Ie=E.useRef(R),[q,z]=E.useState(!1),[te,ue]=E.useState(()=>window.innerWidth),[ve,ze]=E.useState(()=>window.matchMedia("(max-width: 800px)").matches),[ye,be]=E.useState(t),[P,he]=E.useState(t?"in":"out"),We=E.useRef(ye),dt=E.useRef(P);We.current=ye,dt.current=P;const Ee=va(R);Tx({present:ye,narrow:ve,motion:P,width:Ee,resizing:q,viewport:te}),E.useEffect(()=>{if(t){be(!0),he("in");return}if(We.current){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){be(!1);return}he("out")}},[t]),E.useEffect(()=>{const ae=window.matchMedia("(max-width: 800px)"),Be=()=>ze(ae.matches);return ae.addEventListener("change",Be),()=>ae.removeEventListener("change",Be)},[]),E.useEffect(()=>{const ae=()=>ue(window.innerWidth);return window.addEventListener("resize",ae),()=>window.removeEventListener("resize",ae)},[]),E.useEffect(()=>{u(""),h(""),V(null),ke(null),D("auto"),T([]),ee([]),le([]),j(null)},[i]),E.useEffect(()=>{const ae=setTimeout(()=>h(o.trim()),200);return()=>clearTimeout(ae)},[o]),E.useEffect(()=>{if(!t)return;let ae=!1;return ge(!0),ce(""),Ai(jb(i,{query:c,scope:p,lifecycle:v,type:w},null)).then(Be=>{if(!ae){if(Be.status!==200||Be.body.ok===!1){T([]),j(null),ce(Tb(Be.status,a)),ge(!1);return}T(Eb(Be.body)),j(typeof Be.body.nextCursor=="string"?Be.body.nextCursor:null),B(Be.body.capped===!0),ge(!1)}}),()=>{ae=!0}},[t,i,c,p,v,w,xe,a]),E.useEffect(()=>{if(!t)return;let ae=!1;return Ai(`/dsh-bot/api/memory/frames?sessionId=${encodeURIComponent(i)}`).then(Be=>{ae||Be.body.ok===!1||ee(Q4(Be.body))}),()=>{ae=!0}},[t,i,xe]);const De=A==="none"?null:A==="auto"?K[0]?.revision??null:A,Me=S.map(ae=>ae.id).join(",");E.useEffect(()=>{if(!t||De==null||Me===""){le([]);return}let ae=!1;const Be=new URLSearchParams({sessionId:i,revision:String(De),ids:Me});return Ai(`/dsh-bot/api/memory/context?${Be}`).then(ut=>{ae||ut.body.ok===!1||le(Z4(ut.body))}),()=>{ae=!0}},[t,i,De,Me]),E.useEffect(()=>{if(!t||O==null){ke(null);return}let ae=!1;const Be=new URLSearchParams({sessionId:i});return Ai(`/dsh-bot/api/memory/entities/${encodeURIComponent(O)}?${Be}`).then(ut=>{ae||ke(ut.body.ok===!1?null:X4(ut.body))}),()=>{ae=!0}},[t,i,O,xe]),E.useEffect(()=>{if(!ye)return;const ae=Be=>{if(Be.key==="Escape"){if(O!=null){V(null);return}r()}};return document.addEventListener("keydown",ae),()=>document.removeEventListener("keydown",ae)},[ye,O,r]);async function Ve(){if(N==null)return;const ae=await Ai(jb(i,{query:c,scope:p,lifecycle:v,type:w},N));if(ae.status!==200||ae.body.ok===!1){ce(Tb(ae.status,a));return}T(Be=>[...Be,...Eb(ae.body)]),j(typeof ae.body.nextCursor=="string"?ae.body.nextCursor:null)}const Ae=S.find(ae=>ae.id===O)??null,Ue=Z&&Z.id===O?Z:Ae,nt=ae=>De==null?null:Y.find(Be=>Be.id===ae)??{id:ae,form:"unknown",reason:"no_manifest"};return ye?ml.createPortal(m.jsxs("div",{className:ve?`files-drawer narrow files-drawer-${P}`:`files-drawer files-drawer-${P}${q?" resizing":""}`,style:ve?void 0:{width:Ee},role:"dialog","aria-label":a("memory.title"),onAnimationEnd:ae=>{ae.target!==ae.currentTarget||ae.animationName!=="files-drawer-out"||dt.current==="out"&&be(!1)},children:[ve?null:m.jsx("div",{className:"files-resize",onPointerDown:ae=>{ae.preventDefault(),ae.currentTarget.setPointerCapture(ae.pointerId),z(!0);const Be=Kt=>{const Bt=va(window.innerWidth-Kt.clientX);Ie.current=Bt,Ke(Bt)},ut=()=>{z(!1),W4(Ie.current),window.removeEventListener("pointermove",Be),window.removeEventListener("pointerup",ut)};window.addEventListener("pointermove",Be),window.addEventListener("pointerup",ut)}}),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(aO,{})}),m.jsxs("nav",{className:"files-crumbs","aria-label":a("memory.title"),children:[m.jsx("button",{type:"button",onClick:()=>V(null),children:a("memory.title")}),Ue?m.jsxs("span",{children:[m.jsx("span",{"aria-hidden":"true",children:"/"}),m.jsx("span",{className:"files-crumb-current",children:f1(Ue,a("memory.missing"))})]}):null]}),m.jsx("button",{type:"button",className:"files-icon-btn files-upload","aria-label":a("memory.refresh"),onClick:()=>Te(ae=>ae+1),children:m.jsx(sO,{})})]}),Ue?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:ae=>u(ae.target.value)}),m.jsxs("select",{"aria-label":a("memory.scope"),value:p,onChange:ae=>y(ae.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:ae=>g(ae.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:ae=>x(ae.target.value),children:[m.jsx("option",{value:"all",children:a("memory.type.all")}),a1.map(ae=>m.jsx("option",{value:ae,children:a(tm[ae])},ae))]}),K.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:De==null?"none":String(De),onChange:ae=>{const Be=ae.target.value;D(Be==="none"?"none":Number(Be))},children:[m.jsx("option",{value:"none",children:a("memory.frame.unselected")}),K.map(ae=>m.jsx("option",{value:ae.revision,children:a("memory.frame.option",{revision:String(ae.revision)})},ae.revision))]})]}),m.jsx("div",{className:"files-body",children:m.jsx("div",{className:"files-stage in",children:Ue?m.jsx(nO,{entity:Ue,citation:nt(Ue.id),sourceReady:Z?.id===Ue.id,t:a,onClose:()=>V(null),onSelect:V}):re?m.jsx("p",{className:"files-status memory-error",children:re}):oe&&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(oO,{})}),m.jsx("p",{children:a("memory.empty")})]}):m.jsxs(m.Fragment,{children:[De!=null?m.jsx("p",{className:"memory-note",children:a("memory.frame.note")}):null,M?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(ae=>m.jsx(tO,{entity:ae,selected:ae.id===O,t:a,onSelect:V},ae.id))]}),N?m.jsx("button",{type:"button",className:"memory-more",onClick:()=>{Ve()},children:a("memory.more")}):null,m.jsx("p",{className:"memory-readonly",children:a("memory.readonly")})]})})})]}),document.body):null}function tO({entity:t,selected:i,t:r,onSelect:a}){const o=t.tombstone?r("memory.tombstone"):f1(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(lO,{type:t.type}),m.jsx("span",{children:o})]}),m.jsx("span",{className:"files-col-type",children:r(tm[t.type])}),m.jsx("span",{className:"files-col-size",children:r(c1[t.lifecycle])}),m.jsx("span",{className:"files-col-time",title:dO(t.updatedAt),children:Us(t.updatedAt,r("memory.missing"))})]})}function nO({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(tm[t.type]),m.jsx("span",{"aria-hidden":"true",children:" · "}),a(J4[t.scope]),m.jsx("span",{"aria-hidden":"true",children:" · "}),a(c1[t.lifecycle])]}),m.jsxs("span",{children:[i?m.jsx("span",{className:`memory-cite memory-cite-${i.form}`,children:a(d1(i.form))}):null,m.jsx("button",{type:"button",onClick:o,children:a("memory.back")})]})]}),m.jsxs("div",{className:"files-markdown",children:[m.jsx(iO,{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(rO,{source:t.source,t:a}):null,i?m.jsx("p",{className:"memory-cite-reason",children:a(uO(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:[fO(h.tool,a)," · ",Us(h.at,a("memory.missing"))]},h.id))})]}):null]})]})}function iO({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:Us(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?d1(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 rO({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(cO(t.creator))}),t.createdAt?m.jsx("p",{children:i("memory.source.created",{time:Us(t.createdAt,i("memory.missing"))})}):null,t.updatedAt?m.jsx("p",{children:i("memory.source.updated",{time:Us(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 lO({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 aO(){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 sO(){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 oO(){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 f1(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 jb(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 Tb(t,i){return i(t===401||t===403?"memory.denied":"memory.failed")}function d1(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 uO(t){return t==="no_frame"?"memory.cite.reason.no_frame":"memory.cite.reason.no_manifest"}function cO(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 fO(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 Us(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 dO(t){if(!t)return;const i=new Date(t);if(!Number.isNaN(i.getTime()))return i.toLocaleString()}function Eh(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 Pd(t,i,r){const a=Eh(t,r);return a!==t?a:i&&i!==""?i:t}function nm({title:t,closeLabel:i,onClose:r,children:a,className:o}){E.useEffect(()=>{if(typeof document>"u")return;const c=document.body.style.overflow;document.body.style.overflow="hidden";const h=p=>{p.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:ml.createPortal(u,document.body)}function hO({sessionId:t,current:i,onClose:r,onChanged:a}){const{t:o}=Ze(),[u,c]=E.useState(null),[h,p]=E.useState(null),[y,v]=E.useState(null),[g,w]=E.useState(null),[x,S]=E.useState(""),[T,N]=E.useState(!1);E.useEffect(()=>{Pe(`/permissions?sessionId=${encodeURIComponent(t)}`).then(D=>c(D.body)),Pe("/permissions/default").then(D=>p(D.body))},[t]);async function j(D){N(!0),S("");try{const Y=await Pe("/permissions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:t,name:D})});if(Y.status===200&&Y.body.ok!==!1){c(Y.body),v(null),typeof Y.body.currentValue=="string"&&a?.(Y.body.currentValue);return}S(typeof Y.body.message=="string"?Y.body.message:o("permission.failed"))}catch{S(o("permission.failed"))}finally{N(!1)}}function M(D){if(!(D.value===u?.currentValue||D.value==="custom")){if(D.value==="danger-full-access"||D.value==="auto"){w(null),v(D);return}j(D.value)}}async function B(D){N(!0),S("");try{const Y=await Pe("/permissions/default",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:D})});if(Y.status===200&&Y.body.ok!==!1){p(Y.body),w(null);return}S(typeof Y.body.message=="string"?Y.body.message:o("permission.failed"))}catch{S(o("permission.failed"))}finally{N(!1)}}function K(D){if(!(D.value===h?.defaultPreset||D.value==="custom"||D.value==="auto")){if(D.value==="danger-full-access"){v(null),w(D);return}B(D.value)}}const ee=u?.options??[],A=ee.find(D=>D.value===(u?.currentValue??i));return m.jsxs(nm,{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"),":"," ",Pd(u?.currentValue??i??"",A?.name,o)||"—"]}):null,m.jsx("ul",{className:"user-question-options",children:ee.map(D=>m.jsx("li",{children:m.jsxs("button",{type:"button",className:D.value===u?.currentValue?"user-question-option selected":"user-question-option",disabled:T||D.value==="custom",onClick:()=>M(D),children:[m.jsx("span",{className:"user-question-option-label",children:Pd(D.value,D.name,o)}),D.description?m.jsx("span",{className:"user-question-option-desc",children:D.description}):null]})},D.value))}),y?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:y.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:T,onClick:()=>v(null),children:o("permission.cancel")}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:T,onClick:()=>{j(y.value)},children:o("permission.confirm")})]})]}):null,m.jsx("h4",{className:"user-question-header",children:o("permission.defaultTitle")}),m.jsx("p",{className:"user-question-hint",children:o("permission.defaultHelp")}),h&&h.available===!1?m.jsx("p",{className:"user-question-hint",children:o("permission.unavailable")}):null,m.jsx("ul",{className:"user-question-options",children:(h?.options??[]).map(D=>m.jsx("li",{children:m.jsxs("button",{type:"button",className:D.value===h?.defaultPreset?"user-question-option selected":"user-question-option",disabled:T||D.value==="custom"||D.value==="auto",onClick:()=>K(D),children:[m.jsx("span",{className:"user-question-option-label",children:Pd(D.value,D.name,o)}),D.description?m.jsx("span",{className:"user-question-option-desc",children:D.description}):null]})},`default-${D.value}`))}),g?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:o("permission.confirmDefaultFull")}),m.jsxs("div",{className:"user-question-row",children:[m.jsx("button",{type:"button",className:"user-question-skip",disabled:T,onClick:()=>w(null),children:o("permission.cancel")}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:T,onClick:()=>{B(g.value)},children:o("permission.confirm")})]})]}):null,x?m.jsx("p",{className:"user-question-status exception",children:x}):null]})}function mO({onClose:t,authorization:i,catalog:r}){const{t:a}=Ze(),[o,u]=E.useState(!0),[c,h]=E.useState([]),[p,y]=E.useState([]),[v,g]=E.useState([]),[w,x]=E.useState({}),[S,T]=E.useState(""),[N,j]=E.useState(!1),[M]=E.useState(()=>J0(async()=>{const O=await Pe("/authorization");if(O.status!==200)throw new Error("Authorization catalog unavailable");return O.body})),B=r??M,K=E.useRef(!0),ee=E.useRef(0);async function A(O=!1){if(document.hidden)return;O&&B.invalidate();const V=++ee.current;try{const Z=await B.get();if(!K.current||V!==ee.current)return;u(Z.available!==!1),h(Array.isArray(Z.entries)?Z.entries:[]),i||(y(Array.isArray(Z.notices)?Z.notices:[]),g(Array.isArray(Z.prompts)?Z.prompts:[]))}catch{K.current&&V===ee.current&&T(a("auth.failed"))}}E.useEffect(()=>{i&&(u(i.available!==!1),(Array.isArray(i.prompts)&&i.prompts.length>0||Array.isArray(i.inFlight)&&i.inFlight.length>0)&&j(!1),y(Array.isArray(i.notices)?i.notices:[]),g(Array.isArray(i.prompts)?i.prompts:[]))},[i]),E.useEffect(()=>{K.current=!0,A();const O=()=>{document.hidden||A(!0)},V=window.setInterval(()=>{A()},3e4);return document.addEventListener("visibilitychange",O),()=>{K.current=!1,ee.current++,window.clearInterval(V),document.removeEventListener("visibilitychange",O)}},[B,i?.catalogRevision]);async function D(O,V){j(!0),T("");try{const Z=await Pe("/authorization/begin",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:O.key,method:V})});(Z.status!==200||Z.body.ok===!1)&&T(typeof Z.body.message=="string"?Z.body.message:a("auth.failed")),await A(!0)}catch{T(a("auth.failed"))}finally{j(!1)}}async function Y(O,V=!1,Z){j(!0),T("");try{const ke=await Pe("/authorization/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({promptId:O.promptId,value:V?void 0:Z??w[O.promptId]??"",declined:V})});(ke.status!==200||ke.body.ok===!1)&&T(typeof ke.body.message=="string"?ke.body.message:a("auth.failed")),await A(!0)}catch{T(a("auth.failed"))}finally{j(!1)}}async function le(O){j(!0);try{await Pe("/authorization/cancel",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:O.key})}),await A(!0)}finally{j(!1)}}return m.jsxs(nm,{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,p.map((O,V)=>m.jsxs("p",{className:"user-question-hint",children:[O.message,O.code?` · ${O.code}`:"",O.url?m.jsxs(m.Fragment,{children:[" ",m.jsx("a",{href:O.url,target:"_blank",rel:"noreferrer",children:O.url})]}):null]},`${O.message}-${V}`)),v.map(O=>m.jsxs("article",{className:"user-question",children:[m.jsx("p",{className:"user-question-text",children:O.message}),O.kind==="select"?m.jsx("ul",{className:"user-question-options",children:(O.options??[]).map(V=>m.jsx("li",{children:m.jsxs("button",{type:"button",className:"user-question-option",disabled:N,onClick:()=>{Y(O,!1,V.id)},children:[m.jsx("span",{className:"user-question-option-label",children:V.label}),V.description?m.jsx("span",{className:"user-question-option-desc",children:V.description}):null]})},V.id))}):O.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[O.promptId]??"",placeholder:O.placeholder,disabled:N,onChange:V=>x(Z=>({...Z,[O.promptId]:V.target.value}))})]}):m.jsx("label",{className:"user-question-custom",children:m.jsx("input",{type:"text",value:w[O.promptId]??"",placeholder:O.placeholder,disabled:N,onChange:V=>x(Z=>({...Z,[O.promptId]:V.target.value}))})}),m.jsxs("div",{className:"user-question-row",children:[m.jsx("button",{type:"button",className:"user-question-skip",disabled:N,onClick:()=>{Y(O,!0)},children:a("auth.cancel")}),O.kind!=="select"?m.jsx("button",{type:"button",className:"user-question-submit",disabled:N||O.kind!=="secret"&&!(w[O.promptId]??"").trim(),onClick:()=>{Y(O)},children:a("auth.writeVault")}):null]})]},O.promptId)),c.map(O=>{const V={...O,inFlight:O.inFlight||Array.isArray(i?.inFlight)&&i.inFlight.some(Z=>JSON.stringify(Z)===JSON.stringify(O.key))};return m.jsxs("article",{className:"user-question",children:[m.jsx("p",{className:"user-question-text",children:V.label}),m.jsxs("div",{className:"user-question-row",children:[V.methods.map(Z=>m.jsx("button",{type:"button",className:"user-question-submit",disabled:N||V.inFlight,onClick:()=>{D(V,Z.id)},children:Z.label||a("auth.start")},Z.id)),V.inFlight?m.jsx("button",{type:"button",className:"user-question-skip",disabled:N,onClick:()=>{le(V)},children:a("auth.cancel")}):null]})]},JSON.stringify(V.key))}),S?m.jsx("p",{className:"user-question-status exception",children:S}):null]})}function pO({onClose:t}){const{t:i,locale:r}=Ze(),[a,o]=E.useState(!1),[u,c]=E.useState(!1),[h,p]=E.useState(null),[y,v]=E.useState([]),[g,w]=E.useState([]),[x,S]=E.useState(""),[T,N]=E.useState(!1);async function j(){const B=await Pe(`/cua?locale=${encodeURIComponent(r)}`);c(!0),o(B.body.available===!0);const K=B.body.systemStatus;p(K&&typeof K=="object"?K:null);const ee=B.body.applications;if(ee&&typeof ee=="object"){const A=ee;v(Array.isArray(A.allowedApps)?A.allowedApps:[]),w(Array.isArray(A.blockedApps)?A.blockedApps:[])}}E.useEffect(()=>{j()},[r]);async function M(B,K={}){N(!0),S("");try{const ee=await Pe("/cua",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:B,locale:r,...K})});(ee.status!==200||ee.body.ok===!1)&&S(typeof ee.body.message=="string"?ee.body.message:i("cua.failed")),await j()}catch{S(i("cua.failed"))}finally{N(!1)}}return u&&!a?null:m.jsxs(nm,{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:()=>{M("requestPermission",{permission:B})},children:i("cua.request")}),m.jsx("button",{type:"button",className:"user-question-skip",disabled:T,onClick:()=>{M("openSettings",{permission:B})},children:i("cua.openSettings")})]},B)),m.jsx("h4",{className:"user-question-header",children:i("cua.grants")}),y.length===0?m.jsx("p",{className:"user-question-hint",children:i("cua.emptyGrants")}):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-skip",disabled:T,onClick:()=>{M("revoke",{id:B.id})},children:i("cua.revoke")})]},B.id)),m.jsx("h4",{className:"user-question-header",children:i("cua.blocked")}),g.length===0?m.jsx("p",{className:"user-question-hint",children:i("cua.emptyBlocked")}):null,g.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:()=>{M("retryApproval",{id:B.id})},children:i("cua.askAgain")})]},B.id)),x?m.jsx("p",{className:"user-question-status exception",children:x}):null]})}function yO(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 h1(t){return Array.isArray(t)?t.filter(i=>i?.type==="text"&&typeof i.text=="string").map(i=>i.text??"").join(`
|
|
62
|
+
`).trim():""}function im(t){const i=t.message;return i&&typeof i=="object"?i:Array.isArray(t.content)||typeof t.toolCallId=="string"?t:null}function Iu(t){if(typeof t=="string")return t;if(t&&typeof t=="object")try{return JSON.stringify(t)}catch{return""}return""}function ft(t){return typeof t=="number"?t:void 0}function gO(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 ic(t,i){return`${t??""}:${i??""}`}function rm(t){if(t.kind==="think"||t.kind==="tool"||t.kind==="assistant")return t.step}function xa(t){return t.sort((i,r)=>i.seq-r.seq)}function vO(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 xa([...t,i])}function bO(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(p=>a[p]).find(p=>typeof p=="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 lm(t){return t.kind==="worker-card"||t.kind==="canvas-card"||t.kind==="approval-card"}function xO(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})):lm(u)?(o(),i.push({type:"card",segment:u})):u.kind==="tool"&&em(u.name)?(o(),i.push({type:"question",segment:u})):(u.kind==="think"||u.kind==="tool")&&r.push(u);return o(),i}function wO(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=SO(i,["file_path","path","file"]);if(!a)return null;if(r==="write"){const o=typeof i.content=="string"?i.content:"",u=Vu(o).map(c=>({kind:"add",text:c}));return Nb(a,o.length,u,u.length,0)}if(r==="edit"||r==="canvas_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:typeof i.old=="string"?i.old:null,u=typeof i.new_string=="string"?i.new_string:typeof i.new_str=="string"?i.new_str:typeof i.replacement=="string"?i.replacement:typeof i.content=="string"?i.content:typeof i.file_text=="string"?i.file_text:"",c=o==null||o===""?Vu(u).map(y=>({kind:"add",text:y})):kO(o,u),h=c.filter(y=>y.kind==="add").length,p=c.filter(y=>y.kind==="del").length;return Nb(a,u.length,c,h,p)}return null}function Nb(t,i,r,a,o){const u=t.split("/").filter(Boolean).at(-1)??t;return{path:t,name:u,language:EO(u),kilobytes:Math.max(1,Math.ceil(i/1024)),added:a,removed:o,lines:r}}function SO(t,i){for(const r of i){const a=t[r];if(typeof a=="string"&&a.trim())return a.trim()}return""}function Vu(t){return t===""?[]:(t.endsWith(`
|
|
63
|
+
`)?t.slice(0,-1):t).split(`
|
|
64
|
+
`)}function kO(t,i){const r=Vu(t),a=Vu(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 g=a.length-1;g>=0;g-=1){const w=c[v],x=c[v+1];!w||!x||(w[g]=r[v]===a[g]?(x[g+1]??0)+1:Math.max(x[g]??0,w[g+1]??0))}const h=[];let p=0,y=0;for(;p<r.length&&y<a.length;)r[p]===a[y]?(h.push({kind:"context",text:r[p]??""}),p+=1,y+=1):(c[p+1]?.[y]??0)>=(c[p]?.[y+1]??0)?(h.push({kind:"del",text:r[p]??""}),p+=1):(h.push({kind:"add",text:a[y]??""}),y+=1);for(;p<r.length;)h.push({kind:"del",text:r[p]??""}),p+=1;for(;y<a.length;)h.push({kind:"add",text:a[y]??""}),y+=1;return h}function EO(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 jO(t){return(t.split(`
|
|
65
|
+
`).map(r=>r.trim()).find(Boolean)??"").replaceAll("**","")}function m1(t,i){const r=t.findIndex(g=>g.kind==="tool"&&g.callId===i.callId);if(r<0)return xa([...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,y=i.callReceived&&(!a.callReceived||(i.callSeq??-1)>(a.callSeq??-1))?i:a,v=(y.name!=="tool"?y.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:y.callReceived?y.args:i.args||a.args,callReceived:a.callReceived||i.callReceived,callSeq:y.callSeq,requestedAt:y.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?nc(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},xa(o)}function TO(t,i,r,a,o,u){const c=`live:${i}:`,h=t.segments.filter(v=>v.id.startsWith(c));let p=t.segments.filter(v=>!v.id.startsWith(c)||v.kind==="tool"&&(v.callReceived||v.resultReceived));const y=[];for(const v of r){const g=a+v.index/100;if(v.kind==="reasoning"&&v.text.trim())y.push({kind:"think",id:`${c}think:${v.index}`,text:v.text,running:!0,seq:g,turn:o,step:u});else if(v.kind==="text"&&v.text)y.push({kind:"assistant",id:`${c}text:${v.index}`,text:v.text,streaming:!0,seq:g,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=[...p,...h].find(T=>T.kind==="tool"&&T.callId===w),S=p.findIndex(T=>T.kind==="tool"&&T.callId===w);if(S>=0){const T=p[S];if(T&&T.kind==="tool"&&!T.callReceived&&!T.resultReceived){const N=p.slice();N[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"},p=N}}else y.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??g,turn:o,step:u})}}return xa([...p,...y])}function p1(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 Eu(t,i,r,a){return p1(t,i,r).map(u=>u.index===i?a({...u,kind:r}):u)}function NO(t,i){const r=ft(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 p1(t,r,o)}if(a==="text-delta"||a==="text-chunks"){const o=typeof i.text=="string"?i.text:Cb(i.texts);return Eu(t,r,"text",u=>({...u,text:u.text+o}))}if(a==="reasoning-delta"||a==="reasoning-chunks"){const o=typeof i.text=="string"?i.text:Cb(i.texts);return Eu(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:Iu(i.args??i.arguments);return Eu(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 Eu(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:Iu(o.arguments)||c.args}))}return t}function Cb(t){return Array.isArray(t)?t.filter(i=>typeof i=="string").join(""):""}function y1(t,i){const r=i.data??{},a=r.chunk;if(!a||typeof a!="object")return t;const o=ft(r.turn),u=ft(r.step),c=ic(o,u),h=t.live[c]??{seq:i.seq??0,blocks:[]},p=NO(h.blocks,a),y={...t.live,[c]:{seq:h.seq||i.seq||0,blocks:p}},v=h.seq||i.seq||0;return{...t,live:y,drafting:!0,turn:o??t.turn,segments:TO({...t},c,p,v,o,u)}}function g1(t,i){const r=i.data??{},a=im(r),o=a?.content??[],u=ft(r.turn),c=ft(r.step),h=ic(u,c),p={...t.live};delete p[h];let y=t.segments.filter(g=>!g.id.startsWith(`live:${h}:`));y=y.filter(g=>!((g.kind==="think"||g.kind==="assistant")&&g.turn===u&&g.step===c));const v=i.seq??0;return o.forEach((g,w)=>{const x=v+w/100;if(g.type==="reasoning"&&g.text?.trim())y.push({kind:"think",id:`think:${h}:${w}`,text:g.text,running:!1,seq:x,turn:u,step:c});else if(g.type==="text"&&g.text)y.push({kind:"assistant",id:`text:${h}:${w}`,text:g.text,streaming:!1,time:i.time,seq:x,turn:u,step:c,messageId:a?.id});else if(g.type==="tool-call"){const S=g.id||`call:${h}:${w}`,T=y.find(N=>N.kind==="tool"&&N.callId===S);y=y.filter(N=>!(N.kind==="tool"&&N.callId===S)),y.push({...T?.kind==="tool"?T:{},kind:"tool",id:`tool:${S}`,callId:S,name:T?.kind==="tool"&&T.callReceived?T.name:g.name||(T?.kind==="tool"?T.name:"")||"tool",args:T?.kind==="tool"&&T.callReceived?T.args:Iu(g.arguments)||(T?.kind==="tool"?T.args:""),result:T?.kind==="tool"?T.result:"",error:T?.kind==="tool"?T.error:!1,running:T?.kind==="tool"?T.running&&!T.resultReceived:!0,status:T?.kind==="tool"?T.resultReceived?nc(g.name||T.name,T.result,T.error,T.errorCode):T.status:"preparing",seq:x,turn:u,step:c})}}),{...t,live:p,segments:xa(y)}}function CO(t,i){const r=i.data??{},a=typeof r.callId=="string"?r.callId:"";if(!a)return t;const o=ft(r.turn),u=ft(r.step);return{...t,segments:m1(t.segments,{kind:"tool",id:`tool:${a}`,callId:a,name:typeof r.name=="string"?r.name:"tool",args:Iu(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 AO(t,i){const r=i.data??{},a=im(r),o=a?.toolCallId??(typeof r.callId=="string"?r.callId:"");if(!o)return t;const u=h1(a?.content),c=ft(r.turn),h=ft(r.step),p=t.segments.find(y=>y.kind==="tool"&&y.callId===o);return{...t,segments:m1(t.segments,{kind:"tool",id:`tool:${o}`,callId:o,name:p?.kind==="tool"?p.name:"tool",args:p?.kind==="tool"?p.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:nc(p?.kind==="tool"?p.name:"tool",u,a?.isError===!0,typeof r.error?.code=="string"?r.error.code:void 0),error:a?.isError===!0,running:!1,seq:p?.seq??i.seq??Number.MAX_SAFE_INTEGER,turn:c??(p?.kind==="tool"?p.turn:void 0),step:h??(p?.kind==="tool"?p.step:void 0)})}}function RO(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 v1(t,i){let r=i;for(const a of t.segments)a.seq>r&&(r=a.seq);return r+.5}function _O(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:ft(a.time)??0,chunk:a.chunk});continue}const o=ft(a.index)??0,u=Array.isArray(a.texts)?a.texts:Array.isArray(a.args)?a.args:null;if(!u)continue;let c=ft(a.time0)??0;const h=Array.isArray(a.dt)?a.dt:[];u.forEach((p,y)=>{y>0&&(c+=ft(h[y-1])??0);const v=typeof p=="string"?p:"";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 b1(t,i,r,a,o,u){return y1(t,{seq:u,data:{turn:i,step:r,chunk:o}})}function jh(t,i,r,a=!1){const o=ic(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&&rm(c)===r&&(c.kind==="assistant"||c.kind==="think")))}}function OO(t,i){const r=t.streamAttempt;if(!r||i.surfaceOp!=null&&i.surfaceOp!=="append")return!1;const a=i.data??{};return ft(a.turn)!==r.turn||ft(a.step)!==r.step?!1:i.seq==null||i.seq>r.startedAfterSeq}function _s(t){const i=t.pendingAssistant;return{...i?g1(t,i):t,pendingAssistant:null,streamAttempt:null}}function zO(t,i,r){return{...t,streamAttempt:null,pendingAssistant:null,segments:t.segments.map(a=>a.kind==="user"||a.turn!==i||rm(a)!==r?a:a.kind==="think"?{...a,running:!1}:a.kind==="tool"?{...a,running:!1,status:a.resultReceived||!P0.has(Ph(a))?a.status:"unknown"}:a.kind==="assistant"?{...a,streaming:!1}:a)}}function x1(t,i,r){return!!t.turnEnds?.[i]||t.segments.some(a=>a.kind!=="user"&&a.turn===i&&rm(a)===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 MO(t,i){const r=ft(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=ft(u.turn),p=ft(u.step),y=ft(u.startedAfterSeq)??r;if(!c||h==null||p==null)return{...a,streamAttempt:null};if(x1(a,h,p))return{...a,streamAttempt:null};a=jh(a,h,p);const v=_O(u.stream),g=Math.min(ft(u.nextIndex)??v.length,v.length),w=v1(a,y);for(let x=0;x<g;x+=1){const S=v[x];S&&(a=b1(a,h,p,S.time,S.chunk,w))}return{...a,drafting:g>0||a.drafting,streamAttempt:{attemptId:c,turn:h,step:p,nextIndex:g,startedAfterSeq:y}}}function qO(t,i){const r=typeof i.type=="string"?i.type:"",a=ft(i.revision),o=typeof i.attemptId=="string"?i.attemptId:"";if(a==null||!o||a<=t.streamRevision)return t;if(r==="start"){const c=ft(i.turn),h=ft(i.step);if(c==null||h==null||x1(t,c,h))return t;const p=t.pendingAssistant?_s(t):t;return{...jh(p,c,h,!0),drafting:!0,streamRevision:a,streamAttempt:{attemptId:o,turn:c,step:h,nextIndex:0,startedAfterSeq:ft(i.startedAfterSeq)??t.streamRevision}}}if(a!==t.streamRevision+1)return{..._s(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=ft(i.index),h=i.chunk;if(c==null||!h||typeof h!="object")return{...t,streamRevision:a};if(c!==u.nextIndex)return{..._s(t),streamRevision:a};const p=ic(u.turn,u.step),y=t.live[p]?.seq||v1(t,u.startedAfterSeq);return{...b1(t,u.turn,u.step,ft(i.time)??0,h,y),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 p={...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{...jh(p,u.turn,u.step),streamAttempt:null,pendingAssistant:null}}return c.kind==="committed"&&c.eventType==="assistant/message"?{..._s(h),streamRevision:a}:{...zO(h,u.turn,u.step),streamRevision:a}}return{...t,streamRevision:a}}function DO(t,i,r=!1){const a=ft(t.pendingAssistant?.data?.turn),o=t.pendingAssistant&&(i==null||a===i)?_s(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||!P0.has(Ph(c))?c.status:r&&!c.callReceived?"cancelled":"unknown"}:c.kind==="assistant"?{...c,streaming:!1}:c)}}function LO(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 p=c,y=p.currentValue??p.preset??p.sandbox;typeof y=="string"&&(o.preset=y)}const h=a.sessionStats;if(h&&typeof h=="object"){const p=h.turns,y=h.steps;typeof p=="number"&&(o.turns=p),typeof y=="number"&&(o.steps=y)}return o}function BO(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 u=a.source&&typeof a.source=="object"?a.source.kind:"";return r.title&&u!=="provider"||(r={...r,title:a.title}),r}if(i.type==="request/context"){const u=typeof a.model=="string"?a.model:"";return u&&(r={...r,model:u}),r}if(i.type==="turn/start"){const u=ft(a.turn);return r={...r,drafting:!0,turn:u??r.turn,turnStartedAt:typeof i.time=="number"?i.time:Date.now()},r}if(i.type==="turn/end"){const u=ft(a.turn)??r.turn,c={...r.completed};u!=null&&r.turn===u&&r.turnStartedAt!=null&&typeof i.time=="number"&&(c[u]=Math.max(1,Math.round((i.time-r.turnStartedAt)/1e3)));const h=u==null?null:gO(a.reason),p=h==null?null:{...h,...typeof i.seq=="number"?{seq:i.seq}:{}},y=p==null||u==null?r.failures:{...r.failures,[u]:p},v=a.reason&&typeof a.reason=="object"&&typeof a.reason.kind=="string"?a.reason.kind:"",g=u==null?r.turnEnds??{}:{...r.turnEnds??{},[u]:v||r.turnEnds?.[u]||"ended"};return r=DO(r,u,v==="aborted"),r={...r,drafting:r.turn===u?!1:r.drafting,completed:c,failures:y,turnEnds:g,turnStartedAt:r.turn===u?null:r.turnStartedAt},r}if(i.type==="llm/retry"){const u=ft(a.turn),c=typeof a.retryId=="string"?a.retryId:"",h=ft(a.retry);if(u==null||c===""||h==null)return r;const p=a.failure&&typeof a.failure=="object"?a.failure:{},y={retryId:c,retry:h,maxRetries:ft(a.maxRetries)??null,delayMs:typeof a.delayMs=="number"?a.delayMs:0,message:typeof p.message=="string"?p.message:"Request failed.",...typeof p.code=="string"?{code:p.code}:{},...typeof i.seq=="number"?{seq:i.seq}:{},state:"scheduled"},v=r.retries[u]??[];return r={...r,retries:{...r.retries,[u]:[...v.filter(g=>g.retryId!==c||g.retry!==h),y]}},r}if(i.type==="llm/retry-started"){const u=ft(a.turn),c=typeof a.retryId=="string"?a.retryId:"",h=ft(a.retry);if(u==null||c===""||h==null)return r;const p=r.retries[u];return p&&(r={...r,retries:{...r.retries,[u]:p.map(y=>y.retryId===c&&y.retry===h?{...y,state:"started"}:y)}}),r}if(i.type==="assistant/live-chunk")return r=y1(r,i),r;if(i.type==="user/message"){const u=im(a);if(!u||u.source?.kind!=="user")return r;const c=h1(u.content);return c&&(r={...r,segments:vO(r.segments,{kind:"user",id:`user:${i.seq??c}`,text:c,time:i.time,seq:i.seq??Number.MAX_SAFE_INTEGER,turn:ft(a.turn)})}),r}if(i.type==="assistant/message")return OO(r,i)?r={...r,pendingAssistant:i}:r=g1(r,i),r;if(i.type==="tool/call")return r=CO(r,i),r;i.type==="tool/result"&&(r=AO(r,i));const o=UO(i);return o&&(r={...r,segments:HO(r.segments,o)}),r}function UO(t){const i=t.data??{},r=typeof t.seq=="number"?t.seq:Number.MAX_SAFE_INTEGER;if(t.type==="plugin:foundations/worker"){const a=typeof i.ticketId=="string"?i.ticketId:"";return a===""?null:{kind:"worker-card",id:`worker:${a}`,seq:r,ticketId:a,summary:typeof i.summary=="string"&&i.summary!==""?i.summary:a,status:typeof i.status=="string"&&i.status!==""?i.status:"accepted"}}if(t.type==="plugin:foundations/canvas"){const a=typeof i.canvasId=="string"?i.canvasId:"",o=typeof i.revision=="number"?i.revision:null;return a===""||o==null?null:{kind:"canvas-card",id:`canvas:${a}:${o}`,seq:r,canvasId:a,revision:o,title:typeof i.title=="string"?i.title:"",ticketId:typeof i.ticketId=="string"?i.ticketId:null,previewKind:i.kind==="delta"?"delta":"snapshot"}}if(t.type==="plugin:foundations/approval"){const a=typeof i.requestId=="string"?i.requestId:"",o=typeof i.toolName=="string"?i.toolName:"";return a===""||o===""?null:{kind:"approval-card",id:`approval:${a}`,seq:r,requestId:a,toolName:o,reason:typeof i.reason=="string"?i.reason:"",...typeof i.callId=="string"&&i.callId!==""?{callId:i.callId}:{}}}return null}function HO(t,i){return xa([...t.filter(r=>r.id!==i.id),i])}function IO(t,i){const r=RO(i)??(i&&typeof i=="object"?i:null);if(!r)return t;let a=t;if(r.type==="snapshot"){a=LO(a,r);const o=r.assistantStream;o&&typeof o=="object"&&(a=MO(a,o))}if(r.type==="assistant-stream"){const o=r.frame;o&&typeof o=="object"&&(a=qO(a,o))}return a}function VO(t){for(let i=t.length-1;i>=0;i-=1){const r=t[i];if(!r||r.kind==="user"&&hx(r.text)||lm(r))continue;const a=r.kind==="user"?tc(r.text):null,o=r.kind==="user"?Ch(r.text):null,c=(a?a.body:o?.body?o.body:r.kind==="user"||r.kind==="assistant"?r.text:r.kind==="tool"?r.result||bO(r.name,r.args):jO(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 Yu(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Ab(t,i){if(!Yu(t))return;if(i==="ticket.id"){const a=t.ticket;if(!Yu(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 Hs(t,i){if(!Yu(i)||i.t!=="v"&&i.t!=="o"&&i.t!=="l")return t;const r=i;return r.t==="v"?r.v:r.t==="o"?YO(t,r):FO(t,r)}function YO(t,i){const r=Yu(t)?{...t}:{};for(const a of i.d??[])delete r[a];for(const[a,o]of Object.entries(i.s))r[a]=Hs(r[a],o);return r}function FO(t,i){const r=i.id,a=Array.isArray(t)?t.slice():[],o=new Set(i.d??[]),u=[],c=new Map;for(const p of a){const y=Ab(p,r);y!==void 0&&o.has(y)||(y!==void 0&&c.set(y,u.length),u.push(p))}for(const[p,y]of Object.entries(i.s??{})){const v=c.get(p);if(v===void 0){u.push(Hs(void 0,y));continue}u[v]=Hs(u[v],y)}if(!i.order)return u;const h=new Map;for(const p of u){const y=Ab(p,r);y!==void 0&&h.set(y,p)}return i.order.filter(p=>h.has(p)).map(p=>h.get(p))}class GO{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+=Rb(u))}let a=null;(this.pending.size>vk||this.pendingBytes>bk)&&(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-Rb(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 Rb(t){return 64+(typeof t.type=="string"?t.type.length:0)}function ya(t,i){return{kind:"session",sessionId:t}}function _b(t){const i=t.addressOf??(a=>ya(a)),r=t.openingMessages??ck;return{kind:"ws-follow",open(a,o,u){return new Promise(c=>{const h=typeof location<"u"&&location.protocol==="https:"?"wss:":"ws:",p=typeof location<"u"?location.host:"127.0.0.1",y=t.url??`${h}//${p}/api/remote.mux`,v=(t.websocket??(N=>new WebSocket(N)))(y),g=`follow-${Math.random().toString(36).slice(2)}`;let w=!1;const x=()=>!w&&v.readyState===1,S=N=>{if(!w){w=!0,u.removeEventListener("abort",T);try{v.close()}catch{}c(N)}},T=()=>S({ok:!1,retryable:!1,code:"ABORTED"});u.addEventListener("abort",T),v.addEventListener("open",()=>{u.aborted||v.send(JSON.stringify({type:"open",streamId:g,endpoint:"session/follow",payload:{args:{request:{address:i(a.sessionId),maxMessages:r,assistantStream:!0,activate:!0}}}}))}),v.addEventListener("message",N=>{let j;try{j=JSON.parse(String(N.data))}catch{return}if(j.streamId===g){if(j.type==="error"){S({ok:!1,retryable:!0,code:"FOLLOW_ERROR",message:j.error?.message});return}if(j.type==="end"){S({ok:!0,throughSeq:-1});return}j.type==="item"&&$O(j.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 $O(t,i,r){const a=w1(t);if(!a)return;if(a.type==="snapshot"){const u=typeof a.cursor=="number"?a.cursor:-1,c=Is(a.records),h=c.length>0?Math.min(...c.map(y=>y.seq)):u+1,p=a.hasMore===!0;i.opened({firstSeq:h,cursor:u,hasMore:p,...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=Is(a);o.length&&i.events(o)}function w1(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)?w1(r):i}function Is(t){const i=[];return Au(t,i),i.sort((r,a)=>r.seq-a.seq)}function Au(t,i){if(!t)return;if(Array.isArray(t)){for(const o of t)Au(o,i);return}if(typeof t!="object")return;const r=t;if(r.event&&typeof r.event=="object"){const o=Ob(r.event);o&&i.push(o);return}const a=Ob(r);a&&i.push(a),Array.isArray(r.records)&&Au(r.records,i),Array.isArray(r.events)&&Au(r.events,i)}function Ob(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 zb(t={}){const i=t.fetch??fetch,r=t.url??$b;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(hk)}),p=await i(`${r}?${h}`,{method:"GET",credentials:"same-origin",signal:u,headers:{accept:"application/json"}});if(p.status===404)return{ok:!1,retryable:!1,code:"ENHANCE_UNAVAILABLE"};if(!p.ok)return{ok:!1,retryable:p.status>=500,code:"RANGE_ERROR",message:`HTTP ${p.status}`};const y=await p.json(),v=Is(y.events);if(v.length&&o.events(v,{throughSeq:a.throughSeq}),y.nextAfterSeq==null)return{ok:!0,throughSeq:a.throughSeq};if(y.nextAfterSeq<=c)return{ok:!1,retryable:!0,code:"RANGE_STALLED"};c=y.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 XO(t=fetch,i=$b,r){try{return(await t(i,{method:"HEAD",credentials:"same-origin",signal:r})).ok}catch{return!1}}const QO=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 p=r();i=null,t({reason:"visible",hiddenMs:p})},o=()=>{i==null&&(i=Date.now())},u=p=>{const y=r();i=null,t({reason:"pageshow",hiddenMs:y,persisted:p.persisted})},c=()=>t({reason:"online",hiddenMs:r()}),h=()=>{if(document.visibilityState==="hidden")return;const p=r();i=null,t({reason:"focus",hiddenMs:p})};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 ZO(){return typeof document<"u"&&document.visibilityState==="hidden"}function Mb(t){return{open(i,r){return KO(t,i,r??{})}}}function KO(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},p;const y=new Promise(P=>{p=P});let v=!1;const g=P=>{v||(v=!0,p(P))};let w=[],x=!1,S=null;const T=t.raf??(typeof requestAnimationFrame=="function"?requestAnimationFrame:P=>setTimeout(P,0)),N=t.cancelRaf??(typeof cancelAnimationFrame=="function"?cancelAnimationFrame:clearTimeout),j=()=>{S!=null&&(S.kind==="timer"?clearTimeout(S.id):N(S.id),S=null)},M=t.wait??PO,B=t.random??Math.random,K=t.now??Date.now,ee=t.isHidden??ZO,A=()=>{if(S=null,w.length===0)return;const P=w;w=[];const he={events:P,fromCache:x};x=!1;for(const We of o)We(he)},D=()=>{j(),A()},Y=(P,he=!1)=>{if(P.length===0||(he&&(x=!0),w.push(...P),S!=null))return;const We={kind:ee()?"timer":"raf",id:null};S=We,We.id=We.kind==="timer"?setTimeout(A,0):T(A)},le=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 he of c)he(h)};let O=0,V=!1,Z=0,ke=!0,oe=null,ge=!1,re=null,ce=null,xe=!1,Te=K(),R=Number.NEGATIVE_INFINITY;const Ke=async P=>{if(a.signal.aborted)return;if(ge){ge=!1;return}const he=new AbortController;oe=he;const We=()=>he.abort();a.signal.addEventListener("abort",We,{once:!0});try{await M(P,he.signal)}catch{}finally{a.signal.removeEventListener("abort",We),oe===he&&(oe=null)}},Ie=()=>{const P=xe;return xe=!1,P},q=P=>{if(!ke||a.signal.aborted)return;D();const he=K(),We=ce?ce():!0,dt=he-Te>=Nk,Ee=!We||P.reason==="online"||P.persisted===!0||P.hiddenMs>=Tk||P.reason!=="focus"&&dt;if(Z=0,O=0,V=!1,oe){oe.abort();return}if(!re){ge=!0;return}Ee&&(he-R<Ck||(R=he,re.signal.aborted||(xe=!0,re.abort())))};z();async function z(){try{await te()}finally{ke=!1,be()}}async function te(){const P=await t.checkpoint.getCursor(i);let he=P?.appliedSeq??-1;const We=await t.checkpoint.readEvents(i,-1),dt=JO(We,-1).filter(Ae=>Ae.seq<=he||he<0);he<0&&dt.length&&(he=dt[dt.length-1].seq);const Ee=new GO(he);P?.headSeq!=null&&Ee.setHead(P.headSeq),dt.length&&Y(dt,!0),le({phase:"connecting",appliedSeq:Ee.appliedSeq,headSeq:Ee.headSeq});let De=r.enhancement==="off"?!1:await ue();const Me=()=>({events(Ae){const Ue=Ee.push(Ae);Ee.headSeq!=null&&Ee.appliedSeq>Ee.headSeq&&Ee.setHead(Ee.appliedSeq),Ue.delivered.length&&(Y(Ue.delivered),t.checkpoint.putEvents(i,Ue.delivered),t.checkpoint.setCursor(i,Ee.appliedSeq,Ee.headSeq)),le({appliedSeq:Ee.appliedSeq,headSeq:Ee.headSeq,fraction:h.fraction}),Ue.overflow},head(Ae){Ee.setHead(Ae),le({headSeq:Ee.headSeq,appliedSeq:Ee.appliedSeq})},progress(Ae){const Ue=Ae.total&&Ae.total>0?Math.min(1,Ae.loaded/Ae.total):null;le({fraction:Ue,appliedSeq:Ee.appliedSeq,headSeq:Ee.headSeq})},ephemeral(Ae){for(const Ue of u)Ue(Ae)},opened(){}}),Ve=async(Ae,Ue,nt)=>{if(Ue<=Ae)return{ok:!0,throughSeq:Ue};le({phase:"syncing",fraction:h.fraction});const ae=Ue-Ae,Be=Me(),ut=De&&t.cdc!=null&&(ae>mk||ae*128>pk);if(De&&t.range!=null&&!ut&&t.range){const Bt=await t.range.fetch({sessionId:i,afterSeq:Ae,throughSeq:Ue},Be,nt);if(Bt.ok||nt.aborted)return Bt;De=!1}else if(ut&&t.cdc){const Bt=await t.cdc.fetch({sessionId:i,afterSeq:Ae,throughSeq:Ue},Be,nt);if(Bt.ok||nt.aborted)return Bt;De=!1}return t.page.fetch({sessionId:i,afterSeq:Ee.appliedSeq,throughSeq:Ue},Be,nt)};for(;!a.signal.aborted;){if(V){le({phase:"stalled",appliedSeq:Ee.appliedSeq,headSeq:Ee.headSeq,fraction:null});const pe=new AbortController,Le=()=>pe.abort();a.signal.addEventListener("abort",Le);const Je=Ee.headSeq??Ee.appliedSeq,lt=await t.page.fetch({sessionId:i,afterSeq:Ee.appliedSeq,throughSeq:Math.max(Je,Ee.appliedSeq)},Me(),pe.signal);a.signal.removeEventListener("abort",Le),lt.ok&&Ee.headSeq!=null&&Ee.appliedSeq>=Ee.headSeq&&(le({phase:"live",appliedSeq:Ee.appliedSeq,headSeq:Ee.headSeq,fraction:null,error:void 0}),g({ok:!0,caughtUpTo:Ee.appliedSeq})),Z+=1;const bt=ju(Z,B);await Ke(Math.min(bt,xk)),V=O>=Rd}if(a.signal.aborted)break;le({phase:h.phase==="restoring"?"connecting":h.phase==="live"?"syncing":"connecting"});const Ae=new AbortController;re=Ae,ce=null;const Ue=()=>Ae.abort();a.signal.addEventListener("abort",Ue);const nt=()=>{a.signal.removeEventListener("abort",Ue),Ae.abort(),re===Ae&&(re=null,ce=null)};let ae=null;const Be=Me(),ut=()=>{re===Ae&&(Te=K())},Kt={events(pe,Le){ut(),Be.events(pe,Le)},head(pe){ut(),Be.head(pe)},progress:Be.progress,ephemeral(pe){ut(),Be.ephemeral(pe)},opened(pe){ut(),ae=pe,re===Ae&&(ce=pe.alive??null),Ee.setHead(pe.cursor),le({headSeq:pe.cursor,appliedSeq:Ee.appliedSeq,phase:"syncing"})}},Bt=t.follow.open({sessionId:i},Kt,Ae.signal),Q=await Promise.race([Bt.then(pe=>({kind:"done",outcome:pe})),WO(()=>ae!=null,Ae.signal,M).then(()=>({kind:"opened"}))]),se=ae;if(Q.kind==="done"||se==null||Ae.signal.aborted){if(nt(),a.signal.aborted)break;if(Ie())continue;O+=1,O>=Rd&&(V=!0),Z+=1,await Ke(ju(Z,B));continue}O=0,Z=0;const _e=se.firstSeq-1,Ne=await Ve(Ee.appliedSeq,_e,Ae.signal);if(Ae.signal.aborted){if(nt(),a.signal.aborted)break;Ie();continue}if(!Ne.ok&&!Ne.retryable){le({phase:"error",error:{code:Ne.code,message:Ne.message??Ne.code,retrying:!1},appliedSeq:Ee.appliedSeq,headSeq:Ee.headSeq}),g({ok:!1,code:Ne.code,message:Ne.message??Ne.code}),nt();break}if(!Ne.ok){nt(),le({phase:"stalled",error:{code:Ne.code,message:Ne.message??Ne.code,retrying:!0},appliedSeq:Ee.appliedSeq,headSeq:Ee.headSeq}),Z+=1,await Ke(ju(Z,B));continue}le({phase:"live",appliedSeq:Ee.appliedSeq,headSeq:Ee.headSeq,fraction:null,error:void 0}),Ee.appliedSeq>=_e&&g({ok:!0,caughtUpTo:Ee.appliedSeq});const we=await Bt;if(nt(),a.signal.aborted)break;Ie()||we.ok||(O+=1,O>=Rd&&(V=!0),le({phase:"stalled",error:{code:we.code,message:we.message??we.code,retrying:!0}}),Z+=1,await Ke(ju(Z,B)))}h.phase!=="error"&&le({phase:"closed"}),j()}async function ue(){return r.enhancement==="off"||!t.cdc&&!t.range?!1:t.probe?t.probe():XO()}const ve=(t.onResume??QO)(q),ze=t.livenessMs===void 0?Ak:t.livenessMs;let ye=null;ze!==!1&&ze>0&&(ye=setInterval(()=>{ee()||!re||!ce||ce()||q({reason:"liveness",hiddenMs:0})},ze),ye.unref?.());function be(){ye!=null&&clearInterval(ye),ye=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:y,close(){ve(),be(),a.abort(),j(),le({phase:"closed"})}}}function JO(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 ju(t,i){return Math.min(Sk,wk*2**Math.max(0,t-1))*(.5+i()*.5)}function PO(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 WO(t,i,r){for(;!t()&&!i.aborted;)await r(5,i).catch(()=>{})}function qb(t={}){const i=t.addressOf??(u=>ya(u)),r=t.fetch??fetch,a=t.url??jk,o=t.maxMessages??fk;return{kind:"official-page",async fetch(u,c,h){if(u.throughSeq<=u.afterSeq)return{ok:!0,throughSeq:u.throughSeq};let p=u.throughSeq+1,y=0;const v=u.throughSeq-u.afterSeq;c.progress({loaded:0,total:v,unit:"events"});try{for(;!h.aborted;){const g=await e3(r,a,{address:i(u.sessionId),throughSeq:u.throughSeq,beforeSeq:p,maxMessages:o,turnWindow:dk},h);if(!g.ok)return g;const w=Is(g.records);w.length&&c.events(w,{throughSeq:u.throughSeq}),y+=w.length,c.progress({loaded:y,total:v,unit:"events"});const x=w.reduce((S,T)=>Math.min(S,T.seq),Number.POSITIVE_INFINITY);if(!g.hasMore||!Number.isFinite(x)||x<=u.afterSeq+1)break;if(x>=p)return{ok:!1,retryable:!0,code:"PAGE_STALLED",message:"Official page did not move."};p=x}return h.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!0,throughSeq:u.throughSeq}}catch(g){return h.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:{ok:!1,retryable:!0,code:"PAGE_ERROR",message:g instanceof Error?g.message:String(g)}}}}}async function e3(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 Db(t){const i=await crypto.subtle.digest("SHA-256",t);return[...new Uint8Array(i)].map(r=>r.toString(16).padStart(2,"0")).join("")}function Lb(t){const i=t.fetch??fetch,r=t.concurrency??yk,a=t.retries??gk,o=t.manifestUrl??kk,u=t.chunkUrl??Ek,c=t.wait??r3;return{kind:"cdc-snapshot",async fetch(h,p,y){if(h.throughSeq<=h.afterSeq)return{ok:!0,throughSeq:h.throughSeq};const v=new AbortController,g=()=>v.abort();y.addEventListener("abort",g);try{const w=await t3(i,o,h,v.signal);return w.ok?await n3({manifest:w.value,afterSeq:h.afterSeq,throughSeq:h.throughSeq,sink:p,cache:t.cache,fetchImpl:i,chunkUrl:u,concurrency:r,retries:a,wait:c,signal:v.signal}):w}catch(w){return y.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{y.removeEventListener("abort",g),v.signal.aborted||v.abort()}}}}async function t3(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 n3(t){const i=[...t.manifest.chunks].sort((N,j)=>N.fromSeq-j.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 N=i[u];if(!N||!r.has(N.fromSeq))break;const j=(r.get(N.fromSeq)??[]).filter(M=>M.seq>t.afterSeq&&M.seq<=t.throughSeq);j.length&&t.sink.events(j,{throughSeq:t.throughSeq}),u+=1}},h=[];for(const N of i){const j=await t.cache.getChunk(N.hash);j&&await Db(j)===N.hash?(r.set(N.fromSeq,Bb(j)),a+=N.bytes,t.sink.progress({loaded:a,total:o,unit:"bytes"}),c()):h.push(N)}if(h.length===0)return c(),{ok:!0,throughSeq:t.throughSeq};let p=0,y=0,v=null,g=null;const w=()=>{const N=g;g=null,N?.()},x=()=>new Promise(N=>{if(y===0){N();return}g=N}),S=async N=>{for(let j=0;j<t.retries;j+=1){if(t.signal.aborted||v)return;try{const M=await i3(t.fetchImpl,t.chunkUrl,t.manifest.sessionId,N,t.signal);if(await Db(M)!==N.hash)throw new Error("hash mismatch");await t.cache.putChunk(N.hash,M),r.set(N.fromSeq,Bb(M)),a+=N.bytes,t.sink.progress({loaded:a,total:o,unit:"bytes"}),c();return}catch(M){if(t.signal.aborted||v)return;if(j+1>=t.retries){v={ok:!1,retryable:!0,code:"CDC_CHUNK_FAILED",message:M instanceof Error?M.message:String(M)};return}await t.wait(50*2**j,t.signal).catch(()=>{})}}},T=()=>{for(;!v&&!t.signal.aborted&&y<t.concurrency&&p<h.length;){const N=h[p];if(p+=1,!N)break;y+=1,S(N).finally(()=>{y-=1,w()})}};for(T();y>0&&!t.signal.aborted;)T(),y>0&&await x();return t.signal.aborted?{ok:!1,retryable:!1,code:"ABORTED"}:v||(c(),{ok:!0,throughSeq:t.throughSeq})}async function i3(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 Bb(t){const i=new TextDecoder().decode(t),r=[];for(const a of i.split(`
|
|
66
|
+
`))if(a.trim()!=="")try{r.push(...Is(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})})}function l3(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 a3(t){return t.replace(/[@()\r\n]/g," ").replace(/\s+/g," ").trim()||"Untitled"}function s3(t,i){return`@${a3(t)} (${i})`}function o3(t,i,r,a,o){const u=Math.max(0,Math.min(i,t.length)),c=`${s3(a,o)} `;return{text:t.slice(0,r)+c+t.slice(u),cursor:r+c.length}}function u3(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 Wd=()=>({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 rc({open:t,children:i,className:r}){const[a,o]=E.useState(t),[u,c]=E.useState(t);E.useLayoutEffect(()=>{if(t){o(!0);const y=requestAnimationFrame(()=>c(!0));return()=>cancelAnimationFrame(y)}c(!1),window.matchMedia("(prefers-reduced-motion: reduce)").matches&&o(!1)},[t]);function h(y){y.target!==y.currentTarget||y.propertyName!=="grid-template-rows"||t||o(!1)}const p=["coll-container",u?"expand":"",r].filter(Boolean).join(" ");return m.jsx("div",{className:p,onTransitionEnd:h,children:m.jsx("div",{children:a?i:null})})}function c3({ticket:t,now:i,onSupply:r,onOpen:a}){const{t:o}=Ze(),[u,c]=E.useState(""),[h,p]=E.useState(""),[y,v]=E.useState(!1),g=ME(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:dx(t.status,o)})]}),zE(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,g?m.jsx("p",{className:g.stale?"stale":"work-question",children:g.text||o("work.questionEmpty")}):null,g?.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||y||(v(!0),p(""),r(t.id,S).then(T=>{v(!1),T?p(T):c("")}))},children:[m.jsxs("label",{children:[m.jsx("span",{children:o("work.answerLabel")}),m.jsx("textarea",{value:u,rows:2,disabled:y,onChange:x=>c(x.target.value)})]}),h?m.jsx("p",{className:"work-error",children:h}):null,m.jsx("button",{type:"submit",disabled:y||u.trim()==="",children:o("work.answerSubmit")})]}):null]})}function f3({briefing:t,time:i,mark:r,onOpenFile:a}){const{t:o}=Ze(),[u,c]=E.useState(!1),h=t.body.split(`
|
|
67
|
+
`).map(y=>y.trim()).find(Boolean)??"",p=[t.wallMs!=null?o("work.duration",{value:d3(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(y=>!y),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(h3,{}),h&&!u?m.jsx("span",{className:"briefing-preview",children:h}):null]}),m.jsx(rc,{open:u,children:m.jsxs("div",{className:"briefing-body",children:[t.body?m.jsx($s,{text:t.body,onOpenFile:a}):null,p.length?m.jsx("p",{className:"briefing-facts",children:p.join(" · ")}):null,t.notes.map(y=>m.jsx("p",{className:"briefing-note",children:y},y))]})})]}),i?m.jsx("time",{children:i}):null]})}function d3(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 h3(){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 m3({text:t}){return m.jsx("p",{className:"work-refused",children:t})}function p3({segment:t}){const[i,r]=E.useState(!1),{t:a}=Ze();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(A3,{}),m.jsx(Fu,{})]}),m.jsx("span",{className:"official-label",children:t.running?a("activity.thinking"):a("activity.reasoning")})]}),m.jsx(rc,{open:i,children:m.jsx("div",{className:"think-body",children:t.text})})]})}function y3({segments:t,pending:i=!1,tickets:r=[],cwd:a,connectionPhase:o}){const{t:u}=Ze(),c=t.flatMap(x=>x.kind==="tool"?[Wh(x,r)]:[]),h=t.some(x=>x.kind==="think"&&x.running)||c.some(x=>Bs.has(x)),p=i||h,y=[[u("activity.count.active"),c.filter(x=>Bs.has(x)).length],[u("activity.count.failed"),c.filter(x=>x==="failed").length],[u("activity.count.cancelled"),c.filter(x=>x==="cancelled").length],[u("activity.count.unknown"),c.filter(x=>x==="unknown").length]].filter(([,x])=>Number(x)>0).map(([x,S])=>`${x} ${S}`).join(" · "),[v,g]=E.useState(()=>p),w=o!=null&&o!=="live";return m.jsxs("section",{className:v?"activity-group open":"activity-group","aria-label":u("activity.title"),"data-state":p?"running":"settled","data-activity-start":t[0]?.id,children:[m.jsxs("button",{type:"button",className:"official-title","aria-expanded":v,onClick:()=>g(x=>!x),children:[m.jsxs("span",{className:"official-leading",children:[m.jsx(Th,{}),m.jsx(Fu,{})]}),m.jsx("span",{className:"official-label",children:t.length===1?u("activity.titleOne"):u("activity.titleWithCount",{count:String(t.length)})}),y?m.jsx("span",{className:"activity-status",children:y}):null,w?m.jsx("span",{className:"activity-status",children:["restoring","connecting","syncing"].includes(o??"")?u("activity.resyncing"):u("activity.connectionLastKnown")}):null]}),m.jsx(rc,{open:v,children:m.jsxs("div",{className:"activity-body",children:[i&&!h?m.jsx("p",{className:"activity-note",children:u("activity.generating")}):null,t.map(x=>x.kind==="think"?m.jsx(p3,{segment:x},x.id):m.jsx(j3,{segment:x,cwd:a,tickets:r,stale:w},x.callId))]})})]})}function g3({detail:t}){return m.jsxs("span",{className:"official-label call-label file-call",children:[m.jsx("span",{className:"call-verb",children:"Read"}),m.jsx("span",{className:"call-target",children:t.path}),t.span?m.jsx("span",{className:"call-lines",children:t.span}):null]})}function v3({detail:t}){return m.jsxs("span",{className:"official-label call-label file-call",children:[m.jsx("span",{className:"call-verb",children:"Edit"}),m.jsx("span",{className:"call-target",children:t.path}),t.added>0?m.jsxs("span",{className:"diff-plus",children:["+",t.added]}):null,t.removed>0?m.jsxs("span",{className:"diff-minus",children:["-",t.removed]}):null]})}function b3({detail:t}){return m.jsxs("span",{className:"official-label call-label file-call",children:[m.jsx("span",{className:"call-verb",children:"Write"}),m.jsx("span",{className:"call-target",children:t.path}),t.added>0?m.jsxs("span",{className:"diff-plus",children:["+",t.added]}):null]})}function x3({detail:t}){return m.jsxs("span",{className:"official-label call-label file-call",children:[m.jsx("span",{className:"call-verb",children:"Grep"}),m.jsx("span",{className:"call-target",children:t.pattern}),t.where?m.jsxs("span",{className:"call-lines",children:["in ",t.where]}):null]})}function w3({detail:t}){return m.jsxs("span",{className:"official-label call-label canvas-call",children:[m.jsx("span",{className:"call-tool",children:"canvas_read"}),m.jsx("span",{className:"call-target",children:t.path||"files"})]})}function S3({detail:t}){return m.jsxs("span",{className:"official-label call-label canvas-call",children:[m.jsx("span",{className:"call-tool",children:"canvas_edit"}),m.jsx("span",{className:"call-target",children:t.path}),t.added>0?m.jsxs("span",{className:"diff-plus",children:["+",t.added]}):null,t.removed>0?m.jsxs("span",{className:"diff-minus",children:["-",t.removed]}):null]})}function k3({detail:t}){return m.jsxs("span",{className:"official-label call-label canvas-call",children:[m.jsx("span",{className:"call-tool",children:"canvas_write"}),t.files?m.jsx("span",{className:"call-target",children:t.files}):null,t.added!=null&&t.added>0?m.jsxs("span",{className:"diff-plus",children:["+",t.added]}):null,t.remove?m.jsxs("span",{className:"call-lines",children:["remove ",t.remove]}):null]})}k4.show(t=>m.jsx(g3,{detail:t}));E4.show(t=>m.jsx(v3,{detail:t}));j4.show(t=>m.jsx(b3,{detail:t}));T4.show(t=>m.jsx(x3,{detail:t}));N4.show(t=>m.jsx(w3,{detail:t}));C4.show(t=>m.jsx(S3,{detail:t}));A4.show(t=>m.jsx(k3,{detail:t}));function E3({detail:t}){return t.view()}function j3(t){const[i,r]=E.useState(!1),[a,o]=E.useState(!1);return m.jsx(T3,{...t,open:i,argsOpen:a,onToggle:()=>r(u=>!u),onArgsToggle:()=>o(u=>!u)})}function T3({segment:t,cwd:i,tickets:r=[],stale:a=!1,open:o,argsOpen:u,onToggle:c,onArgsToggle:h}){const p=E.useId(),{t:y,locale:v}=Ze(),g=t1(t,i,r),w=wO({...t,args:g.args,result:g.output}),x=Jh(t.name)?y("activity.runCommand"):g.title,S=g.description||(g.todos.length?y("activity.updatePlan"):"")||(g.ticket?g.ticket.summary:"")||(g.detail?"":w?.name||x),T=["failed","cancelled","unknown"].includes(g.status);return m.jsx(Ub,{className:"official-row tool-activity",status:g.status,segmentId:t.id,open:o,onToggle:c,panelId:`${p}-tool`,title:m.jsxs(m.Fragment,{children:[m.jsxs("span",{className:"official-leading",children:[m.jsx(Th,{}),m.jsx(Fu,{})]}),g.detail&&S===""?m.jsx(E3,{detail:g.detail}):m.jsx("span",{className:"official-label",children:S}),T?m.jsxs("span",{className:"activity-status",children:[wb(g.status,y),a?y("activity.lastKnownSuffix"):""]}):null]}),children:m.jsxs("div",{className:"activity-detail",children:[g.status!=="succeeded"&&!T?m.jsxs("p",{className:"activity-note",children:[wb(g.status,y),a?y("activity.lastKnownSuffix"):""]}):null,g.todos.length?m.jsxs("p",{className:"activity-note",children:[g.todos.filter(N=>N.status==="completed").length,"/",g.todos.length," ",y("activity.planComplete")]}):null,m.jsxs("div",{className:"activity-facts",children:[g.title," · ",t.callId]}),g.command?m.jsxs("div",{className:"activity-command",children:[m.jsx(Ru,{text:g.command}),m.jsx("pre",{children:g.command})]}):null,g.cwd?m.jsxs("p",{className:"activity-facts",children:[g.cwdSource==="recorded"?y("activity.cwdRecorded"):g.cwdSource==="requested"?y("activity.cwdRequested"):y("activity.cwdSessionDefault"),": ",g.cwd]}):null,g.status==="waiting"?m.jsx("p",{className:"activity-note",children:y("activity.callRequested")}):null,g.jobId?m.jsxs("p",{className:"activity-facts",children:["Job: ",g.jobId," · ",y("activity.jobRegistered")]}):null,g.ticketId?m.jsxs("p",{className:"activity-facts",children:["Ticket: ",g.ticketId," ",g.ticket?.childSessionId?`· Worker: ${g.ticket.childSessionId}`:""]}):null,g.latestReport?m.jsxs("p",{className:"activity-note",children:[y("activity.latestReport")," (v",g.ticket?.revision,"): ",g.latestReport]}):null,g.todos.length?m.jsx("ul",{className:"activity-todos",children:g.todos.map((N,j)=>m.jsxs("li",{children:[m.jsx("span",{children:N.status})," ",N.content]},j))}):null,t.requestedAt!=null?m.jsxs("p",{className:"activity-facts",children:[y("activity.callRecorded"),":"," ",new Date(t.requestedAt).toLocaleString(v==="zh"?"zh-CN":"en"),t.settledAt!=null?` · ${y("activity.callWait")}: ${Math.max(0,t.settledAt-t.requestedAt)}ms`:""]}):null,g.exitCode!=null?m.jsxs("p",{className:"activity-facts",children:["Exit: ",g.exitCode]}):null,w?m.jsx(N3,{change:w}):null,m.jsx(Ub,{className:"official-row activity-arguments",open:u,onToggle:h,panelId:`${p}-args`,title:m.jsxs(m.Fragment,{children:[m.jsxs("span",{className:"official-leading",children:[m.jsx(Th,{}),m.jsx(Fu,{})]}),m.jsx("span",{className:"official-label",children:y("activity.fullArgs")})]}),trailing:u?m.jsx(Ru,{text:g.args}):null,children:m.jsx("pre",{children:g.args||"{}"})}),t.resultReceived||t.result?m.jsxs("div",{className:"activity-output",children:[m.jsxs("div",{className:"activity-block-head",children:[m.jsx("span",{children:y("activity.toolResult")}),m.jsx(Ru,{text:g.output})]}),m.jsx("pre",{children:g.output||y("activity.emptyResult")})]}):null]})})}function Ub({className:t,status:i,segmentId:r,open:a,onToggle:o,panelId:u,title:c,trailing:h,children:p}){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:y=>{y.stopPropagation(),o()},children:c}),h,m.jsx("div",{id:u,className:"activity-panel",children:m.jsx(rc,{open:a,children:p})})]})}function N3({change:t}){const i=t.lines.map(r=>`${r.kind==="del"?"- ":r.kind==="add"?"+ ":" "}${r.text}`).join(`
|
|
68
|
+
`);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(Ru,{text:i})]}),m.jsx("div",{className:"diff-body",children:t.lines.map((r,a)=>m.jsx("div",{className:C3(r.kind),children:r.text},a))})]})}function C3(t){return t==="add"?"diff-line added":t==="del"?"diff-line removed":"diff-line same"}function Ru({text:t}){const[i,r]=E.useState(!1);return m.jsx("button",{type:"button",className:"diff-copy","aria-label":i?"Copied":"Copy",onClick:a=>{a.stopPropagation(),navigator.clipboard.writeText(t).then(()=>{r(!0),window.setTimeout(()=>r(!1),1e3)})},children:i?m.jsx(_3,{}):m.jsx(R3,{})})}function Fu(){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 A3(){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 Th(){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 R3(){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 _3(){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 O3={aborted:"question.aborted",failed:"question.failed",answered:"question.answered"};function As(t){return{selected:[...t.selected],custom:t.custom,skipped:t.skipped}}function z3(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 M3({item:t,draft:i,interactive:r,disabled:a,onToggle:o}){const{t:u}=Ze();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 p=c.has(h.label),y=z4(h.label,h.recommended),v=p?"user-question-option selected":"user-question-option",g=m.jsxs(m.Fragment,{children:[m.jsxs("span",{className:"user-question-option-label",children:[h.label,y.recommended?m.jsx("span",{className:"user-question-badge",children:u("question.recommended")}):null]}),h.description?m.jsx("span",{className:"user-question-option-desc",children:h.description}):null]});return m.jsx("li",{children:r?m.jsx("button",{type:"button",className:v,"data-selected":p?"true":"false","aria-pressed":t.multiSelect?p:void 0,disabled:a,onClick:()=>o(h.label),children:g}):m.jsx("div",{className:v,"data-selected":p?"true":"false",children:g})},h.label)})})}function am({interactive:t,waitLabel:i,onTakeTime:r,busy:a}){const{t:o}=Ze();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 q3({segment:t,sessionId:i,onCompose:r,remainingMs:a,waitState:o}){const u=Xs(t);return u?u.presentation==="plan-review"?m.jsx(L3,{segment:t,sessionId:i,onCompose:r,remainingMs:a,waitState:o}):u.presentation==="approval"?m.jsx(B3,{segment:t,sessionId:i,remainingMs:a,waitState:o}):m.jsx(D3,{segment:t,sessionId:i,remainingMs:a,waitState:o}):null}function sm(t,i,r,a,o){const{t:u}=Ze(),c=!!(r&&l1(r.state)),[h,p]=E.useState(o==="waiting"||r?.wait==="waiting"),[y,v]=E.useState(o==="continued"||r?.state==="continued"),[g,w]=E.useState(a??r?.timeoutMs),x=E.useRef(null),S=(o==="counting"||r?.wait==="counting"||typeof(a??r?.timeoutMs)=="number")&&!h&&!y;E.useEffect(()=>{o==="waiting"&&p(!0),(o==="continued"||r?.state==="continued")&&v(!0),typeof a=="number"&&(x.current=Date.now()+a,w(a))},[a,o,r?.state]),E.useEffect(()=>{if(!c||!S)return;const j=a??g??r?.timeoutMs;if(typeof j!="number")return;x.current==null&&(x.current=Date.now()+j);const M=()=>{const K=Math.max(0,(x.current??Date.now())-Date.now());return w(K),K<=0?(v(!0),t&&Pe("/questions/timeout",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:t,callId:i})}),!1):!0};if(!M())return;const B=window.setInterval(()=>{M()||window.clearInterval(B)},250);return()=>window.clearInterval(B)},[c,S,t,i,a,g,r?.timeoutMs]);async function T(){p(!0),x.current=null,t&&await Pe("/questions/take-time",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:t,callId:i})})}const N=y?u("question.continued"):h?u("question.waitingNoTimer"):S&&typeof g=="number"?u("question.remaining",{time:z3(g)}):null;return{answerable:c,held:h,continued:y,waitLabel:N,takeTime:T,markHeld:()=>p(!0)}}function D3({segment:t,sessionId:i,remainingMs:r,waitState:a}){const{t:o}=Ze(),u=Xs(t),c=sm(i,u.callId,u,r,a),[h,p]=E.useState({}),[y,v]=E.useState(!1),[g,w]=E.useState(""),x=u.questions,S=E.useMemo(()=>{const A={};for(const D of x)A[D.id]=h[D.id]??As(D);return A},[h,x]),T=!!i&&c.answerable,N=x.length>1||x.some(A=>A.multiSelect||A.options.length===0);function j(A,D){c.markHeld(),p(Y=>{const le=x.find(V=>V.id===A),O=Y[A]??(le?As(le):{selected:[],custom:"",skipped:!1});return{...Y,[A]:{...O,...D}}})}async function M(A){if(!(!i||y)){v(!0),w("");try{const D=await Pe("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,callId:u.callId,answers:A})});if(D.status===200&&D.body.ok!==!1||D.status===409)return;const Y=typeof D.body.message=="string"?D.body.message:o("question.submitFailed");w(Y)}catch{w(o("question.submitFailed"))}finally{v(!1)}}}function B(A,D){return D.skipped?{id:A.id,selected:[]}:D.custom.trim()&&(A.multiSelect||D.selected.length===0||A.options.length===0)?A.multiSelect?{id:A.id,selected:D.selected,custom:D.custom}:{id:A.id,selected:[],custom:D.custom}:D.selected.length?{id:A.id,selected:[...D.selected]}:null}function K(){const A=x.map(D=>B(D,S[D.id]??As(D)));if(A.some(D=>D==null)){w(o("question.incomplete"));return}M(A)}function ee(A,D){if(!T||y)return;if(!A.multiSelect&&x.length===1&&!S[A.id]?.custom){M([{id:A.id,selected:[D]}]);return}const Y=S[A.id]??As(A),le=A.multiSelect?Y.selected.includes(D)?Y.selected.filter(O=>O!==D):[...Y.selected,D]:[D];j(A.id,{selected:le,skipped:!1,custom:A.multiSelect?Y.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(am,{interactive:T,waitLabel:c.waitLabel,onTakeTime:()=>{c.takeTime()},busy:y}),u.questions.map(A=>{const D=S[A.id]??As(A);return m.jsxs("article",{className:"user-question","data-question":A.id,children:[A.header?m.jsx("h3",{className:"user-question-header",children:A.header}):null,m.jsx("p",{className:"user-question-text",children:A.question}),A.detail?m.jsx("p",{className:"user-question-hint",children:A.detail}):null,A.multiSelect&&c.answerable?m.jsx("p",{className:"user-question-hint",children:o("question.multiSelect")}):null,m.jsx(M3,{item:A,draft:c.answerable?D:{selected:A.selected,custom:A.custom,skipped:A.skipped},interactive:T,disabled:y,onToggle:Y=>ee(A,Y)}),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:D.custom,disabled:y,rows:2,placeholder:o("question.customPlaceholder"),onChange:Y=>j(A.id,{custom:Y.target.value,skipped:!1})})]}),m.jsx("button",{type:"button",className:"user-question-skip",disabled:y,onClick:()=>{if(x.length===1){M([{id:A.id,selected:[]}]);return}j(A.id,{skipped:!0,selected:[],custom:""})},children:o("question.skip")})]}):null,!T&&A.custom?m.jsx("p",{className:"user-question-hint",children:o("question.custom",{text:A.custom})}):null,(A.skipped||D.skipped)&&(u.state!=="open"||T)?m.jsx("p",{className:"user-question-hint",children:o("question.skipped")}):null]},A.id)}),T&&(N||x.some(A=>(S[A.id]?.custom??"").trim()!==""))?m.jsx("button",{type:"button",className:"user-question-submit",disabled:y,onClick:K,children:o(y?"question.submitting":"question.submit")}):null,g?m.jsx("p",{className:"user-question-status exception",children:g}):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(O3[u.state])}):null]})}function L3({segment:t,sessionId:i,onCompose:r,remainingMs:a,waitState:o}){const{t:u}=Ze(),c=Xs(t),h=n1(c.questions),p=sm(i,c.callId,c,a,o),[y,v]=E.useState(!1),[g,w]=E.useState(""),[x,S]=E.useState(!1),[T,N]=E.useState(""),j=!!i&&p.answerable,M=h.item.selected[0],B=M===h.approve.label;async function K(){if(!(!i||x)){S(!0),N("");try{const A=await Pe("/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(A.status===200&&A.body.ok!==!1||A.status===409)return;N(typeof A.body.message=="string"?A.body.message:u("question.submitFailed"))}catch{N(u("question.submitFailed"))}finally{S(!1)}}}async function ee(){if(!i||x)return;const A=g.trim();if(!A){N(u("question.changesNeeded"));return}S(!0),N("");try{const D=await Pe("/questions/cancel",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,callId:c.callId})});if(D.status===200&&D.body.ok!==!1){r?.(A);return}if(D.status===409){r?.(A);return}N(typeof D.body.message=="string"?D.body.message:u("question.submitFailed"))}catch{N(u("question.submitFailed"))}finally{S(!1)}}return m.jsxs("section",{className:"user-question-card","data-segment":t.id,"data-state":p.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:h.item.question}),m.jsx(am,{interactive:j,waitLabel:p.waitLabel,onTakeTime:()=>{p.takeTime()},busy:x}),h.plan?y?m.jsx("div",{className:"user-question-plan",children:m.jsx($s,{text:h.plan})}):m.jsx("p",{className:"user-question-hint",children:h.plan.split(`
|
|
69
|
+
`).filter(Boolean).slice(0,2).join(" ")}):null,h.plan?m.jsx("button",{type:"button",className:"user-question-skip",onClick:()=>v(A=>!A),children:u(y?"question.hidePlan":"question.viewFull")}):null,j?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:g,disabled:x,rows:3,placeholder:u("question.changePlaceholder"),onChange:A=>{p.markHeld(),w(A.target.value)}})]}),m.jsxs("div",{className:"user-question-row",children:[m.jsx("button",{type:"button",className:"user-question-skip",disabled:x,onClick:()=>{ee()},children:u("question.requestChanges")}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:x,onClick:()=>{K()},children:u(x?"question.submitting":"question.approvePlan")})]})]}):M?m.jsx("p",{className:"user-question-status",children:B?u("question.approvePlan"):M}):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 B3({segment:t,sessionId:i,remainingMs:r,waitState:a}){const{t:o,locale:u}=Ze(),c=Xs(t),h=i1(c.questions),p=sm(i,c.callId,c,r,a),[y,v]=E.useState(!1),[g,w]=E.useState(""),x=!!i&&p.answerable,S=Kd(h.intent.display?.question,u,h.item.question),T=Kd(h.intent.display?.detail,u,h.item.detail),N=Kd(h.intent.display?.approve,u,h.approve.label),j=h.item.selected[0];async function M(B){if(!(!i||y)){v(!0),w("");try{const K=await Pe("/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(K.status===200&&K.body.ok!==!1||K.status===409)return;w(typeof K.body.message=="string"?K.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":p.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:h.intent.subject.name}):null,m.jsx("p",{className:"user-question-text",children:S}),T?m.jsx("p",{className:"user-question-hint",children:T}):null,m.jsx(am,{interactive:x,waitLabel:p.waitLabel,onTakeTime:()=>{p.takeTime()},busy:y}),x?m.jsxs("div",{className:"user-question-row",children:[m.jsx("button",{type:"button",className:"user-question-skip",disabled:y,onClick:()=>{M(h.reject.label)},children:o("question.reject")}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:y,onClick:()=>{M(h.approve.label)},children:y?o("question.submitting"):N||o("question.allow")}),h.always?m.jsx("button",{type:"button",className:"user-question-submit",disabled:y,onClick:()=>{M(h.always.label)},children:o("question.alwaysAllow")}):null]}):j?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,g?m.jsx("p",{className:"user-question-status exception",children:g}):null]})}function U3({approval:t,sessionId:i}){const{t:r,locale:a}=Ze(),[o,u]=E.useState(!1),[c,h]=E.useState(""),[p,y]=E.useState(t.state),v=p==="recorded"?t.state:p,g=!!i&&v==="open",w=a.startsWith("zh")&&t.displayReason?.zh?t.displayReason.zh:t.displayReason?.en||t.reason;async function x(T){if(!(!i||o)){u(!0),h("");try{const N=await Pe("/approvals/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,requestId:t.requestId,outcome:T})});if(N.status===200&&N.body.ok!==!1){y(T);return}if(N.status===409){y(T);return}h(typeof N.body.message=="string"?N.body.message:r("approval.submitFailed"))}catch{h(r("approval.submitFailed"))}finally{u(!1)}}}const S=v==="allowed-once"?r("approval.allowed"):v==="rejected"?r("approval.rejected"):v==="cancelled"?r("approval.cancelled"):v==="unavailable"?r("approval.failed"):null;return m.jsxs("section",{className:"user-question-card","data-kind":"tool-approval","data-state":v,"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:t.toolName}),w?m.jsx("p",{className:"user-question-hint",children:w}):null,g?m.jsxs("div",{className:"user-question-row",children:[m.jsx("button",{type:"button",className:"user-question-skip",disabled:o,onClick:()=>{x("rejected")},children:r("approval.reject")}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:o,onClick:()=>{x("allowed-once")},children:r(o?"question.submitting":"approval.allowOnce")})]}):S?m.jsx("p",{className:p==="allowed-once"?"user-question-status":"user-question-status exception",children:S}):null,c?m.jsx("p",{className:"user-question-status exception",children:c}):null]})}function H3(t){if(t.type==="user"||t.type==="card")return typeof t.segment?.seq=="number"?t.segment.seq:null;if(t.type!=="turn"||!t.segments)return null;let i=-1;for(const r of t.segments)typeof r.seq=="number"&&r.seq>i&&(i=r.seq);return i<0?null:i}function I3(t,i){let r;typeof t?.seq=="number"&&(r=t.seq);for(const a of i??[])typeof a.seq=="number"&&(r==null||a.seq>r)&&(r=a.seq);return r}function V3(t,i){const r=[...t],a=[...i].sort((o,u)=>(o.seq??Number.POSITIVE_INFINITY)-(u.seq??Number.POSITIVE_INFINITY));for(const o of a){let u=r.length;if(typeof o.seq=="number")for(let c=0;c<r.length;c++){const h=H3(r[c]);if(h!=null&&h>o.seq){u=c;break}}r.splice(u,0,o.block)}return r}function Y3(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 F3({sessionId:t,segments:i,completed:r,failures:a,retries:o,turnEnds:u,tickets:c,now:h,canRetry:p,onRetry:y,onSupply:v,onOpenSession:g,onOpenFile:w,onOpenInbox:x,botLabel:S,chat:T=!1,cwd:N,connectionPhase:j,approvals:M=[],questionWaits:B,onCompose:K}){const ee=[];let A=null;const D=()=>{A&&(A.segments.length||a[A.turn]||o[A.turn]?.length)&&ee.push(A),A=null};for(const oe of i){if(oe.kind==="user"){D(),hx(oe.text)||ee.push({type:"user",segment:oe});continue}if(lm(oe)){A?A.segments.push(oe):ee.push({type:"card",segment:oe});continue}const ge=oe.turn??-1;(!A||A.turn!==ge)&&(D(),A={type:"turn",turn:ge,seconds:r[ge],segments:[]}),A.segments.push(oe)}D();const Y=new Set(ee.flatMap(oe=>oe.type==="turn"?[oe.turn]:[])),le=[],O=oe=>{if(Y.has(oe)||!Number.isFinite(oe))return;const ge=a[oe],re=o[oe];!ge&&!re?.length||(Y.add(oe),le.push({seq:I3(ge,re),block:{type:"turn",turn:oe,seconds:r[oe],segments:[]}}))};for(const oe of Object.keys(a))O(Number(oe));for(const oe of Object.keys(o))O(Number(oe));if(le.length){const oe=V3(ee,le);ee.splice(0,ee.length,...oe)}const V=new Map(c.map(oe=>[oe.id,oe])),Z=ee.reduce((oe,ge)=>ge.type==="turn"?Math.max(oe,ge.turn):oe,-1),ke=mx(c);return m.jsx(m.Fragment,{children:ee.map((oe,ge)=>m.jsx(E.Fragment,{children:oe.type==="user"?m.jsx(Q3,{segment:oe.segment,botLabel:S,onOpenInbox:x,onOpenFile:w}):oe.type==="card"?m.jsx(S1,{segment:oe.segment,sessionId:t,byId:V,now:h,onSupply:v,onOpenSession:g,approvals:M}):m.jsx(W3,{sessionId:t,cwd:N,connectionPhase:j,block:oe,index:ge,blocks:ee,failures:a,retries:o,turnEnds:u,latestTurn:Z,background:ke,byId:V,now:h,canRetry:p,onRetry:y,onSupply:v,onOpenSession:g,onOpenFile:w,chat:T,approvals:M,questionWaits:B,onCompose:K})},oe.type==="turn"?`${t}:turn-${oe.turn}`:oe.segment.id))})}function S1({segment:t,sessionId:i,byId:r,now:a,onSupply:o,onOpenSession:u,approvals:c}){const h=I0();return t.kind==="worker-card"?m.jsx(c3,{ticket:G3(t,r),now:a,onSupply:o,onOpen:u}):t.kind==="canvas-card"?m.jsx(k_,{item:$3(t),onOpen:()=>h.open(t.canvasId)}):m.jsx(U3,{approval:X3(t,i,c),sessionId:i})}function G3(t,i){return i.get(t.ticketId)??{id:t.ticketId,status:t.status,revision:1,summary:t.summary,childSessionId:null,startedAt:null,events:[]}}function $3(t){return{id:t.canvasId,title:t.title,ticketId:t.ticketId,previewRevision:t.revision,stableRevision:null}}function X3(t,i,r){return r.find(a=>a.requestId===t.requestId)??{requestId:t.requestId,sessionId:i??"",toolName:t.toolName,reason:t.reason,...t.callId?{callId:t.callId}:{},state:"recorded"}}function Q3({segment:t,botLabel:i,onOpenInbox:r,onOpenFile:a}){const o=tc(t.text),u=Ch(t.text),{locale:c}=Ze(),h=Y3(t.time,c);if(u)return m.jsx(f3,{briefing:u,time:h,mark:t.id,onOpenFile:a});if(o){const p=a4([{kind:"in",id:t.id,seq:t.seq,time:t.time,mail:o}],i);return m.jsx(c4,{who:p?.who??"BOT",preview:p?.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:m.jsx(Z3,{text:t.text})}),h?m.jsx("time",{children:h}):null]})}function Z3({text:t}){const i=U0(t);return m.jsxs(m.Fragment,{children:[i.text,i.chips.length>0?m.jsx("span",{className:"canvas-chip-row",children:i.chips.map(r=>m.jsx("span",{className:"canvas-chip",children:m.jsx("span",{className:"canvas-chip-text",children:r.label})},`${r.canvasId}:${r.revision}:${r.path}`))}):null]})}function K3(t,i,r){for(let a=i-1;a>=0;a-=1){const o=t[a];if(o?.type==="user"&&o.segment?.text&&o.segment.text.trim()!==""){if(tc(o.segment.text)||Ch(o.segment.text))continue;if(o.segment.turn==null||o.segment.turn===r)return U0(o.segment.text).text;break}}return""}function J3(t,i){return t.slice(i+1).some(r=>r.type==="user")}function P3({seconds:t,failure:i,retries:r,prompt:a,continued:o,canRetry:u,onRetry:c,showLabel:h}){const{t:p}=Ze(),[y,v]=E.useState(!1);if(!i&&r.length===0)return null;const g=y||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&&!g?m.jsx("button",{type:"button",className:"retry-turn",disabled:!u,onClick:()=>{v(!0),c(a)},children:p("bot.retry")}):null]})}function W3({sessionId:t,block:i,index:r,blocks:a,failures:o,retries:u,turnEnds:c,latestTurn:h,background:p,byId:y,now:v,canRetry:g,onRetry:w,onSupply:x,onOpenSession:S,onOpenFile:T,chat:N=!1,cwd:j,connectionPhase:M,approvals:B=[],questionWaits:K,onCompose:ee}){const{t:A}=Ze(),D=xO(i.segments),Y=V=>K?.[V]??K?.[`${t}:${V}`],le=D.some(V=>V.type==="activity"),O=N&&c[i.turn]==="aborted"&&!o[i.turn]&&!(i.turn===h&&p);return m.jsx("div",{children:m.jsxs("div",{"data-turn":`turn:${i.turn}`,children:[D.map(V=>{if(V.type==="text")return m.jsx("div",{"data-segment":V.segment.id,className:V.segment.streaming?"assistant streaming":"assistant",children:m.jsx($s,{text:V.segment.text,streaming:V.segment.streaming,onOpenFile:T})},V.segment.id);if(V.type==="question"){const ke=Y(V.segment.callId);return m.jsx(q3,{segment:V.segment,sessionId:t,onCompose:ee,remainingMs:ke?.remainingMs,waitState:ke?.waitState},V.segment.id)}if(V.type==="card")return m.jsx(S1,{segment:V.segment,sessionId:t,byId:y,now:v,onSupply:x,onOpenSession:S,approvals:B},V.segment.id);const Z=V.segments.filter(ke=>ke.kind==="tool");return m.jsxs(E.Fragment,{children:[m.jsx(y3,{segments:V.segments,cwd:j,tickets:[...y.values()],connectionPhase:M}),Z.filter(ke=>qE(ke)).map(ke=>m.jsx(m3,{text:DE(ke.result,A)},ke.id))]},V.id)}),O?m.jsx("p",{className:"work-note",children:A("bot.stopped")}):null,m.jsx(P3,{seconds:i.seconds,failure:o[i.turn],retries:u[i.turn]??[],prompt:K3(a,r,i.turn),continued:J3(a,r),canRetry:g,onRetry:w,showLabel:!le}),i.turn===h&&c[i.turn]==="aborted"&&p?m.jsx("p",{className:"work-note",children:A("bot.stoppedBackground")}):null]})})}function Hb(){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 Ib(t,i,r){if(!(r in i))return i;const a={...i};return delete a[r],sessionStorage.setItem(t,JSON.stringify(a)),a}function eh(t){try{const i=JSON.parse(sessionStorage.getItem(t)||"{}");return i&&typeof i=="object"?i:{}}catch{return{}}}function Vb(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 th(t){fetch("/dsh-bot/api/sessions/previews",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(t),keepalive:!0})}function ez(t){return(t??"").split("/").filter(Boolean).at(-1)??""}function tz(){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(p=>typeof p=="string"))}catch{}}),r.addEventListener("error",()=>o([]))})}function nz(){const{t,locale:i,setLocale:r}=Ze(),[a,o]=E.useState(Hb),[u,c]=E.useState([]),[h,p]=E.useState(""),[y,v]=E.useState(""),[g,w]=E.useState(!1),[x,S]=E.useState(()=>eh("dsh-bot.titles")),[T,N]=E.useState(()=>eh("dsh-bot.previews")),[j,M]=E.useState(Wd),[B,K]=E.useState(""),[ee,A]=E.useState(null),[D,Y]=E.useState(a);D!==a&&(Y(a),M(Wd()));const[le,O]=E.useState(null),[V,Z]=E.useState({ready:!1,reason:"loading"}),[ke,oe]=E.useState(null),[ge,re]=E.useState(null),[ce,xe]=E.useState(!1),[Te,R]=E.useState(""),[Ke,Ie]=E.useState([]),[q,z]=E.useState(!1),[te,ue]=E.useState(0);E.useEffect(()=>{Ie([])},[a]);const[ve,ze]=E.useState(0),[ye,be]=E.useState(0),[P,he]=E.useState(""),[We,dt]=E.useState(""),[Ee,De]=E.useState(!1),[Me,Ve]=E.useState(null),[Ae,Ue]=E.useState(null),[nt,ae]=E.useState(null),[Be,ut]=E.useState([]),[Kt,Bt]=E.useState({}),[Q,se]=E.useState(!1),[_e,Ne]=E.useState(!1),[we,pe]=E.useState({}),[Le]=E.useState(()=>J0(async()=>{const C=await Pe("/authorization");if(C.status!==200)throw new Error("Authorization catalog unavailable");return{available:C.body.available,entries:C.body.entries}})),Je=E.useRef(void 0),lt=E.useRef(null),[bt,gt]=E.useState(null),[wn,Nt]=E.useState(0),[Ct,ht]=E.useState(!1),[Ft,hi]=E.useState(()=>new Set),[Fn,J]=E.useState(()=>new Set),[me,Et]=E.useState(!1),[vt,at]=E.useState(!1),[Mt,jt]=E.useState(""),[gl,nr]=E.useState(0),[qn,Oi]=E.useState(()=>new Set),[ni,zi]=E.useState({}),[Mi,vl]=E.useState({}),[ir,Qs]=E.useState(!1),[lc,Zs]=E.useState({}),[rr,Dr]=E.useState(()=>Date.now()),[bl,ka]=E.useState(""),Ks=i4(a,gl);E.useEffect(()=>{ut([]),Bt({});const C=g4({visible:!document.hidden,fetch:async W=>{const de=await Pe(`/interactions?compact=1&sessionId=${encodeURIComponent(a)}`,{signal:W});if(de.status!==200)throw new Error("Interactions unavailable");return de.body},active:W=>{const de=W;return!!(de.questions?.length||de.approvals?.some(Oe=>Oe.state==="open")||de.authorization?.prompts?.length||de.authorization?.inFlight?.length)},apply:W=>{const de=W,Oe=Array.isArray(de.approvals)?de.approvals:[];ut(Oe);const je={};if(Array.isArray(de.questions))for(const wt of de.questions)typeof wt.callId=="string"&&wt.callId!==""&&(je[wt.callId]={remainingMs:wt.remainingMs,waitState:wt.waitState});Bt(je);const $e=de.authorization,Ot=$e&&typeof $e=="object"?$e.prompts:[];Ne(Array.isArray(Ot)&&Ot.length>0);const mt=$e&&typeof $e=="object"?$e:{},pt=JSON.stringify([mt.catalogRevision,mt.available]);Je.current!==pt&&(Je.current=pt,Le.invalidate()),pe(wt=>JSON.stringify(wt)===JSON.stringify(mt)?wt:mt)},schedule:(W,de)=>{const Oe=window.setTimeout(W,de);return()=>window.clearTimeout(Oe)}});lt.current=C;const G=()=>C.setVisible(!document.hidden);return document.addEventListener("visibilitychange",G),()=>{C.close(),lt.current===C&&(lt.current=null),document.removeEventListener("visibilitychange",G)}},[a,Le]),E.useEffect(()=>{Pe("/cua").then(C=>se(C.body.available===!0))},[]);const Ea=E.useRef(null),Lr=E.useRef(null),xl=E.useRef(null),wl=E.useRef(null),Sl=E.useRef(new Set),Gn=E.useRef(0),$t=E.useRef(new Map),ln=E.useRef(0),mi=E.useRef(new Map),ja=E.useRef(!1),kl=E.useRef(a),Ta=E.useRef(null);kl.current=a;function lr(C){return ni[C.sessionId]||x[C.sessionId]||C.title||ez(C.cwd)||t("session.unnamed")}function qi(C){const G=u.find(W=>W.sessionId===C);return G?lr(G):ni[C]||x[C]||""}const El=K0(j.segments),ii=a!==""&&B!==a&&(ee==null||ee.phase==="restoring"||ee.phase==="connecting"||ee.phase==="syncing"&&B!==a),Di=ee?.fraction!=null?{loaded:Math.round(ee.fraction*1e3),total:1e3}:null,Li=ee?.phase==="syncing"&&ee.fraction!=null,pi=E.useMemo(()=>l4(j.segments),[j.segments]),ar=E.useMemo(()=>yO(pi),[pi]),Pt=a?lr({sessionId:a,cwd:u.find(C=>C.sessionId===a)?.cwd,title:j.title||null}):t("app.title"),Js=a?`/#/s/${encodeURIComponent(a)}`:"/";function Br(C){at(!1),o(C),De(!1),ht(!1),gt(null),O(null),dt(""),jt("");const G=C?`#/s/${encodeURIComponent(C)}`:"#/";location.hash!==G&&history.replaceState(null,"",G)}function Ps(C){if(!C||C===a)return;const G=a;at(!1),o(C),De(!1),ht(!1),gt(null),O(null),dt(""),jt("");const W=`#/s/${encodeURIComponent(C)}`;location.hash!==W&&history.pushState({kind:"worker",owner:G},"",W)}function yi(){if(at(!1),De(!1),ht(!1),gt(null),history.state?.kind==="worker"){history.back();return}bl&&Br(bl)}E.useEffect(()=>{let C=!1;return tz().then(G=>{C||hi(new Set(G))}),()=>{C=!0}},[]);function Bi(C){const G=TE(C);G&&(Zs(G.signals),vl(G.cards),Qs(!0));const W=C.desk;if(!W||typeof W!="object"||Array.isArray(W))return;const de=W,Oe=de.sessions;if(Oe&&typeof Oe=="object"&&!Array.isArray(Oe)){const mt=Oe,pt=mt.result;if(pt?.ok!==!0)p(pt?.error?.message||String(mt.error||t("session.listUnavailable")));else if(p(""),c(Aa(pt.value?.items)),ct(mt.previews),!ja.current){ja.current=!0;const wt=Vb(mt.previews),St={};for(const[Ut,Vt]of Object.entries(eh("dsh-bot.previews")))Sl.current.has(Ut)||wt[Ut]||!Vt||(St[Ut]=Vt);Object.keys(St).length>0&&th({previews:St})}}const je=de.bots;if(je&&typeof je=="object"&&!Array.isArray(je)&&je.ok===!0){const mt=je,pt=Array.isArray(mt.bots)?mt.bots:[],wt=pt.flatMap(Ut=>{if(!Ut||typeof Ut!="object")return[];const Vt=Ut.sessionId;return typeof Vt=="string"?[Vt]:[]}),St={};for(const Ut of pt){if(!Ut||typeof Ut!="object")continue;const Vt=Ut.sessionId,$n=Ut.name;typeof Vt=="string"&&typeof $n=="string"&&$n!==""&&(St[Vt]=$n)}if(wt.length===0&&Array.isArray(mt.sessionIds))for(const Ut of mt.sessionIds)typeof Ut=="string"&&wt.push(Ut);Oi(new Set(wt)),zi(St)}const $e=de.health;if($e&&typeof $e=="object"&&!Array.isArray($e)){const mt=$e;oe(mt),mt.execution&&Z({ready:mt.execution.ready===!0,reason:mt.execution.reason||(mt.execution.ready===!0?"":"catalog_unreadable")})}const Ot=de.usage;Ot&&typeof Ot=="object"&&!Array.isArray(Ot)&&re(Ot)}E.useEffect(()=>{let C=!1;return(async()=>{try{const G=await Pe("/sessions");if(C)return;const W=G.body.result;W?.ok===!0?(p(""),c(Aa(W.value?.items)),ct(G.body.previews)):G.status!==200&&p(W?.error?.message||t("session.listUnavailable"))}catch{}try{const G=await Pe("/sessions/bots");if(C||G.body.ok!==!0)return;const W=Array.isArray(G.body.bots)?G.body.bots:[],de=W.flatMap(je=>{if(!je||typeof je!="object")return[];const $e=je.sessionId;return typeof $e=="string"?[$e]:[]}),Oe={};for(const je of W){if(!je||typeof je!="object")continue;const $e=je.sessionId,Ot=je.name;typeof $e=="string"&&typeof Ot=="string"&&Ot!==""&&(Oe[$e]=Ot)}if(de.length===0&&Array.isArray(G.body.sessionIds))for(const je of G.body.sessionIds)typeof je=="string"&&de.push(je);Oi(new Set(de)),zi(Oe)}catch{}})(),()=>{C=!0}},[]),E.useEffect(()=>{let C=!1,G=null,W=0,de=2e3,Oe,je;const $e=pt=>{let wt;try{wt=JSON.parse(String(pt.data))}catch{return null}return wt.ok===!0?wt:null},Ot=()=>{if(G?.close(),Oe=void 0,je=void 0,C||document.hidden||typeof EventSource>"u")return;const pt=new EventSource(`/dsh-bot/api/live?sessionId=${encodeURIComponent(a)}`);G=pt,pt.addEventListener("interaction-error",()=>{!C&&G===pt&<.current?.disconnected()}),pt.addEventListener("interactions",wt=>{if(C||G!==pt)return;const St=$e(wt);St?.sessionId===a&&(de=2e3,lt.current?.ingest(St))}),pt.addEventListener("canvas",wt=>{if(C||G!==pt)return;const St=$e(wt);!St||!Array.isArray(St.events)||St.events.length===0||(de=2e3,Nt(Ut=>Ut+1))}),pt.addEventListener("snapshot",wt=>{if(C||G!==pt)return;const St=$e(wt);St&&(de=2e3,St.desk!==void 0&&(Oe=St.desk),St.work!==void 0&&(je=St.work),Bi(St))}),pt.addEventListener("delta",wt=>{if(C||G!==pt)return;const St=$e(wt);if(!St)return;const Ut={ok:!0};St.desk!==void 0&&Oe!==void 0&&(Oe=Hs(Oe,St.desk),Ut.desk=Oe),St.work!==void 0&&je!==void 0&&(je=Hs(je,St.work),Ut.work=je),(Ut.desk!==void 0||Ut.work!==void 0)&&Bi(Ut)}),pt.addEventListener("error",()=>{C||G!==pt||(lt.current?.disconnected(),pt.close(),G===pt&&(G=null),W=window.setTimeout(Ot,de),de=Math.min(15e3,de*2))})},mt=()=>{window.clearTimeout(W),document.hidden?(G?.close(),G=null):(de=2e3,Ot())};return document.addEventListener("visibilitychange",mt),Ot(),()=>{C=!0,document.removeEventListener("visibilitychange",mt),window.clearTimeout(W),G?.close()}},[a]),E.useEffect(()=>{const C=()=>{at(!1),De(!1),ht(!1),gt(null),O(null),dt(""),jt(""),o(Hb())};return window.addEventListener("hashchange",C),()=>window.removeEventListener("hashchange",C)},[]),E.useEffect(()=>{let C=!1;return fv().then(W=>{C||(Ta.current=Mb({follow:_b({addressOf:de=>ya(de)}),page:qb({addressOf:de=>ya(de)}),cdc:Lb({cache:W}),range:zb(),checkpoint:W}))}),()=>{C=!0}},[]),E.useEffect(()=>{if(!a){K(""),A(null);return}M(Wd()),A(null);let C=!1,G=null;return(async()=>{const W=await fv();if(C)return;const de=Ta.current??Mb({follow:_b({addressOf:je=>ya(je)}),page:qb({addressOf:je=>ya(je)}),cdc:Lb({cache:W}),range:zb(),checkpoint:W});Ta.current=de;const Oe=de.open(a,{enhancement:"auto"});G=Oe,Oe.onBatch(je=>{C||kl.current!==a||(M($e=>{let Ot=$e;for(const mt of je.events)Ot=BO(Ot,mt);return Ot}),K(a))}),Oe.onEphemeral(je=>{C||kl.current!==a||M($e=>IO($e,je))}),Oe.onStatus(je=>{C||kl.current!==a||(A(je),(je.phase==="live"||je.phase==="stalled"||je.phase==="error")&&K(a))})})(),()=>{C=!0,G?.close()}},[a]),E.useEffect(()=>{!a||D!==a||!j.title||ni[a]||S(C=>{if(C[a]===j.title)return C;const G={...C,[a]:j.title};return sessionStorage.setItem("dsh-bot.titles",JSON.stringify(G)),G})},[a,D,j.title,ni]);const Ur=!!a&&qn.has(a),cn=Ur&&ir?Mi[a]??[]:[],jl=Ur&&ir?a:"";E.useEffect(()=>{if(!a||!ha(a)){ka("");return}let C=!1;const G=kE(a);return Ai(`/dsh-bot/api/work/ticket?id=${encodeURIComponent(G)}`).then(W=>{if(C||W.body.ok!==!0||!W.body.ticket||typeof W.body.ticket!="object")return;const de=W.body.ticket.owner_session_id;typeof de=="string"&&ka(de)}),()=>{C=!0}},[a]);const Ws=cn.some(C=>C.status==="started");E.useEffect(()=>{if(!Ws)return;const C=window.setInterval(()=>Dr(Date.now()),1e3);return()=>window.clearInterval(C)},[Ws]);function ct(C){const G=Vb(C);Object.keys(G).length!==0&&N(W=>{let de=!1;const Oe={...W};for(const[je,$e]of Object.entries(G))Oe[je]||(Oe[je]=$e,de=!0);return de?(sessionStorage.setItem("dsh-bot.previews",JSON.stringify(Oe)),Oe):W})}function Na(){window.clearTimeout(ln.current),ln.current=0;const C=[...$t.current];if($t.current.clear(),C.length!==0){if(C.length===1){const[G,W]=C[0]??[];G&&W&&th({sessionId:G,preview:W});return}th({previews:Object.fromEntries(C)})}}E.useEffect(()=>()=>{Na()},[]),E.useEffect(()=>{if(!a||D!==a)return;const C=VO(j.segments);!C||mi.current.get(a)===C||(mi.current.set(a,C),N(G=>{if(G[a]===C)return G;const W={...G,[a]:C};return sessionStorage.setItem("dsh-bot.previews",JSON.stringify(W)),W}),$t.current.set(a,C),window.clearTimeout(ln.current),ln.current=window.setTimeout(Na,400))},[a,D,j.segments]),E.useLayoutEffect(()=>{const C=wl.current;if(!C||!Me)return;const G=C.getBoundingClientRect(),W=Math.max(8,Math.min(Me.x,window.innerWidth-G.width-8)),de=Math.max(8,Math.min(Me.y,window.innerHeight-G.height-8));(W!==Me.x||de!==Me.y)&&Ve(Oe=>Oe&&{...Oe,x:W,y:de}),C.querySelector("button")?.focus()},[Me]),E.useEffect(()=>{if(!Me)return;const C=()=>Ve(null),G=de=>{const Oe=de.target;Oe instanceof Node&&wl.current?.contains(Oe)||C()},W=de=>{de.key==="Escape"&&C()};return document.addEventListener("pointerdown",G),document.addEventListener("keydown",W),document.addEventListener("scroll",C,!0),()=>{document.removeEventListener("pointerdown",G),document.removeEventListener("keydown",W),document.removeEventListener("scroll",C,!0)}},[Me]),E.useEffect(()=>{if(!Ee)return;const C=W=>{const de=W.target;de instanceof Node&&xl.current?.contains(de)||De(!1)},G=W=>{W.key==="Escape"&&De(!1)};return document.addEventListener("pointerdown",C),document.addEventListener("keydown",G),()=>{document.removeEventListener("pointerdown",C),document.removeEventListener("keydown",G)}},[Ee]),E.useEffect(()=>{at(!1)},[a]);const Hr=E.useMemo(()=>{const C=y.trim().toLowerCase();return u.filter(G=>ha(G.sessionId)||Ft.has(G.sessionId)||G.blank===!0&&!Fn.has(G.sessionId)?!1:C?[lr(G),G.cwd??"",T[G.sessionId]??""].join(" ").toLowerCase().includes(C):!0)},[u,y,x,T,Ft,ni,Fn]),ri=E.useMemo(()=>!a||!qn.has(a)?[]:u.flatMap(C=>!qn.has(C.sessionId)||C.sessionId===a||Ft.has(C.sessionId)||C.blank===!0&&!Fn.has(C.sessionId)||ha(C.sessionId)?[]:[{sessionId:C.sessionId,label:lr(C)}]),[u,qn,a,Ft,ni,x,Fn]),Xt=a&&qn.has(a)?l3(Te,ve):null,Tl=Xt?`${Xt.start}:${Xt.query}`:"",gi=Xt?u3(ri,Xt.query):[],Nl=Xt!=null&&P!==Tl,Cl=Math.min(ye,Math.max(gi.length-1,0));E.useEffect(()=>{be(0)},[Tl]),E.useEffect(()=>{J(C=>{let G=!1;const W=new Set(C);for(const de of C){const Oe=u.find(je=>je.sessionId===de);Oe&&Oe.blank!==!0&&(W.delete(de),G=!0)}return G?W:C})},[u]);function Aa(C){const G=Sl.current;return(C??[]).filter(W=>!G.has(W.sessionId))}function jn(C){Sl.current.add(C),$t.current.delete(C),mi.current.delete(C),c(G=>G.filter(W=>W.sessionId!==C)),hi(G=>{const W=new Set(G);return W.delete(C),W}),S(G=>Ib("dsh-bot.titles",G,C)),N(G=>Ib("dsh-bot.previews",G,C)),Oi(G=>{if(!G.has(C))return G;const W=new Set(G);return W.delete(C),W}),zi(G=>{if(!(C in G))return G;const W={...G};return delete W[C],W}),a===C&&Br("")}function Ra(C,G){C.preventDefault(),Ve({id:G,x:C.clientX,y:C.clientY})}function _a(C){return t(C==="fence"?"session.deleteFence":C==="stop"?"session.deleteStop":C==="idle"?"session.deleteIdle":C==="store"?"session.deleteStore":C==="canvas"?"session.deleteCanvas":C==="files"?"session.deleteFiles":C==="cache"?"session.deleteCache":C==="done"?"session.deleteDone":"session.deleteProgress")}function Al(C){return C.error==="running"?t("session.deleteBusy"):C.error==="session_unreadable"?t("session.deleteUnreadable"):C.error||t("session.deleteFailed")}async function Ui(C,G){if(G.phase==="error")return Ue({id:C,phase:"error",percent:G.percent,error:Al(G)}),!1;if(G.phase!=="done")return Ue({id:C,phase:G.phase,percent:G.percent,error:t("session.deleteFailed")}),!1;const W=G.deletedSessionIds?.length?G.deletedSessionIds:[C];Ue({id:C,phase:"cache",percent:94,error:""});try{await Dk(W)}catch{}for(const de of W)jn(de);return p(""),Ue(null),!0}async function Oa(C){if(Ae&&Ae.error===""&&Ae.id!==C)return!1;Ue({id:C,phase:"fence",percent:8,error:""});try{const G=await fetch(`/dsh-bot/api/sessions/${encodeURIComponent(C)}/delete`,{method:"POST",headers:{accept:"application/x-ndjson"}});if(!(G.headers.get("content-type")??"").includes("ndjson")){const Oe=await G.json().catch(()=>({}));return Ue({id:C,phase:"error",percent:8,error:Oe.message||Oe.error||t("session.deleteFailed")}),!1}const de=await uk(G,Oe=>{Oe.phase!=="done"&&Ue({id:C,phase:Oe.phase,percent:Oe.percent,error:Oe.phase==="error"?Al(Oe):""})});return de?Ui(C,de):za(C)}catch{return za(C)}}async function za(C){for(let G=0;G<40;G+=1){const W=await Pe(`/sessions/${encodeURIComponent(C)}/delete`),de=typeof W.body.phase=="string"?W.body.phase:"absent";if(de==="absent")break;const Oe={phase:de,percent:typeof W.body.percent=="number"?W.body.percent:8,...typeof W.body.error=="string"?{error:W.body.error}:{},...Array.isArray(W.body.deletedSessionIds)?{deletedSessionIds:W.body.deletedSessionIds.filter(je=>typeof je=="string")}:{}};if(de!=="done"&&de!=="error"){Ue({id:C,phase:de,percent:Oe.percent,error:""}),await new Promise(je=>setTimeout(je,400));continue}return Ui(C,Oe)}return Ue({id:C,phase:"error",percent:8,error:t("session.deleteFailed")}),!1}async function sr(C,G,W){Et(!1),W!==""&&(zi(je=>({...je,[C]:W})),Oi(je=>new Set([...je,C])),S(je=>{const $e={...je,[C]:W};return sessionStorage.setItem("dsh-bot.titles",JSON.stringify($e)),$e})),J(je=>new Set(je).add(C));const Oe=(await Pe("/sessions")).body.result;c(Aa(Oe?.value?.items)),Br(C),jt(G),nr(je=>je+1)}function eo(C,G){R(C),ze(G),window.requestAnimationFrame(()=>{const W=Lr.current;W&&(W.focus(),W.setSelectionRange(G,G))})}function Ma(C){if(!Xt)return;const G=o3(Te,ve,Xt.start,C.label,C.sessionId);eo(G.text,G.cursor)}function to(C="/"){De(!1),R(G=>{const W=G.replace(/\s+$/,"");return W===""?C==="/"?"/":`${C} `:`${W} ${C==="/"?"/":`${C} `}`}),window.requestAnimationFrame(()=>Lr.current?.focus())}async function Rl(C){const G=le?.status==="accepted"&&j.drafting,W=jl===a?cn:[];if(!a||!C||!V.ready||mv(G,W,qn.has(a)))return!1;Ea.current?.pin();const de=j.drafting;R(""),dt(""),Gn.current+=1;const Oe=Number.MAX_SAFE_INTEGER-Gn.current;M(Ot=>({...Ot,drafting:!0,segments:[...Ot.segments,{kind:"user",id:`optimistic:${Oe}`,text:C,time:Date.now(),seq:Oe,optimistic:!0}]}));const je=await Pe("/tasks",{method:"POST",headers:{"content-type":"application/json","idempotency-key":crypto.randomUUID()},body:JSON.stringify({sessionId:a,text:C})}),$e=je.body.task;if(O($e??null),je.status!==202){M(mt=>({...mt,drafting:de?mt.drafting:!1,segments:mt.segments.filter(pt=>!(pt.kind==="user"&&pt.optimistic&&pt.text===C))}));const Ot=je.body.execution;return dt(Ot?.reason||_u(String(je.body.error||""),t("composer.notSent"),t)),!1}return!0}async function no(){const C=Te.trim();if(!C||!Ii)return;const G=Ke,W=G.map(r_).join(`
|
|
70
|
+
`),de=W?`${C}
|
|
71
|
+
|
|
72
|
+
${W}`:C;Ie([]),ue(je=>je+1),await Rl(de)||Ie(G)}async function ac(C,G){const W=await Ai("/dsh-bot/api/work/supply",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:a,ticketId:C,text:G})});return W.status!==200||W.body.ok===!1?Qb(W.body,t("composer.supplyFailed")):""}async function _l(){if(!le||le.status!=="accepted")return;const G=(await Pe(`/tasks/${le.id}/cancel?sessionId=${encodeURIComponent(le.sessionId??"")}`,{method:"POST"})).body.task??le;O(G),G.status==="cancelled"&&M(W=>({...W,drafting:!1}))}const bn=le?.status==="accepted"&&j.drafting,qa=jl===a?cn:[],Da=Ae?.id===a,Hi=mv(bn,qa,Ur)||Da,Ii=!!a&&V.ready&&Te.trim()!==""&&!Hi;function La(C){if(!qn.has(C.sessionId))return null;const G=C.running===!0||C.sessionId===a&&(bn||j.drafting),W=C.sessionId===a&&jl===a?cn:(lc[C.sessionId]??[]).map(de=>({status:de}));return _E(W,G)}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(C=>!C),children:m.jsx(VE,{})}),m.jsx("button",{type:"button",className:"icon-btn","aria-label":t("new.title"),onClick:()=>Et(!0),children:m.jsx(bx,{})})]})]}),g?m.jsx("input",{className:"filter",value:y,placeholder:t("session.searchPlaceholder"),onChange:C=>v(C.target.value)}):null,h?m.jsx("p",{className:"note",children:h}):null,Mt?m.jsx("p",{className:"note ok",children:Mt}):null,m.jsxs("ul",{className:"sessions",children:[Hr.length===0?m.jsx("li",{className:"empty",children:y.trim()?t("session.noMatch"):t("session.none")}):null,Hr.map(C=>{const G=lr(C);return m.jsx("li",{onContextMenu:W=>Ra(W,C.sessionId),children:m.jsxs("button",{type:"button",className:C.sessionId===a?"session selected":"session",title:C.cwd||C.sessionId,onClick:()=>Br(C.sessionId),children:[m.jsxs("span",{className:qn.has(C.sessionId)?"mark bot-mark":"mark",children:[qn.has(C.sessionId)?"BOT":Array.from(G)[0],m.jsx(pv,{signal:La(C)})]}),m.jsxs("span",{className:"copy",children:[m.jsx("span",{className:"name",children:G}),m.jsx("span",{className:"preview",children:(C.sessionId===a?_d(cn,rr,t):"")||T[C.sessionId]||(C.running?t("session.running"):"")})]})]})},C.sessionId)})]}),ce?m.jsx(IE,{health:ke,usage:ge,execution:V,model:j.model}):null,m.jsxs("div",{className:"me-row",children:[m.jsxs("button",{type:"button",className:"me",onClick:()=>xe(C=>!C),children:[m.jsx("span",{className:"mark me-mark",children:t("local.mark")}),m.jsx("span",{children:ke?.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(QE,{ref:Ea,scrollKey:`${vt?"bot":"main"}:${a}`,busy:ii||Li,progress:Di,jumpInBody:vt,composerHidden:vt,composerLift:q,header:m.jsxs(m.Fragment,{children:[m.jsxs("header",{className:"chat-head",children:[vt?m.jsx("button",{type:"button",className:"bot-chat-back",onClick:()=>at(!1),children:t("nav.back")}):ha(a)?m.jsx("button",{type:"button",className:"back",onClick:yi,children:t("nav.back")}):m.jsx("button",{type:"button",className:"back",onClick:()=>{ht(!1),gt(null),o("")},children:t("nav.sessions")}),a&&qn.has(a)?m.jsxs("span",{className:"bot-badge",children:["BOT",m.jsx(pv,{signal:La({sessionId:a,running:u.find(C=>C.sessionId===a)?.running})})]}):null,m.jsx("h1",{children:vt?t("nav.botMessages"):Pt}),!vt&&_d(cn,rr,t)?m.jsx("span",{className:"work-chip",children:_d(cn,rr,t)}):null,a&&!vt?m.jsx("button",{type:"button",className:"files-open","aria-pressed":nt==="memory",onClick:()=>{if(nt==="memory"){ae(null);return}ht(!1),gt(null),ae("memory")},children:t("memory.open")}):null,a&&!vt?m.jsx("button",{type:"button",className:"files-open","aria-pressed":Ct,onClick:()=>{if(Ct){ht(!1),gt(null);return}ae(C=>C==="memory"?null:C),ht(!0)},children:t("files.open")}):null,m.jsx("a",{href:Js,children:t("nav.official")})]}),ha(a)&&!vt?m.jsxs("nav",{className:"work-crumb","aria-label":t("nav.where"),children:[m.jsx("button",{type:"button",onClick:yi,children:bl&&qi(bl)||t("nav.mainSession")}),m.jsx("span",{"aria-hidden":"true",children:"/"}),m.jsx("span",{children:t("nav.worker")})]}):null,a&&!vt?m.jsx("button",{type:"button",className:"basis",onClick:()=>{ht(!1),gt(null),ae("memory")},children:Ks||t("memory.open")}):null]}),rail:vt||ii?void 0:C=>m.jsx(y4,{root:C,marks:ar,busyId:j.drafting&&j.turn!=null?`turn:${j.turn}`:void 0}),composer:m.jsx(ZE,{onSubmit:()=>{no()},activity:a&&!ii?m.jsx(G4,{segments:j.segments,drafting:j.drafting,currentTurn:j.turn,tickets:cn,connectionPhase:ee?.phase,pendingApprovals:Be}):null,chips:m.jsx(m.Fragment,{children:Ke.length>0?m.jsx("div",{className:"canvas-chip-row",children:Ke.map(C=>m.jsxs("span",{className:"canvas-chip",children:[m.jsx("span",{className:"canvas-chip-text",children:C.label}),m.jsx("button",{type:"button","aria-label":t("canvas.removeMention"),onClick:()=>Ie(G=>G.filter(W=>!(W.canvasId===C.canvasId&&W.revision===C.revision&&W.path===C.path))),children:"×"})]},`${C.canvasId}:${C.revision}:${C.path}`))}):null}),mentions:m.jsx(m.Fragment,{children:Nl?m.jsx("div",{className:"mention-menu",role:"listbox","aria-label":t("composer.mention"),children:gi.length===0?m.jsx("p",{className:"mention-empty",children:t("composer.noBot")}):gi.map((C,G)=>m.jsxs("button",{type:"button",role:"option","aria-selected":G===Cl,className:G===Cl?"active":"",onMouseDown:W=>{W.preventDefault(),Ma(C)},children:[m.jsx("span",{className:"bot-badge",children:"BOT"}),m.jsx("span",{className:"mention-name",children:C.label})]},C.sessionId))}):null}),textareaRef:Lr,value:Te,placeholder:a?kh({segments:j.segments,drafting:j.drafting,currentTurn:j.turn,tickets:cn,pendingApprovals:Be,t})?.text===t("question.waiting")||kh({segments:j.segments,drafting:j.drafting,currentTurn:j.turn,tickets:cn,pendingApprovals:Be,t})?.text===t("approval.waiting")?t("question.waiting"):OE(cn,t)??(Ur&&bn?t("composer.interrupt"):qn.has(a)?t("composer.mentionHint"):t("composer.task")):t("composer.pick"),disabled:!a,onChange:(C,G)=>{R(C),ze(G)},onSelect:C=>ze(C),onKeyDown:C=>{if(!C.nativeEvent.isComposing){if(Nl&&gi.length>0){if(C.key==="ArrowDown"){C.preventDefault(),be(G=>(G+1)%gi.length);return}if(C.key==="ArrowUp"){C.preventDefault(),be(G=>(G-1+gi.length)%gi.length);return}if(C.key==="Enter"||C.key==="Tab"){C.preventDefault();const G=gi[Cl];G&&Ma(G);return}if(C.key==="Escape"){C.preventDefault(),he(Tl);return}}C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),no())}},toolsRef:xl,addDisabled:!a,addExpanded:Ee,onAdd:()=>De(C=>!C),addMenu:Ee?m.jsxs("div",{className:"plus-menu",role:"menu",children:[m.jsx("button",{type:"button",role:"menuitem",onClick:()=>to(),children:t("composer.command")}),m.jsx("button",{type:"button",role:"menuitem",onClick:()=>{De(!1),ht(!1),gt(null),ae("memory")},children:t("memory.open")}),m.jsx("button",{type:"button",role:"menuitem",onClick:()=>{De(!1),ae("permission")},children:t("permission.open")}),m.jsx("button",{type:"button",role:"menuitem",onClick:()=>{De(!1),ae("authorization")},children:t("auth.open")}),Q?m.jsx("button",{type:"button",role:"menuitem",onClick:()=>{De(!1),ae("cua")},children:t("cua.open")}):null,m.jsx("p",{className:"plus-note",children:t("composer.filesLater")})]}):null,permission:m.jsx(m.Fragment,{children:j.preset?m.jsx("button",{type:"button",className:"chip","aria-label":Eh(j.preset,t),title:Eh(j.preset,t),onClick:()=>ae("permission"),children:m.jsx(YE,{preset:j.preset})}):null}),model:j.model,showStop:bn,onStop:()=>{_l()},showSend:!Hi,sendDisabled:!Ii,stats:We||(V.ready?HE(j):_u(V.reason,V.reason,t))}),children:[a?null:m.jsx("p",{className:"empty-thread",children:t("nav.pick")}),a&&!ii&&!Li&&!vt&&pi.length===0&&cn.length===0?m.jsx("p",{className:"empty-thread",children:t("nav.empty")}):null,m.jsx(j_,{children:m.jsx(E_,{sessionId:!vt&&!ii&&a?a:"",pulse:wn,tickets:cn,onActive:z,dismiss:te,onMention:C=>Ie(G=>[...G.filter(de=>!(de.canvasId===C.canvasId&&de.revision===C.revision&&de.path===C.path)),C].slice(-8)),children:ii?null:vt?m.jsx(f4,{items:El,botLabel:qi,onOpenFile:(C,G)=>{ae(W=>W==="memory"?null:W),gt({path:C,line:G,token:Date.now()}),ht(!0)}}):m.jsx(F3,{sessionId:a,cwd:u.find(C=>C.sessionId===a)?.cwd,connectionPhase:ee?.phase,segments:pi,approvals:Be,questionWaits:Kt,onCompose:C=>eo(C,C.length),completed:j.completed,failures:j.failures,retries:j.retries,turnEnds:j.turnEnds,tickets:cn,now:rr,canRetry:!!a&&V.ready&&!bn,onRetry:C=>{Rl(C)},onSupply:ac,onOpenSession:Ps,onOpenFile:(C,G)=>{ae(W=>W==="memory"?null:W),gt({path:C,line:G,token:Date.now()}),ht(!0)},onOpenInbox:()=>at(!0),botLabel:qi,chat:Ur})})},a)]}),nt==="permission"&&a?m.jsx(hO,{sessionId:a,current:j.preset,onClose:()=>ae(null),onChanged:()=>nr(C=>C+1)}):null,nt==="authorization"||_e&&nt==null?m.jsx(mO,{authorization:we,catalog:Le,onClose:()=>ae(null)}):null,nt==="cua"&&Q?m.jsx(pO,{onClose:()=>ae(null)}):null,a?m.jsx(D_,{open:Ct,sessionId:a,focus:bt,onClose:()=>{ht(!1),gt(null)}},a):null,a&&!vt?m.jsx(eO,{open:nt==="memory",sessionId:a,onClose:()=>ae(null)}):null,Ae?ml.createPortal(m.jsx("div",{className:"delete-modal",role:"dialog","aria-modal":"true","aria-labelledby":"delete-progress-title",children:m.jsxs("div",{className:"delete-card",children:[m.jsx("h2",{id:"delete-progress-title",children:t("session.deleteProgress")}),m.jsx("p",{children:Ae.error||_a(Ae.phase)}),m.jsx("div",{className:"delete-track",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Ae.percent,"aria-valuetext":_a(Ae.phase),children:m.jsx("div",{className:"delete-bar",style:{width:`${Math.max(0,Math.min(100,Ae.percent))}%`}})}),Ae.error?m.jsx("button",{type:"button",onClick:()=>{Oa(Ae.id)},children:t("session.deleteRetry")}):null]})}),document.body):null,Me?m.jsx("div",{ref:wl,className:"session-menu",role:"menu","aria-label":t("session.menu"),style:{left:Me.x,top:Me.y},onContextMenu:C=>C.preventDefault(),children:m.jsx("button",{type:"button",role:"menuitem",onClick:()=>{const C=Me.id;Ve(null),Oa(C)},children:t("session.delete")})}):null,me?m.jsx(n4,{onClose:()=>Et(!1),onCreated:(C,G,W)=>{sr(C,G,W)}}):null]})}const k1=document.querySelector("#root");if(!k1)throw new Error("missing root");sk.createRoot(k1).render(m.jsx(E.StrictMode,{children:m.jsx(bE,{children:m.jsx(nz,{})})}));export{iz as W,ej as _,m as j,rz as m,E as r,Ze as u};
|