gcf-board 0.30.0 → 0.31.0

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.
@@ -1,123 +0,0 @@
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,t.exports),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.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(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 P(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,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(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 F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var L=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)};function ee(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function te(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ee(te.bind(null,e))}var ne={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ne,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=te,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=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.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 D(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)E.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 D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ee,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),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&&j(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&&j(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,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(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,j(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`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(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.browser=function(e){return{$$typeof:o,_reason:e}},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 c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.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=u(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=u(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,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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=u(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=u(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,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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 l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),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){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e: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}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),L=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),R=Symbol.for(`react.activity`),z=Symbol.for(`react.legacy_hidden`),B=Symbol.for(`react.memo_cache_sentinel`),V=Symbol.for(`react.view_transition`),re=Symbol.for(`react.recoverable`),ie=Symbol.iterator;function H(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Symbol.for(`react.client.reference`);function oe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case L:return`Suspense`;case ee:return`SuspenseList`;case R:return`Activity`;case V:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case te:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var se=Array.isArray,U=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function pe(e,t){ue++,le[ue]=e.current,e.current=t}var me=de(null),he=de(null),ge=de(null),_e=de(null);function ve(e,t){switch(pe(ge,t),pe(he,e),pe(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(me),pe(me,e)}function ye(){fe(me),fe(he),fe(ge)}function G(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,pe(_e,e)),t=me.current;var n=dp(t,e.type);t!==n&&(pe(he,e),pe(me,n))}function be(e){he.current===e&&(fe(me),fe(he)),_e.current===e&&(fe(_e),sh._currentValue=ce)}var xe,Se;function Ce(e){if(xe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||``,Se=-1<e.stack.indexOf(`
2
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+xe+e+Se}var we=!1;function Te(e,t){if(!e||we)return``;we=!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}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}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{we=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ce(n):``}function Ee(e,t){switch(e.tag){case 26:case 27:case 5:return Ce(e.type);case 16:return Ce(`Lazy`);case 13:return e.child!==t&&t!==null?Ce(`Suspense Fallback`):Ce(`Suspense`);case 19:return Ce(`SuspenseList`);case 0:case 15:return Te(e.type,!1);case 11:return Te(e.type.render,!1);case 1:return Te(e.type,!0);case 31:return Ce(`Activity`);case 30:return Ce(`ViewTransition`);default:return``}}function De(e){try{var t=``,n=null;do t+=Ee(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}}var Oe=Object.prototype.hasOwnProperty,ke=t.unstable_scheduleCallback,Ae=t.unstable_cancelCallback,je=t.unstable_shouldYield,Me=t.unstable_requestPaint,Ne=t.unstable_now,Pe=t.unstable_getCurrentPriorityLevel,Fe=t.unstable_ImmediatePriority,Ie=t.unstable_UserBlockingPriority,Le=t.unstable_NormalPriority,Re=t.unstable_LowPriority,ze=t.unstable_IdlePriority,Be=t.log,Ve=t.unstable_setDisableYieldValue,He=null,Ue=null;function We(e){if(typeof Be==`function`&&Ve(e),Ue&&typeof Ue.setStrictMode==`function`)try{Ue.setStrictMode(He,e)}catch{}}var Ge=Math.clz32?Math.clz32:Je,Ke=Math.log,qe=Math.LN2;function Je(e){return e>>>=0,e===0?32:31-(Ke(e)/qe|0)|0}var Ye=256,Xe=262144,Ze=4194304;function Qe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function $e(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=Qe(n))):i=Qe(o):i=Qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Qe(n))):i=Qe(o)):i=Qe(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 et(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function tt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ge(n),i=1<<r;t|=e[r],n&=~i}return t}function nt(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 rt(){var e=Ze;return Ze<<=1,!(Ze&62914560)&&(Ze=4194304),e}function it(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function at(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ot(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-Ge(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&&st(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function st(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ge(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ct(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ge(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function lt(e,t){var n=t&-t;return n=n&42?1:ut(n),(n&(e.suspendedLanes|t))===0?n:0}function ut(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 dt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ft(){var e=W.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function pt(e,t){var n=W.p;try{return W.p=e,t()}finally{W.p=n}}var mt=Math.random().toString(36).slice(2),ht=`__reactFiber$`+mt,gt=`__reactProps$`+mt,_t=`__reactContainer$`+mt,vt=`__reactEvents$`+mt,yt=`__reactListeners$`+mt,bt=`__reactHandles$`+mt,xt=`__reactResources$`+mt,St=`__reactMarker$`+mt,Ct=`__reactLoad$`+mt;function wt(e){delete e[ht],delete e[gt],delete e[yt],delete e[bt]}function Tt(e){var t;if(t=e[ht])return t;for(var n=e.parentNode;n;){if(t=n[_t]||n[ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[ht])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Et(e){if(e=e[ht]||e[_t]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ot(e){var t=e[xt];return t||=e[xt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function kt(e){e[St]=!0}function At(e){e[Ct]=void 0}var jt=new Set,Mt={};function Nt(e,t){Pt(e,t),Pt(e+`Capture`,t)}function Pt(e,t){for(Mt[e]=t,e=0;e<t.length;e++)jt.add(t[e])}var Ft=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]*$`),It={},Lt={};function Rt(e){return Oe.call(Lt,e)?!0:Oe.call(It,e)?!1:Ft.test(e)?Lt[e]=!0:(It[e]=!0,!1)}var zt=!1;function Bt(){var e=zt;return zt=!1,e}function Vt(e,t,n){if(Rt(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 Ht(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 Ut(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 Wt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Gt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Kt(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 qt(e){if(!e._valueTracker){var t=Gt(e)?`checked`:`value`;e._valueTracker=Kt(e,t,``+e[t])}}function Jt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Gt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Yt=/[\n"\\]/g;function Xt(e){return e.replace(Yt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Zt(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=``+Wt(t)):e.value!==``+Wt(t)&&(e.value=``+Wt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):$t(e,Wt(n)):o===`number`&&e.value==t?$t(e,Wt(e.value)):$t(e,Wt(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=``+Wt(s):e.removeAttribute(`name`)}function Qt(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)){qt(e);return}n=n==null?``:``+Wt(n),t=t==null?n:``+Wt(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),qt(e)}function $t(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function en(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=``+Wt(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 tn(e,t,n){t!=null&&(t=``+Wt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Wt(n)}function nn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(se(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Wt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),qt(e)}function rn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var an=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 on(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||an.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function sn(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]=``,zt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(on(e,a,r),zt=!0)}else for(var o in t)t.hasOwnProperty(o)&&on(e,o,t[o])}function cn(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 ln=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),un=/^[\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 dn(e){return un.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function fn(){}var pn=null;function mn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hn=null,gn=null;function _n(e){var t=Et(e);if(t&&(e=t.stateNode)){var n=e[gt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Zt(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="`+Xt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[gt]||null;if(!a)throw Error(i(90));Zt(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&&Jt(r)}break a;case`textarea`:tn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&en(e,!!n.multiple,t,!1)}}}var vn=!1;function yn(e,t,n){if(vn)return e(t,n);vn=!0;try{return e(t)}finally{if(vn=!1,(hn!==null||gn!==null)&&(Id(),hn&&(t=hn,e=gn,gn=hn=null,_n(t),e)))for(t=0;t<e.length;t++)_n(e[t])}}function bn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[gt]||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 xn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Sn=!1;if(xn)try{var Cn={};Object.defineProperty(Cn,"passive",{get:function(){Sn=!0}}),window.addEventListener(`test`,Cn,Cn),window.removeEventListener(`test`,Cn,Cn)}catch{Sn=!1}var wn=null,Tn=null,En=null;function Dn(){if(En)return En;var e,t=Tn,n=t.length,r,i=`value`in wn?wn.value:wn.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 En=i.slice(e,1<r?1-r:void 0)}function On(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 kn(){return!0}function An(){return!1}function jn(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)?kn:An,this.isPropagationStopped=An,this}return D(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=kn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=kn)},persist:function(){},isPersistent:kn}),t}var Mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nn=jn(Mn),Pn=D({},Mn,{view:0,detail:0}),Fn=jn(Pn),In,Ln,Rn,zn=D({},Pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xn,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!==Rn&&(Rn&&e.type===`mousemove`?(In=e.screenX-Rn.screenX,Ln=e.screenY-Rn.screenY):Ln=In=0,Rn=e),In)},movementY:function(e){return`movementY`in e?e.movementY:Ln}}),Bn=jn(zn),Vn=jn(D({},zn,{dataTransfer:0})),Hn=jn(D({},Pn,{relatedTarget:0})),Un=jn(D({},Mn,{animationName:0,elapsedTime:0,pseudoElement:0})),Wn=jn(D({},Mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Gn=jn(D({},Mn,{data:0})),Kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},qn={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`},Jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Yn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Jn[e])?!!t[e]:!1}function Xn(){return Yn}var Zn=jn(D({},Pn,{key:function(e){if(e.key){var t=Kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=On(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?qn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xn,charCode:function(e){return e.type===`keypress`?On(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?On(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Qn=jn(D({},zn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),$n=jn(D({},Mn,{submitter:0})),er=jn(D({},Pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xn})),tr=jn(D({},Mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),nr=jn(D({},zn,{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})),rr=jn(D({},Mn,{newState:0,oldState:0,source:0})),ir=[9,13,27,32],ar=xn&&`CompositionEvent`in window,or=null;xn&&`documentMode`in document&&(or=document.documentMode);var sr=xn&&`TextEvent`in window&&!or,cr=xn&&(!ar||or&&8<or&&11>=or),lr=` `,ur=!1;function dr(e,t){switch(e){case`keyup`:return ir.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function fr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var pr=!1;function mr(e,t){switch(e){case`compositionend`:return fr(t);case`keypress`:return t.which===32?(ur=!0,lr):null;case`textInput`:return e=t.data,e===lr&&ur?null:e;default:return null}}function hr(e,t){if(pr)return e===`compositionend`||!ar&&dr(e,t)?(e=Dn(),En=Tn=wn=null,pr=!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 cr&&t.locale!==`ko`?null:t.data;default:return null}}var gr={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 _r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!gr[e.type]:t===`textarea`}function vr(e,t,n,r){hn?gn?gn.push(r):gn=[r]:hn=r,t=qf(t,`onChange`),0<t.length&&(n=new Nn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var yr=null,br=null;function xr(e){zf(e,0)}function Sr(e){if(Jt(Dt(e)))return e}function Cr(e,t){if(e===`change`)return t}var wr=!1;if(xn){var Tr;if(xn){var Er=`oninput`in document;if(!Er){var Dr=document.createElement(`div`);Dr.setAttribute(`oninput`,`return;`),Er=typeof Dr.oninput==`function`}Tr=Er}else Tr=!1;wr=Tr&&(!document.documentMode||9<document.documentMode)}function Or(){yr&&(yr.detachEvent(`onpropertychange`,kr),br=yr=null)}function kr(e){if(e.propertyName===`value`&&Sr(br)){var t=[];vr(t,br,e,mn(e)),yn(xr,t)}}function Ar(e,t,n){e===`focusin`?(Or(),yr=t,br=n,yr.attachEvent(`onpropertychange`,kr)):e===`focusout`&&Or()}function jr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Sr(br)}function Mr(e,t){if(e===`click`)return Sr(t)}function Nr(e,t){if(e===`input`||e===`change`)return Sr(t)}function Pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Fr=typeof Object.is==`function`?Object.is:Pr;function Ir(e,t){if(Fr(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(!Oe.call(t,i)||!Fr(e[i],t[i]))return!1}return!0}function Lr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Rr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zr(e,t){var n=Rr(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=Rr(n)}}function Br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lr(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=Lr(e.document)}return t}function Hr(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 Ur=xn&&`documentMode`in document&&11>=document.documentMode,Wr=null,Gr=null,Kr=null,qr=!1;function Jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qr||Wr==null||Wr!==Lr(r)||(r=Wr,`selectionStart`in r&&Hr(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}),Kr&&Ir(Kr,r)||(Kr=r,r=qf(Gr,`onSelect`),0<r.length&&(t=new Nn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Wr)))}function Yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Xr={animationend:Yr(`Animation`,`AnimationEnd`),animationiteration:Yr(`Animation`,`AnimationIteration`),animationstart:Yr(`Animation`,`AnimationStart`),transitionrun:Yr(`Transition`,`TransitionRun`),transitionstart:Yr(`Transition`,`TransitionStart`),transitioncancel:Yr(`Transition`,`TransitionCancel`),transitionend:Yr(`Transition`,`TransitionEnd`)},Zr={},Qr={};xn&&(Qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Xr.animationend.animation,delete Xr.animationiteration.animation,delete Xr.animationstart.animation),`TransitionEvent`in window||delete Xr.transitionend.transition);function $r(e){if(Zr[e])return Zr[e];if(!Xr[e])return e;var t=Xr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Qr)return Zr[e]=t[n];return e}var ei=$r(`animationend`),ti=$r(`animationiteration`),ni=$r(`animationstart`),ri=$r(`transitionrun`),ii=$r(`transitionstart`),ai=$r(`transitioncancel`),oi=$r(`transitionend`),si=new Map,ci=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);ci.push(`scrollEnd`);function li(e,t){si.set(e,t),Nt(t,[e])}var ui=0;function di(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=vd.identifierPrefix;var n=ui++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function fi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Td;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function pi(e,t){return e=fi(e),t=fi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var mi=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)},hi=[],gi=0,_i=0;function vi(){for(var e=gi,t=_i=gi=0;t<e;){var n=hi[t];hi[t++]=null;var r=hi[t];hi[t++]=null;var i=hi[t];hi[t++]=null;var a=hi[t];if(hi[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&&Si(n,i,a)}}function yi(e,t,n,r){hi[gi++]=e,hi[gi++]=t,hi[gi++]=n,hi[gi++]=r,_i|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function bi(e,t,n,r){return yi(e,t,n,r),Ci(e)}function xi(e,t){return yi(e,null,null,t),Ci(e)}function Si(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-Ge(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ci(e){if(50<Ed)throw Ed=0,Dd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var wi={};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 Ei(e,t,n,r){return new Ti(e,t,n,r)}function Di(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Oi(e,t){var n=e.alternate;return n===null?(n=Ei(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&1206910976,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 ki(e,t){e.flags&=1206910978;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 Ai(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Di(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,me.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case R:return e=Ei(31,n,t,a),e.elementType=R,e.lanes=o,e;case j:return ji(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Ei(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case L:return e=Ei(13,n,t,a),e.elementType=L,e.lanes=o,e;case ee:return e=Ei(19,n,t,a),e.elementType=ee,e.lanes=o,e;case z:case V:return e=a|32,e=Ei(30,n,t,e),e.elementType=V,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case te:s=14;break a;case ne:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ei(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ji(e,t,n,r){return e=Ei(7,e,r,t),e.lanes=n,e}function Mi(e,t,n){return e=Ei(6,e,null,t),e.lanes=n,e}function Ni(e){var t=Ei(18,null,null,0);return t.stateNode=e,t}function Pi(e,t,n){return t=Ei(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fi=new WeakMap;function Ii(e,t){if(typeof e==`object`&&e){var n=Fi.get(e);return n===void 0?(t={value:e,source:t,stack:De(t)},Fi.set(e,t),t):n}return{value:e,source:t,stack:De(t)}}var Li=[],Ri=0,zi=null,Bi=0,Vi=[],Hi=0,Ui=null,Wi=1,Gi=``;function Ki(e,t){Li[Ri++]=Bi,Li[Ri++]=zi,zi=e,Bi=t}function qi(e,t,n){Vi[Hi++]=Wi,Vi[Hi++]=Gi,Vi[Hi++]=Ui,Ui=e;var r=Wi;e=Gi;var i=32-Ge(r)-1;r&=~(1<<i),n+=1;var a=32-Ge(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Wi=1<<32-Ge(t)+i|n<<i|r,Gi=a+e}else Wi=1<<a|n<<i|r,Gi=e}function Ji(e){e.return!==null&&(Ki(e,1),qi(e,1,0))}function Yi(e){for(;e===zi;)zi=Li[--Ri],Li[Ri]=null,Bi=Li[--Ri],Li[Ri]=null;for(;e===Ui;)Ui=Vi[--Hi],Vi[Hi]=null,Gi=Vi[--Hi],Vi[Hi]=null,Wi=Vi[--Hi],Vi[Hi]=null}function Xi(e,t){Vi[Hi++]=Wi,Vi[Hi++]=Gi,Vi[Hi++]=Ui,Wi=t.id,Gi=t.overflow,Ui=e}var Zi=null,Qi=null,K=!1,$i=null,ea=!1,ta=Error(i(519));function na(e){throw ca(Ii(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ta}function ra(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ht]=e,t[gt]=r,n){case`dialog`:Bf(`cancel`,t),Bf(`close`,t);break;case`iframe`:case`object`:case`embed`:Bf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Lf.length;n++)Bf(Lf[n],t);break;case`source`:Bf(`error`,t);break;case`img`:case`image`:case`link`:Bf(`error`,t),Bf(`load`,t);break;case`details`:Bf(`toggle`,t);break;case`input`:Bf(`invalid`,t),Qt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Bf(`invalid`,t);break;case`textarea`:Bf(`invalid`,t),nn(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||$f(t.textContent,n)?(r.popover!=null&&(Bf(`beforetoggle`,t),Bf(`toggle`,t)),r.onScroll!=null&&Bf(`scroll`,t),r.onScrollEnd!=null&&Bf(`scrollend`,t),r.onClick!=null&&(t.onclick=fn),t=!0):t=!1,t||na(e,!0)}function ia(e){for(Zi=e.return;Zi;)switch(Zi.tag){case 5:case 31:case 13:ea=!1;return;case 27:case 3:ea=!0;return;default:Zi=Zi.return}}function aa(e){if(e!==Zi)return!1;if(!K)return ia(e),K=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&Qi&&na(e),ia(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Qi=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Qi=dm(e)}else t===27?(t=Qi,Sp(e.type)?(e=um,um=null,Qi=e):Qi=t):Qi=Zi?lm(e.stateNode.nextSibling):null;return!0}function oa(){Qi=Zi=null,K=!1}function sa(){var e=$i;return e!==null&&(fd===null?fd=e:fd.push.apply(fd,e),$i=null),e}function ca(e){$i===null?$i=[e]:$i.push(e)}var la=de(null),ua=null,da=null;function fa(e,t,n){pe(la,t._currentValue),t._currentValue=n}function pa(e){e._currentValue=la.current,fe(la)}function ma(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 ha(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),ma(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),ma(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ma(a.return,n,e),s=a.child,s=s===null?null:s.sibling):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 ga(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;Fr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===_e.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}a=a.return}return e!==null&&ha(t,e,n,r),t.flags|=262144,e!==null}function _a(e){for(e=e.firstContext;e!==null;){if(!Fr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function va(e){ua=e,da=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ya(e){return xa(ua,e)}function ba(e,t){return ua===null&&va(e),xa(e,t)}function xa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},da===null){if(e===null)throw Error(i(308));da=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else da=da.next=t;return n}var Sa=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()})}},Ca=t.unstable_scheduleCallback,wa=t.unstable_NormalPriority,Ta={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ea(){return{controller:new Sa,data:new Map,refCount:0}}function Da(e){e.refCount--,e.refCount===0&&Ca(wa,function(){e.controller.abort()})}function Oa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var ka=null;function Aa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var ja=null,Ma=0,Na=0,Pa=null;function Fa(e,t){if(ja===null){var n=ja=[];Ma=0,Na=Mf(),Pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ma++,t.then(Ia,Ia),t}function Ia(){if(--Ma===0&&(ka=null,ja!==null)){Pa!==null&&(Pa.status=`fulfilled`);var e=ja;ja=null,Na=0,Pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function La(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 Ra=U.S;U.S=function(e,t){if(Z=Ne(),typeof t==`object`&&t&&typeof t.then==`function`&&Fa(e,t),ka!==null)for(var n=vf;n!==null;)Oa(n,ka),n=n.next;if(n=e.types,n!==null){for(var r=vf;r!==null;)Oa(r,n),r=r.next;if(Na!==0){r=ka,r===null&&(r=ka=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ra!==null&&Ra(e,t)};var za=de(null);function Ba(){var e=za.current;return e===null?Xu.pooledCache:e}function Va(e,t){t===null?pe(za,za.current):pe(za,t.pool)}function Ha(){var e=Ba();return e===null?null:{parent:Ta._currentValue,pool:e}}var Ua=Error(i(460)),Wa=Error(i(474)),Ga=Error(i(542)),Ka={then:function(){}};function qa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ja(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(fn,fn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Qa(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(fn,fn);else{if(e=Xu,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,Qa(e),e}throw Xa=t,Ua}}function Ya(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Xa=e,Ua):e}}var Xa=null;function Za(){if(Xa===null)throw Error(i(459));var e=Xa;return Xa=null,e}function Qa(e){if(e===Ua||e===Ga)throw Error(i(483))}var $a=null,eo=0;function to(e){var t=eo;return eo+=1,$a===null&&($a=[]),Ja($a,e,t)}function no(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ro(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function io(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=Oi(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|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Mi(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===j?(e=d(e,t,n.props.children,r,n.key),no(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ne&&Ya(i)===t.type)?(t=a(t,n.props),no(t,n),t.return=e,t):(t=Ai(n.type,n.key,n.props,null,e.mode,r),no(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=Pi(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=ji(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=Mi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ai(t.type,t.key,t.props,null,e.mode,n),no(n,t),n.return=e,n;case A:return t=Pi(t,e.mode,n),t.return=e,t;case ne:return t=Ya(t),f(e,t,n)}if(se(t)||H(t))return t=ji(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,to(t),n);if(t.$$typeof===F)return f(e,ba(e,t),n);ro(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 k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case ne:return n=Ya(n),p(e,t,n,r)}if(se(n)||H(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,to(n),r);if(n.$$typeof===F)return p(e,t,ba(e,n),r);ro(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 k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ne:return r=Ya(r),m(e,t,n,r,i)}if(se(r)||H(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,to(r),i);if(r.$$typeof===F)return m(e,t,n,ba(t,r),i);ro(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),K&&Ki(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 K&&Ki(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(_.key===null?h:_.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)}),K&&Ki(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),K&&Ki(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 K&&Ki(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(_.key===null?g:_.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)}),K&&Ki(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),no(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ne&&Ya(l)===r.type){n(e,r.sibling),c=a(r,o.props),no(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=ji(o.props.children,e.mode,c,o.key),no(c,o),c.return=e,e=c):(c=Ai(o.type,o.key,o.props,null,e.mode,c),no(c,o),c.return=e,e=c)}return s(e);case A: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=Pi(o,e.mode,c),c.return=e,e=c}return s(e);case ne:return o=Ya(o),_(e,r,o,c)}if(se(o))return h(e,r,o,c);if(H(o)){if(l=H(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,to(o),c);if(o.$$typeof===F)return _(e,r,ba(e,o),c);ro(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=Mi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{eo=0;var i=_(e,t,n,r);return $a=null,i}catch(t){if(t===Ua||t===Ga)throw t;var a=Ei(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ao=io(!0),oo=io(!1),so=!1;function co(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lo(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 uo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Yu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ci(e),Si(e,null,n),t}return yi(e,r,t,n),Ci(e)}function po(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,ct(e,n)}}function mo(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}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var ho=!1;function go(){if(ho){var e=Pa;if(e!==null)throw e}}function _o(e,t,n,r){ho=!1;var i=e.updateQueue;so=!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?(Qu&f)===f:(r&f)===f){f!==0&&f===Na&&(ho=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:so=!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),od|=o,e.lanes=o,e.memoizedState=d}}function vo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function yo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)vo(n[e],t)}var bo=de(null),xo=de(0);function So(e,t){e=id,pe(xo,e),pe(bo,t),id=e|t.baseLanes}function Co(){pe(xo,id),pe(bo,bo.current)}function wo(){id=xo.current,fe(bo),fe(xo)}var To=de(null),Eo=null;function Do(e){var t=e.alternate;pe(Mo,Mo.current&1),pe(To,e),Eo===null&&(t===null||bo.current!==null||t.memoizedState!==null)&&(Eo=e)}function Oo(e){pe(Mo,Mo.current),pe(To,e),Eo===null&&(Eo=e)}function ko(e){e.tag===22?(pe(Mo,Mo.current),pe(To,e),Eo===null&&(Eo=e)):Ao()}function Ao(){pe(Mo,Mo.current),pe(To,To.current)}function jo(e){fe(To),Eo===e&&(Eo=null),fe(Mo)}var Mo=de(0);function No(e,t){pe(To,To.current),pe(Mo,t)}function Po(e){fe(Mo),fe(To),Eo===e&&(Eo=null)}function Fo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Io=0,q=null,Lo=null,Ro=null,zo=!1,Bo=!1,Vo=!1,Ho=0,Uo=0,Wo=null,Go=0;function Ko(){throw Error(i(321))}function qo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Fr(e[n],t[n]))return!1;return!0}function Jo(e,t,n,r,i,a){return Io=a,q=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?dc:fc,Vo=!1,a=n(r,i),Vo=!1,Bo&&(a=Xo(t,n,r,i)),Yo(e),a}function Yo(e){U.H=uc;var t=Lo!==null&&Lo.next!==null;if(Io=0,Ro=Lo=q=null,zo=!1,Uo=0,Wo=null,t)throw Error(i(300));e===null||kc||(e=e.dependencies,e!==null&&_a(e)&&(kc=!0))}function Xo(e,t,n,r){q=e;var a=0;do{if(Bo&&(Wo=null),Uo=0,Bo=!1,25<=a)throw Error(i(301));if(a+=1,Ro=Lo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}U.H=pc,o=t(n,r)}while(Bo);return o}function Zo(){var e=U.H,t=e.useState()[0];return t=typeof t.then==`function`?is(t):t,e=e.useState()[0],(Lo===null?null:Lo.memoizedState)!==e&&(q.flags|=1024),t}function Qo(){var e=Ho!==0;return Ho=0,e}function $o(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function es(e){if(zo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}zo=!1}Io=0,Ro=Lo=q=null,Bo=!1,Uo=Ho=0,Wo=null}function ts(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ro===null?q.memoizedState=Ro=e:Ro=Ro.next=e,Ro}function ns(){if(Lo===null){var e=q.alternate;e=e===null?null:e.memoizedState}else e=Lo.next;var t=Ro===null?q.memoizedState:Ro.next;if(t!==null)Ro=t,Lo=e;else{if(e===null)throw q.alternate===null?Error(i(467)):Error(i(310));Lo=e,e={memoizedState:Lo.memoizedState,baseState:Lo.baseState,baseQueue:Lo.baseQueue,queue:Lo.queue,next:null},Ro===null?q.memoizedState=Ro=e:Ro=Ro.next=e}return Ro}function rs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function is(e){var t=Uo;return Uo+=1,Wo===null&&(Wo=[]),e=Ja(Wo,e,t),t=q,(Ro===null?t.memoizedState:Ro.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?dc:fc),e}function as(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return is(e);if(e.$$typeof===re)return;if(e.$$typeof===F)return ya(e)}throw Error(i(438,String(e)))}function os(e){var t=null,n=q.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=q.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=rs(),q.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]=B;return t.index++,n}function ss(e,t){return typeof t==`function`?t(e):t}function cs(e){return ls(ns(),Lo,e)}function ls(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?(Io&f)===f:(Qu&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===Na&&(d=!0);else if((Io&p)===p){u=u.next,p===Na&&(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,q.lanes|=p,od|=p;f=u.action,Vo&&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,q.lanes|=f,od|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Fr(o,e.memoizedState)&&(kc=!0,d&&(n=Pa,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 us(e){var t=ns(),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);Fr(o,t.memoizedState)||(kc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ds(e,t,n){var r=q,a=ns(),o=K;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Fr((Lo||a).memoizedState,n);if(s&&(a.memoizedState=n,kc=!0),a=a.queue,Is(ms.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ro!==null&&!!(Ro.memoizedState.tag&1),js(e?9:8,{destroy:void 0},ps.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Xu===null)throw Error(i(349));o||Io&127||fs(r,t,n)}return n}function fs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=q.updateQueue,t===null?(t=rs(),q.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ps(e,t,n,r){t.value=n,t.getSnapshot=r,hs(t)&&gs(e)}function ms(e,t,n){return n(function(){hs(t)&&gs(e)})}function hs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Fr(e,n)}catch{return!0}}function gs(e){var t=xi(e,2);t!==null&&jd(t,e,2)}function _s(e){var t=ts();if(typeof e==`function`){var n=e;if(e=n(),Vo){We(!0);try{n()}finally{We(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:e},t}function vs(e,t,n,r){return e.baseState=n,ls(e,Lo,typeof r==`function`?r:ss)}function ys(e,t,n,r,a){if(sc(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)}};U.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,bs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function bs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=U.T,o={};o.types=a===null?null:a.types,U.T=o;try{var s=n(i,r),c=U.S;c!==null&&c(o,s),xs(e,t,s)}catch(n){Cs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),U.T=a}}else try{a=n(i,r),xs(e,t,a)}catch(n){Cs(e,t,n)}}function xs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ss(e,t,n)},function(n){return Cs(e,t,n)}):Ss(e,t,n)}function Ss(e,t,n){t.status=`fulfilled`,t.value=n,ws(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,bs(e,n)))}function Cs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ws(t),t=t.next;while(t!==r)}e.action=null}function ws(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ts(e,t){return t}function Es(e,t){if(K){var n=Xu.formState;if(n!==null){a:{var r=q;if(K){if(Qi){b:{for(var i=Qi,a=ea;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Qi=lm(i.nextSibling),r=i.data===`F!`;break a}}na(r)}r=!1}r&&(t=n[0])}}return n=ts(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ts,lastRenderedState:t},n.queue=r,n=ic.bind(null,q,r),r.dispatch=n,r=_s(!1),a=oc.bind(null,q,!1,r.queue),r=ts(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ys.bind(null,q,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ds(e){return Os(ns(),Lo,e)}function Os(e,t,n){if(t=ls(e,t,Ts)[0],e=cs(ss)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=is(t)}catch(e){throw e===Ua?Ga:e}else r=t;t=ns();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(q.flags|=2048,js(9,{destroy:void 0},ks.bind(null,i,n),null)),[r,a,e]}function ks(e,t){e.action=t}function As(e){var t=ns(),n=Lo;if(n!==null)return Os(t,n,e);ns(),t=t.memoizedState,n=ns();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function js(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=q.updateQueue,t===null&&(t=rs(),q.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 Ms(){return ns().memoizedState}function Ns(e,t,n,r){var i=ts();q.flags|=e,i.memoizedState=js(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ps(e,t,n,r){var i=ns();r=r===void 0?null:r;var a=i.memoizedState.inst;Lo!==null&&r!==null&&qo(r,Lo.memoizedState.deps)?i.memoizedState=js(t,a,n,r):(q.flags|=e,i.memoizedState=js(1|t,a,n,r))}function Fs(e,t){Ns(8390656,8,e,t)}function Is(e,t){Ps(2048,8,e,t)}function Ls(e){q.flags|=4;var t=q.updateQueue;if(t===null)t=rs(),q.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Rs(e){var t=ns().memoizedState;return Ls({ref:t,nextImpl:e}),function(){if(Yu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function zs(e,t){return Ps(4,2,e,t)}function Bs(e,t){return Ps(4,4,e,t)}function Vs(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 Hs(e,t,n){n=n==null?null:n.concat([e]),Ps(4,4,Vs.bind(null,t,e),n)}function Us(){}function Ws(e,t){var n=ns();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&qo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Gs(e,t){var n=ns();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&qo(t,r[1]))return r[0];if(r=e(),Vo){We(!0);try{e()}finally{We(!1)}}return n.memoizedState=[r,t],r}function Ks(e,t,n){return n===void 0||Io&1073741824&&!(Qu&261930)?e.memoizedState=t:(e.memoizedState=n,e=kd(),q.lanes|=e,od|=e,n)}function qs(e,t,n,r){return Fr(n,t)?n:bo.current===null?!(Io&106)||Io&1073741824&&!(Qu&261930)?(kc=!0,e.memoizedState=n):(e=kd(),q.lanes|=e,od|=e,t):(e=Ks(e,n,r),Fr(e,t)||(kc=!0),e)}function Js(e,t,n,r,i){var a=W.p;W.p=a!==0&&8>a?a:8;var o=U.T,s={};s.types=o===null?null:o.types,U.T=s,oc(e,!1,t,n);try{var c=i(),l=U.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ac(e,t,La(c,r),Od(e)):ac(e,t,r,Od(e))}catch(n){ac(e,t,{then:function(){},status:`rejected`,reason:n},Od())}finally{W.p=a,o!==null&&s.types!==null&&(o.types=s.types),U.T=o}}function Ys(){}function Xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Zs(e).queue;Js(e,a,t,ce,n===null?Ys:function(){return Qs(e),n(r)})}function Zs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qs(e){var t=Zs(e);t.next===null&&(t=e.alternate.memoizedState),ac(e,t.next.queue,{},Od())}function $s(){return ya(sh)}function ec(){return ns().memoizedState}function tc(){return ns().memoizedState}function nc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Od();e=uo(n);var r=fo(t,e,n);r!==null&&(jd(r,t,n),po(r,t,n)),t={cache:Ea()},e.payload=t;return}t=t.return}}function rc(e,t,n){var r=Od();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},sc(e)?cc(t,n):(n=bi(e,t,n,r),n!==null&&(jd(n,e,r),lc(n,t,r)))}function ic(e,t,n){ac(e,t,n,Od())}function ac(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(sc(e))cc(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,Fr(s,o))return yi(e,t,i,0),Xu===null&&vi(),!1}catch{}if(n=bi(e,t,i,r),n!==null)return jd(n,e,r),lc(n,t,r),!0}return!1}function oc(e,t,n,r){if(r={lane:2,revertLane:Mf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},sc(e)){if(t)throw Error(i(479))}else t=bi(e,n,r,2),t!==null&&jd(t,e,2)}function sc(e){var t=e.alternate;return e===q||t!==null&&t===q}function cc(e,t){Bo=zo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ct(e,n)}}var uc={readContext:ya,use:as,useCallback:Ko,useContext:Ko,useEffect:Ko,useImperativeHandle:Ko,useLayoutEffect:Ko,useInsertionEffect:Ko,useMemo:Ko,useReducer:Ko,useRef:Ko,useState:Ko,useDebugValue:Ko,useDeferredValue:Ko,useTransition:Ko,useSyncExternalStore:Ko,useId:Ko,useHostTransitionStatus:Ko,useFormState:Ko,useActionState:Ko,useOptimistic:Ko,useMemoCache:Ko,useCacheRefresh:Ko,useEffectEvent:Ko},dc={readContext:ya,use:as,useCallback:function(e,t){return ts().memoizedState=[e,t===void 0?null:t],e},useContext:ya,useEffect:Fs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ns(4194308,4,Vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ns(4194308,4,e,t)},useInsertionEffect:function(e,t){Ns(4,2,e,t)},useMemo:function(e,t){var n=ts();t=t===void 0?null:t;var r=e();if(Vo){We(!0);try{e()}finally{We(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ts();if(n!==void 0){var i=n(t);if(Vo){We(!0);try{n(t)}finally{We(!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=rc.bind(null,q,e),[r.memoizedState,e]},useRef:function(e){var t=ts();return e={current:e},t.memoizedState=e},useState:function(e){e=_s(e);var t=e.queue,n=ic.bind(null,q,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Us,useDeferredValue:function(e,t){return Ks(ts(),e,t)},useTransition:function(){var e=_s(!1);return e=Js.bind(null,q,e.queue,!0,!1),ts().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=q,a=ts();if(K){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xu===null)throw Error(i(349));Qu&127||fs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Fs(ms.bind(null,r,o,e),[e]),r.flags|=2048,js(9,{destroy:void 0},ps.bind(null,r,o,n,t),null),n},useId:function(){var e=ts(),t=Xu.identifierPrefix;if(K){var n=Gi,r=Wi;n=(r&~(1<<32-Ge(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Ho++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:$s,useFormState:Es,useActionState:Es,useOptimistic:function(e){var t=ts();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=oc.bind(null,q,!0,n),n.dispatch=t,[e,t]},useMemoCache:os,useCacheRefresh:function(){return ts().memoizedState=nc.bind(null,q)},useEffectEvent:function(e){var t=ts(),n={impl:e};return t.memoizedState=n,function(){if(Yu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},fc={readContext:ya,use:as,useCallback:Ws,useContext:ya,useEffect:Is,useImperativeHandle:Hs,useInsertionEffect:zs,useLayoutEffect:Bs,useMemo:Gs,useReducer:cs,useRef:Ms,useState:function(){return cs(ss)},useDebugValue:Us,useDeferredValue:function(e,t){return qs(ns(),Lo.memoizedState,e,t)},useTransition:function(){var e=cs(ss)[0],t=ns().memoizedState;return[typeof e==`boolean`?e:is(e),t]},useSyncExternalStore:ds,useId:ec,useHostTransitionStatus:$s,useFormState:Ds,useActionState:Ds,useOptimistic:function(e,t){return vs(ns(),Lo,e,t)},useMemoCache:os,useCacheRefresh:tc,useEffectEvent:Rs},pc={readContext:ya,use:as,useCallback:Ws,useContext:ya,useEffect:Is,useImperativeHandle:Hs,useInsertionEffect:zs,useLayoutEffect:Bs,useMemo:Gs,useReducer:us,useRef:Ms,useState:function(){return us(ss)},useDebugValue:Us,useDeferredValue:function(e,t){var n=ns();return Lo===null?Ks(n,e,t):qs(n,Lo.memoizedState,e,t)},useTransition:function(){var e=us(ss)[0],t=ns().memoizedState;return[typeof e==`boolean`?e:is(e),t]},useSyncExternalStore:ds,useId:ec,useHostTransitionStatus:$s,useFormState:As,useActionState:As,useOptimistic:function(e,t){var n=ns();return Lo===null?(n.baseState=e,[e,n.queue.dispatch]):vs(n,Lo,e,t)},useMemoCache:os,useCacheRefresh:tc,useEffectEvent:Rs};function mc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Od(),i=uo(r);i.payload=t,n!=null&&(i.callback=n),t=fo(e,i,r),t!==null&&(jd(t,e,r),po(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Od(),i=uo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=fo(e,i,r),t!==null&&(jd(t,e,r),po(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Od(),r=uo(n);r.tag=2,t!=null&&(r.callback=t),t=fo(e,r,n),t!==null&&(jd(t,e,n),po(t,e,n))}};function gc(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?!Ir(n,r)||!Ir(i,a):!0}function _c(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&&hc.enqueueReplaceState(t,t.state,null)}function vc(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=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function yc(e){mi(e)}function bc(e){console.error(e)}function xc(e){mi(e)}function Sc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Cc(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 wc(e,t,n){return n=uo(n),n.tag=3,n.payload={element:null},n.callback=function(){Sc(e,t)},n}function Tc(e){return e=uo(e),e.tag=3,e}function Ec(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(){Cc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Cc(t,n,r),typeof i!=`function`&&(gd===null?gd=new Set([this]):gd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Dc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ga(t,n,a,!0),n=To.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Eo===null?Ud():n.alternate===null&&ad===0&&(ad=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ka?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ff(e,r,a)),!1;case 22:return n.flags|=65536,r===Ka?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)),ff(e,r,a)),!1}throw Error(i(435,n.tag))}return ff(e,r,a),Ud(),!1}if(K)return t=To.current,t===null?(r!==ta&&(t=Error(i(423),{cause:r}),ca(Ii(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ii(r,n),a=wc(e.stateNode,r,a),mo(e,a),ad!==4&&(ad=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ta&&(e=Error(i(422),{cause:r}),ca(Ii(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ii(o,n),dd===null?dd=[o]:dd.push(o),ad!==4&&(ad=2),t===null)return!0;r=Ii(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=wc(n.stateNode,r,e),mo(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`&&(gd===null||!gd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Tc(a),Ec(a,e,n,r),mo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Oc=Error(i(461)),kc=!1;function Ac(e,t,n,r){t.child=e===null?oo(t,null,n,r):ao(t,e.child,n,r)}function jc(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 va(t),r=Jo(e,t,n,o,a,i),s=Qo(),e!==null&&!kc?($o(e,t,i),al(e,t,i)):(K&&s&&Ji(t),t.flags|=1,Ac(e,t,r,i),t.child)}function Mc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Di(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Nc(e,t,a,r,i)):(e=Ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ol(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ir:n,n(o,r)&&e.ref===t.ref)return al(e,t,i)}return t.flags|=1,e=Oi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Nc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ir(a,r)&&e.ref===t.ref){if(kc=!1,t.pendingProps=r=a,ol(e,i))e.flags&131072&&(kc=!0);else return t.lanes=e.lanes,al(e,t,i)}}return Vc(e,t,n,r,i)}function Pc(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 Ic(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Va(t,a===null?null:a.cachePool),a===null?Co():So(t,a),ko(t);else return r=t.lanes=536870912,Ic(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Va(t,null),Co(),Ao()):(Va(t,a.cachePool),So(t,a),Ao(),t.memoizedState=null);return Ac(e,t,i,n),t.child}function Fc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ic(e,t,n,r,i){var a=Ba();return a=a===null?null:{parent:Ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Va(t,null),Co(),ko(t),e!==null&&ga(e,t,r,!0),t.childLanes=i,null}function Lc(e,t){return t=Xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Rc(e,t,n){return ao(t,e.child,null,n),e=Lc(t,t.pendingProps),e.flags|=2,jo(t),t.memoizedState=null,e}function zc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(K){if(r.mode===`hidden`)return e=Lc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Fc(null,e);if(Oo(t),(e=Qi)?(e=am(e,ea),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ui===null?null:{id:Wi,overflow:Gi},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Zi=t,Qi=null)):e=null,e===null)throw na(t);return t.lanes=536870912,null}return Lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Oo(t),a){if(t.flags&256)t.flags&=-257,t=Rc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(kc||ga(e,t,n,!1),a=(n&e.childLanes)!==0,kc||a){if(bo.current===null){if(r=Xu,r!==null&&(s=lt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,xi(e,s),jd(r,e,s),Oc;Ud()}t=Rc(e,t,n)}else e=o.treeContext,Qi=lm(s.nextSibling),Zi=t,K=!0,$i=null,ea=!1,e!==null&&Xi(t,e),t=Lc(t,r),t.flags|=134221824;return t}return e=Oi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Bc(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 Vc(e,t,n,r,i){return va(t),n=Jo(e,t,n,r,void 0,i),r=Qo(),e!==null&&!kc?($o(e,t,i),al(e,t,i)):(K&&r&&Ji(t),t.flags|=1,Ac(e,t,n,i),t.child)}function Hc(e,t,n,r,i,a){return va(t),t.updateQueue=null,n=Xo(t,r,n,i),Yo(e),r=Qo(),e!==null&&!kc?($o(e,t,a),al(e,t,a)):(K&&r&&Ji(t),t.flags|=1,Ac(e,t,n,a),t.child)}function Uc(e,t,n,r,i){if(va(t),t.stateNode===null){var a=wi,o=n.contextType;typeof o==`object`&&o&&(a=ya(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=hc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},co(t),o=n.contextType,a.context=typeof o==`object`&&o?ya(o):wi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(mc(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&&hc.enqueueReplaceState(a,a.state,null),_o(t,r,a,i),go(),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=vc(n,s);a.props=c;var l=a.context,u=n.contextType;o=wi,typeof u==`object`&&u&&(o=ya(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)&&_c(t,a,r,o),so=!1;var f=t.memoizedState;a.state=f,_o(t,r,a,i),go(),l=t.memoizedState,s||f!==l||so?(typeof d==`function`&&(mc(t,n,d,r),l=t.memoizedState),(c=so||gc(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,lo(e,t),o=t.memoizedProps,u=vc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=wi,typeof l==`object`&&l&&(c=ya(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)&&_c(t,a,r,c),so=!1,f=t.memoizedState,a.state=f,_o(t,r,a,i),go();var p=t.memoizedState;o!==d||f!==p||so||e!==null&&e.dependencies!==null&&_a(e.dependencies)?(typeof s==`function`&&(mc(t,n,s,r),p=t.memoizedState),(u=so||gc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&_a(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,Bc(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=ao(t,e.child,null,i),t.child=ao(t,null,n,i)):Ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=al(e,t,i),e}function Wc(e,t,n,r){return oa(),t.flags|=256,Ac(e,t,n,r),t.child}var Gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kc(e){return{baseLanes:e,cachePool:Ha()}}function qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ld),e}function Jc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Mo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(K){if(i?Do(t):Ao(),(e=Qi)?(e=am(e,ea),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ui===null?null:{id:Wi,overflow:Gi},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Zi=t,Qi=null)):e=null,e===null)throw na(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Ao(),i=t.mode,a=Xc({mode:`hidden`,children:a},i),r=ji(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Kc(n),r.childLanes=qc(e,o,n),t.memoizedState=Gc,Fc(null,r)):(Do(t),Yc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Qc(e,t,a,o,r,c,s,n)}return i?(Ao(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Oi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=ji(i,a,n,null),i.flags|=2):i=Oi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Fc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Kc(n):(a=i.cachePool,a===null?a=Ha():(s=Ta._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=qc(e,o,n),t.memoizedState=Gc,Fc(e.child,r)):(Do(t),n=e.child,e=n.sibling,n=Oi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Yc(e,t){return t=Xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Xc(e,t){return e=Ei(22,e,null,t),e.lanes=0,e}function Zc(e,t,n){return ao(t,e.child,null,n),e=Yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Do(t),t.flags&=-257,Zc(e,t,c)):t.memoizedState===null?(Ao(),o=a.fallback,s=t.mode,a=Xc({mode:`visible`,children:a.children},s),o=ji(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,ao(t,e.child,null,c),a=t.child,a.memoizedState=Kc(c),a.childLanes=qc(e,r,c),t.memoizedState=Gc,Fc(null,a)):(Ao(),t.child=e.child,t.flags|=128,null);if(Do(t),sm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ca({value:a,source:null,stack:null})),Zc(e,t,c)}if(kc||ga(e,t,c,!1),r=(c&e.childLanes)!==0,kc||r){if(bo.current!==null)return Zc(e,t,c);if(r=Xu,r!==null&&(a=lt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,xi(e,a),jd(r,e,a),Oc;return om(o)||Ud(),Zc(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Qi=lm(o.nextSibling),Zi=t,K=!0,$i=null,ea=!1,e!==null&&Xi(t,e),t=Yc(t,a.children),t.flags|=134221824,t)}function $c(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ma(e.return,t,n)}function el(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Fo(n)===null&&(t=e),e=e.sibling}return t}function tl(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 nl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function rl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Mo.current;if(t.flags&128)return No(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,No(t,o),i===`backwards`&&e!==null?(nl(e),Ac(e,t,r,n),nl(e)):Ac(e,t,r,n),r=K?Bi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$c(e,n,t);else if(e.tag===19)$c(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`backwards`:n=el(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,nl(t)),tl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Fo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}tl(t,!0,n,null,a,r);break;case`together`:tl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=el(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),tl(t,!1,i,n,a,r)}return t.child}function il(e,t,n){var r=t.pendingProps;return fa(t,t.type,r.value),Ac(e,t,r.children,n),t.child}function al(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),od|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ga(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=Oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ol(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&_a(e)))}function sl(e,t,n){switch(t.tag){case 3:ve(t,t.stateNode.containerInfo),fa(t,Ta,e.memoizedState.cache),oa();break;case 27:case 5:G(t);break;case 4:ve(t,t.stateNode.containerInfo);break;case 10:fa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Oo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Do(t),t.flags|=128,null;r=ga(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Jc(e,t,n):(Do(t),e=al(e,t,n),e===null?null:e.sibling)}Do(t);break;case 19:if(t.flags&128)return rl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ga(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return rl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),No(t,Mo.current),r)break;return null;case 22:return t.lanes=0,Pc(e,t,n,t.pendingProps);case 24:fa(t,Ta,e.memoizedState.cache)}return al(e,t,n)}function cl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)kc=!0;else{if(!ol(e,n)&&!(t.flags&128))return kc=!1,sl(e,t,n);kc=!!(e.flags&131072)}}else kc=!1,K&&t.flags&1048576&&qi(t,Bi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ya(t.elementType),t.type=e,typeof e==`function`)Di(e)?(r=vc(e,r),t.tag=1,t=Uc(null,t,e,r,n)):(t.tag=0,t=Vc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=jc(null,t,e,r,n);break a}if(a===te){t.tag=14,t=Mc(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=il(null,t,n);break a}}throw t=oe(e)||e,Error(i(306,t,``))}}return t;case 0:return Vc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=vc(r,t.pendingProps),Uc(e,t,r,a,n);case 3:a:{if(ve(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,lo(e,t),_o(t,r,null,n);var s=t.memoizedState;if(r=s.cache,fa(t,Ta,r),r!==o.cache&&ha(t,[Ta],n,!0),go(),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=Wc(e,t,r,n);break a}if(r!==a){a=Ii(Error(i(424)),t),ca(a),t=Wc(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(Qi=lm(e.firstChild),Zi=t,K=!0,$i=null,ea=!0,n=oo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(oa(),r===a){t=al(e,t,n);break a}Ac(e,t,r,n)}t=t.child}return t;case 26:return Bc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:K||(t.stateNode=fp(t.type,t.pendingProps,ge.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return G(t),e===null&&K&&(r=t.stateNode=hm(t.type,t.pendingProps,ge.current),Zi=t,ea=!0,a=Qi,Sp(t.type)?(um=a,Qi=lm(r.firstChild)):Qi=a),Ac(e,t,t.pendingProps.children,n),Bc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&K&&((a=r=Qi)&&(r=rm(r,t.type,t.pendingProps,ea),r===null?a=!1:(t.stateNode=r,Zi=t,Qi=lm(r.firstChild),ea=!1,a=!0)),a||na(t)),G(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(a,o)?r=null:s!==null&&pp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Jo(e,t,Zo,null,null,n),sh._currentValue=a),Bc(e,t),Ac(e,t,r,n),t.child;case 6:return e===null&&K&&((e=n=Qi)&&(n=im(n,t.pendingProps,ea),n===null?e=!1:(t.stateNode=n,Zi=t,Qi=null,e=!0)),e||na(t)),null;case 13:return Jc(e,t,n);case 4:return ve(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ao(t,null,r,n):Ac(e,t,r,n),t.child;case 11:return jc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Bc(e,t),Ac(e,t,r,n),t.child;case 8:return Ac(e,t,t.pendingProps.children,n),t.child;case 12:return Ac(e,t,t.pendingProps.children,n),t.child;case 10:return il(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,va(t),a=ya(a),r=r(a),t.flags|=1,Ac(e,t,r,n),t.child;case 14:return Mc(e,t,t.type,t.pendingProps,n);case 15:return Nc(e,t,t.type,t.pendingProps,n);case 19:return rl(e,t,n);case 31:return zc(e,t,n);case 22:return Pc(e,t,n,t.pendingProps);case 24:return va(t),r=ya(Ta),e===null?(a=Ba(),a===null&&(a=Xu,o=Ea(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},co(t),fa(t,Ta,a)):((e.lanes&n)!==0&&(lo(e,t),_o(t,null,null,n),go()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,fa(t,Ta,r),r!==a.cache&&ha(t,[Ta],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),fa(t,Ta,r))),Ac(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:K&&Ji(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Bc(e,t),Ac(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ll(e){e.flags|=4}function ul(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Bd())e.flags|=8192;else throw Xa=Ka,Wa}}else e.flags&=-16777217}function dl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Bd())e.flags|=8192;else throw Xa=Ka,Wa}}function fl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:rt(),e.lanes|=t,ud|=t)}function pl(e,t){if(!K)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function ml(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&1206910976,r|=i.flags&1206910976,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 hl(e,t,n){var r=t.pendingProps;switch(Yi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ml(t),null;case 1:return ml(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),pa(Ta),ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(aa(t)?ll(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,sa())),ml(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ll(t),o===null?(ml(t),ul(t,a,null,r,n)):(ml(t),dl(t,o))):o?o===e.memoizedState?(ml(t),t.flags&=-16777217):(ll(t),ml(t),dl(t,o)):(e=e.memoizedProps,e!==r&&ll(t),ml(t),ul(t,a,e,r,n)),null;case 27:if(be(t),n=ge.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ml(t),t.subtreeFlags&=-33554433,null}e=me.current,aa(t)?ra(t,e):(e=hm(a,r,n),t.stateNode=e,ll(t))}return ml(t),t.subtreeFlags&=-33554433,null;case 5:if(be(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ml(t),t.subtreeFlags&=-33554433,null}if(o=me.current,aa(t))ra(t,o);else{var s=lp(ge.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[ht]=t,o[gt]=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(np(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&&ll(t)}}return ml(t),t.subtreeFlags&=-33554433,ul(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ll(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ge.current,aa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Zi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ht]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||na(t,!0)}else e=lp(e).createTextNode(r),e[ht]=t,t.stateNode=e}return ml(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=aa(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[ht]=t}else oa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ml(t),e=!1}else n=sa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(jo(t),t):(jo(t),null);if(t.flags&128)throw Error(i(558))}return ml(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=aa(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[ht]=t}else oa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ml(t),a=!1}else a=sa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(jo(t),t):(jo(t),null)}return jo(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),fl(t,t.updateQueue),ml(t),null);case 4:return ye(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,ml(t),null;case 10:return pa(t.type),ml(t),null;case 19:if(Po(t),r=t.memoizedState,r===null)return ml(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)pl(r,!1);else{if(ad!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Fo(e),o!==null){for(t.flags|=128,pl(r,!1),e=o.updateQueue,t.updateQueue=e,fl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ki(n,e),n=n.sibling;return No(t,Mo.current&1|2),K&&Ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ne()>hd&&(t.flags|=128,a=!0,pl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,fl(t,e),pl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!K)return ml(t),null}else 2*Ne()-r.renderingStartTime>hd&&n!==536870912&&(t.flags|=128,a=!0,pl(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ne(),e.sibling=null,o=Mo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||K?No(t,o):(n=o,pe(To,t),pe(Mo,n),Eo===null&&(Eo=t)),K&&Ki(t,r.treeForkCount),e}return ml(t),null;case 22:case 23:return jo(t),wo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(ml(t),t.subtreeFlags&6&&(t.flags|=8192)):ml(t),n=t.updateQueue,n!==null&&fl(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&&fe(za),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),pa(Ta),ml(t),null;case 25:return null;case 30:return t.flags|=33554432,ml(t),null}throw Error(i(156,t.tag))}function gl(e,t){switch(Yi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pa(Ta),ye(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return be(t),null;case 31:if(t.memoizedState!==null){if(jo(t),t.alternate===null)throw Error(i(340));oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Po(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ye(),null;case 10:return pa(t.type),null;case 22:case 23:return jo(t),wo(),e!==null&&fe(za),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return pa(Ta),null;case 25:return null;default:return null}}function _l(e,t){switch(Yi(t),t.tag){case 3:pa(Ta),ye();break;case 26:case 27:case 5:be(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&jo(t);break;case 13:jo(t);break;case 19:Po(t);break;case 10:pa(t.type);break;case 22:case 23:jo(t),wo(),e!==null&&fe(za);break;case 24:pa(Ta)}}function vl(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){df(t,t.return,e)}}function J(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){df(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){df(t,t.return,e)}}function yl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{yo(t,n)}catch(t){df(e,e.return,t)}}}function bl(e,t,n){n.props=vc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){df(e,t,n)}}function Y(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:var i=e.stateNode,a=di(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);m(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){df(e,t,n)}}function X(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){df(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){df(e,t,n)}else n.current=null}}function xl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function Sl(e){for(var t=e.return;t!==null&&(Tl(t)&&em(e.stateNode,t.stateNode),!wl(t));)t=t.return}function Cl(e){for(var t=e.return;t!==null&&(Tl(t)&&tm(e.stateNode,t.stateNode),!wl(t));)t=t.return}function wl(e){return e.tag===5||e.tag===3||e.tag===27}function Tl(e){return e&&e.tag===7&&e.stateNode!==null}function El(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){df(e,e.return,t)}}function Dl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[gt]=t}catch(t){df(e,e.return,t)}}function Ol(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function kl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ol(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&&Sp(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 Al(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=fn)),xl(e,r),zt=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Al(e,t,n,r),e=e.sibling;e!==null;)Al(e,t,n,r),e=e.sibling}function jl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),xl(e,r),zt=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(jl(e,t,n,r),e=e.sibling;e!==null;)jl(e,t,n,r),e=e.sibling}function Ml(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[ht]=e,t[gt]=n}catch(t){df(e,e.return,t)}}var Nl=!1,Pl=null;function Fl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Nl=!0)}var Il=null;function Ll(){var e=Il;return Il=null,e}var Rl=0;function zl(e,t,n,r,i){return Rl=0,Bl(e.child,t,n,r,i)}function Bl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Nl=!0,Tp(o,Rl===0?t:t+`_`+Rl,n),Rl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Bl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Vl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Vl(e.child,t),e=e.sibling}function Hl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Hl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=pi(t.default,t.share),t!==`none`&&(zl(e,n,t,null,!1)||Vl(e.child,!1))}e=e.sibling}}function Ul(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=di(r,n),a=pi(r.default,n.paired?r.share:r.enter);a===`none`?Hl(e):zl(e,i,a,null,!1)?(Hl(e),n.paired||t||Ad(e,r.onEnter)):Vl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ul(e,t),e=e.sibling;else Hl(e)}function Wl(e){if(Pl!==null&&Pl.size!==0){var t=Pl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=pi(n.default,n.share);if(a!==`none`&&(zl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ad(e,n.onShare)):Vl(e.child,!1)),t.delete(r),t.size===0)break}}}Wl(e)}e=e.sibling}}}function Gl(e){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode),r=Pl===null?void 0:Pl.get(n),i=pi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(zl(e,n,i,null,!1)?r===void 0?Ad(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Pl.delete(n),Ad(e,t.onShare)):Vl(e.child,!1)),Pl!==null&&Wl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e),e=e.sibling;else Pl!==null&&Wl(e)}function Kl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode);t=pi(t.default,t.update),e.flags&=-5,t!==`none`&&zl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Kl(e);e=e.sibling}}function ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Vl(e.child,!1))}ql(e)}e=e.sibling}}function Jl(e){if(e.tag===30)e.stateNode.paired=null,Vl(e.child,!1),ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e),e=e.sibling;else ql(e)}function Yl(e){for(e=e.child;e!==null;)e.tag===30?Vl(e.child,!1):e.subtreeFlags&33554432&&Yl(e),e=e.sibling}function Xl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Rl<a.length){var l=a[Rl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Rl===0?n:n+`_`+Rl,i),s&&e.flags&4||(Il===null&&(Il=[]),Il.push(c,Rl===0?r:r+`_`+Rl,t.memoizedProps)),Rl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Xl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Zl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=di(n,r),a=pi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Rl=0,i=Xl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ad(e,n.onUpdate))}else e.subtreeFlags&33554432&&Zl(e,t);e=e.sibling}}var Ql=!1,$l=!1,eu=!1,tu=!1,nu=typeof WeakSet==`function`?WeakSet:Set,ru=null,iu=!1,au=!1,ou=!1,su=!1;function cu(e,t,n){if(e=e.containerInfo,sp=gh,e=Vr(e),Hr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,ru=t,t=n?9270:1024;ru!==null;){if(e=ru,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Gl(r[a]);if(e.alternate===null&&e.flags&2)n&&Fl(e),lu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Gl(r),lu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Fl(e),lu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ru=r):(n&&Kl(e),lu(n))}}Pl=null}function lu(e){for(;ru!==null;){var t=ru,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=vc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){df(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=di(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=pi(a.default,a.update),a!==`none`&&zl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,ru=r;break}ru=t.return}}function uu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Au(e,n),r&4&&vl(5,n);break;case 1:if(Au(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){df(n,n.return,e)}else{var i=vc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){df(n,n.return,e)}}}r&64&&yl(n),r&512&&Y(n,n.return);break;case 3:if(Au(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{yo(e,t)}catch(e){df(n,n.return,e)}}break;case 27:t===null&&r&4&&Ml(n);case 26:case 5:Au(e,n),t===null&&r&4&&El(n),r&512&&Y(n,n.return);break;case 12:Au(e,n);break;case 31:Au(e,n),r&4&&yu(e,n);break;case 13:Au(e,n),r&4&&bu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=hf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||Ql,!r){var a=t!==null&&t.memoizedState!==null||$l;t=Ql,i=$l,Ql=r,($l=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Mu(e,n,r)):Au(e,n),Ql=t,$l=i}break;case 30:Au(e,n),r&512&&Y(n,n.return);break;case 7:r&512&&Y(n,n.return);default:Au(e,n)}}function du(e,t){for(e=e.child;e!==null;)fu(e,t),e=e.sibling}function fu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){df(e,e.return,t)}pu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,zt=!0}catch(t){df(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){df(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&du(e,t);break;default:du(e,t)}}function pu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:fu(n,r);break a;case 22:n.memoizedState===null&&pu(n,r);break a;default:pu(n,r)}}e=e.sibling}}function mu(e){var t=e.alternate;t!==null&&(e.alternate=null,mu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&wt(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 hu=null,gu=!1;function _u(e,t,n){for(n=n.child;n!==null;)vu(e,t,n),n=n.sibling}function vu(e,t,n){if(Ue&&typeof Ue.onCommitFiberUnmount==`function`)try{Ue.onCommitFiberUnmount(He,n)}catch{}switch(n.tag){case 26:$l||X(n,t),_u(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!$l&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$l||X(n,t),Cl(n);var r=hu,i=gu;Sp(n.type)&&(hu=n.stateNode,gu=!1),_u(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),hu=r,gu=i;break;case 5:$l||X(n,t),Cl(n);case 6:if(n.tag===6&&Cl(n),r=hu,i=gu,hu=null,_u(e,t,n),hu=r,gu=i,hu!==null){if(gu)try{(hu.nodeType===9?hu.body:hu.nodeName===`HTML`?hu.ownerDocument.body:hu).removeChild(n.stateNode),zt=!0}catch(e){df(n,t,e)}else try{hu.removeChild(n.stateNode),zt=!0}catch(e){df(n,t,e)}}break;case 18:hu!==null&&(gu?(e=hu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(hu,n.stateNode));break;case 4:r=hu,i=gu,hu=n.stateNode.containerInfo,gu=!0,_u(e,t,n),hu=r,gu=i;break;case 0:case 11:case 14:case 15:J(2,n,t),$l||J(4,n,t),_u(e,t,n);break;case 1:$l||(X(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&bl(n,t,r)),_u(e,t,n);break;case 21:_u(e,t,n);break;case 22:$l=(r=$l)||n.memoizedState!==null,_u(e,t,n),$l=r;break;case 30:X(n,t),_u(e,t,n);break;case 7:$l||X(n,t),_u(e,t,n);break;default:_u(e,t,n)}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){df(t,t.return,e)}}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){df(t,t.return,e)}}function xu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nu),t;default:throw Error(i(435,e.tag))}}function Su(e,t){var n=xu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=gf.bind(null,e,t);t.then(r,r)}})}function Cu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){hu=l.stateNode,gu=!1;break a}break;case 5:hu=l.stateNode,gu=!1;break a;case 3:case 4:hu=l.stateNode.containerInfo,gu=!0;break a}l=l.return}if(hu===null)throw Error(i(160));vu(s,c,o),hu=null,gu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tu(t,e,n),t=t.sibling}var wu=null;function Tu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Cu(t,e,n),Eu(e),a&4&&(J(3,e,e.return),vl(3,e),J(5,e,e.return));break;case 1:Cu(t,e,n),Eu(e),a&512&&($l||r===null||X(r,r.return)),a&64&&Ql&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=wu,Cu(t,e,n),Eu(e),a&512&&($l||r===null||X(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(Ql)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[St]||r[ht]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),np(r,t,n),r[ht]=e,kt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[ht]=e,kt(r),t=r}e.stateNode=t}}else Ql||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Dl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||$l||t.parentNode.removeChild(t)):a.count--,n===null?Ql||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:Cu(t,e,n),Eu(e),a&512&&($l||r===null||X(r,r.return)),r!==null&&a&4&&Dl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=eu,eu=!1,Cu(t,e,n),eu=o,Eu(e),a&512&&($l||r===null||X(r,r.return)),e.flags&32){t=e.stateNode;try{rn(t,``),zt=!0}catch(t){df(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Dl(e,t,r===null?t:r.memoizedProps)),a&1024&&(tu=!0);break;case 6:if(Cu(t,e,n),Eu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,zt=!0}catch(t){df(e,e.return,t)}}break;case 3:if(zt=!1,Wm=null,o=wu,wu=bm(t.containerInfo),Cu(t,e,n),wu=o,Eu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){df(e,e.return,t)}tu&&(tu=!1,Du(e)),zt=!1;break;case 4:a=eu,eu=Ql,r=Bt(),o=wu,wu=bm(e.stateNode.containerInfo),Cu(t,e,n),Eu(e),wu=o,zt&&au&&(ou=!0),zt=r,eu=a;break;case 12:Cu(t,e,n),Eu(e);break;case 31:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 13:Cu(t,e,n),Eu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(md=Ne()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Ql,l=$l,u=eu;Ql=c||o,eu=u||o,$l=l||s,Cu(t,e,n),$l=l,eu=u,Ql=c,Eu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Ql||$l||(t=s||$l,n=Ql,r=$l,Ql=o||Ql,$l=t,ju(e,2),Ql=n,$l=r),!o&&eu||du(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Su(e,n))));break;case 19:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 30:a&512&&($l||r===null||X(r,r.return)),a=Bt(),o=au,s=(n&335544064)===n,c=e.memoizedProps,au=s&&pi(c.default,c.update)!==`none`,Cu(t,e,n),Eu(e),s&&r!==null&&zt&&(e.flags|=4),au=o,zt=a;break;case 21:break;case 7:a&512&&($l||r===null||X(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Cu(t,e,n),Eu(e)}}function Eu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ol(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Tl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(wl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;jl(e,kl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(rn(l,``),n.flags&=-33),jl(e,kl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Al(e,kl(e),u,s);break;default:throw Error(i(161))}}catch(t){df(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Du(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Du(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Ou(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ku(t,e),t=t.sibling;else Zl(t,!1)}function ku(e,t){var n=e.alternate;if(n===null)Ul(e,!1);else switch(e.tag){case 3:if(su=iu=!1,Ll(),Ou(t,e),!iu&&!ou){if(e=Il,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),su=!0}Il=null;break;case 5:Ou(t,e);break;case 4:r=iu,iu=!1,Ou(t,e),iu&&(ou=!0),iu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Ou(t,e):Ul(e,!1));break;case 30:r=iu,i=Ll(),iu=!1,Ou(t,e),iu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=di(a,o),o=di(n.memoizedProps,o);var s=pi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Rl=0,t=Xl(e,n,t,o,s,a,!0),Rl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ad(e,e.memoizedProps.onUpdate),Il=i):i!==null&&(i.push.apply(i,Il),Il=i),iu=e.flags&32?!0:r;break;default:Ou(t,e)}}function Au(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)uu(e,t.alternate,t),t=t.sibling}function ju(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:J(4,n,n.return),ju(n,r);break;case 1:X(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&bl(n,n.return,i),ju(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:X(n,n.return),n.tag!==5&&n.tag!==27||Cl(n),ju(n,r);break;case 6:Cl(n);break;case 26:X(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||$l||i.parentNode.removeChild(i),ju(n,r);break;case 22:n.memoizedState===null&&ju(n,r);break;case 30:X(n,n.return),ju(n,r);break;case 7:X(n,n.return);default:ju(n,r)}e=e.sibling}}function Mu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Mu(i,a,n),vl(4,a);break;case 1:if(Mu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){df(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)vo(l[i],c)}catch(e){df(r,r.return,e)}}s&&o&64&&yl(a),Y(a,a.return);break;case 27:n&2&&Ml(a);case 5:a.tag!==5&&a.tag!==27||Sl(a),Mu(i,a,n),s&&r===null&&o&4&&El(a),Y(a,a.return);break;case 6:Sl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Ql||Km(bm(c.ownerDocument),a.type,c),Mu(i,a,n),s&&r===null&&o&4&&El(a),Y(a,a.return);break;case 12:Mu(i,a,n);break;case 31:Mu(i,a,n),s&&o&4&&yu(i,a);break;case 13:Mu(i,a,n),s&&o&4&&bu(i,a);break;case 22:a.memoizedState===null&&Mu(i,a,n),Y(a,a.return);break;case 30:Mu(i,a,n),Y(a,a.return);break;case 7:Y(a,a.return);default:Mu(i,a,n)}t=t.sibling}}function Nu(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&&Da(n))}function Pu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Da(e))}function Fu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Iu(e,t,n,r),t=t.sibling;else i&&Yl(t)}function Iu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Jl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Fu(e,t,n,r),a&2048&&vl(9,t);break;case 1:Fu(e,t,n,r);break;case 3:Fu(e,t,n,r),i&&su&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Da(a)));break;case 12:if(a&2048){Fu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){df(t,t.return,e)}}else Fu(e,t,n,r);break;case 31:Fu(e,t,n,r);break;case 13:Fu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Jl(t),o._visibility&2?Fu(e,t,n,r):(o._visibility|=2,Lu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Jl(s),o._visibility&2?Fu(e,t,n,r):Ru(e,t)),a&2048&&Nu(s,t);break;case 24:Fu(e,t,n,r),a&2048&&Pu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Vl(a.child,!0),Vl(t.child,!0))),Fu(e,t,n,r);break;default:Fu(e,t,n,r)}}function Lu(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:Lu(a,o,s,c,i),vl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Lu(a,o,s,c,i)):u._visibility&2?Lu(a,o,s,c,i):Ru(a,o),i&&l&2048&&Nu(o.alternate,o);break;case 24:Lu(a,o,s,c,i),i&&l&2048&&Pu(o.alternate,o);break;default:Lu(a,o,s,c,i)}t=t.sibling}}function Ru(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:Ru(n,r),i&2048&&Nu(r.alternate,r);break;case 24:Ru(n,r),i&2048&&Pu(r.alternate,r);break;default:Ru(n,r)}t=t.sibling}}var zu=8192;function Bu(e,t,n){if(e.subtreeFlags&zu)for(e=e.child;e!==null;)Vu(e,t,n),e=e.sibling}function Vu(e,t,n){switch(e.tag){case 26:Bu(e,t,n),e.flags&zu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,wu,e.memoizedState,e.memoizedProps));break;case 5:Bu(e,t,n),e.flags&zu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=wu;wu=bm(e.stateNode.containerInfo),Bu(e,t,n),wu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=zu,zu=16777216,Bu(e,t,n),zu=r):Bu(e,t,n));break;case 30:if((e.flags&zu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Pl===null&&(Pl=new Map),Pl.set(r,i)}Bu(e,t,n);break;default:Bu(e,t,n)}}function Hu(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 Uu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Wu(e),e=e.sibling}function Wu(e){switch(e.tag){case 0:case 11:case 15:Uu(e),e.flags&2048&&J(9,e,e.return);break;case 3:Uu(e);break;case 12:Uu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Gu(e)):Uu(e);break;default:Uu(e)}}function Gu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:J(8,t,t.return),Gu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Gu(t));break;default:Gu(t)}e=e.sibling}}function Ku(e,t){for(;ru!==null;){var n=ru;switch(n.tag){case 0:case 11:case 15:J(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:Da(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ru=r;else a:for(n=e;ru!==null;){r=ru;var i=r.sibling,a=r.return;if(mu(r),r===n){ru=null;break a}if(i!==null){i.return=a,ru=i;break a}ru=a}}}var qu={getCacheForType:function(e){var t=ya(Ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ya(Ta).controller.signal}},Ju=typeof WeakMap==`function`?WeakMap:Map,Yu=0,Xu=null,Zu=null,Qu=0,$u=0,ed=null,td=!1,nd=!1,rd=!1,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=null,fd=null,pd=!1,md=0,Z=0,hd=1/0,Q=null,gd=null,_d=0,vd=null,yd=null,$=0,bd=0,xd=null,Sd=null,Cd=null,wd=null,Td=null,Ed=0,Dd=null;function Od(){return Yu&2&&Qu!==0?Qu&-Qu:U.T===null?ft():Mf()}function kd(){if(ld===0){if(!(Qu&536870912)||K){var e=Xe;Xe<<=1,!(Xe&3932160)&&(Xe=262144),ld=e}else ld=536870912}return e=To.current,e!==null&&(e.flags|=32),ld}function Ad(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(di(e.memoizedProps,n))),wd===null&&(wd=[]),wd.push(t.bind(null,r))}}function jd(e,t,n){(e===Xu&&($u===2||$u===9)||e.cancelPendingCommit!==null)&&(Rd(e,0),Fd(e,Qu,ld,!1)),at(e,n),Yu&2&&e===Xu||(e===Xu&&(!(Yu&2)&&(sd|=n),ad===4&&Fd(e,Qu,ld,!1)),wf(e))}function Md(e,t,n){if(Yu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||et(e,t),a=r?Kd(e,t):Wd(e,t,!0),o=r;do{if(a===0){nd&&!r&&Fd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Pd(n))a=Wd(e,t,!1),o=!1;else{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=dd;var l=c.current.memoizedState.isDehydrated;if(l&&(Rd(c,s).flags|=256),s=Wd(c,s,!1),s!==2&&s!==6){if(rd&&!l){c.errorRecoveryDisabledLanes|=o,sd|=o,a=4;break a}o=fd,fd=a,o!==null&&(fd===null?fd=o:fd.push.apply(fd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Rd(e,0),Fd(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&&(t&62914560)!==t)break;case 6:Fd(r,t,ld,!td);break a;case 2:fd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=md+300-Ne(),10<a)){if(Fd(r,t,ld,!td),$e(r,0,!0)!==0)break a;$=t,r.timeoutHandle=gp(Nd.bind(null,r,n,fd,Q,pd,t,ld,sd,ud,td,o,`Throttled`,-0,0),a);break a}Nd(r,n,fd,Q,pd,t,ld,sd,ud,td,o,null,-0,0)}break}}while(1);wf(e)}function Nd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:fn},Pl=null,Vu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?md-Ne():(a&4194048)===a?Z-Ne():0,m=eh(d,m),m!==null)?($=a,e.cancelPendingCommit=m($d.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Fd(e,a,o,!l)):$d(e,t,a,n,r,i,o,s,c,l,u,d)}function Pd(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(!Fr(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 Fd(e,t,n,r){t=tt(e,t),t&=~cd,t&=~sd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ge(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&st(e,n,t)}function Id(){return Yu&6?!0:(Tf(0,!1),!1)}function Ld(){if(Zu!==null){if($u===0)var e=Zu.return;else e=Zu,da=ua=null,es(e),$a=null,eo=0,e=Zu;for(;e!==null;)_l(e.alternate,e),e=e.return;Zu=null}}function Rd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),$=0,Ld(),Xu=e,Zu=n=Oi(e.current,null),Qu=t,$u=0,ed=null,td=!1,nd=et(e,t),rd=!1,ud=ld=cd=sd=od=ad=0,fd=dd=null,pd=!1,id=tt(e,t),vi(),n}function zd(e,t){q=null,U.H=uc,t===Ua||t===Ga?(t=Za(),$u=3):t===Wa?(t=Za(),$u=4):$u=t===Oc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ed=t,Zu===null&&(ad=1,Sc(e,Ii(t,e.current)))}function Bd(){var e=To.current;return e===null?!0:(Qu&4194048)===Qu?Eo===null:(Qu&62914560)===Qu||Qu&536870912?e===Eo:!1}function Vd(){var e=U.H;return U.H=uc,e===null?uc:e}function Hd(){var e=U.A;return U.A=qu,e}function Ud(){ad=4,td||(Qu&4194048)!==Qu&&To.current!==null||(nd=!0),!(od&134217727)&&!(sd&134217727)||Xu===null||Fd(Xu,Qu,ld,!1)}function Wd(e,t,n){var r=Yu;Yu|=2;var i=Vd(),a=Hd();(Xu!==e||Qu!==t)&&(Q=null,Rd(e,t)),t=!1;var o=ad;a:do try{if($u!==0&&Zu!==null){var s=Zu,c=ed;switch($u){case 8:Ld(),o=6;break a;case 3:case 2:case 9:case 6:To.current===null&&(t=!0);var l=$u;if($u=0,ed=null,Xd(e,s,c,l),n&&nd){o=0;break a}break;default:l=$u,$u=0,ed=null,Xd(e,s,c,l)}}Gd(),o=ad;break}catch(t){zd(e,t)}while(1);return t&&e.shellSuspendCounter++,da=ua=null,Yu=r,U.H=i,U.A=a,Zu===null&&(Xu=null,Qu=0,vi()),o}function Gd(){for(;Zu!==null;)Jd(Zu)}function Kd(e,t){var n=Yu;Yu|=2;var r=Vd(),a=Hd();Xu!==e||Qu!==t?(Q=null,hd=Ne()+500,Rd(e,t)):nd=et(e,t);a:do try{if($u!==0&&Zu!==null){t=Zu;var o=ed;b:switch($u){case 1:$u=0,ed=null,Xd(e,t,o,1);break;case 2:case 9:if(qa(o)){$u=0,ed=null,Yd(t);break}t=function(){$u!==2&&$u!==9||Xu!==e||($u=7),wf(e)},o.then(t,t);break a;case 3:$u=7;break a;case 4:$u=5;break a;case 7:qa(o)?($u=0,ed=null,Yd(t)):($u=0,ed=null,Xd(e,t,o,7));break;case 5:var s=null;switch(Zu.tag){case 26:s=Zu.memoizedState;case 5:case 27:var c=Zu;if(s?Ym(s):c.stateNode.complete){$u=0,ed=null;var l=c.sibling;if(l!==null)Zu=l;else{var u=c.return;u===null?Zu=null:(Zu=u,Zd(u))}break b}}$u=0,ed=null,Xd(e,t,o,5);break;case 6:$u=0,ed=null,Xd(e,t,o,6);break;case 8:Ld(),ad=6;break a;default:throw Error(i(462))}}qd();break}catch(t){zd(e,t)}while(1);return da=ua=null,U.H=r,U.A=a,Yu=n,Zu===null?(Xu=null,Qu=0,vi(),ad):0}function qd(){for(;Zu!==null&&!je();)Jd(Zu)}function Jd(e){var t=cl(e.alternate,e,id);e.memoizedProps=e.pendingProps,t===null?Zd(e):Zu=t}function Yd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Hc(n,t,t.pendingProps,t.type,void 0,Qu);break;case 11:t=Hc(n,t,t.pendingProps,t.type.render,t.ref,Qu);break;case 5:es(t);var r=t;r===Zi&&(K?(ia(r),r.tag===5&&r.stateNode!=null&&(Qi=r.stateNode)):(ia(r),K=!0));default:_l(n,t),t=Zu=ki(t,id),t=cl(n,t,id)}e.memoizedProps=e.pendingProps,t===null?Zd(e):Zu=t}function Xd(e,t,n,r){da=ua=null,es(t),$a=null,eo=0;var i=t.return;try{if(Dc(e,i,t,n,Qu)){ad=1,Sc(e,Ii(n,e.current)),Zu=null;return}}catch(t){if(i!==null)throw Zu=i,t;ad=1,Sc(e,Ii(n,e.current)),Zu=null;return}t.flags&32768?(K||r===1?e=!0:nd||Qu&536870912?e=!1:(td=e=!0,(r===2||r===9||r===3||r===6)&&(r=To.current,r!==null&&r.tag===13&&(r.flags|=16384))),Qd(t,e)):Zd(t)}function Zd(e){var t=e;do{if(t.flags&32768){Qd(t,td);return}e=t.return;var n=hl(t.alternate,t,id);if(n!==null){Zu=n;return}if(t=t.sibling,t!==null){Zu=t;return}Zu=t=e}while(t!==null);ad===0&&(ad=5)}function Qd(e,t){do{var n=gl(e.alternate,e);if(n!==null){n.flags&=32767,Zu=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Zu=e;return}Zu=e=n}while(e!==null);ad=6,Zu=null}function $d(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do cf();while(_d!==0);if(Yu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Xu&&(Zu=Xu=null,Qu=0),yd=t,vd=e,$=n,xd=a,Sd=r,ef(e,t,n,s,c,l,f)}}function ef(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(bd=s,s|=_i,ot(e,n,s,r,i,a),wd=null,(n&335544064)===n?(Td=Aa(e),r=10262):(Td=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,_f(Le,function(){return lf(),null})):(e.callbackNode=null,e.callbackPriority=0),Nl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=U.T,U.T=null,i=W.p,W.p=2,a=Yu,Yu|=4;try{cu(e,t,n)}finally{Yu=a,W.p=i,U.T=r}}_d=1,Nl?Cd=Mp(o,e.containerInfo,Td,rf,af,nf,of,lf,tf,null,null):(rf(),af(),of())}function tf(e){if(_d!==0){var t=vd.onRecoverableError;t(e,{componentStack:null})}}function nf(){_d===3&&(_d=0,ku(yd,vd),_d=4)}function rf(){if(_d===1){_d=0;var e=vd,t=yd,n=$,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=U.T,U.T=null;var i=W.p;W.p=2;var a=Yu;Yu|=4;try{au=ou=!1,Tu(t,e,n),n=cp;var o=Vr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Br(s.ownerDocument.documentElement,s)){if(c!==null&&Hr(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 _=zr(s,h),v=zr(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}}gh=!!sp,cp=sp=null}finally{Yu=a,W.p=i,U.T=r}}e.current=t,_d=2}}function af(){if(_d===2){_d=0;var e=vd,t=yd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=U.T,U.T=null;var r=W.p;W.p=2;var i=Yu;Yu|=4;try{uu(e,t.alternate,t)}finally{Yu=i,W.p=r,U.T=n}}_d=3}}function of(){if(_d===4||_d===3){_d=0;var e=Cd;Cd=null,Me();var t=vd,n=yd,r=$,i=Sd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?_d=5:(_d=0,yd=vd=null,sf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(gd=null),dt(r),n=n.stateNode,Ue&&typeof Ue.onCommitFiberRoot==`function`)try{Ue.onCommitFiberRoot(He,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=U.T,a=W.p,W.p=2,U.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{U.T=n,W.p=a}}if(i=wd,o=Td,Td=null,i!==null&&(wd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);$&3&&cf(),wf(t),a=t.pendingLanes,r&261930&&a&42?t===Dd?Ed++:(Ed=0,Dd=t):(Ed=0,Dd=null),Tf(0,!1)}}function sf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Da(t)))}function cf(){return Cd!==null&&(Cd.skipTransition(),Cd=null),rf(),af(),of(),lf()}function lf(){if(_d!==5)return!1;var e=vd,t=bd;bd=0;var n=dt($),r=U.T,a=W.p;try{W.p=32>n?32:n,U.T=null,n=xd,xd=null;var o=vd,s=$;if(_d=0,yd=vd=null,$=0,Yu&6)throw Error(i(331));var c=Yu;if(Yu|=4,Wu(o.current),Iu(o,o.current,s,n),Yu=c,Tf(0,!1),Ue&&typeof Ue.onPostCommitFiberRoot==`function`)try{Ue.onPostCommitFiberRoot(He,o)}catch{}return!0}finally{W.p=a,U.T=r,sf(e,t)}}function uf(e,t,n){t=Ii(n,t),t=wc(e.stateNode,t,2),e=fo(e,t,2),e!==null&&(at(e,2),wf(e))}function df(e,t,n){if(e.tag===3)uf(e,e,n);else for(;t!==null;){if(t.tag===3){uf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(gd===null||!gd.has(r))){e=Ii(n,e),n=Tc(2),r=fo(t,n,2),r!==null&&(Ec(n,r,t,e),at(r,2),wf(r));break}}t=t.return}}function ff(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ju;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)||(rd=!0,i.add(n),e=pf.bind(null,e,t,n),t.then(e,e))}function pf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xu===e&&(Qu&n)===n&&(ad===4||ad===3&&(Qu&62914560)===Qu&&300>Ne()-md?Yu&2?cd|=n:Rd(e,0):cd|=n,ud===Qu&&(ud=0)),wf(e)}function mf(e,t){t===0&&(t=rt()),e=xi(e,t),e!==null&&(at(e,t),wf(e))}function hf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mf(e,n)}function gf(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),mf(e,n)}function _f(e,t){return ke(e,t)}var vf=null,yf=null,bf=!1,xf=!1,Sf=!1,Cf=0;function wf(e){e!==yf&&e.next===null&&(yf===null?vf=yf=e:yf=yf.next=e),xf=!0,bf||(bf=!0,jf())}function Tf(e,t){if(!Sf&&xf){Sf=!0;do for(var n=!1,r=vf;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-Ge(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Af(r,a))}else a=Qu,a=$e(r,r===Xu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||et(r,a)||(n=!0,Af(r,a))}r=r.next}while(n);Sf=!1}}function Ef(){Df()}function Df(){xf=bf=!1;var e=0;Cf!==0&&hp()&&(e=Cf);for(var t=Ne(),n=null,r=vf;r!==null;){var i=r.next,a=Of(r,t);a===0?(r.next=null,n===null?vf=i:n.next=i,i===null&&(yf=n)):(n=r,(e!==0||a&3)&&(xf=!0)),r=i}_d!==0&&_d!==5||Tf(e,!1),Cf!==0&&(Cf=0)}function Of(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ge(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=nt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Xu,n=Qu,n=$e(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&($u===2||$u===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ae(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||et(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ae(r),dt(n)){case 2:case 8:n=Ie;break;case 32:n=Le;break;case 268435456:n=ze;break;default:n=Le}return r=kf.bind(null,e),n=ke(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ae(r),e.callbackPriority=2,e.callbackNode=null,2}function kf(e,t){if(_d!==0&&_d!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(cf()&&e.callbackNode!==n)return null;var r=Qu;return r=$e(e,e===Xu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Md(e,r,t),Of(e,Ne()),e.callbackNode!=null&&e.callbackNode===n?kf.bind(null,e):null)}function Af(e,t){if(cf())return null;Md(e,t,!0)}function jf(){bp(function(){Yu&6?ke(Fe,Ef):Df()})}function Mf(){if(Cf===0){var e=Na;e===0&&(e=Ye,Ye<<=1,!(Ye&261888)&&(Ye=256)),Cf=e}return Cf}function Nf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:dn(e)}function Pf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Nf((i[gt]||null).action),o=r.submitter;o&&(t=(t=o[gt]||null)?Nf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Nn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Cf!==0){var e=new FormData(i,o);Xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Ff=0;Ff<ci.length;Ff++){var If=ci[Ff];li(If.toLowerCase(),`on`+(If[0].toUpperCase()+If.slice(1)))}li(ei,`onAnimationEnd`),li(ti,`onAnimationIteration`),li(ni,`onAnimationStart`),li(`dblclick`,`onDoubleClick`),li(`focusin`,`onFocus`),li(`focusout`,`onBlur`),li(ri,`onTransitionRun`),li(ii,`onTransitionStart`),li(ai,`onTransitionCancel`),li(oi,`onTransitionEnd`),Pt(`onMouseEnter`,[`mouseout`,`mouseover`]),Pt(`onMouseLeave`,[`mouseout`,`mouseover`]),Pt(`onPointerEnter`,[`pointerout`,`pointerover`]),Pt(`onPointerLeave`,[`pointerout`,`pointerover`]),Nt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Nt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Nt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Nt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Lf=`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(` `),Rf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Lf));function zf(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){mi(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){mi(e)}i.currentTarget=null,a=c}}}}function Bf(e,t){var n=t[vt];n===void 0&&(n=t[vt]=new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,jt.forEach(function(t){t!==`selectionchange`&&(Rf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!Sn||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 Gf(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=Tt(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}yn(function(){var r=a,i=mn(n),s=[];a:{var c=si.get(e);if(c!==void 0){var l=Nn,u=e;switch(e){case`keypress`:if(On(n)===0)break a;case`keydown`:case`keyup`:l=Zn;break;case`focusin`:u=`focus`,l=Hn;break;case`focusout`:u=`blur`,l=Hn;break;case`beforeblur`:case`afterblur`:l=Hn;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=Bn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Vn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=er;break;case ei:case ti:case ni:l=Un;break;case oi:l=tr;break;case`scroll`:case`scrollend`:l=Fn;break;case`wheel`:l=nr;break;case`copy`:case`cut`:case`paste`:l=Wn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Qn;break;case`submit`:l=$n;break;case`toggle`:case`beforetoggle`:l=rr}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=bn(m,p),g!=null&&d.push(Kf(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(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==pn&&(u=n.relatedTarget||n.fromElement)&&(Tt(u)||u[_t]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Tt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Bn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Qn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Dt(c),h=l==null?u:Dt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Tt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,Jf):null,c!==null&&Yf(s,u,c,d,!1),l!==null&&f!==null&&Yf(s,f,l,d,!0)))}a:{if(c=r?Dt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Cr;else if(_r(c)){if(wr)_=Nr;else{_=jr;var v=Ar}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&cn(r.elementType)&&(_=Cr):_=Mr;if(_&&=_(e,r)){vr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Dt(r):window,e){case`focusin`:(_r(v)||v.contentEditable===`true`)&&(Wr=v,Gr=r,Kr=null);break;case`focusout`:Kr=Gr=Wr=null;break;case`mousedown`:qr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:qr=!1,Jr(s,n,i);break;case`selectionchange`:if(Ur)break;case`keydown`:case`keyup`:Jr(s,n,i)}var y;if(ar)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else pr?dr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(cr&&n.locale!==`ko`&&(pr||b!==`onCompositionStart`?b===`onCompositionEnd`&&pr&&(y=Dn()):(wn=i,Tn=`value`in wn?wn.value:wn.textContent,pr=!0)),v=qf(r,b),0<v.length&&(b=new Gn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=fr(n),y!==null&&(b.data=y)))),(y=sr?mr(e,n):hr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Gn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Pf(s,e,r,n,i)}zf(s,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(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=bn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=bn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(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=bn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=bn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
9
- `).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||rn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&rn(e,``+r);else return;break;case`className`:Ht(e,`class`,r);break;case`tabIndex`:Ht(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ht(e,n,r);break;case`style`:sn(e,r,o);return;case`data`:if(t!==`object`){Ht(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=dn(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`&&ep(e,t,`name`,a.name,a,null),ep(e,t,`formEncType`,a.formEncType,a,null),ep(e,t,`formMethod`,a.formMethod,a,null),ep(e,t,`formTarget`,a.formTarget,a,null)):(ep(e,t,`encType`,a.encType,a,null),ep(e,t,`method`,a.method,a,null),ep(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=dn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=fn);return;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;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));o?.__html!==n&&(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=dn(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`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`: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`:Bf(`beforetoggle`,e),Bf(`toggle`,e),Vt(e,`popover`,r);break;case`xlinkActuate`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ut(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ut(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ut(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ut(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Vt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=ln.get(n)||n,Vt(e,n,r);else return}zt=!0}function tp(e,t,n,r,a,o){switch(n){case`style`:sn(e,r,o);return;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));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)rn(e,r);else if(typeof r==`number`||typeof r==`bigint`)rn(e,``+r);else return;break;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=fn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Mt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[gt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}zt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Vt(e,n,r)}return}zt=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Bf(`error`,e),Bf(`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:ep(e,t,o,s,n,null)}}a&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:Bf(`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:ep(e,t,r,d,n,null)}}Qt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Bf(`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:ep(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&en(e,!!r,n,!0):en(e,!!r,t,!1);return;case`textarea`:for(s in Bf(`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:ep(e,t,s,c,n,null)}nn(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:ep(e,t,l,r,n,null)}return;case`dialog`:Bf(`beforetoggle`,e),Bf(`toggle`,e),Bf(`cancel`,e),Bf(`close`,e);break;case`iframe`:case`object`:Bf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Lf.length;r++)Bf(Lf[r],e);break;case`image`:Bf(`error`,e),Bf(`load`,e);break;case`details`:Bf(`toggle`,e);break;case`embed`:case`source`:case`link`:Bf(`error`,e),Bf(`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:ep(e,t,u,r,n,null)}return;default:if(cn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(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)||ep(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`:m!==f&&(zt=!0),o=m;break;case`name`:m!==f&&(zt=!0),a=m;break;case`checked`:m!==f&&(zt=!0),u=m;break;case`defaultChecked`:m!==f&&(zt=!0),d=m;break;case`value`:m!==f&&(zt=!0),s=m;break;case`defaultValue`:m!==f&&(zt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}Zt(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)||ep(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`:o!==l&&(zt=!0),p=o;break;case`defaultValue`:o!==l&&(zt=!0),c=o;break;case`multiple`:o!==l&&(zt=!0),s=o;default:o!==l&&ep(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?en(e,!!n,n?[]:``,!1):en(e,!!n,t,!0)):en(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:ep(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`:a!==o&&(zt=!0),p=a;break;case`defaultValue`:a!==o&&(zt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ep(e,t,s,a,r,o)}tn(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:ep(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`:p!==m&&(zt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(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)&&ep(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:ep(e,t,u,p,r,m)}return;default:if(cn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(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||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(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||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){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&&ap(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&&ap(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 sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(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 dp(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 fp(e,t,n,r){return n=lp(n).createElement(e),n[ht]=r,n[gt]=t,np(n,e,t),kt(n),n}function pp(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 mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(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),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[St]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(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 Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Tt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),Zp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(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`:nm(n),wt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(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[St])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=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(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 lm(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 um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(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 pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(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 gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===fn&&(e.onclick=null),wt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=W.d;W.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Id();return e||t}function Cm(e){var t=Et(e);t!==null&&t.tag===5&&t.type===`form`?Qs(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=Xt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),kt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Xt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Xt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Xt(n.imageSizes)+`"]`)):i+=`[href="`+Xt(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Ct]=!0,o.onload=o.onerror=function(){At(o)}),kt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Xt(r)+`"][href="`+Xt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),kt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Ot(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);kt(c),np(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,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Ot(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),kt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Ot(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),kt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=ge.current)?bm(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`?(n=Pm(n.href),t=Ot(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Pm(n.href);var o=Ot(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(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,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`?(n=Rm(n),t=Ot(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pm(e){return`href="`+Xt(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ct]){r.loading=1;return}}else t=e.createElement(`link`),t[Ct]=!0,t.onload=t.onerror=At.bind(null,t),np(t,`link`,n),kt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+Xt(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Xt(n.href)+`"]`);if(r)return t.instance=r,kt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),kt(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,kt(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),kt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,kt(a),a):(r=n,(a=vm.get(o))&&(r=D({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),kt(a),np(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,Vm(r,n.precedence,e));return t.instance}function Vm(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 Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,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[St]||a[ht]||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 Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(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 Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(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=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,kt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),kt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(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=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.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=nh.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 sh={$$typeof:F,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function ch(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=it(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=it(0),this.hiddenUpdates=it(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ei(3,null,null,t),e.current=a,a.stateNode=e,t=Ea(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},co(a),e}function uh(e){return e?(e=wi,e):wi}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=uo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=fo(e,r,t),n!==null&&(jd(n,e,t),po(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=xi(e,67108864);t!==null&&jd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=Od();t=ut(t);var n=xi(e,t);n!==null&&jd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=U.T;U.T=null;var a=W.p;try{W.p=2,yh(e,t,n,r)}finally{W.p=a,U.T=i}}function vh(e,t,n,r){var i=U.T;U.T=null;var a=W.p;try{W.p=8,yh(e,t,n,r)}finally{W.p=a,U.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Et(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Qe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ge(o);s.entanglements[1]|=c,o&=~c}wf(a),!(Yu&6)&&(hd=Ne()+500,Tf(0,!1))}}break;case 31:case 13:s=xi(a,2),s!==null&&jd(s,a,2),Id(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=mn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Tt(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 xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Pe()){case Fe:return 2;case Ie:return 8;case Le:case Re:return 32;case ze:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(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=Et(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Tt(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,pt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,pt(e.priority,function(){hh(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 Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);pn=r,n.target.dispatchEvent(r),pn=null}else return t=Et(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=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(Sh(r||n)===null)continue;break}var a=Et(n);a!==null&&(e.splice(t,3),t-=3,Xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.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[gt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[gt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){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 Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dh(n,Od(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Id(),t[_t]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=ft();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.1`)throw Error(i(527,Kh,`19.3.1`));W.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 qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:U,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{He=Jh.inject(qh),Ue=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=yc,s=bc,c=xc;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=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[_t]=t.current,Uf(e),new Wh(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=l(d(),1),y=_();function b(e,t=0){let n=[],r,i=Math.max(0,t-1);for(;(r=e.indexOf(`
10
-
11
- `,i))>=0;){let t=e.slice(0,r);e=e.slice(r+2),i=0;let a=`message`,o=[];for(let e of t.split(`
12
- `)){if(e.startsWith(`:`))continue;let t=e.indexOf(`:`),n=t<0?e:e.slice(0,t),r=t<0?``:e.slice(t+1).replace(/^ /,``);n===`event`?a=r:n===`data`&&o.push(r)}o.length&&n.push({type:a,data:o.join(`
13
- `)})}return{events:n,rest:e}}var x=3e3,S=[500,1e3,2e3,5e3],C=6e4,w=class{ws=null;streams=new Map;next=1;tries=0;heard=Date.now();timer;constructor(){setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&Date.now()-this.heard>C&&this.ws.close()},C/4),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&!this.ws&&this.streams.size&&this.connect()})}add(e){let t=this.next++;return this.streams.set(t,e),this.ws?this.ask(t):this.connect(),t}remove(e){this.streams.delete(e)&&this.send({op:`close`,id:e})}again(e){setTimeout(()=>{this.streams.get(e)?.readyState===E.CONNECTING&&this.ask(e)},x)}ask(e){let t=this.streams.get(e);t&&this.send({op:`open`,id:e,url:t.url})}send(e){this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}connect(){clearTimeout(this.timer);let e=new WebSocket(`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/api/ws`);this.ws=e,e.onopen=()=>{this.tries=0,this.heard=Date.now();for(let e of this.streams.keys())this.ask(e)},e.onmessage=e=>{this.heard=Date.now();let t=JSON.parse(String(e.data));this.streams.get(t.id)?.take(t)},e.onclose=()=>{if(this.ws===e){this.ws=null;for(let e of this.streams.values())e.dropped();this.streams.size&&(this.timer=setTimeout(()=>this.connect(),S[Math.min(this.tries++,S.length-1)]))}}}},T=null,E=class e extends EventTarget{static CONNECTING=0;static OPEN=1;static CLOSED=2;readyState=e.CONNECTING;onopen=null;onmessage=null;url;id;held=``;constructor(e){super(),this.url=e,this.id=(T??=new w).add(this)}close(){this.readyState=e.CLOSED,T?.remove(this.id)}take(t){if(this.readyState!==e.CLOSED){if(t.open){this.readyState=e.OPEN,this.held=``;let t=new Event(`open`);this.dispatchEvent(t),this.onopen?.(t)}if(t.data!==void 0){let{events:e,rest:n}=b(this.held+t.data,this.held.length);this.held=n;for(let t of e){let e=new MessageEvent(t.type,{data:t.data});this.dispatchEvent(e),t.type===`message`&&this.onmessage?.(e)}}t.end!==void 0&&(t.end!==200&&t.end!==0?(this.readyState=e.CLOSED,T?.remove(this.id)):(this.readyState=e.CONNECTING,T?.again(this.id)),this.dispatchEvent(new Event(`error`)))}}dropped(){this.readyState!==e.CLOSED&&(this.readyState=e.CONNECTING,this.dispatchEvent(new Event(`error`)))}},D=(e,t)=>e.kind===`list`?t.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).join(`
14
- `):t.trim(),O=e=>Array.isArray(e)?e.join(`
15
- `):e==null?``:String(e);function k(e,t,n=null){let r=O(e.default)||(n??``);return e.key in t?t[e.key]===``?r:t[e.key]:e.value===null?r:O(e.value)}var A=(e,t=null)=>O(e.default)||(t??``);function j(e,t,n,r=null){let i={...e},a=A(t,r),o=D(t,n)===``||D(t,n)===D(t,a)?``:n,s=t.value===null?``:O(t.value);return D(t,o)===D(t,s)?delete i[t.key]:i[t.key]=o,i}function M(e,t){let n={};for(let[r,i]of Object.entries(t)){let t=e.find(e=>e.key===r);if(!t)continue;let a=t.value===null?``:O(t.value);D(t,i)!==D(t,a)&&(n[r]=i)}return n}function N(e,t){let n=Object.entries(M(e,t)),r=t=>e.find(e=>e.key===t)?.file,i=n.filter(([e])=>!r(e));return[...i.length?[{cmd:`config-preset`,pairs:Object.fromEntries(i)}]:[],...n.filter(([e])=>r(e)).map(([e,t])=>({cmd:`config-set`,key:e,value:t}))]}function P(e,t){return Object.keys(t).find(t=>RegExp(`(^|[\\s:])${t.replace(`.`,`\\.`)}\\b`).test(e))??null}var F=e=>e.filter(e=>e.value!==null&&O(e.value)!==O(e.default)).length,I=e=>`gcf-settings-drafts:${e}`;function L(e){try{let t=JSON.parse(localStorage.getItem(I(e))??`{}`);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}function ee(e,t){try{Object.keys(t).length?localStorage.setItem(I(e),JSON.stringify(t)):localStorage.removeItem(I(e))}catch{}}var te=new Map;async function ne(e,t){let n=t().finally(()=>te.delete(e));te.set(e,n),await n}var R=e=>te.has(e),z=()=>Promise.allSettled([...te.values()]).then(()=>{});async function B(e,t,n){e!==`GET`&&!t.endsWith(`/move`)&&await z();let r=await fetch(t,{method:e,headers:n===void 0?{}:{"content-type":`application/json`},body:n===void 0?void 0:JSON.stringify(n)}),i=await r.json().catch(n=>{if(r.ok)throw Error(`${e} ${t}: the answer is not JSON`,{cause:n});return{}});if(!r.ok)throw Error(i.error??`${r.status} ${r.statusText}`);return i}var V=e=>`/api/p/${encodeURIComponent(e)}`,re=1e3;async function ie(e,t,n=!1,r=t=>B(`GET`,`${V(e)}/play/queue/${t}`),i=e=>new Promise(t=>setTimeout(t,e))){let a=t?.ticket;if(typeof a!=`number`)return t;for(;;){let e=await r(a);if(e.state===`done`||e.state===`gone`){if(e.ok&&e.result!==void 0||n&&e.result!==void 0)return e.result;throw Error(e.problem??`the build did not end`)}await i(re)}}var H={projects:()=>B(`GET`,`/api/projects`),themes:()=>B(`GET`,`/api/themes`),yolo:()=>B(`GET`,`/api/yolo`),setYolo:e=>B(`PUT`,`/api/yolo`,{on:e}),addProject:(e,t)=>B(`POST`,`/api/projects`,{path:e,name:t||void 0}),removeProject:e=>B(`DELETE`,`/api/projects/${encodeURIComponent(e)}`),board:e=>B(`GET`,`${V(e)}/board`),file:(e,t)=>B(`GET`,`${V(e)}/file?path=${encodeURIComponent(t)}`),playtest:e=>B(`GET`,`${V(e)}/playtest`),metrics:e=>B(`GET`,`${V(e)}/metrics`),playBuild:async(e,t,n=!1,r,i)=>ie(e,await B(`POST`,`${V(e)}/play/build`,{...t===null?{main:!0}:{id:t},...n?{fresh:!0}:{},...r?{of:r}:{},...i?{profile:i}:{}}),!0),playStart:async(e,t,n,r,i)=>ie(e,await B(`POST`,`${V(e)}/play/start`,{...t===null?{main:!0}:{id:t},target:n,...r?{device:r}:{},...i?{profile:i}:{}})),playDevices:(e,t)=>B(`POST`,`${V(e)}/play/devices`,{target:t}),playTicket:(e,t)=>B(`GET`,`${V(e)}/play/queue/${t}`),playCancel:(e,t)=>B(`DELETE`,`${V(e)}/play/queue/${t}`),playStop:e=>B(`POST`,`${V(e)}/play/stop`,{}),move:(e,t)=>B(`POST`,`${V(e)}/move`,t),movePreview:(e,t,n)=>B(`POST`,`${V(e)}/item/${encodeURIComponent(t)}/amend/preview`,n),changes:(e,t)=>B(`GET`,`${V(e)}/changes?tree=${encodeURIComponent(t)}`),changeDiff:(e,t,n)=>B(`GET`,`${V(e)}/changes/diff?tree=${encodeURIComponent(t)}&path=${encodeURIComponent(n)}`),commitChanges:(e,t,n)=>B(`POST`,`${V(e)}/changes/commit`,{message:t,paths:n}),pushChanges:e=>B(`POST`,`${V(e)}/changes/push`,{}),pullChanges:e=>B(`POST`,`${V(e)}/changes/pull`,{}),changeFileUrl:(e,t,n,r)=>`${V(e)}/changes/file?tree=${encodeURIComponent(t)}&path=${encodeURIComponent(n)}&side=${r}`,editsDiff:(e,t)=>B(`POST`,`${V(e)}/edits/diff`,{paths:t}),run:(e,t,n=!1,r)=>B(`POST`,`${V(e)}/run`,{ids:t,fresh:n,...r}),pastRuns:(e,t)=>B(`GET`,`${V(e)}/runs/past?limit=${t}`).then(e=>e.runs),history:(e,t)=>B(`GET`,`${V(e)}/item/${encodeURIComponent(t)}/history`),logPart:(e,t,n,r)=>B(`GET`,`${V(e)}/log/${encodeURIComponent(t)}?from=${n}&to=${r}`),draft:(e,t)=>B(`POST`,`${V(e)}/inbox/${encodeURIComponent(t)}/draft`,{}),start:(e,t,n={})=>B(`POST`,`${V(e)}/start/${encodeURIComponent(t)}`,n),designPart:(e,t,n,r)=>B(`GET`,`${V(e)}/design/part?kind=${t}&name=${encodeURIComponent(n)}${r?`&type=${r}`:``}`),next:(e,t)=>B(`GET`,`${V(e)}/next?count=${t}`),gate:(e,t)=>B(`GET`,`${V(e)}/gate?ids=${t.map(encodeURIComponent).join(`,`)}`),stop:(e,t)=>B(`POST`,`${V(e)}/stop`,{id:t}),wake:(e,t)=>B(`POST`,`${V(e)}/wake`,t),wakeTalk:(e,t)=>B(`POST`,`${V(e)}/talk/${encodeURIComponent(t)}/wake`,{}),pendingChat:(e,t)=>B(`GET`,`${V(e)}/chat/${encodeURIComponent(t)}/pending`),hold:(e,t)=>B(`POST`,`${V(e)}/hold/${encodeURIComponent(t)}`,{}),resumeQueue:e=>B(`POST`,`${V(e)}/queue/resume`,{}),accountSettings:()=>B(`GET`,`/api/settings`),setAccountSettings:e=>B(`PUT`,`/api/settings`,e),holdProject:(e,t)=>B(t?`POST`:`DELETE`,`${V(e)}/hold`,t?{}:void 0),askUsage:()=>B(`POST`,`/api/usage`,{}),autopilot:(e,t)=>B(`POST`,`${V(e)}/autopilot`,{on:t}),closeReport:(e,t)=>B(`DELETE`,`${V(e)}/reports/${encodeURIComponent(t)}`),unqueue:(e,t)=>B(`DELETE`,`${V(e)}/queue/${encodeURIComponent(t)}`),talks:(e,t)=>B(`GET`,`${V(e)}/talks${t?`?item=${encodeURIComponent(t)}`:``}`).then(e=>e.talks),newTalk:(e,t)=>B(`POST`,`${V(e)}/talks`,t?{item:t}:{}),pickTalk:(e,t,n)=>B(`POST`,`${V(e)}/talk/${encodeURIComponent(t)}/agent`,n),closeTalk:(e,t)=>B(`POST`,`${V(e)}/talk/${encodeURIComponent(t)}/stop`,{}),sendTalk:(e,t,n)=>B(`POST`,`${V(e)}/talk/${encodeURIComponent(t)}`,n),sendChat:(e,t,n)=>B(`POST`,`${V(e)}/chat/${encodeURIComponent(t)}`,n)},ae=e=>`${V(e)}/design/export`,oe=(e,t)=>`${V(e)}/attachment?path=${encodeURIComponent(t)}`,se=(e,t)=>`item`in t?`${V(e)}/chat/${encodeURIComponent(t.item)}`:`${V(e)}/talk/${encodeURIComponent(t.talk)}`;function U(e,t,n){let r=new E(e);return r.onopen=t,r.addEventListener(`reset`,t),r.onmessage=e=>n(JSON.parse(e.data)),()=>r.close()}var W=null,ce=()=>W??=new E(`/api/events`);function le(e,t){let n=ce(),r=n.readyState===E.OPEN,i=()=>{r&&t?.(),r=!0},a=t=>e(JSON.parse(t.data));return n.addEventListener(`open`,i),n.addEventListener(`message`,a),()=>{n.removeEventListener(`open`,i),n.removeEventListener(`message`,a)}}function ue(e,t){let n=new E(`${V(e)}/changes/events`);return n.addEventListener(`message`,e=>t(JSON.parse(e.data))),()=>n.close()}function de(e){let t=ce(),n=()=>e(!0,!1),r=()=>e(!1,t.readyState===E.CLOSED);return t.addEventListener(`open`,n),t.addEventListener(`error`,r),()=>{t.removeEventListener(`open`,n),t.removeEventListener(`error`,r)}}function fe(e,t,n,r){let i=new E(`${V(e)}/log/${encodeURIComponent(t)}`);return i.onopen=n,i.addEventListener(`reset`,n),i.onmessage=e=>r(JSON.parse(e.data)),()=>i.close()}var pe=`\\p{L}\\p{N}_`,me=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),he=new Map,ge=8;function _e(e){let t=e.join(`
16
- `);if(he.has(t))return he.get(t)??null;he.size>=ge&&he.clear();let n=[...e].sort((e,t)=>t.length-e.length).map(me),r=n.length?RegExp(`(?<![${pe}/\\\\.\\-])(${n.join(`|`)})(?![${pe}/\\\\\\-]|\\.[${pe}])`,`gu`):null;return he.set(t,r),r}function ve(e,t,n=[]){let r=new Set([...t].filter(e=>e.includes(`-`)));for(let e of n)t.has(e)&&r.add(e);let i=_e([...r].sort());if(!i)return e?[{t:e}]:[];let a=[],o=0;for(let t of e.matchAll(i))t.index>o&&a.push({t:e.slice(o,t.index)}),a.push({t:t[1],id:t[1]}),o=t.index+t[1].length;return o<e.length&&a.push({t:e.slice(o)}),a}var ye=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})),G=o(((e,t)=>{t.exports=ye()}))(),be=(0,v.createContext)(null);function xe(e,t){return t===`history`?`${e} · ended, in history: opens its record`:t===`graveyard`?`${e} · in the graveyard: opens its record`:`Open ${e}`}function Se({id:e,toned:t=!1,code:n=!1}){let r=(0,v.useContext)(be);return r?.known.has(e)?(0,G.jsx)(`button`,{type:`button`,className:`item-link ${t?`toned`:``} ${n?`code`:``}`,title:xe(e,r.ended(e)),onClick:t=>{t.stopPropagation(),t.preventDefault(),t.currentTarget.closest(`.modal`)?r.openApart(e):r.open(e)},children:e}):n?(0,G.jsx)(`code`,{children:e}):(0,G.jsx)(G.Fragment,{children:e})}function Ce({text:e,named:t,toned:n}){let r=(0,v.useContext)(be);return r?(0,G.jsx)(G.Fragment,{children:ve(e,r.known,t).map((e,t)=>e.id?(0,G.jsx)(Se,{id:e.id,toned:n},t):e.t)}):(0,G.jsx)(G.Fragment,{children:e})}var we=e=>v.Children.map(e,e=>typeof e==`string`?(0,G.jsx)(Ce,{text:e}):e);function Te({children:e}){let t=(0,v.useContext)(be),n=typeof e==`string`?e:``;return n&&t?.known.has(n)?(0,G.jsx)(Se,{id:n,code:!0}):(0,G.jsx)(`code`,{children:e})}var Ee=[];function De({onClose:e,dirty:t,children:n}){let r=(0,v.useRef)({}).current,i=(0,v.useRef)(document.activeElement).current;return(0,v.useEffect)(()=>(Ee.push(r),()=>{Ee.splice(Ee.indexOf(r),1);let e=document.activeElement;i instanceof HTMLElement&&i.isConnected&&(!e||e===document.body)&&i.focus()}),[r,i]),(0,v.useEffect)(()=>{let n=n=>{n.key!==`Escape`||n.defaultPrevented||Ee.at(-1)!==r||(n.preventDefault(),t||e())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]),(0,G.jsx)(`div`,{className:`modal`,onClick:n=>{n.stopPropagation(),t||e()},children:n})}var Oe=e=>e.answer(!1),ke=(e,t,n=!1,r={})=>new Promise(i=>Oe({...r,text:e,action:t,danger:n,answer:i}));function Ae({error:e,refused:t}){return(0,G.jsxs)(`div`,{role:`alert`,className:`dialog-error`,title:t?`The framework's answer, word for word. Change a field to try again; Cancel closes it.`:void 0,children:[(0,G.jsx)(`span`,{className:`de-mark`,"aria-hidden":`true`,children:`✘`}),(0,G.jsxs)(`div`,{className:`de-body`,children:[t&&(0,G.jsx)(`span`,{className:`de-head`,children:`gcf refused it`}),(0,G.jsx)(`span`,{className:`de-text`,children:(0,G.jsx)(Ce,{text:e,toned:!0})}),t&&(0,G.jsx)(`span`,{className:`de-hint`,children:`Change a field to try again, or Cancel.`})]})]})}function je({id:e,head:t,text:n}){return(0,G.jsxs)(`div`,{id:e,role:`note`,className:`warn-note`,children:[(0,G.jsx)(`span`,{className:`wn-mark`,"aria-hidden":`true`,children:`⚠`}),(0,G.jsxs)(`div`,{className:`wn-body`,children:[(0,G.jsx)(`span`,{className:`wn-head`,children:t}),(0,G.jsx)(`span`,{className:`wn-text`,children:n})]})]})}function Me(){let[e,t]=(0,v.useState)(null),n=(0,v.useId)();if((0,v.useEffect)(()=>{Oe=e=>t(t=>(t?.answer(!1),e))},[]),!e)return null;let r=n=>{t(null),e.answer(n)};return(0,G.jsx)(De,{onClose:()=>r(!1),dirty:!1,children:(0,G.jsxs)(`div`,{className:`dialog`,role:`alertdialog`,"aria-modal":!0,"aria-label":e.title??e.text,"aria-describedby":e.title?`${n}-text${e.warn?` ${n}-warn`:``}`:void 0,onClick:e=>e.stopPropagation(),children:[e.title&&(0,G.jsx)(`h2`,{children:e.title}),(0,G.jsx)(`p`,{id:`${n}-text`,className:e.title?`dialog-body`:`dialog-text`,children:e.text}),e.warn&&(0,G.jsx)(je,{id:`${n}-warn`,head:e.warn.head,text:e.warn.text}),(0,G.jsxs)(`div`,{className:`dialog-actions`,children:[(0,G.jsx)(`button`,{type:`button`,className:`btn-line`,onClick:()=>r(!1),children:`Cancel`}),e.other&&(0,G.jsxs)(`button`,{type:`button`,className:e.other.agent?`btn btn-agent`:`btn`,title:e.other.title,onClick:()=>{r(!1),e.other?.go()},children:[e.other.agent,e.other.label]}),(0,G.jsx)(`button`,{type:`button`,className:e.danger?`btn-danger`:`btn-primary`,autoFocus:!0,onClick:()=>r(!0),children:e.action})]})]})})}var Ne=[/^gcf\/inbox\/in-[0-9a-f]{8}\/attachments\/./,/^gcf\/work\/[a-z0-9]+(-[a-z0-9]+)*\/attachments\/./],Pe=e=>Ne.some(t=>t.test(e));function Fe(e,t,n){if(n===`main`||n===`worktree`)return n;let r=e.items.find(e=>e.id===t)?.run_mode;return r===`main`||r===`worktree`?r:e.run_mode}var Ie=e=>e&&`paths`in e?e:void 0;function Le(e,t){return e.refusal?.code===`clean`?e.refusal.left:/^edits (commit|discard|diff): no change under gcf\//m.test(e.err)&&t.length===1?[]:null}var Re=e=>typeof e==`string`&&(e===`GLOSSARY.md`||e.startsWith(`gcf/`))&&!/[\\\r\n]/.test(e)&&!e.split(`/`).includes(`..`),ze=e=>`propose_${e.replace(/[-:]/g,`_`)}`;function Be(e,t){if(!t)return null;let n=ze(t),r=Object.keys(e).filter(e=>ze(e)===n);return r.find(t=>e[t].propose)??(Object.hasOwn(e,t)?t:r[0])??null}function Ve(e){return`${e.replace(/\r\n?/g,`
17
- `).replace(/^\n+|\n+$/g,``).split(`
18
- `).map(e=>e?`> ${e}`:`>`).join(`
19
- `)}\n\n`}var He=/^\[in reply to the agent's message of (\d{4}-\d\d-\d\dT[\d:.]+Z)\]$/gm;function Ue(e){let t=[...e.matchAll(He)].at(-1);return!t||t.index===void 0?{at:null,text:e}:{at:t[1],text:e.slice(0,t.index)+e.slice(t.index+t[0].length+1)}}function We(){let e=0,t=0;return{send:()=>++e,last:()=>e,lands:e=>e<t?!1:(t=e,!0)}}var Ge=h(),Ke=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function qe(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Je(e){return`nodeType`in e}function Ye(e){return e?qe(e)?e:Je(e)?e.ownerDocument?.defaultView??window:window:window}function Xe(e){let{Document:t}=Ye(e);return e instanceof t}function Ze(e){return!qe(e)&&e instanceof Ye(e).HTMLElement}function Qe(e){return e instanceof Ye(e).SVGElement}function $e(e){return e?qe(e)?e.document:Je(e)?Xe(e)?e:Ze(e)||Qe(e)?e.ownerDocument:document:document:document}var et=Ke?v.useLayoutEffect:v.useEffect;function tt(e){let t=(0,v.useRef)(e);return et(()=>{t.current=e}),(0,v.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function nt(){let e=(0,v.useRef)(null);return[(0,v.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,v.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function rt(e,t){t===void 0&&(t=[e]);let n=(0,v.useRef)(e);return et(()=>{n.current!==e&&(n.current=e)},t),n}function it(e,t){let n=(0,v.useRef)();return(0,v.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function at(e){let t=tt(e),n=(0,v.useRef)(null);return[n,(0,v.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function ot(e){let t=(0,v.useRef)();return(0,v.useEffect)(()=>{t.current=e},[e]),t.current}var st={};function ct(e,t){return(0,v.useMemo)(()=>{if(t)return t;let n=st[e]==null?0:st[e]+1;return st[e]=n,e+`-`+n},[e,t])}function lt(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var ut=lt(1),dt=lt(-1);function ft(e){return`clientX`in e&&`clientY`in e}function pt(e){if(!e)return!1;let{KeyboardEvent:t}=Ye(e.target);return t&&e instanceof t}function mt(e){if(!e)return!1;let{TouchEvent:t}=Ye(e.target);return t&&e instanceof t}function ht(e){if(mt(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return ft(e)?{x:e.clientX,y:e.clientY}:null}var gt=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[gt.Translate.toString(e),gt.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),_t=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function vt(e){return e.matches(_t)?e:e.querySelector(_t)}var yt={display:`none`};function bt(e){let{id:t,value:n}=e;return v.createElement(`div`,{id:t,style:yt},n)}function xt(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return v.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function St(){let[e,t]=(0,v.useState)(``);return{announce:(0,v.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var Ct=(0,v.createContext)(null);function wt(e){let t=(0,v.useContext)(Ct);(0,v.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Tt(){let[e]=(0,v.useState)(()=>new Set),t=(0,v.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,v.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Et={draggable:`
20
- To pick up a draggable item, press the space bar.
21
- While dragging, use the arrow keys to move the item.
22
- Press space again to drop the item in its new position, or press escape to cancel.
23
- `},Dt={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function Ot(e){let{announcements:t=Dt,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Et}=e,{announce:a,announcement:o}=St(),s=ct(`DndLiveRegion`),[c,l]=(0,v.useState)(!1);if((0,v.useEffect)(()=>{l(!0)},[]),wt((0,v.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=v.createElement(v.Fragment,null,v.createElement(bt,{id:r,value:i.draggable}),v.createElement(xt,{id:s,announcement:o}));return n?(0,Ge.createPortal)(u,n):u}var kt;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(kt||={});function At(){}function jt(e,t){return(0,v.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function Mt(){var e=[...arguments];return(0,v.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var Nt=Object.freeze({x:0,y:0});function Pt(e,t){let n=ht(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function Ft(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function It(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function Lt(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var Rt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=Lt(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(Ft)};function zt(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Bt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Nt}function Vt(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var Ht=Vt(1);function Ut(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Wt(e,t,n){let r=Ut(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var Gt={ignoreTransform:!1};function Kt(e,t){t===void 0&&(t=Gt);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=Ye(e).getComputedStyle(e);t&&(n=Wt(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function qt(e){return Kt(e,{ignoreTransform:!0})}function Jt(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Yt(e,t){return t===void 0&&(t=Ye(e).getComputedStyle(e)),t.position===`fixed`}function Xt(e,t){t===void 0&&(t=Ye(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function Zt(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Xe(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Ze(i)||Qe(i)||n.includes(i))return n;let a=Ye(e).getComputedStyle(i);return i!==e&&Xt(i,a)&&n.push(i),Yt(i,a)?n:r(i.parentNode)}return e?r(e):n}function Qt(e){let[t]=Zt(e,1);return t??null}function $t(e){return!Ke||!e?null:qe(e)?e:Je(e)?Xe(e)||e===$e(e).scrollingElement?window:Ze(e)?e:null:null}function en(e){return qe(e)?e.scrollX:e.scrollLeft}function tn(e){return qe(e)?e.scrollY:e.scrollTop}function nn(e){return{x:en(e),y:tn(e)}}var rn;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(rn||={});function an(e){return!Ke||!e?!1:e===document.scrollingElement}function on(e){let t={x:0,y:0},n=an(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var sn={x:.2,y:.2};function cn(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=sn);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=on(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=rn.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=rn.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=rn.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=rn.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function ln(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function un(e){return e.reduce((e,t)=>ut(e,nn(t)),Nt)}function dn(e){return e.reduce((e,t)=>e+en(t),0)}function fn(e){return e.reduce((e,t)=>e+tn(t),0)}function pn(e,t){if(t===void 0&&(t=Kt),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);Qt(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var mn=[[`x`,[`left`,`right`],dn],[`y`,[`top`,`bottom`],fn]],hn=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=Zt(t),r=un(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of mn)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},gn=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function _n(e){let{EventTarget:t}=Ye(e);return e instanceof t?e:$e(e)}function vn(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var yn;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(yn||={});function bn(e){e.preventDefault()}function xn(e){e.stopPropagation()}var Sn;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(Sn||={});var Cn={start:[Sn.Space,Sn.Enter],cancel:[Sn.Esc],end:[Sn.Space,Sn.Enter,Sn.Tab]},wn=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Sn.Right:return{...n,x:n.x+25};case Sn.Left:return{...n,x:n.x-25};case Sn.Down:return{...n,y:n.y+25};case Sn.Up:return{...n,y:n.y-25}}},Tn=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new gn($e(t)),this.windowListeners=new gn(Ye(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(yn.Resize,this.handleCancel),this.windowListeners.add(yn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(yn.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&pn(n),t(Nt)}handleKeyDown(e){if(pt(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=Cn,coordinateGetter:a=wn,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:Nt;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=dt(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=on(n),p=ln(n),m={x:Math.min(i===Sn.Right?p.right-p.width/2:p.right,Math.max(i===Sn.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===Sn.Down?p.bottom-p.height/2:p.bottom,Math.max(i===Sn.Down?p.top:p.top+p.height/2,u.y))},h=i===Sn.Right&&!s||i===Sn.Left&&!c,g=i===Sn.Down&&!l||i===Sn.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===Sn.Right&&e<=d.x||i===Sn.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}r.x=a?n.scrollLeft-e:i===Sn.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===Sn.Down&&e<=d.y||i===Sn.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}r.y=a?n.scrollTop-e:i===Sn.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,ut(dt(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Tn.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=Cn,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function En(e){return!!(e&&`distance`in e)}function Dn(e){return!!(e&&`delay`in e)}var On=class{constructor(e,t,n){n===void 0&&(n=_n(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=$e(i),this.documentListeners=new gn(this.document),this.listeners=new gn(n),this.windowListeners=new gn(Ye(i)),this.initialCoordinates=ht(r)??Nt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(yn.Resize,this.handleCancel),this.windowListeners.add(yn.DragStart,bn),this.windowListeners.add(yn.VisibilityChange,this.handleCancel),this.windowListeners.add(yn.ContextMenu,bn),this.documentListeners.add(yn.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Dn(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(En(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(yn.Click,xn,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(yn.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=ht(e)??Nt,s=dt(n,o);if(!t&&a){if(En(a)){if(a.tolerance!=null&&vn(s,a.tolerance))return this.handleCancel();if(vn(s,a.distance))return this.handleStart()}if(Dn(a)&&vn(s,a.tolerance))return this.handleCancel();this.handlePending(a,s)}else e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Sn.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},kn={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},An=class extends On{constructor(e){let{event:t}=e,n=$e(t.target);super(e,kn,n)}};An.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var jn={move:{name:`mousemove`},end:{name:`mouseup`}},Mn;(function(e){e[e.RightClick=2]=`RightClick`})(Mn||={});var Nn=class extends On{constructor(e){super(e,jn,$e(e.event.target))}};Nn.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Mn.RightClick&&(r?.({event:n}),!0)}}];var Pn={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},Fn=class extends On{constructor(e){super(e,Pn)}static setup(){return window.addEventListener(Pn.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Pn.move.name,e)};function e(){}}};Fn.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var In;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(In||={});var Ln;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(Ln||={});function Rn(e){let{acceleration:t,activator:n=In.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=Ln.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=Bn({delta:d,disabled:!a}),[m,h]=nt(),g=(0,v.useRef)({x:0,y:0}),_=(0,v.useRef)({x:0,y:0}),y=(0,v.useMemo)(()=>{switch(n){case In.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case In.DraggableRect:return i}},[n,i,c]),b=(0,v.useRef)(null),x=(0,v.useCallback)(()=>{let e=b.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),S=(0,v.useMemo)(()=>s===Ln.TreeOrder?[...l].reverse():l,[s,l]);(0,v.useEffect)(()=>{if(!a||!l.length||!y)h();else{for(let e of S){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=cn(e,i,y,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){h(),b.current=e,m(x,o),g.current=s,_.current=a;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()}},[t,x,r,h,a,o,JSON.stringify(y),JSON.stringify(p),m,l,S,u,JSON.stringify(f)])}var zn={x:{[rn.Backward]:!1,[rn.Forward]:!1},y:{[rn.Backward]:!1,[rn.Forward]:!1}};function Bn(e){let{delta:t,disabled:n}=e,r=ot(t);return it(e=>{if(n||!r||!e)return zn;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[rn.Backward]:e.x[rn.Backward]||i.x===-1,[rn.Forward]:e.x[rn.Forward]||i.x===1},y:{[rn.Backward]:e.y[rn.Backward]||i.y===-1,[rn.Forward]:e.y[rn.Forward]||i.y===1}}},[n,t,r])}function Vn(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return it(e=>t==null?null:r??e??null,[r,t])}function Hn(e,t){return(0,v.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var Un;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(Un||={});var Wn;(function(e){e.Optimized=`optimized`})(Wn||={});var Gn=new Map;function Kn(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,v.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,v.useRef)(e),d=g(),f=rt(d),p=(0,v.useCallback)(function(e){e===void 0&&(e=[]),f.current||o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,v.useRef)(null),h=it(t=>{if(d&&!n)return Gn;if(!t||t===Gn||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new hn(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,v.useEffect)(()=>{u.current=e},[e]),(0,v.useEffect)(()=>{d||p()},[n,d]),(0,v.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,v.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case Un.Always:return!1;case Un.BeforeDragging:return n;default:return!n}}}function qn(e,t){return it(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function Jn(e,t){return qn(e,t)}function Yn(e){let{callback:t,disabled:n}=e,r=tt(t),i=(0,v.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,v.useEffect)(()=>()=>i?.disconnect(),[i]),i}function Xn(e){let{callback:t,disabled:n}=e,r=tt(t),i=(0,v.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,v.useEffect)(()=>()=>i?.disconnect(),[i]),i}function Zn(e){return new hn(Kt(e),e)}function Qn(e,t,n){t===void 0&&(t=Zn);let[r,i]=(0,v.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=Yn({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=Xn({callback:a});return et(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function $n(e){return Bt(e,qn(e))}var er=[];function tr(e){let t=(0,v.useRef)(e),n=it(n=>e?n&&n!==er&&e&&t.current&&e.parentNode===t.current.parentNode?n:Zt(e):er,[e]);return(0,v.useEffect)(()=>{t.current=e},[e]),n}function nr(e){let[t,n]=(0,v.useState)(null),r=(0,v.useRef)(e),i=(0,v.useCallback)(e=>{let t=$t(e.target);t&&n(e=>e?(e.set(t,nn(t)),new Map(e)):null)},[]);return(0,v.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=$t(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,nn(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{$t(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,v.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>ut(e,t),Nt):un(e):Nt,[e,t])}function rr(e,t){t===void 0&&(t=[]);let n=(0,v.useRef)(null);return(0,v.useEffect)(()=>{n.current=null},t),(0,v.useEffect)(()=>{let t=e!==Nt;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?dt(e,n.current):Nt}function ir(e){(0,v.useEffect)(()=>{if(!Ke)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function ar(e,t){return(0,v.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function or(e){return(0,v.useMemo)(()=>e?Jt(e):null,[e])}var sr=[];function cr(e,t){t===void 0&&(t=Kt);let[n]=e,r=or(n?Ye(n):null),[i,a]=(0,v.useState)(sr);function o(){a(()=>e.length?e.map(e=>an(e)?r:new hn(t(e),e)):sr)}let s=Xn({callback:o});return et(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function lr(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return Ze(t)?t:e}function ur(e){let{measure:t}=e,[n,r]=(0,v.useState)(null),i=Xn({callback:(0,v.useCallback)(e=>{for(let{target:n}of e)if(Ze(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=at((0,v.useCallback)(e=>{let n=lr(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,v.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var dr=[{sensor:An,options:{}},{sensor:Tn,options:{}}],fr={current:{}},pr={draggable:{measure:qt},droppable:{measure:qt,strategy:Un.WhileDragging,frequency:Wn.Optimized},dragOverlay:{measure:Kt}},mr=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},hr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new mr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:At},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:pr,measureDroppableContainers:At,windowRect:null,measuringScheduled:!1},gr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:At,draggableNodes:new Map,over:null,measureDroppableContainers:At},_r=(0,v.createContext)(gr),vr=(0,v.createContext)(hr);function yr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new mr}}}function br(e,t){switch(t.type){case kt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case kt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case kt.DragEnd:case kt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case kt.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new mr(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case kt.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new mr(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case kt.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new mr(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function xr(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,v.useContext)(_r),a=ot(r),o=ot(n?.id);return(0,v.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!pt(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=vt(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Sr(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Cr(e){return(0,v.useMemo)(()=>({draggable:{...pr.draggable,...e?.draggable},droppable:{...pr.droppable,...e?.droppable},dragOverlay:{...pr.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function wr(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,v.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;et(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=Bt(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=Qt(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var Tr=(0,v.createContext)({...Nt,scaleX:1,scaleY:1}),Er;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(Er||={});var Dr=(0,v.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=dr,collisionDetection:o=Rt,measuring:s,modifiers:c,...l}=e,[u,d]=(0,v.useReducer)(br,void 0,yr),[f,p]=Tt(),[m,h]=(0,v.useState)(Er.Uninitialized),g=m===Er.Initialized,{draggable:{active:_,nodes:y,translate:b},droppable:{containers:x}}=u,S=_==null?null:y.get(_),C=(0,v.useRef)({initial:null,translated:null}),w=(0,v.useMemo)(()=>_==null?null:{id:_,data:S?.data??fr,rect:C},[_,S]),T=(0,v.useRef)(null),[E,D]=(0,v.useState)(null),[O,k]=(0,v.useState)(null),A=rt(l,Object.values(l)),j=ct(`DndDescribedBy`,t),M=(0,v.useMemo)(()=>x.getEnabled(),[x]),N=Cr(s),{droppableRects:P,measureDroppableContainers:F,measuringScheduled:I}=Kn(M,{dragging:g,dependencies:[b.x,b.y],config:N.droppable}),L=Vn(y,_),ee=(0,v.useMemo)(()=>O?ht(O):null,[O]),te=we(),ne=Jn(L,N.draggable.measure);wr({activeNode:_==null?null:y.get(_),config:te.layoutShiftCompensation,initialRect:ne,measure:N.draggable.measure});let R=Qn(L,N.draggable.measure,ne),z=Qn(L?L.parentElement:null),B=(0,v.useRef)({activatorEvent:null,active:null,activeNode:L,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:y,draggingNode:null,draggingNodeRect:null,droppableContainers:x,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),V=x.getNodeFor(B.current.over?.id),re=ur({measure:N.dragOverlay.measure}),ie=re.nodeRef.current??L,H=g?re.rect??R:null,ae=!!(re.nodeRef.current&&re.rect),oe=$n(ae?null:R),se=or(ie?Ye(ie):null),U=tr(g?V??L:null),W=cr(U),ce=Sr(c,{transform:{x:b.x-oe.x,y:b.y-oe.y,scaleX:1,scaleY:1},activatorEvent:O,active:w,activeNodeRect:R,containerNodeRect:z,draggingNodeRect:H,over:B.current.over,overlayNodeRect:re.rect,scrollableAncestors:U,scrollableAncestorRects:W,windowRect:se}),le=ee?ut(ee,b):null,ue=nr(U),de=rr(ue),fe=rr(ue,[R]),pe=ut(ce,de),me=H?Ht(H,ce):null,he=w&&me?o({active:w,collisionRect:me,droppableRects:P,droppableContainers:M,pointerCoordinates:le}):null,ge=It(he,`id`),[_e,ve]=(0,v.useState)(null),ye=zt(ae?ce:ut(ce,fe),_e?.rect??null,R),G=(0,v.useRef)(null),be=(0,v.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(T.current==null)return;let i=y.get(T.current);if(!i)return;let a=e.nativeEvent,o=new n({active:T.current,activeNode:i,event:a,options:r,context:B,onAbort(e){if(!y.get(e))return;let{onDragAbort:t}=A.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!y.get(e))return;let{onDragPending:i}=A.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=T.current;if(t==null)return;let n=y.get(t);if(!n)return;let{onDragStart:r}=A.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:C}};(0,Ge.unstable_batchedUpdates)(()=>{r?.(i),h(Er.Initializing),d({type:kt.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),D(G.current),k(a)})},onMove(e){d({type:kt.DragMove,coordinates:e})},onEnd:s(kt.DragEnd),onCancel:s(kt.DragCancel)});G.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=B.current,o=null;if(t&&i){let{cancelDrop:s}=A.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===kt.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=kt.DragCancel)}T.current=null,(0,Ge.unstable_batchedUpdates)(()=>{d({type:e}),h(Er.Uninitialized),ve(null),D(null),k(null),G.current=null;let t=e===kt.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=A.current[t];e?.(o),f({type:t,event:o})}})}}},[y]),xe=Hn(a,(0,v.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=y.get(r);if(T.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},T.current=r,be(n,t))},[y,be]));ir(a),et(()=>{R&&m===Er.Initializing&&h(Er.Initialized)},[R,m]),(0,v.useEffect)(()=>{let{onDragMove:e}=A.current,{active:t,activatorEvent:n,collisions:r,over:i}=B.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:pe.x,y:pe.y},over:i};(0,Ge.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[pe.x,pe.y]),(0,v.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=B.current;if(!e||T.current==null||!t||!i)return;let{onDragOver:a}=A.current,o=r.get(ge),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,Ge.unstable_batchedUpdates)(()=>{ve(s),a?.(c),f({type:`onDragOver`,event:c})})},[ge]),et(()=>{B.current={activatorEvent:O,active:w,activeNode:L,collisionRect:me,collisions:he,droppableRects:P,draggableNodes:y,draggingNode:ie,draggingNodeRect:H,droppableContainers:x,over:_e,scrollableAncestors:U,scrollAdjustedTranslate:pe},C.current={initial:H,translated:me}},[w,L,he,me,y,ie,H,P,x,_e,U,pe]),Rn({...te,delta:b,draggingRect:me,pointerCoordinates:le,scrollableAncestors:U,scrollableAncestorRects:W});let Se=(0,v.useMemo)(()=>({active:w,activeNode:L,activeNodeRect:R,activatorEvent:O,collisions:he,containerNodeRect:z,dragOverlay:re,draggableNodes:y,droppableContainers:x,droppableRects:P,over:_e,measureDroppableContainers:F,scrollableAncestors:U,scrollableAncestorRects:W,measuringConfiguration:N,measuringScheduled:I,windowRect:se}),[w,L,R,O,he,z,re,y,x,P,_e,F,U,W,N,I,se]),Ce=(0,v.useMemo)(()=>({activatorEvent:O,activators:xe,active:w,activeNodeRect:R,ariaDescribedById:{draggable:j},dispatch:d,draggableNodes:y,over:_e,measureDroppableContainers:F}),[O,xe,w,R,d,j,y,_e,F]);return v.createElement(Ct.Provider,{value:p},v.createElement(_r.Provider,{value:Ce},v.createElement(vr.Provider,{value:Se},v.createElement(Tr.Provider,{value:ye},i)),v.createElement(xr,{disabled:n?.restoreFocus===!1})),v.createElement(Ot,{...n,hiddenTextDescribedById:j}));function we(){let e=E?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),Or=(0,v.createContext)(null),kr=`button`,Ar=`Draggable`;function jr(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=ct(Ar),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,v.useContext)(_r),{role:p=kr,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,v.useContext)(g?Tr:Or),[y,b]=at(),[x,S]=at(),C=ar(o,t),w=rt(n);return et(()=>(d.set(t,{id:t,key:a,node:y,activatorNode:x,data:w}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,v.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===kr?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:C,node:y,over:f,setNodeRef:b,setActivatorNodeRef:S,transform:_}}function Mr(){return(0,v.useContext)(vr)}var Nr=`Droppable`,Pr={timeout:25};function Fr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=ct(Nr),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,v.useContext)(_r),u=(0,v.useRef)({disabled:n}),d=(0,v.useRef)(!1),f=(0,v.useRef)(null),p=(0,v.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...Pr,...i},_=rt(h??r),y=Xn({callback:(0,v.useCallback)(()=>{d.current?(p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)):d.current=!0},[g]),disabled:m||!o}),[b,x]=at((0,v.useCallback)((e,t)=>{y&&(t&&(y.unobserve(t),d.current=!1),e&&y.observe(e))},[y])),S=rt(t);return(0,v.useEffect)(()=>{y&&b.current&&(y.disconnect(),d.current=!1,y.observe(b.current))},[b,y]),(0,v.useEffect)(()=>(s({type:kt.RegisterDroppable,element:{id:r,key:a,disabled:n,node:b,rect:f,data:S}}),()=>s({type:kt.UnregisterDroppable,key:a,id:r})),[r]),(0,v.useEffect)(()=>{n!==u.current.disabled&&(s({type:kt.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:b,over:c,setNodeRef:x}}function Ir(e){let{animation:t,children:n}=e,[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),s=ot(n);return!n&&!r&&s&&i(s),et(()=>{if(!a)return;let e=r?.key,n=r?.props.id;e==null||n==null?i(null):Promise.resolve(t(n,a)).then(()=>{i(null)})},[t,r,a]),v.createElement(v.Fragment,null,n,r?(0,v.cloneElement)(r,{ref:o}):null)}var Lr={x:0,y:0,scaleX:1,scaleY:1};function Rr(e){let{children:t}=e;return v.createElement(_r.Provider,{value:gr},v.createElement(Tr.Provider,{value:Lr},t))}var zr={position:`fixed`,touchAction:`none`},Br=e=>pt(e)?`transform 250ms ease`:void 0,Vr=(0,v.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=Br}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...zr,width:s.width,height:s.height,top:s.top,left:s.left,transform:gt.Transform.toString(d),transformOrigin:i&&r?Pt(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return v.createElement(n,{className:o,style:f,ref:t},a)}),Hr={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:gt.Transform.toString(t)},{transform:gt.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function Ur(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return tt((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=lr(a);if(!c)return;let{transform:l}=Ye(a).getComputedStyle(a),u=Ut(l);if(!u)return;let d=typeof t==`function`?t:Wr(t);return pn(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function Wr(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...Hr,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var Gr=0;function Kr(e){return(0,v.useMemo)(()=>{if(e!=null)return Gr++,Gr},[e])}var qr=v.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:y,scrollableAncestors:b,scrollableAncestorRects:x,windowRect:S}=Mr(),C=(0,v.useContext)(Tr),w=Kr(d?.id),T=Sr(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:b,scrollableAncestorRects:x,transform:C,windowRect:S}),E=qn(f),D=Ur({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:y}),O=E?g.setRef:void 0;return v.createElement(Rr,null,v.createElement(Ir,{animation:D},d&&w?v.createElement(Vr,{key:w,id:d.id,ref:O,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:E,style:{zIndex:l,...i},transform:T},n):null))}),Jr=e=>e.design&&!(`error`in e.design)?e.design:null;function Yr(e){let t=new Map((Jr(e)?.steps??[]).map(e=>[e.id,e.done]));return(e.domain.sections.design?.steps??[]).map(e=>({...e,done:t.get(e.id)??!1}))}var Xr=e=>{let t=new Set(Jr(e)?.questions??[]);return(e.questions??[]).filter(e=>t.has(e.id))},Zr=(e,t)=>{let n=new Set((e.units??[]).find(e=>e.id===t)?.blocked_by??[]);return(e.questions??[]).filter(e=>n.has(e.id))};function Qr(e){let t=e.value===`TBD`?null:e.value;return e.form===`record-list`?Array.isArray(t)?t:[]:e.form===`scalar`?typeof t==`string`?t:``:Array.isArray(t)?t.join(`
24
- `):``}function $r(e,t){return e.form===`record-list`||e.form===`scalar`?t:String(t).split(`
25
- `).map(e=>e.trim()).filter(Boolean)}function ei(e,t,n){return Object.fromEntries(e.filter(e=>JSON.stringify($r(e,t[e.key]))!==JSON.stringify($r(e,n[e.key]))).map(e=>[e.key,$r(e,n[e.key])]))}var ti=e=>Array.isArray(e)?!e.length:!e.trim();function ni(e){if(e===`GLOSSARY.md`||e===`gcf/glossary.md`)return`glossary`;if(e===`gcf/PILLARS.md`)return`pillars`;if(e===`gcf/game.md`)return`vision`;let t=/^gcf\/design\/([a-z0-9-]+)\.md$/.exec(e)?.[1];return t?`units:system:${t}`:null}var ri=e=>/^gcf\/(game|glossary|PILLARS)\.md$/.test(e)||e===`GLOSSARY.md`||e.startsWith(`gcf/design/`),ii={а:`a`,б:`b`,в:`v`,г:`g`,ґ:`g`,д:`d`,е:`e`,ё:`e`,є:`ie`,ж:`zh`,з:`z`,и:`i`,і:`i`,ї:`i`,й:`i`,к:`k`,л:`l`,м:`m`,н:`n`,о:`o`,п:`p`,р:`r`,с:`s`,т:`t`,у:`u`,ў:`u`,ф:`f`,х:`kh`,ц:`ts`,ч:`ch`,ш:`sh`,щ:`shch`,ъ:``,ы:`y`,ь:``,э:`e`,ю:`iu`,я:`ia`};function ai(e,t,n=`pillar`){let r=[...e.toLowerCase().normalize(`NFD`).replace(/\p{M}/gu,``).normalize(`NFC`)].map(e=>ii[e]??e).join(``).split(/[^a-z0-9]+/).filter(Boolean).slice(0,4);for(;r.length>1&&r.join(`-`).length>32;)r.pop();let i=r.join(`-`).slice(0,32).replace(/-+$/,``);if(!i){let e=1;for(;t(`${n}-${e}`);)e++;return`${n}-${e}`}let a=i;for(let e=2;t(a);e++)a=`${i}-${e}`;return a}function oi(e){let t=e.blocked_by.length>0;return{state:e.ready?`ready`:t?`held by ${e.blocked_by.join(`, `)}`:`TBD ${e.tbd}`,tone:e.ready?`ok`:t?`needs`:`warn`,tip:e.ready?`No TBD and no question: it can go into work`:t?`A question holds it: it cannot go into work until the question is answered and applied${e.tbd?` · TBD ${e.tbd}`:``}`:`${e.tbd} slot${e.tbd===1?` is`:`s are`} TBD`,extra:t&&e.tbd?`TBD ${e.tbd}`:``}}function si(e,t){let n=e.domain.sections.inbox,r=t.category??(t.class===`D2`?`assumption`:`decision`),i=n?.categories?.find(e=>e.id===r);return{label:i?.label??r,help:i?.help??``,needs:!!(i&&n?.groups?.find(e=>e.id===i.group)?.counts)}}var ci=e=>typeof e==`string`&&/^TBD\b/.test(e);function li(e){let t=[];for(let n of e.replace(/\r\n/g,`
26
- `).split(`
27
- `)){let e=/^(#{1,3}) (.*)$/.exec(n);e?t.push({h:e[2],level:e[1].length,body:``}):t.length&&(t[t.length-1].body+=`${n}\n`)}return t.map(e=>({...e,body:e.body.trim()}))}function ui(e){let t=[],n=[];for(let r of e.split(`
28
- `)){let e=/^applied (.+)$/.exec(r),i=/^(\S+) (\S+): (.*)$/.exec(r);e?t.push(e[1]):i&&n.push({outcome:i[1],part:i[2],note:i[3]})}return{applied:t,report:n}}function di(e,t){let n=[...e.record_keys,...e.optional_record_keys];return[...n,...new Set(t.flatMap(e=>Object.keys(e)).filter(e=>!n.includes(e)))]}function fi(e,t){if(!t||!Object.hasOwn(e.moves,t))return null;let{args:n,...r}=e.moves[t];return r.kind===`agent`?null:{...r,cmd:t}}var pi=(e,t)=>e.moves.flatMap(e=>fi(t,e)??[]),mi=new Set([`verdict:keep`,`decide:go`]),hi=e=>e.danger?`btn-danger`:mi.has(e.cmd)?`btn-ok`:`btn`,gi=(e,t)=>{let n=e.moves.find(e=>t.moves[e]?.kind===`agent`);return n?t.moves[n]:null},_i=(e,t)=>!!(t.harness&&gi(e,t)),vi=(e,t)=>!e.when||e.when.is.includes(String(t[e.when.key]??``)),yi=e=>String(e??``).split(/[\s,]+/).filter(Boolean);function bi(e,t){return Object.fromEntries(e.filter(e=>vi(e,t)&&t[e.key]!==void 0).map(e=>{let n=t[e.key];return e.kind===`list`?[e.key,(n??[]).map(e=>e.trim()).filter(Boolean)]:e.kind===`ids`||e.kind===`tags`?[e.key,yi(n)]:[e.key,n]}))}var xi=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).replace(/^data:[^,]*,/,``)),r.onerror=()=>n(r.error),r.readAsDataURL(e)}),Si=(e,t={})=>({...Object.fromEntries(e.flatMap(e=>e.default===void 0?[]:[[e.key,e.default]])),...t});function Ci(e,t){let n=e[t.key];return t.key===`skip_gates`?n===!0?`skip · its own`:n===!1?`wait · its own`:`project`:n==null||n===``||n===0?null:Array.isArray(n)?n.length?n.join(`, `):null:t.kind===`rank`?`#${String(n)}`:String(n)}var wi=(e,t)=>e.options?.find(e=>e.value===t)?.help??e.help,Ti=(e,t)=>e.length>t?`${e.slice(0,t-1)}…`:e,Ei=/^[a-z0-9]+(-[a-z0-9]+)*$/,Di=e=>[...new Set([...Object.keys(Jr(e)?.systems??{}),...e.items.flatMap(e=>e.system),...(e.units??[]).map(e=>e.system)])].filter(Boolean).sort();function Oi(e,t){return[{value:``,label:`none`},...e.map(e=>({value:e.name,label:e.goal?`${e.name} · ${Ti(e.goal,48)}`:e.name})),...t&&!e.some(e=>e.name===t)?[{value:t,label:`${t} (not in game.md)`}]:[]]}function ki(e,t,n){let r=t.of??[`item`];return[{value:``,label:`none`},...[...e.items].filter(e=>!t.of||t.of.includes(e.type)).sort((e,t)=>Number(e.priority===null)-Number(t.priority===null)||(e.priority??0)-(t.priority??0)).map(e=>({value:e.id,label:e.title?`${e.title} (${e.id})`:e.id})),...n&&!e.items.some(e=>e.id===n&&(!t.of||t.of.includes(e.type)))?[{value:n,label:`${n} (not a live ${r.join(` or `)})`}]:[]]}function Ai(e,t,n){if(t===n||!e.includes(t))return null;let r=e.filter(e=>e!==t),i=n===null?r.length:r.indexOf(n);return i<0?null:(r.splice(i,0,t),r.join()===e.join()?null:r)}var ji=e=>e.running?`running`:e.status;function Mi(e,t,n){let r=ji(e);if(t===n.runs_from&&r===t)return fi(n,n.rank)?{act:`rank`}:null;if(t===r)return null;if(t===`running`&&_i(e,n))return{act:`run`};let i=pi(e,n).find(e=>e.drag===t);return i?{act:`move`,move:i}:null}function Ni(e,t,n,r){if(r)return r;let i=t.filter(e=>e!==n).at(-1);if(!i)return null;let a=e.filter(e=>e!==n);return a[a.indexOf(i)+1]??null}function Pi(e,t){let n=e.filter(e=>e!==t),r=e.indexOf(t);return{list:n,self:r<0?n.length:r}}function Fi(e,t,n){let r=ji(e),i=n.filter(n=>n===r||Mi(e,n,t));return t.sections.graveyard&&Mi(e,`graveyard`,t)?[...i,`graveyard`]:i}var Ii=(e,t)=>({id:e.id,from:ji(e),target:ji(e),pos:Pi(t,e.id).self});function Li(e,t,n,r,i){let a=Pi(r,e.id);if(t===`ArrowLeft`||t===`ArrowRight`){let r=n.length,o=n[(n.indexOf(e.target)+(t===`ArrowRight`?1:-1)+r)%r];return{...e,target:o,pos:o===i&&e.from===i?a.self:e.pos}}if((t===`ArrowUp`||t===`ArrowDown`)&&e.target===i&&e.from===i){let n=Math.max(0,Math.min(a.list.length,e.pos+(t===`ArrowDown`?1:-1)));return n===e.pos?e:{...e,pos:n}}return e}function Ri(e,t,n,r,i){let a=Pi(r,e.id),o=e.target===n.runs_from&&e.from===n.runs_from,s=e.target===e.from&&(!o||e.pos===a.self),c=o?a.list[e.pos]??null:null,l=e.target===`graveyard`?n.sections.graveyard?.label??`Graveyard`:i[e.target]??e.target,u=s?null:Mi(t,e.target,n),d=u?u.act===`rank`?`rank ${e.pos+1}, ${c?`before ${c}`:`last of the ranked`}`:u.act===`run`?`Run: it asks first`:`opens the ${u.move.label} form`:`back where it was`;return{same:s,ranking:o,before:c,where:l,act:d,say:`${e.id} picked up · ${l}: ${d}. Arrows move it, Space drops it, Escape puts it back.`}}var zi=3e5,Bi=e=>e<6e4?`${Math.round(e/1e3)} s`:e<36e5?`${Math.round(e/6e4)} min`:`${Math.round(e/36e5)} h`;function Vi({at:e}){let[t,n]=(0,v.useState)(Date.now());(0,v.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),5e3);return()=>clearInterval(e)},[]);let r=Math.max(0,t-Date.parse(e)),i=`Its run log was last written at ${new Date(e).toLocaleTimeString()}`;return r<zi?(0,G.jsxs)(`span`,{className:`activity`,title:i,children:[(0,G.jsx)(`span`,{className:`dot pulse`,"aria-hidden":`true`}),` active `,Bi(r),` ago`]}):(0,G.jsxs)(`span`,{className:`quiet`,title:i,children:[`quiet `,Bi(r)]})}var Hi=(e,t)=>t.size&&e.runs?{...e,runs:{...e.runs,reports:e.runs.reports?.filter(e=>!t.has(e.id))}}:e;async function Ui(e,t,n){e.add(t),n.show(),await n.ask().catch(r=>{e.delete(t),n.refused(r)}),await n.read(),e.delete(t)}var Wi=e=>typeof e==`number`?`$${e.toFixed(2)}`:``,Gi=(e,t)=>e?`, ${e} ${t}${e>1?`s`:``}`:``,Ki=e=>(e.result??`merged`).split(` (`)[0];function qi(e){return/^(error|conflict)$/.test(e)?`error`:/^(block|no result)/.test(e)?`warn`:/^(paused|skipped)/.test(e)?`neutral`:`ok`}function Ji(e){let t=e.returned,n=e.conflicts?.length??0;return[...e.shelved?[{mark:`⇢`,text:`${e.shelved.id}'s work went to ${e.shelved.branch}`}]:[],...e.shelved?.staged?[{mark:``,text:e.shelved.staged}]:[],...t?[{mark:`⇢`,text:`its work came back${n?` with ${n} conflict(s)`:``}`}]:[],...(e.conflicts??[]).map(e=>({mark:``,text:`conflict: ${e.path}${e.kept_main?`, main kept`:``}`})),...t?.staged?[{mark:``,text:t.staged}]:[],...t?.branch_moved?[{mark:``,text:`work/${t.id} moved on: its copy is kept`}]:[],...e.left?.length?[{mark:``,text:`left: ${e.left.join(`, `)}`}]:[]]}function Yi(e,t){let n=Wi(e.cost_usd);return{lead:t,id:e.id,word:e.result??`merged`,tone:qi(Ki(e)),text:e.reason??e.error??e.conflict??``,tail:`${n&&` — ${n}`}${Gi(e.handoffs,`handoff`)}${Gi(e.lessons,`lesson`)}`,warn:e.process,subs:Ji(e)}}function Xi(e){return[...(e.orphans??[]).map(e=>Yi(e,`picked up`)),...e.gate?[{text:e.waits?e.gate:`gate: ${e.gate}`,subs:[]}]:[],...(e.items??[]).map(e=>Yi(e)),...(e.features??[]).map(e=>Yi(e,`feature`))]}function Zi(e){let t=e.result;return[...new Set([...e.ids,...t?.waits?[t.waits.id,...t.waits.depends]:[],...[...t?.items??[],...t?.orphans??[],...t?.features??[]].flatMap(e=>[e.id,...e.shelved?[e.shelved.id]:[]])])]}function Qi(e){let t=e.result;return t?.waits?[{id:t.waits.id,word:`did not start`,tone:`quiet`,cost:``}]:t?.gate&&!t.items?.length?e.ids.map(e=>({id:e,word:`refused by the gate`,tone:`error`,cost:``})):t?.items?.length?t.items.map(e=>{let t=Ki(e);return{id:e.id,word:t,tone:qi(t),cost:Wi(e.cost_usd)}}):e.ids.map(e=>({id:e,word:``,tone:`neutral`,cost:``}))}function K(e){let t=e.result,n=!e.ok||[...t?.items??[],...t?.features??[]].some(e=>e.result===`error`||e.result===`conflict`),r={"not-started":{word:`did not start`,tone:`quiet`},failed:{word:`run failed`,tone:`error`},paused:{word:`run paused`,tone:`neutral`},ended:{word:`run ended`,tone:`ok`}},i=t?.waits?`not-started`:n?`failed`:(t?.items??[]).some(e=>e.result?.startsWith(`paused`))?`paused`:`ended`,a=t?Xi(t):[],o=e.err.split(`
29
- `).map(e=>e.trimEnd()).filter(Boolean).slice(-3),s=o.length?o:[e.ok?`ended`:`failed`];return{kind:i,...r[i],items:Qi(e),lines:a.length?a:s.map(e=>({text:e,subs:[]})),note:e.note,named:Zi(e)}}function $i(e){let t=[...e].reverse(),n=e=>K(e).kind===`failed`;return[...t.filter(n),...t.filter(e=>!n(e))]}function ea(e,t){return e.map(e=>{let n=t.find(t=>t.id===e);if(!n?.resumable)return e;let r=n.resume?.ended;return`${e} (${r===`limit`?`paused: limit: resumes its session`:r===`handoff`?`paused: context handoff: a fresh session goes on from the plan`:`interrupted: resumes its kept work`})`}).join(`, `)}var ta=e=>({console:`running — console run`,session:`running — your session`})[e.running_kind??``]??`running`,na=e=>{let t=new Date(e);return`${[t.getFullYear(),t.getMonth()+1,t.getDate()].map(e=>String(e).padStart(2,`0`)).join(`-`)} ${ra(e)}`},ra=e=>new Date(e).toTimeString().slice(0,5),ia=e=>{let t=new Date(e),n=e=>String(e).padStart(2,`0`);return Number.isNaN(t.getTime())?``:`${n(t.getDate())}.${n(t.getMonth()+1)} ${ra(e)}`};function aa(e,t=new Date){let n=new Date(e);return n.toDateString()===t.toDateString()?ra(e):`${n.toLocaleDateString(void 0,{weekday:`short`,day:`numeric`,month:`short`})} ${ra(e)}`}var oa=e=>e.resume?.ended===`limit`?`The usage limit stopped it past what its run waits for; run it after the reset`:`Its last run stopped; the next run resumes its work`;function sa(e){let t={handoff:`context handoff`,limit:`limit`}[e.resume?.ended??``];return t?`paused: ${t}`:`interrupted`}var ca=e=>`shelved: ${e.files} file${e.files===1?``:`s`}`;function la(e,t){let n=t.commits?`, main moved ${t.commits} commit${t.commits===1?``:`s`} since`:``;return`${ca(t)} on work/${e}${n}; a run brings them back, a drop drops them`}var ua=`The run waits for the usage limit's reset, then goes on by itself; Go on now if you reset it early, Stop ends the wait`,da=(e,t,n,r=ra)=>{let i=e?r(e):`?`;return t?`reserve: ${n?`quota at ${n}%, `:``}goes on at ${i}`:`limit: resumes ${i}`};function fa(e,t=Date.now()){let n=Date.parse(e.resume?.resets??``);if(!e.running||Number.isNaN(n))return null;let r=Math.ceil((n+6e4)/6e4)*6e4;return r>t?new Date(r).toISOString():null}var pa=`You reset the usage limit early: the wait ends now and the session goes on. If the limit still holds, it waits again; nothing is lost`;function ma({ctx:e,of:t,label:n=`Go on now`}){let[r,i]=(0,v.useState)(!1),a=async()=>{i(!0);try{let n=e.project.name;if(`talk`in t)await H.wakeTalk(n,t.talk);else{let r=await H.wake(n,t);if(!r.ok)throw Error(r.err||r.out);/^nothing waits/.test(r.out)&&e.notify(r.out,`warn`)}}catch(t){e.notify(t.message,`error`)}i(!1)};return(0,G.jsx)(`button`,{className:`btn`,title:pa,disabled:r,onClick:()=>void a(),children:n})}var ha=`default`,ga=e=>/^x[a-z]/.test(e)?`x${e.charAt(1).toUpperCase()}${e.slice(2)}`:e.charAt(0).toUpperCase()+e.slice(1),_a=(e,t)=>e?`Default - project setting (${ga(e)})`:t?`Default (${ga(t)})`:`Default`,va=(e,t,n)=>t?`Default sets nothing: it runs on the project setting (agent.${e}: ${t})`:n?`Default sets nothing: the default holds (${ga(n)})`:`Default sets nothing: the agent's own ${e} holds`,ya=(e,t)=>(t===`model`||t===`effort`?e.agent?.[t]:null)??null,ba=(e,t)=>(t===`model`||t===`effort`?e.defaults?.[t]:null)??null,xa=(e,t,n)=>(n&&n!=="default"?n:null)??ya(e,t)??ba(e,t);function Sa(e,t,n,r){return[...n===null?[]:[{value:r,label:n}],...e.map(e=>({value:e,label:ga(e)})),...t&&t!==r&&!e.includes(t)?[{value:t,label:`${t} (set from the console)`}]:[]]}function Ca({id:e,what:t,presets:n,value:r,onChange:i,compact:a=!1,disabled:o=!1,project:s,fallback:c,auto:l,autoValue:u=ha,from:d,own:f=!1}){let p=r&&r!=="default"?r:u;return(0,G.jsx)(`span`,{className:`a-pick ${a?`compact`:``} ${f?`own`:``}`,children:(0,G.jsx)(`select`,{id:e,className:`input`,"aria-label":a?t:void 0,value:p,disabled:o,title:a?`${t[0].toUpperCase()}${t.slice(1)}: ${d??`what holds`} · the agent's next session takes a change (a resume or a fresh agent)`:l?`Default sets nothing for this run: each item runs on its own ${t}, else the project setting, else the default`:va(t,s,c),onChange:e=>i(e.target.value),children:Sa(n,p,a?null:l??_a(s,c),u).map(e=>(0,G.jsx)(`option`,{value:e.value,children:e.label},e.value))})})}function wa({ctx:e,talk:t}){let n=e.talks.find(e=>e.id===t),r=e.board.presets,[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)({});if((0,v.useEffect)(()=>s({}),[n?.model,n?.effort]),!n||!r||!(r.model.length||r.effort.length))return null;let c=async(n,r)=>{a(!0),s({...o,[n]:r});try{await H.pickTalk(e.project.name,t,{[n]:r}),e.notify(`${n} ${ga(r)}: from the agent's next session`),e.reloadTalks()}catch(t){s({...o,[n]:void 0}),e.notify(t.message,`error`)}finally{a(!1)}},l=e=>{let t=o[e]??n[e];return t&&t!=="default"?t:null},u=l(`model`)||l(`effort`),d=async()=>{a(!0),s({model:ha,effort:ha});try{await H.pickTalk(e.project.name,t,{model:ha,effort:ha}),e.notify(`the thread follows the project's setting: from the agent's next session`),e.reloadTalks()}catch(t){s({}),e.notify(t.message,`error`)}finally{a(!1)}},f=t=>ga(xa(e.board,t)??``)||`the default`;return(0,G.jsxs)(G.Fragment,{children:[[`model`,`effort`].map(t=>(0,G.jsx)(Ca,{what:t,presets:r[t],value:xa(e.board,t,o[t]??n[t]),compact:!0,own:!!l(t),from:l(t)?`this thread's own pick`:ya(e.board,t)?`the project setting (agent.${t})`:`the default`,disabled:i,onChange:e=>void c(t,e)},t)),u&&(0,G.jsxs)(`button`,{type:`button`,className:`a-pick-follow`,"aria-label":`Follow the project setting`,title:`This thread has its own pick (${[l(`model`),l(`effort`)].filter(Boolean).map(e=>ga(e)).join(` · `)}). Take it off: the thread follows the project setting again (${f(`model`)} · ${f(`effort`)}), and a later change in Settings reaches it`,disabled:i,onClick:()=>void d(),children:[(0,G.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M3 12a9 9 0 1 0 3-6.7`}),(0,G.jsx)(`path`,{d:`M3 4v5h5`})]}),`project`]})]})}var Ta=`0.13.0`;function Ea(e,t){if(e===void 0)return!1;if(e===null)return!0;let n=e.split(/[.+-]/).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<r.length;e++){let t=n[e]||0;if(t!==r[e])return t>r[e]}return!0}var Da=(e,t)=>e.extensions?e.extensions[`${t}-aif-ext`]:void 0,Oa=e=>Da(e,e.domain.kind),ka=e=>e.domain.harness?Da(e,e.domain.harness):void 0,Aa=e=>Ea(Oa(e),Ta),ja=e=>!!e.domain.harness&&Ea(ka(e),`0.13.0`),Ma={main:`in the project folder, one at a time`,worktree:`in its own worktree`},Na=e=>e&&e!=="default"?e:null,Pa=e=>e.answer(null),Fa=1500;function Ia(e,t,n){let[r,i]=(0,v.useState)({}),[a,o]=(0,v.useState)(null),s=e?.board.runs,c=!!(s?.paused||s?.active.some(e=>e.mode===`main`)),l=(e&&t?.filter(t=>!(c&&Fe(e.board,t,n)===`main`)))?.join(`,`)??``,u=e&&t?.length&&e.board.domain.harness?e.project.name:null,d=(0,v.useRef)(``);return(0,v.useEffect)(()=>{if(!u)return d.current=``,o([]),i({});let e=!0,t=d.current===`${u}/${l}`;d.current=`${u}/${l}`,t||(i({}),o(null));let n=setTimeout(()=>void H.gate(u,l.split(`,`)).then(t=>{if(!e)return;o(t.dirty??[]);let n=new Set(l.split(`,`));i(Object.fromEntries(Object.entries(t.items??{}).flatMap(([e,t])=>t.pass||!n.has(e)?[]:[[e,t.reason]])))}).catch(()=>{e&&(i({}),o([]))}),t?Fa:0);return()=>{e=!1,clearTimeout(n)}},[u,l,e?.board]),{refused:r,dirty:a}}function La(e){return`The project folder holds uncommitted changes outside gcf/: ${e.slice(0,5).join(`, `)}${e.length>5?` and ${e.length-5} more`:``}. A main run's code lands among them, and its build and commits meet them: commit them or set them aside first.`}var Ra=(e,t=`Commit the loose work in the project folder: a main run is about to start among it.`)=>[t,`The uncommitted changes outside gcf/: ${e.join(`, `)}.`,`Read the diff of each first. Commit what belongs to the project, with a message that says what it is.`,`A file that looks like it should not go into git (editor noise, a secret, a stray build file): leave it, and tell me which and why.`].join(`
30
- `),za=(e,t)=>[Ra(e,`Commit the loose work the operator ticked in the project folder.`),...t.trim()?[`From the operator:`,t]:[]].join(`
31
- `);async function Ba(e,t){let n=null,r=!1;try{n=(await H.newTalk(e.project.name)).id,await H.sendTalk(e.project.name,n,{type:`say`,text:t}),r=!0}catch(t){e.notify(t.message,`error`)}return n&&(e.reloadTalks(),e.go(`chat`,n)),{opened:!!n,sent:r}}function Va(){return(0,G.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M4 4.5h16v11.5H10.5L6 19.5V16H4z`}),(0,G.jsx)(`path`,{d:`M8.8 10.4l2.1 2.1 4.2-4.2`})]})}function Ha(e,t){return!e.board.domain.chat||!t.length?null:{label:`Commit with agent`,agent:(0,G.jsx)(Va,{}),title:`A project chat thread: its agent reads the diff and commits these files; nothing runs`,go:()=>void Ba(e,Ra(t))}}var Ua=(e,t,n=!1)=>new Promise(r=>Pa({ctx:e,ids:t,gate:n,answer:r}));async function Wa(e,t,n=!1){let r=await Ua(e,t,n);return r&&await e.run(r.ids,!1,r.agent),!!r}function Ga(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)({}),i=(0,v.useId)(),{refused:a,dirty:o}=Ia(e?.ctx??null,e?.ids??null,n.mode);if((0,v.useEffect)(()=>{Pa=e=>{r({}),t(t=>(t?.answer(null),e))}},[]),!e)return null;let{ctx:s,ids:c,gate:l}=e,{board:u}=s,d=c.filter(e=>!a[e]),f=r=>{t(null);let i={model:Na(n.model),effort:Na(n.effort),mode:n.mode};e.answer(r?{ids:d,agent:i}:null)},p=u.presets,m=ja(u)&&p&&(p.model.length||p.effort.length),h=e=>{let t=[e?.model,e?.effort,e?.run_mode].filter(Boolean);return t.length?`its own: ${t.join(` · `)}`:``},g=[Na(n.model),Na(n.effort),n.mode].filter(Boolean).join(` · `),_=[...new Set(d.map(e=>Fe(u,e,n.mode)))],y=_.length>1?`each where it runs (${_.map(e=>`${e}: ${Ma[e]}`).join(`; `)}), two runs at once`:Ma[_[0]??Fe(u,c[0],n.mode)],b=e=>d.filter(t=>Fe(u,t,n.mode)===e),x=b(`main`).filter(e=>u.items.find(t=>t.id===e)?.type===`spike`),S=[x.length?`${x.join(`, `)}: a spike on main leaves its code in main; in a worktree only its plan comes back, its code kept as a spike/<id> tag`:``,b(`worktree`).length&&u.runs?.active.some(e=>e.mode===`main`)?`a main run works in the project folder now: a worktree branch merges when that run ends`:``,b(`main`).length&&u.runs?.active.some(e=>e.mode===`main`)?`a main run works in the project folder now: this one waits in the queue`:``].filter(Boolean),C=b(`main`).length>0&&!!o?.length,w=C&&o?Ha(s,o):null;return(0,G.jsx)(De,{onClose:()=>f(!1),dirty:!1,children:(0,G.jsxs)(`div`,{className:`dialog`,role:`dialog`,"aria-modal":!0,"aria-label":`Run ${c.join(`, `)}?`,onClick:e=>e.stopPropagation(),children:[(0,G.jsxs)(`h2`,{children:[`Run `,c.join(`, `),`?`]}),(0,G.jsxs)(`p`,{className:`dialog-body`,children:[l?`The run gate picked these. `:``,`One agent session each, `,y,`.`,m?` A model or effort picked here holds for this run only; each item keeps its own.`:u.domain.harness&&!ja(u)?` This harness is older than run picks: each item runs on its own model.`:``]}),(0,G.jsx)(`ul`,{className:`run-list`,children:c.map(e=>{let t=h(u.items.find(t=>t.id===e));return(0,G.jsxs)(`li`,{className:a[e]?`refused`:void 0,children:[(0,G.jsx)(`span`,{className:`mono`,children:ea([e],u.items)}),a[e]?(0,G.jsxs)(`span`,{className:`small`,children:[`✕ the run gate refuses it now: `,a[e]]}):t&&(0,G.jsx)(`span`,{className:`dim small`,children:t})]},e)})}),m&&[`model`,`effort`].map(e=>(0,G.jsxs)(`div`,{className:`f-field`,children:[(0,G.jsx)(`span`,{className:`f-label`,children:(0,G.jsxs)(`label`,{htmlFor:`${i}-${e}`,children:[e===`model`?`Model`:`Effort`,` for this run`]})}),(0,G.jsx)(Ca,{id:`${i}-${e}`,what:e,presets:p[e],value:n[e],auto:`Default - each item's own`,onChange:t=>r({...n,[e]:t})})]},e)),(0,G.jsxs)(`div`,{className:`f-field`,children:[(0,G.jsx)(`span`,{className:`f-label`,children:(0,G.jsx)(`label`,{htmlFor:`${i}-mode`,children:`Where this run goes`})}),(0,G.jsxs)(`select`,{id:`${i}-mode`,className:`input`,value:n.mode??``,onChange:e=>r({...n,mode:e.target.value===``?void 0:e.target.value}),children:[(0,G.jsxs)(`option`,{value:``,children:[`default: each item's own, else the project's (`,u.run_mode,`)`]}),(0,G.jsxs)(`option`,{value:`main`,children:[`main · `,Ma.main]}),(0,G.jsxs)(`option`,{value:`worktree`,children:[`worktree · `,Ma.worktree]})]}),S.map(e=>(0,G.jsx)(`span`,{className:`f-help`,children:e},e)),C&&o&&(0,G.jsx)(je,{head:`Loose work in the project folder`,text:`${La(o)} Or pick worktree above.`})]}),(0,G.jsxs)(`div`,{className:`dialog-actions`,children:[(0,G.jsx)(`button`,{type:`button`,className:`btn-line`,onClick:()=>f(!1),children:`Cancel`}),w&&(0,G.jsxs)(`button`,{type:`button`,className:`btn btn-agent`,title:w.title,onClick:()=>{f(!1),w.go()},children:[(0,G.jsx)(Va,{}),w.label]}),(0,G.jsx)(`button`,{type:`button`,className:`btn-primary`,autoFocus:!0,disabled:!d.length||b(`main`).length>0&&o===null,title:d.length?b(`main`).length>0&&o===null?`Asking the run gate first`:void 0:`The run gate refuses every one of them now`,onClick:()=>f(!0),children:d.length<c.length&&d.length?`Run ${d.join(`, `)}${g?` on ${g}`:``}`:g?`Run on ${g}`:`Run`})]})]})})}function Ka(e){let[t,n]=(0,v.useState)(3),[r,i]=(0,v.useState)(!1);return{count:t,setCount:n,busy:r,go:async()=>{i(!0);try{let n=await H.next(e.project.name,t);n.length?(i(!1),await Wa(e,n,!0)):e.notify(`nothing can run now: dependencies, WIP or a run in progress`,`error`)}catch(t){e.notify(t.message,`error`)}i(!1)}}}function qa({ctx:e}){let{count:t,setCount:n,busy:r,go:i}=Ka(e);return(0,G.jsxs)(`div`,{className:`run-next`,title:`The framework's run gate picks them`,children:[(0,G.jsx)(`button`,{disabled:r,onClick:()=>void i(),children:r?`asking the run gate…`:`Run next`}),(0,G.jsx)(`input`,{type:`number`,min:1,max:20,value:t,onChange:e=>n(Math.max(1,Math.min(20,Number(e.target.value)||1))),"aria-label":`How many, 1 to 20`})]})}async function Ja(e,t){await ke(fa(t)?`Stop the run of ${t.id}? It ends the wait for the reset: ${t.id} becomes paused: limit, Run resumes it later, and the queue goes on.`:`Stop the run of ${t.id}? It stays ready with its work kept; Run resumes it.`,`Stop`,!0)&&await e.stop(t.id)}function Ya(e){let t=e.domain.sections?.inbox,n=new Set((t?.groups??[]).filter(e=>e.counts).map(e=>e.id)),r=new Set((t?.categories??[]).filter(e=>n.has(e.group)).map(e=>e.id));return{entries:(e.inbox??[]).filter(e=>r.has(e.category)&&!e.later),repeats:n.size?e.inbox_repeats??[]:[]}}function Xa(e){let{entries:t,repeats:n}=Ya(e),r=(e.questions??[]).filter(e=>Za(e)&&!e.answer);return t.length+n.length+r.length}var Za=e=>e.category?e.category===`decision`:/^D1\b/.test(e.class??``);function Qa(e,t){return e.domain.columns.some(e=>e.human&&e.status===t)}function $a(e,t){return e.running?!1:Qa(t,e.status)?!0:e.resumable&&e.resume?.ended===`limit`}function eo(e,t=[]){let n=(e.runs?.reports??[]).filter(e=>K(e).kind===`failed`),r=Ya(e),i=e.items.filter(t=>$a(t,e)).sort((e,t)=>(e.priority??1/0)-(t.priority??1/0));return[...n.map(e=>({kind:`report`,report:e})),...e.runs?.paused?[{kind:`queue`}]:[],...e.runs?.autopilot?.stop&&e.runs.autopilot.stop.kind!==`idle`?[{kind:`pilot`,stop:e.runs.autopilot.stop}]:[],...t.flatMap(e=>e.card&&!e.limit_until?[{kind:`chat`,card:e.card,talk:e}]:[]),...e.items.flatMap(e=>e.running&&e.chat_card?[{kind:`chat`,card:e.chat_card,item:e.id}]:[]),...(e.questions??[]).filter(e=>Za(e)&&!e.answer).map(e=>({kind:`question`,question:e})),...r.entries.map(e=>({kind:`entry`,entry:e})),...r.repeats.map(e=>({kind:`repeat`,repeat:e})),...i.map(e=>({kind:`item`,item:e}))]}var to=e=>[e.blocked_by.length?`blocked by ${e.blocked_by.join(`, `)}`:``,e.tbd?`TBD ${e.tbd}`:``].filter(Boolean).join(` · `)||(e.ready?`ready`:`not ready`);function no(e,t){return t.running?`running`:e.domain.columns.find(e=>e.status===t.status)?.label??t.status}function ro(e,t,n=[]){let r=e.items.find(e=>e.id===t);if(r){let i=no(e,r),a=n.includes(t)?`the run gate waits for it`:`it lets a run start`;return{id:t,kind:`item`,state:`${i}${r.verified?` · verified`:``}`,tone:r.running?`running`:r.status,tip:`${r.title??t} · ${i} · ${a}`}}let i=e.units?.find(e=>e.id===t);if(i)return{id:t,kind:`unit`,state:to(i),tone:i.ready?`ok`:`warn`,tip:`design unit, not taken into work · ${i.title??t} · ${i.file}`};let a=e.graveyard?.find(e=>e.id===t);if(a)return{id:t,kind:`grave`,state:`graveyard: it never will be done`,tone:`error`,tip:a.reason??`in the graveyard`};let o=e.history?.find(e=>e.id===t);return o?{id:t,kind:`history`,state:`ended${o.event?`: ${o.event}`:``}`,tone:`ok`,tip:`in history${o.date?` since ${o.date}`:``}`}:{id:t,kind:`unknown`,state:`unknown: no item, unit or graveyard line`,tone:`warn`,tip:`The framework knows no ${t}`}}var io=e=>e.needs??[],ao=e=>e.needed_by??[];function oo(e,t,n){let r=n&&n!==t.id?e.items.find(e=>e.id===n):void 0;if(!r)return{label:``,dim:!1,self:n===t.id};let i=io(r).includes(t.id)?`needed by ${r.id}`:io(t).includes(r.id)?`needs ${r.id}`:``;return{label:i,dim:!i,self:!1}}var so=(e,t)=>ao(t).length>0||io(t).some(t=>e.items.some(e=>e.id===t));function co(e,t){let n=e[t];return n==null||n===``?[]:Array.isArray(n)?n.map(String):[String(n)]}var lo=(e,t,n)=>t.every(t=>{let r=n[t.key];return!r?.length||co(e,t.key).some(e=>r.includes(e))});function uo(e,t){let n=t.trim().toLowerCase();return!n||e.id.includes(n)||(e.title??``).toLowerCase().includes(n)}var fo=(e,t)=>e.options?.find(e=>e.value===t)?.label??t;function po(e,t,n){let r=new Map;for(let n of e)for(let e of co(n,t.key))r.set(e,(r.get(e)??0)+1);return[...r.keys()].sort().map(e=>({value:e,label:fo(t,e),count:r.get(e)??0,on:(n[t.key]??[]).includes(e)}))}function mo(e,t,n){let r=e[t]??[],i=r.includes(n)?r.filter(e=>e!==n):[...r,n],{[t]:a,...o}=e;return i.length?{...o,[t]:i}:o}function ho(e,t,n){let r=new Map;for(let e of t){let t=co(e,n.key);for(let n of t.length?t:[``])r.set(n,[...r.get(n)??[],e])}return[...r.keys()].sort((e,t)=>Number(e===``)-Number(t===``)||e.localeCompare(t)).map(t=>{let i=n.kind===`ids`&&t?e.items.find(e=>e.id===t):void 0,a=i?.title;return{value:t,label:t?a||t:`none`,sub:a?t:``,item:i?i.id:null,items:r.get(t)??[]}})}var go=window.matchMedia(`(width <= 700px)`),_o={status:`running`,label:`running`,help:`An agent session works on it`},vo=new Set([`priority`,`type`,`gate`,`severity`,`tune_count`,`waits_for`,`blocked`,`needs`,`needed_by`]);function yo(e,t){return e.starting?{label:`starting…`,tone:`running`,tip:`Run asked for: the harness claims it (seconds); a refused start puts the card back in ready`}:e.running_kind===`console`?{label:`running — console run`,tone:`running`,tip:`Started from a console (gcf-harness run)`}:e.running_kind===`session`?{label:`running — your session`,tone:`running`,tip:`Your own agent session works on it; release the mark when you are done`}:e.shelved&&!e.running?{label:ca(e.shelved),tone:`neutral`,tip:la(e.id,e.shelved)}:e.resumable&&!e.running?{label:sa(e),tone:`neutral`,tip:oa(e)}:t?{label:`queued`,tone:`queued`,tip:`Waits for the main run going on; starts after it`}:null}var bo=new Set([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,` `,`Enter`,`Escape`,`Tab`]),xo=({text:e,compact:t})=>(0,G.jsx)(`div`,{className:`k-ghost ${t?`compact`:``}`,"aria-hidden":`true`,children:e});function So({item:e,ctx:t,compact:n,selected:r,onSelect:i,hover:a,lane:o,kb:s}){let{board:c}=t,{domain:l}=c,u=o===void 0?e.id:`${e.id}@${o}`,{attributes:d,listeners:f,setNodeRef:p,isDragging:m}=jr({id:u,data:{id:e.id}}),h=Fr({id:`before:${u}`,data:{id:e.id},disabled:ji(e)!==l.runs_from||!l.rank}),g=e=>{p(e),h.setNodeRef(e)},_=c.runs?.queued.includes(e.id)??!1,v=fa(e),y=new Map;for(let t of l.fields){let n=t.card?Ci(e,t):null;n!==null&&y.set(t.key,{f:t,v:n})}let b=y.get(`priority`)??[...y.values()].find(e=>e.f.kind===`rank`),x=y.get(`type`),S=y.get(`gate`),C=y.get(`severity`),w=y.get(`waits_for`),T=y.get(`blocked`),E=y.get(`tune_count`),D=[...y.values()].filter(({f:e})=>!vo.has(e.key)&&e.kind!==`rank`),O=yo(e,_),k=$a(e,c),A=e.plan,j=_i(e,l)&&!_&&!e.running,M=()=>t.openItem(e.id),N=l.sections.lessons?e.lessons??0:0,P=y.has(`needs`)?io(e):[],F=y.has(`needed_by`)?ao(e):[],I=`Not ended in history: ${P.map(e=>`${e} (${ro(c,e).state})`).join(`, `)}`,L=`They depend on it: ${F.join(`, `)}`,ee=oo(c,e,a.id),te=so(c,e),ne={onMouseEnter:()=>te&&a.set(e.id),onMouseLeave:()=>a.id===e.id&&a.set(null),onFocus:t=>{te&&t.target.matches(`:focus-visible`)&&a.set(e.id)},onBlur:t=>{a.id===e.id&&a.set(null),R&&!t.currentTarget.contains(t.relatedTarget)&&s.key(`Tab`)}},R=s.grab?.id===e.id&&s.grab.lane===o,z=!e.running&&!go.matches,B=e=>e.target===e.currentTarget||e.target.matches(`.c-open`),V=t=>R?bo.has(t.key)?(t.preventDefault(),t.stopPropagation(),s.key(t.key),!0):!1:t.key!==` `||!z||s.grab||!B(t)?!1:(t.preventDefault(),t.stopPropagation(),s.pick(e,o),!0),re=e=>{e.key===` `&&z&&B(e)&&e.preventDefault()},ie=t=>(0,G.jsxs)(G.Fragment,{children:[s.ghost===e.id&&s.grab?.lane===o&&(0,G.jsx)(xo,{text:s.ghostText,compact:n}),t,R&&(0,G.jsxs)(`div`,{className:`k-note`,role:`note`,children:[(0,G.jsx)(`span`,{className:`k-hint`,children:s.hint}),(0,G.jsx)(`div`,{className:`k-keys`,children:s.keys.map(([e,t])=>(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:e}),t]},e))})]})]}),H=z?` · Space picks it up to move it with the keys`:``,ae=[...y.values()].filter(({f:e})=>e.badge).map(({f:e,v:t})=>`${e.key}-${t}`),oe=[`card`,n?`compact`:``,...ae,m?`dragging`:``,r?`selected`:``,h.isOver&&!m?`drop-before`:``,ee.label||ee.self?`lit`:``,ee.dim?`dim`:``,R?`lifted`:``].join(` `);if(n)return ie((0,G.jsxs)(`div`,{ref:g,...d,...f,...ne,"aria-roledescription":`movable card`,"aria-pressed":R,className:oe,"data-card":e.id,title:`${e.id}${e.title?` — ${e.title}`:``}${H}`,onClick:()=>!s.grab&&M(),onKeyUp:re,onKeyDown:e=>{V(e)||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),M())},children:[(0,G.jsx)(`span`,{className:`c-rank`,children:b?.v??``}),(0,G.jsx)(`span`,{className:`c-id`,children:e.id}),ee.label&&(0,G.jsx)(`span`,{className:`c-rel`,children:ee.label}),P.length>0&&(0,G.jsxs)(`span`,{className:`c-note mono`,title:I,children:[`◂`,P.length]}),k?(0,G.jsx)(`span`,{className:`c-needs`,title:`Only you can move it on`,children:`●`}):O?(0,G.jsx)(`span`,{className:`c-mark tone-${O.tone}`,title:O.tip,children:O.label}):null]}));let{role:se,tabIndex:U,"aria-pressed":W,"aria-roledescription":ce,...le}=d;return ie((0,G.jsxs)(`div`,{ref:g,className:oe,"data-card":e.id,title:S?wi(S.f,S.v):void 0,...le,...f,...ne,onClick:e=>{!s.grab&&!e.target.closest(`button`)&&M()},onKeyDown:V,onKeyUp:re,children:[e.running&&e.running_kind!==`session`&&(0,G.jsx)(`span`,{className:`c-flow`,"aria-hidden":`true`}),ee.label&&(0,G.jsx)(`span`,{className:`c-rel`,children:ee.label}),(0,G.jsxs)(`div`,{className:`c-top`,children:[j&&(0,G.jsx)(`button`,{role:`checkbox`,"aria-checked":r,"aria-label":`Select ${e.id} for a run`,className:`c-box`,onClick:()=>i(!r),children:r?`☑`:`☐`}),(0,G.jsxs)(`button`,{className:`c-open`,onClick:()=>!s.grab&&M(),"aria-roledescription":z?`movable card`:void 0,"aria-pressed":z?R:void 0,title:H?`Open it${H}`:void 0,"aria-label":`Open ${e.id}${e.title?`: ${e.title}`:``}`,children:[x&&(0,G.jsx)(`span`,{className:`c-type`,title:wi(x.f,x.v)??x.v,children:x.v.slice(0,3).toUpperCase()}),k&&(0,G.jsx)(`span`,{className:`c-needs`,title:`Only you can move it on`,"aria-label":`needs you`,children:`●`}),(0,G.jsx)(`span`,{className:`c-id`,children:e.id})]}),T&&(0,G.jsx)(`span`,{className:`c-blocked`,role:`img`,tabIndex:0,title:`Blocked: ${T.v} · open the card to read it in Status`,"aria-label":`blocked: ${T.v}`,children:`!`}),b&&(0,G.jsx)(`span`,{className:`c-rank`,title:`Priority rank: lower runs sooner. Drag the card to change it.`,children:b.v})]}),e.title&&(0,G.jsx)(`div`,{className:`c-title`,children:e.title}),(O||e.verified||C)&&(0,G.jsxs)(`div`,{className:`c-marks`,children:[O&&(0,G.jsxs)(`span`,{className:`badge tone-${O.tone} ${e.starting?`badge-starting`:``}`,role:e.starting?`status`:void 0,title:O.tip,children:[e.starting&&(0,G.jsx)(`span`,{className:`badge-ring`,"aria-hidden":`true`}),O.label]}),e.verified&&(0,G.jsx)(`span`,{className:`badge tone-ok`,title:`Passed build, tests and review; merges into main at the start of the next run`,children:`✔ verified`}),C&&(0,G.jsxs)(`span`,{className:`c-sev sev-${C.v}`,title:`severity: ${C.v}`,children:[`▲ `,C.v]})]}),v&&(0,G.jsxs)(`div`,{className:`c-limit`,children:[(0,G.jsxs)(`span`,{title:`The run waits for the usage limit's reset, then goes on by itself; Go on now if you reset it early, Stop ends the wait`,children:[`◷ `,da(v,e.resume?.reserve)]}),(0,G.jsx)(ma,{ctx:t,of:{id:e.id}}),(0,G.jsx)(`button`,{className:`btn-danger`,title:`Ends the wait: the item becomes paused: limit; Run resumes it later`,onClick:()=>void Ja(t,e),children:`Stop`})]}),e.running&&e.running_kind!==`session`&&e.active_at&&!v&&(0,G.jsx)(Vi,{at:e.active_at}),w&&(0,G.jsxs)(`div`,{className:`c-waits`,title:w.f.help??`The run gate would refuse it now`,children:[`⧗ waits for `,(0,G.jsx)(Ce,{text:String(w.v),named:e.waits_for??[]})]}),(typeof e.skip_gates==`boolean`||e.gate_why)&&(0,G.jsxs)(`div`,{className:`c-gates`,children:[typeof e.skip_gates==`boolean`&&(0,G.jsxs)(`span`,{title:e.skip_gates?`Its own gates: each on its second value (milestone go, verdict defer, decision agent, question assume)`:`Its own gates: every one waits for you`,children:[(0,G.jsx)(`span`,{className:`dim`,"aria-hidden":`true`,children:`⇥`}),` `,e.skip_gates?`gates: skip`:`gates: wait`]}),e.gate_why&&(0,G.jsxs)(`span`,{className:`c-gate-why`,title:`Its own verdict stop: ${e.gate_why}`,children:[`verdict: `,e.gate_why]})]}),(0,G.jsxs)(`div`,{className:`c-foot`,children:[A&&(`error`in A?(0,G.jsx)(`span`,{className:`c-plan bad`,title:A.error,children:`plan ✘`}):(0,G.jsxs)(`span`,{className:`c-plan`,title:`Plan checkboxes done / total`,children:[(0,G.jsx)(`span`,{className:`bar`,"aria-hidden":`true`,children:(0,G.jsx)(`span`,{style:{width:`${Math.round(100*A.done/Math.max(1,A.tasks))}%`}})}),A.done,`/`,A.tasks]})),E&&(0,G.jsxs)(`span`,{className:`c-note`,title:E.f.help,children:[`· tuned `,E.v,`×`]}),N>0&&(0,G.jsxs)(`span`,{className:`c-note`,title:`What got in its agents' way: lessons in the inbox`,children:[`· `,N,` lesson`,N>1?`s`:``]}),D.map(({f:e,v:t})=>(0,G.jsxs)(`span`,{className:`c-note`,title:wi(e,t),children:[`· `,e.label,` `,t]},e.key)),P.length>0&&(0,G.jsxs)(`span`,{className:`c-dep`,title:I,children:[y.get(`needs`)?.f.label??`needs`,` `,P.length]}),F.length>0&&(0,G.jsxs)(`span`,{className:`c-dep`,title:L,children:[y.get(`needed_by`)?.f.label??`needed by`,` `,F.length]})]})]}))}function Co({status:e,label:t,help:n,count:r,shown:i,wip:a,take:o,end:s,children:c}){let{setNodeRef:l,isOver:u}=Fr({id:e,data:{status:e}});return(0,G.jsxs)(`section`,{ref:l,id:`col-${e}`,className:`column col-${e} ${u?`over`:``} ${o}`,"aria-label":`${t} column`,children:[(0,G.jsxs)(`div`,{className:`col-head`,title:n,tabIndex:0,children:[(0,G.jsx)(`span`,{className:`col-dot`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`col-label`,children:t}),(0,G.jsx)(`span`,{className:`col-count`,children:i===r?r:`${i} of ${r}`}),a]}),(0,G.jsxs)(`div`,{className:`col-body`,children:[r===0?(0,G.jsx)(`div`,{className:`col-empty`,children:e===`running`?`nothing runs`:`empty`}):i===0?(0,G.jsx)(`div`,{className:`col-empty`,children:`none match the filter`}):c,s]})]})}function wo({status:e,lane:t,label:n,take:r,children:i}){let{setNodeRef:a,isOver:o}=Fr({id:`${e}@${t}`,data:{status:e}});return(0,G.jsx)(`div`,{ref:a,className:`lane-cell ${o?`over`:``} ${r}`,"aria-label":n,children:i})}function To({label:e,hot:t}){let{setNodeRef:n,isOver:r}=Fr({id:`graveyard`,data:{status:`graveyard`}});return(0,G.jsxs)(`div`,{ref:n,className:`grave ${r?`over`:``} ${t?`k-target`:``}`,"aria-label":`Graveyard drop zone`,children:[(0,G.jsxs)(`span`,{children:[`✝ `,e]}),(0,G.jsx)(`small`,{children:`Drop here: opens the drop form. Nothing ends until you confirm it.`})]})}var Eo=`[data-card], button, input, select, textarea, a, label, [role="button"]`;function Do(){let e=(0,v.useRef)(void 0);return(0,v.useCallback)(t=>{e.current?.(),e.current=t?Oo(t):void 0},[])}function Oo(e){let t=null,n=!1,r=r=>{r.pointerType===`mouse`&&r.button===0&&(r.target.closest(Eo)||(t={x:r.clientX,left:e.scrollLeft,id:r.pointerId},n=!1))},i=r=>{if(!t)return;let i=r.clientX-t.x;if(!(!n&&Math.abs(i)<4)){if(!n){n=!0;try{e.setPointerCapture(t.id)}catch{}e.classList.add(`panning`)}e.scrollLeft=t.left-i}},a=()=>{t=null,e.classList.remove(`panning`)},o=e=>{n&&(n=!1,e.stopPropagation(),e.preventDefault())},s=t=>{if(t.shiftKey||Math.abs(t.deltaX)>Math.abs(t.deltaY)||e.scrollHeight>e.clientHeight+2)return;let n=t.target.closest(`.col-body`);n&&n.scrollHeight>n.clientHeight||e.scrollWidth<=e.clientWidth||(e.scrollLeft+=t.deltaY,t.preventDefault())};return e.addEventListener(`pointerdown`,r),e.addEventListener(`pointermove`,i),e.addEventListener(`pointerup`,a),e.addEventListener(`pointercancel`,a),e.addEventListener(`click`,o,!0),e.addEventListener(`wheel`,s,{passive:!1}),()=>{e.removeEventListener(`pointerdown`,r),e.removeEventListener(`pointermove`,i),e.removeEventListener(`pointerup`,a),e.removeEventListener(`pointercancel`,a),e.removeEventListener(`click`,o,!0),e.removeEventListener(`wheel`,s)}}var ko=e=>e.ctrlKey||e.metaKey||e.altKey||e.defaultPrevented||!!document.querySelector(`.modal`)||!!e.target?.closest?.(`input, textarea, select, [contenteditable]`);function Ao(){let e=[...document.querySelectorAll(`.board [data-card]`)];return{all:e,at:e.findIndex(e=>e.contains(document.activeElement))}}var jo=e=>{e&&((e.querySelector(`.c-open`)??e).focus(),e.scrollIntoView({block:`nearest`,inline:`nearest`}))};function Mo({ctx:e}){let[t,n]=(0,v.useState)(new Set),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)({}),[s,c]=(0,v.useState)(`none`),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)(null),[b,x]=(0,v.useState)(null),S=(0,v.useRef)(null),C=Do(),w=Mt(jt(An,{activationConstraint:{distance:8}}),jt(Fn,{activationConstraint:{delay:300,tolerance:8}})),{board:T}=e,E=T.items,{domain:D}=T,O=D.runs_from,k=D.columns.flatMap(e=>e.status===O?[e,_o]:[e]),A=T.runs?.queued??[],j=[...t].filter(e=>!A.includes(e)&&E.some(t=>t.id===e&&_i(t,D)&&!t.running)),M=E.filter(e=>ji(e)===O).map(e=>e.id),N=D.fields.filter(e=>e.filter),P=D.fields.filter(e=>e.group),F=P.find(e=>e.key===s),I=Object.values(a).reduce((e,t)=>e+t.length,0),L=e=>uo(e,r)&&lo(e,N,a)&&(!d||$a(e,T)),ee=!!(r.trim()||I||d),te=E.filter(e=>$a(e,T)).length,ne=D.sections.playtest?.waits[0],R={id:_||b?null:h,set:g};(0,v.useEffect)(()=>{h&&!E.some(e=>e.id===h)&&g(null)},[h,E]);let z=b?E.find(e=>e.id===b.id):void 0,B=F?ho(T,E,F).map(e=>({...e,shown:e.items.filter(L)})).filter(e=>!ee||e.shown.length):[],V=(e,t)=>{let n=F?B.find(e=>e.value===t)?.items??[]:E,r=new Set(n.filter(t=>t.id===e||L(t)).map(e=>e.id));return M.filter(e=>r.has(e))},re=b?V(b.id,b.lane):[],ie=z&&(F?B.some(e=>e.value===b?.lane&&e.items.some(e=>e.id===z.id)):b?.lane===void 0);(0,v.useEffect)(()=>{b&&!ie&&x(null)},[b,ie]);let H=Object.fromEntries(k.map(e=>[e.status,e.label])),ae=z?Fi(z,D,k.map(e=>e.status)):[],oe=b&&z?Ri(b,z,D,re,H):null;(0,v.useEffect)(()=>{b&&(document.getElementById(`col-${b.target}`)?.scrollIntoView({block:`nearest`,inline:`nearest`}),document.querySelector(`.board .k-ghost`)?.scrollIntoView({block:`nearest`}))},[b]),(0,v.useEffect)(()=>{let e=()=>{S.current=null};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[]),(0,v.useEffect)(()=>{let e=S.current;if(!e)return;let t=document.querySelector(`.board [data-card="${CSS.escape(e.id)}"]`),n=document.activeElement;Date.now()>e.until||n&&n!==document.body&&!t?.contains(n)?S.current=null:t&&!t.contains(n)&&jo(t)}),(0,v.useEffect)(()=>{let e=e=>{if(ko(e))return;let{all:t,at:n}=Ao();if(e.key===`j`||e.key===`k`)e.preventDefault(),jo(t[n<0?0:Math.max(0,Math.min(t.length-1,n+(e.key===`j`?1:-1)))]);else if(/^[1-9]$/.test(e.key)){let t=document.querySelectorAll(`.board .column, .board .lane-head-col`)[Number(e.key)-1];if(!t)return;e.preventDefault(),t.scrollIntoView({inline:`start`,block:`nearest`,behavior:`smooth`});let n=t.querySelector(`[data-card]`);n?jo(n):t.querySelector(`.col-head`)?.focus()}else if(e.key===`r`&&n>=0){let r=E.find(e=>e.id===t[n].dataset.card);if(!r||!_i(r,D)||r.running||A.includes(r.id))return;e.preventDefault(),ce(r.id,!0)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)});let se=fi(D,D.rank),U=(t,n)=>{let r=Ai(M,t,n);r&&se&&e.move({cmd:se.cmd,ids:r})},W=e=>{y(null);let t=e.active.data.current?.id??String(e.active.id),n=E.find(e=>e.id===t),r=e.over;if(!n||!r)return;if(String(r.id).startsWith(`before:`)){let e=r.data.current?.id;if(ji(n)===O)return U(n.id,e)}let i=String(r.id).startsWith(`before:`)?O:r.data.current?.status??String(r.id);le(n,i,F?String(r.id).split(`@`)[1]:void 0)},ce=async(t,n)=>{let r=await Ua(e,[t]);r&&(n&&(S.current={id:t,until:Date.now()+1e4}),await e.run(r.ids,!1,r.agent))},le=(t,n,r,i=!1)=>{let a=Mi(t,n,D);if(a?.act===`rank`)return U(t.id,Ni(M,V(t.id,r),t.id,null));if(a?.act===`run`)return void ce(t.id,i);a?e.openMove({title:`${a.move.label} ${t.id}`,id:t.id,move:a.move}):n!==ji(t)&&e.notify(`no move takes ${t.id} to ${n}: open it for its moves`,`error`)},ue={grab:b,ghost:oe&&!oe.same?oe.before:null,ghostText:oe?`drops here · ${oe.act}`:``,hint:oe?`→ ${oe.where} · ${oe.act}`:``,keys:[[`← →`,`column`],...b?.from===O&&se?[[`↑ ↓`,`rank`]]:[],[`Space`,`drop`],[`Esc`,`put back`]],pick:(e,t)=>{g(null),x({...Ii(e,V(e.id,t)),...F&&{lane:t}})},key:t=>{if(!b||!z||!oe)return x(null);if(t===`Escape`||t===`Tab`)return x(null),e.notify(`${b.id}: put back, nothing moved`);if(t!==`ArrowUp`&&t!==`ArrowDown`||se){if(t!==` `&&t!==`Enter`)return x(Li(b,t,ae,re,O));if(x(null),S.current={id:b.id,until:Date.now()+1e4},!oe.same){if(oe.ranking)return U(b.id,Ni(M,re,b.id,oe.before));le(z,b.target,void 0,!0)}}}},de=oe?.ranking&&!oe.same&&!oe.before&&(0,G.jsx)(xo,{text:ue.ghostText,compact:l}),fe=e=>{let t=me??z;return t?b?.target===e?`k-target`:b&&e===b.from||Mi(t,e,D)?`takes`:`no-drop`:``},pe=async()=>{await Wa(e,j)&&n(new Set)},me=_?E.find(e=>e.id===_):void 0,he=(r,i)=>(0,G.jsx)(So,{item:r,ctx:e,compact:l,hover:R,lane:i,kb:ue,selected:t.has(r.id),onSelect:e=>n(t=>{let n=new Set(t);return e?n.add(r.id):n.delete(r.id),n})},r.id),ge=e=>e===ne&&D.sections.wip&&T.wip&&(0,G.jsxs)(`span`,{className:`col-wip ${T.wip.over?`over`:``}`,title:D.sections.wip.help,children:[`WIP `,T.wip.count,`/`,T.wip.limit,T.wip.over?` · over`:``]});return(0,G.jsxs)(Dr,{sensors:w,onDragStart:e=>{g(null),x(null),y(e.active.data.current?.id??String(e.active.id))},onDragCancel:()=>y(null),onDragEnd:W,children:[(0,G.jsxs)(`section`,{className:`board`,"aria-label":`Board`,children:[(0,G.jsxs)(`div`,{className:`board-tools ${e.boardTools?``:`shut`}`,children:[(0,G.jsxs)(`div`,{className:`board-row`,children:[(0,G.jsx)(`input`,{className:`input board-search`,type:`search`,"data-search":!0,"aria-label":`Search items by id and title`,value:r,onChange:e=>i(e.target.value),placeholder:`search id or title`}),(0,G.jsxs)(`button`,{className:`pill pill-needs ${d?`on`:``}`,"aria-pressed":d,onClick:()=>f(!d),children:[d?`✓ `:``,`waiting for me · `,te]}),N.length>0&&(0,G.jsxs)(`button`,{className:`btn-line board-filter ${I?`on`:``}`,"aria-expanded":p,title:`Filter by the fields the domain marks: several at once`,onClick:()=>m(!p),children:[`Filter`,I?` · ${I}`:``,` `,p?`▴`:`▾`]}),P.length>0&&(0,G.jsxs)(`label`,{className:`board-group`,children:[`Group by`,(0,G.jsxs)(`select`,{className:`input`,"aria-label":`Group the board in lanes by`,value:F?F.key:`none`,onChange:e=>c(e.target.value),children:[(0,G.jsx)(`option`,{value:`none`,children:`none`}),P.map(e=>(0,G.jsx)(`option`,{value:e.key,children:e.label},e.key))]})]}),(0,G.jsxs)(`button`,{className:`btn-line board-density`,title:`Card density`,onClick:()=>u(!l),children:[`▤ `,l?`compact`:`comfortable`]}),D.harness&&(0,G.jsxs)(`div`,{className:`board-run`,children:[j.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{className:`btn-accent`,onClick:()=>void pe(),children:[`▶ Run selected (`,j.length,`)`]}),(0,G.jsx)(`button`,{className:`icon-btn bordered`,"aria-label":`Clear selection`,onClick:()=>n(new Set),children:`×`})]}),(0,G.jsx)(`div`,{className:`run-next-accent`,children:(0,G.jsx)(qa,{ctx:e})})]})]}),p&&N.length>0&&(0,G.jsx)(`div`,{className:`board-filters`,role:`group`,"aria-label":`Filters`,children:N.map(e=>(0,G.jsxs)(`div`,{role:`group`,"aria-label":e.label,title:e.help,children:[(0,G.jsx)(`span`,{className:`bf-label`,children:e.label}),(0,G.jsx)(`div`,{className:`bf-values`,children:po(E,e,a).map(t=>(0,G.jsxs)(`button`,{className:`bf-chip`,"aria-pressed":t.on,onClick:()=>o(mo(a,e.key,t.value)),children:[t.on?`✓ `:``,t.label,` `,(0,G.jsx)(`span`,{className:`dim`,children:t.count})]},t.value))})]},e.key))}),I>0&&(0,G.jsxs)(`div`,{className:`board-chips`,children:[N.flatMap(e=>(a[e.key]??[]).map(t=>(0,G.jsxs)(`span`,{className:`bf-picked`,children:[e.label,`: `,fo(e,t),(0,G.jsx)(`button`,{"aria-label":`Remove the filter ${e.label}: ${fo(e,t)}`,onClick:()=>o(mo(a,e.key,t)),children:`×`})]},`${e.key}:${t}`))),(0,G.jsx)(`button`,{className:`link-btn small`,onClick:()=>{o({}),i(``),f(!1)},children:`clear all`})]}),!N.length&&!P.length&&(0,G.jsx)(`span`,{role:`note`,className:`dim small`,children:`The domain marks no field for filters or lanes: search and “waiting for me” only.`})]}),!F&&(0,G.jsx)(`nav`,{className:`col-jump`,"aria-label":`Columns`,children:k.map(e=>(0,G.jsxs)(`button`,{className:`col-${e.status}`,onClick:()=>document.getElementById(`col-${e.status}`)?.scrollIntoView({inline:`start`,behavior:`smooth`}),children:[e.label,` · `,E.filter(t=>ji(t)===e.status).length]},e.status))}),F?(0,G.jsxs)(`div`,{className:`lanes`,ref:C,style:{"--cols":k.length},children:[(0,G.jsx)(`div`,{className:`lane-heads`,children:k.map(({status:e,label:t,help:n})=>(0,G.jsxs)(`div`,{className:`lane-head-col col-${e}`,title:n,children:[(0,G.jsx)(`span`,{className:`col-dot`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`col-label`,children:t}),(0,G.jsx)(`span`,{className:`col-count`,children:E.filter(t=>ji(t)===e).length}),ge(e)]},e))}),!B.length&&(0,G.jsx)(`p`,{className:`dim lanes-none`,children:`No item matches the search and filters.`}),B.map(t=>(0,G.jsxs)(`section`,{className:`lane`,"aria-label":`Lane ${t.label}`,children:[(0,G.jsxs)(`div`,{className:`lane-head`,title:t.value?`${F.label}: ${t.value}`:`Items with no ${F.label}`,children:[(0,G.jsx)(`h3`,{className:t.value?``:`dim`,children:t.label}),t.sub&&(0,G.jsx)(`span`,{className:`mono dim`,children:t.sub}),(0,G.jsx)(`span`,{className:`mono dim`,children:t.shown.length===t.items.length?t.items.length:`${t.shown.length} of ${t.items.length}`}),t.item&&(0,G.jsxs)(`button`,{className:`link-btn small`,onClick:()=>e.openItem(t.item??``),children:[`open `,t.item]})]}),(0,G.jsx)(`div`,{className:`lane-row`,children:k.map(({status:e,label:n})=>(0,G.jsxs)(wo,{status:e,lane:t.value,label:`${t.label} · ${n}`,take:fe(e),children:[t.shown.filter(t=>ji(t)===e).map(e=>he(e,t.value)),e===O&&t.value===b?.lane&&de]},e))})]},t.value||`(none)`))]}):(0,G.jsx)(`div`,{className:`columns`,ref:C,children:k.map(({status:e,label:t,help:n})=>{let r=E.filter(t=>ji(t)===e),i=r.filter(L);return(0,G.jsx)(Co,{status:e,label:t,help:n,count:r.length,shown:i.length,wip:ge(e),take:fe(e),end:e===O&&de,children:i.map(e=>he(e))},e)})}),(0,G.jsx)(`div`,{className:`k-say`,role:`status`,"aria-live":`assertive`,children:oe?.say??``}),(_||b)&&(0,G.jsxs)(`div`,{className:`drag-help`,children:[(0,G.jsx)(`p`,{role:`status`,children:b?`Moving with the keys: ← → picks the column, ↑ ↓ the rank among ready cards, Space drops it, Esc puts it back. The column you can drop in is outlined; a dimmed one takes no move from here.`:`Drop on a ready card to rank it before that card · on running to run it (it asks first) · onto the column a move names to open that move. Verdicts and decisions are buttons only.`}),D.sections.graveyard&&(_||ae.includes(`graveyard`))&&(0,G.jsx)(To,{label:D.sections.graveyard.label??`Graveyard`,hot:b?.target===`graveyard`})]})]}),(0,G.jsx)(qr,{dropAnimation:null,children:me&&(0,G.jsxs)(`div`,{className:`card overlay ${l?`compact`:``} gate-${me.gate}`,children:[(0,G.jsx)(`span`,{className:`c-id`,children:me.id}),!l&&me.title&&(0,G.jsx)(`div`,{className:`c-title`,children:me.title})]})})]})}function No(e){return(0,G.jsxs)(`button`,{type:`button`,className:`tile ${e.needs?`needs`:e.accent?`accent`:``} ${e.on?`on`:e.picked?`picked`:``}`,"data-tile-key":e.dataKey,title:e.tip??`Open: the full text and its moves`,onClick:e.onOpen,children:[(0,G.jsxs)(`span`,{className:`tile-head`,children:[(0,G.jsx)(`span`,{className:`tile-cat tone-${e.tone??`neutral`}`,title:e.catTip,children:e.cat}),e.origin&&(0,G.jsx)(`span`,{className:`tile-origin`,children:e.origin}),e.age&&(0,G.jsx)(`span`,{className:`tile-age`,title:e.ageTip,children:e.age})]}),(0,G.jsx)(`span`,{className:`tile-title`,children:e.title}),(0,G.jsxs)(`span`,{className:`tile-foot`,children:[(0,G.jsx)(`span`,{className:`tile-sub`,children:e.sub}),e.mark&&(0,G.jsx)(`span`,{className:`tile-mark mark-${e.markTone??`quiet`}`,children:e.mark})]})]})}function Po({label:e,tip:t,onClick:n,disabled:r}){return(0,G.jsx)(`button`,{type:`button`,className:`trash-btn`,"aria-label":e,title:t??e,onClick:n,disabled:r,children:(0,G.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M3 6h18`}),(0,G.jsx)(`path`,{d:`M8 6V4h8v2`}),(0,G.jsx)(`path`,{d:`M19 6l-1 14H6L5 6`}),(0,G.jsx)(`path`,{d:`M10 11v6`}),(0,G.jsx)(`path`,{d:`M14 11v6`})]})})}function Fo({children:e}){return(0,G.jsx)(`div`,{className:`tiles`,children:e})}var Io=e=>`${e} commit${e===1?``:`s`}`,q={run:`run`,thread:`chat`,session:`agent`,operator:`you`};function Lo(e,{running:t=!1,branches:n=0,canPull:r=!1}={}){let i={push:null,pull:!1,off:t?`Off while a run writes in main: its commits are half a card`:null,note:n?`${n===1?`1 run's`:`${n} runs'`} work is on their own branches: Push sends ${e.name} only`:null};if(!e.remotes.length)return{...i,tone:`none`,line:`No remote to push to. Add one from a terminal: git remote add origin <url>`};if(!e.target)return{...i,tone:`none`,line:`${e.name} has no upstream and there is no origin: push it once from a terminal, or ai-factory gcf changes push --remote <one of ${e.remotes.join(`, `)}>`};let a=e.upstream?`Push`:`Push to ${e.target.split(`/`)[0]}`,o=r&&e.behind>0;return e.ahead&&e.behind?{...i,push:a,pull:o,tone:`both`,line:`↑${e.ahead} ↓${e.behind} · ${e.target} moved on: Push will likely be refused`}:e.ahead?{...i,push:a,tone:`ahead`,line:`↑ ${Io(e.ahead)} to push to ${e.target}`}:e.behind?{...i,pull:o,tone:`behind`,line:`↓ ${e.behind} on ${e.target} not here, as of the last fetch`}:{...i,tone:`clean`,line:e.upstream?`✓ Pushed · ${e.upstream}`:`Nothing to push to ${e.target}`}}function Ro(e,t){let n=e?.code;return{pull:t&&n===`behind`,agent:n===`behind`||n===`diverged`}}var zo=e=>{let[t,...n]=(e.target??`origin/${e.name}`).split(`/`);return[`Bring ${e.target??t} into ${e.name}: Push was refused, the remote has commits ${e.name} lacks.`,`Run git pull --no-rebase ${t} ${n.join(`/`)}: never rebase, never force.`,`Resolve any conflicts, check that the build and the tests pass, then tell me what came in.`,`Push only when I say so.`].join(`
32
- `)},Bo={command:[`M12 4a8 8 0 1 0 0 16a8 8 0 1 0 0-16z`,`M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6z`],board:[`M4 5h4v14H4z`,`M10 5h4v9h-4z`,`M16 5h4v6h-4z`],chat:[`M4 5h16v11H10l-5 4v-4H4z`],inbox:[`M4 13l2.2-8h11.6L20 13`,`M4 13v6h16v-6h-5a3 3 0 0 1-6 0z`],design:[`M4 20l1-4.5L15.5 5l3.5 3.5L8.5 19z`,`M13.5 7l3.5 3.5`],runs:[`M12 4a8 8 0 1 0 0 16a8 8 0 1 0 0-16z`,`M10.2 8.6v6.8l5.6-3.4z`],playtest:[`M7.5 8h9a4.5 4.5 0 0 1 4.5 4.5v.5a3 3 0 0 1-5.5 1.7L14.4 13H9.6l-1.1 1.7A3 3 0 0 1 3 13v-.5A4.5 4.5 0 0 1 7.5 8z`,`M8 10v3`,`M6.5 11.5h3`,`M16 10.5h.01`,`M17.5 12h.01`],ended:[`M4 5h16v4H4z`,`M5.5 9v10h13V9`,`M10 13h4`],agent:[`M12 3.5l7 3v5c0 4.3-2.9 7.6-7 9c-4.1-1.4-7-4.7-7-9v-5z`,`M9.5 12l2 2 3.5-4`],metrics:[`M5 19v-6`,`M10 19V6`,`M15 19v-9`,`M20 19V4`],changes:[`M7 3.5h7l4 4v13H7z`,`M14 3.5v4h4`,`M10 12h5`,`M12.5 9.5v5`,`M10 17h5`]},Vo={command:`c`,board:`b`,chat:`t`,inbox:`i`,design:`d`,runs:`r`,changes:`x`,playtest:`p`,ended:`e`,agent:`a`,metrics:`m`},Ho={command:e=>`${e} wait for you`,chat:e=>`${e} ${e===1?`thread waits`:`threads wait`} for your answer`,inbox:e=>`Needs you: ${e}`},Uo=0;function Wo(e,t,n,r){if(e.ctrlKey||e.metaKey||e.altKey)return!1;if(Uo&&Date.now()-Uo<1200){if(Uo=0,e.key===`s`)return r(),!0;let i=t.find(t=>Vo[t]===e.key);return i&&n(i),!!i}return e.key===`g`&&(Uo=Date.now()),!1}function Go(){let[e,t]=(0,v.useState)(()=>new Date);return(0,v.useEffect)(()=>{let e=setInterval(()=>t(new Date),15e3);return()=>clearInterval(e)},[]),e.toTimeString().slice(0,5)}function Ko({entries:e,screen:t,go:n}){Go();let[r,i]=(0,v.useState)(null),a=()=>i(null);return(0,G.jsxs)(`nav`,{className:`side`,"aria-label":`Screens`,children:[e.map(e=>{let r=e.screen===t,o=e.count>0?Ho[e.screen]?.(e.count)??``:``,s=Vo[e.screen]?`g ${Vo[e.screen]}`:``,c=t=>{let n=t.currentTarget.getBoundingClientRect();i({label:e.label,keys:s,note:o,top:Math.round(n.top+n.height/2)})};return(0,G.jsxs)(`button`,{className:`rail-btn`,"aria-current":r?`page`:void 0,"aria-label":`${e.label}${o?`, ${o}`:``}${s?`, keys ${s}`:``}`,onClick:()=>n(e.screen),onMouseEnter:c,onMouseLeave:a,onFocus:c,onBlur:a,children:[(0,G.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(Bo[e.screen]??[`M12 12h.01`]).map(e=>(0,G.jsx)(`path`,{d:e},e))}),e.count>0&&(0,G.jsx)(`span`,{className:`rail-count ${e.needs?`needs`:``}`,"aria-hidden":`true`,children:e.count>99?`99+`:e.count})]},e.screen)}),r&&(0,G.jsxs)(`div`,{className:`rail-tip`,role:`tooltip`,style:{top:r.top},children:[(0,G.jsxs)(`span`,{className:`rail-tip-head`,children:[(0,G.jsx)(`span`,{className:`rail-tip-label`,children:r.label}),r.keys&&(0,G.jsx)(`kbd`,{children:r.keys})]}),r.note&&(0,G.jsx)(`span`,{className:`rail-tip-note`,children:r.note})]})]})}function qo({entries:e,screen:t,go:n}){let r=[`command`,`board`,`chat`,`inbox`],i=[...e.filter(e=>r.includes(e.screen)),{screen:`more`,label:`More`,count:0}],a=!r.includes(t);return(0,G.jsx)(`nav`,{className:`phone-nav`,"aria-label":`Screens`,children:i.map(e=>(0,G.jsxs)(`button`,{"aria-current":e.screen===t||e.screen===`more`&&a?`page`:void 0,onClick:()=>n(e.screen),children:[(0,G.jsx)(`span`,{className:`count ${e.count?e.needs?`needs`:``:`none`}`,children:e.count||`·`}),e.label]},e.screen))})}var Jo=6e5,Yo=e=>e.kind===`session`?`5h`:e.kind===`weekly_all`?`week`:`${e.scope?.model?.display_name??e.kind}${e.group===`weekly`?` week`:``}`,Xo=e=>e.kind===`session`?`5-hour window`:e.kind===`weekly_all`?`week, all models`:`${e.group===`weekly`?`week, `:``}${e.scope?.model?.display_name??e.kind}`,Zo=e=>e.resets_at?Date.parse(e.resets_at):NaN,Qo=(e,t)=>{let n=new Date(e);return n.toDateString()===new Date(t).toDateString()?ra(e):n.getTime()-t<5184e5?`${n.toLocaleDateString(void 0,{weekday:`short`})} ${ra(e)}`:aa(e,new Date(t))};function $o(e,t,n=Date.now()){let r=rs(t,n),i=e?.failed?[`The board's last /usage ask failed: ${e.failed.error}`]:[];if(!e?.at||!e.limits.length)return{...r,title:[r.title,...i].join(`
33
- `)};let a=e.limits.filter(e=>e.kind===`session`||e.kind===`weekly_all`||e.severity===`critical`),o=a.length?a:e.limits.slice(0,2),s=e=>!(Zo(e)<=n),c=e=>s(e)?`${Yo(e)} ${Math.round(e.percent)}%${e.resets_at&&!Number.isNaN(Zo(e))?` · ${Qo(e.resets_at,n)}`:``}`:`${Yo(e)} ?`,l=n-Date.parse(e.at)>Jo||!!e.failed,u=o.map(e=>{let t=Math.max(0,Math.min(100,Math.round(e.percent))),r=e.resets_at&&!Number.isNaN(Zo(e))?Qo(e.resets_at,n):``;return s(e)?{name:Yo(e),pct:`${t}%`,used:t,reset:r,warn:e.severity===`critical`||t>=100}:{name:Yo(e),pct:`?`,used:0,reset:``,warn:!1}}),d=!!r.rejected||e.limits.some(e=>s(e)&&(e.severity===`critical`||e.percent>=100)),f=e.limits.map(e=>`${Xo(e)}: ${Math.round(e.percent)}% used, resets ${e.resets_at&&!Number.isNaN(Zo(e))?na(e.resets_at):`?`}${s(e)?e.severity===`critical`?` (critical)`:``:` (reset since the reading)`}`);return{text:`${o.map(c).join(` | `)}${l?` · old`:``}`,title:[...f,`read ${na(e.at)}`,...i,`Click to read it now`].join(`
34
- `),rejected:d,segs:u,old:l}}var es=`No reading yet: a run records the usage limit when Claude reports it, which it does near a limit`,ts=e=>`${Math.min(100,Math.max(0,Math.round((1-(e.utilization??0))*100)))}% left`,ns=e=>{let t=new Date(typeof e.resetsAt==`number`?e.resetsAt*1e3:NaN);return Number.isNaN(t.getTime())?null:t.toISOString()};function rs(e,t=Date.now()){if(!e)return{text:`quota ?`,title:es};let{unifiedWindows:n,status:r,utilization:i,resetsAt:a}=e.info,o=Object.entries(n??{limit:{utilization:i??(r===`rejected`?1:void 0),resetsAt:a}}).filter(([,e])=>typeof e?.utilization==`number`);if(!o.length)return{text:`quota ?`,title:`The last reading names no share (read ${na(e.at)})`};let s=o.filter(([,e])=>typeof e.resetsAt!=`number`||e.resetsAt*1e3>t).sort(([,e],[,t])=>(t.utilization??0)-(e.utilization??0)),c=`read ${na(e.at)}`;if(!s.length)return{text:`quota ?`,title:`The last reading has reset since (${c}): ${es}`};let[,l]=s[0],u=s.map(([e,t])=>{let n=ns(t);return`${e}: ${ts(t)}, resets ${n?na(n):`?`}`}),d=ns(l),f=d?Date.parse(d)-t<864e5?ra(d):na(d):`?`,p=r===`rejected`&&(typeof a!=`number`||a*1e3>t),m=p?[`The limit is reached: runs wait for the reset by themselves`]:[];return{text:`quota ${ts(l)} · resets ${f}`,title:[...u,c,...m].join(`
35
- `),rejected:p}}function is(e,t=Date.now()){let n=e?.info.resetsAt;return e?.info.status!==`rejected`||typeof n!=`number`||n*1e3<=t?null:new Date(n*1e3).toISOString()}var as=e=>e===!0?`✔`:e===!1?`✘`:`?`,os=e=>e===!0?`met`:e===!1?`unmet`:`you judge`;function ss(e,t){(0,v.useEffect)(()=>{if(!e)return;let n=e=>e.key===`Escape`&&!e.defaultPrevented&&t();return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t])}function cs({project:e,projects:t}){let[n,r]=(0,v.useState)(!1);return ss(n,()=>r(!1)),(0,G.jsxs)(`div`,{className:`top-switch`,children:[(0,G.jsxs)(`button`,{className:`switch`,onClick:()=>r(!n),"aria-expanded":n,"aria-haspopup":`menu`,title:`Switch project · ${e.path}`,children:[(0,G.jsx)(`span`,{className:`switch-mark`,"aria-hidden":`true`,children:e.name.slice(0,2)}),(0,G.jsx)(`span`,{className:`switch-name`,children:e.name}),(0,G.jsx)(`span`,{className:`switch-caret`,"aria-hidden":`true`,children:`▾`})]}),n&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`menu-scrim`,onClick:()=>r(!1)}),(0,G.jsxs)(`div`,{className:`menu switch-menu`,role:`menu`,"aria-label":`Projects`,children:[t.list.map(n=>(0,G.jsxs)(`div`,{className:`switch-row`,children:[(0,G.jsxs)(`button`,{role:`menuitem`,className:`switch-pick`,onClick:()=>{r(!1),t.choose(n.name)},children:[(0,G.jsxs)(`span`,{className:`switch-pick-name`,children:[n.name===e.name?`● `:``,n.name]}),(0,G.jsx)(`span`,{className:`switch-path`,children:n.path})]}),(0,G.jsx)(Po,{label:`Take the project off the board`,tip:`Take it off the board; its files stay`,onClick:()=>{r(!1),t.remove(n)}})]},n.name)),(0,G.jsx)(`button`,{role:`menuitem`,className:`switch-add`,onClick:()=>{r(!1),t.add()},children:`+ Add a project…`})]})]})]})}function ls({ctx:e}){let[t,n]=(0,v.useState)(!1);ss(t,()=>n(!1));let{board:r}=e,i=r.domain.sections,a=!r.phase||`error`in r.phase?null:r.phase;if(!a){let e=r.phase&&r.phase.error;return e?(0,G.jsxs)(`span`,{role:`alert`,tabIndex:0,className:`h-chip h-chip-error`,title:`phase: ${e}`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`✘`}),(0,G.jsxs)(`span`,{className:`h-chip-cut`,children:[`phase: `,e]})]}):null}let o=fi(r.domain,i.phase?.next),s=`${a.criteria.filter(e=>e.met===!0).length} of ${a.criteria.length} criteria met`;return(0,G.jsxs)(`div`,{className:`h-phase`,children:[(0,G.jsxs)(`button`,{className:`h-chip h-phase-btn ${t?`on`:``}`,"aria-expanded":t,"aria-haspopup":`dialog`,title:`Phase ${a.phase} · ${s} · its criteria and next phase`,onClick:()=>n(!t),children:[(0,G.jsx)(`span`,{className:`h-phase-name`,children:a.phase}),(0,G.jsx)(`span`,{className:`h-marks`,"aria-hidden":`true`,children:a.criteria.map(e=>(0,G.jsx)(`span`,{className:`met-${String(e.met)}`,children:as(e.met)},e.name))}),(0,G.jsxs)(`span`,{className:`h-crit-sum`,children:[`· `,s]}),(0,G.jsx)(`span`,{className:`h-caret`,"aria-hidden":`true`,children:`▾`})]}),t&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`menu-scrim`,onClick:()=>n(!1)}),(0,G.jsxs)(`div`,{className:`menu h-phase-menu`,role:`dialog`,"aria-label":`Phase ${a.phase}`,children:[(0,G.jsxs)(`span`,{className:`h-menu-head`,children:[`Phase `,a.phase,` · exit criteria`]}),a.criteria.map(e=>(0,G.jsxs)(`div`,{className:`h-crit met-${String(e.met)}`,children:[(0,G.jsx)(`b`,{"aria-hidden":`true`,children:as(e.met)}),(0,G.jsxs)(`span`,{className:`h-crit-name`,children:[e.name,` `,(0,G.jsxs)(`span`,{className:`h-crit-state`,children:[`· `,os(e.met)]})]}),(0,G.jsx)(`span`,{}),(0,G.jsx)(`span`,{className:`h-crit-tip`,children:e.detail})]},e.name)),a.next&&o&&(0,G.jsxs)(`button`,{className:`btn-line`,title:o.help??`Opens the phase form`,onClick:()=>{n(!1),o&&e.openMove({title:`Phase ${a.phase} → ${a.next}`,move:{...o,fields:o.fields.map(e=>e.excuses===`phase`?{...e,required:!a.ready}:e)}})},children:[`next phase → `,a.next]})]})]})]})}function us({ctx:e}){let{board:t}=e,n=t.runs?.autopilot;if(!n)return null;let r=n.stop,i=n.on?r?.kind===`play`?`play`:r?`warn`:`run`:`off`,a=r?r.text:n.on?`taking ${t.build_milestone??`the next milestone`}: it runs the next item itself`:`nothing starts by itself`,o=n.on&&r?.kind===`dirty`&&t.domain.sections.changes,s=(0,G.jsxs)(`button`,{className:`h-chip h-ap ap-${i}`,"aria-pressed":n.on,title:(n.on?`The autopilot starts the runs by itself and stops when a milestone is built for you to play. An agent never starts a run.`:`The autopilot is off: runs start when you run them.`)+(r?`\n\nNow: ${r.text}`:``)+(o?`
36
-
37
- Click: Changes, to commit the loose work.`:`\n\nClick to turn it ${n.on?`off`:`on`}; kept in queue.json.`),onClick:()=>o?e.go(`changes`):void e.setAutopilot(!n.on),children:[(0,G.jsxs)(`span`,{className:`h-ap-label`,children:[(0,G.jsx)(`span`,{className:`h-ap-mark`,"aria-hidden":`true`,children:n.on?`⟳`:`○`}),n.on?`autopilot`:`autopilot off`]}),(0,G.jsx)(`span`,{className:`h-ap-why`,children:a})]});return o?(0,G.jsxs)(`span`,{className:`h-ap-split`,children:[s,(0,G.jsx)(`button`,{className:`h-chip h-ap-off ap-${i}`,"aria-label":`Turn the autopilot off`,title:`Turn the autopilot off: nothing starts by itself over the loose work`,onClick:()=>void e.setAutopilot(!1),children:`off`})]}):s}function ds({ctx:e}){let{board:t}=e;if(!t.domain.harness||!t.runs)return null;let n=t.runs.paused_by===`hold`,r=t.runs.active.length;return(0,G.jsx)(`button`,{className:`h-chip h-hold ${n?`ap-warn`:`ap-off`}`,"aria-pressed":n,title:n?`Held: nothing queued or piloted starts${r?`; ${r} run(s) still handing over`:``}. Your own Run still goes. Click to release: the queue goes on, the autopilot stays off.`:`Hold the project: its sessions hand over at their next step, the queue and the autopilot stop; their work waits, ready.`,onClick:()=>void e.holdProject(!n),children:n?`held${r?` · ${r} stopping`:``} · release`:`hold`})}function fs({ctx:e}){let{board:t}=e,n=t.milestones??[];if(t.build_milestone===void 0||!n.length)return null;let r=e=>n.find(t=>t.name===e)?.goal??``,i=t.build_milestone,a=t.play_milestone;return(0,G.jsxs)(`button`,{className:`h-chip h-ms`,title:[i?`building ${i}: ${r(i)}`:`every milestone is built`,a?`play ${a}: ${r(a)} · Playtest has it`:``].filter(Boolean).join(`
38
- `)||`The milestones of game.md`,onClick:()=>e.go(`playtest`),children:[(0,G.jsx)(`span`,{children:i?(0,G.jsxs)(G.Fragment,{children:[`building `,(0,G.jsx)(`span`,{className:`mono strong`,children:i})]}):`all built`}),a&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`dim`,"aria-hidden":`true`,children:`·`}),(0,G.jsxs)(`span`,{className:`h-ms-play`,children:[`play `,(0,G.jsx)(`span`,{className:`mono`,children:a})]})]})]})}function ps({ctx:e,screen:t}){let{changes:n}=e;if(!n)return null;let r=()=>e.go(`changes`),i=t===`changes`?`page`:void 0,a=n.ahead?(0,G.jsxs)(`span`,{className:`h-changes-ahead`,title:`${Io(n.ahead)} not pushed yet`,children:[`· ↑`,n.ahead]}):null,o=n.ahead?` ${Io(n.ahead)} not pushed yet.`:``;if(n.count===0)return(0,G.jsxs)(`button`,{className:`h-chip h-changes-clean`,"aria-current":i,title:`The main checkout holds nothing uncommitted.${o} Click: Changes`,onClick:r,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`✓`}),`clean`,a]});let s=n.count===null,c=`${n.count} file${n.count===1?` is`:`s are`}`;return(0,G.jsxs)(`button`,{className:`h-chip h-changes ${s?`h-changes-run`:``}`,"aria-current":i,title:s?`A run works in the main checkout: the agent writes there now, so nothing is counted. Click: what is not committed`:`${c} of the main checkout not committed.${o} Click: which, and how they differ (g x)`,onClick:r,children:[(0,G.jsx)(`span`,{className:`h-changes-dot`,"aria-hidden":`true`}),s?`run writing in main`:`${n.count} changed`,!s&&a]})}function ms({ctx:e,className:t}){let{board:n}=e,r=$o(n.usage,n.quota),[i,a]=(0,v.useState)(!1),o=`${n.usage?.at??``} ${n.usage?.failed?.at??``}`;return(0,v.useEffect)(()=>a(!1),[o]),(0,v.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>a(!1),35e3);return()=>clearTimeout(e)},[i]),n.usage?(0,G.jsxs)(`button`,{className:`${t} ${r.rejected?`u-warn`:``}`,title:r.title,"aria-label":r.text,"aria-busy":i,onClick:()=>{a(!0),e.askUsage()},children:[!r.segs&&(0,G.jsx)(`span`,{className:`u-text`,children:r.text}),r.segs?.map(e=>(0,G.jsxs)(`span`,{className:`u-seg ${e.warn?`u-crit`:``}`,children:[(0,G.jsx)(`span`,{className:`u-name`,children:e.name}),(0,G.jsx)(`span`,{className:`u-gauge`,"aria-hidden":`true`,children:(0,G.jsx)(`span`,{style:{width:`${e.used}%`}})}),(0,G.jsx)(`b`,{children:e.pct}),e.reset&&(0,G.jsx)(`span`,{className:`u-reset`,children:e.reset})]},e.name)),r.old&&(0,G.jsx)(`span`,{className:`u-old`,children:`· old`}),i&&(0,G.jsx)(`span`,{className:`u-busy`,"aria-hidden":`true`})]}):(0,G.jsx)(`span`,{tabIndex:0,className:`${t} u-plain ${r.rejected?`u-warn`:``}`,title:r.title,"aria-label":r.text,children:r.text})}var hs=e=>{let t=e.board.runs?.queued??[];return`runs: ${e.board.run_mode}${t.length?` · ${t.length} queued`:``}`},gs=e=>{let t=e.board.runs?.queued??[];return(e.board.run_mode===`main`?`Runs go one at a time in the project folder (run_mode: main)`:`Each run goes in its own worktree, several at once (run_mode: worktree)`)+(t.length?` · queued: ${t.join(`, `)}`:``)},_s=e=>Object.entries(e.board.extensions??{}).map(([e,t])=>`${e} ${t??`?`}`).join(`, `);function vs({ctx:e,screen:t,projects:n,waiting:r,onWaiting:i,onHelp:a,onSettings:o}){let[s,c]=(0,v.useState)(!1),{board:l}=e,{sections:u}=l.domain,d=fi(l.domain,l.domain.new_item),f=l.items.flatMap(e=>{let t=fa(e);return t?[{id:e.id,at:t,reserve:!!e.resume?.reserve}]:[]}),p=e.talks.flatMap(e=>e.limit_until?[{id:`chat thread ${e.id}`,at:e.limit_until,reserve:!1}]:[]),m=[...f,...p].sort((e,t)=>Date.parse(e.at)-Date.parse(t.at)),h=[f.length?`${f.length} run${f.length>1?`s`:``}`:``,p.length?`${p.length} chat thread${p.length>1?`s`:``}`:``].filter(Boolean).join(`, `);return(0,G.jsxs)(`div`,{className:`top-bar`,children:[(0,G.jsx)(cs,{project:e.project,projects:n}),(0,G.jsxs)(`header`,{className:`project-header ${s?`open`:``}`,"aria-label":`Project header`,children:[u.phase&&(0,G.jsx)(ls,{ctx:e}),u.phase&&l.phase&&(0,G.jsx)(`span`,{className:`h-sep`,"aria-hidden":`true`}),(0,G.jsxs)(`div`,{className:`h-chips`,children:[l.domain.harness&&(0,G.jsx)(`span`,{className:`h-text phone-only`,tabIndex:0,title:gs(e),children:hs(e)}),(0,G.jsx)(us,{ctx:e}),(0,G.jsx)(ds,{ctx:e}),(0,G.jsx)(fs,{ctx:e}),(0,G.jsx)(ps,{ctx:e,screen:t}),m.length>0&&(0,G.jsxs)(`span`,{className:`h-chip h-limit mono`,tabIndex:0,title:`Waiting for the usage limit's reset: ${m.map(e=>e.id).join(`, `)}. The limit is one for the account: they wait by themselves and go on after it; Go on now wakes them all if you reset it early; Stop is on the item.`,children:[`◷`,` `,da(m[0].at,m.every(e=>e.reserve)),(0,G.jsxs)(`span`,{className:`h-sub`,children:[`waiting: `,h]})]}),m.length>0&&(0,G.jsx)(ma,{ctx:e,of:{all:!0}}),l.runs?.paused&&(0,G.jsx)(`button`,{className:`h-chip h-paused`,title:l.runs.paused_by===`limit`?`The usage limit stopped a run by itself (a weekly limit, an unknown reset, a wait over 6 hours, or a third limit): the queue is paused. Resume it after the reset${l.runs.paused_until?` (${aa(l.runs.paused_until)})`:``}.`:`A run failed in a way the next one would repeat (the harness did not start, another run works in the folder): fix the cause, then resume.`,onClick:()=>void e.resumeQueue(),children:`‖ queue paused — resume`}),!l.domain.harness&&(l.extensions_error?(0,G.jsx)(`span`,{role:`alert`,tabIndex:0,className:`h-chip h-chip-error`,title:`The project's .ai-factory.json is there but cannot be read: ${l.extensions_error}. The board knows no harness, so it offers no run. Every manual move works.`,children:`✘ .ai-factory.json unreadable: no run buttons`}):(0,G.jsx)(`span`,{tabIndex:0,className:`h-chip`,title:`The domain names no harness (decision 22): no Run, Run next, Run selected or Metrics. Notes, items, planning, moves and verdicts all work.`,children:`no harness: manual moves only`}))]}),(0,G.jsx)(ms,{ctx:e,className:`h-usage phone-only`}),(0,G.jsxs)(`div`,{className:`h-rest`,children:[u.wip&&l.wip&&(0,G.jsxs)(`span`,{tabIndex:0,className:`h-wip phone-only ${l.wip.over?`over`:``}`,title:u.wip.help,children:[`WIP `,l.wip.count,`/`,l.wip.limit,l.wip.over&&` · over`]}),u.release&&l.release&&(0,G.jsx)(`span`,{tabIndex:0,className:`h-release phone-only`,title:`Last release: version, channel, date`,children:[l.release.version,l.release.channel,l.release.date].filter(Boolean).join(` · `)}),t===`board`&&(0,G.jsx)(`button`,{className:`h-icon wide-only`,"aria-label":`Board tools`,"aria-expanded":e.boardTools,title:`${e.boardTools?`Hide`:`Show`} the board tools: search, filters, group by, run`,onClick:e.toggleBoardTools,children:(0,G.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:e.boardTools?`M6 15l6-6 6 6`:`M6 9l6 6 6-6`})})}),r>0&&(0,G.jsxs)(`button`,{className:`pill pill-needs`,title:`What only you can move on: questions, verdicts, decisions, blocked items, failed runs, a paused queue`,onClick:i,children:[`● waiting for me · `,r]}),d&&(0,G.jsx)(`button`,{className:`h-icon`,"aria-label":`New item`,title:`New item: the domain's new-item form${d.help?` · ${d.help}`:``}`,onClick:()=>e.newItem(),children:(0,G.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`M12 5v14M5 12h14`})})}),(0,G.jsx)(`button`,{className:`h-icon h-gear`,onClick:o,"aria-label":`Settings`,title:`Settings: gcf/config.yml and this browser's board`,children:(0,G.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,className:`thin`,children:[(0,G.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,G.jsx)(`path`,{d:`M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z`})]})}),(0,G.jsx)(`button`,{className:`h-icon h-help`,onClick:a,"aria-label":`Help`,title:`Help: every word the board uses, the moves, the fields`,children:`?`}),l.board_version&&(0,G.jsxs)(`span`,{className:`h-version phone-only`,tabIndex:0,title:_s(e),children:[`board `,l.board_version]})]}),(0,G.jsx)(`button`,{className:`h-more`,"aria-expanded":s,onClick:()=>c(!s),children:s?`less ▴`:`more ▾`})]})]})}function ys({ctx:e}){let{board:t}=e,{sections:n}=t.domain,r=Go(),i=_s(e);return(0,G.jsxs)(`footer`,{className:`status-bar`,"aria-label":`Status`,children:[(0,G.jsxs)(`span`,{className:`sb-seg sb-live`,tabIndex:0,title:`Live: follows the project's files · ${location.host} · ${r}`,children:[(0,G.jsx)(`span`,{className:`sb-dot`,"aria-hidden":`true`}),`live `,r]}),t.domain.harness&&(0,G.jsx)(`span`,{className:`sb-seg`,tabIndex:0,title:gs(e),children:hs(e)}),n.wip&&t.wip&&(0,G.jsxs)(`span`,{className:`sb-seg sb-wip ${t.wip.over?`over`:``}`,tabIndex:0,title:n.wip.help,children:[`WIP `,t.wip.count,`/`,t.wip.limit,t.wip.over&&` · over`]}),(0,G.jsx)(`span`,{className:`sb-fill`}),(0,G.jsx)(ms,{ctx:e,className:`h-quota sb-usage`}),(n.release&&t.release||t.board_version)&&(0,G.jsx)(`span`,{className:`sb-seg sb-rel`,tabIndex:0,title:[n.release&&t.release?`Last release: ${[t.release.version,t.release.channel,t.release.date].filter(Boolean).join(` · `)}${t.release.phase?` (${t.release.phase})`:``}`:``,i?`The packages this project uses: ${i}`:``].filter(Boolean).join(`
39
- `),children:(0,G.jsx)(`span`,{children:[n.release&&t.release?.version,t.board_version&&`board ${t.board_version}`].filter(Boolean).join(` · `)})})]})}function bs(e){let t=[e.sections?.includes(`GDD#`)?`from the GDD import${e.lens?` (${e.lens})`:``}`:null,e.sys&&e.sys!==`-`?`systems: ${e.sys}`:null,e.until?`comes back on ${e.until}`:null].filter(Boolean);return t.length?t.join(` · `):`from an agent run`}var xs=e=>e.category===`lesson`,Ss=e=>({groups:e.domain.sections.inbox?.groups??[],categories:e.domain.sections.inbox?.categories??[]});function Cs(e,t){let{groups:n,categories:r}=Ss(e);return r.find(e=>e.id===t)??{id:t,label:t||`—`,help:`not in the vocabulary`,rank:99,group:n[0]?.id??``,set_by:[],details:null,later:!0,layer:`project`}}var ws=e=>e.category??(/^D2\b/.test(e.class??``)?`assumption`:`decision`);function Ts(e){let{sections:t}=e.domain,n=t.inbox?e.inbox??[]:[],r=t.questions?e.questions??[]:[];return[...n.map((t,n)=>{let r=t.at?Date.parse(t.at):NaN;return{kind:`entry`,id:t.id,entry:t,cat:Cs(e,t.category),detail:t.detail??``,origin:t.origin||`you`,item:t.item,at:Number.isNaN(r)?null:r,idx:n,later:t.later,answered:!1,text:`${t.title??``} ${t.text}`}}),...r.map((t,n)=>({kind:`q`,id:t.id,q:t,cat:Cs(e,ws(t)),detail:``,origin:t.origin??`agent`,item:null,at:null,idx:n,later:!1,answered:!!t.answer,text:[t.question,t.assumed,t.proposed,t.sys,t.blocks].filter(Boolean).join(` `)}))]}function Es(e,t,n){let r=(t.q??``).trim().toLowerCase();return(n===`cat`||!t.cat||e.cat.id===t.cat)&&(n===`det`||n===`cat`||!t.det||e.detail===t.det)&&(n===`org`||!t.org||e.origin===t.org)&&(n===`item`||!t.item||e.item===t.item)&&(!r||`${e.text} ${e.id} ${e.cat.label} ${e.detail} ${e.item??``}`.toLowerCase().includes(r))}var Ds=e=>!!(e.cat||e.org||e.item||e.q?.trim());function Os(e){let t=e.inbox??[];return(e.inbox_repeats??[]).map(e=>({...e,key:`${e.category}:${e.detail}`,recs:e.records.flatMap(e=>t.filter(t=>t.id===e&&!t.later))}))}function ks(e,t){let n=(t.q??``).trim().toLowerCase();return(!t.cat||t.cat===e.category)&&(!t.det||t.det===e.detail)&&(!t.org||e.recs.some(e=>(e.origin||`you`)===t.org))&&(!t.item||e.items.includes(t.item))&&(!n||e.recs.some(e=>`${e.title??``} ${e.text} ${e.id}`.toLowerCase().includes(n)))}function As(e,t,n={}){let{groups:r}=Ss(e),i=r.find(e=>e.holds_later)?.id,a=r.find(e=>e.counts)?.id,o=Ts(e).filter(e=>Es(e,t)),s=Os(e).filter(e=>ks(e,t)),c=Ds(t),l=e=>e.at??0,u=(e,t)=>e.cat.rank-t.cat.rank,d=(e,t)=>u(e,t)||l(e)-l(t)||e.idx-t.idx,f=(e,t)=>u(e,t)||l(t)-l(e)||e.idx-t.idx;return r.flatMap(e=>{let t=o.filter(t=>(t.later?i:t.cat.group)===e.id),r=t.filter(e=>!e.answered).sort(e.order===`newest`?f:d),l=t.filter(e=>e.answered),u=e.id===a?s:[];if(!r.length&&!u.length&&!l.length)return[];let p=new Map;for(let e of r){let t=p.get(e.cat.id)??{cat:e.cat,n:0,det:new Map};t.n++,e.detail&&t.det.set(e.detail,(t.det.get(e.detail)??0)+1),p.set(e.cat.id,t)}return[{group:e,open:c||(n[e.id]??!e.folded),recs:r,answered:l,reps:u,summary:[...p.values()].sort((e,t)=>e.cat.rank-t.cat.rank).map(e=>({cat:e.cat,n:e.n,dets:[...e.det].sort((e,t)=>t[1]-e[1])}))}]})}var js=(e,t)=>t.size?{...e,inbox:e.inbox?.filter(e=>!t.has(e.id))}:e,Ms=(e,t)=>e.filter(e=>xs(e)&&e.item===t);function Ns({ctx:e,q:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),c=fi(e.board.domain,e.board.domain.sections.questions?.answer),l=t.class!==`D2`,u=c&&(!t.answer||i),d=Cs(e.board,ws(t)),f=async i=>{i?.preventDefault(),c&&n.trim()&&!o&&(s(!0),await e.move({cmd:c.cmd,id:t.id,text:n})&&(r(``),a(!1)),s(!1))};return(0,G.jsxs)(`article`,{className:`question ${l?`d1`:`d2`}`,"aria-label":`Question ${t.id}`,children:[(0,G.jsxs)(`div`,{className:`q-head`,children:[(0,G.jsx)(`span`,{className:`q-class`,title:d.help,children:d.label}),(0,G.jsx)(`span`,{className:`q-org`,title:`where it came from: it never changes`,children:t.origin??`agent`}),t.sys&&t.sys!==`-`&&(0,G.jsx)(`span`,{className:`q-sys`,children:t.sys}),(0,G.jsxs)(`span`,{className:`q-id`,title:`the record's own key`,children:[`(`,t.id,`)`]}),t.blocks&&(0,G.jsxs)(`span`,{className:`q-blocks`,children:[`blocks `,t.blocks]})]}),!l&&(0,G.jsx)(`span`,{className:`q-assumed`,children:`Assumed`}),(0,G.jsx)(`p`,{className:`q-text`,children:l?t.question:t.assumed}),t.until&&(0,G.jsxs)(`div`,{className:`q-until`,children:[`until: `,t.until]}),l&&t.proposed&&(0,G.jsxs)(`div`,{className:`q-proposed`,children:[(0,G.jsx)(`span`,{children:`Agent proposes`}),(0,G.jsx)(`p`,{children:t.proposed})]}),(0,G.jsx)(`span`,{className:`q-origin`,title:t.sections??void 0,children:bs(t)}),t.answer&&!i&&(0,G.jsxs)(`div`,{className:`q-answered`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`b`,{children:`✔ Answered:`}),` `,t.answer,` `,(0,G.jsx)(`i`,{children:`(waits for the agent to apply)`})]}),c&&(0,G.jsx)(`button`,{className:`btn-line`,onClick:()=>a(!0),children:`Change the answer`})]}),u&&(0,G.jsxs)(`form`,{className:`q-form`,onSubmit:f,children:[(0,G.jsxs)(`label`,{className:`field`,children:[(0,G.jsx)(`span`,{className:`field-label`,children:l?`Your answer`:`Overrule: an answer replaces the assumption`}),(0,G.jsx)(`textarea`,{className:`input`,rows:2,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),f())},title:`Ctrl+Enter answers`,placeholder:`Your answer in your own words… Ctrl+Enter answers`})]}),(0,G.jsxs)(`div`,{className:`q-acts`,children:[(0,G.jsx)(`button`,{type:`submit`,className:`btn-primary`,disabled:o||!n.trim(),children:o?`Writing…`:l?`Answer`:`Overrule`}),l&&t.proposed&&(0,G.jsx)(`button`,{type:`button`,className:`btn-line`,title:`Copies the agent's proposal into the box`,onClick:()=>r(t.proposed??``),children:`use proposed`}),i&&(0,G.jsx)(`button`,{type:`button`,className:`btn-line`,onClick:()=>a(!1),children:`Cancel`})]})]})]})}var Ps={chat:[`M12 7.4l.9 1.9 1.9.9-1.9.9-.9 1.9-.9-1.9-1.9-.9 1.9-.9z`],draft:[`M9 13l.6-2.2 3.9-3.9 1.6 1.6-3.9 3.9z`],review:[`M8.8 10.4l2.1 2.1 4.2-4.2`],import:[`M12 13V7.6`,`M9.6 9.8L12 7.4l2.4 2.4`],interview:[`M10 8.6a2 2 0 1 1 2.9 1.8c-.6.3-.9.7-.9 1.3`,`M12 13.4h.01`],name:[`M8.6 8h4.2l2.4 2.3-2.4 2.4H8.6z`],fill:[`M12 7.6v5`,`M9.5 10.1h5`],revise:[`M15 10.2a3 3 0 1 1-1-2.3`,`M15.2 6.8v1.8h-1.8`]},Fs={ingest:`import`,"review-gdd":`review`,debate:`review`,"debate-unit":`review`,vision:`interview`,pillars:`interview`,"revise-pillars":`revise`,"revise-vision":`revise`,"draft-glossary":`draft`,"draft-system":`draft`,"draft-entry":`draft`,"name-pillars":`name`,card:`fill`};function Is(e){return Fs[e]??`chat`}function Ls({label:e,tip:t,glyph:n=`chat`,onClick:r,off:i=!1,primary:a=!1,starting:o=!1,hasThread:s=!1,size:c=`md`,file:l}){let u=[e,t].filter(Boolean).join(` — `)+(s?` · its thread exists: opens it`:``),d=e+(s?`, thread open`:``),f=`agent-btn ${c} ${a&&!i?`primary`:``} ${i?`off`:``} ${o?`pulse`:``}`,p=(0,G.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M4 4.5h16v11.5H10.5L6 19.5V16H4z`}),Ps[n].map(e=>(0,G.jsx)(`path`,{d:e},e))]});return(0,G.jsxs)(`span`,{className:`agent-btn-wrap`,children:[l?(0,G.jsxs)(`label`,{className:f,title:u,"aria-disabled":i||void 0,children:[p,(0,G.jsx)(`input`,{type:`file`,accept:`.md,text/markdown`,"aria-label":`${d}: pick a markdown file`,disabled:i,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&l(t)}})]}):(0,G.jsx)(`button`,{type:`button`,className:f,title:u,"aria-label":d,disabled:i,onClick:r,children:p}),s&&!i&&(0,G.jsx)(`span`,{className:`agent-btn-dot`,"aria-hidden":`true`})]})}var Rs=window.matchMedia(`(width <= 700px)`),zs=()=>(0,v.useSyncExternalStore)(e=>(Rs.addEventListener(`change`,e),()=>Rs.removeEventListener(`change`,e)),()=>Rs.matches),Bs=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?``:`${String(t.getMonth()+1).padStart(2,`0`)}.${String(t.getDate()).padStart(2,`0`)} ${t.toTimeString().slice(0,5)}`};function Vs(e,t=Date.now()){let n=e?Date.parse(e):NaN;if(Number.isNaN(n))return``;let r=Math.max(0,Math.round((t-n)/6e4));return r<60?`${r} min`:r<1440?`${Math.round(r/60)} h`:`${Math.round(r/1440)} d`}var Hs=e=>e&&Bs(e)?`added ${Bs(e)}`:void 0;function Us(e){let t=e.text.split(`
40
- `),n=e.title??t[0].replace(/^#+\s*/,``);return{title:n,rest:(t[0].replace(/^#+\s*/,``).trim()===n.trim()?t.slice(1):t).join(`
41
- `).trim()}}var Ws=(e,t)=>t?`${e} · ${t}`:e,Gs=(e,t,n=!1)=>!n&&!!Ss(e).groups.find(e=>e.id===t.group)?.counts,Ks=(e,t)=>e.items.find(e=>e.id===t),qs=(e,t)=>Ks(e,t)?.title||t,Js=e=>e.sys&&e.sys!==`-`?e.sys:``,Ys=e=>e.class!==`D2`,Xs=`Erase: noise, nothing is made of it`;function Zs(e,t){let{board:n}=e,{domain:r}=n,i=r.sections.inbox,a=fi(r,i?.category),o=fi(r,t.later?i?.back:i?.later),s=fi(r,i?.drop),c=Cs(n,t.category),{title:l,rest:u}=Us(t),d=Ss(n).groups.find(e=>e.holds_later),f=Ss(n).groups.find(e=>e.id===c.group);return{title:l,rest:u,toItem:r.new_item?()=>e.newItem({from:t.id,title:l,note:u}):null,sort:a?()=>e.openMove({title:`Sort: ${Ti(Us(t).title||t.id,70)}`,id:t.id,move:a}):null,sortTip:a?.help??``,away:o&&(t.later||c.later)?()=>e.move({cmd:o.cmd,id:t.id}):null,awayTip:t.later?`Back to ${f?.label??c.group}`:d?.help??o?.help??``,erase:s?()=>e.erase(s.cmd,t.id):null,eraseCmd:s?`gcf ${s.cmd.replace(`-`,` `)}`:``}}function Qs({ctx:e,e:t}){let[n,r]=(0,v.useState)(!1),{domain:i}=e.board;if(!i.chat||!i.new_item)return null;let a=e.talks.find(e=>e.entry===t.id),o=a?.title?a:void 0,s=is(e.board.quota),c=async()=>{if(!n){r(!0);try{let n=await H.draft(e.project.name,t.id);e.reloadTalks(),e.go(`chat`,n.thread)}catch(t){e.notify(t.message,`error`)}r(!1)}};return(0,G.jsx)(Ls,{label:`Draft with agent`,glyph:`draft`,hasThread:!!o,starting:n,off:!o&&!!s,tip:s&&!o?`Off until ${ra(s)}: the usage limit holds for the account`:o?`Opens its thread in the project chat; sends nothing`:`Opens a project chat thread on this entry: the agent proposes an item from it, or says none is needed`,onClick:()=>o?e.go(`chat`,o.id):void c()})}function $s({ctx:e,e:t,place:n}){let[r,i]=(0,v.useState)(!1),a=Zs(e,t),o=e=>n===`detail`?` · ${e}`:``,s=a.away;return(0,G.jsxs)(`div`,{className:`ib-acts ${n}`,onClick:e=>e.stopPropagation(),children:[a.toItem&&(0,G.jsx)(`button`,{className:`ib-act main`,title:`Opens the new-item form: the title from its first line, the rest of its text in the note`,onClick:a.toItem,children:`→ Item`}),n!==`lesson`&&(0,G.jsx)(Qs,{ctx:e,e:t}),a.sort&&(0,G.jsx)(`button`,{className:`ib-act`,title:a.sortTip+o(`s`),onClick:a.sort,children:`Sort…`}),s&&(0,G.jsx)(`button`,{className:`ib-act ${t.later?`back`:``}`,disabled:r,title:a.awayTip+o(`l`),onClick:()=>{i(!0),s().finally(()=>i(!1))},children:t.later?`Back`:`Later`}),a.erase&&(0,G.jsx)(Po,{label:`Erase`,tip:n===`detail`?`${Xs} · e`:n===`lesson`?`Erase (${a.eraseCmd})`:`${Xs} (${a.eraseCmd})`,disabled:r,onClick:a.erase})]})}function ec({ctx:e,id:t,bare:n=!1}){let r=Ks(e.board,t);return r?(0,G.jsxs)(`button`,{className:`ib-link`,onClick:n=>{n.stopPropagation(),e.openItem(t)},children:[(0,G.jsx)(`span`,{className:`ib-u`,children:r.title||t}),!n&&r.title&&(0,G.jsxs)(`span`,{className:`ib-id`,children:[`(`,t,`)`]})]}):(0,G.jsxs)(`span`,{className:`ib-ended`,title:`ended: not on the board`,children:[t,` ✔`]})}function tc({ctx:e,e:t,big:n=!1}){let r=t.attachments??[];return r.length?(0,G.jsx)(`div`,{className:`ib-atts`,children:r.map(t=>(0,G.jsxs)(`a`,{className:`ib-att ${n?`big`:``}`,title:t,href:oe(e.project.name,t),target:`_blank`,rel:`noreferrer`,children:[`▣ `,t.split(`/`).pop()]},t))}):null}function nc({cat:e,detail:t,lead:n,tip:r}){return(0,G.jsxs)(`span`,{className:`tile-cat ib-cat tone-${n?`needs`:`neutral`}`,title:r??e.help,children:[e.label,t&&(0,G.jsxs)(`span`,{className:`ib-cat-det`,children:[`· `,t]})]})}function rc({ctx:e,e:t}){let n=Cs(e.board,t.category),{title:r,rest:i}=Us(t);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`h2`,{className:`ib-d-title`,children:r}),t.item&&(0,G.jsxs)(`div`,{className:`ib-d-from`,children:[`from `,(0,G.jsx)(ec,{ctx:e,id:t.item})]}),i&&(0,G.jsx)(`p`,{className:`ib-d-rest`,children:i}),(0,G.jsx)(tc,{ctx:e,e:t,big:!0}),(0,G.jsxs)(`span`,{className:`ib-d-cat`,title:n.help,children:[n.label,`: `,n.help]}),(0,G.jsx)($s,{ctx:e,e:t,place:`detail`})]})}function ic({ctx:e,r:t}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`h2`,{className:`ib-d-title`,children:[`The same obstacle in `,t.items.length,` runs`]}),(0,G.jsx)(`span`,{className:`ib-d-tip`,children:oc(e.board,t)}),(0,G.jsx)(`div`,{className:`ib-d-items`,children:t.items.map(t=>(0,G.jsx)(ec,{ctx:e,id:t},t))}),(0,G.jsx)(`div`,{className:`ib-lessons`,children:t.recs.map(t=>(0,G.jsx)(ac,{ctx:e,e:t},t.id))})]})}function ac({ctx:e,e:t}){return(0,G.jsxs)(`div`,{className:`ib-lesson`,children:[(0,G.jsxs)(`div`,{className:`ib-lesson-line`,children:[t.item&&(0,G.jsx)(ec,{ctx:e,id:t.item,bare:!0}),(0,G.jsx)(`span`,{className:`mono`,title:Hs(t.at),children:Vs(t.at)})]}),(0,G.jsx)(`p`,{children:Us(t).title}),(0,G.jsx)($s,{ctx:e,e:t,place:`lesson`})]})}var oc=(e,t)=>`${Ws(Cs(e,t.category).label,t.detail)} from ${t.items.length} items: a repeated obstacle is yours to remove now`;function sc(e,t){e.openDetail({key:`entry:${t}`,render:e=>{let n=e.board.inbox?.find(e=>e.id===t);if(!n)return null;let r=Cs(e.board,n.category);return{cat:Ws(r.label,n.detail),catTip:r.help,tone:Gs(e.board,r,n.later)?`needs`:`neutral`,origin:n.origin||`you`,age:Vs(n.at),ageTip:Hs(n.at),body:(0,G.jsx)(rc,{ctx:e,e:n})}}})}function cc(e,t){e.openDetail({key:`q:${t}`,render:e=>{let n=e.board.questions?.find(e=>e.id===t);if(!n)return null;let r=Cs(e.board,ws(n));return{cat:r.label,catTip:r.help,tone:Gs(e.board,r)?`needs`:`neutral`,origin:n.origin??`agent`,body:(0,G.jsx)(Ns,{ctx:e,q:n})}}})}function lc(e,t){e.openDetail({key:`rep:${t}`,render:e=>{let n=Os(e.board).find(e=>e.key===t);return n?{cat:Ws(Cs(e.board,n.category).label,n.detail),catTip:oc(e.board,n),tone:`needs`,origin:`agent · repeated`,body:(0,G.jsx)(ic,{ctx:e,r:n})}:null}})}function uc(e,t,n=!1){let{board:r}=e,i=Cs(r,t.category),a=Gs(r,i,t.later),{title:o,rest:s}=Us(t),c=`entry:${t.id}`,l=t.item&&Ks(r,t.item)?.title,u=t.item?`from ${qs(r,t.item)}${n&&l?` (${t.item})`:``}`:``,d=t.attachments?.length??0;return{cat:Ws(i.label,t.detail),catTip:i.help,tone:a?`needs`:`neutral`,needs:a,origin:t.origin||`you`,age:Vs(t.at),ageTip:Hs(t.at),title:o,sub:n?u:u||s.split(`
42
- `)[0],mark:n?t.text.trim().includes(`
43
- `)?`+ more`:``:d?`▣ ${d}`:s?`+ more`:``,on:e.detailKey===c,dataKey:c,tip:n?void 0:`Open: the full text and its moves (Enter)`,onOpen:()=>sc(e,t.id)}}function dc(e,t,n=!1){let r=Cs(e.board,ws(t)),i=Gs(e.board,r),a=`q:${t.id}`,o=Ys(t);return{cat:r.label,catTip:r.help,tone:i?`needs`:`neutral`,needs:i&&!t.answer,origin:t.origin??`agent`,title:(o?t.question:t.assumed)??``,sub:t.blocks?`blocks ${t.blocks}`:Js(t),mark:t.answer?`✔ answered`:o&&t.proposed?`a proposal`:``,markTone:t.answer?`ok`:`text`,on:e.detailKey===a,dataKey:a,tip:n?void 0:`Open: the full text and its moves (Enter)`,onOpen:()=>cc(e,t.id)}}function fc(e,t,n=!1){let r=Os(e.board).find(e=>e.key===t);if(!r)return null;let i=`rep:${r.key}`,a=oc(e.board,r);return{cat:Ws(Cs(e.board,r.category).label,r.detail),catTip:a,tone:`needs`,needs:!0,origin:`agent · repeated`,title:`The same obstacle in ${r.items.length} runs`,sub:r.items.map(t=>qs(e.board,t)).join(`, `),mark:`${r.recs.length} lessons`,markTone:`needs`,on:e.detailKey===i,dataKey:i,tip:n?void 0:a,onOpen:()=>lc(e,r.key)}}function pc({ctx:e,r:t}){let n=t.entry,r=Gs(e.board,t.cat,t.later),{title:i,rest:a}=Us(n);return(0,G.jsxs)(`article`,{className:`ib-rec ${r?`needs`:``}`,"aria-label":i,"data-tile-key":`entry:${n.id}`,children:[(0,G.jsxs)(`div`,{className:`ib-rec-line`,children:[(0,G.jsx)(nc,{cat:t.cat,detail:n.detail,lead:r}),(0,G.jsx)(`span`,{className:`ib-origin`,title:`where it came from: it never changes`,children:t.origin}),n.item&&(0,G.jsx)(ec,{ctx:e,id:n.item}),n.at&&(0,G.jsx)(`span`,{className:`ib-age`,title:Hs(n.at),children:Vs(n.at)})]}),(0,G.jsx)(`p`,{className:`ib-rec-title`,children:i}),a&&(0,G.jsx)(`p`,{className:`ib-rec-rest`,children:a}),(0,G.jsx)(tc,{ctx:e,e:n}),(0,G.jsx)($s,{ctx:e,e:n,place:`rec`})]})}function mc({ctx:e,r:t}){let[n,r]=(0,v.useState)(!1),i=Cs(e.board,t.category);return(0,G.jsxs)(`article`,{className:`ib-rec needs`,"aria-label":`The same obstacle in ${t.items.length} runs`,title:oc(e.board,t),children:[(0,G.jsxs)(`div`,{className:`ib-rec-line`,children:[(0,G.jsx)(nc,{cat:i,detail:t.detail,lead:!0}),(0,G.jsx)(`span`,{className:`ib-origin`,children:`agent · repeated`})]}),(0,G.jsxs)(`p`,{className:`ib-rec-title`,children:[`The same obstacle in `,t.items.length,` runs`]}),(0,G.jsx)(`div`,{className:`ib-rep-items`,children:t.items.map(t=>(0,G.jsx)(ec,{ctx:e,id:t},t))}),(0,G.jsx)(`button`,{className:`ib-act main ib-rep-toggle`,"aria-expanded":n,onClick:()=>r(!n),children:n?`▾ Hide its ${t.recs.length} lessons`:`▸ Open its ${t.recs.length} lessons`}),n&&(0,G.jsx)(`div`,{className:`ib-rep-recs`,children:t.recs.map(t=>(0,G.jsx)(ac,{ctx:e,e:t},t.id))})]})}function hc({ctx:e}){let{board:t}=e,{domain:n}=t,r=fi(n,n.sections.inbox?.add),i=r?.fields.find(e=>e.key===`category`),a=r?.fields.find(e=>e.key===`detail`),o=Ss(t).categories.filter(e=>e.set_by.includes(`you`)),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(i?.default||o[0]?.id||``),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(!1);if(!r)return null;let h=o.find(e=>e.id===l),g=async()=>{if(!s.trim()||p)return;m(!0);let t={cmd:r.cmd,text:s,...l?{category:l}:{},...a&&d.trim()?{detail:d.trim().toLowerCase()}:{}};await e.move(t)&&(c(``),f(``)),m(!1)};return(0,G.jsxs)(`div`,{className:`ib-add`,children:[(0,G.jsx)(`textarea`,{"aria-label":`New inbox entry`,rows:2,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),g())},placeholder:`An idea, a note, a play note… Line 1 is its title.`}),(0,G.jsxs)(`div`,{className:`ib-add-row`,children:[(0,G.jsx)(`button`,{className:`ib-add-btn`,disabled:p||!s.trim(),onClick:()=>void g(),children:p?`Adding…`:`Add`}),o.length>0&&(0,G.jsxs)(`label`,{className:`ib-as`,children:[(0,G.jsx)(`span`,{children:`as`}),(0,G.jsx)(`select`,{"aria-label":`Category`,title:h?.help,value:l,onChange:e=>{u(e.target.value),f(``)},children:o.map(e=>(0,G.jsx)(`option`,{value:e.id,title:e.help,children:e.label},e.id))})]}),a&&(h?.details?(0,G.jsxs)(`select`,{className:`ib-add-det`,"aria-label":`Detail`,value:d,onChange:e=>f(e.target.value),children:[(0,G.jsx)(`option`,{value:``,children:`no detail`}),h.details.map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))]}):(0,G.jsx)(`input`,{className:`ib-add-det`,"aria-label":`Detail, optional`,value:d,maxLength:a.max??30,onChange:e=>f(e.target.value),placeholder:`detail (optional): touch`})),(0,G.jsxs)(`span`,{className:`ib-add-hint`,children:[h?.help?`${h.help} · `:``,`Ctrl+Enter adds, Enter breaks the line`]})]})]})}var gc=[[``,`any`],[`you`,`you`],[`agent`,`agents`],[`automation`,`automation`]];function _c({ctx:e,f:t,set:n,phone:r}){let{board:i}=e,{groups:a,categories:o}=Ss(i),s=Ts(i).filter(e=>!e.answered),c=(e,n)=>s.filter(r=>n(r)&&Es(r,t,e)).length,l=t.cat?Cs(i,t.cat):null,u=l?[...new Set([...l.details??[],...s.filter(e=>e.cat.id===t.cat&&e.detail).map(e=>e.detail)])].map(e=>({d:e,n:c(`det`,n=>n.cat.id===t.cat&&n.detail===e)})).filter(e=>e.n>0||(l.details??[]).includes(e.d)):[],d=[...new Set(s.flatMap(e=>e.item?[e.item]:[]))];return(0,G.jsxs)(`div`,{role:`search`,"aria-label":`Filter the inbox`,className:`ib-filter`,children:[(0,G.jsxs)(`div`,{className:`ib-filter-row`,children:[(0,G.jsxs)(`select`,{className:`ib-fsel ${l?`on`:``}`,"aria-label":`Category`,value:t.cat??``,onChange:e=>n({...t,cat:e.target.value,det:``}),children:[(0,G.jsxs)(`option`,{value:``,children:[`All categories · `,c(`cat`,()=>!0)]}),a.map(e=>{let t=o.filter(t=>t.group===e.id).map(e=>({c:e,n:c(`cat`,t=>t.cat.id===e.id)})).filter(e=>e.n>0);return t.length>0&&(0,G.jsx)(`optgroup`,{label:e.label,children:t.map(e=>(0,G.jsxs)(`option`,{value:e.c.id,children:[e.c.label,` · `,e.n]},e.c.id))},e.id)})]}),(0,G.jsx)(`div`,{role:`radiogroup`,"aria-label":`Origin`,className:`ib-seg`,children:gc.map(([e,r])=>{let i=c(`org`,t=>!e||t.origin===e),a=(t.org??``)===e;return(0,G.jsxs)(`button`,{role:`radio`,"aria-checked":a,className:a?`on`:``,disabled:!i&&e!==``,onClick:()=>n({...t,org:e}),children:[r,(0,G.jsx)(`span`,{children:i})]},r)})}),d.length>0&&(0,G.jsxs)(`select`,{className:`ib-fsel ib-fitem`,"aria-label":`From item`,value:t.item??``,onChange:e=>n({...t,item:e.target.value}),children:[(0,G.jsx)(`option`,{value:``,children:`from any item`}),d.map(e=>(0,G.jsxs)(`option`,{value:e,children:[`from `,qs(i,e),Ks(i,e)?.title?` (${e})`:``,` · `,c(`item`,t=>t.item===e)]},e))]}),(0,G.jsx)(`input`,{className:`ib-search`,"aria-label":`Search the inbox`,type:`search`,value:t.q??``,onChange:e=>n({...t,q:e.target.value}),placeholder:`search the text`}),!r&&(0,G.jsx)(`span`,{className:`ib-keys`,title:`Keys on the inbox`,children:`j / k · Enter opens · s sort · l later · e erase`}),!r&&Ds(t)&&(0,G.jsx)(`button`,{className:`ib-clear`,onClick:()=>n({}),children:`Clear filters`})]}),l&&u.length>0&&(0,G.jsxs)(`div`,{role:`group`,"aria-label":l.details?`its kinds`:`its details`,className:`ib-dets`,children:[(0,G.jsx)(`span`,{children:l.details?`its kinds`:`its details`}),u.map(e=>{let r=t.det===e.d;return(0,G.jsxs)(`button`,{"aria-pressed":r,className:r?`on`:``,disabled:!e.n&&!r,onClick:()=>n({...t,det:r?``:e.d}),children:[e.d,(0,G.jsx)(`span`,{children:e.n})]},e.d)})]})]})}function vc(e,t,n){let r=t=>t.kind===`entry`?{key:`entry:${t.id}`,tile:uc(e,t.entry),entry:t.entry}:{key:`q:${t.id}`,tile:dc(e,t.q)};return[...t.recs.map(r),...t.reps.flatMap(t=>{let n=fc(e,t.key);return n?[{key:`rep:${t.key}`,tile:n}]:[]}),...n?t.answered.map(r):[]]}function yc({ctx:e,g:t,phone:n,fold:r,ansOpen:i,toggleAns:a,cards:o,picked:s}){let{group:c,open:l}=t,u=t.recs.length+t.reps.length,d=t.answered.length>0&&(0,G.jsxs)(`button`,{className:`ib-ans`,"aria-expanded":i,onClick:a,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`✔`}),i?`▾`:`▸`,` `,t.answered.length,` answered, waiting for an agent to apply`]}),f=e=>(0,G.jsx)(No,{...e.tile,picked:e.key===s},e.key),p=o.slice(0,o.length-(i?t.answered.length:0));return(0,G.jsxs)(`section`,{className:`ib-group ${c.counts?`counts`:``} ${l?`open`:``}`,"aria-label":c.label,children:[(0,G.jsxs)(`button`,{className:`ib-ghead`,"aria-expanded":l,title:`${l?`Fold`:`Open`} ${c.label}`,onClick:r,children:[(0,G.jsx)(`span`,{className:`ib-gmark`,"aria-hidden":`true`,children:l?`▾`:`▸`}),(0,G.jsx)(`h3`,{children:c.label}),(0,G.jsx)(`span`,{className:`ib-gcount`,children:u}),(0,G.jsx)(`span`,{className:`ib-ghelp`,children:c.help}),!l&&t.summary.length>0&&(0,G.jsx)(`span`,{className:`ib-sum`,children:t.summary.map(e=>(0,G.jsxs)(`span`,{children:[e.cat.label,` `,(0,G.jsx)(`b`,{children:e.n}),e.dets.length>0&&(0,G.jsx)(`i`,{children:e.dets.map(([e,t])=>`${e} ${t}`).join(` · `)})]},e.cat.id))}),(0,G.jsx)(`span`,{className:`ib-gact`,children:l?`▴ Hide`:`▾ Show ${u}`})]}),l&&(n?(0,G.jsxs)(`div`,{className:`ib-gbody phone`,children:[t.recs.map(t=>t.kind===`q`?(0,G.jsx)(Ns,{ctx:e,q:t.q},t.id):(0,G.jsx)(pc,{ctx:e,r:t},t.id)),t.reps.map(t=>(0,G.jsx)(mc,{ctx:e,r:t},t.key)),d,i&&t.answered.map(t=>(0,G.jsx)(Ns,{ctx:e,q:t.q},t.id))]}):(0,G.jsx)(`div`,{className:`ib-gbody`,children:(0,G.jsxs)(Fo,{children:[p.map(f),d,i&&o.slice(p.length).map(f)]})}))]})}function bc({ctx:e}){let{board:t}=e,n=zs(),[r,i]=(0,v.useState)({}),[a,o]=(0,v.useState)({}),[s,c]=(0,v.useState)({}),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(null),p=As(t,r,a),m=new Map(p.map(t=>[t.group.id,t.open?vc(e,t,!!s[t.group.id]):[]]));for(let e of m.values())for(let t of e){let e=t.tile.onOpen;t.tile={...t.tile,onOpen:()=>(f(t.key),e())}}let h=n?[]:[...m.values()].flat(),g=(0,v.useRef)(()=>{});if(g.current=t=>{let n=d??e.detailKey,r=h.findIndex(e=>e.key===n),i=!!e.detailKey,a=e=>{let t=h[Math.max(0,Math.min(h.length-1,e))];t&&(f(t.key),document.querySelector(`[data-tile-key="${CSS.escape(t.key)}"]`)?.scrollIntoView({block:`nearest`}),i&&t.tile.onOpen())};t.key===`j`?a(r<0?0:r+1):t.key===`k`&&a(r<0?0:r-1);let o=h[r];if(!o||(t.key===`Enter`&&o.tile.onOpen(),!o.entry))return;let s=Zs(e,o.entry);if(t.key===`s`)s.sort?.();else if(t.key===`l`)s.away?.();else if(t.key===`e`&&s.erase){let e=h[r+1]??h[r-1];s.erase(),f(e?.key??null),i&&e&&e.tile.onOpen()}},(0,v.useEffect)(()=>{if(n)return;let e=0,t=t=>{if(ko(t)||t.repeat||document.querySelector(`aside.drawer:not(.detail-win), .help`))return;let n=Date.now()-e<1200;e=t.key===`g`?Date.now():0,!n&&[`j`,`k`,`Enter`,`s`,`l`,`e`].includes(t.key)&&(t.key===`Enter`&&t.target?.closest?.(`button, a`)||setTimeout(()=>{t.defaultPrevented||g.current(t)}))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[n]),!t.domain.sections.inbox)return null;let _=Ts(t).filter(e=>!e.answered),y=Ds(r),b=_.filter(e=>Es(e,r)).length,x=Xa(t),S=[r.cat,r.org,r.item,r.q?.trim()].filter(Boolean).length;return(0,G.jsxs)(`section`,{className:`ib`,"aria-label":`Inbox`,children:[(0,G.jsxs)(`div`,{className:`ib-top`,children:[(0,G.jsxs)(`div`,{className:`ib-head`,children:[(0,G.jsx)(`h2`,{children:`Inbox`}),x>0&&(0,G.jsxs)(`span`,{className:`ib-need`,children:[x,` need you`]}),(0,G.jsx)(`span`,{className:`ib-shown`,children:y?`${b} of ${_.length} shown`:`${_.length} records`})]}),(0,G.jsx)(hc,{ctx:e}),n&&(0,G.jsxs)(`div`,{className:`ib-ftoggle`,children:[(0,G.jsxs)(`button`,{"aria-expanded":l,onClick:()=>u(!l),children:[l?`▾ `:`▸ `,`Filter`,S?` · ${S}`:``]}),y&&(0,G.jsx)(`button`,{onClick:()=>i({}),children:`Clear`})]}),(!n||l)&&(0,G.jsx)(_c,{ctx:e,f:r,set:i,phone:n})]}),y&&!p.length&&(0,G.jsx)(`p`,{className:`ib-empty`,children:`Nothing matches the filter.`}),!y&&!p.length&&(0,G.jsx)(`p`,{className:`ib-empty`,children:`Nothing waits here. What you add above, and what agents and checks file, lands in its group.`}),p.map(t=>(0,G.jsx)(yc,{ctx:e,g:t,phone:n,fold:()=>o({...a,[t.group.id]:!t.open}),ansOpen:!!s[t.group.id],toggleAns:()=>c({...s,[t.group.id]:!s[t.group.id]}),cards:m.get(t.group.id)??[],picked:n?null:d},t.group.id))]})}var xc=(e,t,n=`debug`)=>(e??[]).find(e=>e.build===t&&e.profile===n)??null,Sc=e=>Object.entries(e).map(([e,t])=>`${e}: ${JSON.stringify(t)}`).join(`, `),Cc=(e,t,n=!1)=>`Play${n?` main`:``}${e.length>1?` on ${t}`:``}`,wc=e=>e.shared_with?.length?`Same build as ${e.shared_with.join(`, `)}.`:null;function Tc(e,t){let n=e.targets.map(e=>` ${e.name}${e.build?` plays ${e.build}`:``}: ${e.start?`start \`${e.start}\`, `:``}open \`${e.open}\``+(e.stop?`, stop \`${e.stop}\``:``)),r=e.builds.map(t=>` ${t.name}${t.name===e.auto_build?` (auto_build)`:``}: `+Object.entries(t.profiles).map(([e,t])=>`${e} \`${t}\``).join(`, `)+` into \`${t.output}\``+(t.plays_on.length?`, plays on ${t.plays_on.map(Sc).join(`; `)}`:``));return[...r.length?[`builds:`,...r]:[`no build`],...n.length?[`targets:`,...n]:[`no target`],...t?[`last failure: ${t}`]:[]].join(`
44
- `)}function Ec(e){let t=e.targets[0],n=e.builds.find(t=>t.name===e.auto_build)??e.builds[0];return{...n?{of:n.name,build:n.profiles.debug,output:n.output}:{},...n?.plays_on.length?{plays_on:n.plays_on.map(Sc)}:{},...t?{target:t.name,start:t.start,open:t.open}:{},...t?.build?{target_build:t.build}:{},...t?.stop?{stop:t.stop}:{}}}function Dc(e){try{if(!e?.document)return;e.document.title=`Building…`,e.document.body.textContent=`Building the game… this tab opens it when it is ready.`}catch{}}async function Oc(e,t,n=window,r){let i=/^https?:\/\//.test(e.open)?n.open(`about:blank`,`_blank`):null;try{if(r){Dc(i);let e=await r();if(!e.ok)throw Error(e.problem??`the build failed`)}let e=await t();return i&&e.url?(i.opener=null,i.location.href=e.url):i?.close(),e}catch(e){throw i?.close(),e}}function kc(e,t,n=!1){let r=e.board.domain.starts?.[t],[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(``),c=is(e.board.quota),l=t=>n?s(t):e.notify(t,`error`),u=c?`Off until ${ra(c)}: the usage limit holds for the account. The forms work without an agent.`:i?`Opening a new thread of the project chat…`:`${r?.help??``} · opens a new thread of the project chat${r?.skill?` with ${r.skill}`:``}, and goes to it`,d=async n=>{a(!0),s(``);try{let r=await H.start(e.project.name,t,n);e.reloadTalks(),e.go(`chat`,r.thread)}catch(e){l(e.message)}a(!1)};return{s:r,busy:i,err:o,off:!!c||i,tip:u,go:d,pick:async e=>{if(!/\.md$/i.test(e.name))return l(`${e.name} is not markdown: save a Word or Google document as .md first`);if(e.size>5242880)return l(`${e.name} is ${(e.size/1048576).toFixed(1)} MB: a GDD is up to 5 MB`);await d({file:{name:e.name,text:await e.text()}})}}}var Ac=[`B`,`KB`,`MB`,`GB`];function jc(e){let t=e,n=0;for(;t>=1024&&n<Ac.length-1;)t/=1024,n++;return`${n?t.toFixed(1):t} ${Ac[n]}`}function Mc(e,t=!1){let n=e.built_at?new Date(e.built_at).toLocaleString([],{dateStyle:`short`,timeStyle:`short`}):``,r=[e.commit?.slice(0,7),n,e.size===null?``:jc(e.size)].filter(Boolean).join(` · `);return`Build ${t?`${e.build} · ${e.profile} · `:``}${r}`}function Nc({ctx:e,words:t}){let n=kc(e,`play-setup`,!0),r=fi(e.board.domain,`play-setup`);return(0,G.jsxs)(`div`,{className:`play-bar`,role:`group`,"aria-label":`Set up how to play`,children:[(0,G.jsxs)(`div`,{className:`play-facts`,children:[(0,G.jsx)(`span`,{className:`dim small`,children:t}),n.err&&(0,G.jsx)(`span`,{className:`error-text small play-why`,children:n.err})]}),(0,G.jsxs)(`div`,{className:`play-acts`,children:[n.s&&(0,G.jsx)(`button`,{className:`btn-agent`,disabled:n.off,title:n.tip,onClick:()=>void n.go({}),children:n.busy?`Opening…`:`Set up`}),r&&(0,G.jsx)(`button`,{className:`link-btn small`,onClick:()=>r&&e.openMove({title:`How to play this project`,move:r}),children:`by hand`})]})]})}function Pc({ctx:e,play:t,problem:n,rebuild:r,off:i}){let a=kc(e,`play-fix`),o=fi(e.board.domain,`play-setup`);return(0,G.jsxs)(`details`,{className:`play-change`,children:[(0,G.jsx)(`summary`,{className:`btn-line`,children:`Change`}),(0,G.jsxs)(`div`,{className:`play-acts`,children:[a.s&&(0,G.jsx)(`button`,{className:`btn-agent`,disabled:a.off,title:a.tip,onClick:()=>void a.go({text:Tc(t,n)}),children:a.busy?`Opening…`:`Find again with agent`}),o&&(0,G.jsx)(`button`,{className:`btn-line`,onClick:()=>e.openMove({title:`How to play this project`,move:o,values:Ec(t)}),children:`Edit`}),r&&(0,G.jsx)(`button`,{className:`btn-line`,disabled:i,title:`Builds the folder as it is now and replaces the build every card on this code plays`,onClick:r,children:`Build again`})]})]})}var Fc=(e,t)=>e.builds.length>1||t.some(e=>e.profile!==`debug`);function Ic({builds:e,building:t,play:n,id:r,said:i}){let a=n.running?.id===r?n.running:null,o=e.filter(e=>e.ok),s=e.filter(e=>e.problem),c=[...new Set(e.flatMap(e=>e.dirtied))],l=o.map(wc).find(Boolean);return(0,G.jsxs)(`div`,{className:`play-facts`,children:[o.map(t=>(0,G.jsx)(`span`,{className:`mono small`,children:Mc(t,Fc(n,e))},`${t.build}.${t.profile}`)),l&&(0,G.jsx)(`span`,{className:`dim small`,children:l}),t&&(0,G.jsxs)(`span`,{className:`small`,role:`status`,children:[(0,G.jsx)(`span`,{className:`dot pulse`,"aria-hidden":`true`}),` Building…`]}),e.some(e=>e.building&&e.cold)&&(0,G.jsx)(`span`,{className:`dim small`,children:`First build in the build folder: every asset is imported, it takes long.`}),!o.length&&!t&&!s.length&&(0,G.jsx)(`span`,{className:`dim small`,children:`No build of this card yet: Play builds it first.`}),o.some(e=>e.source===`click`)&&(0,G.jsx)(`span`,{className:`warn-text small`,children:`Built by hand: it may hold later cards too.`}),e.some(e=>e.dirty)&&(0,G.jsx)(`span`,{className:`warn-text small`,children:`The folder had uncommitted changes then.`}),c.length>0&&(0,G.jsxs)(`span`,{className:`warn-text small`,children:[`The build changed `,c.join(`, `),`.`]}),s.map(e=>(0,G.jsx)(`span`,{className:`error-text small play-why`,title:e.problem??``,children:e.problem},`${e.build}.${e.profile}`)),n.problem&&(0,G.jsx)(`span`,{className:`error-text small`,children:n.problem}),a&&(0,G.jsxs)(`span`,{className:`ok-text small`,role:`status`,children:[`Playing on `,a.target,a.url?(0,G.jsxs)(G.Fragment,{children:[` · `,(0,G.jsx)(`a`,{href:a.url,target:`_blank`,rel:`noopener noreferrer`,children:a.url})]}):` · ${a.open}`]}),i&&!a&&(0,G.jsx)(`span`,{className:`small`,role:`status`,children:i})]})}function Lc({ctx:e,id:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),c=kc(e,`play-fix`),{board:l,project:u,notify:d}=e,f=l.items.find(e=>e.id===t),p=l.domain.sections.playtest?.waits??[];if(!f||!p.includes(f.status)||l.play===void 0)return null;let m=l.play;if(m===null)return(0,G.jsx)(Nc,{ctx:e,words:`How to play is not set up: the agent finds it in the project.`});let h=f.builds??[],g=m.running?.id===t?m.running:null,_=async(e,t)=>{r(e);try{await t()}catch(e){d(e.message,`error`)}r(``)},y=n===`build`||h.some(e=>e.building),b=o||h.find(e=>e.problem)?.problem||null,x=e=>!!xc(h,e.build)?.ok,S=e=>_(`play:${e.name}`,async()=>{a(``),s(``);try{let n=await Oc(e,()=>H.playStart(u.name,t,e.name),window,x(e)?void 0:()=>H.playBuild(u.name,t,!1,e.build));n.url||a(n.open)}catch(e){throw s(e.message),e}}),C=e=>_(`build`,async()=>{let n=await H.playBuild(u.name,t,!0,e?.build,e?.profile);!n.ok&&!n.moved_on&&d(`The build of ${t} failed`,`error`)}),w=()=>_(`stop`,async()=>{await H.playStop(u.name),a(``)}),T=!!n||y;return(0,G.jsxs)(`div`,{className:`play-bar`,role:`group`,"aria-label":`Play ${t}`,children:[(0,G.jsx)(Ic,{builds:h,building:y,play:m,id:t,said:i}),o&&(0,G.jsx)(`span`,{className:`error-text small play-why`,role:`alert`,children:o}),(0,G.jsxs)(`div`,{className:`play-acts`,children:[m.targets.map(e=>(0,G.jsx)(`button`,{className:`btn-primary`,disabled:T,title:x(e)?e.open:`Builds the game first, then: ${e.open}`,onClick:()=>void S(e),children:n===`play:${e.name}`?x(e)?`Starting…`:`Building…`:Cc(m.targets,e.name)},e.name)),g&&(0,G.jsx)(`button`,{className:`btn-line`,disabled:!!n,onClick:()=>void w(),children:`Stop`}),b&&c.s&&(0,G.jsx)(`button`,{className:`btn-agent`,disabled:c.off,title:c.tip,onClick:()=>void c.go({text:Tc(m,b)}),children:`Fix with agent`}),h.some(e=>e.problem)&&(0,G.jsx)(`button`,{className:`btn-line`,disabled:T,onClick:()=>void C(h.find(e=>e.problem)),children:`Build again`}),(0,G.jsx)(Pc,{ctx:e,play:m,problem:b,rebuild:h.some(e=>e.ok)?()=>void C():void 0,off:T})]})]})}function Rc({ctx:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),s=kc(e,`play-fix`),{board:c,project:l,notify:u}=e,d=c.play;if(!d||d.problem||!(`main`in d))return null;let f=d.main??[],p=d.running?.main?d.running:null,m=async(e,t)=>{n(e);try{await t()}catch(e){u(e.message,`error`)}n(``)},h=e=>m(`play:${e.name}`,async()=>{i(``),o(``);try{let t=await Oc(e,()=>H.playStart(l.name,null,e.name),window,()=>H.playBuild(l.name,null,!1,e.build));t.url||i(t.open)}catch(e){throw o(e.message),e}}),g=()=>m(`build`,async()=>{let e=await H.playBuild(l.name,null,!0);e.ok||u(`The build of main failed: ${e.problem??``}`,`error`)}),_=!!t||f.some(e=>e.building),y=a||f.find(e=>e.problem)?.problem||null;return(0,G.jsxs)(`div`,{className:`play-bar`,role:`group`,"aria-label":`Play main`,children:[(0,G.jsxs)(`div`,{className:`play-facts`,children:[f.filter(e=>e.ok).map(e=>(0,G.jsx)(`span`,{className:`mono small`,children:Mc(e,Fc(d,f))},`${e.build}.${e.profile}`)),(t===`build`||f.some(e=>e.building))&&(0,G.jsxs)(`span`,{className:`small`,role:`status`,children:[(0,G.jsx)(`span`,{className:`dot pulse`,"aria-hidden":`true`}),` Building…`]}),y&&(0,G.jsx)(`span`,{className:`error-text small play-why`,role:`alert`,title:y,children:y}),p&&(0,G.jsxs)(`span`,{className:`ok-text small`,role:`status`,children:[`Main plays on `,p.target,` · `,p.url??p.open]}),r&&!p&&(0,G.jsx)(`span`,{className:`small`,role:`status`,children:r})]}),(0,G.jsxs)(`div`,{className:`play-acts`,children:[d.targets.map(e=>(0,G.jsx)(`button`,{className:`btn-line`,disabled:_,title:`The checkout as it is, uncommitted edits too: built first when its code has no build`,onClick:()=>void h(e),children:t===`play:${e.name}`?`Starting…`:Cc(d.targets,e.name,!0)},e.name)),(0,G.jsx)(`button`,{className:`btn-line`,disabled:_,title:`Build the checkout as it is now, without starting it`,onClick:()=>void g(),children:t===`build`?`Building…`:`Build main`}),y&&s.s&&(0,G.jsx)(`button`,{className:`btn-agent`,disabled:s.off,title:s.tip,onClick:()=>void s.go({text:Tc(d,y)}),children:`Fix with agent`}),p&&(0,G.jsx)(`button`,{className:`btn-line`,disabled:!!t,onClick:()=>void m(`stop`,async()=>void await H.playStop(l.name)),children:`Stop`})]})]})}function zc(e){let t=typeof e.duration_ms==`number`?Math.round(e.duration_ms/6e4):null;return[typeof e.cost_usd==`number`?`$${e.cost_usd.toFixed(2)}`:``,t===null?``:t<60?`${t} min`:`${Math.floor(t/60)} h ${String(t%60).padStart(2,`0`)} min`,e.dod?`DoD ${e.dod}`:``,e.review?`review ${e.review}`:``,e.commit?`main ${e.commit}`:``,e.unticked?`${e.unticked} plan task${e.unticked>1?`s`:``} unticked`:``,e.lessons?`${e.lessons} lesson${e.lessons>1?`s`:``} to the Inbox`:``].filter(Boolean)}var Bc={Question:`the question`,Try:`What to try`};function Vc(e){switch(e.kind){case`no_notes`:return`The run left no Play notes: the question has no notes, what to try comes from the card`;case`section_unknown`:return`The notes have a section the board does not know: ${e.section??``}`;case`section_empty`:return`The agent left ${Bc[e.section??``]??e.section} empty`;case`row_template`:return`The row ${e.row??``} does not follow the template`;case`row_unknown`:return`The card has no row ${e.row??``}`;case`row_missing`:return`The row ${e.row??``} has no note from the agent`;case`no_criterion`:return`The card has no miss criterion: the question is the agent's`;default:return e.text}}var Hc=e=>e.warned??e.warnings.map(e=>({kind:``,text:e})),Uc=/[\p{L}\p{N}]+/gu;function Wc(e,t){if(!t)return e;let n=t.toLowerCase().match(Uc)??[];if(!n.length)return e;let r=[...e.matchAll(Uc)];if(r.length<n.length)return e;for(let t=0;t<n.length;t++)if(r[t][0].toLowerCase()!==n[t])return e;if(r.length===n.length)return null;let i=r[n.length-1],a=e.slice(i.index+i[0].length).replace(/^[\s\p{P}]+/u,``).trim();return a?`…${a}`:null}function Gc(e){if(typeof e==`string`&&/^[a-z]{2,3}(-|$)/i.test(e.trim()))try{return Intl.getCanonicalLocales(e.trim())[0]}catch{return}}var Kc=e=>e?new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):``;function qc(e){let t=e.outcome.build,n=[];return t?.building?n.push(`the build is being made`):t?.ok&&t.stale?n.push(`the build is old: the rebuild failed — ${t.problem??``}`):t?.ok?n.push(`built ${[t.name,t.profile].filter(Boolean).join(` · `)} ${Kc(t.built_at)}`):t?.problem?n.push(`no build: ${t.problem.split(`
45
- `)[0]}`):e.play&&n.push(`no build yet: Play builds it first`),e.outcome.queued!==null&&n.push(`a build waits in the queue (ticket ${e.outcome.queued})`),n}var Jc={"awaiting-verdict":`Ready for a verdict`,"awaiting-decision":`Waits for a decision`},Yc={ready:`a device is there and Play starts it`,built:`built: Play on a device the target finds`,"not built":`this build is not made yet: Play builds it first, then starts`,"not set up":`no target serves this row: Set up`,"not detected":`the target has no devices script: Play starts the server and shows the address`},Xc=(e,t)=>!!t&&e.device===t?.device&&(e.os??null)===(t?.os??null)&&(e.os_min??null)===(t?.os_min??null),Zc={debug:`The default: a development build, with its logs`,release:`The build players get; Play builds it first if it is not made`};function Qc(e,t){let n=e.built.find(e=>e.building);if(n)return`building ${n.profile}…`;if(e.built.some(e=>e.profile===t&&e.ok))return`✓ built · ${t}`;let r=e.built.filter(e=>e.ok).map(e=>e.profile);return r.length?`○ ${t} not built · ${r.join(`, `)} built`:`○ No build of this card yet`}function $c(e,t){let[n,r]=(0,v.useState)({}),[i,a]=(0,v.useState)(null),o=t.filter(e=>e.devices).map(e=>e.name),s=o.join(`,`),c=(0,v.useCallback)(()=>{a(new Date().toISOString());for(let t of s?s.split(`,`):[])r(e=>({...e,[t]:`asking`})),H.playDevices(e.project.name,t).then(e=>r(n=>({...n,[t]:e}))).catch(e=>r(n=>({...n,[t]:{problem:e.message}})))},[e.project.name,s]);return(0,v.useEffect)(()=>c(),[c]),{asked:n,at:i,ask:c,any:o.length>0}}function el({ctx:e,id:t,build:n,row:r,play:i,asked:a,start:o,busy:s,profile:c,lang:l}){let u=kc(e,`play-setup`,!0),d=fi(e.board.domain,`play-setup`),f=i.targets.find(e=>e.name===r.target)??null,p=r.target?a[r.target]:void 0,m=[r.device===`any`?r.target:r.device,r.os,r.os_min&&`${r.os_min}+`,r.input?.join(`, `)].filter(Boolean).join(` · `),h=r.status===`not built`,g=h?`Build${c===`release`?` release`:``}, then play`:`Play`,_=p&&p!==`asking`&&`devices`in p?p.devices.filter(e=>Xc(r,p.rows[e.row??-1])):[];return(0,G.jsxs)(`div`,{className:`ho-row`,children:[(0,G.jsxs)(`div`,{className:`ho-row-head`,children:[(0,G.jsx)(`span`,{className:`ho-row-label`,children:m}),(0,G.jsx)(`span`,{className:`ho-status`,title:Yc[r.status],children:r.status})]}),(0,G.jsxs)(`div`,{className:`ho-row-body`,children:[_.map(e=>(0,G.jsxs)(`div`,{className:`ho-dev`,children:[(0,G.jsx)(`span`,{className:`ho-dev-name`,children:e.name}),(0,G.jsxs)(`span`,{className:`dim small`,children:[[e.os,e.os_version].filter(Boolean).join(` `),` · `,e.play?`ready`:e.why??e.note??e.state]}),e.play&&e.id&&(0,G.jsxs)(`button`,{className:`btn-primary ho-go`,disabled:!!s,title:h?`Builds this card first, then starts it here`:f?.open,onClick:()=>o(r.target??``,e.id,`${n} on ${e.name}`),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`▶ `}),s===`${r.target}:${e.id}`?`Starting…`:g]})]},e.id??e.name)),p===`asking`&&(0,G.jsx)(`span`,{className:`dim small`,children:`asking the devices…`}),p&&p!==`asking`&&`unavailable`in p&&p.unavailable&&(0,G.jsx)(`span`,{className:`dim small`,children:p.unavailable}),p&&p!==`asking`&&p.problem&&(0,G.jsxs)(`div`,{className:`ho-fail`,children:[(0,G.jsx)(`span`,{className:`error-text small`,children:p.problem}),`tail`in p&&p.tail&&(0,G.jsx)(`code`,{className:`ho-tail`,children:p.tail})]}),p&&p!==`asking`&&`devices`in p&&!_.length&&!p.unavailable&&!p.problem&&(0,G.jsx)(`span`,{className:`dim small`,children:`no device: plug one in, then Refresh`}),r.status!==`not set up`&&r.target&&(!f?.devices||r.device===`any`)&&(0,G.jsxs)(`div`,{className:`ho-dev`,children:[r.devices[0]&&(0,G.jsx)(`span`,{className:`ho-dev-name`,children:r.devices[0].name}),r.address&&(0,G.jsx)(`span`,{className:`mono small`,children:r.address}),(0,G.jsxs)(`button`,{className:`btn-primary ho-go`,disabled:!!s,title:f?.open,onClick:()=>o(r.target??``,null,`${n} on ${r.target}`),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`▶ `}),s===`${r.target}:`?`Starting…`:g]})]}),r.status===`not set up`&&(u.s||d)&&(0,G.jsx)(`button`,{className:`btn-agent ho-setup`,disabled:u.s?u.off:!1,title:`Set up a target that plays this row`,onClick:()=>u.s?void u.go({}):d&&e.openMove({title:`How to play this project`,move:d}),children:`✦ Set up`}),r.note&&(0,G.jsx)(`span`,{className:`ho-note`,lang:l,children:r.note})]})]})}function tl({ctx:e,id:t,h:n,play:r,lang:i}){let[a,o]=(0,v.useState)(``),s=e.board.items.find(e=>e.id===t)?.builds??[],c=r.running?.id===t?r.running:null,l=()=>void H.playStop(e.project.name).catch(t=>e.notify(t.message,`error`)),u=(n,r)=>{o(`build`),H.playBuild(e.project.name,t,!0,n,r).then(n=>{!n.ok&&!n.moved_on&&e.notify(`The build of ${t} failed`,`error`)}).catch(t=>e.notify(t.message,`error`)).finally(()=>o(``))},[d,f]=(0,v.useState)(``),p=new Set((n.play??[]).flatMap(e=>e.rows.map(e=>e.target))),m=$c(e,r.targets.filter(e=>p.has(e.name))),h=(r.queue??[]).filter(e=>e.job.build===t),[g,_]=(0,v.useState)({}),[y,b]=(0,v.useState)(``),x=kc(e,`play-fix`),S=(n,i,a,s)=>{o(`${n}:${i??``}`),f(``),b(``),Oc({open:r.targets.find(e=>e.name===n)?.open??``},()=>H.playStart(e.project.name,t,n,i,s)).then(e=>{f(e.state===`launched`?`✓ started ${a}`:`${a}: ${e.url??e.open}`)}).catch(e=>b(e.message)).finally(()=>o(``))};return(0,G.jsxs)(`section`,{className:`ho-play`,role:`group`,"aria-label":`Play ${t}`,children:[(0,G.jsxs)(`div`,{className:`ho-play-head`,children:[(0,G.jsx)(`span`,{className:`ho-h`,children:`Play`}),m.any&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`dim small`,children:m.at?`devices asked ${Kc(m.at)}`:``}),(0,G.jsx)(`button`,{className:`link-btn small`,onClick:m.ask,title:`Asks the devices again`,children:`⟳ Refresh`})]})]}),h.map(t=>(0,G.jsxs)(`div`,{className:`ho-queue`,role:`status`,children:[(0,G.jsxs)(`span`,{className:`small`,children:[t.job.of?`${t.job.of} · ${t.job.profile??`debug`} · `:``,t.building?`building`:`waits${t.after?`: after ${t.after}`:``}`,t.job.start?`, then plays on ${t.job.start.target}`:``]}),(0,G.jsx)(`button`,{className:`btn-line small`,title:t.building?`Stops the build: a stopped build may leave the engine cache in a bad state`:`Takes the build out of the queue`,onClick:()=>void H.playCancel(e.project.name,t.ticket).catch(t=>e.notify(t.message,`error`)),children:t.building?`Stop`:`Cancel`})]},t.ticket)),(n.play??[]).map(n=>{let o=g[n.build]??`debug`,d=n.built.some(e=>e.profile===o&&e.ok),f=e=>d||e.status===`not set up`||e.status===`not built`?e:{...e,status:`not built`},p=s.find(e=>e.build===n.build&&e.profile===o&&e.ok),h=p?[p.commit?.slice(0,7),p.built_at&&new Date(p.built_at).toLocaleString([],{dateStyle:`short`,timeStyle:`short`}),typeof p.size==`number`&&jc(p.size)].filter(Boolean).join(` · `):``,v=c&&n.rows.some(e=>e.target===c.target);return(0,G.jsxs)(`div`,{className:`ho-group`,children:[(0,G.jsxs)(`div`,{className:`ho-group-head`,children:[(0,G.jsx)(`span`,{className:`ho-group-name`,children:n.build}),(0,G.jsx)(`span`,{className:`dim small`,children:Qc(n,o)}),h&&(0,G.jsx)(`span`,{className:`mono small dim`,title:`The build's commit, when it was made, its size`,children:h}),n.profiles.length>1?(0,G.jsx)(`span`,{role:`radiogroup`,"aria-label":`Profile of ${n.build}`,className:`seg ho-prof`,children:n.profiles.map(e=>(0,G.jsxs)(`button`,{role:`radio`,"aria-checked":e===o,className:`seg-btn`,title:Zc[e],onClick:()=>_(t=>({...t,[n.build]:e})),children:[e,n.built.some(t=>t.profile===e&&t.ok)?` ✓`:``]},e))}):(0,G.jsx)(`span`,{className:`dim small ho-prof`,title:`This build has one command: no release`,children:`one profile`}),(0,G.jsx)(Pc,{ctx:e,play:r,problem:n.built.find(e=>e.problem)?.problem??null,rebuild:p?()=>u(n.build,o):void 0,off:!!a||n.built.some(e=>e.building)})]}),n.built.some(e=>e.building&&e.cold)&&(0,G.jsx)(`span`,{className:`dim small`,children:`First build in the build folder: every asset is imported, it takes long.`}),n.rows.map((s,c)=>(0,G.jsx)(el,{ctx:e,id:t,build:n.build,row:f(s),play:r,asked:m.asked,start:(e,t,n)=>S(e,t,n,o),busy:a,profile:o,lang:i},c)),v&&(0,G.jsxs)(`div`,{className:`ho-playing`,role:`status`,children:[(0,G.jsxs)(`span`,{className:`ok-text small`,children:[`Playing on `,c.target,c.url?(0,G.jsxs)(G.Fragment,{children:[` · `,(0,G.jsx)(`a`,{href:c.url,target:`_blank`,rel:`noreferrer`,children:c.url.replace(/^https?:\/\//,``)})]}):` · ${c.open}`]}),(0,G.jsx)(`button`,{className:`btn-line small`,title:`Stops the player: the build stays`,onClick:l,children:`Stop`})]})]},n.build)}),c&&!(n.play??[]).some(e=>e.rows.some(e=>e.target===c.target))&&(0,G.jsxs)(`div`,{className:`ho-playing`,role:`status`,children:[(0,G.jsxs)(`span`,{className:`ok-text small`,children:[`Playing on `,c.target,` · `,c.url??c.open]}),(0,G.jsx)(`button`,{className:`btn-line small`,title:`Stops the player: the build stays`,onClick:l,children:`Stop`})]}),(n.unplaced??[]).length>0&&(0,G.jsxs)(`div`,{className:`ho-unplaced`,role:`group`,"aria-label":`Notes on no row`,children:[(0,G.jsx)(`span`,{className:`dim small`,children:`On no row: the agent's notes as written`}),n.unplaced.map((e,t)=>(0,G.jsxs)(`p`,{lang:i,children:[e.row&&(0,G.jsxs)(`b`,{children:[e.row,`: `]}),e.text]},t))]}),d&&(0,G.jsx)(`span`,{className:`small`,role:`status`,children:d}),y&&(0,G.jsxs)(`div`,{className:`ho-fail`,children:[(0,G.jsx)(`span`,{className:`error-text small`,role:`alert`,children:y}),x.s&&(0,G.jsx)(`button`,{className:`btn-agent`,disabled:x.off,title:x.tip,onClick:()=>void x.go({text:Tc(r,y)}),children:`Fix with agent`})]})]})}function nl({h:e,end:t}){let n=e.technical,r=t?zc(t):[],i=[[`code at`,n.commit?.slice(0,7)??``],[`snapshot`,n.code??``],[`unticked`,n.unticked===null?``:String(n.unticked)],[`the run`,r.join(` · `)],[`its move`,t?.move??``]].filter(([,e])=>e);return!i.length&&!n.passes.length&&!n.notes?null:(0,G.jsxs)(`details`,{className:`ho-tech`,children:[(0,G.jsxs)(`summary`,{children:[`Technical`,(0,G.jsx)(`span`,{className:`dim small`,children:[n.commit?.slice(0,7),...r.filter(e=>!e.startsWith(`main `)),n.passes.length&&`${n.passes.length} plan passes`].filter(Boolean).join(` · `)})]}),(0,G.jsx)(`div`,{className:`ho-tech-rows`,children:i.map(([e,t])=>(0,G.jsxs)(`span`,{className:`ho-tech-row`,children:[(0,G.jsx)(`span`,{className:`dim`,children:e}),` `,(0,G.jsx)(`span`,{className:`mono`,children:t})]},e))}),n.passes.length>0&&(0,G.jsxs)(`div`,{className:`ho-passes`,role:`table`,"aria-label":`Plan passes`,children:[(0,G.jsx)(`span`,{className:`dim`,children:`plan pass`}),(0,G.jsx)(`span`,{className:`dim`,children:`blocking`}),(0,G.jsx)(`span`,{className:`dim`,children:`polish`}),n.passes.map(e=>(0,G.jsxs)(`span`,{role:`row`,className:`ho-pass`,children:[(0,G.jsx)(`span`,{children:e.pass}),(0,G.jsx)(`span`,{children:e.blocking}),(0,G.jsx)(`span`,{children:e.polish})]},e.pass))]}),n.notes&&(0,G.jsxs)(`div`,{className:`ho-notes`,children:[(0,G.jsx)(`span`,{className:`dim small`,children:`the agent's notes`}),(0,G.jsx)(`p`,{children:n.notes})]})]})}function rl({ctx:e,id:t,lead:n}){return e.board.items.find(e=>e.id===t)?.handoff?(0,G.jsx)(il,{ctx:e,id:t,lead:n}):(0,G.jsx)(Lc,{ctx:e,id:t})}function il({ctx:e,id:t,lead:n}){let r=e.board.items.find(e=>e.id===t),i=r?.handoff;if(!i)return null;let a=e.board.play,o=i.try?.length?i.try:i.try===null?[]:i.try_from_behavior,s=Gc(e.board.settings?.find(e=>e.key===`language.ui`)?.value),c=i.outcome.word===`awaiting-decision`,l=Hc(i),u=i.question.has_criterion?i.question.notes.map(e=>Wc(e,i.question.criterion)).filter(e=>!!e):i.question.notes.slice(1);return(0,G.jsxs)(`div`,{className:`handoff`,role:`group`,"aria-label":`The handoff`,children:[(0,G.jsxs)(`div`,{className:`ho-out`,children:[(0,G.jsxs)(`div`,{className:`ho-out-head`,children:[(0,G.jsx)(`strong`,{children:Jc[i.outcome.word]??i.outcome.word}),(0,G.jsx)(`span`,{className:`dim small`,title:`The card's status word`,children:i.outcome.word})]}),qc(i).map((e,t)=>(0,G.jsx)(`span`,{className:`small ho-out-line`,children:e},`${t}:${e}`)),l.length>0&&(0,G.jsxs)(`div`,{className:`ho-warns`,role:`note`,"aria-label":`The handoff has problems`,children:[l.map((e,t)=>(0,G.jsxs)(`span`,{className:`small ho-warn`,title:e.text,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`▲ `}),Vc(e)]},`${t}:${e.text}`)),i.play&&e.board.play&&l.some(e=>e.kind===`row_template`||e.kind===`row_unknown`)&&(0,G.jsx)(`span`,{className:`dim small`,children:`So Play cannot place their notes on a row: they are kept under Play, as the agent wrote them.`})]})]}),(0,G.jsxs)(`section`,{className:`ho-question`,"aria-label":`The question`,children:[(0,G.jsx)(`span`,{className:`ho-h`,children:c?`The decision`:`The main question`}),(0,G.jsx)(`span`,{className:`ho-q`,title:i.question.has_criterion?`The card's miss criterion, word for word`:void 0,lang:i.question.criterion===null?s:void 0,children:i.question.criterion??i.question.notes[0]??``}),!i.question.has_criterion&&(0,G.jsx)(`span`,{className:`warn-text small`,children:`this card has no miss criterion`}),u.length>0&&(0,G.jsx)(`ul`,{className:`ho-list`,lang:s,children:u.map(e=>(0,G.jsx)(`li`,{children:e},e))}),(n||c)&&(0,G.jsxs)(`div`,{className:`ho-q-foot`,children:[(0,G.jsx)(`span`,{className:`dim small`,children:c?`Decide it in its form`:`Play it below, then answer this question.`}),n&&(0,G.jsx)(`button`,{className:`btn-primary`,title:n.tip,onClick:n.on,children:n.label})]})]}),i.play&&a&&(0,G.jsx)(tl,{ctx:e,id:t,h:i,play:a,lang:s}),i.changed.length>0&&(0,G.jsxs)(`section`,{className:`ho-sec`,"aria-label":`What changed`,children:[(0,G.jsx)(`span`,{className:`ho-h`,children:`What changed`}),(0,G.jsx)(`ul`,{className:`ho-list`,children:i.changed.map((e,t)=>(0,G.jsx)(`li`,{children:e},`${t}:${e}`))})]}),o.length>0&&(0,G.jsxs)(`section`,{className:`ho-sec`,"aria-label":`What to try`,children:[(0,G.jsx)(`span`,{className:`ho-h`,children:`What to try`}),!i.try?.length&&(0,G.jsx)(`span`,{className:`dim small`,children:`from the card's behavior`}),(0,G.jsx)(`ol`,{className:`ho-list`,lang:i.try?.length?s:void 0,children:o.map((e,t)=>(0,G.jsx)(`li`,{children:e},`${t}:${e}`))})]}),i.attention.length>0&&(0,G.jsxs)(`section`,{className:`ho-sec`,"aria-label":`Watch out`,children:[(0,G.jsx)(`span`,{className:`ho-h`,children:`Watch out`}),i.attention.map((e,t)=>(0,G.jsxs)(`span`,{className:`warn-text small`,lang:s,children:[`▲ `,e]},`${t}:${e}`))]}),i.waits.length>0&&(0,G.jsxs)(`section`,{className:`ho-sec`,"aria-label":`Waits for a decision`,children:[(0,G.jsx)(`span`,{className:`ho-h`,children:`Waits for a decision`}),i.waits.map(t=>(0,G.jsxs)(`div`,{className:`ho-wait`,children:[(0,G.jsx)(`span`,{className:`dim small`,children:t.kind}),(0,G.jsx)(`span`,{children:t.text}),t.kind===`question`&&(0,G.jsxs)(`button`,{className:`link-btn small`,onClick:()=>e.go(`inbox`),children:[`Answer `,t.id]})]},`${t.kind}:${t.id??t.text}`))]}),(0,G.jsx)(nl,{h:i,end:r.run_end??null})]})}function al(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var ol=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sl=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cl={};function ll(e,t){return((t||cl).jsx?sl:ol).test(e)}var ul=/[ \t\n\f\r]/g;function dl(e){return typeof e==`object`?e.type===`text`&&fl(e.value):fl(e)}function fl(e){return e.replace(ul,``)===``}var pl=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};pl.prototype.normal={},pl.prototype.property={},pl.prototype.space=void 0;function ml(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new pl(n,r,t)}function hl(e){return e.toLowerCase()}var gl=class{constructor(e,t){this.attribute=t,this.property=e}};gl.prototype.attribute=``,gl.prototype.booleanish=!1,gl.prototype.boolean=!1,gl.prototype.commaOrSpaceSeparated=!1,gl.prototype.commaSeparated=!1,gl.prototype.defined=!1,gl.prototype.mustUseProperty=!1,gl.prototype.number=!1,gl.prototype.overloadedBoolean=!1,gl.prototype.property=``,gl.prototype.spaceSeparated=!1,gl.prototype.space=void 0;var _l=s({boolean:()=>J,booleanish:()=>yl,commaOrSpaceSeparated:()=>Sl,commaSeparated:()=>xl,number:()=>Y,overloadedBoolean:()=>bl,spaceSeparated:()=>X}),vl=0,J=Cl(),yl=Cl(),bl=Cl(),Y=Cl(),X=Cl(),xl=Cl(),Sl=Cl();function Cl(){return 2**++vl}var wl=Object.keys(_l),Tl=class extends gl{constructor(e,t,n,r){let i=-1;if(super(e,t),El(this,`space`,r),typeof n==`number`)for(;++i<wl.length;){let e=wl[i];El(this,wl[i],(n&_l[e])===_l[e])}}};Tl.prototype.defined=!0;function El(e,t,n){n&&(e[t]=n)}function Dl(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Tl(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[hl(r)]=r,n[hl(a.attribute)]=r}return new pl(t,n,e.space)}var Ol=Dl({properties:{ariaActiveDescendant:null,ariaAtomic:yl,ariaAutoComplete:null,ariaBusy:yl,ariaChecked:yl,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:X,ariaCurrent:null,ariaDescribedBy:X,ariaDetails:null,ariaDisabled:yl,ariaDropEffect:X,ariaErrorMessage:null,ariaExpanded:yl,ariaFlowTo:X,ariaGrabbed:yl,ariaHasPopup:null,ariaHidden:yl,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:X,ariaLevel:Y,ariaLive:null,ariaModal:yl,ariaMultiLine:yl,ariaMultiSelectable:yl,ariaOrientation:null,ariaOwns:X,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:yl,ariaReadOnly:yl,ariaRelevant:null,ariaRequired:yl,ariaRoleDescription:X,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:yl,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function kl(e,t){return t in e?e[t]:t}function Al(e,t){return kl(e,t.toLowerCase())}var jl=Dl({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:xl,acceptCharset:X,accessKey:X,action:null,allow:null,allowFullScreen:J,allowPaymentRequest:J,allowUserMedia:J,alpha:J,alt:null,as:null,async:J,autoCapitalize:null,autoComplete:X,autoFocus:J,autoPlay:J,blocking:X,capture:null,charSet:null,checked:J,cite:null,className:X,closedBy:null,colorSpace:null,cols:Y,colSpan:Y,command:null,commandFor:null,content:null,contentEditable:yl,controls:J,controlsList:X,coords:Y|xl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:J,defer:J,dir:null,dirName:null,disabled:J,download:bl,draggable:yl,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:J,formTarget:null,headers:X,height:Y,hidden:bl,high:Y,href:null,hrefLang:null,htmlFor:X,httpEquiv:X,id:null,imageSizes:null,imageSrcSet:null,inert:J,inputMode:null,integrity:null,is:null,isMap:J,itemId:null,itemProp:X,itemRef:X,itemScope:J,itemType:X,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:J,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:J,muted:J,name:null,nonce:null,noModule:J,noValidate:J,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:J,optimum:Y,pattern:null,ping:X,placeholder:null,playsInline:J,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:J,referrerPolicy:null,rel:X,required:J,reversed:J,rows:Y,rowSpan:Y,sandbox:X,scope:null,scoped:J,seamless:J,selected:J,shadowRootClonable:J,shadowRootCustomElementRegistry:J,shadowRootDelegatesFocus:J,shadowRootMode:null,shadowRootSerializable:J,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:yl,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:J,useMap:null,value:yl,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:X,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:J,declare:J,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:J,noHref:J,noShade:J,noWrap:J,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:yl,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:J,disablePictureInPicture:J,disableRemotePlayback:J,exportParts:xl,part:X,prefix:null,property:null,results:Y,security:null,unselectable:null},space:`html`,transform:Al}),Ml=Dl({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:Sl,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:X,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:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:J,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,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:xl,g2:xl,glyphName:xl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:Sl,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,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:Y,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:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:X,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Sl,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Sl,rev:Sl,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Sl,requiredFeatures:Sl,requiredFonts:Sl,requiredFormats:Sl,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:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:Sl,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Sl,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Sl,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:kl}),Nl=Dl({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()}}),Pl=Dl({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Al}),Fl=Dl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Il={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`},Ll=/[A-Z]/g,Rl=/-[a-z]/g,zl=/^data[-\w.:]+$/i;function Bl(e,t){let n=hl(t),r=t,i=gl;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&zl.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Rl,Hl);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Rl.test(e)){let n=e.replace(Ll,Vl);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Tl}return new i(r,t)}function Vl(e){return`-`+e.toLowerCase()}function Hl(e){return e.charAt(1).toUpperCase()}var Ul=ml([Ol,jl,Nl,Pl,Fl],`html`),Wl=ml([Ol,Ml,Nl,Pl,Fl],`svg`);function Gl(e){return e.join(` `).trim()}var Kl=/\/\*(?:[^*]|\*(?!\/))*\*\//g,ql=/\n/g,Jl=/^\s*/,Yl=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Xl=/^:\s*/,Zl=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,Ql=/^[;\s]*/,$l=`
46
- `,eu=`/`,tu=`*`,nu=``,ru=`comment`,iu=`declaration`;function au(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(ql);t&&(n+=t.length);var i=e.lastIndexOf($l);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(Jl)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(eu==e.charAt(0)&&tu==e.charAt(1)){for(var n=2;nu!=e.charAt(n)&&(tu!=e.charAt(n)||eu!=e.charAt(n+1));)++n;if(n+=2,nu===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:ru,comment:o})}}function f(){var e=a(),t=c(Yl);if(t){if(d(),!c(Xl))return s(`property missing ':'`);var n=c(Zl),r=e({type:iu,property:t[0].replace(Kl,nu).trim(),value:n?n[0].replace(Kl,nu).trim():nu});return c(Ql),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function ou(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=au(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n??={},n[r]=a)}),n}var su=lu(`end`),cu=lu(`start`);function lu(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 uu(e){let t=cu(e),n=su(e);if(t&&n)return{start:t,end:n}}function du(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?pu(e.position):`start`in e||`end`in e?pu(e):`line`in e||`column`in e?fu(e):``}function fu(e){return mu(e&&e.line)+`:`+mu(e&&e.column)}function pu(e){return fu(e&&e.start)+`-`+fu(e&&e.end)}function mu(e){return e&&typeof e==`number`?e:1}var hu=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){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=du(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}};Object.defineProperties(hu.prototype,{file:{configurable:!0,enumerable:!0,value:``,writable:!0},name:{configurable:!0,enumerable:!0,value:``,writable:!0},reason:{configurable:!0,enumerable:!0,value:``,writable:!0},message:{configurable:!0,enumerable:!0,value:``,writable:!0},stack:{configurable:!0,enumerable:!0,value:``,writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});var gu={}.hasOwnProperty,_u=new Map,vu=/[A-Z]/g,yu=/-([a-z])/g,bu=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),xu=new Set([`td`,`th`]),Su=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Cu(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=Pu(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=Nu(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`?Wl:Ul,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=wu(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function wu(e,t,n){if(t.type===`element`)return Tu(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Eu(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Ou(e,t,n);if(t.type===`mdxjsEsm`)return Du(e,t);if(t.type===`root`)return ku(e,t,n);if(t.type===`text`)return Au(e,t)}function Tu(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Wl,e.schema=i),e.ancestors.push(t);let a=Bu(e,t.tagName,!1),o=Fu(e,t),s=Lu(e,t);return bu.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!dl(e)})),ju(e,o,a,t),Mu(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Eu(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)}Vu(e,t.position)}function Du(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Vu(e,t.position)}function Ou(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Wl,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Bu(e,t.name,!0),o=Iu(e,t),s=Lu(e,t);return ju(e,o,a,t),Mu(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ku(e,t,n){let r={};return Mu(r,Lu(e,t)),e.create(t,e.Fragment,r,n)}function Au(e,t){return t.value}function ju(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Mu(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Nu(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 Pu(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=cu(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 Fu(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&gu.call(t.properties,i)){let a=Ru(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&xu.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 Iu(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 Vu(e,t.position)}else{let{name:i}=r,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 Vu(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Lu(e,t){let n=[],r=-1,i=e.passKeys?new Map:_u;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=wu(e,a,o);s!==void 0&&n.push(s)}return n}function Ru(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=Bl(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?al(n):Gl(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:Hu(n):zu(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?Il[r.property]||r.property:r.attribute,n]}function zu(e,t){let n={};try{ou(t,function(t,r){if(t&&r){let i=t;i.slice(0,2)!==`--`&&(i=i.toLowerCase(),e.stylePropertyNameCase===`dom`&&(i.slice(0,4)===`-ms-`&&(i=i.slice(1)),i=i.replace(yu,Gu))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new hu("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=Su+`#cannot-parse-style-attribute`,r}return n}function Bu(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=ll(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=ll(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return gu.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Vu(e)}function Vu(e,t){let n=new hu("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=Su+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Hu(e){let t={},n;for(n in e)gu.call(e,n)&&(t[Uu(n)]=e[n]);return t}function Uu(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(vu,Wu);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Wu(e){return`-`+e.toLowerCase()}function Gu(e,t){return t.toUpperCase()}var Ku={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`]},qu={};function Ju(e,t){let n=t||qu;return Yu(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Yu(e,t,n){if(Zu(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 Xu(e.children,t,n)}return Array.isArray(e)?Xu(e,t,n):``}function Xu(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Yu(e[i],t,n);return r.join(``)}function Zu(e){return!!(e&&typeof e==`object`)}var Qu=document.createElement(`i`);function $u(e){let t=`&`+e+`;`;Qu.innerHTML=t;let n=Qu.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function ed(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 td(e,t){return e.length>0?(ed(e,e.length,0,t),e):t}var nd={}.hasOwnProperty;function rd(e){let t={},n=-1;for(;++n<e.length;)id(t,e[n]);return t}function id(e,t){let n;for(n in t){let r=(nd.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){nd.call(r,a)||(r[a]=[]);let e=i[a];ad(r[a],Array.isArray(e)?e:e?[e]:[])}}}function ad(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);ed(e,0,0,r)}function od(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 sd(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var cd=vd(/[A-Za-z]/),ld=vd(/[\dA-Za-z]/),ud=vd(/[#-'*+\--9=?A-Z^-~]/);function dd(e){return e!==null&&(e<32||e===127)}var fd=vd(/\d/),pd=vd(/[\dA-Fa-f]/),md=vd(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function hd(e){return e!==null&&(e<0||e===32)}function Q(e){return e===-2||e===-1||e===32}var gd=vd(/\p{P}|\p{S}/u),_d=vd(/\s/);function vd(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function yd(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&ld(e.charCodeAt(n+1))&&ld(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 $(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Q(r)?(e.enter(n),s(r)):t(r)}function s(r){return Q(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function bd(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&Q(t)?(e.enter(r),c(t)):l(t)}function c(t){return Q(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var xd={tokenize:Sd};function Sd(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),$(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);else return Z(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Cd=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){wd(this,e,t,n,!1)}addBefore(e,t,n){wd(this,e,t,n,!0)}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,this.index.clear()}};function wd(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var Td={tokenize:Dd},Ed={tokenize:Od};function Dd(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++;let c=new Cd;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),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(Ed,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(Ed,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);else 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);else return Z(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++;let l=new Cd;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}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 Od(e,t,n){return $(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function kd(e){if(e===null||hd(e)||_d(e))return 1;if(gd(e))return 2}function Ad(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 jd={name:`attention`,resolveAll:Md,tokenize:Nd};function Md(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};Pd(o,-a),Pd(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=td(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=td(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=td(r,Ad(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=td(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=td(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),ed(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Nd(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=kd(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=kd(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Pd(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Fd={name:`autolink`,tokenize:Id};function Id(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 cd(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||ld(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||ld(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||dd(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):ud(t)?(e.consume(t),l):n(t)}function u(e){return ld(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||ld(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Ld={partial:!0,tokenize:Rd};function Rd(e,t,n){return r;function r(t){return Q(t)?$(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Z(e)?t(e):n(e)}}var zd={continuation:{tokenize:Vd},exit:Hd,name:`blockQuote`,tokenize:Bd};function Bd(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 Q(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Vd(e,t,n){let r=this;return i;function i(t){return Q(t)?$(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(zd,t,n)(r)}}function Hd(e){e.exit(`blockQuote`)}var Ud={name:`characterEscape`,tokenize:Wd};function Wd(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 md(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Gd={name:`characterReference`,tokenize:Kd};function Kd(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=ld,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=pd,u):(e.enter(`characterReferenceValue`),a=7,o=fd,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===ld&&!$u(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 qd={partial:!0,tokenize:Jd};function Jd(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 Yd={concrete:!0,name:`codeFenced`,tokenize:Xd};function Xd(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`),Q(t)?$(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Z(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(qd,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),$(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Z(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Z(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&&Q(t)?$(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Z(t)?e.check(qd,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Z(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`),Q(t)?$(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`),Q(t)?$(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Z(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var Zd={name:`codeIndented`,tokenize:$d},Qd={partial:!0,tokenize:ef};function $d(e,t,n){return r;function r(t){return e.enter(`codeIndented`),bd(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):Z(t)?e.attempt(Qd,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||Z(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function ef(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Z(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):bd(e,t,a,`linePrefix`,4,4)(o)}function a(e){return Z(e)?i(e):n(e)}}var tf={name:`codeText`,previous:rf,resolve:nf,tokenize:af};function nf(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 rf(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function af(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)):Z(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||Z(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 of=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&&sf(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),sf(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),sf(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);sf(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);sf(this.left,t.reverse())}}}};function sf(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 cf(e){let t={},n=-1,r,i,a,o,s,c,l,u=new of(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,lf(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 ed(e,0,1/0,u.slice(0)),!l}function lf(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 uf={resolve:ff,tokenize:pf},df={partial:!0,tokenize:mf};function ff(e){return cf(e),e}function pf(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):Z(t)?e.check(df,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 mf(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$(e,a,`linePrefix`)}function a(i){if(i===null||Z(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 hf(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||dd(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||Z(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||hd(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||dd(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 gf(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):Z(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||Z(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Q(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function _f(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):Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Z(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 vf(e,t){let n;return r;function r(i){return Z(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Q(i)?$(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var yf={name:`definition`,tokenize:xf},bf={partial:!0,tokenize:Sf};function xf(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return gf.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=sd(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 hd(t)?vf(e,l)(t):l(t)}function l(t){return hf(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(bf,d,d)(t)}function d(t){return Q(t)?$(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Z(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Sf(e,t,n){return r;function r(t){return hd(t)?vf(e,i)(t):n(t)}function i(t){return _f(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Q(t)?$(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Z(e)?t(e):n(e)}}var Cf={name:`hardBreakEscape`,tokenize:wf};function wf(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Z(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Tf={name:`headingAtx`,resolve:Ef,tokenize:Df};function Ef(e,t){let n=e.length-2,r=3;if(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){let 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`};ed(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Df(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||hd(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Z(n)?(e.exit(`atxHeading`),t(n)):Q(n)?$(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||hd(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Of=`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(`.`),kf=[`pre`,`script`,`style`,`textarea`],Af={concrete:!0,name:`htmlFlow`,resolveTo:Mf,tokenize:Nf},jf={partial:!0,tokenize:Pf};function Mf(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 Nf(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:I):cd(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):cd(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):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 cd(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||hd(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&kf.includes(l)?(i=1,r.interrupt?t(s):O(s)):Of.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||ld(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 Q(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||cd(t)?(e.consume(t),b):Q(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||ld(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Q(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):Q(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Z(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||hd(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Q(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Z(t)?O(t):Q(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):Z(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(jf,ee,k)(t)):t===null||Z(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(qd,A,ee)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Z(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return kf.includes(n)?(e.consume(t),L):O(t)}return cd(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||Z(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),L)}function ee(n){return e.exit(`htmlFlow`),t(n)}}function Pf(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Ld,t,n)}}var Ff={name:`htmlText`,tokenize:If};function If(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):cd(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):cd(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):Z(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(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):Z(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):Z(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Z(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return cd(t)?(e.consume(t),S):n(t)}function S(t){return t===45||ld(t)?(e.consume(t),S):C(t)}function C(t){return Z(t)?(o=C,N(t)):Q(t)?(e.consume(t),C):M(t)}function w(t){return t===45||ld(t)?(e.consume(t),w):t===47||t===62||hd(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||cd(t)?(e.consume(t),E):Z(t)?(o=T,N(t)):Q(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||ld(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Z(t)?(o=D,N(t)):Q(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):Z(t)?(o=O,N(t)):Q(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):Z(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||hd(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||hd(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return Q(t)?$(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var Lf={name:`labelEnd`,resolveAll:Vf,resolveTo:Hf,tokenize:Uf},Rf={tokenize:Wf},zf={tokenize:Gf},Bf={tokenize:Kf};function Vf(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&&ed(e,0,e.length,n),e}function Hf(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=td(o,e.slice(i+1,i+r+3)),o=td(o,[[`enter`,l,t]]),o=td(o,Ad(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=td(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=td(o,e.slice(a+1)),o=td(o,[[`exit`,s,t]]),ed(e,i,e.length,o),e}function Uf(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(sd(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(Rf,u,o?u:d)(t):t===91?e.attempt(zf,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Bf,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function Wf(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 hd(t)?vf(e,a)(t):a(t)}function a(t){return t===41?u(t):hf(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return hd(t)?vf(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?_f(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return hd(t)?vf(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 Gf(e,t,n){let r=this;return i;function i(t){return gf.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(sd(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Kf(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 qf={name:`labelStartImage`,resolveAll:Lf.resolveAll,tokenize:Jf};function Jf(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Yf={name:`labelStartLink`,resolveAll:Lf.resolveAll,tokenize:Xf};function Xf(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Zf={name:`lineEnding`,tokenize:Qf};function Qf(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),$(e,t,`linePrefix`)}}var $f={name:`thematicBreak`,tokenize:ep};function ep(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||Z(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Q(t)?$(e,s,`whitespace`)(t):s(t))}}var tp={continuation:{tokenize:ap},exit:sp,name:`list`,tokenize:ip},np={partial:!0,tokenize:cp},rp={partial:!0,tokenize:op};function ip(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:fd(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($f,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 fd(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(Ld,r.interrupt?n:u,e.attempt(np,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Q(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 ap(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Ld,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Q(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(rp,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,$(e,e.attempt(tp,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function op(e,t,n){let r=this;return $(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 sp(e){e.exit(this.containerState.type)}function cp(e,t,n){let r=this;return $(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!Q(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var lp={name:`setextUnderline`,resolveTo:up,tokenize:dp};function up(e,t){let n=new Cd,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function dp(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`),Q(t)?$(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Z(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var fp={tokenize:pp};function pp(e){let t=this,n=e.attempt(Ld,r,e.attempt(this.parser.constructs.flowInitial,i,$(e,e.attempt(this.parser.constructs.flow,i,e.attempt(uf,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var mp={resolveAll:vp()},hp=_p(`string`),gp=_p(`text`);function _p(e){return{resolveAll:vp(e===`text`?yp: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);else 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 vp(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 yp(e,t){let n=new Cd,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var bp=s({attentionMarkers:()=>Op,contentInitial:()=>Sp,disable:()=>kp,document:()=>xp,flow:()=>wp,flowInitial:()=>Cp,insideSpan:()=>Dp,string:()=>Tp,text:()=>Ep}),xp={42:tp,43:tp,45:tp,48:tp,49:tp,50:tp,51:tp,52:tp,53:tp,54:tp,55:tp,56:tp,57:tp,62:zd},Sp={91:yf},Cp={[-2]:Zd,[-1]:Zd,32:Zd},wp={35:Tf,42:$f,45:[lp,$f],60:Af,61:lp,95:$f,96:Yd,126:Yd},Tp={38:Gd,92:Ud},Ep={[-5]:Zf,[-4]:Zf,[-3]:Zf,33:qf,38:Gd,42:jd,60:[Fd,Ff],91:Yf,92:[Cf,Ud],93:Lf,95:jd,96:tf},Dp={null:[jd,mp]},Op={null:[42,95]},kp={null:[]};function Ap(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=td(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Ad(a,l.events,l),l.events):[]}function f(e,t){return Mp(p(e),t)}function p(e){return jp(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(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){Z(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&&ed(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 jp(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 Mp(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=`
47
- `;break;case-3:o=`\r
48
- `;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 Np(e){let t={constructs:rd([bp,...(e||{}).extensions||[]]),content:n(xd),defined:[],document:n(Td),flow:n(fp),lazy:{},string:n(hp),text:n(gp)};return t;function n(e){return n;function n(n){return Ap(t,e,n)}}}function Pp(e){for(;!cf(e););return e}var Fp=/[\0\t\n\r]/g;function Ip(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){Fp.lastIndex=c;let n=Fp.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Lp=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Rp(e){return e.replace(Lp,zp)}function zp(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return od(n.slice(t?2:1),t?16:10)}return $u(n)||e}var Bp={}.hasOwnProperty;function Vp(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Hp(n)(Pp(Np(n).document().write(Ip()(e,t,!0))))}function Hp(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(de),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(W),blockQuote:o(H),characterEscape:E,characterReference:E,codeFenced:o(ae),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ae,s),codeText:o(oe,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(se),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(U),hardBreakEscape:o(ce),hardBreakTrailing:o(ce),htmlFlow:o(le,s),htmlFlowData:E,htmlText:o(le,s),htmlTextData:E,image:o(ue),label:s,link:o(de),listItem:o(pe),listItemValue:p,listOrdered:o(fe,f),listUnordered:o(fe),paragraph:o(me),reference:ne,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(W),strong:o(he),thematicBreak:o(_e)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:ie,autolinkProtocol:re,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:B,characterReference:V,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(P),label:I,labelText:F,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:R,resourceDestinationString:L,resourceTitleString:ee,resource:te,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};Wp(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),Bp.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||Kp).call(o,void 0,e[0])}for(r.position={start:Up(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Up(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];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 n=r;for(s=void 0;n--;){let t=e[n];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=n}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),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(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:Up(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+du({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Kp).call(this,e,r[0])),n.position.end=Up(e.end)}function d(){return Ju(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(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 m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){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 v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=sd(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=ge(),n.position={start:Up(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Up(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Up(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){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 P(){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 F(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Rp(t),n.identifier=sd(t).toLowerCase()}function I(){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 L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function te(){this.data.inReference=void 0}function ne(){this.data.referenceType=`collapsed`}function R(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=sd(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function z(e){this.data.characterReferenceType=e.type}function B(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=od(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=$u(t);let i=this.stack[this.stack.length-1];i.value+=r}function V(e){let t=this.stack.pop();t.position.end=Up(e.end)}function re(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ie(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function H(){return{type:`blockquote`,children:[],position:void 0}}function ae(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function oe(){return{type:`inlineCode`,value:``,position:void 0}}function se(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function U(){return{type:`emphasis`,children:[],position:void 0}}function W(){return{type:`heading`,depth:0,children:[],position:void 0}}function ce(){return{type:`break`,position:void 0}}function le(){return{type:`html`,value:``,position:void 0}}function ue(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function de(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function fe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function pe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function me(){return{type:`paragraph`,children:[],position:void 0}}function he(){return{type:`strong`,children:[],position:void 0}}function ge(){return{type:`text`,value:``,position:void 0}}function _e(){return{type:`thematicBreak`,position:void 0}}}function Up(e){return{line:e.line,column:e.column,offset:e.offset}}function Wp(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Wp(e,r):Gp(e,r)}}function Gp(e,t){let n;for(n in t)if(Bp.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`afterExit`:case`beforeEnter`:{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 Kp(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+du({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+du({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+du({start:t.start,end:t.end})+`) is still open`)}function qp(e){let t=this;t.parser=n;function n(n){return Vp(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Jp(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 Yp(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
49
- `}]}function Xp(e,t){let n=t.value?t.value+`
50
- `:``,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 Zp(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Qp(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $p(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=yd(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 em(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 tm(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function nm(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 rm(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nm(e,t);let i={src:yd(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 im(e,t){let n={src:yd(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 am(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 om(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nm(e,t);let i={href:yd(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 sm(e,t){let n={href:yd(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 cm(e,t,n){let r=e.all(t),i=n?lm(n):um(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:`
51
- `}),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:`
52
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function lm(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=um(n[r])}return t}function um(e){return e.spread??e.children.length>1}function dm(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 fm(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pm(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function mm(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hm(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=cu(t.children[1]),o=su(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 gm(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 _m(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var vm=9,ym=32;function bm(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(xm(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(xm(t.slice(i),i>0,!1)),a.join(``)}function xm(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===vm||t===ym;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===vm||t===ym;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Sm(e,t){let n={type:`text`,value:bm(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Cm(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var wm={blockquote:Jp,break:Yp,code:Xp,delete:Zp,emphasis:Qp,footnoteReference:$p,heading:em,html:tm,imageReference:rm,image:im,inlineCode:am,linkReference:om,link:sm,listItem:cm,list:dm,paragraph:fm,root:pm,strong:mm,table:hm,tableCell:_m,tableRow:gm,text:Sm,thematicBreak:Cm,toml:Tm,yaml:Tm,definition:Tm,footnoteDefinition:Tm};function Tm(){}var{defineProperty:Em}=Object,Dm=typeof self==`object`?self:globalThis,Om=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Dm[e](t)},km=(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){let i=r(t),a=r(n);i===`__proto__`?Em(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}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 Dm[e]==`function`?Om(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)}case`-0`:return-0}return n(Om(a,o),i)};return r},Am=e=>km(new Map,e)(0),jm=``,{toString:Mm}={},{keys:Nm,is:Pm}=Object,Fm=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Mm.call(e).slice(8,-1);switch(n){case`Array`:return[1,jm];case`Object`:return[2,jm];case`Date`:return[3,jm];case`RegExp`:return[4,jm];case`Map`:return[5,jm];case`Set`:return[6,jm];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Im=([e,t])=>e===0&&(t===`function`||t===`symbol`),Lm=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=Fm(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&Pm(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of Nm(o))(e||!Im(Fm(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?jm:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(Im(Fm(n))||Im(Fm(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!Im(Fm(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},Rm=(e,{json:t,lossy:n}={})=>{let r=[];return Lm(!(t||n),!!t,new Map,r)(e),r},zm=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Am(Rm(e,t)):structuredClone(e):(e,t)=>Am(Rm(e,t));function Bm(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 Vm(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Hm(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Bm,r=e.options.footnoteBackLabel||Vm,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=yd(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:{...zm(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
53
- `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
54
- `}]}}var Um=(function(e){if(e==null)return Jm;if(typeof e==`function`)return qm(e);if(typeof e==`object`)return Array.isArray(e)?Wm(e):Gm(e);if(typeof e==`string`)return Km(e);throw Error(`Expected function, string, or object as test`)});function Wm(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Um(e[n]);return qm(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Gm(e){let t=e;return qm(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Km(e){return qm(t);function t(t){return t&&t.type===e}}function qm(e){return t;function t(t,n,r){return!!(Ym(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Jm(){return!0}function Ym(e){return typeof e==`object`&&!!e&&`type`in e}function Xm(e){return e}var Zm=[],Qm=`skip`;function $m(e,t,n,r){if(!e||typeof e!=`object`)throw Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,a,o,s,c;if(typeof n==`function`||n&&typeof n==`object`?(a=t,o=n,r&&(i=!1)):(o=t,n&&(i=!1)),typeof o==`function`)s=o;else if(o&&typeof o==`object`){if(o.enter!==null&&o.enter!==void 0){if(typeof o.enter==`function`)s=o.enter;else throw Error("Unexpected value `"+o.enter+"` for `visitors.enter`, expected optional visitor")}if(typeof o.exit==`function`)c=o.exit;else throw Error("Unexpected value `"+o.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw Error("Unexpected value `"+o+"` for `enter` or `visitors`, expected visitor or object with visitors");let l=Um(a),u=i?1:-1;d(e,void 0,[])();function d(e,t,n){let r=e&&typeof e==`object`?e:{};if(typeof r.type==`string`){let t=typeof r.tagName==`string`?r.tagName:typeof r.name==`string`?r.name:void 0;Object.defineProperty(o,"name",{value:`node (`+Xm(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=Zm;if(s&&r&&(o=eh(s(e,n,t)),o[0]===!1))return o;if(`children`in e&&e.children){let t=e;if(t.children&&o[0]!==`skip`){let e=(i?-1:t.children.length)+u,r=[...n,t];for(;e>-1&&e<t.children.length;){let n=t.children[e],i=d(n,e,r)();if(i[0]===!1)return i;e=typeof i[1]==`number`?i[1]:e+u}}}if(c&&r){let r=eh(c(e,n,t));if(r[0]===`skip`)throw Error("Unexpected value `"+r[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(r[0]===!1||typeof r[1]==`number`)return r}return o}}}function eh(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Zm:[e]}function th(e,t,n,r){let i,a,o;typeof n==`function`||n&&typeof n==`object`?(i=t,a=n,o=r):(a=t,o=n),typeof a==`function`?$m(e,i,rh(a),o):$m(e,i,nh(a),o)}function nh(e){return!e||typeof e!=`object`?e:{enter:typeof e.enter==`function`?rh(e.enter):e.enter,exit:typeof e.exit==`function`?rh(e.exit):e.exit}}function rh(e){return t;function t(t,n,r){return e(t,r,n[n.length-1])}}var ih={}.hasOwnProperty,ah={};function oh(e,t){let n=t||ah,r=new Map,i=new Map,a={all:s,applyData:ch,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...wm,...n.handlers},one:o,options:n,patch:sh,wrap:uh};return th(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(ih.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=zm(n);return r.children=a.all(e),r}return zm(e)}return(a.options.unknownHandler||lh)(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=dh(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=dh(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function sh(e,t){e.position&&(t.position=uu(e))}function ch(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,zm(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function lh(e,t){let n=t.data||{},r=`value`in t&&!(ih.call(n,`hProperties`)||ih.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 uh(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
55
- `});++r<e.length;)r&&n.push({type:`text`,value:`
56
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
57
- `}),n}function dh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function fh(e,t){let n=oh(e,t),r=n.one(e,void 0),i=Hm(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
58
- `},i)),a}function ph(e,t){return e&&`run`in e?async function(n,r){let i=fh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return fh(n,{file:r,...e||t})}}function mh(e){if(e)throw e}var hh=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 gh(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 _h(){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);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?vh(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 vh(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 yh={basename:bh,dirname:xh,extname:Sh,join:Ch,sep:`/`};function bh(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Eh(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 xh(e){if(Eh(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 Sh(e){Eh(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}}else 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 Ch(...e){let t=-1,n;for(;++t<e.length;)Eh(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:wh(n)}function wh(e){Eh(e);let t=e.codePointAt(0)===47,n=Th(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Th(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 Eh(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Dh={cwd:Oh};function Oh(){return`/`}function kh(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Ah(e){if(typeof e==`string`)e=new URL(e);else if(!kh(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 jh(e)}function jh(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 Mh=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Nh=class{constructor(e){let t;t=e?kh(e)?{path:e}:typeof e==`string`||Lh(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Dh.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Mh.length;){let e=Mh[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)Mh.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?yh.basename(this.path):void 0}set basename(e){Fh(e,`basename`),Ph(e,`basename`),this.path=yh.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?yh.dirname(this.path):void 0}set dirname(e){Ih(this.basename,`dirname`),this.path=yh.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?yh.extname(this.path):void 0}set extname(e){if(Ph(e,`extname`),Ih(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=yh.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){kh(e)&&(e=Ah(e)),Fh(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?yh.basename(this.path,this.extname):void 0}set stem(e){Fh(e,`stem`),Ph(e,`stem`),this.path=yh.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 hu(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 Ph(e,t){if(e&&e.includes(yh.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+yh.sep+"`")}function Fh(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Ih(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Lh(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Rh=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),zh=l(hh(),1),Bh={}.hasOwnProperty,Vh=new class e extends Rh{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=_h()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,zh.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Wh(`data`,this.frozen),this.namespace[e]=t,this):Bh.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Wh(`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=qh(e),n=this.parser||this.Parser;return Hh(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Hh(`process`,this.parser||this.Parser),Uh(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=qh(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);Yh(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(),Hh(`processSync`,this.parser||this.Parser),Uh(`processSync`,this.compiler||this.Compiler),this.process(e,r),Kh(`processSync`,`process`,t),n;function r(e,r){t=!0,mh(e),n=r}}run(e,t,n){Gh(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=qh(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),Kh(`runSync`,`run`,n),r;function i(e,t){mh(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=qh(t),r=this.compiler||this.Compiler;return Uh(`stringify`,r),Gh(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Wh(`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,zh.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];gh(o)&&gh(r)&&(r=(0,zh.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Hh(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Uh(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Wh(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 Gh(e){if(!gh(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Kh(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function qh(e){return Jh(e)?e:new Nh(e)}function Jh(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Yh(e){return typeof e==`string`||Xh(e)}function Xh(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Zh=[],Qh={allowDangerousHtml:!0},$h=/^(https?|ircs?|mailto|xmpp)$/i,eg=[{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 tg(e){let t=ng(e),n=rg(e);return ig(t.runSync(t.parse(n),n),e)}function ng(e){let t=e.rehypePlugins||Zh,n=e.remarkPlugins||Zh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Qh}:Qh;return Vh().use(qp).use(n).use(ph,r).use(t)}function rg(e){let t=e.children||``,n=new Nh;return typeof t==`string`?n.value=t:``+t,n}function ig(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||ag;for(let e of eg)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return th(e,l),Cu(e,{Fragment:G.Fragment,components:i,ignoreInvalidStyle:!0,jsx:G.jsx,jsxs:G.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 Ku)if(Object.hasOwn(Ku,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Ku[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 ag(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||$h.test(e.slice(0,t))?e:``}function og(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function sg(e,t,n){let r=Um((n||{}).ignore||[]),i=cg(t),a=-1;for(;++a<i.length;)$m(e,o);function o(e,t,n){if(e.type===`text`&&typeof n==`number`)return s(e,t,n);if(r(e,n,t[t.length-1]))return Qm}function s(e,t,n){let r=t[t.length-1],o=i[a][0],s=i[a][1],c=0,l=!1,u=[];o.lastIndex=0;let d=o.exec(e.value);for(;d;){let n=d.index,r={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,r);if(typeof i==`string`&&(i=i.length>0?{type:`text`,value:i}:void 0),i===!1)o.lastIndex=n+1;else{if(c!==n&&f({type:`text`,value:e.value.slice(c,n)}),Array.isArray(i))for(let e of i)f(e);else i&&f(i);c=n+d[0].length,l=!0}if(!o.global)break;d=o.exec(e.value)}return l?(c<e.value.length&&f({type:`text`,value:e.value.slice(c)}),r.children.splice(n,1,...u)):u=[e],n+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function cg(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([lg(e[0]),ug(e[1])])}return t}function lg(e){return typeof e==`string`?new RegExp(og(e),`g`):e}function ug(e){return typeof e==`function`?e:function(){return e}}function dg(e){sg(e,[/\r?\n|\r/g,fg])}function fg(){return{type:`break`}}function pg(){return function(e){dg(e)}}function mg(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}var hg=`phrasing`,gg=[`autolink`,`link`,`image`,`label`];function _g(){return{transforms:[Tg],enter:{literalAutolink:yg,literalAutolinkEmail:bg,literalAutolinkHttp:bg,literalAutolinkWww:bg},exit:{literalAutolink:wg,literalAutolinkEmail:Cg,literalAutolinkHttp:xg,literalAutolinkWww:Sg}}}function vg(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:hg,notInConstruct:gg},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:hg,notInConstruct:gg},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:hg,notInConstruct:gg}]}}function yg(e){this.enter({type:`link`,title:null,url:``,children:[],position:void 0},e)}function bg(e){this.config.enter.autolinkProtocol.call(this,e)}function xg(e){this.config.exit.autolinkProtocol.call(this,e)}function Sg(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 Cg(e){this.config.exit.autolinkEmail.call(this,e)}function wg(e){this.exit(e)}function Tg(e){sg(e,[[/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,Eg],[/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,kg],[/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,Og],[/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,Dg]],{ignore:[`link`,`linkReference`]})}function Eg(e,t,n,r,i){if(!Mg(i))return!1;let a=``;if(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),gd(n.charCodeAt(0))||!Ag(n))return!1;let o=jg(n+r),s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0],position:void 0}],position:void 0};return o[1]?[s,{type:`text`,value:o[1],position:void 0}]:s}function Dg(e,t,n){return!/[\d\-_]$/.test(n)&&{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n,position:void 0}],position:void 0}}function Og(e,t,n){if(/[\d\-_]$/.test(n))return!1;let r=`mailto:`+t+`@`+n;return{type:`link`,title:null,url:r,children:[{type:`text`,value:r,position:void 0}],position:void 0}}function kg(e,t,n,r,i){if(/[\d\-_]$/.test(n)||r&&(!/[A-Za-z]$/.test(r)||i.input.charAt(i.index+e.length)===`@`))return!1;let a=`xmpp:`+t+`@`+n+(r||``);return{type:`link`,title:null,url:a,children:[{type:`text`,value:a,position:void 0}],position:void 0}}function Ag(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[\dA-Za-z]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[\dA-Za-z]/.test(t[t.length-2])))}function jg(e){let t=e.length;for(;t>0;){let n=e.charCodeAt(t-1);if(n===33||n===34||n===38||n===39||n===41||n===44||n===46||n===58||n===59||n===60||n===62||n===63||n===93||n===125)t--;else break}if(t===e.length)return[e,void 0];let n=e.slice(t);e=e.slice(0,t);let r=n.indexOf(`)`),i=mg(e,`(`),a=mg(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 Mg(e){let t=e.input.charCodeAt(e.index-1);return e.index===0||_d(t)||gd(t)}Hg.peek=Vg;function Ng(){this.buffer()}function Pg(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Fg(){this.buffer()}function Ig(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Lg(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=sd(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Rg(e){this.exit(e)}function zg(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=sd(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Bg(e){this.exit(e)}function Vg(){return`[`}function Hg(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 Ug(){return{enter:{gfmFootnoteCallString:Ng,gfmFootnoteCall:Pg,gfmFootnoteDefinitionLabelString:Fg,gfmFootnoteDefinition:Ig},exit:{gfmFootnoteCallString:Lg,gfmFootnoteCall:Rg,gfmFootnoteDefinitionLabelString:zg,gfmFootnoteDefinition:Bg}}}function Wg(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Hg},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?`
59
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Kg:Gg))),s(),o}}function Gg(e,t,n){return t===0?e:Kg(e,t,n)}function Kg(e,t,n){return(n?``:` `)+e}var qg=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Qg.attention=$g,Qg.peek=e_;function Jg(){return{canContainEols:[`delete`],enter:{strikethrough:Xg},exit:{strikethrough:Zg}}}function Yg(){return{handlers:{delete:Qg},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:qg}]}}function Xg(e){this.enter({type:`delete`,children:[],position:void 0},e)}function Zg(e){this.exit(e)}function Qg(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function $g(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function e_(){return`~`}function t_(e){return e.length}function n_(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||t_,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=r_(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]=i_(r[d]);else{let e=i_(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],r=n.fillRows===!1?Math.max(1,o[u===1?0:u].length):l;d=-1;let i=[];for(;++d<r;){let o=e[d]||``,s=``,l=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];if(n===114)s=` `.repeat(e);else if(n===99){let t=e/2;e%2?(s=` `.repeat(t+.5),l=` `.repeat(t-.5)):(s=` `.repeat(t),l=s)}else l=` `.repeat(e)}n.delimiterStart!==!1&&!d&&i.push(`|`),n.padding===!1||n.alignDelimiters===!1&&o===``||n.delimiterStart===!1&&!d||i.push(` `),n.alignDelimiters!==!1&&i.push(s),i.push(o),n.alignDelimiters!==!1&&i.push(l),n.padding!==!1&&i.push(` `),(n.delimiterEnd!==!1||d!==r-1)&&i.push(`|`)}m.push(n.delimiterEnd===!1?i.join(``).replace(/ +$/,``):i.join(``))}return m.join(`
60
- `)}function r_(e){return e==null?``:String(e)}function i_(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}var a_=Um([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function o_(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()),s_);return i(),o}function s_(e,t,n){return`>`+(n?``:` `)+e}function c_(e,t){return l_(e,t.inConstruct,!0)&&!l_(e,t.notInConstruct,!1)}function l_(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 u_(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
61
- `&&!e.before&&!e.after&&c_(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
62
- `}function d_(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 f_(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function p_(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function m_(e,t,n,r){let i=p_(n),a=e.value||``;if(f_(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,h_);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(d_(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
63
- `,encode:["`"],...o.current()})),t()}return u+=o.move(`
64
- `),a&&(u+=o.move(a+`
65
- `)),u+=o.move(s),c(),u}function h_(e,t,n){return(n?``:` `)+e}function g_(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function __(e,t,n,r){let i=g_(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?` `:`
66
- `,...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 v_(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function y_(e){let t=e.codePointAt(0);return t===void 0?``:String.fromCodePoint(t)}function b_(e){let t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function x_(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function S_(e,t,n){let r=kd(e),i=kd(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}}function C_(e){if(e.charCodeAt(0)!==60)return;let t=e.charCodeAt(1);if(t===33){let t=e.charCodeAt(2);return t===45?2:t===91?5:cd(t)?4:void 0}if(t===63)return 3;let n=t===47,r=n?2:1,i=r,a=e.charCodeAt(i);if(!cd(a))return;for(;a===45||ld(a);)a=e.charCodeAt(++i);let o=e.slice(r,i).toLowerCase();return!n&&a!==47&&kf.includes(o)?1:Of.includes(o)?6:7}var w_=new Map([[`*`,!1],[`_`,!0]]);function T_(e,t,n){let r=new Set;for(let i of e){let e=n.get(i);if(e&&i.attention&&t.some(e=>e.attention===i.attention))for(let t of e.tokens)r.add(t.attention)}let i=[];for(let t of e)t.attention&&r.delete(t.attention)&&i.push(t.attention);return i.reverse(),i}function E_(e,t,n){let r=[],i=new Map,a=new Map,o=0;for(;o<e.length;){if(!e[o].attention){o++;continue}let s=e[o].value.charAt(0),c=w_.get(s),l=o+1;for(;l<e.length&&e[l].attention&&e[l].value.charAt(0)===s;)l++;let u=o?e[o-1].value:t,d=kd(u.charCodeAt(u.length-1)),f=kd((l<e.length?e[l].value:n).charCodeAt(0)),p=!f||f===2&&!!d,m=!d||d===2&&!!f,h={tokens:e.slice(o,l),markers:[],start:0,end:0,open:c?p&&(!!d||!m):p,close:c?m&&(!!f||!p):m,split:c!==void 0};for(let e of h.tokens){i.set(e,[...h.tokens]),a.set(e,h);let t=e.value.length;for(;t--;)h.markers.push(e)}h.end=h.markers.length,r.push(h),o=l}for(k_(r,i),o=-1;++o<e.length;){let t=i.get(e[o]);if(t)return{attention:T_(e,t,a),index:o}}}function D_(e,t){let n=e[t?0:e.length-1];if(!n||n.attention)return;let r=t?y_(n.value):b_(n.value),i=x_(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let e=n.value.slice(0,n.value.length-r.length),t=0;for(;e.charCodeAt(e.length-1-t)===92;)t++;t%2&&(e+=`\\`),n.value=e+i}}function O_(e,t,n,r,i){for(let a of n.attention){let o=t.get(a)||a.sequences[0];for(let s of a.sequences){if(s===o)continue;let c=new Map(t);c.set(a,s);let l=F_(e,c,r,i),u=E_(l,r,i);if(!u||u.index>n.index)return{chosen:c,mistake:u,tokens:l}}}}function k_(e,t){let n=new Map;for(let r of e){let e=r.tokens[0].value.charAt(0),i=n.get(e);i||(i=[],n.set(e,i));let a=r.close?i.length:0;for(;a--&&r.start<r.end;){let e=i[a],n=e.end-e.start,o=r.end-r.start;if(r.split?(e.close||r.open)&&o%3&&!((n+o)%3):n!==e.markers.length||n!==o)continue;let s=r.split?n>1&&o>1?2:1:o,c=e.markers.slice(e.end-s,e.end),l=r.markers.slice(r.start,r.start+s),u=c[0],d=l[0];if(u===c[s-1]&&u.value.length===s&&d===l[s-1]&&d.value.length===s&&u.attention===d.attention)t.delete(u),t.delete(d);else{let e=[...new Set([...c,...l])];for(let n of e){let r=t.get(n);r&&r.push(...e)}}e.end-=s,r.start+=s,e.start===e.end&&i.splice(a,1),a=i.length}r.open&&r.start<r.end&&i.push(r)}}function A_(e,t,n){if(t.length===0)throw Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(let t of n)if(!Number.isSafeInteger(t)||t<1)throw Error("Cannot serialize `"+e+"` as attention with `"+t+"` as size, expected positive integer");let r=[];for(let i of t){if(i.length!==1)throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!md(i.charCodeAt(0)))throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(let e of n)r.push(i.repeat(e))}return r}function j_(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before;r.push(-1);let c=t.createTracker(n);for(;++o<i.length;){let l=i[o],u;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),u=n?y_(n(i[o+1],e,t,{before:``,after:``,...c.current()})):``}else u=n.after;let d=a[a.length-1];typeof d==`string`&&(s===`\r`||s===`
67
- `)&&l.type===`html`&&C_(l.value)!==7&&(a[a.length-1]=d.replace(/(\r?\n|\r)$/,` `),s=` `,c=t.createTracker(n),c.move(I_(a,n.before,n.after)));let f=t.handle.handlers[l.type];if(f&&f.attention){let e=M_(l,f.attention,t,c);if(!e)continue;a.push(e),s=b_(e.sequences[0])}else{let n=t.handle(l,e,t,{...c.current(),after:u,before:s});if(!n)continue;c.move(n),a.push(n),s=b_(n)}}return r.pop(),a}function M_(e,t,n,r){let{construct:i,markers:a,sizes:o}=t(e,n),s=A_(e.type,a,o),c=s[0],l=n.enter(i),u=n.createTracker(r.current());u.move(c);let d=j_(e,n,{...u.current(),before:c,after:c});if(l(),d.length!==0)return r.move(c),r.move(I_(d,c,c)),r.move(c),{children:d,sequences:s}}function N_(e,t,n,r){let i=F_(e,t,n,r),a=E_(i,n,r);for(;a;){let o=O_(e,t,a,n,r);if(!o)return;t=o.chosen,i=o.tokens,a=o.mistake}return i}function P_(e,t,n,r){let i=n,a=-1;for(;++a<e.length;){let o=e[a];if(typeof o==`string`){i=``;continue}let s=a===e.length-1?r:``,c=o.sequences.find(function(t){let r=t.charAt(0);return r!==i.charAt(0)&&r!==s.charAt(0)||e.length===1&&w_.has(r)&&t.length>n.length})||o.sequences[0];c!==o.sequences[0]&&t.set(o,c),P_(o.children,t,c,c),i=c}}function F_(e,t,n,r){let i=[],a,o=b_(n),s=-1;for(;++s<e.length;){let n=e[s];if(typeof n==`string`){let e={value:n,attention:void 0};a&&a===y_(n)&&D_([e],!0),a=void 0,i.push(e),e.value&&(o=b_(e.value));continue}let c=t.get(n)||n.sequences[0],l=c.charAt(0),u=e[s+1],d=o,f=y_(u===void 0?r:typeof u==`string`?u:t.get(u)||u.sequences[0]),p=F_(n.children,t,c,c),m=p[0].value,h=S_(d.charCodeAt(d.length-1),m.charCodeAt(0),l);h.inside&&D_(p,!0);let g=b_(p[p.length-1].value),_=S_(f.charCodeAt(0),g.charCodeAt(g.length-1),l);_.inside&&D_(p,!1),h.outside&&d!==`
68
- `&&d!==`\r`&&D_(i,!1),_.outside&&(a=f),i.push({value:c,attention:n},...p,{value:c,attention:n}),o=c.charAt(c.length-1)}return i}function I_(e,t,n){let r=new Map;P_(e,r,t,n);let i=(r.size>0?N_(e,r,t,n):void 0)||N_(e,new Map,t,n)||F_(e,new Map,t,n),a=``;for(let e of i)a+=e.value;return a}L_.attention=R_,L_.peek=z_;function L_(e,t,n,r){let i=n.enter(`phrasing`),a=M_(e,R_,n,n.createTracker(r)),o=a?I_([a],r.before,r.after):``;return i(),o}function R_(e,t){return{construct:`emphasis`,markers:v_(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function z_(e,t,n){return n.options.emphasis||`*`}function B_(e,t){let n=!1;return th(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)&&Ju(e)&&(t.options.setext||n))}function V_(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(B_(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
69
- `,after:`
70
- `});return r(),t(),o+`
71
- `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
72
- `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
73
- `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=x_(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}H_.peek=U_;function H_(e){return e.value||``}function U_(){return`<`}W_.peek=G_;function W_(e,t,n,r){let i=g_(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 G_(){return`!`}K_.peek=q_;function K_(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=u.filter(function(e){return e!==`phrasing`}),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 q_(){return`!`}J_.peek=Y_;function J_(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;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 Y_(){return"`"}function X_(e,t){let n=Ju(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))}Z_.peek=Q_;function Z_(e,t,n,r){let i=g_(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(X_(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`),u=n.containerPhrasing(e,{before:l,after:`](`,...o.current()});l+=o.move(u),c(),l+=o.move(`](`);let d=/[\0- \u007F]/.test(e.url),f=r.before.charAt(r.before.length-1),p=e.title||void 0;if(!p&&!d&&(f===`
74
- `||f===`\r`)){let e=0;for(;e<u.length&&u.charCodeAt(e)!==93;)e+=u.charCodeAt(e)===92?2:1;u.charCodeAt(e+1)===58&&(p=``)}return!e.url&&typeof p==`string`||d?(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:typeof p==`string`?` `:`)`,...o.current()}))),c(),typeof p==`string`&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(p,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Q_(e,t,n){return X_(e,n)?`<`:`[`}$_.peek=ev;function $_(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=u.filter(function(e){return e!==`phrasing`}),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 ev(){return`[`}function tv(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 nv(e){let t=tv(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 rv(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function iv(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 av(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?rv(n):tv(n),s=e.ordered?o===`.`?`)`:`.`:nv(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),iv(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 ov(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 sv(e,t,n,r){let i=ov(n),a=n.bulletCurrent||tv(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 cv(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function lv(e,t,n,r){if(!e.children.some(function(e){return a_(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function uv(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}dv.attention=fv,dv.peek=pv;function dv(e,t,n,r){let i=n.enter(`phrasing`),a=M_(e,fv,n,n.createTracker(r)),o=a?I_([a],r.before,r.after):``;return i(),o}function fv(e,t){return{construct:`strong`,markers:uv(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function pv(e,t,n){return n.options.strong||`*`}function mv(e,t,n,r){let i=t?t.children:[],a=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function hv(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 gv(e,t,n){let r=(iv(n)+(n.options.ruleSpaces?` `:``)).repeat(hv(n));return n.options.ruleSpaces?r.slice(0,-1):r}var _v={blockquote:o_,break:u_,code:m_,definition:__,emphasis:L_,hardBreak:u_,heading:V_,html:H_,image:W_,imageReference:K_,inlineCode:J_,link:Z_,linkReference:$_,list:av,listItem:sv,paragraph:cv,root:lv,strong:dv,text:mv,thematicBreak:gv};function vv(){return{enter:{table:yv,tableData:Cv,tableHeader:Cv,tableRow:xv},exit:{codeText:wv,table:bv,tableData:Sv,tableHeader:Sv,tableRow:Sv}}}function yv(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[],position:void 0},e),this.data.inTable=!0}function bv(e){this.exit(e),this.data.inTable=void 0}function xv(e){this.enter({type:`tableRow`,children:[],position:void 0},e)}function Sv(e){this.exit(e)}function Cv(e){this.enter({type:`tableCell`,children:[],position:void 0},e)}function wv(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Tv));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Tv(e,t){return t===`|`?t:e}function Ev(e){let{tableCellPadding:t,tablePipeAlign:n,stringLength:r}=e||{},i=t?` `:`|`;return{handlers:{inlineCode:d,table:a,tableCell:s,tableRow:o},join:[Dv],unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
75
- `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}]};function a(e,t,n,r){let i=l(e,n,r),a=i[0];if(a){let t=e.align?e.align.length:0,n=-1;if(!t)for(;++n<i.length;)i[n].length>t&&(t=i[n].length);for(;a.length<t;)a.push(``)}return c(i,e.align)}function o(e,t,n,r){let i=c([u(e,n,r)]);return i.slice(0,i.indexOf(`
76
- `))}function s(e,t,n,r){let a=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:i,after:i});return o(),a(),s}function c(e,i){return n_(e,{align:i,alignDelimiters:n,fillRows:!1,padding:t,stringLength:r})}function l(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=u(r[i],t,n);return o(),a}function u(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}function d(e,t,n){let r=_v.inlineCode(e,t,n);if(!n.stack.includes(`tableCell`))return r;let i=[],a=0,o=r.indexOf(`|`);for(;o!==-1;){let e=o;for(;e>a&&r.charCodeAt(e-1)===92;)e--;i.push(r.slice(a,o)),(o-e)%2==0&&i.push(`\\`),a=o,o=r.indexOf(`|`,o+1)}return i.push(r.slice(a)),i.join(``)}}function Dv(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&Ov(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function Ov(e,t){let n=!1;return th(e,function(e){if(e.type===`break`||`value`in e&&/\r?\n|\r/.test(e.value))return n=!0,!1}),!!((!e.depth||e.depth<3)&&Ju(e)&&(t.options.setext||n))}function kv(){return{exit:{taskListCheckValueChecked:jv,taskListCheckValueUnchecked:jv,paragraph:Mv}}}function Av(){return{handlers:{paragraph:Nv},join:[Pv]}}function jv(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Mv(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={...n.position.start}))}}this.exit(e)}function Nv(e,t,n,r){if(!t||t.type!==`listItem`||Fv(t)!==e)return _v.paragraph(e,t,n,r);let i=`[`+(t.checked?`x`:` `)+`] `,a=n.createTracker(r);return a.move(i),i+_v.paragraph(e.children.length>0?e:{type:`paragraph`,children:[{type:`text`,value:` `}]},t,n,{...r,...a.current()})}function Pv(e,t,n){if(e.type!==`definition`||n.type!==`listItem`)return;let r=Fv(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function Fv(e){if(typeof e.checked==`boolean`)for(let t of e.children){if(t.type===`paragraph`)return t;if(t.type!==`definition`)return}}function Iv(){return[_g(),Ug(),Jg(),vv(),kv()]}function Lv(e){return{extensions:[vg(),Wg(e),Yg(),Ev(e),Av()]}}var Rv={tokenize:Qv,partial:!0},zv={tokenize:$v,partial:!0},Bv={tokenize:ey,partial:!0},Vv={tokenize:ty,partial:!0},Hv={tokenize:ny,partial:!0},Uv={name:`wwwAutolink`,tokenize:Xv,previous:ry},Wv={name:`protocolAutolink`,tokenize:Zv,previous:iy},Gv={name:`emailAutolink`,tokenize:Yv,previous:ay},Kv={};function qv(){return{text:Kv}}for(var Jv=48;Jv<123;)Kv[Jv]=Gv,Jv++,Jv===58?Jv=65:Jv===91&&(Jv=97);Kv[43]=Gv,Kv[45]=Gv,Kv[46]=Gv,Kv[95]=Gv,Kv[72]=[Gv,Wv],Kv[104]=[Gv,Wv],Kv[87]=[Gv,Uv],Kv[119]=[Gv,Uv];function Yv(e,t,n){let r=this,i,a;return o;function o(t){return!oy(t)||!ay.call(r,r.previous)||sy(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return oy(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Hv,u,l)(t):t===45||t===95||ld(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&&cd(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Xv(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!ry.call(r,r.previous)||sy(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Rv,e.attempt(zv,e.attempt(Bv,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Zv(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&iy.call(r,r.previous)&&!sy(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(cd(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||dd(t)||hd(t)||_d(t)||gd(t)?n(t):e.attempt(zv,e.attempt(Bv,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Qv(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 $v(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Vv,c,s)(t):t===null||hd(t)||_d(t)||t!==45&&gd(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 ey(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(Vv,t,a)(o):o===null||hd(o)||_d(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function ty(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||hd(o)||_d(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||hd(e)||_d(e)?t(e):r(e)}function a(e){return cd(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):cd(t)?(e.consume(t),o):n(t)}}function ny(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return ld(e)?n(e):t(e)}}function ry(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||hd(e)}function iy(e){return!cd(e)}function ay(e){return!(e===47||oy(e))}function oy(e){return e===43||e===45||e===46||e===95||ld(e)}function sy(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 cy={tokenize:gy,partial:!0};function ly(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:py,continuation:{tokenize:my},exit:hy}},text:{91:{name:`gfmFootnoteCall`,tokenize:fy},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:uy,resolveTo:dy}}}}function uy(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=sd(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 dy(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 fy(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||hd(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(sd(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return hd(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 py(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||hd(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=sd(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return hd(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),$(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function my(e,t,n){return e.check(Ld,t,e.attempt(cy,t,n))}function hy(e){e.exit(`gfmFootnoteDefinition`)}function gy(e,t,n){let r=this;return $(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 _y(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&&ed(o,o.length,0,Ad(s,e.slice(r+1,n),t)),ed(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),ed(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=kd(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=kd(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var vy=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){yy(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,this.index.clear()}};function yy(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function by(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 xy(){return{flow:{null:{name:`table`,tokenize:Sy,resolveAll:Cy}}}}function Sy(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{type:e}=r.events[t][1];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||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):Z(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Q(t)?$(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||hd(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,Q(t)?$(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 Q(t)?$(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||Z(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 Q(t)?$(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Z(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||Z(n)?(e.exit(`tableRow`),t(n)):Q(n)?$(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||hd(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 Cy(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 vy;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Ty(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=wy(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=wy(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=wy(f,t,o,i,n,d)):(o[0]=o[1],d=wy(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Ty(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=by(t.events,n))}return e}function wy(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Ey(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Ey(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=Ey(t.events,n[2]),a=Ey(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({},Ey(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Ty(e,t,n,r,i){let a=[],o=Ey(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 Ey(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Dy={name:`tasklistCheck`,tokenize:ky};function Oy(){return{text:{91:Dy}}}function ky(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 hd(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 Z(r)?t(r):Q(r)?e.check({tokenize:Ay},t,n)(r):n(r)}}function Ay(e,t,n){return $(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function jy(e){return rd([qv(),ly(),_y(e),xy(),Oy()])}var My={};function Ny(e){let t=this,n=e||My,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(jy(n)),a.push(Iv()),o.push(Lv(n))}var Py=/^diff --git a\/(.*) b\/(.*)$/,Fy=/^new file (?!mode \d+$)(.+?)(?:: (?:binary|link|not readable|nested repository|not a regular file))?$/,Iy=/^(index |--- |\+\+\+ )/,Ly=/^diff --git "a\/(?:[^"\\]|\\.)*" "b\/((?:[^"\\]|\\.)*)"$/,Ry={n:10,t:9,r:13,b:8,f:12,v:11,a:7};function zy(e){let t=[];for(let n=0;n<e.length;n++){if(e[n]!==`\\`){t.push(...new TextEncoder().encode(e[n]));continue}let r=/^[0-7]{3}/.exec(e.slice(n+1,n+4));if(r)t.push(parseInt(r[0],8)),n+=3;else{let r=e[++n]??``;t.push(Ry[r]??r.charCodeAt(0))}}return new TextDecoder().decode(new Uint8Array(t))}function By(e,t){let n=Ly.exec(e);if(n)return zy(n[1]);let r=Py.exec(e);if(r)return t.find(t=>e===`diff --git a/${t} b/${t}`)??r[2];let i=Fy.exec(e);return i?i[1]:null}function Vy(e,t=[]){let n=[],r=null;for(let i of e.split(`
77
- `)){let e=r?.inHunk&&/^[ +\-\\]/.test(i)?null:By(i,t);if(e!==null)r={path:e,lines:[],inHunk:!1},n.push(r),i.startsWith(`diff --git `)||r.lines.push(i);else{if(!r){if(!i)continue;r={path:``,lines:[],inHunk:!0},n.push(r)}if(i.startsWith(`@@`))r.inHunk=!0;else if(!r.inHunk&&Iy.test(i)){i.startsWith(`+++ `)&&(r.inHunk=!0);continue}r.lines.push(i)}}for(let e of n)for(;e.lines.at(-1)===``;)e.lines.pop();return n.map(({path:e,lines:t})=>({path:e,lines:t}))}function Hy(e){let t=new Map(Vy(e.staged,e.files).map(e=>[e.path,e.lines])),n=new Map(Vy(e.unstaged,e.files).map(e=>[e.path,e.lines])),r=[...new Set([...e.files,...t.keys(),...n.keys()])].map(e=>({path:e,staged:t.get(e)??[],unstaged:n.get(e)??[]}));return t.has(``)||n.has(``)?r.filter(e=>e.staged.length||e.unstaged.length):r}function Uy(e){return e.startsWith(`@@`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:e.startsWith(` `)?`ctx`:`meta`}var Wy=/^gcf\/work\/([^/]+?)(?:\.md$|\/)/;function Gy(e,t){let n=Wy.exec(t)?.[1];return n&&e.board.items.some(e=>e.id===n&&e.running)?n:null}function Ky(e){let t=e.board.domain.sections.edits;return t?.commit&&t.discard?{commit:t.commit,discard:t.discard}:null}function qy({ctx:e,refusal:t,error:n,onError:r,onDone:i}){let[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(t),d=Ky(e);if(!d||!l)return null;let f=()=>{r(``),u(null),i?.()},p=async()=>{c(!0);let t=await e.moveIn({cmd:d.commit,paths:l.paths});c(!1);let n=t.ok?[]:Le(t,l.paths);if(n&&!n.length)return f();if(n)return u({code:`dirty`,paths:n});r(t.err),u(Ie(t.refusal)??l)};return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`c-acts refusal-acts`,role:`group`,"aria-label":`Fix the refusal`,children:[(0,G.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>o(`show`),title:l.paths.join(`
78
- `),children:`Show diff`}),(0,G.jsx)(`button`,{type:`button`,className:`btn`,disabled:s,title:`Commit the edits as they are (gcf edits commit): ${l.paths.join(`, `)}`,onClick:()=>void p(),children:s?`Committing…`:`Commit`}),(0,G.jsx)(`button`,{type:`button`,className:`btn rf-discard`,title:`Shows the diff first: Discard is there, it cannot be undone`,onClick:()=>o(`discard`),children:`Discard…`})]}),a&&(0,G.jsx)(eb,{ctx:e,refusal:l,title:n,focusDiscard:a===`discard`,onClose:()=>o(null),onDone:f,onLeft:e=>u({code:`dirty`,paths:e})})]})}function Jy({ctx:e,refusal:t,error:n,again:r}){let[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(!1);return o?(0,G.jsxs)(`span`,{className:`rf-fixed`,children:[`✔ its files under gcf/ are committed or put back · `,r]}):(0,G.jsxs)(`div`,{className:`rf-fixes`,children:[(0,G.jsx)(qy,{ctx:e,refusal:t,error:n,onError:a,onDone:()=>s(!0)}),i&&(0,G.jsx)(`span`,{className:`rf-err`,children:i})]})}function Yy({ctx:e,refusal:t,error:n}){return(0,G.jsxs)(`div`,{role:`alert`,className:`dialog-error`,title:`The framework's answer, word for word. Change a field to try again; Cancel closes it.`,children:[(0,G.jsx)(`span`,{className:`de-mark`,"aria-hidden":`true`,children:`✘`}),(0,G.jsxs)(`div`,{className:`de-body`,children:[(0,G.jsx)(`span`,{className:`de-head`,children:`gcf refused it`}),(0,G.jsx)(`span`,{className:`de-text`,children:(0,G.jsx)(Ce,{text:n,toned:!0})}),(0,G.jsx)(Jy,{ctx:e,refusal:t,error:n,again:`the primary button tries the move again`},t.paths.join(`
79
- `)),(0,G.jsx)(`span`,{className:`de-hint`,children:`Change a field to try again, or Cancel.`})]})]})}var Xy=`git’s output, not cut by file`,Zy=200,Qy=20;function $y({head:e,lines:t,none:n,limit:r}){let[i,a]=(0,v.useState)(!1),o=i?t:t.slice(0,r),s=t.length-o.length;return(0,G.jsxs)(`div`,{className:`diff-part`,children:[(0,G.jsx)(`span`,{className:`diff-part-h`,children:e}),t.length&&!o.length?(0,G.jsxs)(`button`,{type:`button`,className:`diff-late`,title:`Past the first files a part opens on a click`,onClick:()=>a(!0),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`▸`}),`Show `,s,` lines`]}):t.length?(0,G.jsxs)(`div`,{className:`diff-lines`,"aria-label":`${e} diff`,children:[o.map((e,t)=>(0,G.jsx)(`div`,{className:`dl ${Uy(e)}`,children:e||` `},t)),s>0&&(0,G.jsxs)(`button`,{type:`button`,className:`diff-more`,title:`The first ${r} lines are shown: the rest opens here`,onClick:()=>a(!0),children:[`Show `,s,` more lines`]})]}):(0,G.jsx)(`span`,{className:`diff-none`,children:n})]})}function eb({ctx:e,refusal:t,title:n,focusDiscard:r=!1,onClose:i,onDone:a,onLeft:o}){let[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(!1),p=(0,v.useRef)(null),m=Ky(e),h=t.paths,g=h.join(`
80
- `);(0,v.useEffect)(()=>{let t=!0;return H.editsDiff(e.project.name,g.split(`
81
- `)).then(e=>t&&c(e),e=>t&&u(e.message)),()=>{t=!1}},[e.project.name,g]),(0,v.useEffect)(()=>{s&&r&&p.current?.focus()},[s,r]);let _=async t=>{f(!0);let n=await e.moveIn({cmd:t,paths:h});f(!1);let r=n.ok?[]:Le(n,h);r&&!r.length?(i(),a?.()):r&&o?(i(),o(r)):u(n.err)},y=s?Hy(s):h.map(e=>({path:e,staged:[],unstaged:[]})),b=s?s.files.length:h.length;return(0,Ge.createPortal)((0,G.jsx)(De,{onClose:i,dirty:d,children:(0,G.jsxs)(`div`,{className:`dialog diff-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Hand edits under gcf/`,onClick:e=>e.stopPropagation(),children:[(0,G.jsxs)(`div`,{className:`diff-head`,children:[(0,G.jsxs)(`div`,{className:`diff-title`,children:[(0,G.jsx)(`h2`,{children:`Hand edits under gcf/`}),(0,G.jsxs)(`span`,{className:`diff-count`,children:[b===1?`1 file`:`${b} files`,` · gcf edits diff`]})]}),n&&(0,G.jsx)(`div`,{role:`note`,className:`diff-why`,children:n})]}),(0,G.jsxs)(`div`,{className:`diff-body`,children:[!s&&!l&&(0,G.jsx)(`p`,{className:`dim`,children:`reading the diff…`}),s&&y.map((t,n)=>{let r=n<Qy?Zy:0,i=Gy(e,t.path);return(0,G.jsxs)(v.Fragment,{children:[n===Qy&&(0,G.jsxs)(`div`,{role:`note`,className:`diff-late-note`,children:[`Files `,21,` to `,y.length,`: their parts open on a click`]}),(0,G.jsxs)(`section`,{"aria-label":t.path||Xy,className:`diff-file`,children:[(0,G.jsx)(`code`,{className:`diff-path`,children:t.path||Xy}),i&&(0,G.jsxs)(`div`,{role:`note`,className:`diff-run`,children:[(0,G.jsx)(`span`,{className:`diff-run-mark`,"aria-hidden":`true`,children:`⚠`}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`span`,{className:`diff-run-dot`,"aria-hidden":`true`}),i,` is driven by a run: this may be its unfinished edit`]})]}),t.staged.length>0&&t.unstaged.length>0&&(0,G.jsx)(`p`,{role:`note`,className:`diff-both`,children:`⚠ Commit takes the file as it is on disk: a line held only in the index goes`}),(0,G.jsxs)(`div`,{className:`diff-parts`,children:[(0,G.jsx)($y,{head:`Staged`,lines:t.staged,none:`nothing staged`,limit:r}),(0,G.jsx)($y,{head:`Not staged`,lines:t.unstaged,none:`nothing outside the stage`,limit:r})]})]})]},t.path)})]}),(0,G.jsxs)(`div`,{className:`diff-foot`,children:[l&&(0,G.jsx)(`span`,{role:`alert`,className:`diff-err`,children:l}),(0,G.jsxs)(`div`,{className:`diff-foot-row`,children:[(0,G.jsx)(`button`,{type:`button`,className:`btn-line`,autoFocus:!r,onClick:i,disabled:d,children:`Close`}),(0,G.jsx)(`span`,{className:`diff-note`,children:m&&(b===1?`Discard puts this file back as the last commit has it; a new file goes. No undo.`:`Discard puts these files back as the last commit has them; a new file goes. No undo.`)}),m&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{type:`button`,className:`btn-danger`,ref:p,disabled:d||!s,title:`gcf edits discard: no undo`,onClick:()=>void _(m.discard),children:`Discard`}),(0,G.jsx)(`button`,{type:`button`,className:`btn-primary`,disabled:d,title:`gcf edits commit: the files as they are, in one commit`,onClick:()=>void _(m.commit),children:d?`Working…`:`Commit`})]})]})]})]})}),document.body)}var tb=()=>{},nb=(e,t)=>tb({refusal:e,error:t});function rb({ctx:e}){let[t,n]=(0,v.useState)(null);return(0,v.useEffect)(()=>(tb=n,()=>{tb=()=>{}}),[]),!t||!Ky(e)?null:(0,G.jsx)(eb,{ctx:e,refusal:t.refusal,title:t.error,onClose:()=>n(null)})}async function ib(e){if(window.isSecureContext&&navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}let t=document.activeElement,n=document.createElement(`textarea`);n.value=e,n.setAttribute(`readonly`,``),n.style.position=`fixed`,n.style.opacity=`0`,document.body.append(n),n.select(),n.setSelectionRange(0,e.length);let r=!1;try{r=document.execCommand(`copy`)}catch{r=!1}return n.remove(),t?.focus(),r}var ab=20,ob=12,sb=4,cb=16;function lb(e){return e?e.type===`text`?e.value:e.type===`element`?e.children.map(lb).join(``):``:``}var ub=e=>[.../^[ \t]*/.exec(e)?.[0]??``].reduce((e,t)=>e+(t===` `?sb:1),0);function db(e){let t=(e?.children.find(e=>e.type===`element`))?.properties.className;return(Array.isArray(t)?t:[]).map(String).find(e=>e.startsWith(`language-`))?.slice(9)??``}function fb({text:e,label:t=`code`,lang:n=``}){let r=e.replace(/\n$/,``),i=r.split(`
82
- `),a=i.length>ab,[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``);(0,v.useEffect)(()=>{if(!c)return;let e=setTimeout(()=>l(``),1500);return()=>clearTimeout(e)},[c]);let u=a&&!o?i.slice(0,ob):i;return(0,G.jsxs)(`div`,{className:`c-code`,children:[(0,G.jsxs)(`div`,{className:`c-code-head`,children:[(0,G.jsxs)(`span`,{className:`c-code-what`,children:[n||`code`,` · `,i.length,` `,i.length===1?`line`:`lines`]}),(0,G.jsx)(`button`,{type:`button`,className:`c-code-copy ${c}`,"aria-label":`Copy ${t}`,title:c===`no`?`The browser did not let the page copy`:`Copies the whole ${t}, folded or not`,onClick:()=>void ib(r).then(e=>l(e?`ok`:`no`)),children:c===`ok`?`✓ Copied`:c===`no`?`Not copied`:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,G.jsx)(`rect`,{x:`8`,y:`8`,width:`12`,height:`12`,rx:`2`}),(0,G.jsx)(`path`,{d:`M16 8V5a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h3`})]}),`Copy`]})})]}),(0,G.jsx)(`pre`,{className:a&&!o?`folded`:``,children:(0,G.jsx)(`code`,{children:u.map((e,t)=>{let n=Math.min(ub(e),cb)+2;return(0,G.jsxs)(`span`,{className:`ln`,style:{paddingLeft:`${n}ch`,textIndent:`-${n}ch`},children:[e,`
83
- `]},t)})})}),a&&(0,G.jsxs)(`button`,{type:`button`,className:`c-code-more`,"aria-expanded":o,onClick:()=>s(!o),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:o?`▴`:`▾`}),` `,o?`Less`:`More (${i.length-ob} lines)`]})]})}function pb(e,t){return e?`${e}${e.endsWith(`
84
- `)?``:`
85
- `}${t}`:t}var mb=/^([a-z][a-z0-9_]*):/;function hb(e){let t=!1;return e.split(`
86
- `).flatMap(e=>{/^\s*```/.test(e)&&(t=!t);let n=t?null:mb.exec(e);return n?[n[1]]:[]})}function gb(e){let t=hb(e).length,n=e.split(`
87
- `).length;return`${t} ${t===1?`block`:`blocks`} · ${n} ${n===1?`line`:`lines`}`}function _b(e,t){let n=Array.from({length:e.length+1},()=>Array(t.length+1).fill(0));for(let r=e.length-1;r>=0;r--)for(let i=t.length-1;i>=0;i--)n[r][i]=e[r]===t[i]?n[r+1][i+1]+1:Math.max(n[r+1][i],n[r][i+1]);let r=[],i=[],a=()=>{r.push(...i.filter(e=>e.kind===`del`),...i.filter(e=>e.kind===`add`)),i=[]},o=0,s=0;for(;o<e.length||s<t.length;)o<e.length&&s<t.length&&e[o]===t[s]?(a(),r.push({kind:`ctx`,text:e[o]}),o++,s++):s<t.length&&(o>=e.length||n[o][s+1]>=n[o+1][s])?i.push({kind:`add`,text:t[s++]}):i.push({kind:`del`,text:e[o++]});return a(),r}var vb=e=>e===`title`?`title`:`${e}:`;function yb({block:e,old:t,new:n}){return e===`title`?``:t.length?n.length?``:`block removed`:`new block`}function bb(e){let t=e.filter(e=>e.kind===`del`).length,n=e.filter(e=>e.kind===`add`).length;return[t?`−${t}`:``,n?`+${n}`:``].filter(Boolean).join(` `)}function xb(e,t){let n=e.length,r=new Set(e.map(e=>e.block)),i=hb(t).filter(e=>!r.has(e));return{sum:`${n} ${n===1?`block changes`:`blocks change`}: ${e.map(e=>vb(e.block)).join(`, `)}`,stays:i.length?`${i.map(vb).join(`, `)} ${i.length===1?`stays as it is`:`stay as they are`}.`:``}}var Sb=60,Cb={ctx:{sign:` `,tip:`unchanged`},del:{sign:`−`,tip:`old line`},add:{sign:`+`,tip:`new line`}};function wb({change:e}){let t=(0,v.useMemo)(()=>_b(e.old,e.new),[e]),[n,r]=(0,v.useState)(!1),i=n?t:t.slice(0,Sb),a=t.length-i.length,o=vb(e.block),s=yb(e);return(0,G.jsxs)(`section`,{"aria-label":o,className:`am-block`,children:[(0,G.jsxs)(`div`,{className:`am-block-h`,children:[(0,G.jsx)(`code`,{children:o}),s&&(0,G.jsx)(`span`,{className:`am-state ${e.old.length?`gone`:`new`}`,children:s}),(0,G.jsx)(`span`,{className:`am-counts`,children:bb(t)})]}),(0,G.jsxs)(`div`,{className:`am-lines`,children:[i.map((e,t)=>(0,G.jsxs)(`div`,{className:`am-line ${e.kind}`,title:Cb[e.kind].tip,children:[e.kind===`ctx`?(0,G.jsx)(`span`,{"aria-hidden":`true`}):(0,G.jsx)(`span`,{role:`img`,"aria-label":Cb[e.kind].tip,children:Cb[e.kind].sign}),(0,G.jsx)(`span`,{className:`am-line-text`,children:e.text||` `})]},t)),a>0&&(0,G.jsxs)(`button`,{type:`button`,className:`diff-more`,title:`The first ${Sb} lines are shown: the rest opens here`,onClick:()=>r(!0),children:[`Show `,a,` more lines`]})]})]})}function Tb({preview:e}){let{changes:t,text:n}=e;if(!t.length)return(0,G.jsx)(`p`,{className:`am-sum`,children:`The card already says this: nothing changes.`});let{sum:r,stays:i}=xb(t,n);return(0,G.jsxs)(`div`,{className:`am-changes`,children:[(0,G.jsxs)(`div`,{className:`am-sums`,children:[(0,G.jsx)(`span`,{className:`am-sum`,children:r}),i&&(0,G.jsx)(`span`,{className:`am-stays`,children:i})]}),t.map(e=>(0,G.jsx)(wb,{change:e},e.block))]})}var Eb=e=>typeof e==`string`?e:``,Db=e=>(e??``).slice(0,7),Ob=`Nothing was written. The card's text is read again in the box; what you typed waits in The text not used.`;function kb({ctx:e,open:t,onClose:n}){let{move:r}=t,i=t.id??``,a=(0,v.useId)(),o=e.project.name,s=e.board.items.find(e=>e.id===i),c=e.board.inbox??[],[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(``),_=Eb(t.values?.from),[y,b]=(0,v.useState)(_),[x,S]=(0,v.useState)(null),[C,w]=(0,v.useState)(null),[T,E]=(0,v.useState)(!1),[D,O]=(0,v.useState)(null),k=async e=>{let t=await H.movePreview(o,i,e);u(t),f(t.title),m(t.text),S(null)};(0,v.useEffect)(()=>{let e=t.values??{};g(Eb(e.add)),k({text:Eb(e.text),title:Eb(e.title)}).catch(t=>{w({title:Eb(e.title),text:Eb(e.text),add:``,why:`What the agent proposed: gcf could not read it. Nothing in it was written: take from it what still holds.`}),O({head:`gcf refused it`,words:t.message}),k({}).catch(e=>O({head:`gcf refused it`,words:e.message}))})},[]);let A={text:p,add:h,title:d,from:y},j=async e=>{w(e=>{let t=e&&p===l?.text;return{title:e&&d===l?.title?e.title:d,text:t?e.text:p,add:[e?.add,h].filter(Boolean).join(`
88
- `),why:t?e.why:`What you typed before the card changed. Nothing in it was written: take from it what still holds.`}}),g(``),await k({}),O(e)},M=async()=>{if(!T){E(!0),O(null);try{let e=await H.movePreview(o,i,A);e.base===l?.base?S(e):await j({head:`The card changed`,words:`The card changed while this form was open (${Db(l?.base)} → ${Db(e.base)}).`,note:Ob})}catch(e){O({head:`gcf refused it`,words:e.message})}finally{E(!1)}}},N=async()=>{if(!T){E(!0),O(null);try{let a=await e.moveIn({cmd:r.cmd,id:i,...A,base:l?.base,...t.extra});if(a.ok)return n();if(a.refusal?.code===`stale`)return await j({head:`gcf refused it`,words:a.err,note:Ob});O({head:`gcf refused it`,words:a.err,refusal:a.refusal,note:a.refusal?.code===`running`?`Nothing was written. Amend it after the run.`:``})}catch(e){O({head:`gcf refused it`,words:e.message})}finally{E(!1)}}},P=r.hint&&s&&!s.running&&r.hint.status.includes(s.status)?r.hint.text:``,F=e=>r.fields.find(t=>t.key===e),I=F(`add`)?.max,L=I!==void 0&&h.length>I,ee=!!l&&(p!==l?.text||d!==l?.title||!!h),te=ee||!!l?.changes.length||!!y,ne=!!l&&!L&&te,R=!!(x?.changes.length||y),z=L?`${F(`add`)?.label}: at most ${I} characters`:te?`Asks gcf for the old and new lines, block by block: nothing is written yet`:`Nothing differs from the card as read`,B=e=>t=>{T||(e(t.target.value),O(null))},V=s?.running?`running`:s?.status,re=V===`running`?`running`:e.board.domain.columns.find(e=>e.status===V)?.label??V,ie=D?.refusal;return(0,G.jsx)(De,{onClose:n,dirty:T||ee||!!C||y!==_,children:(0,G.jsxs)(`div`,{className:`am-sheet`,role:`dialog`,"aria-modal":!0,"aria-label":t.title,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),(x?!R:!ne)||(x?N():M()))},children:[(0,G.jsxs)(`div`,{className:`am-head`,children:[(0,G.jsxs)(`div`,{className:`am-head-row`,children:[(0,G.jsx)(`h2`,{children:t.title}),(s?.title??l?.title)&&(0,G.jsx)(`span`,{className:`am-card-title`,children:s?.title??l?.title}),V&&(0,G.jsx)(`span`,{className:`badge tone-${V}`,title:`Its status now: amend leaves it as it is`,children:re}),(0,G.jsx)(`span`,{className:`am-gap`}),(0,G.jsxs)(`ol`,{"aria-label":`Steps`,className:`am-steps`,children:[(0,G.jsx)(`li`,{"aria-current":x?void 0:`step`,children:`1 · Text`}),(0,G.jsx)(`li`,{"aria-current":x?`step`:void 0,title:z,children:`2 · Changes`})]}),l&&(0,G.jsxs)(`span`,{className:`am-base`,title:`Read at ${l.base}: if the card changes after this read, the move is refused and the form reads it again`,children:[`read at `,Db(l.base)]}),(0,G.jsx)(`button`,{type:`button`,className:`am-x`,disabled:T,"aria-label":`Close without amending`,title:`Close: nothing is written`,onClick:n,children:`✕`})]}),(0,G.jsx)(`p`,{className:`am-help`,children:r.help?`${r.help}.`:``}),P&&(0,G.jsxs)(`div`,{role:`note`,className:`am-built`,children:[(0,G.jsx)(`span`,{children:`Built`}),(0,G.jsx)(`span`,{children:P})]}),t.extra?.proposal!==void 0&&(0,G.jsxs)(`span`,{className:`am-from-prop`,children:[`Filled in from the agent's proposal: `,r.label,` makes the move as it stands here.`]}),D&&(ie&&`paths`in ie?(0,G.jsx)(Yy,{ctx:e,refusal:ie,error:D.words}):(0,G.jsxs)(`div`,{role:`alert`,className:`am-error`,children:[(0,G.jsx)(`span`,{className:`am-error-h`,children:D.head}),(0,G.jsx)(`span`,{className:`am-error-words`,children:D.words}),D.note&&(0,G.jsx)(`span`,{className:`am-error-note`,children:D.note})]}))]}),!l&&!D&&(0,G.jsx)(`p`,{className:`am-reading`,children:`Reading the card…`}),l&&!x&&(0,G.jsxs)(`div`,{className:`am-body ${C?`stale`:``}`,children:[(0,G.jsxs)(`div`,{className:`am-col am-main`,children:[C&&(0,G.jsx)(`span`,{className:`am-eyebrow`,children:`The card now, read again`}),(0,G.jsxs)(`div`,{className:`f-field`,children:[(0,G.jsx)(`span`,{className:`f-label`,children:(0,G.jsx)(`label`,{htmlFor:`${a}-title`,children:F(`title`)?.label??`Title`})}),(0,G.jsx)(`input`,{id:`${a}-title`,className:`input am-ctl`,value:d,onChange:B(f)})]}),(0,G.jsxs)(`div`,{className:`f-field am-text`,children:[(0,G.jsxs)(`span`,{className:`f-label am-label-row`,children:[(0,G.jsx)(`label`,{htmlFor:`${a}-text`,children:F(`text`)?.label??`Blocks to replace`}),(0,G.jsx)(`span`,{className:`am-meta`,children:gb(p)})]}),(0,G.jsx)(`textarea`,{id:`${a}-text`,className:`input mono am-box`,spellCheck:!1,autoFocus:!0,value:p,onChange:B(m)}),(0,G.jsx)(`span`,{className:`field-help`,children:`tuning: and provenance: are not in the box: they stay as they are. A block you leave out stays as it is; its key alone, with nothing under it, takes it out. Change the line that is wrong: only these blocks reach the systems docs.`})]})]}),(0,G.jsxs)(`div`,{className:`am-col`,children:[C&&(0,G.jsxs)(`section`,{"aria-label":`The text not used`,className:`am-unused`,children:[(0,G.jsx)(`span`,{className:`am-eyebrow warn`,children:`The text not used`}),(0,G.jsx)(`span`,{className:`am-unused-why`,children:C.why}),(0,G.jsxs)(`div`,{className:`am-unused-box`,"aria-readonly":`true`,children:[C.title&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{children:F(`title`)?.label??`Title`}),(0,G.jsx)(`span`,{className:`am-unused-title`,children:C.title})]}),C.text&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{children:F(`text`)?.label??`Blocks to replace`}),(0,G.jsx)(`pre`,{children:C.text})]}),C.add.trim()&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{children:F(`add`)?.label??`Lines to add to notes`}),(0,G.jsx)(`pre`,{children:C.add})]})]})]}),(0,G.jsxs)(`div`,{className:`f-field`,children:[(0,G.jsxs)(`span`,{className:`f-label am-label-row`,children:[(0,G.jsx)(`label`,{htmlFor:`${a}-add`,children:F(`add`)?.label??`Lines to add to notes`}),I!==void 0&&(0,G.jsxs)(`span`,{className:`am-meta ${L?`over`:``}`,children:[h.length,` / `,I]})]}),(0,G.jsx)(`textarea`,{id:`${a}-add`,className:`input am-box am-add`,rows:5,value:h,onChange:B(g)}),(0,G.jsx)(`span`,{className:`field-help`,children:`One line each: each goes under notes: as a “- ” line. The lines notes: holds stay.`})]}),(c.length>0||y)&&(0,G.jsxs)(`div`,{className:`f-field`,children:[(0,G.jsx)(`span`,{className:`f-label`,children:(0,G.jsx)(`label`,{htmlFor:`${a}-from`,children:F(`from`)?.label??`Inbox entry it takes: erased`})}),(0,G.jsxs)(`select`,{id:`${a}-from`,className:`input am-ctl`,value:y,onChange:B(b),children:[(0,G.jsx)(`option`,{value:``,children:`none`}),y&&!c.some(e=>e.id===y)&&(0,G.jsx)(`option`,{value:y,children:y}),c.map(e=>(0,G.jsxs)(`option`,{value:e.id,children:[e.id,` · `,Ti(e.title??e.text.split(`
89
- `)[0],60)]},e.id))]}),(0,G.jsx)(`span`,{className:`field-help`,children:y?`Takes inbox entry ${y}: it is erased, and its words go to notes unless you write lines above.`:`The inbox entry this fix answers, if any: it is erased with the move.`})]})]})]}),x&&(0,G.jsx)(`div`,{className:`am-body am-review`,children:(0,G.jsx)(Tb,{preview:x})}),(0,G.jsx)(`div`,{className:`am-foot`,children:x?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{type:`button`,className:`btn-line`,disabled:T,onClick:()=>S(null),children:`← Back to the text`}),(0,G.jsxs)(`span`,{className:`am-foot-note mono`,children:[`gcf item amend `,i,` · one commit · the status stays`]}),(0,G.jsx)(`button`,{type:`button`,className:`btn-primary`,autoFocus:!0,disabled:!x||!R,"aria-busy":T,onClick:()=>void N(),children:T?`Committing…`:r.label},`make`)]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{type:`button`,className:`btn-line`,disabled:T,onClick:n,children:`Cancel`}),(0,G.jsx)(`span`,{className:`am-foot-note`,children:`Nothing is written yet: Show changes reads the old and new lines first.`}),(0,G.jsx)(`button`,{type:`button`,className:`btn-primary`,title:z,disabled:!ne,"aria-busy":T,onClick:()=>void M(),children:T?`Reading the changes…`:`Show changes`})]})})]})})}function Ab(e){let t=e.split(`
90
- `),n=t.pop()??``,r=[];for(let e of t)if(e.trim())try{let t=JSON.parse(e);t&&typeof t.type==`string`&&r.push(t)}catch{}return{events:r,rest:n}}var jb=` (Recommended)`;function Mb(e){let t={live:!1,phase:`idle`,ctx:void 0,bg:[],cost:0,limitUntil:null,limitReserve:!1,limitPct:null,resuming:!1,waitKind:null,waitAt:null,everStarted:!1,endedIdle:!1,freshQueued:!1,tasks:[]},n=0,r=!1,i=new Set;for(let a of e)switch(a.type===`turn`?r=!0:([`session`,`working`,`read`,`agent`].includes(a.type)||a.type===`say`&&a.by===`operator`)&&(r=!1),(a.type===`session`||a.type===`session_end`||a.type===`closed`)&&(t.resuming=!1),a.type){case`session`:t.live=!0,t.everStarted=!0,t.endedIdle=!1,t.phase=`ready`,n=0,t.limitUntil=null,i.clear(),a.kind===`handoff`&&(t.ctx=0,t.freshQueued=!1);break;case`session_end`:t.live=!1,t.cost+=a.cost_usd??n,n=0,t.phase=a.code===`idle`?`idle`:`ended`,t.endedIdle=a.code===`idle`,t.bg=[],t.freshQueued=!1,i.clear();break;case`limit`:t.phase=`limit`,t.limitUntil=a.until,t.limitReserve=!!a.reserve,t.limitPct=a.pct??null;break;case`limit_end`:t.phase=`ended`,t.limitUntil=null,t.resuming=a.by!==`stop`&&a.by!==`hold`;break;case`closed`:t.live=!1,t.phase=`ended`,t.endedIdle=!1,t.limitUntil=null,t.bg=[],t.freshQueued=!1,i.clear();break;case`working`:case`read`:case`agent`:t.live&&t.phase!==`limit`&&(t.phase=`working`);break;case`say`:a.by===`operator`&&(t.phase===`waiting`||t.phase===`ready`)&&(t.phase=`working`);break;case`waiting`:t.phase=`waiting`,t.waitKind=a.kind,t.waitAt=a.at;break;case`question`:case`approval`:i.add(a.request_id);break;case`answer`:case`allowed`:case`denied`:case`dropped`:a.request_id&&i.delete(a.request_id),t.phase===`waiting`&&t.waitKind===`card`&&!i.size&&(t.phase=`working`);break;case`timeout`:a.kind===`card`&&i.clear();break;case`interrupt`:t.phase=`working`;break;case`turn`:n=a.total_cost_usd??n,a.context_pct!==void 0&&(t.ctx=a.context_pct);break;case`context`:t.ctx=a.context_pct;break;case`background`:t.bg=a.tasks??[];break;case`handoff`:t.freshQueued=!!(a.error&&t.bg.length)}return t.live&&(t.cost+=n),t.tasks=[...Nb(e).values()].filter(e=>e.state===`running`).map(e=>({id:e.id,run:e.run,kind:e.what,agent:e.agent,description:e.description,doing:e.doing,calls:e.calls,at:e.at})),t.phase===`waiting`&&t.waitKind===`text`&&t.bg.length&&(t.phase=`background`),t.phase===`working`&&r&&t.bg.length&&(t.phase=`background`),t}function Nb(e){let t=new Map,n=new Map,r=new Set,i=(e,t)=>Date.parse(t)-Date.parse(e.at);return e.forEach((e,a)=>{if(e.type===`session`||e.type===`session_end`||e.type===`closed`){for(let e of n.values())e.state===`running`&&(e.state=`stopped`);n.clear(),r=new Set}else if(e.type===`background`){let t=new Set((e.tasks??[]).map(e=>e.id));for(let a of r){let r=n.get(a);t.has(a)||r?.state!==`running`||(r.state=`done`,r.doing=null,r.ms??=i(r,e.at))}r=t}else if(e.type===`task`){let r=n.get(e.id);(!r||e.phase===`start`&&r.state!==`running`)&&(r={kind:`task`,at:e.at,id:e.id,run:a,what:`task`,agent:null,description:``,prompt:``,doing:null,calls:null,ms:null,state:`running`,status:null,summary:``,background:!1},n.set(e.id,r),t.set(a,r)),e.kind&&r.what===`task`&&(r.what=e.kind),e.agent&&(r.agent??=e.agent),e.description&&!r.description&&(r.description=e.description),e.prompt&&!r.prompt&&(r.prompt=e.prompt),e.background&&(r.background=!0),typeof e.calls==`number`&&(r.calls=e.calls),e.phase===`progress`&&(e.doing&&r.state===`running`&&(r.doing=e.doing),typeof e.ms==`number`&&(r.ms=e.ms)),e.phase===`end`&&(r.status=e.status??null,r.state=!e.status||e.status===`completed`?`done`:/kill|stop/.test(e.status)?`stopped`:`failed`,r.summary=e.summary??r.summary,r.doing=null,r.ms=typeof e.ms==`number`?e.ms:i(r,e.at))}}),t}function Pb(e){let t=new Map;for(let n of e)n.type===`question`||n.type===`approval`?t.set(n.request_id,n):n.type===`answer`||n.type===`allowed`||n.type===`dropped`||n.type===`denied`&&n.request_id?t.delete(n.request_id):(n.type===`timeout`&&n.kind===`card`||n.type===`session_end`||n.type===`session`||n.type===`closed`)&&t.clear();return[...t.values()][0]??null}function Fb(e){let t=-1;return e.forEach((e,n)=>{e.type===`session`&&e.kind===`handoff`&&(t=n)}),t<0||e.slice(t).some(e=>e.type===`say`&&e.by===`operator`)}var Ib={edit:`edit`,shell:`shell`,read:`read`,search:`search`,web:`web`,mcp:`mcp`,skill:`skill`,subagent:`subagent`,other:`other`},Lb={operator:`denied by you`,rule:`denied by a deny rule of the project`,timeout:`denied: no answer in time`,engine:`refused by the center itself`},Rb=e=>`$${(e??0).toFixed(2)}`,zb=e=>e.kind===`approval`&&e.state!==`waiting`||e.kind===`refused`||e.kind===`line`&&!!e.tech,Bb=e=>e?ia(e):`?`;function Vb(e,{talk:t,answerMin:n}){let r=[],i=new Map,a=new Map,o=new Map,s=Mb(e),c=0,l=null,u=!1,d=null,f=[],p=(e,t,n,i=null,a={})=>r.push({kind:`line`,at:e.at,mark:t,text:n,tone:i,...a}),m=Nb(e),h=m.size>0,g=()=>{for(let e of a.values())e.state===`waiting`&&(e.state=`dropped`,e.dropWhy=`the session closed`)};return e.forEach((_,v)=>{switch(_.type){case`session`:{c++,g();let e=_.model!==void 0||_.effort!==void 0?`model ${_.model??`default`}, effort ${_.effort??`default`}`:null,n=e&&(d===null?_.model||_.effort:e!==d)?` · on ${e}`:``;d=e??d,_.kind===`handoff`?(l=null,p(_,`↻`,(t?`a fresh agent goes on from the summary`:`fresh session · it goes on from the Handoff in the plan`)+n,`running`)):_.kind===`resume`?p(_,`▸`,(t?u?`agent started again after the reset · it remembers the earlier talk`:`agent started again · it remembers the earlier talk`:`session resumed · it remembers the talk`)+n,`running`):p(_,`▸`,(t?`agent started`:`run session started`)+n,`running`);break}case`session_end`:g(),f=[],_.code===`idle`?p(_,`■`,`agent closed after ${n} min with no input · not an error: your next message starts it again`):_.limit_resets?p(_,`■`,`${t?`agent closed at once at the usage limit`:`session ended at the usage limit`} · resets ${_.limit_resets} · ${Rb(_.cost_usd)}`,null,{mono:!0}):_.code===`handoff`?p(_,`■`,`session ended for the handoff · ${Rb(_.cost_usd)}`,null,{mono:!0}):_.code===`stopped`?p(_,`■`,`session stopped · ${Rb(_.cost_usd)}`,null,{mono:!0}):p(_,`■`,`${t&&typeof _.code==`number`?`agent ended (exit ${_.code})`:t?`agent ended`:`session ended`} · ${Rb(_.cost_usd)}`,null,{mono:!0});break;case`closed`:{u=!1,g(),f=[];let e=_.dropped?` · ${_.dropped===1?`1 message`:`${_.dropped} messages`} not sent`:``;p(_,`■`,`agent closed by you, with all it started · your next message resumes the talk${e}`);break}case`held`:p(_,`‖`,_.reason===`hold`?`held by you · the session hands over at its next step; Run goes on from the plan`:`quota at its reserve · the session hands over; the run goes on after the reset`);break;case`limit`:{u=!0;let e=s.phase===`limit`&&s.limitUntil===_.until,n=t?` · the agent starts again by itself after the reset and finishes the cut reply. Until then only a message is taken: Stop, card answers and fresh agent are off; close agent ends the wait`:` · the session goes on by itself; a message sent now reaches the agent after the reset`,r=da(_.until,_.reserve,_.pct,Bb);p(_,`◷`,`${r}${e?`${n} · reset early? Go on now`:``}`,`neutral`,{box:e,wake:e,tip:_.reserve?`Your quota reserve (Settings) keeps automation off the last share of the quota until the reset.`:`The usage limit is one for the account. It waits for the reset by itself.`});break}case`limit_end`:(_.by===`operator`||_.by===`usage`)&&p(_,`◷`,_.by===`operator`?`went on before the reset: you pressed Go on now`:`went on before the reset: /usage says the limit is back`);break;case`say`:if(_.by===`operator`||_.by===`timeout`){let e=Ue(_.text),t={kind:`me`,at:_.at,text:e.text,replyAt:e.at,images:_.images??[],byTimeout:_.by===`timeout`,n:_.n,status:_.by===`timeout`?`sent by the timeout: no answer came in ${n} min`:_.retry?`sent again after a crash: it may be a duplicate`:s.phase===`limit`?`accepted · reaches the agent after the reset`:`sent`};i.set(`${c}:${_.n}`,t),r.push(t)}else _.by===`run`?p(_,`›`,`run prompt: ${_.text}`,null,{mono:!0}):l?l.tip=`The center asked the agent: ${_.text}`:t&&u?(u=!1,p(_,`›`,`the center asked the agent after the reset: “${_.text}” · its next text answers this`,null,{box:!0,tip:`say by: engine — the center's own words to the agent`})):p(_,`·`,`the center asked the agent for a summary`,null,{tip:_.text});break;case`read`:{let e=i.get(`${c}:${_.n}`);e&&!e.byTimeout&&(e.status=`${e.status.startsWith(`sent again`)?`sent again after a crash · `:``}${_.assumed?`taken as read: no echo came`:`read ${ia(_.at)}`}`);break}case`agent`:/hit your (session )?limit/i.test(_.text)?r.push({kind:`claude`,at:_.at,text:_.text}):l?l.summary=l.summary?`${l.summary}\n\n${_.text}`:_.text:r.push({kind:`agent`,at:_.at,text:_.text});break;case`question`:{let e={kind:`question`,at:_.at,id:_.request_id,state:`waiting`,questions:_.questions.map(e=>({...e,options:(e.options??[]).map(e=>({raw:e.label,label:e.label.endsWith(` (Recommended)`)?e.label.slice(0,-14):e.label,rec:e.label.endsWith(jb),description:e.description}))}))};a.set(_.request_id,e),o.set(_.request_id,v),r.push(e);break}case`answer`:{let e=a.get(_.request_id);e?.kind===`question`&&(e.state=_.by===`timeout`?`timeout`:`answered`,e.answers=_.answers);break}case`dropped`:{let t=a.get(_.request_id);if(!t)break;let n=e.slice(o.get(_.request_id)??0,v);t.state=`dropped`,t.dropWhy=n.some(e=>e.type===`interrupt`)?`your Stop ended the turn`:n.some(e=>e.type===`session_end`)?`the session closed`:`the turn ended`;break}case`approval`:{let e={kind:`approval`,at:_.at,id:_.request_id,tool:_.tool,what:Ib[_.kind]??_.kind,title:_.title,reason:_.reason,always:_.always,..._.always&&_.always_wide?{wide:!0}:{},state:`waiting`};a.set(_.request_id,e),r.push(e);break}case`allowed`:{if(_.by===`yolo`){r.push({kind:`approval`,at:_.at,id:_.request_id,tool:_.tool,what:Ib[_.kind]??_.kind,title:_.title,reason:_.reason,state:`auto`});break}let t=a.get(_.request_id);t?.kind===`approval`&&(t.state=_.always?`always`:`once`,t.rule=_.rule??t.always,t.notSaved=!_.always&&!!t.always&&e.slice(Math.max(0,v-2),v).some(e=>e.type===`error`&&e.text.startsWith(`the rule ${t.always} was not saved`)));break}case`run_end`:r.push({kind:`run_end`,at:_.at,end:_});break;case`denied`:{let e=_.request_id?a.get(_.request_id):void 0;e?.kind===`approval`?(e.state=`denied`,e.deniedBy=_.by):_.by===`engine`&&!t?_.tool===`AskUserQuestion`?p(_,`✕`,`question card refused by the center: this run asks nothing (answer time 0)`,`warn`,{box:!0,tech:{tool:`question`,title:`AskUserQuestion`,out:`refused by the center: this run asks nothing`,tone:`warn`},tip:`chat.answer_timeout_min is 0: the session asks no question`}):p(_,`✕`,`${_.tool||`the call`} refused by the center: no one approves a call in a run`,`warn`,{box:!0,tech:{tool:_.kind??(_.tool||`call`),title:_.title||(_.kind?_.tool:``),out:`refused by the center: no one approves a call in a run`,tone:`warn`},mono:!0,tip:`A run asks no permission: its deny rules decide`}):_.by===`engine`?p(_,`✕`,`${_.tool}${_.title?` ${_.title}`:``} — refused by the center: ${_.reason??``}`,`warn`,{box:!0,tech:{tool:_.kind??_.tool,title:_.title||(_.kind?_.tool:``),out:`refused by the center: a main run works here`,tone:`warn`},mono:!0,tip:`The center refused it by itself, with no card: a main run works in the same folder.`}):_.by===`rule`?r.push({kind:`refused`,at:_.at,tool:_.tool,what:_.kind??_.tool,title:_.title??``,why:_.description??``,rule:_.rule,group:_.group,reason:_.reason??``}):p(_,`✕`,`${_.tool}${_.title?` ${_.title}`:``} — ${Lb[_.by??``]??`denied`}${_.reason?`: ${_.reason}`:``}`,null,{mono:!0,tech:{tool:_.kind??_.tool,title:_.title||(_.kind?_.tool:``),out:Lb[_.by??``]??`denied`}});break}case`timeout`:if(_.kind===`text`)p(_,`◷`,`no answer in ${n} min: the default answer goes to the agent`);else for(let e of a.values())e.state===`waiting`&&(e.kind===`approval`?(e.state=`denied`,e.deniedBy=`timeout`):e.state=`timeout`);break;case`interrupt`:p(_,`‖`,t?`you pressed Stop: the step stopped · the agent waits for your message and closes after ${n} min, as after any reply`:`you pressed Stop: the step stopped, the session stays open`,`neutral`);break;case`waiting`:_.kind===`stop`&&!t&&p(_,`·`,`the agent waits for your message; after a Stop no default answer comes`);break;case`error`:p(_,`✕`,_.text,`error`,{box:!0,mono:!0,tip:`Input that reached no one`});break;case`task`:{let e=m.get(v);e&&r.push(e);break}case`background`:if(f=_.tasks??[],h)break;p(_,`⟳`,_.tasks?.length?`in the background: ${_.tasks.map(e=>e.description).join(`, `)} · no timer runs, no default answer comes`:`background tasks done`,`running`);break;case`compacted`:p(_,`↧`,`the agent compacted its context by itself`);break;case`handoff`:{if(_.error){let e=l;e?(e.failed=!0,l=null,p(_,`✕`,`the summary failed: ${_.error} · the same agent goes on`,`warn`,{box:!0,tip:`The fresh agent did not start. The talk goes on with the agent you had.`})):f.length?p(_,`◷`,`fresh agent queued: ${_.error} · once the background tasks end it takes over by itself, with no second click`,`neutral`,{box:!0,tip:`Not an error: the summary turn waits for the background tasks`}):p(_,`↻`,`fresh agent: ${_.error} · the agent is a fresh one already and has not had your message: nothing changes`,`neutral`,{box:!0,tip:`Not an error: the press changes nothing`});break}let e=typeof _.pct==`number`?` · context ${_.pct}%`:_.tokens?` · ${Math.round(_.tokens/1e3)}k tokens`:``;if(t){let t=_.by===`operator`?`by you, with fresh agent`:_.by===`threshold`?`past the handoff share`:_.by===`compacted`?`after a compaction`:`handed over`;l={kind:`divider`,at:_.at,by:`${t}${e}`,summary:``,failed:!1},r.push(l)}else p(_,`↻`,`context handoff${typeof _.pct==`number`?` at ${_.pct}%`:``} · the agent writes its Handoff into the plan, a fresh session goes on`,`running`);break}case`proposal`:r.push({kind:`proposal`,at:_.at,id:_.id,move:_.move,fields:_.fields??{}});break;case`step`:{let e=`ok`in _?_.ok:null,t;if(_.step===`plan`)t=_.stalled?`planning does not converge · ${_.stalled.join(`, `)}`:`plan converged in ${_.passes} passes · implementation in a fresh session`;else if(_.step===`move`)t=`${{submit:`submitted · waits for your verdict`,close:`closed`,block:`blocked`}[_.move]??_.move}${_.text?` · ${_.text}`:``}`;else if(_.step===`build`)t=e===null&&_.text?_.text:(e===null?`building the game to play…`:e?`the build to play is ready`:`the build to play failed`)+(_.text?` · ${_.text}`:``);else{let n={dod:`checks (DoD)`,review:`review`,commit:`committed`}[_.step];t=_.step===`commit`&&e?`committed`:_.step===`review`&&e?`review done`:`${n}${e===!0?` green`:e===!1?` red`:`: result unknown · the check ran, its result could not be matched`}`,_.text&&(t+=` · ${_.text}`)}let n=_.step===`plan`&&!(`stalled`in _&&_.stalled);r.push({kind:`step`,at:_.at,mark:n||e===!0?`✔`:e===!1?`✘`:_.step===`build`?_.text?`·`:`…`:`?`,text:t,tone:n||e===!0?`ok`:e===!1?`error`:`neutral`,unknown:!n&&e===null&&_.step!==`build`});break}}}),r}function Hb(e,t){let n=[],r=null;for(let t of e)t.type===`session`&&r===null?r=t.at:t.type===`run_end`&&r!==null&&(n.push({start:r,end:t.at,closed:!0}),r=null);return r!==null&&n.push({start:r,end:t?null:e.at(-1).at,closed:!1}),n}function Ub(e,t){let n=Hb(e.events,e.live),r=e=>n.find(t=>t.start<=e&&(t.end===null||e<=t.end))??null,i=[],a=new Set,o=0,s=0;for(;o<e.list.length||s<t.list.length;){let n=s>=t.list.length||o<e.list.length&&e.list[o].at<=t.list[s].at,c=n?e.list[o++]:t.list[s++],l=r(c.at),u=null;n&&l&&c.at===l.start&&c.kind===`line`&&!a.has(l.start)?(u=`start`,a.add(l.start)):n&&l?.closed&&c.kind===`run_end`&&c.at===l.end&&(u=`end`),i.push({e:c,part:n?e.part:t.part,rail:l!==null,ring:u})}return i}function Wb(e,t,n){let r={};for(let i=0;i<e.length;i++){let a=(t[i]??[]).map(e=>e.endsWith(` (Recommended)`)?e.slice(0,-14):e),o=a.length?a.join(`, `):(n[i]??``).trim();if(!o)return null;r[e[i].question]=o}return r}function Gb(e,t,n){let r=e=>e.id?t.some(t=>t.type===`say`&&t.id===e.id):n>e.after,i=e=>t.slice(e.from).some(t=>t.type===`error`&&/ not sent: /.test(t.text)&&(!t.id||!e.id||t.id===e.id));return e.filter(e=>!r(e)&&!i(e))}var Kb=(e,t)=>e.filter(e=>e.id&&t.slice(e.from).some(t=>t.type===`error`&&/ not sent: /.test(t.text)&&t.id===e.id)),qb=(e,t,n)=>e.filter(e=>!t.some(t=>t.type===`say`&&t.id===e.id)&&!n.some(t=>t.id===e.id)),Jb=e=>e?.status===`blocked`?e.denied_rule??null:null;async function Yb(e,t){let n=Jb(t);if(!n)return!1;let r=n.rule.replace(/^\w+: /,``);if(n.group===`guards`&&!await ke(`This run's agent may change ${r}, which the guards keep from it: its own hooks, settings or guard files. A hook it writes there runs outside the deny rules.`,`Allow for one run`,!0))return!1;let i={model:null,effort:null,allow:[n.rule],unblock:!0};return e.run([t.id],!1,i)}var Xb=`gcf-chat-tech`,Zb=[`expanded`,`collapsed`,`hidden`];function Qb(){try{let e=localStorage.getItem(Xb);return Zb.includes(e)?e:`collapsed`}catch{return`collapsed`}}var $b=Qb(),ex=new Set,tx=()=>{for(let e of ex)e()};typeof window<`u`&&window.addEventListener(`storage`,e=>{(e.key===Xb||e.key===null)&&($b=Qb(),tx())});function nx(e){$b=e;try{localStorage.setItem(Xb,e)}catch{}tx()}function rx(e){return ex.add(e),()=>{ex.delete(e)}}var ix=()=>(0,v.useSyncExternalStore)(rx,()=>$b),ax=!1,ox=new Set,sx=null,cx=0,lx=0,ux=()=>{for(let e of ox)e()};function dx(){let e=++cx;H.yolo().then(t=>{e<lx||(lx=e,ax=t.on,ux())}).catch(()=>{})}function fx(e){if(ox.add(e),!sx){let e=le(e=>{e.type===`yolo`&&dx()}),t=de(e=>{e&&dx()});sx=()=>{e(),t()},dx()}return()=>{ox.delete(e),ox.size||(sx?.(),sx=null)}}var px=()=>(0,v.useSyncExternalStore)(fx,()=>ax);async function mx(e){let t=++cx,n=await H.setYolo(e);t<lx||(lx=t,ax=n.on,ux())}var hx=[`image/png`,`image/jpeg`,`image/gif`,`image/webp`],gx=10,_x=5242500,vx=7340032,yx=`png, jpeg, gif or webp · up to 10 a message, 5 MB each, about 7 MB in all with the files`,bx=/^(https?:|mailto:)/i,xx=[Ny,pg],Sx={p:({node:e,children:t,...n})=>(0,G.jsx)(`p`,{...n,children:we(t)}),li:({node:e,children:t,...n})=>(0,G.jsx)(`li`,{...n,children:we(t)}),td:({node:e,children:t,...n})=>(0,G.jsx)(`td`,{...n,children:we(t)}),th:({node:e,children:t,...n})=>(0,G.jsx)(`th`,{...n,children:we(t)}),strong:({node:e,children:t,...n})=>(0,G.jsx)(`strong`,{...n,children:we(t)}),em:({node:e,children:t,...n})=>(0,G.jsx)(`em`,{...n,children:we(t)}),code:({children:e})=>(0,G.jsx)(Te,{children:e}),a:({node:e,href:t,children:n})=>(0,G.jsx)(be.Provider,{value:null,children:t&&bx.test(t)?(0,G.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,children:n}):(0,G.jsx)(`span`,{children:n})}),input:({node:e,type:t,checked:n})=>t===`checkbox`?(0,G.jsx)(`span`,{className:`c-task ${n?`done`:``}`,"aria-label":n?`done`:`not done`,children:n?`☑`:`☐`}):null,img:({src:e,alt:t})=>typeof e==`string`&&bx.test(e)?(0,G.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:t||e}):(0,G.jsx)(`span`,{children:t}),pre:({node:e})=>(0,G.jsx)(fb,{text:lb(e),lang:db(e)})},Cx=({text:e})=>(0,G.jsx)(tg,{remarkPlugins:xx,components:Sx,children:e}),wx=e=>`${(e/1024/1024).toFixed(1)} MB`,Tx=e=>`$${e.toFixed(2)}`,Ex=(...e)=>(0,G.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.9`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:e.map(e=>(0,G.jsx)(`path`,{d:e},e))}),Dx={file:Ex(`M20 11.5l-8.2 8.2a5 5 0 0 1-7.1-7.1l8.6-8.6a3.4 3.4 0 0 1 4.8 4.8l-8.6 8.6a1.7 1.7 0 0 1-2.4-2.4l7.9-7.9`),picture:Ex(`M5.5 4.5h13a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2v-11a2 2 0 0 1 2-2z`,`M10.6 10a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0z`,`M20.5 16l-5-5-8 8.5`),fresh:Ex(`M20 12a8 8 0 1 1-2.6-5.9`,`M20 4v5h-5`),stop:(0,G.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,G.jsx)(`rect`,{x:`5`,y:`5`,width:`14`,height:`14`,rx:`2`,fill:`currentColor`})}),close:Ex(`M6 6l12 12M18 6L6 18`),hold:Ex(`M9 5v14`,`M15 5v14`),send:Ex(`M21 3L10.5 13.5`,`M21 3l-6.5 18-4-7.5L3 9.5z`)};function Ox(e){let[t,n]=(0,v.useState)([]);return(0,v.useEffect)(()=>{if(n([]),!e)return;let t=``,r=!0;return U(e,()=>{t=``,r=!0},e=>{let i=Ab(t+e);t=i.rest;let a=r;r=!1,n(e=>a?i.events:[...e,...i.events])})},[e]),t}var kx=15e3;function Ax(e){let[t,n]=(0,v.useState)(Date.now());return(0,v.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),t}function jx({from:e,minutes:t}){let n=Ax(!0),r=Math.max(0,Math.round((Date.parse(e)+t*6e4-n)/1e3));return(0,G.jsxs)(`span`,{"aria-live":`off`,className:`mono`,children:[String(Math.floor(r/60)).padStart(2,`0`),`:`,String(r%60).padStart(2,`0`)]})}var Mx=(e,t)=>{let n=e.board.chat?.answer_timeout_min;return t?n||15:n??15};function Nx({e,part:t,minutes:n,live:r}){let[i,a]=(0,v.useState)({}),[o,s]=(0,v.useState)({}),[c,l]=(0,v.useState)(!1),u=r.phase===`limit`,d=e.state===`waiting`&&!u,f=Wb(e.questions,i,o),p=async()=>{f&&(l(!0),await t.send({type:`answer`,request_id:e.id,answers:f}).catch(()=>{}),l(!1))},m=e.state===`answered`?`answered by you`:e.state===`timeout`?`no answer in ${n} min: ${e.questions.every(e=>e.options.some(e=>e.rec))?`the recommended option was taken`:`the default text went to the agent`}`:e.state===`dropped`?`withdrawn: ${e.dropWhy??`the turn ended`}`:u?`off: no card is open during the limit wait`:`waiting for you · the default goes in`;return(0,G.jsxs)(`div`,{role:`group`,"aria-label":`Question from the agent`,className:`c-card ${d?`pending`:``}`,children:[e.questions.map((t,n)=>{let r=e.answers?.[t.question]??``,c=r?r.split(/,\s*/):[],l=i[n]??[],u=(e,t)=>d?l.includes(e):c.includes(t)||c.includes(e),f=r&&!t.options.some(e=>u(e.raw,e.label))?`${e.state===`timeout`?`default text`:`your answer`}: ${r}`:``;return(0,G.jsxs)(`div`,{role:`group`,"aria-label":t.question,className:`c-q`,children:[(0,G.jsxs)(`div`,{className:`c-q-head`,children:[t.header&&(0,G.jsxs)(`span`,{className:`c-q-tag`,children:[`? `,t.header]}),(0,G.jsx)(`span`,{className:`dim small`,children:t.multiSelect?`pick any`:`pick one`}),(0,G.jsx)(`span`,{className:`c-time`,children:ia(e.at)})]}),(0,G.jsx)(`div`,{className:`c-q-text`,children:t.question}),(0,G.jsx)(`div`,{className:`c-q-options`,children:t.options.map(e=>{let r=u(e.raw,e.label);return(0,G.jsxs)(`button`,{role:t.multiSelect?`checkbox`:`radio`,"aria-checked":r,disabled:!d,className:r?d?`on`:`done`:``,onClick:()=>a(r=>{let i=r[n]??[];return{...r,[n]:t.multiSelect?i.includes(e.raw)?i.filter(t=>t!==e.raw):[...i,e.raw]:i[0]===e.raw?[]:[e.raw]}}),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:r?t.multiSelect?`☑`:`●`:t.multiSelect?`☐`:`○`}),(0,G.jsxs)(`span`,{children:[(0,G.jsxs)(`span`,{className:`c-q-label`,children:[e.label,e.rec&&(0,G.jsx)(`span`,{className:`c-rec`,title:`The agent's default: the timeout takes it`,children:`recommended`})]}),e.description&&(0,G.jsx)(`small`,{children:e.description})]})]},e.raw)})}),d&&(0,G.jsx)(`input`,{className:`input`,"aria-label":`Your own answer to: ${t.question}`,value:o[n]??``,onChange:e=>s({...o,[n]:e.target.value}),placeholder:`Or answer in your own words`}),f&&(0,G.jsxs)(`span`,{className:`c-q-shown`,children:[`✔ `,f]})]},n)}),d&&(0,G.jsxs)(`div`,{className:`c-submit`,children:[(0,G.jsx)(`button`,{className:`btn-primary`,disabled:!f||c,onClick:()=>void p(),children:e.questions.length>1?`Submit answers`:`Submit answer`}),(0,G.jsx)(`span`,{className:`dim small`,children:e.questions.length>1?`One answer goes for the whole card; it cannot be taken back.`:`It cannot be taken back.`})]}),(0,G.jsxs)(`span`,{className:`c-state ${d?`needs`:``}`,children:[m,` `,d&&(0,G.jsx)(jx,{from:r.waitAt??e.at,minutes:n})]})]})}function Px({e,part:t,minutes:n,live:r}){let[i,a]=(0,v.useState)(!1),o=e.state===`waiting`&&r.phase!==`limit`,s=async e=>{a(!0),await t.send(e).catch(()=>{}),a(!1)},c=e.state===`auto`?`✔ ran without asking (YOLO)`:e.state===`once`?e.notSaved?`✔ allowed once · the rule was not saved`:`✔ allowed once by you`:e.state===`always`?`✔ allowed always · rule saved for this machine and project: ${e.rule??``}`:e.state===`denied`?`✕ ${Lb[e.deniedBy??``]??`denied`}`:e.state===`dropped`?`withdrawn: ${e.dropWhy??`the turn ended`}`:r.phase===`limit`?`off: no card is open during the limit wait`:`waiting for you · denied by itself in`,l=o?`needs`:e.state===`denied`||e.state===`dropped`||e.notSaved?``:`ok`;return(0,G.jsxs)(`div`,{role:`group`,"aria-label":e.state===`auto`?`A call YOLO ran`:`Permission asked by the agent`,className:`c-card ${o?`pending`:``}`,children:[(0,G.jsxs)(`div`,{className:`c-q-head`,children:[(0,G.jsx)(`span`,{className:`c-kind`,title:`The kind of tool call`,children:e.what}),(0,G.jsx)(`span`,{className:`c-ask`,children:e.state===`auto`?`The agent ran`:`The agent asks to run`}),(0,G.jsx)(`span`,{className:`c-time`,children:ia(e.at)})]}),(0,G.jsx)(`code`,{className:`c-call`,children:e.title}),e.reason&&(0,G.jsxs)(`span`,{className:`c-reason`,children:[`Why: `,e.reason]}),o&&(0,G.jsxs)(`div`,{className:`c-acts`,children:[(0,G.jsx)(`button`,{className:`btn-primary`,disabled:i,onClick:()=>void s({type:`allow`,request_id:e.id}),children:`Allow once`}),e.always&&(0,G.jsx)(`button`,{className:`btn`,disabled:i,title:e.wide?`Allows every call of ${e.always}, with any arguments, in every session of this project on this machine (.claude/settings.local.json)`:`Saves the rule ${e.always} for this machine and this project (.claude/settings.local.json)`,onClick:()=>void s({type:`allow`,request_id:e.id,always:!0}),children:`Always`}),(0,G.jsx)(`button`,{className:`btn-line`,disabled:i,onClick:()=>void s({type:`deny`,request_id:e.id}),children:`Deny`})]}),e.always&&(0,G.jsxs)(`span`,{className:`c-rule`,children:[`always would save: `,e.always,e.wide&&` · every call of this tool, any arguments, in every session of this project`]}),!e.always&&o&&(0,G.jsx)(`span`,{className:`dim small`,children:`no "always" for an edit, a git command, a framework move, a whole tool or server, or a rule too broad`}),(0,G.jsxs)(`span`,{className:`c-state ${l}`,children:[c,` `,o&&(0,G.jsx)(jx,{from:r.waitAt??e.at,minutes:n})]})]})}function Fx({ctx:e,e:t,part:n}){let r=t.group?e.board.agent?.groups.find(e=>e.id===t.group):void 0,i=n.talk===null?e.board.items.find(e=>e.id===n.item):void 0,a=i&&t.rule&&Jb(i)?.rule===t.rule?i:null,[o,s]=(0,v.useState)(!1),c=async()=>{if(a&&!o){s(!0);try{await Yb(e,a)}finally{s(!1)}}},l=!t.group&&(e.board.agent?.extra??[]).some(e=>(e.pattern?`${e.kind}: ${e.pattern}`:e.kind)===t.rule),u=r?`the deny group ${r.id} (${r.label})`:t.group?`the deny group ${t.group}`:l?`your own deny rule`:`a deny rule of its settings`,d=r&&!r.on?`The group is off now: the next session may do it.`:t.group?`To let the agent do it, turn the group off in Agent permissions: the next session runs without its rules.`:l?`To let the agent do it, remove your rule in Agent permissions: the next session runs without it.`:`The deny rules of the project are in Agent permissions; a change holds from the next session.`;return(0,G.jsxs)(`div`,{role:`group`,"aria-label":`A call a deny rule refused`,className:`c-card c-deny`,children:[(0,G.jsxs)(`div`,{className:`c-q-head`,children:[(0,G.jsxs)(`span`,{className:`c-deny-tool`,title:`The tool the agent called`,children:[`✕ `,t.tool]}),(0,G.jsx)(`span`,{className:`c-ask`,children:`A deny rule refused the agent`}),(0,G.jsx)(`span`,{className:`c-time`,children:ia(t.at)})]}),(0,G.jsx)(`code`,{className:`c-call`,children:t.title||t.reason}),t.why&&(0,G.jsxs)(`span`,{className:`c-reason`,children:[`It wanted it for: `,(0,G.jsx)(`span`,{className:`c-deny-why`,children:t.why})]}),(0,G.jsxs)(`span`,{className:`c-rule`,children:[`refused by `,u,t.rule?` · rule ${t.rule}`:``]}),(0,G.jsxs)(`div`,{className:`c-deny-foot`,children:[(0,G.jsxs)(`span`,{className:`c-deny-todo ${r&&!r.on?`off`:``}`,children:[`The agent decides by itself how to go on without it. `,d]}),a&&(0,G.jsx)(`button`,{className:`btn-primary`,"aria-busy":o||void 0,title:`Three steps in one: this rule off for the item's next run only, the unblock, the run`,onClick:()=>void c(),children:o?`Allowing…`:`Allow for one run`}),(0,G.jsx)(`button`,{className:`btn`,title:`Opens the Agent screen: its deny groups and rules`,onClick:()=>e.go(`agent`),children:`Agent permissions`})]})]})}function Ix({ctx:e,e:t,part:n}){let[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(``),b=n.proposals?.find(e=>e.id===t.id),x=r&&(!b||b.state===`offered`)?{...b,id:t.id,state:`accepting`}:b??{id:t.id,state:`offered`},S=Be(e.board.domain.moves,t.move)??t.move,C=fi(e.board.domain,S),w=C&&!C.fields.some(e=>e.key===`id`)&&typeof t.fields.id==`string`?t.fields.id:void 0,T=w?e.board.items.find(e=>e.id===w):void 0,E=w&&!T?e.board.inbox?.find(e=>e.id===w):void 0,D=S===e.board.domain.sections.questions?.answer,O=w&&D?(e.board.questions??[]).find(e=>e.id===w):void 0,k=x.question??O?.question,A=e=>C?.fields.find(t=>t.key===e)?.label??e,j=S===e.board.domain.new_item,M=C?.preview?void 0:(j?[`note`]:[`note`,`reason`,`text`]).find(e=>typeof t.fields[e]==`string`&&t.fields[e]),N=C?.preview?[`text`,`add`,`title`]:[],P=Object.entries(t.fields).filter(([e])=>e!==`title`&&e!==M&&!(w&&e===`id`)&&!N.includes(e));for(let e of C?.fields??[])e.kind===`remove`&&t.fields[e.key]===void 0&&P.push([e.key,`by the rule`,!0]);let F=M?t.fields[M]:void 0,I={...C?Si(C.fields):{},...t.fields,...l&&{base:l.base}},L={talk:n.talk,id:t.id},ee=j?`New item`:S,te=w&&!D?`${ee} ${w}`:ee,ne=j?`New item`:D?`Answer to a decision`:zx(S,C?.label??S),R=x.state===`refused`?Ie(x.refusal):void 0,z=x.state===`offered`||x.state===`refused`,B=C?.preview&&w&&z?w:``,V=x.refusal?.code,re=JSON.stringify(t.fields);(0,v.useEffect)(()=>{if(!B)return;let t=!0;return H.movePreview(e.project.name,B,JSON.parse(re)).then(e=>t&&(u(e),f(``))).catch(e=>t&&f(e.message)),()=>{t=!1}},[e.project.name,B,re,V,x.at]);let ie=Lx(t.fields,l?.changes),ae=V===`running`&&x.state===`refused`&&!!ie,oe=async()=>{m(`sending`),g(``);try{await H.sendChat(e.project.name,w??``,{type:`say`,text:ie,live_only:!0}),m(`sent`),y(new Date().toISOString())}catch(e){m(``),g(e.message)}},[se,U]=(0,v.useState)(!1),W=(0,v.useRef)(null),ce=()=>{U(!1),setTimeout(()=>W.current?.focus(),0)},le=async(t=!1)=>{if(!C)return;if(C.danger&&!t){U(!0);return}U(!1),i(!0),o(``),g(``),c(!1);let n={cmd:C.cmd,...w&&{id:w},...bi(C.fields,I),proposal:L};Ux.includes(C.cmd)?await Wx(e,n):await e.move(n),i(!1)},ue=()=>C&&e.openMove({title:te,id:w,move:C,values:I,body:j?`Filled in from the agent's proposal: every field it proposed. Created and committed at once.`:`Filled in from the agent's proposal: every field it proposed.`,extra:{proposal:L}}),de={offered:`needs`,accepting:`running`,accepted:`ok`,refused:`error`}[x.state],fe=j?{offered:`proposed`,accepting:`creating…`,accepted:`created`,refused:`refused`}:{offered:`proposed`,accepting:`making…`,accepted:`made`,refused:`refused`},pe={offered:`●`,accepting:`◌`,accepted:`✔`,refused:`✘`}[x.state],me=T?T.running?`running`:T.status:``,he=me===`running`?`running`:e.board.domain.columns.find(e=>e.status===me)?.label??me,ge=C?.label??S,_e=x.state===`refused`&&!s;return(0,G.jsxs)(`div`,{role:`group`,"aria-label":`${te} proposed by the agent`,className:`c-card prop ${x.state}`,children:[(0,G.jsxs)(`div`,{className:`c-q-head`,children:[(0,G.jsx)(`span`,{className:`c-prop-what`,title:`The move it proposes: ${S}`,children:ne}),(0,G.jsxs)(`span`,{className:`c-prop-state tone-${de}`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:pe}),fe[x.state]]}),(0,G.jsx)(`span`,{className:`c-time`,children:ia(t.at)})]}),w&&!D&&(0,G.jsxs)(`div`,{className:`c-prop-target`,children:[(0,G.jsxs)(`div`,{className:`c-prop-target-row`,children:[T?(0,G.jsx)(`button`,{className:`link-btn mono c-prop-id`,title:`Open ${T.id}`,onClick:()=>e.openItem(T.id),children:T.id}):(0,G.jsx)(`span`,{className:`mono c-prop-id`,children:E?.id??w}),(0,G.jsx)(`span`,{className:`c-prop-title`,children:T?T.title:E?E.title??E.text.split(`
91
- `)[0]:``}),T&&x.state!==`accepted`&&(0,G.jsx)(`span`,{className:`badge tone-${me}`,title:`Its status now, read from the board`,children:he})]}),!T&&!E&&x.state!==`accepted`&&(0,G.jsxs)(`span`,{role:`note`,className:`c-prop-warn`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`⚠`}),w,` is not on the board`]}),T&&C&&x.state===`offered`&&!Ux.includes(C.cmd)&&!T.moves.includes(C.cmd)&&(0,G.jsxs)(`span`,{role:`note`,className:`c-prop-warn`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`⚠`}),`does not take `,ge,` now: the framework will refuse it`]})]}),D&&(0,G.jsxs)(`div`,{className:`c-prop-target`,children:[(0,G.jsx)(`span`,{className:`c-prop-qhead`,children:`The question, as the board first read it`}),(0,G.jsx)(`span`,{className:`c-prop-title c-prop-question`,children:k??`the question is not on the board`}),O?.answer&&O.question===k&&x.state!==`accepted`&&(0,G.jsxs)(`span`,{role:`note`,className:`c-prop-warn`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`⚠`}),`answered already: `,O.answer]})]}),j&&typeof t.fields.title==`string`&&(0,G.jsx)(`span`,{className:`c-prop-title c-prop-new`,children:t.fields.title}),P.length>0&&(0,G.jsx)(`dl`,{className:`c-prop-fields`,children:P.map(([e,t,n])=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:A(e)}),(0,G.jsx)(`dd`,{className:n?`rule`:``,children:String(t)})]},e))}),typeof F==`string`&&F&&M&&(0,G.jsxs)(`div`,{className:`c-prop-note ${j?``:`quote`}`,children:[(0,G.jsx)(`span`,{children:A(M)}),(0,G.jsx)(`div`,{className:`md`,children:(0,G.jsx)(Cx,{text:F})})]}),z&&l&&(0,G.jsx)(Tb,{preview:l}),B&&!l&&!d&&(0,G.jsx)(`span`,{className:`am-card-reading`,children:`Reading the changes…`}),z&&d&&(0,G.jsxs)(`span`,{role:`note`,className:`c-prop-warn`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`⚠`}),d]}),x.state===`refused`&&s&&(0,G.jsx)(`div`,{role:`status`,className:`c-created`,children:`✔ its files under gcf/ are committed or put back · Try again makes the move`}),_e&&(0,G.jsxs)(`div`,{role:`alert`,className:`c-prop-error`,children:[(0,G.jsx)(`span`,{className:`c-prop-error-head`,children:a?`Commit refused`:`gcf refused it`}),(0,G.jsx)(`span`,{className:`c-prop-error-text`,children:(0,G.jsx)(Ce,{text:a||x.error||``,toned:!0})}),R&&(0,G.jsx)(qy,{ctx:e,refusal:R,error:x.error??``,onError:o,onDone:()=>c(!0)},x.at??``)]}),se&&C&&(x.state===`offered`||x.state===`refused`)&&(0,G.jsxs)(`div`,{role:`alertdialog`,"aria-label":`${ge} ${w??``}?`,className:`c-prop-confirm`,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),ce())},children:[(0,G.jsxs)(`span`,{children:[ge,` `,w,`? `,C.help?`${C.help}.`:``,` It cannot be taken back from the chat.`]}),(0,G.jsxs)(`div`,{className:`c-acts`,children:[(0,G.jsxs)(`button`,{className:`btn-danger solid`,autoFocus:!0,onClick:()=>void le(!0),children:[`Yes, `,ge]}),(0,G.jsx)(`button`,{className:`btn`,onClick:ce,children:`Cancel`})]})]}),(x.state===`offered`||x.state===`refused`)&&C&&!se&&(0,G.jsxs)(`div`,{className:`c-acts`,children:[(0,G.jsx)(`button`,{ref:W,className:C.danger?`btn-danger`:`btn-primary`,disabled:!!C.preview&&!l,title:(C.danger?`Asks first. `:``)+`Runs the move as it is: every field above goes with it`,onClick:()=>void le(),children:x.state===`refused`?`Try again`:j?`Create`:C.label}),ae&&p!==`sent`&&(0,G.jsxs)(`button`,{className:`btn am-send`,disabled:p===`sending`,title:`Its words go to the chat of ${w}'s run, to its live session only, never to the item's thread. The card stays refused`,onClick:()=>void oe(),children:[(0,G.jsx)(`span`,{className:`am-send-dot`,"aria-hidden":`true`}),p===`sending`?`Sending…`:`Send to the run`]}),!Ux.includes(C.cmd)&&(0,G.jsx)(`button`,{className:`btn`,title:`Opens the move's form, filled in`,onClick:ue,children:`Edit…`})]}),ae&&p===`sent`&&(0,G.jsxs)(`span`,{role:`status`,className:`am-sent`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`✔`}),(0,G.jsxs)(`span`,{children:[`Sent to `,w,`'s run at `,ia(_),`: its agent reads it with its next turn. The card stays refused: Try again after the run.`]})]}),ae&&h&&p!==`sent`&&(0,G.jsxs)(`span`,{role:`alert`,className:`am-send-err`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`⚠`}),(0,G.jsx)(`span`,{children:h})]}),x.state===`accepting`&&(0,G.jsxs)(`span`,{className:`c-creating`,children:[(0,G.jsx)(`span`,{className:`dot pulse`,"aria-hidden":`true`}),j?`creating ${x.item??String(t.fields.id??`the item`)}`:te,`: the framework commits it`]}),x.state===`accepted`&&(0,G.jsxs)(`span`,{className:`c-created`,children:[`✔ `,j?`created`:`made: ${ge}`,x.item&&(j?`: `:` `),D?(0,G.jsx)(`span`,{children:k??x.item}):x.item&&(0,G.jsx)(`span`,{className:`mono`,children:(0,G.jsx)(Se,{id:x.item})})]})]})}function Lx(e,t){let n=(e,t)=>typeof t==`string`&&t?[`${e} ${t}`]:[],r=t?.length?t.map(e=>e.block===`title`?`Title: ${e.new[0]??``}`:e.new.join(`
92
- `)||`The block ${e.block} goes.`):[...n(`Title:`,e.title),...n(`Blocks:`,e.text),...n(`Notes:`,e.add)];return r.length?[`The operator decided this about the card you work on; it replaces what the card says.`,`Build by it, and rewrite the slots it contradicts in your commit.`,...r].join(`
93
-
94
- `):``}var Rx={verdict:`Verdict`,decide:`Decision`,block:`Block`,unblock:`Unblock`,amend:`Amend`,drop:`Drop`,depends:`Dependencies`};function zx(e,t){let[n,r]=e.split(`:`),i=Rx[n];return i?r?`${i} · ${t}`:i:t}function Bx({ctx:e,e:t,onReply:n}){let{domain:r}=e.board,i=fi(r,r.sections.inbox?.add),a=fi(r,r.sections.questions?.answer),o=(e.board.questions??[]).filter(e=>e.class===`D1`&&!e.answer),s=t.text.split(`
95
- `)[0].slice(0,120);return(0,G.jsxs)(`div`,{className:`c-agent`,"data-at":t.at,children:[(0,G.jsx)(`span`,{className:`sr`,children:`Agent:`}),(0,G.jsx)(`div`,{className:`c-bubble md`,children:(0,G.jsx)(Cx,{text:t.text})}),(0,G.jsxs)(`div`,{className:`c-agent-acts`,children:[n&&(0,G.jsx)(`button`,{title:`Reply to this whole message: the agent gets your words with it quoted`,onClick:()=>n({at:t.at,text:t.text}),children:`Reply`}),r.new_item&&(0,G.jsx)(`button`,{onClick:()=>e.newItem({title:s,note:t.text}),children:`Create item from this`}),i&&(0,G.jsx)(`button`,{onClick:()=>e.openMove({title:`Add to the inbox`,move:i,values:{text:t.text,category:`idea`},body:`${i.help??``}. From the agent's message.`}),children:`Add to inbox`}),a&&o.length>0&&(0,G.jsx)(`button`,{onClick:()=>e.openMove({title:`Answer a decision with this`,move:{...a,fields:[{key:`id`,label:`Question`,kind:`choice`,required:!0,options:o.map(e=>({value:e.id,label:`${e.id} — ${(e.question??``).slice(0,70)}`}))},...a.fields]},values:{text:t.text},body:`The agent's message becomes your answer to an open decision. Edit it first if you like.`}),children:`Answer a decision`}),(0,G.jsx)(`span`,{className:`c-time`,children:ia(t.at)})]})]})}function Vx(e,t,n){let r=(n.closest(`.c-stream`)??document).querySelector(`.c-agent[data-at="${CSS.escape(t)}"]`);r?r.scrollIntoView({block:`center`,behavior:`smooth`}):e.notify(`The agent message of ${ia(t)} is not in this chat: its quote is below`,`ok`)}function Hx({ctx:e,e:t,part:n}){let r=fi(e.board.domain,`attach`);return(0,G.jsxs)(`div`,{className:`c-me`,children:[(0,G.jsx)(`span`,{className:`sr`,children:`You:`}),(0,G.jsxs)(`div`,{className:`c-bubble md`,children:[t.byTimeout&&(0,G.jsx)(`span`,{className:`c-default`,children:`default answer`}),t.replyAt&&(0,G.jsxs)(`button`,{className:`c-reply-to`,title:`The agent message this replies to: scroll to it`,onClick:n=>Vx(e,t.replyAt??``,n.currentTarget),children:[`↩ `,ia(t.replyAt)]}),t.text&&(0,G.jsx)(`div`,{className:`c-me-text`,children:(0,G.jsx)(Cx,{text:t.text})}),t.images.length>0&&(0,G.jsx)(`div`,{className:`c-imgs`,children:t.images.map(t=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`img`,{src:n.imageUrl(t),alt:t.split(`/`).pop()}),r&&(0,G.jsx)(`button`,{className:`c-attach`,title:`Commit this picture into an item's attachments (gcf item attach)`,onClick:()=>e.openMove({title:`Attach to an item`,move:{...r,fields:[{key:`id`,label:`Item id`,kind:`text`,required:!0},...r.fields]},values:{id:n.item??``,file:n.imagePath(t)}}),children:`attach to item…`})]},t))})]}),(0,G.jsxs)(`span`,{className:`c-me-status`,children:[ia(t.at),` · `,t.status]})]})}var Ux=[`play`,`play-main`];async function Wx(e,t){let n=e.board.play?.targets.find(e=>e.name===t.target),r=t.cmd===`play-main`?null:String(t.id),i=r===null?[]:e.board.items.find(e=>e.id===r)?.builds,a=r!==null&&xc(i,n?.build)?.ok===!0?void 0:()=>H.playBuild(e.project.name,r,!1,n?.build);await Oc(n??{open:``},async()=>{let n=await e.moveOut(t);if(!n.ok)throw Error(n.err);return JSON.parse(n.out)},window,a).then(t=>!t.url&&e.notify(t.open,`ok`),t=>e.notify(t.message,`error`))}function Gx(e,t){let[n,r]=(0,v.useState)([]),i=e.project.name;return(0,v.useEffect)(()=>{if(r([]),!t)return;let e=!0,n=()=>void H.pendingChat(i,t).then(t=>e&&r(t.lines),()=>{});n();let a=setInterval(n,5e3);return()=>{e=!1,clearInterval(a)}},[i,t]),n}var Kx=e=>e.talk?{talk:e.talk}:e.item?{id:e.item}:null;function qx({ctx:e,part:t,thread:n,startNote:r,onReply:i}){let a=ix(),o=t=>{let n=t.talk!==null,r=Mx(e,n),i=Mb(t.events),a=n&&!e.talks.find(e=>e.id===t.talk)?.live;return{p:t,minutes:r,live:i,shown:Vb(t.events,{talk:n,answerMin:r}).map(e=>a&&(e.kind===`question`||e.kind===`approval`)&&e.state===`waiting`?{...e,state:`dropped`,dropWhy:`the agent ended without it`}:a&&e.kind===`task`&&e.state===`running`?{...e,state:`stopped`}:e),lastEndAt:t.events.findLast(e=>e.type===`run_end`)?.at}},s=o(t),c=n?o(n):null,l=(t,n,r)=>{let a=n.p;switch(t.kind){case`me`:return(0,G.jsx)(Hx,{ctx:e,e:t,part:a},r);case`agent`:return(0,G.jsx)(Bx,{ctx:e,e:t,onReply:i},r);case`claude`:return(0,G.jsxs)(`div`,{className:`c-claude`,title:`Claude's own limit message, as the agent's line`,children:[(0,G.jsxs)(`span`,{children:[`Claude: `,t.text]}),(0,G.jsx)(`span`,{className:`c-time`,children:ia(t.at)})]},r);case`line`:return(0,G.jsxs)(`div`,{className:`c-line ${t.box?`box`:``} ${t.mono?`mono`:``} ${t.tone?`tone-${t.tone}`:``}`,title:t.tip,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:t.mark}),(0,G.jsx)(`span`,{children:t.text}),t.wake&&Kx(a)&&(0,G.jsx)(ma,{ctx:e,of:Kx(a)}),(0,G.jsx)(`span`,{className:`c-time`,children:ia(t.at)})]},r);case`step`:return(0,G.jsxs)(`div`,{className:`c-step tone-${t.tone??`neutral`} ${t.unknown?`unknown`:``}`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:t.mark}),(0,G.jsx)(`span`,{children:t.text}),(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`c-time`,children:ia(t.at)})]},r);case`question`:return(0,G.jsx)(Nx,{e:t,part:a,minutes:n.minutes,live:n.live},r);case`approval`:return(0,G.jsx)(Px,{e:t,part:a,minutes:n.minutes,live:n.live},r);case`proposal`:return(0,G.jsx)(Ix,{ctx:e,e:t,part:a},r);case`refused`:return(0,G.jsx)(Fx,{ctx:e,e:t,part:a},r);case`task`:return(0,G.jsx)(aS,{e:t},r);case`run_end`:return(0,G.jsx)(hS,{ctx:e,id:a.item??``,end:t.end,acts:t.at===n.lastEndAt},r);case`divider`:return(0,G.jsxs)(`div`,{role:`separator`,"aria-label":`Talk handed to a fresh agent`,className:`c-div ${t.failed?`failed`:``}`,title:t.tip,children:[(0,G.jsxs)(`div`,{className:`c-div-head`,children:[t.failed?`✕ the summary failed · the same agent goes on`:`↻ talk handed to a fresh agent`,(0,G.jsxs)(`span`,{children:[`· `,t.by]}),(0,G.jsx)(`span`,{className:`c-time`,children:ia(t.at)})]}),t.summary?(0,G.jsxs)(`div`,{className:`c-div-sum`,children:[(0,G.jsx)(`span`,{children:t.failed?`What the agent wrote before the summary failed (no fresh agent starts from it)`:`The summary the fresh agent starts from (read only: correct it with your next message)`}),(0,G.jsx)(`p`,{children:t.summary})]}):!t.failed&&(0,G.jsx)(`span`,{className:`dim small`,children:`the agent is writing the summary…`})]},r)}},u=new Map,d=(e,t)=>{let n=`${t.key}-${e.kind}@${e.at}`,r=u.get(n)??0;return u.set(n,r+1),`${n}-${r}`},f=(e,t,n)=>!zb(e)||a===`expanded`?l(e,t,n):a===`hidden`?null:(0,G.jsx)(Zx,{e,children:l(e,t)},n);if(!c)return(0,G.jsx)(G.Fragment,{children:s.shown.map(e=>f(e,s,d(e,t)))});let p=Ub({part:s,list:s.shown,events:t.events,live:s.live.live},{part:c,list:c.shown}),m=p.findLast(e=>e.ring===`start`)?.e.at;return(0,G.jsx)(G.Fragment,{children:p.map(({e,part:t,rail:n,ring:i})=>{let a=d(e,t.p),o=t===s,c=e.kind===`me`?o?`You → run`:`You → thread`:e.kind===`agent`?o?`Run agent`:`Thread agent`:null,l=i===`start`?(0,G.jsxs)(`div`,{className:`c-run-start`,children:[(0,G.jsx)(`strong`,{children:`Run started`}),e.at===m&&s.live.live&&r&&(0,G.jsx)(`span`,{className:`mono small dim`,children:r}),(0,G.jsx)(`span`,{className:`c-time`,children:ia(e.at)})]}):f(e,t,a);return l===null?null:(0,G.jsxs)(`div`,{className:`c-row ${o?`from-run`:`from-thread`} ${e.kind===`me`?`mine`:``} ${n?`rail`:``} ${i?`ring-${i}`:``}`,children:[(0,G.jsx)(`span`,{className:`c-gut`,"aria-hidden":`true`}),(0,G.jsxs)(`div`,{className:`c-row-body`,children:[c&&(0,G.jsx)(`span`,{className:`c-who ${o?`run`:`thread`}`,title:e.kind===`me`?o?`Went to the run's session`:`Went to the card's own thread`:void 0,children:c}),l]})]},a)})})}function Jx({ctx:e}){return px()?(0,G.jsx)(`button`,{className:`c-yolo`,title:`Calls run without a card. Deny rules and the main-run refusal still hold. Settings turns it off.`,onClick:()=>e.openSettings(),children:`YOLO`}):null}function Yx(e){return e.kind===`refused`?`refused by ${e.group?`deny group ${e.group}`:`a deny rule`}`:e.kind===`line`?e.tech?.out??``:e.kind===`approval`?e.state===`auto`?`ran without asking (YOLO)`:e.state===`once`?e.notSaved?`allowed once · the rule was not saved`:`allowed once by you`:e.state===`always`?`allowed always · rule saved`:e.state===`denied`?Lb[e.deniedBy??``]??`denied`:`withdrawn: ${e.dropWhy??`the turn ended`}`:``}function Xx(e){return e.kind===`refused`?`warn`:e.kind===`line`?e.tech?.tone??``:e.kind===`approval`?e.state===`auto`?`warn`:e.state===`once`&&!e.notSaved||e.state===`always`?`ok`:``:``}function Zx({e,children:t}){let[n,r]=(0,v.useState)(!1),[i,a]=e.kind===`approval`?[e.what,e.title]:e.kind===`refused`?[e.what,e.title||e.reason]:e.kind===`line`?[e.tech?.tool??``,e.tech?.title??``]:[``,``],o=Xx(e);return(0,G.jsxs)(`div`,{className:`c-fold ${n?`open`:``}`,children:[(0,G.jsxs)(`button`,{className:`c-fold-head`,"aria-expanded":n,title:n?`Fold it into one line`:`Show the whole card`,onClick:()=>r(!n),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:n?`▾`:`▸`}),(0,G.jsx)(`span`,{className:`c-kind`,children:i}),(0,G.jsx)(`span`,{className:`c-fold-title`,children:a}),(0,G.jsxs)(`span`,{className:`c-fold-out ${o?`tone-${o}`:``}`,children:[`· `,Yx(e)]}),(0,G.jsx)(`span`,{className:`c-time`,children:ia(e.at)})]}),n&&t]})}var Qx=e=>{let t=Math.max(0,Math.round(e/1e3));return t<60?`${t} s`:t<3600?`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`:`${Math.floor(t/3600)} h ${String(Math.floor(t/60)%60).padStart(2,`0`)} min`},$x=(e,t)=>e===`agent`?`subagent${t?` ${t}`:``}`:e,eS=e=>{let t=Math.max(0,Math.round(e/1e3));return t<3600?`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`:Qx(e)},tS={done:[`done`,`ok`,`✓`],failed:[`failed`,`warn`,`✕`],stopped:[`stopped`,``,`■`]},nS=1e3,rS=4e3;function iS({label:e,text:t,max:n,cut:r,none:i,mono:a=!1,warn:o=!1}){return(0,G.jsxs)(`section`,{"aria-label":e,className:`c-task-side`,children:[(0,G.jsxs)(`span`,{className:`c-task-label`,children:[e,t.length>=n&&(0,G.jsx)(`span`,{className:`c-task-cut`,children:r})]}),t?(0,G.jsx)(`div`,{className:`c-task-text ${a?`mono`:``} ${o?`warn`:``}`,children:t}):(0,G.jsx)(`span`,{className:`c-task-none`,children:i})]})}function aS({e}){let[t,n]=(0,v.useState)(!1),r=e.state===`running`,i=Ax(r),a=r?i-Date.parse(e.at):e.ms,[o,s,c]=r?[e.doing??`running`,`running`,``]:tS[e.state]??[e.state,``,`■`],l=e.state===`failed`&&e.status&&e.status!==`failed`?` · ${e.status}`:``,u=e.what===`agent`,d=r?`it reports when it ends`:e.state===`stopped`&&!e.status?`no report: its session ended with it`:`no report`;return(0,G.jsxs)(`div`,{className:`c-fold c-task ${r?`running`:``} ${t?`open`:``}`,"data-task":e.id,"data-run":e.run,children:[(0,G.jsxs)(`button`,{className:`c-fold-head`,"aria-expanded":t,title:t?`Fold it`:`What it was told and what it reported`,onClick:()=>n(!t),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:t?`▾`:`▸`}),r&&(0,G.jsx)(`span`,{className:`c-task-dot`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`c-kind c-task-kind ${u?`agent`:``}`,title:u?`A subagent the agent started, of this type`:`A command the agent runs in the background`,children:$x(e.what,e.agent)}),(0,G.jsx)(`span`,{className:`c-task-for`,title:`What it was started for`,children:e.description||e.id}),(0,G.jsxs)(`span`,{className:`c-task-out ${s?`tone-${s}`:``}`,children:[(0,G.jsx)(`span`,{className:`c-task-sep`,"aria-hidden":`true`,children:`·`}),c&&(0,G.jsx)(`span`,{"aria-hidden":`true`,children:c}),(0,G.jsxs)(`span`,{className:`c-task-word ${r&&e.doing?`mono`:``}`,children:[o,l]})]}),e.calls!==null&&(0,G.jsxs)(`span`,{className:`c-task-calls`,children:[e.calls,` call`,e.calls===1?``:`s`]}),a!==null&&Number.isFinite(a)&&(0,G.jsx)(`span`,{className:`c-task-took ${r?`running`:``}`,title:r?`How long it has run`:`How long it ran`,children:r?eS(a):Qx(a)}),(0,G.jsx)(`span`,{className:`c-time`,children:ia(e.at)})]}),t&&(0,G.jsxs)(`div`,{className:`c-task-body`,children:[(0,G.jsx)(iS,{label:`Told`,text:e.prompt,max:nS,cut:`the head of its prompt: 1000 characters`,none:e.what===`shell`?`a shell is told nothing: its command is the line above`:`no prompt in the event`}),(0,G.jsx)(iS,{label:`Reported`,text:e.summary,max:rS,cut:`the head of its report: 4000 characters`,none:d,mono:!0,warn:e.state===`failed`})]})]})}function oS({tasks:e}){let t=Ax(e.length>0);if(!e.length)return null;let n=e=>{let t=document.querySelector(`.c-task[data-task="${CSS.escape(e.id)}"][data-run="${e.run}"]`);t?.scrollIntoView({block:`center`,behavior:`smooth`}),t?.querySelector(`.c-fold-head`)?.focus()};return(0,G.jsx)(`div`,{className:`c-tasks`,role:`list`,"aria-label":`What runs beside the agent`,children:e.map(e=>(0,G.jsxs)(`button`,{role:`listitem`,className:`c-task-chip`,title:`${$x(e.kind,e.agent)}: ${e.description} · ${e.doing??`running`}${e.calls===null?``:` · ${e.calls} calls`} · click: its line in the stream`,onClick:()=>n(e),children:[(0,G.jsx)(`span`,{className:`c-task-dot`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`c-task-what`,children:e.description||$x(e.kind,e.agent)}),(0,G.jsx)(`span`,{className:`c-task-doing`,children:e.doing??`running`}),(0,G.jsx)(`span`,{className:`c-task-time`,children:eS(t-Date.parse(e.at))})]},`${e.id}@${e.run}`))})}function sS({ctx:e,live:t}){let n=e.board.context?.handoff_pct??0,r=e.board.context?.compact_pct??0,i=typeof t.ctx==`number`?t.ctx:null,a=i!==null&&n>0&&i>=n-10,o=t.ctx===null?`How full the agent's context is: unknown, the model's window is not known`:`How full the agent's context is${n>0?` · at ${n}% a fresh agent takes over`:` · no handoff`}${r>0?` · at ${r}% the agent compacts`:``}`;return(0,G.jsxs)(`span`,{className:`c-ctx ${a?`near`:``}`,tabIndex:0,title:o,children:[t.ctx===null?`context ?`:i===null?`context —`:`context ${i}%`,(0,G.jsxs)(`span`,{className:`c-ctx-bar`,"aria-hidden":`true`,children:[i!==null&&(0,G.jsx)(`span`,{className:`fill`,style:{width:`${Math.min(100,i)}%`}}),t.ctx===null&&(0,G.jsx)(`span`,{className:`unknown`}),n>0&&(0,G.jsx)(`span`,{className:`mark`,style:{left:`${n}%`}}),r>0&&(0,G.jsx)(`span`,{className:`mark dim`,style:{left:`${r}%`}})]})]})}function cS({ctx:e,part:t,placeholder:n,route:r,canStop:i=!0,costLabel:a,onSend:o,extra:s,pulse:c,quote:l}){let[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(null),m=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(l)return l.current=e=>{typeof e==`string`?d(t=>pb(t,e)):p(e);let t=m.current;t?.focus(),requestAnimationFrame(()=>t?.setSelectionRange(t.value.length,t.value.length))},()=>{l.current=null}},[l]);let[h,g]=(0,v.useState)([]),_=(0,v.useRef)([]),y=e=>{_.current=e,g(e)},[b,x]=(0,v.useState)([]),S=(0,v.useRef)([]),C=e=>{S.current=e,x(e)},w=()=>_.current.reduce((e,t)=>e+t.size,0)+S.current.reduce((e,t)=>e+Math.floor((t.data??``).length*3/4),0),[T,E]=(0,v.useState)(null),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(``),[N,P]=(0,v.useState)(!1),[F,I]=(0,v.useState)(null),[L,ee]=(0,v.useState)(null),[te,ne]=(0,v.useState)([]),R=t.talk!==null,z=Mb(t.events),B=Mx(e,R),V=z.phase===`limit`,re=t.events.filter(e=>e.type===`handoff`).length,ie=F!==null&&re===F,ae=!!(R&&e.talks.find(e=>e.id===t.talk)?.live),oe=R&&!ae?null:Pb(t.events),se=L!==null&&ae&&Date.now()-L.t<kx&&!t.events.slice(L.n).some(e=>e.type===`closed`||e.type===`session`),U=!R&&z.phase===`waiting`&&z.waitKind===`text`&&z.waitAt,W=t.events.filter(e=>e.type===`say`&&e.by===`operator`&&!e.retry).length,ce=te.filter(e=>e.key===t.key),le=Gb(ce,t.events,W),ue=Kb(ce,t.events),de=qb(Gx(e,!R&&V?t.item??null:null),t.events,ce);Ax(!!oe||!!U||se);let fe=async e=>{let t=await Promise.all([...e].map(async e=>hx.includes(e.type)&&e.size<=_x?{f:e,data:await xi(e)}:{f:e,data:``})),n=[],r=[..._.current],i=w()-r.reduce((e,t)=>e+t.size,0);for(let{f:e,data:a}of t){let t=i+r.reduce((e,t)=>e+t.size,0);hx.includes(e.type)?r.length>=gx?n.push(`${e.name}: at most ${gx} pictures a message`):e.size>_x?n.push(`${e.name}: ${wx(e.size)}, at most 5 MB a picture`):t+e.size>vx?n.push(`${e.name}: the pictures and files of one message come to about 7 MB at most (${wx(t+e.size)} with it)`):r.push({name:e.name,type:e.type,size:e.size,data:a}):n.push(`${e.name}: ${e.type||`this kind`} is not taken, only png, jpeg, gif and webp`)}y(r),M(n.join(` · `))},pe=async e=>{let t=await Promise.all([...e].map(async e=>({f:e,data:e.size<=_x?await xi(e):``}))),n=[],r=[...S.current],i=w();for(let{f:e,data:a}of t)r.length>=10?n.push(`${e.name}: at most 10 attachments a message`):e.size>_x?n.push(`${e.name}: ${wx(e.size)}, at most 5 MB a file`):i+e.size>vx?n.push(`${e.name}: the pictures and files of one message come to about 7 MB at most (${wx(i+e.size)} with it)`):(r.push({kind:`file`,ref:e.name,data:a}),i+=e.size);C(r),M(n.join(` · `))},me=async()=>{if(N||se||!u.trim()&&!h.length&&!b.length)return;if(f&&!u.trim()){A(`Write your reply: the quote alone says nothing to the agent`);return}P(!0),A(``);let e={text:u,pictures:h,attach:b,...f?{reply:f}:{}},n={text:u.trim()||(h.length?`(pictures)`:`(attached)`),after:W+le.length,from:t.events.length,key:t.key,sending:!0};ne(e=>[...e,n]),d(``),y([]),C([]),p(null),M(``);try{let r=await o(e),i=r?.key??t.key;ne(e=>i===t.key||!t.key?e.map(e=>e===n?{...n,key:i,sending:!1,...r?.id?{id:r.id}:{}}:e):e.filter(e=>e!==n))}catch(t){ne(e=>e.filter(e=>e!==n)),d(t=>t?`${e.text}\n${t}`:e.text),y([...e.pictures,..._.current]),C([...e.attach,...S.current]),e.reply&&p(t=>t??e.reply??null),A(t.message)}P(!1)},he=async e=>{try{await t.send(e)}catch(e){A(e.message)}},ge=()=>{let e=[...t.events].reverse().find(e=>e.type===`say`&&e.by===`operator`),n=e?.type===`say`&&!t.events.some((n,r)=>n.type===`read`&&n.n===e.n&&r>t.events.indexOf(e));z.live&&Fb(t.events)&&(z.phase===`working`||z.phase===`background`||z.phase===`waiting`&&z.waitKind===`card`||n)&&I(re),t.send({type:`handoff`}).catch(e=>{I(null),A(e.message)})},_e=async()=>{let n=z.bg.map(e=>e.description).join(`, `);if(!n||await ke(`Close the agent? Its background tasks stop with it: ${n}.`,`Close`,!0)){ee({n:t.events.length,t:Date.now()}),I(null);try{await H.closeTalk(e.project.name,t.talk??``)}catch(t){ee(null),e.notify(t.message,`error`)}}},ve,ye=`neutral`,be=null;se?(ve=`closing the agent and all it started…`,ye=`running`):(N||le.length)&&!z.live&&!V&&R?(ve=`starting the agent…`,ye=`running`):V?ve=`${da(z.limitUntil,z.limitReserve,z.limitPct??void 0,Bb)}${R?` · the agent closed; it starts again by itself · only messages until then`:` · waits for the reset by itself`} · reset early? Go on now`:z.resuming?(ve=`the wait is over · the session goes on now…`,ye=`running`):z.freshQueued?(ve=`fresh agent queued · it takes over by itself when the background tasks end`,ye=`running`):z.phase===`waiting`&&z.waitKind===`card`&&oe?(ve=`waiting for your answer on the card · the default goes in`,ye=`needs`,be=(0,G.jsx)(jx,{from:z.waitAt??oe.at,minutes:B})):z.phase===`waiting`&&z.waitKind===`stop`?ve=`stopped · waits for your message`:z.phase===`waiting`&&z.waitKind===`text`?R?ve=`your turn · the agent closes after ${B} min idle`:(ve=`waiting for your reply · the default answer goes in`,ye=`needs`,z.waitAt&&(be=(0,G.jsx)(jx,{from:z.waitAt,minutes:B}))):z.phase===`background`?(ve=`working in the background: ${z.bg.map(e=>e.description).join(`, `)} · no timer runs`,ye=`running`):z.phase===`ready`&&z.live?(ve=`agent ready · waits for your message`,ye=`running`):z.phase===`working`&&z.live?(ve=`working…`,ye=`running`):ve=z.endedIdle?`agent closed · your next message starts it again`:z.everStarted?R?`agent closed · your next message starts it again`:`session ended`:R?`no agent yet · your first message starts one`:`no session`,ie&&!z.freshQueued&&(ve+=` · fresh agent asked for: it takes over when this turn ends`);let xe=i&&z.live&&!V&&z.phase===`working`,Se=R&&!V&&!z.freshQueued&&!ie&&z.everStarted,Ce=ae&&(z.live||V)&&!se,we=!R&&!!t.item&&z.live&&z.phase!==`ended`,Te=ve.split(` · `)[0].replace(/^(working in the background):.*/,`$1`)+(ie&&!z.freshQueued?` · fresh agent asked`:``);return(0,G.jsxs)(`div`,{className:`c-composer`,children:[(0,G.jsxs)(`div`,{className:`c-status`,children:[(0,G.jsxs)(`span`,{className:`c-status-label tone-${ye}`,children:[(0,G.jsx)(`span`,{className:`dot ${ye===`running`?`pulse`:``}`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{role:`status`,title:ve,children:Te===`no agent yet`?`no agent`:Te}),be]}),(0,G.jsxs)(`span`,{className:`c-status-right`,children:[(0,G.jsx)(`span`,{className:`mono dim small c-cost`,tabIndex:0,title:a===`this run`?`What this run cost so far`:`What this thread cost so far: every agent session in it`,children:Tx(z.cost)}),(0,G.jsx)(sS,{ctx:e,live:z}),V&&Kx(t)&&(0,G.jsx)(ma,{ctx:e,of:Kx(t)})]})]}),c,(0,G.jsx)(oS,{tasks:z.live&&(!R||ae)?z.tasks:[]}),le.map((e,t)=>(0,G.jsxs)(`span`,{className:`c-out`,role:`status`,children:[`▸ `,e.text.split(`
96
- `)[0].slice(0,80),` ·`,` `,e.sending?`sending…`:V?`accepted · it reaches the agent after the reset`:z.live?`sent · the agent takes it in next`:`starting the agent…`]},t)),de.map(n=>(0,G.jsxs)(`span`,{className:`c-out`,role:`status`,children:[`▸ `,n.text.split(`
97
- `)[0].slice(0,80),` · waits for the session after the reset`,` `,Kx(t)&&(0,G.jsx)(ma,{ctx:e,of:Kx(t)})]},n.id)),ue.map(e=>(0,G.jsxs)(`span`,{className:`c-out`,role:`status`,children:[`▸ `,e.text.split(`
98
- `)[0].slice(0,80),` · not sent: the session had ended ·`,` `,(0,G.jsx)(`button`,{className:`btn`,title:`Your words go back into the input`,onClick:()=>{ne(t=>t.filter(t=>t!==e)),d(t=>t?`${e.text}\n${t}`:e.text)},children:`Put back`})]},e.id)),r&&(0,G.jsxs)(`span`,{className:`c-route`,children:[`→ `,r]}),(0,G.jsxs)(`div`,{className:`c-input`,onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),fe(e.dataTransfer.files)},children:[f&&(0,G.jsx)(`div`,{className:`c-pics c-reply-chip`,children:(0,G.jsxs)(`span`,{title:f.text,children:[`↩ Reply to the agent · `,ia(f.at),`:`,` `,f.text.replace(/\s+/g,` `).slice(0,60),(0,G.jsx)(`button`,{"aria-label":`Cancel the reply`,title:`Cancel the reply`,onClick:()=>p(null),children:`×`})]})}),b.length>0&&(0,G.jsx)(`div`,{className:`c-pics`,children:b.map((e,t)=>(0,G.jsxs)(`span`,{title:e.kind===`unit`?`Design unit: the agent gets unit ${e.ref} and its file`:e.data===void 0?`Goes with the message as context`:`A file of your machine: the agent reads its copy beside the chat`,children:[e.kind===`item`?`▸`:e.kind===`unit`?`◇`:`▤`,` `,e.ref,(0,G.jsx)(`button`,{"aria-label":`Remove ${e.ref}`,onClick:()=>C(b.filter((e,n)=>n!==t)),children:`×`})]},`${e.kind}:${e.ref}:${t}`))}),h.length>0&&(0,G.jsx)(`div`,{className:`c-pics`,children:h.map((e,t)=>(0,G.jsxs)(`span`,{title:wx(e.size),children:[`▣ `,e.name,(0,G.jsx)(`button`,{"aria-label":`Remove ${e.name}`,title:`Remove this picture`,onClick:()=>y(h.filter((e,n)=>n!==t)),children:`×`})]},t))}),(0,G.jsx)(`textarea`,{ref:m,"aria-label":`Message to the agent`,rows:4,value:u,onChange:e=>{d(e.target.value),A(``)},onKeyDown:e=>{e.key===`Escape`&&f&&(e.preventDefault(),p(null)),e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),me())},onPaste:e=>{let t=[...e.clipboardData.files].filter(e=>e.type.startsWith(`image/`));t.length&&(e.preventDefault(),fe(t))},placeholder:n??(V?R?`Write now: the agent takes it in after the reset`:`Write now: it reaches the agent after the reset`:`Message the agent…`)}),(0,G.jsxs)(`div`,{className:`c-tools`,role:`toolbar`,"aria-label":`Message tools`,children:[(e.board.domain.sections.units?[`item`,`unit`]:[`item`]).map(e=>(0,G.jsx)(`button`,{className:`c-chip ${T===e?`on`:``}`,"aria-expanded":e===`unit`?T===e:void 0,title:e===`item`?`Attach an item to the message as context`:`Attach a design unit: pick it from the live units by id and title; the agent gets unit <id> (<file>)`,onClick:()=>{E(T===e?null:e),O(``)},children:`${e===`unit`&&T===e?`▾`:`+`} ${e}`},e)),(0,G.jsxs)(`label`,{className:`c-ico c-pick`,"aria-label":`Attach a file`,title:`Attach a file of your machine as context: the agent reads its copy beside the chat · up to 10 a message, 5 MB each, about 7 MB in all with the pictures`,children:[Dx.file,(0,G.jsx)(`input`,{"aria-label":`Attach a file`,type:`file`,multiple:!0,onChange:e=>{e.target.files&&pe(e.target.files),e.target.value=``}})]}),(0,G.jsxs)(`label`,{className:`c-ico c-pick`,"aria-label":`Add a picture`,title:`Add a picture · paste or drop it too · ${yx}`,children:[Dx.picture,(0,G.jsx)(`input`,{"aria-label":`Add a picture`,type:`file`,multiple:!0,accept:hx.join(`,`),onChange:e=>{e.target.files&&fe(e.target.files),e.target.value=``}})]}),T===`item`&&(0,G.jsxs)(`select`,{className:`input c-attach-pick`,"aria-label":`The item to attach`,value:``,onChange:e=>{let t=e.target.value;t&&b.length<10&&!b.some(e=>e.kind===`item`&&e.ref===t)&&C([...b,{kind:`item`,ref:t}]),E(null)},children:[(0,G.jsx)(`option`,{value:``,children:`pick an item…`}),e.board.items.map(e=>(0,G.jsx)(`option`,{value:e.id,children:e.id},e.id))]}),T===`unit`&&(0,G.jsx)(lS,{ctx:e,q:D,setQ:O,picked:b.filter(e=>e.kind===`unit`).map(e=>e.ref),onPick:e=>C(b.some(t=>t.kind===`unit`&&t.ref===e)?b.filter(t=>t.kind!==`unit`||t.ref!==e):b.length<10?[...b,{kind:`unit`,ref:e}]:b),onClose:()=>E(null)}),(t.talk!==null||s)&&(0,G.jsx)(`span`,{className:`c-sep`,"aria-hidden":`true`}),t.talk!==null&&(0,G.jsx)(wa,{ctx:e,talk:t.talk}),s,(0,G.jsx)(`span`,{className:`grow`}),R&&(0,G.jsx)(`button`,{className:`c-ico c-fresh ${ie||z.freshQueued?`on`:``}`,"aria-label":`Fresh agent`,disabled:!Se,title:V?`Off while the thread waits for the limit's reset`:z.freshQueued?`Queued already: it takes over when the background tasks end`:ie?`Asked for: the handoff comes when this turn ends`:`A fresh agent goes on from a summary of this talk; the summary cannot be edited first`,onClick:ge,children:Dx.fresh}),(0,G.jsx)(`button`,{className:`c-ico c-stop`,"aria-label":`Stop`,disabled:!xe,title:V?`Off while it waits for the limit's reset: nothing runs to interrupt`:z.phase===`background`&&z.live?`Off: the agent's turn is over, only its background tasks run; ${R?`Close the agent stops them`:`the item's Stop ends the run with them`}`:xe?`Stop: interrupts the agent's step; the session stays open`:`Stop: works while the agent thinks or answers`,onClick:()=>void he({type:`interrupt`}),children:Dx.stop}),we&&(0,G.jsx)(`button`,{className:`c-ico c-hold`,"aria-label":`Hold`,title:`Hold: the session hands over at its next step and the card waits, ready; Run goes on from where it stopped`,onClick:()=>void e.hold(t.item),children:Dx.hold}),R&&(0,G.jsx)(`button`,{className:`c-ico c-close`,"aria-label":`Close the agent`,disabled:!Ce,title:se?`Closing: the agent ends within seconds`:`Closes the agent and all it started (dev servers, watchers); your next message resumes the talk`,onClick:()=>void _e(),children:Dx.close}),(0,G.jsx)(`button`,{className:`c-send`,"aria-label":`Send`,disabled:N||se||!u.trim()&&!h.length&&!b.length,title:`Send · Ctrl+Enter`,onClick:()=>void me(),children:Dx.send})]})]}),j&&(0,G.jsxs)(`span`,{role:`alert`,className:`c-err`,children:[`not added: `,j]}),k&&(0,G.jsxs)(`span`,{role:`alert`,className:`c-err mono`,children:[`not sent: `,k]})]})}function lS({ctx:e,q:t,setQ:n,picked:r,onPick:i,onClose:a}){let o=t.trim().toLowerCase(),s=(e.board.units??[]).filter(e=>!o||e.id.includes(o)||(e.title??``).toLowerCase().includes(o));return(0,G.jsxs)(`div`,{className:`c-units`,role:`dialog`,"aria-label":`Attach a design unit`,children:[(0,G.jsxs)(`div`,{className:`c-units-head`,children:[(0,G.jsx)(`input`,{className:`input`,type:`search`,"aria-label":`Search design units`,placeholder:`design units: search id or title`,value:t,autoFocus:!0,onChange:e=>n(e.target.value)}),(0,G.jsx)(`button`,{className:`icon-btn`,"aria-label":`Close the unit picker`,onClick:a,children:`×`})]}),(0,G.jsxs)(`div`,{role:`listbox`,"aria-multiselectable":`true`,className:`c-units-list`,children:[s.map(e=>{let t=r.includes(e.id);return(0,G.jsxs)(`button`,{role:`option`,"aria-selected":t,className:`picker-row`,title:e.title??e.id,onClick:()=>i(e.id),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:t?`☑`:`☐`}),(0,G.jsxs)(`span`,{className:`picker-name`,children:[(0,G.jsx)(`span`,{className:`mono`,children:e.id}),e.title&&(0,G.jsx)(`span`,{className:`dim`,children:e.title})]}),(0,G.jsx)(`span`,{className:`picker-state tone-${e.ready?`ok`:`warn`}`,children:to(e)})]},e.id)}),!s.length&&(0,G.jsx)(`span`,{className:`dim small`,children:`no design unit matches`})]})]})}var uS=({text:e,pictures:t,attach:n,reply:r})=>({type:`say`,text:e.trim()||(t.length?`(pictures)`:``),...t.length?{images:t.map(e=>({media_type:e.type,data:e.data}))}:{},...n.length?{attach:n}:{},...r?{reply_to:r}:{}});function dS(e){let t=(0,v.useRef)(null),n=(0,v.useRef)(!0),r=(0,v.useRef)(0),[i,a]=(0,v.useState)(!1),o=e=>{e.style.overflowAnchor=n.current?`none`:``};return(0,v.useEffect)(()=>{let e=t.current;e&&n.current&&(e.scrollTop=e.scrollHeight)},[e]),(0,v.useEffect)(()=>{let e=t.current;if(!e)return;o(e);let r=new ResizeObserver(()=>{n.current&&(e.scrollTop=e.scrollHeight)}),i=()=>{r.disconnect(),r.observe(e);for(let t of e.children)r.observe(t,{box:`border-box`})},a=new MutationObserver(i);return i(),a.observe(e,{childList:!0}),()=>{r.disconnect(),a.disconnect()}},[]),{ref:t,onScroll:()=>{let e=t.current;if(!e)return;let i=e.scrollHeight-e.scrollTop-e.clientHeight<40;(i||e.scrollTop<r.current)&&(n.current=i),r.current=e.scrollTop,o(e),a(!n.current)},away:i,toEnd:()=>{let e=t.current;n.current=!0,a(!1),e&&(o(e),e.scrollTo({top:e.scrollHeight,behavior:`smooth`}))}}}function fS({follow:e}){return e.away?(0,G.jsx)(`div`,{className:`c-to-end`,children:(0,G.jsx)(`button`,{className:`btn`,onClick:e.toEnd,title:`Scroll to the last message`,children:`↓ Latest`})}):null}var pS={submitted:[`submitted`,`ok`,`✔`],blocked:[`blocked`,`blocked`,`!`],failed:[`failed`,`error`,`✘`],paused:[`paused`,`neutral`,`‖`],stopped:[`stopped`,`neutral`,`■`],"no-result":[`no result`,`warn`,`?`],skipped:[`skipped`,`neutral`,`↷`]},mS={blocked:`its question`,failed:`the error`,"no-result":`why no result`,skipped:`why it was skipped`,paused:`why it paused`,stopped:`why it stopped`};function hS({ctx:e,id:t,end:n,acts:r=!0,play:i=!0,allow:a=!0}){let o=zc(n),[s,c,l]=pS[n.outcome]??[n.outcome,`neutral`,`·`],u=_S(e,t,n),d=e.board.items.find(e=>e.id===t),f=!!d?.handoff,p=r&&i&&f,m=r&&f&&n.at===d?.run_end?.at;return r?(0,G.jsxs)(`div`,{className:`c-card c-end tone-${c} ${p?`handoff`:``}`,role:`note`,"aria-label":`The run of ${t} ended`,children:[(0,G.jsxs)(`div`,{className:`c-end-head`,children:[(0,G.jsx)(`span`,{className:`c-end-mark`,"aria-hidden":`true`,children:l}),(0,G.jsxs)(`strong`,{className:`c-end-title`,children:[`Run ended: `,s]}),n.move&&(0,G.jsxs)(`span`,{className:`c-end-move`,title:`The run's result word`,children:[`move `,n.move]}),n.at&&(0,G.jsx)(`span`,{className:`c-end-time`,children:ia(n.at)})]}),n.reason&&(0,G.jsxs)(`div`,{className:`c-end-reason`,children:[(0,G.jsx)(`span`,{className:`c-end-label`,children:mS[n.outcome]??`reason`}),(0,G.jsx)(`span`,{className:`c-end-why`,children:n.reason})]}),o.length>0&&!m&&(0,G.jsx)(`div`,{className:`c-end-facts`,children:o.map((e,t)=>(0,G.jsxs)(`span`,{children:[t>0&&(0,G.jsx)(`span`,{className:`c-end-sep`,"aria-hidden":`true`,children:`·`}),e]},e))}),n.process&&(0,G.jsxs)(`span`,{className:`c-end-process`,children:[`▲ a broken step: `,n.process]}),n.left&&(0,G.jsxs)(`span`,{className:`c-end-process`,title:`A rerun goes on in that worktree, with these files`,children:[n.left.files,` file`,n.left.files>1?`s`:``,` left uncommitted in`,` `,(0,G.jsx)(`span`,{className:`mono`,children:n.left.worktree})]}),i&&(0,G.jsx)(rl,{ctx:e,id:t,lead:f?u:null}),u&&!p&&(0,G.jsx)(`div`,{className:`c-end-acts`,children:(0,G.jsx)(gS,{ctx:e,id:t,end:n,allow:a})})]}):(0,G.jsx)(`div`,{className:`c-card c-end folded tone-${c}`,role:`note`,"aria-label":`The run of ${t} ended`,children:(0,G.jsxs)(`details`,{children:[(0,G.jsxs)(`summary`,{className:`c-end-head`,children:[(0,G.jsx)(`span`,{className:`c-end-mark`,"aria-hidden":`true`,children:l}),(0,G.jsxs)(`strong`,{className:`c-end-title`,children:[`Run ended: `,s]}),n.move&&(0,G.jsxs)(`span`,{className:`c-end-move`,children:[`move `,n.move]}),n.at&&(0,G.jsx)(`span`,{className:`c-end-time`,children:ia(n.at)})]}),n.reason&&(0,G.jsx)(`span`,{className:`c-end-why`,children:n.reason}),o.length>0&&(0,G.jsx)(`div`,{className:`c-end-facts`,children:o.join(` · `)}),n.left&&(0,G.jsxs)(`span`,{className:`c-end-process`,children:[n.left.files,` file`,n.left.files>1?`s`:``,` left uncommitted in`,` `,(0,G.jsx)(`span`,{className:`mono`,children:n.left.worktree})]})]})})}function gS({ctx:e,id:t,end:n,allow:r=!0}){let i=_S(e,t,n),a=e.board.items.find(e=>e.id===t),o=r?Jb(a):null,[s,c]=(0,v.useState)(!1),l=async()=>{a&&!s&&(c(!0),await Yb(e,a).catch(()=>!1)||c(!1))};return(0,G.jsxs)(G.Fragment,{children:[o&&(0,G.jsx)(`button`,{className:`btn-primary`,"aria-busy":s||void 0,"aria-disabled":s||void 0,title:`Three steps in one: the rule ${o.rule} off for this item's next run only, the unblock, the run`,onClick:()=>void l(),children:s?`Allowing…`:`Allow ${o.rule} for one run`}),i&&(0,G.jsx)(`button`,{className:o?`btn`:`btn-primary`,title:i.tip,onClick:i.on,children:i.label})]})}function _S(e,t,n){let r=e.board.items.find(e=>e.id===t),i=r?pi(r,e.board.domain).find(e=>e.cmd===`unblock`):void 0;return r?.status===`blocked`&&i?{label:`Unblock`,tip:`Its Unblock: your answer goes to its next run`,on:()=>e.openMove({title:`${i.label} ${t}`,id:t,move:i})}:r&&[`awaiting-verdict`,`unplayed`].includes(r.status)?{label:`Verdict`,tip:`Opens Playtest with ${t} open and marked: the build, the platforms, and its verdict`,on:()=>{e.itemOpen!==t&&e.openItem(t),e.go(`playtest`)}}:r?.status===`ready`&&!r.running&&n.outcome!==`submitted`?{label:`Run again`,tip:`Starts it again; the run gate may still refuse`,on:()=>void e.run([t])}:null}function vS({ctx:e,id:t,end:n,onShow:r}){let[i,a,o]=pS[n.outcome]??[n.outcome,`neutral`,`·`],s=_S(e,t,n),c=e.board.items.find(e=>e.id===t)?.handoff,l=c?c.outcome.word===`awaiting-decision`?`Waits for a decision`:`Ready for a verdict`:`Run ended: ${i}`;return(0,G.jsxs)(`div`,{className:`c-end-bar tone-${c?`verdict`:a}`,role:`status`,"aria-label":`The last run of ${t}`,children:[(0,G.jsx)(`span`,{className:`c-end-mark`,"aria-hidden":`true`,children:c?`●`:o}),(0,G.jsx)(`span`,{className:`c-end-bar-text`,children:l}),n.at&&(0,G.jsxs)(`span`,{className:`c-end-bar-time`,children:[`· run ended `,ia(n.at),n.commit?` · main ${n.commit}`:``]}),(0,G.jsx)(`span`,{className:`c-end-bar-gap`}),(0,G.jsx)(`button`,{className:`btn-line`,title:`Scrolls the chat to the run's end card`,onClick:r,children:`↑ Show`}),s&&(0,G.jsx)(gS,{ctx:e,id:t,end:n},n.at)]})}var yS=e=>!!e.closest(`.d-grab`)&&!e.closest(`button, a, input, select, textarea`),bS=200,xS=8;function SS(e,t,n,r,i){let a=Math.min(600,e-32),o=r??{x:e-a-12,y:n},s=Math.max(0,Math.min(o.x,e-120)),c=Math.max(0,Math.min(o.y,t-bS-xS-i));return{x:s,y:c,width:a,height:Math.max(bS,t-c-xS-i)}}function CS(e,t){return async(...n)=>{if(!e.current){e.current=!0;try{await t(...n)}finally{e.current=!1}}}}var wS=48;function TS(e){let t=e.split(/\r?\n/).filter(e=>e.trim()),n=/^([a-z_]+):(?:\s+(.*))?$/;if(!t.length||!n.test(t[0]))return null;let r=[],i=r[0],a=null,o=null;for(let e of t){let t;if(t=e.match(n))i={key:t[1],rest:t[2]??``,items:[]},r.push(i),a=o=null;else if(t=e.match(/^- (.*)$/)){let e=t[1].match(n);o=e?[e[1],e[2]??``]:null,a=o?{fields:[o]}:{text:t[1]},i.items.push(a)}else(t=e.match(/^\s+([a-z_]+):(?:\s+(.*))?$/))&&a&&`fields`in a?(o=[t[1],t[2]??``],a.fields.push(o)):o?o[1]+=` ${e.trim()}`:a&&`text`in a?a.text+=` ${e.trim()}`:i.rest+=(i.rest?` `:``)+e.trim()}return r.map(e=>{e.items=e.items.map(e=>`fields`in e&&e.fields.length===1?{text:`${e.fields[0][0]}: ${e.fields[0][1]}`}:e);let t=e.items.filter(e=>`fields`in e).map(e=>e.fields),n=t[0]?.map(([e])=>e)??[],r=t.length>1&&t.every(e=>e.length===n.length&&e.every(([e,t],r)=>e===n[r]&&t.length<=wS));return{key:e.key,rest:e.rest,bullets:e.items.filter(e=>`text`in e).map(({text:e})=>{let t=e.match(/^([a-z0-9-]+): (.*)$/);return t?{lead:t[1],text:t[2]}:{lead:null,text:e}}),table:r?{cols:n,rows:t.map(e=>e.map(([,e])=>e))}:null,cards:r?[]:t}})}var ES=e=>e.replace(/^(\s*)(?:([#>*+-])|(\d+)([.)]))(?=\s|$)/,(e,t,n,r,i)=>n?`${t}\\${n}`:`${t}${r}\\${i}`),DS=e=>e.replace(/_/g,` `),OS=/^\s*(```|~~~)/,kS=/^## +(.+?)\s*$/,AS=/^(context|decisions|tasks|pillar_check|verification):\s*$/,jS=/^(tasks|handoff|outcome|play notes)\b/i,MS=/^tasks\b/i,NS=/^decisions\b/i,PS={context:`Context`,decisions:`Decisions`,tasks:`Tasks`,pillar_check:`Pillar check`,verification:`Verification`},FS=[/^play notes\b/i,MS,/^pillar_check$/,NS,/^passes\b/i,/^reviews\b/i,/^handoff\b/i,/^outcome\b/i];function IS(e){let t=e.kind===`block`?PS[e.key]??e.key:e.key.split(/\s*\(/)[0];return t.charAt(0).toUpperCase()+t.slice(1)}function LS(e,t,n){let r=e=>FS.findIndex(t=>t.test(e.key)),i=e.filter(e=>e.body&&!(/^original request\b/i.test(e.key)&&e.body.replace(/[`*_\s]/g,``)===t));return{main:i.filter(e=>r(e)>=0).sort((e,t)=>r(e)-r(t)).map(e=>r(e)===0?{...e,open:n}:e),technical:i.filter(e=>r(e)<0)}}function RS(e){return e.findIndex(e=>e.tasks.some(e=>!e.done))}function zS(e){let t=[];for(let n of e){for(let e of JS(n)??[])t.push(e.id);for(let e of KS(n)??[])for(let n of e.tasks)n.id&&t.push(n.id)}return t}var BS=/^- pass (\d+)(?: \(cycle (\d+)\))?: blocking (\d+), polish (\d+)(?:, by ([\w.:-]+))?$/;function VS(e){if(!/^(passes|reviews)\b/i.test(e.key))return null;let t=[];for(let n of e.body.split(`
99
- `)){if(!n.trim())continue;let e=BS.exec(n.trim());if(!e)return null;t.push({pass:+e[1],cycle:+(e[2]??0),blocking:+e[3],polish:+e[4],...e[5]?{by:e[5]}:{}})}return t.length?t:null}var HS=e=>e.charAt(0).toUpperCase()+e.slice(1);function US(e){if(!e||e===`self`)return`session`;let[t,n,r]=e.split(`:`);if(!n)return HS(t);let i=t===`codex`?n.split(`-`).at(-1):n.replace(/^claude-/,``).split(`-`)[0];return r?`${HS(i)} · ${r===`xhigh`?`xHigh`:HS(r)}`:HS(i)}function WS(e){let t=Math.max(...e.map(e=>e.cycle)),n=e.filter(e=>e.cycle===t),r=n.at(-1),i=r.blocking?`blocking ${r.blocking}`:`converged`;return[t?`cycle ${t}`:null,`${n.length} pass${n.length===1?``:`es`}`,i].filter(Boolean).join(` · `)}function GS(e){let t=null,n=[],r=[],i=!1;for(let a of e.replace(/\r\n/g,`
100
- `).split(`
101
- `)){OS.test(a)&&(i=!i);let e=i?null:kS.exec(a),o=i?null:AS.exec(a),s=i||r.length||t!==null?null:/^# +(.+?)\s*$/.exec(a);if(s)t=s[1];else if(e||o){let t=(e??o)[1];r.push({key:t,kind:e?`md`:`block`,body:``,open:jS.test(t),lines:[]})}else r.length?r.at(-1).lines.push(a):n.push(a)}return{title:t,lead:n.join(`
102
- `).trim(),folds:r.map(({lines:e,...t})=>({...t,body:e.join(`
103
- `).trim()}))}}function KS(e){if(!MS.test(e.key))return null;let t=[{name:null,tasks:[]}],n=null;for(let r of e.body.split(`
104
- `)){let i=/^### +(.+?)\s*$/.exec(r),a=/^\s*- \[([ xX])\] +(.*)$/.exec(r);if(i)t.push({name:i[1],tasks:[]}),n=null;else if(a)n={done:a[1]!==` `,...e.kind===`block`?qS(a[2]):{text:a[2]}},t.at(-1).tasks.push(n);else if(n&&/^\s+\S/.test(r))n.text+=` ${r.trim()}`;else if(!r.trim())n=null;else return null}let r=t.filter(e=>e.tasks.length);return r.length?r:null}function qS(e){let t=/^(t\d+[a-z]?)\s+(.*)$/.exec(e),n=t?t[2]:e,r=/\s*\((d\d+[a-z]?(?:,\s*d\d+[a-z]?)*)\)\s*$/.exec(n);return{text:r?n.slice(0,r.index):n,...t?{id:t[1]}:{},...r?{refs:r[1].split(/,\s*/)}:{}}}function JS(e){if(e.kind!==`block`||!NS.test(e.key))return null;let t=[];for(let n of e.body.split(`
105
- `)){if(!n.trim())continue;let e=/^- ([a-z_]+): (.*)$/.exec(n),r=/^\s+([a-z_]+): (.*)$/.exec(n);if(e)t.push({[e[1]]:e[2]});else if(r&&t.length&&!(r[1]in t.at(-1)))t.at(-1)[r[1]]=r[2];else return null}return!t.length||t.some(e=>!e.id||!e.pick)?null:t.map(({id:e,pick:t,...n})=>({id:e,pick:t,rows:Object.entries(n).map(([e,t])=>({key:e,value:t}))}))}function YS(e){if(e.kind!==`block`)return null;let t=[];for(let n of e.body.split(`
106
- `)){if(!n.trim())continue;let e=/^- (.*)$/.exec(n);if(!e)return null;let r=/^([a-z_][\w-]*): (.*)$/.exec(e[1]);t.push(r?{lead:r[1],text:r[2]}:{lead:null,text:e[1]})}return t.length?t:null}function XS(e){if(!MS.test(e.key))return null;let t=e.body.match(/^\s*- \[[ xX]\] /gm)?.length??0,n=e.body.match(/^\s*- \[[xX]\] /gm)?.length??0;return t?{done:n,all:t}:null}function ZS(e){let t=XS(e);if(t)return`${t.done} / ${t.all}`;let n=VS(e);if(n)return WS(n);let r=e.body.split(`
107
- `).filter(e=>e.trim()),i=r.filter(e=>/^(- |\* |\d+\. )/.test(e)).length;return NS.test(e.key)&&i?`${i} decision${i===1?``:`s`}`:r.length?`${r.length} line${r.length===1?``:`s`}`:``}function QS(e,t){let n=e=>e.replaceAll(`\\`,`/`),r=n(t);if(!/^([a-z]:)?\//i.test(r))return r;let i=n(e).replace(/\/+$/,``);return r.toLowerCase().startsWith(`${i.toLowerCase()}/`)?r.slice(i.length+1):null}function $S(e,t){if(/^([a-z][a-z0-9+.-]*:|[/\\#?])/i.test(t))return null;let n=e.split(`/`).slice(0,-1).map(encodeURIComponent).join(`/`),r=n?`http://p/${n}/`:`http://p/`;try{let{pathname:e}=new URL(t,r);return decodeURIComponent(e.slice(1))}catch{return null}}var eC=(e,t)=>{let n=QS(e.path,t);return t=>{let r=n===null?null:$S(n,t);return r&&Pe(r)?oe(e.name,r):ag(t)}},tC=[[/^start: /,`start`],[/^agent: /,`agent`],[/^tool error: /,`toolerr`],[/^denied: /,`denied`],[/^tool: /,`tool`],[/^(?=subagent tool error: )/,`toolerr`],[/^(?=subagent tool: )/,`tool`],[/^(?=subagent: )/,`agent`]];function nC(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){if(!r.trim())continue;let e=r.match(/^\[(\d\d:\d\d:\d\d)\] (.*)$/),i=e?e[1]:``,a=e?e[2]:r,o=n&&!e?`result`:`other`,s=tC.find(([e])=>e.test(a));if(s)o=s[1],a=a.replace(s[0],``),n=!1;else if(/^result:/.test(a)){if(n=!0,a=a.slice(7).trim(),!a)continue;o=`result`}else e&&/^(done|ended) /.test(a)?(o=`summary`,n=!1):e&&(n=!1);t.push({time:i,kind:o,text:a})}return t}var rC=e=>/--resume/.test(e)?`session resumed`:/--handoff/.test(e)?`fresh session after handoff`:`run start`;function iC(e){let t={text:``,rect:null,rects:[]},n=window.getSelection();if(!e||!n||n.isCollapsed||!n.rangeCount)return t;let r=n.getRangeAt(0);if(!e.contains(r.commonAncestorContainer))return t;let i=n.toString();return i.trim()?{text:i,rect:r.getBoundingClientRect(),rects:[...r.getClientRects()]}:t}var aC=(e,t,n)=>e.some(e=>t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom),oC=200,sC=76,cC=(0,G.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.9`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,G.jsx)(`rect`,{x:`8`,y:`8`,width:`12`,height:`12`,rx:`2`}),(0,G.jsx)(`path`,{d:`M16 8V5a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h3`})]}),lC=(0,G.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.9`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M9 14L4 9l5-5`}),(0,G.jsx)(`path`,{d:`M4 9h10a6 6 0 0 1 6 6v4`})]}),uC=(e,t)=>({x:Math.max(4,Math.min(e,window.innerWidth-oC-4)),y:Math.max(4,Math.min(t,window.innerHeight-sC-4))});function dC({stream:e,onReply:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(t);c.current=t;let l=!!t;(0,v.useEffect)(()=>{let t=e.current;if(!t)return;let n=e=>{let{text:n,rect:i,rects:a}=iC(t);if(!n||!i)return;let o=!!(e.clientX||e.clientY);if(o&&!aC(a,e.clientX,e.clientY))return;e.preventDefault(),s.current=document.activeElement;let c=o?uC(e.clientX,e.clientY):uC(i.left,i.bottom+4);r({...c,text:n})};return t.addEventListener(`contextmenu`,n),()=>t.removeEventListener(`contextmenu`,n)},[e]),(0,v.useEffect)(()=>{if(!n)return;o.current?.querySelector(`[role="menuitem"]`)?.focus();let e=e=>{o.current?.contains(e.target)||r(null)},t=()=>r(null);return document.addEventListener(`pointerdown`,e,!0),window.addEventListener(`wheel`,t,!0),window.addEventListener(`touchmove`,t,!0),window.addEventListener(`resize`,t),()=>{document.removeEventListener(`pointerdown`,e,!0),window.removeEventListener(`wheel`,t,!0),window.removeEventListener(`touchmove`,t,!0),window.removeEventListener(`resize`,t)}},[n]),(0,v.useEffect)(()=>{if(!l||!window.matchMedia(`(pointer: coarse)`).matches)return;let t=()=>{let{text:t,rect:n}=iC(e.current);a(t&&n?{...uC(n.left,n.bottom+8),text:t}:null)};return document.addEventListener(`selectionchange`,t),window.addEventListener(`scroll`,t,!0),()=>{document.removeEventListener(`selectionchange`,t),window.removeEventListener(`scroll`,t,!0)}},[e,l]);let u=e=>{r(null),e&&s.current?.focus()},d=e=>{r(null),a(null),c.current?.(Ve(e))};return(0,G.jsxs)(G.Fragment,{children:[n&&(0,G.jsxs)(`div`,{ref:o,className:`c-sel-menu`,role:`menu`,"aria-label":`Selection`,style:{left:n.x,top:n.y},onKeyDown:e=>{let t=[...o.current?.querySelectorAll(`[role="menuitem"]`)??[]],n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),t[(n+t.length)%t.length]?.focus()};e.key===`Escape`?(e.preventDefault(),u(!0)):e.key===`ArrowDown`?r(n+1):e.key===`ArrowUp`?r(n-1):e.key===`Home`?r(0):e.key===`End`?r(t.length-1):e.key===`Tab`&&u(!1)},children:[(0,G.jsxs)(`button`,{role:`menuitem`,"aria-label":`Copy`,"aria-keyshortcuts":`Control+C`,tabIndex:-1,onClick:()=>{ib(n.text),u(!0)},children:[cC,(0,G.jsx)(`span`,{children:`Copy`}),(0,G.jsx)(`kbd`,{children:`Ctrl+C`})]}),l&&(0,G.jsxs)(`button`,{role:`menuitem`,"aria-label":`Reply`,title:`Quotes it into your message`,tabIndex:-1,onClick:()=>d(n.text),children:[lC,(0,G.jsx)(`span`,{children:`Reply`}),(0,G.jsx)(`span`,{className:`dim`,children:`quotes it`})]})]}),i&&!n&&(0,G.jsxs)(`button`,{className:`c-sel-reply`,style:{left:i.x,top:i.y},onPointerDown:e=>e.preventDefault(),onClick:()=>d(i.text),children:[lC,`Reply`]})]})}function fC(e,t,n){let r=e.project.name,i=`proposals`in t?t.proposals:[];return{key:t.id,events:n,talk:t.id,item:t.item,proposals:i,send:n=>H.sendTalk(r,t.id,n).catch(t=>{throw e.notify(t.message,`error`),t}),imageUrl:e=>`/api/p/${encodeURIComponent(r)}/talk/${t.id}/att/${e.split(`/`).pop()}`,imagePath:e=>`.gcf-session/chats/${t.id}/${e}`}}function pC({ctx:e,item:t}){let n=e.project.name,[r,i]=(0,v.useState)(``),a=(0,v.useRef)(null),o=Ox(se(n,{item:t.id})),s=e.talks.find(e=>e.item===t.id),c=Ox(s?se(n,{talk:s.id}):null),l=dS(o.length+c.length),u={key:`run`,events:o,talk:null,item:t.id,send:r=>H.sendChat(n,t.id,r).catch(t=>{throw e.notify(t.message,`error`),t}),imageUrl:e=>`/api/p/${encodeURIComponent(n)}/chat/${t.id}/att/${e.split(`/`).pop()}`,imagePath:e=>`.gcf-session/runs/${e}`},d=fC(e,s??{id:``,item:t.id},c),f=Mb(o),p=t.running&&t.running_kind!==`session`&&(f.live||f.phase===`limit`||f.resuming),m=p?u:d,h=t.running&&t.running_kind===`session`,g=o.findLastIndex(e=>e.type===`run_end`),_=o.findLastIndex(e=>e.type===`session`),y=g>=0&&g>_?o[g]:null,b=()=>[...l.ref.current?.querySelectorAll(`.c-end:not(.folded)`)??[]].at(-1)??null,[x,S]=(0,v.useState)(!0);(0,v.useEffect)(()=>{let e=b();if(!e||typeof IntersectionObserver>`u`)return S(!0);let t=new IntersectionObserver(([e])=>S(e.isIntersecting),{root:l.ref.current});return t.observe(e),()=>t.disconnect()},[y?.at,o.length,c.length]);let C=y?.type===`run_end`&&!x&&(t.handoff||_S(e,t.id,y))?y:null,w=()=>b()?.scrollIntoView({block:`center`,behavior:`smooth`}),T=[`model`,`effort`].map(n=>xa(e.board,n,t[n])).filter(Boolean).map(e=>ga(e??``)).join(` · `);return(0,G.jsxs)(`div`,{className:`item-chat`,children:[(0,G.jsxs)(`div`,{className:`c-stream`,ref:l.ref,onScroll:l.onScroll,role:`log`,"aria-live":`polite`,"aria-relevant":`additions`,children:[!o.length&&!c.length&&(0,G.jsx)(`div`,{className:`tab-empty`,children:h?`An interactive session has no chat on the board: it is your own agent session, in your terminal.`:`No chat yet: it opens with the item's next run. A question now makes ${t.id}'s own thread of the project chat.`}),(0,G.jsx)(qx,{ctx:e,part:u,thread:d,startNote:T,onReply:e=>a.current?.(e)})]}),(0,G.jsx)(fS,{follow:l}),(0,G.jsx)(dC,{stream:l.ref,onReply:e=>a.current?.(e)}),C&&(0,G.jsx)(vS,{ctx:e,id:t.id,end:C,onShow:w}),(0,G.jsx)(cS,{ctx:e,part:m,quote:a,costLabel:p?`this run`:`this thread`,pulse:p?(0,G.jsx)(mC,{item:t,events:o}):void 0,canStop:!0,route:r,placeholder:p?f.phase===`limit`?`Write now: it reaches the agent after the reset`:`Message the agent working on ${t.id}…`:`A question about ${t.id}: it goes to its own thread`,extra:p?(0,G.jsx)(`span`,{className:`a-pick compact`,children:[`model`,`effort`].map(n=>(0,G.jsx)(`select`,{className:`input`,"aria-label":n,disabled:!0,title:`${n}: a run keeps the item's own model and effort`,children:(0,G.jsx)(`option`,{children:ga(xa(e.board,n,t[n])??``)})},n))}):(0,G.jsx)(Jx,{ctx:e}),onSend:async r=>{let a=f.phase===`limit`,o=await H.sendChat(n,t.id,uS(r));return i(o.talk?`the server sent your last message to ${o.talk}, ${t.id}'s own thread`:a?`the server took your last message into the run: it waits for the reset`:`the server sent your last message to the run's session`),o.talk&&e.reloadTalks(),{key:o.talk??u.key,id:o.id}}})]})}function mC({item:e,events:t}){let n=e.plan&&!(`error`in e.plan)?e.plan:null,r=t.findLastIndex(e=>e.type===`run_end`),i=t.slice(r+1).find(e=>e.type===`session`),a=i&&e.active_at&&e.active_at>=i.at,o=n&&n.tasks?`step ${Math.min(n.done+1,n.tasks)} of ${n.tasks}`:``,s=a?e.doing??``:``,c=i?Math.max(1,Math.round((Date.now()-Date.parse(i.at))/6e4)):0,l=c?c<60?`${c} min`:`${Math.floor(c/60)} h ${String(c%60).padStart(2,`0`)} min`:``;return!o&&!s&&!l?null:(0,G.jsxs)(`div`,{className:`c-pulse`,role:`status`,title:`While the run goes: its plan step, its last tool call (from its log), how long it has gone. Every call is in the Log tab.`,children:[(0,G.jsx)(`span`,{className:`c-pulse-dot`,"aria-hidden":`true`}),o&&(0,G.jsx)(`span`,{className:`c-pulse-step`,children:o}),s&&(0,G.jsx)(`span`,{className:`c-pulse-doing`,children:s}),(0,G.jsx)(`span`,{className:`c-pulse-time`,children:l})]})}var hC=e=>String(e).padStart(2,`0`),gC=e=>{let t=Math.round(e/6e4);return t<60?`${t} min`:`${Math.floor(t/60)} h ${hC(t%60)} min`},_C=e=>e===null?`?`:e>=1e6?`${(e/1e6).toFixed(1).replace(/\.0$/,``)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e),vC=e=>e===null?`$?`:`$${e.toFixed(2)}`,yC={submit:`ok`,close:`ok`,paused:`neutral`,"no-result":`neutral`,block:`blocked`,"not-started":`queued`};function bC(e){return!e.model&&!e.effort?{text:`on the agent's own model`,picked:!1}:{text:`on ${e.model??`the agent's model`} · ${e.effort??`the agent's effort`}`,picked:!0}}function xC(e,t,n){if(e.started)return{from:e.started,to:e.ended};let r=n.slice(n.indexOf(e)+1).find(e=>e.items.some(e=>e.id===t));return{from:r?r.ended:null,to:e.ended}}function SC({ctx:e,run:t,only:n,list:r,onPart:i}){let a=(e,n)=>i(n.id,{kind:e,run:t,item:n,span:xC(t,n.id,r)}),{board:o}=e,s=e=>o.items.some(t=>t.id===e)||(o.history??[]).some(t=>t.id===e)||(o.graveyard??[]).some(t=>t.id===e),c=t.items.filter(e=>!n||e.id===n),l=n?t.items.filter(e=>e.id!==n).map(e=>e.id):[],u=t.started&&t.started.slice(0,10)===t.ended.slice(0,10);return(0,G.jsxs)(`article`,{className:`run-row`,"aria-label":`Run ended ${t.ended}`,children:[(0,G.jsxs)(`header`,{children:[t.started?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{className:`mono strong`,title:`start → end, on your clock`,children:[ia(t.started),` → `,u?ra(t.ended):ia(t.ended)]}),(0,G.jsx)(`span`,{className:`mono dim`,children:gC(Date.parse(t.ended)-Date.parse(t.started))})]}):(0,G.jsxs)(`span`,{className:`mono strong`,title:`An older run-log line has no start`,children:[`ended `,ia(t.ended)]}),(0,G.jsx)(`span`,{className:`mono dim`,title:`Run mode`,children:t.mode}),t.cost_usd!==null&&(0,G.jsx)(`span`,{className:`mono`,title:`What the whole run cost`,children:vC(t.cost_usd)}),(0,G.jsxs)(`span`,{className:`dim small`,children:[t.items.length,` item`,t.items.length>1?`s`:``]}),l.length>0&&(0,G.jsxs)(`span`,{className:`mono dim small`,children:[`with `,l.join(`, `)]}),!t.id&&(0,G.jsx)(`span`,{className:`dim small run-old`,children:`an older run-log line: no id, no start, no model, no log part`})]}),c.map((t,n)=>{let r=bC(t);return(0,G.jsxs)(`div`,{className:`run-item`,children:[(0,G.jsxs)(`div`,{className:`run-item-line`,children:[s(t.id)?(0,G.jsx)(`button`,{className:`link-btn mono strong`,onClick:()=>e.openItem(t.id),children:t.id}):(0,G.jsx)(`span`,{className:`mono strong`,children:t.id}),(0,G.jsx)(`span`,{className:`badge mono tone-${yC[t.result]??`warn`}`,title:`The run-log's result word`,children:t.result}),t.cost_usd!==null&&(0,G.jsx)(`span`,{className:`mono`,children:vC(t.cost_usd)}),t.duration_ms!==null&&(0,G.jsx)(`span`,{className:`mono dim`,children:gC(t.duration_ms)}),(0,G.jsx)(`span`,{className:`grow`}),s(t.id)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{className:`btn-line run-btn`,title:t.log?`The part of ${t.id}'s log this run wrote: bytes ${t.log.from.toLocaleString(`en`)}–${t.log.to.toLocaleString(`en`)}`:`An older line: no log part, the whole log`,onClick:()=>a(`log`,t),children:t.log?`log`:`whole log`}),(0,G.jsx)(Ls,{label:`Chat`,tip:`Opens the chat of this run: its conversation with the agent, and a question you send goes to it`,glyph:`chat`,size:`sm`,onClick:()=>a(`chat`,t)})]})]}),t.reason&&(0,G.jsx)(`span`,{className:`mono run-reason`,title:`The reason, word for word`,children:t.reason}),(0,G.jsxs)(`div`,{className:`run-facts mono`,children:[Object.values(t.tokens).some(e=>e!==null)&&(0,G.jsxs)(`span`,{title:`tokens`,children:[`in `,_C(t.tokens.input),` · out `,_C(t.tokens.output),` · cache read`,` `,_C(t.tokens.cache_read)]}),t.turns!==null&&(0,G.jsxs)(`span`,{children:[t.turns,` turns`]}),t.handoffs>0&&(0,G.jsxs)(`span`,{className:`running-text`,children:[`↻ `,t.handoffs,` handoff`,t.handoffs>1?`s`:``]}),(0,G.jsx)(`span`,{className:r.picked?``:`dim`,title:`What it ran on: the run's pick or the item's own; none is the agent's choice`,children:r.text}),t.process&&(0,G.jsxs)(`span`,{className:`warn-text`,title:`A broken step of the run's process`,children:[`! `,t.process]})]})]},`${t.id}-${n}`)})]})}function CC(e){let t=e?.split(/\r?\n/)??[],n=t.findIndex(e=>/^tuning:\s*$/.test(e)),r=[];if(n<0)return r;for(let e of t.slice(n+1)){if(/^[A-Za-z_][\w-]*:/.test(e)||/^##\s/.test(e))break;let t=e.trim();t&&!/^<!--.*-->$/.test(t)&&(e.startsWith(`- `)?r.push(e.slice(2).trim()):/^\s/.test(e)&&r.length&&(r[r.length-1]+=` ${t}`))}return r}var wC={p:({children:e})=>(0,G.jsx)(G.Fragment,{children:e})},TC=[Ny],EC=[`status`,`chat`,`file`,`plan`,`log`,`history`,`related`,`lessons`],DC=`gcf-item-tab`;function OC(){try{let e=localStorage.getItem(DC);return EC.includes(e)?e:null}catch{return null}}function kC(e){try{localStorage.setItem(DC,e)}catch{}}var AC=[`type`,`system`,`gate`,`milestone`],jC=null,MC=window.matchMedia(`(width <= 700px)`),NC=24,PC=2e4,FC=()=>(0,v.useSyncExternalStore)(e=>(window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)),()=>`${window.innerWidth}x${window.innerHeight}`);function IC(){FC();let[e,t]=(0,v.useState)(jC),n=(0,v.useRef)(null),r=Math.round(document.querySelector(`.workspace`)?.getBoundingClientRect().top??48)+6,{x:i,y:a,width:o,height:s}=SS(window.innerWidth,window.innerHeight,r,e,MC.matches?0:NC);return{style:{"--win-x":`${i}px`,"--win-y":`${a}px`,"--win-w":`${o}px`,"--win-h":`${s}px`},onPointerDown:e=>{e.button===0&&!MC.matches&&yS(e.target)&&(n.current={dx:e.clientX-i,dy:e.clientY-a},e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault())},onPointerMove:e=>{n.current&&(jC={x:e.clientX-n.current.dx,y:e.clientY-n.current.dy},t(jC))},onPointerUp:()=>{n.current=null},onPointerCancel:()=>{n.current=null},onLostPointerCapture:()=>{n.current=null}}}function LC({id:e,ctx:t}){let[n,r]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>r(!1),1500);return()=>clearTimeout(e)},[n]),(0,G.jsx)(`button`,{type:`button`,className:`icon-btn d-copy`,"aria-label":n?`Copied`:`Copy the name ${e}`,title:n?`Copied`:`Copy ${e}`,onClick:()=>void ib(e).then(e=>e?r(!0):t.notify(`The browser did not let the page copy`,`error`)),children:n?`✓`:`⧉`})}var RC=new Set([`depends`,`needs`,`needed_by`,`waits_for`]),zC=e=>e.board.domain.fields.some(e=>e.key===`needs`),BC=new Map,VC=new Map;function HC(e,t,n){let r=`${e.project.name}\n${t}`,[i,a]=(0,v.useState)(()=>BC.get(r)?.text??null);(0,v.useEffect)(()=>{let i=!0;return t&&BC.get(r)?.version!==n&&H.file(e.project.name,t).then(e=>{BC.set(r,{version:n,text:e.text}),i&&a(e.text)},e=>i&&a(e.message)),()=>{i=!1}},[e.project.name,t,n,r]);let o=(0,v.useRef)(r);return(0,v.useEffect)(()=>{o.current!==r&&(o.current=r,a(BC.get(r)?.text??null))},[r]),i}var UC=(e,t)=>e.map((e,n)=>(0,G.jsxs)(`section`,{className:`file-sec`,children:[(0,G.jsx)(`h3`,{children:DS(e.key)}),e.rest&&(0,G.jsx)(`p`,{children:t(e.rest)}),e.bullets.length>0&&(0,G.jsx)(`ul`,{children:e.bullets.map((e,n)=>(0,G.jsxs)(`li`,{children:[e.lead&&(0,G.jsxs)(`span`,{className:`file-lead`,children:[e.lead,`: `]}),t(e.text)]},n))}),e.cards.length>0&&(0,G.jsx)(`ol`,{className:`file-cards`,children:e.cards.map((e,n)=>(0,G.jsx)(`li`,{children:e.map(([e,n],r)=>(0,G.jsxs)(`span`,{className:`file-card-row`,children:[(0,G.jsx)(`span`,{children:DS(e)}),(0,G.jsx)(`span`,{children:t(n)})]},r))},n))}),e.table&&(0,G.jsxs)(`table`,{className:`file-table`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsx)(`tr`,{children:e.table.cols.map((e,t)=>(0,G.jsx)(`th`,{children:DS(e)},t))})}),(0,G.jsx)(`tbody`,{children:e.table.rows.map((e,n)=>(0,G.jsx)(`tr`,{children:e.map((e,n)=>(0,G.jsx)(`td`,{children:t(e)},n))},n))})]})]},n));function WC({ctx:e,item:t}){let n=n=>(0,G.jsx)(tg,{urlTransform:eC(e.project,t.file),components:wC,children:ES(n)}),r=HC(e,t.file,JSON.stringify(t)),[i,a]=(0,v.useState)(!1);if(r===null)return(0,G.jsx)(`p`,{className:`tab-note`,children:`reading…`});let o=r.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/),s=o?r.slice(o[0].length):r,c=TS(s);return(0,G.jsxs)(`div`,{className:`file-tab`,children:[(0,G.jsx)(`div`,{className:`tab-path`,children:t.file}),o&&(0,G.jsxs)(`div`,{className:`file-front`,children:[(0,G.jsxs)(`button`,{"aria-expanded":i,title:`The item's data block: what the board and the core read`,onClick:()=>a(!i),children:[i?`▾`:`▸`,` front matter`,(0,G.jsxs)(`span`,{className:`dim`,children:[o[1].split(/\r?\n/).length,` lines`]})]}),i&&(0,G.jsx)(`pre`,{className:`frontmatter`,children:o[1]})]}),c?UC(c,n):(0,G.jsx)(`div`,{className:`md`,children:(0,G.jsx)(tg,{urlTransform:eC(e.project,t.file),remarkPlugins:TC,children:s})})]})}function GC({ctx:e,item:t}){let n=t.plan,r=HC(e,t.plan_file,`${JSON.stringify(n)} ${e.board.plans_rev??0}`);if(!t.plan_file)return(0,G.jsx)(`p`,{className:`tab-note`,children:`No plan yet: the run writes the plan first.`});let i=r===null?[]:GS(r).folds,a=i.some(e=>XS(e)),o=i.length?i.some(e=>e.kind===`block`)?` · plan form (CNL-P)`:` · an older plan: folds by its headings`:``;return(0,G.jsxs)(`div`,{className:`plan-tab`,children:[n&&!(`error`in n)&&!a&&(0,G.jsxs)(`div`,{className:`plan-head`,title:`Plan checkboxes done / total`,children:[(0,G.jsxs)(`span`,{children:[n.done,` / `,n.tasks,` checked`]}),(0,G.jsx)(`span`,{className:`bar ok`,"aria-hidden":`true`,children:(0,G.jsx)(`span`,{style:{width:`${Math.round(100*n.done/Math.max(1,n.tasks))}%`}})})]}),n&&`error`in n&&(0,G.jsxs)(`div`,{role:`alert`,className:`plan-error`,children:[(0,G.jsx)(`span`,{children:`✘ The framework cannot read the plan`}),(0,G.jsx)(`pre`,{children:n.error})]}),(0,G.jsx)(`div`,{className:`tab-path`,title:`${t.plan_file}${o}`,children:t.plan_file}),r===null?(0,G.jsx)(`p`,{className:`tab-note`,children:`reading…`}):(0,G.jsx)(XC,{ctx:e,item:t,text:r})]})}var KC=(0,v.createContext)({ids:new Set,target:null,go:()=>{}});function qC({children:e}){let{ids:t,go:n}=(0,v.useContext)(KC);return(0,G.jsx)(G.Fragment,{children:v.Children.map(e,e=>typeof e==`string`?ve(e,t,[...t]).map((e,t)=>e.id?(0,G.jsx)(JC,{id:e.id,go:n},t):e.t):e)})}function JC({id:e,go:t}){return(0,G.jsx)(`button`,{type:`button`,className:`item-link plan-link`,title:`${e.startsWith(`d`)?`Decision`:`Task`} ${e} of this plan`,onClick:n=>{n.stopPropagation(),n.preventDefault(),t(e)},children:e})}function YC(e,t){let{target:n}=(0,v.useContext)(KC),r=!!e&&n?.id===e;return(0,v.useEffect)(()=>{r&&t.current?.scrollIntoView?.({block:`center`,behavior:`smooth`})},[r,n?.n,t]),r}function XC({ctx:e,item:t,text:n}){let r=eC(e.project,t.plan_file??``),[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>a(null),2e3);return()=>clearTimeout(e)},[i]);let{lead:o,folds:s}=GS(n),c={ids:new Set(zS(s)),target:i,go:e=>a(t=>({id:e,n:(t?.n??0)+1}))},l={p:qC,li:({children:e})=>(0,G.jsx)(`li`,{children:(0,G.jsx)(qC,{children:e})})},u=e=>(0,G.jsx)(tg,{urlTransform:r,components:l,children:ES(e)}),d=e=>(0,G.jsx)(`div`,{className:`md`,children:(0,G.jsx)(tg,{urlTransform:r,remarkPlugins:TC,components:{...l,p:({children:e})=>(0,G.jsx)(`p`,{children:(0,G.jsx)(qC,{children:e})})},children:e})});if(!s.length)return d(n);let f=t.moves.some(e=>e.startsWith(`verdict:`)),{main:p,technical:m}=LS(s,t.id,f),h=(e,t)=>(0,G.jsx)(tw,{f:e,children:ZC(e,u,d)},`${e.key}-${t}`);return(0,G.jsx)(KC.Provider,{value:c,children:(0,G.jsxs)(`div`,{className:`plan-folds`,children:[o&&d(o),p.map(h),m.length>0&&(0,G.jsx)(tw,{f:{key:`Technical`,kind:`md`,body:``,open:!1},count:`${m.length} section${m.length===1?``:`s`}`,children:(0,G.jsx)(`div`,{className:`plan-technical`,children:m.map(h)})})]})})}function ZC(e,t,n){let r=KS(e);if(r){let e=r.some(e=>e.tasks.some(e=>e.id)),n=RS(r);return(0,G.jsx)(`div`,{className:`plan-tasks ${e?`with-ids`:``}`,children:r.map((r,i)=>(0,G.jsx)(QC,{p:r,open:i===n,ids:e,inline:t},i))})}let i=JS(e);if(i)return(0,G.jsx)(`div`,{className:`plan-cards`,children:i.map(e=>(0,G.jsx)(ew,{d:e,inline:t},e.id))});let a=VS(e);if(a)return(0,G.jsx)(`ol`,{className:`plan-passes`,children:a.map((e,t)=>(0,G.jsxs)(`li`,{className:e.blocking?`blocking`:``,children:[(0,G.jsxs)(`span`,{className:`plan-pass-n`,children:[`pass `,e.pass,e.cycle?` · cycle ${e.cycle}`:``]}),(0,G.jsxs)(`span`,{children:[`blocking `,e.blocking]}),(0,G.jsxs)(`span`,{children:[`polish `,e.polish]}),(0,G.jsx)(`span`,{className:`plan-pass-by`,title:e.by?`by ${e.by}`:`by the session`,children:US(e.by)})]},t))});let o=YS(e);if(o)return(0,G.jsx)(`ul`,{className:`plan-lines`,children:o.map((e,n)=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsxs)(`span`,{children:[e.lead&&(0,G.jsx)(`span`,{className:`plan-lead`,children:e.lead}),t(e.text)]})]},n))});let s=e.kind===`block`?TS(`${e.key}:\n${e.body}`):null;return s?UC(s,t):n(e.body)}function QC({p:e,open:t,ids:n,inline:r}){let{target:i,go:a}=(0,v.useContext)(KC),[o,s]=(0,v.useState)(t||!e.name),c=!!i&&e.tasks.some(e=>e.id===i.id);(0,v.useEffect)(()=>{c&&s(!0)},[c,i?.n]);let l=e.tasks.filter(e=>e.done).length,u=l===e.tasks.length;return(0,G.jsxs)(`div`,{className:`plan-phase ${o?`open`:``}`,children:[e.name&&(0,G.jsxs)(`button`,{type:`button`,className:`plan-phase-head`,"aria-expanded":o,title:`${l} of ${e.tasks.length} tasks of this phase ticked`,onClick:()=>s(!o),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:o?`▾`:`▸`}),(0,G.jsx)(`span`,{className:`plan-phase-name`,children:e.name}),(0,G.jsxs)(`span`,{className:`plan-phase-count ${u?`all`:``}`,children:[l,` / `,e.tasks.length]}),(0,G.jsx)(`span`,{className:`bar ok`,"aria-hidden":`true`,children:(0,G.jsx)(`span`,{style:{width:`${Math.round(100*l/e.tasks.length)}%`}})})]}),o&&(0,G.jsx)(`ul`,{children:e.tasks.map((e,t)=>(0,G.jsx)($C,{t:e,ids:n,inline:r,go:a},t))})]})}function $C({t:e,ids:t,inline:n,go:r}){let i=(0,v.useRef)(null),a=YC(e.id,i);return(0,G.jsxs)(`li`,{ref:i,className:`${e.done?`done`:``} ${a?`plan-hit`:``}`,children:[(0,G.jsx)(`span`,{className:`plan-box`,role:`img`,"aria-label":e.done?`done`:`to do`,children:e.done?`☑`:`☐`}),t&&(0,G.jsx)(`span`,{className:`plan-tid`,children:e.id}),(0,G.jsxs)(`span`,{className:`plan-task-text`,children:[n(e.text),e.refs?.map(e=>(0,G.jsx)(`button`,{type:`button`,className:`plan-ref`,title:`Decision ${e} of this plan`,onClick:()=>r(e),children:e},e))]})]})}function ew({d:e,inline:t}){let[n,r]=(0,v.useState)(!1),i=(0,v.useRef)(null),a=YC(e.id,i),{target:o}=(0,v.useContext)(KC);return(0,v.useEffect)(()=>{a&&r(!0)},[a,o?.n]),(0,G.jsxs)(`article`,{ref:i,className:`plan-card ${n?`open`:``} ${a?`plan-hit`:``}`,onClick:()=>r(!n),children:[(0,G.jsxs)(`div`,{className:`plan-card-head`,children:[(0,G.jsx)(`button`,{type:`button`,className:`plan-card-id`,"aria-expanded":n,title:`${n?`Fold`:`Open`} decision ${e.id}`,onClick:e=>{e.stopPropagation(),r(!n)},children:e.id}),(0,G.jsx)(`span`,{className:`plan-card-pick`,children:t(e.pick)})]}),n&&e.rows.map(e=>(0,G.jsxs)(`div`,{className:`plan-card-row`,children:[(0,G.jsx)(`span`,{children:e.key}),(0,G.jsx)(`span`,{children:t(e.value)})]},e.key))]})}function tw({f:e,count:t,children:n}){let[r,i]=(0,v.useState)(e.open),{target:a}=(0,v.useContext)(KC),o=!!a&&((JS(e)??[]).some(e=>e.id===a.id)||(KS(e)??[]).some(e=>e.tasks.some(e=>e.id===a.id)));(0,v.useEffect)(()=>{o&&i(!0)},[o,a?.n]);let s=t??ZS(e),c=XS(e),l=c!==null&&c.done===c.all,u=IS(e),d=e.kind===`md`?e.key.slice(e.key.split(/\s*\(/)[0].length).trim():``;return(0,G.jsxs)(`section`,{className:`plan-fold ${r?`open`:``}`,"aria-label":u,children:[(0,G.jsxs)(`button`,{className:`plan-fold-head`,"aria-expanded":r,title:`${r?`Fold`:`Open`} ${u}`,onClick:()=>i(!r),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:r?`▾`:`▸`}),(0,G.jsx)(`span`,{className:`plan-fold-name`,children:u}),d&&(0,G.jsx)(`span`,{className:`plan-fold-sub`,children:d}),s&&(0,G.jsxs)(`span`,{className:`plan-fold-count ${l?`all`:``}`,children:[`· `,s]}),c&&(0,G.jsx)(`span`,{className:`bar ok`,"aria-hidden":`true`,children:(0,G.jsx)(`span`,{style:{width:`${Math.round(100*c.done/c.all)}%`}})})]}),r&&(0,G.jsx)(`div`,{className:`plan-fold-body`,children:n})]})}function nw({ctx:e,item:t}){let[n,r]=(0,v.useState)(``),i=(0,v.useRef)(null);return(0,v.useEffect)(()=>fe(e.project.name,t.id,()=>r(``),e=>r(t=>(t+e).slice(-262144))),[e.project.name,t.id]),(0,v.useEffect)(()=>{i.current?.scrollIntoView({block:`end`})},[n]),t.running_kind===`session`&&t.running?(0,G.jsx)(`div`,{className:`tab-empty`,children:`An interactive session writes no log. It is your own agent session: follow it in your terminal.`}):(0,G.jsxs)(`div`,{className:`log`,"aria-live":`polite`,"aria-relevant":`additions`,children:[(0,G.jsx)(ow,{text:n}),(0,G.jsx)(`div`,{ref:i})]})}function rw({ctx:e,id:t,part:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(``),s=n.item.log;return(0,v.useEffect)(()=>{let n=!0;return(s?H.logPart(e.project.name,t,s.from,s.to):H.file(e.project.name,`.gcf-session/runs/${t}.log`).then(e=>({...e,cut:0}))).then(e=>n&&i(e),e=>n&&o(e.message)),()=>{n=!1}},[e.project.name,t,s]),a?(0,G.jsxs)(`p`,{className:`tab-note error-text`,children:[`✘ `,a]}):r?(0,G.jsxs)(`div`,{className:`log`,children:[r.cut>0&&(0,G.jsxs)(`div`,{className:`tab-note`,children:[`…the first `,r.cut.toLocaleString(`en`),` bytes of this part are cut: 2 MB at most`]}),(0,G.jsx)(ow,{text:r.text})]}):(0,G.jsx)(`p`,{className:`tab-note`,children:`reading…`})}var iw=400;function aw({text:e}){let[t,n]=(0,v.useState)(!1);return t||e.length<=iw?(0,G.jsx)(`span`,{children:e}):(0,G.jsxs)(`span`,{children:[e.slice(0,iw),`…`,` `,(0,G.jsxs)(`button`,{type:`button`,className:`link-btn small`,onClick:()=>n(!0),children:[`all `,e.length,` characters`]})]})}function ow({text:e}){let t=nC(e);return(0,G.jsxs)(G.Fragment,{children:[!t.length&&(0,G.jsx)(`div`,{className:`tab-empty`,children:`no output yet`}),t.map((e,t)=>e.kind===`start`?(0,G.jsxs)(`div`,{className:`log-start`,children:[(0,G.jsxs)(`span`,{children:[`▸ `,rC(e.text),` · `,e.time]}),(0,G.jsx)(`span`,{children:e.text})]},t):e.kind===`summary`?(0,G.jsxs)(`div`,{className:`log-summary`,children:[`■ `,e.time,` `,e.text]},t):(0,G.jsxs)(`div`,{className:`log-line log-${e.kind}`,children:[(0,G.jsx)(`span`,{children:e.time}),(0,G.jsx)(aw,{text:e.text})]},t))]})}function sw({ctx:e,id:t,part:n}){let r=Ox(se(e.project.name,{item:t})),{from:i,to:a}=n.span,[o,s]=[i?Date.parse(i):-1/0,Date.parse(a)],c=r.filter(e=>Date.parse(e.at)>=o&&Date.parse(e.at)<=s),l=(0,v.useRef)(null),u={key:`part-${n.run.ended}`,events:c,talk:null,item:t,send:async()=>{},imageUrl:n=>`/api/p/${encodeURIComponent(e.project.name)}/chat/${t}/att/${n.split(`/`).pop()}`,imagePath:e=>`.gcf-session/runs/${e}`};return(0,G.jsxs)(`div`,{className:`item-chat part`,children:[(0,G.jsxs)(`div`,{className:`c-stream`,role:`log`,ref:l,children:[!c.length&&(0,G.jsx)(`div`,{className:`tab-empty`,children:`No chat event in this run's time.`}),(0,G.jsx)(qx,{ctx:e,part:u})]}),(0,G.jsx)(dC,{stream:l})]})}function cw({ctx:e,item:t,f:n}){let r=Ci(t,n),i=t[n.key],a=n.kind===`ids`||n.key===`parent`?Array.isArray(i)?i:[i]:null;if(!a)return(0,G.jsx)(G.Fragment,{children:r});let o=new Set(e.board.items.map(e=>e.id)),s=new Set((e.board.history??[]).map(e=>e.id)),c=new Set((e.board.graveyard??[]).map(e=>e.id));return(0,G.jsx)(G.Fragment,{children:a.map(t=>o.has(String(t))?(0,G.jsx)(`button`,{className:`link-btn mono`,onClick:()=>e.openItem(String(t)),children:String(t)},String(t)):s.has(String(t))?(0,G.jsxs)(`span`,{className:`fact-ended`,title:`ended: accepted, in history`,children:[String(t),` ✔`]},String(t)):c.has(String(t))?(0,G.jsxs)(`span`,{className:`fact-ended`,title:`ended: in the graveyard`,children:[String(t),` ✝`]},String(t)):(0,G.jsxs)(`span`,{className:`fact-ended`,title:`not on the board: no item has this id`,children:[String(t),` ?`]},String(t)))})}function lw(e){let t=Math.max(0,Math.round((Date.now()-Date.parse(e))/6e4));return Number.isNaN(t)?``:t<60?`${t} min`:t<1440?`${Math.round(t/60)} h`:`${Math.round(t/1440)} d`}function uw({ctx:e,e:t}){let{domain:n}=e.board,r=fi(n,n.sections.inbox?.drop),{title:i,rest:a}=Us(t),[o,s]=(0,v.useState)(!1),c=e.talks.find(e=>e.entry===t.id&&e.title),l=is(e.board.quota),u=async()=>{if(c)return e.go(`chat`,c.id);s(!0);try{let n=await H.draft(e.project.name,t.id);e.reloadTalks(),e.go(`chat`,n.thread)}catch(t){e.notify(t.message,`error`)}s(!1)};return(0,G.jsxs)(`div`,{className:`d-lesson`,children:[(0,G.jsxs)(`span`,{className:`d-lesson-side`,children:[(0,G.jsx)(`span`,{children:t.detail??``}),t.at&&(0,G.jsx)(`span`,{className:`d-lesson-age`,children:lw(t.at)})]}),(0,G.jsxs)(`span`,{className:`d-lesson-main`,children:[(0,G.jsx)(`span`,{className:`d-lesson-text`,children:t.text}),(0,G.jsxs)(`span`,{className:`d-lesson-acts`,children:[n.new_item&&(0,G.jsx)(`button`,{className:`btn`,title:`Opens the new-item form from this lesson; the lesson is erased when the item is created`,onClick:()=>e.newItem({from:t.id,title:i,note:a}),children:`→ Item`}),n.chat&&n.new_item&&(0,G.jsx)(Ls,{size:`sm`,glyph:`draft`,label:`Draft with agent`,off:!c&&!!l,starting:o,hasThread:!!c,tip:c?`Opens its thread ${c.id}; sends nothing`:l?`Off until ${ra(l)}: the usage limit holds`:`Opens a project chat thread on this lesson: the agent proposes an item from it, or says none is needed`,onClick:()=>void(o||u())}),r&&(0,G.jsx)(Po,{label:`Erase`,tip:`Erase the lesson (gcf inbox drop)`,onClick:()=>e.erase(r.cmd,t.id)})]})]})]})}function dw({ctx:e,id:t,waits:n,holds:r}){let i=ro(e.board,t,n),a={item:``,unit:`unit`,grave:`✝`,history:`✔`,unknown:`?`}[i.kind],o=e.board.items.find(e=>e.id===t)?.type;return(0,G.jsxs)(`div`,{className:`dep-line`,title:i.tip,children:[(0,G.jsx)(`span`,{className:`mono dim`,children:i.kind===`item`?(o??``).slice(0,3).toUpperCase():a}),(0,G.jsxs)(`span`,{className:`dep-what`,children:[i.kind===`unit`||i.kind===`unknown`?(0,G.jsx)(`span`,{className:`mono`,children:t}):(0,G.jsx)(`button`,{className:`link-btn mono`,onClick:()=>e.openItem(t),children:t}),(0,G.jsxs)(`span`,{className:`dep-state tone-${i.tone}`,children:[i.state,r?` · waits for this`:``]})]})]})}function fw({ctx:e,item:t}){let{domain:n}=e.board,r=n.fields.find(e=>e.key===`depends`),i=r?.edit&&t.moves.includes(r.edit)?fi(n,r.edit):null,a=io(t),o=ao(t),s=t.waits_for??[],c=(e,t)=>n.fields.find(t=>t.key===e)?.label??t;return(0,G.jsxs)(`section`,{className:`d-deps`,"aria-label":`Dependencies`,children:[(0,G.jsxs)(`div`,{className:`d-deps-head`,children:[(0,G.jsx)(`span`,{children:`Dependencies`}),i&&(0,G.jsx)(`button`,{className:`btn`,disabled:t.running,title:t.running?`Not while it runs`:`Add or remove a dependency: the depends move`,onClick:()=>e.openMove({title:`Dependencies of ${t.id}`,id:t.id,move:i}),children:`Edit…`})]}),(0,G.jsxs)(`div`,{className:`d-deps-cols`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`span`,{className:`d-deps-sub`,title:`Its depends that have not ended in history`,children:[c(`needs`,`needs`),` · `,a.length]}),!a.length&&(0,G.jsx)(`span`,{className:`dim small`,children:`nothing: every dependency has ended`}),a.map(t=>(0,G.jsx)(dw,{ctx:e,id:t,waits:s},t)),a.length>0&&(0,G.jsxs)(`span`,{className:`dim small`,children:[`⧗`,` `,s.length?`the run gate waits for ${s.join(`, `)}`:`none of them holds a run back`]})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`span`,{className:`d-deps-sub`,title:`The items on the board whose depends name it`,children:[c(`needed_by`,`needed by`),` · `,o.length]}),!o.length&&(0,G.jsx)(`span`,{className:`dim small`,children:`no item depends on it`}),o.map(n=>(0,G.jsx)(dw,{ctx:e,id:n,waits:[],holds:e.board.items.find(e=>e.id===n)?.waits_for?.includes(t.id)},n))]})]})]})}var pw=(e,t)=>e.split(/[^a-z0-9-]+/).includes(t),mw={run:[`run`,`an agent run`],thread:[`thread`,`a board chat`],session:[`session`,`your own agent session`],operator:[`operator`,`you: a console or the board`]};function hw({ctx:e,id:t,onPart:n}){let{board:r}=e,i=`${e.project.name}\n${t}`,[a,o]=(0,v.useState)(()=>VC.get(i)?.h??null),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(new Set),d=Aa(r),f=JSON.stringify([r.head,r.items.find(e=>e.id===t)?.running,r.runs?.reports?.length]);if((0,v.useEffect)(()=>{if(!d||VC.get(i)?.stamp===f)return;let n=!0;return H.history(e.project.name,t).then(e=>{VC.set(i,{stamp:f,h:e}),n&&(o(e),c(``))},e=>n&&c(e.message)),()=>{n=!1}},[e.project.name,t,d,f,i]),!d)return(0,G.jsxs)(`div`,{role:`note`,className:`empty-box chat-old`,children:[(0,G.jsxs)(`b`,{children:[`History needs gcf-aif-ext ≥ `,Ta.replace(/\.0$/,``),`: this project has`,` `,Oa(r)??`an older one`,`.`]}),(0,G.jsx)(`code`,{children:`update gcf-aif-ext`})]});if(s)return(0,G.jsxs)(`p`,{className:`tab-note error-text`,children:[`✘ `,s]});if(!a)return(0,G.jsx)(`p`,{className:`tab-note`,children:`reading…`});let p=r.domain.moves;return(0,G.jsxs)(`div`,{className:`history`,children:[(0,G.jsxs)(`section`,{"aria-label":`Its moves`,children:[(0,G.jsx)(`span`,{className:`d-deps-sub`,children:`Its moves · newest first`}),!a.moves.length&&(0,G.jsx)(`span`,{className:`dim small`,children:`no move yet`}),(0,G.jsx)(`ol`,{className:`h-moves`,children:a.moves.map((e,n)=>{let r=p[e.move],i=e.by?mw[e.by]:null,a=l.has(n);return(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`button`,{"aria-expanded":a,title:e.subject,onClick:()=>{let e=new Set(l);a?e.delete(n):e.add(n),u(e)},children:[(0,G.jsx)(`span`,{className:`mono dim`,children:ia(e.at)}),(0,G.jsxs)(`span`,{className:r?`h-move`:`h-move mono`,title:r?`move ${e.move}${r.help?` · ${r.help}`:``}`:`move ${e.move}: the domain has no form for it`,children:[r?.label??e.move,!pw(e.subject,t)&&(0,G.jsxs)(`span`,{className:`dim small`,children:[` · `,e.subject]})]}),(0,G.jsx)(`span`,{className:i?`small`:`dim small`,title:i?i[1]:`A commit older than the framework's marks: who made it is not known`,children:i?i[0]:`unknown`}),(0,G.jsxs)(`span`,{className:`mono small`,children:[a?`▾`:`▸`,` `,e.commit]})]}),a&&(0,G.jsx)(`code`,{className:`h-subject`,children:e.subject})]},`${e.commit}-${n}`)})})]}),(0,G.jsxs)(`section`,{"aria-label":`Its runs`,children:[(0,G.jsx)(`span`,{className:`d-deps-sub`,children:`Its runs`}),ja(r)?a.runs.length?a.runs.map((r,i)=>(0,G.jsx)(SC,{ctx:e,run:r,only:t,list:a.runs,onPart:(e,t)=>n(t)},r.id??`old-${r.ended}-${i}`)):(0,G.jsx)(`span`,{className:`dim small`,children:`no run in the run log`}):(0,G.jsx)(`span`,{className:`dim small`,children:r.domain.harness?`Past runs need gcf-harness-aif-ext ≥ ${Ta.replace(/\.0$/,``)}.`:`No harness: its runs went from a console.`})]})]})}function gw({ctx:e,item:t}){let{board:n}=e,r=t.parent?n.items.find(e=>e.id===t.parent):void 0,i=r?r.children.filter(e=>e!==t.id):t.parent?n.items.filter(e=>e.parent===t.parent&&e.id!==t.id).map(e=>e.id):[],a=n.domain.sections.graveyard?.match,o=a?co(t,a):[],s=o.length?(n.graveyard??[]).filter(e=>e.tags.some(e=>o.includes(e))):[];return(0,G.jsxs)(`div`,{className:`related`,children:[(0,G.jsx)(`section`,{"aria-label":`Siblings`,children:t.parent?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{className:`d-deps-sub`,children:[`Siblings under `,r?.title??t.parent,` · `,i.length,` `,(0,G.jsx)(`button`,{className:`link-btn mono`,onClick:()=>e.openItem(t.parent??``),children:t.parent})]}),i.map(t=>{let r=ro(n,t);return(0,G.jsxs)(`button`,{className:`rel-row`,title:r.tip,onClick:()=>e.openItem(t),children:[(0,G.jsx)(`span`,{className:`mono`,children:t}),(0,G.jsx)(`span`,{className:`badge tone-${r.tone}`,children:r.state})]},t)})]}):(0,G.jsx)(`span`,{className:`dim small`,children:t.children.length?`A feature with no parent: its children are listed above.`:`No parent feature: it has no siblings.`})}),a&&n.domain.sections.graveyard&&(0,G.jsxs)(`section`,{"aria-label":`Graveyard hits`,children:[(0,G.jsxs)(`span`,{className:`d-deps-sub`,children:[`Did we kill this before? Graveyard lines tagged with its `,a,o.length?`: ${o.join(`, `)}`:``]}),!s.length&&(0,G.jsx)(`span`,{className:`dim small`,children:o.length?`No graveyard line holds ${o.join(`, `)}.`:`It has no ${a} to match.`}),s.map((t,n)=>(0,G.jsxs)(`button`,{className:`rel-grave`,onClick:()=>e.openItem(t.id),children:[(0,G.jsxs)(`span`,{className:`rel-grave-line`,children:[t.type&&(0,G.jsx)(`span`,{className:`mono dim`,children:t.type.slice(0,3).toUpperCase()}),(0,G.jsxs)(`span`,{className:`mono strong`,children:[`✝ `,t.id]}),t.tags.map(e=>(0,G.jsxs)(`span`,{className:`mono small ${o.includes(e)?`strong`:`dim`}`,children:[`#`,e]},e))]}),t.reason&&(0,G.jsx)(`span`,{className:`small`,children:t.reason})]},`${t.id}-${n}`))]}),(0,G.jsx)(`span`,{className:`dim small`,children:`Its dependencies are above, under Dependencies.`})]})}function _w({id:e,part:t,onClear:n}){let r=ia(t.run.started??t.run.ended),i=t.item.log,a=t.kind===`log`?i?`The part of the log the run of ${r} wrote: bytes ${i.from.toLocaleString(`en`)}–${i.to.toLocaleString(`en`)}. ${e}'s log holds every run.`:`A run older than log parts (ended ${ia(t.run.ended)}): its whole log.`:`The chat of the run of ${r}.`;return(0,G.jsxs)(`div`,{role:`note`,className:`part-note`,children:[(0,G.jsx)(`span`,{children:a}),(0,G.jsx)(`button`,{className:`icon-btn`,"aria-label":t.kind===`log`?`Show the whole log`:`Show the whole chat`,title:`Back to the whole log and chat`,onClick:n,children:`×`})]})}function vw({ctx:e,id:t,part:n,onClose:r}){let[i,a]=(0,v.useState)(n??null),[o,s]=(0,v.useState)(`history`),c=IC(),{board:l}=e,u=l.history?.find(e=>e.id===t),d=l.graveyard?.find(e=>e.id===t),f=l.domain.sections,p=f.lessons?Ms(l.inbox??[],t):null,m=e=>{s(e),a(null)},h=o===`status`&&!i;return(0,G.jsxs)(`aside`,{className:`drawer`,"aria-label":`Item ${t}`,...c,children:[(0,G.jsx)(`div`,{className:`d-head`,children:(0,G.jsxs)(`div`,{className:`d-top`,children:[(0,G.jsx)(`button`,{className:`d-back`,"aria-label":`Back`,onClick:r,children:`‹`}),(0,G.jsxs)(`div`,{className:`d-name`,children:[(0,G.jsxs)(`div`,{className:`d-meta d-grab`,title:`Drag to move the window`,children:[(0,G.jsx)(`span`,{className:d?`error-text`:`ok-text`,children:d?f.graveyard?.label??`graveyard`:f.history?.label??`history`}),d?.type&&(0,G.jsx)(`span`,{className:`d-dot`,children:d.type})]}),(0,G.jsxs)(`h2`,{children:[(0,G.jsx)(`span`,{className:`d-id`,children:t}),(0,G.jsx)(LC,{id:t,ctx:e})]})]}),(0,G.jsx)(`button`,{className:`icon-btn bordered d-close`,"aria-label":`Close`,onClick:r,children:`×`})]})}),(0,G.jsxs)(`div`,{role:`tablist`,className:`d-tabs`,children:[(0,G.jsx)(`button`,{role:`tab`,"aria-selected":h,onClick:()=>m(`status`),children:`Status`}),(0,G.jsx)(`button`,{role:`tab`,"aria-selected":o===`history`&&!i,onClick:()=>m(`history`),children:`History`}),p&&(0,G.jsxs)(`button`,{role:`tab`,"aria-selected":o===`lessons`&&!i,onClick:()=>m(`lessons`),children:[`Lessons (`,p.length,`)`]}),i&&(0,G.jsx)(`button`,{role:`tab`,"aria-selected":!0,children:i.kind===`log`?`Log`:`Chat`})]}),(0,G.jsx)(`div`,{className:`d-body`,children:(0,G.jsxs)(`div`,{role:`tabpanel`,className:`d-panel`,children:[h&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`dl`,{className:`facts`,children:d?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`reason`}),(0,G.jsx)(`dd`,{children:d.reason??`—`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`tags`}),(0,G.jsx)(`dd`,{className:`mono`,children:d.tags.map(e=>`#${e}`).join(` `)||`—`})]})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`event`}),(0,G.jsx)(`dd`,{children:u?.event??`—`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`date`}),(0,G.jsx)(`dd`,{children:u?.date??`—`})]})]})}),(0,G.jsxs)(`p`,{className:`d-ended dim small`,children:[d?`It ended in the graveyard`:`It ended in history`,`; it keeps its History.`]})]}),o===`history`&&!i&&(0,G.jsx)(hw,{ctx:e,id:t,onPart:a}),o===`lessons`&&p&&!i&&(0,G.jsxs)(`div`,{className:`d-lessons`,children:[!p.length&&(0,G.jsx)(`span`,{className:`d-lessons-none`,children:`No lesson from its sessions in the Inbox: none came, or each is sorted.`}),p.map(t=>(0,G.jsx)(uw,{ctx:e,e:t},t.id))]}),i&&(0,G.jsx)(_w,{id:t,part:i,onClear:()=>a(null)}),i?.kind===`log`&&(0,G.jsx)(rw,{ctx:e,id:t,part:i}),i?.kind===`chat`&&(0,G.jsx)(sw,{ctx:e,id:t,part:i})]})})]})}function yw(e){let t=(0,v.useRef)(!1);return(0,v.useEffect)(()=>{if(!t.current)return;t.current=!1;let n=document.activeElement;n&&n!==document.body||e()?.focus()}),(0,v.useCallback)(e=>{if(e)return()=>{e===document.activeElement&&(t.current=!0)}},[])}function bw({ctx:e,item:t,tab:n,part:r,onClose:i}){let a=OC(),[o,s]=(0,v.useState)(EC.includes(n)?n:a&&(a!==`lessons`||e.board.domain.sections.lessons)?a:t.blocked||t.waits_for?.length?`status`:t.running&&t.running_kind!==`session`?`chat`:`file`),[c,l]=(0,v.useState)(r??null),u=c&&c.kind===o?c:null,[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(!1),_=t.running&&!t.starting,y=e.board.runs?.queued.includes(t.id)??!1,b=e.board.runs?.active.some(e=>e.ids.includes(t.id))??!1,x=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(!h)return void(x.current=!1);if(b&&(x.current=!0),_||y||x.current&&!b)return g(!1);let e=setTimeout(()=>g(!1),PC);return()=>clearTimeout(e)},[h,_,y,b]);let S=p!==null||h||!!t.starting,C=(0,v.useRef)(null),w=yw(()=>C.current?.querySelector(`button:not(:disabled)`)),T=async n=>{await e.run([t.id],n)&&g(!0)},E=(0,v.useRef)(!1),D=CS(E,async()=>{m(`gate`);try{if(!await ie())return;m(`run`),await T(!1)}finally{m(null)}}),O=CS(E,async()=>{m(`fresh`);try{let n=await V();await ke(`This drops the agent's context; its files are kept.`,`Start fresh`,!0,{title:`Start ${t.id} fresh?`,warn:n.length?{...re(n),head:`It runs on main, among loose work`}:void 0,other:Ha(e,n)??void 0})&&await T(!0)}finally{m(null)}}),k=CS(E,async()=>{m(`allow`);try{await Yb(e,t)&&g(!0)}finally{m(null)}}),A=IC(),j=CC(HC(e,t.tune_count?t.file:null,String(t.tune_count))),{domain:M}=e.board,N=M.sections.lessons?Ms(e.board.inbox??[],t.id):[],P=pi(t,M),F=gi(t,M),I=_i(t,M),L=fa(t),ee=t.running?{label:`running`,help:`An agent session works on it; its status: ${t.status}`}:M.columns.find(e=>e.status===t.status),te=$a(t,e.board),ne=typeof t.blocked==`string`&&t.blocked?t.blocked:null,R=t.waits_for??[],z=Ia(e,I&&!y&&!t.running?[t.id]:null),B=z.refused[t.id]??null,V=async()=>Fe(e.board,t.id)===`main`?z.dirty??await H.gate(e.project.name,[t.id]).then(e=>e.dirty??[],()=>[]):[],re=e=>({head:`Loose work in the project folder`,text:La(e)}),ie=async()=>{let n=await V();return!n.length||ke(`${t.id} runs on main, in the project folder. A warning, not a refusal: you judge.`,`Run anyway`,!1,{title:`Run ${t.id} here anyway?`,warn:re(n),other:Ha(e,n)??void 0})},ae=t.plan&&!(`error`in t.plan)?t.plan:null,se=e=>({...Object.fromEntries(e.fields.filter(e=>e.presets).map(e=>[e.key,`default`])),...Object.fromEntries(M.fields.filter(n=>n.edit===e.cmd&&typeof t[n.key]==`string`).map(e=>[e.key,t[e.key]]))}),U=n=>e.openMove({title:`${n.label} ${t.id}`,id:t.id,move:n,values:se(n)}),W=e=>e.edit&&t.moves.includes(e.edit)?fi(M,e.edit):null,ce=n=>Ci(t,n)===null&&(n.key===`model`||n.key===`effort`)?e.board.agent?.[n.key]??null:null,le=M.fields.filter(e=>e.key===`model`||e.key===`effort`),ue=n=>ga(Ci(t,n)??ce(n)??ba(e.board,n.key)??`default`),de=e=>`${e.label}: ${Ci(t,e)===null?ce(e)===null?`nothing set: the default holds`:`the project's (Settings, agent.*)`:`its own`}`,fe=le[0]&&!t.running?W(le[0]):null,pe=AC.map(e=>M.fields.find(t=>t.key===e)).filter(e=>!!e&&Ci(t,e)!==null),me=M.fields.filter(n=>n.key!==`blocked`&&!(AC.includes(n.key)&&!W(n))&&!(zC(e)?RC.has(n.key):n.key===`waits_for`)&&(le.includes(n)?n===le[0]:Ci(t,n)!==null)),he=[t.running?ta(t):null,L?da(L,t.resume?.reserve):null,t.shelved&&!t.running?ca(t.shelved):null,t.resumable&&!t.running?sa(t):null,y?`queued`:null,t.verified?`✔ verified`:null].filter(Boolean);return(0,G.jsxs)(`aside`,{className:`drawer`,"aria-label":`Item ${t.id}`,...A,children:[(0,G.jsxs)(`div`,{className:`d-head`,children:[(0,G.jsxs)(`div`,{className:`d-top`,children:[(0,G.jsx)(`button`,{className:`d-back`,"aria-label":`Back`,onClick:i,children:`‹`}),(0,G.jsxs)(`div`,{className:`d-name`,children:[(0,G.jsxs)(`div`,{className:`d-meta d-grab`,title:MC.matches?void 0:`Drag to move the window`,children:[te?(0,G.jsxs)(`span`,{className:`d-needs`,title:`status: ${ee?.label??t.status} · ${ee?.help??``} Only you can move it on.`,children:[`● `,ee?.label??t.status]}):(0,G.jsx)(`span`,{className:`d-status`,title:`status: ${ee?.label??t.status}${ee?.help?` · ${ee.help}`:``}`,children:ee?.label??t.status}),pe.map(e=>(0,G.jsx)(`span`,{className:`d-dot ${e.key===`gate`?`gate-text gate-${t.gate}`:``}`,title:`${e.label}: ${Ci(t,e)}${e.help?` · ${e.help}`:``}`,children:Ci(t,e)},e.key)),he.map(e=>(0,G.jsx)(`span`,{className:`d-state d-dot`,title:/^(limit|reserve):/.test(e)?ua:e.startsWith(`paused`)||e===`interrupted`?oa(t):void 0,children:e},e)),L&&(0,G.jsx)(ma,{ctx:e,of:{id:t.id}}),t.running&&t.running_kind!==`session`&&t.active_at&&!L&&(0,G.jsx)(Vi,{at:t.active_at})]}),(0,G.jsxs)(`h2`,{children:[(0,G.jsx)(`span`,{className:`d-id`,children:t.id}),t.title&&(0,G.jsxs)(`span`,{className:`d-title`,children:[`(`,t.title,`)`]}),(0,G.jsx)(LC,{id:t.id,ctx:e})]})]}),(0,G.jsx)(`button`,{className:`icon-btn bordered d-close`,"aria-label":`Close`,onClick:i,children:`×`})]}),(0,G.jsxs)(`div`,{className:`d-acts`,ref:C,children:[t.running&&t.running_kind===`session`&&(0,G.jsx)(`button`,{className:`btn`,title:`A session's mark makes it running; your own session goes on`,onClick:async()=>{await ke(`Release the session mark on ${t.id}?`,`Release mark`)&&e.move({cmd:`release`,id:t.id})},children:`Release mark`}),_&&t.running_kind!==`session`&&(0,G.jsx)(`button`,{className:`btn-danger`,title:L?`Ends the wait for the reset: it becomes paused: limit, and Run resumes it later`:`Stops the agent session; the item stays ready and its work is kept`,onClick:()=>void Ja(e,t),children:`Stop`}),_&&t.running_kind!==`session`&&(0,G.jsx)(`button`,{className:`btn`,title:`Hold: the session hands over at its next step and the card waits, ready; Run goes on from where it stopped`,onClick:()=>void e.hold(t.id),children:`Hold`}),y&&(0,G.jsx)(`button`,{className:`btn`,title:`Takes it out of the run queue; it asks nothing`,onClick:()=>void e.unqueue(t.id),children:`Remove from queue`}),I&&!y&&!_&&(0,G.jsx)(`button`,{className:`btn-primary`,ref:w,onClick:()=>S||void D(),disabled:B!==null,"aria-disabled":S||void 0,"aria-busy":p===`gate`||p===`run`||h||t.starting,title:B?`The run gate refuses it now: ${B}`:t.resumable?`Goes on from where its last run stopped`:F?.help??`Starts at once: you named this item. The run gate may still refuse; the run report says why.`,children:p===`gate`?`Asking the gate…`:p===`run`||h||t.starting?`Starting…`:t.resumable?`Resume`:F?.label??`Run`}),I&&!y&&!t.running&&t.resume&&t.resume.ended!==`handoff`&&(0,G.jsx)(`button`,{className:`btn`,ref:w,disabled:B!==null,"aria-disabled":S||void 0,"aria-busy":p===`fresh`,title:B?`The run gate refuses it now: ${B}`:`A new agent session: the kept one, and what it knew, is dropped`,onClick:()=>S||void O(),children:p===`fresh`?`Asking the gate…`:`Start fresh`}),!t.running&&P.filter(e=>!e.rare).map(e=>(0,G.jsx)(`button`,{className:hi(e),title:e.help,disabled:S,onClick:()=>U(e),children:e.label},e.cmd)),P.some(e=>e.rare)&&(0,G.jsxs)(`button`,{className:`btn-line`,"aria-expanded":d,onClick:()=>f(!d),children:[d?`▾`:`▸`,` More`]}),d&&P.filter(e=>e.rare).map(e=>(0,G.jsx)(`button`,{className:hi(e),title:e.help,disabled:S,onClick:()=>U(e),children:e.label},e.cmd))]})]}),(0,G.jsx)(`div`,{role:`tablist`,className:`d-tabs`,children:EC.filter(e=>e!==`lessons`||M.sections.lessons).map(e=>(0,G.jsxs)(`button`,{role:`tab`,"aria-selected":e===o,onClick:()=>{s(e),kC(e)},children:[e[0].toUpperCase()+e.slice(1),e===`lessons`?` (${N.length})`:``]},e))}),(0,G.jsx)(`div`,{className:`d-body`,children:(0,G.jsxs)(`div`,{role:`tabpanel`,className:`d-panel ${o===`chat`&&!u?`chat`:``}`,children:[o===`status`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(rl,{ctx:e,id:t.id}),t.run_end&&!t.running&&(0,G.jsx)(hS,{ctx:e,id:t.id,end:t.run_end,play:!1,allow:!1}),j.length>0&&(0,G.jsxs)(`div`,{role:`note`,"aria-label":`Tuning notes`,className:`d-shelf`,children:[(0,G.jsx)(`span`,{children:`♪ Tuning notes`}),(0,G.jsx)(`ul`,{className:`d-tuning`,children:j.map((e,t)=>(0,G.jsx)(`li`,{children:e},t))})]}),t.shelved&&!t.running&&(0,G.jsxs)(`div`,{role:`note`,className:`d-shelf`,children:[(0,G.jsx)(`span`,{children:`⇢ Shelved`}),(0,G.jsx)(`span`,{children:la(t.id,t.shelved)})]}),ne&&(0,G.jsxs)(`div`,{role:`note`,className:`d-blocked`,children:[(0,G.jsx)(`span`,{children:`! Blocked`}),(0,G.jsx)(`span`,{children:ne}),t.denied_rule&&(0,G.jsxs)(`div`,{className:`d-allow`,children:[(0,G.jsx)(`button`,{className:`btn-primary`,ref:w,"aria-disabled":S||void 0,"aria-busy":p===`allow`,title:`Three steps in one: the rule ${t.denied_rule.rule} off for this item's next run only, the unblock, the run`,onClick:()=>S||void k(),children:p===`allow`?`Allowing…`:`Allow ${t.denied_rule.rule} for one run`}),(0,G.jsxs)(`span`,{className:`dim small`,children:[t.denied_rule.group?`the group ${t.denied_rule.group} stays on for other runs`:`your rule stays for other runs`,`; or do it by hand, then Unblock`]})]})]}),B?(0,G.jsxs)(`div`,{className:`d-waits`,children:[`⧗ the run gate refuses it now: `,(0,G.jsx)(Ce,{text:B,named:R})]}):R.length>0&&(0,G.jsxs)(`div`,{className:`d-waits`,children:[`⧗ waits for `,(0,G.jsx)(Ce,{text:R.join(`, `),named:R}),` — the run gate would refuse it now`]}),t.running&&ae&&(0,G.jsxs)(`div`,{className:`d-run`,children:[(0,G.jsx)(`div`,{className:`d-run-head`,children:`This run`}),(0,G.jsxs)(`div`,{className:`live-plan`,title:`Plan checkboxes done / total`,children:[(0,G.jsx)(`span`,{children:`tasks`}),(0,G.jsx)(`span`,{className:`bar`,"aria-hidden":`true`,children:(0,G.jsx)(`span`,{style:{width:`${Math.round(100*ae.done/Math.max(1,ae.tasks))}%`}})}),(0,G.jsxs)(`span`,{className:`mono`,children:[ae.done,` of `,ae.tasks]})]})]}),(0,G.jsxs)(`dl`,{className:`facts`,children:[me.map(n=>n===le[0]?(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:le.map(e=>e.label).join(` / `)}),(0,G.jsxs)(`dd`,{title:le.map(de).join(` · `),children:[le.map(ue).join(` / `),fe&&(0,G.jsx)(`button`,{className:`link-btn`,title:fe.help,onClick:()=>U(fe),children:`change`})]})]},n.key):(0,G.jsxs)(`div`,{title:n.help,children:[(0,G.jsx)(`dt`,{children:n.label}),(0,G.jsxs)(`dd`,{title:wi(n,Ci(t,n)??``),children:[(0,G.jsx)(cw,{ctx:e,item:t,f:n}),W(n)&&(0,G.jsx)(`button`,{className:`link-btn`,title:W(n)?.help,onClick:()=>U(W(n)),children:`change`})]})]},n.key)),t.since&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`waits since`}),(0,G.jsxs)(`dd`,{title:t.since,children:[t.since_at?`${na(t.since_at)} · `:``,(0,G.jsx)(`span`,{className:`mono`,children:t.since.slice(0,7)})]})]})]}),zC(e)&&(0,G.jsx)(fw,{ctx:e,item:t}),(t.attachments??[]).length>0&&(0,G.jsx)(`div`,{className:`entry-atts`,role:`group`,"aria-label":`Attachments`,children:(t.attachments??[]).map(t=>(0,G.jsxs)(`a`,{className:`entry-att`,title:t,href:oe(e.project.name,t),target:`_blank`,rel:`noreferrer`,children:[`▣ `,t.split(`/`).pop()]},t))})]}),o===`lessons`&&(0,G.jsxs)(`div`,{className:`d-lessons`,children:[!N.length&&(0,G.jsx)(`span`,{className:`d-lessons-none`,children:`No lesson from its sessions yet.`}),N.map(t=>(0,G.jsx)(uw,{ctx:e,e:t},t.id))]}),u&&(0,G.jsx)(_w,{id:t.id,part:u,onClear:()=>l(null)}),o===`chat`&&(u?(0,G.jsx)(sw,{ctx:e,id:t.id,part:u}):(0,G.jsx)(pC,{ctx:e,item:t})),o===`file`&&(0,G.jsx)(WC,{ctx:e,item:t}),o===`plan`&&(0,G.jsx)(GC,{ctx:e,item:t}),o===`log`&&(u?(0,G.jsx)(rw,{ctx:e,id:t.id,part:u}):(0,G.jsx)(nw,{ctx:e,item:t})),o===`history`&&(0,G.jsx)(hw,{ctx:e,id:t.id,onPart:e=>{l(e),s(e.kind)}}),o===`related`&&(0,G.jsx)(gw,{ctx:e,item:t})]})})]})}function xw({ctx:e}){let{history:t=[],graveyard:n=[]}=e.board,{sections:r}=e.board.domain;return(0,G.jsxs)(`section`,{className:`page ended`,"aria-label":`Ended`,children:[r.history&&(0,G.jsxs)(`section`,{"aria-label":r.history.label??`History`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[r.history.label??`History`,(0,G.jsx)(`span`,{className:`dim`,children:t.length}),(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),!t.length&&(0,G.jsx)(`p`,{className:`dim small`,children:`Nothing ended yet.`}),t.length>0&&(0,G.jsx)(`div`,{className:`ended-list`,children:[...t].reverse().map((t,n)=>(0,G.jsxs)(`button`,{className:`ended-row`,title:`Open its History`,onClick:()=>e.openItem(t.id),children:[(0,G.jsx)(`span`,{className:`mono`,children:t.id}),(0,G.jsx)(`span`,{className:`ok-text small`,title:`What ended it`,children:t.event}),(0,G.jsx)(`span`,{className:`mono dim small`,children:t.date})]},`${t.id}-${n}`))})]}),r.graveyard&&(0,G.jsxs)(`section`,{"aria-label":r.graveyard.label??`Graveyard`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[r.graveyard.label??`Graveyard`,(0,G.jsx)(`span`,{className:`dim`,children:n.length}),(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),!n.length&&(0,G.jsx)(`p`,{className:`dim small`,children:`Nothing was killed or dropped.`}),[...n].reverse().map((t,n)=>(0,G.jsxs)(`button`,{className:`grave-row`,title:`Open its History`,onClick:()=>e.openItem(t.id),children:[(0,G.jsxs)(`div`,{className:`grave-line`,children:[t.type&&(0,G.jsx)(`span`,{className:`mono dim small`,title:t.type,children:t.type.slice(0,3).toUpperCase()}),(0,G.jsx)(`span`,{className:`mono grave-id`,children:t.id}),t.tags.map(e=>(0,G.jsxs)(`span`,{className:`mono small entry-tag`,children:[`#`,e]},e))]}),t.reason&&(0,G.jsx)(`p`,{children:t.reason})]},`${t.id}-${n}`))]})]})}var Sw=60;function Cw(e,t){let n=[...e.items].filter(e=>e.id!==t).sort((e,t)=>Number(e.priority===null)-Number(t.priority===null)||(e.priority??0)-(t.priority??0)).map(t=>({id:t.id,title:t.title??``,kind:t.type.slice(0,3).toUpperCase(),state:no(e,t),tone:t.running?`running`:t.status})),r=(e.units??[]).map(e=>({id:e.id,title:e.title??``,kind:`unit`,state:to(e),tone:e.ready?`ok`:`warn`}));return[...n,...r]}function ww({board:e,value:t,self:n,onChange:r,inputId:i,folded:a=!1}){let[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!a),u=o.trim().toLowerCase(),d=Cw(e,n),f=d.filter(e=>!u||e.id.includes(u)||e.title.toLowerCase().includes(u)),p=f.slice(0,u?40:Sw),m=e=>{r(t.includes(e)?t.filter(t=>t!==e):[...t,e]),s(``)},h=e=>d.find(t=>t.id===e)?.title;return(0,G.jsxs)(`div`,{className:`picker`,children:[(0,G.jsxs)(`div`,{className:`picker-chips`,children:[!t.length&&(0,G.jsx)(`span`,{className:`dim small`,children:`no dependency`}),t.map(t=>{let r=ro(e,t),i=t===n||r.kind===`unknown`||r.kind===`grave`,a=t===n?`itself`:r.state,o=h(t);return(0,G.jsxs)(`span`,{className:`picker-chip ${i?`bad`:``}`,title:a,children:[o?`${Ti(o,48)} (${t})`:t,(0,G.jsx)(`span`,{className:`dim`,children:a}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`Take ${o||t} out`,onClick:()=>m(t),children:`×`})]},t)}),(0,G.jsx)(`button`,{type:`button`,className:`picker-fold`,"aria-expanded":c,title:c?`Fold the list; the picked ones stay`:`Open the list of items and design units`,onClick:()=>l(!c),children:c?`▾ Hide the list`:`▸ Pick by title`})]}),c&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`input`,{id:i,className:`input`,value:o,"aria-label":`Search items and design units`,placeholder:`search items and design units by title`,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),p.length===1&&m(p[0].id))}}),(0,G.jsxs)(`div`,{role:`listbox`,"aria-multiselectable":!0,"aria-label":`Items and design units`,className:`picker-list`,children:[p.map(e=>{let n=t.includes(e.id);return(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n,className:`picker-row`,onClick:()=>m(e.id),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:n?`☑`:`☐`}),(0,G.jsx)(`span`,{className:`mono dim`,children:e.kind}),(0,G.jsxs)(`span`,{className:`picker-label`,children:[e.title||e.id,` `,e.title&&(0,G.jsxs)(`span`,{className:`mono dim`,children:[`(`,e.id,`)`]})]}),(0,G.jsx)(`span`,{className:`picker-state tone-${e.tone}`,children:e.state})]},`${e.kind}:${e.id}`)}),!p.length&&(0,G.jsx)(`span`,{className:`dim small`,children:`nothing matches`}),f.length>p.length&&(0,G.jsxs)(`span`,{className:`dim small`,children:[f.length-p.length,` more: type to narrow`]})]}),(0,G.jsxs)(`span`,{className:`dim small`,children:[t.length,` `,t.length===1?`dependency`:`dependencies`]})]})]})}function Tw({ctx:e,id:t,current:n,open:r,onClose:i}){let{move:a,values:o={}}=r,[s,c]=(0,v.useState)(()=>[...new Set([...n,...yi(o.add)].filter(e=>!yi(o.remove).includes(e)))]),[l,u]=(0,v.useState)(!1),d=s.filter(e=>!n.includes(e)),f=n.filter(e=>!s.includes(e)),p=d.length>0||f.length>0;return(0,G.jsx)(De,{onClose:i,dirty:p,children:(0,G.jsxs)(`form`,{className:`dialog wide`,role:`dialog`,"aria-modal":!0,"aria-label":`Dependencies of ${t}`,onClick:e=>e.stopPropagation(),onSubmit:async n=>{n.preventDefault();let[s,c]=!p&&r.extra?[yi(o.add),yi(o.remove)]:[d,f];if(!s.length&&!c.length)return i();u(!0);let l=await e.move({cmd:a.cmd,id:t,...s.length?{add:s}:{},...c.length?{remove:c}:{},...r.extra});u(!1),l&&i()},children:[(0,G.jsxs)(`h2`,{children:[`Dependencies of `,t]}),(0,G.jsxs)(`p`,{className:`dialog-body`,children:[r.body?`${r.body} `:a.help?`${a.help}. `:``,`Tick what it waits for, untick what it no longer does. The framework refuses the item itself, a graveyard line and a cycle.`]}),(0,G.jsx)(ww,{board:e.board,value:s,self:t,onChange:c}),(0,G.jsxs)(`div`,{className:`dialog-actions`,children:[(0,G.jsx)(`button`,{type:`button`,className:`btn-line`,onClick:i,disabled:l,children:`Cancel`}),(0,G.jsx)(`button`,{type:`submit`,className:`btn-primary`,disabled:l,children:l?`Committing…`:`Save`})]})]})})}var Ew={tags:[`tags`,`short words, comma-separated`],list:[`one per line`,`a list: one entry per line`],slug:[`slug`,`lowercase letters, digits and hyphens`]},Dw=[{value:``,label:`By the rule (default)`,help:`the command's own rule: a removal item when the item's code is in main`},{value:`yes`,label:`Yes, its code is in main`,help:`a new item deletes its code from the main build`},{value:`no`,label:`No`,help:`no removal item`}],Ow=`The phase's exit gate reads it: milestone-done closes the phase when nothing open of its milestone is left`,kw=(e,t)=>t.from===`milestones`?Jr(e)?.milestones??null:null,Aw={you:`you`,agent:`an agent`,automation:`automation`};function jw({id:e,rows:t,value:n,onChange:r}){return(0,G.jsx)(`select`,{id:e,className:`input`,value:n,onChange:e=>r(e.target.value),children:t.map(e=>(0,G.jsx)(`option`,{value:e.value,children:e.label},e.value))})}function Mw({id:e,board:t,value:n,onChange:r}){let[i,a]=(0,v.useState)(``),o=Di(t),s=yi(n),c=i.trim().toLowerCase(),l=o.filter(e=>!s.includes(e)&&(!c||e.includes(c))).slice(0,14),u=c!==``&&!o.includes(c)&&!s.includes(c),d=u&&Ei.test(c),f=(e,t)=>{r((t?[...s,e]:s.filter(t=>t!==e)).join(`, `)),t&&a(``)};return(0,G.jsxs)(`div`,{className:`picker`,children:[(0,G.jsxs)(`div`,{className:`picker-chips`,children:[s.map(e=>(0,G.jsxs)(`span`,{className:`picker-chip mono`,children:[e,!o.includes(e)&&(0,G.jsx)(`span`,{className:`f-new`,children:`new`}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`Take ${e} out`,onClick:()=>f(e,!1),children:`×`})]},e)),!s.length&&(0,G.jsx)(`span`,{className:`dim small`,children:`no subsystem`})]}),(0,G.jsx)(`input`,{id:e,className:`input mono f-search`,value:i,"aria-label":`Subsystems`,placeholder:`search the known subsystems, or type a new slug`,onChange:e=>a(e.target.value),onKeyDown:e=>{(e.key===`Enter`||e.key===`,`)&&(e.preventDefault(),d?f(c,!0):l.length===1&&f(l[0],!0))}}),(0,G.jsxs)(`div`,{className:`f-sugg`,children:[d&&(0,G.jsxs)(`button`,{type:`button`,className:`new`,onClick:()=>f(c,!0),children:[`+ new subsystem “`,c,`”`]}),l.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>f(e,!0),children:[`+ `,e]},e))]}),u&&!d&&(0,G.jsx)(`span`,{role:`alert`,className:`f-warn`,children:`a new subsystem is a slug: lowercase letters, digits and hyphens`})]})}function Nw({field:e,options:t,value:n,onChange:r}){return(0,G.jsx)(`div`,{role:`radiogroup`,"aria-label":e.label,className:`f-choice ${t.length>4?`wrap`:``}`,children:t.map(e=>(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n===e.value,title:e.help,onClick:()=>r(e.value),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:n===e.value?`●`:`○`}),(0,G.jsxs)(`span`,{children:[e.label||e.value||`—`,e.help&&(0,G.jsx)(`small`,{children:e.help})]})]},e.value))})}function Pw({id:e,field:t,value:n,onChange:r,presets:i,board:a,self:o,newItem:s,details:c}){if(t.kind===`file`)return(0,G.jsx)(Iw,{id:e,value:n,onChange:r});let l=Array.isArray(n)?n.join(`
108
- `):String(n??``);if(t.kind===`ids`&&t.single)return(0,G.jsx)(jw,{id:e,rows:ki(a,t,l),value:l,onChange:r});if(t.kind===`ids`)return(0,G.jsx)(ww,{board:a,inputId:e,value:yi(l),self:o,folded:s,onChange:e=>r(e.join(`, `))});if(s&&t.key===`system`)return(0,G.jsx)(Mw,{id:e,board:a,value:l,onChange:r});if(c)return(0,G.jsx)(Nw,{field:t,options:[{value:``,label:`no detail`},...c.map(e=>({value:e,label:e}))],value:l,onChange:r});if(t.presets)return(0,G.jsx)(Ca,{id:e,what:t.presets,presets:i?.[t.presets]??[],value:l,project:ya(a,t.presets),fallback:ba(a,t.presets),onChange:r});let u=kw(a,t);if(u)return(0,G.jsx)(jw,{id:e,rows:Oi(u,l),value:l,onChange:r});let d=[`slug`,`ids`,`tags`].includes(t.kind)?`mono`:``;if(t.kind===`remove`)return(0,G.jsx)(Nw,{field:t,options:Dw,value:n===!0?`yes`:n===!1?`no`:``,onChange:e=>r(e===`yes`||e!==`no`&&void 0)});if(t.kind===`choice`){let e=t.options??[];return(0,G.jsx)(Nw,{field:t,options:e,value:l,onChange:r})}let f=t.kind===`tags`?yi(l).map(e=>({label:`#${e}`,tip:`tag`})):[];return(0,G.jsxs)(G.Fragment,{children:[t.kind===`longtext`||t.kind===`list`?(0,G.jsx)(`textarea`,{id:e,className:`input`,value:l,required:t.required,rows:t.kind===`longtext`?4:3,placeholder:t.kind===`list`?`one per line`:void 0,onChange:e=>r(t.kind===`list`?e.target.value.split(`
109
- `):e.target.value)}):(0,G.jsx)(`input`,{id:e,className:`input ${d}`,value:l,required:t.required,list:t.kind===`text`&&t.key===`id`?`move-form-ids`:void 0,pattern:t.kind===`slug`?`[a-z0-9]+(-[a-z0-9]+)*`:void 0,placeholder:t.kind===`tags`?`feel, touch`:t.kind===`slug`?`win-feedback`:void 0,onChange:e=>r(e.target.value)}),f.length>0&&(0,G.jsx)(`div`,{className:`f-chips`,children:f.map((e,t)=>(0,G.jsx)(`span`,{title:e.tip,children:e.label},t))})]})}var Fw=10485760;function Iw({id:e,value:t,onChange:n}){let[r,i]=(0,v.useState)(``),a=typeof t==`string`?t.split(/[\\/]/).pop():t?.name;return(0,G.jsxs)(`div`,{className:`f-file`,children:[(0,G.jsxs)(`label`,{className:`f-file-btn`,children:[(0,G.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:`M20 11.5l-8.2 8.2a5 5 0 0 1-7.1-7.1l8.6-8.6a3.4 3.4 0 0 1 4.8 4.8l-8.6 8.6a1.7 1.7 0 0 1-2.4-2.4l7.9-7.9`})}),a?`Another file…`:`Choose a file…`,(0,G.jsx)(`input`,{id:e,type:`file`,onChange:async e=>{let t=e.target.files?.[0];if(e.target.value=``,t){if(t.size>Fw)return i(`${t.name}: over 10 MB, the most an attachment takes`);i(``),n({name:t.name,data:await xi(t)})}}})]}),(0,G.jsx)(`span`,{className:`f-file-name ${a?`mono`:`dim`}`,title:a,children:a??`no file yet`}),r&&(0,G.jsx)(`span`,{className:`f-err`,children:r})]})}var Lw=e=>(Array.isArray(e)?e.join(`
110
- `):String(e??``)).trim();function Rw(e){return e.open.move.preview?(0,G.jsx)(kb,{...e}):(0,G.jsx)(zw,{...e})}function zw({ctx:e,open:t,onClose:n}){let{move:r}=t,{domain:i}=e.board,a=(0,v.useId)(),o=r.cmd===i.new_item,s=o&&r.fields.some(e=>e.key===`blocked`),c=i.sections.inbox,l=r.cmd===c?.category?(e.board.inbox??[]).find(e=>e.id===t.id):void 0,[u]=(0,v.useState)(()=>Si(r.fields,l?{category:l.category,detail:l.detail??``,...t.values}:t.values)),[d,f]=(0,v.useState)(u),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(void 0),[S,C]=(0,v.useState)(()=>Lw(u.blocked)?!0:null),w=S??d.type===`asset`,T=e=>c?.categories?.find(t=>t.id===e),E=l?T(d.category):void 0,D=(e,t)=>{g(``),y(!1),x(void 0),f(l&&e===`category`?{...d,category:t,detail:t===l.category?l.detail??``:``}:{...d,[e]:t})},O=t.body??(l?`${r.help?`${r.help}. `:``}Now ${T(l.category)?.label??l.category}${l.detail?` · ${l.detail}`:``}, from ${Aw[l.origin]??l.origin}${l.item?` on ${l.item}`:``}: the origin stays.${E&&!E.later&&l.later?` ${E.label} never waits in Later: it leaves Later.`:``}`:o?Lw(u.from)?`From ${Lw(u.from)}: its first line is the title, the rest the note. The entry is erased when the item is created.`:`Created and committed at once. Its id comes from the title.`:r.help),k=new Map(e.board.items.map(e=>[e.id,e.running?`running`:e.status])),A=t.id?e.board.items.find(e=>e.id===t.id):void 0,j=r.fields.some(e=>e.required&&vi(e,d)&&(e.kind===`choice`&&!Lw(d[e.key])||e.kind===`file`&&d[e.key]===void 0)),M=async i=>{i.preventDefault(),x(void 0);let a=bi(r.fields,d);if(s&&!w)delete a.blocked;else if(s&&!Lw(d.blocked))return g(`Start blocked: say what it waits for`);m(!0);let o=await e.moveIn({cmd:r.cmd,id:t.id,...a,...t.extra});m(!1),o.ok?n():(g(o.err),y(o.refused),x(o.refusal))},N=t=>{if(kw(e.board,t))return Ow;if(t.kind===`ids`&&t.single)return`one live ${(t.of??[`item`]).join(` or `)}, by its title`;if(E?.details&&t.key===`detail`)return`${E.label} takes one of its own details`;if(o&&t.key===`system`||s&&t.key===`blocked`)return;if(t.excuses!==`plan`||!A)return t.help;let n=A.plan;return n?`error`in n?`the plan cannot be read: ${n.error}`:n.tasks-n.done?`${n.tasks-n.done} of ${n.tasks} plan tasks are unticked: say why it goes anyway`:`every plan task is ticked: leave it empty`:`the item has no plan file`};return(0,G.jsx)(De,{onClose:n,dirty:Object.entries(d).some(([e,t])=>Lw(t)!==Lw(u[e])),children:(0,G.jsxs)(`form`,{className:`dialog ${r.fields.length>6?`wide`:``}`,role:`dialog`,"aria-modal":!0,"aria-label":t.title,onClick:e=>e.stopPropagation(),onSubmit:M,children:[(0,G.jsx)(`h2`,{children:t.title}),O&&(0,G.jsx)(`p`,{className:`dialog-body`,children:O}),(0,G.jsx)(`datalist`,{id:`move-form-ids`,children:[...k.keys()].map(e=>(0,G.jsx)(`option`,{value:e},e))}),r.fields.filter(e=>!e.hidden&&vi(e,d)).map(n=>{let r=`${a}-${n.key}`,i=Ew[n.kind],c=Lw(d[n.key]),l=N(n),u=E&&n.key===`detail`?E.details:null,f=s&&n.key===`blocked`?`Waits for something outside`:o&&n.key===`system`?n.label.replace(/, comma-separated/i,``):n.label;return(0,G.jsxs)(`div`,{className:`f-field`,children:[(0,G.jsxs)(`span`,{className:`f-label`,children:[n.kind===`choice`||n.kind===`remove`||u?(0,G.jsxs)(`span`,{className:`f-label-text`,title:n.help,children:[f,n.required?` (required)`:``]}):(0,G.jsxs)(`label`,{htmlFor:r,title:n.help,children:[f,n.required?` (required)`:``]}),i&&(0,G.jsx)(`span`,{title:i[1],children:i[0]})]}),s&&n.key===`blocked`?(0,G.jsxs)(`div`,{className:`f-check`,children:[(0,G.jsxs)(`label`,{children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:w,onChange:e=>{g(``),C(e.target.checked)}}),(0,G.jsx)(`span`,{children:`Start blocked`})]}),w&&(0,G.jsx)(`input`,{id:r,className:`input`,value:c,"aria-label":`Why it starts blocked`,placeholder:d.type===`asset`?`file needed: the final lock icon`:`what it waits for`,onChange:e=>D(n.key,e.target.value)}),(0,G.jsx)(`span`,{className:`field-help`,children:w?`It is created blocked with this reason: the runner takes it only after Unblock. A file brought later: Unblock with file: <path>, and its run takes it in.`:`Off: it is created ready. On: it waits for something outside, a file, an answer, an access.`})]}):(0,G.jsx)(Pw,{id:r,field:n,value:d[n.key],presets:e.board.presets,board:e.board,self:t.id??Lw(d.id),newItem:o,details:u,onChange:e=>D(n.key,e)}),l&&n.kind!==`choice`&&!n.presets&&(0,G.jsx)(`span`,{className:`field-help`,children:l}),n.max&&!u&&(0,G.jsxs)(`span`,{"aria-live":`polite`,className:`f-count ${c.length>n.max?`over`:``}`,children:[c.length,` / `,n.max]})]},n.key)}),h&&(b&&`paths`in b?(0,G.jsx)(Yy,{ctx:e,refusal:b,error:h}):(0,G.jsx)(Ae,{error:h,refused:_})),(0,G.jsxs)(`div`,{className:`dialog-actions`,children:[(0,G.jsx)(`button`,{type:`button`,className:`btn-line`,onClick:n,disabled:p,children:`Cancel`}),(0,G.jsx)(`button`,{type:`submit`,className:r.danger?`btn-danger`:`btn-primary`,disabled:p||j,children:p?`Running…`:r.label})]})]})})}function Bw({ctx:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(``),a=(0,v.useRef)(0),{project:o,notify:s,board:c}=e,l=c.domain.sections.playtest,u=c.settings?.find(e=>e.key===`tune_limit`),d=u?u.value??u.default:null,f=fi(c.domain,c.domain.sections.inbox?.add),p=l?.category,m=JSON.stringify(c.items.filter(e=>(l?.waits??[]).includes(e.status)));if((0,v.useEffect)(()=>{let e=++a.current;H.playtest(o.name).then(t=>e===a.current&&n(t),e=>s(e.message,`error`))},[m,o.name,s]),!t)return(0,G.jsx)(`div`,{className:`page`,role:`status`,children:(0,G.jsx)(`p`,{className:`dim`,children:`Reading the session…`})});let h=new Map;for(let e of t.items){let t=e.system[0]??`(no system)`;h.set(t,[...h.get(t)??[],e])}let g=[(t.main?t.branch!==t.main:/^(HEAD|work\/)/.test(t.branch??``))?`not ${t.main??`main`}: Play main here plays another branch`:null,t.dirty?`uncommitted changes`:null].filter(Boolean);return(0,G.jsxs)(`section`,{className:`page playtest`,"aria-label":`Playtest`,children:[(0,G.jsxs)(`div`,{className:`page-head`,children:[(0,G.jsx)(`h1`,{children:`Playtest`}),(0,G.jsxs)(`p`,{children:[`Play each card's build, then judge it. `,t.items.length,` wait`,t.items.length===1?`s`:``,` for you.`]})]}),(0,G.jsxs)(`section`,{className:`pt-build`,"aria-label":`The builds to play`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`pt-build-label`,children:`The checkout`}),(0,G.jsxs)(`span`,{className:`mono pt-build-ref`,children:[t.branch,` · `,t.commit]}),(0,G.jsx)(`span`,{className:g.length?`warn-text`:`dim small`,children:g.length?g.join(` · `):`no warnings: on main, nothing uncommitted`}),(0,G.jsx)(Rc,{ctx:e})]}),t.items.map(t=>(0,G.jsxs)(`div`,{className:`pt-build-item`,children:[(0,G.jsx)(`button`,{className:`pt-build-name`,onClick:()=>e.openItem(t.id,`file`),children:t.title??t.id}),(0,G.jsx)(rl,{ctx:e,id:t.id})]},t.id))]}),(t.milestones??[]).map(n=>{let r=c.milestones?.find(e=>e.name===n.name),i=r?.ids??[],a=r?.units??[],o=(c.play?.builds??[]).map(e=>e.name),s=i.flatMap(e=>c.items.find(t=>t.id===e)?.play_on??[]),l=o.length?[...new Set(s.length?s:o)]:t.platforms??[];return(0,G.jsxs)(`section`,{className:`pt-ms`,"aria-label":`Milestone ${n.name}`,children:[(0,G.jsxs)(`div`,{className:`pt-ms-top`,children:[(0,G.jsxs)(`div`,{className:`pt-ms-head`,children:[(0,G.jsxs)(`div`,{className:`pt-ms-line`,children:[(0,G.jsx)(`span`,{className:`pt-ms-cap`,children:`Milestone`}),(0,G.jsx)(`span`,{className:`pt-ms-name`,children:n.name}),(0,G.jsx)(`span`,{className:`pt-ms-state ${r?.built?`built`:``}`,children:r?.played?`played`:r?.built?`built`:`building`}),(0,G.jsxs)(`span`,{className:`pt-ms-counts`,children:[n.to_play,` to play`,n.building||n.blocked?` · still building ${n.building}${n.blocked?`, blocked ${n.blocked}`:``}`:``]})]}),n.goal&&(0,G.jsx)(`span`,{className:`pt-ms-goal`,children:n.goal})]}),(0,G.jsxs)(`button`,{className:`btn-ok pt-ms-keep`,title:`Keep every item of it that waits for play, in one commit (verdict keep --milestone); tune or kill an item on its own first`,onClick:()=>void(async()=>{await ke(`Keep milestone ${n.name}: every item of it that waits for play?`,`Keep`)&&await e.move({cmd:`milestone-keep`,id:n.name})})(),children:[`Keep `,n.name]})]}),n.play&&(0,G.jsxs)(`div`,{className:`pt-ms-play`,children:[(0,G.jsx)(`span`,{children:`play:`}),(0,G.jsx)(`span`,{children:n.play})]}),(0,G.jsxs)(`div`,{className:`pt-ms-where`,children:[(0,G.jsx)(`span`,{children:`where to play`}),(0,G.jsx)(`span`,{title:`The builds its items play on: each item's Play by platform has the rows`,children:l.length?l.join(` · `):`no builds in the read`})]}),a.length>0&&(0,G.jsxs)(`span`,{className:`pt-ms-units`,children:[a.length,` design unit`,a.length>1?`s`:``,` not carded:`,` `,a.map(e=>e.id).join(`, `)]}),i.length>0&&(0,G.jsx)(`div`,{role:`list`,className:`pt-ms-rows`,children:i.map(t=>{let n=c.items.find(e=>e.id===t),r=c.domain.columns.find(e=>e.status===n?.status),i=n?.play_on??[];return(0,G.jsxs)(`div`,{role:`listitem`,className:`pt-ms-row ${e.itemOpen===t?`on`:``}`,children:[(0,G.jsxs)(`button`,{disabled:!n,onClick:()=>n&&e.openItem(t,`file`),children:[(0,G.jsx)(`span`,{className:`mono strong`,children:t}),n?.title&&(0,G.jsx)(`span`,{children:n.title})]}),(0,G.jsx)(`span`,{className:`pt-ms-st`,children:n?`${n.running?`running`:r?.label??n.status} on this board`:`not on the board`}),(0,G.jsxs)(`span`,{className:`pt-ms-on`,children:[`Play on `,(0,G.jsx)(`span`,{children:i.length?i.join(` · `):`—`})]})]},t)})})]},n.name)}),!t.items.length&&(0,G.jsx)(`div`,{className:`empty-box`,children:`Nothing waits for play.`}),[...h].map(([t,n])=>(0,G.jsxs)(`section`,{className:`pt-group`,"aria-label":t,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[t,(0,G.jsx)(`span`,{className:`dim`,children:n.length}),(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),(0,G.jsx)(`div`,{className:`wide-only`,children:(0,G.jsx)(Fo,{children:n.map(t=>{let n=c.items.find(e=>e.id===t.id),r=c.domain.columns.find(e=>e.status===t.status),i=[(t.play_on??[]).length?`play on ${(t.play_on??[]).join(`, `)}`:``,t.status===`unplayed`?`unplayed: nobody played it yet`:r?.label??t.status,n?.since?`built at ${n.since.slice(0,7)}`:``,n?.tune_count?`tuned ${n.tune_count}${d?` of ${d}`:`×`}`:``];return(0,G.jsx)(No,{cat:n?`${n.type.slice(0,3).toUpperCase()} · ${n.gate}`:t.id,tone:n?.gate,origin:n?.running?`running`:r?.label??t.status,title:t.title??t.id,sub:i.filter(Boolean).join(` · `),mark:t.title?t.id:``,needs:n?$a(n,c):!1,on:e.itemOpen===t.id,onOpen:()=>e.openItem(t.id,`file`)},t.id)})})}),(0,G.jsx)(`div`,{className:`phone-only pt-rows`,children:n.map(t=>{let n=c.items.find(e=>e.id===t.id),r=n?pi(n,c.domain).filter(e=>l?.verdicts.includes(e.cmd)):[],i=c.domain.columns.find(e=>e.status===t.status);return(0,G.jsxs)(`div`,{className:`pt-item gate-${n?.gate??``}`,children:[(0,G.jsxs)(`button`,{className:`pt-open`,onClick:()=>e.openItem(t.id),children:[(0,G.jsx)(`span`,{className:`mono pt-id`,children:t.id}),(t.title??t.intent)&&(0,G.jsx)(`span`,{className:`pt-title`,children:t.title??t.intent}),(0,G.jsxs)(`span`,{className:`dim small`,children:[i?.label??t.status,n?.tune_count?` · tuned ${n.tune_count}×`:``]})]}),(0,G.jsxs)(`dl`,{className:`pt-check`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`Check`}),(0,G.jsx)(`dd`,{children:t.question})]}),t.reach.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`Get there`}),(0,G.jsx)(`dd`,{children:t.reach.join(`; `)})]}),t.feel.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`Feel`}),(0,G.jsx)(`dd`,{children:t.feel.join(`; `)})]}),(t.play_on??[]).length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`Play on`}),(0,G.jsx)(`dd`,{children:(t.play_on??[]).join(`; `)})]})]}),(0,G.jsx)(`div`,{className:`pt-acts`,children:r.map(n=>(0,G.jsx)(`button`,{className:hi(n),title:n.help,onClick:()=>e.openMove({title:`${n.label} ${t.id}`,id:t.id,move:n}),children:n.label},n.cmd))})]},t.id)})})]},t)),f&&p&&(0,G.jsxs)(`section`,{className:`pt-note`,"aria-label":`A note from the playtest`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[`A note from the playtest`,(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),(0,G.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault(),r.trim()&&await e.move({cmd:f.cmd,text:r,category:p})&&i(``)},children:[(0,G.jsx)(`textarea`,{className:`input`,"aria-label":`A note from the playtest`,rows:2,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},title:`Ctrl+Enter adds`,placeholder:`What you noticed: it goes to the inbox as ${p}`}),(0,G.jsx)(`button`,{type:`submit`,className:`btn`,disabled:!r.trim(),children:`To the inbox`})]})]})]})}var Vw=(e,t)=>e.kind===t.kind&&e.pattern===t.pattern;function Hw({r:e}){return(0,G.jsxs)(`code`,{className:`rule-text`,children:[(0,G.jsxs)(`span`,{className:`dim`,children:[e.kind,`:`]}),` `,e.pattern]})}function Uw({ctx:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),s=e.board.agent,c=e.board.context;if(!s)return(0,G.jsx)(`div`,{className:`page`,children:(0,G.jsx)(`p`,{className:`dim`,children:`This core reports no agent permissions: update it.`})});let l=s.extra??[],u=(s.rules?.deny??[]).filter(e=>!l.some(t=>Vw(t,e))),d=s.rules?.allow??[],f=async(t,n)=>{i(t);let r=await e.move({cmd:`permissions`,...n});return i(null),r};return(0,G.jsxs)(`section`,{className:`page agent`,"aria-label":`Agent`,children:[(0,G.jsxs)(`div`,{className:`page-head`,children:[(0,G.jsx)(`h1`,{children:`Agent`}),(0,G.jsx)(`p`,{children:`What agent runs may not do. A run allows everything but the deny rules. A deny rule stops an accident, not a rewording: an agent that means it can say the same thing another way.`})]}),(0,G.jsxs)(`section`,{"aria-label":`Deny groups`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[`Deny groups`,(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),(0,G.jsx)(`div`,{className:`ag-groups`,children:s.groups.map(e=>(0,G.jsxs)(`button`,{role:`checkbox`,"aria-checked":e.on,disabled:r!==null,className:`ag-group ${e.on?`on`:``}`,onClick:()=>void f(e.id,{[e.on?`off`:`on`]:[e.id]}),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:e.on?`☑`:`☐`}),(0,G.jsxs)(`span`,{className:`ag-group-label`,children:[e.label.split(`: `)[0],e.label.includes(`: `)&&(0,G.jsx)(`small`,{children:e.label.slice(e.label.indexOf(`: `)+2)})]}),(0,G.jsx)(`span`,{className:`ag-state`,children:r===e.id?`…`:e.on?`denied`:`allowed`})]},e.id))}),(0,G.jsx)(`span`,{className:`dim small`,children:`A command a run refused blocks its item with “needs permission: <command>”: untick its group, or remove the own rule that refused it, and run it again.`}),u.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{className:`btn-line ag-base`,"aria-expanded":a,onClick:()=>o(!a),children:[a?`▾`:`▸`,` the rules the ticked groups add · `,u.length]}),a&&(0,G.jsx)(`div`,{className:`ag-base-list`,children:u.map(e=>(0,G.jsx)(Hw,{r:e},`${e.kind}:${e.pattern}`))})]})]}),(0,G.jsxs)(`section`,{"aria-label":`Own deny rules`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[`Own deny rules`,(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),!s.deny_extra.length&&(0,G.jsx)(`span`,{className:`dim`,children:`No own rule yet.`}),s.deny_extra.map((e,t)=>(0,G.jsxs)(`div`,{className:`ag-rule`,children:[l[t]?(0,G.jsx)(Hw,{r:l[t]}):(0,G.jsx)(`code`,{className:`rule-text`,children:e}),l[t]&&`${l[t].kind}: ${l[t].pattern}`!==e&&(0,G.jsxs)(`span`,{className:`mono dim small`,title:`Claude's form is taken too; the list shows every rule neutral`,children:[`entered as `,e]}),(0,G.jsx)(Po,{label:`Remove the rule`,tip:`Remove · runs may do this again`,disabled:r!==null,onClick:()=>void f(`undeny:${e}`,{undeny:[e]})})]},e)),(0,G.jsxs)(`form`,{className:`ag-add`,onSubmit:async e=>{e.preventDefault(),t.trim()&&await f(`add`,{deny:[t.trim()]})&&n(``)},children:[(0,G.jsx)(`input`,{className:`input mono`,"aria-label":`A deny rule`,value:t,onChange:e=>n(e.target.value),placeholder:`shell: curl * · read: ~/.aws/** · mcp: server__tool · or Bash(curl *)`}),(0,G.jsx)(`button`,{type:`submit`,className:`btn`,disabled:!t.trim()||r!==null,children:r===`add`?`Adding…`:`Deny`})]}),(0,G.jsx)(`span`,{className:`dim small`,children:`Write it neutral, kind: pattern, with the kinds edit, shell, read, search, web, mcp, skill, subagent, other. Claude's form, Bash(curl *), is taken too. The core refuses a rule of neither form.`})]}),(0,G.jsxs)(`section`,{"aria-label":`Allow rules`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[`Allow rules`,(0,G.jsx)(`span`,{className:`dim sub`,children:`agent.allow in gcf/config.yml`}),(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),!d.length&&(0,G.jsx)(`span`,{className:`dim`,children:`No allow rule. Runs allow everything but the deny rules anyway; an allow rule lets an agent run without bypass skip asking. Always on a project chat card saves its rule in .claude/settings.local.json instead, for this machine.`}),d.map(e=>(0,G.jsx)(`div`,{className:`ag-rule`,children:(0,G.jsx)(Hw,{r:e})},`${e.kind}:${e.pattern}`))]}),c&&(0,G.jsxs)(`section`,{"aria-label":`Context`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[`Context`,(0,G.jsx)(`span`,{className:`dim sub`,children:`read only · set in Settings`}),(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),(0,G.jsx)(`div`,{className:`ag-ctx`,children:[{key:`context_handoff_pct`,label:`handoff at`,value:c.handoff_pct?`${c.handoff_pct}%`:`never`,tip:`At this share of the window a session hands its item to a fresh one`},{key:`context_window`,label:`window`,value:c.window?`${c.window.toLocaleString()} tokens`:`the model's`,tip:`The context window the share is of`},{key:`auto_compact_pct`,label:`compacts at`,value:c.compact_pct?`${c.compact_pct}%`:`its own default`,tip:`Where the agent compacts its context`}].map(e=>(0,G.jsxs)(`div`,{className:`ag-ctx-box`,title:e.tip,children:[(0,G.jsx)(`span`,{children:e.label}),(0,G.jsx)(`span`,{className:`mono`,children:e.value}),(0,G.jsxs)(`code`,{children:[`gcf/config.yml · `,e.key]})]},e.key))})]})]})}function Ww(e){return!e.trim()||e.trim()===`none`?[]:e.split(`,`).map(e=>{let[t,n=``,r=``]=e.trim().split(`:`);return{agent:t===`codex`?`codex`:`claude`,model:n,effort:r}})}var Gw=e=>e.length?e.map(e=>`${e.agent}:${e.model}:${e.effort}`).join(`, `):`none`;function Kw(e,t,n){if(t===n||n<0||n>=e.length)return e;let r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r}var qw=(e,t)=>[...e,e.at(-1)??{agent:`claude`,...Xw(`claude`,t)}],Jw=(e,t)=>e===`codex`?(t?.codex??[]).map(e=>e.model):t?.claude.model??[`fable`,`opus`,`sonnet`,`haiku`],Yw=(e,t)=>e.agent===`codex`?t?.codex.find(t=>t.model===e.model)?.efforts??[]:t?.claude.effort??[`low`,`medium`,`high`,`xhigh`,`max`];function Xw(e,t){if(e===`codex`){let e=t?.codex[0];return{model:e?.model??`astra`,effort:e?.efforts.includes(`medium`)?`medium`:e?.efforts[0]??`medium`}}return{model:`opus`,effort:`high`}}var Zw=(e,t)=>({agent:e,...Xw(e,t)}),Qw=`gcf-theme`;function $w(){try{let e=JSON.parse(localStorage.getItem(Qw)??`null`);return e&&typeof e.id==`string`&&e.tokens&&typeof e.tokens==`object`?e:null}catch{return null}}var eT=$w(),tT=new Set;function nT(e){eT=e;try{e?localStorage.setItem(Qw,JSON.stringify(e)):localStorage.removeItem(Qw)}catch{}for(let e of tT)e()}var rT=()=>eT,iT=()=>(0,v.useSyncExternalStore)(e=>(tT.add(e),()=>tT.delete(e)),rT),aT=[];function oT(e,t){for(let t of aT)e.style.removeProperty(t);aT=[];let n=[],r=getComputedStyle(e);for(let[i,a]of Object.entries(t?.tokens??{})){let t=`--gcf-${i}`;r.getPropertyValue(t)?(e.style.setProperty(t,a),aT.push(t)):n.push(i)}return document.body.style.background=t?.tokens.bg??``,document.documentElement.style.colorScheme=t?.scheme??``,n}var sT=null,cT=`gcf-settings-open`,lT=`Board · this browser`;function uT(){try{let e=JSON.parse(localStorage.getItem(cT)??`[]`);return Array.isArray(e)?e:[]}catch{return[]}}function dT({ctx:e}){let t=e.board.settings,n=e.project.name,[r,i]=(0,v.useState)(uT),[a,o]=(0,v.useState)(()=>t&&!R(n)?M(t,L(n)):{}),[s]=(0,v.useState)(()=>Object.keys(a).length>0&&!sT),[c]=(0,v.useState)(()=>{let e=sT?.project===n?sT:null;return sT=null,e}),l=(0,v.useRef)({drafts:a,settings:t});if(l.current={drafts:a,settings:t},(0,v.useEffect)(()=>ee(n,a),[n,a]),(0,v.useEffect)(()=>{t&&o(e=>M(t,e))},[t]),(0,v.useEffect)(()=>{let e=t?.find(e=>e.key===c?.key);e&&i(t=>[...new Set([...t,e.group??`Settings`])])},[c,t]),(0,v.useEffect)(()=>{c?.key&&document.getElementById(`set-${c.key}`)?.scrollIntoView()},[c]),(0,v.useEffect)(()=>{let t=()=>{let{drafts:e,settings:t}=l.current;if(t)for(let r of N(t,e))navigator.sendBeacon(`/api/p/${encodeURIComponent(n)}/move`,new Blob([JSON.stringify(r)],{type:`application/json`}))};return window.addEventListener(`pagehide`,t),()=>{window.removeEventListener(`pagehide`,t),fT(e,n,l.current.drafts,l.current.settings)}},[n]),!t)return(0,G.jsxs)(`div`,{className:`page`,children:[(0,G.jsx)(bT,{}),(0,G.jsx)(wT,{}),(0,G.jsx)(CT,{}),(0,G.jsx)(`p`,{className:`dim`,children:`This core reports no settings: update it.`})]});let u=[...new Set(t.map(e=>e.group??`Settings`))],d=e=>{let t=r.includes(e)?r.filter(t=>t!==e):[...r,e];i(t);try{localStorage.setItem(cT,JSON.stringify(t))}catch{}},f=(e,t,n)=>o(r=>j(r,e,t,n));return(0,G.jsxs)(`section`,{className:`page settings`,"aria-label":`Settings`,children:[(0,G.jsxs)(`div`,{className:`page-head`,children:[(0,G.jsx)(`h1`,{children:`Settings`}),(0,G.jsx)(`p`,{children:`Every key of gcf/config.yml you set, and the agents' language. Your changes are saved when you leave Settings, in one commit; the core refuses a value its rules do not take.`}),s&&(0,G.jsx)(`p`,{className:`set-leftover`,role:`status`,children:`Changes of your last visit were not saved: they are back here, and go when you leave.`}),c&&!c.key&&(0,G.jsxs)(`p`,{className:`set-refused`,role:`alert`,children:[`Not saved: `,c.why]})]}),(0,G.jsxs)(pT,{name:lT,open:r.includes(lT),onToggle:()=>d(lT),children:[(0,G.jsx)(bT,{}),(0,G.jsx)(wT,{})]}),u.map(n=>{let i=t.filter(e=>(e.group??`Settings`)===n);return(0,G.jsxs)(pT,{name:n,open:r.includes(n),changed:F(i),onToggle:()=>d(n),children:[n===`Autonomy`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`set-intro`,children:`Every stop that waits for you, for the whole project (gates: in gcf/config.yml). A card may hold its own gates. A preset commits at once.`}),(0,G.jsx)(hT,{ctx:e,settings:t})]}),i.map(t=>(0,G.jsx)(vT,{ctx:e,s:t,drafts:a,setDraft:f,refused:c?.key===t.key?c.why:null},t.key))]},n)})]})}async function fT(e,t,n,r){if(!r)return;let i=N(r,n);i.length&&await ne(t,async()=>{for(let r of i){let i=await e.moveIn(r);if(!i.ok){sT={project:t,key:P(i.err,n),why:i.err},e.openSettings();return}}ee(t,{})})}function pT(e){let t=`set-fold-${e.name.replace(/\W+/g,`-`)}`;return(0,G.jsxs)(`section`,{"aria-label":e.name,className:`set-group`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`set-fold`,"aria-expanded":e.open,"aria-controls":t,onClick:e.onToggle,children:[(0,G.jsx)(`span`,{className:`set-chev`,"aria-hidden":`true`,children:e.open?`▾`:`▸`}),e.name,!e.open&&!!e.changed&&(0,G.jsxs)(`span`,{className:`dim small`,children:[` · `,e.changed,` changed`]})]}),(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),e.open&&(0,G.jsx)(`div`,{id:t,children:e.children})]})}var mT=[{name:`Careful`,help:`Every gate waits for you; the autopilot is off`,keys:{"gates.milestone":`wait`,"gates.verdict":`wait`,"gates.decision":`wait`,"gates.question":`wait`},pilot:!1},{name:`Autonomous`,help:`The agent decides its spikes and assumes instead of asking; it stops for a built milestone and an item’s own verdict; runs in worktrees; the autopilot is on`,keys:{"gates.milestone":`wait`,"gates.verdict":`wait`,"gates.decision":`agent`,"gates.question":`assume`,run_mode:`worktree`},pilot:!0}];function hT({ctx:e,settings:t}){let n=e=>{let n=t.find(t=>t.key===e);return String(n?.value??n?.default??``)},r=e.board.runs?.autopilot?.on??!1,i=mT.find(e=>e.pilot===r&&Object.entries(e.keys).every(([e,t])=>n(e)===t)),a=async t=>{await e.move({cmd:`config-preset`,pairs:t.keys})&&r!==t.pilot&&await e.setAutopilot(t.pilot)};return(0,G.jsxs)(`div`,{className:`set-presets`,children:[(0,G.jsx)(`div`,{role:`group`,"aria-label":`Presets`,className:`set-preset-btns`,children:mT.map(e=>(0,G.jsx)(`button`,{className:i===e?`btn-primary`:`btn`,"aria-pressed":i===e,title:e.help,onClick:()=>void a(e),children:e.name},e.name))}),(0,G.jsxs)(`div`,{className:`set-preset-now`,children:[(0,G.jsx)(`span`,{className:i?``:`own`,title:i?`The keys match ${i.name}: ${i.help}`:`The keys match neither preset`,children:i?`now: ${i.name}`:`now: your own`}),(0,G.jsxs)(`span`,{className:`mono`,children:[`autopilot `,r?`on`:`off`,` · run_mode `,n(`run_mode`)||e.board.run_mode]})]}),(0,G.jsx)(`button`,{className:`btn-line set-preset-agent`,title:`The deny groups and rules the agent works under`,onClick:()=>e.go(`agent`),children:`Agent permissions`})]})}function gT(e){let{options:t,value:n,onPick:r}=e;return(0,G.jsx)(`div`,{id:e.id,role:`radiogroup`,"aria-label":e.label,className:`set-seg`,onKeyDown:e=>{let i={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];if(!i||!t.length)return;e.preventDefault();let a=(Math.max(0,t.indexOf(n))+i+t.length)%t.length;e.currentTarget.querySelectorAll(`[role="radio"]`)[a]?.focus(),r(t[a])},children:t.map((e,i)=>(0,G.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e===n,tabIndex:e===n||!t.includes(n)&&i===0?0:-1,onClick:()=>r(e),children:e},e))})}var _T=(e,t)=>t===``?`none`:e.kind===`share`?`${t}%`:e.unit&&e.unit!==`%`?`${t} ${e.unit}`:t;function vT(e){let{ctx:t,s:n,drafts:r}=e,i=`set-${n.key}`,a=n.presets?ba(t.board,n.presets):null,o=k(n,r,a),s=A(n,a),c=t=>e.setDraft(n,t,a),l=(n.key in r?r[n.key]!==``:n.value!==null)&&o!==s,u=yT(t,n,i,o,c);return(0,G.jsxs)(`div`,{className:`set-row${n.key in r?` set-draft`:``}`,children:[(0,G.jsxs)(`div`,{className:`set-what`,children:[(0,G.jsx)(`label`,{htmlFor:i,className:`set-title`,title:n.help??n.label,tabIndex:0,children:n.title??n.key}),(0,G.jsx)(`span`,{children:n.hint??n.label})]}),(0,G.jsxs)(`div`,{className:`set-how`,children:[(0,G.jsxs)(`div`,{className:`set-ctl`,children:[u,l&&(0,G.jsx)(`button`,{type:`button`,className:`btn-icon set-reset`,"aria-label":`Reset to ${_T(n,s)}`,title:`Reset to ${_T(n,s)}`,onClick:()=>c(``),children:`↺`})]}),e.refused&&(0,G.jsx)(`span`,{className:`set-refused`,role:`alert`,children:e.refused})]})]})}function yT(e,t,n,r,i){if(t.kind===`passes`)return(0,G.jsx)(ET,{id:n,label:t.title??t.key,value:r,presets:e.board.review_presets,providers:e.board.providers,onChange:i});if(t.presets){let a=e.board.presets?.[t.presets]??[],o=r&&!a.includes(r)?[...a,r]:a;return(0,G.jsx)(`select`,{id:n,className:`input`,value:r,onChange:e=>i(e.target.value),children:o.map(e=>(0,G.jsx)(`option`,{value:e,children:ga(e)},e))})}return t.kind===`mode`&&t.options&&t.group===`Autonomy`?(0,G.jsx)(gT,{id:n,label:t.title??t.key,options:t.options,value:r,onPick:i}):t.kind===`mode`&&t.options?(0,G.jsx)(`select`,{id:n,className:`input mono`,value:r,onChange:e=>i(e.target.value),children:[...t.options,...r&&!t.options.includes(r)?[r]:[]].map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))}):t.options?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`input`,{id:n,className:`input mono`,value:r,list:`${n}-options`,onChange:e=>i(e.target.value)}),(0,G.jsx)(`datalist`,{id:`${n}-options`,children:t.options.map(e=>(0,G.jsx)(`option`,{value:e},e))})]}):t.kind===`command`||t.kind===`list`?(0,G.jsx)(`textarea`,{id:n,className:`input mono set-command`,rows:t.kind===`list`?3:1,value:r,onChange:e=>i(e.target.value),placeholder:t.example?`e.g. ${t.example}`:`none`}):t.kind===`number`||t.kind===`share`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`input`,{id:n,type:`number`,className:`input mono set-number`,value:r,min:t.min??0,max:t.max??(t.kind===`share`?100:void 0),step:t.step??1,onChange:e=>i(e.target.value)}),(t.kind===`share`||t.unit)&&(0,G.jsx)(`span`,{className:`mono dim`,children:t.kind===`share`?`%`:t.unit})]}):(0,G.jsx)(`input`,{id:n,className:`input mono`,value:r,onChange:e=>i(e.target.value)})}function bT(){let e=iT(),[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(``);return(0,v.useEffect)(()=>{H.themes().then(n,e=>i(e.message))},[]),(0,G.jsxs)(`section`,{"aria-label":`Theme`,className:`set-group`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[`Board · this browser`,(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),(0,G.jsxs)(`div`,{className:`set-row`,children:[(0,G.jsxs)(`div`,{className:`set-what`,children:[(0,G.jsx)(`label`,{htmlFor:`set-theme`,className:`mono`,children:`theme`}),(0,G.jsx)(`span`,{children:`Colours of the board in this browser. The phone and the desk can differ.`})]}),(0,G.jsxs)(`div`,{className:`set-how`,children:[(0,G.jsx)(`div`,{className:`set-ctl`,children:(0,G.jsxs)(`select`,{id:`set-theme`,className:`input`,value:e?.id??``,onChange:e=>{let n=t?.find(t=>t.id===e.target.value);nT(n&&`tokens`in n?n:null)},children:[(0,G.jsx)(`option`,{value:``,children:`Dark (built-in)`}),t?.map(e=>`tokens`in e?(0,G.jsxs)(`option`,{value:e.id,children:[e.name,` (`,e.scheme,`)`]},e.id):(0,G.jsxs)(`option`,{value:e.id,disabled:!0,children:[e.id,`: `,e.error]},e.id))]})}),(0,G.jsx)(`span`,{className:`dim small`,children:r||`Applies at once. The board ships its own; a JSON file in ~/.gcf/themes adds one or replaces one of its id: reload the page after changing it.`})]})]}),(0,G.jsx)(ST,{})]})}var xT=[{v:`expanded`,label:`Expanded`,help:`every card in full`,now:`Every technical card in full`},{v:`collapsed`,label:`Collapsed into a line`,help:`one line each; a click opens it (the default)`,now:`One line each; a click opens the card`},{v:`hidden`,label:`Hidden`,help:`only a card that waits for you`,now:`Gone from the stream; a card that waits for you stays`}];function ST(){let e=ix();return(0,G.jsxs)(`div`,{className:`set-row`,children:[(0,G.jsxs)(`div`,{className:`set-what`,children:[(0,G.jsx)(`span`,{id:`set-chat-tech`,className:`mono set-name`,children:`technical cards`}),(0,G.jsx)(`span`,{children:`A permission card no longer waiting, a refusal, a call YOLO ran. A card that waits for you is always open in full; text, questions, proposals and steps never fold.`})]}),(0,G.jsxs)(`div`,{className:`set-how set-tech-how`,children:[(0,G.jsx)(`div`,{role:`radiogroup`,"aria-labelledby":`set-chat-tech`,className:`set-seg set-tech`,onKeyDown:t=>{let n={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[t.key];if(!n)return;t.preventDefault();let r=(xT.findIndex(t=>t.v===e)+n+xT.length)%xT.length;t.currentTarget.querySelectorAll(`[role="radio"]`)[r]?.focus(),nx(xT[r].v)},children:xT.map(t=>(0,G.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t.v===e,tabIndex:t.v===e?0:-1,title:t.help,onClick:()=>nx(t.v),children:t.label},t.v))}),(0,G.jsxs)(`div`,{className:`set-tech-line`,"aria-hidden":`true`,children:[(0,G.jsx)(`span`,{children:`▸`}),(0,G.jsx)(`span`,{className:`stl-tool`,children:`shell`}),(0,G.jsx)(`span`,{className:`stl-title`,children:`npm run levels:list`}),(0,G.jsx)(`span`,{className:`stl-yolo`,children:`· ran without asking (YOLO)`}),(0,G.jsx)(`span`,{className:`stl-at`,children:`09:02`})]}),(0,G.jsxs)(`span`,{className:`dim small`,children:[xT.find(t=>t.v===e)?.now,` · applies at once, in every tab of this browser`]})]})]})}function CT(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(``);(0,v.useEffect)(()=>{H.accountSettings().then(e=>t(e.quota_reserve_pct),e=>r(e.message))},[]);let i=async e=>{r(``),await H.setAccountSettings({quota_reserve_pct:e}).then(e=>t(e.quota_reserve_pct),e=>r(e.message))};return(0,G.jsx)(`section`,{"aria-label":`This account`,className:`set-group`,children:(0,G.jsxs)(`div`,{className:`set-row`,children:[(0,G.jsxs)(`div`,{className:`set-what`,children:[(0,G.jsx)(`span`,{id:`set-reserve-name`,className:`mono set-name`,children:`quota_reserve_pct`}),(0,G.jsx)(`span`,{children:`The share of each usage window the queue and the autopilot leave to you: at it they stand until the window resets, the week until its reset. Your own Run goes. Every project of this account.`})]}),(0,G.jsxs)(`div`,{className:`set-how`,children:[(0,G.jsx)(`input`,{type:`number`,min:0,max:50,"aria-labelledby":`set-reserve-name`,value:e??``,disabled:e===null,onChange:e=>t(Number(e.target.value)),onBlur:e=>void i(Number(e.target.value))}),n&&(0,G.jsx)(`span`,{role:`alert`,className:`set-yolo-err`,children:n}),(0,G.jsx)(`span`,{className:`mono set-yolo-file`,children:`~/.gcf/settings.json`})]})]})})}function wT(){let e=px(),[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``),s=async e=>{t||(i(e),n(!0),o(``),await mx(e).catch(e=>o(e.message)),n(!1))},c=t?r:e;return(0,G.jsxs)(`section`,{"aria-label":`This machine`,className:`set-group`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[`Board · this machine`,(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),(0,G.jsxs)(`div`,{className:`set-row`,children:[(0,G.jsxs)(`div`,{className:`set-what`,children:[(0,G.jsx)(`span`,{id:`set-yolo-name`,className:`mono set-name set-yolo-name${c?` on`:``}`,children:`YOLO`}),(0,G.jsx)(`span`,{children:`The threads of the project chat ask no permission: the center allows each call itself. Deny rules, the main-run refusal and question cards stay. Every project on this machine; from the next call.`})]}),(0,G.jsxs)(`div`,{className:`set-how set-yolo${c?` on`:``}`,children:[(0,G.jsxs)(`button`,{id:`set-yolo`,type:`button`,role:`switch`,"aria-checked":c,"aria-labelledby":`set-yolo-name`,"aria-describedby":`set-yolo-risk`,className:`set-switch`,onClick:()=>void s(!c),children:[(0,G.jsx)(`span`,{className:`set-switch-track`,"aria-hidden":`true`,children:(0,G.jsx)(`span`,{className:`set-switch-knob`})}),c?`on`:`off`]}),(0,G.jsxs)(`p`,{id:`set-yolo-risk`,className:`set-yolo-risk`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`⚠`}),(0,G.jsx)(`span`,{children:`Calls run unseen, as in a task run: a framework move that changes the project (integrate, close, design discard, inbox drop), an edit of AGENTS.md or CLAUDE.md, which stays after YOLO goes off, and a command that gets round a deny rule run too.`})]}),a&&(0,G.jsx)(`span`,{role:`alert`,className:`set-yolo-err`,children:a}),(0,G.jsx)(`span`,{className:`mono set-yolo-file`,children:`~/.gcf/chat-yolo`})]})]})]})}var TT={claude:`Claude`,codex:`Codex`};function ET(e){let{presets:t,providers:n}=e,r=Ww(e.value),[i,a]=(0,v.useState)(null),o=t=>e.onChange(Gw(t)),s=(e,t)=>o(r.map((n,r)=>r===e?t:n)),c=e=>t=>{!t.altKey||t.key!==`ArrowUp`&&t.key!==`ArrowDown`||(t.preventDefault(),o(Kw(r,e,e+(t.key===`ArrowUp`?-1:1))))},l=(e,t)=>t&&!e.includes(t)?[...e,t]:e;return(0,G.jsxs)(`div`,{className:`pass-list`,children:[(0,G.jsx)(`ol`,{id:e.id,"aria-label":e.label,children:r.map((e,u)=>(0,G.jsxs)(`li`,{className:`pass-row${i===u?` dragging`:``}`,draggable:!0,onDragStart:()=>a(u),onDragOver:e=>e.preventDefault(),onDrop:()=>{i!==null&&o(Kw(r,i,u)),a(null)},onDragEnd:()=>a(null),onKeyDown:c(u),children:[(0,G.jsxs)(`span`,{className:`pass-k mono dim`,title:`Drag, or Alt+↑/↓, to move it`,children:[`pass `,u+1]}),(0,G.jsx)(`select`,{className:`input`,"aria-label":`Pass ${u+1} provider`,value:e.agent,onChange:e=>s(u,Zw(e.target.value,t)),children:[`claude`,`codex`].map(e=>(0,G.jsx)(`option`,{value:e,children:TT[e]},e))}),(0,G.jsx)(`select`,{className:`input`,"aria-label":`Pass ${u+1} model`,value:e.model,onChange:t=>s(u,{...e,model:t.target.value}),children:l(Jw(e.agent,t),e.model).map(e=>(0,G.jsx)(`option`,{value:e,children:ga(e)},e))}),(0,G.jsx)(`select`,{className:`input`,"aria-label":`Pass ${u+1} effort`,value:e.effort,onChange:t=>s(u,{...e,effort:t.target.value}),children:l(Yw(e,t),e.effort).map(e=>(0,G.jsx)(`option`,{value:e,children:ga(e)},e))}),(0,G.jsx)(`button`,{type:`button`,className:`btn-icon`,"aria-label":`Remove pass ${u+1}`,title:`Remove this pass`,onClick:()=>o(r.filter((e,t)=>t!==u)),children:`🗑`}),n&&!n[e.agent]&&(0,G.jsxs)(`span`,{className:`pass-warn small`,role:`note`,children:[TT[e.agent],` CLI not found: the session's own subagent makes this pass`]})]},u))}),!r.length&&(0,G.jsx)(`p`,{className:`dim small`,children:`No review of this kind.`}),(0,G.jsx)(`button`,{type:`button`,className:`btn pass-add`,"aria-label":`Add a pass`,title:`Add a pass: a copy of the last`,onClick:()=>o(qw(r,t)),children:`+`})]})}var DT=e=>e===null?`-`:`$${e.toFixed(2)}`,OT=e=>`${e} run${e===1?``:`s`}`,kT=(e,t=1)=>e===null?`-`:e.toFixed(t),AT=e=>Object.entries(e).map(([e,t])=>`${e} ${t}`).join(`, `);function jT({ctx:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(``),a=(0,v.useRef)(0),{project:o}=e,s=(e.board.runs?.reports??[]).map(e=>e.id).join(),c=e.board.items.filter(e=>e.running).map(e=>e.id).join();(0,v.useEffect)(()=>{let e=++a.current;H.metrics(o.name).then(t=>{e===a.current&&(n(t),i(``))},t=>e===a.current&&i(t.message))},[s,c,o.name]);let l=(0,G.jsxs)(`div`,{className:`page-head`,children:[(0,G.jsx)(`h1`,{children:`Metrics`}),(0,G.jsx)(`p`,{children:`What the runs did and what they cost (gcf-harness metrics).`})]});if(r)return(0,G.jsxs)(`section`,{className:`page metrics`,children:[l,(0,G.jsxs)(`div`,{className:`empty-box`,children:[`No metrics: `,r]})]});if(!t)return(0,G.jsxs)(`section`,{className:`page metrics`,role:`status`,children:[l,(0,G.jsx)(`p`,{className:`dim`,children:`Reading the metrics…`})]});let u=t.runs;if(!u.count)return(0,G.jsxs)(`section`,{className:`page metrics`,children:[l,(0,G.jsx)(`div`,{className:`empty-box`,children:`No runs yet. Each run the board or a console starts adds to these numbers: what it reached, its handoffs, checks and cost.`})]});let d=u.share===null?``:` (${Math.round(u.share*100)}%)`,f=u.avg_duration_ms===null?null:u.avg_duration_ms/6e4,p=[[String(u.count),`runs${Object.keys(u.results).length?` · ${AT(u.results)}`:``}`],[`${u.reached} of ${u.finished}`,`reached submit or close${d}`],[DT(u.cost_usd),`${DT(u.avg_cost_usd)} a run · ${kT(f,0)} min · ${kT(u.avg_turns,0)} turns`],[String(u.handoffs),`context handoffs`],[String(t.plan.checks),`plan checks · ${t.plan.items} items · ${t.plan.failed} failed`],[String(t.verify.attempts),`DoD attempts · ${t.verify.red} red${t.verify.red?` (${AT(t.verify.failing)})`:``}`],[String(t.guard.count),`guard firings${t.guard.count?` · ${AT(t.guard.by_hook)}`:``}`],[String(u.outside_implement),`code outside aif-implement`],[String(u.unverified),`moved without a green verify`]],m=t.items??[],h=Math.max(...m.map(e=>e.cost_usd),.01),g=(t.by_day??[]).slice(-14),_=Math.max(...g.map(e=>e.cost_usd),.01),y=(t.by_week??[]).at(-1),b=new Set(e.board.items.map(e=>e.id));return(0,G.jsxs)(`section`,{className:`page metrics`,"aria-label":`Metrics`,children:[l,(0,G.jsxs)(`section`,{"aria-label":`Runs`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[`Runs`,(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),(0,G.jsx)(`div`,{className:`mt-tiles`,children:p.map(([e,t])=>(0,G.jsxs)(`div`,{className:`mt-tile`,children:[(0,G.jsx)(`span`,{className:`mono`,children:e}),(0,G.jsx)(`span`,{children:t})]},t))}),Object.keys(u.blocks).length>0&&(0,G.jsxs)(`div`,{className:`mt-blocks`,children:[(0,G.jsx)(`span`,{className:`dim`,children:`block reasons:`}),Object.entries(u.blocks).map(([e,t])=>(0,G.jsxs)(`span`,{children:[e,` `,(0,G.jsx)(`b`,{className:`mono`,children:t})]},e))]})]}),t.items?(0,G.jsxs)(`section`,{"aria-label":`Cost per item`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[`Cost per item`,(0,G.jsx)(`span`,{className:`dim sub`,children:`over all its runs`}),(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),m.map(t=>(0,G.jsxs)(`div`,{className:`mt-item`,children:[(0,G.jsx)(`button`,{className:`link-btn mono`,disabled:!b.has(t.id),onClick:()=>e.openItem(t.id),children:t.id}),(0,G.jsx)(`span`,{className:`mt-bar`,"aria-hidden":`true`,children:(0,G.jsx)(`span`,{style:{width:`${Math.round(100*t.cost_usd/h)}%`}})}),(0,G.jsx)(`span`,{className:`mono`,children:DT(t.cost_usd)}),(0,G.jsx)(`span`,{className:`dim small`,title:`last ${t.last}`,children:OT(t.runs)})]},t.id))]}):(0,G.jsx)(`p`,{className:`dim`,children:`Cost per item, day and week needs gcf-harness-aif-ext 0.9.5.`}),g.length>0&&(0,G.jsxs)(`section`,{"aria-label":`Cost per day`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[`Cost per day`,y&&(0,G.jsxs)(`span`,{className:`dim sub`,children:[`this week `,DT(y.cost_usd)]}),(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),(0,G.jsx)(`div`,{className:`mt-days`,children:g.map(e=>(0,G.jsxs)(`div`,{title:`${e.day}: ${DT(e.cost_usd)}, ${OT(e.runs)}`,children:[(0,G.jsx)(`span`,{className:`mono small`,children:DT(e.cost_usd)}),(0,G.jsx)(`span`,{className:`mt-col`,"aria-hidden":`true`,style:{height:`${Math.max(2,Math.round(80*e.cost_usd/_))}px`}}),(0,G.jsx)(`span`,{className:`mono dim small`,children:e.day.slice(5).replace(`-`,`.`)})]},e.day))})]})]})}var MT=e=>{let t=e.resume?.resets;return t?Number.isNaN(Date.parse(t))?t:ra(t):`?`};function NT(e,t){let{board:n}=e,{domain:r}=n,i=e=>r.columns.find(t=>t.status===e.status),a=new Set(r.sections.playtest?.waits??[]),o=(t,r)=>({key:`item:${t.id}`,cat:`${t.type.slice(0,3).toUpperCase()} · ${t.gate}`,tone:t.gate,origin:t.running?`running`:i(t)?.label??t.status,title:t.title||t.id,sub:r,mark:t.title?t.id:``,needs:$a(t,n),on:e.itemOpen===t.id,onOpen:()=>e.openItem(t.id)}),s=t.flatMap(e=>e.kind===`item`?[e.item]:[]),c=t.some(e=>e.kind===`queue`)?[{key:`queue`,cat:`RUN`,tone:`needs`,origin:`queue paused`,title:`the run queue`,sub:n.runs?.paused_by===`limit`?`A run ended paused: limit by itself. Resume the queue after the reset${n.runs?.paused_until?` (${aa(n.runs.paused_until)})`:``}.`:`A run failed in a way the next one would repeat. Fix what its report names, then resume.`,needs:!0,tip:`Open Runs: Resume queue is there`,onOpen:()=>e.go(`runs`)}]:[],l=n.runs?.autopilot,u=t.flatMap(t=>{if(t.kind!==`pilot`)return[];let{stop:r}=t;if(r.kind===`play`){let t=(n.milestones??[]).find(e=>e.name===r.milestone),i=(t?.items[`awaiting-verdict`]??0)+(t?.items.unplayed??0);return[{key:`pilot`,cat:`MILESTONE · ${r.milestone} · built`,tone:`unplayed`,origin:`the autopilot stands`,title:r.text,sub:t?.play?`play: ${t.play}`:t?.goal??``,mark:i?`${i} to play`:``,markTone:`needs`,needs:!0,play:!0,tip:`${t?.play?`Its play question: ${t.play} · `:``}Open Playtest: Keep ${r.milestone} keeps all of it that waits for play`,onOpen:()=>e.go(`playtest`)}]}let i=l?.guarded[0],a=r.kind===`empty`?{sub:`Card its units on Design`,open:()=>e.go(`design`)}:r.kind===`dirty`?{sub:`Commit or stash it, or pick worktree runs in Settings`,open:()=>e.openSettings()}:r.kind===`no-move`&&i?{sub:`It takes ${i} again once its file changes · turn it on in the header`,open:()=>e.openItem(i)}:{sub:``,open:()=>e.go(`runs`)};return[{key:`pilot`,cat:`AUTOPILOT · ${r.kind===`no-move`?`off by itself`:`stands`}`,tone:`warn`,origin:l?.on?`on, waiting`:`off`,title:r.text,sub:a.sub,mark:``,needs:!0,play:!1,tip:[r.text,a.sub].filter(Boolean).join(` · `),onOpen:a.open}]}),d=u.filter(e=>e.play),f=u.filter(e=>!e.play),p=s.filter(e=>!Qa(n,e.status)).map(e=>o(e,`Hit the usage limit (resets ${MT(e)}); its session is kept. Resume is in its window; while the limit holds, the run waits for the reset.`)),m=t.flatMap(t=>{if(t.kind!==`chat`)return[];let{card:n,talk:r}=t,i=r?`${r.title??`untitled thread`}${r.item?` · ${r.item}`:``} · project chat`:`${t.item} · run chat`;return[{key:`chat:${n.request_id}`,cat:n.kind===`approval`?`permission · ${n.tool??``}`:`question`,tone:`needs`,origin:i,title:n.text,sub:n.reason??``,needs:!0,tip:`Open its chat: the card is answered there`,onOpen:()=>r?e.go(`chat`,r.id):e.openItem(t.item??``,`chat`)}]}),h=t.flatMap(t=>{let n=t.kind===`entry`?uc(e,t.entry,!0):t.kind===`repeat`?fc(e,`${t.repeat.category}:${t.repeat.detail}`,!0):null;return n?[{...n,key:n.dataKey??n.title}]:[]}),g=r.sections.inbox?.groups?.find(e=>e.counts)?.label??`Inbox`,_=t.flatMap(t=>t.kind===`question`?[{...dc(e,t.question,!0),key:t.question.id}]:[]),v=s.filter(e=>Qa(n,e.status)),y=e=>`${e.blocked??i(e)?.help??``}${e.tune_count?` · tuned ${e.tune_count}×`:``}`,b=r.columns.filter(e=>Qa(n,e.status)&&!a.has(e.status)).map(e=>({key:e.status,label:e.label,tiles:v.filter(t=>t.status===e.status).map(e=>o(e,y(e)))}));return[{key:`runs`,label:`Runs that need you`,tiles:[...f,...c,...p]},{key:`chat`,label:`Answer in a chat`,tiles:m},{key:`answer`,label:`Answer`,tiles:_},{key:`inbox`,label:`Inbox: ${g}`,tiles:h},{key:`play`,label:`Play and judge`,tiles:[...d,...v.filter(e=>a.has(e.status)).map(e=>o(e,y(e)))]},...b].filter(e=>e.tiles.length)}function PT({ctx:e}){let t=eo(e.board,e.talks),n=NT(e,t),r=e.board.domain.starts&&Jr(e.board)?Yr(e.board):[],i=r.some(e=>e.id===`work`&&e.done)?0:r.filter(e=>!e.done).length;return(0,G.jsxs)(`section`,{className:`feed`,"aria-label":`Waiting for me`,children:[(0,G.jsxs)(`div`,{className:`feed-head`,children:[(0,G.jsx)(`span`,{className:`feed-total`,children:t.length}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h1`,{children:`waiting for me`}),(0,G.jsx)(`span`,{children:`Only you can move these on. Everything else runs or waits on the queue, the clock or a trigger.`})]})]}),!n.length&&!i&&(0,G.jsx)(`div`,{className:`feed-empty`,children:t.length?`A failed run report waits in the row above.`:`Nothing waits for you. Runs go on by themselves.`}),[...i>0?[{key:`design`,label:`Start the game`,tiles:[{key:`design`,cat:`DESIGN`,origin:`${i} of ${r.length} steps left`,title:`The game starts with its design: ${i} of ${r.length} steps to the first work.`,sub:r.find(e=>!e.done)?.label??``,tip:`Open Design`,onOpen:()=>e.go(`design`)}]}]:[],...n].map(e=>(0,G.jsxs)(`section`,{className:`feed-group`,"aria-label":e.label,children:[(0,G.jsxs)(`h2`,{children:[e.label,(0,G.jsx)(`span`,{className:`count needs`,children:e.tiles.length}),(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),e.tiles.length?(0,G.jsx)(Fo,{children:e.tiles.map(({key:e,...t})=>(0,G.jsx)(No,{...t},e))}):null]},e.key))]})}function FT({ctx:e}){let{board:t}=e,n=t.runs,r=e=>t.items.find(t=>t.id===e),i=(n?.active??[]).flatMap(e=>{let t=e.ids.map(r).find(e=>e?.running)??r(e.ids[0]);return t?[{run:e,item:t}]:[]}),a=new Set(i.map(e=>e.item.id)),o=t.items.filter(e=>e.running&&!a.has(e.id)),s=n?.queued??[],c=!!t.domain.harness;return(0,G.jsxs)(`aside`,{className:`live`,"aria-label":`Live runs`,children:[(0,G.jsxs)(`div`,{className:`live-head`,children:[(0,G.jsx)(`h2`,{children:`Live`}),c&&(0,G.jsx)(qa,{ctx:e})]}),!c&&(0,G.jsx)(`div`,{role:`note`,className:`live-note`,children:t.extensions_error?`No run: .ai-factory.json cannot be read, so the board knows no harness. Fix the file; every manual move works meanwhile.`:`No harness in this project: nothing runs from the board. Items, moves, verdicts, the inbox and settings all work.`}),c&&!i.length&&!o.length&&(0,G.jsx)(`div`,{className:`live-note`,children:n?.paused?`Nothing runs: the queue is paused.`:`Nothing runs now.`}),i.map(({run:t,item:n})=>{let r=fa(n),i=n.plan&&!(`error`in n.plan)?n.plan:null;return(0,G.jsxs)(`article`,{className:`live-run`,children:[(0,G.jsxs)(`div`,{className:`live-run-head`,children:[(0,G.jsxs)(`button`,{className:`live-run-id`,onClick:()=>e.openItem(n.id),children:[(0,G.jsx)(`span`,{children:n.id}),n.title&&(0,G.jsx)(`small`,{children:n.title})]}),!r&&n.active_at&&(0,G.jsx)(Vi,{at:n.active_at})]}),r&&(0,G.jsxs)(`div`,{className:`live-limit`,title:`The usage limit is one for the account. The run waits for the reset by itself and goes on in the same session; the queue waits behind it.`,children:[`◷ `,da(r,n.resume?.reserve),(0,G.jsx)(`span`,{children:`waits for the reset by itself · Go on now if you reset it early · Stop ends the wait: paused: limit, the queue goes on`}),(0,G.jsx)(ma,{ctx:e,of:{id:n.id}})]}),t.ids.length>1&&(0,G.jsxs)(`span`,{className:`live-batch`,children:[`item `,t.ids.indexOf(n.id)+1,` of `,t.ids.length,`: `,t.ids.join(`, `)]}),i&&(0,G.jsxs)(`div`,{className:`live-plan`,title:`Plan checkboxes done / total`,children:[(0,G.jsx)(`span`,{children:`tasks`}),(0,G.jsx)(`span`,{className:`bar`,"aria-hidden":`true`,children:(0,G.jsx)(`span`,{style:{width:`${Math.round(100*i.done/Math.max(1,i.tasks))}%`}})}),(0,G.jsxs)(`span`,{className:`mono`,children:[i.done,` of `,i.tasks]})]}),(0,G.jsxs)(`div`,{className:`live-run-foot`,children:[(0,G.jsxs)(`span`,{children:[`this board · `,t.mode,` · started `,ra(t.started),t.model||t.effort?` · on ${[t.model,t.effort].filter(Boolean).join(` · `)}`:``]}),(0,G.jsx)(`button`,{className:`btn`,onClick:()=>e.openItem(n.id),children:`Follow`}),(0,G.jsx)(`button`,{className:`btn-danger`,title:r?`Ends the wait for the reset: it becomes paused: limit, Run resumes it later, and the queue goes on`:`Stops the agent session; the item stays ready and its work is kept`,onClick:()=>void Ja(e,n),children:`Stop`})]})]},t.started+n.id)}),o.map(t=>(0,G.jsxs)(`button`,{className:`live-other`,onClick:()=>e.openItem(t.id),children:[(0,G.jsxs)(`span`,{className:`live-other-kind`,children:[`◐ `,ta(t),t.running_kind!==`session`&&t.active_at&&(0,G.jsx)(Vi,{at:t.active_at})]}),(0,G.jsx)(`span`,{className:`live-other-id`,children:t.id}),(0,G.jsx)(`span`,{className:`live-other-note`,children:t.running_kind===`session`?`no log: an interactive session`:`no run report: started from a console`})]},t.id)),c&&(0,G.jsxs)(`section`,{className:`live-queue`,"aria-label":`Run queue`,children:[(0,G.jsxs)(`h3`,{children:[`Queue · `,s.length,n?.paused?` · paused`:``]}),!s.length&&(0,G.jsx)(`span`,{className:`live-empty`,children:`empty`}),s.map((t,i)=>{let a=r(t)?.waits_for??[],o=n?.queued_with?.[t];return(0,G.jsxs)(`div`,{className:`live-q`,children:[(0,G.jsxs)(`span`,{className:`mono`,children:[`#`,i+1]}),(0,G.jsxs)(`button`,{className:`live-q-id`,onClick:()=>e.openItem(t),children:[(0,G.jsx)(`span`,{children:t}),o&&(0,G.jsxs)(`small`,{title:`What it will run on: this run's pick`,children:[`on `,[o.model??`its own model`,o.effort].filter(Boolean).join(` · `)]}),a.length>0&&(0,G.jsxs)(`small`,{children:[`⧗ waits for `,a.join(`, `)]})]}),(0,G.jsx)(Po,{label:`Remove from queue`,tip:`Remove from queue; it asks nothing`,onClick:()=>void e.unqueue(t)})]},t)})]}),(n?.acts??[]).length>0&&(0,G.jsxs)(`section`,{className:`live-acts`,"aria-label":`What ran by itself`,children:[(0,G.jsx)(`h3`,{children:`What ran by itself`}),[...n?.acts??[]].reverse().slice(0,12).map((e,t)=>(0,G.jsxs)(`div`,{className:`live-act`,children:[(0,G.jsx)(`span`,{children:ra(e.at)}),(0,G.jsx)(`span`,{children:e.text})]},t))]})]})}function IT({ctx:e}){return(0,G.jsxs)(`div`,{className:`command`,children:[(0,G.jsx)(PT,{ctx:e}),(0,G.jsx)(FT,{ctx:e})]})}function LT({ctx:e,talk:t}){let n=Ox(se(e.project.name,{talk:t.id})),r=dS(n.length),i=fC(e,t,n),a=Mb(n),o=(0,v.useRef)(null);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`c-stream`,ref:r.ref,onScroll:r.onScroll,role:`log`,"aria-live":`polite`,"aria-relevant":`additions`,children:[!n.length&&(0,G.jsx)(`div`,{className:`tab-empty`,children:t.title?`Your message is sent: the agent starts and takes it in.`:`Write the first message: it starts an agent.`}),(0,G.jsx)(qx,{ctx:e,part:i,onReply:e=>o.current?.(e)})]}),(0,G.jsx)(fS,{follow:r}),(0,G.jsx)(dC,{stream:r.ref,onReply:e=>o.current?.(e)}),(0,G.jsx)(cS,{ctx:e,part:i,quote:o,costLabel:`this thread`,placeholder:a.phase===`limit`?`Write now: the agent takes it in after the reset`:a.live?`Message the agent…`:`Message: it starts the agent, who remembers this thread`,onSend:async n=>({id:(await H.sendTalk(e.project.name,t.id,uS(n))).id})})]})}function RT({ctx:e,onMade:t}){let n=(0,v.useRef)(null);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`c-stream`,children:(0,G.jsx)(`div`,{className:`tab-empty`,children:`Write the first message: it starts an agent, and its first line becomes the thread's title.`})}),(0,G.jsx)(cS,{ctx:e,part:{key:`new`,events:[],talk:``,send:async()=>{},imageUrl:()=>``,imagePath:()=>``},costLabel:`this thread`,placeholder:`First message: it makes the thread, and its first line becomes the title`,onSend:async r=>{n.current??=(await H.newTalk(e.project.name)).id;let i=n.current,a=await H.sendTalk(e.project.name,i,uS(r));return e.reloadTalks(),t(i),{id:a.id}}})]})}function zT(e){return[e.running?`running`:e.handoff?e.status===`awaiting-decision`?`decision waits`:`verdict waits`:e.status,e.run_end?.at&&`run ended ${ia(e.run_end.at)}`].filter(Boolean).join(` · `)}function BT({ctx:e,thread:t}){let[n,r]=(0,v.useState)(`all`),i=(0,v.useRef)(void 0),{board:a,talks:o}=e;if(!a.domain.chat)return(0,G.jsx)(`div`,{className:`page`,children:(0,G.jsxs)(`div`,{role:`note`,className:`empty-box chat-old`,children:[(0,G.jsx)(`b`,{children:`No project chat in this project`}),(0,G.jsx)(`span`,{children:`Its core is older than 0.12. Runs and their chats still work.`}),(0,G.jsx)(`code`,{children:`update gcf-aif-ext to 0.12`})]})});let s=[...new Set(o.flatMap(e=>e.item?[e.item]:[]))],c=a.items.map(e=>e.id).filter(e=>!s.includes(e)),l=o.filter(e=>n===`all`||e.item===n),u=l.find(e=>e.id===i.current)??l[0];i.current=t?void 0:u?.id;let d=t===`new`?null:o.find(e=>e.id===t)??(t?null:u),f=t===`new`||!d&&!o.length,p=t=>e.go(`chat`,t),m=new Set((a.inbox??[]).map(e=>e.id)),h=e=>e?.item?a.items.find(t=>t.id===e.item)??null:null,g=h(d);return(0,G.jsxs)(`div`,{className:`chat-screen ${t?`has-thread`:``}`,children:[(0,G.jsxs)(`aside`,{className:`threads`,"aria-label":`Threads of the project chat`,children:[(0,G.jsxs)(`div`,{className:`threads-head`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h1`,{children:`Project chat`}),(0,G.jsx)(`button`,{className:`btn`,title:`Start a thread: its title is the first line of your first message`,onClick:()=>p(`new`),children:`+ New thread`})]}),(0,G.jsxs)(`select`,{className:`input`,"aria-label":`Filter threads by item`,value:n,onChange:e=>r(e.target.value),children:[(0,G.jsx)(`option`,{value:`all`,children:`all threads`}),s.map(e=>(0,G.jsxs)(`option`,{value:e,children:[`item: `,e]},e)),c.map(e=>(0,G.jsxs)(`option`,{value:e,children:[`item: `,e,` · no thread yet`]},e))]})]}),(0,G.jsxs)(`div`,{className:`threads-list`,children:[n!==`all`&&!l.length&&(0,G.jsxs)(`div`,{className:`threads-none`,children:[(0,G.jsxs)(`p`,{children:[`No thread for `,n,` yet.`]}),(0,G.jsx)(Ls,{label:`Ask about this item`,tip:`Opens the Chat tab of ${n}: your first question makes its bound thread`,glyph:`chat`,onClick:()=>e.openItem(n,`chat`)})]}),l.map(t=>{let n=t.proposals.map(e=>`${e.move??`item-new`} ${e.state}${e.item?` → ${e.item}`:``}`).join(` · `);return(0,G.jsxs)(`button`,{className:`thread-row`,"aria-current":d?.id===t.id?`true`:void 0,onClick:()=>p(t.id),children:[(0,G.jsxs)(`span`,{className:`thread-title`,children:[t.waiting&&(0,G.jsx)(`span`,{className:`needs-dot`,"aria-label":`waiting for you`,title:`A permission or question card waits for you: it is in "waiting for me"`,children:`●`}),(0,G.jsx)(`span`,{className:t.title===null?`dim`:``,children:t.title??`untitled · no message yet`})]}),(0,G.jsxs)(`span`,{className:`thread-meta`,children:[t.item&&(0,G.jsxs)(`span`,{title:`The thread is bound to this item`,children:[`▸ `,t.item]}),h(t)&&(0,G.jsx)(`span`,{className:`thread-card`,title:`Where its card stands on the board`,children:zT(h(t))}),t.start&&(0,G.jsxs)(`span`,{title:`Opened from the Design screen: it follows its own skill`,children:[`✎ `,e.board.domain.starts?.[t.start]?.label??t.start]}),t.entry&&(0,G.jsxs)(`span`,{title:`Drafts an item from this inbox entry`,children:[`◇ `,t.entry,m.has(t.entry)?``:` · erased`]}),(0,G.jsx)(`span`,{title:`Last message, yours or the agent's: the list goes by it`,children:ia(t.used_at)}),(0,G.jsxs)(`span`,{title:`What its agents cost`,children:[`$`,t.cost_usd.toFixed(2)]}),(0,G.jsx)(`span`,{className:t.limit_until?`is-limit`:t.live?`is-live`:``,title:`Whether its agent runs now`,children:t.limit_until?`limit: resumes ${ia(t.limit_until)}`:t.live?`agent live`:`agent closed`})]}),n&&(0,G.jsx)(`span`,{className:`thread-props`,children:n})]},t.id)})]})]}),(0,G.jsxs)(`section`,{className:`thread`,"aria-label":`Thread`,children:[(0,G.jsxs)(`div`,{className:`thread-head`,children:[(0,G.jsx)(`button`,{className:`d-back`,"aria-label":`Back to the threads`,onClick:()=>e.go(`chat`),children:`‹`}),(0,G.jsx)(`h2`,{title:d?.title??void 0,children:f?`New thread`:d?.title??`untitled · no message yet`}),!f&&d&&!g&&(0,G.jsx)(Jx,{ctx:e}),d?.entry&&(m.has(d.entry)?(0,G.jsxs)(`button`,{className:`btn-line mono`,title:`The inbox entry this thread drafts from: open the inbox`,onClick:()=>e.go(`inbox`),children:[`◇ `,d.entry]}):(0,G.jsxs)(`span`,{className:`mono dim small`,title:`The entry is erased or taken: the thread stays`,children:[`◇ `,d.entry,` · erased`]})),d?.item&&(0,G.jsx)(`button`,{className:`btn-line`,title:`Open the card ${d.item}: this thread is its own`,onClick:()=>e.openItem(d.item??``,`chat`),children:g?`Open card`:`▸ ${d.item}`})]}),f?(0,G.jsx)(RT,{ctx:e,onMade:p}):d&&g?(0,G.jsx)(pC,{ctx:e,item:g},d.id):d?(0,G.jsx)(LT,{ctx:e,talk:d},d.id):(0,G.jsx)(`div`,{className:`c-stream`,children:(0,G.jsx)(`div`,{className:`tab-empty`,children:`This thread is not in the list: pick one.`})})]})]})}var VT=[`start`,`pillars`,`vision`,`glossary`,`units`,`questions`,`designer`],HT={start:`Start`,pillars:`Pillars`,vision:`Vision & scope`,glossary:`Glossary`,units:`Units`,questions:`Questions`,designer:`Designer`},UT=[`mechanic`,`resource`,`rule`,`constraint`,`entity`],WT={line:`One line`,lines:`Lines: one per line`,records:`Records: each record's keys side by side; add or remove a record`},GT=[[`Your GDD is kept`,`in gcf/source/, each section anchored: a new version shows what changed.`],[`Design units`,`in gcf/design/, by subsystem: each slot is a word-for-word quote of the GDD, or TBD.`],[`Their order`,`in backlog.md.`],[`Questions`,`here and in Inbox: what the GDD leaves open (Decision needed) and what the agent assumed (Assumption to check).`],[`Drafts of the vision and the glossary`,`you confirm them in the thread.`],[`Pillar candidates`,`for the pillars step.`],[`Nothing on the board`,`no item is made: a unit becomes work only when you take it into work.`]],KT=e=>e.replace(/_/g,` `),qT=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function JT({st:e,k:t,unit:n,system:r,primary:i}){let a=e.s;return a?(0,G.jsx)(Ls,{label:e.busy?`Starting…`:a.label,tip:e.tip,glyph:Is(t),primary:i,starting:e.busy,off:e.off||a.takes===`unit`&&!n||a.takes===`system`&&!r,onClick:()=>void e.go(a.takes===`unit`?{unit:n}:a.takes===`system`?{system:r}:{}),file:a.takes===`file`?t=>void e.pick(t):void 0}):null}function YT({ctx:e,k:t,unit:n,system:r,named:i,primary:a}){let o=kc(e,t);if(!o.s)return null;let s=(0,G.jsx)(JT,{st:o,k:t,unit:n,system:r,primary:a});return i?(0,G.jsxs)(`span`,{className:`agent-act`,children:[s,o.busy?`Starting…`:o.s.label]}):s}function XT({ctx:e,k:t,primary:n}){let r=kc(e,t,!0);return r.s?(0,G.jsxs)(`div`,{className:`design-way`,children:[(0,G.jsxs)(`div`,{className:`design-way-head`,children:[(0,G.jsx)(JT,{st:r,k:t,primary:n}),(0,G.jsx)(`span`,{className:`design-way-label`,children:r.busy?`Starting…`:r.s.label})]}),(0,G.jsx)(`span`,{className:`design-note`,children:r.s.help}),r.s.takes===`file`&&(0,G.jsx)(`span`,{className:`design-fine`,children:`.md, up to 5 MB · a Word or Google document: save it as markdown first`}),r.err&&(0,G.jsx)(`span`,{role:`alert`,className:`design-err`,children:r.err})]}):null}function ZT({ctx:e,label:t,big:n}){let r=kc(e,`ingest`);return r.s?(0,G.jsxs)(`label`,{className:`design-pick${n?` big`:``}${r.off?` off`:``}`,title:r.tip,"aria-disabled":r.off||void 0,children:[r.busy?`Starting…`:t,(0,G.jsx)(`input`,{type:`file`,accept:`.md,text/markdown`,"aria-label":n?`Pick the same GDD again`:`Import a new version: pick the GDD`,disabled:r.off,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&r.pick(t)}})]}):null}function QT({ctx:e,k:t,label:n,help:r}){let i=kc(e,t),[a,o]=(0,v.useState)(``);if(!i.s)return null;let s=`design-rev-${t}`;return(0,G.jsxs)(`div`,{className:`design-panel`,children:[(0,G.jsx)(`label`,{htmlFor:s,className:`design-revise-label`,children:n}),(0,G.jsx)(`span`,{className:`design-note`,children:r}),(0,G.jsxs)(`div`,{className:`design-revise-row`,children:[(0,G.jsx)(`input`,{id:s,className:`design-input`,placeholder:`what to change, in your words`,value:a,onChange:e=>o(e.target.value)}),(0,G.jsx)(Ls,{label:i.busy?`Starting…`:i.s.label,tip:!i.off&&!a.trim()?`Say first what to change`:i.tip,glyph:Is(t),starting:i.busy,off:i.off||!a.trim(),onClick:()=>void i.go({text:a})})]})]})}function $T({label:e,aria:t,v:n,onChange:r,name:i}){let a=ci(n);return(0,G.jsxs)(`label`,{className:`design-cell`,children:[(0,G.jsx)(`span`,{children:e}),(0,G.jsx)(`input`,{className:`design-input${a?` tbd`:``}${i?` strong`:``}`,"aria-label":t,placeholder:a?`TBD`:``,value:a?``:n,onChange:e=>r(e.target.value===``&&a?`TBD`:e.target.value)})]})}function eE({f:e,value:t,edited:n,compact:r,onChange:i,toText:a}){let o=e.form===`scalar`?`line`:e.form===`record-list`?`records`:`lines`,s=`design-f-${e.key}`,c=KT(e.key),l=e.value===`TBD`&&ti(t),u=o===`records`&&Array.isArray(t)?t:[],d=u.reduce((e,t)=>e+Object.values(t).filter(ci).length,0),f=ti(t),p=l?[`TBD`,e.note].filter(Boolean).join(` · `):f?[e.required?`empty`:``,e.note].filter(Boolean).join(` · `):``,m=(0,G.jsxs)(`div`,{className:`design-fhead${r?` compact`:``}`,children:[(0,G.jsx)(`label`,{htmlFor:s,className:`design-fkey`,children:c}),!r&&o===`lines`&&(0,G.jsx)(`span`,{className:`design-fkind`,title:WT.lines,children:`one per line`}),(l||d>0)&&(0,G.jsx)(`span`,{className:`design-tbd-badge`,title:l?`To be decided: the slot is open. A unit with a TBD cannot go into work`:`${d} record value${d>1?`s are`:` is`} TBD`,children:l?`TBD`:`TBD ${d}`}),n&&(0,G.jsx)(`span`,{className:`design-changed`,children:`changed`}),(0,G.jsx)(`span`,{className:`design-spacer`}),e.required?f&&!l?(0,G.jsx)(`span`,{className:`design-req empty`,title:`Required: the part does not hold without it`,children:`● required · empty`}):(0,G.jsx)(`span`,{className:`design-req`,title:`Required: it cannot be left empty (TBD keeps it open)`,children:`● required`}):(0,G.jsx)(`span`,{className:`design-req opt`,title:`Optional: it may stay empty`,children:`optional`})]}),h=e.note&&(0,G.jsx)(`span`,{className:r?`design-fnote small`:`design-fnote`,children:e.note});if(!e.exact){let t=e.value,n=Array.isArray(t)?t.map(e=>typeof e==`object`?Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(` · `):e).join(`
111
- `):String(t??``);return(0,G.jsxs)(`div`,{className:`design-field`,children:[m,!r&&h,(0,G.jsxs)(`div`,{className:`design-ro${r?` compact`:``}`,title:`This slot holds text the form cannot keep (a comment, prose): edit as text edits the whole part`,children:[(0,G.jsx)(`span`,{className:`design-ro-text`,children:n}),(0,G.jsxs)(`span`,{className:`design-ro-side`,children:[!r&&(0,G.jsx)(`span`,{children:`read only`}),(0,G.jsx)(`button`,{className:`design-ro-btn`,onClick:a,children:`edit as text`})]})]}),!r&&(0,G.jsx)(`span`,{className:`design-ro-why`,children:`it holds text a form cannot keep: edit the part as text`}),r&&h]})}if(o===`line`)return(0,G.jsxs)(`div`,{className:`design-field`,children:[m,!r&&h,(0,G.jsx)(`input`,{id:s,className:`design-input${l?` tbd`:``}`,value:String(t),title:r?e.note??void 0:void 0,disabled:e.header&&e.key===`type`,placeholder:p,onChange:e=>i(e.target.value)}),r&&h]});if(o===`lines`)return(0,G.jsxs)(`div`,{className:`design-field`,children:[m,h,(0,G.jsx)(`textarea`,{id:s,className:`design-input design-lines${l?` tbd`:``}`,"aria-label":`${c}: one per line`,rows:Math.max(2,String(t).split(`
112
- `).length+1),value:String(t),placeholder:p,onChange:e=>i(e.target.value)})]});let g=di(e,u),_=(e,t,n)=>i(u.map((r,i)=>i===e?{...r,[t]:n}:r));return(0,G.jsxs)(`div`,{className:`design-field`,children:[m,h,(0,G.jsxs)(`div`,{className:`design-recs`,id:s,children:[(0,G.jsxs)(`div`,{className:`design-rec-headrow`,"aria-hidden":`true`,children:[g.map(e=>(0,G.jsx)(`span`,{children:KT(e)},e)),(0,G.jsx)(`span`,{className:`design-rec-gap`})]}),u.map((e,t)=>(0,G.jsxs)(`div`,{className:`design-rec-row`,children:[g.map(n=>n===`id`?(0,G.jsxs)(`span`,{className:`design-cell`,children:[(0,G.jsx)(`span`,{children:`id`}),(0,G.jsx)(`span`,{className:`design-rec-id`,children:e.id||`made from the name on save`})]},n):(0,G.jsx)($T,{label:KT(n),aria:`${c} ${t+1}: ${KT(n)}`,v:e[n]??``,onChange:e=>_(t,n,e)},n)),(0,G.jsx)(Po,{label:`Remove record ${t+1} of ${c}`,onClick:()=>i(u.filter((e,n)=>n!==t))})]},t)),l&&(0,G.jsx)(`span`,{className:`design-tbd-none`,children:`TBD: no record yet`}),(0,G.jsx)(`button`,{className:`design-add`,title:`Add a record: each key empty`,onClick:()=>i([...u,Object.fromEntries(g.map(e=>[e,``]))]),children:`+ record`})]})]})}function tE({ctx:e,f:t,value:n,saved:r,onChange:i}){let a=fi(e.board.domain,e.board.domain.sections.design?.retire),o=Jr(e.board)?.pillars??[],s=n,c=Array.isArray(r)?r:[],l=di(t,s).filter(e=>e!==`id`&&e!==`name`),u=(e,t,n)=>i(s.map((r,i)=>i===e?{...r,[t]:n}:r)),d=new Set([...c,...s].map(e=>e.id).filter(Boolean)),[f,p]=(0,v.useState)(null);return(0,G.jsxs)(`div`,{className:`design-pillars`,children:[s.map((t,n)=>{let r=t.id??``,f=c.find(e=>e.id===r),m=!!(r&&f),h=(t.name??``).trim(),g=(f?.name??``).trim(),_=h?ai(h,e=>e!==r&&d.has(e)):``,v=o.find(e=>e.id===r)?.units,y=v===void 0?m?``:`not saved yet`:`${v} ${v===1?`unit cites`:`units cite`} it`;return(0,G.jsxs)(`article`,{className:`design-pillar-card`,children:[(0,G.jsxs)(`div`,{className:`design-pillar-top`,children:[(0,G.jsxs)(`div`,{className:`design-pillar-head`,children:[(0,G.jsx)(`span`,{className:`design-pillar-title${!h&&m?` mono`:``}`,children:h||(m?r:`New pillar`)}),(0,G.jsxs)(`span`,{className:`design-pillar-line`,children:[(0,G.jsx)(`code`,{title:m?`The pillar's id: units cite it in pillars:. The system keeps it; a new name renames it after the save.`:`A new pillar gets its id from its name`,children:m?r:h?`its id: ${_}`:`its id comes from its name`}),(0,G.jsx)(`span`,{title:`Units whose pillars cite it`,children:y})]})]}),m&&!g&&(0,G.jsx)(YT,{ctx:e,k:`name-pillars`}),m&&a&&(0,G.jsx)(`button`,{className:`design-danger small`,title:`The game no longer holds it: units left with no pillar read pillars: TBD`,onClick:()=>p(r),children:`Retire…`}),!m&&(0,G.jsx)(Po,{label:`Remove record ${n+1} of pillars`,tip:`Remove this pillar: it is not saved yet`,onClick:()=>i(s.filter((e,t)=>t!==n))})]}),(0,G.jsxs)(`label`,{className:`design-cell`,children:[(0,G.jsx)(`span`,{children:`name`}),(0,G.jsx)(`input`,{className:`design-input strong`,"aria-label":`Pillar ${n+1}: name`,placeholder:m?`no name yet: a few words you know it by`:`a few words you know it by`,value:t.name??``,onChange:e=>u(n,`name`,e.target.value)})]}),m&&g&&h&&h!==g&&_!==r&&(0,G.jsxs)(`span`,{className:`design-note`,children:[`↻ Save renames `,r,` → `,_,` wherever it is cited: a second commit after the save.`]}),l.map(e=>(0,G.jsx)($T,{label:KT(e),aria:`Pillar ${n+1}: ${KT(e)}`,v:t[e]??``,onChange:t=>u(n,e,t)},e))]},n)}),(0,G.jsxs)(`button`,{className:`design-add`,title:`A new pillar: name, statement, invariant, review question; its id comes from its name`,onClick:()=>i([...s,Object.fromEntries([`name`,...l].map(e=>[e,``]))]),children:[`+ pillar · `,s.length,` of 2 to 7`]}),f&&(0,G.jsx)(hE,{ctx:e,kind:`retire`,id:f,onClose:()=>p(null)})]})}function nE({ctx:e,kind:t,name:n,rows:r=18}){let i=e.board.domain.sections.design,[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)({}),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(!1),b=()=>H.designPart(e.project.name,t,n).then(e=>{let t=Object.fromEntries(e.fields.map(e=>[e.key,Qr(e)]));o(e),c(t),u(t),m(e.text),g(``)},e=>g(e.message)),x=a?ei(a.fields,s,l):{},S=Object.keys(x).length,C=S>0||d&&p!==a?.text,w=Jr(e.board)?.unrecorded??[],T=`${e.board.head??``} ${w.join(`,`)}`;if((0,v.useEffect)(()=>{C||b()},[t,n,T]),h)return(0,G.jsxs)(`p`,{className:`error-text`,children:[`✘ `,h]});if(!a||!i)return(0,G.jsxs)(`p`,{className:`dim`,children:[`reading `,n,`…`]});let E=async()=>{y(!0);let r=await e.move({id:n,kind:t,base:a.base??void 0,...d?{cmd:i.save_text,text:p}:{cmd:i.save,fields:JSON.stringify(x)}});y(!1),r&&(f(!1),await b())},D=!!(a.file&&w.includes(a.file)),O=C&&!_,k=r=>t===`doc`&&n===`pillars`&&r.key===`pillars`&&r.exact?(0,G.jsx)(tE,{ctx:e,f:r,value:l[r.key],saved:s[r.key],onChange:e=>u({...l,[r.key]:e})},r.key):(0,G.jsx)(eE,{f:r,value:l[r.key],edited:r.key in x,compact:t===`unit`&&!!r.header,onChange:e=>u({...l,[r.key]:e}),toText:()=>f(!0)},r.key),A=a.fields.filter(e=>t===`unit`&&e.header),j=a.fields.filter(e=>!(t===`unit`&&e.header));return(0,G.jsxs)(`div`,{className:`design-form`,children:[d?(0,G.jsxs)(`div`,{className:`design-astext`,children:[(0,G.jsxs)(`span`,{className:`design-note`,children:[`The whole `,t===`unit`?`unit`:`part`,` as text, as it is in`,` `,a.file??`its file`,`. Save text writes all of it.`]}),(0,G.jsx)(`textarea`,{className:`design-input design-text`,"aria-label":`${n} as text`,rows:r,value:p,onChange:e=>m(e.target.value)})]}):t===`unit`?(0,G.jsxs)(`div`,{className:`design-fields`,children:[(0,G.jsxs)(`div`,{className:`design-group`,children:[(0,G.jsx)(`h3`,{className:`design-h3`,children:`Header`}),(0,G.jsx)(`div`,{className:`design-header-grid`,children:A.map(k)})]}),(0,G.jsxs)(`div`,{className:`design-group`,children:[(0,G.jsxs)(`h3`,{className:`design-h3`,children:[`Blocks of a `,a.type]}),(0,G.jsx)(`div`,{className:`design-fields`,children:j.map(k)})]})]}):(0,G.jsx)(`div`,{className:`design-fields`,children:j.map(k)}),(0,G.jsxs)(`div`,{className:`design-savebar`,children:[D&&(0,G.jsxs)(`span`,{className:`design-wait`,children:[`⧗ `,a.file,` holds a change not recorded yet, a draft perhaps: you see it in the form, and Save records it along with your edits.`]}),(0,G.jsxs)(`span`,{className:`design-base`,title:`The part as read: a save is refused if the file changed since`,children:[t===`unit`?`${a.file} · `:``,`read at `,a.base??`—`]}),(0,G.jsx)(`span`,{className:`design-spacer`}),d?(0,G.jsx)(`button`,{className:`design-textbtn`,title:`Back to the form; the text edits are dropped`,onClick:()=>{m(a.text),f(!1)},children:`back to the form`}):(0,G.jsx)(`button`,{className:`design-textbtn`,title:a.fields.some(e=>!e.exact)?`A slot holds text the form cannot keep: edit the whole part as text`:`Edit the whole part as text, as it is in its file`,onClick:()=>f(!0),children:`edit as text`}),(0,G.jsx)(`button`,{className:`design-revert`,disabled:!C||_,title:`Drop the changes`,onClick:()=>void b(),children:`Revert`}),(0,G.jsx)(`button`,{className:`design-save`,disabled:!O,title:D&&C?`gcf design save: your changes and the waiting change of ${a.file}, in one commit`:C?d?`gcf design save: the whole part as text; refused if it changed since it was read`:`gcf design save: only the changed fields; refused if the part changed since it was read, or if the save adds a finding of the design check`:`Nothing changed yet`,onClick:()=>void E(),children:_?`Saving…`:d?`Save text`:S?`Save ${S} ${S===1?`change`:`changes`}`:`Save`})]})]})}function rE({ctx:e,d:t,part:n,go:r}){let i=Yr(e.board),a=i.filter(e=>e.done).length,o=i.length>0&&a===i.length,s=e.board.units??[],c=s.filter(e=>e.ready).length,l=Xr(e.board).filter(e=>e.class!==`D2`&&!e.answer).length,u={start:`${a}/${i.length}`,pillars:String(t.pillars.length),vision:t.game?`✔`:`–`,glossary:String(t.glossary??0),units:String(s.length),questions:String(l),designer:``},d={start:`${a} of ${i.length} steps done`,pillars:`${t.pillars.length} pillars`,vision:t.game?`game.md exists`:`no game.md yet`,glossary:`${t.glossary??0} terms`,units:`${s.length} live units · ${c} ready`,questions:`${l} waiting for your answer`,designer:`Export the whole design as one markdown file, or import it back`},f=e=>e===`questions`&&l?` needs`:e===`start`&&o?` ok`:``,p=o?[...VT.slice(1),VT[0]]:VT,m=`${a} of ${i.length} steps done`;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`nav`,{className:`design-nav`,"aria-label":`Parts of the design`,children:[(0,G.jsxs)(`div`,{className:`design-nav-head`,children:[(0,G.jsx)(`h1`,{children:`Design`}),(0,G.jsx)(`span`,{title:`design.steps: what the framework counts done`,children:m})]}),p.map(e=>(0,G.jsxs)(`button`,{className:`design-nav-btn`,"aria-current":e===n||void 0,title:d[e],onClick:()=>r(e),children:[(0,G.jsx)(`span`,{children:HT[e]}),u[e]&&(0,G.jsx)(`span`,{className:`design-count${f(e)}`,children:u[e]})]},e)),(0,G.jsx)(`p`,{className:`design-nav-note`,children:`Nothing here is work yet: a unit becomes a card on the board only when it is taken into work.`})]}),(0,G.jsxs)(`div`,{className:`design-bar`,children:[(0,G.jsxs)(`div`,{className:`design-bar-head`,children:[(0,G.jsx)(`h1`,{children:`Design`}),(0,G.jsx)(`span`,{children:m})]}),(0,G.jsx)(`div`,{role:`tablist`,"aria-label":`Parts of the design`,className:`design-bar-tabs`,children:p.map(e=>(0,G.jsxs)(`button`,{role:`tab`,className:`design-bar-tab`,"aria-selected":e===n,title:d[e],onClick:()=>r(e),children:[HT[e],u[e]&&(0,G.jsx)(`span`,{className:`design-count${f(e)}`,children:u[e]})]},e))})]})]})}function iE({ctx:e,d:t,go:n}){let r=e.board.domain.sections.design,i=fi(e.board.domain,r?.commit),a=fi(e.board.domain,r?.discard),o=t.unrecorded,[s,c]=(0,v.useState)(null);return o.length?(0,G.jsxs)(`section`,{className:`design-unrec`,"aria-label":`Not recorded yet`,children:[(0,G.jsxs)(`div`,{className:`design-unrec-main`,children:[(0,G.jsxs)(`div`,{className:`design-unrec-head`,children:[(0,G.jsx)(`h2`,{children:`Not recorded yet`}),(0,G.jsxs)(`span`,{children:[o.length===1?`1 file waits`:`${o.length} files wait`,` to be recorded`]})]}),(0,G.jsx)(`div`,{className:`design-unrec-files`,children:o.map(e=>{let t=ni(e);return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`code`,{title:`Written by a design thread or an agent's draft; git has not recorded it yet`,children:e}),t&&(0,G.jsx)(`button`,{className:`design-open`,title:`Edit it in its part's form: a save of the part records the draft along with your edits`,onClick:()=>n(t),children:`open in its form →`})]},e)})}),(0,G.jsx)(`span`,{className:`design-note`,children:`Look it over, then record it: one commit. Or edit it in its form: the save takes it along. A save that touches another waiting file waits for it.`})]}),(0,G.jsxs)(`div`,{className:`design-unrec-acts`,children:[i&&(0,G.jsx)(`button`,{className:`design-rec`,title:t.blocking?`gcf design commit: refused while the design check has findings; the dialog gives the framework's answer`:`gcf design commit: one commit of the files that wait`,onClick:()=>c(`record`),children:`Record design…`}),a&&o.some(ri)&&(0,G.jsx)(`button`,{className:`design-danger`,title:`gcf design discard: the draft's files as the last record has them, a new one deleted; it asks first`,onClick:()=>c(`discard`),children:`Discard draft…`})]}),s&&(0,G.jsx)(hE,{ctx:e,kind:s,onClose:()=>c(null)})]}):null}function aE({ctx:e,d:t,go:n}){let r=e.board.units??[];return t.blocking?(0,G.jsxs)(`section`,{className:`design-findings`,"aria-label":`Findings of the design check`,children:[(0,G.jsxs)(`div`,{className:`design-findings-head`,title:`design.blocking: findings of the design check that hold every commit`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`!`}),(0,G.jsxs)(`span`,{children:[qT(t.blocking,`blocking finding`),` of the design check: nothing commits until the check is clean. A save that clears the last one goes.`]})]}),(0,G.jsx)(`ul`,{children:(t.findings??[]).map((e,t)=>{let i=r.some(t=>t.id===e.id);return(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`span`,{className:`design-find-where`,children:[(0,G.jsx)(`code`,{className:`design-find-check`,title:`The check that found it`,children:e.check}),(0,G.jsxs)(`code`,{children:[e.file,e.line==null?``:`:${e.line}`]})]}),(0,G.jsxs)(`span`,{className:`design-find-main`,children:[(0,G.jsx)(`span`,{className:`design-find-msg`,children:e.message}),i?(0,G.jsxs)(`button`,{className:`design-find-open`,title:`Open the unit ${e.id}`,onClick:()=>n(`units:${e.id}`),children:[`open `,e.id,` →`]}):e.id&&(0,G.jsx)(`span`,{className:`design-find-id`,title:`${e.id} is not a unit: fix it in ${e.file}`,children:e.id})]})]},t)})})]}):null}function oE({ctx:e,file:t,importing:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),s=async()=>{if(o(!a),!a)try{i((await H.file(e.project.name,t)).text)}catch{i(``)}},c=li(r??``);return(0,G.jsxs)(`div`,{className:`design-source-card`,children:[(0,G.jsxs)(`div`,{className:`design-source-row`,children:[(0,G.jsx)(`code`,{children:t}),(0,G.jsx)(`button`,{className:`design-small-btn`,"aria-expanded":a,title:`Its text as kept in gcf/source/, by its anchored sections`,onClick:()=>void s(),children:a?`hide`:`view`}),!n&&(0,G.jsx)(ZT,{ctx:e,label:`Import a new version`})]}),n&&(0,G.jsxs)(`div`,{role:`status`,className:`design-importing`,children:[(0,G.jsx)(`span`,{children:`Import unfinished: pick the same GDD again to go on.`}),(0,G.jsx)(ZT,{ctx:e,label:`Pick the same GDD again`,big:!0})]}),a&&(0,G.jsxs)(`div`,{className:`design-gdd`,children:[(0,G.jsxs)(`span`,{className:`design-gdd-head`,children:[t,` · `,c.filter(e=>e.level>1).length,` sections, each anchored`]}),r!==null&&!c.length&&(0,G.jsx)(`span`,{className:`design-gdd-none`,children:`The board could not read the GDD's text.`}),c.map((e,t)=>(0,G.jsxs)(`section`,{children:[(0,G.jsx)(`h4`,{className:e.level===1?`top`:void 0,children:e.h}),e.body&&(0,G.jsx)(`p`,{children:e.body})]},t))]})]})}function sE({ctx:e,d:t,go:n}){let r=e.board.domain.starts??{},i=Yr(e.board),a=e.board.units??[],o=Xr(e.board),[s,c]=(0,v.useState)({}),[l,u]=(0,v.useState)(!1),d=i.filter(e=>e.done).length,f=i.length>0&&d===i.length,p=i.find(e=>!e.done)?.id,m=o.filter(e=>e.class!==`D2`&&!e.answer).length,h=a.filter(e=>e.ready),g=a.filter(e=>e.blocked_by.length),_=Object.keys(t.systems).length,y=t.pillars.some(e=>!e.name),b={design:a.length||t.game?[`${qT(a.length,`design unit`)} in ${qT(_,`subsystem`)}`,t.game?`the vision written (game.md)`:`no vision yet`,t.glossary?`${t.glossary} glossary terms`:``,t.sources[0]?`imported from ${t.sources[0].file.split(`/`).pop()}`:``].filter(Boolean).join(` · `):`nothing yet: no design unit, no vision`,pillars:t.pillars.length?`${qT(t.pillars.length,`pillar`)}: ${t.pillars.map(e=>e.name||`${e.id} (no name yet)`).join(`, `)}`:`no pillar yet: 2 to 7`,questions:m?`${m} waiting for your answer`:o.length?`none waits for your answer`:`no question yet`,work:h.length?`${qT(h.length,`ready unit`)}: ${h.map(e=>e.id).join(`, `)}`:a.length?`no unit is ready yet: each has a TBD or a question`:`no unit yet`},x=(e,t,r)=>(0,G.jsxs)(`button`,{className:`design-link${r?` big`:``}`,onClick:()=>n(e),children:[t,` →`]});return(0,G.jsxs)(`section`,{className:`design-sec design-start`,"aria-label":`Start`,children:[(0,G.jsxs)(`div`,{className:`design-start-head`,children:[(0,G.jsx)(`h2`,{children:f?`The design is set`:d===0?`A game starts with its design`:`From an idea to the first work`}),(0,G.jsx)(`p`,{children:f?`All four steps are done. The pillars and the units change all along the project: their parts are on the left, and Start stays at the end of the list.`:d===0?`Four steps from an idea to the first work. Begin with the game design: bring a GDD, or talk the game through with an agent.`:`Four steps, each done or not by the framework's count. A done step stays here: you may go back to any of them.`})]}),(0,G.jsx)(`ol`,{className:`design-steps`,children:i.map((a,o)=>{let d=a.id===p,f=s[a.id]??(!a.done&&d),_=(a.starts??[]).filter(e=>r[e]&&r[e].takes!==`unit`&&(e!==`name-pillars`||y));return(0,G.jsxs)(`li`,{className:`design-step`,children:[(0,G.jsxs)(`div`,{className:`design-step-rail`,"aria-hidden":`true`,children:[(0,G.jsx)(`span`,{className:`design-step-mark${a.done?` done`:d?` cur`:``}`,children:a.done?`✔`:o+1}),o<i.length-1&&(0,G.jsx)(`span`,{className:`design-step-line`})]}),(0,G.jsxs)(`div`,{className:`design-step-body${d?` cur`:``}`,children:[(0,G.jsxs)(`button`,{className:`design-step-toggle`,"aria-expanded":f,title:f?`Fold the step`:`Open the step and its ways in`,onClick:()=>c({...s,[a.id]:!f}),children:[(0,G.jsxs)(`span`,{className:`design-step-text`,children:[(0,G.jsxs)(`span`,{className:`design-step-titles`,children:[(0,G.jsx)(`span`,{className:`design-step-title${!a.done&&!d?` later`:``}`,children:a.label}),(0,G.jsx)(`span`,{className:`design-step-state${a.done?` done`:d?` cur`:``}`,title:a.done?`The framework counts this step done (design.steps); you may go back to it at any time`:`Not done yet, by the framework's count (design.steps)`,children:a.done?`done`:d?`next`:`not done`})]}),(0,G.jsx)(`span`,{className:`design-step-summary`,children:b[a.id]??``})]}),(0,G.jsx)(`span`,{className:`design-step-fold`,children:f?`Close`:a.done?`Go back to it`:`Open`})]}),f&&(0,G.jsxs)(`div`,{className:`design-step-open`,children:[(0,G.jsx)(`p`,{className:`design-step-help`,children:a.help}),a.id===`design`&&(0,G.jsxs)(`div`,{className:`design-step-design`,children:[(0,G.jsx)(`div`,{className:`design-ways`,children:_.map((t,n)=>(0,G.jsx)(XT,{ctx:e,k:t,primary:n===0},t))}),x(`units`,`or write units by hand`),(0,G.jsxs)(`div`,{className:`design-learn`,children:[(0,G.jsxs)(`button`,{className:`design-learn-btn`,"aria-expanded":l,title:`What the import writes into the project`,onClick:()=>u(!l),children:[l?`▾ `:`▸ `,`What an import gives`]}),l&&(0,G.jsx)(`dl`,{children:GT.map(([e,t])=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:e}),(0,G.jsx)(`dd`,{children:t})]},e))})]}),t.sources.length>0&&(0,G.jsxs)(`div`,{className:`design-sources`,children:[(0,G.jsx)(`h3`,{className:`design-h3`,children:`GDD sources`}),t.sources.map(t=>(0,G.jsx)(oE,{ctx:e,file:t.file,importing:t.importing},t.file))]})]}),a.id!==`design`&&(_.length>0||a.id===`pillars`)&&(0,G.jsxs)(`div`,{className:`design-step-ways`,children:[_.map((t,n)=>(0,G.jsx)(YT,{ctx:e,k:t,named:!0,primary:n===0},t)),a.id===`pillars`&&x(`pillars`,`or write them by hand`)]}),a.id===`questions`&&(0,G.jsxs)(`div`,{className:`design-step-list`,children:[x(`questions`,`${m} waiting for your answer`,!0),g.length>0&&(0,G.jsxs)(`div`,{className:`design-held-list`,children:[(0,G.jsx)(`span`,{children:`Units a question holds`}),g.map(e=>(0,G.jsxs)(`button`,{title:`Open the unit`,onClick:()=>n(`units:${e.id}`),children:[(0,G.jsx)(`span`,{className:`design-held-id`,children:e.id}),(0,G.jsxs)(`span`,{className:`design-held-by`,children:[`held by `,e.blocked_by.join(`, `)]})]},e.id))]})]}),a.id===`work`&&(0,G.jsxs)(`div`,{className:`design-step-list`,children:[h.map(e=>(0,G.jsxs)(`button`,{className:`design-ready`,title:`Open the unit: Fill TBDs with agent takes it into work on your word`,onClick:()=>n(`units:${e.id}`),children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`span`,{className:`design-held-id`,children:e.id}),(0,G.jsx)(`span`,{className:`design-ready-mark`,children:`ready`})]}),(0,G.jsx)(`span`,{className:`design-ready-title`,children:e.title})]},e.id)),x(`units`,`pick a ready unit`),(0,G.jsx)(`span`,{className:`design-fine`,children:`In the unit, Fill TBDs with agent goes through it with you; it goes into work only when you say so.`})]})]})]})]},a.id)})})]})}function cE({ctx:e,d:t}){let n=!t.pillars.length,r=t.pillars.filter(e=>!e.name).length;return(0,G.jsxs)(`section`,{className:`design-sec`,"aria-label":`Pillars`,children:[(0,G.jsxs)(`div`,{className:`design-head`,children:[(0,G.jsxs)(`div`,{className:`design-head-main`,children:[(0,G.jsx)(`h2`,{children:`Pillars`}),(0,G.jsx)(`span`,{className:`design-lead`,children:`What the game always holds: every unit and every review answers to them. One part, gcf/PILLARS.md: Save writes all of them together.`})]}),!n&&(0,G.jsx)(YT,{ctx:e,k:`pillars`})]}),n&&(0,G.jsxs)(`div`,{className:`design-empty-panel`,children:[(0,G.jsx)(`h3`,{children:`PILLARS.md is empty`}),(0,G.jsx)(`span`,{className:`design-empty-text`,children:`The interview starts from candidates the agent draws from the vision and the units: you keep 2 to 7, each with what it forbids and the question a review asks. The draft waits under Not recorded yet until you record it.`}),(0,G.jsx)(YT,{ctx:e,k:`pillars`,primary:!0}),(0,G.jsx)(`span`,{className:`design-fine`,children:`Or write one by hand below.`})]}),r>0&&(0,G.jsxs)(`div`,{className:`design-unnamed`,role:`note`,children:[(0,G.jsxs)(`span`,{children:[r===1?`1 pillar has`:`${r} pillars have`,` no name yet: it shows its id until one is given`]}),(0,G.jsx)(YT,{ctx:e,k:`name-pillars`})]}),(0,G.jsx)(nE,{ctx:e,kind:`doc`,name:`pillars`,rows:14}),!n&&(0,G.jsx)(QT,{ctx:e,k:`revise-pillars`,label:`Revise with agent`,help:`Say what to change: the agent proposes, you confirm in the thread.`})]})}function lE({ctx:e,d:t}){return(0,G.jsxs)(`section`,{className:`design-sec`,"aria-label":`Vision and scope`,children:[(0,G.jsxs)(`div`,{className:`design-head-main`,children:[(0,G.jsx)(`h2`,{children:`Vision & scope`}),(0,G.jsx)(`code`,{className:`design-path`,children:`gcf/game.md`})]}),!t.game&&(0,G.jsxs)(`div`,{className:`design-panel design-novision`,children:[(0,G.jsx)(`span`,{children:`No vision yet. An import drafts it from the GDD; Create with agent writes it in an interview.`}),(0,G.jsx)(YT,{ctx:e,k:`vision`}),(0,G.jsx)(`span`,{className:`design-fine`,children:`Or write it by hand below.`})]}),(0,G.jsx)(nE,{ctx:e,kind:`doc`,name:`game`}),t.game&&(0,G.jsx)(QT,{ctx:e,k:`revise-vision`,label:`Change with agent`,help:`The vision, the scope or the milestones, in your words.`})]})}function uE({ctx:e,d:t}){let n=t.glossary??0;return(0,G.jsxs)(`section`,{className:`design-sec`,"aria-label":`Glossary`,children:[(0,G.jsxs)(`div`,{className:`design-head`,children:[(0,G.jsxs)(`div`,{className:`design-head-main`,children:[(0,G.jsx)(`h2`,{children:`Glossary`}),(0,G.jsxs)(`span`,{className:`design-path`,children:[`GLOSSARY.md · `,n,` terms`]})]}),(0,G.jsx)(YT,{ctx:e,k:`draft-glossary`,primary:!n&&!t.glossary_old})]}),t.glossary_old&&(0,G.jsxs)(`div`,{className:`design-warn-note`,role:`note`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`⚠`}),(0,G.jsx)(`span`,{children:`gcf/glossary.md is read no more (core 0.21): move it to GLOSSARY.md with git mv, give it a purpose line, turn each not: into avoid: (a word wrong in every document) and move units: into gcf/game.md. Until then its words hold nowhere.`})]}),!n&&!t.glossary_old&&(0,G.jsxs)(`p`,{className:`design-empty`,children:[`No glossary yet. Draft with agent writes one from the vision and the units; it waits under Not recorded yet for you to record, edit or discard.`,(0,G.jsx)(`span`,{className:`design-fine design-empty-fine`,children:`Or write it by hand below.`})]}),(!t.glossary_old||n>0)&&(0,G.jsx)(nE,{ctx:e,kind:`doc`,name:`glossary`})]})}function dE({ctx:e,d:t,onClose:n,onMade:r}){let i=e.board.domain.sections.design,a=fi(e.board.domain,i?.new_unit),o=Object.keys(t.systems),s=e=>a?.fields.find(t=>t.key===e),c=s(`type`)?.options?.map(e=>e.value)??UT,[l,u]=(0,v.useState)({system:o[0]??``,type:c.includes(`mechanic`)?`mechanic`:c[0]??``,title:``}),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(void 0),[h,g]=(0,v.useState)(!1);if(!a)return null;let _=(e,t)=>{u({...l,[e]:t}),f(``),m(void 0)},y=(e,t)=>`${s(e)?.label??t} *`,b=!!l.system&&!o.includes(l.system),x=b&&!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(l.system),S=async()=>{let t=[!l.system.trim()&&y(`system`,`Subsystem`),!l.title.trim()&&y(`title`,`Title`)].filter(Boolean);if(t.length)return f(`${t.join(`, `)}: required`);if(x)return f(`system: a subsystem is a lowercase slug (letters, digits, hyphens), e.g. tray-input`);m(void 0),g(!0);let n=await e.moveOut({cmd:a.cmd,...l,fields:`{}`});g(!1);let i=n.out.split(`
113
- `)[0].trim();n.ok&&i?r(i):(f(n.err||`The framework refused it: its answer is in the notice.`),m(n.refusal))};return(0,G.jsx)(De,{onClose:n,dirty:h||!!l.title,children:(0,G.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Add a design unit`,className:`design-dialog`,onClick:e=>e.stopPropagation(),children:[(0,G.jsxs)(`div`,{className:`design-dialog-head`,children:[(0,G.jsx)(`h2`,{children:`Add a design unit`}),(0,G.jsxs)(`span`,{children:[a.help,`. Every block of its type starts TBD; it lands at the end of its subsystem's file and of backlog.md, and opens.`]})]}),(0,G.jsxs)(`div`,{className:`design-dialog-field`,children:[(0,G.jsx)(`span`,{children:y(`system`,`Subsystem`)}),o.length>0&&(0,G.jsx)(`div`,{role:`radiogroup`,"aria-label":`Existing subsystems`,className:`design-sys-chips`,children:o.map(e=>(0,G.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e===l.system,className:`design-sys-chip${e===l.system?` on`:``}`,onClick:()=>_(`system`,e),children:e},e))}),(0,G.jsx)(`input`,{className:`design-input mono${x?` bad`:b?` new`:``}`,"aria-label":o.length?`New subsystem`:`No subsystem yet: name the first one`,value:b?l.system:``,placeholder:o.length?`or a new one: tray-input`:`a new subsystem: tray-input`,onChange:e=>_(`system`,e.target.value.trim())}),b&&(0,G.jsx)(`span`,{className:`design-sys-note${x?` bad`:``}`,children:x?`A subsystem is a lowercase slug: letters, digits and hyphens, e.g. tray-input`:`New: gcf/design/${l.system}.md starts with this unit`})]}),(0,G.jsxs)(`label`,{className:`design-dialog-field`,children:[(0,G.jsx)(`span`,{children:y(`type`,`Type`)}),(0,G.jsx)(`select`,{className:`design-input`,value:l.type,onChange:e=>_(`type`,e.target.value),children:c.map(e=>(0,G.jsx)(`option`,{children:e},e))})]}),(0,G.jsxs)(`label`,{className:`design-dialog-field`,children:[(0,G.jsx)(`span`,{children:y(`title`,`Title`)}),(0,G.jsx)(`input`,{className:`design-input`,value:l.title,onChange:e=>_(`title`,e.target.value)})]}),(0,G.jsxs)(`code`,{className:`design-dialog-cmd`,children:[`gcf design save --kind unit --system `,l.system||`<subsystem>`,` --type`,` `,l.type||`<type>`,` --title `,l.title?(e=>/\s/.test(e)?`"${e}"`:e)(l.title):`<title>`]}),d&&(0,G.jsx)(fE,{ctx:e,error:d,refusal:p}),(0,G.jsxs)(`div`,{className:`design-dialog-acts`,children:[(0,G.jsx)(`button`,{className:`design-cancel`,disabled:h,onClick:n,children:`Cancel`}),(0,G.jsx)(`button`,{className:`design-prim`,disabled:h,onClick:()=>void S(),children:h?`Working…`:`Add unit`})]})]})})}function fE({ctx:e,error:t,refusal:n}){let r=Ie(n);return(0,G.jsxs)(`div`,{role:`alert`,className:`design-dialog-err`,children:[(0,G.jsx)(`span`,{children:(0,G.jsx)(Ce,{text:t,toned:!0})}),r&&(0,G.jsx)(Jy,{ctx:e,refusal:r,error:t,again:`the button below tries again`},r.paths.join(`
114
- `))]})}var pE={record:()=>`Record the design`,discard:()=>`Discard the draft?`,retire:e=>`Retire pillar ${e}`,drop:e=>`Drop unit ${e}`},mE={record:`Record design`,discard:`Discard draft`,retire:`Retire`,drop:`Drop`};function hE({ctx:e,kind:t,id:n=``,onClose:r}){let i=e.board.domain.sections.design,a={record:i?.commit,discard:i?.discard,retire:i?.retire,drop:i?.drop}[t],o=fi(e.board.domain,a),s=(e.board.units??[]).find(e=>e.id===n),[c,l]=(0,v.useState)(t===`drop`&&s?{tags:s.system}:{}),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(void 0),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(null);if(!o||!a)return null;let y=Jr(e.board)?.unrecorded??[],b=t===`record`?y:t===`discard`?y.filter(ri):[],x=o.fields.filter(e=>!e.hidden),S=(e.board.domain.moves[a]?.args??[]).join(` `).replace(`{id}`,n),C=t===`discard`?`${o.help??``}. These files go back:`:o.help??``,w=async()=>{if(g)return r();p(void 0);let i=x.filter(e=>e.required&&!c[e.key]?.trim());if(i.length)return d(`${i.map(e=>e.label).join(`, `)}: required`);h(!0);let o=await e.moveOut({cmd:a,...n?{id:n}:{},...bi(x,c)});if(h(!1),p(o.refusal),!o.ok)return d(o.err||o.out||`The framework refused it.`);if(t!==`drop`)return r();_({type:s?.type??``,reason:c.reason??``,tags:(c.tags??``).split(/[,\s]+/).filter(Boolean)})};return(0,G.jsx)(De,{onClose:r,dirty:m||Object.values(c).some(Boolean),children:(0,G.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":g?`Unit dropped`:pE[t](n),className:`design-dialog`,onClick:e=>e.stopPropagation(),children:[(0,G.jsxs)(`div`,{className:`design-dialog-head`,children:[(0,G.jsx)(`h2`,{children:g?`Unit dropped`:pE[t](n)}),!g&&C&&(0,G.jsx)(`span`,{children:C})]}),g&&(0,G.jsxs)(`div`,{className:`design-grave`,children:[(0,G.jsx)(`span`,{children:`In the graveyard (Ended), as an item's line`}),(0,G.jsxs)(`div`,{className:`design-grave-line`,children:[(0,G.jsx)(`code`,{children:n}),(0,G.jsx)(`span`,{className:`design-grave-type`,children:g.type}),(0,G.jsx)(`span`,{className:`design-grave-reason`,children:g.reason}),(0,G.jsx)(`span`,{className:`design-grave-tags`,children:g.tags.map(e=>(0,G.jsxs)(`span`,{children:[`#`,e]},e))})]})]}),!g&&b.length>0&&(0,G.jsx)(`div`,{className:`design-dialog-files`,children:b.map(e=>(0,G.jsx)(`code`,{children:e},e))}),!g&&x.map(e=>(0,G.jsxs)(`label`,{className:`design-dialog-field`,children:[(0,G.jsxs)(`span`,{children:[e.label,e.required?` *`:``]}),e.kind===`longtext`?(0,G.jsx)(`textarea`,{className:`design-input`,rows:3,value:c[e.key]??``,onChange:t=>l({...c,[e.key]:t.target.value})}):e.kind===`choice`?(0,G.jsx)(`select`,{className:`design-input`,value:c[e.key]??``,onChange:t=>l({...c,[e.key]:t.target.value}),children:(e.options??[]).map(e=>(0,G.jsx)(`option`,{value:e.value,children:e.label},e.value))}):(0,G.jsx)(`input`,{className:`design-input`,value:c[e.key]??``,onChange:t=>l({...c,[e.key]:t.target.value})})]},e.key)),!g&&(0,G.jsx)(`code`,{className:`design-dialog-cmd`,children:S}),u&&(0,G.jsx)(fE,{ctx:e,error:u,refusal:f}),(0,G.jsxs)(`div`,{className:`design-dialog-acts`,children:[!g&&(0,G.jsx)(`button`,{className:`design-cancel`,disabled:m,onClick:r,children:`Cancel`}),(0,G.jsx)(`button`,{className:`design-prim${o.danger&&!g?` danger`:``}`,disabled:m,onClick:()=>void w(),children:m?`Working…`:g?`Done`:mE[t]})]})]})})}function gE(e,t){let[n,r]=(0,v.useState)(``);return(0,v.useEffect)(()=>{let n=!0;return H.designPart(e.project.name,`system`,t).then(e=>{let t=e.fields.find(e=>e.key===`purpose`)?.value,i=Array.isArray(t)?t.join(` · `):typeof t==`string`?t:``;n&&r(e.exists?i||`TBD`:`no part yet`)},()=>n&&r(``)),()=>{n=!1}},[t,e.board.head]),n}function _E({ctx:e,system:t,list:n,open:r,go:i}){let a=Jr(e.board)?.systems[t],o=gE(e,t);return(0,G.jsxs)(`section`,{className:`design-sys`,"aria-label":`Subsystem ${t}`,children:[(0,G.jsxs)(`div`,{className:`design-sys-head`,children:[(0,G.jsxs)(`span`,{className:`design-sys-name`,children:[(0,G.jsx)(`span`,{children:t}),a&&(0,G.jsxs)(`span`,{className:`design-sys-sub`,title:`From design.systems: units, ready, values (filled slots) and TBDs in gcf/design/${t}.md`,children:[qT(a.units,`unit`),` · `,a.ready,` ready · `,a.values,` values ·`,` `,a.tbd?`TBD ${a.tbd}`:`no TBD`]})]}),(0,G.jsxs)(`div`,{className:`design-sys-row`,children:[(0,G.jsxs)(`button`,{className:`design-purpose${r===`system:${t}`?` on`:``}`,title:`Open the subsystem's purpose in its form`,onClick:()=>i(`units:system:${t}`),children:[(0,G.jsx)(`span`,{className:`design-purpose-k`,children:`Purpose`}),(0,G.jsx)(`span`,{className:`design-purpose-v`,children:o}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`›`})]}),(0,G.jsx)(YT,{ctx:e,k:`draft-system`,system:t})]})]}),(0,G.jsxs)(`div`,{className:`design-sys-rows`,children:[n.map(e=>{let t=oi(e);return(0,G.jsxs)(`button`,{className:`design-unit-row${r===e.id?` on`:``}`,"aria-current":r===e.id||void 0,title:t.tip,onClick:()=>i(`units:${e.id}`),children:[(0,G.jsxs)(`span`,{className:`design-unit-top`,children:[(0,G.jsx)(`span`,{className:`design-unit-title`,children:e.title??e.id}),(0,G.jsx)(`span`,{className:`design-pill tone-${t.tone}`,children:t.state})]}),(0,G.jsxs)(`span`,{className:`design-unit-meta`,children:[(0,G.jsx)(`span`,{children:e.type}),(0,G.jsxs)(`span`,{children:[`(`,e.id,`)`]}),t.extra&&(0,G.jsx)(`span`,{className:`warn`,children:t.extra})]})]},e.id)}),!n.length&&(0,G.jsx)(`span`,{className:`design-none`,children:`no unit yet`})]})]})}function vE({ctx:e,d:t,open:n,go:r}){let i=e.board.units??[],a=fi(e.board.domain,e.board.domain.sections.design?.drop),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),u=Map.groupBy(i,e=>e.system),d=[...new Set([...Object.keys(t.systems),...u.keys()])],f=n?.startsWith(`system:`)?n.slice(7):null,p=i.find(e=>e.id===n),m=(0,G.jsx)(`button`,{className:`design-back`,onClick:()=>r(`units`),children:`‹ Units`}),h=p&&oi(p);return(0,G.jsxs)(`section`,{className:`design-units${p||f?` has-open`:``}`,"aria-label":`Units`,children:[(0,G.jsxs)(`div`,{className:`design-unit-list`,children:[(0,G.jsxs)(`div`,{className:`design-head`,children:[(0,G.jsxs)(`div`,{className:`design-head-main`,children:[(0,G.jsx)(`h2`,{children:`Units`}),(0,G.jsxs)(`span`,{className:`design-path small`,children:[i.length,` live units · `,i.filter(e=>e.ready).length,` ready`]})]}),e.board.domain.sections.design?.new_unit&&(0,G.jsx)(`button`,{className:`design-add-unit`,title:`A new unit: subsystem, type, title; its id comes from the title, every block starts TBD`,onClick:()=>s(!0),children:`+ Add unit`})]}),!d.length&&(0,G.jsx)(`p`,{className:`design-empty`,children:`No design unit yet. An import or Create with agent writes the first ones; Add unit writes one by hand.`}),d.map(t=>(0,G.jsx)(_E,{ctx:e,system:t,list:u.get(t)??[],open:n,go:r},t))]}),!p&&!f&&d.length>0&&(0,G.jsx)(`div`,{className:`design-pick-one`,children:`Open a unit to see its form.`}),p&&h&&(0,G.jsxs)(`article`,{className:`design-open-part`,"aria-label":`Unit ${p.id}`,children:[m,(0,G.jsxs)(`div`,{className:`design-unit-head`,children:[(0,G.jsxs)(`span`,{className:`design-unit-id`,children:[(0,G.jsx)(`code`,{children:p.id}),(0,G.jsx)(`span`,{className:`tone-${h.tone}`,children:p.ready?`ready: no TBD, no question`:p.blocked_by.length?`held by ${p.blocked_by.join(`, `)}${p.tbd?` · TBD ${p.tbd}`:``}`:`TBD ${p.tbd}`})]}),(0,G.jsx)(`h2`,{children:p.title??p.id}),(0,G.jsxs)(`span`,{className:`design-path`,children:[p.type,` · `,p.file]})]}),(0,G.jsxs)(`div`,{className:`design-unit-acts`,children:[(0,G.jsx)(YT,{ctx:e,k:`card`,unit:p.id,primary:!0}),(0,G.jsx)(YT,{ctx:e,k:`debate-unit`,unit:p.id}),(0,G.jsx)(`span`,{className:`design-spacer`}),a&&(0,G.jsx)(Po,{label:`Drop the unit`,tip:`Drop…: the unit leaves the design into the graveyard, with the reason; it asks first`,onClick:()=>l(p.id)})]}),(0,G.jsx)(`span`,{className:`design-fine design-unit-hint`,children:`Fill TBDs with agent goes through the TBDs with you; it goes into work only on your word.`}),(0,G.jsxs)(`div`,{className:`design-held`,children:[(0,G.jsx)(`h3`,{className:`design-h3`,children:`Questions that hold it`}),!Zr(e.board,p.id).length&&(0,G.jsx)(`span`,{className:`design-none`,children:`No question holds it.`}),Zr(e.board,p.id).map(t=>(0,G.jsx)(Ns,{ctx:e,q:t},t.id))]}),(0,G.jsx)(nE,{ctx:e,kind:`unit`,name:p.id,rows:24},p.id)]}),f&&(0,G.jsxs)(`article`,{className:`design-open-part`,"aria-label":`Subsystem ${f}`,children:[m,(0,G.jsxs)(`div`,{className:`design-head`,children:[(0,G.jsxs)(`div`,{className:`design-head-main`,children:[(0,G.jsx)(`span`,{className:`design-kicker`,children:`subsystem`}),(0,G.jsx)(`h2`,{className:`mono`,children:f})]}),(0,G.jsx)(YT,{ctx:e,k:`draft-system`,system:f})]}),(0,G.jsx)(nE,{ctx:e,kind:`system`,name:f},f)]}),c&&(0,G.jsx)(hE,{ctx:e,kind:`drop`,id:c,onClose:()=>{l(null),n===c&&r(`units`)}}),o&&(0,G.jsx)(dE,{ctx:e,d:t,onClose:()=>s(!1),onMade:e=>{s(!1),r(`units:${e}`)}})]})}function yE({ctx:e}){let t=Xr(e.board),n=t.filter(e=>e.class!==`D2`),r=t.filter(e=>e.class===`D2`),[i,a]=(0,v.useState)(!1),o=n.filter(e=>!e.answer).length,s=t=>{let n=si(e.board,t),r=`q:${t.id}`,i=t.sys&&t.sys!==`-`?t.sys:``;return(0,G.jsx)(No,{cat:n.label,catTip:n.help,tone:n.needs?`needs`:void 0,needs:n.needs&&!t.answer,origin:t.origin??`agent`,title:(t.class===`D2`?t.assumed:t.question)??t.id,sub:t.blocks?`blocks ${t.blocks}`:i,mark:t.answer?`✔ answered`:t.proposed?`a proposal`:void 0,markTone:t.answer?`ok`:`text`,on:e.detailKey===r,onOpen:()=>e.openDetail({key:r,render:e=>{let n=Xr(e.board).find(e=>e.id===t.id);if(!n)return null;let r=si(e.board,n);return{cat:r.label,catTip:r.help,tone:r.needs?`needs`:void 0,origin:n.origin??`agent`,body:(0,G.jsx)(Ns,{ctx:e,q:n})}}})},t.id)},c=t=>(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`design-desk`,children:(0,G.jsx)(Fo,{children:t.map(s)})}),(0,G.jsx)(`div`,{className:`design-phone`,children:t.map(t=>(0,G.jsx)(Ns,{ctx:e,q:t},t.id))})]});return(0,G.jsxs)(`section`,{className:`design-sec design-qs`,"aria-label":`Questions`,children:[(0,G.jsx)(`div`,{className:`design-head`,children:(0,G.jsxs)(`div`,{className:`design-head-main`,children:[(0,G.jsx)(`h2`,{children:`Questions`}),(0,G.jsx)(`span`,{className:`design-lead`,children:`What the design leaves open. Inbox lists the same questions: one record, answered in either place.`}),(0,G.jsx)(YT,{ctx:e,k:`debate`})]})}),!t.length&&(0,G.jsx)(`p`,{className:`design-empty`,children:`No open question. An import or a review with agent writes them here.`}),n.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`h3`,{className:`design-h3`,children:[`Waiting for your answer`,(0,G.jsxs)(`span`,{className:`design-h3-count`,children:[o,` waiting · `,n.length-o,` answered`]})]}),c(n)]}),r.length>0&&(0,G.jsxs)(`button`,{className:`design-fold`,"aria-expanded":i,onClick:()=>a(!i),children:[i?`▾ `:`▸ `,si(e.board,r[0]).label,` · `,r.length]}),i&&c(r)]})}function bE({ctx:e}){let t=e.board.domain.sections.design,[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),c=async()=>{let t=await fetch(ae(e.project.name));if(!t.ok)throw Error(await t.text());return t.text()},l=async()=>{r(`export`);try{let e=await c(),t=document.createElement(`a`);t.href=URL.createObjectURL(new Blob([e],{type:`text/markdown`})),t.download=`design.md`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),0),a(e)}catch(t){e.notify(t.message,`error`)}r(null)},u=async()=>{if(i!==null)return a(null);try{a(await c())}catch(t){e.notify(t.message,`error`)}},d=async n=>{if(!t)return;r(`import`),s(null);let i=await e.moveOut({cmd:t.import,bundle:await n.text()});r(null);let a=Ie(i.refusal);!i.ok&&a&&nb(a,i.err);let o=ui(i.out);(i.ok||o.applied.length||o.report.length)&&s({name:n.name,...o})};return(0,G.jsxs)(`section`,{className:`design-sec`,"aria-label":`Designer`,children:[(0,G.jsxs)(`div`,{className:`design-head-main`,children:[(0,G.jsx)(`h2`,{children:`Designer`}),(0,G.jsx)(`span`,{className:`design-lead design-narrow`,children:`For a designer who edits the design like a document: the whole of it in one markdown file, out and back, without an agent.`})]}),(0,G.jsxs)(`div`,{className:`design-cards`,children:[(0,G.jsxs)(`div`,{className:`design-card`,children:[(0,G.jsx)(`h3`,{children:`Export`}),(0,G.jsx)(`span`,{children:`One markdown file: the pillars, the vision, the glossary and every unit. Its gcf:part comments mark each part: keep them, the import reads them.`}),(0,G.jsx)(`button`,{className:`design-card-btn`,disabled:n===`export`,title:`gcf design export: downloads the file`,onClick:()=>void l(),children:n===`export`?`Exporting…`:`Export`})]}),t&&(0,G.jsxs)(`div`,{className:`design-card`,children:[(0,G.jsx)(`h3`,{children:`Import`}),(0,G.jsx)(`span`,{children:`Brings the edited file back. A part changed in the project since the export is reported, never overwritten.`}),(0,G.jsxs)(`label`,{className:`design-card-btn design-pick-plain${n===`import`?` off`:``}`,title:`gcf design import --commit: pick the edited .md`,children:[n===`import`?`Importing…`:`Import`,(0,G.jsx)(`input`,{type:`file`,accept:`.md,text/markdown`,"aria-label":`Import the designer's file`,disabled:n===`import`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&d(t)}})]})]})]}),o&&(0,G.jsxs)(`section`,{role:`status`,"aria-label":`Import report`,className:`design-report`,children:[(0,G.jsxs)(`h3`,{children:[o.name,` imported`]}),(0,G.jsxs)(`div`,{className:`design-report-list`,children:[(0,G.jsx)(`span`,{children:`Written`}),o.applied.map(e=>(0,G.jsxs)(`code`,{className:`design-applied`,children:[`✔ `,e]},e))]}),o.report.length>0&&(0,G.jsxs)(`div`,{className:`design-report-list`,children:[(0,G.jsx)(`span`,{children:`Not written: reported, kept as they are in the project`}),o.report.map(e=>(0,G.jsxs)(`div`,{className:`design-reported`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`code`,{children:e.part}),(0,G.jsx)(`span`,{className:`design-outcome`,children:e.outcome})]}),(0,G.jsx)(`span`,{className:`design-reported-note`,children:e.note})]},e.part))]})]}),(0,G.jsxs)(`div`,{className:`design-export-wrap`,children:[(0,G.jsxs)(`button`,{className:`design-fold mono`,"aria-expanded":i!==null,title:`The file Export gives right now, the same as the download`,onClick:()=>void u(),children:[i===null?`▸ `:`▾ `,`What Export gives · design.md`]}),i!==null&&(0,G.jsx)(`div`,{className:`design-export`,children:i.split(`
115
- `).map((e,t)=>(0,G.jsx)(`div`,{className:/^<!-- gcf:/.test(e)?`marker`:/^<!--/.test(e)?`comment`:void 0,children:e||` `},t))})]})]})}function xE({ctx:e,arg:t}){let[n,...r]=(t??``).split(`:`),i=VT.includes(n)?n:`start`,a=r.join(`:`)||null,o=t=>e.go(`design`,t),s=Jr(e.board),c=e.board.design&&`error`in e.board.design?e.board.design.error:``,l=is(e.board.quota);return(0,G.jsxs)(`div`,{className:`design-screen part-${i}`,children:[s&&(0,G.jsx)(rE,{ctx:e,d:s,part:i,go:o}),(0,G.jsx)(`div`,{className:`design-main`,children:s&&(0,G.jsxs)(`div`,{className:`design-content`,children:[l&&(0,G.jsxs)(`div`,{role:`note`,className:`design-limit`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`◷`}),(0,G.jsxs)(`span`,{children:[`Off until `,ra(l),`: the usage limit holds for the account. The forms work without an agent.`]})]}),(0,G.jsx)(iE,{ctx:e,d:s,go:o}),(0,G.jsx)(aE,{ctx:e,d:s,go:o}),i===`start`&&(0,G.jsx)(sE,{ctx:e,d:s,go:o}),i===`pillars`&&(0,G.jsx)(cE,{ctx:e,d:s}),i===`vision`&&(0,G.jsx)(lE,{ctx:e,d:s}),i===`glossary`&&(0,G.jsx)(uE,{ctx:e,d:s}),i===`units`&&(0,G.jsx)(vE,{ctx:e,d:s,open:a,go:o}),i===`questions`&&(0,G.jsx)(yE,{ctx:e}),i===`designer`&&(0,G.jsx)(bE,{ctx:e})]})}),c&&(0,G.jsx)(`div`,{role:`alert`,"aria-label":`The design check cannot run`,className:`design-cannot`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h1`,{children:`Design · the design check cannot run`}),(0,G.jsx)(`code`,{children:c}),(0,G.jsx)(`span`,{children:`The board reads the design with its check; until the check runs, no part of the design shows. The rest of the board works. The screen comes back by itself with the next read.`})]})})]})}function SE({ctx:e,spec:t,onClose:n}){let r=IC(),i=t.render(e),a=!i;return(0,v.useEffect)(()=>{a&&n()},[a,n]),i?(0,G.jsxs)(`aside`,{className:`drawer detail-win`,"aria-label":`Detail window`,...r,children:[(0,G.jsx)(`div`,{className:`d-head`,children:(0,G.jsxs)(`div`,{className:`d-top detail-top d-grab`,title:`Drag to move the window`,children:[(0,G.jsx)(`button`,{className:`d-back`,"aria-label":`Back`,onClick:n,children:`‹`}),(0,G.jsx)(`span`,{className:`tile-cat tone-${i.tone??`neutral`}`,title:i.catTip,children:i.cat}),i.origin&&(0,G.jsx)(`span`,{className:`tile-origin`,title:`where it came from: it never changes`,children:i.origin}),i.age&&(0,G.jsx)(`span`,{className:`detail-age`,title:i.ageTip,children:i.age}),(0,G.jsx)(`span`,{className:`detail-esc`,"aria-hidden":`true`,children:`Esc`}),(0,G.jsx)(`button`,{className:`icon-btn bordered d-close`,"aria-label":`Close`,title:`Close · Esc`,onClick:n,children:`×`})]})}),(0,G.jsx)(`div`,{className:`d-body detail-body`,children:i.body})]}):null}var CE=window.matchMedia(`(width <= 700px)`),wE=window.matchMedia(`(width >= 1600px)`),TE=e=>(CE.addEventListener(`change`,e),wE.addEventListener(`change`,e),()=>{CE.removeEventListener(`change`,e),wE.removeEventListener(`change`,e)}),EE=()=>CE.matches?1:wE.matches?3:2,DE={failed:`!`,"not-started":`⧗`,paused:`‖`,ended:`✓`};function OE({l:e,named:t}){return(0,G.jsxs)(`p`,{className:`report-line`,children:[e.lead&&`${e.lead} `,e.id&&(0,G.jsx)(Se,{id:e.id}),e.word&&(0,G.jsxs)(G.Fragment,{children:[`: `,(0,G.jsx)(`span`,{className:`report-word tone-${e.tone}`,children:e.word}),e.text&&` — `]}),(0,G.jsx)(Ce,{text:e.text,named:e.id?void 0:t}),e.tail,e.subs.map((e,n)=>(0,G.jsxs)(`span`,{className:`report-sub ${e.mark?``:`quiet`}`,children:[e.mark&&(0,G.jsx)(`span`,{className:`report-sub-mark`,"aria-hidden":`true`,children:e.mark}),(0,G.jsx)(Ce,{text:e.text,named:t,toned:!0})]},n)),e.warn&&(0,G.jsxs)(`span`,{className:`report-warn`,title:`A process note from the framework`,children:[`⚠ `,e.warn]})]})}function kE({ctx:e,r:t}){let n=K(t);return(0,G.jsxs)(`article`,{className:`report tone-${n.tone}`,"aria-label":`Run report: ${t.ids.join(`, `)}`,children:[(0,G.jsxs)(`div`,{className:`report-head`,children:[(0,G.jsx)(`span`,{className:`report-kind`,children:n.word}),(0,G.jsxs)(`h3`,{className:`report-title`,children:[`run`,` `,t.ids.map((e,t)=>(0,G.jsxs)(`span`,{children:[t>0&&`, `,(0,G.jsx)(Se,{id:e})]},e))]}),(0,G.jsx)(`span`,{className:`report-time`,children:ra(t.at)}),(0,G.jsx)(`button`,{className:`icon-btn report-close`,"aria-label":`Remove the report`,title:`Remove the report for good`,onClick:n=>n.detail<2&&e.closeReport(t.id),children:`×`})]}),(0,G.jsx)(`div`,{className:`report-lines`,children:n.lines.map((e,t)=>(0,G.jsx)(OE,{l:e,named:n.named},t))}),n.note&&(0,G.jsx)(`div`,{className:`report-note`,children:(0,G.jsx)(Ce,{text:n.note,named:n.named,toned:!0})})]})}function AE({ctx:e,r:t,open:n,onOpen:r}){let i=K(t),a=t.ids.join(`, `),o=i.lines.map(e=>`${e.id?`${e.id}: ${e.word??``} `:``}${e.text}`);return(0,G.jsxs)(`div`,{className:`report-chip kind-${i.kind}`,title:`${i.word} · ${[...o,i.note].filter(Boolean).join(`
116
- `)}\nClick: the whole report. × removes it.`,children:[(0,G.jsxs)(`button`,{className:`report-chip-open`,"aria-expanded":n,"aria-haspopup":`dialog`,"aria-label":`${i.word} · ${a} · ${ra(t.at)}: open the whole report`,onClick:e=>r(e.currentTarget),children:[(0,G.jsx)(`span`,{className:`report-chip-mark`,"aria-hidden":`true`,children:DE[i.kind]}),(0,G.jsx)(`span`,{className:`report-chip-kind`,children:i.word}),(0,G.jsx)(`span`,{className:`report-chip-items`,children:i.items.map((e,t)=>(0,G.jsxs)(`span`,{children:[t>0&&(0,G.jsx)(`span`,{className:`report-chip-sep`,children:`·`}),(0,G.jsx)(`span`,{className:`report-chip-id`,children:e.id}),e.word&&(0,G.jsxs)(`span`,{className:`report-word tone-${e.tone}`,children:[` `,e.word]}),e.cost&&(0,G.jsxs)(`span`,{className:`report-chip-cost`,children:[` `,e.cost]})]},e.id))}),(0,G.jsx)(`span`,{className:`report-time`,children:ra(t.at)})]}),(0,G.jsx)(`button`,{className:`report-chip-x`,"aria-label":`Remove the report`,title:`Remove the report for good`,onClick:n=>n.detail<2&&e.closeReport(t.id),children:`×`})]})}function jE({ctx:e}){let t=e.board.runs?.reports??[],n=(0,v.useSyncExternalStore)(TE,EE),[r,i]=(0,v.useState)(null),a=(0,v.useRef)(null),o=$i(t),s=o.slice(0,n),c=o.slice(n),l=r?.key===`more`?c:o.filter(e=>e.id===r?.key),u=l.length>0;r&&!u&&i(null);let d=e.itemOpen;if((0,v.useEffect)(()=>{d&&i(null)},[d]),(0,v.useEffect)(()=>{if(!u)return;let e=e=>{e.key===`Escape`&&(e.stopPropagation(),i(null))};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[u]),!t.length)return null;let f=(e,t)=>{let n=a.current?.getBoundingClientRect().left??0,o=t.closest(`.report-chip`)??t;i(r?.key===e?null:{key:e,x:o.getBoundingClientRect().left-n})},p=c.filter(e=>K(e).kind===`failed`).length,m=r?.key===`more`?`${c.length} more run reports`:`Run report`;return(0,G.jsxs)(`div`,{className:`report-row-wrap`,children:[(0,G.jsxs)(`div`,{className:`report-row`,role:`region`,"aria-label":`Run reports`,ref:a,children:[s.map(t=>(0,G.jsx)(AE,{ctx:e,r:t,open:r?.key===t.id,onOpen:e=>f(t.id,e)},t.id)),c.length>0&&(0,G.jsxs)(`button`,{className:`report-more ${p?`bad`:``}`,"aria-expanded":r?.key===`more`,"aria-haspopup":`dialog`,title:`${c.length} more: ${c.map(e=>`${K(e).word} ${e.ids.join(`, `)}`).join(` · `)}${p?` · a failure among them`:``}`,onClick:e=>f(`more`,e.currentTarget),children:[`+`,c.length]})]}),u&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`report-scrim`,"aria-hidden":`true`,onClick:()=>i(null)}),(0,G.jsxs)(`div`,{className:`report-panel`,role:`dialog`,"aria-label":m,style:{"--report-x":`${r?.x??0}px`},children:[(0,G.jsxs)(`div`,{className:`report-panel-top`,children:[(0,G.jsx)(`span`,{className:`report-panel-h`,children:m}),(0,G.jsx)(`button`,{className:`report-panel-close`,onClick:()=>i(null),children:`Close`})]}),(0,G.jsx)(`div`,{className:`report-panel-list`,children:l.map(t=>(0,G.jsx)(kE,{ctx:e,r:t},t.id))}),(0,G.jsx)(`span`,{className:`report-panel-hint`,children:`Esc or a click outside closes it · × removes a report for good`})]})]})]})}var ME=[[`run`,`An agent session works on an item; the board starts it through the harness`],[`running`,`The column of the items an agent session works on now`],[`queue`,`Runs in the project folder go one at a time; the next waits in the queue`],[`worktree / main`,`Where a run works: its own git worktree (several at once) or the folder`],[`handoff`,`At the context share a session hands its item to a fresh one, from the plan`],[`usage limit`,`A run waits for the limit to reset, then goes on by itself; Go on now goes on at once when you reset it early; Stop ends the wait`],[`reserve`,`Automation waits while the quota is past your reserve (Settings); Go on now lets this run use it`],[`resume`,`A rerun goes on in the session or worktree the last run left`],[`permissions`,`What agent runs may not do: deny groups and custom rules`]];function NE(e){return[...e.terms.map(e=>({group:`Terms`,term:e.term,help:e.help})),...e.columns.map(e=>({group:`Columns`,term:e.label,help:e.help})),...Object.entries(e.moves).flatMap(([e,t])=>t.help?[{group:`Moves`,term:e===t.label?e:`${t.label} (${e})`,help:t.help}]:[]),...e.fields.flatMap(e=>[...e.help?[{group:`Fields`,term:e.label,help:e.help}]:[],...(e.options??[]).flatMap(t=>t.help?[{group:`Fields`,term:`${e.label}: ${t.label}`,help:t.help}]:[])]),...ME.map(([e,t])=>({group:`Runs`,term:e,help:t}))]}var PE=[[`Space on a card`,`Pick the card up to move it without the mouse: ← → the column, ↑ ↓ its rank among ready cards, Space drops it, Esc puts it back`],[`Right click on chat text`,`With text selected: Copy, or Reply (it quotes the text into your message). On a phone, the Reply button under the selection`],[`Esc in the chat input`,`Cancels an agent message's Reply: its chip goes, your words stay`],[`/`,`Search: the board's filter on the board, the inbox's on the inbox, Help's in Help`],[`i`,`Quick capture: a new inbox entry, from any screen`],[`n`,`New item`],[`j / k`,`Move between cards`],[`Enter`,`Opens the focused card; in the inbox field adds the entry, Shift+Enter breaks the line`],[`Esc`,`Closes a dialog, a menu, Help or the item's window; a dialog with typed text stays`],[`r`,`Runs the focused card: it asks first, the card is not opened`],[`1–7`,`Focus a column`],[`?`,`Help`],[`j / k on Inbox`,`Move between records; Enter opens the record's window, s Sort…, l Later or Back, e Erase, Esc closes the window`],[`g, then a letter`,`Go to a screen: g c Command, g b Board, g t Chat, g i Inbox, g d Design, g r Runs, g p Playtest, g e Ended, g a Agent, g s Settings, g m Metrics`],[`Ctrl+Enter`,`Sends a chat message`]];function FE({domain:e,onClose:t}){let[n,r]=(0,v.useState)(``);(0,v.useEffect)(()=>{let e=e=>e.key===`Escape`&&!e.defaultPrevented&&!document.querySelector(`.modal`)&&t();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]);let i=n.trim().toLowerCase(),a=[...NE(e),...PE.map(([e,t])=>({group:`Keys`,term:e,help:t}))].filter(e=>!i||`${e.term} ${e.help}`.toLowerCase().includes(i)),o=[...new Set(a.map(e=>e.group))];return(0,G.jsxs)(`aside`,{className:`help`,role:`dialog`,"aria-label":`Help`,children:[(0,G.jsxs)(`div`,{className:`help-head`,children:[(0,G.jsx)(`h2`,{children:`Help`}),(0,G.jsx)(`button`,{className:`icon-btn`,"aria-label":`Close help`,onClick:t,children:`×`})]}),(0,G.jsx)(`div`,{className:`help-search`,children:(0,G.jsx)(`input`,{className:`input`,type:`search`,"aria-label":`Search the help`,value:n,onChange:e=>r(e.target.value),placeholder:`search a word: handoff, gate, unplayed…`,autoFocus:!0})}),(0,G.jsxs)(`div`,{className:`help-body`,children:[!a.length&&(0,G.jsxs)(`p`,{className:`dim`,children:[`Nothing found for “`,n,`”.`]}),o.map(e=>{let t=a.filter(t=>t.group===e);return(0,G.jsxs)(`section`,{"aria-label":e,children:[(0,G.jsxs)(`h3`,{children:[e,` · `,t.length]}),(0,G.jsx)(`dl`,{children:t.map((e,t)=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:e.term}),(0,G.jsx)(`dd`,{children:e.help})]},`${e.term}-${t}`))})]},e)})]})]})}var IE={branch:`committed on branch`,open:`not committed`,both:`committed, changed again`},LE=e=>e.state?IE[e.state]:``,RE={modified:{word:`modified`,tip:`Changed against the base`},added:{word:`added`,tip:`New, in git (added to the index or committed on the branch)`},deleted:{word:`deleted`,tip:`Gone from the disk: it has no size`},renamed:{word:`renamed`,tip:`Moved: the old name is the one the base has`},copied:{word:`copied`,tip:`A copy of a file the base has`},untracked:{word:`not in git`,tip:`Untracked: git does not know this file; a commit would not take it unless it is added`},conflict:{word:`conflict`,tip:`A merge left it unresolved`}},zE={branch:`The run committed it on its branch; nothing left on disk`,open:`On the worktree's disk only`,both:`Committed on the branch, then changed again on disk`},BE=e=>e.view===`text`||e.view===`image`;function VE(e){if(e.view===`binary`)return`binary`;if(e.view!==`listed`)return``;let t=e.why??``;return t.startsWith(`no_diff `)?`listed only: ${t}`:t}function HE(e){if(e.view===`binary`)return`binary`;let t=e.why??``;return t.startsWith(`no_diff `)?`no_diff`:t||`listed`}function UE(e){return e===void 0?``:e<1024?`${e} B`:e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:e<10240?`${(e/1024).toFixed(1)} KB`:`${Math.round(e/1024)} KB`}function WE(e,t){return e.id===`main`?`main checkout`:t.includes(e.id)?`${e.id} · running`:e.verified?`${e.id} · verified, waiting to merge`:`${e.id} · stopped`}var GE=e=>e?e.slice(0,7):``,KE=`4b825dc`;function qE(e,t){return t?t.startsWith(KE)?`no commit yet`:`${e===`main`?`against the last commit`:`against the merge-base`} ${GE(t)}`:``}function JE(e){return e?e.lines===null?`first ${e.shown} lines: the rest is past the limit`:`first ${e.shown} of ${e.lines} lines`:``}var YE=(e,t)=>Vy(e,[t.path]).flatMap(e=>e.lines);function XE(e){return e.status===`conflict`?`No tick: resolve the conflict first, then it can be committed`:e.why===`nested repository`?`No tick: a nested repository. git add would record an empty gitlink; commit it in its own repository`:e.why===`not a regular file`?`No tick: not a regular file. git cannot record it`:``}var ZE=(e,t)=>e.filter(e=>!XE(e)&&!t.has(e.path));function QE(e,t){let n=e.filter(e=>!XE(e)).length;if(!n)return null;let r=ZE(e,t).length;return r===n?`true`:r?`mixed`:`false`}function $E(e,t,n){let r=new Set(e);for(let e of t)XE(e)||(n?r.delete(e.path):r.add(e.path));return r}function eD(e,t,n){if(n>0)return e;let r=new Set(t.map(e=>e.path)),i=[...e].filter(e=>r.has(e));return i.length===e.size?e:new Set(i)}function tD(e){let t={dirs:new Map,files:[],n:0,all:[]};for(let n of e){let e=n.path.replace(/\/$/,``).split(`/`),r=`${e.pop()}${n.path.endsWith(`/`)?`/`:``}`,i=t;i.n++;for(let t of e){let e=i.dirs.get(t);e||i.dirs.set(t,e={dirs:new Map,files:[],n:0,all:[]}),i=e,i.n++,i.all.push(n)}i.files.push({f:n,name:r})}return t}var nD=e=>e.split(`/`).slice(0,-1).join(`/`);function rD({f:e,name:t}){return e.from?`${nD(e.from)===nD(e.path)?e.from.split(`/`).pop():e.from} → ${t}`:t}function iD(e,t){let n=[],r=(e,i,a)=>{for(let o of[...e.dirs.keys()].sort()){let s=o,c=e.dirs.get(o);for(;c.dirs.size===1&&!c.files.length;){let[e,t]=[...c.dirs][0];s+=`/${e}`,c=t}let l=`${a}${s}/`,u=c.n<=200!==t.has(l);n.push({kind:`dir`,key:l,name:`${s}/`,depth:i,count:c.n,open:u,files:c.all}),u&&r(c,i+1,l)}for(let t of[...e.files].sort((e,t)=>e.name.localeCompare(t.name)))n.push({kind:`file`,file:t.f,label:rD(t),depth:i})};return r(tD(e),0,``),n}function aD({ctx:e,branch:t,running:n,branches:r,reread:i}){let[a,o]=(0,v.useState)(null),s=!!e.board.domain.sections.changes?.pull,c=Lo(t,{running:n,branches:r,canPull:s}),l=a?.phase===`busy`,u=e.project.name,d=async()=>{if(await ke(`Push ${Io(t.ahead)} to ${t.target}? They leave this machine. Only a force push takes them back, and GCF never makes one.`,`Push`)){o({phase:`busy`,move:`push`});try{let e=await H.pushChanges(u);o(e.ok?{phase:`done`,words:e.pushed?`Pushed ${Io(e.pushed)} to ${e.upstream} ${e.from??`new`}..${e.to}`:`${e.upstream} is up to date`}:{phase:`refused`,move:`push`,words:e.err,refusal:e.refusal})}catch(e){o({phase:`refused`,move:`push`,words:e.message})}i()}},f=async()=>{o({phase:`busy`,move:`pull`});try{let e=await H.pullChanges(u);o(e.ok?{phase:`done`,words:e.pulled?`Pulled ${Io(e.pulled)} from ${e.upstream} ${e.from}..${e.to}`:`Nothing to pull from ${e.upstream}`}:{phase:`refused`,move:`pull`,words:e.err,refusal:e.refusal})}catch(e){o({phase:`refused`,move:`pull`,words:e.message})}i()},p=a?.phase===`refused`?Ro(a.refusal,s):null,m=!!e.board.domain.chat,h=!!c.off||l;return(0,G.jsxs)(`div`,{className:`ch-push ch-push-${c.tone}`,role:`group`,"aria-label":`Push`,children:[(0,G.jsxs)(`div`,{className:`ch-push-row`,children:[(0,G.jsx)(`span`,{className:`ch-push-line`,children:c.line}),c.pull&&(0,G.jsx)(`button`,{className:`btn`,disabled:h,title:c.off??`git pull --ff-only`,onClick:()=>void f(),children:l&&a.move===`pull`?`Pulling…`:`Pull`}),c.push&&(0,G.jsx)(`button`,{className:`btn-primary`,disabled:h,"aria-busy":l,title:c.off??`Push to ${t.target}: fast-forward only, never force`,onClick:()=>void d(),children:l&&a.move===`push`?`Pushing…`:c.push})]}),c.off&&(c.push||c.pull)&&(0,G.jsx)(`span`,{role:`note`,className:`ch-push-note`,children:c.off}),c.note&&(0,G.jsx)(`span`,{role:`note`,className:`ch-push-note`,children:c.note}),t.out.length>0&&(0,G.jsxs)(`details`,{className:`ch-push-out`,children:[(0,G.jsx)(`summary`,{children:`what goes out`}),(0,G.jsx)(`ul`,{children:t.out.map(e=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`code`,{children:e.hash}),(0,G.jsx)(`span`,{className:`ch-push-subject`,children:e.subject}),(0,G.jsx)(`span`,{className:`ch-push-by`,children:q[e.by]})]},e.hash))}),t.out_more>0&&(0,G.jsxs)(`span`,{className:`ch-push-more`,children:[`and `,t.out_more,` more`]})]}),a?.phase===`done`&&(0,G.jsxs)(`div`,{role:`status`,className:`ch-done`,children:[(0,G.jsx)(`span`,{className:`ch-done-mark`,"aria-hidden":`true`,children:`✓`}),(0,G.jsx)(`span`,{className:`ch-done-subject`,children:a.words}),(0,G.jsx)(`button`,{className:`icon-btn ch-done-x`,"aria-label":`Dismiss`,onClick:()=>o(null),children:`×`})]}),a?.phase===`refused`&&(0,G.jsxs)(`div`,{role:`alert`,className:`ch-refused`,children:[(0,G.jsxs)(`span`,{className:`ch-refused-h`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`✘`}),a.move===`push`?`Not pushed`:`Not pulled`,(0,G.jsx)(`button`,{className:`icon-btn ch-done-x`,"aria-label":`Dismiss`,onClick:()=>o(null),children:`×`})]}),(0,G.jsx)(`span`,{className:`ch-refused-words`,children:(0,G.jsx)(Ce,{text:a.words,toned:!0})}),p&&(p.pull||p.agent&&m)&&(0,G.jsxs)(`span`,{className:`ch-commit-btns`,children:[p.pull&&(0,G.jsx)(`button`,{className:`btn`,disabled:h,onClick:()=>void f(),children:`Pull`}),p.agent&&m&&(0,G.jsxs)(`button`,{className:`btn btn-agent`,onClick:()=>void Ba(e,zo(t)),children:[(0,G.jsx)(Va,{}),`Ask agent to pull`]})]})]})]})}var oD=(e,t)=>({paddingLeft:`${8+e*14+(t?14:0)}px`});function sD({f:e}){let t=RE[e.status];return(0,G.jsx)(`span`,{className:`ch-status ch-${e.status}`,title:t.tip,children:t.word})}function cD({f:e}){return e.state?(0,G.jsx)(`span`,{className:`ch-state ch-state-${e.state}`,title:zE[e.state],children:LE(e)}):null}function lD({box:e}){return e.state===null?(0,G.jsx)(`span`,{className:`ch-tick ch-tick-none`,tabIndex:0,title:e.tip,"aria-label":e.tip}):(0,G.jsx)(`button`,{type:`button`,role:`checkbox`,className:`ch-tick`,"aria-checked":e.state,"aria-label":e.tip,title:e.tip,"aria-disabled":e.off,onClick:t=>{t.stopPropagation(),e.off||e.toggle()},children:(0,G.jsx)(`span`,{className:`ch-box ch-box-${e.state}`,"aria-hidden":`true`,children:{true:`✓`,mixed:`–`,false:``}[e.state]})})}function uD({r:e,box:t,onToggle:n}){let r=`${e.count} file${e.count===1?``:`s`}`;return(0,G.jsxs)(`li`,{className:`ch-li`,children:[t&&(0,G.jsx)(lD,{box:t}),(0,G.jsxs)(`button`,{className:`ch-dir`,style:oD(e.depth,!1),"aria-expanded":e.open,title:`${e.open?`Fold`:`Open`} ${e.key} · ${r}`,onClick:n,children:[(0,G.jsx)(`span`,{className:`ch-mark`,"aria-hidden":`true`,children:e.open?`▾`:`▸`}),(0,G.jsx)(`span`,{className:`ch-dir-name`,children:e.name}),(0,G.jsx)(`span`,{className:`ch-count`,"aria-label":r,children:e.count})]})]})}function dD({r:e,on:t,box:n,onOpen:r}){let i=e.file,a=[RE[i.status].word,`${i.from?`${i.from} → `:``}${i.path}`,LE(i)].filter(Boolean).join(` `),o=i.size!==void 0&&(0,G.jsx)(`span`,{className:`ch-size`,children:UE(i.size)});if(BE(i)){let s=i.view===`image`;return(0,G.jsxs)(`li`,{className:`ch-li`,children:[n&&(0,G.jsx)(lD,{box:n}),(0,G.jsxs)(`button`,{className:`ch-row ${t?`on`:``}`,style:oD(e.depth,!0),"aria-current":t?`true`:void 0,"aria-label":a,title:`${s?`Open: before | after`:`Open its diff`} · ${i.path}`,onClick:r,children:[(0,G.jsx)(sD,{f:i}),(0,G.jsxs)(`span`,{className:`ch-name`,children:[(0,G.jsxs)(`span`,{className:`ch-path`,children:[s&&(0,G.jsx)(`span`,{className:`ch-pic-mark`,"aria-label":`picture`,children:`▣`}),(0,G.jsx)(`span`,{className:`ch-cut-name`,children:e.label})]}),(0,G.jsx)(cD,{f:i})]}),o]})]})}return(0,G.jsxs)(`li`,{className:`ch-li`,children:[n&&(0,G.jsx)(lD,{box:n}),(0,G.jsxs)(`div`,{className:`ch-row ch-quiet`,style:oD(e.depth,!0),tabIndex:0,role:`group`,"aria-disabled":`true`,"aria-label":a,title:`${i.path} · ${VE(i)} · opens nothing`,children:[(0,G.jsx)(sD,{f:i}),(0,G.jsxs)(`span`,{className:`ch-name`,children:[(0,G.jsx)(`span`,{className:`ch-path`,children:(0,G.jsx)(`span`,{className:`ch-cut-name`,children:e.label})}),(0,G.jsx)(`span`,{className:`ch-why`,children:HE(i)}),(0,G.jsx)(cD,{f:i})]}),o]})]})}var fD=e=>Uy(e)===`meta`;function pD({lines:e}){return(0,G.jsx)(`div`,{className:`ch-lines`,children:(0,G.jsx)(`div`,{className:`ch-lines-in`,children:e.map((e,t)=>(0,G.jsx)(`div`,{className:`dl ${Uy(e)}`,children:e||` `},t))})})}function mD({label:e,tip:t,lines:n,eol:r}){return(0,G.jsxs)(`section`,{className:`ch-extra`,"aria-label":e,children:[(0,G.jsx)(`span`,{className:`ch-extra-h`,title:t,children:r?`${e} · line endings only`:e}),(0,G.jsx)(pD,{lines:n})]})}function hD({conflict:e}){return(0,G.jsx)(`div`,{className:`ch-nodiff ${e?`conflict`:``}`,children:e?`conflict: resolve it to see a difference`:`no difference in content`})}function gD({ctx:e,tree:t,f:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(``),s=e.project.name,c=e.changesTick;if((0,v.useEffect)(()=>{let e=!0;return H.changeDiff(s,t,n.path).then(t=>{e&&(i(t),o(``))},t=>e&&o(t.message)),()=>{e=!1}},[s,t,n.path,c]),a)return(0,G.jsx)(`span`,{className:`diff-none`,children:a});if(!r||r.path!==n.path)return(0,G.jsx)(`span`,{className:`diff-none`,children:`Reading the diff…`});let l=e=>!!r.eol?.includes(e),u=!!(r.index||r.open),d=r.cut&&JE(r.cut),f=!(!d||!r.diff||l(`diff`)||u),p=r.diff&&l(`diff`)?YE(r.diff,n).filter(fD):[];return(0,G.jsxs)(G.Fragment,{children:[r.diff&&!l(`diff`)&&(0,G.jsxs)(`div`,{className:`ch-block`,children:[(0,G.jsx)(pD,{lines:YE(r.diff,n)}),f&&(0,G.jsxs)(`div`,{role:`note`,className:`ch-cut`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`⋯`}),d]})]}),r.diff&&l(`diff`)&&(0,G.jsxs)(`div`,{role:`note`,className:`ch-eol`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`↵`}),`only the line endings changed (CRLF ↔ LF)`]}),p.length>0&&(0,G.jsx)(pD,{lines:p}),!r.diff&&u&&(0,G.jsx)(`div`,{className:`ch-disk-none`,children:`on disk: no difference against the base`}),!r.diff&&!u&&(0,G.jsx)(hD,{conflict:!!r.conflict}),r.index&&(0,G.jsx)(mD,{label:`in the index, not on disk`,tip:`The index differs from both the last commit and the disk: git commit would take this. Commit on this screen takes the disk, so it refuses until you choose`,lines:YE(r.index,n),eol:l(`index`)}),r.open&&(0,G.jsx)(mD,{label:`not committed`,tip:`A run undid on disk what it committed: against the base nothing is left, this is the change its branch holds`,lines:YE(r.open,n),eol:l(`open`)}),d&&!f&&(0,G.jsxs)(`div`,{role:`note`,className:`ch-cut ch-cut-alone`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`⋯`}),d]})]})}var _D=`past 10 MB: the picture is not shown`;function vD({ctx:e,tree:t,f:n,side:r,base:i}){let[a,o]=(0,v.useState)(null),s=H.changeFileUrl(e.project.name,t,n.path,r),c=e.changesTick,l=r===`now`&&(n.size??0)>10485760;(0,v.useEffect)(()=>{if(l)return;let e=!0,t=``;return(async()=>{let n=await fetch(s);if(!n.ok)throw Error((await n.json()).error);let r=await n.blob();e&&(t=URL.createObjectURL(r),o({url:t,size:r.size}))})().catch(t=>e&&o({err:t.message||`No picture`})),()=>{e=!1,t&&URL.revokeObjectURL(t)}},[s,c,l]);let u=r===`base`?`before`:`after`,d=l||a&&`err`in a&&/is past \d+ bytes/.test(a.err),f=l?n.size:a&&`url`in a?a.size:void 0;return(0,G.jsxs)(`figure`,{className:`ch-side-pic`,children:[(0,G.jsxs)(`figcaption`,{className:`ch-side-h`,children:[u,` · `,r===`base`?i??`base`:`on disk`]}),d?(0,G.jsx)(`div`,{className:`ch-pic-note`,children:_D}):a&&(`url`in a?(0,G.jsx)(`div`,{className:`ch-pic`,children:(0,G.jsx)(`img`,{src:a.url,alt:`${n.path}, ${u}`})}):(0,G.jsx)(`div`,{className:`ch-pic-note`,children:a.err})),f!==void 0&&(0,G.jsx)(`span`,{className:`ch-size`,children:UE(f)})]})}function yD({ctx:e,tree:t,f:n,base:r}){let i=n.status===`added`||n.status===`untracked`,a=n.status===`deleted`;return(0,G.jsxs)(G.Fragment,{children:[(i||a)&&(0,G.jsx)(`span`,{className:`ch-only`,children:i?`added: only after`:`deleted: only before`}),(0,G.jsxs)(`div`,{className:`ch-pics`,children:[!i&&(0,G.jsx)(vD,{ctx:e,tree:t,f:n,side:`base`,base:r}),!a&&(0,G.jsx)(vD,{ctx:e,tree:t,f:n,side:`now`,base:r})]})]})}function bD(e){return e===`main`?`The project folder: what is not committed`:`The worktree of ${e}, against where it left the main checkout: what its run committed on its branch and what it has not committed`}function xD({trees:e,tree:t,running:n,onPick:r}){return(0,G.jsx)(`div`,{role:`tablist`,"aria-label":`Which checkout`,className:`ch-trees`,onKeyDown:n=>{let i={ArrowRight:1,ArrowLeft:-1}[n.key];if(!i)return;n.preventDefault();let a=e[(e.findIndex(e=>e.id===t)+i+e.length)%e.length];r(a.id),n.currentTarget.querySelector(`[data-tree="${CSS.escape(a.id)}"]`)?.focus()},children:e.map(e=>{let i=n.includes(e.id)?`running`:e.verified?`verified`:`stopped`;return(0,G.jsxs)(`button`,{role:`tab`,"aria-selected":e.id===t,tabIndex:e.id===t?0:-1,"data-tree":e.id,className:`ch-tab`,title:bD(e.id),onClick:()=>r(e.id),children:[e.id!==`main`&&(0,G.jsx)(`span`,{className:`ch-dot ${i}`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:WE(e,n)})]},e.id)})})}function SD({f:e,tree:t,base:n}){let r=e.status===`deleted`?`no size: deleted`:UE(e.size)||`no size`,i=qE(t,n);return(0,G.jsxs)(`div`,{className:`ch-pane-top`,children:[(0,G.jsxs)(`div`,{className:`ch-pane-row`,children:[(0,G.jsx)(sD,{f:e}),(0,G.jsx)(`code`,{className:`ch-pane-h`,children:e.path})]}),e.from&&(0,G.jsxs)(`span`,{className:`ch-pane-sub`,children:[`from `,e.from]}),(0,G.jsxs)(`span`,{className:`ch-pane-sub`,children:[r,i?` · ${i}`:``]})]})}function CD(e,t){let n=`${e.count} file${e.count===1?``:`s`}`,r=qE(t,e.base);return r?`${n} · ${r}`:n}function wD({tree:e,base:t}){if(!t)return(0,G.jsxs)(`div`,{className:`ch-empty`,children:[(0,G.jsx)(`span`,{className:`ch-empty-h`,children:`Not in git`}),(0,G.jsx)(`span`,{className:`ch-empty-sub`,children:`This project has no commits to compare its files with.`})]});let n=GE(t);return(0,G.jsxs)(`div`,{className:`ch-empty`,children:[(0,G.jsx)(`span`,{className:`ch-empty-mark`,"aria-hidden":`true`,children:`✓`}),(0,G.jsx)(`span`,{className:`ch-empty-h`,children:`Nothing uncommitted`}),(0,G.jsxs)(`span`,{className:`ch-empty-sub`,children:[e===`main`?`The main checkout matches its last commit`:`This worktree holds no work`,`, ${n}`,`.`]})]})}function TD(){let[e,t]=(0,v.useState)(new Set),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(null);return{unticked:e,setUnticked:t,msg:n,setMsg:r,outcome:i,setOutcome:a}}var ED=72,DD=e=>`${e} file${e===1?``:`s`}`;function OD(e,t,n){return e?`Off while a run writes in main`:t?n?`Commits the ${t} ticked file${t===1?``:`s`} with this message, through the commit gate · Ctrl+Enter`:`Write the message first: its first line is the subject`:`Tick the files to commit`}function kD(e,t,n){return e?`Off while a run writes in main`:t?n?`Opens a new project chat thread: the agent reads the diff of each ticked file and commits what belongs to the project. The box goes with it as an instruction, and may be empty. Nothing is committed by this click`:`Off: only files under gcf/ are ticked, and the agent cannot commit those`:`Tick the files first`}function AD({outcome:e,dismiss:t}){return e?.phase===`done`?(0,G.jsxs)(`div`,{role:`status`,className:`ch-done`,children:[(0,G.jsx)(`span`,{className:`ch-done-mark`,"aria-hidden":`true`,children:`✓`}),(0,G.jsx)(`code`,{className:`ch-done-hash`,children:e.hash}),(0,G.jsx)(`span`,{className:`ch-done-subject`,children:e.subject}),(0,G.jsxs)(`span`,{className:`ch-done-files`,children:[`· `,DD(e.files)]}),(0,G.jsx)(`button`,{className:`icon-btn ch-done-x`,"aria-label":`Dismiss`,onClick:t,children:`×`})]}):e?.phase===`refused`?(0,G.jsxs)(`div`,{role:`alert`,className:`ch-refused`,children:[(0,G.jsxs)(`span`,{className:`ch-refused-h`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`✘`}),`Not committed`,(0,G.jsx)(`span`,{className:`ch-refused-sub`,children:`the message and the ticks are kept`}),(0,G.jsx)(`button`,{className:`icon-btn ch-done-x`,"aria-label":`Dismiss`,onClick:t,children:`×`})]}),(0,G.jsx)(`span`,{className:`ch-refused-words`,children:(0,G.jsx)(Ce,{text:e.words,toned:!0})})]}):null}function jD({msg:e,setMsg:t,outcome:n,dismiss:r,ticked:i,run:a,chat:o,onCommit:s,onAgent:c}){let l=n?.phase===`busy`,u=e.split(`
117
- `)[0].trim(),d=i.length,f=i.filter(e=>!Re(e.path)).length,p=!a&&!l&&!!u&&d>0,m=!a&&!l&&f>0;return(0,G.jsxs)(`div`,{className:`ch-commit`,role:`group`,"aria-label":`Commit the ticked files`,children:[(0,G.jsx)(AD,{outcome:n,dismiss:r}),(0,G.jsxs)(`label`,{className:`ch-msg`,children:[(0,G.jsxs)(`span`,{className:`ch-msg-h`,children:[`Message`,(0,G.jsx)(`span`,{className:`ch-msg-sub`,children:`the first line is the subject`}),(0,G.jsxs)(`span`,{className:`ch-msg-len ${u.length>ED?`long`:``}`,title:`The subject's length; ${ED} reads well in git log`,children:[u.length,` / `,ED]})]}),(0,G.jsx)(`textarea`,{value:e,rows:3,disabled:l,spellCheck:!1,placeholder:`Message · the first line is the subject. With Commit with agent: an instruction, or nothing`,onChange:e=>t(e.target.value),onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&e.key===`Enter`&&p&&(e.preventDefault(),s())}})]}),(0,G.jsxs)(`div`,{className:`ch-commit-btns`,children:[(0,G.jsxs)(`button`,{className:`btn-primary`,disabled:!p,"aria-busy":l,title:OD(a,d,u),onClick:s,children:[l?`Committing…`:`Commit`,(0,G.jsx)(`span`,{className:`ch-commit-n`,children:DD(d)})]}),o&&(0,G.jsxs)(`button`,{className:`btn btn-agent`,disabled:!m,title:kD(a,d,f),onClick:c,children:[(0,G.jsx)(Va,{}),`Commit with agent`]}),(0,G.jsx)(`kbd`,{className:`ch-kbd`,title:`Ctrl+Enter presses Commit`,children:`Ctrl+Enter`})]}),a&&(0,G.jsxs)(`span`,{role:`note`,className:`ch-off-note`,children:[(0,G.jsx)(`span`,{className:`ch-dot running`,"aria-hidden":`true`}),`Both off while a run writes in main`]}),o&&!a&&!l&&f<d&&(0,G.jsx)(`span`,{role:`note`,className:`ch-gcf-note`,children:`The agent cannot commit files under gcf/: use Commit`})]})}function MD({ctx:e}){let[t,n]=(0,v.useState)(`main`),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(new Set),{unticked:d,setUnticked:f,msg:p,setMsg:m,outcome:h,setOutcome:g}=e.commitBox,[_,y]=(0,v.useState)(0),b=e.project.name,x=e.changesTick;(0,v.useEffect)(()=>{let e=!0;return H.changes(b,t).then(n=>{e&&(i(n),o(``),t===`main`&&f(e=>eD(e,n.files,n.more)))},r=>{e&&(t!==`main`&&/has no worktree/.test(r.message)?(n(`main`),c(null),u(new Set)):o(r.message))}),()=>{e=!1}},[b,t,x,_]);let S=(e.board.runs?.active??[]).flatMap(e=>e.ids),C=r?.trees??[{id:`main`}],w=r?.tree===t?r:null,T=w?.files??[],E=T.find(e=>e.path===s&&BE(e)),D=GE(w?.base??null)||null,O=t===`main`&&e.changes?.count===null,k=e=>{n(e),c(null),u(new Set)},A=e=>{let t=new Set(l);t.delete(e)||t.add(e),u(t)},j=!!e.board.domain.sections.changes?.commit,M=j&&t===`main`&&T.length>0,N=M?ZE(T,d):[],P=h?.phase===`busy`,F=(e,t)=>{f($E(d,e,t)),h?.phase!==`busy`&&g(null)},I=(e,t)=>{let n=QE(e,d);return{state:n,off:P,toggle:()=>F(e,n!==`true`),tip:n===null?`Nothing here can be ticked: hover a file for why`:`${n===`true`?`Untick`:`Tick`} ${t}${n===`mixed`?` · part of it is ticked`:``}`}},L=e=>{let t=QE([e],d)===`true`;return{state:QE([e],d),off:P,toggle:()=>F([e],!t),tip:XE(e)||`${t?`Ticked: the commit takes it. Click to leave it out`:`Left out of the commit. Click to tick`} · the row itself opens ${BE(e)?`its diff`:`nothing`}`}},ee=async()=>{g({phase:`busy`});try{let e=await H.commitChanges(b,p,N.map(e=>e.path));e.ok?(g({phase:`done`,hash:e.hash,subject:e.subject,files:e.files}),m(``),f(new Set)):g({phase:`refused`,words:e.err})}catch(e){g({phase:`refused`,words:e.message})}y(e=>e+1)},te=async()=>{(await Ba(e,za(N.map(e=>e.path).filter(e=>!Re(e)),p))).sent&&m(``)},ne=w&&CD(w,t);return(0,G.jsxs)(`div`,{className:`ch-page ${E?`ch-opened`:``}`,children:[(0,G.jsxs)(`div`,{className:`ch-top`,children:[(0,G.jsxs)(`div`,{className:`ch-top-row`,children:[(0,G.jsx)(`h1`,{className:`ch-title`,children:`Changes`}),ne&&(0,G.jsx)(`span`,{className:`ch-head`,children:M?`${N.length} of ${ne}`:ne}),!(j&&t===`main`)&&(0,G.jsxs)(`span`,{className:`ch-view-only`,tabIndex:0,title:`View only: a run commits its own work on its branch; nothing here changes a file`,children:[(0,G.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z`}),(0,G.jsx)(`path`,{d:`M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6z`})]}),`view only`]})]}),(0,G.jsx)(xD,{trees:C,tree:t,running:S,onPick:k}),t===`main`&&w?.branch&&e.board.domain.sections.changes?.push&&(0,G.jsx)(aD,{ctx:e,branch:w.branch,running:O,branches:C.length-1,reread:()=>y(e=>e+1)}),O&&(0,G.jsxs)(`div`,{role:`status`,className:`ch-banner`,children:[(0,G.jsx)(`span`,{className:`ch-dot running`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:`A run writes in the main checkout now: this list changes as it works, the header counts nothing, and Commit and Commit with agent wait until it ends.`})]})]}),a&&(0,G.jsxs)(`div`,{role:`alert`,className:`read-fail`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`✘`}),(0,G.jsx)(`span`,{children:a})]}),(0,G.jsxs)(`div`,{role:`tabpanel`,className:`ch-body ${w&&!T.length?`ch-one`:``}`,children:[(0,G.jsxs)(`div`,{className:`ch-col`,children:[(0,G.jsxs)(`div`,{className:`ch-list`,children:[w&&!T.length&&(0,G.jsx)(wD,{tree:t,base:w.base}),M&&(0,G.jsxs)(`div`,{className:`ch-all`,children:[(0,G.jsx)(lD,{box:I(T,`every file that can be committed`)}),(0,G.jsx)(`span`,{className:`ch-all-word`,children:{true:`all ticked`,mixed:`${N.length} ticked`,false:`none ticked`}[QE(T,d)??`false`]})]}),(0,G.jsx)(`ul`,{className:`ch-rows`,"aria-label":`Changed files`,children:iD(T,l).map(e=>e.kind===`dir`?(0,G.jsx)(uD,{r:e,box:M?I(e.files,`every file under ${e.key}`):null,onToggle:()=>A(e.key)},e.key):(0,G.jsx)(dD,{r:e,on:e.file===E,box:M?L(e.file):null,onOpen:()=>c(e.file.path)},e.file.path))}),w&&w.more>0&&(0,G.jsxs)(`div`,{className:`ch-more`,title:`The list ends at 2000 files`,children:[`and `,w.more,` more`,(0,G.jsx)(`span`,{children:`The list ends at 2000 files`})]})]}),M&&(0,G.jsx)(jD,{msg:p,setMsg:e=>{m(e),h?.phase===`done`&&g(null)},outcome:h,dismiss:()=>g(null),ticked:N,run:O,chat:!!e.board.domain.chat,onCommit:()=>void ee(),onAgent:()=>void te()}),!M&&t===`main`&&h&&h.phase!==`busy`&&(0,G.jsx)(`div`,{className:`ch-commit`,children:(0,G.jsx)(AD,{outcome:h,dismiss:()=>g(null)})})]}),w&&T.length>0&&(0,G.jsx)(`div`,{className:`ch-pane`,"aria-label":`Difference`,children:E?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{className:`ch-back`,onClick:()=>c(null),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`←`}),`Changes`]}),(0,G.jsx)(SD,{f:E,tree:t,base:D}),(0,G.jsx)(`div`,{className:`ch-pane-body`,children:E.view===`image`?(0,G.jsx)(yD,{ctx:e,tree:t,f:E,base:D},`${t} ${E.path}`):(0,G.jsx)(gD,{ctx:e,tree:t,f:E})})]}):(0,G.jsx)(`p`,{className:`ch-hint`,children:`Pick a file: a text file shows its diff, a picture before | after. A quiet row opens nothing; its tooltip says why.`})})]})]})}var ND=50,PD=Date.now();function FD({ctx:e,id:t}){let[n,r]=(0,v.useState)(``);(0,v.useEffect)(()=>fe(e.project.name,t,()=>r(``),e=>r(t=>(t+e).slice(-32768))),[e.project.name,t]);let i=nC(n).filter(e=>e.kind!==`start`).slice(-6);return(0,G.jsxs)(`div`,{className:`runs-log`,"aria-live":`polite`,"aria-label":`Live log`,children:[!i.length&&(0,G.jsx)(`span`,{className:`dim`,children:`no output yet`}),i.map((e,t)=>(0,G.jsxs)(`div`,{className:`log-${e.kind}`,children:[(0,G.jsx)(`span`,{className:`dim`,children:e.time}),(0,G.jsx)(`span`,{title:e.text,children:e.text})]},t))]})}var ID=(e,t)=>e&&(e.model||e.effort)?`on ${e.model??`its own model`} · ${e.effort??`its own effort`} · ${t}`:`on its own model`;function LD({ctx:e,run:t,list:n}){let r=`run:${t.id??`old-${t.ended}`}`,i=t.started&&t.started.slice(0,10)===t.ended.slice(0,10)?ra(t.ended):ia(t.ended),a=`${t.items.length} item${t.items.length>1?`s`:``}`,o=Date.parse(t.ended)>PD,s=[...new Set(t.items.map(e=>e.result))],c=s.some(e=>yC[e]!==`ok`),l=t=>e.board.items.find(e=>e.id===t)?.title||t;return(0,G.jsx)(No,{cat:t.started?`${ia(t.started)} → ${i}`:`ended ${i}`,origin:t.mode,age:t.started?gC(Date.parse(t.ended)-Date.parse(t.started)):``,title:t.items.map(e=>l(e.id)).join(` · `),sub:`${vC(t.cost_usd)} · ${a}${o?` · this session`:``}`,mark:s.join(` · `),markTone:c?`warn`:`ok`,accent:o,on:e.detailKey===r,tip:`Open: its items, their stats and logs`,onOpen:()=>e.openDetail({key:r,render:e=>({cat:`Run · ${t.mode}`,origin:a,age:vC(t.cost_usd),body:(0,G.jsx)(SC,{ctx:e,run:t,list:n,onPart:(t,n)=>e.openItem(t,n.kind,n)})})})})}var RD=e=>`its own: ${e.model??`default`} · ${e.effort??`default`}`;function zD({ctx:e}){let{board:t}=e,n=t.runs,r=e=>t.items.find(t=>t.id===e),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(ND),[c,l]=(0,v.useState)(``),u=Ka(e),d=ja(t),f=(n?.reports??[]).map(e=>e.id).join(` `),p=(0,v.useRef)(0);(0,v.useEffect)(()=>{if(!d)return;let t=++p.current;H.pastRuns(e.project.name,o+1).then(e=>{t===p.current&&(a(e),l(``))},e=>t===p.current&&l(e.message))},[e.project.name,o,d,f,n?.active.length]);let m=(n?.active??[]).flatMap(e=>{let t=e.ids.map(r).find(e=>e?.running)??r(e.ids[0]);return t?[{run:e,item:t}]:[]}),h=new Set(m.map(e=>e.item.id)),g=t.items.filter(e=>e.running&&!h.has(e.id)),_=n?.queued??[],y=(i??[]).slice(0,o);return(0,G.jsxs)(`section`,{className:`page runs`,"aria-label":`Runs`,children:[(0,G.jsxs)(`div`,{className:`runs-head`,children:[(0,G.jsx)(`h1`,{children:`Runs`}),(0,G.jsxs)(`span`,{className:`mono dim`,title:`Where runs work`,children:[`runs: `,t.run_mode]}),(0,G.jsxs)(`div`,{className:`run-next runs-start`,title:`The run gate picks them; the dialog asks for a model and effort for this run${d?``:` (not with this harness)`}`,children:[(0,G.jsx)(`button`,{disabled:u.busy,onClick:()=>void u.go(),children:u.busy?`asking the run gate…`:`Run next`}),(0,G.jsx)(`input`,{type:`number`,min:1,max:20,value:u.count,onChange:e=>u.setCount(Math.max(1,Math.min(20,Number(e.target.value)||1))),"aria-label":`How many to run, 1 to 20`})]})]}),(0,G.jsxs)(`section`,{"aria-label":`Active runs`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[`Active`,(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),!m.length&&!g.length&&(0,G.jsx)(`p`,{className:`empty-box`,children:n?.paused?`Nothing runs: the queue is paused.`:`Nothing runs now.`}),m.map(({run:t,item:n})=>{let r=fa(n),i=!!(t.model||t.effort);return(0,G.jsxs)(`article`,{className:`runs-active`,children:[(0,G.jsxs)(`div`,{className:`runs-active-top`,children:[(0,G.jsxs)(`div`,{className:`runs-active-name`,children:[(0,G.jsx)(`span`,{className:`mono strong`,children:n.id}),n.title&&(0,G.jsx)(`span`,{className:`dim small`,children:n.title})]}),!r&&n.active_at&&(0,G.jsx)(Vi,{at:n.active_at})]}),(0,G.jsxs)(`div`,{className:`runs-facts mono`,children:[(0,G.jsx)(`span`,{children:t.mode}),(0,G.jsxs)(`span`,{children:[`started `,ra(t.started)]}),(0,G.jsxs)(`span`,{children:[Math.max(1,Math.round((Date.now()-Date.parse(t.started))/6e4)),` min`]}),(0,G.jsx)(`span`,{className:i?``:`dim`,title:`The model and effort of this run; ${RD(n)}`,children:ID(t,`this run's pick`)}),i&&(0,G.jsx)(`span`,{className:`dim`,children:RD(n)})]}),t.ids.length>1&&(0,G.jsxs)(`span`,{className:`mono dim small`,children:[`item `,t.ids.indexOf(n.id)+1,` of `,t.ids.length,`: `,t.ids.join(`, `)]}),r&&(0,G.jsxs)(`span`,{className:`runs-limit mono`,children:[`◷ `,da(r,n.resume?.reserve),` · waits for the reset by itself`,` `,(0,G.jsx)(ma,{ctx:e,of:{id:n.id}})]}),(0,G.jsx)(FD,{ctx:e,id:n.id}),(0,G.jsxs)(`div`,{className:`runs-acts`,children:[(0,G.jsx)(`button`,{className:`btn`,onClick:()=>e.openItem(n.id,`log`),children:`Whole log`}),(0,G.jsx)(`button`,{className:`btn-danger`,title:r?`Ends the wait for the reset: paused: limit`:`Stops the agent session; the item stays ready and its work is kept`,onClick:()=>void Ja(e,n),children:`Stop`})]})]},t.started+n.id)}),g.map(t=>(0,G.jsxs)(`button`,{className:`runs-other`,onClick:()=>e.openItem(t.id),children:[(0,G.jsx)(`span`,{className:`mono strong`,children:t.id}),(0,G.jsxs)(`span`,{className:`running-text small`,children:[`◐ `,ta(t)]})]},t.id))]}),(0,G.jsxs)(`section`,{"aria-label":`Queue`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[`Queue · `,_.length,n?.paused?` · paused`:``,(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),n?.paused&&(0,G.jsx)(`button`,{className:`btn runs-resume`,onClick:()=>void e.resumeQueue(),children:`queue paused — resume`}),!_.length&&(0,G.jsx)(`span`,{className:`dim`,children:`empty`}),_.map((t,i)=>{let a=r(t)?.waits_for??[],o=n?.queued_with?.[t];return(0,G.jsxs)(`div`,{className:`runs-q`,role:`button`,tabIndex:0,title:`Open ${t}`,onClick:()=>e.openItem(t),onKeyDown:n=>{n.target!==n.currentTarget||n.key!==`Enter`&&n.key!==` `||(n.preventDefault(),e.openItem(t))},children:[(0,G.jsxs)(`div`,{className:`runs-q-line`,children:[(0,G.jsxs)(`span`,{className:`mono dim`,children:[`#`,i+1]}),(0,G.jsx)(`span`,{className:`mono strong`,children:t}),(0,G.jsx)(`span`,{className:`mono small ${o?``:`dim`}`,title:`What it will run on`,children:ID(o,`for this run`)}),a.length>0&&(0,G.jsxs)(`span`,{className:`dim small`,children:[`⧗ waits for `,a.join(`, `)]})]}),(0,G.jsx)(Po,{label:`Remove from queue`,tip:`Remove from queue; it asks nothing`,onClick:n=>{n.stopPropagation(),e.unqueue(t)}})]},t)})]}),(0,G.jsxs)(`section`,{"aria-label":`Past runs`,children:[(0,G.jsxs)(`h2`,{className:`section-h`,children:[`Past runs`,i?` · ${y.length}${i.length>o?`+`:``}`:``,(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),!d&&(0,G.jsxs)(`div`,{role:`note`,className:`empty-box chat-old`,children:[(0,G.jsx)(`span`,{children:`Past runs need gcf-harness-aif-ext ≥ 0.13: this harness keeps no run record the board can read. Active runs show above.`}),(0,G.jsx)(`code`,{children:`update gcf-harness-aif-ext`})]}),d&&c&&(0,G.jsxs)(`p`,{role:`alert`,className:`error-text`,children:[`✘ `,c]}),d&&!i&&!c&&(0,G.jsx)(`p`,{className:`dim`,children:`reading the run log…`}),d&&i&&!i.length&&(0,G.jsx)(`p`,{className:`dim`,children:`No run in the run log yet.`}),y.length>0&&(0,G.jsx)(`div`,{className:`wide-only`,children:(0,G.jsx)(Fo,{children:y.map((t,n)=>(0,G.jsx)(LD,{ctx:e,run:t,list:i??[]},t.id??`old-${t.ended}-${n}`))})}),(0,G.jsx)(`div`,{className:`phone-only runs-rows`,children:y.map((t,n)=>(0,G.jsx)(SC,{ctx:e,run:t,list:i??[],onPart:(t,n)=>e.openItem(t,n.kind,n)},t.id??`old-${t.ended}-${n}`))}),i&&i.length>0&&(0,G.jsxs)(`div`,{className:`runs-more`,children:[(0,G.jsx)(`span`,{className:`dim small`,children:i.length>o?`${o} shown · ${ND} at a time, newest first`:`all ${i.length} shown · newest first`}),i.length>o&&(0,G.jsxs)(`button`,{className:`btn-line`,onClick:()=>s(o+ND),children:[`Show `,ND,` more`]})]})]})]})}function BD(e,t){let n=t.filter(t=>!e.has(t));for(let t of n)e.set(t,{});return n}function VD(e,t){if(!t.size)return e;let n=e.domain.runs_from;return{...e,items:e.items.map(e=>t.has(e.id)&&!e.running&&e.status===n?{...e,running:!0,running_kind:`board`,starting:!0}:e)}}function HD(e,t,n){let r=new Set(t.items.filter(e=>e.running).map(e=>e.id)),i=new Map;for(let[a,o]of e){let e=t.items.find(e=>e.id===a);if(e&&!e.running&&e.status===t.domain.runs_from){if(o.after!==void 0&&n>o.after){let e=t.runs?.active.find(e=>e.ids.includes(a));if(!e||e.ids.some(e=>r.has(e)))continue}i.set(a,o)}}return i}function UD(e){let t=e.title??e.tool;return`${t.length>80?`${t.slice(0,79)}…`:t} (${e.group?`deny group ${e.group}`:`a deny rule`})`}var WD=(e,t)=>e?t.filter(t=>!e.has(t)):[];function GD(e,t,n){let r=(0,v.useRef)(null),i=(0,v.useRef)({entries:e,tell:n});i.current={entries:e,tell:n};let a=e.map(e=>e.key).join(` `);(0,v.useEffect)(()=>{if(!t)return;let{entries:e,tell:n}=i.current,a=new Set(WD(r.current,e.map(e=>e.key)));for(let t of e)a.has(t.key)&&n(t);r.current=new Set([...r.current??[],...e.map(e=>e.key)])},[a,t])}var KD=[`command`,`board`,`chat`,`inbox`,`design`,`runs`,`changes`,`playtest`,`ended`,`agent`,`metrics`,`more`],qD=`gcf-board-tools`,JD={command:`Command`,board:`Board`,chat:`Chat`,inbox:`Inbox`,design:`Design`,runs:`Runs`,changes:`Changes`,playtest:`Playtest`,ended:`Ended`,agent:`Agent`,metrics:`Metrics`,more:`More`},YD={design:`The game design: pillars, vision, units`,runs:`What runs, what waits, what ran`,changes:`What is not committed, and how it differs`,playtest:`What waits for a playtest, by subsystem`,ended:`Accepted items and the graveyard`,agent:`What runs may not do`,metrics:`What the runs did and cost`};function XD(e){let t=e.domain.sections,n={inbox:t.inbox||t.questions,design:t.design&&e.domain.starts,playtest:t.playtest,ended:t.history||t.graveyard,metrics:e.domain.harness,runs:e.domain.harness,changes:t.changes};return KD.filter(e=>e!==`more`&&(!(e in n)||n[e]))}function ZD({project:e,projects:t,screen:n,arg:r,go:i,notify:a,onLinks:o}){let[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(void 0),[h,g]=(0,v.useState)(void 0),[_,y]=(0,v.useState)(0),[b,x]=(0,v.useState)(null),[S,C]=(0,v.useState)([]),[w,T]=(0,v.useState)(null),[E,D]=(0,v.useState)(0),O=TD(),[k,A]=(0,v.useState)(!1),[j,M]=(0,v.useState)(null),[N,P]=(0,v.useState)(!1),[F,I]=(0,v.useState)(!1),[L,ee]=(0,v.useState)(()=>{try{return localStorage.getItem(qD)!==`shut`}catch{return!0}}),[te,ne]=(0,v.useState)(!1),R=(0,v.useRef)(new Set),z=(0,v.useRef)(new Set),B=(0,v.useRef)(new Map),V=(0,v.useRef)(We()),re=(0,v.useCallback)(()=>{let t=V.current.send();return H.board(e.name).then(e=>{if(!V.current.lands(t))return;let n=Hi(js(e,R.current),z.current);B.current=HD(B.current,n,t),c(VD(n,B.current)),u(``)},e=>V.current.lands(t)&&u(e.message))},[e.name]),ie=!!s?.domain.chat,ae=(0,v.useRef)(0),oe=(0,v.useCallback)(()=>{let t=++ae.current;H.talks(e.name).then(e=>{t===ae.current&&(C(e),A(!0))},()=>t===ae.current&&C([]))},[e.name]);(0,v.useEffect)(()=>(re(),le(t=>{(t.type===`board`&&t.project===e.name||t.type===`quota`)&&re(),t.type===`talks`&&t.project===e.name&&oe()},()=>{re(),oe()})),[re,oe,e.name]),(0,v.useEffect)(()=>{ie&&oe()},[ie,oe]);let se=!!s?.domain.sections.changes;(0,v.useEffect)(()=>{if(!se)return;let t=ue(e.name,e=>{T(e.unknown?null:e),D(e=>e+1)});return()=>{t(),T(null)}},[se,e.name]);let U=(0,v.useRef)(()=>{});(0,v.useEffect)(()=>{let e=e=>U.current(e);return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let W=async(t,n,r=!1)=>{try{let i=await H.move(e.name,t),o=r||i.held===!0;(i.ok||!o)&&a(i.ok?i.out||`done`:i.err||i.out,i.ok?`ok`:`error`);let s=Ie(i.refusal);!i.ok&&s&&!r&&!n&&t.proposal===void 0&&nb(s,i.err||i.out);let c=re();return n&&await c,{ok:i.ok,out:i.out,err:i.ok?``:i.err||i.out,refused:!i.ok,...i.refusal&&{refusal:i.refusal}}}catch(e){return r||a(e.message,`error`),{ok:!1,out:``,err:e.message,refused:!1}}},ce=e=>W(e,!0),de=async e=>(await W(e,!1)).ok,fe=e=>W(e,!1,!0),pe=(e,t)=>{R.current.add(t),c(e=>e&&js(e,R.current)),de({cmd:e,id:t}).finally(()=>{R.current.delete(t),re()})},me=t=>void Ui(z.current,t,{show:()=>c(e=>e&&Hi(e,z.current)),ask:()=>H.closeReport(e.name,t),read:re,refused:e=>a(e.message,`error`)}),he=async(t,n=!1,r)=>{let i=BD(B.current,t);c(e=>e&&VD(e,B.current));try{let o=await H.run(e.name,t,n,r),s=[r?.model,r?.effort,r?.mode].filter(Boolean).join(`, `),c=o.queued??[];for(let e of i)c.includes(e)?B.current.delete(e):B.current.has(e)&&B.current.set(e,{after:V.current.last()});let l=t.filter(e=>!c.includes(e));return a(`${[l.length?`run started: ${l.join(`, `)}`:``,c.length?`queued behind the main run: ${c.join(`, `)}`:``].filter(Boolean).join(` · `)}${s?` · on ${s} for this run`:``}`),re(),!0}catch(e){a(e.message,`error`);for(let e of i)B.current.delete(e);return re(),!1}},ge=async t=>{try{let n=await H.stop(e.name,t);a(n.ok?n.out:n.err||n.out,n.ok?`ok`:`error`),re()}catch(e){a(e.message,`error`)}},_e=async t=>{try{let n=await H.hold(e.name,t);a(n.ok?n.out:n.err||n.out,n.ok?`ok`:`error`),re()}catch(e){a(e.message,`error`)}},ve=async t=>{await H.unqueue(e.name,t).catch(e=>a(e.message,`error`)),re()},ye=async()=>{await H.resumeQueue(e.name).catch(e=>a(e.message,`error`)),re()},xe=async t=>{await H.autopilot(e.name,t).catch(e=>a(e.message,`error`)),re()},Se=async t=>{await H.holdProject(e.name,t).catch(e=>a(e.message,`error`)),re()},Ce=async()=>{await H.askUsage().catch(e=>a(e.message,`error`))},we=(s?.items??[]).flatMap(e=>e.run_end?[{key:`${e.id}@${e.run_end.at}`,text:`${e.id}: ${e.run_end.outcome}`}]:[]),Te=!!s;GD(we,Te,e=>a(`run ended: ${e.text} — its card is in its chat`));let Ee=(s?.items??[]).flatMap(e=>e.denied?[{key:`${e.id}@${e.denied.at}`,text:`${e.id}: ${UD(e.denied)}`,open:()=>{f(e.id),m(`chat`),g(void 0),y(e=>e+1),x(null)}}]:[]),Oe=S.flatMap(e=>e.denied?[{key:`${e.id}@${e.denied.at}`,text:`${e.title??`a thread`}: ${UD(e.denied)}`,open:()=>i(`chat`,e.id)}]:[]),ke=e=>a(`agent refused: ${e.text} — its card is in its chat`,`warn`,e.open,`Open its card`);GD(Ee,Te,ke),GD(Oe,k,ke);let Ae=s?.runs?.autopilot?.stop,je=Ae?.kind===`play`?Ae.text:``;(0,v.useEffect)(()=>{je&&a(je)},[je,a]);let Me=[s?.items,s?.history,s?.graveyard].map(e=>(e??[]).map(e=>e.id).join(`
118
- `)).join(`
119
-
120
- `),Ne=(0,v.useRef)(null),Pe=(0,v.useMemo)(()=>{let[t,n,r]=Me.split(`
121
-
122
- `).map(e=>e.split(`
123
- `).filter(Boolean));return{known:new Set([...t,...n,...r]),open:e=>Ne.current?.(e),openApart:t=>window.open(`#${encodeURIComponent(e.name)}/board/${encodeURIComponent(t)}`),ended:e=>t.includes(e)?null:n.includes(e)?`history`:`graveyard`}},[Me,e.name]);(0,v.useEffect)(()=>(o(Pe),()=>o(null)),[Pe,o]);let Fe=n===`board`?r:void 0,Le=!!s;if((0,v.useEffect)(()=>{Fe&&Le&&Ne.current?.(Fe)},[Fe,Le]),!s)return(0,G.jsx)(`main`,{className:`boot`,role:`status`,children:l?(0,G.jsxs)(`span`,{className:`boot-error`,role:`alert`,children:[`✘ `,l]}):`reading gcf board --json…`});let Re=(e={})=>{let t=fi(s.domain,s.domain.new_item);t&&M({title:`New item`,move:t,values:{title:e.title??``,from:e.from,...e.note?{note:e.note}:{}}})},ze=s.domain.fields.find(e=>e.key===`depends`)?.edit,Be=j?.id&&j.move.cmd===ze?s.items.find(e=>e.id===j.id):void 0,Ve={project:e,board:s,changes:w,changesTick:E,commitBox:O,notify:a,move:de,moveOut:ce,moveIn:fe,erase:pe,closeReport:me,run:he,stop:ge,hold:_e,unqueue:ve,resumeQueue:ye,setAutopilot:xe,holdProject:Se,askUsage:Ce,boardTools:L,toggleBoardTools:()=>{try{localStorage.setItem(qD,L?`shut`:`open`)}catch{}ee(!L)},openItem:(e,t,n)=>{f(e),m(t),g(n),y(e=>e+1),x(null)},openDetail:e=>{f(null),x(e)},closeDetail:()=>x(null),detailKey:b?.key??null,itemOpen:d,openMove:M,newItem:Re,go:i,openSettings:()=>{P(!1),ne(!1),I(!0)},talks:S,reloadTalks:oe};Ne.current=Ve.openItem;let He=s.items.find(e=>e.id===d),Ue=!He&&d?[...s.history??[],...s.graveyard??[]].some(e=>e.id===d):!1;U.current=e=>{if(e.key===`Escape`&&(d||b)&&!e.defaultPrevented&&!document.querySelector(`.modal`)){let t=e.target?.closest?.(`input, textarea, select, [contenteditable]`);t?t.blur():N||(f(null),x(null));return}if(ko(e)||document.querySelector(`.modal`))return;if(Wo(e,XD(s),i,()=>{P(!1),ne(!1),I(!0)})){e.preventDefault(),e.stopImmediatePropagation();return}let t=fi(s.domain,s.domain.sections.inbox?.add);if(e.key===`?`)P(!0);else if(e.key===`/`){let e=document.querySelector(N?`.help input`:`.screen [data-search], .screen input[type="search"]`);if(!e)return;!N&&!L&&e.matches(`[data-search]`)?(Ve.toggleBoardTools(),requestAnimationFrame(()=>{e.focus(),e.select()})):(e.focus(),e.select())}else if(e.key===`n`&&s.domain.new_item)Re();else if(e.key===`i`&&t)M({title:`Add to the inbox`,move:t,values:{}});else return;e.preventDefault()};let Ge=XD(s),Ke=Ge.includes(n)||n===`more`?n:`command`,qe=eo(s,S).length,Je=Xa(s),Ye=Ge.map(e=>({screen:e,label:JD[e],count:e===`command`?qe:e===`inbox`?Je:e===`chat`?S.filter(e=>e.waiting).length:0,needs:e===`command`||e===`chat`||e===`inbox`}));return(0,G.jsx)(be.Provider,{value:Pe,children:(0,G.jsxs)(`div`,{className:`project`,children:[(0,G.jsx)(Ko,{entries:Ye,screen:Ke,go:i}),(0,G.jsxs)(`div`,{className:`project-main`,children:[(0,G.jsx)(vs,{ctx:Ve,screen:Ke,projects:t,waiting:qe,onWaiting:()=>i(`command`),onHelp:()=>P(!N),onSettings:()=>{P(!1),ne(!1),I(!F)}}),(0,G.jsxs)(`div`,{className:`workspace`,children:[(0,G.jsxs)(`main`,{className:`screen screen-${Ke}`,children:[(0,G.jsx)(jE,{ctx:Ve}),l&&(0,G.jsxs)(`div`,{role:`alert`,className:`read-fail`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`✘`}),(0,G.jsxs)(`span`,{children:[l,` · The board shows the last good read.`]})]}),Ke===`command`&&(0,G.jsx)(IT,{ctx:Ve}),Ke===`board`&&(0,G.jsx)(Mo,{ctx:Ve}),Ke===`chat`&&(0,G.jsx)(BT,{ctx:Ve,thread:r}),Ke===`inbox`&&(0,G.jsx)(bc,{ctx:Ve}),Ke===`design`&&(0,G.jsx)(xE,{ctx:Ve,arg:r}),Ke===`runs`&&(0,G.jsx)(zD,{ctx:Ve}),Ke===`changes`&&(0,G.jsx)(MD,{ctx:Ve}),Ke===`playtest`&&(0,G.jsx)(Bw,{ctx:Ve}),Ke===`ended`&&(0,G.jsx)(xw,{ctx:Ve}),Ke===`metrics`&&(0,G.jsx)(jT,{ctx:Ve}),Ke===`agent`&&(0,G.jsx)(Uw,{ctx:Ve}),Ke===`more`&&(0,G.jsxs)(`div`,{className:`page more`,children:[Ye.filter(e=>e.screen in YD).map(e=>(0,G.jsxs)(`button`,{className:`more-row`,onClick:()=>i(e.screen),children:[(0,G.jsx)(`span`,{className:`more-label`,children:e.label}),(0,G.jsx)(`span`,{className:`more-sub`,children:YD[e.screen]})]},e.screen)),(0,G.jsxs)(`button`,{className:`more-row`,onClick:()=>{ne(!1),I(!0)},children:[(0,G.jsx)(`span`,{className:`more-label`,children:`Settings`}),(0,G.jsx)(`span`,{className:`more-sub`,children:`gcf/config.yml, one save each; this browser's theme`})]}),(0,G.jsxs)(`button`,{className:`more-row`,onClick:()=>P(!0),children:[(0,G.jsx)(`span`,{className:`more-label`,children:`Help`}),(0,G.jsx)(`span`,{className:`more-sub`,children:`Every word the board uses, the moves, the fields`})]}),(0,G.jsxs)(`h2`,{className:`section-h more-head`,children:[`Projects`,(0,G.jsx)(`span`,{className:`rule`,"aria-hidden":`true`})]}),t.list.map(n=>(0,G.jsxs)(`div`,{className:`more-proj`,children:[(0,G.jsxs)(`button`,{className:`more-row`,"aria-current":n.name===e.name?`true`:void 0,onClick:()=>t.choose(n.name),children:[(0,G.jsxs)(`span`,{className:`more-label`,children:[n.name===e.name?`● `:``,n.name]}),(0,G.jsx)(`span`,{className:`more-sub mono`,children:n.path})]}),(0,G.jsx)(Po,{label:`Remove ${n.name} from the board`,tip:`Take it off the board; its files stay`,onClick:()=>t.remove(n)})]},n.name)),(0,G.jsx)(`button`,{className:`more-row`,onClick:t.add,children:(0,G.jsx)(`span`,{className:`more-label`,children:`+ Add a project…`})})]})]}),He&&(0,G.jsx)(bw,{ctx:Ve,item:He,tab:p,part:h,onClose:()=>f(null)},`${He.id} ${p??``} ${_}`),b&&!He&&!Ue&&(0,G.jsx)(SE,{ctx:Ve,spec:b,onClose:()=>x(null)},b.key),Ue&&d&&(0,G.jsx)(vw,{ctx:Ve,id:d,part:h,onClose:()=>f(null)},`${d} ${_}`)]}),(0,G.jsx)(ys,{ctx:Ve})]}),(0,G.jsx)(qo,{entries:Ye,screen:Ke,go:i}),j&&Be?(0,G.jsx)(Tw,{ctx:Ve,id:Be.id,current:Be.depends,open:j,onClose:()=>M(null)},`${j.move.cmd} ${Be.id}`):j&&(0,G.jsx)(Rw,{ctx:Ve,open:j,onClose:()=>M(null)},`${j.move.cmd} ${j.id??``} ${j.title}`),(0,G.jsx)(rb,{ctx:Ve}),N&&(0,G.jsx)(FE,{domain:s.domain,onClose:()=>P(!1)}),F&&(0,G.jsx)(De,{onClose:()=>I(!1),dirty:te,children:(0,G.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Settings`,className:`settings-dialog`,onClick:e=>e.stopPropagation(),onInput:e=>{e.target.matches(`input:not([type=file]), textarea`)&&ne(!0)},children:[(0,G.jsx)(`button`,{className:`icon-btn bordered settings-close`,"aria-label":`Close the settings`,title:`Close · Esc`,autoFocus:!0,onClick:()=>I(!1),children:`×`}),(0,G.jsx)(dT,{ctx:Ve})]})}),(0,G.jsx)(Ga,{})]})})}function QD(){let[e=``,t=``,n]=location.hash.slice(1).split(`/`).map(e=>{try{return decodeURIComponent(e)}catch{return``}});return{name:e,screen:KD.includes(t)?t:`command`,arg:n||void 0}}function $D({onAdded:e,notify:t,onCancel:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``);return(0,G.jsxs)(`form`,{className:`form add-project`,onSubmit:async n=>{n.preventDefault();try{e(await H.addProject(r.trim(),a.trim())),i(``),o(``)}catch(e){t(e.message,`error`)}},children:[(0,G.jsxs)(`label`,{className:`field`,children:[(0,G.jsx)(`span`,{className:`field-label`,children:`Project folder`}),(0,G.jsx)(`input`,{className:`input`,placeholder:`C:\\games\\zombie-puzzle`,value:r,onChange:e=>i(e.target.value),required:!0,autoFocus:!0}),(0,G.jsx)(`span`,{className:`field-help`,children:`A folder with gcf/ in it (ai-factory gcf init).`})]}),(0,G.jsxs)(`label`,{className:`field`,children:[(0,G.jsx)(`span`,{className:`field-label`,children:`Name`}),(0,G.jsx)(`input`,{className:`input`,placeholder:`optional: the folder's name`,value:a,onChange:e=>o(e.target.value)})]}),(0,G.jsxs)(`div`,{className:`dialog-actions`,children:[n&&(0,G.jsx)(`button`,{type:`button`,className:`btn-line`,onClick:n,children:`Cancel`}),(0,G.jsx)(`button`,{type:`submit`,className:`btn-primary`,children:`Add project`})]})]})}function eO({closed:e}){return(0,G.jsx)(`div`,{className:`gone`,role:`alertdialog`,"aria-label":`The board's server is gone`,children:(0,G.jsxs)(`div`,{className:`gone-box`,children:[(0,G.jsx)(`span`,{className:`gone-title`,children:e?`The board was started again`:`The board's server is gone`}),(0,G.jsxs)(`span`,{className:`gone-text`,children:[`This page shows the last read and cannot act. Runs started from it go on by themselves.`,` `,e?`Open the board again from its link: the desktop shortcut, or the URL with ?t= that gcf-board printed.`:`Start gcf-board again; the page reconnects by itself.`]}),!e&&(0,G.jsxs)(`span`,{role:`status`,className:`gone-retry`,children:[(0,G.jsx)(`span`,{className:`dot pulse`,"aria-hidden":`true`}),`trying `,location.host,` again…`]})]})})}function tO(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(QD()),[i,a]=(0,v.useState)([]),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null),f=(0,v.useRef)(void 0),p=(0,v.useRef)(null),m=iT(),h=(0,v.useCallback)((e,t=`ok`,n,r)=>{let i=Date.now()+Math.random();a(a=>[...a,{id:i,text:e,kind:t,open:n,openLabel:r}]),setTimeout(()=>a(e=>e.filter(e=>e.id!==i)),t===`error`||n?12e3:4e3)},[]);(0,v.useEffect)(()=>{H.projects().then(t,e=>h(e.message,`error`));let e=()=>r(QD());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[h]),(0,v.useLayoutEffect)(()=>{if(!p.current)return;let e=oT(p.current,m);e.length&&h(`Theme ${m?.name}: this board has no token ${e.join(`, `)}`,`error`)},[m,h]),(0,v.useEffect)(()=>{m&&H.themes().then(e=>{if(rT()?.id!==m.id)return;let t=e.find(e=>e.id===m.id);t&&`tokens`in t?JSON.stringify(t)!==JSON.stringify(m)&&nT(t):(nT(null),h(`Theme ${m.name} ${t?`cannot be read: ${t.error}`:`is gone`}: back to dark`,`error`))},()=>{})},[]),(0,v.useEffect)(()=>de((e,t)=>{(e||t)&&(clearTimeout(f.current),f.current=void 0),e?d(null):t?d(`closed`):f.current??=setTimeout(()=>d(`retry`),3e3)}),[]);let g=(e,t,n)=>{location.hash=`${encodeURIComponent(e)}/${t}${n?`/${encodeURIComponent(n)}`:``}`},_=e?.find(e=>e.name===n.name)??e?.[0]??null,y=e=>{t(t=>[...t??[],e]),l(!1),g(e.name,`command`)},b={list:e??[],choose:e=>g(e,n.screen),add:()=>l(!0),remove:async e=>{if(await ke(`Take ${e.name} off the board? Its files stay as they are.`,`Remove`,!0))try{await H.removeProject(e.name),t(t=>t?.filter(t=>t.name!==e.name)??null)}catch(e){h(e.message,`error`)}}};return(0,G.jsxs)(`div`,{className:`app`,"data-gcf":`b`,ref:p,children:[!e&&(0,G.jsx)(`div`,{className:`boot`,children:`reading the projects…`}),e&&!e.length&&(0,G.jsxs)(`main`,{className:`welcome`,children:[(0,G.jsx)(`h1`,{children:`GCF board`}),(0,G.jsx)(`p`,{children:`No project yet. Add a folder that has gcf/ (ai-factory gcf init).`}),(0,G.jsx)($D,{notify:h,onAdded:y})]}),_&&(0,G.jsx)(ZD,{project:_,projects:b,screen:n.screen,arg:n.arg,go:(e,t)=>g(_.name,e,t),notify:h,onLinks:s},_.name),c&&(0,G.jsx)(De,{onClose:()=>l(!1),dirty:!1,children:(0,G.jsxs)(`div`,{className:`dialog`,role:`dialog`,"aria-modal":!0,"aria-label":`Add a project`,onClick:e=>e.stopPropagation(),children:[(0,G.jsx)(`h2`,{children:`Add a project`}),(0,G.jsx)($D,{notify:h,onAdded:y,onCancel:()=>l(!1)})]})}),u&&(0,G.jsx)(eO,{closed:u===`closed`}),(0,G.jsx)(Me,{}),(0,G.jsx)(`div`,{className:`toasts`,role:`status`,children:i.map(e=>(0,G.jsxs)(`div`,{className:`toast ${e.kind}`,children:[e.open?(0,G.jsxs)(`button`,{className:`toast-text toast-open`,onClick:()=>{e.open?.(),a(t=>t.filter(t=>t.id!==e.id))},children:[(0,G.jsx)(`span`,{children:e.text}),(0,G.jsxs)(`span`,{className:`toast-link`,children:[e.openLabel??`Open`,` ›`]})]}):(0,G.jsx)(`span`,{className:`toast-text`,children:(0,G.jsx)(be.Provider,{value:o,children:(0,G.jsx)(Ce,{text:e.text,toned:!0})})}),(0,G.jsx)(`button`,{className:`toast-close`,"aria-label":`Close`,onClick:()=>a(t=>t.filter(t=>t.id!==e.id)),children:`×`})]},e.id))})]})}(0,y.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(v.StrictMode,{children:(0,G.jsx)(tO,{})}));