@pasko70/pibo 2.2.4 → 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/agent-runtime/capabilities.js +9 -1
  2. package/dist/agent-runtimes/codex-native/adapter.js +5 -0
  3. package/dist/agent-runtimes/omp/adapter.js +5 -0
  4. package/dist/agent-runtimes/omp/turn.js +2 -0
  5. package/dist/agent-runtimes/pi/adapter.js +27 -6
  6. package/dist/agent-runtimes/pi/intent-tracing.js +120 -0
  7. package/dist/agent-runtimes/pi/routed-session.js +25 -8
  8. package/dist/agent-runtimes/pi/runtime.js +3 -0
  9. package/dist/apps/chat/chat-settings-routes.js +44 -3
  10. package/dist/apps/chat/chat-transcription.js +85 -0
  11. package/dist/apps/chat/data/chat-data-mappers.js +4 -4
  12. package/dist/apps/chat/stream.js +23 -9
  13. package/dist/apps/chat/trace-v2.js +1 -0
  14. package/dist/apps/chat/web-app.js +49 -0
  15. package/dist/apps/chat-ui/assets/{dist-CImWCF2M.js → dist-BCRR_a0Z.js} +1 -1
  16. package/dist/apps/chat-ui/assets/{dist-luJVFsmq.js → dist-BK7eaoLT.js} +1 -1
  17. package/dist/apps/chat-ui/assets/{dist-BFwTuvyi.js → dist-CTUT484B.js} +1 -1
  18. package/dist/apps/chat-ui/assets/{dist-ltfz1vFX.js → dist-fNgdnmyE.js} +1 -1
  19. package/dist/apps/chat-ui/assets/{dist-rf4HYdoa.js → dist-wq3P0LZj.js} +1 -1
  20. package/dist/apps/chat-ui/assets/{index-nZQXUpxE.css → index-BJ56TREg.css} +1 -1
  21. package/dist/apps/chat-ui/assets/index-DsFKL_EZ.js +228 -0
  22. package/dist/apps/chat-ui/index.html +2 -2
  23. package/dist/apps/chat-vscode-web/assets/index-R4FTxr78.js +43 -0
  24. package/dist/apps/chat-vscode-web/index.html +1 -1
  25. package/dist/apps/vscode-artifacts/latest.vsix +0 -0
  26. package/dist/apps/vscode-artifacts/pibo-vscode-ext-2.2.5.vsix +0 -0
  27. package/dist/core/gateway-resource-guard.js +35 -14
  28. package/dist/core/gateway-settings.js +64 -0
  29. package/dist/core/session-router.js +5 -1
  30. package/dist/core/user-settings.js +20 -0
  31. package/dist/data/ingest-service.js +2 -2
  32. package/dist/debug/index.js +7 -2
  33. package/dist/gateway/server.js +2 -0
  34. package/dist/index.js +5 -0
  35. package/dist/plugins/builtin.js +4 -2
  36. package/dist/plugins/openai-chatgpt-transcription.js +12 -0
  37. package/dist/plugins/openai-transcription.js +12 -0
  38. package/dist/plugins/registry.js +23 -0
  39. package/dist/session-ui/terminalRows.js +51 -1
  40. package/dist/shared/trace-event-projection.js +4 -0
  41. package/dist/shared/trace-live-reducer.js +4 -0
  42. package/dist/shared/trace-patch-nodes.js +1 -0
  43. package/dist/transcription/openai-chatgpt.js +148 -0
  44. package/dist/transcription/openai.js +72 -0
  45. package/dist/transcription/types.js +8 -0
  46. package/npm-shrinkwrap.json +2 -2
  47. package/package.json +1 -1
  48. package/dist/apps/chat-ui/assets/index-D2Maa2v1.js +0 -226
  49. package/dist/apps/chat-vscode-web/assets/index-BpurWVnX.js +0 -41
  50. package/dist/apps/vscode-artifacts/pibo-vscode-ext-2.2.4.vsix +0 -0
@@ -0,0 +1,43 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function te(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function ne(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function A(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,A(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+te(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+te(a,u),c+=A(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+te(a,u++),c+=A(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return A(ne(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function j(e,t,n){if(e==null)return e;var r=[],i=0;return A(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var M=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},N={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=N,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:re}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,M)}catch(e){M(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&te(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function te(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),te=Symbol.iterator;function ne(e){return typeof e!=`object`||!e?null:(e=te&&e[te]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var re=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},ae=[],oe=-1;function se(e){return{current:e}}function ce(e){0>oe||(e.current=ae[oe],ae[oe]=null,oe--)}function le(e,t){oe++,ae[oe]=e.current,e.current=t}var ue=se(null),de=se(null),P=se(null),fe=se(null);function pe(e,t){switch(le(P,t),le(de,e),le(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ud(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ud(t),e=Wd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ce(ue),le(ue,e)}function me(){ce(ue),ce(de),ce(P)}function he(e){e.memoizedState!==null&&le(fe,e);var t=ue.current,n=Wd(t,e.type);t!==n&&(le(de,e),le(ue,n))}function ge(e){de.current===e&&(ce(ue),ce(de)),fe.current===e&&(ce(fe),ep._currentValue=ie)}var _e,ve;function ye(e){if(_e===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);_e=t&&t[1]||``,ve=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+_e+e+ve}var be=!1;function xe(e,t){if(!e||be)return``;be=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{be=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ye(n):``}function Se(e,t){switch(e.tag){case 26:case 27:case 5:return ye(e.type);case 16:return ye(`Lazy`);case 13:return e.child!==t&&t!==null?ye(`Suspense Fallback`):ye(`Suspense`);case 19:return ye(`SuspenseList`);case 0:case 15:return xe(e.type,!1);case 11:return xe(e.type.render,!1);case 1:return xe(e.type,!0);case 31:return ye(`Activity`);default:return``}}function Ce(e){try{var t=``,n=null;do t+=Se(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var we=Object.prototype.hasOwnProperty,Te=t.unstable_scheduleCallback,Ee=t.unstable_cancelCallback,De=t.unstable_shouldYield,Oe=t.unstable_requestPaint,ke=t.unstable_now,Ae=t.unstable_getCurrentPriorityLevel,je=t.unstable_ImmediatePriority,Me=t.unstable_UserBlockingPriority,Ne=t.unstable_NormalPriority,Pe=t.unstable_LowPriority,Fe=t.unstable_IdlePriority,Ie=t.log,Le=t.unstable_setDisableYieldValue,Re=null,ze=null;function Be(e){if(typeof Ie==`function`&&Le(e),ze&&typeof ze.setStrictMode==`function`)try{ze.setStrictMode(Re,e)}catch{}}var Ve=Math.clz32?Math.clz32:We,He=Math.log,Ue=Math.LN2;function We(e){return e>>>=0,e===0?32:31-(He(e)/Ue|0)|0}var Ge=256,Ke=262144,F=4194304;function I(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;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 qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=I(n))):i=I(o):i=I(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=I(n))):i=I(o)):i=I(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xe(){var e=F;return F<<=1,!(F&62914560)&&(F=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ve(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&et(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function et(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ve(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function tt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ve(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function nt(e,t){var n=t&-t;return n=n&42?1:rt(n),(n&(e.suspendedLanes|t))===0?n:0}function rt(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 it(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function at(){var e=N.p;return e===0?(e=window.event,e===void 0?32:hp(e.type)):e}function ot(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var st=Math.random().toString(36).slice(2),ct=`__reactFiber$`+st,lt=`__reactProps$`+st,ut=`__reactContainer$`+st,dt=`__reactEvents$`+st,ft=`__reactListeners$`+st,pt=`__reactHandles$`+st,mt=`__reactResources$`+st,ht=`__reactMarker$`+st;function gt(e){delete e[ct],delete e[lt],delete e[dt],delete e[ft],delete e[pt]}function _t(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ut]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pf(e);e!==null;){if(n=e[ct])return n;e=pf(e)}return t}e=n,n=e.parentNode}return null}function vt(e){if(e=e[ct]||e[ut]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function yt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function bt(e){var t=e[mt];return t||=e[mt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function xt(e){e[ht]=!0}var St=new Set,Ct={};function wt(e,t){Tt(e,t),Tt(e+`Capture`,t)}function Tt(e,t){for(Ct[e]=t,e=0;e<t.length;e++)St.add(t[e])}var Et=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]*$`),Dt={},Ot={};function kt(e){return we.call(Ot,e)?!0:we.call(Dt,e)?!1:Et.test(e)?Ot[e]=!0:(Dt[e]=!0,!1)}function At(e,t,n){if(kt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function jt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Mt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Nt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Pt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ft(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function It(e){if(!e._valueTracker){var t=Pt(e)?`checked`:`value`;e._valueTracker=Ft(e,t,``+e[t])}}function Lt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Pt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Rt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var zt=/[\n"\\]/g;function Bt(e){return e.replace(zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Vt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Nt(t)):e.value!==``+Nt(t)&&(e.value=``+Nt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ut(e,o,Nt(n)):Ut(e,o,Nt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Nt(s):e.removeAttribute(`name`)}function Ht(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){It(e);return}n=n==null?``:``+Nt(n),t=t==null?n:``+Nt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),It(e)}function Ut(e,t,n){t===`number`&&Rt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Wt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Nt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Gt(e,t,n){if(t!=null&&(t=``+Nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Nt(n)}function Kt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(re(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Nt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),It(e)}function qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jt=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 Yt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Jt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function L(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Yt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Yt(e,o,t[o])}function Xt(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 Zt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Qt=/^[\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 $t(e){return Qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function en(){}var tn=null;function nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rn=null,an=null;function on(e){var t=vt(e);if(t&&(e=t.stateNode)){var n=e[lt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Vt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Bt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[lt]||null;if(!a)throw Error(i(90));Vt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Lt(r)}break a;case`textarea`:Gt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Wt(e,!!n.multiple,t,!1)}}}var sn=!1;function cn(e,t,n){if(sn)return e(t,n);sn=!0;try{return e(t)}finally{if(sn=!1,(rn!==null||an!==null)&&(Cu(),rn&&(t=rn,e=an,an=rn=null,on(t),e)))for(t=0;t<e.length;t++)on(e[t])}}function ln(e,t){var n=e.stateNode;if(n===null)return null;var r=n[lt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var un=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),dn=!1;if(un)try{var fn={};Object.defineProperty(fn,"passive",{get:function(){dn=!0}}),window.addEventListener(`test`,fn,fn),window.removeEventListener(`test`,fn,fn)}catch{dn=!1}var pn=null,mn=null,hn=null;function gn(){if(hn)return hn;var e,t=mn,n=t.length,r,i=`value`in pn?pn.value:pn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return hn=i.slice(e,1<r?1-r:void 0)}function _n(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function vn(){return!0}function yn(){return!1}function bn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?vn:yn,this.isPropagationStopped=yn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=vn)},persist:function(){},isPersistent:vn}),t}var xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sn=bn(xn),Cn=m({},xn,{view:0,detail:0}),wn=bn(Cn),Tn,En,Dn,On=m({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zn,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!==Dn&&(Dn&&e.type===`mousemove`?(Tn=e.screenX-Dn.screenX,En=e.screenY-Dn.screenY):En=Tn=0,Dn=e),Tn)},movementY:function(e){return`movementY`in e?e.movementY:En}}),kn=bn(On),An=bn(m({},On,{dataTransfer:0})),jn=bn(m({},Cn,{relatedTarget:0})),Mn=bn(m({},xn,{animationName:0,elapsedTime:0,pseudoElement:0})),Nn=bn(m({},xn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Pn=bn(m({},xn,{data:0})),Fn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},In={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`},Ln={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ln[e])?!!t[e]:!1}function zn(){return Rn}var Bn=bn(m({},Cn,{key:function(e){if(e.key){var t=Fn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=_n(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?In[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zn,charCode:function(e){return e.type===`keypress`?_n(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?_n(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Vn=bn(m({},On,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Hn=bn(m({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zn})),Un=bn(m({},xn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Wn=bn(m({},On,{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})),Gn=bn(m({},xn,{newState:0,oldState:0})),Kn=[9,13,27,32],qn=un&&`CompositionEvent`in window,Jn=null;un&&`documentMode`in document&&(Jn=document.documentMode);var Yn=un&&`TextEvent`in window&&!Jn,Xn=un&&(!qn||Jn&&8<Jn&&11>=Jn),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return Kn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function nr(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function rr(e,t){if(tr)return e===`compositionend`||!qn&&$n(e,t)?(e=gn(),hn=mn=pn=null,tr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Xn&&t.locale!==`ko`?null:t.data;default:return null}}var ir={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 ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ir[e.type]:t===`textarea`}function or(e,t,n,r){rn?an?an.push(r):an=[r]:rn=r,t=Dd(t,`onChange`),0<t.length&&(n=new Sn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var sr=null,cr=null;function lr(e){X(e,0)}function ur(e){if(Lt(yt(e)))return e}function dr(e,t){if(e===`change`)return t}var fr=!1;if(un){var pr;if(un){var mr=`oninput`in document;if(!mr){var hr=document.createElement(`div`);hr.setAttribute(`oninput`,`return;`),mr=typeof hr.oninput==`function`}pr=mr}else pr=!1;fr=pr&&(!document.documentMode||9<document.documentMode)}function gr(){sr&&(sr.detachEvent(`onpropertychange`,_r),cr=sr=null)}function _r(e){if(e.propertyName===`value`&&ur(cr)){var t=[];or(t,cr,e,nn(e)),cn(lr,t)}}function vr(e,t,n){e===`focusin`?(gr(),sr=t,cr=n,sr.attachEvent(`onpropertychange`,_r)):e===`focusout`&&gr()}function R(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ur(cr)}function yr(e,t){if(e===`click`)return ur(t)}function br(e,t){if(e===`input`||e===`change`)return ur(t)}function z(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var xr=typeof Object.is==`function`?Object.is:z;function Sr(e,t){if(xr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!we.call(t,i)||!xr(e[i],t[i]))return!1}return!0}function Cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wr(e,t){var n=Cr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Cr(n)}}function B(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?B(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function V(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rt(e.document)}return t}function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var H=un&&`documentMode`in document&&11>=document.documentMode,Er=null,Dr=null,Or=null,kr=!1;function Ar(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kr||Er==null||Er!==Rt(r)||(r=Er,`selectionStart`in r&&Tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Or&&Sr(Or,r)||(Or=r,r=Dd(Dr,`onSelect`),0<r.length&&(t=new Sn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Er)))}function jr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var U={animationend:jr(`Animation`,`AnimationEnd`),animationiteration:jr(`Animation`,`AnimationIteration`),animationstart:jr(`Animation`,`AnimationStart`),transitionrun:jr(`Transition`,`TransitionRun`),transitionstart:jr(`Transition`,`TransitionStart`),transitioncancel:jr(`Transition`,`TransitionCancel`),transitionend:jr(`Transition`,`TransitionEnd`)},Mr={},Nr={};un&&(Nr=document.createElement(`div`).style,`AnimationEvent`in window||(delete U.animationend.animation,delete U.animationiteration.animation,delete U.animationstart.animation),`TransitionEvent`in window||delete U.transitionend.transition);function Pr(e){if(Mr[e])return Mr[e];if(!U[e])return e;var t=U[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),W=Pr(`transitioncancel`),Br=Pr(`transitionend`),Vr=new Map,Hr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Hr.push(`scrollEnd`);function Ur(e,t){Vr.set(e,t),wt(t,[e])}var Wr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Gr=[],Kr=0,qr=0;function Jr(){for(var e=Kr,t=qr=Kr=0;t<e;){var n=Gr[t];Gr[t++]=null;var r=Gr[t];Gr[t++]=null;var i=Gr[t];Gr[t++]=null;var a=Gr[t];if(Gr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Qr(n,i,a)}}function Yr(e,t,n,r){Gr[Kr++]=e,Gr[Kr++]=t,Gr[Kr++]=n,Gr[Kr++]=r,qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Xr(e,t,n,r){return Yr(e,t,n,r),$r(e)}function Zr(e,t){return Yr(e,null,null,t),$r(e)}function Qr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ve(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function $r(e){if(50<mu)throw mu=0,hu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ei={};function ti(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ni(e,t,n,r){return new ti(e,t,n,r)}function ri(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ii(e,t){var n=e.alternate;return n===null?(n=ni(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ai(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function oi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ri(e)&&(s=1);else if(typeof e==`string`)s=Gf(e,n,ue.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ni(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return si(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ni(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ni(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ni(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function si(e,t,n,r){return e=ni(7,e,r,t),e.lanes=n,e}function ci(e,t,n){return e=ni(6,e,null,t),e.lanes=n,e}function li(e){var t=ni(18,null,null,0);return t.stateNode=e,t}function ui(e,t,n){return t=ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var di=new WeakMap;function fi(e,t){if(typeof e==`object`&&e){var n=di.get(e);return n===void 0?(t={value:e,source:t,stack:Ce(t)},di.set(e,t),t):n}return{value:e,source:t,stack:Ce(t)}}var pi=[],mi=0,hi=null,gi=0,_i=[],vi=0,yi=null,bi=1,xi=``;function Si(e,t){pi[mi++]=gi,pi[mi++]=hi,hi=e,gi=t}function Ci(e,t,n){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,yi=e;var r=bi;e=xi;var i=32-Ve(r)-1;r&=~(1<<i),n+=1;var a=32-Ve(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,bi=1<<32-Ve(t)+i|n<<i|r,xi=a+e}else bi=1<<a|n<<i|r,xi=e}function wi(e){e.return!==null&&(Si(e,1),Ci(e,1,0))}function Ti(e){for(;e===hi;)hi=pi[--mi],pi[mi]=null,gi=pi[--mi],pi[mi]=null;for(;e===yi;)yi=_i[--vi],_i[vi]=null,xi=_i[--vi],_i[vi]=null,bi=_i[--vi],_i[vi]=null}function Ei(e,t){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,bi=t.id,xi=t.overflow,yi=e}var Di=null,Oi=null,G=!1,ki=null,Ai=!1,ji=Error(i(519));function Mi(e){throw Ri(fi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ji}function Ni(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ct]=e,t[lt]=r,n){case`dialog`:Z(`cancel`,t),Z(`close`,t);break;case`iframe`:case`object`:case`embed`:Z(`load`,t);break;case`video`:case`audio`:for(n=0;n<yd.length;n++)Z(yd[n],t);break;case`source`:Z(`error`,t);break;case`img`:case`image`:case`link`:Z(`error`,t),Z(`load`,t);break;case`details`:Z(`toggle`,t);break;case`input`:Z(`invalid`,t),Ht(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Z(`invalid`,t);break;case`textarea`:Z(`invalid`,t),Kt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Nd(t.textContent,n)?(r.popover!=null&&(Z(`beforetoggle`,t),Z(`toggle`,t)),r.onScroll!=null&&Z(`scroll`,t),r.onScrollEnd!=null&&Z(`scrollend`,t),r.onClick!=null&&(t.onclick=en),t=!0):t=!1,t||Mi(e,!0)}function Pi(e){for(Di=e.return;Di;)switch(Di.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:Di=Di.return}}function Fi(e){if(e!==Di)return!1;if(!G)return Pi(e),G=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Gd(e.type,e.memoizedProps)),n=!n),n&&Oi&&Mi(e),Pi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=ff(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=ff(e)}else t===27?(t=Oi,$d(e.type)?(e=df,df=null,Oi=e):Oi=t):Oi=Di?uf(e.stateNode.nextSibling):null;return!0}function Ii(){Oi=Di=null,G=!1}function Li(){var e=ki;return e!==null&&(eu===null?eu=e:eu.push.apply(eu,e),ki=null),e}function Ri(e){ki===null?ki=[e]:ki.push(e)}var zi=se(null),Bi=null,Vi=null;function Hi(e,t,n){le(zi,t._currentValue),t._currentValue=n}function Ui(e){e._currentValue=zi.current,ce(zi)}function Wi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Gi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Wi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Wi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ki(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;xr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===fe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ep]:e.push(ep))}a=a.return}e!==null&&Gi(t,e,n,r),t.flags|=262144}function qi(e){for(e=e.firstContext;e!==null;){if(!xr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ji(e){Bi=e,Vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yi(e){return Zi(Bi,e)}function Xi(e,t){return Bi===null&&Ji(e),Zi(e,t)}function Zi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Vi===null){if(e===null)throw Error(i(308));Vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vi=Vi.next=t;return n}var Qi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},$i=t.unstable_scheduleCallback,ea=t.unstable_NormalPriority,ta={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function na(){return{controller:new Qi,data:new Map,refCount:0}}function ra(e){e.refCount--,e.refCount===0&&$i(ea,function(){e.controller.abort()})}var ia=null,aa=0,oa=0,sa=null;function ca(e,t){if(ia===null){var n=ia=[];aa=0,oa=md(),sa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return aa++,t.then(la,la),t}function la(){if(--aa===0&&ia!==null){sa!==null&&(sa.status=`fulfilled`);var e=ia;ia=null,oa=0,sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var da=M.S;M.S=function(e,t){ru=ke(),typeof t==`object`&&t&&typeof t.then==`function`&&ca(e,t),da!==null&&da(e,t)};var fa=se(null);function pa(){var e=fa.current;return e===null?Rl.pooledCache:e}function ma(e,t){t===null?le(fa,fa.current):le(fa,t.pool)}function ha(){var e=pa();return e===null?null:{parent:ta._currentValue,pool:e}}var ga=Error(i(460)),_a=Error(i(474)),va=Error(i(542)),ya={then:function(){}};function ba(e){return e=e.status,e===`fulfilled`||e===`rejected`}function xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(en,en),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e;default:if(typeof t.status==`string`)t.then(en,en);else{if(e=Rl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e}throw Ca=t,ga}}function Sa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ca=e,ga):e}}var Ca=null;function wa(){if(Ca===null)throw Error(i(459));var e=Ca;return Ca=null,e}function Ta(e){if(e===ga||e===va)throw Error(i(483))}var Ea=null,Da=0;function Oa(e){var t=Da;return Da+=1,Ea===null&&(Ea=[]),xa(Ea,e,t)}function ka(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Aa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ja(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ii(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ci(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Sa(i)===t.type)?(t=a(t,n.props),ka(t,n),t.return=e,t):(t=oi(n.type,n.key,n.props,null,e.mode,r),ka(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ui(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=si(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ci(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=oi(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case v:return t=ui(t,e.mode,n),t.return=e,t;case O:return t=Sa(t),f(e,t,n)}if(re(t)||ne(t))return t=si(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Oa(t),n);if(t.$$typeof===C)return f(e,Xi(e,t),n);Aa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Sa(n),p(e,t,n,r)}if(re(n)||ne(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Oa(n),r);if(n.$$typeof===C)return p(e,t,Xi(e,n),r);Aa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Sa(r),m(e,t,n,r,i)}if(re(r)||ne(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Oa(r),i);if(r.$$typeof===C)return m(e,t,n,Xi(t,r),i);Aa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),G&&Si(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return G&&Si(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),G&&Si(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),G&&Si(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return G&&Si(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),G&&Si(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Sa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ka(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=oi(o.type,o.key,o.props,null,e.mode,c),ka(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=ui(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Sa(o),b(e,r,o,c)}if(re(o))return h(e,r,o,c);if(ne(o)){if(l=ne(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Oa(o),c);if(o.$$typeof===C)return b(e,r,Xi(e,o),c);Aa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Da=0;var i=b(e,t,n,r);return Ea=null,i}catch(t){if(t===ga||t===va)throw t;var a=ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ma=ja(!0),Na=ja(!1),Pa=!1;function Fa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ia(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ll&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=$r(e),Qr(e,null,n),t}return Yr(e,r,t,n),$r(e)}function za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}function Ba(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Va=!1;function Ha(){if(Va){var e=sa;if(e!==null)throw e}}function Ua(e,t,n,r){Va=!1;var i=e.updateQueue;Pa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Bl&f)===f:(r&f)===f){f!==0&&f===oa&&(Va=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Pa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Jl|=o,e.lanes=o,e.memoizedState=d}}function Wa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ga(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Wa(n[e],t)}var Ka=se(null),qa=se(0);function Ja(e,t){e=Kl,le(qa,e),le(Ka,t),Kl=e|t.baseLanes}function Ya(){le(qa,Kl),le(Ka,Ka.current)}function Xa(){Kl=qa.current,ce(Ka),ce(qa)}var Za=se(null),Qa=null;function $a(e){var t=e.alternate;le(io,io.current&1),le(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){le(io,io.current),le(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(le(io,io.current),le(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){le(io,io.current),le(Za,Za.current)}function ro(e){ce(Za),Qa===e&&(Qa=null),ce(io)}var io=se(0);function ao(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sf(n)||cf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var oo=0,so=null,co=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(i(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xr(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return oo=a,so=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?Is:Ls,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){M.H=Fs;var t=co!==null&&co.next!==null;if(oo=0,lo=co=so=null,uo=!1,ho=0,go=null,t)throw Error(i(300));e===null||ec||(e=e.dependencies,e!==null&&qi(e)&&(ec=!0))}function So(e,t,n,r){so=e;var a=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=a)throw Error(i(301));if(a+=1,lo=co=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=Rs,o=t(n,r)}while(fo);return o}function Co(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?ko(t):t,e=e.useState()[0],(co===null?null:co.memoizedState)!==e&&(so.flags|=1024),t}function K(){var e=mo!==0;return mo=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}oo=0,lo=co=so=null,fo=!1,ho=mo=0,go=null}function Eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?so.memoizedState=lo=e:lo=lo.next=e,lo}function Do(){if(co===null){var e=so.alternate;e=e===null?null:e.memoizedState}else e=co.next;var t=lo===null?so.memoizedState:lo.next;if(t!==null)lo=t,co=e;else{if(e===null)throw so.alternate===null?Error(i(467)):Error(i(310));co=e,e={memoizedState:co.memoizedState,baseState:co.baseState,baseQueue:co.baseQueue,queue:co.queue,next:null},lo===null?so.memoizedState=lo=e:lo=lo.next=e}return lo}function Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=ho;return ho+=1,go===null&&(go=[]),e=xa(go,e,t),t=so,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?Is:Ls),e}function Ao(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ko(e);if(e.$$typeof===C)return Yi(e)}throw Error(i(438,String(e)))}function jo(e){var t=null,n=so.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=so.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Oo(),so.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ee;return t.index++,n}function Mo(e,t){return typeof t==`function`?t(e):t}function No(e){return Po(Do(),co,e)}function Po(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(oo&f)===f:(Bl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===oa&&(d=!0);else if((oo&p)===p){u=u.next,p===oa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,so.lanes|=p,Jl|=p;f=u.action,po&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,so.lanes|=f,Jl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!xr(o,e.memoizedState)&&(ec=!0,d&&(n=sa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Fo(e){var t=Do(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);xr(o,t.memoizedState)||(ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Io(e,t,n){var r=so,a=Do(),o=G;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!xr((co||a).memoizedState,n);if(s&&(a.memoizedState=n,ec=!0),a=a.queue,ss(zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,a,n,t),null),Rl===null)throw Error(i(349));o||oo&127||Lo(r,t,n)}return n}function Lo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=so.updateQueue,t===null?(t=Oo(),so.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Bo(t)&&Vo(e)}function zo(e,t,n){return n(function(){Bo(t)&&Vo(e)})}function Bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xr(e,n)}catch{return!0}}function Vo(e){var t=Zr(e,2);t!==null&&vu(t,e,2)}function Ho(e){var t=Eo();if(typeof e==`function`){var n=e;if(e=n(),po){Be(!0);try{n()}finally{Be(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t}function Uo(e,t,n,r){return e.baseState=n,Po(e,co,typeof r==`function`?r:Mo)}function Wo(e,t,n,r,a){if(Ms(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Go(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Go(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),Ko(e,t,s)}catch(n){Jo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){Jo(e,t,n)}}function Ko(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){qo(e,t,n)},function(n){return Jo(e,t,n)}):qo(e,t,n)}function qo(e,t,n){t.status=`fulfilled`,t.value=n,Yo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function Jo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Yo(t),t=t.next;while(t!==r)}e.action=null}function Yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xo(e,t){return t}function Zo(e,t){if(G){var n=Rl.formState;if(n!==null){a:{var r=so;if(G){if(Oi){b:{for(var i=Oi,a=Ai;i.nodeType!==8;){if(!a){i=null;break b}if(i=uf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Oi=uf(i.nextSibling),r=i.data===`F!`;break a}}Mi(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:t},n.queue=r,n=ks.bind(null,so,r),r.dispatch=n,r=Ho(!1),a=js.bind(null,so,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Wo.bind(null,so,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Qo(e){return $o(Do(),co,e)}function $o(e,t,n){if(t=Po(e,t,Xo)[0],e=No(Mo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ko(t)}catch(e){throw e===ga?va:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(so.flags|=2048,ns(9,{destroy:void 0},es.bind(null,i,n),null)),[r,a,e]}function es(e,t){e.action=t}function ts(e){var t=Do(),n=co;if(n!==null)return $o(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=so.updateQueue,t===null&&(t=Oo(),so.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function rs(){return Do().memoizedState}function is(e,t,n,r){var i=Eo();so.flags|=e,i.memoizedState=ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function as(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;co!==null&&r!==null&&yo(r,co.memoizedState.deps)?i.memoizedState=ns(t,a,n,r):(so.flags|=e,i.memoizedState=ns(1|t,a,n,r))}function os(e,t){is(8390656,8,e,t)}function ss(e,t){as(2048,8,e,t)}function cs(e){so.flags|=4;var t=so.updateQueue;if(t===null)t=Oo(),so.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ls(e){var t=Do().memoizedState;return cs({ref:t,nextImpl:e}),function(){if(Ll&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function us(e,t){return as(4,2,e,t)}function ds(e,t){return as(4,4,e,t)}function fs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ps(e,t,n){n=n==null?null:n.concat([e]),as(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){Be(!0);try{e()}finally{Be(!1)}}return n.memoizedState=[r,t],r}function _s(e,t,n){return n===void 0||oo&1073741824&&!(Bl&261930)?e.memoizedState=t:(e.memoizedState=n,e=_u(),so.lanes|=e,Jl|=e,n)}function vs(e,t,n,r){return xr(n,t)?n:Ka.current===null?!(oo&42)||oo&1073741824&&!(Bl&261930)?(ec=!0,e.memoizedState=n):(e=_u(),so.lanes|=e,Jl|=e,t):(e=_s(e,n,r),xr(e,t)||(ec=!0),e)}function ys(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};M.T=s,js(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,ua(c,r),gu(e)):As(e,t,r,gu(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},gu())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ss(e).queue;ys(e,a,t,ie,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:ie},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},gu())}function ws(){return Yi(ep)}function Ts(){return Do().memoizedState}function Es(){return Do().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gu();e=La(n);var r=Ra(t,e,n);r!==null&&(vu(r,t,n),za(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=Xr(e,t,n,r),n!==null&&(vu(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,gu())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,xr(s,o))return Yr(e,t,i,0),Rl===null&&Jr(),!1}catch{}if(n=Xr(e,t,i,r),n!==null)return vu(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:md(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=Xr(e,n,r,2),t!==null&&vu(t,e,2)}function Ms(e){var t=e.alternate;return e===so||t!==null&&t===so}function Ns(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}var Fs={readContext:Yi,use:Ao,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Fs.useEffectEvent=vo;var Is={readContext:Yi,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),is(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(po){Be(!0);try{e()}finally{Be(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(po){Be(!0);try{n(t)}finally{Be(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Os.bind(null,so,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=ks.bind(null,so,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=ys.bind(null,so,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=so,a=Eo();if(G){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Rl===null)throw Error(i(349));Bl&127||Lo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,os(zo.bind(null,r,o,e),[e]),r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=Rl.identifierPrefix;if(G){var n=xi,r=bi;n=(r&~(1<<32-Ve(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ws,useFormState:Zo,useActionState:Zo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,so,!0,n),n.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Eo().memoizedState=Ds.bind(null,so)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(Ll&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:No,useRef:rs,useState:function(){return No(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){return vs(Do(),co.memoizedState,e,t)},useTransition:function(){var e=No(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){return Uo(Do(),co,e,t)},useMemoCache:jo,useCacheRefresh:Es};Ls.useEffectEvent=ls;var Rs={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Fo,useRef:rs,useState:function(){return Fo(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){var n=Do();return co===null?_s(n,e,t):vs(n,co.memoizedState,e,t)},useTransition:function(){var e=Fo(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){var n=Do();return co===null?(n.baseState=e,[e,n.queue.dispatch]):Uo(n,co,e,t)},useMemoCache:jo,useCacheRefresh:Es};Rs.useEffectEvent=ls;function zs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gu(),i=La(r);i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(vu(t,e,r),za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gu(),i=La(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(vu(t,e,r),za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gu(),r=La(n);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,n),t!==null&&(vu(t,e,n),za(t,e,n))}};function Vs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Sr(n,r)||!Sr(i,a):!0}function Hs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Bs.enqueueReplaceState(t,t.state,null)}function Us(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ws(e){Wr(e)}function Gs(e){console.error(e)}function Ks(e){Wr(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=La(e),e.tag=3,e}function Zs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Js(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Js(t,n,r),typeof i!=`function`&&(ou===null?ou=new Set([this]):ou.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Qs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ki(t,n,a,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Qa===null?Au():n.alternate===null&&ql===0&&(ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Ju(e,r,a)),!1;case 22:return n.flags|=65536,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Ju(e,r,a)),!1}throw Error(i(435,n.tag))}return Ju(e,r,a),Au(),!1}if(G)return t=Za.current,t===null?(r!==ji&&(t=Error(i(423),{cause:r}),Ri(fi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=fi(r,n),a=Ys(e.stateNode,r,a),Ba(e,a),ql!==4&&(ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ji&&(e=Error(i(422),{cause:r}),Ri(fi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=fi(o,n),$l===null?$l=[o]:$l.push(o),ql!==4&&(ql=2),t===null)return!0;r=fi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ys(n.stateNode,r,e),Ba(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ou===null||!ou.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Xs(a),Zs(a,e,n,r),Ba(n,a),!1}n=n.return}while(n!==null);return!1}var $s=Error(i(461)),ec=!1;function tc(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function nc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ji(t),r=bo(e,t,n,o,a,i),s=K(),e!==null&&!ec?(wo(e,t,i),Tc(e,t,i)):(G&&s&&wi(t),t.flags|=1,tc(e,t,r,i),t.child)}function rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ri(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,q(e,t,a,r,i)):(e=oi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ec(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Sr:n,n(o,r)&&e.ref===t.ref)return Tc(e,t,i)}return t.flags|=1,e=ii(a,r),e.ref=t.ref,e.return=t,t.child=e}function q(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Sr(a,r)&&e.ref===t.ref){if(ec=!1,t.pendingProps=r=a,Ec(e,i))e.flags&131072&&(ec=!0);else return t.lanes=e.lanes,Tc(e,t,i)}}return dc(e,t,n,r,i)}function ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return oc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ma(t,a===null?null:a.cachePool),a===null?Ya():Ja(t,a),to(t);else return r=t.lanes=536870912,oc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ma(t,null),Ya(),no(t)):(ma(t,a.cachePool),Ja(t,a),no(t),t.memoizedState=null);return tc(e,t,i,n),t.child}function ac(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function oc(e,t,n,r,i){var a=pa();return a=a===null?null:{parent:ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ma(t,null),Ya(),to(t),e!==null&&Ki(e,t,r,!0),t.childLanes=i,null}function sc(e,t){return t=bc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cc(e,t,n){return Ma(t,e.child,null,n),e=sc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function lc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(G){if(r.mode===`hidden`)return e=sc(t,r),t.lanes=536870912,ac(null,e);if(eo(t),(e=Oi)?(e=of(e,Ai),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return t.lanes=536870912,null}return sc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(eo(t),a){if(t.flags&256)t.flags&=-257,t=cc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(ec||Ki(e,t,n,!1),a=(n&e.childLanes)!==0,ec||a){if(r=Rl,r!==null&&(s=nt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Zr(e,s),vu(r,e,s),$s;Au(),t=cc(e,t,n)}else e=o.treeContext,Oi=uf(s.nextSibling),Di=t,G=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=sc(t,r),t.flags|=4096;return t}return e=ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function dc(e,t,n,r,i){return Ji(t),n=bo(e,t,n,r,void 0,i),r=K(),e!==null&&!ec?(wo(e,t,i),Tc(e,t,i)):(G&&r&&wi(t),t.flags|=1,tc(e,t,n,i),t.child)}function fc(e,t,n,r,i,a){return Ji(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=K(),e!==null&&!ec?(wo(e,t,a),Tc(e,t,a)):(G&&r&&wi(t),t.flags|=1,tc(e,t,n,a),t.child)}function pc(e,t,n,r,i){if(Ji(t),t.stateNode===null){var a=ei,o=n.contextType;typeof o==`object`&&o&&(a=Yi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Bs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Fa(t),o=n.contextType,a.context=typeof o==`object`&&o?Yi(o):ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(zs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Bs.enqueueReplaceState(a,a.state,null),Ua(t,r,a,i),Ha(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Us(n,s);a.props=c;var l=a.context,u=n.contextType;o=ei,typeof u==`object`&&u&&(o=Yi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Hs(t,a,r,o),Pa=!1;var f=t.memoizedState;a.state=f,Ua(t,r,a,i),Ha(),l=t.memoizedState,s||f!==l||Pa?(typeof d==`function`&&(zs(t,n,d,r),l=t.memoizedState),(c=Pa||Vs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ia(e,t),o=t.memoizedProps,u=Us(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ei,typeof l==`object`&&l&&(c=Yi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Hs(t,a,r,c),Pa=!1,f=t.memoizedState,a.state=f,Ua(t,r,a,i),Ha();var p=t.memoizedState;o!==d||f!==p||Pa||e!==null&&e.dependencies!==null&&qi(e.dependencies)?(typeof s==`function`&&(zs(t,n,s,r),p=t.memoizedState),(u=Pa||Vs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&qi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,uc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ma(t,e.child,null,i),t.child=Ma(t,null,n,i)):tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Tc(e,t,i),e}function mc(e,t,n,r){return Ii(),t.flags|=256,tc(e,t,n,r),t.child}var hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:ha()}}function _c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Zl),e}function vc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(io.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(G){if(a?$a(t):no(t),(e=Oi)?(e=of(e,Ai),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return cf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(no(t),a=t.mode,c=bc({mode:`hidden`,children:c},a),r=si(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(null,r)):($a(t),yc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?($a(t),t.flags&=-257,t=xc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,a=t.mode,r=bc({mode:`visible`,children:r.children},a),c=si(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ma(t,e.child,null,n),r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,t=ac(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),cf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ri({value:r,source:null,stack:null}),t=xc(e,t,n)}else if(ec||Ki(e,t,n,!1),s=(n&e.childLanes)!==0,ec||s){if(s=Rl,s!==null&&(r=nt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Zr(e,r),vu(s,e,r),$s;sf(c)||Au(),t=xc(e,t,n)}else sf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Oi=uf(c.nextSibling),Di=t,G=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=yc(t,r.children),t.flags|=4096);return t}return a?(no(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ii(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=si(c,a,n,null),c.flags|=2):c=ii(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ac(null,r),r=t.child,c=e.child.memoizedState,c===null?c=gc(n):(a=c.cachePool,a===null?a=ha():(l=ta._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(e.child,r)):($a(t),n=e.child,e=n.sibling,n=ii(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function yc(e,t){return t=bc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function bc(e,t){return e=ni(22,e,null,t),e.lanes=0,e}function xc(e,t,n){return Ma(t,e.child,null,n),e=yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,n)}function Cc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function wc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,le(io,o),tc(e,t,r,n),r=G?gi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Sc(e,n,t);else if(e.tag===19)Sc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ao(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ao(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cc(t,!0,n,null,a,r);break;case`together`:Cc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Tc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ki(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ec(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&qi(e)))}function Dc(e,t,n){switch(t.tag){case 3:pe(t,t.stateNode.containerInfo),Hi(t,ta,e.memoizedState.cache),Ii();break;case 27:case 5:he(t);break;case 4:pe(t,t.stateNode.containerInfo);break;case 10:Hi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($a(t),e=Tc(e,t,n),e===null?null:e.sibling):vc(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Ki(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return wc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),le(io,io.current),r)break;return null;case 22:return t.lanes=0,ic(e,t,n,t.pendingProps);case 24:Hi(t,ta,e.memoizedState.cache)}return Tc(e,t,n)}function Oc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)ec=!0;else{if(!Ec(e,n)&&!(t.flags&128))return ec=!1,Dc(e,t,n);ec=!!(e.flags&131072)}}else ec=!1,G&&t.flags&1048576&&Ci(t,gi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Sa(t.elementType),t.type=e,typeof e==`function`)ri(e)?(r=Us(e,r),t.tag=1,t=pc(null,t,e,r,n)):(t.tag=0,t=dc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=nc(null,t,e,r,n);break a}if(a===D){t.tag=14,t=rc(null,t,e,r,n);break a}}throw t=j(e)||e,Error(i(306,t,``))}}return t;case 0:return dc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Us(r,t.pendingProps),pc(e,t,r,a,n);case 3:a:{if(pe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ia(e,t),Ua(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Hi(t,ta,r),r!==o.cache&&Gi(t,[ta],n,!0),Ha(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=mc(e,t,r,n);break a}if(r!==a){a=fi(Error(i(424)),t),Ri(a),t=mc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Oi=uf(e.firstChild),Di=t,G=!0,ki=null,Ai=!0,n=Na(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ii(),r===a){t=Tc(e,t,n);break a}tc(e,t,r,n)}t=t.child}return t;case 26:return uc(e,t),e===null?(n=jf(t.type,null,t.pendingProps,null))?t.memoizedState=n:G||(n=t.type,e=t.pendingProps,r=Hd(P.current).createElement(n),r[ct]=t,r[lt]=e,Id(r,n,e),xt(r),t.stateNode=r):t.memoizedState=jf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return he(t),e===null&&G&&(r=t.stateNode=mf(t.type,t.pendingProps,P.current),Di=t,Ai=!0,a=Oi,$d(t.type)?(df=a,Oi=uf(r.firstChild)):Oi=a),tc(e,t,t.pendingProps.children,n),uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&G&&((a=r=Oi)&&(r=rf(r,t.type,t.pendingProps,Ai),r===null?a=!1:(t.stateNode=r,Di=t,Oi=uf(r.firstChild),Ai=!1,a=!0)),a||Mi(t)),he(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Gd(a,o)?r=null:s!==null&&Gd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=bo(e,t,Co,null,null,n),ep._currentValue=a),uc(e,t),tc(e,t,r,n),t.child;case 6:return e===null&&G&&((e=n=Oi)&&(n=af(n,t.pendingProps,Ai),n===null?e=!1:(t.stateNode=n,Di=t,Oi=null,e=!0)),e||Mi(t)),null;case 13:return vc(e,t,n);case 4:return pe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):tc(e,t,r,n),t.child;case 11:return nc(e,t,t.type,t.pendingProps,n);case 7:return tc(e,t,t.pendingProps,n),t.child;case 8:return tc(e,t,t.pendingProps.children,n),t.child;case 12:return tc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Hi(t,t.type,r.value),tc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ji(t),a=Yi(a),r=r(a),t.flags|=1,tc(e,t,r,n),t.child;case 14:return rc(e,t,t.type,t.pendingProps,n);case 15:return q(e,t,t.type,t.pendingProps,n);case 19:return wc(e,t,n);case 31:return lc(e,t,n);case 22:return ic(e,t,n,t.pendingProps);case 24:return Ji(t),r=Yi(ta),e===null?(a=pa(),a===null&&(a=Rl,o=na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Fa(t),Hi(t,ta,a)):((e.lanes&n)!==0&&(Ia(e,t),Ua(t,null,null,n),Ha()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Hi(t,ta,r),r!==a.cache&&Gi(t,[ta],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Hi(t,ta,r))),tc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function kc(e){e.flags|=4}function Ac(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Du())e.flags|=8192;else throw Ca=ya,_a}}else e.flags&=-16777217}function jc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Kf(t)){if(Du())e.flags|=8192;else throw Ca=ya,_a}}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Xe(),e.lanes|=t,Ql|=t)}function Nc(e,t){if(!G)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Fc(e,t,n){var r=t.pendingProps;switch(Ti(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pc(t),null;case 1:return Pc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ui(ta),me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?kc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li())),Pc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(kc(t),o===null?(Pc(t),Ac(t,a,null,r,n)):(Pc(t),jc(t,o))):o?o===e.memoizedState?(Pc(t),t.flags&=-16777217):(kc(t),Pc(t),jc(t,o)):(e=e.memoizedProps,e!==r&&kc(t),Pc(t),Ac(t,a,e,r,n)),null;case 27:if(ge(t),n=P.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}e=ue.current,Fi(t)?Ni(t,e):(e=mf(a,r,n),t.stateNode=e,kc(t))}return Pc(t),null;case 5:if(ge(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}if(o=ue.current,Fi(t))Ni(t,o);else{var s=Hd(P.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ct]=t,o[lt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Id(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&kc(t)}}return Pc(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=P.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Di,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Nd(e.nodeValue,n)),e||Mi(t,!0)}else e=Hd(e).createTextNode(r),e[ct]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Fi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ct]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ro(t),t):(ro(t),null);if(t.flags&128)throw Error(i(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Fi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ct]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),a=!1}else a=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ro(t),t):(ro(t),null)}return ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Mc(t,t.updateQueue),Pc(t),null);case 4:return me(),e===null&&Cd(t.stateNode.containerInfo),Pc(t),null;case 10:return Ui(t.type),Pc(t),null;case 19:if(ce(io),r=t.memoizedState,r===null)return Pc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Nc(r,!1);else{if(ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Nc(r,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ai(n,e),n=n.sibling;return le(io,io.current&1|2),G&&Si(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ke()>iu&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=ao(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!G)return Pc(t),null}else 2*ke()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ke(),e.sibling=null,n=io.current,le(io,a?n&1|2:n&1),G&&Si(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Mc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ce(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ta),Pc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ic(e,t){switch(Ti(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ge(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ce(io),null;case 4:return me(),null;case 10:return Ui(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&ce(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(ta),null;case 25:return null;default:return null}}function Lc(e,t){switch(Ti(t),t.tag){case 3:Ui(ta),me();break;case 26:case 27:case 5:ge(t);break;case 4:me();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:ce(io);break;case 10:Ui(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&ce(fa);break;case 24:Ui(ta)}}function Rc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){J(t,t.return,e)}}function zc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){J(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){J(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){J(e,e.return,t)}}}function Vc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){J(e,t,n)}}function Hc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){J(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){J(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){J(e,t,n)}else n.current=null}}function Wc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){J(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;Ld(r,e.type,n,t),r[lt]=t}catch(t){J(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&$d(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(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&&$d(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=en));else if(r!==4&&(r===27&&$d(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&$d(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Id(t,r,n),t[ct]=e,t[lt]=n}catch(t){J(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,el=typeof WeakSet==`function`?WeakSet:Set,tl=null;function nl(e,t){if(e=e.containerInfo,Bd=cp,e=V(e),Tr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Vd={focusedElem:e,selectionRange:n},cp=!1,tl=t;tl!==null;)if(t=tl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,tl=e;else for(;tl!==null;){switch(t=tl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Us(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){J(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)nf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:nf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,tl=e;break}tl=t.return}}function rl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&Rc(5,n);break;case 1:if(vl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){J(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){J(n,n.return,e)}}}r&64&&Bc(n),r&512&&Hc(n,n.return);break;case 3:if(vl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ga(e,t)}catch(e){J(n,n.return,e)}}break;case 27:t===null&&r&4&&Xc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Wc(n),r&512&&Hc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ll(e,n);break;case 13:vl(e,n),r&4&&ul(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Zu.bind(null,n),lf(e,n))));break;case 22:if(r=n.memoizedState!==null||Zc,!r){t=t!==null&&t.memoizedState!==null||Qc,i=Zc;var a=Qc;Zc=r,(Qc=t)&&!a?bl(e,n,!!(n.subtreeFlags&8772)):vl(e,n),Zc=i,Qc=a}break;case 30:break;default:vl(e,n)}}function il(e){var t=e.alternate;t!==null&&(e.alternate=null,il(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&gt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var al=null,ol=!1;function sl(e,t,n){for(n=n.child;n!==null;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(ze&&typeof ze.onCommitFiberUnmount==`function`)try{ze.onCommitFiberUnmount(Re,n)}catch{}switch(n.tag){case 26:Qc||Uc(n,t),sl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Qc||Uc(n,t);var r=al,i=ol;$d(n.type)&&(al=n.stateNode,ol=!1),sl(e,t,n),hf(n.stateNode),al=r,ol=i;break;case 5:Qc||Uc(n,t);case 6:if(r=al,i=ol,al=null,sl(e,t,n),al=r,ol=i,al!==null){if(ol)try{(al.nodeType===9?al.body:al.nodeName===`HTML`?al.ownerDocument.body:al).removeChild(n.stateNode)}catch(e){J(n,t,e)}else try{al.removeChild(n.stateNode)}catch(e){J(n,t,e)}}break;case 18:al!==null&&(ol?(e=al,ef(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Pp(e)):ef(al,n.stateNode));break;case 4:r=al,i=ol,al=n.stateNode.containerInfo,ol=!0,sl(e,t,n),al=r,ol=i;break;case 0:case 11:case 14:case 15:zc(2,n,t),Qc||zc(4,n,t),sl(e,t,n);break;case 1:Qc||(Uc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Vc(n,t,r)),sl(e,t,n);break;case 21:sl(e,t,n);break;case 22:Qc=(r=Qc)||n.memoizedState!==null,sl(e,t,n),Qc=r;break;default:sl(e,t,n)}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Pp(e)}catch(e){J(t,t.return,e)}}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Pp(e)}catch(e){J(t,t.return,e)}}function dl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new el),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new el),t;default:throw Error(i(435,e.tag))}}function fl(e,t){var n=dl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Qu.bind(null,e,t);t.then(r,r)}})}function pl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if($d(c.type)){al=c.stateNode,ol=!1;break a}break;case 5:al=c.stateNode,ol=!1;break a;case 3:case 4:al=c.stateNode.containerInfo,ol=!0;break a}c=c.return}if(al===null)throw Error(i(160));cl(o,s,a),al=null,ol=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hl(t,e),t=t.sibling}var ml=null;function hl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pl(t,e),gl(e),r&4&&(zc(3,e,e.return),Rc(3,e),zc(5,e,e.return));break;case 1:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&64&&Zc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=ml;if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ht]||o[ct]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Id(o,r,n),o[ct]=e,xt(o),r=o;break a;case`link`:var s=Uf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Id(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Uf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Id(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ct]=e,xt(o),r=o}e.stateNode=r}else Wf(a,e.type,e.stateNode)}else e.stateNode=Rf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Gc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Wf(a,e.type,e.stateNode):Rf(a,r,e.memoizedProps))}break;case 27:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),n!==null&&r&4&&Gc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),e.flags&32){a=e.stateNode;try{qt(a,``)}catch(t){J(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Gc(e,a,n===null?a:n.memoizedProps)),r&1024&&($c=!0);break;case 6:if(pl(t,e),gl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){J(e,e.return,t)}}break;case 3:if(Hf=null,a=ml,ml=vf(t.containerInfo),pl(t,e),ml=a,gl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Pp(t.containerInfo)}catch(t){J(e,e.return,t)}$c&&($c=!1,_l(e));break;case 4:r=ml,ml=vf(e.stateNode.containerInfo),pl(t,e),gl(e),ml=r;break;case 12:pl(t,e),gl(e);break;case 31:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 13:pl(t,e),gl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nu=ke()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Zc,d=Qc;if(Zc=u||a,Qc=d||l,pl(t,e),Qc=d,Zc=u,gl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Zc||Qc||yl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){J(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){J(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?tf(m,!0):tf(l.stateNode,!1)}catch(e){J(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,fl(e,n))));break;case 19:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 30:break;case 21:break;default:pl(t,e),gl(e)}}function gl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Yc(e,qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(qt(o,``),n.flags&=-33),Yc(e,qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Jc(e,qc(e),s);break;default:throw Error(i(161))}}catch(t){J(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rl(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zc(4,t,t.return),yl(t);break;case 1:Uc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Vc(t,t.return,n),yl(t);break;case 27:hf(t.stateNode);case 26:case 5:Uc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:bl(i,a,n),Rc(4,a);break;case 1:if(bl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){J(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Wa(c[i],s)}catch(e){J(r,r.return,e)}}n&&o&64&&Bc(a),Hc(a,a.return);break;case 27:Xc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Wc(a),Hc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ll(i,a);break;case 13:bl(i,a,n),n&&o&4&&ul(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Hc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ra(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&Rc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e)));break;case 12:if(i&2048){Cl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){J(t,t.return,e)}}else Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Cl(e,t,n,r):El(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Tl(a,o,s,c,i),Rc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):El(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function El(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:El(n,r),i&2048&&xl(r.alternate,r);break;case 24:El(n,r),i&2048&&Sl(r.alternate,r);break;default:El(n,r)}t=t.sibling}}var Dl=8192;function Ol(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)kl(e,t,n),e=e.sibling}function kl(e,t,n){switch(e.tag){case 26:Ol(e,t,n),e.flags&Dl&&e.memoizedState!==null&&qf(n,ml,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,n);break;case 3:case 4:var r=ml;ml=vf(e.stateNode.containerInfo),Ol(e,t,n),ml=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Dl,Dl=16777216,Ol(e,t,n),Dl=r):Ol(e,t,n));break;default:Ol(e,t,n)}}function Al(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ml(e),e=e.sibling}function Ml(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&zc(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nl(e)):jl(e);break;default:jl(e)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zc(8,t,t.return),Nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nl(t));break;default:Nl(t)}e=e.sibling}}function Pl(e,t){for(;tl!==null;){var n=tl;switch(n.tag){case 0:case 11:case 15:zc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,tl=r;else a:for(n=e;tl!==null;){r=tl;var i=r.sibling,a=r.return;if(il(r),r===n){tl=null;break a}if(i!==null){i.return=a,tl=i;break a}tl=a}}}var Fl={getCacheForType:function(e){var t=Yi(ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Yi(ta).controller.signal}},Il=typeof WeakMap==`function`?WeakMap:Map,Ll=0,Rl=null,zl=null,Bl=0,Vl=0,Hl=null,Ul=!1,Wl=!1,Gl=!1,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=null,eu=null,tu=!1,nu=0,ru=0,iu=1/0,au=null,ou=null,su=0,cu=null,lu=null,uu=0,du=0,fu=null,pu=null,mu=0,hu=null;function gu(){return Ll&2&&Bl!==0?Bl&-Bl:M.T===null?at():md()}function _u(){if(Zl===0){if(!(Bl&536870912)||G){var e=Ke;Ke<<=1,!(Ke&3932160)&&(Ke=262144),Zl=e}else Zl=536870912}return e=Za.current,e!==null&&(e.flags|=32),Zl}function vu(e,t,n){(e===Rl&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)&&(Tu(e,0),Su(e,Bl,Zl,!1)),Qe(e,n),(!(Ll&2)||e!==Rl)&&(e===Rl&&(!(Ll&2)&&(Yl|=n),ql===4&&Su(e,Bl,Zl,!1)),od(e))}function yu(e,t,n){if(Ll&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Je(e,t),a=r?Nu(e,t):ju(e,t,!0),o=r;do{if(a===0){Wl&&!r&&Su(e,t,0,!1);break}if(n=e.current.alternate,o&&!xu(n)){a=ju(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=$l;var l=c.current.memoizedState.isDehydrated;if(l&&(Tu(c,s).flags|=256),s=ju(c,s,!1),s!==2){if(Gl&&!l){c.errorRecoveryDisabledLanes|=o,Yl|=o,a=4;break a}o=eu,eu=a,o!==null&&(eu===null?eu=o:eu.push.apply(eu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Tu(e,0),Su(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Su(r,t,Zl,!Ul);break a;case 2:eu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=nu+300-ke(),10<a)){if(Su(r,t,Zl,!Ul),qe(r,0,!0)!==0)break a;uu=t,r.timeoutHandle=Jd(bu.bind(null,r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,`Throttled`,-0,0),a);break a}bu(r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,null,-0,0)}break}while(1);od(e)}function bu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:en},kl(t,a,d);var m=(a&62914560)===a?nu-ke():(a&4194048)===a?ru-ke():0;if(m=Yf(d,m),m!==null){uu=a,e.cancelPendingCommit=m(Bu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Su(e,a,o,!l);return}}Bu(e,t,a,n,r,i,o,s,c)}function xu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!xr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Su(e,t,n,r){t&=~Xl,t&=~Yl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ve(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&et(e,n,t)}function Cu(){return Ll&6?!0:(sd(0,!1),!1)}function wu(){if(zl!==null){if(Vl===0)var e=zl.return;else e=zl,Vi=Bi=null,To(e),Ea=null,Da=0,e=zl;for(;e!==null;)Lc(e.alternate,e),e=e.return;zl=null}}function Tu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Yd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),uu=0,wu(),Rl=e,zl=n=ii(e.current,null),Bl=t,Vl=0,Hl=null,Ul=!1,Wl=Je(e,t),Gl=!1,Ql=Zl=Xl=Yl=Jl=ql=0,eu=$l=null,tu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ve(r),a=1<<i;t|=e[i],r&=~a}return Kl=t,Jr(),n}function Eu(e,t){so=null,M.H=Fs,t===ga||t===va?(t=wa(),Vl=3):t===_a?(t=wa(),Vl=4):Vl=t===$s?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Hl=t,zl===null&&(ql=1,qs(e,fi(t,e.current)))}function Du(){var e=Za.current;return e===null?!0:(Bl&4194048)===Bl?Qa===null:(Bl&62914560)===Bl||Bl&536870912?e===Qa:!1}function Ou(){var e=M.H;return M.H=Fs,e===null?Fs:e}function ku(){var e=M.A;return M.A=Fl,e}function Au(){ql=4,Ul||(Bl&4194048)!==Bl&&Za.current!==null||(Wl=!0),!(Jl&134217727)&&!(Yl&134217727)||Rl===null||Su(Rl,Bl,Zl,!1)}function ju(e,t,n){var r=Ll;Ll|=2;var i=Ou(),a=ku();(Rl!==e||Bl!==t)&&(au=null,Tu(e,t)),t=!1;var o=ql;a:do try{if(Vl!==0&&zl!==null){var s=zl,c=Hl;switch(Vl){case 8:wu(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=Vl;if(Vl=0,Hl=null,Lu(e,s,c,l),n&&Wl){o=0;break a}break;default:l=Vl,Vl=0,Hl=null,Lu(e,s,c,l)}}Mu(),o=ql;break}catch(t){Eu(e,t)}while(1);return t&&e.shellSuspendCounter++,Vi=Bi=null,Ll=r,M.H=i,M.A=a,zl===null&&(Rl=null,Bl=0,Jr()),o}function Mu(){for(;zl!==null;)Fu(zl)}function Nu(e,t){var n=Ll;Ll|=2;var r=Ou(),a=ku();Rl!==e||Bl!==t?(au=null,iu=ke()+500,Tu(e,t)):Wl=Je(e,t);a:do try{if(Vl!==0&&zl!==null){t=zl;var o=Hl;b:switch(Vl){case 1:Vl=0,Hl=null,Lu(e,t,o,1);break;case 2:case 9:if(ba(o)){Vl=0,Hl=null,Iu(t);break}t=function(){Vl!==2&&Vl!==9||Rl!==e||(Vl=7),od(e)},o.then(t,t);break a;case 3:Vl=7;break a;case 4:Vl=5;break a;case 7:ba(o)?(Vl=0,Hl=null,Iu(t)):(Vl=0,Hl=null,Lu(e,t,o,7));break;case 5:var s=null;switch(zl.tag){case 26:s=zl.memoizedState;case 5:case 27:var c=zl;if(s?Kf(s):c.stateNode.complete){Vl=0,Hl=null;var l=c.sibling;if(l!==null)zl=l;else{var u=c.return;u===null?zl=null:(zl=u,Ru(u))}break b}}Vl=0,Hl=null,Lu(e,t,o,5);break;case 6:Vl=0,Hl=null,Lu(e,t,o,6);break;case 8:wu(),ql=6;break a;default:throw Error(i(462))}}Pu();break}catch(t){Eu(e,t)}while(1);return Vi=Bi=null,M.H=r,M.A=a,Ll=n,zl===null?(Rl=null,Bl=0,Jr(),ql):0}function Pu(){for(;zl!==null&&!De();)Fu(zl)}function Fu(e){var t=Oc(e.alternate,e,Kl);e.memoizedProps=e.pendingProps,t===null?Ru(e):zl=t}function Iu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fc(n,t,t.pendingProps,t.type,void 0,Bl);break;case 11:t=fc(n,t,t.pendingProps,t.type.render,t.ref,Bl);break;case 5:To(t);default:Lc(n,t),t=zl=ai(t,Kl),t=Oc(n,t,Kl)}e.memoizedProps=e.pendingProps,t===null?Ru(e):zl=t}function Lu(e,t,n,r){Vi=Bi=null,To(t),Ea=null,Da=0;var i=t.return;try{if(Qs(e,i,t,n,Bl)){ql=1,qs(e,fi(n,e.current)),zl=null;return}}catch(t){if(i!==null)throw zl=i,t;ql=1,qs(e,fi(n,e.current)),zl=null;return}t.flags&32768?(G||r===1?e=!0:Wl||Bl&536870912?e=!1:(Ul=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),zu(t,e)):Ru(t)}function Ru(e){var t=e;do{if(t.flags&32768){zu(t,Ul);return}e=t.return;var n=Fc(t.alternate,t,Kl);if(n!==null){zl=n;return}if(t=t.sibling,t!==null){zl=t;return}zl=t=e}while(t!==null);ql===0&&(ql=5)}function zu(e,t){do{var n=Ic(e.alternate,e);if(n!==null){n.flags&=32767,zl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){zl=e;return}zl=e=n}while(e!==null);ql=6,zl=null}function Bu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Gu();while(su!==0);if(Ll&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=qr,$e(e,n,o,s,c,l),e===Rl&&(zl=Rl=null,Bl=0),lu=t,cu=e,uu=n,du=o,fu=a,pu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,$u(Ne,function(){return Ku(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=M.T,M.T=null,a=N.p,N.p=2,s=Ll,Ll|=4;try{nl(e,t,n)}finally{Ll=s,N.p=a,M.T=r}}su=1,Vu(),Hu(),Uu()}}function Vu(){if(su===1){su=0;var e=cu,t=lu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=Ll;Ll|=4;try{hl(t,e);var a=Vd,o=V(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&B(s.ownerDocument.documentElement,s)){if(c!==null&&Tr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=wr(s,h),v=wr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}cp=!!Bd,Vd=Bd=null}finally{Ll=i,N.p=r,M.T=n}}e.current=t,su=2}}function Hu(){if(su===2){su=0;var e=cu,t=lu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=Ll;Ll|=4;try{rl(e,t.alternate,t)}finally{Ll=i,N.p=r,M.T=n}}su=3}}function Uu(){if(su===4||su===3){su=0,Oe();var e=cu,t=lu,n=uu,r=pu;t.subtreeFlags&10256||t.flags&10256?su=5:(su=0,lu=cu=null,Wu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ou=null),it(n),t=t.stateNode,ze&&typeof ze.onCommitFiberRoot==`function`)try{ze.onCommitFiberRoot(Re,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=M.T,i=N.p,N.p=2,M.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{M.T=t,N.p=i}}uu&3&&Gu(),od(e),i=e.pendingLanes,n&261930&&i&42?e===hu?mu++:(mu=0,hu=e):mu=0,sd(0,!1)}}function Wu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Gu(){return Vu(),Hu(),Uu(),Ku()}function Ku(){if(su!==5)return!1;var e=cu,t=du;du=0;var n=it(uu),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=fu,fu=null;var o=cu,s=uu;if(su=0,lu=cu=null,uu=0,Ll&6)throw Error(i(331));var c=Ll;if(Ll|=4,Ml(o.current),wl(o,o.current,s,n),Ll=c,sd(0,!1),ze&&typeof ze.onPostCommitFiberRoot==`function`)try{ze.onPostCommitFiberRoot(Re,o)}catch{}return!0}finally{N.p=a,M.T=r,Wu(e,t)}}function qu(e,t,n){t=fi(n,t),t=Ys(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(Qe(e,2),od(e))}function J(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ou===null||!ou.has(r))){e=fi(n,e),n=Xs(2),r=Ra(t,n,2),r!==null&&(Zs(n,r,t,e),Qe(r,2),od(r));break}}t=t.return}}function Ju(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Il;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Gl=!0,i.add(n),e=Yu.bind(null,e,t,n),t.then(e,e))}function Yu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Rl===e&&(Bl&n)===n&&(ql===4||ql===3&&(Bl&62914560)===Bl&&300>ke()-nu?!(Ll&2)&&Tu(e,0):Xl|=n,Ql===Bl&&(Ql=0)),od(e)}function Xu(e,t){t===0&&(t=Xe()),e=Zr(e,t),e!==null&&(Qe(e,t),od(e))}function Zu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xu(e,n)}function Qu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Xu(e,n)}function $u(e,t){return Te(e,t)}var ed=null,td=null,nd=!1,rd=!1,id=!1,ad=0;function od(e){e!==td&&e.next===null&&(td===null?ed=td=e:td=td.next=e),rd=!0,nd||(nd=!0,pd())}function sd(e,t){if(!id&&rd){id=!0;do for(var n=!1,r=ed;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ve(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,fd(r,a))}else a=Bl,a=qe(r,r===Rl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,fd(r,a))}r=r.next}while(n);id=!1}}function cd(){ld()}function ld(){rd=nd=!1;var e=0;ad!==0&&qd()&&(e=ad);for(var t=ke(),n=null,r=ed;r!==null;){var i=r.next,a=ud(r,t);a===0?(r.next=null,n===null?ed=i:n.next=i,i===null&&(td=n)):(n=r,(e!==0||a&3)&&(rd=!0)),r=i}su!==0&&su!==5||sd(e,!1),ad!==0&&(ad=0)}function ud(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ve(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ye(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Rl,n=Bl,n=qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ee(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Je(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ee(r),it(n)){case 2:case 8:n=Me;break;case 32:n=Ne;break;case 268435456:n=Fe;break;default:n=Ne}return r=dd.bind(null,e),n=Te(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ee(r),e.callbackPriority=2,e.callbackNode=null,2}function dd(e,t){if(su!==0&&su!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gu()&&e.callbackNode!==n)return null;var r=Bl;return r=qe(e,e===Rl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(yu(e,r,t),ud(e,ke()),e.callbackNode!=null&&e.callbackNode===n?dd.bind(null,e):null)}function fd(e,t){if(Gu())return null;yu(e,t,!0)}function pd(){Zd(function(){Ll&6?Te(je,cd):ld()})}function md(){if(ad===0){var e=oa;e===0&&(e=Ge,Ge<<=1,!(Ge&261888)&&(Ge=256)),ad=e}return ad}function hd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:$t(``+e)}function gd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function _d(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=hd((i[lt]||null).action),o=r.submitter;o&&(t=(t=o[lt]||null)?hd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Sn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ad!==0){var e=o?gd(i,o):new FormData(i);xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?gd(i,o):new FormData(i),xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var vd=0;vd<Hr.length;vd++){var Y=Hr[vd];Ur(Y.toLowerCase(),`on`+(Y[0].toUpperCase()+Y.slice(1)))}Ur(Fr,`onAnimationEnd`),Ur(Ir,`onAnimationIteration`),Ur(Lr,`onAnimationStart`),Ur(`dblclick`,`onDoubleClick`),Ur(`focusin`,`onFocus`),Ur(`focusout`,`onBlur`),Ur(Rr,`onTransitionRun`),Ur(zr,`onTransitionStart`),Ur(W,`onTransitionCancel`),Ur(Br,`onTransitionEnd`),Tt(`onMouseEnter`,[`mouseout`,`mouseover`]),Tt(`onMouseLeave`,[`mouseout`,`mouseover`]),Tt(`onPointerEnter`,[`pointerout`,`pointerover`]),Tt(`onPointerLeave`,[`pointerout`,`pointerover`]),wt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),wt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),wt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),wt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var yd=`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(` `),bd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(yd));function X(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Wr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Wr(e)}i.currentTarget=null,a=c}}}}function Z(e,t){var n=t[dt];n===void 0&&(n=t[dt]=new Set);var r=e+`__bubble`;n.has(r)||(wd(t,e,2,!1),n.add(r))}function xd(e,t,n){var r=0;t&&(r|=4),wd(n,e,r,t)}var Sd=`_reactListening`+Math.random().toString(36).slice(2);function Cd(e){if(!e[Sd]){e[Sd]=!0,St.forEach(function(t){t!==`selectionchange`&&(bd.has(t)||xd(t,!1,e),xd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sd]||(t[Sd]=!0,xd(`selectionchange`,!1,t))}}function wd(e,t,n,r){switch(hp(t)){case 2:var i=lp;break;case 8:i=up;break;default:i=dp}n=i.bind(null,t,n,e),i=void 0,!dn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Td(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=_t(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}cn(function(){var r=a,i=nn(n),s=[];a:{var c=Vr.get(e);if(c!==void 0){var l=Sn,u=e;switch(e){case`keypress`:if(_n(n)===0)break a;case`keydown`:case`keyup`:l=Bn;break;case`focusin`:u=`focus`,l=jn;break;case`focusout`:u=`blur`,l=jn;break;case`beforeblur`:case`afterblur`:l=jn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=An;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Hn;break;case Fr:case Ir:case Lr:l=Mn;break;case Br:l=Un;break;case`scroll`:case`scrollend`:l=wn;break;case`wheel`:l=Wn;break;case`copy`:case`cut`:case`paste`:l=Nn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Vn;break;case`toggle`:case`beforetoggle`:l=Gn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=ln(m,p),g!=null&&d.push(Ed(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==tn&&(u=n.relatedTarget||n.fromElement)&&(_t(u)||u[ut]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?_t(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Vn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:yt(l),h=u==null?c:yt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,_t(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Od,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&kd(s,c,l,d,!1),u!==null&&f!==null&&kd(s,f,u,d,!0)}}a:{if(c=r?yt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=dr;else if(ar(c)){if(fr)v=br;else{v=R;var y=vr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Xt(r.elementType)&&(v=dr):v=yr;if(v&&=v(e,r)){or(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ut(c,`number`,c.value)}switch(y=r?yt(r):window,e){case`focusin`:(ar(y)||y.contentEditable===`true`)&&(Er=y,Dr=r,Or=null);break;case`focusout`:Or=Dr=Er=null;break;case`mousedown`:kr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:kr=!1,Ar(s,n,i);break;case`selectionchange`:if(H)break;case`keydown`:case`keyup`:Ar(s,n,i)}var b;if(qn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else tr?$n(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Xn&&n.locale!==`ko`&&(tr||x!==`onCompositionStart`?x===`onCompositionEnd`&&tr&&(b=gn()):(pn=i,mn=`value`in pn?pn.value:pn.textContent,tr=!0)),y=Dd(r,x),0<y.length&&(x=new Pn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=er(n),b!==null&&(x.data=b)))),(b=Yn?nr(e,n):rr(e,n))&&(x=Dd(r,`onBeforeInput`),0<x.length&&(y=new Pn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),_d(s,e,r,n,i)}X(s,t)})}function Ed(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Dd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=ln(e,n),i!=null&&r.unshift(Ed(e,i,a)),i=ln(e,t),i!=null&&r.push(Ed(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Od(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function kd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=ln(n,a),l!=null&&o.unshift(Ed(n,l,c))):i||(l=ln(n,a),l!=null&&o.push(Ed(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Ad=/\r\n?/g,jd=/\u0000|\uFFFD/g;function Md(e){return(typeof e==`string`?e:``+e).replace(Ad,`
9
+ `).replace(jd,``)}function Nd(e,t){return t=Md(t),Md(e)===t}function Pd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&qt(e,``+r);break;case`className`:jt(e,`class`,r);break;case`tabIndex`:jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:jt(e,n,r);break;case`style`:L(e,r,o);break;case`data`:if(t!==`object`){jt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Pd(e,t,`name`,a.name,a,null),Pd(e,t,`formEncType`,a.formEncType,a,null),Pd(e,t,`formMethod`,a.formMethod,a,null),Pd(e,t,`formTarget`,a.formTarget,a,null)):(Pd(e,t,`encType`,a.encType,a,null),Pd(e,t,`method`,a.method,a,null),Pd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=en);break;case`onScroll`:r!=null&&Z(`scroll`,e);break;case`onScrollEnd`:r!=null&&Z(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=$t(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Z(`beforetoggle`,e),Z(`toggle`,e),At(e,`popover`,r);break;case`xlinkActuate`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:At(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Zt.get(n)||n,At(e,n,r))}}function Fd(e,t,n,r,a,o){switch(n){case`style`:L(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&qt(e,``+r);break;case`onScroll`:r!=null&&Z(`scroll`,e);break;case`onScrollEnd`:r!=null&&Z(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=en);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ct.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[lt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):At(e,n,r)}}}function Id(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Z(`error`,e),Z(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Pd(e,t,o,s,n,null)}}a&&Pd(e,t,`srcSet`,n.srcSet,n,null),r&&Pd(e,t,`src`,n.src,n,null);return;case`input`:Z(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Pd(e,t,r,d,n,null)}}Ht(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Z(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Pd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Wt(e,!!r,n,!0):Wt(e,!!r,t,!1);return;case`textarea`:for(s in Z(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Pd(e,t,s,c,n,null)}Kt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Pd(e,t,l,r,n,null)}return;case`dialog`:Z(`beforetoggle`,e),Z(`toggle`,e),Z(`cancel`,e),Z(`close`,e);break;case`iframe`:case`object`:Z(`load`,e);break;case`video`:case`audio`:for(r=0;r<yd.length;r++)Z(yd[r],e);break;case`image`:Z(`error`,e),Z(`load`,e);break;case`details`:Z(`toggle`,e);break;case`embed`:case`source`:case`link`:Z(`error`,e),Z(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Pd(e,t,u,r,n,null)}return;default:if(Xt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Fd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Pd(e,t,c,r,n,null))}function Ld(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Pd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Pd(e,t,p,m,r,f)}}Vt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Pd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Pd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Wt(e,!!n,n?[]:``,!1):Wt(e,!!n,t,!0)):Wt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Pd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Pd(e,t,s,a,r,o)}Gt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Pd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Pd(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Pd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Pd(e,t,u,p,r,m)}return;default:if(Xt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Fd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Fd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Pd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Pd(e,t,f,p,r,m)}function Rd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function zd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Rd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Rd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Bd=null,Vd=null;function Hd(e){return e.nodeType===9?e:e.ownerDocument}function Ud(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 Wd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Gd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Kd=null;function qd(){var e=window.event;return e&&e.type===`popstate`?e!==Kd&&(Kd=e,!0):(Kd=null,!1)}var Jd=typeof setTimeout==`function`?setTimeout:void 0,Yd=typeof clearTimeout==`function`?clearTimeout:void 0,Xd=typeof Promise==`function`?Promise:void 0,Zd=typeof queueMicrotask==`function`?queueMicrotask:Xd===void 0?Jd:function(e){return Xd.resolve(null).then(e).catch(Qd)};function Qd(e){setTimeout(function(){throw e})}function $d(e){return e===`head`}function ef(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Pp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)hf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,hf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ht]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&hf(e.ownerDocument.body)}n=i}while(n);Pp(t)}function tf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function nf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nf(n),gt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[ht])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=uf(e.nextSibling),e===null)break}return null}function af(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=uf(e.nextSibling),e===null))return null;return e}function of(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=uf(e.nextSibling),e===null))return null;return e}function sf(e){return e.data===`$?`||e.data===`$~`}function cf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function uf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var df=null;function ff(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return uf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function mf(e,t,n){switch(t=Hd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function hf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);gt(e)}var gf=new Map,_f=new Set;function vf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var yf=N.d;N.d={f:bf,r:xf,D:wf,C:Tf,L:Ef,m:Df,X:kf,S:Of,M:Af};function bf(){var e=yf.f(),t=Cu();return e||t}function xf(e){var t=vt(e);t!==null&&t.tag===5&&t.type===`form`?Cs(t):yf.r(e)}var Sf=typeof document>`u`?null:document;function Cf(e,t,n){var r=Sf;if(r&&typeof t==`string`&&t){var i=Bt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),_f.has(i)||(_f.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Id(t,`link`,e),xt(t),r.head.appendChild(t)))}}function wf(e){yf.D(e),Cf(`dns-prefetch`,e,null)}function Tf(e,t){yf.C(e,t),Cf(`preconnect`,e,t)}function Ef(e,t,n){yf.L(e,t,n);var r=Sf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Bt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Bt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Bt(n.imageSizes)+`"]`)):i+=`[href="`+Bt(e)+`"]`;var a=i;switch(t){case`style`:a=Mf(e);break;case`script`:a=If(e)}gf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),gf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Nf(a))||t===`script`&&r.querySelector(Lf(a))||(t=r.createElement(`link`),Id(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Df(e,t){yf.m(e,t);var n=Sf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Bt(r)+`"][href="`+Bt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=If(e)}if(!gf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),gf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Lf(a)))return}r=n.createElement(`link`),Id(r,`link`,e),xt(r),n.head.appendChild(r)}}}function Of(e,t,n){yf.S(e,t,n);var r=Sf;if(r&&e){var i=bt(r).hoistableStyles,a=Mf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Nf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=gf.get(a))&&Bf(e,n);var c=o=r.createElement(`link`);xt(c),Id(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function kf(e,t){yf.X(e,t);var n=Sf;if(n&&e){var r=bt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=m({src:e,async:!0},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),xt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t){yf.M(e,t);var n=Sf;if(n&&e){var r=bt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=gf.get(i))&&Vf(e,t),a=n.createElement(`script`),xt(a),Id(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t,n,r){var a=(a=P.current)?vf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Mf(n.href),n=bt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Mf(n.href);var o=bt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Nf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),gf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},gf.set(e,n),o||Ff(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=If(n),n=bt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Mf(e){return`href="`+Bt(e)+`"`}function Nf(e){return`link[rel="stylesheet"][`+e+`]`}function Pf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Ff(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Id(t,`link`,n),xt(t),e.head.appendChild(t))}function If(e){return`[src="`+Bt(e)+`"]`}function Lf(e){return`script[async]`+e}function Rf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Bt(n.href)+`"]`);if(r)return t.instance=r,xt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),xt(r),Id(r,`style`,a),zf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Mf(n.href);var o=e.querySelector(Nf(a));if(o)return t.state.loading|=4,t.instance=o,xt(o),o;r=Pf(n),(a=gf.get(a))&&Bf(r,a),o=(e.ownerDocument||e).createElement(`link`),xt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Id(o,`link`,r),t.state.loading|=4,zf(o,n.precedence,e),t.instance=o;case`script`:return o=If(n.src),(a=e.querySelector(Lf(o)))?(t.instance=a,xt(a),a):(r=n,(a=gf.get(o))&&(r=m({},n),Vf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),xt(a),Id(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,zf(r,n.precedence,e));return t.instance}function zf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Hf=null;function Uf(e,t,n){if(Hf===null){var r=new Map,i=Hf=new Map;i.set(n,r)}else i=Hf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ht]||a[ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Wf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Gf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Kf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function qf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Mf(r.href),a=t.querySelector(Nf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,xt(a);return}a=t.ownerDocument||t,r=Pf(r),(i=gf.get(i))&&Bf(r,i),a=a.createElement(`link`),xt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Id(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Xf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ep={$$typeof:C,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function tp(e,t,n,r,i,a,o,s,c){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=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ni(3,null,null,t),e.current=a,a.stateNode=e,t=na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Fa(a),e}function rp(e){return e?(e=ei,e):ei}function Q(e,t,n,r,i,a){i=rp(i),r.context===null?r.context=i:r.pendingContext=i,r=La(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ra(e,r,t),n!==null&&(vu(n,e,t),za(n,e,t))}function ip(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ap(e,t){ip(e,t),(e=e.alternate)&&ip(e,t)}function op(e){if(e.tag===13||e.tag===31){var t=Zr(e,67108864);t!==null&&vu(t,e,67108864),ap(e,67108864)}}function sp(e){if(e.tag===13||e.tag===31){var t=gu();t=rt(t);var n=Zr(e,t);n!==null&&vu(n,e,t),ap(e,t)}}var cp=!0;function lp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,dp(e,t,n,r)}finally{N.p=a,M.T=i}}function up(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,dp(e,t,n,r)}finally{N.p=a,M.T=i}}function dp(e,t,n,r){if(cp){var i=fp(r);if(i===null)Td(e,t,r,pp,n),wp(e,r);else if(Ep(i,e,t,n,r))r.stopPropagation();else if(wp(e,r),t&4&&-1<Cp.indexOf(e)){for(;i!==null;){var a=vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=I(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ve(o);s.entanglements[1]|=c,o&=~c}od(a),!(Ll&6)&&(iu=ke()+500,sd(0,!1))}}break;case 31:case 13:s=Zr(a,2),s!==null&&vu(s,a,2),Cu(),ap(a,2)}if(a=fp(r),a===null&&Td(e,t,r,pp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Td(e,t,r,null,n)}}function fp(e){return e=nn(e),mp(e)}var pp=null;function mp(e){if(pp=null,e=_t(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return pp=e,null}function hp(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`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ae()){case je:return 2;case Me:return 8;case Ne:case Pe:return 32;case Fe:return 268435456;default:return 32}default:return 32}}var gp=!1,_p=null,vp=null,yp=null,bp=new Map,xp=new Map,Sp=[],Cp=`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 wp(e,t){switch(e){case`focusin`:case`focusout`:_p=null;break;case`dragenter`:case`dragleave`:vp=null;break;case`mouseover`:case`mouseout`:yp=null;break;case`pointerover`:case`pointerout`:bp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:xp.delete(t.pointerId)}}function Tp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=vt(t),t!==null&&op(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ep(e,t,n,r,i){switch(t){case`focusin`:return _p=Tp(_p,e,t,n,r,i),!0;case`dragenter`:return vp=Tp(vp,e,t,n,r,i),!0;case`mouseover`:return yp=Tp(yp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return bp.set(a,Tp(bp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,xp.set(a,Tp(xp.get(a)||null,e,t,n,r,i)),!0}return!1}function Dp(e){var t=_t(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ot(e.priority,function(){sp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ot(e.priority,function(){sp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Op(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=fp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tn=r,n.target.dispatchEvent(r),tn=null}else return t=vt(n),t!==null&&op(t),e.blockedOn=n,!1;t.shift()}return!0}function kp(e,t,n){Op(e)&&n.delete(t)}function Ap(){gp=!1,_p!==null&&Op(_p)&&(_p=null),vp!==null&&Op(vp)&&(vp=null),yp!==null&&Op(yp)&&(yp=null),bp.forEach(kp),xp.forEach(kp)}function jp(e,n){e.blockedOn===n&&(e.blockedOn=null,gp||(gp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ap)))}var Mp=null;function Np(e){Mp!==e&&(Mp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Mp===e&&(Mp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(mp(r||n)===null)continue;break}var a=vt(n);a!==null&&(e.splice(t,3),t-=3,xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Pp(e){function t(t){return jp(t,e)}_p!==null&&jp(_p,e),vp!==null&&jp(vp,e),yp!==null&&jp(yp,e),bp.forEach(t),xp.forEach(t);for(var n=0;n<Sp.length;n++){var r=Sp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Sp.length&&(n=Sp[0],n.blockedOn===null);)Dp(n),n.blockedOn===null&&Sp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[lt]||null;if(typeof a==`function`)o||Np(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[lt]||null)s=o.formAction;else if(mp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Np(n)}}}function Fp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Ip(e){this._internalRoot=e}Lp.prototype.render=Ip.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Q(n,gu(),e,t,null,null)},Lp.prototype.unmount=Ip.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Q(e.current,2,null,e,null,null),Cu(),t[ut]=null}};function Lp(e){this._internalRoot=e}Lp.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Sp.length&&t!==0&&t<Sp[n].priority;n++);Sp.splice(n,0,e),n===0&&Dp(e)}};var Rp=n.version;if(Rp!==`19.2.8`)throw Error(i(527,Rp,`19.2.8`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var zp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Bp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bp.isDisabled&&Bp.supportsFiber)try{Re=Bp.inject(zp),ze=Bp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ws,s=Gs,c=Ks;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=np(e,1,!1,null,null,n,r,null,o,s,c,Fp),e[ut]=t.current,Cd(e),new Ip(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},y=new class extends v{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},b={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},x=new class{#e=b;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function S(e){setTimeout(e,0)}var C=typeof window>`u`||`Deno`in globalThis;function w(){}function T(e,t){return typeof e==`function`?e(t):e}function E(e){return typeof e==`number`&&e>=0&&e!==1/0}function D(e,t){return Math.max(e+(t||0)-Date.now(),0)}function O(e,t){return typeof e==`function`?e(t):e}function k(e,t){return typeof e==`function`?e(t):e}function ee(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ne(o,t.options))return!1}else if(!j(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function te(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(A(t.options.mutationKey)!==A(a))return!1}else if(!j(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ne(e,t){return(t?.queryKeyHashFn||A)(e)}function A(e){return JSON.stringify(e,(e,t)=>ae(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function j(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!j(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!j(e[r],t[r]))return!1;return!0}return!1}var re=Object.prototype.hasOwnProperty;function M(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ie(e)&&ie(t);if(!r&&!(ae(e)&&ae(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:re.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=M(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function N(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ie(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ae(e){if(!oe(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!oe(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function oe(e){return Object.prototype.toString.call(e)===`[object Object]`}function se(e){return new Promise(t=>{x.setTimeout(t,e)})}function ce(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:M(e,t)}function le(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ue(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var de=Symbol();function P(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===de?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function fe(e,t){return typeof e==`function`?e(...t):!!e}function pe(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var me=(()=>{let e=()=>C;return{isServer(){return e()},setIsServer(t){e=t}}})();function he(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ge=S;function _e(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ge,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ve=_e(),ye=new class extends v{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function be(e){return Math.min(1e3*2**e,3e4)}function xe(e){return(e??`online`)!==`online`||ye.isOnline()}var Se=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ce(e){let t=!1,n=0,r,i=he(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Se(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>y.isFocused()&&(e.networkMode===`always`||ye.isOnline())&&e.canRun(),u=()=>xe(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(me.isServer()?0:3),o=e.retryDelay??be,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),se(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var we=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),E(this.gcTime)&&(this.#e=x.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(me.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(x.clearTimeout(this.#e),this.#e=void 0)}};function Te(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{pe(e,()=>t.signal,()=>n=!0)},u=P(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ue:le;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?De:Ee,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ee(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Ee(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function De(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Oe=class extends we{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=je(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=je(this.options);e.data!==void 0&&(this.setState(Ae(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ce(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(w).catch(w):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>k(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===de||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>O(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!D(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=P(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Te(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Ce({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Se&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Se){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ke(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ae(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ve.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ke(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xe(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ae(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function je(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Me=class extends v{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=he(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Pe(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fe(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fe(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof k(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!N(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Ie(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||k(this.options.enabled,this.#t)!==k(t.enabled,this.#t)||O(this.options.staleTime,this.#t)!==O(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||k(this.options.enabled,this.#t)!==k(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Re(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(w)),t}#g(){this.#b();let e=O(this.options.staleTime,this.#t);if(me.isServer()||this.#r.isStale||!E(e))return;let t=D(this.#r.dataUpdatedAt,e)+1;this.#d=x.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(me.isServer()||k(this.options.enabled,this.#t)===!1||!E(this.#p)||this.#p===0)&&(this.#f=x.setInterval(()=>{(this.options.refetchIntervalInBackground||y.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(x.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(x.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Pe(e,t),o=i&&Ie(e,n,t,r);(a||o)&&(l={...l,...ke(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=ce(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=ce(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Le(e,t),refetch:this.refetch,promise:this.#o,isEnabled:k(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=he();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a()}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!N(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){ve.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Ne(e,t){return k(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||k(t.retryOnMount,e)!==!1)}function Pe(e,t){return Ne(e,t)||e.state.data!==void 0&&Fe(e,t,t.refetchOnMount)}function Fe(e,t,n){if(k(t.enabled,e)!==!1&&O(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Le(e,t)}return!1}function Ie(e,t,n,r){return(e!==t||k(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Le(e,n)}function Le(e,t){return k(t.enabled,e)!==!1&&e.isStaleByTime(O(t.staleTime,e))}function Re(e,t){return!N(e.getCurrentResult(),t)}var ze=class extends we{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Be(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Ce({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ve.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Be(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ve=class extends v{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new ze({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=He(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=He(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=He(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=He(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ve.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>te(t,e))}findAll(e={}){return this.getAll().filter(t=>te(e,t))}notify(e){ve.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ve.batch(()=>Promise.all(e.map(e=>e.continue().catch(w))))}};function He(e){return e.options.scope?.id}var Ue=class extends v{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ne(r,t),a=this.get(i);return a||(a=new Oe({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ve.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ee(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ee(e,t)):t}notify(e){ve.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ve.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ve.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},We=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ue,this.#t=e.mutationCache||new Ve,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=y.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ye.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(O(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=T(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ve.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ve.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ve.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=ve.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(w).catch(w)}invalidateQueries(e,t={}){return ve.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ve.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(w)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(w)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(O(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(w).catch(w)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(w).catch(w)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ye.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(A(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{j(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(A(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{j(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ne(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===de&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ge=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Ke=o(((e,t)=>{t.exports=Ge()})),F=l(d(),1),I=Ke(),qe=F.createContext(void 0),Je=e=>{let t=F.useContext(qe);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ye=({client:e,children:t})=>(F.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,I.jsx)(qe.Provider,{value:e,children:t})),Xe=F.createContext(!1),Ze=()=>F.useContext(Xe);Xe.Provider;function Qe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $e=F.createContext(Qe()),et=()=>F.useContext($e),tt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?fe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},nt=e=>{F.useEffect(()=>{e.clearReset()},[e])},rt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||fe(n,[e.error,r])),it=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},at=(e,t)=>e.isLoading&&e.isFetching&&!t,ot=(e,t)=>e?.suspense&&t.isPending,st=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ct(e,t,n){let r=Ze(),i=et(),a=Je(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,it(o),tt(o,i,s),nt(i);let l=!a.getQueryCache().get(o.queryHash),[u]=F.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(F.useSyncExternalStore(F.useCallback(e=>{let t=f?u.subscribe(ve.batchCalls(e)):w;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),F.useEffect(()=>{u.setOptions(o)},[o,u]),ot(o,d))throw st(o,u,i);if(rt({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!me.isServer()&&at(d,r)&&(l?st(o,u,i):s?.promise)?.catch(w).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function lt(e,t){return ct(e,Me,t)}var ut=_();function dt(e){return e.session?.profile??e.agents[0]?.name??e.customAgents[0]?.profileName??``}function ft(e,t){let n=vt(e,t);return n?_t(n):void 0}function pt(e,t){for(let n of e){if(n.piboSessionId===t)return n;let e=pt(n.children,t);if(e)return e}}function mt(e,t,n=[]){for(let r of e){let e=[...n,r];if(r.piboSessionId===t)return e;let i=mt(r.children,t,e);if(i.length)return i}return[]}function ht(){let e=globalThis.crypto?.randomUUID?.()??Math.random().toString(36).slice(2);return`web-${Date.now().toString(36)}-${e}`}function gt(e,t){return!e||e.startsWith(`optimistic-session-`)||t}function _t(e){return`${e.provider}/${e.id}`}function vt(e,t){if(t.activeModel)return t.activeModel;let n=e.agents.find(e=>e.name===t.profile);if(n?.model)return n.model;let r=e.customAgents.find(e=>e.profileName===t.profile),i=n??r;return t.parentId?i?.subagentModel??e.modelDefaults?.subagent:i?.mainModel??e.modelDefaults?.main}function yt(e){let t=e.flatMap(e=>e.slashCommands.filter(e=>e!==`tree`).map(t=>({slash:`/${t}`,action:e.name,description:e.name===`thinking`&&t===`thinking`?`Show thinking level or use /thinking <level>.`:e.description??e.name})));return t.push({slash:`/download`,action:`download`,description:`Download a file by absolute path or relative to the current working directory.`},{slash:`/upload`,action:`upload`,description:`Upload one or more files to the configured Pibo uploads directory.`},{slash:`/thinking-show`,action:`thinking-show`,description:`Toggle historical thinking display in this browser.`}),t}function bt(e,t){if(!e)return[];let n=e.agentCatalog?.skills??[],r=e.agentCatalog?.userSkills??[],i=[...n,...r],a=dt(e),o=t?pt(e.sessions,t)?.profile??a:a,s=[...e.agents.map(e=>({name:e.name,skills:e.skills})),...e.customAgents.map(e=>({name:e.profileName,skills:e.skills}))].find(e=>e.name===o),c=new Set(s?.skills??[]);return i.filter(e=>c.has(e.name))}async function xt(e,t){let n=await fetch(e,t),r=await n.json().catch(()=>void 0);if(!n.ok){let e=r&&typeof r==`object`&&`error`in r?String(r.error):`Request failed`,t=Error(e);throw t.status=n.status,t.data=r,t}return r}async function St(e,t=!1,n,r=!1,i){let a=kt(e,t,n);return r&&a.set(`markRead`,`true`),xt(`/api/chat/bootstrap${a.size?`?${a.toString()}`:``}`,i).then(jt)}async function Ct(e,t){return xt(`/api/chat/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...e?{profile:e}:{},...t?{roomId:t}:{}})})}async function wt(e,t){return xt(`/api/chat/sessions/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}async function Tt(e,t){return xt(`/api/chat/sessions/${encodeURIComponent(e)}`,{method:`DELETE`,headers:{"content-type":`application/json`},body:JSON.stringify({confirmText:t})})}async function Et(e,t,n,r,i=[],a=[],o=`queue`){return xt(`/api/chat/message`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({piboSessionId:e,text:t,clientTxnId:n,delivery:o,...r?{roomId:r}:{},...i.length?{webAnnotationIds:i}:{},...a.length?{fileAttachmentPaths:a}:{}})})}async function Dt(e){return xt(`/api/chat/status?${new URLSearchParams({piboSessionId:e}).toString()}`,{cache:`no-store`})}async function Ot(e,t,n){return xt(`/api/chat/action`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({piboSessionId:e,action:t,params:n})})}function kt(e,t=!1,n){let r=new URLSearchParams;return e&&r.set(`piboSessionId`,e),t&&r.set(`includeArchived`,`true`),n&&r.set(`roomId`,n),r}function At(e){if(!e.session)throw Error(`Invalid navigation response.`);let t=e.sessions??[],n=e.selectedPiboSessionId??e.session.id??t[0]?.piboSessionId??``;return{identity:e.identity??{userId:``},session:e.session,runtimeStatus:e.runtimeStatus,room:e.room,selectedRoomId:e.selectedRoomId??``,selectedPiboSessionId:n,latestRoomStreamId:e.latestRoomStreamId,rooms:e.rooms??[],sessions:t}}function jt(e){return{...At(e),agents:e.agents??[],customAgents:e.customAgents??[],agentFolders:e.agentFolders??[],modelDefaults:e.modelDefaults,modelCatalog:e.modelCatalog?{providers:(e.modelCatalog.providers??[]).map(e=>({...e,models:e.models??[]}))}:e.modelCatalog,agentCatalog:e.agentCatalog?{...e.agentCatalog,piboTools:e.agentCatalog.piboTools??[],piPackages:(e.agentCatalog.piPackages??[]).map(e=>({...e,enabled:e.enabled!==!1})),userSkills:e.agentCatalog.userSkills??[]}:e.agentCatalog,capabilities:{actions:e.capabilities?.actions??[]},integrations:e.integrations}}function Mt(e){let t=e.trim();if(t.length>=2){let e=t[0],n=t[t.length-1];if(e===`"`&&n===`"`||e===`'`&&n===`'`)return t.slice(1,-1).trim()}return t}function Nt(e,t){if(e===`thinking`&&t)return{level:t.split(/\s+/,1)[0]};if(e===`compact`&&t)return{customInstructions:t};if(e===`goal`)return{command:t}}var Pt=/filename\*=UTF-8''([^;]+)|filename="?([^";]+)"?/i;async function Ft(e){let t=new FormData;for(let n of e)t.append(`files`,n,n.name);let n=await fetch(`/api/chat/upload`,{method:`POST`,body:t});if(!n.ok){let e=await n.json().catch(()=>void 0),t=e&&typeof e==`object`&&`error`in e?String(e.error):`Upload failed`;throw Error(t)}return n.json()}async function It(e,t={}){let n=new URLSearchParams({path:e});t.piboSessionId&&n.set(`piboSessionId`,t.piboSessionId),t.roomId&&n.set(`roomId`,t.roomId);let r=await fetch(`/api/chat/download?${n.toString()}`);if(!r.ok){let e=await r.json().catch(()=>void 0),t=e&&typeof e==`object`&&`error`in e?String(e.error):`Download failed`;throw Error(t)}let i=Bt(r.headers.get(`content-disposition`)),a=zt(r.headers.get(`content-length`)),o={path:e,filename:i,receivedBytes:0,totalBytes:a};t.onStart?.(o);let s=await Lt(r,o,t.onProgress);return Rt(s,i),{path:e,filename:i,receivedBytes:s.size,totalBytes:a}}async function Lt(e,t,n){if(!e.body){let r=await e.blob();return n?.({...t,receivedBytes:r.size}),r}let r=e.body.getReader(),i=[],a=0;for(;;){let{done:e,value:o}=await r.read();if(e)break;o&&(i.push(new Uint8Array(o)),a+=o.byteLength,n?.({...t,receivedBytes:a}))}return new Blob(i,{type:e.headers.get(`content-type`)??`application/octet-stream`})}function Rt(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,document.body.append(r),r.click(),r.remove(),URL.revokeObjectURL(n)}function zt(e){if(!e)return;let t=Number(e);return Number.isFinite(t)&&t>=0?t:void 0}function Bt(e){let t=e?.match(Pt),n=t?.[1];return n?decodeURIComponent(n):t?.[2]??`download`}var Vt=[`default`,`hide`,`slim`,`intent`],Ht=`terminal`,Ut=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Wt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Gt=e=>{let t=Wt(e);return t.charAt(0).toUpperCase()+t.slice(1)},Kt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),qt=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},Jt={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Yt=(0,F.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,F.createElement)(`svg`,{ref:c,...Jt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Kt(`lucide`,i),...!a&&!qt(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,F.createElement)(e,t)),...Array.isArray(a)?a:[a]])),L=(e,t)=>{let n=(0,F.forwardRef)(({className:n,...r},i)=>(0,F.createElement)(Yt,{ref:i,iconNode:t,className:Kt(`lucide-${Ut(Gt(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Gt(e),n},Xt=L(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Zt=L(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),Qt=L(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),$t=L(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),en=L(`bolt`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),tn=L(`book-a`,[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}],[`path`,{d:`m8 13 4-7 4 7`,key:`4rari8`}],[`path`,{d:`M9.1 11h5.7`,key:`1gkovt`}]]),nn=L(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),rn=L(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),an=L(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),on=L(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),sn=L(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),cn=L(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),ln=L(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),un=L(`chevrons-down`,[[`path`,{d:`m7 6 5 5 5-5`,key:`1lc07p`}],[`path`,{d:`m7 13 5 5 5-5`,key:`1d48rs`}]]),dn=L(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),fn=L(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),pn=L(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),mn=L(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),hn=L(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),gn=L(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),_n=L(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),vn=L(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),yn=L(`clock-3`,[[`path`,{d:`M12 6v6h4`,key:`135r8i`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),bn=L(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),xn=L(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Sn=L(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Cn=L(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),wn=L(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Tn=L(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),En=L(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Dn=L(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),On=L(`git-branch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),kn=L(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),An=L(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),jn=L(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),Mn=L(`key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]),Nn=L(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Pn=L(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),Fn=L(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),In=L(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ln=L(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Rn=L(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),zn=L(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Bn=L(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),Vn=L(`panel-top-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`m15 14-3 3-3-3`,key:`g215vf`}]]),Hn=L(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Un=L(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Wn=L(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),Gn=L(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),Kn=L(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),qn=L(`send-horizontal`,[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),Jn=L(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Yn=L(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Xn=L(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Zn=L(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Qn=L(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),$n=L(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),er=L(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),tr=L(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),nr=l(h(),1),rr=0,ir=1,ar=2,or=4;function sr(e){return()=>e}function cr(e){e()}function lr(e,t){return n=>e(t(n))}function ur(e,t){return()=>e(t)}function dr(e,t){return n=>e(t,n)}function fr(e){return e!==void 0}function pr(...e){return()=>{e.map(cr)}}function mr(){}function hr(e,t){return t(e),e}function gr(e,t){return t(e)}function _r(...e){return e}function vr(e,t){return e(ir,t)}function R(e,t){e(rr,t)}function yr(e){e(ar)}function br(e){return e(or)}function z(e,t){return vr(e,dr(t,rr))}function xr(e,t){let n=e(ir,e=>{n(),t(e)});return n}function Sr(e){let t,n;return r=>i=>{t=i,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Cr(e,t){return e===t}function wr(e=Cr){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function B(e){return t=>n=>{e(n)&&t(n)}}function V(e){return t=>lr(t,e)}function Tr(e){return t=>()=>{t(e)}}function H(e,...t){let n=Ar(...t);return((t,r)=>{switch(t){case ar:yr(e);return;case ir:return vr(e,n(r))}})}function Er(e,t){return n=>r=>{n(t=e(t,r))}}function Dr(e){return t=>n=>{e>0?e--:t(n)}}function Or(e){let t=null,n;return r=>i=>{t=i,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function kr(...e){let t=Array.from({length:e.length}),n=0,r=null,i=2**e.length-1;return e.forEach((e,a)=>{let o=2**a;vr(e,e=>{let s=n;n|=o,t[a]=e,s!==i&&n===i&&r&&(r(),r=null)})}),e=>a=>{let o=()=>{e([a].concat(t))};n===i?o():r=o}}function Ar(...e){return t=>e.reduceRight(gr,t)}function jr(e){let t,n,r=()=>t?.();return function(i,a){switch(i){case ir:return a?n===a?void 0:(r(),n=a,t=vr(e,a),t):(r(),mr);case ar:r(),n=null;return}}}function U(e){let t=e,n=Nr();return((e,r)=>{switch(e){case rr:t=r;break;case ir:r(t);break;case or:return t}return n(e,r)})}function Mr(e,t){return hr(U(t),t=>z(e,t))}function Nr(){let e=[];return((t,n)=>{switch(t){case rr:e.slice().forEach(e=>{e(n)});return;case ar:e.splice(0);return;case ir:return e.push(n),()=>{let t=e.indexOf(n);t>-1&&e.splice(t,1)}}})}function Pr(e){return hr(Nr(),t=>z(e,t))}var Fr={singleton:!0};function Ir(e,t=[],n=Fr){let{singleton:r}=n;return{constructor:e,dependencies:t,id:Lr(),singleton:r}}var Lr=()=>Symbol(`id`);function Rr(e){let t=new Map,n=({constructor:e,dependencies:r,id:i,singleton:a})=>{if(a&&t.has(i))return t.get(i);let o=e(r.map(e=>n(e)));return a&&t.set(i,o),o};return n(e)}function zr(...e){let t=Nr(),n=Array.from({length:e.length}),r=0,i=2**e.length-1;return e.forEach((e,a)=>{let o=2**a;vr(e,e=>{n[a]=e,r|=o,r===i&&R(t,n)})}),function(e,a){switch(e){case ar:yr(t);return;case ir:return r===i&&a(n),vr(t,a)}}}function W(e,t=Cr){return H(e,wr(t))}function Br(...e){return function(t,n){switch(t){case ar:return;case ir:return pr(...e.map(e=>vr(e,n)))}}}var Vr={DEBUG:0,INFO:1,WARN:2,ERROR:3},Hr={[Vr.DEBUG]:`debug`,[Vr.ERROR]:`error`,[Vr.INFO]:`log`,[Vr.WARN]:`warn`},Ur=()=>typeof globalThis>`u`?window:globalThis,Wr=Ir(()=>{let e=U(Vr.ERROR);return{log:U((t,n,r=Vr.INFO)=>{r>=(Ur().VIRTUOSO_LOG_LEVEL??br(e))&&console[Hr[r]](`%creact-virtuoso: %c%s %o`,`color: #0253b3; font-weight: bold`,`color: initial`,t,n)}),logLevel:e}},[],{singleton:!0});function Gr(e){return`self`in e?e.document.documentElement:e}function Kr(e){let t=Gr(e);return t.ownerDocument.defaultView.getComputedStyle(t).direction===`rtl`}function qr(e,t){return Kr(e)?-t:t}function Jr(e,t){return Kr(e)?-t:t}function Yr(e,t,n){return Xr(e,t,n).callbackRef}function Xr(e,t,n){let r=F.useRef(null),i=e=>{},a=F.useMemo(()=>typeof ResizeObserver<`u`?new ResizeObserver(t=>{let r=()=>{let n=t[0].target;n.offsetParent!==null&&e(n)};n?r():requestAnimationFrame(r)}):null,[e,n]);return i=e=>{e&&t?(a?.observe(e),r.current=e):(r.current&&a?.unobserve(r.current),r.current=null)},{callbackRef:i,ref:r}}function Zr(e,t,n,r,i,a,o,s,c){return Xr(F.useCallback(n=>{let c=Qr(n.children,t,s?`offsetWidth`:`offsetHeight`,i),l=n.parentElement;for(;l.dataset.virtuosoScroller===void 0;)l=l.parentElement;let u=l.lastElementChild?.dataset.viewportType===`window`,d;u&&(d=l.ownerDocument.defaultView);let f=o?s?o.scrollWidth:o.scrollHeight:u?s?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight:s?l.scrollWidth:l.scrollHeight,p=o?s?o.offsetWidth:o.offsetHeight:u?s?d.innerWidth:d.innerHeight:s?l.offsetWidth:l.offsetHeight,m=o?s?qr(o,o.scrollLeft):o.scrollTop:u?s?qr(d,d.scrollX||d.document.documentElement.scrollLeft):d.scrollY||d.document.documentElement.scrollTop:s?qr(l,l.scrollLeft):l.scrollTop;r({scrollHeight:f,scrollTop:Math.max(m,0),viewportHeight:p}),a?.(s?$r(`column-gap`,getComputedStyle(n).columnGap,i):$r(`row-gap`,getComputedStyle(n).rowGap,i)),c!==null&&e(c)},[e,t,i,a,o,r,s]),n,c)}function Qr(e,t,n,r){let i=e.length;if(i===0)return null;let a=[];for(let o=0;o<i;o++){let i=e.item(o);if(i.dataset.index===void 0)continue;let s=parseInt(i.dataset.index,10),c=parseFloat(i.dataset.knownSize),l=t(i,n);if(l===0&&r(`Zero-sized element, this should not happen`,{child:i},Vr.ERROR),l===c)continue;let u=a[a.length-1];a.length===0||u.size!==l||u.endIndex!==s-1?a.push({endIndex:s,size:l,startIndex:s}):a[a.length-1].endIndex++}return a}function $r(e,t,n){return t!==`normal`&&t?.endsWith(`px`)!==!0&&n(`${e} was not resolved to pixel value correctly`,t,Vr.WARN),t===`normal`?0:parseInt(t??`0`,10)}function ei(e,t,n){let r=F.useRef(null),i=F.useCallback(n=>{if(!n?.offsetParent)return;let i=n.getBoundingClientRect(),a=i.width,s,c;if(t){let e=t.getBoundingClientRect(),n=i.top-e.top;c=e.height-Math.max(0,n),s=n+t.scrollTop}else{let e=o.current.ownerDocument.defaultView;c=e.innerHeight-Math.max(0,i.top),s=i.top+e.scrollY}r.current={listHeight:i.height,offsetTop:s,visibleHeight:c,visibleWidth:a},e(r.current)},[e,t]),{callbackRef:a,ref:o}=Xr(i,!0,n),s=F.useCallback(()=>{i(o.current)},[i,o]);return F.useEffect(()=>{if(t){t.addEventListener(`scroll`,s);let e=new ResizeObserver(()=>{requestAnimationFrame(s)});return e.observe(t),()=>{t.removeEventListener(`scroll`,s),e.unobserve(t)}}let e=o.current?.ownerDocument.defaultView;return e?.addEventListener(`scroll`,s),e?.addEventListener(`resize`,s),()=>{e?.removeEventListener(`scroll`,s),e?.removeEventListener(`resize`,s)}},[s,t,o]),a}var ti=Ir(()=>{let e=Nr(),t=Nr(),n=U(0),r=Nr(),i=U(0),a=Nr(),o=Nr(),s=U(0),c=U(0),l=U(0),u=U(0),d=Nr(),f=Nr(),p=U(!1),m=U(!1),h=U(!1);return z(H(e,V(({scrollTop:e})=>e)),t),z(H(e,V(({scrollHeight:e})=>e)),o),z(t,i),{deviation:n,fixedFooterHeight:l,fixedHeaderHeight:c,footerHeight:u,headerHeight:s,horizontalDirection:m,scrollBy:f,scrollContainerState:e,scrollHeight:o,scrollingInProgress:p,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:h,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:a}},[],{singleton:!0}),ni={lvl:0};function ri(e,t){let n=e.length;if(n===0)return[];let{index:r,value:i}=t(e[0]),a=[];for(let o=1;o<n;o++){let{index:n,value:s}=t(e[o]);a.push({end:n-1,start:r,value:i}),r=n,i=s}return a.push({end:1/0,start:r,value:i}),a}function ii(e){return e===ni}function ai(e,t){if(!ii(e))return t===e.k?e.v:t<e.k?ai(e.l,t):ai(e.r,t)}function oi(e,t,n=`k`){if(ii(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){let r=oi(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return oi(e.l,t,n)}function si(e,t,n){return ii(e)?vi(t,n,1):t===e.k?mi(e,{k:t,v:n}):t<e.k?yi(mi(e,{l:si(e.l,t,n)})):yi(mi(e,{r:si(e.r,t,n)}))}function ci(){return ni}function li(e,t,n){if(ii(e))return[];let r=oi(e,t)[0];return Si(fi(e,r,n))}function ui(e,t){if(ii(e))return ni;let{k:n,l:r,r:i}=e;if(t===n){if(ii(r))return i;if(ii(i))return r;let[t,n]=_i(r);return pi(mi(e,{k:t,l:hi(r),v:n}))}return pi(t<n?mi(e,{l:ui(r,t)}):mi(e,{r:ui(i,t)}))}function di(e){return ii(e)?[]:[...di(e.l),{k:e.k,v:e.v},...di(e.r)]}function fi(e,t,n){if(ii(e))return[];let{k:r,l:i,r:a,v:o}=e,s=[];return r>t&&(s=s.concat(fi(i,t,n))),r>=t&&r<=n&&s.push({k:r,v:o}),r<=n&&(s=s.concat(fi(a,t,n))),s}function pi(e){let{l:t,lvl:n,r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(gi(t))return bi(mi(e,{lvl:n-1}));if(!ii(t)&&!ii(t.r))return mi(t.r,{l:mi(t,{r:t.r.l}),lvl:n,r:mi(e,{l:t.r.r,lvl:n-1})});throw Error(`Unexpected empty nodes`)}if(gi(e))return xi(mi(e,{lvl:n-1}));if(!ii(r)&&!ii(r.l)){let t=r.l,i=gi(t)?r.lvl-1:r.lvl;return mi(t,{l:mi(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:xi(mi(r,{l:t.r,lvl:i}))})}throw Error(`Unexpected empty nodes`)}function mi(e,t){return vi(t.k===void 0?e.k:t.k,t.v===void 0?e.v:t.v,t.lvl===void 0?e.lvl:t.lvl,t.l===void 0?e.l:t.l,t.r===void 0?e.r:t.r)}function hi(e){return ii(e.r)?e.l:pi(mi(e,{r:hi(e.r)}))}function gi(e){return ii(e)||e.lvl>e.r.lvl}function _i(e){return ii(e.r)?[e.k,e.v]:_i(e.r)}function vi(e,t,n,r=ni,i=ni){return{k:e,l:r,lvl:n,r:i,v:t}}function yi(e){return xi(bi(e))}function bi(e){let{l:t}=e;return!ii(t)&&t.lvl===e.lvl?mi(t,{r:mi(e,{l:t.r})}):e}function xi(e){let{lvl:t,r:n}=e;return!ii(n)&&!ii(n.r)&&n.lvl===t&&n.r.lvl===t?mi(n,{l:mi(e,{r:n.l}),lvl:t+1}):e}function Si(e){return ri(e,({k:e,v:t})=>({index:e,value:t}))}function Ci(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function wi(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}var Ti=Ir(()=>({recalcInProgress:U(!1)}),[],{singleton:!0});function Ei(e,t,n){return e[Di(e,t,n)]}function Di(e,t,n,r=0){let i=e.length-1;for(;r<=i;){let a=Math.floor((r+i)/2),o=e[a],s=n(o,t);if(s===0)return a;if(s===-1){if(i-r<2)return a-1;i=a-1}else{if(i===r)return a;r=a+1}}throw Error(`Failed binary finding record in array - ${e.join(`,`)}, searched for ${t}`)}function Oi(e,t,n,r){let i=Di(e,t,r),a=Di(e,n,r,i);return e.slice(i,a+1)}function G(e,t){return Math.round(e.getBoundingClientRect()[t])}function ki(e){return!ii(e.groupOffsetTree)}function Ai({index:e},t){return t===e?0:t<e?-1:1}function ji(){return{groupIndices:[],groupOffsetTree:ci(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:ci()}}function Mi(e,t){let n=ii(e)?0:1/0;for(let r of t){let{endIndex:t,size:i,startIndex:a}=r;if(n=Math.min(n,a),ii(e)){e=si(e,0,i);continue}let o=li(e,a-1,t+1);if(o.some(Wi(r)))continue;let s=!1,c=!1;for(let{end:n,start:r,value:a}of o)s?(t>=r||i===a)&&(e=ui(e,r)):(c=a!==i,s=!0),n>t&&t>=r&&a!==i&&(e=si(e,t+1,a));c&&(e=si(e,a,i))}return[e,n]}function Ni(e){return e.groupIndex!==void 0}function Pi({offset:e},t){return t===e?0:t<e?-1:1}function Fi(e,t,n){if(t.length===0)return 0;let{index:r,offset:i,size:a}=Ei(t,e,Ai),o=e-r,s=a*o+(o-1)*n+i;return s>0?s+n:s}function Ii(e,t){if(!ki(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function Li(e,t,n){if(Ni(e))return t.groupIndices[e.groupIndex]+1;let r=Ii(e.index===`LAST`?n:e.index,t);return r=Math.max(0,Math.min(n,r)),r}function Ri(e,t,n,r=0){return r>0&&(t=Math.max(t,Ei(e,r,Ai).offset)),ri(Oi(e,t,n,Pi),Ui)}function zi(e,[t,n,r,i]){t.length>0&&r(`received item sizes`,t,Vr.DEBUG);let a=e.sizeTree,o=a,s=0;if(n.length>0&&ii(a)&&t.length===2){let e=t[0].size,r=t[1].size;o=n.reduce((t,n)=>si(si(t,n,e),n+1,r),o)}else[o,s]=Mi(o,t);if(o===a)return e;let{lastIndex:c,lastOffset:l,lastSize:u,offsetTree:d}=Hi(e.offsetTree,s,o,i);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>si(e,t,Fi(t,d,i)),ci()),lastIndex:c,lastOffset:l,lastSize:u,offsetTree:d,sizeTree:o}}function Bi(e){return di(e).map(({k:e,v:t},n,r)=>{let i=r[n+1];return{endIndex:i===void 0?1/0:i.k-1,size:t,startIndex:e}})}function Vi(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function Hi(e,t,n,r){let i=e,a=0,o=0,s=0,c=0;if(t===0)i=[];else{c=Di(i,t-1,Ai),s=i[c].offset;let e=oi(n,t-1);a=e[0],o=e[1],i.length&&i[c].size===oi(n,t)[1]&&--c,i=i.slice(0,c+1)}for(let{start:e,value:c}of li(n,t,1/0)){let t=e-a,n=t*o+s+t*r;i.push({index:e,offset:n,size:c}),a=e,s=n,o=c}return{lastIndex:a,lastOffset:s,lastSize:o,offsetTree:i}}function Ui(e){return{index:e.index,value:e}}function Wi(e){let{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}var Gi={offsetHeight:`height`,offsetWidth:`width`},Ki=Ir(([{log:e},{recalcInProgress:t}])=>{let n=Nr(),r=Nr(),i=Mr(r,0),a=Nr(),o=Nr(),s=U(0),c=U([]),l=U(void 0),u=U(void 0),d=U(void 0),f=U(void 0),p=U((e,t)=>G(e,Gi[t])),m=U(void 0),h=U(0),g=ji(),_=Mr(H(n,kr(c,e,h),Er(zi,g),wr()),g),v=Mr(H(c,wr(),Er((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),V(({prev:e})=>e)),[]);z(H(c,B(e=>e.length>0),kr(_,h),V(([e,t,n])=>{let r=e.reduce((e,r,i)=>si(e,r,Fi(r,t.offsetTree,n)||i),ci());return{...t,groupIndices:e,groupOffsetTree:r}})),_),z(H(r,kr(_),B(([e,{lastIndex:t}])=>e<t),V(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),z(l,u);let y=Mr(H(l,V(e=>e===void 0)),!0);z(H(u,B(e=>e!==void 0&&ii(br(_).sizeTree)),V(e=>{let t=br(d),n=br(c).length>0;return t!==void 0&&t!==0?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),z(H(f,B(e=>e!==void 0&&e.length>0&&ii(br(_).sizeTree)),V(e=>{let t=[],n=e[0],r=0;for(let i=1;i<e.length;i++){let a=e[i];a!==n&&(t.push({endIndex:i-1,size:n,startIndex:r}),n=a,r=i)}return t.push({endIndex:e.length-1,size:n,startIndex:r}),t})),n),z(H(c,kr(d,u),B(([,e,t])=>e!==void 0&&t!==void 0),V(([e,t,n])=>{let r=[];for(let i=0;i<e.length;i++){let a=e[i],o=e[i+1];r.push({startIndex:a,endIndex:a,size:t}),o!==void 0&&r.push({startIndex:a+1,endIndex:o-1,size:n})}return r})),n);let b=Pr(H(n,kr(_),Er(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:g}),V(e=>e.changed)));vr(H(s,Er((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),V(e=>e.diff)),e=>{let{groupIndices:n}=br(_);if(e>0)R(t,!0),R(a,e+Vi(e,n));else if(e<0){let t=br(v);t.length>0&&(e-=Vi(-e,t)),R(o,e)}}),vr(H(s,kr(e)),([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},Vr.ERROR)});let x=Pr(a);z(H(a,kr(_),V(([e,t])=>{let n=t.groupIndices.length>0,r=[],i=t.lastSize;if(n){let n=ai(t.sizeTree,0),a=0,o=0;for(;a<e;){let e=t.groupIndices[o],s=t.groupIndices.length===o+1?1/0:t.groupIndices[o+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+s-1,size:i,startIndex:e+1}),o++,a+=s+1}let s=di(t.sizeTree);return a!==e&&s.shift(),s.reduce((t,{k:n,v:r})=>{let i=t.ranges;return t.prevSize!==0&&(i=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:i}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return di(t.sizeTree).reduce((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:i,ranges:[]}).ranges})),n);let S=Pr(H(o,kr(_,h),V(([e,{offsetTree:t},n])=>Fi(-e,t,n))));return z(H(o,kr(_,h),V(([e,t,n])=>{if(t.groupIndices.length>0){if(ii(t.sizeTree))return t;let r=ci(),i=br(v),a=0,o=0,s=0;for(;a<-e;){s=i[o];let e=i[o+1]-s-1;o++,a+=e+1}if(r=di(t.sizeTree).reduce((t,{k:n,v:r})=>si(t,Math.max(0,n+e),r),r),a!==-e){let n=ai(t.sizeTree,s);r=si(r,0,n);let i=oi(t.sizeTree,-e+1)[1];r=si(r,1,i)}return{...t,sizeTree:r,...Hi(t.offsetTree,0,r,n)}}let r=di(t.sizeTree).reduce((t,{k:n,v:r})=>si(t,Math.max(0,n+e),r),ci());return{...t,sizeTree:r,...Hi(t.offsetTree,0,r,n)}})),_),{beforeUnshiftWith:x,data:m,defaultItemSize:u,firstItemIndex:s,fixedItemSize:l,fixedGroupSize:d,gap:h,groupIndices:c,heightEstimates:f,itemSize:p,listRefresh:b,shiftWith:o,shiftWithOffset:S,sizeRanges:n,sizes:_,statefulTotalCount:i,totalCount:r,trackItemSizes:y,unshiftWith:a}},_r(Wr,Ti),{singleton:!0});function qi(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}var Ji=Ir(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:i}])=>{let a=Nr(),o=Nr(),s=Pr(H(a,V(qi)));return z(H(s,V(e=>e.totalCount)),n),z(H(s,V(e=>e.groupIndices)),e),z(H(zr(i,t,r),B(([e,t])=>ki(t)),V(([e,t,n])=>oi(t.groupOffsetTree,Math.max(e-n,0),`v`)[0]),wr(),V(e=>[e])),o),{groupCounts:a,topItemsIndexes:o}},_r(Ki,ti)),Yi=Ir(([{log:e}])=>{let t=U(!1),n=Pr(H(t,B(e=>e),wr()));return vr(t,t=>{t&&br(e)(`props updated`,{},Vr.DEBUG)}),{didMount:n,propsReady:t}},_r(Wr),{singleton:!0}),Xi=typeof document<`u`&&`scrollBehavior`in document.documentElement.style;function Zi(e){let t=typeof e==`number`?{index:e}:{...e};return t.align||=`start`,(!t.behavior||!Xi)&&(t.behavior=`auto`),t.offset===void 0&&(t.offset=0),t}var Qi=Ir(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:a,footerHeight:o,headerHeight:s,scrollingInProgress:c,scrollTo:l,smoothScrollTargetReached:u,viewportHeight:d},{log:f}])=>{let p=Nr(),m=Nr(),h=U(0),g=null,_=null,v=null;function y(){g!==null&&(g(),g=null),v!==null&&(v(),v=null),_&&=(clearTimeout(_),null),R(c,!1)}return z(H(p,kr(n,d,r,h,s,o,f),kr(e,a,i),V(([[e,n,r,i,a,o,s,l],d,f,h])=>{let b=Zi(e),{align:x,behavior:S,offset:C}=b,w=i-1,T=Li(b,n,w),E=Fi(T,n.offsetTree,d)+o;x===`end`?(E+=f+oi(n.sizeTree,T)[1]-r+h,T===w&&(E+=s)):x===`center`?E+=(f+oi(n.sizeTree,T)[1]-r+h)/2:E-=a,C!==void 0&&C!==0&&(E+=C);let D=t=>{y(),t?(l(`retrying to scroll to`,{location:e},Vr.DEBUG),R(p,e)):(R(m,!0),l(`list did not change, scroll successful`,{},Vr.DEBUG))};if(y(),S===`smooth`){let e=!1;v=vr(t,t=>{e||=t}),g=xr(u,()=>{D(e)})}else g=xr(H(t,$i(150)),D);return _=setTimeout(()=>{y()},1200),R(c,!0),l(`scrolling from index to`,{behavior:S,index:T,top:E},Vr.DEBUG),{behavior:S,top:E}})),l),{scrollTargetReached:m,scrollToIndex:p,topListHeight:h}},_r(Ki,ti,Wr),{singleton:!0});function $i(e){return t=>{let n=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(n))}}}function ea(e,t){e===0?t():requestAnimationFrame(()=>{ea(e-1,t)})}function ta(e,t){if(e===void 0)return 0;let n=t-1,r=typeof e==`number`?e:e.index===`LAST`?n:e.index;return Math.max(0,Math.min(r,n))}function na(e){return e===void 0?!0:typeof e==`number`?e===0:e.index===0&&(e.align===void 0||e.align===`start`)&&(e.offset===void 0||e.offset===0)}var ra=Ir(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:a},{didMount:o}])=>{let s=U(!0),c=U(0),l=U(!0);return z(H(o,kr(c),B(([e,t])=>!na(t)),Tr(!1)),s),z(H(o,kr(c),B(([e,t])=>!na(t)),Tr(!1)),l),vr(H(zr(t,o),kr(s,n,e,l),B(([[,e],t,{sizeTree:n},r,i])=>e&&(!ii(n)||fr(r))&&!t&&!i),kr(c)),([,e])=>{if(e===void 0){R(s,!0),R(l,!0);return}xr(i,()=>{R(l,!0)}),ea(4,()=>{xr(r,()=>{R(s,!0)}),R(a,e)})}),{initialItemFinalLocationReached:l,initialTopMostItemIndex:c,scrolledToInitialItem:s}},_r(Ki,ti,Qi,Yi),{singleton:!0});function ia(e,t){return Math.abs(e-t)<1.01}var aa=`up`,oa=`down`,sa=`none`,ca={atBottom:!1,notAtBottomBecause:`NOT_SHOWING_LAST_ITEM`,state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},la=0,ua=Ir(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:a}])=>{let o=U(!1),s=U(!0),c=Nr(),l=Nr(),u=U(4),d=U(la),f=Mr(H(Br(H(W(i),Dr(1),Tr(!0)),H(W(i),Dr(1),Tr(!1),Sr(100))),wr()),!1),p=Mr(H(Br(H(n,Tr(!0)),H(n,Tr(!1),Sr(200))),wr()),!1);z(H(zr(W(i),W(d)),V(([e,t])=>e<=t),wr()),s),z(H(s,Or(50)),l);let m=Pr(H(zr(r,W(a),W(t),W(e),W(u)),Er((e,[{scrollHeight:t,scrollTop:n},r,i,a,o])=>{let s=n+r-t>-o,c={scrollHeight:t,scrollTop:n,viewportHeight:r};if(s){let t,r;return n>e.state.scrollTop?(t=`SCROLLED_DOWN`,r=e.state.scrollTop-n):(t=`SIZE_DECREASED`,r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:c}}let l;return l=c.scrollHeight>e.state.scrollHeight?`SIZE_INCREASED`:r<e.state.viewportHeight?`VIEWPORT_HEIGHT_DECREASING`:n<e.state.scrollTop?`SCROLLING_UPWARDS`:`NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM`,{atBottom:!1,notAtBottomBecause:l,state:c}},ca),wr((e,t)=>e!==void 0&&e.atBottom===t.atBottom))),h=Mr(H(r,Er((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(!ia(e.scrollHeight,t)){let i=t-(n+r)<1;return e.scrollTop!==n&&i?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}return{changed:!1,jump:0,scrollHeight:t,scrollTop:n}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),B(e=>e.changed),V(e=>e.jump)),0);z(H(m,V(e=>e.atBottom)),o),z(H(o,Or(50)),c);let g=U(oa);z(H(r,V(({scrollTop:e})=>e),wr(),Er((e,t)=>br(p)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?aa:oa,prevScrollTop:t},{direction:oa,prevScrollTop:0}),V(e=>e.direction)),g),z(H(r,Or(50),Tr(sa)),g);let _=U(0);return z(H(f,B(e=>!e),Tr(0)),_),z(H(i,Or(100),kr(f),B(([e,t])=>t),Er(([e,t],[n])=>[t,n],[0,0]),V(([e,t])=>t-e)),_),{atBottomState:m,atBottomStateChange:c,atBottomThreshold:u,atTopStateChange:l,atTopThreshold:d,isAtBottom:o,isAtTop:s,isScrolling:f,lastJumpDueToItemResize:h,scrollDirection:g,scrollVelocity:_}},_r(ti)),da=`top`,fa=`bottom`,pa=`none`;function ma(e,t,n){return typeof e==`number`?n===aa&&t===da||n===oa&&t===fa?e:0:n===aa?t===da?e.main:e.reverse:t===fa?e.main:e.reverse}function ha(e,t){return typeof e==`number`?e:e[t]??0}var ga=Ir(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{let a=Nr(),o=U(0),s=U(0),c=U(0);return{increaseViewportBy:s,listBoundary:a,overscan:c,topListHeight:o,visibleRange:Mr(H(zr(W(r),W(i),W(n),W(a,wi),W(c),W(o),W(t),W(e),W(s)),V(([e,t,n,[r,i],a,o,s,c,l])=>{let u=e-c,d=o+s,f=Math.max(n-u,0),p=pa,m=ha(l,da),h=ha(l,fa);return r-=c,r+=n+s,i+=n+s,i-=c,r>e+d-m&&(p=aa),i<e-f+t+h&&(p=oa),p===pa?null:[Math.max(u-n-ma(a,da,p)-m,0),u-f-s+t+ma(a,fa,p)+h]}),B(e=>e!==null),wr(wi)),[0,0])}},_r(ti),{singleton:!0});function _a(e,t,n){if(ki(t)){let r=Ii(e,t);return[{index:oi(t.groupOffsetTree,r)[0],offset:0,size:0},{data:n?.[0],index:r,offset:0,size:0}]}return[{data:n?.[0],index:e,offset:0,size:0}]}var va={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function ya(e,t,n,r,i,a){let{lastIndex:o,lastOffset:s,lastSize:c}=i,l=0,u=0;if(e.length>0){l=e[0].offset;let t=e[e.length-1];u=t.offset+t.size}let d=n-o,f=s+d*c+(d-1)*r,p=l,m=f-u;return{bottom:u,firstItemIndex:a,items:xa(e,i,a),offsetBottom:m,offsetTop:l,top:p,topItems:xa(t,i,a),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function ba(e,t,n,r,i,a){let o=0;if(n.groupIndices.length>0)for(let t of n.groupIndices){if(t-o>=e)break;o++}let s=e+o,c=ta(t,s);return ya(Array.from({length:s}).map((e,t)=>({data:a[t+c],index:t+c,offset:0,size:0})),[],s,i,n,r)}function xa(e,t,n){if(e.length===0)return[];if(!ki(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));let r=e[0].index,i=e[e.length-1].index,a=[],o=li(t.groupOffsetTree,r,i),s,c=0;for(let r of e){(!s||s.end<r.index)&&(s=o.shift(),c=t.groupIndices.indexOf(s.start));let e;e=r.index===s.start?{index:c,type:`group`}:{groupIndex:c,index:r.index-(c+1)+n},a.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return a}function Sa(e,t){return e===void 0?0:typeof e==`number`?e:e[t]??0}var Ca=Ir(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:i},a,{listBoundary:o,topListHeight:s,visibleRange:c},{initialTopMostItemIndex:l,scrolledToInitialItem:u},{topListHeight:d},f,{didMount:p},{recalcInProgress:m}])=>{let h=U([]),g=U(0),_=Nr(),v=U(0);z(a.topItemsIndexes,h);let y=Mr(H(zr(p,m,W(c,wi),W(i),W(r),W(l),u,W(h),W(t),W(n),W(v),e),B(([e,t,,n,,,,,,,,r])=>{let i=r!==void 0&&r.length!==n;return e&&!t&&!i}),V(([,,[e,t],n,r,i,a,o,s,c,l,u])=>{let d=r,{offsetTree:f,sizeTree:p}=d,m=br(g);if(n===0)return{...va,totalCount:n};if(e===0&&t===0)return m===0?{...va,totalCount:n}:ba(m,i,r,s,c,u||[]);if(ii(p))return m>0?null:ya(_a(ta(i,n),d,u),[],n,c,d,s);let h=[];if(o.length>0){let e=o[0],t=o[o.length-1],n=0;for(let r of li(p,e,t)){let i=r.value,a=Math.max(r.start,e),o=Math.min(r.end,t);for(let e=a;e<=o;e++)h.push({data:u?.[e],index:e,offset:n,size:i}),n+=i}}if(!a)return ya([],h,n,c,d,s);let _=o.length>0?o[o.length-1]+1:0,v=Ri(f,e,t,_);if(v.length===0)return null;let y=n-1,b=hr([],n=>{for(let r of v){let i=r.value,a=i.offset,o=r.start,s=i.size;if(i.offset<e){o+=Math.floor((e-i.offset+c)/(s+c));let t=o-r.start;a+=t*s+t*c}o<_&&(a+=(_-o)*s,o=_);let l=Math.min(r.end,y);for(let e=o;e<=l&&!(a>=t);e++)n.push({data:u?.[e],index:e,offset:a,size:s}),a+=s+c}}),x=Sa(l,da),S=Sa(l,fa);if(b.length>0&&(x>0||S>0)){let e=b[0],t=b[b.length-1];if(x>0&&e.index>_){let t=Math.min(x,e.index-_),n=[],r=e.offset;for(let i=e.index-1;i>=e.index-t;i--){let t=li(p,i,i)[0]?.value??e.size;r-=t+c,n.unshift({data:u?.[i],index:i,offset:r,size:t})}b.unshift(...n)}if(S>0&&t.index<y){let e=Math.min(S,y-t.index),n=t.offset+t.size+c;for(let r=t.index+1;r<=t.index+e;r++){let e=li(p,r,r)[0]?.value??t.size;b.push({data:u?.[r],index:r,offset:n,size:e}),n+=e+c}}}return ya(b,h,n,c,d,s)}),B(e=>e!==null),wr()),va);z(H(e,B(fr),V(e=>e?.length)),i),z(H(y,V(e=>e.topListHeight)),d),z(d,s),z(H(y,V(e=>[e.top,e.bottom])),o),z(H(y,V(e=>e.items)),_);let b=Pr(H(y,B(({items:e})=>e.length>0),kr(i,e),B(([{items:e},t])=>e[e.length-1].originalIndex===t-1),V(([,e,t])=>[e-1,t]),wr(wi),V(([e])=>e))),x=Pr(H(y,Or(200),B(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),V(({items:e})=>e[0].index),wr()));return{endReached:b,initialItemCount:g,itemsRendered:_,listState:y,minOverscanItemCount:v,rangeChanged:Pr(H(y,B(({items:e})=>e.length>0),V(({items:e})=>{let t=0,n=e.length-1;for(;e[t].type===`group`&&t<n;)t++;for(;e[n].type===`group`&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),wr(Ci))),startReached:x,topItemsIndexes:h,...f}},_r(Ki,Ji,ga,ra,Qi,ua,Yi,Ti),{singleton:!0}),wa=Ir(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:i}])=>{let a=Nr(),o=Mr(H(zr(n,e,r,t,i),V(([e,t,n,r,i])=>e+t+n+r+i.offsetBottom+i.bottom)),0);return z(W(o),a),{totalListHeight:o,totalListHeightChanged:a}},_r(ti,Ca),{singleton:!0}),Ta=Ir(([{viewportHeight:e},{totalListHeight:t}])=>{let n=U(!1);return{alignToBottom:n,paddingTopAddition:Mr(H(zr(n,e,t),B(([e])=>e),V(([,e,t])=>Math.max(0,e-t)),Or(0),wr()),0)}},_r(ti,wa),{singleton:!0}),Ea=Ir(()=>({context:U(null)})),Da=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...i},viewportBottom:a,viewportTop:o})=>t<o?{...i,align:n??`start`,...r===void 0?{}:{behavior:r}}:e>a?{...i,align:n??`end`,...r===void 0?{}:{behavior:r}}:null,Oa=Ir(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:a,scrollingInProgress:o,scrollTop:s,viewportHeight:c},{scrollToIndex:l}])=>{let u=Nr();return z(H(u,kr(t,c,n,a,i,r,s),kr(e),V(([[e,t,n,r,i,a,s,c],l])=>{let{calculateViewLocation:u=Da,done:d,...f}=e,p=Li(e,t,r-1),m=Fi(p,t.offsetTree,l)+i+a,h=m+oi(t.sizeTree,p)[1],g=c+a,_=u({itemBottom:h,itemTop:m,locationParams:f,viewportBottom:c+n-s,viewportTop:g});return _===null?d?.():d&&xr(H(o,B(e=>!e),Dr(br(o)?1:2)),d),_}),B(e=>e!==null)),l),{scrollIntoView:u}},_r(Ki,ti,Qi,Ca,Wr),{singleton:!0});function ka(e){return e===!1?!1:e===`smooth`?`smooth`:`auto`}var Aa=(e,t)=>typeof e==`function`?ka(e(t)):t&&ka(e),ja=Ir(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:a},{scrollToIndex:o},{scrolledToInitialItem:s},{didMount:c,propsReady:l},{log:u},{scrollingInProgress:d},{context:f},{scrollIntoView:p}])=>{let m=U(!1),h=Nr(),g=null;function _(e){R(o,{align:`end`,behavior:e,index:`LAST`})}vr(H(zr(H(W(t),Dr(1)),c),kr(W(m),a,s,d),V(([[e,t],n,r,i,a])=>{let o=t&&i,s=`auto`;return o&&(s=Aa(n,r||a),o&&=s!==!1),{followOutputBehavior:s,shouldFollow:o,totalCount:e}}),B(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{g!==null&&(g(),g=null),br(n)===void 0?g=xr(e,()=>{br(u)(`following output to `,{totalCount:r},Vr.DEBUG),_(t),g=null}):requestAnimationFrame(()=>{br(u)(`following output to `,{totalCount:r},Vr.DEBUG),_(t)})});function v(e){let t=xr(i,t=>{e&&!t.atBottom&&t.notAtBottomBecause===`SIZE_INCREASED`&&g===null&&(br(u)(`scrolling to bottom due to increased size`,{},Vr.DEBUG),_(`auto`))});setTimeout(t,100)}vr(H(zr(W(m),t,l),B(([e,,t])=>e!==!1&&t),Er(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),B(({refreshed:e})=>e),kr(m,t)),([,e])=>{br(s)&&v(e!==!1)}),vr(h,()=>{v(br(m)!==!1)}),vr(zr(W(m),i),([e,t])=>{e!==!1&&!t.atBottom&&t.notAtBottomBecause===`VIEWPORT_HEIGHT_DECREASING`&&_(`auto`)});let y=U(null),b=Nr();return z(Br(H(W(r),V(e=>e?.length??0)),H(W(t))),b),vr(H(zr(H(b,Dr(1)),c),kr(W(y),s,d,f),V(([[e,t],n,r,i,a])=>t&&r&&n?.({context:a,totalCount:e,scrollingInProgress:i})),B(e=>!!e),Or(0)),t=>{g!==null&&(g(),g=null),br(n)===void 0?g=xr(e,()=>{br(u)(`scrolling into view`,{}),R(p,t),g=null}):requestAnimationFrame(()=>{br(u)(`scrolling into view`,{}),R(p,t)})}),{autoscrollToBottom:h,followOutput:m,scrollIntoViewOnChange:y}},_r(Ki,ua,Qi,ra,Yi,Wr,ti,Ea,Oa)),Ma=Ir(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:a,listState:o},{didMount:s}])=>(z(H(s,kr(a),B(([,e])=>e!==0),kr(i,r,t,n,e),V(([[,e],t,n,r,i,a=[]])=>ba(e,t,n,r,i,a))),o),{}),_r(Ki,ra,Ca,Yi),{singleton:!0}),Na=Ir(([{didMount:e},{scrollTo:t},{listState:n}])=>{let r=U(0);return vr(H(e,kr(r),B(([,e])=>e!==0),V(([,e])=>({top:e}))),e=>{xr(H(n,Dr(1),B(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{R(t,e)})})}),{initialScrollTop:r}},_r(Yi,ti,Ca),{singleton:!0}),Pa=Ir(([{scrollVelocity:e}])=>{let t=U(!1),n=Nr(),r=U(!1);return z(H(e,kr(r,t,n),B(([e,t])=>t!==!1&&t!==void 0),V(([e,t,n,r])=>{let{enter:i,exit:a}=t;if(n){if(a(e,r))return!1}else if(i(e,r))return!0;return n}),wr()),t),vr(H(zr(t,e,n),kr(r)),([[e,t,n],r])=>{e&&r!==!1&&r!==void 0&&r.change&&r.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},_r(ua),{singleton:!0}),Fa=Ir(([{scrollContainerState:e,scrollTo:t}])=>{let n=Nr(),r=Nr(),i=Nr(),a=U(!1),o=U(void 0);return z(H(zr(n,r),V(([{scrollTop:e,viewportHeight:t},{offsetTop:n,listHeight:r}])=>({scrollHeight:r,scrollTop:Math.max(0,e-n),viewportHeight:t}))),e),z(H(t,kr(r),V(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),i),{customScrollParent:o,useWindowScroll:a,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},_r(ti)),Ia=Ir(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:a},{useWindowScroll:o,windowScrollContainerState:s,windowViewportRect:c}])=>{let l=Nr(),u=U(void 0),d=U(null),f=U(null);return z(s,d),z(c,f),vr(H(l,kr(t,r,o,d,f,n)),([e,t,n,r,i,a,o])=>{let s=Bi(t.sizeTree);r&&i!==null&&a!==null&&(n=i.scrollTop-a.offsetTop),n-=o,e({ranges:s,scrollTop:n})}),z(H(u,B(fr),V(La)),i),z(H(a,kr(u),B(([,e])=>e!==void 0),wr(),V(([,e])=>e.ranges)),e),{getState:l,restoreStateFrom:u}},_r(Ki,ti,ra,Yi,Fa));function La(e){return{align:`start`,index:0,offset:e.scrollTop}}var Ra=Ir(([{topItemsIndexes:e}])=>{let t=U(0);return z(H(t,B(e=>e>=0),V(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},_r(Ca));function za(e){let t=!1,n;return(()=>(t||(t=!0,n=e()),n))}var Ba=za(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Va=Ir(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:a,groupIndices:o,heightEstimates:s,itemSize:c,sizeRanges:l,sizes:u,statefulTotalCount:d,totalCount:f,trackItemSizes:p},{initialItemFinalLocationReached:m,initialTopMostItemIndex:h,scrolledToInitialItem:g},_,v,y,b,{scrollToIndex:x},S,{topItemCount:C},{groupCounts:w},T])=>{let{listState:E,minOverscanItemCount:D,topItemsIndexes:O,rangeChanged:k,...ee}=b;return z(k,T.scrollSeekRangeChanged),z(H(zr(T.windowViewportRect,_.headerHeight,_.fixedHeaderHeight),V(([e,t,n])=>Math.max(t+n+1,e.visibleHeight))),_.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:a,groupCounts:w,heightEstimates:s,initialItemFinalLocationReached:m,initialTopMostItemIndex:h,scrolledToInitialItem:g,sizeRanges:l,topItemCount:C,topItemsIndexes:O,totalCount:f,...y,groupIndices:o,itemSize:c,listState:E,minOverscanItemCount:D,scrollToIndex:x,statefulTotalCount:d,trackItemSizes:p,rangeChanged:k,...ee,...T,..._,sizes:u,...v}},_r(Ki,ra,ti,Ia,ja,Ca,Qi,Ir(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:a,lastJumpDueToItemResize:o,scrollDirection:s},{listState:c},{beforeUnshiftWith:l,gap:u,shiftWithOffset:d,sizes:f},{log:p},{recalcInProgress:m}])=>{let h=Pr(H(c,kr(o),Er(([,e,t,n],[{bottom:r,items:i,offsetBottom:a,totalCount:o},s])=>{let c=r+a,l=0;return t===o&&e.length>0&&i.length>0&&(i[0].originalIndex===0&&e[0].originalIndex===0||(l=c-n,l!==0&&(l+=s))),[l,i,o,c]},[0,[],0,0]),B(([e])=>e!==0),kr(r,s,n,i,p,m),B(([,e,t,n,,,r])=>!r&&!n&&e!==0&&t===aa),V(([[e],,,,,t])=>(t(`Upward scrolling compensation`,{amount:e},Vr.DEBUG),e))));function g(n){n>0?(R(t,{behavior:`auto`,top:-n}),R(e,0)):(R(e,0),R(t,{behavior:`auto`,top:-n}))}return vr(H(h,kr(e,a)),([t,n,r])=>{r&&Ba()?R(e,n-t):g(-t)}),vr(H(zr(Mr(a,!1),e,m),B(([e,t,n])=>!e&&!n&&t!==0),V(([e,t])=>t),Or(1)),g),z(H(d,V(e=>({top:-e}))),t),vr(H(l,kr(f,u),V(([e,{groupIndices:t,lastSize:n,sizeTree:r},i])=>{function a(e){return e*(n+i)}if(t.length===0)return a(e);let o=0,s=ai(r,0),c=0,l=0;for(;c<e;){c++,o+=s;let n=t.length===l+1?1/0:t[l+1]-t[l]-1;c+n>e&&(o-=s,n=e-c+1),c+=n,o+=a(n),l++}return o})),n=>{R(e,n),requestAnimationFrame(()=>{R(t,{top:n}),requestAnimationFrame(()=>{R(e,0),R(m,!1)})})}),{deviation:e}},_r(ti,ua,Ca,Ki,Wr,Ti)),Ra,Ji,Ir(([e,t,n,r,i,a,o,s,c,l,u])=>({...e,...t,...n,...r,...i,...a,...o,...s,...c,...l,...u}),_r(ga,Ma,Yi,Pa,wa,Na,Ta,Fa,Oa,Wr,Ea))));function Ha(e,t){let n={},r={},i=0,a=e.length;for(;i<a;)r[e[i]]=1,i+=1;for(let e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}var Ua=typeof document>`u`?F.useEffect:F.useLayoutEffect;function Wa(e,t,n){let r=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),a=Object.keys(t.methods||{}),o=Object.keys(t.events||{}),s=F.createContext({});function c(e,n){e.propsReady!==void 0&&R(e.propsReady,!1);for(let i of r){let r=e[t.required[i]];R(r,n[i])}for(let r of i)if(r in n){let i=e[t.optional[r]];R(i,n[r])}e.propsReady!==void 0&&R(e.propsReady,!0)}function l(e){return a.reduce((n,r)=>(n[r]=n=>{let i=e[t.methods[r]];R(i,n)},n),{})}function u(e){return o.reduce((n,r)=>(n[r]=jr(e[t.events[r]]),n),{})}return{Component:F.forwardRef(function(t,a){let{children:d,...f}=t,[p]=F.useState(()=>hr(Rr(e),e=>{c(e,f)})),[m]=F.useState(ur(u,p));Ua(()=>{for(let e of o)e in f&&vr(m[e],f[e]);return()=>{Object.values(m).map(yr)}},[f,m,p]),Ua(()=>{c(p,f)}),F.useImperativeHandle(a,sr(l(p)));let h=n;return(0,I.jsx)(s.Provider,{value:p,children:n===void 0?d:(0,I.jsx)(h,{...Ha([...r,...i,...o],f),children:d})})}),useEmitter:(e,t)=>{let n=F.useContext(s)[e];Ua(()=>vr(n,t),[t,n])},useEmitterValue:e=>{let t=F.useContext(s)[e],n=F.useCallback(e=>vr(t,e),[t]);return F.useSyncExternalStore(n,()=>br(t),()=>br(t))},usePublisher:e=>{let t=F.useContext(s);return F.useCallback(n=>{R(t[e],n)},[t,e])}}}var Ga=F.createContext(void 0),Ka=F.createContext(void 0),qa=`-webkit-sticky`,Ja=`sticky`,Ya=za(()=>{if(typeof document>`u`)return Ja;let e=document.createElement(`div`);return e.style.position=qa,e.style.position===qa?qa:Ja}),Xa=typeof document>`u`?F.useEffect:F.useLayoutEffect;function Za(e){return`self`in e}function Qa(e){return`body`in e}function $a(e,t,n,r=mr,i,a){let o=F.useRef(null),s=F.useRef(null),c=F.useRef(null),l=F.useCallback(n=>{let r,i,o,l=n.target;if(Qa(l)||Za(l)){let e=Za(l)?l:l.defaultView;o=a===!0?qr(e,e.scrollX):e.scrollY,r=a===!0?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,i=a===!0?e.innerWidth:e.innerHeight}else o=a===!0?qr(l,l.scrollLeft):l.scrollTop,r=a===!0?l.scrollWidth:l.scrollHeight,i=a===!0?l.offsetWidth:l.offsetHeight;let u=()=>{e({scrollHeight:r,scrollTop:Math.max(o,0),viewportHeight:i})};n.suppressFlushSync===!0?u():nr.flushSync(u),s.current!==null&&(o===s.current||o<=0||o===r-i)&&(s.current=null,t(!0),c.current&&=(clearTimeout(c.current),null))},[e,t,a]);F.useEffect(()=>{let e=i??o.current;return r(i??o.current),l({suppressFlushSync:!0,target:e}),e.addEventListener(`scroll`,l,{passive:!0}),()=>{r(null),e.removeEventListener(`scroll`,l)}},[o,l,n,r,i]);function u(n){let r=o.current;if(!r||(a===!0?`offsetWidth`in r&&r.offsetWidth===0:`offsetHeight`in r&&r.offsetHeight===0))return;let i=n.behavior===`smooth`,l,u,d;Za(r)?(u=Math.max(G(r.document.documentElement,a===!0?`width`:`height`),a===!0?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),l=a===!0?r.innerWidth:r.innerHeight,d=a===!0?qr(r,r.scrollX):r.scrollY):(u=r[a===!0?`scrollWidth`:`scrollHeight`],l=G(r,a===!0?`width`:`height`),d=a===!0?qr(r,r.scrollLeft):r.scrollTop);let f=u-l;if(n.top===void 0){r.scrollTo(n);return}let p=Math.ceil(Math.max(Math.min(f,n.top),0));if(n.top=p,ia(l,u)||p===d){e({scrollHeight:u,scrollTop:d,viewportHeight:l}),i&&t(!0);return}i?(s.current=p,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,s.current=null,t(!0)},1e3)):s.current=null,a===!0&&(n={...n.behavior===void 0?{}:{behavior:n.behavior},left:Jr(r,p)}),r.scrollTo(n)}function d(e){a===!0&&(e={...e.behavior===void 0?{}:{behavior:e.behavior},...e.top===void 0?{}:{left:Jr(o.current,e.top)}}),o.current.scrollBy(e)}return{scrollByCallback:d,scrollerRef:o,scrollToCallback:u}}function eo(e){return e}var to=Ir(([e,t])=>({...e,...t}),_r(Va,Ir(()=>{let e=U(e=>`Item ${e}`),t=U(e=>`Group ${e}`),n=U({}),r=U(eo),i=U(`div`),a=U(mr),o=(e,t=null)=>Mr(H(n,V(t=>t[e]),wr()),t);return{components:n,computeItemKey:r,EmptyPlaceholder:o(`EmptyPlaceholder`),FooterComponent:o(`Footer`),GroupComponent:o(`Group`,`div`),groupContent:t,HeaderComponent:o(`Header`),HeaderFooterTag:i,ItemComponent:o(`Item`,`div`),itemContent:e,ListComponent:o(`List`,`div`),ScrollerComponent:o(`Scroller`,`div`),scrollerRef:a,ScrollSeekPlaceholder:o(`ScrollSeekPlaceholder`),TopItemListComponent:o(`TopItemList`)}}))),no=({height:e})=>(0,I.jsx)(`div`,{style:{height:e}}),ro={overflowAnchor:`none`,position:Ya(),zIndex:1},io={overflowAnchor:`none`},ao={...io,display:`inline-block`,height:`100%`},oo=F.memo(function({showTopList:e=!1}){let t=K(`listState`),n=wo(`sizeRanges`),r=K(`useWindowScroll`),i=K(`customScrollParent`),a=wo(`windowScrollContainerState`),o=wo(`scrollContainerState`),s=i||r?a:o,c=K(`itemContent`),l=K(`context`),u=K(`groupContent`),d=K(`trackItemSizes`),f=K(`itemSize`),p=K(`log`),m=wo(`gap`),h=K(`horizontalDirection`),{callbackRef:g}=Zr(n,f,d,e?mr:s,p,m,i,h,K(`skipAnimationFrameInResizeObserver`)),[_,v]=F.useState(0);Co(`deviation`,e=>{_!==e&&v(e)});let y=K(`EmptyPlaceholder`),b=K(`ScrollSeekPlaceholder`)??no,x=K(`ListComponent`),S=K(`ItemComponent`),C=K(`GroupComponent`),w=K(`computeItemKey`),T=K(`isSeeking`),E=K(`groupIndices`).length>0,D=K(`alignToBottom`),O=K(`initialItemFinalLocationReached`),k=e?{}:{boxSizing:`border-box`,...h?{display:`inline-block`,height:`100%`,marginInlineStart:_===0?D?`auto`:0:_,paddingInlineEnd:t.offsetBottom,paddingInlineStart:t.offsetTop,whiteSpace:`nowrap`}:{marginTop:_===0?D?`auto`:0:_,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...O?{}:{visibility:`hidden`}};return!e&&t.totalCount===0&&y!=null?(0,I.jsx)(y,{...po(y,l)}):(0,I.jsx)(x,{...po(x,l),"data-testid":e?`virtuoso-top-item-list`:`virtuoso-item-list`,ref:g,style:k,children:(e?t.topItems:t.items).map(e=>{let n=e.originalIndex,r=w(n+t.firstItemIndex,e.data,l);return T?(0,F.createElement)(b,{...po(b,l),height:e.size,index:e.index,key:r,type:e.type||`item`,...e.type===`group`?{}:{groupIndex:e.groupIndex}}):e.type===`group`?(0,F.createElement)(C,{...po(C,l),"data-index":n,"data-item-index":e.index,"data-known-size":e.size,key:r,style:ro},u(e.index,l)):(0,F.createElement)(S,{...po(S,l),...mo(S,e.data),"data-index":n,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:r,style:h?ao:io},E?c(e.index,e.groupIndex,e.data,l):c(e.index,e.data,l))})})}),so={height:`100%`,outline:`none`,overflowY:`auto`,position:`relative`,WebkitOverflowScrolling:`touch`},co={outline:`none`,overflowX:`auto`,position:`relative`},lo=e=>({height:`100%`,position:`absolute`,top:0,width:`100%`,...e?{display:`flex`,flexDirection:`column`}:void 0}),uo=(e,t,n=0)=>({...lo(e),position:t?`relative`:`absolute`,top:t?-n:0}),fo={position:Ya(),top:0,width:`100%`,zIndex:1};function po(e,t){if(typeof e!=`string`)return{context:t}}function mo(e,t){return{item:typeof e==`string`?void 0:t}}var ho=F.memo(function(){let e=K(`HeaderComponent`),t=wo(`headerHeight`),n=K(`HeaderFooterTag`),r=Yr(F.useMemo(()=>e=>{t(G(e,`height`))},[t]),!0,K(`skipAnimationFrameInResizeObserver`)),i=K(`context`);return e==null?null:(0,I.jsx)(n,{ref:r,children:(0,I.jsx)(e,{...po(e,i)})})}),go=F.memo(function(){let e=K(`FooterComponent`),t=wo(`footerHeight`),n=K(`HeaderFooterTag`),r=Yr(F.useMemo(()=>e=>{t(G(e,`height`))},[t]),!0,K(`skipAnimationFrameInResizeObserver`)),i=K(`context`);return e==null?null:(0,I.jsx)(n,{ref:r,children:(0,I.jsx)(e,{...po(e,i)})})});function _o({useEmitter:e,useEmitterValue:t,usePublisher:n}){return F.memo(function({children:r,style:i,context:a,...o}){let s=n(`scrollContainerState`),c=t(`ScrollerComponent`),l=n(`smoothScrollTargetReached`),u=t(`scrollerRef`),d=t(`horizontalDirection`)||!1,{scrollByCallback:f,scrollerRef:p,scrollToCallback:m}=$a(s,l,c,u,void 0,d);return e(`scrollTo`,m),e(`scrollBy`,f),(0,I.jsx)(c,{"data-testid":`virtuoso-scroller`,"data-virtuoso-scroller":!0,ref:p,style:{...d?co:so,...i},tabIndex:0,...o,...po(c,a),children:r})})}function vo({useEmitter:e,useEmitterValue:t,usePublisher:n}){return F.memo(function({children:r,style:i,context:a,...o}){let s=n(`windowScrollContainerState`),c=t(`ScrollerComponent`),l=n(`smoothScrollTargetReached`),u=t(`totalListHeight`),d=t(`deviation`),f=t(`customScrollParent`),p=F.useRef(null),{scrollByCallback:m,scrollerRef:h,scrollToCallback:g}=$a(s,l,c,t(`scrollerRef`),f);return Xa(()=>(h.current=f??p.current?.ownerDocument.defaultView,()=>{h.current=null}),[h,f]),e(`windowScrollTo`,g),e(`scrollBy`,m),(0,I.jsx)(c,{ref:p,"data-virtuoso-scroller":!0,style:{position:`relative`,...i,...u===0?void 0:{height:u+d}},...o,...po(c,a),children:r})})}var yo=({children:e})=>{let t=F.useContext(Ga),n=wo(`viewportHeight`),r=wo(`fixedItemHeight`),i=K(`alignToBottom`),a=K(`horizontalDirection`),o=Yr(F.useMemo(()=>lr(n,e=>G(e,a?`width`:`height`)),[n,a]),!0,K(`skipAnimationFrameInResizeObserver`));return F.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,I.jsx)(`div`,{"data-viewport-type":`element`,ref:o,style:lo(i),children:e})},bo=({children:e})=>{let t=F.useContext(Ga),n=wo(`windowViewportRect`),r=wo(`fixedItemHeight`),i=K(`customScrollParent`),a=K(`useWindowScroll`),o=K(`topListHeight`),s=ei(n,i,K(`skipAnimationFrameInResizeObserver`)),c=K(`alignToBottom`);return F.useEffect(()=>{t&&(r(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,I.jsx)(`div`,{"data-viewport-type":`window`,ref:s,style:uo(c,a,o),children:e})},xo=({children:e})=>{let t=K(`TopItemListComponent`)??`div`,n=K(`headerHeight`),r={...fo,marginTop:`${n}px`},i=K(`context`);return(0,I.jsx)(t,{style:r,...po(t,i),children:e})},{Component:So,useEmitter:Co,useEmitterValue:K,usePublisher:wo}=Wa(to,{optional:{restoreStateFrom:`restoreStateFrom`,context:`context`,followOutput:`followOutput`,scrollIntoViewOnChange:`scrollIntoViewOnChange`,itemContent:`itemContent`,groupContent:`groupContent`,overscan:`overscan`,increaseViewportBy:`increaseViewportBy`,minOverscanItemCount:`minOverscanItemCount`,totalCount:`totalCount`,groupCounts:`groupCounts`,topItemCount:`topItemCount`,firstItemIndex:`firstItemIndex`,initialTopMostItemIndex:`initialTopMostItemIndex`,components:`components`,atBottomThreshold:`atBottomThreshold`,atTopThreshold:`atTopThreshold`,computeItemKey:`computeItemKey`,defaultItemHeight:`defaultItemHeight`,fixedGroupHeight:`fixedGroupHeight`,fixedItemHeight:`fixedItemHeight`,heightEstimates:`heightEstimates`,itemSize:`itemSize`,scrollSeekConfiguration:`scrollSeekConfiguration`,headerFooterTag:`HeaderFooterTag`,data:`data`,initialItemCount:`initialItemCount`,initialScrollTop:`initialScrollTop`,alignToBottom:`alignToBottom`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`,horizontalDirection:`horizontalDirection`,skipAnimationFrameInResizeObserver:`skipAnimationFrameInResizeObserver`},methods:{scrollToIndex:`scrollToIndex`,scrollIntoView:`scrollIntoView`,scrollTo:`scrollTo`,scrollBy:`scrollBy`,autoscrollToBottom:`autoscrollToBottom`,getState:`getState`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,totalListHeightChanged:`totalListHeightChanged`,itemsRendered:`itemsRendered`,groupIndices:`groupIndices`}},F.memo(function(e){let t=K(`useWindowScroll`),n=K(`topItemsIndexes`).length>0,r=K(`customScrollParent`),i=K(`context`);return(0,I.jsxs)(r||t?Eo:To,{...e,context:i,children:[n&&(0,I.jsx)(xo,{children:(0,I.jsx)(oo,{showTopList:!0})}),(0,I.jsxs)(r||t?bo:yo,{children:[(0,I.jsx)(ho,{}),(0,I.jsx)(oo,{}),(0,I.jsx)(go,{})]})]})})),To=_o({useEmitter:Co,useEmitterValue:K,usePublisher:wo}),Eo=vo({useEmitter:Co,useEmitterValue:K,usePublisher:wo}),Do=So,Oo=Ir(([e,t])=>({...e,...t}),_r(Va,Ir(()=>{let e=U(e=>(0,I.jsxs)(`td`,{children:[`Item $`,e]})),t=U(null),n=U(e=>(0,I.jsxs)(`td`,{colSpan:1e3,children:[`Group `,e]})),r=U(null),i=U(null),a=U({}),o=U(eo),s=U(mr),c=(e,t=null)=>Mr(H(a,V(t=>t[e]),wr()),t);return{components:a,computeItemKey:o,context:t,EmptyPlaceholder:c(`EmptyPlaceholder`),FillerRow:c(`FillerRow`),fixedFooterContent:i,fixedHeaderContent:r,itemContent:e,groupContent:n,ScrollerComponent:c(`Scroller`,`div`),scrollerRef:s,ScrollSeekPlaceholder:c(`ScrollSeekPlaceholder`),TableBodyComponent:c(`TableBody`,`tbody`),TableComponent:c(`Table`,`table`),TableFooterComponent:c(`TableFoot`,`tfoot`),TableHeadComponent:c(`TableHead`,`thead`),TableRowComponent:c(`TableRow`,`tr`),GroupComponent:c(`Group`,`tr`)}}))),ko=({height:e})=>(0,I.jsx)(`tr`,{children:(0,I.jsx)(`td`,{style:{height:e}})}),Ao=({height:e})=>(0,I.jsx)(`tr`,{children:(0,I.jsx)(`td`,{style:{border:0,height:e,padding:0}})}),jo={overflowAnchor:`none`},Mo={position:Ya(),zIndex:2,overflowAnchor:`none`},No=F.memo(function({showTopList:e=!1}){let t=zo(`listState`),n=zo(`computeItemKey`),r=zo(`firstItemIndex`),i=zo(`context`),a=zo(`isSeeking`),o=zo(`fixedHeaderHeight`),s=zo(`groupIndices`).length>0,c=zo(`itemContent`),l=zo(`groupContent`),u=zo(`ScrollSeekPlaceholder`)??ko,d=zo(`GroupComponent`),f=zo(`TableRowComponent`),p=(e?t.topItems:[]).reduce((e,t,n)=>(n===0?e.push(t.size):e.push(e[n-1]+t.size),e),[]);return(e?t.topItems:t.items).map(t=>{let m=t.originalIndex,h=n(m+r,t.data,i),g=e?m===0?0:p[m-1]:0;return a?(0,F.createElement)(u,{...po(u,i),height:t.size,index:t.index,key:h,type:t.type||`item`}):t.type===`group`?(0,F.createElement)(d,{...po(d,i),"data-index":m,"data-item-index":t.index,"data-known-size":t.size,key:h,style:{...Mo,top:o}},l(t.index,i)):(0,F.createElement)(f,{...po(f,i),...mo(f,t.data),"data-index":m,"data-item-index":t.index,"data-known-size":t.size,"data-item-group-index":t.groupIndex,key:h,style:e?{...Mo,top:o+g}:jo},s?c(t.index,t.groupIndex,t.data,i):c(t.index,t.data,i))})}),Po=F.memo(function(){let e=zo(`listState`),t=zo(`topItemsIndexes`).length>0,n=Bo(`sizeRanges`),r=zo(`useWindowScroll`),i=zo(`customScrollParent`),a=Bo(`windowScrollContainerState`),o=Bo(`scrollContainerState`),s=i||r?a:o,c=zo(`trackItemSizes`),{callbackRef:l,ref:u}=Zr(n,zo(`itemSize`),c,s,zo(`log`),void 0,i,!1,zo(`skipAnimationFrameInResizeObserver`)),[d,f]=F.useState(0);Ro(`deviation`,e=>{d!==e&&(u.current.style.marginTop=`${e}px`,f(e))});let p=zo(`EmptyPlaceholder`),m=zo(`FillerRow`)??Ao,h=zo(`TableBodyComponent`),g=zo(`paddingTopAddition`),_=zo(`statefulTotalCount`),v=zo(`context`);if(_===0&&p!=null)return(0,I.jsx)(p,{...po(p,v)});let y=(t?e.topItems:[]).reduce((e,t)=>e+t.size,0),b=e.offsetTop+g+d-y,x=e.offsetBottom,S=b>0?(0,I.jsx)(m,{context:v,height:b},`padding-top`):null,C=x>0?(0,I.jsx)(m,{context:v,height:x},`padding-bottom`):null;return(0,I.jsxs)(h,{"data-testid":`virtuoso-item-list`,ref:l,...po(h,v),children:[S,t&&(0,I.jsx)(No,{showTopList:!0}),(0,I.jsx)(No,{}),C]})}),Fo=({children:e})=>{let t=F.useContext(Ga),n=Bo(`viewportHeight`),r=Bo(`fixedItemHeight`),i=Yr(F.useMemo(()=>lr(n,e=>G(e,`height`)),[n]),!0,zo(`skipAnimationFrameInResizeObserver`));return F.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),(0,I.jsx)(`div`,{"data-viewport-type":`element`,ref:i,style:lo(!1),children:e})},Io=({children:e})=>{let t=F.useContext(Ga),n=Bo(`windowViewportRect`),r=Bo(`fixedItemHeight`),i=zo(`customScrollParent`),a=zo(`useWindowScroll`),o=ei(n,i,zo(`skipAnimationFrameInResizeObserver`));return F.useEffect(()=>{t&&(r(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),(0,I.jsx)(`div`,{"data-viewport-type":`window`,ref:o,style:uo(!1,a),children:e})},{Component:Lo,useEmitter:Ro,useEmitterValue:zo,usePublisher:Bo}=Wa(Oo,{optional:{restoreStateFrom:`restoreStateFrom`,context:`context`,followOutput:`followOutput`,firstItemIndex:`firstItemIndex`,itemContent:`itemContent`,groupContent:`groupContent`,fixedHeaderContent:`fixedHeaderContent`,fixedFooterContent:`fixedFooterContent`,overscan:`overscan`,increaseViewportBy:`increaseViewportBy`,minOverscanItemCount:`minOverscanItemCount`,totalCount:`totalCount`,topItemCount:`topItemCount`,initialTopMostItemIndex:`initialTopMostItemIndex`,components:`components`,groupCounts:`groupCounts`,atBottomThreshold:`atBottomThreshold`,atTopThreshold:`atTopThreshold`,computeItemKey:`computeItemKey`,defaultItemHeight:`defaultItemHeight`,fixedGroupHeight:`fixedGroupHeight`,fixedItemHeight:`fixedItemHeight`,itemSize:`itemSize`,scrollSeekConfiguration:`scrollSeekConfiguration`,data:`data`,initialItemCount:`initialItemCount`,initialScrollTop:`initialScrollTop`,alignToBottom:`alignToBottom`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`},methods:{scrollToIndex:`scrollToIndex`,scrollIntoView:`scrollIntoView`,scrollTo:`scrollTo`,scrollBy:`scrollBy`,getState:`getState`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,totalListHeightChanged:`totalListHeightChanged`,itemsRendered:`itemsRendered`,groupIndices:`groupIndices`}},F.memo(function(e){let t=zo(`useWindowScroll`),n=zo(`customScrollParent`),r=Bo(`fixedHeaderHeight`),i=Bo(`fixedFooterHeight`),a=zo(`fixedHeaderContent`),o=zo(`fixedFooterContent`),s=zo(`context`),c=Yr(F.useMemo(()=>lr(r,e=>G(e,`height`)),[r]),!0,zo(`skipAnimationFrameInResizeObserver`)),l=Yr(F.useMemo(()=>lr(i,e=>G(e,`height`)),[i]),!0,zo(`skipAnimationFrameInResizeObserver`)),u=n||t?Ho:Vo,d=n||t?Io:Fo,f=zo(`TableComponent`),p=zo(`TableHeadComponent`),m=zo(`TableFooterComponent`),h=a?(0,I.jsx)(p,{ref:c,style:{position:`sticky`,top:0,zIndex:2},...po(p,s),children:a()},`TableHead`):null,g=o?(0,I.jsx)(m,{ref:l,style:{bottom:0,position:`sticky`,zIndex:1},...po(m,s),children:o()},`TableFoot`):null;return(0,I.jsx)(u,{...e,...po(u,s),children:(0,I.jsx)(d,{children:(0,I.jsxs)(f,{style:{borderSpacing:0,overflowAnchor:`none`},...po(f,s),children:[h,(0,I.jsx)(Po,{},`TableBody`),g]})})})})),Vo=_o({useEmitter:Ro,useEmitterValue:zo,usePublisher:Bo}),Ho=vo({useEmitter:Ro,useEmitterValue:zo,usePublisher:Bo}),Uo={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Wo={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:Go,floor:Ko,max:qo,min:Jo,round:Yo}=Math;function Xo(e,t,n){return Array.from({length:t-e+1}).map((t,r)=>({data:n===null?null:n[r+e],index:r+e}))}function Zo(e){return{...Wo,items:e}}function Qo(e,t){return e!==void 0&&e.width===t.width&&e.height===t.height}function $o(e,t){return e!==void 0&&e.column===t.column&&e.row===t.row}var es=Ir(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:a,scrollBy:o,scrollContainerState:s,scrollTo:c,scrollTop:l,smoothScrollTargetReached:u,viewportHeight:d},f,p,{didMount:m,propsReady:h},{customScrollParent:g,useWindowScroll:_,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:b},x])=>{let S=U(0),C=U(0),w=U(Uo),T=U({height:0,width:0}),E=U({height:0,width:0}),D=Nr(),O=Nr(),k=U(0),ee=U(null),te=U({column:0,row:0}),ne=Nr(),A=Nr(),j=U(!1),re=U(0),M=U(!0),N=U(!1),ie=U(!1);vr(H(m,kr(re),B(([e,t])=>!na(t))),()=>{R(M,!1)}),vr(H(zr(m,M,E,T,re,N),B(([e,t,n,r,,i])=>e&&!t&&n.height!==0&&r.height!==0&&!i)),([,,,,e])=>{if(e===void 0){R(M,!0);return}R(N,!0),ea(1,()=>{R(D,e)}),xr(H(l),()=>{R(t,[0,0]),R(M,!0)})}),z(H(A,B(e=>e!=null&&e.scrollTop>0),Tr(0)),C),vr(H(m,kr(A),B(([,e])=>e!=null)),([,e])=>{e&&(R(T,e.viewport),R(E,e.item),R(te,e.gap),e.scrollTop>0&&(R(j,!0),xr(H(l,Dr(1)),e=>{R(j,!1)}),R(c,{top:e.scrollTop})))}),z(H(T,V(({height:e})=>e)),d),z(H(zr(W(T,Qo),W(E,Qo),W(te,(e,t)=>e!==void 0&&e.column===t.column&&e.row===t.row),W(l)),V(([e,t,n,r])=>({gap:n,item:t,scrollTop:r,viewport:e}))),ne),z(H(zr(W(S),r,W(te,$o),W(E,Qo),W(T,Qo),W(ee),W(C),W(j),W(M),W(re)),B(([,,,,,,,e])=>!e),V(([e,[t,n],r,i,a,o,s,,c,l])=>{let{column:u,row:d}=r,{height:f,width:p}=i,{width:m}=a;if(s===0&&(e===0||m===0))return Uo;if(p===0){let t=ta(l,e);return Zo(Xo(t,t+Math.max(s-1,0),o))}let h=ts(m,p,u),g,_;c?t===0&&n===0&&s>0?(g=0,_=s-1):(g=h*Ko((t+d)/(f+d)),_=h*Go((n+d)/(f+d))-1,_=Jo(e-1,qo(_,h-1)),g=Jo(_,qo(0,g))):(g=0,_=-1);let v=Xo(g,_,o),{bottom:y,top:b}=ns(a,r,i,v),x=Go(e/h);return{bottom:y,itemHeight:f,items:v,itemWidth:p,offsetBottom:x*f+(x-1)*d-y,offsetTop:b,top:b}})),w),z(H(ee,B(e=>e!==null),V(e=>e.length)),S),z(H(zr(T,E,w,te),B(([e,t,{items:n}])=>n.length>0&&t.height!==0&&e.height!==0),V(([e,t,{items:n},r])=>{let{bottom:i,top:a}=ns(e,r,t,n);return[a,i]}),wr(wi)),t);let ae=U(!1);z(H(l,kr(ae),V(([e,t])=>t||e!==0)),ae);let oe=Pr(H(zr(w,S),B(([{items:e}])=>e.length>0),kr(ae),B(([[e,t],n])=>{let r=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&e.offsetBottom===0&&e.items.length===t)&&r}),V(([[,e]])=>e-1),wr())),se=Pr(H(W(w),B(({items:e})=>e.length>0&&e[0].index===0),Tr(0),wr())),ce=Pr(H(W(w),kr(j),B(([{items:e},t])=>e.length>0&&!t),V(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),wr(Ci),Or(0)));z(ce,p.scrollSeekRangeChanged),z(H(D,kr(T,E,S,te),V(([e,t,n,r,i])=>{let a=Zi(e),{align:o,behavior:s,offset:c}=a,l=a.index;l===`LAST`&&(l=r-1),l=qo(0,l,Jo(r-1,l));let u=rs(t,i,n,l);return o===`end`?u=Yo(u-t.height+n.height):o===`center`&&(u=Yo(u-t.height/2+n.height/2)),c!==void 0&&c!==0&&(u+=c),{behavior:s,top:u}})),c);let le=Mr(H(w,V(e=>e.offsetBottom+e.bottom)),0);return z(H(b,V(e=>({height:e.visibleHeight,width:e.visibleWidth}))),T),{customScrollParent:g,data:ee,deviation:k,footerHeight:i,gap:te,headerHeight:a,increaseViewportBy:e,initialItemCount:C,itemDimensions:E,overscan:n,restoreStateFrom:A,scrollBy:o,scrollContainerState:s,scrollHeight:O,scrollTo:c,scrollToIndex:D,scrollTop:l,smoothScrollTargetReached:u,totalCount:S,useWindowScroll:_,viewportDimensions:T,windowScrollContainerState:v,windowScrollTo:y,windowViewportRect:b,...p,gridState:w,horizontalDirection:ie,initialTopMostItemIndex:re,totalListHeight:le,...f,endReached:oe,propsReady:h,rangeChanged:ce,startReached:se,stateChanged:ne,stateRestoreInProgress:j,...x}},_r(ga,ti,ua,Pa,Yi,Fa,Wr));function ts(e,t,n){return qo(1,Ko((e+n)/(Ko(t)+n)))}function ns(e,t,n,r){let{height:i}=n;if(i===void 0||r.length===0)return{bottom:0,top:0};let a=rs(e,t,n,r[0].index);return{bottom:rs(e,t,n,r[r.length-1].index)+i,top:a}}function rs(e,t,n,r){let i=Ko(r/ts(e.width,n.width,t.column)),a=i*n.height+qo(0,i-1)*t.row;return a>0?a+t.row:a}var is=Ir(([e,t])=>({...e,...t}),_r(es,Ir(()=>{let e=U(e=>`Item ${e}`),t=U({}),n=U(null),r=U(`virtuoso-grid-item`),i=U(`virtuoso-grid-list`),a=U(eo),o=U(`div`),s=U(mr),c=(e,n=null)=>Mr(H(t,V(t=>t[e]),wr()),n),l=U(!1),u=U(!1);return z(W(u),l),{components:t,computeItemKey:a,context:n,FooterComponent:c(`Footer`),HeaderComponent:c(`Header`),headerFooterTag:o,itemClassName:r,ItemComponent:c(`Item`,`div`),itemContent:e,listClassName:i,ListComponent:c(`List`,`div`),readyStateChanged:l,reportReadyState:u,ScrollerComponent:c(`Scroller`,`div`),scrollerRef:s,ScrollSeekPlaceholder:c(`ScrollSeekPlaceholder`,`div`)}}))),as=F.memo(function(){let e=fs(`gridState`),t=fs(`listClassName`),n=fs(`itemClassName`),r=fs(`itemContent`),i=fs(`computeItemKey`),a=fs(`isSeeking`),o=ps(`scrollHeight`),s=fs(`ItemComponent`),c=fs(`ListComponent`),l=fs(`ScrollSeekPlaceholder`),u=fs(`context`),d=ps(`itemDimensions`),f=ps(`gap`),p=fs(`log`),m=fs(`stateRestoreInProgress`),h=ps(`reportReadyState`),g=Yr(F.useMemo(()=>e=>{let t=e.parentElement.parentElement.scrollHeight;o(t);let n=e.firstChild;if(n!==null){let{height:e,width:t}=n.getBoundingClientRect();d({height:e,width:t})}f({column:gs(`column-gap`,getComputedStyle(e).columnGap,p),row:gs(`row-gap`,getComputedStyle(e).rowGap,p)})},[o,d,f,p]),!0,!1);return Xa(()=>{e.itemHeight>0&&e.itemWidth>0&&h(!0)},[e]),m?null:(0,I.jsx)(c,{className:t,ref:g,...po(c,u),"data-testid":`virtuoso-item-list`,style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(t=>{let o=i(t.index,t.data,u);return a?(0,I.jsx)(l,{...po(l,u),height:e.itemHeight,index:t.index,width:e.itemWidth},o):(0,F.createElement)(s,{...po(s,u),className:n,"data-index":t.index,key:o},r(t.index,t.data,u))})})}),os=F.memo(function(){let e=fs(`HeaderComponent`),t=ps(`headerHeight`),n=fs(`headerFooterTag`),r=Yr(F.useMemo(()=>e=>{t(G(e,`height`))},[t]),!0,!1),i=fs(`context`);return e==null?null:(0,I.jsx)(n,{ref:r,children:(0,I.jsx)(e,{...po(e,i)})})}),ss=F.memo(function(){let e=fs(`FooterComponent`),t=ps(`footerHeight`),n=fs(`headerFooterTag`),r=Yr(F.useMemo(()=>e=>{t(G(e,`height`))},[t]),!0,!1),i=fs(`context`);return e==null?null:(0,I.jsx)(n,{ref:r,children:(0,I.jsx)(e,{...po(e,i)})})}),cs=({children:e})=>{let t=F.useContext(Ka),n=ps(`itemDimensions`),r=ps(`viewportDimensions`),i=Yr(F.useMemo(()=>e=>{r(e.getBoundingClientRect())},[r]),!0,!1);return F.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),(0,I.jsx)(`div`,{ref:i,style:lo(!1),children:e})},ls=({children:e})=>{let t=F.useContext(Ka),n=ps(`windowViewportRect`),r=ps(`itemDimensions`),i=fs(`customScrollParent`),a=fs(`useWindowScroll`),o=ei(n,i,!1);return F.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),(0,I.jsx)(`div`,{ref:o,style:uo(!1,a),children:e})},{Component:us,useEmitter:ds,useEmitterValue:fs,usePublisher:ps}=Wa(is,{optional:{context:`context`,totalCount:`totalCount`,overscan:`overscan`,itemContent:`itemContent`,components:`components`,computeItemKey:`computeItemKey`,data:`data`,initialItemCount:`initialItemCount`,scrollSeekConfiguration:`scrollSeekConfiguration`,headerFooterTag:`headerFooterTag`,listClassName:`listClassName`,itemClassName:`itemClassName`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`,restoreStateFrom:`restoreStateFrom`,initialTopMostItemIndex:`initialTopMostItemIndex`,increaseViewportBy:`increaseViewportBy`},methods:{scrollTo:`scrollTo`,scrollBy:`scrollBy`,scrollToIndex:`scrollToIndex`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,stateChanged:`stateChanged`,readyStateChanged:`readyStateChanged`}},F.memo(function({...e}){let t=fs(`useWindowScroll`),n=fs(`customScrollParent`),r=n||t?hs:ms,i=n||t?ls:cs,a=fs(`context`);return(0,I.jsx)(r,{...e,...po(r,a),children:(0,I.jsxs)(i,{children:[(0,I.jsx)(os,{}),(0,I.jsx)(as,{}),(0,I.jsx)(ss,{})]})})})),ms=_o({useEmitter:ds,useEmitterValue:fs,usePublisher:ps}),hs=vo({useEmitter:ds,useEmitterValue:fs,usePublisher:ps});function gs(e,t,n){return t!==`normal`&&t?.endsWith(`px`)!==!0&&n(`${e} was not resolved to pixel value correctly`,t,Vr.WARN),t===`normal`?0:parseInt(t??`0`,10)}function _s(e){if(e.type===`wheel`)return(e.deltaY??0)<0?`away`:(e.deltaY??0)>0?`toward`:void 0;if(e.type===`keydown`){if([`ArrowUp`,`PageUp`,`Home`].includes(e.key??``)||e.key===` `&&e.shiftKey)return`away`;if([`ArrowDown`,`PageDown`,`End`,` `].includes(e.key??``))return`toward`}}function vs(e){if(!(!e.hasUserScrollIntent||e.previousScrollTop===void 0)){if(e.scrollTop<e.previousScrollTop-1)return`away`;if(e.scrollTop>e.previousScrollTop+1)return`toward`}}function ys(e,t){if(t!==void 0&&e!==void 0&&t!==e)return t>e?`away`:`toward`}function bs(e){if(e.button===1)return`middle`;if(e.button!==0||!e.targetIsScroller||e.clientX===void 0||e.scrollerRight===void 0)return;let t=Math.max(12,e.verticalScrollbarWidth??0);return e.clientX>=e.scrollerRight-t?`scrollbar`:void 0}function xs(e,t){return e&&!t}function Ss(e,t){let n=t.length-e.length;if(n<=0)return 0;for(let r=0;r<e.length;r+=1)if(e[r]!==t[r+n])return 0;return n}function Cs({items:e,itemKeys:t,firstItemIndex:n,scrollTop:r,viewportHeight:i}){let a=r+i;return e.filter(e=>e.offset+e.size>r&&e.offset<a).sort((e,t)=>e.offset-t.offset).flatMap(e=>{let i=e.index-n,a=t[i];return a===void 0?[]:[{key:a,dataIndex:i,offset:e.offset-r}]})}function ws({anchors:e,nextKeys:t}){if(!e.length||!t.length)return;for(let n of e){let e=t.indexOf(n.key);if(e>=0)return Ts(e,n.offset)}let n=e[0];return Ts(Math.min(Math.max(n.dataIndex,0),t.length-1),n.offset)}function Ts(e,t){return{index:e,align:`start`,behavior:`auto`,offset:-t}}var Es=24,Ds=700,Os=120,ks=1500,As=3,js=1e6;function Ms({itemCount:e,itemKeys:t,isPrepending:n=!1,resetKey:r,contentKey:i,atBottomThreshold:a=Es,onAtTop:o,onNearTop:s,atTopThreshold:c=0,nearTopThreshold:l=0,onUserScrollIntent:u,onScrollbarDragChange:d,onVisibleAnchorChange:f}){let p=(0,F.useRef)(null),m=(0,F.useRef)(e),h=(0,F.useRef)(n);h.current=n;let g=(0,F.useRef)(!0),_=(0,F.useRef)(void 0),v=(0,F.useRef)(void 0),y=(0,F.useRef)(void 0),b=(0,F.useRef)(void 0),x=(0,F.useRef)(void 0),S=(0,F.useRef)(!1),C=(0,F.useRef)(void 0),w=(0,F.useRef)(!1),T=(0,F.useRef)(!1),E=(0,F.useRef)(void 0),D=(0,F.useRef)(void 0),O=(0,F.useRef)(void 0),k=(0,F.useRef)(void 0),ee=(0,F.useRef)(void 0),te=(0,F.useRef)(void 0),ne=(0,F.useRef)([]),A=(0,F.useRef)([]),j=(0,F.useRef)(void 0),re=(0,F.useRef)(t),M=(0,F.useRef)(js),N=(0,F.useRef)(js),ie=(0,F.useRef)({resetKey:r,itemKeys:t}),ae=(0,F.useRef)(!1),oe=(0,F.useRef)(!1),se=(0,F.useRef)(!1),[ce,le]=(0,F.useState)(!0),[ue,de]=(0,F.useState)(!1),[P,fe]=(0,F.useState)(null),pe=ie.current;if(!Object.is(pe.resetKey,r))M.current=js,ae.current=!1,oe.current=!1;else{let e=Ss(pe.itemKeys,t);ae.current=e>0,e>0&&(M.current-=e,oe.current=!0)}ie.current={resetKey:r,itemKeys:t};let me=M.current;(0,F.useLayoutEffect)(()=>{m.current=e},[e]);let he=(0,F.useCallback)((e,t=!0)=>{let n=g.current;g.current=e,e&&(!n&&t&&f?.(void 0),T.current=!1,v.current!==void 0&&cancelAnimationFrame(v.current),v.current=void 0),le(e)},[f]),ge=(0,F.useCallback)(e=>{se.current!==e&&(se.current=e,de(e))},[]),_e=(0,F.useCallback)(e=>{let t=e<=c;return ge(t),t},[c,ge]),ve=(0,F.useCallback)(()=>{if(!P||g.current)return;let e=Is(P,re.current);A.current=e.length?e:Cs({items:ne.current,itemKeys:re.current,firstItemIndex:N.current,scrollTop:Ps(P),viewportHeight:Fs(P)});let t=A.current[0];return f?.(t),t},[f,P]),ye=(0,F.useCallback)(e=>{ne.current=e},[]),be=(0,F.useCallback)((e=!1)=>{if(g.current||w.current||O.current!==void 0||oe.current&&!e)return;let t=j.current??A.current,n=re.current,r=ws({anchors:t,nextKeys:n});if(!r)return;let i=()=>{if(g.current||w.current||O.current!==void 0)return!1;let e=!!(P&&Ls(P,r,t,n));return!e&&!oe.current&&p.current?.scrollToIndex(r),e},a=i();oe.current&&!a||(v.current!==void 0&&cancelAnimationFrame(v.current),v.current=requestAnimationFrame(()=>{i(),v.current=requestAnimationFrame(()=>{v.current=void 0,i()})}))},[P]),xe=(0,F.useCallback)(()=>{g.current||(ve(),j.current=A.current,w.current=!1)},[ve]),Se=(0,F.useCallback)(e=>({startIndex:Math.max(0,e.startIndex-M.current),endIndex:Math.max(0,e.endIndex-M.current)}),[]),Ce=(0,F.useCallback)(()=>{_.current!==void 0&&(cancelAnimationFrame(_.current),_.current=void 0)},[]),we=(0,F.useCallback)(e=>{let t=re.current,n=t.indexOf(e.key);if(n<0)return!1;he(!1),w.current=!1,A.current=[{...e,dataIndex:n}],j.current=A.current,Ce();let r={index:n,align:`start`,behavior:`auto`,offset:-e.offset},i=()=>{g.current||P&&Ls(P,r,A.current,t)||p.current?.scrollToIndex(r)};return p.current?.scrollToIndex(r),v.current!==void 0&&cancelAnimationFrame(v.current),v.current=requestAnimationFrame(()=>{i(),v.current=requestAnimationFrame(()=>{v.current=void 0,i()})}),!0},[Ce,P,he]),Te=(0,F.useCallback)(()=>{!s||!P||x.current===void 0&&(x.current=requestAnimationFrame(()=>{x.current=void 0,!(!s||!P)&&Ps(P)<=l&&(ve(),j.current=A.current,s())}))},[ve,l,s,P]),Ee=(0,F.useCallback)((e=`auto`)=>{Ce(),_.current=requestAnimationFrame(()=>{_.current=void 0,!(!g.current||m.current<1)&&(p.current?.autoscrollToBottom(),P&&zs(P),requestAnimationFrame(()=>{g.current&&P&&zs(P)}))})},[Ce,P]),De=(0,F.useCallback)(()=>{!o||!P||b.current===void 0&&(b.current=requestAnimationFrame(()=>{b.current=void 0,!(!o||!P)&&_e(Ps(P))&&(ve(),j.current=A.current,o())}))},[ve,o,P,_e]),Oe=(0,F.useCallback)(()=>P?_e(Ps(P)):!1,[P,_e]),ke=(0,F.useCallback)((e=`auto`)=>{he(!0),Ee(e)},[Ee,he]),Ae=(0,F.useCallback)((e,t=`center`,n=`auto`,r={})=>{he(!1),w.current=!0,Ce(),requestAnimationFrame(()=>{if(n!==`fast-smooth`){p.current?.scrollToIndex({index:e,align:t,behavior:n});return}if(r.stagingAlign){p.current?.scrollToIndex({index:e,align:r.stagingAlign,behavior:`auto`}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{p.current?.scrollToIndex({index:e,align:t,behavior:`smooth`})})});return}let i=r.fromIndex,a=Math.abs(typeof i==`number`?i-e:0),o=r.stagingDistance??As;if(typeof i!=`number`||a<=o){p.current?.scrollToIndex({index:e,align:t,behavior:`smooth`});return}let s=m.current-1,c=e<i?Math.min(s,e+o):Math.max(0,e-o);p.current?.scrollToIndex({index:c,align:t,behavior:`auto`}),requestAnimationFrame(()=>{p.current?.scrollToIndex({index:e,align:t,behavior:`smooth`})})})},[Ce,he]),je=(0,F.useCallback)((e,t)=>{S.current=!0;let n=t??_s(Vs(e));u?.(e,n),C.current=n,w.current=!0,n===`away`?(T.current=!1,Ce(),he(!1),ve()):n===`toward`&&(T.current=!0,P&&Ns(P,1)&&he(!0)),n!==`away`&&P&&!Ns(P,a)&&(he(!1),ve());let r=P?Ps(P):void 0;r!==void 0&&_e(r)?De():Bs(e)&&r!==void 0&&r<=l&&Te(),E.current!==void 0&&window.clearTimeout(E.current),E.current=window.setTimeout(()=>{S.current=!1,C.current=void 0,E.current=void 0},Ds)},[a,ve,Ce,l,u,De,Te,P,he,_e]),Me=(0,F.useCallback)(e=>{let t=O.current;!t||e&&t!==e||(O.current=void 0,k.current!==void 0&&window.clearTimeout(k.current),k.current=void 0,t===`scrollbar`&&(ve(),j.current=A.current,d?.(!1)))},[ve,d]),Ne=(0,F.useCallback)(()=>{if(!P)return;let e=Ps(P),t=te.current;te.current=e;let n=O.current,r=S.current||n!==void 0,i=vs({hasUserScrollIntent:r,previousScrollTop:t,scrollTop:e});i&&n&&(C.current=i,u?.(void 0,i)),n===`middle`&&(k.current!==void 0&&window.clearTimeout(k.current),k.current=window.setTimeout(()=>Me(`middle`),ks));let o=i===`away`;o?T.current=!1:i===`toward`&&C.current===`toward`&&(T.current=!0);let s=r||o||!g.current;if(w.current&&h.current&&j.current!==void 0&&(ve(),j.current=A.current),w.current&&(D.current!==void 0&&window.clearTimeout(D.current),D.current=window.setTimeout(()=>{ve(),h.current&&j.current!==void 0&&(j.current=A.current),w.current=!1,D.current=void 0},Os)),_e(e)?r&&C.current===`away`&&De():s&&e<=l&&Te(),Ns(P,a)){xs(T.current,o)&&he(!0);return}r&&he(!1)},[a,ve,Me,l,u,De,Te,P,he,_e]);(0,F.useLayoutEffect)(()=>{if(!P||typeof MutationObserver>`u`)return;let e=P instanceof Window?document.scrollingElement:P;if(!e)return;let t=()=>{if(g.current){zs(P);return}be(!0)},n=typeof ResizeObserver>`u`?void 0:new ResizeObserver(t),r=()=>{let t=e.querySelector(`[data-testid="virtuoso-item-list"]`);t&&n?.observe(t)},i=new MutationObserver(()=>{r(),t()});return r(),i.observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:[`style`,`data-index`,`data-item-index`]}),()=>{i.disconnect(),n?.disconnect()}},[be,P]),(0,F.useEffect)(()=>{if(!P)return;let e=P,t=e=>{let t=e instanceof KeyboardEvent?e.key:``;t===`Escape`&&Me(`middle`),[`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `].includes(t)&&(Me(`middle`),je(e))},n=t=>{if(!(t instanceof PointerEvent))return;let n=Hs(t,e);if(!n){t.button===0&&Me(`middle`);return}if(n===`middle`&&O.current===`middle`){Me(`middle`);return}O.current=n,n===`scrollbar`&&d?.(!0),je(t)},r=()=>Me(`scrollbar`),i=e=>{ee.current=Us(e)},a=e=>{Me(`middle`);let t=Us(e),n=ee.current;ee.current=t,je(e,ys(n,t))},o=e=>{Me(`middle`),je(e)};return e.addEventListener(`wheel`,o,{passive:!0}),e.addEventListener(`touchstart`,i,{passive:!0}),e.addEventListener(`touchmove`,a,{passive:!0}),e.addEventListener(`pointerdown`,n,{passive:!0}),e.addEventListener(`keydown`,t),e.addEventListener(`scroll`,Ne,{passive:!0}),window.addEventListener(`pointerup`,r,{passive:!0}),window.addEventListener(`pointercancel`,r,{passive:!0}),()=>{e.removeEventListener(`wheel`,o),e.removeEventListener(`touchstart`,i),e.removeEventListener(`touchmove`,a),e.removeEventListener(`pointerdown`,n),e.removeEventListener(`keydown`,t),e.removeEventListener(`scroll`,Ne),window.removeEventListener(`pointerup`,r),window.removeEventListener(`pointercancel`,r)}},[Me,je,d,P,Ne]),(0,F.useLayoutEffect)(()=>{te.current=void 0,D.current!==void 0&&window.clearTimeout(D.current),D.current=void 0,w.current=!1,A.current=[],j.current=void 0,ge(!1),he(!0,!1),Ee(`auto`)},[r,Ee,ge,he]);let Pe=(0,F.useCallback)(()=>{y.current!==void 0&&cancelAnimationFrame(y.current),y.current=requestAnimationFrame(()=>{y.current=requestAnimationFrame(()=>{y.current=void 0,oe.current=!1,be()})})},[be]);return(0,F.useLayoutEffect)(()=>{let e=ae.current;return ae.current=!1,re.current=t,N.current=M.current,!g.current&&j.current!==void 0&&(w.current=!1),g.current?Ee(`auto`):e?Pe():be(),j.current=void 0,()=>{!g.current&&j.current===void 0&&(j.current=A.current)}},[i,e,t,be,Pe,Ee]),(0,F.useEffect)(()=>()=>{Ce(),v.current!==void 0&&cancelAnimationFrame(v.current),y.current!==void 0&&cancelAnimationFrame(y.current),b.current!==void 0&&cancelAnimationFrame(b.current),x.current!==void 0&&cancelAnimationFrame(x.current),E.current!==void 0&&window.clearTimeout(E.current),D.current!==void 0&&window.clearTimeout(D.current),k.current!==void 0&&window.clearTimeout(k.current)},[Ce]),{virtuosoRef:p,firstItemIndex:me,itemsRendered:ye,normalizeRange:Se,isSticky:ce,isAtTop:ue,isScrolledToTop:Oe,captureVisibleAnchor:ve,prepareForPrepend:xe,restoreAnchor:we,stickToBottom:ke,scrollToIndex:Ae,scrollerRef:fe,atBottomStateChange:(0,F.useCallback)(e=>{if(e){xs(T.current,!1)&&he(!0);return}S.current&&he(!1)},[he]),atBottomThreshold:a,followOutput:(0,F.useCallback)(()=>g.current?`auto`:!1,[]),totalListHeightChanged:(0,F.useCallback)(()=>{g.current?Ee(`auto`):oe.current?Pe():be()},[be,Pe,Ee])}}function Ns(e,t){let n=e instanceof Window?document.scrollingElement:e;return!n||n.scrollHeight-n.scrollTop-n.clientHeight<=t}function Ps(e){return(e instanceof Window?document.scrollingElement:e)?.scrollTop??0}function Fs(e){return(e instanceof Window?document.scrollingElement:e)?.clientHeight??0}function Is(e,t){let n=e instanceof Window?document:e,r=e instanceof Window?0:e.getBoundingClientRect().top,i=r+Fs(e);return[...n.querySelectorAll(`[data-index][data-item-index]`)].flatMap(e=>{let n=Number(e.dataset.index),a=Number.isInteger(n)?t[n]:void 0;if(a===void 0)return[];let o=e.getBoundingClientRect();return o.bottom<=r||o.top>=i?[]:[{key:a,dataIndex:n,offset:o.top-r}]}).sort((e,t)=>e.offset-t.offset)}function Ls(e,t,n,r){let i=n.find(e=>r.indexOf(e.key)===t.index);if(!i)return!1;let a=e instanceof Window?document:e,o=[...a.querySelectorAll(`[data-row-id]`)].find(e=>e.dataset.rowId===i.key)?.closest(`[data-index][data-item-index]`)??a.querySelector(`[data-index="${t.index}"][data-item-index]`);if(!o)return!1;let s=e instanceof Window?0:e.getBoundingClientRect().top,c=o.getBoundingClientRect().top-s-i.offset;return Math.abs(c)>.5&&Rs(e,Ps(e)+c),!0}function Rs(e,t){let n=e instanceof Window?document.scrollingElement:e;n&&(n.scrollTop=t)}function zs(e){let t=e instanceof Window?document.scrollingElement:e;t&&(t.scrollTop=t.scrollHeight)}function Bs(e){return e instanceof WheelEvent?e.deltaY<0:e instanceof KeyboardEvent?[`ArrowUp`,`PageUp`,`Home`].includes(e.key)||e.key===` `&&e.shiftKey:e?.type===`touchmove`}function Vs(e){return e instanceof WheelEvent?{type:`wheel`,deltaY:e.deltaY}:e instanceof KeyboardEvent?{type:`keydown`,key:e.key,shiftKey:e.shiftKey}:{type:e?.type}}function Hs(e,t){let n=t instanceof Window?document.scrollingElement:t,r=n?.getBoundingClientRect();return bs({button:e.button,targetIsScroller:e.target===t,clientX:e.clientX,scrollerRight:r?.right,verticalScrollbarWidth:n?n.offsetWidth-n.clientWidth:void 0})}function Us(e){if(e instanceof TouchEvent)return e.touches[0]?.clientY}function Ws(e,t=`done`,n=!1){if(!e)return t===`running`?`running`:t===`error`?`failed`:`completed`;if(n)return t===`error`?`failed`:`completed`;let r=[e.localStatus,e.aggregateStatus];return r.some(Qs)?`cancelled`:e.hasError||e.hasErrorDescendant||r.some(Zs)?`failed`:e.isSettled===!1||e.isTreeActive||e.isLocalActive||e.hasActiveDescendant||r.some(Ys)||t===`running`&&r.every(Xs)?`running`:`completed`}function Gs(e,t,n){return ec(nc((rc(e)?e:void 0)?.subagentName)??$s(t)??nc(n)??nc(t)??`Subagent`)}function Ks(e){if(typeof e==`string`)return tc(e);if(rc(e)){for(let t of[`message`,`task`,`prompt`,`query`]){let n=tc(e[t]);if(n)return n}return Ks(e.arguments)}}function qs(e,t=180){let n=Ks(e)?.replace(/\s+/g,` `).trim();if(!(!n||t<1))return n.length<=t?n:`${n.slice(0,Math.max(1,t-1)).trimEnd()}…`}function Js(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m ${i}s`:`${r}m ${i}s`}function Ys(e){return[`queued`,`starting`,`running`,`streaming`,`waiting`,`blocked`,`retrying`,`compacting`,`pausing`,`paused`].includes(e)}function Xs(e){return e===`idle`||e===`unknown`}function Zs(e){return e===`error`}function Qs(e){return e===`cancelled`||e===`interrupted`||e===`disposed`}function $s(e){let t=tc(e);if(t)return t.replace(/^pibo_subagent_/,``)}function ec(e){return e.replace(/^pibo_subagent_/,``).split(/[\s_-]+/).filter(Boolean).map(e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(` `)||`Subagent`}function tc(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function nc(e){return tc(e)}function rc(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q.apply(null,arguments)}function ic(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ac={},oc=(0,F.createContext)(ac),sc=(e,t)=>q({},e,t),cc=()=>(0,F.useContext)(oc),lc=(0,F.createContext)(()=>{});lc.displayName=`JVR.DispatchShowTools`;function uc(){return(0,F.useReducer)(sc,ac)}function dc(){return(0,F.useContext)(lc)}var fc=e=>{var t=e.initial,n=e.dispatch,r=e.children;return(0,I.jsx)(oc.Provider,{value:t,children:(0,I.jsx)(lc.Provider,{value:n,children:r})})};fc.displayName=`JVR.ShowTools`;var pc={},mc=(0,F.createContext)(pc),hc=(e,t)=>q({},e,t),gc=()=>(0,F.useContext)(mc),_c=(0,F.createContext)(()=>{});_c.displayName=`JVR.DispatchExpands`;function vc(){return(0,F.useReducer)(hc,pc)}function yc(){return(0,F.useContext)(_c)}var bc=e=>{var t=e.initial,n=e.dispatch,r=e.children;return(0,I.jsx)(mc.Provider,{value:t,children:(0,I.jsx)(_c.Provider,{value:n,children:r})})};bc.displayName=`JVR.Expands`;var xc={Str:{as:`span`,"data-type":`string`,style:{color:`var(--w-rjv-type-string-color, #cb4b16)`},className:`w-rjv-type`,children:`string`},Url:{as:`a`,style:{color:`var(--w-rjv-type-url-color, #0969da)`},"data-type":`url`,className:`w-rjv-type`,children:`url`},Undefined:{style:{color:`var(--w-rjv-type-undefined-color, #586e75)`},as:`span`,"data-type":`undefined`,className:`w-rjv-type`,children:`undefined`},Null:{style:{color:`var(--w-rjv-type-null-color, #d33682)`},as:`span`,"data-type":`null`,className:`w-rjv-type`,children:`null`},Map:{style:{color:`var(--w-rjv-type-map-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`map`,className:`w-rjv-type`,children:`Map`},Nan:{style:{color:`var(--w-rjv-type-nan-color, #859900)`},as:`span`,"data-type":`nan`,className:`w-rjv-type`,children:`NaN`},Bigint:{style:{color:`var(--w-rjv-type-bigint-color, #268bd2)`},as:`span`,"data-type":`bigint`,className:`w-rjv-type`,children:`bigint`},Int:{style:{color:`var(--w-rjv-type-int-color, #268bd2)`},as:`span`,"data-type":`int`,className:`w-rjv-type`,children:`int`},Set:{style:{color:`var(--w-rjv-type-set-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`set`,className:`w-rjv-type`,children:`Set`},Float:{style:{color:`var(--w-rjv-type-float-color, #859900)`},as:`span`,"data-type":`float`,className:`w-rjv-type`,children:`float`},True:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},False:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},Date:{style:{color:`var(--w-rjv-type-date-color, #268bd2)`},as:`span`,"data-type":`date`,className:`w-rjv-type`,children:`date`}},Sc=(0,F.createContext)(xc),Cc=(e,t)=>q({},e,t),wc=()=>(0,F.useContext)(Sc),Tc=(0,F.createContext)(()=>{});Tc.displayName=`JVR.DispatchTypes`;function Ec(){return(0,F.useReducer)(Cc,xc)}function Dc(){return(0,F.useContext)(Tc)}function Oc(e){var t=e.initial,n=e.dispatch,r=e.children;return(0,I.jsx)(Sc.Provider,{value:t,children:(0,I.jsx)(Tc.Provider,{value:n,children:r})})}Oc.displayName=`JVR.Types`;var kc=[`style`];function Ac(e){var t=e.style,n=ic(e,kc),r=q({cursor:`pointer`,height:`1em`,width:`1em`,userSelect:`none`,display:`inline-flex`},t);return(0,I.jsx)(`svg`,q({viewBox:`0 0 24 24`,fill:`var(--w-rjv-arrow-color, currentColor)`,style:r},n,{children:(0,I.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`})}))}Ac.displayName=`JVR.TriangleArrow`;var jc={Arrow:{as:`span`,className:`w-rjv-arrow`,style:{transform:`rotate(0deg)`,transition:`all 0.3s`},children:(0,I.jsx)(Ac,{})},Colon:{as:`span`,style:{color:`var(--w-rjv-colon-color, var(--w-rjv-color))`,marginLeft:0,marginRight:2},className:`w-rjv-colon`,children:`:`},Quote:{as:`span`,style:{color:`var(--w-rjv-quotes-color, #236a7c)`},className:`w-rjv-quotes`,children:`"`},ValueQuote:{as:`span`,style:{color:`var(--w-rjv-quotes-string-color, #cb4b16)`},className:`w-rjv-quotes`,children:`"`},BracketsLeft:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-start`,children:`[`},BracketsRight:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-end`,children:`]`},BraceLeft:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-start`,children:`{`},BraceRight:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-end`,children:`}`}},Mc=(0,F.createContext)(jc),Nc=(e,t)=>q({},e,t),Pc=()=>(0,F.useContext)(Mc),Fc=(0,F.createContext)(()=>{});Fc.displayName=`JVR.DispatchSymbols`;function Ic(){return(0,F.useReducer)(Nc,jc)}function Lc(){return(0,F.useContext)(Fc)}var Rc=e=>{var t=e.initial,n=e.dispatch,r=e.children;return(0,I.jsx)(Mc.Provider,{value:t,children:(0,I.jsx)(Fc.Provider,{value:n,children:r})})};Rc.displayName=`JVR.Symbols`;var zc={Copied:{className:`w-rjv-copied`,style:{height:`1em`,width:`1em`,cursor:`pointer`,verticalAlign:`middle`,marginLeft:5}},CountInfo:{as:`span`,className:`w-rjv-object-size`,style:{color:`var(--w-rjv-info-color, #0000004d)`,paddingLeft:8,fontStyle:`italic`}},CountInfoExtra:{as:`span`,className:`w-rjv-object-extra`,style:{paddingLeft:8}},Ellipsis:{as:`span`,style:{cursor:`pointer`,color:`var(--w-rjv-ellipsis-color, #cb4b16)`,userSelect:`none`},className:`w-rjv-ellipsis`,children:`...`},Row:{as:`div`,className:`w-rjv-line`},KeyName:{as:`span`,className:`w-rjv-object-key`}},Bc=(0,F.createContext)(zc),Vc=(e,t)=>q({},e,t),Hc=()=>(0,F.useContext)(Bc),Uc=(0,F.createContext)(()=>{});Uc.displayName=`JVR.DispatchSection`;function Wc(){return(0,F.useReducer)(Vc,zc)}function Gc(){return(0,F.useContext)(Uc)}var Kc=e=>{var t=e.initial,n=e.dispatch,r=e.children;return(0,I.jsx)(Bc.Provider,{value:t,children:(0,I.jsx)(Uc.Provider,{value:n,children:r})})};Kc.displayName=`JVR.Section`;var qc={objectSortKeys:!1,indentWidth:15},Jc=(0,F.createContext)(qc);Jc.displayName=`JVR.Context`;var Yc=(0,F.createContext)(()=>{});Yc.displayName=`JVR.DispatchContext`;function Xc(e,t){return q({},e,t)}var Zc=()=>(0,F.useContext)(Jc),Qc=e=>{var t=e.children,n=e.initialState,r=e.initialTypes,i=(0,F.useReducer)(Xc,Object.assign({},qc,n)),a=i[0],o=i[1],s=uc(),c=s[0],l=s[1],u=vc(),d=u[0],f=u[1],p=Ec(),m=p[0],h=p[1],g=Ic(),_=g[0],v=g[1],y=Wc(),b=y[0],x=y[1];return(0,F.useEffect)(()=>o(q({},n)),[n]),(0,I.jsx)(Jc.Provider,{value:a,children:(0,I.jsx)(Yc.Provider,{value:o,children:(0,I.jsx)(fc,{initial:c,dispatch:l,children:(0,I.jsx)(bc,{initial:d,dispatch:f,children:(0,I.jsx)(Oc,{initial:q({},m,r),dispatch:h,children:(0,I.jsx)(Rc,{initial:_,dispatch:v,children:(0,I.jsx)(Kc,{initial:b,dispatch:x,children:t})})})})})})})};Qc.displayName=`JVR.Provider`;function $c(e){if(e==null)throw TypeError(`Cannot destructure `+e)}var el=[`isNumber`,`value`,`parentValue`,`keyName`,`keys`],tl=[`as`,`render`],nl=[`as`,`render`],rl=[`as`,`render`],il=[`as`,`style`,`render`],al=[`as`,`render`],ol=[`as`,`render`],sl=[`as`,`render`],cl=[`as`,`render`],ll=e=>{var t=Pc().Quote,n=t===void 0?{}:t,r=e.isNumber,i=e.value,a=e.parentValue,o=e.keyName,s=e.keys,c=ic(e,el);if(r)return null;var l=n.as,u=n.render,d=ic(n,tl),f=l||`span`,p=q({},c,d);return typeof p.children==`string`&&(p.children=p.children.trim()||void 0),u&&typeof u==`function`&&u(p,{value:i,parentValue:a,keyName:o,keys:s||(o?[o]:[])})||(0,I.jsx)(f,q({},p))};ll.displayName=`JVR.Quote`;var ul=e=>{var t=Pc().ValueQuote,n=t===void 0?{}:t,r=q({},($c(e),e)),i=n.as,a=n.render,o=ic(n,nl),s=i||`span`,c=q({},r,o);return a&&typeof a==`function`&&a(c,{})||(0,I.jsx)(s,q({},c))};ul.displayName=`JVR.ValueQuote`;var dl=e=>{var t=e.value,n=e.parentValue,r=e.keyName,i=e.keys,a=Pc().Colon,o=a===void 0?{}:a,s=o.as,c=o.render,l=ic(o,rl),u=s||`span`;return c&&typeof c==`function`&&c(l,{value:t,parentValue:n,keyName:r,keys:i||(r?[r]:[])})||(0,I.jsx)(u,q({},l))};dl.displayName=`JVR.Colon`;var fl=e=>{var t=Pc().Arrow,n=t===void 0?{}:t,r=gc(),i=e.expandKey,a=e.style,o=e.value,s=e.parentValue,c=e.keyName,l=e.keys,u=!!r[i],d=n.as,f=n.style,p=n.render,m=ic(n,il),h=d||`span`,g=p&&typeof p==`function`,_=q({},m,{"data-expanded":u,style:q({},f,a)});return g&&p(_,{value:o,parentValue:s,keyName:c,keys:l||(c?[c]:[])})||(0,I.jsx)(h,q({},m,{style:q({},f,a)}))};fl.displayName=`JVR.Arrow`;var pl=e=>{var t=e.isBrackets,n=e.value,r=e.parentValue,i=e.keyName,a=e.keys,o=Pc(),s=o.BracketsLeft,c=s===void 0?{}:s,l=o.BraceLeft,u=l===void 0?{}:l,d={value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])};if(t){var f=c.as,p=c.render,m=ic(c,al),h=f||`span`;return p&&typeof p==`function`&&p(m,d)||(0,I.jsx)(h,q({},m))}var g=u.as,_=u.render,v=ic(u,ol),y=g||`span`;return _&&typeof _==`function`&&_(v,d)||(0,I.jsx)(y,q({},v))};pl.displayName=`JVR.BracketsOpen`;var ml=e=>{var t=e.isBrackets,n=e.isVisiable,r=e.value,i=e.parentValue,a=e.keyName,o={value:r,parentValue:i,keyName:a,keys:e.keys||(a?[a]:[])};if(!n)return null;var s=Pc(),c=s.BracketsRight,l=c===void 0?{}:c,u=s.BraceRight,d=u===void 0?{}:u;if(t){var f=l.as,p=l.render,m=ic(l,sl),h=f||`span`;return p&&typeof p==`function`&&p(m,o)||(0,I.jsx)(h,q({},m))}var g=d.as,_=d.render,v=ic(d,cl),y=g||`span`;return _&&typeof _==`function`&&_(v,o)||(0,I.jsx)(y,q({},v))};ml.displayName=`JVR.BracketsClose`;var hl=e=>{var t=e.keyName,n=e.value,r=e.expandKey,i=e.parentValue,a=e.level,o=e.keys,s=o===void 0?[]:o,c=gc(),l=Zc(),u=l.collapsed,d=l.shouldExpandNodeInitially,f=typeof u==`boolean`?u:typeof u==`number`&&a>u,p=c[r]??(!d&&f),m=d&&d(!p,{value:n,keys:s,level:a,keyName:t,parentValue:i});if(d&&u===!1){if(c[r]===void 0&&!m)return null}else if(c[r]===void 0&&m)return null;var h=Object.keys(n).length;if(p||h===0)return null;var g={paddingLeft:4},_={keyName:t,value:n,keys:s,parentValue:i},v=Array.isArray(n),y=n instanceof Set;return(0,I.jsx)(`div`,{style:g,children:(0,I.jsx)(ml,q({isBrackets:v||y},_,{isVisiable:!0}))})};hl.displayName=`JVR.NestedClose`;var gl=[`as`,`render`],_l=[`as`,`render`],vl=[`as`,`render`],yl=[`as`,`render`],bl=[`as`,`render`],xl=[`as`,`render`],Sl=[`as`,`render`],Cl=[`as`,`render`],wl=[`as`,`render`],Tl=[`as`,`render`],El=[`as`,`render`],Dl=[`as`,`render`],Ol=[`as`,`render`],kl=e=>{if(e===void 0)return`0n`;if(typeof e==`string`)try{e=BigInt(e)}catch{return`0n`}return e?e.toString()+`n`:`0n`},Al=e=>{var t=e.value,n=e.keyName,r=wc(),i=r.Set,a=i===void 0?{}:i,o=r.displayDataTypes;if(!(t instanceof Set)||!o)return null;var s=a.as,c=a.render,l=ic(a,gl);return c&&typeof c==`function`&&c(l,{type:`type`,value:t,keyName:n})||(0,I.jsx)(s||`span`,q({},l))};Al.displayName=`JVR.SetComp`;var jl=e=>{var t=e.value,n=e.keyName,r=wc(),i=r.Map,a=i===void 0?{}:i,o=r.displayDataTypes;if(!(t instanceof Map)||!o)return null;var s=a.as,c=a.render,l=ic(a,_l);return c&&typeof c==`function`&&c(l,{type:`type`,value:t,keyName:n})||(0,I.jsx)(s||`span`,q({},l))};jl.displayName=`JVR.MapComp`;var Ml={opacity:.75,paddingRight:4},Nl=e=>{var t=e.children,n=t===void 0?``:t,r=e.keyName,i=e.keys,a=wc(),o=a.Str,s=o===void 0?{}:o,c=a.displayDataTypes,l=Zc(),u=l.shortenTextAfterLength,d=u===void 0?30:u,f=l.stringEllipsis,p=f===void 0?`...`:f,m=s.as,h=s.render,g=ic(s,vl),_=n,v=(0,F.useState)(d&&_.length>d),y=v[0],b=v[1];(0,F.useEffect)(()=>b(d&&_.length>d),[d]);var x=m||`span`,S=q({},Ml,s.style||{});d>0&&(g.style=q({},g.style,{cursor:_.length<=d?`initial`:`pointer`}),_.length>d&&(g.onClick=()=>{b(!y)}));var C=y?``+_.slice(0,d)+p:_,w=h&&typeof h==`function`,T=w&&h(q({},g,{style:S}),{type:`type`,value:n,keyName:r,keys:i}),E=y?`w-rjv-value w-rjv-value-short`:`w-rjv-value`,D=w&&h(q({},g,{children:C,className:E}),{type:`value`,value:n,keyName:r,keys:i});return(0,I.jsxs)(F.Fragment,{children:[c&&(T||(0,I.jsx)(x,q({},g,{style:S}))),D||(0,I.jsxs)(F.Fragment,{children:[(0,I.jsx)(ul,{}),(0,I.jsx)(x,q({},g,{className:E,children:C})),(0,I.jsx)(ul,{})]})]})};Nl.displayName=`JVR.TypeString`;var Pl=e=>{var t=e.children,n=e.keyName,r=e.keys,i=wc(),a=i.True,o=a===void 0?{}:a,s=i.displayDataTypes,c=o.as,l=o.render,u=ic(o,yl),d=c||`span`,f=q({},Ml,o.style||{}),p=l&&typeof l==`function`,m=p&&l(q({},u,{style:f}),{type:`type`,value:t,keyName:n,keys:r}),h=p&&l(q({},u,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,I.jsxs)(F.Fragment,{children:[s&&(m||(0,I.jsx)(d,q({},u,{style:f}))),h||(0,I.jsx)(d,q({},u,{className:`w-rjv-value`,children:t?.toString()}))]})};Pl.displayName=`JVR.TypeTrue`;var Fl=e=>{var t=e.children,n=e.keyName,r=e.keys,i=wc(),a=i.False,o=a===void 0?{}:a,s=i.displayDataTypes,c=o.as,l=o.render,u=ic(o,bl),d=c||`span`,f=q({},Ml,o.style||{}),p=l&&typeof l==`function`,m=p&&l(q({},u,{style:f}),{type:`type`,value:t,keyName:n,keys:r}),h=p&&l(q({},u,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,I.jsxs)(F.Fragment,{children:[s&&(m||(0,I.jsx)(d,q({},u,{style:f}))),h||(0,I.jsx)(d,q({},u,{className:`w-rjv-value`,children:t?.toString()}))]})};Fl.displayName=`JVR.TypeFalse`;var Il=e=>{var t=e.children,n=e.keyName,r=e.keys,i=wc(),a=i.Float,o=a===void 0?{}:a,s=i.displayDataTypes,c=o.as,l=o.render,u=ic(o,xl),d=c||`span`,f=q({},Ml,o.style||{}),p=l&&typeof l==`function`,m=p&&l(q({},u,{style:f}),{type:`type`,value:t,keyName:n,keys:r}),h=p&&l(q({},u,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,I.jsxs)(F.Fragment,{children:[s&&(m||(0,I.jsx)(d,q({},u,{style:f}))),h||(0,I.jsx)(d,q({},u,{className:`w-rjv-value`,children:t?.toString()}))]})};Il.displayName=`JVR.TypeFloat`;var Ll=e=>{var t=e.children,n=e.keyName,r=e.keys,i=wc(),a=i.Int,o=a===void 0?{}:a,s=i.displayDataTypes,c=o.as,l=o.render,u=ic(o,Sl),d=c||`span`,f=q({},Ml,o.style||{}),p=l&&typeof l==`function`,m=p&&l(q({},u,{style:f}),{type:`type`,value:t,keyName:n,keys:r}),h=p&&l(q({},u,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,I.jsxs)(F.Fragment,{children:[s&&(m||(0,I.jsx)(d,q({},u,{style:f}))),h||(0,I.jsx)(d,q({},u,{className:`w-rjv-value`,children:t?.toString()}))]})};Ll.displayName=`JVR.TypeInt`;var Rl=e=>{var t=e.children,n=e.keyName,r=e.keys,i=wc(),a=i.Bigint,o=a===void 0?{}:a,s=i.displayDataTypes,c=o.as,l=o.render,u=ic(o,Cl),d=c||`span`,f=q({},Ml,o.style||{}),p=l&&typeof l==`function`,m=p&&l(q({},u,{style:f}),{type:`type`,value:t,keyName:n,keys:r}),h=p&&l(q({},u,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,I.jsxs)(F.Fragment,{children:[s&&(m||(0,I.jsx)(d,q({},u,{style:f}))),h||(0,I.jsx)(d,q({},u,{className:`w-rjv-value`,children:kl(t?.toString())}))]})};Rl.displayName=`JVR.TypeFloat`;var zl=e=>{var t=e.children,n=e.keyName,r=e.keys,i=wc(),a=i.Url,o=a===void 0?{}:a,s=i.displayDataTypes,c=o.as,l=o.render,u=ic(o,wl),d=c||`span`,f=q({},Ml,o.style),p=l&&typeof l==`function`,m=p&&l(q({},u,{style:f}),{type:`type`,value:t,keyName:n,keys:r}),h=p&&l(q({},u,{children:t?.href,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,I.jsxs)(F.Fragment,{children:[s&&(m||(0,I.jsx)(d,q({},u,{style:f}))),h||(0,I.jsxs)(`a`,q({href:t?.href,target:`_blank`},u,{className:`w-rjv-value`,children:[(0,I.jsx)(ul,{}),t?.href,(0,I.jsx)(ul,{})]}))]})};zl.displayName=`JVR.TypeUrl`;var Bl=e=>{var t=e.children,n=e.keyName,r=e.keys,i=wc(),a=i.Date,o=a===void 0?{}:a,s=i.displayDataTypes,c=o.as,l=o.render,u=ic(o,Tl),d=c||`span`,f=q({},Ml,o.style||{}),p=l&&typeof l==`function`,m=p&&l(q({},u,{style:f}),{type:`type`,value:t,keyName:n,keys:r}),h=t instanceof Date?t.toLocaleString():t,g=p&&l(q({},u,{children:h,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,I.jsxs)(F.Fragment,{children:[s&&(m||(0,I.jsx)(d,q({},u,{style:f}))),g||(0,I.jsx)(d,q({},u,{className:`w-rjv-value`,children:h}))]})};Bl.displayName=`JVR.TypeDate`;var Vl=e=>{var t=e.children,n=e.keyName,r=e.keys,i=wc(),a=i.Undefined,o=a===void 0?{}:a,s=i.displayDataTypes,c=o.as,l=o.render,u=ic(o,El),d=c||`span`,f=q({},Ml,o.style||{}),p=l&&typeof l==`function`,m=p&&l(q({},u,{style:f}),{type:`type`,value:t,keyName:n,keys:r}),h=p&&l(q({},u,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,I.jsxs)(F.Fragment,{children:[s&&(m||(0,I.jsx)(d,q({},u,{style:f}))),h||(0,I.jsx)(d,q({},u,{className:`w-rjv-value`,children:`undefined`}))]})};Vl.displayName=`JVR.TypeUndefined`;var Hl=e=>{var t=e.children,n=e.keyName,r=e.keys,i=wc(),a=i.Null,o=a===void 0?{}:a,s=i.displayDataTypes,c=o.as,l=o.render,u=ic(o,Dl),d=c||`span`,f=q({},Ml,o.style||{}),p=l&&typeof l==`function`,m=p&&l(q({},u,{style:f}),{type:`type`,value:t,keyName:n,keys:r}),h=p&&l(q({},u,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,I.jsxs)(F.Fragment,{children:[s&&(m||(0,I.jsx)(d,q({},u,{style:f}))),h||(0,I.jsx)(d,q({},u,{className:`w-rjv-value`,children:`null`}))]})};Hl.displayName=`JVR.TypeNull`;var Ul=e=>{var t=e.children,n=e.keyName,r=e.keys,i=wc(),a=i.Nan,o=a===void 0?{}:a,s=i.displayDataTypes,c=o.as,l=o.render,u=ic(o,Ol),d=c||`span`,f=q({},Ml,o.style||{}),p=l&&typeof l==`function`,m=p&&l(q({},u,{style:f}),{type:`type`,value:t,keyName:n,keys:r}),h=p&&l(q({},u,{children:t?.toString(),className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,I.jsxs)(F.Fragment,{children:[s&&(m||(0,I.jsx)(d,q({},u,{style:f}))),h||(0,I.jsx)(d,q({},u,{className:`w-rjv-value`,children:`NaN`}))]})};Ul.displayName=`JVR.TypeNan`;var Wl=e=>Number(e)===e&&e%1!=0||isNaN(e),Gl=e=>{var t=e.value,n={keyName:e.keyName,keys:e.keys};return t instanceof URL?(0,I.jsx)(zl,q({},n,{children:t})):typeof t==`string`?(0,I.jsx)(Nl,q({},n,{children:t})):t===!0?(0,I.jsx)(Pl,q({},n,{children:t})):t===!1?(0,I.jsx)(Fl,q({},n,{children:t})):t===null?(0,I.jsx)(Hl,q({},n,{children:t})):t===void 0?(0,I.jsx)(Vl,q({},n,{children:t})):t instanceof Date?(0,I.jsx)(Bl,q({},n,{children:t})):typeof t==`number`&&isNaN(t)?(0,I.jsx)(Ul,q({},n,{children:t})):typeof t==`number`&&Wl(t)?(0,I.jsx)(Il,q({},n,{children:t})):typeof t==`bigint`?(0,I.jsx)(Rl,q({},n,{children:t})):typeof t==`number`?(0,I.jsx)(Ll,q({},n,{children:t})):null};Gl.displayName=`JVR.Value`;function Kl(e,t,n){var r=Lc(),i=[e.className,t.className].filter(Boolean).join(` `),a=q({},e,t,{className:i,style:q({},e.style,t.style),children:t.children||e.children});(0,F.useEffect)(()=>r({[n]:a}),[t])}function ql(e,t,n){var r=Dc(),i=[e.className,t.className].filter(Boolean).join(` `),a=q({},e,t,{className:i,style:q({},e.style,t.style),children:t.children||e.children});(0,F.useEffect)(()=>r({[n]:a}),[t])}function Jl(e,t,n){var r=Gc(),i=[e.className,t.className].filter(Boolean).join(` `),a=q({},e,t,{className:i,style:q({},e.style,t.style),children:t.children||e.children});(0,F.useEffect)(()=>r({[n]:a}),[t])}var Yl=[`as`,`render`],Xl=e=>{var t=Hc().KeyName;return Jl(t===void 0?{}:t,e,`KeyName`),null};Xl.displayName=`JVR.KeyName`;var Zl=e=>{var t=e.children,n=e.value,r=e.parentValue,i=e.keyName,a=e.keys,o={color:typeof t==`number`?`var(--w-rjv-key-number, #268bd2)`:`var(--w-rjv-key-string, #002b36)`},s=Hc().KeyName,c=s===void 0?{}:s,l=c.as,u=c.render,d=ic(c,Yl);d.style=q({},d.style,o);var f=l||`span`;return u&&typeof u==`function`&&u(q({},d,{children:t}),{value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])})||(0,I.jsx)(f,q({},d,{children:t}))};Zl.displayName=`JVR.KeyNameComp`;var Ql=[`children`,`value`,`parentValue`,`keyName`,`keys`],$l=[`as`,`render`,`children`],eu=e=>{var t=Hc().Row;return Jl(t===void 0?{}:t,e,`Row`),null};eu.displayName=`JVR.Row`;var tu=e=>{var t=e.children,n=e.value,r=e.parentValue,i=e.keyName,a=e.keys,o=ic(e,Ql),s=Hc().Row,c=s===void 0?{}:s,l=c.as,u=c.render;c.children;var d=ic(c,$l),f=l||`div`;return u&&typeof u==`function`&&u(q({},o,d,{children:t}),{value:n,keyName:i,parentValue:r,keys:a})||(0,I.jsx)(f,q({},o,d,{children:t}))};tu.displayName=`JVR.RowComp`;function nu(e){var t=(0,F.useRef)();return(0,F.useEffect)(()=>{t.current=e}),t.current}function ru(e){var t=e.value,n=e.highlightUpdates,r=e.highlightContainer,i=nu(t),a=(0,F.useMemo)(()=>{if(!n||i===void 0)return!1;if(typeof t!=typeof i)return!0;if(typeof t==`number`)return isNaN(t)&&isNaN(i)?!1:t!==i;if(Array.isArray(t)!==Array.isArray(i))return!0;if(typeof t==`object`||typeof t==`function`)return!1;if(t!==i)return!0},[n,t]);(0,F.useEffect)(()=>{r&&r.current&&a&&`animate`in r.current&&r.current.animate([{backgroundColor:`var(--w-rjv-update-color, #ebcb8b)`},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[a,t,r])}var iu=[`keyName`,`value`,`parentValue`,`expandKey`,`keys`,`beforeCopy`],au=[`as`,`render`],ou=e=>{var t=e.keyName,n=e.value,r=e.parentValue,i=e.expandKey,a=e.keys,o=e.beforeCopy,s=ic(e,iu),c=Zc(),l=c.onCopied,u=c.enableClipboard,d=c.beforeCopy,f=cc()[i],p=(0,F.useState)(!1),m=p[0],h=p[1],g=Hc().Copied,_=g===void 0?{}:g,v=_?.beforeCopy;if(u===!1||!f)return null;var y={style:{display:`inline-flex`},fill:m?`var(--w-rjv-copied-success-color, #28a745)`:`var(--w-rjv-copied-color, currentColor)`,onClick:e=>{e.stopPropagation();var s=``;s=typeof n==`number`&&n===1/0?`Infinity`:typeof n==`number`&&isNaN(n)?`NaN`:typeof n==`bigint`?kl(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,(e,t)=>typeof t==`bigint`?kl(t):t,2);var c=o||v||d;c&&typeof c==`function`&&(s=c(s,t,n,r,i,a)),l&&l(s,n),h(!0),(navigator.clipboard||{writeText(e){return new Promise((t,n)=>{var r=document.createElement(`textarea`);r.style.position=`absolute`,r.style.opacity=`0`,r.style.left=`-99999999px`,r.value=e,document.body.appendChild(r),r.select(),document.execCommand(`copy`)?t():n(),r.remove()})}}).writeText(s).then(()=>{var e=setTimeout(()=>{h(!1),clearTimeout(e)},3e3)}).catch(e=>{})}};_.as;var b=_.render,x=ic(_,au),S=q({},x,s,y,{style:q({},x.style,s.style,y.style)});return b&&typeof b==`function`&&b(q({},S,{"data-copied":m}),{value:n,keyName:t,keys:a,parentValue:r})||(m?(0,I.jsx)(`svg`,q({viewBox:`0 0 32 36`},S,{children:(0,I.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})):(0,I.jsx)(`svg`,q({viewBox:`0 0 32 36`},S,{children:(0,I.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})))};ou.displayName=`JVR.Copied`;function su(){var e=(0,F.useRef)(null);return e.current===null&&(e.current=`custom-id-`+Math.random().toString(36).substr(2,9)),e.current}var cu=e=>{var t=e.keyName,n=e.value,r=e.expandKey,i=r===void 0?``:r,a=e.level,o=e.keys,s=o===void 0?[]:o,c=e.parentValue,l=gc(),u=Zc(),d=u.objectSortKeys,f=u.indentWidth,p=u.collapsed,m=u.shouldExpandNodeInitially,h=typeof p==`boolean`?p:typeof p==`number`&&a>p,g=l[i]??(!m&&h),_=m&&m(!g,{value:n,keys:s,level:a,keyName:t,parentValue:c});if(m&&p===!1){if(l[i]===void 0&&!_)return null}else if(l[i]===void 0&&_)return null;if(g)return null;var v=Array.isArray(n)?Object.entries(n).map(e=>[Number(e[0]),e[1]]):Object.entries(n);return d&&(v=d===!0?v.sort((e,t)=>{var n=e[0],r=t[0];return typeof n==`string`&&typeof r==`string`?n.localeCompare(r):0}):v.sort((e,t)=>{var n=e[0],r=e[1],i=t[0],a=t[1];return typeof n==`string`&&typeof i==`string`?d(n,i,r,a):0})),(0,I.jsx)(`div`,{className:`w-rjv-wrap`,style:{borderLeft:`var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)`,paddingLeft:f,marginLeft:6},children:v.map((e,t)=>{var r=e[0],i=e[1];return(0,I.jsx)(uu,{parentValue:n,keyName:r,keys:[...s,r],value:i,level:a},t)})})};cu.displayName=`JVR.KeyValues`;var lu=e=>{var t=e.keyName,n=e.parentValue,r=e.keys,i=e.value,a=Zc().highlightUpdates,o=typeof t==`number`,s=(0,F.useRef)(null);ru({value:i,highlightUpdates:a,highlightContainer:s});var c={keyName:t,value:i,keys:r,parentValue:n};return(0,I.jsxs)(F.Fragment,{children:[(0,I.jsxs)(`span`,{ref:s,children:[(0,I.jsx)(ll,q({isNumber:o,"data-placement":`left`},c)),(0,I.jsx)(Zl,q({},c,{children:t})),(0,I.jsx)(ll,q({isNumber:o,"data-placement":`right`},c))]}),(0,I.jsx)(dl,q({},c))]})};lu.displayName=`JVR.KayName`;var uu=e=>{var t=e.keyName,n=e.value,r=e.parentValue,i=e.level,a=i===void 0?0:i,o=e.keys,s=o===void 0?[]:o,c=dc(),l=su(),u=Array.isArray(n),d=n instanceof Set,f=n instanceof Map,p=n instanceof Date,m=n instanceof URL;if(n&&typeof n==`object`&&!u&&!d&&!f&&!p&&!m||u||d||f){var h=d?Array.from(n):f?Object.fromEntries(n):n;return(0,I.jsx)(wu,{keyName:t,value:h,parentValue:r,initialValue:n,keys:s,level:a+1})}return(0,I.jsxs)(tu,q({className:`w-rjv-line`,value:n,keyName:t,keys:s,parentValue:r},{onMouseEnter:()=>c({[l]:!0}),onMouseLeave:()=>c({[l]:!1})},{children:[(0,I.jsx)(lu,{keyName:t,value:n,keys:s,parentValue:r}),(0,I.jsx)(Gl,{keyName:t,value:n,keys:s}),(0,I.jsx)(ou,{keyName:t,value:n,keys:s,parentValue:r,expandKey:l})]}))};uu.displayName=`JVR.KeyValuesItem`;var du=[`value`,`keyName`],fu=[`as`,`render`],pu=e=>{var t=Hc().CountInfoExtra;return Jl(t===void 0?{}:t,e,`CountInfoExtra`),null};pu.displayName=`JVR.CountInfoExtra`;var mu=e=>{var t=e.value,n=t===void 0?{}:t,r=e.keyName,i=ic(e,du),a=Hc().CountInfoExtra,o=a===void 0?{}:a,s=o.as,c=o.render,l=ic(o,fu);if(!c&&!l.children)return null;var u=s||`span`,d=c&&typeof c==`function`,f=q({},l,i);return d&&c(f,{value:n,keyName:r})||(0,I.jsx)(u,q({},f))};mu.displayName=`JVR.CountInfoExtraComps`;var hu=[`value`,`keyName`],gu=[`as`,`render`],_u=e=>{var t=Hc().CountInfo;return Jl(t===void 0?{}:t,e,`CountInfo`),null};_u.displayName=`JVR.CountInfo`;var vu=e=>{var t=e.value,n=t===void 0?{}:t,r=e.keyName,i=ic(e,hu),a=Zc().displayObjectSize,o=Hc().CountInfo,s=o===void 0?{}:o;if(!a)return null;var c=s.as,l=s.render,u=ic(s,gu),d=c||`span`;u.style=q({},u.style,e.style);var f=Object.keys(n).length;u.children||=f+` item`+(f===1?``:`s`);var p=q({},u,i);return l&&typeof l==`function`&&l(q({},p,{"data-length":f}),{value:n,keyName:r})||(0,I.jsx)(d,q({},p))};vu.displayName=`JVR.CountInfoComp`;var yu=[`as`,`render`],bu=e=>{var t=Hc().Ellipsis;return Jl(t===void 0?{}:t,e,`Ellipsis`),null};bu.displayName=`JVR.Ellipsis`;var xu=e=>{var t=e.isExpanded,n=e.value,r=e.keyName,i=Hc().Ellipsis,a=i===void 0?{}:i,o=a.as,s=a.render,c=ic(a,yu),l=o||`span`;return s&&typeof s==`function`&&s(q({},c,{"data-expanded":t}),{value:n,keyName:r})||(!t||typeof n==`object`&&Object.keys(n).length==0?null:(0,I.jsx)(l,q({},c)))};xu.displayName=`JVR.EllipsisComp`;var Su=e=>{var t=e.keyName,n=e.expandKey,r=e.keys,i=r===void 0?[]:r,a=e.initialValue,o=e.value,s=e.parentValue,c=e.level,l=gc(),u=yc(),d=Zc(),f=d.onExpand,p=d.collapsed,m=d.shouldExpandNodeInitially,h=typeof p==`boolean`?p:typeof p==`number`&&c>p,g=l[n]??(!m&&h),_=m&&m(!g,{value:o,keys:i,level:c,keyName:t,parentValue:s});l[n]===void 0&&m&&(g=!_);var v=()=>{var e={expand:!g,value:o,keyid:n,keyName:t};f&&f(e),u({[n]:e.expand})},y={display:`inline-flex`,alignItems:`center`},b={transform:`rotate(`+(g?`-90`:`0`)+`deg)`,transition:`all 0.3s`},x=Object.keys(o).length,S=typeof o==`object`,C=Array.isArray(o),w=o instanceof Set,T=x!==0&&(C||w||S),E={style:y};T&&(E.onClick=v);var D={keyName:t,value:o,keys:i,parentValue:s};return(0,I.jsxs)(`span`,q({},E,{children:[T&&(0,I.jsx)(fl,q({style:b,expandKey:n},D)),(t||typeof t==`number`)&&(0,I.jsx)(lu,q({},D)),(0,I.jsx)(Al,{value:a,keyName:t}),(0,I.jsx)(jl,{value:a,keyName:t}),(0,I.jsx)(pl,q({isBrackets:C||w},D)),(0,I.jsx)(xu,{keyName:t,value:o,isExpanded:g}),(0,I.jsx)(ml,q({isVisiable:g||!T,isBrackets:C||w},D)),(0,I.jsx)(vu,{value:o,keyName:t}),(0,I.jsx)(mu,{value:o,keyName:t}),(0,I.jsx)(ou,{keyName:t,value:o,expandKey:n,parentValue:s,keys:i})]}))};Su.displayName=`JVR.NestedOpen`;var Cu=[`className`,`children`,`parentValue`,`keyid`,`level`,`value`,`initialValue`,`keys`,`keyName`],wu=(0,F.forwardRef)((e,t)=>{var n=e.className,r=n===void 0?``:n;e.children;var i=e.parentValue;e.keyid;var a=e.level,o=a===void 0?1:a,s=e.value,c=e.initialValue,l=e.keys,u=e.keyName,d=ic(e,Cu),f=dc(),p=su(),m=[r,`w-rjv-inner`].filter(Boolean).join(` `);return(0,I.jsxs)(`div`,q({className:m,ref:t},d,{onMouseEnter:()=>f({[p]:!0}),onMouseLeave:()=>f({[p]:!1})},{children:[(0,I.jsx)(Su,{expandKey:p,value:s,level:o,keys:l,parentValue:i,keyName:u,initialValue:c}),(0,I.jsx)(cu,{expandKey:p,value:s,level:o,keys:l,parentValue:i,keyName:u}),(0,I.jsx)(hl,{expandKey:p,value:s,level:o,keys:l,parentValue:i,keyName:u})]}))});wu.displayName=`JVR.Container`;var Tu=e=>{var t=Pc().BraceLeft;return Kl(t===void 0?{}:t,e,`BraceLeft`),null};Tu.displayName=`JVR.BraceLeft`;var Eu=e=>{var t=Pc().BraceRight;return Kl(t===void 0?{}:t,e,`BraceRight`),null};Eu.displayName=`JVR.BraceRight`;var Du=e=>{var t=Pc().BracketsLeft;return Kl(t===void 0?{}:t,e,`BracketsLeft`),null};Du.displayName=`JVR.BracketsLeft`;var Ou=e=>{var t=Pc().BracketsRight;return Kl(t===void 0?{}:t,e,`BracketsRight`),null};Ou.displayName=`JVR.BracketsRight`;var ku=e=>{var t=Pc().Arrow;return Kl(t===void 0?{}:t,e,`Arrow`),null};ku.displayName=`JVR.Arrow`;var Au=e=>{var t=Pc().Colon;return Kl(t===void 0?{}:t,e,`Colon`),null};Au.displayName=`JVR.Colon`;var ju=e=>{var t=Pc().Quote;return Kl(t===void 0?{}:t,e,`Quote`),null};ju.displayName=`JVR.Quote`;var Mu=e=>{var t=Pc().ValueQuote;return Kl(t===void 0?{}:t,e,`ValueQuote`),null};Mu.displayName=`JVR.ValueQuote`;var Nu=e=>{var t=wc().Bigint;return ql(t===void 0?{}:t,e,`Bigint`),null};Nu.displayName=`JVR.Bigint`;var Pu=e=>{var t=wc().Date;return ql(t===void 0?{}:t,e,`Date`),null};Pu.displayName=`JVR.Date`;var Fu=e=>{var t=wc().False;return ql(t===void 0?{}:t,e,`False`),null};Fu.displayName=`JVR.False`;var Iu=e=>{var t=wc().Float;return ql(t===void 0?{}:t,e,`Float`),null};Iu.displayName=`JVR.Float`;var Lu=e=>{var t=wc().Int;return ql(t===void 0?{}:t,e,`Int`),null};Lu.displayName=`JVR.Int`;var Ru=e=>{var t=wc().Map;return ql(t===void 0?{}:t,e,`Map`),null};Ru.displayName=`JVR.Map`;var zu=e=>{var t=wc().Nan;return ql(t===void 0?{}:t,e,`Nan`),null};zu.displayName=`JVR.Nan`;var Bu=e=>{var t=wc().Null;return ql(t===void 0?{}:t,e,`Null`),null};Bu.displayName=`JVR.Null`;var Vu=e=>{var t=wc().Set;return ql(t===void 0?{}:t,e,`Set`),null};Vu.displayName=`JVR.Set`;var Hu=e=>{var t=wc().Str;return ql(t===void 0?{}:t,e,`Str`),null};Hu.displayName=`JVR.StringText`;var Uu=e=>{var t=wc().True;return ql(t===void 0?{}:t,e,`True`),null};Uu.displayName=`JVR.True`;var Wu=e=>{var t=wc().Undefined;return ql(t===void 0?{}:t,e,`Undefined`),null};Wu.displayName=`JVR.Undefined`;var Gu=e=>{var t=wc().Url;return ql(t===void 0?{}:t,e,`Url`),null};Gu.displayName=`JVR.Url`;var Ku=e=>{var t=Hc().Copied;return Jl(t===void 0?{}:t,e,`Copied`),null};Ku.displayName=`JVR.Copied`;var qu=[`className`,`style`,`value`,`children`,`collapsed`,`shouldExpandNodeInitially`,`indentWidth`,`displayObjectSize`,`shortenTextAfterLength`,`stringEllipsis`,`highlightUpdates`,`enableClipboard`,`displayDataTypes`,`objectSortKeys`,`onExpand`,`onCopied`,`beforeCopy`],J=(0,F.forwardRef)((e,t)=>{var n=e.className,r=n===void 0?``:n,i=e.style,a=e.value,o=e.children,s=e.collapsed,c=s!==void 0&&s,l=e.shouldExpandNodeInitially,u=e.indentWidth,d=u===void 0?15:u,f=e.displayObjectSize,p=f===void 0||f,m=e.shortenTextAfterLength,h=m===void 0?30:m,g=e.stringEllipsis,_=e.highlightUpdates,v=_===void 0||_,y=e.enableClipboard,b=y===void 0||y,x=e.displayDataTypes,S=x===void 0||x,C=e.objectSortKeys,w=C!==void 0&&C,T=e.onExpand,E=e.onCopied,D=e.beforeCopy,O=ic(e,qu),k=q({lineHeight:1.4,fontFamily:`var(--w-rjv-font-family, Menlo, monospace)`,color:`var(--w-rjv-color, #002b36)`,backgroundColor:`var(--w-rjv-background-color, #00000000)`,fontSize:13},i),ee=[`w-json-view-container`,`w-rjv`,r].filter(Boolean).join(` `);return(0,I.jsxs)(Qc,{initialState:{value:a,objectSortKeys:w,indentWidth:d,shouldExpandNodeInitially:c===!1?l:void 0,displayObjectSize:p,collapsed:c,enableClipboard:b,shortenTextAfterLength:h,stringEllipsis:g,highlightUpdates:v,onCopied:E,onExpand:T,beforeCopy:D},initialTypes:{displayDataTypes:S},children:[(0,I.jsx)(wu,q({value:a},O,{ref:t,className:ee,style:k})),o]})});J.Bigint=Nu,J.Date=Pu,J.False=Fu,J.Float=Iu,J.Int=Lu,J.Map=Ru,J.Nan=zu,J.Null=Bu,J.Set=Vu,J.String=Hu,J.True=Uu,J.Undefined=Wu,J.Url=Gu,J.ValueQuote=Mu,J.Arrow=ku,J.Colon=Au,J.Quote=ju,J.Ellipsis=bu,J.BraceLeft=Tu,J.BraceRight=Eu,J.BracketsLeft=Du,J.BracketsRight=Ou,J.Copied=Ku,J.CountInfo=_u,J.CountInfoExtra=pu,J.KeyName=Xl,J.Row=eu,J.displayName=`JVR.JsonView`;var Ju={"--w-rjv-font-family":`monospace`,"--w-rjv-color":`#9cdcfe`,"--w-rjv-key-string":`#9cdcfe`,"--w-rjv-background-color":`#1e1e1e`,"--w-rjv-line-color":`#36334280`,"--w-rjv-arrow-color":`#838383`,"--w-rjv-edit-color":`var(--w-rjv-color)`,"--w-rjv-info-color":`#9c9c9c7a`,"--w-rjv-update-color":`#9cdcfe`,"--w-rjv-copied-color":`#9cdcfe`,"--w-rjv-copied-success-color":`#28a745`,"--w-rjv-curlybraces-color":`#d4d4d4`,"--w-rjv-colon-color":`#d4d4d4`,"--w-rjv-brackets-color":`#d4d4d4`,"--w-rjv-quotes-color":`var(--w-rjv-key-string)`,"--w-rjv-quotes-string-color":`var(--w-rjv-type-string-color)`,"--w-rjv-type-string-color":`#ce9178`,"--w-rjv-type-int-color":`#b5cea8`,"--w-rjv-type-float-color":`#b5cea8`,"--w-rjv-type-bigint-color":`#b5cea8`,"--w-rjv-type-boolean-color":`#569cd6`,"--w-rjv-type-date-color":`#b5cea8`,"--w-rjv-type-url-color":`#3b89cf`,"--w-rjv-type-null-color":`#569cd6`,"--w-rjv-type-nan-color":`#859900`,"--w-rjv-type-undefined-color":`#569cd6`};function Yu({value:e,defaultExpandLevel:t=1,className:n=``,maxHeight:r=`24rem`,showControls:i=!0}){let a=Xu(e),[o,s]=(0,F.useState)(t),[c,l]=(0,F.useState)(0),u=(0,F.useCallback)(()=>{s(!1),l(e=>e+1)},[]),d=(0,F.useCallback)(()=>{s(t),l(e=>e+1)},[t]);return a?(0,I.jsxs)(`div`,{className:`min-w-0 max-w-full ${n}`,children:[i?(0,I.jsxs)(`div`,{className:`flex items-center gap-1 mb-1`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:u,className:`flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium text-slate-400 hover:text-slate-200 bg-slate-800/50 hover:bg-slate-700/60 rounded-sm transition-colors`,children:[(0,I.jsx)(dn,{size:10}),`Expand`]}),(0,I.jsxs)(`button`,{type:`button`,onClick:d,className:`flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium text-slate-400 hover:text-slate-200 bg-slate-800/50 hover:bg-slate-700/60 rounded-sm transition-colors`,children:[(0,I.jsx)(ln,{size:10}),`Collapse`]})]}):null,(0,I.jsx)(`div`,{className:`min-w-0 max-w-full overflow-auto rounded-sm text-xs`,style:{maxHeight:r},children:(0,I.jsx)(J,{value:a,style:{...Ju,background:`transparent`,fontSize:`12px`,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`},collapsed:o,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,shortenTextAfterLength:120},c)})]}):(0,I.jsx)(`pre`,{className:`max-w-full overflow-auto whitespace-pre-wrap break-words font-mono text-xs text-slate-300 ${n}`,style:{maxHeight:r},children:typeof e==`string`?e:JSON.stringify(e,null,2)})}function Xu(e){if(typeof e==`object`&&e)return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return null;try{let e=JSON.parse(t);return typeof e==`object`&&e?e:null}catch{return null}}function Zu({title:e,summary:t,input:n,output:r,error:i,traceStatus:a=`done`,linkedPiboSessionId:o,startedAt:s,completedAt:c,durationMs:l,signals:u,onOpenSession:d}){let f=o?u?.sessions[o]:void 0,p=Ws(f,a,a===`error`||c!==void 0),m=(0,F.useMemo)(()=>{if(!(!o||!u))return Object.values(u.nodes).find(e=>e.childPiboSessionId===o||e.piboSessionId===o&&e.kind===`session`)},[o,u]),h=s??m?.startedAt??m?.createdAt,g=p===`running`?void 0:c??f?.updatedAt??m?.completedAt,[_,v]=(0,F.useState)(()=>Date.now()),[y,b]=(0,F.useState)(!1),x=Gs(n,e,t),S=qs(n),C=ed(h,g,p===`running`?void 0:l,_,p===`running`),w=n!==void 0||r!==void 0||!!i;return(0,F.useEffect)(()=>{if(p!==`running`)return;let e=window.setInterval(()=>v(Date.now()),1e3);return()=>window.clearInterval(e)},[p]),(0,I.jsxs)(`div`,{className:`min-w-0 overflow-hidden rounded-sm border border-[#f97316]/60 bg-[#1a140f] text-slate-200 shadow-sm`,"data-pibo-component":`AgentDelegationCard`,"data-delegation-status":p,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-3 border-b border-[#f97316]/25 bg-[#f97316]/8 px-3 py-2.5`,children:[(0,I.jsxs)(`span`,{className:`relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-[#f97316] bg-[#f97316]/15 text-[#f97316]`,children:[(0,I.jsx)(On,{size:16,"aria-hidden":`true`}),p===`running`?(0,I.jsx)(`span`,{className:`absolute -right-0.5 -top-0.5 h-2 w-2 animate-pulse rounded-full bg-[#0bda57]`,"aria-hidden":`true`}):null]}),(0,I.jsxs)(`div`,{className:`min-w-[12rem] flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-wider text-[#f97316]`,children:`Agent Delegation`}),(0,I.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 text-sm font-semibold text-slate-100`,children:[(0,I.jsx)(nn,{size:14,className:`shrink-0 text-[#f97316]`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`truncate`,children:x})]}),(0,I.jsx)(Qu,{status:p})]}),S?(0,I.jsx)(`p`,{className:`mt-1 line-clamp-2 break-words font-mono text-xs leading-relaxed text-slate-400`,children:S}):null,C?(0,I.jsx)(`div`,{className:`mt-1 font-mono text-[10px] tabular-nums text-slate-500`,children:C}):null]}),o&&d?(0,I.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),d(o)},className:`inline-flex min-h-8 shrink-0 items-center gap-1.5 rounded-sm border border-[#f97316]/70 px-2.5 py-1 text-[11px] font-semibold text-[#fb923c] hover:border-[#f97316] hover:bg-[#f97316]/10 focus:outline-none focus:ring-1 focus:ring-[#f97316]`,children:[(0,I.jsx)(Cn,{size:13,"aria-hidden":`true`}),`Open sub-session`]}):null]}),w?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),b(e=>!e)},"aria-expanded":y,className:`flex min-h-9 w-full items-center justify-between gap-2 border-t border-[#f97316]/15 px-3 py-2 text-left text-[11px] font-semibold text-slate-400 hover:bg-[#f97316]/5 hover:text-slate-200 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-[#f97316]`,children:[(0,I.jsx)(`span`,{children:`Technical details`}),(0,I.jsx)(`span`,{"aria-hidden":`true`,children:y?`−`:`+`})]}),y?(0,I.jsxs)(`div`,{className:`grid min-w-0 gap-3 border-t border-[#f97316]/15 bg-[#0e1116] p-3 text-xs`,children:[n===void 0?null:(0,I.jsx)($u,{label:`Arguments`,value:n}),r===void 0?null:(0,I.jsx)($u,{label:`Result`,value:r}),i?(0,I.jsx)($u,{label:`Error`,value:i,error:!0}):null]}):null]}):null]})}function Qu({status:e}){let t={running:`border-[#0bda57]/40 bg-[#0bda57]/10 text-[#0bda57]`,completed:`border-green-500/40 bg-green-500/10 text-green-400`,failed:`border-red-500/40 bg-red-500/10 text-red-400`,cancelled:`border-slate-500/50 bg-slate-500/10 text-slate-300`},n=`${e.charAt(0).toUpperCase()}${e.slice(1)}`;return(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-sm border px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wide ${t[e]}`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:[e===`running`?(0,I.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-current`,"aria-hidden":`true`}):null,n]})}function $u({label:e,value:t,error:n=!1}){return(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-wider ${n?`text-red-400`:`text-[#fb923c]`}`,children:e}),(0,I.jsx)(Yu,{value:t})]})}function ed(e,t,n,r,i){let a=rd(e),o=rd(t),s=n??(a===void 0?void 0:Math.max(0,(o??r)-a)),c=[];return a!==void 0&&c.push(i?`Started ${td(r-a)}`:`Started ${nd(a)}`),s!==void 0&&c.push(Js(s)),c.length?c.join(` · `):void 0}function td(e){let t=Math.max(0,Math.floor(e/1e3));if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}function nd(e){return`${new Date(e).toISOString().slice(11,19)} UTC`}function rd(e){if(!e)return;let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}function id({delivery:e,className:t=``}){let n=e===`steer`;return(0,I.jsxs)(`div`,{className:`flex items-start gap-3 rounded-sm border px-3 py-2.5 ${n?`border-amber-500/40 bg-amber-500/10`:`border-[#11a4d4]/40 bg-[#11a4d4]/10`} ${t}`,"data-pibo-debug":`pending-user-message-${e}`,"aria-live":`polite`,children:[(0,I.jsx)(yn,{size:15,className:`mt-0.5 shrink-0 animate-pulse ${n?`text-amber-400`:`text-[#11a4d4]`}`}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-bold uppercase tracking-wider ${n?`text-amber-400`:`text-[#11a4d4]`}`,children:n?`Steering pending`:`Queued for next turn`}),(0,I.jsx)(`div`,{className:`mt-0.5 text-xs leading-5 text-slate-400`,children:n?`Waiting for the next tool call boundary.`:`Waiting for the active turn to finish.`})]})]})}function ad(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var od=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sd=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cd={};function ld(e,t){return((t||cd).jsx?sd:od).test(e)}var ud=/[ \t\n\f\r]/g;function dd(e){return typeof e==`object`?e.type===`text`&&fd(e.value):fd(e)}function fd(e){return e.replace(ud,``)===``}var pd=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};pd.prototype.normal={},pd.prototype.property={},pd.prototype.space=void 0;function md(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new pd(n,r,t)}function hd(e){return e.toLowerCase()}var gd=class{constructor(e,t){this.attribute=t,this.property=e}};gd.prototype.attribute=``,gd.prototype.booleanish=!1,gd.prototype.boolean=!1,gd.prototype.commaOrSpaceSeparated=!1,gd.prototype.commaSeparated=!1,gd.prototype.defined=!1,gd.prototype.mustUseProperty=!1,gd.prototype.number=!1,gd.prototype.overloadedBoolean=!1,gd.prototype.property=``,gd.prototype.spaceSeparated=!1,gd.prototype.space=void 0;var _d=s({boolean:()=>Y,booleanish:()=>yd,commaOrSpaceSeparated:()=>Sd,commaSeparated:()=>xd,number:()=>X,overloadedBoolean:()=>bd,spaceSeparated:()=>Z}),vd=0,Y=Cd(),yd=Cd(),bd=Cd(),X=Cd(),Z=Cd(),xd=Cd(),Sd=Cd();function Cd(){return 2**++vd}var wd=Object.keys(_d),Td=class extends gd{constructor(e,t,n,r){let i=-1;if(super(e,t),Ed(this,`space`,r),typeof n==`number`)for(;++i<wd.length;){let e=wd[i];Ed(this,wd[i],(n&_d[e])===_d[e])}}};Td.prototype.defined=!0;function Ed(e,t,n){n&&(e[t]=n)}function Dd(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Td(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[hd(r)]=r,n[hd(a.attribute)]=r}return new pd(t,n,e.space)}var Od=Dd({properties:{ariaActiveDescendant:null,ariaAtomic:yd,ariaAutoComplete:null,ariaBusy:yd,ariaChecked:yd,ariaColCount:X,ariaColIndex:X,ariaColSpan:X,ariaControls:Z,ariaCurrent:null,ariaDescribedBy:Z,ariaDetails:null,ariaDisabled:yd,ariaDropEffect:Z,ariaErrorMessage:null,ariaExpanded:yd,ariaFlowTo:Z,ariaGrabbed:yd,ariaHasPopup:null,ariaHidden:yd,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Z,ariaLevel:X,ariaLive:null,ariaModal:yd,ariaMultiLine:yd,ariaMultiSelectable:yd,ariaOrientation:null,ariaOwns:Z,ariaPlaceholder:null,ariaPosInSet:X,ariaPressed:yd,ariaReadOnly:yd,ariaRelevant:null,ariaRequired:yd,ariaRoleDescription:Z,ariaRowCount:X,ariaRowIndex:X,ariaRowSpan:X,ariaSelected:yd,ariaSetSize:X,ariaSort:null,ariaValueMax:X,ariaValueMin:X,ariaValueNow:X,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function kd(e,t){return t in e?e[t]:t}function Ad(e,t){return kd(e,t.toLowerCase())}var jd=Dd({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:xd,acceptCharset:Z,accessKey:Z,action:null,allow:null,allowFullScreen:Y,allowPaymentRequest:Y,allowUserMedia:Y,alpha:Y,alt:null,as:null,async:Y,autoCapitalize:null,autoComplete:Z,autoFocus:Y,autoPlay:Y,blocking:Z,capture:null,charSet:null,checked:Y,cite:null,className:Z,closedBy:null,colorSpace:null,cols:X,colSpan:X,command:null,commandFor:null,content:null,contentEditable:yd,controls:Y,controlsList:Z,coords:X|xd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Y,defer:Y,dir:null,dirName:null,disabled:Y,download:bd,draggable:yd,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Y,formTarget:null,headers:Z,height:X,hidden:bd,high:X,href:null,hrefLang:null,htmlFor:Z,httpEquiv:Z,id:null,imageSizes:null,imageSrcSet:null,inert:Y,inputMode:null,integrity:null,is:null,isMap:Y,itemId:null,itemProp:Z,itemRef:Z,itemScope:Y,itemType:Z,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Y,low:X,manifest:null,max:null,maxLength:X,media:null,method:null,min:null,minLength:X,multiple:Y,muted:Y,name:null,nonce:null,noModule:Y,noValidate:Y,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:Y,optimum:X,pattern:null,ping:Z,placeholder:null,playsInline:Y,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Y,referrerPolicy:null,rel:Z,required:Y,reversed:Y,rows:X,rowSpan:X,sandbox:Z,scope:null,scoped:Y,seamless:Y,selected:Y,shadowRootClonable:Y,shadowRootCustomElementRegistry:Y,shadowRootDelegatesFocus:Y,shadowRootMode:null,shadowRootSerializable:Y,shape:null,size:X,sizes:null,slot:null,span:X,spellCheck:yd,src:null,srcDoc:null,srcLang:null,srcSet:null,start:X,step:null,style:null,tabIndex:X,target:null,title:null,translate:null,type:null,typeMustMatch:Y,useMap:null,value:yd,width:X,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Z,axis:null,background:null,bgColor:null,border:X,borderColor:null,bottomMargin:X,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Y,declare:Y,event:null,face:null,frame:null,frameBorder:null,hSpace:X,leftMargin:X,link:null,longDesc:null,lowSrc:null,marginHeight:X,marginWidth:X,noResize:Y,noHref:Y,noShade:Y,noWrap:Y,object:null,profile:null,prompt:null,rev:null,rightMargin:X,rules:null,scheme:null,scrolling:yd,standby:null,summary:null,text:null,topMargin:X,valueType:null,version:null,vAlign:null,vLink:null,vSpace:X,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Y,disablePictureInPicture:Y,disableRemotePlayback:Y,exportParts:xd,part:Z,prefix:null,property:null,results:X,security:null,unselectable:null},space:`html`,transform:Ad}),Md=Dd({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:Sd,accentHeight:X,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:X,amplitude:X,arabicForm:null,ascent:X,attributeName:null,attributeType:null,azimuth:X,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:X,by:null,calcMode:null,capHeight:X,className:Z,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:X,diffuseConstant:X,direction:null,display:null,dur:null,divisor:X,dominantBaseline:null,download:Y,dx:null,dy:null,edgeMode:null,editable:null,elevation:X,enableBackground:null,end:null,event:null,exponent:X,externalResourcesRequired:null,fill:null,fillOpacity:X,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:xd,g2:xd,glyphName:xd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:X,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:X,horizOriginX:X,horizOriginY:X,id:null,ideographic:X,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:X,k:X,k1:X,k2:X,k3:X,k4:X,kernelMatrix:Sd,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:X,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:X,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:X,overlineThickness:X,paintOrder:null,panose1:null,path:null,pathLength:X,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Z,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:X,pointsAtY:X,pointsAtZ:X,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Sd,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Sd,rev:Sd,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Sd,requiredFeatures:Sd,requiredFonts:Sd,requiredFormats:Sd,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:X,specularExponent:X,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:X,strikethroughThickness:X,string:null,stroke:null,strokeDashArray:Sd,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:X,strokeOpacity:X,strokeWidth:null,style:null,surfaceScale:X,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Sd,tabIndex:X,tableValues:null,target:null,targetX:X,targetY:X,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Sd,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:X,underlineThickness:X,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:X,values:null,vAlphabetic:X,vMathematical:X,vectorEffect:null,vHanging:X,vIdeographic:X,version:null,vertAdvY:X,vertOriginX:X,vertOriginY:X,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:X,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:kd}),Nd=Dd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Pd=Dd({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Ad}),Fd=Dd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Id={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`},Ld=/[A-Z]/g,Rd=/-[a-z]/g,zd=/^data[-\w.:]+$/i;function Bd(e,t){let n=hd(t),r=t,i=gd;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&zd.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Rd,Hd);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Rd.test(e)){let n=e.replace(Ld,Vd);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Td}return new i(r,t)}function Vd(e){return`-`+e.toLowerCase()}function Hd(e){return e.charAt(1).toUpperCase()}var Ud=md([Od,jd,Nd,Pd,Fd],`html`),Wd=md([Od,Md,Nd,Pd,Fd],`svg`);function Gd(e){return e.join(` `).trim()}var Kd=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
10
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),qd=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(Kd());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),Jd=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Yd=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(qd()),r=Jd();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Xd=Qd(`end`),Zd=Qd(`start`);function Qd(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function $d(e){let t=Zd(e),n=Xd(e);if(t&&n)return{start:t,end:n}}function ef(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?nf(e.position):`start`in e||`end`in e?nf(e):`line`in e||`column`in e?tf(e):``}function tf(e){return rf(e&&e.line)+`:`+rf(e&&e.column)}function nf(e){return tf(e&&e.start)+`-`+tf(e&&e.end)}function rf(e){return e&&typeof e==`number`?e:1}var af=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=ef(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};af.prototype.file=``,af.prototype.name=``,af.prototype.reason=``,af.prototype.message=``,af.prototype.stack=``,af.prototype.column=void 0,af.prototype.line=void 0,af.prototype.ancestors=void 0,af.prototype.cause=void 0,af.prototype.fatal=void 0,af.prototype.place=void 0,af.prototype.ruleId=void 0,af.prototype.source=void 0;var of=l(Yd(),1),sf={}.hasOwnProperty,cf=new Map,lf=/[A-Z]/g,uf=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),df=new Set([`td`,`th`]),ff=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function pf(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=wf(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Cf(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Wd:Ud,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=mf(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function mf(e,t,n){if(t.type===`element`)return hf(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return gf(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return vf(e,t,n);if(t.type===`mdxjsEsm`)return _f(e,t);if(t.type===`root`)return yf(e,t,n);if(t.type===`text`)return bf(e,t)}function hf(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Wd,e.schema=i),e.ancestors.push(t);let a=Af(e,t.tagName,!1),o=Tf(e,t),s=Df(e,t);return uf.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!dd(e)})),xf(e,o,a,t),Sf(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function gf(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}jf(e,t.position)}function _f(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);jf(e,t.position)}function vf(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Wd,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Af(e,t.name,!0),o=Ef(e,t),s=Df(e,t);return xf(e,o,a,t),Sf(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function yf(e,t,n){let r={};return Sf(r,Df(e,t)),e.create(t,e.Fragment,r,n)}function bf(e,t){return t.value}function xf(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Sf(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Cf(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function wf(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Zd(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Tf(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&sf.call(t.properties,i)){let a=Of(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&df.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Ef(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else jf(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else jf(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Df(e,t){let n=[],r=-1,i=e.passKeys?new Map:cf;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=mf(e,a,o);s!==void 0&&n.push(s)}return n}function Of(e,t,n){let r=Bd(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ad(n):Gd(n)),r.property===`style`){let t=typeof n==`object`?n:kf(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Mf(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Id[r.property]||r.property:r.attribute,n]}}function kf(e,t){try{return(0,of.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new af("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=ff+`#cannot-parse-style-attribute`,r}}function Af(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=ld(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=ld(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return sf.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);jf(e)}function jf(e,t){let n=new af("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=ff+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Mf(e){let t={},n;for(n in e)sf.call(e,n)&&(t[Nf(n)]=e[n]);return t}function Nf(e){let t=e.replace(lf,Pf);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Pf(e){return`-`+e.toLowerCase()}var Ff={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`]},If={};function Lf(e,t){let n=t||If;return Rf(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Rf(e,t,n){if(Bf(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return zf(e.children,t,n)}return Array.isArray(e)?zf(e,t,n):``}function zf(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Rf(e[i],t,n);return r.join(``)}function Bf(e){return!!(e&&typeof e==`object`)}var Vf=document.createElement(`i`);function Hf(e){let t=`&`+e+`;`;Vf.innerHTML=t;let n=Vf.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Uf(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Wf(e,t){return e.length>0?(Uf(e,e.length,0,t),e):t}var Gf={}.hasOwnProperty;function Kf(e){let t={},n=-1;for(;++n<e.length;)qf(t,e[n]);return t}function qf(e,t){let n;for(n in t){let r=(Gf.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Gf.call(r,a)||(r[a]=[]);let e=i[a];Jf(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Jf(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Uf(e,0,0,r)}function Yf(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function Xf(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Zf=cp(/[A-Za-z]/),Qf=cp(/[\dA-Za-z]/),$f=cp(/[#-'*+\--9=?A-Z^-~]/);function ep(e){return e!==null&&(e<32||e===127)}var tp=cp(/\d/),np=cp(/[\dA-Fa-f]/),rp=cp(/[!-/:-@[-`{-~]/);function Q(e){return e!==null&&e<-2}function ip(e){return e!==null&&(e<0||e===32)}function ap(e){return e===-2||e===-1||e===32}var op=cp(/\p{P}|\p{S}/u),sp=cp(/\s/);function cp(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function lp(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Qf(e.charCodeAt(n+1))&&Qf(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function up(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return ap(r)?(e.enter(n),s(r)):t(r)}function s(r){return ap(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var dp={tokenize:fp};function fp(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),up(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var pp={tokenize:hp},mp={tokenize:gp};function hp(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Uf(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(mp,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(mp,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Q(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Uf(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function gp(e,t,n){return up(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function _p(e){if(e===null||ip(e)||sp(e))return 1;if(op(e))return 2}function vp(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var yp={name:`attention`,resolveAll:bp,tokenize:xp};function bp(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Sp(d,-c),Sp(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Wf(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Wf(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Wf(l,vp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Wf(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Wf(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Uf(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function xp(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=_p(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=_p(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Sp(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Cp={name:`autolink`,tokenize:wp};function wp(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Zf(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Qf(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Qf(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||ep(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):$f(t)?(e.consume(t),l):n(t)}function u(e){return Qf(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Qf(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Tp={partial:!0,tokenize:Ep};function Ep(e,t,n){return r;function r(t){return ap(t)?up(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Q(e)?t(e):n(e)}}var Dp={continuation:{tokenize:kp},exit:Ap,name:`blockQuote`,tokenize:Op};function Op(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return ap(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function kp(e,t,n){let r=this;return i;function i(t){return ap(t)?up(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Dp,t,n)(r)}}function Ap(e){e.exit(`blockQuote`)}var jp={name:`characterEscape`,tokenize:Mp};function Mp(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return rp(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Np={name:`characterReference`,tokenize:Pp};function Pp(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Qf,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=np,u):(e.enter(`characterReferenceValue`),a=7,o=tp,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Qf&&!Hf(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Fp={partial:!0,tokenize:Rp},Ip={concrete:!0,name:`codeFenced`,tokenize:Lp};function Lp(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),ap(t)?up(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Fp,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):ap(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),up(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&ap(t)?up(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Q(t)?e.check(Fp,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),ap(t)?up(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),ap(t)?up(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Rp(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var zp={name:`codeIndented`,tokenize:Vp},Bp={partial:!0,tokenize:Hp};function Vp(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),up(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Q(t)?e.attempt(Bp,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Hp(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):up(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Q(e)?i(e):n(e)}}var Up={name:`codeText`,previous:Gp,resolve:Wp,tokenize:Kp};function Wp(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Gp(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Kp(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Q(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var qp=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Jp(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Jp(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Jp(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Jp(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Jp(this.left,t.reverse())}}}};function Jp(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Yp(e){let t={},n=-1,r,i,a,o,s,c,l,u=new qp(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Xp(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Uf(e,0,1/0,u.slice(0)),!l}function Xp(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Zp={resolve:$p,tokenize:em},Qp={partial:!0,tokenize:tm};function $p(e){return Yp(e),e}function em(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Q(t)?e.check(Qp,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function tm(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),up(e,a,`linePrefix`)}function a(i){if(i===null||Q(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function nm(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||ep(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Q(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||ip(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||ep(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function rm(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Q(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!ap(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function im(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),up(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Q(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function am(e,t){let n;return r;function r(i){return Q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):ap(i)?up(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var om={name:`definition`,tokenize:cm},sm={partial:!0,tokenize:lm};function cm(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return rm.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Xf(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return ip(t)?am(e,l)(t):l(t)}function l(t){return nm(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(sm,d,d)(t)}function d(t){return ap(t)?up(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function lm(e,t,n){return r;function r(t){return ip(t)?am(e,i)(t):n(t)}function i(t){return im(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return ap(t)?up(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Q(e)?t(e):n(e)}}var um={name:`hardBreakEscape`,tokenize:dm};function dm(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var fm={name:`headingAtx`,resolve:pm,tokenize:mm};function pm(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Uf(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function mm(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||ip(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Q(n)?(e.exit(`atxHeading`),t(n)):ap(n)?up(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||ip(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var hm=`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`.split(`.`),gm=[`pre`,`script`,`style`,`textarea`],_m={concrete:!0,name:`htmlFlow`,resolveTo:bm,tokenize:xm},vm={partial:!0,tokenize:Cm},ym={partial:!0,tokenize:Sm};function bm(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function xm(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:M):Zf(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Zf(a)?(e.consume(a),i=4,r.interrupt?t:M):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:M):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Zf(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||ip(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&gm.includes(l)?(i=1,r.interrupt?t(s):O(s)):hm.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Qf(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return ap(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Zf(t)?(e.consume(t),b):ap(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Qf(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):ap(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):ap(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Q(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||ip(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||ap(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Q(t)?O(t):ap(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),ne):t===60&&i===1?(e.consume(t),A):t===62&&i===4?(e.consume(t),N):t===63&&i===3?(e.consume(t),M):t===93&&i===5?(e.consume(t),re):Q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(vm,ie,k)(t)):t===null||Q(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(ym,ee,ie)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||Q(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function ne(t){return t===45?(e.consume(t),M):O(t)}function A(t){return t===47?(e.consume(t),o=``,j):O(t)}function j(t){if(t===62){let n=o.toLowerCase();return gm.includes(n)?(e.consume(t),N):O(t)}return Zf(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),j):O(t)}function re(t){return t===93?(e.consume(t),M):O(t)}function M(t){return t===62?(e.consume(t),N):t===45&&i===2?(e.consume(t),M):O(t)}function N(t){return t===null||Q(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),N)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function Sm(e,t,n){let r=this;return i;function i(t){return Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Cm(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Tp,t,n)}}var wm={name:`htmlText`,tokenize:Tm};function Tm(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Zf(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Zf(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Q(t)?(o=d,A(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ne(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Q(t)?(o=h,A(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ne(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ne(t):Q(t)?(o=v,A(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Q(t)?(o=y,A(t)):(e.consume(t),y)}function b(e){return e===62?ne(e):y(e)}function x(t){return Zf(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Qf(t)?(e.consume(t),S):C(t)}function C(t){return Q(t)?(o=C,A(t)):ap(t)?(e.consume(t),C):ne(t)}function w(t){return t===45||Qf(t)?(e.consume(t),w):t===47||t===62||ip(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ne):t===58||t===95||Zf(t)?(e.consume(t),E):Q(t)?(o=T,A(t)):ap(t)?(e.consume(t),T):ne(t)}function E(t){return t===45||t===46||t===58||t===95||Qf(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Q(t)?(o=D,A(t)):ap(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Q(t)?(o=O,A(t)):ap(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):Q(t)?(o=k,A(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||ip(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||ip(e)?T(e):n(e)}function ne(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function A(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return ap(t)?up(e,re,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):re(t)}function re(t){return e.enter(`htmlTextData`),o(t)}}var Em={name:`labelEnd`,resolveAll:Am,resolveTo:jm,tokenize:Mm},Dm={tokenize:Nm},Om={tokenize:Pm},km={tokenize:Fm};function Am(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Uf(e,0,e.length,n),e}function jm(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Wf(s,e.slice(a+1,a+r+3)),s=Wf(s,[[`enter`,u,t]]),s=Wf(s,vp(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Wf(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Wf(s,e.slice(o+1)),s=Wf(s,[[`exit`,c,t]]),Uf(e,a,e.length,s),e}function Mm(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Xf(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Dm,u,o?u:d)(t):t===91?e.attempt(Om,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(km,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Nm(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return ip(t)?am(e,a)(t):a(t)}function a(t){return t===41?u(t):nm(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return ip(t)?am(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?im(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return ip(t)?am(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Pm(e,t,n){let r=this;return i;function i(t){return rm.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Xf(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Fm(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Im={name:`labelStartImage`,resolveAll:Em.resolveAll,tokenize:Lm};function Lm(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Rm={name:`labelStartLink`,resolveAll:Em.resolveAll,tokenize:zm};function zm(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Bm={name:`lineEnding`,tokenize:Vm};function Vm(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),up(e,t,`linePrefix`)}}var Hm={name:`thematicBreak`,tokenize:Um};function Um(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),ap(t)?up(e,s,`whitespace`)(t):s(t))}}var Wm={continuation:{tokenize:Jm},exit:Xm,name:`list`,tokenize:qm},Gm={partial:!0,tokenize:Zm},Km={partial:!0,tokenize:Ym};function qm(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:tp(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Hm,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return tp(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Tp,r.interrupt?n:u,e.attempt(Gm,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return ap(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Jm(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Tp,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,up(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!ap(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Km,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,up(e,e.attempt(Wm,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Ym(e,t,n){let r=this;return up(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Xm(e){e.exit(this.containerState.type)}function Zm(e,t,n){let r=this;return up(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!ap(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Qm={name:`setextUnderline`,resolveTo:$m,tokenize:eh};function $m(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function eh(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),ap(t)?up(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var th={tokenize:nh};function nh(e){let t=this,n=e.attempt(Tp,r,e.attempt(this.parser.constructs.flowInitial,i,up(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Zp,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var rh={resolveAll:sh()},ih=oh(`string`),ah=oh(`text`);function oh(e){return{resolveAll:sh(e===`text`?ch:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function sh(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function ch(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var lh=s({attentionMarkers:()=>_h,contentInitial:()=>dh,disable:()=>vh,document:()=>uh,flow:()=>ph,flowInitial:()=>fh,insideSpan:()=>gh,string:()=>mh,text:()=>hh}),uh={42:Wm,43:Wm,45:Wm,48:Wm,49:Wm,50:Wm,51:Wm,52:Wm,53:Wm,54:Wm,55:Wm,56:Wm,57:Wm,62:Dp},dh={91:om},fh={[-2]:zp,[-1]:zp,32:zp},ph={35:fm,42:Hm,45:[Qm,Hm],60:_m,61:Qm,95:Hm,96:Ip,126:Ip},mh={38:Np,92:jp},hh={[-5]:Bm,[-4]:Bm,[-3]:Bm,33:Im,38:Np,42:yp,60:[Cp,wm],91:Rm,92:[um,jp],93:Em,95:yp,96:Up},gh={null:[yp,rh]},_h={null:[42,95]},vh={null:[]};function yh(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Wf(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=vp(a,l.events,l),l.events):[]}function f(e,t){return xh(p(e),t)}function p(e){return bh(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Q(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Uf(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function bh(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function xh(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
11
+ `;break;case-3:o=`\r
12
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Sh(e){let t={constructs:Kf([lh,...(e||{}).extensions||[]]),content:n(dp),defined:[],document:n(pp),flow:n(th),lazy:{},string:n(ih),text:n(ah)};return t;function n(e){return n;function n(n){return yh(t,e,n)}}}function Ch(e){for(;!Yp(e););return e}var wh=/[\0\t\n\r]/g;function Th(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(wh.lastIndex=u,c=wh.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Eh=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Dh(e){return e.replace(Eh,Oh)}function Oh(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Yf(n.slice(t?2:1),t?16:10)}return Hf(n)||e}var kh={}.hasOwnProperty;function Ah(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),jh(n)(Ch(Sh(n).document().write(Th()(e,t,!0))))}function jh(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(be),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ge),blockQuote:a(P),characterEscape:T,characterReference:T,codeFenced:a(fe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(fe,o),codeText:a(pe,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(me),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(he),hardBreakEscape:a(_e),hardBreakTrailing:a(_e),htmlFlow:a(ve,o),htmlFlowData:T,htmlText:a(ve,o),htmlTextData:T,image:a(ye),label:o,link:a(be),listItem:a(Se),listItemValue:f,listOrdered:a(xe,d),listUnordered:a(xe),paragraph:a(Ce),reference:ae,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ge),strong:a(we),thematicBreak:a(Ee)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ce,characterReference:le,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(te),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(ee),htmlTextData:E,image:c(A),label:re,labelText:j,lineEnding:D,link:c(ne),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:M,resourceTitleString:N,resource:ie,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Nh(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];kh.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Fh).call(a,void 0,e[0])}for(r.position={start:Mh(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Mh(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Mh(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Fh).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+ef({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Mh(e.end)}function u(){return Lf(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Xf(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Te(),n.position={start:Mh(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Mh(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Mh(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function A(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function j(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Dh(t),n.identifier=Xf(t).toLowerCase()}function re(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function N(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ie(){this.data.inReference=void 0}function ae(){this.data.referenceType=`collapsed`}function oe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Xf(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function se(e){this.data.characterReferenceType=e.type}function ce(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Yf(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Hf(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=Mh(e.end)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function P(){return{type:`blockquote`,children:[]}}function fe(){return{type:`code`,lang:null,meta:null,value:``}}function pe(){return{type:`inlineCode`,value:``}}function me(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function he(){return{type:`emphasis`,children:[]}}function ge(){return{type:`heading`,depth:0,children:[]}}function _e(){return{type:`break`}}function ve(){return{type:`html`,value:``}}function ye(){return{type:`image`,title:null,url:``,alt:null}}function be(){return{type:`link`,title:null,url:``,children:[]}}function xe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Se(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ce(){return{type:`paragraph`,children:[]}}function we(){return{type:`strong`,children:[]}}function Te(){return{type:`text`,value:``}}function Ee(){return{type:`thematicBreak`}}}function Mh(e){return{line:e.line,column:e.column,offset:e.offset}}function Nh(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Nh(e,r):Ph(e,r)}}function Ph(e,t){let n;for(n in t)if(kh.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Fh(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+ef({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ef({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+ef({start:t.start,end:t.end})+`) is still open`)}function Ih(e){let t=this;t.parser=n;function n(n){return Ah(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Lh(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Rh(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
13
+ `}]}function zh(e,t){let n=t.value?t.value+`
14
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Bh(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vh(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hh(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=lp(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Uh(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Wh(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Gh(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Kh(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gh(e,t);let i={src:lp(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function qh(e,t){let n={src:lp(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Jh(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Yh(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gh(e,t);let i={href:lp(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Xh(e,t){let n={href:lp(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Zh(e,t,n){let r=e.all(t),i=n?Qh(n):$h(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
15
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
16
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Qh(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=$h(n[r])}return t}function $h(e){return e.spread??e.children.length>1}function eg(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function tg(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ng(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function rg(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ig(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Zd(t.children[1]),o=Xd(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function ag(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function og(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var sg=9,cg=32;function lg(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(ug(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(ug(t.slice(i),i>0,!1)),a.join(``)}function ug(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===sg||t===cg;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===sg||t===cg;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function dg(e,t){let n={type:`text`,value:lg(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function fg(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var pg={blockquote:Lh,break:Rh,code:zh,delete:Bh,emphasis:Vh,footnoteReference:Hh,heading:Uh,html:Wh,imageReference:Kh,image:qh,inlineCode:Jh,linkReference:Yh,link:Xh,listItem:Zh,list:eg,paragraph:tg,root:ng,strong:rg,table:ig,tableCell:og,tableRow:ag,text:dg,thematicBreak:fg,toml:mg,yaml:mg,definition:mg,footnoteDefinition:mg};function mg(){}var hg=typeof self==`object`?self:globalThis,gg=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new hg[e](t)},_g=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof hg[e]==`function`?gg(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(gg(a,o),i)};return r},vg=e=>_g(new Map,e)(0),yg=``,{toString:bg}={},{keys:xg}=Object,Sg=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=bg.call(e).slice(8,-1);switch(n){case`Array`:return[1,yg];case`Object`:return[2,yg];case`Date`:return[3,yg];case`RegExp`:return[4,yg];case`Map`:return[5,yg];case`Set`:return[6,yg];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Cg=([e,t])=>e===0&&(t===`function`||t===`symbol`),wg=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Sg(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of xg(r))(e||!Cg(Sg(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?yg:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Cg(Sg(n))||Cg(Sg(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Cg(Sg(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Tg=(e,{json:t,lossy:n}={})=>{let r=[];return wg(!(t||n),!!t,new Map,r)(e),r},Eg=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?vg(Tg(e,t)):structuredClone(e):(e,t)=>vg(Tg(e,t));function Dg(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Og(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function kg(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Dg,r=e.options.footnoteBackLabel||Og,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=lp(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Eg(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
17
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
18
+ `}]}}var Ag=(function(e){if(e==null)return Fg;if(typeof e==`function`)return Pg(e);if(typeof e==`object`)return Array.isArray(e)?jg(e):Mg(e);if(typeof e==`string`)return Ng(e);throw Error(`Expected function, string, or object as test`)});function jg(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Ag(e[n]);return Pg(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Mg(e){let t=e;return Pg(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Ng(e){return Pg(t);function t(t){return t&&t.type===e}}function Pg(e){return t;function t(t,n,r){return!!(Ig(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Fg(){return!0}function Ig(e){return typeof e==`object`&&!!e&&`type`in e}function Lg(e){return e}var Rg=[];function zg(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Ag(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Lg(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Rg,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Bg(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Bg(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Rg:[e]}function Vg(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),zg(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Hg={}.hasOwnProperty,Ug={};function Wg(e,t){let n=t||Ug,r=new Map,i=new Map,a={all:s,applyData:Kg,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...pg,...n.handlers},one:o,options:n,patch:Gg,wrap:Jg};return Vg(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Hg.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Eg(n);return r.children=a.all(e),r}return Eg(e)}return(a.options.unknownHandler||qg)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Yg(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Yg(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Gg(e,t){e.position&&(t.position=$d(e))}function Kg(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Eg(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function qg(e,t){let n=t.data||{},r=`value`in t&&!(Hg.call(n,`hProperties`)||Hg.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Jg(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
19
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
20
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
21
+ `}),n}function Yg(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Xg(e,t){let n=Wg(e,t),r=n.one(e,void 0),i=kg(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
22
+ `},i)),a}function Zg(e,t){return e&&`run`in e?async function(n,r){let i=Xg(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Xg(n,{file:r,...e||t})}}function Qg(e){if(e)throw e}var $g=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function e_(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function t_(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?n_(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function n_(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var r_={basename:i_,dirname:a_,extname:o_,join:s_,sep:`/`};function i_(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);u_(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function a_(e){if(u_(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function o_(e){u_(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function s_(...e){let t=-1,n;for(;++t<e.length;)u_(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:c_(n)}function c_(e){u_(e);let t=e.codePointAt(0)===47,n=l_(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function l_(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function u_(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var d_={cwd:f_};function f_(){return`/`}function p_(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function m_(e){if(typeof e==`string`)e=new URL(e);else if(!p_(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return h_(e)}function h_(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var g_=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],__=class{constructor(e){let t;t=e?p_(e)?{path:e}:typeof e==`string`||x_(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:d_.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<g_.length;){let e=g_[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)g_.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?r_.basename(this.path):void 0}set basename(e){y_(e,`basename`),v_(e,`basename`),this.path=r_.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?r_.dirname(this.path):void 0}set dirname(e){b_(this.basename,`dirname`),this.path=r_.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?r_.extname(this.path):void 0}set extname(e){if(v_(e,`extname`),b_(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=r_.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){p_(e)&&(e=m_(e)),y_(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?r_.basename(this.path,this.extname):void 0}set stem(e){y_(e,`stem`),v_(e,`stem`),this.path=r_.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new af(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function v_(e,t){if(e&&e.includes(r_.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+r_.sep+"`")}function y_(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function b_(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function x_(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var S_=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),C_=l($g(),1),w_={}.hasOwnProperty,T_=new class e extends S_{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=t_()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,C_.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(O_(`data`,this.frozen),this.namespace[e]=t,this):w_.call(this.namespace,e)&&this.namespace[e]||void 0:e?(O_(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=j_(e),n=this.parser||this.Parser;return E_(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),E_(`process`,this.parser||this.Parser),D_(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=j_(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);N_(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),E_(`processSync`,this.parser||this.Parser),D_(`processSync`,this.compiler||this.Compiler),this.process(e,r),A_(`processSync`,`process`,t),n;function r(e,r){t=!0,Qg(e),n=r}}run(e,t,n){k_(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=j_(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),A_(`runSync`,`run`,n),r;function i(e,t){Qg(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=j_(t),r=this.compiler||this.Compiler;return D_(`stringify`,r),k_(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(O_(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,C_.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];e_(o)&&e_(r)&&(r=(0,C_.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function E_(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function D_(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function O_(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function k_(e){if(!e_(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function A_(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function j_(e){return M_(e)?e:new __(e)}function M_(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function N_(e){return typeof e==`string`||P_(e)}function P_(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var F_=[],I_={allowDangerousHtml:!0},L_=/^(https?|ircs?|mailto|xmpp)$/i,R_=[{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 z_(e){let t=B_(e),n=V_(e);return H_(t.runSync(t.parse(n),n),e)}function B_(e){let t=e.rehypePlugins||F_,n=e.remarkPlugins||F_,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...I_}:I_;return T_().use(Ih).use(n).use(Zg,r).use(t)}function V_(e){let t=e.children||``,n=new __;return typeof t==`string`?n.value=t:``+t,n}function H_(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||U_;for(let e of R_)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Vg(e,l),pf(e,{Fragment:I.Fragment,components:i,ignoreInvalidStyle:!0,jsx:I.jsx,jsxs:I.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Ff)if(Object.hasOwn(Ff,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Ff[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function U_(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||L_.test(e.slice(0,t))?e:``}function W_(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function G_(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function K_(e,t,n){let r=Ag((n||{}).ignore||[]),i=q_(t),a=-1;for(;++a<i.length;)zg(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function q_(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([J_(e[0]),Y_(e[1])])}return t}function J_(e){return typeof e==`string`?new RegExp(G_(e),`g`):e}function Y_(e){return typeof e==`function`?e:function(){return e}}var X_=`phrasing`,Z_=[`autolink`,`link`,`image`,`label`];function Q_(){return{transforms:[ov],enter:{literalAutolink:ev,literalAutolinkEmail:tv,literalAutolinkHttp:tv,literalAutolinkWww:tv},exit:{literalAutolink:av,literalAutolinkEmail:iv,literalAutolinkHttp:nv,literalAutolinkWww:rv}}}function $_(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:X_,notInConstruct:Z_},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:X_,notInConstruct:Z_},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:X_,notInConstruct:Z_}]}}function ev(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function tv(e){this.config.enter.autolinkProtocol.call(this,e)}function nv(e){this.config.exit.autolinkProtocol.call(this,e)}function rv(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function iv(e){this.config.exit.autolinkEmail.call(this,e)}function av(e){this.exit(e)}function ov(e){K_(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,sv],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,cv]],{ignore:[`link`,`linkReference`]})}function sv(e,t,n,r,i){let a=``;if(!dv(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!lv(n)))return!1;let o=uv(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function cv(e,t,n,r){return!dv(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function lv(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function uv(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=W_(e,`(`),a=W_(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function dv(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||sp(n)||op(n))&&(!t||n!==47)}xv.peek=bv;function fv(){this.buffer()}function pv(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function mv(){this.buffer()}function hv(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function gv(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function _v(e){this.exit(e)}function vv(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xf(this.sliceSerialize(e)).toLowerCase(),n.label=t}function yv(e){this.exit(e)}function bv(){return`[`}function xv(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Sv(){return{enter:{gfmFootnoteCallString:fv,gfmFootnoteCall:pv,gfmFootnoteDefinitionLabelString:mv,gfmFootnoteDefinition:hv},exit:{gfmFootnoteCallString:gv,gfmFootnoteCall:_v,gfmFootnoteDefinitionLabelString:vv,gfmFootnoteDefinition:yv}}}function Cv(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:xv},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
23
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Tv:wv))),s(),o}}function wv(e,t,n){return t===0?e:Tv(e,t,n)}function Tv(e,t,n){return(n?``:` `)+e}var Ev=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];jv.peek=Mv;function Dv(){return{canContainEols:[`delete`],enter:{strikethrough:kv},exit:{strikethrough:Av}}}function Ov(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Ev}],handlers:{delete:jv}}}function kv(e){this.enter({type:`delete`,children:[]},e)}function Av(e){this.exit(e)}function jv(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Mv(){return`~`}function Nv(e){return e.length}function Pv(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Nv,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Fv(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Iv(r[d]);else{let e=Iv(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
24
+ `)}function Fv(e){return e==null?``:String(e)}function Iv(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Lv(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Rv);return i(),o}function Rv(e,t,n){return`>`+(n?``:` `)+e}function zv(e,t){return Bv(e,t.inConstruct,!0)&&!Bv(e,t.notInConstruct,!1)}function Bv(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Vv(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
25
+ `&&zv(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
26
+ `}function Hv(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Uv(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Wv(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Gv(e,t,n,r){let i=Wv(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Uv(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Kv);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Hv(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
27
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
28
+ `),a&&(u+=s.move(a+`
29
+ `)),u+=s.move(c),l(),u}function Kv(e,t,n){return(n?``:` `)+e}function qv(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Jv(e,t,n,r){let i=qv(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
30
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Yv(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Xv(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Zv(e,t,n){let r=_p(e),i=_p(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Qv.peek=$v;function Qv(e,t,n,r){let i=Yv(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Zv(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Xv(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Zv(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Xv(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function $v(e,t,n){return n.options.emphasis||`*`}function ey(e,t){let n=!1;return Vg(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Lf(e)&&(t.options.setext||n))}function ty(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(ey(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
31
+ `,after:`
32
+ `});return r(),t(),o+`
33
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
34
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
35
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=Xv(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}ny.peek=ry;function ny(e){return e.value||``}function ry(){return`<`}iy.peek=ay;function iy(e,t,n,r){let i=qv(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function ay(){return`!`}oy.peek=sy;function oy(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function sy(){return`!`}cy.peek=ly;function cy(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function ly(){return"`"}function uy(e,t){let n=Lf(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}dy.peek=fy;function dy(e,t,n,r){let i=qv(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(uy(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function fy(e,t,n){return uy(e,n)?`<`:`[`}py.peek=my;function py(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function my(){return`[`}function hy(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function gy(e){let t=hy(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function _y(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function vy(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function yy(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?_y(n):hy(n),s=e.ordered?o===`.`?`)`:`.`:gy(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),vy(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function by(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function xy(e,t,n,r){let i=by(n),a=n.bulletCurrent||hy(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Sy(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Cy=Ag([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function wy(e,t,n,r){return(e.children.some(function(e){return Cy(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ty(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ey.peek=Dy;function Ey(e,t,n,r){let i=Ty(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Zv(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Xv(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Zv(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Xv(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Dy(e,t,n){return n.options.strong||`*`}function Oy(e,t,n,r){return n.safe(e.value,r)}function ky(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Ay(e,t,n){let r=(vy(n)+(n.options.ruleSpaces?` `:``)).repeat(ky(n));return n.options.ruleSpaces?r.slice(0,-1):r}var jy={blockquote:Lv,break:Vv,code:Gv,definition:Jv,emphasis:Qv,hardBreak:Vv,heading:ty,html:ny,image:iy,imageReference:oy,inlineCode:cy,link:dy,linkReference:py,list:yy,listItem:xy,paragraph:Sy,root:wy,strong:Ey,text:Oy,thematicBreak:Ay};function My(){return{enter:{table:Ny,tableData:Ly,tableHeader:Ly,tableRow:Fy},exit:{codeText:Ry,table:Py,tableData:Iy,tableHeader:Iy,tableRow:Iy}}}function Ny(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Py(e){this.exit(e),this.data.inTable=void 0}function Fy(e){this.enter({type:`tableRow`,children:[]},e)}function Iy(e){this.exit(e)}function Ly(e){this.enter({type:`tableCell`,children:[]},e)}function Ry(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,zy));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function zy(e,t){return t===`|`?t:e}function By(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
36
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
37
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Pv(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=jy.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Vy(){return{exit:{taskListCheckValueChecked:Uy,taskListCheckValueUnchecked:Uy,paragraph:Wy}}}function Hy(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Gy}}}function Uy(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Wy(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Gy(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=jy.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Ky(){return[Q_(),Sv(),Dv(),My(),Vy()]}function qy(e){return{extensions:[$_(),Cv(e),Ov(),By(e),Hy()]}}var Jy={tokenize:cb,partial:!0},Yy={tokenize:lb,partial:!0},Xy={tokenize:ub,partial:!0},Zy={tokenize:db,partial:!0},Qy={tokenize:fb,partial:!0},$y={name:`wwwAutolink`,tokenize:ob,previous:pb},eb={name:`protocolAutolink`,tokenize:sb,previous:mb},tb={name:`emailAutolink`,tokenize:ab,previous:hb},nb={};function rb(){return{text:nb}}for(var ib=48;ib<123;)nb[ib]=tb,ib++,ib===58?ib=65:ib===91&&(ib=97);nb[43]=tb,nb[45]=tb,nb[46]=tb,nb[95]=tb,nb[72]=[tb,eb],nb[104]=[tb,eb],nb[87]=[tb,$y],nb[119]=[tb,$y];function ab(e,t,n){let r=this,i,a;return o;function o(t){return!gb(t)||!hb.call(r,r.previous)||_b(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return gb(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Qy,u,l)(t):t===45||t===95||Qf(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Zf(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function ob(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!pb.call(r,r.previous)||_b(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Jy,e.attempt(Yy,e.attempt(Xy,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function sb(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&mb.call(r,r.previous)&&!_b(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Zf(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||ep(t)||ip(t)||sp(t)||op(t)?n(t):e.attempt(Yy,e.attempt(Xy,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function cb(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function lb(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Zy,c,s)(t):t===null||ip(t)||sp(t)||t!==45&&op(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function ub(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Zy,t,a)(o):o===null||ip(o)||sp(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function db(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||ip(o)||sp(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||ip(e)||sp(e)?t(e):r(e)}function a(e){return Zf(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Zf(t)?(e.consume(t),o):n(t)}}function fb(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Qf(e)?n(e):t(e)}}function pb(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ip(e)}function mb(e){return!Zf(e)}function hb(e){return!(e===47||gb(e))}function gb(e){return e===43||e===45||e===46||e===95||Qf(e)}function _b(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var vb={tokenize:Eb,partial:!0};function yb(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Cb,continuation:{tokenize:wb},exit:Tb}},text:{91:{name:`gfmFootnoteCall`,tokenize:Sb},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:bb,resolveTo:xb}}}}function bb(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Xf(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function xb(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Sb(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||ip(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Xf(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return ip(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Cb(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||ip(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Xf(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return ip(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),up(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function wb(e,t,n){return e.check(Tp,t,e.attempt(vb,t,n))}function Tb(e){e.exit(`gfmFootnoteDefinition`)}function Eb(e,t,n){let r=this;return up(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Db(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Uf(o,o.length,0,vp(s,e.slice(r+1,n),t)),Uf(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Uf(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=_p(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=_p(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Ob=class{constructor(){this.map=[]}add(e,t,n){kb(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function kb(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Ab(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function jb(){return{flow:{null:{name:`table`,tokenize:Mb,resolveAll:Nb}}}}function Mb(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):ap(t)?up(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||ip(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,ap(t)?up(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return ap(t)?up(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return ap(t)?up(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Q(n)?(e.exit(`tableRow`),t(n)):ap(n)?up(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||ip(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Nb(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Ob;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Fb(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Pb(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Pb(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Pb(f,t,o,i,n,d)):(o[0]=o[1],d=Pb(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Fb(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Ab(t.events,n))}return e}function Pb(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Ib(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Ib(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Ib(t.events,n[2]),a=Ib(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Ib(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Fb(e,t,n,r,i){let a=[],o=Ib(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Ib(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Lb={name:`tasklistCheck`,tokenize:zb};function Rb(){return{text:{91:Lb}}}function zb(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return ip(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Q(r)?t(r):ap(r)?e.check({tokenize:Bb},t,n)(r):n(r)}}function Bb(e,t,n){return up(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Vb(e){return Kf([rb(),yb(),Db(e),jb(),Rb()])}var Hb={};function Ub(e){let t=this,n=e||Hb,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Vb(n)),a.push(Ky()),o.push(qy(n))}var Wb=l(o(((e,t)=>{var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){n||={};var r,a;switch(i.util.type(t)){case`Object`:if(a=i.util.objId(t),n[a])return n[a];for(var o in r={},n[a]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case`Array`:return a=i.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return`none`},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,`gi`),``),e.classList.add(`language-`+n)},currentScript:function(){if(typeof document>`u`)return null;if(document.currentScript&&document.currentScript.tagName===`SCRIPT`)return document.currentScript;try{throw Error()}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName(`script`);for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r||=i.languages;var a=r[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=r[e];return r[e]=o,i.languages.DFS(i.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,r,a){a||={};var o=i.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var c=t[s],l=i.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:`code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code`};i.hooks.run(`before-highlightall`,r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run(`before-all-elements-highlight`,r);for(var a=0,o;o=r.elements[a++];)i.highlightElement(o,t===!0,r.callback)},highlightElement:function(t,n,r){var a=i.util.getLanguage(t),o=i.languages[a];i.util.setLanguage(t,a);var s=t.parentElement;s&&s.nodeName.toLowerCase()===`pre`&&i.util.setLanguage(s,a);var c={element:t,language:a,grammar:o,code:t.textContent};function l(e){c.highlightedCode=e,i.hooks.run(`before-insert`,c),c.element.innerHTML=c.highlightedCode,i.hooks.run(`after-highlight`,c),i.hooks.run(`complete`,c),r&&r.call(c.element)}if(i.hooks.run(`before-sanity-check`,c),s=c.element.parentElement,s&&s.nodeName.toLowerCase()===`pre`&&!s.hasAttribute(`tabindex`)&&s.setAttribute(`tabindex`,`0`),!c.code){i.hooks.run(`complete`,c),r&&r.call(c.element);return}if(i.hooks.run(`before-highlight`,c),!c.grammar){l(i.util.encode(c.code));return}if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){l(e.data)},u.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else l(i.highlight(c.code,c.grammar,c.language))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run(`after-tokenize`,r),a.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new c;return l(i,i.head,e),s(e,i,t,i.head,0),d(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(!(!n||!n.length))for(var r=0,a;a=n[r++];)a(t)}},Token:a};e.Prism=i;function a(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}a.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var r=``;return t.forEach(function(t){r+=e(t,n)}),r}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),i.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`&quot;`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function o(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function s(e,t,n,r,c,d){for(var f in n)if(!(!n.hasOwnProperty(f)||!n[f])){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=r.next,C=c;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof a)){var T=1,E;if(v){if(E=o(x,C,e,_),!E||E.index>=e.length)break;var D=E.index,O=E.index+E[0].length,k=C;for(k+=S.value.length;D>=k;)S=S.next,k+=S.value.length;if(k-=S.value.length,C=k,S.value instanceof a)continue;for(var ee=S;ee!==t.tail&&(k<O||typeof ee.value==`string`);ee=ee.next)T++,k+=ee.value.length;T--,w=e.slice(C,k),E.index-=C}else if(E=o(x,0,w,_),!E)continue;var D=E.index,te=E[0],ne=w.slice(0,D),A=w.slice(D+te.length),j=C+w.length;d&&j>d.reach&&(d.reach=j);var re=S.prev;ne&&(re=l(t,re,ne),C+=ne.length),u(t,re,T);var M=new a(f,g?i.tokenize(te,g):te,y,te);if(S=l(t,re,M),A&&l(t,S,A),T>1){var N={cause:f+`,`+m,reach:j};s(e,t,n,S.prev,C,N),d&&N.reach>d.reach&&(d.reach=N.reach)}}}}}}function c(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function d(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}if(!e.document)return e.addEventListener&&(i.disableWorkerMessageHandler||e.addEventListener(`message`,function(t){var n=JSON.parse(t.data),r=n.language,a=n.code,o=n.immediateClose;e.postMessage(i.highlight(a,i.languages[r],r)),o&&e.close()},!1)),i;var f=i.util.currentScript();f&&(i.filename=f.src,f.hasAttribute(`data-manual`)&&(i.manual=!0));function p(){i.manual||i.highlightAll()}if(!i.manual){var m=document.readyState;m===`loading`||m===`interactive`&&f&&f.defer?document.addEventListener(`DOMContentLoaded`,p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return i}(typeof window<`u`?window:typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope?self:{});t!==void 0&&t.exports&&(t.exports=n),typeof global<`u`&&(global.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside[`attr-value`].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside[`internal-subset`].inside=n.languages.markup,n.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&amp;/,`&`))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var a={};a[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:i},n.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(e,t){n.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:n.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend(`markup`,{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend(`clike`,{"class-name":[n.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),n.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),n.languages.markup&&(n.languages.markup.tag.addInlined(`script`,`javascript`),n.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),n.languages.js=n.languages.javascript,(function(){if(n===void 0||typeof document>`u`)return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e=`Loading…`,t=function(e,t){return`✖ Error `+e+` while fetching file: `+t},r=`✖ Error: File does not exist or is empty`,i={js:`javascript`,py:`python`,rb:`ruby`,ps1:`powershell`,psm1:`powershell`,sh:`bash`,bat:`batch`,h:`c`,tex:`latex`},a=`data-src-status`,o=`loading`,s=`loaded`,c=`failed`,l=`pre[data-src]:not([`+a+`="`+s+`"]):not([`+a+`="`+o+`"])`;function u(e,n,i){var a=new XMLHttpRequest;a.open(`GET`,e,!0),a.onreadystatechange=function(){a.readyState==4&&(a.status<400&&a.responseText?n(a.responseText):a.status>=400?i(t(a.status,a.statusText)):i(r))},a.send(null)}function d(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||``);if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}n.hooks.add(`before-highlightall`,function(e){e.selector+=`, `+l}),n.hooks.add(`before-sanity-check`,function(t){var r=t.element;if(r.matches(l)){t.code=``,r.setAttribute(a,o);var f=r.appendChild(document.createElement(`CODE`));f.textContent=e;var p=r.getAttribute(`data-src`),m=t.language;if(m===`none`){var h=(/\.(\w+)$/.exec(p)||[,`none`])[1];m=i[h]||h}n.util.setLanguage(f,m),n.util.setLanguage(r,m);var g=n.plugins.autoloader;g&&g.loadLanguages(m),u(p,function(e){r.setAttribute(a,s);var t=d(r.getAttribute(`data-range`));if(t){var i=e.split(/\r\n?|\n/g),o=t[0],c=t[1]==null?i.length:t[1];o<0&&(o+=i.length),o=Math.max(0,Math.min(o-1,i.length)),c<0&&(c+=i.length),c=Math.max(0,Math.min(c,i.length)),e=i.slice(o,c).join(`
38
+ `),r.hasAttribute(`data-start`)||r.setAttribute(`data-start`,String(o+1))}f.textContent=e,n.highlightElement(f)},function(e){r.setAttribute(a,c),f.textContent=e})}}),n.plugins.fileHighlight={highlight:function(e){for(var t=(e||document).querySelectorAll(l),r=0,i;i=t[r++];)n.highlightElement(i)}};var f=!1;n.fileHighlight=function(){f||=(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()}))(),1);function Gb(e){return typeof e==`object`&&!!e&&`languages`in e}var Kb=globalThis,qb=Gb(Kb.Prism)?Kb.Prism:Wb.default;Kb.Prism=qb,typeof window<`u`&&(window.Prism=qb);var Jb;function Yb(){if(Jb!==void 0)return Jb;let e=dx();if(!e)return Jb=!1,Jb;try{let t=new URL(e.location.href).searchParams.get(`debugStreaming`);Jb=t===null?e.localStorage.getItem(`pibo.chat.debugStreaming`)===`1`:t!==`0`&&t!==`false`}catch{Jb=!1}return Jb}function Xb(e,t){sx(e,e=>{e.liveOpenCount+=1,e.lastReadyState=t})}function Zb(e,t){sx(e,e=>{e.liveErrorCount+=1,e.lastReadyState=t})}function Qb(e,t,n,r){sx(e,e=>{let i=px();e.eventCount+=1,e.eventTypeCounts[t.type]=(e.eventTypeCounts[t.type]??0)+1,e.lastEventAt=i,e.firstEventAt??=i,e.lastReadyState=r;let a=n||t.streamFrameId;if(a){e.lastEventId=a;let t=ox(a);t===`durable`?e.lastDurableCursor=a:t===`transient`&&(e.lastTransientLiveId=a)}t.type===`TEXT_MESSAGE_CONTENT`&&typeof t.delta==`string`?(e.firstTextDeltaAt??=i,e.textDeltaCount+=1,e.textDeltaBytes+=fx(t.delta)):t.type===`REASONING_MESSAGE_CONTENT`&&typeof t.delta==`string`&&(e.firstReasoningDeltaAt??=i,e.reasoningDeltaCount+=1,e.reasoningDeltaBytes+=fx(t.delta))})}function $b(e,t,n,r){sx(e,e=>{if(e.firstEnqueueAt??=px(),e.enqueueCount+=1,r&&(e.enqueueFlushImmediateCount+=1),e.pendingEventCount=n,t.streamFrameId){let n=ox(t.streamFrameId);n===`durable`?e.lastDurableCursor=t.streamFrameId:n===`transient`&&(e.lastTransientLiveId=t.streamFrameId)}})}function ex(e,t,n){sx(e,e=>{let r=px();e.firstFlushAt??=r,e.firstOverlayUpdateAt??=r,e.flushCount+=1,e.flushedEventCount+=t,e.pendingEventCount=0,e.overlayUpdateCount+=1,e.overlayEventCount=n,e.lastFlushAt=r})}function tx(e,t){sx(e,e=>{let n=mx(t);e.liveTraceComputeCount+=1,e.liveTraceComputeDurationMsLast=n,e.liveTraceComputeDurationMsTotal+=n,e.liveTraceComputeDurationMsMax=Math.max(e.liveTraceComputeDurationMsMax??0,n)})}function nx(e,t){cx(n=>{let r=mx(t);n.markdownRenderCount+=1,n.markdownRenderDurationMsLast=r,n.markdownRenderDurationMsTotal+=r,n.markdownRenderDurationMsMax=Math.max(n.markdownRenderDurationMsMax??0,r),e===`plain`?(n.markdownRenderPlainCount+=1,n.markdownRenderPlainDurationMsTotal+=r,n.markdownRenderPlainDurationMsMax=Math.max(n.markdownRenderPlainDurationMsMax??0,r)):e===`gfm-fast`?(n.markdownRenderGfmFastCount+=1,n.markdownRenderGfmFastDurationMsTotal+=r,n.markdownRenderGfmFastDurationMsMax=Math.max(n.markdownRenderGfmFastDurationMsMax??0,r)):(n.markdownRenderFullCount+=1,n.markdownRenderFullDurationMsTotal+=r,n.markdownRenderFullDurationMsMax=Math.max(n.markdownRenderFullDurationMsMax??0,r),e===`gfm`?(n.markdownRenderGfmCount+=1,n.markdownRenderGfmDurationMsTotal+=r,n.markdownRenderGfmDurationMsMax=Math.max(n.markdownRenderGfmDurationMsMax??0,r)):(n.markdownRenderCommonMarkCount+=1,n.markdownRenderCommonMarkDurationMsTotal+=r,n.markdownRenderCommonMarkDurationMsMax=Math.max(n.markdownRenderCommonMarkDurationMsMax??0,r)))})}function rx(e,t){sx(e,e=>{e.traceRefreshScheduledCount+=1,e.lastTraceRefreshScheduledAt=px(),e.lastTraceRefreshDelayMs=t})}function ix(e,t){sx(e,e=>{t.traceBaseUpdated&&(e.traceBaseUpdateCount+=1),e.overlayEventCount=t.overlayEventCount,t.traceBaseOutputLength!==void 0&&(e.traceBaseOutputLength=t.traceBaseOutputLength),t.currentOutputLength!==void 0&&(e.currentOutputLength=t.currentOutputLength)})}function ax(e){let t=dx();if(!t?.__piboStreamingBenchmarkShouldDropOverlayEvent)return!1;try{return!!t.__piboStreamingBenchmarkShouldDropOverlayEvent(e)}catch{return!1}}function ox(e){return e?/^live:\d+$/.test(e)?`transient`:/^\d+:\d+$/.test(e)?`durable`:`other`:`missing`}function sx(e,t){cx(n=>{n.sessionIds.includes(e)||n.sessionIds.push(e),n.selectedPiboSessionId=e,t(n)})}function cx(e){let t=lx();t&&(e(t),t.updatedAt=px())}function lx(){if(!Yb())return;let e=dx();if(e)return e.__piboStreamingDebugReset||=()=>(e.__piboStreamingDebug=ux(),e.__piboStreamingDebug),e.__piboStreamingDebug??=ux(),e.__piboStreamingDebug}function ux(){let e=px();return{enabled:!0,startedAt:e,updatedAt:e,sessionIds:[],liveOpenCount:0,liveErrorCount:0,eventCount:0,eventTypeCounts:{},textDeltaCount:0,textDeltaBytes:0,reasoningDeltaCount:0,reasoningDeltaBytes:0,enqueueCount:0,enqueueFlushImmediateCount:0,pendingEventCount:0,flushCount:0,flushedEventCount:0,overlayUpdateCount:0,overlayEventCount:0,liveTraceComputeCount:0,liveTraceComputeDurationMsTotal:0,markdownRenderCount:0,markdownRenderPlainCount:0,markdownRenderFullCount:0,markdownRenderCommonMarkCount:0,markdownRenderGfmCount:0,markdownRenderGfmFastCount:0,markdownRenderDurationMsTotal:0,markdownRenderPlainDurationMsTotal:0,markdownRenderFullDurationMsTotal:0,markdownRenderCommonMarkDurationMsTotal:0,markdownRenderGfmDurationMsTotal:0,markdownRenderGfmFastDurationMsTotal:0,traceRefreshScheduledCount:0,traceRefreshStartedCount:0,traceRefreshCompletedCount:0,traceRefreshFailedCount:0,traceRefreshDurationMsTotal:0,traceBaseUpdateCount:0}}function dx(){return typeof window>`u`?void 0:window}function fx(e){return typeof TextEncoder<`u`?new TextEncoder().encode(e).byteLength:e.length}function px(){return new Date().toISOString()}function mx(e){return Math.max(0,Math.round(e*1e3)/1e3)}(function(e){var t=`\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b`,n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:`punctuation`,inside:null},r={bash:n,environment:{pattern:RegExp(`\\$`+t),alias:`constant`},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp(`(\\{)`+t),lookbehind:!0,alias:`constant`}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:`important`},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:`function`},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:`function`}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:`variable`,lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp(`(^|[\\s;|&]|[<>]\\()`+t),lookbehind:!0,alias:`constant`}},alias:`variable`,lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:`variable`,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp(`\\$?`+t),alias:`constant`},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:`class-name`},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:`important`},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:`important`}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=[`comment`,`function-name`,`for-or-select`,`assign-left`,`parameter`,`string`,`environment`,`function`,`keyword`,`builtin`,`boolean`,`file-descriptor`,`operator`,`punctuation`,`number`],a=r.variable[1].inside,o=0;o<i.length;o++)a[i[o]]=e.languages.bash[i[o]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash})(Prism),(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(Prism),Prism.languages.javascript=Prism.languages.extend(`clike`,{"class-name":[Prism.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),Prism.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined(`script`,`javascript`),Prism.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),Prism.languages.js=Prism.languages.javascript,Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},Prism.languages.webmanifest=Prism.languages.json,(function(e){function t(e){return e=e.replace(/<inner>/g,function(){return`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var n="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",r=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return n}),i=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`;e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+r+i+`(?:`+r+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+r+i+`)(?:`+r+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(n),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+r+`)`+i+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+r+`$`),inside:{"table-header":{pattern:RegExp(n),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:t(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:t(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:t(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:t(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){if(e.language!==`markdown`&&e.language!==`md`)return;function t(e){if(!(!e||typeof e==`string`))for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.type!==`code`){t(i.content);continue}var a=i.content[1],o=i.content[3];if(a&&o&&a.type===`code-language`&&o.type===`code-block`&&typeof a.content==`string`){var s=a.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`);s=(/[a-z][\w-]*/i.exec(s)||[``])[0].toLowerCase();var c=`language-`+s;o.alias?typeof o.alias==`string`?o.alias=[o.alias,c]:o.alias.push(c):o.alias=[c]}}}t(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],o=/language-(.+)/.exec(a);if(o){n=o[1];break}}var s=e.languages[n];if(s)t.content=e.highlight(c(t.content),s,n);else if(n&&n!==`none`&&e.plugins.autoloader){var l=`md-`+new Date().valueOf()+`-`+Math.floor(Math.random()*0x2386f26fc10000);t.attributes.id=l,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(l);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))})}}});var a=RegExp(e.languages.markup.tag.pattern.source,`gi`),o={amp:`&`,lt:`<`,gt:`>`,quot:`"`},s=String.fromCodePoint||String.fromCharCode;function c(e){var t=e.replace(a,``);return t=t.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(e,t){return t=t.toLowerCase(),t[0]===`#`?s(t[1]===`x`?parseInt(t.slice(2),16):Number(t.slice(1))):o[t]||e}),t}e.languages.md=e.languages.markdown})(Prism),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism),(function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r=`(?:`+n.source+`(?:[ ]+`+t.source+`)?|`+t.source+`(?:[ ]+`+n.source+`)?)`,i=`(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&'*,\\-:>?@[\\]\`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \\t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*`.replace(/<PLAIN>/g,function(){return`[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]`}),a=`"(?:[^"\\\\\\r\\n]|\\\\.)*"|'(?:[^'\\\\\\r\\n]|\\\\.)*'`;function o(e,t){t=(t||``).replace(/m/g,``)+`m`;var n=`([:\\-,[{]\\s*(?:\\s<<prop>>[ \\t]+)?)(?:<<value>>)(?=[ \\t]*(?:$|,|\\]|\\}|(?:[\\r\\n]\\s*)?#))`.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<<prop>>[ \\t]+)?[|>])[ \\t]*(?:((?:\\r?\\n|\\r)[ \\t]+)\\S[^\\r\\n]*(?:\\2[^\\r\\n]+)*)`.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:`string`},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\\r\\n?])[ \\t]*(?:<<prop>>[ \\t]+)?)<<key>>(?=\\s*:\\s)`.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return`(?:`+i+`|`+a+`)`})),lookbehind:!0,greedy:!0,alias:`atrule`},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:`important`},datetime:{pattern:o(`\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \\t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \\t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?`),lookbehind:!0,alias:`number`},boolean:{pattern:o(`false|true`,`i`),lookbehind:!0,alias:`important`},null:{pattern:o(`null|~`,`i`),lookbehind:!0,alias:`important`},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(`[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)`,`i`),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(Prism);var hx=[`p`,`br`,`strong`,`em`,`a`,`ul`,`ol`,`li`,`blockquote`,`code`,`pre`,`h1`,`h2`,`h3`,`h4`,`hr`,`table`,`thead`,`tbody`,`tr`,`th`,`td`,`input`,`del`],gx=[Ub],_x=[],vx=/[\n\r\\`*_\[\]<>]|~~/,yx=/^\s*(?:#{1,6}\s|[-+>]|(?:\d+[.)]))\s/,bx=/^\s*-{3,}\s*$/,xx=/\b(?:https?:\/\/|www\.)|\S+@\S+\.\S+/i,Sx=/^\s*[-+*]\s+\[[ xX]\]\s/m,Cx=/(^|\n)\s*\|?.+\|.+\n\s*\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)+\|?\s*(?:\n|$)/;function wx(e){return e.length>0&&!vx.test(e)&&!yx.test(e)&&!bx.test(e)&&!(Tx(e)&&xx.test(e))}function Tx(e){return e.includes(`://`)||e.includes(`www.`)||e.includes(`@`)}function Ex(e){let t=Dx(e);return t?t.openerEnd>=e.length?e.slice(0,t.openerStart):`${e}\``:e}function Dx(e){let t=0;for(;t<e.length;){let n=e.indexOf("`",t);if(n===-1)return;if(Ax(e,n)){t=n+1;continue}if(kx(e,n)!==1)return;let r=Ox(e,n+1);if(r===-1)return{openerStart:n,openerEnd:n+1};t=r+1}}function Ox(e,t){for(;t<e.length;){let n=e.indexOf("`",t);if(n===-1)return-1;let r=kx(e,n);if(r===1)return n;t=n+r}return-1}function kx(e,t){let n=t;for(;n<e.length&&e[n]==="`";)n+=1;return n-t}function Ax(e,t){let n=0,r=t-1;for(;r>=0&&e[r]===`\\`;)n+=1,--r;return n%2==1}function jx(e){return e.includes(`~~`)||e.includes(`[`)&&Sx.test(e)||e.includes(`|`)&&Cx.test(e)||Tx(e)&&xx.test(e)}var Mx=/[\n\r\\`*_\[\]<>]/,Nx=/^\s*[-+*]\s+\[([ xX])\]\s+(.+?)\s*$/,Px=/[\n\r\\<>|~]/,Fx=/[\n\r\\\[\]<>|~]/,Ix=/[\s\[\]()`<>]/;function Lx(e){if(!e.includes(`~~`)||Mx.test(e)||yx.test(e)||bx.test(e)||Tx(e)&&xx.test(e)||e.includes(`[`)&&Sx.test(e)||e.includes(`|`)&&Cx.test(e))return;let t=[],n=0,r=0;for(;n<e.length;){let i=e.indexOf(`~~`,n);if(i===-1){t.push(e.slice(n));break}let a=e.indexOf(`~~`,i+2);if(a===-1||a===i+2)return;let o=e.slice(n,i);o&&t.push(o);let s=e.slice(i+2,a);if(s.includes(`~`))return;t.push((0,I.jsx)(`del`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`del`,children:s},`del-${r}`)),r+=1,n=a+2}return r>0?(0,I.jsx)(`p`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`p`,children:t}):void 0}function Rx(e){if(!e||Ix.test(e))return;let t=U_(e);if(t){if(t.startsWith(`/`)||t.startsWith(`#`))return t;try{let e=new URL(t);return e.protocol===`http:`||e.protocol===`https:`||e.protocol===`mailto:`?t:void 0}catch{return}}}function zx(e,t){if(!e||Fx.test(e))return;let n=[],r=0,i=0,a=0,o=0;for(;r<e.length;){let s=e.indexOf(`**`,r),c=e.indexOf(`_`,r),l=e.indexOf("`",r),u=s===-1?1/0:s,d=c===-1?1/0:c,f=Math.min(u,d,l===-1?1/0:l);if(f===1/0){let t=e.slice(r);if(t.includes(`*`)||t.includes(`_`)||t.includes("`")||Tx(t)&&xx.test(t))return;t&&n.push(t);break}let p=e.slice(r,f);if(p.includes(`*`)||p.includes(`_`)||p.includes("`")||Tx(p)&&xx.test(p))return;if(p&&n.push(p),f===u){let a=e.indexOf(`**`,f+2);if(a===-1||a===f+2)return;let o=e.slice(f+2,a);if(o.includes(`*`)||o.includes("`")||o.includes(`[`)||o.includes(`]`))return;if(o.includes(`_`)){if(!o.startsWith(`_`)||!o.endsWith(`_`)||o.length<=2)return;let e=o.slice(1,-1);if(e.includes(`*`)||e.includes(`_`)||e.includes("`")||e.includes(`[`)||e.includes(`]`))return;n.push((0,I.jsx)(`strong`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`strong`,children:(0,I.jsx)(`em`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`em`,children:e})},`link-${t}-strong-${i}`))}else n.push((0,I.jsx)(`strong`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`strong`,children:o},`link-${t}-strong-${i}`));i+=1,r=a+2}else if(f===d){if(e[f+1]===`_`)return;let i=e.indexOf(`_`,f+1);if(i===-1||i===f+1)return;let o=e.slice(f+1,i);if(o.includes(`**`)){if(!o.startsWith(`**`)||!o.endsWith(`**`)||o.length<=4)return;let e=o.slice(2,-2);if(e.includes(`*`)||e.includes(`_`)||e.includes("`")||e.includes(`[`)||e.includes(`]`))return;n.push((0,I.jsx)(`em`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`em`,children:(0,I.jsx)(`strong`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`strong`,children:e})},`link-${t}-em-${a}`))}else{if(o.includes(`*`)||o.includes(`_`)||o.includes("`")||o.includes(`[`)||o.includes(`]`))return;n.push((0,I.jsx)(`em`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`em`,children:o},`link-${t}-em-${a}`))}a+=1,r=i+1}else{if(e[f+1]==="`")return;let i=e.indexOf("`",f+1);if(i===-1||i===f+1)return;let a=e.slice(f+1,i);if(a.includes("`")||a.includes(`[`)||a.includes(`]`)||a.startsWith(` `)||a.endsWith(` `))return;n.push((0,I.jsx)(`code`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`code`,children:a},`link-${t}-code-${o}`)),o+=1,r=i+1}}return n.length>0?n:void 0}function Bx(e){let t=[],n=0,r=0,i=0,a=0;for(;n<e.length;){let o=e.indexOf(`**`,n),s=e.indexOf("`",n),c=e.indexOf(`[`,n),l=o===-1?1/0:o,u=s===-1?1/0:s,d=Math.min(l,u,c===-1?1/0:c);if(d===1/0){let r=e.slice(n);if(r.includes(`*`)||r.includes(`_`)||r.includes("`")||r.includes(`[`)||r.includes(`]`)||Tx(r)&&xx.test(r))return;r&&t.push(r);break}let f=e.slice(n,d);if(f.includes(`*`)||f.includes(`_`)||f.includes("`")||f.includes(`[`)||f.includes(`]`)||Tx(f)&&xx.test(f))return;if(f&&t.push(f),d===l){let i=e.indexOf(`**`,d+2);if(i===-1||i===d+2)return;let a=e.slice(d+2,i);if(a.includes(`*`)||a.includes(`_`)||a.includes("`")||a.includes(`[`)||a.includes(`]`))return;t.push((0,I.jsx)(`strong`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`strong`,children:a},`strong-${r}`)),r+=1,n=i+2}else if(d===u){if(e[d+1]==="`")return;let r=e.indexOf("`",d+1);if(r===-1||r===d+1)return;let a=e.slice(d+1,r);if(a.includes(`_`)||a.includes("`")||a.includes(`[`)||a.includes(`]`)||a.startsWith(` `)||a.endsWith(` `))return;t.push((0,I.jsx)(`code`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`code`,children:a},`code-${i}`)),i+=1,n=r+1}else{let r=e.indexOf(`](`,d+1);if(r===-1||r===d+1)return;let i=e.indexOf(`)`,r+2);if(i===-1||i===r+2)return;let o=zx(e.slice(d+1,r),a),s=Rx(e.slice(r+2,i));if(!s||!o)return;t.push((0,I.jsx)(`a`,{href:s,target:`_blank`,rel:`noreferrer`,"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`a`,children:o},`link-${a}`)),a+=1,n=i+1}}return t.length>0?t:void 0}function Vx(e){let t=Nx.exec(e);if(!t)return;let n=t[2];if(!n||Px.test(n))return;let r=Bx(n);if(!r)return;let i=t[1].toLowerCase()===`x`;return(0,I.jsx)(`ul`,{className:`contains-task-list`,"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`ul`,children:(0,I.jsxs)(`li`,{className:`task-list-item`,"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`li`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:i,readOnly:!0,disabled:!0,"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`input`}),r]})})}var Hx={p({children:e,node:t,...n}){return(0,I.jsx)(`p`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`p`,...n,children:e})},ul({children:e,node:t,...n}){return(0,I.jsx)(`ul`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`ul`,...n,children:e})},ol({children:e,node:t,...n}){return(0,I.jsx)(`ol`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`ol`,...n,children:e})},li({children:e,node:t,...n}){return(0,I.jsx)(`li`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`li`,...n,children:e})},blockquote({children:e,node:t,...n}){return(0,I.jsx)(`blockquote`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`blockquote`,...n,children:e})},pre({children:e,node:t,...n}){return(0,I.jsx)(`pre`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`pre`,...n,children:e})},a({href:e,children:t}){return(0,I.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`a`,children:t})},code({className:e,children:t,node:n,...r}){let i=Ux(e),a=String(t).replace(/\n$/,``);if(!i)return(0,I.jsx)(`code`,{className:e,"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`code`,...r,children:t});let o=qb.languages[i];return o?(0,I.jsx)(`code`,{className:`language-${i}`,"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`code`,dangerouslySetInnerHTML:{__html:qb.highlight(a,o,i)},...r}):(0,I.jsx)(`code`,{className:e,"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`code`,...r,children:t})},th({children:e,node:t,...n}){return(0,I.jsx)(`th`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`th`,...n,children:e})},td({children:e,node:t,...n}){return(0,I.jsx)(`td`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`td`,...n,children:e})},input({checked:e,node:t,...n}){return(0,I.jsx)(`input`,{type:`checkbox`,checked:!!e,readOnly:!0,disabled:!0,"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`input`,...n})}};function Ux(e){let t=/language-(\S+)/.exec(e??``);if(!t)return;let n=t[1].toLowerCase();return n===`sh`||n===`shell`?`bash`:n===`js`?`javascript`:n===`ts`?`typescript`:n===`md`?`markdown`:n===`yml`?`yaml`:n}function Wx(e,t){t!==void 0&&nx(e,(typeof performance>`u`?Date.now():performance.now())-t)}var Gx=(e,t,n)=>{if(n.tagName!==`a`||t!==`href`)return``;let r=U_(e);if(!r)return``;if(r.startsWith(`/`)||r.startsWith(`#`))return r;try{let e=new URL(r);return e.protocol===`http:`||e.protocol===`https:`||e.protocol===`mailto:`?r:``}catch{return``}},Kx=(0,F.memo)(function({children:e,streaming:t=!1}){let n=Yb()?typeof performance>`u`?Date.now():performance.now():void 0,r=t?Ex(e):e,i=`commonmark`,a;if(wx(r))i=`plain`,a=(0,I.jsx)(`p`,{"data-pibo-component":`MarkdownRenderer`,"data-pibo-markdown-node":`p`,children:r});else{let e=jx(r),t=e?Lx(r)??Vx(r):void 0;t?(i=`gfm-fast`,a=t):(i=e?`gfm`:`commonmark`,a=z_({allowedElements:hx,children:r,components:Hx,remarkPlugins:e?gx:_x,skipHtml:!0,urlTransform:Gx}))}return Wx(i,n),a});function qx(e){let t=e.pibo?.traceNodeType;return t?t===`tool.call`||t===`tool.result`||t===`agent.delegation`:e.spanType===`tool.call`||e.spanType===`tool.result`||e.spanType===`agent.delegation`}var Jx={"agent.run":{color:`text-[#11a4d4]`,bgColor:`bg-[#11a4d4]/20`,borderColor:`border-[#11a4d4]`,label:`Agent Run`},"tool.call":{color:`text-purple-500`,bgColor:`bg-purple-500/20`,borderColor:`border-purple-500`,label:`Tool Call`},"tool.result":{color:`text-green-500`,bgColor:`bg-green-500/20`,borderColor:`border-green-500`,label:`Tool Result`},"model.request":{color:`text-blue-500`,bgColor:`bg-blue-500/20`,borderColor:`border-blue-500`,label:`Model Request`},"model.response":{color:`text-[#0bda57]`,bgColor:`bg-[#0bda57]/20`,borderColor:`border-[#0bda57]`,label:`Model Response`},"model.reasoning":{color:`text-amber-500`,bgColor:`bg-amber-500/20`,borderColor:`border-amber-500`,label:`Reasoning`},"agent.delegation":{color:`text-orange-500`,bgColor:`bg-orange-500/20`,borderColor:`border-orange-500`,label:`Agent Delegation`},"agent.async":{color:`text-orange-500`,bgColor:`bg-orange-500/20`,borderColor:`border-orange-500`,label:`Async Agent`},"yielded.run":{color:`text-[#11a4d4]`,bgColor:`bg-[#11a4d4]/20`,borderColor:`border-[#11a4d4]`,label:`Yielded Run`},"user.prompt":{color:`text-cyan-500`,bgColor:`bg-cyan-500/20`,borderColor:`border-cyan-500`,label:`User Prompt`},user_input:{color:`text-slate-500`,bgColor:`bg-slate-800`,borderColor:`border-slate-600`,label:`User Input`},"execution.command":{color:`text-yellow-500`,bgColor:`bg-yellow-500/20`,borderColor:`border-yellow-500`,label:`Command`}},Yx=12;function Xx(e,t){return t===`all`||e<t}(0,F.memo)(function e({span:t,startTime:n,depth:r=0,expansionDepth:i,expansionSignal:a,expandThinking:o,toolDisplayMode:s=`default`,onFork:c,onOpenSession:l}){let[u,d]=(0,F.useState)(()=>Xx(r,i)),[f,p]=(0,F.useState)(()=>t.spanType===`model.reasoning`?o:Xx(r,i));(0,F.useEffect)(()=>{let e=Xx(r,i);d(e),p(t.spanType===`model.reasoning`?o:e)},[r,i,a,o,t.spanType]),Jx[t.spanType]||Jx[`agent.run`],t.status,t.status,t.spanType===`user.prompt`||t.spanType;let m=!!t.children?.length;lS(t.startTime,n),t.durationUs?`${(t.durationUs/1e3).toFixed(1)}`:t.endTime&&`${((t.endTime-t.startTime)/1e3).toFixed(1)}`;let h=(0,F.useCallback)(()=>{p(e=>!e),m&&d(e=>!e)},[m]);return(0,I.jsx)(Zx,{span:t,startTime:n,depth:r,contentExpanded:f,childrenExpanded:u,onToggle:h,onFork:c,onOpenSession:l,toolDisplayMode:s,childrenContent:m?t.children?.map(t=>(0,I.jsx)(e,{span:t,startTime:n,depth:r+1,expansionDepth:i,expansionSignal:a,expandThinking:o,toolDisplayMode:s,onFork:c,onOpenSession:l},t.id)):void 0})});var Zx=(0,F.memo)(function({span:e,startTime:t,depth:n=0,contentExpanded:r,childrenExpanded:i,onToggle:a,onFork:o,onOpenSession:s,signals:c,toolDisplayMode:l=`default`,childrenContent:u}){let d=Jx[e.spanType]||Jx[`agent.run`],f=e.status===`UNSET`,p=oS(e.status,f),m=e.spanType===`user.prompt`||e.spanType===`user_input`,h=!!e.children?.length,g=l!=="default"&&qx(e),_=lS(e.startTime,t),v=e.durationUs?`${(e.durationUs/1e3).toFixed(1)}ms`:e.endTime?`${((e.endTime-e.startTime)/1e3).toFixed(1)}ms`:null;return e.spanType===`agent.delegation`&&l==="default"?(0,I.jsx)(`div`,{className:`relative mb-4`,"data-pibo-debug":`trace-span`,"data-trace-node-id":e.id,"data-span-type":e.spanType,"data-span-status":e.status,"data-order-source":e.pibo?.source,"data-stable-key":e.pibo?.stableKey,style:{marginLeft:n>0?Yx:0,width:n>0?`calc(100% - ${Yx}px)`:`var(--trace-readable-width)`,maxWidth:`100%`},children:(0,I.jsx)(Zu,{title:e.name,summary:typeof e.attributes.content==`string`?e.attributes.content:void 0,input:e.attributes.input??e.attributes.arguments,output:e.attributes.output??e.attributes.result,error:e.statusMessage,traceStatus:e.status===`UNSET`?`running`:e.status===`ERROR`?`error`:`done`,linkedPiboSessionId:e.pibo?.linkedPiboSessionId,startedAt:new Date(e.startTime/1e3).toISOString(),completedAt:e.endTime?new Date(e.endTime/1e3).toISOString():void 0,durationMs:e.durationUs===void 0?void 0:e.durationUs/1e3,signals:c,onOpenSession:s})}):(0,I.jsx)(`div`,{className:`relative mb-4 group`,"data-pibo-debug":`trace-span`,"data-trace-node-id":e.id,"data-span-type":e.spanType,"data-span-status":e.status,"data-order-source":e.pibo?.source,"data-stable-key":e.pibo?.stableKey,style:{marginLeft:n>0?Yx:0,width:n>0?`calc(100% - ${Yx}px)`:`var(--trace-readable-width)`,maxWidth:`100%`},children:(0,I.jsxs)(`div`,{className:`min-w-0 ${m?`bg-[#11a4d4]/10`:`bg-white dark:bg-[#1a262b]`} border ${p.cardClass} rounded-sm shadow-sm transition-all hover:border-opacity-70 focus:outline-none focus:ring-1 focus:ring-[#11a4d4]/50 ${f?p.glowClass:``}`,onDoubleClick:e=>{g||Qx(e)||a()},onKeyDown:e=>{g||Qx(e)||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},role:g?void 0:`button`,tabIndex:g?void 0:0,"aria-expanded":g?void 0:r,children:[(0,I.jsx)($x,{span:e,config:d,statusStyles:p,isActive:f,contentExpanded:r,duration:v,relativeTime:_,onToggle:a,onFork:o,onOpenSession:s,toolDisplayMode:l}),!g&&r?(0,I.jsx)(nS,{span:e}):null,!g&&h&&i&&r?(0,I.jsx)(`div`,{className:`min-w-0 border-t border-slate-700 bg-slate-900/50 py-4`,children:u}):null]})})});function Qx(e){let t=e.target;if(!(t instanceof Element)||t===e.currentTarget)return!1;let n=t.closest(`button, a, input, textarea, select, summary, [role='button'], [tabindex]:not([tabindex='-1'])`);return!!(n&&n!==e.currentTarget)}function $x({span:e,config:t,statusStyles:n,isActive:r,contentExpanded:i,duration:a,relativeTime:o,onToggle:s,onFork:c,onOpenSession:l,toolDisplayMode:u}){let d=u!=="default"&&qx(e),f=u===`intent`?cS(e.attributes.intent):void 0,p=e.spanType===`user.prompt`||e.spanType===`user_input`?`bg-[#11a4d4]/10`:n.headerClass,m=`${i&&!d?`border-b ${t.borderColor}/20`:``} ${p}`;return(0,I.jsx)(`div`,{className:m,children:(0,I.jsxs)(`div`,{className:`box-border flex w-full min-w-0 items-center`,style:{maxWidth:`100%`},children:[(0,I.jsx)(`div`,{className:`min-w-0 flex-1 px-4 py-2 text-left`,children:(0,I.jsxs)(`span`,{className:`min-w-0 text-xs font-bold ${t.color} uppercase tracking-wider flex items-center gap-2`,children:[d?null:i?(0,I.jsx)(sn,{size:12}):(0,I.jsx)(cn,{size:12}),(0,I.jsx)(eS,{spanType:e.spanType,config:t,isActive:r}),f?(0,I.jsx)(`span`,{className:`min-w-0 truncate normal-case`,children:f}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`shrink-0`,children:t.label}),e.name?(0,I.jsxs)(`span`,{className:`min-w-0 truncate font-normal text-slate-500 dark:text-slate-400 normal-case`,children:[`: `,e.name]}):null]}),r?(0,I.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-[#11a4d4] animate-pulse`}):null]})}),(0,I.jsx)(rS,{forkEntryId:e.pibo?.traceNodeType===`user.message`?e.pibo.entryId:void 0,linkedPiboSessionId:e.pibo?.linkedPiboSessionId,onFork:c,onOpenSession:l}),(0,I.jsx)(tS,{duration:a,relativeTime:o})]})})}function eS({spanType:e,config:t,isActive:n}){return(0,I.jsxs)(`span`,{className:`relative inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full ${t.bgColor} border-2 ${t.borderColor} ${n?`shadow-[0_0_10px_rgba(17,164,212,0.4)]`:``}`,children:[(0,I.jsx)(aS,{type:e,className:t.color}),n?(0,I.jsx)(`span`,{className:`absolute -right-0.5 -top-0.5 h-1.5 w-1.5 rounded-full bg-[#11a4d4] animate-pulse`}):null]})}function tS({duration:e,relativeTime:t}){return(0,I.jsxs)(`div`,{className:`ml-2 mr-4 flex w-36 shrink-0 items-center justify-end gap-2 font-mono tabular-nums`,children:[e?(0,I.jsx)(`span`,{className:`text-[10px] text-slate-500 dark:text-slate-400`,children:e}):null,(0,I.jsx)(`span`,{className:`text-xs text-slate-400 dark:text-slate-500`,children:t})]})}var nS=(0,F.memo)(function({span:e}){let[t,n]=(0,F.useState)(!1),{spanType:r,attributes:i,name:a}=e,o=i.content||i.input||i.output||i.message,s=i.tool_name||i.tool?.name||i[`tool.name`],c=typeof s==`string`?s:null,l=i.output||i.result||i[`tool.result`],u=i.arguments||i.args||i[`tool.arguments`],d=cS(i[`message.pending_delivery`]),f=e.status===`ERROR`?(0,I.jsxs)(`div`,{className:`mx-4 mt-4 p-3 bg-red-500/10 border border-red-500/20 rounded-sm text-xs`,children:[(0,I.jsx)(`div`,{className:`flex items-center gap-2 font-semibold text-red-500 mb-1`,children:`Error`}),e.statusMessage?(0,I.jsx)(`div`,{className:`font-mono text-red-400 mb-2`,children:e.statusMessage}):null]}):null;if(r===`user.prompt`||r===`user_input`)return(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[f,(0,I.jsx)(`div`,{className:`min-w-0 break-words p-4 font-mono text-sm text-slate-300 whitespace-pre-wrap`,children:typeof o==`string`?o:JSON.stringify(o)}),d===`queue`||d===`steer`?(0,I.jsx)(id,{delivery:d,className:`mx-4 mb-4`}):null]});if(r===`model.response`)return(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[f,(0,I.jsx)(`div`,{className:`model-response-markdown min-w-0 p-4 text-sm text-slate-200 leading-relaxed`,children:typeof o==`string`?(0,I.jsx)(Kx,{children:o}):(0,I.jsx)(Yu,{value:o})})]});if(r===`tool.result`)return(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[f,(0,I.jsxs)(`div`,{className:`p-4 bg-green-500/5 border-t border-green-500/20`,children:[(0,I.jsxs)(`div`,{className:`text-xs font-medium text-green-400 mb-2`,children:[`Returned from `,c||a,`:`]}),(0,I.jsx)(Yu,{value:l??o})]})]});if(r===`tool.call`){let e=uS(u)?u:{},r=Object.keys(e).length>0;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`p-4 bg-[#0e1116] border-b border-slate-800`,children:(0,I.jsx)(iS,{name:c??a,args:e})}),l==null?null:(0,I.jsxs)(`div`,{className:`px-4 py-2 bg-[#1a262b] flex items-center gap-2`,children:[(0,I.jsx)(Zt,{size:14,className:`text-slate-400`}),(0,I.jsx)(`span`,{className:`text-xs font-mono text-slate-500`,children:`Output:`}),(0,I.jsx)(`code`,{className:`min-w-0 max-w-md truncate text-xs font-mono text-slate-300`,children:typeof l==`string`?l.slice(0,100):JSON.stringify(l).slice(0,100)})]}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`w-full px-4 py-1.5 flex items-center gap-1.5 text-[11px] font-medium text-slate-400 hover:text-slate-200 bg-slate-900/40 hover:bg-slate-800/60 border-t border-slate-700/40 transition-colors`,children:[t?(0,I.jsx)(wn,{size:12}):(0,I.jsx)(Tn,{size:12}),t?`Hide Details`:`Show Details`]}),t?(0,I.jsxs)(`div`,{className:`border-t border-slate-700/40 bg-[#0e1116]`,children:[r?(0,I.jsxs)(`div`,{className:`px-4 pt-3 pb-2`,children:[(0,I.jsx)(`div`,{className:`text-[10px] font-semibold text-blue-400 uppercase tracking-wider mb-1.5`,children:`Input`}),(0,I.jsx)(Yu,{value:e})]}):null,l==null?null:(0,I.jsxs)(`div`,{className:`px-4 pt-2 pb-3 border-t border-slate-700/30`,children:[(0,I.jsx)(`div`,{className:`text-[10px] font-semibold text-green-400 uppercase tracking-wider mb-1.5`,children:`Output`}),(0,I.jsx)(Yu,{value:l})]})]}):null,f]})}if(r===`yielded.run`){let e=uS(l)?l:uS(o)?o:{};return(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[f,(0,I.jsxs)(`div`,{className:`p-4 border-b border-[#11a4d4]/20 bg-[#11a4d4]/5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,I.jsx)($t,{size:14,className:`text-[#11a4d4]`}),(0,I.jsx)(`span`,{className:`text-sm font-medium text-[#11a4d4]`,children:`Run notification`}),(0,I.jsx)(`span`,{className:`text-xs font-mono text-slate-400`,children:typeof i.content==`string`?i.content:a})]}),(0,I.jsx)(sS,{notification:e})]}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`w-full px-4 py-1.5 flex items-center gap-1.5 text-[11px] font-medium text-slate-400 hover:text-slate-200 bg-slate-900/40 hover:bg-slate-800/60 border-t border-slate-700/40 transition-colors`,children:[t?(0,I.jsx)(wn,{size:12}):(0,I.jsx)(Tn,{size:12}),t?`Hide Details`:`Show Details`]}),t?(0,I.jsx)(`div`,{className:`border-t border-slate-700/40 bg-[#0e1116] px-4 py-3`,children:(0,I.jsx)(Yu,{value:e})}):null]})}if(r===`model.reasoning`){let e=i.reasoning||i[`model.reasoning`]||o;return(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[f,(0,I.jsxs)(`div`,{className:`min-w-0 break-words p-4 font-mono text-sm text-slate-300 bg-amber-500/5 leading-relaxed whitespace-pre-wrap`,children:[(0,I.jsx)(`span`,{className:`text-amber-500 opacity-60`,children:`// Model reasoning`}),(0,I.jsx)(`br`,{}),typeof e==`string`?e:JSON.stringify(e,null,2)]})]})}if(r===`agent.delegation`){let e=i[`delegation.target_agent`],t=i[`delegation.query`],n=i[`result.status`];return(0,I.jsxs)(I.Fragment,{children:[f,(0,I.jsxs)(`div`,{className:`p-4 border-b border-orange-500/20 bg-orange-500/5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,I.jsx)(On,{size:14,className:`text-orange-500`}),(0,I.jsx)(`span`,{className:`text-sm font-medium text-orange-500`,children:`Delegated to:`}),(0,I.jsxs)(`span`,{className:`text-sm font-semibold text-slate-200`,children:[e||`unknown`,` agent`]}),n?(0,I.jsx)(`span`,{className:`ml-2 px-2 py-0.5 text-[10px] font-bold rounded-sm bg-green-500/20 text-green-500`,children:n.toUpperCase()}):null]}),t?(0,I.jsxs)(`div`,{className:`text-xs text-slate-400 font-mono italic line-clamp-2`,children:[`"`,dS(t),`"`]}):null]})]})}if(r===`agent.async`){let e=i[`async_agent.target_agent`],t=i[`async_agent.query`],n=i[`async_agent.started_by`],r=i.run_id,a=i[`result.status`];return(0,I.jsxs)(I.Fragment,{children:[f,(0,I.jsxs)(`div`,{className:`p-4 border-b border-orange-500/20 bg-orange-500/5`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 mb-2`,children:[(0,I.jsx)(On,{size:14,className:`text-orange-500`}),(0,I.jsx)(`span`,{className:`text-sm font-medium text-orange-500`,children:`Async agent started:`}),(0,I.jsxs)(`span`,{className:`text-sm font-semibold text-slate-200`,children:[e||`unknown`,` agent`]}),a?(0,I.jsx)(`span`,{className:`px-2 py-0.5 text-[10px] font-bold rounded-sm bg-orange-500/15 text-orange-400`,children:a.toUpperCase()}):null]}),(0,I.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-x-3 gap-y-1 font-mono text-[11px] text-slate-500`,children:[(0,I.jsxs)(`span`,{children:[`Started by `,n||`pibo_run_start`]}),r?(0,I.jsx)(`span`,{children:r}):null]}),t?(0,I.jsxs)(`div`,{className:`text-xs text-slate-400 font-mono italic line-clamp-2`,children:[`"`,dS(t),`"`]}):null]})]})}return r===`agent.run`?(0,I.jsx)(`div`,{className:`flex flex-col`,children:f}):(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[f,(0,I.jsx)(`div`,{className:`p-4 font-mono text-sm text-slate-300`,children:(0,I.jsx)(Yu,{value:i})})]})});function rS({forkEntryId:e,linkedPiboSessionId:t,onFork:n,onOpenSession:r}){let i=e&&n?e:void 0,a=t&&r?t:void 0;return!i&&!a?null:(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[i?(0,I.jsx)(`button`,{type:`button`,onClick:()=>n?.(i),className:`inline-flex h-8 w-8 items-center justify-center rounded-sm border border-slate-700 bg-[#151f24]/80 text-slate-400 transition-colors hover:border-[#11a4d4] hover:text-[#11a4d4]`,title:`Fork user message`,"aria-label":`Fork user message`,children:(0,I.jsx)(On,{size:14})}):null,a?(0,I.jsx)(`button`,{type:`button`,onClick:()=>r?.(a),className:`inline-flex h-8 w-8 items-center justify-center rounded-sm border border-slate-700 bg-[#151f24]/80 text-slate-400 transition-colors hover:border-[#11a4d4] hover:text-[#11a4d4]`,title:`Open child session`,"aria-label":`Open child session`,children:(0,I.jsx)(Cn,{size:14})}):null]})}function iS({name:e,args:t}){return(0,I.jsxs)(`code`,{className:`font-mono text-xs text-green-400`,children:[(0,I.jsx)(`span`,{className:`text-purple-400`,children:`def`}),` `,(0,I.jsx)(`span`,{className:`text-yellow-300`,children:e}),(0,I.jsxs)(`span`,{children:[`(`,Object.entries(t).map(([e,t],n)=>(0,I.jsxs)(`span`,{children:[n>0?`, `:null,(0,I.jsx)(`span`,{className:`text-blue-400`,children:e}),`=`,(0,I.jsx)(`span`,{className:`text-green-300`,children:typeof t==`string`?`'${t.slice(0,50)}${t.length>50?`...`:``}'`:dS(t).slice(0,50)})]},e)),`)`]})]})}function aS({type:e,className:t}){let n={size:14,className:t};switch(e){case`agent.run`:return(0,I.jsx)(rn,{...n});case`tool.call`:return(0,I.jsx)(en,{...n});case`tool.result`:return(0,I.jsx)(Zt,{...n});case`model.request`:return(0,I.jsx)(nn,{...n});case`model.response`:return(0,I.jsx)(Zt,{...n});case`model.reasoning`:return(0,I.jsx)(Pn,{...n});case`agent.delegation`:return(0,I.jsx)(On,{...n});case`agent.async`:return(0,I.jsx)(On,{...n});case`yielded.run`:return(0,I.jsx)($t,{...n});case`user.prompt`:return(0,I.jsx)(zn,{...n});case`user_input`:return(0,I.jsx)(er,{...n});case`execution.command`:return(0,I.jsx)(en,{...n});default:return(0,I.jsx)(on,{...n})}}function oS(e,t){return e===`ERROR`?{cardClass:`border-[#ff6b00]/50`,headerClass:`bg-[#ff6b00]/5`,glowClass:``}:e===`OK`?{cardClass:`border-[#0bda57]/30`,headerClass:`bg-[#0bda57]/5`,glowClass:``}:t?{cardClass:`border-[#11a4d4]/50`,headerClass:`bg-[#11a4d4]/5`,glowClass:`shadow-[0_0_10px_rgba(17,164,212,0.1)]`}:{cardClass:`border-slate-700`,headerClass:`bg-[#151f24]`,glowClass:``}}function sS({notification:e}){let t=[[`completed`,`text-green-500`,e.completed],[`failed`,`text-red-400`,e.failed],[`timed out`,`text-amber-400`,e.timedOut],[`cancelled`,`text-slate-400`,e.cancelled],[`running`,`text-[#11a4d4]`,e.running]].map(([e,t,n])=>({name:e,color:t,runs:Array.isArray(n)?n.filter(uS):[]})).filter(e=>e.runs.length>0);return t.length===0?(0,I.jsx)(`div`,{className:`text-xs text-slate-400`,children:`No yielded run updates.`}):(0,I.jsx)(`div`,{className:`grid gap-2`,children:t.map(e=>(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-wider ${e.color}`,children:e.name}),(0,I.jsx)(`div`,{className:`grid gap-1`,children:e.runs.map((t,n)=>(0,I.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_auto] gap-2 rounded-sm border border-slate-700/60 bg-[#0e1116]/60 px-2 py-1.5`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`truncate font-mono text-xs text-slate-200`,children:cS(t.toolName)||`yielded tool`}),(0,I.jsx)(`div`,{className:`truncate font-mono text-[10px] text-slate-500`,children:cS(t.runId)})]}),(0,I.jsx)(`div`,{className:`font-mono text-[10px] uppercase text-slate-400`,children:cS(t.status)||e.name})]},`${e.name}-${n}`))})]},e.name))})}function cS(e){return typeof e==`string`?e:``}function lS(e,t){let n=(e-t)/1e3,r=Math.floor(n/6e4),i=Math.floor(n%6e4/1e3),a=Math.floor(n%1e3);return`${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}.${String(a).padStart(3,`0`)}`}function uS(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function dS(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var fS=5e3,pS=0,mS=new Map,hS=0;function gS(e){let t=mS.get(e);return t||(t={snapshots:[],pending:null,pendingTimer:null},mS.set(e,t)),t}function _S(){if(typeof window<`u`&&window.__piboTraceSnapshotCollectionEnabled===!0)return!0;try{return localStorage.getItem(`pibo.chat.traceDebug`)===`true`}catch{return!1}}function vS(e){let t=0;for(let n of e)for(let e=0;e<n.length;e++)t=(t<<5)-t+n.charCodeAt(e),t|=0;return t.toString(36)}function yS(e){return vS([JSON.stringify(e)])}function bS(e){return JSON.stringify({trigger:e.trigger,traceVersion:e.traceVersion,baseTraceVersion:e.baseTraceVersion,latestStreamId:e.latestStreamId,lastRawEventId:e.lastRawEventId,selectedSessionStatus:e.selectedSessionStatus,overlayEventCount:e.overlayEventCount,layers:e.layers.map(e=>[e.kind,e.digest])})}function xS(e){if(!e.pending)return;let t=e.pending;if(t.layers.length===0){e.pending=null;return}let n=e.snapshots.at(-1);(!n||bS(n)!==bS(t))&&(e.snapshots.push(t),e.snapshots.length>fS&&e.snapshots.shift()),e.pending=null}function SS(e){if(!_S())return;let t=gS(e.piboSessionId);t.pendingTimer&&=(clearTimeout(t.pendingTimer),null);let n=e.layer&&t.pending?.layers?.find(t=>t.kind===e.layer.kind),r=t.pending&&MS(t.pending.traceVersion,e.traceVersion)&&MS(t.pending.baseTraceVersion,e.baseTraceVersion)&&MS(t.pending.latestStreamId,e.latestStreamId)&&MS(t.pending.lastRawEventId,e.lastRawEventId)&&MS(t.pending.selectedSessionStatus,e.selectedSessionStatus)&&MS(t.pending.overlayEventCount,e.overlayEventCount);if(t.pending&&t.pending.trigger===e.trigger&&t.pending.piboSessionId===e.piboSessionId&&r&&(!n||n.digest===e.layer?.digest)||xS(t),t.pending||={sequence:++hS,timestamp:Date.now(),piboSessionId:e.piboSessionId,trigger:e.trigger,layers:[],expansionOverrides:e.expansionOverrides,traceVersion:e.traceVersion,baseTraceVersion:e.baseTraceVersion,latestStreamId:e.latestStreamId,lastRawEventId:e.lastRawEventId,selectedSessionStatus:e.selectedSessionStatus,overlayEventCount:e.overlayEventCount},e.layer){let n=t.pending.layers.findIndex(t=>t.kind===e.layer.kind);n>=0?t.pending.layers[n]=e.layer:t.pending.layers.push(e.layer)}e.expansionOverrides!==void 0&&(t.pending.expansionOverrides=e.expansionOverrides),e.traceVersion!==void 0&&(t.pending.traceVersion=e.traceVersion),e.baseTraceVersion!==void 0&&(t.pending.baseTraceVersion=e.baseTraceVersion),e.latestStreamId!==void 0&&(t.pending.latestStreamId=e.latestStreamId),e.lastRawEventId!==void 0&&(t.pending.lastRawEventId=e.lastRawEventId),e.selectedSessionStatus!==void 0&&(t.pending.selectedSessionStatus=e.selectedSessionStatus),e.overlayEventCount!==void 0&&(t.pending.overlayEventCount=e.overlayEventCount),t.pendingTimer=setTimeout(()=>{xS(t),t.pendingTimer=null},pS)}function CS(e){let t={traceVersion:e.currentTraceView.version,baseTraceVersion:e.baseTraceView?.version,latestStreamId:e.currentTraceView.latestStreamId,lastRawEventId:e.currentTraceView.rawEvents.at(-1)?.id,selectedSessionStatus:e.selectedSessionStatus,overlayEventCount:e.overlayEvents.length};wS(e.piboSessionId,e.trigger,`baseNodes`,e.baseTraceView?.nodes??[],t),TS(e.piboSessionId,e.trigger,e.overlayEvents,t),wS(e.piboSessionId,e.trigger,`currentNodes`,e.currentTraceView.nodes,t)}function wS(e,t,n,r,i){let a=NS(r).map(PS);SS({piboSessionId:e,trigger:t,layer:{kind:n,ids:a.map(e=>e.id),digest:yS(a),meta:a},...i})}function TS(e,t,n,r){let i=n.map(e=>({id:e.id,type:e.type,eventId:e.eventId,eventSequence:e.eventSequence,streamId:e.streamId,streamFrameIndex:e.streamFrameIndex}));SS({piboSessionId:e,trigger:t,layer:{kind:`overlayEvents`,ids:i.map(e=>e.id),digest:yS(i),meta:i},...r})}function ES(e,t,n,r){let i=n.map(e=>({id:e.id,kind:e.kind,status:e.status,sourceNodeIds:[...e.sourceNodeIds],eventId:e.eventId,runId:e.runId,orderSource:e.orderSource,orderStreamId:e.orderStreamId,orderStreamFrameIndex:e.orderStreamFrameIndex}));SS({piboSessionId:e,trigger:t,layer:{kind:`terminalRows`,ids:i.map(e=>e.id),digest:yS(i),meta:i},...r})}function DS(e){let t=mS.get(e);return t?(xS(t),t.snapshots):[]}function OS(e){let t=mS.get(e);return t?.pending?.sequence??t?.snapshots.at(-1)?.sequence}function kS(e){if(e)return JSON.stringify({piboSessionId:e,snapshots:DS(e)},null,2);let t={};for(let[e,n]of mS)xS(n),t[e]=n.snapshots;return JSON.stringify(t,null,2)}function AS(e){if(e){jS(mS.get(e)),mS.delete(e);return}for(let e of mS.values())jS(e);mS.clear()}function jS(e){e?.pendingTimer&&(clearTimeout(e.pendingTimer),e.pendingTimer=null)}function MS(e,t){return t===void 0||e===void 0||e===t}function NS(e){return e.flatMap(e=>[e,...NS(e.children??[])])}function PS(e){let t=IS(e);return{id:e.id,type:e.type,status:e.status,parentId:e.parentId,childIds:e.children.map(e=>e.id),entryId:e.entryId,eventId:e.eventId,toolCallId:e.toolCallId,runId:e.runId,stableKey:e.stableKey,source:e.source,orderKey:e.orderKey,contentLength:t.length,contentKind:FS(t)}}function FS(e){return e.startsWith(`<pibo_run_notification>`)?`pibo-run-notification`:e.startsWith(`<pibo_goal_continuation>`)?`pibo-goal-continuation`:e.startsWith(`<pibo_`)?`pibo-system`:`message`}function IS(e){return typeof e.output==`string`?e.output:typeof e.summary==`string`?e.summary:e.output&&typeof e.output==`object`&&`text`in e.output&&typeof e.output.text==`string`?e.output.text:``}typeof window<`u`&&(window.__piboTraceSnapshots={exportAsJson:e=>{let t=kS(e),n=new Blob([t],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`trace-snapshots-${e??`all`}-${Date.now()}.json`,i.click(),URL.revokeObjectURL(r)},getSnapshots:DS,getLatestSequence:OS,clearSnapshots:AS,exportSnapshots:kS});function LS(e,t={}){if(!e)return RS(t);let n=e.latestTurn,r=n?.state===`running`,i=e.isTreeActive||r;return{status:e.hasError||e.hasErrorDescendant||e.aggregateStatus===`error`?`error`:i?`running`:`idle`,isTreeActive:i,isTurnActive:r,activeTurnId:r?n.eventId:void 0,activeTurnStartedAt:r?n.startedAt:void 0,latestTurn:n,source:`signals`}}function RS(e){let t=e.status===`running`&&zS(e.turnStartedAt);return{status:e.status??`idle`,isTreeActive:e.status===`running`,isTurnActive:t,activeTurnStartedAt:t?e.turnStartedAt:void 0,source:`fallback`}}function zS(e){return!!(e&&Number.isFinite(Date.parse(e)))}function BS({signal:e,fallbackStatus:t,fallbackTurnStartedAt:n}){return(0,F.useMemo)(()=>LS(e,{status:t,turnStartedAt:n}),[t,n,e])}function VS({goal:e}){let t=US(e),[n,r]=(0,F.useState)(()=>Date.now());return(0,F.useEffect)(()=>{if(r(Date.now()),!t||e?.state.goalEndedAt)return;let n=window.setInterval(()=>r(Date.now()),1e3);return()=>window.clearInterval(n)},[e?.id,e?.state.goalEndedAt,t]),(0,I.jsx)(HS,{goal:e,nowMs:n})}function HS({goal:e,nowMs:t}){let n=US(e);if(!e||!n)return null;let r=n===`active`?`Pursuing Goal`:`Goal Paused`,i=n===`active`?`text-fuchsia-400`:`text-amber-300`,a=WS(e,t);return(0,I.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-2 font-sans text-sm font-semibold ${i}`,"data-pibo-debug":`session-goal-indicator`,"data-goal-id":e.id,"data-goal-status":n,title:`${e.name}: ${e.prompt}`,children:[(0,I.jsx)(Xn,{size:17,className:n===`active`?`animate-pulse`:``,"aria-hidden":`true`}),(0,I.jsxs)(`span`,{children:[r,`:`]}),(0,I.jsx)(`span`,{className:`tabular-nums`,children:a})]})}function US(e){if(!e||e.mode!==`goal`)return;let t=e.state.goalStatus??(e.enabled?`active`:`paused`);return t===`active`||t===`paused`?t:void 0}function WS(e,t){let n=e.state.goalStartedAt?Date.parse(e.state.goalStartedAt):NaN,r=e.state.goalEndedAt?Date.parse(e.state.goalEndedAt):t,i=Number.isFinite(n)&&Number.isFinite(r)?Math.max(0,Math.floor((r-n)/1e3)):0,a=Math.floor(i/3600),o=Math.floor(i%3600/60),s=i%60;return a>0?`${a}:${String(o).padStart(2,`0`)}:${String(s).padStart(2,`0`)}`:`${o}:${String(s).padStart(2,`0`)}`}function GS(e){if(e==null)return{kind:`empty`};let t=KS(e);return t===void 0?{kind:`json`,value:e}:{kind:`text`,text:t}}function KS(e){if(typeof e==`string`)return e;if(Array.isArray(e)){let t=e.map(KS).filter(e=>e!==void 0);return t.length===e.length&&t.length>0?t.join(``):void 0}if(!JS(e))return;let t=typeof e.type==`string`?e.type:void 0;if(t===`text`&&typeof e.text==`string`)return e.text;if(t===`text`&&typeof e.content==`string`)return e.content;if(t===`output_text`&&typeof e.text==`string`)return e.text;let n=KS(e.content);if(n!==void 0&&qS(e))return n;let r=JS(e.message)?KS(e.message.content):void 0;if(r!==void 0)return r}function qS(e){let t=Object.keys(e).filter(t=>e[t]!==void 0);return t.length===1&&t[0]===`content`||t.every(e=>e===`content`||e===`type`)||t.every(e=>e===`content`||e===`details`||e===`type`)?!0:typeof e.type==`string`&&e.type.includes(`text`)}function JS(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}async function YS(e,t,n){let r=new URLSearchParams({piboSessionId:e}),i=await fetch(`/api/chat/trace/summary?${r.toString()}`,{headers:t?{"if-none-match":$S(t)}:void 0,signal:n?.signal});if(i.status===304)return{notModified:!0,version:eC(i.headers.get(`etag`))??t};let a=await i.json().catch(()=>void 0);if(!i.ok){let e=a&&typeof a==`object`&&`error`in a?String(a.error):`Request failed`,t=Error(e);throw t.status=i.status,t.data=a,t}return{summary:a,notModified:!1,version:eC(i.headers.get(`etag`))??a.version}}async function XS(e,t={}){let n=new URLSearchParams({piboSessionId:e});t.limit&&n.set(`limit`,String(t.limit)),t.beforeCursor===void 0?t.beforeSequence!==void 0&&n.set(`before`,String(t.beforeSequence)):n.set(`before`,String(t.beforeCursor));let r=await fetch(`/api/chat/trace/timeline?${n.toString()}`,{headers:t.knownVersion?{"if-none-match":$S(t.knownVersion)}:void 0,signal:t.signal});if(r.status===304)return{notModified:!0,version:eC(r.headers.get(`etag`))??t.knownVersion};let i=await r.json().catch(()=>void 0);if(!r.ok){let e=i&&typeof i==`object`&&`error`in i?String(i.error):`Request failed`,t=Error(e);throw t.status=r.status,t.data=i,t}return{timeline:i,notModified:!1,version:eC(r.headers.get(`etag`))??i.version}}async function ZS(e,t={}){let n=new URLSearchParams({piboSessionId:e});return t.limit&&n.set(`limit`,String(t.limit)),t.beforeSequence!==void 0&&n.set(`before`,String(t.beforeSequence)),xt(`/api/chat/trace/raw-events?${n.toString()}`,{signal:t.signal})}async function QS(e,t={}){let n=new URLSearchParams;t.offset!==void 0&&n.set(`offset`,String(t.offset)),t.limit!==void 0&&n.set(`limit`,String(t.limit));let r=n.toString();return xt(`/api/chat/trace/payload/${encodeURIComponent(e)}${r?`?${r}`:``}`)}function $S(e){return`"${e}"`}function eC(e){if(!e)return;let t=e.trim();return t.startsWith(`W/`)?eC(t.slice(2)):t.startsWith(`"`)&&t.endsWith(`"`)?t.slice(1,-1):t}function tC({row:e,onOpenSession:t}){return(0,I.jsx)(`div`,{className:`mt-2 border border-[#2a2a2a] bg-[#111111] px-3 py-2 text-[12px] text-[#d4d4d4]`,"data-shared-terminal-details":e.kind,children:e.detailItems?.length?(0,I.jsx)(`div`,{className:`space-y-3`,children:e.detailItems.map(e=>(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,I.jsx)(`span`,{className:`font-semibold text-[#d4d4d4]`,children:e.label}),e.linkedPiboSessionId?(0,I.jsx)(`button`,{type:`button`,onClick:()=>t(e.linkedPiboSessionId),className:`border border-[#3a3a3a] px-2 py-0.5 text-[#38bdf8] hover:border-[#38bdf8]`,children:`Open Session`}):null]}),(0,I.jsx)(iC,{label:`Input`,value:e.input}),(0,I.jsx)(iC,{label:`Output`,value:e.output}),(0,I.jsx)(nC,{refs:e.payloadRefs}),(0,I.jsx)(aC,{value:e.output}),e.error?(0,I.jsx)(cC,{label:`Error`,value:e.error,tone:`red`}):null]},e.id))}):(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsx)(iC,{label:`Input`,value:e.input}),(0,I.jsx)(iC,{label:`Output`,value:e.output}),(0,I.jsx)(nC,{refs:e.payloadRefs}),(0,I.jsx)(aC,{value:e.output}),e.error?(0,I.jsx)(cC,{label:`Error`,value:e.error,tone:`red`}):null,e.linkedPiboSessionId?(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,I.jsx)(`span`,{className:`text-[#737373]`,children:`Child session`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>t(e.linkedPiboSessionId),className:`border border-[#3a3a3a] px-2 py-0.5 text-[#38bdf8] hover:border-[#38bdf8]`,children:e.linkedPiboSessionId})]}):null]})})}function nC({refs:e}){if(!e)return null;let t=Object.entries(e).filter(e=>!!e[1]);return t.length?(0,I.jsx)(`div`,{className:`space-y-2`,children:t.map(([e,t])=>(0,I.jsx)(rC,{kind:e,refInfo:t},`${e}:${t.ref}`))}):null}function rC({kind:e,refInfo:t}){let[n,r]=(0,F.useState)({status:`loading`});return(0,F.useEffect)(()=>{let e=!1;return r({status:`loading`}),QS(t.ref,{offset:0,limit:65536}).then(t=>{e||r({status:`loaded`,data:t.data,hasMore:t.hasMore,nextOffset:t.nextOffset})}).catch(t=>{e||r({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},[t.ref]),(0,I.jsxs)(`div`,{className:`space-y-1`,"data-shared-terminal-payload-ref":e,children:[(0,I.jsxs)(`div`,{className:`text-[11px] font-semibold text-[#737373]`,children:[e,` payload (`,Math.ceil(t.byteLength/1024),` KB)`]}),n.status===`loading`?(0,I.jsx)(`div`,{className:`border border-[#2a2a2a] bg-[#0b0b0b] p-2 text-[12px] text-[#737373]`,children:`Loading payload preview...`}):n.status===`error`?(0,I.jsx)(`div`,{className:`border border-[#2a2a2a] bg-[#0b0b0b] p-2 text-[12px] text-[#ef4444]`,children:n.message}):(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`pre`,{className:`m-0 max-h-[520px] overflow-auto whitespace-pre-wrap break-words border border-[#2a2a2a] bg-[#0b0b0b] p-2 font-mono text-[12px] leading-[1.45] text-[#d4d4d4]`,children:n.data}),n.hasMore?(0,I.jsx)(`div`,{className:`text-[11px] text-[#737373]`,children:`Showing first chunk. More payload data is available on demand.`}):null]})]})}function iC({label:e,value:t}){let n=GS(t);if(n.kind===`empty`)return null;if(n.kind===`text`){let t=lC(n.text);return t?.kind===`json`?(0,I.jsx)(sC,{label:e,value:t.value,meta:t.meta}):t?.kind===`text`?(0,I.jsx)(cC,{label:e,value:t.text}):(0,I.jsx)(cC,{label:e,value:n.text})}return(0,I.jsx)(sC,{label:e,value:n.value})}function aC({value:e}){let t=oC(e);return t?(0,I.jsxs)(`details`,{className:`space-y-1 border border-[#2a2a2a] bg-[#0b0b0b] p-2`,children:[(0,I.jsxs)(`summary`,{className:`cursor-pointer text-[11px] font-semibold text-[#38bdf8]`,children:[`Show full output (`,t.originalLines,` lines)`]}),t.fullOutput?(0,I.jsx)(`pre`,{className:`mt-2 max-h-[520px] overflow-auto whitespace-pre-wrap break-words font-mono text-[12px] leading-[1.45] text-[#d4d4d4]`,children:t.fullOutput}):t.fullOutputPath?(0,I.jsxs)(`div`,{className:`mt-2 min-w-0 break-words font-mono text-[12px] text-[#d4d4d4]`,children:[`Full output file: `,t.fullOutputPath]}):null]}):null}function oC(e){if(!fC(e))return;let t=fC(e.details)?e.details.piboBashOutputCompaction:void 0;if(!fC(t)||t.kind!==`validation-output`)return;let n=typeof t.originalLines==`number`?t.originalLines:void 0;if(n!==void 0)return{originalLines:n,fullOutput:typeof t.fullOutput==`string`?t.fullOutput:void 0,fullOutputPath:typeof t.fullOutputPath==`string`?t.fullOutputPath:void 0}}function sC({label:e,value:t,meta:n}){return(0,I.jsxs)(`div`,{className:`space-y-1`,"data-shared-terminal-detail-json":e,children:[(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-semibold text-[#737373]`,"data-shared-terminal-detail-label":e,children:e}),n?(0,I.jsxs)(`div`,{className:`min-w-0 break-words text-[11px] text-[#737373]`,children:[`Status: `,n]}):null]}),(0,I.jsx)(`div`,{className:`compact-terminal-json border border-[#2a2a2a] bg-[#0b0b0b] p-2`,children:(0,I.jsx)(Yu,{value:t,showControls:!1})})]})}function cC({label:e,value:t,tone:n=`default`}){return(0,I.jsxs)(`div`,{className:`space-y-1`,"data-shared-terminal-detail-text":e,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-semibold text-[#737373]`,"data-shared-terminal-detail-label":e,children:e}),(0,I.jsx)(`pre`,{className:`m-0 whitespace-pre-wrap break-words border border-[#2a2a2a] bg-[#0b0b0b] p-2 font-mono text-[12px] leading-[1.45] ${n===`red`?`text-[#ef4444]`:`text-[#d4d4d4]`}`,children:t})]})}function lC(e){let t=e.trim();if(!t)return;let n=dC(t);if(n!==void 0)return uC(n);let r=t.split(/\r?\n/);for(let e=1;e<r.length;e+=1){let t=r.slice(e).join(`
39
+ `).trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))continue;let n=dC(t);if(n!==void 0)return uC(n,r.slice(0,e).join(` `).trim()||void 0)}}function uC(e,t){let n=GS(e);if(n.kind===`text`){let e=lC(n.text);return e?.kind===`json`?{...e,meta:e.meta??t}:{kind:`text`,text:n.text}}return{kind:`json`,value:e,meta:t}}function dC(e){if(!(!e.startsWith(`{`)&&!e.startsWith(`[`)))try{let t=JSON.parse(e);return typeof t==`object`&&t?t:void 0}catch{return}}function fC(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function pC({name:e,input:t}){return(0,I.jsxs)(`span`,{className:`compact-terminal-function-call`,children:[(0,I.jsx)(`span`,{className:`text-[#facc15] font-semibold`,children:e}),(0,I.jsx)(`span`,{className:`text-[#d4d4d4]`,children:`(`}),t===void 0?null:(0,I.jsx)(mC,{value:t}),(0,I.jsx)(`span`,{className:`text-[#d4d4d4]`,children:`)`})]})}function mC({value:e}){let[t,n]=(0,F.useState)(()=>new Set([`$`])),[r,i]=(0,F.useState)(()=>new Set);return(0,I.jsx)(hC,{value:e,path:`$`,expandedPaths:t,expandedStrings:r,onTogglePath:e=>{n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},onToggleString:e=>{i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}})}function hC({value:e,path:t,expandedPaths:n,expandedStrings:r,onTogglePath:i,onToggleString:a}){if(Array.isArray(e))return(0,I.jsx)(gC,{value:e,path:t,open:`[`,close:`]`,expandedPaths:n,expandedStrings:r,onTogglePath:i,onToggleString:a});if(yC(e))return(0,I.jsx)(gC,{value:e,path:t,open:`{`,close:`}`,expandedPaths:n,expandedStrings:r,onTogglePath:i,onToggleString:a});if(typeof e==`string`){let n=r.has(t),i=e.length>140&&!n,o=i?`${e.slice(0,140)}...`:e,s=(0,I.jsx)(`span`,{className:`text-[#fb923c]`,children:JSON.stringify(o)});return!i&&e.length<=140?s:(0,I.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),a(t)},className:`compact-terminal-json-toggle text-left align-baseline`,title:n?`Collapse string`:`Expand string`,"aria-label":`String at ${_C(t)}`,"aria-expanded":n,children:s})}return typeof e==`number`||typeof e==`boolean`||e===null?(0,I.jsx)(`span`,{className:`text-[#60a5fa]`,children:String(e)}):(0,I.jsx)(`span`,{className:`text-[#737373]`,children:JSON.stringify(String(e))})}function gC({value:e,path:t,open:n,close:r,expandedPaths:i,expandedStrings:a,onTogglePath:o,onToggleString:s}){let c=i.has(t),l=`inline-json-${(0,F.useId)()}`,u=c?Array.isArray(e)?e.map((e,t)=>[String(t),e]):Object.entries(e):[];return(0,I.jsxs)(`span`,{children:[(0,I.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),o(t)},className:`compact-terminal-json-toggle align-baseline text-[#737373]`,title:c?`Collapse JSON`:`Expand JSON`,"aria-label":`JSON at ${t}`,"aria-expanded":c,"aria-controls":l,"data-inline-json-path":t,children:[(0,I.jsx)(`span`,{className:`compact-terminal-json-caret`,children:c?`▾`:`▸`}),n,c?null:`...${r}`]}),(0,I.jsxs)(`span`,{id:l,children:[u.map(([n,r],c)=>{let l=`${t}.${vC(n)}`;return(0,I.jsxs)(`span`,{children:[c>0?(0,I.jsx)(`span`,{className:`text-[#737373]`,children:`, `}):null,Array.isArray(e)?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-[#d4d4d4]`,children:JSON.stringify(n)}),(0,I.jsx)(`span`,{className:`text-[#737373]`,children:`:`})]}),(0,I.jsx)(hC,{value:r,path:l,expandedPaths:i,expandedStrings:a,onTogglePath:o,onToggleString:s})]},l)}),c?(0,I.jsx)(`span`,{className:`text-[#737373]`,children:r}):null]})]})}function _C(e){let t=e.replace(/[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}/gi,`[id]`);return t.length<=80?t:`${t.slice(0,39)}…${t.slice(-39)}`}function vC(e){return e.replaceAll(`\\`,`\\\\`).replaceAll(`.`,`\\.`)}function yC(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}var bC=120;function xC({line:e,status:t,clampLines:n}){let r=`min-w-0 whitespace-pre-wrap break-words ${n?`block overflow-hidden`:``}`,i=TC(e.tokens),a=i.length>bC;return(0,I.jsxs)(`div`,{className:`grid grid-cols-[1.9rem_minmax(0,1fr)] gap-2 leading-[1.45]`,children:[(0,I.jsx)(`span`,{className:`whitespace-pre ${CC(e.prefix,t)}`,children:SC(e.prefix)}),(0,I.jsxs)(`span`,{className:r,style:n?{maxHeight:`${n*1.45}em`}:void 0,children:[a?(0,I.jsx)(`span`,{className:`text-[#d4d4d4]`,children:i.map(e=>e.text).join(``)}):i.map((e,t)=>(0,I.jsx)(`span`,{className:wC(e),children:e.text},`${t}:${e.text}`)),e.functionCall?(0,I.jsx)(pC,{name:e.functionCall.name,input:e.functionCall.input}):null]})]})}function SC(e=`none`){switch(e){case`bullet`:return`•`;case`detail`:return`└`;case`continuation`:return` `;case`prompt`:return`›`;default:return` `}}function CC(e=`none`,t){if(e===`bullet`){if(t===`running`)return`text-[#38bdf8]`;if(t===`error`)return`text-[#ef4444]`;if(t===`done`)return`text-[#22c55e]`}return`text-[#737373]`}function wC(e){return`${e.tone===`dim`?`text-[#737373]`:e.tone===`cyan`?`text-[#38bdf8]`:e.tone===`green`?`text-[#22c55e]`:e.tone===`red`?`text-[#ef4444]`:e.tone===`magenta`?`text-[#d946ef]`:e.tone===`yellow`?`text-[#facc15]`:e.tone===`blue`?`text-[#60a5fa]`:e.tone===`amber`?`text-[#f59e0b]`:`text-[#d4d4d4]`} ${e.weight===`bold`?`font-bold`:e.weight===`semibold`?`font-semibold`:`font-normal`} ${e.italic?`italic`:``}`.trim()}function TC(e){let t=[];for(let n of e){if(!n.text)continue;let e=t.at(-1);if(e&&e.tone===n.tone&&e.weight===n.weight&&e.italic===n.italic){e.text+=n.text;continue}t.push({...n})}return t}async function EC(e,t){return xt(`/api/chat/loops/session-goal?${new URLSearchParams({piboSessionId:e}).toString()}`,t)}async function DC(e,t={}){let n=new URLSearchParams({piboSessionId:e});return t.status&&n.set(`status`,t.status),t.limit&&n.set(`limit`,String(t.limit)),t.scope&&n.set(`scope`,t.scope),xt(`/api/web-annotations?${n.toString()}`)}async function OC(e,t){return xt(`/api/web-annotations/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(MC(t))})}async function kC(e){let t=new URLSearchParams;return e?.trim()&&t.set(`cdpUrl`,e.trim()),xt(`/api/web-annotations/targets${t.size?`?${t.toString()}`:``}`)}async function AC(e){return xt(`/api/web-annotations/bindings`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(MC(e))})}async function jC(e,t){return xt(`/api/web-annotations/bindings/${encodeURIComponent(e)}/inject`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(MC(t))})}function MC(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0&&e!==``))}async function NC(e,t,n){return xt(`/api/chat/projects/${encodeURIComponent(e)}/workflow-sessions/${encodeURIComponent(t)}/human-actions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(n)})}function PC(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e;return t.action===`show_login_menu`&&Array.isArray(t.providers)}function FC(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e;return t.action===`show_model_menu`&&Array.isArray(t.providers)}function IC(e){return LC(e)?e.result:e}function LC(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&e.type===`execution_result`}var RC={device_code:`Device code`,browser_oauth:`Browser OAuth`,api_key:`API key`};function zC({row:e,piboSessionId:t}){let n=PC(e.output)?e.output:void 0,r=(0,F.useMemo)(()=>n?.providers??[],[n?.providers]),[i,a]=(0,F.useState)({type:`select_provider`}),[o,s]=(0,F.useState)(!1),[c,l]=(0,F.useState)(``),[u,d]=(0,F.useState)(``),[f,p]=(0,F.useState)(null),m=(0,F.useRef)(!1),h=(0,F.useCallback)(()=>{a({type:`select_provider`}),l(``),d(``)},[]),g=(0,F.useCallback)(async e=>{try{await navigator.clipboard.writeText(e),p(e),window.setTimeout(()=>p(t=>t===e?null:t),1600)}catch{}},[]),_=(0,F.useCallback)(async(e,n)=>{if(!t){a({type:`error`,provider:e,message:`Select a chat session before starting login.`});return}s(!0),a({type:`device_starting`,provider:e});try{let r=IC(await Ot(t,`login.start`,{provider:e.id,method:n})),i=r?.url??r?.flow?.verificationUrl;if(!i){a({type:`error`,provider:e,message:`No login URL returned.`});return}a({type:`device_flow`,provider:e,url:i,flowId:r.flowId??r.state??r.flow?.flowId,completion:r.flow?.completion,userCode:r.userCode??r.flow?.userCode,instructions:r.instructions??r.flow?.instructions})}catch(t){a({type:`error`,provider:e,message:t instanceof Error?t.message:String(t)})}finally{s(!1)}},[t]),v=(0,F.useCallback)(async(e,n,r)=>{if(!(!t||!n)){s(!0);try{let i=IC(await Ot(t,`login.complete`,{provider:e.id,flowId:n,...r?{code:r}:{}}));if(i?.state===`pending`)return;if(i?.state===`failed`){a({type:`error`,provider:e,message:`Login failed. Start a new runtime login flow.`});return}a({type:`success`,provider:e,message:`${e.name} login completed for this runtime.`})}catch(t){a({type:`error`,provider:e,message:t instanceof Error?t.message:String(t)})}finally{s(!1)}}},[t]),y=(0,F.useCallback)(async(e,n)=>{if(!t||!n){h();return}s(!0);try{await Ot(t,`login.cancel`,{provider:e.id,flowId:n}),h()}catch(t){a({type:`error`,provider:e,message:t instanceof Error?t.message:String(t)})}finally{s(!1)}},[t,h]);(0,F.useEffect)(()=>{if(i.type!==`device_flow`||i.completion!==`notification`||!i.flowId||!t)return;let e=async()=>{if(!(m.current||i.type!==`device_flow`)){m.current=!0;try{let e=IC(await Ot(t,`login.complete`,{provider:i.provider.id,flowId:i.flowId}));e?.state===`connected`||e?.state===`partial`?a({type:`success`,provider:i.provider,message:`${i.provider.name} login completed for this runtime.`}):e?.state===`failed`&&a({type:`error`,provider:i.provider,message:`Login failed. Start a new runtime login flow.`})}catch(e){a({type:`error`,provider:i.provider,message:e instanceof Error?e.message:String(e)})}finally{m.current=!1}}},n=window.setInterval(()=>void e(),1500);return()=>window.clearInterval(n)},[t,i]);let b=(0,F.useCallback)(async e=>{if(!t)return;let n=c.trim();if(n){s(!0);try{await Ot(t,`login.apikey`,{provider:e.id,apiKey:n}),l(``),a({type:`success`,provider:e,message:`${e.name} API key saved.`})}catch(t){a({type:`error`,provider:e,message:t instanceof Error?t.message:String(t)})}finally{s(!1)}}},[c,t]);return n?(0,I.jsx)(BC,{title:i.type===`select_provider`?`Login`:UC(i),tone:i.type===`error`?`red`:i.type===`success`?`green`:`cyan`,action:i.type===`select_provider`?void 0:(0,I.jsx)(VC,{onClick:()=>{i.type===`device_flow`?y(i.provider,i.flowId):h()},disabled:o}),children:i.type===`select_provider`?(0,I.jsxs)(`div`,{className:`grid gap-2`,children:[(0,I.jsxs)(`div`,{className:`text-[11px] text-[#737373]`,children:[`Choose a provider. Use `,(0,I.jsx)(`span`,{className:`text-[#38bdf8]`,children:`/login`}),` anytime.`]}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.map(e=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>a({type:`select_method`,provider:e}),className:`inline-flex items-center gap-1 border border-[#3a3a3a] bg-transparent px-2 py-1 text-[11px] text-[#d4d4d4] hover:border-[#38bdf8] hover:text-[#38bdf8]`,children:[(0,I.jsx)(`span`,{children:e.name}),e.configured?(0,I.jsx)(`span`,{className:`text-[#22c55e]`,children:`●`}):null]},e.id))})]}):i.type===`select_method`?(0,I.jsxs)(`div`,{className:`grid gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,I.jsx)(`span`,{className:`text-[#737373]`,children:`Provider:`}),(0,I.jsx)(`span`,{className:`text-[#d4d4d4]`,children:i.provider.name}),i.provider.configured?(0,I.jsx)(HC,{tone:`green`,children:`Configured`}):(0,I.jsx)(HC,{tone:`neutral`,children:`Not configured`})]}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.provider.authMethods.map(e=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>e===`api_key`?a({type:`api_key`,provider:i.provider}):void _(i.provider,e),className:`inline-flex items-center gap-1 border border-[#3a3a3a] bg-transparent px-2 py-1 text-[11px] text-[#d4d4d4] hover:border-[#38bdf8] hover:text-[#38bdf8]`,children:[e===`api_key`?(0,I.jsx)(Mn,{size:11}):(0,I.jsx)(Ln,{size:11}),RC[e]]},e))})]}):i.type===`device_starting`?(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-2 text-[11px] text-[#38bdf8]`,children:[(0,I.jsx)(In,{size:13,className:`animate-spin`}),` Starting device login...`]}):i.type===`device_flow`?(0,I.jsxs)(`div`,{className:`grid gap-2 text-[11px]`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-[#737373]`,children:`Open:`}),(0,I.jsxs)(`a`,{href:i.url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-[#38bdf8] hover:underline`,children:[WC(i.url),` `,(0,I.jsx)(Cn,{size:11})]}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>void g(i.url),className:`inline-flex items-center gap-1 border border-[#3a3a3a] px-1.5 py-0.5 text-[#737373] hover:border-[#38bdf8] hover:text-[#38bdf8]`,children:[f===i.url?(0,I.jsx)(hn,{size:10}):(0,I.jsx)(bn,{size:10}),` `,f===i.url?`Copied`:`Copy`]})]}),i.userCode?(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-[#737373]`,children:`Code:`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>void g(i.userCode),className:`border border-[#1f4960] px-2 py-0.5 font-semibold tracking-widest text-[#38bdf8] hover:border-[#38bdf8]`,children:i.userCode}),(0,I.jsx)(`span`,{className:`text-[#737373]`,children:`then`}),i.completion===`notification`?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[#38bdf8]`,children:[(0,I.jsx)(In,{size:11,className:`animate-spin`}),` Waiting for runtime`]}):(0,I.jsxs)(`button`,{type:`button`,disabled:o||!i.flowId,onClick:()=>void v(i.provider,i.flowId),className:`inline-flex items-center gap-1 border border-[#3a3a3a] px-2 py-0.5 text-[#d4d4d4] hover:border-[#38bdf8] hover:text-[#38bdf8] disabled:opacity-50`,children:[o?(0,I.jsx)(In,{size:11,className:`animate-spin`}):(0,I.jsx)(hn,{size:11}),` Complete`]})]}):(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,I.jsx)(`input`,{value:u,autoComplete:`off`,spellCheck:!1,onChange:e=>d(e.target.value),placeholder:`authorization code`,className:`min-w-0 flex-1 border border-[#2a2a2a] bg-[#0b0b0b] px-2 py-1 text-[11px] text-[#d4d4d4] outline-none focus:border-[#38bdf8]`}),(0,I.jsxs)(`button`,{type:`button`,disabled:o||!u.trim()||!i.flowId,onClick:()=>void v(i.provider,i.flowId,u.trim()),className:`inline-flex items-center gap-1 border border-[#3a3a3a] px-2 py-1 text-[#d4d4d4] hover:border-[#38bdf8] hover:text-[#38bdf8] disabled:opacity-50`,children:[o?(0,I.jsx)(In,{size:11,className:`animate-spin`}):(0,I.jsx)(hn,{size:11}),` Complete`]})]}),i.instructions?(0,I.jsx)(`div`,{className:`text-[#737373]`,children:i.instructions}):null]}):i.type===`api_key`?(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-[11px]`,children:[(0,I.jsx)(`span`,{className:`text-[#737373]`,children:`API key:`}),(0,I.jsx)(`input`,{type:`password`,value:c,autoComplete:`off`,spellCheck:!1,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&b(i.provider)},placeholder:`sk-...`,className:`min-w-[12rem] flex-1 border border-[#2a2a2a] bg-[#0b0b0b] px-2 py-1 text-[11px] text-[#d4d4d4] outline-none focus:border-[#38bdf8]`}),(0,I.jsxs)(`button`,{type:`button`,disabled:o||!c.trim(),onClick:()=>void b(i.provider),className:`inline-flex items-center gap-1 border border-[#3a3a3a] px-2 py-1 text-[#d4d4d4] hover:border-[#38bdf8] hover:text-[#38bdf8] disabled:opacity-50`,children:[o?(0,I.jsx)(In,{size:11,className:`animate-spin`}):(0,I.jsx)(hn,{size:11}),` Save`]})]}):i.type===`success`?(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] text-[#22c55e]`,children:[(0,I.jsx)(hn,{size:13}),` `,i.message]}):(0,I.jsxs)(`div`,{className:`flex items-start gap-2 text-[11px] text-[#ef4444]`,children:[(0,I.jsx)(pn,{size:13,className:`mt-0.5 shrink-0`}),` `,(0,I.jsx)(`span`,{children:i.message})]})}):(0,I.jsx)(BC,{title:`Login`,tone:`red`,children:`Unparseable login payload.`})}function BC({title:e,tone:t,action:n,children:r}){return(0,I.jsxs)(`div`,{className:`mt-2 border border-[#2a2a2a] bg-[#111111] px-3 py-2 text-[12px] text-[#d4d4d4]`,"data-shared-terminal-card":`login`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,I.jsx)(Ln,{size:14,className:t===`red`?`text-[#ef4444]`:t===`green`?`text-[#22c55e]`:`text-[#38bdf8]`}),(0,I.jsx)(`span`,{className:`font-semibold text-[#d4d4d4]`,children:e}),n?(0,I.jsx)(`div`,{className:`ml-auto`,children:n}):null]}),r]})}function VC({onClick:e,disabled:t}){return(0,I.jsxs)(`button`,{type:`button`,disabled:t,onClick:e,className:`inline-flex items-center gap-1 border border-[#3a3a3a] bg-transparent px-1.5 py-0.5 text-[11px] text-[#737373] hover:border-[#38bdf8] hover:text-[#38bdf8] disabled:opacity-50`,children:[(0,I.jsx)(Qt,{size:10}),` Back`]})}function HC({tone:e,children:t}){return(0,I.jsx)(`span`,{className:`border px-1.5 py-0.5 text-[10px] ${e===`green`?`border-[#14532d] text-[#22c55e]`:`border-[#3a3a3a] text-[#737373]`}`,children:t})}function UC(e){return`provider`in e&&e.provider?e.provider.name:`Login`}function WC(e){try{let t=new URL(e);return`${t.host}${t.pathname}`}catch{return e.length>42?`${e.slice(0,39)}...`:e}}function GC({row:e,piboSessionId:t,onModelChanged:n}){let r=IC(e.output),i=(FC(r)?r:void 0)?.providers??[],a=(0,F.useMemo)(()=>i.flatMap(e=>e.models.map(t=>({...t,providerLabel:e.label,authConfigured:e.authConfigured}))),[i]),[o,s]=(0,F.useState)(``),[c,l]=(0,F.useState)(null),[u,d]=(0,F.useState)(!1),[f,p]=(0,F.useState)(null),m=(0,F.useMemo)(()=>{let e=o.trim().toLowerCase();return e?a.filter(t=>`${t.providerLabel} ${t.provider} ${t.label} ${t.id}`.toLowerCase().includes(e)):a},[a,o]),h=async e=>{if(!(!t||u||e.authConfigured===!1)){d(!0),l(e),p(null);try{await wt(t,{activeModel:{provider:e.provider,id:e.id}}),p(`Selected ${e.provider}/${e.id}.`),await n?.()}catch(e){p(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,I.jsxs)(`div`,{className:`ml-[1.9rem] max-w-3xl border border-[#3a3a3a] bg-[#111111] text-[12px] shadow-lg`,"data-shared-terminal-card":`model`,children:[(0,I.jsx)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[#2a2a2a] px-3 py-2`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[#d4d4d4]`,children:`Model`}),(0,I.jsx)(`div`,{className:`text-[11px] text-[#737373]`,children:`Choose a model exposed by the active runtime.`})]})}),(0,I.jsxs)(`div`,{className:`space-y-2 p-3`,children:[i.length?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`label`,{className:`flex items-center gap-2 border border-[#2a2a2a] bg-[#0b0b0b] px-2 py-1 text-[#737373]`,children:[(0,I.jsx)(Kn,{size:13}),(0,I.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:`Search models`,className:`min-w-0 flex-1 bg-transparent text-[#d4d4d4] outline-none placeholder:text-[#525252]`})]}),(0,I.jsx)(`div`,{className:`max-h-72 overflow-auto border border-[#2a2a2a]`,children:m.length?m.map(e=>(0,I.jsxs)(`button`,{type:`button`,disabled:u||e.authConfigured===!1,onClick:()=>void h(e),className:`grid w-full grid-cols-[150px_1fr_auto] gap-2 border-b border-[#1f1f1f] px-3 py-2 text-left hover:bg-[#38bdf8]/10 disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,I.jsx)(`span`,{className:`truncate text-[#737373]`,children:e.providerLabel}),(0,I.jsxs)(`span`,{className:`min-w-0`,children:[(0,I.jsx)(`span`,{className:`block truncate text-[#d4d4d4]`,children:e.label}),(0,I.jsxs)(`span`,{className:`block truncate text-[11px] text-[#737373]`,children:[e.provider,`/`,e.id]})]}),e.authConfigured===!1?(0,I.jsx)(Ln,{size:13,className:`text-[#737373]`,"aria-label":`Provider authentication missing`}):c?.provider===e.provider&&c?.id===e.id?(0,I.jsx)(on,{size:14,className:`text-[#22c55e]`}):null]},`${e.provider}:${e.id}`)):(0,I.jsx)(`div`,{className:`px-3 py-2 text-[#737373]`,children:`No matching models.`})})]}):(0,I.jsx)(`div`,{className:`text-[#737373]`,children:`No models are available for the active runtime.`}),f?(0,I.jsx)(`div`,{className:`text-[11px] text-[#a3a3a3]`,children:f}):null]})]})}function KC(e={}){let t=[],n=[],r=$C(e.warnings),i=$C(e.errors);(e.session?.id||e.session?.title)&&t.push({id:`session`,label:`Session`,value:qC([e.session?.title,e.session?.id].filter(Boolean).join(` | `))}),e.session?.profile&&t.push({id:`profile`,label:`Profile`,value:qC(e.session.profile)}),e.session?.status&&t.push({id:`session-status`,label:`Session status`,value:qC(e.session.status),tone:e.session.status===`error`||e.session.status===`disposed`?`red`:`neutral`}),(e.model?.provider||e.model?.id||e.model?.label)&&t.push({id:`model`,label:`Model`,value:qC(e.model.label??[e.model.provider,e.model.id].filter(Boolean).join(`/`))}),e.runtime?.state&&t.push({id:`runtime`,label:`Runtime`,value:qC(e.runtime.state),tone:e.runtime.connected===!1||e.runtime.disposed?`red`:`green`}),e.runtime?.disposed!==void 0&&t.push({id:`disposed`,label:`Disposed`,value:e.runtime.disposed?`yes`:`no`,tone:e.runtime.disposed?`red`:`neutral`}),typeof e.runtime?.queuedMessages==`number`&&t.push({id:`queue`,label:`Queue`,value:String(e.runtime.queuedMessages)}),e.runtime?.processing!==void 0&&t.push({id:`processing`,label:`Processing`,value:e.runtime.processing?`yes`:`no`,tone:e.runtime.processing?`cyan`:`neutral`}),e.runtime?.streaming!==void 0&&t.push({id:`streaming`,label:`Streaming`,value:e.runtime.streaming?`yes`:`no`,tone:e.runtime.streaming?`cyan`:`neutral`}),e.cwd&&t.push({id:`cwd`,label:`CWD`,value:qC(e.cwd)});let a=typeof e.thinking==`string`?{level:e.thinking}:e.thinking;(a?.level||a?.supported!==void 0)&&t.push({id:`thinking`,label:`Thinking`,value:qC(a.level??(a.supported===!1?`unsupported`:`available`)),tone:a.supported===!1?`red`:`yellow`}),e.fastMode!==void 0&&t.push({id:`fast-mode`,label:`Fast mode`,value:typeof e.fastMode==`string`?qC(e.fastMode):e.fastMode?`on`:`off`,tone:e.fastMode?`green`:`neutral`});let o=$C(e.tools?.enabled),s=$C(e.tools?.active);o.length&&t.push({id:`enabled-tools`,label:`Enabled tools`,value:`${o.length}${o.length<=4?` (${o.join(`, `)})`:``}`}),s.length&&t.push({id:`active-tools`,label:`Active tools`,value:`${s.length}${s.length<=4?` (${s.join(`, `)})`:``}`,tone:`cyan`}),e.providerUsage?.planType&&t.push({id:`provider-plan`,label:`Provider plan`,value:qC(e.providerUsage.planType)}),e.providerUsage?.credits&&t.push({id:`provider-credits`,label:`Credits`,value:e.providerUsage.credits.unlimited?`unlimited`:qC(e.providerUsage.credits.balance??`available`)}),e.message&&t.push({id:`message`,label:`Message`,value:qC(e.message)}),n.push(JC(e.contextUsage));for(let t of YC(e.providerUsage))n.push(t);return{kind:`status`,title:`Status`,fields:t,progress:n,warnings:r,errors:i}}function qC(e){return e.replace(/\b([A-Z0-9_]*(?:API[_-]?KEY|TOKEN|SECRET|PASSWORD)[A-Z0-9_]*)\s*=\s*([^\s]+)/gi,`$1=[redacted]`).replace(/\b(api[_-]?key|token|secret|password)\s*[:=]\s*([^\s]+)/gi,`$1=[redacted]`).replace(/\b(?:sk|pk|pibo|ghp|github_pat)_[A-Za-z0-9_\-]{8,}\b/g,`[redacted]`)}function JC(e){if(!e||e.tokens===void 0&&e.contextWindow===void 0&&e.percent===void 0)return{id:`context`,label:`Context`,state:`unavailable`,text:`Context usage unavailable`,tone:`neutral`};let t=XC(e.percent??(e.tokens!==void 0&&e.contextWindow?e.tokens/e.contextWindow*100:void 0));return{id:`context`,label:`Context`,state:t===void 0?`unavailable`:`available`,value:e.tokens,max:e.contextWindow,percent:t,text:t===void 0?`Context usage unavailable`:`${e.tokens??`?`}/${e.contextWindow??`?`} tokens (${t.toFixed(1)}%)`,tone:ZC(t)}}function YC(e){return e?.limits?.length?e.limits.map((t,n)=>{let r=XC(t.usedPercent),i=XC(t.remainingPercent??(r===void 0?void 0:100-r)),a=e.provider?`${e.provider} `:``,o=[i===void 0?void 0:`${i.toFixed(1)}% remaining`,t.resetsAt?`resets ${qC(t.resetsAt)}`:void 0].filter(Boolean).join(`, `);return{id:`provider-${n}`,label:`${a}${t.label??`quota`}`.trim(),state:i===void 0?`unavailable`:`available`,percent:i,text:i===void 0?`Provider usage unavailable`:o,tone:QC(i)}}):[{id:`provider`,label:`Provider quota`,state:`unavailable`,text:`Provider usage unavailable`,tone:`neutral`}]}function XC(e){if(!(typeof e!=`number`||!Number.isFinite(e)))return Math.max(0,Math.min(100,e))}function ZC(e){return e===void 0?`neutral`:e>=80?`red`:e>=50?`yellow`:`green`}function QC(e){return e===void 0?`neutral`:e<=20?`red`:e<=50?`yellow`:`green`}function $C(e){return(e??[]).map(e=>qC(e)).filter(e=>e.length>0)}function ew(e){switch(e.kind){case`tool.status`:return tw(e);case`tool.thinking`:return nw(e);case`tool.model`:return rw(e);case`tool.login`:return iw(e);case`tool.call`:case`tool.image`:case`tool.group.exploring`:case`tool.group.images`:return aw(e);case`yielded.run`:return ow(e,`yielded-run`,`Yielded run`,e.status===`error`?`red`:e.status===`running`?`cyan`:`green`);case`execution.compaction`:return ow(e,`compaction`,e.status===`error`?`Compaction failed`:e.status===`running`?`Compacting`:`Compaction`,e.status===`error`?`red`:`magenta`);case`execution.command`:return ow(e,`command`,`Command`,e.status===`error`?`red`:`yellow`);case`error`:return ow(e,`error`,`Error`,`red`);default:return}}function tw(e){let t=cw(e.output),n=lw(t,`activeModel`)??lw(t,`model`),r=KC({session:{id:fw(t,`piboSessionId`)??fw(t,`sessionId`),title:fw(t,`sessionTitle`)??fw(t,`title`),profile:fw(t,`profile`)??fw(t,`activeAgentId`)??fw(t,`agentId`),status:mw(t,`disposed`)?`disposed`:fw(t,`sessionStatus`)},model:n?{provider:fw(n,`provider`),id:fw(n,`id`),label:fw(n,`label`)}:void 0,runtime:{state:mw(t,`disposed`)?`disposed`:mw(t,`processing`)?`processing`:mw(t,`streaming`)?`streaming`:fw(t,`mode`)??`idle`,connected:mw(t,`connected`),queuedMessages:pw(t,`queuedMessages`),processing:mw(t,`processing`),streaming:mw(t,`streaming`),disposed:mw(t,`disposed`)},cwd:fw(t,`cwd`),contextUsage:lw(t,`contextUsage`),providerUsage:lw(t,`providerUsage`),tools:{enabled:dw(t,`enabledTools`),active:dw(t,`activeTools`)},thinking:fw(t,`thinkingLevel`)?{level:fw(t,`thinkingLevel`)}:void 0,fastMode:mw(t,`fastMode`),warnings:dw(t,`warnings`),errors:dw(t,`errors`),message:fw(t,`message`)});return{id:e.id,kind:`status`,title:`Status`,status:e.status,tone:e.status===`error`?`red`:`green`,rows:r.fields.map(e=>({label:e.label,value:e.value,tone:e.tone})),statusView:r,sourceRowKind:e.kind}}function nw(e){let t=cw(e.output),n=fw(t,`level`)??`unknown`,r=t?.supported!==!1,i=dw(t,`availableLevels`);return{id:e.id,kind:`thinking`,title:`Thinking`,status:e.status,tone:r?`yellow`:`red`,rows:[{label:`Current`,value:qC(n)},{label:`Supported`,value:r?`yes`:`no`,tone:r?`green`:`red`}],actions:i.map(e=>({id:`thinking:${e}`,label:e,action:`thinking.set`,value:e,disabled:!r})),sourceRowKind:e.kind}}function rw(e){let t=uw(cw(e.output),`providers`),n=t.flatMap(e=>{let t=fw(e,`id`)??fw(e,`provider`)??`provider`,n=fw(e,`label`)??fw(e,`name`)??t;return uw(e,`models`).map(e=>{let r=fw(e,`id`)??`model`,i=fw(e,`label`)??r;return{id:`model:${t}:${r}`,label:`${n} / ${i}`,action:`model.select`,value:`${t}/${r}`}})});return{id:e.id,kind:`model`,title:`Model`,status:e.status,tone:n.length?`cyan`:`neutral`,rows:[{label:`Providers`,value:String(t.length)},{label:`Models`,value:String(n.length)}],actions:n,sourceRowKind:e.kind}}function iw(e){let t=uw(cw(e.output),`providers`),n=t.map(e=>{let t=fw(e,`id`)??`provider`;return{id:`login:${t}`,label:fw(e,`name`)??fw(e,`label`)??t,action:`login.selectProvider`,value:t,description:dw(e,`authMethods`).join(`, `)}});return{id:e.id,kind:`login`,title:`Login`,status:e.status,tone:n.length?`cyan`:`neutral`,rows:[{label:`Providers`,value:String(t.length)}],actions:n,sourceRowKind:e.kind}}function aw(e){return ow(e,`tool`,e.kind===`tool.group.exploring`?`Exploring`:e.kind===`tool.image`||e.kind===`tool.group.images`?`Image`:`Tool`,e.status===`error`?`red`:e.status===`running`?`cyan`:`green`)}function ow(e,t,n,r){let i=e.lines.flatMap(e=>{let t=`${e.tokens.map(e=>e.text).join(``)}${e.functionCall?`${e.functionCall.name}${e.functionCall.input===void 0?``:` ${sw(e.functionCall.input)}`}`:``}`.trim();return t?[{value:qC(t)}]:[]}),a=e.lines.length===0&&typeof e.output==`string`&&e.output.trim()?[{value:qC(e.output.trim())}]:[],o=[e.error?{label:`Error`,value:qC(e.error),tone:`red`}:void 0].filter(e=>!!e);return{id:e.id,kind:t,title:n,status:e.status,tone:r,rows:[...i,...a,...o],sourceRowKind:e.kind}}function sw(e){try{return JSON.stringify(e)}catch{return String(e)}}function cw(e){if(e){if(typeof e==`string`)try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:void 0}catch{return}return typeof e==`object`&&!Array.isArray(e)?e:void 0}}function lw(e,t){let n=e?.[t];return n&&typeof n==`object`&&!Array.isArray(n)?n:void 0}function uw(e,t){let n=e?.[t];return Array.isArray(n)?n.filter(e=>!!e&&typeof e==`object`&&!Array.isArray(e)):[]}function dw(e,t){let n=e?.[t];return Array.isArray(n)?n.filter(e=>typeof e==`string`):[]}function fw(e,t){let n=e?.[t];return typeof n==`string`?n:void 0}function pw(e,t){let n=e?.[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function mw(e,t){let n=e?.[t];return typeof n==`boolean`?n:void 0}var hw={transcript:0,"product-history":1,"event-log":1,live:2},gw={"user.message":0,"execution.command":1,"execution.compaction":1,"agent.turn":2,"model.reasoning":3,"tool.call":4,"agent.delegation":4,"agent.async":5,"tool.result":6,"yielded.run":7,"assistant.message":8,error:9};function _w(e,t){return{sourceRank:hw[`event-log`],turnSeq:e??2**53-1,eventSequence:e,phaseRank:gw[t]}}function vw(e,t,n){let r=e??2**53-1,i=t??2**53-1;return{sourceRank:hw.live,turnSeq:r,streamId:r,streamFrameIndex:i,phaseRank:gw[n]}}function yw(e){let[t,n]=e.split(`:`);if(t===void 0||n===void 0)return;let r=Number(t),i=Number(n);if(!(!Number.isInteger(r)||r<0)&&!(!Number.isInteger(i)||i<0))return{streamId:r,frameIndex:i}}function bw(e,t){if(e)return{...e,contentPartIndex:(e.contentPartIndex??0)+.1,phaseRank:gw[t]}}function xw(e,t){return!e&&!t?0:e?t?e.sourceRank-t.sourceRank||e.turnSeq-t.turnSeq||(e.transcriptIndex??2**53-1)-(t.transcriptIndex??2**53-1)||(e.eventSequence??2**53-1)-(t.eventSequence??2**53-1)||(e.streamId??2**53-1)-(t.streamId??2**53-1)||(e.streamFrameIndex??2**53-1)-(t.streamFrameIndex??2**53-1)||(e.contentPartIndex??0)-(t.contentPartIndex??0)||e.phaseRank-t.phaseRank:-1:1}function Sw(e){let t=!1,n=e.map(e=>e.children.length?(t=!0,{...e,children:Sw(e.children)}):e);return Cw(n)?t?n:[...e]:[...n].sort(ww)}function Cw(e){for(let t=1;t<e.length;t+=1)if(ww(e[t-1],e[t])>0)return!1;return!0}function ww(e,t){if(e.orderKey&&t.orderKey&&e.orderKey.sourceRank===t.orderKey.sourceRank){let n=xw(e.orderKey,t.orderKey);if(n!==0)return n}else{let n=Tw(e,t);if(n!==0)return n}let n=Ew(e.startedAt,t.startedAt);if(n!==0)return n;let r=xw(e.orderKey,t.orderKey);return r===0?e.id.localeCompare(t.id):r}function Tw(e,t){if(!e.eventId||e.eventId!==t.eventId)return 0;let n=e.orderKey?.phaseRank,r=t.orderKey?.phaseRank;return n===void 0||r===void 0?0:n-r}function Ew(e,t){return!e&&!t?0:e?t?e.localeCompare(t):-1:1}function Dw(e){let t=[],n=[...e].reverse();for(;n.length;){let e=n.pop();if(e){t.push(e);for(let t=e.children.length-1;t>=0;--t)n.push(e.children[t])}}return t}function Ow(e){let t=new Map;for(let n of e)t.set(n.id,{...n,children:[...n.children]});let n=new Set;for(let e of t.values()){if(!e.parentId)continue;let r=t.get(e.parentId);r&&(r.children.push(e),n.add(e.id))}return Sw([...t.values()].filter(e=>!n.has(e.id)))}function kw(e,t,n,r){if(!Aw(t))return;let i=r.get(e)?.filter(e=>e.metadata?.subagentToolName===t)??[],a=Mw(n);return a?i.find(e=>e.metadata?.threadKey===a)?.id:i.length===1?i[0].id:void 0}function Aw(e){return e.startsWith(`pibo_subagent_`)}function jw(e){return e.slice(14)}function Mw(e){let t=`args`in e&&e.args&&typeof e.args==`object`&&!Array.isArray(e.args)?e.args:void 0,n=t&&`threadKey`in t?t.threadKey:void 0;return typeof n==`string`&&n.trim()?n.trim():void 0}function Nw(e,t,n,r){let i=Fw(e,t,n,r);if(!i)return;let a=e.children.find(e=>e.id===i.id);if(a){Lw(a,i),a.runId=i.runId??a.runId;return}e.children.push(i)}function Pw(e){let t=new Map;for(let n of Dw(e)){let e=Rw(n.output);if(!e)continue;let r=Bw(e.runId);r&&t.set(r,{snapshot:e,completedAt:Bw(e.completedAt)??Bw(e.updatedAt)??n.completedAt})}for(let n of Dw(e)){if(n.type!==`agent.async`||!n.runId)continue;let e=t.get(n.runId);if(!e)continue;let r=Bw(e.snapshot.status);(r===`completed`||r===`cancelled`||r===`failed`||r===`timed_out`)&&(n.status=r===`failed`||r===`timed_out`?`error`:`done`,n.completedAt=e.completedAt??n.completedAt,n.output=e.snapshot,(r===`failed`||r===`timed_out`)&&(n.error=Bw(e.snapshot.summary)??n.error))}}function Fw(e,t,n,r){if(!Iw(e))return;let i=Rw(e.output),a=Hw(e.input)?e.input:{},o=Bw(i?.toolName)??Bw(a.toolName)??r?.title;if(!o||!Aw(o))return;let s=Bw(r?.summary)??jw(o),c=Bw(i?.runId),l=Bw(i?.status),u=a.arguments,d=Bw(i?.completionPolicy)??Bw(a.completionPolicy);return{id:`${e.id}:async-agent`,parentId:e.id,piboSessionId:t,eventId:e.eventId,toolCallId:e.toolCallId,runId:c,type:`agent.async`,title:s,status:Vw(e,l),startedAt:r?.startedAt??n??e.startedAt,completedAt:l===`completed`||l===`cancelled`||l===`failed`||l===`timed_out`?e.completedAt:void 0,summary:`Started by ${e.title}`,input:{startedBy:e.title,startToolCallId:e.toolCallId,toolName:o,subagentName:s,runId:c,completionPolicy:d,arguments:u,threadKey:Hw(r?.input)?r.input.threadKey:void 0},output:i,error:e.error,linkedPiboSessionId:r?.linkedPiboSessionId??e.linkedPiboSessionId,source:e.source,stableKey:c?`async-agent:${c}`:`${e.stableKey??e.id}:async-agent`,orderKey:bw(e.orderKey,`agent.async`),children:[]}}function Iw(e){return e.type===`tool.call`&&e.title===`pibo_run_start`}function Lw(e,t){e.status=t.status,e.summary=t.summary??e.summary,e.input=t.input??e.input,e.output=t.output??e.output,e.error=t.error??e.error,e.completedAt=t.completedAt??e.completedAt,e.linkedPiboSessionId=t.linkedPiboSessionId??e.linkedPiboSessionId}function Rw(e){if(Hw(e)){if(zw(e))return e;if(Hw(e.details)&&zw(e.details))return e.details}}function zw(e){return typeof e.runId==`string`&&typeof e.toolName==`string`}function Bw(e){return typeof e==`string`?e:void 0}function Vw(e,t){return e.status===`error`||t===`failed`?`error`:t===`completed`||t===`cancelled`?`done`:`running`}function Hw(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Uw(e){let t=(e??``).trim();if(!t.startsWith(`<pibo_run_notification>`)||!t.endsWith(`</pibo_run_notification>`))return;let n=t.slice(23,t.length-24).trim();try{let e=JSON.parse(n);return!e||typeof e!=`object`||Array.isArray(e)?void 0:e}catch{return}}function Ww(e){let t=Gw(e.notification),n=t.length===1?t[0]:void 0,r=qw(e.notification.failed)+qw(e.notification.timedOut),i=qw(e.notification.running);return{id:e.id,entryId:e.entryId,piboSessionId:e.piboSessionId,eventId:e.eventId,runId:typeof n?.runId==`string`?n.runId:void 0,type:`yielded.run`,title:`Run Notification`,status:r>0?`error`:i>0?`running`:`done`,startedAt:e.startedAt,summary:Jw(e.notification),output:e.notification,source:e.source,stableKey:e.stableKey??e.id,orderKey:e.orderKey,children:[]}}function Gw(e){return[...Kw(e.completed),...Kw(e.failed),...Kw(e.timedOut),...Kw(e.cancelled),...Kw(e.running)]}function Kw(e){return Array.isArray(e)?e.filter(Yw):[]}function qw(e){return Array.isArray(e)?e.length:0}function Jw(e){let t=[[qw(e.completed),`completed`],[qw(e.failed),`failed`],[qw(e.timedOut),`timed out`],[qw(e.cancelled),`cancelled`],[qw(e.running),`running`]].filter(([e])=>Number(e)>0).map(([e,t])=>`${e} ${t}`);return t.length?t.join(`, `):`No yielded run updates`}function Yw(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Xw(e,t,n,r,i,a,o,s,c){let l=r.payload,u=o.mode===`none`?void 0:rT(e,r);if(u){l.type===`message_steered`&&l.activeEventId&&(u.parentId=DT(l.activeEventId));return}if((o.mode===`native`&&bT(l)||o.mode===`product`&&yT(l))&&ST(l,o)&&!xT(l,s)||CT(l,o,c))return;if(l.type===`assistant_delta`){fT(e,t,l,c,r.createdAt,r.eventSequence,r.streamId,r.streamFrameIndex,r.traceSource);return}if(l.type===`thinking_delta`){hT(e,t,l,c,r.createdAt,r.eventSequence,r.streamId,r.streamFrameIndex,r.traceSource);return}if(l.type===`assistant_message`){let i=Zw(n,l,r.createdAt,r.eventSequence,r.streamId,r.streamFrameIndex,r.traceSource),a=t.get(i.id)??pT(t,i);if(a){mT(a,i);return}e.push(i),t.set(i.id,i);return}let d=dT(n,l,i,a,c,r.createdAt,r.eventSequence,r.streamId,r.streamFrameIndex,r.traceSource);if(d){if(d.type===`user.message`&&d.status===`running`&&!d.parentId&&l.type===`message_steered`){let e=[...t.values()].reverse().find(e=>e.type===`agent.turn`&&e.status===`running`);e&&(d.parentId=e.id)}if(d.type===`agent.turn`&&d.eventId){let e=[...t.values()].find(e=>e.type===`agent.turn`&&e.eventId===d.eventId);if(e){e.status=d.status,e.completedAt=d.completedAt??e.completedAt;return}}if(d.type===`assistant.message`){let e=t.get(d.id)??pT(t,d);if(e){mT(e,d);return}}if(d.type===`execution.compaction`){let t=zT(e);if(t){BT(t,d);return}}if(d.type===`model.reasoning`){let e=t.get(d.id)??pT(t,d);if(e){gT(e,d);return}}if(d.type===`agent.delegation`&&!d.toolCallId&&d.linkedPiboSessionId){let e=PT([...t.values()],d);if(e){NT(e,d);return}}if(d.toolCallId){let e=[...t.values()].find(e=>e.toolCallId===d.toolCallId&&(e.type===`tool.call`||e.type===`agent.delegation`));if(e){if(Iw(e)&&d.type===`agent.delegation`){Nw(e,n,r.createdAt,d);return}MT(e,d),Nw(e,n,r.createdAt);return}}if(d.eventId){let e=t.get(d.id);if(e){d.type===`user.message`?(e.status=d.status,e.parentId=d.parentId??e.parentId,e.summary=d.summary??e.summary,e.output=d.output??e.output):d.type===`execution.command`&&(e.status=d.status,e.output=d.output??e.output,e.error=d.error??e.error,e.completedAt=d.completedAt??e.completedAt);return}}Qw(d,t),Nw(d,n,r.createdAt),e.push(d);for(let e of Dw([d]))t.set(e.id,e)}}function Zw(e,t,n,r,i,a,o){let s=typeof t.eventId==`string`?t.eventId:void 0,c=kT(t);return{id:c?OT(c):`event:${t.type}:${GT(t)}`,piboSessionId:e,eventId:s,parentId:s?DT(s):void 0,type:`assistant.message`,title:`Agent Message`,status:`done`,startedAt:n,completedAt:n,summary:t.text,output:t.text,source:`event-log`,stableKey:c?`assistant:${c}`:ET(t),orderKey:wT(r,t.type,i,a,o),children:[]}}function Qw(e,t){if(e.type!==`execution.command`||e.parentId&&t.has(e.parentId))return;let n=[...t.values()].filter(n=>{if(n.type!==`agent.turn`||!n.startedAt||!e.startedAt||n.startedAt>e.startedAt)return!1;let r=$w(n,t);return r===void 0||e.startedAt<=r}).sort(ww).at(-1);n&&(e.parentId=n.id)}function $w(e,t){return e.completedAt?e.completedAt:[...t.values()].filter(t=>t.type===`error`&&t.eventId!==void 0&&t.eventId===e.eventId&&t.startedAt!==void 0).sort(ww).at(0)?.startedAt}function eT(e){return e.some(e=>{let t=e.payload.type;return t!==`assistant_delta`&&t!==`thinking_delta`})}function tT(e){if(e.type===`assistant_delta`){if(e.text.length===0)return;let t=kT(e);return t?OT(t):void 0}if(e.type===`thinking_delta`){if(e.text.length===0)return;let t=jT(e);return t?AT(t):void 0}}function nT(e,t){return!!rT(e,t)}function rT(e,t){let n=t.payload;if(n.type!==`message_queued`&&n.type!==`message_steered`||n.source!==`user`)return;let r=typeof n.eventId==`string`?n.eventId:void 0,i=r??t.eventId,a=`event:${n.type}:${r??GT(n)}`,o=ET(n),s=typeof n.text==`string`?n.text:void 0,c=Dw([...e]).filter(e=>e.type===`user.message`&&iT(e.source));return c.find(e=>aT(e,a,o,i))||c.find(e=>!oT(e)&&!!(s&&cT(e)===s))}function iT(e){return e===`transcript`||e===`product-history`}function aT(e,t,n,r){return e.id===t||e.stableKey===n?!0:r?e.entryId===r||e.stableKey===`entry:${r}`||[e.id,e.stableKey].some(e=>sT(e)===r):!1}function oT(e){return[e.id,e.stableKey].some(e=>sT(e)!==void 0)}function sT(e){for(let t of[`event:message_queued:`,`event:message_steered:`])if(e?.startsWith(t))return e.slice(t.length)}function cT(e){if(typeof e.output==`string`)return e.output;if(typeof e.summary==`string`)return e.summary}function lT(e){if(e.streamId!==void 0){let t=e.payload;return e.streamFrameIndex===void 0?`stream:${e.streamId}:${t.type}`:`stream:${e.streamId}:${e.streamFrameIndex}:${t.type}`}return e.eventSequence===void 0?`id:${e.id}`:`sequence:${e.piboSessionId??``}:${e.eventSequence}`}function uT(e,t){let n=t;for(let t of e)t.streamId!==void 0&&(n=n===void 0?t.streamId:Math.max(n,t.streamId));return n}function dT(e,t,n,r,i,a,o,s,c,l){let u=`eventId`in t&&typeof t.eventId==`string`?t.eventId:void 0,d=`event:${t.type}:${u??GT(t)}`,f=u?DT(u):void 0,p={id:d,piboSessionId:e,eventId:u,startedAt:a,source:`event-log`,stableKey:ET(t),orderKey:wT(o,t.type,s,c,l),children:[]};switch(t.type){case`message_queued`:case`message_steered`:{let n=Uw(t.text);return t.source===`service`&&n?Ww({id:d,piboSessionId:e,eventId:u,startedAt:a,source:`event-log`,stableKey:u?`run-notification:${u}`:d,orderKey:wT(o,t.type,s,c,l),notification:n}):{...p,...t.type===`message_steered`&&t.activeEventId?{parentId:DT(t.activeEventId)}:{},type:`user.message`,title:`User Message`,status:_T(t)?`running`:`done`,summary:t.text,output:t.text}}case`message_started`:case`message_finished`:return t.source===`service`?void 0:{...p,id:u?DT(u):d,type:`agent.turn`,startedAt:t.type===`message_started`?a:void 0,title:`Agent Turn`,status:t.type===`message_finished`||i!==`running`?`done`:`running`,completedAt:t.type===`message_finished`?a:void 0,stableKey:u?`turn:${u}`:p.stableKey};case`thinking_finished`:{if(!VT(t.text))return;let e=jT(t);return{...p,id:e?AT(e):d,parentId:f,type:`model.reasoning`,title:`Thinking`,status:`done`,summary:t.text,output:t.text,stableKey:e?`reasoning:${e}`:p.stableKey}}case`assistant_message`:{let e=kT(t);return{...p,id:e?OT(e):d,parentId:f,type:`assistant.message`,title:`Agent Message`,status:`done`,completedAt:a,summary:t.text,output:t.text,stableKey:e?`assistant:${e}`:p.stableKey}}case`tool_call`:case`tool_execution_started`:case`tool_execution_updated`:case`tool_execution_finished`:{let o=Aw(t.toolName),s=r.get(t.toolCallId)??(o?kw(e,t.toolName,t,n):void 0);return{...p,id:`tool:${t.toolCallId}`,parentId:f,toolCallId:t.toolCallId,intent:t.intent,type:o?`agent.delegation`:`tool.call`,title:t.toolName,status:t.type===`tool_execution_finished`?t.isError?`error`:`done`:i===`running`&&(t.type===`tool_execution_started`||t.type===`tool_execution_updated`)?`running`:`done`,completedAt:t.type===`tool_execution_finished`?a:void 0,input:`args`in t?t.args:void 0,output:t.type===`tool_execution_finished`?t.result:t.type===`tool_execution_updated`?t.partialResult:void 0,error:t.type===`tool_execution_finished`&&t.isError?HT(t.result):void 0,linkedPiboSessionId:s,stableKey:`tool:${t.toolCallId}`,children:[]}}case`subagent_session`:{let e=WT(t.childPiboSessionId),n=UT(o,s,t);return{...p,id:t.toolCallId?`tool:${t.toolCallId}`:`event:subagent_session:${n}`,eventId:u,toolCallId:t.toolCallId,type:`agent.delegation`,title:t.toolName,status:i===`running`?`running`:`done`,summary:t.subagentName,input:{subagentName:t.subagentName,threadKey:t.threadKey},linkedPiboSessionId:e,stableKey:t.toolCallId?`tool:${t.toolCallId}`:e?`subagent:${e}`:`subagent:event:${n}`,children:[]}}case`execution_result`:return vT(t.action)?void 0:{...p,type:`execution.command`,title:t.action,status:`done`,input:{action:t.action},output:t.result};case`compaction_start`:{let e=UT(o,s,t);return{...p,id:`event:compaction:${e}`,type:`execution.compaction`,title:`compact`,status:`running`,summary:`Compacting`,input:{reason:t.reason},stableKey:`compaction:${e}`}}case`compaction_end`:{let e=UT(o,s,t);return{...p,id:`event:compaction:end:${e}`,type:`execution.compaction`,title:`compact`,status:t.errorMessage?`error`:`done`,completedAt:a,summary:t.aborted?`Compaction skipped`:t.errorMessage?`Compaction failed`:`Compacted`,input:{reason:t.reason},output:t.result,error:t.errorMessage,stableKey:`compaction:${e}`}}case`session_error`:return{...p,type:`error`,title:`Session Error`,status:`error`,summary:t.errorDetails?.userMessage,input:t.errorDetails,error:t.error,output:t.error};default:return}}function fT(e,t,n,r,i,a,o,s,c){if(typeof n.text!=`string`||n.text.length===0)return;let l=kT(n),u=l?OT(l):`event:assistant_delta:${GT(n)}`,d=t.get(u);if(d){let e=`${typeof d.output==`string`?d.output:``}${n.text}`;d.status=r===`running`?`running`:`done`,d.summary=e,d.output=e;return}let f={id:u,parentId:n.eventId?DT(n.eventId):void 0,piboSessionId:n.piboSessionId,eventId:n.eventId,type:`assistant.message`,title:`Agent Message`,status:r===`running`?`running`:`done`,startedAt:i,summary:n.text,output:n.text,source:`event-log`,stableKey:l?`assistant:${l}`:u,orderKey:wT(a,n.type,o,s,c),children:[]};e.push(f),t.set(f.id,f)}function pT(e,t){if(t.stableKey)return[...e.values()].find(e=>e.type===t.type&&e.stableKey===t.stableKey)}function mT(e,t){e.status=t.status,e.summary=t.summary??e.summary,e.output=t.output??e.output,e.error=t.error??e.error,e.completedAt=t.completedAt??e.completedAt}function hT(e,t,n,r,i,a,o,s,c){if(typeof n.text!=`string`||n.text.length===0)return;let l=jT(n),u=l?AT(l):`event:thinking_delta:${GT(n)}`,d=l?`reasoning:${l}`:u,f=t.get(u)??[...t.values()].find(e=>e.type===`model.reasoning`&&e.stableKey===d);if(f){let e=`${typeof f.output==`string`?f.output:``}${n.text}`;f.status=r===`running`?`running`:`done`,f.summary=e,f.output=e;return}let p={id:u,parentId:n.eventId?DT(n.eventId):void 0,piboSessionId:n.piboSessionId,eventId:n.eventId,type:`model.reasoning`,title:`Thinking`,status:r===`running`?`running`:`done`,startedAt:i,summary:n.text,output:n.text,source:`event-log`,stableKey:d,orderKey:wT(a,n.type,o,s,c),children:[]};e.push(p),t.set(p.id,p)}function gT(e,t){e.status=t.status,e.summary=t.summary??e.summary,e.output=t.output??e.output,e.completedAt=t.completedAt??e.completedAt}function _T(e){return(e.type===`message_queued`||e.type===`message_steered`)&&`clientTxnId`in e&&typeof e.clientTxnId==`string`}function vT(e){return e===`session.fork`||e===`session.clone`||e===`session.switch`}function yT(e){return e.type===`assistant_delta`||e.type===`assistant_message`}function bT(e){return e.type===`message_queued`||e.type===`message_started`||e.type===`message_finished`||e.type===`assistant_delta`||e.type===`assistant_message`||e.type===`thinking_started`||e.type===`thinking_delta`||e.type===`thinking_finished`}function xT(e,t){let n=`eventId`in e&&typeof e.eventId==`string`?e.eventId:void 0;return!!(n&&t.has(n))}function ST(e,t){let n=`eventId`in e&&typeof e.eventId==`string`?e.eventId:void 0;return n===void 0||t.eventIds.has(n)}function CT(e,t,n){return t.mode!==`native`||n===`running`||e.type!==`tool_call`&&e.type!==`tool_execution_started`&&e.type!==`tool_execution_updated`&&e.type!==`tool_execution_finished`||typeof e.intent==`string`&&e.intent.trim()?!1:t.toolCallIds.has(e.toolCallId)||ST(e,t)}function wT(e,t,n,r,i){return i===`live`?vw(n,r,TT(t)):_w(e,TT(t))}function TT(e){switch(e){case`message_queued`:case`message_steered`:return`user.message`;case`message_started`:case`message_finished`:return`agent.turn`;case`thinking_started`:case`thinking_delta`:case`thinking_finished`:return`model.reasoning`;case`tool_call`:case`tool_execution_started`:case`tool_execution_updated`:case`tool_execution_finished`:case`subagent_session`:return`tool.call`;case`assistant_delta`:case`assistant_message`:return`assistant.message`;case`execution_result`:return`execution.command`;case`compaction_start`:case`compaction_end`:return`execution.compaction`;case`session_error`:return`error`;default:return`execution.command`}}function ET(e){let t=`eventId`in e&&typeof e.eventId==`string`?e.eventId:void 0;if(e.type===`tool_call`||e.type===`tool_execution_started`||e.type===`tool_execution_updated`||e.type===`tool_execution_finished`||e.type===`subagent_session`&&e.toolCallId)return`tool:${e.toolCallId}`;if(t&&(e.type===`message_started`||e.type===`message_finished`))return`turn:${t}`;if(e.type===`thinking_started`||e.type===`thinking_delta`||e.type===`thinking_finished`){let t=jT(e);if(t)return`reasoning:${t}`}if(e.type===`assistant_delta`||e.type===`assistant_message`){let t=kT(e);if(t)return`assistant:${t}`}return`event:${e.type}:${t??GT(e)}`}function DT(e){return`event:message:${e}`}function OT(e){return`event:assistant:${e}`}function kT(e){if(!e.eventId)return;let t=typeof e.assistantIndex==`number`?e.assistantIndex:e.contentIndex;return typeof t==`number`?`${e.eventId}:assistant:${t}`:e.eventId}function AT(e){return`event:thinking:${e}`}function jT(e){if(!e.eventId)return;let t=typeof e.thinkingIndex==`number`?e.thinkingIndex:e.contentIndex;return typeof t==`number`?`${e.eventId}:thinking:${t}`:e.eventId}function MT(e,t){e.status=t.status,e.intent=t.intent??e.intent,e.summary=t.summary??e.summary,e.input=LT(e,t),e.output=t.output??e.output,e.error=t.error??e.error,e.completedAt=t.completedAt??e.completedAt,e.linkedPiboSessionId=t.linkedPiboSessionId??e.linkedPiboSessionId}function NT(e,t){e.summary=t.summary??e.summary,e.input=LT(e,t),e.linkedPiboSessionId=t.linkedPiboSessionId??e.linkedPiboSessionId}function PT(e,t){let n=[...e].reverse().filter(e=>e.type===`agent.delegation`),r=FT(t),i=n.filter(e=>!e.linkedPiboSessionId&&FT(e)===r),a=IT(t.input);return(a?i.find(e=>IT(e.input)===a):i.length===1?i[0]:void 0)||n.find(e=>e.linkedPiboSessionId===t.linkedPiboSessionId)}function FT(e){let t=RT(e.input)?e.input:void 0,n=typeof t?.subagentName==`string`?t.subagentName:e.summary??e.title;return typeof n==`string`&&n.replace(/^pibo_subagent_/,``).trim().toLowerCase()||void 0}function IT(e){if(!(!RT(e)||typeof e.threadKey!=`string`))return e.threadKey.trim()||void 0}function LT(e,t){return e.type!==`agent.delegation`||!RT(e.input)||!RT(t.input)?t.input??e.input:Object.fromEntries(Object.entries({...e.input,...t.input}).filter(([,e])=>e!==void 0))}function RT(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function zT(e){return Dw([...e]).reverse().find(e=>e.type===`execution.compaction`&&e.status===`running`)}function BT(e,t){e.status=t.status,e.summary=t.summary??e.summary,e.input=t.input??e.input,e.output=t.output??e.output,e.error=t.error??e.error,e.completedAt=t.completedAt??e.completedAt}function VT(e){return typeof e==`string`&&e.trim().length>0}function HT(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function UT(e,t,n){return e===void 0?t===void 0?GT(n):`stream:${t}`:`sequence:${e}`}function WT(e){if(typeof e==`string`)return e.trim()||void 0}function GT(e){return KT(new TextEncoder().encode(JSON.stringify(e))).slice(0,48)}function KT(e){let t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`,n=``,r=0;for(;r+2<e.length;r+=3){let i=e[r]<<16|e[r+1]<<8|e[r+2];n+=t[i>>18&63]+t[i>>12&63]+t[i>>6&63]+t[i&63]}if(r<e.length){let i=e[r],a=r+1<e.length?e[r+1]:0,o=i<<16|a<<8;n+=t[o>>18&63]+t[o>>12&63],r+1<e.length&&(n+=t[o>>6&63])}return n}function qT(e){let t=new Map;for(let n of e)t.set(n.id,n);let n=[];for(let r of e){if(!r.parentId){n.push(r);continue}let e=t.get(r.parentId);e?e.children.push(r):n.push(r)}return Sw(n)}function JT(e,t,n){return t.map(t=>YT(e,t,n))}function YT(e,t,n){let r=e.get(t.id);if(t.children.length===0){let e=r!==void 0&&r.children.length===0;return r&&e&&(n&&!n.has(t.id)||XT(r,t))?r:e?{...t,children:r.children}:{...t,children:[]}}let i=t.children.map(t=>YT(e,t,n)),a=r!==void 0&&r.children.length===i.length&&r.children.every((e,t)=>e===i[t]);return r&&a&&(n&&!n.has(t.id)||XT(r,t))?r:a?{...t,children:r?.children??i}:{...t,children:i}}function XT(e,t){return e.id===t.id&&e.parentId===t.parentId&&e.entryId===t.entryId&&e.piboSessionId===t.piboSessionId&&e.eventId===t.eventId&&e.toolCallId===t.toolCallId&&e.runId===t.runId&&e.intent===t.intent&&e.type===t.type&&e.title===t.title&&e.status===t.status&&e.startedAt===t.startedAt&&e.completedAt===t.completedAt&&e.durationMs===t.durationMs&&e.summary===t.summary&&e.input===t.input&&e.output===t.output&&e.error===t.error&&e.linkedPiboSessionId===t.linkedPiboSessionId&&e.source===t.source&&e.stableKey===t.stableKey&&ZT(e.orderKey,t.orderKey)}function ZT(e,t){return e===t?!0:!e||!t?!1:e.sourceRank===t.sourceRank&&e.turnSeq===t.turnSeq&&e.transcriptIndex===t.transcriptIndex&&e.contentPartIndex===t.contentPartIndex&&e.eventSequence===t.eventSequence&&e.streamId===t.streamId&&e.streamFrameIndex===t.streamFrameIndex&&e.phaseRank===t.phaseRank}function QT(e,t,n){if(!t.length)return e;let r=new Set(e.rawEvents.map(e=>lT(e))),i=[];for(let e of t){let t=lT(e);r.has(t)||(r.add(t),i.push(e))}if(!i.length)return e;let a=Dw(e.nodes),o=[],s=new Map,c=new Map;for(let e of a){c.set(e.id,e);let t={...e,children:[]};o.push(t),s.set(t.id,t)}let l=new Map,u=new Map,d=new Set,f={mode:`none`,eventIds:new Set,toolCallIds:new Set},p=[],m=new Set;for(let t of i){if(nT(o,t))continue;p.push(t);let r=tT(t.payload);m&&r?m.add(r):m=void 0,Xw(o,s,e.piboSessionId,t,l,u,f,d,n)}if(!p.length)return e;let h=qT(o);eT(p)&&Pw(h);let g=JT(c,h,m);return{...e,rawEvents:e.rawEvents.length?[...e.rawEvents,...p]:p,nodes:g,latestStreamId:uT(p,e.latestStreamId)}}var $T={browser_use_open_tabs:`browser_use.open_tabs`,browser_use_take_screenshot:`browser_use.take_screenshot`,browser_use_browser_use:`browser_use.browser_use`,node_repl_js:`node_repl.js`,node_repl_js_reset:`node_repl.js_reset`};function eE(e,t){if(!e)return[];let n=aE(e.nodes),r=RE(oE(e.nodes).sort((e,t)=>ww(e.node,t.node)).filter(e=>e.node.type!==`agent.turn`&&(t.showThinking||e.node.type!==`model.reasoning`)).map(e=>sE(e.node,e.turnId)));dE(r,n);let i=uE(r);return tE((t.toolDisplayMode??`default`)==="default"?VE(i).map(e=>e.row):i.map(e=>e.row),t.toolDisplayMode??`default`)}function tE(e,t){return t==="default"?e:t===`hide`?e.filter(e=>!nE(e)):e.flatMap(e=>{if(!nE(e))return[e];let n=e.intent?.trim();if(t===`intent`&&!n)return[];let r={...e,lines:e.lines.slice(0,1),input:void 0,output:void 0,error:void 0,markdown:void 0,expandable:!1,singleLine:!0,previewOmission:void 0,detailItems:void 0};return t===`intent`?[{...r,title:void 0,summary:void 0,lines:[{prefix:`bullet`,tokens:[$(n,e.status===`error`?`red`:e.status===`done`?`green`:`cyan`,`semibold`)]}]}]:[r]})}function nE(e){return e.id.startsWith(`terminal:tool:`)||e.kind===`tool.call`||e.kind===`tool.image`||e.kind===`tool.group.exploring`||e.kind===`tool.group.images`||e.kind===`agent.delegation`}function rE(e){if(!e)return;let t=new Set(oE(e.nodes).map(({node:e})=>e).filter(e=>e.type===`error`&&e.eventId).map(e=>e.eventId));return[...aE(e.nodes).values()].filter(e=>e.startedAt&&!e.completedAt&&(!e.eventId||!t.has(e.eventId))).sort(ww).at(-1)?.startedAt}function iE(e){let t=Math.max(0,Math.floor(e/1e3));return[Math.floor(t/3600),Math.floor(t%3600/60),t%60].map(e=>String(e).padStart(2,`0`)).join(`:`)}function aE(e){let t=new Map;for(let n of e){n.type===`agent.turn`&&t.set(n.id,n);for(let[e,r]of aE(n.children))t.set(e,r)}return t}function oE(e,t){let n=[];for(let r of e)r.type!==`agent.turn`&&n.push({node:r,turnId:t}),n.push(...oE(r.children,r.type===`agent.turn`?r.id:t));return n}function sE(e,t){let n;switch(e.type){case`user.message`:n={row:mE(e),turnId:t};break;case`assistant.message`:n={row:hE(e),turnId:t};break;case`model.reasoning`:n={row:gE(e),turnId:t};break;case`tool.call`:n=_E(e,t);break;case`tool.result`:n=bE(e,t);break;case`agent.delegation`:n={row:SE(e),turnId:t};break;case`agent.async`:n={row:CE(e),turnId:t};break;case`yielded.run`:n={row:wE(e),turnId:t};break;case`execution.command`:n={row:EE(e),turnId:t};break;case`execution.compaction`:n={row:TE(e),turnId:t};break;case`error`:n={row:IE(e),turnId:t};break;case`agent.turn`:n={row:{id:e.id,kind:`error`,status:`neutral`,lines:[],sourceNodeIds:[e.id]},turnId:t}}return{...n,row:{...n.row,id:cE(e),intent:e.intent,...pE(e)}}}function cE(e){if(e.type===`tool.call`||e.type===`tool.result`||e.type===`agent.delegation`){let t=e.toolCallId??lE(e.stableKey,`tool:`);if(t)return`terminal:tool:${t}`;if(e.type===`agent.delegation`&&e.linkedPiboSessionId)return`terminal:delegation:${e.linkedPiboSessionId}`}if((e.type===`agent.async`||e.type===`yielded.run`)&&e.runId)return`terminal:run:${e.runId}`;if(e.type===`assistant.message`){let t=lE(e.stableKey,`assistant:`);if(t)return`terminal:assistant:${t}`}if(e.type===`model.reasoning`){let t=lE(e.stableKey,`reasoning:`);if(t)return`terminal:reasoning:${t}`}return e.id}function lE(e,t){if(!e?.startsWith(t))return;let n=e.slice(t.length);return n&&n!==`undefined`?n:void 0}function uE(e){let t=[],n=new Map;for(let r of e){let e=n.get(r.row.id);if(e===void 0){n.set(r.row.id,t.length),t.push(r);continue}let i=t[e];t[e]={...r,turnId:r.turnId??i.turnId,row:{...i.row,...r.row,sourceNodeIds:[...new Set([...i.row.sourceNodeIds,...r.row.sourceNodeIds])],intent:r.row.intent??i.row.intent,input:r.row.input??i.row.input,output:r.row.output??i.row.output,error:r.row.error??i.row.error,payloadRefs:{...i.row.payloadRefs,...r.row.payloadRefs}}}}return t}function dE(e,t){for(let n of t.values()){if(!n.completedAt)continue;let t=e.filter(e=>e.turnId===n.id).at(-1);t?.row.kind===`message.assistant`&&t.row.status!==`running`&&(t.row.startedAt=n.startedAt,t.row.completedAt=n.completedAt,t.row.durationMs=n.durationMs??fE(n.startedAt,n.completedAt))}}function fE(e,t){if(!e||!t)return;let n=new Date(e).getTime(),r=new Date(t).getTime();return Number.isFinite(n)&&Number.isFinite(r)?Math.max(0,r-n):void 0}function pE(e){return{eventId:e.eventId,runId:e.runId,orderSource:e.source,orderStreamId:e.orderKey?.streamId,orderStreamFrameIndex:e.orderKey?.streamFrameIndex,payloadRefs:e.payloadRefs}}function mE(e){let t=CD(e.output)||CD(e.summary)||e.title;return{id:e.id,kind:`message.user`,status:xD(e.status),lines:[{prefix:`prompt`,tokens:[$(t)]}],sourceNodeIds:[e.id],forkEntryId:e.entryId,pendingMessageDelivery:yD(e),startedAt:e.startedAt,output:t,payloadRefs:e.payloadRefs}}function hE(e){return{id:e.id,kind:`message.assistant`,status:xD(e.status),lines:[],sourceNodeIds:[e.id],startedAt:e.startedAt,completedAt:e.source===`transcript`||e.source===`product-history`?e.completedAt:void 0,durationMs:e.source===`transcript`||e.source===`product-history`?e.durationMs:void 0,output:CD(e.output)||CD(e.summary)||``,error:e.error,payloadRefs:e.payloadRefs}}function gE(e){let t=cD(e.output??e.summary);return{id:e.id,kind:`reasoning`,status:xD(e.status),lines:[{prefix:`bullet`,tokens:[$(e.status===`running`?`Thinking`:`Thought`,`amber`,`semibold`)]}],sourceNodeIds:[e.id],markdown:t,payloadRefs:e.payloadRefs}}function _E(e,t){let n=hD(e.input);if(n&&uD(e.title))return{row:FE(e,n),turnId:t,exploring:void 0};if(dD(e.title))return{row:vE(e),turnId:t};let r=KE(e);if(r)return{row:yE(e,r),turnId:t,image:r.groupable?r.detail:void 0};let i=oD(e.error??e.output,5,e.error?`red`:`dim`);return{row:{id:e.id,kind:`tool.call`,status:xD(e.status),errorKind:e.status===`error`?`tool`:void 0,lines:[{prefix:`bullet`,tokens:[$(_D(e.status),SD(e.status),`semibold`),$(` `)],functionCall:{name:tD(e.title),input:e.input}},...i.lines],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error,previewOmission:sD(i,e.error?`error`:`output`)},turnId:t,exploring:eD(e)}}function vE(e){let t=xD(e.status),n=pD(e),r=mD(e.output),i=[{prefix:`bullet`,tokens:[$(fD(e.status),SD(e.status),e.status===`error`?`bold`:`semibold`)]}];return n&&i.push({prefix:`detail`,tokens:[$(`query: ${JSON.stringify(n)}`,`cyan`)]}),e.status===`done`&&r!==void 0&&i.push({prefix:`detail`,tokens:[$(`sources: ${r}`,`dim`)]}),e.status===`error`&&e.error&&i.push({prefix:`detail`,tokens:[$(e.error,`red`)]}),{id:e.id,kind:`tool.call`,status:t,errorKind:e.status===`error`?`tool`:void 0,lines:i,sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error}}function yE(e,t){let n=xD(e.status),r=t.path?`Path: ${t.path}`:t.artifactId?`Artifact: ${t.artifactId}`:t.query?`Query: ${t.query}`:t.mimeType?`Type: ${t.mimeType}`:`Image content returned`;return{id:e.id,kind:`tool.image`,status:n,errorKind:e.status===`error`?`tool`:void 0,lines:[{prefix:`bullet`,tokens:[$(t.verb,SD(e.status),`semibold`)]},{prefix:`detail`,tokens:[$(r,e.status===`error`?`red`:`cyan`)]}],sourceNodeIds:[e.id],input:JE(e.input),output:t.summary,error:e.error,expandable:e.input!==void 0||t.summary!==void 0||!!e.error}}function bE(e,t){let n=KE(e);return n?{row:yE(e,n),turnId:t,image:n.groupable?n.detail:void 0}:{row:xE(e),turnId:t}}function xE(e){let t=oD(e.error??e.output,5,e.error?`red`:`dim`);return{id:e.id,kind:`tool.call`,status:xD(e.status),errorKind:e.status===`error`?`tool`:void 0,lines:[{prefix:`bullet`,tokens:[$(e.status===`error`?`Tool failed`:`Returned`,SD(e.status),`semibold`),$(` ${tD(e.title)}`)]},...t.lines],sourceNodeIds:[e.id],output:e.output,error:e.error,expandable:e.output!==void 0||!!e.error,previewOmission:sD(t,e.error?`error`:`output`)}}function SE(e){let t=CD(wD(e.input)?e.input.subagentName:void 0)||e.summary||e.title,n=lD((wD(e.input)?e.input.arguments:void 0)??e.input),r=n?[{prefix:`detail`,tokens:[$(n,`dim`)]}]:[];return{id:e.id,kind:`agent.delegation`,status:xD(e.status),errorKind:e.status===`error`?`tool`:void 0,title:e.title,summary:e.summary,lines:[{prefix:`bullet`,tokens:[$(vD(e.status),SD(e.status),`semibold`),$(` ${t}`,`cyan`)]},...r],sourceNodeIds:[e.id],linkedPiboSessionId:e.linkedPiboSessionId,startedAt:e.startedAt,completedAt:e.completedAt,durationMs:e.durationMs,input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error}}function CE(e){let t=oD(e.error??e.output,5,e.error?`red`:`dim`);return{id:e.id,kind:`agent.async`,status:xD(e.status),lines:[{prefix:`bullet`,tokens:[$(bD(e.status),SD(e.status),`semibold`),$(` ${e.title}`,`cyan`)]},...t.lines],sourceNodeIds:[e.id],linkedPiboSessionId:e.linkedPiboSessionId,input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error,previewOmission:sD(t,e.error?`error`:`output`)}}function wE(e){let t=oD(e.output,5);return{id:e.id,kind:`yielded.run`,status:xD(e.status),errorKind:e.status===`error`?`tool`:void 0,lines:[{prefix:`bullet`,tokens:[$(e.status===`running`?`Waiting on runs`:`Run update`,SD(e.status),`semibold`),$(e.summary?` ${e.summary}`:``)]},...t.lines],sourceNodeIds:[e.id],output:e.output,error:e.error,expandable:e.output!==void 0||!!e.error,previewOmission:sD(t,`output`)}}function TE(e){let t=e.status===`running`?`Compacting`:e.status===`error`?`Compaction failed`:CD(e.summary)||`Compacted`;return{id:e.id,kind:`execution.compaction`,status:xD(e.status),lines:[{prefix:`bullet`,tokens:[$(t,SD(e.status),e.status===`error`?`bold`:`semibold`)]}],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error}}function EE(e){if(e.title===`status`)return DE(e);if(e.title===`thinking`)return BE(e.output)?kE(e):OE(e);if(e.title===`fast_mode`)return AE(e);if(e.title===`login`&&NE(e.output))return jE(e);if(e.title===`model`&&PE(e.output))return ME(e);hD(e.output)??hD(e.input)??e.title;let t=oD(e.error??e.output,5,e.error?`red`:`dim`,180);return{id:e.id,kind:`execution.command`,status:xD(e.status),lines:[{prefix:`bullet`,tokens:[$(`Command`,`yellow`,`semibold`),$(` /${e.title}`,`yellow`)]},...t.lines],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error,previewOmission:sD(t,e.error?`error`:`output`)}}function DE(e){return{id:e.id,kind:`tool.status`,status:xD(e.status),lines:[],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:!1}}function OE(e){return{id:e.id,kind:`tool.thinking`,status:xD(e.status),lines:[],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:!1}}function kE(e){let t=wD(e.output)?e.output:void 0,n=CD(t?.level),r=t?.changed!==!1,i=t?.supported!==!1,a=i?n?r?`Thinking level set to ${n}.`:`Thinking level is already ${n}.`:`Thinking level updated.`:`Thinking level is not supported by this model.`;return{id:e.id,kind:`execution.command`,status:xD(e.status),lines:[{prefix:`bullet`,tokens:[$(a,i?`green`:`dim`,`semibold`)]}],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:!1}}function AE(e){let t=wD(e.output)?e.output:void 0,n=t?.mode===`fast`?`fast`:t?.mode===`normal`?`normal`:void 0,r=t?.changed!==!1,i=t?.supported!==!1,a=i?n===`fast`?r?`Switched to Fast mode.`:`Fast mode is already on.`:n===`normal`?r?`Switched to Normal mode.`:`Normal mode is already on.`:`Fast mode updated.`:`Fast mode is not supported by this model.`;return{id:e.id,kind:`execution.command`,status:xD(e.status),lines:[{prefix:`bullet`,tokens:[$(a,i?`green`:`dim`,`semibold`)]}],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:!1}}function jE(e){return{id:e.id,kind:`tool.login`,status:xD(e.status),lines:[],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:!1}}function ME(e){return{id:e.id,kind:`tool.model`,status:xD(e.status),lines:[],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:!1}}function NE(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return t.action===`show_login_menu`&&Array.isArray(t.providers)}function PE(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return t.action===`show_model_menu`&&Array.isArray(t.providers)}function FE(e,t){let n=oD(e.error??e.output,5,e.error?`red`:`dim`,180);return{id:e.id,kind:`execution.command`,status:xD(e.status),errorKind:e.status===`error`?`tool`:void 0,lines:[{prefix:`bullet`,tokens:[$(e.status===`running`?`Running`:`Ran`,SD(e.status),`semibold`),$(` `),...gD(t)]},...n.lines],sourceNodeIds:[e.id],input:e.input,output:e.output,error:e.error,expandable:e.input!==void 0||e.output!==void 0||!!e.error,previewOmission:sD(n,e.error?`error`:`output`)}}function IE(e){return{id:e.id,kind:`error`,status:`error`,errorKind:`system`,lines:[{prefix:`bullet`,tokens:[$(e.title||`Error`,`red`,`bold`),$(e.error?` ${e.error}`:``,`red`)]},...LE(e.input)],sourceNodeIds:[e.id],input:e.input,error:e.error,output:e.output,expandable:e.input!==void 0||e.output!==void 0||!!e.error}}function LE(e){return wD(e)?[[`Class`,CD(e.errorClass)??CD(e.category)],[`Code`,CD(e.code)??CD(e.providerCode)],[`Origin`,CD(e.origin)],[`Provider`,[CD(e.api),CD(e.provider),CD(e.model)].filter(Boolean).join(` / `)||void 0],[`Retryable`,typeof e.retryable==`boolean`?e.retryable?`yes`:`no`:void 0]].filter(e=>typeof e[1]==`string`&&e[1].length>0).map(([e,t],n)=>({prefix:n===0?`detail`:`continuation`,tokens:[$(`${e}: `,`dim`),$(t,`red`)]})):[]}function RE(e){let t=e.map(e=>e.row.output).filter(zE).at(-1);return t?e.map(e=>e.row.kind!==`tool.thinking`||!wD(e.row.output)?e:{...e,row:{...e.row,output:{...e.row.output,level:t.level,availableLevels:t.availableLevels,supported:t.supported}}}):[...e]}function zE(e){return wD(e)&&typeof e.level==`string`&&Array.isArray(e.availableLevels)}function BE(e){return wD(e)&&e.action===`set_thinking_level`}function VE(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e[n],i=HE(r);if(!i){t.push(r);continue}let a=[r],o=n+1;for(;o<e.length&&HE(e[o])===i&&e[o].turnId===r.turnId;)a.push(e[o]),o+=1;if(a.length===1){t.push(r);continue}t.push({row:i===`images`?WE(a):UE(a),turnId:r.turnId}),n=o-1}return t}function HE(e){if(e.image)return`images`;if(e.exploring)return`exploring`}function UE(e){let t=GE(e,`exploring`),n=t.slice(0,6),r=Math.max(0,t.length-n.length),i=e[0]?.row,a=i?.id??`exploring`,o=e[e.length-1]?.row.id??a,s=e.some(e=>e.row.status===`running`)?`running`:e.some(e=>e.row.status===`error`)?`error`:`done`;return{id:`group:exploring:${a}:${o}`,kind:`tool.group.exploring`,status:s,errorKind:s===`error`?`tool`:void 0,lines:[{prefix:`bullet`,tokens:[$(s===`running`?`Exploring`:s===`error`?`Exploring failed`:`Explored`,SD(s),`semibold`)]},...n.map((e,t)=>({prefix:t===0?`detail`:`continuation`,tokens:[$(e.label,e.status===`error`?`red`:`dim`)]})),...r>0?[{prefix:`continuation`,tokens:[$(`+${r} more explorations`,`dim`,`normal`,!0)]}]:[]],sourceNodeIds:e.flatMap(e=>e.row.sourceNodeIds),eventId:i?.eventId,runId:i?.runId,orderSource:i?.orderSource,orderStreamId:i?.orderStreamId,orderStreamFrameIndex:i?.orderStreamFrameIndex,detailItems:t,expandable:t.some(e=>e.input!==void 0||e.output!==void 0||!!e.error),previewOmission:r>0?{source:`details`,visibleLineCount:n.length,omittedLineCount:r,totalLineCount:t.length,maxVisibleLineCount:6}:void 0}}function WE(e){let t=GE(e,`images`),n=t.slice(0,6),r=Math.max(0,t.length-n.length),i=e[0]?.row,a=i?.id??`images`,o=e[e.length-1]?.row.id??a,s=e.some(e=>e.row.status===`running`)?`running`:e.some(e=>e.row.status===`error`)?`error`:`done`;return{id:`group:images:${a}:${o}`,kind:`tool.group.images`,status:s,errorKind:s===`error`?`tool`:void 0,lines:[{prefix:`bullet`,tokens:[$(s===`running`?`Viewing images`:s===`error`?`Image reads failed`:`Viewed images`,SD(s),`semibold`)]},...n.map((e,t)=>({prefix:t===0?`detail`:`continuation`,tokens:[$(e.label,e.status===`error`?`red`:`cyan`)]})),...r>0?[{prefix:`continuation`,tokens:[$(`+${r} more image reads`,`dim`,`normal`,!0)]}]:[]],sourceNodeIds:e.flatMap(e=>e.row.sourceNodeIds),eventId:i?.eventId,runId:i?.runId,orderSource:i?.orderSource,orderStreamId:i?.orderStreamId,orderStreamFrameIndex:i?.orderStreamFrameIndex,detailItems:t,expandable:t.some(e=>e.input!==void 0||e.output!==void 0||!!e.error),previewOmission:r>0?{source:`details`,visibleLineCount:n.length,omittedLineCount:r,totalLineCount:t.length,maxVisibleLineCount:6}:void 0}}function GE(e,t){return e.map(e=>{let n=t===`images`?e.image:e.exploring;return{id:e.row.id,label:n?.label??e.row.lines[0]?.tokens.map(e=>e.text).join(``)??e.row.id,status:e.row.status,input:e.row.input,output:e.row.output,error:e.row.error,payloadRefs:e.row.payloadRefs,linkedPiboSessionId:e.row.linkedPiboSessionId,previewOmission:e.row.previewOmission}})}function KE(e){let t=(e.title??``).trim().toLowerCase(),n=wD(e.input)?e.input:void 0,r=wD(e.output)?e.output:void 0,i=$E(r,`details`),a=t===`codex_image_generation`?XE(i)??ZE(n):void 0,o=a?CD(i?.savedPath)??rD(i):rD(n)??rD(i)??rD(r),s=a?CD(i?.artifactId):void 0,c=iD(n),l=qE(e.output),u=nD(t,[`view_image`,`image`,`screenshot`]);if(!l.length&&!u&&!a)return;let d=l.map(e=>e.mimeType).find(e=>!!e),f=Math.max(1,l.length),p={type:l.length>1?`images`:l.length===1?`image`:`image_reference`,toolName:a?e.title:void 0,operation:a,path:o,savedPath:a?o:void 0,artifactId:s,model:a?CD(i?.model):void 0,referencedImageCount:a?aD(i?.referencedImageCount):void 0,query:c,mimeType:d,count:f>1?f:void 0,detail:l.length?`Image data hidden in terminal view.`:`Image path only; binary data is hidden in terminal view.`},m=o??s??c??d??`image`,h=a?QE(e.status,a):YE(e.status,f);return{count:f,path:o,artifactId:s,query:c,mimeType:d,verb:h,groupable:!a,summary:p,detail:{id:e.id,label:`${h} ${m}`,status:xD(e.status),input:JE(e.input),output:p,error:e.error}}}function qE(e,t=0,n=new Set){if(t>5||typeof e!=`object`||!e||n.has(e))return[];if(n.add(e),Array.isArray(e))return e.flatMap(e=>qE(e,t+1,n));let r=e,i=typeof r.type==`string`?r.type.toLowerCase():void 0,a=typeof r.mimeType==`string`?r.mimeType:typeof r.mime_type==`string`?r.mime_type:void 0,o=typeof r.data==`string`||typeof r.image_url==`string`||wD(r.image_url);if((i===`image`||i===`input_image`||i===`output_image`||i===`image_url`)&&(o||a?.startsWith(`image/`))||a?.startsWith(`image/`)&&o)return[{mimeType:a}];let s=[];return`content`in r&&s.push(r.content),`message`in r&&s.push(r.message),`result`in r&&s.push(r.result),`output`in r&&s.push(r.output),s.flatMap(e=>qE(e,t+1,n))}function JE(e){if(Array.isArray(e))return e.map(JE);if(!wD(e))return e;let t={};for(let[n,r]of Object.entries(e)){if((n===`data`||n===`image_url`)&&typeof r==`string`&&r.length>120){t[n]=`[hidden ${n}]`;continue}t[n]=JE(r)}return t}function YE(e,t){return e===`running`?t>1?`Viewing images`:`Viewing image`:e===`error`?t>1?`Image reads failed`:`Image read failed`:t>1?`Viewed images`:`Viewed image`}function XE(e){let t=CD(e?.operation);return t===`generate`||t===`edit`?t:void 0}function ZE(e){if(!e)return;let t=e.referenced_image_paths;return Array.isArray(t)&&t.length>0||aD(e.num_last_images_to_include)!==void 0?`edit`:`generate`}function QE(e,t){return t===`edit`?e===`running`?`Editing image`:e===`error`?`Image edit failed`:`Edited image`:e===`running`?`Generating image`:e===`error`?`Image generation failed`:`Generated image`}function $E(e,t){let n=e?.[t];return wD(n)?n:void 0}function eD(e){let t=(e.title??``).trim().toLowerCase(),n=wD(e.input)?e.input:void 0;if(nD(t,[`read`,`open`]))return{id:e.id,label:`Read ${rD(n)??lD(e.input)}`,status:xD(e.status),input:e.input,output:e.output,error:e.error};if(nD(t,[`list`,`ls`,`glob`]))return{id:e.id,label:`List ${rD(n)??lD(e.input)}`,status:xD(e.status),input:e.input,output:e.output,error:e.error};if(nD(t,[`search`,`find`,`grep`,`rg`])){let t=iD(n),r=rD(n);return{id:e.id,label:`Search ${t??lD(e.input)}${r?` in ${r}`:``}`,status:xD(e.status),input:e.input,output:e.output,error:e.error}}}function tD(e){return $T[e]??e}function nD(e,t){return t.some(t=>e===t||e.startsWith(`${t}_`)||e.endsWith(`_${t}`)||e.includes(t))}function rD(e){if(e)for(let t of[`path`,`file`,`filePath`,`filepath`,`url`,`uri`,`cwd`,`pattern`,`glob`]){let n=CD(e[t]);if(n)return n}}function iD(e){if(e)for(let t of[`query`,`pattern`,`text`,`name`,`q`,`regex`]){let n=CD(e[t]);if(n)return n}}function aD(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function oD(e,t,n=`dim`,r=160){let i={lines:[],visibleLineCount:0,omittedLineCount:0,totalLineCount:0,maxVisibleLineCount:t},a=cD(e);if(!a)return i;let o=a.split(/\r?\n/).map(e=>e.trimEnd()).filter((e,t,n)=>e.length>0||n.length===1);if(!o.length)return i;let s=o.slice(0,t),c=Math.max(0,o.length-s.length),l=s.map((e,t)=>({prefix:t===0?`detail`:`continuation`,tokens:[$(e,n)]}));return c>0&&l.push({prefix:`continuation`,tokens:[$(`+${c} more lines`,`dim`,`normal`,!0)]}),{lines:l,visibleLineCount:s.length,omittedLineCount:c,totalLineCount:o.length,maxVisibleLineCount:t}}function sD(e,t){if(!(e.omittedLineCount<=0))return{source:t,visibleLineCount:e.visibleLineCount,omittedLineCount:e.omittedLineCount,totalLineCount:e.totalLineCount,maxVisibleLineCount:e.maxVisibleLineCount}}function cD(e){let t=KS(e);if(t!==void 0)return t.trim();if(typeof e==`string`)return e.trim();if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function lD(e){return(typeof e==`string`?e:cD(e)).replace(/\s+/g,` `).trim()}function uD(e){let t=(e??``).trim().toLowerCase();return t===`shell`||t===`bash`||t===`terminal`}function dD(e){return(e??``).trim().toLowerCase()===`web_search`}function fD(e){return e===`running`?`Searching web`:e===`error`?`Web search failed`:`Searched web`}function pD(e){let t=wD(e.input)?e.input:void 0,n=wD(e.output)?e.output:void 0;return CD(t?.query)??CD(n?.query)??CD(e.summary)}function mD(e){if(!wD(e))return;let t=e.sourceCount??e.sourcesCount;if(typeof t==`number`&&Number.isFinite(t))return t;let n=e.sources??e.citations??e.results;return Array.isArray(n)?n.length:void 0}function hD(e){if(wD(e))for(let t of[`cmd`,`command`,`script`]){let n=CD(e[t]);if(n)return n}}function gD(e){let t=e.match(/\s+|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[^\s]+/g)??[e],n=!1;return t.map(e=>/^\s+$/.test(e)?$(e):/^(?:&&|\|\||[|;<>]|2>&1)$/.test(e)?$(e,`red`,`semibold`):e.startsWith(`-`)?$(e,`magenta`):e.startsWith(`$`)||e.includes(`=`)?$(e,`yellow`):/^['"]/.test(e)?$(e,`green`):n?e.includes(`/`)||e.startsWith(`.`)?$(e,`cyan`):$(e,`default`):(n=!0,$(e,`green`,`semibold`)))}function _D(e){return e===`running`?`Calling`:e===`error`?`Call failed`:`Called`}function vD(e){return e===`running`?`Spawning`:e===`error`?`Spawn failed`:`Spawned`}function yD(e){if(e.status===`running`){if(e.id.startsWith(`event:message_steered:`))return`steer`;if(e.id.startsWith(`event:message_queued:`))return`queue`}}function bD(e){return e===`running`?`Waiting for`:`Finished waiting for`}function xD(e){return e===`running`?`running`:e===`error`?`error`:`done`}function SD(e){return e===`running`?`cyan`:e===`error`?`red`:e===`done`?`green`:`default`}function $(e,t=`default`,n=`normal`,r=!1){return{text:e,tone:t,weight:n,italic:r}}function CD(e){return typeof e==`string`&&e.trim().length?e:void 0}function wD(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function TD(e){if(!e)return;let t;if(typeof e==`string`)try{t=JSON.parse(e)}catch{return}else typeof e==`object`&&!Array.isArray(e)&&(t=e);if(!t)return;let n=typeof t.contextUsage==`object`&&t.contextUsage!==null?t.contextUsage:void 0,r=typeof t.providerUsage==`object`&&t.providerUsage!==null?t.providerUsage:void 0,i=Array.isArray(r?.limits)?r.limits.filter(e=>!!e&&typeof e==`object`&&!Array.isArray(e)).map(e=>{let t=typeof e.usedPercent==`number`?e.usedPercent:void 0,n=typeof e.remainingPercent==`number`?e.remainingPercent:t===void 0?0:Math.max(0,Math.min(100,100-t));return{label:typeof e.label==`string`?e.label:`limit`,usedPercent:t??0,remainingPercent:n,resetsAt:typeof e.resetsAt==`string`?e.resetsAt:void 0}}):[],a=typeof r?.credits==`object`&&r.credits!==null?r.credits:void 0;return{piboSessionId:typeof t.piboSessionId==`string`?t.piboSessionId:void 0,queuedMessages:typeof t.queuedMessages==`number`?t.queuedMessages:void 0,processing:typeof t.processing==`boolean`?t.processing:void 0,streaming:typeof t.streaming==`boolean`?t.streaming:void 0,enabledTools:Array.isArray(t.enabledTools)?t.enabledTools.filter(e=>typeof e==`string`):Array.isArray(t.activeTools)?t.activeTools.filter(e=>typeof e==`string`):void 0,activeTools:Array.isArray(t.activeTools)?t.activeTools.filter(e=>typeof e==`string`):void 0,cwd:typeof t.cwd==`string`?t.cwd:void 0,disposed:typeof t.disposed==`boolean`?t.disposed:void 0,contextUsage:n?{tokens:typeof n.tokens==`number`?n.tokens:void 0,contextWindow:typeof n.contextWindow==`number`?n.contextWindow:void 0,percent:typeof n.percent==`number`?n.percent:void 0}:void 0,providerUsage:r&&(i.length>0||a)?{provider:typeof r.provider==`string`?r.provider:void 0,planType:typeof r.planType==`string`?r.planType:void 0,fetchedAt:typeof r.fetchedAt==`string`?r.fetchedAt:void 0,limits:i,credits:a?{unlimited:a.unlimited===!0,balance:typeof a.balance==`string`?a.balance:void 0}:void 0}:void 0}}function ED(e,t,n){return n?{id:e,label:t,value:n}:void 0}function DD({field:e,icon:t}){let n=t===`session`?An:En;return(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px]`,"data-shared-status-field":e.id,children:[(0,I.jsx)(n,{size:11,className:`shrink-0 text-[#737373]`}),(0,I.jsxs)(`span`,{className:`shrink-0 text-[#737373]`,children:[e.label,`:`]}),(0,I.jsx)(`span`,{className:`truncate font-mono ${e.id===`session`?`text-[#38bdf8]`:`text-[#d4d4d4]`}`,children:e.value})]})}function OD({progress:e,label:t}){let n=e.percent??0,r=e.tone===`red`?`bg-[#ef4444]`:e.tone===`yellow`?`bg-[#facc15]`:e.tone===`cyan`?`bg-[#38bdf8]`:`bg-[#22c55e]`;return(0,I.jsxs)(`div`,{className:`mt-3 space-y-1`,"data-shared-progress":e.id,"data-shared-progress-state":e.state,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,I.jsx)(`span`,{className:`text-[#737373]`,children:t??e.label}),(0,I.jsx)(`span`,{className:`font-mono text-[#d4d4d4]`,children:e.state===`available`?e.text:`unavailable`})]}),e.state===`available`?(0,I.jsx)(`div`,{className:`h-1.5 w-full overflow-hidden rounded-full bg-[#2a2a2a]`,children:(0,I.jsx)(`div`,{className:`h-full rounded-full ${r} transition-all`,style:{width:`${Math.min(Math.max(n,0),100)}%`}})}):null]})}function kD(e){if(!e)return;let t=new Date(e);if(!Number.isNaN(t.getTime()))return t.toLocaleString(void 0,{weekday:`short`,hour:`2-digit`,minute:`2-digit`})}function AD({row:e,piboSessionId:t}){let[n,r]=(0,F.useState)(null),i=n?.rowId===e.id&&Object.is(n.sourceOutput,e.output)?n.output:e.output,[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(null),d=TD(i),f=ew(e),p=i===e.output?f:ew({...e,output:i}),m=p?.kind===`status`?p.statusView:void 0,h=async()=>{if(!(!t||s)){c(!0),u(null);try{r({rowId:e.id,sourceOutput:e.output,output:await Dt(t)})}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(!1)}}},g=(0,I.jsx)(`button`,{type:`button`,disabled:!t||s,onClick:()=>void h(),className:`ml-auto inline-flex h-7 w-7 shrink-0 items-center justify-center border border-[#3a3a3a] bg-[#151f24] text-[#737373] transition hover:border-[#38bdf8] hover:text-[#38bdf8] disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":`Refresh status`,"aria-busy":s,title:s?`Refreshing status`:`Refresh status`,"data-pibo-debug":`terminal-status-refresh`,children:(0,I.jsx)(Un,{size:13,className:s?`animate-spin`:void 0})});if(!d||!m)return(0,I.jsxs)(`div`,{className:`mt-2 border border-[#2a2a2a] bg-[#111111] px-3 py-2 text-[12px] text-[#d4d4d4]`,"data-pibo-component":`TerminalStatusCard`,"data-pibo-debug":`terminal-status-card`,"data-shared-terminal-card":`status`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`text-[#737373]`,children:`Status (unparseable)`}),g]}),l?(0,I.jsx)(`div`,{className:`mt-2 text-[11px] text-[#ef4444]`,role:`alert`,children:l}):null]});let _=new Map(m.fields.map(e=>[e.id,e])),v=_.get(`session`)??ED(`session`,`Session`,d.piboSessionId),y=_.get(`cwd`)??ED(`cwd`,`CWD`,d.cwd),b=m.progress.find(e=>e.id===`context`),x=m.progress.filter(e=>e.id.startsWith(`provider`)),S=d.providerUsage?.limits.length?d.providerUsage.limits:void 0,C=d.enabledTools??d.activeTools??[],w=m.fields.filter(e=>!new Set([`session`,`cwd`]).has(e.id)),T=d.providerUsage?.provider?`${d.providerUsage.provider} quota`:`Provider quota`;return(0,I.jsxs)(`div`,{className:`mt-2 border border-[#2a2a2a] bg-[#111111] px-3 py-2 text-[12px] text-[#d4d4d4]`,"data-pibo-component":`TerminalStatusCard`,"data-pibo-debug":`terminal-status-card`,"data-shared-terminal-card":`status`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,I.jsx)(Xt,{size:14,className:`text-[#22c55e]`}),(0,I.jsx)(`span`,{className:`font-semibold text-[#d4d4d4]`,children:m.title}),g]}),l?(0,I.jsx)(`div`,{className:`mb-2 text-[11px] text-[#ef4444]`,role:`alert`,children:l}):null,(0,I.jsxs)(`div`,{className:`grid grid-cols-1 gap-1.5 sm:grid-cols-2`,children:[v?(0,I.jsx)(DD,{field:v,icon:`session`}):null,y?(0,I.jsx)(DD,{field:y,icon:`cwd`}):null,w.slice(0,8).map(e=>(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px]`,"data-shared-status-field":e.id,children:[(0,I.jsxs)(`span`,{className:`shrink-0 text-[#737373]`,children:[e.label,`:`]}),(0,I.jsx)(`span`,{className:`truncate font-mono text-[#d4d4d4]`,children:e.value})]},e.id))]}),(0,I.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[d.processing?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 border border-[#1f4960] px-1.5 py-0.5 text-[11px] text-[#38bdf8]`,children:[(0,I.jsx)(xn,{size:10}),` Processing`]}):null,d.streaming?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 border border-[#1f4960] px-1.5 py-0.5 text-[11px] text-[#38bdf8]`,children:[(0,I.jsx)(Xt,{size:10}),` Streaming`]}):null,typeof d.queuedMessages==`number`&&d.queuedMessages>0?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 border border-[#3a3a3a] px-1.5 py-0.5 text-[11px] text-[#d4d4d4]`,children:[(0,I.jsx)(Nn,{size:10}),` Queued: `,d.queuedMessages]}):null,d.disposed?(0,I.jsx)(`span`,{className:`inline-flex items-center gap-1 border border-[#5f2222] px-1.5 py-0.5 text-[11px] text-[#ef4444]`,children:`Disposed`}):null]}),b?(0,I.jsx)(OD,{progress:b,label:`Context Usage`}):null,x.length?(0,I.jsxs)(`div`,{className:`mt-3 space-y-1.5 border-t border-[#2a2a2a] pt-2`,"data-shared-provider-progress":x.length,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-[#737373]`,"data-shared-status-field":`provider-quota`,children:[(0,I.jsx)(Dn,{size:11}),(0,I.jsxs)(`span`,{children:[T,d.providerUsage?.planType?` (${d.providerUsage.planType})`:``]})]}),S?S.map(e=>{let t=kD(e.resetsAt);return(0,I.jsxs)(`div`,{className:`space-y-1`,"data-shared-progress":`provider-limit:${e.label}`,"data-shared-progress-state":`available`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-[11px]`,children:[(0,I.jsx)(`span`,{className:`text-[#a3a3a3]`,children:e.label}),(0,I.jsxs)(`span`,{className:`shrink-0 font-mono text-[#d4d4d4]`,children:[e.remainingPercent.toFixed(0),`% left`,t?` · resets ${t}`:``]})]}),(0,I.jsx)(`div`,{className:`h-1.5 w-full overflow-hidden rounded-full bg-[#2a2a2a]`,children:(0,I.jsx)(`div`,{className:`h-full rounded-full bg-[#38bdf8] transition-all`,style:{width:`${Math.min(Math.max(e.remainingPercent,0),100)}%`}})})]},`${e.label}-${e.resetsAt??``}`)}):x.map(e=>(0,I.jsx)(OD,{progress:e},e.id)),d.providerUsage?.credits?(0,I.jsxs)(`div`,{className:`text-[11px] text-[#a3a3a3]`,"data-shared-status-field":`provider-credits`,children:[`Credits: `,d.providerUsage.credits.unlimited?`unlimited`:d.providerUsage.credits.balance??`available`]}):null]}):null,m.warnings.length||m.errors.length?(0,I.jsxs)(`div`,{className:`mt-3 space-y-1 border-t border-[#2a2a2a] pt-2`,children:[m.warnings.map((e,t)=>(0,I.jsxs)(`div`,{"data-shared-status-warning":!0,className:`text-[11px] text-[#facc15]`,children:[`⚠ `,e]},`warning-${t}`)),m.errors.map((e,t)=>(0,I.jsxs)(`div`,{"data-shared-status-error":!0,className:`text-[11px] text-[#ef4444]`,children:[`✕ `,e]},`error-${t}`))]}):null,C.length>0?(0,I.jsxs)(`div`,{className:`mt-3`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`flex items-center gap-1.5 text-[11px] text-[#737373] hover:text-[#d4d4d4]`,children:[(0,I.jsx)(`span`,{className:`text-[#d4d4d4]`,children:a?`▾`:`▸`}),(0,I.jsxs)(`span`,{children:[`Enabled tools (`,C.length,`)`]})]}),a?(0,I.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:C.map(e=>(0,I.jsx)(`span`,{className:`inline-block rounded-sm border border-[#2a2a2a] bg-[#0b0b0b] px-1.5 py-0.5 font-mono text-[11px] text-[#a3a3a3]`,children:e},e))}):null]}):null]})}var jD=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`];function MD(e){let t;if(typeof e==`string`)try{t=JSON.parse(e)}catch{return}else e&&typeof e==`object`&&!Array.isArray(e)&&(t=e);if(t)return{level:typeof t.level==`string`?t.level:void 0,availableLevels:Array.isArray(t.availableLevels)?t.availableLevels.filter(e=>typeof e==`string`):[],supported:typeof t.supported==`boolean`?t.supported:void 0}}function ND(e){return jD.includes(e)?e:void 0}function PD({row:e,onLevelSelect:t}){let n=MD(e.output);return n?(0,I.jsxs)(`div`,{className:`mt-2 border border-[#2a2a2a] bg-[#111111] px-3 py-2 text-[12px] text-[#d4d4d4]`,"data-shared-terminal-card":`thinking`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,I.jsx)(rn,{size:14,className:`text-[#f59e0b]`}),(0,I.jsx)(`span`,{className:`font-semibold text-[#d4d4d4]`,children:`Thinking`}),n.supported===!1?(0,I.jsxs)(`span`,{className:`ml-auto inline-flex items-center gap-1 border border-[#5f2222] px-1.5 py-0.5 text-[11px] text-[#ef4444]`,children:[(0,I.jsx)(tr,{size:10}),` Unsupported`]}):(0,I.jsxs)(`span`,{className:`ml-auto inline-flex items-center gap-1 border border-[#1f4960] px-1.5 py-0.5 text-[11px] text-[#38bdf8]`,children:[(0,I.jsx)(on,{size:10}),` Supported`]})]}),(0,I.jsxs)(`div`,{className:`grid gap-1.5 text-[11px]`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-[#737373]`,children:`Current:`}),(0,I.jsx)(`span`,{className:`font-mono font-semibold text-[#f59e0b]`,children:n.level??`unknown`})]}),n.availableLevels.length?(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,I.jsx)(`span`,{className:`mr-1 text-[#737373]`,children:`Available:`}),n.availableLevels.map(e=>{let r=ND(e),i=n.supported===!1||!r||!t;return(0,I.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>{r&&t?.(r)},className:`border bg-transparent px-1.5 py-0.5 ${e===n.level?`border-[#f59e0b] text-[#f59e0b]`:`border-[#3a3a3a] text-[#d4d4d4]`} ${i?`cursor-default`:`cursor-pointer`}`,children:e},e)})]}):null,(0,I.jsxs)(`div`,{className:`text-[#737373]`,children:[`Click a level or use `,(0,I.jsx)(`span`,{className:`text-[#f59e0b]`,children:`/thinking <level>`}),`.`]})]})]}):(0,I.jsx)(`div`,{className:`mt-2 border border-[#2a2a2a] bg-[#111111] px-3 py-2 text-[12px] text-[#d4d4d4]`,"data-shared-terminal-card":`thinking`,children:(0,I.jsx)(`div`,{className:`text-[#737373]`,children:`Thinking (unparseable)`})})}var FD=`pibo.chat.terminalReadingPosition.`;function ID(e){if(e)try{return RD(sessionStorage.getItem(FD+e))}catch{return}}function LD(e,t){if(e)try{let n=FD+e;t?sessionStorage.setItem(n,JSON.stringify(t)):sessionStorage.removeItem(n)}catch{}}function RD(e){if(e)try{let t=JSON.parse(e);return typeof t.rowId!=`string`||!t.rowId||typeof t.offsetPx!=`number`||!Number.isFinite(t.offsetPx)?void 0:{rowId:t.rowId,offsetPx:t.offsetPx}}catch{return}}var zD=180,BD=4800,VD=20,HD={index:`LAST`,align:`end`},UD={top:2400,bottom:2400},WD=84,GD=700,KD=6;function qD({traceView:e,isLoading:t,terminalFullscreen:n,showThinking:r,expandThinking:i,toolDisplayMode:a,sessionAgentProfile:o,sessionActiveModel:s,sessionRuntimeBinding:c,selectedSessionStatus:l,selectedSessionSignal:u,signals:d,sessionGoal:f,sessionBreadcrumbs:p,originSession:m,derivedSessions:h,agentProfiles:g,sessionProfileChangeDisabled:_,onSessionAgentProfileChange:v,onFork:y,onOpenSession:b,onLoadOlderTracePage:x,hasOlderTraceEvents:S,isFetchingOlderTracePage:C,onThinkingLevelChange:w,onModelChanged:T}){let E=(0,F.useMemo)(()=>eE(e,{showThinking:r,toolDisplayMode:a}),[r,a,e]),D=(0,F.useMemo)(()=>E.map(e=>e.id),[E]),O=e?.piboSessionId??``,[k,ee]=(0,F.useState)(),te=(0,F.useRef)(void 0),[ne,A]=(0,F.useState)(new Set),j=(0,F.useMemo)(()=>[E,ne],[ne,E]),[re,M]=(0,F.useState)(null),N=(0,F.useRef)({}),ie=(0,F.useRef)(!1),ae=(0,F.useRef)(!1),oe=(0,F.useRef)(void 0),se=(0,F.useRef)(!1),ce=(0,F.useRef)(!1),le=(0,F.useRef)(!1),ue=(0,F.useRef)(()=>void 0),de=E.filter(e=>iO(e,`user`)).length,P=E.filter(e=>iO(e,`tool`)).length,fe=E.filter(e=>iO(e,`system`)).length,pe=BS({signal:u,fallbackStatus:l,fallbackTurnStartedAt:(0,F.useMemo)(()=>rE(e),[e])}),me=pe.activeTurnStartedAt,he=pe.isTurnActive,ge=!!US(f);(0,F.useLayoutEffect)(()=>{!O||!e||!_S()||ES(O,`compact-terminal:render`,E,{traceVersion:e.version,latestStreamId:e.latestStreamId,lastRawEventId:e.rawEvents.at(-1)?.id,selectedSessionStatus:l})},[O,E,l,e]);let _e=(0,F.useCallback)(e=>{if(!S||C||se.current)return;if(ce.current){le.current=!0;return}let t=()=>{oe.current=void 0,!se.current&&(se.current=!0,ae.current=!1,ue.current(),x?.())};if(!e||!ae.current){oe.current!==void 0&&window.clearTimeout(oe.current),t();return}oe.current===void 0&&(oe.current=window.setTimeout(t,GD))},[S,C,x]),ve=(0,F.useCallback)(()=>{ie.current&&ae.current&&_e(!0)},[_e]),ye=(0,F.useCallback)(()=>{ie.current&&(!ae.current&&!ce.current||_e(!1))},[_e]),be=(0,F.useCallback)(e=>{if(ce.current=e,e){oe.current!==void 0&&(window.clearTimeout(oe.current),oe.current=void 0,le.current=!0);return}le.current&&(le.current=!1,_e(!1))},[_e]),xe=(0,F.useCallback)((e,t)=>{yO(e,t)&&(ae.current=!0)},[]),Se=(0,F.useCallback)(e=>{ie.current&&e.startIndex<=VD&&ve()},[ve]),Ce=(0,F.useCallback)(e=>{O&&LD(O,e?{rowId:e.key,offsetPx:e.offset}:void 0)},[O]),we=Ms({itemCount:E.length,itemKeys:D,isPrepending:C,resetKey:e?.piboSessionId,contentKey:j,atBottomThreshold:zD,nearTopThreshold:BD,onAtTop:ye,onNearTop:ve,onUserScrollIntent:xe,onScrollbarDragChange:be,onVisibleAnchorChange:Ce});ue.current=we.prepareForPrepend,(0,F.useEffect)(()=>{te.current=void 0,se.current=!1,ce.current=!1,le.current=!1,ee(O?ID(O):void 0)},[O]),(0,F.useEffect)(()=>{se.current=!1},[e?.nextBeforeCursor,e?.nextBeforeSequence]),(0,F.useEffect)(()=>()=>{oe.current!==void 0&&window.clearTimeout(oe.current)},[]),(0,F.useEffect)(()=>{if(!O||!k)return;let t=D.indexOf(k.rowId);if(t>=0){let e=requestAnimationFrame(()=>{we.restoreAnchor({key:k.rowId,dataIndex:t,offset:k.offsetPx})&&ee(void 0)});return()=>cancelAnimationFrame(e)}if(!S){LD(O,void 0),ee(void 0);return}if(C)return;let n=String(e?.nextBeforeCursor??e?.nextBeforeSequence??E.length),r=`${O}:${n}`;te.current!==r&&(te.current=r,x?.())},[S,C,x,O,k,D,E.length,we.restoreAnchor,e?.nextBeforeCursor,e?.nextBeforeSequence]),(0,F.useEffect)(()=>{if(!O)return;let e=()=>{we.captureVisibleAnchor()};return window.addEventListener(`pagehide`,e),()=>window.removeEventListener(`pagehide`,e)},[O,we.captureVisibleAnchor]),(0,F.useEffect)(()=>{A(e=>rO(e,E,i))},[i,E]),(0,F.useEffect)(()=>{ie.current=!1,ae.current=!1;let e=window.setTimeout(()=>{ie.current=!0},250);return()=>window.clearTimeout(e)},[e?.piboSessionId]),(0,F.useEffect)(()=>{let e=new Set(E.map(e=>e.id));M(t=>t&&e.has(t)?t:null);for(let t of[`system`,`tool`,`user`]){let n=N.current[t];n&&!e.has(n)&&delete N.current[t]}},[E]);let Te=(0,F.useCallback)(e=>{let t=aO(E,e,N.current[e]);t&&(N.current[e]=t.row.id,M(t.row.id),we.scrollToIndex(t.index,`start`,`fast-smooth`,{fromIndex:t.fromIndex,stagingAlign:e===`tool`?`end`:void 0}),oO(t.row.id))},[E,we]),Ee=e=>{e.expandable&&A(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n})},De=(0,F.useCallback)((t,n)=>(0,I.jsx)(`div`,{className:`px-4`,children:(0,I.jsx)(XD,{row:n,expanded:ne.has(n.id),focused:re===n.id,piboSessionId:e?.piboSessionId??``,onToggle:()=>Ee(n),onFork:y,onOpenSession:b,onThinkingLevelChange:w,onModelChanged:T,signals:d})}),[ne,re,y,T,b,w,d,e?.piboSessionId]),Oe=(0,F.useMemo)(()=>({Footer:he||ge?()=>(0,I.jsx)(dO,{startedAt:me,isWorking:he,goal:f}):void 0}),[me,he,f,ge]);return(0,I.jsxs)(`section`,{className:`relative min-w-0 flex-1 flex flex-col overflow-hidden bg-[#0b0b0b] text-[#d4d4d4]`,"data-pibo-component":`CompactTerminalSessionView`,"data-pibo-debug":`compact-terminal-session-view`,"data-pibo-session-id":e?.piboSessionId??void 0,"data-pibo-terminal-fullscreen":n?`true`:`false`,"data-pibo-trace-has-older":e?.hasOlderEvents===!0?`true`:`false`,"data-pibo-trace-next-before":e?.nextBeforeCursor??e?.nextBeforeSequence??``,children:[n?null:(0,I.jsx)(JD,{errorCount:fe,toolErrorCount:P,userMessageCount:de,onNavigate:Te,sessionAgentProfile:o,sessionActiveModel:s,sessionRuntimeBinding:c,sessionBreadcrumbs:p,originSession:m,derivedSessions:h,onOpenSession:b}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:e?E.length?(0,I.jsx)(Do,{ref:we.virtuosoRef,data:E,firstItemIndex:we.firstItemIndex,initialTopMostItemIndex:HD,increaseViewportBy:UD,defaultItemHeight:WD,className:`min-h-0 h-full overflow-x-hidden font-mono text-[12px] leading-[1.45]`,computeItemKey:(e,t)=>t.id,scrollerRef:we.scrollerRef,atBottomStateChange:we.atBottomStateChange,atBottomThreshold:we.atBottomThreshold,itemsRendered:we.itemsRendered,rangeChanged:e=>Se(we.normalizeRange(e)),followOutput:we.followOutput,totalListHeightChanged:we.totalListHeightChanged,alignToBottom:!0,components:Oe,itemContent:De}):(0,I.jsx)(_O,{isLoading:t,agentProfiles:g,disabled:_,onSelectAgentProfile:v,message:`No visible trace rows yet.`}):(0,I.jsx)(_O,{isLoading:t,agentProfiles:g,disabled:_,onSelectAgentProfile:v})}),E.length===0&&ge?(0,I.jsx)(dO,{isWorking:!1,goal:f}):null,we.isSticky?null:(0,I.jsx)(`button`,{type:`button`,onClick:()=>{LD(O,void 0),we.stickToBottom(`auto`)},title:`Scroll to latest`,"aria-label":`Scroll to latest`,className:`absolute right-4 bottom-4 z-30 inline-flex h-9 w-9 items-center justify-center rounded-sm border border-[#38bdf8] bg-[#111111]/95 text-[#38bdf8] shadow-lg shadow-black/30 hover:bg-[#161616]`,children:(0,I.jsx)(sn,{size:18})})]})}function JD({errorCount:e,toolErrorCount:t,userMessageCount:n,onNavigate:r,sessionAgentProfile:i,sessionActiveModel:a,sessionRuntimeBinding:o,sessionBreadcrumbs:s,originSession:c,derivedSessions:l,onOpenSession:u}){return(0,I.jsxs)(`div`,{"data-pibo-debug":`compact-terminal-header`,className:`border-b border-[#2a2a2a] bg-[#111111] px-4 py-2 text-[11px]`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[i?(0,I.jsx)(hO,{tone:`neutral`,children:i}):null,o?(0,I.jsxs)(hO,{tone:o.state===`missing`||o.state===`error`?`red`:o.state===`unbound`?`amber`:`cyan`,label:`Runtime ${o.runtimeInstanceId} · ${o.state}`,children:[o.runtimeInstanceId,` · `,o.state]}):null,a?(0,I.jsx)(hO,{tone:`purple`,children:a}):null,n>0?(0,I.jsxs)(hO,{tone:`cyan`,label:`${n} user messages · jump to previous user message`,onClick:()=>r(`user`),children:[n,(0,I.jsx)(zn,{size:12})]}):null,e>0?(0,I.jsxs)(hO,{tone:`red`,label:`${e} errors · jump to previous error`,onClick:()=>r(`system`),children:[e,(0,I.jsx)(_n,{size:12})]}):null,t>0?(0,I.jsxs)(hO,{tone:`amber`,label:`${t} tool call errors · jump to previous tool error`,onClick:()=>r(`tool`),children:[t,(0,I.jsx)(kn,{size:12})]}):null,c?(0,I.jsxs)(YD,{onClick:()=>u(c.piboSessionId),children:[`Origin `,c.label]}):null,l.map(e=>(0,I.jsxs)(YD,{onClick:()=>u(e.piboSessionId),children:[`Derived `,e.label]},e.piboSessionId))]}),s.length?(0,I.jsx)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1 text-[#737373]`,children:s.map((e,t)=>(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[t>0?(0,I.jsx)(cn,{size:12,className:`text-[#525252]`}):null,(0,I.jsx)(`button`,{type:`button`,onClick:()=>u(e.piboSessionId),className:`hover:text-[#38bdf8]`,children:e.label})]},e.piboSessionId))}):null]})}function YD({children:e,onClick:t}){return(0,I.jsx)(`button`,{type:`button`,onClick:t,className:`border border-[#3a3a3a] px-2 py-0.5 text-[#38bdf8] hover:border-[#38bdf8]`,children:e})}function XD({row:e,expanded:t,focused:n,piboSessionId:r,onToggle:i,onFork:a,onOpenSession:o,onThinkingLevelChange:s,onModelChanged:c,signals:l}){let u=!t&&cO(e),d=u?sO(e):e.lines;return e.kind===`agent.delegation`?(0,I.jsx)(`div`,{className:nO(e,n),"data-pibo-component":`TerminalRow`,"data-pibo-debug":`terminal-row`,"data-pibo-terminal-row":`true`,"data-row-id":e.id,"data-row-kind":e.kind,"data-row-status":e.status,"data-trace-node-id":e.sourceNodeIds.join(` `),"data-event-id":e.eventId,"data-run-id":e.runId,"data-order-source":e.orderSource,"data-order-stream-id":e.orderStreamId,"data-order-frame-index":e.orderStreamFrameIndex,tabIndex:n?0:void 0,"aria-current":n?`true`:void 0,children:(0,I.jsx)(Zu,{title:e.title,summary:e.summary,input:e.input,output:e.output,error:e.error,traceStatus:e.status===`neutral`?`done`:e.status,linkedPiboSessionId:e.linkedPiboSessionId,startedAt:e.startedAt,completedAt:e.completedAt,durationMs:e.durationMs,signals:l,onOpenSession:o})}):(0,I.jsxs)(`div`,{className:nO(e,n),"data-pibo-component":`TerminalRow`,"data-pibo-debug":`terminal-row`,"data-pibo-terminal-row":`true`,"data-row-id":e.id,"data-row-kind":e.kind,"data-row-status":e.status,"data-trace-node-id":e.sourceNodeIds.join(` `),"data-event-id":e.eventId,"data-run-id":e.runId,"data-order-source":e.orderSource,"data-order-stream-id":e.orderStreamId,"data-order-frame-index":e.orderStreamFrameIndex,onDoubleClick:e.expandable?t=>{!e.expandable||lO(t)||i()}:void 0,onKeyDown:e.expandable?t=>{!e.expandable||lO(t)||(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),i())}:void 0,role:e.expandable?`button`:void 0,tabIndex:e.expandable||n?0:void 0,"aria-expanded":e.expandable?t:void 0,"aria-current":n?`true`:void 0,children:[(0,I.jsxs)(`div`,{className:`flex gap-3`,children:[(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,I.jsx)(ZD,{row:e,visibleLines:d,collapseToolCallPreview:u,piboSessionId:r,onThinkingLevelChange:s,onModelChanged:c})}),(0,I.jsx)(tO,{row:e,onFork:a,onOpenSession:o})]}),t?(0,I.jsx)(tC,{row:e,onOpenSession:o}):null]})}function ZD({row:e,visibleLines:t,collapseToolCallPreview:n,piboSessionId:r,onThinkingLevelChange:i,onModelChanged:a}){return e.kind===`message.assistant`?(0,I.jsxs)(`div`,{className:`ml-[1.9rem] min-w-0`,"data-pibo-component":`TerminalAssistantMessage`,children:[(0,I.jsx)(`div`,{className:`compact-terminal-markdown`,"data-pibo-component":`MarkdownRendererHost`,"data-pibo-markdown-kind":`assistant-message`,children:(0,I.jsx)(Kx,{streaming:e.status===`running`,children:typeof e.output==`string`?e.output:``})}),e.status===`running`?null:(0,I.jsx)($D,{timestamp:e.completedAt,durationMs:e.durationMs})]}):e.kind===`message.user`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(QD,{lines:t,status:e.status,clampPreview:n,singleLine:e.singleLine}),e.pendingMessageDelivery?(0,I.jsx)(id,{delivery:e.pendingMessageDelivery,className:`ml-[1.9rem] mt-2`}):null,(0,I.jsx)($D,{timestamp:e.startedAt})]}):e.kind===`tool.status`?(0,I.jsx)(AD,{row:e,piboSessionId:r}):e.kind===`tool.thinking`?(0,I.jsx)(PD,{row:e,onLevelSelect:i}):e.kind===`tool.login`?(0,I.jsx)(zC,{row:e,piboSessionId:r}):e.kind===`tool.model`?(0,I.jsx)(GC,{row:e,piboSessionId:r,onModelChanged:a}):e.kind===`execution.compaction`&&e.status===`running`?(0,I.jsx)(pO,{}):e.kind===`reasoning`&&e.markdown?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(QD,{lines:t,status:e.status,clampPreview:n,singleLine:e.singleLine}),(0,I.jsx)(`div`,{className:`ml-[1.9rem] min-w-0`,"data-pibo-component":`TerminalReasoningMarkdown`,children:(0,I.jsx)(`div`,{className:`compact-terminal-markdown compact-terminal-reasoning`,"data-pibo-component":`MarkdownRendererHost`,"data-pibo-markdown-kind":`reasoning`,children:(0,I.jsx)(Kx,{streaming:e.status===`running`,children:e.markdown})})})]}):(0,I.jsx)(QD,{lines:t,status:e.status,clampPreview:n,singleLine:e.singleLine})}function QD({lines:e,status:t,clampPreview:n,singleLine:r}){return e.map((e,i)=>(0,I.jsx)(xC,{line:e,status:t,clampLines:r?1:n&&i===0?5:void 0},i))}function $D({timestamp:e,durationMs:t}){let n=eO(e);return n?(0,I.jsxs)(`div`,{className:`mt-1 text-right font-mono text-[10px] tabular-nums text-[#737373]`,"data-pibo-component":`TerminalMessageMetadata`,children:[n,t===void 0?null:` · ${iE(t)}`]}):null}function eO(e){if(!e)return;let t=new Date(e);if(Number.isFinite(t.getTime()))return new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}).format(t)}function tO({row:e,onFork:t,onOpenSession:n}){return(0,I.jsxs)(`div`,{className:`flex shrink-0 items-start gap-1 transition-opacity ${e.forkEntryId?`opacity-100`:`opacity-0 group-hover:opacity-100 group-focus-within:opacity-100`}`,children:[e.linkedPiboSessionId?(0,I.jsx)(gO,{label:`Open linked session`,onClick:()=>n(e.linkedPiboSessionId),children:`Open`}):null,e.forkEntryId?(0,I.jsxs)(gO,{label:`Fork from this user message`,onClick:()=>t(e.forkEntryId),children:[(0,I.jsx)(On,{size:13}),`Fork`]}):null]})}function nO(e,t=!1){let n=e.kind===`message.user`?`group border-b border-[#141414] bg-[#11a4d4]/10 py-2 last:border-b-0 hover:bg-[#11a4d4]/15`:e.kind===`agent.delegation`?`group border-b border-[#141414] bg-[#f97316]/5 py-2 last:border-b-0`:e.kind===`execution.command`?`group border-b border-[#141414] bg-[#f59e0b]/5 py-2 last:border-b-0 hover:bg-[#f59e0b]/10`:`group border-b border-[#141414] py-2 last:border-b-0 hover:bg-[#161616]`,r=e.expandable||t?` focus:outline-none focus:ring-1 focus:ring-[#38bdf8]/50`:``;return t?`${n}${r} ring-1 ring-[#38bdf8] bg-[#123040]`:`${n}${r}`}function rO(e,t,n){let r=new Set;for(let i of t)e.has(i.id)&&r.add(i.id),n&&i.kind===`reasoning`&&i.expandable&&r.add(i.id);return vO(e,r)?e:r}function iO(e,t){return t===`user`?e.kind===`message.user`:e.status===`error`?t===`tool`?e.errorKind===`tool`:e.errorKind!==`tool`:!1}function aO(e,t,n){let r=e.map((e,t)=>({row:e,index:t})).filter(({row:e})=>iO(e,t));if(!r.length)return;let i=n?e.findIndex(e=>e.id===n):-1,a=i>=0?i:e.length;return{...r.filter(e=>e.index<a).at(-1)??r[r.length-1],fromIndex:a}}function oO(e){let t=0,n=()=>{let r=Array.from(document.querySelectorAll(`[data-pibo-component="TerminalRow"]`)).find(t=>t.dataset.rowId===e);if(r){r.scrollIntoView({block:`start`,inline:`nearest`,behavior:`smooth`}),r.focus({preventScroll:!0});return}t+=1,t<8&&requestAnimationFrame(n)};requestAnimationFrame(()=>requestAnimationFrame(n))}function sO(e){return e.kind===`tool.group.exploring`||e.kind===`tool.group.images`?e.lines.slice(0,KD):e.lines}function cO(e){return!!e.expandable&&(e.kind===`tool.call`||e.kind===`tool.image`||e.kind===`tool.group.exploring`||e.kind===`tool.group.images`||e.kind===`agent.delegation`||e.kind===`agent.async`||e.kind===`yielded.run`||e.kind===`execution.command`||e.kind===`execution.compaction`)}function lO(e){let t=e.target;if(!(t instanceof Element)||t===e.currentTarget)return!1;let n=t.closest(`button, a, input, textarea, select, summary, [role='button'], [tabindex]:not([tabindex='-1'])`);return!!(n&&n!==e.currentTarget)}var uO=`Working...`;function dO({startedAt:e,isWorking:t,goal:n}){let r=fO(t?e:void 0),i=US(n),a=[t?`Working`:void 0,i===`active`?`Pursuing Goal`:i===`paused`?`Goal Paused`:void 0].filter(Boolean).join(`. `);return(0,I.jsx)(`div`,{className:`border-t border-[#141414] px-4 py-2`,role:`status`,"aria-live":`polite`,"aria-label":a,"data-pibo-component":`TerminalStreamingFooter`,"data-pibo-active-turn-started-at":t?e:void 0,children:(0,I.jsxs)(`div`,{className:`flex min-w-0 items-baseline justify-between gap-4`,"aria-hidden":`true`,children:[t?(0,I.jsxs)(`div`,{className:`grid min-w-0 flex-1 grid-cols-[1.9rem_minmax(0,1fr)] gap-2 whitespace-pre-wrap break-words`,children:[(0,I.jsx)(`span`,{className:`whitespace-pre text-[#737373]`,children:`•`}),(0,I.jsxs)(`span`,{className:`inline-flex min-w-0 items-baseline gap-2`,children:[r?(0,I.jsx)(`span`,{className:`shrink-0 tabular-nums text-[#737373]`,children:r}):null,(0,I.jsx)(`span`,{className:`compact-terminal-working-label`,children:uO})]})]}):(0,I.jsx)(`span`,{className:`min-w-0 flex-1`}),(0,I.jsx)(VS,{goal:n})]})})}function fO(e){let t=e?new Date(e).getTime():NaN,[n,r]=(0,F.useState)(()=>Date.now());return(0,F.useEffect)(()=>{if(r(Date.now()),!Number.isFinite(t))return;let e=window.setInterval(()=>r(Date.now()),1e3);return()=>window.clearInterval(e)},[t]),Number.isFinite(t)?iE(Math.max(0,n-t)):void 0}function pO(){let e=mO();return(0,I.jsxs)(`div`,{className:`grid grid-cols-[1.9rem_minmax(0,1fr)] gap-2 whitespace-pre-wrap break-words`,children:[(0,I.jsx)(`span`,{className:`whitespace-pre text-[#38bdf8]`,children:`•`}),(0,I.jsxs)(`span`,{className:`min-w-0`,children:[(0,I.jsx)(`span`,{className:`font-semibold text-[#38bdf8]`,children:`Compacting`}),(0,I.jsx)(`span`,{className:`text-[#38bdf8]`,children:e})]})]})}function mO(){let[e,t]=(0,F.useState)(0);return(0,F.useEffect)(()=>{let e=window.setInterval(()=>t(e=>(e+1)%4),400);return()=>window.clearInterval(e)},[]),`.`.repeat(e)}function hO({tone:e,label:t,onClick:n,children:r}){let i=`inline-flex items-center gap-1 border px-2 py-0.5 ${e===`cyan`?`border-[#1f4960] text-[#38bdf8]`:e===`red`?`border-[#5f2222] text-[#ef4444]`:e===`amber`?`border-[#6b4e16] text-[#f59e0b]`:e===`purple`?`border-purple-500/40 text-purple-300`:`border-[#3a3a3a] text-[#d4d4d4]`}`;return n?(0,I.jsx)(`button`,{type:`button`,onClick:n,className:`${i} hover:bg-white/5 focus:outline-none focus:ring-1 focus:ring-[#38bdf8]`,title:t,"aria-label":t,children:r}):(0,I.jsx)(`span`,{className:i,title:t,"aria-label":t,children:r})}function gO({label:e,onClick:t,children:n}){return(0,I.jsx)(`button`,{type:`button`,onClick:t,"aria-label":e,title:e,className:`inline-flex min-h-7 min-w-7 items-center gap-1 border border-[#3a3a3a] px-2 text-[11px] text-[#737373] hover:border-[#38bdf8] hover:text-[#38bdf8]`,children:n})}function _O({isLoading:e,agentProfiles:t,disabled:n,onSelectAgentProfile:r,message:i}){return(0,I.jsxs)(`div`,{className:`flex min-h-full flex-col items-center justify-center gap-4 px-6 py-10 text-center text-[12px] text-[#737373]`,children:[(0,I.jsx)(`div`,{children:e?`Loading trace…`:i??`No trace selected.`}),t.length?(0,I.jsx)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:t.map(e=>(0,I.jsx)(`button`,{type:`button`,disabled:n,onClick:()=>r(e.name),className:`border border-[#3a3a3a] px-2 py-1 text-[#d4d4d4] hover:border-[#38bdf8] hover:text-[#38bdf8] disabled:opacity-50`,children:e.name},e.name))}):null]})}function vO(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function yO(e,t){return t?t===`away`:e instanceof WheelEvent?e.deltaY<0:e instanceof KeyboardEvent?[`ArrowUp`,`PageUp`,`Home`].includes(e.key):e?.type===`touchmove`}function bO({traceView:e,isLoading:t,selectedSessionStatus:n,selectedSessionSignal:r,workflowProjectSession:i,workflowLifecycleEvents:a,sessionNodes:o,onOpenSession:s,onRefreshBootstrap:c,onError:l}){let u=i?BO(i,e,n,r,a??[],o):null;return u?(0,I.jsx)(`section`,{className:`min-w-0 flex-1 overflow-auto bg-[#0b0f14] p-4 text-slate-300`,children:(0,I.jsxs)(`div`,{className:`mx-auto flex max-w-6xl flex-col gap-4`,children:[(0,I.jsx)(xO,{model:u}),(0,I.jsx)(SO,{}),(0,I.jsx)(CO,{model:u,onRefreshBootstrap:c,onError:l}),(0,I.jsx)(TO,{model:u}),(0,I.jsx)(EO,{model:u,onOpenSession:s}),(0,I.jsx)(NO,{nodes:u.nodes,edges:u.edges}),(0,I.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[minmax(0,1fr)_360px]`,children:[(0,I.jsx)(FO,{model:u}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,I.jsx)(IO,{model:u}),(0,I.jsx)(LO,{model:u}),(0,I.jsx)(RO,{model:u})]})]})]})}):(0,I.jsx)(`section`,{className:`min-w-0 flex-1 overflow-auto bg-[#0b0f14] p-4 text-slate-300`,children:(0,I.jsxs)(`div`,{className:`mx-auto flex max-w-4xl flex-col gap-4`,children:[(0,I.jsxs)(`div`,{className:`rounded-sm border border-slate-800 bg-[#111820] p-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-slate-100`,children:[(0,I.jsx)(Nn,{size:16,className:`text-[#11a4d4]`}),`Workflow / XState`]}),(0,I.jsx)(`p`,{className:`mt-2 text-sm text-slate-400`,children:t?`Loading session trace…`:`This session is not linked to a workflow run, so no Workflow/XState projection is available.`})]}),(0,I.jsx)(SO,{})]})})}function xO({model:e}){return(0,I.jsxs)(`div`,{className:`rounded-sm border border-slate-800 bg-[#111820] p-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-slate-100`,children:[(0,I.jsx)(Nn,{size:16,className:`text-[#11a4d4]`}),`Workflow / XState Projection`]}),(0,I.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs`,children:[(0,I.jsx)(Sk,{tone:`blue`,children:e.workflowId}),e.workflowRunId?(0,I.jsxs)(Sk,{tone:`slate`,children:[`run `,Dk(e.workflowRunId)]}):null,(0,I.jsx)(Sk,{tone:Ck(e.status),children:e.state})]})]}),(0,I.jsxs)(`div`,{className:`min-w-0 text-right font-mono text-[11px] text-slate-500`,children:[(0,I.jsxs)(`div`,{className:`truncate`,children:[`session `,Dk(e.piboSessionId)]}),e.latestStreamId===void 0?null:(0,I.jsxs)(`div`,{children:[`stream `,e.latestStreamId]})]})]}),(0,I.jsx)(`p`,{className:`mt-3 text-sm text-slate-400`,children:`Dedicated Project workflow execution surface. This view derives the current XState-style UI snapshot from project-session workflow linkage and live session state while keeping kernel records as durable truth.`})]})}function SO(){return(0,I.jsx)(`div`,{className:`rounded-sm border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-bold uppercase tracking-wider text-amber-200`,children:[(0,I.jsx)(Qn,{size:14}),`Workflow IR source-of-truth boundary`]}),(0,I.jsx)(`p`,{className:`mt-2 max-w-3xl text-xs leading-5 text-amber-100/80`,children:`Projects inspect configured sessions, workflow runs, and the XState-style projection derived from Pibo Workflow IR. Authoring stays in the Workflows tab; raw XState editing and inline executable code are not exposed here.`})]}),(0,I.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[(0,I.jsx)(`span`,{className:`rounded border border-amber-500/40 bg-[#0b0f14]/50 px-2 py-1 text-[10px] uppercase tracking-wide text-amber-100/80`,children:`IR: source of truth`}),(0,I.jsx)(`span`,{className:`rounded border border-amber-500/40 bg-[#0b0f14]/50 px-2 py-1 text-[10px] uppercase tracking-wide text-amber-100/80`,children:`XState: projection only`})]})]})})}function CO({model:e,onRefreshBootstrap:t,onError:n}){let r=e.workflowRunId?MO(e):void 0,i=`${e.workflowId}${e.workflowVersion?`@${e.workflowVersion}`:``}`;return(0,I.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-3`,"aria-label":`Projects workflow execution shell`,children:[(0,I.jsx)(AO,{title:`Workflow configured-session view`,icon:(0,I.jsx)(Fn,{size:14}),children:(0,I.jsxs)(`div`,{className:`space-y-3 text-xs text-slate-400`,children:[(0,I.jsx)(jO,{label:`selected workflow`,value:i}),(0,I.jsx)(jO,{label:`session state`,value:e.workflowRunId?`started`:`configured/not-started`}),(0,I.jsx)(jO,{label:`input keys`,value:String(e.configuration.inputKeys.length)}),(0,I.jsx)(jO,{label:`prompt overrides`,value:String(e.configuration.promptOverrideNodeIds.length)}),(0,I.jsx)(`p`,{className:`leading-5 text-slate-500`,children:`Saved configuration is reviewed here before Start. Workflow selection and session overrides remain immutable for this configured Project session.`})]})}),(0,I.jsx)(AO,{title:`Workflow run view`,icon:(0,I.jsx)(Xt,{size:14}),children:(0,I.jsxs)(`div`,{className:`space-y-3 text-xs text-slate-400`,children:[(0,I.jsx)(jO,{label:`run id`,value:e.workflowRunId?Dk(e.workflowRunId):`not started`}),(0,I.jsx)(jO,{label:`status`,value:e.state}),(0,I.jsx)(jO,{label:`current node`,value:r?.label??`none`}),(0,I.jsx)(jO,{label:`output`,value:e.finalOutput?`available`:`empty`}),(0,I.jsx)(jO,{label:`error`,value:e.runtimeErrors.length?`${e.runtimeErrors.length} runtime errors`:e.validationErrors.length?`${e.validationErrors.length} validation diagnostics`:`none`}),(0,I.jsx)(`p`,{className:`leading-5 text-slate-500`,children:`This workflow run view container is the stable Project home for status, current node, output, and error sections.`})]})}),(0,I.jsx)(AO,{title:`Human action area`,icon:(0,I.jsx)(yn,{size:14}),children:(0,I.jsx)(wO,{model:e,onRefreshBootstrap:t,onError:n})})]})}function wO({model:e,onRefreshBootstrap:t,onError:n}){let[r,i]=(0,F.useState)({}),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)({}),[l,u]=(0,F.useState)({}),d=(e,t)=>{i(n=>({...n,[e]:t}))},f=async(i,a)=>{if(!i.waitTokenId||!a.registered)return;let s=`${i.waitTokenId}:${a.id}`,l=a.kind??`resume`,d;if(l===`resume`){let e=r[i.waitTokenId]??(i.payloadRequirements?.required?`{}`:``);if(e.trim())try{d=JSON.parse(e)}catch{let e=[{code:`WorkflowRuntimeError.invalidHumanActionPayload`,message:`Resume payload must be valid JSON before it can be submitted.`,severity:`error`,path:`$.payload`,hint:`Enter JSON such as {"comment":"Approved"}.`}];c(t=>({...t,[i.waitTokenId]:e})),n?.(`Resume payload must be valid JSON.`);return}}o(s),c(e=>({...e,[i.waitTokenId]:[]}));try{await NC(e.projectId,e.piboSessionId,{waitTokenId:i.waitTokenId,actionId:a.id,...a.kind?{kind:a.kind}:{},...d===void 0?{}:{payload:d}}),u(e=>({...e,[i.waitTokenId]:`${a.displayName} submitted.`})),n?.(null),await t?.()}catch(e){let t=uk(e);c(e=>({...e,[i.waitTokenId]:t})),n?.(t[0]?.message??dk(e))}finally{o(null)}};return(0,I.jsxs)(`div`,{className:`space-y-3 text-xs text-slate-400`,children:[e.pendingHumanActions.length?(0,I.jsx)(`div`,{className:`space-y-3`,children:e.pendingHumanActions.map(e=>{let t=[...e.diagnostics,...e.waitTokenId?s[e.waitTokenId]??[]:[]];return(0,I.jsxs)(`div`,{className:`rounded-sm border border-amber-500/40 bg-amber-500/10 p-3 text-amber-100`,"aria-label":`Pending workflow human action wait token`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`font-semibold`,children:e.label}),(0,I.jsx)(`div`,{className:`mt-1 break-words text-[11px] leading-5 text-amber-100/80`,children:e.prompt})]}),(0,I.jsx)(`span`,{className:`shrink-0 rounded border border-amber-400/40 bg-[#0b0f14]/40 px-1.5 py-0.5 font-mono text-[10px] text-amber-100/70`,children:e.waitTokenId?Dk(e.waitTokenId):e.source})]}),(0,I.jsxs)(`div`,{className:`mt-2 grid gap-2 text-[11px] text-amber-100/75`,children:[(0,I.jsx)(jO,{label:`human node`,value:e.humanNodeId??`unspecified`}),(0,I.jsx)(jO,{label:`payload`,value:e.payloadRequirements?.description??`No persisted payload schema.`}),e.expiresAt?(0,I.jsx)(jO,{label:`expires`,value:e.expiresAt}):null]}),e.payloadRequirements?.schema?(0,I.jsxs)(`div`,{className:`mt-2 rounded-sm border border-amber-400/25 bg-[#0b0f14]/50 p-2`,children:[(0,I.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-wider text-amber-100/70`,children:`Resume payload schema`}),(0,I.jsx)(Yu,{value:e.payloadRequirements.schema,defaultExpandLevel:1,maxHeight:`10rem`,showControls:!1})]}):null,e.availableActions.some(e=>e.kind===`resume`)?(0,I.jsxs)(`label`,{className:`mt-3 block text-[11px] text-amber-100/80`,children:[(0,I.jsx)(`span`,{className:`mb-1 block font-semibold`,children:`Resume payload JSON`}),(0,I.jsx)(`textarea`,{className:`min-h-20 w-full rounded-sm border border-amber-500/30 bg-[#0b0f14] px-2 py-1.5 font-mono text-[11px] text-amber-50 outline-none focus:border-[#11a4d4]`,value:r[e.waitTokenId??e.id]??(e.payloadRequirements?.required?`{}`:``),onChange:t=>d(e.waitTokenId??e.id,t.target.value),placeholder:`{"comment":"Approved"}`})]}):null,(0,I.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,"aria-label":`Workflow wait token actions`,children:e.availableActions.length?e.availableActions.map(t=>{let n=`${e.waitTokenId}:${t.id}`;return(0,I.jsx)(`button`,{type:`button`,disabled:!e.waitTokenId||!t.registered||a!==null,onClick:()=>void f(e,t),className:`rounded-sm border border-amber-400/40 bg-[#0b0f14]/70 px-2.5 py-1 text-[11px] font-semibold text-amber-100 transition hover:border-[#11a4d4] hover:text-[#8bdcf4] disabled:cursor-not-allowed disabled:opacity-50`,title:t.description??t.id,children:a===n?`Submitting…`:t.displayName},t.id)}):(0,I.jsx)(`span`,{className:`text-amber-100/60`,children:`No registered human actions are available for this wait token.`})}),e.waitTokenId&&l[e.waitTokenId]?(0,I.jsx)(`div`,{className:`mt-2 text-[11px] text-emerald-200`,children:l[e.waitTokenId]}):null,t.length?(0,I.jsx)(`div`,{className:`mt-2 space-y-1`,"aria-label":`Human action diagnostics`,children:t.map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded border border-red-400/35 bg-red-500/15 p-2 text-[11px] leading-5 text-red-100`,children:[(0,I.jsx)(`div`,{children:e.message}),(0,I.jsxs)(`div`,{className:`mt-1 font-mono text-[10px] text-red-100/70`,children:[e.code,e.path?` · ${e.path}`:``]})]},`${e.code}:${t}`))}):null]},e.id)})}):(0,I.jsx)(`div`,{className:`rounded-sm border border-slate-800 bg-[#0b0f14] p-3 text-slate-500`,children:`No pending human action. Approval, rejection, resume, and cancel controls render here when a persisted workflow wait token exists.`}),(0,I.jsx)(`p`,{className:`leading-5 text-slate-500`,children:`This human action area lives inside the workflow run context, validates wait-token state and resume payloads, and stays separate from normal Terminal chat controls.`})]})}function TO({model:e}){let t=e.workflowRunId?MO(e):void 0,n=[...e.runtimeErrors.map(e=>({...e,source:e.source??`runtime`})),...e.validationErrors.map(e=>({...e,source:e.source??`validation`}))].slice(0,8);return(0,I.jsxs)(`section`,{className:`rounded-sm border border-slate-800 bg-[#111820] p-4 text-sm`,"aria-label":`Workflow run inspection panel`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-bold uppercase tracking-wider text-slate-500`,children:[(0,I.jsx)(Sn,{size:14}),`Workflow run inspection`]}),(0,I.jsx)(`p`,{className:`mt-2 max-w-3xl text-xs leading-5 text-slate-500`,children:`Status, current node, history, attempts, transfers, output, and errors are rendered from Project session and workflow run facts when a run is linked. The XState graph remains a visualization projection only.`})]}),(0,I.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2 text-[10px] uppercase tracking-wide`,children:[(0,I.jsx)(`span`,{className:`rounded border border-emerald-500/40 bg-emerald-500/10 px-2 py-1 text-emerald-200`,children:`kernel/run records: truth`}),(0,I.jsx)(`span`,{className:`rounded border border-amber-500/40 bg-amber-500/10 px-2 py-1 text-amber-100`,children:`XState projection only`})]})]}),(0,I.jsxs)(`div`,{className:`mt-4 grid gap-3 lg:grid-cols-3`,children:[(0,I.jsxs)(DO,{title:`Status`,badge:e.state,icon:(0,I.jsx)(Xt,{size:14}),children:[(0,I.jsx)(OO,{label:`run id`,value:e.workflowRunId?Dk(e.workflowRunId):`not started`}),(0,I.jsx)(OO,{label:`status`,value:e.state}),(0,I.jsx)(OO,{label:`record source`,value:e.workflowRunId?`Project workflow run id`:`no run record yet`})]}),(0,I.jsxs)(DO,{title:`Current node`,badge:t?.status??`none`,icon:(0,I.jsx)(Wn,{size:14}),children:[(0,I.jsx)(OO,{label:`node`,value:t?.label??`none`}),(0,I.jsx)(OO,{label:`node id`,value:t?.id??`none`}),(0,I.jsx)(OO,{label:`source`,value:`project/session run cursor`})]}),(0,I.jsx)(DO,{title:`Run history`,badge:`${e.runHistory.length}`,icon:(0,I.jsx)(jn,{size:14}),children:e.runHistory.length?(0,I.jsx)(`div`,{className:`space-y-2`,children:e.runHistory.map(e=>(0,I.jsxs)(`div`,{className:`rounded-sm border border-slate-800 bg-[#0b0f14] p-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsx)(`div`,{className:`min-w-0 truncate font-mono text-xs text-slate-200`,children:Dk(e.id)}),(0,I.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 text-[10px] uppercase tracking-wide ${Ek(e.status)}`,children:e.status})]}),(0,I.jsxs)(`div`,{className:`mt-1 text-[11px] text-slate-500`,children:[e.currentNodeId?`current ${e.currentNodeId}`:`no current node`,` · `,e.source]}),(0,I.jsxs)(`div`,{className:`mt-1 font-mono text-[10px] text-slate-600`,children:[`updated `,e.updatedAt]})]},e.id))}):(0,I.jsx)(kO,{children:e.workflowRunId?`No workflow run history for this selected Project session yet.`:`No current run attempts; this configured Project session has not been started.`})})]}),(0,I.jsxs)(`div`,{className:`mt-3 grid gap-3 lg:grid-cols-2`,children:[(0,I.jsx)(DO,{title:`Node attempts`,badge:`${e.nodeAttempts.length}`,icon:(0,I.jsx)(Fn,{size:14}),children:e.nodeAttempts.length?(0,I.jsx)(`div`,{className:`space-y-2`,children:e.nodeAttempts.map(e=>(0,I.jsxs)(`div`,{className:`rounded-sm border border-slate-800 bg-[#0b0f14] p-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`truncate text-xs font-semibold text-slate-200`,children:e.label}),(0,I.jsxs)(`div`,{className:`mt-1 font-mono text-[10px] text-slate-500`,children:[e.nodeId,` · attempt `,e.attempt]})]}),(0,I.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 text-[10px] uppercase tracking-wide ${Ek(e.status)}`,children:e.status})]}),(0,I.jsxs)(`div`,{className:`mt-1 text-[11px] text-slate-500`,children:[e.kind,` · `,e.source]})]},e.id))}):(0,I.jsx)(kO,{children:e.workflowRunId?`No node attempts recorded for this workflow run yet.`:`No current node attempts; Start has not created a workflow run.`})}),(0,I.jsx)(DO,{title:`Edge transfers`,badge:`${e.edgeTransfers.length}`,icon:(0,I.jsx)(On,{size:14}),children:e.edgeTransfers.length?(0,I.jsx)(`div`,{className:`space-y-2`,children:e.edgeTransfers.map(e=>(0,I.jsxs)(`div`,{className:`rounded-sm border border-slate-800 bg-[#0b0f14] p-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsx)(`div`,{className:`min-w-0 truncate font-mono text-xs text-slate-200`,children:e.edgeId}),(0,I.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 text-[10px] uppercase tracking-wide ${Ek(e.status)}`,children:e.status})]}),(0,I.jsxs)(`div`,{className:`mt-1 text-[11px] text-slate-500`,children:[e.source,e.createdAt?` · ${e.createdAt}`:``]})]},e.id))}):(0,I.jsx)(kO,{children:`No edge transfers recorded for this workflow run yet.`})}),(0,I.jsx)(DO,{title:`Output`,badge:e.finalOutput?`available`:`empty`,icon:(0,I.jsx)(mn,{size:14}),children:e.finalOutput?(0,I.jsxs)(`div`,{className:`rounded-sm border border-slate-800 bg-[#0b0f14] p-2`,children:[(0,I.jsx)(`div`,{className:`mb-2 font-mono text-[10px] text-slate-500`,children:e.finalOutput.source}),(0,I.jsx)(Yu,{value:e.finalOutput.value,defaultExpandLevel:1,maxHeight:`12rem`,showControls:!1})]}):(0,I.jsx)(kO,{children:`No workflow output has been recorded for this run yet.`})}),(0,I.jsx)(DO,{title:`Error`,badge:n.length?`${n.length}`:`none`,icon:(0,I.jsx)(Qn,{size:14}),children:n.length?(0,I.jsx)(`div`,{className:`space-y-2`,children:n.map(e=>(0,I.jsxs)(`div`,{className:`rounded-sm border border-red-500/35 bg-red-500/10 p-2 text-xs text-red-100`,children:[(0,I.jsx)(`div`,{className:`break-words`,children:e.message}),(0,I.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1 font-mono text-[10px] text-red-200/70`,children:[e.code?(0,I.jsx)(`span`,{children:e.code}):null,e.source?(0,I.jsx)(`span`,{children:e.source}):null]})]},e.id))}):(0,I.jsx)(kO,{children:`No workflow run errors are recorded.`})})]})]})}function EO({model:e,onOpenSession:t}){let n=WO(e.definitionLink);return(0,I.jsxs)(`section`,{className:`rounded-sm border border-slate-800 bg-[#111820] p-4 text-sm`,"aria-label":`Workflow navigation links`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-bold uppercase tracking-wider text-slate-500`,children:[(0,I.jsx)(Cn,{size:14}),`Workflow navigation links`]}),(0,I.jsx)(`p`,{className:`mt-2 max-w-3xl text-xs leading-5 text-slate-500`,children:`Use these run-view links to move between real nested workflow sessions and the Workflows tab definition. Snapshot-only history is shown when the live definition is deleted or unavailable.`})]}),e.definitionLink.status===`live`&&n?(0,I.jsxs)(`a`,{className:`inline-flex shrink-0 items-center justify-center gap-1 rounded-sm border border-[#11a4d4]/50 px-3 py-1.5 text-xs font-semibold text-[#8bdcf4] transition hover:border-[#11a4d4] hover:text-slate-100`,href:n,children:[(0,I.jsx)(Cn,{size:13}),`Open live workflow definition`]}):null]}),(0,I.jsxs)(`div`,{className:`mt-4 grid gap-3 lg:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`rounded-sm border border-slate-800 bg-[#0f171e] p-3`,"aria-label":`Nested workflow child session links`,children:[(0,I.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-2`,children:[(0,I.jsx)(`div`,{className:`text-xs font-bold uppercase tracking-wider text-slate-500`,children:`Nested workflow child sessions`}),(0,I.jsx)(`span`,{className:`rounded border border-slate-700 bg-[#0b0f14] px-1.5 py-0.5 font-mono text-[10px] text-slate-400`,children:e.nestedSessionLinks.length})]}),e.nestedSessionLinks.length?(0,I.jsx)(`div`,{className:`space-y-2`,children:e.nestedSessionLinks.map(e=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>t(e.piboSessionId),className:`w-full rounded-sm border border-slate-800 bg-[#0b0f14] p-2 text-left transition hover:border-[#11a4d4]/60 hover:bg-[#102331]`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`truncate text-xs font-semibold text-slate-200`,children:e.title}),(0,I.jsx)(`div`,{className:`mt-1 font-mono text-[10px] text-slate-500`,children:Dk(e.piboSessionId)})]}),(0,I.jsx)(`span`,{className:`rounded border border-[#11a4d4]/40 bg-[#11a4d4]/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-[#8bdcf4]`,children:`open session`})]})},e.piboSessionId))}):(0,I.jsx)(kO,{children:`No nested workflow child sessions are linked under this selected Project session yet.`})]}),(0,I.jsxs)(`div`,{className:`rounded-sm border border-slate-800 bg-[#0f171e] p-3`,"aria-label":`Workflow definition link state`,children:[(0,I.jsx)(`div`,{className:`mb-3 text-xs font-bold uppercase tracking-wider text-slate-500`,children:`Workflow definition link`}),e.definitionLink.status===`live`&&n?(0,I.jsxs)(`div`,{className:`rounded-sm border border-emerald-500/35 bg-emerald-500/10 p-3 text-xs leading-5 text-emerald-100`,children:[(0,I.jsx)(`div`,{className:`font-semibold`,children:`Live workflow definition exists`}),(0,I.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-emerald-100/80`,children:KO(e.definitionLink)}),e.definitionLink.definitionHash?(0,I.jsxs)(`div`,{className:`mt-1 font-mono text-[10px] text-emerald-100/60`,children:[`snapshot `,Dk(e.definitionLink.definitionHash)]}):null]}):(0,I.jsxs)(`div`,{className:`rounded-sm border border-amber-500/40 bg-amber-500/10 p-3 text-xs leading-5 text-amber-100`,children:[(0,I.jsx)(`div`,{className:`font-semibold`,children:`Definition deleted — snapshot-only definition-deleted state`}),(0,I.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-amber-100/80`,children:KO(e.definitionLink)}),(0,I.jsx)(`div`,{className:`mt-1 text-amber-100/80`,children:e.definitionLink.tombstoneLabel??`Historical run inspection uses the immutable Project session snapshot instead of a broken live definition link.`}),e.definitionLink.definitionHash?(0,I.jsxs)(`div`,{className:`mt-1 font-mono text-[10px] text-amber-100/60`,children:[`snapshot `,Dk(e.definitionLink.definitionHash)]}):null]})]})]})]})}function DO({title:e,badge:t,icon:n,children:r}){return(0,I.jsxs)(`section`,{className:`min-w-0 rounded-sm border border-slate-800 bg-[#0f171e] p-3`,"aria-label":e,children:[(0,I.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs font-bold uppercase tracking-wider text-slate-500`,children:[(0,I.jsx)(`span`,{className:`text-[#11a4d4]`,children:n}),e]}),(0,I.jsx)(`span`,{className:`shrink-0 rounded border border-slate-700 bg-[#0b0f14] px-1.5 py-0.5 font-mono text-[10px] text-slate-400`,children:t})]}),r]})}function OO({label:e,value:t}){return(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-slate-800/70 py-2 first:pt-0 last:border-b-0 last:pb-0`,children:[(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-slate-500`,children:e}),(0,I.jsx)(`span`,{className:`min-w-0 max-w-[14rem] truncate text-right font-mono text-xs text-slate-300`,title:t,children:t})]})}function kO({children:e}){return(0,I.jsx)(`div`,{className:`rounded-sm border border-dashed border-slate-800 bg-[#0b0f14] p-3 text-xs leading-5 text-slate-500`,children:e})}function AO({title:e,icon:t,children:n}){return(0,I.jsxs)(`section`,{className:`rounded-sm border border-slate-800 bg-[#111820] p-4`,"aria-label":e,children:[(0,I.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-bold uppercase tracking-wider text-slate-500`,children:[(0,I.jsx)(`span`,{className:`text-[#11a4d4]`,children:t}),e]}),n]})}function jO({label:e,value:t}){return(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-slate-800/70 pb-2 last:border-b-0 last:pb-0`,children:[(0,I.jsx)(`span`,{className:`uppercase tracking-wide text-slate-500`,children:e}),(0,I.jsx)(`span`,{className:`min-w-0 max-w-[12rem] truncate text-right font-mono text-slate-300`,title:t,children:t})]})}function MO(e){return e.nodes.find(e=>e.status===`active`||e.status===`waiting`)??e.nodes[0]}function NO({nodes:e,edges:t}){return(0,I.jsxs)(`div`,{className:`rounded-sm border border-slate-800 bg-[#0f171e] p-4`,children:[(0,I.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-bold uppercase tracking-wider text-slate-500`,children:[(0,I.jsx)(Wn,{size:14}),`Visual State Flow`]}),(0,I.jsx)(`div`,{className:`grid gap-3 md:grid-cols-[1fr_auto_1fr_auto_1fr]`,children:e.map((e,n)=>(0,I.jsx)(PO,{node:e,edge:t[n]},e.id))})]})}function PO({node:e,edge:t}){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`rounded-sm border p-3 ${wk(e.status)}`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(xk,{status:e.status}),(0,I.jsx)(`div`,{className:`min-w-0 truncate text-sm font-semibold text-slate-100`,children:e.label})]}),(0,I.jsx)(`span`,{className:`rounded border border-slate-700 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-slate-400`,children:e.kind})]}),(0,I.jsx)(`p`,{className:`mt-2 text-xs text-slate-400`,children:e.description})]}),t?(0,I.jsx)(`div`,{className:`hidden items-center justify-center text-center text-[10px] uppercase tracking-wide text-slate-500 md:flex`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(On,{size:14,className:`mx-auto mb-1 text-[#11a4d4]`}),t.label]})}):null]})}function FO({model:e}){return(0,I.jsxs)(`div`,{className:`rounded-sm border border-slate-800 bg-[#111820] p-4`,children:[(0,I.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-bold uppercase tracking-wider text-slate-500`,children:[(0,I.jsx)(Xt,{size:14}),`Current UI Snapshot`]}),(0,I.jsx)(Yu,{value:e.snapshot,showControls:!1})]})}function IO({model:e}){return(0,I.jsxs)(`div`,{className:`rounded-sm border border-slate-800 bg-[#111820] p-4 text-sm`,children:[(0,I.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-bold uppercase tracking-wider text-slate-500`,children:[(0,I.jsx)(Fn,{size:14}),`Node Statuses`]}),(0,I.jsxs)(`span`,{className:`font-mono text-[11px] text-slate-500`,children:[e.nodes.length,` nodes`]})]}),(0,I.jsx)(`div`,{className:`space-y-2`,children:e.nodes.map(e=>(0,I.jsxs)(`div`,{className:`rounded-sm border px-3 py-2 ${wk(e.status)}`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,I.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:(0,I.jsx)(xk,{status:e.status})}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`truncate text-sm font-semibold text-slate-100`,children:e.label}),(0,I.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[11px] text-slate-500`,children:e.id})]})]}),(0,I.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:[(0,I.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 text-[10px] uppercase tracking-wide ${Tk(e.status)}`,children:e.status}),(0,I.jsx)(`span`,{className:`rounded border border-slate-700 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-slate-400`,children:e.kind})]})]}),(0,I.jsx)(`p`,{className:`mt-2 text-xs text-slate-400`,children:e.description})]},e.id))}),(0,I.jsx)(`p`,{className:`mt-3 text-xs text-slate-500`,children:`Node status is reconstructed from the workflow run linkage and live session state; persisted kernel records remain the durable source of truth.`})]})}function LO({model:e}){return(0,I.jsxs)(`div`,{className:`rounded-sm border border-slate-800 bg-[#111820] p-4 text-sm`,children:[(0,I.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-bold uppercase tracking-wider text-slate-500`,children:[(0,I.jsx)(mn,{size:14}),`Final Output & Validation`]}),(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,I.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wide text-slate-400`,children:`Final output`}),e.finalOutput?(0,I.jsx)(`span`,{className:`rounded border border-slate-700 px-1.5 py-0.5 font-mono text-[10px] text-slate-500`,children:e.finalOutput.source}):null]}),e.finalOutput?(0,I.jsx)(`div`,{className:`rounded-sm border border-slate-800 bg-[#0b0f14] p-2`,children:(0,I.jsx)(Yu,{value:e.finalOutput.value,defaultExpandLevel:1,maxHeight:`14rem`,showControls:!1})}):(0,I.jsx)(`div`,{className:`rounded-sm border border-slate-800 bg-[#0b0f14] p-3 text-xs text-slate-500`,children:`No final workflow output is available yet. Completed workflow-backed sessions show the final assistant output here.`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,I.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wide text-slate-400`,children:`Validation errors`}),(0,I.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 font-mono text-[10px] ${e.validationErrors.length?`border-red-500/40 bg-red-500/10 text-red-300`:`border-emerald-500/40 bg-emerald-500/10 text-emerald-300`}`,children:e.validationErrors.length?`${e.validationErrors.length} found`:`none`})]}),e.validationErrors.length?(0,I.jsx)(`div`,{className:`space-y-2`,children:e.validationErrors.map(e=>(0,I.jsx)(`div`,{className:`rounded-sm border border-red-500/35 bg-red-500/10 p-2`,children:(0,I.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 text-xs text-red-200`,children:[(0,I.jsx)(Qn,{size:14,className:`mt-0.5 shrink-0 text-red-300`}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`break-words`,children:e.message}),(0,I.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1 font-mono text-[10px] text-red-200/70`,children:[e.code?(0,I.jsx)(`span`,{children:e.code}):null,e.path?(0,I.jsx)(`span`,{children:e.path}):null,e.source?(0,I.jsx)(`span`,{children:e.source}):null]})]})]})},e.id))}):(0,I.jsx)(`div`,{className:`rounded-sm border border-slate-800 bg-[#0b0f14] p-3 text-xs text-slate-500`,children:`No workflow validation diagnostics were found in the current session trace.`})]})]})]})}function RO({model:e}){return(0,I.jsxs)(`div`,{className:`rounded-sm border border-slate-800 bg-[#111820] p-4 text-sm`,children:[(0,I.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-bold uppercase tracking-wider text-slate-500`,children:[(0,I.jsx)(vn,{size:14}),`Projection Facts`]}),(0,I.jsxs)(`dl`,{className:`space-y-3`,children:[(0,I.jsx)(zO,{label:`projection kind`,value:`pibo.workflow.xstateUiModel`}),(0,I.jsx)(zO,{label:`schema`,value:`v1`}),(0,I.jsx)(zO,{label:`durable truth`,value:`kernel`}),(0,I.jsx)(zO,{label:`private payloads`,value:`not exposed`}),(0,I.jsx)(zO,{label:`states`,value:String(e.nodes.length)}),(0,I.jsx)(zO,{label:`transitions`,value:String(e.edges.length)}),(0,I.jsx)(zO,{label:`trace`,value:e.traceVersion??`pending`})]})]})}function zO({label:e,value:t}){return(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-slate-800/70 pb-2 last:border-b-0 last:pb-0`,children:[(0,I.jsx)(`dt`,{className:`text-xs uppercase tracking-wide text-slate-500`,children:e}),(0,I.jsx)(`dd`,{className:`min-w-0 truncate text-right font-mono text-xs text-slate-300`,children:t})]})}function BO(e,t,n,r,i,a){if(!mk(e))return null;let o=hk(e,n),s=gk(e,n),c=_k(s),l=nk(t,s),u=[...ik(t),...rk(e,i)],d=YO(e,o,c),f=XO(t,e.workflowRunId),p=$O(t,e.workflowRunId),m=ek(t,r),h=VO(e),g=HO(a,e.piboSessionId),_=[{id:`workflow.entry`,label:`workflow entry`,kind:`initial`,status:s===`idle`?`active`:`completed`,description:`Project session is linked to a workflow-capable route.`},{id:`node.session`,label:t?.title??`pibo session actor`,kind:`agent`,status:c===`node.session`?s:s===`completed`?`completed`:`idle`,description:`Normal Pibo routed session used as the visible workflow actor.`},{id:vk(s),label:yk(s),kind:`terminal`,status:c.startsWith(`workflow.`)?s:`idle`,description:`Terminal state projected from the current workflow/session state.`}];return{projectId:e.projectId,workflowId:e.workflowId,...e.workflowVersion?{workflowVersion:e.workflowVersion}:{},...e.workflowRunId?{workflowRunId:e.workflowRunId}:{},piboSessionId:e.piboSessionId,state:o,status:s,traceTitle:t?.title,traceVersion:t?.version,latestStreamId:t?.latestStreamId,nodes:_,edges:[{id:`workflow.transition.entry.session`,source:`workflow.entry`,target:`node.session`,label:`WORKFLOW.START`},{id:`workflow.transition.session.terminal`,source:`node.session`,target:vk(s),label:bk(s)}],configuration:qO(e),definitionLink:h,nestedSessionLinks:g,pendingHumanActions:JO(e,r),runHistory:d,nodeAttempts:f,edgeTransfers:p,runtimeErrors:m,...l?{finalOutput:l}:{},validationErrors:u,snapshot:{kind:`pibo.workflow.xstateUiModel`,schemaVersion:1,projection:{workflowId:e.workflowId,initialStateId:`workflow.entry`,durableTruth:`kernel`,exposesPrivatePayloads:!1},authoring:{location:`workflows_tab`,rawXStateEditingUi:`not_exposed`,inlineExecutableCodeUi:`not_exposed`},current:{snapshotKind:`ui`,...e.workflowRunId?{runId:e.workflowRunId}:{},status:o,stateIds:[c],nodeId:c===`node.session`?`session`:void 0},nodeStatuses:_.map(e=>({id:e.id,kind:e.kind,status:e.status})),runInspection:{durableTruth:`kernel_run_records`,xstateProjectionOnly:!0,runHistoryCount:d.length,nodeAttemptCount:f.length,edgeTransferCount:p.length,runtimeErrorCount:m.length},result:{hasFinalOutput:!!l,validationErrorCount:u.length},actors:[{id:`workflow.actor.session`,kind:`agent`,piboSessionId:e.piboSessionId}],definitionLink:{status:h.status,workflowId:h.workflowId,workflowVersion:h.workflowVersion,hasLiveLink:h.status===`live`&&!!WO(h)},nestedWorkflowSessionCount:g.length}}}function VO(e){return e.workflowDefinitionLink?e.workflowDefinitionLink:e.workflowVersion?{status:`live`,workflowId:e.workflowId,workflowVersion:e.workflowVersion,title:e.title??e.workflowId,href:GO(e.workflowId,e.workflowVersion)}:{status:`snapshot_only_definition_deleted`,workflowId:e.workflowId,title:e.title??e.workflowId,tombstoneLabel:`Historical run inspection uses the immutable Project session snapshot instead of a broken live definition link.`}}function HO(e,t){let n=UO(e,t);if(!n)return[];let r=[],i=e=>{for(let t of e)t.workflowSessionKind===`nested_workflow`&&r.push({piboSessionId:t.piboSessionId,title:t.title,kind:t.workflowSessionKind??t.profile??`workflow`,...t.workflowSessionKind?{workflowSessionKind:t.workflowSessionKind}:{}}),i(t.children)};return i(n.children),r}function UO(e,t){for(let n of e){if(n.piboSessionId===t)return n;let e=UO(n.children,t);if(e)return e}}function WO(e){if(e.status===`live`){if(e.href)return e.href;if(e.workflowVersion)return GO(e.workflowId,e.workflowVersion)}}function GO(e,t){return`/apps/chat/workflows/view/${encodeURIComponent(e)}/${encodeURIComponent(t)}`}function KO(e){return`${e.workflowId}${e.workflowVersion?`@${e.workflowVersion}`:``}`}function qO(e){let t=e.configuration;return{inputKeys:Object.keys(t?.inputValues??{}).sort(),promptOverrideNodeIds:Object.keys(t?.promptOverrides??{}).sort()}}function JO(e,t){if(e.pendingHumanActions?.length)return e.pendingHumanActions.map(e=>({id:`wait-token:${e.waitTokenId}`,waitTokenId:e.waitTokenId,workflowRunId:e.workflowRunId,...e.nodeAttemptId?{nodeAttemptId:e.nodeAttemptId}:{},...e.humanNodeId?{humanNodeId:e.humanNodeId}:{},prompt:e.prompt,label:`Pending registered human action`,source:`persisted wait token`,...e.schema?{schema:e.schema}:{},payloadRequirements:e.payloadRequirements,availableActions:e.availableActions,diagnostics:e.diagnostics,createdAt:e.createdAt,...e.expiresAt?{expiresAt:e.expiresAt}:{}}));let n=hk(e,void 0).toLowerCase(),r=[t?.aggregateStatus,t?.localStatus].filter(e=>typeof e==`string`).join(` `).toLowerCase();return n.includes(`waiting`)||n.includes(`blocked`)||r.includes(`waiting`)||r.includes(`blocked`)||t?.hasBlockedDescendant?[{id:`human-action:${e.piboSessionId}`,prompt:`Session signal indicates a wait, but no persisted workflow wait token is available in the Project run store.`,label:`Awaiting human action`,source:t?`session signal`:`project session state`,availableActions:[],diagnostics:[]}]:[]}function YO(e,t,n){return e.workflowRunId?[{id:e.workflowRunId,status:t,currentNodeId:n,updatedAt:e.updatedAt,source:`project session run record`}]:[]}function XO(e,t){return!t||!e?[]:ak(e.nodes).filter(ZO).slice(0,8).map((e,t)=>({id:e.id,nodeId:e.stableKey??e.entryId??e.type,label:e.title||e.type,kind:e.type,status:QO(e.status),attempt:t+1,source:`session trace fact`,...e.startedAt?{startedAt:e.startedAt}:{},...e.completedAt?{completedAt:e.completedAt}:{}}))}function ZO(e){return e.type===`agent.turn`||e.type===`tool.call`||e.type===`execution.command`||e.type===`agent.delegation`||e.type===`agent.async`||e.type===`yielded.run`||e.type===`error`}function QO(e){return e===`done`?`completed`:e===`error`?`failed`:`running`}function $O(e,t){if(!t||!e)return[];let n=[];for(let r of e.rawEvents){if(!pk(r.payload))continue;let e=fk(r.payload.type),i=fk(r.payload.runId);if(e!==`edge.transferred`||i&&i!==t)continue;let a=fk(r.payload.edgeId);a&&n.push({id:fk(r.payload.edgeTransferId)??r.id,edgeId:a,status:`transferred`,source:r.type,createdAt:r.createdAt})}return n.slice(0,8)}function ek(e,t){let n=[];for(let e of t?.errors??[])n.push({id:`signal:${n.length}`,message:e.message,...e.code?{code:e.code}:{},source:e.source??`session signal`});if(e){for(let t of ak(e.nodes)){let e=t.error??(t.status===`error`?sk(t.output)??sk(t.summary):void 0);e&&n.push({id:`node:${t.id}`,message:e,source:t.type})}for(let t of e.rawEvents){if(!pk(t.payload))continue;let e=t.payload.error,r=pk(e)?fk(e.message):fk(e),i=pk(e)?fk(e.code):void 0;r&&n.push({id:`event:${t.id}`,message:r,...i?{code:i}:{},source:t.type})}}return tk(n).slice(0,8)}function tk(e){let t=new Set;return e.filter(e=>{let n=`${e.code??``}:${e.message}:${e.source??``}`;return!t.has(n)&&(t.add(n),!0)})}function nk(e,t){if(t!==`completed`||!e)return;let n=ak(e.nodes),r=[...n].reverse().find(e=>e.type===`assistant.message`&&e.status===`done`&&(e.output!==void 0||e.summary));if(r)return{value:r.output??r.summary??``,source:`assistant.message`};let i=[...n].reverse().find(e=>e.status===`done`&&e.type!==`user.message`&&e.type!==`model.reasoning`&&e.output!==void 0);return i?{value:i.output,source:i.type}:void 0}function rk(e,t){let n=[];for(let r of t)if(r.piboSessionId===e.piboSessionId&&(r.type===`project.workflow_start.blocked`||r.validation?.trigger===`before_workflow_start`))for(let e of r.diagnostics)e.severity===`error`&&n.push({id:`lifecycle:${r.id}:${n.length}`,message:e.message,code:e.code,path:e.path,source:`start lifecycle event`});return lk(n).slice(0,8)}function ik(e){if(!e)return[];let t=[];for(let n of ak(e.nodes)){let e=n.error??sk(n.output)??sk(n.summary);e&&(!ck([n.title,n.summary,n.error,n.type].filter(e=>typeof e==`string`).join(` `))&&!ck(e)||t.push({id:`node:${n.id}`,message:e,...n.type?{source:n.type}:{}}))}for(let n of e.rawEvents)ok(n.payload,`event:${n.id}`,t);return lk(t).slice(0,8)}function ak(e){let t=[],n=e=>{for(let r of e)t.push(r),n(r.children)};return n(e),t}function ok(e,t,n,r=0){if(r>4||!pk(e))return;let i=Array.isArray(e.diagnostics)?e.diagnostics:void 0;if(i)for(let e of i){if(!pk(e))continue;let r=fk(e.message)??sk(e);r&&n.push({id:`${t}:diagnostic:${n.length}`,message:r,...fk(e.code)?{code:fk(e.code)}:{},...fk(e.path)?{path:fk(e.path)}:{},source:`workflow.diagnostic`})}let a=e.error;if(pk(a)){let e=fk(a.code),r=fk(a.message)??sk(a);r&&ck([e,r].filter(Boolean).join(` `))&&n.push({id:`${t}:error:${n.length}`,message:r,...e?{code:e}:{},source:`workflow.error`})}else typeof a==`string`&&ck(a)&&n.push({id:`${t}:error:${n.length}`,message:a,source:`workflow.error`});for(let[i,a]of Object.entries(e))i!==`diagnostics`&&i!==`error`&&(i===`payload`||i===`output`||i===`result`||i===`data`)&&ok(a,`${t}:${i}`,n,r+1)}function sk(e){if(typeof e==`string`)return e;if(pk(e))return fk(e.message)??fk(e.error)??fk(e.summary)}function ck(e){let t=e.toLowerCase();return t.includes(`validation`)||t.includes(`validate`)||t.includes(`diagnostic`)||t.includes(`workflowinterfaceerror`)||t.includes(`workflowruntimeerror.validation`)}function lk(e){let t=new Set;return e.filter(e=>{let n=`${e.code??``}:${e.path??``}:${e.message}`;return!t.has(n)&&(t.add(n),!0)})}function uk(e){return pk(e)&&pk(e.data)&&Array.isArray(e.data.diagnostics)?e.data.diagnostics.filter(pk).map(t=>({code:fk(t.code)??`WorkflowRuntimeError.humanActionRejected`,message:fk(t.message)??dk(e),severity:t.severity===`info`||t.severity===`warning`||t.severity===`error`?t.severity:`error`,...fk(t.path)?{path:fk(t.path)}:{},...fk(t.registryRef)?{registryRef:fk(t.registryRef)}:{},...fk(t.hint)?{hint:fk(t.hint)}:{}})):[{code:`WorkflowRuntimeError.humanActionRejected`,message:dk(e),severity:`error`}]}function dk(e){return e instanceof Error?e.message:String(e)}function fk(e){return typeof e==`string`&&e.trim()?e:void 0}function pk(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function mk(e){return!!e.workflowRunId||e.state===`workflow`||e.workflowId!==`simple-chat`}function hk(e,t){return e.archived?`archived`:e.state&&e.state!==`workflow`?e.state.replace(/_/g,` `):t===`running`?`running`:t===`error`?`failed`:e.workflowRunId?`workflow`:e.kind}function gk(e,t){let n=hk(e,t).toLowerCase();return e.archived?`cancelled`:n.includes(`complete`)||n.includes(`done`)?`completed`:n.includes(`fail`)||n.includes(`error`)?`failed`:n.includes(`cancel`)?`cancelled`:n.includes(`wait`)||n.includes(`blocked`)?`waiting`:!e.workflowRunId&&n.includes(`configured`)?`idle`:`active`}function _k(e){return e===`completed`?`workflow.completed`:e===`failed`?`workflow.failed`:e===`cancelled`?`workflow.cancelled`:`node.session`}function vk(e){return e===`failed`?`workflow.failed`:e===`cancelled`?`workflow.cancelled`:`workflow.completed`}function yk(e){return e===`failed`?`failed`:e===`cancelled`?`cancelled`:`completed`}function bk(e){return e===`failed`?`WORKFLOW.FAIL`:e===`cancelled`?`WORKFLOW.CANCEL`:`WORKFLOW.NODE.DONE`}function xk({status:e}){return e===`completed`?(0,I.jsx)(mn,{size:16,className:`text-emerald-300`}):e===`failed`?(0,I.jsx)(_n,{size:16,className:`text-red-300`}):e===`cancelled`?(0,I.jsx)(Qn,{size:16,className:`text-slate-400`}):e===`waiting`?(0,I.jsx)(yn,{size:16,className:`text-amber-300`}):e===`active`?(0,I.jsx)(Xt,{size:16,className:`text-[#11a4d4]`}):(0,I.jsx)(vn,{size:16,className:`text-slate-500`})}function Sk({tone:e,children:t}){return(0,I.jsx)(`span`,{className:`rounded border px-2 py-1 font-mono ${{blue:`border-[#11a4d4]/40 bg-[#11a4d4]/10 text-[#11a4d4]`,slate:`border-slate-700 bg-slate-900/50 text-slate-300`,green:`border-emerald-500/40 bg-emerald-500/10 text-emerald-300`,amber:`border-amber-500/40 bg-amber-500/10 text-amber-300`,red:`border-red-500/40 bg-red-500/10 text-red-300`}[e]}`,children:t})}function Ck(e){return e===`completed`?`green`:e===`failed`||e===`cancelled`?`red`:e===`waiting`?`amber`:`blue`}function wk(e){return e===`completed`?`border-emerald-500/40 bg-emerald-500/10`:e===`failed`?`border-red-500/40 bg-red-500/10`:e===`cancelled`?`border-slate-600 bg-slate-800/40`:e===`waiting`?`border-amber-500/40 bg-amber-500/10`:e===`active`?`border-[#11a4d4]/50 bg-[#11a4d4]/10 shadow-[0_0_0_1px_rgba(17,164,212,0.18)]`:`border-slate-800 bg-[#111820]`}function Tk(e){return e===`completed`?`border-emerald-500/40 bg-emerald-500/10 text-emerald-300`:e===`failed`||e===`cancelled`?`border-red-500/40 bg-red-500/10 text-red-300`:e===`waiting`?`border-amber-500/40 bg-amber-500/10 text-amber-300`:e===`active`?`border-[#11a4d4]/40 bg-[#11a4d4]/10 text-[#11a4d4]`:`border-slate-700 bg-slate-900/50 text-slate-400`}function Ek(e){let t=e.toLowerCase();return t.includes(`complete`)||t.includes(`done`)||t.includes(`transferred`)?`border-emerald-500/40 bg-emerald-500/10 text-emerald-300`:t.includes(`fail`)||t.includes(`error`)||t.includes(`cancel`)?`border-red-500/40 bg-red-500/10 text-red-300`:t.includes(`wait`)||t.includes(`blocked`)?`border-amber-500/40 bg-amber-500/10 text-amber-300`:t.includes(`run`)||t.includes(`active`)||t.includes(`workflow`)?`border-[#11a4d4]/40 bg-[#11a4d4]/10 text-[#11a4d4]`:`border-slate-700 bg-slate-900/50 text-slate-400`}function Dk(e){return e.length>18?`${e.slice(0,10)}…${e.slice(-6)}`:e}var Ok=[{id:`terminal`,label:`Terminal`,description:`Compact Codex-style terminal transcript.`,render:e=>(0,I.jsx)(qD,{...e})},{id:`workflow`,label:`Workflow`,description:`Workflow/XState visualization for workflow-backed project sessions.`,render:e=>(0,I.jsx)(bO,{...e})}],kk=new Map(Ok.map(e=>[e.id,e]));function Ak(){return Ok}function jk(e){return kk.get(e)??kk.get(`terminal`)}var Mk=`pibo.chat.composerHistory`,Nk=`pibo.chat.toolDisplayMode`;function Pk(){try{let e=localStorage.getItem(Mk);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim().length>0).slice(-100):[]}catch{return[]}}function Fk(e){let t=e.trim();if(!t)return;let n=Pk();if(n.at(-1)!==t)try{localStorage.setItem(Mk,JSON.stringify([...n,t].slice(-100)))}catch{}}function Ik(){try{let e=localStorage.getItem(Nk);return Vt.includes(e)?e:`default`}catch{return`default`}}function Lk(e){try{localStorage.setItem(Nk,e)}catch{}}async function Rk(e){let t=new FormData;t.append(`file`,e,e.name);let n=await fetch(`/api/chat/transcription`,{method:`POST`,body:t}),r=await n.json().catch(()=>void 0);if(!n.ok){let e=r&&typeof r==`object`&&`error`in r?String(r.error):`Transcription failed`;throw Error(e)}return r.transcription}function zk(e){if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(e);let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();try{return document.execCommand(`copy`),Promise.resolve()}finally{document.body.removeChild(t)}}var Bk=3e3;Bk/50;function Vk({samples:e,elapsedMs:t}){let n=(0,F.useMemo)(()=>Uk(e),[e]);return(0,I.jsxs)(`div`,{className:`mb-2 flex h-12 w-full items-center gap-3 overflow-hidden rounded-full border border-[#11a4d4]/60 bg-[#0e1116] px-4`,role:`status`,"aria-label":`Recording audio`,"data-pibo-debug":`composer-audio-waveform`,"data-window-ms":Bk,"data-sample-count":e.length,children:[(0,I.jsx)(`span`,{className:`h-2 w-2 shrink-0 animate-pulse rounded-full bg-red-400`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] font-bold uppercase tracking-wider text-red-300`,children:`Rec`}),(0,I.jsx)(`svg`,{className:`h-8 min-w-0 flex-1`,viewBox:`0 0 240 32`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:n.map((e,t)=>{let r=Math.max(3,Math.round(e*28));return(0,I.jsx)(`rect`,{x:t*4+1,y:(32-r)/2,width:`2`,height:r,rx:`1`,fill:`#11a4d4`,opacity:.3+t/Math.max(1,n.length-1)*.7},t)})}),(0,I.jsx)(`span`,{className:`w-10 shrink-0 text-right font-mono text-[11px] tabular-nums text-slate-400`,"aria-hidden":`true`,children:Wk(t)})]})}function Hk(e,t,n){let r=Math.max(0,Math.min(1,Number.isFinite(t)?t:0));return[...e.filter(e=>n-e.at<Bk),{at:n,level:r}].slice(-60)}function Uk(e){let t=e.slice(-60).map(e=>e.level);return[...Array.from({length:Math.max(0,60-t.length)},()=>0),...t]}function Wk(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}function Gk(e,t){return e.length>t?`${e.slice(0,Math.max(0,t-1))}…`:e}function Kk({sessionId:e,disabled:t=!1,commands:n,skills:r,value:i,focusSignal:a,selectedWebAnnotations:o,selectedUploadAttachments:s,onValueChange:c,onCommand:l,onDetachWebAnnotation:u,onClearWebAnnotations:d,onAttachUploadedFiles:f,onDetachUploadAttachment:p,onClearUploadAttachments:m,onSend:h}){let g=(0,F.useRef)(null),_=(0,F.useRef)(null),v=(0,F.useRef)(null),y=(0,F.useRef)(null),b=(0,F.useRef)(null),x=(0,F.useRef)(null),S=(0,F.useRef)(null),C=(0,F.useRef)(i),w=(0,F.useRef)(!0),T=(0,F.useRef)(null),E=(0,F.useRef)(null),D=(0,F.useRef)([]),O=(0,F.useRef)(null),k=(0,F.useRef)(null),ee=(0,F.useRef)(null),te=(0,F.useRef)(null),[ne,A]=(0,F.useState)(0),[j,re]=(0,F.useState)(0),[M,N]=(0,F.useState)(0),[ie,ae]=(0,F.useState)([]),[oe,se]=(0,F.useState)(!1),[ce,le]=(0,F.useState)(null),[ue,de]=(0,F.useState)(null),[P,fe]=(0,F.useState)(!1),[pe,me]=(0,F.useState)(!1),[he,ge]=(0,F.useState)(null),[_e,ve]=(0,F.useState)([]),[ye,be]=(0,F.useState)(0),xe=(0,F.useCallback)((e=!0)=>{te.current!==null&&(cancelAnimationFrame(te.current),te.current=null),k.current?.disconnect(),ee.current?.disconnect(),k.current=null,ee.current=null;let t=O.current;O.current=null,t&&t.state!==`closed`&&t.close().catch(()=>void 0),e&&(ve([]),be(0))},[]),Se=(0,F.useCallback)(e=>{xe();let t=window.AudioContext??window.webkitAudioContext;if(t)try{let n=new t,r=n.createMediaStreamSource(e),i=n.createAnalyser();i.fftSize=1024,i.smoothingTimeConstant=.65,r.connect(i),O.current=n,k.current=r,ee.current=i;let a=new Uint8Array(i.fftSize),o=performance.now(),s=o-50,c=e=>{if(e-s>=50){i.getByteTimeDomainData(a);let t=0;for(let e of a){let n=(e-128)/128;t+=n*n}let n=Math.min(1,Math.sqrt(t/a.length)*4);ve(t=>Hk(t,n,e)),be(e-o),s=e}te.current=requestAnimationFrame(c)};n.resume().catch(()=>void 0),te.current=requestAnimationFrame(c)}catch{xe()}},[xe]),Ce=(0,F.useMemo)(()=>{for(let e=M-1;e>=0;e--){let t=i[e];if(t===` `||t===`
40
+ `||t===` `)break;if(t===`$`){if(e>0&&i[e-1]===`\\`)continue;return{query:i.slice(e+1,M).toLowerCase(),startPos:e,endPos:M}}}return null},[i,M]),we=i.trim().startsWith(`/`)?i.trim().split(/\s+/)[0]:null,Te=Ce?qk(Ce.startPos,i.slice(Ce.startPos,M)):null,Ee=we?Jk(we):null,De=(0,F.useMemo)(()=>Ce?r.filter(e=>e.name.toLowerCase().startsWith(Ce.query)):[],[Ce,r]),Oe=(0,F.useMemo)(()=>we?n.filter(e=>e.slash.startsWith(we)):[],[we,n]),ke=Te&&ie.includes(Te)?[]:De,Ae=Ee&&ie.includes(Ee)?[]:Oe,je=(0,F.useCallback)(e=>{e&&ae(t=>t.includes(e)?t:[...t,e])},[]),Me=(0,F.useCallback)(()=>{let e=[De.length?Te:null,Oe.length?Ee:null].filter(e=>!!e);e.length&&ae(t=>{let n=new Set(t);for(let t of e)n.add(t);return n.size===t.length?t:[...n]})},[Ee,Oe.length,De.length,Te]);(0,F.useEffect)(()=>{let e=[Te,Ee].filter(e=>!!e);ae(t=>t.filter(t=>e.includes(t)))},[Ee,Te]),(0,F.useEffect)(()=>{!Ae.length||ne<Ae.length||A(0)},[ne,Ae.length]),(0,F.useEffect)(()=>{!ke.length||j<ke.length||re(0)},[j,ke.length]),(0,F.useEffect)(()=>{let e=requestAnimationFrame(()=>b.current?.scrollIntoView({block:`nearest`}));return()=>cancelAnimationFrame(e)},[ne,Ae.length]),(0,F.useEffect)(()=>{let e=requestAnimationFrame(()=>x.current?.scrollIntoView({block:`nearest`}));return()=>cancelAnimationFrame(e)},[j,ke.length]),(0,F.useEffect)(()=>{C.current=i},[i]),(0,F.useEffect)(()=>{S.current=null},[e]),(0,F.useEffect)(()=>(w.current=!0,()=>{w.current=!1,xe(!1);let e=T.current;e&&e.state!==`inactive`&&(e.ondataavailable=null,e.onstop=null,e.stop());for(let e of E.current?.getTracks()??[])e.stop()}),[xe]),(0,F.useEffect)(()=>{if(!ue)return;let e=requestAnimationFrame(()=>y.current?.focus());return()=>{cancelAnimationFrame(e),URL.revokeObjectURL(ue.previewUrl)}},[ue]),(0,F.useEffect)(()=>{if(a<=0)return;let e=_.current;if(!e)return;let t=e.value.length;e.focus(),e.setSelectionRange(t,t),N(t)},[a]),(0,F.useEffect)(()=>{if(!Ae.length&&!ke.length)return;let e=e=>{let t=e.target;t instanceof Node&&(g.current?.contains(t)||Me())};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[Me,Ae.length,ke.length]),(0,F.useLayoutEffect)(()=>{iA(_.current)},[i]);let Ne=e=>{if(!Ce||!_.current)return;let t=i.slice(0,Ce.startPos),n=i.slice(Ce.endPos);c(t+`$`+e+n),je(qk(Ce.startPos,`$${e}`));let r=Ce.startPos+1+e.length;N(r),requestAnimationFrame(()=>{_.current?.setSelectionRange(r,r),N(r)})},Pe=e=>{c(e),requestAnimationFrame(()=>{let e=_.current;if(!e)return;let t=e.value.length;e.setSelectionRange(t,t),N(t)})},Fe=e=>{let t=S.current;if(!t){if(e===`next`||i!==``)return!1;let t=Pk();if(!t.length)return!1;let n=e===`previous`?t.length-1:0;return S.current={entries:t,index:n,draft:i},Pe(t[n]),!0}if(e===`previous`){let e=Math.max(0,t.index-1);return S.current={...t,index:e},Pe(t.entries[e]),!0}let n=t.index+1;return n>=t.entries.length?(S.current=null,Pe(t.draft),!0):(S.current={...t,index:n},Pe(t.entries[n]),!0)},Ie=()=>{t||oe||v.current?.click()},Le=()=>{de(null)},Re=e=>{if(t||oe)return;let n=Yk(e.clipboardData);if(!n.length)return;e.preventDefault(),Me(),le(null);let r=n[0];de(e=>(e&&URL.revokeObjectURL(e.previewUrl),{file:r,previewUrl:URL.createObjectURL(r)}))},ze=async()=>{if(!ue||oe)return;let e=ue.file;de(null),await Be([e])},Be=async e=>{if(e.length){se(!0),le({message:`Uploading ${e.length} file${e.length===1?``:`s`}...`,error:!1});try{f((await Ft(e)).files),le(null)}catch(e){le({message:e instanceof Error?e.message:String(e),error:!0})}finally{se(!1)}}},Ve=async e=>{let t=D.current;D.current=[],xe();for(let e of E.current?.getTracks()??[])e.stop();if(E.current=null,T.current=null,w.current){fe(!1),me(!0),ge({message:`Transcribing recording…`,error:!1});try{if(!t.length)throw Error(`The audio recording is empty.`);let n=e.mimeType||t.find(e=>e.type)?.type||`audio/webm`,r=new Blob(t,{type:n}),i=await Rk(new File([r],rA(n),{type:n,lastModified:Date.now()}));if(!w.current)return;let a=tA(C.current,i.text);C.current=a,c(a),ge(null),requestAnimationFrame(()=>{let e=_.current;e&&(e.focus(),e.setSelectionRange(a.length,a.length),N(a.length))})}catch(e){w.current&&ge({message:e instanceof Error?e.message:String(e),error:!0})}finally{w.current&&me(!1)}}},He=async()=>{if(P){let e=T.current;e&&e.state!==`inactive`&&(xe(),fe(!1),me(!0),e.stop());return}if(!(t||oe||pe)){if(ge(null),typeof navigator>`u`||!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>`u`){ge({message:`Audio recording is not supported by this browser.`,error:!0});return}try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});if(!w.current){for(let t of e.getTracks())t.stop();return}let t=nA(),n=t?new MediaRecorder(e,{mimeType:t}):new MediaRecorder(e);E.current=e,T.current=n,D.current=[],n.ondataavailable=e=>{e.data.size>0&&D.current.push(e.data)},n.onerror=()=>{n.onstop=null,D.current=[],xe();for(let t of e.getTracks())t.stop();E.current=null,T.current=null,w.current&&(fe(!1),me(!1),ge({message:`Audio recording failed.`,error:!0}))},n.onstop=()=>void Ve(n),n.start(),Se(e),fe(!0)}catch(e){xe();for(let e of E.current?.getTracks()??[])e.stop();if(E.current=null,T.current=null,!w.current)return;fe(!1),ge({message:e instanceof Error?e.message:`Microphone access failed.`,error:!0})}}},Ue=async()=>{if(t||P||pe)return;let e=i.trim();if(e){if(ke.length){Ne(ke[Math.min(j,ke.length-1)].name);return}if(Ae.length&&!n.some(t=>t.slash===e.split(/\s+/)[0])){let e=Ae[Math.min(ne,Ae.length-1)].slash;c(e),je(Jk(e));return}if(S.current=null,Fk(e),c(``),e.split(/\s+/)[0]===`/upload`){Ie();return}e.startsWith(`/`)&&await l(e)||await h(e)}};return(0,I.jsxs)(`div`,{ref:g,"data-pibo-debug":`composer`,"data-pibo-session-id":e??void 0,"data-pibo-state":t?`disabled`:i?`non-empty`:`empty`,className:`relative p-3 bg-[#151f24] border-t border-slate-800 max-[980px]:p-2`,children:[(0,I.jsx)(`input`,{ref:v,type:`file`,multiple:!0,className:`hidden`,onChange:e=>{let t=Array.from(e.target.files??[]);e.target.value=``,Be(t)}}),ce?(0,I.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 rounded-sm border px-3 py-2 text-xs ${ce.error?`border-red-900 bg-red-950/40 text-red-200`:ce.copyText?`border-green-900/60 bg-green-950/30 text-green-300`:`border-slate-700 bg-[#0e1116] text-slate-300`}`,children:[(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:ce.message}),ce.copyText?(0,I.jsx)(`button`,{type:`button`,onClick:()=>void zk(ce.copyText),title:`Copy uploaded file path`,"aria-label":`Copy uploaded file path`,className:`shrink-0 rounded-sm p-0.5 text-slate-400 hover:bg-slate-800 hover:text-[#11a4d4]`,children:(0,I.jsx)(bn,{size:13})}):null,(0,I.jsx)(`button`,{type:`button`,onClick:()=>le(null),title:`Hide upload status`,"aria-label":`Hide upload status`,className:`shrink-0 rounded-sm p-0.5 text-slate-500 hover:bg-slate-800 hover:text-slate-200`,children:(0,I.jsx)(tr,{size:13})})]}):null,he?(0,I.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 rounded-sm border px-3 py-2 text-xs ${he.error?`border-red-900 bg-red-950/40 text-red-200`:`border-slate-700 bg-[#0e1116] text-slate-300`}`,"data-pibo-debug":`composer-transcription-status`,children:[pe&&!he.error?(0,I.jsx)(In,{size:13,className:`shrink-0 animate-spin text-[#11a4d4]`}):null,(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:he.message}),he.error?(0,I.jsx)(`button`,{type:`button`,onClick:()=>ge(null),title:`Hide transcription status`,"aria-label":`Hide transcription status`,className:`shrink-0 rounded-sm p-0.5 text-slate-500 hover:bg-slate-800 hover:text-slate-200`,children:(0,I.jsx)(tr,{size:13})}):null]}):null,ue?(0,I.jsx)(`div`,{className:`fixed inset-0 z-50 grid place-items-center bg-black/60 px-4`,role:`dialog`,"aria-modal":`true`,"aria-label":`Upload pasted image`,onKeyDown:e=>{e.key===`Escape`&&Le()},children:(0,I.jsxs)(`div`,{className:`w-full max-w-md rounded-sm border border-slate-700 bg-[#151f24] shadow-2xl`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-slate-800 px-4 py-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-semibold text-slate-100`,children:`Pasted image detected`}),(0,I.jsx)(`div`,{className:`mt-1 text-xs text-slate-400`,children:`Upload this clipboard image to the configured Pibo uploads directory?`})]}),(0,I.jsx)(`button`,{type:`button`,onClick:Le,className:`rounded-sm p-1 text-slate-500 hover:bg-slate-800 hover:text-slate-200`,"aria-label":`Cancel pasted image upload`,children:(0,I.jsx)(tr,{size:14})})]}),(0,I.jsxs)(`div`,{className:`space-y-3 px-4 py-4`,children:[(0,I.jsx)(`img`,{src:ue.previewUrl,alt:`Pasted clipboard image preview`,className:`max-h-64 w-full rounded-sm border border-slate-800 bg-[#0e1116] object-contain`}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-slate-400`,children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate font-mono`,children:ue.file.name}),(0,I.jsx)(`span`,{className:`shrink-0 font-mono`,children:eA(ue.file.size)})]})]}),(0,I.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-slate-800 px-4 py-3`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:Le,className:`h-8 rounded-sm border border-slate-700 px-3 text-xs text-slate-300 hover:border-slate-500 hover:text-slate-100`,children:`Cancel`}),(0,I.jsx)(`button`,{ref:y,type:`button`,onClick:()=>void ze(),disabled:oe,className:`h-8 rounded-sm bg-[#11a4d4] px-3 text-xs font-medium text-white disabled:opacity-50`,children:`Upload image`})]})]})}):null,ke.length?(0,I.jsx)(`div`,{className:`absolute left-3 bottom-full mb-2 w-[min(520px,calc(100%-24px))] max-h-72 overflow-auto bg-[#0e1116] border border-emerald-500 rounded-sm shadow-xl`,children:ke.map((e,t)=>(0,I.jsxs)(`button`,{ref:t===j?x:null,type:`button`,onClick:()=>Ne(e.name),className:`w-full grid grid-cols-[120px_1fr] gap-2 px-3 py-2 text-left border-b border-slate-800 ${t===j?`bg-emerald-500/15`:``}`,children:[(0,I.jsxs)(`span`,{className:`font-mono text-emerald-400`,children:[`$`,e.name]}),(0,I.jsx)(`span`,{className:`text-xs text-slate-400`,children:e.description??e.path??``})]},e.name))}):null,s.length?(0,I.jsxs)(`div`,{className:`mb-2 rounded-sm border border-slate-800 bg-[#0e1116] px-2.5 py-1.5`,"data-pibo-debug":`composer-upload-attachments`,"data-upload-attachment-count":s.length,children:[(0,I.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between gap-2`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-bold uppercase tracking-wider text-[#11a4d4]`,children:`Attached uploads`}),(0,I.jsx)(`button`,{type:`button`,onClick:m,className:`text-[11px] text-slate-500 hover:text-[#11a4d4]`,children:`Clear`})]}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:s.map(e=>(0,I.jsxs)(`div`,{title:e.path,className:`inline-flex max-w-80 items-center gap-1 rounded-sm border border-emerald-500/45 bg-emerald-500/10 px-2 py-1 text-left text-[11px] text-slate-200`,"data-pibo-debug":`composer-upload-attachment-chip`,"data-upload-path":e.path,children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:Gk(e.name||e.path,100)}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>void zk(e.path),title:`Copy uploaded file path`,"aria-label":`Copy uploaded file path`,className:`shrink-0 rounded-sm p-0.5 text-emerald-300 hover:bg-slate-800 hover:text-[#11a4d4]`,children:(0,I.jsx)(bn,{size:11})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>p(e.id),title:`Detach ${e.name||e.path}`,"aria-label":`Detach ${e.name||e.path}`,className:`shrink-0 rounded-sm p-0.5 text-emerald-300 hover:bg-slate-800 hover:text-slate-100`,children:(0,I.jsx)(tr,{size:11})})]},e.id))})]}):null,o.length?(0,I.jsxs)(`div`,{className:`mb-2 rounded-sm border border-slate-800 bg-[#0e1116] px-3 py-2`,"data-pibo-debug":`composer-web-annotations`,"data-web-annotation-count":o.length,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-bold uppercase tracking-wider text-[#11a4d4]`,children:`Attached web annotations`}),(0,I.jsx)(`button`,{type:`button`,onClick:d,className:`text-[11px] text-slate-500 hover:text-[#11a4d4]`,children:`Clear`})]}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:o.map(e=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>u(e.id),title:`Detach ${e.id}`,className:`inline-flex max-w-72 items-center gap-1 rounded-sm border border-[#11a4d4]/50 bg-[#11a4d4]/10 px-2 py-1 text-left text-[11px] text-slate-200`,"data-pibo-debug":`composer-web-annotation-chip`,"data-web-annotation-id":e.id,children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:Gk(e.primaryTarget||e.label||e.note||e.id,100)}),(0,I.jsx)(tr,{size:11,className:`shrink-0 text-[#11a4d4]`})]},e.id))})]}):null,Ae.length?(0,I.jsx)(`div`,{className:`absolute left-3 bottom-full mb-2 w-[min(520px,calc(100%-24px))] max-h-72 overflow-auto bg-[#0e1116] border border-[#11a4d4] rounded-sm shadow-xl`,children:Ae.map((e,t)=>(0,I.jsxs)(`button`,{ref:t===ne?b:null,type:`button`,onClick:()=>{c(e.slash),je(Jk(e.slash)),A(t)},className:`w-full grid grid-cols-[120px_1fr] gap-2 px-3 py-2 text-left border-b border-slate-800 ${t===ne?`bg-[#11a4d4]/15`:``}`,children:[(0,I.jsx)(`span`,{className:`font-mono text-[#11a4d4]`,children:e.slash}),(0,I.jsx)(`span`,{className:`text-xs text-slate-400`,children:e.description})]},e.slash))}):null,P?(0,I.jsx)(Vk,{samples:_e,elapsedMs:ye}):null,(0,I.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_auto] items-end gap-2`,children:[(0,I.jsx)(`textarea`,{id:`message-composer-input`,ref:_,"data-pibo-debug":`composer-input`,"data-pibo-session-id":e??void 0,"data-pibo-state":t?`disabled`:i?`non-empty`:`empty`,rows:1,value:i,disabled:t,onChange:e=>{S.current=null,C.current=e.target.value,c(e.target.value),N(e.target.selectionStart)},onKeyDown:e=>{if(e.key===`Escape`&&(ke.length||Ae.length)){e.preventDefault(),e.stopPropagation(),Me();return}if(ke.length&&(e.key===`ArrowDown`||e.key===`ArrowUp`)){e.preventDefault(),re(t=>e.key===`ArrowDown`?(t+1)%ke.length:(t-1+ke.length)%ke.length);return}if(Ae.length&&(e.key===`ArrowDown`||e.key===`ArrowUp`)){e.preventDefault(),A(t=>e.key===`ArrowDown`?(t+1)%Ae.length:(t-1+Ae.length)%Ae.length);return}if((e.key===`ArrowUp`||e.key===`ArrowDown`)&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&Fe(e.key===`ArrowUp`?`previous`:`next`)){e.preventDefault();return}e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Ue())},onPaste:Re,placeholder:t?`Select a session to message`:`Send message ...`,className:`h-10 min-h-10 resize-none overflow-hidden bg-[#0e1116] border border-slate-700 rounded-sm px-3 py-2 text-sm leading-5 outline-none focus:border-[#11a4d4] disabled:opacity-50 [scrollbar-gutter:stable]`}),(0,I.jsx)(`button`,{type:`button`,disabled:pe||oe||!P&&t,onClick:()=>void He(),title:P?`Stop recording and transcribe`:pe?`Transcribing recording`:`Start voice recording`,"aria-label":P?`Stop recording and transcribe`:`Start voice recording`,"aria-pressed":P,"data-pibo-debug":`composer-audio-recording`,"data-recording":P?`true`:`false`,className:`h-10 w-10 self-end inline-flex items-center justify-center rounded-sm border disabled:opacity-50 ${P?`border-red-400 bg-red-500/20 text-red-300 animate-pulse`:`border-slate-700 bg-[#0e1116] text-slate-300 hover:border-[#11a4d4] hover:text-[#11a4d4]`}`,children:pe?(0,I.jsx)(In,{size:16,className:`animate-spin`}):P?(0,I.jsx)(Yn,{size:14,fill:`currentColor`}):(0,I.jsx)(Bn,{size:16})}),(0,I.jsx)(`button`,{type:`button`,disabled:t||oe||P||pe,onClick:()=>void Ue(),title:`Send message`,"aria-label":`Send message`,className:`h-10 w-10 self-end inline-flex items-center justify-center bg-[#11a4d4] rounded-sm text-white disabled:opacity-50`,children:(0,I.jsx)(qn,{size:16})})]})]})}function qk(e,t){return`skill:${e}:${t}`}function Jk(e){return`command:${e}`}function Yk(e){let t=Array.from(e.items).filter(e=>e.kind===`file`&&e.type.startsWith(`image/`)).map(e=>e.getAsFile()).filter(e=>!!e);return(t.length?t:Array.from(e.files).filter(e=>e.type.startsWith(`image/`))).map(Xk)}function Xk(e){return e.name&&e.name!==`image.png`?e:new File([e],Zk(e.type),{type:e.type||`image/png`,lastModified:Date.now()})}function Zk(e){let t=Qk(e),n=new Date;return`screenshot-${[n.getFullYear(),$k(n.getMonth()+1),$k(n.getDate()),`-`,$k(n.getHours()),$k(n.getMinutes()),$k(n.getSeconds())].join(``)}${t}`}function Qk(e){switch(e){case`image/jpeg`:return`.jpg`;case`image/gif`:return`.gif`;case`image/webp`:return`.webp`;case`image/svg+xml`:return`.svg`;default:return`.png`}}function $k(e){return String(e).padStart(2,`0`)}function eA(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KiB`:`${(e/1048576).toFixed(1)} MiB`}function tA(e,t){let n=t.trim();return n?e?`${e}${/\s$/.test(e)?``:`
41
+
42
+ `}${n}`:n:e}function nA(){return[`audio/webm;codecs=opus`,`audio/webm`,`audio/ogg;codecs=opus`,`audio/mp4`].find(e=>MediaRecorder.isTypeSupported(e))}function rA(e){let t=e.includes(`ogg`)?`ogg`:e.includes(`mp4`)?`m4a`:`webm`;return`recording-${Date.now()}.${t}`}function iA(e){if(!e)return;if(e.value&&!e.value.includes(`
43
+ `)&&e.value.length<80){e.style.height=``,e.style.overflowY=`hidden`;return}let t=window.getComputedStyle(e),n=aA(t.lineHeight,20),r=aA(t.borderTopWidth)+aA(t.borderBottomWidth),i=n*5+aA(t.paddingTop)+aA(t.paddingBottom);e.style.height=`auto`;let a=e.scrollHeight,o=a>i;e.style.height=`${Math.min(a,i)+r}px`,e.style.overflowY=o?`auto`:`hidden`,o&&e.selectionStart===e.value.length&&e.selectionEnd===e.value.length&&(e.scrollTop=a)}function aA(e,t=0){let n=Number.parseFloat(e);return Number.isFinite(n)?n:t}var oA=`pibo.chat.webAnnotations.cdpUrl`,sA=`pibo.chat.webAnnotations.selected`,cA=`${sA}.`,lA=`pibo.chat.webAnnotations.overlay.`,uA=`pibo.chat.webAnnotations.panelCollapsed`,dA=`pibo.chat.shortcuts.webAnnotationsToggle`,fA=`Alt+Shift+A`;function pA(){try{return localStorage.getItem(oA)??``}catch{return``}}function mA(e){try{e.trim()?localStorage.setItem(oA,e.trim()):localStorage.removeItem(oA)}catch{}}function hA(){try{return localStorage.getItem(dA)||`Alt+Shift+A`}catch{return fA}}function gA(e){try{return vA(localStorage.getItem(_A(e)))}catch{return null}}function _A(e){return lA+e}function vA(e){if(!e)return null;try{return yA(JSON.parse(e))}catch{return null}}function yA(e){if(!e||typeof e!=`object`)return null;let t=e,n=typeof t.piboSessionId==`string`?t.piboSessionId.trim():``;return n?{bindingId:typeof t.bindingId==`string`?t.bindingId:void 0,piboSessionId:n,installed:t.installed!==!1,active:t.active===!0,toolbarExpanded:t.toolbarExpanded===!0,mode:typeof t.mode==`string`?t.mode:void 0,reason:typeof t.reason==`string`?t.reason:void 0,updatedAt:typeof t.updatedAt==`string`?t.updatedAt:void 0}:null}function bA(e){try{let t=SA(localStorage.getItem(sA));if(t.length||!e)return t;let n=cA+e,r=SA(localStorage.getItem(n));return r.length&&(localStorage.setItem(sA,JSON.stringify(r)),localStorage.removeItem(n)),r}catch{return[]}}function xA(e,t){try{let n=[...new Set(t.filter(e=>e.trim()))].slice(0,5);n.length?localStorage.setItem(sA,JSON.stringify(n)):localStorage.removeItem(sA),e&&localStorage.removeItem(cA+e)}catch{}}function SA(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`&&!!e.trim()).slice(0,5):[]}catch{return[]}}function CA(){try{return localStorage.getItem(uA)===`true`}catch{return!1}}function wA(e){try{localStorage.setItem(uA,String(e))}catch{}}var TA=`web-annotations-dialog`,EA=`web-annotations-session-panel-details`;function DA({piboSessionId:e,annotations:t,selectedIds:n,loading:r,error:i,collapsed:a,onRefresh:o,onToggle:s,onClear:c,onCollapse:l,onClose:u}){return e?(0,I.jsxs)(`section`,{className:`border-t border-slate-800 bg-[#101d22] px-3 py-2 sm:px-4`,"data-pibo-debug":`web-annotations-session-panel`,"data-pibo-session-id":e,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsx)(`div`,{className:`min-w-0`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-bold uppercase tracking-wider text-[#11a4d4]`,children:`Web annotations`}),(0,I.jsx)(`span`,{className:`rounded-sm border border-slate-700 px-1.5 py-0.5 text-[10px] text-slate-400`,children:t.length}),n.length?(0,I.jsxs)(`span`,{className:`rounded-sm border border-[#11a4d4]/50 px-1.5 py-0.5 text-[10px] text-[#11a4d4]`,children:[n.length,` attached`]}):null]})}),(0,I.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:o,disabled:r,title:`Refresh annotations`,"aria-label":`Refresh annotations`,className:`inline-flex h-8 w-8 items-center justify-center rounded-sm border border-slate-700 text-slate-300 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50 sm:h-7 sm:w-7`,"data-pibo-debug":`web-annotations-refresh`,children:(0,I.jsx)(Un,{size:12,className:r?`animate-spin`:void 0})}),(0,I.jsx)(`button`,{type:`button`,onClick:c,disabled:r||!t.length,title:`Clear visible annotations`,"aria-label":`Clear visible annotations`,className:`inline-flex h-8 w-8 items-center justify-center rounded-sm border border-slate-700 text-slate-300 hover:border-red-500 hover:text-red-300 disabled:opacity-50 sm:h-7 sm:w-7`,children:(0,I.jsx)(Zn,{size:12})}),(0,I.jsx)(`button`,{type:`button`,onClick:l,title:a?`Expand annotations panel`:`Collapse annotations panel`,"aria-label":`Web annotations details`,"aria-expanded":!a,"aria-controls":EA,className:`inline-flex h-8 w-8 items-center justify-center rounded-sm border border-slate-700 text-slate-300 hover:border-[#11a4d4] hover:text-[#11a4d4] sm:h-7 sm:w-7`,children:a?(0,I.jsx)(fn,{size:12}):(0,I.jsx)(un,{size:12})}),(0,I.jsx)(`button`,{type:`button`,onClick:u,title:`Hide annotations panel`,"aria-label":`Hide annotations panel`,className:`inline-flex h-8 w-8 items-center justify-center rounded-sm border border-slate-700 text-slate-300 hover:border-[#11a4d4] hover:text-[#11a4d4] sm:h-7 sm:w-7`,children:(0,I.jsx)(tr,{size:12})})]})]}),(0,I.jsxs)(`div`,{id:EA,hidden:a,children:[(0,I.jsx)(`div`,{className:`text-[11px] text-slate-500`,children:`Global annotation list. Selected attachments follow you when switching sessions.`}),i?(0,I.jsx)(`div`,{className:`rounded-sm border border-red-900 bg-red-950/40 px-3 py-2 text-xs text-red-200`,"data-pibo-debug":`web-annotations-error`,children:RA(i,220)}):r&&!t.length?(0,I.jsx)(`div`,{className:`rounded-sm border border-slate-800 bg-[#0e1116] px-3 py-2 text-xs text-slate-400`,"data-pibo-debug":`web-annotations-loading`,children:`Loading annotations…`}):t.length?(0,I.jsx)(`div`,{className:`mt-2 grid max-h-[min(40svh,18rem)] grid-cols-1 gap-2 overflow-y-auto pr-1 sm:max-h-56 sm:grid-cols-[repeat(auto-fill,minmax(16rem,1fr))]`,"data-pibo-debug":`web-annotations-list`,children:t.map((e,t)=>{let r=n.includes(e.id),i=RA(e.primaryTarget||e.label||e.selector||e.targetKind||`target`,64),a=`${t+1}: ${i}`;return(0,I.jsxs)(`div`,{"data-pibo-debug":`web-annotation-chip`,"data-web-annotation-id":e.id,"data-web-annotation-session-id":e.piboSessionId,"data-web-annotation-selected":r?`true`:`false`,className:`min-w-0 rounded-sm border px-3 py-2 text-xs ${r?`border-[#11a4d4] bg-[#11a4d4]/10`:`border-slate-800 bg-[#0e1116]`}`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-[11px] text-slate-500`,children:[e.status,` · `,e.targetKind]}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>s(e.id),"aria-pressed":r,"aria-label":`Include web annotation ${a}`,title:`${r?`Detach`:`Attach`} web annotation ${a}`,className:`inline-flex h-8 shrink-0 items-center gap-1 rounded-sm border px-2 text-[11px] sm:h-6 sm:px-1.5 ${r?`border-[#11a4d4] text-[#11a4d4]`:`border-slate-700 text-slate-300 hover:border-[#11a4d4] hover:text-[#11a4d4]`}`,children:[r?(0,I.jsx)(tr,{size:11}):(0,I.jsx)(Hn,{size:11}),` `,r?`Detach`:`Attach`]})]}),(0,I.jsx)(`div`,{className:`truncate text-slate-200`,title:e.primaryTarget||e.label||e.selector||e.id,children:RA(e.primaryTarget||e.label||e.selector||e.id,120)}),e.piboContext?(0,I.jsx)(`div`,{className:`truncate font-mono text-[11px] text-[#11a4d4]`,title:e.piboContext,children:RA(e.piboContext,140)}):null,(0,I.jsx)(`div`,{className:`truncate font-mono text-[11px] text-slate-500`,title:e.url,children:FA(e.url)}),(0,I.jsxs)(`div`,{className:`truncate font-mono text-[11px] text-slate-500`,title:LA(e),children:[`Source `,IA(e)]}),(0,I.jsx)(`div`,{className:`mt-1 line-clamp-2 text-slate-400`,title:e.note,children:RA(e.note,180)}),(0,I.jsx)(`div`,{className:`mt-1 text-[11px] text-slate-600`,children:zA(e.createdAt)})]},e.id)})}):(0,I.jsx)(`div`,{className:`rounded-sm border border-slate-800 bg-[#0e1116] px-3 py-2 text-xs text-slate-500`,"data-pibo-debug":`web-annotations-empty`,children:`No open annotations for this session.`})]})]}):null}function OA({piboSessionId:e,piboRoomId:t,disabled:n,panelVisible:r,onShowPanel:i,onHidePanel:a,onError:o}){let[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(``),[d,f]=(0,F.useState)(()=>pA()),[p,m]=(0,F.useState)([]),[h,g]=(0,F.useState)(`idle`),[_,v]=(0,F.useState)(!1),[y,b]=(0,F.useState)(null),x=(0,F.useRef)(null),S=(0,F.useRef)(null),C=()=>{c(!1),x.current?.focus()};(0,F.useEffect)(()=>{n&&c(!1)},[n]),(0,F.useEffect)(()=>{if(!s||n)return;S.current?.focus();let e=e=>{e.key===`Escape`&&(e.preventDefault(),C())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[s,n]),(0,F.useEffect)(()=>{mA(d)},[d]);let w=async()=>{if(e){g(`loading`),b(null);try{let e=await kC(d);m(e.targets.filter(e=>e.type===`page`||e.attachable)),g(`loaded`)}catch(e){let t=NA(e,`CDP unavailable`);m([]),g(`error`),b({kind:`error`,message:t}),o(t)}}},T=async n=>{if(!e)throw Error(`No active session context`);return jC(n.binding.id,AA({piboSessionId:e,piboRoomId:t,cdpUrl:d,annotationShortcut:hA()}))},E=async()=>{if(!(!e||_)){i(),v(!0),b({kind:`info`,message:`Injecting annotation overlay into this Pibo page…`});try{let n=await AC({piboSessionId:e,piboRoomId:t,url:window.location.href,title:document.title,sameOrigin:!0,annotationShortcut:hA()});if(!n.overlay)throw Error(`Overlay config missing from same-origin binding response`);await MA(n.overlay),b({kind:`success`,message:`Annotation overlay is ready on this Pibo page. Open the overlay controls or use the shortcut to start annotating.`}),o(null)}catch(e){let t=NA(e,`Current-page annotation failed`);b({kind:`error`,message:t}),o(t)}finally{v(!1)}}},D=async()=>{if(!e||_)return;i();let n=l.trim();if(!n){b({kind:`error`,message:`URL is required`});return}if(jA(n)){let e=`That looks like a CDP endpoint. Put it in CDP URL, and put the page you want to annotate in Annotate URL.`;b({kind:`error`,message:e}),o(e);return}v(!0),b({kind:`info`,message:`Opening target and injecting overlay…`});try{let r=await AC(AA({piboSessionId:e,piboRoomId:t,url:n,cdpUrl:d})),i=await T(r);b({kind:`success`,message:`Annotation overlay injected for ${PA(i.target??r.target,i.binding.url)}`}),u(``),o(null)}catch(e){let t=NA(e,`Annotation failed`);b({kind:`error`,message:t}),o(t)}finally{v(!1)}},O=async n=>{if(!(!e||_)){i(),v(!0),b({kind:`info`,message:`Binding selected target and injecting overlay…`});try{let r=await AC(AA({piboSessionId:e,piboRoomId:t,targetId:n.id,cdpUrl:d})),i=await T(r);b({kind:`success`,message:`Annotation overlay injected for ${PA(i.target??n,i.binding.url)}`}),o(null)}catch(e){let t=NA(e,n.attachable?`Target annotation failed`:`Target not attachable`);b({kind:`error`,message:t}),o(t)}finally{v(!1)}}};return(0,I.jsxs)(`div`,{className:`relative`,"data-pibo-debug":`web-annotations-entry`,"data-pibo-session-id":e??void 0,children:[(0,I.jsx)(kA,{buttonRef:x,onClick:()=>{n||(c(e=>!e),r||i())},title:n?`Select an active session to annotate a web page`:r?`Web Annotations`:`Show Web Annotations`,ariaLabel:`Web Annotations`,ariaHaspopup:`dialog`,ariaExpanded:s,ariaControls:TA,disabled:n,active:s||r,children:(0,I.jsx)(tn,{size:14})}),s&&!n?(0,I.jsxs)(`div`,{id:TA,className:`fixed inset-x-2 bottom-3 z-40 max-h-[calc(100svh-1.5rem)] overflow-y-auto rounded-sm border border-slate-700 bg-[#0e1116] p-3 text-sm shadow-xl sm:absolute sm:inset-auto sm:right-0 sm:top-full sm:bottom-auto sm:mt-2 sm:w-[min(420px,calc(100vw-24px))] sm:max-h-[calc(100svh-5rem)]`,role:`dialog`,"aria-label":`Web Annotations`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-xs font-bold uppercase tracking-wider text-[#11a4d4]`,children:`Web Annotations`}),(0,I.jsx)(`div`,{className:`mt-1 text-xs text-slate-500`,children:`Start an inactive overlay for this Pibo page, or bind a CDP target for external pages.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:r?a:i,className:`rounded-sm p-1 text-slate-500 hover:bg-slate-800 hover:text-slate-200`,"aria-label":r?`Hide annotation list`:`Show annotation list`,title:r?`Hide annotation list`:`Show annotation list`,children:(0,I.jsx)(Gn,{size:14})}),(0,I.jsx)(`button`,{type:`button`,onClick:C,className:`rounded-sm p-1 text-slate-500 hover:bg-slate-800 hover:text-slate-200`,"aria-label":`Close Web Annotations panel`,children:(0,I.jsx)(tr,{size:14})})]})]}),(0,I.jsx)(`button`,{ref:S,type:`button`,onClick:()=>void E(),disabled:_,className:`mb-3 h-10 w-full rounded-sm bg-emerald-600 px-3 text-xs font-medium text-white hover:bg-emerald-500 disabled:opacity-50 sm:h-9`,"data-pibo-debug":`web-annotations-current-page`,children:`Annotate this Pibo page`}),(0,I.jsx)(`label`,{className:`mb-2 block text-[11px] font-bold uppercase tracking-wider text-slate-500`,htmlFor:`web-annotation-url`,children:`Annotate URL via CDP`}),(0,I.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-[1fr_auto]`,children:[(0,I.jsx)(`input`,{id:`web-annotation-url`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&D()},placeholder:`http://localhost:5173`,disabled:_,className:`h-10 min-w-0 rounded-sm border border-slate-700 bg-[#151f24] px-2 text-base text-slate-100 outline-none focus:border-[#11a4d4] disabled:opacity-60 sm:h-9 sm:text-xs`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>void D(),disabled:_||!l.trim(),className:`h-10 rounded-sm bg-[#11a4d4] px-3 text-xs font-medium text-white disabled:opacity-50 sm:h-9`,children:`Annotate`})]}),(0,I.jsx)(`label`,{className:`mt-3 mb-1 block text-[11px] font-bold uppercase tracking-wider text-slate-500`,htmlFor:`web-annotation-cdp-url`,children:`CDP URL (optional)`}),(0,I.jsx)(`input`,{id:`web-annotation-cdp-url`,value:d,onChange:e=>f(e.target.value),placeholder:`Use gateway default`,disabled:_,className:`h-10 w-full rounded-sm border border-slate-800 bg-[#151f24] px-2 font-mono text-base text-slate-300 outline-none focus:border-[#11a4d4] disabled:opacity-60 sm:h-8 sm:text-[11px]`}),(0,I.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-bold uppercase tracking-wider text-slate-500`,children:`Existing targets`}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>void w(),disabled:_||h===`loading`,className:`inline-flex h-7 items-center gap-1 rounded-sm border border-slate-700 px-2 text-[11px] text-slate-300 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-50`,children:[(0,I.jsx)(Un,{size:12,className:h===`loading`?`animate-spin`:void 0}),` Refresh`]})]}),(0,I.jsxs)(`div`,{className:`mt-2 max-h-[min(34svh,14rem)] overflow-auto rounded-sm border border-slate-800 sm:max-h-56`,children:[h===`idle`?(0,I.jsx)(`div`,{className:`px-3 py-3 text-xs text-slate-500`,children:`Refresh to list reachable browser targets.`}):null,h===`loading`?(0,I.jsx)(`div`,{className:`px-3 py-3 text-xs text-slate-400`,children:`Loading targets…`}):null,h===`loaded`&&!p.length?(0,I.jsx)(`div`,{className:`px-3 py-3 text-xs text-slate-500`,children:`No attachable browser targets found.`}):null,p.map(e=>(0,I.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 border-b border-slate-800 px-3 py-2 last:border-b-0 sm:grid-cols-[1fr_auto]`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`truncate text-xs text-slate-200`,title:e.title||e.url,children:RA(e.title||`Untitled target`,120)}),(0,I.jsx)(`div`,{className:`truncate font-mono text-[11px] text-slate-500`,title:e.url,children:RA(e.url||e.id,160)})]}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>void O(e),disabled:_||!e.attachable,title:e.attachable?`Attach selected target`:`Target is not attachable`,className:`h-9 rounded-sm border border-slate-700 px-2 text-[11px] text-slate-300 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-40 sm:h-8`,children:`Attach`})]},e.id))]}),y?(0,I.jsx)(`div`,{className:`mt-2 rounded-sm border px-2 py-2 text-xs ${y.kind===`error`?`border-red-900 bg-red-950/40 text-red-200`:y.kind===`success`?`border-emerald-900/60 bg-emerald-950/30 text-emerald-300`:`border-slate-700 bg-[#151f24] text-slate-300`}`,children:y.message}):null]}):null]})}function kA({buttonRef:e,title:t,ariaLabel:n,ariaHaspopup:r,ariaExpanded:i,ariaControls:a,disabled:o,active:s,onClick:c,children:l}){return(0,I.jsx)(`button`,{ref:e,type:`button`,onClick:c,disabled:o,title:t,"aria-label":n,"aria-haspopup":r,"aria-expanded":i,"aria-controls":a,className:`h-8 w-8 inline-flex items-center justify-center border rounded-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${s?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#11a4d4]`:`border-slate-700 text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`}`,children:l})}function AA(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e&&e.trim()))}function jA(e){try{let t=new URL(e);return t.port===`56663`||t.pathname.startsWith(`/json/`)}catch{return!1}}function MA(e){return new Promise((t,n)=>{let r=window;try{r.__piboWebAnnotations?.remove?.(),r.__piboWebAnnotationConfig=e;let i=document.createElement(`script`);i.src=`/apps/web-annotations/overlay.js?ts=${Date.now()}`,i.async=!0,i.onload=()=>t(),i.onerror=()=>n(Error(`Could not load Web Annotation overlay script`)),document.head.appendChild(i)}catch(e){n(e)}})}function NA(e,t){let n=BA(e);return!n||n===`undefined`?t:/target.*not found|selected cdp target/i.test(n)?`Target not found: ${n}`:/inject|overlay|evaluation/i.test(n)?`Injection failed: ${n}`:/cdp endpoint.*is unreachable|failed to fetch|fetch failed|chrome target discovery|cdp unavailable|econnrefused|connect/i.test(n)?`CDP unavailable: ${n}`:`${t}: ${n}`}function PA(e,t){let n=e?.url||t||e?.title||`target`;return FA(e?.title||n)}function FA(e){try{let t=new URL(e);return`${t.host}${t.pathname===`/`?``:t.pathname}`}catch{return RA(e,80)}}function IA(e){return e.piboRoomId?`${RA(e.piboSessionId,24)} · room ${RA(e.piboRoomId,18)}`:RA(e.piboSessionId,44)}function LA(e){return e.piboRoomId?`Session ${e.piboSessionId} in room ${e.piboRoomId}`:`Session ${e.piboSessionId}`}function RA(e,t){return e.length>t?`${e.slice(0,Math.max(0,t-1))}…`:e}function zA(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{dateStyle:`short`,timeStyle:`short`})}function BA(e){return e instanceof Error?e.message:String(e)}function VA(e){return!!e.workflowRunId||e.state===`workflow`||e.workflowId!==`simple-chat`}function HA(e,t){return{workflowId:e.workflowId,state:WA(e,t),...e.workflowRunId?{workflowRunId:e.workflowRunId}:{}}}function UA({summary:e}){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-slate-600`,children:`·`}),(0,I.jsxs)(`span`,{className:`min-w-0 max-w-52 truncate rounded border border-[#11a4d4]/35 bg-[#11a4d4]/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-[#11a4d4]`,title:e.workflowId,children:[`workflow `,e.workflowId]}),(0,I.jsxs)(`span`,{className:GA(e.state),children:[`state `,e.state]}),e.workflowRunId?(0,I.jsxs)(`span`,{className:`min-w-0 max-w-40 truncate rounded border border-slate-700 bg-slate-900/40 px-1.5 py-0.5 text-[10px] text-slate-400`,title:e.workflowRunId,children:[`run `,KA(e.workflowRunId)]}):null]})}function WA(e,t){return e.archived?`archived`:e.state&&e.state!==`workflow`?e.state.replace(/_/g,` `):t===`running`?`running`:t===`error`?`failed`:e.state?e.state.replace(/_/g,` `):e.workflowRunId?`workflow`:e.kind}function GA(e,t=!1){let n=e.toLowerCase(),r=`shrink-0 rounded border px-1.5 py-0.5 text-[10px] uppercase tracking-wide`;return t?`${r} border-slate-700 text-slate-500`:n.includes(`failed`)||n.includes(`error`)?`${r} border-red-500/40 text-red-300 bg-red-500/10`:n.includes(`waiting`)?`${r} border-amber-500/40 text-amber-300 bg-amber-500/10`:n.includes(`complete`)||n.includes(`done`)?`${r} border-emerald-500/40 text-emerald-300 bg-emerald-500/10`:`${r} border-[#11a4d4]/40 text-[#11a4d4] bg-[#11a4d4]/10`}function KA(e){return e.length>18?`${e.slice(0,10)}…${e.slice(-6)}`:e}function qA({title:e,roomLabel:t,headerPiboSessionId:n,piboSessionId:r,piboRoomId:i,webAnnotationsDisabled:a,webAnnotationsPanelRendered:o,workflowHeader:s,sessionViewId:c,sessionViews:l,currentSessionView:u,allowedSessionViewIds:d,extraViewTabs:f,activeViewId:p,terminalFullscreenAvailable:m,onEnterTerminalFullscreen:h,onOpenSessionWindow:g,showRawEvents:_,showThinking:v,expandThinking:y,toolDisplayMode:b,toolIntentSupported:x,onToolDisplayModeChange:S,onShowWebAnnotationsPanel:C,onHideWebAnnotationsPanel:w,onSelectSessionView:T,onToggleRawEvents:E,onToggleThinking:D,onToggleExpandThinking:O,onError:k}){let[ee,te]=(0,F.useState)(null),ne=(0,F.useRef)(void 0),A=ee===n,j=p??c,re=(0,F.useMemo)(()=>d?new Set(d):null,[d]);(0,F.useEffect)(()=>()=>{ne.current&&window.clearTimeout(ne.current)},[]);let M=()=>{n&&(zk(n).catch(()=>void 0),te(n),ne.current&&window.clearTimeout(ne.current),ne.current=window.setTimeout(()=>te(null),900))};return(0,I.jsxs)(`div`,{className:`h-14 px-4 bg-[#151f24] border-b border-slate-800 flex items-center justify-between max-[980px]:h-auto max-[980px]:flex-wrap max-[980px]:py-2 max-[980px]:gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`h1`,{className:`text-base font-semibold truncate`,children:e}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 font-mono text-[11px] text-slate-500`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:t}),n?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-slate-600`,children:`·`}),(0,I.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>void M(),title:A?`Copied Pibo session ID`:`Copy Pibo session ID`,"aria-label":A?`Copied Pibo session ID`:`Copy Pibo session ID`,className:`min-w-0 max-w-48 truncate rounded-sm px-1 font-mono underline-offset-2 transition-colors duration-150 focus:outline-none focus:ring-1 focus:ring-[#11a4d4] ${A?`bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-400/50`:`text-slate-400 hover:text-[#11a4d4] hover:underline`}`,children:n})]}):null,s?(0,I.jsx)(UA,{summary:s}):null]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(OA,{piboSessionId:r,piboRoomId:i,disabled:a,panelVisible:o,onShowPanel:C,onHidePanel:w,onError:k}),g?(0,I.jsx)(`button`,{type:`button`,onClick:g,title:`Open selected session in new window`,"aria-label":`Open selected session in new window`,"data-pibo-debug":`open-session-window`,className:`h-8 w-8 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 transition-colors hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,I.jsx)(Hn,{size:15})}):null,(0,I.jsxs)(`select`,{value:b,onChange:e=>S(e.target.value),title:`Tool display mode`,"aria-label":`Tool display mode`,"data-pibo-debug":`tool-display-mode`,className:`h-8 rounded-sm border border-slate-700 bg-[#0e1116] px-2 text-[11px] font-bold uppercase tracking-wide text-slate-300 outline-none focus:border-[#11a4d4]`,children:[(0,I.jsx)(`option`,{value:`default`,children:`Tools: Default`}),(0,I.jsx)(`option`,{value:`hide`,children:`Tools: Hide`}),(0,I.jsx)(`option`,{value:`slim`,children:`Tools: Slim`}),(0,I.jsx)(`option`,{value:`intent`,disabled:!x,children:`Tools: Intent`})]}),(0,I.jsxs)(`div`,{role:`group`,"aria-label":`Session views`,className:`flex items-center rounded-sm border border-slate-700 bg-[#0e1116] p-0.5`,children:[l.map(e=>{let t=!!(re&&!re.has(e.id));return(0,I.jsx)(`button`,{type:`button`,onClick:()=>{t||T(e.id)},disabled:t,title:t?`Project session routing uses the ${u.label} view for this session kind.`:e.description??e.label,"aria-label":t?`${e.label} view unavailable for this Project session kind`:`Switch to ${e.label} view`,"aria-pressed":j===e.id,className:`min-w-20 px-2.5 py-1 text-[11px] font-bold tracking-wide max-[980px]:min-w-0 max-[980px]:px-1.5 disabled:cursor-not-allowed disabled:text-slate-600 ${j===e.id?`bg-[#11a4d4]/10 text-[#11a4d4]`:`text-slate-400 hover:text-[#11a4d4] disabled:hover:text-slate-600`}`,children:e.label},e.id)}),f?.map(e=>{let t=e.active??j===e.id;return(0,I.jsx)(`button`,{type:`button`,onClick:()=>{e.disabled||e.onSelect()},disabled:e.disabled,title:e.description??e.label,"aria-label":e.disabled?`${e.label} view unavailable`:`Switch to ${e.label} view`,"aria-pressed":t,className:`min-w-20 px-2.5 py-1 text-[11px] font-bold tracking-wide max-[980px]:min-w-0 max-[980px]:px-1.5 disabled:cursor-not-allowed disabled:text-slate-600 ${t?`bg-[#11a4d4]/10 text-[#11a4d4]`:`text-slate-400 hover:text-[#11a4d4] disabled:hover:text-slate-600`}`,children:e.label},e.id)})]}),m&&h?(0,I.jsx)(`button`,{type:`button`,onClick:h,title:`Enter Terminal fullscreen`,"aria-label":`Enter Terminal fullscreen`,"data-pibo-debug":`enter-terminal-fullscreen`,className:`h-8 w-8 inline-flex items-center justify-center border border-slate-700 rounded-sm text-slate-400 transition-colors hover:border-[#11a4d4] hover:text-[#11a4d4]`,children:(0,I.jsx)(Rn,{size:14})}):null,(0,I.jsx)(JA,{onClick:E,title:_?`Hide Raw Events`:`Show Raw Events`,ariaLabel:`Raw Events`,active:_,children:(0,I.jsx)(an,{size:14})}),(0,I.jsx)(JA,{onClick:D,title:v?`Hide Thinking`:`Show Thinking`,ariaLabel:`Thinking`,active:v,children:v?(0,I.jsx)(rn,{size:14}):(0,I.jsx)(wn,{size:14})}),v?(0,I.jsx)(JA,{onClick:O,title:y?`Collapse Thinking`:`Expand Thinking`,ariaLabel:`Thinking expansion`,active:y,children:y?(0,I.jsx)(un,{size:14}):(0,I.jsx)(fn,{size:14})}):null]})]})}function JA({title:e,ariaLabel:t,active:n,onClick:r,children:i}){return(0,I.jsx)(`button`,{type:`button`,onClick:r,title:e,"aria-label":t,"aria-pressed":n,className:`h-8 w-8 inline-flex items-center justify-center border rounded-sm transition-colors ${n?`border-[#11a4d4] bg-[#11a4d4]/10 text-[#11a4d4]`:`border-slate-700 text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4]`}`,children:i})}function YA(e){let t=[];for(let n of e){let e=t[t.length-1];if(e&&XA(e,n)){e.count+=1,e.createdAt=n.createdAt,e.payload={...$A(e.payload)?e.payload:{},text:`${ZA(e.payload)}${ZA(n.payload)}`};continue}t.push({...n,count:1})}return t}function XA(e,t){if(e.type!==t.type||e.type!==`assistant_delta`&&e.type!==`thinking_delta`&&e.type!==`TEXT_MESSAGE_CONTENT`&&e.type!==`REASONING_MESSAGE_CONTENT`)return!1;let n=$A(e.payload)?e.payload:{},r=$A(t.payload)?t.payload:{};return QA(n)===QA(r)}function ZA(e){return $A(e)?typeof e.text==`string`?e.text:typeof e.delta==`string`?e.delta:``:``}function QA(e){return e.eventId??e.messageId}function $A(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function ej({traceView:e,eventLimit:t,isFetching:n,visible:r,onLoadOlder:i}){let a=(0,F.useMemo)(()=>r?YA(e?.rawEvents??[]):[],[e?.rawEvents,r]);return r?(0,I.jsxs)(`aside`,{className:`min-h-0 overflow-auto bg-[#0e1116] border-l border-slate-800 max-[980px]:hidden`,children:[(0,I.jsx)(`div`,{className:`h-11 px-3 border-b border-slate-800 flex items-center text-xs font-bold uppercase tracking-wider`,children:`Raw Events`}),(0,I.jsxs)(`div`,{className:`p-3 flex flex-col gap-2`,children:[e&&a.length>=t?(0,I.jsx)(`button`,{type:`button`,onClick:i,disabled:n,className:`mb-1 rounded-sm border border-slate-700 px-2 py-1 text-xs text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:opacity-60`,children:n?`Loading raw events…`:`Load older raw events (${a.length})`}):null,a.slice(-t).reverse().map(e=>(0,I.jsxs)(`div`,{className:`border-l-2 border-[#11a4d4] bg-[#151f24] p-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-[#11a4d4] font-mono text-[11px] mb-1`,children:[(0,I.jsx)(`span`,{children:e.type}),e.count>1?(0,I.jsxs)(`span`,{className:`text-slate-500`,children:[`x`,e.count]}):null]}),(0,I.jsx)(Yu,{value:e.payload,showControls:!1})]},e.id))]})]}):null}function tj({title:e,onOpenSessionWindow:t,onExit:n}){return(0,I.jsxs)(`div`,{"data-pibo-debug":`terminal-fullscreen-top-bar`,className:`h-7 min-h-7 flex items-center border-b border-slate-600 bg-[#151f24]`,children:[(0,I.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-base font-semibold leading-none`,children:e}),t?(0,I.jsx)(`button`,{type:`button`,onClick:t,title:`Open selected session in new window`,"aria-label":`Open selected session in new window`,"data-pibo-debug":`open-session-window`,className:`h-full w-7 shrink-0 inline-flex items-center justify-center text-slate-400 hover:bg-[#11a4d4]/10 hover:text-[#11a4d4]`,children:(0,I.jsx)(Hn,{size:14})}):null,(0,I.jsx)(`button`,{type:`button`,onClick:n,title:`Show normal top bar`,"aria-label":`Exit Terminal fullscreen`,className:`h-full w-7 shrink-0 inline-flex items-center justify-center text-slate-400 hover:bg-[#11a4d4]/10 hover:text-[#11a4d4]`,children:(0,I.jsx)(Vn,{size:14})})]})}function nj({enabled:e,onFilesDropped:t,children:n,className:r,...i}){let a=(0,F.useRef)(0),[o,s]=(0,F.useState)(!1),[c,l]=(0,F.useState)(0),u=c>0;(0,F.useEffect)(()=>{e||(a.current=0,s(!1))},[e]);let d=()=>{a.current=0,s(!1)},f=t=>ij(t.dataTransfer)?(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect=e&&!u?`copy`:`none`,!0):!1,p=t=>{!f(t)||!e||u||(a.current+=1,s(!0))},m=e=>{f(e)},h=e=>{!f(e)||a.current===0||(a.current=Math.max(0,a.current-1),a.current===0&&s(!1))},g=async n=>{if(!f(n)||(d(),!e||u))return;let r=aj(n.dataTransfer);if(r.length){l(r.length);try{await t(r)}finally{l(0)}}},_=u?`uploading`:o?`drag-active`:`idle`;return(0,I.jsxs)(`main`,{...i,"data-pibo-file-drop-state":_,className:`relative ${r??``}`,onDragEnter:p,onDragOver:m,onDragLeave:h,onDragEnd:d,onDrop:g,children:[n,o||u?(0,I.jsx)(rj,{uploadingFileCount:c}):null]})}function rj({uploadingFileCount:e}){let t=e>0;return(0,I.jsx)(`div`,{"data-pibo-debug":`terminal-file-drop-overlay`,"data-pibo-state":t?`uploading`:`drag-active`,role:`status`,"aria-live":`polite`,className:`pointer-events-none absolute inset-0 z-40 grid place-items-center bg-[#071015]/90 p-6 backdrop-blur-[2px]`,children:(0,I.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center rounded-sm border border-dashed border-[#11a4d4] bg-[#0e1116]/95 px-8 py-7 text-center shadow-2xl shadow-black/50`,children:[t?(0,I.jsx)(In,{size:36,className:`mb-3 animate-spin text-[#11a4d4]`,"aria-hidden":`true`}):(0,I.jsx)($n,{size:36,className:`mb-3 text-[#11a4d4]`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`text-sm font-semibold text-slate-100`,children:t?`Uploading ${e} file${e===1?``:`s`}…`:`Drop files to upload`}),(0,I.jsx)(`span`,{className:`mt-1 text-xs leading-5 text-slate-400`,children:t?`Saving to the Pibo uploads directory`:`Images and other files will be attached to your next message.`})]})})}function ij(e){return Array.from(e.types).includes(`Files`)||Array.from(e.items).some(e=>e.kind===`file`)}function aj(e){return Array.from(e.files)}function oj({selectedPiboSessionId:e,selectedRoomId:t,fallbackRoomId:n,sessionViewId:r,loadingTrace:i,roomNavigationPending:a=!1,sessionNavigationPending:o=!1,traceError:s,showRawEvents:c,currentTraceView:l,rawEventLimit:u,tracePageFetching:d,onLoadMoreRawEvents:f,terminalFullscreen:p,terminalFileDropEnabled:m,onTerminalFilesDropped:h,onOpenSessionWindow:g,onExitTerminalFullscreen:_,headerProps:v,projectSessionCreatePanel:y,workflowStartPanel:b,projectModulePanel:x,currentSessionView:S,sessionViewProps:C,webAnnotationsPanelRendered:w,webAnnotationsPanelProps:T,runtimeRequestPanel:E,composerProps:D}){let O=a||o&&!l||i;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(nj,{enabled:m,onFilesDropped:h,"data-pibo-debug":`chat-shell`,"data-pibo-session-id":e??void 0,"data-pibo-room-id":t??n??void 0,"data-pibo-view-id":r,"data-pibo-state":a?`room-loading`:o?`session-loading`:i?`loading`:s?`error`:e?`ready`:`empty`,"data-pibo-terminal-fullscreen":p?`true`:`false`,className:`min-h-0 h-full flex flex-col`,children:[p?(0,I.jsx)(tj,{title:v.title,onOpenSessionWindow:g,onExit:_}):(0,I.jsx)(qA,{...v}),!p&&y?(0,I.jsx)(`div`,{className:`border-b border-slate-800 bg-[#101d22] px-4 py-3`,children:y}):null,!p&&b?(0,I.jsx)(`div`,{className:`border-b border-slate-800 bg-[#101d22] px-4 py-3`,children:b}):null,!p&&x?x:O?(0,I.jsx)(sj,{label:a?`Loading room`:`Loading session`}):s&&!l?(0,I.jsx)(`div`,{className:`min-h-0 flex-1 p-4 text-sm text-red-200`,children:s}):S.render({...C,terminalFullscreen:p}),!p&&w?(0,I.jsx)(DA,{...T}):null,E,(0,I.jsx)(Kk,{...D})]}),(0,I.jsx)(ej,{traceView:l,eventLimit:u,isFetching:d,visible:c&&!p,onLoadOlder:f})]})}function sj({label:e}){return(0,I.jsx)(`section`,{"data-pibo-debug":`room-navigation-loading`,className:`relative min-w-0 flex-1 overflow-hidden bg-[#0b0b0b] text-[#d4d4d4]`,"aria-live":`polite`,"aria-label":e,children:(0,I.jsx)(`div`,{className:`min-h-0 h-full overflow-hidden font-mono text-[12px] leading-[1.45]`,children:(0,I.jsxs)(`div`,{className:`px-4`,children:[(0,I.jsx)(`div`,{className:`group border-b border-[#141414] py-2`,children:(0,I.jsxs)(`div`,{className:`grid grid-cols-[1.9rem_minmax(0,1fr)] gap-2 leading-[1.45]`,children:[(0,I.jsx)(`span`,{className:`flex items-center text-[#38bdf8]`,children:(0,I.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-[#38bdf8] animate-pulse`})}),(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`font-semibold text-[#d4d4d4]`,children:e}),(0,I.jsx)(`span`,{className:`h-2 w-24 rounded-sm bg-[#262626] animate-pulse`})]})]})}),[{kind:`tool`,lines:5},{kind:`markdown`,lines:4},{kind:`command`,lines:4},{kind:`tool`,lines:3},{kind:`markdown`,lines:5}].map((e,t)=>(0,I.jsx)(cj,{kind:e.kind,lineCount:e.lines},t))]})})})}function cj({kind:e,lineCount:t}){let n=e===`command`,r=e===`markdown`;return(0,I.jsx)(`div`,{className:`group border-b border-[#141414] py-2 animate-pulse ${n?`bg-[#f59e0b]/5`:``}`,"aria-hidden":`true`,children:Array.from({length:t}).map((e,i)=>(0,I.jsxs)(`div`,{className:`grid grid-cols-[1.9rem_minmax(0,1fr)] gap-2 leading-[1.45]`,children:[(0,I.jsx)(`span`,{className:`flex items-center text-[#737373]`,children:i===0&&!r?(0,I.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${n?`bg-[#f59e0b]`:`bg-[#22c55e]`}`}):i>0&&!r?(0,I.jsx)(`span`,{className:`text-[10px]`,children:`L`}):null}),(0,I.jsx)(`span`,{className:`min-w-0 py-[3px]`,children:i===0?(0,I.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`h-[13px] rounded-sm ${r?`w-56 bg-[#d4d4d4]/45`:n?`w-28 bg-[#f59e0b]/65`:`w-24 bg-[#22c55e]/65`}`}),r?null:(0,I.jsx)(`span`,{className:`h-[13px] w-64 rounded-sm bg-[#262626]`})]}):(0,I.jsx)(`span`,{className:`block h-[10px] rounded-sm bg-[#262626] ${i===t-1?`w-[42%]`:i%2==0?`w-[72%]`:`w-[58%]`}`})})]},i))})}var lj=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function uj({title:e,description:t,onClose:n,initialFocusRef:r,children:i,closeLabel:a=`Close dialog`,closeDisabled:o=!1}){let s=(0,F.useId)(),c=(0,F.useId)(),l=(0,F.useRef)(null);return(0,F.useEffect)(()=>{let e=document.activeElement instanceof HTMLElement?document.activeElement:null,t=window.requestAnimationFrame(()=>{(r?.current??l.current?.querySelector(lj)??l.current)?.focus()});return()=>{window.cancelAnimationFrame(t),e?.isConnected&&e.focus()}},[r]),(0,I.jsx)(`div`,{className:`fixed inset-0 z-50 grid place-items-center bg-black/70 p-4`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":s,"aria-describedby":c,onClick:e=>{!o&&e.target===e.currentTarget&&n()},onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),o||n();return}if(e.key!==`Tab`)return;let t=Array.from(l.current?.querySelectorAll(lj)??[]);if(t.length===0){e.preventDefault(),l.current?.focus();return}let r=t[0],i=t[t.length-1],a=document.activeElement;t.includes(a)?e.shiftKey&&a===r?(e.preventDefault(),i.focus()):!e.shiftKey&&a===i&&(e.preventDefault(),r.focus()):(e.preventDefault(),(e.shiftKey?i:r).focus())},children:(0,I.jsxs)(`div`,{ref:l,tabIndex:-1,className:`max-h-[calc(100vh-2rem)] w-full max-w-lg overflow-y-auto rounded-sm border border-slate-700 bg-[#1a262b] text-slate-200 shadow-2xl outline-none`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-slate-800 px-4 py-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:s,className:`text-sm font-bold uppercase tracking-wider text-slate-100`,children:e}),(0,I.jsx)(`p`,{id:c,className:`mt-1 text-xs text-slate-400`,children:t})]}),(0,I.jsx)(`button`,{type:`button`,onClick:n,disabled:o,"aria-label":a,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-sm border border-slate-700 text-slate-400 hover:border-[#11a4d4] hover:text-[#11a4d4] disabled:cursor-not-allowed disabled:opacity-50`,children:(0,I.jsx)(tr,{size:14})})]}),i]})})}function dj(e){let t=new Map;if(gj(e.nodes,t),!t.size)return e;let{nodes:n,changed:r}=_j(e.nodes,t);return r?{...e,nodes:n}:e}function fj(e){return e.some(hj)}function pj(e){let t=new Map;return bj(e,e=>{if(e.type!==`user.message`||!e.entryId)return;let n=xj(e),r=t.get(n);r?r.push(e.entryId):t.set(n,[e.entryId])}),t}function mj(e,t){if(!t.size)return;let n=new Map;bj(e,e=>{if(e.type!==`user.message`||!e.entryId)return;let t=xj(e),r=n.get(t)??new Set;r.add(e.entryId),n.set(t,r)});let r=new Map;bj(e,e=>{if(e.type!==`user.message`||e.entryId)return;let i=xj(e),a=t.get(i);if(!a?.length)return;let o=n.get(i)??new Set,s=r.get(i)??0;for(;s<a.length&&o.has(a[s]);)s+=1;let c=a[s];c&&(e.entryId=c,o.add(c),n.set(i,o),r.set(i,s+1))})}function hj(e){let t=e.payload;return!!(t&&typeof t==`object`&&!Array.isArray(t)&&`type`in t&&(t.type===`message_queued`||t.type===`message_steered`)&&`source`in t&&t.source===`user`&&`text`in t&&typeof t.text==`string`)}function gj(e,t){for(let n of e){if(n.type===`user.message`&&!yj(n)&&!vj(n)){let e=xj(n);e&&t.set(e,(t.get(e)??0)+1)}gj(n.children,t)}}function _j(e,t){let n=!1,r=[];for(let i of e){if(yj(i)){let e=xj(i),r=e?t.get(e)??0:0;if(r>0){t.set(e,r-1),n=!0;continue}}let e=_j(i.children,t);n||=e.changed,r.push(e.changed?{...i,children:e.nodes}:i)}return{nodes:n?r:e,changed:n}}function vj(e){return[e.id,e.stableKey].some(e=>e?.startsWith(`event:message_queued:`)||e?.startsWith(`event:message_steered:`))}function yj(e){return e.type===`user.message`?e.source===`event-log`&&(e.id.startsWith(`event:message_queued:`)||e.id.startsWith(`event:message_steered:`))?!0:[e.id,e.stableKey,e.eventId].filter(e=>typeof e==`string`).some(e=>e.startsWith(`optimistic:user-message:`)||e.includes(`:optimistic:user-message:`)):!1}function bj(e,t){for(let n of e)t(n),bj(n.children,t)}function xj(e){return typeof e.output==`string`?e.output:typeof e.summary==`string`?e.summary:``}function Sj(e,t,n){return t&&e.set(t.piboSessionId,t),n?e.get(n)??null:null}function Cj(e,t,n){t&&t.piboSessionId!==n.piboSessionId&&e.set(t.piboSessionId,t);let r=wj(t?.piboSessionId===n.piboSessionId?t:e.get(n.piboSessionId)??null,n);return r?e.set(n.piboSessionId,r):e.delete(n.piboSessionId),r}function wj(e,t){if(!e||e.piboSessionId!==t.piboSessionId)return e;let n=Dj(t),r=Tj(t.nodes),i=e.events.filter(e=>{let i=Mj(e);if(i&&n.has(i))return!1;if(hj(e)){let t=r.get(e.payload.text)??0;if(t>0)return t===1?r.delete(e.payload.text):r.set(e.payload.text,t-1),!1}return!Aj(t,e)});return i.length?{...e,events:i}:null}function Tj(e){let t=new Map;for(let n of e){if(n.type===`user.message`&&kj(n)&&!Ej(n)){let e=Fj(n);e&&t.set(e,(t.get(e)??0)+1)}for(let[e,r]of Tj(n.children))t.set(e,(t.get(e)??0)+r)}return t}function Ej(e){return[e.id,e.stableKey].some(e=>e?.startsWith(`event:message_queued:`)||e?.startsWith(`event:message_steered:`))}function Dj(e){let t=new Set;for(let n of e.rawEvents){let e=Mj(n);e&&t.add(e)}return Oj(e.nodes,t),t}function Oj(e,t){for(let n of e){if(n.type===`user.message`)for(let e of[`message_queued`,`message_steered`]){let r=`event:${e}:`,i=n.id.startsWith(r)?n.id.slice(r.length):void 0;i&&t.add(`${n.piboSessionId}:${e}:${i}`),kj(n)&&n.entryId&&t.add(`${n.piboSessionId}:${e}:${n.entryId}`)}if(n.type===`assistant.message`){let e=Nj(n,`assistant:`);e&&(t.add(`${n.piboSessionId}:assistant_delta:${e}`),(kj(n)||n.completedAt!==void 0)&&t.add(`${n.piboSessionId}:assistant_message:${e}`)),kj(n)&&n.eventId&&(t.add(`${n.piboSessionId}:message_started:${n.eventId}`),t.add(`${n.piboSessionId}:message_finished:${n.eventId}`))}if(n.type===`model.reasoning`){let e=Nj(n,`reasoning:`);e&&(t.add(`${n.piboSessionId}:thinking_delta:${e}`),kj(n)&&(t.add(`${n.piboSessionId}:thinking_started:${e}`),t.add(`${n.piboSessionId}:thinking_finished:${e}`)))}if(n.toolCallId&&(n.type===`tool.call`||n.type===`tool.result`||n.type===`agent.delegation`)){let e=`tool:${n.toolCallId}`;t.add(`${n.piboSessionId}:tool_call:${e}`);let r=n.completedAt!==void 0||n.type===`tool.result`||n.status===`error`;(n.status===`running`||n.output!==void 0||r)&&t.add(`${n.piboSessionId}:tool_execution_started:${e}`),(n.output!==void 0&&!r||r)&&t.add(`${n.piboSessionId}:tool_execution_updated:${e}`),r&&t.add(`${n.piboSessionId}:tool_execution_finished:${e}`)}Oj(n.children,t)}}function kj(e){return e.source===`transcript`||e.source===`product-history`}function Aj(e,t){let n=t.payload;if(!n||typeof n!=`object`||Array.isArray(n))return!1;let r=`source`in n?n.source:void 0,i=`text`in n?n.text:void 0;return r!==`service`||typeof i!=`string`||!Uw(i)?!1:jj(e,t)}function jj(e,t){let n=t.eventSequence;if(n===void 0||e.firstEventSequence===void 0)return!1;let r=e.lastEventSequence??e.eventCount;return r!==void 0&&n>=e.firstEventSequence&&n<=r}function Mj(e){let t=e.payload;if(!t||typeof t!=`object`||Array.isArray(t))return;let n=`eventId`in t&&typeof t.eventId==`string`?t.eventId:e.eventId,r=`piboSessionId`in t&&typeof t.piboSessionId==`string`?t.piboSessionId:e.piboSessionId;if(r){if(e.type===`tool_call`||e.type===`tool_execution_started`||e.type===`tool_execution_updated`||e.type===`tool_execution_finished`){let n=`toolCallId`in t&&typeof t.toolCallId==`string`?t.toolCallId:void 0;return n?`${r}:${e.type}:tool:${n}`:void 0}if(n){if(e.type===`assistant_delta`||e.type===`assistant_message`){let i=Pj(t,`assistantIndex`)??Pj(t,`contentIndex`),a=i===void 0?n:`${n}:assistant:${i}`;return`${r}:${e.type}:${a}`}if(e.type===`thinking_started`||e.type===`thinking_delta`||e.type===`thinking_finished`){let i=Pj(t,`thinkingIndex`)??Pj(t,`contentIndex`),a=i===void 0?n:`${n}:thinking:${i}`;return`${r}:${e.type}:${a}`}return`${r}:${e.type}:${n}`}}}function Nj(e,t){return e.stableKey?.startsWith(t)?e.stableKey.slice(t.length):e.eventId}function Pj(e,t){let n=t in e?e[t]:void 0;return typeof n==`number`&&Number.isFinite(n)?n:void 0}function Fj(e){return typeof e.output==`string`?e.output:e.output&&typeof e.output==`object`&&`text`in e.output&&typeof e.output.text==`string`?e.output.text:``}function Ij({selectedPiboSessionId:e,reconciledBaseTraceView:t,liveTraceOverlay:n,selectedSessionStatus:r,persistedUserMessageIndexForBaseTrace:i,now:a}){if(!e||t?.piboSessionId!==e)return{traceView:null};let o=(n?.piboSessionId===e?wj(n,t):null)?.events??[];if(!o.length)return{traceView:t};let s=a?.(),c=QT(t,o,r??`idle`),l=fj(o);return l&&mj(c.nodes,i),{traceView:l?dj(c):c,liveTraceComputeDurationMs:s!==void 0&&a?a()-s:void 0}}function Lj(e,t){for(let n of e)t(n),Lj(n.children,t)}function Rj(e){return typeof e.output==`string`?e.output:typeof e.summary==`string`?e.summary:``}function zj(e){if(!e)return;let t=0;return Lj(e.nodes,e=>{e.type===`assistant.message`&&(t+=Rj(e).length)}),t}function Bj({selectedPiboSessionId:e,baseTraceView:t,liveTraceOverlay:n,selectedSessionStatus:r}){let i=(0,F.useMemo)(()=>t?dj(t):null,[t]),a=(0,F.useMemo)(()=>i?pj(i.nodes):new Map,[i]),o=(0,F.useMemo)(()=>Ij({selectedPiboSessionId:e,reconciledBaseTraceView:i,liveTraceOverlay:n,selectedSessionStatus:r,persistedUserMessageIndexForBaseTrace:a,now:Yb()?()=>performance.now():void 0}),[n,e,r,i,a]),s=o.traceView;return(0,F.useEffect)(()=>{!e||!s?.piboSessionId||!Yb()||(ix(s.piboSessionId,{overlayEventCount:n?.piboSessionId===s.piboSessionId?n.events.length:0,traceBaseOutputLength:zj(t),currentOutputLength:zj(s)}),o.liveTraceComputeDurationMs!==void 0&&tx(s.piboSessionId,o.liveTraceComputeDurationMs))},[t,o.liveTraceComputeDurationMs,s,n,e]),(0,F.useEffect)(()=>{if(!s?.piboSessionId||!_S())return;let e=n?.piboSessionId===s.piboSessionId?n.events:[];CS({piboSessionId:s.piboSessionId,trigger:`trace-state:render`,baseTraceView:t,currentTraceView:s,overlayEvents:e,selectedSessionStatus:r})},[t,s,n,r]),(0,F.useEffect)(()=>{let e=()=>{if(!s?.piboSessionId||!_S())return;let e=n?.piboSessionId===s.piboSessionId?n.events:[];CS({piboSessionId:s.piboSessionId,trigger:`trace-state:tab:${document.visibilityState}`,baseTraceView:t,currentTraceView:s,overlayEvents:e,selectedSessionStatus:r})};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[t,s,n,r]),s}var Vj=1e4,Hj=3e5;function Uj(e){return[`chat`,`trace-summary`,e]}function Wj(e,t={}){let n=t.pageSize??t.eventLimit??50,r=t.beforeCursor??t.beforeSequence;return[`chat`,`trace-page`,e,t.includeRawEvents?`raw`:`compact`,t.rawEventsLimit??80,n,r===void 0?`tail`:String(r)]}function Gj(e,t){if(e.piboSessionId!==t.piboSessionId)return e;let n=new Set,r=[...t.rawEvents,...e.rawEvents].filter(e=>{let t=e.id||`${e.eventSequence??``}:${e.type}:${e.createdAt}`;return!n.has(t)&&(n.add(t),!0)});return{...e,version:e.version,nodes:nM(t.nodes,e.nodes),rawEvents:r,beforeCursor:t.beforeCursor??e.beforeCursor,firstEventSequence:t.firstEventSequence??e.firstEventSequence,nextBeforeSequence:t.nextBeforeSequence,nextBeforeCursor:t.nextBeforeCursor,hasOlderEvents:t.hasOlderEvents,eventLimit:(e.eventLimit??0)+(t.eventLimit??t.pageSize??0)}}function Kj(e,t){return e.piboSessionId===t.piboSessionId?{...t,nodes:qj(e.nodes,t),rawEvents:eM(e.rawEvents,t.rawEvents),beforeCursor:e.beforeCursor,firstEventSequence:e.firstEventSequence??t.firstEventSequence,nextBeforeSequence:e.nextBeforeSequence,nextBeforeCursor:e.nextBeforeCursor,hasOlderEvents:e.hasOlderEvents,eventLimit:e.eventLimit??t.eventLimit}:t}function qj(e,t){let n=Dw([...e]),r=Dw([...t.nodes]),i=new Set(r.map(e=>e.id)),a=Yj([...n,...r]),o=Zj(r),s=Qj(r),c=n.filter(e=>{if(i.has(e.id))return!0;if(e.type===`agent.turn`&&e.source===`event-log`&&e.eventId&&a.has(e.eventId)||Xj(e))return!1;let n=e.orderKey?.eventSequence;if(n!==void 0&&t.firstEventSequence!==void 0)return n<t.firstEventSequence;let r=e.orderKey?o.get(e.orderKey.sourceRank):void 0;if(e.orderKey&&r)return xw(e.orderKey,r)<0;if(e.source===`live`||e.orderKey?.streamId!==void 0)return!1;let c=$j(e.startedAt);return c!==void 0&&s!==void 0&&c<s}),l=new Set([...c,...r].map(e=>e.id)),u=new Set(n.filter(e=>!l.has(e.id)).map(e=>e.id));return nM(Jj(c,u),Jj(r,u))}function Jj(e,t){return e.map(e=>e.parentId&&t.has(e.parentId)?{...e,parentId:void 0}:e)}function Yj(e){let t=new Set;for(let n of e)(n.source===`transcript`||n.source===`product-history`)&&n.eventId&&t.add(n.eventId);return t}function Xj(e){return e.source===`live`||e.orderKey?.streamId!==void 0}function Zj(e){let t=new Map;for(let n of e){if(!n.orderKey)continue;let e=t.get(n.orderKey.sourceRank);(!e||xw(n.orderKey,e)<0)&&t.set(n.orderKey.sourceRank,n.orderKey)}return t}function Qj(e){let t;for(let n of e){let e=$j(n.startedAt);e!==void 0&&(t=t===void 0?e:Math.min(t,e))}return t}function $j(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function eM(e,t){if(!t.length)return e;let n=t.reduce((e,t)=>t.eventSequence===void 0?e:e===void 0?t.eventSequence:Math.min(e,t.eventSequence),void 0),r=new Map;for(let t of e)n!==void 0&&t.eventSequence!==void 0&&t.eventSequence>=n||r.set(tM(t),t);for(let e of t)r.set(tM(e),e);return[...r.values()]}function tM(e){return e.id||`${e.eventSequence??``}:${e.type}:${e.createdAt}`}function nM(e,t){let n=new Map;for(let t of Dw([...e]))n.set(t.id,{...t,children:[]});for(let e of Dw([...t])){let t=n.get(e.id);n.set(e.id,{...t,...e,children:[]})}return Ow([...n.values()])}function rM(e,t=[]){let n=new Map,r=[],i=e.hasOlderEvents??e.cursor.hasOlder,a=i?e.nextBeforeCursor??e.cursor.before:void 0,o=i?e.nextBeforeSequence??iM(e.cursor.before):void 0;for(let t of e.nodes)n.set(t.nodeId,aM(t));for(let t of e.nodes){let e=n.get(t.nodeId);if(!e)continue;let i=t.parentId?n.get(t.parentId):void 0;i?i.children.push(e):r.push(e)}return{piboSessionId:e.piboSessionId,piSessionId:e.piSessionId,title:e.title,version:e.version,latestStreamId:e.latestStreamId,eventCount:e.eventCount,eventLimit:e.pageSize,pageSize:e.pageSize,beforeCursor:e.cursor.before,firstEventSequence:e.firstEventSequence??iM(e.cursor.before),lastEventSequence:e.lastEventSequence??iM(e.cursor.after),nextBeforeSequence:o,nextBeforeCursor:a,hasOlderEvents:i,nodes:r,rawEvents:t}}function iM(e){if(!e)return;let t=Number.parseInt(e,10);return Number.isFinite(t)?t:void 0}function aM(e){let t=e.preview?.text,n=e.payloadRefs?.input?.preview,r=e.payloadRefs?.output?.preview??e.payloadRefs?.reasoning?.preview??t,i=e.payloadRefs?.error?.preview,a=e.inlinePayloads?.output??e.inlinePayloads?.reasoning;return{id:e.nodeId,parentId:e.parentId,entryId:e.entryId,piboSessionId:e.piboSessionId,eventId:e.eventId,toolCallId:e.toolCallId,runId:e.runId,intent:e.intent,type:e.type,title:e.title,status:e.status,startedAt:e.startedAt,completedAt:e.completedAt,durationMs:e.durationMs,summary:t,input:e.inlinePayloads?.input??n,output:a??r,error:typeof e.inlinePayloads?.error==`string`?e.inlinePayloads.error:i,payloadRefs:e.payloadRefs,linkedPiboSessionId:e.linkedPiboSessionId,source:e.source,stableKey:e.stableKey,orderKey:e.orderKey,children:[]}}var oM=128;function sM({selectedPiboSessionId:e,showRawEvents:t,liveTraceOverlay:n,liveTraceOverlayCacheRef:r,setLiveTraceOverlay:i}){let a=Je(),[o,s]=(0,F.useState)(50),[c,l]=(0,F.useState)(80),[u,d]=(0,F.useState)(null),f=(0,F.useRef)(new Map),[p,m]=(0,F.useState)(void 0),[h,g]=(0,F.useState)(!1),_=(0,F.useRef)(null),v=(0,F.useRef)(new Set),y=(0,F.useMemo)(()=>e?Uj(e):null,[e]),b=(0,F.useMemo)(()=>e?Wj(e,{includeRawEvents:!1,rawEventsLimit:0,pageSize:50}):null,[e]),x=lt({queryKey:y??[`chat`,`trace-summary`,`idle`],queryFn:async({signal:t})=>{if(!e||!y)throw Error(`Session is required`);let n=a.getQueryData(y),r=await YS(e,n?.version,{signal:t});if(r.notModified&&n)return n;if(!r.summary)throw Error(`Trace summary response missing payload.`);return r.summary},enabled:!1,staleTime:Vj,gcTime:Hj,refetchOnWindowFocus:!1,retry:1}),S=lt({queryKey:b??[`chat`,`trace-page`,`idle`,`compact`,c,50,`tail`],queryFn:async({signal:t})=>{if(!e||!b)throw Error(`Session is required`);let n=a.getQueryData(b),r=await XS(e,{limit:50,knownVersion:n?.version,signal:t});if(r.notModified&&n)return n;if(!r.timeline)throw Error(`Trace timeline response missing payload.`);return rM(r.timeline)},enabled:!!e,staleTime:Vj,gcTime:Hj,refetchOnWindowFocus:!1,retry:1});(0,F.useLayoutEffect)(()=>{let t=b?a.getQueryData(b):void 0;s(50),l(80),m(void 0),g(!1),d(n=>(n&&f.current.set(n.piboSessionId,n),e?f.current.get(e)??(t?.piboSessionId===e?t:null):null)),i(t=>Sj(r.current,t,e)),_.current=null,v.current=new Set},[r,a,e,i,b]);let C=lt({queryKey:e?[`chat`,`trace-raw-events`,e,c,p??`tail`]:[`chat`,`trace-raw-events`,`idle`],queryFn:async({signal:t})=>{if(!e)throw Error(`Session is required`);return ZS(e,{limit:c,beforeSequence:p,signal:t})},enabled:!!(e&&t),staleTime:Vj,gcTime:Hj,refetchOnWindowFocus:!1,retry:1});(0,F.useEffect)(()=>{let t=S.data;!t||t.piboSessionId!==e||(Yb()&&ix(t.piboSessionId,{overlayEventCount:0,traceBaseOutputLength:zj(t),traceBaseUpdated:!0}),(0,F.startTransition)(()=>{d(e=>{let n=e?.piboSessionId===t.piboSessionId?Kj(e,t):t;return f.current.set(t.piboSessionId,n),n}),i(e=>Cj(r.current,e,t))}))},[r,e,i,S.data]),(0,F.useEffect)(()=>{let t=u;!t||t.piboSessionId!==e||(0,F.startTransition)(()=>{i(e=>Cj(r.current,e,t))})},[u,r,e,i]),(0,F.useEffect)(()=>{let t=C.data;!t||t.piboSessionId!==e||(0,F.startTransition)(()=>{d(e=>{if(!e)return e;if(p===void 0)return{...e,rawEvents:t.events};let n=new Set(t.events.map(e=>e.id));return{...e,rawEvents:[...t.events,...e.rawEvents.filter(e=>!n.has(e.id))]}})})},[p,C.data,e]);let w=(0,F.useCallback)(async n=>{if(!e||!n)return;let r=`${e}:${n}`;if(_.current||v.current.has(r))return;_.current=r,g(!0);let i=Wj(e,{includeRawEvents:t,rawEventsLimit:c,pageSize:50,beforeCursor:n});try{let t=await a.fetchQuery({queryKey:i,queryFn:async({signal:t})=>{let r=a.getQueryData(i),o=await XS(e,{limit:50,beforeCursor:n,knownVersion:r?.version,signal:t});if(o.notModified&&r)return r;if(!o.timeline)throw Error(`Trace timeline response missing payload.`);return rM(o.timeline)},staleTime:Vj,gcTime:Hj});(0,F.startTransition)(()=>{d(e=>e?Gj(e,t):t),s(e=>e+(t.pageSize??50))}),cM(v.current,r)}finally{_.current===r&&(_.current=null),g(!1)}},[a,c,e,t]),T=e?u?.piboSessionId===e?u:f.current.get(e)??(S.data?.piboSessionId===e?S.data:null):null,E=e?n?.piboSessionId===e?n:r.current.get(e)??null:null,D=(0,F.useCallback)(()=>{let e=T?.rawEvents[0]?.eventSequence;m(e),l(e=>e+80)},[T?.rawEvents]);return{baseTraceView:T,liveTraceOverlay:E,traceEventLimit:o,rawEventLimit:c,traceSummaryQuery:x,tracePageQuery:S,rawEventsQuery:C,loadingOlderTracePage:h,tracePageReady:!!b,loadOlderTracePage:w,loadMoreRawEvents:D}}function cM(e,t){if(e.add(t),e.size<=oM)return;let n=e.values().next();n.done||e.delete(n.value)}function lM(e){let t=e.currentEvents,n,r,i=()=>(r??=new Set(t.map(gM)),r),a=e=>{n??=t.slice(),n.push(e),t=n};for(let o of e.streamEvents){let s=fM(o,e.piboSessionId,e.nextSequence,e.now??(()=>new Date().toISOString()));if(!s)continue;if(uM(s)){t=dM(t,s),n=t,r=void 0;continue}let c=gM(s),l=i();l.has(c)||(l.add(c),a(s))}return t}function uM(e){return e.type===`assistant_message`||e.type===`thinking_finished`||e.type===`tool_execution_finished`}function dM(e,t){return t.type===`assistant_message`?[...hM(e,t,`assistant_delta`),t]:t.type===`thinking_finished`?[...hM(e,t,`thinking_delta`),t]:t.type===`tool_execution_finished`?[...hM(e,t,`tool_execution_updated`),t]:e}function fM(e,t,n,r){if(e.type===`RAW_EVENT`&&yM(e.event)&&typeof e.event.type==`string`){let i=e.event;return pM(e,t,e.event.type,i,n,r)}if(e.type===`TEXT_MESSAGE_CONTENT`&&typeof e.delta==`string`)return pM(e,t,`assistant_delta`,{type:`assistant_delta`,piboSessionId:t,eventId:typeof e.runId==`string`?e.runId:void 0,...vM(typeof e.messageId==`string`?e.messageId:void 0,`assistant`),text:e.delta},n,r);if(e.type===`REASONING_MESSAGE_CONTENT`&&typeof e.delta==`string`)return pM(e,t,`thinking_delta`,{type:`thinking_delta`,piboSessionId:t,eventId:typeof e.runId==`string`?e.runId:void 0,...vM(typeof e.messageId==`string`?e.messageId:void 0,`thinking`),text:e.delta},n,r);if(e.type===`TOOL_CALL_START`&&typeof e.toolCallId==`string`&&typeof e.toolName==`string`)return pM(e,t,`tool_execution_started`,{type:`tool_execution_started`,piboSessionId:t,eventId:typeof e.runId==`string`?e.runId:void 0,toolCallId:e.toolCallId,toolName:e.toolName,args:e.args,...e.intent?{intent:e.intent}:{}},n,r);if(e.type===`TOOL_CALL_ARGS`&&typeof e.toolCallId==`string`&&typeof e.toolName==`string`){let i=typeof e.runId==`string`?e.runId:void 0,a=e.sourceEventType===`tool_execution_updated`?`tool_execution_updated`:`tool_call`;return pM(e,t,a,a===`tool_execution_updated`?{type:`tool_execution_updated`,piboSessionId:t,eventId:i,toolCallId:e.toolCallId,toolName:e.toolName,args:e.args,partialResult:e.partialResult,...e.intent?{intent:e.intent}:{}}:{type:`tool_call`,piboSessionId:t,eventId:i,toolCallId:e.toolCallId,toolName:e.toolName,args:e.args,argsComplete:!!e.argsComplete,...e.intent?{intent:e.intent}:{}},n,r)}if(e.type===`TOOL_CALL_RESULT`&&typeof e.toolCallId==`string`&&typeof e.toolName==`string`)return pM(e,t,`tool_execution_finished`,{type:`tool_execution_finished`,piboSessionId:t,eventId:typeof e.runId==`string`?e.runId:void 0,toolCallId:e.toolCallId,toolName:e.toolName,result:e.result,isError:!!e.isError,...e.intent?{intent:e.intent}:{}},n,r);if(e.type===`RUN_ERROR`&&typeof e.message==`string`)return pM(e,t,`session_error`,{type:`session_error`,piboSessionId:t,eventId:typeof e.runId==`string`?e.runId:void 0,error:e.message,errorDetails:e.errorDetails},n,r)}function pM(e,t,n,r,i,a){let o=typeof e.streamFrameId==`string`?e.streamFrameId:void 0,s=typeof e.streamFrameIndex==`number`?e.streamFrameIndex:void 0,c=typeof e.liveReplayId==`number`&&Number.isFinite(e.liveReplayId)?e.liveReplayId:void 0,l=i();return{id:typeof e.streamId==`number`?`stream:${e.streamId}:${s??`raw`}:${n}`:c===void 0?o?`stream:${o}:${n}`:`live:${l}:${n}`:`live-replay:${c}:${n}`,piboSessionId:t,eventSequence:l,streamId:typeof e.streamId==`number`?e.streamId:void 0,streamFrameIndex:s,traceSource:`live`,eventId:typeof r.eventId==`string`?r.eventId:void 0,type:n,createdAt:mM(e)??a(),payload:r}}function mM(e){if(!(typeof e.createdAt!=`string`||!Number.isFinite(Date.parse(e.createdAt))))return e.createdAt}function hM(e,t,n){let r=_M(t);return e.filter(e=>e.type!==n||_M(e)!==r)}function gM(e){return e.streamId===void 0?`${e.id}:${e.type}`:e.streamFrameIndex===void 0?`stream:${e.streamId}:${e.id}:${e.type}`:`stream:${e.streamId}:${e.streamFrameIndex}:${e.type}`}function _M(e){let t=yM(e.payload)?e.payload:{},n=typeof t.piboSessionId==`string`?t.piboSessionId:e.piboSessionId??``,r=typeof t.eventId==`string`?t.eventId:e.eventId??``;if(typeof t.toolCallId==`string`)return`${n}:${r}:tool:${t.toolCallId}`;let i=typeof t.assistantIndex==`number`?t.assistantIndex:void 0,a=typeof t.thinkingIndex==`number`?t.thinkingIndex:void 0,o=typeof t.contentIndex==`number`?t.contentIndex:0;return`${n}:${r}:${i??a??o}`}function vM(e,t){let n=e?.match(RegExp(`:${t}:(\\d+)$`));if(!n)return{};let r=Number(n[1]);return Number.isInteger(r)?t===`assistant`?{assistantIndex:r}:{thinkingIndex:r}:{}}function yM(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function bM(e){try{let t=JSON.parse(e.data);if(typeof t.type!=`string`)return;let n=e.lastEventId?yw(e.lastEventId):void 0;return{...t,...e.lastEventId?{streamFrameId:e.lastEventId}:{},...n?{streamId:n.streamId,streamFrameIndex:n.frameIndex}:{}}}catch{return}}function xM(e,t,n){let r=e.get(t);r?.streamId!==void 0&&r.streamId>=n||e.set(t,{streamId:n,frameIndex:2**53-1,cursor:CM(n),exact:!1,...r?.liveReplayId===void 0?{}:{liveReplayId:r.liveReplayId}})}function SM(e,t,n){let r=e.get(t),i=typeof n.liveReplayId==`number`&&Number.isFinite(n.liveReplayId)?Math.max(r?.liveReplayId??0,n.liveReplayId):r?.liveReplayId;if(n.streamId===void 0||n.streamFrameIndex===void 0){i!==void 0&&i!==r?.liveReplayId&&e.set(t,{...r??{exact:!1},liveReplayId:i});return}if(r&&(r.streamId!==void 0&&r.streamId>n.streamId||r.streamId===n.streamId&&r.exact&&r.frameIndex!==void 0&&r.frameIndex>=n.streamFrameIndex)){i!==void 0&&i!==r.liveReplayId&&e.set(t,{...r,liveReplayId:i});return}e.set(t,{streamId:n.streamId,frameIndex:n.streamFrameIndex,cursor:n.streamFrameId??`${n.streamId}:${n.streamFrameIndex}`,exact:!0,...i===void 0?{}:{liveReplayId:i}})}function CM(e){return`${e}:999999`}function wM(e){if(e.type===`RUN_FINISHED`||e.type===`TEXT_MESSAGE_END`)return 300;if(e.type===`RUN_ERROR`)return 0}function TM(e){return e.type===`RUN_STARTED`||e.type===`RUN_FINISHED`||e.type===`RUN_ERROR`||e.type===`TEXT_MESSAGE_END`||e.type===`RUNTIME_APPROVAL_REQUESTED`||e.type===`RUNTIME_APPROVAL_RESOLVED`||e.type===`RUNTIME_USER_INPUT_REQUESTED`||e.type===`RUNTIME_USER_INPUT_RESOLVED`}function EM(e){return e.type===`TEXT_MESSAGE_CONTENT`||e.type===`REASONING_MESSAGE_CONTENT`||e.type===`TOOL_CALL_START`||e.type===`TOOL_CALL_ARGS`||e.type===`TOOL_CALL_RESULT`||e.type===`RUN_ERROR`||e.type===`RAW_EVENT`}function DM(e,t,n){if(n.type===`RUN_STARTED`||n.type===`RUN_FINISHED`||n.type===`RUN_ERROR`){e.delete(t);return}let r=AM(n);r&&e.get(t)?.delete(r)}function OM(e,t,n){let r=kM(n);if(!r)return!1;let i=e.get(t);return i||(i=new Set,e.set(t,i)),!i.has(r)&&(i.add(r),!0)}function kM(e){if(e.type===`TEXT_MESSAGE_CONTENT`||e.type===`REASONING_MESSAGE_CONTENT`)return`${e.type}:${e.messageId}`}function AM(e){if(e.type===`TEXT_MESSAGE_START`)return`TEXT_MESSAGE_CONTENT:${e.messageId}`;if(e.type===`REASONING_MESSAGE_START`)return`REASONING_MESSAGE_CONTENT:${e.messageId}`}var jM=500,MM=1e4,NM=45e3,PM=15e3,FM=100,IM=2;function LM(e){let t=Math.max(e.eventCount??0,e.lastEventSequence??0);for(let n of e.rawEvents)t=Math.max(t,n.eventSequence??0);return t+1}function RM(e){if(e.forceReconnect)return!0;let t=e.liveStream;return!t||t.piboSessionId!==e.selectedPiboSessionId||t.readyState===IM||(e.nowMs??Date.now())-t.lastActivityAt>NM}function zM({selectedPiboSessionId:e,tracePageData:t,currentTraceView:n,liveEventSeqRef:r,selectedSessionStatus:i,tracePageReady:a,setLiveTraceOverlay:o,onRefreshTrace:s,onRefreshBootstrap:c,onRuntimeRequestEvent:l,onError:u}){let d=(0,F.useRef)(new Map),f=(0,F.useRef)(void 0),p=(0,F.useRef)(void 0),m=(0,F.useRef)(new Map),h=(0,F.useRef)(new Map),g=(0,F.useRef)(null),_=(0,F.useRef)(void 0),v=(0,F.useRef)(0),y=(0,F.useRef)(!1),b=(0,F.useRef)(!1),[x,S]=(0,F.useState)(0);(0,F.useEffect)(()=>{let n=t;!n||n.piboSessionId!==e||(r.current=Math.max(r.current,LM(n)),n.latestStreamId!==void 0&&xM(h.current,n.piboSessionId,n.latestStreamId))},[r,e,t]);let C=(0,F.useCallback)(e=>{let t=d.current.get(e);t?.length&&(o(n=>{let i=lM({currentEvents:n?.piboSessionId===e?n.events:[],streamEvents:t,piboSessionId:e,nextSequence:()=>r.current++});return ex(e,t.length,i.length),{piboSessionId:e,events:i}}),d.current.delete(e))},[]),w=(0,F.useCallback)(()=>{if(!(f.current!==void 0||p.current!==void 0||!e)){if(document.hidden){p.current=setTimeout(()=>{p.current=void 0,C(e)},FM);return}f.current=requestAnimationFrame(()=>{f.current=void 0,C(e)})}},[C,e]),T=(0,F.useCallback)((t,n,r=!1)=>{DM(m.current,t,n);let i=r||OM(m.current,t,n),a=d.current.get(t)??[];a.push(n),d.current.set(t,a),$b(t,n,a.length,i),i||t!==e?C(t):w()},[C,w,e]);(0,F.useEffect)(()=>()=>{f.current!==void 0&&cancelAnimationFrame(f.current),p.current!==void 0&&clearTimeout(p.current),_.current!==void 0&&clearTimeout(_.current)},[]);let E=(0,F.useCallback)((e,t)=>{SM(h.current,e,t)},[]),D=(0,F.useCallback)((e=0)=>{if(_.current!==void 0){if(e>0)return;clearTimeout(_.current)}_.current=setTimeout(()=>{_.current=void 0,S(e=>e+1)},e)},[]),O=(0,F.useCallback)((t=!1)=>{if(!e)return;C(e),s().catch(e=>u(BM(e))),c().catch(e=>u(BM(e)));let n=g.current;if(RM({selectedPiboSessionId:e,liveStream:n?{piboSessionId:n.piboSessionId,lastActivityAt:n.lastActivityAt,readyState:n.events.readyState}:null,forceReconnect:t})){if(t){if(y.current)return;y.current=!0}D()}},[C,u,c,s,D,e]);(0,F.useEffect)(()=>{if(!e||!a||!n||n.piboSessionId!==e)return;let t=new URLSearchParams({piboSessionId:e});t.set(`mode`,`live`);let r=h.current.get(e),i=r?.cursor??(n.latestStreamId===void 0?void 0:CM(n.latestStreamId));i!==void 0&&t.set(`since`,i),r?.liveReplayId!==void 0&&t.set(`liveSince`,String(r.liveReplayId));let o=new EventSource(`/api/chat/events?${t.toString()}`),d=Date.now();g.current={piboSessionId:e,events:o,openedAt:d,lastActivityAt:d};let f=!1,p,m,b=!1,x=!1,S=(t,n=!1)=>{if(p){if(!n)return;clearTimeout(p)}rx(e,t),p=setTimeout(()=>{p=void 0,s().catch(e=>u(BM(e)))},t)},w=()=>{if(b){x=!0;return}b=!0,c().catch(e=>u(BM(e))).finally(()=>{b=!1,x&&(x=!1,O(250,!0))})},O=(e,t=!1)=>{if(m){if(!t)return;clearTimeout(m)}m=setTimeout(()=>{m=void 0,w()},e)},k=()=>{O(900,!0)};return o.onopen=()=>{v.current=0,y.current=!1,_.current!==void 0&&(clearTimeout(_.current),_.current=void 0),Xb(e,o.readyState);let t=g.current;t?.events===o&&(t.lastActivityAt=Date.now())},o.onerror=()=>{if(f)return;Zb(e,o.readyState);let t=g.current;t?.events===o&&(t.lastErrorAt=Date.now());let n=v.current++,r=Math.min(MM,jM*2**n);D(r)},o.addEventListener(`pibo`,t=>{if(f)return;let n=bM(t);if(!n)return;let r=n.piboSessionId||e,i=g.current;if(i?.events===o&&(i.lastActivityAt=Date.now()),E(r,n),Qb(r,n,t.lastEventId,o.readyState),r===e&&n.type===`ready`&&n.liveReplay?.missed&&S(0,!0),ax(n))return;(n.type===`RUNTIME_APPROVAL_REQUESTED`||n.type===`RUNTIME_APPROVAL_RESOLVED`||n.type===`RUNTIME_USER_INPUT_REQUESTED`||n.type===`RUNTIME_USER_INPUT_RESOLVED`)&&l?.(n);let a=n.type!==`TEXT_MESSAGE_CONTENT`&&n.type!==`REASONING_MESSAGE_CONTENT`;r===e&&EM(n)&&T(r,n,a);let s=wM(n);r===e&&s!==void 0?S(s,!0):r===e&&n.type!==`ready`&&n.type!==`RAW_EVENT`&&S(1500,!0),TM(n)&&(n.type===`RUN_FINISHED`||n.type===`RUN_ERROR`||n.type===`TEXT_MESSAGE_END`?k():O(r===e?0:150))}),()=>{f=!0,p&&clearTimeout(p),m&&clearTimeout(m),C(e),g.current?.events===o&&(g.current=null),o.close()}},[n?.piboSessionId,T,C,u,c,s,l,E,D,x,e,a]),(0,F.useEffect)(()=>{n?.piboSessionId&&C(n.piboSessionId)},[n?.piboSessionId,C]),(0,F.useEffect)(()=>{let e=()=>O(),t=()=>O(!0),n=()=>{b.current=!0},r=()=>{if(document.hidden){n();return}b.current=!1,O(!0)},i=e=>{let t=b.current||e.persisted;b.current=!1,O(t)};return window.addEventListener(`focus`,e),window.addEventListener(`online`,t),window.addEventListener(`pagehide`,n),window.addEventListener(`pageshow`,i),document.addEventListener(`visibilitychange`,r),()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`online`,t),window.removeEventListener(`pagehide`,n),window.removeEventListener(`pageshow`,i),document.removeEventListener(`visibilitychange`,r)}},[O]),(0,F.useEffect)(()=>{if(!e||i!==`running`)return;let t=window.setInterval(()=>{C(e);let t=g.current;RM({selectedPiboSessionId:e,liveStream:t?{piboSessionId:t.piboSessionId,lastActivityAt:t.lastActivityAt,readyState:t.events.readyState}:null})&&(s().catch(e=>u(BM(e))),D())},PM);return()=>window.clearInterval(t)},[C,u,s,D,e,i])}function BM(e){return e instanceof Error?e.message:String(e)}var VM=10;function HM(e,t,n,r){if(!t||!n.length)return e;let i=e[t]??[],a=new Set(i.map(e=>e.path)),o=n.filter(e=>e.path&&!a.has(e.path)).map(e=>({...e,id:r()}));return o.length?{...e,[t]:[...i,...o].slice(0,VM)}:e}function UM(e,t,n){if(!t)return e;let r=e[t]??[],i=r.filter(e=>e.id!==n);return i.length===r.length?e:{...e,[t]:i}}function WM(e,t){return!t||!e[t]?.length?e:{...e,[t]:[]}}function GM(e,t){let[n,r]=(0,F.useState)({});return{selectedUploadAttachments:(0,F.useMemo)(()=>e?n[e]??[]:[],[e,n]),attachUploadedFiles:(0,F.useCallback)(n=>{r(r=>HM(r,e,n,t))},[t,e]),detachUploadAttachment:(0,F.useCallback)(t=>{r(n=>UM(n,e,t))},[e]),clearSelectedUploadAttachments:(0,F.useCallback)(()=>{r(t=>WM(t,e))},[e])}}function KM({selectedPiboSessionId:e,onError:t,formatError:n}){let[r,i]=(0,F.useState)([]),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(()=>e?gA(e):null),[l,u]=(0,F.useState)(()=>CA()),[d,f]=(0,F.useState)(!1),p=!!(e&&s?.piboSessionId===e&&s.installed),m=!!e&&(a||p),h=lt({queryKey:[`web-annotations`,`app`,e],queryFn:async()=>{if(!e)throw Error(`Session is required`);return DC(e,{limit:100,scope:`app`})},enabled:!!e&&(m||r.length>0),staleTime:1e3,refetchOnWindowFocus:m,refetchInterval:m?5e3:!1,retry:1}),g=h.refetch,_=(0,F.useMemo)(()=>(h.data?.annotations??[]).filter(e=>e.status!==`resolved`&&e.status!==`dismissed`),[h.data?.annotations]),v=(0,F.useMemo)(()=>r.map(e=>_.find(t=>t.id===e)).filter(e=>!!e),[r,_]);(0,F.useEffect)(()=>{i(e?bA(e):[]),c(e?gA(e):null)},[e]),(0,F.useEffect)(()=>{if(!e)return;let t=t=>{!t||t.piboSessionId!==e||(c(e=>t.installed?t:e?.installed&&e.bindingId&&t.bindingId&&e.bindingId!==t.bindingId?e:t),t.installed?g():o(!1))},n=e=>t(yA(e.detail)),r=n=>{n.key===_A(e)&&t(vA(n.newValue))},i=()=>t(gA(e));return window.addEventListener(`pibo:web-annotation-overlay-state`,n),window.addEventListener(`storage`,r),window.addEventListener(`focus`,i),document.addEventListener(`visibilitychange`,i),i(),()=>{window.removeEventListener(`pibo:web-annotation-overlay-state`,n),window.removeEventListener(`storage`,r),window.removeEventListener(`focus`,i),document.removeEventListener(`visibilitychange`,i)}},[g,e]),(0,F.useEffect)(()=>{if(!h.data)return;if(!_.length){i(t=>(t.length&&e&&xA(e,[]),t.length?[]:t));return}let t=new Set(_.map(e=>e.id));i(n=>{let r=n.filter(e=>t.has(e));return r.length!==n.length&&e&&xA(e,r),r.length===n.length?n:r})},[e,_,h.data]),(0,F.useEffect)(()=>{let e=()=>{o(!0),g()};return window.addEventListener(`pibo:web-annotation-saved`,e),()=>window.removeEventListener(`pibo:web-annotation-saved`,e)},[g]);let y=(0,F.useCallback)(t=>{i(n=>{let r=t(n);return e&&xA(e,r),r})},[e]),b=(0,F.useCallback)(e=>{y(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e].slice(0,5))},[y]),x=(0,F.useCallback)(()=>y(()=>[]),[y]);return{selectedWebAnnotationIds:r,selectedWebAnnotations:v,visibleWebAnnotations:_,webAnnotationsPanelCollapsed:l,webAnnotationsPanelRendered:m,webAnnotationsPanelVisible:a,webAnnotationsQuery:h,clearingWebAnnotations:d,setWebAnnotationsPanelVisible:o,toggleWebAnnotationAttachment:b,detachWebAnnotationAttachment:(0,F.useCallback)(e=>{y(t=>t.filter(t=>t!==e))},[y]),clearSelectedWebAnnotationAttachments:x,toggleWebAnnotationsPanelCollapsed:(0,F.useCallback)(()=>{u(e=>{let t=!e;return wA(t),t})},[]),clearVisibleWebAnnotations:(0,F.useCallback)(async()=>{if(!(!_.length||d)&&window.confirm(`Dismiss ${_.length} visible web annotations? This keeps sent messages but clears the annotation list.`)){f(!0);try{await Promise.all(_.map(e=>OC(e.id,{piboSessionId:e.piboSessionId,status:`dismissed`,summary:`Cleared from Chat Web UI`}))),x(),await g()}catch(e){t(n(e,`Could not clear web annotations`))}finally{f(!1)}}},[d,x,n,t,g,_])}}var qM=new WeakMap;function JM(e,t,n){let r=n.map(e=>YM(e)),i=nN(r),a=i.length?Math.min(...i.map(e=>e.startTime)):Date.now()*1e3,o=i.flatMap(e=>e.endTime?[e.endTime]:[]),s=o.length?Math.max(...o):void 0,c=i.some(e=>e.status===`UNSET`);return{id:e,name:t,status:i.some(e=>e.status===`ERROR`)?`ERROR`:c?`UNSET`:`OK`,spans:r,startedAt:new Date(a/1e3),completedAt:s?new Date(s/1e3):void 0,totalDurationMs:s?(s-a)/1e3:0}}function YM(e){let t=qM.get(e);if(t)return t;let n=tN(e.startedAt)??Date.now()*1e3,r=tN(e.completedAt),i=eN(e.status),a=XM(e.type),o={id:e.id,parentId:e.parentId,name:ZM(e),spanType:a,startTime:n,endTime:r,durationUs:e.durationMs===void 0?void 0:e.durationMs*1e3,attributes:QM(e),status:i,statusMessage:e.error,events:e.error?[{name:`exception`,timestamp:r??n,attributes:{message:e.error}}]:[],children:e.children?.map(YM),pibo:{entryId:e.entryId,linkedPiboSessionId:e.linkedPiboSessionId,traceNodeType:e.type,traceOrder:e.orderKey,stableKey:e.stableKey,source:e.source}};return qM.set(e,o),o}function XM(e){switch(e){case`user.message`:return`user.prompt`;case`assistant.message`:return`model.response`;case`model.reasoning`:return`model.reasoning`;case`tool.call`:return`tool.call`;case`tool.result`:return`tool.result`;case`agent.delegation`:return`agent.delegation`;case`agent.async`:return`agent.async`;case`execution.command`:case`execution.compaction`:return`execution.command`;case`yielded.run`:return`yielded.run`;case`agent.turn`:return`agent.run`;case`error`:return`tool.result`}}function ZM(e){return e.type===`assistant.message`?`assistant_message`:e.type===`user.message`?`user_prompt`:e.type===`model.reasoning`?`model_reasoning`:e.title||e.type}function QM(e){let t={};if(e.summary&&(t.content=e.summary),e.input!==void 0&&(t.input=e.input,t.args=e.input,t.arguments=e.input),e.output!==void 0&&(t.output=e.output,t.result=e.output),e.error&&(t.error=e.error),e.toolCallId&&(t.tool_call_id=e.toolCallId),e.runId&&(t.run_id=e.runId),e.intent&&(t.intent=e.intent),(e.type===`tool.call`||e.type===`agent.delegation`)&&(t.tool_name=e.title),e.type===`assistant.message`&&(t.content=e.output??e.summary??``),e.type===`user.message`){t.content=e.output??e.summary??``;let n=$M(e);n&&(t[`message.pending_delivery`]=n)}return e.type===`model.reasoning`&&(t.reasoning=e.output??e.summary??``),e.type===`agent.delegation`&&(t[`delegation.target_agent`]=e.title.replace(/^pibo_subagent_/,``),t[`delegation.query`]=e.summary??e.input,t[`result.status`]=e.status===`done`?`completed`:e.status,t.linked_pibo_session_id=e.linkedPiboSessionId),e.type===`agent.async`&&(t[`async_agent.target_agent`]=e.title,t[`async_agent.started_by`]=rN(e.input)?e.input.startedBy:`pibo_run_start`,t[`async_agent.query`]=rN(e.input)?e.input.arguments:e.input,t[`result.status`]=e.status===`done`?`started`:e.status,t.linked_pibo_session_id=e.linkedPiboSessionId),e.type===`yielded.run`&&(t[`run.notification`]=!0,t[`run.status`]=e.status),t}function $M(e){if(e.type===`user.message`&&e.status===`running`){if(e.id.startsWith(`event:message_steered:`))return`steer`;if(e.id.startsWith(`event:message_queued:`))return`queue`}}function eN(e){return e===`running`?`UNSET`:e===`error`?`ERROR`:`OK`}function tN(e){if(!e)return;let t=new Date(e).getTime();return Number.isFinite(t)?t*1e3:void 0}function nN(e){return e.flatMap(e=>[e,...e.children?nN(e.children):[]])}function rN(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function iN(e,t,n){let r=t?pt(e.sessions,t):void 0,i=e.agents.find(e=>e.name===n),a=e.customAgents.find(e=>e.profileName===n)??i,o=r?.runtimeInstanceId??a?.runtimeInstanceId,s=(e.agentCatalog?.agentRuntimes.find(e=>o?e.id===o:r?.runtimeAdapterId?e.adapterId===r.runtimeAdapterId:!1))?.capabilities.tools.intentTracing;if(!s?.supported)return!1;if(!s.configurable)return!0;let c=(e.session?.id===t?e.session.runtimeBinding:void 0)?.metadata?.intentTracing;if(typeof c==`boolean`)return c;let l=a?.runtimeOptions?.intentTracing;return typeof l==`boolean`?l:s.enabledByDefault}function aN(e){return(e.selectedPiboSessionId?pt(e.sessionNodes,e.selectedPiboSessionId):void 0)?.title||e.traceTitle||e.selectedPiboSessionId||e.fallback}function oN(e,t){return t?{sessionBreadcrumbs:dN(e,t),originSession:lN(e,t),derivedSessions:uN(e,t)}:{sessionBreadcrumbs:[],originSession:void 0,derivedSessions:[]}}function sN(e){let t=e.selectedPiboSessionId?pt(e.bootstrap.sessions,e.selectedPiboSessionId):void 0,n=hN(e.currentTraceView);return mN(e.selectedSessionActiveModel,e.bootstrap.runtimeStatus?.thinkingLevel??n.level??t?.initialThinkingLevel??fN(e.bootstrap,e.selectedSessionProfile,!!t?.parentId),e.bootstrap.runtimeStatus?.fastMode??n.fast??pN(e.bootstrap,e.selectedSessionProfile,!!t?.parentId)??!1)}function cN(e){return{traceView:e.currentTraceView,selectedTrace:e.currentTraceView?JM(e.currentTraceView.piboSessionId,e.currentTraceView.title,e.currentTraceView.nodes):null,isLoading:e.isLoading,showThinking:e.showThinking,expandThinking:e.expandThinking,toolDisplayMode:e.toolDisplayMode,sessionAgentProfile:e.selectedSessionProfile,sessionActiveModel:e.sessionActiveModelBadge,sessionRuntimeBinding:e.sessionRuntimeBinding,selectedSessionStatus:e.selectedSessionStatus,selectedSessionSignal:e.selectedSessionSignal,signals:e.signals,sessionGoal:e.sessionGoal,workflowProjectSession:e.workflowProjectSession,workflowLifecycleEvents:e.workflowLifecycleEvents,sessionNodes:e.sessionNodes,sessionBreadcrumbs:e.sessionLinks.sessionBreadcrumbs,originSession:e.sessionLinks.originSession,derivedSessions:e.sessionLinks.derivedSessions,agentProfiles:e.agentProfiles,sessionProfileChangeDisabled:e.sessionProfileChangeDisabled,onSessionAgentProfileChange:e.onSessionAgentProfileChange,onFork:e.onFork,onOpenSession:e.onOpenSession,onLoadOlderTracePage:e.onLoadOlderTracePage,hasOlderTraceEvents:e.hasOlderTraceEvents,isFetchingOlderTracePage:e.isFetchingOlderTracePage,onThinkingLevelChange:e.onThinkingLevelChange,onModelChanged:async()=>{await e.onRefreshBootstrap(),await e.onRefreshTrace()},onRefreshBootstrap:e.onRefreshBootstrap,onError:e.onError}}function lN(e,t){let n=pt(e,t);if(!n?.originId)return;let r=pt(e,n.originId);return{piboSessionId:n.originId,label:r?vN(r,0):n.originId}}function uN(e,t){return pt(e,t)?.derivedSessions.map(e=>({piboSessionId:e.piboSessionId,label:yN(e),profile:e.profile,status:e.status}))??[]}function dN(e,t){return mt(e,t).map((e,t)=>({piboSessionId:e.piboSessionId,label:vN(e,t)}))}function fN(e,t,n=!1){let r=e.agents.find(e=>e.name===t),i=e.customAgents.find(e=>e.profileName===t),a=r??i;return n?a?.subagentThinkingLevel??a?.thinkingLevel??e.modelDefaults?.subagentThinking??e.modelDefaults?.thinking:a?.mainThinkingLevel??a?.thinkingLevel??e.modelDefaults?.mainThinking??e.modelDefaults?.thinking}function pN(e,t,n=!1){let r=e.agents.find(e=>e.name===t),i=e.customAgents.find(e=>e.profileName===t),a=r??i;return n?a?.subagentFast??a?.fast??e.modelDefaults?.subagentFast??e.modelDefaults?.fast:a?.mainFast??a?.fast??e.modelDefaults?.mainFast??e.modelDefaults?.fast}function mN(e,t,n){if(e)return[e,t,n?`fast`:void 0].filter(Boolean).join(` `)}function hN(e){let t={};if(!e)return t;for(let n of gN(e.nodes)){if(n.type!==`execution.command`||n.title!==`thinking`&&n.title!==`fast_mode`)continue;let e=n.output&&typeof n.output==`object`?n.output:void 0;t={level:(typeof e?.level==`string`&&_N(e.level)?e.level:void 0)??t.level,fast:n.title===`fast_mode`?e?.mode===`fast`:t.fast}}return t}function gN(e){return e.flatMap(e=>[e,...gN(e.children)])}function _N(e){return jD.includes(e)}function vN(e,t){return t?e.subagentName&&e.subagentName!==e.profile?`${e.subagentName} (${e.profile})`:e.profile||e.subagentName||e.title:e.profile||e.title}function yN(e){return e.subagentName&&e.subagentName!==e.profile?`${e.subagentName} (${e.profile})`:e.title||e.profile||e.subagentName||`Untitled Session`}function bN({piboSessionId:e,text:t,selectedWebAnnotations:n,selectedUploadAttachments:r,eventSequence:i,now:a,clientTxnId:o,delivery:s=`queue`}){let c=n.map(e=>e.id),l=r.map(e=>e.path),u=s===`steer`?`message_steered`:`message_queued`;return{piboSessionId:e,text:t,webAnnotationIds:c,fileAttachmentPaths:l,clientTxnId:o,delivery:s,optimisticEvent:{id:o,piboSessionId:e,eventSequence:i,eventId:o,type:u,createdAt:a,payload:{type:u,piboSessionId:e,eventId:o,clientTxnId:o,delivery:s,...s===`queue`?{queuedMessages:1}:{},text:t,...l.length?{fileAttachmentPaths:l}:{},source:`user`}}}}function xN(e,t){if(e.delivery===t)return e;let n=t===`steer`?`message_steered`:`message_queued`,r={...e.optimisticEvent.payload};return delete r.queuedMessages,{...e,delivery:t,optimisticEvent:{...e.optimisticEvent,type:n,payload:{...r,type:n,delivery:t,...t===`queue`?{queuedMessages:1}:{}}}}}function SN(e,t,n){return{piboSessionId:t,events:[...e?.piboSessionId===t?e.events:[],n]}}var CN=`optimistic-session-`;function wN(e){return e?.startsWith(CN)===!0}function TN(e){return e&&!wN(e)?e:null}function EN(e){return e instanceof Error?e.message:String(e)}var DN=[`(display-mode: standalone)`,`(display-mode: window-controls-overlay)`];function ON(e,t){return DN.some(t=>e(t).matches)?typeof t.userAgentData?.mobile==`boolean`?!t.userAgentData.mobile:!(/Android|iPhone|iPad|iPod|Mobile/i.test(t.userAgent)||/Macintosh/i.test(t.userAgent)&&t.maxTouchPoints>1):!1}function kN(){return typeof window<`u`&&typeof navigator<`u`&&ON(window.matchMedia.bind(window),navigator)}function AN(e,t){return{url:e,name:`pibo-session-${t}`,features:`width=1280,height=900`}}function jN(){let e=AN(window.location.href,crypto.randomUUID());return window.open(e.url,e.name,e.features)}var MN=[{id:`accept`,label:`Approve once`},{id:`acceptForSession`,label:`Approve for session`},{id:`decline`,label:`Decline`},{id:`cancel`,label:`Cancel turn`}];function NN({piboSessionId:e,approvals:t,userInputs:n,onResolved:r,onError:i}){let[a,o]=(0,F.useState)(null);if(t.length===0&&n.length===0)return null;let s=async(t,n)=>{if(!a){o(t),i(null);try{await Ot(e,`runtime.approval.respond`,{requestId:t,decision:n}),r(t)}catch(e){i(EN(e))}finally{o(null)}}},c=async(t,n)=>{if(!a){o(t),i(null);try{await Ot(e,`runtime.user_input.respond`,{requestId:t,answers:n}),r(t)}catch(e){i(EN(e))}finally{o(null)}}};return(0,I.jsx)(`section`,{className:`border-t border-slate-800 bg-[#101d22] px-3 py-2 sm:px-4`,"data-pibo-debug":`runtime-request-panel`,"aria-label":`Runtime requests`,children:(0,I.jsxs)(`div`,{className:`mx-auto grid w-full max-w-4xl gap-2`,children:[t.map(e=>(0,I.jsx)(PN,{request:e,busy:a===e.requestId,disabled:a!==null,onDecision:t=>void s(e.requestId,t)},e.requestId)),n.map(e=>(0,I.jsx)(FN,{request:e,busy:a===e.requestId,disabled:a!==null,onSubmit:t=>void c(e.requestId,t)},e.requestId))]})})}function PN({request:e,busy:t,disabled:n,onDecision:r}){let i=e.decisions?.length?e.decisions:MN;return(0,I.jsxs)(`article`,{className:`rounded-sm border border-amber-500/40 bg-amber-500/5`,"data-pibo-debug":`runtime-approval-request`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-amber-500/20 px-3 py-2`,children:[(0,I.jsx)(Jn,{size:16,className:`mt-0.5 shrink-0 text-amber-400`,"aria-hidden":`true`}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(`h3`,{className:`text-xs font-bold uppercase tracking-wider text-amber-300`,children:e.title||`Approval required`}),(0,I.jsx)(`span`,{className:`rounded-sm border border-slate-700 px-1.5 py-0.5 font-mono text-[10px] uppercase text-slate-400`,children:e.requestType})]}),e.detail?(0,I.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-slate-300`,children:e.detail}):null]})]}),e.arguments===void 0?null:(0,I.jsx)(`pre`,{className:`max-h-36 overflow-auto border-b border-slate-800 bg-[#0e1116] px-3 py-2 font-mono text-[11px] leading-5 text-slate-300`,children:RN(e.arguments)}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-2 px-3 py-2`,children:i.map(e=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>r(e.id),disabled:n,title:e.description,className:LN(e.id),"data-pibo-decision":e.id,children:t?`Responding…`:e.label},e.id))})]})}function FN({request:e,busy:t,disabled:n,onSubmit:r}){let[i,a]=(0,F.useState)({}),o=(0,F.useMemo)(()=>e.questions.every(e=>!!i[e.id]?.trim()),[i,e.questions]);return(0,I.jsxs)(`article`,{className:`rounded-sm border border-cyan-500/40 bg-cyan-500/5`,"data-pibo-debug":`runtime-user-input-request`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-cyan-500/20 px-3 py-2`,children:[(0,I.jsx)(gn,{size:16,className:`mt-0.5 shrink-0 text-cyan-400`,"aria-hidden":`true`}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(`h3`,{className:`text-xs font-bold uppercase tracking-wider text-cyan-300`,children:`Input requested`}),(0,I.jsx)(`span`,{className:`rounded-sm border border-slate-700 px-1.5 py-0.5 font-mono text-[10px] uppercase text-slate-400`,children:e.blocking===!1?`non-blocking`:`blocking`})]}),(0,I.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-slate-400`,children:`Codex is waiting for structured input before continuing this turn.`})]})]}),(0,I.jsx)(`div`,{className:`grid gap-3 px-3 py-3`,children:e.questions.map(t=>(0,I.jsx)(IN,{question:t,groupName:`runtime-question-${e.requestId}-${t.id}`,value:i[t.id]??``,disabled:n,onChange:e=>a(n=>({...n,[t.id]:e}))},t.id))}),(0,I.jsx)(`div`,{className:`flex justify-end border-t border-cyan-500/20 px-3 py-2`,children:(0,I.jsx)(`button`,{type:`button`,onClick:()=>r(i),disabled:n||!o,className:`rounded-sm border border-[#11a4d4] bg-[#11a4d4] px-3 py-1.5 text-xs font-semibold text-white transition hover:bg-[#0d8eb8] disabled:cursor-not-allowed disabled:opacity-50`,children:t?`Submitting…`:`Submit response`})})]})}function IN({question:e,groupName:t,value:n,disabled:r,onChange:i}){let a=e.options??[],o=new Set(a.map(e=>e.label)),s=!!n&&!o.has(n);return(0,I.jsxs)(`fieldset`,{className:`grid gap-2`,disabled:r,children:[(0,I.jsxs)(`legend`,{className:`text-xs font-semibold text-slate-200`,children:[e.header?(0,I.jsx)(`span`,{className:`mr-2 font-mono uppercase text-cyan-400`,children:e.header}):null,e.question]}),a.length?(0,I.jsxs)(`div`,{className:`grid gap-1.5 sm:grid-cols-2`,children:[a.map(e=>(0,I.jsxs)(`label`,{className:`flex cursor-pointer gap-2 rounded-sm border border-slate-700 bg-[#151f24] px-2.5 py-2 text-xs hover:border-cyan-500/60`,children:[(0,I.jsx)(`input`,{type:`radio`,name:t,value:e.label,checked:n===e.label,onChange:()=>i(e.label),className:`mt-0.5 accent-[#11a4d4]`}),(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`span`,{className:`block font-semibold text-slate-200`,children:e.label}),e.description?(0,I.jsx)(`span`,{className:`mt-0.5 block leading-4 text-slate-400`,children:e.description}):null]})]},e.label)),e.allowFreeform?(0,I.jsxs)(`label`,{className:`flex cursor-pointer gap-2 rounded-sm border border-slate-700 bg-[#151f24] px-2.5 py-2 text-xs hover:border-cyan-500/60`,children:[(0,I.jsx)(`input`,{type:`radio`,name:t,checked:s,onChange:()=>i(`Other`),className:`mt-0.5 accent-[#11a4d4]`}),(0,I.jsx)(`span`,{className:`font-semibold text-slate-200`,children:`Other`})]}):null]}):null,a.length===0||e.allowFreeform&&s?(0,I.jsx)(`input`,{type:e.secret?`password`:`text`,value:s&&n===`Other`?``:n,onChange:e=>i(e.target.value),autoComplete:`off`,placeholder:e.secret?`Enter a private response`:`Enter a response`,className:`w-full rounded-sm border border-slate-700 bg-[#0e1116] px-2.5 py-2 font-mono text-xs text-slate-200 outline-none focus:border-[#11a4d4] focus:ring-1 focus:ring-[#11a4d4]/40`}):null]})}function LN(e){let t=`rounded-sm border px-2.5 py-1.5 text-xs font-semibold transition disabled:cursor-not-allowed disabled:opacity-50`;return e===`accept`?`${t} border-emerald-500/60 bg-emerald-500/10 text-emerald-300 hover:bg-emerald-500/20`:e===`acceptForSession`?`${t} border-cyan-500/60 bg-cyan-500/10 text-cyan-300 hover:bg-cyan-500/20`:e===`cancel`?`${t} border-red-500/60 bg-red-500/10 text-red-300 hover:bg-red-500/20`:`${t} border-slate-600 bg-slate-800/60 text-slate-300 hover:border-slate-500`}function RN(e){if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return`[unavailable]`}}function zN({bootstrap:e,selectedPiboSessionId:t,selectedRoomId:n,selectedRoomArchived:r,roomNavigationPending:i,sessionNavigationPending:a,selectedSessionProfile:o,selectedSessionActiveModel:s,selectedSessionStatus:c,selectedSessionSignal:l,signals:u,workflowProjectSession:d,workflowLifecycleEvents:f,projectSessionCreatePanel:p,workflowStartPanel:m,projectModulePanel:h,extraViewTabs:g,activeViewId:_,sessionViewId:v,sessionViews:y,currentSessionView:b,allowedSessionViewIds:x,creatingSession:S,terminalFullscreen:C=!1,onEnterTerminalFullscreen:w,onExitTerminalFullscreen:T,showRawEvents:E,showThinking:D,expandThinking:O,toolDisplayMode:k,commands:ee,skills:te,composerText:ne,composerFocusSignal:A,onComposerTextChange:j,onToggleRawEvents:re,onToggleThinking:M,onToggleExpandThinking:N,onToolDisplayModeChange:ie,onSessionAgentProfileChange:ae,onFork:oe,onOpenSession:se,onSelectSessionView:ce,onCommand:le,onThinkingLevelChange:ue,onRefreshTrace:de,onRefreshBootstrap:P,onSend:fe,onError:pe}){let me=(0,F.useRef)(0),he=(0,F.useRef)(new Map),[ge,_e]=(0,F.useState)(null),ve=(0,F.useCallback)(e=>{_e(t=>{let n=typeof e==`function`?e(t):e;return n&&he.current.set(n.piboSessionId,n),n})},[]),[ye,be]=(0,F.useState)(null),[xe,Se]=(0,F.useState)([]),[Ce,we]=(0,F.useState)([]),Te=(0,F.useRef)(new Set),Ee=(0,F.useRef)(null),De=TN(t);(0,F.useEffect)(()=>{let t=e.runtimeStatus?.piboSessionId===De?e.runtimeStatus:void 0;Se(t?.pendingApprovals?[...t.pendingApprovals]:[]),we(t?.pendingUserInputs?[...t.pendingUserInputs]:[])},[e.runtimeStatus,De]);let Oe=(0,F.useCallback)(e=>{if(e.type===`RUNTIME_APPROVAL_REQUESTED`){Se(t=>[...t.filter(t=>t.requestId!==e.request.requestId),e.request]);return}if(e.type===`RUNTIME_USER_INPUT_REQUESTED`){we(t=>[...t.filter(t=>t.requestId!==e.request.requestId),e.request]);return}Se(t=>t.filter(t=>t.requestId!==e.requestId)),we(t=>t.filter(t=>t.requestId!==e.requestId))},[]),ke=(0,F.useCallback)(e=>{Se(t=>t.filter(t=>t.requestId!==e)),we(t=>t.filter(t=>t.requestId!==e))},[]),Ae=lt({queryKey:De?[`chat`,`session-goal`,De]:[`chat`,`session-goal`,`idle`],queryFn:({signal:e})=>EC(De,{signal:e}),enabled:!!De,refetchInterval:De?5e3:!1}),je=!!De&&kN(),Me=(0,F.useCallback)(()=>{jN()||pe(`The browser blocked the new Pibo window.`)},[pe]),Ne=je?Me:void 0,{baseTraceView:Pe,liveTraceOverlay:Fe,rawEventLimit:Ie,traceSummaryQuery:Le,tracePageQuery:Re,rawEventsQuery:ze,loadingOlderTracePage:Be,tracePageReady:Ve,loadOlderTracePage:He,loadMoreRawEvents:Ue}=sM({selectedPiboSessionId:De,showRawEvents:E,liveTraceOverlay:ge,liveTraceOverlayCacheRef:he,setLiveTraceOverlay:ve}),{selectedWebAnnotationIds:We,selectedWebAnnotations:Ge,visibleWebAnnotations:Ke,webAnnotationsPanelCollapsed:qe,webAnnotationsPanelRendered:Je,webAnnotationsPanelVisible:Ye,webAnnotationsQuery:Xe,clearingWebAnnotations:Ze,setWebAnnotationsPanelVisible:Qe,toggleWebAnnotationAttachment:$e,detachWebAnnotationAttachment:et,clearSelectedWebAnnotationAttachments:tt,toggleWebAnnotationsPanelCollapsed:nt,clearVisibleWebAnnotations:rt}=KM({selectedPiboSessionId:De,onError:pe,formatError:NA}),{selectedUploadAttachments:it,attachUploadedFiles:at,detachUploadAttachment:ot,clearSelectedUploadAttachments:st}=GM(t,(0,F.useCallback)(()=>`upload-${ht()}`,[])),ct=Bj({selectedPiboSessionId:De,baseTraceView:Pe,liveTraceOverlay:Fe,selectedSessionStatus:c});zM({selectedPiboSessionId:De,tracePageData:Re.data,currentTraceView:ct,liveEventSeqRef:me,selectedSessionStatus:c,tracePageReady:Ve,setLiveTraceOverlay:ve,onRefreshTrace:de,onRefreshBootstrap:P,onRuntimeRequestEvent:Oe,onError:pe});let ut=sN({bootstrap:e,selectedPiboSessionId:t,selectedSessionProfile:o,selectedSessionActiveModel:s,currentTraceView:ct}),dt=(0,F.useMemo)(()=>oN(e.sessions,t),[e.sessions,t]),ft=!!t&&Re.isFetching&&!ct,pt=Re.error?EN(Re.error):Le.error?EN(Le.error):null,mt=gt(t,r),_t=!mt&&b.id===`terminal`&&(_??v)===`terminal`,vt=(0,F.useCallback)(async e=>{try{let t=await Ft(e);at(t.files)}catch(e){pe(EN(e))}},[at,pe]),yt=ct?.piboSessionId??t??``,bt=d&&VA(d)?HA(d,c):null,xt=e=>{for(let n of[750,2e3,5e3,1e4])window.setTimeout(()=>{t===e&&Re.refetch().catch(e=>pe(EN(e)))},n)},St=async(e,t)=>{let n=xN(e,t);ve(e=>SN(e,n.piboSessionId,n.optimisticEvent)),await fe(n.text,n.webAnnotationIds,n.fileAttachmentPaths,n.clientTxnId,t),tt(),st(),await Promise.all([Re.refetch(),Xe.refetch()]),xt(n.piboSessionId)},Ct=(e,t)=>{ve(t=>{let n=t?.piboSessionId===e.piboSessionId?t:he.current.get(e.piboSessionId)??null;if(!n)return t;let r=n.events.filter(t=>t.id!==e.clientTxnId),i=r.length?{...n,events:r}:null;return i?he.current.set(e.piboSessionId,i):he.current.delete(e.piboSessionId),t?.piboSessionId===e.piboSessionId?i:t}),j(t=>t||e.text),pe(EN(t))},wt=async e=>{if(mt||!t)return;let n=bN({piboSessionId:t,text:e,selectedWebAnnotations:Ge,selectedUploadAttachments:it,eventSequence:me.current++,now:new Date().toISOString(),clientTxnId:ht()});if(c===`running`){be(n);return}try{await St(n,`queue`)}catch(e){Ct(n,e)}},Tt=()=>{ye&&(j(e=>e||ye.text),be(null))},Et=async e=>{let t=ye;if(!(!t||Te.current.has(t.clientTxnId))){Te.current.add(t.clientTxnId),be(e=>e?.clientTxnId===t.clientTxnId?null:e),pe(null);try{await St(t,e)}catch(e){Ct(t,e)}finally{Te.current.delete(t.clientTxnId)}}},Dt=iN(e,t,o),Ot=k===`intent`&&!Dt?`slim`:k,kt=cN({currentTraceView:ct,isLoading:ft,showThinking:D,expandThinking:O,toolDisplayMode:Ot,selectedSessionProfile:o,sessionActiveModelBadge:ut,sessionRuntimeBinding:e.session?.id===De?e.session.runtimeBinding:void 0,selectedSessionStatus:c,selectedSessionSignal:l,signals:u,sessionGoal:Ae.data?.goal,workflowProjectSession:d,workflowLifecycleEvents:f,sessionNodes:e.sessions,sessionLinks:dt,agentProfiles:e.agents,sessionProfileChangeDisabled:S||r,onSessionAgentProfileChange:ae,onFork:oe,onOpenSession:se,onLoadOlderTracePage:()=>void He(ct?.nextBeforeCursor??ct?.nextBeforeSequence),hasOlderTraceEvents:ct?.hasOlderEvents===!0||ct?.nextBeforeCursor!==void 0||typeof ct?.nextBeforeSequence==`number`,isFetchingOlderTracePage:Be,onThinkingLevelChange:ue,onRefreshTrace:de,onRefreshBootstrap:P,onError:pe});return(0,I.jsxs)(I.Fragment,{children:[ye?(0,I.jsx)(uj,{title:`Session is running`,description:`Choose how this message should be delivered.`,onClose:Tt,initialFocusRef:Ee,children:(0,I.jsxs)(`div`,{className:`grid gap-2 p-4 sm:grid-cols-2`,"data-pibo-debug":`message-delivery-dialog`,children:[(0,I.jsxs)(`button`,{ref:Ee,type:`button`,onClick:()=>void Et(`queue`),className:`rounded-sm border border-slate-700 bg-[#151f24] p-3 text-left transition hover:border-[#11a4d4] hover:bg-[#11a4d4]/10 disabled:opacity-50`,"data-pibo-debug":`message-delivery-queue`,children:[(0,I.jsx)(`span`,{className:`block text-xs font-bold uppercase tracking-wider text-[#11a4d4]`,children:`Queue`}),(0,I.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-slate-400`,children:`Run it as the next turn after the active turn finishes.`})]}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>void Et(`steer`),className:`rounded-sm border border-amber-500/50 bg-amber-500/5 p-3 text-left transition hover:border-amber-400 hover:bg-amber-500/10 disabled:opacity-50`,"data-pibo-debug":`message-delivery-steer`,children:[(0,I.jsx)(`span`,{className:`block text-xs font-bold uppercase tracking-wider text-amber-400`,children:`Steer`}),(0,I.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-slate-400`,children:`Add it to the active turn after the current tool finishes, before the next model step.`})]})]})}):null,(0,I.jsx)(oj,{selectedPiboSessionId:t,selectedRoomId:n,fallbackRoomId:e.selectedRoomId??void 0,sessionViewId:v,loadingTrace:ft,roomNavigationPending:i,sessionNavigationPending:a,traceError:pt,showRawEvents:E,currentTraceView:ct,rawEventLimit:Ie,tracePageFetching:E?ze.isFetching:Re.isFetching,onLoadMoreRawEvents:Ue,terminalFullscreen:C,terminalFileDropEnabled:_t,onTerminalFilesDropped:vt,onOpenSessionWindow:Ne,onExitTerminalFullscreen:T??(()=>void 0),headerProps:{title:aN({sessionNodes:e.sessions,selectedPiboSessionId:t,traceTitle:ct?.title,fallback:e.room?.name??n??void 0}),roomLabel:e.room?.name??n??`Room`,headerPiboSessionId:yt,piboSessionId:t,piboRoomId:n??e.selectedRoomId??void 0,webAnnotationsDisabled:!t||r,webAnnotationsPanelRendered:Je,workflowHeader:bt,sessionViewId:v,sessionViews:y,currentSessionView:b,allowedSessionViewIds:x,extraViewTabs:g,activeViewId:_,terminalFullscreenAvailable:b.id===`terminal`&&(_??v)===`terminal`,onEnterTerminalFullscreen:w,onOpenSessionWindow:Ne,showRawEvents:E,showThinking:D,expandThinking:O,toolDisplayMode:Ot,toolIntentSupported:Dt,onToolDisplayModeChange:ie,onShowWebAnnotationsPanel:()=>Qe(!0),onHideWebAnnotationsPanel:()=>Qe(!1),onSelectSessionView:ce,onToggleRawEvents:re,onToggleThinking:M,onToggleExpandThinking:N,onError:pe},projectSessionCreatePanel:p,workflowStartPanel:m,projectModulePanel:h,currentSessionView:b,sessionViewProps:kt,webAnnotationsPanelRendered:Je,webAnnotationsPanelProps:{piboSessionId:t,annotations:Ke,selectedIds:We,loading:Xe.isLoading||Xe.isFetching||Ze,error:Xe.error?EN(Xe.error):null,collapsed:qe,onRefresh:()=>void Xe.refetch(),onToggle:$e,onClear:()=>void rt(),onCollapse:nt,onClose:()=>Qe(!1)},runtimeRequestPanel:De?(0,I.jsx)(NN,{piboSessionId:De,approvals:xe,userInputs:Ce,onResolved:ke,onError:pe}):void 0,composerProps:{sessionId:t,disabled:mt,commands:ee,skills:te,value:ne,focusSignal:A,selectedWebAnnotations:Ge,selectedUploadAttachments:it,onValueChange:j,onCommand:le,onDetachWebAnnotation:et,onClearWebAnnotations:tt,onAttachUploadedFiles:at,onDetachUploadAttachment:ot,onClearUploadAttachments:st,onSend:wt}})]})}function BN({mode:e,onSelectSession:t,onNewSession:n,onDeleteSession:r,onRenameSession:i,onSelectRoom:a}){return e.kind===`rooms`?(0,I.jsx)(qN,{candidates:e.candidates,workspace:e.workspace,onSelectRoom:a}):(0,I.jsx)(GN,{sessions:e.sessions,selectedPiboSessionId:e.selectedPiboSessionId,onSelectSession:t,onNewSession:n,onDeleteSession:r,onRenameSession:i})}function VN(e){return e===`running`?`running`:e===`error`?`error`:e===`completed`?`completed`:`idle`}var HN={running:`bg-cyan-400`,idle:`bg-slate-500`,error:`bg-rose-500`,completed:`bg-emerald-500`},UN={running:`running`,idle:`idle`,error:`error`,completed:`completed`};function WN({status:e}){let t=VN(e);return(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] uppercase tracking-wider text-slate-400`,children:[(0,I.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full ${HN[t]}`,"aria-hidden":`true`}),UN[t]]})}function GN({sessions:e,selectedPiboSessionId:t,onSelectSession:n,onNewSession:r,onDeleteSession:i,onRenameSession:a}){let o=[...e].sort((e,t)=>{let n=e.lastActivityAt??``;return(t.lastActivityAt??``).localeCompare(n)});return(0,I.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-slate-800 px-3 py-2 bg-[#0c1820]`,"data-testid":`session-list`,children:[(0,I.jsx)(`button`,{type:`button`,className:`shrink-0 w-7 h-7 inline-flex items-center justify-center rounded border border-slate-700 text-slate-300 hover:border-[#11a4d4] hover:text-[#11a4d4]`,title:`New session`,onClick:()=>void r(`default`),children:`+`}),(0,I.jsxs)(`ul`,{className:`flex gap-1 overflow-x-auto min-w-0`,children:[o.map(e=>{let r=e.piboSessionId===t;return(0,I.jsx)(`li`,{className:`shrink-0`,children:(0,I.jsx)(KN,{session:e,isActive:r,onSelect:()=>n(e.piboSessionId),onDelete:()=>void i(e.piboSessionId),onRename:t=>void a(e.piboSessionId,t)})},e.piboSessionId)}),o.length===0&&(0,I.jsx)(`li`,{className:`text-xs text-slate-500 px-2 py-1`,children:`No sessions yet — click + to start one.`})]})]})}function KN({session:e,isActive:t,onSelect:n,onDelete:r,onRename:i}){let[a,o]=(0,F.useState)(!1);return(0,I.jsxs)(`div`,{className:`group inline-flex items-center gap-2 rounded px-2 py-1 border ${t?`border-[#11a4d4] bg-[#102834]`:`border-slate-700 bg-[#0a1418] hover:border-slate-500`}`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:n,className:`inline-flex items-center gap-2 text-left`,children:[(0,I.jsx)(WN,{status:e.status}),(0,I.jsx)(`span`,{className:`text-xs text-slate-200 max-w-[180px] truncate`,children:e.title||`Untitled`})]}),(0,I.jsx)(`button`,{type:`button`,className:`text-slate-500 hover:text-slate-200 text-xs px-1`,title:`Session actions`,"aria-label":`Session actions`,onClick:e=>{e.stopPropagation(),o(e=>!e)},children:`…`}),a&&(0,I.jsxs)(`div`,{className:`absolute z-10 mt-12 -ml-20 bg-[#0a1418] border border-slate-700 rounded shadow-lg text-xs`,children:[(0,I.jsx)(`button`,{type:`button`,className:`block w-full text-left px-3 py-1.5 hover:bg-[#102834]`,onClick:t=>{t.stopPropagation(),o(!1);let n=window.prompt(`Rename session`,e.title??``);n&&n!==e.title&&i(n)},children:`Rename`}),(0,I.jsx)(`button`,{type:`button`,className:`block w-full text-left px-3 py-1.5 hover:bg-rose-900/30 text-rose-300`,onClick:t=>{t.stopPropagation(),o(!1),window.confirm(`Delete session "${e.title??`Untitled`}"?`)&&r()},children:`Delete`})]})]})}function qN({candidates:e,workspace:t,onSelectRoom:n}){return(0,I.jsxs)(`div`,{className:`border-b border-slate-800 px-3 py-3 bg-[#0c1820]`,"data-testid":`room-picker`,children:[(0,I.jsxs)(`div`,{className:`text-[10px] uppercase tracking-wider text-slate-400 mb-2`,children:[`Multiple rooms found for `,(0,I.jsx)(`span`,{className:`font-mono text-slate-300`,children:t})]}),(0,I.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsxs)(`button`,{type:`button`,className:`w-full text-left px-3 py-2 border border-slate-700 rounded hover:border-[#11a4d4] bg-[#0a1418]`,onClick:()=>n(e.id),children:[(0,I.jsx)(`div`,{className:`font-semibold text-slate-200 text-sm`,children:e.name}),e.topic&&(0,I.jsx)(`div`,{className:`text-xs text-slate-400 mt-0.5`,children:e.topic}),(0,I.jsxs)(`div`,{className:`text-[10px] text-slate-500 mt-1`,children:[`Created `,JN(e.createdAt),` · Updated `,JN(e.updatedAt)]})]})},e.id))})]})}function JN(e){try{return new Date(e).toLocaleString()}catch{return e}}function YN(){return new URLSearchParams(window.location.search).get(`workspace`)}function XN(){return new URLSearchParams(window.location.search).get(`roomId`)}function ZN(){let e=(0,F.useMemo)(()=>YN(),[]),[t,n]=(0,F.useState)(()=>XN()),[r,i]=(0,F.useState)(()=>XN()?{kind:`sessions`,roomId:XN(),sessions:[],selectedPiboSessionId:null}:{kind:`rooms`,candidates:[],workspace:e??``}),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(null),[l,u]=(0,F.useState)(``),[d,f]=(0,F.useState)(0),[p,m]=(0,F.useState)(null),[h,g]=(0,F.useState)(!1),[_,v]=(0,F.useState)(Ik),y=(0,F.useMemo)(()=>{let e=a?.sessionNodes;return Array.isArray(e)?e:[]},[a]);(0,F.useEffect)(()=>{if(!t)return;let e=!1;return(async()=>{try{let n=await St(void 0,!1,t);if(e)return;o(n);let r=n.sessions.find(e=>!e.archived)??n.sessions[0];r&&!s&&c(r.piboSessionId),i({kind:`sessions`,roomId:t,sessions:n.sessions,selectedPiboSessionId:r?.piboSessionId??null})}catch(t){e||m(EN(t))}})(),()=>{e=!0}},[t]);let b=(0,F.useCallback)(async()=>{if(t)try{let e=await St(s??void 0,!1,t,!0);o(e)}catch(e){m(EN(e))}},[t,s]),x=(0,F.useCallback)(async()=>{await b()},[b]);(0,F.useEffect)(()=>{if(!t)return;let e=`/api/chat/events?${new URLSearchParams({roomId:t,mode:`summary`,since:`0:999999`}).toString()}`,n=new EventSource(e),r,i=()=>{r&&clearTimeout(r),r=setTimeout(()=>{r=void 0,b()},200)};return n.addEventListener(`change`,i),n.addEventListener(`trace`,i),n.addEventListener(`message`,i),n.onerror=()=>{},()=>{r&&clearTimeout(r),n.close()}},[t,b]),(0,F.useEffect)(()=>{let e=e=>{let t=e.data;!t||typeof t!=`object`||(t.type===`pibo/set-selector-mode`?(i(t.mode),t.mode.kind===`sessions`&&n(t.mode.roomId)):t.type===`pibo/refresh-bootstrap`&&b())};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[b]);let S=(0,F.useMemo)(()=>a?yt(a.capabilities.actions):[],[a]),C=(0,F.useMemo)(()=>bt(a,s),[a,s]),w=(0,F.useMemo)(()=>r.kind===`sessions`?r.sessions:y,[r,y]),T=(0,F.useCallback)(e=>{c(e),f(e=>e+1)},[]),E=(0,F.useCallback)(async e=>{if(t)try{let n=await Ct(e,t);await b(),n.session?.id&&c(n.session.id)}catch(e){m(EN(e))}},[t,b]),D=(0,F.useCallback)(async e=>{try{await Tt(e,`delete`),await b(),s===e&&c(null)}catch(e){m(EN(e))}},[b,s]),O=(0,F.useCallback)(async(e,t)=>{try{await wt(e,{title:t}),await b()}catch(e){m(EN(e))}},[b]),k=(0,F.useCallback)(e=>{n(e),c(null),o(null),i({kind:`sessions`,roomId:e,sessions:[],selectedPiboSessionId:null});let t=new URLSearchParams(window.location.search);t.set(`roomId`,e),window.history.replaceState(null,``,`${window.location.pathname}?${t.toString()}`)},[]),ee=(0,F.useCallback)(async e=>{if(!(!s||!t))try{await Et(s,e,ht(),t),u(``),f(e=>e+1),await b()}catch(e){m(EN(e))}},[s,t,b]),te=(0,F.useCallback)(async e=>{if(!s)return!1;let n=e.trim();if(!n)return!1;let r=n.split(/\s+/)[0],i=S.find(e=>e.slash===r);if(!i)return m(`Unknown command: ${r}`),!1;if(i.action===`thinking-show`)return g(e=>!e),!0;if(i.action===`download`){let e=Mt(n.slice(r.length));if(!e)return m(`Usage: /download <path>`),!0;try{await It(e,{piboSessionId:s,roomId:t??void 0})}catch(e){m(EN(e))}return!0}try{let e=Nt(i.action,n.slice(r.length).trim());await Ot(s,i.action,e),await b()}catch(e){m(EN(e))}return!0},[S,s,t,b]),ne=(0,F.useMemo)(()=>Ak(),[]),A=(0,F.useMemo)(()=>jk(Ht),[]);if(!a)return(0,I.jsxs)(`div`,{className:`pibo-vscode-panel h-full flex flex-col bg-[#0c1820] text-slate-200`,children:[(0,I.jsx)(BN,{mode:r,onSelectSession:T,onNewSession:E,onDeleteSession:D,onRenameSession:O,onSelectRoom:k}),(0,I.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-slate-400 text-sm`,children:p?`Error: ${p}`:t?`Loading Pibo…`:`Waiting for room…`})]});if(r.kind===`rooms`){let e=a.rooms??r.candidates;return(0,I.jsxs)(`div`,{className:`pibo-vscode-panel h-full flex flex-col bg-[#0c1820] text-slate-200`,children:[(0,I.jsx)(BN,{mode:{kind:`rooms`,candidates:e,workspace:r.workspace},onSelectSession:T,onNewSession:E,onDeleteSession:D,onRenameSession:O,onSelectRoom:k}),(0,I.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-slate-400 text-sm`,children:`Multiple rooms found — pick one above to continue.`})]})}let j=a.sessions.find(e=>e.piboSessionId===s);return(0,I.jsxs)(`div`,{className:`pibo-vscode-panel h-full flex flex-col bg-[#0c1820] text-slate-200`,children:[(0,I.jsx)(BN,{mode:{kind:`sessions`,roomId:t??``,sessions:w,selectedPiboSessionId:s},onSelectSession:T,onNewSession:E,onDeleteSession:D,onRenameSession:O,onSelectRoom:k}),p&&(0,I.jsxs)(`div`,{className:`bg-rose-900/40 border-b border-rose-700 text-rose-200 text-xs px-3 py-1.5`,role:`alert`,children:[p,(0,I.jsx)(`button`,{type:`button`,className:`ml-3 underline`,onClick:()=>m(null),children:`dismiss`})]}),(0,I.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,I.jsx)(zN,{bootstrap:a,selectedPiboSessionId:s,selectedRoomId:t,selectedRoomArchived:!1,selectedSessionProfile:j?.profile??`default`,selectedSessionActiveModel:j?ft(a,j)??void 0:void 0,selectedSessionStatus:j?.status,sessionViewId:Ht,sessionViews:ne,currentSessionView:A,allowedSessionViewIds:[`terminal`],creatingSession:!1,showRawEvents:!1,showThinking:h,expandThinking:!1,toolDisplayMode:_,commands:S,skills:C,composerText:l,composerFocusSignal:d,onComposerTextChange:u,onToggleRawEvents:()=>void 0,onToggleThinking:()=>g(e=>!e),onToggleExpandThinking:()=>void 0,onToolDisplayModeChange:e=>{v(e),Lk(e)},onSessionAgentProfileChange:()=>void 0,onFork:()=>void 0,onOpenSession:e=>c(e),onSelectSessionView:()=>void 0,onCommand:te,onThinkingLevelChange:e=>void te(`/thinking ${e}`),onRefreshTrace:x,onRefreshBootstrap:b,onSend:ee,onError:m})})]})}var QN=new We({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),$N=document.getElementById(`root`);$N&&(0,ut.createRoot)($N).render((0,I.jsx)(F.StrictMode,{children:(0,I.jsx)(Ye,{client:QN,children:(0,I.jsx)(ZN,{})})}));