@thready-web/dsh-bot-plugin 0.1.0-beta.13 → 0.1.0-beta.14
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/README.md +7 -1
- package/dist/desk.js +10 -1
- package/dist/http.js +29 -1
- package/dist/index.js +44 -3
- package/dist/permission-default.js +167 -0
- package/dist/permissions.js +18 -0
- package/dist/work-child.js +5 -4
- package/dist/worker-permission.js +75 -0
- package/package.json +1 -1
- package/public/assets/{SourceEditor-BjtoMvcX.js → SourceEditor-D5hkHEda.js} +3 -3
- package/public/assets/{cssMode--96PQtWh.js → cssMode-BnFhgVEg.js} +1 -1
- package/public/assets/{freemarker2-Bz-HlISL.js → freemarker2-CZnj0JQj.js} +1 -1
- package/public/assets/{handlebars-D9ScJ8AM.js → handlebars-DphCsr4u.js} +1 -1
- package/public/assets/{html-Czc0jojJ.js → html-OCowmZFv.js} +1 -1
- package/public/assets/{htmlMode-CCww5Z1w.js → htmlMode-CoLh_9Z9.js} +1 -1
- package/public/assets/{index-ztUdW074.js → index-FZCH-ncM.js} +41 -41
- package/public/assets/{javascript-B-yRZSiz.js → javascript-iZ7A5Jj8.js} +1 -1
- package/public/assets/{jsonMode-ASWsY833.js → jsonMode-Di_cLA3H.js} +1 -1
- package/public/assets/{liquid-BGoox2vJ.js → liquid-CiQRe5pn.js} +1 -1
- package/public/assets/{mdx-DHgvnl_U.js → mdx-DN_t25k0.js} +1 -1
- package/public/assets/{python-BJvVD30_.js → python-BjuxmwHR.js} +1 -1
- package/public/assets/{razor-0PwR35mu.js → razor-8ivZBBa_.js} +1 -1
- package/public/assets/{tsMode-3ETp8Gdh.js → tsMode-Bd30jXnV.js} +1 -1
- package/public/assets/{typescript-BT0iTK6K.js → typescript-yjXIK0i2.js} +1 -1
- package/public/assets/{xml-BTaNc_uT.js → xml-SwYrmBdL.js} +1 -1
- package/public/assets/{yaml-Dr7LW3tK.js → yaml-B5ynY56t.js} +1 -1
- package/public/index.html +1 -1
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SourceEditor-
|
|
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 $b(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kd={exports:{}},Ss={};var tv;function ek(){if(tv)return Ss;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 Ss.Fragment=i,Ss.jsx=r,Ss.jsxs=r,Ss}var nv;function tk(){return nv||(nv=1,kd.exports=ek()),kd.exports}var m=tk(),Ed={exports:{}},Fe={};var iv;function nk(){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(){}},C=Object.assign,k={};function M(z,ee,ue){this.props=z,this.context=ee,this.refs=k,this.updater=ue||T}M.prototype.isReactComponent={},M.prototype.setState=function(z,ee){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,ee,"setState")},M.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function L(){}L.prototype=M.prototype;function P(z,ee,ue){this.props=z,this.context=ee,this.refs=k,this.updater=ue||T}var ie=P.prototype=new L;ie.constructor=P,C(ie,M.prototype),ie.isPureReactComponent=!0;var A=Array.isArray;function F(){}var X={H:null,A:null,T:null,S:null},le=Object.prototype.hasOwnProperty;function O(z,ee,ue){var ve=ue.ref;return{$$typeof:t,type:z,key:ee,ref:ve!==void 0?ve:null,props:ue}}function V(z,ee){return O(z.type,ee,z.props)}function W(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function ke(z){var ee={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(ue){return ee[ue]})}var oe=/\/+/g;function ge(z,ee){return typeof z=="object"&&z!==null&&z.key!=null?ke(""+z.key):ee.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(F,F):(z.status="pending",z.then(function(ee){z.status==="pending"&&(z.status="fulfilled",z.value=ee)},function(ee){z.status==="pending"&&(z.status="rejected",z.reason=ee)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function ce(z,ee,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),ee,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,ee,ue,"",function(et){return et})):ze!=null&&(W(ze)&&(ze=V(ze,ue+(ze.key==null||z&&z.key===ze.key?"":(""+ze.key).replace(oe,"$&/")+"/")+be)),ee.push(ze)),1;be=0;var K=ve===""?".":ve+":";if(A(z))for(var de=0;de<z.length;de++)ve=z[de],ye=K+ge(ve,de),be+=ce(ve,ee,ue,ye,ze);else if(de=S(z),typeof de=="function")for(z=de.call(z),de=0;!(ve=z.next()).done;)ve=ve.value,ye=K+ge(ve,de++),be+=ce(ve,ee,ue,ye,ze);else if(ye==="object"){if(typeof z.then=="function")return ce(re(z),ee,ue,ve,ze);throw ee=String(z),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.")}return be}function xe(z,ee,ue){if(z==null)return z;var ve=[],ze=0;return ce(z,ve,"","",function(ye){return ee.call(ue,ye,ze++)}),ve}function Te(z){if(z._status===-1){var ee=z._result,ue=ee();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 ee=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(ee))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)};function Ze(z){var ee=X.T,ue={};ue.types=ee!==null?ee.types:null,X.T=ue;try{var ve=z(),ze=X.S;ze!==null&&ze(ue,ve),typeof ve=="object"&&ve!==null&&typeof ve.then=="function"&&ve.then(F,R)}catch(ye){R(ye)}finally{ee!==null&&ue.types!==null&&(ee.types=ue.types),X.T=ee}}function Ie(z){var ee=X.T;if(ee!==null){var ue=ee.types;ue===null?ee.types=[z]:ue.indexOf(z)===-1&&ue.push(z)}else Ze(Ie.bind(null,z))}var q={map:xe,forEach:function(z,ee,ue){xe(z,function(){ee.apply(this,arguments)},ue)},count:function(z){var ee=0;return xe(z,function(){ee++}),ee},toArray:function(z){return xe(z,function(ee){return ee})||[]},only:function(z){if(!W(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=P,Fe.StrictMode=a,Fe.Suspense=p,Fe.ViewTransition=w,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(z){return X.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,ee,ue){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var ve=C({},z.props),ze=z.key;if(ee!=null)for(ye in ee.key!==void 0&&(ze=""+ee.key),ee)!le.call(ee,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&ee.ref===void 0||(ve[ye]=ee[ye]);var ye=arguments.length-2;if(ye===1)ve.children=ue;else if(1<ye){for(var be=Array(ye),K=0;K<ye;K++)be[K]=arguments[K+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,ee,ue){var ve,ze={},ye=null;if(ee!=null)for(ve in ee.key!==void 0&&(ye=""+ee.key),ee)le.call(ee,ve)&&ve!=="key"&&ve!=="__self"&&ve!=="__source"&&(ze[ve]=ee[ve]);var be=arguments.length-2;if(be===1)ze.children=ue;else if(1<be){for(var K=Array(be),de=0;de<be;de++)K[de]=arguments[de+2];ze.children=K}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=W,Fe.lazy=function(z){return{$$typeof:v,_payload:{_status:-1,_result:z},_init:Te}},Fe.memo=function(z,ee){return{$$typeof:y,type:z,compare:ee===void 0?null:ee}},Fe.startTransition=Ze,Fe.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},Fe.use=function(z){return X.H.use(z)},Fe.useActionState=function(z,ee,ue){return X.H.useActionState(z,ee,ue)},Fe.useCallback=function(z,ee){return X.H.useCallback(z,ee)},Fe.useContext=function(z){return X.H.useContext(z)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(z,ee){return X.H.useDeferredValue(z,ee)},Fe.useEffect=function(z,ee){return X.H.useEffect(z,ee)},Fe.useEffectEvent=function(z){return X.H.useEffectEvent(z)},Fe.useId=function(){return X.H.useId()},Fe.useImperativeHandle=function(z,ee,ue){return X.H.useImperativeHandle(z,ee,ue)},Fe.useInsertionEffect=function(z,ee){return X.H.useInsertionEffect(z,ee)},Fe.useLayoutEffect=function(z,ee){return X.H.useLayoutEffect(z,ee)},Fe.useMemo=function(z,ee){return X.H.useMemo(z,ee)},Fe.useOptimistic=function(z,ee){return X.H.useOptimistic(z,ee)},Fe.useReducer=function(z,ee,ue){return X.H.useReducer(z,ee,ue)},Fe.useRef=function(z){return X.H.useRef(z)},Fe.useState=function(z){return X.H.useState(z)},Fe.useSyncExternalStore=function(z,ee,ue){return X.H.useSyncExternalStore(z,ee,ue)},Fe.useTransition=function(){return X.H.useTransition()},Fe.version="19.3.1",Fe}var rv;function Th(){return rv||(rv=1,Ed.exports=nk()),Ed.exports}var j=Th();const tz=$b(j);var jd={exports:{}},ks={},Td={exports:{}},Nd={};var lv;function ik(){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,Ze=R>>>1;Te<Ze;){var Ie=2*(Te+1)-1,q=re[Ie],z=Ie+1,ee=re[z];if(0>o(q,xe))z<R&&0>o(ee,q)?(re[Te]=ee,re[z]=xe,Te=z):(re[Te]=q,re[Ie]=xe,Te=Ie);else if(z<R&&0>o(ee,xe))re[Te]=ee,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,C=!1,k=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function P(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 ie(re){if(T=!1,P(re),!S)if(r(p)!==null)S=!0,A||(A=!0,W());else{var ce=r(y);ce!==null&&ge(ie,ce.startTime-re)}}var A=!1,F=-1,X=5,le=-1;function O(){return C?!0:!(t.unstable_now()-le<X)}function V(){if(C=!1,A){var re=t.unstable_now();le=re;var ce=!0;try{e:{S=!1,T&&(T=!1,M(F),F=-1),x=!0;var xe=w;try{t:{for(P(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,P(re),ce=!0;break t}g===r(p)&&a(p),P(re)}else a(p);g=r(p)}if(g!==null)ce=!0;else{var Ze=r(y);Ze!==null&&ge(ie,Ze.startTime-re),ce=!1}}break e}finally{g=null,w=xe,x=!1}ce=void 0}}finally{ce?W():A=!1}}}var W;if(typeof L=="function")W=function(){L(V)};else if(typeof MessageChannel<"u"){var ke=new MessageChannel,oe=ke.port2;ke.port1.onmessage=V,W=function(){oe.postMessage(null)}}else W=function(){k(V,0)};function ge(re,ce){F=k(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"):X=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(){C=!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(F),F=-1):T=!0,ge(ie,xe-Te))):(re.sortIndex=R,i(p,re),S||x||(S=!0,A||(A=!0,W()))),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 rk(){return av||(av=1,Td.exports=ik()),Td.exports}var Cd={exports:{}},mn={};var sv;function lk(){if(sv)return mn;sv=1;var t=Th();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 mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,mn.browser=function(v){return{$$typeof:u,_reason:v}},mn.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)},mn.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()}},mn.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))},mn.prefetchDNS=function(v){typeof v=="string"&&a.d.D(v)},mn.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})}},mn.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)},mn.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})}},mn.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)},mn.requestFormReset=function(v){a.d.r(v)},mn.unstable_batchedUpdates=function(v,g){return v(g)},mn.useFormState=function(v,g,w){return p.H.useFormState(v,g,w)},mn.useFormStatus=function(){return p.H.useHostTransitionStatus()},mn.version="19.3.1",mn}var ov;function Xb(){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=lk(),Cd.exports}var uv;function ak(){if(uv)return ks;uv=1;var t=rk(),i=Th(),r=Xb();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,E=f.child;E;){if(E===l){b=!0,l=f,s=d;break}if(E===s){b=!0,s=f,l=d;break}E=E.sibling}if(!b){for(E=d.child;E;){if(E===l){b=!0,l=d,s=f;break}if(E===s){b=!0,s=d,l=f;break}E=E.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 C(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var k=null,M=null;function L(e,n,l){return e===l?!0:e===n?(k=e,!0):!1}function P(e,n,l){return e===l?(M=e,!1):e===n?(M!==null&&(k=e),!0):!1}function ie(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function 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 F=Object.assign,X=Symbol.for("react.element"),le=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),W=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"),Ze=Symbol.for("react.activity"),Ie=Symbol.for("react.legacy_hidden"),q=Symbol.for("react.memo_cache_sentinel"),z=Symbol.for("react.view_transition"),ee=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 W:return"StrictMode";case ce:return"Suspense";case xe:return"SuspenseList";case Ze: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,K=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,et={pending:!1,data:null,method:null,action:null},mt=[],Ee=-1;function De(e){return{current:e}}function Me(e){0>Ee||(e.current=mt[Ee],mt[Ee]=null,Ee--)}function Ve(e,n){Ee++,mt[Ee]=e.current,e.current=n}var Ae=De(null),Ue=De(null),rt=De(null),ae=De(null);function Be(e,n){switch(Ve(rt,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 ft(){Me(Ae),Me(Ue),Me(rt)}function Qt(e){var n=e.memoizedState;n!==null&&(ya._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),ya._currentValue=et)}var Q,se;function Oe(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(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SourceEditor-D5hkHEda.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 $b(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kd={exports:{}},Ss={};var nv;function ek(){if(nv)return Ss;nv=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 Ss.Fragment=i,Ss.jsx=r,Ss.jsxs=r,Ss}var iv;function tk(){return iv||(iv=1,kd.exports=ek()),kd.exports}var m=tk(),Ed={exports:{}},Fe={};var rv;function nk(){if(rv)return Fe;rv=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 q(z,ee,ue){this.props=z,this.context=ee,this.refs=j,this.updater=ue||T}q.prototype.isReactComponent={},q.prototype.setState=function(z,ee){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,ee,"setState")},q.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function B(){}B.prototype=q.prototype;function P(z,ee,ue){this.props=z,this.context=ee,this.refs=j,this.updater=ue||T}var ie=P.prototype=new B;ie.constructor=P,N(ie,q.prototype),ie.isPureReactComponent=!0;var A=Array.isArray;function L(){}var G={H:null,A:null,T:null,S:null},le=Object.prototype.hasOwnProperty;function O(z,ee,ue){var ve=ue.ref;return{$$typeof:t,type:z,key:ee,ref:ve!==void 0?ve:null,props:ue}}function Y(z,ee){return O(z.type,ee,z.props)}function W(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function ke(z){var ee={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(ue){return ee[ue]})}var oe=/\/+/g;function ge(z,ee){return typeof z=="object"&&z!==null&&z.key!=null?ke(""+z.key):ee.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(L,L):(z.status="pending",z.then(function(ee){z.status==="pending"&&(z.status="fulfilled",z.value=ee)},function(ee){z.status==="pending"&&(z.status="rejected",z.reason=ee)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function ce(z,ee,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),ee,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,ee,ue,"",function(tt){return tt})):ze!=null&&(W(ze)&&(ze=Y(ze,ue+(ze.key==null||z&&z.key===ze.key?"":(""+ze.key).replace(oe,"$&/")+"/")+be)),ee.push(ze)),1;be=0;var K=ve===""?".":ve+":";if(A(z))for(var de=0;de<z.length;de++)ve=z[de],ye=K+ge(ve,de),be+=ce(ve,ee,ue,ye,ze);else if(de=S(z),typeof de=="function")for(z=de.call(z),de=0;!(ve=z.next()).done;)ve=ve.value,ye=K+ge(ve,de++),be+=ce(ve,ee,ue,ye,ze);else if(ye==="object"){if(typeof z.then=="function")return ce(re(z),ee,ue,ve,ze);throw ee=String(z),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.")}return be}function xe(z,ee,ue){if(z==null)return z;var ve=[],ze=0;return ce(z,ve,"","",function(ye){return ee.call(ue,ye,ze++)}),ve}function Te(z){if(z._status===-1){var ee=z._result,ue=ee();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 ee=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(ee))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)};function Ze(z){var ee=G.T,ue={};ue.types=ee!==null?ee.types:null,G.T=ue;try{var ve=z(),ze=G.S;ze!==null&&ze(ue,ve),typeof ve=="object"&&ve!==null&&typeof ve.then=="function"&&ve.then(L,R)}catch(ye){R(ye)}finally{ee!==null&&ue.types!==null&&(ee.types=ue.types),G.T=ee}}function Ie(z){var ee=G.T;if(ee!==null){var ue=ee.types;ue===null?ee.types=[z]:ue.indexOf(z)===-1&&ue.push(z)}else Ze(Ie.bind(null,z))}var M={map:xe,forEach:function(z,ee,ue){xe(z,function(){ee.apply(this,arguments)},ue)},count:function(z){var ee=0;return xe(z,function(){ee++}),ee},toArray:function(z){return xe(z,function(ee){return ee})||[]},only:function(z){if(!W(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return Fe.Activity=g,Fe.Children=M,Fe.Component=q,Fe.Fragment=r,Fe.Profiler=o,Fe.PureComponent=P,Fe.StrictMode=a,Fe.Suspense=p,Fe.ViewTransition=w,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(z){return G.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,ee,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(ee!=null)for(ye in ee.key!==void 0&&(ze=""+ee.key),ee)!le.call(ee,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&ee.ref===void 0||(ve[ye]=ee[ye]);var ye=arguments.length-2;if(ye===1)ve.children=ue;else if(1<ye){for(var be=Array(ye),K=0;K<ye;K++)be[K]=arguments[K+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,ee,ue){var ve,ze={},ye=null;if(ee!=null)for(ve in ee.key!==void 0&&(ye=""+ee.key),ee)le.call(ee,ve)&&ve!=="key"&&ve!=="__self"&&ve!=="__source"&&(ze[ve]=ee[ve]);var be=arguments.length-2;if(be===1)ze.children=ue;else if(1<be){for(var K=Array(be),de=0;de<be;de++)K[de]=arguments[de+2];ze.children=K}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=W,Fe.lazy=function(z){return{$$typeof:v,_payload:{_status:-1,_result:z},_init:Te}},Fe.memo=function(z,ee){return{$$typeof:y,type:z,compare:ee===void 0?null:ee}},Fe.startTransition=Ze,Fe.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},Fe.use=function(z){return G.H.use(z)},Fe.useActionState=function(z,ee,ue){return G.H.useActionState(z,ee,ue)},Fe.useCallback=function(z,ee){return G.H.useCallback(z,ee)},Fe.useContext=function(z){return G.H.useContext(z)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(z,ee){return G.H.useDeferredValue(z,ee)},Fe.useEffect=function(z,ee){return G.H.useEffect(z,ee)},Fe.useEffectEvent=function(z){return G.H.useEffectEvent(z)},Fe.useId=function(){return G.H.useId()},Fe.useImperativeHandle=function(z,ee,ue){return G.H.useImperativeHandle(z,ee,ue)},Fe.useInsertionEffect=function(z,ee){return G.H.useInsertionEffect(z,ee)},Fe.useLayoutEffect=function(z,ee){return G.H.useLayoutEffect(z,ee)},Fe.useMemo=function(z,ee){return G.H.useMemo(z,ee)},Fe.useOptimistic=function(z,ee){return G.H.useOptimistic(z,ee)},Fe.useReducer=function(z,ee,ue){return G.H.useReducer(z,ee,ue)},Fe.useRef=function(z){return G.H.useRef(z)},Fe.useState=function(z){return G.H.useState(z)},Fe.useSyncExternalStore=function(z,ee,ue){return G.H.useSyncExternalStore(z,ee,ue)},Fe.useTransition=function(){return G.H.useTransition()},Fe.version="19.3.1",Fe}var lv;function Nh(){return lv||(lv=1,Ed.exports=nk()),Ed.exports}var E=Nh();const tz=$b(E);var jd={exports:{}},ks={},Td={exports:{}},Nd={};var av;function ik(){return av||(av=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,Ze=R>>>1;Te<Ze;){var Ie=2*(Te+1)-1,M=re[Ie],z=Ie+1,ee=re[z];if(0>o(M,xe))z<R&&0>o(ee,M)?(re[Te]=ee,re[z]=xe,Te=z):(re[Te]=M,re[Ie]=xe,Te=Ie);else if(z<R&&0>o(ee,xe))re[Te]=ee,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,q=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function P(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 ie(re){if(T=!1,P(re),!S)if(r(p)!==null)S=!0,A||(A=!0,W());else{var ce=r(y);ce!==null&&ge(ie,ce.startTime-re)}}var A=!1,L=-1,G=5,le=-1;function O(){return N?!0:!(t.unstable_now()-le<G)}function Y(){if(N=!1,A){var re=t.unstable_now();le=re;var ce=!0;try{e:{S=!1,T&&(T=!1,q(L),L=-1),x=!0;var xe=w;try{t:{for(P(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,P(re),ce=!0;break t}g===r(p)&&a(p),P(re)}else a(p);g=r(p)}if(g!==null)ce=!0;else{var Ze=r(y);Ze!==null&&ge(ie,Ze.startTime-re),ce=!1}}break e}finally{g=null,w=xe,x=!1}ce=void 0}}finally{ce?W():A=!1}}}var W;if(typeof B=="function")W=function(){B(Y)};else if(typeof MessageChannel<"u"){var ke=new MessageChannel,oe=ke.port2;ke.port1.onmessage=Y,W=function(){oe.postMessage(null)}}else W=function(){j(Y,0)};function ge(re,ce){L=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"):G=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?(q(L),L=-1):T=!0,ge(ie,xe-Te))):(re.sortIndex=R,i(p,re),S||x||(S=!0,A||(A=!0,W()))),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 sv;function rk(){return sv||(sv=1,Td.exports=ik()),Td.exports}var Cd={exports:{}},mn={};var ov;function lk(){if(ov)return mn;ov=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 mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,mn.browser=function(v){return{$$typeof:u,_reason:v}},mn.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)},mn.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()}},mn.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))},mn.prefetchDNS=function(v){typeof v=="string"&&a.d.D(v)},mn.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})}},mn.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)},mn.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})}},mn.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)},mn.requestFormReset=function(v){a.d.r(v)},mn.unstable_batchedUpdates=function(v,g){return v(g)},mn.useFormState=function(v,g,w){return p.H.useFormState(v,g,w)},mn.useFormStatus=function(){return p.H.useHostTransitionStatus()},mn.version="19.3.1",mn}var uv;function Xb(){if(uv)return Cd.exports;uv=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=lk(),Cd.exports}var cv;function ak(){if(cv)return ks;cv=1;var t=rk(),i=Nh(),r=Xb();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,q=null;function B(e,n,l){return e===l?!0:e===n?(j=e,!0):!1}function P(e,n,l){return e===l?(q=e,!1):e===n?(q!==null&&(j=e),!0):!1}function ie(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function 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 L=Object.assign,G=Symbol.for("react.element"),le=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),Y=Symbol.for("react.fragment"),W=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"),Ze=Symbol.for("react.activity"),Ie=Symbol.for("react.legacy_hidden"),M=Symbol.for("react.memo_cache_sentinel"),z=Symbol.for("react.view_transition"),ee=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 Y:return"Fragment";case ke:return"Profiler";case W:return"StrictMode";case ce:return"Suspense";case xe:return"SuspenseList";case Ze: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,K=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,tt={pending:!1,data:null,method:null,action:null},mt=[],Ee=-1;function De(e){return{current:e}}function Me(e){0>Ee||(e.current=mt[Ee],mt[Ee]=null,Ee--)}function Ve(e,n){Ee++,mt[Ee]=e.current,e.current=n}var Ae=De(null),Ue=De(null),rt=De(null),ae=De(null);function Be(e,n){switch(Ve(rt,n),Ve(Ue,e),Ve(Ae,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?fg(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=fg(n),e=dg(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Me(Ae),Ve(Ae,e)}function ft(){Me(Ae),Me(Ue),Me(rt)}function Qt(e){var n=e.memoizedState;n!==null&&(ya._currentValue=n.memoizedState,Ve(ae,e)),n=Ae.current;var l=dg(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),ya._currentValue=tt)}var Q,se;function Oe(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
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 ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(Se){var
|
|
5
|
-
`),
|
|
6
|
-
`);for(f=s=0;s<_.length&&!_[s].includes("DetermineComponentFrameRoot");)s++;for(;f<
|
|
7
|
-
`+_[s].replace(" at new "," at ");return e.displayName
|
|
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 ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(Se){var U=Se}Reflect.construct(e,[],ne)}else{try{ne.call()}catch(Se){U=Se}ne=!1;try{var $=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ne=!0,new e}finally{ne&&($!==void 0?Object.defineProperty(e.prototype,"props",$):delete e.prototype.props)}}}else{try{throw Error()}catch(Se){U=Se}(ne=e())&&typeof ne.catch=="function"&&ne.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:"")?Oe(l):""}function pe(e,n){switch(e.tag){case 26:case 27:case 5:return Oe(e.type);case 16:return Oe("Lazy");case 13:return e.child!==n&&n!==null?Oe("Suspense Fallback"):Oe("Suspense");case 19:return Oe("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 Oe("Activity");case 30:return Oe("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
8
|
Error generating stack: `+s.message+`
|
|
9
|
-
`+s.stack}}var Ke=Object.prototype.hasOwnProperty,st=t.unstable_scheduleCallback,bt=t.unstable_cancelCallback,vt=t.unstable_shouldYield,xn=t.unstable_requestPaint,Nt=t.unstable_now,Ct=t.unstable_getCurrentPriorityLevel,pt=t.unstable_ImmediatePriority,Ft=t.unstable_UserBlockingPriority,pi=t.unstable_NormalPriority,Vn=t.unstable_LowPriority,Z=t.unstable_IdlePriority,he=t.log,Et=t.unstable_setDisableYieldValue,yt=null,ot=null;function Mt(e){if(typeof he=="function"&&Et(e),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(yt,e)}catch{}}var jt=Math.clz32?Math.clz32:zn,jl=Math.log,tr=Math.LN2;function zn(e){return e>>>=0,e===0?32:31-(jl(e)/tr|0)|0}var zi=256,li=262144,Mi=4194304;function qi(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 Tl(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 E=s&134217727;return E!==0?(s=E&~d,s!==0?f=qi(s):(b&=E,b!==0?f=qi(b):l||(l=E&~e,l!==0&&(f=qi(l))))):(E=s&~d,E!==0?f=qi(E):b!==0?f=qi(b):l||(l=s&~e,l!==0&&(f=qi(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 nr(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function $s(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 ac(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 Xs(){var e=Mi;return Mi<<=1,(Mi&62914560)===0&&(Mi=4194304),e}function ir(e){for(var n=[],l=0;31>l;l++)n.push(e);return n}function Hr(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Nl(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 E=e.entanglements,_=e.expirationTimes,H=e.hiddenUpdates;for(l=b&~l;0<l;){var $=31-jt(l),ne=1<<$;E[$]=0,_[$]=-1;var B=H[$];if(B!==null)for(H[$]=null,$=0;$<B.length;$++){var G=B[$];G!==null&&(G.lane&=-536870913)}l&=~ne}s!==0&&Aa(e,s,0),d!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=d&~(b&~n))}function Aa(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 Qs(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 Ir(e,n){var l=n&-n;return l=(l&42)!==0?1:Ra(l),(l&(e.suspendedLanes|n))!==0?0:l}function Ra(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 Cl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Al(){var e=de.p;return e!==0?e:(e=window.event,e===void 0?32:Qg(e.type))}function _a(e,n){var l=de.p;try{return de.p=e,n()}finally{de.p=l}}var Yn=Math.random().toString(36).slice(2),Zt="__reactFiber$"+Yn,on="__reactProps$"+Yn,yi="__reactContainer$"+Yn,Rl="__reactEvents$"+Yn,Zs="__reactListeners$"+Yn,_l="__reactHandles$"+Yn,Vr="__reactResources$"+Yn,Di="__reactMarker$"+Yn,Yr="__reactLoad$"+Yn;function Li(e){delete e[Zt],delete e[on],delete e[Zs],delete e[_l]}function ai(e){var n;if(n=e[Zt])return n;for(var l=e.parentNode;l;){if(n=l[yi]||l[Zt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(e=Cg(e);e!==null;){if(l=e[Zt])return l;e=Cg(e)}return n}e=l,l=e.parentNode}return null}function Fn(e){if(e=e[Zt]||e[yi]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Bi(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function rr(e){var n=e[Vr];return n||(n=e[Vr]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Ut(e){e[Di]=!0}function Ks(e){e[Yr]=void 0}var Ol=new Set,Fr={};function Ui(e,n){lr(e,n),lr(e+"Capture",n)}function lr(e,n){for(Fr[e]=n,e=0;e<n.length;e++)Ol.add(n[e])}var sc=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]*$"),Gr={},Js={};function Ps(e){return Ke.call(Js,e)?!0:Ke.call(Gr,e)?!1:sc.test(e)?Js[e]=!0:(Gr[e]=!0,!1)}var dt=!1;function ar(){var e=dt;return dt=!1,e}function nn(e,n,l){if(Ps(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 sr(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 Gn(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 gn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Oa(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function sm(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 zl(e){if(!e._valueTracker){var n=Oa(e)?"checked":"value";e._valueTracker=sm(e,n,""+e[n])}}function Ws(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),s="";return e&&(s=Oa(e)?e.checked?"true":"false":e.value),e=s,e!==l?(n.setValue(e),!0):!1}var gi=/[\n"\\]/g;function vn(e){return e.replace(gi,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function $n(e,n,l,s,f,d,b,E){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=""+gn(n)):e.value!==""+gn(n)&&(e.value=""+gn(n)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),n!=null?b==="number"&&e.value==n?$r(e,gn(e.value)):$r(e,gn(n)):l!=null?$r(e,gn(l)):s!=null&&e.removeAttribute("value"),f==null&&d!=null&&(e.defaultChecked=!!d),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?e.name=""+gn(E):e.removeAttribute("name")}function za(e,n,l,s,f,d,b,E){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)){zl(e);return}l=l!=null?""+gn(l):"",n=n!=null?""+gn(n):l,E||n===e.value||(e.value=n),e.defaultValue=n}s=s??f,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=E?e.checked:!!s,e.defaultChecked=!!s,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),zl(e)}function $r(e,n){e.defaultValue!==""+n&&(e.defaultValue=""+n)}function vi(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=""+gn(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 eo(e,n,l){if(n!=null&&(n=""+gn(n),n!==e.value&&(e.value=n),l==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=l!=null?""+gn(l):""}function to(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=gn(n),e.defaultValue=l,s=e.textContent,s===l&&s!==""&&s!==null&&(e.value=s),zl(e)}function Hi(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var no=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||no.has(n)?n==="float"?e.cssFloat=l:e[n]=(""+l).trim():e[n]=l+"px"}function qa(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]="",dt=!0);for(var f in n)s=n[f],n.hasOwnProperty(f)&&l[f]!==s&&(Ma(e,f,s),dt=!0)}else for(var d in n)n.hasOwnProperty(d)&&Ma(e,d,n[d])}function Ml(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 oc=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"]]),io=/^[\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 Xr(e){return io.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xn(){}var ql=null;function Dl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var or=null,ur=null;function cr(e){var n=Fn(e);if(n&&(e=n.stateNode)){var l=e[on]||null;e:switch(e=n.stateNode,n.type){case"input":if($n(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="'+vn(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var s=l[n];if(s!==e&&s.form===e.form){var f=s[on]||null;if(!f)throw Error(a(90));$n(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&&Ws(s)}break e;case"textarea":eo(e,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&vi(e,!!l.multiple,n,!1)}}}var Da=!1;function ro(e,n,l){if(Da)return e(n,l);Da=!0;try{var s=e(n);return s}finally{if(Da=!1,(or!==null||ur!==null)&&(tu(),or&&(n=or,e=ur,ur=or=null,cr(n),e)))for(n=0;n<e.length;n++)cr(e[n])}}function fr(e,n){var l=e.stateNode;if(l===null)return null;var s=l[on]||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 Qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ll=!1;if(Qn)try{var N={};Object.defineProperty(N,"passive",{get:function(){Ll=!0}}),window.addEventListener("test",N,N),window.removeEventListener("test",N,N)}catch{Ll=!1}var I=null,J=null,me=null;function _e(){if(me)return me;var e,n=J,l=n.length,s,f="value"in I?I.value:I.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 me=f.slice(e,1<s?1-s:void 0)}function je(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 Je(){return!0}function Ot(){return!1}function Ge(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 E in e)e.hasOwnProperty(E)&&(l=e[E],this[E]=l?l(d):d[E]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Je:Ot,this.isPropagationStopped=Ot,this}return F(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=Je)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Je)},persist:function(){},isPersistent:Je}),n}var Pe={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},St=Ge(Pe),xt=F({},Pe,{view:0,detail:0}),Vt=Ge(xt),Zn,Qr,La,lo=F({},xt,{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!==La&&(La&&e.type==="mousemove"?(Zn=e.screenX-La.screenX,Qr=e.screenY-La.screenY):Qr=Zn=0,La=e),Zn)},movementY:function(e){return"movementY"in e?e.movementY:Qr}}),om=Ge(lo),T1=F({},lo,{dataTransfer:0}),N1=Ge(T1),C1=F({},xt,{relatedTarget:0}),uc=Ge(C1),A1=F({},Pe,{animationName:0,elapsedTime:0,pseudoElement:0}),R1=Ge(A1),_1=F({},Pe,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),O1=Ge(_1),z1=F({},Pe,{data:0}),um=Ge(z1),M1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},q1={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"},D1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function L1(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=D1[e])?!!n[e]:!1}function cc(){return L1}var B1=F({},xt,{key:function(e){if(e.key){var n=M1[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=je(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?q1[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"?je(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?je(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),U1=Ge(B1),H1=F({},lo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cm=Ge(H1),I1=F({},Pe,{submitter:0}),V1=Ge(I1),Y1=F({},xt,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cc}),F1=Ge(Y1),G1=F({},Pe,{propertyName:0,elapsedTime:0,pseudoElement:0}),$1=Ge(G1),X1=F({},lo,{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}),Q1=Ge(X1),Z1=F({},Pe,{newState:0,oldState:0,source:0}),K1=Ge(Z1),J1=[9,13,27,32],fc=Qn&&"CompositionEvent"in window,Ba=null;Qn&&"documentMode"in document&&(Ba=document.documentMode);var P1=Qn&&"TextEvent"in window&&!Ba,fm=Qn&&(!fc||Ba&&8<Ba&&11>=Ba),dm=" ",hm=!1;function mm(e,n){switch(e){case"keyup":return J1.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 Bl=!1;function W1(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 ew(e,n){if(Bl)return e==="compositionend"||!fc&&mm(e,n)?(e=_e(),me=J=I=null,Bl=!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 tw={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"?!!tw[e.type]:n==="textarea"}function gm(e,n,l,s){or?ur?ur.push(s):ur=[s]:or=s,n=su(n,"onChange"),0<n.length&&(l=new St("onChange","change",null,l,s),e.push({event:l,listeners:n}))}var Ua=null,Ha=null;function nw(e){rg(e,0)}function ao(e){var n=Bi(e);if(Ws(n))return e}function vm(e,n){if(e==="change")return n}var bm=!1;if(Qn){var dc;if(Qn){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(){Ua&&(Ua.detachEvent("onpropertychange",Sm),Ha=Ua=null)}function Sm(e){if(e.propertyName==="value"&&ao(Ha)){var n=[];gm(n,Ha,e,Dl(e)),ro(nw,n)}}function iw(e,n,l){e==="focusin"?(wm(),Ua=n,Ha=l,Ua.attachEvent("onpropertychange",Sm)):e==="focusout"&&wm()}function rw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ao(Ha)}function lw(e,n){if(e==="click")return ao(n)}function aw(e,n){if(e==="input"||e==="change")return ao(n)}function sw(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Mn=typeof Object.is=="function"?Object.is:sw;function Ia(e,n){if(Mn(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(!Ke.call(n,f)||!Mn(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 ow=Qn&&"documentMode"in document&&11>=document.documentMode,Ul=null,yc=null,Va=null,gc=!1;function Nm(e,n,l){var s=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;gc||Ul==null||Ul!==mc(s)||(s=Ul,"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}),Va&&Ia(Va,s)||(Va=s,s=su(yc,"onSelect"),0<s.length&&(n=new St("onSelect","select",null,n,l),e.push({event:n,listeners:s}),n.target=Ul)))}function Zr(e,n){var l={};return l[e.toLowerCase()]=n.toLowerCase(),l["Webkit"+e]="webkit"+n,l["Moz"+e]="moz"+n,l}var Hl={animationend:Zr("Animation","AnimationEnd"),animationiteration:Zr("Animation","AnimationIteration"),animationstart:Zr("Animation","AnimationStart"),transitionrun:Zr("Transition","TransitionRun"),transitionstart:Zr("Transition","TransitionStart"),transitioncancel:Zr("Transition","TransitionCancel"),transitionend:Zr("Transition","TransitionEnd")},vc={},Cm={};Qn&&(Cm=document.createElement("div").style,"AnimationEvent"in window||(delete Hl.animationend.animation,delete Hl.animationiteration.animation,delete Hl.animationstart.animation),"TransitionEvent"in window||delete Hl.transitionend.transition);function Kr(e){if(vc[e])return vc[e];if(!Hl[e])return e;var n=Hl[e],l;for(l in n)if(n.hasOwnProperty(l)&&l in Cm)return vc[e]=n[l];return e}var Am=Kr("animationend"),Rm=Kr("animationiteration"),_m=Kr("animationstart"),uw=Kr("transitionrun"),cw=Kr("transitionstart"),fw=Kr("transitioncancel"),Om=Kr("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 si(e,n){zm.set(e,n),Ui(n,[e])}var dw=0;function Ii(e,n){if(e.name!=null&&e.name!=="auto")return e.name;if(n.autoName!==null)return n.autoName;e=fi.identifierPrefix;var l=dw++;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=aa;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 Vi(e,n){return e=Mm(e),n=Mm(n),n==null?e==="auto"?null:e:n==="auto"?null:n}var so=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)},Kn=[],Il=0,xc=0;function oo(){for(var e=Il,n=xc=Il=0;n<e;){var l=Kn[n];Kn[n++]=null;var s=Kn[n];Kn[n++]=null;var f=Kn[n];Kn[n++]=null;var d=Kn[n];if(Kn[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 uo(e,n,l,s){Kn[Il++]=e,Kn[Il++]=n,Kn[Il++]=l,Kn[Il++]=s,xc|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function wc(e,n,l,s){return uo(e,n,l,s),co(e)}function Jr(e,n){return uo(e,null,null,n),co(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 co(e){if(50<cs)throw cs=0,eu=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Vl={};function hw(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 En(e,n,l,s){return new hw(e,n,l,s)}function Sc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Yi(e,n){var l=e.alternate;return l===null?(l=En(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 fo(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=IS(e,l,Ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(s){case Ze:return e=En(31,l,n,f),e.elementType=Ze,e.lanes=d,e;case V:return Pr(l.children,f,d,n);case W:b=8,f|=24;break;case ke:return e=En(12,l,n,f|2),e.elementType=ke,e.lanes=d,e;case ce:return e=En(13,l,n,f),e.elementType=ce,e.lanes=d,e;case xe:return e=En(19,l,n,f),e.elementType=xe,e.lanes=d,e;case Ie:case z:return e=f|32,e=En(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=En(b,l,n,f),n.elementType=e,n.type=s,n.lanes=d,n}function Pr(e,n,l,s){return e=En(7,e,s,n),e.lanes=l,e}function kc(e,n,l){return e=En(6,e,null,n),e.lanes=l,e}function Lm(e){var n=En(18,null,null,0);return n.stateNode=e,n}function Ec(e,n,l){return n=En(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 Jn(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 Yl=[],Fl=0,ho=null,Ya=0,Pn=[],Wn=0,dr=null,bi=1,xi="";function Fi(e,n){Yl[Fl++]=Ya,Yl[Fl++]=ho,ho=e,Ya=n}function Um(e,n,l){Pn[Wn++]=bi,Pn[Wn++]=xi,Pn[Wn++]=dr,dr=e;var s=bi;e=xi;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,bi=1<<32-jt(n)+f|l<<f|s,xi=d+e}else bi=1<<d|l<<f|s,xi=e}function mo(e){e.return!==null&&(Fi(e,1),Um(e,1,0))}function jc(e){for(;e===ho;)ho=Yl[--Fl],Yl[Fl]=null,Ya=Yl[--Fl],Yl[Fl]=null;for(;e===dr;)dr=Pn[--Wn],Pn[Wn]=null,xi=Pn[--Wn],Pn[Wn]=null,bi=Pn[--Wn],Pn[Wn]=null}function Hm(e,n){Pn[Wn++]=bi,Pn[Wn++]=xi,Pn[Wn++]=dr,bi=n.id,xi=n.overflow,dr=e}var ln=null,Ht=null,tt=!1,hr=null,ei=!1,Tc=Error(a(519));function mr(e){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fa(Jn(n,e)),Tc}function Im(e){var n=e.stateNode,l=e.type,s=e.memoizedProps;switch(n[Zt]=e,n[on]=s,l){case"dialog":at("cancel",n),at("close",n);break;case"iframe":case"object":case"embed":at("load",n);break;case"video":case"audio":for(l=0;l<ds.length;l++)at(ds[l],n);break;case"source":at("error",n);break;case"img":case"image":case"link":at("error",n),at("load",n);break;case"details":at("toggle",n);break;case"input":at("invalid",n),za(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":at("invalid",n);break;case"textarea":at("invalid",n),to(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&&(at("beforetoggle",n),at("toggle",n)),s.onScroll!=null&&at("scroll",n),s.onScrollEnd!=null&&at("scrollend",n),s.onClick!=null&&(n.onclick=Xn),n=!0):n=!1,n||mr(e,!0)}function po(e){for(ln=e.return;ln;)switch(ln.tag){case 5:case 31:case 13:ei=!1;return;case 27:case 3:ei=!0;return;default:ln=ln.return}}function Gl(e){if(e!==ln)return!1;if(!tt)return po(e),tt=!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&&mr(e),po(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,Rr(e.type)?(e=dd,dd=null,Ht=e):Ht=n):Ht=ln?ni(e.stateNode.nextSibling):null;return!0}function Wr(){Ht=ln=null,tt=!1}function Nc(){var e=hr;return e!==null&&(Nn===null?Nn=e:Nn.push.apply(Nn,e),hr=null),e}function Fa(e){hr===null?hr=[e]:hr.push(e)}var Cc=De(null),el=null,Gi=null;function pr(e,n,l){Ve(Cc,n._currentValue),n._currentValue=l}function $i(e){e._currentValue=Cc.current,Me(Cc)}function yo(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 E=d;d=f;for(var _=0;_<n.length;_++)if(E.context===n[_]){d.lanes|=l,E=d.alternate,E!==null&&(E.lanes|=l),yo(d.return,l,e),s||(b=null);break e}d=E.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),yo(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),yo(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 tl(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 E=f.type;Mn(f.pendingProps.value,b.value)||(e!==null?e.push(E):e=[E])}}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(ya):e=[ya])}f=f.return}return e!==null&&Ac(n,e,l,s),n.flags|=262144,e!==null}function go(e){for(e=e.firstContext;e!==null;){if(!Mn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function nl(e){el=e,Gi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function un(e){return Vm(el,e)}function vo(e,n){return el===null&&nl(e),Vm(e,n)}function Vm(e,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Gi===null){if(e===null)throw Error(a(308));Gi=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Gi=Gi.next=n;return l}var mw=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()})}},pw=t.unstable_scheduleCallback,yw=t.unstable_NormalPriority,Jt={$$typeof:ge,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rc(){return{controller:new mw,data:new Map,refCount:0}}function Ga(e){e.refCount--,e.refCount===0&&pw(yw,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 $a=null;function gw(e){var n=e.transitionTypes;return e.transitionTypes=null,n}var Xa=null,_c=0,il=0,$l=null;function vw(e,n){if(Xa===null){var l=Xa=[];_c=0,il=Qf(),$l={status:"pending",value:void 0,then:function(s){l.push(s)}}}return _c++,n.then(Fm,Fm),n}function Fm(){if(--_c===0&&($a=null,Xa!==null)){$l!==null&&($l.status="fulfilled");var e=Xa;Xa=null,il=0,$l=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function bw(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=K.S;K.S=function(e,n){if(Ly=Nt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&vw(e,n),$a!==null)for(var l=ca;l!==null;)Ym(l,$a),l=l.next;if(l=e.types,l!==null){for(var s=ca;s!==null;)Ym(s,l),s=s.next;if(il!==0){s=$a,s===null&&(s=$a=[]);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 rl=De(null);function Oc(){var e=rl.current;return e!==null?e:qt.pooledCache}function bo(e,n){n===null?Ve(rl,rl.current):Ve(rl,n.pool)}function $m(){var e=Oc();return e===null?null:{parent:Jt._currentValue,pool:e}}var Xl=Error(a(460)),zc=Error(a(474)),xo=Error(a(542)),wo={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(Xn,Xn),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(Xn,Xn);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 al=n,Xl}}function ll(e){try{var n=e._init;return n(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(al=l,Xl):l}}var al=null;function Zm(){if(al===null)throw Error(a(459));var e=al;return al=null,e}function Km(e){if(e===Xl||e===xo)throw Error(a(483))}var Ql=null,Qa=0;function So(e){var n=Qa;return Qa+=1,Ql===null&&(Ql=[]),Qm(Ql,e,n)}function yr(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function ko(e,n){throw n.$$typeof===X?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(U,D){if(e){var Y=U.deletions;Y===null?(U.deletions=[D],U.flags|=16):Y.push(D)}}function l(U,D){if(!e)return null;for(;D!==null;)n(U,D),D=D.sibling;return null}function s(U){for(var D=new Map;U!==null;)U.key===null?D.set(U.index,U):D.set(U.key,U),U=U.sibling;return D}function f(U,D){return U=Yi(U,D),U.index=0,U.sibling=null,U}function d(U,D,Y){return U.index=Y,e?(Y=U.alternate,Y!==null?(Y=Y.index,Y<D?(U.flags|=2,D):Y):(U.flags|=134217730,D)):(U.flags|=1048576,D)}function b(U){return e&&U.alternate===null&&(U.flags|=134217730),U}function E(U,D,Y,te){return D===null||D.tag!==6?(D=kc(Y,U.mode,te),D.return=U,D):(D=f(D,Y),D.return=U,D)}function _(U,D,Y,te){var Ce=Y.type;return Ce===V?(U=$(U,D,Y.props.children,te,Y.key),yr(U,Y),U):D!==null&&(D.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===R&&ll(Ce)===D.type)?(D=f(D,Y.props),yr(D,Y),D.return=U,D):(D=fo(Y.type,Y.key,Y.props,null,U.mode,te),yr(D,Y),D.return=U,D)}function H(U,D,Y,te){return D===null||D.tag!==4||D.stateNode.containerInfo!==Y.containerInfo||D.stateNode.implementation!==Y.implementation?(D=Ec(Y,U.mode,te),D.return=U,D):(D=f(D,Y.children||[]),D.return=U,D)}function $(U,D,Y,te,Ce){return D===null||D.tag!==7?(D=Pr(Y,U.mode,te,Ce),D.return=U,D):(D=f(D,Y),D.return=U,D)}function ne(U,D,Y){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=kc(""+D,U.mode,Y),D.return=U,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case le:return Y=fo(D.type,D.key,D.props,null,U.mode,Y),yr(Y,D),Y.return=U,Y;case O:return D=Ec(D,U.mode,Y),D.return=U,D;case R:return D=ll(D),ne(U,D,Y)}if(be(D)||ve(D))return D=Pr(D,U.mode,Y,null),D.return=U,D;if(typeof D.then=="function")return ne(U,So(D),Y);if(D.$$typeof===ge)return ne(U,vo(U,D),Y);ko(U,D)}return null}function B(U,D,Y,te){var Ce=D!==null?D.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Ce!==null?null:E(U,D,""+Y,te);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case le:return Y.key===Ce?_(U,D,Y,te):null;case O:return Y.key===Ce?H(U,D,Y,te):null;case R:return Y=ll(Y),B(U,D,Y,te)}if(be(Y)||ve(Y))return Ce!==null?null:$(U,D,Y,te,null);if(typeof Y.then=="function")return B(U,D,So(Y),te);if(Y.$$typeof===ge)return B(U,D,vo(U,Y),te);ko(U,Y)}return null}function G(U,D,Y,te,Ce){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return U=U.get(Y)||null,E(D,U,""+te,Ce);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case le:return U=U.get(te.key===null?Y:te.key)||null,_(D,U,te,Ce);case O:return U=U.get(te.key===null?Y:te.key)||null,H(D,U,te,Ce);case R:return te=ll(te),G(U,D,Y,te,Ce)}if(be(te)||ve(te))return U=U.get(Y)||null,$(D,U,te,Ce,null);if(typeof te.then=="function")return G(U,D,Y,So(te),Ce);if(te.$$typeof===ge)return G(U,D,Y,vo(D,te),Ce);ko(D,te)}return null}function Se(U,D,Y,te){for(var Ce=null,ct=null,qe=D,Ye=D=0,en=null;qe!==null&&Ye<Y.length;Ye++){qe.index>Ye?(en=qe,qe=null):en=qe.sibling;var gt=B(U,qe,Y[Ye],te);if(gt===null){qe===null&&(qe=en);break}e&&qe&>.alternate===null&&n(U,qe),D=d(gt,D,Ye),ct===null?Ce=gt:ct.sibling=gt,ct=gt,qe=en}if(Ye===Y.length)return l(U,qe),tt&&Fi(U,Ye),Ce;if(qe===null){for(;Ye<Y.length;Ye++)qe=ne(U,Y[Ye],te),qe!==null&&(D=d(qe,D,Ye),ct===null?Ce=qe:ct.sibling=qe,ct=qe);return tt&&Fi(U,Ye),Ce}for(qe=s(qe);Ye<Y.length;Ye++)en=G(qe,U,Ye,Y[Ye],te),en!==null&&(e&&(gt=en.alternate,gt!==null&&qe.delete(gt.key===null?Ye:gt.key)),D=d(en,D,Ye),ct===null?Ce=en:ct.sibling=en,ct=en);return e&&qe.forEach(function(qr){return n(U,qr)}),tt&&Fi(U,Ye),Ce}function Re(U,D,Y,te){if(Y==null)throw Error(a(151));for(var Ce=null,ct=null,qe=D,Ye=D=0,en=null,gt=Y.next();qe!==null&&!gt.done;Ye++,gt=Y.next()){qe.index>Ye?(en=qe,qe=null):en=qe.sibling;var qr=B(U,qe,gt.value,te);if(qr===null){qe===null&&(qe=en);break}e&&qe&&qr.alternate===null&&n(U,qe),D=d(qr,D,Ye),ct===null?Ce=qr:ct.sibling=qr,ct=qr,qe=en}if(gt.done)return l(U,qe),tt&&Fi(U,Ye),Ce;if(qe===null){for(;!gt.done;Ye++,gt=Y.next())gt=ne(U,gt.value,te),gt!==null&&(D=d(gt,D,Ye),ct===null?Ce=gt:ct.sibling=gt,ct=gt);return tt&&Fi(U,Ye),Ce}for(qe=s(qe);!gt.done;Ye++,gt=Y.next())gt=G(qe,U,Ye,gt.value,te),gt!==null&&(e&&(en=gt.alternate,en!==null&&qe.delete(en.key===null?Ye:en.key)),D=d(gt,D,Ye),ct===null?Ce=gt:ct.sibling=gt,ct=gt);return e&&qe.forEach(function(WS){return n(U,WS)}),tt&&Fi(U,Ye),Ce}function Qe(U,D,Y,te){if(typeof Y=="object"&&Y!==null&&Y.type===V&&Y.key===null&&Y.props.ref===void 0&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case le:e:{for(var Ce=Y.key;D!==null;){if(D.key===Ce){if(Ce=Y.type,Ce===V){if(D.tag===7){l(U,D.sibling),te=f(D,Y.props.children),yr(te,Y),te.return=U,U=te;break e}}else if(D.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===R&&ll(Ce)===D.type){l(U,D.sibling),te=f(D,Y.props),yr(te,Y),te.return=U,U=te;break e}l(U,D);break}else n(U,D);D=D.sibling}Y.type===V?(te=Pr(Y.props.children,U.mode,te,Y.key),yr(te,Y),te.return=U,U=te):(te=fo(Y.type,Y.key,Y.props,null,U.mode,te),yr(te,Y),te.return=U,U=te)}return b(U);case O:e:{for(Ce=Y.key;D!==null;){if(D.key===Ce)if(D.tag===4&&D.stateNode.containerInfo===Y.containerInfo&&D.stateNode.implementation===Y.implementation){l(U,D.sibling),te=f(D,Y.children||[]),te.return=U,U=te;break e}else{l(U,D);break}else n(U,D);D=D.sibling}te=Ec(Y,U.mode,te),te.return=U,U=te}return b(U);case R:return Y=ll(Y),Qe(U,D,Y,te)}if(be(Y))return Se(U,D,Y,te);if(ve(Y)){if(Ce=ve(Y),typeof Ce!="function")throw Error(a(150));return Y=Ce.call(Y),Re(U,D,Y,te)}if(typeof Y.then=="function")return Qe(U,D,So(Y),te);if(Y.$$typeof===ge)return Qe(U,D,vo(U,Y),te);ko(U,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,D!==null&&D.tag===6?(l(U,D.sibling),te=f(D,Y),te.return=U,U=te):(l(U,D),te=kc(Y,U.mode,te),te.return=U,U=te),b(U)):l(U,D)}return function(U,D,Y,te){try{Qa=0;var Ce=Qe(U,D,Y,te);return Ql=null,Ce}catch(qe){if(qe===Xl||qe===xo)throw qe;var ct=En(29,qe,null,U.mode);return ct.lanes=te,ct.return=U,ct}}}var sl=Jm(!0),Pm=Jm(!1),gr=!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 vr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function br(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=co(e),qm(e,null,l),n}return uo(e,s,n,l),co(e)}function Za(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,Qs(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 Ka(){if(Lc){var e=$l;if(e!==null)throw e}}function Ja(e,n,l,s){Lc=!1;var f=e.updateQueue;gr=!1;var d=f.firstBaseUpdate,b=f.lastBaseUpdate,E=f.shared.pending;if(E!==null){f.shared.pending=null;var _=E,H=_.next;_.next=null,b===null?d=H:b.next=H,b=_;var $=e.alternate;$!==null&&($=$.updateQueue,E=$.lastBaseUpdate,E!==b&&(E===null?$.firstBaseUpdate=H:E.next=H,$.lastBaseUpdate=_))}if(d!==null){var ne=f.baseState;b=0,$=H=_=null,E=d;do{var B=E.lane&-536870913,G=B!==E.lane;if(G?(ut&B)===B:(s&B)===B){B!==0&&B===il&&(Lc=!0),$!==null&&($=$.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var Se=e,Re=E;B=n;var Qe=l;switch(Re.tag){case 1:if(Se=Re.payload,typeof Se=="function"){ne=Se.call(Qe,ne,B);break e}ne=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Re.payload,B=typeof Se=="function"?Se.call(Qe,ne,B):Se,B==null)break e;ne=F({},ne,B);break e;case 2:gr=!0}}B=E.callback,B!==null&&(e.flags|=64,G&&(e.flags|=8192),G=f.callbacks,G===null?f.callbacks=[B]:G.push(B))}else G={lane:B,tag:E.tag,payload:E.payload,callback:E.callback,next:null},$===null?(H=$=G,_=ne):$=$.next=G,b|=B;if(E=E.next,E===null){if(E=f.shared.pending,E===null)break;G=E,E=G.next,G.next=null,f.lastBaseUpdate=G,f.shared.pending=null}}while(!0);$===null&&(_=ne),f.baseState=_,f.firstBaseUpdate=H,f.lastBaseUpdate=$,d===null&&(f.shared.lanes=0),Tr|=b,e.lanes=b,e.memoizedState=ne}}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 xr=De(null),Eo=De(0);function tp(e,n){e=Ji,Ve(Eo,e),Ve(xr,n),Ji=e|n.baseLanes}function Bc(){Ve(Eo,Ji),Ve(xr,xr.current)}function Uc(){Ji=Eo.current,Me(xr),Me(Eo)}var cn=De(null),bn=null;function wr(e){var n=e.alternate;Ve(fn,fn.current&1),Ve(cn,e),bn===null&&(n===null||xr.current!==null||n.memoizedState!==null)&&(bn=e)}function Hc(e){Ve(fn,fn.current),Ve(cn,e),bn===null&&(bn=e)}function np(e){e.tag===22?(Ve(fn,fn.current),Ve(cn,e),bn===null&&(bn=e)):Sr()}function Sr(){Ve(fn,fn.current),Ve(cn,cn.current)}function qn(e){Me(cn),bn===e&&(bn=null),Me(fn)}var fn=De(0);function Pa(e,n){Ve(cn,cn.current),Ve(fn,n)}function Ic(e){Me(fn),Me(cn),bn===e&&(bn=null)}function jo(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 Xi=0,Xe=null,zt=null,Pt=null,To=!1,Zl=!1,ol=!1,No=0,Wa=0,Kl=null,xw=0;function $t(){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(!Mn(e[l],n[l]))return!1;return!0}function Yc(e,n,l,s,f,d){return Xi=d,Xe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,K.H=e===null||e.memoizedState===null?Up:Hp,ol=!1,d=l(s,f),ol=!1,Zl&&(d=rp(n,l,s,f)),ip(e),d}function ip(e){K.H=Mo;var n=zt!==null&&zt.next!==null;if(Xi=0,Pt=zt=Xe=null,To=!1,Wa=0,Kl=null,n)throw Error(a(300));e===null||Wt||(e=e.dependencies,e!==null&&go(e)&&(Wt=!0))}function rp(e,n,l,s){Xe=e;var f=0;do{if(Zl&&(Kl=null),Wa=0,Zl=!1,25<=f)throw Error(a(301));if(f+=1,Pt=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)}K.H=Cw,d=n(l,s)}while(Zl);return d}function ww(){var e=K.H,n=e.useState()[0];return n=typeof n.then=="function"?es(n):n,e=e.useState()[0],(zt!==null?zt.memoizedState:null)!==e&&(Xe.flags|=1024),n}function Fc(){var e=No!==0;return No=0,e}function Gc(e,n,l){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l}function $c(e){if(To){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}To=!1}Xi=0,Pt=zt=Xe=null,Zl=!1,Wa=No=0,Kl=null}function wn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?Xe.memoizedState=Pt=e:Pt=Pt.next=e,Pt}function Kt(){if(zt===null){var e=Xe.alternate;e=e!==null?e.memoizedState:null}else e=zt.next;var n=Pt===null?Xe.memoizedState:Pt.next;if(n!==null)Pt=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},Pt===null?Xe.memoizedState=Pt=e:Pt=Pt.next=e}return Pt}function Co(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function es(e){var n=Wa;return Wa+=1,Kl===null&&(Kl=[]),e=Qm(Kl,e,n),n=Xe,(Pt===null?n.memoizedState:Pt.next)===null&&(n=n.alternate,K.H=n===null||n.memoizedState===null?Up:Hp),e}function Ao(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return es(e);if(e.$$typeof===ee)return;if(e.$$typeof===ge)return un(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=Co(),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 Qi(e,n){return typeof n=="function"?n(e):n}function Ro(e){var n=Kt();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 E=b=null,_=null,H=n,$=!1;do{var ne=H.lane&-536870913;if(ne!==H.lane?(ut&ne)===ne:(Xi&ne)===ne){var B=H.revertLane;if(B===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),ne===il&&($=!0);else if((Xi&B)===B){H=H.next,B===il&&($=!0);continue}else ne={lane:0,revertLane:H.revertLane,gesture:null,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},_===null?(E=_=ne,b=d):_=_.next=ne,Xe.lanes|=B,Tr|=B;ne=H.action,ol&&l(d,ne),d=H.hasEagerState?H.eagerState:l(d,ne)}else B={lane:ne,revertLane:H.revertLane,gesture:H.gesture,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null},_===null?(E=_=B,b=d):_=_.next=B,Xe.lanes|=ne,Tr|=ne;H=H.next}while(H!==null&&H!==n);if(_===null?b=d:_.next=E,!Mn(d,e.memoizedState)&&(Wt=!0,$&&(l=$l,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=Kt(),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);Mn(d,n.memoizedState)||(Wt=!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=Kt(),d=tt;if(d){if(l===void 0)throw Error(a(407));l=l()}else l=n();var b=!Mn((zt||f).memoizedState,l);if(b&&(f.memoizedState=l,Wt=!0),f=f.queue,Pc(op.bind(null,s,f,e),[e]),e=f.getSnapshot!==n||b||Pt!==null&&(Pt.memoizedState.tag&1)!==0,Jl(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||(Xi&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=Co(),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!Mn(e,l)}catch{return!0}}function cp(e){var n=Jr(e,2);n!==null&&Cn(n,e,2)}function Kc(e){var n=wn();if(typeof e=="function"){var l=e;if(e=l(),ol){Mt(!0);try{l()}finally{Mt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:e},n}function fp(e,n,l,s){return e.baseState=l,Qc(e,zt,typeof s=="function"?s:Qi)}function Sw(e,n,l,s,f){if(zo(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)}};K.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=K.T,b={};b.types=d!==null?d.types:null,K.T=b;try{var E=l(f,s),_=K.S;_!==null&&_(b,E),hp(e,n,E)}catch(H){Jc(e,n,H)}finally{d!==null&&b.types!==null&&(d.types=b.types),K.T=d}}else try{d=l(f,s),hp(e,n,d)}catch(H){Jc(e,n,H)}}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(tt){var l=qt.formState;if(l!==null){e:{var s=Xe;if(tt){if(Ht){t:{for(var f=Ht,d=ei;f.nodeType!==8;){if(!d){f=null;break t}if(f=ni(f.nextSibling),f===null){f=null;break t}}d=f.data,f=d==="F!"||d==="F"?f:null}if(f){Ht=ni(f.nextSibling),s=f.data==="F!";break e}}mr(s)}s=!1}s&&(n=l[0])}}return l=wn(),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=wn(),f={state:n,dispatch:null,action:e,pending:null},s.queue=f,l=Sw.bind(null,Xe,f,d,l),f.dispatch=l,s.memoizedState=e,[n,l,!1]}function vp(e){var n=Kt();return bp(n,zt,e)}function bp(e,n,l){if(n=Qc(e,n,yp)[0],e=Ro(Qi)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=es(n)}catch(b){throw b===Xl?xo:b}else s=n;n=Kt();var f=n.queue,d=f.dispatch;return l!==n.memoizedState&&(Xe.flags|=2048,Jl(9,{destroy:void 0},kw.bind(null,f,l),null)),[s,d,e]}function kw(e,n){e.action=n}function xp(e){var n=Kt(),l=zt;if(l!==null)return bp(n,l,e);Kt(),n=n.memoizedState,l=Kt();var s=l.queue.dispatch;return l.memoizedState=e,[n,s,!1]}function Jl(e,n,l,s){return e={tag:e,create:l,deps:s,inst:n,next:null},n=Xe.updateQueue,n===null&&(n=Co(),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 Kt().memoizedState}function _o(e,n,l,s){var f=wn();Xe.flags|=e,f.memoizedState=Jl(1|n,{destroy:void 0},l,s===void 0?null:s)}function Oo(e,n,l,s){var f=Kt();s=s===void 0?null:s;var d=f.memoizedState.inst;zt!==null&&s!==null&&Vc(s,zt.memoizedState.deps)?f.memoizedState=Jl(n,d,l,s):(Xe.flags|=e,f.memoizedState=Jl(1|n,d,l,s))}function Sp(e,n){_o(8390656,8,e,n)}function Pc(e,n){Oo(2048,8,e,n)}function Ew(e){Xe.flags|=4;var n=Xe.updateQueue;if(n===null)n=Co(),Xe.updateQueue=n,n.events=[e];else{var l=n.events;l===null?n.events=[e]:l.push(e)}}function kp(e){var n=Kt().memoizedState;return Ew({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 Oo(4,2,e,n)}function jp(e,n){return Oo(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,Oo(4,4,Tp.bind(null,n,e),l)}function Wc(){}function Cp(e,n){var l=Kt();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=Kt();n=n===void 0?null:n;var s=l.memoizedState;if(n!==null&&Vc(n,s[1]))return s[0];if(s=e(),ol){Mt(!0);try{e()}finally{Mt(!1)}}return l.memoizedState=[s,n],s}function ef(e,n,l){return l===void 0||(Xi&1073741824)!==0&&(ut&261930)===0?e.memoizedState=n:(e.memoizedState=l,e=Uy(),Xe.lanes|=e,Tr|=e,l)}function Rp(e,n,l,s){return Mn(l,n)?l:xr.current!==null?(e=ef(e,l,s),Mn(e,n)||(Wt=!0),e):(Xi&106)===0||(Xi&1073741824)!==0&&(ut&261930)===0?(Wt=!0,e.memoizedState=l):(e=Uy(),Xe.lanes|=e,Tr|=e,n)}function _p(e,n,l,s,f){var d=de.p;de.p=d!==0&&8>d?d:8;var b=K.T,E={};E.types=b!==null?b.types:null,K.T=E,rf(e,!1,n,l);try{var _=f(),H=K.S;if(H!==null&&H(E,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var $=bw(_,s);ts(e,n,$,Un(e))}else ts(e,n,s,Un(e))}catch(ne){ts(e,n,{then:function(){},status:"rejected",reason:ne},Un())}finally{de.p=d,b!==null&&E.types!==null&&(b.types=E.types),K.T=b}}function jw(){}function tf(e,n,l,s){if(e.tag!==5)throw Error(a(476));var f=Op(e).queue;_p(e,f,n,et,l===null?jw:function(){return zp(e),l(s)})}function Op(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:et,baseState:et,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:et},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,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),ts(e,n.next.queue,{},Un())}function nf(){return un(ya)}function Mp(){return Kt().memoizedState}function qp(){return Kt().memoizedState}function Tw(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var l=Un();e=vr(l);var s=br(n,e,l);s!==null&&(Cn(s,n,l),Za(s,n,l)),n={cache:Rc()},e.payload=n;return}n=n.return}}function Nw(e,n,l){var s=Un();l={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},zo(e)?Lp(n,l):(l=wc(e,n,l,s),l!==null&&(Cn(l,e,s),Bp(l,n,s)))}function Dp(e,n,l){var s=Un();ts(e,n,l,s)}function ts(e,n,l,s){var f={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(zo(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,E=d(b,l);if(f.hasEagerState=!0,f.eagerState=E,Mn(E,b))return uo(e,n,f,0),qt===null&&oo(),!1}catch{}if(l=wc(e,n,f,s),l!==null)return Cn(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},zo(e)){if(n)throw Error(a(479))}else n=wc(e,l,s,2),n!==null&&Cn(n,e,2)}function zo(e){var n=e.alternate;return e===Xe||n!==null&&n===Xe}function Lp(e,n){Zl=To=!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,Qs(e,l)}}var Mo={readContext:un,use:Ao,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t,useEffectEvent:$t},Up={readContext:un,use:Ao,useCallback:function(e,n){return wn().memoizedState=[e,n===void 0?null:n],e},useContext:un,useEffect:Sp,useImperativeHandle:function(e,n,l){l=l!=null?l.concat([e]):null,_o(4194308,4,Tp.bind(null,n,e),l)},useLayoutEffect:function(e,n){return _o(4194308,4,e,n)},useInsertionEffect:function(e,n){_o(4,2,e,n)},useMemo:function(e,n){var l=wn();n=n===void 0?null:n;var s=e();if(ol){Mt(!0);try{e()}finally{Mt(!1)}}return l.memoizedState=[s,n],s},useReducer:function(e,n,l){var s=wn();if(l!==void 0){var f=l(n);if(ol){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=Nw.bind(null,Xe,e),[s.memoizedState,e]},useRef:function(e){var n=wn();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=wn();return ef(l,e,n)},useTransition:function(){var e=Kc(!1);return e=_p.bind(null,Xe,e.queue,!0,!1),wn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,l){var s=Xe,f=wn();if(tt){if(l===void 0)throw Error(a(407));l=l()}else{if(l=n(),qt===null)throw Error(a(349));(ut&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,Jl(9,{destroy:void 0},sp.bind(null,s,d,l,n),null),l},useId:function(){var e=wn(),n=qt.identifierPrefix;if(tt){var l=xi,s=bi;l=(s&~(1<<32-jt(s)-1)).toString(32)+l,n="_"+n+"R_"+l,l=No++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=xw++,n="_"+n+"r_"+l.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:nf,useFormState:gp,useActionState:gp,useOptimistic:function(e){var n=wn();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 wn().memoizedState=Tw.bind(null,Xe)},useEffectEvent:function(e){var n=wn(),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:un,use:Ao,useCallback:Cp,useContext:un,useEffect:Pc,useImperativeHandle:Np,useInsertionEffect:Ep,useLayoutEffect:jp,useMemo:Ap,useReducer:Ro,useRef:wp,useState:function(){return Ro(Qi)},useDebugValue:Wc,useDeferredValue:function(e,n){var l=Kt();return Rp(l,zt.memoizedState,e,n)},useTransition:function(){var e=Ro(Qi)[0],n=Kt().memoizedState;return[typeof e=="boolean"?e:es(e),n]},useSyncExternalStore:lp,useId:Mp,useHostTransitionStatus:nf,useFormState:vp,useActionState:vp,useOptimistic:function(e,n){var l=Kt();return fp(l,zt,e,n)},useMemoCache:Xc,useCacheRefresh:qp,useEffectEvent:kp},Cw={readContext:un,use:Ao,useCallback:Cp,useContext:un,useEffect:Pc,useImperativeHandle:Np,useInsertionEffect:Ep,useLayoutEffect:jp,useMemo:Ap,useReducer:Zc,useRef:wp,useState:function(){return Zc(Qi)},useDebugValue:Wc,useDeferredValue:function(e,n){var l=Kt();return zt===null?ef(l,e,n):Rp(l,zt.memoizedState,e,n)},useTransition:function(){var e=Zc(Qi)[0],n=Kt().memoizedState;return[typeof e=="boolean"?e:es(e),n]},useSyncExternalStore:lp,useId:Mp,useHostTransitionStatus:nf,useFormState:xp,useActionState:xp,useOptimistic:function(e,n){var l=Kt();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:F({},n,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var af={enqueueSetState:function(e,n,l){e=e._reactInternals;var s=Un(),f=vr(s);f.payload=n,l!=null&&(f.callback=l),n=br(e,f,s),n!==null&&(Cn(n,e,s),Za(n,e,s))},enqueueReplaceState:function(e,n,l){e=e._reactInternals;var s=Un(),f=vr(s);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=br(e,f,s),n!==null&&(Cn(n,e,s),Za(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var l=Un(),s=vr(l);s.tag=2,n!=null&&(s.callback=n),n=br(e,s,l),n!==null&&(Cn(n,e,l),Za(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?!Ia(l,s)||!Ia(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 ul(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=F({},l));for(var f in e)l[f]===void 0&&(l[f]=e[f])}return l}function Yp(e){so(e)}function Fp(e){console.error(e)}function Gp(e){so(e)}function qo(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=vr(l),l.tag=3,l.payload={element:null},l.callback=function(){qo(e,n)},l}function Xp(e){return e=vr(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"&&(Nr===null?Nr=new Set([this]):Nr.add(this));var E=s.stack;this.componentDidCatch(s.value,{componentStack:E!==null?E:""})})}function Aw(e,n,l,s,f){if(l.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=l.alternate,n!==null&&tl(n,l,f,!0),l=cn.current,l!==null){switch(l.tag){case 31:case 13:case 19:return bn===null?nu():l.alternate===null&&Xt===0&&(Xt=3),l.flags&=-257,l.flags|=65536,l.lanes=f,s===wo?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===wo?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),nu(),!1}if(tt)return n=cn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,s!==Tc&&(e=Error(a(422),{cause:s}),Fa(Jn(e,l)))):(s!==Tc&&(n=Error(a(423),{cause:s}),Fa(Jn(n,l))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,s=Jn(s,l),f=sf(e.stateNode,s,f),Dc(e,f),Xt!==4&&(Xt=2)),!1;var d=Error(a(520),{cause:s});if(d=Jn(d,l),us===null?us=[d]:us.push(d),Xt!==4&&(Xt=2),n===null)return!0;s=Jn(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"&&(Nr===null||!Nr.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)),Wt=!1;function rn(e,n,l,s){n.child=e===null?Pm(n,null,l,s):sl(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 E in s)E!=="ref"&&(b[E]=s[E])}else b=s;return nl(n),s=Yc(e,n,l,b,d,f),E=Fc(),e!==null&&!Wt?(Gc(e,n,f),Zi(e,n,f)):(tt&&E&&mo(n),n.flags|=1,rn(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=fo(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:Ia,l(b,s)&&e.ref===n.ref)return Zi(e,n,f)}return n.flags|=1,e=Yi(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(Ia(d,s)&&e.ref===n.ref)if(Wt=!1,n.pendingProps=s=d,yf(e,f))(e.flags&131072)!==0&&(Wt=!0);else return n.lanes=e.lanes,Zi(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&&bo(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?(bo(n,d.cachePool),tp(n,d),Sr(),n.memoizedState=null):(e!==null&&bo(n,null),Bc(),Sr());return rn(e,n,f,l),n.child}function ns(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:Jt._currentValue,pool:d},n.memoizedState={baseLanes:l,cachePool:d},e!==null&&bo(n,null),Bc(),np(n),e!==null&&tl(e,n,s,!0),n.childLanes=f,null}function Do(e,n){return n=Lo({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 sl(n,e.child,null,l),e=Do(n,n.pendingProps),e.flags|=2,qn(n),n.memoizedState=null,e}function Rw(e,n,l){var s=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(tt){if(s.mode==="hidden")return e=Do(n,s),n.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},ns(null,e);if(Hc(n),(e=Ht)?(e=Tg(e,ei),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:dr!==null?{id:bi,overflow:xi}:null,retryLane:536870912,hydrationErrors:null},l=Lm(e),l.return=n,n.child=l,ln=n,Ht=null)):e=null,e===null)throw mr(n);return n.lanes=536870912,null}return Do(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(Wt||tl(e,n,l,!1),f=(l&e.childLanes)!==0,Wt||f){if(xr.current===null){if(s=qt,s!==null&&(b=Ir(s,l),b!==0&&b!==d.retryLane))throw d.retryLane=b,Jr(e,b),Cn(s,e,b),of;nu()}n=ey(e,n,l)}else e=d.treeContext,Ht=ni(b.nextSibling),ln=n,tt=!0,hr=null,ei=!1,e!==null&&Hm(n,e),n=Do(n,s),n.flags|=134221824;return n}return e=Yi(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Pl(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 nl(n),l=Yc(e,n,l,s,void 0,f),s=Fc(),e!==null&&!Wt?(Gc(e,n,f),Zi(e,n,f)):(tt&&s&&mo(n),n.flags|=1,rn(e,n,l,f),n.child)}function ty(e,n,l,s,f,d){return nl(n),n.updateQueue=null,l=rp(n,s,l,f),ip(e),s=Fc(),e!==null&&!Wt?(Gc(e,n,d),Zi(e,n,d)):(tt&&s&&mo(n),n.flags|=1,rn(e,n,l,d),n.child)}function ny(e,n,l,s,f){if(nl(n),n.stateNode===null){var d=Vl,b=l.contextType;typeof b=="object"&&b!==null&&(d=un(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?un(b):Vl,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),Ja(n,s,d,f),Ka(),d.state=n.memoizedState),typeof d.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){d=n.stateNode;var E=n.memoizedProps,_=ul(l,E);d.props=_;var H=d.context,$=l.contextType;b=Vl,typeof $=="object"&&$!==null&&(b=un($));var ne=l.getDerivedStateFromProps;$=typeof ne=="function"||typeof d.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,$||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(E||H!==b)&&Vp(n,d,s,b),gr=!1;var B=n.memoizedState;d.state=B,Ja(n,s,d,f),Ka(),H=n.memoizedState,E||B!==H||gr?(typeof ne=="function"&&(lf(n,l,ne,s),H=n.memoizedState),(_=gr||Ip(n,l,_,s,B,H,b))?($||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(n.flags|=4194308)):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=H),d.props=s,d.state=H,d.context=b,s=_):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{d=n.stateNode,qc(e,n),b=n.memoizedProps,$=ul(l,b),d.props=$,ne=n.pendingProps,B=d.context,H=l.contextType,_=Vl,typeof H=="object"&&H!==null&&(_=un(H)),E=l.getDerivedStateFromProps,(H=typeof E=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==ne||B!==_)&&Vp(n,d,s,_),gr=!1,B=n.memoizedState,d.state=B,Ja(n,s,d,f),Ka();var G=n.memoizedState;b!==ne||B!==G||gr||e!==null&&e.dependencies!==null&&go(e.dependencies)?(typeof E=="function"&&(lf(n,l,E,s),G=n.memoizedState),($=gr||Ip(n,l,$,s,B,G,_)||e!==null&&e.dependencies!==null&&go(e.dependencies))?(H||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,G,_),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,G,_)),typeof d.componentDidUpdate=="function"&&(n.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&B===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&B===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=G),d.props=s,d.state=G,d.context=_,s=$):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&B===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&B===e.memoizedState||(n.flags|=1024),s=!1)}return d=s,Pl(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=sl(n,e.child,null,f),n.child=sl(n,null,l,f)):rn(e,n,l,f),n.memoizedState=d.state,e=n.child):e=Zi(e,n,f),e}function iy(e,n,l,s){return Wr(),n.flags|=256,rn(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|=Bn),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:(fn.current&2)!==0),b&&(f=!0,n.flags&=-129),b=(n.flags&32)!==0,n.flags&=-33,e===null){if(tt){if(f?wr(n):Sr(),(e=Ht)?(e=Tg(e,ei),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:dr!==null?{id:bi,overflow:xi}:null,retryLane:536870912,hydrationErrors:null},l=Lm(e),l.return=n,n.child=l,ln=n,Ht=null)):e=null,e===null)throw mr(n);return fd(e)?n.lanes=32:n.lanes=536870912,null}return d=s.children,s=s.fallback,f?(Sr(),f=n.mode,d=Lo({mode:"hidden",children:d},f),s=Pr(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,ns(null,s)):(wr(n),hf(n,d))}var E=e.memoizedState;if(E!==null){var _=E.dehydrated;if(_!==null)return _w(e,n,d,b,s,_,E,l)}return f?(Sr(),f=s.fallback,d=n.mode,E=e.child,_=E.sibling,s=Yi(E,{mode:"hidden",children:s.children}),s.subtreeFlags=E.subtreeFlags&1206910976,_!==null?f=Yi(_,f):(f=Pr(f,d,l,null),f.flags|=2),f.return=n,s.return=n,s.sibling=f,n.child=s,ns(null,s),s=n.child,f=e.child.memoizedState,f===null?f=ff(l):(d=f.cachePool,d!==null?(E=Jt._currentValue,d=d.parent!==E?{parent:E,pool:E}:d):d=$m(),f={baseLanes:f.baseLanes|l,cachePool:d}),s.memoizedState=f,s.childLanes=df(e,b,l),n.memoizedState=cf,ns(e.child,s)):(wr(n),l=e.child,e=l.sibling,l=Yi(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=Lo({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Lo(e,n){return e=En(22,e,null,n),e.lanes=0,e}function Bo(e,n,l){return sl(n,e.child,null,l),e=hf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function _w(e,n,l,s,f,d,b,E){if(l)return n.flags&256?(wr(n),n.flags&=-257,Bo(e,n,E)):n.memoizedState!==null?(Sr(),n.child=e.child,n.flags|=128,null):(Sr(),d=f.fallback,b=n.mode,f=Lo({mode:"visible",children:f.children},b),d=Pr(d,b,E,null),d.flags|=2,f.return=n,d.return=n,f.sibling=d,n.child=f,sl(n,e.child,null,E),f=n.child,f.memoizedState=ff(E),f.childLanes=df(e,s,E),n.memoizedState=cf,ns(null,f));if(wr(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,Fa({value:f,source:null,stack:null})),Bo(e,n,E)}if(Wt||tl(e,n,E,!1),s=(E&e.childLanes)!==0,Wt||s){if(xr.current!==null)return Bo(e,n,E);if(s=qt,s!==null&&(f=Ir(s,E),f!==0&&f!==b.retryLane))throw b.retryLane=f,Jr(e,f),Cn(s,e,f),of;return cd(d)||nu(),Bo(e,n,E)}return cd(d)?(n.flags|=192,n.child=e.child,null):(e=b.treeContext,Ht=ni(d.nextSibling),ln=n,tt=!0,hr=null,ei=!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),yo(e.return,n,l)}function ay(e){for(var n=null;e!==null;){var l=e.alternate;l!==null&&jo(l)===null&&(n=e),e=e.sibling}return n}function Uo(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=fn.current;if(n.flags&128)return Pa(n,b),null;var E=(b&2)!==0;if(E?(b=b&1|2,n.flags|=128):b&=1,Pa(n,b),f==="backwards"&&e!==null?(mf(e),rn(e,n,s,l),mf(e)):rn(e,n,s,l),s=tt?Ya:0,!E&&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)),Uo(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&&jo(e)===null){n.child=f;break}e=f.sibling,f.sibling=l,l=f,f=e}Uo(n,!0,l,null,d,s);break;case"together":Uo(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),Uo(n,!1,f,l,d,s)}return n.child}function sy(e,n,l){var s=n.pendingProps;return pr(n,n.type,s.value),rn(e,n,s.children,l),n.child}function Zi(e,n,l){if(e!==null&&(n.dependencies=e.dependencies),Tr|=n.lanes,(l&n.childLanes)===0)if(e!==null){if(tl(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=Yi(e,e.pendingProps),n.child=l,l.return=n;e.sibling!==null;)e=e.sibling,l=l.sibling=Yi(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&&go(e)))}function Ow(e,n,l){switch(n.tag){case 3:Be(n,n.stateNode.containerInfo),pr(n,Jt,e.memoizedState.cache),Wr();break;case 27:case 5:Qt(n);break;case 4:Be(n,n.stateNode.containerInfo);break;case 10:pr(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 wr(n),n.flags|=128,null;s=tl(e,n,l,!1);var f=n.child.childLanes;return s||(l&f)!==0?ry(e,n,l):(wr(n),e=Zi(e,n,l),e!==null?e.sibling:null)}wr(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||(tl(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),Pa(n,fn.current),s)break;return null;case 22:return n.lanes=0,Pp(e,n,l,n.pendingProps);case 24:pr(n,Jt,e.memoizedState.cache)}return Zi(e,n,l)}function oy(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps)Wt=!0;else{if(!yf(e,l)&&(n.flags&128)===0)return Wt=!1,Ow(e,n,l);Wt=(e.flags&131072)!==0}else Wt=!1,tt&&(n.flags&1048576)!==0&&Um(n,Ya,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=ll(n.elementType),n.type=e,typeof e=="function")Sc(e)?(s=ul(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=ul(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),Ja(n,s,null,l);var b=n.memoizedState;if(s=b.cache,pr(n,Jt,s),s!==d.cache&&Ac(n,[Jt],l,!0),Ka(),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=Jn(Error(a(424)),n),Fa(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=ni(e.firstChild),ln=n,tt=!0,hr=null,ei=!0,l=Pm(n,null,s,l),n.child=l;l;)l.flags=l.flags&-3|134221824,l=l.sibling;else{if(Wr(),s===f){n=Zi(e,n,l);break e}rn(e,n,s,l)}n=n.child}return n;case 26:return Pl(e,n),e===null?(l=zg(n.type,null,n.pendingProps,null))?n.memoizedState=l:tt||(n.stateNode=dg(n.type,n.pendingProps,rt.current,n)):n.memoizedState=zg(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Qt(n),e===null&&tt&&(s=n.stateNode=Ag(n.type,n.pendingProps,rt.current),ln=n,ei=!0,f=Ht,Rr(n.type)?(dd=f,Ht=ni(s.firstChild)):Ht=f),rn(e,n,n.pendingProps.children,l),Pl(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&tt&&((f=s=Ht)&&(s=TS(s,n.type,n.pendingProps,ei),s!==null?(n.stateNode=s,ln=n,Ht=ni(s.firstChild),ei=!1,f=!0):f=!1),f||mr(n)),Qt(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,ww,null,null,l),ya._currentValue=f),Pl(e,n),rn(e,n,s,l),n.child;case 6:return e===null&&tt&&((e=l=Ht)&&(l=NS(l,n.pendingProps,ei),l!==null?(n.stateNode=l,ln=n,Ht=null,e=!0):e=!1),e||mr(n)),null;case 13:return ry(e,n,l);case 4:return Be(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=sl(n,null,s,l):rn(e,n,s,l),n.child;case 11:return Zp(e,n,n.type,n.pendingProps,l);case 7:return s=n.pendingProps,Pl(e,n),rn(e,n,s,l),n.child;case 8:return rn(e,n,n.pendingProps.children,l),n.child;case 12:return rn(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,nl(n),f=un(f),s=s(f),n.flags|=1,rn(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 Rw(e,n,l);case 22:return Pp(e,n,l,n.pendingProps);case 24:return nl(n),s=un(Jt),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),pr(n,Jt,f)):((e.lanes&l)!==0&&(qc(e,n),Ja(n,null,null,l),Ka()),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),pr(n,Jt,s)):(s=d.cache,pr(n,Jt,s),s!==f.cache&&Ac(n,[Jt],l,!0))),rn(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:tt&&mo(n),e!==null&&e.memoizedProps.name!==s.name?n.flags|=4194816:Pl(e,n),rn(e,n,s.children,l),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function Ki(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 al=wo,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 al=wo,zc}function Ho(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Xs():536870912,e.lanes|=n,ia|=n)}function is(e,n){if(!tt)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 zw(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),$i(Jt),ft(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Gl(n)?Ki(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?(Ki(n),d!==null?(It(n),uy(n,d)):(It(n),gf(n,f,null,s,l))):d?d!==e.memoizedState?(Ki(n),It(n),uy(n,d)):(It(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Ki(n),It(n),gf(n,f,e,s,l)),null;case 27:if(Bt(n),l=rt.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Ki(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return It(n),n.subtreeFlags&=-33554433,null}e=Ae.current,Gl(n)?Im(n):(e=Ag(f,s,l),n.stateNode=e,Ki(n))}return It(n),n.subtreeFlags&=-33554433,null;case 5:if(Bt(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Ki(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return It(n),n.subtreeFlags&=-33554433,null}if(d=Ae.current,Gl(n))Im(n);else{var b=ms(rt.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[Zt]=n,d[on]=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(hn(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&&Ki(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&&Ki(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(a(166));if(e=rt.current,Gl(n)){if(e=n.stateNode,l=n.memoizedProps,s=null,f=ln,f!==null)switch(f.tag){case 27:case 5:s=f.memoizedProps}e[Zt]=n,e=!!(e.nodeValue===l||s!==null&&s.suppressHydrationWarning===!0||og(e.nodeValue,l)),e||mr(n,!0)}else e=ms(e).createTextNode(s),e[Zt]=n,n.stateNode=e}return It(n),null;case 31:if(l=n.memoizedState,e===null||e.memoizedState!==null){if(s=Gl(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[Zt]=n}else Wr(),(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?(qn(n),n):(qn(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=Gl(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[Zt]=n}else Wr(),(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?(qn(n),n):(qn(n),null)}return qn(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),Ho(n,n.updateQueue),It(n),null);case 4:return ft(),e===null&&Pf(n.stateNode.containerInfo),n.flags|=67108864,It(n),null;case 10:return $i(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)is(s,!1);else{if(Xt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(d=jo(e),d!==null){for(n.flags|=128,is(s,!1),e=d.updateQueue,n.updateQueue=e,Ho(n,e),n.subtreeFlags=0,e=l,l=n.child;l!==null;)Dm(l,e),l=l.sibling;return Pa(n,fn.current&1|2),tt&&Fi(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&Nt()>Po&&(n.flags|=128,f=!0,is(s,!1),n.lanes=4194304)}else{if(!f)if(e=jo(d),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,Ho(n,e),is(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!d.alternate&&!tt)return It(n),null}else 2*Nt()-s.renderingStartTime>Po&&l!==536870912&&(n.flags|=128,f=!0,is(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=fn.current,d=f?d&1|2:d&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!l||tt?Pa(n,d):(l=d,Ve(cn,n),Ve(fn,l),bn===null&&(bn=n)),tt&&Fi(n,s.treeForkCount),e}return It(n),null;case 22:case 23:return qn(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&&Ho(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(rl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),$i(Jt),It(n),null;case 25:return null;case 30:return n.flags|=33554432,It(n),null}throw Error(a(156,n.tag))}function Mw(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 $i(Jt),ft(),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(qn(n),n.alternate===null)throw Error(a(340));Wr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(qn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(a(340));Wr()}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 ft(),null;case 10:return $i(n.type),null;case 22:case 23:return qn(n),Uc(),e!==null&&Me(rl),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return $i(Jt),null;case 25:return null;default:return null}}function cy(e,n){switch(jc(n),n.tag){case 3:$i(Jt),ft();break;case 26:case 27:case 5:Bt(n);break;case 4:ft();break;case 31:n.memoizedState!==null&&qn(n);break;case 13:qn(n);break;case 19:Ic(n);break;case 10:$i(n.type);break;case 22:case 23:qn(n),Uc(),e!==null&&Me(rl);break;case 24:$i(Jt)}}function rs(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(E){Rt(n,n.return,E)}}function kr(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,E=b.destroy;if(E!==void 0){b.destroy=void 0,f=n;var _=l,H=E;try{H()}catch($){Rt(f,_,$)}}}s=s.next}while(s!==d)}}catch($){Rt(n,n.return,$)}}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=ul(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(s){Rt(e,n,s)}}function wi(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=Ii(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 Hn(e);g(e.child,!1,ES,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(E){Rt(e,n,E)}}function dn(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 Io(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 ls(e){for(var n=e.return;n!==null&&(bf(n)&&jS(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;aS(s,e.type,l,n),s[on]=n}catch(f){Rt(e,e.return,f)}}function my(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Rr(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&&Rr(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=Xn)),Io(e,s),dt=!0;else if(f!==4&&(f===27&&(Io(e,s),s=null,Rr(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 Vo(e,n,l,s){var f=e.tag;if(f===5||f===6)f=e.stateNode,n?l.insertBefore(f,n):l.appendChild(f),Io(e,s),dt=!0;else if(f!==4&&(f===27&&(Io(e,s),s=null,Rr(e.type)&&(l=e.stateNode)),e=e.child,e!==null))for(Vo(e,n,l,s),e=e.sibling;e!==null;)Vo(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]);hn(n,s,l),n[Zt]=e,n[on]=l}catch(d){Rt(e,e.return,d)}}var Yo=!1,Dn=null;function yy(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Yo=!0)}var Si=null;function gy(){var e=Si;return Si=null,e}var jn=0;function Wl(e,n,l,s,f){return jn=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 E=ad(b);s.push(E),E.view&&(d=!0)}else d||ad(b).view&&(d=!0);Yo=!0,gg(b,jn===0?n:n+"_"+jn,l),jn++}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 ki(e,n){for(;e!==null;)e.tag===5?vg(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&n||ki(e.child,n)),e=e.sibling}function Fo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Fo(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=Vi(n.default,n.share),n!=="none"&&(Wl(e,l,n,null,!1)||ki(e.child,!1))}e=e.sibling}}function Ef(e,n){if(e.tag===30){var l=e.stateNode,s=e.memoizedProps,f=Ii(s,l),d=Vi(s.default,l.paired?s.share:s.enter);d!=="none"?Wl(e,f,d,null,!1)?(Fo(e),l.paired||n||sa(e,s.onEnter)):ki(e.child,!1):Fo(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Ef(e,n),e=e.sibling;else Fo(e)}function jf(e){if(Dn!==null&&Dn.size!==0){var n=Dn;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=Vi(l.default,l.share);if(d!=="none"&&(Wl(e,s,d,null,!1)?(d=e.stateNode,f.paired=d,d.paired=f,sa(e,l.onShare)):ki(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=Ii(n,e.stateNode),s=Dn!==null?Dn.get(l):void 0,f=Vi(n.default,s!==void 0?n.share:n.exit);f!=="none"&&(Wl(e,l,f,null,!1)?s!==void 0?(f=e.stateNode,s.paired=f,f.paired=s,Dn.delete(l),sa(e,n.onShare)):sa(e,n.onExit):ki(e.child,!1)),Dn!==null&&jf(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Tf(e),e=e.sibling;else Dn!==null&&jf(e)}function by(e){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,l=Ii(n,e.stateNode);n=Vi(n.default,n.update),e.flags&=-5,n!=="none"&&Wl(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,ki(e.child,!1))}Nf(e)}e=e.sibling}}function Go(e){if(e.tag===30)e.stateNode.paired=null,ki(e.child,!1),Nf(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Go(e),e=e.sibling;else Nf(e)}function xy(e){for(e=e.child;e!==null;)e.tag===30?ki(e.child,!1):(e.subtreeFlags&33554432)!==0&&xy(e),e=e.sibling}function Cf(e,n,l,s,f,d,b){for(var E=!1;n!==null;){if(n.tag===5){var _=n.stateNode;if(d!==null&&jn<d.length){var H=d[jn],$=ad(_);(H.view||$.view)&&(E=!0);var ne;if(ne=(e.flags&4)===0)if($.clip)ne=!0;else{ne=H.rect;var B=$.rect;ne=ne.y!==B.y||ne.x!==B.x||ne.height!==B.height||ne.width!==B.width}ne&&(e.flags|=4),$.abs?$=!H.abs:(H=H.rect,$=$.rect,$=H.height!==$.height||H.width!==$.width),$&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&gg(_,jn===0?l:l+"_"+jn,f),E&&(e.flags&4)!==0||(Si===null&&(Si=[]),Si.push(_,jn===0?s:s+"_"+jn,n.memoizedProps)),jn++}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)&&(E=!0));n=n.sibling}return E}function wy(e,n){for(e=e.child;e!==null;){if(e.tag===30){var l=e.memoizedProps,s=e.stateNode,f=Ii(l,s),d=Vi(l.default,l.update),b;b=e.memoizedState,e.memoizedState=null,s=e;var E=e.child;jn=0,f=Cf(s,E,f,f,d,b,!1),(e.flags&4)!==0&&f&&sa(e,l.onUpdate)}else(e.subtreeFlags&33554432)!==0&&wy(e);e=e.sibling}}var an=!1,Tt=!1,Ei=!1,Af=!1,Sy=typeof WeakSet=="function"?WeakSet:Set,sn=null,ji=!1,as=!1,$o=!1,Rf=!1;function qw(e,n,l){if(e=e.containerInfo,td=ga,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 E=0,_=-1,H=-1,$=0,ne=0,B=e,G=null;t:for(;;){for(var Se;B!==s||d!==0&&B.nodeType!==3||(_=E+d),B!==b||f!==0&&B.nodeType!==3||(H=E+f),B.nodeType===3&&(E+=B.nodeValue.length),(Se=B.firstChild)!==null;)G=B,B=Se;for(;;){if(B===e)break t;if(G===s&&++$===d&&(_=E),G===b&&++ne===f&&(H=E),(Se=B.nextSibling)!==null)break;B=G,G=B.parentNode}B=Se}s=_===-1||H===-1?null:{start:_,end:H}}else s=null}s=s||{start:0,end:0}}else s=null;for(nd={focusedElem:e,selectionRange:s},ga=!1,l=(l&335544064)===l,sn=n,n=l?9270:1024;sn!==null;){if(e=sn,l&&(s=e.deletions,s!==null))for(d=0;d<s.length;d++)l&&Tf(s[d]);if(e.alternate===null&&(e.flags&2)!==0)l&&yy(e),Xo(l);else{if(e.tag===22){if(s=e.alternate,e.memoizedState!==null){s!==null&&s.memoizedState===null&&l&&Tf(s),Xo(l);continue}else if(s!==null&&s.memoizedState!==null){l&&yy(e),Xo(l);continue}}s=e.child,(e.subtreeFlags&n)!==0&&s!==null?(s.return=e,sn=s):(l&&by(e),Xo(l))}}Dn=null}function Xo(e){for(;sn!==null;){var n=sn,l=e,s=n.alternate,f=n.flags;switch(n.tag){case 0:case 11:case 15:break;case 1:if((f&1024)!==0&&s!==null){l=void 0,f=s.memoizedProps,s=s.memoizedState;var d=n.stateNode;try{var b=ul(n.type,f);l=d.getSnapshotBeforeUpdate(b,s),d.__reactInternalSnapshotBeforeUpdate=l}catch(E){Rt(n,n.return,E)}}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=Ii(s.memoizedProps,s.stateNode),f=n.memoizedProps,f=Vi(f.default,f.update),f!=="none"&&Wl(s,l,f,s.memoizedState=[],!0));break;default:if((f&1024)!==0)throw Error(a(163))}if(s=n.sibling,s!==null){s.return=n.return,sn=s;break}sn=n.return}}function ky(e,n,l){var s=l.flags;switch(l.tag){case 0:case 11:case 15:Ti(e,l),s&4&&rs(5,l);break;case 1:if(Ti(e,l),s&4)if(e=l.stateNode,n===null)try{e.componentDidMount()}catch(b){Rt(l,l.return,b)}else{var f=ul(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&&wi(l,l.return);break;case 3:if(Ti(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:Ti(e,l),n===null&&s&4&&xf(l),s&512&&wi(l,l.return);break;case 12:Ti(e,l);break;case 31:Ti(e,l),s&4&&Ny(e,l);break;case 13:Ti(e,l),s&4&&Cy(e,l),s&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Xw.bind(null,l),CS(e,l))));break;case 22:if(s=l.memoizedState!==null||an,!s){var d=n!==null&&n.memoizedState!==null||Tt;n=an,f=Tt,an=s,(Tt=d)&&!f?(s=2,(l.subtreeFlags&8772)!==0&&(s|=1),ci(e,l,s)):Ti(e,l),an=n,Tt=f}break;case 30:Ti(e,l),s&512&&wi(l,l.return);break;case 7:s&512&&wi(l,l.return);default:Ti(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,dt=!0}catch(_){Rt(e,e.return,_)}break;case 18:try{var E=e.stateNode;n?yg(E,!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&&Li(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,Tn=!1;function oi(e,n,l){for(l=l.child;l!==null;)Ty(e,n,l),l=l.sibling}function Ty(e,n,l){if(ot&&typeof ot.onCommitFiberUnmount=="function")try{ot.onCommitFiberUnmount(yt,l)}catch{}switch(l.tag){case 26:Tt||dn(l,n),oi(e,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&!Tt&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Tt||dn(l,n),ls(l);var s=Yt,f=Tn;Rr(l.type)&&(Yt=l.stateNode,Tn=!1),oi(e,n,l),Rg(l.stateNode,l.type,l.memoizedProps),Yt=s,Tn=f;break;case 5:Tt||dn(l,n),ls(l);case 6:if(l.tag===6&&ls(l),s=Yt,f=Tn,Yt=null,oi(e,n,l),Yt=s,Tn=f,Yt!==null)if(Tn)try{(Yt.nodeType===9?Yt.body:Yt.nodeName==="HTML"?Yt.ownerDocument.body:Yt).removeChild(l.stateNode),dt=!0}catch(d){Rt(l,n,d)}else try{Yt.removeChild(l.stateNode),dt=!0}catch(d){Rt(l,n,d)}break;case 18:Yt!==null&&(Tn?(e=Yt,pg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),va(e)):pg(Yt,l.stateNode));break;case 4:s=Yt,f=Tn,Yt=l.stateNode.containerInfo,Tn=!0,oi(e,n,l),Yt=s,Tn=f;break;case 0:case 11:case 14:case 15:kr(2,l,n),Tt||kr(4,l,n),oi(e,n,l);break;case 1:Tt||(dn(l,n),s=l.stateNode,typeof s.componentWillUnmount=="function"&&dy(l,n,s)),oi(e,n,l);break;case 21:oi(e,n,l);break;case 22:Tt=(s=Tt)||l.memoizedState!==null,oi(e,n,l),Tt=s;break;case 30:dn(l,n),oi(e,n,l);break;case 7:Tt||dn(l,n),oi(e,n,l);break;default:oi(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{va(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{va(e)}catch(l){Rt(n,n.return,l)}}function Dw(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 Qo(e,n){var l=Dw(e);n.forEach(function(s){if(!l.has(s)){l.add(s);var f=Qw.bind(null,e,s);s.then(f,f)}})}function Sn(e,n,l){var s=n.deletions;if(s!==null)for(var f=0;f<s.length;f++){var d=s[f],b=e,E=n,_=E;e:for(;_!==null;){switch(_.tag){case 27:if(Rr(_.type)){Yt=_.stateNode,Tn=!1;break e}break;case 5:Yt=_.stateNode,Tn=!1;break e;case 3:case 4:Yt=_.stateNode.containerInfo,Tn=!0;break e}_=_.return}if(Yt===null)throw Error(a(160));Ty(b,E,d),Yt=null,Tn=!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 ui=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}Sn(n,e,l),kn(e),f&4&&(kr(3,e,e.return),rs(3,e),kr(5,e,e.return));break;case 1:Sn(n,e,l),kn(e),f&512&&(Tt||s===null||dn(s,s.return)),f&64&&an&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?n:l.concat(n))));break;case 26:if(d=ui,Sn(n,e,l),kn(e),f&512&&(Tt||s===null||dn(s,s.return)),f&4)if(f=s!==null?s.memoizedState:null,l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null)if(an)e.stateNode=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[Di]||s[Zt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=f.createElement(n),f.head.insertBefore(s,f.querySelector("head > title"))),hn(s,n,l),s[Zt]=e,Ut(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),hn(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),hn(s,n,l),f.head.appendChild(s);break;default:throw Error(a(468,n))}s[Zt]=e,Ut(s),n=s}e.stateNode=n}else an||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?an||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:Sn(n,e,l),kn(e),f&512&&(Tt||s===null||dn(s,s.return)),s!==null&&f&4&&wf(e,e.memoizedProps,s.memoizedProps);break;case 5:if(d=Ei,Ei=!1,Sn(n,e,l),Ei=d,kn(e),f&512&&(Tt||s===null||dn(s,s.return)),e.flags&32){n=e.stateNode;try{Hi(n,""),dt=!0}catch($){Rt(e,e.return,$)}}f&4&&e.stateNode!=null&&(n=e.memoizedProps,wf(e,n,s!==null?s.memoizedProps:n)),f&1024&&(Af=!0);break;case 6:if(Sn(n,e,l),kn(e),f&4){if(e.stateNode===null)throw Error(a(162));n=e.memoizedProps,l=e.stateNode;try{l.nodeValue=n,dt=!0}catch($){Rt(e,e.return,$)}}break;case 3:if(dt=!1,uu=null,d=ui,ui=ps(n.containerInfo),Sn(n,e,l),ui=d,kn(e),f&4&&s!==null&&s.memoizedState.isDehydrated)try{va(n.containerInfo)}catch($){Rt(e,e.return,$)}Af&&(Af=!1,Ry(e)),dt=!1;break;case 4:f=Ei,Ei=an,s=ar(),d=ui,ui=ps(e.stateNode.containerInfo),Sn(n,e,l),kn(e),ui=d,dt&&as&&($o=!0),dt=s,Ei=f;break;case 12:Sn(n,e,l),kn(e);break;case 31:Sn(n,e,l),kn(e),f&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Qo(e,n)));break;case 13:Sn(n,e,l),kn(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Jo=Nt()),f&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Qo(e,n)));break;case 22:d=e.memoizedState!==null,b=s!==null&&s.memoizedState!==null;var E=an,_=Tt,H=Ei;an=E||d,Ei=H||d,Tt=_||b,Sn(n,e,l),Tt=_,Ei=H,an=E,kn(e),f&8192&&(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,!d||s===null||b||an||Tt||(n=b||Tt,l=an,s=Tt,an=d||an,Tt=n,Er(e,2),an=l,Tt=s),!d&&Ei||_f(e,d)),f&4&&(n=e.updateQueue,n!==null&&(l=n.retryQueue,l!==null&&(n.retryQueue=null,Qo(e,l))));break;case 19:Sn(n,e,l),kn(e),f&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Qo(e,n)));break;case 30:f&512&&(Tt||s===null||dn(s,s.return)),f=ar(),d=as,b=(l&335544064)===l,E=e.memoizedProps,as=b&&Vi(E.default,E.update)!=="none",Sn(n,e,l),kn(e),b&&s!==null&&dt&&(e.flags|=4),as=d,dt=f;break;case 21:break;case 7:f&512&&(Tt||s===null||dn(s,s.return)),s&&s.stateNode!==null&&(s.stateNode._fragmentFiber=e);default:Sn(n,e,l),kn(e)}}function kn(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 E=l.stateNode,_=Sf(e);Vo(e,_,E,b);break;case 5:var H=l.stateNode;l.flags&32&&(Hi(H,""),l.flags&=-33);var $=Sf(e);Vo(e,$,H,b);break;case 3:case 4:var ne=l.stateNode.containerInfo,B=Sf(e);kf(e,B,ne,b);break;default:throw Error(a(161))}}catch(G){Rt(e,e.return,G)}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,ga=!0,n.reset(),ga=!1),e=e.sibling}}function ea(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=ji=!1,gy(),ea(n,e),!ji&&!$o){if(e=Si,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}Si=null;break;case 5:ea(n,e);break;case 4:s=ji,ji=!1,ea(n,e),ji&&($o=!0),ji=s;break;case 22:e.memoizedState===null&&(l.memoizedState!==null?Ef(e,!1):ea(n,e));break;case 30:s=ji,f=gy(),ji=!1,ea(n,e),ji&&(e.flags|=4);var d=e.memoizedProps,b=e.stateNode;n=Ii(d,b),b=Ii(l.memoizedProps,b);var E=Vi(d.default,d.update);E==="none"?n=!1:(d=l.memoizedState,l.memoizedState=null,l=e.child,jn=0,n=Cf(e,l,n,b,E,d,!0),jn!==(d===null?0:d.length)&&(e.flags|=32)),(e.flags&4)!==0&&n?(sa(e,e.memoizedProps.onUpdate),Si=f):f!==null&&(f.push.apply(f,Si),Si=f),ji=(e.flags&32)!==0?!0:s;break;default:ea(n,e)}}function Ti(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)ky(e,n.alternate,n),n=n.sibling}function Er(e,n){for(e=e.child;e!==null;){var l=e,s=n;switch(l.tag){case 0:case 11:case 14:case 15:kr(4,l,l.return),Er(l,s);break;case 1:dn(l,l.return);var f=l.stateNode;typeof f.componentWillUnmount=="function"&&dy(l,l.return,f),Er(l,s);break;case 27:(s&2)!==0&&Rg(l.stateNode,l.type,l.memoizedProps);case 5:dn(l,l.return),l.tag!==5&&l.tag!==27||ls(l),Er(l,s);break;case 6:ls(l);break;case 26:dn(l,l.return),f=l.stateNode,l.memoizedState!==null||f===null||Tt||f.parentNode.removeChild(f),Er(l,s);break;case 22:l.memoizedState===null&&Er(l,s);break;case 30:dn(l,l.return),Er(l,s);break;case 7:dn(l,l.return);default:Er(l,s)}e=e.sibling}}function ci(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,E=(l&1)!==0;switch(d.tag){case 0:case 11:case 15:ci(f,d,l),rs(4,d);break;case 1:if(ci(f,d,l),s=d,f=s.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch($){Rt(s,s.return,$)}if(s=d,f=s.updateQueue,f!==null){var _=s.stateNode;try{var H=f.shared.hiddenCallbacks;if(H!==null)for(f.shared.hiddenCallbacks=null,f=0;f<H.length;f++)Wm(H[f],_)}catch($){Rt(s,s.return,$)}}E&&b&64&&fy(d),wi(d,d.return);break;case 27:(l&2)!==0&&py(d);case 5:d.tag!==5&&d.tag!==27||hy(d),ci(f,d,l),E&&s===null&&b&4&&xf(d),wi(d,d.return);break;case 6:hy(d);break;case 26:_=d.stateNode,d.memoizedState!==null||_===null||an||yd(ps(_.ownerDocument),d.type,_),ci(f,d,l),E&&s===null&&b&4&&xf(d),wi(d,d.return);break;case 12:ci(f,d,l);break;case 31:ci(f,d,l),E&&b&4&&Ny(f,d);break;case 13:ci(f,d,l),E&&b&4&&Cy(f,d);break;case 22:d.memoizedState===null&&ci(f,d,l),wi(d,d.return);break;case 30:ci(f,d,l),wi(d,d.return);break;case 7:wi(d,d.return);default:ci(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&&Ga(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&&Ga(e))}function ti(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&&Go(n);var d=n.flags;switch(n.tag){case 0:case 11:case 15:ti(e,n,l,s),d&2048&&rs(9,n);break;case 1:ti(e,n,l,s);break;case 3:ti(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&&Ga(d)));break;case 12:if(d&2048){ti(e,n,l,s),d=n.stateNode;try{var b=n.memoizedProps,E=b.id,_=b.onPostCommit;typeof _=="function"&&_(E,n.alternate===null?"mount":"update",d.passiveEffectDuration,-0)}catch(H){Rt(n,n.return,H)}}else ti(e,n,l,s);break;case 31:ti(e,n,l,s);break;case 13:ti(e,n,l,s);break;case 23:break;case 22:b=n.stateNode,E=n.alternate,n.memoizedState!==null?(f&&E!==null&&E.memoizedState===null&&Go(E),b._visibility&2?ti(e,n,l,s):ss(e,n)):(f&&E!==null&&E.memoizedState!==null&&Go(n),b._visibility&2?ti(e,n,l,s):(b._visibility|=2,ta(e,n,l,s,(n.subtreeFlags&10256)!==0||!1))),d&2048&&zf(E,n);break;case 24:ti(e,n,l,s),d&2048&&Mf(n.alternate,n);break;case 30:f&&(d=n.alternate,d!==null&&(ki(d.child,!0),ki(n.child,!0))),ti(e,n,l,s);break;default:ti(e,n,l,s)}}function ta(e,n,l,s,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var d=e,b=n,E=l,_=s,H=b.flags;switch(b.tag){case 0:case 11:case 15:ta(d,b,E,_,f),rs(8,b);break;case 23:break;case 22:var $=b.stateNode;b.memoizedState!==null?$._visibility&2?ta(d,b,E,_,f):ss(d,b):($._visibility|=2,ta(d,b,E,_,f)),f&&H&2048&&zf(b.alternate,b);break;case 24:ta(d,b,E,_,f),f&&H&2048&&Mf(b.alternate,b);break;default:ta(d,b,E,_,f)}n=n.sibling}}function ss(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:ss(l,s),f&2048&&zf(s.alternate,s);break;case 24:ss(l,s),f&2048&&Mf(s.alternate,s);break;default:ss(l,s)}n=n.sibling}}var cl=8192;function fl(e,n,l){if(e.subtreeFlags&cl)for(e=e.child;e!==null;)zy(e,n,l),e=e.sibling}function zy(e,n,l){switch(e.tag){case 26:fl(e,n,l),e.flags&cl&&(e.memoizedState!==null?VS(l,ui,e.memoizedState,e.memoizedProps):(e=e.stateNode,(n&335544128)===n&&Hg(l,e)));break;case 5:fl(e,n,l),e.flags&cl&&(e=e.stateNode,(n&335544128)===n&&Hg(l,e));break;case 3:case 4:var s=ui;ui=ps(e.stateNode.containerInfo),fl(e,n,l),ui=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=cl,cl=16777216,fl(e,n,l),cl=s):fl(e,n,l));break;case 30:if((e.flags&cl)!==0&&(s=e.memoizedProps.name,s!=null&&s!=="auto")){var f=e.stateNode;f.paired=null,Dn===null&&(Dn=new Map),Dn.set(s,f)}fl(e,n,l);break;default:fl(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 os(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];sn=s,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:os(e),e.flags&2048&&kr(9,e,e.return);break;case 3:os(e);break;case 12:os(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Zo(e)):os(e);break;default:os(e)}}function Zo(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];sn=s,Dy(s,e)}My(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:kr(8,n,n.return),Zo(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,Zo(n));break;default:Zo(n)}e=e.sibling}}function Dy(e,n){for(;sn!==null;){var l=sn;switch(l.tag){case 0:case 11:case 15:kr(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:Ga(l.memoizedState.cache)}if(s=l.child,s!==null)s.return=l,sn=s;else e:for(l=e;sn!==null;){s=sn;var f=s.sibling,d=s.return;if(jy(s),s===l){sn=null;break e}if(f!==null){f.return=d,sn=f;break e}sn=d}}}var Lw={getCacheForType:function(e){var n=un(Jt),l=n.data.get(e);return l===void 0&&(l=e(),n.data.set(e,l)),l},cacheSignal:function(){return un(Jt).controller.signal}},Bw=typeof WeakMap=="function"?WeakMap:Map,kt=0,qt=null,lt=null,ut=0,At=0,Ln=null,jr=!1,na=!1,qf=!1,Ji=0,Xt=0,Tr=0,dl=0,Ko=0,Bn=0,ia=0,us=null,Nn=null,Df=!1,Jo=0,Ly=0,Po=1/0,Wo=null,Nr=null,Gt=0,fi=null,hl=null,Ni=0,Lf=0,Bf=null,By=null,ra=null,la=null,aa=null,cs=0,eu=null;function Un(){return(kt&2)!==0&&ut!==0?ut&-ut:K.T!==null?Qf():Al()}function Uy(){if(Bn===0)if((ut&536870912)===0||tt){var e=li;li<<=1,(li&3932160)===0&&(li=262144),Bn=e}else Bn=536870912;return e=cn.current,e!==null&&(e.flags|=32),Bn}function sa(e,n){if(n!=null){var l=e.stateNode,s=l.ref;s===null&&(s=l.ref=bg(Ii(e.memoizedProps,l))),la===null&&(la=[]),la.push(n.bind(null,s))}}function Cn(e,n,l){(e===qt&&(At===2||At===9)||e.cancelPendingCommit!==null)&&(oa(e,0),Cr(e,ut,Bn,!1)),Hr(e,l),((kt&2)===0||e!==qt)&&(e===qt&&((kt&2)===0&&(dl|=l),Xt===4&&Cr(e,ut,Bn,!1)),Ci(e))}function Hy(e,n,l){if((kt&6)!==0)throw Error(a(327));var s=!l&&(n&127)===0&&(n&e.expiredLanes)===0||nr(e,n),f=s?Iw(e,n):Hf(e,n,!0),d=s;do{if(f===0){na&&!s&&Cr(e,n,0,!1);break}else{if(l=e.current.alternate,d&&!Uw(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 E=e;f=us;var _=E.current.memoizedState.isDehydrated;if(_&&(oa(E,b).flags|=256),b=Hf(E,b,!1),b!==2&&b!==6){if(qf&&!_){E.errorRecoveryDisabledLanes|=d,dl|=d,f=4;break e}d=Nn,Nn=f,d!==null&&(Nn===null?Nn=d:Nn.push.apply(Nn,d))}f=b}if(d=!1,f!==2)continue}}if(f===1){oa(e,0),Cr(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:Cr(s,n,Bn,!jr);break e;case 2:Nn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(f=Jo+300-Nt(),10<f)){if(Cr(s,n,Bn,!jr),Tl(s,0,!0)!==0)break e;Ni=n,s.timeoutHandle=ld(Iy.bind(null,s,l,Nn,Wo,Df,n,Bn,dl,ia,jr,d,"Throttled",-0,0),f);break e}Iy(s,l,Nn,Wo,Df,n,Bn,dl,ia,jr,d,null,-0,0)}}break}while(!0);Ci(e)}function Iy(e,n,l,s,f,d,b,E,_,H,$,ne,B,G){e.timeoutHandle=-1;var Se=n.subtreeFlags,Re=(d&335544064)===d;if(ne=null,(Re||Se&8192||(Se&16785408)===16785408)&&(ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xn},Dn=null,zy(n,d,ne),Re&&(Se=ne,Re=e.containerInfo,Re=(Re.nodeType===9?Re:Re.ownerDocument).__reactViewTransition,Re!=null&&(Se.count++,Se.waitingForViewTransition=!0,Se=vs.bind(Se),Re.finished.then(Se,Se))),Se=(d&62914560)===d?Jo-Nt():(d&4194048)===d?Ly-Nt():0,Se=YS(ne,Se),Se!==null)){Ni=d,e.cancelPendingCommit=Se(Zy.bind(null,e,n,d,l,s,f,b,E,_,H,$,ne,null,B,G)),Cr(e,d,b,!H);return}Zy(e,n,d,l,s,f,b,E,_,H,$,ne)}function Uw(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(!Mn(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 Cr(e,n,l,s){n=$s(e,n),n&=~Ko,n&=~dl,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&&Aa(e,l,n)}function tu(){return(kt&6)===0?(fs(0),!1):!0}function Uf(){if(lt!==null){if(At===0)var e=lt.return;else e=lt,Gi=el=null,$c(e),Ql=null,Qa=0,e=lt;for(;e!==null;)cy(e.alternate,e),e=e.return;lt=null}}function oa(e,n){var l=e.timeoutHandle;return l!==-1&&(e.timeoutHandle=-1,uS(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Ni=0,Uf(),qt=e,lt=l=Yi(e.current,null),ut=n,At=0,Ln=null,jr=!1,na=nr(e,n),qf=!1,ia=Bn=Ko=dl=Tr=Xt=0,Nn=us=null,Df=!1,Ji=$s(e,n),oo(),l}function Vy(e,n){Xe=null,K.H=Mo,n===Xl||n===xo?(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,Ln=n,lt===null&&(Xt=1,qo(e,Jn(n,e.current)))}function Yy(){var e=cn.current;return e===null?!0:(ut&4194048)===ut?bn===null:(ut&62914560)===ut||(ut&536870912)!==0?e===bn:!1}function Fy(){var e=K.H;return K.H=Mo,e===null?Mo:e}function Gy(){var e=K.A;return K.A=Lw,e}function nu(){Xt=4,jr||(ut&4194048)!==ut&&cn.current!==null||(na=!0),(Tr&134217727)===0&&(dl&134217727)===0||qt===null||Cr(qt,ut,Bn,!1)}function Hf(e,n,l){var s=kt;kt|=2;var f=Fy(),d=Gy();(qt!==e||ut!==n)&&(Wo=null,oa(e,n)),n=!1;var b=Xt;e:do try{if(At!==0&<!==null){var E=lt,_=Ln;switch(At){case 8:Uf(),b=6;break e;case 3:case 2:case 9:case 6:cn.current===null&&(n=!0);var H=At;if(At=0,Ln=null,ua(e,E,_,H),l&&na){b=0;break e}break;default:H=At,At=0,Ln=null,ua(e,E,_,H)}}Hw(),b=Xt;break}catch($){Vy(e,$)}while(!0);return n&&e.shellSuspendCounter++,Gi=el=null,kt=s,K.H=f,K.A=d,lt===null&&(qt=null,ut=0,oo()),b}function Hw(){for(;lt!==null;)$y(lt)}function Iw(e,n){var l=kt;kt|=2;var s=Fy(),f=Gy();qt!==e||ut!==n?(Wo=null,Po=Nt()+500,oa(e,n)):na=nr(e,n);e:do try{if(At!==0&<!==null){n=lt;var d=Ln;t:switch(At){case 1:At=0,Ln=null,ua(e,n,d,1);break;case 2:case 9:if(Xm(d)){At=0,Ln=null,Xy(n);break}n=function(){At!==2&&At!==9||qt!==e||(At=7),Ci(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,Ln=null,Xy(n)):(At=0,Ln=null,ua(e,n,d,7));break;case 5:var b=null;switch(lt.tag){case 26:b=lt.memoizedState;case 5:case 27:var E=lt;if(b?Bg(b):E.stateNode.complete){At=0,Ln=null;var _=E.sibling;if(_!==null)lt=_;else{var H=E.return;H!==null?(lt=H,iu(H)):lt=null}break t}}At=0,Ln=null,ua(e,n,d,5);break;case 6:At=0,Ln=null,ua(e,n,d,6);break;case 8:Uf(),Xt=6;break e;default:throw Error(a(462))}}Vw();break}catch($){Vy(e,$)}while(!0);return Gi=el=null,K.H=s,K.A=f,kt=l,lt!==null?0:(qt=null,ut=0,oo(),Xt)}function Vw(){for(;lt!==null&&!vt();)$y(lt)}function $y(e){var n=oy(e.alternate,e,Ji);e.memoizedProps=e.pendingProps,n===null?iu(e):lt=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,ut);break;case 11:n=ty(l,n,n.pendingProps,n.type.render,n.ref,ut);break;case 5:$c(n);var s=n;s===ln&&(tt?(po(s),s.tag===5&&s.stateNode!=null&&(Ht=s.stateNode)):(po(s),tt=!0));default:cy(l,n),n=lt=Dm(n,Ji),n=oy(l,n,Ji)}e.memoizedProps=e.pendingProps,n===null?iu(e):lt=n}function ua(e,n,l,s){Gi=el=null,$c(n),Ql=null,Qa=0;var f=n.return;try{if(Aw(e,f,n,l,ut)){Xt=1,qo(e,Jn(l,e.current)),lt=null;return}}catch(d){if(f!==null)throw lt=f,d;Xt=1,qo(e,Jn(l,e.current)),lt=null;return}n.flags&32768?(tt||s===1?e=!0:na||(ut&536870912)!==0?e=!1:(jr=e=!0,(s===2||s===9||s===3||s===6)&&(s=cn.current,s!==null&&s.tag===13&&(s.flags|=16384))),Qy(n,e)):iu(n)}function iu(e){var n=e;do{if((n.flags&32768)!==0){Qy(n,jr);return}e=n.return;var l=zw(n.alternate,n,Ji);if(l!==null){lt=l;return}if(n=n.sibling,n!==null){lt=n;return}lt=n=e}while(n!==null);Xt===0&&(Xt=5)}function Qy(e,n){do{var l=Mw(e.alternate,e);if(l!==null){l.flags&=32767,lt=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(e=e.sibling,e!==null)){lt=e;return}lt=e=l}while(e!==null);Xt=6,lt=null}function Zy(e,n,l,s,f,d,b,E,_,H,$,ne){e.cancelPendingCommit=null;do ru();while(Gt!==0);if((kt&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));e===qt&&(lt=qt=null,ut=0),hl=n,fi=e,Ni=l,Bf=f,By=s,Yw(e,n,l,b,E,_,ne)}}function Yw(e,n,l,s,f,d,b){var E=n.lanes|n.childLanes;if(Lf=E,E|=xc,Nl(e,l,E,s,f,d),la=null,(l&335544064)===l?(aa=gw(e),s=10262):(aa=null,s=10256),(n.subtreeFlags&s)!==0||(n.flags&s)!==0?(e.callbackNode=null,e.callbackPriority=0,Zw(pi,function(){return Ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Yo=!1,s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=K.T,K.T=null,f=de.p,de.p=2,d=kt,kt|=4;try{qw(e,n,l)}finally{kt=d,de.p=f,K.T=s}}Gt=1,Yo?ra=pS(b,e.containerInfo,aa,If,Vf,Gw,Yf,Ff,Fw):(If(),Vf(),Yf())}function Fw(e){if(Gt!==0){var n=fi.onRecoverableError;n(e,{componentStack:null})}}function Gw(){Gt===3&&(Gt=0,_y(hl,fi),Gt=4)}function If(){if(Gt===1){Gt=0;var e=fi,n=hl,l=Ni,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=K.T,K.T=null;var f=de.p;de.p=2;var d=kt;kt|=4;try{as=$o=!1,Ay(n,e,l),l=nd;var b=Tm(e.containerInfo),E=l.focusedElem,_=l.selectionRange;if(b!==E&&E&&E.ownerDocument&&jm(E.ownerDocument.documentElement,E)){if(_!==null&&pc(E)){var H=_.start,$=_.end;if($===void 0&&($=H),"selectionStart"in E)E.selectionStart=H,E.selectionEnd=Math.min($,E.value.length);else{var ne=E.ownerDocument||document,B=ne&&ne.defaultView||window;if(B.getSelection){var G=B.getSelection(),Se=E.textContent.length,Re=Math.min(_.start,Se),Qe=_.end===void 0?Re:Math.min(_.end,Se);!G.extend&&Re>Qe&&(b=Qe,Qe=Re,Re=b);var U=Em(E,Re),D=Em(E,Qe);if(U&&D&&(G.rangeCount!==1||G.anchorNode!==U.node||G.anchorOffset!==U.offset||G.focusNode!==D.node||G.focusOffset!==D.offset)){var Y=ne.createRange();Y.setStart(U.node,U.offset),G.removeAllRanges(),Re>Qe?(G.addRange(Y),G.extend(D.node,D.offset)):(Y.setEnd(D.node,D.offset),G.addRange(Y))}}}}for(ne=[],G=E;G=G.parentNode;)G.nodeType===1&&ne.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<ne.length;E++){var te=ne[E];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}ga=!!td,nd=td=null}finally{kt=d,de.p=f,K.T=s}}e.current=n,Gt=2}}function Vf(){if(Gt===2){Gt=0;var e=fi,n=hl,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=K.T,K.T=null;var s=de.p;de.p=2;var f=kt;kt|=4;try{ky(e,n.alternate,n)}finally{kt=f,de.p=s,K.T=l}}Gt=3}}function Yf(){if(Gt===4||Gt===3){Gt=0;var e=ra;ra=null,xn();var n=fi,l=hl,s=Ni,f=By,d=(s&335544064)===s?10262:10256;if((l.subtreeFlags&d)!==0||(l.flags&d)!==0?Gt=5:(Gt=0,hl=fi=null,Ky(n,n.pendingLanes)),d=n.pendingLanes,d===0&&(Nr=null),Cl(s),l=l.stateNode,ot&&typeof ot.onCommitFiberRoot=="function")try{ot.onCommitFiberRoot(yt,l,void 0,(l.current.flags&128)===128)}catch{}if(f!==null){l=K.T,d=de.p,de.p=2,K.T=null;try{for(var b=n.onRecoverableError,E=0;E<f.length;E++){var _=f[E];b(_.value,{componentStack:_.stack})}}finally{K.T=l,de.p=d}}if(f=la,b=aa,aa=null,f!==null&&(la=null,b===null&&(b=[]),e!==null))for(_=0;_<f.length;_++)l=(0,f[_])(b),l!==void 0&&e.finished.finally(l);(Ni&3)!==0&&ru(),Ci(n),d=n.pendingLanes,(s&261930)!==0&&(d&42)!==0?n===eu?cs++:(cs=0,eu=n):(cs=0,eu=null),fs(0)}}function Ky(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Ga(n)))}function ru(){return ra!==null&&(ra.skipTransition(),ra=null),If(),Vf(),Yf(),Ff()}function Ff(){if(Gt!==5)return!1;var e=fi,n=Lf;Lf=0;var l=Cl(Ni),s=K.T,f=de.p;try{de.p=32>l?32:l,K.T=null,l=Bf,Bf=null;var d=fi,b=Ni;if(Gt=0,hl=fi=null,Ni=0,(kt&6)!==0)throw Error(a(331));var E=kt;if(kt|=4,qy(d.current),Oy(d,d.current,b,l),kt=E,fs(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(yt,d)}catch{}return!0}finally{de.p=f,K.T=s,Ky(e,n)}}function Jy(e,n,l){n=Jn(l,n),n=sf(e.stateNode,n,2),e=br(e,n,2),e!==null&&(Hr(e,2),Ci(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"&&(Nr===null||!Nr.has(s))){e=Jn(l,e),l=Xp(2),s=br(n,l,2),s!==null&&(Qp(l,s,n,e),Hr(s,2),Ci(s));break}}n=n.return}}function Gf(e,n,l){var s=e.pingCache;if(s===null){s=e.pingCache=new Bw;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=$w.bind(null,e,n,l),n.then(e,e))}function $w(e,n,l){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,qt===e&&(ut&l)===l&&((Xt===4||Xt===3&&(ut&62914560)===ut&&300>Nt()-Jo)&&(kt&2)===0?oa(e,0):Ko|=l,ia===ut&&(ia=0)),Ci(e)}function Py(e,n){n===0&&(n=Xs()),e=Jr(e,n),e!==null&&(Hr(e,n),Ci(e))}function Xw(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),Py(e,l)}function Qw(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 Zw(e,n){return st(e,n)}var ca=null,fa=null,$f=!1,lu=!1,Xf=!1,Ar=0;function Ci(e){e!==fa&&e.next===null&&(fa===null?ca=fa=e:fa=fa.next=e),lu=!0,$f||($f=!0,Jw())}function fs(e,n){if(!Xf&&lu){Xf=!0;do for(var l=!1,s=ca;s!==null;){if(e!==0){var f=s.pendingLanes;if(f===0)var d=0;else{var b=s.suspendedLanes,E=s.pingedLanes;d=(1<<31-jt(42|e)+1)-1,d&=f&~(b&~E),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(l=!0,ng(s,d))}else d=ut,d=Tl(s,s===qt?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||nr(s,d)||(l=!0,ng(s,d));s=s.next}while(l);Xf=!1}}function Kw(){Wy()}function Wy(){lu=$f=!1;var e=0;Ar!==0&&oS()&&(e=Ar);for(var n=Nt(),l=null,s=ca;s!==null;){var f=s.next,d=eg(s,n);d===0?(s.next=null,l===null?ca=f:l.next=f,f===null&&(fa=l)):(l=s,(e!==0||(d&3)!==0)&&(lu=!0)),s=f}Gt!==0&&Gt!==5||fs(e),Ar!==0&&(Ar=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),E=1<<b,_=f[b];_===-1?((E&l)===0||(E&s)!==0)&&(f[b]=ac(E,n)):_<=n&&(e.expiredLanes|=E),d&=~E}if(n=qt,l=ut,l=Tl(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||nr(e,l)){if(n=l&-l,n===e.callbackPriority)return n;switch(s!==null&&bt(s),Cl(l)){case 2:case 8:l=Ft;break;case 32:l=pi;break;case 268435456:l=Z;break;default:l=pi}return s=tg.bind(null,e),l=st(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(ru()&&e.callbackNode!==l)return null;var s=ut;return s=Tl(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(ru())return null;Hy(e,n,!0)}function Jw(){cS(function(){(kt&6)!==0?st(pt,Kw):Wy()})}function Qf(){if(Ar===0){var e=il;e===0&&(e=zi,zi<<=1,(zi&261888)===0&&(zi=256)),Ar=e}return Ar}function ig(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Xr(e)}function Pw(e,n,l,s,f){if(n==="submit"&&l&&l.stateNode===f){var d=ig((f[on]||null).action),b=s.submitter;b&&(n=(n=b[on]||null)?ig(n.formAction):b.getAttribute("formAction"),n!==null&&(d=n,b=null));var E=new St("action","action",null,s,f);e.push({event:E,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Ar!==0){var _=new FormData(f,b);tf(l,{pending:!0,data:_,method:f.method,action:d},null,_)}}else typeof d=="function"&&(E.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],Ww=Kf.toLowerCase(),eS=Kf[0].toUpperCase()+Kf.slice(1);si(Ww,"on"+eS)}si(Am,"onAnimationEnd"),si(Rm,"onAnimationIteration"),si(_m,"onAnimationStart"),si("dblclick","onDoubleClick"),si("focusin","onFocus"),si("focusout","onBlur"),si(uw,"onTransitionRun"),si(cw,"onTransitionStart"),si(fw,"onTransitionCancel"),si(Om,"onTransitionEnd"),lr("onMouseEnter",["mouseout","mouseover"]),lr("onMouseLeave",["mouseout","mouseover"]),lr("onPointerEnter",["pointerout","pointerover"]),lr("onPointerLeave",["pointerout","pointerover"]),Ui("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ui("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ui("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ui("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ui("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ui("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ds="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(" "),tS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ds));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 E=s[b],_=E.instance,H=E.currentTarget;if(E=E.listener,_!==d&&f.isPropagationStopped())break e;d=E,f.currentTarget=H;try{d(f)}catch($){so($)}f.currentTarget=null,d=_}else for(b=0;b<s.length;b++){if(E=s[b],_=E.instance,H=E.currentTarget,E=E.listener,_!==d&&f.isPropagationStopped())break e;d=E,f.currentTarget=H;try{d(f)}catch($){so($)}f.currentTarget=null,d=_}}}}function at(e,n){var l=n[Rl];l===void 0&&(l=n[Rl]=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 au="_reactListening"+Math.random().toString(36).slice(2);function Pf(e){if(!e[au]){e[au]=!0,Ol.forEach(function(l){l!=="selectionchange"&&(tS.has(l)||Jf(l,!1,e),Jf(l,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[au]||(n[au]=!0,Jf("selectionchange",!1,n))}}function lg(e,n,l,s){switch(Qg(n)){case 2:var f=XS;break;case 8:f=QS;break;default:f=vd}l=f.bind(null,n,l,e),f=void 0,!Ll||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 E=s.stateNode.containerInfo;if(E===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(;E!==null;){if(b=ai(E),b===null)return;if(_=b.tag,_===5||_===6||_===26||_===27){s=d=b;continue e}E=E.parentNode}}s=s.return}ro(function(){var H=d,$=Dl(l),ne=[];e:{var B=zm.get(e);if(B!==void 0){var G=St,Se=e;switch(e){case"keypress":if(je(l)===0)break e;case"keydown":case"keyup":G=U1;break;case"focusin":Se="focus",G=uc;break;case"focusout":Se="blur",G=uc;break;case"beforeblur":case"afterblur":G=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":G=om;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=N1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=F1;break;case Am:case Rm:case _m:G=R1;break;case Om:G=$1;break;case"scroll":case"scrollend":G=Vt;break;case"wheel":G=Q1;break;case"copy":case"cut":case"paste":G=O1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=cm;break;case"submit":G=V1;break;case"toggle":case"beforetoggle":G=K1}var Re=(n&4)!==0,Qe=!Re&&(e==="scroll"||e==="scrollend"),U=Re?B!==null?B+"Capture":null:B;Re=[];for(var D=H,Y;D!==null;){var te=D;if(Y=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||Y===null||U===null||(te=fr(D,U),te!=null&&Re.push(hs(D,te,Y))),Qe)break;D=D.return}0<Re.length&&(B=new G(B,Se,null,l,$),ne.push({event:B,listeners:Re}))}}if((n&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",B=e==="mouseout"||e==="pointerout",G&&l!==ql&&(Se=l.relatedTarget||l.fromElement)&&(ai(Se)||Se[yi]))break e;(B||G)&&(Se=$.window===$?$:(G=$.ownerDocument)?G.defaultView||G.parentWindow:window,B?(G=l.relatedTarget||l.toElement,B=H,G=G?ai(G):null,G!==null&&(Qe=u(G),Re=G.tag,G!==Qe||Re!==5&&Re!==27&&Re!==6)&&(G=null)):(B=null,G=H),B!==G&&(Re=om,te="onMouseLeave",U="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(Re=cm,te="onPointerLeave",U="onPointerEnter",D="pointer"),Qe=B==null?Se:Bi(B),Y=G==null?Se:Bi(G),Se=new Re(te,D+"leave",B,l,$),Se.target=Qe,Se.relatedTarget=Y,te=null,ai($)===H&&(Re=new Re(U,D+"enter",G,l,$),Re.target=Y,Re.relatedTarget=Qe,te=Re),Qe=te,Re=B&&G?A(B,G,nS):null,B!==null&&ag(ne,Se,B,Re,!1),G!==null&&Qe!==null&&ag(ne,Qe,G,Re,!0)))}e:{if(B=H?Bi(H):window,G=B.nodeName&&B.nodeName.toLowerCase(),G==="select"||G==="input"&&B.type==="file")var Ce=vm;else if(ym(B))if(bm)Ce=aw;else{Ce=rw;var ct=iw}else G=B.nodeName,!G||G.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?H&&Ml(H.elementType)&&(Ce=vm):Ce=lw;if(Ce&&(Ce=Ce(e,H))){gm(ne,Ce,l,$);break e}ct&&ct(e,B,H)}switch(ct=H?Bi(H):window,e){case"focusin":(ym(ct)||ct.contentEditable==="true")&&(Ul=ct,yc=H,Va=null);break;case"focusout":Va=yc=Ul=null;break;case"mousedown":gc=!0;break;case"contextmenu":case"mouseup":case"dragend":gc=!1,Nm(ne,l,$);break;case"selectionchange":if(ow)break;case"keydown":case"keyup":Nm(ne,l,$)}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 Bl?mm(e,l)&&(Ye="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ye="onCompositionStart");Ye&&(fm&&l.locale!=="ko"&&(Bl||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&Bl&&(qe=_e()):(I=$,J="value"in I?I.value:I.textContent,Bl=!0)),ct=su(H,Ye),0<ct.length&&(Ye=new um(Ye,e,null,l,$),ne.push({event:Ye,listeners:ct}),qe?Ye.data=qe:(qe=pm(l),qe!==null&&(Ye.data=qe)))),(qe=P1?W1(e,l):ew(e,l))&&(Ye=su(H,"onBeforeInput"),0<Ye.length&&(ct=new um("onBeforeInput","beforeinput",null,l,$),ne.push({event:ct,listeners:Ye}),ct.data=qe)),Pw(ne,e,H,l,$)}rg(ne,n)})}function hs(e,n,l){return{instance:e,listener:n,currentTarget:l}}function su(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=fr(e,l),f!=null&&s.unshift(hs(e,f,d)),f=fr(e,n),f!=null&&s.push(hs(e,f,d))),e.tag===3)return s;e=e.return}return[]}function nS(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 E=l,_=E.alternate,H=E.stateNode;if(E=E.tag,_!==null&&_===s)break;E!==5&&E!==26&&E!==27||H===null||(_=H,f?(H=fr(l,d),H!=null&&b.unshift(hs(l,H,_))):f||(H=fr(l,d),H!=null&&b.push(hs(l,H,_)))),l=l.return}b.length!==0&&e.push({event:n,listeners:b})}var iS=/\r\n?/g,rS=/\u0000|\uFFFD/g;function sg(e){return(typeof e=="string"?e:""+e).replace(iS,`
|
|
10
|
-
`).replace(rS,"")}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===""||Hi(e,s);else if(typeof s=="number"||typeof s=="bigint")n!=="body"&&Hi(e,""+s);else return;break;case"className":sr(e,"class",s);break;case"tabIndex":sr(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":sr(e,l,s);break;case"style":qa(e,s,d);return;case"data":if(n!=="object"){sr(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=Xr(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=Xr(s),e.setAttribute(l,s);break;case"onClick":s!=null&&(e.onclick=Xn);return;case"onScroll":s!=null&&at("scroll",e);return;case"onScrollEnd":s!=null&&at("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=Xr(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":at("beforetoggle",e),at("toggle",e),nn(e,"popover",s);break;case"xlinkActuate":Gn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Gn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Gn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Gn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Gn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Gn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":nn(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=oc.get(l)||l,nn(e,l,s);else return}dt=!0}function ed(e,n,l,s,f,d){switch(l){case"style":qa(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")Hi(e,s);else if(typeof s=="number"||typeof s=="bigint")Hi(e,""+s);else return;break;case"onScroll":s!=null&&at("scroll",e);return;case"onScrollEnd":s!=null&&at("scrollend",e);return;case"onClick":s!=null&&(e.onclick=Xn);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Fr.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[on]||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}dt=!0,l in e?e[l]=s:s===!0?e.setAttribute(l,""):nn(e,l,s)}return}dt=!0}function hn(e,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":at("error",e),at("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":at("invalid",e);var E=d=b=f=null,_=null,H=null;for(s in l)if(l.hasOwnProperty(s)){var $=l[s];if($!=null)switch(s){case"name":f=$;break;case"type":b=$;break;case"checked":_=$;break;case"defaultChecked":H=$;break;case"value":d=$;break;case"defaultValue":E=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(a(137,n));break;default:_t(e,n,s,$,l,null)}}za(e,d,E,_,H,b,f,!1);return;case"select":at("invalid",e),s=b=d=null;for(f in l)if(l.hasOwnProperty(f)&&(E=l[f],E!=null))switch(f){case"value":d=E;break;case"defaultValue":b=E;break;case"multiple":s=E;default:_t(e,n,f,E,l,null)}n=d,l=b,e.multiple=!!s,n!=null?vi(e,!!s,n,!1):l!=null&&vi(e,!!s,l,!0);return;case"textarea":at("invalid",e),d=f=s=null;for(b in l)if(l.hasOwnProperty(b)&&(E=l[b],E!=null))switch(b){case"value":s=E;break;case"defaultValue":f=E;break;case"children":d=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(a(91));break;default:_t(e,n,b,E,l,null)}to(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":at("beforetoggle",e),at("toggle",e),at("cancel",e),at("close",e);break;case"iframe":case"object":at("load",e);break;case"video":case"audio":for(s=0;s<ds.length;s++)at(ds[s],e);break;case"image":at("error",e),at("load",e);break;case"details":at("toggle",e);break;case"embed":case"source":case"link":at("error",e),at("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(H in l)if(l.hasOwnProperty(H)&&(s=l[H],s!=null))switch(H){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:_t(e,n,H,s,l,null)}return;default:if(Ml(n)){for($ in l)l.hasOwnProperty($)&&(s=l[$],s!==void 0&&ed(e,n,$,s,l,void 0));return}}for(E in l)l.hasOwnProperty(E)&&(s=l[E],s!=null&&_t(e,n,E,s,l,null))}var lS={};function aS(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,E=null,_=null,H=null,$=null;for(G in l){var ne=l[G];if(l.hasOwnProperty(G)&&ne!=null)switch(G){case"checked":break;case"value":break;case"defaultValue":_=ne;default:s.hasOwnProperty(G)||_t(e,n,G,null,s,ne)}}for(var B in s){var G=s[B];if(ne=l[B],s.hasOwnProperty(B)&&(G!=null||ne!=null))switch(B){case"type":G!==ne&&(dt=!0),d=G;break;case"name":G!==ne&&(dt=!0),f=G;break;case"checked":G!==ne&&(dt=!0),H=G;break;case"defaultChecked":G!==ne&&(dt=!0),$=G;break;case"value":G!==ne&&(dt=!0),b=G;break;case"defaultValue":G!==ne&&(dt=!0),E=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(a(137,n));break;default:G!==ne&&_t(e,n,B,G,s,ne)}}$n(e,b,E,_,H,$,d,f);return;case"select":G=b=E=B=null;for(d in l)if(_=l[d],l.hasOwnProperty(d)&&_!=null)switch(d){case"value":break;case"multiple":G=_;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!==_&&(dt=!0),B=d;break;case"defaultValue":d!==_&&(dt=!0),E=d;break;case"multiple":d!==_&&(dt=!0),b=d;default:d!==_&&_t(e,n,f,d,s,_)}n=E,l=b,s=G,B!=null?vi(e,!!l,B,!1):!!s!=!!l&&(n!=null?vi(e,!!l,n,!0):vi(e,!!l,l?[]:"",!1));return;case"textarea":G=B=null;for(E in l)if(f=l[E],l.hasOwnProperty(E)&&f!=null&&!s.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:_t(e,n,E,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&&(dt=!0),B=f;break;case"defaultValue":f!==d&&(dt=!0),G=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)}eo(e,B,G);return;case"option":for(var Se in l)B=l[Se],l.hasOwnProperty(Se)&&B!=null&&!s.hasOwnProperty(Se)&&(Se==="selected"?e.selected=!1:_t(e,n,Se,null,s,B));for(_ in s)B=s[_],G=l[_],s.hasOwnProperty(_)&&B!==G&&(B!=null||G!=null)&&(_==="selected"?(B!==G&&(dt=!0),e.selected=B&&typeof B!="function"&&typeof B!="symbol"):_t(e,n,_,B,s,G));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)B=l[Re],l.hasOwnProperty(Re)&&B!=null&&!s.hasOwnProperty(Re)&&_t(e,n,Re,null,s,B);for(H in s)if(B=s[H],G=l[H],s.hasOwnProperty(H)&&B!==G&&(B!=null||G!=null))switch(H){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(a(137,n));break;default:_t(e,n,H,B,s,G)}return;default:if(Ml(n)){for(var Qe in l)B=l[Qe],l.hasOwnProperty(Qe)&&B!==void 0&&!s.hasOwnProperty(Qe)&&ed(e,n,Qe,void 0,s,B);for($ in s)B=s[$],G=l[$],!s.hasOwnProperty($)||B===G||B===void 0&&G===void 0||ed(e,n,$,B,s,G);return}}for(var U in l)B=l[U],l.hasOwnProperty(U)&&B!=null&&!s.hasOwnProperty(U)&&_t(e,n,U,null,s,B);for(ne in s)B=s[ne],G=l[ne],!s.hasOwnProperty(ne)||B===G||B==null&&G==null||_t(e,n,ne,B,s,G)}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 sS(){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,E=f.duration;if(d&&E&&ug(b)){for(b=0,E=f.responseEnd,s+=1;s<l.length;s++){var _=l[s],H=_.startTime;if(H>E)break;var $=_.transferSize,ne=_.initiatorType;$&&ug(ne)&&(_=_.responseEnd,b+=$*(_<E?1:(E-H)/(_-H)))}if(--s,n+=8*(d+b)/(f.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var td=null,nd=null;function ms(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=ms(l).createElement(e),l[Zt]=s,l[on]=n,hn(l,e,n),Ut(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 oS(){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,uS=typeof clearTimeout=="function"?clearTimeout:void 0,hg=typeof Promise=="function"?Promise:void 0,mg=typeof requestAnimationFrame=="function"?requestAnimationFrame:ld,cS=typeof queueMicrotask=="function"?queueMicrotask:typeof hg<"u"?function(e){return hg.resolve(null).then(e).catch(fS)}:ld;function fS(e){setTimeout(function(){throw e})}function Rr(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),va(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,E=d.nodeName;d[Di]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&d.rel.toLowerCase()==="stylesheet"||l.removeChild(d),d=b}}else l==="body"&&hd(e.ownerDocument.body);l=f}while(l);va(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 dS(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 dS(n,l,e)}function hS(e){return e.documentElement.clientHeight}function mS(e){this.addEventListener("load",e),this.addEventListener("error",e)}function pS(e,n,l,s,f,d,b,E,_){var H=n.nodeType===9?n:n.ownerDocument;try{var $=H.startViewTransition({update:function(){var B=H.defaultView,G=B.navigation&&B.navigation.transition,Se=H.fonts.status;s();var Re=[];if(Se==="loaded"&&(hS(H),H.fonts.status==="loading"&&Re.push(H.fonts.ready)),Se=Re.length,e!==null)for(var Qe=e.suspenseyImages,U=0,D=0;D<Qe.length;D++){var Y=Qe[D];if(!Y.complete){var te=Y.getBoundingClientRect();if(0<te.bottom&&0<te.right&&te.top<B.innerHeight&&te.left<B.innerWidth){if(U+=Ug(Y),U>cu){Re.length=Se;break}Y=new Promise(mS.bind(Y)),Re.push(Y)}}}if(0<Re.length)return B=Promise.race([Promise.all(Re),new Promise(function(Ce){return setTimeout(Ce,500)})]).then(f,f),(G?Promise.allSettled([G.finished,B]):B).then(d,d);if(f(),G)return G.finished.then(d,d);d()},types:l});H.__reactViewTransition=$;var ne=[];return $.ready.then(function(){for(var B=H.documentElement.getAnimations({subtree:!0}),G=0;G<B.length;G++){var Se=B[G],Re=Se.effect,Qe=Re.pseudoElement;if(Qe!=null&&Qe.startsWith("::view-transition")){ne.push(Se),Se=Re.getKeyframes();for(var U=Qe=void 0,D=!0,Y=0;Y<Se.length;Y++){var te=Se[Y],Ce=te.width;if(Qe===void 0)Qe=Ce;else if(Qe!==Ce){D=!1;break}if(Ce=te.height,U===void 0)U=Ce;else if(U!==Ce){D=!1;break}delete te.width,delete te.height,te.transform==="none"&&delete te.transform}D&&Qe!==void 0&&U!==void 0&&(Re.setKeyframes(Se),D=getComputedStyle(Re.target,Re.pseudoElement),D.width!==Qe||D.height!==U)&&(D=Se[0],D.width=Qe,D.height=U,D=Se[Se.length-1],D.width=Qe,D.height=U,Re.setKeyframes(Se))}}b()},function(B){H.__reactViewTransition===$&&(H.__reactViewTransition=null);try{typeof B=="object"&&B!==null&&B.name==="InvalidStateError"&&(B.message==="View transition was skipped because document visibility state is hidden."||B.message==="Skipping view transition because document visibility state has become hidden."||B.message==="Skipping view transition because viewport size changed."||B.message==="Transition was aborted because of invalid state")&&(B=null),B!==null&&_(B)}finally{s(),f(),b()}}),$.finished.finally(function(){for(var B=0;B<ne.length;B++)ne[B].cancel();H.__reactViewTransition===$&&(H.__reactViewTransition=null),E()}),$}catch{return s(),f(),b(),null}}function ml(e,n){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+n+")"}ml.prototype.animate=function(e,n){return n=typeof n=="number"?{duration:n}:F({},n),n.pseudoElement=this._selector,this._scope.animate(e,n)},ml.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},ml.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function bg(e){return{name:e,group:new ml("group",e),imagePair:new ml("image-pair",e),old:new ml("old",e),new:new ml("new",e)}}function Hn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Hn.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,E=n;l!=null&&typeof l!="boolean"&&l.once===!0&&(E=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=da(l),d.push({type:e,listener:n,optionsOrUseCapture:l,attachedListener:E,cleanup:f}),g(this._fragmentFiber.child,!1,yS,e,E,s)}this._eventListeners=d}};function yS(e,n,l,s){return C(e).addEventListener(n,l,s),!1}Hn.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=da(f.optionsOrUseCapture),g(this._fragmentFiber.child,!1,gS,e,l,f),s.splice(n,1),d!==null&&d()}};function gS(e,n,l,s){return C(e).removeEventListener(n,l,s),!1}function da(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}Hn.prototype.dispatchEvent=function(e){var n=w(this._fragmentFiber);if(n===null)return!0;n=C(n);var l=this._eventListeners;if(l!==null&&0<l.length||!e.bubbles){var s=n.nodeType===9?n.createComment(""):document.createTextNode("");if(l)for(var f=0;f<l.length;f++){var d=l[f];s.addEventListener(d.type,d.attachedListener,da(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,da(d.optionsOrUseCapture));return n.removeChild(s),e}return n.dispatchEvent(e)},Hn.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=C(e),AS(e,n))}Hn.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}Hn.prototype.blur=function(){var e=w(this._fragmentFiber);e!==null&&(e=C(e),e=ms(e).activeElement,e!==null&&g(this._fragmentFiber.child,!1,vS,e,void 0,void 0))};function vS(e,n){return e.tag===6?!1:(e=C(e),e===n||e.contains(n)?(n.blur(),!0):!1)}Hn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),g(this._fragmentFiber.child,!1,bS,e,void 0,void 0)};function bS(e,n){return e.tag===6||(e=C(e),n.observe(e)),!1}Hn.prototype.unobserveUsing=function(e){var n=this._observers;if(n!==null&&n.has(e)){n.delete(e),g(this._fragmentFiber.child,!1,xS,e,void 0,void 0);for(var l=n=0;l<di.length;l++){var s=di[l];s.fragmentInstance===this&&s.observer===e?e.unobserve(s.instance):di[n++]=s}di.length=n}};function xS(e,n){return e.tag===6||(e=C(e),n.unobserve(e)),!1}var di=[],od=!1;function wS(e,n,l){di.push({fragmentInstance:e,observer:n,instance:l}),od||(od=!0,RS(function(){od=!1;var s=di;di=[];for(var f=0;f<s.length;f++){var d=s[f];d.observer.unobserve(d.instance)}}))}Hn.prototype.getClientRects=function(){var e=[];return g(this._fragmentFiber.child,!1,SS,e,void 0,void 0),e};function SS(e,n){if(e.tag===6){e=e.stateNode;var l=e.ownerDocument.createRange();l.selectNodeContents(e),n.push.apply(n,l.getClientRects())}else e=C(e),n.push.apply(n,e.getClientRects());return!1}Hn.prototype.getRootNode=function(e){var n=w(this._fragmentFiber);return n===null?this:C(n).getRootNode(e)},Hn.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=C(n);if(l.length===0){if(l=s,x(this._fragmentFiber)){e:{for(n=this._fragmentFiber.return;n!==null;){if(n.tag===4){n=n.stateNode.containerInfo;break e}if(n.tag===3||n.tag===5||n.tag===27)break;n=n.return}n=null}n!=null&&(l=n)}n=this._fragmentFiber;var f=s=l.compareDocumentPosition(e);return l===e?f=Node.DOCUMENT_POSITION_CONTAINS:s&Node.DOCUMENT_POSITION_CONTAINED_BY&&(l=S(n)[1],l===null?f=Node.DOCUMENT_POSITION_PRECEDING:(e=C(l).compareDocumentPosition(e),f=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),f|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}n=C(l[0]),f=C(l[l.length-1]);var d=x(this._fragmentFiber)?n.parentElement:s;if(d==null)return Node.DOCUMENT_POSITION_DISCONNECTED;s=d.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_CONTAINED_BY,d=d.compareDocumentPosition(f)&Node.DOCUMENT_POSITION_CONTAINED_BY;var b=n.compareDocumentPosition(e),E=f.compareDocumentPosition(e),_=b&Node.DOCUMENT_POSITION_CONTAINED_BY||E&Node.DOCUMENT_POSITION_CONTAINED_BY;return E=s&&d&&b&Node.DOCUMENT_POSITION_FOLLOWING&&E&Node.DOCUMENT_POSITION_PRECEDING,n=s&&n===e||d&&f===e||_||E?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||kS(n,this._fragmentFiber,l[0],l[l.length-1],e)?n:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function kS(e,n,l,s,f){var d=ai(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,ie),n===null?n=!1:(g(n,!0,L,d,l),d=k,k=null,n=d!==null)),n):e&Node.DOCUMENT_POSITION_FOLLOWING?((n=!!d)&&!(n=d===s)&&(n=A(s,d,ie),n===null?n=!1:(g(n,!0,P,d,s),d=k,M=k=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)}Hn.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=C(s),kg(e,l);return}if(s=C(s),s.nodeType!==9){if(s.nodeType===11){l="host"in s?s.host:null,l!==null&&l.scrollIntoView(e);return}s.scrollIntoView(e)}}for(s=l?n.length-1:0;s!==(l?-1:n.length);){var f=n[s];f.tag===6?(f=C(f),kg(f,l)):C(f).scrollIntoView(e),s+=l?-1:1}};function ES(e,n){return e=C(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,da(f.optionsOrUseCapture))}e.nodeType!==3&&(l=n._observers,l!==null&&l.forEach(function(d){for(var b=0,E=0;E<di.length;E++){var _=di[E];(_.fragmentInstance!==n||_.observer!==d||_.instance!==e)&&(di[b++]=_)}di.length=b,d.observe(e)}),Eg(e,n))}function jS(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,da(f.optionsOrUseCapture))}e.nodeType!==3&&(l=n._observers,l!==null&&l.forEach(function(d){typeof d.rootMargin=="string"?wS(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),Li(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function TS(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[Di])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=ni(e.nextSibling),e===null)break}return null}function NS(e,n,l){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=ni(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=ni(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 CS(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 ni(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 ni(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 AS(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 RS(e){mg(function(){mg(function(n){return e(n)})})}function Ag(e,n,l){switch(n=ms(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,lS,f)}l.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Xn&&(e.onclick=null),Li(e)}function hd(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Li(e)}var ii=new Map,_g=new Set;function ps(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 Pi=de.d;de.d={f:_S,r:OS,D:zS,C:MS,L:qS,m:DS,X:BS,S:LS,M:US};function _S(){var e=Pi.f(),n=tu();return e||n}function OS(e){var n=Fn(e);n!==null&&n.tag===5&&n.type==="form"?zp(n):Pi.r(e)}var ha=typeof document>"u"?null:document;function Og(e,n,l){var s=ha;if(s&&typeof n=="string"&&n){var f=vn(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"),hn(n,"link",e),Ut(n),s.head.appendChild(n)))}}function zS(e){Pi.D(e),Og("dns-prefetch",e,null)}function MS(e,n){Pi.C(e,n),Og("preconnect",e,n)}function qS(e,n,l){Pi.L(e,n,l);var s=ha;if(s&&e&&n){var f='link[rel="preload"][as="'+vn(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+vn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+vn(l.imageSizes)+'"]')):f+='[href="'+vn(e)+'"]';var d=f;switch(n){case"style":d=ma(e);break;case"script":d=pa(e)}if(!(ii.has(d)||(e=F({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:e,as:n},l),ii.set(d,e),s.querySelector(f)!==null||n==="style"&&s.querySelector(ys(d))||n==="script"&&s.querySelector(gs(d))))){var b=s.createElement("link");hn(b,"link",e),n==="style"&&(b[Yr]=!0,b.onload=b.onerror=function(){Ks(b)}),Ut(b),s.head.appendChild(b)}}}function DS(e,n){Pi.m(e,n);var l=ha;if(l&&e){var s=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+vn(s)+'"][href="'+vn(e)+'"]',d=f;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=pa(e)}if(!ii.has(d)&&(e=F({rel:"modulepreload",href:e},n),ii.set(d,e),l.querySelector(f)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(gs(d)))return}s=l.createElement("link"),hn(s,"link",e),Ut(s),l.head.appendChild(s)}}}function LS(e,n,l){Pi.S(e,n,l);var s=ha;if(s&&e){var f=rr(s).hoistableStyles,d=ma(e);n=n||"default";var b=f.get(d);if(!b){var E={loading:0,preload:null};if(b=s.querySelector(ys(d)))E.loading=5;else{e=F({rel:"stylesheet",href:e,"data-precedence":n},l),(l=ii.get(d))&&md(e,l);var _=b=s.createElement("link");Ut(_),hn(_,"link",e),_._p=new Promise(function(H,$){_.onload=H,_.onerror=$}),_.addEventListener("load",function(){E.loading|=1}),_.addEventListener("error",function(){E.loading|=2}),E.loading|=4,ou(b,n,s)}b={type:"stylesheet",instance:b,count:1,state:E},f.set(d,b)}}}function BS(e,n){Pi.X(e,n);var l=ha;if(l&&e){var s=rr(l).hoistableScripts,f=pa(e),d=s.get(f);d||(d=l.querySelector(gs(f)),d||(e=F({src:e,async:!0},n),(n=ii.get(f))&&pd(e,n),d=l.createElement("script"),Ut(d),hn(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(f,d))}}function US(e,n){Pi.M(e,n);var l=ha;if(l&&e){var s=rr(l).hoistableScripts,f=pa(e),d=s.get(f);d||(d=l.querySelector(gs(f)),d||(e=F({src:e,async:!0,type:"module"},n),(n=ii.get(f))&&pd(e,n),d=l.createElement("script"),Ut(d),hn(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=rt.current)?ps(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=ma(l.href),n=rr(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=ma(l.href);var d=rr(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(ys(e)))?d._p||(b.instance=d,b.state.loading=5):(d=ii.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},ii.set(e,d)),HS(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=pa(l),n=rr(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 ma(e){return'href="'+vn(e)+'"'}function ys(e){return'link[rel="stylesheet"]['+e+"]"}function Mg(e){return F({},e,{"data-precedence":e.precedence,precedence:null})}function HS(e,n,l,s){if(n=e.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[Yr]!==!0){s.loading=1;return}}else n=e.createElement("link"),n[Yr]=!0,n.onload=n.onerror=Ks.bind(null,n),hn(n,"link",l),Ut(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 pa(e){return'[src="'+vn(e)+'"]'}function gs(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~="'+vn(l.href)+'"]');if(s)return n.instance=s,Ut(s),s;var f=F({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Ut(s),hn(s,"style",f),ou(s,l.precedence,e),n.instance=s;case"stylesheet":f=ma(l.href);var d=e.querySelector(ys(f));if(d)return n.state.loading|=4,n.instance=d,Ut(d),d;s=Mg(l),(f=ii.get(f))&&md(s,f),d=(e.ownerDocument||e).createElement("link"),Ut(d);var b=d;return b._p=new Promise(function(E,_){b.onload=E,b.onerror=_}),hn(d,"link",s),n.state.loading|=4,ou(d,l.precedence,e),n.instance=d;case"script":return d=pa(l.src),(f=e.querySelector(gs(d)))?(n.instance=f,Ut(f),f):(s=l,(f=ii.get(d))&&(s=F({},l),pd(s,f)),e=e.ownerDocument||e,f=e.createElement("script"),Ut(f),hn(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,ou(s,l.precedence,e));return n.instance}function ou(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 E=s[b];if(E.dataset.precedence===n)d=E;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 uu=null;function Dg(e,n,l){if(uu===null){var s=new Map,f=uu=new Map;f.set(l,s)}else f=uu,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[Di]||d[Zt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var b=d.getAttribute(n)||"";b=e+b;var E=s.get(b);E?E.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 IS(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=FS.bind(e),n.decode().then(e,e))}function VS(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=ma(s.href),d=n.querySelector(ys(f));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=vs.bind(e),n.then(e,e)),l.state.loading|=4,l.instance=d,Ut(d);return}d=n.ownerDocument||n,s=Mg(s),(f=ii.get(f))&&md(s,f),d=d.createElement("link"),Ut(d);var b=d;b._p=new Promise(function(E,_){b.onload=E,b.onerror=_}),hn(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=vs.bind(e),n.addEventListener("load",l),n.addEventListener("error",l))}}var cu=0;function YS(e,n){return e.stylesheets&&e.count===0&&du(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var s=setTimeout(function(){if(e.stylesheets&&du(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+n);0<e.imgBytes&&cu===0&&(cu=62500*sS());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&du(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>cu?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)du(e,e.stylesheets);else if(e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}}}function vs(){this.count--,Ig(this)}function FS(){this.imgCount--,Ig(this)}var fu=null;function du(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fu=new Map,n.forEach(GS,e),fu=null,vs.call(e))}function GS(e,n){if(!(n.state.loading&4)){var l=fu.get(e);if(l)var s=l.get(null);else{l=new Map,fu.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=vs.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 ya={$$typeof:ge,Provider:null,Consumer:null,_currentValue:et,_currentValue2:et,_threadCount:0};function $S(e,n,l,s,f,d,b,E,_){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=ir(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ir(0),this.hiddenUpdates=ir(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,E,_,H,$,ne){return e=new $S(e,n,l,b,_,H,$,ne,E),n=1,d===!0&&(n|=24),d=En(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=Vl,e):Vl}function Fg(e,n,l,s,f,d){f=Yg(f),s.context===null?s.context=f:s.pendingContext=f,s=vr(n),s.payload={element:l},d=d===void 0?null:d,d!==null&&(s.callback=d),l=br(e,s,n),l!==null&&(Cn(l,e,n),Za(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=Jr(e,67108864);n!==null&&Cn(n,e,67108864),gd(e,67108864)}}function Xg(e){if(e.tag===13||e.tag===31){var n=Un();n=Ra(n);var l=Jr(e,n);l!==null&&Cn(l,e,n),gd(e,n)}}var ga=!0;function XS(e,n,l,s){var f=K.T;K.T=null;var d=de.p;try{de.p=2,vd(e,n,l,s)}finally{de.p=d,K.T=f}}function QS(e,n,l,s){var f=K.T;K.T=null;var d=de.p;try{de.p=8,vd(e,n,l,s)}finally{de.p=d,K.T=f}}function vd(e,n,l,s){if(ga){var f=bd(s);if(f===null)Wf(e,n,s,hu,l),Zg(e,s);else if(KS(f,e,n,l,s))s.stopPropagation();else if(Zg(e,s),n&4&&-1<ZS.indexOf(e)){for(;f!==null;){var d=Fn(f);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var b=qi(d.pendingLanes);if(b!==0){var E=d;for(E.pendingLanes|=2,E.entangledLanes|=2;b;){var _=1<<31-jt(b);E.entanglements[1]|=_,b&=~_}Ci(d),(kt&6)===0&&(Po=Nt()+500,fs(0))}}break;case 31:case 13:E=Jr(d,2),E!==null&&Cn(E,d,2),tu(),gd(d,2)}if(d=bd(s),d===null&&Wf(e,n,s,hu,l),d===f)break;f=d}f!==null&&s.stopPropagation()}else Wf(e,n,s,null,l)}}function bd(e){return e=Dl(e),xd(e)}var hu=null;function xd(e){if(hu=null,e=ai(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 hu=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 pt:return 2;case Ft:return 8;case pi:case Vn:return 32;case Z:return 268435456;default:return 32}default:return 32}}var wd=!1,_r=null,Or=null,zr=null,bs=new Map,xs=new Map,Mr=[],ZS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Zg(e,n){switch(e){case"focusin":case"focusout":_r=null;break;case"dragenter":case"dragleave":Or=null;break;case"mouseover":case"mouseout":zr=null;break;case"pointerover":case"pointerout":bs.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":xs.delete(n.pointerId)}}function ws(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=Fn(n),n!==null&&$g(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function KS(e,n,l,s,f){switch(n){case"focusin":return _r=ws(_r,e,n,l,s,f),!0;case"dragenter":return Or=ws(Or,e,n,l,s,f),!0;case"mouseover":return zr=ws(zr,e,n,l,s,f),!0;case"pointerover":var d=f.pointerId;return bs.set(d,ws(bs.get(d)||null,e,n,l,s,f)),!0;case"gotpointercapture":return d=f.pointerId,xs.set(d,ws(xs.get(d)||null,e,n,l,s,f)),!0}return!1}function Kg(e){var n=ai(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,_a(e.priority,function(){Xg(l)});return}}else if(n===31){if(n=h(l),n!==null){e.blockedOn=n,_a(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 mu(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);ql=s,l.target.dispatchEvent(s),ql=null}else return n=Fn(l),n!==null&&$g(n),e.blockedOn=l,!1;n.shift()}return!0}function Jg(e,n,l){mu(e)&&l.delete(n)}function JS(){wd=!1,_r!==null&&mu(_r)&&(_r=null),Or!==null&&mu(Or)&&(Or=null),zr!==null&&mu(zr)&&(zr=null),bs.forEach(Jg),xs.forEach(Jg)}function pu(e,n){e.blockedOn===n&&(e.blockedOn=null,wd||(wd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,JS)))}var yu=null;function Pg(e){yu!==e&&(yu=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){yu===e&&(yu=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=Fn(l);d!==null&&(e.splice(n,3),n-=3,tf(d,{pending:!0,data:f,method:l.method,action:s},s,f))}}))}function va(e){function n(_){return pu(_,e)}_r!==null&&pu(_r,e),Or!==null&&pu(Or,e),zr!==null&&pu(zr,e),bs.forEach(n),xs.forEach(n);for(var l=0;l<Mr.length;l++){var s=Mr[l];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Mr.length&&(l=Mr[0],l.blockedOn===null);)Kg(l),l.blockedOn===null&&Mr.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[on]||null;if(typeof d=="function")b||Pg(l);else if(b){var E=null;if(d&&d.hasAttribute("formAction")){if(f=d,b=d[on]||null)E=b.formAction;else if(xd(f)!==null)continue}else E=b.action;typeof E=="function"?l[s+1]=E:(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}gu.prototype.render=Sd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var l=n.current,s=Un();Fg(l,s,e,n,null,null)},gu.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),tu(),n[yi]=null}};function gu(e){this._internalRoot=e}gu.prototype.unstable_scheduleHydration=function(e){if(e){var n=Al();e={blockedOn:null,target:e,priority:n};for(var l=0;l<Mr.length&&n!==0&&n<Mr[l].priority;l++);Mr.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"));de.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 PS={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vu.isDisabled&&vu.supportsFiber)try{yt=vu.inject(PS),ot=vu}catch{}}return ks.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[yi]=n.current,Pf(e),new Sd(n)},ks.hydrateRoot=function(e,n,l){if(!o(e))throw Error(a(299));var s=!1,f="",d=Yp,b=Fp,E=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&&(E=l.onRecoverableError),l.formState!==void 0&&(_=l.formState)),n=Vg(e,1,!0,n,l??null,s,f,_,d,b,E,Wg),n.context=Yg(null),l=n.current,s=Un(),s=Ra(s),f=vr(s),f.callback=null,br(l,f,s),l=s,n.current.lanes=l,Hr(n,l),Ci(n),e[yi]=n.current,Pf(e),new gu(n)},ks.version="19.3.1",ks}var cv;function sk(){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=ak(),jd.exports}var ok=sk(),Sl=Xb();async function nt(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 uk(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 ck(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(`
|
|
9
|
+
`+s.stack}}var Ke=Object.prototype.hasOwnProperty,st=t.unstable_scheduleCallback,bt=t.unstable_cancelCallback,vt=t.unstable_shouldYield,xn=t.unstable_requestPaint,Nt=t.unstable_now,Ct=t.unstable_getCurrentPriorityLevel,pt=t.unstable_ImmediatePriority,Ft=t.unstable_UserBlockingPriority,pi=t.unstable_NormalPriority,Vn=t.unstable_LowPriority,Z=t.unstable_IdlePriority,he=t.log,Et=t.unstable_setDisableYieldValue,yt=null,ot=null;function Mt(e){if(typeof he=="function"&&Et(e),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(yt,e)}catch{}}var jt=Math.clz32?Math.clz32:zn,jl=Math.log,tr=Math.LN2;function zn(e){return e>>>=0,e===0?32:31-(jl(e)/tr|0)|0}var zi=256,li=262144,Mi=4194304;function qi(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 Tl(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=qi(s):(b&=k,b!==0?f=qi(b):l||(l=k&~e,l!==0&&(f=qi(l))))):(k=s&~d,k!==0?f=qi(k):b!==0?f=qi(b):l||(l=s&~e,l!==0&&(f=qi(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 nr(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function $s(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 ac(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 Xs(){var e=Mi;return Mi<<=1,(Mi&62914560)===0&&(Mi=4194304),e}function ir(e){for(var n=[],l=0;31>l;l++)n.push(e);return n}function Hr(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Nl(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),ne=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&=~ne}s!==0&&Aa(e,s,0),d!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=d&~(b&~n))}function Aa(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 Qs(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 Ir(e,n){var l=n&-n;return l=(l&42)!==0?1:Ra(l),(l&(e.suspendedLanes|n))!==0?0:l}function Ra(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 Cl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Al(){var e=de.p;return e!==0?e:(e=window.event,e===void 0?32:Zg(e.type))}function _a(e,n){var l=de.p;try{return de.p=e,n()}finally{de.p=l}}var Yn=Math.random().toString(36).slice(2),Zt="__reactFiber$"+Yn,on="__reactProps$"+Yn,yi="__reactContainer$"+Yn,Rl="__reactEvents$"+Yn,Zs="__reactListeners$"+Yn,_l="__reactHandles$"+Yn,Vr="__reactResources$"+Yn,Di="__reactMarker$"+Yn,Yr="__reactLoad$"+Yn;function Li(e){delete e[Zt],delete e[on],delete e[Zs],delete e[_l]}function ai(e){var n;if(n=e[Zt])return n;for(var l=e.parentNode;l;){if(n=l[yi]||l[Zt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(e=Ag(e);e!==null;){if(l=e[Zt])return l;e=Ag(e)}return n}e=l,l=e.parentNode}return null}function Fn(e){if(e=e[Zt]||e[yi]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Bi(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function rr(e){var n=e[Vr];return n||(n=e[Vr]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Ut(e){e[Di]=!0}function Ks(e){e[Yr]=void 0}var Ol=new Set,Fr={};function Ui(e,n){lr(e,n),lr(e+"Capture",n)}function lr(e,n){for(Fr[e]=n,e=0;e<n.length;e++)Ol.add(n[e])}var sc=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]*$"),Gr={},Js={};function Ps(e){return Ke.call(Js,e)?!0:Ke.call(Gr,e)?!1:sc.test(e)?Js[e]=!0:(Gr[e]=!0,!1)}var dt=!1;function ar(){var e=dt;return dt=!1,e}function nn(e,n,l){if(Ps(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 sr(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 Gn(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 gn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Oa(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function om(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 zl(e){if(!e._valueTracker){var n=Oa(e)?"checked":"value";e._valueTracker=om(e,n,""+e[n])}}function Ws(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),s="";return e&&(s=Oa(e)?e.checked?"true":"false":e.value),e=s,e!==l?(n.setValue(e),!0):!1}var gi=/[\n"\\]/g;function vn(e){return e.replace(gi,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function $n(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=""+gn(n)):e.value!==""+gn(n)&&(e.value=""+gn(n)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),n!=null?b==="number"&&e.value==n?$r(e,gn(e.value)):$r(e,gn(n)):l!=null?$r(e,gn(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=""+gn(k):e.removeAttribute("name")}function za(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)){zl(e);return}l=l!=null?""+gn(l):"",n=n!=null?""+gn(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),zl(e)}function $r(e,n){e.defaultValue!==""+n&&(e.defaultValue=""+n)}function vi(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=""+gn(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 eo(e,n,l){if(n!=null&&(n=""+gn(n),n!==e.value&&(e.value=n),l==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=l!=null?""+gn(l):""}function to(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=gn(n),e.defaultValue=l,s=e.textContent,s===l&&s!==""&&s!==null&&(e.value=s),zl(e)}function Hi(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var no=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||no.has(n)?n==="float"?e.cssFloat=l:e[n]=(""+l).trim():e[n]=l+"px"}function qa(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]="",dt=!0);for(var f in n)s=n[f],n.hasOwnProperty(f)&&l[f]!==s&&(Ma(e,f,s),dt=!0)}else for(var d in n)n.hasOwnProperty(d)&&Ma(e,d,n[d])}function Ml(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 oc=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"]]),io=/^[\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 Xr(e){return io.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xn(){}var ql=null;function Dl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var or=null,ur=null;function cr(e){var n=Fn(e);if(n&&(e=n.stateNode)){var l=e[on]||null;e:switch(e=n.stateNode,n.type){case"input":if($n(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="'+vn(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var s=l[n];if(s!==e&&s.form===e.form){var f=s[on]||null;if(!f)throw Error(a(90));$n(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&&Ws(s)}break e;case"textarea":eo(e,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&vi(e,!!l.multiple,n,!1)}}}var Da=!1;function ro(e,n,l){if(Da)return e(n,l);Da=!0;try{var s=e(n);return s}finally{if(Da=!1,(or!==null||ur!==null)&&(tu(),or&&(n=or,e=ur,ur=or=null,cr(n),e)))for(n=0;n<e.length;n++)cr(e[n])}}function fr(e,n){var l=e.stateNode;if(l===null)return null;var s=l[on]||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 Qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ll=!1;if(Qn)try{var C={};Object.defineProperty(C,"passive",{get:function(){Ll=!0}}),window.addEventListener("test",C,C),window.removeEventListener("test",C,C)}catch{Ll=!1}var V=null,J=null,me=null;function _e(){if(me)return me;var e,n=J,l=n.length,s,f="value"in V?V.value:V.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 me=f.slice(e,1<s?1-s:void 0)}function je(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 Je(){return!0}function Ot(){return!1}function Ge(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)?Je:Ot,this.isPropagationStopped=Ot,this}return L(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=Je)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Je)},persist:function(){},isPersistent:Je}),n}var We={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},St=Ge(We),xt=L({},We,{view:0,detail:0}),Vt=Ge(xt),Zn,Qr,La,lo=L({},xt,{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!==La&&(La&&e.type==="mousemove"?(Zn=e.screenX-La.screenX,Qr=e.screenY-La.screenY):Qr=Zn=0,La=e),Zn)},movementY:function(e){return"movementY"in e?e.movementY:Qr}}),um=Ge(lo),T1=L({},lo,{dataTransfer:0}),N1=Ge(T1),C1=L({},xt,{relatedTarget:0}),uc=Ge(C1),A1=L({},We,{animationName:0,elapsedTime:0,pseudoElement:0}),R1=Ge(A1),_1=L({},We,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),O1=Ge(_1),z1=L({},We,{data:0}),cm=Ge(z1),M1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},q1={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"},D1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function L1(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=D1[e])?!!n[e]:!1}function cc(){return L1}var B1=L({},xt,{key:function(e){if(e.key){var n=M1[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=je(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?q1[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"?je(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?je(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),U1=Ge(B1),H1=L({},lo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fm=Ge(H1),I1=L({},We,{submitter:0}),V1=Ge(I1),Y1=L({},xt,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cc}),F1=Ge(Y1),G1=L({},We,{propertyName:0,elapsedTime:0,pseudoElement:0}),$1=Ge(G1),X1=L({},lo,{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}),Q1=Ge(X1),Z1=L({},We,{newState:0,oldState:0,source:0}),K1=Ge(Z1),J1=[9,13,27,32],fc=Qn&&"CompositionEvent"in window,Ba=null;Qn&&"documentMode"in document&&(Ba=document.documentMode);var P1=Qn&&"TextEvent"in window&&!Ba,dm=Qn&&(!fc||Ba&&8<Ba&&11>=Ba),hm=" ",mm=!1;function pm(e,n){switch(e){case"keyup":return J1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ym(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bl=!1;function W1(e,n){switch(e){case"compositionend":return ym(n);case"keypress":return n.which!==32?null:(mm=!0,hm);case"textInput":return e=n.data,e===hm&&mm?null:e;default:return null}}function ew(e,n){if(Bl)return e==="compositionend"||!fc&&pm(e,n)?(e=_e(),me=J=V=null,Bl=!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 dm&&n.locale!=="ko"?null:n.data;default:return null}}var tw={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 gm(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!tw[e.type]:n==="textarea"}function vm(e,n,l,s){or?ur?ur.push(s):ur=[s]:or=s,n=su(n,"onChange"),0<n.length&&(l=new St("onChange","change",null,l,s),e.push({event:l,listeners:n}))}var Ua=null,Ha=null;function nw(e){lg(e,0)}function ao(e){var n=Bi(e);if(Ws(n))return e}function bm(e,n){if(e==="change")return n}var xm=!1;if(Qn){var dc;if(Qn){var hc="oninput"in document;if(!hc){var wm=document.createElement("div");wm.setAttribute("oninput","return;"),hc=typeof wm.oninput=="function"}dc=hc}else dc=!1;xm=dc&&(!document.documentMode||9<document.documentMode)}function Sm(){Ua&&(Ua.detachEvent("onpropertychange",km),Ha=Ua=null)}function km(e){if(e.propertyName==="value"&&ao(Ha)){var n=[];vm(n,Ha,e,Dl(e)),ro(nw,n)}}function iw(e,n,l){e==="focusin"?(Sm(),Ua=n,Ha=l,Ua.attachEvent("onpropertychange",km)):e==="focusout"&&Sm()}function rw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ao(Ha)}function lw(e,n){if(e==="click")return ao(n)}function aw(e,n){if(e==="input"||e==="change")return ao(n)}function sw(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Mn=typeof Object.is=="function"?Object.is:sw;function Ia(e,n){if(Mn(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(!Ke.call(n,f)||!Mn(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 Em(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jm(e,n){var l=Em(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=Em(l)}}function Tm(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Tm(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Nm(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 ow=Qn&&"documentMode"in document&&11>=document.documentMode,Ul=null,yc=null,Va=null,gc=!1;function Cm(e,n,l){var s=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;gc||Ul==null||Ul!==mc(s)||(s=Ul,"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}),Va&&Ia(Va,s)||(Va=s,s=su(yc,"onSelect"),0<s.length&&(n=new St("onSelect","select",null,n,l),e.push({event:n,listeners:s}),n.target=Ul)))}function Zr(e,n){var l={};return l[e.toLowerCase()]=n.toLowerCase(),l["Webkit"+e]="webkit"+n,l["Moz"+e]="moz"+n,l}var Hl={animationend:Zr("Animation","AnimationEnd"),animationiteration:Zr("Animation","AnimationIteration"),animationstart:Zr("Animation","AnimationStart"),transitionrun:Zr("Transition","TransitionRun"),transitionstart:Zr("Transition","TransitionStart"),transitioncancel:Zr("Transition","TransitionCancel"),transitionend:Zr("Transition","TransitionEnd")},vc={},Am={};Qn&&(Am=document.createElement("div").style,"AnimationEvent"in window||(delete Hl.animationend.animation,delete Hl.animationiteration.animation,delete Hl.animationstart.animation),"TransitionEvent"in window||delete Hl.transitionend.transition);function Kr(e){if(vc[e])return vc[e];if(!Hl[e])return e;var n=Hl[e],l;for(l in n)if(n.hasOwnProperty(l)&&l in Am)return vc[e]=n[l];return e}var Rm=Kr("animationend"),_m=Kr("animationiteration"),Om=Kr("animationstart"),uw=Kr("transitionrun"),cw=Kr("transitionstart"),fw=Kr("transitioncancel"),zm=Kr("transitionend"),Mm=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 si(e,n){Mm.set(e,n),Ui(n,[e])}var dw=0;function Ii(e,n){if(e.name!=null&&e.name!=="auto")return e.name;if(n.autoName!==null)return n.autoName;e=fi.identifierPrefix;var l=dw++;return e="_"+e+"t_"+l.toString(32)+"_",n.autoName=e}function qm(e){if(e==null||typeof e=="string")return e;var n=null,l=aa;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 Vi(e,n){return e=qm(e),n=qm(n),n==null?e==="auto"?null:e:n==="auto"?null:n}var so=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)},Kn=[],Il=0,xc=0;function oo(){for(var e=Il,n=xc=Il=0;n<e;){var l=Kn[n];Kn[n++]=null;var s=Kn[n];Kn[n++]=null;var f=Kn[n];Kn[n++]=null;var d=Kn[n];if(Kn[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&&Dm(l,f,d)}}function uo(e,n,l,s){Kn[Il++]=e,Kn[Il++]=n,Kn[Il++]=l,Kn[Il++]=s,xc|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function wc(e,n,l,s){return uo(e,n,l,s),co(e)}function Jr(e,n){return uo(e,null,null,n),co(e)}function Dm(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 co(e){if(50<cs)throw cs=0,eu=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Vl={};function hw(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 En(e,n,l,s){return new hw(e,n,l,s)}function Sc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Yi(e,n){var l=e.alternate;return l===null?(l=En(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 Lm(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 fo(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=IS(e,l,Ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(s){case Ze:return e=En(31,l,n,f),e.elementType=Ze,e.lanes=d,e;case Y:return Pr(l.children,f,d,n);case W:b=8,f|=24;break;case ke:return e=En(12,l,n,f|2),e.elementType=ke,e.lanes=d,e;case ce:return e=En(13,l,n,f),e.elementType=ce,e.lanes=d,e;case xe:return e=En(19,l,n,f),e.elementType=xe,e.lanes=d,e;case Ie:case z:return e=f|32,e=En(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=En(b,l,n,f),n.elementType=e,n.type=s,n.lanes=d,n}function Pr(e,n,l,s){return e=En(7,e,s,n),e.lanes=l,e}function kc(e,n,l){return e=En(6,e,null,n),e.lanes=l,e}function Bm(e){var n=En(18,null,null,0);return n.stateNode=e,n}function Ec(e,n,l){return n=En(4,e.children!==null?e.children:[],e.key,n),n.lanes=l,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Um=new WeakMap;function Jn(e,n){if(typeof e=="object"&&e!==null){var l=Um.get(e);return l!==void 0?l:(n={value:e,source:n,stack:Le(n)},Um.set(e,n),n)}return{value:e,source:n,stack:Le(n)}}var Yl=[],Fl=0,ho=null,Ya=0,Pn=[],Wn=0,dr=null,bi=1,xi="";function Fi(e,n){Yl[Fl++]=Ya,Yl[Fl++]=ho,ho=e,Ya=n}function Hm(e,n,l){Pn[Wn++]=bi,Pn[Wn++]=xi,Pn[Wn++]=dr,dr=e;var s=bi;e=xi;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,bi=1<<32-jt(n)+f|l<<f|s,xi=d+e}else bi=1<<d|l<<f|s,xi=e}function mo(e){e.return!==null&&(Fi(e,1),Hm(e,1,0))}function jc(e){for(;e===ho;)ho=Yl[--Fl],Yl[Fl]=null,Ya=Yl[--Fl],Yl[Fl]=null;for(;e===dr;)dr=Pn[--Wn],Pn[Wn]=null,xi=Pn[--Wn],Pn[Wn]=null,bi=Pn[--Wn],Pn[Wn]=null}function Im(e,n){Pn[Wn++]=bi,Pn[Wn++]=xi,Pn[Wn++]=dr,bi=n.id,xi=n.overflow,dr=e}var ln=null,Ht=null,nt=!1,hr=null,ei=!1,Tc=Error(a(519));function mr(e){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fa(Jn(n,e)),Tc}function Vm(e){var n=e.stateNode,l=e.type,s=e.memoizedProps;switch(n[Zt]=e,n[on]=s,l){case"dialog":at("cancel",n),at("close",n);break;case"iframe":case"object":case"embed":at("load",n);break;case"video":case"audio":for(l=0;l<ds.length;l++)at(ds[l],n);break;case"source":at("error",n);break;case"img":case"image":case"link":at("error",n),at("load",n);break;case"details":at("toggle",n);break;case"input":at("invalid",n),za(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":at("invalid",n);break;case"textarea":at("invalid",n),to(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||ug(n.textContent,l)?(s.popover!=null&&(at("beforetoggle",n),at("toggle",n)),s.onScroll!=null&&at("scroll",n),s.onScrollEnd!=null&&at("scrollend",n),s.onClick!=null&&(n.onclick=Xn),n=!0):n=!1,n||mr(e,!0)}function po(e){for(ln=e.return;ln;)switch(ln.tag){case 5:case 31:case 13:ei=!1;return;case 27:case 3:ei=!0;return;default:ln=ln.return}}function Gl(e){if(e!==ln)return!1;if(!nt)return po(e),nt=!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&&mr(e),po(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Ht=Cg(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Ht=Cg(e)}else n===27?(n=Ht,Rr(e.type)?(e=dd,dd=null,Ht=e):Ht=n):Ht=ln?ni(e.stateNode.nextSibling):null;return!0}function Wr(){Ht=ln=null,nt=!1}function Nc(){var e=hr;return e!==null&&(Nn===null?Nn=e:Nn.push.apply(Nn,e),hr=null),e}function Fa(e){hr===null?hr=[e]:hr.push(e)}var Cc=De(null),el=null,Gi=null;function pr(e,n,l){Ve(Cc,n._currentValue),n._currentValue=l}function $i(e){e._currentValue=Cc.current,Me(Cc)}function yo(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),yo(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),yo(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),yo(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 tl(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;Mn(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(ya):e=[ya])}f=f.return}return e!==null&&Ac(n,e,l,s),n.flags|=262144,e!==null}function go(e){for(e=e.firstContext;e!==null;){if(!Mn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function nl(e){el=e,Gi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function un(e){return Ym(el,e)}function vo(e,n){return el===null&&nl(e),Ym(e,n)}function Ym(e,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Gi===null){if(e===null)throw Error(a(308));Gi=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Gi=Gi.next=n;return l}var mw=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()})}},pw=t.unstable_scheduleCallback,yw=t.unstable_NormalPriority,Jt={$$typeof:ge,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rc(){return{controller:new mw,data:new Map,refCount:0}}function Ga(e){e.refCount--,e.refCount===0&&pw(yw,function(){e.controller.abort()})}function Fm(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 $a=null;function gw(e){var n=e.transitionTypes;return e.transitionTypes=null,n}var Xa=null,_c=0,il=0,$l=null;function vw(e,n){if(Xa===null){var l=Xa=[];_c=0,il=Qf(),$l={status:"pending",value:void 0,then:function(s){l.push(s)}}}return _c++,n.then(Gm,Gm),n}function Gm(){if(--_c===0&&($a=null,Xa!==null)){$l!==null&&($l.status="fulfilled");var e=Xa;Xa=null,il=0,$l=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function bw(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 $m=K.S;K.S=function(e,n){if(By=Nt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&vw(e,n),$a!==null)for(var l=ca;l!==null;)Fm(l,$a),l=l.next;if(l=e.types,l!==null){for(var s=ca;s!==null;)Fm(s,l),s=s.next;if(il!==0){s=$a,s===null&&(s=$a=[]);for(var f=0;f<l.length;f++){var d=l[f];s.indexOf(d)===-1&&s.push(d)}}}$m!==null&&$m(e,n)};var rl=De(null);function Oc(){var e=rl.current;return e!==null?e:qt.pooledCache}function bo(e,n){n===null?Ve(rl,rl.current):Ve(rl,n.pool)}function Xm(){var e=Oc();return e===null?null:{parent:Jt._currentValue,pool:e}}var Xl=Error(a(460)),zc=Error(a(474)),xo=Error(a(542)),wo={then:function(){}};function Qm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Zm(e,n,l){switch(l=e[l],l===void 0?e.push(n):l!==n&&(n.then(Xn,Xn),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Jm(e),e===void 0&&!("reason"in n)?Error(a(600)):e;default:if(typeof n.status=="string")n.then(Xn,Xn);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,Jm(e),e}throw al=n,Xl}}function ll(e){try{var n=e._init;return n(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(al=l,Xl):l}}var al=null;function Km(){if(al===null)throw Error(a(459));var e=al;return al=null,e}function Jm(e){if(e===Xl||e===xo)throw Error(a(483))}var Ql=null,Qa=0;function So(e){var n=Qa;return Qa+=1,Ql===null&&(Ql=[]),Zm(Ql,e,n)}function yr(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function ko(e,n){throw n.$$typeof===G?Error(a(525)):(e=Object.prototype.toString.call(n),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Pm(e){function n(H,D){if(e){var F=H.deletions;F===null?(H.deletions=[D],H.flags|=16):F.push(D)}}function l(H,D){if(!e)return null;for(;D!==null;)n(H,D),D=D.sibling;return null}function s(H){for(var D=new Map;H!==null;)H.key===null?D.set(H.index,H):D.set(H.key,H),H=H.sibling;return D}function f(H,D){return H=Yi(H,D),H.index=0,H.sibling=null,H}function d(H,D,F){return H.index=F,e?(F=H.alternate,F!==null?(F=F.index,F<D?(H.flags|=2,D):F):(H.flags|=134217730,D)):(H.flags|=1048576,D)}function b(H){return e&&H.alternate===null&&(H.flags|=134217730),H}function k(H,D,F,te){return D===null||D.tag!==6?(D=kc(F,H.mode,te),D.return=H,D):(D=f(D,F),D.return=H,D)}function _(H,D,F,te){var Ce=F.type;return Ce===Y?(H=X(H,D,F.props.children,te,F.key),yr(H,F),H):D!==null&&(D.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===R&&ll(Ce)===D.type)?(D=f(D,F.props),yr(D,F),D.return=H,D):(D=fo(F.type,F.key,F.props,null,H.mode,te),yr(D,F),D.return=H,D)}function I(H,D,F,te){return D===null||D.tag!==4||D.stateNode.containerInfo!==F.containerInfo||D.stateNode.implementation!==F.implementation?(D=Ec(F,H.mode,te),D.return=H,D):(D=f(D,F.children||[]),D.return=H,D)}function X(H,D,F,te,Ce){return D===null||D.tag!==7?(D=Pr(F,H.mode,te,Ce),D.return=H,D):(D=f(D,F),D.return=H,D)}function ne(H,D,F){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=kc(""+D,H.mode,F),D.return=H,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case le:return F=fo(D.type,D.key,D.props,null,H.mode,F),yr(F,D),F.return=H,F;case O:return D=Ec(D,H.mode,F),D.return=H,D;case R:return D=ll(D),ne(H,D,F)}if(be(D)||ve(D))return D=Pr(D,H.mode,F,null),D.return=H,D;if(typeof D.then=="function")return ne(H,So(D),F);if(D.$$typeof===ge)return ne(H,vo(H,D),F);ko(H,D)}return null}function U(H,D,F,te){var Ce=D!==null?D.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return Ce!==null?null:k(H,D,""+F,te);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case le:return F.key===Ce?_(H,D,F,te):null;case O:return F.key===Ce?I(H,D,F,te):null;case R:return F=ll(F),U(H,D,F,te)}if(be(F)||ve(F))return Ce!==null?null:X(H,D,F,te,null);if(typeof F.then=="function")return U(H,D,So(F),te);if(F.$$typeof===ge)return U(H,D,vo(H,F),te);ko(H,F)}return null}function $(H,D,F,te,Ce){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return H=H.get(F)||null,k(D,H,""+te,Ce);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case le:return H=H.get(te.key===null?F:te.key)||null,_(D,H,te,Ce);case O:return H=H.get(te.key===null?F:te.key)||null,I(D,H,te,Ce);case R:return te=ll(te),$(H,D,F,te,Ce)}if(be(te)||ve(te))return H=H.get(F)||null,X(D,H,te,Ce,null);if(typeof te.then=="function")return $(H,D,F,So(te),Ce);if(te.$$typeof===ge)return $(H,D,F,vo(D,te),Ce);ko(D,te)}return null}function Se(H,D,F,te){for(var Ce=null,ct=null,qe=D,Ye=D=0,en=null;qe!==null&&Ye<F.length;Ye++){qe.index>Ye?(en=qe,qe=null):en=qe.sibling;var gt=U(H,qe,F[Ye],te);if(gt===null){qe===null&&(qe=en);break}e&&qe&>.alternate===null&&n(H,qe),D=d(gt,D,Ye),ct===null?Ce=gt:ct.sibling=gt,ct=gt,qe=en}if(Ye===F.length)return l(H,qe),nt&&Fi(H,Ye),Ce;if(qe===null){for(;Ye<F.length;Ye++)qe=ne(H,F[Ye],te),qe!==null&&(D=d(qe,D,Ye),ct===null?Ce=qe:ct.sibling=qe,ct=qe);return nt&&Fi(H,Ye),Ce}for(qe=s(qe);Ye<F.length;Ye++)en=$(qe,H,Ye,F[Ye],te),en!==null&&(e&&(gt=en.alternate,gt!==null&&qe.delete(gt.key===null?Ye:gt.key)),D=d(en,D,Ye),ct===null?Ce=en:ct.sibling=en,ct=en);return e&&qe.forEach(function(qr){return n(H,qr)}),nt&&Fi(H,Ye),Ce}function Re(H,D,F,te){if(F==null)throw Error(a(151));for(var Ce=null,ct=null,qe=D,Ye=D=0,en=null,gt=F.next();qe!==null&&!gt.done;Ye++,gt=F.next()){qe.index>Ye?(en=qe,qe=null):en=qe.sibling;var qr=U(H,qe,gt.value,te);if(qr===null){qe===null&&(qe=en);break}e&&qe&&qr.alternate===null&&n(H,qe),D=d(qr,D,Ye),ct===null?Ce=qr:ct.sibling=qr,ct=qr,qe=en}if(gt.done)return l(H,qe),nt&&Fi(H,Ye),Ce;if(qe===null){for(;!gt.done;Ye++,gt=F.next())gt=ne(H,gt.value,te),gt!==null&&(D=d(gt,D,Ye),ct===null?Ce=gt:ct.sibling=gt,ct=gt);return nt&&Fi(H,Ye),Ce}for(qe=s(qe);!gt.done;Ye++,gt=F.next())gt=$(qe,H,Ye,gt.value,te),gt!==null&&(e&&(en=gt.alternate,en!==null&&qe.delete(en.key===null?Ye:en.key)),D=d(gt,D,Ye),ct===null?Ce=gt:ct.sibling=gt,ct=gt);return e&&qe.forEach(function(WS){return n(H,WS)}),nt&&Fi(H,Ye),Ce}function Qe(H,D,F,te){if(typeof F=="object"&&F!==null&&F.type===Y&&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;D!==null;){if(D.key===Ce){if(Ce=F.type,Ce===Y){if(D.tag===7){l(H,D.sibling),te=f(D,F.props.children),yr(te,F),te.return=H,H=te;break e}}else if(D.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===R&&ll(Ce)===D.type){l(H,D.sibling),te=f(D,F.props),yr(te,F),te.return=H,H=te;break e}l(H,D);break}else n(H,D);D=D.sibling}F.type===Y?(te=Pr(F.props.children,H.mode,te,F.key),yr(te,F),te.return=H,H=te):(te=fo(F.type,F.key,F.props,null,H.mode,te),yr(te,F),te.return=H,H=te)}return b(H);case O:e:{for(Ce=F.key;D!==null;){if(D.key===Ce)if(D.tag===4&&D.stateNode.containerInfo===F.containerInfo&&D.stateNode.implementation===F.implementation){l(H,D.sibling),te=f(D,F.children||[]),te.return=H,H=te;break e}else{l(H,D);break}else n(H,D);D=D.sibling}te=Ec(F,H.mode,te),te.return=H,H=te}return b(H);case R:return F=ll(F),Qe(H,D,F,te)}if(be(F))return Se(H,D,F,te);if(ve(F)){if(Ce=ve(F),typeof Ce!="function")throw Error(a(150));return F=Ce.call(F),Re(H,D,F,te)}if(typeof F.then=="function")return Qe(H,D,So(F),te);if(F.$$typeof===ge)return Qe(H,D,vo(H,F),te);ko(H,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,D!==null&&D.tag===6?(l(H,D.sibling),te=f(D,F),te.return=H,H=te):(l(H,D),te=kc(F,H.mode,te),te.return=H,H=te),b(H)):l(H,D)}return function(H,D,F,te){try{Qa=0;var Ce=Qe(H,D,F,te);return Ql=null,Ce}catch(qe){if(qe===Xl||qe===xo)throw qe;var ct=En(29,qe,null,H.mode);return ct.lanes=te,ct.return=H,ct}}}var sl=Pm(!0),Wm=Pm(!1),gr=!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 vr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function br(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=co(e),Dm(e,null,l),n}return uo(e,s,n,l),co(e)}function Za(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,Qs(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 Ka(){if(Lc){var e=$l;if(e!==null)throw e}}function Ja(e,n,l,s){Lc=!1;var f=e.updateQueue;gr=!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 ne=f.baseState;b=0,X=I=_=null,k=d;do{var U=k.lane&-536870913,$=U!==k.lane;if($?(ut&U)===U:(s&U)===U){U!==0&&U===il&&(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"){ne=Se.call(Qe,ne,U);break e}ne=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Re.payload,U=typeof Se=="function"?Se.call(Qe,ne,U):Se,U==null)break e;ne=L({},ne,U);break e;case 2:gr=!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=$,_=ne):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&&(_=ne),f.baseState=_,f.firstBaseUpdate=I,f.lastBaseUpdate=X,d===null&&(f.shared.lanes=0),Tr|=b,e.lanes=b,e.memoizedState=ne}}function ep(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function tp(e,n){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)ep(l[e],n)}var xr=De(null),Eo=De(0);function np(e,n){e=Ji,Ve(Eo,e),Ve(xr,n),Ji=e|n.baseLanes}function Bc(){Ve(Eo,Ji),Ve(xr,xr.current)}function Uc(){Ji=Eo.current,Me(xr),Me(Eo)}var cn=De(null),bn=null;function wr(e){var n=e.alternate;Ve(fn,fn.current&1),Ve(cn,e),bn===null&&(n===null||xr.current!==null||n.memoizedState!==null)&&(bn=e)}function Hc(e){Ve(fn,fn.current),Ve(cn,e),bn===null&&(bn=e)}function ip(e){e.tag===22?(Ve(fn,fn.current),Ve(cn,e),bn===null&&(bn=e)):Sr()}function Sr(){Ve(fn,fn.current),Ve(cn,cn.current)}function qn(e){Me(cn),bn===e&&(bn=null),Me(fn)}var fn=De(0);function Pa(e,n){Ve(cn,cn.current),Ve(fn,n)}function Ic(e){Me(fn),Me(cn),bn===e&&(bn=null)}function jo(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 Xi=0,Xe=null,zt=null,Pt=null,To=!1,Zl=!1,ol=!1,No=0,Wa=0,Kl=null,xw=0;function $t(){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(!Mn(e[l],n[l]))return!1;return!0}function Yc(e,n,l,s,f,d){return Xi=d,Xe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,K.H=e===null||e.memoizedState===null?Hp:Ip,ol=!1,d=l(s,f),ol=!1,Zl&&(d=lp(n,l,s,f)),rp(e),d}function rp(e){K.H=Mo;var n=zt!==null&&zt.next!==null;if(Xi=0,Pt=zt=Xe=null,To=!1,Wa=0,Kl=null,n)throw Error(a(300));e===null||Wt||(e=e.dependencies,e!==null&&go(e)&&(Wt=!0))}function lp(e,n,l,s){Xe=e;var f=0;do{if(Zl&&(Kl=null),Wa=0,Zl=!1,25<=f)throw Error(a(301));if(f+=1,Pt=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)}K.H=Cw,d=n(l,s)}while(Zl);return d}function ww(){var e=K.H,n=e.useState()[0];return n=typeof n.then=="function"?es(n):n,e=e.useState()[0],(zt!==null?zt.memoizedState:null)!==e&&(Xe.flags|=1024),n}function Fc(){var e=No!==0;return No=0,e}function Gc(e,n,l){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l}function $c(e){if(To){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}To=!1}Xi=0,Pt=zt=Xe=null,Zl=!1,Wa=No=0,Kl=null}function wn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?Xe.memoizedState=Pt=e:Pt=Pt.next=e,Pt}function Kt(){if(zt===null){var e=Xe.alternate;e=e!==null?e.memoizedState:null}else e=zt.next;var n=Pt===null?Xe.memoizedState:Pt.next;if(n!==null)Pt=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},Pt===null?Xe.memoizedState=Pt=e:Pt=Pt.next=e}return Pt}function Co(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function es(e){var n=Wa;return Wa+=1,Kl===null&&(Kl=[]),e=Zm(Kl,e,n),n=Xe,(Pt===null?n.memoizedState:Pt.next)===null&&(n=n.alternate,K.H=n===null||n.memoizedState===null?Hp:Ip),e}function Ao(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return es(e);if(e.$$typeof===ee)return;if(e.$$typeof===ge)return un(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=Co(),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]=M;return n.index++,l}function Qi(e,n){return typeof n=="function"?n(e):n}function Ro(e){var n=Kt();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 ne=I.lane&-536870913;if(ne!==I.lane?(ut&ne)===ne:(Xi&ne)===ne){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}),ne===il&&(X=!0);else if((Xi&U)===U){I=I.next,U===il&&(X=!0);continue}else ne={lane:0,revertLane:I.revertLane,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},_===null?(k=_=ne,b=d):_=_.next=ne,Xe.lanes|=U,Tr|=U;ne=I.action,ol&&l(d,ne),d=I.hasEagerState?I.eagerState:l(d,ne)}else U={lane:ne,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|=ne,Tr|=ne;I=I.next}while(I!==null&&I!==n);if(_===null?b=d:_.next=k,!Mn(d,e.memoizedState)&&(Wt=!0,X&&(l=$l,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=Kt(),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);Mn(d,n.memoizedState)||(Wt=!0),n.memoizedState=d,n.baseQueue===null&&(n.baseState=d),l.lastRenderedState=d}return[d,s]}function ap(e,n,l){var s=Xe,f=Kt(),d=nt;if(d){if(l===void 0)throw Error(a(407));l=l()}else l=n();var b=!Mn((zt||f).memoizedState,l);if(b&&(f.memoizedState=l,Wt=!0),f=f.queue,Pc(up.bind(null,s,f,e),[e]),e=f.getSnapshot!==n||b||Pt!==null&&(Pt.memoizedState.tag&1)!==0,Jl(e?9:8,{destroy:void 0},op.bind(null,s,f,l,n),null),e){if(s.flags|=2048,qt===null)throw Error(a(349));d||(Xi&127)!==0||sp(s,n,l)}return l}function sp(e,n,l){e.flags|=16384,e={getSnapshot:n,value:l},n=Xe.updateQueue,n===null?(n=Co(),Xe.updateQueue=n,n.stores=[e]):(l=n.stores,l===null?n.stores=[e]:l.push(e))}function op(e,n,l,s){n.value=l,n.getSnapshot=s,cp(n)&&fp(e)}function up(e,n,l){return l(function(){cp(n)&&fp(e)})}function cp(e){var n=e.getSnapshot;e=e.value;try{var l=n();return!Mn(e,l)}catch{return!0}}function fp(e){var n=Jr(e,2);n!==null&&Cn(n,e,2)}function Kc(e){var n=wn();if(typeof e=="function"){var l=e;if(e=l(),ol){Mt(!0);try{l()}finally{Mt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:e},n}function dp(e,n,l,s){return e.baseState=l,Qc(e,zt,typeof s=="function"?s:Qi)}function Sw(e,n,l,s,f){if(zo(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)}};K.T!==null?l(!0):d.isTransition=!1,s(d),l=n.pending,l===null?(d.next=n.pending=d,hp(n,d)):(d.next=l.next,n.pending=l.next=d)}}function hp(e,n){var l=n.action,s=n.payload,f=e.state;if(n.isTransition){var d=K.T,b={};b.types=d!==null?d.types:null,K.T=b;try{var k=l(f,s),_=K.S;_!==null&&_(b,k),mp(e,n,k)}catch(I){Jc(e,n,I)}finally{d!==null&&b.types!==null&&(d.types=b.types),K.T=d}}else try{d=l(f,s),mp(e,n,d)}catch(I){Jc(e,n,I)}}function mp(e,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(s){pp(e,n,s)},function(s){return Jc(e,n,s)}):pp(e,n,l)}function pp(e,n,l){n.status="fulfilled",n.value=l,yp(n),e.state=l,n=e.pending,n!==null&&(l=n.next,l===n?e.pending=null:(l=l.next,n.next=l,hp(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,yp(n),n=n.next;while(n!==s)}e.action=null}function yp(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function gp(e,n){return n}function vp(e,n){if(nt){var l=qt.formState;if(l!==null){e:{var s=Xe;if(nt){if(Ht){t:{for(var f=Ht,d=ei;f.nodeType!==8;){if(!d){f=null;break t}if(f=ni(f.nextSibling),f===null){f=null;break t}}d=f.data,f=d==="F!"||d==="F"?f:null}if(f){Ht=ni(f.nextSibling),s=f.data==="F!";break e}}mr(s)}s=!1}s&&(n=l[0])}}return l=wn(),l.memoizedState=l.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gp,lastRenderedState:n},l.queue=s,l=Lp.bind(null,Xe,s),s.dispatch=l,s=Kc(!1),d=rf.bind(null,Xe,!1,s.queue),s=wn(),f={state:n,dispatch:null,action:e,pending:null},s.queue=f,l=Sw.bind(null,Xe,f,d,l),f.dispatch=l,s.memoizedState=e,[n,l,!1]}function bp(e){var n=Kt();return xp(n,zt,e)}function xp(e,n,l){if(n=Qc(e,n,gp)[0],e=Ro(Qi)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=es(n)}catch(b){throw b===Xl?xo:b}else s=n;n=Kt();var f=n.queue,d=f.dispatch;return l!==n.memoizedState&&(Xe.flags|=2048,Jl(9,{destroy:void 0},kw.bind(null,f,l),null)),[s,d,e]}function kw(e,n){e.action=n}function wp(e){var n=Kt(),l=zt;if(l!==null)return xp(n,l,e);Kt(),n=n.memoizedState,l=Kt();var s=l.queue.dispatch;return l.memoizedState=e,[n,s,!1]}function Jl(e,n,l,s){return e={tag:e,create:l,deps:s,inst:n,next:null},n=Xe.updateQueue,n===null&&(n=Co(),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 Sp(){return Kt().memoizedState}function _o(e,n,l,s){var f=wn();Xe.flags|=e,f.memoizedState=Jl(1|n,{destroy:void 0},l,s===void 0?null:s)}function Oo(e,n,l,s){var f=Kt();s=s===void 0?null:s;var d=f.memoizedState.inst;zt!==null&&s!==null&&Vc(s,zt.memoizedState.deps)?f.memoizedState=Jl(n,d,l,s):(Xe.flags|=e,f.memoizedState=Jl(1|n,d,l,s))}function kp(e,n){_o(8390656,8,e,n)}function Pc(e,n){Oo(2048,8,e,n)}function Ew(e){Xe.flags|=4;var n=Xe.updateQueue;if(n===null)n=Co(),Xe.updateQueue=n,n.events=[e];else{var l=n.events;l===null?n.events=[e]:l.push(e)}}function Ep(e){var n=Kt().memoizedState;return Ew({ref:n,nextImpl:e}),function(){if((kt&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}function jp(e,n){return Oo(4,2,e,n)}function Tp(e,n){return Oo(4,4,e,n)}function Np(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 Cp(e,n,l){l=l!=null?l.concat([e]):null,Oo(4,4,Np.bind(null,n,e),l)}function Wc(){}function Ap(e,n){var l=Kt();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 Rp(e,n){var l=Kt();n=n===void 0?null:n;var s=l.memoizedState;if(n!==null&&Vc(n,s[1]))return s[0];if(s=e(),ol){Mt(!0);try{e()}finally{Mt(!1)}}return l.memoizedState=[s,n],s}function ef(e,n,l){return l===void 0||(Xi&1073741824)!==0&&(ut&261930)===0?e.memoizedState=n:(e.memoizedState=l,e=Hy(),Xe.lanes|=e,Tr|=e,l)}function _p(e,n,l,s){return Mn(l,n)?l:xr.current!==null?(e=ef(e,l,s),Mn(e,n)||(Wt=!0),e):(Xi&106)===0||(Xi&1073741824)!==0&&(ut&261930)===0?(Wt=!0,e.memoizedState=l):(e=Hy(),Xe.lanes|=e,Tr|=e,n)}function Op(e,n,l,s,f){var d=de.p;de.p=d!==0&&8>d?d:8;var b=K.T,k={};k.types=b!==null?b.types:null,K.T=k,rf(e,!1,n,l);try{var _=f(),I=K.S;if(I!==null&&I(k,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var X=bw(_,s);ts(e,n,X,Un(e))}else ts(e,n,s,Un(e))}catch(ne){ts(e,n,{then:function(){},status:"rejected",reason:ne},Un())}finally{de.p=d,b!==null&&k.types!==null&&(b.types=k.types),K.T=b}}function jw(){}function tf(e,n,l,s){if(e.tag!==5)throw Error(a(476));var f=zp(e).queue;Op(e,f,n,tt,l===null?jw:function(){return Mp(e),l(s)})}function zp(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:tt,baseState:tt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:tt},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:l},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Mp(e){var n=zp(e);n.next===null&&(n=e.alternate.memoizedState),ts(e,n.next.queue,{},Un())}function nf(){return un(ya)}function qp(){return Kt().memoizedState}function Dp(){return Kt().memoizedState}function Tw(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var l=Un();e=vr(l);var s=br(n,e,l);s!==null&&(Cn(s,n,l),Za(s,n,l)),n={cache:Rc()},e.payload=n;return}n=n.return}}function Nw(e,n,l){var s=Un();l={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},zo(e)?Bp(n,l):(l=wc(e,n,l,s),l!==null&&(Cn(l,e,s),Up(l,n,s)))}function Lp(e,n,l){var s=Un();ts(e,n,l,s)}function ts(e,n,l,s){var f={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(zo(e))Bp(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,Mn(k,b))return uo(e,n,f,0),qt===null&&oo(),!1}catch{}if(l=wc(e,n,f,s),l!==null)return Cn(l,e,s),Up(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},zo(e)){if(n)throw Error(a(479))}else n=wc(e,l,s,2),n!==null&&Cn(n,e,2)}function zo(e){var n=e.alternate;return e===Xe||n!==null&&n===Xe}function Bp(e,n){Zl=To=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function Up(e,n,l){if((l&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,l|=s,n.lanes=l,Qs(e,l)}}var Mo={readContext:un,use:Ao,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t,useEffectEvent:$t},Hp={readContext:un,use:Ao,useCallback:function(e,n){return wn().memoizedState=[e,n===void 0?null:n],e},useContext:un,useEffect:kp,useImperativeHandle:function(e,n,l){l=l!=null?l.concat([e]):null,_o(4194308,4,Np.bind(null,n,e),l)},useLayoutEffect:function(e,n){return _o(4194308,4,e,n)},useInsertionEffect:function(e,n){_o(4,2,e,n)},useMemo:function(e,n){var l=wn();n=n===void 0?null:n;var s=e();if(ol){Mt(!0);try{e()}finally{Mt(!1)}}return l.memoizedState=[s,n],s},useReducer:function(e,n,l){var s=wn();if(l!==void 0){var f=l(n);if(ol){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=Nw.bind(null,Xe,e),[s.memoizedState,e]},useRef:function(e){var n=wn();return e={current:e},n.memoizedState=e},useState:function(e){e=Kc(e);var n=e.queue,l=Lp.bind(null,Xe,n);return n.dispatch=l,[e.memoizedState,l]},useDebugValue:Wc,useDeferredValue:function(e,n){var l=wn();return ef(l,e,n)},useTransition:function(){var e=Kc(!1);return e=Op.bind(null,Xe,e.queue,!0,!1),wn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,l){var s=Xe,f=wn();if(nt){if(l===void 0)throw Error(a(407));l=l()}else{if(l=n(),qt===null)throw Error(a(349));(ut&127)!==0||sp(s,n,l)}f.memoizedState=l;var d={value:l,getSnapshot:n};return f.queue=d,kp(up.bind(null,s,d,e),[e]),s.flags|=2048,Jl(9,{destroy:void 0},op.bind(null,s,d,l,n),null),l},useId:function(){var e=wn(),n=qt.identifierPrefix;if(nt){var l=xi,s=bi;l=(s&~(1<<32-jt(s)-1)).toString(32)+l,n="_"+n+"R_"+l,l=No++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=xw++,n="_"+n+"r_"+l.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:nf,useFormState:vp,useActionState:vp,useOptimistic:function(e){var n=wn();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 wn().memoizedState=Tw.bind(null,Xe)},useEffectEvent:function(e){var n=wn(),l={impl:e};return n.memoizedState=l,function(){if((kt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Ip={readContext:un,use:Ao,useCallback:Ap,useContext:un,useEffect:Pc,useImperativeHandle:Cp,useInsertionEffect:jp,useLayoutEffect:Tp,useMemo:Rp,useReducer:Ro,useRef:Sp,useState:function(){return Ro(Qi)},useDebugValue:Wc,useDeferredValue:function(e,n){var l=Kt();return _p(l,zt.memoizedState,e,n)},useTransition:function(){var e=Ro(Qi)[0],n=Kt().memoizedState;return[typeof e=="boolean"?e:es(e),n]},useSyncExternalStore:ap,useId:qp,useHostTransitionStatus:nf,useFormState:bp,useActionState:bp,useOptimistic:function(e,n){var l=Kt();return dp(l,zt,e,n)},useMemoCache:Xc,useCacheRefresh:Dp,useEffectEvent:Ep},Cw={readContext:un,use:Ao,useCallback:Ap,useContext:un,useEffect:Pc,useImperativeHandle:Cp,useInsertionEffect:jp,useLayoutEffect:Tp,useMemo:Rp,useReducer:Zc,useRef:Sp,useState:function(){return Zc(Qi)},useDebugValue:Wc,useDeferredValue:function(e,n){var l=Kt();return zt===null?ef(l,e,n):_p(l,zt.memoizedState,e,n)},useTransition:function(){var e=Zc(Qi)[0],n=Kt().memoizedState;return[typeof e=="boolean"?e:es(e),n]},useSyncExternalStore:ap,useId:qp,useHostTransitionStatus:nf,useFormState:wp,useActionState:wp,useOptimistic:function(e,n){var l=Kt();return zt!==null?dp(l,zt,e,n):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Xc,useCacheRefresh:Dp,useEffectEvent:Ep};function lf(e,n,l,s){n=e.memoizedState,l=l(s,n),l=l==null?n:L({},n,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var af={enqueueSetState:function(e,n,l){e=e._reactInternals;var s=Un(),f=vr(s);f.payload=n,l!=null&&(f.callback=l),n=br(e,f,s),n!==null&&(Cn(n,e,s),Za(n,e,s))},enqueueReplaceState:function(e,n,l){e=e._reactInternals;var s=Un(),f=vr(s);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=br(e,f,s),n!==null&&(Cn(n,e,s),Za(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var l=Un(),s=vr(l);s.tag=2,n!=null&&(s.callback=n),n=br(e,s,l),n!==null&&(Cn(n,e,l),Za(n,e,l))}};function Vp(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?!Ia(l,s)||!Ia(f,d):!0}function Yp(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 ul(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=L({},l));for(var f in e)l[f]===void 0&&(l[f]=e[f])}return l}function Fp(e){so(e)}function Gp(e){console.error(e)}function $p(e){so(e)}function qo(e,n){try{var l=e.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function Xp(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=vr(l),l.tag=3,l.payload={element:null},l.callback=function(){qo(e,n)},l}function Qp(e){return e=vr(e),e.tag=3,e}function Zp(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(){Xp(n,l,s)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Xp(n,l,s),typeof f!="function"&&(Nr===null?Nr=new Set([this]):Nr.add(this));var k=s.stack;this.componentDidCatch(s.value,{componentStack:k!==null?k:""})})}function Aw(e,n,l,s,f){if(l.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=l.alternate,n!==null&&tl(n,l,f,!0),l=cn.current,l!==null){switch(l.tag){case 31:case 13:case 19:return bn===null?nu():l.alternate===null&&Xt===0&&(Xt=3),l.flags&=-257,l.flags|=65536,l.lanes=f,s===wo?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===wo?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),nu(),!1}if(nt)return n=cn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,s!==Tc&&(e=Error(a(422),{cause:s}),Fa(Jn(e,l)))):(s!==Tc&&(n=Error(a(423),{cause:s}),Fa(Jn(n,l))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,s=Jn(s,l),f=sf(e.stateNode,s,f),Dc(e,f),Xt!==4&&(Xt=2)),!1;var d=Error(a(520),{cause:s});if(d=Jn(d,l),us===null?us=[d]:us.push(d),Xt!==4&&(Xt=2),n===null)return!0;s=Jn(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"&&(Nr===null||!Nr.has(d))))return l.flags|=65536,f&=-f,l.lanes|=f,f=Qp(f),Zp(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)),Wt=!1;function rn(e,n,l,s){n.child=e===null?Wm(n,null,l,s):sl(n,e.child,l,s)}function Kp(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 nl(n),s=Yc(e,n,l,b,d,f),k=Fc(),e!==null&&!Wt?(Gc(e,n,f),Zi(e,n,f)):(nt&&k&&mo(n),n.flags|=1,rn(e,n,s,f),n.child)}function Jp(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,Pp(e,n,d,s,f)):(e=fo(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:Ia,l(b,s)&&e.ref===n.ref)return Zi(e,n,f)}return n.flags|=1,e=Yi(d,s),e.ref=n.ref,e.return=n,n.child=e}function Pp(e,n,l,s,f){if(e!==null){var d=e.memoizedProps;if(Ia(d,s)&&e.ref===n.ref)if(Wt=!1,n.pendingProps=s=d,yf(e,f))(e.flags&131072)!==0&&(Wt=!0);else return n.lanes=e.lanes,Zi(e,n,f)}return uf(e,n,l,s,f)}function Wp(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 ey(e,n,d,l,s)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&bo(n,d!==null?d.cachePool:null),d!==null?np(n,d):Bc(),ip(n);else return s=n.lanes=536870912,ey(e,n,d!==null?d.baseLanes|l:l,l,s)}else d!==null?(bo(n,d.cachePool),np(n,d),Sr(),n.memoizedState=null):(e!==null&&bo(n,null),Bc(),Sr());return rn(e,n,f,l),n.child}function ns(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function ey(e,n,l,s,f){var d=Oc();return d=d===null?null:{parent:Jt._currentValue,pool:d},n.memoizedState={baseLanes:l,cachePool:d},e!==null&&bo(n,null),Bc(),ip(n),e!==null&&tl(e,n,s,!0),n.childLanes=f,null}function Do(e,n){return n=Lo({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function ty(e,n,l){return sl(n,e.child,null,l),e=Do(n,n.pendingProps),e.flags|=2,qn(n),n.memoizedState=null,e}function Rw(e,n,l){var s=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(nt){if(s.mode==="hidden")return e=Do(n,s),n.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},ns(null,e);if(Hc(n),(e=Ht)?(e=Ng(e,ei),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:dr!==null?{id:bi,overflow:xi}:null,retryLane:536870912,hydrationErrors:null},l=Bm(e),l.return=n,n.child=l,ln=n,Ht=null)):e=null,e===null)throw mr(n);return n.lanes=536870912,null}return Do(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=ty(e,n,l);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(a(558));else if(Wt||tl(e,n,l,!1),f=(l&e.childLanes)!==0,Wt||f){if(xr.current===null){if(s=qt,s!==null&&(b=Ir(s,l),b!==0&&b!==d.retryLane))throw d.retryLane=b,Jr(e,b),Cn(s,e,b),of;nu()}n=ty(e,n,l)}else e=d.treeContext,Ht=ni(b.nextSibling),ln=n,nt=!0,hr=null,ei=!1,e!==null&&Im(n,e),n=Do(n,s),n.flags|=134221824;return n}return e=Yi(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Pl(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 nl(n),l=Yc(e,n,l,s,void 0,f),s=Fc(),e!==null&&!Wt?(Gc(e,n,f),Zi(e,n,f)):(nt&&s&&mo(n),n.flags|=1,rn(e,n,l,f),n.child)}function ny(e,n,l,s,f,d){return nl(n),n.updateQueue=null,l=lp(n,s,l,f),rp(e),s=Fc(),e!==null&&!Wt?(Gc(e,n,d),Zi(e,n,d)):(nt&&s&&mo(n),n.flags|=1,rn(e,n,l,d),n.child)}function iy(e,n,l,s,f){if(nl(n),n.stateNode===null){var d=Vl,b=l.contextType;typeof b=="object"&&b!==null&&(d=un(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?un(b):Vl,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),Ja(n,s,d,f),Ka(),d.state=n.memoizedState),typeof d.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){d=n.stateNode;var k=n.memoizedProps,_=ul(l,k);d.props=_;var I=d.context,X=l.contextType;b=Vl,typeof X=="object"&&X!==null&&(b=un(X));var ne=l.getDerivedStateFromProps;X=typeof ne=="function"||typeof d.getSnapshotBeforeUpdate=="function",k=n.pendingProps!==k,X||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(k||I!==b)&&Yp(n,d,s,b),gr=!1;var U=n.memoizedState;d.state=U,Ja(n,s,d,f),Ka(),I=n.memoizedState,k||U!==I||gr?(typeof ne=="function"&&(lf(n,l,ne,s),I=n.memoizedState),(_=gr||Vp(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=ul(l,b),d.props=X,ne=n.pendingProps,U=d.context,I=l.contextType,_=Vl,typeof I=="object"&&I!==null&&(_=un(I)),k=l.getDerivedStateFromProps,(I=typeof k=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==ne||U!==_)&&Yp(n,d,s,_),gr=!1,U=n.memoizedState,d.state=U,Ja(n,s,d,f),Ka();var $=n.memoizedState;b!==ne||U!==$||gr||e!==null&&e.dependencies!==null&&go(e.dependencies)?(typeof k=="function"&&(lf(n,l,k,s),$=n.memoizedState),(X=gr||Vp(n,l,X,s,U,$,_)||e!==null&&e.dependencies!==null&&go(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,Pl(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=sl(n,e.child,null,f),n.child=sl(n,null,l,f)):rn(e,n,l,f),n.memoizedState=d.state,e=n.child):e=Zi(e,n,f),e}function ry(e,n,l,s){return Wr(),n.flags|=256,rn(e,n,l,s),n.child}var cf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ff(e){return{baseLanes:e,cachePool:Xm()}}function df(e,n,l){return e=e!==null?e.childLanes&~l:0,n&&(e|=Bn),e}function ly(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:(fn.current&2)!==0),b&&(f=!0,n.flags&=-129),b=(n.flags&32)!==0,n.flags&=-33,e===null){if(nt){if(f?wr(n):Sr(),(e=Ht)?(e=Ng(e,ei),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:dr!==null?{id:bi,overflow:xi}:null,retryLane:536870912,hydrationErrors:null},l=Bm(e),l.return=n,n.child=l,ln=n,Ht=null)):e=null,e===null)throw mr(n);return fd(e)?n.lanes=32:n.lanes=536870912,null}return d=s.children,s=s.fallback,f?(Sr(),f=n.mode,d=Lo({mode:"hidden",children:d},f),s=Pr(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,ns(null,s)):(wr(n),hf(n,d))}var k=e.memoizedState;if(k!==null){var _=k.dehydrated;if(_!==null)return _w(e,n,d,b,s,_,k,l)}return f?(Sr(),f=s.fallback,d=n.mode,k=e.child,_=k.sibling,s=Yi(k,{mode:"hidden",children:s.children}),s.subtreeFlags=k.subtreeFlags&1206910976,_!==null?f=Yi(_,f):(f=Pr(f,d,l,null),f.flags|=2),f.return=n,s.return=n,s.sibling=f,n.child=s,ns(null,s),s=n.child,f=e.child.memoizedState,f===null?f=ff(l):(d=f.cachePool,d!==null?(k=Jt._currentValue,d=d.parent!==k?{parent:k,pool:k}:d):d=Xm(),f={baseLanes:f.baseLanes|l,cachePool:d}),s.memoizedState=f,s.childLanes=df(e,b,l),n.memoizedState=cf,ns(e.child,s)):(wr(n),l=e.child,e=l.sibling,l=Yi(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=Lo({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Lo(e,n){return e=En(22,e,null,n),e.lanes=0,e}function Bo(e,n,l){return sl(n,e.child,null,l),e=hf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function _w(e,n,l,s,f,d,b,k){if(l)return n.flags&256?(wr(n),n.flags&=-257,Bo(e,n,k)):n.memoizedState!==null?(Sr(),n.child=e.child,n.flags|=128,null):(Sr(),d=f.fallback,b=n.mode,f=Lo({mode:"visible",children:f.children},b),d=Pr(d,b,k,null),d.flags|=2,f.return=n,d.return=n,f.sibling=d,n.child=f,sl(n,e.child,null,k),f=n.child,f.memoizedState=ff(k),f.childLanes=df(e,s,k),n.memoizedState=cf,ns(null,f));if(wr(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,Fa({value:f,source:null,stack:null})),Bo(e,n,k)}if(Wt||tl(e,n,k,!1),s=(k&e.childLanes)!==0,Wt||s){if(xr.current!==null)return Bo(e,n,k);if(s=qt,s!==null&&(f=Ir(s,k),f!==0&&f!==b.retryLane))throw b.retryLane=f,Jr(e,f),Cn(s,e,f),of;return cd(d)||nu(),Bo(e,n,k)}return cd(d)?(n.flags|=192,n.child=e.child,null):(e=b.treeContext,Ht=ni(d.nextSibling),ln=n,nt=!0,hr=null,ei=!1,e!==null&&Im(n,e),n=hf(n,f.children),n.flags|=134221824,n)}function ay(e,n,l){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),yo(e.return,n,l)}function sy(e){for(var n=null;e!==null;){var l=e.alternate;l!==null&&jo(l)===null&&(n=e),e=e.sibling}return n}function Uo(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=fn.current;if(n.flags&128)return Pa(n,b),null;var k=(b&2)!==0;if(k?(b=b&1|2,n.flags|=128):b&=1,Pa(n,b),f==="backwards"&&e!==null?(mf(e),rn(e,n,s,l),mf(e)):rn(e,n,s,l),s=nt?Ya:0,!k&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ay(e,l,n);else if(e.tag===19)ay(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=sy(n.child),l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null,mf(n)),Uo(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&&jo(e)===null){n.child=f;break}e=f.sibling,f.sibling=l,l=f,f=e}Uo(n,!0,l,null,d,s);break;case"together":Uo(n,!1,null,null,void 0,s);break;case"independent":n.memoizedState=null;break;default:l=sy(n.child),l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),Uo(n,!1,f,l,d,s)}return n.child}function oy(e,n,l){var s=n.pendingProps;return pr(n,n.type,s.value),rn(e,n,s.children,l),n.child}function Zi(e,n,l){if(e!==null&&(n.dependencies=e.dependencies),Tr|=n.lanes,(l&n.childLanes)===0)if(e!==null){if(tl(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=Yi(e,e.pendingProps),n.child=l,l.return=n;e.sibling!==null;)e=e.sibling,l=l.sibling=Yi(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&&go(e)))}function Ow(e,n,l){switch(n.tag){case 3:Be(n,n.stateNode.containerInfo),pr(n,Jt,e.memoizedState.cache),Wr();break;case 27:case 5:Qt(n);break;case 4:Be(n,n.stateNode.containerInfo);break;case 10:pr(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 wr(n),n.flags|=128,null;s=tl(e,n,l,!1);var f=n.child.childLanes;return s||(l&f)!==0?ly(e,n,l):(wr(n),e=Zi(e,n,l),e!==null?e.sibling:null)}wr(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||(tl(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),Pa(n,fn.current),s)break;return null;case 22:return n.lanes=0,Wp(e,n,l,n.pendingProps);case 24:pr(n,Jt,e.memoizedState.cache)}return Zi(e,n,l)}function uy(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps)Wt=!0;else{if(!yf(e,l)&&(n.flags&128)===0)return Wt=!1,Ow(e,n,l);Wt=(e.flags&131072)!==0}else Wt=!1,nt&&(n.flags&1048576)!==0&&Hm(n,Ya,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=ll(n.elementType),n.type=e,typeof e=="function")Sc(e)?(s=ul(e,s),n.tag=1,n=iy(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=Kp(null,n,e,s,l);break e}else if(f===Te){n.tag=14,n=Jp(null,n,e,s,l);break e}else if(f===ge){n.tag=10,n.type=e,n=oy(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=ul(s,n.pendingProps),iy(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),Ja(n,s,null,l);var b=n.memoizedState;if(s=b.cache,pr(n,Jt,s),s!==d.cache&&Ac(n,[Jt],l,!0),Ka(),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=ry(e,n,s,l);break e}else if(s!==f){f=Jn(Error(a(424)),n),Fa(f),n=ry(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=ni(e.firstChild),ln=n,nt=!0,hr=null,ei=!0,l=Wm(n,null,s,l),n.child=l;l;)l.flags=l.flags&-3|134221824,l=l.sibling;else{if(Wr(),s===f){n=Zi(e,n,l);break e}rn(e,n,s,l)}n=n.child}return n;case 26:return Pl(e,n),e===null?(l=Mg(n.type,null,n.pendingProps,null))?n.memoizedState=l:nt||(n.stateNode=hg(n.type,n.pendingProps,rt.current,n)):n.memoizedState=Mg(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Qt(n),e===null&&nt&&(s=n.stateNode=Rg(n.type,n.pendingProps,rt.current),ln=n,ei=!0,f=Ht,Rr(n.type)?(dd=f,Ht=ni(s.firstChild)):Ht=f),rn(e,n,n.pendingProps.children,l),Pl(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&nt&&((f=s=Ht)&&(s=TS(s,n.type,n.pendingProps,ei),s!==null?(n.stateNode=s,ln=n,Ht=ni(s.firstChild),ei=!1,f=!0):f=!1),f||mr(n)),Qt(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,ww,null,null,l),ya._currentValue=f),Pl(e,n),rn(e,n,s,l),n.child;case 6:return e===null&&nt&&((e=l=Ht)&&(l=NS(l,n.pendingProps,ei),l!==null?(n.stateNode=l,ln=n,Ht=null,e=!0):e=!1),e||mr(n)),null;case 13:return ly(e,n,l);case 4:return Be(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=sl(n,null,s,l):rn(e,n,s,l),n.child;case 11:return Kp(e,n,n.type,n.pendingProps,l);case 7:return s=n.pendingProps,Pl(e,n),rn(e,n,s,l),n.child;case 8:return rn(e,n,n.pendingProps.children,l),n.child;case 12:return rn(e,n,n.pendingProps.children,l),n.child;case 10:return oy(e,n,l);case 9:return f=n.type._context,s=n.pendingProps.children,nl(n),f=un(f),s=s(f),n.flags|=1,rn(e,n,s,l),n.child;case 14:return Jp(e,n,n.type,n.pendingProps,l);case 15:return Pp(e,n,n.type,n.pendingProps,l);case 19:return pf(e,n,l);case 31:return Rw(e,n,l);case 22:return Wp(e,n,l,n.pendingProps);case 24:return nl(n),s=un(Jt),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),pr(n,Jt,f)):((e.lanes&l)!==0&&(qc(e,n),Ja(n,null,null,l),Ka()),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),pr(n,Jt,s)):(s=d.cache,pr(n,Jt,s),s!==f.cache&&Ac(n,[Jt],l,!0))),rn(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:nt&&mo(n),e!==null&&e.memoizedProps.name!==s.name?n.flags|=4194816:Pl(e,n),rn(e,n,s.children,l),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function Ki(e){e.flags|=4}function gf(e,n,l,s,f){var d;if((d=(e.mode&32)!==0)&&(d=l===null?Bg(n,s):Bg(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(Fy())e.flags|=8192;else throw al=wo,zc}else e.flags&=-16777217}function cy(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ug(n))if(Fy())e.flags|=8192;else throw al=wo,zc}function Ho(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Xs():536870912,e.lanes|=n,ia|=n)}function is(e,n){if(!nt)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 zw(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),$i(Jt),ft(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Gl(n)?Ki(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?(Ki(n),d!==null?(It(n),cy(n,d)):(It(n),gf(n,f,null,s,l))):d?d!==e.memoizedState?(Ki(n),It(n),cy(n,d)):(It(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Ki(n),It(n),gf(n,f,e,s,l)),null;case 27:if(Bt(n),l=rt.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Ki(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return It(n),n.subtreeFlags&=-33554433,null}e=Ae.current,Gl(n)?Vm(n):(e=Rg(f,s,l),n.stateNode=e,Ki(n))}return It(n),n.subtreeFlags&=-33554433,null;case 5:if(Bt(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Ki(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return It(n),n.subtreeFlags&=-33554433,null}if(d=Ae.current,Gl(n))Vm(n);else{var b=ms(rt.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[Zt]=n,d[on]=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(hn(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&&Ki(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&&Ki(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(a(166));if(e=rt.current,Gl(n)){if(e=n.stateNode,l=n.memoizedProps,s=null,f=ln,f!==null)switch(f.tag){case 27:case 5:s=f.memoizedProps}e[Zt]=n,e=!!(e.nodeValue===l||s!==null&&s.suppressHydrationWarning===!0||ug(e.nodeValue,l)),e||mr(n,!0)}else e=ms(e).createTextNode(s),e[Zt]=n,n.stateNode=e}return It(n),null;case 31:if(l=n.memoizedState,e===null||e.memoizedState!==null){if(s=Gl(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[Zt]=n}else Wr(),(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?(qn(n),n):(qn(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=Gl(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[Zt]=n}else Wr(),(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?(qn(n),n):(qn(n),null)}return qn(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),Ho(n,n.updateQueue),It(n),null);case 4:return ft(),e===null&&Pf(n.stateNode.containerInfo),n.flags|=67108864,It(n),null;case 10:return $i(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)is(s,!1);else{if(Xt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(d=jo(e),d!==null){for(n.flags|=128,is(s,!1),e=d.updateQueue,n.updateQueue=e,Ho(n,e),n.subtreeFlags=0,e=l,l=n.child;l!==null;)Lm(l,e),l=l.sibling;return Pa(n,fn.current&1|2),nt&&Fi(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&Nt()>Po&&(n.flags|=128,f=!0,is(s,!1),n.lanes=4194304)}else{if(!f)if(e=jo(d),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,Ho(n,e),is(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!d.alternate&&!nt)return It(n),null}else 2*Nt()-s.renderingStartTime>Po&&l!==536870912&&(n.flags|=128,f=!0,is(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=fn.current,d=f?d&1|2:d&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!l||nt?Pa(n,d):(l=d,Ve(cn,n),Ve(fn,l),bn===null&&(bn=n)),nt&&Fi(n,s.treeForkCount),e}return It(n),null;case 22:case 23:return qn(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&&Ho(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(rl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),$i(Jt),It(n),null;case 25:return null;case 30:return n.flags|=33554432,It(n),null}throw Error(a(156,n.tag))}function Mw(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 $i(Jt),ft(),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(qn(n),n.alternate===null)throw Error(a(340));Wr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(qn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(a(340));Wr()}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 ft(),null;case 10:return $i(n.type),null;case 22:case 23:return qn(n),Uc(),e!==null&&Me(rl),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return $i(Jt),null;case 25:return null;default:return null}}function fy(e,n){switch(jc(n),n.tag){case 3:$i(Jt),ft();break;case 26:case 27:case 5:Bt(n);break;case 4:ft();break;case 31:n.memoizedState!==null&&qn(n);break;case 13:qn(n);break;case 19:Ic(n);break;case 10:$i(n.type);break;case 22:case 23:qn(n),Uc(),e!==null&&Me(rl);break;case 24:$i(Jt)}}function rs(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 kr(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 dy(e){var n=e.updateQueue;if(n!==null){var l=e.stateNode;try{tp(n,l)}catch(s){Rt(e,e.return,s)}}}function hy(e,n,l){l.props=ul(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(s){Rt(e,n,s)}}function wi(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=Ii(e.memoizedProps,f);(f.ref===null||f.ref.name!==d)&&(f.ref=xg(d)),s=f.ref;break;case 7:if(e.stateNode===null){var b=new Hn(e);g(e.child,!1,ES,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 dn(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 Io(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++)Tg(e.stateNode,n[l])}function my(e){for(var n=e.return;n!==null&&(bf(n)&&Tg(e.stateNode,n.stateNode),!vf(n));)n=n.return}function ls(e){for(var n=e.return;n!==null&&(bf(n)&&jS(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;aS(s,e.type,l,n),s[on]=n}catch(f){Rt(e,e.return,f)}}function py(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Rr(e.type)||e.tag===4}function Sf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||py(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&&Rr(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=Xn)),Io(e,s),dt=!0;else if(f!==4&&(f===27&&(Io(e,s),s=null,Rr(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 Vo(e,n,l,s){var f=e.tag;if(f===5||f===6)f=e.stateNode,n?l.insertBefore(f,n):l.appendChild(f),Io(e,s),dt=!0;else if(f!==4&&(f===27&&(Io(e,s),s=null,Rr(e.type)&&(l=e.stateNode)),e=e.child,e!==null))for(Vo(e,n,l,s),e=e.sibling;e!==null;)Vo(e,n,l,s),e=e.sibling}function yy(e){var n=e.stateNode,l=e.memoizedProps;try{for(var s=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);hn(n,s,l),n[Zt]=e,n[on]=l}catch(d){Rt(e,e.return,d)}}var Yo=!1,Dn=null;function gy(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Yo=!0)}var Si=null;function vy(){var e=Si;return Si=null,e}var jn=0;function Wl(e,n,l,s,f){return jn=0,by(e.child,n,l,s,f)}function by(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);Yo=!0,vg(b,jn===0?n:n+"_"+jn,l),jn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&f||by(e.child,n,l,s,f)&&(d=!0));e=e.sibling}return d}function ki(e,n){for(;e!==null;)e.tag===5?bg(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&n||ki(e.child,n)),e=e.sibling}function Fo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Fo(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=Vi(n.default,n.share),n!=="none"&&(Wl(e,l,n,null,!1)||ki(e.child,!1))}e=e.sibling}}function Ef(e,n){if(e.tag===30){var l=e.stateNode,s=e.memoizedProps,f=Ii(s,l),d=Vi(s.default,l.paired?s.share:s.enter);d!=="none"?Wl(e,f,d,null,!1)?(Fo(e),l.paired||n||sa(e,s.onEnter)):ki(e.child,!1):Fo(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Ef(e,n),e=e.sibling;else Fo(e)}function jf(e){if(Dn!==null&&Dn.size!==0){var n=Dn;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=Vi(l.default,l.share);if(d!=="none"&&(Wl(e,s,d,null,!1)?(d=e.stateNode,f.paired=d,d.paired=f,sa(e,l.onShare)):ki(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=Ii(n,e.stateNode),s=Dn!==null?Dn.get(l):void 0,f=Vi(n.default,s!==void 0?n.share:n.exit);f!=="none"&&(Wl(e,l,f,null,!1)?s!==void 0?(f=e.stateNode,s.paired=f,f.paired=s,Dn.delete(l),sa(e,n.onShare)):sa(e,n.onExit):ki(e.child,!1)),Dn!==null&&jf(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Tf(e),e=e.sibling;else Dn!==null&&jf(e)}function xy(e){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,l=Ii(n,e.stateNode);n=Vi(n.default,n.update),e.flags&=-5,n!=="none"&&Wl(e,l,n,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&xy(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,ki(e.child,!1))}Nf(e)}e=e.sibling}}function Go(e){if(e.tag===30)e.stateNode.paired=null,ki(e.child,!1),Nf(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Go(e),e=e.sibling;else Nf(e)}function wy(e){for(e=e.child;e!==null;)e.tag===30?ki(e.child,!1):(e.subtreeFlags&33554432)!==0&&wy(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&&jn<d.length){var I=d[jn],X=ad(_);(I.view||X.view)&&(k=!0);var ne;if(ne=(e.flags&4)===0)if(X.clip)ne=!0;else{ne=I.rect;var U=X.rect;ne=ne.y!==U.y||ne.x!==U.x||ne.height!==U.height||ne.width!==U.width}ne&&(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&&vg(_,jn===0?l:l+"_"+jn,f),k&&(e.flags&4)!==0||(Si===null&&(Si=[]),Si.push(_,jn===0?s:s+"_"+jn,n.memoizedProps)),jn++}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 Sy(e,n){for(e=e.child;e!==null;){if(e.tag===30){var l=e.memoizedProps,s=e.stateNode,f=Ii(l,s),d=Vi(l.default,l.update),b;b=e.memoizedState,e.memoizedState=null,s=e;var k=e.child;jn=0,f=Cf(s,k,f,f,d,b,!1),(e.flags&4)!==0&&f&&sa(e,l.onUpdate)}else(e.subtreeFlags&33554432)!==0&&Sy(e);e=e.sibling}}var an=!1,Tt=!1,Ei=!1,Af=!1,ky=typeof WeakSet=="function"?WeakSet:Set,sn=null,ji=!1,as=!1,$o=!1,Rf=!1;function qw(e,n,l){if(e=e.containerInfo,td=ga,e=Nm(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,ne=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&&++ne===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},ga=!1,l=(l&335544064)===l,sn=n,n=l?9270:1024;sn!==null;){if(e=sn,l&&(s=e.deletions,s!==null))for(d=0;d<s.length;d++)l&&Tf(s[d]);if(e.alternate===null&&(e.flags&2)!==0)l&&gy(e),Xo(l);else{if(e.tag===22){if(s=e.alternate,e.memoizedState!==null){s!==null&&s.memoizedState===null&&l&&Tf(s),Xo(l);continue}else if(s!==null&&s.memoizedState!==null){l&&gy(e),Xo(l);continue}}s=e.child,(e.subtreeFlags&n)!==0&&s!==null?(s.return=e,sn=s):(l&&xy(e),Xo(l))}}Dn=null}function Xo(e){for(;sn!==null;){var n=sn,l=e,s=n.alternate,f=n.flags;switch(n.tag){case 0:case 11:case 15:break;case 1:if((f&1024)!==0&&s!==null){l=void 0,f=s.memoizedProps,s=s.memoizedState;var d=n.stateNode;try{var b=ul(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=Ii(s.memoizedProps,s.stateNode),f=n.memoizedProps,f=Vi(f.default,f.update),f!=="none"&&Wl(s,l,f,s.memoizedState=[],!0));break;default:if((f&1024)!==0)throw Error(a(163))}if(s=n.sibling,s!==null){s.return=n.return,sn=s;break}sn=n.return}}function Ey(e,n,l){var s=l.flags;switch(l.tag){case 0:case 11:case 15:Ti(e,l),s&4&&rs(5,l);break;case 1:if(Ti(e,l),s&4)if(e=l.stateNode,n===null)try{e.componentDidMount()}catch(b){Rt(l,l.return,b)}else{var f=ul(l.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Rt(l,l.return,b)}}s&64&&dy(l),s&512&&wi(l,l.return);break;case 3:if(Ti(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{tp(e,n)}catch(b){Rt(l,l.return,b)}}break;case 27:n===null&&s&4&&yy(l);case 26:case 5:Ti(e,l),n===null&&s&4&&xf(l),s&512&&wi(l,l.return);break;case 12:Ti(e,l);break;case 31:Ti(e,l),s&4&&Cy(e,l);break;case 13:Ti(e,l),s&4&&Ay(e,l),s&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Xw.bind(null,l),CS(e,l))));break;case 22:if(s=l.memoizedState!==null||an,!s){var d=n!==null&&n.memoizedState!==null||Tt;n=an,f=Tt,an=s,(Tt=d)&&!f?(s=2,(l.subtreeFlags&8772)!==0&&(s|=1),ci(e,l,s)):Ti(e,l),an=n,Tt=f}break;case 30:Ti(e,l),s&512&&wi(l,l.return);break;case 7:s&512&&wi(l,l.return);default:Ti(e,l)}}function _f(e,n){for(e=e.child;e!==null;)jy(e,n),e=e.sibling}function jy(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,dt=!0}catch(_){Rt(e,e.return,_)}break;case 18:try{var k=e.stateNode;n?gg(k,!0):gg(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:jy(l,s);break e;case 22:l.memoizedState===null&&Of(l,s);break e;default:Of(l,s)}}e=e.sibling}}function Ty(e){var n=e.alternate;n!==null&&(e.alternate=null,Ty(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Li(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,Tn=!1;function oi(e,n,l){for(l=l.child;l!==null;)Ny(e,n,l),l=l.sibling}function Ny(e,n,l){if(ot&&typeof ot.onCommitFiberUnmount=="function")try{ot.onCommitFiberUnmount(yt,l)}catch{}switch(l.tag){case 26:Tt||dn(l,n),oi(e,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&!Tt&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Tt||dn(l,n),ls(l);var s=Yt,f=Tn;Rr(l.type)&&(Yt=l.stateNode,Tn=!1),oi(e,n,l),_g(l.stateNode,l.type,l.memoizedProps),Yt=s,Tn=f;break;case 5:Tt||dn(l,n),ls(l);case 6:if(l.tag===6&&ls(l),s=Yt,f=Tn,Yt=null,oi(e,n,l),Yt=s,Tn=f,Yt!==null)if(Tn)try{(Yt.nodeType===9?Yt.body:Yt.nodeName==="HTML"?Yt.ownerDocument.body:Yt).removeChild(l.stateNode),dt=!0}catch(d){Rt(l,n,d)}else try{Yt.removeChild(l.stateNode),dt=!0}catch(d){Rt(l,n,d)}break;case 18:Yt!==null&&(Tn?(e=Yt,yg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),va(e)):yg(Yt,l.stateNode));break;case 4:s=Yt,f=Tn,Yt=l.stateNode.containerInfo,Tn=!0,oi(e,n,l),Yt=s,Tn=f;break;case 0:case 11:case 14:case 15:kr(2,l,n),Tt||kr(4,l,n),oi(e,n,l);break;case 1:Tt||(dn(l,n),s=l.stateNode,typeof s.componentWillUnmount=="function"&&hy(l,n,s)),oi(e,n,l);break;case 21:oi(e,n,l);break;case 22:Tt=(s=Tt)||l.memoizedState!==null,oi(e,n,l),Tt=s;break;case 30:dn(l,n),oi(e,n,l);break;case 7:Tt||dn(l,n),oi(e,n,l);break;default:oi(e,n,l)}}function Cy(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{va(e)}catch(l){Rt(n,n.return,l)}}}function Ay(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{va(e)}catch(l){Rt(n,n.return,l)}}function Dw(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new ky),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new ky),n;default:throw Error(a(435,e.tag))}}function Qo(e,n){var l=Dw(e);n.forEach(function(s){if(!l.has(s)){l.add(s);var f=Qw.bind(null,e,s);s.then(f,f)}})}function Sn(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(Rr(_.type)){Yt=_.stateNode,Tn=!1;break e}break;case 5:Yt=_.stateNode,Tn=!1;break e;case 3:case 4:Yt=_.stateNode.containerInfo,Tn=!0;break e}_=_.return}if(Yt===null)throw Error(a(160));Ny(b,k,d),Yt=null,Tn=!1,b=d.alternate,b!==null&&(b.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Ry(n,e,l),n=n.sibling}var ui=null;function Ry(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}Sn(n,e,l),kn(e),f&4&&(kr(3,e,e.return),rs(3,e),kr(5,e,e.return));break;case 1:Sn(n,e,l),kn(e),f&512&&(Tt||s===null||dn(s,s.return)),f&64&&an&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?n:l.concat(n))));break;case 26:if(d=ui,Sn(n,e,l),kn(e),f&512&&(Tt||s===null||dn(s,s.return)),f&4)if(f=s!==null?s.memoizedState:null,l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null)if(an)e.stateNode=hg(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[Di]||s[Zt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=f.createElement(n),f.head.insertBefore(s,f.querySelector("head > title"))),hn(s,n,l),s[Zt]=e,Ut(s),n=s;break e;case"link":if(d=Lg("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),hn(s,n,l),f.head.appendChild(s);break;case"meta":if(d=Lg("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),hn(s,n,l),f.head.appendChild(s);break;default:throw Error(a(468,n))}s[Zt]=e,Ut(s),n=s}e.stateNode=n}else an||yd(d,e.type,e.stateNode);else e.stateNode=Dg(d,l,e.memoizedProps);else f!==l?(f===null?(n=s.stateNode,n===null||Tt||n.parentNode.removeChild(n)):f.count--,l===null?an||yd(d,e.type,e.stateNode):Dg(d,l,e.memoizedProps)):l===null&&e.stateNode!==null&&wf(e,e.memoizedProps,s.memoizedProps);break;case 27:Sn(n,e,l),kn(e),f&512&&(Tt||s===null||dn(s,s.return)),s!==null&&f&4&&wf(e,e.memoizedProps,s.memoizedProps);break;case 5:if(d=Ei,Ei=!1,Sn(n,e,l),Ei=d,kn(e),f&512&&(Tt||s===null||dn(s,s.return)),e.flags&32){n=e.stateNode;try{Hi(n,""),dt=!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(Sn(n,e,l),kn(e),f&4){if(e.stateNode===null)throw Error(a(162));n=e.memoizedProps,l=e.stateNode;try{l.nodeValue=n,dt=!0}catch(X){Rt(e,e.return,X)}}break;case 3:if(dt=!1,uu=null,d=ui,ui=ps(n.containerInfo),Sn(n,e,l),ui=d,kn(e),f&4&&s!==null&&s.memoizedState.isDehydrated)try{va(n.containerInfo)}catch(X){Rt(e,e.return,X)}Af&&(Af=!1,_y(e)),dt=!1;break;case 4:f=Ei,Ei=an,s=ar(),d=ui,ui=ps(e.stateNode.containerInfo),Sn(n,e,l),kn(e),ui=d,dt&&as&&($o=!0),dt=s,Ei=f;break;case 12:Sn(n,e,l),kn(e);break;case 31:Sn(n,e,l),kn(e),f&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Qo(e,n)));break;case 13:Sn(n,e,l),kn(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Jo=Nt()),f&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Qo(e,n)));break;case 22:d=e.memoizedState!==null,b=s!==null&&s.memoizedState!==null;var k=an,_=Tt,I=Ei;an=k||d,Ei=I||d,Tt=_||b,Sn(n,e,l),Tt=_,Ei=I,an=k,kn(e),f&8192&&(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,!d||s===null||b||an||Tt||(n=b||Tt,l=an,s=Tt,an=d||an,Tt=n,Er(e,2),an=l,Tt=s),!d&&Ei||_f(e,d)),f&4&&(n=e.updateQueue,n!==null&&(l=n.retryQueue,l!==null&&(n.retryQueue=null,Qo(e,l))));break;case 19:Sn(n,e,l),kn(e),f&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Qo(e,n)));break;case 30:f&512&&(Tt||s===null||dn(s,s.return)),f=ar(),d=as,b=(l&335544064)===l,k=e.memoizedProps,as=b&&Vi(k.default,k.update)!=="none",Sn(n,e,l),kn(e),b&&s!==null&&dt&&(e.flags|=4),as=d,dt=f;break;case 21:break;case 7:f&512&&(Tt||s===null||dn(s,s.return)),s&&s.stateNode!==null&&(s.stateNode._fragmentFiber=e);default:Sn(n,e,l),kn(e)}}function kn(e){var n=e.flags;if(n&2){try{for(var l,s=e.return;s!==null;){if(py(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);Vo(e,_,k,b);break;case 5:var I=l.stateNode;l.flags&32&&(Hi(I,""),l.flags&=-33);var X=Sf(e);Vo(e,X,I,b);break;case 3:case 4:var ne=l.stateNode.containerInfo,U=Sf(e);kf(e,U,ne,b);break;default:throw Error(a(161))}}catch($){Rt(e,e.return,$)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function _y(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;_y(n),n.tag===5&&n.flags&1024&&(n=n.stateNode,ga=!0,n.reset(),ga=!1),e=e.sibling}}function ea(e,n){if(n.subtreeFlags&9270)for(n=n.child;n!==null;)Oy(n,e),n=n.sibling;else Sy(n)}function Oy(e,n){var l=e.alternate;if(l===null)Ef(e,!1);else switch(e.tag){case 3:if(Rf=ji=!1,vy(),ea(n,e),!ji&&!$o){if(e=Si,e!==null)for(var s=0;s<e.length;s+=3){l=e[s];var f=e[s+1];bg(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}Si=null;break;case 5:ea(n,e);break;case 4:s=ji,ji=!1,ea(n,e),ji&&($o=!0),ji=s;break;case 22:e.memoizedState===null&&(l.memoizedState!==null?Ef(e,!1):ea(n,e));break;case 30:s=ji,f=vy(),ji=!1,ea(n,e),ji&&(e.flags|=4);var d=e.memoizedProps,b=e.stateNode;n=Ii(d,b),b=Ii(l.memoizedProps,b);var k=Vi(d.default,d.update);k==="none"?n=!1:(d=l.memoizedState,l.memoizedState=null,l=e.child,jn=0,n=Cf(e,l,n,b,k,d,!0),jn!==(d===null?0:d.length)&&(e.flags|=32)),(e.flags&4)!==0&&n?(sa(e,e.memoizedProps.onUpdate),Si=f):f!==null&&(f.push.apply(f,Si),Si=f),ji=(e.flags&32)!==0?!0:s;break;default:ea(n,e)}}function Ti(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Ey(e,n.alternate,n),n=n.sibling}function Er(e,n){for(e=e.child;e!==null;){var l=e,s=n;switch(l.tag){case 0:case 11:case 14:case 15:kr(4,l,l.return),Er(l,s);break;case 1:dn(l,l.return);var f=l.stateNode;typeof f.componentWillUnmount=="function"&&hy(l,l.return,f),Er(l,s);break;case 27:(s&2)!==0&&_g(l.stateNode,l.type,l.memoizedProps);case 5:dn(l,l.return),l.tag!==5&&l.tag!==27||ls(l),Er(l,s);break;case 6:ls(l);break;case 26:dn(l,l.return),f=l.stateNode,l.memoizedState!==null||f===null||Tt||f.parentNode.removeChild(f),Er(l,s);break;case 22:l.memoizedState===null&&Er(l,s);break;case 30:dn(l,l.return),Er(l,s);break;case 7:dn(l,l.return);default:Er(l,s)}e=e.sibling}}function ci(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:ci(f,d,l),rs(4,d);break;case 1:if(ci(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++)ep(I[f],_)}catch(X){Rt(s,s.return,X)}}k&&b&64&&dy(d),wi(d,d.return);break;case 27:(l&2)!==0&&yy(d);case 5:d.tag!==5&&d.tag!==27||my(d),ci(f,d,l),k&&s===null&&b&4&&xf(d),wi(d,d.return);break;case 6:my(d);break;case 26:_=d.stateNode,d.memoizedState!==null||_===null||an||yd(ps(_.ownerDocument),d.type,_),ci(f,d,l),k&&s===null&&b&4&&xf(d),wi(d,d.return);break;case 12:ci(f,d,l);break;case 31:ci(f,d,l),k&&b&4&&Cy(f,d);break;case 13:ci(f,d,l),k&&b&4&&Ay(f,d);break;case 22:d.memoizedState===null&&ci(f,d,l),wi(d,d.return);break;case 30:ci(f,d,l),wi(d,d.return);break;case 7:wi(d,d.return);default:ci(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&&Ga(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&&Ga(e))}function ti(e,n,l,s){var f=(l&335544064)===l;if(n.subtreeFlags&(f?10262:10256))for(n=n.child;n!==null;)zy(e,n,l,s),n=n.sibling;else f&&wy(n)}function zy(e,n,l,s){var f=(l&335544064)===l;f&&n.alternate===null&&n.return!==null&&n.return.alternate!==null&&Go(n);var d=n.flags;switch(n.tag){case 0:case 11:case 15:ti(e,n,l,s),d&2048&&rs(9,n);break;case 1:ti(e,n,l,s);break;case 3:ti(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&&Ga(d)));break;case 12:if(d&2048){ti(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 ti(e,n,l,s);break;case 31:ti(e,n,l,s);break;case 13:ti(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&&Go(k),b._visibility&2?ti(e,n,l,s):ss(e,n)):(f&&k!==null&&k.memoizedState!==null&&Go(n),b._visibility&2?ti(e,n,l,s):(b._visibility|=2,ta(e,n,l,s,(n.subtreeFlags&10256)!==0||!1))),d&2048&&zf(k,n);break;case 24:ti(e,n,l,s),d&2048&&Mf(n.alternate,n);break;case 30:f&&(d=n.alternate,d!==null&&(ki(d.child,!0),ki(n.child,!0))),ti(e,n,l,s);break;default:ti(e,n,l,s)}}function ta(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:ta(d,b,k,_,f),rs(8,b);break;case 23:break;case 22:var X=b.stateNode;b.memoizedState!==null?X._visibility&2?ta(d,b,k,_,f):ss(d,b):(X._visibility|=2,ta(d,b,k,_,f)),f&&I&2048&&zf(b.alternate,b);break;case 24:ta(d,b,k,_,f),f&&I&2048&&Mf(b.alternate,b);break;default:ta(d,b,k,_,f)}n=n.sibling}}function ss(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:ss(l,s),f&2048&&zf(s.alternate,s);break;case 24:ss(l,s),f&2048&&Mf(s.alternate,s);break;default:ss(l,s)}n=n.sibling}}var cl=8192;function fl(e,n,l){if(e.subtreeFlags&cl)for(e=e.child;e!==null;)My(e,n,l),e=e.sibling}function My(e,n,l){switch(e.tag){case 26:fl(e,n,l),e.flags&cl&&(e.memoizedState!==null?VS(l,ui,e.memoizedState,e.memoizedProps):(e=e.stateNode,(n&335544128)===n&&Ig(l,e)));break;case 5:fl(e,n,l),e.flags&cl&&(e=e.stateNode,(n&335544128)===n&&Ig(l,e));break;case 3:case 4:var s=ui;ui=ps(e.stateNode.containerInfo),fl(e,n,l),ui=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=cl,cl=16777216,fl(e,n,l),cl=s):fl(e,n,l));break;case 30:if((e.flags&cl)!==0&&(s=e.memoizedProps.name,s!=null&&s!=="auto")){var f=e.stateNode;f.paired=null,Dn===null&&(Dn=new Map),Dn.set(s,f)}fl(e,n,l);break;default:fl(e,n,l)}}function qy(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 os(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];sn=s,Ly(s,e)}qy(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Dy(e),e=e.sibling}function Dy(e){switch(e.tag){case 0:case 11:case 15:os(e),e.flags&2048&&kr(9,e,e.return);break;case 3:os(e);break;case 12:os(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Zo(e)):os(e);break;default:os(e)}}function Zo(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];sn=s,Ly(s,e)}qy(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:kr(8,n,n.return),Zo(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,Zo(n));break;default:Zo(n)}e=e.sibling}}function Ly(e,n){for(;sn!==null;){var l=sn;switch(l.tag){case 0:case 11:case 15:kr(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:Ga(l.memoizedState.cache)}if(s=l.child,s!==null)s.return=l,sn=s;else e:for(l=e;sn!==null;){s=sn;var f=s.sibling,d=s.return;if(Ty(s),s===l){sn=null;break e}if(f!==null){f.return=d,sn=f;break e}sn=d}}}var Lw={getCacheForType:function(e){var n=un(Jt),l=n.data.get(e);return l===void 0&&(l=e(),n.data.set(e,l)),l},cacheSignal:function(){return un(Jt).controller.signal}},Bw=typeof WeakMap=="function"?WeakMap:Map,kt=0,qt=null,lt=null,ut=0,At=0,Ln=null,jr=!1,na=!1,qf=!1,Ji=0,Xt=0,Tr=0,dl=0,Ko=0,Bn=0,ia=0,us=null,Nn=null,Df=!1,Jo=0,By=0,Po=1/0,Wo=null,Nr=null,Gt=0,fi=null,hl=null,Ni=0,Lf=0,Bf=null,Uy=null,ra=null,la=null,aa=null,cs=0,eu=null;function Un(){return(kt&2)!==0&&ut!==0?ut&-ut:K.T!==null?Qf():Al()}function Hy(){if(Bn===0)if((ut&536870912)===0||nt){var e=li;li<<=1,(li&3932160)===0&&(li=262144),Bn=e}else Bn=536870912;return e=cn.current,e!==null&&(e.flags|=32),Bn}function sa(e,n){if(n!=null){var l=e.stateNode,s=l.ref;s===null&&(s=l.ref=xg(Ii(e.memoizedProps,l))),la===null&&(la=[]),la.push(n.bind(null,s))}}function Cn(e,n,l){(e===qt&&(At===2||At===9)||e.cancelPendingCommit!==null)&&(oa(e,0),Cr(e,ut,Bn,!1)),Hr(e,l),((kt&2)===0||e!==qt)&&(e===qt&&((kt&2)===0&&(dl|=l),Xt===4&&Cr(e,ut,Bn,!1)),Ci(e))}function Iy(e,n,l){if((kt&6)!==0)throw Error(a(327));var s=!l&&(n&127)===0&&(n&e.expiredLanes)===0||nr(e,n),f=s?Iw(e,n):Hf(e,n,!0),d=s;do{if(f===0){na&&!s&&Cr(e,n,0,!1);break}else{if(l=e.current.alternate,d&&!Uw(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=us;var _=k.current.memoizedState.isDehydrated;if(_&&(oa(k,b).flags|=256),b=Hf(k,b,!1),b!==2&&b!==6){if(qf&&!_){k.errorRecoveryDisabledLanes|=d,dl|=d,f=4;break e}d=Nn,Nn=f,d!==null&&(Nn===null?Nn=d:Nn.push.apply(Nn,d))}f=b}if(d=!1,f!==2)continue}}if(f===1){oa(e,0),Cr(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:Cr(s,n,Bn,!jr);break e;case 2:Nn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(f=Jo+300-Nt(),10<f)){if(Cr(s,n,Bn,!jr),Tl(s,0,!0)!==0)break e;Ni=n,s.timeoutHandle=ld(Vy.bind(null,s,l,Nn,Wo,Df,n,Bn,dl,ia,jr,d,"Throttled",-0,0),f);break e}Vy(s,l,Nn,Wo,Df,n,Bn,dl,ia,jr,d,null,-0,0)}}break}while(!0);Ci(e)}function Vy(e,n,l,s,f,d,b,k,_,I,X,ne,U,$){e.timeoutHandle=-1;var Se=n.subtreeFlags,Re=(d&335544064)===d;if(ne=null,(Re||Se&8192||(Se&16785408)===16785408)&&(ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xn},Dn=null,My(n,d,ne),Re&&(Se=ne,Re=e.containerInfo,Re=(Re.nodeType===9?Re:Re.ownerDocument).__reactViewTransition,Re!=null&&(Se.count++,Se.waitingForViewTransition=!0,Se=vs.bind(Se),Re.finished.then(Se,Se))),Se=(d&62914560)===d?Jo-Nt():(d&4194048)===d?By-Nt():0,Se=YS(ne,Se),Se!==null)){Ni=d,e.cancelPendingCommit=Se(Ky.bind(null,e,n,d,l,s,f,b,k,_,I,X,ne,null,U,$)),Cr(e,d,b,!I);return}Ky(e,n,d,l,s,f,b,k,_,I,X,ne)}function Uw(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(!Mn(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 Cr(e,n,l,s){n=$s(e,n),n&=~Ko,n&=~dl,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&&Aa(e,l,n)}function tu(){return(kt&6)===0?(fs(0),!1):!0}function Uf(){if(lt!==null){if(At===0)var e=lt.return;else e=lt,Gi=el=null,$c(e),Ql=null,Qa=0,e=lt;for(;e!==null;)fy(e.alternate,e),e=e.return;lt=null}}function oa(e,n){var l=e.timeoutHandle;return l!==-1&&(e.timeoutHandle=-1,uS(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Ni=0,Uf(),qt=e,lt=l=Yi(e.current,null),ut=n,At=0,Ln=null,jr=!1,na=nr(e,n),qf=!1,ia=Bn=Ko=dl=Tr=Xt=0,Nn=us=null,Df=!1,Ji=$s(e,n),oo(),l}function Yy(e,n){Xe=null,K.H=Mo,n===Xl||n===xo?(n=Km(),At=3):n===zc?(n=Km(),At=4):At=n===of?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Ln=n,lt===null&&(Xt=1,qo(e,Jn(n,e.current)))}function Fy(){var e=cn.current;return e===null?!0:(ut&4194048)===ut?bn===null:(ut&62914560)===ut||(ut&536870912)!==0?e===bn:!1}function Gy(){var e=K.H;return K.H=Mo,e===null?Mo:e}function $y(){var e=K.A;return K.A=Lw,e}function nu(){Xt=4,jr||(ut&4194048)!==ut&&cn.current!==null||(na=!0),(Tr&134217727)===0&&(dl&134217727)===0||qt===null||Cr(qt,ut,Bn,!1)}function Hf(e,n,l){var s=kt;kt|=2;var f=Gy(),d=$y();(qt!==e||ut!==n)&&(Wo=null,oa(e,n)),n=!1;var b=Xt;e:do try{if(At!==0&<!==null){var k=lt,_=Ln;switch(At){case 8:Uf(),b=6;break e;case 3:case 2:case 9:case 6:cn.current===null&&(n=!0);var I=At;if(At=0,Ln=null,ua(e,k,_,I),l&&na){b=0;break e}break;default:I=At,At=0,Ln=null,ua(e,k,_,I)}}Hw(),b=Xt;break}catch(X){Yy(e,X)}while(!0);return n&&e.shellSuspendCounter++,Gi=el=null,kt=s,K.H=f,K.A=d,lt===null&&(qt=null,ut=0,oo()),b}function Hw(){for(;lt!==null;)Xy(lt)}function Iw(e,n){var l=kt;kt|=2;var s=Gy(),f=$y();qt!==e||ut!==n?(Wo=null,Po=Nt()+500,oa(e,n)):na=nr(e,n);e:do try{if(At!==0&<!==null){n=lt;var d=Ln;t:switch(At){case 1:At=0,Ln=null,ua(e,n,d,1);break;case 2:case 9:if(Qm(d)){At=0,Ln=null,Qy(n);break}n=function(){At!==2&&At!==9||qt!==e||(At=7),Ci(e)},d.then(n,n);break e;case 3:At=7;break e;case 4:At=5;break e;case 7:Qm(d)?(At=0,Ln=null,Qy(n)):(At=0,Ln=null,ua(e,n,d,7));break;case 5:var b=null;switch(lt.tag){case 26:b=lt.memoizedState;case 5:case 27:var k=lt;if(b?Ug(b):k.stateNode.complete){At=0,Ln=null;var _=k.sibling;if(_!==null)lt=_;else{var I=k.return;I!==null?(lt=I,iu(I)):lt=null}break t}}At=0,Ln=null,ua(e,n,d,5);break;case 6:At=0,Ln=null,ua(e,n,d,6);break;case 8:Uf(),Xt=6;break e;default:throw Error(a(462))}}Vw();break}catch(X){Yy(e,X)}while(!0);return Gi=el=null,K.H=s,K.A=f,kt=l,lt!==null?0:(qt=null,ut=0,oo(),Xt)}function Vw(){for(;lt!==null&&!vt();)Xy(lt)}function Xy(e){var n=uy(e.alternate,e,Ji);e.memoizedProps=e.pendingProps,n===null?iu(e):lt=n}function Qy(e){var n=e,l=n.alternate;switch(n.tag){case 15:case 0:n=ny(l,n,n.pendingProps,n.type,void 0,ut);break;case 11:n=ny(l,n,n.pendingProps,n.type.render,n.ref,ut);break;case 5:$c(n);var s=n;s===ln&&(nt?(po(s),s.tag===5&&s.stateNode!=null&&(Ht=s.stateNode)):(po(s),nt=!0));default:fy(l,n),n=lt=Lm(n,Ji),n=uy(l,n,Ji)}e.memoizedProps=e.pendingProps,n===null?iu(e):lt=n}function ua(e,n,l,s){Gi=el=null,$c(n),Ql=null,Qa=0;var f=n.return;try{if(Aw(e,f,n,l,ut)){Xt=1,qo(e,Jn(l,e.current)),lt=null;return}}catch(d){if(f!==null)throw lt=f,d;Xt=1,qo(e,Jn(l,e.current)),lt=null;return}n.flags&32768?(nt||s===1?e=!0:na||(ut&536870912)!==0?e=!1:(jr=e=!0,(s===2||s===9||s===3||s===6)&&(s=cn.current,s!==null&&s.tag===13&&(s.flags|=16384))),Zy(n,e)):iu(n)}function iu(e){var n=e;do{if((n.flags&32768)!==0){Zy(n,jr);return}e=n.return;var l=zw(n.alternate,n,Ji);if(l!==null){lt=l;return}if(n=n.sibling,n!==null){lt=n;return}lt=n=e}while(n!==null);Xt===0&&(Xt=5)}function Zy(e,n){do{var l=Mw(e.alternate,e);if(l!==null){l.flags&=32767,lt=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(e=e.sibling,e!==null)){lt=e;return}lt=e=l}while(e!==null);Xt=6,lt=null}function Ky(e,n,l,s,f,d,b,k,_,I,X,ne){e.cancelPendingCommit=null;do ru();while(Gt!==0);if((kt&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));e===qt&&(lt=qt=null,ut=0),hl=n,fi=e,Ni=l,Bf=f,Uy=s,Yw(e,n,l,b,k,_,ne)}}function Yw(e,n,l,s,f,d,b){var k=n.lanes|n.childLanes;if(Lf=k,k|=xc,Nl(e,l,k,s,f,d),la=null,(l&335544064)===l?(aa=gw(e),s=10262):(aa=null,s=10256),(n.subtreeFlags&s)!==0||(n.flags&s)!==0?(e.callbackNode=null,e.callbackPriority=0,Zw(pi,function(){return Ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Yo=!1,s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=K.T,K.T=null,f=de.p,de.p=2,d=kt,kt|=4;try{qw(e,n,l)}finally{kt=d,de.p=f,K.T=s}}Gt=1,Yo?ra=pS(b,e.containerInfo,aa,If,Vf,Gw,Yf,Ff,Fw):(If(),Vf(),Yf())}function Fw(e){if(Gt!==0){var n=fi.onRecoverableError;n(e,{componentStack:null})}}function Gw(){Gt===3&&(Gt=0,Oy(hl,fi),Gt=4)}function If(){if(Gt===1){Gt=0;var e=fi,n=hl,l=Ni,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=K.T,K.T=null;var f=de.p;de.p=2;var d=kt;kt|=4;try{as=$o=!1,Ry(n,e,l),l=nd;var b=Nm(e.containerInfo),k=l.focusedElem,_=l.selectionRange;if(b!==k&&k&&k.ownerDocument&&Tm(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 ne=k.ownerDocument||document,U=ne&&ne.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=jm(k,Re),D=jm(k,Qe);if(H&&D&&($.rangeCount!==1||$.anchorNode!==H.node||$.anchorOffset!==H.offset||$.focusNode!==D.node||$.focusOffset!==D.offset)){var F=ne.createRange();F.setStart(H.node,H.offset),$.removeAllRanges(),Re>Qe?($.addRange(F),$.extend(D.node,D.offset)):(F.setEnd(D.node,D.offset),$.addRange(F))}}}}for(ne=[],$=k;$=$.parentNode;)$.nodeType===1&&ne.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<ne.length;k++){var te=ne[k];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}ga=!!td,nd=td=null}finally{kt=d,de.p=f,K.T=s}}e.current=n,Gt=2}}function Vf(){if(Gt===2){Gt=0;var e=fi,n=hl,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=K.T,K.T=null;var s=de.p;de.p=2;var f=kt;kt|=4;try{Ey(e,n.alternate,n)}finally{kt=f,de.p=s,K.T=l}}Gt=3}}function Yf(){if(Gt===4||Gt===3){Gt=0;var e=ra;ra=null,xn();var n=fi,l=hl,s=Ni,f=Uy,d=(s&335544064)===s?10262:10256;if((l.subtreeFlags&d)!==0||(l.flags&d)!==0?Gt=5:(Gt=0,hl=fi=null,Jy(n,n.pendingLanes)),d=n.pendingLanes,d===0&&(Nr=null),Cl(s),l=l.stateNode,ot&&typeof ot.onCommitFiberRoot=="function")try{ot.onCommitFiberRoot(yt,l,void 0,(l.current.flags&128)===128)}catch{}if(f!==null){l=K.T,d=de.p,de.p=2,K.T=null;try{for(var b=n.onRecoverableError,k=0;k<f.length;k++){var _=f[k];b(_.value,{componentStack:_.stack})}}finally{K.T=l,de.p=d}}if(f=la,b=aa,aa=null,f!==null&&(la=null,b===null&&(b=[]),e!==null))for(_=0;_<f.length;_++)l=(0,f[_])(b),l!==void 0&&e.finished.finally(l);(Ni&3)!==0&&ru(),Ci(n),d=n.pendingLanes,(s&261930)!==0&&(d&42)!==0?n===eu?cs++:(cs=0,eu=n):(cs=0,eu=null),fs(0)}}function Jy(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Ga(n)))}function ru(){return ra!==null&&(ra.skipTransition(),ra=null),If(),Vf(),Yf(),Ff()}function Ff(){if(Gt!==5)return!1;var e=fi,n=Lf;Lf=0;var l=Cl(Ni),s=K.T,f=de.p;try{de.p=32>l?32:l,K.T=null,l=Bf,Bf=null;var d=fi,b=Ni;if(Gt=0,hl=fi=null,Ni=0,(kt&6)!==0)throw Error(a(331));var k=kt;if(kt|=4,Dy(d.current),zy(d,d.current,b,l),kt=k,fs(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(yt,d)}catch{}return!0}finally{de.p=f,K.T=s,Jy(e,n)}}function Py(e,n,l){n=Jn(l,n),n=sf(e.stateNode,n,2),e=br(e,n,2),e!==null&&(Hr(e,2),Ci(e))}function Rt(e,n,l){if(e.tag===3)Py(e,e,l);else for(;n!==null;){if(n.tag===3){Py(n,e,l);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Nr===null||!Nr.has(s))){e=Jn(l,e),l=Qp(2),s=br(n,l,2),s!==null&&(Zp(l,s,n,e),Hr(s,2),Ci(s));break}}n=n.return}}function Gf(e,n,l){var s=e.pingCache;if(s===null){s=e.pingCache=new Bw;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=$w.bind(null,e,n,l),n.then(e,e))}function $w(e,n,l){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,qt===e&&(ut&l)===l&&((Xt===4||Xt===3&&(ut&62914560)===ut&&300>Nt()-Jo)&&(kt&2)===0?oa(e,0):Ko|=l,ia===ut&&(ia=0)),Ci(e)}function Wy(e,n){n===0&&(n=Xs()),e=Jr(e,n),e!==null&&(Hr(e,n),Ci(e))}function Xw(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),Wy(e,l)}function Qw(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),Wy(e,l)}function Zw(e,n){return st(e,n)}var ca=null,fa=null,$f=!1,lu=!1,Xf=!1,Ar=0;function Ci(e){e!==fa&&e.next===null&&(fa===null?ca=fa=e:fa=fa.next=e),lu=!0,$f||($f=!0,Jw())}function fs(e,n){if(!Xf&&lu){Xf=!0;do for(var l=!1,s=ca;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,ig(s,d))}else d=ut,d=Tl(s,s===qt?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||nr(s,d)||(l=!0,ig(s,d));s=s.next}while(l);Xf=!1}}function Kw(){eg()}function eg(){lu=$f=!1;var e=0;Ar!==0&&oS()&&(e=Ar);for(var n=Nt(),l=null,s=ca;s!==null;){var f=s.next,d=tg(s,n);d===0?(s.next=null,l===null?ca=f:l.next=f,f===null&&(fa=l)):(l=s,(e!==0||(d&3)!==0)&&(lu=!0)),s=f}Gt!==0&&Gt!==5||fs(e),Ar!==0&&(Ar=0)}function tg(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]=ac(k,n)):_<=n&&(e.expiredLanes|=k),d&=~k}if(n=qt,l=ut,l=Tl(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||nr(e,l)){if(n=l&-l,n===e.callbackPriority)return n;switch(s!==null&&bt(s),Cl(l)){case 2:case 8:l=Ft;break;case 32:l=pi;break;case 268435456:l=Z;break;default:l=pi}return s=ng.bind(null,e),l=st(l,s),e.callbackPriority=n,e.callbackNode=l,n}return s!==null&&s!==null&&bt(s),e.callbackPriority=2,e.callbackNode=null,2}function ng(e,n){if(Gt!==0&&Gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(ru()&&e.callbackNode!==l)return null;var s=ut;return s=Tl(e,e===qt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Iy(e,s,n),tg(e,Nt()),e.callbackNode!=null&&e.callbackNode===l?ng.bind(null,e):null)}function ig(e,n){if(ru())return null;Iy(e,n,!0)}function Jw(){cS(function(){(kt&6)!==0?st(pt,Kw):eg()})}function Qf(){if(Ar===0){var e=il;e===0&&(e=zi,zi<<=1,(zi&261888)===0&&(zi=256)),Ar=e}return Ar}function rg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Xr(e)}function Pw(e,n,l,s,f){if(n==="submit"&&l&&l.stateNode===f){var d=rg((f[on]||null).action),b=s.submitter;b&&(n=(n=b[on]||null)?rg(n.formAction):b.getAttribute("formAction"),n!==null&&(d=n,b=null));var k=new St("action","action",null,s,f);e.push({event:k,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Ar!==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],Ww=Kf.toLowerCase(),eS=Kf[0].toUpperCase()+Kf.slice(1);si(Ww,"on"+eS)}si(Rm,"onAnimationEnd"),si(_m,"onAnimationIteration"),si(Om,"onAnimationStart"),si("dblclick","onDoubleClick"),si("focusin","onFocus"),si("focusout","onBlur"),si(uw,"onTransitionRun"),si(cw,"onTransitionStart"),si(fw,"onTransitionCancel"),si(zm,"onTransitionEnd"),lr("onMouseEnter",["mouseout","mouseover"]),lr("onMouseLeave",["mouseout","mouseover"]),lr("onPointerEnter",["pointerout","pointerover"]),lr("onPointerLeave",["pointerout","pointerover"]),Ui("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ui("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ui("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ui("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ui("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ui("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ds="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(" "),tS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ds));function lg(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){so(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){so(X)}f.currentTarget=null,d=_}}}}function at(e,n){var l=n[Rl];l===void 0&&(l=n[Rl]=new Set);var s=e+"__bubble";l.has(s)||(ag(n,e,2,!1),l.add(s))}function Jf(e,n,l){var s=0;n&&(s|=4),ag(l,e,s,n)}var au="_reactListening"+Math.random().toString(36).slice(2);function Pf(e){if(!e[au]){e[au]=!0,Ol.forEach(function(l){l!=="selectionchange"&&(tS.has(l)||Jf(l,!1,e),Jf(l,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[au]||(n[au]=!0,Jf("selectionchange",!1,n))}}function ag(e,n,l,s){switch(Zg(n)){case 2:var f=XS;break;case 8:f=QS;break;default:f=vd}l=f.bind(null,n,l,e),f=void 0,!Ll||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=ai(k),b===null)return;if(_=b.tag,_===5||_===6||_===26||_===27){s=d=b;continue e}k=k.parentNode}}s=s.return}ro(function(){var I=d,X=Dl(l),ne=[];e:{var U=Mm.get(e);if(U!==void 0){var $=St,Se=e;switch(e){case"keypress":if(je(l)===0)break e;case"keydown":case"keyup":$=U1;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":$=um;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=N1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=F1;break;case Rm:case _m:case Om:$=R1;break;case zm:$=$1;break;case"scroll":case"scrollend":$=Vt;break;case"wheel":$=Q1;break;case"copy":case"cut":case"paste":$=O1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=fm;break;case"submit":$=V1;break;case"toggle":case"beforetoggle":$=K1}var Re=(n&4)!==0,Qe=!Re&&(e==="scroll"||e==="scrollend"),H=Re?U!==null?U+"Capture":null:U;Re=[];for(var D=I,F;D!==null;){var te=D;if(F=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||F===null||H===null||(te=fr(D,H),te!=null&&Re.push(hs(D,te,F))),Qe)break;D=D.return}0<Re.length&&(U=new $(U,Se,null,l,X),ne.push({event:U,listeners:Re}))}}if((n&7)===0){e:{if($=e==="mouseover"||e==="pointerover",U=e==="mouseout"||e==="pointerout",$&&l!==ql&&(Se=l.relatedTarget||l.fromElement)&&(ai(Se)||Se[yi]))break e;(U||$)&&(Se=X.window===X?X:($=X.ownerDocument)?$.defaultView||$.parentWindow:window,U?($=l.relatedTarget||l.toElement,U=I,$=$?ai($):null,$!==null&&(Qe=u($),Re=$.tag,$!==Qe||Re!==5&&Re!==27&&Re!==6)&&($=null)):(U=null,$=I),U!==$&&(Re=um,te="onMouseLeave",H="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(Re=fm,te="onPointerLeave",H="onPointerEnter",D="pointer"),Qe=U==null?Se:Bi(U),F=$==null?Se:Bi($),Se=new Re(te,D+"leave",U,l,X),Se.target=Qe,Se.relatedTarget=F,te=null,ai(X)===I&&(Re=new Re(H,D+"enter",$,l,X),Re.target=F,Re.relatedTarget=Qe,te=Re),Qe=te,Re=U&&$?A(U,$,nS):null,U!==null&&sg(ne,Se,U,Re,!1),$!==null&&Qe!==null&&sg(ne,Qe,$,Re,!0)))}e:{if(U=I?Bi(I):window,$=U.nodeName&&U.nodeName.toLowerCase(),$==="select"||$==="input"&&U.type==="file")var Ce=bm;else if(gm(U))if(xm)Ce=aw;else{Ce=rw;var ct=iw}else $=U.nodeName,!$||$.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?I&&Ml(I.elementType)&&(Ce=bm):Ce=lw;if(Ce&&(Ce=Ce(e,I))){vm(ne,Ce,l,X);break e}ct&&ct(e,U,I)}switch(ct=I?Bi(I):window,e){case"focusin":(gm(ct)||ct.contentEditable==="true")&&(Ul=ct,yc=I,Va=null);break;case"focusout":Va=yc=Ul=null;break;case"mousedown":gc=!0;break;case"contextmenu":case"mouseup":case"dragend":gc=!1,Cm(ne,l,X);break;case"selectionchange":if(ow)break;case"keydown":case"keyup":Cm(ne,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 Bl?pm(e,l)&&(Ye="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ye="onCompositionStart");Ye&&(dm&&l.locale!=="ko"&&(Bl||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&Bl&&(qe=_e()):(V=X,J="value"in V?V.value:V.textContent,Bl=!0)),ct=su(I,Ye),0<ct.length&&(Ye=new cm(Ye,e,null,l,X),ne.push({event:Ye,listeners:ct}),qe?Ye.data=qe:(qe=ym(l),qe!==null&&(Ye.data=qe)))),(qe=P1?W1(e,l):ew(e,l))&&(Ye=su(I,"onBeforeInput"),0<Ye.length&&(ct=new cm("onBeforeInput","beforeinput",null,l,X),ne.push({event:ct,listeners:Ye}),ct.data=qe)),Pw(ne,e,I,l,X)}lg(ne,n)})}function hs(e,n,l){return{instance:e,listener:n,currentTarget:l}}function su(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=fr(e,l),f!=null&&s.unshift(hs(e,f,d)),f=fr(e,n),f!=null&&s.push(hs(e,f,d))),e.tag===3)return s;e=e.return}return[]}function nS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sg(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=fr(l,d),I!=null&&b.unshift(hs(l,I,_))):f||(I=fr(l,d),I!=null&&b.push(hs(l,I,_)))),l=l.return}b.length!==0&&e.push({event:n,listeners:b})}var iS=/\r\n?/g,rS=/\u0000|\uFFFD/g;function og(e){return(typeof e=="string"?e:""+e).replace(iS,`
|
|
10
|
+
`).replace(rS,"")}function ug(e,n){return n=og(n),og(e)===n}function _t(e,n,l,s,f,d){switch(l){case"children":if(typeof s=="string")n==="body"||n==="textarea"&&s===""||Hi(e,s);else if(typeof s=="number"||typeof s=="bigint")n!=="body"&&Hi(e,""+s);else return;break;case"className":sr(e,"class",s);break;case"tabIndex":sr(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":sr(e,l,s);break;case"style":qa(e,s,d);return;case"data":if(n!=="object"){sr(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=Xr(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=Xr(s),e.setAttribute(l,s);break;case"onClick":s!=null&&(e.onclick=Xn);return;case"onScroll":s!=null&&at("scroll",e);return;case"onScrollEnd":s!=null&&at("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=Xr(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":at("beforetoggle",e),at("toggle",e),nn(e,"popover",s);break;case"xlinkActuate":Gn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Gn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Gn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Gn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Gn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Gn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":nn(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=oc.get(l)||l,nn(e,l,s);else return}dt=!0}function ed(e,n,l,s,f,d){switch(l){case"style":qa(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")Hi(e,s);else if(typeof s=="number"||typeof s=="bigint")Hi(e,""+s);else return;break;case"onScroll":s!=null&&at("scroll",e);return;case"onScrollEnd":s!=null&&at("scrollend",e);return;case"onClick":s!=null&&(e.onclick=Xn);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Fr.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[on]||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}dt=!0,l in e?e[l]=s:s===!0?e.setAttribute(l,""):nn(e,l,s)}return}dt=!0}function hn(e,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":at("error",e),at("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":at("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)}}za(e,d,k,_,I,b,f,!1);return;case"select":at("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?vi(e,!!s,n,!1):l!=null&&vi(e,!!s,l,!0);return;case"textarea":at("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)}to(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":at("beforetoggle",e),at("toggle",e),at("cancel",e),at("close",e);break;case"iframe":case"object":at("load",e);break;case"video":case"audio":for(s=0;s<ds.length;s++)at(ds[s],e);break;case"image":at("error",e),at("load",e);break;case"details":at("toggle",e);break;case"embed":case"source":case"link":at("error",e),at("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(Ml(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 lS={};function aS(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 ne=l[$];if(l.hasOwnProperty($)&&ne!=null)switch($){case"checked":break;case"value":break;case"defaultValue":_=ne;default:s.hasOwnProperty($)||_t(e,n,$,null,s,ne)}}for(var U in s){var $=s[U];if(ne=l[U],s.hasOwnProperty(U)&&($!=null||ne!=null))switch(U){case"type":$!==ne&&(dt=!0),d=$;break;case"name":$!==ne&&(dt=!0),f=$;break;case"checked":$!==ne&&(dt=!0),I=$;break;case"defaultChecked":$!==ne&&(dt=!0),X=$;break;case"value":$!==ne&&(dt=!0),b=$;break;case"defaultValue":$!==ne&&(dt=!0),k=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(a(137,n));break;default:$!==ne&&_t(e,n,U,$,s,ne)}}$n(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!==_&&(dt=!0),U=d;break;case"defaultValue":d!==_&&(dt=!0),k=d;break;case"multiple":d!==_&&(dt=!0),b=d;default:d!==_&&_t(e,n,f,d,s,_)}n=k,l=b,s=$,U!=null?vi(e,!!l,U,!1):!!s!=!!l&&(n!=null?vi(e,!!l,n,!0):vi(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&&(dt=!0),U=f;break;case"defaultValue":f!==d&&(dt=!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)}eo(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!==$&&(dt=!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(Ml(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(ne in s)U=s[ne],$=l[ne],!s.hasOwnProperty(ne)||U===$||U==null&&$==null||_t(e,n,ne,U,s,$)}function cg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function sS(){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&&cg(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,ne=_.initiatorType;X&&cg(ne)&&(_=_.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 ms(e){return e.nodeType===9?e:e.ownerDocument}function fg(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dg(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 hg(e,n,l,s){return l=ms(l).createElement(e),l[Zt]=s,l[on]=n,hn(l,e,n),Ut(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 oS(){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,uS=typeof clearTimeout=="function"?clearTimeout:void 0,mg=typeof Promise=="function"?Promise:void 0,pg=typeof requestAnimationFrame=="function"?requestAnimationFrame:ld,cS=typeof queueMicrotask=="function"?queueMicrotask:typeof mg<"u"?function(e){return mg.resolve(null).then(e).catch(fS)}:ld;function fS(e){setTimeout(function(){throw e})}function Rr(e){return e==="head"}function yg(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),va(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[Di]||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);va(n)}function gg(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 vg(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 bg(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 dS(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 dS(n,l,e)}function hS(e){return e.documentElement.clientHeight}function mS(e){this.addEventListener("load",e),this.addEventListener("error",e)}function pS(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"&&(hS(I),I.fonts.status==="loading"&&Re.push(I.fonts.ready)),Se=Re.length,e!==null)for(var Qe=e.suspenseyImages,H=0,D=0;D<Qe.length;D++){var F=Qe[D];if(!F.complete){var te=F.getBoundingClientRect();if(0<te.bottom&&0<te.right&&te.top<U.innerHeight&&te.left<U.innerWidth){if(H+=Hg(F),H>cu){Re.length=Se;break}F=new Promise(mS.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 ne=[];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")){ne.push(Se),Se=Re.getKeyframes();for(var H=Qe=void 0,D=!0,F=0;F<Se.length;F++){var te=Se[F],Ce=te.width;if(Qe===void 0)Qe=Ce;else if(Qe!==Ce){D=!1;break}if(Ce=te.height,H===void 0)H=Ce;else if(H!==Ce){D=!1;break}delete te.width,delete te.height,te.transform==="none"&&delete te.transform}D&&Qe!==void 0&&H!==void 0&&(Re.setKeyframes(Se),D=getComputedStyle(Re.target,Re.pseudoElement),D.width!==Qe||D.height!==H)&&(D=Se[0],D.width=Qe,D.height=H,D=Se[Se.length-1],D.width=Qe,D.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<ne.length;U++)ne[U].cancel();I.__reactViewTransition===X&&(I.__reactViewTransition=null),k()}),X}catch{return s(),f(),b(),null}}function ml(e,n){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+n+")"}ml.prototype.animate=function(e,n){return n=typeof n=="number"?{duration:n}:L({},n),n.pseudoElement=this._selector,this._scope.animate(e,n)},ml.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},ml.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function xg(e){return{name:e,group:new ml("group",e),imagePair:new ml("image-pair",e),old:new ml("old",e),new:new ml("new",e)}}function Hn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Hn.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(Sg(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=da(l),d.push({type:e,listener:n,optionsOrUseCapture:l,attachedListener:k,cleanup:f}),g(this._fragmentFiber.child,!1,yS,e,k,s)}this._eventListeners=d}};function yS(e,n,l,s){return N(e).addEventListener(n,l,s),!1}Hn.prototype.removeEventListener=function(e,n,l){var s=this._eventListeners;if(s!==null&&(n=Sg(s,e,n,l),n!==-1)){var f=s[n];l=f.attachedListener;var d=f.cleanup;f=da(f.optionsOrUseCapture),g(this._fragmentFiber.child,!1,gS,e,l,f),s.splice(n,1),d!==null&&d()}};function gS(e,n,l,s){return N(e).removeEventListener(n,l,s),!1}function da(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function wg(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Sg(e,n,l,s){if(e.length===0)return-1;s=wg(s);for(var f=0;f<e.length;f++){var d=e[f];if(d.type===n&&d.listener===l&&wg(d.optionsOrUseCapture)===s)return f}return-1}Hn.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,da(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,da(d.optionsOrUseCapture));return n.removeChild(s),e}return n.dispatchEvent(e)},Hn.prototype.focus=function(e){g(this._fragmentFiber.child,!0,kg,e,void 0,void 0)};function kg(e,n){return e.tag===6?!1:(e=N(e),AS(e,n))}Hn.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&&!kg(n[l],e);l--);};function sd(e,n){return n.push(e),!1}Hn.prototype.blur=function(){var e=w(this._fragmentFiber);e!==null&&(e=N(e),e=ms(e).activeElement,e!==null&&g(this._fragmentFiber.child,!1,vS,e,void 0,void 0))};function vS(e,n){return e.tag===6?!1:(e=N(e),e===n||e.contains(n)?(n.blur(),!0):!1)}Hn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),g(this._fragmentFiber.child,!1,bS,e,void 0,void 0)};function bS(e,n){return e.tag===6||(e=N(e),n.observe(e)),!1}Hn.prototype.unobserveUsing=function(e){var n=this._observers;if(n!==null&&n.has(e)){n.delete(e),g(this._fragmentFiber.child,!1,xS,e,void 0,void 0);for(var l=n=0;l<di.length;l++){var s=di[l];s.fragmentInstance===this&&s.observer===e?e.unobserve(s.instance):di[n++]=s}di.length=n}};function xS(e,n){return e.tag===6||(e=N(e),n.unobserve(e)),!1}var di=[],od=!1;function wS(e,n,l){di.push({fragmentInstance:e,observer:n,instance:l}),od||(od=!0,RS(function(){od=!1;var s=di;di=[];for(var f=0;f<s.length;f++){var d=s[f];d.observer.unobserve(d.instance)}}))}Hn.prototype.getClientRects=function(){var e=[];return g(this._fragmentFiber.child,!1,SS,e,void 0,void 0),e};function SS(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}Hn.prototype.getRootNode=function(e){var n=w(this._fragmentFiber);return n===null?this:N(n).getRootNode(e)},Hn.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||kS(n,this._fragmentFiber,l[0],l[l.length-1],e)?n:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function kS(e,n,l,s,f){var d=ai(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,ie),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,ie),n===null?n=!1:(g(n,!0,P,d,s),d=j,q=j=null,n=d!==null)),n):!1}function Eg(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)}Hn.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),Eg(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),Eg(f,l)):N(f).scrollIntoView(e),s+=l?-1:1}};function ES(e,n){return e=N(e),jg(e,n),!1}function jg(e,n){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(n)}function Tg(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,da(f.optionsOrUseCapture))}e.nodeType!==3&&(l=n._observers,l!==null&&l.forEach(function(d){for(var b=0,k=0;k<di.length;k++){var _=di[k];(_.fragmentInstance!==n||_.observer!==d||_.instance!==e)&&(di[b++]=_)}di.length=b,d.observe(e)}),jg(e,n))}function jS(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,da(f.optionsOrUseCapture))}e.nodeType!==3&&(l=n._observers,l!==null&&l.forEach(function(d){typeof d.rootMargin=="string"?wS(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),Li(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function TS(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[Di])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=ni(e.nextSibling),e===null)break}return null}function NS(e,n,l){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=ni(e.nextSibling),e===null))return null;return e}function Ng(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ni(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 CS(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 ni(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 Cg(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(n===0)return ni(e.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}e=e.nextSibling}return null}function Ag(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 AS(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 RS(e){pg(function(){pg(function(n){return e(n)})})}function Rg(e,n,l){switch(n=ms(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 _g(e,n,l){for(var s in l){var f=l[s];l.hasOwnProperty(s)&&f!=null&&_t(e,n,s,null,lS,f)}l.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Xn&&(e.onclick=null),Li(e)}function hd(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Li(e)}var ii=new Map,Og=new Set;function ps(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 Pi=de.d;de.d={f:_S,r:OS,D:zS,C:MS,L:qS,m:DS,X:BS,S:LS,M:US};function _S(){var e=Pi.f(),n=tu();return e||n}function OS(e){var n=Fn(e);n!==null&&n.tag===5&&n.type==="form"?Mp(n):Pi.r(e)}var ha=typeof document>"u"?null:document;function zg(e,n,l){var s=ha;if(s&&typeof n=="string"&&n){var f=vn(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),Og.has(f)||(Og.add(f),e={rel:e,crossOrigin:l,href:n},s.querySelector(f)===null&&(n=s.createElement("link"),hn(n,"link",e),Ut(n),s.head.appendChild(n)))}}function zS(e){Pi.D(e),zg("dns-prefetch",e,null)}function MS(e,n){Pi.C(e,n),zg("preconnect",e,n)}function qS(e,n,l){Pi.L(e,n,l);var s=ha;if(s&&e&&n){var f='link[rel="preload"][as="'+vn(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+vn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+vn(l.imageSizes)+'"]')):f+='[href="'+vn(e)+'"]';var d=f;switch(n){case"style":d=ma(e);break;case"script":d=pa(e)}if(!(ii.has(d)||(e=L({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:e,as:n},l),ii.set(d,e),s.querySelector(f)!==null||n==="style"&&s.querySelector(ys(d))||n==="script"&&s.querySelector(gs(d))))){var b=s.createElement("link");hn(b,"link",e),n==="style"&&(b[Yr]=!0,b.onload=b.onerror=function(){Ks(b)}),Ut(b),s.head.appendChild(b)}}}function DS(e,n){Pi.m(e,n);var l=ha;if(l&&e){var s=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+vn(s)+'"][href="'+vn(e)+'"]',d=f;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=pa(e)}if(!ii.has(d)&&(e=L({rel:"modulepreload",href:e},n),ii.set(d,e),l.querySelector(f)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(gs(d)))return}s=l.createElement("link"),hn(s,"link",e),Ut(s),l.head.appendChild(s)}}}function LS(e,n,l){Pi.S(e,n,l);var s=ha;if(s&&e){var f=rr(s).hoistableStyles,d=ma(e);n=n||"default";var b=f.get(d);if(!b){var k={loading:0,preload:null};if(b=s.querySelector(ys(d)))k.loading=5;else{e=L({rel:"stylesheet",href:e,"data-precedence":n},l),(l=ii.get(d))&&md(e,l);var _=b=s.createElement("link");Ut(_),hn(_,"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,ou(b,n,s)}b={type:"stylesheet",instance:b,count:1,state:k},f.set(d,b)}}}function BS(e,n){Pi.X(e,n);var l=ha;if(l&&e){var s=rr(l).hoistableScripts,f=pa(e),d=s.get(f);d||(d=l.querySelector(gs(f)),d||(e=L({src:e,async:!0},n),(n=ii.get(f))&&pd(e,n),d=l.createElement("script"),Ut(d),hn(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(f,d))}}function US(e,n){Pi.M(e,n);var l=ha;if(l&&e){var s=rr(l).hoistableScripts,f=pa(e),d=s.get(f);d||(d=l.querySelector(gs(f)),d||(e=L({src:e,async:!0,type:"module"},n),(n=ii.get(f))&&pd(e,n),d=l.createElement("script"),Ut(d),hn(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(f,d))}}function Mg(e,n,l,s){var f=(f=rt.current)?ps(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=ma(l.href),n=rr(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=ma(l.href);var d=rr(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(ys(e)))?d._p||(b.instance=d,b.state.loading=5):(d=ii.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},ii.set(e,d)),HS(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=pa(l),n=rr(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 ma(e){return'href="'+vn(e)+'"'}function ys(e){return'link[rel="stylesheet"]['+e+"]"}function qg(e){return L({},e,{"data-precedence":e.precedence,precedence:null})}function HS(e,n,l,s){if(n=e.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[Yr]!==!0){s.loading=1;return}}else n=e.createElement("link"),n[Yr]=!0,n.onload=n.onerror=Ks.bind(null,n),hn(n,"link",l),Ut(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 pa(e){return'[src="'+vn(e)+'"]'}function gs(e){return"script[async]"+e}function Dg(e,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+vn(l.href)+'"]');if(s)return n.instance=s,Ut(s),s;var f=L({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Ut(s),hn(s,"style",f),ou(s,l.precedence,e),n.instance=s;case"stylesheet":f=ma(l.href);var d=e.querySelector(ys(f));if(d)return n.state.loading|=4,n.instance=d,Ut(d),d;s=qg(l),(f=ii.get(f))&&md(s,f),d=(e.ownerDocument||e).createElement("link"),Ut(d);var b=d;return b._p=new Promise(function(k,_){b.onload=k,b.onerror=_}),hn(d,"link",s),n.state.loading|=4,ou(d,l.precedence,e),n.instance=d;case"script":return d=pa(l.src),(f=e.querySelector(gs(d)))?(n.instance=f,Ut(f),f):(s=l,(f=ii.get(d))&&(s=L({},l),pd(s,f)),e=e.ownerDocument||e,f=e.createElement("script"),Ut(f),hn(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,ou(s,l.precedence,e));return n.instance}function ou(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 uu=null;function Lg(e,n,l){if(uu===null){var s=new Map,f=uu=new Map;f.set(l,s)}else f=uu,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[Di]||d[Zt]||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 IS(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 Bg(e,n){return e==="img"&&n.src!=null&&n.src!==""&&n.onLoad==null&&n.loading!=="lazy"}function Ug(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Hg(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Ig(e,n){typeof n.decode=="function"&&(e.imgCount++,n.complete||(e.imgBytes+=Hg(n),e.suspenseyImages.push(n)),e=FS.bind(e),n.decode().then(e,e))}function VS(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=ma(s.href),d=n.querySelector(ys(f));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=vs.bind(e),n.then(e,e)),l.state.loading|=4,l.instance=d,Ut(d);return}d=n.ownerDocument||n,s=qg(s),(f=ii.get(f))&&md(s,f),d=d.createElement("link"),Ut(d);var b=d;b._p=new Promise(function(k,_){b.onload=k,b.onerror=_}),hn(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=vs.bind(e),n.addEventListener("load",l),n.addEventListener("error",l))}}var cu=0;function YS(e,n){return e.stylesheets&&e.count===0&&du(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var s=setTimeout(function(){if(e.stylesheets&&du(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+n);0<e.imgBytes&&cu===0&&(cu=62500*sS());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&du(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>cu?50:800)+n);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(f)}}:null}function Vg(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)du(e,e.stylesheets);else if(e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}}}function vs(){this.count--,Vg(this)}function FS(){this.imgCount--,Vg(this)}var fu=null;function du(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fu=new Map,n.forEach(GS,e),fu=null,vs.call(e))}function GS(e,n){if(!(n.state.loading&4)){var l=fu.get(e);if(l)var s=l.get(null);else{l=new Map,fu.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=vs.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 ya={$$typeof:ge,Provider:null,Consumer:null,_currentValue:tt,_currentValue2:tt,_threadCount:0};function $S(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=ir(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ir(0),this.hiddenUpdates=ir(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 Yg(e,n,l,s,f,d,b,k,_,I,X,ne){return e=new $S(e,n,l,b,_,I,X,ne,k),n=1,d===!0&&(n|=24),d=En(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 Fg(e){return e?(e=Vl,e):Vl}function Gg(e,n,l,s,f,d){f=Fg(f),s.context===null?s.context=f:s.pendingContext=f,s=vr(n),s.payload={element:l},d=d===void 0?null:d,d!==null&&(s.callback=d),l=br(e,s,n),l!==null&&(Cn(l,e,n),Za(l,e,n))}function $g(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){$g(e,n),(e=e.alternate)&&$g(e,n)}function Xg(e){if(e.tag===13||e.tag===31){var n=Jr(e,67108864);n!==null&&Cn(n,e,67108864),gd(e,67108864)}}function Qg(e){if(e.tag===13||e.tag===31){var n=Un();n=Ra(n);var l=Jr(e,n);l!==null&&Cn(l,e,n),gd(e,n)}}var ga=!0;function XS(e,n,l,s){var f=K.T;K.T=null;var d=de.p;try{de.p=2,vd(e,n,l,s)}finally{de.p=d,K.T=f}}function QS(e,n,l,s){var f=K.T;K.T=null;var d=de.p;try{de.p=8,vd(e,n,l,s)}finally{de.p=d,K.T=f}}function vd(e,n,l,s){if(ga){var f=bd(s);if(f===null)Wf(e,n,s,hu,l),Kg(e,s);else if(KS(f,e,n,l,s))s.stopPropagation();else if(Kg(e,s),n&4&&-1<ZS.indexOf(e)){for(;f!==null;){var d=Fn(f);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var b=qi(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&=~_}Ci(d),(kt&6)===0&&(Po=Nt()+500,fs(0))}}break;case 31:case 13:k=Jr(d,2),k!==null&&Cn(k,d,2),tu(),gd(d,2)}if(d=bd(s),d===null&&Wf(e,n,s,hu,l),d===f)break;f=d}f!==null&&s.stopPropagation()}else Wf(e,n,s,null,l)}}function bd(e){return e=Dl(e),xd(e)}var hu=null;function xd(e){if(hu=null,e=ai(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 hu=e,null}function Zg(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 pt:return 2;case Ft:return 8;case pi:case Vn:return 32;case Z:return 268435456;default:return 32}default:return 32}}var wd=!1,_r=null,Or=null,zr=null,bs=new Map,xs=new Map,Mr=[],ZS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Kg(e,n){switch(e){case"focusin":case"focusout":_r=null;break;case"dragenter":case"dragleave":Or=null;break;case"mouseover":case"mouseout":zr=null;break;case"pointerover":case"pointerout":bs.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":xs.delete(n.pointerId)}}function ws(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=Fn(n),n!==null&&Xg(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function KS(e,n,l,s,f){switch(n){case"focusin":return _r=ws(_r,e,n,l,s,f),!0;case"dragenter":return Or=ws(Or,e,n,l,s,f),!0;case"mouseover":return zr=ws(zr,e,n,l,s,f),!0;case"pointerover":var d=f.pointerId;return bs.set(d,ws(bs.get(d)||null,e,n,l,s,f)),!0;case"gotpointercapture":return d=f.pointerId,xs.set(d,ws(xs.get(d)||null,e,n,l,s,f)),!0}return!1}function Jg(e){var n=ai(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,_a(e.priority,function(){Qg(l)});return}}else if(n===31){if(n=h(l),n!==null){e.blockedOn=n,_a(e.priority,function(){Qg(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 mu(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);ql=s,l.target.dispatchEvent(s),ql=null}else return n=Fn(l),n!==null&&Xg(n),e.blockedOn=l,!1;n.shift()}return!0}function Pg(e,n,l){mu(e)&&l.delete(n)}function JS(){wd=!1,_r!==null&&mu(_r)&&(_r=null),Or!==null&&mu(Or)&&(Or=null),zr!==null&&mu(zr)&&(zr=null),bs.forEach(Pg),xs.forEach(Pg)}function pu(e,n){e.blockedOn===n&&(e.blockedOn=null,wd||(wd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,JS)))}var yu=null;function Wg(e){yu!==e&&(yu=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){yu===e&&(yu=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=Fn(l);d!==null&&(e.splice(n,3),n-=3,tf(d,{pending:!0,data:f,method:l.method,action:s},s,f))}}))}function va(e){function n(_){return pu(_,e)}_r!==null&&pu(_r,e),Or!==null&&pu(Or,e),zr!==null&&pu(zr,e),bs.forEach(n),xs.forEach(n);for(var l=0;l<Mr.length;l++){var s=Mr[l];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Mr.length&&(l=Mr[0],l.blockedOn===null);)Jg(l),l.blockedOn===null&&Mr.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[on]||null;if(typeof d=="function")b||Wg(l);else if(b){var k=null;if(d&&d.hasAttribute("formAction")){if(f=d,b=d[on]||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),Wg(l)}}}function ev(){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}gu.prototype.render=Sd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var l=n.current,s=Un();Gg(l,s,e,n,null,null)},gu.prototype.unmount=Sd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Gg(e.current,2,null,e,null,null),tu(),n[yi]=null}};function gu(e){this._internalRoot=e}gu.prototype.unstable_scheduleHydration=function(e){if(e){var n=Al();e={blockedOn:null,target:e,priority:n};for(var l=0;l<Mr.length&&n!==0&&n<Mr[l].priority;l++);Mr.splice(l,0,e),l===0&&Jg(e)}};var tv=i.version;if(tv!=="19.3.1")throw Error(a(527,tv,"19.3.1"));de.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 PS={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vu.isDisabled&&vu.supportsFiber)try{yt=vu.inject(PS),ot=vu}catch{}}return ks.createRoot=function(e,n){if(!o(e))throw Error(a(299));var l=!1,s="",f=Fp,d=Gp,b=$p;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=Yg(e,1,!1,null,null,l,s,null,f,d,b,ev),e[yi]=n.current,Pf(e),new Sd(n)},ks.hydrateRoot=function(e,n,l){if(!o(e))throw Error(a(299));var s=!1,f="",d=Fp,b=Gp,k=$p,_=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=Yg(e,1,!0,n,l??null,s,f,_,d,b,k,ev),n.context=Fg(null),l=n.current,s=Un(),s=Ra(s),f=vr(s),f.callback=null,br(l,f,s),l=s,n.current.lanes=l,Hr(n,l),Ci(n),e[yi]=n.current,Pf(e),new gu(n)},ks.version="19.3.1",ks}var fv;function sk(){if(fv)return jd.exports;fv=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=ak(),jd.exports}var ok=sk(),Sl=Xb();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 uk(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 ck(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
11
|
`);if(o=h.pop()??"",u=Ad(h.join(`
|
|
12
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=uk(a);o&&(r=o,i(o))}return r}const fk=1,dk=500,hk={minMessages:50,minTurns:2},mk=500,pk=2e3,yk=256*1024,gk=6,vk=3,bk=5e3,xk=8*1024*1024,wk=2e3,Sk=500,kk=1e4,Rd=3,Qb=64*1024*1024,Zb="/api/dsh-bot/log/range",Ek="/api/dsh-bot/log/manifest",jk="/api/dsh-bot/log/chunk",Tk="/api/session/events",Nk=3e3,Ck=3e4,Ak=1e3,Rk=15e3,_k="dsh-bot",Ok=2,zk=["log_chunks","log_events","log_cursors"];function Mk(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(_k,Ok);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(),!zk.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 qk(){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>Qb&&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
|
|
13
|
+
`)){const o=uk(a);o&&(r=o,i(o))}return r}const fk=1,dk=500,hk={minMessages:50,minTurns:2},mk=500,pk=2e3,yk=256*1024,gk=6,vk=3,bk=5e3,xk=8*1024*1024,wk=2e3,Sk=500,kk=1e4,Rd=3,Qb=64*1024*1024,Zb="/api/dsh-bot/log/range",Ek="/api/dsh-bot/log/manifest",jk="/api/dsh-bot/log/chunk",Tk="/api/session/events",Nk=3e3,Ck=3e4,Ak=1e3,Rk=15e3,_k="dsh-bot",Ok=2,zk=["log_chunks","log_events","log_cursors"];function Mk(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(_k,Ok);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(),!zk.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 qk(){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>Qb&&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 dv(t){const i=await Kb(t);if(i.ok!==!0)return qk();const r=i.db;return{mode:"idb",async getCursor(a){return Wi(r,"log_cursors","readonly",o=>Rn(o.get(a))).then(o=>o?{appliedSeq:o.appliedSeq,headSeq:o.headSeq??null}:null)},async setCursor(a,o,u){await Wi(r,"log_cursors","readwrite",async c=>{const h=await Rn(c.get(a)),p=h?Math.max(h.appliedSeq,o):o,y=u==null?h?.headSeq??null:Math.max(h?.headSeq??u,u);await Rn(c.put({sessionId:a,appliedSeq:p,headSeq:y,updatedAt:Date.now()}))})},async putEvents(a,o){await Wi(r,"log_events","readwrite",async u=>{for(const c of o)await Rn(u.put({sessionId:a,seq:c.seq,event:c}))})},async readEvents(a,o=-1){return(await Wi(r,"log_events","readonly",c=>{const h=c.index("bySession");return Rn(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 Wi(r,"log_chunks","readonly",u=>Rn(u.get(a)));return o?.bytes?(Wi(r,"log_chunks","readwrite",u=>Rn(u.put({...o,lastUsed:Date.now()},a))),o.bytes):null},async putChunk(a,o){await Wi(r,"log_chunks","readwrite",async u=>{await Rn(u.put({bytes:o,lastUsed:Date.now()},a)),await Dk(u)})}}}async function Dk(t){const i=t.index("byLastUsed"),r=await Rn(i.getAll()),a=await Rn(i.getAllKeys());let o=r.reduce((u,c)=>u+(c.bytes?.byteLength??0),0);for(let u=0;u<r.length&&o>Qb;u+=1){const c=a[u],h=r[u];c==null||!h||(o-=h.bytes.byteLength,await Rn(t.delete(c)))}}async function Lk(t,i){const r=await Kb(i);if(r.ok!==!0)return;const a=r.db;try{await Wi(a,"log_events","readwrite",async o=>{const u=o.index("bySession");for(const c of t){const h=await Rn(u.getAll(c));for(const p of h)!p||p.sessionId!==c||await Rn(o.delete([p.sessionId,p.seq]))}}),await Wi(a,"log_cursors","readwrite",async o=>{for(const u of t)await Rn(o.delete(u))})}finally{a.close()}}function Kb(t){try{return Mk(t)}catch{return Promise.resolve({ok:!1,reason:"unavailable"})}}function Wi(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 Rn(t){return new Promise((i,r)=>{t.onsuccess=()=>i(t.result),t.onerror=()=>r(t.error)})}async function Ri(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 Jb(t,i){return typeof t.message=="string"&&t.message!==""?t.message:i}const Bk=/^(?:Name|名字)\s*[::]\s*(.+?)\s*$/i,Uk=/^(?:Style|风格)\s*[::]\s*(.+?)\s*$/i,Hk=/^(?:Task|任务)\s*[::]\s*(.+?)\s*$/i;function Ik(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
14
|
|
|
15
15
|
`)}function Vk(t){const i={name:"",style:"",task:""};for(const r of t.split(`
|
|
16
|
-
`)){const a=Bk.exec(r),o=Uk.exec(r),u=Hk.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 Yk={"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)"},Fk={"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":"(空结果)"},Pb={en:Yk,zh:Fk},Gk={"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"},$k={"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":"来源"},Wb={en:Gk,zh:$k},Xk={"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."},Qk={"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":"无法读取会话是否仍在运行"},ex={en:Xk,zh:Qk},Zk={"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."},Kk={"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":"没有送出。"},tx={en:Zk,zh:Kk},Jk={"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"},Pk={"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":"主运行时不可达"},nx={en:Jk,zh:Pk},Wk={"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"},eE={"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":"已记录决定"},ix={en:Wk,zh:eE},tE={"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."},nE={"approval.title":"工具许可","approval.allowOnce":"允许一次","approval.reject":"拒绝","approval.waiting":"等待你的回答","approval.allowed":"已允许一次","approval.rejected":"已拒绝","approval.cancelled":"这个请求已被取消。","approval.failed":"这个请求未能完成。","approval.submitFailed":"决定未能提交。"},rx={en:tE,zh:nE},iE={"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"},rE={"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":"自动审阅"},lx={en:iE,zh:rE},lE={"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"},aE={"auth.title":"授权","auth.open":"凭据","auth.empty":"当前没有可进行的授权流程。","auth.start":"开始","auth.writeVault":"写入保险库","auth.cancel":"取消","auth.secretMask":"••••••••","auth.unavailable":"此主机未提供官方授权。","auth.failed":"授权未能完成。","auth.close":"关闭"},ax={en:lE,zh:aE},sE={"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"},oE={"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":"关闭"},sx={en:sE,zh:oE},uE={"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"},cE={"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} 毫秒"},ox={en:uE,zh:cE},ux={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":"重试图片"}},fE={"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"},dE={"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":"更新工作状态"},cx={en:fE,zh:dE},fx={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":"设计预览无法加载。"}},hE={...nx.en,...ex.en,...tx.en,...Wb.en,...ox.en,...Pb.en,...ix.en,...rx.en,...lx.en,...ax.en,...sx.en,...ux.en,...cx.en,...fx.en},mE={...nx.zh,...ex.zh,...tx.zh,...Wb.zh,...ox.zh,...Pb.zh,...ix.zh,...rx.zh,...lx.zh,...ax.zh,...sx.zh,...ux.zh,...cx.zh,...fx.zh},dv={en:hE,zh:mE},hv=new Set;function pE(t){return hv.add(t),()=>{hv.delete(t)}}const dx="dsh-bot.locale";function yE(){try{const t=localStorage.getItem(dx);if(t==="en"||t==="zh")return t}catch{}return"en"}function gE(t){try{localStorage.setItem(dx,t)}catch{}typeof document<"u"&&(document.documentElement.lang=t==="zh"?"zh-CN":"en")}function hx(t,i,r){const a=dv[t][i]??dv.en[i];return r?a.replace(/\{(\w+)\}/g,(o,u)=>r[u]??""):a}function _i(t,i){return hx("en",t,i)}const vE={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 bE(t,i,r=_i){const a=vE[t];return a?r(a):i}const mx=j.createContext({locale:"en",setLocale:()=>{},t:_i});function xE({children:t}){const[i,r]=j.useState(()=>yE()),[a,o]=j.useState(0),u=j.useCallback(p=>{gE(p),r(p)},[]);j.useEffect(()=>pE(()=>o(p=>p+1)),[]);const c=j.useCallback((p,y)=>hx(i,p,y),[i,a]),h=j.useMemo(()=>({locale:i,setLocale:u,t:c}),[i,u,c]);return m.jsx(mx.Provider,{value:h,children:t})}function We(){return j.useContext(mx)}const wE={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"},SE=new Set(["delivered","cancelled"]),kE=new Set(["accepted","enqueued","started","needs_user","waiting_budget"]);function px(t,i=_i){const r=wE[t];return r?i(r):t}function yx(t){return t.replace(/^\uFEFF/,"").trimStart().startsWith("[foundations:ticket]")}function Nh(t){const i=t.replace(/^\uFEFF/,"").replace(/\r\n/g,`
|
|
16
|
+
`)){const a=Bk.exec(r),o=Uk.exec(r),u=Hk.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 Yk={"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)"},Fk={"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":"(空结果)"},Pb={en:Yk,zh:Fk},Gk={"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"},$k={"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":"来源"},Wb={en:Gk,zh:$k},Xk={"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."},Qk={"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":"无法读取会话是否仍在运行"},ex={en:Xk,zh:Qk},Zk={"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."},Kk={"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":"没有送出。"},tx={en:Zk,zh:Kk},Jk={"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"},Pk={"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":"主运行时不可达"},nx={en:Jk,zh:Pk},Wk={"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"},eE={"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":"已记录决定"},ix={en:Wk,zh:eE},tE={"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."},nE={"approval.title":"工具许可","approval.allowOnce":"允许一次","approval.reject":"拒绝","approval.waiting":"等待你的回答","approval.allowed":"已允许一次","approval.rejected":"已拒绝","approval.cancelled":"这个请求已被取消。","approval.failed":"这个请求未能完成。","approval.submitFailed":"决定未能提交。"},rx={en:tE,zh:nE},iE={"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."},rE={"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":"之后新建的主会话会从完全允许开始。这是很宽的权限:工作区以外的文件也可以改,并且不再弹出审批。"},lx={en:iE,zh:rE},lE={"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"},aE={"auth.title":"授权","auth.open":"凭据","auth.empty":"当前没有可进行的授权流程。","auth.start":"开始","auth.writeVault":"写入保险库","auth.cancel":"取消","auth.secretMask":"••••••••","auth.unavailable":"此主机未提供官方授权。","auth.failed":"授权未能完成。","auth.close":"关闭"},ax={en:lE,zh:aE},sE={"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"},oE={"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":"关闭"},sx={en:sE,zh:oE},uE={"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"},cE={"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} 毫秒"},ox={en:uE,zh:cE},ux={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":"重试图片"}},fE={"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"},dE={"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":"更新工作状态"},cx={en:fE,zh:dE},fx={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":"设计预览无法加载。"}},hE={...nx.en,...ex.en,...tx.en,...Wb.en,...ox.en,...Pb.en,...ix.en,...rx.en,...lx.en,...ax.en,...sx.en,...ux.en,...cx.en,...fx.en},mE={...nx.zh,...ex.zh,...tx.zh,...Wb.zh,...ox.zh,...Pb.zh,...ix.zh,...rx.zh,...lx.zh,...ax.zh,...sx.zh,...ux.zh,...cx.zh,...fx.zh},hv={en:hE,zh:mE},mv=new Set;function pE(t){return mv.add(t),()=>{mv.delete(t)}}const dx="dsh-bot.locale";function yE(){try{const t=localStorage.getItem(dx);if(t==="en"||t==="zh")return t}catch{}return"en"}function gE(t){try{localStorage.setItem(dx,t)}catch{}typeof document<"u"&&(document.documentElement.lang=t==="zh"?"zh-CN":"en")}function hx(t,i,r){const a=hv[t][i]??hv.en[i];return r?a.replace(/\{(\w+)\}/g,(o,u)=>r[u]??""):a}function _i(t,i){return hx("en",t,i)}const vE={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 bE(t,i,r=_i){const a=vE[t];return a?r(a):i}const mx=E.createContext({locale:"en",setLocale:()=>{},t:_i});function xE({children:t}){const[i,r]=E.useState(()=>yE()),[a,o]=E.useState(0),u=E.useCallback(p=>{gE(p),r(p)},[]);E.useEffect(()=>pE(()=>o(p=>p+1)),[]);const c=E.useCallback((p,y)=>hx(i,p,y),[i,a]),h=E.useMemo(()=>({locale:i,setLocale:u,t:c}),[i,u,c]);return m.jsx(mx.Provider,{value:h,children:t})}function et(){return E.useContext(mx)}const wE={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"},SE=new Set(["delivered","cancelled"]),kE=new Set(["accepted","enqueued","started","needs_user","waiting_budget"]);function px(t,i=_i){const r=wE[t];return r?i(r):t}function yx(t){return t.replace(/^\uFEFF/,"").trimStart().startsWith("[foundations:ticket]")}function Ch(t){const i=t.replace(/^\uFEFF/,"").replace(/\r\n/g,`
|
|
17
17
|
`).trimStart();if(!i.startsWith("[foundations:briefing]"))return null;const r=i.slice(22).replace(/^\n/,""),a=r.indexOf(`
|
|
18
18
|
---
|
|
19
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 ba(t){return t.startsWith("worker-")&&t.length>7}function EE(t){return ba(t)?t.slice(7):""}function jE(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 TE(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]=CE({cards:o});return r}function NE(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:jE(i),cards:TE(i)}}function CE(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=AE(r,a);return o?[o]:[]}):[]}function AE(t,i="",r=_i){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(UE):[],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 RE(t){const i=t.filter(a=>!SE.has(a.status)),r=t.find(a=>a.status==="delivered");return r?[...i,r]:i}function gx(t){return t.some(i=>kE.has(i.status))}function mv(t,i,r=!1){return r?!1:t&&!gx(i)}const _E=new Set(["accepted","enqueued","started"]);function OE(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:_E.has(o.status)&&(a=!0));return r?"wait":a?"run":null}function _d(t,i=Date.now(),r=_i){const a=t.filter(c=>c.status==="started");if(a.length>1)return r("work.preview.startedMany",{count:String(a.length)});const o=xx(t);if(!o||o.status==="ready")return"";const u=px(o.status,r);if(o.status==="started"){const c=bx(o.startedAt,i);return c?`${u} · ${c}`:u}return u}function zE(t,i=_i){if(t.filter(o=>o.status==="started").length>1)return i("work.placeholder.many");const a=xx(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 ME(t,i,r=_i){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=bx(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=BE(t);return o&&a.push(o),a}function qE(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 vx(t){return t==="foundations_dispatch"||t==="foundations_dispatch_canvas"}function DE(t){if(!vx(t.name)||t.result.trim()==="")return!1;const i=wx(t.result);return i?i.ok===!1&&i.code==="BUDGET":t.result.includes('"BUDGET"')||/concurrency limit/i.test(t.result)}function LE(t,i=_i){const r=wx(t);return r&&typeof r.message=="string"&&r.message!==""?r.message:i("work.budgetFallback")}function bx(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 xx(t){const i=RE(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 BE(t){return t.events.filter(r=>r.kind==="progress"&&r.applyStatus==="applied"&&r.revision===t.revision&&r.text.trim()!=="").at(-1)?.text??""}function UE(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 wx(t){try{const i=JSON.parse(t);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}const HE="modulepreload",IE=function(t){return"/dsh-bot/"+t},pv={},VE=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=IE(y),y in pv)return;pv[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":HE,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,Cs=268,Od=220,yv=400,kx=320,Ex=960,Ms=640;function Ea(t){return Number.isFinite(t)?Math.min(Ex,Math.max(kx,Math.round(t))):Ms}function jx(t){return Math.max(0,(t-Math.min(Sx,t))/2)}function Nu(t){const i=jx(t);return{drawer:0,reserve:0,sidebar:Cs,inset:i,insetRight:i,overlap:!1}}function gv(t,i){const r=Math.min(Ex,Math.max(kx,i)),a=Math.min(Sx,t),o=jx(t),u=Od+yv;if(r<=o)return{drawer:r,reserve:0,sidebar:Cs,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:Od,inset:0,insetRight:0,overlap:!0};const p=Math.max(0,a-h),y=Math.max(0,a-Cs-yv),v=Math.max(0,Cs-Od),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:Cs-x,inset:c,insetRight:0,overlap:!1}}function vv(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 wa=null;function Cu(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 bv(t){if(wa!==t)return;wa=null,document.documentElement.classList.remove("files-push","files-closing","files-resizing"),Cu(Nu(0))}function Tx(t){const{present:i,narrow:r,motion:a,width:o,resizing:u,viewport:c}=t,h=j.useRef(Symbol("drawer")),p=j.useRef(!1),y=j.useRef(i),v=j.useRef(a);y.current=i,v.current=a,j.useLayoutEffect(()=>{const g=document.documentElement,w=h.current;if(!i||r){p.current=!1,bv(w);return}if(a==="out"&&wa!==null&&wa!==w){p.current=!1;return}wa=w;const x=a==="out"?Nu(c):gv(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"),Cu(Nu(c));let S=!1;const T=requestAnimationFrame(()=>{if(S=!0,wa!==w||(g.classList.remove("files-resizing"),!y.current))return;const C=v.current==="out"?Nu(window.innerWidth):gv(window.innerWidth,o);Cu(C)});return()=>{cancelAnimationFrame(T),S||(p.current=!1)}}p.current=!0,Cu(x)},[i,r,a,o,u,c]),j.useEffect(()=>()=>{p.current=!1,bv(h.current)},[])}function nz(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 YE(t){const i=t.split(".").pop()?.toLowerCase()??"";return i==="md"||i==="markdown"}function FE(t,i){const r={};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const GE=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$E=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XE={};function xv(t,i){return(XE.jsx?$E:GE).test(t)}const QE=/[ \t\n\f\r]/g;function ZE(t){return typeof t=="object"?t.type==="text"?wv(t.value):!1:wv(t)}function wv(t){return t.replace(QE,"")===""}class Hs{constructor(i,r,a){this.normal=r,this.property=i,a&&(this.space=a)}}Hs.prototype.normal={};Hs.prototype.property={};Hs.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 Hs(r,a,i)}function th(t){return t.toLowerCase()}class On{constructor(i,r){this.attribute=r,this.property=i}}On.prototype.attribute="";On.prototype.booleanish=!1;On.prototype.boolean=!1;On.prototype.commaOrSpaceSeparated=!1;On.prototype.commaSeparated=!1;On.prototype.defined=!1;On.prototype.mustUseProperty=!1;On.prototype.number=!1;On.prototype.overloadedBoolean=!1;On.prototype.property="";On.prototype.spaceSeparated=!1;On.prototype.space=void 0;let KE=0;const $e=kl(),tn=kl(),nh=kl(),fe=kl(),Dt=kl(),bl=kl(),In=kl();function kl(){return 2**++KE}const ih=Object.freeze(Object.defineProperty({__proto__:null,boolean:$e,booleanish:tn,commaOrSpaceSeparated:In,commaSeparated:bl,number:fe,overloadedBoolean:nh,spaceSeparated:Dt},Symbol.toStringTag,{value:"Module"})),zd=Object.keys(ih);class Ch extends On{constructor(i,r,a,o){let u=-1;if(super(i,r),Sv(this,"space",o),typeof a=="number")for(;++u<zd.length;){const c=zd[u];Sv(this,zd[u],(a&ih[c])===ih[c])}}}Ch.prototype.defined=!0;function Sv(t,i,r){r&&(t[i]=r)}function Na(t){const i={},r={};for(const[a,o]of Object.entries(t.properties)){const u=new Ch(a,t.transform(t.attributes||{},a),o,t.space);t.mustUseProperty&&t.mustUseProperty.includes(a)&&(u.mustUseProperty=!0),i[a]=u,r[th(a)]=a,r[th(u.attribute)]=a}return new Hs(i,r,t.space)}const Cx=Na({properties:{ariaActiveDescendant:null,ariaAtomic:tn,ariaAutoComplete:null,ariaBusy:tn,ariaChecked:tn,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:Dt,ariaCurrent:null,ariaDescribedBy:Dt,ariaDetails:null,ariaDisabled:tn,ariaDropEffect:Dt,ariaErrorMessage:null,ariaExpanded:tn,ariaFlowTo:Dt,ariaGrabbed:tn,ariaHasPopup:null,ariaHidden:tn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Dt,ariaLevel:fe,ariaLive:null,ariaModal:tn,ariaMultiLine:tn,ariaMultiSelectable:tn,ariaOrientation:null,ariaOwns:Dt,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:tn,ariaReadOnly:tn,ariaRelevant:null,ariaRequired:tn,ariaRoleDescription:Dt,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:tn,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 JE=Na({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:bl,acceptCharset:Dt,accessKey:Dt,action:null,allow:null,allowFullScreen:$e,allowPaymentRequest:$e,allowUserMedia:$e,alpha:$e,alt:null,as:null,async:$e,autoCapitalize:null,autoComplete:Dt,autoFocus:$e,autoPlay:$e,blocking:Dt,capture:null,charSet:null,checked:$e,cite:null,className:Dt,closedBy:null,colorSpace:null,cols:fe,colSpan:fe,command:null,commandFor:null,content:null,contentEditable:tn,controls:$e,controlsList:Dt,coords:fe|bl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$e,defer:$e,dir:null,dirName:null,disabled:$e,download:nh,draggable:tn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$e,formTarget:null,headers:Dt,height:fe,hidden:nh,high:fe,href:null,hrefLang:null,htmlFor:Dt,httpEquiv:Dt,id:null,imageSizes:null,imageSrcSet:null,inert:$e,inputMode:null,integrity:null,is:null,isMap:$e,itemId:null,itemProp:Dt,itemRef:Dt,itemScope:$e,itemType:Dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$e,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:$e,muted:$e,name:null,nonce:null,noModule:$e,noValidate:$e,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:$e,optimum:fe,pattern:null,ping:Dt,placeholder:null,playsInline:$e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$e,referrerPolicy:null,rel:Dt,required:$e,reversed:$e,rows:fe,rowSpan:fe,sandbox:Dt,scope:null,scoped:$e,seamless:$e,selected:$e,shadowRootClonable:$e,shadowRootCustomElementRegistry:$e,shadowRootDelegatesFocus:$e,shadowRootMode:null,shadowRootSerializable:$e,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:tn,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:$e,useMap:null,value:tn,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:$e,declare:$e,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:$e,noHref:$e,noShade:$e,noWrap:$e,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:tn,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:$e,disablePictureInPicture:$e,disableRemotePlayback:$e,exportParts:bl,part:Dt,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:Rx}),PE=Na({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:In,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:$e,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:bl,g2:bl,glyphName:bl,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:In,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:In,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:In,rev:In,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:In,requiredFeatures:In,requiredFonts:In,requiredFormats:In,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:In,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:In,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:In,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=Na({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=Na({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Rx}),zx=Na({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,i){return"xml:"+i.slice(3).toLowerCase()}}),WE={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"},ej=/[A-Z]/g,kv=/-[a-z]/g,tj=/^data[-\w.:]+$/i;function nj(t,i){const r=th(i);let a=i,o=On;if(r in t.normal)return t.property[t.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&tj.test(i)){if(i.charAt(4)==="-"){const u=i.slice(5).replace(kv,rj);a="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=i.slice(4);if(!kv.test(u)){let c=u.replace(ej,ij);c.charAt(0)!=="-"&&(c="-"+c),i="data"+c}}o=Ch}return new o(a,i)}function ij(t){return"-"+t.toLowerCase()}function rj(t){return t.charAt(1).toUpperCase()}const lj=Nx([Cx,JE,_x,Ox,zx],"html"),Ah=Nx([Cx,PE,_x,Ox,zx],"svg");function aj(t){return t.join(" ").trim()}var Ev=/\/\*(?:[^*]|\*(?!\/))*\*\//g,sj=/\n/g,oj=/^\s*/,uj=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,cj=/^:\s*/,fj=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,dj=/^[;\s]*/,hj=`
|
|
21
|
-
`,jv="/",Tv="*",Es="",mj="comment",pj="declaration";function yj(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(sj);T&&(r+=T.length);var C=S.lastIndexOf(hj);a=~C?S.length-C:a+S.length}function u(){var S={line:r,column:a};return function(T){return T.position=new c(S),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 C=T[0];return o(C),t=t.slice(C.length),T}}function y(){p(oj)}function v(S){for(var T;T=g();)S.push(T);return S}function g(){var S=u();if(!(jv!=t.charAt(0)||Tv!=t.charAt(1))){for(var T=2;Es!=t.charAt(T)&&(Tv!=t.charAt(T)||jv!=t.charAt(T+1));)++T;if(T+=2,Es===t.charAt(T-1))return h("End of comment missing");var C=t.slice(2,T-2);return a+=2,o(C),t=t.slice(T),a+=2,S({type:mj,comment:C})}}function w(){var S=u(),T=p(uj);if(T){if(g(),!p(cj))return h("property missing ':'");var C=p(fj),k=S({type:pj,property:T[0].replace(Ev,Es).trim(),value:C?C[0].replace(Ev,Es).trim():Es});return p(dj),k}}function x(){var S=[];v(S);for(var T;T=w();)S.push(T),v(S);return S}return y(),x()}function gj(t,i){let r=null;if(!t||typeof t!="string")return r;const a=yj(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"),Rh=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 vj(t){const i=Rh(t),r=Mx(t);if(i&&r)return{start:i,end:r}}function Rs(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Nv(t.position):"start"in t||"end"in t?Nv(t):"line"in t||"column"in t?rh(t):""}function rh(t){return Cv(t&&t.line)+":"+Cv(t&&t.column)}function Nv(t){return rh(t&&t.start)+"-"+rh(t&&t.end)}function Cv(t){return t&&typeof t=="number"?t:1}class $u 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=Rs(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($u.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 _h={}.hasOwnProperty,bj=new Map,xj=/[A-Z]/g,wj=/-([a-z])/g,Sj=new Set(["table","tbody","thead","tfoot","tr"]),kj=new Set(["td","th"]),Dx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ej(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=Oj(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=_j(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"?Ah:lj,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 jj(t,i,r);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return Tj(t,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return Cj(t,i,r);if(i.type==="mdxjsEsm")return Nj(t,i);if(i.type==="root")return Aj(t,i,r);if(i.type==="text")return Rj(t,i)}function jj(t,i,r){const a=t.schema;let o=a;i.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=Ah,t.schema=o),t.ancestors.push(i);const u=Ux(t,i.tagName,!1),c=zj(t,i);let h=zh(t,i);return Sj.has(i.tagName)&&(h=h.filter(function(p){return typeof p=="string"?!ZE(p):!0})),Bx(t,c,u,i),Oh(c,h),t.ancestors.pop(),t.schema=a,t.create(i,u,c,r)}function Tj(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)}qs(t,i.position)}function Nj(t,i){if(i.data&&i.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(i.data.estree);qs(t,i.position)}function Cj(t,i,r){const a=t.schema;let o=a;i.name==="svg"&&a.space==="html"&&(o=Ah,t.schema=o),t.ancestors.push(i);const u=i.name===null?t.Fragment:Ux(t,i.name,!0),c=Mj(t,i),h=zh(t,i);return Bx(t,c,u,i),Oh(c,h),t.ancestors.pop(),t.schema=a,t.create(i,u,c,r)}function Aj(t,i,r){const a={};return Oh(a,zh(t,i)),t.create(i,t.Fragment,a,r)}function Rj(t,i){return i.value}function Bx(t,i,r,a){typeof r!="string"&&r!==t.Fragment&&t.passNode&&(i.node=a)}function Oh(t,i){if(i.length>0){const r=i.length>1?i:i[0];r&&(t.children=r)}}function _j(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 Oj(t,i){return r;function r(a,o,u,c){const h=Array.isArray(u.children),p=Rh(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 zj(t,i){const r={};let a,o;for(o in i.properties)if(o!=="children"&&_h.call(i.properties,o)){const u=qj(t,o,i.properties[o]);if(u){const[c,h]=u;t.tableCellAlignToStyle&&c==="align"&&typeof h=="string"&&kj.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 Mj(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 qs(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 qs(t,i.position);else u=a.value===null?!0:a.value;r[o]=u}return r}function zh(t,i){const r=[];let a=-1;const o=t.passKeys?new Map:bj;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 qj(t,i,r){if(r==null||typeof r=="number"&&Number.isNaN(r))return;const a=nj(t.schema,i);return Array.isArray(r)&&(r=a.commaSeparated?FE(r):aj(r)),a.property==="style"?["style",typeof r=="object"?t.stylePropertyNameCase==="dom"?r:Lj(r):Dj(t,String(r))]:[t.elementAttributeNameCase==="react"&&a.space?WE[a.property]||a.property:a.attribute,r]}function Dj(t,i){const r={};try{gj(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(wj,Hj))),r[u]=o}})}catch(a){if(t.ignoreInvalidStyle)return{};const o=a,u=new $u("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=xv(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=xv(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(a.type==="Literal"){const o=a.value;return _h.call(t.components,o)?t.components[o]:o}if(t.evaluater)return t.evaluater.evaluateExpression(a);qs(t)}function qs(t,i){const r=new $u("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 Lj(t){const i={};let r;for(r in t)_h.call(t,r)&&(i[Bj(r)]=t[r]);return i}function Bj(t){if(t.slice(0,2)==="--")return t;let i=t.replace(xj,Uj);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function Uj(t){return"-"+t.toLowerCase()}function Hj(t,i){return i.toUpperCase()}const Md={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"]},Ij={};function Xu(t,i){const r=Ij,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(Vj(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 Av(t.children,i,r)}return Array.isArray(t)?Av(t,i,r):""}function Av(t,i,r){const a=[];let o=-1;for(;++o<t.length;)a[o]=Hx(t[o],i,r);return a.join("")}function Vj(t){return!!(t&&typeof t=="object")}const Rv=document.createElement("i");function Mh(t){const i="&"+t+";";Rv.innerHTML=i;const r=Rv.textContent;return r.charCodeAt(r.length-1)===59&&t!=="semi"||r===i?!1:r}function hi(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 ri(t,i){return t.length>0?(hi(t,t.length,0,i),t):i}const _v={}.hasOwnProperty;function Ix(t){const i={};let r=-1;for(;++r<t.length;)Yj(i,t[r]);return i}function Yj(t,i){let r;for(r in i){const o=(_v.call(t,r)?t[r]:void 0)||(t[r]={}),u=i[r];let c;if(u)for(c in u){_v.call(o,c)||(o[c]=[]);const h=u[c];Fj(o[c],Array.isArray(h)?h:h?[h]:[])}}}function Fj(t,i){let r=-1;const a=[];for(;++r<i.length;)(i[r].add==="after"?t:a).push(i[r]);hi(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 mi(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pn=Ur(/[A-Za-z]/),yn=Ur(/[\dA-Za-z]/),Gj=Ur(/[#-'*+\--9=?A-Z^-~]/);function Ou(t){return t!==null&&(t<32||t===127)}const lh=Ur(/\d/),$j=Ur(/[\dA-Fa-f]/),Yx=Ur(/[!-/:-@[-`{-~]/);function He(t){return t!==null&&t<-2}function Lt(t){return t!==null&&(t<0||t===32)}function it(t){return t===-2||t===-1||t===32}const Is=Ur(new RegExp("\\p{P}|\\p{S}","u")),xl=Ur(/\s/);function Ur(t){return i;function i(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function Ca(t){const i=[];let r=-1,a=0,o=0;for(;++r<t.length;){const u=t.charCodeAt(r);let c="";if(u===37&&yn(t.charCodeAt(r+1))&&yn(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 wt(t,i,r,a){const o=a?a-1:1/0;let u=0;return c;function c(p){return it(p)?(t.enter(r),h(p)):i(p)}function h(p){return it(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 it(v)?(t.enter(a),p(v)):y(v)}function p(v){return it(v)&&c<u?(t.consume(v),c++,p):(t.exit(a),y(v))}function y(v){return c>=o?i(v):r(v)}}const Xj={tokenize:Qj};function Qj(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"),wt(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 zu=class{constructor(){this.index=new Map,this.map=[]}add(i,r,a){Ov(this,i,r,a,!1)}addBefore(i,r,a){Ov(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 Ov(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 Zj={tokenize:Kj},zv={tokenize:Jj};function Kj(t){const i=this,r=[];let a=0,o,u,c;return h;function h(L){if(a<r.length){const P=r[a];return i.containerState=P[1],t.attempt(P[0].continuation,p,y)(L)}return y(L)}function p(L){if(a++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,o&&M();const P=i.events.length;let ie=P,A;for(;ie--;)if(i.events[ie][0]==="exit"&&i.events[ie][1].type==="chunkFlow"){A=i.events[ie][1].end;break}k(a);let F=P;for(;F<i.events.length;)i.events[F][1].end={...A},F++;const X=new zu;return X.add(ie+1,0,i.events.slice(P)),X.add(P,F-P,[]),X.consume(i.events),y(L)}return h(L)}function y(L){if(a===r.length){if(!o)return w(L);if(o.currentConstruct&&o.currentConstruct.concrete)return S(L);i.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return i.containerState={},t.check(zv,v,g)(L)}function v(L){return o&&M(),k(a),w(L)}function g(L){return i.parser.lazy[i.now().line]=a!==r.length,c=i.now().offset,S(L)}function w(L){return i.containerState={},t.attempt(zv,x,S)(L)}function x(L){return a++,r.push([i.currentConstruct,i.containerState]),w(L)}function S(L){if(L===null){o&&M(),k(0),t.consume(L);return}return o=o||i.parser.flow(i.now()),t.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),T(L)}function T(L){if(L===null){C(t.exit("chunkFlow"),!0),k(0),t.consume(L);return}return He(L)?(t.consume(L),C(t.exit("chunkFlow")),a=0,i.interrupt=void 0,h):(t.consume(L),T)}function C(L,P){const ie=i.sliceStream(L);if(P&&ie.push(null),L.previous=u,u&&(u.next=L),u=L,o.defineSkip(L.start),o.write(ie),i.parser.lazy[L.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 F=i.events.length;let X=F,le,O;for(;X--;)if(i.events[X][0]==="exit"&&i.events[X][1].type==="chunkFlow"){if(le){O=i.events[X][1].end;break}le=!0}for(k(a),A=F;A<i.events.length;)i.events[A][1].end={...O},A++;const V=new zu;V.add(X+1,0,i.events.slice(F)),V.add(F,A-F,[]),V.consume(i.events)}}function k(L){let P=r.length;for(;P-- >L;){const ie=r[P];i.containerState=ie[1],ie[0].exit.call(i,t)}r.length=L}function M(){o.write([null]),u=void 0,o=void 0,i.containerState._closeFlow=void 0}}function Jj(t,i,r){return wt(t,t.attempt(this.parser.constructs.document,i,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Lr(t){if(t===null||Lt(t)||xl(t))return 1;if(Is(t))return 2}function Qu(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 ah={name:"attention",resolveAll:Pj,tokenize:Wj};function Pj(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};Mv(c,-u),Mv(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=ri(a,[["enter",t[o][1],i],["exit",t[o][1],i]])),a=ri(a,[["enter",g,i],["enter",p,i],["exit",p,i],["enter",v,i]]),a=ri(a,Qu(i.parser.constructs.insideSpan.null,t.slice(o+1,r),i)),a=ri(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=ri(a,[["enter",t[r][1],i],["exit",t[r][1],i]])),hi(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 Wj(t,i){const r=this.parser.constructs.attentionMarkers.null,a=this.previous,o=Lr(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=Lr(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 Mv(t,i){t.column+=i,t.offset+=i,t._bufferIndex+=i}const eT={name:"autolink",tokenize:tT};function tT(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 pn(x)?(t.consume(x),c):x===64?r(x):y(x)}function c(x){return x===43||x===45||x===46||yn(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||yn(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||Ou(x)?r(x):(t.consume(x),p)}function y(x){return x===64?(t.consume(x),v):Gj(x)?(t.consume(x),y):r(x)}function v(x){return yn(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||yn(x))&&a++<63){const S=x===45?w:g;return t.consume(x),S}return r(x)}}const Vs={partial:!0,tokenize:nT};function nT(t,i,r){return a;function a(u){return it(u)?wt(t,o,"linePrefix")(u):o(u)}function o(u){return u===null||He(u)?i(u):r(u)}}const Gx={continuation:{tokenize:rT},exit:lT,name:"blockQuote",tokenize:iT};function iT(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 it(c)?(t.enter("blockQuotePrefixWhitespace"),t.consume(c),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),i):(t.exit("blockQuotePrefix"),i(c))}}function rT(t,i,r){const a=this;return o;function o(c){return it(c)?wt(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 lT(t){t.exit("blockQuote")}const $x={name:"characterEscape",tokenize:aT};function aT(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:sT};function sT(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=yn,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=$j,v):(t.enter("characterReferenceValue"),u=7,c=lh,v(g))}function v(g){if(g===59&&o){const w=t.exit("characterReferenceValue");return c===yn&&!Mh(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 sh={partial:!0,tokenize:oT};function oT(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 qv={concrete:!0,name:"codeFenced",tokenize:uT};function uT(t,i,r){const a=this,o={partial:!0,tokenize:ie};let u=0,c=0,h;return p;function p(A){return y(A)}function y(A){const F=a.events[a.events.length-1];return u=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[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"),it(A)?wt(t,g,"whitespace")(A):g(A))}function g(A){return A===null||He(A)?(t.exit("codeFencedFence"),a.interrupt?i(A):t.check(sh,T,P)(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)):it(A)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),wt(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,P,C)(A)}function C(A){return t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),k}function k(A){return u>0&&it(A)?wt(t,M,"linePrefix",u+1)(A):M(A)}function M(A){return A===null||He(A)?t.check(sh,T,P)(A):(t.enter("codeFlowValue"),L(A))}function L(A){return A===null||He(A)?(t.exit("codeFlowValue"),M(A)):(t.consume(A),L)}function P(A){return t.exit("codeFenced"),i(A)}function ie(A,F,X){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"),it(ge)?wt(A,W,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ge):W(ge)}function W(ge){return ge===h?(A.enter("codeFencedFenceSequence"),ke(ge)):X(ge)}function ke(ge){return ge===h?(le++,A.consume(ge),ke):le>=c?(A.exit("codeFencedFenceSequence"),it(ge)?wt(A,oe,"whitespace")(ge):oe(ge)):X(ge)}function oe(ge){return ge===null||He(ge)?(A.exit("codeFencedFence"),F(ge)):X(ge)}}}const qd={name:"codeIndented",tokenize:fT},cT={partial:!0,tokenize:dT};function fT(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(cT,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 dT(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 hT={name:"codeText",previous:pT,resolve:mT,tokenize:yT};function mT(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 pT(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function yT(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 gT{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&&js(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),js(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),js(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);js(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);js(this.left,r.reverse())}}}function js(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 gT(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,vT(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 hi(t,0,Number.POSITIVE_INFINITY,v.slice(0)),!y}function vT(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 C=[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,C.push(T),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(c.events=[],x?(x._tokenizer=void 0,x.previous=void 0):C.pop(),w=C.length;w--;){const k=h.slice(C[w],C[w+1]),M=u.pop();p.push([M,M+k.length-1]),t.splice(M,2,k)}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 bT={resolve:wT,tokenize:ST},xT={partial:!0,tokenize:kT};function wT(t){return Qx(t),t}function ST(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(xT,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 kT(t,i,r){const a=this;return o;function o(c){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),wt(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(k){return k===60?(t.enter(a),t.enter(o),t.enter(u),t.consume(k),t.exit(u),w):k===null||k===32||k===41||Ou(k)?r(k):(t.enter(a),t.enter(c),t.enter(h),t.enter("chunkString",{contentType:"string"}),T(k))}function w(k){return k===62?(t.enter(u),t.consume(k),t.exit(u),t.exit(o),t.exit(a),i):(t.enter(h),t.enter("chunkString",{contentType:"string"}),x(k))}function x(k){return k===62?(t.exit("chunkString"),t.exit(h),w(k)):k===null||k===60||He(k)?r(k):(t.consume(k),k===92?S:x)}function S(k){return k===60||k===62||k===92?(t.consume(k),x):x(k)}function T(k){return!v&&(k===null||k===41||Lt(k))?(t.exit("chunkString"),t.exit(h),t.exit(c),t.exit(a),i(k)):v<y&&k===40?(t.consume(k),v++,T):k===41?(t.consume(k),v--,T):k===null||k===32||k===40||Ou(k)?r(k):(t.consume(k),k===92?C:T)}function C(k){return k===40||k===41||k===92?(t.consume(k),T):T(k)}}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=!it(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"),wt(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 _s(t,i){let r;return a;function a(o){return He(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r=!0,a):it(o)?wt(t,a,r?"linePrefix":"lineSuffix")(o):i(o)}}const ET={name:"definition",tokenize:TT},jT={partial:!0,tokenize:NT};function TT(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=mi(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)?_s(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(jT,g,g)(x)}function g(x){return it(x)?wt(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 NT(t,i,r){return a;function a(h){return Lt(h)?_s(t,o)(h):r(h)}function o(h){return Jx(t,u,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function u(h){return it(h)?wt(t,c,"whitespace")(h):c(h)}function c(h){return h===null||He(h)?i(h):r(h)}}const CT={name:"hardBreakEscape",tokenize:AT};function AT(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 RT={name:"headingAtx",resolve:_T,tokenize:OT};function _T(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"};hi(t,a,r-a+1,[["enter",o,i],["enter",u,i],["exit",u,i],["exit",o,i]])}return t}function OT(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)):it(v)?wt(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"],oh=["pre","script","style","textarea"],zT={concrete:!0,name:"htmlFlow",resolveTo:qT,tokenize:DT},MT={partial:!0,tokenize:LT};function qT(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 DT(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):pn(q)?(t.consume(q),c=String.fromCharCode(q),C):r(q)}function w(q){return q===45?(t.consume(q),o=2,x):q===91?(t.consume(q),o=5,h=0,S):pn(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:W:S):r(q)}function T(q){return pn(q)?(t.consume(q),c=String.fromCharCode(q),C):r(q)}function C(q){if(q===null||q===47||q===62||Lt(q)){const z=q===47,ee=c.toLowerCase();return!z&&!u&&oh.includes(ee)?(o=1,a.interrupt?i(q):W(q)):Px.includes(c.toLowerCase())?(o=6,z?(t.consume(q),k):a.interrupt?i(q):W(q)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?r(q):u?M(q):L(q))}return q===45||yn(q)?(t.consume(q),c+=String.fromCharCode(q),C):r(q)}function k(q){return q===62?(t.consume(q),a.interrupt?i:W):r(q)}function M(q){return it(q)?(t.consume(q),M):O(q)}function L(q){return q===47?(t.consume(q),O):q===58||q===95||pn(q)?(t.consume(q),P):it(q)?(t.consume(q),L):O(q)}function P(q){return q===45||q===46||q===58||q===95||yn(q)?(t.consume(q),P):ie(q)}function ie(q){return q===61?(t.consume(q),A):it(q)?(t.consume(q),ie):L(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,F):it(q)?(t.consume(q),A):X(q)}function F(q){return q===p?(t.consume(q),p=null,le):q===null||He(q)?r(q):(t.consume(q),F)}function X(q){return q===null||q===34||q===39||q===47||q===60||q===61||q===62||q===96||Lt(q)?ie(q):(t.consume(q),X)}function le(q){return q===47||q===62||it(q)?L(q):r(q)}function O(q){return q===62?(t.consume(q),V):r(q)}function V(q){return q===null||He(q)?W(q):it(q)?(t.consume(q),V):r(q)}function W(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),Ze):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(MT,Ie,ke)(q)):q===null||He(q)?(t.exit("htmlFlowData"),ke(q)):(t.consume(q),W)}function ke(q){return t.check(sh,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"),W(q))}function re(q){return q===45?(t.consume(q),R):W(q)}function ce(q){return q===47?(t.consume(q),c="",xe):W(q)}function xe(q){if(q===62){const z=c.toLowerCase();return oh.includes(z)?(t.consume(q),Ze):W(q)}return pn(q)&&c.length<8?(t.consume(q),c+=String.fromCharCode(q),xe):W(q)}function Te(q){return q===93?(t.consume(q),R):W(q)}function R(q){return q===62?(t.consume(q),Ze):q===45&&o===2?(t.consume(q),R):W(q)}function Ze(q){return q===null||He(q)?(t.exit("htmlFlowData"),Ie(q)):(t.consume(q),Ze)}function Ie(q){return t.exit("htmlFlow"),i(q)}}function LT(t,i,r){return a;function a(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(Vs,i,r)}}const BT={name:"htmlText",tokenize:UT};function UT(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),ie):R===63?(t.consume(R),L):pn(R)?(t.consume(R),X):r(R)}function y(R){return R===45?(t.consume(R),v):R===91?(t.consume(R),u=0,S):pn(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 Ze="CDATA[";return R===Ze.charCodeAt(u++)?(t.consume(R),u===Ze.length?T:S):r(R)}function T(R){return R===null?r(R):R===93?(t.consume(R),C):He(R)?(c=T,ce(R)):(t.consume(R),T)}function C(R){return R===93?(t.consume(R),k):T(R)}function k(R){return R===62?re(R):R===93?(t.consume(R),k):T(R)}function M(R){return R===null||R===62?re(R):He(R)?(c=M,ce(R)):(t.consume(R),M)}function L(R){return R===null?r(R):R===63?(t.consume(R),P):He(R)?(c=L,ce(R)):(t.consume(R),L)}function P(R){return R===62?re(R):L(R)}function ie(R){return pn(R)?(t.consume(R),A):r(R)}function A(R){return R===45||yn(R)?(t.consume(R),A):F(R)}function F(R){return He(R)?(c=F,ce(R)):it(R)?(t.consume(R),F):re(R)}function X(R){return R===45||yn(R)?(t.consume(R),X):R===47||R===62||Lt(R)?le(R):r(R)}function le(R){return R===47?(t.consume(R),re):R===58||R===95||pn(R)?(t.consume(R),O):He(R)?(c=le,ce(R)):it(R)?(t.consume(R),le):re(R)}function O(R){return R===45||R===46||R===58||R===95||yn(R)?(t.consume(R),O):V(R)}function V(R){return R===61?(t.consume(R),W):He(R)?(c=V,ce(R)):it(R)?(t.consume(R),V):le(R)}function W(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=W,ce(R)):it(R)?(t.consume(R),W):(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 it(R)?wt(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 qh={name:"labelEnd",resolveAll:YT,resolveTo:FT,tokenize:GT},HT={tokenize:$T},IT={tokenize:XT},VT={tokenize:QT};function YT(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&&hi(t,0,t.length,r),t}function FT(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=ri(c,t.slice(o+1,o+a+3)),c=ri(c,[["enter",y,i]]),c=ri(c,Qu(i.parser.constructs.insideSpan.null,t.slice(o+a+4,u-3),i)),c=ri(c,[["exit",y,i],t[u-2],t[u-1],["exit",p,i]]),c=ri(c,t.slice(u+1)),c=ri(c,[["exit",h,i]]),hi(t,o,t.length,c),t}function GT(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(mi(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(HT,v,c?v:g)(w):w===91?t.attempt(IT,v,c?y:g)(w):c?v(w):g(w)}function y(w){return t.attempt(VT,v,g)(w)}function v(w){return o.pop(),i(w)}function g(w){return u._balanced=!0,r(w)}}function $T(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)?_s(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)?_s(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)?_s(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 XT(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(mi(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?i(h):r(h)}function c(h){return r(h)}}function QT(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 ZT={name:"labelStartImage",resolveAll:qh.resolveAll,tokenize:KT};function KT(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 JT={name:"labelStartLink",resolveAll:qh.resolveAll,tokenize:PT};function PT(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 Dd={name:"lineEnding",tokenize:WT};function WT(t,i){return r;function r(a){return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),wt(t,i,"linePrefix")}}const Au={name:"thematicBreak",tokenize:eN};function eN(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"),it(y)?wt(t,h,"whitespace")(y):h(y))}}const An={continuation:{tokenize:rN},exit:aN,name:"list",tokenize:iN},tN={partial:!0,tokenize:sN},nN={partial:!0,tokenize:lN};function iN(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:lh(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(Au,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 lh(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(Vs,a.interrupt?r:v,t.attempt(tN,w,g))}function v(x){return a.containerState.initialBlankLine=!0,u++,w(x)}function g(x){return it(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 rN(t,i,r){const a=this;return a.containerState._closeFlow=void 0,t.check(Vs,o,u);function o(h){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,wt(t,i,"listItemIndent",a.containerState.size+1)(h)}function u(h){return a.containerState.furtherBlankLines||!it(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(nN,i,c)(h))}function c(h){return a.containerState._closeFlow=!0,a.interrupt=void 0,wt(t,t.attempt(An,i,r),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function lN(t,i,r){const a=this;return wt(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 aN(t){t.exit(this.containerState.type)}function sN(t,i,r){const a=this;return wt(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!it(u)&&c&&c[1].type==="listItemPrefixWhitespace"?i(u):r(u)}}const Dv={name:"setextUnderline",resolveTo:oN,tokenize:uN};function oN(t,i){const r=new zu;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 uN(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"),it(y)?wt(t,p,"lineSuffix")(y):p(y))}function p(y){return y===null||He(y)?(t.exit("setextHeadingLine"),i(y)):r(y)}}const cN={tokenize:fN};function fN(t){const i=this,r=t.attempt(Vs,a,t.attempt(this.parser.constructs.flowInitial,o,wt(t,t.attempt(this.parser.constructs.flow,o,t.attempt(bT,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 dN={resolveAll:e0()},hN=Wx("string"),mN=Wx("text");function Wx(t){return{resolveAll:e0(t==="text"?pN: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 pN(t,i){const r=new zu;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 yN={42:An,43:An,45:An,48:An,49:An,50:An,51:An,52:An,53:An,54:An,55:An,56:An,57:An,62:Gx},gN={91:ET},vN={[-2]:qd,[-1]:qd,32:qd},bN={35:RT,42:Au,45:[Dv,Au],60:zT,61:Dv,95:Au,96:qv,126:qv},xN={38:Xx,92:$x},wN={[-5]:Dd,[-4]:Dd,[-3]:Dd,33:ZT,38:Xx,42:ah,60:[eT,BT],91:JT,92:[CT,$x],93:qh,95:ah,96:hT},SN={null:[ah,dN]},kN={null:[42,95]},EN={null:[]},jN=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:kN,contentInitial:gN,disable:EN,document:yN,flow:bN,flowInitial:vN,insideSpan:SN,string:xN,text:wN},Symbol.toStringTag,{value:"Module"}));function TN(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:F(ie),check:F(A),consume:M,enter:L,exit:P,interrupt:F(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=ri(c,V),C(),c[c.length-1]!==null?[]:(X(i,0),y.events=Qu(u,y.events,y),y.events)}function w(V,W){return CN(x(V),W)}function x(V){return NN(c,V)}function S(){const{_bufferIndex:V,_index:W,line:ke,column:oe,offset:ge}=a;return{_bufferIndex:V,_index:W,line:ke,column:oe,offset:ge}}function T(V){o[V.line]=V.column,O()}function C(){for(;a._index<c.length;){const V=c[a._index];if(typeof V=="string"){const W=a._index;for(a._bufferIndex<0&&(a._bufferIndex=0);a._index===W&&a._bufferIndex<V.length;)k(V.charCodeAt(a._bufferIndex))}else k(V)}}function k(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 L(V,W){const ke=W||{};return ke.type=V,ke.start=S(),y.events.push(["enter",ke,y]),h.push(ke),ke}function P(V){const W=h.pop();return W.end=S(),y.events.push(["exit",W,y]),W}function ie(V,W){X(V,W.from)}function A(V,W){W.restore()}function F(V,W){return ke;function ke(oe,ge,re){let ce,xe,Te,R;return Array.isArray(oe)?Ie(oe):"tokenize"in oe?Ie([oe]):Ze(oe);function Ze(ue){return ve;function ve(ze){const ye=ze!==null&&ue[ze],be=ze!==null&&ue.null,K=[...Array.isArray(ye)?ye:ye?[ye]:[],...Array.isArray(be)?be:be?[be]:[]];return Ie(K)(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)?ee():ue.tokenize.call(W?Object.assign(Object.create(y),W):y,p,z,ee)(ze)}}function z(ue){return V(Te,R),ge}function ee(ue){return R.restore(),++xe<ce.length?q(ce[xe]):re}}}function X(V,W){V.resolveAll&&!u.includes(V)&&u.push(V),V.resolve&&hi(y.events,W,y.events.length-W,V.resolve(y.events.slice(W),y)),V.resolveTo&&(y.events=V.resolveTo(y.events,y))}function le(){const V=S(),W=y.previous,ke=y.currentConstruct,oe=y.events.length,ge=Array.from(h);return{from:oe,restore:re};function re(){a=V,y.previous=W,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 NN(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 CN(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=`
|
|
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 ba(t){return t.startsWith("worker-")&&t.length>7}function EE(t){return ba(t)?t.slice(7):""}function jE(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 TE(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]=CE({cards:o});return r}function NE(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:jE(i),cards:TE(i)}}function CE(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=AE(r,a);return o?[o]:[]}):[]}function AE(t,i="",r=_i){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(UE):[],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 RE(t){const i=t.filter(a=>!SE.has(a.status)),r=t.find(a=>a.status==="delivered");return r?[...i,r]:i}function gx(t){return t.some(i=>kE.has(i.status))}function pv(t,i,r=!1){return r?!1:t&&!gx(i)}const _E=new Set(["accepted","enqueued","started"]);function OE(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:_E.has(o.status)&&(a=!0));return r?"wait":a?"run":null}function _d(t,i=Date.now(),r=_i){const a=t.filter(c=>c.status==="started");if(a.length>1)return r("work.preview.startedMany",{count:String(a.length)});const o=xx(t);if(!o||o.status==="ready")return"";const u=px(o.status,r);if(o.status==="started"){const c=bx(o.startedAt,i);return c?`${u} · ${c}`:u}return u}function zE(t,i=_i){if(t.filter(o=>o.status==="started").length>1)return i("work.placeholder.many");const a=xx(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 ME(t,i,r=_i){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=bx(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=BE(t);return o&&a.push(o),a}function qE(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 vx(t){return t==="foundations_dispatch"||t==="foundations_dispatch_canvas"}function DE(t){if(!vx(t.name)||t.result.trim()==="")return!1;const i=wx(t.result);return i?i.ok===!1&&i.code==="BUDGET":t.result.includes('"BUDGET"')||/concurrency limit/i.test(t.result)}function LE(t,i=_i){const r=wx(t);return r&&typeof r.message=="string"&&r.message!==""?r.message:i("work.budgetFallback")}function bx(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 xx(t){const i=RE(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 BE(t){return t.events.filter(r=>r.kind==="progress"&&r.applyStatus==="applied"&&r.revision===t.revision&&r.text.trim()!=="").at(-1)?.text??""}function UE(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 wx(t){try{const i=JSON.parse(t);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}const HE="modulepreload",IE=function(t){return"/dsh-bot/"+t},yv={},VE=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=IE(y),y in yv)return;yv[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":HE,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,Cs=268,Od=220,gv=400,kx=320,Ex=960,Ms=640;function Ea(t){return Number.isFinite(t)?Math.min(Ex,Math.max(kx,Math.round(t))):Ms}function jx(t){return Math.max(0,(t-Math.min(Sx,t))/2)}function Nu(t){const i=jx(t);return{drawer:0,reserve:0,sidebar:Cs,inset:i,insetRight:i,overlap:!1}}function vv(t,i){const r=Math.min(Ex,Math.max(kx,i)),a=Math.min(Sx,t),o=jx(t),u=Od+gv;if(r<=o)return{drawer:r,reserve:0,sidebar:Cs,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:Od,inset:0,insetRight:0,overlap:!0};const p=Math.max(0,a-h),y=Math.max(0,a-Cs-gv),v=Math.max(0,Cs-Od),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:Cs-x,inset:c,insetRight:0,overlap:!1}}function bv(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 wa=null;function Cu(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 xv(t){if(wa!==t)return;wa=null,document.documentElement.classList.remove("files-push","files-closing","files-resizing"),Cu(Nu(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,xv(w);return}if(a==="out"&&wa!==null&&wa!==w){p.current=!1;return}wa=w;const x=a==="out"?Nu(c):vv(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"),Cu(Nu(c));let S=!1;const T=requestAnimationFrame(()=>{if(S=!0,wa!==w||(g.classList.remove("files-resizing"),!y.current))return;const N=v.current==="out"?Nu(window.innerWidth):vv(window.innerWidth,o);Cu(N)});return()=>{cancelAnimationFrame(T),S||(p.current=!1)}}p.current=!0,Cu(x)},[i,r,a,o,u,c]),E.useEffect(()=>()=>{p.current=!1,xv(h.current)},[])}function nz(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 YE(t){const i=t.split(".").pop()?.toLowerCase()??"";return i==="md"||i==="markdown"}function FE(t,i){const r={};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const GE=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$E=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XE={};function wv(t,i){return(XE.jsx?$E:GE).test(t)}const QE=/[ \t\n\f\r]/g;function ZE(t){return typeof t=="object"?t.type==="text"?Sv(t.value):!1:Sv(t)}function Sv(t){return t.replace(QE,"")===""}class Hs{constructor(i,r,a){this.normal=r,this.property=i,a&&(this.space=a)}}Hs.prototype.normal={};Hs.prototype.property={};Hs.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 Hs(r,a,i)}function nh(t){return t.toLowerCase()}class On{constructor(i,r){this.attribute=r,this.property=i}}On.prototype.attribute="";On.prototype.booleanish=!1;On.prototype.boolean=!1;On.prototype.commaOrSpaceSeparated=!1;On.prototype.commaSeparated=!1;On.prototype.defined=!1;On.prototype.mustUseProperty=!1;On.prototype.number=!1;On.prototype.overloadedBoolean=!1;On.prototype.property="";On.prototype.spaceSeparated=!1;On.prototype.space=void 0;let KE=0;const $e=kl(),tn=kl(),ih=kl(),fe=kl(),Dt=kl(),bl=kl(),In=kl();function kl(){return 2**++KE}const rh=Object.freeze(Object.defineProperty({__proto__:null,boolean:$e,booleanish:tn,commaOrSpaceSeparated:In,commaSeparated:bl,number:fe,overloadedBoolean:ih,spaceSeparated:Dt},Symbol.toStringTag,{value:"Module"})),zd=Object.keys(rh);class Ah extends On{constructor(i,r,a,o){let u=-1;if(super(i,r),kv(this,"space",o),typeof a=="number")for(;++u<zd.length;){const c=zd[u];kv(this,zd[u],(a&rh[c])===rh[c])}}}Ah.prototype.defined=!0;function kv(t,i,r){r&&(t[i]=r)}function Na(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 Hs(i,r,t.space)}const Cx=Na({properties:{ariaActiveDescendant:null,ariaAtomic:tn,ariaAutoComplete:null,ariaBusy:tn,ariaChecked:tn,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:Dt,ariaCurrent:null,ariaDescribedBy:Dt,ariaDetails:null,ariaDisabled:tn,ariaDropEffect:Dt,ariaErrorMessage:null,ariaExpanded:tn,ariaFlowTo:Dt,ariaGrabbed:tn,ariaHasPopup:null,ariaHidden:tn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Dt,ariaLevel:fe,ariaLive:null,ariaModal:tn,ariaMultiLine:tn,ariaMultiSelectable:tn,ariaOrientation:null,ariaOwns:Dt,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:tn,ariaReadOnly:tn,ariaRelevant:null,ariaRequired:tn,ariaRoleDescription:Dt,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:tn,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 JE=Na({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:bl,acceptCharset:Dt,accessKey:Dt,action:null,allow:null,allowFullScreen:$e,allowPaymentRequest:$e,allowUserMedia:$e,alpha:$e,alt:null,as:null,async:$e,autoCapitalize:null,autoComplete:Dt,autoFocus:$e,autoPlay:$e,blocking:Dt,capture:null,charSet:null,checked:$e,cite:null,className:Dt,closedBy:null,colorSpace:null,cols:fe,colSpan:fe,command:null,commandFor:null,content:null,contentEditable:tn,controls:$e,controlsList:Dt,coords:fe|bl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$e,defer:$e,dir:null,dirName:null,disabled:$e,download:ih,draggable:tn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$e,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:$e,inputMode:null,integrity:null,is:null,isMap:$e,itemId:null,itemProp:Dt,itemRef:Dt,itemScope:$e,itemType:Dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$e,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:$e,muted:$e,name:null,nonce:null,noModule:$e,noValidate:$e,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:$e,optimum:fe,pattern:null,ping:Dt,placeholder:null,playsInline:$e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$e,referrerPolicy:null,rel:Dt,required:$e,reversed:$e,rows:fe,rowSpan:fe,sandbox:Dt,scope:null,scoped:$e,seamless:$e,selected:$e,shadowRootClonable:$e,shadowRootCustomElementRegistry:$e,shadowRootDelegatesFocus:$e,shadowRootMode:null,shadowRootSerializable:$e,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:tn,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:$e,useMap:null,value:tn,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:$e,declare:$e,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:$e,noHref:$e,noShade:$e,noWrap:$e,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:tn,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:$e,disablePictureInPicture:$e,disableRemotePlayback:$e,exportParts:bl,part:Dt,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:Rx}),PE=Na({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:In,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:$e,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:bl,g2:bl,glyphName:bl,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:In,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:In,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:In,rev:In,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:In,requiredFeatures:In,requiredFonts:In,requiredFormats:In,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:In,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:In,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:In,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=Na({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=Na({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Rx}),zx=Na({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,i){return"xml:"+i.slice(3).toLowerCase()}}),WE={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"},ej=/[A-Z]/g,Ev=/-[a-z]/g,tj=/^data[-\w.:]+$/i;function nj(t,i){const r=nh(i);let a=i,o=On;if(r in t.normal)return t.property[t.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&tj.test(i)){if(i.charAt(4)==="-"){const u=i.slice(5).replace(Ev,rj);a="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=i.slice(4);if(!Ev.test(u)){let c=u.replace(ej,ij);c.charAt(0)!=="-"&&(c="-"+c),i="data"+c}}o=Ah}return new o(a,i)}function ij(t){return"-"+t.toLowerCase()}function rj(t){return t.charAt(1).toUpperCase()}const lj=Nx([Cx,JE,_x,Ox,zx],"html"),Rh=Nx([Cx,PE,_x,Ox,zx],"svg");function aj(t){return t.join(" ").trim()}var jv=/\/\*(?:[^*]|\*(?!\/))*\*\//g,sj=/\n/g,oj=/^\s*/,uj=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,cj=/^:\s*/,fj=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,dj=/^[;\s]*/,hj=`
|
|
21
|
+
`,Tv="/",Nv="*",Es="",mj="comment",pj="declaration";function yj(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(sj);T&&(r+=T.length);var N=S.lastIndexOf(hj);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(oj)}function v(S){for(var T;T=g();)S.push(T);return S}function g(){var S=u();if(!(Tv!=t.charAt(0)||Nv!=t.charAt(1))){for(var T=2;Es!=t.charAt(T)&&(Nv!=t.charAt(T)||Tv!=t.charAt(T+1));)++T;if(T+=2,Es===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:mj,comment:N})}}function w(){var S=u(),T=p(uj);if(T){if(g(),!p(cj))return h("property missing ':'");var N=p(fj),j=S({type:pj,property:T[0].replace(jv,Es).trim(),value:N?N[0].replace(jv,Es).trim():Es});return p(dj),j}}function x(){var S=[];v(S);for(var T;T=w();)S.push(T),v(S);return S}return y(),x()}function gj(t,i){let r=null;if(!t||typeof t!="string")return r;const a=yj(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 vj(t){const i=_h(t),r=Mx(t);if(i&&r)return{start:i,end:r}}function Rs(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Cv(t.position):"start"in t||"end"in t?Cv(t):"line"in t||"column"in t?lh(t):""}function lh(t){return Av(t&&t.line)+":"+Av(t&&t.column)}function Cv(t){return lh(t&&t.start)+"-"+lh(t&&t.end)}function Av(t){return t&&typeof t=="number"?t:1}class $u 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=Rs(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($u.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,bj=new Map,xj=/[A-Z]/g,wj=/-([a-z])/g,Sj=new Set(["table","tbody","thead","tfoot","tr"]),kj=new Set(["td","th"]),Dx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ej(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=Oj(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=_j(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:lj,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 jj(t,i,r);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return Tj(t,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return Cj(t,i,r);if(i.type==="mdxjsEsm")return Nj(t,i);if(i.type==="root")return Aj(t,i,r);if(i.type==="text")return Rj(t,i)}function jj(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=zj(t,i);let h=Mh(t,i);return Sj.has(i.tagName)&&(h=h.filter(function(p){return typeof p=="string"?!ZE(p):!0})),Bx(t,c,u,i),zh(c,h),t.ancestors.pop(),t.schema=a,t.create(i,u,c,r)}function Tj(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)}qs(t,i.position)}function Nj(t,i){if(i.data&&i.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(i.data.estree);qs(t,i.position)}function Cj(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=Mj(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 Aj(t,i,r){const a={};return zh(a,Mh(t,i)),t.create(i,t.Fragment,a,r)}function Rj(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 _j(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 Oj(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 zj(t,i){const r={};let a,o;for(o in i.properties)if(o!=="children"&&Oh.call(i.properties,o)){const u=qj(t,o,i.properties[o]);if(u){const[c,h]=u;t.tableCellAlignToStyle&&c==="align"&&typeof h=="string"&&kj.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 Mj(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 qs(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 qs(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:bj;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 qj(t,i,r){if(r==null||typeof r=="number"&&Number.isNaN(r))return;const a=nj(t.schema,i);return Array.isArray(r)&&(r=a.commaSeparated?FE(r):aj(r)),a.property==="style"?["style",typeof r=="object"?t.stylePropertyNameCase==="dom"?r:Lj(r):Dj(t,String(r))]:[t.elementAttributeNameCase==="react"&&a.space?WE[a.property]||a.property:a.attribute,r]}function Dj(t,i){const r={};try{gj(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(wj,Hj))),r[u]=o}})}catch(a){if(t.ignoreInvalidStyle)return{};const o=a,u=new $u("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=wv(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=wv(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);qs(t)}function qs(t,i){const r=new $u("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 Lj(t){const i={};let r;for(r in t)Oh.call(t,r)&&(i[Bj(r)]=t[r]);return i}function Bj(t){if(t.slice(0,2)==="--")return t;let i=t.replace(xj,Uj);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function Uj(t){return"-"+t.toLowerCase()}function Hj(t,i){return i.toUpperCase()}const Md={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"]},Ij={};function Xu(t,i){const r=Ij,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(Vj(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 Rv(t.children,i,r)}return Array.isArray(t)?Rv(t,i,r):""}function Rv(t,i,r){const a=[];let o=-1;for(;++o<t.length;)a[o]=Hx(t[o],i,r);return a.join("")}function Vj(t){return!!(t&&typeof t=="object")}const _v=document.createElement("i");function qh(t){const i="&"+t+";";_v.innerHTML=i;const r=_v.textContent;return r.charCodeAt(r.length-1)===59&&t!=="semi"||r===i?!1:r}function hi(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 ri(t,i){return t.length>0?(hi(t,t.length,0,i),t):i}const Ov={}.hasOwnProperty;function Ix(t){const i={};let r=-1;for(;++r<t.length;)Yj(i,t[r]);return i}function Yj(t,i){let r;for(r in i){const o=(Ov.call(t,r)?t[r]:void 0)||(t[r]={}),u=i[r];let c;if(u)for(c in u){Ov.call(o,c)||(o[c]=[]);const h=u[c];Fj(o[c],Array.isArray(h)?h:h?[h]:[])}}}function Fj(t,i){let r=-1;const a=[];for(;++r<i.length;)(i[r].add==="after"?t:a).push(i[r]);hi(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 mi(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pn=Ur(/[A-Za-z]/),yn=Ur(/[\dA-Za-z]/),Gj=Ur(/[#-'*+\--9=?A-Z^-~]/);function Ou(t){return t!==null&&(t<32||t===127)}const ah=Ur(/\d/),$j=Ur(/[\dA-Fa-f]/),Yx=Ur(/[!-/:-@[-`{-~]/);function He(t){return t!==null&&t<-2}function Lt(t){return t!==null&&(t<0||t===32)}function it(t){return t===-2||t===-1||t===32}const Is=Ur(new RegExp("\\p{P}|\\p{S}","u")),xl=Ur(/\s/);function Ur(t){return i;function i(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function Ca(t){const i=[];let r=-1,a=0,o=0;for(;++r<t.length;){const u=t.charCodeAt(r);let c="";if(u===37&&yn(t.charCodeAt(r+1))&&yn(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 wt(t,i,r,a){const o=a?a-1:1/0;let u=0;return c;function c(p){return it(p)?(t.enter(r),h(p)):i(p)}function h(p){return it(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 it(v)?(t.enter(a),p(v)):y(v)}function p(v){return it(v)&&c<u?(t.consume(v),c++,p):(t.exit(a),y(v))}function y(v){return c>=o?i(v):r(v)}}const Xj={tokenize:Qj};function Qj(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"),wt(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 zu=class{constructor(){this.index=new Map,this.map=[]}add(i,r,a){zv(this,i,r,a,!1)}addBefore(i,r,a){zv(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 zv(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 Zj={tokenize:Kj},Mv={tokenize:Jj};function Kj(t){const i=this,r=[];let a=0,o,u,c;return h;function h(B){if(a<r.length){const P=r[a];return i.containerState=P[1],t.attempt(P[0].continuation,p,y)(B)}return y(B)}function p(B){if(a++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,o&&q();const P=i.events.length;let ie=P,A;for(;ie--;)if(i.events[ie][0]==="exit"&&i.events[ie][1].type==="chunkFlow"){A=i.events[ie][1].end;break}j(a);let L=P;for(;L<i.events.length;)i.events[L][1].end={...A},L++;const G=new zu;return G.add(ie+1,0,i.events.slice(P)),G.add(P,L-P,[]),G.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(Mv,v,g)(B)}function v(B){return o&&q(),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(Mv,x,S)(B)}function x(B){return a++,r.push([i.currentConstruct,i.containerState]),w(B)}function S(B){if(B===null){o&&q(),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,P){const ie=i.sliceStream(B);if(P&&ie.push(null),B.previous=u,u&&(u.next=B),u=B,o.defineSkip(B.start),o.write(ie),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 L=i.events.length;let G=L,le,O;for(;G--;)if(i.events[G][0]==="exit"&&i.events[G][1].type==="chunkFlow"){if(le){O=i.events[G][1].end;break}le=!0}for(j(a),A=L;A<i.events.length;)i.events[A][1].end={...O},A++;const Y=new zu;Y.add(G+1,0,i.events.slice(L)),Y.add(L,A-L,[]),Y.consume(i.events)}}function j(B){let P=r.length;for(;P-- >B;){const ie=r[P];i.containerState=ie[1],ie[0].exit.call(i,t)}r.length=B}function q(){o.write([null]),u=void 0,o=void 0,i.containerState._closeFlow=void 0}}function Jj(t,i,r){return wt(t,t.attempt(this.parser.constructs.document,i,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Lr(t){if(t===null||Lt(t)||xl(t))return 1;if(Is(t))return 2}function Qu(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:Pj,tokenize:Wj};function Pj(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};qv(c,-u),qv(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=ri(a,[["enter",t[o][1],i],["exit",t[o][1],i]])),a=ri(a,[["enter",g,i],["enter",p,i],["exit",p,i],["enter",v,i]]),a=ri(a,Qu(i.parser.constructs.insideSpan.null,t.slice(o+1,r),i)),a=ri(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=ri(a,[["enter",t[r][1],i],["exit",t[r][1],i]])),hi(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 Wj(t,i){const r=this.parser.constructs.attentionMarkers.null,a=this.previous,o=Lr(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=Lr(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 qv(t,i){t.column+=i,t.offset+=i,t._bufferIndex+=i}const eT={name:"autolink",tokenize:tT};function tT(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 pn(x)?(t.consume(x),c):x===64?r(x):y(x)}function c(x){return x===43||x===45||x===46||yn(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||yn(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||Ou(x)?r(x):(t.consume(x),p)}function y(x){return x===64?(t.consume(x),v):Gj(x)?(t.consume(x),y):r(x)}function v(x){return yn(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||yn(x))&&a++<63){const S=x===45?w:g;return t.consume(x),S}return r(x)}}const Vs={partial:!0,tokenize:nT};function nT(t,i,r){return a;function a(u){return it(u)?wt(t,o,"linePrefix")(u):o(u)}function o(u){return u===null||He(u)?i(u):r(u)}}const Gx={continuation:{tokenize:rT},exit:lT,name:"blockQuote",tokenize:iT};function iT(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 it(c)?(t.enter("blockQuotePrefixWhitespace"),t.consume(c),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),i):(t.exit("blockQuotePrefix"),i(c))}}function rT(t,i,r){const a=this;return o;function o(c){return it(c)?wt(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 lT(t){t.exit("blockQuote")}const $x={name:"characterEscape",tokenize:aT};function aT(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:sT};function sT(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=yn,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=$j,v):(t.enter("characterReferenceValue"),u=7,c=ah,v(g))}function v(g){if(g===59&&o){const w=t.exit("characterReferenceValue");return c===yn&&!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:oT};function oT(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 Dv={concrete:!0,name:"codeFenced",tokenize:uT};function uT(t,i,r){const a=this,o={partial:!0,tokenize:ie};let u=0,c=0,h;return p;function p(A){return y(A)}function y(A){const L=a.events[a.events.length-1];return u=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[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"),it(A)?wt(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,P)(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)):it(A)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),wt(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,P,N)(A)}function N(A){return t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),j}function j(A){return u>0&&it(A)?wt(t,q,"linePrefix",u+1)(A):q(A)}function q(A){return A===null||He(A)?t.check(oh,T,P)(A):(t.enter("codeFlowValue"),B(A))}function B(A){return A===null||He(A)?(t.exit("codeFlowValue"),q(A)):(t.consume(A),B)}function P(A){return t.exit("codeFenced"),i(A)}function ie(A,L,G){let le=0;return O;function O(ge){return A.enter("lineEnding"),A.consume(ge),A.exit("lineEnding"),Y}function Y(ge){return A.enter("codeFencedFence"),it(ge)?wt(A,W,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ge):W(ge)}function W(ge){return ge===h?(A.enter("codeFencedFenceSequence"),ke(ge)):G(ge)}function ke(ge){return ge===h?(le++,A.consume(ge),ke):le>=c?(A.exit("codeFencedFenceSequence"),it(ge)?wt(A,oe,"whitespace")(ge):oe(ge)):G(ge)}function oe(ge){return ge===null||He(ge)?(A.exit("codeFencedFence"),L(ge)):G(ge)}}}const qd={name:"codeIndented",tokenize:fT},cT={partial:!0,tokenize:dT};function fT(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(cT,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 dT(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 hT={name:"codeText",previous:pT,resolve:mT,tokenize:yT};function mT(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 pT(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function yT(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 gT{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&&js(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),js(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),js(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);js(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);js(this.left,r.reverse())}}}function js(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 gT(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,vT(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 hi(t,0,Number.POSITIVE_INFINITY,v.slice(0)),!y}function vT(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]),q=u.pop();p.push([q,q+j.length-1]),t.splice(q,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 bT={resolve:wT,tokenize:ST},xT={partial:!0,tokenize:kT};function wT(t){return Qx(t),t}function ST(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(xT,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 kT(t,i,r){const a=this;return o;function o(c){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),wt(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||Ou(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||Ou(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=!it(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"),wt(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 _s(t,i){let r;return a;function a(o){return He(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r=!0,a):it(o)?wt(t,a,r?"linePrefix":"lineSuffix")(o):i(o)}}const ET={name:"definition",tokenize:TT},jT={partial:!0,tokenize:NT};function TT(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=mi(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)?_s(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(jT,g,g)(x)}function g(x){return it(x)?wt(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 NT(t,i,r){return a;function a(h){return Lt(h)?_s(t,o)(h):r(h)}function o(h){return Jx(t,u,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function u(h){return it(h)?wt(t,c,"whitespace")(h):c(h)}function c(h){return h===null||He(h)?i(h):r(h)}}const CT={name:"hardBreakEscape",tokenize:AT};function AT(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 RT={name:"headingAtx",resolve:_T,tokenize:OT};function _T(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"};hi(t,a,r-a+1,[["enter",o,i],["enter",u,i],["exit",u,i],["exit",o,i]])}return t}function OT(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)):it(v)?wt(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"],zT={concrete:!0,name:"htmlFlow",resolveTo:qT,tokenize:DT},MT={partial:!0,tokenize:LT};function qT(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 DT(t,i,r){const a=this;let o,u,c,h,p;return y;function y(M){return v(M)}function v(M){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(M),g}function g(M){return M===33?(t.consume(M),w):M===47?(t.consume(M),u=!0,T):M===63?(t.consume(M),o=3,a.interrupt?i:R):pn(M)?(t.consume(M),c=String.fromCharCode(M),N):r(M)}function w(M){return M===45?(t.consume(M),o=2,x):M===91?(t.consume(M),o=5,h=0,S):pn(M)?(t.consume(M),o=4,a.interrupt?i:R):r(M)}function x(M){return M===45?(t.consume(M),a.interrupt?i:R):r(M)}function S(M){const z="CDATA[";return M===z.charCodeAt(h++)?(t.consume(M),h===z.length?a.interrupt?i:W:S):r(M)}function T(M){return pn(M)?(t.consume(M),c=String.fromCharCode(M),N):r(M)}function N(M){if(M===null||M===47||M===62||Lt(M)){const z=M===47,ee=c.toLowerCase();return!z&&!u&&uh.includes(ee)?(o=1,a.interrupt?i(M):W(M)):Px.includes(c.toLowerCase())?(o=6,z?(t.consume(M),j):a.interrupt?i(M):W(M)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?r(M):u?q(M):B(M))}return M===45||yn(M)?(t.consume(M),c+=String.fromCharCode(M),N):r(M)}function j(M){return M===62?(t.consume(M),a.interrupt?i:W):r(M)}function q(M){return it(M)?(t.consume(M),q):O(M)}function B(M){return M===47?(t.consume(M),O):M===58||M===95||pn(M)?(t.consume(M),P):it(M)?(t.consume(M),B):O(M)}function P(M){return M===45||M===46||M===58||M===95||yn(M)?(t.consume(M),P):ie(M)}function ie(M){return M===61?(t.consume(M),A):it(M)?(t.consume(M),ie):B(M)}function A(M){return M===null||M===60||M===61||M===62||M===96?r(M):M===34||M===39?(t.consume(M),p=M,L):it(M)?(t.consume(M),A):G(M)}function L(M){return M===p?(t.consume(M),p=null,le):M===null||He(M)?r(M):(t.consume(M),L)}function G(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||Lt(M)?ie(M):(t.consume(M),G)}function le(M){return M===47||M===62||it(M)?B(M):r(M)}function O(M){return M===62?(t.consume(M),Y):r(M)}function Y(M){return M===null||He(M)?W(M):it(M)?(t.consume(M),Y):r(M)}function W(M){return M===45&&o===2?(t.consume(M),re):M===60&&o===1?(t.consume(M),ce):M===62&&o===4?(t.consume(M),Ze):M===63&&o===3?(t.consume(M),R):M===93&&o===5?(t.consume(M),Te):He(M)&&(o===6||o===7)?(t.exit("htmlFlowData"),t.check(MT,Ie,ke)(M)):M===null||He(M)?(t.exit("htmlFlowData"),ke(M)):(t.consume(M),W)}function ke(M){return t.check(oh,oe,Ie)(M)}function oe(M){return t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),ge}function ge(M){return M===null||He(M)?ke(M):(t.enter("htmlFlowData"),W(M))}function re(M){return M===45?(t.consume(M),R):W(M)}function ce(M){return M===47?(t.consume(M),c="",xe):W(M)}function xe(M){if(M===62){const z=c.toLowerCase();return uh.includes(z)?(t.consume(M),Ze):W(M)}return pn(M)&&c.length<8?(t.consume(M),c+=String.fromCharCode(M),xe):W(M)}function Te(M){return M===93?(t.consume(M),R):W(M)}function R(M){return M===62?(t.consume(M),Ze):M===45&&o===2?(t.consume(M),R):W(M)}function Ze(M){return M===null||He(M)?(t.exit("htmlFlowData"),Ie(M)):(t.consume(M),Ze)}function Ie(M){return t.exit("htmlFlow"),i(M)}}function LT(t,i,r){return a;function a(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(Vs,i,r)}}const BT={name:"htmlText",tokenize:UT};function UT(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),ie):R===63?(t.consume(R),B):pn(R)?(t.consume(R),G):r(R)}function y(R){return R===45?(t.consume(R),v):R===91?(t.consume(R),u=0,S):pn(R)?(t.consume(R),q):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 Ze="CDATA[";return R===Ze.charCodeAt(u++)?(t.consume(R),u===Ze.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 q(R){return R===null||R===62?re(R):He(R)?(c=q,ce(R)):(t.consume(R),q)}function B(R){return R===null?r(R):R===63?(t.consume(R),P):He(R)?(c=B,ce(R)):(t.consume(R),B)}function P(R){return R===62?re(R):B(R)}function ie(R){return pn(R)?(t.consume(R),A):r(R)}function A(R){return R===45||yn(R)?(t.consume(R),A):L(R)}function L(R){return He(R)?(c=L,ce(R)):it(R)?(t.consume(R),L):re(R)}function G(R){return R===45||yn(R)?(t.consume(R),G):R===47||R===62||Lt(R)?le(R):r(R)}function le(R){return R===47?(t.consume(R),re):R===58||R===95||pn(R)?(t.consume(R),O):He(R)?(c=le,ce(R)):it(R)?(t.consume(R),le):re(R)}function O(R){return R===45||R===46||R===58||R===95||yn(R)?(t.consume(R),O):Y(R)}function Y(R){return R===61?(t.consume(R),W):He(R)?(c=Y,ce(R)):it(R)?(t.consume(R),Y):le(R)}function W(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=W,ce(R)):it(R)?(t.consume(R),W):(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 it(R)?wt(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:YT,resolveTo:FT,tokenize:GT},HT={tokenize:$T},IT={tokenize:XT},VT={tokenize:QT};function YT(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&&hi(t,0,t.length,r),t}function FT(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=ri(c,t.slice(o+1,o+a+3)),c=ri(c,[["enter",y,i]]),c=ri(c,Qu(i.parser.constructs.insideSpan.null,t.slice(o+a+4,u-3),i)),c=ri(c,[["exit",y,i],t[u-2],t[u-1],["exit",p,i]]),c=ri(c,t.slice(u+1)),c=ri(c,[["exit",h,i]]),hi(t,o,t.length,c),t}function GT(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(mi(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(HT,v,c?v:g)(w):w===91?t.attempt(IT,v,c?y:g)(w):c?v(w):g(w)}function y(w){return t.attempt(VT,v,g)(w)}function v(w){return o.pop(),i(w)}function g(w){return u._balanced=!0,r(w)}}function $T(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)?_s(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)?_s(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)?_s(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 XT(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(mi(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?i(h):r(h)}function c(h){return r(h)}}function QT(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 ZT={name:"labelStartImage",resolveAll:Dh.resolveAll,tokenize:KT};function KT(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 JT={name:"labelStartLink",resolveAll:Dh.resolveAll,tokenize:PT};function PT(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 Dd={name:"lineEnding",tokenize:WT};function WT(t,i){return r;function r(a){return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),wt(t,i,"linePrefix")}}const Au={name:"thematicBreak",tokenize:eN};function eN(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"),it(y)?wt(t,h,"whitespace")(y):h(y))}}const An={continuation:{tokenize:rN},exit:aN,name:"list",tokenize:iN},tN={partial:!0,tokenize:sN},nN={partial:!0,tokenize:lN};function iN(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(Au,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(Vs,a.interrupt?r:v,t.attempt(tN,w,g))}function v(x){return a.containerState.initialBlankLine=!0,u++,w(x)}function g(x){return it(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 rN(t,i,r){const a=this;return a.containerState._closeFlow=void 0,t.check(Vs,o,u);function o(h){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,wt(t,i,"listItemIndent",a.containerState.size+1)(h)}function u(h){return a.containerState.furtherBlankLines||!it(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(nN,i,c)(h))}function c(h){return a.containerState._closeFlow=!0,a.interrupt=void 0,wt(t,t.attempt(An,i,r),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function lN(t,i,r){const a=this;return wt(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 aN(t){t.exit(this.containerState.type)}function sN(t,i,r){const a=this;return wt(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!it(u)&&c&&c[1].type==="listItemPrefixWhitespace"?i(u):r(u)}}const Lv={name:"setextUnderline",resolveTo:oN,tokenize:uN};function oN(t,i){const r=new zu;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 uN(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"),it(y)?wt(t,p,"lineSuffix")(y):p(y))}function p(y){return y===null||He(y)?(t.exit("setextHeadingLine"),i(y)):r(y)}}const cN={tokenize:fN};function fN(t){const i=this,r=t.attempt(Vs,a,t.attempt(this.parser.constructs.flowInitial,o,wt(t,t.attempt(this.parser.constructs.flow,o,t.attempt(bT,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 dN={resolveAll:e0()},hN=Wx("string"),mN=Wx("text");function Wx(t){return{resolveAll:e0(t==="text"?pN: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 pN(t,i){const r=new zu;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 yN={42:An,43:An,45:An,48:An,49:An,50:An,51:An,52:An,53:An,54:An,55:An,56:An,57:An,62:Gx},gN={91:ET},vN={[-2]:qd,[-1]:qd,32:qd},bN={35:RT,42:Au,45:[Lv,Au],60:zT,61:Lv,95:Au,96:Dv,126:Dv},xN={38:Xx,92:$x},wN={[-5]:Dd,[-4]:Dd,[-3]:Dd,33:ZT,38:Xx,42:sh,60:[eT,BT],91:JT,92:[CT,$x],93:Dh,95:sh,96:hT},SN={null:[sh,dN]},kN={null:[42,95]},EN={null:[]},jN=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:kN,contentInitial:gN,disable:EN,document:yN,flow:bN,flowInitial:vN,insideSpan:SN,string:xN,text:wN},Symbol.toStringTag,{value:"Module"}));function TN(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:L(ie),check:L(A),consume:q,enter:B,exit:P,interrupt:L(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(Y){return c=ri(c,Y),N(),c[c.length-1]!==null?[]:(G(i,0),y.events=Qu(u,y.events,y),y.events)}function w(Y,W){return CN(x(Y),W)}function x(Y){return NN(c,Y)}function S(){const{_bufferIndex:Y,_index:W,line:ke,column:oe,offset:ge}=a;return{_bufferIndex:Y,_index:W,line:ke,column:oe,offset:ge}}function T(Y){o[Y.line]=Y.column,O()}function N(){for(;a._index<c.length;){const Y=c[a._index];if(typeof Y=="string"){const W=a._index;for(a._bufferIndex<0&&(a._bufferIndex=0);a._index===W&&a._bufferIndex<Y.length;)j(Y.charCodeAt(a._bufferIndex))}else j(Y)}}function j(Y){v=v(Y)}function q(Y){He(Y)?(a.line++,a.column=1,a.offset+=Y===-3?2:1,O()):Y!==-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=Y}function B(Y,W){const ke=W||{};return ke.type=Y,ke.start=S(),y.events.push(["enter",ke,y]),h.push(ke),ke}function P(Y){const W=h.pop();return W.end=S(),y.events.push(["exit",W,y]),W}function ie(Y,W){G(Y,W.from)}function A(Y,W){W.restore()}function L(Y,W){return ke;function ke(oe,ge,re){let ce,xe,Te,R;return Array.isArray(oe)?Ie(oe):"tokenize"in oe?Ie([oe]):Ze(oe);function Ze(ue){return ve;function ve(ze){const ye=ze!==null&&ue[ze],be=ze!==null&&ue.null,K=[...Array.isArray(ye)?ye:ye?[ye]:[],...Array.isArray(be)?be:be?[be]:[]];return Ie(K)(ze)}}function Ie(ue){return ce=ue,xe=0,ue.length===0?re:M(ue[xe])}function M(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)?ee():ue.tokenize.call(W?Object.assign(Object.create(y),W):y,p,z,ee)(ze)}}function z(ue){return Y(Te,R),ge}function ee(ue){return R.restore(),++xe<ce.length?M(ce[xe]):re}}}function G(Y,W){Y.resolveAll&&!u.includes(Y)&&u.push(Y),Y.resolve&&hi(y.events,W,y.events.length-W,Y.resolve(y.events.slice(W),y)),Y.resolveTo&&(y.events=Y.resolveTo(y.events,y))}function le(){const Y=S(),W=y.previous,ke=y.currentConstruct,oe=y.events.length,ge=Array.from(h);return{from:oe,restore:re};function re(){a=Y,y.previous=W,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 NN(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 CN(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
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 AN(t){const a={constructs:Ix([jN,...(t||{}).extensions||[]]),content:o(Xj),defined:[],document:o(Zj),flow:o(cN),lazy:{},string:o(hN),text:o(mN)};return a;function o(u){return c;function c(h){return TN(a,u,h)}}}function RN(t){for(;!Qx(t););return t}const Lv=/[\0\t\n\r]/g;function _N(){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;){Lv.lastIndex=y;const v=Lv.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 ON=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function zN(t){return t.replace(ON,MN)}function MN(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 Mh(r)||t}const t0={}.hasOwnProperty;function qN(t,i,r){return i&&typeof i=="object"&&(r=i,i=void 0),DN(r)(RN(AN(r).document().write(_N()(t,i,!0))))}function DN(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(K),characterEscape:O,characterReference:O,codeFenced:c(de),codeFencedFenceInfo:h,codeFencedFenceMeta:h,codeIndented:c(de,h),codeText:c(et,h),codeTextData:O,data:O,codeFlowValue:O,definition:c(mt),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(rt,w),listUnordered:c(rt),paragraph:c(Be),reference:z,referenceString:h,resourceDestinationString:h,resourceTitleString:h,setextHeading:c(De),strong:c(ft),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(k),codeFencedFence:C,codeFencedFenceInfo:S,codeFencedFenceMeta:T,codeFlowValue:V,codeIndented:y(M),codeText:y(re),codeTextData:V,data:V,definition:y(),definitionDestinationString:ie,definitionLabelString:L,definitionTitleString:P,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:W,link:y(ce),listItem:y(),listOrdered:y(),listUnordered:y(),paragraph:y(),referenceString:ee,resourceDestinationString:Ze,resourceTitleString:Ie,resource:q,setextHeading:y(le),setextHeadingLineSequence:X,setextHeadingText:F,strong:y(),thematicBreak:y()}};n0(i,(t||{}).mdastExtensions||[]);const r={};return a;function a(Q){let se={type:"root",children:[],position:void 0};const Oe={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,{...Oe,sliceSerialize:Q[pe][2].sliceSerialize},Q[pe][1]),t0.call(Le,Q[pe][1].type)&&Le[Q[pe][1].type].call({...Oe,sliceSerialize:Q[pe][2].sliceSerialize},Q[pe][1]),Q[pe][0]==="exit"&&i.afterExit.length>0&&o(i.afterExit,{...Oe,sliceSerialize:Q[pe][2].sliceSerialize},Q[pe][1])}if(Oe.tokenStack.length>0){const Le=Oe.tokenStack[Oe.tokenStack.length-1];(Le[1]||Bv).call(Oe,void 0,Le[0])}for(se.position={start:Dr(Q.length>0?Q[0][1].start:{line:1,column:1,offset:0}),end:Dr(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,Oe){let Ne=-1;for(;++Ne<Q.length;)Q[Ne].call(se,Oe)}function u(Q,se){const Oe=Q.length-1;let Ne=se-1,we=-1,pe=!1,Le,Ke,st,bt;const vt=[];for(;++Ne<=Oe;){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&&!st&&(st=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 pt=Ne;for(Ke=void 0;pt--;){const Ft=Q[pt];if(Ft[1].type==="lineEnding"||Ft[1].type==="lineEndingBlank"){if(Ft[0]==="exit")continue;Ke&&(Q[Ke][1].type="lineEndingBlank",pe=!0),Ft[1].type="lineEnding",Ke=pt}else if(!(Ft[1].type==="linePrefix"||Ft[1].type==="blockQuotePrefix"||Ft[1].type==="blockQuotePrefixWhitespace"||Ft[1].type==="blockQuoteMarker"||Ft[1].type==="listItemIndent"))break}st&&(!Ke||st<Ke)&&(Le._spread=!0),Le.end=Object.assign({},Ke?Q[Ke][1].start:Ct[1].end),vt.push({at:Ke||Ne,event:["exit",Le,Ct[2]]})}if(Ct[1].type==="listItemPrefix"){const pt={type:"listItem",_spread:!1,start:Object.assign({},Ct[1].start),end:void 0};Le=pt,vt.push({at:Ne,event:["enter",pt,Ct[2]]}),st=void 0,bt=!0}}}const xn=Q.splice(se);let Nt=0;for(Ne=-1;++Ne<xn.length;){for(;Nt<vt.length&&vt[Nt].at===se+Ne;)Q.push(vt[Nt++].event);Q.push(xn[Ne])}Q[se][1]._spread=pe}function c(Q,se){return Oe;function Oe(Ne){p.call(this,Q(Ne),Ne),se&&se.call(this,Ne)}}function h(){this.stack.push({type:"fragment",children:[]})}function p(Q,se,Oe){this.stack[this.stack.length-1].children.push(Q),this.stack.push(Q),this.tokenStack.push([se,Oe||void 0]),Q.position={start:Dr(se.start),end:void 0}}function y(Q){return se;function se(Oe){Q&&Q.call(this,Oe),v.call(this,Oe)}}function v(Q,se){const Oe=this.stack.pop(),Ne=this.tokenStack.pop();if(!Ne)throw new Error("Cannot close `"+Q.type+"` ("+Rs({start:Q.start,end:Q.end})+"): it’s not open");Ne[0].type!==Q.type&&(se?se.call(this,Q,Ne[0]):(Ne[1]||Bv).call(this,Q,Ne[0])),Oe.position.end=Dr(Q.end)}function g(){return Xu(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 C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){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 L(Q){const se=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=se,Oe.identifier=mi(this.sliceSerialize(Q)).toLowerCase()}function P(){const Q=this.resume(),se=this.stack[this.stack.length-1];se.title=Q}function ie(){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 Oe=this.sliceSerialize(Q).length;se.depth=Oe}}function F(){this.data.setextHeadingSlurpLineEnding=!0}function X(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 Oe=this.stack[this.stack.length-1].children;let Ne=Oe[Oe.length-1];(!Ne||Ne.type!=="text")&&(Ne=Qt(),Ne.position={start:Dr(Q.start),end:void 0},Oe.push(Ne)),this.stack.push(Ne)}function V(Q){const se=this.stack.pop();se.value+=this.sliceSerialize(Q),se.position.end=Dr(Q.end)}function W(Q){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=se.children[se.children.length-1];Oe.position.end=Dr(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),Oe=this.stack[this.stack.length-2];Oe.label=zN(se),Oe.identifier=mi(se).toLowerCase()}function R(){const Q=this.stack[this.stack.length-1],se=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const Ne=Q.children;Oe.children=Ne}else Oe.alt=se}function Ze(){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 ee(Q){const se=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=se,Oe.identifier=mi(this.sliceSerialize(Q)).toLowerCase(),this.data.referenceType="full"}function ue(Q){this.data.characterReferenceType=Q.type}function ve(Q){const se=this.sliceSerialize(Q),Oe=this.data.characterReferenceType;let Ne;Oe?(Ne=Vx(se,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ne=Mh(se);const we=this.stack[this.stack.length-1];we.value+=Ne}function ze(Q){const se=this.stack.pop();se.position.end=Dr(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 K(){return{type:"blockquote",children:[],position:void 0}}function de(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function et(){return{type:"inlineCode",value:"",position:void 0}}function mt(){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 rt(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 ft(){return{type:"strong",children:[],position:void 0}}function Qt(){return{type:"text",value:"",position:void 0}}function Bt(){return{type:"thematicBreak",position:void 0}}}function Dr(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):LN(t,a)}}function LN(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 Bv(t,i){throw t?new Error("Cannot close `"+t.type+"` ("+Rs({start:t.start,end:t.end})+"): a different token (`"+i.type+"`, "+Rs({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Rs({start:i.start,end:i.end})+") is still open")}function BN(t){const i=this;i.parser=r;function r(a){return qN(a,{...i.data("settings"),...t,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function UN(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 HN(t,i){const r={type:"element",tagName:"br",properties:{},children:[]};return t.patch(i,r),[t.applyData(i,r),{type:"text",value:`
|
|
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 AN(t){const a={constructs:Ix([jN,...(t||{}).extensions||[]]),content:o(Xj),defined:[],document:o(Zj),flow:o(cN),lazy:{},string:o(hN),text:o(mN)};return a;function o(u){return c;function c(h){return TN(a,u,h)}}}function RN(t){for(;!Qx(t););return t}const Bv=/[\0\t\n\r]/g;function _N(){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;){Bv.lastIndex=y;const v=Bv.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 ON=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function zN(t){return t.replace(ON,MN)}function MN(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 qN(t,i,r){return i&&typeof i=="object"&&(r=i,i=void 0),DN(r)(RN(AN(r).document().write(_N()(t,i,!0))))}function DN(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(K),characterEscape:O,characterReference:O,codeFenced:c(de),codeFencedFenceInfo:h,codeFencedFenceMeta:h,codeIndented:c(de,h),codeText:c(tt,h),codeTextData:O,data:O,codeFlowValue:O,definition:c(mt),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(rt,w),listUnordered:c(rt),paragraph:c(Be),reference:z,referenceString:h,resourceDestinationString:h,resourceTitleString:h,setextHeading:c(De),strong:c(ft),thematicBreak:c(Bt)},exit:{atxHeading:y(),atxHeadingSequence:A,autolink:y(),autolinkEmail:be,autolinkProtocol:ye,blockQuote:y(),characterEscapeValue:Y,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:ve,characterReference:ze,codeFenced:y(j),codeFencedFence:N,codeFencedFenceInfo:S,codeFencedFenceMeta:T,codeFlowValue:Y,codeIndented:y(q),codeText:y(re),codeTextData:Y,data:Y,definition:y(),definitionDestinationString:ie,definitionLabelString:B,definitionTitleString:P,emphasis:y(),hardBreakEscape:y(ke),hardBreakTrailing:y(ke),htmlFlow:y(oe),htmlFlowData:Y,htmlText:y(ge),htmlTextData:Y,image:y(xe),label:R,labelText:Te,lineEnding:W,link:y(ce),listItem:y(),listOrdered:y(),listUnordered:y(),paragraph:y(),referenceString:ee,resourceDestinationString:Ze,resourceTitleString:Ie,resource:M,setextHeading:y(le),setextHeadingLineSequence:G,setextHeadingText:L,strong:y(),thematicBreak:y()}};n0(i,(t||{}).mdastExtensions||[]);const r={};return a;function a(Q){let se={type:"root",children:[],position:void 0};const Oe={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,{...Oe,sliceSerialize:Q[pe][2].sliceSerialize},Q[pe][1]),t0.call(Le,Q[pe][1].type)&&Le[Q[pe][1].type].call({...Oe,sliceSerialize:Q[pe][2].sliceSerialize},Q[pe][1]),Q[pe][0]==="exit"&&i.afterExit.length>0&&o(i.afterExit,{...Oe,sliceSerialize:Q[pe][2].sliceSerialize},Q[pe][1])}if(Oe.tokenStack.length>0){const Le=Oe.tokenStack[Oe.tokenStack.length-1];(Le[1]||Uv).call(Oe,void 0,Le[0])}for(se.position={start:Dr(Q.length>0?Q[0][1].start:{line:1,column:1,offset:0}),end:Dr(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,Oe){let Ne=-1;for(;++Ne<Q.length;)Q[Ne].call(se,Oe)}function u(Q,se){const Oe=Q.length-1;let Ne=se-1,we=-1,pe=!1,Le,Ke,st,bt;const vt=[];for(;++Ne<=Oe;){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&&!st&&(st=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 pt=Ne;for(Ke=void 0;pt--;){const Ft=Q[pt];if(Ft[1].type==="lineEnding"||Ft[1].type==="lineEndingBlank"){if(Ft[0]==="exit")continue;Ke&&(Q[Ke][1].type="lineEndingBlank",pe=!0),Ft[1].type="lineEnding",Ke=pt}else if(!(Ft[1].type==="linePrefix"||Ft[1].type==="blockQuotePrefix"||Ft[1].type==="blockQuotePrefixWhitespace"||Ft[1].type==="blockQuoteMarker"||Ft[1].type==="listItemIndent"))break}st&&(!Ke||st<Ke)&&(Le._spread=!0),Le.end=Object.assign({},Ke?Q[Ke][1].start:Ct[1].end),vt.push({at:Ke||Ne,event:["exit",Le,Ct[2]]})}if(Ct[1].type==="listItemPrefix"){const pt={type:"listItem",_spread:!1,start:Object.assign({},Ct[1].start),end:void 0};Le=pt,vt.push({at:Ne,event:["enter",pt,Ct[2]]}),st=void 0,bt=!0}}}const xn=Q.splice(se);let Nt=0;for(Ne=-1;++Ne<xn.length;){for(;Nt<vt.length&&vt[Nt].at===se+Ne;)Q.push(vt[Nt++].event);Q.push(xn[Ne])}Q[se][1]._spread=pe}function c(Q,se){return Oe;function Oe(Ne){p.call(this,Q(Ne),Ne),se&&se.call(this,Ne)}}function h(){this.stack.push({type:"fragment",children:[]})}function p(Q,se,Oe){this.stack[this.stack.length-1].children.push(Q),this.stack.push(Q),this.tokenStack.push([se,Oe||void 0]),Q.position={start:Dr(se.start),end:void 0}}function y(Q){return se;function se(Oe){Q&&Q.call(this,Oe),v.call(this,Oe)}}function v(Q,se){const Oe=this.stack.pop(),Ne=this.tokenStack.pop();if(!Ne)throw new Error("Cannot close `"+Q.type+"` ("+Rs({start:Q.start,end:Q.end})+"): it’s not open");Ne[0].type!==Q.type&&(se?se.call(this,Q,Ne[0]):(Ne[1]||Uv).call(this,Q,Ne[0])),Oe.position.end=Dr(Q.end)}function g(){return Xu(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 q(){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(),Oe=this.stack[this.stack.length-1];Oe.label=se,Oe.identifier=mi(this.sliceSerialize(Q)).toLowerCase()}function P(){const Q=this.resume(),se=this.stack[this.stack.length-1];se.title=Q}function ie(){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 Oe=this.sliceSerialize(Q).length;se.depth=Oe}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function G(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 Oe=this.stack[this.stack.length-1].children;let Ne=Oe[Oe.length-1];(!Ne||Ne.type!=="text")&&(Ne=Qt(),Ne.position={start:Dr(Q.start),end:void 0},Oe.push(Ne)),this.stack.push(Ne)}function Y(Q){const se=this.stack.pop();se.value+=this.sliceSerialize(Q),se.position.end=Dr(Q.end)}function W(Q){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=se.children[se.children.length-1];Oe.position.end=Dr(Q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(se.type)&&(O.call(this,Q),Y.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),Oe=this.stack[this.stack.length-2];Oe.label=zN(se),Oe.identifier=mi(se).toLowerCase()}function R(){const Q=this.stack[this.stack.length-1],se=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const Ne=Q.children;Oe.children=Ne}else Oe.alt=se}function Ze(){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 M(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function ee(Q){const se=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=se,Oe.identifier=mi(this.sliceSerialize(Q)).toLowerCase(),this.data.referenceType="full"}function ue(Q){this.data.characterReferenceType=Q.type}function ve(Q){const se=this.sliceSerialize(Q),Oe=this.data.characterReferenceType;let Ne;Oe?(Ne=Vx(se,Oe==="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=Dr(Q.end)}function ye(Q){Y.call(this,Q);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(Q)}function be(Q){Y.call(this,Q);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(Q)}function K(){return{type:"blockquote",children:[],position:void 0}}function de(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function tt(){return{type:"inlineCode",value:"",position:void 0}}function mt(){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 rt(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 ft(){return{type:"strong",children:[],position:void 0}}function Qt(){return{type:"text",value:"",position:void 0}}function Bt(){return{type:"thematicBreak",position:void 0}}}function Dr(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):LN(t,a)}}function LN(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 Uv(t,i){throw t?new Error("Cannot close `"+t.type+"` ("+Rs({start:t.start,end:t.end})+"): a different token (`"+i.type+"`, "+Rs({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Rs({start:i.start,end:i.end})+") is still open")}function BN(t){const i=this;i.parser=r;function r(a){return qN(a,{...i.data("settings"),...t,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function UN(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 HN(t,i){const r={type:"element",tagName:"br",properties:{},children:[]};return t.patch(i,r),[t.applyData(i,r),{type:"text",value:`
|
|
24
24
|
`}]}function IN(t,i){const r=i.value?i.value+`
|
|
25
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 VN(t,i){const r={type:"element",tagName:"del",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function YN(t,i){const r={type:"element",tagName:"em",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function FN(t,i){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",a=String(i.identifier).toUpperCase(),o=Ca(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 GN(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 $N(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 XN(t,i){const r=String(i.identifier).toUpperCase(),a=t.definitionById.get(r);if(!a)return i0(t,i);const o={src:Ca(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 QN(t,i){const r={src:Ca(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 ZN(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 KN(t,i){const r=String(i.identifier).toUpperCase(),a=t.definitionById.get(r);if(!a)return i0(t,i);const o={href:Ca(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 JN(t,i){const r={href:Ca(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 PN(t,i,r){const a=t.all(i),o=r?WN(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
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 WN(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 eC(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 tC(t,i){const r={type:"element",tagName:"p",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function nC(t,i){const r={type:"root",children:t.wrap(t.all(i))};return t.patch(i,r),t.applyData(i,r)}function iC(t,i){const r={type:"element",tagName:"strong",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function rC(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=
|
|
27
|
+
`});const y={type:"element",tagName:"li",properties:u,children:c};return t.patch(i,y),t.applyData(i,y)}function WN(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 eC(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 tC(t,i){const r={type:"element",tagName:"p",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function nC(t,i){const r={type:"root",children:t.wrap(t.all(i))};return t.patch(i,r),t.applyData(i,r)}function iC(t,i){const r={type:"element",tagName:"strong",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}function rC(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 lC(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 aC(t,i){const r={type:"element",tagName:"td",properties:{},children:t.all(i)};return t.patch(i,r),t.applyData(i,r)}const Hv=9,Iv=32;function sC(t){const i=String(t),r=/\r?\n|\r/g;let a=r.exec(i),o=0;const u=[];for(;a;)u.push(Vv(i.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=r.exec(i);return u.push(Vv(i.slice(o),o>0,!1)),u.join("")}function Vv(t,i,r){let a=0,o=t.length;if(i){let u=t.codePointAt(a);for(;u===Hv||u===Iv;)a++,u=t.codePointAt(a)}if(r){let u=t.codePointAt(o-1);for(;u===Hv||u===Iv;)o--,u=t.codePointAt(o-1)}return o>a?t.slice(a,o):""}function oC(t,i){const r={type:"text",value:sC(String(i.value))};return t.patch(i,r),t.applyData(i,r)}function uC(t,i){const r={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(i,r),t.applyData(i,r)}const cC={blockquote:UN,break:HN,code:IN,delete:VN,emphasis:YN,footnoteReference:FN,heading:GN,html:$N,imageReference:XN,image:QN,inlineCode:ZN,linkReference:KN,link:JN,listItem:PN,list:eC,paragraph:tC,root:nC,strong:iC,table:rC,tableCell:aC,tableRow:lC,text:oC,thematicBreak:uC,toml:bu,yaml:bu,definition:bu,footnoteDefinition:bu};function bu(){}const l0=-1,Zu=0,Os=1,Mu=2,Lh=3,Bh=4,Uh=5,Hh=6,a0=7,s0=8,{defineProperty:fC}=Object,o0=typeof self=="object"?self:globalThis,Yv=(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)},dC=(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 Zu:case l0:return r(c,o);case Os:{const h=r([],o);for(const p of c)h.push(a(p));return h}case Mu:{const h=r({},o);for(const[p,y]of c){const v=a(p),g=a(y);v==="__proto__"?fC(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"?Yv(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(Yv(u,c),o)};return a},Fv=t=>dC(new Map,t)(0),gl="",{toString:hC}={},{keys:mC,is:pC}=Object,Ts=t=>{const i=typeof t;if(i!=="object"||!t)return[Zu,i];const r=hC.call(t).slice(8,-1);switch(r){case"Array":return[Os,gl];case"Object":return[Mu,gl];case"Date":return[Lh,gl];case"RegExp":return[Bh,gl];case"Map":return[Uh,gl];case"Set":return[Hh,gl];case"DataView":return[Os,r]}return r.includes("Array")?[Os,r]:t instanceof Error?[a0,t.name||"Error"]:[Mu,r]},xu=([t,i])=>t===Zu&&(i==="function"||i==="symbol"),yC=(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]=Ts(c);switch(h){case Zu:{let v=c;switch(p){case"bigint":h=s0,v=c.toString();break;case"number":if(!c&&pC(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 Os:{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 Mu:{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 mC(c))(t||!xu(Ts(c[w])))&&v.push([u(w),u(c[w])]);return g}case Lh:return o([h,isNaN(c.getTime())?gl: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||!(xu(Ts(w))||xu(Ts(x))))&&v.push([u(w),u(x)]);return g}case Hh:{const v=[],g=o([h,v],c);for(const w of c)(t||!xu(Ts(w)))&&v.push(u(w));return g}}const{message:y}=c;return o([h,{name:p,message:y}],c)};return u},Gv=(t,{json:i,lossy:r}={})=>{const a=[];return yC(!(i||r),!!i,new Map,a)(t),a},qu=typeof structuredClone=="function"?(t,i)=>i&&("json"in i||"lossy"in i)?Fv(Gv(t,i)):structuredClone(t):(t,i)=>Fv(Gv(t,i));function gC(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 vC(t,i){return"Back to reference "+(t+1)+(i>1?"-"+i:"")}function bC(t){const i=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=t.options.footnoteBackContent||gC,a=t.options.footnoteBackLabel||vC,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=Ca(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 q=typeof r=="string"?r:r(p,x);typeof q=="string"&&(q={type:"text",value:q}),S.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+w+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(p,x),className:["data-footnote-backref"]},children:Array.isArray(q)?q:[q]})}const N=v[v.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const q=N.children[N.children.length-1];q&&q.type==="text"?q.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:{...qu(c),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
28
28
|
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(h,!0)},{type:"text",value:`
|
|
29
|
-
`}]}}const Ku=(function(t){if(t==null)return kC;if(typeof t=="function")return Ju(t);if(typeof t=="object")return Array.isArray(t)?xC(t):wC(t);if(typeof t=="string")return SC(t);throw new Error("Expected function, string, or object as test")});function xC(t){const i=[];let r=-1;for(;++r<t.length;)i[r]=Ku(t[r]);return Ju(a);function a(...o){let u=-1;for(;++u<i.length;)if(i[u].apply(this,o))return!0;return!1}}function wC(t){const i=t;return Ju(r);function r(a){const o=a;let u;for(u in t)if(o[u]!==i[u])return!1;return!0}}function SC(t){return Ju(i);function i(r){return r&&r.type===t}}function Ju(t){return i;function i(r,a,o){return!!(EC(r)&&t.call(this,r,typeof a=="number"?a:void 0,o||void 0))}}function kC(){return!0}function EC(t){return t!==null&&typeof t=="object"&&"type"in t}const u0=[],jC=!0,zs=!1,
|
|
29
|
+
`}]}}const Ku=(function(t){if(t==null)return kC;if(typeof t=="function")return Ju(t);if(typeof t=="object")return Array.isArray(t)?xC(t):wC(t);if(typeof t=="string")return SC(t);throw new Error("Expected function, string, or object as test")});function xC(t){const i=[];let r=-1;for(;++r<t.length;)i[r]=Ku(t[r]);return Ju(a);function a(...o){let u=-1;for(;++u<i.length;)if(i[u].apply(this,o))return!0;return!1}}function wC(t){const i=t;return Ju(r);function r(a){const o=a;let u;for(u in t)if(o[u]!==i[u])return!1;return!0}}function SC(t){return Ju(i);function i(r){return r&&r.type===t}}function Ju(t){return i;function i(r,a,o){return!!(EC(r)&&t.call(this,r,typeof a=="number"?a:void 0,o||void 0))}}function kC(){return!0}function EC(t){return t!==null&&typeof t=="object"&&"type"in t}const u0=[],jC=!0,zs=!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=Ku(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 q=u0;if(h&&j&&(q=$v(h(w,S,x)),q[0]===zs))return q;if("children"in w&&w.children){const B=w;if(B.children&&q[0]!==ch){let P=(o?-1:B.children.length)+v;const ie=[...S,B];for(;P>-1&&P<B.children.length;){const A=B.children[P],L=g(A,P,ie)();if(L[0]===zs)return L;P=typeof L[1]=="number"?L[1]:P+v}}}if(p&&j){const B=$v(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]===zs||typeof B[1]=="number")return B}return q}}}function $v(t){return Array.isArray(t)?t:typeof t=="number"?[jC,t]:t==null?u0:[t]}function Pu(t,i,r,a){let o,u,c;u=i,c=r,typeof u=="function"?fh(t,o,dh(u),c):fh(t,o,TC(u),c)}function TC(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,NC={};function CC(t,i){const r=i||NC,a=new Map,o=new Map,u=new Map,c={...cC,...r.handlers},h={all:y,applyData:RC,definitionById:a,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:c,one:p,options:r,patch:AC,wrap:OC};return Pu(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=qu(N);return j.children=h.all(v),j}return qu(v)}return(h.options.unknownHandler||_C)(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=Xv(S.value)),!Array.isArray(S)&&S.type==="element")){const T=S.children[0];T&&T.type==="text"&&(T.value=Xv(T.value))}Array.isArray(S)?g.push(...S):g.push(S)}}}return g}}function AC(t,i){t.position&&(i.position=vj(t))}function RC(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,qu(u)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function _C(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 OC(t,i){const r=[];let a=-1;for(i&&r.push({type:"text",value:`
|
|
30
30
|
`});++a<t.length;)a&&r.push({type:"text",value:`
|
|
31
31
|
`}),r.push(t[a]);return i&&t.length>0&&r.push({type:"text",value:`
|
|
32
|
-
`}),r}function
|
|
33
|
-
`},o),u}function zC(t,i){return t&&"run"in t?async function(r,a){const o=Xv(r,{file:a,...i});await t.run(o,a)}:function(r,a){return Xv(r,{file:a,...t||i})}}function Qv(t){if(t)throw t}var Ld,Zv;function MC(){if(Zv)return Ld;Zv=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 Ld=function p(){var y,v,g,w,x,S,T=arguments[0],C=1,k=arguments.length,M=!1;for(typeof T=="boolean"&&(M=T,T=arguments[1]||{},C=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});C<k;++C)if(y=arguments[C],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},Ld}var qC=MC();const Bd=$b(qC);function hh(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 DC(){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?LC(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 LC(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 Ai={basename:BC,dirname:UC,extname:HC,join:IC,sep:"/"};function BC(t,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');Ys(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 UC(t){if(Ys(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 HC(t){Ys(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 IC(...t){let i=-1,r;for(;++i<t.length;)Ys(t[i]),t[i]&&(r=r===void 0?t[i]:r+"/"+t[i]);return r===void 0?".":VC(r)}function VC(t){Ys(t);const i=t.codePointAt(0)===47;let r=YC(t,!i);return r.length===0&&!i&&(r="."),r.length>0&&t.codePointAt(t.length-1)===47&&(r+="/"),i?"/"+r:r}function YC(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 Ys(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const FC={cwd:GC};function GC(){return"/"}function mh(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function $C(t){if(typeof t=="string")t=new URL(t);else if(!mh(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 XC(t)}function XC(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 Ud=["history","path","basename","stem","extname","dirname"];class c0{constructor(i){let r;i?mh(i)?r={path:i}:typeof i=="string"||QC(i)?r={value:i}:r=i:r={},this.cwd="cwd"in r?"":FC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Ud.length;){const u=Ud[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)Ud.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?Ai.basename(this.path):void 0}set basename(i){Id(i,"basename"),Hd(i,"basename"),this.path=Ai.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Ai.dirname(this.path):void 0}set dirname(i){Kv(this.basename,"dirname"),this.path=Ai.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Ai.extname(this.path):void 0}set extname(i){if(Hd(i,"extname"),Kv(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=Ai.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){mh(i)&&(i=$C(i)),Id(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Ai.basename(this.path,this.extname):void 0}set stem(i){Id(i,"stem"),Hd(i,"stem"),this.path=Ai.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 $u(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 Hd(t,i){if(t&&t.includes(Ai.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Ai.sep+"`")}function Id(t,i){if(!t)throw new Error("`"+i+"` cannot be empty")}function Kv(t,i){if(!t)throw new Error("Setting `"+i+"` requires `path` to be set too")}function QC(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const ZC=(function(t){const a=this.constructor.prototype,o=a[t],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,a),u}),KC={}.hasOwnProperty;class Hh extends ZC{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=DC()}copy(){const i=new Hh;let r=-1;for(;++r<this.attachers.length;){const a=this.attachers[r];i.use(...a)}return i.data(Bd(!0,{},this.namespace)),i}data(i,r){return typeof i=="string"?arguments.length===2?(Fd("data",this.frozen),this.namespace[i]=r,this):KC.call(this.namespace,i)&&this.namespace[i]||void 0:i?(Fd("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=wu(i),a=this.parser||this.Parser;return Vd("parse",a),a(String(r),r)}process(i,r){const a=this;return this.freeze(),Vd("process",this.parser||this.Parser),Yd("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(u,c){const h=wu(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);WC(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(),Vd("processSync",this.parser||this.Parser),Yd("processSync",this.compiler||this.Compiler),this.process(i,o),Pv("processSync","process",r),a;function o(u,c){r=!0,Qv(u),a=c}}run(i,r,a){Jv(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=wu(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),Pv("runSync","run",a),o;function u(c,h){Qv(c),o=h,a=!0}}stringify(i,r){this.freeze();const a=wu(r),o=this.compiler||this.Compiler;return Yd("stringify",o),Jv(i),o(i,a)}use(i,...r){const a=this.attachers,o=this.namespace;if(Fd("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=Bd(!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];hh(T)&&hh(x)&&(x=Bd(!0,T,x)),a[w]=[y,x,...S]}}}}const JC=new Hh().freeze();function Vd(t,i){if(typeof i!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Yd(t,i){if(typeof i!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Fd(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 Jv(t){if(!hh(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Pv(t,i,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+i+"` instead")}function wu(t){return PC(t)?t:new c0(t)}function PC(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function WC(t){return typeof t=="string"||eA(t)}function eA(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const tA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Wv=[],eb={allowDangerousHtml:!0},nA=/^(https?|ircs?|mailto|xmpp)$/i,iA=[{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 rA(t){const i=lA(t),r=aA(t);return sA(i.runSync(i.parse(r),r),t)}function lA(t){const i=t.rehypePlugins||Wv,r=t.remarkPlugins||Wv,a=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...eb}:eb;return JC().use(BN).use(r).use(zC,a).use(i)}function aA(t){const i=t.children||"",r=new c0;return typeof i=="string"&&(r.value=i),r}function sA(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 iA)Object.hasOwn(i,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+tA+v.id,void 0);return Pu(t,y),Ej(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 Md)if(Object.hasOwn(Md,x)&&Object.hasOwn(v.properties,x)){const S=v.properties[x],T=Md[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||nA.test(t.slice(0,i))?t:""}function tb(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 oA(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function uA(t,i,r){const o=Ku((r||{}).ignore||[]),u=cA(i);let c=-1;for(;++c<u.length;)ch(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 uh}function p(y,v,g){const w=v[v.length-1],x=u[c][0],S=u[c][1];let T=0,C=!1,k=[];x.lastIndex=0;let M=x.exec(y.value);for(;M;){const P=M.index,ie={index:M.index,input:M.input,stack:[...v,y]};let A=S(...M,ie);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1)x.lastIndex=P+1;else{if(T!==P&&L({type:"text",value:y.value.slice(T,P)}),Array.isArray(A))for(const F of A)L(F);else A&&L(A);T=P+M[0].length,C=!0}if(!x.global)break;M=x.exec(y.value)}return C?(T<y.value.length&&L({type:"text",value:y.value.slice(T)}),w.children.splice(g,1,...k)):k=[y],g+k.length;function L(P){const ie=k[k.length-1];ie&&ie.type==="text"&&P.type==="text"?ie.value+=P.value:k.push(P)}}}function cA(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([fA(o[0]),dA(o[1])])}return i}function fA(t){return typeof t=="string"?new RegExp(oA(t),"g"):t}function dA(t){return typeof t=="function"?t:function(){return t}}const Gd="phrasing",$d=["autolink","link","image","label"];function hA(){return{transforms:[xA],enter:{literalAutolink:pA,literalAutolinkEmail:Xd,literalAutolinkHttp:Xd,literalAutolinkWww:Xd},exit:{literalAutolink:bA,literalAutolinkEmail:vA,literalAutolinkHttp:yA,literalAutolinkWww:gA}}}function mA(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Gd,notInConstruct:$d},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Gd,notInConstruct:$d},{character:":",before:"[ps]",after:"\\/",inConstruct:Gd,notInConstruct:$d}]}}function pA(t){this.enter({type:"link",title:null,url:"",children:[],position:void 0},t)}function Xd(t){this.config.enter.autolinkProtocol.call(this,t)}function yA(t){this.config.exit.autolinkProtocol.call(this,t)}function gA(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 vA(t){this.config.exit.autolinkEmail.call(this,t)}function bA(t){this.exit(t)}function xA(t){uA(t,[[new RegExp("(?<![\\da-z])(https?:\\/\\/|www(?=\\.))([\\w-]*\\.[\\w\\-.]*)([^\\t\\n\\r ]*)","gi"),wA],[new RegExp("(?<![\\w+\\-.@])xmpp:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)(\\/(?:[\\w\\-/]|\\.(?=[\\dA-Za-z]))*)?","g"),EA],[new RegExp("(?<![\\w+\\-.@])mailto:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),kA],[new RegExp("(?<![\\w+\\-.]|(?:^|[^\\d@A-Za-z])(?:mailto|xmpp):)([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),SA]],{ignore:["link","linkReference"]})}function wA(t,i,r,a,o){if(!NA(o))return!1;let u="";if(/^w/i.test(i)&&(r=i+r,i="",u="http://"),Is(r.charCodeAt(0))||!jA(r))return!1;const c=TA(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 SA(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 kA(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 EA(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 jA(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 TA(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=tb(t,"(");let u=tb(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 NA(t){const i=t.input.charCodeAt(t.index-1);return t.index===0||xl(i)||Is(i)}d0.peek=DA;function CA(){this.buffer()}function AA(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function RA(){this.buffer()}function _A(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function OA(t){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=mi(this.sliceSerialize(t)).toLowerCase(),r.label=i}function zA(t){this.exit(t)}function MA(t){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=mi(this.sliceSerialize(t)).toLowerCase(),r.label=i}function qA(t){this.exit(t)}function DA(){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 LA(){return{enter:{gfmFootnoteCallString:CA,gfmFootnoteCall:AA,gfmFootnoteDefinitionLabelString:RA,gfmFootnoteDefinition:_A},exit:{gfmFootnoteCallString:OA,gfmFootnoteCall:zA,gfmFootnoteDefinitionLabelString:MA,gfmFootnoteDefinition:qA}}}function BA(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:UA))),y(),p}}function UA(t,i,r){return i===0?t:h0(t,i,r)}function h0(t,i,r){return(r?"":" ")+t}const HA=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];
|
|
35
|
-
`)}function ZA(t){return t==null?"":String(t)}function
|
|
32
|
+
`}),r}function Xv(t){let i=0,r=t.charCodeAt(i);for(;r===9||r===32;)i++,r=t.charCodeAt(i);return t.slice(i)}function Qv(t,i){const r=CC(t,i),a=r.one(t,void 0),o=bC(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 zC(t,i){return t&&"run"in t?async function(r,a){const o=Qv(r,{file:a,...i});await t.run(o,a)}:function(r,a){return Qv(r,{file:a,...t||i})}}function Zv(t){if(t)throw t}var Ld,Kv;function MC(){if(Kv)return Ld;Kv=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 Ld=function p(){var y,v,g,w,x,S,T=arguments[0],N=1,j=arguments.length,q=!1;for(typeof T=="boolean"&&(q=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&&(q&&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(q,S,w)})):typeof w<"u"&&c(T,{name:v,newValue:w}));return T},Ld}var qC=MC();const Bd=$b(qC);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 DC(){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?LC(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 LC(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 Ai={basename:BC,dirname:UC,extname:HC,join:IC,sep:"/"};function BC(t,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');Ys(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 UC(t){if(Ys(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 HC(t){Ys(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 IC(...t){let i=-1,r;for(;++i<t.length;)Ys(t[i]),t[i]&&(r=r===void 0?t[i]:r+"/"+t[i]);return r===void 0?".":VC(r)}function VC(t){Ys(t);const i=t.codePointAt(0)===47;let r=YC(t,!i);return r.length===0&&!i&&(r="."),r.length>0&&t.codePointAt(t.length-1)===47&&(r+="/"),i?"/"+r:r}function YC(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 Ys(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const FC={cwd:GC};function GC(){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 $C(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 XC(t)}function XC(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 Ud=["history","path","basename","stem","extname","dirname"];class c0{constructor(i){let r;i?ph(i)?r={path:i}:typeof i=="string"||QC(i)?r={value:i}:r=i:r={},this.cwd="cwd"in r?"":FC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Ud.length;){const u=Ud[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)Ud.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?Ai.basename(this.path):void 0}set basename(i){Id(i,"basename"),Hd(i,"basename"),this.path=Ai.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Ai.dirname(this.path):void 0}set dirname(i){Jv(this.basename,"dirname"),this.path=Ai.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Ai.extname(this.path):void 0}set extname(i){if(Hd(i,"extname"),Jv(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=Ai.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){ph(i)&&(i=$C(i)),Id(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Ai.basename(this.path,this.extname):void 0}set stem(i){Id(i,"stem"),Hd(i,"stem"),this.path=Ai.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 $u(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 Hd(t,i){if(t&&t.includes(Ai.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Ai.sep+"`")}function Id(t,i){if(!t)throw new Error("`"+i+"` cannot be empty")}function Jv(t,i){if(!t)throw new Error("Setting `"+i+"` requires `path` to be set too")}function QC(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const ZC=(function(t){const a=this.constructor.prototype,o=a[t],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,a),u}),KC={}.hasOwnProperty;class Ih extends ZC{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=DC()}copy(){const i=new Ih;let r=-1;for(;++r<this.attachers.length;){const a=this.attachers[r];i.use(...a)}return i.data(Bd(!0,{},this.namespace)),i}data(i,r){return typeof i=="string"?arguments.length===2?(Fd("data",this.frozen),this.namespace[i]=r,this):KC.call(this.namespace,i)&&this.namespace[i]||void 0:i?(Fd("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=wu(i),a=this.parser||this.Parser;return Vd("parse",a),a(String(r),r)}process(i,r){const a=this;return this.freeze(),Vd("process",this.parser||this.Parser),Yd("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(u,c){const h=wu(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);WC(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(),Vd("processSync",this.parser||this.Parser),Yd("processSync",this.compiler||this.Compiler),this.process(i,o),Wv("processSync","process",r),a;function o(u,c){r=!0,Zv(u),a=c}}run(i,r,a){Pv(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=wu(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),Wv("runSync","run",a),o;function u(c,h){Zv(c),o=h,a=!0}}stringify(i,r){this.freeze();const a=wu(r),o=this.compiler||this.Compiler;return Yd("stringify",o),Pv(i),o(i,a)}use(i,...r){const a=this.attachers,o=this.namespace;if(Fd("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=Bd(!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=Bd(!0,T,x)),a[w]=[y,x,...S]}}}}const JC=new Ih().freeze();function Vd(t,i){if(typeof i!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Yd(t,i){if(typeof i!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Fd(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 Pv(t){if(!mh(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Wv(t,i,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+i+"` instead")}function wu(t){return PC(t)?t:new c0(t)}function PC(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function WC(t){return typeof t=="string"||eA(t)}function eA(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const tA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",eb=[],tb={allowDangerousHtml:!0},nA=/^(https?|ircs?|mailto|xmpp)$/i,iA=[{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 rA(t){const i=lA(t),r=aA(t);return sA(i.runSync(i.parse(r),r),t)}function lA(t){const i=t.rehypePlugins||eb,r=t.remarkPlugins||eb,a=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...tb}:tb;return JC().use(BN).use(r).use(zC,a).use(i)}function aA(t){const i=t.children||"",r=new c0;return typeof i=="string"&&(r.value=i),r}function sA(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 iA)Object.hasOwn(i,v.from)&&(""+v.from+(v.to?"use `"+v.to+"` instead":"remove it")+tA+v.id,void 0);return Pu(t,y),Ej(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 Md)if(Object.hasOwn(Md,x)&&Object.hasOwn(v.properties,x)){const S=v.properties[x],T=Md[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||nA.test(t.slice(0,i))?t:""}function nb(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 oA(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function uA(t,i,r){const o=Ku((r||{}).ignore||[]),u=cA(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 q=x.exec(y.value);for(;q;){const P=q.index,ie={index:q.index,input:q.input,stack:[...v,y]};let A=S(...q,ie);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1)x.lastIndex=P+1;else{if(T!==P&&B({type:"text",value:y.value.slice(T,P)}),Array.isArray(A))for(const L of A)B(L);else A&&B(A);T=P+q[0].length,N=!0}if(!x.global)break;q=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(P){const ie=j[j.length-1];ie&&ie.type==="text"&&P.type==="text"?ie.value+=P.value:j.push(P)}}}function cA(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([fA(o[0]),dA(o[1])])}return i}function fA(t){return typeof t=="string"?new RegExp(oA(t),"g"):t}function dA(t){return typeof t=="function"?t:function(){return t}}const Gd="phrasing",$d=["autolink","link","image","label"];function hA(){return{transforms:[xA],enter:{literalAutolink:pA,literalAutolinkEmail:Xd,literalAutolinkHttp:Xd,literalAutolinkWww:Xd},exit:{literalAutolink:bA,literalAutolinkEmail:vA,literalAutolinkHttp:yA,literalAutolinkWww:gA}}}function mA(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Gd,notInConstruct:$d},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Gd,notInConstruct:$d},{character:":",before:"[ps]",after:"\\/",inConstruct:Gd,notInConstruct:$d}]}}function pA(t){this.enter({type:"link",title:null,url:"",children:[],position:void 0},t)}function Xd(t){this.config.enter.autolinkProtocol.call(this,t)}function yA(t){this.config.exit.autolinkProtocol.call(this,t)}function gA(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 vA(t){this.config.exit.autolinkEmail.call(this,t)}function bA(t){this.exit(t)}function xA(t){uA(t,[[new RegExp("(?<![\\da-z])(https?:\\/\\/|www(?=\\.))([\\w-]*\\.[\\w\\-.]*)([^\\t\\n\\r ]*)","gi"),wA],[new RegExp("(?<![\\w+\\-.@])xmpp:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)(\\/(?:[\\w\\-/]|\\.(?=[\\dA-Za-z]))*)?","g"),EA],[new RegExp("(?<![\\w+\\-.@])mailto:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),kA],[new RegExp("(?<![\\w+\\-.]|(?:^|[^\\d@A-Za-z])(?:mailto|xmpp):)([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),SA]],{ignore:["link","linkReference"]})}function wA(t,i,r,a,o){if(!NA(o))return!1;let u="";if(/^w/i.test(i)&&(r=i+r,i="",u="http://"),Is(r.charCodeAt(0))||!jA(r))return!1;const c=TA(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 SA(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 kA(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 EA(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 jA(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 TA(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=nb(t,"(");let u=nb(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 NA(t){const i=t.input.charCodeAt(t.index-1);return t.index===0||xl(i)||Is(i)}d0.peek=DA;function CA(){this.buffer()}function AA(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function RA(){this.buffer()}function _A(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function OA(t){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=mi(this.sliceSerialize(t)).toLowerCase(),r.label=i}function zA(t){this.exit(t)}function MA(t){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=mi(this.sliceSerialize(t)).toLowerCase(),r.label=i}function qA(t){this.exit(t)}function DA(){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 LA(){return{enter:{gfmFootnoteCallString:CA,gfmFootnoteCall:AA,gfmFootnoteDefinitionLabelString:RA,gfmFootnoteDefinition:_A},exit:{gfmFootnoteCallString:OA,gfmFootnoteCall:zA,gfmFootnoteDefinitionLabelString:MA,gfmFootnoteDefinition:qA}}}function BA(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:UA))),y(),p}}function UA(t,i,r){return i===0?t:h0(t,i,r)}function h0(t,i,r){return(r?"":" ")+t}const HA=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Vh.attention=GA;Vh.peek=$A;function IA(){return{canContainEols:["delete"],enter:{strikethrough:YA},exit:{strikethrough:FA}}}function VA(){return{handlers:{delete:Vh},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:HA}]}}function YA(t){this.enter({type:"delete",children:[],position:void 0},t)}function FA(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 GA(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function $A(){return"~"}function XA(t){return t.length}function QA(t,i){const r=i||{},a=(r.align||[]).concat(),o=r.stringLength||XA,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 q=ZA(t[v][j]);if(r.alignDelimiters!==!1){const B=o(q);N[j]=B,(p[j]===void 0||B>p[j])&&(p[j]=B)}T.push(q)}c[v]=T,h[v]=N}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<y;)u[g]=ib(a[g]);else{const T=ib(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 q=r.alignDelimiters===!1?1:Math.max(1,p[g]-N.length-j.length);const B=N+"-".repeat(q)+j;r.alignDelimiters!==!1&&(q=N.length+q+j.length,q>p[g]&&(p[g]=q),x[g]=q),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 q=[];for(;++g<j;){const B=T[g]||"";let P="",ie="";if(r.alignDelimiters!==!1){const A=p[g]-(N[g]||0),L=u[g];if(L===114)P=" ".repeat(A);else if(L===99){const G=A/2;A%2?(P=" ".repeat(G+.5),ie=" ".repeat(G-.5)):(P=" ".repeat(G),ie=P)}else ie=" ".repeat(A)}r.delimiterStart!==!1&&!g&&q.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&B==="")&&(r.delimiterStart!==!1||g)&&q.push(" "),r.alignDelimiters!==!1&&q.push(P),q.push(B),r.alignDelimiters!==!1&&q.push(ie),r.padding!==!1&&q.push(" "),(r.delimiterEnd!==!1||g!==j-1)&&q.push("|")}S.push(r.delimiterEnd===!1?q.join("").replace(/ +$/,""):q.join(""))}return S.join(`
|
|
35
|
+
`)}function ZA(t){return t==null?"":String(t)}function ib(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 KA=Ku(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function JA(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()),PA);return o(),c}function PA(t,i,r){return">"+(r?"":" ")+t}function WA(t,i){return rb(t,i.inConstruct,!0)&&!rb(t,i.notInConstruct,!1)}function rb(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 lb(t,i,r,a){let o=-1;for(;++o<r.unsafe.length;){const u=r.unsafe[o];if(u.character===`
|
|
36
36
|
`&&!u.before&&!u.after&&WA(r.stack,u))return/[\t ]/.test(a.before)?"":" "}return`\\
|
|
37
37
|
`}function e2(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 t2(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 n2(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 i2(t,i,r,a){const o=n2(r),u=t.value||"";if(t2(t,r)){const g=r.enter("codeIndented"),w=r.indentLines(u,r2);return g(),w}const c=r.createTracker(a),h=o.repeat(Math.max(e2(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
38
|
`,encode:["`"],...c.current()})),g()}return v+=c.move(`
|
|
39
39
|
`),u&&(v+=c.move(u+`
|
|
40
|
-
`)),v+=c.move(h),p(),v}function r2(t,i,r){return(r?"":" ")+t}function
|
|
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 a2(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 Du(t){const i=t.codePointAt(0);return i===void 0?"":String.fromCodePoint(i)}function ka(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
|
|
42
|
-
`)&&y.type==="html"&&s2(y.value)!==7&&(u[u.length-1]=g.replace(/(\r?\n|\r)$/," "),h=" ",p=i.createTracker(r),p.move(ec(u,r.before,r.after)));const w=i.handle.handlers[y.type];if(w&&w.attention){const x=
|
|
43
|
-
`&&w!=="\r"&&Su(o,!1),
|
|
40
|
+
`)),v+=c.move(h),p(),v}function r2(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 l2(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 a2(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 Du(t){const i=t.codePointAt(0);return i===void 0?"":String.fromCodePoint(i)}function ka(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 ab(t,i,r){const a=Lr(t),o=Lr(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 s2(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:pn(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(!pn(u))return;for(;u===45||yn(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 o2(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=Lr(v.charCodeAt(v.length-1)),w=Lr((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(c2(a,o),c=-1;++c<t.length;){const h=o.get(t[c]);if(h)return{attention:o2(t,h,u),index:c}}}function Su(t,i){const r=t[i?0:t.length-1];if(!r||r.attention)return;const a=i?Du(r.value):ka(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 u2(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=Wu(t,p,a,o),v=y0(y,a,o);if(!v||v.index>r.index)return{chosen:p,mistake:v,tokens:y}}}}function c2(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 f2(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 d2(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?Du(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"&&s2(y.value)!==7&&(u[u.length-1]=g.replace(/(\r?\n|\r)$/," "),h=" ",p=i.createTracker(r),p.move(ec(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=ka(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=ka(x)}}return a.pop(),u}function Fh(t,i,r,a){const{construct:o,markers:u,sizes:c}=i(t,r),h=f2(t.type,u,c),p=h[0],y=r.enter(o),v=r.createTracker(a.current());v.move(p);const g=d2(t,r,{...v.current(),before:p,after:p});if(y(),g.length!==0)return a.move(p),a.move(ec(g,p,p)),a.move(p),{children:g,sequences:h}}function sb(t,i,r,a){let o=Wu(t,i,r,a),u=y0(o,r,a);for(;u;){const c=u2(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 Wu(t,i,r,a){const o=[];let u,c=ka(r),h=-1;for(;++h<t.length;){const p=t[h];if(typeof p=="string"){const B={value:p,attention:void 0};u&&u===Du(p)&&Su([B],!0),u=void 0,o.push(B),B.value&&(c=ka(B.value));continue}const y=i.get(p)||p.sequences[0],v=y.charAt(0),g=t[h+1],w=c,x=Du(g===void 0?a:typeof g=="string"?g:i.get(g)||g.sequences[0]),S=Wu(p.children,i,y,y),T=S[0].value,N=ab(w.charCodeAt(w.length-1),T.charCodeAt(0),v);N.inside&&Su(S,!0);const j=ka(S[S.length-1].value),q=ab(x.charCodeAt(0),j.charCodeAt(j.length-1),v);q.inside&&Su(S,!1),N.outside&&w!==`
|
|
43
|
+
`&&w!=="\r"&&Su(o,!1),q.outside&&(u=x),o.push({value:y,attention:p},...S,{value:y,attention:p}),c=y.charAt(y.length-1)}return o}function ec(t,i,r){const a=new Map;g0(t,a,i,r);const o=(a.size>0?sb(t,a,i,r):void 0)||sb(t,new Map,i,r)||Wu(t,new Map,i,r);let u="";for(const c of o)u+=c.value;return u}Gh.attention=v0;Gh.peek=h2;function Gh(t,i,r,a){const o=r.enter("phrasing"),u=Fh(t,v0,r,r.createTracker(a)),c=u?ec([u],a.before,a.after):"";return o(),c}function v0(t,i){return{construct:"emphasis",markers:a2(i)==="*"?["*","_"]:["_","*"],sizes:[1]}}function h2(t,i,r){return r.options.emphasis||"*"}function m2(t,i){let r=!1;return Pu(t,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return r=!0,zs}),!!((!t.depth||t.depth<3)&&Xu(t)&&(i.options.setext||r))}function p2(t,i,r,a){const o=Math.max(Math.min(6,t.depth||1),1),u=r.createTracker(a);if(m2(t,r)){const g=r.enter("headingSetext"),w=r.enter("phrasing"),x=r.containerPhrasing(t,{...u.current(),before:`
|
|
44
44
|
`,after:`
|
|
45
45
|
`});return w(),g(),x+`
|
|
46
46
|
`+(o===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
47
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=y2;function b0(t){return t.value||""}function y2(){return"<"}x0.peek=g2;function x0(t,i,r,a){const o=
|
|
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 x2(t,i,r){return k0(t,r)?"<":"["}j0.peek=w2;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 w2(){return"["}function
|
|
50
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}]};function c(x,S,T,
|
|
51
|
-
`))}function p(x,S,T,C){const k=T.enter("tableCell"),M=T.enter("phrasing"),L=T.containerPhrasing(x,{...C,before:u,after:u});return M(),k(),L}function y(x,S){return QA(x,{align:S,alignDelimiters:a,fillRows:!1,padding:r,stringLength:o})}function v(x,S,T){const{children:C}=x;let k=-1;const M=[],L=S.enter("table");for(;++k<C.length;)M[k]=g(C[k],S,T);return L(),M}function g(x,S,T){const{children:C}=x;let k=-1;const M=[],L=S.enter("tableRow");for(;++k<C.length;)M[k]=p(C[k],x,S,T);return L(),M}function w(x,S,T){const C=ph.inlineCode(x,S,T);if(!T.stack.includes("tableCell"))return C;const k=[];let M=0,L=C.indexOf("|");for(;L!==-1;){let P=L;for(;P>M&&C.charCodeAt(P-1)===92;)P--;k.push(C.slice(M,L)),(L-P)%2===0&&k.push("\\"),M=L,L=C.indexOf("|",L+1)}return k.push(C.slice(M)),k.join("")}}function I2(t,i,r,a){if(t.type==="table"&&r.type==="listItem"&&r.spread===!1&&(i.type==="definition"||i.type==="heading"&&V2(i,a)||i.type==="paragraph"||i.type==="table"))return 1}function V2(t,i){let r=!1;return Pu(t,function(a){if(a.type==="break"||"value"in a&&/\r?\n|\r/.test(a.value))return r=!0,zs}),!!((!t.depth||t.depth<3)&&Xu(t)&&(i.options.setext||r))}function Y2(){return{exit:{taskListCheckValueChecked:ob,taskListCheckValueUnchecked:ob,paragraph:G2}}}function F2(){return{handlers:{paragraph:$2},join:[X2]}}function ob(t){const i=this.stack[this.stack.length-2];i.type,i.checked=t.type==="taskListCheckValueChecked"}function G2(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 $2(t,i,r,a){if(!i||i.type!=="listItem"||C0(i)!==t)return ph.paragraph(t,i,r,a);const o="["+(i.checked?"x":" ")+"] ",u=r.createTracker(a);u.move(o);const c=ph.paragraph(t.children.length>0?t:{type:"paragraph",children:[{type:"text",value:" "}]},i,r,{...a,...u.current()});return o+c}function X2(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 Q2(){return[hA(),LA(),IA(),M2(),Y2()]}function Z2(t){return{extensions:[mA(),BA(t),VA(),H2(t),F2()]}}const K2={tokenize:nR,partial:!0},A0={tokenize:iR,partial:!0},R0={tokenize:rR,partial:!0},_0={tokenize:lR,partial:!0},J2={tokenize:aR,partial:!0},O0={name:"wwwAutolink",tokenize:eR,previous:M0},z0={name:"protocolAutolink",tokenize:tR,previous:q0},er={name:"emailAutolink",tokenize:W2,previous:D0},Oi={};function P2(){return{text:Oi}}let pl=48;for(;pl<123;)Oi[pl]=er,pl++,pl===58?pl=65:pl===91&&(pl=97);Oi[43]=er;Oi[45]=er;Oi[46]=er;Oi[95]=er;Oi[72]=[er,z0];Oi[104]=[er,z0];Oi[87]=[er,O0];Oi[119]=[er,O0];function W2(t,i,r){const a=this;let o,u;return c;function c(g){return!yh(g)||!D0.call(a,a.previous)||Xh(a.events)?r(g):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),h(g))}function h(g){return yh(g)?(t.consume(g),h):g===64?(t.consume(g),p):r(g)}function p(g){return g===46?t.check(J2,v,y)(g):g===45||g===95||yn(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&&pn(a.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),i(g)):r(g)}}function eR(t,i,r){const a=this;return o;function o(c){return c!==87&&c!==119||!M0.call(a,a.previous)||Xh(a.events)?r(c):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(K2,t.attempt(A0,t.attempt(R0,u),r),r)(c))}function u(c){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),i(c)}}function tR(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)&&!Xh(a.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),o+=String.fromCodePoint(g),t.consume(g),h):r(g)}function h(g){if(pn(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||Ou(g)||Lt(g)||xl(g)||Is(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 nR(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 iR(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)||xl(y)||y!==45&&Is(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 rR(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)||xl(c)?i(c):(t.consume(c),o)}function u(c){return c===41&&a++,t.consume(c),o}}function lR(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)||xl(h)?i(h):r(h)}function o(h){return h===null||h===40||h===91||Lt(h)||xl(h)?i(h):a(h)}function u(h){return pn(h)?c(h):r(h)}function c(h){return h===59?(t.consume(h),a):pn(h)?(t.consume(h),c):r(h)}}function aR(t,i,r){return a;function a(u){return t.consume(u),o}function o(u){return yn(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!pn(t)}function D0(t){return!(t===47||yh(t))}function yh(t){return t===43||t===45||t===46||t===95||yn(t)}function Xh(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 sR={tokenize:pR,partial:!0};function oR(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:dR,continuation:{tokenize:hR},exit:mR}},text:{91:{name:"gfmFootnoteCall",tokenize:fR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uR,resolveTo:cR}}}}function uR(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=mi(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 cR(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 fR(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(mi(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 dR(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=mi(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),wt(t,x,"gfmFootnoteDefinitionWhitespace")):r(S)}function x(S){return i(S)}}function hR(t,i,r){return t.check(Vs,i,t.attempt(sR,i,r))}function mR(t){t.exit("gfmFootnoteDefinition")}function pR(t,i,r){const a=this;return wt(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 yR(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&&hi(w,w.length,0,Qu(x,c.slice(y+1,p),h)),hi(w,w.length,0,[["exit",g,h],["enter",c[p][1],h],["exit",c[p][1],h],["exit",v,h]]),hi(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=Lr(y);if(S===126)return g>1?p(S):(c.consume(S),g++,x);if(g<2&&!r)return p(S);const C=c.exit("strikethroughSequenceTemporary"),k=Lr(S);return C._open=!k||k===2&&!!T,C._close=!T||T===2&&!!k,h(S)}}}class gR{constructor(){this.map=[],this.index=new Map}add(i,r,a){vR(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 vR(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 bR(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 xR(){return{flow:{null:{name:"table",tokenize:wR,resolveAll:SR}}}}function wR(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 W=V>-1?a.events[V][1].type:null,ke=W==="tableHead"||W==="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):it(O)?wt(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,it(O)?wt(t,S,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):S(O))}function S(O){return O===45||O===58?C(O):O===124?(c=!0,t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),T):ie(O)}function T(O){return it(O)?wt(t,C,"whitespace")(O):C(O)}function C(O){return O===58?(u+=1,c=!0,t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),k):O===45?(u+=1,k(O)):O===null||He(O)?P(O):ie(O)}function k(O){return O===45?(t.enter("tableDelimiterFiller"),M(O)):ie(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"),L):(t.exit("tableDelimiterFiller"),L(O))}function L(O){return it(O)?wt(t,P,"whitespace")(O):P(O)}function P(O){return O===124?S(O):O===null||He(O)?!c||o!==u?ie(O):(t.exit("tableDelimiterRow"),t.exit("tableHead"),i(O)):ie(O)}function ie(O){return r(O)}function A(O){return t.enter("tableRow"),F(O)}function F(O){return O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),F):O===null||He(O)?(t.exit("tableRow"),i(O)):it(O)?wt(t,F,"whitespace")(O):(t.enter("data"),X(O))}function X(O){return O===null||O===124||Lt(O)?(t.exit("data"),F(O)):(t.consume(O),O===92?le:X)}function le(O){return O===92||O===124?(t.consume(O),X):X(O)}}function SR(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 gR;for(;++r<t.length;){const x=t[r],S=x[1];x[0]==="enter"?S.type==="tableHead"?(h=!1,p!==0&&(ub(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=ku(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=ku(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=ku(w,i,u,o,r,g)):c[1]!==0&&(g=ku(w,i,c,o,r,g)),o=0):o&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(c[3]=r)}for(p!==0&&ub(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=bR(i.events,r))}return t}function ku(t,i,r,a,o,u){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",h="tableContent";r[0]!==0&&(u.end=Object.assign({},xa(i.events,r[0])),t.add(r[0],0,[["exit",u,i]]));const p=xa(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=xa(i.events,r[2]),v=xa(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({},xa(i.events,o)),t.add(o,0,[["exit",u,i]]),u=void 0),u}function ub(t,i,r,a,o){const u=[],c=xa(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 xa(t,i){const r=t[i],a=r[0]==="enter"?"start":"end";return r[1][a]}const kR={name:"tasklistCheck",tokenize:jR};function ER(){return{text:{91:kR}}}function jR(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):it(p)?t.check({tokenize:TR},i,r)(p):r(p)}}function TR(t,i,r){return wt(t,a,"whitespace");function a(o){return o===null?r(o):i(o)}}function NR(t){return Ix([P2(),oR(),yR(t),xR(),ER()])}const CR={};function AR(t){const i=this,r=t||CR,a=i.data(),o=a.micromarkExtensions||(a.micromarkExtensions=[]),u=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);o.push(NR(r)),u.push(Q2()),c.push(Z2(r))}const RR="cnv_[A-Za-z0-9_-]{16}",_R="[1-9]\\d{0,8}",Qh="[A-Za-z0-9_-]+(?:\\/[A-Za-z0-9_-]+)*\\.html",Zh="[A-Za-z][A-Za-z0-9_-]{0,64}",OR=new RegExp(`^canvas:(${RR})(?:@(${_R}))?(?:/(${Qh}))?(?:#(${Zh}))?$`),zR=new RegExp(`^(${Qh})(?:#(${Zh}))?$`);function tc(t){return new RegExp(`^${Qh}$`).test(t)}function gh(t){return new RegExp(`^${Zh}$`).test(t)}function MR(t,i){return L0(t)?t:i(t)}function L0(t){if(!t)return null;const i=OR.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 qR(t){const i=zR.exec(t);return i?.[1]?{page:i[1],anchor:i[2]??null}:null}const DR=new Set(["tbody","thead","tfoot"]),LR=/^(\d+):([a-z][a-z0-9-]*)$/;function BR(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:BR(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 UR(t){const i=[];for(const r of t.rawChildren)t.tag==="table"&&DR.has(r.tag)?i.push(...r.rawChildren):i.push(r);return i}function HR(t){if(t==="")return[];if(t.length>500||t.includes("//"))return null;const i=t.split("/"),r=[];for(const a of i){const o=LR.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 IR(t){return t.map(i=>`${i.index}:${i.tag}`).join("/")}function VR(t,i){const r=HR(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=UR(u)[c.index];if(!h||h.tag!==c.tag)return null;o.push(c),u=h,a.push({path:IR(o),tag:h.tag,classes:h.classes})}return{node:u,breadcrumb:a}}function YR(t,i){const r=VR(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 FR=/\[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 GR(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(FR,(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,`
|
|
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=y2;function b0(t){return t.value||""}function y2(){return"<"}x0.peek=g2;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 g2(){return"!"}w0.peek=v2;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 v2(){return"!"}S0.peek=b2;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 b2(){return"`"}function k0(t,i){const r=Xu(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=x2;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 x2(t,i,r){return k0(t,r)?"<":"["}j0.peek=w2;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 w2(){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 S2(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 k2(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 E2(t,i,r,a){const o=r.enter("list"),u=r.bulletCurrent;let c=t.ordered?k2(r):$h(r);const h=t.ordered?c==="."?")":".":S2(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 j2(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 T2(t,i,r,a){const o=j2(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 N2(t,i,r,a){const o=r.enter("paragraph"),u=r.enter("phrasing"),c=r.containerPhrasing(t,a);return u(),o(),c}function C2(t,i,r,a){if(!t.children.some(function(h){return KA(h)}))return r.containerFlow(t,a);const u=r.enter("phrasing"),c=r.containerPhrasing(t,a);return u(),c}function A2(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=R2;function Xh(t,i,r,a){const o=r.enter("phrasing"),u=Fh(t,N0,r,r.createTracker(a)),c=u?ec([u],a.before,a.after):"";return o(),c}function N0(t,i){return{construct:"strong",markers:A2(i)==="*"?["*","_"]:["_","*"],sizes:[2]}}function R2(t,i,r){return r.options.strong||"*"}function _2(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 O2(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 z2(t,i,r){const a=(T0(r)+(r.options.ruleSpaces?" ":"")).repeat(O2(r));return r.options.ruleSpaces?a.slice(0,-1):a}const yh={blockquote:JA,break:lb,code:i2,definition:l2,emphasis:Gh,hardBreak:lb,heading:p2,html:b0,image:x0,imageReference:w0,inlineCode:S0,link:E0,linkReference:j0,list:E2,listItem:T2,paragraph:N2,root:C2,strong:Xh,text:_2,thematicBreak:z2};function M2(){return{enter:{table:q2,tableData:ob,tableHeader:ob,tableRow:L2},exit:{codeText:B2,table:D2,tableData:Qd,tableHeader:Qd,tableRow:Qd}}}function q2(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 D2(t){this.exit(t),this.data.inTable=void 0}function L2(t){this.enter({type:"tableRow",children:[],position:void 0},t)}function Qd(t){this.exit(t)}function ob(t){this.enter({type:"tableCell",children:[],position:void 0},t)}function B2(t){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,U2));const r=this.stack[this.stack.length-1];r.type,r.value=i,this.exit(t)}function U2(t,i){return i==="|"?i:t}function H2(t){const i=t||{},{tableCellPadding:r,tablePipeAlign:a,stringLength:o}=i,u=r?" ":"|";return{handlers:{inlineCode:w,table:c,tableCell:p,tableRow:h},join:[I2],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),q=j[0];if(q){let B=x.align?x.align.length:0,P=-1;if(!B)for(;++P<j.length;)j[P].length>B&&(B=j[P].length);for(;q.length<B;)q.push("")}return y(j,x.align)}function h(x,S,T,N){const j=g(x,T,N),q=y([j]);return q.slice(0,q.indexOf(`
|
|
51
|
+
`))}function p(x,S,T,N){const j=T.enter("tableCell"),q=T.enter("phrasing"),B=T.containerPhrasing(x,{...N,before:u,after:u});return q(),j(),B}function y(x,S){return QA(x,{align:S,alignDelimiters:a,fillRows:!1,padding:r,stringLength:o})}function v(x,S,T){const{children:N}=x;let j=-1;const q=[],B=S.enter("table");for(;++j<N.length;)q[j]=g(N[j],S,T);return B(),q}function g(x,S,T){const{children:N}=x;let j=-1;const q=[],B=S.enter("tableRow");for(;++j<N.length;)q[j]=p(N[j],x,S,T);return B(),q}function w(x,S,T){const N=yh.inlineCode(x,S,T);if(!T.stack.includes("tableCell"))return N;const j=[];let q=0,B=N.indexOf("|");for(;B!==-1;){let P=B;for(;P>q&&N.charCodeAt(P-1)===92;)P--;j.push(N.slice(q,B)),(B-P)%2===0&&j.push("\\"),q=B,B=N.indexOf("|",B+1)}return j.push(N.slice(q)),j.join("")}}function I2(t,i,r,a){if(t.type==="table"&&r.type==="listItem"&&r.spread===!1&&(i.type==="definition"||i.type==="heading"&&V2(i,a)||i.type==="paragraph"||i.type==="table"))return 1}function V2(t,i){let r=!1;return Pu(t,function(a){if(a.type==="break"||"value"in a&&/\r?\n|\r/.test(a.value))return r=!0,zs}),!!((!t.depth||t.depth<3)&&Xu(t)&&(i.options.setext||r))}function Y2(){return{exit:{taskListCheckValueChecked:ub,taskListCheckValueUnchecked:ub,paragraph:G2}}}function F2(){return{handlers:{paragraph:$2},join:[X2]}}function ub(t){const i=this.stack[this.stack.length-2];i.type,i.checked=t.type==="taskListCheckValueChecked"}function G2(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 $2(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 X2(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 Q2(){return[hA(),LA(),IA(),M2(),Y2()]}function Z2(t){return{extensions:[mA(),BA(t),VA(),H2(t),F2()]}}const K2={tokenize:nR,partial:!0},A0={tokenize:iR,partial:!0},R0={tokenize:rR,partial:!0},_0={tokenize:lR,partial:!0},J2={tokenize:aR,partial:!0},O0={name:"wwwAutolink",tokenize:eR,previous:M0},z0={name:"protocolAutolink",tokenize:tR,previous:q0},er={name:"emailAutolink",tokenize:W2,previous:D0},Oi={};function P2(){return{text:Oi}}let pl=48;for(;pl<123;)Oi[pl]=er,pl++,pl===58?pl=65:pl===91&&(pl=97);Oi[43]=er;Oi[45]=er;Oi[46]=er;Oi[95]=er;Oi[72]=[er,z0];Oi[104]=[er,z0];Oi[87]=[er,O0];Oi[119]=[er,O0];function W2(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(J2,v,y)(g):g===45||g===95||yn(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&&pn(a.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),i(g)):r(g)}}function eR(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(K2,t.attempt(A0,t.attempt(R0,u),r),r)(c))}function u(c){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),i(c)}}function tR(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(pn(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||Ou(g)||Lt(g)||xl(g)||Is(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 nR(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 iR(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)||xl(y)||y!==45&&Is(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 rR(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)||xl(c)?i(c):(t.consume(c),o)}function u(c){return c===41&&a++,t.consume(c),o}}function lR(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)||xl(h)?i(h):r(h)}function o(h){return h===null||h===40||h===91||Lt(h)||xl(h)?i(h):a(h)}function u(h){return pn(h)?c(h):r(h)}function c(h){return h===59?(t.consume(h),a):pn(h)?(t.consume(h),c):r(h)}}function aR(t,i,r){return a;function a(u){return t.consume(u),o}function o(u){return yn(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!pn(t)}function D0(t){return!(t===47||gh(t))}function gh(t){return t===43||t===45||t===46||t===95||yn(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 sR={tokenize:pR,partial:!0};function oR(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:dR,continuation:{tokenize:hR},exit:mR}},text:{91:{name:"gfmFootnoteCall",tokenize:fR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uR,resolveTo:cR}}}}function uR(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=mi(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 cR(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 fR(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(mi(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 dR(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=mi(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),wt(t,x,"gfmFootnoteDefinitionWhitespace")):r(S)}function x(S){return i(S)}}function hR(t,i,r){return t.check(Vs,i,t.attempt(sR,i,r))}function mR(t){t.exit("gfmFootnoteDefinition")}function pR(t,i,r){const a=this;return wt(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 yR(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&&hi(w,w.length,0,Qu(x,c.slice(y+1,p),h)),hi(w,w.length,0,[["exit",g,h],["enter",c[p][1],h],["exit",c[p][1],h],["exit",v,h]]),hi(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=Lr(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=Lr(S);return N._open=!j||j===2&&!!T,N._close=!T||T===2&&!!j,h(S)}}}class gR{constructor(){this.map=[],this.index=new Map}add(i,r,a){vR(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 vR(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 bR(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 xR(){return{flow:{null:{name:"table",tokenize:wR,resolveAll:SR}}}}function wR(t,i,r){const a=this;let o=0,u=0,c;return h;function h(O){let Y=a.events.length-1;for(;Y>-1;){const{type:oe}=a.events[Y][1];if(oe==="lineEnding"||oe==="linePrefix")Y--;else break}const W=Y>-1?a.events[Y][1].type:null,ke=W==="tableHead"||W==="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):it(O)?wt(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,it(O)?wt(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):ie(O)}function T(O){return it(O)?wt(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)?P(O):ie(O)}function j(O){return O===45?(t.enter("tableDelimiterFiller"),q(O)):ie(O)}function q(O){return O===45?(t.consume(O),q):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 it(O)?wt(t,P,"whitespace")(O):P(O)}function P(O){return O===124?S(O):O===null||He(O)?!c||o!==u?ie(O):(t.exit("tableDelimiterRow"),t.exit("tableHead"),i(O)):ie(O)}function ie(O){return r(O)}function A(O){return t.enter("tableRow"),L(O)}function L(O){return O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),L):O===null||He(O)?(t.exit("tableRow"),i(O)):it(O)?wt(t,L,"whitespace")(O):(t.enter("data"),G(O))}function G(O){return O===null||O===124||Lt(O)?(t.exit("data"),L(O)):(t.consume(O),O===92?le:G)}function le(O){return O===92||O===124?(t.consume(O),G):G(O)}}function SR(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 gR;for(;++r<t.length;){const x=t[r],S=x[1];x[0]==="enter"?S.type==="tableHead"?(h=!1,p!==0&&(cb(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=ku(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=ku(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=ku(w,i,u,o,r,g)):c[1]!==0&&(g=ku(w,i,c,o,r,g)),o=0):o&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(c[3]=r)}for(p!==0&&cb(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=bR(i.events,r))}return t}function ku(t,i,r,a,o,u){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",h="tableContent";r[0]!==0&&(u.end=Object.assign({},xa(i.events,r[0])),t.add(r[0],0,[["exit",u,i]]));const p=xa(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=xa(i.events,r[2]),v=xa(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({},xa(i.events,o)),t.add(o,0,[["exit",u,i]]),u=void 0),u}function cb(t,i,r,a,o){const u=[],c=xa(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 xa(t,i){const r=t[i],a=r[0]==="enter"?"start":"end";return r[1][a]}const kR={name:"tasklistCheck",tokenize:jR};function ER(){return{text:{91:kR}}}function jR(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):it(p)?t.check({tokenize:TR},i,r)(p):r(p)}}function TR(t,i,r){return wt(t,a,"whitespace");function a(o){return o===null?r(o):i(o)}}function NR(t){return Ix([P2(),oR(),yR(t),xR(),ER()])}const CR={};function AR(t){const i=this,r=t||CR,a=i.data(),o=a.micromarkExtensions||(a.micromarkExtensions=[]),u=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);o.push(NR(r)),u.push(Q2()),c.push(Z2(r))}const RR="cnv_[A-Za-z0-9_-]{16}",_R="[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}",OR=new RegExp(`^canvas:(${RR})(?:@(${_R}))?(?:/(${Zh}))?(?:#(${Kh}))?$`),zR=new RegExp(`^(${Zh})(?:#(${Kh}))?$`);function tc(t){return new RegExp(`^${Zh}$`).test(t)}function vh(t){return new RegExp(`^${Kh}$`).test(t)}function MR(t,i){return L0(t)?t:i(t)}function L0(t){if(!t)return null;const i=OR.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 qR(t){const i=zR.exec(t);return i?.[1]?{page:i[1],anchor:i[2]??null}:null}const DR=new Set(["tbody","thead","tfoot"]),LR=/^(\d+):([a-z][a-z0-9-]*)$/;function BR(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:BR(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 UR(t){const i=[];for(const r of t.rawChildren)t.tag==="table"&&DR.has(r.tag)?i.push(...r.rawChildren):i.push(r);return i}function HR(t){if(t==="")return[];if(t.length>500||t.includes("//"))return null;const i=t.split("/"),r=[];for(const a of i){const o=LR.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 IR(t){return t.map(i=>`${i.index}:${i.tag}`).join("/")}function VR(t,i){const r=HR(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=UR(u)[c.index];if(!h||h.tag!==c.tag)return null;o.push(c),u=h,a.push({path:IR(o),tag:h.tag,classes:h.classes})}return{node:u,breadcrumb:a}}function YR(t,i){const r=VR(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 FR=/\[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 GR(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(FR,(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
52
|
|
|
53
|
-
`).trim(),chips:i}}const XR=new Set(["accepted","enqueued","started"]);function QR(t,i){const r=new Map(i.map(u=>[u.id,u.status])),a=new Map,o=[];for(const u of t)if(ZR(u,r)){if(!u.ticketId){o.push(u);continue}a.set(u.ticketId,u)}return{byTicket:a,loose:o}}function ZR(t,i){if(t.previewRevision==null)return!1;if(!t.ticketId)return!0;const r=i.get(t.ticketId);return r==null?!0:!XR.has(r)}function cb(){return{revision:null,files:new Map}}async function KR(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 JR(t,i){return i.kind!=="delta"||t.revision==null||i.baseRevision==null||i.baseRevision!==t.revision||i.revision!==t.revision+1?{mode:"snapshot",paths:i.manifest.map(o=>o.path)}:{mode:"delta",paths:i.manifest.filter(o=>{const u=t.files.get(o.path);return!u||u.hash!==o.hash||u.bytes.byteLength!==o.bytes}).map(o=>o.path)}}async function PR(t,i,r){const a=new Map;for(const o of i.manifest){const u=t.files.get(o.path),c=r.get(o.path)??(u&&u.hash===o.hash?u.bytes:void 0);if(!c)return{ok:!1,cache:t,error:`missing ${o.path}`};if(c.byteLength!==o.bytes)return{ok:!1,cache:t,error:`size ${o.path}`};const h=await KR(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 WR(t,i,r){const a=JR(t,i),o=new Map;try{for(const u of a.paths)o.set(u,await r(u))}catch(u){return{ok:!1,cache:t,error:u instanceof Error?u.message:"fetch failed"}}if(a.mode==="snapshot"){for(const u of i.manifest)if(!o.has(u.path))return{ok:!1,cache:t,error:`incomplete snapshot ${u.path}`}}return PR(t,i,o)}function e_(t,i){return i.ok?i.src:t}const fb=[{id:"desktop",width:1280,label:"canvas.device.desktop"},{id:"tablet",width:768,label:"canvas.device.tablet"},{id:"phone",width:390,label:"canvas.device.phone"}],t_={byTicket:new Map,loose:[],open:(t,i)=>{}},H0=j.createContext(t_);function I0(){return j.useContext(H0)}const yl="canvas-inspect",n_=150;function db(){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 i_({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:C=null}){const{t:k}=We(),M=j.useRef(null),L=j.useRef(null),P=j.useRef(null),ie=j.useRef(v);ie.current=v;const A=j.useRef(w);A.current=w;const F=j.useRef(()=>{}),[X,le]=j.useState(db()?"prepare":"settled"),[O,V]=j.useState("center center"),W=j.useRef(X);W.current=X;const ke=j.useRef(!1),oe=j.useRef(null),[ge,re]=j.useState("desktop"),[ce,xe]=j.useState(!1),[Te,R]=j.useState(""),[Ze,Ie]=j.useState(""),[q,z]=j.useState(null),[ee,ue]=j.useState(null),ve=j.useRef(0),[ze,ye]=j.useState(null),[be,K]=j.useState(null),[de,et]=j.useState(0),mt=j.useRef(null),Ee=j.useRef(x),De=j.useRef(c),Me=j.useRef(r),Ve=j.useRef("");ke.current=ce,Ve.current=Te,oe.current=be,mt.current=ze,Ee.current=x,De.current=c,Me.current=r;const Ae=T&&tc(T)?T:null,Ue=C&&gh(C)?C:null,rt=S>0&&S!==ve.current;u!==Ze?(Ie(u),R(u?s_():""),u!==""&&(S>0&&(ve.current=S),z(S>0?Ae:null),ue(S>0?Ue:null),xe(!1),K(null),et(0))):rt&&u&&(ve.current=S,z(Ae),ue(Ue),xe(!1),K(null));const ae=q??hb(u),Be=a_(u,Te,ae,de,ee),ft=l_(u,ae),Qt=t||k("canvas.card"),Bt=i.find(we=>we.revision===r)??null,Q=fb.find(we=>we.id===ge)?.width??1280,se=()=>{if(W.current!=="leave"){if(!db()){ie.current();return}W.current="leave",le("leave")}};F.current=se,j.useLayoutEffect(()=>{if(X!=="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")},[X,g]),j.useEffect(()=>{if(X!=="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 Ke=bt=>{bt.target===we&&bt.animationName==="canvas-zoom-in"&&Le()};we.addEventListener("animationend",Ke);const st=window.setTimeout(Le,260);return()=>{we.removeEventListener("animationend",Ke),window.clearTimeout(st)}},[X]),j.useEffect(()=>{X==="settled"&&A.current?.()},[X]),j.useEffect(()=>{if(X!=="leave")return;const we=M.current;let pe=!1;const Le=()=>{pe||(pe=!0,ie.current())};if(!we){Le();return}const Ke=bt=>{bt.target===we&&bt.animationName==="canvas-zoom-out"&&Le()};we.addEventListener("animationend",Ke);const st=window.setTimeout(Le,280);return()=>{we.removeEventListener("animationend",Ke),window.clearTimeout(st)}},[X]),j.useEffect(()=>{const we=document.activeElement instanceof HTMLElement?document.activeElement:null,pe=document.body.style.overflow;document.body.style.overflow="hidden",L.current?.focus();const Le=Ke=>{if(Ke.key==="Escape"){if(ke.current){Ke.preventDefault(),Ke.stopPropagation(),xe(!1);const xn=P.current?.contentWindow,Nt=Ve.current;xn&&typeof xn.postMessage=="function"&&Nt&&xn.postMessage({dsh:yl,nonce:Nt,type:"disarm"},"*");return}Ke.preventDefault(),Ke.stopPropagation(),F.current();return}if(Ke.key!=="Tab")return;const st=[...M.current?.querySelectorAll('button, iframe, [href], [tabindex="0"]')??[]],bt=st[0],vt=st.at(-1);Ke.shiftKey&&(document.activeElement===bt||!M.current?.contains(document.activeElement))?(Ke.preventDefault(),vt?.focus()):!Ke.shiftKey&&(document.activeElement===vt||!M.current?.contains(document.activeElement))&&(Ke.preventDefault(),bt?.focus())};return document.addEventListener("keydown",Le,!0),()=>{document.removeEventListener("keydown",Le,!0),document.body.style.overflow=pe,we?.isConnected&&we.focus()}},[]),j.useEffect(()=>{if(X!=="settled"||!ft)return;let we=!1;return fetch(ft,{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}},[X,ft]),j.useEffect(()=>{if(!Te)return;const we=pe=>{if(pe.source!==P.current?.contentWindow)return;const Le=pe.data;if(!Le||Le.dsh!==yl||Le.nonce!==Te)return;if(Le.type==="open"&&typeof Le.path=="string"){const pt=qR(Le.path);if(!pt)return;z(Ft=>Ft===pt.page||Ft==null&&pt.page===hb(u)?Ft:pt.page),ue(pt.anchor),K(null),ye(null);return}if(!ke.current)return;if(Le.type==="ready"){const pt=oe.current;pt!=null&&P.current?.contentWindow?.postMessage({dsh:yl,nonce:Te,type:"pin",path:pt},"*");return}if(Le.type!=="select"||typeof Le.path!="string")return;const Ke=mt.current,st=Ke?YR(Ke,Le.path):null,bt=De.current,vt=Me.current;if(!st||!bt||vt==null)return;K(Le.path);const xn=o_(P.current,Le.rect),Nt=GR(Qt,k("canvas.revision",{revision:String(vt)}),st.tag,st.text),Ct={canvasId:bt,revision:vt,path:st.path,tag:st.tag,label:Nt};u_(xn,Nt).then(()=>Ee.current?.(Ct))};return window.addEventListener("message",we),()=>window.removeEventListener("message",we)},[Te,u,k,Qt]);const Oe=()=>{xe(!1),K(null),z(null),ue(null),et(Date.now())},Ne=we=>{const pe=P.current?.contentWindow;!pe||typeof pe.postMessage!="function"||!Te||pe.postMessage({dsh:yl,nonce:Te,type:we},"*")};return Sl.createPortal(m.jsx("div",{className:X==="leave"?"canvas-modal leaving":"canvas-modal",onClick:we=>{we.target===we.currentTarget&&se()},children:m.jsxs("div",{ref:M,className:`canvas-dialog ${X}`,style:{transformOrigin:O},role:"dialog","aria-modal":"true","aria-label":Qt,children:[m.jsxs("header",{className:"canvas-toolbar",children:[m.jsxs("div",{className:"canvas-toolbar-title",children:[m.jsx("strong",{className:"canvas-name",title:Qt,children:Qt}),m.jsx("button",{ref:L,type:"button",className:"canvas-close","aria-label":k("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:k("canvas.reset.hint"),onClick:Oe,disabled:!u,children:k("canvas.reset")}),m.jsx("button",{type:"button",className:ce?"canvas-select on":"canvas-select","aria-pressed":ce,"aria-label":k("canvas.select"),title:k("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":k("canvas.devices"),children:fb.map(we=>m.jsx("button",{type:"button","aria-pressed":ge===we.id,onClick:()=>re(we.id),children:k(we.label)},we.id))}),m.jsx("div",{className:"canvas-segment canvas-versions",role:"group","aria-label":k("canvas.versions"),children:i.map(we=>m.jsxs("button",{type:"button","aria-pressed":we.revision===r,disabled:we.status==="failed",title:we.error??k("canvas.revision",{revision:String(we.revision)}),onClick:()=>h(we.revision),children:[k("canvas.revision",{revision:String(we.revision)}),m.jsx("span",{className:"canvas-version-status",children:k(r_(we.status))})]},we.revision))}),m.jsx("button",{type:"button",className:"canvas-adopt",onClick:y,disabled:Bt?.status!=="preview"||a==="loading",children:Bt?.status==="stable"?k("canvas.adopted"):k("canvas.adopt")})]})]}),m.jsxs("div",{className:"canvas-stage",children:[a==="loading"?m.jsx("p",{className:"canvas-status",children:k("canvas.loading")}):null,a==="error"?m.jsxs("p",{className:"canvas-status",role:"alert",children:[m.jsx("span",{children:o||k("canvas.error")}),m.jsx("button",{type:"button",onClick:p,children:k("canvas.retry")})]}):null,X==="settled"&&u?m.jsx("div",{className:"canvas-frame",style:{width:`min(100%, ${Q}px)`},children:m.jsx("iframe",{ref:P,title:Qt,sandbox:"allow-scripts",referrerPolicy:"no-referrer",src:Be||void 0,onLoad:()=>{if(!Te)return;const we=P.current?.contentWindow;!we||typeof we.postMessage!="function"||(we.postMessage({dsh:yl,nonce:Te,type:"hello"},"*"),ee&&gh(ee)&&we.postMessage({dsh:yl,nonce:Te,type:"focus",anchor:ee},"*"),ke.current&&we.postMessage({dsh:yl,nonce:Te,type:"arm"},"*"))}})}):null]})]})}),document.body)}function r_(t){return t==="stable"?"canvas.stable":t==="failed"?"canvas.failed":"canvas.preview"}function hb(t){const r=/^\/dsh-bot\/canvas-media\/[A-Za-z0-9_-]{20,128}\/[1-9]\d{0,8}\/(.+)$/.exec(t.split("?")[0]??"")?.[1]??"";return tc(r)?r:"index.html"}function l_(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||!tc(i)?t:`${r[1]}${i}`}function a_(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||!tc(r))return"";const c=`/dsh-bot/canvas-inspect/${u[1]}/${u[2]}/${r}?nonce=${encodeURIComponent(i)}`,h=a?`${c}&r=${a}`:c;return o&&gh(o)?`${h}#${o}`:h}function s_(){const t=new Uint8Array(16);return crypto.getRandomValues(t),[...t].map(i=>i.toString(16).padStart(2,"0")).join("")}function o_(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 u_(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 mb(t,i,r){return`/dsh-bot/canvas-media/${t}/${i}/${r.split("/").map(a=>encodeURIComponent(a)).join("/")}`}function pb(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 yb(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 c_(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 f_({item:t,onOpen:i}){const{t:r}=We();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 d_({sessionId:t,pulse:i,tickets:r,onMention:a,onActive:o,dismiss:u=0,children:c}){const{t:h}=We(),[p,y]=j.useState([]),[v,g]=j.useState(!1),[w,x]=j.useState(null),S=j.useRef(null);S.current=w;const[T,C]=j.useState(!1),[k,M]=j.useState(null),L=j.useRef(0),P=j.useRef(null),[ie,A]=j.useState(null),[F,X]=j.useState([]),[le,O]=j.useState(null),[V,W]=j.useState("idle"),[ke,oe]=j.useState(""),[ge,re]=j.useState(""),ce=j.useRef(cb()),xe=j.useRef(null),Te=j.useRef(0),[R,Ze]=j.useState(u);u!==R&&(Ze(u),u>0&&x(null));const Ie=p.find(ye=>ye.id===w)??null,z=(k&&k.id===w&&k.revision!=null?k.revision:null)??Ie?.previewRevision??Ie?.stableRevision??null,ee=j.useRef(async()=>{});j.useEffect(()=>{const ye=be=>{be.detail!==0&&(P.current={x:be.clientX,y:be.clientY,at:performance.now()})};return document.addEventListener("click",ye,!0),()=>document.removeEventListener("click",ye,!0)},[]),j.useEffect(()=>{x(null),y([]),g(!1)},[t]),j.useEffect(()=>{o?.(w!=null)},[w,o]),j.useEffect(()=>()=>o?.(!1),[o]),j.useEffect(()=>{if(!t)return;let ye=!1;const be=async()=>{const de=await nt(`/canvas?sessionId=${encodeURIComponent(t)}`);if(!ye){if(de.status!==200){g(!0);return}g(!1),y(pb(de.body))}};be();const K=window.setInterval(()=>{be()},6e4);return()=>{ye=!0,window.clearInterval(K)}},[t,i]),j.useEffect(()=>{if(!w)return;let ye=!1;return nt(`/canvas/${w}`).then(be=>{ye||be.status!==200||X(yb(be.body))}),()=>{ye=!0}},[w,i,z]),j.useEffect(()=>{if(!(!w||!T||z==null))return ee.current(w,z),()=>{Te.current+=1}},[w,z,T]);async function ue(ye,be){const K=++Te.current;xe.current!==ye&&(xe.current=ye,ce.current=cb(),re("")),W("loading"),oe("");const de=await nt(`/canvas/${ye}/token`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({revision:be})});if(K!==Te.current)return;const et=de.body.token;if(de.status!==200||typeof et!="string"){W("error"),oe(h("canvas.error"));return}const mt=await nt(`/canvas/${ye}/revisions/${be}`);if(K!==Te.current)return;const Ee=mt.status===200?c_(mt.body):null;if(!Ee){W("error"),oe(h("canvas.error"));return}const De=await WR(ce.current,Ee,async Me=>{const Ve=await fetch(mb(et,be,Me),{credentials:"omit",cache:"no-store"});if(!Ve.ok)throw new Error(h("canvas.error"));return new Uint8Array(await Ve.arrayBuffer())});if(K===Te.current){if(!De.ok){ce.current=De.cache,W("error"),oe(h("canvas.error"));return}ce.current=De.cache,re(Me=>e_(Me,{ok:!0,src:mb(et,Ee.revision,Ee.entry)})),O(Ee.revision),W("ready")}}ee.current=ue;const ve=j.useMemo(()=>QR(p,r),[p,r]),ze=j.useMemo(()=>({byTicket:ve.byTicket,loose:ve.loose,open:(ye,be)=>{const K=P.current,de=K!=null&&performance.now()-K.at<n_;A(de?{x:K.x,y:K.y}:null),S.current==null&&(C(!1),re(""),W("idle")),L.current+=1,M({id:ye,stamp:L.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(i_,{title:Ie.title,revisions:F,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&&nt(`/canvas/${Ie.id}/adopt`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({revision:le})}).then(ye=>{ye.status===200&&(nt(`/canvas/${Ie.id}`).then(be=>{be.status===200&&X(yb(be.body))}),nt(`/canvas?sessionId=${encodeURIComponent(t)}`).then(be=>{be.status===200&&y(pb(be.body))}))})},onClose:()=>x(null),origin:ie,onOpened:()=>C(!0),canvasId:Ie.id,onMention:a,routeStamp:k?.id===Ie.id?k.stamp:0,routePage:k?.id===Ie.id?k.page:null,routeAnchor:k?.id===Ie.id?k.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=j.createContext(null);function h_({children:t}){const[i]=j.useState(V0);return m.jsx(Y0.Provider,{value:i,children:t})}function m_({src:t,alt:i="",title:r}){const{t:a}=We(),o=j.useContext(Y0),[u]=j.useState(V0),c=o??u,h=j.useSyncExternalStore(c.subscribe,()=>c.has(t??""),()=>!1),[p,y]=j.useState(null),v=h||p===t,[g,w]=j.useState(!1),[x,S]=j.useState(!1),T=j.useRef(null),C=j.useRef(null),k=j.useRef(null),M=j.useRef(null),L=i||a("image.untitled");j.useEffect(()=>{if(!g||v)return;const A=document.activeElement instanceof HTMLElement?document.activeElement:null,F=document.body.style.overflow;document.body.style.overflow="hidden",C.current?.focus();const X=O=>{if(O.key==="Escape"&&(O.preventDefault(),O.stopPropagation(),w(!1)),O.key!=="Tab")return;const V=[...T.current?.querySelectorAll('button, [href], [tabindex="0"]')??[]],W=V[0],ke=V.at(-1);O.shiftKey&&(document.activeElement===W||!T.current?.contains(document.activeElement))?(O.preventDefault(),ke?.focus()):!O.shiftKey&&(document.activeElement===ke||!T.current?.contains(document.activeElement))&&(O.preventDefault(),W?.focus())},le=O=>{T.current?.contains(O.target)||C.current?.focus()};return document.addEventListener("keydown",X,!0),document.addEventListener("focusin",le),()=>{document.removeEventListener("keydown",X,!0),document.removeEventListener("focusin",le),document.body.style.overflow=F,A?.isConnected?A.focus():k.current?.focus()}},[g,v]),j.useEffect(()=>{S(!1),w(!1)},[t]);function P(){S(A=>!A),M.current&&(M.current.scrollLeft=0,M.current.scrollTop=0)}function ie(){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:k,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:L}),"aria-haspopup":"dialog","aria-expanded":g,title:a("image.open",{name:L}),onClick:()=>{S(!1),w(!0)},children:[m.jsx("img",{className:"image-preview-thumbnail",src:t,alt:i,title:r,loading:"lazy",onError:ie}),m.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a("image.enlarge")})]}),g&&Sl.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":L,children:[m.jsxs("header",{className:"image-lightbox-toolbar",children:[m.jsx("span",{className:"image-lightbox-name",title:L,children:L}),m.jsx("button",{type:"button",onClick:P,"aria-pressed":x,children:a(x?"image.fit":"image.original")}),m.jsx("button",{ref:C,type:"button",onClick:()=>w(!1),"aria-label":a("image.close"),children:a("image.close")})]}),m.jsx("div",{ref: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:ie})})]})}),document.body)]})}function p_({text:t,language:i}){const[r,a]=j.useState(!1);return m.jsxs("div",{className:"code-block",children:[m.jsxs("div",{className:"code-banner",children:[m.jsx("span",{className:"code-lang",children:i||"Code block"}),m.jsx("button",{type:"button",className:"code-copy","aria-label":r?"Copied":"Copy",onClick:()=>{navigator.clipboard.writeText(t).then(()=>{a(!0),window.setTimeout(()=>a(!1),1e3)})},children:r?"Copied":"Copy"})]}),m.jsx("pre",{children:m.jsx("code",{children:t})})]})}function y_({children:t}){const i=j.Children.toArray(t)[0];if(j.isValidElement(i)){const r=i,a=String(r.props.children??"").replace(/\n$/,""),o=/language-([\w-]+)/.exec(r.props.className??"");return m.jsx(p_,{text:a,language:o?.[1]})}return m.jsx("pre",{children:t})}function g_(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 vh=j.createContext({streaming:!1}),v_={pre:y_,img({src:t,alt:i,title:r}){const{resolveImage:a}=j.useContext(vh),o=typeof t=="string"?a?.(t):void 0,u=typeof t=="string"&&t!==""&&!/^(?:[a-z][a-z0-9+.-]*:|\/|#|\?)/i.test(t);return m.jsx(m_,{src:o??(u?`/dsh-bot/${t.replace(/^\.\//,"")}`:t||void 0),alt:i,title:r})},code({className:t,children:i}){return m.jsx("code",{className:t,children:i})},table({children:t}){return m.jsx("div",{className:"table-scroll",children:m.jsx("table",{children:t})})},a({href:t,children:i,node:r}){const{streaming:a,onOpenFile:o}=j.useContext(vh),u=I0(),{t:c}=We();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:g_(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 b_(t,i){if(!i)return t;const r=t.match(/```/g);return r&&r.length%2===1?`${t}
|
|
54
|
-
\`\`\``:t}function Fs({text:t,streaming:i=!1,onOpenFile:r,resolveImage:a}){const o=j.useMemo(()=>({streaming:i,onOpenFile:r,resolveImage:a}),[i,r,a]);return m.jsx(vh.Provider,{value:o,children:m.jsx("div",{className:i?"markdown streaming":"markdown",children:m.jsx(rA,{remarkPlugins:[AR],components:v_,urlTransform:u=>MR(u,f0),children:b_(t,i)})})})}const x_=j.lazy(()=>VE(()=>import("./SourceEditor-BjtoMvcX.js").then(t=>t.S),__vite__mapDeps([0,1]))),w_=50*1024*1024,F0="dsh-bot.files-drawer-width";function S_(){try{const t=localStorage.getItem(F0);return t==null||t===""?Ms:Ea(Number(t))}catch{return Ms}}function k_(t){try{localStorage.setItem(F0,String(t))}catch{}}function E_({open:t,sessionId:i,focus:r,onClose:a}){const{t:o}=We(),[u,c]=j.useState(null),[h,p]=j.useState("workspace"),[y,v]=j.useState(""),[g,w]=j.useState([]),[x,S]=j.useState("loading"),[T,C]=j.useState(""),[k,M]=j.useState(null),[L,P]=j.useState(0),[ie,A]=j.useState(S_),F=j.useRef(ie),[X,le]=j.useState(!1),[O,V]=j.useState(()=>window.innerWidth),[W,ke]=j.useState(()=>window.matchMedia("(max-width: 800px)").matches),[oe,ge]=j.useState(t),[re,ce]=j.useState(t?"in":"out"),[xe,Te]=j.useState(),[R,Ze]=j.useState(""),[Ie,q]=j.useState(!1),[z,ee]=j.useState(null),[ue,ve]=j.useState(!1),[ze,ye]=j.useState(!1),[be,K]=j.useState(null),[de,et]=j.useState(""),mt=j.useRef(0),Ee=j.useRef(null),De=j.useRef(""),Me=j.useRef(!0),Ve=j.useRef(0),Ae=j.useRef(r),Ue=j.useRef(oe),rt=j.useRef(re);Ae.current=r,Ue.current=oe,rt.current=re,j.useEffect(()=>()=>{Me.current=!1,De.current&&URL.revokeObjectURL(De.current)},[]),j.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]),j.useEffect(()=>{const Z=window.matchMedia("(max-width: 800px)"),he=()=>ke(Z.matches);return Z.addEventListener("change",he),()=>Z.removeEventListener("change",he)},[]),j.useEffect(()=>{const Z=()=>V(window.innerWidth);return window.addEventListener("resize",Z),()=>window.removeEventListener("resize",Z)},[]);const ae=Ea(ie);Tx({present:oe,narrow:W,motion:re,width:ae,resizing:X,viewport:O}),j.useEffect(()=>{const Z=he=>{if(he.key==="Escape"){if(z&&be==null){ee(null);return}a()}};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[a,z,be]),j.useEffect(()=>{if(!t)return;const Z=new AbortController;return c(null),Ae.current||(v(""),M(null),C("")),nt(`/files/roots?sessionId=${encodeURIComponent(i)}`,{signal:Z.signal}).then(he=>{if(Z.signal.aborted)return;const Et=typeof he.body.workspace=="string"?he.body.workspace:null,yt=typeof he.body.home=="string"?he.body.home:null,ot=typeof he.body.workspaceReason=="string"?he.body.workspaceReason:"",Mt=typeof he.body.homeReason=="string"?he.body.homeReason:"";if(c({workspace:Et,workspaceReason:ot,home:yt,homeReason:Mt}),Ae.current)return;const jt=vv({workspace:Et,home:yt,workspaceReason:ot});jt.kind==="path"?(p(jt.root),v(jt.path)):(S("error"),C(o(jt.notice)))}).catch(()=>{Z.signal.aborted||(S("error"),C(o("files.failed")))}),()=>Z.abort()},[t,i,o]),j.useEffect(()=>{if(!t||!r||!u)return;const Z=T_(u.workspace,r.path);if(!Z){const Mt=vv(u);S("error"),C(o(Mt.kind==="unavailable"?Mt.notice:"files.missing"));return}const he=++Ve.current,Et=new AbortController,yt=Z.split("/").filter(Boolean).at(-1)??Z,ot=N_(Z,u.workspace,u.home);return Te(r.line),C(""),ot&&p(ot),nt(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(Z)}`,{signal:Et.signal}).then(Mt=>{if(!(he!==Ve.current||!Me.current)){if(Mt.status===200&&Array.isArray(Mt.body.items)){Te(void 0),Ze(""),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:Z);return}return Ze(Z),v(C_(Z)),Q(Z,yt,0,he)}}).catch(()=>{he!==Ve.current||!Me.current||Et.signal.aborted||M({kind:"error",path:Z,name:yt})}),()=>Et.abort()},[t,r,u,i,o]),j.useEffect(()=>{if(!y)return;const Z=new AbortController;return S("loading"),C(""),nt(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(y)}`,{signal:Z.signal}).then(he=>{if(Z.signal.aborted)return;if(he.status!==200||!Array.isArray(he.body.items)){w([]),S("error"),C(Eu(he.body.error,o));return}const Et=typeof he.body.path=="string"?he.body.path:y;w(he.body.items.filter(__)),S("ready"),(he.body.root==="workspace"||he.body.root==="home")&&p(he.body.root),Et!==y&&v(Et)}).catch(()=>{Z.signal.aborted||(S("error"),C(o("files.failed")))}),()=>Z.abort()},[y,i,L,o]);function Be(Z){De.current&&URL.revokeObjectURL(De.current),De.current=Z}function ft(Z){const he=Z==="workspace"?u?.workspace:u?.home;he&&(p(Z),M(null),ee(null),he!==y&&(S("loading"),v(he)))}async function Qt(Z){const he=bh(y,Z.name);if(Z.kind==="file"){await Q(he,Z.name,Z.size);return}if(Z.kind==="link"){const Et=await nt(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(he)}`);if(!Me.current)return;if(Et.status!==200){if(Et.body.error==="not_directory"){await Q(he,Z.name,Z.size);return}C(Eu(Et.body.error,o));return}M(null),S("loading"),v(typeof Et.body.path=="string"?Et.body.path:he);return}M(null),S("loading"),v(he)}async function Bt(Z){const he=await nt(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(Z)}`);if(Me.current){if(he.status===200&&Array.isArray(he.body.items)){M(null),S("loading"),(he.body.root==="workspace"||he.body.root==="home")&&p(he.body.root),v(typeof he.body.path=="string"?he.body.path:Z);return}if(he.body.error==="not_directory"){const Et=Z.split("/").filter(Boolean).at(-1)??Z;await Q(Z,Et,0);return}C(Eu(he.body.error,o))}}async function Q(Z,he,Et,yt=++Ve.current){const ot=()=>Me.current&&yt===Ve.current;M({kind:"loading",path:Z,name:he});const Mt=M_(he);if(Mt){try{const jl=await fetch(Lu(i,Z));if(!ot())return;if(!jl.ok){M({kind:"error",path:Z,name:he});return}const tr=URL.createObjectURL(new Blob([await jl.arrayBuffer()],{type:Mt}));if(!ot()){URL.revokeObjectURL(tr);return}Be(tr),M({kind:"image",path:Z,name:he,url:tr})}catch{ot()&&M({kind:"error",path:Z,name:he})}return}const jt=await nt(`/files/text?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(Z)}`);if(ot()){if(jt.status===415||jt.body.error==="binary"){M({kind:"binary",path:Z,name:he,size:Et});return}if(jt.status!==200||typeof jt.body.text!="string"){M({kind:"error",path:Z,name:he});return}M({kind:"text",path:Z,name:he,text:jt.body.text,eof:jt.body.eof!==!1})}}function se(Z){if(be==null){if(Z.size>w_){C(o("files.tooLarge")),ee(null);return}C(""),ve(!1),ye(!1),K(null),ee(Z)}}async function Oe(){if(!(!z||!y||be!=null)){K(0),C("");try{const Z=await D_(i,y,z,ue,K);if(!Me.current)return;if(Z.status===409){ye(!0),C(o("files.exists")),K(null);return}if(Z.status!==201||typeof Z.body.path!="string"){C(Eu(Z.body.error,o)),K(null);return}ee(null),K(null),P(he=>he+1)}catch{if(!Me.current)return;C(o("files.failed")),K(null)}}}const Ne=j.useRef(null),we=j.useRef(0),[pe,Le]=j.useState(null),[Ke,st]=j.useState(!1);j.useEffect(()=>{let Z=null;if(k?k.kind!=="loading"&&(Z={kind:"file",key:`file:${k.path}`,path:y,root:h,preview:k}):y&&x!=="loading"&&(Z=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:""}),!Z){!y&&!k&&(Ne.current=null,Le(null)),st(!1);return}const he=Ne.current;if(he?.key===Z.key){if(he.root===Z.root&&he.path===Z.path&&(he.kind==="file"&&Z.kind==="file"?he.preview===Z.preview:he.kind==="list"&&Z.kind==="list"&&he.items===Z.items&&he.error===Z.error))return;Ne.current=Z,Le(Z);return}if(!he||window.matchMedia("(prefers-reduced-motion: reduce)").matches){Ne.current=Z,Le(Z),st(!1);return}const Et=++we.current;st(!0);const yt=window.setTimeout(()=>{we.current===Et&&(Ne.current=Z,Le(Z),st(!1))},200);return()=>window.clearTimeout(yt)},[k,g,x,y,h,T,o]),j.useEffect(()=>{const Z=pe?.kind==="file"&&pe.preview.kind==="image",he=k?.kind==="image"||k?.kind==="loading";Z||he||!De.current||(URL.revokeObjectURL(De.current),De.current="")},[pe,k]);const bt=pe?.root??h,vt=pe?.path||y,xn=bt==="workspace"?u?.workspace:u?.home,Nt=xn?R_(xn,vt):[],Ct=pe?.kind==="file"?{name:pe.preview.name,path:pe.preview.path}:null,pt=pe?.kind==="list"?pe.error:"";function Ft(Z){navigator.clipboard.writeText(Z).then(()=>{et(Z),window.setTimeout(()=>et(he=>he===Z?"":he),1e3)})}const pi=z!=null&&(ze||g.some(Z=>Z.name===z.name)),Vn=be!=null;return oe?Sl.createPortal(m.jsxs("div",{className:W?`files-drawer narrow files-drawer-${re}`:`files-drawer files-drawer-${re}${X?" resizing":""}`,style:W?void 0:{width:ae},role:"dialog","aria-label":o("files.title"),onAnimationEnd:Z=>{Z.target!==Z.currentTarget||Z.animationName!=="files-drawer-out"||rt.current==="out"&&ge(!1)},onDragEnter:Z=>{Z.preventDefault(),mt.current+=1,q(!0)},onDragOver:Z=>Z.preventDefault(),onDragLeave:()=>{mt.current-=1,mt.current<=0&&(mt.current=0,q(!1))},onDrop:Z=>{Z.preventDefault(),mt.current=0,q(!1);const he=Z.dataTransfer.files[0];he&&se(he)},children:[W?null:m.jsx("div",{className:"files-resize",onPointerDown:Z=>{Z.preventDefault(),Z.currentTarget.setPointerCapture(Z.pointerId),le(!0);const he=yt=>{const ot=Ea(window.innerWidth-yt.clientX);F.current=ot,A(ot)},Et=()=>{le(!1),k_(F.current),window.removeEventListener("pointermove",he),window.removeEventListener("pointerup",Et)};window.addEventListener("pointermove",he),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(L_,{})}),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||gb(u?.homeReason,o),onClick:()=>ft("home"),children:m.jsx(H_,{})}),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??gb(u?.workspaceReason,o),onClick:()=>ft("workspace"),children:m.jsx(U_,{})})]}),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((Z,he)=>m.jsxs("span",{children:[he>0?m.jsx("span",{"aria-hidden":"true",children:"/"}):null,m.jsx("button",{type:"button",title:Z.path,onClick:()=>{Z.path===y&&!k||(M(null),Z.path!==y&&(S("loading"),v(Z.path)))},children:Z.name})]},Z.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,vt?m.jsx("button",{type:"button",className:"files-icon-btn files-crumb-copy","aria-label":o("files.pathHint"),title:de===(Ct?.path||vt)?o("files.copied"):o("files.pathHint"),onClick:()=>Ft(Ct?.path||vt),children:de===(Ct?.path||vt)?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||Vn,onClick:()=>Ee.current?.click(),children:m.jsx(Y_,{})}),m.jsx("input",{ref:Ee,type:"file",hidden:!0,onChange:Z=>{const he=Z.target.files?.[0];Z.target.value="",he&&se(he)}})]}),T&&T!==pt?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:Ke?"files-stage out":"files-stage in",children:pe.kind==="file"?m.jsx(j_,{preview:pe.preview,sessionId:i,line:pe.preview.path===R?xe:void 0,onOpenPath:Z=>{Bt(Z)}}):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(B_,{})}),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(Z=>m.jsxs("div",{className:"files-row",role:"row",children:[m.jsxs("button",{type:"button",className:"files-name",onClick:()=>{Qt(Z)},children:[m.jsx("span",{className:Z.kind==="dir"?"files-mark dir":"files-mark",children:z_(Z.kind)}),m.jsx("span",{children:Z.name})]}),m.jsx("span",{className:"files-col-type",children:O_(Z,o)}),m.jsx("span",{className:"files-col-size",children:Z.kind==="file"?xh(Z.size):"—"}),m.jsx("span",{className:"files-col-time",children:q_(Z.mtime)}),m.jsx("span",{className:"files-row-actions",children:Z.kind==="file"?m.jsxs("a",{className:"files-action",href:Lu(i,bh(y,Z.name)),children:[m.jsx(Q0,{}),o("files.download")]}):null})]},Z.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:xh(z.size)})]}),m.jsx("p",{className:"files-confirm-dest",children:y}),Vn?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,pi?m.jsxs("label",{className:"files-check",children:[m.jsx("input",{type:"checkbox",checked:ue,disabled:Vn,onChange:Z=>ve(Z.target.checked)}),o("files.overwrite")]}):null,m.jsxs("div",{className:"files-confirm-actions",children:[m.jsx("button",{type:"button",disabled:Vn,onClick:()=>ee(null),children:o("files.cancel")}),m.jsx("button",{type:"button",className:"primary",disabled:Vn||pi&&!ue,onClick:()=>{Oe()},children:o("files.upload")})]})]}):null]}),document.body):null}function j_({preview:t,sessionId:i,line:r,onOpenPath:a}){const{t:o}=We(),u=t.kind==="text"&&YE(t.name),[c,h]=j.useState(u&&r==null?"preview":"source"),[p,y]=j.useState(!1);if(j.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(I_,{}),o("files.previewMode")]}),m.jsxs("button",{type:"button",className:"files-action","aria-pressed":c==="source",onClick:()=>h("source"),children:[m.jsx(V_,{}),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:Lu(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")," ",xh(t.size)]}):w?m.jsxs(m.Fragment,{children:[m.jsx(j.Suspense,{fallback:m.jsx("p",{className:"files-status",children:o("file.loading")}),children:m.jsx(x_,{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(Fs,{text:v,onOpenFile:x=>{const S=x.startsWith("/")?x:G0(t.path,x);S&&a(S)},resolveImage:x=>A_(i,t.path,x)}),g?null:m.jsx("p",{className:"file-modal-note",children:o("files.truncated")})]})]})}function gb(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 T_(t,i){const r=i.replace(/^\.\//,"");return r.startsWith("/")?r:t?bh(t,r):null}function N_(t,i,r){return i&&(t===i||t.startsWith(`${i}/`))?"workspace":r&&(t===r||t.startsWith(`${r}/`))?"home":null}function C_(t){const i=t.lastIndexOf("/");return i<=0?"/":t.slice(0,i)}function A_(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`${Lu(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 R_(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 bh(t,i){return t==="/"?`/${i}`:`${t.replace(/\/$/,"")}/${i}`}function Lu(t,i){return`/dsh-bot/api/files/raw?sessionId=${encodeURIComponent(t)}&path=${encodeURIComponent(i)}`}function __(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 Eu(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 O_(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 z_(t){return t==="dir"?"▸":t==="link"?"↗":"·"}function M_(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 xh(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 q_(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 D_(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 L_(){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 B_(){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 U_(){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 H_(){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 I_(){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 V_(){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 Y_(){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 F_({onClose:t,onCreated:i}){const[r,a]=j.useState(""),[o,u]=j.useState(""),[c,h]=j.useState(""),[p,y]=j.useState(!1),[v,g]=j.useState(""),{locale:w,setLocale:x,t:S}=We();function T(k){a(k)}async function C(){if(p)return;const k=r.trim();if(k===""){g(S("new.nameRequired"));return}y(!0),g("");const M=await nt("/sessions",{method:"POST",headers:{"content-type":"application/json","idempotency-key":crypto.randomUUID()},body:JSON.stringify({name:k})}),L=typeof M.body.sessionId=="string"?M.body.sessionId:"";if(!L){const X=M.body.upstream;g(X?.message||String(M.body.error||S("new.createFailed"))),y(!1);return}const P=Ik(k,o,c),ie=await Ri("/dsh-bot/api/sessions/open",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:L,personaText:P,idempotencyKey:crypto.randomUUID()})});if(ie.body.ok!==!0){g(Jb(ie.body,S("new.personaFailed"))),y(!1);return}const A=c.trim()||S("new.kickoff"),F=await nt("/tasks",{method:"POST",headers:{"content-type":"application/json","idempotency-key":crypto.randomUUID()},body:JSON.stringify({sessionId:L,text:A})});if(F.status!==202){const X=F.body.execution,le=F.body.task;g(X?.reason||le?.reason||S("new.turnFailed")),y(!1);return}i(L,S("new.created",{name:k}),k)}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:k=>k.stopPropagation(),onSubmit:k=>{k.preventDefault(),C()},children:[m.jsxs("div",{className:"setup-head",children:[m.jsx("h2",{id:"new-session-title",children:S("new.title")}),m.jsx("button",{type:"button",className:"setup-close","aria-label":S("new.close"),onClick:t,children:"×"})]}),m.jsx("p",{className:"setup-lead",children:S("new.lead")}),m.jsx("label",{htmlFor:"setup-name",children:S("new.name")}),m.jsx("input",{id:"setup-name",value:r,placeholder:S("new.namePlaceholder"),onChange:k=>T(k.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:k=>u(k.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:k=>h(k.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 G_(t,i){const{t:r}=We(),[a,o]=j.useState("");return j.useEffect(()=>{if(t===""){o("");return}let u=!1;return(async()=>{const c=await Ri(`/dsh-bot/api/status?sessionId=${encodeURIComponent(t)}`),h=await Ri(`/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=Vk(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 nc(t){const i=t.replace(/\r\n/g,`
|
|
53
|
+
`).trim(),chips:i}}const XR=new Set(["accepted","enqueued","started"]);function QR(t,i){const r=new Map(i.map(u=>[u.id,u.status])),a=new Map,o=[];for(const u of t)if(ZR(u,r)){if(!u.ticketId){o.push(u);continue}a.set(u.ticketId,u)}return{byTicket:a,loose:o}}function ZR(t,i){if(t.previewRevision==null)return!1;if(!t.ticketId)return!0;const r=i.get(t.ticketId);return r==null?!0:!XR.has(r)}function fb(){return{revision:null,files:new Map}}async function KR(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 JR(t,i){return i.kind!=="delta"||t.revision==null||i.baseRevision==null||i.baseRevision!==t.revision||i.revision!==t.revision+1?{mode:"snapshot",paths:i.manifest.map(o=>o.path)}:{mode:"delta",paths:i.manifest.filter(o=>{const u=t.files.get(o.path);return!u||u.hash!==o.hash||u.bytes.byteLength!==o.bytes}).map(o=>o.path)}}async function PR(t,i,r){const a=new Map;for(const o of i.manifest){const u=t.files.get(o.path),c=r.get(o.path)??(u&&u.hash===o.hash?u.bytes:void 0);if(!c)return{ok:!1,cache:t,error:`missing ${o.path}`};if(c.byteLength!==o.bytes)return{ok:!1,cache:t,error:`size ${o.path}`};const h=await KR(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 WR(t,i,r){const a=JR(t,i),o=new Map;try{for(const u of a.paths)o.set(u,await r(u))}catch(u){return{ok:!1,cache:t,error:u instanceof Error?u.message:"fetch failed"}}if(a.mode==="snapshot"){for(const u of i.manifest)if(!o.has(u.path))return{ok:!1,cache:t,error:`incomplete snapshot ${u.path}`}}return PR(t,i,o)}function e_(t,i){return i.ok?i.src:t}const db=[{id:"desktop",width:1280,label:"canvas.device.desktop"},{id:"tablet",width:768,label:"canvas.device.tablet"},{id:"phone",width:390,label:"canvas.device.phone"}],t_={byTicket:new Map,loose:[],open:(t,i)=>{}},H0=E.createContext(t_);function I0(){return E.useContext(H0)}const yl="canvas-inspect",n_=150;function hb(){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 i_({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}=et(),q=E.useRef(null),B=E.useRef(null),P=E.useRef(null),ie=E.useRef(v);ie.current=v;const A=E.useRef(w);A.current=w;const L=E.useRef(()=>{}),[G,le]=E.useState(hb()?"prepare":"settled"),[O,Y]=E.useState("center center"),W=E.useRef(G);W.current=G;const ke=E.useRef(!1),oe=E.useRef(null),[ge,re]=E.useState("desktop"),[ce,xe]=E.useState(!1),[Te,R]=E.useState(""),[Ze,Ie]=E.useState(""),[M,z]=E.useState(null),[ee,ue]=E.useState(null),ve=E.useRef(0),[ze,ye]=E.useState(null),[be,K]=E.useState(null),[de,tt]=E.useState(0),mt=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,mt.current=ze,Ee.current=x,De.current=c,Me.current=r;const Ae=T&&tc(T)?T:null,Ue=N&&vh(N)?N:null,rt=S>0&&S!==ve.current;u!==Ze?(Ie(u),R(u?s_():""),u!==""&&(S>0&&(ve.current=S),z(S>0?Ae:null),ue(S>0?Ue:null),xe(!1),K(null),tt(0))):rt&&u&&(ve.current=S,z(Ae),ue(Ue),xe(!1),K(null));const ae=M??mb(u),Be=a_(u,Te,ae,de,ee),ft=l_(u,ae),Qt=t||j("canvas.card"),Bt=i.find(we=>we.revision===r)??null,Q=db.find(we=>we.id===ge)?.width??1280,se=()=>{if(W.current!=="leave"){if(!hb()){ie.current();return}W.current="leave",le("leave")}};L.current=se,E.useLayoutEffect(()=>{if(G!=="prepare")return;const we=q.current;if(we&&g){const pe=we.getBoundingClientRect();Y(`${g.x-pe.left}px ${g.y-pe.top}px`)}else Y("center center");le("enter")},[G,g]),E.useEffect(()=>{if(G!=="enter")return;const we=q.current;let pe=!1;const Le=()=>{pe||(pe=!0,le(bt=>bt==="enter"?"settled":bt))};if(!we){Le();return}const Ke=bt=>{bt.target===we&&bt.animationName==="canvas-zoom-in"&&Le()};we.addEventListener("animationend",Ke);const st=window.setTimeout(Le,260);return()=>{we.removeEventListener("animationend",Ke),window.clearTimeout(st)}},[G]),E.useEffect(()=>{G==="settled"&&A.current?.()},[G]),E.useEffect(()=>{if(G!=="leave")return;const we=q.current;let pe=!1;const Le=()=>{pe||(pe=!0,ie.current())};if(!we){Le();return}const Ke=bt=>{bt.target===we&&bt.animationName==="canvas-zoom-out"&&Le()};we.addEventListener("animationend",Ke);const st=window.setTimeout(Le,280);return()=>{we.removeEventListener("animationend",Ke),window.clearTimeout(st)}},[G]),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=Ke=>{if(Ke.key==="Escape"){if(ke.current){Ke.preventDefault(),Ke.stopPropagation(),xe(!1);const xn=P.current?.contentWindow,Nt=Ve.current;xn&&typeof xn.postMessage=="function"&&Nt&&xn.postMessage({dsh:yl,nonce:Nt,type:"disarm"},"*");return}Ke.preventDefault(),Ke.stopPropagation(),L.current();return}if(Ke.key!=="Tab")return;const st=[...q.current?.querySelectorAll('button, iframe, [href], [tabindex="0"]')??[]],bt=st[0],vt=st.at(-1);Ke.shiftKey&&(document.activeElement===bt||!q.current?.contains(document.activeElement))?(Ke.preventDefault(),vt?.focus()):!Ke.shiftKey&&(document.activeElement===vt||!q.current?.contains(document.activeElement))&&(Ke.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(G!=="settled"||!ft)return;let we=!1;return fetch(ft,{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}},[G,ft]),E.useEffect(()=>{if(!Te)return;const we=pe=>{if(pe.source!==P.current?.contentWindow)return;const Le=pe.data;if(!Le||Le.dsh!==yl||Le.nonce!==Te)return;if(Le.type==="open"&&typeof Le.path=="string"){const pt=qR(Le.path);if(!pt)return;z(Ft=>Ft===pt.page||Ft==null&&pt.page===mb(u)?Ft:pt.page),ue(pt.anchor),K(null),ye(null);return}if(!ke.current)return;if(Le.type==="ready"){const pt=oe.current;pt!=null&&P.current?.contentWindow?.postMessage({dsh:yl,nonce:Te,type:"pin",path:pt},"*");return}if(Le.type!=="select"||typeof Le.path!="string")return;const Ke=mt.current,st=Ke?YR(Ke,Le.path):null,bt=De.current,vt=Me.current;if(!st||!bt||vt==null)return;K(Le.path);const xn=o_(P.current,Le.rect),Nt=GR(Qt,j("canvas.revision",{revision:String(vt)}),st.tag,st.text),Ct={canvasId:bt,revision:vt,path:st.path,tag:st.tag,label:Nt};u_(xn,Nt).then(()=>Ee.current?.(Ct))};return window.addEventListener("message",we),()=>window.removeEventListener("message",we)},[Te,u,j,Qt]);const Oe=()=>{xe(!1),K(null),z(null),ue(null),tt(Date.now())},Ne=we=>{const pe=P.current?.contentWindow;!pe||typeof pe.postMessage!="function"||!Te||pe.postMessage({dsh:yl,nonce:Te,type:we},"*")};return Sl.createPortal(m.jsx("div",{className:G==="leave"?"canvas-modal leaving":"canvas-modal",onClick:we=>{we.target===we.currentTarget&&se()},children:m.jsxs("div",{ref:q,className:`canvas-dialog ${G}`,style:{transformOrigin:O},role:"dialog","aria-modal":"true","aria-label":Qt,children:[m.jsxs("header",{className:"canvas-toolbar",children:[m.jsxs("div",{className:"canvas-toolbar-title",children:[m.jsx("strong",{className:"canvas-name",title:Qt,children:Qt}),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:Oe,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:db.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(r_(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,G==="settled"&&u?m.jsx("div",{className:"canvas-frame",style:{width:`min(100%, ${Q}px)`},children:m.jsx("iframe",{ref:P,title:Qt,sandbox:"allow-scripts",referrerPolicy:"no-referrer",src:Be||void 0,onLoad:()=>{if(!Te)return;const we=P.current?.contentWindow;!we||typeof we.postMessage!="function"||(we.postMessage({dsh:yl,nonce:Te,type:"hello"},"*"),ee&&vh(ee)&&we.postMessage({dsh:yl,nonce:Te,type:"focus",anchor:ee},"*"),ke.current&&we.postMessage({dsh:yl,nonce:Te,type:"arm"},"*"))}})}):null]})]})}),document.body)}function r_(t){return t==="stable"?"canvas.stable":t==="failed"?"canvas.failed":"canvas.preview"}function mb(t){const r=/^\/dsh-bot\/canvas-media\/[A-Za-z0-9_-]{20,128}\/[1-9]\d{0,8}\/(.+)$/.exec(t.split("?")[0]??"")?.[1]??"";return tc(r)?r:"index.html"}function l_(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||!tc(i)?t:`${r[1]}${i}`}function a_(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||!tc(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 s_(){const t=new Uint8Array(16);return crypto.getRandomValues(t),[...t].map(i=>i.toString(16).padStart(2,"0")).join("")}function o_(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 u_(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 pb(t,i,r){return`/dsh-bot/canvas-media/${t}/${i}/${r.split("/").map(a=>encodeURIComponent(a)).join("/")}`}function yb(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 gb(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 c_(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 f_({item:t,onOpen:i}){const{t:r}=et();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 d_({sessionId:t,pulse:i,tickets:r,onMention:a,onActive:o,dismiss:u=0,children:c}){const{t:h}=et(),[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,q]=E.useState(null),B=E.useRef(0),P=E.useRef(null),[ie,A]=E.useState(null),[L,G]=E.useState([]),[le,O]=E.useState(null),[Y,W]=E.useState("idle"),[ke,oe]=E.useState(""),[ge,re]=E.useState(""),ce=E.useRef(fb()),xe=E.useRef(null),Te=E.useRef(0),[R,Ze]=E.useState(u);u!==R&&(Ze(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,ee=E.useRef(async()=>{});E.useEffect(()=>{const ye=be=>{be.detail!==0&&(P.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 de=await Pe(`/canvas?sessionId=${encodeURIComponent(t)}`);if(!ye){if(de.status!==200){g(!0);return}g(!1),y(yb(de.body))}};be();const K=window.setInterval(()=>{be()},6e4);return()=>{ye=!0,window.clearInterval(K)}},[t,i]),E.useEffect(()=>{if(!w)return;let ye=!1;return Pe(`/canvas/${w}`).then(be=>{ye||be.status!==200||G(gb(be.body))}),()=>{ye=!0}},[w,i,z]),E.useEffect(()=>{if(!(!w||!T||z==null))return ee.current(w,z),()=>{Te.current+=1}},[w,z,T]);async function ue(ye,be){const K=++Te.current;xe.current!==ye&&(xe.current=ye,ce.current=fb(),re("")),W("loading"),oe("");const de=await Pe(`/canvas/${ye}/token`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({revision:be})});if(K!==Te.current)return;const tt=de.body.token;if(de.status!==200||typeof tt!="string"){W("error"),oe(h("canvas.error"));return}const mt=await Pe(`/canvas/${ye}/revisions/${be}`);if(K!==Te.current)return;const Ee=mt.status===200?c_(mt.body):null;if(!Ee){W("error"),oe(h("canvas.error"));return}const De=await WR(ce.current,Ee,async Me=>{const Ve=await fetch(pb(tt,be,Me),{credentials:"omit",cache:"no-store"});if(!Ve.ok)throw new Error(h("canvas.error"));return new Uint8Array(await Ve.arrayBuffer())});if(K===Te.current){if(!De.ok){ce.current=De.cache,W("error"),oe(h("canvas.error"));return}ce.current=De.cache,re(Me=>e_(Me,{ok:!0,src:pb(tt,Ee.revision,Ee.entry)})),O(Ee.revision),W("ready")}}ee.current=ue;const ve=E.useMemo(()=>QR(p,r),[p,r]),ze=E.useMemo(()=>({byTicket:ve.byTicket,loose:ve.loose,open:(ye,be)=>{const K=P.current,de=K!=null&&performance.now()-K.at<n_;A(de?{x:K.x,y:K.y}:null),S.current==null&&(N(!1),re(""),W("idle")),B.current+=1,q({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(i_,{title:Ie.title,revisions:L,activeRevision:le,phase:Y,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&&G(gb(be.body))}),Pe(`/canvas?sessionId=${encodeURIComponent(t)}`).then(be=>{be.status===200&&y(yb(be.body))}))})},onClose:()=>x(null),origin:ie,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 h_({children:t}){const[i]=E.useState(V0);return m.jsx(Y0.Provider,{value:i,children:t})}function m_({src:t,alt:i="",title:r}){const{t:a}=et(),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),q=E.useRef(null),B=i||a("image.untitled");E.useEffect(()=>{if(!g||v)return;const A=document.activeElement instanceof HTMLElement?document.activeElement:null,L=document.body.style.overflow;document.body.style.overflow="hidden",N.current?.focus();const G=O=>{if(O.key==="Escape"&&(O.preventDefault(),O.stopPropagation(),w(!1)),O.key!=="Tab")return;const Y=[...T.current?.querySelectorAll('button, [href], [tabindex="0"]')??[]],W=Y[0],ke=Y.at(-1);O.shiftKey&&(document.activeElement===W||!T.current?.contains(document.activeElement))?(O.preventDefault(),ke?.focus()):!O.shiftKey&&(document.activeElement===ke||!T.current?.contains(document.activeElement))&&(O.preventDefault(),W?.focus())},le=O=>{T.current?.contains(O.target)||N.current?.focus()};return document.addEventListener("keydown",G,!0),document.addEventListener("focusin",le),()=>{document.removeEventListener("keydown",G,!0),document.removeEventListener("focusin",le),document.body.style.overflow=L,A?.isConnected?A.focus():j.current?.focus()}},[g,v]),E.useEffect(()=>{S(!1),w(!1)},[t]);function P(){S(A=>!A),q.current&&(q.current.scrollLeft=0,q.current.scrollTop=0)}function ie(){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:ie}),m.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:a("image.enlarge")})]}),g&&Sl.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:P,"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:q,className:x?"image-lightbox-stage original":"image-lightbox-stage",tabIndex:0,role:"region","aria-label":a(x?"image.scroll":"image.fit"),children:m.jsx("img",{src:t,alt:i,title:r,draggable:!1,onError:ie})})]})}),document.body)]})}function p_({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 y_({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(p_,{text:a,language:o?.[1]})}return m.jsx("pre",{children:t})}function g_(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}),v_={pre:y_,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(m_,{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}=et();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:g_(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 b_(t,i){if(!i)return t;const r=t.match(/```/g);return r&&r.length%2===1?`${t}
|
|
54
|
+
\`\`\``:t}function Fs({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(rA,{remarkPlugins:[AR],components:v_,urlTransform:u=>MR(u,f0),children:b_(t,i)})})})}const x_=E.lazy(()=>VE(()=>import("./SourceEditor-D5hkHEda.js").then(t=>t.S),__vite__mapDeps([0,1]))),w_=50*1024*1024,F0="dsh-bot.files-drawer-width";function S_(){try{const t=localStorage.getItem(F0);return t==null||t===""?Ms:Ea(Number(t))}catch{return Ms}}function k_(t){try{localStorage.setItem(F0,String(t))}catch{}}function E_({open:t,sessionId:i,focus:r,onClose:a}){const{t:o}=et(),[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,q]=E.useState(null),[B,P]=E.useState(0),[ie,A]=E.useState(S_),L=E.useRef(ie),[G,le]=E.useState(!1),[O,Y]=E.useState(()=>window.innerWidth),[W,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,Ze]=E.useState(""),[Ie,M]=E.useState(!1),[z,ee]=E.useState(null),[ue,ve]=E.useState(!1),[ze,ye]=E.useState(!1),[be,K]=E.useState(null),[de,tt]=E.useState(""),mt=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),rt=E.useRef(re);Ae.current=r,Ue.current=oe,rt.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 Z=window.matchMedia("(max-width: 800px)"),he=()=>ke(Z.matches);return Z.addEventListener("change",he),()=>Z.removeEventListener("change",he)},[]),E.useEffect(()=>{const Z=()=>Y(window.innerWidth);return window.addEventListener("resize",Z),()=>window.removeEventListener("resize",Z)},[]);const ae=Ea(ie);Tx({present:oe,narrow:W,motion:re,width:ae,resizing:G,viewport:O}),E.useEffect(()=>{const Z=he=>{if(he.key==="Escape"){if(z&&be==null){ee(null);return}a()}};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[a,z,be]),E.useEffect(()=>{if(!t)return;const Z=new AbortController;return c(null),Ae.current||(v(""),q(null),N("")),Pe(`/files/roots?sessionId=${encodeURIComponent(i)}`,{signal:Z.signal}).then(he=>{if(Z.signal.aborted)return;const Et=typeof he.body.workspace=="string"?he.body.workspace:null,yt=typeof he.body.home=="string"?he.body.home:null,ot=typeof he.body.workspaceReason=="string"?he.body.workspaceReason:"",Mt=typeof he.body.homeReason=="string"?he.body.homeReason:"";if(c({workspace:Et,workspaceReason:ot,home:yt,homeReason:Mt}),Ae.current)return;const jt=bv({workspace:Et,home:yt,workspaceReason:ot});jt.kind==="path"?(p(jt.root),v(jt.path)):(S("error"),N(o(jt.notice)))}).catch(()=>{Z.signal.aborted||(S("error"),N(o("files.failed")))}),()=>Z.abort()},[t,i,o]),E.useEffect(()=>{if(!t||!r||!u)return;const Z=T_(u.workspace,r.path);if(!Z){const Mt=bv(u);S("error"),N(o(Mt.kind==="unavailable"?Mt.notice:"files.missing"));return}const he=++Ve.current,Et=new AbortController,yt=Z.split("/").filter(Boolean).at(-1)??Z,ot=N_(Z,u.workspace,u.home);return Te(r.line),N(""),ot&&p(ot),Pe(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(Z)}`,{signal:Et.signal}).then(Mt=>{if(!(he!==Ve.current||!Me.current)){if(Mt.status===200&&Array.isArray(Mt.body.items)){Te(void 0),Ze(""),q(null),S("loading"),(Mt.body.root==="workspace"||Mt.body.root==="home")&&p(Mt.body.root),v(typeof Mt.body.path=="string"?Mt.body.path:Z);return}return Ze(Z),v(C_(Z)),Q(Z,yt,0,he)}}).catch(()=>{he!==Ve.current||!Me.current||Et.signal.aborted||q({kind:"error",path:Z,name:yt})}),()=>Et.abort()},[t,r,u,i,o]),E.useEffect(()=>{if(!y)return;const Z=new AbortController;return S("loading"),N(""),Pe(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(y)}`,{signal:Z.signal}).then(he=>{if(Z.signal.aborted)return;if(he.status!==200||!Array.isArray(he.body.items)){w([]),S("error"),N(Eu(he.body.error,o));return}const Et=typeof he.body.path=="string"?he.body.path:y;w(he.body.items.filter(__)),S("ready"),(he.body.root==="workspace"||he.body.root==="home")&&p(he.body.root),Et!==y&&v(Et)}).catch(()=>{Z.signal.aborted||(S("error"),N(o("files.failed")))}),()=>Z.abort()},[y,i,B,o]);function Be(Z){De.current&&URL.revokeObjectURL(De.current),De.current=Z}function ft(Z){const he=Z==="workspace"?u?.workspace:u?.home;he&&(p(Z),q(null),ee(null),he!==y&&(S("loading"),v(he)))}async function Qt(Z){const he=xh(y,Z.name);if(Z.kind==="file"){await Q(he,Z.name,Z.size);return}if(Z.kind==="link"){const Et=await Pe(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(he)}`);if(!Me.current)return;if(Et.status!==200){if(Et.body.error==="not_directory"){await Q(he,Z.name,Z.size);return}N(Eu(Et.body.error,o));return}q(null),S("loading"),v(typeof Et.body.path=="string"?Et.body.path:he);return}q(null),S("loading"),v(he)}async function Bt(Z){const he=await Pe(`/files?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(Z)}`);if(Me.current){if(he.status===200&&Array.isArray(he.body.items)){q(null),S("loading"),(he.body.root==="workspace"||he.body.root==="home")&&p(he.body.root),v(typeof he.body.path=="string"?he.body.path:Z);return}if(he.body.error==="not_directory"){const Et=Z.split("/").filter(Boolean).at(-1)??Z;await Q(Z,Et,0);return}N(Eu(he.body.error,o))}}async function Q(Z,he,Et,yt=++Ve.current){const ot=()=>Me.current&&yt===Ve.current;q({kind:"loading",path:Z,name:he});const Mt=M_(he);if(Mt){try{const jl=await fetch(Lu(i,Z));if(!ot())return;if(!jl.ok){q({kind:"error",path:Z,name:he});return}const tr=URL.createObjectURL(new Blob([await jl.arrayBuffer()],{type:Mt}));if(!ot()){URL.revokeObjectURL(tr);return}Be(tr),q({kind:"image",path:Z,name:he,url:tr})}catch{ot()&&q({kind:"error",path:Z,name:he})}return}const jt=await Pe(`/files/text?sessionId=${encodeURIComponent(i)}&path=${encodeURIComponent(Z)}`);if(ot()){if(jt.status===415||jt.body.error==="binary"){q({kind:"binary",path:Z,name:he,size:Et});return}if(jt.status!==200||typeof jt.body.text!="string"){q({kind:"error",path:Z,name:he});return}q({kind:"text",path:Z,name:he,text:jt.body.text,eof:jt.body.eof!==!1})}}function se(Z){if(be==null){if(Z.size>w_){N(o("files.tooLarge")),ee(null);return}N(""),ve(!1),ye(!1),K(null),ee(Z)}}async function Oe(){if(!(!z||!y||be!=null)){K(0),N("");try{const Z=await D_(i,y,z,ue,K);if(!Me.current)return;if(Z.status===409){ye(!0),N(o("files.exists")),K(null);return}if(Z.status!==201||typeof Z.body.path!="string"){N(Eu(Z.body.error,o)),K(null);return}ee(null),K(null),P(he=>he+1)}catch{if(!Me.current)return;N(o("files.failed")),K(null)}}}const Ne=E.useRef(null),we=E.useRef(0),[pe,Le]=E.useState(null),[Ke,st]=E.useState(!1);E.useEffect(()=>{let Z=null;if(j?j.kind!=="loading"&&(Z={kind:"file",key:`file:${j.path}`,path:y,root:h,preview:j}):y&&x!=="loading"&&(Z=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:""}),!Z){!y&&!j&&(Ne.current=null,Le(null)),st(!1);return}const he=Ne.current;if(he?.key===Z.key){if(he.root===Z.root&&he.path===Z.path&&(he.kind==="file"&&Z.kind==="file"?he.preview===Z.preview:he.kind==="list"&&Z.kind==="list"&&he.items===Z.items&&he.error===Z.error))return;Ne.current=Z,Le(Z);return}if(!he||window.matchMedia("(prefers-reduced-motion: reduce)").matches){Ne.current=Z,Le(Z),st(!1);return}const Et=++we.current;st(!0);const yt=window.setTimeout(()=>{we.current===Et&&(Ne.current=Z,Le(Z),st(!1))},200);return()=>window.clearTimeout(yt)},[j,g,x,y,h,T,o]),E.useEffect(()=>{const Z=pe?.kind==="file"&&pe.preview.kind==="image",he=j?.kind==="image"||j?.kind==="loading";Z||he||!De.current||(URL.revokeObjectURL(De.current),De.current="")},[pe,j]);const bt=pe?.root??h,vt=pe?.path||y,xn=bt==="workspace"?u?.workspace:u?.home,Nt=xn?R_(xn,vt):[],Ct=pe?.kind==="file"?{name:pe.preview.name,path:pe.preview.path}:null,pt=pe?.kind==="list"?pe.error:"";function Ft(Z){navigator.clipboard.writeText(Z).then(()=>{tt(Z),window.setTimeout(()=>tt(he=>he===Z?"":he),1e3)})}const pi=z!=null&&(ze||g.some(Z=>Z.name===z.name)),Vn=be!=null;return oe?Sl.createPortal(m.jsxs("div",{className:W?`files-drawer narrow files-drawer-${re}`:`files-drawer files-drawer-${re}${G?" resizing":""}`,style:W?void 0:{width:ae},role:"dialog","aria-label":o("files.title"),onAnimationEnd:Z=>{Z.target!==Z.currentTarget||Z.animationName!=="files-drawer-out"||rt.current==="out"&&ge(!1)},onDragEnter:Z=>{Z.preventDefault(),mt.current+=1,M(!0)},onDragOver:Z=>Z.preventDefault(),onDragLeave:()=>{mt.current-=1,mt.current<=0&&(mt.current=0,M(!1))},onDrop:Z=>{Z.preventDefault(),mt.current=0,M(!1);const he=Z.dataTransfer.files[0];he&&se(he)},children:[W?null:m.jsx("div",{className:"files-resize",onPointerDown:Z=>{Z.preventDefault(),Z.currentTarget.setPointerCapture(Z.pointerId),le(!0);const he=yt=>{const ot=Ea(window.innerWidth-yt.clientX);L.current=ot,A(ot)},Et=()=>{le(!1),k_(L.current),window.removeEventListener("pointermove",he),window.removeEventListener("pointerup",Et)};window.addEventListener("pointermove",he),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(L_,{})}),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||vb(u?.homeReason,o),onClick:()=>ft("home"),children:m.jsx(H_,{})}),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??vb(u?.workspaceReason,o),onClick:()=>ft("workspace"),children:m.jsx(U_,{})})]}),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((Z,he)=>m.jsxs("span",{children:[he>0?m.jsx("span",{"aria-hidden":"true",children:"/"}):null,m.jsx("button",{type:"button",title:Z.path,onClick:()=>{Z.path===y&&!j||(q(null),Z.path!==y&&(S("loading"),v(Z.path)))},children:Z.name})]},Z.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,vt?m.jsx("button",{type:"button",className:"files-icon-btn files-crumb-copy","aria-label":o("files.pathHint"),title:de===(Ct?.path||vt)?o("files.copied"):o("files.pathHint"),onClick:()=>Ft(Ct?.path||vt),children:de===(Ct?.path||vt)?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||Vn,onClick:()=>Ee.current?.click(),children:m.jsx(Y_,{})}),m.jsx("input",{ref:Ee,type:"file",hidden:!0,onChange:Z=>{const he=Z.target.files?.[0];Z.target.value="",he&&se(he)}})]}),T&&T!==pt?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:Ke?"files-stage out":"files-stage in",children:pe.kind==="file"?m.jsx(j_,{preview:pe.preview,sessionId:i,line:pe.preview.path===R?xe:void 0,onOpenPath:Z=>{Bt(Z)}}):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(B_,{})}),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(Z=>m.jsxs("div",{className:"files-row",role:"row",children:[m.jsxs("button",{type:"button",className:"files-name",onClick:()=>{Qt(Z)},children:[m.jsx("span",{className:Z.kind==="dir"?"files-mark dir":"files-mark",children:z_(Z.kind)}),m.jsx("span",{children:Z.name})]}),m.jsx("span",{className:"files-col-type",children:O_(Z,o)}),m.jsx("span",{className:"files-col-size",children:Z.kind==="file"?wh(Z.size):"—"}),m.jsx("span",{className:"files-col-time",children:q_(Z.mtime)}),m.jsx("span",{className:"files-row-actions",children:Z.kind==="file"?m.jsxs("a",{className:"files-action",href:Lu(i,xh(y,Z.name)),children:[m.jsx(Q0,{}),o("files.download")]}):null})]},Z.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}),Vn?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,pi?m.jsxs("label",{className:"files-check",children:[m.jsx("input",{type:"checkbox",checked:ue,disabled:Vn,onChange:Z=>ve(Z.target.checked)}),o("files.overwrite")]}):null,m.jsxs("div",{className:"files-confirm-actions",children:[m.jsx("button",{type:"button",disabled:Vn,onClick:()=>ee(null),children:o("files.cancel")}),m.jsx("button",{type:"button",className:"primary",disabled:Vn||pi&&!ue,onClick:()=>{Oe()},children:o("files.upload")})]})]}):null]}),document.body):null}function j_({preview:t,sessionId:i,line:r,onOpenPath:a}){const{t:o}=et(),u=t.kind==="text"&&YE(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(I_,{}),o("files.previewMode")]}),m.jsxs("button",{type:"button",className:"files-action","aria-pressed":c==="source",onClick:()=>h("source"),children:[m.jsx(V_,{}),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:Lu(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(x_,{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(Fs,{text:v,onOpenFile:x=>{const S=x.startsWith("/")?x:G0(t.path,x);S&&a(S)},resolveImage:x=>A_(i,t.path,x)}),g?null:m.jsx("p",{className:"file-modal-note",children:o("files.truncated")})]})]})}function vb(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 T_(t,i){const r=i.replace(/^\.\//,"");return r.startsWith("/")?r:t?xh(t,r):null}function N_(t,i,r){return i&&(t===i||t.startsWith(`${i}/`))?"workspace":r&&(t===r||t.startsWith(`${r}/`))?"home":null}function C_(t){const i=t.lastIndexOf("/");return i<=0?"/":t.slice(0,i)}function A_(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`${Lu(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 R_(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 Lu(t,i){return`/dsh-bot/api/files/raw?sessionId=${encodeURIComponent(t)}&path=${encodeURIComponent(i)}`}function __(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 Eu(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 O_(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 z_(t){return t==="dir"?"▸":t==="link"?"↗":"·"}function M_(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 q_(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 D_(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 L_(){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 B_(){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 U_(){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 H_(){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 I_(){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 V_(){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 Y_(){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 F_({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}=et();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 q=await Pe("/sessions",{method:"POST",headers:{"content-type":"application/json","idempotency-key":crypto.randomUUID()},body:JSON.stringify({name:j})}),B=typeof q.body.sessionId=="string"?q.body.sessionId:"";if(!B){const G=q.body.upstream;g(G?.message||String(q.body.error||S("new.createFailed"))),y(!1);return}const P=Ik(j,o,c),ie=await Ri("/dsh-bot/api/sessions/open",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:B,personaText:P,idempotencyKey:crypto.randomUUID()})});if(ie.body.ok!==!0){g(Jb(ie.body,S("new.personaFailed"))),y(!1);return}const A=c.trim()||S("new.kickoff"),L=await Pe("/tasks",{method:"POST",headers:{"content-type":"application/json","idempotency-key":crypto.randomUUID()},body:JSON.stringify({sessionId:B,text:A})});if(L.status!==202){const G=L.body.execution,le=L.body.task;g(G?.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 G_(t,i){const{t:r}=et(),[a,o]=E.useState("");return E.useEffect(()=>{if(t===""){o("");return}let u=!1;return(async()=>{const c=await Ri(`/dsh-bot/api/status?sessionId=${encodeURIComponent(t)}`),h=await Ri(`/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=Vk(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 nc(t){const i=t.replace(/\r\n/g,`
|
|
55
55
|
`);if(!i.startsWith("[foundations:message]"))return null;const r=i.slice(21).replace(/^\n/,""),a=r.indexOf(`
|
|
56
56
|
---
|
|
57
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 $_=new Set(["foundations_send","foundations_reply"]);function K0(t){const i=[];for(const r of t){if(r.kind==="user"){const o=nc(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"||!$_.has(r.name))continue;const a=K_(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 X_(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 Q_(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 Z_(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 K_(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 J_({mail:t,label:i,onOpenFile:r}){const{t:a}=
|
|
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(Fs,{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 P_({who:t,preview:i,time:r,mark:a,onOpen:o}){const{t:u}=
|
|
60
|
-
`)[0]??"").trim():""}function oO(t){if(!t||typeof t!="object"||Array.isArray(t))return null;const i=t,r=
|
|
61
|
-
`).length}function cO(t){return t.length<=3?t.join(", "):`${t[0]} + ${t.length-1} files`}function xb(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 fO=El(["read"],(t,i)=>{const r=_n(i.file_path)||_n(i.path),a=oO(t.meta)??(t.result?uO(t.result):null),o=a?.path||r;if(!o)return null;let u="";if(a&&a.end>=a.start)u=bb(a.start,a.end);else{const c=wh(i.offset),h=wh(i.limit);h!=null?u=bb(c??1,(c??1)+h-1):c!=null&&(u=`L${c}`)}return{path:Br(o),span:u}},t=>[t.path?`Read ${t.path}`:"Read",t.span].filter(i=>i!=="").join(" ")),dO=El(["edit","apply_patch","str_replace_editor"],(t,i)=>{const r=_n(i.file_path)||_n(i.path);return r?{path:Br(r),added:ja(xb(i,["new_string","new_str","content","file_text"])),removed:ja(xb(i,["old_string","old_str"]))}:null},t=>["Edit",t.path,e1(t.added,t.removed)].filter(i=>i!=="").join(" ")),hO=El(["write"],(t,i)=>{const r=_n(i.file_path)||_n(i.path);return r?{path:Br(r),added:ja(typeof i.content=="string"?i.content:"")}:null},t=>["Write",t.path,t.added>0?`+${t.added}`:""].filter(i=>i!=="").join(" ")),mO=El(["grep"],(t,i)=>{const r=_n(i.pattern)||_n(i.query);return r?{pattern:r.length>48?`${r.slice(0,48)}…`:r,where:Br(_n(i.path)||_n(i.glob))}:null},t=>["Grep",t.pattern,t.where?`in ${t.where}`:""].filter(i=>i!=="").join(" ")),pO=El(["canvas_read"],(t,i)=>({path:Br(_n(i.path))}),t=>t.path?`canvas_read ${t.path}`:"canvas_read files"),yO=El(["canvas_edit"],(t,i)=>{const r=_n(i.path);return r?{path:Br(r),added:ja(typeof i.replacement=="string"?i.replacement:""),removed:ja(typeof i.old=="string"?i.old:"")}:null},t=>["canvas_edit",t.path,e1(t.added,t.removed)].filter(i=>i!=="").join(" ")),gO=El(["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=_n(y.path);v&&(a.push(Br(v)),typeof y.text=="string"&&(o+=1,u+=ja(y.text)))}const c=Array.isArray(i.remove)?i.remove.flatMap(p=>{const y=typeof p=="string"?_n(p):"";return y?[Br(y)]:[]}):[];if(a.length===0&&c.length===0)return null;const h=c.slice(0,2).join(", ");return{files:cO(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 vO(t){const i=t.name.toLowerCase(),r=wl(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 bO(t){return t.text}function t1(t,i,r=[]){const a=wl(t.args),o=wl(t.result),u=Kh(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(k=>k.id===w),S=Ph(t,r),T=t.name==="todo_write"&&Array.isArray(a.todos)?a.todos.flatMap(k=>{if(!k||typeof k!="object")return[];const M=k;return typeof M.content=="string"&&typeof M.status=="string"?[{content:M.content,status:M.status}]:[]}):[],C=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:vO(t),args:aO(t.args),output:t.result,exitCode:C?Number(C[1]):null,ticket:x,ticketId:w,latestReport:x?.events.filter(k=>k.revision===x.revision&&k.applyStatus!=="stale").at(-1)?.text??"",jobId:u?/(?:^started background job |moved to background job )([^\s\]]+)/m.exec(t.result)?.[1]??"":""}}const xO="ask_user_question";function Wh(t){return t.replace(/-/g,"_").toLowerCase()===xO}function wO(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 Zd(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 SO(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=Kd(a.question);if(o){r.display={question:o};const u=Kd(a.detail);u&&(r.display.detail=u);const c=Kd(a.approve);c&&(r.display.approve=c)}}return r}}function Kd(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 vl(t){return typeof t=="string"?t:""}function kO(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:vl(r.description),recommended:r.recommended===!0}]}):[]}function EO(t){return Array.isArray(t)?t.flatMap((i,r)=>{if(!i||typeof i!="object")return[];const a=i,o=vl(a.question);if(!o)return[];const u=vl(a.id);return[{id:u===""?`question-${r+1}`:u,question:o,detail:vl(a.detail),header:vl(a.header),options:kO(a.options),multiSelect:a.multi_select===!0||a.multiSelect===!0,intent:SO(a.intent)}]}):[]}function jO(t){const i=new Map,r=wl(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=vl(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:vl(u.custom)})}return i}function TO(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=wl(t);return!!(i&&i.pending===!0)}function NO(t){return r1(t.result)?!1:!!(t.resultReceived||t.result!==""||t.error||t.errorCode)}function CO(t){const i=t.timeout;if(!(typeof i!="number"||!Number.isFinite(i)||i<=0))return i>1e3?i:i*1e3}function Gs(t){if(!Wh(t.name))return null;const i=wl(t.args),r=EO(i.questions),a=jO(t.result),o=TO(t),u=r1(t.result),c=NO(t),h=c&&t.error&&!o,p=u?"continued":c?o?"aborted":h?"failed":"answered":"open",y=CO(i),v=u?"continued":p==="open"&&y?"counting":"none",g=r.map(S=>{const T=a.get(S.id),C=T?.selected??[],k=T?.custom??"";return{...S,selected:C,custom:k,skipped:p==="answered"&&C.length===0&&!k}}),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 AO=new Set(["accepted","enqueued","started","needs_user","ready"]),RO=new Set(["delivered","failed","cancelled"]),_O={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"},OO={accepted:"activity.ticket.scheduling",enqueued:"activity.ticket.scheduling",started:"activity.status.worker",needs_user:"activity.ticket.needsUser",ready:"activity.ticket.ready"};function Sh(t){const{segments:i,drafting:r,currentTurn:a,tickets:o=[],t:u=_i}=t,c=[],h=[],p=new Set,y=w=>a==null||w===a,v=w=>u(_O[w]);for(const w of i){if(w.kind!=="tool")continue;if(Wh(w.name)){const k=Gs(w);if(k&&l1(k.state)&&r&&y(w.turn)){c.push({text:u("question.waiting"),moving:!0});continue}}const x=Ph(w,o);if(x!=="background"&&!Ds.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?bO(S.detail):S.title),C={text:`${v(S.status)}: ${T}`,moving:S.status!=="background"};if(S.status==="background"){r&&y(w.turn)&&h.push(C);continue}Ds.has(S.status)&&(!r||!y(w.turn)||c.push(C))}t.pendingApprovals?.some(w=>w.state==="open")&&c.push({text:u("approval.waiting"),moving:!0});for(const w of o){if(p.has(w.id)||RO.has(w.status)||!AO.has(w.status))continue;p.add(w.id);const x=OO[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 zO(t){const{t:i}=We(),r=Sh({...t,t:i}),[a,o]=j.useState(()=>typeof document>"u"||document.visibilityState!=="hidden");return j.useEffect(()=>{const u=()=>o(document.visibilityState!=="hidden");return document.addEventListener("visibilitychange",u),u(),()=>document.removeEventListener("visibilitychange",u)},[]),r?m.jsxs("div",{className:"composer-activity",role:"status","aria-live":"polite","aria-atomic":"true","data-moving":r.moving&&a?"true":"false",children:[m.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:m.jsx("path",{d:"M3 4h10M3 8h10M3 12h6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})}),m.jsx("span",{className:"composer-activity-text",title:r.text,children:r.text})]}):null}const a1=["persona","profile","fact","episodic","procedural","state","skill"];function MO(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 wb(t){return Array.isArray(t.entities)?t.entities.flatMap(i=>{const r=o1(i);return r?[s1(r)]:[]}):[]}function qO(t){const i=o1(t.entity);return i?s1(i):null}function DO(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 LO(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:MO(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"||!BO(i.type)?null:i}function BO(t){return typeof t=="string"&&a1.includes(t)}const u1="dsh-bot.memory-drawer-width",em={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"},UO={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 HO(){try{const t=localStorage.getItem(u1);return t==null||t===""?Ms:Ea(Number(t))}catch{return Ms}}function IO(t){try{localStorage.setItem(u1,String(t))}catch{}}function VO({open:t,sessionId:i,onClose:r}){const{t:a}=We(),[o,u]=j.useState(""),[c,h]=j.useState(""),[p,y]=j.useState("all"),[v,g]=j.useState("all"),[w,x]=j.useState("all"),[S,T]=j.useState([]),[C,k]=j.useState(null),[M,L]=j.useState(!1),[P,ie]=j.useState([]),[A,F]=j.useState("auto"),[X,le]=j.useState([]),[O,V]=j.useState(null),[W,ke]=j.useState(null),[oe,ge]=j.useState(!0),[re,ce]=j.useState(""),[xe,Te]=j.useState(0),[R,Ze]=j.useState(HO),Ie=j.useRef(R),[q,z]=j.useState(!1),[ee,ue]=j.useState(()=>window.innerWidth),[ve,ze]=j.useState(()=>window.matchMedia("(max-width: 800px)").matches),[ye,be]=j.useState(t),[K,de]=j.useState(t?"in":"out"),et=j.useRef(ye),mt=j.useRef(K);et.current=ye,mt.current=K;const Ee=Ea(R);Tx({present:ye,narrow:ve,motion:K,width:Ee,resizing:q,viewport:ee}),j.useEffect(()=>{if(t){be(!0),de("in");return}if(et.current){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){be(!1);return}de("out")}},[t]),j.useEffect(()=>{const ae=window.matchMedia("(max-width: 800px)"),Be=()=>ze(ae.matches);return ae.addEventListener("change",Be),()=>ae.removeEventListener("change",Be)},[]),j.useEffect(()=>{const ae=()=>ue(window.innerWidth);return window.addEventListener("resize",ae),()=>window.removeEventListener("resize",ae)},[]),j.useEffect(()=>{u(""),h(""),V(null),ke(null),F("auto"),T([]),ie([]),le([]),k(null)},[i]),j.useEffect(()=>{const ae=setTimeout(()=>h(o.trim()),200);return()=>clearTimeout(ae)},[o]),j.useEffect(()=>{if(!t)return;let ae=!1;return ge(!0),ce(""),Ri(Sb(i,{query:c,scope:p,lifecycle:v,type:w},null)).then(Be=>{if(!ae){if(Be.status!==200||Be.body.ok===!1){T([]),k(null),ce(kb(Be.status,a)),ge(!1);return}T(wb(Be.body)),k(typeof Be.body.nextCursor=="string"?Be.body.nextCursor:null),L(Be.body.capped===!0),ge(!1)}}),()=>{ae=!0}},[t,i,c,p,v,w,xe,a]),j.useEffect(()=>{if(!t)return;let ae=!1;return Ri(`/dsh-bot/api/memory/frames?sessionId=${encodeURIComponent(i)}`).then(Be=>{ae||Be.body.ok===!1||ie(DO(Be.body))}),()=>{ae=!0}},[t,i,xe]);const De=A==="none"?null:A==="auto"?P[0]?.revision??null:A,Me=S.map(ae=>ae.id).join(",");j.useEffect(()=>{if(!t||De==null||Me===""){le([]);return}let ae=!1;const Be=new URLSearchParams({sessionId:i,revision:String(De),ids:Me});return Ri(`/dsh-bot/api/memory/context?${Be}`).then(ft=>{ae||ft.body.ok===!1||le(LO(ft.body))}),()=>{ae=!0}},[t,i,De,Me]),j.useEffect(()=>{if(!t||O==null){ke(null);return}let ae=!1;const Be=new URLSearchParams({sessionId:i});return Ri(`/dsh-bot/api/memory/entities/${encodeURIComponent(O)}?${Be}`).then(ft=>{ae||ke(ft.body.ok===!1?null:qO(ft.body))}),()=>{ae=!0}},[t,i,O,xe]),j.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(C==null)return;const ae=await Ri(Sb(i,{query:c,scope:p,lifecycle:v,type:w},C));if(ae.status!==200||ae.body.ok===!1){ce(kb(ae.status,a));return}T(Be=>[...Be,...wb(ae.body)]),k(typeof ae.body.nextCursor=="string"?ae.body.nextCursor:null)}const Ae=S.find(ae=>ae.id===O)??null,Ue=W&&W.id===O?W:Ae,rt=ae=>De==null?null:X.find(Be=>Be.id===ae)??{id:ae,form:"unknown",reason:"no_manifest"};return ye?Sl.createPortal(m.jsxs("div",{className:ve?`files-drawer narrow files-drawer-${K}`:`files-drawer files-drawer-${K}${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"||mt.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=Qt=>{const Bt=Ea(window.innerWidth-Qt.clientX);Ie.current=Bt,Ze(Bt)},ft=()=>{z(!1),IO(Ie.current),window.removeEventListener("pointermove",Be),window.removeEventListener("pointerup",ft)};window.addEventListener("pointermove",Be),window.addEventListener("pointerup",ft)}}),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(QO,{})}),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(ZO,{})})]}),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(em[ae])},ae))]}),P.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;F(Be==="none"?"none":Number(Be))},children:[m.jsx("option",{value:"none",children:a("memory.frame.unselected")}),P.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(FO,{entity:Ue,citation:rt(Ue.id),sourceReady:W?.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(KO,{})}),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(YO,{entity:ae,selected:ae.id===O,t:a,onSelect:V},ae.id))]}),C?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 YO({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(XO,{type:t.type}),m.jsx("span",{children:o})]}),m.jsx("span",{className:"files-col-type",children:r(em[t.type])}),m.jsx("span",{className:"files-col-size",children:r(c1[t.lifecycle])}),m.jsx("span",{className:"files-col-time",title:e4(t.updatedAt),children:Ls(t.updatedAt,r("memory.missing"))})]})}function FO({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(em[t.type]),m.jsx("span",{"aria-hidden":"true",children:" · "}),a(UO[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(GO,{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($O,{source:t.source,t:a}):null,i?m.jsx("p",{className:"memory-cite-reason",children:a(JO(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:[WO(h.tool,a)," · ",Ls(h.at,a("memory.missing"))]},h.id))})]}):null]})]})}function GO({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:Ls(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 $O({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(PO(t.creator))}),t.createdAt?m.jsx("p",{children:i("memory.source.created",{time:Ls(t.createdAt,i("memory.missing"))})}):null,t.updatedAt?m.jsx("p",{children:i("memory.source.updated",{time:Ls(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 XO({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 QO(){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 ZO(){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 KO(){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 Sb(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 kb(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 JO(t){return t==="no_frame"?"memory.cite.reason.no_frame":"memory.cite.reason.no_manifest"}function PO(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 WO(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 Ls(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 e4(t){if(!t)return;const i=new Date(t);if(!Number.isNaN(i.getTime()))return i.toLocaleString()}function kh(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 Eb(t,i,r){const a=kh(t,r);return a!==t?a:i&&i!==""?i:t}function tm({title:t,closeLabel:i,onClose:r,children:a,className:o}){j.useEffect(()=>{if(typeof document>"u")return;const c=document.body.style.overflow;document.body.style.overflow="hidden";const h=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:Sl.createPortal(u,document.body)}function t4({sessionId:t,current:i,onClose:r,onChanged:a}){const{t:o}=We(),[u,c]=j.useState(null),[h,p]=j.useState(null),[y,v]=j.useState(""),[g,w]=j.useState(!1);j.useEffect(()=>{nt(`/permissions?sessionId=${encodeURIComponent(t)}`).then(k=>c(k.body))},[t]);async function x(k){w(!0),v("");try{const M=await nt("/permissions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:t,name:k})});if(M.status===200&&M.body.ok!==!1){c(M.body),p(null),typeof M.body.currentValue=="string"&&a?.(M.body.currentValue);return}v(typeof M.body.message=="string"?M.body.message:o("permission.failed"))}catch{v(o("permission.failed"))}finally{w(!1)}}function S(k){if(!(k.value===u?.currentValue||k.value==="custom")){if(k.value==="danger-full-access"||k.value==="auto"){p(k);return}x(k.value)}}const T=u?.options??[],C=T.find(k=>k.value===(u?.currentValue??i));return m.jsxs(tm,{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"),":"," ",Eb(u?.currentValue??i??"",C?.name,o)||"—"]}):null,m.jsx("ul",{className:"user-question-options",children:T.map(k=>m.jsx("li",{children:m.jsxs("button",{type:"button",className:k.value===u?.currentValue?"user-question-option selected":"user-question-option",disabled:g||k.value==="custom",onClick:()=>S(k),children:[m.jsx("span",{className:"user-question-option-label",children:Eb(k.value,k.name,o)}),k.description?m.jsx("span",{className:"user-question-option-desc",children:k.description}):null]})},k.value))}),h?m.jsxs("div",{className:"settings-confirm",children:[m.jsx("p",{className:"user-question-text",children:o("permission.confirmTitle")}),m.jsx("p",{className:"user-question-hint",children:h.value==="auto"?o("permission.confirmAuto"):o("permission.confirmFull")}),m.jsxs("div",{className:"user-question-row",children:[m.jsx("button",{type:"button",className:"user-question-skip",disabled:g,onClick:()=>p(null),children:o("permission.cancel")}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:g,onClick:()=>{x(h.value)},children:o("permission.confirm")})]})]}):null,y?m.jsx("p",{className:"user-question-status exception",children:y}):null]})}function n4({onClose:t,authorization:i,catalog:r}){const{t:a}=We(),[o,u]=j.useState(!0),[c,h]=j.useState([]),[p,y]=j.useState([]),[v,g]=j.useState([]),[w,x]=j.useState({}),[S,T]=j.useState(""),[C,k]=j.useState(!1),[M]=j.useState(()=>J0(async()=>{const O=await nt("/authorization");if(O.status!==200)throw new Error("Authorization catalog unavailable");return O.body})),L=r??M,P=j.useRef(!0),ie=j.useRef(0);async function A(O=!1){if(document.hidden)return;O&&L.invalidate();const V=++ie.current;try{const W=await L.get();if(!P.current||V!==ie.current)return;u(W.available!==!1),h(Array.isArray(W.entries)?W.entries:[]),i||(y(Array.isArray(W.notices)?W.notices:[]),g(Array.isArray(W.prompts)?W.prompts:[]))}catch{P.current&&V===ie.current&&T(a("auth.failed"))}}j.useEffect(()=>{i&&(u(i.available!==!1),(Array.isArray(i.prompts)&&i.prompts.length>0||Array.isArray(i.inFlight)&&i.inFlight.length>0)&&k(!1),y(Array.isArray(i.notices)?i.notices:[]),g(Array.isArray(i.prompts)?i.prompts:[]))},[i]),j.useEffect(()=>{P.current=!0,A();const O=()=>{document.hidden||A(!0)},V=window.setInterval(()=>{A()},3e4);return document.addEventListener("visibilitychange",O),()=>{P.current=!1,ie.current++,window.clearInterval(V),document.removeEventListener("visibilitychange",O)}},[L,i?.catalogRevision]);async function F(O,V){k(!0),T("");try{const W=await nt("/authorization/begin",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:O.key,method:V})});(W.status!==200||W.body.ok===!1)&&T(typeof W.body.message=="string"?W.body.message:a("auth.failed")),await A(!0)}catch{T(a("auth.failed"))}finally{k(!1)}}async function X(O,V=!1,W){k(!0),T("");try{const ke=await nt("/authorization/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({promptId:O.promptId,value:V?void 0:W??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{k(!1)}}async function le(O){k(!0);try{await nt("/authorization/cancel",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:O.key})}),await A(!0)}finally{k(!1)}}return m.jsxs(tm,{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:C,onClick:()=>{X(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:C,onChange:V=>x(W=>({...W,[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:C,onChange:V=>x(W=>({...W,[O.promptId]:V.target.value}))})}),m.jsxs("div",{className:"user-question-row",children:[m.jsx("button",{type:"button",className:"user-question-skip",disabled:C,onClick:()=>{X(O,!0)},children:a("auth.cancel")}),O.kind!=="select"?m.jsx("button",{type:"button",className:"user-question-submit",disabled:C||O.kind!=="secret"&&!(w[O.promptId]??"").trim(),onClick:()=>{X(O)},children:a("auth.writeVault")}):null]})]},O.promptId)),c.map(O=>{const V={...O,inFlight:O.inFlight||Array.isArray(i?.inFlight)&&i.inFlight.some(W=>JSON.stringify(W)===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(W=>m.jsx("button",{type:"button",className:"user-question-submit",disabled:C||V.inFlight,onClick:()=>{F(V,W.id)},children:W.label||a("auth.start")},W.id)),V.inFlight?m.jsx("button",{type:"button",className:"user-question-skip",disabled:C,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 i4({onClose:t}){const{t:i,locale:r}=We(),[a,o]=j.useState(!1),[u,c]=j.useState(!1),[h,p]=j.useState(null),[y,v]=j.useState([]),[g,w]=j.useState([]),[x,S]=j.useState(""),[T,C]=j.useState(!1);async function k(){const L=await nt(`/cua?locale=${encodeURIComponent(r)}`);c(!0),o(L.body.available===!0);const P=L.body.systemStatus;p(P&&typeof P=="object"?P:null);const ie=L.body.applications;if(ie&&typeof ie=="object"){const A=ie;v(Array.isArray(A.allowedApps)?A.allowedApps:[]),w(Array.isArray(A.blockedApps)?A.blockedApps:[])}}j.useEffect(()=>{k()},[r]);async function M(L,P={}){C(!0),S("");try{const ie=await nt("/cua",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:L,locale:r,...P})});(ie.status!==200||ie.body.ok===!1)&&S(typeof ie.body.message=="string"?ie.body.message:i("cua.failed")),await k()}catch{S(i("cua.failed"))}finally{C(!1)}}return u&&!a?null:m.jsxs(tm,{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(L=>m.jsxs("div",{className:"user-question-row",children:[m.jsxs("p",{className:"user-question-text",children:[i(L==="accessibility"?"cua.accessibility":"cua.screenRecording"),m.jsx("span",{className:"user-question-hint",children:h?.[L]?i("cua.granted"):i("cua.missing")})]}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:T,onClick:()=>{M("requestPermission",{permission:L})},children:i("cua.request")}),m.jsx("button",{type:"button",className:"user-question-skip",disabled:T,onClick:()=>{M("openSettings",{permission:L})},children:i("cua.openSettings")})]},L)),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(L=>m.jsxs("div",{className:"user-question-row",children:[m.jsx("p",{className:"user-question-text",children:L.name}),m.jsx("button",{type:"button",className:"user-question-skip",disabled:T,onClick:()=>{M("revoke",{id:L.id})},children:i("cua.revoke")})]},L.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(L=>m.jsxs("div",{className:"user-question-row",children:[m.jsx("p",{className:"user-question-text",children:L.name}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:T,onClick:()=>{M("retryApproval",{id:L.id})},children:i("cua.askAgain")})]},L.id)),x?m.jsx("p",{className:"user-question-status exception",children:x}):null]})}function r4(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
|
|
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 $_=new Set(["foundations_send","foundations_reply"]);function K0(t){const i=[];for(const r of t){if(r.kind==="user"){const o=nc(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"||!$_.has(r.name))continue;const a=K_(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 X_(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 Q_(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 Z_(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 K_(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 J_({mail:t,label:i,onOpenFile:r}){const{t:a}=et(),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(Fs,{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 P_({who:t,preview:i,time:r,mark:a,onOpen:o}){const{t:u}=et(),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(iO,{})}),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 W_({items:t,botLabel:i,onOpenFile:r}){const{locale:a}=et();return m.jsxs("div",{className:"bot-chat",children:[m.jsx(tO,{}),t.length===0?m.jsx(nO,{}):null,t.map(o=>o.kind==="in"?m.jsxs("div",{className:"mail-row",children:[m.jsx(J_,{mail:o.mail,label:i(o.mail.from),onOpenFile:r}),Bu(o.time,a)?m.jsx("time",{children:Bu(o.time,a)}):null]},o.id):m.jsx(eO,{item:o,items:t,botLabel:i},o.id))]})}function eO({item:t,items:i,botLabel:r}){const{t:a,locale:o}=et(),u=Z_(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})}),Bu(t.time,o)?m.jsx("time",{children:Bu(t.time,o)}):null]})}function tO(){const{t}=et();return m.jsx("p",{className:"bot-chat-lead",children:t("inbox.lead")})}function nO(){const{t}=et();return m.jsx("p",{className:"empty-thread",children:t("inbox.empty")})}function Bu(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 iO(){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 rO({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 q of i){const B=x.querySelector(`[data-turn="${CSS.escape(q.id)}"]`);B instanceof HTMLElement&&B.getBoundingClientRect().top-T<=36&&(j=q.id)}u(q=>q===j?q: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(q=>q.top===N&&q.bottom===j?q:{top:N,bottom:j})},[o,v]);const{t:g}=et();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 lO(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,q=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{q(),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 Ds=new Set(["preparing","waiting","running","worker"]),P0=new Set([...Ds,"background"]);function aO(t){try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}}function wl(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 ic(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!==""?ic(t.name,t.result,t.error):t.running?"waiting":"unknown"}const sO={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 bb(t,i=_i){return i(sO[t])}function Wh(t,i=[]){const r=Ph(t);if(!vx(t.name))return r;const a=wl(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 Br(t){return t.split(/[/\\]/).map(r=>r.trim()).filter(Boolean).at(-1)??t}function _n(t){return typeof t=="string"?(t.split(`
|
|
60
|
+
`)[0]??"").trim():""}function oO(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 uO(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 El(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 xb(t,i){return i<t||i<1?"":t===i?`L${t}`:`L${t}-${i}`}function ja(t){return t===""?0:t.replace(/\n$/,"").split(`
|
|
61
|
+
`).length}function cO(t){return t.length<=3?t.join(", "):`${t[0]} + ${t.length-1} files`}function wb(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 fO=El(["read"],(t,i)=>{const r=_n(i.file_path)||_n(i.path),a=oO(t.meta)??(t.result?uO(t.result):null),o=a?.path||r;if(!o)return null;let u="";if(a&&a.end>=a.start)u=xb(a.start,a.end);else{const c=Sh(i.offset),h=Sh(i.limit);h!=null?u=xb(c??1,(c??1)+h-1):c!=null&&(u=`L${c}`)}return{path:Br(o),span:u}},t=>[t.path?`Read ${t.path}`:"Read",t.span].filter(i=>i!=="").join(" ")),dO=El(["edit","apply_patch","str_replace_editor"],(t,i)=>{const r=_n(i.file_path)||_n(i.path);return r?{path:Br(r),added:ja(wb(i,["new_string","new_str","content","file_text"])),removed:ja(wb(i,["old_string","old_str"]))}:null},t=>["Edit",t.path,e1(t.added,t.removed)].filter(i=>i!=="").join(" ")),hO=El(["write"],(t,i)=>{const r=_n(i.file_path)||_n(i.path);return r?{path:Br(r),added:ja(typeof i.content=="string"?i.content:"")}:null},t=>["Write",t.path,t.added>0?`+${t.added}`:""].filter(i=>i!=="").join(" ")),mO=El(["grep"],(t,i)=>{const r=_n(i.pattern)||_n(i.query);return r?{pattern:r.length>48?`${r.slice(0,48)}…`:r,where:Br(_n(i.path)||_n(i.glob))}:null},t=>["Grep",t.pattern,t.where?`in ${t.where}`:""].filter(i=>i!=="").join(" ")),pO=El(["canvas_read"],(t,i)=>({path:Br(_n(i.path))}),t=>t.path?`canvas_read ${t.path}`:"canvas_read files"),yO=El(["canvas_edit"],(t,i)=>{const r=_n(i.path);return r?{path:Br(r),added:ja(typeof i.replacement=="string"?i.replacement:""),removed:ja(typeof i.old=="string"?i.old:"")}:null},t=>["canvas_edit",t.path,e1(t.added,t.removed)].filter(i=>i!=="").join(" ")),gO=El(["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=_n(y.path);v&&(a.push(Br(v)),typeof y.text=="string"&&(o+=1,u+=ja(y.text)))}const c=Array.isArray(i.remove)?i.remove.flatMap(p=>{const y=typeof p=="string"?_n(p):"";return y?[Br(y)]:[]}):[];if(a.length===0&&c.length===0)return null;const h=c.slice(0,2).join(", ");return{files:cO(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 vO(t){const i=t.name.toLowerCase(),r=wl(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 bO(t){return t.text}function t1(t,i,r=[]){const a=wl(t.args),o=wl(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 q=j;return typeof q.content=="string"&&typeof q.status=="string"?[{content:q.content,status:q.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:vO(t),args:aO(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 xO="ask_user_question";function em(t){return t.replace(/-/g,"_").toLowerCase()===xO}function wO(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 Zd(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 SO(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=Kd(a.question);if(o){r.display={question:o};const u=Kd(a.detail);u&&(r.display.detail=u);const c=Kd(a.approve);c&&(r.display.approve=c)}}return r}}function Kd(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 vl(t){return typeof t=="string"?t:""}function kO(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:vl(r.description),recommended:r.recommended===!0}]}):[]}function EO(t){return Array.isArray(t)?t.flatMap((i,r)=>{if(!i||typeof i!="object")return[];const a=i,o=vl(a.question);if(!o)return[];const u=vl(a.id);return[{id:u===""?`question-${r+1}`:u,question:o,detail:vl(a.detail),header:vl(a.header),options:kO(a.options),multiSelect:a.multi_select===!0||a.multiSelect===!0,intent:SO(a.intent)}]}):[]}function jO(t){const i=new Map,r=wl(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=vl(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:vl(u.custom)})}return i}function TO(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=wl(t);return!!(i&&i.pending===!0)}function NO(t){return r1(t.result)?!1:!!(t.resultReceived||t.result!==""||t.error||t.errorCode)}function CO(t){const i=t.timeout;if(!(typeof i!="number"||!Number.isFinite(i)||i<=0))return i>1e3?i:i*1e3}function Gs(t){if(!em(t.name))return null;const i=wl(t.args),r=EO(i.questions),a=jO(t.result),o=TO(t),u=r1(t.result),c=NO(t),h=c&&t.error&&!o,p=u?"continued":c?o?"aborted":h?"failed":"answered":"open",y=CO(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 AO=new Set(["accepted","enqueued","started","needs_user","ready"]),RO=new Set(["delivered","failed","cancelled"]),_O={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"},OO={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=_i}=t,c=[],h=[],p=new Set,y=w=>a==null||w===a,v=w=>u(_O[w]);for(const w of i){if(w.kind!=="tool")continue;if(em(w.name)){const j=Gs(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"&&!Ds.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?bO(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}Ds.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)||RO.has(w.status)||!AO.has(w.status))continue;p.add(w.id);const x=OO[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 zO(t){const{t:i}=et(),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 MO(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 Sb(t){return Array.isArray(t.entities)?t.entities.flatMap(i=>{const r=o1(i);return r?[s1(r)]:[]}):[]}function qO(t){const i=o1(t.entity);return i?s1(i):null}function DO(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 LO(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:MO(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"||!BO(i.type)?null:i}function BO(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"},UO={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 HO(){try{const t=localStorage.getItem(u1);return t==null||t===""?Ms:Ea(Number(t))}catch{return Ms}}function IO(t){try{localStorage.setItem(u1,String(t))}catch{}}function VO({open:t,sessionId:i,onClose:r}){const{t:a}=et(),[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),[q,B]=E.useState(!1),[P,ie]=E.useState([]),[A,L]=E.useState("auto"),[G,le]=E.useState([]),[O,Y]=E.useState(null),[W,ke]=E.useState(null),[oe,ge]=E.useState(!0),[re,ce]=E.useState(""),[xe,Te]=E.useState(0),[R,Ze]=E.useState(HO),Ie=E.useRef(R),[M,z]=E.useState(!1),[ee,ue]=E.useState(()=>window.innerWidth),[ve,ze]=E.useState(()=>window.matchMedia("(max-width: 800px)").matches),[ye,be]=E.useState(t),[K,de]=E.useState(t?"in":"out"),tt=E.useRef(ye),mt=E.useRef(K);tt.current=ye,mt.current=K;const Ee=Ea(R);Tx({present:ye,narrow:ve,motion:K,width:Ee,resizing:M,viewport:ee}),E.useEffect(()=>{if(t){be(!0),de("in");return}if(tt.current){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){be(!1);return}de("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(""),Y(null),ke(null),L("auto"),T([]),ie([]),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(""),Ri(kb(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(Eb(Be.status,a)),ge(!1);return}T(Sb(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 Ri(`/dsh-bot/api/memory/frames?sessionId=${encodeURIComponent(i)}`).then(Be=>{ae||Be.body.ok===!1||ie(DO(Be.body))}),()=>{ae=!0}},[t,i,xe]);const De=A==="none"?null:A==="auto"?P[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 Ri(`/dsh-bot/api/memory/context?${Be}`).then(ft=>{ae||ft.body.ok===!1||le(LO(ft.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 Ri(`/dsh-bot/api/memory/entities/${encodeURIComponent(O)}?${Be}`).then(ft=>{ae||ke(ft.body.ok===!1?null:qO(ft.body))}),()=>{ae=!0}},[t,i,O,xe]),E.useEffect(()=>{if(!ye)return;const ae=Be=>{if(Be.key==="Escape"){if(O!=null){Y(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 Ri(kb(i,{query:c,scope:p,lifecycle:v,type:w},N));if(ae.status!==200||ae.body.ok===!1){ce(Eb(ae.status,a));return}T(Be=>[...Be,...Sb(ae.body)]),j(typeof ae.body.nextCursor=="string"?ae.body.nextCursor:null)}const Ae=S.find(ae=>ae.id===O)??null,Ue=W&&W.id===O?W:Ae,rt=ae=>De==null?null:G.find(Be=>Be.id===ae)??{id:ae,form:"unknown",reason:"no_manifest"};return ye?Sl.createPortal(m.jsxs("div",{className:ve?`files-drawer narrow files-drawer-${K}`:`files-drawer files-drawer-${K}${M?" 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"||mt.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=Qt=>{const Bt=Ea(window.innerWidth-Qt.clientX);Ie.current=Bt,Ze(Bt)},ft=()=>{z(!1),IO(Ie.current),window.removeEventListener("pointermove",Be),window.removeEventListener("pointerup",ft)};window.addEventListener("pointermove",Be),window.addEventListener("pointerup",ft)}}),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(QO,{})}),m.jsxs("nav",{className:"files-crumbs","aria-label":a("memory.title"),children:[m.jsx("button",{type:"button",onClick:()=>Y(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(ZO,{})})]}),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))]}),P.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;L(Be==="none"?"none":Number(Be))},children:[m.jsx("option",{value:"none",children:a("memory.frame.unselected")}),P.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(FO,{entity:Ue,citation:rt(Ue.id),sourceReady:W?.id===Ue.id,t:a,onClose:()=>Y(null),onSelect:Y}):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(KO,{})}),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,q?m.jsx("p",{className:"memory-note",children:a("memory.capped")}):null,m.jsxs("div",{className:"files-table",role:"table",children:[m.jsxs("div",{className:"files-row files-columns memory-row",role:"row",children:[m.jsx("span",{role:"columnheader",children:a("files.name")}),m.jsx("span",{className:"files-col-type",role:"columnheader",children:a("memory.kind")}),m.jsx("span",{className:"files-col-size",role:"columnheader",children:a("memory.lifecycle")}),m.jsx("span",{className:"files-col-time",role:"columnheader",children:a("files.modified")})]}),S.map(ae=>m.jsx(YO,{entity:ae,selected:ae.id===O,t:a,onSelect:Y},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 YO({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(XO,{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:e4(t.updatedAt),children:Ls(t.updatedAt,r("memory.missing"))})]})}function FO({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(UO[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(GO,{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($O,{source:t.source,t:a}):null,i?m.jsx("p",{className:"memory-cite-reason",children:a(JO(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:[WO(h.tool,a)," · ",Ls(h.at,a("memory.missing"))]},h.id))})]}):null]})]})}function GO({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:Ls(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 $O({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(PO(t.creator))}),t.createdAt?m.jsx("p",{children:i("memory.source.created",{time:Ls(t.createdAt,i("memory.missing"))})}):null,t.updatedAt?m.jsx("p",{children:i("memory.source.updated",{time:Ls(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 XO({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 QO(){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 ZO(){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 KO(){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 kb(t,i,r){const a=new URLSearchParams({sessionId:t});return i.query!==""&&a.set("q",i.query),i.scope!=="all"&&a.set("scope",i.scope),i.lifecycle!=="all"&&a.set("lifecycle",i.lifecycle),i.type!=="all"&&a.set("type",i.type),r&&a.set("cursor",r),`/dsh-bot/api/memory/entities?${a}`}function Eb(t,i){return i(t===401||t===403?"memory.denied":"memory.failed")}function 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 JO(t){return t==="no_frame"?"memory.cite.reason.no_frame":"memory.cite.reason.no_manifest"}function PO(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 WO(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 Ls(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 e4(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 Jd(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:Sl.createPortal(u,document.body)}function t4({sessionId:t,current:i,onClose:r,onChanged:a}){const{t:o}=et(),[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(L=>c(L.body)),Pe("/permissions/default").then(L=>p(L.body))},[t]);async function j(L){N(!0),S("");try{const G=await Pe("/permissions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:t,name:L})});if(G.status===200&&G.body.ok!==!1){c(G.body),v(null),typeof G.body.currentValue=="string"&&a?.(G.body.currentValue);return}S(typeof G.body.message=="string"?G.body.message:o("permission.failed"))}catch{S(o("permission.failed"))}finally{N(!1)}}function q(L){if(!(L.value===u?.currentValue||L.value==="custom")){if(L.value==="danger-full-access"||L.value==="auto"){w(null),v(L);return}j(L.value)}}async function B(L){N(!0),S("");try{const G=await Pe("/permissions/default",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:L})});if(G.status===200&&G.body.ok!==!1){p(G.body),w(null);return}S(typeof G.body.message=="string"?G.body.message:o("permission.failed"))}catch{S(o("permission.failed"))}finally{N(!1)}}function P(L){if(!(L.value===h?.defaultPreset||L.value==="custom"||L.value==="auto")){if(L.value==="danger-full-access"){v(null),w(L);return}B(L.value)}}const ie=u?.options??[],A=ie.find(L=>L.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"),":"," ",Jd(u?.currentValue??i??"",A?.name,o)||"—"]}):null,m.jsx("ul",{className:"user-question-options",children:ie.map(L=>m.jsx("li",{children:m.jsxs("button",{type:"button",className:L.value===u?.currentValue?"user-question-option selected":"user-question-option",disabled:T||L.value==="custom",onClick:()=>q(L),children:[m.jsx("span",{className:"user-question-option-label",children:Jd(L.value,L.name,o)}),L.description?m.jsx("span",{className:"user-question-option-desc",children:L.description}):null]})},L.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(L=>m.jsx("li",{children:m.jsxs("button",{type:"button",className:L.value===h?.defaultPreset?"user-question-option selected":"user-question-option",disabled:T||L.value==="custom"||L.value==="auto",onClick:()=>P(L),children:[m.jsx("span",{className:"user-question-option-label",children:Jd(L.value,L.name,o)}),L.description?m.jsx("span",{className:"user-question-option-desc",children:L.description}):null]})},`default-${L.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 n4({onClose:t,authorization:i,catalog:r}){const{t:a}=et(),[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),[q]=E.useState(()=>J0(async()=>{const O=await Pe("/authorization");if(O.status!==200)throw new Error("Authorization catalog unavailable");return O.body})),B=r??q,P=E.useRef(!0),ie=E.useRef(0);async function A(O=!1){if(document.hidden)return;O&&B.invalidate();const Y=++ie.current;try{const W=await B.get();if(!P.current||Y!==ie.current)return;u(W.available!==!1),h(Array.isArray(W.entries)?W.entries:[]),i||(y(Array.isArray(W.notices)?W.notices:[]),g(Array.isArray(W.prompts)?W.prompts:[]))}catch{P.current&&Y===ie.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(()=>{P.current=!0,A();const O=()=>{document.hidden||A(!0)},Y=window.setInterval(()=>{A()},3e4);return document.addEventListener("visibilitychange",O),()=>{P.current=!1,ie.current++,window.clearInterval(Y),document.removeEventListener("visibilitychange",O)}},[B,i?.catalogRevision]);async function L(O,Y){j(!0),T("");try{const W=await Pe("/authorization/begin",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({key:O.key,method:Y})});(W.status!==200||W.body.ok===!1)&&T(typeof W.body.message=="string"?W.body.message:a("auth.failed")),await A(!0)}catch{T(a("auth.failed"))}finally{j(!1)}}async function G(O,Y=!1,W){j(!0),T("");try{const ke=await Pe("/authorization/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({promptId:O.promptId,value:Y?void 0:W??w[O.promptId]??"",declined:Y})});(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,Y)=>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}-${Y}`)),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(Y=>m.jsx("li",{children:m.jsxs("button",{type:"button",className:"user-question-option",disabled:N,onClick:()=>{G(O,!1,Y.id)},children:[m.jsx("span",{className:"user-question-option-label",children:Y.label}),Y.description?m.jsx("span",{className:"user-question-option-desc",children:Y.description}):null]})},Y.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:Y=>x(W=>({...W,[O.promptId]:Y.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:Y=>x(W=>({...W,[O.promptId]:Y.target.value}))})}),m.jsxs("div",{className:"user-question-row",children:[m.jsx("button",{type:"button",className:"user-question-skip",disabled:N,onClick:()=>{G(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:()=>{G(O)},children:a("auth.writeVault")}):null]})]},O.promptId)),c.map(O=>{const Y={...O,inFlight:O.inFlight||Array.isArray(i?.inFlight)&&i.inFlight.some(W=>JSON.stringify(W)===JSON.stringify(O.key))};return m.jsxs("article",{className:"user-question",children:[m.jsx("p",{className:"user-question-text",children:Y.label}),m.jsxs("div",{className:"user-question-row",children:[Y.methods.map(W=>m.jsx("button",{type:"button",className:"user-question-submit",disabled:N||Y.inFlight,onClick:()=>{L(Y,W.id)},children:W.label||a("auth.start")},W.id)),Y.inFlight?m.jsx("button",{type:"button",className:"user-question-skip",disabled:N,onClick:()=>{le(Y)},children:a("auth.cancel")}):null]})]},JSON.stringify(Y.key))}),S?m.jsx("p",{className:"user-question-status exception",children:S}):null]})}function i4({onClose:t}){const{t:i,locale:r}=et(),[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 P=B.body.systemStatus;p(P&&typeof P=="object"?P:null);const ie=B.body.applications;if(ie&&typeof ie=="object"){const A=ie;v(Array.isArray(A.allowedApps)?A.allowedApps:[]),w(Array.isArray(A.blockedApps)?A.blockedApps:[])}}E.useEffect(()=>{j()},[r]);async function q(B,P={}){N(!0),S("");try{const ie=await Pe("/cua",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:B,locale:r,...P})});(ie.status!==200||ie.body.ok===!1)&&S(typeof ie.body.message=="string"?ie.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:()=>{q("requestPermission",{permission:B})},children:i("cua.request")}),m.jsx("button",{type:"button",className:"user-question-skip",disabled:T,onClick:()=>{q("openSettings",{permission:B})},children:i("cua.openSettings")})]},B)),m.jsx("h4",{className:"user-question-header",children:i("cua.grants")}),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:()=>{q("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:()=>{q("retryApproval",{id:B.id})},children:i("cua.askAgain")})]},B.id)),x?m.jsx("p",{className:"user-question-status exception",children:x}):null]})}function r4(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 Uu(t){if(typeof t=="string")return t;if(t&&typeof t=="object")try{return JSON.stringify(t)}catch{return""}return""}function ht(t){return typeof t=="number"?t:void 0}function l4(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 rc(t,i){return`${t??""}:${i??""}`}function rm(t){if(t.kind==="think"||t.kind==="tool"||t.kind==="assistant")return t.step}function Ta(t){return t.sort((i,r)=>i.seq-r.seq)}function a4(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 Ta([...t,i])}function s4(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 o4(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 u4(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=c4(i,["file_path","path","file"]);if(!a)return null;if(r==="write"){const o=typeof i.content=="string"?i.content:"",u=Hu(o).map(c=>({kind:"add",text:c}));return jb(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===""?Hu(u).map(y=>({kind:"add",text:y})):f4(o,u),h=c.filter(y=>y.kind==="add").length,p=c.filter(y=>y.kind==="del").length;return jb(a,u.length,c,h,p)}return null}function jb(t,i,r,a,o){const u=t.split("/").filter(Boolean).at(-1)??t;return{path:t,name:u,language:d4(u),kilobytes:Math.max(1,Math.ceil(i/1024)),added:a,removed:o,lines:r}}function c4(t,i){for(const r of i){const a=t[r];if(typeof a=="string"&&a.trim())return a.trim()}return""}function Hu(t){return t===""?[]:(t.endsWith(`
|
|
63
63
|
`)?t.slice(0,-1):t).split(`
|
|
64
64
|
`)}function f4(t,i){const r=Hu(t),a=Hu(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 d4(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 h4(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 Ta([...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?ic(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},Ta(o)}function m4(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 C=p.slice();C[S]={...T,name:v.name||T.name,args:v.args||T.args,running:T.resultReceived?!1:T.running,status:T.resultReceived||T.callReceived?T.status:"preparing"},p=C}}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 Ta([...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 ju(t,i,r,a){return p1(t,i,r).map(u=>u.index===i?a({...u,kind:r}):u)}function p4(t,i){const r=ht(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:Tb(i.texts);return ju(t,r,"text",u=>({...u,text:u.text+o}))}if(a==="reasoning-delta"||a==="reasoning-chunks"){const o=typeof i.text=="string"?i.text:Tb(i.texts);return ju(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:Uu(i.args??i.arguments);return ju(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 ju(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:Uu(o.arguments)||c.args}))}return t}function Tb(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=ht(r.turn),u=ht(r.step),c=rc(o,u),h=t.live[c]??{seq:i.seq??0,blocks:[]},p=p4(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:m4({...t},c,p,v,o,u)}}function g1(t,i){const r=i.data??{},a=nm(r),o=a?.content??[],u=ht(r.turn),c=ht(r.step),h=rc(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(C=>C.kind==="tool"&&C.callId===S);y=y.filter(C=>!(C.kind==="tool"&&C.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:Uu(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?ic(g.name||T.name,T.result,T.error,T.errorCode):T.status:"preparing",seq:x,turn:u,step:c})}}),{...t,live:p,segments:Ta(y)}}function y4(t,i){const r=i.data??{},a=typeof r.callId=="string"?r.callId:"";if(!a)return t;const o=ht(r.turn),u=ht(r.step);return{...t,segments:m1(t.segments,{kind:"tool",id:`tool:${a}`,callId:a,name:typeof r.name=="string"?r.name:"tool",args:Uu(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 g4(t,i){const r=i.data??{},a=nm(r),o=a?.toolCallId??(typeof r.callId=="string"?r.callId:"");if(!o)return t;const u=h1(a?.content),c=ht(r.turn),h=ht(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:ic(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 v4(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 b4(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:ht(a.time)??0,chunk:a.chunk});continue}const o=ht(a.index)??0,u=Array.isArray(a.texts)?a.texts:Array.isArray(a.args)?a.args:null;if(!u)continue;let c=ht(a.time0)??0;const h=Array.isArray(a.dt)?a.dt:[];u.forEach((p,y)=>{y>0&&(c+=ht(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 Eh(t,i,r,a=!1){const o=rc(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&&im(c)===r&&(c.kind==="assistant"||c.kind==="think")))}}function x4(t,i){const r=t.streamAttempt;if(!r||i.surfaceOp!=null&&i.surfaceOp!=="append")return!1;const a=i.data??{};return ht(a.turn)!==r.turn||ht(a.step)!==r.step?!1:i.seq==null||i.seq>r.startedAfterSeq}function As(t){const i=t.pendingAssistant;return{...i?g1(t,i):t,pendingAssistant:null,streamAttempt:null}}function w4(t,i,r){return{...t,streamAttempt:null,pendingAssistant:null,segments:t.segments.map(a=>a.kind==="user"||a.turn!==i||im(a)!==r?a:a.kind==="think"?{...a,running:!1}:a.kind==="tool"?{...a,running:!1,status:a.resultReceived||!P0.has(Jh(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&&im(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 S4(t,i){const r=ht(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=ht(u.turn),p=ht(u.step),y=ht(u.startedAfterSeq)??r;if(!c||h==null||p==null)return{...a,streamAttempt:null};if(x1(a,h,p))return{...a,streamAttempt:null};a=Eh(a,h,p);const v=b4(u.stream),g=Math.min(ht(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 k4(t,i){const r=typeof i.type=="string"?i.type:"",a=ht(i.revision),o=typeof i.attemptId=="string"?i.attemptId:"";if(a==null||!o||a<=t.streamRevision)return t;if(r==="start"){const c=ht(i.turn),h=ht(i.step);if(c==null||h==null||x1(t,c,h))return t;const p=t.pendingAssistant?As(t):t;return{...Eh(p,c,h,!0),drafting:!0,streamRevision:a,streamAttempt:{attemptId:o,turn:c,step:h,nextIndex:0,startedAfterSeq:ht(i.startedAfterSeq)??t.streamRevision}}}if(a!==t.streamRevision+1)return{...As(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=ht(i.index),h=i.chunk;if(c==null||!h||typeof h!="object")return{...t,streamRevision:a};if(c!==u.nextIndex)return{...As(t),streamRevision:a};const p=rc(u.turn,u.step),y=t.live[p]?.seq||v1(t,u.startedAfterSeq);return{...b1(t,u.turn,u.step,ht(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{...Eh(p,u.turn,u.step),streamAttempt:null,pendingAssistant:null}}return c.kind==="committed"&&c.eventType==="assistant/message"?{...As(h),streamRevision:a}:{...w4(h,u.turn,u.step),streamRevision:a}}return{...t,streamRevision:a}}function E4(t,i,r=!1){const a=ht(t.pendingAssistant?.data?.turn),o=t.pendingAssistant&&(i==null||a===i)?As(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(Jh(c))?c.status:r&&!c.callReceived?"cancelled":"unknown"}:c.kind==="assistant"?{...c,streaming:!1}:c)}}function j4(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 T4(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=ht(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=ht(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:l4(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=E4(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=ht(a.turn),c=typeof a.retryId=="string"?a.retryId:"",h=ht(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:ht(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=ht(a.turn),c=typeof a.retryId=="string"?a.retryId:"",h=ht(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=nm(a);if(!u||u.source?.kind!=="user")return r;const c=h1(u.content);return c&&(r={...r,segments:a4(r.segments,{kind:"user",id:`user:${i.seq??c}`,text:c,time:i.time,seq:i.seq??Number.MAX_SAFE_INTEGER,turn:ht(a.turn)})}),r}if(i.type==="assistant/message")return x4(r,i)?r={...r,pendingAssistant:i}:r=g1(r,i),r;if(i.type==="tool/call")return r=y4(r,i),r;i.type==="tool/result"&&(r=g4(r,i));const o=N4(i);return o&&(r={...r,segments:C4(r.segments,o)}),r}function N4(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 C4(t,i){return Ta([...t.filter(r=>r.id!==i.id),i])}function A4(t,i){const r=v4(i)??(i&&typeof i=="object"?i:null);if(!r)return t;let a=t;if(r.type==="snapshot"){a=j4(a,r);const o=r.assistantStream;o&&typeof o=="object"&&(a=S4(a,o))}if(r.type==="assistant-stream"){const o=r.frame;o&&typeof o=="object"&&(a=k4(a,o))}return a}function R4(t){for(let i=t.length-1;i>=0;i-=1){const r=t[i];if(!r||r.kind==="user"&&yx(r.text)||rm(r))continue;const a=r.kind==="user"?nc(r.text):null,o=r.kind==="user"?Nh(r.text):null,c=(a?a.body:o?.body?o.body:r.kind==="user"||r.kind==="assistant"?r.text:r.kind==="tool"?r.result||s4(r.name,r.args):h4(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 Iu(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Nb(t,i){if(!Iu(t))return;if(i==="ticket.id"){const a=t.ticket;if(!Iu(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 Bs(t,i){if(!Iu(i)||i.t!=="v"&&i.t!=="o"&&i.t!=="l")return t;const r=i;return r.t==="v"?r.v:r.t==="o"?_4(t,r):O4(t,r)}function _4(t,i){const r=Iu(t)?{...t}:{};for(const a of i.d??[])delete r[a];for(const[a,o]of Object.entries(i.s))r[a]=Bs(r[a],o);return r}function O4(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=Nb(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(Bs(void 0,y));continue}u[v]=Bs(u[v],y)}if(!i.order)return u;const h=new Map;for(const p of u){const y=Nb(p,r);y!==void 0&&h.set(y,p)}return i.order.filter(p=>h.has(p)).map(p=>h.get(p))}class z4{appliedSeq;headSeq=null;pending=new Map;pendingBytes=0;constructor(i=-1){this.appliedSeq=i}setHead(i){(this.headSeq==null||i>this.headSeq)&&(this.headSeq=i)}push(i){const r=[];for(const u of i)if(!(typeof u.seq!="number"||!Number.isFinite(u.seq))&&!(u.seq<=this.appliedSeq)){if(u.seq===this.appliedSeq+1){r.push(u),this.appliedSeq=u.seq,this.flushPending(r);continue}this.pending.has(u.seq)||(this.pending.set(u.seq,u),this.pendingBytes+=Cb(u))}let a=null;(this.pending.size>bk||this.pendingBytes>xk)&&(a={afterSeq:this.appliedSeq,dropped:this.pending.size},this.pending.clear(),this.pendingBytes=0);const o=this.nextGap();return{delivered:r,gapTo:o,overflow:a}}flushPending(i){for(;this.pending.has(this.appliedSeq+1);){const r=this.pending.get(this.appliedSeq+1);if(this.pending.delete(this.appliedSeq+1),!r)break;this.pendingBytes=Math.max(0,this.pendingBytes-Cb(r)),i.push(r),this.appliedSeq=r.seq}}nextGap(){if(this.pending.size===0)return null;let i=Number.POSITIVE_INFINITY;for(const r of this.pending.keys())r<i&&(i=r);return Number.isFinite(i)?i:null}}function Cb(t){return 64+(typeof t.type=="string"?t.type.length:0)}function Sa(t,i){return{kind:"session",sessionId:t}}function Ab(t){const i=t.addressOf??(a=>Sa(a)),r=t.openingMessages??fk;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??(C=>new WebSocket(C)))(y),g=`follow-${Math.random().toString(36).slice(2)}`;let w=!1;const x=()=>!w&&v.readyState===1,S=C=>{if(!w){w=!0,u.removeEventListener("abort",T);try{v.close()}catch{}c(C)}},T=()=>S({ok:!1,retryable:!1,code:"ABORTED"});u.addEventListener("abort",T),v.addEventListener("open",()=>{u.aborted||v.send(JSON.stringify({type:"open",streamId:g,endpoint:"session/follow",payload:{args:{request:{address:i(a.sessionId),maxMessages:r,assistantStream:!0,activate:!0}}}}))}),v.addEventListener("message",C=>{let k;try{k=JSON.parse(String(C.data))}catch{return}if(k.streamId===g){if(k.type==="error"){S({ok:!1,retryable:!0,code:"FOLLOW_ERROR",message:k.error?.message});return}if(k.type==="end"){S({ok:!0,throughSeq:-1});return}k.type==="item"&&M4(k.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 M4(t,i,r){const a=w1(t);if(!a)return;if(a.type==="snapshot"){const u=typeof a.cursor=="number"?a.cursor:-1,c=Us(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=Us(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 Us(t){const i=[];return Ru(t,i),i.sort((r,a)=>r.seq-a.seq)}function Ru(t,i){if(!t)return;if(Array.isArray(t)){for(const o of t)Ru(o,i);return}if(typeof t!="object")return;const r=t;if(r.event&&typeof r.event=="object"){const o=Rb(r.event);o&&i.push(o);return}const a=Rb(r);a&&i.push(a),Array.isArray(r.records)&&Ru(r.records,i),Array.isArray(r.events)&&Ru(r.events,i)}function Rb(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 _b(t={}){const i=t.fetch??fetch,r=t.url??Zb;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(mk)}),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=Us(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 q4(t=fetch,i=Zb,r){try{return(await t(i,{method:"HEAD",credentials:"same-origin",signal:r})).ok}catch{return!1}}const D4=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 L4(){return typeof document<"u"&&document.visibilityState==="hidden"}function Ob(t){return{open(i,r){return B4(t,i,r??{})}}}function B4(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(K=>{p=K});let v=!1;const g=K=>{v||(v=!0,p(K))};let w=[],x=!1,S=null;const T=t.raf??(typeof requestAnimationFrame=="function"?requestAnimationFrame:K=>setTimeout(K,0)),C=t.cancelRaf??(typeof cancelAnimationFrame=="function"?cancelAnimationFrame:clearTimeout),k=()=>{S!=null&&(S.kind==="timer"?clearTimeout(S.id):C(S.id),S=null)},M=t.wait??H4,L=t.random??Math.random,P=t.now??Date.now,ie=t.isHidden??L4,A=()=>{if(S=null,w.length===0)return;const K=w;w=[];const de={events:K,fromCache:x};x=!1;for(const et of o)et(de)},F=()=>{k(),A()},X=(K,de=!1)=>{if(K.length===0||(de&&(x=!0),w.push(...K),S!=null))return;const et={kind:ie()?"timer":"raf",id:null};S=et,et.id=et.kind==="timer"?setTimeout(A,0):T(A)},le=K=>{h={...h,...K,lag:(K.headSeq??h.headSeq)==null||(K.appliedSeq??h.appliedSeq)==null?K.lag??h.lag:(K.headSeq??h.headSeq)-(K.appliedSeq??h.appliedSeq)};for(const de of c)de(h)};let O=0,V=!1,W=0,ke=!0,oe=null,ge=!1,re=null,ce=null,xe=!1,Te=P(),R=Number.NEGATIVE_INFINITY;const Ze=async K=>{if(a.signal.aborted)return;if(ge){ge=!1;return}const de=new AbortController;oe=de;const et=()=>de.abort();a.signal.addEventListener("abort",et,{once:!0});try{await M(K,de.signal)}catch{}finally{a.signal.removeEventListener("abort",et),oe===de&&(oe=null)}},Ie=()=>{const K=xe;return xe=!1,K},q=K=>{if(!ke||a.signal.aborted)return;F();const de=P(),et=ce?ce():!0,mt=de-Te>=Ck,Ee=!et||K.reason==="online"||K.persisted===!0||K.hiddenMs>=Nk||K.reason!=="focus"&&mt;if(W=0,O=0,V=!1,oe){oe.abort();return}if(!re){ge=!0;return}Ee&&(de-R<Ak||(R=de,re.signal.aborted||(xe=!0,re.abort())))};z();async function z(){try{await ee()}finally{ke=!1,be()}}async function ee(){const K=await t.checkpoint.getCursor(i);let de=K?.appliedSeq??-1;const et=await t.checkpoint.readEvents(i,-1),mt=U4(et,-1).filter(Ae=>Ae.seq<=de||de<0);de<0&&mt.length&&(de=mt[mt.length-1].seq);const Ee=new z4(de);K?.headSeq!=null&&Ee.setHead(K.headSeq),mt.length&&X(mt,!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&&(X(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,rt)=>{if(Ue<=Ae)return{ok:!0,throughSeq:Ue};le({phase:"syncing",fraction:h.fraction});const ae=Ue-Ae,Be=Me(),ft=De&&t.cdc!=null&&(ae>pk||ae*128>yk);if(De&&t.range!=null&&!ft&&t.range){const Bt=await t.range.fetch({sessionId:i,afterSeq:Ae,throughSeq:Ue},Be,rt);if(Bt.ok||rt.aborted)return Bt;De=!1}else if(ft&&t.cdc){const Bt=await t.cdc.fetch({sessionId:i,afterSeq:Ae,throughSeq:Ue},Be,rt);if(Bt.ok||rt.aborted)return Bt;De=!1}return t.page.fetch({sessionId:i,afterSeq:Ee.appliedSeq,throughSeq:Ue},Be,rt)};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 Ke=Ee.headSeq??Ee.appliedSeq,st=await t.page.fetch({sessionId:i,afterSeq:Ee.appliedSeq,throughSeq:Math.max(Ke,Ee.appliedSeq)},Me(),pe.signal);a.signal.removeEventListener("abort",Le),st.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})),W+=1;const bt=Tu(W,L);await Ze(Math.min(bt,wk)),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 rt=()=>{a.signal.removeEventListener("abort",Ue),Ae.abort(),re===Ae&&(re=null,ce=null)};let ae=null;const Be=Me(),ft=()=>{re===Ae&&(Te=P())},Qt={events(pe,Le){ft(),Be.events(pe,Le)},head(pe){ft(),Be.head(pe)},progress:Be.progress,ephemeral(pe){ft(),Be.ephemeral(pe)},opened(pe){ft(),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},Qt,Ae.signal),Q=await Promise.race([Bt.then(pe=>({kind:"done",outcome:pe})),I4(()=>ae!=null,Ae.signal,M).then(()=>({kind:"opened"}))]),se=ae;if(Q.kind==="done"||se==null||Ae.signal.aborted){if(rt(),a.signal.aborted)break;if(Ie())continue;O+=1,O>=Rd&&(V=!0),W+=1,await Ze(Tu(W,L));continue}O=0,W=0;const Oe=se.firstSeq-1,Ne=await Ve(Ee.appliedSeq,Oe,Ae.signal);if(Ae.signal.aborted){if(rt(),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}),rt();break}if(!Ne.ok){rt(),le({phase:"stalled",error:{code:Ne.code,message:Ne.message??Ne.code,retrying:!0},appliedSeq:Ee.appliedSeq,headSeq:Ee.headSeq}),W+=1,await Ze(Tu(W,L));continue}le({phase:"live",appliedSeq:Ee.appliedSeq,headSeq:Ee.headSeq,fraction:null,error:void 0}),Ee.appliedSeq>=Oe&&g({ok:!0,caughtUpTo:Ee.appliedSeq});const we=await Bt;if(rt(),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}}),W+=1,await Ze(Tu(W,L)))}h.phase!=="error"&&le({phase:"closed"}),k()}async function ue(){return r.enhancement==="off"||!t.cdc&&!t.range?!1:t.probe?t.probe():q4()}const ve=(t.onResume??D4)(q),ze=t.livenessMs===void 0?Rk:t.livenessMs;let ye=null;ze!==!1&&ze>0&&(ye=setInterval(()=>{ie()||!re||!ce||ce()||q({reason:"liveness",hiddenMs:0})},ze),ye.unref?.());function be(){ye!=null&&clearInterval(ye),ye=null}return{onBatch(K){return o.add(K),()=>o.delete(K)},onEphemeral(K){return u.add(K),()=>u.delete(K)},onStatus(K){return c.add(K),K(h),()=>c.delete(K)},get status(){return h},ready:y,close(){ve(),be(),a.abort(),k(),le({phase:"closed"})}}}function U4(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 Tu(t,i){return Math.min(kk,Sk*2**Math.max(0,t-1))*(.5+i()*.5)}function H4(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 I4(t,i,r){for(;!t()&&!i.aborted;)await r(5,i).catch(()=>{})}function zb(t={}){const i=t.addressOf??(u=>Sa(u)),r=t.fetch??fetch,a=t.url??Tk,o=t.maxMessages??dk;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 V4(r,a,{address:i(u.sessionId),throughSeq:u.throughSeq,beforeSeq:p,maxMessages:o,turnWindow:hk},h);if(!g.ok)return g;const w=Us(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 V4(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 Mb(t){const i=await crypto.subtle.digest("SHA-256",t);return[...new Uint8Array(i)].map(r=>r.toString(16).padStart(2,"0")).join("")}function qb(t){const i=t.fetch??fetch,r=t.concurrency??gk,a=t.retries??vk,o=t.manifestUrl??Ek,u=t.chunkUrl??jk,c=t.wait??$4;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 Y4(i,o,h,v.signal);return w.ok?await F4({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 Y4(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 F4(t){const i=[...t.manifest.chunks].sort((C,k)=>C.fromSeq-k.fromSeq),r=new Map;let a=0;const o=t.manifest.totalSize;t.sink.progress({loaded:a,total:o,unit:"bytes"}),t.sink.head(t.manifest.throughSeq);let u=0;const c=()=>{for(;u<i.length;){const C=i[u];if(!C||!r.has(C.fromSeq))break;const k=(r.get(C.fromSeq)??[]).filter(M=>M.seq>t.afterSeq&&M.seq<=t.throughSeq);k.length&&t.sink.events(k,{throughSeq:t.throughSeq}),u+=1}},h=[];for(const C of i){const k=await t.cache.getChunk(C.hash);k&&await Mb(k)===C.hash?(r.set(C.fromSeq,Db(k)),a+=C.bytes,t.sink.progress({loaded:a,total:o,unit:"bytes"}),c()):h.push(C)}if(h.length===0)return c(),{ok:!0,throughSeq:t.throughSeq};let p=0,y=0,v=null,g=null;const w=()=>{const C=g;g=null,C?.()},x=()=>new Promise(C=>{if(y===0){C();return}g=C}),S=async C=>{for(let k=0;k<t.retries;k+=1){if(t.signal.aborted||v)return;try{const M=await G4(t.fetchImpl,t.chunkUrl,t.manifest.sessionId,C,t.signal);if(await Mb(M)!==C.hash)throw new Error("hash mismatch");await t.cache.putChunk(C.hash,M),r.set(C.fromSeq,Db(M)),a+=C.bytes,t.sink.progress({loaded:a,total:o,unit:"bytes"}),c();return}catch(M){if(t.signal.aborted||v)return;if(k+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**k,t.signal).catch(()=>{})}}},T=()=>{for(;!v&&!t.signal.aborted&&y<t.concurrency&&p<h.length;){const C=h[p];if(p+=1,!C)break;y+=1,S(C).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 G4(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 Db(t){const i=new TextDecoder().decode(t),r=[];for(const a of i.split(`
|
|
66
|
-
`))if(a.trim()!=="")try{r.push(...Us(JSON.parse(a)))}catch{}return r.sort((a,o)=>a.seq-o.seq)}function $4(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 X4(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 Q4(t){return t.replace(/[@()\r\n]/g," ").replace(/\s+/g," ").trim()||"Untitled"}function Z4(t,i){return`@${Q4(t)} (${i})`}function K4(t,i,r,a,o){const u=Math.max(0,Math.min(i,t.length)),c=`${Z4(a,o)} `;return{text:t.slice(0,r)+c+t.slice(u),cursor:r+c.length}}function J4(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
|
|
67
|
-
`).map(y=>y.trim()).find(Boolean)??"",p=[t.wallMs!=null?o("work.duration",{value:l3(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(a3,{}),h&&!u?m.jsx("span",{className:"briefing-preview",children:h}):null]}),m.jsx(lc,{open:u,children:m.jsxs("div",{className:"briefing-body",children:[t.body?m.jsx(Fs,{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 l3(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 a3(){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 s3({text:t}){return m.jsx("p",{className:"work-refused",children:t})}function o3({segment:t}){const[i,r]=j.useState(!1),{t:a}=We();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(S3,{}),m.jsx(Yu,{})]}),m.jsx("span",{className:"official-label",children:t.running?a("activity.thinking"):a("activity.reasoning")})]}),m.jsx(lc,{open:i,children:m.jsx("div",{className:"think-body",children:t.text})})]})}function u3({segments:t,pending:i=!1,tickets:r=[],cwd:a,connectionPhase:o}){const{t:u}=We(),c=t.flatMap(x=>x.kind==="tool"?[Ph(x,r)]:[]),h=t.some(x=>x.kind==="think"&&x.running)||c.some(x=>Ds.has(x)),p=i||h,y=[[u("activity.count.active"),c.filter(x=>Ds.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]=j.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(jh,{}),m.jsx(Yu,{})]}),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(lc,{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(o3,{segment:x},x.id):m.jsx(v3,{segment:x,cwd:a,tickets:r,stale:w},x.callId))]})})]})}function c3({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 f3({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 d3({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 h3({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 m3({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 p3({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 y3({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]})}fO.show(t=>m.jsx(c3,{detail:t}));dO.show(t=>m.jsx(f3,{detail:t}));hO.show(t=>m.jsx(d3,{detail:t}));mO.show(t=>m.jsx(h3,{detail:t}));pO.show(t=>m.jsx(m3,{detail:t}));yO.show(t=>m.jsx(p3,{detail:t}));gO.show(t=>m.jsx(y3,{detail:t}));function g3({detail:t}){return t.view()}function v3(t){const[i,r]=j.useState(!1),[a,o]=j.useState(!1);return m.jsx(b3,{...t,open:i,argsOpen:a,onToggle:()=>r(u=>!u),onArgsToggle:()=>o(u=>!u)})}function b3({segment:t,cwd:i,tickets:r=[],stale:a=!1,open:o,argsOpen:u,onToggle:c,onArgsToggle:h}){const p=j.useId(),{t:y,locale:v}=We(),g=t1(t,i,r),w=u4({...t,args:g.args,result:g.output}),x=Kh(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(jh,{}),m.jsx(Yu,{})]}),g.detail&&S===""?m.jsx(g3,{detail:g.detail}):m.jsx("span",{className:"official-label",children:S}),T?m.jsxs("span",{className:"activity-status",children:[vb(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:[vb(g.status,y),a?y("activity.lastKnownSuffix"):""]}):null,g.todos.length?m.jsxs("p",{className:"activity-note",children:[g.todos.filter(C=>C.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(_u,{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((C,k)=>m.jsxs("li",{children:[m.jsx("span",{children:C.status})," ",C.content]},k))}):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(x3,{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(jh,{}),m.jsx(Yu,{})]}),m.jsx("span",{className:"official-label",children:y("activity.fullArgs")})]}),trailing:u?m.jsx(_u,{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(_u,{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(lc,{open:a,children:p})})]})}function x3({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(_u,{text:i})]}),m.jsx("div",{className:"diff-body",children:t.lines.map((r,a)=>m.jsx("div",{className:w3(r.kind),children:r.text},a))})]})}function w3(t){return t==="add"?"diff-line added":t==="del"?"diff-line removed":"diff-line same"}function _u({text:t}){const[i,r]=j.useState(!1);return m.jsx("button",{type:"button",className:"diff-copy","aria-label":i?"Copied":"Copy",onClick:a=>{a.stopPropagation(),navigator.clipboard.writeText(t).then(()=>{r(!0),window.setTimeout(()=>r(!1),1e3)})},children:i?m.jsx(E3,{}):m.jsx(k3,{})})}function Yu(){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 S3(){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 jh(){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 k3(){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 E3(){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 j3={aborted:"question.aborted",failed:"question.failed",answered:"question.answered"};function Ns(t){return{selected:[...t.selected],custom:t.custom,skipped:t.skipped}}function T3(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 N3({item:t,draft:i,interactive:r,disabled:a,onToggle:o}){const{t:u}=We();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=wO(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 lm({interactive:t,waitLabel:i,onTakeTime:r,busy:a}){const{t:o}=We();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 C3({segment:t,sessionId:i,onCompose:r,remainingMs:a,waitState:o}){const u=Gs(t);return u?u.presentation==="plan-review"?m.jsx(R3,{segment:t,sessionId:i,onCompose:r,remainingMs:a,waitState:o}):u.presentation==="approval"?m.jsx(_3,{segment:t,sessionId:i,remainingMs:a,waitState:o}):m.jsx(A3,{segment:t,sessionId:i,remainingMs:a,waitState:o}):null}function am(t,i,r,a,o){const{t:u}=We(),c=!!(r&&l1(r.state)),[h,p]=j.useState(o==="waiting"||r?.wait==="waiting"),[y,v]=j.useState(o==="continued"||r?.state==="continued"),[g,w]=j.useState(a??r?.timeoutMs),x=j.useRef(null),S=(o==="counting"||r?.wait==="counting"||typeof(a??r?.timeoutMs)=="number")&&!h&&!y;j.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]),j.useEffect(()=>{if(!c||!S)return;const k=a??g??r?.timeoutMs;if(typeof k!="number")return;x.current==null&&(x.current=Date.now()+k);const M=()=>{const P=Math.max(0,(x.current??Date.now())-Date.now());return w(P),P<=0?(v(!0),t&&nt("/questions/timeout",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:t,callId:i})}),!1):!0};if(!M())return;const L=window.setInterval(()=>{M()||window.clearInterval(L)},250);return()=>window.clearInterval(L)},[c,S,t,i,a,g,r?.timeoutMs]);async function T(){p(!0),x.current=null,t&&await nt("/questions/take-time",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:t,callId:i})})}const C=y?u("question.continued"):h?u("question.waitingNoTimer"):S&&typeof g=="number"?u("question.remaining",{time:T3(g)}):null;return{answerable:c,held:h,continued:y,waitLabel:C,takeTime:T,markHeld:()=>p(!0)}}function A3({segment:t,sessionId:i,remainingMs:r,waitState:a}){const{t:o}=We(),u=Gs(t),c=am(i,u.callId,u,r,a),[h,p]=j.useState({}),[y,v]=j.useState(!1),[g,w]=j.useState(""),x=u.questions,S=j.useMemo(()=>{const A={};for(const F of x)A[F.id]=h[F.id]??Ns(F);return A},[h,x]),T=!!i&&c.answerable,C=x.length>1||x.some(A=>A.multiSelect||A.options.length===0);function k(A,F){c.markHeld(),p(X=>{const le=x.find(V=>V.id===A),O=X[A]??(le?Ns(le):{selected:[],custom:"",skipped:!1});return{...X,[A]:{...O,...F}}})}async function M(A){if(!(!i||y)){v(!0),w("");try{const F=await nt("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,callId:u.callId,answers:A})});if(F.status===200&&F.body.ok!==!1||F.status===409)return;const X=typeof F.body.message=="string"?F.body.message:o("question.submitFailed");w(X)}catch{w(o("question.submitFailed"))}finally{v(!1)}}}function L(A,F){return F.skipped?{id:A.id,selected:[]}:F.custom.trim()&&(A.multiSelect||F.selected.length===0||A.options.length===0)?A.multiSelect?{id:A.id,selected:F.selected,custom:F.custom}:{id:A.id,selected:[],custom:F.custom}:F.selected.length?{id:A.id,selected:[...F.selected]}:null}function P(){const A=x.map(F=>L(F,S[F.id]??Ns(F)));if(A.some(F=>F==null)){w(o("question.incomplete"));return}M(A)}function ie(A,F){if(!T||y)return;if(!A.multiSelect&&x.length===1&&!S[A.id]?.custom){M([{id:A.id,selected:[F]}]);return}const X=S[A.id]??Ns(A),le=A.multiSelect?X.selected.includes(F)?X.selected.filter(O=>O!==F):[...X.selected,F]:[F];k(A.id,{selected:le,skipped:!1,custom:A.multiSelect?X.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(lm,{interactive:T,waitLabel:c.waitLabel,onTakeTime:()=>{c.takeTime()},busy:y}),u.questions.map(A=>{const F=S[A.id]??Ns(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(N3,{item:A,draft:c.answerable?F:{selected:A.selected,custom:A.custom,skipped:A.skipped},interactive:T,disabled:y,onToggle:X=>ie(A,X)}),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:F.custom,disabled:y,rows:2,placeholder:o("question.customPlaceholder"),onChange:X=>k(A.id,{custom:X.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}k(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||F.skipped)&&(u.state!=="open"||T)?m.jsx("p",{className:"user-question-hint",children:o("question.skipped")}):null]},A.id)}),T&&(C||x.some(A=>(S[A.id]?.custom??"").trim()!==""))?m.jsx("button",{type:"button",className:"user-question-submit",disabled:y,onClick:P,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(j3[u.state])}):null]})}function R3({segment:t,sessionId:i,onCompose:r,remainingMs:a,waitState:o}){const{t:u}=We(),c=Gs(t),h=n1(c.questions),p=am(i,c.callId,c,a,o),[y,v]=j.useState(!1),[g,w]=j.useState(""),[x,S]=j.useState(!1),[T,C]=j.useState(""),k=!!i&&p.answerable,M=h.item.selected[0],L=M===h.approve.label;async function P(){if(!(!i||x)){S(!0),C("");try{const A=await nt("/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;C(typeof A.body.message=="string"?A.body.message:u("question.submitFailed"))}catch{C(u("question.submitFailed"))}finally{S(!1)}}}async function ie(){if(!i||x)return;const A=g.trim();if(!A){C(u("question.changesNeeded"));return}S(!0),C("");try{const F=await nt("/questions/cancel",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,callId:c.callId})});if(F.status===200&&F.body.ok!==!1){r?.(A);return}if(F.status===409){r?.(A);return}C(typeof F.body.message=="string"?F.body.message:u("question.submitFailed"))}catch{C(u("question.submitFailed"))}finally{S(!1)}}return m.jsxs("section",{className:"user-question-card","data-segment":t.id,"data-state":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(lm,{interactive:k,waitLabel:p.waitLabel,onTakeTime:()=>{p.takeTime()},busy:x}),h.plan?y?m.jsx("div",{className:"user-question-plan",children:m.jsx(Fs,{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,k?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:()=>{ie()},children:u("question.requestChanges")}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:x,onClick:()=>{P()},children:u(x?"question.submitting":"question.approvePlan")})]})]}):M?m.jsx("p",{className:"user-question-status",children:L?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 _3({segment:t,sessionId:i,remainingMs:r,waitState:a}){const{t:o,locale:u}=We(),c=Gs(t),h=i1(c.questions),p=am(i,c.callId,c,r,a),[y,v]=j.useState(!1),[g,w]=j.useState(""),x=!!i&&p.answerable,S=Zd(h.intent.display?.question,u,h.item.question),T=Zd(h.intent.display?.detail,u,h.item.detail),C=Zd(h.intent.display?.approve,u,h.approve.label),k=h.item.selected[0];async function M(L){if(!(!i||y)){v(!0),w("");try{const P=await nt("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,callId:c.callId,answers:[{id:h.item.id,selected:[L]}]})});if(P.status===200&&P.body.ok!==!1||P.status===409)return;w(typeof P.body.message=="string"?P.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(lm,{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"):C||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]}):k?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 O3({approval:t,sessionId:i}){const{t:r,locale:a}=We(),[o,u]=j.useState(!1),[c,h]=j.useState(""),[p,y]=j.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 C=await nt("/approvals/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,requestId:t.requestId,outcome:T})});if(C.status===200&&C.body.ok!==!1){y(T);return}if(C.status===409){y(T);return}h(typeof C.body.message=="string"?C.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 z3(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 M3(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 q3(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=z3(r[c]);if(h!=null&&h>o.seq){u=c;break}}r.splice(u,0,o.block)}return r}function D3(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 L3({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:C,connectionPhase:k,approvals:M=[],questionWaits:L,onCompose:P}){const ie=[];let A=null;const F=()=>{A&&(A.segments.length||a[A.turn]||o[A.turn]?.length)&&ie.push(A),A=null};for(const oe of i){if(oe.kind==="user"){F(),yx(oe.text)||ie.push({type:"user",segment:oe});continue}if(rm(oe)){A?A.segments.push(oe):ie.push({type:"card",segment:oe});continue}const ge=oe.turn??-1;(!A||A.turn!==ge)&&(F(),A={type:"turn",turn:ge,seconds:r[ge],segments:[]}),A.segments.push(oe)}F();const X=new Set(ie.flatMap(oe=>oe.type==="turn"?[oe.turn]:[])),le=[],O=oe=>{if(X.has(oe)||!Number.isFinite(oe))return;const ge=a[oe],re=o[oe];!ge&&!re?.length||(X.add(oe),le.push({seq:M3(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=q3(ie,le);ie.splice(0,ie.length,...oe)}const V=new Map(c.map(oe=>[oe.id,oe])),W=ie.reduce((oe,ge)=>ge.type==="turn"?Math.max(oe,ge.turn):oe,-1),ke=gx(c);return m.jsx(m.Fragment,{children:ie.map((oe,ge)=>m.jsx(j.Fragment,{children:oe.type==="user"?m.jsx(I3,{segment:oe.segment,botLabel:S,onOpenInbox:x,onOpenFile:w}):oe.type==="card"?m.jsx(k1,{segment:oe.segment,sessionId:t,byId:V,now:h,onSupply:v,onOpenSession:g,approvals:M}):m.jsx($3,{sessionId:t,cwd:C,connectionPhase:k,block:oe,index:ge,blocks:ie,failures:a,retries:o,turnEnds:u,latestTurn:W,background:ke,byId:V,now:h,canRetry:p,onRetry:y,onSupply:v,onOpenSession:g,onOpenFile:w,chat:T,approvals:M,questionWaits:L,onCompose:P})},oe.type==="turn"?`${t}:turn-${oe.turn}`:oe.segment.id))})}function k1({segment:t,sessionId:i,byId:r,now:a,onSupply:o,onOpenSession:u,approvals:c}){const h=I0();return t.kind==="worker-card"?m.jsx(i3,{ticket:B3(t,r),now:a,onSupply:o,onOpen:u}):t.kind==="canvas-card"?m.jsx(f_,{item:U3(t),onOpen:()=>h.open(t.canvasId)}):m.jsx(O3,{approval:H3(t,i,c),sessionId:i})}function B3(t,i){return i.get(t.ticketId)??{id:t.ticketId,status:t.status,revision:1,summary:t.summary,childSessionId:null,startedAt:null,events:[]}}function U3(t){return{id:t.canvasId,title:t.title,ticketId:t.ticketId,previewRevision:t.revision,stableRevision:null}}function H3(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 I3({segment:t,botLabel:i,onOpenInbox:r,onOpenFile:a}){const o=nc(t.text),u=Nh(t.text),{locale:c}=We(),h=D3(t.time,c);if(u)return m.jsx(r3,{briefing:u,time:h,mark:t.id,onOpenFile:a});if(o){const p=Q_([{kind:"in",id:t.id,seq:t.seq,time:t.time,mail:o}],i);return m.jsx(P_,{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(V3,{text:t.text})}),h?m.jsx("time",{children:h}):null]})}function V3({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 Y3(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(nc(o.segment.text)||Nh(o.segment.text))continue;if(o.segment.turn==null||o.segment.turn===r)return U0(o.segment.text).text;break}}return""}function F3(t,i){return t.slice(i+1).some(r=>r.type==="user")}function G3({seconds:t,failure:i,retries:r,prompt:a,continued:o,canRetry:u,onRetry:c,showLabel:h}){const{t:p}=We(),[y,v]=j.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 $3({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:C=!1,cwd:k,connectionPhase:M,approvals:L=[],questionWaits:P,onCompose:ie}){const{t:A}=We(),F=o4(i.segments),X=V=>P?.[V]??P?.[`${t}:${V}`],le=F.some(V=>V.type==="activity"),O=C&&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:[F.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(Fs,{text:V.segment.text,streaming:V.segment.streaming,onOpenFile:T})},V.segment.id);if(V.type==="question"){const ke=X(V.segment.callId);return m.jsx(C3,{segment:V.segment,sessionId:t,onCompose:ie,remainingMs:ke?.remainingMs,waitState:ke?.waitState},V.segment.id)}if(V.type==="card")return m.jsx(k1,{segment:V.segment,sessionId:t,byId:y,now:v,onSupply:x,onOpenSession:S,approvals:L},V.segment.id);const W=V.segments.filter(ke=>ke.kind==="tool");return m.jsxs(j.Fragment,{children:[m.jsx(u3,{segments:V.segments,cwd:k,tickets:[...y.values()],connectionPhase:M}),W.filter(ke=>DE(ke)).map(ke=>m.jsx(s3,{text:LE(ke.result,A)},ke.id))]},V.id)}),O?m.jsx("p",{className:"work-note",children:A("bot.stopped")}):null,m.jsx(G3,{seconds:i.seconds,failure:o[i.turn],retries:u[i.turn]??[],prompt:Y3(a,r,i.turn),continued:F3(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]})})}const Fu=8,E1=56;function Hb(){return{following:!0,programmaticTop:null,suppressRejoin:!1,lastTop:null,lastHeight:null}}function Gu(t){return t.scrollHeight-t.scrollTop-t.clientHeight}function X3(t,i){return i.scrollTop<=1&&Gu(i)<=Fu?!1:(t.following=!1,!0)}function Q3(t){t.following=!1}function Z3(t,i){const r=Gu(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<=E1&&(t.following=!0),t.lastTop=i.scrollTop,t.lastHeight=i.scrollHeight,{following:t.following,detached:!t.following&&r>Fu}}function Pd(t){return Math.max(0,t.scrollHeight-t.clientHeight)}function Ib(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 K3(t){const i=j.useRef(null),r=j.useRef(null),a=j.useRef(Hb()),o=j.useRef(!1),[u,c]=j.useState(!1),h=j.useCallback(v=>{if(!v){c(!1);return}const g=!a.current.following&&Gu(v)>Fu;c(w=>w===g?w:g)},[]),p=j.useCallback(()=>{const v=i.current;if(!v||!a.current.following){h(v);return}const g=Pd(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=j.useCallback((v="auto")=>{const g=i.current;if(a.current.following=!0,a.current.suppressRejoin=!1,c(!1),!g)return;const w=Pd(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 j.useLayoutEffect(()=>{const v=Hb();a.current=v,o.current=!1,c(!1);const g=i.current;if(!g)return;const w=Pd(g);v.programmaticTop=w,v.lastTop=w,v.lastHeight=g.scrollHeight,g.scrollTop=w},[t]),j.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=()=>{X3(a.current,v)&&(w(),h(v))},S=()=>{Q3(a.current),w(),h(v)},T=()=>{const X=Z3(a.current,v);X.following&&Gu(v)<=Fu&&(o.current=!1),c(le=>le===X.detached?le:X.detached)},C=X=>{X.deltaY<0&&!Ib(v,X.target)&&x()};let k=0;const M=X=>{k=X.touches[0]?.clientY??0},L=X=>{const le=X.touches[0]?.clientY??k;le>k+8&&!Ib(v,X.target)&&x(),k=le},P=X=>{if(X.altKey||X.metaKey||X.ctrlKey||X.shiftKey)return;const le=X.target;le instanceof HTMLInputElement||le instanceof HTMLTextAreaElement||le instanceof HTMLSelectElement||(X.key==="PageUp"||X.key==="ArrowUp"||X.key==="Home")&&x()},ie=X=>{const le=X.target;le instanceof Element&&le.closest("button.official-title, summary")&&S()},A=()=>{const X=document.getSelection();if(!X||X.isCollapsed)return;const le=X.anchorNode;!le||!v.contains(le)||S()},F=new ResizeObserver(()=>{p()});return F.observe(g),v.addEventListener("scroll",T,{passive:!0}),v.addEventListener("wheel",C,{passive:!0}),v.addEventListener("touchstart",M,{passive:!0}),v.addEventListener("touchmove",L,{passive:!0}),v.addEventListener("keydown",P),v.addEventListener("pointerdown",ie),document.addEventListener("selectionchange",A),p(),()=>{F.disconnect(),v.removeEventListener("scroll",T),v.removeEventListener("wheel",C),v.removeEventListener("touchstart",M),v.removeEventListener("touchmove",L),v.removeEventListener("keydown",P),v.removeEventListener("pointerdown",ie),document.removeEventListener("selectionchange",A)}},[t,h,p]),{scrollRef:i,contentRef:r,detached:u,pin:y,stickIfFollowing:p}}function Vb({label:t,onClick:i}){return m.jsx("button",{type:"button",className:"jump-latest","aria-label":t,onClick:i,children:m.jsx(S1,{})})}function Yb(){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 Fb(t,i,r){if(!(r in i))return i;const a={...i};return delete a[r],sessionStorage.setItem(t,JSON.stringify(a)),a}function Wd(t){try{const i=JSON.parse(sessionStorage.getItem(t)||"{}");return i&&typeof i=="object"?i:{}}catch{return{}}}function Gb(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 eh(t){fetch("/dsh-bot/api/sessions/previews",{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(t),keepalive:!0})}function J3(t){return(t??"").split("/").filter(Boolean).at(-1)??""}function P3(){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 W3(){const{t,locale:i,setLocale:r}=We(),[a,o]=j.useState(Yb),[u,c]=j.useState([]),[h,p]=j.useState(""),[y,v]=j.useState(""),[g,w]=j.useState(!1),[x,S]=j.useState(()=>Wd("dsh-bot.titles")),[T,C]=j.useState(()=>Wd("dsh-bot.previews")),[k,M]=j.useState(Jd),[L,P]=j.useState(""),[ie,A]=j.useState(null),[F,X]=j.useState(a);F!==a&&(X(a),M(Jd()));const[le,O]=j.useState(null),[V,W]=j.useState({ready:!1,reason:"loading"}),[ke,oe]=j.useState(null),[ge,re]=j.useState(null),[ce,xe]=j.useState(!1),[Te,R]=j.useState(""),[Ze,Ie]=j.useState([]),[q,z]=j.useState(!1),[ee,ue]=j.useState(0);j.useEffect(()=>{Ie([])},[a]);const[ve,ze]=j.useState(0),[ye,be]=j.useState(0),[K,de]=j.useState(""),[et,mt]=j.useState(""),[Ee,De]=j.useState(!1),[Me,Ve]=j.useState(null),[Ae,Ue]=j.useState(null),[rt,ae]=j.useState(null),[Be,ft]=j.useState([]),[Qt,Bt]=j.useState({}),[Q,se]=j.useState(!1),[Oe,Ne]=j.useState(!1),[we,pe]=j.useState({}),[Le]=j.useState(()=>J0(async()=>{const N=await nt("/authorization");if(N.status!==200)throw new Error("Authorization catalog unavailable");return{available:N.body.available,entries:N.body.entries}})),Ke=j.useRef(void 0),st=j.useRef(null),[bt,vt]=j.useState(null),[xn,Nt]=j.useState(0),[Ct,pt]=j.useState(!1),[Ft,pi]=j.useState(()=>new Set),[Vn,Z]=j.useState(()=>new Set),[he,Et]=j.useState(!1),[yt,ot]=j.useState(!1),[Mt,jt]=j.useState(""),[jl,tr]=j.useState(0),[zn,zi]=j.useState(()=>new Set),[li,Mi]=j.useState({}),[qi,Tl]=j.useState({}),[nr,$s]=j.useState(!1),[ac,Xs]=j.useState({}),[ir,Hr]=j.useState(()=>Date.now()),[Nl,Aa]=j.useState(""),Qs=G_(a,jl);j.useEffect(()=>{ft([]),Bt({});const N=lO({visible:!document.hidden,fetch:async J=>{const me=await nt(`/interactions?compact=1&sessionId=${encodeURIComponent(a)}`,{signal:J});if(me.status!==200)throw new Error("Interactions unavailable");return me.body},active:J=>{const me=J;return!!(me.questions?.length||me.approvals?.some(_e=>_e.state==="open")||me.authorization?.prompts?.length||me.authorization?.inFlight?.length)},apply:J=>{const me=J,_e=Array.isArray(me.approvals)?me.approvals:[];ft(_e);const je={};if(Array.isArray(me.questions))for(const St of me.questions)typeof St.callId=="string"&&St.callId!==""&&(je[St.callId]={remainingMs:St.remainingMs,waitState:St.waitState});Bt(je);const Je=me.authorization,Ot=Je&&typeof Je=="object"?Je.prompts:[];Ne(Array.isArray(Ot)&&Ot.length>0);const Ge=Je&&typeof Je=="object"?Je:{},Pe=JSON.stringify([Ge.catalogRevision,Ge.available]);Ke.current!==Pe&&(Ke.current=Pe,Le.invalidate()),pe(St=>JSON.stringify(St)===JSON.stringify(Ge)?St:Ge)},schedule:(J,me)=>{const _e=window.setTimeout(J,me);return()=>window.clearTimeout(_e)}});st.current=N;const I=()=>N.setVisible(!document.hidden);return document.addEventListener("visibilitychange",I),()=>{N.close(),st.current===N&&(st.current=null),document.removeEventListener("visibilitychange",I)}},[a,Le]),j.useEffect(()=>{nt("/cua").then(N=>se(N.body.available===!0))},[]);const{scrollRef:Ir,contentRef:Ra,detached:Cl,pin:Al,stickIfFollowing:_a}=K3(`${yt?"bot":"main"}:${a}`),Yn=j.useRef(null),Zt=j.useRef(null),on=j.useRef(null),yi=j.useRef(null),Rl=j.useRef(new Set),Zs=j.useRef(0),_l=j.useRef(new Map),Vr=j.useRef(0),Di=j.useRef(new Map),Yr=j.useRef(!1),Li=j.useRef(a),ai=j.useRef(null);Li.current=a;function Fn(N){return li[N.sessionId]||x[N.sessionId]||N.title||J3(N.cwd)||t("session.unnamed")}function Bi(N){const I=u.find(J=>J.sessionId===N);return I?Fn(I):li[N]||x[N]||""}const rr=K0(k.segments),Ut=a!==""&&L!==a&&(ie==null||ie.phase==="restoring"||ie.phase==="connecting"||ie.phase==="syncing"&&L!==a),Ks=ie?.fraction!=null?{loaded:Math.round(ie.fraction*1e3),total:1e3}:null,Ol=ie?.phase==="syncing"&&ie.fraction!=null,Fr=j.useMemo(()=>X_(k.segments),[k.segments]),Ui=j.useMemo(()=>r4(Fr),[Fr]),lr=a?Fn({sessionId:a,cwd:u.find(N=>N.sessionId===a)?.cwd,title:k.title||null}):t("app.title"),sc=a?`/#/s/${encodeURIComponent(a)}`:"/";function Gr(N){ot(!1),o(N),De(!1),pt(!1),vt(null),O(null),mt(""),jt("");const I=N?`#/s/${encodeURIComponent(N)}`:"#/";location.hash!==I&&history.replaceState(null,"",I)}function Js(N){if(!N||N===a)return;const I=a;ot(!1),o(N),De(!1),pt(!1),vt(null),O(null),mt(""),jt("");const J=`#/s/${encodeURIComponent(N)}`;location.hash!==J&&history.pushState({kind:"worker",owner:I},"",J)}function Ps(){if(ot(!1),De(!1),pt(!1),vt(null),history.state?.kind==="worker"){history.back();return}Nl&&Gr(Nl)}j.useEffect(()=>{let N=!1;return P3().then(I=>{N||pi(new Set(I))}),()=>{N=!0}},[]);function dt(N){const I=NE(N);I&&(Xs(I.signals),Tl(I.cards),$s(!0));const J=N.desk;if(!J||typeof J!="object"||Array.isArray(J))return;const me=J,_e=me.sessions;if(_e&&typeof _e=="object"&&!Array.isArray(_e)){const Ge=_e,Pe=Ge.result;if(Pe?.ok!==!0)p(Pe?.error?.message||String(Ge.error||t("session.listUnavailable")));else if(p(""),c(vi(Pe.value?.items)),gn(Ge.previews),!Yr.current){Yr.current=!0;const St=Gb(Ge.previews),xt={};for(const[Vt,Zn]of Object.entries(Wd("dsh-bot.previews")))Rl.current.has(Vt)||St[Vt]||!Zn||(xt[Vt]=Zn);Object.keys(xt).length>0&&eh({previews:xt})}}const je=me.bots;if(je&&typeof je=="object"&&!Array.isArray(je)&&je.ok===!0){const Ge=je,Pe=Array.isArray(Ge.bots)?Ge.bots:[],St=Pe.flatMap(Vt=>{if(!Vt||typeof Vt!="object")return[];const Zn=Vt.sessionId;return typeof Zn=="string"?[Zn]:[]}),xt={};for(const Vt of Pe){if(!Vt||typeof Vt!="object")continue;const Zn=Vt.sessionId,Qr=Vt.name;typeof Zn=="string"&&typeof Qr=="string"&&Qr!==""&&(xt[Zn]=Qr)}if(St.length===0&&Array.isArray(Ge.sessionIds))for(const Vt of Ge.sessionIds)typeof Vt=="string"&&St.push(Vt);zi(new Set(St)),Mi(xt)}const Je=me.health;if(Je&&typeof Je=="object"&&!Array.isArray(Je)){const Ge=Je;oe(Ge),Ge.execution&&W({ready:Ge.execution.ready===!0,reason:Ge.execution.reason||(Ge.execution.ready===!0?"":"catalog_unreadable")})}const Ot=me.usage;Ot&&typeof Ot=="object"&&!Array.isArray(Ot)&&re(Ot)}j.useEffect(()=>{let N=!1;return(async()=>{try{const I=await nt("/sessions");if(N)return;const J=I.body.result;J?.ok===!0?(p(""),c(vi(J.value?.items)),gn(I.body.previews)):I.status!==200&&p(J?.error?.message||t("session.listUnavailable"))}catch{}try{const I=await nt("/sessions/bots");if(N||I.body.ok!==!0)return;const J=Array.isArray(I.body.bots)?I.body.bots:[],me=J.flatMap(je=>{if(!je||typeof je!="object")return[];const Je=je.sessionId;return typeof Je=="string"?[Je]:[]}),_e={};for(const je of J){if(!je||typeof je!="object")continue;const Je=je.sessionId,Ot=je.name;typeof Je=="string"&&typeof Ot=="string"&&Ot!==""&&(_e[Je]=Ot)}if(me.length===0&&Array.isArray(I.body.sessionIds))for(const je of I.body.sessionIds)typeof je=="string"&&me.push(je);zi(new Set(me)),Mi(_e)}catch{}})(),()=>{N=!0}},[]),j.useEffect(()=>{let N=!1,I=null,J=0,me=2e3,_e,je;const Je=Pe=>{let St;try{St=JSON.parse(String(Pe.data))}catch{return null}return St.ok===!0?St:null},Ot=()=>{if(I?.close(),_e=void 0,je=void 0,N||document.hidden||typeof EventSource>"u")return;const Pe=new EventSource(`/dsh-bot/api/live?sessionId=${encodeURIComponent(a)}`);I=Pe,Pe.addEventListener("interaction-error",()=>{!N&&I===Pe&&st.current?.disconnected()}),Pe.addEventListener("interactions",St=>{if(N||I!==Pe)return;const xt=Je(St);xt?.sessionId===a&&(me=2e3,st.current?.ingest(xt))}),Pe.addEventListener("canvas",St=>{if(N||I!==Pe)return;const xt=Je(St);!xt||!Array.isArray(xt.events)||xt.events.length===0||(me=2e3,Nt(Vt=>Vt+1))}),Pe.addEventListener("snapshot",St=>{if(N||I!==Pe)return;const xt=Je(St);xt&&(me=2e3,xt.desk!==void 0&&(_e=xt.desk),xt.work!==void 0&&(je=xt.work),dt(xt))}),Pe.addEventListener("delta",St=>{if(N||I!==Pe)return;const xt=Je(St);if(!xt)return;const Vt={ok:!0};xt.desk!==void 0&&_e!==void 0&&(_e=Bs(_e,xt.desk),Vt.desk=_e),xt.work!==void 0&&je!==void 0&&(je=Bs(je,xt.work),Vt.work=je),(Vt.desk!==void 0||Vt.work!==void 0)&&dt(Vt)}),Pe.addEventListener("error",()=>{N||I!==Pe||(st.current?.disconnected(),Pe.close(),I===Pe&&(I=null),J=window.setTimeout(Ot,me),me=Math.min(15e3,me*2))})},Ge=()=>{window.clearTimeout(J),document.hidden?(I?.close(),I=null):(me=2e3,Ot())};return document.addEventListener("visibilitychange",Ge),Ot(),()=>{N=!0,document.removeEventListener("visibilitychange",Ge),window.clearTimeout(J),I?.close()}},[a]),j.useEffect(()=>{const N=()=>{ot(!1),De(!1),pt(!1),vt(null),O(null),mt(""),jt(""),o(Yb())};return window.addEventListener("hashchange",N),()=>window.removeEventListener("hashchange",N)},[]),j.useEffect(()=>{let N=!1;return fv().then(J=>{N||(ai.current=Ob({follow:Ab({addressOf:me=>Sa(me)}),page:zb({addressOf:me=>Sa(me)}),cdc:qb({cache:J}),range:_b(),checkpoint:J}))}),()=>{N=!0}},[]),j.useEffect(()=>{if(!a){P(""),A(null);return}M(Jd()),A(null);let N=!1,I=null;return(async()=>{const J=await fv();if(N)return;const me=ai.current??Ob({follow:Ab({addressOf:je=>Sa(je)}),page:zb({addressOf:je=>Sa(je)}),cdc:qb({cache:J}),range:_b(),checkpoint:J});ai.current=me;const _e=me.open(a,{enhancement:"auto"});I=_e,_e.onBatch(je=>{N||Li.current!==a||(M(Je=>{let Ot=Je;for(const Ge of je.events)Ot=T4(Ot,Ge);return Ot}),P(a))}),_e.onEphemeral(je=>{N||Li.current!==a||M(Je=>A4(Je,je))}),_e.onStatus(je=>{N||Li.current!==a||(A(je),(je.phase==="live"||je.phase==="stalled"||je.phase==="error")&&P(a))})})(),()=>{N=!0,I?.close()}},[a]),j.useEffect(()=>{!a||F!==a||!k.title||li[a]||S(N=>{if(N[a]===k.title)return N;const I={...N,[a]:k.title};return sessionStorage.setItem("dsh-bot.titles",JSON.stringify(I)),I})},[a,F,k.title,li]);const ar=!!a&&zn.has(a),nn=ar&&nr?qi[a]??[]:[],sr=ar&&nr?a:"";j.useEffect(()=>{if(!a||!ba(a)){Aa("");return}let N=!1;const I=EE(a);return Ri(`/dsh-bot/api/work/ticket?id=${encodeURIComponent(I)}`).then(J=>{if(N||J.body.ok!==!0||!J.body.ticket||typeof J.body.ticket!="object")return;const me=J.body.ticket.owner_session_id;typeof me=="string"&&Aa(me)}),()=>{N=!0}},[a]);const Gn=nn.some(N=>N.status==="started");j.useEffect(()=>{if(!Gn)return;const N=window.setInterval(()=>Hr(Date.now()),1e3);return()=>window.clearInterval(N)},[Gn]);function gn(N){const I=Gb(N);Object.keys(I).length!==0&&C(J=>{let me=!1;const _e={...J};for(const[je,Je]of Object.entries(I))_e[je]||(_e[je]=Je,me=!0);return me?(sessionStorage.setItem("dsh-bot.previews",JSON.stringify(_e)),_e):J})}function Oa(){window.clearTimeout(Vr.current),Vr.current=0;const N=[..._l.current];if(_l.current.clear(),N.length!==0){if(N.length===1){const[I,J]=N[0]??[];I&&J&&eh({sessionId:I,preview:J});return}eh({previews:Object.fromEntries(N)})}}j.useEffect(()=>()=>{Oa()},[]),j.useEffect(()=>{if(!a||F!==a)return;const N=R4(k.segments);!N||Di.current.get(a)===N||(Di.current.set(a,N),C(I=>{if(I[a]===N)return I;const J={...I,[a]:N};return sessionStorage.setItem("dsh-bot.previews",JSON.stringify(J)),J}),_l.current.set(a,N),window.clearTimeout(Vr.current),Vr.current=window.setTimeout(Oa,400))},[a,F,k.segments]),j.useLayoutEffect(()=>{const N=yi.current;if(!N||!Me)return;const I=N.getBoundingClientRect(),J=Math.max(8,Math.min(Me.x,window.innerWidth-I.width-8)),me=Math.max(8,Math.min(Me.y,window.innerHeight-I.height-8));(J!==Me.x||me!==Me.y)&&Ve(_e=>_e&&{..._e,x:J,y:me}),N.querySelector("button")?.focus()},[Me]),j.useEffect(()=>{if(!Me)return;const N=()=>Ve(null),I=me=>{const _e=me.target;_e instanceof Node&&yi.current?.contains(_e)||N()},J=me=>{me.key==="Escape"&&N()};return document.addEventListener("pointerdown",I),document.addEventListener("keydown",J),document.addEventListener("scroll",N,!0),()=>{document.removeEventListener("pointerdown",I),document.removeEventListener("keydown",J),document.removeEventListener("scroll",N,!0)}},[Me]),j.useEffect(()=>{if(!Ee)return;const N=J=>{const me=J.target;me instanceof Node&&on.current?.contains(me)||De(!1)},I=J=>{J.key==="Escape"&&De(!1)};return document.addEventListener("pointerdown",N),document.addEventListener("keydown",I),()=>{document.removeEventListener("pointerdown",N),document.removeEventListener("keydown",I)}},[Ee]),j.useEffect(()=>{ot(!1)},[a]),j.useLayoutEffect(()=>{const N=Yn.current,I=Ir.current;if(!N||!I)return;const J=()=>{const _e=Number.parseFloat(getComputedStyle(N).getPropertyValue("--composer-fade"))||0,Je=(N.hidden?0:Math.max(0,N.offsetHeight-_e))+E1;(Number.parseFloat(I.style.paddingBottom)||0)!==Je&&(I.style.paddingBottom=`${Je}px`,_a())};J();const me=new ResizeObserver(J);return me.observe(N),()=>{me.disconnect(),I.style.paddingBottom=""}},[yt,q,Ir,_a]);const zl=j.useMemo(()=>{const N=y.trim().toLowerCase();return u.filter(I=>ba(I.sessionId)||Ft.has(I.sessionId)||I.blank===!0&&!Vn.has(I.sessionId)?!1:N?[Fn(I),I.cwd??"",T[I.sessionId]??""].join(" ").toLowerCase().includes(N):!0)},[u,y,x,T,Ft,li,Vn]),Ws=j.useMemo(()=>!a||!zn.has(a)?[]:u.flatMap(N=>!zn.has(N.sessionId)||N.sessionId===a||Ft.has(N.sessionId)||N.blank===!0&&!Vn.has(N.sessionId)||ba(N.sessionId)?[]:[{sessionId:N.sessionId,label:Fn(N)}]),[u,zn,a,Ft,li,x,Vn]),gi=a&&zn.has(a)?X4(Te,ve):null,vn=gi?`${gi.start}:${gi.query}`:"",$n=gi?J4(Ws,gi.query):[],za=gi!=null&&K!==vn,$r=Math.min(ye,Math.max($n.length-1,0));j.useEffect(()=>{be(0)},[vn]),j.useEffect(()=>{Z(N=>{let I=!1;const J=new Set(N);for(const me of N){const _e=u.find(je=>je.sessionId===me);_e&&_e.blank!==!0&&(J.delete(me),I=!0)}return I?J:N})},[u]);function vi(N){const I=Rl.current;return(N??[]).filter(J=>!I.has(J.sessionId))}function eo(N){Rl.current.add(N),_l.current.delete(N),Di.current.delete(N),c(I=>I.filter(J=>J.sessionId!==N)),pi(I=>{const J=new Set(I);return J.delete(N),J}),S(I=>Fb("dsh-bot.titles",I,N)),C(I=>Fb("dsh-bot.previews",I,N)),zi(I=>{if(!I.has(N))return I;const J=new Set(I);return J.delete(N),J}),Mi(I=>{if(!(N in I))return I;const J={...I};return delete J[N],J}),a===N&&Gr("")}function to(N,I){N.preventDefault(),Ve({id:I,x:N.clientX,y:N.clientY})}function Hi(N){return t(N==="fence"?"session.deleteFence":N==="stop"?"session.deleteStop":N==="idle"?"session.deleteIdle":N==="store"?"session.deleteStore":N==="canvas"?"session.deleteCanvas":N==="files"?"session.deleteFiles":N==="cache"?"session.deleteCache":N==="done"?"session.deleteDone":"session.deleteProgress")}function no(N){return N.error==="running"?t("session.deleteBusy"):N.error==="session_unreadable"?t("session.deleteUnreadable"):N.error||t("session.deleteFailed")}async function Ma(N,I){if(I.phase==="error")return Ue({id:N,phase:"error",percent:I.percent,error:no(I)}),!1;if(I.phase!=="done")return Ue({id:N,phase:I.phase,percent:I.percent,error:t("session.deleteFailed")}),!1;const J=I.deletedSessionIds?.length?I.deletedSessionIds:[N];Ue({id:N,phase:"cache",percent:94,error:""});try{await Lk(J)}catch{}for(const me of J)eo(me);return p(""),Ue(null),!0}async function qa(N){if(Ae&&Ae.error===""&&Ae.id!==N)return!1;Ue({id:N,phase:"fence",percent:8,error:""});try{const I=await fetch(`/dsh-bot/api/sessions/${encodeURIComponent(N)}/delete`,{method:"POST",headers:{accept:"application/x-ndjson"}});if(!(I.headers.get("content-type")??"").includes("ndjson")){const _e=await I.json().catch(()=>({}));return Ue({id:N,phase:"error",percent:8,error:_e.message||_e.error||t("session.deleteFailed")}),!1}const me=await ck(I,_e=>{_e.phase!=="done"&&Ue({id:N,phase:_e.phase,percent:_e.percent,error:_e.phase==="error"?no(_e):""})});return me?Ma(N,me):Ml(N)}catch{return Ml(N)}}async function Ml(N){for(let I=0;I<40;I+=1){const J=await nt(`/sessions/${encodeURIComponent(N)}/delete`),me=typeof J.body.phase=="string"?J.body.phase:"absent";if(me==="absent")break;const _e={phase:me,percent:typeof J.body.percent=="number"?J.body.percent:8,...typeof J.body.error=="string"?{error:J.body.error}:{},...Array.isArray(J.body.deletedSessionIds)?{deletedSessionIds:J.body.deletedSessionIds.filter(je=>typeof je=="string")}:{}};if(me!=="done"&&me!=="error"){Ue({id:N,phase:me,percent:_e.percent,error:""}),await new Promise(je=>setTimeout(je,400));continue}return Ma(N,_e)}return Ue({id:N,phase:"error",percent:8,error:t("session.deleteFailed")}),!1}async function oc(N,I,J){Et(!1),J!==""&&(Mi(je=>({...je,[N]:J})),zi(je=>new Set([...je,N])),S(je=>{const Je={...je,[N]:J};return sessionStorage.setItem("dsh-bot.titles",JSON.stringify(Je)),Je})),Z(je=>new Set(je).add(N));const _e=(await nt("/sessions")).body.result;c(vi(_e?.value?.items)),Gr(N),jt(I),tr(je=>je+1)}function io(N,I){R(N),ze(I),window.requestAnimationFrame(()=>{const J=Zt.current;J&&(J.focus(),J.setSelectionRange(I,I))})}function Xr(N){if(!gi)return;const I=K4(Te,ve,gi.start,N.label,N.sessionId);io(I.text,I.cursor)}function Xn(N="/"){De(!1),R(I=>{const J=I.replace(/\s+$/,"");return J===""?N==="/"?"/":`${N} `:`${J} ${N==="/"?"/":`${N} `}`}),window.requestAnimationFrame(()=>Zt.current?.focus())}async function ql(N){const I=le?.status==="accepted"&&k.drafting,J=sr===a?nn:[];if(!a||!N||!V.ready||mv(I,J,zn.has(a)))return!1;Al();const me=k.drafting;R(""),mt(""),Zs.current+=1;const _e=Number.MAX_SAFE_INTEGER-Zs.current;M(Ot=>({...Ot,drafting:!0,segments:[...Ot.segments,{kind:"user",id:`optimistic:${_e}`,text:N,time:Date.now(),seq:_e,optimistic:!0}]}));const je=await nt("/tasks",{method:"POST",headers:{"content-type":"application/json","idempotency-key":crypto.randomUUID()},body:JSON.stringify({sessionId:a,text:N})}),Je=je.body.task;if(O(Je??null),je.status!==202){M(Ge=>({...Ge,drafting:me?Ge.drafting:!1,segments:Ge.segments.filter(Pe=>!(Pe.kind==="user"&&Pe.optimistic&&Pe.text===N))}));const Ot=je.body.execution;return mt(Ot?.reason||Vu(String(je.body.error||""),t("composer.notSent"),t)),!1}return!0}async function Dl(){const N=Te.trim();if(!N||!Qn)return;const I=Ze,J=I.map($R).join(`
|
|
70
|
-
`),me=J?`${
|
|
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 Ta([...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?ic(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},Ta(o)}function m4(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 Ta([...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 ju(t,i,r,a){return p1(t,i,r).map(u=>u.index===i?a({...u,kind:r}):u)}function p4(t,i){const r=ht(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:Tb(i.texts);return ju(t,r,"text",u=>({...u,text:u.text+o}))}if(a==="reasoning-delta"||a==="reasoning-chunks"){const o=typeof i.text=="string"?i.text:Tb(i.texts);return ju(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:Uu(i.args??i.arguments);return ju(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 ju(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:Uu(o.arguments)||c.args}))}return t}function Tb(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=ht(r.turn),u=ht(r.step),c=rc(o,u),h=t.live[c]??{seq:i.seq??0,blocks:[]},p=p4(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:m4({...t},c,p,v,o,u)}}function g1(t,i){const r=i.data??{},a=im(r),o=a?.content??[],u=ht(r.turn),c=ht(r.step),h=rc(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:Uu(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?ic(g.name||T.name,T.result,T.error,T.errorCode):T.status:"preparing",seq:x,turn:u,step:c})}}),{...t,live:p,segments:Ta(y)}}function y4(t,i){const r=i.data??{},a=typeof r.callId=="string"?r.callId:"";if(!a)return t;const o=ht(r.turn),u=ht(r.step);return{...t,segments:m1(t.segments,{kind:"tool",id:`tool:${a}`,callId:a,name:typeof r.name=="string"?r.name:"tool",args:Uu(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 g4(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=ht(r.turn),h=ht(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:ic(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 v4(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 b4(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:ht(a.time)??0,chunk:a.chunk});continue}const o=ht(a.index)??0,u=Array.isArray(a.texts)?a.texts:Array.isArray(a.args)?a.args:null;if(!u)continue;let c=ht(a.time0)??0;const h=Array.isArray(a.dt)?a.dt:[];u.forEach((p,y)=>{y>0&&(c+=ht(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=rc(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 x4(t,i){const r=t.streamAttempt;if(!r||i.surfaceOp!=null&&i.surfaceOp!=="append")return!1;const a=i.data??{};return ht(a.turn)!==r.turn||ht(a.step)!==r.step?!1:i.seq==null||i.seq>r.startedAfterSeq}function As(t){const i=t.pendingAssistant;return{...i?g1(t,i):t,pendingAssistant:null,streamAttempt:null}}function w4(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 S4(t,i){const r=ht(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=ht(u.turn),p=ht(u.step),y=ht(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=b4(u.stream),g=Math.min(ht(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 k4(t,i){const r=typeof i.type=="string"?i.type:"",a=ht(i.revision),o=typeof i.attemptId=="string"?i.attemptId:"";if(a==null||!o||a<=t.streamRevision)return t;if(r==="start"){const c=ht(i.turn),h=ht(i.step);if(c==null||h==null||x1(t,c,h))return t;const p=t.pendingAssistant?As(t):t;return{...jh(p,c,h,!0),drafting:!0,streamRevision:a,streamAttempt:{attemptId:o,turn:c,step:h,nextIndex:0,startedAfterSeq:ht(i.startedAfterSeq)??t.streamRevision}}}if(a!==t.streamRevision+1)return{...As(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=ht(i.index),h=i.chunk;if(c==null||!h||typeof h!="object")return{...t,streamRevision:a};if(c!==u.nextIndex)return{...As(t),streamRevision:a};const p=rc(u.turn,u.step),y=t.live[p]?.seq||v1(t,u.startedAfterSeq);return{...b1(t,u.turn,u.step,ht(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"?{...As(h),streamRevision:a}:{...w4(h,u.turn,u.step),streamRevision:a}}return{...t,streamRevision:a}}function E4(t,i,r=!1){const a=ht(t.pendingAssistant?.data?.turn),o=t.pendingAssistant&&(i==null||a===i)?As(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 j4(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 T4(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=ht(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=ht(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:l4(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=E4(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=ht(a.turn),c=typeof a.retryId=="string"?a.retryId:"",h=ht(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:ht(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=ht(a.turn),c=typeof a.retryId=="string"?a.retryId:"",h=ht(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:a4(r.segments,{kind:"user",id:`user:${i.seq??c}`,text:c,time:i.time,seq:i.seq??Number.MAX_SAFE_INTEGER,turn:ht(a.turn)})}),r}if(i.type==="assistant/message")return x4(r,i)?r={...r,pendingAssistant:i}:r=g1(r,i),r;if(i.type==="tool/call")return r=y4(r,i),r;i.type==="tool/result"&&(r=g4(r,i));const o=N4(i);return o&&(r={...r,segments:C4(r.segments,o)}),r}function N4(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 C4(t,i){return Ta([...t.filter(r=>r.id!==i.id),i])}function A4(t,i){const r=v4(i)??(i&&typeof i=="object"?i:null);if(!r)return t;let a=t;if(r.type==="snapshot"){a=j4(a,r);const o=r.assistantStream;o&&typeof o=="object"&&(a=S4(a,o))}if(r.type==="assistant-stream"){const o=r.frame;o&&typeof o=="object"&&(a=k4(a,o))}return a}function R4(t){for(let i=t.length-1;i>=0;i-=1){const r=t[i];if(!r||r.kind==="user"&&yx(r.text)||lm(r))continue;const a=r.kind==="user"?nc(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||s4(r.name,r.args):h4(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 Iu(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Nb(t,i){if(!Iu(t))return;if(i==="ticket.id"){const a=t.ticket;if(!Iu(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 Bs(t,i){if(!Iu(i)||i.t!=="v"&&i.t!=="o"&&i.t!=="l")return t;const r=i;return r.t==="v"?r.v:r.t==="o"?_4(t,r):O4(t,r)}function _4(t,i){const r=Iu(t)?{...t}:{};for(const a of i.d??[])delete r[a];for(const[a,o]of Object.entries(i.s))r[a]=Bs(r[a],o);return r}function O4(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=Nb(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(Bs(void 0,y));continue}u[v]=Bs(u[v],y)}if(!i.order)return u;const h=new Map;for(const p of u){const y=Nb(p,r);y!==void 0&&h.set(y,p)}return i.order.filter(p=>h.has(p)).map(p=>h.get(p))}class z4{appliedSeq;headSeq=null;pending=new Map;pendingBytes=0;constructor(i=-1){this.appliedSeq=i}setHead(i){(this.headSeq==null||i>this.headSeq)&&(this.headSeq=i)}push(i){const r=[];for(const u of i)if(!(typeof u.seq!="number"||!Number.isFinite(u.seq))&&!(u.seq<=this.appliedSeq)){if(u.seq===this.appliedSeq+1){r.push(u),this.appliedSeq=u.seq,this.flushPending(r);continue}this.pending.has(u.seq)||(this.pending.set(u.seq,u),this.pendingBytes+=Cb(u))}let a=null;(this.pending.size>bk||this.pendingBytes>xk)&&(a={afterSeq:this.appliedSeq,dropped:this.pending.size},this.pending.clear(),this.pendingBytes=0);const o=this.nextGap();return{delivered:r,gapTo:o,overflow:a}}flushPending(i){for(;this.pending.has(this.appliedSeq+1);){const r=this.pending.get(this.appliedSeq+1);if(this.pending.delete(this.appliedSeq+1),!r)break;this.pendingBytes=Math.max(0,this.pendingBytes-Cb(r)),i.push(r),this.appliedSeq=r.seq}}nextGap(){if(this.pending.size===0)return null;let i=Number.POSITIVE_INFINITY;for(const r of this.pending.keys())r<i&&(i=r);return Number.isFinite(i)?i:null}}function Cb(t){return 64+(typeof t.type=="string"?t.type.length:0)}function Sa(t,i){return{kind:"session",sessionId:t}}function Ab(t){const i=t.addressOf??(a=>Sa(a)),r=t.openingMessages??fk;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"&&M4(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 M4(t,i,r){const a=w1(t);if(!a)return;if(a.type==="snapshot"){const u=typeof a.cursor=="number"?a.cursor:-1,c=Us(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=Us(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 Us(t){const i=[];return Ru(t,i),i.sort((r,a)=>r.seq-a.seq)}function Ru(t,i){if(!t)return;if(Array.isArray(t)){for(const o of t)Ru(o,i);return}if(typeof t!="object")return;const r=t;if(r.event&&typeof r.event=="object"){const o=Rb(r.event);o&&i.push(o);return}const a=Rb(r);a&&i.push(a),Array.isArray(r.records)&&Ru(r.records,i),Array.isArray(r.events)&&Ru(r.events,i)}function Rb(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 _b(t={}){const i=t.fetch??fetch,r=t.url??Zb;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(mk)}),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=Us(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 q4(t=fetch,i=Zb,r){try{return(await t(i,{method:"HEAD",credentials:"same-origin",signal:r})).ok}catch{return!1}}const D4=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 L4(){return typeof document<"u"&&document.visibilityState==="hidden"}function Ob(t){return{open(i,r){return B4(t,i,r??{})}}}function B4(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(K=>{p=K});let v=!1;const g=K=>{v||(v=!0,p(K))};let w=[],x=!1,S=null;const T=t.raf??(typeof requestAnimationFrame=="function"?requestAnimationFrame:K=>setTimeout(K,0)),N=t.cancelRaf??(typeof cancelAnimationFrame=="function"?cancelAnimationFrame:clearTimeout),j=()=>{S!=null&&(S.kind==="timer"?clearTimeout(S.id):N(S.id),S=null)},q=t.wait??H4,B=t.random??Math.random,P=t.now??Date.now,ie=t.isHidden??L4,A=()=>{if(S=null,w.length===0)return;const K=w;w=[];const de={events:K,fromCache:x};x=!1;for(const tt of o)tt(de)},L=()=>{j(),A()},G=(K,de=!1)=>{if(K.length===0||(de&&(x=!0),w.push(...K),S!=null))return;const tt={kind:ie()?"timer":"raf",id:null};S=tt,tt.id=tt.kind==="timer"?setTimeout(A,0):T(A)},le=K=>{h={...h,...K,lag:(K.headSeq??h.headSeq)==null||(K.appliedSeq??h.appliedSeq)==null?K.lag??h.lag:(K.headSeq??h.headSeq)-(K.appliedSeq??h.appliedSeq)};for(const de of c)de(h)};let O=0,Y=!1,W=0,ke=!0,oe=null,ge=!1,re=null,ce=null,xe=!1,Te=P(),R=Number.NEGATIVE_INFINITY;const Ze=async K=>{if(a.signal.aborted)return;if(ge){ge=!1;return}const de=new AbortController;oe=de;const tt=()=>de.abort();a.signal.addEventListener("abort",tt,{once:!0});try{await q(K,de.signal)}catch{}finally{a.signal.removeEventListener("abort",tt),oe===de&&(oe=null)}},Ie=()=>{const K=xe;return xe=!1,K},M=K=>{if(!ke||a.signal.aborted)return;L();const de=P(),tt=ce?ce():!0,mt=de-Te>=Ck,Ee=!tt||K.reason==="online"||K.persisted===!0||K.hiddenMs>=Nk||K.reason!=="focus"&&mt;if(W=0,O=0,Y=!1,oe){oe.abort();return}if(!re){ge=!0;return}Ee&&(de-R<Ak||(R=de,re.signal.aborted||(xe=!0,re.abort())))};z();async function z(){try{await ee()}finally{ke=!1,be()}}async function ee(){const K=await t.checkpoint.getCursor(i);let de=K?.appliedSeq??-1;const tt=await t.checkpoint.readEvents(i,-1),mt=U4(tt,-1).filter(Ae=>Ae.seq<=de||de<0);de<0&&mt.length&&(de=mt[mt.length-1].seq);const Ee=new z4(de);K?.headSeq!=null&&Ee.setHead(K.headSeq),mt.length&&G(mt,!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&&(G(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,rt)=>{if(Ue<=Ae)return{ok:!0,throughSeq:Ue};le({phase:"syncing",fraction:h.fraction});const ae=Ue-Ae,Be=Me(),ft=De&&t.cdc!=null&&(ae>pk||ae*128>yk);if(De&&t.range!=null&&!ft&&t.range){const Bt=await t.range.fetch({sessionId:i,afterSeq:Ae,throughSeq:Ue},Be,rt);if(Bt.ok||rt.aborted)return Bt;De=!1}else if(ft&&t.cdc){const Bt=await t.cdc.fetch({sessionId:i,afterSeq:Ae,throughSeq:Ue},Be,rt);if(Bt.ok||rt.aborted)return Bt;De=!1}return t.page.fetch({sessionId:i,afterSeq:Ee.appliedSeq,throughSeq:Ue},Be,rt)};for(;!a.signal.aborted;){if(Y){le({phase:"stalled",appliedSeq:Ee.appliedSeq,headSeq:Ee.headSeq,fraction:null});const pe=new AbortController,Le=()=>pe.abort();a.signal.addEventListener("abort",Le);const Ke=Ee.headSeq??Ee.appliedSeq,st=await t.page.fetch({sessionId:i,afterSeq:Ee.appliedSeq,throughSeq:Math.max(Ke,Ee.appliedSeq)},Me(),pe.signal);a.signal.removeEventListener("abort",Le),st.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})),W+=1;const bt=Tu(W,B);await Ze(Math.min(bt,wk)),Y=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 rt=()=>{a.signal.removeEventListener("abort",Ue),Ae.abort(),re===Ae&&(re=null,ce=null)};let ae=null;const Be=Me(),ft=()=>{re===Ae&&(Te=P())},Qt={events(pe,Le){ft(),Be.events(pe,Le)},head(pe){ft(),Be.head(pe)},progress:Be.progress,ephemeral(pe){ft(),Be.ephemeral(pe)},opened(pe){ft(),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},Qt,Ae.signal),Q=await Promise.race([Bt.then(pe=>({kind:"done",outcome:pe})),I4(()=>ae!=null,Ae.signal,q).then(()=>({kind:"opened"}))]),se=ae;if(Q.kind==="done"||se==null||Ae.signal.aborted){if(rt(),a.signal.aborted)break;if(Ie())continue;O+=1,O>=Rd&&(Y=!0),W+=1,await Ze(Tu(W,B));continue}O=0,W=0;const Oe=se.firstSeq-1,Ne=await Ve(Ee.appliedSeq,Oe,Ae.signal);if(Ae.signal.aborted){if(rt(),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}),rt();break}if(!Ne.ok){rt(),le({phase:"stalled",error:{code:Ne.code,message:Ne.message??Ne.code,retrying:!0},appliedSeq:Ee.appliedSeq,headSeq:Ee.headSeq}),W+=1,await Ze(Tu(W,B));continue}le({phase:"live",appliedSeq:Ee.appliedSeq,headSeq:Ee.headSeq,fraction:null,error:void 0}),Ee.appliedSeq>=Oe&&g({ok:!0,caughtUpTo:Ee.appliedSeq});const we=await Bt;if(rt(),a.signal.aborted)break;Ie()||we.ok||(O+=1,O>=Rd&&(Y=!0),le({phase:"stalled",error:{code:we.code,message:we.message??we.code,retrying:!0}}),W+=1,await Ze(Tu(W,B)))}h.phase!=="error"&&le({phase:"closed"}),j()}async function ue(){return r.enhancement==="off"||!t.cdc&&!t.range?!1:t.probe?t.probe():q4()}const ve=(t.onResume??D4)(M),ze=t.livenessMs===void 0?Rk:t.livenessMs;let ye=null;ze!==!1&&ze>0&&(ye=setInterval(()=>{ie()||!re||!ce||ce()||M({reason:"liveness",hiddenMs:0})},ze),ye.unref?.());function be(){ye!=null&&clearInterval(ye),ye=null}return{onBatch(K){return o.add(K),()=>o.delete(K)},onEphemeral(K){return u.add(K),()=>u.delete(K)},onStatus(K){return c.add(K),K(h),()=>c.delete(K)},get status(){return h},ready:y,close(){ve(),be(),a.abort(),j(),le({phase:"closed"})}}}function U4(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 Tu(t,i){return Math.min(kk,Sk*2**Math.max(0,t-1))*(.5+i()*.5)}function H4(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 I4(t,i,r){for(;!t()&&!i.aborted;)await r(5,i).catch(()=>{})}function zb(t={}){const i=t.addressOf??(u=>Sa(u)),r=t.fetch??fetch,a=t.url??Tk,o=t.maxMessages??dk;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 V4(r,a,{address:i(u.sessionId),throughSeq:u.throughSeq,beforeSeq:p,maxMessages:o,turnWindow:hk},h);if(!g.ok)return g;const w=Us(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 V4(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 Mb(t){const i=await crypto.subtle.digest("SHA-256",t);return[...new Uint8Array(i)].map(r=>r.toString(16).padStart(2,"0")).join("")}function qb(t){const i=t.fetch??fetch,r=t.concurrency??gk,a=t.retries??vk,o=t.manifestUrl??Ek,u=t.chunkUrl??jk,c=t.wait??$4;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 Y4(i,o,h,v.signal);return w.ok?await F4({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 Y4(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 F4(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(q=>q.seq>t.afterSeq&&q.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 Mb(j)===N.hash?(r.set(N.fromSeq,Db(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 q=await G4(t.fetchImpl,t.chunkUrl,t.manifest.sessionId,N,t.signal);if(await Mb(q)!==N.hash)throw new Error("hash mismatch");await t.cache.putChunk(N.hash,q),r.set(N.fromSeq,Db(q)),a+=N.bytes,t.sink.progress({loaded:a,total:o,unit:"bytes"}),c();return}catch(q){if(t.signal.aborted||v)return;if(j+1>=t.retries){v={ok:!1,retryable:!0,code:"CDC_CHUNK_FAILED",message:q instanceof Error?q.message:String(q)};return}await t.wait(50*2**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 G4(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 Db(t){const i=new TextDecoder().decode(t),r=[];for(const a of i.split(`
|
|
66
|
+
`))if(a.trim()!=="")try{r.push(...Us(JSON.parse(a)))}catch{}return r.sort((a,o)=>a.seq-o.seq)}function $4(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 X4(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 Q4(t){return t.replace(/[@()\r\n]/g," ").replace(/\s+/g," ").trim()||"Untitled"}function Z4(t,i){return`@${Q4(t)} (${i})`}function K4(t,i,r,a,o){const u=Math.max(0,Math.min(i,t.length)),c=`${Z4(a,o)} `;return{text:t.slice(0,r)+c+t.slice(u),cursor:r+c.length}}function J4(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 Pd=()=>({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 Vu(t,i,r){return bE(t,i,r)}function P4({active:t,progress:i}){const{t:r}=et(),[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 Lb({signal:t}){const{t:i}=et();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 W4(t){const i=[];return t.turns!=null&&i.push(`${t.turns} turns`),t.steps!=null&&i.push(`${t.steps} steps`),i.join(" · ")}function e3({health:t,usage:i,execution:r,model:a}){const{t:o}=et(),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"):Vu(r.reason,r.reason,o)}),m.jsx("p",{className:i?.connected?"":"muted",children:i?.connected?o("health.usageReady"):Vu(c,i?.error||o("health.usageOff"),o)}),m.jsx("p",{className:"muted",children:o("health.sameSession")})]})}function t3(){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 Bb(){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 n3({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 S1(){return m.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:m.jsx("path",{d:"M12 17V7M7 11.5L12 6.5l5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function lc({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 i3({ticket:t,now:i,onSupply:r,onOpen:a}){const{t:o}=et(),[u,c]=E.useState(""),[h,p]=E.useState(""),[y,v]=E.useState(!1),g=qE(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:px(t.status,o)})]}),ME(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 r3({briefing:t,time:i,mark:r,onOpenFile:a}){const{t:o}=et(),[u,c]=E.useState(!1),h=t.body.split(`
|
|
67
|
+
`).map(y=>y.trim()).find(Boolean)??"",p=[t.wallMs!=null?o("work.duration",{value:l3(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(a3,{}),h&&!u?m.jsx("span",{className:"briefing-preview",children:h}):null]}),m.jsx(lc,{open:u,children:m.jsxs("div",{className:"briefing-body",children:[t.body?m.jsx(Fs,{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 l3(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 a3(){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 s3({text:t}){return m.jsx("p",{className:"work-refused",children:t})}function o3({segment:t}){const[i,r]=E.useState(!1),{t:a}=et();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(S3,{}),m.jsx(Yu,{})]}),m.jsx("span",{className:"official-label",children:t.running?a("activity.thinking"):a("activity.reasoning")})]}),m.jsx(lc,{open:i,children:m.jsx("div",{className:"think-body",children:t.text})})]})}function u3({segments:t,pending:i=!1,tickets:r=[],cwd:a,connectionPhase:o}){const{t:u}=et(),c=t.flatMap(x=>x.kind==="tool"?[Wh(x,r)]:[]),h=t.some(x=>x.kind==="think"&&x.running)||c.some(x=>Ds.has(x)),p=i||h,y=[[u("activity.count.active"),c.filter(x=>Ds.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(Yu,{})]}),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(lc,{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(o3,{segment:x},x.id):m.jsx(v3,{segment:x,cwd:a,tickets:r,stale:w},x.callId))]})})]})}function c3({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 f3({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 d3({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 h3({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 m3({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 p3({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 y3({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]})}fO.show(t=>m.jsx(c3,{detail:t}));dO.show(t=>m.jsx(f3,{detail:t}));hO.show(t=>m.jsx(d3,{detail:t}));mO.show(t=>m.jsx(h3,{detail:t}));pO.show(t=>m.jsx(m3,{detail:t}));yO.show(t=>m.jsx(p3,{detail:t}));gO.show(t=>m.jsx(y3,{detail:t}));function g3({detail:t}){return t.view()}function v3(t){const[i,r]=E.useState(!1),[a,o]=E.useState(!1);return m.jsx(b3,{...t,open:i,argsOpen:a,onToggle:()=>r(u=>!u),onArgsToggle:()=>o(u=>!u)})}function b3({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}=et(),g=t1(t,i,r),w=u4({...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(Yu,{})]}),g.detail&&S===""?m.jsx(g3,{detail:g.detail}):m.jsx("span",{className:"official-label",children:S}),T?m.jsxs("span",{className:"activity-status",children:[bb(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:[bb(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(_u,{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(x3,{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(Yu,{})]}),m.jsx("span",{className:"official-label",children:y("activity.fullArgs")})]}),trailing:u?m.jsx(_u,{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(_u,{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(lc,{open:a,children:p})})]})}function x3({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(_u,{text:i})]}),m.jsx("div",{className:"diff-body",children:t.lines.map((r,a)=>m.jsx("div",{className:w3(r.kind),children:r.text},a))})]})}function w3(t){return t==="add"?"diff-line added":t==="del"?"diff-line removed":"diff-line same"}function _u({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(E3,{}):m.jsx(k3,{})})}function Yu(){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 S3(){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 k3(){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 E3(){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 j3={aborted:"question.aborted",failed:"question.failed",answered:"question.answered"};function Ns(t){return{selected:[...t.selected],custom:t.custom,skipped:t.skipped}}function T3(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 N3({item:t,draft:i,interactive:r,disabled:a,onToggle:o}){const{t:u}=et();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=wO(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}=et();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 C3({segment:t,sessionId:i,onCompose:r,remainingMs:a,waitState:o}){const u=Gs(t);return u?u.presentation==="plan-review"?m.jsx(R3,{segment:t,sessionId:i,onCompose:r,remainingMs:a,waitState:o}):u.presentation==="approval"?m.jsx(_3,{segment:t,sessionId:i,remainingMs:a,waitState:o}):m.jsx(A3,{segment:t,sessionId:i,remainingMs:a,waitState:o}):null}function sm(t,i,r,a,o){const{t:u}=et(),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 q=()=>{const P=Math.max(0,(x.current??Date.now())-Date.now());return w(P),P<=0?(v(!0),t&&Pe("/questions/timeout",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:t,callId:i})}),!1):!0};if(!q())return;const B=window.setInterval(()=>{q()||window.clearInterval(B)},250);return()=>window.clearInterval(B)},[c,S,t,i,a,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:T3(g)}):null;return{answerable:c,held:h,continued:y,waitLabel:N,takeTime:T,markHeld:()=>p(!0)}}function A3({segment:t,sessionId:i,remainingMs:r,waitState:a}){const{t:o}=et(),u=Gs(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 L of x)A[L.id]=h[L.id]??Ns(L);return A},[h,x]),T=!!i&&c.answerable,N=x.length>1||x.some(A=>A.multiSelect||A.options.length===0);function j(A,L){c.markHeld(),p(G=>{const le=x.find(Y=>Y.id===A),O=G[A]??(le?Ns(le):{selected:[],custom:"",skipped:!1});return{...G,[A]:{...O,...L}}})}async function q(A){if(!(!i||y)){v(!0),w("");try{const L=await Pe("/questions/answer",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,callId:u.callId,answers:A})});if(L.status===200&&L.body.ok!==!1||L.status===409)return;const G=typeof L.body.message=="string"?L.body.message:o("question.submitFailed");w(G)}catch{w(o("question.submitFailed"))}finally{v(!1)}}}function B(A,L){return L.skipped?{id:A.id,selected:[]}:L.custom.trim()&&(A.multiSelect||L.selected.length===0||A.options.length===0)?A.multiSelect?{id:A.id,selected:L.selected,custom:L.custom}:{id:A.id,selected:[],custom:L.custom}:L.selected.length?{id:A.id,selected:[...L.selected]}:null}function P(){const A=x.map(L=>B(L,S[L.id]??Ns(L)));if(A.some(L=>L==null)){w(o("question.incomplete"));return}q(A)}function ie(A,L){if(!T||y)return;if(!A.multiSelect&&x.length===1&&!S[A.id]?.custom){q([{id:A.id,selected:[L]}]);return}const G=S[A.id]??Ns(A),le=A.multiSelect?G.selected.includes(L)?G.selected.filter(O=>O!==L):[...G.selected,L]:[L];j(A.id,{selected:le,skipped:!1,custom:A.multiSelect?G.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 L=S[A.id]??Ns(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(N3,{item:A,draft:c.answerable?L:{selected:A.selected,custom:A.custom,skipped:A.skipped},interactive:T,disabled:y,onToggle:G=>ie(A,G)}),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:L.custom,disabled:y,rows:2,placeholder:o("question.customPlaceholder"),onChange:G=>j(A.id,{custom:G.target.value,skipped:!1})})]}),m.jsx("button",{type:"button",className:"user-question-skip",disabled:y,onClick:()=>{if(x.length===1){q([{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||L.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:P,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(j3[u.state])}):null]})}function R3({segment:t,sessionId:i,onCompose:r,remainingMs:a,waitState:o}){const{t:u}=et(),c=Gs(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,q=h.item.selected[0],B=q===h.approve.label;async function P(){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 ie(){if(!i||x)return;const A=g.trim();if(!A){N(u("question.changesNeeded"));return}S(!0),N("");try{const L=await Pe("/questions/cancel",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:i,callId:c.callId})});if(L.status===200&&L.body.ok!==!1){r?.(A);return}if(L.status===409){r?.(A);return}N(typeof L.body.message=="string"?L.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(Fs,{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:()=>{ie()},children:u("question.requestChanges")}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:x,onClick:()=>{P()},children:u(x?"question.submitting":"question.approvePlan")})]})]}):q?m.jsx("p",{className:"user-question-status",children:B?u("question.approvePlan"):q}):c.state==="aborted"?m.jsx("p",{className:"user-question-status exception",children:u("question.aborted")}):c.state==="failed"?m.jsx("p",{className:"user-question-status exception",children:u("question.failed")}):null,T?m.jsx("p",{className:"user-question-status exception",children:T}):null]})}function _3({segment:t,sessionId:i,remainingMs:r,waitState:a}){const{t:o,locale:u}=et(),c=Gs(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=Zd(h.intent.display?.question,u,h.item.question),T=Zd(h.intent.display?.detail,u,h.item.detail),N=Zd(h.intent.display?.approve,u,h.approve.label),j=h.item.selected[0];async function q(B){if(!(!i||y)){v(!0),w("");try{const P=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(P.status===200&&P.body.ok!==!1||P.status===409)return;w(typeof P.body.message=="string"?P.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:()=>{q(h.reject.label)},children:o("question.reject")}),m.jsx("button",{type:"button",className:"user-question-submit",disabled:y,onClick:()=>{q(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:()=>{q(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 O3({approval:t,sessionId:i}){const{t:r,locale:a}=et(),[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 z3(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 M3(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 q3(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=z3(r[c]);if(h!=null&&h>o.seq){u=c;break}}r.splice(u,0,o.block)}return r}function D3(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 L3({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:q=[],questionWaits:B,onCompose:P}){const ie=[];let A=null;const L=()=>{A&&(A.segments.length||a[A.turn]||o[A.turn]?.length)&&ie.push(A),A=null};for(const oe of i){if(oe.kind==="user"){L(),yx(oe.text)||ie.push({type:"user",segment:oe});continue}if(lm(oe)){A?A.segments.push(oe):ie.push({type:"card",segment:oe});continue}const ge=oe.turn??-1;(!A||A.turn!==ge)&&(L(),A={type:"turn",turn:ge,seconds:r[ge],segments:[]}),A.segments.push(oe)}L();const G=new Set(ie.flatMap(oe=>oe.type==="turn"?[oe.turn]:[])),le=[],O=oe=>{if(G.has(oe)||!Number.isFinite(oe))return;const ge=a[oe],re=o[oe];!ge&&!re?.length||(G.add(oe),le.push({seq:M3(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=q3(ie,le);ie.splice(0,ie.length,...oe)}const Y=new Map(c.map(oe=>[oe.id,oe])),W=ie.reduce((oe,ge)=>ge.type==="turn"?Math.max(oe,ge.turn):oe,-1),ke=gx(c);return m.jsx(m.Fragment,{children:ie.map((oe,ge)=>m.jsx(E.Fragment,{children:oe.type==="user"?m.jsx(I3,{segment:oe.segment,botLabel:S,onOpenInbox:x,onOpenFile:w}):oe.type==="card"?m.jsx(k1,{segment:oe.segment,sessionId:t,byId:Y,now:h,onSupply:v,onOpenSession:g,approvals:q}):m.jsx($3,{sessionId:t,cwd:N,connectionPhase:j,block:oe,index:ge,blocks:ie,failures:a,retries:o,turnEnds:u,latestTurn:W,background:ke,byId:Y,now:h,canRetry:p,onRetry:y,onSupply:v,onOpenSession:g,onOpenFile:w,chat:T,approvals:q,questionWaits:B,onCompose:P})},oe.type==="turn"?`${t}:turn-${oe.turn}`:oe.segment.id))})}function k1({segment:t,sessionId:i,byId:r,now:a,onSupply:o,onOpenSession:u,approvals:c}){const h=I0();return t.kind==="worker-card"?m.jsx(i3,{ticket:B3(t,r),now:a,onSupply:o,onOpen:u}):t.kind==="canvas-card"?m.jsx(f_,{item:U3(t),onOpen:()=>h.open(t.canvasId)}):m.jsx(O3,{approval:H3(t,i,c),sessionId:i})}function B3(t,i){return i.get(t.ticketId)??{id:t.ticketId,status:t.status,revision:1,summary:t.summary,childSessionId:null,startedAt:null,events:[]}}function U3(t){return{id:t.canvasId,title:t.title,ticketId:t.ticketId,previewRevision:t.revision,stableRevision:null}}function H3(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 I3({segment:t,botLabel:i,onOpenInbox:r,onOpenFile:a}){const o=nc(t.text),u=Ch(t.text),{locale:c}=et(),h=D3(t.time,c);if(u)return m.jsx(r3,{briefing:u,time:h,mark:t.id,onOpenFile:a});if(o){const p=Q_([{kind:"in",id:t.id,seq:t.seq,time:t.time,mail:o}],i);return m.jsx(P_,{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(V3,{text:t.text})}),h?m.jsx("time",{children:h}):null]})}function V3({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 Y3(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(nc(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 F3(t,i){return t.slice(i+1).some(r=>r.type==="user")}function G3({seconds:t,failure:i,retries:r,prompt:a,continued:o,canRetry:u,onRetry:c,showLabel:h}){const{t:p}=et(),[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 $3({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:q,approvals:B=[],questionWaits:P,onCompose:ie}){const{t:A}=et(),L=o4(i.segments),G=Y=>P?.[Y]??P?.[`${t}:${Y}`],le=L.some(Y=>Y.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:[L.map(Y=>{if(Y.type==="text")return m.jsx("div",{"data-segment":Y.segment.id,className:Y.segment.streaming?"assistant streaming":"assistant",children:m.jsx(Fs,{text:Y.segment.text,streaming:Y.segment.streaming,onOpenFile:T})},Y.segment.id);if(Y.type==="question"){const ke=G(Y.segment.callId);return m.jsx(C3,{segment:Y.segment,sessionId:t,onCompose:ie,remainingMs:ke?.remainingMs,waitState:ke?.waitState},Y.segment.id)}if(Y.type==="card")return m.jsx(k1,{segment:Y.segment,sessionId:t,byId:y,now:v,onSupply:x,onOpenSession:S,approvals:B},Y.segment.id);const W=Y.segments.filter(ke=>ke.kind==="tool");return m.jsxs(E.Fragment,{children:[m.jsx(u3,{segments:Y.segments,cwd:j,tickets:[...y.values()],connectionPhase:q}),W.filter(ke=>DE(ke)).map(ke=>m.jsx(s3,{text:LE(ke.result,A)},ke.id))]},Y.id)}),O?m.jsx("p",{className:"work-note",children:A("bot.stopped")}):null,m.jsx(G3,{seconds:i.seconds,failure:o[i.turn],retries:u[i.turn]??[],prompt:Y3(a,r,i.turn),continued:F3(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]})})}const Fu=8,E1=56;function Hb(){return{following:!0,programmaticTop:null,suppressRejoin:!1,lastTop:null,lastHeight:null}}function Gu(t){return t.scrollHeight-t.scrollTop-t.clientHeight}function X3(t,i){return i.scrollTop<=1&&Gu(i)<=Fu?!1:(t.following=!1,!0)}function Q3(t){t.following=!1}function Z3(t,i){const r=Gu(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<=E1&&(t.following=!0),t.lastTop=i.scrollTop,t.lastHeight=i.scrollHeight,{following:t.following,detached:!t.following&&r>Fu}}function Wd(t){return Math.max(0,t.scrollHeight-t.clientHeight)}function Ib(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 K3(t){const i=E.useRef(null),r=E.useRef(null),a=E.useRef(Hb()),o=E.useRef(!1),[u,c]=E.useState(!1),h=E.useCallback(v=>{if(!v){c(!1);return}const g=!a.current.following&&Gu(v)>Fu;c(w=>w===g?w:g)},[]),p=E.useCallback(()=>{const v=i.current;if(!v||!a.current.following){h(v);return}const g=Wd(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=Wd(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=Hb();a.current=v,o.current=!1,c(!1);const g=i.current;if(!g)return;const w=Wd(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=()=>{X3(a.current,v)&&(w(),h(v))},S=()=>{Q3(a.current),w(),h(v)},T=()=>{const G=Z3(a.current,v);G.following&&Gu(v)<=Fu&&(o.current=!1),c(le=>le===G.detached?le:G.detached)},N=G=>{G.deltaY<0&&!Ib(v,G.target)&&x()};let j=0;const q=G=>{j=G.touches[0]?.clientY??0},B=G=>{const le=G.touches[0]?.clientY??j;le>j+8&&!Ib(v,G.target)&&x(),j=le},P=G=>{if(G.altKey||G.metaKey||G.ctrlKey||G.shiftKey)return;const le=G.target;le instanceof HTMLInputElement||le instanceof HTMLTextAreaElement||le instanceof HTMLSelectElement||(G.key==="PageUp"||G.key==="ArrowUp"||G.key==="Home")&&x()},ie=G=>{const le=G.target;le instanceof Element&&le.closest("button.official-title, summary")&&S()},A=()=>{const G=document.getSelection();if(!G||G.isCollapsed)return;const le=G.anchorNode;!le||!v.contains(le)||S()},L=new ResizeObserver(()=>{p()});return L.observe(g),v.addEventListener("scroll",T,{passive:!0}),v.addEventListener("wheel",N,{passive:!0}),v.addEventListener("touchstart",q,{passive:!0}),v.addEventListener("touchmove",B,{passive:!0}),v.addEventListener("keydown",P),v.addEventListener("pointerdown",ie),document.addEventListener("selectionchange",A),p(),()=>{L.disconnect(),v.removeEventListener("scroll",T),v.removeEventListener("wheel",N),v.removeEventListener("touchstart",q),v.removeEventListener("touchmove",B),v.removeEventListener("keydown",P),v.removeEventListener("pointerdown",ie),document.removeEventListener("selectionchange",A)}},[t,h,p]),{scrollRef:i,contentRef:r,detached:u,pin:y,stickIfFollowing:p}}function Vb({label:t,onClick:i}){return m.jsx("button",{type:"button",className:"jump-latest","aria-label":t,onClick:i,children:m.jsx(S1,{})})}function Yb(){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 Fb(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 Gb(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 J3(t){return(t??"").split("/").filter(Boolean).at(-1)??""}function P3(){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 W3(){const{t,locale:i,setLocale:r}=et(),[a,o]=E.useState(Yb),[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,q]=E.useState(Pd),[B,P]=E.useState(""),[ie,A]=E.useState(null),[L,G]=E.useState(a);L!==a&&(G(a),q(Pd()));const[le,O]=E.useState(null),[Y,W]=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(""),[Ze,Ie]=E.useState([]),[M,z]=E.useState(!1),[ee,ue]=E.useState(0);E.useEffect(()=>{Ie([])},[a]);const[ve,ze]=E.useState(0),[ye,be]=E.useState(0),[K,de]=E.useState(""),[tt,mt]=E.useState(""),[Ee,De]=E.useState(!1),[Me,Ve]=E.useState(null),[Ae,Ue]=E.useState(null),[rt,ae]=E.useState(null),[Be,ft]=E.useState([]),[Qt,Bt]=E.useState({}),[Q,se]=E.useState(!1),[Oe,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}})),Ke=E.useRef(void 0),st=E.useRef(null),[bt,vt]=E.useState(null),[xn,Nt]=E.useState(0),[Ct,pt]=E.useState(!1),[Ft,pi]=E.useState(()=>new Set),[Vn,Z]=E.useState(()=>new Set),[he,Et]=E.useState(!1),[yt,ot]=E.useState(!1),[Mt,jt]=E.useState(""),[jl,tr]=E.useState(0),[zn,zi]=E.useState(()=>new Set),[li,Mi]=E.useState({}),[qi,Tl]=E.useState({}),[nr,$s]=E.useState(!1),[ac,Xs]=E.useState({}),[ir,Hr]=E.useState(()=>Date.now()),[Nl,Aa]=E.useState(""),Qs=G_(a,jl);E.useEffect(()=>{ft([]),Bt({});const C=lO({visible:!document.hidden,fetch:async J=>{const me=await Pe(`/interactions?compact=1&sessionId=${encodeURIComponent(a)}`,{signal:J});if(me.status!==200)throw new Error("Interactions unavailable");return me.body},active:J=>{const me=J;return!!(me.questions?.length||me.approvals?.some(_e=>_e.state==="open")||me.authorization?.prompts?.length||me.authorization?.inFlight?.length)},apply:J=>{const me=J,_e=Array.isArray(me.approvals)?me.approvals:[];ft(_e);const je={};if(Array.isArray(me.questions))for(const St of me.questions)typeof St.callId=="string"&&St.callId!==""&&(je[St.callId]={remainingMs:St.remainingMs,waitState:St.waitState});Bt(je);const Je=me.authorization,Ot=Je&&typeof Je=="object"?Je.prompts:[];Ne(Array.isArray(Ot)&&Ot.length>0);const Ge=Je&&typeof Je=="object"?Je:{},We=JSON.stringify([Ge.catalogRevision,Ge.available]);Ke.current!==We&&(Ke.current=We,Le.invalidate()),pe(St=>JSON.stringify(St)===JSON.stringify(Ge)?St:Ge)},schedule:(J,me)=>{const _e=window.setTimeout(J,me);return()=>window.clearTimeout(_e)}});st.current=C;const V=()=>C.setVisible(!document.hidden);return document.addEventListener("visibilitychange",V),()=>{C.close(),st.current===C&&(st.current=null),document.removeEventListener("visibilitychange",V)}},[a,Le]),E.useEffect(()=>{Pe("/cua").then(C=>se(C.body.available===!0))},[]);const{scrollRef:Ir,contentRef:Ra,detached:Cl,pin:Al,stickIfFollowing:_a}=K3(`${yt?"bot":"main"}:${a}`),Yn=E.useRef(null),Zt=E.useRef(null),on=E.useRef(null),yi=E.useRef(null),Rl=E.useRef(new Set),Zs=E.useRef(0),_l=E.useRef(new Map),Vr=E.useRef(0),Di=E.useRef(new Map),Yr=E.useRef(!1),Li=E.useRef(a),ai=E.useRef(null);Li.current=a;function Fn(C){return li[C.sessionId]||x[C.sessionId]||C.title||J3(C.cwd)||t("session.unnamed")}function Bi(C){const V=u.find(J=>J.sessionId===C);return V?Fn(V):li[C]||x[C]||""}const rr=K0(j.segments),Ut=a!==""&&B!==a&&(ie==null||ie.phase==="restoring"||ie.phase==="connecting"||ie.phase==="syncing"&&B!==a),Ks=ie?.fraction!=null?{loaded:Math.round(ie.fraction*1e3),total:1e3}:null,Ol=ie?.phase==="syncing"&&ie.fraction!=null,Fr=E.useMemo(()=>X_(j.segments),[j.segments]),Ui=E.useMemo(()=>r4(Fr),[Fr]),lr=a?Fn({sessionId:a,cwd:u.find(C=>C.sessionId===a)?.cwd,title:j.title||null}):t("app.title"),sc=a?`/#/s/${encodeURIComponent(a)}`:"/";function Gr(C){ot(!1),o(C),De(!1),pt(!1),vt(null),O(null),mt(""),jt("");const V=C?`#/s/${encodeURIComponent(C)}`:"#/";location.hash!==V&&history.replaceState(null,"",V)}function Js(C){if(!C||C===a)return;const V=a;ot(!1),o(C),De(!1),pt(!1),vt(null),O(null),mt(""),jt("");const J=`#/s/${encodeURIComponent(C)}`;location.hash!==J&&history.pushState({kind:"worker",owner:V},"",J)}function Ps(){if(ot(!1),De(!1),pt(!1),vt(null),history.state?.kind==="worker"){history.back();return}Nl&&Gr(Nl)}E.useEffect(()=>{let C=!1;return P3().then(V=>{C||pi(new Set(V))}),()=>{C=!0}},[]);function dt(C){const V=NE(C);V&&(Xs(V.signals),Tl(V.cards),$s(!0));const J=C.desk;if(!J||typeof J!="object"||Array.isArray(J))return;const me=J,_e=me.sessions;if(_e&&typeof _e=="object"&&!Array.isArray(_e)){const Ge=_e,We=Ge.result;if(We?.ok!==!0)p(We?.error?.message||String(Ge.error||t("session.listUnavailable")));else if(p(""),c(vi(We.value?.items)),gn(Ge.previews),!Yr.current){Yr.current=!0;const St=Gb(Ge.previews),xt={};for(const[Vt,Zn]of Object.entries(eh("dsh-bot.previews")))Rl.current.has(Vt)||St[Vt]||!Zn||(xt[Vt]=Zn);Object.keys(xt).length>0&&th({previews:xt})}}const je=me.bots;if(je&&typeof je=="object"&&!Array.isArray(je)&&je.ok===!0){const Ge=je,We=Array.isArray(Ge.bots)?Ge.bots:[],St=We.flatMap(Vt=>{if(!Vt||typeof Vt!="object")return[];const Zn=Vt.sessionId;return typeof Zn=="string"?[Zn]:[]}),xt={};for(const Vt of We){if(!Vt||typeof Vt!="object")continue;const Zn=Vt.sessionId,Qr=Vt.name;typeof Zn=="string"&&typeof Qr=="string"&&Qr!==""&&(xt[Zn]=Qr)}if(St.length===0&&Array.isArray(Ge.sessionIds))for(const Vt of Ge.sessionIds)typeof Vt=="string"&&St.push(Vt);zi(new Set(St)),Mi(xt)}const Je=me.health;if(Je&&typeof Je=="object"&&!Array.isArray(Je)){const Ge=Je;oe(Ge),Ge.execution&&W({ready:Ge.execution.ready===!0,reason:Ge.execution.reason||(Ge.execution.ready===!0?"":"catalog_unreadable")})}const Ot=me.usage;Ot&&typeof Ot=="object"&&!Array.isArray(Ot)&&re(Ot)}E.useEffect(()=>{let C=!1;return(async()=>{try{const V=await Pe("/sessions");if(C)return;const J=V.body.result;J?.ok===!0?(p(""),c(vi(J.value?.items)),gn(V.body.previews)):V.status!==200&&p(J?.error?.message||t("session.listUnavailable"))}catch{}try{const V=await Pe("/sessions/bots");if(C||V.body.ok!==!0)return;const J=Array.isArray(V.body.bots)?V.body.bots:[],me=J.flatMap(je=>{if(!je||typeof je!="object")return[];const Je=je.sessionId;return typeof Je=="string"?[Je]:[]}),_e={};for(const je of J){if(!je||typeof je!="object")continue;const Je=je.sessionId,Ot=je.name;typeof Je=="string"&&typeof Ot=="string"&&Ot!==""&&(_e[Je]=Ot)}if(me.length===0&&Array.isArray(V.body.sessionIds))for(const je of V.body.sessionIds)typeof je=="string"&&me.push(je);zi(new Set(me)),Mi(_e)}catch{}})(),()=>{C=!0}},[]),E.useEffect(()=>{let C=!1,V=null,J=0,me=2e3,_e,je;const Je=We=>{let St;try{St=JSON.parse(String(We.data))}catch{return null}return St.ok===!0?St:null},Ot=()=>{if(V?.close(),_e=void 0,je=void 0,C||document.hidden||typeof EventSource>"u")return;const We=new EventSource(`/dsh-bot/api/live?sessionId=${encodeURIComponent(a)}`);V=We,We.addEventListener("interaction-error",()=>{!C&&V===We&&st.current?.disconnected()}),We.addEventListener("interactions",St=>{if(C||V!==We)return;const xt=Je(St);xt?.sessionId===a&&(me=2e3,st.current?.ingest(xt))}),We.addEventListener("canvas",St=>{if(C||V!==We)return;const xt=Je(St);!xt||!Array.isArray(xt.events)||xt.events.length===0||(me=2e3,Nt(Vt=>Vt+1))}),We.addEventListener("snapshot",St=>{if(C||V!==We)return;const xt=Je(St);xt&&(me=2e3,xt.desk!==void 0&&(_e=xt.desk),xt.work!==void 0&&(je=xt.work),dt(xt))}),We.addEventListener("delta",St=>{if(C||V!==We)return;const xt=Je(St);if(!xt)return;const Vt={ok:!0};xt.desk!==void 0&&_e!==void 0&&(_e=Bs(_e,xt.desk),Vt.desk=_e),xt.work!==void 0&&je!==void 0&&(je=Bs(je,xt.work),Vt.work=je),(Vt.desk!==void 0||Vt.work!==void 0)&&dt(Vt)}),We.addEventListener("error",()=>{C||V!==We||(st.current?.disconnected(),We.close(),V===We&&(V=null),J=window.setTimeout(Ot,me),me=Math.min(15e3,me*2))})},Ge=()=>{window.clearTimeout(J),document.hidden?(V?.close(),V=null):(me=2e3,Ot())};return document.addEventListener("visibilitychange",Ge),Ot(),()=>{C=!0,document.removeEventListener("visibilitychange",Ge),window.clearTimeout(J),V?.close()}},[a]),E.useEffect(()=>{const C=()=>{ot(!1),De(!1),pt(!1),vt(null),O(null),mt(""),jt(""),o(Yb())};return window.addEventListener("hashchange",C),()=>window.removeEventListener("hashchange",C)},[]),E.useEffect(()=>{let C=!1;return dv().then(J=>{C||(ai.current=Ob({follow:Ab({addressOf:me=>Sa(me)}),page:zb({addressOf:me=>Sa(me)}),cdc:qb({cache:J}),range:_b(),checkpoint:J}))}),()=>{C=!0}},[]),E.useEffect(()=>{if(!a){P(""),A(null);return}q(Pd()),A(null);let C=!1,V=null;return(async()=>{const J=await dv();if(C)return;const me=ai.current??Ob({follow:Ab({addressOf:je=>Sa(je)}),page:zb({addressOf:je=>Sa(je)}),cdc:qb({cache:J}),range:_b(),checkpoint:J});ai.current=me;const _e=me.open(a,{enhancement:"auto"});V=_e,_e.onBatch(je=>{C||Li.current!==a||(q(Je=>{let Ot=Je;for(const Ge of je.events)Ot=T4(Ot,Ge);return Ot}),P(a))}),_e.onEphemeral(je=>{C||Li.current!==a||q(Je=>A4(Je,je))}),_e.onStatus(je=>{C||Li.current!==a||(A(je),(je.phase==="live"||je.phase==="stalled"||je.phase==="error")&&P(a))})})(),()=>{C=!0,V?.close()}},[a]),E.useEffect(()=>{!a||L!==a||!j.title||li[a]||S(C=>{if(C[a]===j.title)return C;const V={...C,[a]:j.title};return sessionStorage.setItem("dsh-bot.titles",JSON.stringify(V)),V})},[a,L,j.title,li]);const ar=!!a&&zn.has(a),nn=ar&&nr?qi[a]??[]:[],sr=ar&&nr?a:"";E.useEffect(()=>{if(!a||!ba(a)){Aa("");return}let C=!1;const V=EE(a);return Ri(`/dsh-bot/api/work/ticket?id=${encodeURIComponent(V)}`).then(J=>{if(C||J.body.ok!==!0||!J.body.ticket||typeof J.body.ticket!="object")return;const me=J.body.ticket.owner_session_id;typeof me=="string"&&Aa(me)}),()=>{C=!0}},[a]);const Gn=nn.some(C=>C.status==="started");E.useEffect(()=>{if(!Gn)return;const C=window.setInterval(()=>Hr(Date.now()),1e3);return()=>window.clearInterval(C)},[Gn]);function gn(C){const V=Gb(C);Object.keys(V).length!==0&&N(J=>{let me=!1;const _e={...J};for(const[je,Je]of Object.entries(V))_e[je]||(_e[je]=Je,me=!0);return me?(sessionStorage.setItem("dsh-bot.previews",JSON.stringify(_e)),_e):J})}function Oa(){window.clearTimeout(Vr.current),Vr.current=0;const C=[..._l.current];if(_l.current.clear(),C.length!==0){if(C.length===1){const[V,J]=C[0]??[];V&&J&&th({sessionId:V,preview:J});return}th({previews:Object.fromEntries(C)})}}E.useEffect(()=>()=>{Oa()},[]),E.useEffect(()=>{if(!a||L!==a)return;const C=R4(j.segments);!C||Di.current.get(a)===C||(Di.current.set(a,C),N(V=>{if(V[a]===C)return V;const J={...V,[a]:C};return sessionStorage.setItem("dsh-bot.previews",JSON.stringify(J)),J}),_l.current.set(a,C),window.clearTimeout(Vr.current),Vr.current=window.setTimeout(Oa,400))},[a,L,j.segments]),E.useLayoutEffect(()=>{const C=yi.current;if(!C||!Me)return;const V=C.getBoundingClientRect(),J=Math.max(8,Math.min(Me.x,window.innerWidth-V.width-8)),me=Math.max(8,Math.min(Me.y,window.innerHeight-V.height-8));(J!==Me.x||me!==Me.y)&&Ve(_e=>_e&&{..._e,x:J,y:me}),C.querySelector("button")?.focus()},[Me]),E.useEffect(()=>{if(!Me)return;const C=()=>Ve(null),V=me=>{const _e=me.target;_e instanceof Node&&yi.current?.contains(_e)||C()},J=me=>{me.key==="Escape"&&C()};return document.addEventListener("pointerdown",V),document.addEventListener("keydown",J),document.addEventListener("scroll",C,!0),()=>{document.removeEventListener("pointerdown",V),document.removeEventListener("keydown",J),document.removeEventListener("scroll",C,!0)}},[Me]),E.useEffect(()=>{if(!Ee)return;const C=J=>{const me=J.target;me instanceof Node&&on.current?.contains(me)||De(!1)},V=J=>{J.key==="Escape"&&De(!1)};return document.addEventListener("pointerdown",C),document.addEventListener("keydown",V),()=>{document.removeEventListener("pointerdown",C),document.removeEventListener("keydown",V)}},[Ee]),E.useEffect(()=>{ot(!1)},[a]),E.useLayoutEffect(()=>{const C=Yn.current,V=Ir.current;if(!C||!V)return;const J=()=>{const _e=Number.parseFloat(getComputedStyle(C).getPropertyValue("--composer-fade"))||0,Je=(C.hidden?0:Math.max(0,C.offsetHeight-_e))+E1;(Number.parseFloat(V.style.paddingBottom)||0)!==Je&&(V.style.paddingBottom=`${Je}px`,_a())};J();const me=new ResizeObserver(J);return me.observe(C),()=>{me.disconnect(),V.style.paddingBottom=""}},[yt,M,Ir,_a]);const zl=E.useMemo(()=>{const C=y.trim().toLowerCase();return u.filter(V=>ba(V.sessionId)||Ft.has(V.sessionId)||V.blank===!0&&!Vn.has(V.sessionId)?!1:C?[Fn(V),V.cwd??"",T[V.sessionId]??""].join(" ").toLowerCase().includes(C):!0)},[u,y,x,T,Ft,li,Vn]),Ws=E.useMemo(()=>!a||!zn.has(a)?[]:u.flatMap(C=>!zn.has(C.sessionId)||C.sessionId===a||Ft.has(C.sessionId)||C.blank===!0&&!Vn.has(C.sessionId)||ba(C.sessionId)?[]:[{sessionId:C.sessionId,label:Fn(C)}]),[u,zn,a,Ft,li,x,Vn]),gi=a&&zn.has(a)?X4(Te,ve):null,vn=gi?`${gi.start}:${gi.query}`:"",$n=gi?J4(Ws,gi.query):[],za=gi!=null&&K!==vn,$r=Math.min(ye,Math.max($n.length-1,0));E.useEffect(()=>{be(0)},[vn]),E.useEffect(()=>{Z(C=>{let V=!1;const J=new Set(C);for(const me of C){const _e=u.find(je=>je.sessionId===me);_e&&_e.blank!==!0&&(J.delete(me),V=!0)}return V?J:C})},[u]);function vi(C){const V=Rl.current;return(C??[]).filter(J=>!V.has(J.sessionId))}function eo(C){Rl.current.add(C),_l.current.delete(C),Di.current.delete(C),c(V=>V.filter(J=>J.sessionId!==C)),pi(V=>{const J=new Set(V);return J.delete(C),J}),S(V=>Fb("dsh-bot.titles",V,C)),N(V=>Fb("dsh-bot.previews",V,C)),zi(V=>{if(!V.has(C))return V;const J=new Set(V);return J.delete(C),J}),Mi(V=>{if(!(C in V))return V;const J={...V};return delete J[C],J}),a===C&&Gr("")}function to(C,V){C.preventDefault(),Ve({id:V,x:C.clientX,y:C.clientY})}function Hi(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 no(C){return C.error==="running"?t("session.deleteBusy"):C.error==="session_unreadable"?t("session.deleteUnreadable"):C.error||t("session.deleteFailed")}async function Ma(C,V){if(V.phase==="error")return Ue({id:C,phase:"error",percent:V.percent,error:no(V)}),!1;if(V.phase!=="done")return Ue({id:C,phase:V.phase,percent:V.percent,error:t("session.deleteFailed")}),!1;const J=V.deletedSessionIds?.length?V.deletedSessionIds:[C];Ue({id:C,phase:"cache",percent:94,error:""});try{await Lk(J)}catch{}for(const me of J)eo(me);return p(""),Ue(null),!0}async function qa(C){if(Ae&&Ae.error===""&&Ae.id!==C)return!1;Ue({id:C,phase:"fence",percent:8,error:""});try{const V=await fetch(`/dsh-bot/api/sessions/${encodeURIComponent(C)}/delete`,{method:"POST",headers:{accept:"application/x-ndjson"}});if(!(V.headers.get("content-type")??"").includes("ndjson")){const _e=await V.json().catch(()=>({}));return Ue({id:C,phase:"error",percent:8,error:_e.message||_e.error||t("session.deleteFailed")}),!1}const me=await ck(V,_e=>{_e.phase!=="done"&&Ue({id:C,phase:_e.phase,percent:_e.percent,error:_e.phase==="error"?no(_e):""})});return me?Ma(C,me):Ml(C)}catch{return Ml(C)}}async function Ml(C){for(let V=0;V<40;V+=1){const J=await Pe(`/sessions/${encodeURIComponent(C)}/delete`),me=typeof J.body.phase=="string"?J.body.phase:"absent";if(me==="absent")break;const _e={phase:me,percent:typeof J.body.percent=="number"?J.body.percent:8,...typeof J.body.error=="string"?{error:J.body.error}:{},...Array.isArray(J.body.deletedSessionIds)?{deletedSessionIds:J.body.deletedSessionIds.filter(je=>typeof je=="string")}:{}};if(me!=="done"&&me!=="error"){Ue({id:C,phase:me,percent:_e.percent,error:""}),await new Promise(je=>setTimeout(je,400));continue}return Ma(C,_e)}return Ue({id:C,phase:"error",percent:8,error:t("session.deleteFailed")}),!1}async function oc(C,V,J){Et(!1),J!==""&&(Mi(je=>({...je,[C]:J})),zi(je=>new Set([...je,C])),S(je=>{const Je={...je,[C]:J};return sessionStorage.setItem("dsh-bot.titles",JSON.stringify(Je)),Je})),Z(je=>new Set(je).add(C));const _e=(await Pe("/sessions")).body.result;c(vi(_e?.value?.items)),Gr(C),jt(V),tr(je=>je+1)}function io(C,V){R(C),ze(V),window.requestAnimationFrame(()=>{const J=Zt.current;J&&(J.focus(),J.setSelectionRange(V,V))})}function Xr(C){if(!gi)return;const V=K4(Te,ve,gi.start,C.label,C.sessionId);io(V.text,V.cursor)}function Xn(C="/"){De(!1),R(V=>{const J=V.replace(/\s+$/,"");return J===""?C==="/"?"/":`${C} `:`${J} ${C==="/"?"/":`${C} `}`}),window.requestAnimationFrame(()=>Zt.current?.focus())}async function ql(C){const V=le?.status==="accepted"&&j.drafting,J=sr===a?nn:[];if(!a||!C||!Y.ready||pv(V,J,zn.has(a)))return!1;Al();const me=j.drafting;R(""),mt(""),Zs.current+=1;const _e=Number.MAX_SAFE_INTEGER-Zs.current;q(Ot=>({...Ot,drafting:!0,segments:[...Ot.segments,{kind:"user",id:`optimistic:${_e}`,text:C,time:Date.now(),seq:_e,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})}),Je=je.body.task;if(O(Je??null),je.status!==202){q(Ge=>({...Ge,drafting:me?Ge.drafting:!1,segments:Ge.segments.filter(We=>!(We.kind==="user"&&We.optimistic&&We.text===C))}));const Ot=je.body.execution;return mt(Ot?.reason||Vu(String(je.body.error||""),t("composer.notSent"),t)),!1}return!0}async function Dl(){const C=Te.trim();if(!C||!Qn)return;const V=Ze,J=V.map($R).join(`
|
|
70
|
+
`),me=J?`${C}
|
|
71
71
|
|
|
72
|
-
${J}`:N;Ie([]),ue(je=>je+1),await ql(me)||Ie(I)}async function or(N,I){const J=await Ri("/dsh-bot/api/work/supply",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:a,ticketId:N,text:I})});return J.status!==200||J.body.ok===!1?Jb(J.body,t("composer.supplyFailed")):""}async function ur(){if(!le||le.status!=="accepted")return;const I=(await nt(`/tasks/${le.id}/cancel?sessionId=${encodeURIComponent(le.sessionId??"")}`,{method:"POST"})).body.task??le;O(I),I.status==="cancelled"&&M(J=>({...J,drafting:!1}))}const cr=le?.status==="accepted"&&k.drafting,Da=sr===a?nn:[],ro=Ae?.id===a,fr=mv(cr,Da,ar)||ro,Qn=!!a&&V.ready&&Te.trim()!==""&&!fr;function Ll(N){if(!zn.has(N.sessionId))return null;const I=N.running===!0||N.sessionId===a&&(cr||k.drafting),J=N.sessionId===a&&sr===a?nn:(ac[N.sessionId]??[]).map(me=>({status:me}));return OE(J,I)}return m.jsxs("div",{className:a?"shell in-chat":"shell",children:[m.jsxs("aside",{className:"side",children:[m.jsxs("div",{className:"side-top",children:[m.jsx("strong",{className:"brand",children:t("app.title")}),m.jsxs("span",{className:"side-actions",children:[m.jsx("button",{type:"button",className:"icon-btn","aria-label":t("session.search"),onClick:()=>w(N=>!N),children:m.jsx(t3,{})}),m.jsx("button",{type:"button",className:"icon-btn","aria-label":t("new.title"),onClick:()=>Et(!0),children:m.jsx(Bb,{})})]})]}),g?m.jsx("input",{className:"filter",value:y,placeholder:t("session.searchPlaceholder"),onChange:N=>v(N.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:[zl.length===0?m.jsx("li",{className:"empty",children:y.trim()?t("session.noMatch"):t("session.none")}):null,zl.map(N=>{const I=Fn(N);return m.jsx("li",{onContextMenu:J=>to(J,N.sessionId),children:m.jsxs("button",{type:"button",className:N.sessionId===a?"session selected":"session",title:N.cwd||N.sessionId,onClick:()=>Gr(N.sessionId),children:[m.jsxs("span",{className:zn.has(N.sessionId)?"mark bot-mark":"mark",children:[zn.has(N.sessionId)?"BOT":Array.from(I)[0],m.jsx(Lb,{signal:Ll(N)})]}),m.jsxs("span",{className:"copy",children:[m.jsx("span",{className:"name",children:I}),m.jsx("span",{className:"preview",children:(N.sessionId===a?_d(nn,ir,t):"")||T[N.sessionId]||(N.running?t("session.running"):"")})]})]})},N.sessionId)})]}),ce?m.jsx(e3,{health:ke,usage:ge,execution:V,model:k.model}):null,m.jsxs("div",{className:"me-row",children:[m.jsxs("button",{type:"button",className:"me",onClick:()=>xe(N=>!N),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("section",{className:"chat",children:[m.jsxs("header",{className:"chat-head",children:[yt?m.jsx("button",{type:"button",className:"bot-chat-back",onClick:()=>ot(!1),children:t("nav.back")}):ba(a)?m.jsx("button",{type:"button",className:"back",onClick:Ps,children:t("nav.back")}):m.jsx("button",{type:"button",className:"back",onClick:()=>{pt(!1),vt(null),o("")},children:t("nav.sessions")}),a&&zn.has(a)?m.jsxs("span",{className:"bot-badge",children:["BOT",m.jsx(Lb,{signal:Ll({sessionId:a,running:u.find(N=>N.sessionId===a)?.running})})]}):null,m.jsx("h1",{children:yt?t("nav.botMessages"):lr}),!yt&&_d(nn,ir,t)?m.jsx("span",{className:"work-chip",children:_d(nn,ir,t)}):null,a&&!yt?m.jsx("button",{type:"button",className:"files-open","aria-pressed":rt==="memory",onClick:()=>{if(rt==="memory"){ae(null);return}pt(!1),vt(null),ae("memory")},children:t("memory.open")}):null,a&&!yt?m.jsx("button",{type:"button",className:"files-open","aria-pressed":Ct,onClick:()=>{if(Ct){pt(!1),vt(null);return}ae(N=>N==="memory"?null:N),pt(!0)},children:t("files.open")}):null,m.jsx("a",{href:sc,children:t("nav.official")})]}),ba(a)&&!yt?m.jsxs("nav",{className:"work-crumb","aria-label":t("nav.where"),children:[m.jsx("button",{type:"button",onClick:Ps,children:Nl&&Bi(Nl)||t("nav.mainSession")}),m.jsx("span",{"aria-hidden":"true",children:"/"}),m.jsx("span",{children:t("nav.worker")})]}):null,a&&!yt?m.jsx("button",{type:"button",className:"basis",onClick:()=>{pt(!1),vt(null),ae("memory")},children:Qs||t("memory.open")}):null,m.jsxs("div",{className:"chat-body",children:[m.jsx(P4,{active:Ut||Ol,progress:Ks}),Cl&&yt?m.jsx(Vb,{label:t("scroll.latest"),onClick:()=>Al("smooth")}):null,m.jsx("div",{className:"scroll",ref:Ir,"aria-busy":Ut||Ol||void 0,children:m.jsxs("div",{className:"column",ref:Ra,children:[a?null:m.jsx("p",{className:"empty-thread",children:t("nav.pick")}),a&&!Ut&&!Ol&&!yt&&Fr.length===0&&nn.length===0?m.jsx("p",{className:"empty-thread",children:t("nav.empty")}):null,m.jsx(h_,{children:m.jsx(d_,{sessionId:!yt&&!Ut&&a?a:"",pulse:xn,tickets:nn,onActive:z,dismiss:ee,onMention:N=>Ie(I=>[...I.filter(me=>!(me.canvasId===N.canvasId&&me.revision===N.revision&&me.path===N.path)),N].slice(-8)),children:Ut?null:yt?m.jsx(W_,{items:rr,botLabel:Bi,onOpenFile:(N,I)=>{ae(J=>J==="memory"?null:J),vt({path:N,line:I,token:Date.now()}),pt(!0)}}):m.jsx(L3,{sessionId:a,cwd:u.find(N=>N.sessionId===a)?.cwd,connectionPhase:ie?.phase,segments:Fr,approvals:Be,questionWaits:Qt,onCompose:N=>io(N,N.length),completed:k.completed,failures:k.failures,retries:k.retries,turnEnds:k.turnEnds,tickets:nn,now:ir,canRetry:!!a&&V.ready&&!cr,onRetry:N=>{ql(N)},onSupply:or,onOpenSession:Js,onOpenFile:(N,I)=>{ae(J=>J==="memory"?null:J),vt({path:N,line:I,token:Date.now()}),pt(!0)},onOpenInbox:()=>ot(!0),botLabel:Bi,chat:ar})})},a)]})}),yt||Ut?null:m.jsx(rO,{root:Ir,marks:Ui,busyId:k.drafting&&k.turn!=null?`turn:${k.turn}`:void 0})]}),m.jsxs(ez,{ref:Yn,lift:q,hidden:yt,children:[Cl?m.jsx(Vb,{label:t("scroll.latest"),onClick:()=>Al("smooth")}):null,m.jsxs("form",{className:"column",onSubmit:N=>{N.preventDefault(),Dl()},children:[a&&!Ut?m.jsx(zO,{segments:k.segments,drafting:k.drafting,currentTurn:k.turn,tickets:nn,connectionPhase:ie?.phase,pendingApprovals:Be}):null,m.jsxs("div",{className:"card",children:[Ze.length>0?m.jsx("div",{className:"canvas-chip-row",children:Ze.map(N=>m.jsxs("span",{className:"canvas-chip",children:[m.jsx("span",{className:"canvas-chip-text",children:N.label}),m.jsx("button",{type:"button","aria-label":t("canvas.removeMention"),onClick:()=>Ie(I=>I.filter(J=>!(J.canvasId===N.canvasId&&J.revision===N.revision&&J.path===N.path))),children:"×"})]},`${N.canvasId}:${N.revision}:${N.path}`))}):null,za?m.jsx("div",{className:"mention-menu",role:"listbox","aria-label":t("composer.mention"),children:$n.length===0?m.jsx("p",{className:"mention-empty",children:t("composer.noBot")}):$n.map((N,I)=>m.jsxs("button",{type:"button",role:"option","aria-selected":I===$r,className:I===$r?"active":"",onMouseDown:J=>{J.preventDefault(),Xr(N)},children:[m.jsx("span",{className:"bot-badge",children:"BOT"}),m.jsx("span",{className:"mention-name",children:N.label})]},N.sessionId))}):null,m.jsx("textarea",{ref:Zt,value:Te,rows:1,placeholder:a?Sh({segments:k.segments,drafting:k.drafting,currentTurn:k.turn,tickets:nn,pendingApprovals:Be,t})?.text===t("question.waiting")||Sh({segments:k.segments,drafting:k.drafting,currentTurn:k.turn,tickets:nn,pendingApprovals:Be,t})?.text===t("approval.waiting")?t("question.waiting"):zE(nn,t)??(ar&&cr?t("composer.interrupt"):zn.has(a)?t("composer.mentionHint"):t("composer.task")):t("composer.pick"),disabled:!a,onChange:N=>{R(N.target.value),ze(N.target.selectionStart??N.target.value.length)},onSelect:N=>ze(N.currentTarget.selectionStart??0),onKeyDown:N=>{if(!N.nativeEvent.isComposing){if(za&&$n.length>0){if(N.key==="ArrowDown"){N.preventDefault(),be(I=>(I+1)%$n.length);return}if(N.key==="ArrowUp"){N.preventDefault(),be(I=>(I-1+$n.length)%$n.length);return}if(N.key==="Enter"||N.key==="Tab"){N.preventDefault();const I=$n[$r];I&&Xr(I);return}if(N.key==="Escape"){N.preventDefault(),de(vn);return}}N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),Dl())}}}),m.jsxs("div",{className:"card-row",children:[m.jsxs("div",{className:"tools",ref:on,children:[m.jsx("button",{type:"button",className:"add","aria-label":t("composer.add"),"aria-haspopup":"menu","aria-expanded":Ee,disabled:!a,onClick:()=>De(N=>!N),children:m.jsx(Bb,{})}),Ee?m.jsxs("div",{className:"plus-menu",role:"menu",children:[m.jsx("button",{type:"button",role:"menuitem",onClick:()=>Xn(),children:t("composer.command")}),m.jsx("button",{type:"button",role:"menuitem",onClick:()=>{De(!1),pt(!1),vt(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,k.preset?m.jsx("button",{type:"button",className:"chip","aria-label":kh(k.preset,t),title:kh(k.preset,t),onClick:()=>ae("permission"),children:m.jsx(n3,{preset:k.preset})}):null]}),m.jsxs("div",{className:"trailing",children:[k.model?m.jsx("span",{className:"model",children:k.model}):null,cr?m.jsx("button",{type:"button",className:"stop","aria-label":t("composer.cancel"),onClick:()=>{ur()},children:m.jsx("span",{className:"stop-icon"})}):null,fr?null:m.jsx("button",{type:"submit",className:"send","aria-label":t("composer.send"),disabled:!Qn,children:m.jsx(S1,{})})]})]})]}),m.jsx("p",{className:"stats",children:et||(V.ready?W4(k):Vu(V.reason,V.reason,t))})]})]})]}),rt==="permission"&&a?m.jsx(t4,{sessionId:a,current:k.preset,onClose:()=>ae(null),onChanged:()=>tr(N=>N+1)}):null,rt==="authorization"||Oe&&rt==null?m.jsx(n4,{authorization:we,catalog:Le,onClose:()=>ae(null)}):null,rt==="cua"&&Q?m.jsx(i4,{onClose:()=>ae(null)}):null,a?m.jsx(E_,{open:Ct,sessionId:a,focus:bt,onClose:()=>{pt(!1),vt(null)}},a):null,a&&!yt?m.jsx(VO,{open:rt==="memory",sessionId:a,onClose:()=>ae(null)}):null,Ae?Sl.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||Hi(Ae.phase)}),m.jsx("div",{className:"delete-track",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Ae.percent,"aria-valuetext":Hi(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:()=>{qa(Ae.id)},children:t("session.deleteRetry")}):null]})}),document.body):null,Me?m.jsx("div",{ref:yi,className:"session-menu",role:"menu","aria-label":t("session.menu"),style:{left:Me.x,top:Me.y},onContextMenu:N=>N.preventDefault(),children:m.jsx("button",{type:"button",role:"menuitem",onClick:()=>{const N=Me.id;Ve(null),qa(N)},children:t("session.delete")})}):null,he?m.jsx(F_,{onClose:()=>Et(!1),onCreated:(N,I,J)=>{oc(N,I,J)}}):null]})}const ez=j.forwardRef(function({lift:i,hidden:r,children:a},o){const[u,c]=j.useState(null);j.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?Sl.createPortal(h,document.body):h}),j1=document.querySelector("#root");if(!j1)throw new Error("missing root");ok.createRoot(j1).render(m.jsx(j.StrictMode,{children:m.jsx(xE,{children:m.jsx(W3,{})})}));export{tz as W,VE as _,m as j,nz as m,j as r,We as u};
|
|
72
|
+
${J}`:C;Ie([]),ue(je=>je+1),await ql(me)||Ie(V)}async function or(C,V){const J=await Ri("/dsh-bot/api/work/supply",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:a,ticketId:C,text:V})});return J.status!==200||J.body.ok===!1?Jb(J.body,t("composer.supplyFailed")):""}async function ur(){if(!le||le.status!=="accepted")return;const V=(await Pe(`/tasks/${le.id}/cancel?sessionId=${encodeURIComponent(le.sessionId??"")}`,{method:"POST"})).body.task??le;O(V),V.status==="cancelled"&&q(J=>({...J,drafting:!1}))}const cr=le?.status==="accepted"&&j.drafting,Da=sr===a?nn:[],ro=Ae?.id===a,fr=pv(cr,Da,ar)||ro,Qn=!!a&&Y.ready&&Te.trim()!==""&&!fr;function Ll(C){if(!zn.has(C.sessionId))return null;const V=C.running===!0||C.sessionId===a&&(cr||j.drafting),J=C.sessionId===a&&sr===a?nn:(ac[C.sessionId]??[]).map(me=>({status:me}));return OE(J,V)}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(t3,{})}),m.jsx("button",{type:"button",className:"icon-btn","aria-label":t("new.title"),onClick:()=>Et(!0),children:m.jsx(Bb,{})})]})]}),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:[zl.length===0?m.jsx("li",{className:"empty",children:y.trim()?t("session.noMatch"):t("session.none")}):null,zl.map(C=>{const V=Fn(C);return m.jsx("li",{onContextMenu:J=>to(J,C.sessionId),children:m.jsxs("button",{type:"button",className:C.sessionId===a?"session selected":"session",title:C.cwd||C.sessionId,onClick:()=>Gr(C.sessionId),children:[m.jsxs("span",{className:zn.has(C.sessionId)?"mark bot-mark":"mark",children:[zn.has(C.sessionId)?"BOT":Array.from(V)[0],m.jsx(Lb,{signal:Ll(C)})]}),m.jsxs("span",{className:"copy",children:[m.jsx("span",{className:"name",children:V}),m.jsx("span",{className:"preview",children:(C.sessionId===a?_d(nn,ir,t):"")||T[C.sessionId]||(C.running?t("session.running"):"")})]})]})},C.sessionId)})]}),ce?m.jsx(e3,{health:ke,usage:ge,execution:Y,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("section",{className:"chat",children:[m.jsxs("header",{className:"chat-head",children:[yt?m.jsx("button",{type:"button",className:"bot-chat-back",onClick:()=>ot(!1),children:t("nav.back")}):ba(a)?m.jsx("button",{type:"button",className:"back",onClick:Ps,children:t("nav.back")}):m.jsx("button",{type:"button",className:"back",onClick:()=>{pt(!1),vt(null),o("")},children:t("nav.sessions")}),a&&zn.has(a)?m.jsxs("span",{className:"bot-badge",children:["BOT",m.jsx(Lb,{signal:Ll({sessionId:a,running:u.find(C=>C.sessionId===a)?.running})})]}):null,m.jsx("h1",{children:yt?t("nav.botMessages"):lr}),!yt&&_d(nn,ir,t)?m.jsx("span",{className:"work-chip",children:_d(nn,ir,t)}):null,a&&!yt?m.jsx("button",{type:"button",className:"files-open","aria-pressed":rt==="memory",onClick:()=>{if(rt==="memory"){ae(null);return}pt(!1),vt(null),ae("memory")},children:t("memory.open")}):null,a&&!yt?m.jsx("button",{type:"button",className:"files-open","aria-pressed":Ct,onClick:()=>{if(Ct){pt(!1),vt(null);return}ae(C=>C==="memory"?null:C),pt(!0)},children:t("files.open")}):null,m.jsx("a",{href:sc,children:t("nav.official")})]}),ba(a)&&!yt?m.jsxs("nav",{className:"work-crumb","aria-label":t("nav.where"),children:[m.jsx("button",{type:"button",onClick:Ps,children:Nl&&Bi(Nl)||t("nav.mainSession")}),m.jsx("span",{"aria-hidden":"true",children:"/"}),m.jsx("span",{children:t("nav.worker")})]}):null,a&&!yt?m.jsx("button",{type:"button",className:"basis",onClick:()=>{pt(!1),vt(null),ae("memory")},children:Qs||t("memory.open")}):null,m.jsxs("div",{className:"chat-body",children:[m.jsx(P4,{active:Ut||Ol,progress:Ks}),Cl&&yt?m.jsx(Vb,{label:t("scroll.latest"),onClick:()=>Al("smooth")}):null,m.jsx("div",{className:"scroll",ref:Ir,"aria-busy":Ut||Ol||void 0,children:m.jsxs("div",{className:"column",ref:Ra,children:[a?null:m.jsx("p",{className:"empty-thread",children:t("nav.pick")}),a&&!Ut&&!Ol&&!yt&&Fr.length===0&&nn.length===0?m.jsx("p",{className:"empty-thread",children:t("nav.empty")}):null,m.jsx(h_,{children:m.jsx(d_,{sessionId:!yt&&!Ut&&a?a:"",pulse:xn,tickets:nn,onActive:z,dismiss:ee,onMention:C=>Ie(V=>[...V.filter(me=>!(me.canvasId===C.canvasId&&me.revision===C.revision&&me.path===C.path)),C].slice(-8)),children:Ut?null:yt?m.jsx(W_,{items:rr,botLabel:Bi,onOpenFile:(C,V)=>{ae(J=>J==="memory"?null:J),vt({path:C,line:V,token:Date.now()}),pt(!0)}}):m.jsx(L3,{sessionId:a,cwd:u.find(C=>C.sessionId===a)?.cwd,connectionPhase:ie?.phase,segments:Fr,approvals:Be,questionWaits:Qt,onCompose:C=>io(C,C.length),completed:j.completed,failures:j.failures,retries:j.retries,turnEnds:j.turnEnds,tickets:nn,now:ir,canRetry:!!a&&Y.ready&&!cr,onRetry:C=>{ql(C)},onSupply:or,onOpenSession:Js,onOpenFile:(C,V)=>{ae(J=>J==="memory"?null:J),vt({path:C,line:V,token:Date.now()}),pt(!0)},onOpenInbox:()=>ot(!0),botLabel:Bi,chat:ar})})},a)]})}),yt||Ut?null:m.jsx(rO,{root:Ir,marks:Ui,busyId:j.drafting&&j.turn!=null?`turn:${j.turn}`:void 0})]}),m.jsxs(ez,{ref:Yn,lift:M,hidden:yt,children:[Cl?m.jsx(Vb,{label:t("scroll.latest"),onClick:()=>Al("smooth")}):null,m.jsxs("form",{className:"column",onSubmit:C=>{C.preventDefault(),Dl()},children:[a&&!Ut?m.jsx(zO,{segments:j.segments,drafting:j.drafting,currentTurn:j.turn,tickets:nn,connectionPhase:ie?.phase,pendingApprovals:Be}):null,m.jsxs("div",{className:"card",children:[Ze.length>0?m.jsx("div",{className:"canvas-chip-row",children:Ze.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(V=>V.filter(J=>!(J.canvasId===C.canvasId&&J.revision===C.revision&&J.path===C.path))),children:"×"})]},`${C.canvasId}:${C.revision}:${C.path}`))}):null,za?m.jsx("div",{className:"mention-menu",role:"listbox","aria-label":t("composer.mention"),children:$n.length===0?m.jsx("p",{className:"mention-empty",children:t("composer.noBot")}):$n.map((C,V)=>m.jsxs("button",{type:"button",role:"option","aria-selected":V===$r,className:V===$r?"active":"",onMouseDown:J=>{J.preventDefault(),Xr(C)},children:[m.jsx("span",{className:"bot-badge",children:"BOT"}),m.jsx("span",{className:"mention-name",children:C.label})]},C.sessionId))}):null,m.jsx("textarea",{ref:Zt,value:Te,rows:1,placeholder:a?kh({segments:j.segments,drafting:j.drafting,currentTurn:j.turn,tickets:nn,pendingApprovals:Be,t})?.text===t("question.waiting")||kh({segments:j.segments,drafting:j.drafting,currentTurn:j.turn,tickets:nn,pendingApprovals:Be,t})?.text===t("approval.waiting")?t("question.waiting"):zE(nn,t)??(ar&&cr?t("composer.interrupt"):zn.has(a)?t("composer.mentionHint"):t("composer.task")):t("composer.pick"),disabled:!a,onChange:C=>{R(C.target.value),ze(C.target.selectionStart??C.target.value.length)},onSelect:C=>ze(C.currentTarget.selectionStart??0),onKeyDown:C=>{if(!C.nativeEvent.isComposing){if(za&&$n.length>0){if(C.key==="ArrowDown"){C.preventDefault(),be(V=>(V+1)%$n.length);return}if(C.key==="ArrowUp"){C.preventDefault(),be(V=>(V-1+$n.length)%$n.length);return}if(C.key==="Enter"||C.key==="Tab"){C.preventDefault();const V=$n[$r];V&&Xr(V);return}if(C.key==="Escape"){C.preventDefault(),de(vn);return}}C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),Dl())}}}),m.jsxs("div",{className:"card-row",children:[m.jsxs("div",{className:"tools",ref:on,children:[m.jsx("button",{type:"button",className:"add","aria-label":t("composer.add"),"aria-haspopup":"menu","aria-expanded":Ee,disabled:!a,onClick:()=>De(C=>!C),children:m.jsx(Bb,{})}),Ee?m.jsxs("div",{className:"plus-menu",role:"menu",children:[m.jsx("button",{type:"button",role:"menuitem",onClick:()=>Xn(),children:t("composer.command")}),m.jsx("button",{type:"button",role:"menuitem",onClick:()=>{De(!1),pt(!1),vt(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,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(n3,{preset:j.preset})}):null]}),m.jsxs("div",{className:"trailing",children:[j.model?m.jsx("span",{className:"model",children:j.model}):null,cr?m.jsx("button",{type:"button",className:"stop","aria-label":t("composer.cancel"),onClick:()=>{ur()},children:m.jsx("span",{className:"stop-icon"})}):null,fr?null:m.jsx("button",{type:"submit",className:"send","aria-label":t("composer.send"),disabled:!Qn,children:m.jsx(S1,{})})]})]})]}),m.jsx("p",{className:"stats",children:tt||(Y.ready?W4(j):Vu(Y.reason,Y.reason,t))})]})]})]}),rt==="permission"&&a?m.jsx(t4,{sessionId:a,current:j.preset,onClose:()=>ae(null),onChanged:()=>tr(C=>C+1)}):null,rt==="authorization"||Oe&&rt==null?m.jsx(n4,{authorization:we,catalog:Le,onClose:()=>ae(null)}):null,rt==="cua"&&Q?m.jsx(i4,{onClose:()=>ae(null)}):null,a?m.jsx(E_,{open:Ct,sessionId:a,focus:bt,onClose:()=>{pt(!1),vt(null)}},a):null,a&&!yt?m.jsx(VO,{open:rt==="memory",sessionId:a,onClose:()=>ae(null)}):null,Ae?Sl.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||Hi(Ae.phase)}),m.jsx("div",{className:"delete-track",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Ae.percent,"aria-valuetext":Hi(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:()=>{qa(Ae.id)},children:t("session.deleteRetry")}):null]})}),document.body):null,Me?m.jsx("div",{ref:yi,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),qa(C)},children:t("session.delete")})}):null,he?m.jsx(F_,{onClose:()=>Et(!1),onCreated:(C,V,J)=>{oc(C,V,J)}}):null]})}const ez=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?Sl.createPortal(h,document.body):h}),j1=document.querySelector("#root");if(!j1)throw new Error("missing root");ok.createRoot(j1).render(m.jsx(E.StrictMode,{children:m.jsx(xE,{children:m.jsx(W3,{})})}));export{tz as W,VE as _,m as j,nz as m,E as r,et as u};
|