ledung 1.0.0 → 1.2.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,108 +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),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 ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function M(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 te(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,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),te(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(A,`$&/`)+`/`)+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+j(a,u),c+=te(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+j(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(M(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 N(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(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 ne=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 re(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,ne)}catch(e){ne(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ie(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 re(ie.bind(null,e))}var ae={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(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=ae,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=ie,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:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=re,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.0`})),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&&A(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&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(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,A(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.0`})),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`),ee=Symbol.for(`react.portal`),A=Symbol.for(`react.fragment`),j=Symbol.for(`react.strict_mode`),M=Symbol.for(`react.profiler`),te=Symbol.for(`react.consumer`),N=Symbol.for(`react.context`),P=Symbol.for(`react.forward_ref`),ne=Symbol.for(`react.suspense`),re=Symbol.for(`react.suspense_list`),ie=Symbol.for(`react.memo`),ae=Symbol.for(`react.lazy`),oe=Symbol.for(`react.activity`),se=Symbol.for(`react.legacy_hidden`),ce=Symbol.for(`react.memo_cache_sentinel`),le=Symbol.for(`react.view_transition`),ue=Symbol.for(`react.recoverable`),de=Symbol.iterator;function fe(e){return typeof e!=`object`||!e?null:(e=de&&e[de]||e[`@@iterator`],typeof e==`function`?e:null)}var pe=Symbol.for(`react.client.reference`);function me(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case A:return`Fragment`;case M:return`Profiler`;case j:return`StrictMode`;case ne:return`Suspense`;case re:return`SuspenseList`;case oe:return`Activity`;case le:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case ee:return`Portal`;case N:return e.displayName||`Context`;case te:return(e._context.displayName||`Context`)+`.Consumer`;case P:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ie:return t=e.displayName||null,t===null?me(e.type)||`Memo`:t;case ae:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}var he=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge={pending:!1,data:null,method:null,action:null},_e=[],ve=-1;function ye(e){return{current:e}}function be(e){0>ve||(e.current=_e[ve],_e[ve]=null,ve--)}function xe(e,t){ve++,_e[ve]=e.current,e.current=t}var Se=ye(null),Ce=ye(null),we=ye(null),Te=ye(null);function Ee(e,t){switch(xe(we,t),xe(Ce,e),xe(Se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dp(t),e=fp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}be(Se),xe(Se,e)}function De(){be(Se),be(Ce),be(we)}function Oe(e){var t=e.memoizedState;t!==null&&(ch._currentValue=t.memoizedState,xe(Te,e)),t=Se.current;var n=fp(t,e.type);t!==n&&(xe(Ce,e),xe(Se,n))}function ke(e){Ce.current===e&&(be(Se),be(Ce)),Te.current===e&&(be(Te),ch._currentValue=ge)}var Ae,je;function Me(e){if(Ae===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ae=t&&t[1]||``,je=-1<e.stack.indexOf(`
2
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+Ae+e+je}var Ne=!1;function Pe(e,t){if(!e||Ne)return``;Ne=!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{Ne=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Me(n):``}function L(e,t){switch(e.tag){case 26:case 27:case 5:return Me(e.type);case 16:return Me(`Lazy`);case 13:return e.child!==t&&t!==null?Me(`Suspense Fallback`):Me(`Suspense`);case 19:return Me(`SuspenseList`);case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return Me(`Activity`);case 30:return Me(`ViewTransition`);default:return``}}function R(e){try{var t=``,n=null;do t+=L(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}}var Fe=Object.prototype.hasOwnProperty,Ie=t.unstable_scheduleCallback,Le=t.unstable_cancelCallback,Re=t.unstable_shouldYield,ze=t.unstable_requestPaint,Be=t.unstable_now,Ve=t.unstable_getCurrentPriorityLevel,He=t.unstable_ImmediatePriority,Ue=t.unstable_UserBlockingPriority,We=t.unstable_NormalPriority,Ge=t.unstable_LowPriority,Ke=t.unstable_IdlePriority,qe=t.log,Je=t.unstable_setDisableYieldValue,Ye=null,Xe=null;function Ze(e){if(typeof qe==`function`&&Je(e),Xe&&typeof Xe.setStrictMode==`function`)try{Xe.setStrictMode(Ye,e)}catch{}}var Qe=Math.clz32?Math.clz32:tt,$e=Math.log,et=Math.LN2;function tt(e){return e>>>=0,e===0?32:31-($e(e)/et|0)|0}var nt=256,rt=262144,it=4194304;function at(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 ot(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=at(n))):i=at(o):i=at(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=at(n))):i=at(o)):i=at(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 st(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ct(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-Qe(n),i=1<<r;t|=e[r],n&=~i}return t}function z(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 lt(){var e=it;return it<<=1,!(it&62914560)&&(it=4194304),e}function B(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ut(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dt(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-Qe(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&&ft(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ft(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Qe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function pt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Qe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function mt(e,t){var n=t&-t;return n=n&42?1:ht(n),(n&(e.suspendedLanes|t))===0?n:0}function ht(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 gt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function _t(){var e=I.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function vt(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var yt=Math.random().toString(36).slice(2),bt=`__reactFiber$`+yt,xt=`__reactProps$`+yt,St=`__reactContainer$`+yt,Ct=`__reactEvents$`+yt,wt=`__reactListeners$`+yt,Tt=`__reactHandles$`+yt,Et=`__reactResources$`+yt,Dt=`__reactMarker$`+yt,Ot=`__reactLoad$`+yt;function kt(e){delete e[bt],delete e[xt],delete e[wt],delete e[Tt]}function At(e){var t;if(t=e[bt])return t;for(var n=e.parentNode;n;){if(t=n[St]||n[bt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pm(e);e!==null;){if(n=e[bt])return n;e=pm(e)}return t}e=n,n=e.parentNode}return null}function jt(e){if(e=e[bt]||e[St]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Mt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Nt(e){var t=e[Et];return t||=e[Et]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Pt(e){e[Dt]=!0}function Ft(e){e[Ot]=void 0}var It=new Set,Lt={};function Rt(e,t){zt(e,t),zt(e+`Capture`,t)}function zt(e,t){for(Lt[e]=t,e=0;e<t.length;e++)It.add(t[e])}var Bt=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]*$`),Vt={},Ht={};function Ut(e){return Fe.call(Ht,e)?!0:Fe.call(Vt,e)?!1:Bt.test(e)?Ht[e]=!0:(Vt[e]=!0,!1)}var V=!1;function Wt(){var e=V;return V=!1,e}function Gt(e,t,n){if(Ut(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 H(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 U(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 Kt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Jt(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 Yt(e){if(!e._valueTracker){var t=qt(e)?`checked`:`value`;e._valueTracker=Jt(e,t,``+e[t])}}function Xt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Zt=/[\n"\\]/g;function Qt(e){return e.replace(Zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function $t(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=``+Kt(t)):e.value!==``+Kt(t)&&(e.value=``+Kt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):tn(e,Kt(n)):o===`number`&&e.value==t?tn(e,Kt(e.value)):tn(e,Kt(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=``+Kt(s):e.removeAttribute(`name`)}function en(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)){Yt(e);return}n=n==null?``:``+Kt(n),t=t==null?n:``+Kt(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),Yt(e)}function tn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function nn(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=``+Kt(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 rn(e,t,n){t!=null&&(t=``+Kt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Kt(n)}function an(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(he(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Kt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Yt(e)}function on(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var sn=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 cn(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||sn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function ln(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]=``,V=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(cn(e,a,r),V=!0)}else for(var o in t)t.hasOwnProperty(o)&&cn(e,o,t[o])}function un(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 dn=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`]]),fn=/^[\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 pn(e){return fn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function mn(){}var hn=null;function gn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _n=null,vn=null;function yn(e){var t=jt(e);if(t&&(e=t.stateNode)){var n=e[xt]||null;a:switch(e=t.stateNode,t.type){case`input`:if($t(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="`+Qt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[xt]||null;if(!a)throw Error(i(90));$t(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&&Xt(r)}break a;case`textarea`:rn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&nn(e,!!n.multiple,t,!1)}}}var bn=!1;function xn(e,t,n){if(bn)return e(t,n);bn=!0;try{return e(t)}finally{if(bn=!1,(_n!==null||vn!==null)&&(zd(),_n&&(t=_n,e=vn,vn=_n=null,yn(t),e)))for(t=0;t<e.length;t++)yn(e[t])}}function Sn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[xt]||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 Cn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,wn=!1;if(Cn)try{var Tn={};Object.defineProperty(Tn,"passive",{get:function(){wn=!0}}),window.addEventListener(`test`,Tn,Tn),window.removeEventListener(`test`,Tn,Tn)}catch{wn=!1}var En=null,Dn=null,On=null;function kn(){if(On)return On;var e,t=Dn,n=t.length,r,i=`value`in En?En.value:En.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 On=i.slice(e,1<r?1-r:void 0)}function An(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 jn(){return!0}function Mn(){return!1}function Nn(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)?jn:Mn,this.isPropagationStopped=Mn,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=jn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=jn)},persist:function(){},isPersistent:jn}),t}var Pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fn=Nn(Pn),In=D({},Pn,{view:0,detail:0}),Ln=Nn(In),Rn,zn,Bn,Vn=D({},In,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qn,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!==Bn&&(Bn&&e.type===`mousemove`?(Rn=e.screenX-Bn.screenX,zn=e.screenY-Bn.screenY):zn=Rn=0,Bn=e),Rn)},movementY:function(e){return`movementY`in e?e.movementY:zn}}),Hn=Nn(Vn),Un=Nn(D({},Vn,{dataTransfer:0})),Wn=Nn(D({},In,{relatedTarget:0})),Gn=Nn(D({},Pn,{animationName:0,elapsedTime:0,pseudoElement:0})),Kn=Nn(D({},Pn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),qn=Nn(D({},Pn,{data:0})),Jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Yn={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`},Xn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xn[e])?!!t[e]:!1}function Qn(){return Zn}var $n=Nn(D({},In,{key:function(e){if(e.key){var t=Jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=An(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Yn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qn,charCode:function(e){return e.type===`keypress`?An(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?An(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),er=Nn(D({},Vn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),tr=Nn(D({},Pn,{submitter:0})),nr=Nn(D({},In,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qn})),rr=Nn(D({},Pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ir=Nn(D({},Vn,{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})),ar=Nn(D({},Pn,{newState:0,oldState:0,source:0})),or=[9,13,27,32],sr=Cn&&`CompositionEvent`in window,cr=null;Cn&&`documentMode`in document&&(cr=document.documentMode);var lr=Cn&&`TextEvent`in window&&!cr,ur=Cn&&(!sr||cr&&8<cr&&11>=cr),dr=` `,fr=!1;function pr(e,t){switch(e){case`keyup`:return or.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function mr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var hr=!1;function gr(e,t){switch(e){case`compositionend`:return mr(t);case`keypress`:return t.which===32?(fr=!0,dr):null;case`textInput`:return e=t.data,e===dr&&fr?null:e;default:return null}}function _r(e,t){if(hr)return e===`compositionend`||!sr&&pr(e,t)?(e=kn(),On=Dn=En=null,hr=!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 ur&&t.locale!==`ko`?null:t.data;default:return null}}var vr={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 yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!vr[e.type]:t===`textarea`}function br(e,t,n,r){_n?vn?vn.push(r):vn=[r]:_n=r,t=Jf(t,`onChange`),0<t.length&&(n=new Fn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var xr=null,Sr=null;function Cr(e){Vf(e,0)}function wr(e){if(Xt(Mt(e)))return e}function Tr(e,t){if(e===`change`)return t}var Er=!1;if(Cn){var Dr;if(Cn){var Or=`oninput`in document;if(!Or){var W=document.createElement(`div`);W.setAttribute(`oninput`,`return;`),Or=typeof W.oninput==`function`}Dr=Or}else Dr=!1;Er=Dr&&(!document.documentMode||9<document.documentMode)}function kr(){xr&&(xr.detachEvent(`onpropertychange`,G),Sr=xr=null)}function G(e){if(e.propertyName===`value`&&wr(Sr)){var t=[];br(t,Sr,e,gn(e)),xn(Cr,t)}}function Ar(e,t,n){e===`focusin`?(kr(),xr=t,Sr=n,xr.attachEvent(`onpropertychange`,G)):e===`focusout`&&kr()}function jr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return wr(Sr)}function Mr(e,t){if(e===`click`)return wr(t)}function Nr(e,t){if(e===`input`||e===`change`)return wr(t)}function K(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Pr=typeof Object.is==`function`?Object.is:K;function Fr(e,t){if(Pr(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(!Fe.call(t,i)||!Pr(e[i],t[i]))return!1}return!0}function Ir(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 Lr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rr(e,t){var n=Lr(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=Lr(n)}}function zr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Br(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ir(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=Ir(e.document)}return t}function Vr(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 Hr=Cn&&`documentMode`in document&&11>=document.documentMode,Ur=null,Wr=null,Gr=null,Kr=!1;function qr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Kr||Ur==null||Ur!==Ir(r)||(r=Ur,`selectionStart`in r&&Vr(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}),Gr&&Fr(Gr,r)||(Gr=r,r=Jf(Wr,`onSelect`),0<r.length&&(t=new Fn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ur)))}function Jr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Yr={animationend:Jr(`Animation`,`AnimationEnd`),animationiteration:Jr(`Animation`,`AnimationIteration`),animationstart:Jr(`Animation`,`AnimationStart`),transitionrun:Jr(`Transition`,`TransitionRun`),transitionstart:Jr(`Transition`,`TransitionStart`),transitioncancel:Jr(`Transition`,`TransitionCancel`),transitionend:Jr(`Transition`,`TransitionEnd`)},Xr={},Zr={};Cn&&(Zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Yr.animationend.animation,delete Yr.animationiteration.animation,delete Yr.animationstart.animation),`TransitionEvent`in window||delete Yr.transitionend.transition);function Qr(e){if(Xr[e])return Xr[e];if(!Yr[e])return e;var t=Yr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Zr)return Xr[e]=t[n];return e}var $r=Qr(`animationend`),ei=Qr(`animationiteration`),ti=Qr(`animationstart`),ni=Qr(`transitionrun`),ri=Qr(`transitionstart`),ii=Qr(`transitioncancel`),ai=Qr(`transitionend`),oi=new Map,si=`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(` `);si.push(`scrollEnd`);function ci(e,t){oi.set(e,t),Rt(t,[e])}var li=0;function ui(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=bd.identifierPrefix;var n=li++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function di(e){if(e==null||typeof e==`string`)return e;var t=null,n=Od;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 fi(e,t){return e=di(e),t=di(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var pi=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)},mi=[],hi=0,gi=0;function _i(){for(var e=hi,t=gi=hi=0;t<e;){var n=mi[t];mi[t++]=null;var r=mi[t];mi[t++]=null;var i=mi[t];mi[t++]=null;var a=mi[t];if(mi[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&&xi(n,i,a)}}function vi(e,t,n,r){mi[hi++]=e,mi[hi++]=t,mi[hi++]=n,mi[hi++]=r,gi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function yi(e,t,n,r){return vi(e,t,n,r),Si(e)}function bi(e,t){return vi(e,null,null,t),Si(e)}function xi(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-Qe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Si(e){if(50<kd)throw kd=0,Ad=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ci={};function wi(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 Ti(e,t,n,r){return new wi(e,t,n,r)}function Ei(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Di(e,t){var n=e.alternate;return n===null?(n=Ti(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 Oi(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 ki(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ei(r)&&(s=1);else if(typeof r==`string`)s=Jm(e,n,Se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case oe:return e=Ti(31,n,t,a),e.elementType=oe,e.lanes=o,e;case A:return Ai(n.children,a,o,t);case j:s=8,a|=24;break;case M:return e=Ti(12,n,t,a|2),e.elementType=M,e.lanes=o,e;case ne:return e=Ti(13,n,t,a),e.elementType=ne,e.lanes=o,e;case re:return e=Ti(19,n,t,a),e.elementType=re,e.lanes=o,e;case se:case le:return e=a|32,e=Ti(30,n,t,e),e.elementType=le,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case N:s=10;break a;case te:s=9;break a;case P:s=11;break a;case ie:s=14;break a;case ae:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ti(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ai(e,t,n,r){return e=Ti(7,e,r,t),e.lanes=n,e}function ji(e,t,n){return e=Ti(6,e,null,t),e.lanes=n,e}function Mi(e){var t=Ti(18,null,null,0);return t.stateNode=e,t}function Ni(e,t,n){return t=Ti(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Pi=new WeakMap;function Fi(e,t){if(typeof e==`object`&&e){var n=Pi.get(e);return n===void 0?(t={value:e,source:t,stack:R(t)},Pi.set(e,t),t):n}return{value:e,source:t,stack:R(t)}}var Ii=[],Li=0,Ri=null,zi=0,Bi=[],Vi=0,Hi=null,Ui=1,Wi=``;function Gi(e,t){Ii[Li++]=zi,Ii[Li++]=Ri,Ri=e,zi=t}function Ki(e,t,n){Bi[Vi++]=Ui,Bi[Vi++]=Wi,Bi[Vi++]=Hi,Hi=e;var r=Ui;e=Wi;var i=32-Qe(r)-1;r&=~(1<<i),n+=1;var a=32-Qe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ui=1<<32-Qe(t)+i|n<<i|r,Wi=a+e}else Ui=1<<a|n<<i|r,Wi=e}function qi(e){e.return!==null&&(Gi(e,1),Ki(e,1,0))}function Ji(e){for(;e===Ri;)Ri=Ii[--Li],Ii[Li]=null,zi=Ii[--Li],Ii[Li]=null;for(;e===Hi;)Hi=Bi[--Vi],Bi[Vi]=null,Wi=Bi[--Vi],Bi[Vi]=null,Ui=Bi[--Vi],Bi[Vi]=null}function Yi(e,t){Bi[Vi++]=Ui,Bi[Vi++]=Wi,Bi[Vi++]=Hi,Ui=t.id,Wi=t.overflow,Hi=e}var Xi=null,Zi=null,q=!1,Qi=null,$i=!1,ea=Error(i(519));function ta(e){throw sa(Fi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ea}function na(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[bt]=e,t[xt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Q(zf[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),en(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),an(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||ep(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=mn),t=!0):t=!1,t||ta(e,!0)}function ra(e){for(Xi=e.return;Xi;)switch(Xi.tag){case 5:case 31:case 13:$i=!1;return;case 27:case 3:$i=!0;return;default:Xi=Xi.return}}function ia(e){if(e!==Xi)return!1;if(!q)return ra(e),q=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||mp(e.type,e.memoizedProps)),n=!n),n&&Zi&&ta(e),ra(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Zi=fm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Zi=fm(e)}else t===27?(t=Zi,Cp(e.type)?(e=dm,dm=null,Zi=e):Zi=t):Zi=Xi?um(e.stateNode.nextSibling):null;return!0}function aa(){Zi=Xi=null,q=!1}function oa(){var e=Qi;return e!==null&&(fd===null?fd=e:fd.push.apply(fd,e),Qi=null),e}function sa(e){Qi===null?Qi=[e]:Qi.push(e)}var ca=ye(null),la=null,ua=null;function da(e,t,n){xe(ca,t._currentValue),t._currentValue=n}function fa(e){e._currentValue=ca.current,be(ca)}function pa(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 ma(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),pa(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),pa(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),pa(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 ha(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;Pr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Te.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ch]:e.push(ch))}a=a.return}return e!==null&&ma(t,e,n,r),t.flags|=262144,e!==null}function ga(e){for(e=e.firstContext;e!==null;){if(!Pr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function _a(e){la=e,ua=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function va(e){return ba(la,e)}function ya(e,t){return la===null&&_a(e),ba(e,t)}function ba(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ua===null){if(e===null)throw Error(i(308));ua=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ua=ua.next=t;return n}var xa=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()})}},Sa=t.unstable_scheduleCallback,Ca=t.unstable_NormalPriority,wa={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ta(){return{controller:new xa,data:new Map,refCount:0}}function Ea(e){e.refCount--,e.refCount===0&&Sa(Ca,function(){e.controller.abort()})}function Da(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 Oa=null;function ka(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Aa=null,ja=0,Ma=0,Na=null;function Pa(e,t){if(Aa===null){var n=Aa=[];ja=0,Ma=Pf(),Na={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ja++,t.then(Fa,Fa),t}function Fa(){if(--ja===0&&(Oa=null,Aa!==null)){Na!==null&&(Na.status=`fulfilled`);var e=Aa;Aa=null,Ma=0,Na=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ia(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 La=F.S;F.S=function(e,t){if(hd=Be(),typeof t==`object`&&t&&typeof t.then==`function`&&Pa(e,t),Oa!==null)for(var n=bf;n!==null;)Da(n,Oa),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)Da(r,n),r=r.next;if(Ma!==0){r=Oa,r===null&&(r=Oa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}La!==null&&La(e,t)};var Ra=ye(null);function za(){var e=Ra.current;return e===null?Qu.pooledCache:e}function Ba(e,t){t===null?xe(Ra,Ra.current):xe(Ra,t.pool)}function Va(){var e=za();return e===null?null:{parent:wa._currentValue,pool:e}}var Ha=Error(i(460)),Ua=Error(i(474)),Wa=Error(i(542)),Ga={then:function(){}};function Ka(e){return e=e.status,e===`fulfilled`||e===`rejected`}function qa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(mn,mn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Za(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(mn,mn);else{if(e=Qu,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,Za(e),e}throw Ya=t,Ha}}function Ja(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ya=e,Ha):e}}var Ya=null;function Xa(){if(Ya===null)throw Error(i(459));var e=Ya;return Ya=null,e}function Za(e){if(e===Ha||e===Wa)throw Error(i(483))}var Qa=null,$a=0;function eo(e){var t=$a;return $a+=1,Qa===null&&(Qa=[]),qa(Qa,e,t)}function to(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function no(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 ro(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=Di(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=ji(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===A?(e=d(e,t,n.props.children,r,n.key),to(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ae&&Ja(i)===t.type)?(t=a(t,n.props),to(t,n),t.return=e,t):(t=ki(n.type,n.key,n.props,null,e.mode,r),to(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=Ni(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=Ai(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=ji(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=ki(t.type,t.key,t.props,null,e.mode,n),to(n,t),n.return=e,n;case ee:return t=Ni(t,e.mode,n),t.return=e,t;case ae:return t=Ja(t),f(e,t,n)}if(he(t)||fe(t))return t=Ai(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,eo(t),n);if(t.$$typeof===N)return f(e,ya(e,t),n);no(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 ee:return n.key===i?u(e,t,n,r):null;case ae:return n=Ja(n),p(e,t,n,r)}if(he(n)||fe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,eo(n),r);if(n.$$typeof===N)return p(e,t,ya(e,n),r);no(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 ee:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ae:return r=Ja(r),m(e,t,n,r,i)}if(he(r)||fe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,eo(r),i);if(r.$$typeof===N)return m(e,t,n,ya(t,r),i);no(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),q&&Gi(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 q&&Gi(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)}),q&&Gi(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),q&&Gi(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 q&&Gi(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)}),q&&Gi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===A&&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===A){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),to(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ae&&Ja(l)===r.type){n(e,r.sibling),c=a(r,o.props),to(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===A?(c=Ai(o.props.children,e.mode,c,o.key),to(c,o),c.return=e,e=c):(c=ki(o.type,o.key,o.props,null,e.mode,c),to(c,o),c.return=e,e=c)}return s(e);case ee: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=Ni(o,e.mode,c),c.return=e,e=c}return s(e);case ae:return o=Ja(o),_(e,r,o,c)}if(he(o))return h(e,r,o,c);if(fe(o)){if(l=fe(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,eo(o),c);if(o.$$typeof===N)return _(e,r,ya(e,o),c);no(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=ji(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{$a=0;var i=_(e,t,n,r);return Qa=null,i}catch(t){if(t===Ha||t===Wa)throw t;var a=Ti(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var io=ro(!0),ao=ro(!1),oo=!1;function so(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function co(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 lo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function uo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Zu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Si(e),xi(e,null,n),t}return vi(e,r,t,n),Si(e)}function fo(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,pt(e,n)}}function po(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 mo=!1;function ho(){if(mo){var e=Na;if(e!==null)throw e}}function go(e,t,n,r){mo=!1;var i=e.updateQueue;oo=!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?(X&f)===f:(r&f)===f){f!==0&&f===Ma&&(mo=!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:oo=!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 _o(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function vo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)_o(n[e],t)}var yo=ye(null),bo=ye(0);function xo(e,t){e=id,xe(bo,e),xe(yo,t),id=e|t.baseLanes}function So(){xe(bo,id),xe(yo,yo.current)}function Co(){id=bo.current,be(yo),be(bo)}var wo=ye(null),To=null;function Eo(e){var t=e.alternate;xe(jo,jo.current&1),xe(wo,e),To===null&&(t===null||yo.current!==null||t.memoizedState!==null)&&(To=e)}function Do(e){xe(jo,jo.current),xe(wo,e),To===null&&(To=e)}function Oo(e){e.tag===22?(xe(jo,jo.current),xe(wo,e),To===null&&(To=e)):ko()}function ko(){xe(jo,jo.current),xe(wo,wo.current)}function Ao(e){be(wo),To===e&&(To=null),be(jo)}var jo=ye(0);function Mo(e,t){xe(wo,wo.current),xe(jo,t)}function No(e){be(jo),be(wo),To===e&&(To=null)}function Po(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sm(n)||cm(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 Fo=0,J=null,Io=null,Lo=null,Ro=!1,zo=!1,Bo=!1,Vo=0,Ho=0,Uo=null,Wo=0;function Go(){throw Error(i(321))}function Ko(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pr(e[n],t[n]))return!1;return!0}function qo(e,t,n,r,i,a){return Fo=a,J=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?uc:dc,Bo=!1,a=n(r,i),Bo=!1,zo&&(a=Yo(t,n,r,i)),Jo(e),a}function Jo(e){F.H=lc;var t=Io!==null&&Io.next!==null;if(Fo=0,Lo=Io=J=null,Ro=!1,Ho=0,Uo=null,t)throw Error(i(300));e===null||Oc||(e=e.dependencies,e!==null&&ga(e)&&(Oc=!0))}function Yo(e,t,n,r){J=e;var a=0;do{if(zo&&(Uo=null),Ho=0,zo=!1,25<=a)throw Error(i(301));if(a+=1,Lo=Io=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=fc,o=t(n,r)}while(zo);return o}function Xo(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?rs(t):t,e=e.useState()[0],(Io===null?null:Io.memoizedState)!==e&&(J.flags|=1024),t}function Zo(){var e=Vo!==0;return Vo=0,e}function Qo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function $o(e){if(Ro){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ro=!1}Fo=0,Lo=Io=J=null,zo=!1,Ho=Vo=0,Uo=null}function es(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lo===null?J.memoizedState=Lo=e:Lo=Lo.next=e,Lo}function ts(){if(Io===null){var e=J.alternate;e=e===null?null:e.memoizedState}else e=Io.next;var t=Lo===null?J.memoizedState:Lo.next;if(t!==null)Lo=t,Io=e;else{if(e===null)throw J.alternate===null?Error(i(467)):Error(i(310));Io=e,e={memoizedState:Io.memoizedState,baseState:Io.baseState,baseQueue:Io.baseQueue,queue:Io.queue,next:null},Lo===null?J.memoizedState=Lo=e:Lo=Lo.next=e}return Lo}function ns(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function rs(e){var t=Ho;return Ho+=1,Uo===null&&(Uo=[]),e=qa(Uo,e,t),t=J,(Lo===null?t.memoizedState:Lo.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?uc:dc),e}function is(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return rs(e);if(e.$$typeof===ue)return;if(e.$$typeof===N)return va(e)}throw Error(i(438,String(e)))}function as(e){var t=null,n=J.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=J.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=ns(),J.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]=ce;return t.index++,n}function os(e,t){return typeof t==`function`?t(e):t}function ss(e){return cs(ts(),Io,e)}function cs(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?(Fo&f)===f:(X&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===Ma&&(d=!0);else if((Fo&p)===p){u=u.next,p===Ma&&(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,J.lanes|=p,od|=p;f=u.action,Bo&&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,J.lanes|=f,od|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Pr(o,e.memoizedState)&&(Oc=!0,d&&(n=Na,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 ls(e){var t=ts(),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);Pr(o,t.memoizedState)||(Oc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function us(e,t,n){var r=J,a=ts(),o=q;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Pr((Io||a).memoizedState,n);if(s&&(a.memoizedState=n,Oc=!0),a=a.queue,Fs(ps.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Lo!==null&&!!(Lo.memoizedState.tag&1),As(e?9:8,{destroy:void 0},fs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Qu===null)throw Error(i(349));o||Fo&127||ds(r,t,n)}return n}function ds(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=J.updateQueue,t===null?(t=ns(),J.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fs(e,t,n,r){t.value=n,t.getSnapshot=r,ms(t)&&hs(e)}function ps(e,t,n){return n(function(){ms(t)&&hs(e)})}function ms(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pr(e,n)}catch{return!0}}function hs(e){var t=bi(e,2);t!==null&&Pd(t,e,2)}function gs(e){var t=es();if(typeof e==`function`){var n=e;if(e=n(),Bo){Ze(!0);try{n()}finally{Ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:e},t}function _s(e,t,n,r){return e.baseState=n,cs(e,Io,typeof r==`function`?r:os)}function vs(e,t,n,r,a){if(oc(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)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ys(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ys(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};o.types=a===null?null:a.types,F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),bs(e,t,s)}catch(n){Ss(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),bs(e,t,a)}catch(n){Ss(e,t,n)}}function bs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){xs(e,t,n)},function(n){return Ss(e,t,n)}):xs(e,t,n)}function xs(e,t,n){t.status=`fulfilled`,t.value=n,Cs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ys(e,n)))}function Ss(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Cs(t),t=t.next;while(t!==r)}e.action=null}function Cs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ws(e,t){return t}function Ts(e,t){if(q){var n=Qu.formState;if(n!==null){a:{var r=J;if(q){if(Zi){b:{for(var i=Zi,a=$i;i.nodeType!==8;)if(!a||(i=um(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Zi=um(i.nextSibling),r=i.data===`F!`;break a}}ta(r)}r=!1}r&&(t=n[0])}}return n=es(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ws,lastRenderedState:t},n.queue=r,n=rc.bind(null,J,r),r.dispatch=n,r=gs(!1),a=ac.bind(null,J,!1,r.queue),r=es(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=vs.bind(null,J,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Es(e){return Ds(ts(),Io,e)}function Ds(e,t,n){if(t=cs(e,t,ws)[0],e=ss(os)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=rs(t)}catch(e){throw e===Ha?Wa:e}else r=t;t=ts();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(J.flags|=2048,As(9,{destroy:void 0},Os.bind(null,i,n),null)),[r,a,e]}function Os(e,t){e.action=t}function ks(e){var t=ts(),n=Io;if(n!==null)return Ds(t,n,e);ts(),t=t.memoizedState,n=ts();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function As(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=J.updateQueue,t===null&&(t=ns(),J.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 js(){return ts().memoizedState}function Ms(e,t,n,r){var i=es();J.flags|=e,i.memoizedState=As(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ns(e,t,n,r){var i=ts();r=r===void 0?null:r;var a=i.memoizedState.inst;Io!==null&&r!==null&&Ko(r,Io.memoizedState.deps)?i.memoizedState=As(t,a,n,r):(J.flags|=e,i.memoizedState=As(1|t,a,n,r))}function Ps(e,t){Ms(8390656,8,e,t)}function Fs(e,t){Ns(2048,8,e,t)}function Is(e){J.flags|=4;var t=J.updateQueue;if(t===null)t=ns(),J.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ls(e){var t=ts().memoizedState;return Is({ref:t,nextImpl:e}),function(){if(Zu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Rs(e,t){return Ns(4,2,e,t)}function zs(e,t){return Ns(4,4,e,t)}function Bs(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 Vs(e,t,n){n=n==null?null:n.concat([e]),Ns(4,4,Bs.bind(null,t,e),n)}function Hs(){}function Us(e,t){var n=ts();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Ko(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ws(e,t){var n=ts();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Ko(t,r[1]))return r[0];if(r=e(),Bo){Ze(!0);try{e()}finally{Ze(!1)}}return n.memoizedState=[r,t],r}function Gs(e,t,n){return n===void 0||Fo&1073741824&&!(X&261930)?e.memoizedState=t:(e.memoizedState=n,e=Md(),J.lanes|=e,od|=e,n)}function Ks(e,t,n,r){return Pr(n,t)?n:yo.current===null?!(Fo&106)||Fo&1073741824&&!(X&261930)?(Oc=!0,e.memoizedState=n):(e=Md(),J.lanes|=e,od|=e,t):(e=Gs(e,n,r),Pr(e,t)||(Oc=!0),e)}function qs(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};s.types=o===null?null:o.types,F.T=s,ac(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ic(e,t,Ia(c,r),jd(e)):ic(e,t,r,jd(e))}catch(n){ic(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function Js(){}function Ys(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Xs(e).queue;qs(e,a,t,ge,n===null?Js:function(){return Zs(e),n(r)})}function Xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:ge},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Zs(e){var t=Xs(e);t.next===null&&(t=e.alternate.memoizedState),ic(e,t.next.queue,{},jd())}function Qs(){return va(ch)}function $s(){return ts().memoizedState}function ec(){return ts().memoizedState}function tc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=lo(n);var r=uo(t,e,n);r!==null&&(Pd(r,t,n),fo(r,t,n)),t={cache:Ta()},e.payload=t;return}t=t.return}}function nc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},oc(e)?sc(t,n):(n=yi(e,t,n,r),n!==null&&(Pd(n,e,r),cc(n,t,r)))}function rc(e,t,n){ic(e,t,n,jd())}function ic(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(oc(e))sc(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,Pr(s,o))return vi(e,t,i,0),Qu===null&&_i(),!1}catch{}if(n=yi(e,t,i,r),n!==null)return Pd(n,e,r),cc(n,t,r),!0}return!1}function ac(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},oc(e)){if(t)throw Error(i(479))}else t=yi(e,n,r,2),t!==null&&Pd(t,e,2)}function oc(e){var t=e.alternate;return e===J||t!==null&&t===J}function sc(e,t){zo=Ro=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pt(e,n)}}var lc={readContext:va,use:is,useCallback:Go,useContext:Go,useEffect:Go,useImperativeHandle:Go,useLayoutEffect:Go,useInsertionEffect:Go,useMemo:Go,useReducer:Go,useRef:Go,useState:Go,useDebugValue:Go,useDeferredValue:Go,useTransition:Go,useSyncExternalStore:Go,useId:Go,useHostTransitionStatus:Go,useFormState:Go,useActionState:Go,useOptimistic:Go,useMemoCache:Go,useCacheRefresh:Go,useEffectEvent:Go},uc={readContext:va,use:is,useCallback:function(e,t){return es().memoizedState=[e,t===void 0?null:t],e},useContext:va,useEffect:Ps,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ms(4194308,4,Bs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ms(4194308,4,e,t)},useInsertionEffect:function(e,t){Ms(4,2,e,t)},useMemo:function(e,t){var n=es();t=t===void 0?null:t;var r=e();if(Bo){Ze(!0);try{e()}finally{Ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=es();if(n!==void 0){var i=n(t);if(Bo){Ze(!0);try{n(t)}finally{Ze(!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=nc.bind(null,J,e),[r.memoizedState,e]},useRef:function(e){var t=es();return e={current:e},t.memoizedState=e},useState:function(e){e=gs(e);var t=e.queue,n=rc.bind(null,J,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Hs,useDeferredValue:function(e,t){return Gs(es(),e,t)},useTransition:function(){var e=gs(!1);return e=qs.bind(null,J,e.queue,!0,!1),es().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=J,a=es();if(q){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Qu===null)throw Error(i(349));X&127||ds(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ps(ps.bind(null,r,o,e),[e]),r.flags|=2048,As(9,{destroy:void 0},fs.bind(null,r,o,n,t),null),n},useId:function(){var e=es(),t=Qu.identifierPrefix;if(q){var n=Wi,r=Ui;n=(r&~(1<<32-Qe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Vo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Wo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Qs,useFormState:Ts,useActionState:Ts,useOptimistic:function(e){var t=es();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ac.bind(null,J,!0,n),n.dispatch=t,[e,t]},useMemoCache:as,useCacheRefresh:function(){return es().memoizedState=tc.bind(null,J)},useEffectEvent:function(e){var t=es(),n={impl:e};return t.memoizedState=n,function(){if(Zu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},dc={readContext:va,use:is,useCallback:Us,useContext:va,useEffect:Fs,useImperativeHandle:Vs,useInsertionEffect:Rs,useLayoutEffect:zs,useMemo:Ws,useReducer:ss,useRef:js,useState:function(){return ss(os)},useDebugValue:Hs,useDeferredValue:function(e,t){return Ks(ts(),Io.memoizedState,e,t)},useTransition:function(){var e=ss(os)[0],t=ts().memoizedState;return[typeof e==`boolean`?e:rs(e),t]},useSyncExternalStore:us,useId:$s,useHostTransitionStatus:Qs,useFormState:Es,useActionState:Es,useOptimistic:function(e,t){return _s(ts(),Io,e,t)},useMemoCache:as,useCacheRefresh:ec,useEffectEvent:Ls},fc={readContext:va,use:is,useCallback:Us,useContext:va,useEffect:Fs,useImperativeHandle:Vs,useInsertionEffect:Rs,useLayoutEffect:zs,useMemo:Ws,useReducer:ls,useRef:js,useState:function(){return ls(os)},useDebugValue:Hs,useDeferredValue:function(e,t){var n=ts();return Io===null?Gs(n,e,t):Ks(n,Io.memoizedState,e,t)},useTransition:function(){var e=ls(os)[0],t=ts().memoizedState;return[typeof e==`boolean`?e:rs(e),t]},useSyncExternalStore:us,useId:$s,useHostTransitionStatus:Qs,useFormState:ks,useActionState:ks,useOptimistic:function(e,t){var n=ts();return Io===null?(n.baseState=e,[e,n.queue.dispatch]):_s(n,Io,e,t)},useMemoCache:as,useCacheRefresh:ec,useEffectEvent:Ls};function pc(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 mc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=jd(),i=lo(r);i.payload=t,n!=null&&(i.callback=n),t=uo(e,i,r),t!==null&&(Pd(t,e,r),fo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=jd(),i=lo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=uo(e,i,r),t!==null&&(Pd(t,e,r),fo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jd(),r=lo(n);r.tag=2,t!=null&&(r.callback=t),t=uo(e,r,n),t!==null&&(Pd(t,e,n),fo(t,e,n))}};function hc(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?!Fr(n,r)||!Fr(i,a):!0}function gc(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&&mc.enqueueReplaceState(t,t.state,null)}function _c(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 vc(e){pi(e)}function yc(e){console.error(e)}function bc(e){pi(e)}function xc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Sc(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 Cc(e,t,n){return n=lo(n),n.tag=3,n.payload={element:null},n.callback=function(){xc(e,t)},n}function wc(e){return e=lo(e),e.tag=3,e}function Tc(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(){Sc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Sc(t,n,r),typeof i!=`function`&&(vd===null?vd=new Set([this]):vd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ec(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ha(t,n,a,!0),n=wo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return To===null?Kd():n.alternate===null&&ad===0&&(ad=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ga?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ga?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)),mf(e,r,a)),!1}throw Error(i(435,n.tag))}return mf(e,r,a),Kd(),!1}if(q)return t=wo.current,t===null?(r!==ea&&(t=Error(i(423),{cause:r}),sa(Fi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Fi(r,n),a=Cc(e.stateNode,r,a),po(e,a),ad!==4&&(ad=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ea&&(e=Error(i(422),{cause:r}),sa(Fi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Fi(o,n),dd===null?dd=[o]:dd.push(o),ad!==4&&(ad=2),t===null)return!0;r=Fi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Cc(n.stateNode,r,e),po(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`&&(vd===null||!vd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=wc(a),Tc(a,e,n,r),po(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Dc=Error(i(461)),Oc=!1;function kc(e,t,n,r){t.child=e===null?ao(t,null,n,r):io(t,e.child,n,r)}function Ac(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 _a(t),r=qo(e,t,n,o,a,i),s=Zo(),e!==null&&!Oc?(Qo(e,t,i),il(e,t,i)):(q&&s&&qi(t),t.flags|=1,kc(e,t,r,i),t.child)}function jc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ei(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Mc(e,t,a,r,i)):(e=ki(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!al(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Fr:n,n(o,r)&&e.ref===t.ref)return il(e,t,i)}return t.flags|=1,e=Di(a,r),e.ref=t.ref,e.return=t,t.child=e}function Mc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Fr(a,r)&&e.ref===t.ref){if(Oc=!1,t.pendingProps=r=a,al(e,i))e.flags&131072&&(Oc=!0);else return t.lanes=e.lanes,il(e,t,i)}}return Bc(e,t,n,r,i)}function Nc(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 Fc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ba(t,a===null?null:a.cachePool),a===null?So():xo(t,a),Oo(t);else return r=t.lanes=536870912,Fc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ba(t,null),So(),ko()):(Ba(t,a.cachePool),xo(t,a),ko(),t.memoizedState=null);return kc(e,t,i,n),t.child}function Pc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Fc(e,t,n,r,i){var a=za();return a=a===null?null:{parent:wa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ba(t,null),So(),Oo(t),e!==null&&ha(e,t,r,!0),t.childLanes=i,null}function Ic(e,t){return t=Yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Lc(e,t,n){return io(t,e.child,null,n),e=Ic(t,t.pendingProps),e.flags|=2,Ao(t),t.memoizedState=null,e}function Rc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(q){if(r.mode===`hidden`)return e=Ic(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Pc(null,e);if(Do(t),(e=Zi)?(e=om(e,$i),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hi===null?null:{id:Ui,overflow:Wi},retryLane:536870912,hydrationErrors:null},n=Mi(e),n.return=t,t.child=n,Xi=t,Zi=null)):e=null,e===null)throw ta(t);return t.lanes=536870912,null}return Ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Do(t),a){if(t.flags&256)t.flags&=-257,t=Lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Oc||ha(e,t,n,!1),a=(n&e.childLanes)!==0,Oc||a){if(yo.current===null){if(r=Qu,r!==null&&(s=mt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,bi(e,s),Pd(r,e,s),Dc;Kd()}t=Lc(e,t,n)}else e=o.treeContext,Zi=um(s.nextSibling),Xi=t,q=!0,Qi=null,$i=!1,e!==null&&Yi(t,e),t=Ic(t,r),t.flags|=134221824;return t}return e=Di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function zc(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 Bc(e,t,n,r,i){return _a(t),n=qo(e,t,n,r,void 0,i),r=Zo(),e!==null&&!Oc?(Qo(e,t,i),il(e,t,i)):(q&&r&&qi(t),t.flags|=1,kc(e,t,n,i),t.child)}function Vc(e,t,n,r,i,a){return _a(t),t.updateQueue=null,n=Yo(t,r,n,i),Jo(e),r=Zo(),e!==null&&!Oc?(Qo(e,t,a),il(e,t,a)):(q&&r&&qi(t),t.flags|=1,kc(e,t,n,a),t.child)}function Hc(e,t,n,r,i){if(_a(t),t.stateNode===null){var a=Ci,o=n.contextType;typeof o==`object`&&o&&(a=va(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=mc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},so(t),o=n.contextType,a.context=typeof o==`object`&&o?va(o):Ci,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(pc(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&&mc.enqueueReplaceState(a,a.state,null),go(t,r,a,i),ho(),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=_c(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ci,typeof u==`object`&&u&&(o=va(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)&&gc(t,a,r,o),oo=!1;var f=t.memoizedState;a.state=f,go(t,r,a,i),ho(),l=t.memoizedState,s||f!==l||oo?(typeof d==`function`&&(pc(t,n,d,r),l=t.memoizedState),(c=oo||hc(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,co(e,t),o=t.memoizedProps,u=_c(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ci,typeof l==`object`&&l&&(c=va(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)&&gc(t,a,r,c),oo=!1,f=t.memoizedState,a.state=f,go(t,r,a,i),ho();var p=t.memoizedState;o!==d||f!==p||oo||e!==null&&e.dependencies!==null&&ga(e.dependencies)?(typeof s==`function`&&(pc(t,n,s,r),p=t.memoizedState),(u=oo||hc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ga(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,zc(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=io(t,e.child,null,i),t.child=io(t,null,n,i)):kc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=il(e,t,i),e}function Uc(e,t,n,r){return aa(),t.flags|=256,kc(e,t,n,r),t.child}var Wc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gc(e){return{baseLanes:e,cachePool:Va()}}function Kc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ld),e}function qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(jo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(q){if(i?Eo(t):ko(),(e=Zi)?(e=om(e,$i),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hi===null?null:{id:Ui,overflow:Wi},retryLane:536870912,hydrationErrors:null},n=Mi(e),n.return=t,t.child=n,Xi=t,Zi=null)):e=null,e===null)throw ta(t);return t.lanes=cm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(ko(),i=t.mode,a=Yc({mode:`hidden`,children:a},i),r=Ai(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Gc(n),r.childLanes=Kc(e,o,n),t.memoizedState=Wc,Pc(null,r)):(Eo(t),Jc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Zc(e,t,a,o,r,c,s,n)}return i?(ko(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Di(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ai(i,a,n,null),i.flags|=2):i=Di(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Pc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Gc(n):(a=i.cachePool,a===null?a=Va():(s=wa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Kc(e,o,n),t.memoizedState=Wc,Pc(e.child,r)):(Eo(t),n=e.child,e=n.sibling,n=Di(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 Jc(e,t){return t=Yc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Yc(e,t){return e=Ti(22,e,null,t),e.lanes=0,e}function Xc(e,t,n){return io(t,e.child,null,n),e=Jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Eo(t),t.flags&=-257,Xc(e,t,c)):t.memoizedState===null?(ko(),o=a.fallback,s=t.mode,a=Yc({mode:`visible`,children:a.children},s),o=Ai(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,io(t,e.child,null,c),a=t.child,a.memoizedState=Gc(c),a.childLanes=Kc(e,r,c),t.memoizedState=Wc,Pc(null,a)):(ko(),t.child=e.child,t.flags|=128,null);if(Eo(t),cm(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,sa({value:a,source:null,stack:null})),Xc(e,t,c)}if(Oc||ha(e,t,c,!1),r=(c&e.childLanes)!==0,Oc||r){if(yo.current!==null)return Xc(e,t,c);if(r=Qu,r!==null&&(a=mt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,bi(e,a),Pd(r,e,a),Dc;return sm(o)||Kd(),Xc(e,t,c)}return sm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Zi=um(o.nextSibling),Xi=t,q=!0,Qi=null,$i=!1,e!==null&&Yi(t,e),t=Jc(t,a.children),t.flags|=134221824,t)}function Qc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),pa(e.return,t,n)}function $c(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Po(n)===null&&(t=e),e=e.sibling}return t}function el(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 tl(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 nl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=jo.current;if(t.flags&128)return Mo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Mo(t,o),i===`backwards`&&e!==null?(tl(e),kc(e,t,r,n),tl(e)):kc(e,t,r,n),r=q?zi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qc(e,n,t);else if(e.tag===19)Qc(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=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,tl(t)),el(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&&Po(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}el(t,!0,n,null,a,r);break;case`together`:el(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),el(t,!1,i,n,a,r)}return t.child}function rl(e,t,n){var r=t.pendingProps;return da(t,t.type,r.value),kc(e,t,r.children,n),t.child}function il(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),od|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ha(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=Di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function al(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ga(e)))}function ol(e,t,n){switch(t.tag){case 3:Ee(t,t.stateNode.containerInfo),da(t,wa,e.memoizedState.cache),aa();break;case 27:case 5:Oe(t);break;case 4:Ee(t,t.stateNode.containerInfo);break;case 10:da(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Do(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Eo(t),t.flags|=128,null;r=ha(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?qc(e,t,n):(Eo(t),e=il(e,t,n),e===null?null:e.sibling)}Eo(t);break;case 19:if(t.flags&128)return nl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ha(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return nl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Mo(t,jo.current),r)break;return null;case 22:return t.lanes=0,Nc(e,t,n,t.pendingProps);case 24:da(t,wa,e.memoizedState.cache)}return il(e,t,n)}function sl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Oc=!0;else{if(!al(e,n)&&!(t.flags&128))return Oc=!1,ol(e,t,n);Oc=!!(e.flags&131072)}}else Oc=!1,q&&t.flags&1048576&&Ki(t,zi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ja(t.elementType),t.type=e,typeof e==`function`)Ei(e)?(r=_c(e,r),t.tag=1,t=Hc(null,t,e,r,n)):(t.tag=0,t=Bc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===P){t.tag=11,t=Ac(null,t,e,r,n);break a}if(a===ie){t.tag=14,t=jc(null,t,e,r,n);break a}if(a===N){t.tag=10,t.type=e,t=rl(null,t,n);break a}}throw t=me(e)||e,Error(i(306,t,``))}}return t;case 0:return Bc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=_c(r,t.pendingProps),Hc(e,t,r,a,n);case 3:a:{if(Ee(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,co(e,t),go(t,r,null,n);var s=t.memoizedState;if(r=s.cache,da(t,wa,r),r!==o.cache&&ma(t,[wa],n,!0),ho(),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=Uc(e,t,r,n);break a}if(r!==a){a=Fi(Error(i(424)),t),sa(a),t=Uc(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(Zi=um(e.firstChild),Xi=t,q=!0,Qi=null,$i=!0,n=ao(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(aa(),r===a){t=il(e,t,n);break a}kc(e,t,r,n)}t=t.child}return t;case 26:return zc(e,t),e===null?(n=Pm(t.type,null,t.pendingProps,null))?t.memoizedState=n:q||(t.stateNode=pp(t.type,t.pendingProps,we.current,t)):t.memoizedState=Pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Oe(t),e===null&&q&&(r=t.stateNode=gm(t.type,t.pendingProps,we.current),Xi=t,$i=!0,a=Zi,Cp(t.type)?(dm=a,Zi=um(r.firstChild)):Zi=a),kc(e,t,t.pendingProps.children,n),zc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&q&&((a=r=Zi)&&(r=im(r,t.type,t.pendingProps,$i),r===null?a=!1:(t.stateNode=r,Xi=t,Zi=um(r.firstChild),$i=!1,a=!0)),a||ta(t)),Oe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,mp(a,o)?r=null:s!==null&&mp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=qo(e,t,Xo,null,null,n),ch._currentValue=a),zc(e,t),kc(e,t,r,n),t.child;case 6:return e===null&&q&&((e=n=Zi)&&(n=am(n,t.pendingProps,$i),n===null?e=!1:(t.stateNode=n,Xi=t,Zi=null,e=!0)),e||ta(t)),null;case 13:return qc(e,t,n);case 4:return Ee(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=io(t,null,r,n):kc(e,t,r,n),t.child;case 11:return Ac(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,zc(e,t),kc(e,t,r,n),t.child;case 8:return kc(e,t,t.pendingProps.children,n),t.child;case 12:return kc(e,t,t.pendingProps.children,n),t.child;case 10:return rl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,_a(t),a=va(a),r=r(a),t.flags|=1,kc(e,t,r,n),t.child;case 14:return jc(e,t,t.type,t.pendingProps,n);case 15:return Mc(e,t,t.type,t.pendingProps,n);case 19:return nl(e,t,n);case 31:return Rc(e,t,n);case 22:return Nc(e,t,n,t.pendingProps);case 24:return _a(t),r=va(wa),e===null?(a=za(),a===null&&(a=Qu,o=Ta(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},so(t),da(t,wa,a)):((e.lanes&n)!==0&&(co(e,t),go(t,null,null,n),ho()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,da(t,wa,r),r!==a.cache&&ma(t,[wa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),da(t,wa,r))),kc(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:q&&qi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:zc(e,t),kc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function cl(e){e.flags|=4}function ll(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Ym(t,r):Ym(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(Ud())e.flags|=8192;else throw Ya=Ga,Ua}}else e.flags&=-16777217}function ul(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xm(t)){if(Ud())e.flags|=8192;else throw Ya=Ga,Ua}}function dl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:lt(),e.lanes|=t,ud|=t)}function fl(e,t){if(!q)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 pl(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 ml(e,t,n){var r=t.pendingProps;switch(Ji(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pl(t),null;case 1:return pl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),fa(wa),De(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ia(t)?cl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,oa())),pl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(cl(t),o===null?(pl(t),ll(t,a,null,r,n)):(pl(t),ul(t,o))):o?o===e.memoizedState?(pl(t),t.flags&=-16777217):(cl(t),pl(t),ul(t,o)):(e=e.memoizedProps,e!==r&&cl(t),pl(t),ll(t,a,e,r,n)),null;case 27:if(ke(t),n=we.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return pl(t),t.subtreeFlags&=-33554433,null}e=Se.current,ia(t)?na(t,e):(e=gm(a,r,n),t.stateNode=e,cl(t))}return pl(t),t.subtreeFlags&=-33554433,null;case 5:if(ke(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return pl(t),t.subtreeFlags&=-33554433,null}if(o=Se.current,ia(t))na(t,o);else{var s=up(we.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[bt]=t,o[xt]=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(rp(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&&cl(t)}}return pl(t),t.subtreeFlags&=-33554433,ll(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=we.current,ia(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Xi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[bt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||ta(t,!0)}else e=up(e).createTextNode(r),e[bt]=t,t.stateNode=e}return pl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ia(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[bt]=t}else aa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pl(t),e=!1}else n=oa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ao(t),t):(Ao(t),null);if(t.flags&128)throw Error(i(558))}return pl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ia(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[bt]=t}else aa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pl(t),a=!1}else a=oa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ao(t),t):(Ao(t),null)}return Ao(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),dl(t,t.updateQueue),pl(t),null);case 4:return De(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,pl(t),null;case 10:return fa(t.type),pl(t),null;case 19:if(No(t),r=t.memoizedState,r===null)return pl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)fl(r,!1);else{if(ad!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Po(e),o!==null){for(t.flags|=128,fl(r,!1),e=o.updateQueue,t.updateQueue=e,dl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Oi(n,e),n=n.sibling;return Mo(t,jo.current&1|2),q&&Gi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Be()>gd&&(t.flags|=128,a=!0,fl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Po(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,dl(t,e),fl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!q)return pl(t),null}else 2*Be()-r.renderingStartTime>gd&&n!==536870912&&(t.flags|=128,a=!0,fl(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=Be(),e.sibling=null,o=jo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||q?Mo(t,o):(n=o,xe(wo,t),xe(jo,n),To===null&&(To=t)),q&&Gi(t,r.treeForkCount),e}return pl(t),null;case 22:case 23:return Ao(t),Co(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(pl(t),t.subtreeFlags&6&&(t.flags|=8192)):pl(t),n=t.updateQueue,n!==null&&dl(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&&be(Ra),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),fa(wa),pl(t),null;case 25:return null;case 30:return t.flags|=33554432,pl(t),null}throw Error(i(156,t.tag))}function hl(e,t){switch(Ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fa(wa),De(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ke(t),null;case 31:if(t.memoizedState!==null){if(Ao(t),t.alternate===null)throw Error(i(340));aa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));aa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return No(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 De(),null;case 10:return fa(t.type),null;case 22:case 23:return Ao(t),Co(),e!==null&&be(Ra),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return fa(wa),null;case 25:return null;default:return null}}function gl(e,t){switch(Ji(t),t.tag){case 3:fa(wa),De();break;case 26:case 27:case 5:ke(t);break;case 4:De();break;case 31:t.memoizedState!==null&&Ao(t);break;case 13:Ao(t);break;case 19:No(t);break;case 10:fa(t.type);break;case 22:case 23:Ao(t),Co(),e!==null&&be(Ra);break;case 24:fa(wa)}}function _l(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){Z(t,t.return,e)}}function vl(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){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function yl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{vo(t,n)}catch(t){Z(e,e.return,t)}}}function bl(e,t,n){n.props=_c(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function xl(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=ui(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Fp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Ip(e);m(e.child,!1,$p,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){Z(e,t,n)}}function Sl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(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){Z(e,t,n)}else n.current=null}}function Cl(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++)tm(e.stateNode,t[n])}function wl(e){for(var t=e.return;t!==null&&(Dl(t)&&tm(e.stateNode,t.stateNode),!El(t));)t=t.return}function Tl(e){for(var t=e.return;t!==null&&(Dl(t)&&nm(e.stateNode,t.stateNode),!El(t));)t=t.return}function El(e){return e.tag===5||e.tag===3||e.tag===27}function Dl(e){return e&&e.tag===7&&e.stateNode!==null}function Ol(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){Z(e,e.return,t)}}function kl(e,t,n){try{var r=e.stateNode;ap(r,e.type,n,t),r[xt]=t}catch(t){Z(e,e.return,t)}}function Al(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cp(e.type)||e.tag===4}function jl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Al(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&&Cp(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 Ml(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=mn)),Cl(e,r),V=!0;else if(i!==4&&(i===27&&(Cl(e,r),r=null,Cp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ml(e,t,n,r),e=e.sibling;e!==null;)Ml(e,t,n,r),e=e.sibling}function Nl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Cl(e,r),V=!0;else if(i!==4&&(i===27&&(Cl(e,r),r=null,Cp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Nl(e,t,n,r),e=e.sibling;e!==null;)Nl(e,t,n,r),e=e.sibling}function Pl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);rp(t,r,n),t[bt]=e,t[xt]=n}catch(t){Z(e,e.return,t)}}var Fl=!1,Il=null;function Ll(e){(e.tag===30||e.subtreeFlags&33554432)&&(Fl=!0)}var Rl=null;function zl(){var e=Rl;return Rl=null,e}var Bl=0;function Vl(e,t,n,r,i){return Bl=0,Hl(e.child,t,n,r,i)}function Hl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=kp(o);r.push(s),s.view&&(a=!0)}else a||kp(o).view&&(a=!0);Fl=!0,Ep(o,Bl===0?t:t+`_`+Bl,n),Bl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Hl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Ul(e,t){for(;e!==null;)e.tag===5?Dp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Ul(e.child,t)),e=e.sibling}function Wl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Wl(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=fi(t.default,t.share),t!==`none`&&(Vl(e,n,t,null,!1)||Ul(e.child,!1))}e=e.sibling}}function Gl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=ui(r,n),a=fi(r.default,n.paired?r.share:r.enter);a===`none`?Wl(e):Vl(e,i,a,null,!1)?(Wl(e),n.paired||t||Nd(e,r.onEnter)):Ul(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e,t),e=e.sibling;else Wl(e)}function Kl(e){if(Il!==null&&Il.size!==0){var t=Il;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=fi(n.default,n.share);if(a!==`none`&&(Vl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Nd(e,n.onShare)):Ul(e.child,!1)),t.delete(r),t.size===0)break}}}Kl(e)}e=e.sibling}}}function ql(e){if(e.tag===30){var t=e.memoizedProps,n=ui(t,e.stateNode),r=Il===null?void 0:Il.get(n),i=fi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Vl(e,n,i,null,!1)?r===void 0?Nd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Il.delete(n),Nd(e,t.onShare)):Ul(e.child,!1)),Il!==null&&Kl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e),e=e.sibling;else Il!==null&&Kl(e)}function Jl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=ui(t,e.stateNode);t=fi(t.default,t.update),e.flags&=-5,t!==`none`&&Vl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Jl(e);e=e.sibling}}function Yl(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,Ul(e.child,!1))}Yl(e)}e=e.sibling}}function Xl(e){if(e.tag===30)e.stateNode.paired=null,Ul(e.child,!1),Yl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else Yl(e)}function Zl(e){for(e=e.child;e!==null;)e.tag===30?Ul(e.child,!1):e.subtreeFlags&33554432&&Zl(e),e=e.sibling}function Ql(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Bl<a.length){var l=a[Bl],u=kp(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&&Ep(c,Bl===0?n:n+`_`+Bl,i),s&&e.flags&4||(Rl===null&&(Rl=[]),Rl.push(c,Bl===0?r:r+`_`+Bl,t.memoizedProps)),Bl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Ql(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function $l(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=ui(n,r),a=fi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Ap)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Bl=0,i=Ql(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Nd(e,n.onUpdate))}else e.subtreeFlags&33554432&&$l(e,t);e=e.sibling}}var eu=!1,tu=!1,nu=!1,ru=!1,iu=typeof WeakSet==`function`?WeakSet:Set,au=null,ou=!1,su=!1,cu=!1,lu=!1;function uu(e,t,n){if(e=e.containerInfo,cp=_h,e=Br(e),Vr(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(lp={focusedElem:e,selectionRange:r},_h=!1,n=(n&335544064)===n,au=t,t=n?9270:1024;au!==null;){if(e=au,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Ll(e),du(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ql(r),du(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ll(e),du(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,au=r):(n&&Jl(e),du(n))}}Il=null}function du(e){for(;au!==null;){var t=au,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=_c(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Z(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)rm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:rm(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=ui(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=fi(a.default,a.update),a!==`none`&&Vl(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,au=r;break}au=t.return}}function fu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Mu(e,n),r&4&&_l(5,n);break;case 1:if(Mu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=_c(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}}r&64&&yl(n),r&512&&xl(n,n.return);break;case 3:if(Mu(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{vo(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Pl(n);case 26:case 5:Mu(e,n),t===null&&r&4&&Ol(n),r&512&&xl(n,n.return);break;case 12:Mu(e,n);break;case 31:Mu(e,n),r&4&&xu(e,n);break;case 13:Mu(e,n),r&4&&Su(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),lm(e,n))));break;case 22:if(r=n.memoizedState!==null||eu,!r){var a=t!==null&&t.memoizedState!==null||tu;t=eu,i=tu,eu=r,(tu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Pu(e,n,r)):Mu(e,n),eu=t,tu=i}break;case 30:Mu(e,n),r&512&&xl(n,n.return);break;case 7:r&512&&xl(n,n.return);default:Mu(e,n)}}function pu(e,t){for(e=e.child;e!==null;)mu(e,t),e=e.sibling}function mu(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){Z(e,e.return,t)}hu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,V=!0}catch(t){Z(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Tp(s,!0):Tp(e.stateNode,!1)}catch(t){Z(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&pu(e,t);break;default:pu(e,t)}}function hu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:mu(n,r);break a;case 22:n.memoizedState===null&&hu(n,r);break a;default:hu(n,r)}}e=e.sibling}}function gu(e){var t=e.alternate;t!==null&&(e.alternate=null,gu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&kt(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 _u=null,vu=!1;function yu(e,t,n){for(n=n.child;n!==null;)bu(e,t,n),n=n.sibling}function bu(e,t,n){if(Xe&&typeof Xe.onCommitFiberUnmount==`function`)try{Xe.onCommitFiberUnmount(Ye,n)}catch{}switch(n.tag){case 26:tu||Sl(n,t),yu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!tu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tu||Sl(n,t),Tl(n);var r=_u,i=vu;Cp(n.type)&&(_u=n.stateNode,vu=!1),yu(e,t,n),_m(n.stateNode,n.type,n.memoizedProps),_u=r,vu=i;break;case 5:tu||Sl(n,t),Tl(n);case 6:if(n.tag===6&&Tl(n),r=_u,i=vu,_u=null,yu(e,t,n),_u=r,vu=i,_u!==null){if(vu)try{(_u.nodeType===9?_u.body:_u.nodeName===`HTML`?_u.ownerDocument.body:_u).removeChild(n.stateNode),V=!0}catch(e){Z(n,t,e)}else try{_u.removeChild(n.stateNode),V=!0}catch(e){Z(n,t,e)}}break;case 18:_u!==null&&(vu?(e=_u,wp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):wp(_u,n.stateNode));break;case 4:r=_u,i=vu,_u=n.stateNode.containerInfo,vu=!0,yu(e,t,n),_u=r,vu=i;break;case 0:case 11:case 14:case 15:vl(2,n,t),tu||vl(4,n,t),yu(e,t,n);break;case 1:tu||(Sl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&bl(n,t,r)),yu(e,t,n);break;case 21:yu(e,t,n);break;case 22:tu=(r=tu)||n.memoizedState!==null,yu(e,t,n),tu=r;break;case 30:Sl(n,t),yu(e,t,n);break;case 7:tu||Sl(n,t),yu(e,t,n);break;default:yu(e,t,n)}}function xu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){Z(t,t.return,e)}}}function Su(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){Z(t,t.return,e)}}function Cu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new iu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new iu),t;default:throw Error(i(435,e.tag))}}function wu(e,t){var n=Cu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Tu(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(Cp(l.type)){_u=l.stateNode,vu=!1;break a}break;case 5:_u=l.stateNode,vu=!1;break a;case 3:case 4:_u=l.stateNode.containerInfo,vu=!0;break a}l=l.return}if(_u===null)throw Error(i(160));bu(s,c,o),_u=null,vu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Du(t,e,n),t=t.sibling}var Eu=null;function Du(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}Tu(t,e,n),Ou(e),a&4&&(vl(3,e,e.return),_l(3,e),vl(5,e,e.return));break;case 1:Tu(t,e,n),Ou(e),a&512&&(tu||r===null||Sl(r,r.return)),a&64&&eu&&(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=Eu,Tu(t,e,n),Ou(e),a&512&&(tu||r===null||Sl(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(eu)e.stateNode=pp(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[Dt]||r[bt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),rp(r,t,n),r[bt]=e,Pt(r),t=r;break a;case`link`:if(o=Km(`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),rp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Km(`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),rp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[bt]=e,Pt(r),t=r}e.stateNode=t}}else eu||qm(o,e.type,e.stateNode)}else e.stateNode=Vm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&kl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||tu||t.parentNode.removeChild(t)):a.count--,n===null?eu||qm(o,e.type,e.stateNode):Vm(o,n,e.memoizedProps))}break;case 27:Tu(t,e,n),Ou(e),a&512&&(tu||r===null||Sl(r,r.return)),r!==null&&a&4&&kl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=nu,nu=!1,Tu(t,e,n),nu=o,Ou(e),a&512&&(tu||r===null||Sl(r,r.return)),e.flags&32){t=e.stateNode;try{on(t,``),V=!0}catch(t){Z(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,kl(e,t,r===null?t:r.memoizedProps)),a&1024&&(ru=!0);break;case 6:if(Tu(t,e,n),Ou(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,V=!0}catch(t){Z(e,e.return,t)}}break;case 3:if(V=!1,Gm=null,o=Eu,Eu=xm(t.containerInfo),Tu(t,e,n),Eu=o,Ou(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){Z(e,e.return,t)}ru&&(ru=!1,ku(e)),V=!1;break;case 4:a=nu,nu=eu,r=Wt(),o=Eu,Eu=xm(e.stateNode.containerInfo),Tu(t,e,n),Ou(e),Eu=o,V&&su&&(cu=!0),V=r,nu=a;break;case 12:Tu(t,e,n),Ou(e);break;case 31:Tu(t,e,n),Ou(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,wu(e,t)));break;case 13:Tu(t,e,n),Ou(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(md=Be()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,wu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=eu,l=tu,u=nu;eu=c||o,nu=u||o,tu=l||s,Tu(t,e,n),tu=l,nu=u,eu=c,Ou(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||eu||tu||(t=s||tu,n=eu,r=tu,eu=o||eu,tu=t,Nu(e,2),eu=n,tu=r),!o&&nu||pu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,wu(e,n))));break;case 19:Tu(t,e,n),Ou(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,wu(e,t)));break;case 30:a&512&&(tu||r===null||Sl(r,r.return)),a=Wt(),o=su,s=(n&335544064)===n,c=e.memoizedProps,su=s&&fi(c.default,c.update)!==`none`,Tu(t,e,n),Ou(e),s&&r!==null&&V&&(e.flags|=4),su=o,V=a;break;case 21:break;case 7:a&512&&(tu||r===null||Sl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Tu(t,e,n),Ou(e)}}function Ou(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Al(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Dl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(El(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Nl(e,jl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(on(l,``),n.flags&=-33),Nl(e,jl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ml(e,jl(e),u,s);break;default:throw Error(i(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ku(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ku(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,_h=!0,t.reset(),_h=!1),e=e.sibling}}function Au(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ju(t,e),t=t.sibling;else $l(t,!1)}function ju(e,t){var n=e.alternate;if(n===null)Gl(e,!1);else switch(e.tag){case 3:if(lu=ou=!1,zl(),Au(t,e),!ou&&!cu){if(e=Rl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Dp(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`})),lu=!0}Rl=null;break;case 5:Au(t,e);break;case 4:r=ou,ou=!1,Au(t,e),ou&&(cu=!0),ou=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Au(t,e):Gl(e,!1));break;case 30:r=ou,i=zl(),ou=!1,Au(t,e),ou&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=ui(a,o),o=ui(n.memoizedProps,o);var s=fi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Bl=0,t=Ql(e,n,t,o,s,a,!0),Bl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Nd(e,e.memoizedProps.onUpdate),Rl=i):i!==null&&(i.push.apply(i,Rl),Rl=i),ou=e.flags&32?!0:r;break;default:Au(t,e)}}function Mu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)fu(e,t.alternate,t),t=t.sibling}function Nu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:vl(4,n,n.return),Nu(n,r);break;case 1:Sl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&bl(n,n.return,i),Nu(n,r);break;case 27:r&2&&_m(n.stateNode,n.type,n.memoizedProps);case 5:Sl(n,n.return),n.tag!==5&&n.tag!==27||Tl(n),Nu(n,r);break;case 6:Tl(n);break;case 26:Sl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||tu||i.parentNode.removeChild(i),Nu(n,r);break;case 22:n.memoizedState===null&&Nu(n,r);break;case 30:Sl(n,n.return),Nu(n,r);break;case 7:Sl(n,n.return);default:Nu(n,r)}e=e.sibling}}function Pu(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:Pu(i,a,n),_l(4,a);break;case 1:if(Pu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(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++)_o(l[i],c)}catch(e){Z(r,r.return,e)}}s&&o&64&&yl(a),xl(a,a.return);break;case 27:n&2&&Pl(a);case 5:a.tag!==5&&a.tag!==27||wl(a),Pu(i,a,n),s&&r===null&&o&4&&Ol(a),xl(a,a.return);break;case 6:wl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||eu||qm(xm(c.ownerDocument),a.type,c),Pu(i,a,n),s&&r===null&&o&4&&Ol(a),xl(a,a.return);break;case 12:Pu(i,a,n);break;case 31:Pu(i,a,n),s&&o&4&&xu(i,a);break;case 13:Pu(i,a,n),s&&o&4&&Su(i,a);break;case 22:a.memoizedState===null&&Pu(i,a,n),xl(a,a.return);break;case 30:Pu(i,a,n),xl(a,a.return);break;case 7:xl(a,a.return);default:Pu(i,a,n)}t=t.sibling}}function Fu(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&&Ea(n))}function Iu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ea(e))}function Lu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Ru(e,t,n,r),t=t.sibling;else i&&Zl(t)}function Ru(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Xl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Lu(e,t,n,r),a&2048&&_l(9,t);break;case 1:Lu(e,t,n,r);break;case 3:Lu(e,t,n,r),i&&lu&&(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&&Ea(a)));break;case 12:if(a&2048){Lu(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){Z(t,t.return,e)}}else Lu(e,t,n,r);break;case 31:Lu(e,t,n,r);break;case 13:Lu(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&&Xl(t),o._visibility&2?Lu(e,t,n,r):(o._visibility|=2,zu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Xl(s),o._visibility&2?Lu(e,t,n,r):Bu(e,t)),a&2048&&Fu(s,t);break;case 24:Lu(e,t,n,r),a&2048&&Iu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Ul(a.child,!0),Ul(t.child,!0))),Lu(e,t,n,r);break;default:Lu(e,t,n,r)}}function zu(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:zu(a,o,s,c,i),_l(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,zu(a,o,s,c,i)):u._visibility&2?zu(a,o,s,c,i):Bu(a,o),i&&l&2048&&Fu(o.alternate,o);break;case 24:zu(a,o,s,c,i),i&&l&2048&&Iu(o.alternate,o);break;default:zu(a,o,s,c,i)}t=t.sibling}}function Bu(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:Bu(n,r),i&2048&&Fu(r.alternate,r);break;case 24:Bu(n,r),i&2048&&Iu(r.alternate,r);break;default:Bu(n,r)}t=t.sibling}}var Vu=8192;function Hu(e,t,n){if(e.subtreeFlags&Vu)for(e=e.child;e!==null;)Uu(e,t,n),e=e.sibling}function Uu(e,t,n){switch(e.tag){case 26:Hu(e,t,n),e.flags&Vu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Qm(n,e)):$m(n,Eu,e.memoizedState,e.memoizedProps));break;case 5:Hu(e,t,n),e.flags&Vu&&(e=e.stateNode,(t&335544128)===t&&Qm(n,e));break;case 3:case 4:var r=Eu;Eu=xm(e.stateNode.containerInfo),Hu(e,t,n),Eu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Vu,Vu=16777216,Hu(e,t,n),Vu=r):Hu(e,t,n));break;case 30:if((e.flags&Vu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Il===null&&(Il=new Map),Il.set(r,i)}Hu(e,t,n);break;default:Hu(e,t,n)}}function Wu(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 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];au=r,Ju(r,e)}Wu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ku(e),e=e.sibling}function Ku(e){switch(e.tag){case 0:case 11:case 15:Gu(e),e.flags&2048&&vl(9,e,e.return);break;case 3:Gu(e);break;case 12:Gu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,qu(e)):Gu(e);break;default:Gu(e)}}function qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];au=r,Ju(r,e)}Wu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:vl(8,t,t.return),qu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,qu(t));break;default:qu(t)}e=e.sibling}}function Ju(e,t){for(;au!==null;){var n=au;switch(n.tag){case 0:case 11:case 15:vl(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:Ea(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,au=r;else a:for(n=e;au!==null;){r=au;var i=r.sibling,a=r.return;if(gu(r),r===n){au=null;break a}if(i!==null){i.return=a,au=i;break a}au=a}}}var Yu={getCacheForType:function(e){var t=va(wa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return va(wa).controller.signal}},Xu=typeof WeakMap==`function`?WeakMap:Map,Zu=0,Qu=null,Y=null,X=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,hd=0,gd=1/0,_d=null,vd=null,yd=0,bd=null,xd=null,Sd=0,Cd=0,wd=null,Td=null,Ed=null,Dd=null,Od=null,kd=0,Ad=null;function jd(){return Zu&2&&X!==0?X&-X:F.T===null?_t():Pf()}function Md(){if(ld===0){if(!(X&536870912)||q){var e=rt;rt<<=1,!(rt&3932160)&&(rt=262144),ld=e}else ld=536870912}return e=wo.current,e!==null&&(e.flags|=32),ld}function Nd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Fp(ui(e.memoizedProps,n))),Dd===null&&(Dd=[]),Dd.push(t.bind(null,r))}}function Pd(e,t,n){(e===Qu&&($u===2||$u===9)||e.cancelPendingCommit!==null)&&(Vd(e,0),Rd(e,X,ld,!1)),ut(e,n),(!(Zu&2)||e!==Qu)&&(e===Qu&&(!(Zu&2)&&(sd|=n),ad===4&&Rd(e,X,ld,!1)),Ef(e))}function Fd(e,t,n){if(Zu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||st(e,t),a=r?Yd(e,t):qd(e,t,!0),o=r;do{if(a===0){nd&&!r&&Rd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ld(n))a=qd(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&&(Vd(c,s).flags|=256),s=qd(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){Vd(e,0),Rd(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:Rd(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-Be(),10<a)){if(Rd(r,t,ld,!td),ot(r,0,!0)!==0)break a;Sd=t,r.timeoutHandle=_p(Id.bind(null,r,n,fd,_d,pd,t,ld,sd,ud,td,o,`Throttled`,-0,0),a);break a}Id(r,n,fd,_d,pd,t,ld,sd,ud,td,o,null,-0,0)}break}}while(1);Ef(e)}function Id(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:mn},Il=null,Uu(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=rh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?md-Be():(a&4194048)===a?hd-Be():0,m=th(d,m),m!==null)?(Sd=a,e.cancelPendingCommit=m(nf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Rd(e,a,o,!l)):nf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ld(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(!Pr(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 Rd(e,t,n,r){t=ct(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-Qe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ft(e,n,t)}function zd(){return Zu&6?!0:(Df(0,!1),!1)}function Bd(){if(Y!==null){if($u===0)var e=Y.return;else e=Y,ua=la=null,$o(e),Qa=null,$a=0,e=Y;for(;e!==null;)gl(e.alternate,e),e=e.return;Y=null}}function Vd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,vp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sd=0,Bd(),Qu=e,Y=n=Di(e.current,null),X=t,$u=0,ed=null,td=!1,nd=st(e,t),rd=!1,ud=ld=cd=sd=od=ad=0,fd=dd=null,pd=!1,id=ct(e,t),_i(),n}function Hd(e,t){J=null,F.H=lc,t===Ha||t===Wa?(t=Xa(),$u=3):t===Ua?(t=Xa(),$u=4):$u=t===Dc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ed=t,Y===null&&(ad=1,xc(e,Fi(t,e.current)))}function Ud(){var e=wo.current;return e===null?!0:(X&4194048)===X?To===null:(X&62914560)===X||X&536870912?e===To:!1}function Wd(){var e=F.H;return F.H=lc,e===null?lc:e}function Gd(){var e=F.A;return F.A=Yu,e}function Kd(){ad=4,td||(X&4194048)!==X&&wo.current!==null||(nd=!0),!(od&134217727)&&!(sd&134217727)||Qu===null||Rd(Qu,X,ld,!1)}function qd(e,t,n){var r=Zu;Zu|=2;var i=Wd(),a=Gd();(Qu!==e||X!==t)&&(_d=null,Vd(e,t)),t=!1;var o=ad;a:do try{if($u!==0&&Y!==null){var s=Y,c=ed;switch($u){case 8:Bd(),o=6;break a;case 3:case 2:case 9:case 6:wo.current===null&&(t=!0);var l=$u;if($u=0,ed=null,$d(e,s,c,l),n&&nd){o=0;break a}break;default:l=$u,$u=0,ed=null,$d(e,s,c,l)}}Jd(),o=ad;break}catch(t){Hd(e,t)}while(1);return t&&e.shellSuspendCounter++,ua=la=null,Zu=r,F.H=i,F.A=a,Y===null&&(Qu=null,X=0,_i()),o}function Jd(){for(;Y!==null;)Zd(Y)}function Yd(e,t){var n=Zu;Zu|=2;var r=Wd(),a=Gd();Qu!==e||X!==t?(_d=null,gd=Be()+500,Vd(e,t)):nd=st(e,t);a:do try{if($u!==0&&Y!==null){t=Y;var o=ed;b:switch($u){case 1:$u=0,ed=null,$d(e,t,o,1);break;case 2:case 9:if(Ka(o)){$u=0,ed=null,Qd(t);break}t=function(){$u!==2&&$u!==9||Qu!==e||($u=7),Ef(e)},o.then(t,t);break a;case 3:$u=7;break a;case 4:$u=5;break a;case 7:Ka(o)?($u=0,ed=null,Qd(t)):($u=0,ed=null,$d(e,t,o,7));break;case 5:var s=null;switch(Y.tag){case 26:s=Y.memoizedState;case 5:case 27:var c=Y;if(s?Xm(s):c.stateNode.complete){$u=0,ed=null;var l=c.sibling;if(l!==null)Y=l;else{var u=c.return;u===null?Y=null:(Y=u,ef(u))}break b}}$u=0,ed=null,$d(e,t,o,5);break;case 6:$u=0,ed=null,$d(e,t,o,6);break;case 8:Bd(),ad=6;break a;default:throw Error(i(462))}}Xd();break}catch(t){Hd(e,t)}while(1);return ua=la=null,F.H=r,F.A=a,Zu=n,Y===null?(Qu=null,X=0,_i(),ad):0}function Xd(){for(;Y!==null&&!Re();)Zd(Y)}function Zd(e){var t=sl(e.alternate,e,id);e.memoizedProps=e.pendingProps,t===null?ef(e):Y=t}function Qd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Vc(n,t,t.pendingProps,t.type,void 0,X);break;case 11:t=Vc(n,t,t.pendingProps,t.type.render,t.ref,X);break;case 5:$o(t);var r=t;r===Xi&&(q?(ra(r),r.tag===5&&r.stateNode!=null&&(Zi=r.stateNode)):(ra(r),q=!0));default:gl(n,t),t=Y=Oi(t,id),t=sl(n,t,id)}e.memoizedProps=e.pendingProps,t===null?ef(e):Y=t}function $d(e,t,n,r){ua=la=null,$o(t),Qa=null,$a=0;var i=t.return;try{if(Ec(e,i,t,n,X)){ad=1,xc(e,Fi(n,e.current)),Y=null;return}}catch(t){if(i!==null)throw Y=i,t;ad=1,xc(e,Fi(n,e.current)),Y=null;return}t.flags&32768?(q||r===1?e=!0:nd||X&536870912?e=!1:(td=e=!0,(r===2||r===9||r===3||r===6)&&(r=wo.current,r!==null&&r.tag===13&&(r.flags|=16384))),tf(t,e)):ef(t)}function ef(e){var t=e;do{if(t.flags&32768){tf(t,td);return}e=t.return;var n=ml(t.alternate,t,id);if(n!==null){Y=n;return}if(t=t.sibling,t!==null){Y=t;return}Y=t=e}while(t!==null);ad===0&&(ad=5)}function tf(e,t){do{var n=hl(e.alternate,e);if(n!==null){n.flags&=32767,Y=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Y=e;return}Y=e=n}while(e!==null);ad=6,Y=null}function nf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do df();while(yd!==0);if(Zu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Qu&&(Y=Qu=null,X=0),xd=t,bd=e,Sd=n,wd=a,Td=r,rf(e,t,n,s,c,l,f)}}function rf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Cd=s,s|=gi,dt(e,n,s,r,i,a),Dd=null,(n&335544064)===n?(Od=ka(e),r=10262):(Od=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(We,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Fl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=F.T,F.T=null,i=I.p,I.p=2,a=Zu,Zu|=4;try{uu(e,t,n)}finally{Zu=a,I.p=i,F.T=r}}yd=1,Fl?Ed=Np(o,e.containerInfo,Od,sf,cf,of,lf,ff,af,null,null):(sf(),cf(),lf())}function af(e){if(yd!==0){var t=bd.onRecoverableError;t(e,{componentStack:null})}}function of(){yd===3&&(yd=0,ju(xd,bd),yd=4)}function sf(){if(yd===1){yd=0;var e=bd,t=xd,n=Sd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=F.T,F.T=null;var i=I.p;I.p=2;var a=Zu;Zu|=4;try{su=cu=!1,Du(t,e,n),n=lp;var o=Br(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&zr(s.ownerDocument.documentElement,s)){if(c!==null&&Vr(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 _=Rr(s,h),v=Rr(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}}_h=!!cp,lp=cp=null}finally{Zu=a,I.p=i,F.T=r}}e.current=t,yd=2}}function cf(){if(yd===2){yd=0;var e=bd,t=xd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Zu;Zu|=4;try{fu(e,t.alternate,t)}finally{Zu=i,I.p=r,F.T=n}}yd=3}}function lf(){if(yd===4||yd===3){yd=0;var e=Ed;Ed=null,ze();var t=bd,n=xd,r=Sd,i=Td,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?yd=5:(yd=0,xd=bd=null,uf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(vd=null),gt(r),n=n.stateNode,Xe&&typeof Xe.onCommitFiberRoot==`function`)try{Xe.onCommitFiberRoot(Ye,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=F.T,a=I.p,I.p=2,F.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{F.T=n,I.p=a}}if(i=Dd,o=Od,Od=null,i!==null&&(Dd=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);Sd&3&&df(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===Ad?kd++:(kd=0,Ad=t):(kd=0,Ad=null),Df(0,!1)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ea(t)))}function df(){return Ed!==null&&(Ed.skipTransition(),Ed=null),sf(),cf(),lf(),ff()}function ff(){if(yd!==5)return!1;var e=bd,t=Cd;Cd=0;var n=gt(Sd),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=wd,wd=null;var o=bd,s=Sd;if(yd=0,xd=bd=null,Sd=0,Zu&6)throw Error(i(331));var c=Zu;if(Zu|=4,Ku(o.current),Ru(o,o.current,s,n),Zu=c,Df(0,!1),Xe&&typeof Xe.onPostCommitFiberRoot==`function`)try{Xe.onPostCommitFiberRoot(Ye,o)}catch{}return!0}finally{I.p=a,F.T=r,uf(e,t)}}function pf(e,t,n){t=Fi(n,t),t=Cc(e.stateNode,t,2),e=uo(e,t,2),e!==null&&(ut(e,2),Ef(e))}function Z(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vd===null||!vd.has(r))){e=Fi(n,e),n=wc(2),r=uo(t,n,2),r!==null&&(Tc(n,r,t,e),ut(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Xu;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=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Qu===e&&(X&n)===n&&(ad===4||ad===3&&(X&62914560)===X&&300>Be()-md?Zu&2?cd|=n:Vd(e,0):cd|=n,ud===X&&(ud=0)),Ef(e)}function gf(e,t){t===0&&(t=lt()),e=bi(e,t),e!==null&&(ut(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(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),gf(e,n)}function yf(e,t){return Ie(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;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-Qe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=X,a=ot(r,r===Qu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||st(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&gp()&&(e=Tf);for(var t=Be(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}yd!==0&&yd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Qe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=z(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Qu,n=X,n=ot(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&&Le(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||st(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Le(r),gt(n)){case 2:case 8:n=Ue;break;case 32:n=We;break;case 268435456:n=Ke;break;default:n=We}return r=jf.bind(null,e),n=Ie(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Le(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(yd!==0&&yd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(df()&&e.callbackNode!==n)return null;var r=X;return r=ot(e,e===Qu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Fd(e,r,t),Af(e,Be()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(df())return null;Fd(e,t,!0)}function Nf(){xp(function(){Zu&6?Ie(He,Of):kf()})}function Pf(){if(Tf===0){var e=Ma;e===0&&(e=nt,nt<<=1,!(nt&261888)&&(nt=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:pn(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[xt]||null).action),o=r.submitter;o&&(t=(t=o[xt]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Fn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);Ys(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Ys(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<si.length;Lf++){var Rf=si[Lf];ci(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}ci($r,`onAnimationEnd`),ci(ei,`onAnimationIteration`),ci(ti,`onAnimationStart`),ci(`dblclick`,`onDoubleClick`),ci(`focusin`,`onFocus`),ci(`focusout`,`onBlur`),ci(ni,`onTransitionRun`),ci(ri,`onTransitionStart`),ci(ii,`onTransitionCancel`),ci(ai,`onTransitionEnd`),zt(`onMouseEnter`,[`mouseout`,`mouseover`]),zt(`onMouseLeave`,[`mouseout`,`mouseover`]),zt(`onPointerEnter`,[`pointerout`,`pointerover`]),zt(`onPointerLeave`,[`pointerout`,`pointerover`]),Rt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Rt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Rt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Rt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Rt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Rt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`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(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(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){pi(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){pi(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[Ct];n===void 0&&(n=t[Ct]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,It.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(Ch(t)){case 2:var i=vh;break;case 8:i=yh;break;default:i=$}n=i.bind(null,t,n,e),i=void 0,!wn||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 Kf(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=At(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}xn(function(){var r=a,i=gn(n),s=[];a:{var c=oi.get(e);if(c!==void 0){var l=Fn,u=e;switch(e){case`keypress`:if(An(n)===0)break a;case`keydown`:case`keyup`:l=$n;break;case`focusin`:u=`focus`,l=Wn;break;case`focusout`:u=`blur`,l=Wn;break;case`beforeblur`:case`afterblur`:l=Wn;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=Hn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Un;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=nr;break;case $r:case ei:case ti:l=Gn;break;case ai:l=rr;break;case`scroll`:case`scrollend`:l=Ln;break;case`wheel`:l=ir;break;case`copy`:case`cut`:case`paste`:l=Kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=er;break;case`submit`:l=tr;break;case`toggle`:case`beforetoggle`:l=ar}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=Sn(m,p),g!=null&&d.push(qf(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!==hn&&(u=n.relatedTarget||n.fromElement)&&(At(u)||u[St]))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?At(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=Hn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=er,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Mt(c),h=l==null?u:Mt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,At(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,Yf):null,c!==null&&Xf(s,u,c,d,!1),l!==null&&f!==null&&Xf(s,f,l,d,!0)))}a:{if(c=r?Mt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Tr;else if(yr(c)){if(Er)_=Nr;else{_=jr;var v=Ar}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&un(r.elementType)&&(_=Tr):_=Mr;if(_&&=_(e,r)){br(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Mt(r):window,e){case`focusin`:(yr(v)||v.contentEditable===`true`)&&(Ur=v,Wr=r,Gr=null);break;case`focusout`:Gr=Wr=Ur=null;break;case`mousedown`:Kr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Kr=!1,qr(s,n,i);break;case`selectionchange`:if(Hr)break;case`keydown`:case`keyup`:qr(s,n,i)}var y;if(sr)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 hr?pr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(ur&&n.locale!==`ko`&&(hr||b!==`onCompositionStart`?b===`onCompositionEnd`&&hr&&(y=kn()):(En=i,Dn=`value`in En?En.value:En.textContent,hr=!0)),v=Jf(r,b),0<v.length&&(b=new qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=mr(n),y!==null&&(b.data=y)))),(y=lr?gr(e,n):_r(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),If(s,e,r,n,i)}Vf(s,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(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=Sn(e,n),i!=null&&r.unshift(qf(e,i,a)),i=Sn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(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=Sn(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=Sn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
9
- `).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function tp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||on(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&on(e,``+r);else return;break;case`className`:H(e,`class`,r);break;case`tabIndex`:H(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:H(e,n,r);break;case`style`:ln(e,r,o);return;case`data`:if(t!==`object`){H(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=pn(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`&&tp(e,t,`name`,a.name,a,null),tp(e,t,`formEncType`,a.formEncType,a,null),tp(e,t,`formMethod`,a.formMethod,a,null),tp(e,t,`formTarget`,a.formTarget,a,null)):(tp(e,t,`encType`,a.encType,a,null),tp(e,t,`method`,a.method,a,null),tp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=pn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=mn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`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=pn(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`:Q(`beforetoggle`,e),Q(`toggle`,e),Gt(e,`popover`,r);break;case`xlinkActuate`:U(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:U(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:U(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:U(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:U(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:U(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:U(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:U(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:U(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Gt(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=dn.get(n)||n,Gt(e,n,r);else return}V=!0}function np(e,t,n,r,a,o){switch(n){case`style`:ln(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`)on(e,r);else if(typeof r==`number`||typeof r==`bigint`)on(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=mn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Lt.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[xt]||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}V=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Gt(e,n,r)}return}V=!0}function rp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`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:tp(e,t,o,s,n,null)}}a&&tp(e,t,`srcSet`,n.srcSet,n,null),r&&tp(e,t,`src`,n.src,n,null);return;case`input`:Q(`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:tp(e,t,r,d,n,null)}}en(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`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:tp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&nn(e,!!r,n,!0):nn(e,!!r,t,!1);return;case`textarea`:for(s in Q(`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:tp(e,t,s,c,n,null)}an(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:tp(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`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:tp(e,t,u,r,n,null)}return;default:if(un(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&np(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&tp(e,t,c,r,n,null))}var ip={};function ap(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)||tp(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&&(V=!0),o=m;break;case`name`:m!==f&&(V=!0),a=m;break;case`checked`:m!==f&&(V=!0),u=m;break;case`defaultChecked`:m!==f&&(V=!0),d=m;break;case`value`:m!==f&&(V=!0),s=m;break;case`defaultValue`:m!==f&&(V=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&tp(e,t,p,m,r,f)}}$t(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)||tp(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&&(V=!0),p=o;break;case`defaultValue`:o!==l&&(V=!0),c=o;break;case`multiple`:o!==l&&(V=!0),s=o;default:o!==l&&tp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?nn(e,!!n,n?[]:``,!1):nn(e,!!n,t,!0)):nn(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:tp(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&&(V=!0),p=a;break;case`defaultValue`:a!==o&&(V=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&tp(e,t,s,a,r,o)}rn(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:tp(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&&(V=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:tp(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)&&tp(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:tp(e,t,u,p,r,m)}return;default:if(un(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&np(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||np(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&tp(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||tp(e,t,f,p,r,m)}function op(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function sp(){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&&op(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&&op(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 cp=null,lp=null;function up(e){return e.nodeType===9?e:e.ownerDocument}function dp(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 fp(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 pp(e,t,n,r){return n=up(n).createElement(e),n[bt]=r,n[xt]=t,rp(n,e,t),Pt(n),n}function mp(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 hp=null;function gp(){var e=window.event;return e&&e.type===`popstate`?e!==hp&&(hp=e,!0):(hp=null,!1)}var _p=typeof setTimeout==`function`?setTimeout:void 0,vp=typeof clearTimeout==`function`?clearTimeout:void 0,yp=typeof Promise==`function`?Promise:void 0,bp=typeof requestAnimationFrame==`function`?requestAnimationFrame:_p,xp=typeof queueMicrotask==`function`?queueMicrotask:yp===void 0?_p:function(e){return yp.resolve(null).then(e).catch(Sp)};function Sp(e){setTimeout(function(){throw e})}function Cp(e){return e===`head`}function wp(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`)vm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Dt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vm(e.ownerDocument.body)}n=i}while(n);Hh(t)}function Tp(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 Ep(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 Dp(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 Op(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 kp(e){return Op(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ap(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Op(t,n,e)}function jp(e){return e.documentElement.clientHeight}function Mp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Np(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`&&(jp(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+=Zm(f),u>eh){s.length=o;break}f=new Promise(Mp.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 Pp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Pp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Pp.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},Pp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Fp(e){return{name:e,group:new Pp(`group`,e),imagePair:new Pp(`image-pair`,e),old:new Pp(`old`,e),new:new Pp(`new`,e)}}function Ip(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Ip.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(Vp(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=zp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Lp,e,s,r)}this._eventListeners=a}};function Lp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Ip.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Vp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=zp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Rp,e,n,i),r.splice(t,1),a!==null&&a()}};function Rp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function zp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Bp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Vp(e,t,n,r){if(e.length===0)return-1;r=Bp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Bp(a.optionsOrUseCapture)===r)return i}return-1}Ip.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,zp(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,zp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Ip.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Hp,e,void 0,void 0)};function Hp(e,t){return e.tag!==6&&(e=b(e),mm(e,t))}Ip.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Up,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Hp(t[n],e);n--);};function Up(e,t){return t.push(e),!1}Ip.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=up(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Wp,e,void 0,void 0))};function Wp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Ip.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Ip.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Kp,e,void 0,void 0);for(var n=t=0;n<qp.length;n++){var r=qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):qp[t++]=r}qp.length=t}};function Kp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var qp=[],Jp=!1;function Yp(e,t,n){qp.push({fragmentInstance:e,observer:t,instance:n}),Jp||(Jp=!0,hm(function(){Jp=!1;var e=qp;qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Ip.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Xp,e,void 0,void 0),e};function Xp(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}Ip.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Ip.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Up,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||Zp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Zp(e,t,n,r,i){var a=At(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 Qp(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)}Ip.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Up,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),Qp(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),Qp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function $p(e,t){return e=b(e),em(e,t),!1}function em(e,t){e.reactFragments??=new Set,e.reactFragments.add(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.addEventListener(i.type,i.attachedListener,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<qp.length;i++){var a=qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(qp[r++]=a)}qp.length=r,n.observe(e)}),em(e,t))}function nm(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,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Yp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function rm(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`:rm(n),kt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function im(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[Dt])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=um(e.nextSibling),e===null)break}return null}function am(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=um(e.nextSibling),e===null))return null;return e}function om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=um(e.nextSibling),e===null))return null;return e}function sm(e){return e.data===`$?`||e.data===`$~`}function cm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lm(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 um(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 dm=null;function fm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return um(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pm(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 mm(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 hm(e){bp(function(){bp(function(t){return e(t)})})}function gm(e,t,n){switch(t=up(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 _m(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&tp(e,t,r,null,ip,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===mn&&(e.onclick=null),kt(e)}function vm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);kt(e)}var ym=new Map,bm=new Set;function xm(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 Sm=I.d;I.d={f:Cm,r:wm,D:Dm,C:Om,L:km,m:Am,X:Mm,S:jm,M:Nm};function Cm(){var e=Sm.f(),t=zd();return e||t}function wm(e){var t=jt(e);t!==null&&t.tag===5&&t.type===`form`?Zs(t):Sm.r(e)}var Tm=typeof document>`u`?null:document;function Em(e,t,n){var r=Tm;if(r&&typeof t==`string`&&t){var i=Qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bm.has(i)||(bm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),rp(t,`link`,e),Pt(t),r.head.appendChild(t)))}}function Dm(e){Sm.D(e),Em(`dns-prefetch`,e,null)}function Om(e,t){Sm.C(e,t),Em(`preconnect`,e,t)}function km(e,t,n){Sm.L(e,t,n);var r=Tm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Qt(n.imageSizes)+`"]`)):i+=`[href="`+Qt(e)+`"]`;var a=i;switch(t){case`style`:a=Fm(e);break;case`script`:a=zm(e)}if(!(ym.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),ym.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Im(a))||t===`script`&&r.querySelector(Bm(a))))){var o=r.createElement(`link`);rp(o,`link`,e),t===`style`&&(o[Ot]=!0,o.onload=o.onerror=function(){Ft(o)}),Pt(o),r.head.appendChild(o)}}}function Am(e,t){Sm.m(e,t);var n=Tm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Qt(r)+`"][href="`+Qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zm(e)}if(!ym.has(a)&&(e=D({rel:`modulepreload`,href:e},t),ym.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bm(a)))return}r=n.createElement(`link`),rp(r,`link`,e),Pt(r),n.head.appendChild(r)}}}function jm(e,t,n){Sm.S(e,t,n);var r=Tm;if(r&&e){var i=Nt(r).hoistableStyles,a=Fm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Im(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=ym.get(a))&&Um(e,n);var c=o=r.createElement(`link`);Pt(c),rp(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,Hm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mm(e,t){Sm.X(e,t);var n=Tm;if(n&&e){var r=Nt(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=D({src:e,async:!0},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),Pt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t){Sm.M(e,t);var n=Tm;if(n&&e){var r=Nt(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),Pt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t,n,r){var a=(a=we.current)?xm(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=Fm(n.href),t=Nt(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=Fm(n.href);var o=Nt(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(Im(e)))?o._p||(s.instance=o,s.state.loading=5):(o=ym.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},ym.set(e,o)),Rm(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=zm(n),t=Nt(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 Fm(e){return`href="`+Qt(e)+`"`}function Im(e){return`link[rel="stylesheet"][`+e+`]`}function Lm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Rm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ot]){r.loading=1;return}}else t=e.createElement(`link`),t[Ot]=!0,t.onload=t.onerror=Ft.bind(null,t),rp(t,`link`,n),Pt(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 zm(e){return`[src="`+Qt(e)+`"]`}function Bm(e){return`script[async]`+e}function Vm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Qt(n.href)+`"]`);if(r)return t.instance=r,Pt(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`),Pt(r),rp(r,`style`,a),Hm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Fm(n.href);var o=e.querySelector(Im(a));if(o)return t.state.loading|=4,t.instance=o,Pt(o),o;r=Lm(n),(a=ym.get(a))&&Um(r,a),o=(e.ownerDocument||e).createElement(`link`),Pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),rp(o,`link`,r),t.state.loading|=4,Hm(o,n.precedence,e),t.instance=o;case`script`:return o=zm(n.src),(a=e.querySelector(Bm(o)))?(t.instance=a,Pt(a),a):(r=n,(a=ym.get(o))&&(r=D({},n),Wm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Pt(a),rp(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,Hm(r,n.precedence,e));return t.instance}function Hm(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 Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gm=null;function Km(e,t,n){if(Gm===null){var r=new Map,i=Gm=new Map;i.set(n,r)}else i=Gm,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[Dt]||a[bt]||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 qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jm(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 Ym(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Xm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Qm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Zm(t),e.suspenseyImages.push(t)),e=ih.bind(e),t.decode().then(e,e))}function $m(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=Fm(r.href),a=t.querySelector(Im(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Pt(a);return}a=t.ownerDocument||t,r=Lm(r),(i=ym.get(i))&&Um(r,i),a=a.createElement(`link`),Pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),rp(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=rh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var eh=0;function th(e,t){return e.stylesheets&&e.count===0&&oh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&eh===0&&(eh=62500*sp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>eh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function nh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)oh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function rh(){this.count--,nh(this)}function ih(){this.imgCount--,nh(this)}var ah=null;function oh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ah=new Map,t.forEach(sh,e),ah=null,rh.call(e))}function sh(e,t){if(!(t.state.loading&4)){var n=ah.get(e);if(n)var r=n.get(null);else{n=new Map,ah.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=rh.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 ch={$$typeof:N,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function lh(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=B(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=B(0),this.hiddenUpdates=B(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 uh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ti(3,null,null,t),e.current=a,a.stateNode=e,t=Ta(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},so(a),e}function dh(e){return e?(e=Ci,e):Ci}function fh(e,t,n,r,i,a){i=dh(i),r.context===null?r.context=i:r.pendingContext=i,r=lo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=uo(e,r,t),n!==null&&(Pd(n,e,t),fo(n,e,t))}function ph(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mh(e,t){ph(e,t),(e=e.alternate)&&ph(e,t)}function hh(e){if(e.tag===13||e.tag===31){var t=bi(e,67108864);t!==null&&Pd(t,e,67108864),mh(e,67108864)}}function gh(e){if(e.tag===13||e.tag===31){var t=jd();t=ht(t);var n=bi(e,t);n!==null&&Pd(n,e,t),mh(e,t)}}var _h=!0;function vh(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,$(e,t,n,r)}finally{I.p=a,F.T=i}}function yh(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,$(e,t,n,r)}finally{I.p=a,F.T=i}}function $(e,t,n,r){if(_h){var i=bh(r);if(i===null)Kf(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=jt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=at(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Qe(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(Zu&6)&&(gd=Be()+500,Df(0,!1))}}break;case 31:case 13:s=bi(a,2),s!==null&&Pd(s,a,2),zd(),mh(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=gn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=At(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(Ve()){case He:return 2;case Ue:return 8;case We:case Ge:return 32;case Ke: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=jt(t),t!==null&&hh(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=At(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,vt(e.priority,function(){gh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,vt(e.priority,function(){gh(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);hn=r,n.target.dispatchEvent(r),hn=null}else return t=jt(n),t!==null&&hh(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=jt(n);a!==null&&(e.splice(t,3),t-=3,Ys(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[xt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[xt]||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;fh(n,jd(),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;fh(e.current,2,null,e,null,null),zd(),t[St]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=_t();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.0`)throw Error(i(527,Kh,`19.3.0`));I.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.0`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Ye=Jh.inject(qh),Xe=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=vc,s=yc,c=bc;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=uh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[St]=t.current,Wf(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=d(),y=_(),b=[`default`,`acceptEdits`,`auto`,`plan`],x=`~chats`;function S(e){return e===`~chats`?`Chats`:e}var C=[`normal`,`high`,`critical`],w=[`merge`,`devShip`,`computerControl`],T=[`merge`,`devShip`],E=String.raw`(?<![\w.-])g?sudo(?:\.exe)?(?![\w.-])`,D=String.raw`(?<![\w.-])runas(?:\.exe)?(?![\w.-])`,O=[`Bash`,`PowerShell`];function k(e,t){if(!O.includes(e)||typeof t.command!=`string`)return!1;let n=t.command;return[E,D].some(e=>new RegExp(e,`i`).test(n))}var ee=[{name:`Kubernetes or Helm commands`,kind:`command`,pattern:String.raw`\b(kubectl|helm)\b`},{name:`Terraform apply, destroy or state changes`,kind:`command`,pattern:String.raw`\bterraform\s+(apply|destroy|import|state\s+(rm|mv|push))\b`},{name:`Pulumi up, destroy or refresh`,kind:`command`,pattern:String.raw`\bpulumi\s+(up|destroy|refresh)\b`},{name:`Cloud CLI commands (aws, az, gcloud) that are not read-only`,kind:`command`,pattern:String.raw`\b(aws|az|gcloud)\b(?![^|;&]*\b(describe|list|get|show|ls|version|help)\b)`},{name:`Publishing to npm`,kind:`command`,pattern:String.raw`\bnpm\s+publish\b`},{name:`Pushing a container image`,kind:`command`,pattern:String.raw`\b(docker|podman)\s+push\b`},{name:`Pushing to main or master, or force-pushing`,kind:`command`,pattern:String.raw`\bgit\s+(?:-[Cc]\s+\S+\s+)*push\b[^|;&]*(\s--force\b|\s-f\b|\s--force-with-lease\b|\bmain\b|\bmaster\b)`},{name:`Elevated commands with gsudo or sudo`,kind:`command`,pattern:E},{name:`Starting a program as administrator (-Verb RunAs, runas)`,kind:`command`,pattern:D},{name:`.env files`,kind:`path`,pattern:String.raw`(^|[\\/])\.env(\.[^\\/]*)?$`},{name:`Files named like credentials`,kind:`path`,pattern:String.raw`credentials`},{name:`Key and certificate files (.pem, .key, .p12, .pfx)`,kind:`path`,pattern:String.raw`\.(pem|key|p12|pfx)$`}];function A(e,t){return ee.find(n=>n.kind===t&&n.pattern===e)?.name}function j(e,t){return ee.filter(n=>!(n.kind===`command`?e:t).includes(n.pattern))}function M(e){let t=j(e.commandPatterns,e.pathPatterns);return{...e,commandPatterns:[...e.commandPatterns,...t.filter(e=>e.kind===`command`).map(e=>e.pattern)],pathPatterns:[...e.pathPatterns,...t.filter(e=>e.kind===`path`).map(e=>e.pattern)]}}var te=[`Blocks a finished PR`,`Blocks a card from Ready`,`Process`,`Housekeeping`,`Record only`],N=`Accepted.`,P=`Changes needed:`;function ne(e,t){let n=t.trim();return e===`accept`?{answer:n?`${N}\n\n${n}`:N}:n?{answer:`${P} ${n}`}:{problem:`Say what needs changing in the box first.`}}var re=/\s*\(recommended\)\s*$/i,ie=e=>e.replace(/\*\*|`/g,``);function ae(e){let t=e.match(/^\*\*(.+?)\*\*[.:]?\s*([\s\S]*)$/);return t?{label:t[1].replace(/\.$/,``),detail:t[2].trim()}:{label:e,detail:``}}function oe(e){return`${e.key} — ${ie(ae(e.text).label)}`}function se(e,t){if(e?.trim())return e;let n=[];if(t.review){let e=t.review;return t.title&&n.push(`**Review: ${t.title}**`),n.push(`**What we were solving**\n\n${e.solving}`,`**What was done**\n\n${e.done}`),e.notes&&n.push(`**Notes**\n\n${e.notes}`),e.evidence?.length&&n.push(`**Evidence**\n\n${e.evidence.map(e=>`- ${e.caption} (\`${e.file.replace(/`/g,`'`)}\`)`).join(`
10
- `)}`),n.push(`Answered "${N}" or "${P} …" on the review page.`),n.join(`
11
-
12
- `)}t.title&&n.push(`**${t.title}**`),t.issue&&n.push(t.issue),t.evidence&&n.push(`**Evidence**\n\n${t.evidence}`),t.options?.length&&n.push(t.options.map(e=>`- ${e.key}) ${e.text}${e.cost?` Cost: ${e.cost}`:``}`).join(`
13
- `)),t.recommended&&n.push(`Recommended: ${t.recommended}${t.why?`. ${t.why}`:``}`),t.reviewer&&n.push(`${t.reviewer.who||`Reviewer`}: ${t.reviewer.pick??`no pick among the options`}${t.reviewer.why?`. ${t.reviewer.why}`:``}`);for(let e of t.opinions??[])n.push(`${e.who}: ${e.pick??`no pick among the options`}${e.why?`. ${e.why}`:``}`);return n.join(`
14
-
15
- `)}function ce(e){let t=e.details;if(t?.review)return{structured:!0,title:t.title||pe(t.review.solving),issue:``,evidence:``,options:[],opinions:[],tier:t.tier??null,rank:t.rank??null,refs:t.refs??[],review:t.review};if(t&&(t.options?.length||t.issue||t.title))return{structured:!0,title:t.title||pe(t.issue||e.question),issue:[t.issue,le(e.question,t)].filter(Boolean).join(`
16
-
17
- `)||(t.title?``:e.question),evidence:t.evidence??``,options:t.options?.length?t.options.map(e=>({key:e.key,...ae(e.text),cost:e.cost??``,answer:oe(e)})):fe(e.options).options,opinions:ue(t,t.options?.length?null:fe(e.options).recommended),tier:t.tier??null,rank:t.rank??null,refs:t.refs??[],review:null};let{options:n,recommended:r}=fe(e.options);return{structured:!1,title:pe(e.question),issue:e.question,evidence:``,options:n,opinions:r?[{who:null,pick:r,why:``}]:[],tier:t?.tier??null,rank:t?.rank??null,refs:t?.refs??[],review:null}}function le(e,t){let n=e.trim();return!n||n===t.issue?.trim()||n===t.title?.trim()||n===se(void 0,t).trim()?``:e}function ue(e,t){let n=[];e.reviewer&&n.push({who:e.reviewer.who||`Reviewer`,pick:e.reviewer.pick??null,why:e.reviewer.why??``});let r=e.recommended??t;(r||e.why)&&n.push({who:null,pick:r,why:e.why??``});for(let t of e.opinions??[])n.push({who:t.who,pick:t.pick??null,why:t.why??``});return n}function de(e){return new Set(e.map(e=>e.pick).filter(e=>e!==null)).size>1}function fe(e){let t=null;return{options:(e??[]).map((e,n)=>{let r=String(n+1);return re.test(e)&&!t&&(t=r),{key:r,label:e.replace(re,``),detail:``,cost:``,answer:e}}),recommended:t}}function pe(e){let t=e.split(`
18
- `);if(t.length>2&&t[0].trim().length<=110&&!t[1].trim())return ie(t[0].trim()).replace(/^#+\s*/,``);let n=ie(e).replace(/\s+/g,` `).trim(),r=n.match(/^(.{10,110}?[.?!])(\s|$)/);return r?r[1]:n.slice(0,100)+(n.length>100?`…`:``)}function me(e,t){return e&&t.includes(e)?e:null}function he(e){let t=[];for(let n of e)for(let e of n)t.includes(e)||t.push(e);return t}function F(e){let t=t=>t===null?e.length:e.indexOf(t);return(e,n)=>t(e.tier)-t(n.tier)||(e.rank??1/0)-(n.rank??1/0)||e.askedAt-n.askedAt}var I=()=>globalThis.location?.protocol===`https:`,ge=null,_e=e=>{ge=e},ve=()=>{if(!ge)throw Error(`This browser has no passkeys.`);return ge},ye=`The passkey check was cancelled.`,be=null,xe=e=>{be=e},Se=!1;async function Ce(e,t,n){let r=t===`/api/device-unlock`?`unlock`:`sign`;if(be&&(r===`unlock`||!Se)){if(!await be({kind:r}))throw Error(ye);Se=!0}for(;;){let i=await L(`POST`,`/api/passkey-challenge`,{method:e,path:t,body:n});try{return await ve().sign(i)}catch(e){let t=e instanceof Error?e.message:String(e);if(!be||!await be({kind:r,failed:t}))throw e}}}var we=null,Te=[],Ee=e=>{we=e,e&&Te.splice(0).forEach(t=>t(e))},De=()=>{we=null},Oe=null,ke=null,Ae=e=>{Oe=e};function je(e){let t=new WebSocket(e);return ke=t,t.addEventListener(`close`,()=>{ke===t&&De()}),t}var Me=5e3;function Ne(){return we?Promise.resolve(we):new Promise(e=>{let t=t=>{clearTimeout(n),e(t)},n=setTimeout(()=>{Te=Te.filter(e=>e!==t),e(null)},Me);Te.push(t)})}var Pe=async e=>(await e.clone().json().catch(()=>({}))).error;async function L(e,t,n){let r=n===void 0?void 0:JSON.stringify(n),i=(n,i)=>{let a=r===void 0?{}:{"Content-Type":`application/json`};return n&&(a[`X-Ledung-Page`]=n),i&&(a[`X-Ledung-Passkey`]=i),fetch(t,{method:e,credentials:`same-origin`,headers:a,body:r})},a=e!==`GET`,o=a?await Ne():null,s=await i(o);if(a&&s.status===403&&o&&Oe&&(await Pe(s))?.startsWith(`Only Ledung's open page can do this`)&&we===o&&(De(),Oe()),a&&s.status===403&&we!==o){let e=await Ne();e&&(s=await i(o=e))}let c=async()=>a&&I()&&s.status===403?Pe(s):void 0;await c()===`This device is locked: unlock it with its passkey to make changes from here.`&&(await L(`POST`,`/api/device-unlock`,{}),s=await i(o)),a&&I()&&s.status===403&&await c()===`This needs your passkey.`&&(s=await i(o,await Ce(e,t,r??``)));let l=await s.json().catch(()=>({}));if(!s.ok)throw Error(l.error??`Request failed (${s.status}).`);return l}var R={messages:(e,t)=>L(`GET`,`/api/sessions/${e}/messages?limit=500${t?`&before=${t}`:``}`),messagesAfter:(e,t)=>L(`GET`,`/api/sessions/${e}/messages?limit=500&after=${t}`),start:(e,t)=>L(`POST`,`/api/sessions`,{project:e,role:`session`,...t?{profile:t}:{}}),startChat:e=>L(`POST`,`/api/chats-new`,e),updateChats:e=>L(`POST`,`/api/chats`,{sensitive:e}),setChatsColour:e=>L(`POST`,`/api/chats-colour`,{colour:e}),editComputer:(e,t)=>L(`POST`,`/api/computers`,{id:e,...t}),send:(e,t)=>L(`POST`,`/api/sessions/${e}/messages`,{text:t}),shellCheck:(e,t)=>L(`GET`,`/api/sessions/${e}/shell-check?command=${encodeURIComponent(t)}`),shell:(e,t,n)=>L(`POST`,`/api/sessions/${e}/shell`,{command:t,confirmed:n}),shellStop:e=>L(`POST`,`/api/sessions/${e}/shell-stop`,{}),setPermissionMode:(e,t)=>L(`POST`,`/api/sessions/${e}/permission-mode`,{mode:t}),interrupt:e=>L(`POST`,`/api/sessions/${e}/interrupt`,{}),mcpServers:e=>L(`GET`,`/api/sessions/${e}/mcp`),reconnectMcp:(e,t)=>L(`POST`,`/api/sessions/${e}/mcp-reconnect`,{name:t}),stop:e=>L(`POST`,`/api/sessions/${e}/stop`,{}),resume:e=>L(`POST`,`/api/sessions/${e}/resume`,{}),archive:e=>L(`POST`,`/api/sessions/${e}/archive`,{}),unarchive:e=>L(`POST`,`/api/sessions/${e}/unarchive`,{}),rename:(e,t)=>L(`POST`,`/api/sessions/${e}/rename`,{title:t}),restart:()=>L(`POST`,`/api/restart`,{}),shortcuts:()=>L(`GET`,`/api/shortcuts`),shortcutsAct:e=>L(`POST`,`/api/shortcuts`,{action:e}),updateStatus:()=>L(`GET`,`/api/update`),updateCheck:()=>L(`POST`,`/api/update-check`,{}),update:()=>L(`POST`,`/api/update`,{}),certificateCheck:()=>L(`POST`,`/api/certificate-check`,{}),remoteLink:()=>L(`GET`,`/api/remote-link`),remoteJoin:e=>L(`POST`,`/api/remote-join`,{code:e}),remoteLeave:()=>L(`POST`,`/api/remote-leave`,{}),relayAdmin:()=>L(`GET`,`/api/relay-admin`),setRelayAdmin:e=>L(`POST`,`/api/relay-admin`,e),makeRelayAdminKey:()=>L(`POST`,`/api/relay-admin-key`,{}),relayComputers:()=>L(`GET`,`/api/relay-computers`),relayInvite:(e,t)=>L(`POST`,`/api/relay-invite`,{owner:e,...t?{name:t}:{}}),revokeRelayInvite:e=>L(`POST`,`/api/relay-invites/${encodeURIComponent(e)}/revoke`,{}),approveComputer:e=>L(`POST`,`/api/relay-computers/${encodeURIComponent(e)}/approve`,{}),computerAdded:e=>L(`POST`,`/api/relay-computers/${encodeURIComponent(e)}/added`,{}),usage:e=>L(`GET`,`/api/usage?${new URLSearchParams(Object.entries(e).filter(([,e])=>e)).toString()}`),sessionUsage:e=>L(`GET`,`/api/sessions/${e}/usage`),overview:()=>L(`GET`,`/api/overview`),answerQuestion:(e,t)=>L(`POST`,`/api/questions/${e}/answer`,{answer:t}),withdrawQuestion:e=>L(`POST`,`/api/questions/${e}/withdraw`,{}),evidenceText:(e,t)=>L(`GET`,`/api/questions/${e}/evidence/${t}`),file:(e,t,n)=>L(`GET`,`/api/sessions/${e}/file?path=${encodeURIComponent(t)}${n?`&in=${n}`:``}`),paneFolders:e=>L(`GET`,`/api/sessions/${e}/folders`),tree:(e,t,n)=>L(`GET`,`/api/sessions/${e}/tree?in=${t}&path=${encodeURIComponent(n)}`),changes:e=>L(`GET`,`/api/sessions/${e}/changes`),sendLineComments:(e,t)=>L(`POST`,`/api/sessions/${e}/line-comments`,t),decide:(e,t)=>L(`POST`,`/api/permissions/${e}`,t),projects:()=>L(`GET`,`/api/projects`),setProjectColours:(e,t)=>L(`POST`,`/api/projects/${encodeURIComponent(e)}/colours`,t),orderProjects:e=>L(`POST`,`/api/projects-order`,{names:e}),orderSessions:e=>L(`POST`,`/api/sessions-order`,{ids:e}),accounts:()=>L(`GET`,`/api/accounts`),checkSignIn:()=>L(`POST`,`/api/signin-check`),addAccount:e=>L(`POST`,`/api/accounts`,e),setAccountChoices:e=>L(`POST`,`/api/account-choices`,e),openAccountFolder:e=>L(`POST`,`/api/accounts/${encodeURIComponent(e)}/open-folder`,{}),removeAccount:e=>L(`POST`,`/api/accounts/${encodeURIComponent(e)}/remove`,{}),addProject:e=>L(`POST`,`/api/projects`,e),createProject:e=>L(`POST`,`/api/projects-new`,e),updateProject:(e,t)=>L(`POST`,`/api/projects/${encodeURIComponent(e)}`,t),renameProject:(e,t,n)=>L(`POST`,`/api/projects/${encodeURIComponent(e)}/rename`,{name:t,...n?{settings:n}:{}}),removeProject:e=>L(`POST`,`/api/projects/${encodeURIComponent(e)}/remove`,{}),messageManager:(e,t)=>L(`POST`,`/api/projects/${encodeURIComponent(e)}/manager`,{text:t}),browse:e=>L(`GET`,`/api/browse${e?`?path=${encodeURIComponent(e)}`:``}`),containers:()=>L(`GET`,`/api/containers`),skills:e=>L(`GET`,`/api/skills${e?`?project=${encodeURIComponent(e)}`:``}`),setSkillDefaults:e=>L(`POST`,`/api/skill-defaults`,e),setMacros:e=>L(`POST`,`/api/macros`,{macros:e}),profiles:()=>L(`GET`,`/api/profiles`),claudeCode:()=>L(`GET`,`/api/claude-code`),browseContainer:(e,t,n)=>L(`GET`,`/api/browse-container?${new URLSearchParams({container:e,user:t,path:n??``}).toString()}`),workflowCheck:(e,t,n)=>L(`GET`,`/api/workflow-check?${new URLSearchParams({path:e??``,config:t??``,workflow:n??``}).toString()}`),projectsFolder:()=>L(`GET`,`/api/projects-folder`),machine:()=>L(`GET`,`/api/machine`),setLimit:e=>L(`POST`,`/api/limit`,{limit:e}),setUsageStop:(e,t,n)=>L(`POST`,`/api/usage-stops`,{account:e,kind:t,percent:n}),liftUsageStop:(e,t)=>L(`POST`,`/api/usage-lift`,{account:e,kind:t}),away:(e,t)=>L(`POST`,`/api/away`,{until:e,allow:t}),back:()=>L(`DELETE`,`/api/away`),setPriority:(e,t)=>L(`POST`,`/api/sessions/${e}/priority`,{priority:t}),setPaused:(e,t)=>L(`POST`,`/api/sessions/${e}/pause`,{paused:t}),cancelClear:e=>L(`POST`,`/api/sessions/${e}/cancel-clear`,{}),startNow:e=>L(`POST`,`/api/sessions/${e}/start-now`,{}),turns:e=>L(`GET`,`/api/sessions/${e}/turns`),board:()=>L(`GET`,`/api/board`),boardThreads:()=>L(`GET`,`/api/board-threads`),boardThread:(e,t)=>L(`GET`,`/api/board-thread?${new URLSearchParams({repo:e,id:t}).toString()}`),boardPeople:e=>L(`GET`,`/api/board-projects/${encodeURIComponent(e)}/people`),boardRepos:(e,t=!1)=>L(`GET`,`/api/board-projects/${encodeURIComponent(e)}/repos${t?`?refresh=1`:``}`),boardOwners:()=>L(`GET`,`/api/board-owners`),usagePublish:()=>L(`GET`,`/api/usage-publish`),setUsagePublish:(e,t,n)=>L(`POST`,`/api/usage-publish`,{enabled:e,repo:t,...n}),usagePublishRepos:(e=!1)=>L(`GET`,`/api/usage-publish-repos${e?`?refresh=1`:``}`),revealUsageKey:()=>L(`POST`,`/api/usage-key-reveal`,{}),setUsageKey:e=>L(`POST`,`/api/usage-key`,{key:e}),takeLinkedUsageKey:()=>L(`POST`,`/api/usage-key`,{fromLinked:!0}),sharedUsage:(e=!1)=>L(`GET`,`/api/usage-shared${e?`?fresh=1`:``}`),removeSharedUsage:e=>L(`POST`,`/api/usage-shared-remove`,{id:e,confirm:!0}),createBoardRepo:(e,t)=>L(`POST`,`/api/board-repos`,{owner:e,name:t,confirm:!0}),setBoardProject:(e,t)=>L(`POST`,`/api/board-projects/${encodeURIComponent(e)}`,t),typicalCosts:(e=30)=>L(`GET`,`/api/typical-costs?days=${e}`),links:()=>L(`GET`,`/api/links`),linkCode:()=>L(`POST`,`/api/links-code`,{}),joinLink:(e,t)=>L(`POST`,`/api/links-join`,{code:e,name:t}),unlink:e=>L(`POST`,`/api/links/${encodeURIComponent(e)}/remove`,{}),linkDevicePair:e=>L(`POST`,`/api/link-device-pair`,{id:e}),dismissLinkPairing:e=>L(`POST`,`/api/link-pairings/${encodeURIComponent(e)}/dismiss`,{}),devices:()=>L(`GET`,`/api/devices`),pairDevice:(e=`phone`)=>L(`POST`,`/api/devices-pair`,{kind:e}),revokeDevice:e=>L(`POST`,`/api/devices/${encodeURIComponent(e)}/revoke`,{}),thisDevice:()=>L(`GET`,`/api/device`),unlockDevice:()=>L(`POST`,`/api/device-unlock`,{}),passkeyEnrolLink:()=>L(`POST`,`/api/passkey-enrol-link`,{}),logOutDevice:()=>L(`POST`,`/api/device-logout`,{}),pushState:()=>L(`GET`,`/api/push`),pushOn:e=>L(`POST`,`/api/push`,{subscription:e}),pushOff:()=>L(`POST`,`/api/push-off`,{}),renameDevice:e=>L(`POST`,`/api/device-name`,{name:e}),addPasskey:async()=>{let e=await L(`POST`,`/api/passkey-options`,{});return L(`POST`,`/api/passkey`,{response:await ve().create(e)})}};function Fe(e){return e===`open`?{className:`conn-up`,text:`Connected to Ledung.`}:{className:`conn-down`,text:e===`connecting`?`Connecting to Ledung…`:`Disconnected from Ledung, retrying…`}}function Ie(e,t=Date.now()){if(!e?.configured)return null;let n=e.boards.filter(e=>e.state!==`off`),r=Object.values(e.unread).reduce((e,t)=>e+t,0),i=Object.values(e.projects).reduce((e,t)=>e+t.ignored.reduce((e,t)=>e+t.count,0),0),a=e.boards.reduce((e,t)=>e+t.paused.length,0),o=[r?`${r} unread`:``,i?`${i} ignored`:``,a?`${a} paused`:``].filter(Boolean),s=o.length?` · ${o.join(` · `)}`:``,c=n.map(e=>e.repo).join(`, `),l=n.filter(e=>e.state===`error`),u=e.boards.find(e=>e.state===`off`&&e.error);if(!n.length)return{text:`Board off`,level:`idle`,title:u?.error??`No project has the board on.`};if(l.length)return{text:`Board: problem${s}`,level:`warn`,title:`${l.map(e=>`${e.repo}: ${e.error??`the last check failed.`}`).join(` `)} Trying again.`};if(n.some(e=>e.state===`starting`))return{text:`Board starting…`,level:`idle`,title:`Connecting to ${c}.`};let d=Math.min(...n.map(e=>e.lastPollAt??0)),f=d?`last checked ${Math.max(0,Math.round((t-d)/1e3))} s ago`:`not checked yet`;return{text:`Board${s}`,level:`ok`,title:`${c}${e.identity?` as @${e.identity}`:``}; ${f}.`}}var Le=`
19
-
20
- ---
21
-
22
- `,Re=/^Board message in thread (\S+) "(.*)", (posted by this Ledung[^\n]*?|from \S+ user [^\n]*?|typed on \S+ by [^\n]*?)\. To: ([^\n]*?)\.\n\n(`{3,})\n/;function ze(e){let t=/^posted by this Ledung(?: \(project "(.*?)"\))? as @(\S+)$/.exec(e);return t?{kind:`out`,service:``,author:t[2],project:t[1]??null}:(t=/^from (\S+) user @(\S+?)'s Ledung(?: \(project "(.*?)", as its header says\))?;/.exec(e),t?{kind:`ledung`,service:t[1],author:t[2],project:t[3]??null}:(t=/^typed on (\S+) by @(\S+?), not through/.exec(e),t?{kind:`typed`,service:t[1],author:t[2],project:null}:null))}function Be(e){let t=Re.exec(e);if(!t)return null;let n=ze(t[3]);if(!n)return null;let r=t[5],i=e.slice(t[0].length),a=i.indexOf(`\n${r}`);if(a<0)return null;let o=i.slice(a+1+r.length);return o&&!o.startsWith(`
23
- `)?null:{...n,threadId:t[1],title:t[2],to:t[4],text:i.slice(0,a),note:o.trim()}}function Ve(e){let t=[],n=[],r=()=>{n.length&&t.push({type:`text`,text:n.join(Le)}),n.length=0},i=0;for(;i<=e.length;){let a=e.slice(i),o=Ge(a);if(o){if(r(),t.push({type:`board`,mark:o.mark}),i+=o.length,i>=e.length)break;i+=7;continue}let s=a.indexOf(Le);if(n.push(s<0?a:a.slice(0,s)),s<0)break;i+=s+7}return r(),t}function He(e,t,n,r){if(!e||t)return null;let i=Ve(n??``);return r?i:i.filter(e=>e.type===`board`||e.text.split(Le).some(We))}var Ue=/^(?:.*\. )?(?:Your task, from your manager|Message from your manager)(?: ".*")?:$/,We=e=>Ue.test(e.split(`
24
- `,1)[0]);function Ge(e){let t=Re.exec(e);if(!t)return null;let n=t[5],r=t[0].length,i=e.indexOf(`\n${n}`,r);if(i<0)return null;let a=i+1+n.length,o=e.indexOf(Le,a),s=o<0?e.length:o,c=Be(e.slice(0,s));return c?{mark:c,length:s}:null}var Ke=e=>/(^|__)board_post$/.test(e);function qe(e){let t=t=>typeof e[t]==`string`?e[t]:``;return{to:Array.isArray(e.to)?e.to.map(String).join(`, `):t(`to`),title:t(`title`),text:t(`text`),threadId:t(`thread`)}}function Je(e,t){return t.toLowerCase().split(/\s+/).filter(Boolean).every(t=>e.toLowerCase().includes(t))}function Ye(e,t){if(!e)return{used:[],others:[],hidden:0};let n=new Map(e.repos.map(e=>[e.repo.toLowerCase(),e.private])),r=e.used.filter(e=>Je(e.repo,t)).map(e=>({repo:e.repo,private:n.get(e.repo.toLowerCase())??null,projects:e.projects})),i=new Set(e.used.map(e=>e.repo.toLowerCase())),a=e.repos.filter(e=>!i.has(e.repo.toLowerCase())&&Je(e.repo,t)).map(e=>({repo:e.repo,private:e.private,projects:[]}));return{used:r,others:a.slice(0,60),hidden:Math.max(0,a.length-60)}}function Xe(e){return`${e.trim().toLowerCase().replace(/[^a-z0-9_.-]+/g,`-`).replace(/^[-.]+|[-.]+$/g,``).replace(/-{2,}/g,`-`)||`ledung`}-board`.slice(0,100)}var Ze=`ledung.autocorrect`;function Qe(e){try{return e.getItem(Ze)===`1`}catch{return!1}}function $e(e,t){try{t?e.setItem(Ze,`1`):e.removeItem(Ze)}catch{}}var et={autoCorrect:`off`},tt={};function nt(e){return e?tt:et}var rt=new Set,it=Qe(localStorage),at=e=>{it=e;for(let e of rt)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.autocorrect`||e.key===null)&&at(Qe(localStorage))});var ot=e=>(rt.add(e),()=>{rt.delete(e)}),st=()=>it;function ct(){return[(0,v.useSyncExternalStore)(ot,st),e=>{$e(localStorage,e),at(e)}]}function z(){return nt((0,v.useSyncExternalStore)(ot,st))}var lt=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})),B=o(((e,t)=>{t.exports=lt()}))();function ut({board:e,open:t,connection:n,onClick:r}){let i=Ie(e);return i?(0,B.jsx)(`button`,{className:`board-chip ${i.level}${n?` ${n.className}`:``}${t?` on`:``}`,title:`${n?`${n.text} `:``}${i.text} — ${i.title}`,"aria-pressed":t,onClick:r,children:i.text}):null}var dt=e=>{if(!e)return`not yet`;let t=Math.max(0,Math.round((Date.now()-e)/1e3));return t<90?`${t} s ago`:`${Math.round(t/60)} min ago`},ft=e=>e.trim().replace(/^@/,``),pt=(e,t)=>e.toLowerCase()===t.toLowerCase(),mt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,ht=e=>e.state===`ok`?`On`:e.state===`starting`?`Starting`:e.state===`error`?`Problem`:`Off`;function gt({board:e}){return e?.configured?(0,B.jsxs)(`section`,{className:`board-settings`,children:[(0,B.jsx)(`h3`,{children:`Message board`}),(0,B.jsxs)(`p`,{className:`muted`,children:[e.identity?(0,B.jsxs)(B.Fragment,{children:[`Every board posts as `,(0,B.jsxs)(`strong`,{children:[`@`,e.identity]}),`, the GitHub login of this computer (`,(0,B.jsx)(`span`,{className:`mono`,children:`gh`}),`).`]}):(0,B.jsxs)(B.Fragment,{children:[`Boards post as this computer's GitHub login (`,(0,B.jsx)(`span`,{className:`mono`,children:`gh`}),`).`]}),` `,`Each project chooses its board and who may post to its manager in its own settings.`]}),e.boards.map(t=>(0,B.jsx)(_t,{repo:t,board:e},t.repo))]}):(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Message board`}),(0,B.jsx)(`p`,{className:`muted`,children:`Managers can talk to managers in other people's Ledungs through a shared board (a GitHub repository). No project uses one yet: each project chooses its board, who may post to it and its channels in its own settings, under Message board.`})]})}function _t({repo:e,board:t}){let n=e.state===`ok`?`ok`:e.state===`error`?`warn`:`idle`;return(0,B.jsxs)(`div`,{className:`board-block`,children:[(0,B.jsxs)(`p`,{className:`board-state`,children:[(0,B.jsx)(`span`,{className:`board-dot ${n}`,"aria-hidden":`true`}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`span`,{className:`mono`,children:e.repo}),` · `,ht(e),e.state===`ok`||e.state===`error`?(0,B.jsxs)(B.Fragment,{children:[` · checked `,dt(e.lastPollAt)]}):null]})]}),e.error&&(0,B.jsx)(`p`,{className:`board-error`,children:e.error}),(0,B.jsxs)(`p`,{className:`muted`,children:[`Projects: `,e.projects.map((n,r)=>(0,B.jsxs)(`span`,{children:[r?`, `:``,n,t.projects[n]?.enabled?``:` (off)`,e.frontDesk===n?` (front desk)`:``]},n)),e.frontDesk?null:(0,B.jsxs)(B.Fragment,{children:[` · no front desk: posts to just @`,t.identity??`you`,` reach nobody`]})]}),(e.ignored.length>0||e.quiet>0||e.paused.length>0)&&(0,B.jsxs)(`ul`,{className:`board-counts`,children:[e.ignored.map(e=>(0,B.jsxs)(`li`,{children:[e.count,` post`,e.count===1?``:`s`,` from `,(0,B.jsxs)(`strong`,{children:[`@`,e.login]}),` ignored: no project here allows them (last `,dt(e.lastAt),`).`]},e.login)),e.quiet>0&&(0,B.jsxs)(`li`,{children:[e.quiet,` post`,e.quiet===1?``:`s`,` in the last day reached no manager (no front desk, or the project's board is off).`]}),e.paused.map(e=>(0,B.jsxs)(`li`,{children:[`Thread `,e.threadId,` no longer wakes `,e.project,` until `,new Date(e.until).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),` (too many wakes in an hour).`]},`${e.project}/${e.threadId}`))]})]})}var vt=(e,t)=>{let n=e?.projects[t],r=n?.repo??``;return{enabled:n?.enabled??!1,repo:r,allow:n?.allow??[],channels:(n?.channels??[]).join(` `),frontDesk:!!r&&e?.boards.find(e=>e.repo===r)?.frontDesk===t}},yt=e=>e.split(/[\s,]+/).filter(Boolean).map(e=>e.replace(/^#/,``).toLowerCase()).join(` `);function bt(e,t){let n=e.repo.trim();return[e.enabled!==t.enabled,n!==t.repo,e.frontDesk!==t.frontDesk,yt(e.channels)!==yt(t.channels),e.allow.length!==t.allow.length||e.allow.some(e=>!t.allow.some(t=>pt(t,e)))].filter(Boolean).length}function xt(e){let t=e.repo.trim();return t&&!mt.test(t)?`The board repository is owner/name.`:e.enabled&&!t?`Name the board repository to turn the board on.`:null}function St(e,t){let n=t.repo.trim();return R.setBoardProject(e,{enabled:t.enabled,repo:n||null,allow:t.allow,channels:t.channels.split(/[\s,]+/).filter(Boolean),frontDesk:t.frontDesk&&!!n})}function Ct({board:e,project:t,projects:n,form:r,onChange:i}){let a=z(),o=vt(e,t),s=e=>i({...r,...e}),c=r.repo.trim(),l=!c||mt.test(c),u=n.map(e=>e.name).filter(n=>n!==t&&e?.projects[n]?.repo),d=e?.boards.find(e=>e.repo===c),f=(d?.projects??[]).filter(e=>e!==t),p=d?.frontDesk??null,m=e?.projects[t]?.ignored??[],h=t=>{let n=e?.projects[t];n&&s({repo:n.repo??``,allow:[...n.allow],channels:n.channels.join(` `),frontDesk:(n.repo??``)===r.repo.trim()&&r.frontDesk})};return(0,B.jsxs)(`div`,{className:`board-settings`,children:[(0,B.jsx)(`p`,{className:`muted`,children:`Lets this project's manager read and post to managers in other people's Ledungs, on a board (a GitHub repository) and only with the people you allow here. Off by default.`}),(0,B.jsxs)(`label`,{className:`toggle`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:r.enabled,onChange:e=>s({enabled:e.target.checked})}),` Use the board in this project`]}),u.length>0&&(0,B.jsxs)(`label`,{className:`board-channels`,children:[`Copy from another project`,(0,B.jsxs)(`select`,{"aria-label":`Copy the board settings from`,value:``,onChange:e=>h(e.target.value),children:[(0,B.jsx)(`option`,{value:``,children:`Choose a project…`}),u.map(t=>(0,B.jsxs)(`option`,{value:t,children:[t,` (`,e.projects[t].repo,`)`]},t))]})]}),(0,B.jsx)(wt,{project:t,value:r.repo,ok:l,onChange:e=>s({repo:e})}),c&&l&&(0,B.jsxs)(`div`,{className:`board-warning`,children:[(0,B.jsxs)(`strong`,{children:[`Everyone with access to `,c,` can read every post on it`]}),`, whichever project or Ledung wrote it. The list below only decides who can reach this project's manager, not who can read. A sensitive project should have a board repository of its own.`,` `,(0,B.jsx)(`strong`,{children:`Files attached to posts`}),` (screenshots, logs) can be read and copied by the same people; Ledung asks you before any leaves. Pruning takes them off the board's branch after their thread closes, but can't take back a copy someone made, and unreachable commits and cached views of them can remain on GitHub until GitHub Support removes them.`,f.length>0&&(0,B.jsxs)(B.Fragment,{children:[` Also on this board here: `,f.join(`, `),`.`]})]}),c&&l&&(0,B.jsx)(Dt,{project:t,savedRepo:o.repo,repo:c,allow:r.allow,active:d?.state===`ok`,onChange:e=>s({allow:e})}),m.length>0&&(0,B.jsx)(`ul`,{className:`board-counts`,children:m.map(e=>(0,B.jsxs)(`li`,{children:[e.count,` post`,e.count===1?``:`s`,` to this project ignored from `,(0,B.jsxs)(`strong`,{children:[`@`,e.login]}),`, who isn't on its list (last `,dt(e.lastAt),`).`,` `,!r.allow.some(t=>pt(t,e.login))&&(0,B.jsxs)(`button`,{className:`small`,onClick:()=>s({allow:[...r.allow,e.login]}),children:[`Allow @`,e.login]})]},e.login))}),(0,B.jsxs)(`label`,{className:`toggle`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:r.frontDesk,disabled:!c||!l,onChange:e=>s({frontDesk:e.target.checked})}),` `,(0,B.jsxs)(`span`,{children:[`Front desk on this board: gets posts addressed to just `,(0,B.jsxs)(`span`,{className:`mono`,children:[`@`,e?.identity??`you`]})]})]}),p&&p!==t&&r.frontDesk&&(0,B.jsxs)(`p`,{className:`muted`,children:[p,` is the front desk now; saving moves it here.`]}),p&&p!==t&&!r.frontDesk&&(0,B.jsxs)(`p`,{className:`muted`,children:[`The front desk on this board is `,p,`.`]}),(0,B.jsxs)(`label`,{className:`board-channels`,children:[`Channels it follows`,(0,B.jsx)(`input`,{...a,value:r.channels,disabled:!r.enabled,placeholder:`#ledung #ops`,onChange:e=>s({channels:e.target.value})})]}),(0,B.jsx)(`p`,{className:`muted`,children:`A channel's posts wake nobody; the manager reads them when it looks. A running manager gets the board's tools at its next start or resume.`}),r.enabled&&!c&&(0,B.jsx)(`p`,{className:`muted`,children:`Name the board repository to turn it on.`})]})}function wt({project:e,value:t,ok:n,onChange:r,load:i,label:a=`Board repository`,newName:o}){let s=z(),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(!1),x=y?t:``,S=(0,v.useCallback)(t=>{h(!0),_(null),(i??(t=>R.boardRepos(e,t)))(t).then(p,e=>_(e.message)).finally(()=>h(!1))},[e,i]);(0,v.useEffect)(()=>{p(null),l(!1),d(!1)},[e]);let C=()=>{l(!0),!f&&!m&&S(!1)},w=e=>{r(e),b(!1),l(!1),d(!1)},T=Ye(f,x),E=x.trim(),D=mt.test(E)&&!T.used.some(e=>e.repo.toLowerCase()===E.toLowerCase())&&!T.others.some(e=>e.repo.toLowerCase()===E.toLowerCase());return(0,B.jsxs)(`div`,{className:`repo-picker`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(l(!1),b(!1))},onKeyDown:e=>{e.key===`Escape`&&l(!1)},children:[(0,B.jsxs)(`label`,{className:`board-channels`,children:[a,(0,B.jsx)(`input`,{...s,className:`mono`,value:t,placeholder:`Choose, search or type owner/name`,"aria-invalid":!n,"aria-expanded":c,role:`combobox`,"aria-controls":`repo-picker-list`,autoComplete:`off`,spellCheck:!1,onFocus:C,onClick:C,onChange:e=>{l(!0),b(!0),r(e.target.value),!f&&!m&&S(!1)},onKeyDown:e=>{if(e.key===`Enter`&&c){e.preventDefault();let t=T.used[0]??T.others[0];D?w(E):t?w(t.repo):l(!1)}}})]}),c&&!u&&(0,B.jsxs)(`div`,{className:`repo-list`,id:`repo-picker-list`,role:`listbox`,children:[(0,B.jsxs)(`div`,{className:`board-block-head`,children:[(0,B.jsx)(`span`,{className:`muted`,children:m?`Reading your repositories…`:f?`${f.repos.length}${f.truncated?`+`:``} repositories you can reach`:``}),(0,B.jsx)(`button`,{type:`button`,className:`small`,disabled:m,onClick:()=>S(!0),title:`Read the list from GitHub again`,children:`Refresh`})]}),g&&(0,B.jsx)(`p`,{className:`board-error`,children:g}),f?.error&&(0,B.jsxs)(`p`,{className:`board-error`,children:[f.error,` You can still type owner/name.`]}),T.used.length>0&&(0,B.jsx)(`p`,{className:`repo-head`,children:`Boards your other projects use`}),T.used.map(e=>(0,B.jsx)(Tt,{row:e,onPick:w},`u${e.repo}`)),T.others.length>0&&(0,B.jsx)(`p`,{className:`repo-head`,children:`Your GitHub repositories`}),T.others.map(e=>(0,B.jsx)(Tt,{row:e,onPick:w},e.repo)),T.hidden>0&&(0,B.jsxs)(`p`,{className:`muted`,children:[T.hidden,` more: type to narrow the list.`]}),D&&(0,B.jsxs)(`button`,{type:`button`,role:`option`,className:`repo-row`,onClick:()=>w(E),children:[(0,B.jsxs)(`span`,{className:`mono`,children:[`Use `,E]}),(0,B.jsx)(`span`,{className:`muted`,children:` (typed; checked when you save)`})]}),f&&!f.error&&!T.used.length&&!T.others.length&&!D&&(0,B.jsx)(`p`,{className:`muted`,children:`Nothing matches. Type the whole name as owner/name to use a repository that isn't listed.`}),(0,B.jsxs)(`button`,{type:`button`,className:`small repo-create`,onClick:()=>d(!0),children:[`Create a new private `,o?``:`board `,`repo…`]})]}),!n&&!c&&(0,B.jsx)(`p`,{className:`board-error`,children:`Write the repository as owner/name.`}),c&&u&&(0,B.jsx)(Et,{project:e,name:o,onCancel:()=>d(!1),onCreated:w})]})}function Tt({row:e,onPick:t}){return(0,B.jsxs)(`button`,{type:`button`,role:`option`,className:`repo-row`,onClick:()=>t(e.repo),children:[(0,B.jsx)(`span`,{className:`mono repo-name`,children:e.repo}),e.private!==null&&(0,B.jsx)(`span`,{className:`chip ${e.private?``:`warn`}`,children:e.private?`private`:`public`}),e.projects.length>0&&(0,B.jsxs)(`span`,{className:`muted`,children:[` used by `,e.projects.join(`, `)]})]})}function Et({project:e,name:t,onCancel:n,onCreated:r}){let i=z(),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(()=>t??Xe(e)),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(!1);(0,v.useEffect)(()=>{R.boardOwners().then(e=>{o(e.owners),c(e.owners[0]?.login??``)},e=>f(e.message))},[]);let h=/^[A-Za-z0-9_.-]{1,100}$/.test(l)&&l!==`.`&&l!==`..`,g=async()=>{m(!0),f(null);try{r((await R.createBoardRepo(s,l)).repo)}catch(e){f(e.message),m(!1)}};return(0,B.jsxs)(`div`,{className:`repo-list repo-create-form`,role:`dialog`,"aria-label":`Create a new private ${t?``:`board `}repository`,children:[(0,B.jsxs)(`h4`,{children:[`Create a new private `,t?``:`board `,`repository`]}),(0,B.jsxs)(`p`,{className:`muted`,children:[`This creates a new `,(0,B.jsx)(`strong`,{children:`private`}),` repository on GitHub, as your `,(0,B.jsx)(`span`,{className:`mono`,children:`gh`}),` login. Only you can see it until you add people on GitHub.`]}),(0,B.jsxs)(`label`,{className:`board-channels`,children:[`Owner`,(0,B.jsxs)(`select`,{value:s,disabled:!a||p,onChange:e=>c(e.target.value),children:[!a&&(0,B.jsx)(`option`,{children:`Reading your accounts…`}),(a??[]).map(e=>(0,B.jsxs)(`option`,{value:e.login,children:[e.login,e.kind===`user`?` (you)`:` (organisation)`]},e.login))]})]}),(0,B.jsxs)(`label`,{className:`board-channels`,children:[`Name`,(0,B.jsx)(`input`,{...i,className:`mono`,value:l,disabled:p,"aria-invalid":!h,onChange:e=>u(e.target.value.trim())})]}),!h&&(0,B.jsx)(`p`,{className:`board-error`,children:`Use letters, digits, - _ and . only.`}),d&&(0,B.jsx)(`p`,{className:`board-error`,children:d}),(0,B.jsxs)(`div`,{className:`board-add`,children:[(0,B.jsx)(`button`,{type:`button`,disabled:p||!s||!h,onClick:()=>void g(),children:p?`Creating…`:`Confirm: create ${s}/${l}`}),(0,B.jsx)(`button`,{type:`button`,disabled:p,onClick:n,children:`Cancel`})]})]})}function Dt({project:e,savedRepo:t,repo:n,allow:r,active:i,onChange:a}){let o=z(),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(``),h=!!t&&t===n,g=(0,v.useCallback)(()=>{u(!0),f(null),R.boardPeople(e).then(c,e=>f(e.message)).finally(()=>u(!1))},[e]);(0,v.useEffect)(()=>{c(null),h&&g()},[h,t,i,g]);let _=e=>r.some(t=>pt(t,e)),y=e=>a(_(e)?r.filter(t=>!pt(t,e)):[...r,e]),b=new Set((s?.lostAccess??[]).map(e=>e.toLowerCase())),x=new Set((s?.people??[]).map(e=>e.id.toLowerCase())),S=r.filter(e=>!x.has(e.toLowerCase())),C=()=>{let e=ft(p);e&&(m(``),_(e)||a([...r,e]))};return(0,B.jsxs)(`div`,{className:`board-block`,children:[(0,B.jsxs)(`div`,{className:`board-block-head`,children:[(0,B.jsx)(`h4`,{children:`Who may post to this project's manager`}),(0,B.jsx)(`button`,{className:`small`,disabled:l||!h,onClick:g,title:`Read the list of people with access to the board again`,children:l?`Reading…`:`Refresh`})]}),d&&(0,B.jsx)(`p`,{className:`board-error`,children:d}),!h&&(0,B.jsxs)(`p`,{className:`muted`,children:[`Save to see who has access to `,n,`.`]}),s?.note&&(0,B.jsx)(`p`,{className:`muted`,children:s.note}),s&&s.source!==`none`&&(0,B.jsxs)(`p`,{className:`muted`,children:[s.source===`collaborators`?`People with access to ${n}: they can all read its posts.`:`Members of ${n.split(`/`)[0]}: people with access to ${n} can read its posts.`,` Having access doesn't let anyone reach this manager: tick the people you trust.`]}),(0,B.jsxs)(`ul`,{className:`board-people`,children:[(s?.people??[]).map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`label`,{className:`toggle`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:_(e.id),onChange:()=>y(e.id)}),e.avatarUrl?(0,B.jsx)(`img`,{className:`avatar`,src:e.avatarUrl,alt:``,width:28,height:28,loading:`lazy`}):(0,B.jsx)(`span`,{className:`avatar blank`,"aria-hidden":`true`}),(0,B.jsxs)(`span`,{className:`person`,children:[(0,B.jsx)(`span`,{children:e.name??e.id}),e.name&&(0,B.jsxs)(`span`,{className:`muted`,children:[` @`,e.id]})]}),b.has(e.id.toLowerCase())&&(0,B.jsx)(`span`,{className:`chip warn`,title:`On the list, but no longer has access to the board repository`,children:`lost access`})]})},e.id)),S.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`label`,{className:`toggle`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:!0,onChange:()=>y(e)}),(0,B.jsx)(`span`,{className:`avatar blank`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`person`,children:(0,B.jsxs)(`span`,{children:[`@`,e]})}),s?.source===`collaborators`&&(0,B.jsx)(`span`,{className:`chip warn`,title:`On the list, but not among the people with access to the board repository`,children:`lost access`})]})},e)),h&&s&&!s.people.length&&!S.length&&(0,B.jsx)(`li`,{className:`muted`,children:`No one is listed. Type a login below.`})]}),(0,B.jsxs)(`div`,{className:`board-add`,children:[(0,B.jsx)(`input`,{...o,value:p,placeholder:`GitHub login, e.g. magto`,"aria-label":`GitHub login to allow`,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Enter`&&C()}}),(0,B.jsx)(`button`,{className:`small`,disabled:!ft(p),onClick:C,children:`Allow`})]})]})}var Ot={out:`Post from this manager`,ledung:`Board message`,typed:`Typed on the board`};function kt({mark:e,time:t,onOpenThread:n}){let r=e.kind===`out`?(0,B.jsxs)(B.Fragment,{children:[`to `,e.to]}):e.kind===`ledung`?(0,B.jsxs)(B.Fragment,{children:[`from `,(0,B.jsxs)(`strong`,{children:[`@`,e.author]}),`'s Ledung`,e.project?` (project ${e.project})`:``]}):(0,B.jsxs)(B.Fragment,{children:[`typed on `,e.service||`the board`,` by `,(0,B.jsxs)(`strong`,{children:[`@`,e.author]})]});return(0,B.jsxs)(`div`,{className:`msg board-post ${e.kind}`,children:[(0,B.jsxs)(`div`,{className:`msg-meta`,children:[(0,B.jsx)(`span`,{className:`who`,children:Ot[e.kind]}),(0,B.jsx)(`span`,{className:`board-from`,children:r}),t]}),(0,B.jsxs)(`div`,{className:`board-thread`,children:[`Thread `,e.threadId?`#${e.threadId} `:``,e.title&&(0,B.jsxs)(B.Fragment,{children:[`“`,e.title,`”`]}),n&&e.threadId&&(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(`button`,{className:`link`,onClick:()=>n(e.threadId),children:`Open in Board`})]}),e.kind!==`out`&&e.to&&(0,B.jsxs)(`span`,{className:`muted`,children:[` · to `,e.to]})]}),(0,B.jsx)(`div`,{className:`msg-body plain`,children:e.text}),(0,B.jsx)(`div`,{className:`muted board-trust`,children:e.kind===`out`?`Sent from this Ledung.`:e.kind===`ledung`?`Sender verified by the board service; not from you. A post can't approve anything.`:`Sender verified by the board service. Typed by that person, not through a Ledung; not from you.`})]})}function At(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var jt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Mt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nt={};function Pt(e,t){return((t||Nt).jsx?Mt:jt).test(e)}var Ft=/[ \t\n\f\r]/g;function It(e){return typeof e==`object`?e.type===`text`&&Lt(e.value):Lt(e)}function Lt(e){return e.replace(Ft,``)===``}var Rt=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Rt.prototype.normal={},Rt.prototype.property={},Rt.prototype.space=void 0;function zt(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Rt(n,r,t)}function Bt(e){return e.toLowerCase()}var Vt=class{constructor(e,t){this.attribute=t,this.property=e}};Vt.prototype.attribute=``,Vt.prototype.booleanish=!1,Vt.prototype.boolean=!1,Vt.prototype.commaOrSpaceSeparated=!1,Vt.prototype.commaSeparated=!1,Vt.prototype.defined=!1,Vt.prototype.mustUseProperty=!1,Vt.prototype.number=!1,Vt.prototype.overloadedBoolean=!1,Vt.prototype.property=``,Vt.prototype.spaceSeparated=!1,Vt.prototype.space=void 0;var Ht=s({boolean:()=>V,booleanish:()=>Wt,commaOrSpaceSeparated:()=>qt,commaSeparated:()=>Kt,number:()=>H,overloadedBoolean:()=>Gt,spaceSeparated:()=>U}),Ut=0,V=Jt(),Wt=Jt(),Gt=Jt(),H=Jt(),U=Jt(),Kt=Jt(),qt=Jt();function Jt(){return 2**++Ut}var Yt=Object.keys(Ht),Xt=class extends Vt{constructor(e,t,n,r){let i=-1;if(super(e,t),Zt(this,`space`,r),typeof n==`number`)for(;++i<Yt.length;){let e=Yt[i];Zt(this,Yt[i],(n&Ht[e])===Ht[e])}}};Xt.prototype.defined=!0;function Zt(e,t,n){n&&(e[t]=n)}function Qt(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Xt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Bt(r)]=r,n[Bt(a.attribute)]=r}return new Rt(t,n,e.space)}var $t=Qt({properties:{ariaActiveDescendant:null,ariaAtomic:Wt,ariaAutoComplete:null,ariaBusy:Wt,ariaChecked:Wt,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:U,ariaCurrent:null,ariaDescribedBy:U,ariaDetails:null,ariaDisabled:Wt,ariaDropEffect:U,ariaErrorMessage:null,ariaExpanded:Wt,ariaFlowTo:U,ariaGrabbed:Wt,ariaHasPopup:null,ariaHidden:Wt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:U,ariaLevel:H,ariaLive:null,ariaModal:Wt,ariaMultiLine:Wt,ariaMultiSelectable:Wt,ariaOrientation:null,ariaOwns:U,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:Wt,ariaReadOnly:Wt,ariaRelevant:null,ariaRequired:Wt,ariaRoleDescription:U,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:Wt,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function en(e,t){return t in e?e[t]:t}function tn(e,t){return en(e,t.toLowerCase())}var nn=Qt({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Kt,acceptCharset:U,accessKey:U,action:null,allow:null,allowFullScreen:V,allowPaymentRequest:V,allowUserMedia:V,alpha:V,alt:null,as:null,async:V,autoCapitalize:null,autoComplete:U,autoFocus:V,autoPlay:V,blocking:U,capture:null,charSet:null,checked:V,cite:null,className:U,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:Wt,controls:V,controlsList:U,coords:H|Kt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:V,defer:V,dir:null,dirName:null,disabled:V,download:Gt,draggable:Wt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:V,formTarget:null,headers:U,height:H,hidden:Gt,high:H,href:null,hrefLang:null,htmlFor:U,httpEquiv:U,id:null,imageSizes:null,imageSrcSet:null,inert:V,inputMode:null,integrity:null,is:null,isMap:V,itemId:null,itemProp:U,itemRef:U,itemScope:V,itemType:U,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:V,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:V,muted:V,name:null,nonce:null,noModule:V,noValidate:V,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:V,optimum:H,pattern:null,ping:U,placeholder:null,playsInline:V,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:V,referrerPolicy:null,rel:U,required:V,reversed:V,rows:H,rowSpan:H,sandbox:U,scope:null,scoped:V,seamless:V,selected:V,shadowRootClonable:V,shadowRootCustomElementRegistry:V,shadowRootDelegatesFocus:V,shadowRootMode:null,shadowRootSerializable:V,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:Wt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:V,useMap:null,value:Wt,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:U,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:V,declare:V,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:V,noHref:V,noShade:V,noWrap:V,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:Wt,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:V,disablePictureInPicture:V,disableRemotePlayback:V,exportParts:Kt,part:U,prefix:null,property:null,results:H,security:null,unselectable:null},space:`html`,transform:tn}),rn=Qt({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:qt,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:U,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:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:V,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,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:Kt,g2:Kt,glyphName:Kt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:qt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,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:H,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:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:U,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:qt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:qt,rev:qt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:qt,requiredFeatures:qt,requiredFonts:qt,requiredFormats:qt,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:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:qt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:qt,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:qt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:en}),an=Qt({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()}}),on=Qt({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:tn}),sn=Qt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),cn={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`},ln=/[A-Z]/g,un=/-[a-z]/g,dn=/^data[-\w.:]+$/i;function fn(e,t){let n=Bt(t),r=t,i=Vt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&dn.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(un,mn);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!un.test(e)){let n=e.replace(ln,pn);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Xt}return new i(r,t)}function pn(e){return`-`+e.toLowerCase()}function mn(e){return e.charAt(1).toUpperCase()}var hn=zt([$t,nn,an,on,sn],`html`),gn=zt([$t,rn,an,on,sn],`svg`);function _n(e){return e.join(` `).trim()}var vn=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
25
- `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),yn=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(vn());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),bn=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),xn=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(yn()),r=bn();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Sn=wn(`end`),Cn=wn(`start`);function wn(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 Tn(e){let t=Cn(e),n=Sn(e);if(t&&n)return{start:t,end:n}}function En(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?On(e.position):`start`in e||`end`in e?On(e):`line`in e||`column`in e?Dn(e):``}function Dn(e){return kn(e&&e.line)+`:`+kn(e&&e.column)}function On(e){return Dn(e&&e.start)+`-`+Dn(e&&e.end)}function kn(e){return e&&typeof e==`number`?e:1}var An=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=En(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}};An.prototype.file=``,An.prototype.name=``,An.prototype.reason=``,An.prototype.message=``,An.prototype.stack=``,An.prototype.column=void 0,An.prototype.line=void 0,An.prototype.ancestors=void 0,An.prototype.cause=void 0,An.prototype.fatal=void 0,An.prototype.place=void 0,An.prototype.ruleId=void 0,An.prototype.source=void 0;var jn=l(xn(),1),Mn={}.hasOwnProperty,Nn=new Map,Pn=/[A-Z]/g,Fn=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),In=new Set([`td`,`th`]),Ln=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Rn(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=Yn(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=Jn(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`?gn:hn,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=zn(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function zn(e,t,n){if(t.type===`element`)return Bn(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Vn(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Un(e,t,n);if(t.type===`mdxjsEsm`)return Hn(e,t);if(t.type===`root`)return Wn(e,t,n);if(t.type===`text`)return Gn(e,t)}function Bn(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=gn,e.schema=i),e.ancestors.push(t);let a=tr(e,t.tagName,!1),o=Xn(e,t),s=Qn(e,t);return Fn.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!It(e)})),Kn(e,o,a,t),qn(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Vn(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)}nr(e,t.position)}function Hn(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);nr(e,t.position)}function Un(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=gn,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:tr(e,t.name,!0),o=Zn(e,t),s=Qn(e,t);return Kn(e,o,a,t),qn(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Wn(e,t,n){let r={};return qn(r,Qn(e,t)),e.create(t,e.Fragment,r,n)}function Gn(e,t){return t.value}function Kn(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function qn(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Jn(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 Yn(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Cn(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 Xn(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Mn.call(t.properties,i)){let a=$n(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&In.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 Zn(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 nr(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else nr(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Qn(e,t){let n=[],r=-1,i=e.passKeys?new Map:Nn;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=zn(e,a,o);s!==void 0&&n.push(s)}return n}function $n(e,t,n){let r=fn(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?At(n):_n(n)),r.property===`style`){let t=typeof n==`object`?n:er(e,String(n));return e.stylePropertyNameCase===`css`&&(t=rr(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?cn[r.property]||r.property:r.attribute,n]}}function er(e,t){try{return(0,jn.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new An("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=Ln+`#cannot-parse-style-attribute`,r}}function tr(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=Pt(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=Pt(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Mn.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);nr(e)}function nr(e,t){let n=new An("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=Ln+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function rr(e){let t={},n;for(n in e)Mn.call(e,n)&&(t[ir(n)]=e[n]);return t}function ir(e){let t=e.replace(Pn,ar);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function ar(e){return`-`+e.toLowerCase()}var or={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`]},sr={};function cr(e,t){let n=t||sr;return lr(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function lr(e,t,n){if(dr(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 ur(e.children,t,n)}return Array.isArray(e)?ur(e,t,n):``}function ur(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=lr(e[i],t,n);return r.join(``)}function dr(e){return!!(e&&typeof e==`object`)}var fr=document.createElement(`i`);function pr(e){let t=`&`+e+`;`;fr.innerHTML=t;let n=fr.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function mr(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 hr(e,t){return e.length>0?(mr(e,e.length,0,t),e):t}var gr={}.hasOwnProperty;function _r(e){let t={},n=-1;for(;++n<e.length;)vr(t,e[n]);return t}function vr(e,t){let n;for(n in t){let r=(gr.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){gr.call(r,a)||(r[a]=[]);let e=i[a];yr(r[a],Array.isArray(e)?e:e?[e]:[])}}}function yr(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);mr(e,0,0,r)}function br(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 xr(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Sr=Mr(/[A-Za-z]/),Cr=Mr(/[\dA-Za-z]/),wr=Mr(/[#-'*+\--9=?A-Z^-~]/);function Tr(e){return e!==null&&(e<32||e===127)}var Er=Mr(/\d/),Dr=Mr(/[\dA-Fa-f]/),Or=Mr(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function kr(e){return e!==null&&(e<0||e===32)}function G(e){return e===-2||e===-1||e===32}var Ar=Mr(/\p{P}|\p{S}/u),jr=Mr(/\s/);function Mr(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Nr(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Cr(e.charCodeAt(n+1))&&Cr(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 K(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return G(r)?(e.enter(n),s(r)):t(r)}function s(r){return G(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function Pr(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&G(t)?(e.enter(r),c(t)):l(t)}function c(t){return G(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Fr={tokenize:Ir};function Ir(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`),K(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 W(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Lr=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Rr(this,e,t,n,!1)}addBefore(e,t,n){Rr(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 Rr(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 zr={tokenize:Vr},Br={tokenize:Hr};function Vr(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 Lr;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(Br,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(Br,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 W(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 Lr;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 Hr(e,t,n){return K(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Ur(e){if(e===null||kr(e)||jr(e))return 1;if(Ar(e))return 2}function Wr(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 Gr={name:`attention`,resolveAll:Kr,tokenize:qr};function Kr(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};Jr(o,-a),Jr(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=hr(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=hr(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=hr(r,Wr(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=hr(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=hr(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),mr(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 qr(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ur(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=Ur(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 Jr(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Yr={name:`autolink`,tokenize:Xr};function Xr(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 Sr(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Cr(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||Cr(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||Tr(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):wr(t)?(e.consume(t),l):n(t)}function u(e){return Cr(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||Cr(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Zr={partial:!0,tokenize:Qr};function Qr(e,t,n){return r;function r(t){return G(t)?K(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||W(e)?t(e):n(e)}}var $r={continuation:{tokenize:ti},exit:ni,name:`blockQuote`,tokenize:ei};function ei(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 G(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function ti(e,t,n){let r=this;return i;function i(t){return G(t)?K(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt($r,t,n)(r)}}function ni(e){e.exit(`blockQuote`)}var ri={name:`characterEscape`,tokenize:ii};function ii(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 Or(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var ai={name:`characterReference`,tokenize:oi};function oi(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=Cr,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=Dr,u):(e.enter(`characterReferenceValue`),a=7,o=Er,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Cr&&!pr(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 si={partial:!0,tokenize:ci};function ci(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 li={concrete:!0,name:`codeFenced`,tokenize:ui};function ui(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`),G(t)?K(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||W(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(si,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||W(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):G(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),K(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||W(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||W(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&&G(t)?K(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||W(t)?e.check(si,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||W(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`),G(t)?K(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`),G(t)?K(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||W(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var di={name:`codeIndented`,tokenize:pi},fi={partial:!0,tokenize:mi};function pi(e,t,n){return r;function r(t){return e.enter(`codeIndented`),Pr(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):W(t)?e.attempt(fi,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||W(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function mi(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):W(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):Pr(e,t,a,`linePrefix`,4,4)(o)}function a(e){return W(e)?i(e):n(e)}}var hi={name:`codeText`,previous:_i,resolve:gi,tokenize:vi};function gi(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 _i(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function vi(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)):W(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||W(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 yi=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&&bi(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),bi(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),bi(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);bi(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);bi(this.left,t.reverse())}}}};function bi(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 xi(e){let t={},n=-1,r,i,a,o,s,c,l,u=new yi(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,Si(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 mr(e,0,1/0,u.slice(0)),!l}function Si(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 Ci={resolve:Ti,tokenize:Ei},wi={partial:!0,tokenize:Di};function Ti(e){return xi(e),e}function Ei(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):W(t)?e.check(wi,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 Di(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),K(e,a,`linePrefix`)}function a(i){if(i===null||W(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 Oi(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||Tr(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||W(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||kr(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||Tr(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 ki(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):W(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||W(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!G(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Ai(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):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),K(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||W(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 ji(e,t){let n;return r;function r(i){return W(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):G(i)?K(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Mi={name:`definition`,tokenize:Pi},Ni={partial:!0,tokenize:Fi};function Pi(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return ki.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=xr(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 kr(t)?ji(e,l)(t):l(t)}function l(t){return Oi(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Ni,d,d)(t)}function d(t){return G(t)?K(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||W(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Fi(e,t,n){return r;function r(t){return kr(t)?ji(e,i)(t):n(t)}function i(t){return Ai(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return G(t)?K(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||W(e)?t(e):n(e)}}var Ii={name:`hardBreakEscape`,tokenize:Li};function Li(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return W(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Ri={name:`headingAtx`,resolve:zi,tokenize:Bi};function zi(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`};mr(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Bi(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||kr(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||W(n)?(e.exit(`atxHeading`),t(n)):G(n)?K(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||kr(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Vi=`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(`.`),Hi=[`pre`,`script`,`style`,`textarea`],Ui={concrete:!0,name:`htmlFlow`,resolveTo:Gi,tokenize:Ki},Wi={partial:!0,tokenize:qi};function Gi(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 Ki(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:P):Sr(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):Sr(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):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 Sr(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||kr(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Hi.includes(l)?(i=1,r.interrupt?t(s):O(s)):Vi.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||Cr(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 G(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Sr(t)?(e.consume(t),b):G(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Cr(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):G(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):G(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||W(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||kr(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||G(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||W(t)?O(t):G(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),ne):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),N):W(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Wi,re,k)(t)):t===null||W(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(si,ee,re)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),A}function A(t){return t===null||W(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),P):O(t)}function M(t){return t===47?(e.consume(t),o=``,te):O(t)}function te(t){if(t===62){let n=o.toLowerCase();return Hi.includes(n)?(e.consume(t),ne):O(t)}return Sr(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),te):O(t)}function N(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),ne):t===45&&i===2?(e.consume(t),P):O(t)}function ne(t){return t===null||W(t)?(e.exit(`htmlFlowData`),re(t)):(e.consume(t),ne)}function re(n){return e.exit(`htmlFlow`),t(n)}}function qi(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Zr,t,n)}}var Ji={name:`htmlText`,tokenize:Yi};function Yi(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):Sr(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):Sr(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):W(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(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):W(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):W(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):W(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return Sr(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Cr(t)?(e.consume(t),S):C(t)}function C(t){return W(t)?(o=C,M(t)):G(t)?(e.consume(t),C):j(t)}function w(t){return t===45||Cr(t)?(e.consume(t),w):t===47||t===62||kr(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||Sr(t)?(e.consume(t),E):W(t)?(o=T,M(t)):G(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||Cr(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):W(t)?(o=D,M(t)):G(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):W(t)?(o=O,M(t)):G(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,A):t===null?n(t):W(t)?(o=k,M(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||kr(t)?T(t):(e.consume(t),ee)}function A(e){return e===47||e===62||kr(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return G(t)?K(e,N,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):N(t)}function N(t){return e.enter(`htmlTextData`),o(t)}}var Xi={name:`labelEnd`,resolveAll:$i,resolveTo:ea,tokenize:ta},Zi={tokenize:na},q={tokenize:ra},Qi={tokenize:ia};function $i(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&&mr(e,0,e.length,n),e}function ea(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=hr(o,e.slice(i+1,i+r+3)),o=hr(o,[[`enter`,l,t]]),o=hr(o,Wr(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=hr(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=hr(o,e.slice(a+1)),o=hr(o,[[`exit`,s,t]]),mr(e,i,e.length,o),e}function ta(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(xr(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(Zi,u,o?u:d)(t):t===91?e.attempt(q,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Qi,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function na(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 kr(t)?ji(e,a)(t):a(t)}function a(t){return t===41?u(t):Oi(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return kr(t)?ji(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Ai(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return kr(t)?ji(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 ra(e,t,n){let r=this;return i;function i(t){return ki.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(xr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function ia(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 aa={name:`labelStartImage`,resolveAll:Xi.resolveAll,tokenize:oa};function oa(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 sa={name:`labelStartLink`,resolveAll:Xi.resolveAll,tokenize:ca};function ca(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 la={name:`lineEnding`,tokenize:ua};function ua(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),K(e,t,`linePrefix`)}}var da={name:`thematicBreak`,tokenize:fa};function fa(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||W(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),G(t)?K(e,s,`whitespace`)(t):s(t))}}var pa={continuation:{tokenize:_a},exit:ya,name:`list`,tokenize:ga},ma={partial:!0,tokenize:ba},ha={partial:!0,tokenize:va};function ga(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:Er(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(da,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 Er(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(Zr,r.interrupt?n:u,e.attempt(ma,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return G(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 _a(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Zr,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,K(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!G(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(ha,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,K(e,e.attempt(pa,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function va(e,t,n){let r=this;return K(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 ya(e){e.exit(this.containerState.type)}function ba(e,t,n){let r=this;return K(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!G(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var xa={name:`setextUnderline`,resolveTo:Sa,tokenize:Ca};function Sa(e,t){let n=new Lr,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 Ca(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`),G(t)?K(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||W(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var wa={tokenize:Ta};function Ta(e){let t=this,n=e.attempt(Zr,r,e.attempt(this.parser.constructs.flowInitial,i,K(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ci,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 Ea={resolveAll:Aa()},Da=ka(`string`),Oa=ka(`text`);function ka(e){return{resolveAll:Aa(e===`text`?ja: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 Aa(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 ja(e,t){let n=new Lr,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 Ma=s({attentionMarkers:()=>Ba,contentInitial:()=>Pa,disable:()=>Va,document:()=>Na,flow:()=>Ia,flowInitial:()=>Fa,insideSpan:()=>za,string:()=>La,text:()=>Ra}),Na={42:pa,43:pa,45:pa,48:pa,49:pa,50:pa,51:pa,52:pa,53:pa,54:pa,55:pa,56:pa,57:pa,62:$r},Pa={91:Mi},Fa={[-2]:di,[-1]:di,32:di},Ia={35:Ri,42:da,45:[xa,da],60:Ui,61:xa,95:da,96:li,126:li},La={38:ai,92:ri},Ra={[-5]:la,[-4]:la,[-3]:la,33:aa,38:ai,42:Gr,60:[Yr,Ji],91:sa,92:[Ii,ri],93:Xi,95:Gr,96:hi},za={null:[Gr,Ea]},Ba={null:[42,95]},Va={null:[]};function Ha(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=hr(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Wr(a,l.events,l),l.events):[]}function f(e,t){return Wa(p(e),t)}function p(e){return Ua(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){W(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&&mr(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 Ua(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 Wa(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=`
26
- `;break;case-3:o=`\r
27
- `;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 Ga(e){let t={constructs:_r([Ma,...(e||{}).extensions||[]]),content:n(Fr),defined:[],document:n(zr),flow:n(wa),lazy:{},string:n(Da),text:n(Oa)};return t;function n(e){return n;function n(n){return Ha(t,e,n)}}}function Ka(e){for(;!xi(e););return e}var qa=/[\0\t\n\r]/g;function Ja(){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;){qa.lastIndex=c;let n=qa.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 Ya=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Xa(e){return e.replace(Ya,Za)}function Za(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return br(n.slice(t?2:1),t?16:10)}return pr(n)||e}var Qa={}.hasOwnProperty;function $a(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),eo(n)(Ka(Ga(n).document().write(Ja()(e,t,!0))))}function eo(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(ye),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(I),blockQuote:o(fe),characterEscape:E,characterReference:E,codeFenced:o(pe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(pe,s),codeText:o(me,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(he),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(F),hardBreakEscape:o(ge),hardBreakTrailing:o(ge),htmlFlow:o(_e,s),htmlFlowData:E,htmlText:o(_e,s),htmlTextData:E,image:o(ve),label:s,link:o(ye),listItem:o(xe),listItemValue:p,listOrdered:o(be,f),listUnordered:o(be),paragraph:o(Se),reference:ae,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(I),strong:o(Ce),thematicBreak:o(Te)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ce,characterReference:le,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(j),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(ee),htmlFlowData:D,htmlText:l(A),htmlTextData:D,image:l(te),label:P,labelText:N,lineEnding:O,link:l(M),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:oe,resourceDestinationString:ne,resourceTitleString:re,resource:ie,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};no(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]),Qa.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]||io).call(o,void 0,e[0])}for(r.position={start:to(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:to(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:to(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+"` ("+En({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||io).call(this,e,r[0])),n.position.end=to(e.end)}function d(){return cr(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=xr(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=we(),n.position={start:to(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=to(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=to(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 ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}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.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 te(){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 N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Xa(t),n.identifier=xr(t).toLowerCase()}function P(){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 ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ie(){this.data.inReference=void 0}function ae(){this.data.referenceType=`collapsed`}function oe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=xr(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function se(e){this.data.characterReferenceType=e.type}function ce(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=br(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=pr(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=to(e.end)}function ue(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function fe(){return{type:`blockquote`,children:[],position:void 0}}function pe(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function me(){return{type:`inlineCode`,value:``,position:void 0}}function he(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function F(){return{type:`emphasis`,children:[],position:void 0}}function I(){return{type:`heading`,depth:0,children:[],position:void 0}}function ge(){return{type:`break`,position:void 0}}function _e(){return{type:`html`,value:``,position:void 0}}function ve(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function ye(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function be(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function xe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function Se(){return{type:`paragraph`,children:[],position:void 0}}function Ce(){return{type:`strong`,children:[],position:void 0}}function we(){return{type:`text`,value:``,position:void 0}}function Te(){return{type:`thematicBreak`,position:void 0}}}function to(e){return{line:e.line,column:e.column,offset:e.offset}}function no(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?no(e,r):ro(e,r)}}function ro(e,t){let n;for(n in t)if(Qa.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 io(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+En({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+En({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+En({start:t.start,end:t.end})+`) is still open`)}function ao(e){let t=this;t.parser=n;function n(n){return $a(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function oo(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 so(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
28
- `}]}function co(e,t){let n=t.value?t.value+`
29
- `:``,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 lo(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uo(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fo(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Nr(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 po(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 mo(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ho(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 go(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ho(e,t);let i={src:Nr(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 _o(e,t){let n={src:Nr(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 vo(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 yo(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ho(e,t);let i={href:Nr(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 bo(e,t){let n={href:Nr(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 xo(e,t,n){let r=e.all(t),i=n?So(n):Co(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:`
30
- `}),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:`
31
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function So(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Co(n[r])}return t}function Co(e){return e.spread??e.children.length>1}function wo(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 To(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Eo(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Do(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Oo(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=Cn(t.children[1]),o=Sn(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 ko(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 Ao(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var jo=9,Mo=32;function No(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Po(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Po(t.slice(i),i>0,!1)),a.join(``)}function Po(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===jo||t===Mo;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===jo||t===Mo;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Fo(e,t){let n={type:`text`,value:No(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function J(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Io={blockquote:oo,break:so,code:co,delete:lo,emphasis:uo,footnoteReference:fo,heading:po,html:mo,imageReference:go,image:_o,inlineCode:vo,linkReference:yo,link:bo,listItem:xo,list:wo,paragraph:To,root:Eo,strong:Do,table:Oo,tableCell:Ao,tableRow:ko,text:Fo,thematicBreak:J,toml:Lo,yaml:Lo,definition:Lo,footnoteDefinition:Lo};function Lo(){}var{defineProperty:Ro}=Object,zo=typeof self==`object`?self:globalThis,Bo=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new zo[e](t)},Vo=(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__`?Ro(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 zo[e]==`function`?Bo(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(Bo(a,o),i)};return r},Ho=e=>Vo(new Map,e)(0),Uo=``,{toString:Wo}={},{keys:Go,is:Ko}=Object,qo=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Wo.call(e).slice(8,-1);switch(n){case`Array`:return[1,Uo];case`Object`:return[2,Uo];case`Date`:return[3,Uo];case`RegExp`:return[4,Uo];case`Map`:return[5,Uo];case`Set`:return[6,Uo];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Jo=([e,t])=>e===0&&(t===`function`||t===`symbol`),Yo=(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]=qo(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&Ko(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 Go(o))(e||!Jo(qo(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?Uo: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||!(Jo(qo(n))||Jo(qo(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!Jo(qo(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},Xo=(e,{json:t,lossy:n}={})=>{let r=[];return Yo(!(t||n),!!t,new Map,r)(e),r},Zo=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Ho(Xo(e,t)):structuredClone(e):(e,t)=>Ho(Xo(e,t));function Qo(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 $o(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function es(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Qo,r=e.options.footnoteBackLabel||$o,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=Nr(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:{...Zo(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
32
- `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
33
- `}]}}var ts=(function(e){if(e==null)return os;if(typeof e==`function`)return as(e);if(typeof e==`object`)return Array.isArray(e)?ns(e):rs(e);if(typeof e==`string`)return is(e);throw Error(`Expected function, string, or object as test`)});function ns(e){let t=[],n=-1;for(;++n<e.length;)t[n]=ts(e[n]);return as(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function rs(e){let t=e;return as(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function is(e){return as(t);function t(t){return t&&t.type===e}}function as(e){return t;function t(t,n,r){return!!(ss(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function os(){return!0}function ss(e){return typeof e==`object`&&!!e&&`type`in e}function cs(e){return e}var ls=[];function us(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=ts(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+cs(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=ls,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=ds(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function ds(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?ls:[e]}function fs(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),us(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var ps={}.hasOwnProperty,ms={};function hs(e,t){let n=t||ms,r=new Map,i=new Map,a={all:s,applyData:_s,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Io,...n.handlers},one:o,options:n,patch:gs,wrap:ys};return fs(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(ps.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=Zo(n);return r.children=a.all(e),r}return Zo(e)}return(a.options.unknownHandler||vs)(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=bs(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=bs(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function gs(e,t){e.position&&(t.position=Tn(e))}function _s(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,Zo(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function vs(e,t){let n=t.data||{},r=`value`in t&&!(ps.call(n,`hProperties`)||ps.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 ys(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
34
- `});++r<e.length;)r&&n.push({type:`text`,value:`
35
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
36
- `}),n}function bs(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function xs(e,t){let n=hs(e,t),r=n.one(e,void 0),i=es(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
37
- `},i)),a}function Ss(e,t){return e&&`run`in e?async function(n,r){let i=xs(n,{file:r,...t});await e.run(i,r)}:function(n,r){return xs(n,{file:r,...e||t})}}function Cs(e){if(e)throw e}var ws=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 Ts(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 Es(){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?Ds(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 Ds(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 Os={basename:ks,dirname:As,extname:js,join:Ms,sep:`/`};function ks(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Fs(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 As(e){if(Fs(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 js(e){Fs(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 Ms(...e){let t=-1,n;for(;++t<e.length;)Fs(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Ns(n)}function Ns(e){Fs(e);let t=e.codePointAt(0)===47,n=Ps(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Ps(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 Fs(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Is={cwd:Ls};function Ls(){return`/`}function Rs(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function zs(e){if(typeof e==`string`)e=new URL(e);else if(!Rs(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 Bs(e)}function Bs(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 Vs=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Hs=class{constructor(e){let t;t=e?Rs(e)?{path:e}:typeof e==`string`||Ks(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Is.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Vs.length;){let e=Vs[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)Vs.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Os.basename(this.path):void 0}set basename(e){Ws(e,`basename`),Us(e,`basename`),this.path=Os.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Os.dirname(this.path):void 0}set dirname(e){Gs(this.basename,`dirname`),this.path=Os.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Os.extname(this.path):void 0}set extname(e){if(Us(e,`extname`),Gs(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=Os.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Rs(e)&&(e=zs(e)),Ws(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Os.basename(this.path,this.extname):void 0}set stem(e){Ws(e,`stem`),Us(e,`stem`),this.path=Os.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 An(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 Us(e,t){if(e&&e.includes(Os.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Os.sep+"`")}function Ws(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Gs(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Ks(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var qs=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Js=l(ws(),1),Ys={}.hasOwnProperty,Xs=new class e extends qs{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=Es()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Js.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?($s(`data`,this.frozen),this.namespace[e]=t,this):Ys.call(this.namespace,e)&&this.namespace[e]||void 0:e?($s(`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=nc(e),n=this.parser||this.Parser;return Zs(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Zs(`process`,this.parser||this.Parser),Qs(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=nc(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);ic(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(),Zs(`processSync`,this.parser||this.Parser),Qs(`processSync`,this.compiler||this.Compiler),this.process(e,r),tc(`processSync`,`process`,t),n;function r(e,r){t=!0,Cs(e),n=r}}run(e,t,n){ec(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=nc(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),tc(`runSync`,`run`,n),r;function i(e,t){Cs(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=nc(t),r=this.compiler||this.Compiler;return Qs(`stringify`,r),ec(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if($s(`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,Js.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];Ts(o)&&Ts(r)&&(r=(0,Js.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Zs(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Qs(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function $s(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 ec(e){if(!Ts(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function tc(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function nc(e){return rc(e)?e:new Hs(e)}function rc(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function ic(e){return typeof e==`string`||ac(e)}function ac(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var oc=[],sc={allowDangerousHtml:!0},cc=/^(https?|ircs?|mailto|xmpp)$/i,lc=[{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 uc(e){let t=dc(e),n=fc(e);return pc(t.runSync(t.parse(n),n),e)}function dc(e){let t=e.rehypePlugins||oc,n=e.remarkPlugins||oc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...sc}:sc;return Xs().use(ao).use(n).use(Ss,r).use(t)}function fc(e){let t=e.children||``,n=new Hs;return typeof t==`string`?n.value=t:``+t,n}function pc(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||mc;for(let e of lc)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return fs(e,l),Rn(e,{Fragment:B.Fragment,components:i,ignoreInvalidStyle:!0,jsx:B.jsx,jsxs:B.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 or)if(Object.hasOwn(or,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=or[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 mc(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||cc.test(e.slice(0,t))?e:``}function hc(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function gc(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function _c(e,t,n){let r=ts((n||{}).ignore||[]),i=vc(t),a=-1;for(;++a<i.length;)us(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1)r.lastIndex=n+1;else{if(s!==n&&f({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a))for(let e of a)f(e);else a&&f(a);s=n+d[0].length,l=!0}if(!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&f({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+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 vc(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([yc(e[0]),bc(e[1])])}return t}function yc(e){return typeof e==`string`?new RegExp(gc(e),`g`):e}function bc(e){return typeof e==`function`?e:function(){return e}}var xc=`phrasing`,Sc=[`autolink`,`link`,`image`,`label`];function Cc(){return{transforms:[jc],enter:{literalAutolink:Tc,literalAutolinkEmail:Ec,literalAutolinkHttp:Ec,literalAutolinkWww:Ec},exit:{literalAutolink:Ac,literalAutolinkEmail:kc,literalAutolinkHttp:Dc,literalAutolinkWww:Oc}}}function wc(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:xc,notInConstruct:Sc},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:xc,notInConstruct:Sc},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:xc,notInConstruct:Sc}]}}function Tc(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Ec(e){this.config.enter.autolinkProtocol.call(this,e)}function Dc(e){this.config.exit.autolinkProtocol.call(this,e)}function Oc(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 kc(e){this.config.exit.autolinkEmail.call(this,e)}function Ac(e){this.exit(e)}function jc(e){_c(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Mc],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Nc]],{ignore:[`link`,`linkReference`]})}function Mc(e,t,n,r,i){let a=``;if(!Ic(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Pc(n)))return!1;let o=Fc(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Nc(e,t,n,r){return!Ic(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Pc(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Fc(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=hc(e,`(`),a=hc(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 Ic(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||jr(n)||Ar(n))&&(!t||n!==47)}Kc.peek=Gc;function Lc(){this.buffer()}function Rc(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function zc(){this.buffer()}function Bc(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Vc(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Hc(e){this.exit(e)}function Uc(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Wc(e){this.exit(e)}function Gc(){return`[`}function Kc(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 qc(){return{enter:{gfmFootnoteCallString:Lc,gfmFootnoteCall:Rc,gfmFootnoteDefinitionLabelString:zc,gfmFootnoteDefinition:Bc},exit:{gfmFootnoteCallString:Vc,gfmFootnoteCall:Hc,gfmFootnoteDefinitionLabelString:Uc,gfmFootnoteDefinition:Wc}}}function Jc(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Kc},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?`
38
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Xc:Yc))),s(),o}}function Yc(e,t,n){return t===0?e:Xc(e,t,n)}function Xc(e,t,n){return(n?``:` `)+e}var Zc=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];nl.attention=rl,nl.peek=il;function Qc(){return{canContainEols:[`delete`],enter:{strikethrough:el},exit:{strikethrough:tl}}}function $c(){return{handlers:{delete:nl},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Zc}]}}function el(e){this.enter({type:`delete`,children:[],position:void 0},e)}function tl(e){this.exit(e)}function nl(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 rl(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function il(){return`~`}function al(e){return e.length}function ol(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||al,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=sl(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]=cl(r[d]);else{let e=cl(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
39
- `)}function sl(e){return e==null?``:String(e)}function cl(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 ll=ts([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function ul(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()),dl);return i(),o}function dl(e,t,n){return`>`+(n?``:` `)+e}function fl(e,t){return pl(e,t.inConstruct,!0)&&!pl(e,t.notInConstruct,!1)}function pl(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 ml(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
40
- `&&!e.before&&!e.after&&fl(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
41
- `}function hl(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 gl(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 _l(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function vl(e,t,n,r){let i=_l(n),a=e.value||``;if(gl(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,yl);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(hl(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:`
42
- `,encode:["`"],...o.current()})),t()}return u+=o.move(`
43
- `),a&&(u+=o.move(a+`
44
- `)),u+=o.move(s),c(),u}function yl(e,t,n){return(n?``:` `)+e}function bl(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function xl(e,t,n,r){let i=bl(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?` `:`
45
- `,...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 Sl(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}Cl.attention=wl,Cl.peek=Tl;function Cl(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function wl(e,t){return{construct:`emphasis`,markers:Sl(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function Tl(e,t,n){return n.options.emphasis||`*`}function El(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Dl(e,t){let n=!1;return fs(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)&&cr(e)&&(t.options.setext||n))}function Ol(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Dl(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
46
- `,after:`
47
- `});return r(),t(),o+`
48
- `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
49
- `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
50
- `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=El(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}kl.peek=Al;function kl(e){return e.value||``}function Al(){return`<`}jl.peek=Ml;function jl(e,t,n,r){let i=bl(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 Ml(){return`!`}Nl.peek=Pl;function Nl(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 Pl(){return`!`}Fl.peek=Il;function Fl(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 Il(){return"`"}function Ll(e,t){let n=cr(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))}Rl.peek=zl;function Rl(e,t,n,r){let i=bl(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(Ll(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(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function zl(e,t,n){return Ll(e,n)?`<`:`[`}Bl.peek=Vl;function Bl(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 Vl(){return`[`}function Hl(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 Ul(e){let t=Hl(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 Wl(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Gl(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 Kl(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Wl(n):Hl(n),s=e.ordered?o===`.`?`)`:`.`:Ul(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),Gl(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 ql(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 Jl(e,t,n,r){let i=ql(n),a=n.bulletCurrent||Hl(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 Yl(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function Xl(e,t,n,r){if(!e.children.some(function(e){return ll(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function Zl(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ql.attention=$l,Ql.peek=eu;function Ql(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function $l(e,t){return{construct:`strong`,markers:Zl(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function eu(e,t,n){return n.options.strong||`*`}function tu(e,t,n,r){let i=t?t.children:[],a=i.indexOf(e);return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function nu(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 ru(e,t,n){let r=(Gl(n)+(n.options.ruleSpaces?` `:``)).repeat(nu(n));return n.options.ruleSpaces?r.slice(0,-1):r}var iu={blockquote:ul,break:ml,code:vl,definition:xl,emphasis:Cl,hardBreak:ml,heading:Ol,html:kl,image:jl,imageReference:Nl,inlineCode:Fl,link:Rl,linkReference:Bl,list:Kl,listItem:Jl,paragraph:Yl,root:Xl,strong:Ql,text:tu,thematicBreak:ru};function au(){return{enter:{table:ou,tableData:uu,tableHeader:uu,tableRow:cu},exit:{codeText:du,table:su,tableData:lu,tableHeader:lu,tableRow:lu}}}function ou(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function su(e){this.exit(e),this.data.inTable=void 0}function cu(e){this.enter({type:`tableRow`,children:[]},e)}function lu(e){this.exit(e)}function uu(e){this.enter({type:`tableCell`,children:[]},e)}function du(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,fu));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function fu(e,t){return t===`|`?t:e}function pu(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
51
- `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
52
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return ol(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=iu.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function mu(){return{exit:{taskListCheckValueChecked:gu,taskListCheckValueUnchecked:gu,paragraph:_u}}}function hu(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:vu}}}function gu(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function _u(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function vu(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=iu.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function yu(){return[Cc(),qc(),Qc(),au(),mu()]}function bu(e){return{extensions:[wc(),Jc(e),$c(),pu(e),hu()]}}var xu={tokenize:Fu,partial:!0},Su={tokenize:Iu,partial:!0},Cu={tokenize:Lu,partial:!0},wu={tokenize:Ru,partial:!0},Tu={tokenize:zu,partial:!0},Eu={name:`wwwAutolink`,tokenize:Nu,previous:Bu},Du={name:`protocolAutolink`,tokenize:Pu,previous:Vu},Ou={name:`emailAutolink`,tokenize:Mu,previous:Hu},ku={};function Au(){return{text:ku}}for(var ju=48;ju<123;)ku[ju]=Ou,ju++,ju===58?ju=65:ju===91&&(ju=97);ku[43]=Ou,ku[45]=Ou,ku[46]=Ou,ku[95]=Ou,ku[72]=[Ou,Du],ku[104]=[Ou,Du],ku[87]=[Ou,Eu],ku[119]=[Ou,Eu];function Mu(e,t,n){let r=this,i,a;return o;function o(t){return!Uu(t)||!Hu.call(r,r.previous)||Wu(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Uu(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Tu,u,l)(t):t===45||t===95||Cr(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&&Sr(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Nu(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Bu.call(r,r.previous)||Wu(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(xu,e.attempt(Su,e.attempt(Cu,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Pu(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Vu.call(r,r.previous)&&!Wu(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Sr(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||Tr(t)||kr(t)||jr(t)||Ar(t)?n(t):e.attempt(Su,e.attempt(Cu,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Fu(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 Iu(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(wu,c,s)(t):t===null||kr(t)||jr(t)||t!==45&&Ar(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 Lu(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(wu,t,a)(o):o===null||kr(o)||jr(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Ru(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||kr(o)||jr(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||kr(e)||jr(e)?t(e):r(e)}function a(e){return Sr(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Sr(t)?(e.consume(t),o):n(t)}}function zu(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Cr(e)?n(e):t(e)}}function Bu(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||kr(e)}function Vu(e){return!Sr(e)}function Hu(e){return!(e===47||Uu(e))}function Uu(e){return e===43||e===45||e===46||e===95||Cr(e)}function Wu(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 Gu={tokenize:Y,partial:!0};function Ku(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Xu,continuation:{tokenize:Zu},exit:Qu}},text:{91:{name:`gfmFootnoteCall`,tokenize:Yu},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:qu,resolveTo:Ju}}}}function qu(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=xr(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 Ju(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 Yu(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||kr(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(xr(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return kr(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 Xu(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||kr(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=xr(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return kr(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),K(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Zu(e,t,n){return e.check(Zr,t,e.attempt(Gu,t,n))}function Qu(e){e.exit(`gfmFootnoteDefinition`)}function Y(e,t,n){let r=this;return K(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 X(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&&mr(o,o.length,0,Wr(s,e.slice(r+1,n),t)),mr(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),mr(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=Ur(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=Ur(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var $u=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){ed(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 ed(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 td(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 nd(){return{flow:{null:{name:`table`,tokenize:rd,resolveAll:id}}}}function rd(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):W(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):G(t)?K(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||kr(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,G(t)?K(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 G(t)?K(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||W(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 G(t)?K(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||W(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||W(n)?(e.exit(`tableRow`),t(n)):G(n)?K(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||kr(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 id(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 $u;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(od(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=ad(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=ad(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=ad(f,t,o,i,n,d)):(o[0]=o[1],d=ad(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&od(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=td(t.events,n))}return e}function ad(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},sd(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=sd(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=sd(t.events,n[2]),a=sd(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({},sd(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function od(e,t,n,r,i){let a=[],o=sd(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 sd(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var cd={name:`tasklistCheck`,tokenize:ud};function ld(){return{text:{91:cd}}}function ud(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 kr(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 W(r)?t(r):G(r)?e.check({tokenize:dd},t,n)(r):n(r)}}function dd(e,t,n){return K(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function fd(e){return _r([Au(),Ku(),X(e),nd(),ld()])}var pd={};function md(e){let t=this,n=e||pd,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(fd(n)),a.push(yu()),o.push(bu(n))}var hd=e=>/\.(png|jpe?g)$/i.test(e.replace(/[?#].*$/,``)),gd=(e,t,n)=>t.startsWith(`board:`)?`/api/board-attachment?file=${encodeURIComponent(t)}`:`/api/sessions/${e}/image?path=${encodeURIComponent(t)}${n?`&in=${n}`:``}`;function _d(e){let[t,n]=(0,v.useState)(null),r=gd(e.sessionId,e.path,e.folder);return t?(0,B.jsxs)(`p`,{className:`error`,children:[e.alt?`${e.alt}: `:``,t]}):(0,B.jsx)(`img`,{src:r,alt:e.alt??e.path,className:`project-image${e.full?` full`:``}${e.onClick?` clickable`:``}`,onClick:e.onClick,onError:()=>{fetch(r,{credentials:`same-origin`}).then(e=>e.json()).then(e=>n(e.error??`The image could not be shown.`)).catch(()=>n(`The image could not be shown.`))}})}async function vd(e){if(window.isSecureContext&&navigator.clipboard)return navigator.clipboard.writeText(e);let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),t.remove()}function yd({text:e,label:t=`Copy`}){let[n,r]=(0,v.useState)(!1);return(0,B.jsx)(`button`,{type:`button`,className:`copy-button`,onClick:async()=>{await vd(e),r(!0),setTimeout(()=>r(!1),1500)},children:n?`Copied`:t})}function bd(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(bd).join(``):e&&typeof e==`object`&&`props`in e?bd(e.props.children):``}function xd(e){return e.startsWith(`#`)?!1:/^[a-zA-Z]:[\\/]/.test(e)||e.startsWith(`file:`)?!0:!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)}function Sd(e,t){let n=t.replace(/^file:\/\/\/?/,``);if(/^[a-zA-Z]:[\\/]/.test(n)||n.startsWith(`/`))return n;let r=e?e.split(`/`):[];for(let e of n.split(`/`))e!==``&&e!==`.`&&(e===`..`&&r.length&&r[r.length-1]!==`..`?r.pop():r.push(e));return r.join(`/`)}function Cd({text:e,baseDir:t=``,onOpenFile:n,sessionId:r}){return(0,B.jsx)(`div`,{className:`markdown`,children:(0,B.jsx)(uc,{remarkPlugins:[md],components:{pre:({children:e})=>{let t=bd(e).replace(/\n$/,``);return(0,B.jsxs)(`div`,{className:`code-block`,children:[(0,B.jsx)(yd,{text:t}),(0,B.jsx)(`pre`,{children:e})]})},a:({href:e,children:r})=>n&&e&&xd(e)?(0,B.jsx)(`a`,{href:e,className:`file-link`,onClick:r=>{r.preventDefault(),n(Sd(t,e))},children:r}):(0,B.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,children:r}),img:({src:e,alt:i})=>{let a=typeof e==`string`?e:``;if(!r||!a||!xd(a)||a.startsWith(`file:`))return(0,B.jsxs)(`span`,{className:`image-note`,children:[`[image not shown`,i?`: ${i}`:``,`]`]});let o=Sd(t,a.replace(/[?#].*$/,``));return!hd(o)||o.startsWith(`..`)?(0,B.jsxs)(`span`,{className:`image-note`,children:[`[image not shown`,i?`: ${i}`:``,`: only PNG and JPEG images inside the project]`]}):(0,B.jsx)(_d,{sessionId:r,path:o,alt:i,onClick:()=>n?.(o)})},table:({children:e})=>(0,B.jsx)(`div`,{className:`table-scroll`,children:(0,B.jsx)(`table`,{children:e})})},children:e})})}var wd=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Td=e=>R.usagePublishRepos(e);function Ed(e){let t=Math.round((Date.now()-e)/6e4);return t<1?`just now`:t<60?`${t} min ago`:t<2880?`${Math.round(t/60)} h ago`:`${Math.round(t/1440)} days ago`}function Dd({accounts:e,run:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)([]),[f,p]=(0,v.useState)(!1),m=(0,v.useCallback)(()=>{R.usagePublish().then(e=>r(e),()=>{}),R.sharedUsage().then(a,()=>{})},[]);(0,v.useEffect)(()=>{m();let e=setInterval(m,6e4);return()=>clearInterval(e)},[m]);let h=n?.allAccounts??!1,g=(n?.accounts??[]).join(`
53
- `);if((0,v.useEffect)(()=>{n&&(s(n.repo??``),l(h),d(g?g.split(`
54
- `):[]))},[n?.repo,h,g]),!n)return null;let _=o.trim(),y=!_||wd.test(_),b=c||u.length>0,x=c!==h||[...u].sort().join(`
55
- `)!==g||_!==(n.repo??``),S=()=>t(async()=>{r(await R.setUsagePublish(b,_||null,{allAccounts:c,accounts:[...u].sort()})),a(await R.sharedUsage(!0))}),C=[...new Set([`default`,...e.map(e=>e.name),...n.accounts])],w=t=>e.find(e=>e.name===t)?.email??null,T=(e,t)=>d(n=>t?[...new Set([...n,e])]:n.filter(t=>t!==e)),E=!n.enabled&&!n.pendingRemovals?.length;if(E&&!f)return(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Not set up`}),(0,B.jsxs)(`div`,{className:`offline`,children:[(0,B.jsx)(`span`,{className:`offline-name`,children:`Publish usage`}),(0,B.jsx)(`span`,{className:`offline-why`,children:`Share this computer's usage totals with your other computers through a GitHub repository.`}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>p(!0),children:`Set up ›`})]})]});let D=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{className:`muted`,children:[`Shares this computer's usage totals with a GitHub repository, through your `,(0,B.jsx)(`span`,{className:`mono`,children:`gh`}),` login, so the Shared tab can show every computer's usage side by side. Each computer keeps one file there and replaces it every 5 minutes when something changed.`]}),(0,B.jsxs)(`div`,{role:`group`,"aria-label":`Accounts to publish`,children:[(0,B.jsx)(`h4`,{children:`Accounts`}),(0,B.jsxs)(`label`,{className:`toggle`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>l(e.target.checked)}),` `,(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`span`,{className:`field-name`,children:`All accounts`}),` `,(0,B.jsx)(`span`,{className:`muted`,children:`(every Claude account on this computer, ones added later too)`})]})]}),C.map(t=>(0,B.jsxs)(`label`,{className:`toggle`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:c||u.includes(t),disabled:c,onChange:e=>T(t,e.target.checked)}),` `,(0,B.jsxs)(`span`,{children:[(0,B.jsxs)(`span`,{className:`field-name`,children:[`Publish `,t]}),` `,(0,B.jsxs)(`span`,{className:`muted`,children:[`(`,t==="default"?`this computer's own login`:w(t)??`not signed in yet`,!e.some(e=>e.name===t)&&t!=="default"?`, removed`:``,`)`]})]})]},t))]}),(0,B.jsx)(wt,{project:``,label:`Default usage repository`,newName:`ledung-usage`,value:o,ok:y,onChange:s,load:Td}),(0,B.jsxs)(`p`,{className:`muted`,children:[`Every project publishes here unless its own settings name a usage repository of its own.`,!!n.projectRepos?.length&&(0,B.jsxs)(B.Fragment,{children:[` Projects with their own: `,n.projectRepos.map((e,t)=>(0,B.jsxs)(`span`,{children:[t?`; `:``,e.projects.join(`, `),` → `,(0,B.jsx)(`span`,{className:`mono`,children:e.repo})]},e.repo)),`.`]})]}),(b||_)&&(0,B.jsxs)(`div`,{className:`board-warning`,children:[(0,B.jsxs)(`strong`,{children:[`Everyone with read access to `,_&&y?_:`the repository`,` sees what is published`]}),`: this computer's name, your GitHub login, and for each account switched on above, per day and model, the tokens, API-equivalent cost and calls, and its plan limits; a project with a repository of its own goes there instead. A project shows by name only where you switch that on in its settings; every other project is `,(0,B.jsx)(`span`,{className:`mono`,children:`other#`}),` and four characters. Never prompts, replies, tool output, paths, folder or branch names, session titles, emails or tokens.`]}),(0,B.jsx)(`button`,{disabled:!x||!y||b&&!_,onClick:()=>void S(),children:`Save`}),b&&!_&&(0,B.jsx)(`span`,{className:`muted`,children:` Choose the repository to publish to.`}),!b&&n.enabled&&(0,B.jsx)(`span`,{className:`muted`,children:` No account is switched on: saving stops publishing and removes this computer's usage from the repositories.`}),n.enabled&&(0,B.jsxs)(`p`,{className:`muted`,children:[`Publishes as `,(0,B.jsx)(`strong`,{children:n.computer}),n.lastPublishedAt?`; last published ${Ed(n.lastPublishedAt)}`:``,`.`,n.error&&(0,B.jsxs)(`span`,{className:`board-error`,children:[` The last publish failed: `,n.error,` Ledung tries again shortly (after 1, 2, then every 5 minutes).`]})]}),!!n.pendingRemovals?.length&&(0,B.jsxs)(`p`,{className:`board-error`,children:[`This computer's usage is still in `,n.pendingRemovals.join(`, `),`; Ledung keeps trying to remove it.`,!n.enabled&&n.error?` ${n.error}`:``]}),(0,B.jsx)(Od,{view:n,onView:r,run:t}),i?.repo&&(0,B.jsx)(kd,{shared:i,onShared:a,run:t})]});return E?(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Not set up`}),(0,B.jsxs)(`div`,{className:`offline-open`,role:`group`,"aria-label":`Publish usage`,children:[(0,B.jsxs)(`h4`,{children:[(0,B.jsx)(`span`,{children:`Publish usage`}),(0,B.jsx)(`button`,{className:`small`,"aria-label":`Close Publish usage`,title:`Close`,onClick:()=>p(!1),children:`✕`})]}),D]})]}):(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Publish usage`}),D]})}function Od({view:e,onView:t,run:n}){let r=z(),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``);return(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h4`,{children:`Usage key`}),(0,B.jsxs)(`p`,{className:`muted`,children:[`Makes a project's `,(0,B.jsx)(`span`,{className:`mono`,children:`other#`}),` label the same on all your computers, without its name. It stays on this computer, next to the link keys. `,e.hasKey?`This computer has one.`:`This computer makes one, or takes a linked computer's, when publishing is switched on.`]}),(0,B.jsxs)(`div`,{className:`board-add`,children:[e.hasKey&&!i&&(0,B.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>a((await R.revealUsageKey()).key)),children:`Show the key`}),i&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`mono`,children:i}),` `,(0,B.jsx)(yd,{text:i}),` `,(0,B.jsx)(`button`,{className:`small`,onClick:()=>a(null),children:`Hide`})]}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await R.takeLinkedUsageKey())),children:`Take a linked computer's key`})]}),(0,B.jsxs)(`div`,{className:`board-add`,children:[(0,B.jsx)(`input`,{...r,className:`mono`,value:o,placeholder:`Paste a usage key from another computer`,onChange:e=>s(e.target.value.trim())}),(0,B.jsx)(`button`,{className:`small`,disabled:!o,onClick:()=>void n(async()=>{t(await R.setUsageKey(o)),s(``),a(null)}),children:`Use this key`})]})]})}function kd({shared:e,onShared:t,run:n}){let[r,i]=(0,v.useState)(null);return(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`h4`,{children:[`Computers publishing to `,e.repo]}),e.error&&(0,B.jsx)(`p`,{className:`board-error`,children:e.error}),!e.entries.length&&!e.error&&(0,B.jsx)(`p`,{className:`muted`,children:`None yet.`}),(0,B.jsx)(`ul`,{className:`board-counts`,children:e.entries.map(a=>(0,B.jsxs)(`li`,{children:[(0,B.jsx)(Ad,{entry:a}),a.stale&&!a.own&&e.canRemove&&(r===a.id?(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(`button`,{className:`small danger`,onClick:()=>void n(async()=>{t(await R.removeSharedUsage(a.id)),i(null)}),children:`Confirm: remove its usage`}),` `,(0,B.jsx)(`button`,{className:`small`,onClick:()=>i(null),children:`Cancel`})]}):(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(`button`,{className:`small`,onClick:()=>i(a.id),children:`Remove…`})]}))]},a.id))}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await R.sharedUsage(!0))),children:`Check again`})]})}function Ad({entry:e}){let t=`${e.computer??`A computer`}${e.login?` (@${e.login})`:``}${e.own?`, this computer`:``}`;return e.state===`newer`?(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:t}),`: published by a newer Ledung. Update Ledung to read it.`]}):e.state===`invalid`?(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:t}),`: its file can't be read (`,e.reason,`).`]}):(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:t}),e.asOf?`, as of ${Ed(e.asOf)}`:``,e.stale&&(0,B.jsx)(`span`,{className:`chip warn`,children:`silent for 30 days`})]})}function jd({value:e,onChange:t}){let n=e.usageRepo.trim();return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Md,{value:e.publishUsageName,onChange:n=>t({...e,publishUsageName:n})}),(0,B.jsx)(wt,{project:``,label:(0,B.jsx)(`span`,{className:`field-name`,children:`Usage repository`}),newName:`ledung-usage`,value:e.usageRepo,ok:!n||wd.test(n),onChange:n=>t({...e,usageRepo:n}),load:Td}),(0,B.jsx)(`span`,{className:`muted`,children:`Where its usage is published, instead of this computer's default repository (Settings → Claude & usage → Publish usage); empty: the default.`})]})}function Md({value:e,onChange:t}){return(0,B.jsxs)(`label`,{className:`toggle`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` `,(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`span`,{className:`field-name`,children:`Publish its usage under its name`}),` `,(0,B.jsx)(`span`,{className:`muted`,children:`(when usage is published in Settings; otherwise it shows as other# and four characters)`})]})]})}var Nd=`ledung.waitingFilter`;function Pd(e){try{let t=JSON.parse(e.getItem(Nd)??`null`);if(t&&(t.mode===`one`||t.mode===`all`))return{mode:t.mode,one:String(t.one??``),hidden:Array.isArray(t.hidden)?t.hidden.map(String):[]}}catch{}return{mode:`all`,one:``,hidden:[]}}function Fd(e,t){try{e.setItem(Nd,JSON.stringify(t))}catch{}}function Id(e,t,n){let r=Pd(e);(r.one===t||r.hidden.includes(t))&&Fd(e,{mode:r.mode,one:r.one===t?n:r.one,hidden:r.hidden.map(e=>e===t?n:e)})}function Ld(e,t,n,r,i){let a=e.map(e=>{let r=ce(e),i=t(e.sessionId);return{q:e,v:r,project:i,tier:me(r.tier,n(i))}}),o=F(i),s=a.filter(e=>e.q.status===`open`&&e.q.addressedTo===`user`&&r(e.project)).sort((e,t)=>o({tier:e.tier,rank:e.v.rank,askedAt:e.q.askedAt},{tier:t.tier,rank:t.v.rank,askedAt:t.q.askedAt})),c=a.filter(e=>e.q.status!==`open`&&r(e.project)).sort((e,t)=>(t.q.answeredAt??t.q.askedAt)-(e.q.answeredAt??e.q.askedAt)).slice(0,30);return{items:a,forYou:s,done:c,listFor:e=>e.q.status===`open`?e.q.addressedTo===`user`?s:[e]:c}}var Rd={A:`Lockdown level A: nothing reaches in; it may still reach out`,B:`Lockdown level B, nearly air-gapped: nothing reaches in or out`};function zd(e){return e===`A`?1:2}function Bd(e){let t=e?.lockdown?.level;return t===`A`||t===`B`?t:null}function Vd(e,t,n){let r=Array.from({length:n},()=>Array(t).fill(` `)),i=Array.from({length:n},()=>Array(t).fill(``)),a=(e,a,o,s=``)=>{e>=0&&a>=0&&e<t&&a<n&&(r[a][e]=o,i[a][e]=s)},o=(e,t,n,r=``)=>[...n].forEach((n,i)=>a(e+i,t,n,r)),s=(e,r,i)=>{let o=e,s=e,c=t-1-e,l=n-1-e;for(let e=o;e<=c;e++){let t=i&&(e-o)%6==3;a(e,s,t?`o`:r[0]),a(e,l,t?`o`:r[0])}for(let e=s;e<=l;e++){let t=i&&(e-s)%3==2&&e<l-1;a(o,e,t?`o`:r[1]),a(c,e,t?`o`:r[1])}a(o,s,r[2]),a(c,s,r[3]),a(o,l,r[4]),a(c,l,r[5])},c=e===`B`;return c?(s(0,`━┃┏┓┗┛`,!0),s(1,`─│┌┐└┘`,!1)):s(0,`─│┌┐└┘`,!0),o(3,0,`┤ LOCK ${e} ├`,c?`d`:`a`),o(t-7,0,`(|)`,c?`d`:``),c||a(t-1,Math.floor(n/2),`»`,`a`),{ch:r,kind:i}}function Hd(e){return e.ch.map((t,n)=>{let r=[];return t.forEach((t,i)=>{let a=e.kind[n][i],o=r[r.length-1];o&&o.kind===a?o.text+=t:r.push({text:t,kind:a})}),r})}var Ud=10,Wd=0;function Gd(){if(Wd)return Wd;let e=document.createElement(`span`);e.className=`lframe-probe`,e.textContent=`0`.repeat(100),document.body.append(e);let t=e.getBoundingClientRect().width/100;return e.remove(),t>0&&document.fonts?.status!==`loading`&&(Wd=t),t||6}function Kd({level:e,fill:t,children:n}){return e?(0,B.jsx)(qd,{level:e,fill:!!t,children:n}):(0,B.jsx)(B.Fragment,{children:n})}function qd({level:e,fill:t,children:n}){let r=(0,v.useRef)(null),i=(0,v.useRef)(null),[a,o]=(0,v.useState)(null),s=zd(e);(0,v.useLayoutEffect)(()=>{let e=()=>{let e=r.current,n=i.current;if(!e||!n)return;let a=Gd(),c=e.clientWidth,l=Math.max(2*s+12,Math.floor(c/a)),u=Math.max(0,(c-l*a)/2),d,f=0,p=0;if(t){let t=e.clientHeight;d=Math.max(2*s+3,Math.floor(t/Ud)),f=Math.max(0,(t-d*Ud)/2)}else{let e=n.clientHeight-(parseFloat(getComputedStyle(n).paddingBottom)||0),t=Math.max(1,Math.ceil(e/Ud-.01));d=t+2*s,p=Math.max(0,t*Ud-e)}let m={cols:l,rows:d,cw:a,padX:u,padY:f,extra:p};o(e=>e&&e.cols===l&&e.rows===d&&e.cw===a&&Math.abs(e.padX-u)<.5&&Math.abs(e.padY-f)<.5&&Math.abs(e.extra-p)<.5?e:m)};e();let n=new ResizeObserver(e);n.observe(r.current),n.observe(i.current);let a=!0;return document.fonts?.ready.then(()=>{a&&(Wd=0,e())}),()=>{a=!1,n.disconnect()}},[e,t,s]);let c=a?.cw??6,l=(a?.padX??0)+s*c,u=(a?.padY??0)+s*Ud;return(0,B.jsxs)(`div`,{ref:r,className:`lframe ${e.toLowerCase()}${t?` fill`:``}`,"data-lock":e,children:[(0,B.jsx)(`pre`,{className:`lframe-border`,"aria-hidden":`true`,style:a?{left:a.padX,top:a.padY,width:a.cols*c,height:a.rows*Ud}:void 0,children:a&&Hd(Vd(e,a.cols,a.rows)).map((e,t)=>(0,B.jsxs)(`span`,{children:[t>0&&`
56
- `,e.map((e,t)=>e.kind?(0,B.jsx)(`span`,{className:`k-${e.kind}`,children:e.text},t):e.text)]},t))}),(0,B.jsx)(`div`,{ref:i,className:`lframe-inner`,style:{margin:`${u}px ${l}px`,paddingBottom:a?.extra||void 0},children:n})]})}var Jd={manager:`on`,session:`off`};function Yd(e,t,n){return n?.[e]?.newSkills??t[e]?.newSkills??Jd[e]}function Xd(e,t,n,r){let i=r?.[t],a=n[t];return i?.on?.includes(e)?!0:i?.off?.includes(e)?!1:a?.on?.includes(e)?!0:!a?.off?.includes(e)&&Yd(t,n,r)===`on`}function Zd(e,t,n,r){let i=e[t]??{},a=e=>(e??[]).filter(e=>e!==n),o={...i,on:r===!0?[...a(i.on),n].sort():a(i.on),off:r===!1?[...a(i.off),n].sort():a(i.off)};return o.on.length||delete o.on,o.off.length||delete o.off,{...e,[t]:o}}var Qd=(e,t,n)=>!!(e?.[t]?.on?.includes(n)||e?.[t]?.off?.includes(n)),$d=[{role:`manager`,label:`Manager`},{role:`session`,label:`Sessions`}],ef={personal:`Personal`,"claude.ai":`From claude.ai`};function tf(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let t=!0;return n(null),i(null),R.skills(e).then(e=>{t&&n(e)},e=>{t&&i(e.message)}),()=>{t=!1}},[e]),{list:t,error:r}}function nf({list:e,error:t,value:n,onChange:r,defaults:i}){if(t)return(0,B.jsxs)(`p`,{className:`error`,children:[`Couldn't list the skills: `,t]});if(!e)return(0,B.jsx)(`p`,{className:`muted`,children:`Looking for your skills…`});let a=i??{},o=i?n:void 0,s=(e,t)=>i?Xd(e,t,a,o):Xd(e,t,n,void 0),c=new Set(e.skills.map(e=>e.name)),l=[...new Set($d.flatMap(({role:e})=>[...n[e]?.on??[],...n[e]?.off??[]]))].filter(e=>!c.has(e)).sort(),u=(e,t)=>{let i={...n[e]};t===null?delete i.newSkills:i.newSkills=t,r({...n,[e]:i})},d=[`personal`,`claude.ai`].map(t=>({source:t,skills:e.skills.filter(e=>e.source===t)})).filter(e=>e.skills.length);return(0,B.jsxs)(`div`,{className:`skill-picker`,children:[(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Skill`}),$d.map(({role:e,label:t})=>(0,B.jsx)(`th`,{children:t},e))]})}),(0,B.jsxs)(`tbody`,{children:[(0,B.jsxs)(`tr`,{className:`skill-new`,children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:`New skills`}),(0,B.jsxs)(`div`,{className:`muted`,children:[`A skill with no tick chosen`,i?` here or in Settings`:``,`, such as one you add later.`]})]}),$d.map(({role:e,label:t})=>(0,B.jsx)(`td`,{children:i?(0,B.jsxs)(`select`,{"aria-label":`New skills, ${t}`,value:n[e]?.newSkills??``,onChange:t=>u(e,t.target.value||null),children:[(0,B.jsxs)(`option`,{value:``,children:[`Settings: `,Yd(e,a,void 0)]}),(0,B.jsx)(`option`,{value:`on`,children:`on`}),(0,B.jsx)(`option`,{value:`off`,children:`off`})]}):(0,B.jsxs)(`select`,{"aria-label":`New skills, ${t}`,value:Yd(e,n,void 0),onChange:t=>u(e,t.target.value),children:[(0,B.jsx)(`option`,{value:`on`,children:`on`}),(0,B.jsx)(`option`,{value:`off`,children:`off`})]})},e))]}),d.map(e=>[(0,B.jsx)(`tr`,{className:`skill-group`,children:(0,B.jsx)(`td`,{colSpan:3,children:ef[e.source]})},`h-${e.source}`),...e.skills.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`span`,{className:`mono`,children:e.name}),e.description&&(0,B.jsx)(`div`,{className:`muted`,children:e.description})]}),$d.map(({role:t,label:a})=>{let o=Qd(n,t,e.name);return(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`input`,{type:`checkbox`,"aria-label":`${e.name}, ${a}`,checked:s(e.name,t),onChange:i=>r(Zd(n,t,e.name,i.target.checked))}),i&&o&&(0,B.jsx)(`button`,{type:`button`,className:`small skill-clear`,title:`Follow Settings again`,onClick:()=>r(Zd(n,t,e.name,null)),children:`here ✕`})]},t)})]},e.name))]),l.length>0&&(0,B.jsx)(`tr`,{className:`skill-group`,children:(0,B.jsx)(`td`,{colSpan:3,children:`Not on this computer any more`})}),l.map(e=>(0,B.jsxs)(`tr`,{className:`skill-gone`,children:[(0,B.jsx)(`td`,{children:(0,B.jsx)(`span`,{className:`mono`,children:e})}),$d.map(({role:t,label:i})=>(0,B.jsx)(`td`,{children:Qd(n,t,e)&&(0,B.jsxs)(`button`,{type:`button`,className:`small skill-clear`,"aria-label":`Clear ${e}, ${i}`,onClick:()=>r(Zd(n,t,e,null)),children:[n[t]?.on?.includes(e)?`on`:`off`,` ✕`]})},t))]},`gone-${e}`))]})]}),!e.skills.length&&(0,B.jsxs)(`p`,{className:`muted`,children:[`No skills of your own were found`,i?` where this project runs`:` on this computer`,`.`]}),e.plugins.length>0&&(0,B.jsxs)(`p`,{className:`muted`,children:[`Plugin skills go on and off with their plugin, in the session profile: `,e.plugins.join(`, `),`.`]})]})}function rf(e,t,n){if(!e)return``;let r=e.skills.length,i=r=>e.skills.filter(e=>n?Xd(e.name,r,n,t):Xd(e.name,r,t,void 0)).length;return`manager ${i(`manager`)} of ${r}, sessions ${i(`session`)} of ${r}`}function af({run:e}){let{list:t,error:n}=tf(void 0),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{t&&r===null&&i(t.defaults)},[t]),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Skills`}),(0,B.jsx)(`p`,{className:`muted`,children:`Which of your own skills managers and sessions get, unless a project's ⚙ says otherwise. Running sessions keep theirs; new and resumed ones get these.`}),(0,B.jsxs)(`details`,{children:[(0,B.jsxs)(`summary`,{children:[`Default skills`,t&&r?`: ${rf(t,r,null)}`:``]}),(0,B.jsx)(nf,{list:t,error:n,value:r??{},onChange:e=>{i(e),o(!1)},defaults:null}),(0,B.jsx)(`button`,{className:`primary`,disabled:!r,onClick:()=>void e(async()=>{i(await R.setSkillDefaults(r??{})),o(!0)}),children:`Save`}),a&&(0,B.jsx)(`span`,{className:`muted`,children:` Saved.`})]})]})}var of={red:{label:`Red`,light:`#b3261e`,dark:`#f28b82`},orange:{label:`Orange`,light:`#a94600`,dark:`#f5a35c`},amber:{label:`Amber`,light:`#865d00`,dark:`#e6c34d`},green:{label:`Green`,light:`#1d7a2c`,dark:`#81c995`},teal:{label:`Teal`,light:`#00766a`,dark:`#4fd1c5`},blue:{label:`Blue`,light:`#2457c5`,dark:`#8ab4f8`},purple:{label:`Purple`,light:`#6d3fb8`,dark:`#c3a6ff`},pink:{label:`Pink`,light:`#ab2c6b`,dark:`#f48fb1`}};function sf(e,t){return e?t===`manager`||e.sessions===`same`?e.manager:e.sessions===`none`?null:e.sessions:null}function cf({colour:e,children:t}){if(!e)return(0,B.jsx)(B.Fragment,{children:t});let n=of[e];return(0,B.jsx)(`span`,{className:`named`,style:{"--name-light":n.light,"--name-dark":n.dark},children:t})}function lf({project:e,run:t}){let n=n=>t(()=>R.setProjectColours(e.name,n)),{manager:r,sessions:i}=e.colours,a=Object.keys(of),o=(e,t,n,r)=>(0,B.jsx)(`button`,{type:`button`,className:`swatch${t?` on`:``}`,"aria-pressed":t,title:of[e].label,"aria-label":`${r}: ${of[e].label}`,onClick:n,children:(0,B.jsx)(cf,{colour:e,children:`●`})},e);return(0,B.jsxs)(`div`,{className:`name-colours`,children:[(0,B.jsxs)(`div`,{className:`name-colour-row`,role:`group`,"aria-label":`Manager name colour`,children:[(0,B.jsxs)(`div`,{className:`name-colour-head`,children:[(0,B.jsx)(`span`,{className:`name-colour-label field-name`,children:`Manager name`}),(0,B.jsx)(`button`,{type:`button`,className:`small${r===null?` on`:``}`,"aria-pressed":r===null,onClick:()=>n({manager:null,sessions:i}),children:`None`})]}),(0,B.jsx)(`div`,{className:`swatches`,children:a.map(e=>o(e,r===e,()=>n({manager:e,sessions:i}),`Manager name`))})]}),(0,B.jsxs)(`div`,{className:`name-colour-row`,role:`group`,"aria-label":`Its sessions' name colour`,children:[(0,B.jsxs)(`div`,{className:`name-colour-head`,children:[(0,B.jsx)(`span`,{className:`name-colour-label field-name`,children:`Its sessions' names`}),(0,B.jsx)(`button`,{type:`button`,className:`small${i===`same`?` on`:``}`,"aria-pressed":i===`same`,onClick:()=>n({manager:r,sessions:`same`}),children:`Same as manager`}),(0,B.jsx)(`button`,{type:`button`,className:`small${i===`none`?` on`:``}`,"aria-pressed":i===`none`,onClick:()=>n({manager:r,sessions:`none`}),children:`None`})]}),(0,B.jsx)(`div`,{className:`swatches`,children:a.map(e=>o(e,i===e,()=>n({manager:r,sessions:e}),`Its sessions' names`))})]})]})}function uf({colour:e,run:t}){let n=e=>t(()=>R.setChatsColour(e));return(0,B.jsx)(`div`,{className:`name-colours`,children:(0,B.jsxs)(`div`,{className:`name-colour-row`,role:`group`,"aria-label":`Chats' name colour`,children:[(0,B.jsxs)(`div`,{className:`name-colour-head`,children:[(0,B.jsx)(`span`,{className:`name-colour-label field-name`,children:`Chats' names`}),(0,B.jsx)(`button`,{type:`button`,className:`small${e===null?` on`:``}`,"aria-pressed":e===null,onClick:()=>n(null),children:`None`})]}),(0,B.jsx)(`div`,{className:`swatches`,children:Object.keys(of).map(t=>(0,B.jsx)(`button`,{type:`button`,className:`swatch${e===t?` on`:``}`,"aria-pressed":e===t,title:of[t].label,"aria-label":`Chats' names: ${of[t].label}`,onClick:()=>n(t),children:(0,B.jsx)(cf,{colour:t,children:`●`})},t))})]})})}function df(e,t){return sf(t.find(t=>t.name===e.project)?.colours,e.role)}var ff=[{id:`update`,label:`Update & restart`,part:`ledung`,settings:[{label:`Update Ledung`,about:`Gets what is new and restarts into it`,keywords:[`upgrade`,`version`,`release`,`new`]},{label:`Restart Ledung`,about:`Starts Ledung again on its newest version; sessions keep running`,keywords:[`reload`,`reboot`]},{label:`Shortcuts`,about:`A Ledung icon on the Desktop and in the Start menu, or in Applications`,keywords:[`desktop`,`icon`,`start menu`,`applications`,`launcher`,`dock`,`shortcut`]}]},{id:`claude`,label:`Claude & usage`,part:`ledung`,settings:[{label:`Accounts`,about:`The Claude accounts sessions run on`,keywords:[`claude`,`login`,`sign in`,`plan`,`subscription`]},{label:`Usage stops`,about:`Hold new turns when a plan window is this full`,keywords:[`usage`,`limit`,`quota`,`pause`,`window`,`percent`]},{label:`Claude Code`,about:`The Claude Code program sessions run`,keywords:[`cli`,`program`,`version`,`install`]},{label:`Publish usage`,about:`Send usage figures to a dashboard, per Claude account`,keywords:[`usage`,`dashboard`,`share`,`statistics`,`account`,`all accounts`,`repository`,`github`]}]},{id:`sessions`,label:`Sessions`,part:`ledung`,settings:[{label:`Skills`,about:`Which of your own skills managers and sessions get`,keywords:[`skill`,`plugins`,`commands`]},{label:`Session profiles`,storedIn:`config`,about:`Sets of tools and settings sessions start with`,keywords:[`profile`,`tools`,`mcp`]}]},{id:`macros`,label:`Macros`,part:`ledung`,settings:[{label:`Macros`,about:`Text you send often, as a chip in the info bar, a keybind, or both`,keywords:[`macro`,`shortcut`,`keybind`,`key`,`hotkey`,`chip`,`snippet`,`quick`,`text`]}]},{id:`remote`,label:`Remote & devices`,part:`ledung`,settings:[{label:`Computers`,about:`This computer's name and colour, and the others Ledung knows`,keywords:[`machine`,`colour`,`color`,`name`]},{label:`Remote access`,about:`Reach this Ledung from your phone, anywhere, through a relay`,keywords:[`phone`,`mobile`,`tunnel`,`internet`,`away`]},{label:`Phones`,about:`Phones that may open this Ledung`,keywords:[`phone`,`mobile`,`device`,`pair`]},{label:`Linked computers`,about:`Link this Ledung with another of yours`,keywords:[`link`,`machine`,`pair`,`device`]},{label:`Relay`,about:`Run a relay for other people`,keywords:[`server`,`host`,`tunnel`]},{label:`Message board`,about:`Managers post to each other on a shared board`,keywords:[`board`,`posts`,`messages`]}]},{id:`look`,label:`Look & feel`,part:`browser`,settings:[{label:`Appearance`,storedIn:`browser`,about:`Light, dark or the computer's own`,keywords:[`theme`,`dark`,`light`,`mode`,`colour`,`color`,`system`]},{label:`Autocorrect`,storedIn:`browser`,about:`Whether the browser corrects words as you type`,keywords:[`spelling`,`typing`,`spell`]},{label:`Status dot`,storedIn:`browser`,about:`The coloured dot by each session in the sidebar`,keywords:[`sidebar`,`dot`,`colour`,`color`]},{label:`Show "Archived" in the sidebar`,storedIn:`browser`,about:`The Archived entry under each project`,keywords:[`archive`,`sidebar`]},{label:`Compact sidebar`,storedIn:`browser`,about:`Smaller session cards in the sidebar`,keywords:[`sidebar`,`dense`,`small`,`cards`]},{label:`App`,storedIn:`browser`,about:`Install Ledung as an app`,keywords:[`install`,`pwa`,`desktop`,`icon`]}]},{id:`notifications`,label:`Notifications`,part:`browser`,settings:[{label:`Notifications`,storedIn:`browser`,about:`A browser notification when something needs your answer`,keywords:[`alert`,`notify`,`sound`,`popup`]}]},{id:`config`,label:`Config file`,part:`info`,settings:[{label:`Config file`,storedIn:`config`,about:`Ledung's config file and its problems`,keywords:[`json`,`port`,`file`,`settings`]}]},{id:`about`,label:`About`,part:`info`,settings:[{label:`About`,about:`Version and where Ledung runs from`,keywords:[`version`,`licence`,`license`]}]}],pf=ff[0].id,Z=e=>`settings:${e}`,mf={usageStop:`Usage stops`,claudeProblem:`Claude Code`,configProblem:`Config file`};function hf(e){let t=ff.find(t=>t.settings.some(t=>t.label===mf[e]));return t?Z(t.id):`settings`}function gf(e,t){if(e===`accounts`)return`claude`;let n=e?.startsWith(`settings:`)?e.slice(9):null;return n&&ff.some(e=>e.id===n)?n:t?null:pf}var _f=[{id:`general`,label:`General`,part:`ledung`,settings:[{label:`Name`,about:`The project's name in the sidebar`,keywords:[`rename`,`title`]},{label:`Claude account`,about:`The account its sessions run on`,keywords:[`account`,`login`,`plan`]},{label:`Model`,about:`The model its sessions use`,keywords:[`opus`,`sonnet`,`haiku`,`claude`]},{label:`Model for its manager`,about:`The model its manager uses`,keywords:[`opus`,`sonnet`,`haiku`,`claude`]},{label:`Permissions for new sessions`,about:`The permission mode new sessions start in`,keywords:[`permission`,`mode`,`auto`,`plan`,`accept`]},{label:`Extra folders`,about:`Folders outside the project its sessions may work in`,keywords:[`folder`,`directory`,`path`]},{label:`Publish its usage under its name`,about:`Published usage figures carry the project's name`,keywords:[`usage`,`dashboard`,`share`]},{label:`Usage repository`,about:`The repository its usage is published to, instead of this computer's default one`,keywords:[`usage`,`dashboard`,`share`,`repo`,`github`,`board`,`publish`]}]},{id:`safety`,label:`What always goes to you`,part:`ledung`,settings:[{label:`What always goes to you`,about:`Commands and paths that always ask you first`,keywords:[`sensitive`,`safety`,`ask`,`patterns`,`commands`,`production`]}]},{id:`powers`,label:`Manager's powers`,part:`ledung`,settings:[{label:`What the manager may decide for you`,about:`What its manager may answer in your place`,keywords:[`grant`,`decide`,`approve`,`manager`]},{label:`Its manager adds projects and starts or stops other managers without asking you`,keywords:[`projects`,`managers`,`manager`]},{label:`Its manager reads and changes workflow settings of your projects`,keywords:[`workflow`,`manager`]},{label:`Dev ship command`,about:`A command away mode may let through`,keywords:[`ship`,`deploy`,`publish`,`away`]},{label:`Lockdown`,about:`Keep its sessions off the network and out of other tools`,keywords:[`network`,`container`,`island`,`security`,`sandbox`]}]},{id:`skills`,label:`Skills & profiles`,part:`ledung`,settings:[{label:`Skills`,about:`Which of your own skills its manager and sessions get`,keywords:[`skill`,`plugins`,`commands`]},{label:`Profile for its manager`,about:`The session profile its manager starts with`,keywords:[`profile`,`tools`,`mcp`,`manager`]},{label:`Profile for its sessions`,about:`The session profile its sessions start with`,keywords:[`profile`,`tools`,`mcp`]}]},{id:`look`,label:`Look`,part:`ledung`,settings:[{label:`Manager name`,about:`Its manager's name colour in the sidebar`,keywords:[`colour`,`color`,`manager`]},{label:`Its sessions' names`,about:`Its sessions' name colour in the sidebar`,keywords:[`colour`,`color`]}]},{id:`workflow`,label:`Workflow`,part:`ledung`,settings:[{label:`Workflow`,about:`Whether it follows a written process, and which`,keywords:[`process`,`agent`]},{label:`Project config for the workflow`,about:`The process's config file for this project`,keywords:[`process`,`config`,`file`]}]},{id:`tickets`,label:`Tickets & questions`,part:`ledung`,settings:[{label:`Ticket pattern`,about:`What a ticket number looks like`,keywords:[`issue`,`ticket`,`jira`]},{label:`Ticket link`,about:`Where a ticket number links to`,keywords:[`issue`,`ticket`,`url`]},{label:`Question tiers`,about:`The order of its questions in Waiting for you`,keywords:[`questions`,`waiting`,`priority`,`order`]}]},{id:`board`,label:`Message board`,part:`ledung`,settings:[{label:`Use the board in this project`,about:`Its manager posts to and reads the message board`,keywords:[`board`,`posts`,`messages`]}]},{id:`remove`,label:`Remove project`,part:`info`,settings:[{label:`Remove project`,about:`Takes it off the list and stops its sessions; the folder is not touched`,keywords:[`delete`,`remove`]}]}],vf=[{id:`general`,label:`General`,part:`ledung`,settings:[{label:`Folder`,storedIn:`config`,about:`Where new chats start`,keywords:[`folder`,`directory`,`path`]},{label:`Permission mode`,storedIn:`config`,about:`The permission mode new chats start in`,keywords:[`permission`,`mode`,`auto`,`plan`]}]},{id:`safety`,label:`What always goes to you`,part:`ledung`,settings:[{label:`What always goes to you`,about:`Commands and paths that always ask you first`,keywords:[`sensitive`,`safety`,`ask`,`patterns`,`commands`,`production`]}]},{id:`look`,label:`Look`,part:`ledung`,settings:[{label:`Chats' names`,about:`The chats' name colour in the sidebar`,keywords:[`colour`,`color`]}]}];function yf(e){if(e===`chats`)return{project:null,group:null};if(e?.startsWith(`chats:`))return{project:null,group:e.slice(6)};if(!e?.startsWith(`ps:`))return null;let t=e.slice(3),n=t.indexOf(`/`);return n<0?{project:t,group:null}:{project:t.slice(0,n),group:t.slice(n+1)}}var bf=(e,t)=>e===null?`chats:${t}`:`ps:${e}/${t}`;function xf(e,t){let n=e.project===null?vf:_f;return e.group&&n.some(t=>t.id===e.group)?e.group:t?null:n[0].id}function Sf(e){return[{id:`ledung`,label:`Ledung`,view:`settings`},{id:`chats`,label:`Chats`,view:`chats`},...e.map(e=>({id:`ps:${e.name}`,label:e.name,view:`ps:${e.name}`})),{id:`add`,label:`+ Add project`,view:`add`}]}function Cf(e){if(!e)return null;if(e===`settings`||e===`accounts`||e.startsWith(`settings:`))return`ledung`;if(e===`add`)return e;let t=yf(e);return t?t.project===null?`chats`:`ps:${t.project}`:null}function wf(e){let t=!!e.remote;return{remote:t?`on`:`off`,phones:t?`on`:`needs`,linked:t?`on`:`needs`,relay:e.relaySetUp===null?`hidden`:e.relaySetUp?`on`:`off`,board:e.boardConfigured?`on`:`off`}}var Tf=e=>e?``:`off`;function Ef(e){return e?e.npm?{update:null,restart:`Starts Ledung again from the installed package, so an update with npm takes effect. Sessions keep running and reconnect.`}:{update:`Gets what is new on main from GitHub into the folder this release was built from, builds a new release and restarts into it. Sessions keep running and reconnect.`,restart:`Loads the newest release. Sessions keep running and reconnect.`}:{update:null,restart:`Starts Ledung again on its newest version. Sessions keep running and reconnect.`}}function Df(e){return e?e.npm?`from npm`:e.available?e.restarting?`restarting…`:e.updating?`updating…`:e.checking?`checking…`:e.check?e.check.upToDate?`up to date`:`${e.check.behind} new change${e.check.behind===1?``:`s`}`:`not checked`:`no updates here`:``}function Of(e){return[{id:`ledung`,label:`Ledung`,groups:ff,viewOf:Z},{id:`chats`,label:`Chats`,groups:vf,viewOf:e=>bf(null,e)},...e.map(e=>({id:`ps:${e.name}`,label:e.name,groups:_f,viewOf:t=>bf(e.name,t)}))]}var kf=e=>e.normalize(`NFD`).replace(/[̀-ͯ]/g,``).toLowerCase().replace(/[^\p{L}\p{N}]+/gu,` `).trim(),Af=e=>kf(e).split(` `).filter(Boolean),jf={label:4,keyword:3,group:2,about:1};function Mf(e,t,n=null){let r=Af(e);if(!r.length)return[];let i=r.join(` `),a=[],o=[...t.filter(e=>e.id===n),...t.filter(e=>e.id!==n)],s=0;for(let e of o)for(let t of e.groups){let n=Af(t.label);for(let o of t.settings){s++;let c=[[jf.label,Af(o.label)],[jf.keyword,(o.keywords??[]).flatMap(Af)],[jf.group,n],[jf.about,Af(o.about??``)]],l=0;for(let e of r){let t=Math.max(0,...c.filter(([,t])=>t.some(t=>t.startsWith(e))).map(([e])=>e));if(!t){l=0;break}l+=t}if(!l)continue;let u=kf(o.label);u===i?l+=10:` ${u} `.includes(` ${i}`)&&(l+=5),a.push({hit:{tab:e.id,tabLabel:e.label,group:t.id,groupLabel:t.label,label:o.label,about:o.about,storedIn:o.storedIn,view:e.viewOf(t.id)},score:l,order:s})}}return a.sort((e,t)=>t.score-e.score||e.order-t.order).map(e=>e.hit)}var Nf=(e,t,n)=>Mf(e,Of(t),n);function Pf(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null);(0,v.useEffect)(()=>{R.updateStatus().then(n,e=>i(e.message))},[e]);let a=!!t&&(t.checking||t.updating||t.restarting);return(0,v.useEffect)(()=>{if(!a)return;let e=setInterval(()=>R.updateStatus().then(n,()=>{}),1e3);return()=>clearInterval(e)},[a]),{view:t,error:r,act:e=>{i(null),e().then(n,e=>i(e.message))}}}function Ff(e){let[t,n]=(0,v.useState)(()=>typeof matchMedia==`function`&&matchMedia(e).matches);return(0,v.useEffect)(()=>{if(typeof matchMedia!=`function`)return;let t=matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function If(e){let t=Pf(e.hellos),n=Df(t.view),r=Cf(e.view),i=!!t.view?.check&&!t.view.check.upToDate,a=zf(r,e.projects,t=>{t!==e.view&&e.onOpen(t)});return(0,B.jsx)(Lf.Provider,{value:a,children:(0,B.jsxs)(`div`,{className:`page-view settings-frame`,children:[(0,B.jsxs)(`header`,{className:`session-head settings-head`,children:[(0,B.jsxs)(`div`,{className:`session-head-text`,children:[(0,B.jsx)(`h2`,{children:`Settings`}),(0,B.jsx)(`div`,{className:`muted`,children:`One place for Ledung, chats and every project.`})]}),(0,B.jsxs)(`div`,{className:`session-corner settings-version`,children:[(0,B.jsxs)(`span`,{className:`settings-state${i?` behind`:n===`up to date`?` ok`:``}`,title:e.source?`Running ${e.source.version}`:void 0,children:[`Ledung `,e.source?.version??``,n&&(0,B.jsxs)(B.Fragment,{children:[` · `,n]})]}),e.canRestart?(0,B.jsx)(Kf,{hellos:e.hellos}):(0,B.jsx)(`span`,{className:`muted`,title:`This Ledung was started by an older launcher. Restart it once from its console window (Ctrl+C, then Ledung.cmd).`,children:`Restart: from console`})]})]}),(0,B.jsx)(`nav`,{className:`settings-tabs`,role:`tablist`,"aria-label":`Settings`,children:Sf(e.projects).map(t=>(0,B.jsx)(`button`,{role:`tab`,"aria-selected":r===t.id,className:`settings-tab${r===t.id?` on`:``}${t.id===`add`?` add`:``}`,onClick:()=>{(r!==t.id||e.view!==t.view)&&e.onOpen(t.view)},children:t.label},t.id))}),(0,B.jsx)(`div`,{className:`settings-tab-body`,children:e.children(t)})]})})}var Lf=(0,v.createContext)(null),Rf=e=>e instanceof HTMLElement&&(e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`);function zf(e,t,n){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(null),s=(0,v.useRef)(null),c=(0,v.useMemo)(()=>Nf(r,t,e),[r,t,e]),l=(0,v.useRef)(r);return l.current=r,(0,v.useEffect)(()=>{let e=e=>{e.defaultPrevented||e.isComposing||(e.key===`Escape`&&l.current?(e.preventDefault(),i(``),s.current?.focus()):e.key===`/`&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&!Rf(e.target)&&s.current&&(e.preventDefault(),s.current.focus(),s.current.select()))};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[]),{query:r,setQuery:i,hits:c,input:s,tab:e,target:a,choose:e=>{i(``),o({tab:e.tab,group:e.group,label:e.label,n:Date.now()}),n(e.view)},reached:e=>o(t=>t?.n===e?null:t)}}var Bf=`section h3, section h4, label.toggle, .compact-slider > span, .offline-name, .field-name`;function Vf(e,t){if(!e)return null;let n=kf(t),r=[...e.querySelectorAll(Bf)].find(e=>{let t=kf(e.textContent??``);return t===n||t===`run a ${n}`});return r?r.closest(`.field, .offline`)??r.closest(`label, details, .compact-slider`)??r:null}var Q=2500,Hf=2e3;function Uf({search:e}){let t=z();return(0,B.jsxs)(`div`,{className:`settings-search`,children:[(0,B.jsx)(`span`,{className:`settings-search-icon`,"aria-hidden":!0,children:`⌕`}),(0,B.jsx)(`input`,{ref:e.input,type:`search`,placeholder:`Search settings`,"aria-label":`Search settings`,value:e.query,...t,onChange:t=>e.setQuery(t.target.value),onKeyDown:t=>{t.key===`Enter`&&e.hits[0]&&(t.preventDefault(),e.choose(e.hits[0])),t.key===`ArrowDown`&&(t.preventDefault(),document.querySelector(`.search-results button`)?.focus())}}),e.query?(0,B.jsx)(`button`,{type:`button`,className:`settings-search-clear`,"aria-label":`Clear search`,title:`Clear search`,onClick:()=>{e.setQuery(``),e.input.current?.focus()},children:`×`}):(0,B.jsx)(`kbd`,{children:`/`})]})}function Wf({search:e}){let t=e.query.trim();return e.hits.length?(0,B.jsxs)(`div`,{className:`search-results`,role:`region`,"aria-label":`Search results`,children:[(0,B.jsxs)(`p`,{className:`muted`,children:[e.hits.length,` setting`,e.hits.length===1?``:`s`,` match "`,t,`"`]}),(0,B.jsx)(`ul`,{children:e.hits.map(t=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{className:`search-hit`,onClick:()=>e.choose(t),onKeyDown:t=>{let n=t.currentTarget.parentElement,r=t.key===`ArrowDown`?n?.nextElementSibling:t.key===`ArrowUp`?n?.previousElementSibling:void 0;r!==void 0&&(t.preventDefault(),r?r.querySelector(`button`)?.focus():t.key===`ArrowUp`&&e.input.current?.focus())},children:[(0,B.jsxs)(`span`,{className:`search-hit-name`,children:[t.label,t.storedIn&&(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(qf,{kind:t.storedIn})]})]}),(0,B.jsxs)(`span`,{className:`search-hit-path`,children:[t.tabLabel,` › `,t.groupLabel]}),t.about&&(0,B.jsx)(`span`,{className:`search-hit-about muted`,children:t.about})]})},`${t.tab}/${t.group}/${t.label}`))})]}):(0,B.jsx)(`div`,{className:`search-results`,role:`region`,"aria-label":`Search results`,children:(0,B.jsxs)(`p`,{className:`muted`,children:[`No setting matches "`,t,`".`]})})}var Gf=6e4;function Kf({hellos:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(`idle`),[a,o]=(0,v.useState)(0);return(0,v.useEffect)(()=>{r===`restarting`&&e>a&&i(`idle`)},[r,e,a]),(0,v.useEffect)(()=>{if(r!==`restarting`)return;let e=setTimeout(()=>i(`timeout`),Gf);return()=>clearTimeout(e)},[r]),r===`restarting`?(0,B.jsx)(`span`,{className:`muted`,children:`Restarting…`}):t?(0,B.jsxs)(`span`,{className:`restart-confirm`,children:[(0,B.jsx)(`span`,{className:`muted`,children:`Sessions keep running and reconnect.`}),(0,B.jsx)(`button`,{className:`small primary`,onClick:async()=>{o(e),n(!1),i(`restarting`);try{await R.restart()}catch{i(`failed`),n(!1)}},children:`Restart`}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>n(!1),children:`Cancel`})]}):(0,B.jsxs)(`span`,{className:`restart-confirm`,children:[r===`failed`&&(0,B.jsx)(`span`,{className:`restart-problem`,children:`The restart was refused.`}),r===`timeout`&&(0,B.jsx)(`span`,{className:`restart-problem`,children:`Ledung hasn't come back yet. Check its console window.`}),(0,B.jsx)(`button`,{className:`small`,title:`Restart Ledung on its newest version`,onClick:()=>{i(`idle`),n(!0)},children:`Restart Ledung`})]})}function qf({kind:e}){return(0,B.jsx)(`span`,{className:`where ${e}`,title:e===`browser`?`Kept in this browser only: another browser or device has its own`:`Read from Ledung's config file`,children:e===`browser`?`this browser`:`config`})}function Jf(e){let t=(0,v.useContext)(Lf),n=!!t?.query.trim(),r=(0,v.useRef)(null),i=t?.target,a=!!i&&i.tab===t.tab&&i.group===e.current&&!n;(0,v.useEffect)(()=>{if(!a||!i||!t)return;let e=Date.now(),n,o=()=>{let a=Vf(r.current,i.label);a?(a.classList.add(`search-found`),a.scrollIntoView({block:`center`}),setTimeout(()=>a.classList.remove(`search-found`),Q),t.reached(i.n)):Date.now()-e<Hf?n=setTimeout(o,100):t.reached(i.n)};return o(),()=>clearTimeout(n)},[a,i?.n]);let o=(0,B.jsxs)(`div`,{className:`settings-side`,children:[t&&(0,B.jsx)(Uf,{search:t}),n&&e.current===null?(0,B.jsx)(Wf,{search:t}):(0,B.jsx)(Yf,{...e})]});if(e.current===null)return(0,B.jsxs)(`div`,{className:`settings-split narrow`,children:[o,e.foot]});let s=e.groups.find(t=>t.id===e.current)?.label??``;return(0,B.jsxs)(`div`,{className:`settings-split${e.narrow?` narrow`:``}`,children:[!e.narrow&&o,(0,B.jsxs)(`div`,{className:`settings-main`,children:[n&&!e.narrow&&(0,B.jsx)(Wf,{search:t}),(0,B.jsxs)(`div`,{className:`settings-content`,role:`region`,"aria-label":s,ref:r,hidden:n&&!e.narrow,children:[e.narrow&&(0,B.jsxs)(`div`,{className:`settings-group-head`,children:[(0,B.jsx)(`button`,{className:`small`,onClick:()=>e.onOpen(null),children:`← All settings`}),(0,B.jsx)(`h3`,{children:s})]}),e.children]}),e.foot]})]})}function Yf(e){return(0,B.jsx)(`nav`,{className:`settings-menu`,"aria-label":`Settings groups`,children:e.groups.map((t,n)=>{let r=n>0&&e.groups[n-1].part!==t.part,i=e.marked?.has(t.id);return(0,B.jsxs)(v.Fragment,{children:[r&&(0,B.jsx)(`div`,{className:`settings-menu-sep`}),r&&t.part===`browser`&&(0,B.jsx)(`div`,{className:`settings-menu-cap`,children:`This browser`}),(0,B.jsxs)(`button`,{className:`settings-menu-item${e.current===t.id?` on`:``}${t.id===`remove`?` danger`:``}`,"aria-current":e.current===t.id?`page`:void 0,onClick:()=>e.onOpen(t.id),children:[(0,B.jsxs)(`span`,{children:[t.label,i&&(0,B.jsx)(`span`,{className:`unsaved-mark`,title:`Changed, not saved yet`,"aria-label":`(not saved)`,children:` •`})]}),(0,B.jsxs)(`span`,{className:`muted`,children:[e.words[t.id]??``,e.narrow&&` ›`]})]})]},t.id)})})}function Xf(e){return!e.count&&!e.saved?null:(0,B.jsxs)(`div`,{className:`save-bar`,role:`region`,"aria-label":`Unsaved changes`,children:[(0,B.jsxs)(`span`,{className:`muted`,children:[e.count?`${e.count} unsaved change${e.count===1?``:`s`}`:`Saved.`,e.count>0&&(0,B.jsxs)(B.Fragment,{children:[` · `,e.note]}),e.count>0&&e.disabled&&(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(`span`,{className:`error`,children:e.disabled})]})]}),(0,B.jsx)(`span`,{className:`grow`}),e.count>0&&(0,B.jsx)(`button`,{className:`small`,disabled:e.busy,onClick:e.onDiscard,children:`Discard`}),e.count>0&&(0,B.jsx)(`button`,{className:`small primary`,disabled:e.busy||!!e.disabled,onClick:e.onSave,children:e.busy?`Saving…`:`Save`})]})}function Zf({follows:e,text:t,onReset:n}){return(0,B.jsxs)(`span`,{className:`inherit${e?``:` over`}`,children:[t,!e&&(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(`button`,{type:`button`,className:`link`,onClick:e=>{e.preventDefault(),n()},children:`Reset`})]})]})}var Qf=`(max-width: 760px)`;function $f(e,t){if(e===`width`){let e=Math.max(220,Math.floor(t/2));return{min:220,max:e,def:Math.min(290,e)}}let n=Math.max(120,Math.floor(t*.75));return{min:120,max:n,def:Math.min(n,Math.max(120,Math.floor(t*.55)))}}function ep(e,t,n){return Math.round(Math.min(n,Math.max(t,e)))}function tp(e){let t=e==null?NaN:Number(e);return Number.isFinite(t)&&t>0?t:null}function np(e,t,n,r,i){return e===(t===`width`?`ArrowRight`:`ArrowDown`)?ep(n+20,r,i):e===(t===`width`?`ArrowLeft`:`ArrowUp`)?ep(n-20,r,i):e===`Home`?r:e===`End`?i:null}function rp(e,t){let[n,r]=(0,v.useState)(e),[i,a]=(0,v.useState)(e),o=JSON.stringify(e);return(0,v.useEffect)(()=>{r(e),a(r=>t(n,r)?r:e)},[o]),{saved:n,value:i,set:a,done:e=>{r(e),a(e)},discard:()=>a(n)}}var ip=(e=``)=>({name:e,account:``,model:``,managerModel:``,permissionMode:``,managerGrant:``,projectToolsUnasked:!1,projectSettingsTools:!1,publishUsageName:!1,usageRepo:``,managerProfile:``,sessionProfile:``,skills:{},...M({commandPatterns:[],pathPatterns:[]}),devShipCommand:``,ticketPattern:``,ticketUrl:``,questionTiers:te.join(`
57
- `),extraFolders:``,workflowUse:null,workflowName:``,workflowConfig:``,lockdownLevel:`off`,lockdownBoard:!1,lockdownRemoteControl:!1,lockdownNetwork:``,lockdownDockerNetwork:``});function ap(e){return{name:e.name,account:e.account??``,model:e.model??``,managerModel:e.managerModel??``,permissionMode:e.permissionMode??``,managerGrant:e.managerGrant??``,projectToolsUnasked:e.projectToolsUnasked,projectSettingsTools:e.projectSettingsTools===!0,publishUsageName:e.publishUsageName===!0,usageRepo:e.usageRepo??``,managerProfile:e.profiles.manager??``,sessionProfile:e.profiles.session??``,skills:e.skills,commandPatterns:e.sensitive.commandPatterns,pathPatterns:e.sensitive.pathPatterns,devShipCommand:e.devShipCommand??``,ticketPattern:e.tickets?.pattern??``,ticketUrl:e.tickets?.url??``,questionTiers:e.questionTiers.join(`
58
- `),extraFolders:e.extraFolders.join(`
59
- `),workflowUse:e.workflow?.use??null,workflowName:e.workflow?.name??``,workflowConfig:e.workflow?.projectConfig??``,lockdownLevel:e.lockdown.level,lockdownBoard:e.lockdown.board,lockdownRemoteControl:e.lockdown.remoteControl,lockdownNetwork:(e.lockdown.network??[]).join(`
60
- `),lockdownDockerNetwork:e.lockdown.dockerNetwork??``}}function op(e,t){return{name:e.name.trim(),...e.model.trim()?{model:e.model.trim()}:{},...e.managerModel.trim()?{managerModel:e.managerModel.trim()}:{},...e.permissionMode?{permissionMode:e.permissionMode}:{},...e.managerGrant.trim()?{managerGrant:e.managerGrant.trim()}:{},...e.projectToolsUnasked?{projectToolsUnasked:!0}:{},...e.projectSettingsTools?{projectSettingsTools:!0}:{},...e.publishUsageName?{publishUsageName:!0}:{},...e.usageRepo.trim()?{usageRepo:e.usageRepo.trim()}:{},...e.managerProfile||e.sessionProfile?{profiles:{...e.managerProfile?{manager:e.managerProfile}:{},...e.sessionProfile?{session:e.sessionProfile}:{}}}:{},...sp(e.skills)?{skills:e.skills}:{},sensitive:{commandPatterns:e.commandPatterns,pathPatterns:e.pathPatterns,mcpTools:t?.sensitive.mcpTools??[]},...e.devShipCommand.trim()?{devShipCommand:e.devShipCommand.trim()}:{},...e.ticketPattern.trim()&&e.ticketUrl.trim()?{tickets:{pattern:e.ticketPattern.trim(),url:e.ticketUrl.trim()}}:{},...lp(cp(e.questionTiers),te)||!cp(e.questionTiers).length?{}:{questionTiers:cp(e.questionTiers)},...cp(e.extraFolders).length?{extraFolders:cp(e.extraFolders)}:{},...e.account?{account:e.account}:{},...e.workflowUse!==null||e.workflowName||e.workflowConfig.trim()?{workflow:{...e.workflowUse===null?{}:{use:e.workflowUse},...e.workflowName?{name:e.workflowName}:{},...e.workflowConfig.trim()?{projectConfig:e.workflowConfig.trim()}:{}}}:{},...e.lockdownLevel===`off`?{}:{lockdown:{level:e.lockdownLevel,...e.lockdownBoard?{board:!0}:{},...e.lockdownRemoteControl?{remoteControl:!0}:{},...cp(e.lockdownNetwork).length?{network:cp(e.lockdownNetwork)}:{},...e.lockdownDockerNetwork.trim()?{dockerNetwork:e.lockdownDockerNetwork.trim()}:{}}}}}var sp=e=>Object.values(e).some(e=>e&&(e.newSkills||e.on?.length||e.off?.length)),cp=e=>[...new Set(e.split(`
61
- `).map(e=>e.trim()).filter(Boolean))],lp=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),up=(e,t)=>e.workflowUse??!t;function dp(e,t,n){return t?{...e,workflowUse:n?!0:null,workflowName:t}:{...e,workflowUse:n?null:!1,workflowName:``}}var fp={name:`general`,account:`general`,model:`general`,managerModel:`general`,permissionMode:`general`,extraFolders:`general`,publishUsageName:`general`,usageRepo:`general`,commandPatterns:`safety`,pathPatterns:`safety`,managerGrant:`powers`,projectToolsUnasked:`powers`,projectSettingsTools:`powers`,devShipCommand:`powers`,lockdownLevel:`powers`,lockdownBoard:`powers`,lockdownRemoteControl:`powers`,lockdownNetwork:`powers`,lockdownDockerNetwork:`powers`,skills:`skills`,managerProfile:`skills`,sessionProfile:`skills`,workflowUse:`workflow`,workflowName:`workflow`,workflowConfig:`workflow`,ticketPattern:`tickets`,ticketUrl:`tickets`,questionTiers:`tickets`},pp=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function mp(e,t){return Object.keys(fp).filter(n=>!pp(e[n],t[n]))}function hp(e,t){return e===``||typeof e==`object`&&!sp(e)?{follows:!0,text:`Ledung default: ${t}`}:{follows:!1,text:`Overrides Ledung (${t})`}}var gp={account:``,model:``,managerModel:``,permissionMode:``,skills:{},managerProfile:``,sessionProfile:``};function _p(e,t){let n=e?.groups.find(e=>e.workflow===t)??e?.groups.find(e=>e.workflow===null);return{manager:n?.defaults.manager??`full`,session:n?.defaults.session??`full`}}var vp={default:`Ask`,acceptEdits:`Accept edits`,auto:`Auto`,plan:`Plan`};function yp({name:e,hint:t,line:n,children:r}){let i=(0,v.useId)();return(0,B.jsxs)(`div`,{className:`field`,children:[(0,B.jsxs)(`label`,{htmlFor:i,children:[(0,B.jsx)(`span`,{className:`field-name`,children:e}),t&&(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(`span`,{className:`muted`,children:t})]})]}),n,r(i)]})}function bp(e,t,n){if(!e.defaults)return null;let r=hp(e.value[t],n);return(0,B.jsx)(Zf,{follows:r.follows,text:r.text,onReset:()=>e.onChange({...e.value,[t]:gp[t]})})}var xp=(e,t)=>n=>e.onChange({...e.value,[t]:n.target.value});function Sp(e){let t=z();return(0,B.jsx)(yp,{name:`Name`,children:n=>(0,B.jsx)(`input`,{id:n,...t,value:e.value.name,onChange:xp(e,`name`),maxLength:48,placeholder:`e.g. Website`})})}function Cp(e){return(0,B.jsx)(yp,{name:`Claude account`,hint:`(for its manager and all its sessions)`,line:bp(e,`account`,`this computer's own login`),children:t=>(0,B.jsxs)(`select`,{id:t,value:e.value.account,onChange:xp(e,`account`),children:[(0,B.jsx)(`option`,{value:``,children:`default: this computer's own login`}),e.accounts.map(t=>(0,B.jsxs)(`option`,{value:t.name,disabled:e.container&&t.kind===`folder`,children:[t.name,t.email?` (${t.email})`:``,e.container&&t.kind===`folder`?` — login folders work only on this computer`:``]},t.name))]})})}function wp(e){let t=z();return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(yp,{name:`Model`,hint:`(empty: from the project's Claude settings, else Claude Code's default)`,line:bp(e,`model`,`the project's Claude settings, else Claude Code's`),children:n=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`input`,{id:n,...t,value:e.value.model,onChange:xp(e,`model`),list:`ledung-models`,placeholder:`opus, sonnet, haiku or a full model name`}),(0,B.jsxs)(`datalist`,{id:`ledung-models`,children:[(0,B.jsx)(`option`,{value:`opus`}),(0,B.jsx)(`option`,{value:`sonnet`}),(0,B.jsx)(`option`,{value:`haiku`})]})]})}),(0,B.jsx)(yp,{name:`Model for its manager`,hint:`(empty: the same as its sessions)`,line:bp(e,`managerModel`,`the same as its sessions`),children:n=>(0,B.jsx)(`input`,{id:n,...t,value:e.value.managerModel,onChange:xp(e,`managerModel`),list:`ledung-models`,placeholder:`opus, sonnet, haiku or a full model name`})})]})}function Tp(e){return(0,B.jsx)(yp,{name:`Permissions for new sessions`,line:bp(e,`permissionMode`,`Ask`),children:t=>(0,B.jsxs)(`select`,{id:t,value:e.value.permissionMode,onChange:xp(e,`permissionMode`),children:[(0,B.jsx)(`option`,{value:``,children:`Ask (default)`}),b.filter(e=>e!=="default").map(e=>(0,B.jsx)(`option`,{value:e,children:vp[e]},e))]})})}function Ep(e){let t=z();return(0,B.jsx)(yp,{name:`Extra folders`,hint:`(full paths, one per line: besides the project folder and folders inside it, its manager may start sessions in folders under these, such as where its git worktrees go. Empty: none)`,children:n=>(0,B.jsx)(`textarea`,{id:n,...t,rows:2,value:e.value.extraFolders,onChange:xp(e,`extraFolders`),className:`mono`})})}function Dp(e){let t=z();return(0,B.jsx)(yp,{name:`What the manager may decide for you`,hint:`(empty: it asks you about everything)`,children:n=>(0,B.jsx)(`textarea`,{id:n,...t,rows:2,value:e.value.managerGrant,onChange:xp(e,`managerGrant`),placeholder:`e.g. Ordinary development decisions: code structure, naming, which tests to add.`})})}function Op(e){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{className:`toggle`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e.value.projectToolsUnasked,onChange:t=>e.onChange({...e.value,projectToolsUnasked:t.target.checked})}),` `,(0,B.jsx)(`span`,{className:`field-name`,children:`Its manager adds projects and starts or stops other managers without asking you`})]}),(0,B.jsxs)(`label`,{className:`toggle`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e.value.projectSettingsTools,onChange:t=>e.onChange({...e.value,projectSettingsTools:t.target.checked})}),` `,(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`span`,{className:`field-name`,children:`Its manager reads and changes workflow settings of your projects`}),` `,(0,B.jsx)(`span`,{className:`muted`,children:`(not locked ones; a new grant, a new dev ship command or a sensitive pattern removed still asks you)`})]})]})]})}function kp(e){let t=z();return(0,B.jsx)(yp,{name:`Dev ship command`,hint:`(a pattern the whole command must match, e.g. npm run ship:dev; while you're away and allow dev ship, the manager may run it. Empty: never)`,children:n=>(0,B.jsx)(`input`,{id:n,...t,value:e.value.devShipCommand,onChange:xp(e,`devShipCommand`),className:`mono`})})}function Ap(e){let t=e.role===`manager`?`managerProfile`:`sessionProfile`,n=e.value[t],r=n&&!e.profiles.includes(n)?[...e.profiles,n]:e.profiles;return(0,B.jsx)(yp,{name:e.role===`manager`?`Profile for its manager`:`Profile for its sessions`,hint:`(what it gets of your own plugins, MCP servers and tools; Ledung's tools always stay)`,line:e.defaults&&bp(e,t,e.defaults.profiles[e.role]),children:i=>(0,B.jsxs)(`select`,{id:i,value:n,onChange:xp(e,t),children:[(0,B.jsx)(`option`,{value:``,children:`default (from the config)`}),r.map(t=>(0,B.jsxs)(`option`,{value:t,children:[t,e.profiles.includes(t)?``:` — not in the config`]},t))]})})}function jp(e){let{list:t,error:n}=tf(e.project);return(0,B.jsxs)(`div`,{className:`field`,children:[e.defaults&&bp(e,`skills`,`Settings → Sessions → Skills${t?`, ${rf(t,{},t.defaults)}`:``}`),(0,B.jsxs)(`details`,{className:`skills-choice`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(`span`,{className:`field-name`,children:`Skills`}),t?`: ${rf(t,e.value.skills,t.defaults)}`:``,` `,(0,B.jsx)(`span`,{className:`muted`,children:`(which of your own skills its manager and sessions get; unchosen ones follow Settings)`})]}),(0,B.jsx)(nf,{list:t,error:n,value:e.value.skills,onChange:t=>e.onChange({...e.value,skills:t}),defaults:t?.defaults??{}})]})]})}function Mp(e,t,n){let[r,i]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let r=!0;return R.workflowCheck(e,t.trim()||void 0,n||void 0).then(e=>{r&&i(e)},()=>{}),()=>{r=!1}},[e,t,n]),r}function Np({check:e,settings:t,container:n}){return!e?.on||!up(t,n)||e.exists!==!1?null:(0,B.jsxs)(`p`,{className:`banner`,children:[`This project has no `,(0,B.jsx)(`span`,{className:`mono`,children:e.projectConfig}),`. Its sessions will follow the process but stop where it needs the project's settings. Write that file, or choose None as its workflow.`]})}function Pp(e){let t=z(),{workflow:n,container:r}=e;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(yp,{name:`Workflow`,hint:`(its sessions are told to read the process first)`,children:t=>(0,B.jsxs)(`select`,{id:t,value:up(e.value,r)?e.value.workflowName||n.workflows[0]:``,onChange:t=>e.onChange(dp(e.value,t.target.value,r)),children:[(0,B.jsx)(`option`,{value:``,children:`None`}),n.workflows.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e)),e.value.workflowName&&!n.workflows.includes(e.value.workflowName)&&(0,B.jsxs)(`option`,{value:e.value.workflowName,children:[e.value.workflowName,` (not in the config)`]})]})}),up(e.value,r)&&n.on&&(0,B.jsx)(yp,{name:`Project config for the workflow`,hint:`(inside the project folder; empty: ${n.projectConfig})`,children:n=>(0,B.jsx)(`input`,{id:n,...t,value:e.value.workflowConfig,onChange:xp(e,`workflowConfig`),className:`mono`})})]})}function Fp(e){let t=z();return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(yp,{name:`Ticket pattern`,hint:`(e.g. [A-Z]+-\\d+)`,children:n=>(0,B.jsx)(`input`,{id:n,...t,value:e.value.ticketPattern,onChange:xp(e,`ticketPattern`),className:`mono`})}),(0,B.jsx)(yp,{name:`Ticket link`,hint:`({id} is replaced by the ticket)`,children:n=>(0,B.jsx)(`input`,{id:n,...t,value:e.value.ticketUrl,onChange:xp(e,`ticketUrl`),className:`mono`,placeholder:`https://tracker.example/browse/{id}`})})]})}function Ip(e){let t=z();return(0,B.jsx)(yp,{name:`Question tiers`,hint:`(one per line, first first: every question gives one, and Waiting for you groups them in this order. Never empty: clearing it brings back the five standard ones)`,children:n=>(0,B.jsx)(`textarea`,{id:n,...t,rows:5,value:e.value.questionTiers,onChange:xp(e,`questionTiers`),onBlur:()=>{cp(e.value.questionTiers).length||e.onChange({...e.value,questionTiers:te.join(`
62
- `)})}})})}function Lp({value:e,onChange:t,heading:n=!0}){let r=z(),[i,a]=(0,v.useState)(`command`),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(null),u=[...e.commandPatterns.map(e=>({kind:`command`,pattern:e})),...e.pathPatterns.map(e=>({kind:`path`,pattern:e}))],d=j(e.commandPatterns,e.pathPatterns),f=n=>t({...e,commandPatterns:n.kind===`command`?e.commandPatterns.filter(e=>e!==n.pattern):e.commandPatterns,pathPatterns:n.kind===`path`?e.pathPatterns.filter(e=>e!==n.pattern):e.pathPatterns}),p=()=>{let n=o.trim();if(n){try{new RegExp(n,`i`)}catch(e){l(`Not a valid regular expression: ${e.message}`);return}l(null),s(``),t(i===`command`?{...e,commandPatterns:e.commandPatterns.includes(n)?e.commandPatterns:[...e.commandPatterns,n]}:{...e,pathPatterns:e.pathPatterns.includes(n)?e.pathPatterns:[...e.pathPatterns,n]})}};return(0,B.jsxs)(`div`,{className:`sensitive-list`,children:[(0,B.jsx)(`p`,{children:n?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`strong`,{children:`Always goes to you`}),` `,(0,B.jsx)(`span`,{className:`muted`,children:`(no session, manager or "for this session" permission can allow these; you decide each time, in every permission mode)`})]}):(0,B.jsx)(`span`,{className:`muted`,children:`No session, manager or "for this session" permission can allow these; you decide each time, in every permission mode.`})}),u.length===0&&(0,B.jsx)(`p`,{className:`muted`,children:`Nothing is sensitive here; every action is decided by the permission mode and the manager.`}),(0,B.jsx)(`ul`,{children:u.map(e=>{let t=A(e.pattern,e.kind);return(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`span`,{className:`sensitive-entry`,children:[(0,B.jsx)(`span`,{children:t??(e.kind===`command`?`Commands matching`:`Files matching`)}),(0,B.jsx)(`code`,{className:t?`muted`:void 0,children:e.pattern})]}),(0,B.jsx)(`button`,{type:`button`,className:`small deny`,onClick:()=>f(e),"aria-label":`Delete: ${t??e.pattern}`,children:`Delete`})]},e.kind+e.pattern)})}),d.length>0&&(0,B.jsx)(`p`,{children:(0,B.jsxs)(`button`,{type:`button`,className:`small`,onClick:()=>t(M(e)),children:[`Add suggested (`,d.length,` of `,ee.length,` not in the list)`]})}),(0,B.jsxs)(`div`,{className:`sensitive-add`,children:[(0,B.jsxs)(`select`,{value:i,onChange:e=>a(e.target.value),"aria-label":`What the pattern is matched against`,children:[(0,B.jsx)(`option`,{value:`command`,children:`A command`}),(0,B.jsx)(`option`,{value:`path`,children:`A file path`})]}),(0,B.jsx)(`input`,{...r,className:`mono`,value:o,placeholder:`regular expression, e.g. \\bmigrate:prod\\b`,onChange:e=>{s(e.target.value),l(null)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),p())}}),(0,B.jsx)(`button`,{type:`button`,className:`small`,onClick:p,disabled:!o.trim(),children:`Add`})]}),c&&(0,B.jsx)(`p`,{className:`error`,children:c})]})}function Rp({value:e,onChange:t,accounts:n,profiles:r,container:i,workflow:a,lockdownB:o}){let s={value:e,onChange:t};return(0,B.jsxs)(`div`,{className:`form`,children:[(0,B.jsx)(Sp,{...s}),(0,B.jsx)(Cp,{...s,accounts:n,container:i}),(0,B.jsx)(wp,{...s}),(0,B.jsx)(Tp,{...s}),(0,B.jsx)(Dp,{...s}),(0,B.jsx)(Op,{...s}),(0,B.jsx)(jd,{value:e,onChange:t}),(0,B.jsx)(zp,{value:e,onChange:t,levelB:o,container:i}),(0,B.jsx)(Ap,{...s,role:`manager`,profiles:r}),(0,B.jsx)(Ap,{...s,role:`session`,profiles:r}),(0,B.jsx)(jp,{...s,project:void 0}),!!a?.workflows.length&&(0,B.jsx)(Pp,{...s,workflow:a,container:!!i}),(0,B.jsxs)(`details`,{children:[(0,B.jsxs)(`summary`,{children:[`More: actions that always go to you, tickets, question tiers`,i?``:` and extra folders`]}),(0,B.jsx)(Lp,{value:e,onChange:t}),(0,B.jsx)(kp,{...s}),(0,B.jsx)(Fp,{...s}),(0,B.jsx)(Ip,{...s}),!i&&(0,B.jsx)(Ep,{...s})]})]})}function zp({value:e,onChange:t,levelB:n,container:r}){let i=z(),a=e.lockdownLevel!==`off`,o=e.lockdownLevel===`B`;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{className:`field-name`,children:`Lockdown`}),` `,(0,B.jsx)(`span`,{className:`muted`,children:`(walls the project off from other projects' managers and sessions; only you can turn it off or down again)`}),(0,B.jsxs)(`select`,{value:e.lockdownLevel,onChange:n=>t({...e,lockdownLevel:n.target.value}),children:[(0,B.jsx)(`option`,{value:`off`,children:`Off (default): managers and sessions reach it as usual`}),(0,B.jsx)(`option`,{value:`A`,children:`Level A: nothing reaches in; it may still reach out`}),(0,B.jsxs)(`option`,{value:`B`,disabled:!!n&&!o,children:[`Level B, nearly air-gapped: nothing reaches in or out`,n?`: not available here`:``]})]})]}),n&&(0,B.jsx)(`p`,{className:`muted`,children:n}),a&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`muted`,children:`Other projects' managers see only its name: they can't message it (except, at level A, to answer each of its messages once), start or stop its manager, or use its folders. While a project is locked, every other session on this computer is kept out of its folders: file tools on every system, and shell commands run in Claude Code's sandbox on macOS and Linux (not on Windows, where only the file tools are stopped). Running sessions take it when Ledung restarts them, which it does as soon as each is free; their conversations are kept.`}),o&&(0,B.jsxs)(`p`,{className:`muted`,children:[`Level B also closes the way out. Its manager has no tools for other managers, other projects or the board. Its sessions get none of your MCP servers, plugins, connectors or own settings, no web tools, and can't read outside their folders.`,r?` Its container is checked before every start: only the project folder mounted, no Docker socket, and only the network you mark below.`:` Their shell commands run in the sandbox with no network but the hosts below.`,` `,`Only what Claude Code and a shell need of Ledung's environment is passed on.`]}),!o&&(0,B.jsxs)(`label`,{className:`toggle`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e.lockdownBoard,onChange:n=>t({...e,lockdownBoard:n.target.checked})}),` `,`Keep the message board on for it`]}),(0,B.jsxs)(`label`,{className:`toggle`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e.lockdownRemoteControl,onChange:n=>t({...e,lockdownRemoteControl:n.target.checked})}),` `,`Keep Remote Control for its manager`]}),o&&!r&&(0,B.jsxs)(`label`,{children:[`Hosts its shell commands may reach `,(0,B.jsx)(`span`,{className:`muted`,children:`(one per line, such as registry.npmjs.org or *.example.com; empty: no network)`}),(0,B.jsx)(`textarea`,{...i,rows:3,value:e.lockdownNetwork,onChange:n=>t({...e,lockdownNetwork:n.target.value})})]}),o&&r&&(0,B.jsxs)(`label`,{children:[`Its island network `,(0,B.jsx)(`span`,{className:`muted`,children:`(the Docker network its container may be on; mark it only once it reaches nothing but what the project may)`}),(0,B.jsx)(`input`,{...i,value:e.lockdownDockerNetwork,onChange:n=>t({...e,lockdownDockerNetwork:n.target.value})})]})]})]})}function Bp(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),s=t=>{i(null),o(!0),e.load(t).then(n,e=>i(e.message)).finally(()=>o(!1))};return(0,v.useEffect)(()=>s(e.start),[e.reloadKey,e.start]),(0,B.jsxs)(`div`,{className:`browser`,children:[r&&(0,B.jsx)(`p`,{className:`error`,children:r}),a&&(0,B.jsx)(`p`,{className:`muted`,children:`Loading folders…`}),t&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`browser-head`,children:[(0,B.jsx)(`button`,{className:`small`,disabled:!t.parent,onClick:()=>s(t.parent??void 0),title:`One folder up`,children:`↑ Up`}),(0,B.jsx)(`span`,{className:`mono browser-path`,children:t.path})]}),t.roots.length>1&&(0,B.jsx)(`div`,{className:`browser-roots`,children:t.roots.map(e=>(0,B.jsx)(`button`,{className:`small`,onClick:()=>s(e),children:e},e))}),(0,B.jsxs)(`ul`,{className:`browser-list`,children:[!t.entries.length&&(0,B.jsx)(`li`,{className:`muted`,children:`No folders here.`}),t.entries.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`button`,{className:`link`,onClick:()=>s(e.path),children:[`📁 `,e.name]}),e.git!==null&&(0,B.jsxs)(`span`,{className:`muted`,children:[` · git`,e.git?` · ${e.git}`:``]}),e.project&&(0,B.jsxs)(`span`,{className:`chip`,children:[`project `,e.project]})]},e.path))]}),(0,B.jsx)(`div`,{className:`browser-foot`,children:(0,B.jsx)(`button`,{className:`primary`,onClick:()=>e.onPick(t.path),children:e.pickLabel})})]})]})}function Vp({run:e,onAdded:t,accounts:n,defaultAccount:r,profiles:i,lockdownB:a}){let o=z(),[s,c]=(0,v.useState)(`local`),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(``),[S,C]=(0,v.useState)(()=>({...ip(),account:r??``})),w=(0,v.useRef)(r??``);(0,v.useEffect)(()=>{let e=w.current,t=r??``;w.current=t,C(n=>n.account===e?{...n,account:t}:n)},[r]);let[T,E]=(0,v.useState)(null),[D,O]=(0,v.useState)(!1),[k,ee]=(0,v.useState)(!1),[A,j]=(0,v.useState)(``),[M,te]=(0,v.useState)(null),[N,P]=(0,v.useState)(!1),ne=Mp(s===`local`&&l?l:void 0,S.workflowConfig,S.workflowName),re=ne&&s!==`local`?{...ne,exists:s!==`new`&&null}:ne,ie=()=>{m(null),g(!0),R.containers().then(f,e=>m(e.message)).finally(()=>g(!1))};(0,v.useEffect)(()=>{u(null),te(null),s===`docker`&&ie(),s===`docker`&&n.find(e=>e.name===S.account)?.kind===`folder`&&C(e=>({...e,account:``})),s===`new`&&!T&&R.projectsFolder().then(e=>E(e.path),()=>{})},[s]);let ae=e=>{u(e);let t=e.split(/[\\/]/).filter(Boolean).pop()??``;S.name||C({...S,name:t.replace(/[^A-Za-z0-9 ._-]/g,``).slice(0,48)})},oe=()=>e(async()=>{P(!0);let e=ne?.workflows[0],n=e&&!S.workflowName&&up(S,s===`docker`)?{...S,workflowName:e}:S;try{if(s===`new`){let e=await R.createProject({parent:T??void 0,github:k,task:A.trim()||void 0,settings:op(n,null)});e.warning&&te(e.warning),t(e.project)}else t(s===`local`?await R.addProject({...op(n,null),runner:`local`,path:l}):await R.addProject({...op(n,null),runner:`docker`,container:_,pathInContainer:l,...b?{user:b}:{}}))}finally{P(!1)}}),se=S.name.trim()&&(s===`new`||l);return(0,B.jsxs)(`div`,{className:`page-view`,children:[(0,B.jsx)(`header`,{className:`session-head`,children:(0,B.jsxs)(`div`,{className:`session-head-text`,children:[(0,B.jsx)(`h2`,{children:`Add a project`}),(0,B.jsx)(`div`,{className:`muted`,children:`A project is a folder where Claude Code works, with its settings and one manager.`})]})}),(0,B.jsxs)(`div`,{className:`page-body`,children:[(0,B.jsxs)(`div`,{className:`segmented`,role:`tablist`,children:[(0,B.jsx)(`button`,{className:s===`local`?`on`:``,onClick:()=>c(`local`),children:`Folder on this computer`}),(0,B.jsx)(`button`,{className:s===`docker`?`on`:``,onClick:()=>c(`docker`),children:`Folder in a container`}),(0,B.jsx)(`button`,{className:s===`new`?`on`:``,onClick:()=>c(`new`),children:`New project`})]}),s===`local`&&(l?(0,B.jsxs)(`p`,{children:[`Folder: `,(0,B.jsx)(`span`,{className:`mono`,children:l}),` `,(0,B.jsx)(`button`,{className:`small`,onClick:()=>u(null),children:`Change`})]}):(0,B.jsx)(Bp,{load:R.browse,reloadKey:`local`,onPick:ae,pickLabel:`Use this folder`})),s===`docker`&&(0,B.jsxs)(B.Fragment,{children:[p&&(0,B.jsx)(`p`,{className:`error`,children:p}),h&&(0,B.jsx)(`p`,{className:`muted`,children:`Looking for running containers…`}),!h&&(d||p)&&(0,B.jsx)(`p`,{children:(0,B.jsx)(`button`,{className:`small`,onClick:ie,children:`Refresh containers`})}),d&&!d.length&&(0,B.jsx)(`p`,{className:`muted`,children:`No containers are running. Start the container first.`}),d&&d.length>0&&(0,B.jsxs)(`div`,{className:`form`,children:[(0,B.jsxs)(`label`,{children:[`Container`,(0,B.jsxs)(`select`,{value:_,onChange:e=>{y(e.target.value),x(d.find(t=>t.name===e.target.value)?.user??``),u(null)},children:[(0,B.jsx)(`option`,{value:``,children:`Choose a running container`}),d.map(e=>(0,B.jsxs)(`option`,{value:e.name,children:[e.name,` (`,e.image,`)`]},e.name))]})]}),(0,B.jsxs)(`label`,{children:[`Run as user `,(0,B.jsx)(`span`,{className:`muted`,children:`(empty: the container's default)`}),(0,B.jsx)(`input`,{...o,value:b,onChange:e=>x(e.target.value)})]})]}),_&&(l?(0,B.jsxs)(`p`,{children:[`Folder: `,(0,B.jsxs)(`span`,{className:`mono`,children:[_,`:`,l]}),` `,(0,B.jsx)(`button`,{className:`small`,onClick:()=>u(null),children:`Change`})]}):(0,B.jsx)(Bp,{load:e=>R.browseContainer(_,b,e),reloadKey:`${_}|${b}`,onPick:ae,pickLabel:`Use this folder`}))]}),s===`new`&&(0,B.jsxs)(`div`,{className:`form`,children:[(0,B.jsx)(`p`,{className:`muted`,children:`Ledung creates a folder named after the project, with a git repository.`}),D?(0,B.jsx)(Bp,{load:R.browse,reloadKey:`parent`,start:T??void 0,onPick:e=>{E(e),O(!1)},pickLabel:`Create it in this folder`}):(0,B.jsxs)(`p`,{children:[`In: `,(0,B.jsx)(`span`,{className:`mono`,children:T??`…`}),` `,(0,B.jsx)(`button`,{className:`small`,onClick:()=>O(!0),children:`Change`})]}),(0,B.jsxs)(`label`,{className:`toggle`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:k,onChange:e=>ee(e.target.checked)}),` Create a private GitHub repository too`]}),(0,B.jsxs)(`label`,{children:[`What is the project for? `,(0,B.jsx)(`span`,{className:`muted`,children:`(optional: given to its manager as its first task)`}),(0,B.jsx)(`textarea`,{...o,rows:3,value:A,onChange:e=>j(e.target.value)})]})]}),(s===`new`||l)&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{children:`Settings`}),(0,B.jsx)(Rp,{value:S,onChange:C,accounts:n,profiles:i,container:s===`docker`,workflow:ne,lockdownB:a}),(0,B.jsx)(Np,{check:re,settings:S,container:s===`docker`}),(0,B.jsx)(`button`,{className:`primary`,disabled:!se||N,onClick:()=>void oe(),children:N?`Adding…`:s===`new`?`Create project`:`Add project`})]}),M&&(0,B.jsx)(`p`,{className:`banner`,children:M})]})]})}function Hp({view:e,project:t,projects:n,run:r,onOpen:i,onRemoved:a,onRenamed:o,accounts:s,profiles:c,board:l,lockdownB:u}){let d=Ff(Qf),f=xf(yf(e)??{project:t.name,group:null},d),p=rp(ap(t),(e,t)=>mp(e,t).length>0),m=rp(vt(l,t.name),(e,t)=>bt(t,e)>0),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(null);(0,v.useEffect)(()=>{R.profiles().then(C,()=>{})},[]),(0,v.useEffect)(()=>{if(!_)return;let e=setTimeout(()=>y(!1),3e3);return()=>clearTimeout(e)},[_]);let w=p.value,T=t.runner===`docker`,E=Mp(t.runner===`local`?t.path:void 0,w.workflowConfig,w.workflowName),D={value:w,onChange:e=>{p.set(e),y(!1)},defaults:{profiles:_p(S,E?.on&&up(w,T)&&(w.workflowName||E.workflows[0])||null)}},O=mp(p.saved,w),k=bt(m.value,m.saved),ee=O.length+k,A=new Set(O.map(e=>fp[e]));k&&A.add(`board`);let j=w.name.trim()!==t.name,M={safety:String(w.commandPatterns.length+w.pathPatterns.length),powers:w.lockdownLevel===`off`?``:`lockdown ${w.lockdownLevel}`,board:m.saved.enabled?``:`off`},te=()=>r(async()=>{g(!0);try{if(k&&(await St(t.name,m.value),m.done(m.value)),O.length&&j){let e=(await R.renameProject(t.name,w.name.trim(),op(w,t))).name;Id(localStorage,t.name,e),o(f?bf(e,f):`ps:${e}`);return}O.length&&p.done(ap(await R.updateProject(t.name,op(w,t)))),y(!0)}finally{g(!1)}}),N=()=>{p.discard(),m.discard()},P=(k?xt(m.value):null)??(w.name.trim()?null:`The project needs a name.`);return(0,B.jsxs)(Jf,{groups:_f,current:f,words:M,marked:A,narrow:d,onOpen:e=>i(e===null?`ps:${t.name}`:bf(t.name,e)),foot:(0,B.jsx)(Xf,{count:ee,saved:_,busy:h,note:j?`saving renames the project; its sessions, manager and questions stay with it, and its folder is not moved`:`running sessions keep theirs; new and resumed ones get these`,disabled:P,onSave:()=>void te(),onDiscard:N}),children:[f===`general`&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`General`}),(0,B.jsx)(`p`,{className:`muted mono tab-where`,children:t.where}),(0,B.jsxs)(`div`,{className:`form`,children:[(0,B.jsx)(Sp,{...D}),(0,B.jsx)(Cp,{...D,accounts:s,container:T}),(0,B.jsx)(wp,{...D}),(0,B.jsx)(Tp,{...D}),!T&&(0,B.jsx)(Ep,{...D}),(0,B.jsx)(jd,{value:w,onChange:D.onChange})]})]}),f===`safety`&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`What always goes to you`}),(0,B.jsx)(`div`,{className:`safety`,children:(0,B.jsx)(Lp,{value:w,onChange:D.onChange,heading:!1})})]}),f===`powers`&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Manager's powers`}),(0,B.jsxs)(`div`,{className:`form`,children:[(0,B.jsx)(Dp,{...D}),(0,B.jsx)(Op,{...D}),(0,B.jsx)(kp,{...D}),(0,B.jsx)(zp,{value:w,onChange:D.onChange,levelB:u,container:T})]})]}),f===`skills`&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Skills & profiles`}),(0,B.jsxs)(`div`,{className:`form`,children:[(0,B.jsx)(jp,{...D,project:t.name}),(0,B.jsx)(Ap,{...D,role:`manager`,profiles:c}),(0,B.jsx)(Ap,{...D,role:`session`,profiles:c})]})]}),f===`look`&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Look`}),(0,B.jsx)(`p`,{className:`muted`,children:`The names of its manager and its sessions in the sidebar and their headers. Saved at once, for every browser.`}),(0,B.jsx)(lf,{project:t,run:r})]}),f===`workflow`&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Workflow`}),E?.workflows.length?(0,B.jsx)(`div`,{className:`form`,children:(0,B.jsx)(Pp,{...D,workflow:E,container:T})}):(0,B.jsxs)(`p`,{children:[(0,B.jsx)(`span`,{className:`field-name`,children:`Workflow`}),`: `,(0,B.jsx)(`span`,{className:`muted`,children:E?`none is configured in Ledung's config ("workflow" or "workflows").`:`looking…`})]}),t.runner===`local`&&(0,B.jsx)(Np,{check:E,settings:w,container:!1})]}),f===`tickets`&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Tickets & questions`}),(0,B.jsxs)(`div`,{className:`form`,children:[(0,B.jsx)(Fp,{...D}),(0,B.jsx)(Ip,{...D})]})]}),f===`board`&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Message board`}),(0,B.jsx)(Ct,{board:l,project:t.name,projects:n,form:m.value,onChange:e=>{m.set(e),y(!1)}})]}),f===`remove`&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Remove project`}),(0,B.jsx)(`p`,{className:`muted`,children:`Takes the project off the list and stops its sessions. Their history stays, and the folder is not touched.`}),b?(0,B.jsxs)(`span`,{className:`restart-confirm`,children:[(0,B.jsxs)(`button`,{className:`small primary`,onClick:()=>void r(async()=>{await R.removeProject(t.name),a()}),children:[`Remove `,t.name]}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>x(!1),children:`Cancel`})]}):(0,B.jsx)(`button`,{onClick:()=>x(!0),children:`Remove project…`})]})]})}function Up({project:e,run:t,onStarted:n}){let r=z(),[i,a]=(0,v.useState)(``);return(0,B.jsx)(Kd,{level:Bd(e),fill:!0,children:(0,B.jsxs)(`div`,{className:`page-view`,children:[(0,B.jsx)(`header`,{className:`session-head`,children:(0,B.jsxs)(`div`,{className:`session-head-text`,children:[(0,B.jsx)(`h2`,{children:e.name}),(0,B.jsx)(`div`,{className:`muted mono`,children:e.where})]})}),(0,B.jsxs)(`div`,{className:`page-body`,children:[(0,B.jsx)(`p`,{children:`This project's manager hasn't started yet. Write to it and it starts: give it a task, or ask where things stand.`}),(0,B.jsxs)(`div`,{className:`composer`,children:[(0,B.jsx)(`textarea`,{...r,rows:4,value:i,onChange:e=>a(e.target.value),placeholder:`Message the manager of ${e.name}`}),(0,B.jsx)(`button`,{className:`primary`,disabled:!i.trim(),onClick:()=>void t(async()=>n((await R.messageManager(e.name,i)).id)),children:`Start manager`})]})]})]})})}var Wp={default:`Ask`,acceptEdits:`Accept edits`,auto:`Auto`,plan:`Plan`};function Gp({chats:e,profiles:t,run:n,onStarted:r}){let i=z(),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(!1),_=a??e?.folder??``,y=p||e?.permissionMode||`auto`,x=()=>n(async()=>{g(!0);try{r((await R.startChat({...a?{folder:a}:{},...l.trim()?{model:l.trim()}:{},...d?{profile:d}:{},...p?{permissionMode:p}:{}})).id)}finally{g(!1)}});return(0,B.jsxs)(`div`,{className:`page-view`,children:[(0,B.jsx)(`header`,{className:`session-head`,children:(0,B.jsxs)(`div`,{className:`session-head-text`,children:[(0,B.jsx)(`h2`,{children:`New chat`}),(0,B.jsx)(`div`,{className:`muted`,children:`A Claude Code session of your own, with no project, workflow or manager. It asks you directly.`})]})}),(0,B.jsxs)(`div`,{className:`page-body`,children:[(0,B.jsxs)(`div`,{className:`form`,children:[s?(0,B.jsx)(Bp,{load:R.browse,reloadKey:`chat`,start:_||void 0,onPick:e=>{o(e),c(!1)},pickLabel:`Chat in this folder`}):(0,B.jsxs)(`p`,{children:[`Folder: `,(0,B.jsx)(`span`,{className:`mono`,children:_||`…`}),` `,(0,B.jsx)(`button`,{className:`small`,onClick:()=>c(!0),children:`Change`})]}),(0,B.jsxs)(`label`,{children:[`Model `,(0,B.jsx)(`span`,{className:`muted`,children:`(empty: Claude Code's own default)`}),(0,B.jsx)(`input`,{...i,value:l,onChange:e=>u(e.target.value),placeholder:`opus, sonnet, haiku or a full model name`})]}),t.length>1&&(0,B.jsxs)(`label`,{children:[`Profile `,(0,B.jsx)(`span`,{className:`muted`,children:`(what it gets of your own plugins, MCP servers and tools)`}),(0,B.jsxs)(`select`,{value:d,onChange:e=>f(e.target.value),children:[(0,B.jsx)(`option`,{value:``,children:`full: your whole setup`}),t.filter(e=>e!==`full`).map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]})]}),(0,B.jsxs)(`label`,{children:[`Permission mode `,(0,B.jsx)(`span`,{className:`muted`,children:`(changeable in the chat; what always goes to you is asked in every mode)`}),(0,B.jsx)(`select`,{value:y,onChange:e=>m(e.target.value),children:b.map(e=>(0,B.jsx)(`option`,{value:e,children:Wp[e]},e))})]})]}),(0,B.jsx)(`button`,{className:`primary`,disabled:h||s||!e,onClick:()=>void x(),children:h?`Starting…`:`Start chat`})]})]})}function Kp({view:e,chats:t,run:n,onOpen:r}){let i=Ff(Qf),a=xf(yf(e)??{project:null,group:null},i),o=rp({commandPatterns:t?.sensitive.commandPatterns??[],pathPatterns:t?.sensitive.pathPatterns??[]},(e,t)=>JSON.stringify(e)!==JSON.stringify(t)),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(!1);if((0,v.useEffect)(()=>{if(!l)return;let e=setTimeout(()=>u(!1),3e3);return()=>clearTimeout(e)},[l]),!t)return(0,B.jsx)(`div`,{className:`page-body`,children:(0,B.jsx)(`p`,{className:`muted`,children:`Loading…`})});let d=[`commandPatterns`,`pathPatterns`].filter(e=>JSON.stringify(o.saved[e])!==JSON.stringify(o.value[e])).length,f=[...t.fromConfig.commandPatterns,...t.fromConfig.pathPatterns,...t.fromConfig.mcpTools],p=()=>n(async()=>{c(!0);try{let e=(await R.updateChats({...o.value,mcpTools:t.sensitive.mcpTools})).sensitive;o.done({commandPatterns:e.commandPatterns,pathPatterns:e.pathPatterns}),u(!0)}finally{c(!1)}});return(0,B.jsxs)(Jf,{groups:vf,current:a,words:{safety:String(o.value.commandPatterns.length+o.value.pathPatterns.length)},marked:d?new Set([`safety`]):void 0,narrow:i,onOpen:e=>r(e===null?`chats`:bf(null,e)),foot:(0,B.jsx)(Xf,{count:d,saved:l,busy:s,note:`running chats keep theirs; new and resumed ones get these`,onSave:()=>void p(),onDiscard:o.discard}),children:[a===`general`&&(0,B.jsxs)(`section`,{children:[(0,B.jsxs)(`div`,{className:`settings-h`,children:[(0,B.jsx)(`h3`,{children:`General`}),(0,B.jsx)(qf,{kind:`config`})]}),(0,B.jsx)(`p`,{className:`muted`,children:`Chats are sessions with no project. They ask you directly, and run on this computer. Both of these are set in Ledung's config ("chats"); each new chat can choose another.`}),(0,B.jsxs)(`p`,{children:[(0,B.jsx)(`span`,{className:`field-name`,children:`Folder`}),`: `,(0,B.jsx)(`span`,{className:`mono`,children:t.folder})]}),(0,B.jsxs)(`p`,{children:[(0,B.jsx)(`span`,{className:`field-name`,children:`Permission mode`}),`: `,Wp[t.permissionMode]]})]}),a===`safety`&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`What always goes to you`}),(0,B.jsxs)(`div`,{className:`safety`,children:[(0,B.jsx)(Lp,{value:o.value,onChange:e=>{o.set(e),u(!1)},heading:!1}),f.length>0&&(0,B.jsxs)(`p`,{className:`muted`,children:[`Also always asked, from Ledung's config: `,f.map((e,t)=>(0,B.jsxs)(v.Fragment,{children:[t?`, `:``,(0,B.jsx)(`code`,{children:e})]},e)),`.`]})]})]}),a===`look`&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Look`}),(0,B.jsx)(`p`,{className:`muted`,children:`The chats' names in the sidebar and their headers. Saved at once, for every browser.`}),(0,B.jsx)(uf,{colour:t.colour,run:n})]})]})}function qp(e){return{text:[e.cut===`timeout`?`Cut off: it ran past its time limit (${Math.round(e.durationMs/1e3)} s), and it and everything it started were ended.`:e.cut===`stopped`?`Stopped: it and everything it started were ended.`:e.cut===`restart`?`Ended by Restart Ledung.`:`Exit code ${e.exitCode??`unknown`}.`,e.truncated?`The output was cut to its first part.`:null,`${e.shell} · ${e.cwd} · ${(e.durationMs/1e3).toFixed(1)} s.`,e.toClaude?`Claude gets it with your next message.`:`Claude did not get it.`].filter(Boolean).join(` `),problem:!!e.cut||e.exitCode!==0||!e.toClaude}}function Jp(e){let t=e.trimStart();return t.startsWith(`!`)&&t.slice(1).trim()||null}function Yp(e){return`This matches ${e.replace(/^command matches /,``)}; run it?`}function Xp(e,t){return`Runs ${t===`docker`?`in the project's container`:`in ${e}`} in the session's folder. The command and its output go to Claude as context, with no reply, and are kept in the history: don't print secrets.`}function Zp(e){return e===`mcp__ledung__ask_user`}var Qp=200;function $p(e){let t=e.trim();return t.length>0&&t.length<=Qp&&!t.includes("```")&&!/\n\s*\n/.test(t)&&!/^\s*([-*+•]|\d+[.)])\s/m.test(t)}function em(e){let t=new Set,n=-1,r=[],i=()=>{n>=0&&r.forEach(e=>t.add(e)),n=-1,r=[]};return e.forEach((e,t)=>{e.kind===`end`?i():e.kind===`tool`&&!e.sub?(n=Zp(e.name)?t:-1,r=[]):e.kind===`text`&&!e.sub&&n>=0&&$p(e.text)&&r.push(t)}),i(),t}function tm(e){let t=e=>e>=1e4?`${Math.round(e/1e3)}k`:`${(e/1e3).toFixed(1)}k`;if(typeof e?.pre_tokens!=`number`||typeof e.post_tokens!=`number`)return`Compacted.`;let n=typeof e.duration_ms==`number`?` in ${Math.round(e.duration_ms/1e3)} s`:``;return`Compacted: ${t(e.pre_tokens)} → ${t(e.post_tokens)}${n}.`}function nm(e){return`Ledung kept only the start of this output (about ${e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`} more was cut). The full output is in Claude Code's own transcript of the session.`}function rm(e){let t=Number(e?.ledung_cut?.chars??0);return Number.isFinite(t)&&t>0?t:0}var im=(e=>`Ledung has delivered messages for you. They are attached as context and are not from ${e}.`)(``).slice(0,-1);function am(e){let t=e.split(`
63
-
64
- `),n=t.at(-1);return!n.startsWith(im)||!n.endsWith(`.`)||n.includes(`
65
- `)?e:t.slice(0,-1).join(`
66
-
67
- `)}var om=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r)setTimeout(function(){r(e)},0);else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h)d[r]=void 0;else{if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends om{};function sm(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function cm(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function lm(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function um(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function dm(e,t){return lm(e,t,``)}function fm(e,t){return um(e,t,``)}function pm(e,t){return t.slice(0,mm(e,t))}function mm(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function hm(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function gm(e,t){if(t)return vm(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function _m(e,t){if(t)return vm(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function vm(e,t){if(!t)return[_m(e),gm(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=hm(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var ym=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,bm=RegExp(`[${ym}]+|\\s+|[^${ym}]`,`ug`);new class extends om{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=hm(e,r)}else n=e.match(bm)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&xm(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&xm(n,i,r,null,t.intlSegmenter),e}};function xm(e,t,n,r,i){if(t&&n){let[a,o]=vm(t.value,i),[s,c]=vm(n.value,i);if(e){let r=sm(a,s);e.value=um(e.value,s,r),t.value=dm(t.value,r),n.value=dm(n.value,r)}if(r){let e=cm(o,c);r.value=lm(r.value,c,e),t.value=fm(t.value,e),n.value=fm(n.value,e)}}else if(n){if(e){let e=_m(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=_m(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=_m(r.value,i),[a,o]=vm(t.value,i),s=sm(n,a);t.value=dm(t.value,s);let c=cm(dm(n,s),o);t.value=fm(t.value,c),r.value=lm(r.value,n,c),e.value=um(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=_m(r.value,i),n=pm(gm(t.value,i),e);t.value=fm(t.value,n)}else if(e){let n=pm(gm(e.value,i),_m(t.value,i));t.value=dm(t.value,n)}}new class extends om{tokenize(e){let t=RegExp(`(\\r?\\n)|[${ym}]+|[^\\S\\n\\r]+|[^${ym}]`,`ug`);return e.match(t)||[]}};var Sm=new class extends om{constructor(){super(...arguments),this.tokenize=wm}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
68
- `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
69
- `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
70
- `)&&(e=e.slice(0,-1)),t.endsWith(`
71
- `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function Cm(e,t,n){return Sm.diff(e,t,n)}function wm(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
72
- `));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function Tm(e){return e==`.`||e==`!`||e==`?`}new class extends om{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(Tm(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends om{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends om{constructor(){super(...arguments),this.tokenize=wm}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(Em(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function Em(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=Em(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=Em(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends om{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Dm({before:e,after:t}){let n=Cm(e,t);return(0,B.jsx)(`pre`,{className:`diff`,children:n.map((e,t)=>{let n=e.added?`diff-add`:e.removed?`diff-del`:`diff-same`,r=e.added?`+`:e.removed?`-`:` `,i=e.value.replace(/\n$/,``).split(`
73
- `);return(0,B.jsxs)(`span`,{className:n,children:[i.map(e=>`${r} ${e}`).join(`
74
- `),`
75
- `]},t)})})}function Om({text:e}){return(0,B.jsxs)(`div`,{className:`code-block`,children:[(0,B.jsx)(yd,{text:e}),(0,B.jsx)(`pre`,{children:(0,B.jsx)(`code`,{children:e})})]})}function km(e){return typeof e.file_path==`string`?e.file_path:typeof e.path==`string`?e.path:null}function Am(e,t){return e===`Bash`&&typeof t.command==`string`?t.command.split(`
76
- `)[0]:km(t)||(typeof t.pattern==`string`?t.pattern:typeof t.url==`string`?t.url:typeof t.description==`string`?t.description:``)}function jm({toolName:e,input:t}){let n=km(t);switch(e){case`Bash`:return(0,B.jsxs)(B.Fragment,{children:[t.description&&(0,B.jsx)(`p`,{className:`muted`,children:t.description}),(0,B.jsx)(Om,{text:String(t.command??``)}),t.run_in_background&&(0,B.jsx)(`p`,{className:`muted`,children:`Runs in the background.`})]});case`Edit`:return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{className:`path`,children:[n,t.replace_all?` (every occurrence)`:``]}),(0,B.jsx)(Dm,{before:String(t.old_string??``),after:String(t.new_string??``)})]});case`MultiEdit`:return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`path`,children:n}),(t.edits??[]).map((e,t)=>(0,B.jsx)(Dm,{before:String(e.old_string??``),after:String(e.new_string??``)},t))]});case`Write`:return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{className:`path`,children:[n,` (whole file)`]}),(0,B.jsx)(Dm,{before:``,after:String(t.content??``)})]});case`NotebookEdit`:return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`path`,children:t.notebook_path}),(0,B.jsx)(Om,{text:String(t.new_source??``)})]});default:return(0,B.jsx)(Om,{text:JSON.stringify(t,null,2)})}}function Mm({permission:e,managerTitle:t}){return e.toolName===`AskUserQuestion`?(0,B.jsx)(Pm,{permission:e}):(0,B.jsx)(Nm,{permission:e,managerTitle:t})}function Nm({permission:e,managerTitle:t}){let n=z(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),d=async(t,n=`once`,r=a)=>{c(!0),u(null);try{await R.decide(e.id,{behavior:t,scope:n,message:t===`deny`?r:void 0})}catch(e){u(e.message),c(!1)}};return(0,B.jsxs)(`div`,{className:`card permission`,children:[(0,B.jsxs)(`div`,{className:`card-head`,children:[(0,B.jsxs)(`strong`,{children:[`Permission: `,e.toolName]}),e.title&&(0,B.jsxs)(`span`,{className:`muted`,children:[` · `,e.title]}),e.addressedTo!==`user`&&(0,B.jsxs)(`span`,{className:`muted`,children:[` · `,e.sensitive?`with`:`for`,` manager "`,t??`manager`,`"`,e.sensitive?``:` to decide`]})]}),e.sensitive&&(0,B.jsxs)(`p`,{className:`sensitive-note`,children:[(0,B.jsx)(`strong`,{children:`Sensitive`}),`: only you can allow this, once at a time.`,e.addressedTo!==`user`&&` Its manager asks you about it; you can also decide it here.`,` `,(0,B.jsxs)(`span`,{className:`muted`,children:[`(`,e.sensitive,`)`]})]}),e.uac&&(0,B.jsxs)(`p`,{className:`sensitive-note`,children:[(0,B.jsx)(`strong`,{children:`Administrator`}),`: `,`This raises a UAC prompt on the PC's desktop; allow it only when you are at the PC.`,` `,(0,B.jsx)(`span`,{className:`muted`,children:`Stop may not end what runs as administrator: Windows does not let Ledung end it. Close it on the PC.`})]}),e.reason&&(0,B.jsx)(`p`,{className:`muted`,children:e.reason}),(0,B.jsx)(jm,{toolName:e.toolName,input:e.input}),r&&(0,B.jsx)(`textarea`,{...n,className:`deny-message`,placeholder:`Optional: tell the session why, or what to do instead`,value:a,onChange:e=>o(e.target.value),rows:2,autoFocus:!0}),(0,B.jsxs)(`div`,{className:`actions`,children:[(0,B.jsx)(`button`,{className:`allow`,disabled:s,onClick:()=>d(`allow`),children:`Allow once`}),!e.sensitive&&(0,B.jsx)(`button`,{disabled:s,title:`Allow this request and its repeats for the rest of this session`,onClick:()=>d(`allow`,`session`),children:`Allow for this session`}),r?(0,B.jsx)(`button`,{className:`deny`,disabled:s,onClick:()=>d(`deny`),children:`Deny`}):(0,B.jsx)(`button`,{className:`deny`,disabled:s,onClick:()=>i(!0),children:`Deny…`}),e.uac&&(0,B.jsx)(`button`,{className:`deny`,disabled:s,title:`Deny it, telling the session nobody is at the PC to answer UAC`,onClick:()=>d(`deny`,`once`,`Denied: the person is not at the PC, so nobody can answer the UAC prompt there. Do not retry the elevated command now; carry on without it, or ask for it later.`),children:`Deny: not at the PC`})]}),l&&(0,B.jsx)(`p`,{className:`error`,children:l})]})}function Pm({permission:e}){let t=z(),n=e.input.questions??[],[r,i]=(0,v.useState)({}),[a,o]=(0,v.useState)({}),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),d=(e,t)=>{i(n=>{let r=n[e.question]??[];return e.multiSelect?{...n,[e.question]:r.includes(t)?r.filter(e=>e!==t):[...r,t]}:{...n,[e.question]:[t]}}),e.multiSelect||o(t=>({...t,[e.question]:``}))},f=e=>{let t=a[e.question]?.trim();return[...r[e.question]??[],...t?[t]:[]].join(`, `)},p=n.every(e=>f(e)),m=async t=>{c(!0),u(null);try{let r=Object.fromEntries(n.map(e=>[e.question,f(e)]));await R.decide(e.id,t===`allow`?{behavior:t,answers:r}:{behavior:t,message:`Simon declined to answer.`})}catch(e){u(e.message),c(!1)}};return(0,B.jsxs)(`div`,{className:`card question`,children:[n.map(e=>(0,B.jsxs)(`fieldset`,{children:[(0,B.jsxs)(`legend`,{children:[e.header&&(0,B.jsx)(`span`,{className:`chip`,children:e.header}),` `,e.question]}),e.options.map(t=>{let n=(r[e.question]??[]).includes(t.label);return(0,B.jsxs)(`button`,{type:`button`,className:`option${n?` on`:``}`,onClick:()=>d(e,t.label),children:[(0,B.jsx)(`strong`,{children:t.label}),t.description&&(0,B.jsxs)(`span`,{className:`muted`,children:[` `,t.description]})]},t.label)}),(0,B.jsx)(`input`,{...t,className:`other`,placeholder:`Or type your own answer`,value:a[e.question]??``,onChange:t=>{let n=t.target.value;o(t=>({...t,[e.question]:n})),!e.multiSelect&&n&&i(t=>({...t,[e.question]:[]}))}})]},e.question)),(0,B.jsxs)(`div`,{className:`actions`,children:[(0,B.jsx)(`button`,{className:`allow`,disabled:s||!p,onClick:()=>m(`allow`),children:`Answer`}),(0,B.jsx)(`button`,{className:`deny`,disabled:s,onClick:()=>m(`deny`),children:`Decline`})]}),l&&(0,B.jsx)(`p`,{className:`error`,children:l})]})}var Fm=[`pass`,`fail`,`unsure`],Im={pass:`Pass`,fail:`Fail`,unsure:`Unsure`},Lm={pass:`looks right`,fail:`looks off`,unsure:`can't tell`},Rm=e=>e.replace(/\s+/g,` `).trim();function zm(e,t,n=``){let r=e=>t[e]?.verdict??null,i=Fm.map(t=>[Im[t],e.filter((e,n)=>r(n)===t).length]).filter(([,e])=>e>0).map(([e,t])=>`${e} ${t}`),a=e.filter((e,t)=>!r(t)).length;a&&i.push(`no verdict ${a}`);let o=e.map((e,n)=>{let i=r(n),a=Rm(t[n]?.note??``);return`- ${Rm(e.group)} · ${Rm(e.path)}: ${i?Im[i]:`no verdict`}${a?` — ${a}`:``}`}),s=n.trim();return[`Screenshot verdicts: ${i.join(` · `)}`,...o,...s?[``,s]:[]].join(`
77
- `)}var Bm=e=>e===`waiting`||!!e?.startsWith(`q:`);function Vm(e,t,n){return Bm(n)?Bm(e)?{depth:t.depth+1,root:t.root}:{depth:1,root:!1}:{depth:0,root:!1}}function Hm(e){return e>0?{back:1}:{queue:!0}}function Um(e,t,n,r,i){if(r===i)return{verdict:null,to:n};let a=Wm(e,t,n+1);return{verdict:i,to:a>=0&&a!==n?a:Math.min(n+1,e.length-1)}}function Wm(e,t,n){for(let r=0;r<e.length;r++){let i=(n+r)%e.length;if(!t(e[i]))return i}return-1}function Gm(e,t,n,r){let i=e.filter(e=>!t(e)).length;return i?n===null?{send:!1,to:Wm(e,t,0),missing:i}:r-n<500?{send:!1,tooSoon:!0}:{send:!0}:{send:!0}}var Km=e=>(e.ctrlKey||e.metaKey)&&e.key===`Enter`,qm=e=>Km(e)&&!e.repeat,Jm=new Map,Ym=(e,t)=>({judged:{},note:``,paths:e.map(e=>e.path),project:t,carried:{},touched:{}});function Xm(e,t,n,r){let i=[...n.entries()].filter(([n,i])=>n!==e&&r(n)&&i.project===t.project).sort(([e],[t])=>t-e);if(!i.length)return t;let a={...t.judged},o={...t.carried},s=!1;return t.paths.forEach((e,n)=>{if(!(a[n]?.verdict||t.touched[n]||o[n]!==void 0))for(let[t,r]of i){let i=r.paths.indexOf(e),c=i>=0?r.judged[i]:void 0;if(c?.verdict){a[n]={verdict:c.verdict,note:a[n]?.note.trim()?a[n].note:c.note},o[n]=t,s=!0;break}}}),s?{...t,judged:a,carried:o}:t}var Zm=e=>[...new Set(Object.values(e.carried))].sort((e,t)=>e-t),Qm=e=>Object.values(e.judged).filter(e=>e.verdict).length,$m=(e,t)=>e>0&&t>0&&e<=t*.6,eh=()=>typeof matchMedia==`function`&&matchMedia(`(pointer: coarse)`).matches;function th({busy:e,onWithdraw:t}){let[n,r]=(0,v.useState)(!1),i=(0,v.useRef)(null);return(0,v.useEffect)(()=>{n&&i.current?.focus()},[n]),n?(0,B.jsxs)(`div`,{className:`withdraw-row asking`,role:`group`,"aria-label":`Withdraw the question`,children:[(0,B.jsx)(`span`,{children:`Withdraw it for the asker? It leaves the queue.`}),(0,B.jsx)(`button`,{className:`small deny`,disabled:e,onClick:t,children:`Yes, withdraw`}),(0,B.jsx)(`button`,{ref:i,className:`small`,disabled:e,onClick:()=>r(!1),children:`Keep it`})]}):(0,B.jsx)(`div`,{className:`withdraw-row`,children:(0,B.jsx)(`button`,{className:`small`,disabled:e,title:`Withdraw it for the asker; it leaves the queue`,onClick:()=>r(!0),children:`Withdraw…`})})}var nh=`ledung-shots-order`;function rh(e){let t=e.opinions.find(e=>e.verdict)?.verdict;return t===`fail`?0:t===`unsure`?1:t===`pass`?3:2}function ih(e){let t=z(),n=e.question,r=n.status===`open`,i=t=>r?Xm(n.id,t,Jm,t=>e.withdrawnIds.includes(t)):t,[a,o]=(0,v.useState)(()=>{let t=i(Jm.get(n.id)??Ym(n.shots,e.session.project));return Jm.set(n.id,t),t}),[s,c]=(0,v.useState)(()=>{try{return localStorage.getItem(nh)===`off-first`}catch{return!1}}),l=(0,v.useMemo)(()=>{let e=n.shots.map((e,t)=>t);return s?e.sort((e,t)=>rh(n.shots[e])-rh(n.shots[t])||e-t):e},[n.shots,s]),[u,d]=(0,v.useState)(()=>{let e=Gm(l,e=>a.judged[e]?.verdict,null,0);return`to`in e?e.to:0}),[f,p]=(0,v.useState)(0),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(null),x=e=>{Jm.set(n.id,e),o(e),b(null)},C=e.withdrawnIds.join(`,`);(0,v.useEffect)(()=>{let e=Jm.get(n.id)??a,t=i(e);t!==e&&x(t)},[C]);let w=Math.min(u,l.length-1),T=l[w],E=n.shots[T],D=a.judged[T],O=n.shots.filter((e,t)=>a.judged[t]?.verdict).length,k=e=>d((e+l.length)%l.length),ee=e=>{let t=E.group,r=w;do r=(r+e+l.length)%l.length;while(n.shots[l[r]].group===t&&r!==w);for(;e<0&&r>0&&n.shots[l[r-1]].group===n.shots[l[r]].group;)r--;k(r)},A=e=>{if(!r)return;let{verdict:t,to:n}=Um(l,e=>a.judged[e]?.verdict,w,D?.verdict,e),i={...a.carried};delete i[T],x({...a,judged:{...a.judged,[T]:{verdict:t,note:D?.note??``}},carried:i,touched:{...a.touched,[T]:!0}}),n!==w&&k(n)},j=e=>x({...a,judged:{...a.judged,[T]:{verdict:D?.verdict??null,note:e}}}),M=()=>{let e=!s;try{localStorage.setItem(nh,e?`off-first`:`as-taken`)}catch{}c(e);let t=n.shots.map((e,t)=>t),r=e?t.sort((e,t)=>rh(n.shots[e])-rh(n.shots[t])||e-t):t;d(Math.max(0,r.indexOf(T)))},te=async t=>{h(!0),_(null);try{await t(),Jm.delete(n.id),e.onDone?.()}catch(e){_(e.message)}finally{h(!1)}},N=()=>{if(m)return;if(!O)return _(`Judge at least one shot first.`);let e=Gm(l,e=>a.judged[e]?.verdict,y,Date.now());`tooSoon`in e||(`to`in e?(b(Date.now()),_(null),k(e.to)):te(()=>R.answerQuestion(n.id,zm(n.shots,a.judged,a.note))))},P=n.shots.length-O,ne=y!==null&&P>0,re=Zm(a),ie=a.carried[T];(0,v.useEffect)(()=>{let t=t=>{let n=/^(TEXTAREA|INPUT|SELECT)$/.test(document.activeElement?.tagName??``);if(Km(t)&&r){t.preventDefault(),qm(t)&&N();return}if(t.key===`Escape`){n?document.activeElement.blur():e.onClose();return}if(n||t.ctrlKey||t.metaKey||t.altKey)return;let i=t.key;if(i===`ArrowRight`)k(w+1);else if(i===`ArrowLeft`)k(w-1);else if(i===`ArrowDown`)ee(1);else if(i===`ArrowUp`)ee(-1);else if(i===`1`||i===`2`||i===`3`)A(Fm[Number(i)-1]);else if((i===`n`||i===`N`)&&r)p(e=>e+1);else if(i===`o`||i===`O`)M();else if((i===`s`||i===`S`)&&e.onToggleSidebar)e.onToggleSidebar();else if((i===`c`||i===`C`)&&e.onGoToConversation)e.onGoToConversation();else return;t.preventDefault()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)});let ae=(0,v.useRef)(null),oe=(0,v.useRef)(null),se=(0,v.useRef)(null),[ce,le]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=ae.current,t=oe.current;if(!e||!t)return;let n=new ResizeObserver(()=>{let n=getComputedStyle(t);le($m(t.getBoundingClientRect().height-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom),e.clientHeight))});return n.observe(e),n.observe(t),()=>n.disconnect()},[]),(0,v.useEffect)(()=>{let e=oe.current,t=se.current;if(!e||!t||getComputedStyle(e).position!==`sticky`)return;let n=e.getBoundingClientRect().bottom,r=t.getBoundingClientRect().top-n;r<0&&e.closest(`.shots`)?.scrollBy({top:r-8})},[T]);let ue=[];l.forEach((e,t)=>{let r=n.shots[e].group;ue.at(-1)?.name===r?ue.at(-1).items.push(t):ue.push({name:r,items:[t]})});let de=(0,B.jsxs)(B.Fragment,{children:[ie!==void 0&&(0,B.jsxs)(`p`,{className:`carried-hint`,children:[`Carried over from #`,ie,`, withdrawn: check it still holds for this picture.`]}),(0,B.jsx)(`div`,{className:`vbtns`,children:Fm.map((e,t)=>(0,B.jsxs)(`button`,{className:`${e}${D?.verdict===e?` on`:``}`,"aria-pressed":D?.verdict===e,onClick:()=>A(e),children:[Im[e],(0,B.jsx)(`kbd`,{children:t+1})]},e))})]});return(0,B.jsxs)(`div`,{className:`shots${ce?` pin`:``}`,ref:ae,children:[(0,B.jsxs)(`div`,{className:`shot-main`,children:[(0,B.jsxs)(`div`,{className:`shot-top`,ref:oe,children:[(0,B.jsxs)(`div`,{className:`stage`,children:[(0,B.jsx)(_d,{sessionId:n.sessionId,path:E.path,alt:`${E.group} ${E.path}`},`${n.id}:${T}`),l.length>1&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{className:`nav l`,onClick:()=>k(w-1),"aria-label":`Previous screenshot`,children:`‹`}),(0,B.jsx)(`button`,{className:`nav r`,onClick:()=>k(w+1),"aria-label":`Next screenshot`,children:`›`})]})]}),r&&(0,B.jsx)(`div`,{className:`shot-vbar`,role:`group`,"aria-label":`Your verdict`,children:de})]}),(0,B.jsx)(`nav`,{className:`strip`,"aria-label":`Screenshots`,children:ue.map(e=>(0,B.jsxs)(`div`,{className:`sgrp`,children:[(0,B.jsxs)(`span`,{children:[e.name,` · `,e.items.filter(e=>a.judged[l[e]]?.verdict).length,`/`,e.items.length]}),(0,B.jsx)(`div`,{children:e.items.map(t=>{let r=l[t],i=a.judged[r];return(0,B.jsxs)(`button`,{className:`thumb`,"aria-current":t===w,"aria-label":`${e.name} ${n.shots[r].path}`,onClick:()=>k(t),children:[(0,B.jsx)(`img`,{src:gd(n.sessionId,n.shots[r].path),alt:``}),(0,B.jsx)(`span`,{className:`vdot${i?.verdict?` ${i.verdict}`:``}${i?.note.trim()?` n`:``}${a.carried[r]===void 0?``:` c`}`,title:a.carried[r]===void 0?void 0:`Carried over from #${a.carried[r]}: give it a second look`})]},r)})})]},e.name+e.items[0]))})]}),(0,B.jsxs)(`aside`,{className:`slip`,"aria-live":`polite`,children:[(0,B.jsxs)(`div`,{className:`meta`,children:[(0,B.jsxs)(`strong`,{children:[`Question #`,n.id]}),(0,B.jsx)(`span`,{className:`chip`,children:S(e.session.project)}),(0,B.jsx)(`span`,{className:`muted`,children:$(n.askedAt)}),(0,B.jsx)(`button`,{className:`link slip-session`,onClick:e.session.onOpen,children:e.session.title})]}),(0,B.jsxs)(`div`,{className:`slip-question`,children:[(0,B.jsx)(`strong`,{className:`slip-title`,children:e.title}),e.refersTo,(0,B.jsx)(`div`,{className:`question-text prose`,children:(0,B.jsx)(Cd,{text:e.issue||n.question,sessionId:n.sessionId})}),e.evidence&&(0,B.jsxs)(`div`,{className:`sblk`,children:[(0,B.jsx)(`span`,{className:`lbl`,children:`Evidence`}),(0,B.jsx)(`div`,{className:`question-text prose`,children:(0,B.jsx)(Cd,{text:e.evidence,sessionId:n.sessionId})})]}),!!e.options?.length&&(0,B.jsxs)(`div`,{className:`sblk`,children:[(0,B.jsx)(`span`,{className:`lbl`,children:`Options`}),(0,B.jsx)(`ol`,{className:`slip-options`,children:e.options.map(t=>{let r=(e.opinions??[]).filter(e=>e.pick===t.key).map(e=>e.who);return(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`strong`,{children:t.label.replace(/\*\*/g,``)}),t.detail&&(0,B.jsx)(`div`,{className:`prose`,children:(0,B.jsx)(Cd,{text:t.detail,sessionId:n.sessionId})}),t.cost&&(0,B.jsxs)(`div`,{className:`muted`,children:[(0,B.jsx)(`b`,{children:`Cost`}),` · `,t.cost]}),r.length>0&&(0,B.jsxs)(`div`,{className:`picked-by`,children:[(0,B.jsx)(`b`,{children:`Picked by`}),` `,r.join(`, `)]})]},t.key)})}),(0,B.jsx)(`span`,{className:`muted hint`,children:`Your verdicts on the shots are the answer.`})]})]}),(0,B.jsx)(`h3`,{ref:se,children:E.group}),(0,B.jsxs)(`div`,{className:`meta`,children:[(0,B.jsxs)(`span`,{className:`chip`,children:[w+1,` / `,l.length]}),E.facts.map(e=>(0,B.jsx)(`span`,{className:`chip`,children:e},e)),(0,B.jsx)(`span`,{className:`chip mono`,children:E.path})]}),(0,B.jsxs)(`div`,{className:`sblk`,children:[(0,B.jsx)(`span`,{className:`lbl`,children:`Look for`}),(0,B.jsx)(`p`,{children:E.lookFor})]}),E.doneWhen&&(0,B.jsxs)(`div`,{className:`sblk`,children:[(0,B.jsx)(`span`,{className:`lbl`,children:`Judge against (the done-condition)`}),(0,B.jsx)(`p`,{children:E.doneWhen})]}),E.opinions.length>0&&(0,B.jsxs)(`div`,{className:`sblk`,children:[(0,B.jsx)(`span`,{className:`lbl`,children:`What the others thought`}),E.opinions.map((e,t)=>(0,B.jsxs)(`div`,{className:`op${e.verdict?` ${e.verdict}`:``}`,children:[(0,B.jsx)(`small`,{children:e.who}),e.verdict&&(0,B.jsx)(`strong`,{className:e.verdict,children:Lm[e.verdict]}),(0,B.jsx)(`p`,{children:e.text})]},t))]}),r?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`sblk slip-verdict`,children:[(0,B.jsx)(`span`,{className:`lbl`,children:`Your verdict`}),de]}),(0,B.jsxs)(`div`,{className:`sblk`,children:[(0,B.jsx)(`label`,{className:`lbl`,htmlFor:`shot-note`,children:`Note on this shot`}),(0,B.jsx)(ah,{value:D?.note??``,focus:f,onChange:j},`${n.id}:${T}`)]}),(0,B.jsxs)(`div`,{className:`send-blk`,children:[(0,B.jsxs)(`div`,{className:P?`shot-count missing`:`muted`,children:[O,` of `,n.shots.length,` judged`,P>0&&` · ${P} without a verdict`]}),re.length>0&&(0,B.jsxs)(`p`,{className:`muted`,children:[Object.keys(a.carried).length,` verdict`,Object.keys(a.carried).length===1?``:`s`,` carried over from `,re.map(e=>`#${e}`).join(`, `),`, withdrawn while you judged `,re.length===1?`it`:`them`,`; ringed on the strip until you judge `,Object.keys(a.carried).length===1?`it`:`them`,` here.`]}),(0,B.jsx)(`label`,{className:`lbl`,htmlFor:`shot-answer-note`,children:`Note to the asker (optional)`}),(0,B.jsx)(`textarea`,{...t,id:`shot-answer-note`,className:`answer-box`,rows:2,placeholder:`Anything to go with the verdicts`,value:a.note,onChange:e=>x({...a,note:e.target.value})}),(0,B.jsx)(`div`,{className:`actions`,children:(0,B.jsx)(`button`,{className:ne?`deny`:`allow`,disabled:m||!O,onClick:N,children:ne?`Send with ${P} without a verdict`:`Send verdicts`})}),ne&&P>0?(0,B.jsxs)(`p`,{className:`error`,children:[P===1?`1 shot has`:`${P} shots have`,` no verdict yet; this is the first. Give `,P===1?`it`:`them`,` one, or press "Send with `,P,` without a verdict" to send `,P===1?`it`:`them`,` as "no verdict".`]}):(0,B.jsxs)(`span`,{className:`muted hint`,children:[O>0&&P>0&&`Send shows the shots without a verdict first. `,(0,B.jsxs)(`span`,{className:`kbd-hint`,children:[(0,B.jsx)(`kbd`,{children:`Ctrl`}),`+`,(0,B.jsx)(`kbd`,{children:`Enter`}),` sends`]})]}),g&&(0,B.jsx)(`p`,{className:`error`,children:g}),(0,B.jsx)(th,{busy:m,onWithdraw:()=>void te(()=>R.withdrawQuestion(n.id))})]})]}):(0,B.jsx)(`div`,{className:`send-blk`,children:n.status===`answered`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`span`,{className:`lbl`,children:[`Answer`,n.answeredBy===`user`?` from ${e.userName}`:``]}),(0,B.jsx)(`pre`,{className:`shot-answer`,children:n.answer}),(0,B.jsx)(`span`,{className:`muted`,children:n.deliveredAt?`delivered ${$(n.deliveredAt)}`:`not delivered yet: it goes in as soon as the session is free`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{className:`muted`,children:[`Withdrawn`,n.withdrawnReason?`: ${n.withdrawnReason}`:``]}),Qm(a)>0&&(0,B.jsxs)(`p`,{className:`error`,children:[`It was withdrawn while you judged it: your `,Qm(a),` verdict`,Qm(a)===1?` was`:`s were`,` not sent. In this tab, until it is reloaded, a question of this project with the same shots takes them where it has no verdict yet.`]})]})}),(0,B.jsx)(`div`,{children:(0,B.jsx)(`button`,{className:`small${s?` on`:``}`,"aria-pressed":s,onClick:M,title:`Order (O)`,children:`Looks off first`})}),(0,B.jsxs)(`div`,{className:`keys`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`←`}),(0,B.jsx)(`kbd`,{children:`→`}),` shot`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`↑`}),(0,B.jsx)(`kbd`,{children:`↓`}),` issue`]}),r&&(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`1`}),(0,B.jsx)(`kbd`,{children:`2`}),(0,B.jsx)(`kbd`,{children:`3`}),` verdict, then next`]}),r&&(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`N`}),` note`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`O`}),` order`]}),e.onGoToConversation&&(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`C`}),` conversation`]}),e.onToggleSidebar&&(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`S`}),` sidebar`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`Esc`}),` queue`]})]})]})]})}function ah(e){let t=z(),[n,r]=(0,v.useState)(null),[i]=(0,v.useState)(e.focus);return(0,v.useEffect)(()=>{e.focus!==i&&n?.focus()},[e.focus]),(0,B.jsx)(`textarea`,{...t,id:`shot-note`,ref:r,className:`answer-box`,rows:2,placeholder:eh()?`Write here`:`N to write, Esc to leave`,value:e.value,onChange:t=>e.onChange(t.target.value)})}var oh=e=>e.shots?.length?`${e.shots.length} screenshot${e.shots.length===1?``:`s`}`:null;function sh(e){let t=z(),n=e.question,[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(null),l=async e=>{o(!0),c(null);try{await e()}catch(e){c(e.message)}finally{o(!1)}},u=n.details?.review?n.details:null,d=u?null:oh(n),f=u?n.status===`open`?`Open the review`:`Show the review`:n.status===`open`?`Judge in the screenshot view`:`Show the screenshots`,p=(d||u)&&(e.onOpenInDesk?(0,B.jsx)(`button`,{className:`small`,onClick:e.onOpenInDesk,children:f}):(0,B.jsx)(`a`,{className:`button-link`,href:`#/waiting/q/${n.id}`,children:f})),m=n.shots?.length?(0,B.jsx)(`div`,{className:`chat-thumbs`,children:n.shots.map((e,t)=>(0,B.jsx)(`img`,{src:gd(n.sessionId,e.path),alt:e.path,title:`${e.group} · ${e.path}`},t))}):null,h=(0,B.jsxs)(`div`,{className:`card-head`,children:[(0,B.jsxs)(`strong`,{children:[`Question #`,n.id]}),e.from&&(0,B.jsxs)(B.Fragment,{children:[` · from `,(0,B.jsx)(`strong`,{children:e.from})]}),e.session&&(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(`button`,{className:`link`,onClick:e.session.onOpen,children:e.session.title}),(0,B.jsxs)(`span`,{className:`muted`,children:[` (`,S(e.session.project),`)`]})]}),(0,B.jsxs)(`span`,{className:`muted`,children:[` · `,$(n.askedAt)]}),n.addressedTo!==`user`&&(0,B.jsxs)(`span`,{className:`muted`,children:[` · to manager "`,e.titleOf?.(n.addressedTo)??`manager`,`"`]}),n.aboutQuestion!==null&&(0,B.jsxs)(`span`,{className:`muted`,children:[` · about #`,n.aboutQuestion]}),d&&(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(`span`,{className:`chip shot-chip`,children:d})]}),u&&(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(`span`,{className:`chip review-chip`,children:`Review`})]})]}),g=u?(0,B.jsx)(`div`,{className:`question-text`,children:(0,B.jsx)(`strong`,{children:u.title})}):(0,B.jsx)(`div`,{className:`question-text`,children:(0,B.jsx)(Cd,{text:n.question,onOpenFile:e.onOpenFile})}),_=n.answeredBy===`user`?n.forwardedFrom===null?e.userName:`${e.userName} (passed on by the manager)`:`Manager "${e.titleOf?.(n.answeredBy??``)??`manager`}", under its standing grant`;return n.status===`open`?(0,B.jsxs)(`div`,{id:`qc-${n.id}`,className:`card question-open${e.focus?` focus`:``}`,children:[h,g,m,n.aboutRequest&&(0,B.jsxs)(`p`,{className:`sensitive-note`,children:[(0,B.jsx)(`strong`,{children:`Permission request`}),`: your answer decides it. "Allow once" allows it once; any other answer denies it, with your words as the reason.`]}),n.options&&!p&&(0,B.jsx)(`div`,{className:`question-options`,children:n.options.map(e=>(0,B.jsx)(`button`,{type:`button`,className:`option${r===e?` on`:``}`,onClick:()=>i(e),children:e},e))}),!p&&(0,B.jsx)(`textarea`,{...t,className:`answer-box`,placeholder:n.aboutRequest?`Choose above, or type why you deny it`:n.options?`Choose above or type your answer`:`Type your answer`,value:r,onChange:e=>i(e.target.value),rows:2}),(0,B.jsxs)(`div`,{className:`actions`,children:[p||(0,B.jsx)(`button`,{className:`allow`,disabled:a||!r.trim(),onClick:()=>l(()=>R.answerQuestion(n.id,r)),children:`Answer`}),e.onOpenInDesk&&!p&&(0,B.jsx)(`button`,{className:`small`,title:`Open it in Waiting for you`,onClick:e.onOpenInDesk,children:`Open in Waiting for you`})]}),s&&(0,B.jsx)(`p`,{className:`error`,children:s}),(0,B.jsx)(th,{busy:a,onWithdraw:()=>void l(()=>R.withdrawQuestion(n.id))})]}):(0,B.jsxs)(`div`,{id:`qc-${n.id}`,className:`card question-done ${n.status}${e.focus?` focus`:``}`,children:[h,g,m,n.status===`answered`?(0,B.jsxs)(`p`,{children:[(0,B.jsxs)(`strong`,{children:[_,`:`]}),` `,d||u?(0,B.jsxs)(`span`,{className:`shot-answer`,children:[`
78
- `,n.answer]}):n.answer,(0,B.jsxs)(`span`,{className:`muted`,children:[` · `,n.deliveredAt?`delivered ${$(n.deliveredAt)}`:`not delivered yet: it goes in as soon as the session is free`]})]}):(0,B.jsxs)(`p`,{className:`muted`,children:[`Withdrawn`,n.withdrawnReason?`: ${n.withdrawnReason}`:``]}),p&&(0,B.jsx)(`div`,{className:`actions`,children:p})]})}var ch=80;function lh(e,t,n){return n<=0?null:Math.max(0,e-t-n)}function uh(e){return e<ch}function dh(e,t,n,r){return Math.max(0,n-r-(e?0:t))}function fh(e){return e.addressedTo===`user`?e.sessionId:e.addressedTo}function ph(e,t=null){return t===null?`#/s/${e}`:`#/s/${e}/q/${t}`}function mh(e){let t=e.match(/^#\/s\/([\w-]+)(?:\/q\/(\d+))?$/);return t?{sessionId:t[1],questionId:t[2]?Number(t[2]):null}:null}function hh(e,t){return`#/s/${e}/m/${t}`}function gh(e){let t=e.match(/^#\/s\/([\w-]+)\/m\/(\d+)$/);return t?{sessionId:t[1],messageId:Number(t[2])}:null}function _h(e,t,n){return e.filter(e=>e.sessionId!==t&&fh(e)===t&&(n===null||e.askedAt>=n)).sort((e,t)=>e.askedAt-t.askedAt||e.id-t.id)}function vh(e,t){let n=[...e];for(let e of t){let t=n.length;for(;t>0&&n[t-1].at>e.at;)t--;n.splice(t,0,e)}return n}function yh(e,t,n){return t?[...e]:e.filter(e=>e.id===n)}function $(e){let t=new Date(e),n=t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`});return t.toDateString()===new Date().toDateString()?n:`${t.toLocaleDateString([],{month:`short`,day:`numeric`})}, ${n}`}function bh(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>e?.type===`text`?e.text:e?.type===`image`?`[image]`:``).join(`
79
- `):``}function xh(e){let t=[],n=new Map;for(let r of e){let e={at:r.at};if(r.kind===`user`)t.push({...e,key:`${r.id}`,type:`user`,text:r.data.text,byLedung:r.data.from===`ledung`||!!r.data.answerTo,context:r.data.context??null});else if(r.kind===`question`)t.push({...e,key:`${r.id}`,type:`question`,questionId:r.data.questionId});else if(r.kind===`event`)t.push({...e,key:`${r.id}`,type:`event`,text:r.data.text});else if(r.kind===`shell`)t.push({...e,key:`${r.id}`,type:`shell`,block:r.data});else if(r.kind===`permission`)t.push({...e,key:`${r.id}`,type:`permission`,permissionId:r.data.permissionId,toolName:r.data.toolName,input:r.data.input});else if(r.kind===`sdk`){let i=r.data,a=i.parent_tool_use_id!=null;if(i.type===`assistant`){let o=!1;(i.message?.content??[]).forEach((i,s)=>{if(i.type===`text`&&i.text.trim()&&(t.push({...e,key:`${r.id}.${s}`,type:`assistant`,text:i.text,sub:a,...o?{}:{anchor:r.id}}),o=!0),i.type===`tool_use`){let o={...e,key:`${r.id}.${s}`,type:`tool`,name:i.name,input:i.input??{},result:null,sub:a};n.set(i.id,o),t.push(o)}})}else if(i.type===`user`&&Array.isArray(i.message?.content))for(let e of i.message.content){let t=e.type===`tool_result`?n.get(e.tool_use_id):void 0;t&&(t.result={text:bh(e.content),isError:!!e.is_error,cut:rm(e)})}else if(i.type===`system`&&i.subtype===`init`)t.push({...e,key:`${r.id}`,type:`note`,technical:!0,text:`Claude Code ${i.claude_code_version} · ${i.model} · ${i.cwd}`});else if(i.type===`system`&&i.subtype===`compact_boundary`)t.push({...e,key:`${r.id}`,type:`divider`,text:`${tm(i.compact_metadata)} Everything above stays here, but the session itself now only has a summary of it.`});else if(i.type===`system`&&i.subtype===`task_notification`)t.push({...e,key:`${r.id}`,type:`note`,technical:!0,text:`Background task ${i.status??`finished`}: ${i.summary??i.task_id??``}`});else if(i.type===`result`){let n=i.duration_ms?` in ${(i.duration_ms/1e3).toFixed(0)} s`:``;if(i.subtype===`success`)i.num_turns>0&&t.push({...e,key:`${r.id}`,type:`note`,technical:!0,text:`Turn finished${n}`});else{let n=i.subtype===`error_during_execution`?`Turn stopped`:`Turn ended: ${String(i.subtype).replace(/_/g,` `)}`;t.push({...e,key:`${r.id}`,type:`note`,technical:!1,text:n})}}}}let r=em(t.map(e=>e.type===`assistant`?{kind:`text`,text:e.text,sub:e.sub}:e.type===`tool`?{kind:`tool`,name:e.name,sub:e.sub}:e.type===`user`||e.type===`note`?{kind:`end`}:{kind:`other`}));return t.forEach((e,t)=>{e.type===`assistant`&&r.has(t)&&(e.quiet=!0)}),t}function Sh(e){let t=new Map;for(let n of e)n.kind===`decision`&&t.set(n.data.permissionId,{...n.data,at:n.at});return t}var Ch={allowed:`Allowed`,denied:`Denied`,cancelled:`Withdrawn`},wh=(0,v.memo)(function(e){let{messages:t,permissions:n,showTechnical:r,sessionId:i,hasEarlier:a}=e,o=a?t[0]?.at??null:null,s=(0,v.useMemo)(()=>xh(t),[t]),c=e.focusQuestion??null,l=(0,v.useMemo)(()=>i?yh(_h(Object.values(e.questions),i,o),r,c):[],[e.questions,i,o,r,c]),u=(0,v.useMemo)(()=>vh(s,l.map(e=>({key:`q${e.id}`,at:e.askedAt,type:`question`,questionId:e.id}))),[s,l]),d=(0,v.useMemo)(()=>Sh(t),[t]),f=(0,v.useRef)(null),p=(0,v.useRef)(!0),m=(0,v.useRef)(null),h=e.focusMessage??null,g=c===null?h===null?null:`#mc-${h}`:`#qc-${c}`,_=(0,v.useRef)(null);(0,v.useLayoutEffect)(()=>{let n=f.current;if(n){if(g!==null&&m.current!==g&&t.length>0){let r=n.querySelector(g);if(r){m.current=g,p.current=!1,r.scrollIntoView({block:`center`});return}let i=t[0]?.id??null;i!==null&&a&&_.current!==i&&(_.current=i,e.onLoadEarlier())}p.current&&(n.scrollTop=n.scrollHeight)}},[u,r,g,a]),(0,v.useEffect)(()=>{p.current=m.current===null},[t.length===0]);let y=(0,v.useRef)(0);return(0,v.useEffect)(()=>{let e=f.current;if(!e)return;let t=new ResizeObserver(()=>{e.clientHeight<=0||(e.scrollTop=dh(p.current,y.current,e.scrollHeight,e.clientHeight))});return t.observe(e),()=>t.disconnect()},[]),(0,B.jsxs)(`div`,{className:`messages`,ref:f,onScroll:e=>{let t=e.currentTarget,n=lh(t.scrollHeight,t.scrollTop,t.clientHeight);n!==null&&(y.current=n,p.current=uh(n))},children:[e.hasEarlier&&(0,B.jsx)(`button`,{className:`load-earlier`,onClick:e.onLoadEarlier,children:`Load earlier messages`}),u.map(t=>(0,B.jsx)(Dh,{item:t,showTechnical:r,userName:e.userName,tint:e.tint,sessionId:i,onQuote:e.onQuote,onOpenFile:e.onOpenFile,onOpenBoardThread:e.onOpenBoardThread,onOpenQuestion:e.onOpenQuestion,titleOf:t.type===`question`||t.type===`permission`?e.titleOf:void 0,question:t.type===`question`?e.questions[t.questionId]:void 0,focused:t.type===`question`?t.questionId===c:t.type===`assistant`&&t.anchor!==void 0&&t.anchor===h,live:t.type===`permission`?n[t.permissionId]:void 0,decision:t.type===`permission`?d.get(t.permissionId):void 0},t.key))]})});function Th(e,t){if(e===t)return!0;if(!e||!t)return!1;let n=e,r=t,i=Object.keys(n);return i.length===Object.keys(r).length&&i.every(e=>n[e]===r[e]||e===`result`&&Th(n[e],r[e]))}function Eh(e,t){let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>n===`item`||n===`decision`?Th(e[n],t[n]):e[n]===t[n])}var Dh=(0,v.memo)(function(e){let{item:t,showTechnical:n,sessionId:r}=e,i=(0,B.jsx)(`time`,{className:`time`,children:$(t.at)}),a=(n,r)=>e.onQuote&&(0,B.jsx)(`button`,{className:`quote-button`,title:`Quote this message in your reply`,onClick:()=>e.onQuote(n,t.at,r),children:`Quote`});switch(t.type){case`user`:{let r=t.byLedung&&!n?am(t.text):t.text,o=r||t.context||``,s=He(t.byLedung,r,t.context,n);return s&&!s.length?null:s?.some(e=>e.type===`board`)?(0,B.jsx)(`div`,{className:`board-delivery`,children:s.map((t,n)=>t.type===`board`?(0,B.jsx)(kt,{mark:t.mark,time:i,onOpenThread:e.onOpenBoardThread},n):(0,B.jsxs)(`div`,{className:`msg delivery answer`,children:[(0,B.jsxs)(`div`,{className:`msg-meta`,children:[(0,B.jsx)(`span`,{className:`who`,children:`Delivered by Ledung`}),i]}),(0,B.jsx)(`div`,{className:`msg-body plain`,children:t.text})]},n))}):(0,B.jsxs)(`div`,{className:`msg ${r?`user`:`delivery`}${t.byLedung?` answer`:``}`,children:[(0,B.jsxs)(`div`,{className:`msg-meta`,children:[(0,B.jsx)(`span`,{className:`who`,children:t.byLedung?`Delivered by Ledung`:e.userName}),i,a(t.byLedung?`Ledung`:e.userName,o)]}),(0,B.jsx)(`div`,{className:`msg-body plain`,children:o}),t.context&&r&&(0,B.jsxs)(`details`,{className:`delivered-context`,children:[(0,B.jsxs)(`summary`,{children:[`Attached context (not from `,e.userName,`)`]}),(0,B.jsx)(`div`,{className:`plain`,children:t.context})]})]})}case`assistant`:return(t.sub||t.quiet)&&!n?null:(0,B.jsxs)(`div`,{id:t.anchor===void 0?void 0:`mc-${t.anchor}`,className:`msg assistant${t.sub?` sub`:``}${e.tint?` tinted`:``}${e.focused?` focus`:``}`,style:e.tint,children:[(0,B.jsxs)(`div`,{className:`msg-meta`,children:[(0,B.jsx)(`span`,{className:`who`,children:t.sub?`Subagent`:`Claude`}),i,a(t.sub?`Subagent`:`Claude`,t.text)]}),(0,B.jsx)(`div`,{className:`msg-body`,children:(0,B.jsx)(Cd,{text:t.text,onOpenFile:e.onOpenFile})})]});case`event`:return(0,B.jsxs)(`div`,{className:`event`,children:[t.text,` `,i]});case`shell`:{let n=t.block,r=qp(n);return(0,B.jsxs)(`div`,{className:`msg user shell`,children:[(0,B.jsxs)(`div`,{className:`msg-meta`,children:[(0,B.jsxs)(`span`,{className:`who`,children:[e.userName,` ran`]}),i]}),(0,B.jsxs)(`pre`,{className:`shell-output`,children:[(0,B.jsxs)(`span`,{className:`shell-command`,children:[`$ `,n.command]}),n.stdout?`
80
- ${n.stdout.replace(/\s+$/,``)}`:``,n.stderr?(0,B.jsx)(`span`,{className:`shell-stderr`,children:`
81
- ${n.stderr.replace(/\s+$/,``)}`}):null]}),(0,B.jsx)(`div`,{className:`shell-footer${r.problem?` problem`:``}`,children:r.text})]})}case`question`:{let t=e.question;return t?(0,B.jsx)(sh,{question:t,userName:e.userName,onOpenFile:e.onOpenFile,titleOf:e.titleOf,from:r&&t.sessionId!==r?e.titleOf?.(t.sessionId)??`another session`:void 0,focus:e.focused,onOpenInDesk:e.onOpenQuestion&&(()=>e.onOpenQuestion(t.id))}):null}case`divider`:return(0,B.jsxs)(`div`,{className:`divider`,children:[(0,B.jsx)(`span`,{children:t.text}),` `,i]});case`note`:return t.technical&&!n?null:(0,B.jsxs)(`div`,{className:`note${t.technical?` technical`:``}`,children:[t.text,` `,i]});case`tool`:if(Ke(t.name)&&!t.sub){let n=qe(t.input),r={kind:`out`,service:``,author:``,project:null,threadId:n.threadId,title:n.title,to:n.to||`the thread`,text:n.text,note:``};return(0,B.jsxs)(`div`,{className:`board-delivery${t.result?.isError?` failed`:``}`,children:[(0,B.jsx)(kt,{mark:r,time:i,onOpenThread:e.onOpenBoardThread}),t.result&&(0,B.jsx)(`div`,{className:`note board-result${t.result.isError?` failed`:``}`,children:t.result.text.slice(0,400)})]})}return n?(0,B.jsxs)(`details`,{className:`tool${t.result?.isError?` failed`:``}`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(`span`,{className:`tool-name`,children:t.name}),` `,(0,B.jsx)(`span`,{className:`tool-summary`,children:Am(t.name,t.input)}),` `,i]}),(0,B.jsx)(`pre`,{className:`tool-input`,children:JSON.stringify(t.input,null,2)}),t.result&&(0,B.jsx)(`pre`,{className:`tool-result`,children:t.result.text.slice(0,2e4)}),t.result&&t.result.cut>0&&(0,B.jsx)(`div`,{className:`note technical tool-cut`,children:nm(t.result.cut)})]}):null;case`permission`:{let r=e.live;if(r?.status===`pending`)return(0,B.jsx)(Mm,{permission:r,managerTitle:e.titleOf?.(r.addressedTo)});let a=e.decision;if(!n&&a?.behavior!==`denied`)return null;let o=a&&a.by!==`user`&&a.by!==`simon`&&a.by!==`ledung`?` by manager "${e.titleOf?.(a.by)??`manager`}"`:``,s=a?`${Ch[a.behavior]??a.behavior}${a.scope===`session`?` for this session`:``}${o}`:`Asked`;return(0,B.jsxs)(`div`,{className:`note decision ${a?.behavior??``}`,children:[s,`: `,t.toolName,` `,(0,B.jsx)(`span`,{className:`tool-summary`,children:Am(t.toolName,t.input)}),a?.message&&a.behavior===`denied`?` (“${a.message}”)`:``,` `,i]})}}},Eh),Oh=`~-~~^~-~~~^-~~-~^~~-~^~-~~`,kh=[` |\\ `,` |_\\ `,`\\____/`],Ah=[``,` |\\ `,`\\__/`],jh=[``,` /| `,`\\__/`],Mh=[` |\\ `,` /|_\\`,` \\__/`],Nh=[` | `,` /|\\ `,` \\_/ `],Ph=[` | `,` /|\\ `,` /_|_\\ `,` \\___/ `];function Fh(e,t){let n=e.width,r=Array.from({length:4},()=>Array(n).fill(` `));r[3]=Array.from({length:n},(e,n)=>Oh[(n+t)%26]);for(let[t,i]of Object.entries(e.water??{})){let e=Number(t);e>=0&&e<n&&(r[3][e]=i)}for(let t of e.sprites??[])t.rows.forEach((e,i)=>{let a=(t.y??0)+i;if(a>=4||a===3&&!t.overWater)return;let o=t.x+(t.shear?.[i]??0);for(let t=0;t<e.length;t++){let i=o+t;e[t]!==` `&&i>=0&&i<n&&(r[a][i]=e[t])}});for(let t of e.marks??[])t.x>=0&&t.x<n&&t.y>=0&&t.y<4&&(r[t.y][t.x]=t.ch);return r.map(e=>e.join(``)).join(`
82
- `)}var Ih=e=>({[e-1]:`=`,[e-2]:`=`}),Lh=(e,t)=>Array(e).fill(t);function Rh(e){let t=Math.round((e-6)/2)-1,n={width:e,sprites:[{rows:Ph,x:t-1,overWater:!0}]},r=t-4,i=t+4;return{width:e,stop:t,near:n,left:r,right:i,gathered:{width:e,sprites:[{rows:Nh,x:r,y:1,overWater:!0},{rows:Nh,x:i,y:1,overWater:!0},...n.sprites]},sideAt:t=>({width:e,sprites:[{rows:kh,x:t}],water:Ih(t)})}}function zh(e){return e?.sprites?.at(-1)?.x??-6}function Bh(e,t,n=e.stop){let r=[];if(t>n){for(let n=t;n<e.width;n++)r.push(e.sideAt(n));t=-6}for(let i=t;i<=n;i++)r.push(e.sideAt(i));return r}function Vh(e,t=0,n=20){let r=[7,12].slice(0,Math.min(t,2)),i=6+(r.at(-1)??0),a=[];for(let e=-6;e<n+i-6;e++){let t={};for(let n of r)t[e-n-1]=`-`;a.push({width:n,sprites:[...r.map(t=>({rows:Ah,x:e-t})),{rows:kh,x:e}],water:{...t,...Ih(e)}})}let o=Math.max(0,Math.min(a.length-1,e+6));return{scenes:[...a.slice(o),...a.slice(0,o)],loopFrom:0}}function Hh(e,t,n=20){let r=Rh(n),i=r.stop,a=[...Bh(r,e),...Lh(3,{width:n,sprites:[{rows:Mh,x:i}]}),...Lh(3,{width:n,sprites:[{rows:Nh,x:i}]}),...Lh(4,{width:n,sprites:[{rows:Nh,x:i}],water:{[i+1]:`(`,[i+5]:`)`}}),...Lh(4,{...r.near,water:{[i]:`(`,[i+7]:`)`}})];if(t===`fleet`)return Uh(r,a);let o=a.length;return a.push(...Wh(r,t)),{scenes:a,loopFrom:o}}function Uh(e,t=[]){let n=[...t],r=e.near.sprites;for(let t=0;t<=8;t++){let i=-4+Math.round((e.left+4)*t/8),a=e.width+Math.round((e.right+1-e.width)*t/8);n.push({width:e.width,sprites:[{rows:Ah,x:i},{rows:jh,x:a},...r],water:{[i-1]:`-`,[a+4]:`-`}})}n.push(...Lh(3,{width:e.width,sprites:[e.gathered.sprites[0],{rows:jh,x:e.right+1},...r]}));let i=n.length;return n.push(e.gathered),{scenes:n,loopFrom:i}}function Wh(e,t){if(t===`fleet`)return[e.gathered];if(t===`none`)return[e.near];let n=[];for(let t=-5;t<e.width+2;t++)n.push({width:e.width,sprites:[{rows:Ah,x:t},...e.near.sprites],water:{[t-1]:`-`}});return n}function Gh(e,t=20){return{scenes:Wh(Rh(t),e),loopFrom:0}}function Kh(e=20){return Uh(Rh(e))}function qh(e=0,t=20){let n=Rh(t),r=n.stop,i=n.left-1,a=n.right+3,o=e=>[{rows:Ah,x:i+e},{rows:Ah,x:a+e}],s=[...Lh(3,{width:t,sprites:[n.gathered.sprites[0],n.gathered.sprites[1],{rows:Nh,x:r}],water:{[r+2]:`.`,[r+4]:`.`}}),...Lh(3,{width:t,sprites:[...o(0),{rows:Mh,x:r}]}),...Lh(2,{width:t,sprites:[...o(0),{rows:kh,x:r}]})];for(let e=1;i+e<t;e++)s.push({width:t,sprites:[...o(e),{rows:kh,x:r+e}],water:{[i+e-1]:`-`,[a+e-1]:`-`,...Ih(r+e)}});let c=s.length;return s.push(...Vh(-6,e,t).scenes),{scenes:s,loopFrom:c}}function Jh(e=20){let t=qh(0,e),n=Hh(-6,`none`,e);return{scenes:[...t.scenes.slice(0,t.loopFrom),...n.scenes],loopFrom:t.loopFrom+n.loopFrom}}function Yh(e=0,t=20){let n=Rh(t).stop,r=[...Lh(3,{width:t,sprites:[{rows:Nh,x:n}],water:{[n+2]:`.`,[n+4]:`.`}}),...Lh(3,{width:t,sprites:[{rows:Mh,x:n}]}),...Lh(2,{width:t,sprites:[{rows:kh,x:n}]})],i=r.length;return r.push(...Vh(n+1,e,t).scenes),{scenes:r,loopFrom:i}}function Xh(e,t=20){let n=Rh(t),r=n.stop+1,i=e=>({width:t,...e}),a=[...Bh(n,e,r),...Lh(3,i({sprites:[{rows:kh,x:r,shear:[1,0,0]}]})),...Lh(3,i({sprites:[{rows:kh,x:r,shear:[2,1,0]}],marks:[{x:r-1,y:2,ch:`~`},{x:r+6,y:2,ch:`~`}]})),...Lh(3,i({sprites:[{rows:kh,x:r,y:1,shear:[2,1,0]}],water:{[r]:`*`,[r+6]:`*`}})),...Lh(3,i({sprites:[{rows:kh,x:r,y:2,shear:[2,1,0]}],water:{[r+2]:`o`}})),...Lh(2,i({marks:[{x:r+3,y:2,ch:`o`}],water:{[r+3]:`.`}})),...Lh(2,i({marks:[{x:r+3,y:1,ch:`o`},{x:r+2,y:2,ch:`.`}]})),...Lh(2,i({marks:[{x:r+3,y:0,ch:`.`},{x:r+2,y:1,ch:`o`}]})),...Lh(2,i({marks:[{x:r+2,y:0,ch:`.`}]}))],o=a.length;return a.push(i({})),{scenes:a,loopFrom:o}}function Zh(e=20){return{scenes:[{width:e}],loopFrom:0}}function Qh(e=20){let t=Rh(e),n=Math.max(t.left,0),r=[];for(let i=-4;i<=n;i++)r.push({width:e,sprites:[{rows:Ah,x:i},...t.near.sprites],water:{[i-1]:`-`}});let i=r.length,a=r=>({width:e,sprites:[{rows:Ah,x:n},...t.near.sprites],marks:r?[{x:n+1,y:0,ch:`.`}]:[]});return r.push(...Lh(3,a(!0)),...Lh(3,a(!1))),{scenes:r,loopFrom:i}}function $h(e=20){let t=Rh(e),n=t.stop,r=Math.max(t.left,0),i={rows:Ah,x:r},a=[...Lh(3,{width:e,sprites:[i,{rows:Nh,x:n}],water:{[n+2]:`.`,[n+4]:`.`}}),...Lh(3,{width:e,sprites:[i,{rows:Mh,x:n}]}),...Lh(2,{width:e,sprites:[i,{rows:kh,x:n}]})];for(let t=n+1;t<e;t++)a.push({width:e,sprites:[i,{rows:kh,x:t}],water:Ih(t)});for(let t=r+1;t<=n+1;t++)a.push({width:e,sprites:[{rows:Ah,x:t}],water:{[t-1]:`-`}});a.push(...Lh(3,{width:e,sprites:[{rows:Nh,x:n}]}),...Lh(4,{width:e,sprites:[{rows:Nh,x:n}],water:{[n+1]:`(`,[n+5]:`)`}}));let o=a.length;return a.push(t.near),{scenes:a,loopFrom:o}}function eg(e=20){let t=Rh(e),n=[];for(let r=Math.max(t.left,0)+1;r<e;r++)n.push({width:e,sprites:[{rows:Ah,x:r},...t.near.sprites],water:{[r-1]:`-`}});let r=n.length;return n.push(t.near),{scenes:n,loopFrom:r}}var tg=[50,33,25,20,10],ng=[kh,[` |\\ `,` |.\\ `,`\\____/`],[` |\\ `,` | \\ `,`\\_.__/`],[` | `,` |\\ `,`\\_.__/`],[` / `,` |\\ `,`\\_. _/`],[` , `,` /| `,`\\_. ./`],[` `,` , `,`\\_. /`]],rg=[Ah,[``,` |\\ `,`\\_./`],[``,` |. `,`\\_./`],[``,` | `,`\\_./`],[``,` / `,`\\_./`],[``,` , `,`\\. /`],[``,` `,` ._,`]],ig=ng.length-1,ag={ship:{stages:ng,length:6},boat:{stages:rg,length:4}},og=(e,t)=>e.map(e=>[...e.padEnd(t)].reverse().map(e=>e===`/`?`\\`:e===`\\`?`/`:e).join(``)),sg={ship:ng.map(e=>og(e,6)),boat:rg.map(e=>og(e,4))},cg=[1,2,5,10,20,25],lg=(e,t=`ship`)=>cg.find(n=>n>=50/(e-ag[t].length))??25;function ug(e,t,n=`ship`){let r=Math.max(0,Math.min(100,e));if(r>=100)return 100;if(r>=90)return 90+Math.floor((r-90)/2)*2;let i=lg(t,n);return Math.floor(r/i)*i}var dg=e=>e<90?0:Math.min(ig,Math.floor((e-90)/2)+1),fg=(e,t,n=`ship`)=>Math.round(e/100*(t-ag[n].length)),pg=(e,t)=>({...e>=3?{[t-3]:`.`,[t-5]:`,`}:{},...e>=5?{[t-7]:`.`}:{},...e>=ig?{[t+1]:`o`,[t+5]:`o`,[t-9]:`,`}:{}}),mg=e=>Object.fromEntries(Array.from({length:Math.max(0,e)},(e,t)=>[t,`_`])),hg={0:[` _ `,`| |`,`|_|`],1:[` `,`|`,`|`],2:[` _ `,` _|`,`|_ `],3:[` _ `,` _|`,` _|`],4:[` `,`|_|`,` |`],5:[` _ `,`|_ `,` _|`],6:[` _ `,`|_ `,`|_|`],7:[` _ `,` |`,` |`],8:[` _ `,`|_|`,`|_|`],9:[` _ `,`|_|`,` _|`],"%":[` `,`o/ `,`/o `]},gg=e=>[0,1,2].map(t=>[...e].map(e=>hg[e]?.[t]??``).join(` `));function _g(e,t,n,r,i=`ship`){let a=gg(r),o=r===`100%`?`100%`:`00%`,s=[];return gg(o)[0].length+1<=n?a.forEach((e,t)=>[...e].forEach((e,n)=>{e!==` `&&s.push({x:n,y:t,ch:e})})):o.length<=n&&(s=[...r].map((e,t)=>({x:t,y:0,ch:e}))),{scene:{width:e,sprites:[{rows:ag[i].stages[t],x:n,shear:t===4&&i===`ship`?[1,0,0]:[]}],water:{...mg(n),...t>=ig?{}:Ih(n),...pg(t,n)},marks:s},number:s}}function vg(e,t,n,r=`ship`){let i=ag[r].length,a={...t>=ig?{}:{[n+i]:`=`,[n+i+1]:`=`},...t>=3?{[n+i+2]:`.`,[n+i+4]:`,`}:{}};return{width:e,sprites:[{rows:sg[r][t],x:n,shear:t===4&&r===`ship`?[-1,0,0]:[]}],water:{...mg(n),...a}}}function yg(e,t,n=`ship`){return{width:e,sprites:[{rows:ag[n].stages[0],x:t}],water:n===`ship`?Ih(t):{[t-1]:`-`}}}var bg=(e,t,n=96)=>Math.round((e-1)/(t-1)*(n-6)),xg=(e,t,n=96)=>bg(e,t,n)+3-1;function Sg(e,t,n,r,i=96){let a=r?n===`right`?Ih(e):{[e+6]:`=`,[e+6+1]:`=`}:{};for(let e=1;e<=t;e++)a[xg(e,t,i)]=`o`;return{width:i,sprites:[{rows:n===`right`?kh:sg.ship[0],x:e}],water:a}}var Cg=180;function wg(e,t){let n=t.filter(t=>t.parentId===e.id),r=n.filter(e=>e.status===`running`).length,i=n.filter(e=>e.status!==`ended`).length,a=e.clearedAt;if(e.clearDue!=null&&e.status!==`ended`)return{kind:`clearing`,clearedAt:a};let o=s();return o&&{...o,clearedAt:a};function s(){switch(e.status){case`running`:return e.paused?{kind:`stopped`,behind:c()}:{kind:`working`,followers:e.role===`manager`?r:0};case`stopping`:return{kind:`working`,followers:e.role===`manager`?r:0};case`starting`:case`waiting`:case`idle`:return{kind:`stopped`,behind:c()};case`ended`:return{kind:`sunk`};default:return null}}function c(){return r>0||e.backgroundTasks>0?`busy`:e.role===`manager`&&i>0?`fleet`:`none`}}var Tg=[7,6,5,4],Eg=5,Dg=e=>Tg[(Tg.indexOf(e)+1)%Tg.length],Og=new Map;function kg(e,t){let n=Og.get(e);if(n)return n;let r=()=>{try{let n=Number(localStorage.getItem(e));return Tg.includes(n)?n:t}catch{return t}},i=new Set,a=r(),o={get:()=>a,set(t){a=t;try{localStorage.setItem(e,String(t))}catch{}for(let e of i)e()},subscribe(t){i.add(t);let n=n=>{n.key===e&&(a=r(),t())};return window.addEventListener(`storage`,n),()=>{i.delete(t),window.removeEventListener(`storage`,n)}}};return Og.set(e,o),o}function Ag(e,t){let n=kg(e,t),r=(0,v.useSyncExternalStore)(n.subscribe,n.get);return{size:r,next:Dg(r),step:()=>n.set(Dg(r))}}function jg(e,t,n,r,i){let a=zh(n?.scenes[r]);if(t?.kind===`clearing`&&e.kind!==`clearing`&&e.kind!==`sunk`)return e.clearedAt!=null&&e.clearedAt!==t.clearedAt?$h(i):eg(i);switch(e.kind){case`clearing`:return Qh(i);case`working`:return t?.kind===`stopped`?t.behind===`fleet`?qh(e.followers,i):Yh(e.followers,i):Vh(t?a:-6,e.followers,i);case`stopped`:return t?.kind===`working`?Hh(a,e.behind,i):t?.kind===`stopped`&&t.behind!==`fleet`&&e.behind===`fleet`?Kh(i):t?.kind===`stopped`&&t.behind===`fleet`&&e.behind===`none`?Jh(i):Gh(e.behind,i);case`sunk`:return t&&t.kind!==`sunk`?Xh(a,i):Zh(i)}}var Mg=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Ng({mode:e,width:t=20,sizeButton:n=!0,hideWhenSunk:r=!1,maxSize:i}){let a=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,o=(0,v.useRef)(null),s=(0,v.useRef)(0),c=(0,v.useRef)(null),[l,u]=(0,v.useState)(0),{size:d,next:f,step:p}=Ag(`ledung.shipSize`,Eg),m=(o.current?.oneShot??!1)&&s.current<o.current.loopFrom;if(!Mg(c.current,e)&&!m){let n=a&&e.kind===`working`?Vh(4,e.followers,t):jg(e,c.current,o.current,s.current,t),r=c.current?.kind===`clearing`&&e.kind!==`clearing`&&e.kind!==`sunk`;o.current=n,s.current=a?n.loopFrom:0,r&&(n.oneShot=!0),c.current=r?{kind:`stopped`,behind:`none`,clearedAt:e.clearedAt}:e}(0,v.useEffect)(()=>{if(a)return;let e=setInterval(()=>{let e=o.current;e&&(s.current=s.current+1<e.scenes.length?s.current+1:e.loopFrom),u(e=>e+1)},Cg);return()=>clearInterval(e)},[a]);let h=o.current;if(r&&e.kind===`sunk`&&s.current>=h.loopFrom)return null;let g=h.scenes[s.current],_=(0,B.jsx)(`pre`,{className:`sailing-ship`,style:{fontSize:`${i?Math.min(d,i):d}px`},"aria-hidden":`true`,children:Fh(g,a?0:l)});return n?(0,B.jsx)(`button`,{type:`button`,className:`ship-button`,title:`Ship size ${d}px: click for ${f}px`,onClick:p,children:_}):_}function Pg(e,t){let n=null,r=null,i=new Map,a=!1;for(let o of e){if(o.kind===`user`&&(n=o.at,r=null,i.clear(),a=!1),o.kind!==`sdk`)continue;let e=o.data;if(e.type===`assistant`&&e.parent_tool_use_id==null)for(let n of e.message?.content??[])if(n.type===`tool_use`){let e=Am(n.name,n.input??{});i.set(n.id,{label:e?`${n.name}: ${e}`:n.name,uacWait:t&&k(n.name,n.input??{})}),a=!1}else n.type===`text`&&n.text.trim()&&(a=!0);else if(e.type===`user`&&Array.isArray(e.message?.content))for(let t of e.message.content)t.type===`tool_result`&&i.delete(t.tool_use_id);else e.type===`result`&&e.num_turns>0&&(r=o.at,i.clear())}let o=[...i.values()].pop(),s=o?`Running ${o.label}`:a?`Writing`:`Thinking`;return{since:n,doing:s,uacWait:!!o?.uacWait,finishedAt:r}}function Fg(e){let t=Math.max(0,Math.floor(e/1e3));return t<60?`${t} s`:`${Math.floor(t/60)} min ${String(t%60).padStart(2,`0`)} s`}function Ig(e){return e.status===`ended`&&/exited with code [1-9]|stopped unexpectedly/.test(e.endReason??``)}function Lg({session:e,sessions:t,messages:n,extra:r}){let i=(0,v.useMemo)(()=>Pg(n,!!e.uac),[n,e.uac]),[a,o]=(0,v.useState)(Date.now()),s=e.status===`running`||e.status===`stopping`,c=t.filter(t=>t.parentId===e.id&&t.status===`running`).length,l=wg(e,t);(0,v.useEffect)(()=>{if(!s)return;let e=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(e)},[s]);let u,d;if(e.status===`waiting`)u=`waiting`,d=`Waiting for your answer above`;else if(s){u=`working`;let t=e.status===`stopping`?`Stopping`:i.doing;d=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`working-label`,children:t}),e.status===`running`&&i.uacWait&&(0,B.jsxs)(`span`,{className:`uac-hint`,children:[` · `,`may be waiting for UAC on the PC`]}),e.status===`running`&&i.since&&(0,B.jsxs)(`span`,{className:`muted`,children:[` · `,Fg(a-i.since)]})]})}else if(e.status===`starting`)u=`done`,d=(0,B.jsx)(`span`,{className:`working-label`,children:`Ready`});else if(e.status===`idle`)u=`done`,d=(0,B.jsxs)(`span`,{className:`working-label`,children:[`Done`,i.finishedAt?` at ${$(i.finishedAt)}`:``,e.backgroundTasks>0?` · ${e.backgroundTasks} background task(s) still running`:``,c>0?` · ${c} session(s) still working`:``]});else if(e.status===`ended`){let t=Ig(e);u=t?`failed`:`done`;let n=e.endedAt?` at ${$(e.endedAt)}`:``;d=(0,B.jsx)(`span`,{className:`working-label`,children:t?`Ended with an error${n}`:`Ended${n}${e.endReason?` · ${e.endReason.split(`
83
- `)[0]}`:``}`})}else return null;return l?(0,B.jsxs)(`div`,{className:`status-line ${u}`,role:`status`,"aria-live":`polite`,children:[(0,B.jsx)(Ng,{mode:l}),d,r]}):null}var Rg=`modulepreload`,zg=function(e){return`/`+e},Bg={},Vg=function(e){return e.pathname.endsWith(`.css`)},Hg=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Ug=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=zg(t,n);let r=s(t),i=Vg(r);return Hg(Bg,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Rg,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Wg={ts:`typescript`,tsx:`typescript`,mts:`typescript`,cts:`typescript`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,py:`python`,sh:`bash`,bash:`bash`,zsh:`bash`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,cs:`csharp`,css:`css`,html:`xml`,htm:`xml`,xml:`xml`,svg:`xml`,csproj:`xml`,yml:`yaml`,yaml:`yaml`,md:`markdown`,markdown:`markdown`,sql:`sql`,go:`go`,rs:`rust`,java:`java`,ini:`ini`,toml:`ini`,cfg:`ini`,diff:`diff`,patch:`diff`},Gg={dockerfile:`dockerfile`,".gitignore":`bash`};function Kg(e){let t=e.split(`/`).pop().toLowerCase();if(Gg[t])return Gg[t];let n=t.lastIndexOf(`.`);return n===-1?null:Wg[t.slice(n+1)]??null}var qg=(e,t=e.split(`
84
- `).length)=>e.length<=262144&&t<=8e3;function Jg(e){let t=[],n=[],r=``;for(let i of e.split(/(<span[^>]*>|<\/span>|\n)/))i&&(i===`
85
- `?(t.push(r+`</span>`.repeat(n.length)),r=n.join(``)):i.startsWith(`<span`)?(n.push(i),r+=i):(i===`</span>`&&n.pop(),r+=i));return t.push(r+`</span>`.repeat(n.length)),t}function Yg(e,t){let n=Kg(e.path);if(!t||!n)return null;let r=e.hunks.flatMap(e=>e.lines);if(!qg(r.map(e=>e.text).join(`
86
- `),r.length))return null;let i=new Map;for(let r of e.hunks)for(let e of[r.lines.filter(e=>e.kind!==`del`),r.lines.filter(e=>e.kind===`del`)]){if(!e.length)continue;let r=t(e.map(e=>e.text).join(`
87
- `),n);e.forEach((e,t)=>i.set(e,r[t]??``))}return i}var Xg=null;function Zg(){return Xg??=Ug(()=>import(`./highlightCore-CFmgAbRi.js`).then(e=>e.highlight),[]),Xg}function Qg(){let[e,t]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let e=!0;return Zg().then(n=>e&&t({fn:n}),()=>{}),()=>{e=!1}},[]),e?.fn??null}function $g(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function e_({text:e,path:t}){let n=e.replace(/\n$/,``).split(`
88
- `),r=Qg(),i=Kg(t),a=(0,v.useMemo)(()=>r&&i&&qg(e,n.length)?r(n.join(`
89
- `),i):null,[r,i,e]);return(0,B.jsx)(`pre`,{className:`file-text numbered hl`,style:{"--ln-width":`${String(n.length).length+1}ch`},children:(0,B.jsx)(`code`,{children:a?a.map((e,t)=>(0,B.jsx)(`span`,{className:`ln-row`,dangerouslySetInnerHTML:{__html:`${e}\n`}},t)):n.map((e,t)=>(0,B.jsxs)(`span`,{className:`ln-row`,children:[e,`
90
- `]},t))})})}function t_(e){let t=e.stack[e.stack.length-1],[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1),c=hd(t);return(0,v.useEffect)(()=>{if(s(!1),c)return;let n=!0;return r(null),a(null),R.file(e.sessionId,t,e.folder).then(e=>n&&r(e),e=>n&&a(e.message)),()=>{n=!1}},[e.sessionId,t,c,e.folder]),(0,B.jsxs)(`aside`,{className:`file-panel`,"aria-label":`File`,children:[(0,B.jsxs)(`header`,{className:`file-head`,children:[(e.stack.length>1||e.backToPane)&&(0,B.jsx)(`button`,{className:`small`,onClick:e.onBack,children:e.backToPane&&e.stack.length===1?`‹ Files`:`Back`}),(0,B.jsx)(`span`,{className:`file-path`,title:!c&&n?.path||t,children:!c&&n?.path||t}),c&&(0,B.jsx)(`button`,{className:`small`,onClick:()=>s(!o),children:o?`Fit to panel`:`Full size`}),!c&&n&&(0,B.jsx)(yd,{text:n.content,label:`Copy all`}),(0,B.jsx)(`button`,{className:`small`,onClick:e.onClose,"aria-label":`Close`,children:`Close`})]}),(0,B.jsxs)(`div`,{className:`file-body`,children:[!c&&i&&(0,B.jsx)(`p`,{className:`error`,children:i}),c&&(0,B.jsx)(_d,{sessionId:e.sessionId,path:t,folder:e.folder,full:o,onClick:()=>s(!o)},t),!c&&!n&&!i&&(0,B.jsx)(`p`,{className:`muted`,children:`Loading…`}),!c&&n?.kind===`markdown`&&(0,B.jsx)(Cd,{text:n.content,baseDir:$g(n.path),onOpenFile:e.onOpen,sessionId:e.sessionId}),!c&&n?.kind===`text`&&(0,B.jsx)(e_,{text:n.content,path:n.path})]})]})}var n_=300;function r_(e){let t=e.replace(/\t/g,` `).trim();return t.length>n_?`${t.slice(0,n_)}…`:t}function i_(e,t){let n=[...new Set(e.map(e=>e.commit.slice(0,7)))];return[`${e.length} line comment${e.length===1?``:`s`} on ${t} at ${n.join(`, `)}:`,...e.map((e,t)=>{let n=e.side===`old`?`-`:`+`,r=`${e.path}:${e.line}${e.side===`old`?` (old)`:``}`,i=e.body.split(`
91
- `).map(e=>` ${e}`).join(`
92
- `);return`${t+1}. ${r} ${n} ${r_(e.lineText)}\n${i}`})].join(`
93
- `)}function a_(e,t,n){let r=t.trim();return e===`accept`?`${N}\n\n${r?`${r}\n\n`:``}Notes, not blocking:\n${n}`:`${P} ${r?`${r}\n\n`:``}${n}`}function o_(e,t,n,r){let i=t.trim();return`${r?`${e}'s line comments on the changes of your session "${r}". Hand them on as a review round; each is a finding to check, not an order.`:`${e}'s line comments on your changes. Each is a finding to check, not an order.`}\n\n${i?`${i}\n\n`:``}${n}`}function s_(e,t){let n=new Map(t.map(e=>[e.id,e]));return t.filter(t=>t.status===`open`&&t.addressedTo===`user`&&t.details?.review&&(t.sessionId===e||t.aboutQuestion!==null&&n.get(t.aboutQuestion)?.sessionId===e)).sort((e,t)=>t.askedAt-e.askedAt)[0]??null}var c_=e=>`ledung.lineComments.${e}`;function l_(e,t){try{let n=JSON.parse(e.getItem(c_(t))??`[]`);return Array.isArray(n)?n.filter(e=>e&&typeof e.id==`string`&&typeof e.body==`string`):[]}catch{return[]}}function u_(e,t,n){try{n.length?e.setItem(c_(t),JSON.stringify(n)):e.removeItem(c_(t))}catch{}}var d_=(e,t)=>e.path===t.path&&e.line===t.line&&e.side===t.side;function f_(e,t){let n=e.filter(e=>e.id!==t.id&&!d_(e,t));if(!t.body.trim())return n;let r=e.findIndex(e=>e.id===t.id||d_(e,t));if(r===-1)return[...n,t];let i=[...n];return i.splice(Math.min(r,i.length),0,t),i}var p_=`(max-width: 760px)`;function m_(){let[e,t]=(0,v.useState)(()=>typeof matchMedia==`function`&&matchMedia(p_).matches);return(0,v.useEffect)(()=>{if(typeof matchMedia!=`function`)return;let e=matchMedia(p_),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function h_(e){let[t,n]=(0,v.useState)(`files`),[r,i]=(0,v.useState)(()=>l_(localStorage,e.session.id));return(0,v.useEffect)(()=>u_(localStorage,e.session.id,r),[e.session.id,r]),(0,B.jsxs)(`aside`,{className:`file-panel files-pane`,"aria-label":`Files`,hidden:e.hidden,children:[(0,B.jsxs)(`header`,{className:`file-head`,children:[(0,B.jsx)(`strong`,{children:`Files`}),(0,B.jsx)(`span`,{className:`chip test-feature`,title:`A test feature: Martin is trying it out (issue #225). It may change or go.`,children:`Test feature`}),(0,B.jsx)(`span`,{className:`spacer`}),(0,B.jsx)(`button`,{className:`small`,onClick:e.onClose,"aria-label":`Close the Files pane`,children:`Close`})]}),(0,B.jsxs)(`div`,{className:`pane-tabs`,role:`tablist`,children:[(0,B.jsx)(`button`,{role:`tab`,"aria-selected":t===`files`,className:t===`files`?`on`:``,onClick:()=>n(`files`),children:`Files`}),(0,B.jsxs)(`button`,{role:`tab`,"aria-selected":t===`changes`,className:t===`changes`?`on`:``,onClick:()=>n(`changes`),children:[`Changes`,r.length?(0,B.jsxs)(`span`,{className:`chip draft`,children:[r.length,` draft`]}):null]})]}),(0,B.jsx)(`div`,{className:`pane-body`,hidden:t!==`files`,children:(0,B.jsx)(g_,{session:e.session,onOpenFile:e.onOpenFile})}),(0,B.jsx)(`div`,{className:`pane-body`,hidden:t!==`changes`,children:(0,B.jsx)(y_,{...e,drafts:r,setDrafts:i,active:t===`changes`})})]})}function g_(e){let t=e.session.id,[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(`session`),[c,l]=(0,v.useState)({}),[u,d]=(0,v.useState)(new Set),[f,p]=(0,v.useState)(``),m=z();(0,v.useEffect)(()=>{R.paneFolders(t).then(e=>r(e.folders),e=>a(e.message))},[t]);let h=e=>{R.tree(t,o,e).then(t=>l(n=>({...n,[e]:t})),t=>l(n=>({...n,[e]:{error:t.message}})))};(0,v.useEffect)(()=>{l({}),d(new Set),h(``)},[t,o]);let g=t=>{if(!t.dir)return e.onOpenFile(t.path,o);if(t.skipped)return;let n=new Set(u);n.has(t.path)?n.delete(t.path):(n.add(t.path),c[t.path]||h(t.path)),d(n)},_=[],y=(e,t)=>{let n=c[e];if(!(!n||`error`in n))for(let e of n.entries)_.push({e,depth:t}),e.dir&&u.has(e.path)&&y(e.path,t+1)};y(``,0);let b=f.trim().toLowerCase(),x=b?Object.values(c).flatMap(e=>`error`in e?[]:e.entries).filter(e=>e.name.toLowerCase().includes(b)).sort((e,t)=>e.path.localeCompare(t.path)):null,S=c[``],C=n?.find(e=>e.key===o);return i?(0,B.jsx)(`p`,{className:`error pane-note`,children:i}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`pane-tools`,children:[n&&n.length>1&&(0,B.jsx)(`div`,{className:`seg-control`,role:`radiogroup`,"aria-label":`Which folder`,children:n.map(e=>(0,B.jsx)(`button`,{role:`radio`,"aria-checked":o===e.key,className:o===e.key?`on`:``,onClick:()=>s(e.key),title:e.path,children:e.label},e.key))}),C&&(0,B.jsx)(`div`,{className:`muted mono pane-root`,title:C.path,children:C.path}),(0,B.jsx)(`input`,{...m,className:`pane-filter`,type:`search`,placeholder:`Filter by name…`,value:f,onChange:e=>p(e.target.value),"aria-label":`Filter files by name`})]}),(0,B.jsxs)(`div`,{className:`tree`,role:`tree`,children:[S&&`error`in S&&(0,B.jsx)(`p`,{className:`error pane-note`,children:S.error}),!S&&(0,B.jsx)(`p`,{className:`muted pane-note`,children:`Loading…`}),x&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{className:`muted pane-note`,children:[x.length,` match`,x.length===1?``:`es`,` in the folders opened so far.`]}),x.map(e=>(0,B.jsx)(__,{e,depth:0,label:e.path,open:u.has(e.path),onClick:()=>g(e)},e.path))]}),!x&&_.map(({e,depth:t})=>(0,B.jsxs)(v.Fragment,{children:[(0,B.jsx)(__,{e,depth:t,open:u.has(e.path),onClick:()=>g(e)}),e.dir&&u.has(e.path)&&c[e.path]&&`error`in c[e.path]&&(0,B.jsx)(`p`,{className:`error pane-note`,style:{paddingLeft:`${(t+1)*14+8}px`},children:c[e.path].error}),e.dir&&u.has(e.path)&&!c[e.path]&&(0,B.jsx)(`p`,{className:`muted pane-note`,style:{paddingLeft:`${(t+1)*14+8}px`},children:`Loading…`})]},e.path)),S&&!(`error`in S)&&S.truncated&&(0,B.jsx)(`p`,{className:`muted pane-note`,children:`Only the first 1000 names are shown.`})]}),(0,B.jsxs)(`p`,{className:`muted pane-foot`,children:[`Read-only. Only what is inside this folder. Names starting with . or $ are not listed`,e.session.project===`~chats`?`, nor folders where settings and sign-ins are kept`:``,`; node_modules and what .gitignore leaves out are greyed.`]})]})}function __(e){let{e:t}=e,n=t.name.lastIndexOf(`.`),r=e.label??t.name;return(0,B.jsxs)(`button`,{role:`treeitem`,"aria-expanded":t.dir&&!t.skipped?e.open:void 0,className:`tree-row${t.skipped?` skipped`:``}${t.dir?` dir`:``}`,style:{paddingLeft:`${e.depth*14+8}px`},onClick:e.onClick,disabled:t.dir&&!!t.skipped,title:t.skipped===`heavy`?`Not listed: a heavy folder`:t.skipped===`ignored`?`Left out by .gitignore`:t.path,children:[(0,B.jsx)(`span`,{className:`tree-caret`,"aria-hidden":`true`,children:t.dir?t.skipped?`·`:e.open?`▾`:`▸`:``}),t.dir?(0,B.jsxs)(`span`,{children:[r,`/`]}):n>0&&!e.label?(0,B.jsxs)(`span`,{children:[t.name.slice(0,n),(0,B.jsx)(`span`,{className:`ext`,children:t.name.slice(n)})]}):(0,B.jsx)(`span`,{children:r}),t.skipped&&(0,B.jsx)(`span`,{className:`tree-note`,children:t.skipped===`heavy`?`not listed`:`ignored`})]})}var v_=e=>e.kind===`del`?{line:e.old,side:`old`}:{line:e.new,side:`new`};function y_(e){let t=e.session.id,n=m_(),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(0),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(null),h=(0,v.useRef)(!1),g=()=>{o(null),R.changes(t).then(e=>{i(e),c(t=>Math.min(t,Math.max(0,e.files.length-1)))},e=>o(e.message))};(0,v.useEffect)(()=>{e.active&&!h.current&&(h.current=!0,g())},[e.active]);let _=r?.files??[],y=_.reduce((e,t)=>e+t.added,0),b=_.reduce((e,t)=>e+t.removed,0),x=n?_.slice(s,s+1):_,S=t=>{e.setDrafts(e=>f_(e,t)),u(null),m(null)};return a?(0,B.jsxs)(`p`,{className:`error pane-note`,children:[a,` `,(0,B.jsx)(`button`,{className:`small`,onClick:g,children:`Try again`})]}):r?(0,B.jsxs)(`div`,{className:`changes-tab`,children:[(0,B.jsxs)(`div`,{className:`changes-head`,children:[(0,B.jsx)(`span`,{children:r.problem??(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`strong`,{children:[_.length,` file`,_.length===1?``:`s`]}),` `,(0,B.jsxs)(`span`,{className:`plus`,children:[`+`,y]}),` `,(0,B.jsxs)(`span`,{className:`minus`,children:[`−`,b]}),(0,B.jsxs)(`span`,{className:`muted`,children:[` · `,r.branch??`HEAD`,` against `,r.base,` · at `,(0,B.jsx)(`span`,{className:`mono`,children:r.head?.slice(0,7)})]})]})}),(0,B.jsx)(`button`,{className:`small`,onClick:g,title:`Read the changes again`,children:`Refresh`})]}),r.truncated&&(0,B.jsx)(`p`,{className:`warn pane-note`,children:`The diff is larger than 1 MB, so it is cut: only the files above the cut are shown, the last one perhaps in part.`}),!r.problem&&!_.length&&(0,B.jsx)(`p`,{className:`muted pane-note`,children:`No changes yet: this branch has no commits of its own. Uncommitted edits are not shown.`}),n&&_.length>0&&(0,B.jsxs)(`div`,{className:`file-step`,children:[(0,B.jsx)(`button`,{className:`small`,"aria-label":`Previous file`,disabled:s===0,onClick:()=>c(s-1),children:`‹`}),(0,B.jsx)(`select`,{value:s,onChange:e=>c(Number(e.target.value)),"aria-label":`Changed file`,children:_.map((e,t)=>(0,B.jsxs)(`option`,{value:t,children:[e.path,` · `,t+1,` of `,_.length]},e.path))}),(0,B.jsx)(`button`,{className:`small`,"aria-label":`Next file`,disabled:s>=_.length-1,onClick:()=>c(s+1),children:`›`})]}),!n&&_.length>1&&(0,B.jsx)(`ul`,{className:`changed-files`,children:_.map(n=>{let r=e.drafts.filter(e=>e.path===n.path).length;return(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`button`,{className:`link mono`,onClick:()=>document.getElementById(b_(t,n.path))?.scrollIntoView({block:`start`}),children:n.path}),r>0&&(0,B.jsx)(`span`,{className:`chip draft`,children:r}),(0,B.jsxs)(`span`,{className:`plus`,children:[`+`,n.added]}),` `,(0,B.jsxs)(`span`,{className:`minus`,children:[`−`,n.removed]})]},n.path)})}),x.map(n=>(0,B.jsx)(x_,{sessionId:t,file:n,head:r.head??``,userName:e.userName,drafts:e.drafts.filter(e=>e.path===n.path),editing:l?.path===n.path?l.line:null,onEdit:e=>u(e?{path:n.path,line:e}:null),onSave:S,onRemove:t=>e.setDrafts(e=>e.filter(e=>e.id!==t.id)),onWhole:()=>e.onOpenFile(n.path,`session`)},n.path)),(0,B.jsx)(C_,{...e,sending:d,setSending:f,sent:p,setSent:m})]}):(0,B.jsx)(`p`,{className:`muted pane-note`,children:`Loading the changes…`})}var b_=(e,t)=>`diff-${e}-${t}`;function x_(e){let t=e.file,n=Qg(),r=(0,v.useMemo)(()=>Yg(t,n),[t,n]);return(0,B.jsxs)(`section`,{className:`diff-file`,id:b_(e.sessionId,t.path),children:[(0,B.jsxs)(`header`,{className:`diff-file-head`,children:[(0,B.jsxs)(`span`,{className:`mono diff-path`,title:t.oldPath?`${t.oldPath} → ${t.path}`:t.path,children:[t.oldPath?`${t.oldPath} → `:``,t.path]}),t.status!==`modified`&&(0,B.jsx)(`span`,{className:`chip`,children:t.status}),(0,B.jsxs)(`span`,{className:`plus`,children:[`+`,t.added]}),` `,(0,B.jsxs)(`span`,{className:`minus`,children:[`−`,t.removed]}),t.status!==`deleted`&&!t.binary&&(0,B.jsx)(`button`,{className:`small`,onClick:e.onWhole,title:`Open the whole file, read-only`,children:`Whole file`})]}),t.binary&&(0,B.jsx)(`p`,{className:`muted pane-note`,children:`A binary file: not shown.`}),!t.binary&&!t.hunks.length&&(0,B.jsx)(`p`,{className:`muted pane-note`,children:`Renamed or its mode changed; no lines differ.`}),(0,B.jsxs)(`table`,{className:`diff-table`,children:[(0,B.jsxs)(`colgroup`,{children:[(0,B.jsx)(`col`,{className:`c-ln`}),(0,B.jsx)(`col`,{className:`c-ln`}),(0,B.jsx)(`col`,{})]}),(0,B.jsx)(`tbody`,{children:t.hunks.map((n,i)=>(0,B.jsxs)(v.Fragment,{children:[(0,B.jsx)(`tr`,{className:`hunk`,children:(0,B.jsx)(`td`,{colSpan:3,className:`mono`,children:n.header})}),n.lines.map((n,i)=>{let a=v_(n),o=e.drafts.filter(e=>d_(e,{path:t.path,...a})),s=e.editing===n;return(0,B.jsxs)(v.Fragment,{children:[(0,B.jsxs)(`tr`,{className:`dl ${n.kind}${o.length?` commented`:``}${s?` editing`:``}`,onClick:()=>e.onEdit(s?null:n),title:`Click to comment on this line`,children:[(0,B.jsx)(`td`,{className:`ln`,children:n.old??``}),(0,B.jsx)(`td`,{className:`ln`,children:n.new??``}),(0,B.jsxs)(`td`,{className:`code hl`,children:[(0,B.jsx)(`span`,{className:`mark`,children:n.kind===`add`?`+`:n.kind===`del`?`−`:` `}),r?.has(n)?(0,B.jsx)(`span`,{dangerouslySetInnerHTML:{__html:r.get(n)}}):n.text]})]}),o.map(t=>(0,B.jsx)(`tr`,{className:`comment-row`,children:(0,B.jsx)(`td`,{colSpan:3,children:(0,B.jsxs)(`div`,{className:`line-comment`,children:[(0,B.jsxs)(`div`,{className:`line-comment-head`,children:[(0,B.jsx)(`strong`,{children:e.userName}),` `,(0,B.jsx)(`span`,{className:`chip draft`,children:`draft`}),` `,(0,B.jsxs)(`span`,{className:`muted`,children:[`line `,t.line,t.side===`old`?` (old)`:``]}),(0,B.jsx)(`span`,{className:`spacer`}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>e.onEdit(n),children:`Edit`}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>e.onRemove(t),children:`Delete`})]}),(0,B.jsx)(`div`,{className:`line-comment-body`,children:t.body})]})})},t.id)),s&&(0,B.jsx)(`tr`,{className:`comment-row`,children:(0,B.jsx)(`td`,{colSpan:3,children:(0,B.jsx)(S_,{path:t.path,line:n,head:e.head,existing:o[0]??null,onCancel:()=>e.onEdit(null),onSave:e.onSave})})})]},i)})]},i))})]})]})}function S_(e){let[t,n]=(0,v.useState)(e.existing?.body??``),r=z(),i=(0,v.useRef)(null),a=(0,v.useRef)(null);(0,v.useEffect)(()=>{i.current?.focus({preventScroll:!0}),a.current?.scrollIntoView({block:`nearest`})},[]);let o=v_(e.line),s=Qg(),c=Kg(e.path),l=s&&c?s(e.line.text,c)[0]??null:null,u=()=>{if(!t.trim())return e.existing?e.onSave({...e.existing,body:``}):e.onCancel();e.onSave({id:e.existing?.id??`${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`,path:e.path,...o,lineText:e.line.text,commit:e.head,body:t})};return(0,B.jsxs)(`div`,{ref:a,className:`comment-editor`,role:`dialog`,"aria-label":`Comment on line ${o.line}`,onClick:e=>e.stopPropagation(),children:[(0,B.jsxs)(`div`,{className:`comment-editor-head`,children:[(0,B.jsxs)(`strong`,{children:[`Comment on line `,o.line,o.side===`old`?` (old)`:``]}),(0,B.jsx)(`span`,{className:`muted mono`,children:e.path})]}),(0,B.jsxs)(`pre`,{className:`quoted-line hl ${e.line.kind}`,children:[e.line.kind===`add`?`+ `:e.line.kind===`del`?`− `:` `,l===null?e.line.text:(0,B.jsx)(`span`,{dangerouslySetInnerHTML:{__html:l}})]}),(0,B.jsx)(`textarea`,{...r,ref:i,className:`box`,value:t,placeholder:`What should the worker look at here?`,onChange:e=>n(e.target.value),onKeyDown:t=>{t.key===`Enter`&&(t.ctrlKey||t.metaKey)&&(t.preventDefault(),u()),t.key===`Escape`&&(t.preventDefault(),e.onCancel())}}),(0,B.jsx)(`p`,{className:`muted`,children:`Kept as a draft until you send; nothing reaches the worker yet.`}),(0,B.jsxs)(`div`,{className:`send`,children:[(0,B.jsx)(`button`,{onClick:e.onCancel,children:`Cancel`}),(0,B.jsx)(`button`,{className:`primary`,onClick:u,children:e.existing?`Save comment`:`Add comment`})]})]})}function C_(e){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(`changes`),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),l=z(),u=(0,v.useMemo)(()=>s_(e.session.id,e.questions),[e.session.id,e.questions]),d=e.session.parentId?e.sessions.find(t=>t.id===e.session.parentId)??null:null,f=e.drafts.length,p=f?i_(e.drafts,e.session.title):``,m=u?a_(r,a,p):o_(e.userName,a,p,d?e.session.title:null),h=async()=>{e.setSending(!0),c(``);try{let t=e.drafts.map(({id:e,...t})=>t);await R.sendLineComments(e.session.id,{verdict:u?r:null,text:a,comments:t}),e.setDrafts(()=>[]),e.setSent(u?`Sent with your ${r===`accept`?`Accept`:`"Changes needed"`} on the review.`:`Sent to ${d?.title??e.session.title}.`),n(!1),o(``)}catch(e){c(e.message)}finally{e.setSending(!1)}};return(0,B.jsxs)(`div`,{className:`comment-bar`,children:[t&&f>0&&(0,B.jsxs)(`div`,{className:`send-panel`,children:[(0,B.jsxs)(`h4`,{children:[`Send `,f,` comment`,f===1?``:`s`]}),u?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{className:`muted`,children:[`With your answer to the open review`,` `,(0,B.jsx)(`button`,{className:`link`,onClick:()=>e.onOpenQuestion(u.id),children:u.details?.title??`#${u.id}`}),`.`]}),(0,B.jsxs)(`label`,{className:`radio`,children:[(0,B.jsx)(`input`,{type:`radio`,checked:r===`changes`,onChange:()=>i(`changes`)}),` `,(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:`As “Changes needed”`}),(0,B.jsx)(`br`,{}),(0,B.jsx)(`span`,{className:`muted`,children:`The manager hands them to the worker as a review round; each one is a finding to check, not an order.`})]})]}),(0,B.jsxs)(`label`,{className:`radio`,children:[(0,B.jsx)(`input`,{type:`radio`,checked:r===`accept`,onChange:()=>i(`accept`)}),` `,(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:`As notes with “Accept”`}),(0,B.jsx)(`br`,{}),(0,B.jsx)(`span`,{className:`muted`,children:`Small things the worker may take or leave; the change can go ahead.`})]})]})]}):(0,B.jsxs)(`p`,{className:`muted`,children:[`No review is open for this session, so they go `,d?(0,B.jsxs)(B.Fragment,{children:[`to its manager `,(0,B.jsx)(`strong`,{children:d.title})]}):(0,B.jsxs)(B.Fragment,{children:[`to `,(0,B.jsx)(`strong`,{children:e.session.title}),` itself`]}),` as one message from you`,d?`, to hand on as a review round`:``,`.`]}),(0,B.jsx)(`textarea`,{...l,className:`box`,placeholder:`A note above the comments (optional)`,value:a,onChange:e=>o(e.target.value)}),(0,B.jsxs)(`details`,{className:`send-preview`,children:[(0,B.jsx)(`summary`,{children:`What goes`}),(0,B.jsx)(`pre`,{children:m})]}),(0,B.jsxs)(`div`,{className:`send`,children:[(0,B.jsx)(`button`,{onClick:()=>n(!1),children:`Cancel`}),(0,B.jsx)(`button`,{className:`primary`,disabled:e.sending,onClick:()=>void h(),children:u?r===`accept`?`Send with Accept`:`Send changes needed`:`Send`}),(0,B.jsx)(`span`,{className:`status`,role:`status`,children:s})]})]}),(0,B.jsxs)(`div`,{className:`comment-bar-row`,children:[(0,B.jsx)(`span`,{children:f?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`strong`,{children:[f,` comment`,f===1?``:`s`]}),` `,(0,B.jsx)(`span`,{className:`chip draft`,children:`draft`})]}):(0,B.jsx)(`span`,{className:`muted`,children:e.sent??`Click a line to comment on it.`})}),(0,B.jsxs)(`button`,{className:`primary`,disabled:!f,onClick:()=>n(!t),"aria-expanded":t,children:[`Send`,u?` with review`:``,` ▾`]})]})]})}function w_(e,t){if(!t)return[];let n=new Set,r=[],i;try{i=new RegExp(t.pattern,`g`)}catch{return[]}for(let a of e)for(let e of(a??``).matchAll(i)){let i=e[0];n.has(i)||(n.add(i),r.push({id:i,url:t.url.replace(`{id}`,encodeURIComponent(i))}))}return r}function T_(e,t){return[...e,{name:x,colours:{manager:t?.colour??null,sessions:`same`}}]}function E_(e,t){if(!e)return;let n=sf(t.find(t=>t.name===e.project)?.colours,e.role);if(!n)return;let r=of[n];return{"--name-light":r.light,"--name-dark":r.dark}}function D_(e,t){return[e,t&&S(t)].filter(Boolean).join(` - `)||`Question`}function O_(e){let{q:t,nameOf:n}=e,r=[],i={userName:e.userName,nameOf:n,onOpenMessage:e.onOpenMessage,onOpenQuestion:e.onOpenQuestion};t.original&&r.push((0,B.jsx)(A_,{o:t.original,nav:i,tint:e.tintOf(t.original.sessionId)},`original`)),(t.sources??[]).forEach((e,n)=>r.push((0,B.jsx)(M_,{src:e,askedAt:t.askedAt,...i},`source-${n}`)));let a=(t.sources??[]).some(e=>!(`error`in e));if(t.earlier?.length&&!a&&r.push((0,B.jsx)(P_,{q:t,lines:t.earlier,userName:e.userName,nameOf:n,onOpen:()=>e.onOpenConversation(t.sessionId,t.id)},`earlier`)),!r.length&&t.aboutQuestion===null)return null;let o=t.aboutQuestion===null?null:t.original?(0,B.jsxs)(B.Fragment,{children:[`Your answer goes to `,(0,B.jsx)(`strong`,{children:n(t.sessionId)}),`, which passes it on to `,n(t.original.sessionId),`.`]}):(0,B.jsxs)(B.Fragment,{children:[`Asked by `,(0,B.jsx)(`strong`,{children:n(t.sessionId)}),` about question #`,t.aboutQuestion,`, which can't be shown here: it is gone, or not from one of its sessions. Your answer goes to the manager.`]});return(0,B.jsxs)(`section`,{className:`block refers`,children:[(0,B.jsx)(`h4`,{children:`What it refers to`}),o&&(0,B.jsx)(`div`,{className:`refers-note muted`,children:o}),r]})}var k_=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function A_({o:e,nav:t,tint:n}){let{nameOf:r}=t,i=ce(e),a=[`asked ${$(e.askedAt)}`,i.options.length?k_(i.options.length,`option`):``,i.opinions.length?k_(i.opinions.length,`opinion`):``,e.status===`open`?``:e.status].filter(Boolean).join(` · `);return(0,B.jsxs)(`details`,{className:`ref-box original name-tinted${n?` tinted`:``}`,style:n,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`strong`,{children:[`Original question #`,e.id]}),` `,(0,B.jsxs)(`span`,{className:`muted`,children:[`from `,r(e.sessionId),` · `,a]})]}),(0,B.jsx)(j_,{o:e,nav:t})]})}function j_({o:e,nav:t,children:n}){let{nameOf:r}=t,i=ce(e),a=r(e.sessionId),o=e=>e??a,s=t=>(0,B.jsx)(Cd,{text:t,sessionId:e.sessionId});return(0,B.jsxs)(`div`,{className:`ref-body`,children:[(0,B.jsx)(`h5`,{className:`ref-title`,children:i.title}),i.issue&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h6`,{children:`The issue`}),(0,B.jsx)(`div`,{className:`prose`,children:s(i.issue)})]}),i.options.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h6`,{children:`Options`}),(0,B.jsx)(`ul`,{className:`ref-opts`,children:i.options.map(e=>{let t=i.opinions.filter(t=>t.pick===e.key).map(e=>o(e.who));return(0,B.jsxs)(`li`,{className:t.length?`picked`:``,children:[(0,B.jsxs)(`b`,{children:[i.structured?`${e.key} · `:``,e.label.replace(/\*\*/g,``)]}),e.detail&&(0,B.jsxs)(B.Fragment,{children:[` — `,(0,B.jsx)(`span`,{className:`prose inline`,children:s(e.detail.replace(/^[—–-]\s*/,``))})]}),e.cost&&(0,B.jsxs)(`span`,{className:`muted`,children:[` Cost: `,e.cost]}),t.length>0&&(0,B.jsxs)(`span`,{className:`ref-pick`,children:[` `,t.map(e=>`${e}'s pick`).join(`, `)]})]},e.key)})})]}),i.opinions.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h6`,{children:`Opinions`}),(0,B.jsx)(`ul`,{className:`ref-ops`,children:i.opinions.map((e,t)=>(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`b`,{children:o(e.who)}),` `,e.pick?`picks ${e.pick}`:`no pick among the options`,e.why?`: `:``,e.why&&(0,B.jsx)(`span`,{className:`prose inline`,children:s(e.why)})]},t))})]}),i.evidence&&(0,B.jsxs)(`details`,{className:`ev`,children:[(0,B.jsx)(`summary`,{children:`Evidence`}),(0,B.jsx)(`div`,{className:`prose`,children:s(i.evidence)})]}),e.sources?.length?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h6`,{children:`What it refers to`}),e.sources.map((n,r)=>(0,B.jsx)(M_,{src:n,askedAt:e.askedAt,...t},r))]}):null,n]})}function M_({src:e,askedAt:t,...n}){let{userName:r,nameOf:i,onOpenMessage:a,onOpenQuestion:o}=n;if(`error`in e)return(0,B.jsx)(N_,{src:e});let s=(e,t)=>(0,B.jsx)(`button`,{className:`link`,onClick:e=>{e.preventDefault(),t()},children:e}),c=e=>(0,B.jsxs)(`div`,{className:`muted ref-cut`,children:[`Cut here: the rest is `,e,`.`]});if(e.kind===`reply`){let t=i(e.sessionId);return(0,B.jsxs)(`details`,{className:`ref-box source reply`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`strong`,{children:[`Reply from `,t]}),` `,(0,B.jsxs)(`span`,{className:`muted`,children:[`· its reply of `,$(e.at),`, word for word`,a?` · `:``]}),a&&s(`open in its conversation`,()=>a(e.sessionId,e.messageId))]}),(0,B.jsxs)(`div`,{className:`ref-body`,children:[(0,B.jsx)(`div`,{className:`prose ref-source`,children:(0,B.jsx)(Cd,{text:e.text,sessionId:e.sessionId})}),e.cut&&c(`in its conversation`)]})]})}if(e.kind===`comment`){let n=e.what===`review`?`Review`:e.what===`review comment`?`Review comment`:`Comment`,r=e.path?` · ${e.path}${e.line?`:${e.line}`:``}`:``,i=e.at?` · written ${$(Date.parse(e.at))}`:``;return(0,B.jsxs)(`details`,{className:`ref-box source comment`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`strong`,{children:[n,` on `,/\/pull\/\d+/.test(e.url)?`PR `:``,`#`,e.number]}),` `,(0,B.jsxs)(`span`,{className:`muted`,children:[`· `,e.repo.split(`/`)[1],` · by `,e.author,i,r,` · fetched `,$(t),` · `]}),(0,B.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,onClick:e=>e.stopPropagation(),children:`open on GitHub`})]}),(0,B.jsxs)(`div`,{className:`ref-body`,children:[(0,B.jsx)(`div`,{className:`prose ref-source`,children:e.text.trim()?(0,B.jsx)(Cd,{text:e.text}):(0,B.jsx)(`span`,{className:`muted`,children:`(no text)`})}),e.cut&&c(`on GitHub`)]})]})}let l=e.question,u=l.answeredBy===null?null:l.answeredBy===`user`?r:i(l.answeredBy),d=l.status===`answered`?`answered${u?` by ${u}`:``} ${$(l.answeredAt??l.askedAt)}`:l.status===`open`?`still open when attached`:l.status,f=o?.(l.id)??null;return(0,B.jsxs)(`details`,{className:`ref-box source question`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`strong`,{children:[`Earlier question #`,l.id]}),` `,(0,B.jsxs)(`span`,{className:`muted`,children:[`· from `,i(l.sessionId),` · asked `,$(l.askedAt),` · `,d,f?` · `:``]}),f&&s(`open it`,f)]}),(0,B.jsx)(j_,{o:l,nav:n,children:l.answer!==null&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h6`,{children:`The answer`}),(0,B.jsxs)(`div`,{className:`ref-line`,children:[(0,B.jsx)(`div`,{className:`ref-who`,children:u??`Answer`}),(0,B.jsx)(`div`,{className:`plain`,children:l.answer})]})]})})]})}function N_({src:e}){let t=e.kind===`reply`?`A session's reply`:e.kind===`comment`?`A GitHub comment`:`An earlier question`;return(0,B.jsxs)(`details`,{className:`ref-box source failed`,open:!0,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`strong`,{children:[t,` could not be attached`]}),` `,(0,B.jsxs)(`span`,{className:`muted`,children:[`· `,e.named]})]}),(0,B.jsx)(`div`,{className:`ref-body`,children:(0,B.jsx)(`div`,{className:`ref-failed`,children:e.error})})]})}function P_({q:e,lines:t,userName:n,nameOf:r,onOpen:i}){let a=r(e.sessionId),o=e=>e.kind===`reply`?a:e.kind===`user`?n:`Delivered to ${a} by Ledung`;return(0,B.jsxs)(`details`,{className:`ref-box earlier`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsx)(`strong`,{children:`Earlier in the conversation`}),` `,(0,B.jsxs)(`span`,{className:`muted`,children:[`· the `,t.length===1?`message`:`${t.length} messages`,` `,a,` had just before asking · `]}),(0,B.jsx)(`button`,{className:`link`,onClick:e=>{e.preventDefault(),i()},children:`open the conversation`})]}),(0,B.jsx)(`div`,{className:`ref-body`,children:t.map((t,n)=>(0,B.jsxs)(`div`,{className:`ref-line ${t.kind}`,children:[(0,B.jsxs)(`div`,{className:`ref-who`,children:[o(t),` · `,$(t.at)]}),(0,B.jsx)(`div`,{className:`prose`,children:(0,B.jsx)(Cd,{text:t.text,sessionId:e.sessionId})}),t.cut&&(0,B.jsx)(`div`,{className:`muted ref-cut`,children:`Cut here: the rest is in the conversation.`})]},n))})]})}var F_=8;function I_({review:e,sessionId:t}){let n=e=>(0,B.jsx)(`div`,{className:`issue prose`,children:(0,B.jsx)(Cd,{text:e,sessionId:t})});return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`block`,children:[(0,B.jsx)(`h4`,{children:`What we were solving`}),n(e.solving)]}),(0,B.jsxs)(`section`,{className:`block`,children:[(0,B.jsx)(`h4`,{children:`What was done`}),n(e.done)]}),e.notes&&(0,B.jsxs)(`section`,{className:`block`,children:[(0,B.jsx)(`h4`,{children:`Notes`}),n(e.notes)]})]})}function L_(e){let{q:t,evidence:n}=e,r=n.filter(e=>e.kind!==`text`);return(0,B.jsxs)(`section`,{className:`block`,children:[(0,B.jsx)(`h4`,{children:`Evidence`}),r.length>0&&(0,B.jsx)(`div`,{className:`rev-thumbs`,children:r.map((n,r)=>(0,B.jsxs)(`figure`,{children:[(0,B.jsx)(R_,{q:t,ev:n,onOpen:()=>e.onShow(r)}),(0,B.jsx)(`figcaption`,{children:n.caption})]},r))}),n.map((e,n)=>e.kind===`text`?(0,B.jsx)(B_,{q:t,n,ev:e},n):null),e.shown!==null&&r[e.shown]&&(0,B.jsx)(z_,{q:t,images:r,at:e.shown,onShow:e.onShow})]})}function R_({q:e,ev:t,onOpen:n}){let[r,i]=(0,v.useState)(!1);return(0,B.jsx)(`button`,{className:`rev-thumb`,"aria-label":`Open large: ${t.caption}`,onClick:n,children:r?(0,B.jsx)(`span`,{className:`rev-thumb-problem`,children:`Can't be shown`}):(0,B.jsx)(`img`,{src:gd(e.sessionId,t.file),alt:``,onError:()=>i(!0)})})}function z_(e){let{images:t,at:n}=e,r=t[n],i=r=>e.onShow((n+r+t.length)%t.length),a=(0,v.useRef)(null);return(0,v.useEffect)(()=>a.current?.focus(),[]),(0,B.jsxs)(`div`,{className:`rev-large`,role:`dialog`,"aria-modal":`true`,"aria-label":r.caption,onClick:t=>{t.target===t.currentTarget&&e.onShow(null)},children:[(0,B.jsxs)(`div`,{className:`rev-large-bar`,children:[(0,B.jsxs)(`span`,{className:`rev-large-caption`,children:[r.caption,` `,(0,B.jsxs)(`span`,{className:`muted`,children:[`· `,n+1,` / `,t.length]})]}),(0,B.jsx)(`button`,{ref:a,className:`icon`,"aria-label":`Close: back to the review`,title:`Close (Esc)`,onClick:()=>e.onShow(null),children:(0,B.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M3.5 3.5l9 9M12.5 3.5l-9 9`})})})]}),(0,B.jsxs)(`div`,{className:`rev-large-stage`,children:[(0,B.jsx)(_d,{sessionId:e.q.sessionId,path:r.file,alt:r.caption},r.file),t.length>1&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{className:`nav l`,onClick:()=>i(-1),"aria-label":`Previous screenshot`,children:`‹`}),(0,B.jsx)(`button`,{className:`nav r`,onClick:()=>i(1),"aria-label":`Next screenshot`,children:`›`})]})]})]})}function B_({q:e,n:t,ev:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let n=!0;return R.evidenceText(e.id,t).then(e=>n&&i(e.content),e=>n&&o(e.message)),()=>{n=!1}},[e.id,t]);let l=r===null?[]:r.replace(/\n$/,``).split(`
94
- `),u=l.length>F_;return(0,B.jsxs)(`div`,{className:`rev-text`,children:[(0,B.jsxs)(`div`,{className:`rev-text-head`,children:[(0,B.jsx)(`span`,{className:`rev-text-caption`,children:n.caption}),(0,B.jsx)(`span`,{className:`chip mono`,children:n.file.replace(/^board:[^/]+\/[^/]+\//,`board: `)}),r!==null&&(0,B.jsxs)(`span`,{className:`muted`,children:[l.length,` line`,l.length===1?``:`s`]})]}),a?(0,B.jsx)(`p`,{className:`error`,children:a}):r===null?(0,B.jsx)(`p`,{className:`muted`,children:`Loading…`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`pre`,{className:`rev-text-body${s?` open`:``}`,tabIndex:s?0:void 0,children:s?r:l.slice(0,F_).join(`
95
- `)}),u&&(0,B.jsx)(`button`,{className:`small rev-text-toggle`,"aria-expanded":s,onClick:()=>c(!s),children:s?`Fold`:`Show all ${l.length} lines`})]})]})}function V_(e){let t=z(),{q:n}=e,[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),l=(0,v.useRef)(null),[u]=(0,v.useState)(e.noteFocus);(0,v.useEffect)(()=>{e.noteFocus!==u&&l.current?.focus()},[e.noteFocus]);let d=async t=>{c(!0),o(``);try{await t(),e.onAnswered()}catch(e){o(e.message),c(!1)}},f=e=>{if(s)return;let t=ne(e,r);`problem`in t?(o(t.problem),l.current?.focus()):d(()=>R.answerQuestion(n.id,t.answer))};if(n.status===`answered`){let t=n.answer??``,r=t.startsWith(N),i=r?t.slice(N.length).trim():t.startsWith(`Changes needed:`)?t.slice(P.length).trim():t;return(0,B.jsxs)(`section`,{className:`block`,children:[(0,B.jsx)(`h4`,{children:`Answer`}),(0,B.jsxs)(`div`,{className:`rev-verdict ${r?`accepted`:`changes`}`,children:[(0,B.jsx)(`strong`,{children:r?`Accepted`:`Changes needed`}),i&&(0,B.jsx)(`div`,{className:`rev-verdict-text`,children:i}),(0,B.jsxs)(`div`,{className:`muted`,children:[e.answeredBy,` · `,$(n.answeredAt??n.askedAt),` · `,n.deliveredAt?`delivered ${$(n.deliveredAt)}`:`not delivered yet: it goes in as soon as the session is free`]})]})]})}return n.status===`withdrawn`?(0,B.jsxs)(`section`,{className:`block`,children:[(0,B.jsx)(`h4`,{children:`Withdrawn`}),(0,B.jsx)(`div`,{className:`answered-box withdrawn`,children:(0,B.jsxs)(`div`,{className:`muted`,children:[`Withdrawn`,n.withdrawnReason?`: ${n.withdrawnReason}`:``]})})]}):(0,B.jsxs)(`section`,{className:`block`,children:[(0,B.jsx)(`h4`,{children:`Your answer`}),(0,B.jsx)(`label`,{className:`muted rev-box-label`,htmlFor:`rev-${n.id}`,children:`A note with Accept (optional), or what needs changing (required for Changes needed)`}),(0,B.jsx)(`textarea`,{...t,id:`rev-${n.id}`,ref:l,className:`box`,placeholder:eh()?`Write here`:`N to write, Esc to leave`,value:r,onChange:e=>{i(e.target.value),o(``)}}),(0,B.jsxs)(`div`,{className:`send`,children:[(0,B.jsx)(`button`,{className:`allow`,disabled:s,onClick:()=>f(`accept`),children:`Accept`}),(0,B.jsx)(`button`,{className:`deny`,disabled:s,onClick:()=>f(`changes`),children:`Changes needed`}),(0,B.jsx)(`span`,{className:`status`,role:`status`,children:a})]}),(0,B.jsx)(th,{busy:s,onWithdraw:()=>void d(()=>R.withdrawQuestion(n.id))})]})}function H_({remote:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(``),a=z(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(!1),f=()=>void R.remoteLink().then(n,()=>n(null));if((0,v.useEffect)(f,[e?.publicName]),!t)return null;if(t.source===`config`)return(0,B.jsxs)(`p`,{className:`muted`,children:[`This relay is set in the config file (`,(0,B.jsx)(`code`,{children:`"remote"`}),`); change or remove it there.`]});let p=e=>{s(!0),l(null),e().then(()=>{i(``),d(!1),f()},e=>l(e.message)).finally(()=>s(!1))};if(t.source===`joined`){let t=e?.certificate,n=e?.state===`connected`&&t?.state===`valid`;return(0,B.jsxs)(`div`,{className:`relay-join`,children:[n&&(0,B.jsx)(`p`,{className:`remote-state connected`,children:`Connected, certificate ok. Pair your phone in Phones below.`}),!n&&t?.state===`waiting-caa`&&(0,B.jsx)(`p`,{className:`muted`,children:`The relay's admin approves this computer, which adds the CAA record; the certificate follows within a minute.`}),u?(0,B.jsxs)(`div`,{className:`restart-confirm`,children:[(0,B.jsx)(`span`,{children:`Leave the relay? Phones stop reaching this Ledung at once; joining again needs a new code.`}),(0,B.jsx)(`button`,{className:`small danger`,disabled:o,onClick:()=>p(R.remoteLeave),children:`Leave`}),(0,B.jsx)(`button`,{className:`small`,disabled:o,onClick:()=>d(!1),children:`Cancel`})]}):(0,B.jsx)(`button`,{className:`small`,onClick:()=>d(!0),children:`Leave this relay`}),c&&(0,B.jsx)(`p`,{className:`restart-problem`,children:c})]})}return(0,B.jsxs)(`div`,{className:`relay-join`,children:[(0,B.jsx)(`p`,{className:`muted`,children:`Got a join code from a relay's admin? Paste it here: Ledung makes its own secret and certificate account, joins the relay and connects, with no restart.`}),(0,B.jsxs)(`div`,{className:`relay-row`,children:[(0,B.jsx)(`input`,{...a,value:r,onChange:e=>i(e.target.value),placeholder:`relay.example.org/ABCD-…`,spellCheck:!1,autoComplete:`off`,"aria-label":`Join code`}),(0,B.jsx)(`button`,{disabled:o||!r.trim(),onClick:()=>p(()=>R.remoteJoin(r)),children:o?`Joining…`:`Join with a code`})]}),c&&(0,B.jsx)(`p`,{className:`restart-problem`,children:c})]})}function U_({view:e,onView:t,run:n,newComputers:r}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(G_,{view:e,onView:t,run:n}),e.relay&&e.keySha256&&(0,B.jsx)(K_,{run:n,newComputers:r,tokenSet:e.tokenSet})]})}var W_=e=>!!e.relay||!!e.keySha256;function G_({view:e,onView:t,run:n}){let[r,i]=(0,v.useState)(e.relay??``),a=z(),[o,s]=(0,v.useState)(``);return(0,B.jsxs)(`div`,{className:`relay-admin`,children:[(0,B.jsxs)(`div`,{className:`relay-row`,children:[(0,B.jsxs)(`label`,{children:[`Relay `,(0,B.jsx)(`input`,{...a,value:r,onChange:e=>i(e.target.value),placeholder:`wss://relay.example.org`,spellCheck:!1})]}),(0,B.jsx)(`button`,{className:`small`,disabled:r.trim()===(e.relay??``),onClick:()=>void n(async()=>t(await R.setRelayAdmin({relay:r}))),children:`Save`})]}),(0,B.jsxs)(`p`,{className:`muted`,children:[`Admin key: `,e.keySha256?(0,B.jsxs)(B.Fragment,{children:[`made. Its SHA-256 goes in the relay's config as `,(0,B.jsx)(`code`,{children:`"adminKeySha256"`}),`: `,(0,B.jsx)(`code`,{className:`remote-record`,children:e.keySha256}),` `,(0,B.jsx)(yd,{text:e.keySha256})]}):`none yet. Ledung makes it and keeps it in its data folder; only its SHA-256 goes to the relay.`]}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await R.makeRelayAdminKey())),children:e.keySha256?`Make a new admin key`:`Make admin key`}),(0,B.jsxs)(`p`,{className:`muted`,children:[`Cloudflare token (Zone DNS edit, for the relay's domain): `,e.tokenSet?`set. Approve writes new computers' CAA records with it.`:`none. Without one, copy each new computer's CAA record into the DNS yourself.`,` It stays on this computer and is never shown again.`]}),(0,B.jsxs)(`div`,{className:`relay-row`,children:[(0,B.jsx)(`input`,{type:`password`,value:o,onChange:e=>s(e.target.value),placeholder:e.tokenSet?`Replace the token`:`Paste the token`,autoComplete:`off`,"aria-label":`Cloudflare token`}),(0,B.jsx)(`button`,{className:`small`,disabled:!o.trim(),onClick:()=>void n(async()=>{t(await R.setRelayAdmin({cloudflareToken:o})),s(``)}),children:`Save token`}),e.tokenSet&&(0,B.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await R.setRelayAdmin({cloudflareToken:``}))),children:`Remove token`})]})]})}function K_({run:e,newComputers:t,tokenSet:n}){let[r,i]=(0,v.useState)(``),a=z(),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(null),m=()=>void R.relayComputers().then(e=>{d(e.invites),p(null)},e=>p(e.message));return(0,v.useEffect)(m,[]),(0,B.jsxs)(`div`,{className:`relay-invites`,children:[(0,B.jsx)(`h4`,{children:`Invite a computer`}),(0,B.jsxs)(`div`,{className:`relay-row`,children:[(0,B.jsx)(`input`,{...a,value:r,onChange:e=>i(e.target.value),placeholder:`Whose computer`,"aria-label":`Owner`}),(0,B.jsx)(`input`,{...a,value:o,onChange:e=>s(e.target.value),placeholder:`Name (optional: two words and digits otherwise)`,spellCheck:!1,"aria-label":`Name`}),(0,B.jsx)(`button`,{disabled:!r.trim(),onClick:()=>void e(async()=>{l(await R.relayInvite(r,o.trim()||void 0)),i(``),s(``),m()}),children:`Invite`})]}),c&&(0,B.jsxs)(`div`,{className:`relay-code`,children:[(0,B.jsxs)(`p`,{children:[`Join code for `,c.owner,`'s computer, `,(0,B.jsx)(`b`,{children:c.host}),`. It is shown only now, works once, and runs out at `,new Date(c.expiresAt).toLocaleString(),`:`]}),(0,B.jsxs)(`p`,{children:[(0,B.jsx)(`code`,{className:`remote-record`,children:c.code}),` `,(0,B.jsx)(yd,{text:c.code})]}),(0,B.jsxs)(`p`,{className:`muted`,children:[`They paste it in their Ledung under Settings → Remote access → Join with a code. Then the computer shows up in Waiting for you`,n?` to approve`:` with its CAA record to add`,`.`]})]}),f&&(0,B.jsx)(`p`,{className:`restart-problem`,children:f}),u&&u.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h4`,{children:`Not used yet`}),(0,B.jsx)(`ul`,{className:`relay-list`,children:u.map(t=>(0,B.jsxs)(`li`,{children:[t.host,` for `,t.owner,`, until `,new Date(t.expiresAt).toLocaleString(),` `,(0,B.jsx)(`button`,{className:`small`,onClick:()=>void e(async()=>{await R.revokeRelayInvite(t.id),m()}),children:`Revoke`})]},t.id))})]}),t.length>0&&(0,B.jsxs)(`p`,{className:`muted`,children:[t.length,` computer`,t.length===1?``:`s`,` joined and wait`,t.length===1?`s`:``,` for the CAA record: see Waiting for you.`]})]})}function q_({computer:e,run:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),o=e=>{a(!0),r(null),t(()=>e().catch(e=>r(e.message))).finally(()=>a(!1))};return(0,B.jsxs)(`div`,{className:`new-computer`,children:[(0,B.jsxs)(`div`,{className:`new-computer-head`,children:[`New computer `,(0,B.jsx)(`code`,{children:e.name}),` for `,e.owner]}),(0,B.jsxs)(`p`,{className:`muted`,children:[`It joined the relay as `,e.host,e.enrolledAt?` at ${new Date(e.enrolledAt).toLocaleString()}`:``,`. Its certificate needs this CAA record, which names its own ACME account:`]}),(0,B.jsx)(`p`,{children:(0,B.jsx)(`code`,{className:`remote-record`,children:e.record})}),(0,B.jsxs)(`div`,{className:`restart-confirm`,children:[e.approvable&&(0,B.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(()=>R.approveComputer(e.name)),title:`Writes the record through Cloudflare with the token in Settings → Relay; never changes an existing one`,children:i?`Approving…`:`Approve`}),(0,B.jsx)(yd,{text:e.record}),!e.approvable&&(0,B.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(()=>R.computerAdded(e.name)),children:`I added it`})]}),!e.approvable&&(0,B.jsx)(`p`,{className:`muted`,children:`No Cloudflare token is set in Settings → Relay: copy the record into the DNS yourself, then press I added it.`}),n&&(0,B.jsx)(`p`,{className:`restart-problem`,children:n})]})}function J_({pairing:e,run:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),o=e=>{a(!0),r(null),t(()=>e().catch(e=>r(e.message))).finally(()=>a(!1))},s=new Date(e.at).toLocaleString(),{device:c}=e;return(0,B.jsxs)(`div`,{className:`new-computer`,children:[(0,B.jsx)(`div`,{className:`new-computer-head`,children:c?(0,B.jsxs)(B.Fragment,{children:[e.computer,` paired `,(0,B.jsx)(`code`,{children:c.name}),` through the link`]}):(0,B.jsxs)(B.Fragment,{children:[e.computer,` opened a pairing through the link`]})}),(0,B.jsx)(`p`,{className:`muted`,children:c?`At ${s}, from ${e.computer}'s own screen. It can look at this computer's sessions, questions and chats; it can change nothing until it sets up its passkey and logs on here with Touch ID or Windows Hello.`:`At ${s}, from ${e.computer}'s own screen: a pairing code for a browser there, good for 10 minutes. Nothing has paired with it yet.`}),(0,B.jsxs)(`div`,{className:`restart-confirm`,children:[c&&(0,B.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(async()=>{await R.revokeDevice(c.id),await R.dismissLinkPairing(e.id)}),children:`Remove device`}),(0,B.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(()=>R.dismissLinkPairing(e.id)),title:`Takes this card away; the device stays in Settings → Phones`,children:`OK`})]}),n&&(0,B.jsx)(`p`,{className:`restart-problem`,children:n})]})}var Y_=e=>e.status===`open`&&e.addressedTo===`user`,X_=e=>e.status===`pending`&&e.addressedTo===`user`;function Z_(e,t){return e.filter(Y_).length+t.filter(X_).length}var Q_=[`var(--s2)`,`var(--s4)`,`var(--s1)`,`var(--s7)`,`var(--s5)`,`var(--s3)`],$_=`var(--s-other)`;function ev(e){let[t,n]=(0,v.useState)(()=>Pd(localStorage)),r=e=>{n(e),Fd(localStorage,e)},i=t=>e.sessions.find(e=>e.id===t),a=e=>i(e)?.title??`unknown`,o=e=>{let t=i(e);return t?.role===`manager`?`Manager "${t.title}"`:t?.title??`Unknown session`},s=e=>i(e)?.project??``,c=t=>e.projects.find(e=>e.name===t),l=t=>E_(i(t),T_(e.projects,e.chats)),u=[...e.projects.map(e=>e.name),...e.sessions.some(e=>e.project===`~chats`)?[x]:[]],d=e=>t.mode===`all`?!t.hidden.includes(e):e===t.one,f=he(e.projects.map(e=>e.questionTiers)),p=e=>e===null?$_:Q_[f.indexOf(e)%Q_.length]??$_,m=he(e.projects.filter(e=>d(e.name)).map(e=>e.questionTiers)),{items:h,forYou:g,done:_,listFor:y}=Ld(e.questions,s,e=>c(e)?.questionTiers??[],d,m),b=e.permissions.filter(e=>e.status===`pending`&&e.addressedTo===`user`&&d(s(e.sessionId))).sort((e,t)=>e.at-t.at),S=t=>h.filter(e=>e.q.status===`open`&&e.q.addressedTo===`user`&&e.project===t).length+e.permissions.filter(e=>e.status===`pending`&&e.addressedTo===`user`&&s(e.sessionId)===t).length,C=e.questionId===null?null:h.find(t=>t.q.id===e.questionId)??null,w=(t,n,r)=>(0,B.jsxs)(`header`,{className:`desk-head`,children:[(0,B.jsx)(`button`,{className:`icon sidebar-toggle`,title:`${e.sidebarHidden?`Show`:`Hide`} the sidebar (S)`,"aria-label":`${e.sidebarHidden?`Show`:`Hide`} the sidebar`,"aria-pressed":e.sidebarHidden,onClick:e.onToggleSidebar,children:(0,B.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,"aria-hidden":`true`,children:[(0,B.jsx)(`rect`,{x:`1.5`,y:`2.5`,width:`13`,height:`11`,rx:`2`}),(0,B.jsx)(`path`,{d:`M6 2.5v11`})]})}),(0,B.jsxs)(`div`,{className:`head-main`,children:[(0,B.jsxs)(`div`,{className:`head-text`,children:[(0,B.jsx)(`h2`,{children:`Waiting for you`}),(0,B.jsx)(`div`,{className:`muted`,children:t})]}),(0,B.jsx)(`div`,{className:`head-controls`,children:n})]}),r&&(0,B.jsxs)(`button`,{className:`small conv`,title:`Go to conversation (C): ${o(fh(r))}`,onClick:()=>e.onGoToConversation(r.id),children:[(0,B.jsx)(tv,{}),(0,B.jsx)(`span`,{className:`conv-text`,children:`Go to conversation`})]}),(0,B.jsx)(`button`,{className:`icon`,title:`Close: back to the view before`,"aria-label":`Close`,onClick:e.onClose,children:(0,B.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M3.5 3.5l9 9M12.5 3.5l-9 9`})})})]}),T={props:e,nameOf:o,titleOf:a,tierColor:p,tintOf:l,settingsOf:c,header:w};if(e.questionId!==null){if(!C)return(0,B.jsxs)(`div`,{className:`waiting-view desk-view`,children:[w(``,(0,B.jsx)(`button`,{onClick:()=>e.onOpenQuestion(null),children:`← Queue`})),(0,B.jsx)(`div`,{className:`desk`,children:(0,B.jsx)(`div`,{className:`desk-body`,children:(0,B.jsxs)(`div`,{className:`empty-box`,children:[`Question #`,e.questionId,` is not here: it may be older than the recent ones Ledung keeps in view.`]})})})]});let t=y(C),n=n=>{let r=t.filter(e=>e.q.id!==n&&e.q.status===`open`)[Math.max(0,t.findIndex(e=>e.q.id===n))]??g.find(e=>e.q.id!==n);e.onOpenQuestion(r?r.q.id:null)};return C.v.review?(0,B.jsx)(ov,{ctx:T,item:C,list:t,onAnswered:n},C.q.id):C.q.shots?(0,B.jsx)(sv,{ctx:T,item:C,list:t,onAnswered:e.onLeaveShots},C.q.id):(0,B.jsx)(uv,{ctx:T,item:C,list:t,onAnswered:n},C.q.id)}return(0,B.jsx)(av,{ctx:T,filter:t,setFilter:r,projectNames:u,waitingIn:S,forYou:g,done:_,permsForYou:b,tiers:m})}var tv=()=>(0,B.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,B.jsx)(`path`,{d:`M2.5 3.5h11v7h-6l-3 2.5v-2.5h-2z`})});function nv(e){let t=(0,v.useRef)(e);t.current=e,(0,v.useEffect)(()=>{let e=e=>{let n=document.activeElement,r=!!n&&(n.tagName===`TEXTAREA`||n.tagName===`INPUT`||n.tagName===`SELECT`);t.current(e,r)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[])}var rv=e=>e.trim().split(`
96
- `)[0]??``,iv=e=>e.replace(/\*\*|`|^#+\s*/gm,``).replace(/\s+/g,` `).trim().slice(0,180);function av(e){let{props:t,nameOf:n,titleOf:r,tierColor:i,tintOf:a,header:o}=e.ctx,{filter:s,setFilter:c}=e,l=t=>c({...s,mode:t,one:e.projectNames.includes(s.one)?s.one:e.projectNames[0]??``}),u=()=>{let t=e.projectNames;t.length&&c({...s,mode:`one`,one:t[(t.indexOf(s.one)+1)%t.length]})};nv((n,r)=>{if(n.key===`Escape`){r?document.activeElement.blur():t.onClose();return}if(r||n.ctrlKey||n.metaKey||n.altKey)return;let i=n.key.toLowerCase();i===`s`?t.onToggleSidebar():n.key===`Enter`&&e.forYou[0]&&document.activeElement?.tagName!==`BUTTON`&&document.activeElement?.tagName!==`A`?(n.preventDefault(),t.onOpenQuestion(e.forYou[0].q.id)):/^[1-9]$/.test(n.key)&&e.forYou[Number(n.key)-1]?t.onOpenQuestion(e.forYou[Number(n.key)-1].q.id):i===`a`?l(s.mode===`all`?`one`:`all`):i===`p`&&u()});let d=e.forYou.length+e.permsForYou.length+t.newComputers.length+t.linkPairings.length,f=e.done.filter(e=>e.q.status===`answered`).length,p=(e,r)=>{let{q:i,v:o}=e,s=i.status!==`open`,c=a(i.sessionId);return(0,B.jsxs)(`div`,{className:`qrow-wrap`,children:[(0,B.jsxs)(`button`,{className:`qrow name-tinted${c?` tinted`:``}${s?` done`:``}`,style:c,onClick:()=>t.onOpenQuestion(i.id),children:[(0,B.jsx)(`span`,{className:`border-label`,children:D_(e.tier,e.project)}),(0,B.jsx)(`span`,{className:`place`,children:s?i.status===`answered`?`✓`:`–`:r??`·`}),(0,B.jsxs)(`span`,{className:`t`,children:[o.title,de(o.opinions)&&!s&&(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(`span`,{className:`split`,children:`They disagree`})]})]}),s?i.status===`answered`?(0,B.jsxs)(`span`,{className:`pill`,children:[i.answeredBy===`user`?`You`:`Manager`,` · `,$(i.answeredAt??i.askedAt)]}):(0,B.jsx)(`span`,{className:`pill grey`,children:`Withdrawn`}):(0,B.jsx)(`span`,{className:`when`,children:$(i.askedAt)}),(0,B.jsxs)(`span`,{className:`meta`,children:[(0,B.jsxs)(`span`,{children:[`#`,i.id]}),(0,B.jsx)(`span`,{children:n(i.sessionId)}),i.aboutQuestion!==null&&(0,B.jsxs)(`span`,{children:[`· about #`,i.aboutQuestion]}),!o.structured&&(0,B.jsx)(`span`,{className:`chip`,children:`plain`}),o.review&&(0,B.jsx)(`span`,{className:`chip review-chip`,children:`Review`}),i.shots&&(0,B.jsx)(`span`,{className:`chip shot-chip`,children:oh(i)})]}),(0,B.jsx)(`span`,{className:`excerpt`,children:s?i.status===`answered`?iv(i.answer??``):i.withdrawnReason??``:iv(o.review?rv(o.review.solving):o.issue)})]}),(0,B.jsx)(`button`,{className:`icon conv-row`,title:`Go to conversation: ${n(fh(i))}`,"aria-label":`Go to conversation of question #${i.id}`,onClick:()=>t.onGoToConversation(i.id),children:(0,B.jsx)(tv,{})})]},i.id)},m=e=>(0,B.jsxs)(`div`,{className:`waiting-permission`,children:[(0,B.jsxs)(`div`,{className:`waiting-from`,children:[(0,B.jsx)(`button`,{className:`link`,onClick:()=>t.onOpenSession(e.sessionId),children:r(e.sessionId)}),(0,B.jsxs)(`span`,{className:`muted`,children:[` (`,S(t.sessions.find(t=>t.id===e.sessionId)?.project??``),`) · `,$(e.at)]})]}),(0,B.jsx)(Mm,{permission:e})]},e.id),h=(e,t,n)=>(0,B.jsxs)(`h3`,{className:`group-head`,style:{"--c":t},children:[(0,B.jsx)(`i`,{}),e,n!==void 0&&(0,B.jsx)(`span`,{className:`count`,children:n})]}),g=(0,B.jsxs)(`div`,{className:`filter`,children:[(0,B.jsxs)(`div`,{className:`seg-control`,role:`group`,"aria-label":`Show`,children:[(0,B.jsx)(`button`,{className:s.mode===`one`?`on`:``,"aria-pressed":s.mode===`one`,onClick:()=>l(`one`),children:`One project`}),(0,B.jsx)(`button`,{className:s.mode===`all`?`on`:``,"aria-pressed":s.mode===`all`,onClick:()=>l(`all`),children:`All`})]}),(0,B.jsx)(`div`,{className:`projs`,children:e.projectNames.map(t=>{let n=s.mode===`all`?!s.hidden.includes(t):t===s.one;return(0,B.jsxs)(`button`,{className:`proj ${n?`on`:`off`}`,"aria-pressed":n,onClick:()=>s.mode===`one`?c({...s,one:t}):c({...s,hidden:s.hidden.includes(t)?s.hidden.filter(e=>e!==t):[...s.hidden,t]}),children:[s.mode===`all`&&(0,B.jsx)(`span`,{className:`box`,children:n?`✓`:``}),S(t),` `,(0,B.jsx)(`b`,{children:e.waitingIn(t)})]},t)})})]}),_=0;return(0,B.jsxs)(`div`,{className:`waiting-view desk-view`,children:[o((0,B.jsxs)(`span`,{className:`tally`,children:[(0,B.jsx)(`b`,{children:d}),` waiting · `,(0,B.jsx)(`b`,{children:f}),` answered`]}),g),(0,B.jsx)(`div`,{className:`desk`,children:(0,B.jsxs)(`div`,{className:`desk-body`,children:[(0,B.jsxs)(`p`,{className:`lede muted`,children:[`Ordered by what each answer unblocks, and each answer takes you to the next.`,(0,B.jsxs)(`span`,{className:`kbd-hint`,children:[` `,(0,B.jsx)(`kbd`,{children:`Enter`}),` opens the first question.`]})]}),!d&&(0,B.jsxs)(`div`,{className:`empty-box`,children:[`Nothing is waiting for you`,s.mode===`one`&&s.one?` in ${s.one}`:``,`. New questions appear here as they are asked.`]}),t.newComputers.length>0&&(0,B.jsxs)(B.Fragment,{children:[h(`New computers`,`var(--warn-border)`,t.newComputers.length),t.newComputers.map(e=>(0,B.jsx)(q_,{computer:e,run:t.run},e.name))]}),t.linkPairings.length>0&&(0,B.jsxs)(B.Fragment,{children:[h(`Paired through the link`,`var(--warn-border)`,t.linkPairings.length),t.linkPairings.map(e=>(0,B.jsx)(J_,{pairing:e,run:t.run},e.id))]}),e.permsForYou.length>0&&(0,B.jsxs)(B.Fragment,{children:[h(`Permission prompts`,`var(--warn-border)`,e.permsForYou.length),e.permsForYou.map(m)]}),[...e.tiers,null].map(t=>{let n=e.forYou.filter(e=>e.tier===t);return n.length?(0,B.jsxs)(`div`,{className:`group`,children:[h(t??`Older, without a tier`,i(t),n.length),n.map(e=>p(e,++_))]},t??``):null}),e.done.length>0&&(0,B.jsxs)(B.Fragment,{children:[h(`Answered recently`,`var(--ok)`),e.done.map(e=>p(e,null))]}),(0,B.jsxs)(`div`,{className:`keys`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`Enter`}),` first question`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`1`}),`–`,(0,B.jsx)(`kbd`,{children:`9`}),` open by place`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`P`}),` next project`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`A`}),` one project / all`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(tv,{}),` on a row: its conversation`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`S`}),` hide / show sidebar`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`Esc`}),` close`]})]})]})})]})}function ov({ctx:e,item:t,list:n,onAnswered:r}){let{props:i,nameOf:a,titleOf:o,tintOf:s,settingsOf:c,header:l}=e,{q:u,v:d,project:f,tier:p}=t,m=d.review,h=m.evidence??[],g=h.filter(e=>e.kind!==`text`),[_,y]=(0,v.useState)(null),[b,x]=(0,v.useState)(0),C=n.findIndex(e=>e.q.id===u.id),w=e=>{let t=n[C+e];C>=0&&t&&i.onOpenQuestion(t.q.id)},T=e=>{let t=_;y(e),e===null&&t!==null&&setTimeout(()=>document.querySelectorAll(`.rev-thumb`)[t]?.focus())};nv((e,t)=>{if(_!==null){if(e.key===`Escape`)T(null);else if(e.key===`ArrowRight`)T((_+1)%g.length);else if(e.key===`ArrowLeft`)T((_-1+g.length)%g.length);else if(e.key===`Tab`){let t=[...document.querySelectorAll(`.rev-large button`)];t[(t.indexOf(document.activeElement)+(e.shiftKey?-1:1)+t.length)%t.length]?.focus()}else return;e.preventDefault();return}let n=!!document.activeElement?.closest(`.rev-text-body`);if(e.key===`Escape`){t||n?document.activeElement.blur():i.onOpenQuestion(null);return}if(t||n||e.ctrlKey||e.metaKey||e.altKey)return;let r=e.key.toLowerCase();r===`s`?i.onToggleSidebar():e.key===`ArrowRight`?w(1):e.key===`ArrowLeft`?w(-1):r===`c`?i.onGoToConversation(u.id):r===`n`&&u.status===`open`&&(e.preventDefault(),x(e=>e+1))});let E=a(u.sessionId),D=c(f)?.tickets??void 0,O=e=>w_([e],D)[0]?.url,k=u.answeredBy===`user`?u.forwardedFrom===null?i.userName:`${i.userName} (passed on by the manager)`:`Manager "${o(u.answeredBy??``)}", under its standing grant`,ee=u.status===`open`?u.addressedTo===`user`?`${C+1} of ${n.length} waiting`:`Manager "${o(u.addressedTo)}" is handling it`:u.status===`answered`?`Answered`:`Withdrawn`;return(0,B.jsxs)(`div`,{className:`waiting-view desk-view`,children:[l(ee,(0,B.jsxs)(`div`,{className:`qbar`,children:[(0,B.jsx)(`button`,{onClick:()=>i.onOpenQuestion(null),children:`← Queue`}),(0,B.jsx)(`button`,{disabled:C<=0,"aria-label":`Previous question`,title:`Previous question (←)`,onClick:()=>w(-1),children:`←`}),(0,B.jsx)(`button`,{disabled:C<0||C>=n.length-1,"aria-label":`Next question`,title:`Next question (→)`,onClick:()=>w(1),children:`→`})]}),u),(0,B.jsx)(`div`,{className:`desk${_===null?``:` locked`}`,children:(0,B.jsxs)(`div`,{className:`desk-body review`,children:[(0,B.jsxs)(`div`,{className:`qhead name-tinted${s(u.sessionId)?` tinted`:``}`,style:s(u.sessionId),children:[(0,B.jsx)(`span`,{className:`border-label`,children:D_(p,f)}),(0,B.jsxs)(`div`,{className:`meta`,children:[(0,B.jsx)(`span`,{className:`chip review-chip`,children:`Review`}),(0,B.jsxs)(`strong`,{children:[`#`,u.id]}),(0,B.jsx)(`span`,{className:`chip`,children:S(f)}),(0,B.jsxs)(`span`,{className:`muted`,children:[`· `,(0,B.jsx)(`button`,{className:`link`,onClick:()=>i.onOpenSession(u.sessionId),children:E}),` · asked `,$(u.askedAt)]}),u.addressedTo!==`user`&&(0,B.jsxs)(`span`,{className:`muted`,children:[`· to manager "`,o(u.addressedTo),`"`]})]}),(0,B.jsx)(`h3`,{children:d.title}),d.refs.length>0&&(0,B.jsx)(`div`,{className:`refs`,children:d.refs.map(e=>{let t=O(e);return t?(0,B.jsx)(`a`,{className:`chip`,href:t,target:`_blank`,rel:`noreferrer noopener`,children:e},e):(0,B.jsx)(`span`,{className:`chip`,children:e},e)})})]}),u.status===`open`&&u.addressedTo!==`user`&&(0,B.jsxs)(`div`,{className:`handled`,children:[`Manager "`,o(u.addressedTo),`" is handling this. Answer it here yourself and the manager is told.`]}),(0,B.jsx)(O_,{q:u,userName:i.userName,nameOf:a,tintOf:s,onOpenConversation:(e,t)=>i.onGoToConversation(t,e),onOpenMessage:i.onGoToMessage,onOpenQuestion:e=>i.questions.some(t=>t.id===e)?()=>i.onOpenQuestion(e):null}),(0,B.jsx)(I_,{review:m,sessionId:u.sessionId}),h.length>0&&(0,B.jsx)(L_,{q:u,evidence:h,shown:_,onShow:T}),(0,B.jsx)(V_,{q:u,answeredBy:k,noteFocus:b,onAnswered:()=>r(u.id)}),(0,B.jsxs)(`div`,{className:`keys`,children:[u.status===`open`&&(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`N`}),` note`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`←`}),(0,B.jsx)(`kbd`,{children:`→`}),` previous / next`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`C`}),` conversation`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`Esc`}),` queue`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`S`}),` sidebar`]})]})]})})]})}function sv({ctx:e,item:t,list:n,onAnswered:r}){let{props:i,nameOf:a,titleOf:o,header:s}=e,{q:c,v:l,project:u}=t,d=n.findIndex(e=>e.q.id===c.id),f=e=>{let t=n[d+e];d>=0&&t&&i.onOpenQuestion(t.q.id)},p=c.status===`open`?c.addressedTo===`user`?`${d+1} of ${n.length} waiting`:`Manager "${o(c.addressedTo)}" is handling it`:c.status===`answered`?`Answered`:`Withdrawn`;return(0,B.jsxs)(`div`,{className:`waiting-view desk-view`,children:[s(p,(0,B.jsxs)(`div`,{className:`qbar`,children:[(0,B.jsx)(`button`,{onClick:()=>i.onOpenQuestion(null),children:`← Queue`}),(0,B.jsx)(`button`,{disabled:d<=0,"aria-label":`Previous question`,title:`Previous question`,onClick:()=>f(-1),children:`←`}),(0,B.jsx)(`button`,{disabled:d<0||d>=n.length-1,"aria-label":`Next question`,title:`Next question`,onClick:()=>f(1),children:`→`})]}),c),(0,B.jsx)(ih,{question:{...c,shots:c.shots},title:l.title,issue:l.issue,evidence:l.evidence,options:l.options,opinions:l.opinions.map(e=>({...e,who:e.who??a(c.sessionId)})),userName:i.userName,session:{title:a(c.sessionId),project:u,onOpen:()=>i.onOpenSession(c.sessionId)},onClose:()=>i.onOpenQuestion(null),onDone:r,onToggleSidebar:i.onToggleSidebar,onGoToConversation:()=>i.onGoToConversation(c.id),withdrawnIds:i.questions.filter(e=>e.status===`withdrawn`).map(e=>e.id),refersTo:(0,B.jsx)(O_,{q:c,userName:i.userName,nameOf:a,tintOf:e.tintOf,onOpenConversation:(e,t)=>i.onGoToConversation(t,e),onOpenMessage:i.onGoToMessage,onOpenQuestion:e=>i.questions.some(t=>t.id===e)?()=>i.onOpenQuestion(e):null})})]})}function cv({opinions:e,whoOf:t}){let n=e.length;return n?n===1?(0,B.jsx)(`div`,{className:`legend`,children:(0,B.jsxs)(`span`,{children:[`Green border: `,t(e[0]),`'s pick`]})}):n>5?(0,B.jsx)(`div`,{className:`legend`,children:(0,B.jsxs)(`span`,{children:[n,` opinions: each option says who picked it`]})}):(0,B.jsxs)(`div`,{className:`legend`,children:[(0,B.jsxs)(`span`,{children:[`Green border in `,n,` parts, one per opinion, left to right:`]}),e.map((e,r)=>(0,B.jsxs)(`span`,{children:[(0,B.jsx)(lv,{i:r,n}),t(e)]},r)),(0,B.jsx)(`span`,{children:`Whole border: they all agree`})]}):null}var lv=({i:e,n:t})=>(0,B.jsx)(`span`,{className:`part-key`,"aria-hidden":`true`,children:Array.from({length:t},(t,n)=>(0,B.jsx)(`i`,{className:n===e?`on`:``},n))});function uv({ctx:e,item:t,list:n,onAnswered:r}){let i=z(),{props:a,nameOf:o,titleOf:s,tintOf:c,settingsOf:l,header:u}=e,{q:d,v:f,project:p,tier:m}=t,h=d.status===`open`,[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(``),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(``),[T,E]=(0,v.useState)(!1),D=(0,v.useRef)(null),O=(0,v.useRef)(null),k=n.findIndex(e=>e.q.id===d.id),ee=f.options.length+1,A=!d.aboutRequest;(0,v.useEffect)(()=>{g===`other`&&D.current?.focus()},[g]);let j=e=>{let t=n[k+e];k>=0&&t&&a.onOpenQuestion(t.q.id)},M=e=>{_(e),w(``)},te=async()=>{if(!h||T)return;if(!g)return w(`Pick an option first.`);if(g===`other`&&!y.trim()){w(`Write your answer in the box first.`),D.current?.focus();return}let e=g===`other`?y.trim():f.options.find(e=>e.key===g).answer,t=A&&x.trim()?`${e}\n\nNote: ${x.trim()}`:e;E(!0),w(``);try{await R.answerQuestion(d.id,t),r(d.id)}catch(e){w(e.message),E(!1)}},N=async()=>{E(!0);try{await R.withdrawQuestion(d.id),r(d.id)}catch(e){w(e.message),E(!1)}};nv((e,t)=>{if((e.ctrlKey||e.metaKey)&&e.key===`Enter`){e.preventDefault(),te();return}if(e.key===`Escape`){t?document.activeElement.blur():a.onOpenQuestion(null);return}if(t||e.ctrlKey||e.metaKey||e.altKey)return;let n=e.key.toLowerCase();if(n===`s`)a.onToggleSidebar();else if(e.key===`ArrowRight`)j(1);else if(e.key===`ArrowLeft`)j(-1);else if(n===`c`)a.onGoToConversation(d.id);else if(!h)return;else if(/^[1-9]$/.test(e.key)){let t=Number(e.key);t<=f.options.length?(e.preventDefault(),M(f.options[t-1].key)):t===ee&&(e.preventDefault(),M(`other`))}else n===`n`&&A&&(e.preventDefault(),O.current?.focus())});let P=o(d.sessionId),ne=l(p)?.tickets??void 0,re=e=>w_([e],ne)[0]?.url,ie=d.status===`answered`&&d.answer!==null?f.options.find(e=>d.answer===e.answer||d.answer.startsWith(`${e.answer}\n\nNote: `))?.key??null:null,ae=d.answeredBy===`user`?d.forwardedFrom===null?a.userName:`${a.userName} (passed on by the manager)`:`Manager "${s(d.answeredBy??``)}", under its standing grant`,oe=e=>{let t=f.options.findIndex(t=>t.key===e);return t<0?e:`${t+1} · ${f.options[t].label.replace(/\*\*/g,``)}`},se=d.status===`open`?d.addressedTo===`user`?`${k+1} of ${n.length} waiting`:`Manager "${s(d.addressedTo)}" is handling it`:d.status===`answered`?`Answered`:`Withdrawn`,ce=e=>(0,B.jsx)(Cd,{text:e,sessionId:d.sessionId}),le=f.opinions,ue=le.length<=5,fe=e=>e.who??P,pe=e=>({"--i":e,"--n":le.length});return(0,B.jsxs)(`div`,{className:`waiting-view desk-view`,children:[u(se,(0,B.jsxs)(`div`,{className:`qbar`,children:[(0,B.jsx)(`button`,{onClick:()=>a.onOpenQuestion(null),children:`← Queue`}),(0,B.jsx)(`button`,{disabled:k<=0,"aria-label":`Previous question`,title:`Previous question (←)`,onClick:()=>j(-1),children:`←`}),(0,B.jsx)(`button`,{disabled:k<0||k>=n.length-1,"aria-label":`Next question`,title:`Next question (→)`,onClick:()=>j(1),children:`→`})]}),d),(0,B.jsx)(`div`,{className:`desk`,children:(0,B.jsxs)(`div`,{className:`desk-body`,children:[(0,B.jsxs)(`div`,{className:`qhead name-tinted${c(d.sessionId)?` tinted`:``}`,style:c(d.sessionId),children:[(0,B.jsx)(`span`,{className:`border-label`,children:D_(m,p)}),(0,B.jsxs)(`div`,{className:`meta`,children:[(0,B.jsxs)(`strong`,{children:[`Question #`,d.id]}),(0,B.jsxs)(`span`,{className:`muted`,children:[`· `,(0,B.jsx)(`button`,{className:`link`,onClick:()=>a.onOpenSession(d.sessionId),children:P}),` · asked `,$(d.askedAt)]}),d.addressedTo!==`user`&&(0,B.jsxs)(`span`,{className:`muted`,children:[`· to manager "`,s(d.addressedTo),`"`]}),!f.structured&&(0,B.jsx)(`span`,{className:`chip`,title:`Asked with text and option labels only`,children:`plain question`}),!f.structured&&(0,B.jsx)(`span`,{className:`muted touch-only`,children:`· asked with text and option labels only`})]}),(0,B.jsx)(`h3`,{children:f.title}),f.refs.length>0&&(0,B.jsx)(`div`,{className:`refs`,children:f.refs.map(e=>{let t=re(e);return t?(0,B.jsx)(`a`,{className:`chip`,href:t,target:`_blank`,rel:`noreferrer noopener`,children:e},e):(0,B.jsx)(`span`,{className:`chip`,children:e},e)})})]}),h&&d.addressedTo!==`user`&&(0,B.jsxs)(`div`,{className:`handled`,children:[`Manager "`,s(d.addressedTo),`" is handling this. Answer it here yourself and the manager is told.`]}),d.aboutRequest&&h&&(0,B.jsxs)(`p`,{className:`sensitive-note`,children:[(0,B.jsx)(`strong`,{children:`Permission request`}),`: your answer decides it. The first option allows it once; any other answer denies it, with your words as the reason.`]}),(0,B.jsx)(O_,{q:d,userName:a.userName,nameOf:o,tintOf:c,onOpenConversation:(e,t)=>a.onGoToConversation(t,e),onOpenMessage:a.onGoToMessage,onOpenQuestion:e=>a.questions.some(t=>t.id===e)?()=>a.onOpenQuestion(e):null}),f.issue&&(0,B.jsxs)(`section`,{className:`block`,children:[(0,B.jsx)(`h4`,{children:`The issue`}),(0,B.jsx)(`div`,{className:`issue prose`,children:ce(f.issue)})]}),f.evidence&&(0,B.jsx)(`section`,{className:`block`,children:(0,B.jsxs)(`details`,{className:`ev`,children:[(0,B.jsx)(`summary`,{children:`Evidence`}),(0,B.jsx)(`div`,{className:`prose`,children:ce(f.evidence)})]})}),d.status===`answered`&&(0,B.jsxs)(`section`,{className:`block`,children:[(0,B.jsx)(`h4`,{children:`Answer`}),(0,B.jsxs)(`div`,{className:`answered-box`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`strong`,{children:[ae,`:`]}),` `,d.answer]}),(0,B.jsxs)(`div`,{className:`muted`,children:[`answered `,$(d.answeredAt??d.askedAt),` · `,d.deliveredAt?`delivered ${$(d.deliveredAt)}`:`not delivered yet: it goes in as soon as the session is free`]})]})]}),d.status===`withdrawn`&&(0,B.jsxs)(`section`,{className:`block`,children:[(0,B.jsx)(`h4`,{children:`Withdrawn`}),(0,B.jsx)(`div`,{className:`answered-box withdrawn`,children:(0,B.jsxs)(`div`,{className:`muted`,children:[`Withdrawn`,d.withdrawnReason?`: ${d.withdrawnReason}`:``]})})]}),(f.options.length>0||h)&&(0,B.jsxs)(`section`,{className:`block opts-block`,children:[(0,B.jsx)(`h4`,{children:`Options`}),f.options.length>0&&(0,B.jsx)(cv,{opinions:le,whoOf:fe}),(0,B.jsxs)(`div`,{className:`opts`,role:`radiogroup`,"aria-label":`Options`,children:[f.options.map((e,t)=>{let n=h?g===e.key:ie===e.key;return(0,B.jsxs)(`button`,{className:`opt${n?` on`:``}`,role:`radio`,"aria-checked":n,disabled:!h,onClick:()=>M(e.key),children:[(0,B.jsx)(`span`,{className:`k`,children:t+1}),(0,B.jsxs)(`span`,{className:`lab`,children:[f.structured&&(0,B.jsx)(`span`,{className:`letter`,children:e.key}),e.label.replace(/\*\*/g,``)]}),e.detail&&(0,B.jsx)(`span`,{className:`det prose`,children:ce(e.detail)}),e.cost&&(0,B.jsxs)(`span`,{className:`cost muted`,children:[(0,B.jsx)(`b`,{children:`Cost`}),` · `,e.cost]}),ue&&le.map((t,n)=>t.pick===e.key&&(0,B.jsxs)(v.Fragment,{children:[(0,B.jsx)(`span`,{className:`edge${n===0?` first`:``}${n===le.length-1?` last`:``}`,style:pe(n)}),(0,B.jsx)(`span`,{className:`tag who`,style:pe(n),title:fe(t),children:fe(t)})]},n)),le.some(t=>t.pick===e.key)&&(0,B.jsxs)(`span`,{className:`picked-by${ue?` touch-only`:``}`,children:[(0,B.jsx)(`b`,{children:`Picked by`}),` `,le.filter(t=>t.pick===e.key).map(fe).join(`, `)]}),!h&&n&&(0,B.jsx)(`span`,{className:`tag answer`,children:`Answer`})]},e.key)}),h&&(0,B.jsxs)(`button`,{className:`opt${g===`other`?` on`:``}`,role:`radio`,"aria-checked":g===`other`,onClick:()=>M(`other`),children:[(0,B.jsx)(`span`,{className:`k`,children:ee}),(0,B.jsx)(`span`,{className:`lab`,children:`Other answer`}),(0,B.jsx)(`span`,{className:`det`,children:d.aboutRequest?`Deny it, saying why in your own words.`:`Say it in your own words.`})]})]}),h&&g===`other`&&(0,B.jsx)(`textarea`,{...i,ref:D,className:`box`,placeholder:`Your answer, in your own words`,value:y,onChange:e=>b(e.target.value)})]}),(f.structured||le.length>0)&&(0,B.jsxs)(`section`,{className:`block`,children:[(0,B.jsxs)(`h4`,{children:[`Opinions`,de(le)&&(0,B.jsx)(`span`,{className:`split`,children:`They disagree`})]}),le.length?(0,B.jsx)(`div`,{className:`recs`,children:le.map((e,t)=>(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`rec-label muted`,children:[ue&&le.length>1&&(0,B.jsx)(lv,{i:t,n:le.length}),fe(e),e.who===null&&` (asker)`]}),(0,B.jsxs)(`div`,{className:`rec${e.pick?``:` empty`}`,children:[(0,B.jsx)(`div`,{className:`pick`,children:e.pick?oe(e.pick):`No pick among the options`}),(0,B.jsx)(`div`,{className:`prose`,children:e.why?ce(e.why):(0,B.jsx)(`span`,{className:`none`,children:f.structured?`No reason given.`:`Marked "(recommended)"; a plain question gives no reason.`})})]})]},t))}):(0,B.jsx)(`div`,{className:`rec empty`,children:(0,B.jsx)(`div`,{className:`none`,children:`No opinions given.`})})]}),h&&(0,B.jsxs)(`section`,{className:`block note-block`,children:[A&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`h4`,{children:[`Note `,(0,B.jsx)(`span`,{className:`opt-in`,children:`(optional, goes with the answer)`})]}),(0,B.jsx)(`textarea`,{...i,ref:O,className:`box`,placeholder:`Anything to go with the answer`,value:x,onChange:e=>S(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`send`,children:[(0,B.jsx)(`button`,{className:`primary`,disabled:!g||T,onClick:()=>void te(),children:`Send answer`}),(0,B.jsxs)(`span`,{className:`muted send-hint`,children:[(0,B.jsx)(`kbd`,{children:`Ctrl`}),`/`,(0,B.jsx)(`kbd`,{children:`⌘`}),`+`,(0,B.jsx)(`kbd`,{children:`Enter`}),` sends`]}),(0,B.jsx)(`span`,{className:`status`,role:`status`,children:C})]}),(0,B.jsx)(th,{busy:T,onWithdraw:()=>void N()})]}),(0,B.jsxs)(`div`,{className:`keys`,children:[h&&(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`1`}),`–`,(0,B.jsx)(`kbd`,{children:ee}),` pick (`,ee,`: other)`]}),h&&A&&(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`N`}),` note`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`←`}),(0,B.jsx)(`kbd`,{children:`→`}),` previous / next`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`C`}),` conversation`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`Esc`}),` queue`]}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`kbd`,{children:`S`}),` sidebar`]})]})]})}),h&&(0,B.jsxs)(`div`,{className:`send-bar`,children:[(0,B.jsx)(`span`,{className:`send-pick${g?``:` muted`}`,children:g===null?`No option picked yet`:g===`other`?`${ee} · Other answer`:oe(g)}),(0,B.jsx)(`button`,{className:`primary`,disabled:!g||T,onClick:()=>void te(),children:`Send answer`}),C&&(0,B.jsx)(`span`,{className:`status`,role:`status`,children:C})]})]})}var dv=e=>Math.max(0,Math.min(100,Math.floor(Math.round((e??0)*1e4)/100)));function fv(e){if(e.holding)return`held at ${e.percent}%`;if(e.lifted)return`stop at ${e.percent}% lifted`;if(e.utilization==null)return`stop at ${e.percent}%`;let t=e.percent-dv(e.utilization);return`${Math.max(1,t)}% to stop`}var pv={five_hour:`5 h`,seven_day:`Weekly`,seven_day_opus:`Weekly Opus`,seven_day_sonnet:`Weekly Sonnet`,seven_day_overage_included:`Weekly (incl. extra)`,overage:`Extra usage`};function mv(e,t,n){if(e==null)return``;let r=Math.ceil((e-t)/6e4),i=`${pv[n]??n} limit resets`;if(r<=0)return`${i} now`;let a=Math.floor(r/1440),o=Math.floor(r%1440/60),s=r%60;return`${i} in ${(a?[`${a} d`,o?`${o} h`:``]:[o?`${o} h`:``,s?`${s} min`:``]).filter(Boolean).join(` `)}`}function hv(e,t){let n=fv(e),r=e.holding||e.utilization==null?n[0].toUpperCase()+n.slice(1):`${dv(e.utilization)}% · ${n}`,i=mv(e.resetsAt,t,e.kind);return i?`${r} · ${i}`:r}var gv=180;function _v({scene:e,step:t,number:n,cls:r}){let i=Fh(e,t),a=Fh({...e,sprites:[]},t),o=new Set(n.map(t=>t.y*(e.width+1)+t.x)),s=[],c=``;for(let e=0;e<i.length;e++)o.has(e)||i[e]!==a[e]&&i[e]!==`
97
- `?(c&&s.push(c),c=``,s.push((0,B.jsx)(`span`,{className:r,children:i[e]},e))):c+=i[e];return c&&s.push(c),s}function vv(e,t){let n=document.createElement(`canvas`).getContext(`2d`);return n?(n.font=`600 ${t}px ${getComputedStyle(e).fontFamily}`,n.measureText(`~`.repeat(50)).width/50):t*.6}function yv({utilization:e,label:t,hull:n=`ship`}){let{size:r,next:i,step:a}=Ag(`ledung.limitShipSize`,5),o=(0,v.useRef)(null),[s,c]=(0,v.useState)(tg.at(-1)),l=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,[u,d]=(0,v.useState)(0);(0,v.useLayoutEffect)(()=>{let e=o.current?.parentElement;if(!e||!o.current)return;let t=()=>{let t=vv(o.current,r);c(tg.find(n=>n*t<=e.clientWidth)??tg.at(-1))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[r]);let f=ug(e*100,s,n),p=(0,v.useRef)(null),m=p.current??={mode:null,x:fg(f,s,n),stage:dg(f),shown:f,at:-1};m.mode===null&&f<m.shown&&!l&&(m.mode=`leaving`),m.mode===null&&(m.shown=f),(0,v.useEffect)(()=>{if(l)return;let e=setInterval(()=>d(e=>e+1),gv);return()=>clearInterval(e)},[l]);let h=m.at!==u;m.at=u;let g,_=[],y=m.stage;if(m.mode===`leaving`)g=vg(s,m.stage,m.x,n),h&&(m.x-=2),m.x<-10&&Object.assign(m,{mode:`arriving`,x:-6,stage:0});else if(m.mode===`arriving`)g=yg(s,m.x,n),y=0,h&&(m.x+=1),m.x>=0&&Object.assign(m,{mode:null,x:0,shown:0});else{let t=fg(f,s,n);l||Math.abs(t-m.x)>s?m.x=t:h&&u%2==0&&m.x!==t&&(m.x+=Math.sign(t-m.x)),y=m.stage=dg(f),{scene:g,number:_}=_g(s,y,m.x,`${dv(e)}%`,n)}let b=y>=ig?`limit-ship-hull wreck`:y>0?`limit-ship-hull breaking`:`limit-ship-hull`;return(0,B.jsx)(`button`,{ref:o,type:`button`,className:`ship-button limit-ship`,title:`${t}: ${Math.round(e*100)}% used. Ship size ${r}px: click for ${i}px`,onClick:a,children:(0,B.jsx)(`pre`,{className:`sailing-ship`,style:{fontSize:`${r}px`},"aria-hidden":`true`,children:(0,B.jsx)(_v,{scene:g,step:l?0:u,number:_,cls:b})})})}var bv=[[`five_hour`,`5-hour`],[`seven_day`,`Weekly`]],xv=e=>bv.find(([t])=>t===e)?.[1]??e;function Sv(e){let t=e.utilization==null?``:` (now ${Math.round(e.utilization*100)}%)`,n=e.resetsAt==null?``:` until ${new Date(e.resetsAt).toLocaleString([],{weekday:`short`,hour:`2-digit`,minute:`2-digit`})}, when the window resets`;return`${xv(e.kind)} usage${e.account==="default"?``:` of account ${e.account}`} reached the stop at ${e.percent}%${t}: new turns are held${n}.`}function Cv({stop:e,run:t}){let[n,r]=(0,v.useState)(Date.now);return(0,v.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),3e4);return()=>clearInterval(e)},[]),(0,B.jsxs)(`div`,{className:`limit-stop${e.holding?` held`:``}`,children:[(0,B.jsx)(`span`,{children:hv(e,n)}),e.holding&&(0,B.jsx)(`button`,{className:`small primary`,onClick:()=>void t(()=>R.liftUsageStop(e.account,e.kind)),children:`Lift`})]})}function wv(e){let t=[`default`,...e.accounts.map(e=>e.name)];return(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Usage stops`}),(0,B.jsxs)(`p`,{className:`muted`,children:[`At this share of a plan window, Ledung holds new turns for every session and manager on the account; a running turn finishes. It lifts when the window resets, when you raise the stop, or with Lift. Once saved here, these replace the config's `,(0,B.jsx)(`code`,{children:`usageStops`}),`.`]}),t.map(n=>(0,B.jsxs)(`div`,{children:[t.length>1&&(0,B.jsx)(`strong`,{children:n==="default"?`This computer's login`:n}),bv.map(([t,r])=>{let i=e.usageStops.find(e=>e.account===n&&e.kind===t);return(0,B.jsx)(Tv,{account:n,kind:t,label:r,stop:i,run:e.run},`${t}:${i?.percent??``}`)})]},n))]})}function Tv(e){let[t,n]=(0,v.useState)(e.stop?String(e.stop.percent):``),r=e.stop,i=()=>void e.run(()=>R.setUsageStop(e.account,e.kind,t.trim()?Number(t):null));return(0,B.jsxs)(`div`,{className:`row`,style:{display:`flex`,gap:`0.5rem`,alignItems:`center`,flexWrap:`wrap`},children:[(0,B.jsxs)(`label`,{children:[e.label,` `,(0,B.jsx)(`input`,{type:`number`,min:1,max:100,placeholder:`none`,value:t,style:{width:`5rem`},onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i()}}),` %`]}),(0,B.jsx)(`button`,{className:`small`,disabled:t.trim()===(r?String(r.percent):``),onClick:i,children:`Save`}),r?.holding&&(0,B.jsx)(`button`,{className:`small primary`,onClick:()=>void e.run(()=>R.liftUsageStop(e.account,e.kind)),children:`Lift`}),(0,B.jsx)(`span`,{className:`muted`,children:r?.holding?`Reached: work is held.`:r?.lifted?`Reached, lifted for this window.`:r?.utilization==null?``:`Now ${Math.round(r.utilization*100)}%.`})]})}var Ev=36e5,Dv={five_hour:5*Ev,seven_day:168*Ev};function Ov(e,t,n,r=Date.now()){let i=Dv[e];if(!i||!n||n<=r)return null;let a=r-(n-i);return a<i/10?null:t*i/Math.min(a,i)}function kv(e,t,n,r=Date.now()){let i=Ov(e,t,n,r);return i==null?Dv[e]?n?n<=r?{share:null,why:`No forecast: the window is resetting`}:{share:null,why:`No forecast yet: too little of the window has gone to tell the pace`}:{share:null,why:`No forecast: the reset time is not known yet`}:{share:null,why:`No forecast for this window`}:{share:i}}function Av(e,t){if(!e)return null;let n=e.match(/^ps?:([^/]+)/);return n?n[1]:t.find(t=>t.id===e)?.project??null}function jv(e,t,n,r){let i=n.find(n=>n.name===Av(e,t));return i?{account:i.account??`default`,remember:!0}:{account:r??n[0]?.account??`default`,remember:!1}}var Mv=e=>e==="default"?`Default`:e,Nv=e=>e&&e!=="default"?e:null;function Pv(e,t){return e.resetsAt!=null&&e.resetsAt<=t}function Fv(e,t){let n=e.seenAt??e.at,r=Math.max(0,Math.floor((t-n)/6e4));return r<1?`as of just now`:r<60?`as of ${r} min ago`:r<1440?`as of ${Math.floor(r/60)} h ago`:`as of ${new Date(n).toLocaleString([],{weekday:`short`,hour:`2-digit`,minute:`2-digit`})}`}function Iv(e,t){return t-(e.seenAt??e.at)>=36e5?Fv(e,t):null}function Lv(e){return e>=1e9?`${(e/1e9).toFixed(e>=1e10?0:1)}B`:e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(Math.round(e))}function Rv(e){return e==null?`—`:e>=100?`$${Math.round(e).toLocaleString(`en-US`)}`:e>=1?`$${e.toFixed(2)}`:`$${e.toFixed(3)}`}var zv=e=>`${Math.round(e*100)}%`;function Bv(e){let t={passing:` ✓`,failing:` ✗`,running:` …`,none:``}[e.checks],n=e.state===`open`?``:` (${e.state})`;return`PR #${e.number}${t}${n}`}var Vv=[`opus-5-5`,`sonnet-5-5`,`haiku-5-5`,`fable-5-1`,`opus-5`,`sonnet-5`,`haiku-4-5`],Hv=[`user`,`answer`,`manager`,`ledung`,`unknown`],Uv={user:`You typed`,answer:`Your answer`,manager:`A manager`,ledung:`Ledung update`,unknown:`Unknown`};function Wv(e,t){let n;return n=e===`model`?[...Vv,...t.filter(e=>!Vv.includes(e)).sort()]:e===`trigger`?Hv:[...t].sort(),t=>{if(e===`trigger`&&t===`unknown`)return`var(--s-other)`;let r=n.indexOf(t);return r>=0&&r<7?`var(--s${r+1})`:`var(--s-other)`}}function Gv({items:e}){return(0,B.jsx)(`div`,{className:`viz-legend`,children:e.map(e=>(0,B.jsxs)(`span`,{className:`viz-legend-item`,children:[(0,B.jsx)(`span`,{className:`viz-swatch${e.textured?` textured`:``}`,style:{background:e.color}}),e.label]},e.label))})}function Kv({children:e}){return(0,B.jsx)(`div`,{className:`viz-tip`,role:`tooltip`,children:e})}function qv(e){let[t,n]=(0,v.useState)(null),r=e.height??160,i=e.columns.map(t=>e.series.reduce((e,n)=>e+(t.values[n.key]??0),0)),a=Math.max(1,...i);if(!e.columns.length)return(0,B.jsx)(`p`,{className:`muted`,children:e.emptyText??`Nothing in this period.`});let o=[a,a/2],s=Math.max(1,Math.ceil(e.columns.length/8));return(0,B.jsxs)(`div`,{className:`viz-bars`,style:{height:r+22},onMouseLeave:()=>n(null),children:[(0,B.jsx)(`div`,{className:`viz-grid`,style:{height:r},children:o.map(e=>(0,B.jsx)(`div`,{className:`viz-gridline`,style:{bottom:`${e/a*100}%`},children:(0,B.jsx)(`span`,{children:Lv(e)})},e))}),(0,B.jsx)(`div`,{className:`viz-cols`,style:{height:r},children:e.columns.map((r,o)=>{let c=e.series.filter(e=>(r.values[e.key]??0)>0);return(0,B.jsxs)(`div`,{className:`viz-col${t===o?` active`:``}`,onMouseEnter:()=>n(o),onClick:()=>n(t===o?null:o),children:[(0,B.jsx)(`div`,{className:`viz-stack`,style:{height:`${i[o]/a*100}%`},children:c.map(e=>(0,B.jsx)(`div`,{className:`viz-seg${r.textured?` textured`:``}`,style:{flexGrow:r.values[e.key],background:e.color}},e.key))}),t===o&&(0,B.jsxs)(Kv,{children:[(0,B.jsx)(`strong`,{children:r.label}),r.note&&(0,B.jsx)(`div`,{className:`muted`,children:r.note}),c.slice().reverse().map(e=>(0,B.jsxs)(`div`,{className:`viz-tip-row`,children:[(0,B.jsx)(`span`,{className:`viz-swatch`,style:{background:e.color}}),` `,e.label,(0,B.jsx)(`span`,{className:`viz-tip-num`,children:Lv(r.values[e.key]??0)})]},e.key)),c.length>1&&(0,B.jsxs)(`div`,{className:`viz-tip-row total`,children:[`Total `,(0,B.jsx)(`span`,{className:`viz-tip-num`,children:Lv(i[o])})]})]}),o%s===0&&(0,B.jsx)(`span`,{className:`viz-xlabel`,children:r.short??r.label})]},o)})})]})}function Jv({label:e,value:t,sub:n}){return(0,B.jsxs)(`div`,{className:`viz-tile`,children:[(0,B.jsx)(`div`,{className:`viz-tile-label`,children:e}),(0,B.jsx)(`div`,{className:`viz-tile-value`,children:t}),n&&(0,B.jsx)(`div`,{className:`viz-tile-sub`,children:n})]})}var Yv={five_hour:`5-hour`,seven_day:`7-day`,seven_day_opus:`7-day Opus`,seven_day_sonnet:`7-day Sonnet`,seven_day_overage_included:`7-day (incl. extra)`,overage:`Extra usage`},Xv={five_hour:`boat`,seven_day:`ship`},Zv={allowed:{label:`OK`,icon:`●`,cls:`good`},allowed_warning:{label:`Close to the limit`,icon:`▲`,cls:`warning`},rejected:{label:`Limit reached`,icon:`■`,cls:`critical`}},Qv=(e,t)=>mv(e,Date.now(),t);function $v({account:e,limits:t,stops:n=[],run:r}){let i=t.filter(t=>(t.account??`default`)===e),a=(0,B.jsxs)(`div`,{className:`limits-account-name muted`,children:[Mv(e),!i.length&&` · no data yet`]});return i.length?(0,B.jsxs)(`div`,{className:`limits-account`,children:[a,(0,B.jsx)(ey,{limits:i,stops:n.filter(t=>t.account===e),run:r},e)]}):(0,B.jsx)(`div`,{className:`limits-account`,children:a})}function ey({limits:e,stops:t,run:n}){let r=Date.now();return(0,B.jsx)(`div`,{className:`limits`,children:e.map(e=>{if(Pv(e,r))return(0,B.jsxs)(`div`,{className:`limit limit-reset${Xv[e.kind]?` with-ship`:``}`,title:`${Yv[e.kind]??e.kind}: the window has reset since the last reading (${Fv(e,r)}). A new one comes with the next turn on this account.`,children:[(0,B.jsxs)(`div`,{className:`limit-head`,children:[(0,B.jsx)(`span`,{children:Yv[e.kind]??e.kind}),(0,B.jsx)(`span`,{className:`limit-status`,children:`reset`})]}),(0,B.jsx)(`div`,{className:`limit-sub muted`,children:(0,B.jsx)(`span`,{children:`no reading since the reset`})})]},e.kind);let i=Iv(e,r),a=Zv[e.status]??{label:e.status,icon:`●`,cls:`good`},o=e.utilization==null?void 0:Xv[e.kind],s=o&&e.utilization!=null?kv(e.kind,e.utilization,e.resetsAt):null,c=t.find(t=>t.kind===e.kind);return(0,B.jsxs)(`div`,{className:`limit${o?` with-ship`:``}`,title:`${Yv[e.kind]??e.kind}: ${a.label}${e.utilization==null?``:`, ${zv(e.utilization)} used`}${s?.share==null?``:`, about ${zv(s.share)} by the reset at this pace`}. ${Qv(e.resetsAt,e.kind)}. Reading ${Fv(e,r)}: Ledung hears the limits during a session's turn.`,children:[!o&&(0,B.jsxs)(`div`,{className:`limit-head`,children:[(0,B.jsx)(`span`,{children:Yv[e.kind]??e.kind}),(0,B.jsxs)(`span`,{className:`limit-status ${a.cls}`,children:[a.icon,` `,e.utilization==null?a.label:zv(e.utilization)]})]}),o&&e.utilization!=null?(0,B.jsx)(`div`,{className:`limit-ship-box`,children:(0,B.jsx)(yv,{utilization:e.utilization,label:Yv[e.kind],hull:o})}):e.utilization!=null&&(0,B.jsx)(`div`,{className:`limit-track`,children:(0,B.jsx)(`div`,{className:`limit-fill ${a.cls}`,style:{width:`${Math.min(100,e.utilization*100)}%`}})}),(0,B.jsxs)(`div`,{className:`limit-sub muted`,children:[(0,B.jsx)(`span`,{children:c&&n?``:Qv(e.resetsAt,e.kind)}),s&&(s.share==null?(0,B.jsx)(`span`,{className:`limit-forecast`,title:s.why,children:`≈ — by reset`}):(0,B.jsxs)(`span`,{className:`limit-forecast${s.share>=1?` over`:``}`,children:[`≈ `,zv(s.share),` by reset`]}))]}),i&&(0,B.jsx)(`div`,{className:`limit-sub limit-age`,children:i}),c&&n&&(0,B.jsx)(Cv,{stop:c,run:n})]},e.kind)})})}function ty(e){let t=[...e.sessions].sort((e,t)=>(t.endedAt??t.createdAt)-(e.endedAt??e.createdAt));return(0,B.jsxs)(`div`,{className:`waiting-view`,children:[(0,B.jsx)(`header`,{className:`session-head`,children:(0,B.jsxs)(`div`,{className:`session-head-text`,children:[(0,B.jsxs)(`h2`,{children:[`Archived · `,e.title]}),(0,B.jsx)(`div`,{className:`muted`,children:t.length?`${t.length} archived; nothing is deleted. Writing to one resumes it.`:`No archived sessions.`})]})}),(0,B.jsx)(`div`,{className:`waiting-list`,children:t.map(t=>{let n=e.overview?.sessions[t.id]?.total;return(0,B.jsxs)(`div`,{className:`archived-row`,children:[(0,B.jsxs)(`div`,{className:`archived-text`,children:[(0,B.jsx)(`button`,{className:`link`,onClick:()=>e.onOpenSession(t.id),children:t.title}),(0,B.jsxs)(`div`,{className:`muted`,children:[t.endedAt?`ended ${$(t.endedAt)}`:`ended`,t.endReason?` · ${t.endReason}`:``,n?` · ${Lv(n)}`:``]})]}),(0,B.jsxs)(`div`,{className:`archived-actions`,children:[t.claudeSessionId&&(0,B.jsx)(`button`,{className:`primary`,onClick:()=>e.run(()=>R.resume(t.id)),children:`Resume`}),(0,B.jsx)(`button`,{onClick:()=>e.run(()=>R.unarchive(t.id)),children:`Unarchive`})]})]},t.id)})})]})}var ny={merge:`merge`,devShip:`dev ship`,computerControl:`computer control`},ry=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,hour12:!1}),iy=e=>{let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`};function ay({away:e,onClick:t}){return(0,B.jsxs)(`button`,{className:`small away-marker`,title:`Away mode is on; open the session settings to end it`,onClick:t,children:[`Away until `,ry(e.until)]})}function oy({away:e,run:t}){let n=e.allow.length?e.allow.map(e=>ny[e]).join(`, `):`nothing`;return(0,B.jsxs)(`div`,{className:`banner away`,role:`status`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsxs)(`strong`,{children:[`Away until `,ry(e.until)]}),` · managers may: `,n]}),(0,B.jsx)(`button`,{className:`small`,title:`End away mode now`,onClick:()=>void t(()=>R.back()),children:`Back`})]})}function sy({initial:e,submit:t,run:n,close:r}){let[i,a]=(0,v.useState)(e.until),[o,s]=(0,v.useState)(e.allow),c=e=>s(t=>t.includes(e)?t.filter(t=>t!==e):w.filter(n=>n===e||t.includes(n)));return(0,B.jsxs)(`form`,{className:`away-form`,onSubmit:e=>{e.preventDefault(),n(async()=>{await R.away(i,o),r()})},children:[(0,B.jsxs)(`label`,{children:[`Away until `,(0,B.jsx)(`input`,{type:`time`,value:i,onChange:e=>a(e.target.value),required:!0})]}),(0,B.jsxs)(`span`,{className:`away-kinds`,children:[`Managers may:`,w.map(e=>(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:o.includes(e),onChange:()=>c(e)}),` `,ny[e]]},e))]}),(0,B.jsx)(`p`,{className:`muted`,children:`Merge and dev ship only when every floor passes. Computer control lets managers take over this computer; they are told when it ends. Everything else waits for you.`}),(0,B.jsxs)(`span`,{className:`away-actions`,children:[(0,B.jsx)(`button`,{type:`submit`,className:`primary small`,children:t}),(0,B.jsx)(`button`,{type:`button`,className:`small`,onClick:r,children:`Cancel`})]})]})}function cy({away:e,run:t}){let[n,r]=(0,v.useState)(!1);if(e){let i=e.allow.length?e.allow.map(e=>ny[e]).join(`, `):`nothing`;return(0,B.jsxs)(`div`,{className:`away-entry`,children:[(0,B.jsxs)(`div`,{className:`away-strip`,role:`status`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsxs)(`strong`,{children:[`Away until `,ry(e.until)]}),` · allowed: `,i]}),(0,B.jsxs)(`span`,{className:`away-actions`,children:[(0,B.jsx)(`button`,{className:`small${n?` on`:``}`,title:`Change the time or what managers may do, and stay away`,onClick:()=>r(!n),children:`Change…`}),(0,B.jsx)(`button`,{className:`small`,title:`End away mode now`,onClick:()=>{r(!1),t(()=>R.back())},children:`Back`})]})]}),n&&(0,B.jsx)(sy,{initial:{until:iy(e.until),allow:e.allow},submit:`Change`,run:t,close:()=>r(!1)})]})}return(0,B.jsxs)(`div`,{className:`away-entry`,children:[(0,B.jsx)(`button`,{className:`small${n?` on`:``}`,title:`Let managers merge, dev ship or take over this computer without you while you're away`,onClick:()=>r(!n),children:`Away…`}),n&&(0,B.jsx)(sy,{initial:{until:`08:00`,allow:T},submit:`Start`,run:t,close:()=>r(!1)})]})}function ly(e,t){return!!e&&t?.role!==`manager`}var uy=45;function dy({step:e,labels:t,onPick:n,children:r}){let i=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,a=t.length,o=bg(e,a),[s,c]=(0,v.useState)(o),l=(0,v.useRef)(`right`),u=(0,v.useRef)(0);(0,v.useEffect)(()=>{if(s===o)return;if(i){c(o);return}let e=setTimeout(()=>{u.current+=1,c(e=>e+Math.sign(o-e))},uy);return()=>clearTimeout(e)},[s,o,i]),s!==o&&(l.current=o>s?`right`:`left`);let d=Fh(Sg(s,a,l.current,s!==o),u.current).split(`
98
- `);return(0,B.jsxs)(`span`,{className:`boat-slider`,style:{"--boat-width":96,"--boat-ship":6},children:[(0,B.jsxs)(`span`,{className:`boat-track`,children:[(0,B.jsxs)(`pre`,{className:`sailing-ship`,"aria-hidden":`true`,children:[d.slice(0,3).join(`
99
- `),`
100
- `,(0,B.jsx)(`span`,{className:`boat-water`,children:d[3]})]}),r]}),(0,B.jsx)(`span`,{className:`boat-marks`,"aria-hidden":`true`,children:t.map((t,r)=>(0,B.jsx)(`span`,{className:r+1===e?`on`:void 0,style:{"--at":(xg(r+1,a)+.5)/96},onClick:e=>{e.preventDefault(),n(r+1)},children:t},t))})]})}var fy={workflow:`workflow`,computer:`this computer`,"workflow+computer":`workflow, changed on this computer`};function py(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null);(0,v.useEffect)(()=>{R.profiles().then(t,e=>r(e.message))},[]);let i=(e?.groups.length??0)>1;return(0,B.jsxs)(`section`,{children:[(0,B.jsxs)(`div`,{className:`settings-h`,children:[(0,B.jsx)(`h3`,{children:`Session profiles`}),(0,B.jsx)(qf,{kind:`config`})]}),(0,B.jsx)(`p`,{className:`muted`,children:`What managers and sessions get of your own Claude Code setup. A workflow's profiles file comes first; a profile of the same name in this computer's config changes it field by field. Read when each session starts.`}),n&&(0,B.jsx)(`p`,{className:`error`,children:n}),e?.groups.map(e=>(0,B.jsxs)(`div`,{className:`profiles-group`,children:[i&&(0,B.jsx)(`h4`,{children:e.workflow===null?`Chats and projects without a workflow's profiles`:`Workflow "${e.workflow}"`}),e.file&&(0,B.jsxs)(`p`,{className:`muted`,children:[`From `,(0,B.jsx)(`code`,{children:e.file})]}),e.warning&&(0,B.jsx)(`div`,{className:`board-warning`,role:`alert`,children:e.warning}),(0,B.jsxs)(`table`,{className:`plain`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Profile`}),(0,B.jsx)(`th`,{children:`From`}),(0,B.jsx)(`th`,{children:`About`})]})}),(0,B.jsxs)(`tbody`,{children:[(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:`full`}),(0,B.jsx)(`td`,{children:`built in`}),(0,B.jsx)(`td`,{className:`muted`,children:`Everything you have set up, as outside Ledung.`})]}),e.profiles.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:e.name}),(0,B.jsx)(`td`,{children:fy[e.source]}),(0,B.jsxs)(`td`,{className:`muted`,children:[e.about??``,e.allow.length>0&&(0,B.jsxs)(`div`,{children:[`Allows without asking: `,e.allow.map((e,t)=>(0,B.jsxs)(`span`,{children:[t?`, `:``,(0,B.jsx)(`code`,{children:e})]},e))]}),e.mcp.length>0&&(0,B.jsxs)(`div`,{children:[`Runs MCP servers: `,e.mcp.map((e,t)=>(0,B.jsxs)(`span`,{children:[t?`, `:``,(0,B.jsx)(`code`,{children:e})]},e))]})]})]},e.name))]})]}),(0,B.jsxs)(`p`,{className:`muted`,children:[`Default for managers: `,e.defaults.manager??`full`,` · for sessions: `,e.defaults.session??`full`,e.pluginsOff.length>0&&(0,B.jsxs)(B.Fragment,{children:[` · plugins off where installed: `,e.pluginsOff.join(`, `)]})]})]},e.workflow??``))]})}var my={installed:`your installed Claude Code`,path:`the Claude Code the config names`,bundled:`the copy that came with Ledung`};function hy(e){return e.filter(e=>e.status!==`ended`).map(e=>({id:e.id,title:e.title,project:e.project,runs:e.runner===`docker`?`the container's own`:e.claudeProgram?my[e.claudeProgram.kind]:`not recorded (started before Ledung recorded it)`,path:e.runner===`docker`?null:e.claudeProgram?.path??null,version:e.claudeVersion}))}function gy(e){return e.split("`").flatMap((e,t)=>t%2?[{kind:`code`,text:e}]:e.split(/(https:\/\/[^\s,)]+[^\s,).])/).filter(Boolean).map(e=>({kind:/^https:\/\//.test(e)?`link`:`text`,text:e})))}function _y({text:e}){return(0,B.jsx)(B.Fragment,{children:gy(e).map((e,t)=>e.kind===`code`?(0,B.jsx)(`code`,{children:e.text},t):e.kind===`link`?(0,B.jsx)(`a`,{href:e.text,target:`_blank`,rel:`noreferrer`,children:e.text},t):e.text)})}var vy=e=>e.charAt(0).toUpperCase()+e.slice(1);function yy({sessions:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),a=()=>R.claudeCode().then(e=>{n(e),i(null)},e=>i(e.message));(0,v.useEffect)(()=>{a()},[]);let o=hy(e),s=t?.program;return(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Claude Code`}),(0,B.jsxs)(`p`,{className:`muted`,children:[`Ledung runs your Claude Code: the `,(0,B.jsx)(`code`,{children:`claude`}),` on the PATH or where its installer puts it`,t?.required&&(0,B.jsxs)(B.Fragment,{children:[`, version `,t.required,` or newer (the one Ledung's Agent SDK was built for)`]}),`. Without it, sessions don't start. A running session keeps the program it started with.`]}),r&&(0,B.jsx)(`p`,{className:`error`,children:r}),t?.problem&&(0,B.jsx)(`div`,{className:`board-warning`,role:`alert`,children:(0,B.jsx)(_y,{text:t.problem})}),t&&(0,B.jsx)(`table`,{className:`plain`,children:(0,B.jsxs)(`tbody`,{children:[(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`New sessions run`}),(0,B.jsx)(`td`,{children:s?(0,B.jsxs)(B.Fragment,{children:[vy(my[s.kind]),` `,s.version&&(0,B.jsxs)(B.Fragment,{children:[`· `,s.version]}),(0,B.jsx)(`div`,{className:`muted mono`,children:s.path})]}):`Nothing: sessions don't start`})]}),t.installed&&t.installed.path!==s?.path&&(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Found`}),(0,B.jsxs)(`td`,{children:[vy(my[t.installed.kind]),` · `,t.installed.version??`version unknown`,(0,B.jsx)(`div`,{className:`muted mono`,children:t.installed.path})]})]})]})}),(0,B.jsx)(`button`,{onClick:()=>void a(),children:`Check again`}),o.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h4`,{children:`Running sessions`}),(0,B.jsxs)(`table`,{className:`plain`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Session`}),(0,B.jsx)(`th`,{children:`Runs`}),(0,B.jsx)(`th`,{children:`Version`})]})}),(0,B.jsx)(`tbody`,{children:o.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[e.title,(0,B.jsx)(`div`,{className:`muted`,children:e.project})]}),(0,B.jsxs)(`td`,{children:[vy(e.runs),e.path&&(0,B.jsx)(`div`,{className:`muted mono`,children:e.path})]}),(0,B.jsx)(`td`,{className:`mono`,children:e.version??``})]},e.id))})]})]})]})}function by(e){if(!e)return{label:`Remote: off`,detail:`Not on a relay: join one with a code below, or set "remote" in the config.`};switch(e.state){case`connected`:return{label:`Remote: connected`,detail:`Through the relay as ${e.publicName}.`};case`connecting`:return{label:`Remote: connecting…`,detail:`To the relay, as ${e.publicName}.`};case`reconnecting`:return{label:`Remote: reconnecting`,detail:e.error}}}var xy=7,Sy=864e5;function Cy(e,t){let n=e.validUntil?new Date(e.validUntil).toLocaleString():null,r=e.nextTry?new Date(e.nextTry).toLocaleTimeString():null,i=e.validUntil!==null&&e.validUntil-t<xy*Sy,a=n?` The one in use is valid until ${n}.`:``;switch(e.state){case`valid`:return{label:`Certificate valid until ${n}`,detail:i?`Fewer than ${xy} days left: it renews while Ledung is connected to the relay.`:null,warn:i,copy:!1};case`offline`:return{label:`Certificate: none yet`,detail:`Ledung orders one once it is connected to the relay.`,warn:!0,copy:!1};case`waiting-caa`:return{label:`Waiting for the CAA record`,detail:`Add this record to the DNS for the name. Ledung looks it up every minute${r?` (next at ${r})`:``} and orders as soon as it names this account.${e.error?` ${e.error}`:``}${a}`,warn:!n||i,copy:!0};case`ordering`:return{label:n?`Renewing the certificate…`:`Getting a certificate…`,detail:a.trim()||null,warn:!1,copy:!1};case`failed`:return{label:n?`Renewal failed`:`Getting a certificate failed`,detail:`${e.error??``}${r?` Trying again at ${r}.`:``}${a}`.trim()||null,warn:!0,copy:!1}}}var wy=function(e,t){let n=e,r=Ey[t],i=null,a=0,o=null,s=[],c={},l=function(e,t){a=n*4+17,i=function(e){let t=Array(e);for(let n=0;n<e;n+=1){t[n]=Array(e);for(let r=0;r<e;r+=1)t[n][r]=null}return t}(a),u(0,0),u(a-7,0),u(0,a-7),p(),f(),h(e,t),n>=7&&m(e),o??=v(n,r,s),g(o,t)},u=function(e,t){for(let n=-1;n<=7;n+=1)if(!(e+n<=-1||a<=e+n))for(let r=-1;r<=7;r+=1)t+r<=-1||a<=t+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?i[e+n][t+r]=!0:i[e+n][t+r]=!1)},d=function(){let e=0,t=0;for(let n=0;n<8;n+=1){l(!0,n);let r=Oy.getLostPoint(c);(n==0||e>r)&&(e=r,t=n)}return t},f=function(){for(let e=8;e<a-8;e+=1)i[e][6]??(i[e][6]=e%2==0);for(let e=8;e<a-8;e+=1)i[6][e]??(i[6][e]=e%2==0)},p=function(){let e=Oy.getPatternPosition(n);for(let t=0;t<e.length;t+=1)for(let n=0;n<e.length;n+=1){let r=e[t],a=e[n];if(i[r][a]==null)for(let e=-2;e<=2;e+=1)for(let t=-2;t<=2;t+=1)e==-2||e==2||t==-2||t==2||e==0&&t==0?i[r+e][a+t]=!0:i[r+e][a+t]=!1}},m=function(e){let t=Oy.getBCHTypeNumber(n);for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[Math.floor(n/3)][n%3+a-8-3]=r}for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[n%3+a-8-3][Math.floor(n/3)]=r}},h=function(e,t){let n=r<<3|t,o=Oy.getBCHTypeInfo(n);for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<6?i[t][8]=n:t<8?i[t+1][8]=n:i[a-15+t][8]=n}for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<8?i[8][a-t-1]=n:t<9?i[8][15-t-1+1]=n:i[8][15-t-1]=n}i[a-8][8]=!e},g=function(e,t){let n=-1,r=a-1,o=7,s=0,c=Oy.getMaskFunction(t);for(let t=a-1;t>0;t-=2)for(t==6&&--t;;){for(let n=0;n<2;n+=1)if(i[r][t-n]==null){let a=!1;s<e.length&&(a=(e[s]>>>o&1)==1),c(r,t-n)&&(a=!a),i[r][t-n]=a,--o,o==-1&&(s+=1,o=7)}if(r+=n,r<0||a<=r){r-=n,n=-n;break}}},_=function(e,t){let n=0,r=0,i=0,a=Array(t.length),o=Array(t.length);for(let s=0;s<t.length;s+=1){let c=t[s].dataCount,l=t[s].totalCount-c;r=Math.max(r,c),i=Math.max(i,l),a[s]=Array(c);for(let t=0;t<a[s].length;t+=1)a[s][t]=255&e.getBuffer()[t+n];n+=c;let u=Oy.getErrorCorrectPolynomial(l),d=Ay(a[s],u.getLength()-1).mod(u);o[s]=Array(u.getLength()-1);for(let e=0;e<o[s].length;e+=1){let t=e+d.getLength()-o[s].length;o[s][e]=t>=0?d.getAt(t):0}}let s=0;for(let e=0;e<t.length;e+=1)s+=t[e].totalCount;let c=Array(s),l=0;for(let e=0;e<r;e+=1)for(let n=0;n<t.length;n+=1)e<a[n].length&&(c[l]=a[n][e],l+=1);for(let e=0;e<i;e+=1)for(let n=0;n<t.length;n+=1)e<o[n].length&&(c[l]=o[n][e],l+=1);return c},v=function(e,t,n){let r=jy.getRSBlocks(e,t),i=My();for(let t=0;t<n.length;t+=1){let r=n[t];i.put(r.getMode(),4),i.put(r.getLength(),Oy.getLengthInBits(r.getMode(),e)),r.write(i)}let a=0;for(let e=0;e<r.length;e+=1)a+=r[e].dataCount;if(i.getLengthInBits()>a*8)throw`code length overflow. (`+i.getLengthInBits()+`>`+a*8+`)`;for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(236,8),i.getLengthInBits()>=a*8));)i.put(17,8);return _(i,r)};c.addData=function(e,t){t||=`Byte`;let n=null;switch(t){case`Numeric`:n=Ny(e);break;case`Alphanumeric`:n=Py(e);break;case`Byte`:n=Fy(e);break;case`Kanji`:n=Iy(e);break;default:throw`mode:`+t}s.push(n),o=null},c.isDark=function(e,t){if(e<0||a<=e||t<0||a<=t)throw e+`,`+t;return i[e][t]},c.getModuleCount=function(){return a},c.make=function(){if(n<1){let e=1;for(;e<40;e++){let t=jy.getRSBlocks(e,r),n=My();for(let t=0;t<s.length;t++){let r=s[t];n.put(r.getMode(),4),n.put(r.getLength(),Oy.getLengthInBits(r.getMode(),e)),r.write(n)}let i=0;for(let e=0;e<t.length;e++)i+=t[e].dataCount;if(n.getLengthInBits()<=i*8)break}n=e}l(!1,d())},c.createTableTag=function(e,t){e||=2,t=t===void 0?e*4:t;let n=``;n+=`<table style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: `+t+`px;`,n+=`">`,n+=`<tbody>`;for(let t=0;t<c.getModuleCount();t+=1){n+=`<tr>`;for(let r=0;r<c.getModuleCount();r+=1)n+=`<td style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: 0px;`,n+=` width: `+e+`px;`,n+=` height: `+e+`px;`,n+=` background-color: `,n+=c.isDark(t,r)?`#000000`:`#ffffff`,n+=`;`,n+=`"/>`;n+=`</tr>`}return n+=`</tbody>`,n+=`</table>`,n},c.createSvgTag=function(e,t,n,r){let i={};typeof arguments[0]==`object`&&(i=arguments[0],e=i.cellSize,t=i.margin,n=i.alt,r=i.title),e||=2,t=t===void 0?e*4:t,n=typeof n==`string`?{text:n}:n||{},n.text=n.text||null,n.id=n.text?n.id||`qrcode-description`:null,r=typeof r==`string`?{text:r}:r||{},r.text=r.text||null,r.id=r.text?r.id||`qrcode-title`:null;let a=c.getModuleCount()*e+t*2,o,s,l,u,d=``,f;for(f=`l`+e+`,0 0,`+e+` -`+e+`,0 0,-`+e+`z `,d+=`<svg version="1.1" xmlns="http://www.w3.org/2000/svg"`,d+=i.scalable?``:` width="`+a+`px" height="`+a+`px"`,d+=` viewBox="0 0 `+a+` `+a+`" `,d+=` preserveAspectRatio="xMinYMin meet"`,d+=r.text||n.text?` role="img" aria-labelledby="`+y([r.id,n.id].join(` `).trim())+`"`:``,d+=`>`,d+=r.text?`<title id="`+y(r.id)+`">`+y(r.text)+`</title>`:``,d+=n.text?`<description id="`+y(n.id)+`">`+y(n.text)+`</description>`:``,d+=`<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>`,d+=`<path d="`,l=0;l<c.getModuleCount();l+=1)for(u=l*e+t,o=0;o<c.getModuleCount();o+=1)c.isDark(l,o)&&(s=o*e+t,d+=`M`+s+`,`+u+f);return d+=`" stroke="transparent" fill="black"/>`,d+=`</svg>`,d},c.createDataURL=function(e,t){e||=2,t=t===void 0?e*4:t;let n=c.getModuleCount()*e+t*2,r=t,i=n-t;return Vy(n,n,function(t,n){if(r<=t&&t<i&&r<=n&&n<i){let i=Math.floor((t-r)/e),a=Math.floor((n-r)/e);return+!c.isDark(a,i)}return 1})},c.createImgTag=function(e,t,n){e||=2,t=t===void 0?e*4:t;let r=c.getModuleCount()*e+t*2,i=``;return i+=`<img`,i+=` src="`,i+=c.createDataURL(e,t),i+=`"`,i+=` width="`,i+=r,i+=`"`,i+=` height="`,i+=r,i+=`"`,n&&(i+=` alt="`,i+=y(n),i+=`"`),i+=`/>`,i};let y=function(e){let t=``;for(let n=0;n<e.length;n+=1){let r=e.charAt(n);switch(r){case`<`:t+=`&lt;`;break;case`>`:t+=`&gt;`;break;case`&`:t+=`&amp;`;break;case`"`:t+=`&quot;`;break;default:t+=r}}return t},b=function(e){e=e===void 0?2:e;let t=c.getModuleCount()*1+e*2,n=e,r=t-e,i,a,o,s,l,u={"██":`█`,"█ ":`▀`," █":`▄`," ":` `},d={"██":`▀`,"█ ":`▀`," █":` `," ":` `},f=``;for(i=0;i<t;i+=2){for(o=Math.floor((i-n)/1),s=Math.floor((i+1-n)/1),a=0;a<t;a+=1)l=`█`,n<=a&&a<r&&n<=i&&i<r&&c.isDark(o,Math.floor((a-n)/1))&&(l=` `),n<=a&&a<r&&n<=i+1&&i+1<r&&c.isDark(s,Math.floor((a-n)/1))?l+=` `:l+=`█`,f+=e<1&&i+1>=r?d[l]:u[l];f+=`
101
- `}return t%2&&e>0?f.substring(0,f.length-t-1)+Array(t+1).join(`▀`):f.substring(0,f.length-1)};return c.createASCII=function(e,t){if(e||=1,e<2)return b(t);--e,t=t===void 0?e*2:t;let n=c.getModuleCount()*e+t*2,r=t,i=n-t,a,o,s,l,u=Array(e+1).join(`██`),d=Array(e+1).join(` `),f=``,p=``;for(a=0;a<n;a+=1){for(s=Math.floor((a-r)/e),p=``,o=0;o<n;o+=1)l=1,r<=o&&o<i&&r<=a&&a<i&&c.isDark(s,Math.floor((o-r)/e))&&(l=0),p+=l?u:d;for(s=0;s<e;s+=1)f+=p+`
102
- `}return f.substring(0,f.length-1)},c.renderTo2dContext=function(e,t){t||=2;let n=c.getModuleCount();for(let r=0;r<n;r++)for(let i=0;i<n;i++)e.fillStyle=c.isDark(r,i)?`black`:`white`,e.fillRect(i*t,r*t,t,t)},c};wy.stringToBytes=function(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);t.push(r&255)}return t},wy.createStringToBytes=function(e,t){let n=function(){let n=zy(e),r=function(){let e=n.read();if(e==-1)throw`eof`;return e},i=0,a={};for(;;){let e=n.read();if(e==-1)break;let t=r(),o=r(),s=r(),c=String.fromCharCode(e<<8|t);a[c]=o<<8|s,i+=1}if(i!=t)throw i+` != `+t;return a}();return function(e){let t=[];for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r);if(i<128)t.push(i);else{let i=n[e.charAt(r)];typeof i==`number`?(i&255)==i?t.push(i):(t.push(i>>>8),t.push(i&255)):t.push(63)}}return t}};var Ty={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ey={L:1,M:0,Q:3,H:2},Dy={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Oy=function(){let e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,n=7973,r={},i=function(e){let t=0;for(;e!=0;)t+=1,e>>>=1;return t};return r.getBCHTypeInfo=function(e){let n=e<<10;for(;i(n)-i(t)>=0;)n^=t<<i(n)-i(t);return(e<<10|n)^21522},r.getBCHTypeNumber=function(e){let t=e<<12;for(;i(t)-i(n)>=0;)t^=n<<i(t)-i(n);return e<<12|t},r.getPatternPosition=function(t){return e[t-1]},r.getMaskFunction=function(e){switch(e){case Dy.PATTERN000:return function(e,t){return(e+t)%2==0};case Dy.PATTERN001:return function(e,t){return e%2==0};case Dy.PATTERN010:return function(e,t){return t%3==0};case Dy.PATTERN011:return function(e,t){return(e+t)%3==0};case Dy.PATTERN100:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case Dy.PATTERN101:return function(e,t){return e*t%2+e*t%3==0};case Dy.PATTERN110:return function(e,t){return(e*t%2+e*t%3)%2==0};case Dy.PATTERN111:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw`bad maskPattern:`+e}},r.getErrorCorrectPolynomial=function(e){let t=Ay([1],0);for(let n=0;n<e;n+=1)t=t.multiply(Ay([1,ky.gexp(n)],0));return t},r.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case Ty.MODE_NUMBER:return 10;case Ty.MODE_ALPHA_NUM:return 9;case Ty.MODE_8BIT_BYTE:return 8;case Ty.MODE_KANJI:return 8;default:throw`mode:`+e}else if(t<27)switch(e){case Ty.MODE_NUMBER:return 12;case Ty.MODE_ALPHA_NUM:return 11;case Ty.MODE_8BIT_BYTE:return 16;case Ty.MODE_KANJI:return 10;default:throw`mode:`+e}else if(t<41)switch(e){case Ty.MODE_NUMBER:return 14;case Ty.MODE_ALPHA_NUM:return 13;case Ty.MODE_8BIT_BYTE:return 16;case Ty.MODE_KANJI:return 12;default:throw`mode:`+e}else throw`type:`+t},r.getLostPoint=function(e){let t=e.getModuleCount(),n=0;for(let r=0;r<t;r+=1)for(let i=0;i<t;i+=1){let a=0,o=e.isDark(r,i);for(let n=-1;n<=1;n+=1)if(!(r+n<0||t<=r+n))for(let s=-1;s<=1;s+=1)i+s<0||t<=i+s||(n!=0||s!=0)&&o==e.isDark(r+n,i+s)&&(a+=1);a>5&&(n+=3+a-5)}for(let r=0;r<t-1;r+=1)for(let i=0;i<t-1;i+=1){let t=0;e.isDark(r,i)&&(t+=1),e.isDark(r+1,i)&&(t+=1),e.isDark(r,i+1)&&(t+=1),e.isDark(r+1,i+1)&&(t+=1),(t==0||t==4)&&(n+=3)}for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(r,i)&&!e.isDark(r,i+1)&&e.isDark(r,i+2)&&e.isDark(r,i+3)&&e.isDark(r,i+4)&&!e.isDark(r,i+5)&&e.isDark(r,i+6)&&(n+=40);for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(i,r)&&!e.isDark(i+1,r)&&e.isDark(i+2,r)&&e.isDark(i+3,r)&&e.isDark(i+4,r)&&!e.isDark(i+5,r)&&e.isDark(i+6,r)&&(n+=40);let r=0;for(let n=0;n<t;n+=1)for(let i=0;i<t;i+=1)e.isDark(i,n)&&(r+=1);let i=Math.abs(100*r/t/t-50)/5;return n+=i*10,n},r}(),ky=function(){let e=Array(256),t=Array(256);for(let t=0;t<8;t+=1)e[t]=1<<t;for(let t=8;t<256;t+=1)e[t]=e[t-4]^e[t-5]^e[t-6]^e[t-8];for(let n=0;n<255;n+=1)t[e[n]]=n;let n={};return n.glog=function(e){if(e<1)throw`glog(`+e+`)`;return t[e]},n.gexp=function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]},n}(),Ay=function(e,t){if(e.length===void 0)throw e.length+`/`+t;let n=function(){let n=0;for(;n<e.length&&e[n]==0;)n+=1;let r=Array(e.length-n+t);for(let t=0;t<e.length-n;t+=1)r[t]=e[t+n];return r}(),r={};return r.getAt=function(e){return n[e]},r.getLength=function(){return n.length},r.multiply=function(e){let t=Array(r.getLength()+e.getLength()-1);for(let n=0;n<r.getLength();n+=1)for(let i=0;i<e.getLength();i+=1)t[n+i]^=ky.gexp(ky.glog(r.getAt(n))+ky.glog(e.getAt(i)));return Ay(t,0)},r.mod=function(e){if(r.getLength()-e.getLength()<0)return r;let t=ky.glog(r.getAt(0))-ky.glog(e.getAt(0)),n=Array(r.getLength());for(let e=0;e<r.getLength();e+=1)n[e]=r.getAt(e);for(let r=0;r<e.getLength();r+=1)n[r]^=ky.gexp(ky.glog(e.getAt(r))+t);return Ay(n,0).mod(e)},r},jy=function(){let e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){let n={};return n.totalCount=e,n.dataCount=t,n},n={},r=function(t,n){switch(n){case Ey.L:return e[(t-1)*4+0];case Ey.M:return e[(t-1)*4+1];case Ey.Q:return e[(t-1)*4+2];case Ey.H:return e[(t-1)*4+3];default:return}};return n.getRSBlocks=function(e,n){let i=r(e,n);if(i===void 0)throw`bad rs block @ typeNumber:`+e+`/errorCorrectionLevel:`+n;let a=i.length/3,o=[];for(let e=0;e<a;e+=1){let n=i[e*3+0],r=i[e*3+1],a=i[e*3+2];for(let e=0;e<n;e+=1)o.push(t(r,a))}return o},n}(),My=function(){let e=[],t=0,n={};return n.getBuffer=function(){return e},n.getAt=function(t){let n=Math.floor(t/8);return(e[n]>>>7-t%8&1)==1},n.put=function(e,t){for(let r=0;r<t;r+=1)n.putBit((e>>>t-r-1&1)==1)},n.getLengthInBits=function(){return t},n.putBit=function(n){let r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1},n},Ny=function(e){let t=Ty.MODE_NUMBER,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+2<t.length;)e.put(i(t.substring(r,r+3)),10),r+=3;r<t.length&&(t.length-r==1?e.put(i(t.substring(r,r+1)),4):t.length-r==2&&e.put(i(t.substring(r,r+2)),7))};let i=function(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*10+a(e.charAt(n));return t},a=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;throw`illegal char :`+e};return r},Py=function(e){let t=Ty.MODE_ALPHA_NUM,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+1<t.length;)e.put(i(t.charAt(r))*45+i(t.charAt(r+1)),11),r+=2;r<t.length&&e.put(i(t.charAt(r)),6)};let i=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;if(`A`<=e&&e<=`Z`)return e.charCodeAt(0)-65+10;switch(e){case` `:return 36;case`$`:return 37;case`%`:return 38;case`*`:return 39;case`+`:return 40;case`-`:return 41;case`.`:return 42;case`/`:return 43;case`:`:return 44;default:throw`illegal char :`+e}};return r},Fy=function(e){let t=Ty.MODE_8BIT_BYTE,n=wy.stringToBytes(e),r={};return r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){for(let t=0;t<n.length;t+=1)e.put(n[t],8)},r},Iy=function(e){let t=Ty.MODE_KANJI,n=wy.stringToBytes;(function(e,t){let r=n(e);if(r.length!=2||(r[0]<<8|r[1])!=t)throw`sjis not supported.`})(`友`,38726);let r=n(e),i={};return i.getMode=function(){return t},i.getLength=function(e){return~~(r.length/2)},i.write=function(e){let t=r,n=0;for(;n+1<t.length;){let r=(255&t[n])<<8|255&t[n+1];if(33088<=r&&r<=40956)r-=33088;else if(57408<=r&&r<=60351)r-=49472;else throw`illegal char at `+(n+1)+`/`+r;r=(r>>>8&255)*192+(r&255),e.put(r,13),n+=2}if(n<t.length)throw`illegal char at `+(n+1)},i},Ly=function(){let e=[],t={};return t.writeByte=function(t){e.push(t&255)},t.writeShort=function(e){t.writeByte(e),t.writeByte(e>>>8)},t.writeBytes=function(e,n,r){n||=0,r||=e.length;for(let i=0;i<r;i+=1)t.writeByte(e[i+n])},t.writeString=function(e){for(let n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},t.toByteArray=function(){return e},t.toString=function(){let t=``;t+=`[`;for(let n=0;n<e.length;n+=1)n>0&&(t+=`,`),t+=e[n];return t+=`]`,t},t},Ry=function(){let e=0,t=0,n=0,r=``,i={},a=function(e){r+=String.fromCharCode(o(e&63))},o=function(e){if(e<0)throw`n:`+e;if(e<26)return 65+e;if(e<52)return 97+(e-26);if(e<62)return 48+(e-52);if(e==62)return 43;if(e==63)return 47;throw`n:`+e};return i.writeByte=function(r){for(e=e<<8|r&255,t+=8,n+=1;t>=6;)a(e>>>t-6),t-=6},i.flush=function(){if(t>0&&(a(e<<6-t),e=0,t=0),n%3!=0){let e=3-n%3;for(let t=0;t<e;t+=1)r+=`=`}},i.toString=function(){return r},i},zy=function(e){let t=e,n=0,r=0,i=0,a={};a.read=function(){for(;i<8;){if(n>=t.length){if(i==0)return-1;throw`unexpected end of file./`+i}let e=t.charAt(n);if(n+=1,e==`=`)return i=0,-1;e.match(/^\s$/)||(r=r<<6|o(e.charCodeAt(0)),i+=6)}let e=r>>>i-8&255;return i-=8,e};let o=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(e==43)return 62;if(e==47)return 63;throw`c:`+e};return a},By=function(e,t){let n=e,r=t,i=Array(e*t),a={};a.setPixel=function(e,t,r){i[t*n+e]=r},a.write=function(e){e.writeString(`GIF87a`),e.writeShort(n),e.writeShort(r),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(`,`),e.writeShort(0),e.writeShort(0),e.writeShort(n),e.writeShort(r),e.writeByte(0);let t=s(2);e.writeByte(2);let i=0;for(;t.length-i>255;)e.writeByte(255),e.writeBytes(t,i,255),i+=255;e.writeByte(t.length-i),e.writeBytes(t,i,t.length-i),e.writeByte(0),e.writeString(`;`)};let o=function(e){let t=e,n=0,r=0,i={};return i.write=function(e,i){if(e>>>i)throw`length over`;for(;n+i>=8;)t.writeByte(255&(e<<n|r)),i-=8-n,e>>>=8-n,r=0,n=0;r=e<<n|r,n+=i},i.flush=function(){n>0&&t.writeByte(r)},i},s=function(e){let t=1<<e,n=(1<<e)+1,r=e+1,a=c();for(let e=0;e<t;e+=1)a.add(String.fromCharCode(e));a.add(String.fromCharCode(t)),a.add(String.fromCharCode(n));let s=Ly(),l=o(s);l.write(t,r);let u=0,d=String.fromCharCode(i[u]);for(u+=1;u<i.length;){let e=String.fromCharCode(i[u]);u+=1,a.contains(d+e)?d+=e:(l.write(a.indexOf(d),r),a.size()<4095&&(a.size()==1<<r&&(r+=1),a.add(d+e)),d=e)}return l.write(a.indexOf(d),r),l.write(n,r),l.flush(),s.toByteArray()},c=function(){let e={},t=0,n={};return n.add=function(r){if(n.contains(r))throw`dup key:`+r;e[r]=t,t+=1},n.size=function(){return t},n.indexOf=function(t){return e[t]},n.contains=function(t){return e[t]!==void 0},n};return a},Vy=function(e,t,n){let r=By(e,t);for(let i=0;i<t;i+=1)for(let t=0;t<e;t+=1)r.setPixel(t,i,n(t,i));let i=Ly();r.write(i);let a=Ry(),o=i.toByteArray();for(let e=0;e<o.length;e+=1)a.writeByte(o[e]);return a.flush(),`data:image/gif;base64,`+a};wy.stringToBytes;var Hy=/^[0-9A-Z $%*+\-./:]*$/,Uy=.3,Wy=e=>e.toUpperCase();function Gy(e){let t=wy(0,`H`);t.addData(e,Hy.test(e)?`Alphanumeric`:`Byte`),t.make();let n=t.getModuleCount(),r=Math.floor(n*Uy);r%2==0&&r--;let i=(n-r)/2,a=(e,t)=>e>=i&&e<i+r&&t>=i&&t<i+r;return{n,dark:(e,n)=>!a(e,n)&&t.isDark(e,n),logo:{from:i,size:r}}}function Ky(e){return e.secure&&e.serviceWorker&&e.pushManager?`yes`:/iPhone|iPad|iPod/.test(e.userAgent)&&!e.standalone?`home-screen`:`no`}var qy=()=>Ky({secure:window.isSecureContext,serviceWorker:`serviceWorker`in navigator,pushManager:`PushManager`in window,userAgent:navigator.userAgent,standalone:navigator.standalone===!0||matchMedia(`(display-mode: standalone)`).matches});function Jy(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(Math.ceil(e.length/4)*4,`=`);return Uint8Array.from(atob(t),e=>e.charCodeAt(0))}function Yy(e,t){return!e||e.byteLength!==t.length?!1:new Uint8Array(e).every((e,n)=>e===t[n])}async function Xy(){return await navigator.serviceWorker.register(`/sw.js`,{scope:`/`}),navigator.serviceWorker.ready}async function Zy(){if((Notification.permission===`granted`?`granted`:await Notification.requestPermission())!==`granted`)throw Error(`Notifications are blocked for Ledung here. Allow them in the settings for it, then switch this on again.`);let{publicKey:e}=await R.pushState(),t=await Xy(),n=Jy(e),r=await t.pushManager.getSubscription();r&&!Yy(r.options.applicationServerKey,n)&&(await r.unsubscribe(),r=null),r??=await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:n}),await R.pushOn(r.toJSON())}async function Qy(){await R.pushOff(),await(await(await navigator.serviceWorker.getRegistration(`/`))?.pushManager.getSubscription())?.unsubscribe()}async function $y(){let{on:e}=await R.pushState();return e?!!await(await navigator.serviceWorker.getRegistration(`/`))?.pushManager.getSubscription():!1}function eb(e){return e?`Pushes for this computer come through the first tab: on the phone, switch on push notifications in Settings there, under Phones. They say this computer's name, and tapping one opens this tab.`:`Pushes for this computer come through the first tab once the two computers are linked (Settings → Linked computers); then, on the phone, switch them on in Settings there, under Phones.`}var tb=[`green`,`purple`,`teal`,`amber`,`pink`,`orange`];function nb(e){return of[e]}function rb(e,t,n=!1){return n?{tabs:null,remote:!1,here:e.find(e=>e.here)??null}:{tabs:e.length>1?e:null,remote:t,here:e.find(e=>e.here)??null}}var ib=3e3,ab=`ledung:paired?`,ob=`ledung:paired`;function sb(e,t,n,r=`not-paired`){return!!e.linked&&!e.here&&!t&&!n&&r===`not-paired`}function cb(){return ab}function lb(e,t){return t&&e===ab?ob:null}function ub(e,t){let n;try{n=new URL(t).origin}catch{return!1}return e.fromFrame&&e.origin===n&&e.data===ob}function db(e,t){return t!==null&&e.some(e=>e.id===t&&!e.here)?t:null}function fb(e){let t=/^#\/c\/([^/]+)$/.exec(e);if(!t)return null;try{return decodeURIComponent(t[1]).toLowerCase()}catch{return null}}function pb(e){if(!e)return;let{light:t,dark:n}=nb(e.colour);return{"--cc-light":t,"--cc-dark":n}}function mb(e=globalThis){return e.self!==e.top}function hb(e){return e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}function gb(e,t,n){return e.here?t===null?0:n:e.waiting??0}var _b=e=>e?new Date(e).toLocaleString():`never`;function vb({text:e}){let{n:t,dark:n,logo:r}=Gy(e),i=[];for(let e=0;e<t;e++)for(let r=0;r<t;r++)n(e,r)&&i.push(`M${r+4},${e+4}h1v1h-1z`);let a=r.from+4+.5,o=r.size-1;return(0,B.jsxs)(`svg`,{className:`qr`,viewBox:`0 0 ${t+8} ${t+8}`,width:220,height:220,role:`img`,"aria-label":`QR code of the pairing link`,children:[(0,B.jsx)(`rect`,{width:t+8,height:t+8,fill:`#fff`}),(0,B.jsx)(`path`,{d:i.join(``),fill:`#000`}),(0,B.jsx)(`image`,{href:`/icon.svg?v=2`,x:a,y:a,width:o,height:o})]})}function yb({run:e,linked:t=!1}){let[n,r]=(0,v.useState)(null);return(0,v.useEffect)(()=>{R.thisDevice().then(r,()=>r({remote:!1}))},[]),n?(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Phones`}),n.remote?(0,B.jsx)(bb,{device:n.device,mayAddPasskey:n.mayAddPasskey,unlockedUntil:n.unlockedUntil,linked:t,run:e,onChange:()=>R.thisDevice().then(r)}):(0,B.jsx)(wb,{run:e})]}):null}function bb(e){let{device:t,unlockedUntil:n}=e,[r,i]=(0,v.useState)(Date.now());(0,v.useEffect)(()=>{let e=setInterval(()=>i(Date.now()),15e3);return()=>clearInterval(e)},[]);let a=n!==null&&n>r,o=t.kind===`computer`;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{className:`muted`,children:[`This device is paired as `,(0,B.jsx)(`b`,{children:t.name}),o?`, a computer`:``,`. Devices are listed and removed in Settings on the computer Ledung runs on.`]}),t.passkey&&o?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`muted`,children:`Its passkey is set up: allowing a sensitive call from here asks for it (Touch ID or Windows Hello) each time.`}),(0,B.jsx)(`p`,{children:a?(0,B.jsx)(B.Fragment,{children:`🔓 Logged on: changes need nothing more until you log out, or until 14 days without use.`}):(0,B.jsx)(B.Fragment,{children:`🔒 Logged off: from here you can look, not change anything. Log on with the passkey; it lasts until you log out.`})}),a?(0,B.jsx)(`button`,{onClick:()=>void e.run(async()=>{await R.logOutDevice(),e.onChange()}),children:`Log out`}):(0,B.jsx)(`button`,{onClick:()=>void e.run(async()=>{await R.unlockDevice(),e.onChange()}),children:`Log on`}),mb()&&(0,B.jsx)(Sb,{linked:e.linked})]}):t.passkey?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`muted`,children:`Its passkey is set up: allowing a sensitive call or writing to a manager from here asks for it (Face ID or fingerprint) each time.`}),(0,B.jsx)(`p`,{children:a?(0,B.jsxs)(B.Fragment,{children:[`🔓 Unlocked for changes until `,new Date(n).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),`.`]}):(0,B.jsx)(B.Fragment,{children:`🔒 Locked: from here you can look, not change anything. Unlocking takes the passkey once and lasts 30 minutes.`})}),!a&&(0,B.jsx)(`button`,{onClick:()=>void e.run(async()=>{await R.unlockDevice(),e.onChange()}),children:`Unlock`}),mb()?(0,B.jsx)(Sb,{linked:e.linked}):(0,B.jsx)(Cb,{run:e.run,onChange:e.onChange})]}):e.mayAddPasskey&&mb()?(0,B.jsx)(xb,{run:e.run,onChange:e.onChange}):e.mayAddPasskey?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`muted`,children:`Set up a passkey now: without it this device can only look, and every change waits for the computer. This is possible in the first 10 minutes after pairing.`}),(0,B.jsx)(`button`,{onClick:()=>void e.run(async()=>{await R.addPasskey(),e.onChange()}),children:`Set up passkey`})]}):(0,B.jsx)(`p`,{className:`muted`,children:`No passkey: this device can only look; changes wait for the computer. To add one, pair this device again from Settings on the computer.`})]})}function xb({run:e,onChange:t}){let[n,r]=(0,v.useState)(null);return(0,v.useEffect)(()=>{if(!n)return;let e=setInterval(()=>{R.thisDevice().then(e=>{e.remote&&e.device.passkey&&t()},()=>{}),Date.now()>n.expiresAt&&r(null)},2e3);return()=>clearInterval(e)},[n,t]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`muted`,children:`Set up a passkey now: without it this device can only look. It is made in a window of its own (here inside another computer's page the browser may not make one), and works here afterwards. This is possible in the first 10 minutes after pairing.`}),n?(0,B.jsxs)(`p`,{children:[(0,B.jsx)(`a`,{className:`button-link`,href:n.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open the passkey window`}),` `,(0,B.jsx)(`span`,{className:`muted`,children:`· then come back here`})]}):(0,B.jsx)(`button`,{onClick:()=>void e(async()=>r(await R.passkeyEnrolLink())),children:`Set up passkey`})]})}function Sb({linked:e}){return(0,B.jsx)(`p`,{className:`muted push-switch framed-push`,children:eb(e)})}function Cb({run:e,onChange:t}){let n=qy(),[r,i]=(0,v.useState)(null);if((0,v.useEffect)(()=>{n===`yes`&&$y().then(i,()=>i(!1))},[n]),n===`home-screen`)return(0,B.jsx)(`p`,{className:`muted push-switch`,children:`Push notifications on an iPhone need Ledung on the Home Screen: Share → Add to Home Screen, then open it from there and switch them on here.`});if(n===`no`)return(0,B.jsx)(`p`,{className:`muted push-switch`,children:`This browser can't get push notifications.`});if(r===null)return null;let a=n=>void e(async()=>{try{await(n?Zy():Qy()),i(n)}finally{t()}});return(0,B.jsxs)(`div`,{className:`push-switch`,children:[(0,B.jsxs)(`label`,{className:`toggle`,title:`A notification on this phone when something new waits for you, even with Ledung closed`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>a(e.target.checked)}),` Push notifications to this phone`]}),(0,B.jsx)(`p`,{className:`muted`,children:`When something new waits for you on this computer. It says which computer and what kind of item, never the text: that loads when you open it.`})]})}function wb({run:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(Date.now()),s=()=>R.devices().then(e=>{n(e),i(t=>t&&e.devices.length>t.before?null:t)},()=>{});if((0,v.useEffect)(()=>{s()},[]),(0,v.useEffect)(()=>{if(!r)return;let e=setInterval(()=>{o(Date.now()),s()},2e3);return()=>clearInterval(e)},[r]),!t)return null;if(!t.publicName)return(0,B.jsx)(`p`,{className:`muted`,children:`Reaching Ledung from a phone anywhere needs a relay: set "remote" with its "publicName" in the config. Then phones are paired here.`});let c=r&&r.expiresAt>a?r:null;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{className:`muted`,children:[`Phones, and other computers' Ledung pages (their tab for this computer), that reach this Ledung at https://`,t.publicName,`. Only a paired device gets in there; the sign-in link does not work there. A phone unlocks for 30 minutes at a time; a computer stays logged on until it logs out.`]}),t.devices.length===0&&(0,B.jsx)(`p`,{className:`muted`,children:`No paired devices.`}),t.devices.map(t=>(0,B.jsxs)(`div`,{className:`device-row`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{children:t.name}),` `,(0,B.jsxs)(`span`,{className:`muted`,children:[`· `,t.kind===`computer`?`computer`:`phone`,` · paired `,t.pairedVia?`through the link from ${t.pairedVia} `:``,_b(t.createdAt),` · last used `,_b(t.lastUsedAt),` · `,t.passkey?`passkey added ${_b(t.passkeyAt)}`:`no passkey`]})]}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>void e(async()=>{await R.revokeDevice(t.id),await s()}),children:`Revoke`})]},t.id)),c?(0,B.jsxs)(`div`,{className:`pairing`,children:[c.kind===`phone`&&(0,B.jsx)(vb,{text:Wy(c.url)}),c.kind===`computer`?(0,B.jsxs)(`p`,{className:`muted`,children:[`On the other computer, click this computer's tab and type the code, or the link, into the field there. It works once, for `,Math.max(0,Math.ceil((c.expiresAt-a)/6e4)),` more minute(s). Then set up the passkey there and log on: it stays logged on until you log out.`]}):(0,B.jsxs)(`p`,{className:`muted`,children:[`Scan it with the phone, or open this link on it. It works once, for `,Math.max(0,Math.ceil((c.expiresAt-a)/6e4)),` more minute(s). Then set up the passkey on the phone, in its Settings → Remote & devices → Phones.`]}),c.kind===`computer`&&(0,B.jsx)(`p`,{className:`pair-code`,children:(0,B.jsx)(`b`,{children:new URL(c.url).pathname.split(`/`).pop().toUpperCase()})}),(0,B.jsx)(`code`,{className:`pair-link`,children:c.url})]}):(0,B.jsx)(`p`,{className:`device-pair-buttons`,children:[`phone`,`computer`].map(n=>(0,B.jsx)(`button`,{onClick:()=>void e(async()=>{let e=await R.pairDevice(n);o(Date.now()),i({...e,before:t.devices.length})}),children:n===`phone`?`Pair a phone`:`Pair a computer`},n))})]})}var Tb=e=>e?new Date(e).toLocaleString():`never`;function Eb({run:e}){let t=z(),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(Date.now()),f=()=>R.links().then(e=>{r(e),a(t=>t&&e.links.length>t.before?null:t)},()=>r(null));if((0,v.useEffect)(()=>{f()},[]),(0,v.useEffect)(()=>{if(!i)return;let e=setInterval(()=>{d(Date.now()),f()},2e3);return()=>clearInterval(e)},[i]),!n)return null;let p=i&&i.expiresAt>u?i:null;return(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Linked computers`}),n.problem?(0,B.jsx)(`p`,{className:`muted`,children:n.problem}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`muted`,children:`Your other computers' Ledungs this one is linked with. Their managers will reach this computer's managers as if they ran here; the link goes end to end through the relay, which can't read it.`}),n.links.length===0&&(0,B.jsx)(`p`,{className:`muted`,children:`No linked computers.`}),n.links.map(t=>(0,B.jsxs)(`div`,{className:`device-row`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`b`,{children:t.name}),` `,(0,B.jsxs)(`span`,{className:`muted`,children:[`· `,t.publicName,` · linked `,Tb(t.linkedAt),` · last heard from `,Tb(t.lastUsedAt)]})]}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>void e(async()=>{await R.unlink(t.id),await f()}),children:`Unlink`})]},t.id)),p?(0,B.jsxs)(`div`,{className:`pairing`,children:[(0,B.jsxs)(`p`,{className:`muted`,children:[`Paste this in Settings → Linked computers on the other computer. It works once, for `,Math.max(0,Math.ceil((p.expiresAt-u)/6e4)),` more minute(s).`]}),(0,B.jsx)(`code`,{className:`pair-link`,children:p.code}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>void navigator.clipboard?.writeText(p.code),children:`Copy`})]}):(0,B.jsx)(`button`,{onClick:()=>void e(async()=>{let e=await R.linkCode();d(Date.now()),a({...e,before:n.links.length})}),children:`Link a computer`}),(0,B.jsxs)(`div`,{className:`link-join`,children:[(0,B.jsx)(`p`,{className:`muted`,children:`Or link with a code made on the other computer:`}),(0,B.jsx)(`input`,{type:`text`,...t,value:o,placeholder:`name.example.com/…`,"aria-label":`Link code from the other computer`,onChange:e=>s(e.target.value)}),(0,B.jsx)(`input`,{type:`text`,...t,value:c,maxLength:40,placeholder:`Its name here, e.g. PC`,"aria-label":`Name for the other computer`,onChange:e=>l(e.target.value)}),(0,B.jsx)(`button`,{disabled:!o.trim(),onClick:()=>void e(async()=>{await R.joinLink(o.trim(),c.trim()),s(``),l(``),await f()}),children:`Link`})]})]})]})}function Db({computers:e,run:t}){return e.length?(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Computers`}),(0,B.jsx)(`p`,{className:`muted`,children:e.length>1?`The tabs at the top of the page, this computer first. A name or colour changed here is this Ledung's; the config's are where they start.`:`Tabs show at the top of the page when the config lists more than one computer. The name is also the remote frame's label.`}),e.map(e=>(0,B.jsx)(Ob,{computer:e,run:t},e.id))]}):null}function Ob({computer:e,run:t}){let n=z(),[r,i]=(0,v.useState)(e.name);(0,v.useEffect)(()=>i(e.name),[e.name]);let a=e.name!==e.config.name||e.colour!==e.config.colour,o=r.trim()!==e.name,s=()=>t(()=>R.editComputer(e.id,{name:r.trim()||null})),c=e.here?`${e.name} (this computer)`:e.name;return(0,B.jsxs)(`div`,{className:`computer-row`,role:`group`,"aria-label":`Computer ${c}`,children:[(0,B.jsxs)(`div`,{className:`computer-name`,children:[(0,B.jsx)(`input`,{type:`text`,...n,value:r,maxLength:24,"aria-label":`Name of ${c}`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&o&&s()}}),o&&(0,B.jsx)(`button`,{className:`small primary`,onClick:()=>void s(),children:`Save`}),e.here&&(0,B.jsx)(`span`,{className:`muted`,children:`This computer`}),a&&!o&&(0,B.jsx)(`button`,{className:`small`,title:`Back to ${e.config.name} in ${of[e.config.colour].label.toLowerCase()}, as the config has it`,onClick:()=>void t(()=>R.editComputer(e.id,{name:null,colour:null})),children:`Use the config's`})]}),(0,B.jsx)(`div`,{className:`swatches`,children:tb.map(n=>(0,B.jsx)(`button`,{type:`button`,className:`swatch${e.colour===n?` on`:``}`,"aria-pressed":e.colour===n,title:of[n].label,"aria-label":`${c}: ${of[n].label}`,onClick:()=>void t(()=>R.editComputer(e.id,{colour:n})),children:(0,B.jsx)(cf,{colour:n,children:`●`})},n))})]})}function kb(e){let t=/^(\d+)\.(\d+)\.0$/.exec(e);return t?t[2]===`0`?`v${t[1]}`:`v${t[1]}.${t[2]}`:`v${e}`}var Ab=[{id:`system`,label:`System`},{id:`light`,label:`Light`},{id:`dark`,label:`Dark`}],jb=`ledung.theme`;function Mb(e){return e===`light`||e===`dark`?e:`system`}function Nb(e){try{return Mb(e.getItem(jb))}catch{return`system`}}function Pb(e,t){try{t===`system`?e.removeItem(jb):e.setItem(jb,t)}catch{}}function Fb(e,t){t===`system`?e.removeAttribute(`data-theme`):e.setAttribute(`data-theme`,t)}var Ib={starting:`Ready`,idle:`Ready`,queued:`Waiting for a free place`,running:`Working`,waiting:`Needs your answer`,stopping:`Stopping`,ended:`Ended`};function Lb(e){return e.status===`starting`||e.paused&&e.status===`running`?`idle`:e.status}var Rb=`ledung.statusDot`;function zb(e){try{return e.getItem(Rb)!==`0`}catch{return!0}}function Bb(e,t){try{t?e.removeItem(Rb):e.setItem(Rb,`0`)}catch{}}function Vb(e,t){return e?{dot:!0,ended:!1}:{dot:!1,tooltip:Ib[t.status],ended:t.status===`ended`}}var Hb=new Set,Ub=zb(localStorage),Wb=e=>{Ub=e;for(let e of Hb)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.statusDot`||e.key===null)&&Wb(zb(localStorage))});var Gb=e=>(Hb.add(e),()=>{Hb.delete(e)}),Kb=()=>Ub;function qb(){return[(0,v.useSyncExternalStore)(Gb,Kb),e=>{Bb(localStorage,e),Wb(e)}]}var Jb=`ledung.compactSidebar`,Yb=[{step:1,label:`None`},{step:2,label:`Less padding, no time row`},{step:3,label:`Name + ship`},{step:4,label:`Tightest`}],Xb=e=>e===1||e===2||e===3||e===4?e:null;function Zb(e){try{return Xb(Number(e.getItem(`ledung.compactSidebar`)))??1}catch{return 1}}function Qb(e,t){try{t===1?e.removeItem(Jb):e.setItem(Jb,String(t))}catch{}}function $b(e){switch(e){case 1:return{time:!0,usage:!0,plusOnly:!1};case 2:return{time:!1,usage:!0,plusOnly:!1};case 3:return{time:!1,usage:!1,plusOnly:!0};case 4:return{time:!1,usage:!1,plusOnly:!0,shipMax:6}}}function ex(e,t,n,r){let i=[t??``,...e>1?[n,r]:[]].filter(Boolean);return i.length?i.join(`
103
- `):void 0}var tx=new Set,nx=Zb(localStorage),rx=e=>{nx=e;for(let e of tx)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.compactSidebar`||e.key===null)&&rx(Zb(localStorage))});var ix=e=>(tx.add(e),()=>{tx.delete(e)}),ax=()=>nx;function ox(){return[(0,v.useSyncExternalStore)(ix,ax),e=>{Qb(localStorage,e),rx(e)}]}var sx=`ledung.archivedLink`;function cx(e){try{return e.getItem(sx)!==`0`}catch{return!0}}function lx(e,t){try{t?e.removeItem(sx):e.setItem(sx,`0`)}catch{}}function ux(e,t,n){return e&&t>0&&!n}var dx=new Set,fx=cx(localStorage),px=e=>{fx=e;for(let e of dx)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.archivedLink`||e.key===null)&&px(cx(localStorage))});var mx=e=>(dx.add(e),()=>{dx.delete(e)}),hx=()=>fx;function gx(){return[(0,v.useSyncExternalStore)(mx,hx),e=>{lx(localStorage,e),px(e)}]}var _x=`ledung.installDismissed`,vx=(e,t)=>/Macintosh/.test(e)&&/Safari\//.test(e)&&!/Chrome|Chromium|CriOS|Edg|OPR|Firefox|FxiOS/.test(e)&&t<=1,yx=(e,t)=>/iPhone|iPad|iPod/.test(e)||/Macintosh/.test(e)&&t>1,bx=e=>/Chrome|Chromium|Edg\//.test(e);function xx(e){return e.standalone||e.installed?{kind:`none`}:e.framed?{kind:`none`,reason:`Install this computer's own page, opened in a tab of its own.`}:e.offer?{kind:`button`}:e.refused?{kind:`none`,reason:`Refused for now. Reload the page to be offered it again.`}:vx(e.userAgent,e.maxTouchPoints)?{kind:`dock`}:yx(e.userAgent,e.maxTouchPoints)?{kind:`none`,reason:`On an iPhone or iPad, use Share → Add to Home Screen in Safari.`}:e.secure?bx(e.userAgent)?{kind:`none`,reason:`The browser isn't offering to install this page: it is installed already, or not allowed here. The install icon in the address bar says which.`}:{kind:`none`,reason:`This browser can't install pages as apps; Edge, Chrome and Safari on macOS can.`}:{kind:`none`,reason:`Browsers offer installing only a page at 127.0.0.1 or over HTTPS; this one is plain http.`}}function Sx(e){try{return e.getItem(_x)===`1`}catch{return!1}}function Cx(e){try{e.setItem(_x,`1`)}catch{}}var wx=(e,t)=>!t&&e.kind!==`none`,Tx=matchMedia(`(display-mode: standalone)`),Ex=null,Dx=!1,Ox=!1,kx=Sx(localStorage),Ax=new Set,jx=()=>xx({standalone:Tx.matches||navigator.standalone===!0,installed:Dx,offer:Ex!==null,refused:Ox,framed:mb(),secure:window.isSecureContext,userAgent:navigator.userAgent,maxTouchPoints:navigator.maxTouchPoints??0}),Mx={install:jx(),notice:!1},Nx=()=>{let e=jx();Mx={install:e,notice:wx(e,kx)};for(let e of Ax)e()};Mx.notice=wx(Mx.install,kx),window.addEventListener(`beforeinstallprompt`,e=>{e.preventDefault(),Ex=e,Ox=!1,Nx()}),window.addEventListener(`appinstalled`,()=>{Dx=!0,Ex=null,Nx()}),Tx.addEventListener(`change`,Nx),window.addEventListener(`storage`,e=>{(e.key===`ledung.installDismissed`||e.key===null)&&(kx=Sx(localStorage),Nx())});var Px=e=>(Ax.add(e),()=>{Ax.delete(e)}),Fx=()=>Mx;async function Ix(){let e=Ex;e&&(Ex=null,await e.prompt(),(await e.userChoice).outcome===`accepted`?Dx=!0:Ox=!0,Nx())}var Lx=()=>{Cx(localStorage),kx=!0,Nx()};function Rx(){return{...(0,v.useSyncExternalStore)(Px,Fx),onInstall:Ix,onDismiss:Lx}}var zx=(0,B.jsxs)(B.Fragment,{children:[`In Safari, choose `,(0,B.jsx)(`b`,{children:`File → Add to Dock`}),`.`]});function Bx({app:e,run:t}){return(0,B.jsxs)(`div`,{className:`banner install`,children:[(0,B.jsxs)(`span`,{children:[`Ledung can run as an app, in a window of its own.`,e.install.kind===`dock`&&(0,B.jsxs)(B.Fragment,{children:[` `,zx]})]}),e.install.kind===`button`&&(0,B.jsx)(`button`,{className:`small primary`,onClick:()=>void t(e.onInstall),children:`Install as app`}),(0,B.jsx)(`button`,{className:`small`,onClick:e.onDismiss,children:`Not now`})]})}function Vx({run:e}){let t=Rx(),{install:n}=t;return n.kind===`none`&&!n.reason?null:(0,B.jsxs)(`section`,{children:[(0,B.jsxs)(`div`,{className:`settings-h`,children:[(0,B.jsx)(`h3`,{children:`App`}),(0,B.jsx)(qf,{kind:`browser`})]}),(0,B.jsx)(`p`,{className:`muted`,children:`Ledung in a window of its own, with its own icon, instead of a browser tab.`}),n.kind===`button`&&(0,B.jsx)(`button`,{className:`primary`,onClick:()=>void e(t.onInstall),children:`Install as app`}),n.kind===`dock`&&(0,B.jsx)(`p`,{children:zx}),n.kind===`none`&&(0,B.jsx)(`p`,{className:`muted`,children:n.reason})]})}function Hx(e,t){return!!e&&!t&&e.available&&!e.asked&&e.places.length>0&&!e.places.some(e=>e.present)}function Ux(e){let t=e.places.map(e=>e.label);return t.length>1?`${t.slice(0,-1).join(`, `)} and ${t[t.length-1]}`:t[0]??``}function Wx(e){return e.kind===`mac`?`Add a Ledung icon to ${Ux(e)}?`:`Add a Ledung icon to your ${Ux(e)}?`}var Gx={desktop:`on your Desktop`,"start-menu":`in the Start menu`,applications:`in Applications`};function Kx(e){let t=e.places.map(e=>Gx[e.id]??`in ${e.label}`);return`A Ledung icon ${t.length>1?`${t.slice(0,-1).join(`, `)} and ${t[t.length-1]}`:t[0]??``}.`}var qx=`It opens this page, and starts Ledung first if it isn't running.`,Jx=null,Yx=null,Xx=new Set,Zx=e=>{Jx=e;for(let e of Xx)e()};function Qx(){return Yx??=R.shortcuts().then(Zx,()=>Zx(null)),Yx}var $x=e=>(Xx.add(e),()=>{Xx.delete(e)});function eS(){return(0,v.useEffect)(()=>void Qx(),[]),{view:(0,v.useSyncExternalStore)($x,()=>Jx),act:async e=>Zx(await R.shortcutsAct(e))}}function tS({run:e}){let{view:t,act:n}=eS();return!t||!Hx(t,mb())?null:(0,B.jsxs)(`div`,{className:`banner install`,children:[(0,B.jsxs)(`span`,{children:[Wx(t),` `,qx]}),(0,B.jsx)(`button`,{className:`small primary`,onClick:()=>void e(()=>n(`add`)),children:`Yes`}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>void e(()=>n(`decline`)),children:`No`})]})}function nS({run:e}){let{view:t,act:n}=eS();if(!t)return null;let r=t.places.filter(e=>!e.present),i=t.places.filter(e=>e.present);return(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Shortcuts`}),t.available?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{className:`muted`,children:[Kx(t),` `,qx,` `,t.kind===`windows`?`Ledung then runs in a minimised window in the taskbar; closing that window stops it.`:`Ledung then runs in a Terminal window; closing it stops Ledung.`]}),(0,B.jsx)(`ul`,{className:`shortcut-places`,children:t.places.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`b`,{children:e.label}),` `,(0,B.jsx)(`span`,{className:`muted`,children:e.present?`added`:`not there`})]},e.id))}),(0,B.jsxs)(`div`,{className:`restart-confirm`,children:[r.length>0&&(0,B.jsx)(`button`,{className:`small primary`,onClick:()=>void e(()=>n(`add`)),children:`Add shortcuts`}),i.length>0&&(0,B.jsx)(`button`,{className:`small`,onClick:()=>void e(()=>n(`remove`)),children:`Remove`})]})]}):(0,B.jsx)(`p`,{className:`muted`,children:t.reason})]})}function rS(e){return!e||!e.email&&!e.organization?`not seen yet: shown after its first session starts`:[e.email,e.organization,e.plan].filter(Boolean).join(` · `)+(e.seenAt?` (seen ${$(e.seenAt)})`:``)}function iS(e){let t=z(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(null),c=t=>[...e.projects.filter(e=>e.account===t).map(e=>e.name),...e.choices.chats===t?[`chats`]:[]].join(`, `)||`no project`,l=t=>(0,B.jsxs)(`select`,{value:e.choices[t]??``,onChange:n=>void e.run(()=>R.setAccountChoices({[t]:n.target.value||null})),children:[(0,B.jsx)(`option`,{value:``,children:`default: this computer's own login`}),e.accounts.map(e=>(0,B.jsxs)(`option`,{value:e.name,children:[e.name,e.email?` (${e.email})`:``]},e.name))]});return(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Accounts`}),(0,B.jsxs)(`p`,{className:`muted`,children:[`Each project uses one account, for its manager and all its sessions; chats use the one chosen below. Ledung never moves work between accounts. Accounts can also be listed under `,(0,B.jsx)(`span`,{className:`mono`,children:`claudeAccounts`}),` in the config file (see ledung.config.example.json).`]}),e.configFileProblems.map(e=>(0,B.jsx)(`div`,{className:`banner`,children:e},e)),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`table`,{className:`plain`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Account`}),(0,B.jsx)(`th`,{children:`Logged in as`}),(0,B.jsx)(`th`,{children:`Used by`}),(0,B.jsx)(`th`,{})]})}),(0,B.jsxs)(`tbody`,{children:[(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:`default`}),(0,B.jsx)(`div`,{className:`muted`,children:`this computer's own Claude Code login`})]}),(0,B.jsx)(`td`,{children:rS(e.defaultIdentity)}),(0,B.jsx)(`td`,{children:c(null)}),(0,B.jsx)(`td`,{})]}),e.accounts.map(t=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`strong`,{children:t.name}),t.whatItIsFor&&(0,B.jsx)(`div`,{children:t.whatItIsFor}),t.inConfigFile&&(0,B.jsx)(`div`,{className:`muted`,children:`set in the config file: to remove it for good, take it out there too, or it comes back at the next start`}),(0,B.jsxs)(`div`,{className:`muted`,children:[`sign-in folder `,(0,B.jsx)(`span`,{className:`mono`,children:t.configDir})]}),(0,B.jsxs)(`div`,{className:`muted`,children:[`in containers `,(0,B.jsx)(`span`,{className:`mono`,children:t.containerDir??`~/.ledung-accounts/${t.name}`})]})]}),(0,B.jsx)(`td`,{children:rS(t)}),(0,B.jsx)(`td`,{children:c(t.name)}),(0,B.jsxs)(`td`,{className:`account-actions`,children:[(0,B.jsx)(`button`,{className:`small`,disabled:e.remote,title:e.remote?`Only on the computer Ledung runs on`:`Show ${t.configDir}`,onClick:()=>void e.run(()=>R.openAccountFolder(t.name)),children:`Open folder`}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>void e.run(()=>R.removeAccount(t.name)),children:`Remove`})]})]},t.name))]})]}),(0,B.jsxs)(`div`,{className:`form`,children:[(0,B.jsxs)(`label`,{children:[`Account for chats `,(0,B.jsx)(`span`,{className:`muted`,children:`(new chats run on it; a running chat keeps its account until it restarts)`}),l(`chats`)]}),(0,B.jsxs)(`label`,{children:[`Account for new projects `,(0,B.jsx)(`span`,{className:`muted`,children:`(chosen for you in Add project)`}),l(`newProjects`)]})]}),(0,B.jsx)(`h4`,{children:`Add an account`}),(0,B.jsxs)(`div`,{className:`form`,children:[(0,B.jsxs)(`label`,{children:[`Name `,(0,B.jsx)(`span`,{className:`muted`,children:`(e.g. personal, work)`}),(0,B.jsx)(`input`,{...t,value:n,onChange:e=>r(e.target.value),maxLength:32})]}),(0,B.jsxs)(`label`,{children:[`Sign-in folder in containers `,(0,B.jsx)(`span`,{className:`muted`,children:`(optional; default ~/.ledung-accounts/<name> in the container user's home, or a mounted folder so the sign-in survives a rebuild)`}),(0,B.jsx)(`input`,{...t,value:i,onChange:e=>a(e.target.value),className:`mono`,placeholder:`~/.ledung-accounts/name`})]}),(0,B.jsxs)(`p`,{className:`muted`,children:[`Ledung makes a folder for this account's Claude Code sign-in, and only that: conversations, memory, skills and settings stay the same for every account, so moving a project to another account changes only whose plan and limits it uses. After adding it, sign in once with Claude Code's own `,(0,B.jsx)(`span`,{className:`mono`,children:`/login`}),` as shown (for a container project, inside the container). Ledung never sees or keeps a sign-in token.`]}),(0,B.jsx)(`button`,{className:`primary`,disabled:!n.trim(),onClick:()=>void e.run(async()=>{s(await R.addAccount({name:n.trim(),...i.trim()?{containerDir:i.trim()}:{}})),a(``),r(``)}),children:`Add account`})]}),o&&(0,B.jsxs)(`div`,{className:`banner`,children:[`Added `,(0,B.jsx)(`strong`,{children:o.name}),`. Choose it in a project's settings (⚙ next to the project), or above for chats and new projects.`,` `,`Now sign in once. In PowerShell:`,(0,B.jsx)(`pre`,{className:`mono`,children:`$env:CLAUDE_SECURESTORAGE_CONFIG_DIR="${o.configDir}"; claude`}),`(on macOS or Linux: `,(0,B.jsxs)(`span`,{className:`mono`,children:[`CLAUDE_SECURESTORAGE_CONFIG_DIR="`,o.configDir,`" claude`]}),`), then type `,(0,B.jsx)(`span`,{className:`mono`,children:`/login`}),` and sign in with this account. For a container project, the same inside the container:`,(0,B.jsx)(`pre`,{className:`mono`,children:`docker exec -it <container> sh -c 'CLAUDE_SECURESTORAGE_CONFIG_DIR=${(o.containerDir??`~/.ledung-accounts/${o.name}`).replace(/^~\//,`$HOME/`)} exec claude'`})]})]})]})}var aS=4e3,oS=[`Ctrl`,`Alt`,`Shift`,`Cmd`],sS=/^(?:(?:Ctrl|Alt|Shift|Cmd)\+)+(?:[A-Z]|[0-9])$/;function cS(e){let t=/^(?:Key([A-Z])|Digit([0-9]))$/.exec(e.code);if(!t)return null;let n=[e.ctrlKey&&`Ctrl`,e.altKey&&`Alt`,e.shiftKey&&`Shift`,e.metaKey&&`Cmd`].filter(Boolean);return n.length?`${n.join(`+`)}+${t[1]??t[2]}`:null}function lS(e){if(!sS.test(e))return!1;let t=e.split(`+`).slice(0,-1);return t.every((e,n)=>n===0||oS.indexOf(e)>oS.indexOf(t[n-1]))}function uS(e,t){if(!t)return e;let n={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Cmd:`⌘`},r=e.split(`+`);return r.slice(0,-1).map(e=>n[e]??e).join(``)+r[r.length-1]}function dS(e,t,n){if(!lS(e))return{refused:`A keybind is Ctrl, Alt or Cmd with a letter or a digit.`};let r=new Set(e.split(`+`).slice(0,-1)),i=e.split(`+`).pop(),a=/^[0-9]$/.test(i),o=t.find(t=>t.key===e&&t.id!==n);return o?{refused:`“${o.name}” has this keybind.`}:!r.has(`Ctrl`)&&!r.has(`Alt`)&&!r.has(`Cmd`)?{refused:`Shift alone types; add Ctrl or Alt.`}:r.has(`Cmd`)?{refused:`Cmd keys belong to the browser and the Mac, and Windows has none.`}:r.has(`Ctrl`)&&r.has(`Alt`)?{refused:`Ctrl+Alt is AltGr on Windows, which types @, { and [ on many keyboards.`}:e===`Ctrl+O`?{refused:`Ctrl+O shows and hides tool calls in Ledung.`}:r.has(`Ctrl`)&&!a?{refused:`${e} is the browser's or the message box's (new tab, copy, find, developer tools…).`}:r.has(`Ctrl`)&&!r.has(`Shift`)?{warning:`On Windows and Linux ${e} switches browser tabs: there it does nothing.`}:r.has(`Alt`)&&!r.has(`Shift`)&&[`D`,`E`,`F`].includes(i)?{refused:`${e} opens the browser's menu or address bar on Windows.`}:r.has(`Alt`)?{warning:`On a Mac ⌥ types a character with this key (⌥2 is @ on a Swedish keyboard): the keybind takes it away there.${a&&!r.has(`Shift`)?` On Linux Alt+1–9 switch browser tabs.`:``}`}:null}function fS(e,t,n=3){let r=[];for(let i of`123456789`){let a=`Ctrl+Shift+${i}`;if(dS(a,e,t)||r.push(a),r.length===n)break}return r}function pS(e,t){return e.filter(e=>e.project===null||e.project===t)}var mS=[`issue`,`branch`,`pr`,`project`,`session`];function hS(e,t){let n=t.branch?/(?:^|[/_-])(\d+)(?=$|[/_-])/.exec(t.branch)?.[1]:void 0,r={issue:t.tickets[0]?.id??(n?`#${n}`:void 0),branch:t.branch??void 0,pr:t.pr?`#${t.pr.number}`:void 0,project:S(t.project),session:t.title},i=[];return{text:e.replace(/\{(issue|branch|pr|project|session)\}/g,(e,t)=>{let n=r[t];return n===void 0?(i.includes(t)||i.push(t),e):n}),missing:i}}function gS(e,t,n){return!(n?!e.send:e.send)||t.missing.length||t.text.trimStart().startsWith(`!`)?`insert`:`send`}function _S(e,t,n){let r=e.slice(),[i]=r.splice(t,1);return r.splice(n,0,i),r}function vS(e){if(e.length>50)return`At most 50 macros.`;let t=new Set,n=new Map;for(let r of e){if(!/^[a-z0-9-]{1,40}$/.test(r.id)||t.has(r.id))return`A macro has no id of its own.`;t.add(r.id);let e=r.name.trim();if(!e||e.length>40)return`A macro's name is 1 to 40 characters.`;if(!r.text.trim()||r.text.length>4e3)return`“${e}”: the text is 1 to ${aS} characters.`;if(!r.chip&&!r.key)return`“${e}” has neither a chip nor a keybind, so nothing could use it.`;if(r.key!==null){let t=dS(r.key,[],null);if(t&&`refused`in t)return`“${e}”: ${t.refused}`;let i=n.get(r.key);if(i)return`“${e}” and “${i}” have the same keybind.`;n.set(r.key,e)}}return null}var yS=()=>typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent);function bS(e,t){let n=e.send?`Sends`:`Puts in the message box`,r=e.key?` · ${uS(e.key,t)}`:``;return`${n}: ${e.text}${r}\nShift+click: ${e.send?`put it in the message box`:`send it`}`}function xS(e){let t=e.macros.filter(e=>e.chip),n=e.macros.filter(e=>!e.chip),r=(0,v.useRef)(null),i=(0,v.useRef)(null),[a,o]=(0,v.useState)(t.length),[s,c]=(0,v.useState)(!1),l=yS();if((0,v.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=()=>{let t=[...e.children],n=t[0]?.offsetTop??0;o(t.filter(e=>e.offsetTop===n).length)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t.map(e=>e.id+e.name).join(`|`)]),(0,v.useEffect)(()=>{if(!s)return;let e=e=>{(e instanceof KeyboardEvent?e.key===`Escape`:!i.current?.contains(e.target))&&c(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,e)}},[s]),!e.macros.length)return null;let u=[...t.slice(a),...n],d=(t,n)=>{c(!1),e.onUse(t,n)};return(0,B.jsxs)(`span`,{className:`macro-bar`,ref:i,children:[(0,B.jsx)(`span`,{className:`macro-chips`,ref:r,children:t.map((e,t)=>(0,B.jsxs)(`button`,{className:`board-chip macro-chip`,title:bS(e,l),tabIndex:t<a?0:-1,"aria-hidden":t<a?void 0:!0,onClick:t=>d(e,t.shiftKey),children:[e.name,e.send&&(0,B.jsx)(`span`,{className:`macro-send`,"aria-label":`sends`,children:` ↵`})]},e.id))}),(0,B.jsx)(`button`,{className:`board-chip macro-chip macro-more${s?` on`:``}`,"aria-expanded":s,"aria-haspopup":`menu`,title:u.length?`${u.length} more macro${u.length===1?``:`s`}`:`Edit macros`,onClick:()=>c(e=>!e),children:u.length?`+${u.length}`:`+`}),s&&(0,B.jsxs)(`div`,{className:`macro-menu`,role:`menu`,children:[u.map(e=>(0,B.jsxs)(`button`,{role:`menuitem`,title:bS(e,l),onClick:t=>d(e,t.shiftKey),children:[(0,B.jsxs)(`span`,{children:[e.name,e.send&&(0,B.jsx)(`span`,{className:`macro-send`,children:` ↵`})]}),e.key?(0,B.jsx)(`kbd`,{children:uS(e.key,l)}):(0,B.jsx)(`span`,{})]},e.id)),u.length>0&&(0,B.jsx)(`hr`,{}),(0,B.jsx)(`button`,{role:`menuitem`,className:`muted`,onClick:()=>{c(!1),e.onEdit()},children:`Edit macros…`})]})]})}var SS=()=>`m-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`,CS=(e,t)=>e!==null&&e!==`~chats`&&!t.some(t=>t.name===e),wS=(e,t)=>e===null?`Global`:`${S(e)}${CS(e,t)?` (removed)`:``}`;function TS(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),a=yS(),o=t=>e.run(()=>R.setMacros(t)),s=t&&e.macros.some(e=>e.id===t.id)?t.id:null;return(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`div`,{className:`settings-h`,children:(0,B.jsx)(`h3`,{children:`Macros`})}),(0,B.jsx)(`p`,{className:`muted`,children:`Text you send often, as a chip in a session's info bar, a keybind, or both. Kept by Ledung, so your phone and other browsers have them too.`}),e.macros.length>0&&(0,B.jsx)(`ul`,{className:`macro-list`,children:e.macros.map((t,c)=>(0,B.jsxs)(`li`,{className:`${t.id===s?`on`:``}${r===c?` dragged`:``}`,draggable:!0,onDragStart:()=>i(c),onDragEnd:()=>i(null),onDragOver:e=>e.preventDefault(),onDrop:t=>{t.preventDefault(),r!==null&&r!==c&&o(_S(e.macros,r,c)),i(null)},children:[t.chip?(0,B.jsxs)(`span`,{className:`board-chip macro-chip static`,children:[t.name,t.send&&(0,B.jsx)(`span`,{className:`macro-send`,children:` ↵`})]}):(0,B.jsxs)(`span`,{className:`macro-keyonly`,title:`No chip: this one is on its keybind only`,children:[t.name,t.send&&(0,B.jsx)(`span`,{className:`macro-send`,children:` ↵`}),` `,(0,B.jsx)(`span`,{className:`muted`,children:`· keybind only`})]}),(0,B.jsx)(`span`,{className:`mono macro-text`,title:t.text,children:t.text}),(0,B.jsx)(`span`,{className:`muted macro-what`,children:t.send?`Sends`:`Inserts`}),t.key?(0,B.jsx)(`kbd`,{children:uS(t.key,a)}):(0,B.jsx)(`span`,{className:`muted macro-nokey`,children:`no key`}),(0,B.jsx)(`span`,{className:`chip macro-scope`,title:wS(t.project,e.projects),children:wS(t.project,e.projects)}),(0,B.jsx)(`span`,{className:`macro-move`,title:`Drag to reorder`,"aria-hidden":!0,children:`⋮⋮`}),(0,B.jsxs)(`span`,{className:`macro-row-buttons`,children:[c>0&&(0,B.jsx)(`button`,{className:`small macro-up`,title:`Move up`,"aria-label":`Move ${t.name} up`,onClick:()=>void o(_S(e.macros,c,c-1)),children:`↑`}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>n({...t}),children:`Edit`})]})]},t.id))}),t?(0,B.jsx)(ES,{draft:t,macros:e.macros,projects:e.projects,mac:a,isNew:!s,onCancel:()=>n(null),onSave:async t=>{let r=s?e.macros.map(e=>e.id===t.id?t:e):[...e.macros,t];await o(r),n(null)},onDelete:s?async()=>{await o(e.macros.filter(e=>e.id!==t.id)),n(null)}:void 0},t.id):(0,B.jsx)(`button`,{className:`primary`,onClick:()=>n({id:SS(),name:``,text:``,send:!1,key:null,chip:!0,project:null}),children:`Add macro`})]})}function ES(e){let[t,n]=(0,v.useState)(e.draft),[r,i]=(0,v.useState)(e.draft.key!==null),[a,o]=(0,v.useState)(!1),s=z(),c=e=>n(t=>({...t,...e})),l=r?t.key:null,u=l?dS(l,e.macros,t.id):null,d={...t,key:l},f=vS([d]),p=fS(e.macros,t.id),m=!t.name.trim()||!t.text.trim()||r&&!t.key||!!u&&`refused`in u||!!f;return(0,B.jsxs)(`div`,{className:`form macro-form`,children:[(0,B.jsx)(`h4`,{children:e.isNew?`New macro`:`Edit “${e.draft.name}”`}),(0,B.jsxs)(`label`,{children:[`Name`,(0,B.jsx)(`input`,{...s,value:t.name,maxLength:40,placeholder:`Run checks`,onChange:e=>c({name:e.target.value})})]}),(0,B.jsxs)(`label`,{children:[`Text`,(0,B.jsx)(`textarea`,{...s,rows:3,value:t.text,placeholder:`Run the checks and tell me what fails.`,onChange:e=>c({text:e.target.value})}),(0,B.jsxs)(`span`,{className:`muted macro-hint`,children:[`Placeholders: `,mS.map(e=>(0,B.jsxs)(`code`,{children:[`{${e}}`,` `]},e)),`filled from the session. One it has no value for is not sent: the text goes into the message box instead.`]})]}),(0,B.jsxs)(`div`,{className:`field`,children:[(0,B.jsx)(`span`,{children:`When used`}),(0,B.jsxs)(`span`,{className:`segmented macro-seg`,children:[(0,B.jsx)(`button`,{className:`small${t.send?``:` on`}`,"aria-pressed":!t.send,onClick:()=>c({send:!1}),children:`Put it in the message box`}),(0,B.jsx)(`button`,{className:`small${t.send?` on`:``}`,"aria-pressed":t.send,onClick:()=>c({send:!0}),children:`Send it at once`})]}),(0,B.jsx)(`span`,{className:`muted macro-hint`,children:`Shift+click a chip for the other one. A text starting with ! always goes into the box.`})]}),(0,B.jsxs)(`label`,{children:[`Where`,(0,B.jsxs)(`select`,{value:t.project??``,onChange:e=>c({project:e.target.value||null}),children:[(0,B.jsx)(`option`,{value:``,children:`Global (every project)`}),e.projects.map(e=>(0,B.jsx)(`option`,{value:e.name,children:e.name},e.name)),CS(e.draft.project,e.projects)&&(0,B.jsx)(`option`,{value:e.draft.project,children:wS(e.draft.project,e.projects)}),(0,B.jsx)(`option`,{value:x,children:`Chats`})]})]}),(0,B.jsxs)(`label`,{className:`toggle macro-switch`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:t.chip,onChange:e=>c({chip:e.target.checked})}),` Show as a chip in the info bar`]}),(0,B.jsxs)(`label`,{className:`toggle macro-switch`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>{i(e.target.checked),e.target.checked&&!t.key&&c({key:p[0]??null})}}),` Keybind`]}),r&&(0,B.jsxs)(`div`,{className:`macro-sub`,children:[(0,B.jsxs)(`span`,{className:`macro-keyrow`,children:[(0,B.jsx)(`input`,{...s,className:`mono macro-keyin${u&&`refused`in u?` bad`:``}`,readOnly:!0,"aria-label":`Keybind`,value:a?`Press the keys…`:t.key?uS(t.key,e.mac):``,onFocus:()=>o(!0),onBlur:()=>o(!1),onKeyDown:e=>{if(e.key===`Tab`||e.key===`Escape`)return;e.preventDefault();let t=cS(e.nativeEvent);t&&(c({key:t}),e.target.blur())}}),(0,B.jsx)(`span`,{className:`muted macro-hint`,children:a?`Ctrl, Alt or Cmd with a letter or a digit`:`Click the box, then press the keys.`})]}),u&&`refused`in u&&(0,B.jsx)(`span`,{className:`macro-conflict`,role:`alert`,children:u.refused}),u&&`warning`in u&&(0,B.jsx)(`span`,{className:`macro-warning`,children:u.warning}),u&&p.length>0&&(0,B.jsxs)(`span`,{className:`macro-hint`,children:[`Free: `,p.map(t=>(0,B.jsx)(`button`,{className:`link macro-free`,onClick:()=>c({key:t}),children:(0,B.jsx)(`kbd`,{children:uS(t,e.mac)})},t))]}),!u&&(0,B.jsx)(`span`,{className:`muted macro-hint`,children:`Works in the message box too. A phone has no keys: there it is in the info bar's + menu.`})]}),!t.chip&&!r&&(0,B.jsx)(`span`,{className:`macro-conflict`,children:`With neither a chip nor a keybind nothing could use it.`}),(0,B.jsxs)(`div`,{className:`macro-keyrow`,children:[(0,B.jsx)(`button`,{className:`primary`,disabled:m,onClick:()=>void e.onSave(d),children:`Save`}),(0,B.jsx)(`button`,{onClick:e.onCancel,children:`Cancel`}),e.onDelete&&(0,B.jsx)(`button`,{className:`deny macro-delete`,onClick:()=>void e.onDelete(),children:`Delete`})]})]})}function DS(e){let t=Ff(Qf),n=gf(e.view,t),r={update:Df(e.update.view),remote:Tf(e.remote),notifications:e.notify.possible&&!e.notify.on&&!mb()?`off`:``};return(0,B.jsx)(Jf,{groups:ff,current:n,words:r,narrow:t,onOpen:t=>e.onOpen(t===null?`settings`:Z(t)),children:n!==null&&(0,B.jsx)(OS,{group:n,...e})})}function OS(e){switch(e.group){case`update`:{let t=Ef(e.update.view);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Update Ledung`}),t.update&&(0,B.jsx)(`p`,{className:`muted`,children:t.update}),(0,B.jsx)(BS,{update:e.update})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Restart Ledung`}),(0,B.jsx)(`p`,{className:`muted`,children:t.restart}),!!e.config?.restartFor.length&&(0,B.jsx)(`p`,{className:`config-restart`,children:AS(e.config)}),e.canRestart?(0,B.jsx)(Kf,{hellos:e.hellos}):(0,B.jsx)(`span`,{className:`muted`,title:`This Ledung was started by an older launcher. Restart it once from its console window (Ctrl+C, then Ledung.cmd).`,children:`Restart: from console`})]}),(0,B.jsx)(nS,{run:e.run})]})}case`claude`:return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(iS,{accounts:e.accounts,choices:e.accountChoices,defaultIdentity:e.defaultIdentity,configFileProblems:e.accountProblems,projects:e.projects,run:e.run,remote:e.throughPublicName}),(0,B.jsx)(wv,{accounts:e.accounts,usageStops:e.usageStops,run:e.run}),(0,B.jsx)(yy,{sessions:e.sessions}),(0,B.jsx)(Dd,{accounts:e.accounts,run:e.run})]});case`sessions`:return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(af,{run:e.run}),(0,B.jsx)(py,{})]});case`macros`:return(0,B.jsx)(TS,{macros:e.macros,projects:e.projects,run:e.run});case`remote`:return(0,B.jsx)(kS,{...e});case`look`:return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{children:[(0,B.jsxs)(`div`,{className:`settings-h`,children:[(0,B.jsx)(`h3`,{children:`Appearance`}),(0,B.jsx)(qf,{kind:`browser`})]}),(0,B.jsx)(LS,{})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsxs)(`div`,{className:`settings-h`,children:[(0,B.jsx)(`h3`,{children:`Typing`}),(0,B.jsx)(qf,{kind:`browser`})]}),(0,B.jsx)(NS,{})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsxs)(`div`,{className:`settings-h`,children:[(0,B.jsx)(`h3`,{children:`Sidebar`}),(0,B.jsx)(qf,{kind:`browser`})]}),(0,B.jsx)(PS,{}),(0,B.jsx)(FS,{}),(0,B.jsx)(IS,{})]}),(0,B.jsx)(Vx,{run:e.run})]});case`notifications`:return(0,B.jsxs)(`section`,{children:[(0,B.jsxs)(`div`,{className:`settings-h`,children:[(0,B.jsx)(`h3`,{children:`Notifications`}),(0,B.jsx)(qf,{kind:`browser`})]}),(0,B.jsx)(MS,{notify:e.notify,linked:e.computers.some(e=>e.linked)})]});case`config`:return e.config?(0,B.jsx)(jS,{config:e.config}):(0,B.jsx)(`p`,{className:`muted`,children:`…`});default:return(0,B.jsx)(US,{source:e.source})}}function kS(e){let[t,n]=(0,v.useState)(void 0),[r,i]=(0,v.useState)(null);(0,v.useEffect)(()=>{R.relayAdmin().then(n,()=>n(null))},[]);let a=wf({remote:e.remote,relaySetUp:t?W_(t):null,boardConfigured:!!e.board?.configured}),o=t&&(0,B.jsx)(U_,{view:t,onView:n,run:e.run,newComputers:e.newComputers}),s=e.projects[0]?.name,c=[{id:`remote`,name:`Remote access`,state:a.remote,why:`Reach this Ledung from your phone, anywhere, through a relay.`,form:(0,B.jsx)(VS,{remote:e.remote}),primary:!0},{id:`phones`,name:`Phones`,state:a.phones,why:``},{id:`linked`,name:`Linked computers`,state:a.linked,why:``},{id:`relay`,name:`Run a relay`,state:a.relay,why:`Only if you host a relay for other people.`,form:o},{id:`board`,name:`Message board`,state:a.board,why:s?`Off in every project; turn it on in a project's tab.`:`Off; each project turns it on in its own tab.`,go:s?{label:`Projects ›`,view:bf(s,`board`)}:void 0}].filter(e=>e.state===`off`||e.state===`needs`);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Db,{computers:e.computers,run:e.run}),a.remote===`on`&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Remote access`}),(0,B.jsx)(VS,{remote:e.remote})]}),a.phones===`on`&&(0,B.jsx)(yb,{run:e.run,linked:e.computers.some(e=>e.linked)},e.remote?.publicName??`none`),a.linked===`on`&&(0,B.jsx)(Eb,{run:e.run},`linked-${e.remote?.publicName??`none`}-${e.remote?.tls??``}`),a.relay===`on`&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Relay`}),o]}),a.board===`on`&&(0,B.jsx)(gt,{board:e.board}),c.length>0&&(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`Not set up`}),c.map(t=>r===t.id&&t.state===`off`&&t.form?(0,B.jsxs)(`div`,{className:`offline-open`,role:`group`,"aria-label":t.name,children:[(0,B.jsxs)(`h4`,{children:[(0,B.jsx)(`span`,{children:t.name}),(0,B.jsx)(`button`,{className:`small`,"aria-label":`Close ${t.name}`,title:`Close`,onClick:()=>i(null),children:`✕`})]}),t.form]},t.id):(0,B.jsxs)(`div`,{className:`offline${t.state===`needs`?` needs`:``}`,children:[(0,B.jsx)(`span`,{className:`offline-name`,children:t.name}),(0,B.jsx)(`span`,{className:`offline-why`,children:t.state===`needs`?`Needs remote access first.`:t.why}),t.state===`off`&&t.form&&(0,B.jsx)(`button`,{className:`small${t.primary?` primary`:``}`,onClick:()=>i(t.id),children:`Set up ›`}),t.state===`off`&&t.go&&(0,B.jsx)(`button`,{className:`small`,onClick:()=>e.onOpen(t.go.view),children:t.go.label})]},t.id))]})]})}function AS(e){return`Restart Ledung to apply: ${e.restartFor.join(`, `)}`}function jS(e){let t=e.config,n=new Date(t.readAt).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`});return(0,B.jsxs)(`section`,{children:[(0,B.jsxs)(`div`,{className:`settings-h`,children:[(0,B.jsx)(`h3`,{children:`Config file`}),(0,B.jsx)(qf,{kind:`config`})]}),(0,B.jsxs)(`p`,{className:`muted`,children:[`Ledung reads `,(0,B.jsx)(`code`,{children:t.file}),` again whenever it changes. Most settings apply at once, to new and resumed sessions; running sessions keep what they started with. A few, such as the port and the network, need Restart Ledung.`]}),(0,B.jsx)(`p`,{children:t.reloaded?`Last reloaded ${n}.`:`Read at start, ${n}; not changed since.`}),t.problem&&(0,B.jsxs)(`p`,{className:`config-problem`,role:`alert`,children:[`The last change was not applied, the settings in use stay: `,t.problem]}),!!t.restartFor.length&&(0,B.jsx)(`p`,{className:`config-restart`,children:AS(t)})]})}function MS({notify:e,linked:t}){return mb()?(0,B.jsx)(Sb,{linked:t}):e.possible?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{className:`toggle`,title:`A browser notification when something new needs your answer and this page is in the background`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e.on,onChange:t=>void e.set(t.target.checked)}),` Send notifications when an agent is waiting for you`]}),(0,B.jsx)(`p`,{className:`muted`,children:`While a Ledung page is open in this browser.`}),e.denied&&(0,B.jsx)(`p`,{className:`muted`,children:`The browser blocks notifications for this page. Allow them in the browser's site settings (the icon left of the address), then switch this on again.`})]}):(0,B.jsx)(`p`,{className:`muted`,children:`Notifications work when this page is opened on this computer at 127.0.0.1.`})}function NS(){let[e,t]=ct();return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{className:`toggle`,title:`Off: the browser doesn't correct words as you type. Spell checking and automatic capitals are left to the browser either way`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` Autocorrect`]}),(0,B.jsx)(`p`,{className:`muted`,children:`Off: words stay as you type them in the message box, answers and every other text field. Spell checking and capitals are the browser's own either way.`})]})}function PS(){let[e,t]=qb();return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{className:`toggle`,title:`The coloured dot left of each session in the sidebar; the ship shows much the same`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` Status dot`]}),(0,B.jsx)(`p`,{className:`muted`,children:`Off: no dot on the session rows; hover a row for its status, and an ended session's name is faded.`})]})}function FS(){let[e,t]=gx();return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{className:`toggle`,title:`The Archived (N) entry under each project in the sidebar, which opens its archived sessions`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` Show "Archived" in the sidebar`]}),(0,B.jsx)(`p`,{className:`muted`,children:`Off: no Archived entry under the projects; switch it back on to open their archived sessions.`})]})}function IS(){let[e,t]=ox(),n=Yb.find(t=>t.step===e).label;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{className:`compact-slider`,title:`Less padding and fewer rows on each session in the sidebar; the ship always stays`,children:[(0,B.jsx)(`span`,{children:`Compact sidebar`}),(0,B.jsx)(dy,{step:e,labels:Yb.map(e=>e.label),onPick:e=>t(e),children:(0,B.jsx)(`input`,{type:`range`,min:1,max:Yb.length,step:1,value:e,list:`compact-steps`,"aria-valuetext":n,onChange:e=>t(Number(e.target.value))})})]}),(0,B.jsx)(`datalist`,{id:`compact-steps`,children:Yb.map(e=>(0,B.jsx)(`option`,{value:e.step,label:e.label},e.step))}),(0,B.jsx)(`p`,{className:`muted`,children:`Each step takes more off the session cards: tighter padding and no date and time, then only the name, the ship and the badge, with a small "+" for a new session. Hover a card for what it no longer shows.`})]})}function LS(){let[e,t]=(0,v.useState)(()=>Nb(localStorage)),n=e=>{t(e),Pb(localStorage,e),Fb(document.documentElement,e)};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`seg-control`,role:`group`,"aria-label":`Colour scheme`,children:Ab.map(t=>(0,B.jsx)(`button`,{className:e===t.id?`on`:``,"aria-pressed":e===t.id,onClick:()=>n(t.id),children:t.label},t.id))}),(0,B.jsx)(`p`,{className:`muted`,children:`System follows the computer's light or dark setting.`})]})}var RS=e=>e?e.slice(0,7):`unknown commit`,zS={waiting:`○`,running:`…`,done:`✓`,failed:`✗`};function BS({update:e}){let{view:t,error:n,act:r}=e,[i,a]=(0,v.useState)(!1);if(n)return(0,B.jsx)(`p`,{className:`restart-problem`,children:n});if(!t)return(0,B.jsx)(`p`,{className:`muted`,children:`…`});if(t.npm)return(0,B.jsxs)(`div`,{className:`update-panel`,children:[(0,B.jsxs)(`p`,{className:`muted`,children:[`Running Ledung `,(0,B.jsx)(`code`,{children:kb(t.npm.version)}),`, installed from npm.`]}),(0,B.jsx)(`p`,{className:`muted`,children:t.reason})]});if(!t.available)return(0,B.jsx)(`p`,{className:`muted`,children:t.reason});let o=t.checking||t.updating||t.restarting,s=t.check,c=!!s&&!s.upToDate&&!t.updating&&!t.restarting;return(0,B.jsxs)(`div`,{className:`update-panel`,children:[(0,B.jsxs)(`p`,{className:`muted`,children:[`Running `,t.running?.commit?(0,B.jsx)(`code`,{children:RS(t.running.commit)}):`an unknown commit (its source is not a git clone)`,`, built from `,(0,B.jsx)(`code`,{children:t.running?.source}),`.`]}),(0,B.jsxs)(`div`,{className:`restart-confirm`,children:[(0,B.jsx)(`button`,{className:`small`,disabled:o,onClick:()=>{a(!1),r(R.updateCheck)},children:t.checking?`Checking…`:`Check for updates`}),s&&!t.checking&&(s.upToDate?(0,B.jsxs)(`span`,{className:`update-ok`,children:[`Up to date (`,RS(s.latest),`)`]}):(0,B.jsxs)(`span`,{children:[s.behind,` new change`,s.behind===1?``:`s`,` on main (`,RS(s.latest),`)`,s.commitKnown?``:`, counted from the source folder`]}))]}),t.checkError&&(0,B.jsx)(`pre`,{className:`update-output restart-problem`,children:t.checkError}),s&&!s.upToDate&&s.changes.length>0&&(0,B.jsx)(`ul`,{className:`update-changes`,children:s.changes.map((e,t)=>(0,B.jsx)(`li`,{children:e},t))}),c&&!t.canRestart&&(0,B.jsx)(`p`,{className:`muted`,children:`Updating ends in a restart, and this Ledung was started by an older launcher. Restart it once from its console window first.`}),c&&t.canRestart&&(i?(0,B.jsxs)(`div`,{className:`restart-confirm`,children:[(0,B.jsx)(`span`,{className:`muted`,children:`Pull main, npm install, npm run release, then restart. Sessions keep running.`}),(0,B.jsx)(`button`,{className:`small primary`,onClick:()=>{a(!1),r(R.update)},children:`Update now`}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>a(!1),children:`Cancel`})]}):(0,B.jsx)(`div`,{className:`restart-confirm`,children:(0,B.jsx)(`button`,{className:`small primary`,onClick:()=>a(!0),children:`Update Ledung`})})),t.steps.length>0&&(0,B.jsx)(`ol`,{className:`update-steps`,children:t.steps.map(e=>(0,B.jsxs)(`li`,{className:`update-step ${e.state}`,children:[(0,B.jsx)(`span`,{className:`update-mark`,children:zS[e.state]}),` `,e.label,e.state===`failed`&&e.output&&(0,B.jsx)(`pre`,{className:`update-output`,children:e.output})]},e.label))}),t.refused&&(0,B.jsx)(`p`,{className:`restart-problem`,children:t.refused}),t.restarting&&(0,B.jsx)(`p`,{className:`muted`,children:`The new release is built. Restarting into it…`})]})}function VS(e){let t=by(e.remote);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`remote-state ${e.remote?.state??`off`}`,children:t.label}),t.detail&&(0,B.jsx)(`p`,{className:`muted`,children:t.detail}),e.remote?.tls&&(0,B.jsx)(`p`,{className:`remote-tls`,children:e.remote.tls}),e.remote?.certificate&&(0,B.jsx)(HS,{cert:e.remote.certificate}),(0,B.jsx)(H_,{remote:e.remote})]})}function HS({cert:e}){let t=Cy(e,Date.now()),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null);return(0,B.jsxs)(`div`,{className:`remote-certificate`,children:[(0,B.jsx)(`p`,{className:t.warn?`remote-tls`:`remote-state connected`,children:t.label}),t.detail&&(0,B.jsx)(`p`,{className:`muted`,children:t.detail}),t.copy&&e.accountUrl&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{className:`muted`,children:[`ACME account (`,e.acme,`): `,(0,B.jsx)(`code`,{children:e.accountUrl}),` `,(0,B.jsx)(yd,{text:e.accountUrl})]}),e.record&&(0,B.jsxs)(`p`,{className:`muted`,children:[`CAA record: `,(0,B.jsx)(`code`,{className:`remote-record`,children:e.record}),` `,(0,B.jsx)(yd,{text:e.record})]}),(0,B.jsx)(`div`,{className:`restart-confirm`,children:(0,B.jsx)(`button`,{className:`small`,disabled:n,onClick:()=>{r(!0),a(null),R.certificateCheck().catch(e=>a(e.message)).finally(()=>r(!1))},children:n?`Checking…`:`Check now`})})]}),i&&(0,B.jsx)(`p`,{className:`restart-problem`,children:i})]})}function US({source:e}){return(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{children:`About`}),(0,B.jsx)(`p`,{className:`muted`,children:`Ledung is free software under the GNU Affero General Public License, version 3, with an additional permission for Anthropic's software; a commercial license is also available.`}),(0,B.jsxs)(`p`,{className:`muted`,children:[`It runs Anthropic's Claude Agent SDK and Claude Code, installed from npm under `,(0,B.jsx)(`a`,{href:`https://code.claude.com/docs/en/legal-and-compliance`,target:`_blank`,rel:`noreferrer`,children:`Anthropic's own terms`}),`. They are not covered by Ledung's license.`]}),e&&(0,B.jsxs)(`p`,{className:`muted`,children:[`Running `,(0,B.jsx)(`code`,{children:e.version}),`. `,(0,B.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:`Source`})]})]})}var WS=(e,t)=>`bt:${e}#${t}`;function GS(e){let t=/^bt:([^#]+)#(.+)$/.exec(e??``);return t?{repo:t[1],id:t[2]}:null}var KS=(e,t)=>`#/board/${e}/${encodeURIComponent(t)}`;function qS(e){let t=/^#\/board\/([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)\/([^/]+)$/.exec(e);if(!t)return null;try{return{repo:t[1],id:decodeURIComponent(t[2])}}catch{return null}}function JS(e,t){return e.mine?`this Ledung's manager of project ${e.fromProject??`unknown`}`:e.viaLedung?`@${e.author}'s Ledung${e.fromProject?`, project ${e.fromProject}`:``}`:`typed on ${t} by @${e.author}`}function YS(e){let t=e.deliveries.map(t=>{switch(t.kind){case`wake`:return{text:`woke ${t.project}`,level:`ok`,project:t.project};case`quiet`:return{text:`quiet to ${t.project}`,level:`quiet`,project:t.project};case`channel`:return{text:`channel, ${t.project}`,level:`quiet`,project:t.project};case`ignored`:return{text:`not delivered to ${t.project}: its allowlist does not name @${e.author}`,level:`warn`,project:t.project}}});return t.length?t:e.status===`sent`?[{text:`sent from this Ledung`,level:`none`}]:e.status===`ignored`?[{text:`not delivered: no project here allows @${e.author}; only the id was kept, not the text`,level:`warn`}]:e.status===`quiet`?[{text:`not delivered: it reached no manager (no front desk, or the project's board is off)`,level:`warn`}]:[{text:`not for this Ledung`,level:`none`}]}var XS={project:``,repo:``,unreadOnly:!1,notDelivered:!1},ZS=e=>e.dropped+e.refused+e.unsent>0,QS=(e,t=``)=>t?e.unread[t]??0:Object.values(e.unread).reduce((e,t)=>e+t,0);function $S(e,t){return e.filter(e=>(!t.repo||e.repo===t.repo)&&(!t.project||e.projects.includes(t.project))&&(!t.unreadOnly||QS(e,t.project)>0)&&(!t.notDelivered||ZS(e)))}var eC=e=>e&&/^https:\/\//.test(e)?e:null;function tC(e,t){let[n,r]=(0,v.useState)({data:null,error:null});return(0,v.useEffect)(()=>{let t=!0;return e().then(e=>t&&r({data:e,error:null}),e=>t&&r(t=>({data:t.data,error:e.message}))),()=>{t=!1}},t),n}var nC=XS,rC=e=>e.length>4?`${e.slice(0,4).join(`, `)} +${e.length-4}`:e.join(`, `);function iC(e){let{data:t,error:n}=tC(()=>R.boardThreads(),[e.board]),[r,i]=(0,v.useState)(nC),a=e=>i(t=>nC={...t,...e}),o=(0,v.useMemo)(()=>Object.keys(e.board?.projects??{}).filter(t=>e.board.projects[t].repo).sort(),[e.board]),s=(e.board?.boards??[]).map(e=>e.repo),c=(0,v.useMemo)(()=>$S(t?.threads??[],r),[t,r]),l=r.project||r.repo||r.unreadOnly||r.notDelivered;return(0,B.jsxs)(`div`,{className:`waiting-view board-view`,children:[(0,B.jsxs)(`header`,{className:`session-head`,children:[(0,B.jsxs)(`div`,{className:`session-head-text`,children:[(0,B.jsx)(`h2`,{children:`Board`}),(0,B.jsx)(`div`,{className:`muted`,children:`Read-only. The managers' messages with other people's Ledungs, newest first. Looking here posts nothing and marks nothing read.`})]}),(0,B.jsx)(`div`,{className:`session-corner`,children:(0,B.jsx)(`button`,{className:`small`,onClick:e.onOpenSettings,children:`Board settings`})})]}),(0,B.jsxs)(`div`,{className:`board-filters`,role:`group`,"aria-label":`Filter threads`,children:[o.length>1&&(0,B.jsxs)(`label`,{children:[`Project`,(0,B.jsxs)(`select`,{value:r.project,onChange:e=>a({project:e.target.value}),children:[(0,B.jsx)(`option`,{value:``,children:`All projects`}),o.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]})]}),s.length>1&&(0,B.jsxs)(`label`,{children:[`Board`,(0,B.jsxs)(`select`,{value:r.repo,onChange:e=>a({repo:e.target.value}),children:[(0,B.jsx)(`option`,{value:``,children:`All boards`}),s.map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]})]}),(0,B.jsxs)(`label`,{className:`toggle`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:r.unreadOnly,onChange:e=>a({unreadOnly:e.target.checked})}),` Unread only`]}),(0,B.jsxs)(`label`,{className:`toggle`,title:`Threads with a post that reached no manager: dropped (sender not allowed), refused by a project's allowlist, or for nobody's inbox`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:r.notDelivered,onChange:e=>a({notDelivered:e.target.checked})}),` Not delivered`]}),l&&(0,B.jsx)(`button`,{className:`small`,onClick:()=>{nC=XS,i(XS)},children:`Clear filters`})]}),(0,B.jsxs)(`div`,{className:`waiting-list board-list`,children:[n&&(0,B.jsx)(`p`,{className:`board-error`,children:n}),!t&&!n&&(0,B.jsx)(`p`,{className:`muted`,children:`Reading the board…`}),t&&c.length===0&&(0,B.jsx)(`p`,{className:`muted`,children:l?`No thread matches these filters.`:`No threads yet. Posts from the board appear here once Ledung has seen them.`}),c.map(t=>(0,B.jsx)(aC,{t,filters:r,onOpen:e.onOpen,showRepo:s.length>1},`${t.repo}#${t.id}`)),t?.truncated&&(0,B.jsxs)(`p`,{className:`muted`,children:[`Only the `,t.threads.length,` most recent threads are listed.`]})]})]})}function aC({t:e,filters:t,onOpen:n,showRepo:r}){let i=QS(e,t.project),a=[e.dropped?`${e.dropped} dropped (sender not allowed)`:``,e.refused?`${e.refused} refused by a project's allowlist`:``,e.unsent?`${e.unsent} reached no manager`:``].filter(Boolean),o=e.last,s=o?o.mine?`${o.fromProject??`this Ledung`}`:o.viaLedung?`@${o.author}'s Ledung`:`@${o.author}`:``;return(0,B.jsxs)(`button`,{className:`board-thread-card${i?` unread`:``}`,onClick:()=>n(WS(e.repo,e.id)),children:[(0,B.jsxs)(`span`,{className:`board-thread-top`,children:[(0,B.jsxs)(`span`,{className:`board-thread-title`,children:[i>0&&(0,B.jsx)(`span`,{className:`unread-dot`,"aria-label":`unread`}),e.onlyDropped?`Thread ${e.id} (dropped posts only)`:e.title]}),(0,B.jsx)(`span`,{className:`muted board-thread-time`,children:$(e.updatedAt)})]}),(0,B.jsxs)(`span`,{className:`board-thread-meta muted`,children:[(0,B.jsx)(`span`,{className:`mono`,children:r?`${e.repo} #${e.id}`:`#${e.id}`}),e.participants.length>0&&(0,B.jsxs)(B.Fragment,{children:[` · `,rC(e.participants)]})]}),(0,B.jsxs)(`span`,{className:`board-thread-chips`,children:[i>0&&(0,B.jsxs)(`span`,{className:`chip accent`,children:[i,` unread`]}),e.projects.map(e=>(0,B.jsx)(`span`,{className:`chip`,children:e},e)),a.map(e=>(0,B.jsx)(`span`,{className:`chip warn`,children:e},e))]}),o&&(0,B.jsxs)(`span`,{className:`board-thread-last`,children:[(0,B.jsxs)(`strong`,{children:[s,`:`]}),` `,o.text||`(empty)`]})]})}function oC(e){let{data:t,error:n}=tC(()=>R.boardThread(e.repo,e.id),[e.repo,e.id,e.board]),r=t=>e.projects.find(e=>e.name===t)?.managerId??null,i=eC(t?.url??null);return(0,B.jsxs)(`div`,{className:`waiting-view board-view`,children:[(0,B.jsxs)(`header`,{className:`session-head`,children:[(0,B.jsxs)(`div`,{className:`session-head-text`,children:[(0,B.jsx)(`h2`,{children:t&&!t.missing?t.title:`Thread ${e.id}`}),(0,B.jsxs)(`div`,{className:`muted`,children:[(0,B.jsxs)(`span`,{className:`mono`,children:[e.repo,` #`,e.id]}),t&&t.participants.length>0&&(0,B.jsxs)(B.Fragment,{children:[` · `,rC(t.participants)]})]})]}),(0,B.jsx)(`div`,{className:`session-corner`,children:(0,B.jsx)(`button`,{className:`small`,onClick:e.onBack,children:`← Board`})})]}),(0,B.jsxs)(`div`,{className:`waiting-list board-thread-page`,children:[(0,B.jsxs)(`p`,{className:`muted board-readonly`,children:[`Read-only: nothing is posted from here and opening this does not mark anything read.`,i&&(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,children:[`Open the thread on `,t?.service??`the board`]}),`.`]})]}),n&&(0,B.jsx)(`p`,{className:`board-error`,children:n}),!t&&!n&&(0,B.jsx)(`p`,{className:`muted`,children:`Reading the thread…`}),t?.missing&&(0,B.jsx)(`p`,{className:`muted`,children:`Ledung holds no posts of this thread. It may be older than the board's first check here, or on a board no project here uses.`}),t?.truncated&&(0,B.jsxs)(`p`,{className:`muted`,children:[`Only the latest `,t.posts.length,` posts are shown.`]}),t?.posts.map(n=>(0,B.jsx)(cC,{p:n,service:t.service,managerOf:r,onOpen:e.onOpen},n.id))]})]})}function sC({files:e}){return(0,B.jsx)(`ul`,{className:`board-attachments`,children:e.map((e,t)=>{let n=e.size>=1048576?`${(e.size/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(e.size/1024))} KB`,r=`${e.name} · ${e.kind===`text`?`text`:e.kind.toUpperCase()} · ${n}`;if(e.file&&e.kind!==`text`){let n=gd(``,e.file);return(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,children:(0,B.jsx)(`img`,{src:n,alt:e.name})}),(0,B.jsx)(`span`,{children:r})]},t)}let i=e.pruned?`pruned`:e.error?`not fetched: ${e.error}`:`in the board cache`;return(0,B.jsx)(`li`,{className:`muted`,children:(0,B.jsxs)(`span`,{children:[r,` · `,i]})},t)})})}function cC({p:e,service:t,managerOf:n,onOpen:r}){let i=e.mine?`out`:e.viaLedung?`ledung`:`typed`,a=e.deliveries.some(e=>!e.read),o=eC(e.url);return(0,B.jsxs)(`div`,{className:`msg board-post board-post-card ${i}${e.text===null?` dropped`:``}${a?` unread`:``}`,children:[(0,B.jsxs)(`div`,{className:`msg-meta`,children:[(0,B.jsx)(`span`,{className:`who`,children:JS(e,t)}),a&&(0,B.jsx)(`span`,{className:`chip accent`,children:`unread`}),(0,B.jsx)(`time`,{className:`time`,children:$(e.at)}),o&&(0,B.jsxs)(`a`,{className:`board-post-link`,href:o,target:`_blank`,rel:`noopener noreferrer`,children:[`on `,t]})]}),e.recipients.length>0&&(0,B.jsxs)(`div`,{className:`board-thread`,children:[`To `,e.recipients.join(`, `)]}),e.text===null?(0,B.jsxs)(`div`,{className:`msg-body muted`,children:[`Dropped: no project here allows @`,e.author,`, so Ledung kept only that this post exists, not its text.`]}):(0,B.jsx)(`div`,{className:`msg-body plain`,children:e.text}),e.attachments.length>0&&(0,B.jsx)(sC,{files:e.attachments}),(0,B.jsx)(`ul`,{className:`board-delivery-list`,children:YS(e).map((e,t)=>{let i=e.project?n(e.project):null;return(0,B.jsxs)(`li`,{className:`delivery-${e.level}`,children:[e.text,i&&(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsxs)(`button`,{className:`link`,onClick:()=>r(i),children:[e.project,`'s manager chat`]})]})]},t)})})]})}var lC=80;function uC({value:e,onSave:t,onDone:n,label:r}){let i=z(),[a,o]=(0,v.useState)(e),s=a.replace(/\s+/g,` `).trim();return(0,B.jsx)(`input`,{...i,className:`name-editor`,"aria-label":r,autoFocus:!0,maxLength:lC,value:a,onFocus:e=>e.currentTarget.select(),onChange:e=>o(e.target.value),onClick:e=>e.stopPropagation(),onBlur:n,onKeyDown:r=>{if(r.stopPropagation(),r.key===`Escape`)n();else if(r.key===`Enter`&&!r.nativeEvent.isComposing){if(r.preventDefault(),!s)return;s===e?n():t(s).then(n)}}})}function dC(e,t){return fC(e)-fC(t)||(e.position!==null&&t.position!==null?e.position-t.position:t.createdAt-e.createdAt)}function fC(e){return e.position===null?e.status===`ended`?2:0:1}function pC(e,t,n){let r=e.indexOf(t);if(r<0)return e;let i=e.filter(e=>e!==t),a=Math.max(0,Math.min(i.length,n>r?n-1:n));return[...i.slice(0,a),t,...i.slice(a)]}function mC(e,t){let n=e.findIndex(e=>t<e);return n<0?e.length:n}function hC(e,t,n){let r=e.indexOf(t);return n===r||n===r+1}var gC=5,_C=450,vC=8,yC=28;function bC(e){let t=(0,v.useRef)(null),[n,r]=(0,v.useState)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(null),o=(0,v.useRef)(!1),s=(0,v.useRef)(e);s.current=e;let c=(0,v.useRef)(null),l=e=>[...t.current?.querySelectorAll(`[data-drag]`)??[]].filter(t=>t.dataset.drag===e),u=(e,t)=>t===`projects`?e.closest(`.project-group`)??e:e,d=(e,n,r)=>{let i=l(e.group),a=i.find(t=>t.dataset.dragId===e.id),o=(e.group===`projects`?t.current:a?.closest(`.project-group`))?.getBoundingClientRect();if(!o||n<o.left||n>o.right||r<o.top||r>o.bottom)return null;let s=mC(i.map(t=>{let n=u(t,e.group).getBoundingClientRect();return n.top+n.height/2}),r);return hC(i.map(e=>e.dataset.dragId),e.id,s)?null:s},f=e=>{let t=a.current;i.current?.timer&&clearTimeout(i.current.timer),i.current=null,a.current=null,c.current?.(),c.current=null,document.body.classList.remove(`sidebar-dragging`),r(null),t&&(o.current=!0,setTimeout(()=>{o.current=!1},0),e&&t.slot!==null&&s.current(t.group,pC(l(t.group).map(e=>e.dataset.dragId),t.id,t.slot)))},p=e=>{a.current={group:e.group,id:e.id,slot:null},document.body.classList.add(`sidebar-dragging`),r(a.current),e.touch&&navigator.vibrate?.(10)},m=e=>{let n=t.current;if(!n)return;let r=n.scrollHeight>n.clientHeight?n:n.closest(`.sidebar`);if(!r)return;let i=r.getBoundingClientRect();e<i.top+yC?r.scrollBy(0,-10):e>i.bottom-yC&&r.scrollBy(0,10)};return(0,v.useEffect)(()=>{let e=t.current;if(!e)return;let n=e=>{a.current&&e.preventDefault()};return e.addEventListener(`touchmove`,n,{passive:!1}),()=>{e.removeEventListener(`touchmove`,n),c.current?.()}},[]),{nav:t,drag:n,handlers:{onPointerDown:e=>{if(e.button!==0||i.current)return;let n=e.target.closest(`[data-drag]`);if(!n||!t.current?.contains(n))return;let o=e.pointerType===`touch`,s={pointerId:e.pointerId,x:e.clientX,y:e.clientY,group:n.dataset.drag,id:n.dataset.dragId,touch:o,timer:null};if(i.current=s,o)s.timer=window.setTimeout(()=>{s.timer=null,i.current===s&&p(s)},_C);else try{n.setPointerCapture(e.pointerId)}catch{}let l=e=>{if(e.pointerId!==s.pointerId)return;let t=Math.hypot(e.clientX-s.x,e.clientY-s.y);if(!a.current){if(s.touch){t>vC&&f(!1);return}if(t<gC)return;p(s)}let n=a.current,i=d(n,e.clientX,e.clientY);i!==n.slot&&(a.current={...n,slot:i},r(a.current)),m(e.clientY)},u=e=>{e.pointerId===s.pointerId&&f(!0)},h=e=>{e.pointerId===s.pointerId&&f(!1)},g=e=>{e.key===`Escape`&&a.current&&(e.preventDefault(),e.stopPropagation(),f(!1))};window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,u),window.addEventListener(`pointercancel`,h),document.addEventListener(`keydown`,g,!0),c.current=()=>{window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,u),window.removeEventListener(`pointercancel`,h),document.removeEventListener(`keydown`,g,!0)}},onClickCapture:e=>{o.current&&(e.preventDefault(),e.stopPropagation())},onContextMenu:e=>{(i.current?.touch||a.current)&&e.preventDefault()}}}}var xC=`ledung.sidebar.folded`,SC=`ledung.sidebar.foldedSessions`,CC=(e,t,n)=>({count:(e?.count??0)+1,pending:(e?.pending??0)+(n[t.s.id]??0),working:(e?.working??!1)||Lb(t.s)===`running`});function wC(e,t){let n=[],r=null,i=null,a=null;return e.forEach((o,s)=>{o.depth===0&&(i=o.s.id,a=null);let c=t.folded||o.depth>0&&i!==null&&t.foldedSessions.includes(i),l=o.depth===0&&e[s+1]?.depth===1;if(!c||o.s.id===t.openId){let e={...o,...c?{drag:null}:{},folds:l,folded:l&&t.foldedSessions.includes(o.s.id),hidden:null};n.push(e),o.depth===0&&(a=e)}else t.folded?r=CC(r,o,t.pending):a&&(a.hidden=CC(a.hidden,o,t.pending))}),t.folded&&!r&&(r={count:0,pending:0,working:!1}),{rows:n,project:r}}function TC(e,t){try{let n=JSON.parse(e.getItem(t)??`[]`);return Array.isArray(n)?n.filter(e=>typeof e==`string`):[]}catch{return[]}}function EC(e,t,n){try{n.length?e.setItem(t,JSON.stringify(n)):e.removeItem(t)}catch{}}var DC=e=>TC(e,xC),OC=(e,t)=>EC(e,xC,t),kC=e=>TC(e,SC),AC=(e,t)=>EC(e,SC,t);function jC(e,t,n=()=>!0){let r=e.filter(e=>e!==t&&n(e));return e.includes(t)?r:[...r,t]}function MC(e,t){let n=[e.container,e.host===`github.com`?null:e.host].filter(Boolean).join(`, `),r=e=>e.toLocaleString(`en-US`),i=e.polling===`slow`?` · PRs checked every 10 min`:e.polling===`stopped`?` · PRs not checked until then`:``;return`GitHub${n?` (${n})`:``}: ${r(e.remaining)} of ${r(e.limit)} left until ${t(e.resetAt)}${i}`}function NC(e,t){return e.filter(e=>e.resetAt>t)}function PC(e){return e.polling===`stopped`?`critical`:e.polling===`slow`?`warning`:``}var FC=[`settings`,`accounts`,`add`,`chats`],IC=e=>!!e&&(FC.includes(e)||/^(settings|chats):/.test(e));function LC(e,t,n){return IC(n)?IC(e)?{depth:t.depth+1,root:t.root}:{depth:1,root:!1}:{depth:0,root:!1}}function RC(e){return e.depth>0&&!e.root?{back:e.depth}:{start:!0}}var zC=e=>e.key===`Escape`&&!e.defaultPrevented&&!e.isComposing,BC=e=>e===null?`phone-list`:`phone-pane`;function VC(e){return e?.ledungFromList===!0?{back:1}:{open:null}}var HC=e=>e?null:`overview`,UC=e=>`ledung.draft.${e}`;function WC(e,t){try{return e.getItem(UC(t))??``}catch{return``}}function GC(e,t,n){try{n?e.setItem(UC(t),n):e.removeItem(UC(t))}catch{}}function KC(e,t=localStorage){let[n,r]=(0,v.useState)(()=>WC(t,e)),i=(0,v.useRef)(n),a=(0,v.useRef)(n);(0,v.useEffect)(()=>{i.current=n});let o=(0,v.useCallback)(()=>{i.current!==a.current&&(a.current=i.current,GC(t,e,i.current))},[t,e]);return(0,v.useEffect)(()=>{if(n===a.current)return;let e=setTimeout(o,300);return()=>clearTimeout(e)},[n,o]),(0,v.useEffect)(()=>{let e=()=>{document.visibilityState===`hidden`&&o()};return window.addEventListener(`pagehide`,o),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`pagehide`,o),document.removeEventListener(`visibilitychange`,e),o()}},[o]),[n,r]}function qC(e){let t=(0,v.useRef)(e);return(0,v.useLayoutEffect)(()=>{t.current=e}),(0,v.useCallback)((...e)=>t.current(...e),[])}function JC(e){let t=e.status===`ended`,n=!t&&e.status!==`stopping`;return{menu:[...e.role===`manager`?[`away`]:[],`permissions`,...e.role===`session`?[`priority`]:[],`toolCalls`,`usage`,...n?[`pause`,`stop`]:[],...e.claudeVersion?[`version`]:[]],header:[...e.status===`queued`?[`startNow`]:[],...e.clearDue!=null&&!t?[`clear`]:[],...e.compacting&&!t?[`compacting`]:[],...t&&e.claudeSessionId?[`resume`]:[],...t&&e.role===`session`?[`archive`]:[]]}}var YC=e=>e.status!==`ended`&&e.status!==`stopping`,XC={connected:`connected`,failed:`failed`,"needs-auth":`needs sign-in`,pending:`starting`,disabled:`disabled`},ZC=e=>e.status===`running`||e.status===`waiting`,QC=e=>e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey&&!e.isComposing&&(/^[a-z]$/i.test(e.key)?e.key.toLowerCase()===`o`:e.code===`KeyO`),$C=e=>e.key===`Escape`&&!e.defaultPrevented&&!e.isComposing;function ew(e){return`${e<10?e.toFixed(1):Math.round(e)} ${e>=.95&&e<1.05?`core`:`cores`}`}function tw(e){return e>=1024**3?`${(e/1024**3).toFixed(e>=10*1024**3?0:1)} GB`:e>=1024**2?`${Math.round(e/1024**2)} MB`:`${Math.round(e/1024)} KB`}function nw(e){let t=Math.round(e/1e3);return t<60?`${t} s`:t<3600?`${Math.round(t/60)} min`:`${(t/3600).toFixed(1)} h`}var rw={normal:`Normal`,high:`High`,critical:`Critical`};function iw({label:e,used:t,total:n,text:r}){let i=n>0?t/n:0,a=i>=.95?`critical`:i>=.8?`warning`:`good`,o={good:`●`,warning:`▲`,critical:`■`}[a];return(0,B.jsxs)(`div`,{className:`limit`,title:`${e}: ${r}${a===`good`?``:a===`warning`?` (busy)`:` (full)`}`,children:[(0,B.jsxs)(`div`,{className:`limit-head`,children:[(0,B.jsx)(`span`,{children:e}),(0,B.jsxs)(`span`,{className:`limit-status ${a}`,children:[o,` `,Math.round(i*100),`%`]})]}),(0,B.jsx)(`div`,{className:`limit-track`,children:(0,B.jsx)(`div`,{className:`limit-fill ${a}`,style:{width:`${Math.min(100,i*100)}%`}})}),(0,B.jsx)(`div`,{className:`limit-sub muted`,children:r})]})}function aw(e){let t=e.machine,[n,r]=(0,v.useState)(``);if((0,v.useEffect)(()=>r(t?String(t.limit):``),[t?.limit]),!t)return null;let i=()=>{let i=Number(n);i!==t.limit&&e.run(()=>R.setLimit(i)).finally(()=>r(String(t.limit)))},a=t=>e.sessions.find(e=>e.id===t)?.title??`a session`;return(0,B.jsxs)(`section`,{className:`machine`,"aria-label":`Machine`,children:[(0,B.jsxs)(`div`,{className:`limits`,children:[(0,B.jsx)(iw,{label:`CPU`,used:t.cores,total:t.cpus,text:`${ew(t.cores)} of ${t.cpus}`}),(0,B.jsx)(iw,{label:`Memory`,used:t.memUsed,total:t.memTotal,text:`${tw(t.memUsed)} of ${tw(t.memTotal)}`}),t.docker&&(0,B.jsx)(iw,{label:`Docker memory`,used:t.docker.memUsed,total:t.docker.memTotal,text:`${tw(t.docker.memUsed)} of ${tw(t.docker.memTotal)} · ${ew(t.docker.cores)}`})]}),(0,B.jsxs)(`div`,{className:`machine-working`,children:[(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`strong`,{children:t.working}),` of `]}),(0,B.jsx)(`input`,{type:`number`,min:1,max:100,value:n,"aria-label":`How many sessions may work at once`,title:`How many sessions may work at the same time. Managers don't count.`,onChange:e=>r(e.target.value),onBlur:i,onKeyDown:e=>e.key===`Enter`&&e.target.blur()}),(0,B.jsxs)(`span`,{children:[` working`,t.line.length?` · ${t.line.length} waiting`:``]})]}),t.line.length>0&&(0,B.jsx)(`ol`,{className:`machine-line`,children:t.line.map(t=>{let n=e.sessions.find(e=>e.id===t);return(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`button`,{className:`link`,onClick:()=>e.onOpen(t),children:a(t)}),n&&n.priority!==`normal`&&(0,B.jsx)(`span`,{className:`chip prio-${n.priority}`,children:rw[n.priority]}),(0,B.jsx)(`button`,{className:`small`,title:`Start this turn now, above the limit`,onClick:()=>void e.run(()=>R.startNow(t)),children:`Start now`})]},t)})})]})}function ow({sessionId:e}){let[t,n]=(0,v.useState)(null);if((0,v.useEffect)(()=>{let t=!0,r=()=>R.turns(e).then(e=>t&&n(e),()=>{});r();let i=setInterval(r,15e3);return()=>{t=!1,clearInterval(i)}},[e]),!t)return null;if(!t.length)return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{children:`Machine use per turn`}),(0,B.jsx)(`p`,{className:`muted`,children:`No turns measured yet.`})]});let r=t.slice(-60);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{children:`CPU per turn`}),(0,B.jsx)(sw,{values:r.map(e=>({value:e.peakCores,label:`${new Date(e.startedAt).toLocaleTimeString()}: peak ${ew(e.peakCores)}, average ${ew(e.avgCores)}`})),format:ew}),(0,B.jsx)(`h3`,{children:`Memory per turn`}),(0,B.jsx)(sw,{values:r.map(e=>({value:e.peakMem,label:`${new Date(e.startedAt).toLocaleTimeString()}: peak ${tw(e.peakMem)}`})),format:tw}),(0,B.jsx)(`div`,{className:`table-scroll`,children:(0,B.jsxs)(`table`,{className:`plain calls`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Started`}),(0,B.jsx)(`th`,{className:`num`,children:`Took`}),(0,B.jsx)(`th`,{className:`num`,children:`Avg CPU`}),(0,B.jsx)(`th`,{className:`num`,children:`Peak CPU`}),(0,B.jsx)(`th`,{className:`num`,children:`Peak memory`}),(0,B.jsx)(`th`,{children:`Commands`})]})}),(0,B.jsx)(`tbody`,{children:t.slice().reverse().map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{className:`nowrap`,children:new Date(e.startedAt).toLocaleTimeString()}),(0,B.jsx)(`td`,{className:`num`,children:nw(e.durationMs)}),(0,B.jsx)(`td`,{className:`num`,children:e.avgCores.toFixed(2)}),(0,B.jsx)(`td`,{className:`num`,children:e.peakCores.toFixed(2)}),(0,B.jsx)(`td`,{className:`num`,children:tw(e.peakMem)}),(0,B.jsx)(`td`,{className:`mono`,children:e.commands.join(`, `)||(0,B.jsx)(`span`,{className:`muted`,children:`none`})})]},e.startedAt))})]})})]})}function sw({values:e,format:t}){let n=Math.max(...e.map(e=>e.value),0);return(0,B.jsxs)(`div`,{className:`mini-bars`,role:`img`,"aria-label":`Highest: ${t(n)}`,children:[(0,B.jsx)(`span`,{className:`mini-max muted`,children:t(n)}),e.map((e,t)=>(0,B.jsx)(`div`,{className:`mini-col`,title:e.label,children:(0,B.jsx)(`div`,{className:`mini-bar`,style:{height:`${n>0?Math.max(2,e.value/n*100):0}%`}})},t))]})}function cw(){let[e,t]=(0,v.useState)(null);return(0,v.useEffect)(()=>{R.typicalCosts(30).then(t,()=>t([]))},[]),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h2`,{children:`Typical machine use per turn`}),(0,B.jsx)(`p`,{className:`muted`,children:`Last 30 days, sessions only (not managers): what a turn that ran each kind of command usually used. Ledung learns these; they don't decide anything yet.`}),e?e.length?(0,B.jsx)(`div`,{className:`table-scroll`,children:(0,B.jsxs)(`table`,{className:`plain`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Project`}),(0,B.jsx)(`th`,{children:`Command`}),(0,B.jsx)(`th`,{className:`num`,children:`Turns`}),(0,B.jsx)(`th`,{className:`num`,children:`Avg CPU`}),(0,B.jsx)(`th`,{className:`num`,children:`Peak CPU`}),(0,B.jsx)(`th`,{className:`num`,children:`Peak memory`}),(0,B.jsx)(`th`,{className:`num`,children:`Duration`})]})}),(0,B.jsx)(`tbody`,{children:e.slice(0,50).map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:S(e.project)}),(0,B.jsx)(`td`,{className:`mono`,children:e.command||(0,B.jsx)(`span`,{className:`muted`,children:`no commands`})}),(0,B.jsx)(`td`,{className:`num`,children:e.turns}),(0,B.jsx)(`td`,{className:`num`,children:ew(e.avgCores)}),(0,B.jsx)(`td`,{className:`num`,children:ew(e.peakCores)}),(0,B.jsx)(`td`,{className:`num`,children:tw(e.peakMem)}),(0,B.jsx)(`td`,{className:`num`,children:nw(e.durationMs)})]},`${e.project} ${e.command}`))})]})}):(0,B.jsx)(`p`,{className:`muted`,children:`No turns measured yet.`}):(0,B.jsx)(`p`,{className:`muted`,children:`Loading…`})]})}function lw(e,t){let n=e=>`${Math.round(e/1e3)}k`;return`${n(e)}${t?` of ${n(t)}`:``}`}var uw={...Ib,waiting:`Needs an answer`};function dw(e){return e.contextTokens&&e.contextWindow?e.contextTokens/e.contextWindow:null}function fw(e){let t=new Set(e.sessions.map(e=>e.id)),n=e=>e.status!==`ended`,r=e.sessions.filter(r=>(!r.parentId||!t.has(r.parentId))&&(n(r)||e.sessions.some(e=>e.parentId===r.id&&n(e)))),i=(e,t)=>Number(t.role===`manager`)-Number(e.role===`manager`)||t.createdAt-e.createdAt,a=r.sort(i).flatMap(t=>[t,...e.sessions.filter(e=>e.parentId===t.id&&n(e)).sort(i)]),o=e.sessions.filter(e=>e.status===`ended`).length;return(0,B.jsx)(`div`,{className:`overview`,children:(0,B.jsxs)(`div`,{className:`overview-list`,children:[(0,B.jsxs)(`div`,{className:`muted`,children:[e.overview?`${Lv(e.overview.todayTokens)} tokens today`:``,o?` · ${o} ended session${o===1?``:`s`} not shown`:``]}),!a.length&&(0,B.jsx)(`p`,{className:`muted`,children:`No sessions are running.`}),a.map(n=>{let r=e.overview?.sessions[n.id],i=dw(n),a=!!n.parentId&&t.has(n.parentId);return(0,B.jsxs)(`div`,{role:`button`,tabIndex:0,className:`overview-card${a?` child`:``}`,onClick:()=>e.onOpenSession(n.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e.onOpenSession(n.id))},children:[(0,B.jsxs)(`div`,{className:`overview-top`,children:[(0,B.jsx)(`span`,{className:`dot ${Lb(n)}`}),(0,B.jsxs)(`span`,{className:`overview-title`,children:[n.role===`manager`&&(0,B.jsx)(`span`,{className:`chip`,children:`Manager`}),` `,n.title]}),e.waitingBySession[n.id]?(0,B.jsx)(`span`,{className:`badge`,children:e.waitingBySession[n.id]}):null]}),(0,B.jsxs)(`div`,{className:`overview-facts`,children:[(0,B.jsxs)(`span`,{children:[uw[n.status],e.machine&&e.machine.line.includes(n.id)?`: number ${e.machine.line.indexOf(n.id)+1}`:``,n.paused?` · paused`:``]}),n.priority!==`normal`&&(0,B.jsx)(`span`,{className:`chip prio-${n.priority}`,title:n.priorityNote??void 0,children:rw[n.priority]}),e.machine?.sessions[n.id]&&(0,B.jsxs)(`span`,{title:`CPU and memory of everything this session runs`,children:[ew(e.machine.sessions[n.id].cores),` · `,tw(e.machine.sessions[n.id].memBytes)]}),(0,B.jsx)(`span`,{children:S(n.project)}),n.branch&&(0,B.jsx)(`span`,{className:`mono`,children:n.branch}),n.pr&&(0,B.jsx)(`a`,{href:n.pr.url,target:`_blank`,rel:`noreferrer noopener`,onClick:e=>e.stopPropagation(),title:`${n.pr.title} — checks ${n.pr.checks}`,children:Bv(n.pr)}),n.tickets.map(e=>(0,B.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,onClick:e=>e.stopPropagation(),children:e.id},e.id)),r&&(0,B.jsxs)(`span`,{title:`Tokens today / in total`,children:[Lv(r.today),` today · `,Lv(r.total),` total · `,Rv(r.costTotal)]}),n.contextTokens!=null&&(0,B.jsxs)(`span`,{className:i!=null&&i>.8?`ctx-high`:``,title:`How full the context window is, and its size in tokens`,children:[`context `,i==null?``:`${zv(i)} · `,lw(n.contextTokens,n.contextWindow)]}),n.backgroundTasks>0&&(0,B.jsxs)(`span`,{children:[n.backgroundTasks,` in background`]})]}),r?.lastReply&&(0,B.jsxs)(`div`,{className:`overview-last`,children:[(0,B.jsx)(`span`,{className:`muted`,children:r.lastReplyAt?$(r.lastReplyAt):``}),` `,r.lastReply.split(`
104
- `)[0]]})]},n.id)})]})})}function pw({sessionId:e,onClose:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{let t=!0,n=()=>R.sessionUsage(e).then(e=>t&&r(e),e=>t&&a(e.message));n();let i=setInterval(n,15e3);return()=>{t=!1,clearInterval(i)}},[e]);let o=(0,v.useMemo)(()=>Wv(`model`,n?.models??[]),[n?.models]),s=n?.totals,c=n?n.calls.slice(-120):[];return(0,B.jsxs)(`aside`,{className:`file-panel`,"aria-label":`Usage`,children:[(0,B.jsxs)(`header`,{className:`file-head`,children:[(0,B.jsx)(`span`,{className:`file-path`,children:`Usage of this session`}),(0,B.jsx)(`button`,{className:`small`,onClick:t,children:`Close`})]}),(0,B.jsxs)(`div`,{className:`file-body`,children:[i&&(0,B.jsx)(`p`,{className:`error`,children:i}),!n&&!i&&(0,B.jsx)(`p`,{className:`muted`,children:`Loading…`}),n&&s&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`tiles`,children:[(0,B.jsx)(Jv,{label:`Tokens`,value:Lv(s.tokens),sub:`${s.calls} model calls`}),(0,B.jsx)(Jv,{label:`API-equivalent cost`,value:Rv(s.cost)}),(0,B.jsx)(Jv,{label:`Cache read share`,value:s.tokens?zv(s.cacheRead/s.tokens):`—`}),(0,B.jsx)(Jv,{label:`In subagents`,value:s.tokens?zv(s.subagentTokens/s.tokens):`—`})]}),(0,B.jsx)(`h3`,{children:`Tokens per model call`}),(0,B.jsx)(Gv,{items:[...n.models.map(e=>({label:e,color:o(e)})),...n.calls.some(e=>e.subagent)?[{label:`subagent call`,color:`var(--s-other)`,textured:!0}]:[]]}),(0,B.jsx)(qv,{height:120,columns:c.map(e=>({label:new Date(e.at).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),short:new Date(e.at).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),values:{[e.model]:e.tokens},textured:!!e.subagent,note:[e.compaction?`Compaction`:``,e.subagent?`Subagent: ${e.subagent}`:``,`Started by: ${Uv[e.trigger]??e.trigger}`].filter(Boolean).join(` · `)})),series:n.models.map(e=>({key:e,label:e,color:o(e)})),emptyText:`No model calls recorded yet.`}),(0,B.jsx)(ow,{sessionId:e}),(0,B.jsx)(`h3`,{children:`Model calls`}),(0,B.jsx)(`div`,{className:`table-scroll`,children:(0,B.jsxs)(`table`,{className:`plain calls`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Time`}),(0,B.jsx)(`th`,{children:`Model`}),(0,B.jsx)(`th`,{className:`num`,children:`Input`}),(0,B.jsx)(`th`,{className:`num`,children:`Cache write`}),(0,B.jsx)(`th`,{className:`num`,children:`Cache read`}),(0,B.jsx)(`th`,{className:`num`,children:`Output`}),(0,B.jsx)(`th`,{className:`num`,children:`Thinking`}),(0,B.jsx)(`th`,{className:`num`,children:`Tokens`}),(0,B.jsx)(`th`,{className:`num`,children:`Cache %`}),(0,B.jsx)(`th`,{className:`num`,children:`Cost`}),(0,B.jsx)(`th`,{className:`num`,children:`Running`}),(0,B.jsx)(`th`,{children:`Who`})]})}),(0,B.jsx)(`tbody`,{children:(()=>{let e=0;return n.calls.map((t,n)=>(e+=t.cost??0,(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{className:`nowrap`,children:new Date(t.at).toLocaleTimeString()}),(0,B.jsxs)(`td`,{className:`nowrap`,children:[(0,B.jsx)(`span`,{className:`viz-swatch`,style:{background:o(t.model)}}),` `,t.model]}),(0,B.jsx)(`td`,{className:`num`,children:Lv(t.input)}),(0,B.jsx)(`td`,{className:`num`,children:Lv(t.cacheWrite)}),(0,B.jsx)(`td`,{className:`num`,children:Lv(t.cacheRead)}),(0,B.jsx)(`td`,{className:`num`,children:Lv(t.output)}),(0,B.jsx)(`td`,{className:`num muted`,children:t.thinking?`~${Lv(t.thinking)}`:``}),(0,B.jsx)(`td`,{className:`num strong`,children:Lv(t.tokens)}),(0,B.jsx)(`td`,{className:`num`,children:t.tokens?zv(t.cacheRead/t.tokens):``}),(0,B.jsx)(`td`,{className:`num`,children:Rv(t.cost)}),(0,B.jsx)(`td`,{className:`num muted`,children:Rv(e)}),(0,B.jsx)(`td`,{className:`muted nowrap`,children:t.subagent?`subagent: ${t.subagent}`:Uv[t.trigger]??t.trigger})]},n)))})()})]})})]})]})]})}var mw=864e5,hw=mw;function gw(e,t){return t.fingerprint??`${e.login}/${e.computerId}/${t.label}`}var _w=e=>e.input+e.cacheWrite+e.cacheRead+e.output;function vw(e){return e.entries.find(e=>e.own)?.login??null}function yw(e,t){let n=vw(e);return e.entries.flatMap(e=>e.state===`ok`&&e.file&&(!t||e.file.login===n)?[e.file]:[])}function bw(e){return e.flatMap(e=>e.accounts.map(t=>({file:e,account:t,key:gw(e,t)})))}function xw(e,t,n){if(e===`all`)return null;let r;if(e===`week`){let e=bw(t).flatMap(({account:e})=>e.limits.filter(e=>e.kind===`seven_day`&&e.resetsAt&&e.resetsAt>n).map(e=>e.resetsAt-Dv.seven_day));r=e.length?Math.min(...e):n-6*mw}else r=n-(Number(e.replace(`d`,``))-1)*mw;return Sw(r)}function Sw(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function Cw(e,t,n){let r=e=>!n||n(e.model),i=e.hourly.filter(r),a=i.length?Math.min(...i.map(e=>e.t)):1/0,o=0;for(let e of i)e.t+36e5>t&&(o+=e.cost);let s=Sw(t),c=Number.isFinite(a)?Sw(a):null;for(let t of e.daily)!r(t)||t.t<s||c&&t.t>=c||(o+=t.cost);return o}function ww(e){let t=/^seven_day_(opus|sonnet|haiku|fable)$/.exec(e)?.[1];return t?e=>e.toLowerCase().includes(t):void 0}var Tw=[`five_hour`,`seven_day`,`seven_day_opus`,`seven_day_sonnet`];function Ew(e,t){let n=new Map;for(let t of bw(e)){let e=n.get(t.key);e?e.push(t):n.set(t.key,[t])}let r=[];for(let[e,i]of n){let n=[...i].sort((e,t)=>t.file.asOf-e.file.asOf)[0],a=[...new Set(i.flatMap(e=>e.account.limits.map(e=>e.kind)))].filter(e=>e!==`overage`&&e!==`seven_day_overage_included`).sort((e,t)=>(Tw.indexOf(e)+1||99)-(Tw.indexOf(t)+1||99)||e.localeCompare(t)).map(e=>{let n=i.flatMap(t=>t.account.limits.filter(t=>t.kind===e)).sort((e,t)=>t.seenAt-e.seenAt)[0],r=n?{...n,at:n.seenAt}:null,a=r?Pv(r,t):!1,o=Dv[e]??Dv.seven_day,s=r?.resetsAt&&!a?r.resetsAt-o:t-o,c=i.map(t=>({computer:t.file.computer,computerId:t.file.computerId,login:t.file.login,cost:Cw(t.account,s,ww(e))})),l=c.reduce((e,t)=>e+t.cost,0);return{kind:e,reading:r,reset:a,pace:r&&!a&&r.utilization!=null?Ov(e.startsWith(`seven_day`)?`seven_day`:e,r.utilization,r.resetsAt,t):null,shares:c.filter(e=>e.cost>0).map(e=>({...e,share:e.cost/l})).sort((e,t)=>t.cost-e.cost)}});r.push({fingerprint:e,label:n.account.label,rows:a,people:[...new Set(i.map(e=>e.file.login))].sort(),computers:[...new Set(i.map(e=>e.file.computer))].sort()})}return r.sort((e,t)=>e.label.localeCompare(t.label))}function Dw(e,t,n){return e===`person`?t.file.login:e===`account`?t.account.label:e===`computer`?t.file.computer:e===`model`?n.model:n.project}function Ow(e,t,n,r){let i=new Map,a=new Set;for(let r of bw(e))for(let e of r.account.daily){if(n&&e.t<n)continue;let o=Dw(t,r,e);a.add(o);let s=i.get(e.t)??Object.create(null);s[o]=(s[o]??0)+_w(e),i.set(e.t,s)}let o=n??[...i.keys()].sort()[0],s=Sw(r),c=[];if(o)for(let e=new Date(`${o}T12:00:00`);Sw(e.getTime())<=s;e.setDate(e.getDate()+1)){let t=Sw(e.getTime());c.push({day:t,values:i.get(t)??Object.create(null)})}return{keys:[...a].sort(),columns:c}}function kw(e,t,n){return bw(e).map(({file:e,account:r,key:i})=>{let a=r.daily.filter(e=>!t||e.t>=t);return{login:e.login,account:r.label,fingerprint:i,computer:e.computer,computerId:e.computerId,tokens:a.reduce((e,t)=>e+_w(t),0),cost:a.reduce((e,t)=>e+t.cost,0),asOf:e.asOf,stale:n-e.asOf>hw}}).sort((e,t)=>e.login.localeCompare(t.login)||e.account.localeCompare(t.account)||e.computer.localeCompare(t.computer))}var Aw=[[`week`,`Since weekly reset`],[`7d`,`7 days`],[`30d`,`30 days`],[`90d`,`90 days`],[`all`,`All time`]],jw=[[`person`,`person`],[`account`,`account`],[`computer`,`computer`],[`model`,`model`],[`project`,`project`]],Mw={five_hour:`5-hour`,seven_day:`Weekly`,seven_day_opus:`Weekly Opus`,seven_day_sonnet:`Weekly Sonnet`},Nw={allowed:{cls:`good`,icon:`●`,label:`OK`},allowed_warning:{cls:`warning`,icon:`▲`,label:`Close to the limit`},rejected:{cls:`critical`,icon:`■`,label:`Limit reached`}};function Pw(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Fw(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let e=!0,n=()=>R.sharedUsage().then(n=>e&&(t(n),r(null)),t=>e&&r(t.message));n();let i=setInterval(n,6e4);return()=>{e=!1,clearInterval(i)}},[]),n&&!e?(0,B.jsx)(`p`,{className:`error`,children:n}):e?(0,B.jsx)(Iw,{view:e,now:Date.now()}):(0,B.jsx)(`p`,{className:`muted`,children:`Loading…`})}function Iw({view:e,now:t,initialMine:n=!1}){let[r,i]=(0,v.useState)(n),[a,o]=(0,v.useState)(`week`),[s,c]=(0,v.useState)(`person`),l=vw(e),u=(0,v.useMemo)(()=>yw(e,r),[e,r]),d=xw(a,u,t),f=(0,v.useMemo)(()=>Ew(u,t),[u,t]),p=(0,v.useMemo)(()=>Ow(u,s,d,t),[u,s,d,t]),m=(0,v.useMemo)(()=>kw(u,d,t),[u,d,t]),h=Wv(`project`,[...new Set(yw(e,!1).map(e=>e.computerId))]),g=Wv(s===`model`?`model`:`project`,p.keys);if(!e.repo)return(0,B.jsx)(`p`,{className:`muted`,children:`Nothing is published here yet. Switch on Publish usage in Settings to share this computer's usage and read everyone else's.`});let _=p.keys.map(e=>({key:e,label:e,color:g(e)})),y=p.columns.map(e=>({label:new Date(`${e.day}T12:00:00`).toLocaleDateString([],{weekday:`short`,day:`numeric`,month:`short`}),short:new Date(`${e.day}T12:00:00`).toLocaleDateString([],{weekday:`short`,day:`numeric`}),values:e.values}));return(0,B.jsxs)(`div`,{className:`shared-usage`,children:[(0,B.jsxs)(`div`,{className:`filters`,children:[(0,B.jsxs)(`label`,{children:[`Period `,(0,B.jsx)(`select`,{value:a,onChange:e=>o(e.target.value),children:Aw.map(([e,t])=>(0,B.jsx)(`option`,{value:e,children:t},e))})]}),(0,B.jsxs)(`label`,{className:`shared-mine`,title:l?`Only ${l}'s own computers`:`Mine needs this computer to publish its usage too`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:r,disabled:!l,onChange:e=>i(e.target.checked)}),` Mine`]})]}),e.error&&(0,B.jsxs)(`p`,{className:`error`,children:[`Could not read the shared usage just now: `,e.error,e.entries.length?` Showing the last files read.`:``]}),e.entries.filter(e=>e.state!==`ok`&&(!r||e.login===l)).map(e=>(0,B.jsxs)(`p`,{className:`shared-note warning`,children:[e.computer??`A computer`,e.login?` (${e.login})`:``,e.state===`newer`?` publishes usage in a newer format: update Ledung to see it.`:` published a usage file Ledung cannot read${e.reason?` (${e.reason})`:``}.`]},e.id)),!u.length&&(0,B.jsx)(`p`,{className:`muted`,children:r?`None of your computers has published yet.`:`No computer has published yet.`}),f.length>0&&(0,B.jsx)(`div`,{className:`shared-cards`,children:f.map(e=>(0,B.jsx)(Lw,{card:e,now:t,color:h},e.fingerprint))}),u.length>0&&(0,B.jsxs)(`section`,{className:`card viz-card`,children:[(0,B.jsxs)(`div`,{className:`viz-card-head`,children:[(0,B.jsx)(`h3`,{children:`Daily tokens`}),(0,B.jsxs)(`div`,{className:`seg-control shared-stack`,role:`group`,"aria-label":`Stack by`,children:[(0,B.jsx)(`span`,{className:`muted`,children:`by`}),jw.map(([e,t])=>(0,B.jsx)(`button`,{className:s===e?`on`:``,onClick:()=>c(e),children:t},e))]})]}),(0,B.jsx)(Gv,{items:_}),(0,B.jsx)(qv,{columns:y,series:_})]}),m.length>0&&(0,B.jsxs)(`section`,{className:`card viz-card`,children:[(0,B.jsx)(`h3`,{children:`Who's who`}),(0,B.jsx)(`div`,{className:`table-scroll`,children:(0,B.jsxs)(`table`,{className:`plain`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Person`}),(0,B.jsx)(`th`,{children:`Account`}),(0,B.jsx)(`th`,{children:`Computer`}),(0,B.jsx)(`th`,{className:`num`,children:`Tokens`}),(0,B.jsx)(`th`,{className:`num`,children:`Cost`}),(0,B.jsx)(`th`,{children:`Last published`})]})}),(0,B.jsx)(`tbody`,{children:m.map((e,n)=>{let r=m[n-1],i=r?.login===e.login;return(0,B.jsxs)(`tr`,{className:e.stale?`shared-stale`:``,children:[(0,B.jsx)(`td`,{children:i?``:e.login}),(0,B.jsx)(`td`,{children:i&&r?.fingerprint===e.fingerprint?``:e.account}),(0,B.jsxs)(`td`,{className:`nowrap`,children:[(0,B.jsx)(`span`,{className:`viz-swatch`,style:{background:h(e.computerId)}}),` `,e.computer]}),(0,B.jsx)(`td`,{className:`num`,children:Lv(e.tokens)}),(0,B.jsx)(`td`,{className:`num`,children:Rv(e.cost)}),(0,B.jsxs)(`td`,{className:`nowrap`,children:[Fv({at:e.asOf,resetsAt:null},t).replace(/^as of /,``),e.stale&&(0,B.jsx)(`span`,{className:`shared-stale-mark`,title:`No publish for over a day`,children:` · stale`})]})]},`${e.computerId}-${e.fingerprint}`)})})]})})]})]})}function Lw({card:e,now:t,color:n}){return(0,B.jsxs)(`section`,{className:`card viz-card shared-card`,children:[(0,B.jsx)(`h3`,{children:e.label}),(0,B.jsxs)(`div`,{className:`muted shared-card-who`,children:[e.people.join(`, `),` · `,e.computers.length,` computer`,e.computers.length===1?``:`s`]}),!e.rows.some(e=>e.reading)&&(0,B.jsx)(`div`,{className:`muted`,children:`no data yet`}),e.rows.map(e=>{let r=Pw(Mw,e.kind)??e.kind;if(!e.reading)return null;if(e.reset)return(0,B.jsxs)(`div`,{className:`shared-limit limit-reset`,title:`${r}: the window has reset since the last reading (${Fv(e.reading,t)}).`,children:[(0,B.jsxs)(`div`,{className:`limit-head`,children:[(0,B.jsx)(`span`,{children:r}),(0,B.jsx)(`span`,{className:`limit-status`,children:`reset`})]}),(0,B.jsx)(`div`,{className:`limit-sub muted`,children:(0,B.jsx)(`span`,{children:`no reading since the reset`})})]},e.kind);let i=e.reading.utilization,a=Iv(e.reading,t),o=Math.min(100,(i??0)*100),s=Pw(Nw,e.reading.status)??{cls:`good`,icon:`●`,label:e.reading.status},c=e.shares.map(e=>`${e.computer} (${e.login}): ${zv(e.share)}, ${Rv(e.cost)}`).join(`
105
- `);return(0,B.jsxs)(`div`,{className:`shared-limit`,children:[(0,B.jsxs)(`div`,{className:`limit-head`,children:[(0,B.jsx)(`span`,{children:r}),(0,B.jsxs)(`span`,{className:`limit-status ${s.cls}`,title:s.label,children:[s.icon,` `,i==null?s.label:zv(i)]})]}),(0,B.jsx)(`div`,{className:`limit-track shared-track`,title:c||`No use recorded in this window`,children:(0,B.jsx)(`div`,{className:`shared-fill`,style:{width:`${o}%`},children:e.shares.length?e.shares.map(e=>(0,B.jsx)(`div`,{className:`shared-seg`,style:{flexGrow:e.share,background:n(e.computerId)}},e.computerId)):(0,B.jsx)(`div`,{className:`shared-seg limit-fill ${s.cls}`,style:{flexGrow:1}})})}),(0,B.jsxs)(`div`,{className:`limit-sub muted`,children:[(0,B.jsx)(`span`,{children:e.shares.map(e=>`${e.computer} ${zv(e.share)}`).join(` · `)}),(0,B.jsxs)(`span`,{className:`limit-forecast${e.pace!=null&&e.pace>=1?` over`:``}`,children:[`≈ `,e.pace==null?`—`:zv(e.pace),` by reset`]})]}),a&&(0,B.jsx)(`div`,{className:`limit-sub limit-age`,children:a})]},e.kind)})]})}function Rw(){return(0,B.jsx)(`div`,{className:`usage-body`,children:(0,B.jsx)(Fw,{})})}var zw=[[`week`,`Since weekly reset`],[`7d`,`7 days`],[`30d`,`30 days`],[`90d`,`90 days`],[`all`,`All time`]];function Bw(e){return new Date(`${e}T12:00:00`).toLocaleDateString([],{weekday:`short`,day:`numeric`})}var Vw=[[`computer`,`This computer`],[`shared`,`Shared`],[`sessions`,`Sessions`]];function Hw(e){let[t,n]=(0,v.useState)(`computer`),r=e.sessionsOpen?`sessions`:t,i=t=>{t===`sessions`?e.sessionsOpen||e.onSessions(!0):(n(t),e.sessionsOpen&&e.onSessions(!1))};return(0,B.jsxs)(`div`,{className:`usage`,children:[(0,B.jsx)(`header`,{className:`session-head`,children:(0,B.jsx)(`div`,{className:`session-head-text`,children:(0,B.jsx)(`h2`,{children:`Usage`})})}),(0,B.jsx)(`div`,{className:`pane-tabs`,role:`tablist`,"aria-label":`Usage`,children:Vw.map(([e,t])=>(0,B.jsx)(`button`,{role:`tab`,"aria-selected":r===e,className:r===e?`on`:``,onClick:()=>i(e),children:t},e))}),r===`computer`?(0,B.jsx)(Uw,{onOpenSession:e.onOpenSession}):r===`shared`?(0,B.jsx)(Rw,{}):(0,B.jsx)(fw,{sessions:e.sessions,overview:e.overview,machine:e.machine,waitingBySession:e.waitingBySession,onOpenSession:e.onOpenSession})]})}function Uw({onOpenSession:e}){let[t,n]=(0,v.useState)({period:`week`}),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(`model`),[l,u]=(0,v.useState)({});(0,v.useEffect)(()=>{let e=!0;R.usage(t).then(t=>e&&i(t),t=>e&&o(t.message));let n=setInterval(()=>R.usage(t).then(t=>e&&i(t),()=>{}),3e4);return()=>{e=!1,clearInterval(n)}},[t]);let d=(0,v.useMemo)(()=>({model:Wv(`model`,r?.options.models??[]),project:Wv(`project`,r?.options.projects??[]),trigger:Wv(`trigger`,Hv)}),[r?.options.models,r?.options.projects]);if(a)return(0,B.jsx)(`div`,{className:`usage-body`,children:(0,B.jsx)(`p`,{className:`error`,children:a})});if(!r)return(0,B.jsx)(`div`,{className:`usage-body`,children:(0,B.jsx)(`p`,{className:`muted`,children:`Loading…`})});let f=e=>n(t=>({...t,...e})),p=r.totals,m=(s===`model`?r.models:s===`project`?[...new Set(r.daily.flatMap(e=>Object.keys(e.byProject)))].sort():Hv.filter(e=>r.daily.some(t=>t.byTrigger[e]))).map(e=>({key:e,label:s===`trigger`?Uv[e]??e:e,color:d[s](e)})),h=r.daily.map(e=>({label:new Date(`${e.day}T12:00:00`).toLocaleDateString([],{weekday:`short`,day:`numeric`,month:`short`}),short:Bw(e.day),values:s===`model`?e.byModel:s===`project`?e.byProject:e.byTrigger})),g=t.project||t.model||t.branch||t.role||t.trigger||t.account;return(0,B.jsxs)(`div`,{className:`usage-body`,children:[(0,B.jsxs)(`div`,{className:`muted`,children:[`Since `,new Date(r.since||Date.now()).toLocaleString([],{dateStyle:`medium`,timeStyle:`short`}),r.since===0?` (all time)`:``]}),(0,B.jsxs)(`div`,{className:`filters`,children:[(0,B.jsxs)(`label`,{children:[`Period `,(0,B.jsx)(`select`,{value:t.period,onChange:e=>f({period:e.target.value}),children:zw.map(([e,t])=>(0,B.jsx)(`option`,{value:e,children:t},e))})]}),(0,B.jsxs)(`label`,{children:[`Project `,(0,B.jsxs)(`select`,{value:t.project??``,onChange:e=>f({project:e.target.value||void 0}),children:[(0,B.jsx)(`option`,{value:``,children:`All`}),r.options.projects.map(e=>(0,B.jsx)(`option`,{value:e,children:S(e)},e))]})]}),(r.options.accounts?.length??0)>1&&(0,B.jsxs)(`label`,{children:[`Account `,(0,B.jsxs)(`select`,{value:t.account??``,onChange:e=>f({account:e.target.value||void 0}),children:[(0,B.jsx)(`option`,{value:``,children:`All`}),r.options.accounts.map(e=>(0,B.jsx)(`option`,{children:e},e))]})]}),(0,B.jsxs)(`label`,{children:[`Model `,(0,B.jsxs)(`select`,{value:t.model??``,onChange:e=>f({model:e.target.value||void 0}),children:[(0,B.jsx)(`option`,{value:``,children:`All`}),r.options.models.map(e=>(0,B.jsx)(`option`,{children:e},e))]})]}),(0,B.jsxs)(`label`,{children:[`Branch `,(0,B.jsxs)(`select`,{value:t.branch??``,onChange:e=>f({branch:e.target.value||void 0}),children:[(0,B.jsx)(`option`,{value:``,children:`All`}),r.options.branches.map(e=>(0,B.jsx)(`option`,{children:e},e))]})]}),(0,B.jsxs)(`label`,{children:[`Role `,(0,B.jsxs)(`select`,{value:t.role??``,onChange:e=>f({role:e.target.value||void 0}),children:[(0,B.jsx)(`option`,{value:``,children:`All`}),(0,B.jsx)(`option`,{value:`manager`,children:`Managers`}),(0,B.jsx)(`option`,{value:`session`,children:`Sessions`})]})]}),(0,B.jsxs)(`label`,{children:[`Started by `,(0,B.jsxs)(`select`,{value:t.trigger??``,onChange:e=>f({trigger:e.target.value||void 0}),children:[(0,B.jsx)(`option`,{value:``,children:`All`}),Hv.map(e=>(0,B.jsx)(`option`,{value:e,children:Uv[e]},e))]})]}),g&&(0,B.jsx)(`button`,{className:`small`,onClick:()=>n({period:t.period}),children:`Clear filters`})]}),(0,B.jsxs)(`div`,{className:`tiles`,children:[(0,B.jsx)(Jv,{label:`Tokens`,value:Lv(p.tokens),sub:`${Lv(p.output)} output`}),(0,B.jsx)(Jv,{label:`API-equivalent cost`,value:Rv(p.cost),sub:`not what a plan charges`}),(0,B.jsx)(Jv,{label:`Model calls`,value:p.calls.toLocaleString(),sub:`${p.sessions} session${p.sessions===1?``:`s`}`}),(0,B.jsx)(Jv,{label:`Cache read share`,value:p.tokens?zv(p.cacheRead/p.tokens):`—`,sub:`higher is cheaper`}),(0,B.jsx)(Jv,{label:`In subagents`,value:p.tokens?zv(p.subagentTokens/p.tokens):`—`})]}),(0,B.jsxs)(`section`,{className:`card viz-card`,children:[(0,B.jsxs)(`div`,{className:`viz-card-head`,children:[(0,B.jsx)(`h3`,{children:`Daily tokens`}),(0,B.jsx)(`div`,{className:`seg-control`,role:`group`,"aria-label":`Split by`,children:[`model`,`project`,`trigger`].map(e=>(0,B.jsx)(`button`,{className:s===e?`on`:``,onClick:()=>c(e),children:e===`trigger`?`started by`:`by ${e}`},e))})]}),(0,B.jsx)(Gv,{items:m}),(0,B.jsx)(qv,{columns:h,series:m})]}),(0,B.jsxs)(`section`,{className:`card viz-card`,children:[(0,B.jsx)(`h3`,{children:`Project × model`}),(0,B.jsx)(`div`,{className:`table-scroll`,children:(0,B.jsxs)(`table`,{className:`matrix`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Project`}),r.models.map(e=>(0,B.jsxs)(`th`,{className:`num`,children:[(0,B.jsx)(`span`,{className:`viz-swatch`,style:{background:d.model(e)}}),` `,e]},e)),(0,B.jsx)(`th`,{className:`num`,children:`Total`}),(0,B.jsx)(`th`,{className:`num`,children:`Cost`}),(0,B.jsx)(`th`,{className:`num`,title:`Share of tokens used by subagents`,children:`Sub`})]})}),(0,B.jsx)(`tbody`,{children:r.matrix.map(e=>(0,B.jsxs)(v.Fragment,{children:[(0,B.jsxs)(`tr`,{className:`matrix-row`,children:[(0,B.jsxs)(`td`,{children:[e.roles.length>1&&(0,B.jsx)(`button`,{className:`caret`,"aria-label":`Show roles`,onClick:()=>u(t=>({...t,[e.project]:!t[e.project]})),children:l[e.project]?`▾`:`▸`}),(0,B.jsx)(`button`,{className:`link`,onClick:()=>f({project:e.project}),children:S(e.project)})]}),r.models.map(t=>(0,B.jsx)(`td`,{className:`num`,children:e.byModel[t]?Lv(e.byModel[t]):``},t)),(0,B.jsx)(`td`,{className:`num strong`,children:Lv(e.tokens)}),(0,B.jsx)(`td`,{className:`num`,children:Rv(e.cost)}),(0,B.jsx)(`td`,{className:`num muted`,children:e.subagentShare?zv(e.subagentShare):``})]}),l[e.project]&&e.roles.map(e=>(0,B.jsxs)(`tr`,{className:`matrix-sub`,children:[(0,B.jsxs)(`td`,{children:[`↳ `,e.role===`manager`?`managers`:`sessions`]}),r.models.map(t=>(0,B.jsx)(`td`,{className:`num`,children:e.byModel[t]?Lv(e.byModel[t]):``},t)),(0,B.jsx)(`td`,{className:`num`,children:Lv(e.tokens)}),(0,B.jsx)(`td`,{className:`num`,children:Rv(e.cost)}),(0,B.jsx)(`td`,{className:`num muted`,children:e.subagentShare?zv(e.subagentShare):``})]},e.role))]},e.project))})]})})]}),(0,B.jsxs)(`section`,{className:`card viz-card`,children:[(0,B.jsx)(`h3`,{children:`Recent sessions`}),(0,B.jsx)(`div`,{className:`table-scroll`,children:(0,B.jsxs)(`table`,{className:`plain`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Last call`}),(0,B.jsx)(`th`,{children:`Session`}),(0,B.jsx)(`th`,{children:`Project`}),(0,B.jsx)(`th`,{children:`Branch`}),(0,B.jsx)(`th`,{children:`Models`}),(0,B.jsx)(`th`,{className:`num`,children:`Calls`}),(0,B.jsx)(`th`,{className:`num`,children:`Tokens`}),(0,B.jsx)(`th`,{className:`num`,children:`Cost`}),(0,B.jsx)(`th`,{className:`num`,children:`Sub`})]})}),(0,B.jsx)(`tbody`,{children:r.recent.map(t=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{className:`nowrap`,children:$(t.lastAt)}),(0,B.jsx)(`td`,{children:(0,B.jsxs)(`button`,{className:`link`,onClick:()=>e(t.sessionId),children:[t.role===`manager`?`Manager · `:``,t.title]})}),(0,B.jsx)(`td`,{children:S(t.project)}),(0,B.jsx)(`td`,{className:`muted`,children:t.branch??``}),(0,B.jsx)(`td`,{className:`muted`,children:t.models.join(`, `)}),(0,B.jsx)(`td`,{className:`num`,children:t.calls}),(0,B.jsx)(`td`,{className:`num`,children:Lv(t.tokens)}),(0,B.jsx)(`td`,{className:`num`,children:Rv(t.cost)}),(0,B.jsx)(`td`,{className:`num muted`,children:t.subagentShare?zv(t.subagentShare):``})]},t.sessionId))})]})})]}),(0,B.jsx)(cw,{})]})}function Ww(e){try{return tp(localStorage.getItem(`ledung.sidebar.${e}`))}catch{return null}}function Gw(e,t){try{t==null?localStorage.removeItem(`ledung.sidebar.${e}`):localStorage.setItem(`ledung.sidebar.${e}`,String(t))}catch{}}function Kw(){let[e,t]=(0,v.useState)(()=>window.matchMedia(Qf).matches),[n,r]=(0,v.useState)({w:window.innerWidth,h:window.innerHeight}),[i,a]=(0,v.useState)(()=>({width:Ww(`width`),height:Ww(`height`)})),o=e?`height`:`width`;(0,v.useEffect)(()=>{let e=window.matchMedia(Qf),n=()=>{t(e.matches),r({w:window.innerWidth,h:window.innerHeight})};return e.addEventListener(`change`,n),window.addEventListener(`resize`,n),()=>{e.removeEventListener(`change`,n),window.removeEventListener(`resize`,n)}},[]);let{min:s,max:c,def:l}=$f(o,e?n.h:n.w),u=ep(i[o]??l,s,c);(0,v.useEffect)(()=>{document.querySelector(`.app`)?.style.setProperty(e?`--sidebar-h`:`--sidebar-w`,`${u}px`)},[u,e]);let d=e=>{Gw(o,e),a(t=>({...t,[o]:e}))};return(0,B.jsx)(`div`,{className:`sidebar-resizer ${e?`horizontal`:`vertical`}`,role:`separator`,"aria-label":`Resize the sidebar`,"aria-orientation":e?`horizontal`:`vertical`,"aria-valuenow":u,"aria-valuemin":s,"aria-valuemax":c,tabIndex:0,title:`Drag to resize, double-click to reset`,onPointerDown:e=>{e.button===0&&(e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault())},onPointerMove:t=>{if(!t.currentTarget.hasPointerCapture(t.pointerId))return;let n=t.currentTarget.parentElement.getBoundingClientRect();d(ep(e?t.clientY-n.top:t.clientX-n.left,s,c))},onDoubleClick:()=>d(null),onKeyDown:e=>{let t=np(e.key,o,u,s,c);t!=null&&(e.preventDefault(),d(t))}})}var qw=`ledung.composer.height`,Jw=.75;function Yw(e,t,n,r,i,a){return Math.ceil(Math.max(e,t*n+r+i,a))}function Xw(e,t,n){return{min:e,max:Math.max(e,Math.floor(t*Jw-n))}}function Zw(e,t,n,r,i){return ep(e+(t-n),r,i)}function Qw(e,t,n,r){return e===`ArrowUp`?ep(t+20,n,r):e===`ArrowDown`?ep(t-20,n,r):e===`Home`?n:e===`End`?r:null}function $w(e){try{return tp(e.getItem(qw))}catch{return null}}function eT(e,t){try{t==null?e.removeItem(qw):e.setItem(qw,String(t))}catch{}}function tT(){try{return localStorage}catch{return null}}function nT(){let e=(0,v.useRef)(null),t=(0,v.useRef)(null),[n,r]=(0,v.useState)(()=>{let e=tT();return e?$w(e):null}),[i,a]=(0,v.useState)(null),o=(0,v.useCallback)(()=>{let n=e.current,r=t.current,i=n?.parentElement;if(!n||!r||!i)return null;let a=getComputedStyle(n),o=parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)+parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),s=getComputedStyle(r),c=parseFloat(s.lineHeight)||parseFloat(s.fontSize)*1.2,l=n.querySelector(`.composer-buttons`)?.offsetHeight??0;return Xw(Yw(parseFloat(s.minHeight)||0,c,r.rows,parseFloat(s.paddingTop)+parseFloat(s.paddingBottom),parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),l),i.clientHeight,o)},[]);(0,v.useLayoutEffect)(()=>{let t=e.current?.parentElement;if(!t)return;let n=()=>a(o());n();let r=new ResizeObserver(n);return r.observe(t),()=>r.disconnect()},[o]);let s=n==null?null:i?ep(n,i.min,i.max):n,c=e=>{let t=tT();t&&eT(t,e),r(e)},l=(0,v.useRef)(null),u=e=>{e.button===0&&t.current&&(e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),l.current={y:e.clientY,h:t.current.offsetHeight},a(o()))},d=e=>{let t=l.current;t&&i&&e.currentTarget.hasPointerCapture(e.pointerId)&&c(Zw(t.h,t.y,e.clientY,i.min,i.max))},f=()=>{l.current=null},p=(0,B.jsx)(`div`,{className:`composer-grip`,role:`separator`,"aria-label":`Resize the message box`,"aria-orientation":`horizontal`,"aria-valuenow":s??void 0,"aria-valuemin":i?.min,"aria-valuemax":i?.max,tabIndex:0,title:`Drag up to make the message box taller, double-click to reset`,onPointerDown:u,onPointerMove:d,onPointerUp:f,onPointerCancel:f,onDoubleClick:()=>c(null),onKeyDown:e=>{let n=o();if(!n||!t.current)return;let r=Qw(e.key,t.current.offsetHeight,n.min,n.max);r!=null&&(e.preventDefault(),c(r))}});return{box:e,area:t,style:s==null?void 0:{height:s},grip:p}}function rT(e,t){let n=new Set(e.map(e=>e.id)),r=t.filter(e=>!n.has(e.id));return r.length?[...e,...r].sort((e,t)=>e.id-t.id):e}async function iT(e,t){let n=[];for(let r=e;;){let e=await t(r);n.push(...e);let i=e.at(-1)?.id??r;if(e.length<500||i<=r)return n;r=i}}function aT(e){let[t,n]=(0,v.useState)(`connecting`),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)([]),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(0),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(`you`),[w,T]=(0,v.useState)(null),[E,D]=(0,v.useState)({}),[O,k]=(0,v.useState)([]),[ee,A]=(0,v.useState)([]),[j,M]=(0,v.useState)([]),[te,N]=(0,v.useState)([]),[P,ne]=(0,v.useState)(null),[re,ie]=(0,v.useState)([]),[ae,oe]=(0,v.useState)(null),[se,ce]=(0,v.useState)(null),[le,ue]=(0,v.useState)(null),[de,fe]=(0,v.useState)([]),[pe,me]=(0,v.useState)({chats:null,newProjects:null}),[he,F]=(0,v.useState)([`full`]),[I,ge]=(0,v.useState)(null),[_e,ve]=(0,v.useState)(`Git Bash`),[ye,be]=(0,v.useState)(null),[xe,Se]=(0,v.useState)(null),[Ce,we]=(0,v.useState)([]),[Te,De]=(0,v.useState)(null),[Oe,ke]=(0,v.useState)(null),[Me,Ne]=(0,v.useState)([]),[Pe,L]=(0,v.useState)([]),[Fe,Ie]=(0,v.useState)([]),[Le,Re]=(0,v.useState)(!1),[ze,Be]=(0,v.useState)(null),Ve=(0,v.useRef)(null),He=(0,v.useRef)(e);He.current=e;let Ue=(0,v.useRef)({sessionId:null,messages:[]});Ue.current.messages=d;let We=(0,v.useCallback)(async e=>{let t=await R.messages(e);He.current===e&&(Ue.current={sessionId:e,messages:t},f(t),m(t.length>=500))},[]),Ge=(0,v.useCallback)(async e=>{let t=Ue.current,n=t.messages.at(-1);if(t.sessionId!==e||!n)return We(e);let r=await iT(n.id,t=>R.messagesAfter(e,t));He.current===e&&f(e=>rT(e,r))},[We]),Ke=(0,v.useCallback)(async()=>{let e=He.current,t=d[0];if(!e||!t)return;let n=await R.messages(e,t.id);He.current===e&&(f(e=>[...n,...e]),m(n.length>=500))},[d]);return(0,v.useEffect)(()=>{Ue.current={sessionId:null,messages:[]},f([]),m(!1),e&&We(e).catch(()=>{})},[e,We]),(0,v.useEffect)(()=>{let e=null,t=500,r=!1,a,s=()=>{n(`connecting`),e=je(`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/ws`),e.onopen=()=>{t=500,n(`open`)},e.onclose=()=>{n(`closed`),r||(a=setTimeout(s,t=Math.min(t*2,1e4)))},e.onmessage=e=>{let t=JSON.parse(e.data);switch(t.type){case`hello`:Ve.current===null?Ve.current=t.build:Ve.current!==t.build&&x(!0),Ee(t.pageKey??null),y(e=>e+1),i(!0),g(t.canRestart),C(t.userName),T(t.source??null),D(Object.fromEntries(t.questions.map(e=>[e.id,e]))),k(t.limits),A(t.usageStops??[]),M(t.macros??[]),ue(t.away??null),o(t.sessions),c(t.projects),Se(t.board??null),we(t.github??[]),F(t.profiles??[`full`]),ge(t.lockdownB??null),ve(t.bangShell??`Git Bash`),De(t.remote??null),ke(t.chats??null),Ne(t.computers??[]),L(t.newComputers??[]),Ie(t.linkPairings??[]),Re(t.throughPublicName??!1),Be(t.config??null),u(Object.fromEntries(t.permissions.map(e=>[e.id,e]))),He.current&&Ge(He.current).catch(()=>{}),R.machine().then(ce,()=>{}),R.accounts().then(e=>{fe(e.accounts),be(e.defaultIdentity),me(e.choices),N(e.signedOut??[]),ne(e.claudeProblem??null),ie(e.configFileProblems??[])},()=>{});break;case`session`:o(e=>e.findIndex(e=>e.id===t.session.id)===-1?[t.session,...e]:e.map(e=>e.id===t.session.id?t.session:e));break;case`limits`:k(t.limits);break;case`macros`:M(t.macros);break;case`usageStops`:A(t.usageStops);break;case`config`:Be(t.config);break;case`projects`:c(t.projects);break;case`accounts`:fe(t.accounts),be(t.defaultIdentity),me(t.choices),N(t.signedOut??[]),ne(t.claudeProblem??null),ie(t.configFileProblems??[]);break;case`board`:Se(t.board);break;case`github`:we(t.github);break;case`remote`:De(t.remote);break;case`newComputers`:L(t.computers);break;case`linkPairings`:Ie(t.pairings);break;case`chats`:ke(t.chats);break;case`computers`:Ne(t.computers);break;case`machine`:ce(t.machine);break;case`away`:ue(t.away);break;case`question`:D(e=>({...e,[t.question.id]:t.question}));break;case`permission`:u(e=>({...e,[t.permission.id]:t.permission}));break;case`message`:t.message.sessionId===He.current&&f(e=>e.some(e=>e.id===t.message.id)?e:[...e,t.message])}}};return s(),Ae(()=>{r||(clearTimeout(a),e&&(e.onopen=e.onclose=e.onmessage=null,e.close()),t=500,s())}),()=>{r=!0,Ae(null),clearTimeout(a),e?.close()}},[Ge]),(0,v.useEffect)(()=>{let e=!0,t=()=>R.overview().then(t=>e&&oe(t),()=>{});t();let n=setInterval(t,2e4);return()=>{e=!1,clearInterval(n)}},[]),{connection:t,loaded:r,canRestart:h,hellos:_,updated:b,userName:S,source:w,questions:E,limits:O,usageStops:ee,macros:j,signedOut:te,claudeProblem:P,accountProblems:re,overview:ae,machine:se,away:le,accounts:de,accountChoices:pe,defaultIdentity:ye,board:xe,github:Ce,remote:Te,computers:Me,newComputers:Pe,linkPairings:Fe,throughPublicName:Le,configStatus:ze,chats:Oe,profiles:he,lockdownB:I,bangShell:_e,sessions:a,projects:s,permissions:l,messages:d,hasEarlier:p,loadEarlier:Ke}}var oT=(e,t=140)=>{let n=e.split(`
106
- `).map(e=>e.trim()).find(Boolean)??``;return n.length>t?`${n.slice(0,t-1)}…`:n},sT=e=>typeof e==`string`?e:``;function cT(e){let t=e.input.questions;return oT(sT(Array.isArray(t)?t[0]?.question:void 0)||e.title||sT(e.input.command)||sT(e.input.file_path)||e.reason||``)}function lT(e,t,n){return[...e.filter(Y_).map(e=>({id:`q${e.id}`,sessionId:e.sessionId,title:`Question from ${n(e.sessionId)}`,body:oT(e.question)})),...t.filter(X_).map(e=>{let t=cT(e);return{id:`p${e.id}`,sessionId:e.sessionId,title:e.toolName===`AskUserQuestion`?`Question from ${n(e.sessionId)}`:`Permission: ${e.toolName} in ${n(e.sessionId)}`,body:e.sensitive?`Sensitive${t?`: ${t}`:``}`:t}})]}var uT={five_hour:`5-hour`,seven_day:`weekly`};function dT(e){return e.filter(e=>e.holding).map(e=>({id:`stop:${e.account}:${e.kind}:${e.resetsAt??``}`,sessionId:`settings`,title:`Usage stop reached: ${uT[e.kind]??e.kind} ${e.percent}%`,body:`New turns${e.account==="default"?``:` on account ${e.account}`} are held until you lift it in Settings${e.resetsAt?` or the window resets`:``}.`}))}function fT(e,t){let n=new Set(t.map(e=>e.id));return e?{show:t.filter(t=>!e.has(t.id)),close:[...e].filter(e=>!n.has(e)),open:n}:{show:[],close:[],open:n}}var pT=()=>window.isSecureContext&&`Notification`in window,mT=`ledung.notify`,hT=()=>{try{return localStorage.getItem(mT)===`1`}catch{return!1}};function gT(e){let t=pT(),[n,r]=(0,v.useState)(hT),[i,a]=(0,v.useState)(t?Notification.permission:`default`),o=t&&n&&i===`granted`,s=(0,v.useRef)(null),c=(0,v.useRef)(new Map),l=(0,v.useRef)(e.onOpenSession);return l.current=e.onOpenSession,(0,v.useEffect)(()=>{if(!e.loaded)return;let t=fT(s.current,[...lT(e.questions,e.permissions,t=>e.sessions.find(e=>e.id===t)?.title??`a session`),...dT(e.usageStops)]);s.current=t.open;for(let e of t.close)c.current.get(e)?.close(),c.current.delete(e);if(!(!o||!document.hidden&&document.hasFocus()))for(let e of t.show)try{let t=new Notification(e.title,{body:e.body,tag:e.id});t.onclick=()=>{window.focus(),l.current(e.sessionId),t.close()},t.onclose=()=>{c.current.get(e.id)===t&&c.current.delete(e.id)},c.current.set(e.id,t)}catch{}},[e.loaded,e.questions,e.permissions,e.sessions,e.usageStops,o]),{possible:t,on:o,denied:t&&i===`denied`,set:async e=>{if(!e){r(!1);try{localStorage.setItem(mT,`0`)}catch{}return}let t=Notification.permission===`granted`?`granted`:await Notification.requestPermission();a(t);let n=t===`granted`;r(n);try{localStorage.setItem(mT,n?`1`:`0`)}catch{}}}}function _T(e,t){return e.key!==`Enter`||e.isComposing?!1:t?e.ctrlKey||e.metaKey:!e.shiftKey}var vT=80;function yT(e,t,n){if(Math.abs(n-1)>.01)return 0;let r=Math.round(e-t);return r>=vT?r:0}var bT=new Set([`button`,`checkbox`,`color`,`file`,`hidden`,`image`,`radio`,`range`,`reset`,`submit`]);function xT(e){if(!e)return!1;if(e.isContentEditable)return!0;let t=e.tagName.toUpperCase();return e.readOnly||e.disabled?!1:t===`TEXTAREA`||t===`INPUT`&&!bT.has((e.type??`text`).toLowerCase())}var ST=400;function CT(e){let t=e.visualViewport;if(!t)return;let n=e.document,r=n.documentElement,i=0,a=()=>{let a=xT(n.activeElement)?yT(r.clientHeight,t.height,t.scale):0;a!==i&&(i=a,a?r.style.setProperty(`--kb`,`${a}px`):r.style.removeProperty(`--kb`)),a&&(e.scrollY>0||t.offsetTop>0)&&e.scrollTo(0,0)},o=()=>{e.setTimeout(a,0),e.setTimeout(a,ST)};t.addEventListener(`resize`,a),t.addEventListener(`scroll`,a),n.addEventListener(`focusin`,o),n.addEventListener(`focusout`,o),n.addEventListener(`visibilitychange`,o);for(let t of[`resize`,`orientationchange`,`focus`,`pageshow`])e.addEventListener(t,o);a()}var wT=(0,B.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,"aria-hidden":`true`,children:[(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`}),(0,B.jsx)(`path`,{d:`M1.5 8h13M8 1.5c2 2 2.6 4 2.6 6.5S10 12.5 8 14.5M8 1.5C6 3.5 5.4 5.5 5.4 8S6 12.5 8 14.5`})]});function TT(e){return(0,B.jsxs)(B.Fragment,{children:[wT,`Remote`,e&&(0,B.jsxs)(`span`,{className:`long`,children:[`\xA0`,`· `,e]})]})}function ET({frame:e,shown:t=null,onShow:n,waiting:r=0}){let{tabs:i,remote:a,here:o}=e;return i?(0,B.jsxs)(`nav`,{className:`ctabs`,"aria-label":`Computers`,children:[i.map(e=>{let i=gb(e,t,r),a=i?(0,B.jsx)(`span`,{className:`badge`,title:`${i} waiting for you on ${e.name}`,"aria-label":`${i} waiting for you`,children:i}):null,o=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`sw`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{className:`nm`,children:e.name}),a]}),s=e.here?t===null:t===e.id;return e.here?s||!n?(0,B.jsx)(`span`,{className:`ctab on`,style:pb(e),"aria-current":`page`,children:o},e.id):(0,B.jsx)(`button`,{type:`button`,className:`ctab`,style:pb(e),onClick:()=>n(null),children:o},e.id):e.url?(0,B.jsx)(`a`,{className:`ctab${s?` on`:``}`,style:pb(e),href:e.url,target:`_blank`,rel:`noopener noreferrer`,title:`${e.name}'s Ledung, ${new URL(e.url).host}`,"aria-current":s?`page`:void 0,onClick:t=>{n&&hb(t)&&(t.preventDefault(),n(e.id))},children:o},e.id):null}),(0,B.jsx)(`span`,{className:`spacer`}),a&&(0,B.jsx)(`span`,{className:`remote-tag`,role:`status`,children:TT(o?.name)})]}):a?(0,B.jsx)(`div`,{className:`remote-band`,role:`status`,children:TT(o?.name)}):null}function DT({computers:e,opened:t,shown:n,throughPublicName:r=!1,framed:i=!1}){let[a,o]=(0,v.useState)({}),[s,c]=(0,v.useState)({}),l=(0,v.useRef)({}),u=(0,v.useRef)({}),d=e.filter(e=>!e.here&&e.url&&t.includes(e.id));(0,v.useEffect)(()=>{let e=e=>{for(let t of d)ub({data:e.data,origin:e.origin,fromFrame:e.source===l.current[t.id]?.contentWindow},t.url)&&(clearTimeout(u.current[t.id]),c(e=>({...e,[t.id]:`paired`})))};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)}),(0,v.useEffect)(()=>()=>Object.values(u.current).forEach(clearTimeout),[]);let f=e=>{clearTimeout(u.current[e.id]),c(t=>({...t,[e.id]:`unknown`})),l.current[e.id]?.contentWindow?.postMessage(cb(),new URL(e.url).origin),u.current[e.id]=setTimeout(()=>c(t=>({...t,[e.id]:`not-paired`})),ib)};return d.length?(0,B.jsx)(B.Fragment,{children:d.map(e=>(0,B.jsxs)(`div`,{className:`cframe-box`,hidden:n!==e.id,children:[sb(e,r,i,s[e.id]??`unknown`)&&!a[e.id]&&(0,B.jsx)(OT,{computer:e,onCode:t=>o(n=>({...n,[e.id]:t}))}),a[e.id]?(0,B.jsx)(`iframe`,{className:`cframe`,style:pb(e),src:a[e.id],title:`${e.name}'s Ledung`,allow:`publickey-credentials-get; publickey-credentials-create`},`pairing`):(0,B.jsx)(`iframe`,{className:`cframe`,style:pb(e),src:e.url,title:`${e.name}'s Ledung`,allow:`publickey-credentials-get; publickey-credentials-create`,ref:t=>{l.current[e.id]=t},onLoad:()=>f(e)},`page`)]},e.id))}):null}function OT({computer:e,onCode:t}){let[n,r]=(0,v.useState)(`offer`),[i,a]=(0,v.useState)(null);return(0,B.jsxs)(`div`,{className:`cframe-bar`,style:pb(e),role:n===`offer`?void 0:`alertdialog`,"aria-label":`Pair through the link with ${e.name}`,children:[n===`offer`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`span`,{children:[`Not paired with `,e.name,` in this tab? It is linked with this computer.`]}),(0,B.jsx)(`button`,{type:`button`,className:`small`,onClick:()=>r(`confirm`),children:`Pair through the link`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`span`,{children:[`Pair this browser with `,(0,B.jsx)(`b`,{children:e.name}),` through the link? It can then look at `,e.name,`'s sessions, and change nothing until it sets up its passkey and logs on there with Touch ID or Windows Hello. `,e.name,` shows the pairing.`]}),(0,B.jsx)(`button`,{type:`button`,className:`small`,disabled:n===`busy`,onClick:()=>{r(`busy`),a(null),R.linkDevicePair(e.id).then(({url:e})=>t(e),e=>{a(e.message),r(`offer`)})},children:n===`busy`?`Pairing…`:`Pair`}),(0,B.jsx)(`button`,{type:`button`,className:`small`,disabled:n===`busy`,onClick:()=>r(`offer`),children:`Cancel`})]}),i&&(0,B.jsx)(`span`,{className:`restart-problem`,children:i})]})}function kT(e,t){(0,v.useEffect)(()=>{if(t)return;let n=()=>{let t=fb(location.hash);t&&(history.replaceState(history.state,``,location.pathname+location.search),e(t))};return n(),window.addEventListener(`hashchange`,n),()=>window.removeEventListener(`hashchange`,n)},[])}var AT=`Removed projects`;function jT(e,t,n){return t===AT?!n.has(e.project)&&e.project!==`~chats`:e.project===t}var MT=mb();MT&&window.addEventListener(`message`,e=>{let t=lb(e.data,e.source===window.parent);t&&window.parent.postMessage(t,e.origin)});var NT={default:`Ask`,acceptEdits:`Accept edits`,auto:`Auto`,plan:`Plan`},PT={default:`Every action that needs permission asks you.`,acceptEdits:`File edits go through; commands still ask you.`,auto:`Routine actions are approved automatically; you are asked about the rest.`,plan:`Read-only: Claude plans but changes nothing.`},FT=[`waiting`,`usage`,`overview`,`board`,`settings`,`add`,`accounts`,`chat`,`chats`],IT=e=>!!e&&!FT.includes(e)&&!e.includes(`:`);function LT(){let e=location.hash.match(/^#\/waiting\/q\/(\d+)$/);if(e)return`q:${e[1]}`;let t=qS(location.hash);if(t)return WS(t.repo,t.id);let n=location.hash.match(/^#\/(waiting|usage|overview|board|settings|add|accounts|chat|chats)$/);if(n)return n[1];let r=location.hash.match(/^#\/(settings|chats)\/([a-z]+)$/);if(r)return`${r[1]}:${r[2]}`;let i=location.hash.match(/^#\/ps\/([^/]+)\/([a-z]+)$/);if(i)return`ps:${decodeURIComponent(i[1])}/${i[2]}`;let a=location.hash.match(/^#\/(p|ps|a)\/(.+)$/);return a?`${a[1]}:${decodeURIComponent(a[2])}`:(mh(location.hash)??gh(location.hash))?.sessionId??null}function RT(e){if(!e)return``;if(FT.includes(e))return`#/${e}`;let t=GS(e);if(t)return KS(t.repo,t.id);if(e.startsWith(`q:`))return`#/waiting/q/${e.slice(2)}`;if(e.startsWith(`settings:`))return`#/settings/${e.slice(9)}`;if(e.startsWith(`chats:`))return`#/chats/${e.slice(6)}`;let n=yf(e);if(n?.project!=null&&n.group)return`#/ps/${encodeURIComponent(n.project)}/${n.group}`;let r=e.match(/^(p|ps|a):(.+)$/);return r?`#/${r[1]}/${encodeURIComponent(r[2])}`:`#/s/${e}`}var zT=()=>history.state??{},BT=()=>Number(zT().ledungDesk??0),VT=()=>zT().ledungDeskRoot===!0;function HT(e){Bm(e)&&zT().ledungDesk===void 0&&history.replaceState({...zT(),ledungDesk:0,ledungDeskRoot:!0},``)}function UT(){let e=history.state??{};return{depth:Number(e.ledungSettings??0),root:e.ledungSettingsRoot===!0}}function WT(e){IC(e)&&(history.state??{}).ledungSettings===void 0&&history.replaceState({...history.state??{},ledungSettings:1,ledungSettingsRoot:!0},``)}var GT=`ledung.waitingSidebar`;function KT(e){try{return localStorage.getItem(`ledung.technical.${e}`)===`1`}catch{return!1}}function qT(){let[e,t]=(0,v.useState)(LT()),[n,r]=(0,v.useState)(location.hash),i=aT(IT(e)?e:null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)([]);kT(e=>{c(e),u(t=>t.includes(e)?t:[...t,e])},MT),(0,v.useEffect)(()=>{HT(LT()),WT(LT());let e=()=>{HT(LT()),WT(LT()),t(LT()),r(location.hash)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let d=n=>{let i=RT(n);if(i!==location.hash){let t=Vm(e,{depth:BT(),root:VT()},n),r=LC(e,UT(),n);location.hash=i,history.replaceState({...history.state??{},ledungDesk:t.depth,ledungDeskRoot:t.root,ledungSettings:r.depth,ledungSettingsRoot:r.root,ledungFromList:e===null},``)}t(n),r(location.hash)},f=e=>{history.replaceState(history.state,``,RT(e)),t(e),r(location.hash)},p=(n,a)=>{let o=i.questions[n];if(!o)return;let s=e===`waiting`?`queue`:e?.startsWith(`q:`)?i.questions[Number(e.slice(2))]?.shots?`shots`:`question`:void 0,c=a??fh(o);location.hash=ph(c,n),history.replaceState({...history.state??{},ledungDesk:0,ledungDeskRoot:!1,ledungFrom:s},``),t(c),r(location.hash)},m=(n,a)=>{let o=e===`waiting`?`queue`:e?.startsWith(`q:`)?i.questions[Number(e.slice(2))]?.shots?`shots`:`question`:void 0;location.hash=hh(n,a),history.replaceState({...history.state??{},ledungDesk:0,ledungDeskRoot:!1,ledungFrom:o},``),t(n),r(location.hash)},h=()=>{let e=BT();e>0&&!VT()?history.go(-e):d(HC(window.matchMedia(Qf).matches))},g=()=>{`back`in VC(history.state)?history.back():d(null)},_=()=>{`back`in Hm(BT())?history.back():d(`waiting`)},y=()=>{let e=RC(UT());`back`in e?history.go(-e.back):d(null)},b=IC(e),x=(0,v.useRef)(y);x.current=y,(0,v.useEffect)(()=>{if(!b)return;let e=e=>{zC(e)&&(e.preventDefault(),x.current())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[b]),(0,v.useEffect)(()=>{let e=e=>{if(e.button!==3&&e.button!==4)return;let t=location.href,n=e.button===3;setTimeout(()=>{location.href===t&&(n?history.back():history.forward())},100)};return window.addEventListener(`mouseup`,e),()=>window.removeEventListener(`mouseup`,e)},[]);let[C,w]=(0,v.useState)(()=>{try{return localStorage.getItem(GT)===`hidden`}catch{return!1}}),T=()=>{w(!C);try{localStorage.setItem(GT,C?`shown`:`hidden`)}catch{}},E=Bm(e)&&C,D=(0,v.useMemo)(()=>Object.values(i.questions).sort((e,t)=>t.id-e.id),[i.questions]),O=(0,v.useMemo)(()=>Object.values(i.permissions),[i.permissions]),k=Z_(D,O)+i.newComputers.length+i.linkPairings.length,ee=Rx(),A=gT({loaded:i.loaded,questions:D,permissions:O,sessions:i.sessions,usageStops:i.usageStops,onOpenSession:d});(0,v.useEffect)(()=>{document.title=k?`(${k}) Project Ledung`:`Project Ledung`},[k]);let j=(0,v.useMemo)(()=>{let e={};for(let t of O)t.status===`pending`&&(e[t.sessionId]=(e[t.sessionId]??0)+1);for(let t of D)t.status===`open`&&(e[t.sessionId]=(e[t.sessionId]??0)+1);return e},[O,D]),M=i.sessions.find(t=>t.id===e)??null,te=Cf(e),N=te?.startsWith(`ps:`)?i.projects.find(e=>e.name===te.slice(3)):void 0,P=te===`ledung`?t=>(0,B.jsx)(DS,{view:e,update:t,run:oe,board:i.board,remote:i.remote,throughPublicName:i.throughPublicName,newComputers:i.newComputers,projects:i.projects,computers:i.computers,sessions:i.sessions,accounts:i.accounts,accountChoices:i.accountChoices,defaultIdentity:i.defaultIdentity,accountProblems:i.accountProblems,usageStops:i.usageStops,macros:i.macros,canRestart:i.canRestart,source:i.source,config:i.configStatus,hellos:i.hellos,notify:A,onOpen:d}):te===`add`?()=>(0,B.jsx)(Vp,{run:oe,accounts:i.accounts,defaultAccount:i.accountChoices.newProjects,profiles:i.profiles,lockdownB:i.lockdownB,onAdded:e=>d(e.managerId??`p:${e.name}`)}):te===`chats`?()=>(0,B.jsx)(Kp,{view:e,chats:i.chats,run:oe,onOpen:d}):N?()=>(0,B.jsx)(Hp,{view:e,board:i.board,projects:i.projects,project:N,run:oe,accounts:i.accounts,profiles:N.profileNames??i.profiles,lockdownB:i.lockdownB,onOpen:d,onRemoved:()=>d(null),onRenamed:f},N.name):null,[ne,re]=(0,v.useState)(()=>{try{return localStorage.getItem(`ledung.limitAccount`)}catch{return null}}),ie=jv(e,i.sessions,i.projects,ne),ae=ie.account;(0,v.useEffect)(()=>{if(ie.remember&&ie.account!==ne){re(ie.account);try{localStorage.setItem(`ledung.limitAccount`,ie.account)}catch{}}},[ie.remember,ie.account,ne]);let oe=async e=>{o(null);try{await e()}catch(e){o(e.message)}},se=(0,B.jsxs)(B.Fragment,{children:[i.updated&&(0,B.jsxs)(`div`,{className:`banner updated`,children:[(0,B.jsx)(`span`,{children:`Ledung was updated — reload`}),(0,B.jsx)(`button`,{className:`small primary`,onClick:()=>location.reload(),children:`Reload`})]}),i.away&&ly(i.away,M)&&(0,B.jsx)(oy,{away:i.away,run:oe}),ee.notice&&(0,B.jsx)(Bx,{app:ee,run:oe}),(0,B.jsx)(tS,{run:oe}),i.usageStops.filter(e=>e.holding).map(e=>(0,B.jsxs)(`div`,{className:`banner updated`,children:[(0,B.jsx)(`span`,{children:Sv(e)}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>void oe(()=>R.liftUsageStop(e.account,e.kind)),children:`Lift`}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>d(hf(`usageStop`)),children:`Settings`})]},`${e.account}:${e.kind}`)),i.claudeProblem&&(0,B.jsxs)(`div`,{className:`banner updated signin`,role:`alert`,children:[(0,B.jsx)(`span`,{children:(0,B.jsx)(_y,{text:i.claudeProblem})}),(0,B.jsx)(`button`,{className:`small primary`,onClick:()=>void oe(()=>R.checkSignIn()),children:`Check again`}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>d(hf(`claudeProblem`)),children:`Settings`})]}),i.configStatus?.problem&&(0,B.jsxs)(`div`,{className:`banner updated signin`,role:`alert`,children:[(0,B.jsxs)(`span`,{children:[`The config file was changed but not applied: `,i.configStatus.problem]}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>d(hf(`configProblem`)),children:`Settings`})]}),i.signedOut.map(e=>(0,B.jsxs)(`div`,{className:`banner updated signin`,children:[(0,B.jsx)(`span`,{children:e.help.split("`").map((e,t)=>t%2?(0,B.jsx)(`code`,{children:e},t):e)}),(0,B.jsx)(`button`,{className:`small primary`,onClick:()=>void oe(()=>R.checkSignIn()),children:`Check again`}),e.account!=="default"&&(0,B.jsx)(`button`,{className:`small`,onClick:()=>d(`settings:claude`),children:`Accounts`})]},`signin:${e.account}`)),a&&(0,B.jsxs)(`div`,{className:`banner error`,onClick:()=>o(null),children:[a,` `,(0,B.jsx)(`span`,{className:`muted`,children:`(click to dismiss)`})]})]}),ce=rb(i.computers,i.throughPublicName,MT),le=db(i.computers,s);return(0,B.jsxs)(`div`,{className:`page${ce.remote?` remote`:``}`,style:pb(ce.here),children:[(0,B.jsx)(ET,{frame:ce,shown:le,onShow:e=>{c(e),e&&!l.includes(e)&&u(t=>[...t,e])},waiting:k}),(0,B.jsx)(DT,{computers:i.computers,opened:l,shown:le,throughPublicName:i.throughPublicName,framed:MT}),(0,B.jsxs)(`div`,{className:`app ${BC(e)}${E?` no-sidebar`:``}`,hidden:le!==null,children:[e===null&&(0,B.jsx)(`div`,{className:`phone-banners`,children:se}),(0,B.jsx)(JT,{sessions:i.sessions,projects:i.projects,chats:i.chats,pending:j,waiting:k,limits:i.limits,usageStops:i.usageStops,github:i.github,stripAccount:ae,overview:i.overview,machine:i.machine,run:oe,openId:e,onOpen:d,onCloseSettings:y,profiles:i.profiles,onStart:(e,t)=>oe(async()=>d((await R.start(e,t)).id)),connection:i.connection,board:i.board}),!E&&(0,B.jsx)(Kw,{}),(0,B.jsxs)(`main`,{className:`main`,children:[se,e!==null&&!M&&(0,B.jsx)(`div`,{className:`phone-bar`,children:(0,B.jsx)(`button`,{className:`phone-back`,onClick:g,children:`← List`})}),e===`usage`||e===`overview`?(0,B.jsx)(Hw,{sessionsOpen:e===`overview`,onSessions:e=>d(e?`overview`:`usage`),sessions:i.sessions,overview:i.overview,machine:i.machine,waitingBySession:j,onOpenSession:d}):Bm(e)?(0,B.jsx)(ev,{questions:D,permissions:O,sessions:i.sessions,projects:i.projects,chats:i.chats,userName:i.userName,questionId:e?.startsWith(`q:`)?Number(e.slice(2)):null,onOpenQuestion:e=>d(e===null?`waiting`:`q:${e}`),onOpenSession:d,onGoToConversation:p,onGoToMessage:m,onClose:h,onLeaveShots:_,sidebarHidden:C,onToggleSidebar:T,newComputers:i.newComputers,linkPairings:i.linkPairings,run:oe}):e===`board`?(0,B.jsx)(iC,{board:i.board,onOpen:d,onOpenSettings:()=>d(`settings`)}):GS(e)?(0,B.jsx)(oC,{repo:GS(e).repo,id:GS(e).id,board:i.board,projects:i.projects,onOpen:d,onBack:()=>d(`board`)},e):P?(0,B.jsx)(If,{view:e,projects:i.projects,source:i.source,canRestart:i.canRestart,hellos:i.hellos,onOpen:d,children:P}):e===`chat`?(0,B.jsx)(Gp,{chats:i.chats,profiles:i.profiles,run:oe,onStarted:d}):e?.startsWith(`a:`)?(0,B.jsx)(ty,{title:S(e.slice(2)),sessions:i.sessions.filter(t=>t.archivedAt&&jT(t,e.slice(2),new Set(i.projects.map(e=>e.name)))),overview:i.overview,run:oe,onOpenSession:d},e):e?.startsWith(`p:`)&&i.projects.some(t=>t.name===e.slice(2))?(0,B.jsx)(Up,{project:i.projects.find(t=>t.name===e.slice(2)),run:oe,onStarted:d},e):M?(0,B.jsx)(YT,{session:M,ledung:i,pendingCount:j[M.id]??0,run:oe,focusQuestion:mh(n)?.questionId??null,focusMessage:gh(n)?.messageId??null,cameFrom:zT().ledungFrom??null,onOpenQuestion:e=>d(`q:${e}`),onOpenBoardThread:(e,t)=>d(WS(e,t)),onBack:g},M.id):(0,B.jsxs)(`div`,{className:`empty`,children:[(0,B.jsx)(`h1`,{children:`Project Ledung`}),(0,B.jsx)(`p`,{children:i.projects.length?`Open a project on the left to talk to its manager.`:`No projects yet. Add one to start talking to its manager.`}),(0,B.jsxs)(`div`,{className:`empty-actions`,children:[!i.projects.length&&(0,B.jsx)(`button`,{className:`primary`,onClick:()=>d(`add`),children:`Add a project`}),(0,B.jsx)(`button`,{onClick:()=>d(`chat`),children:`New chat`}),(0,B.jsx)(`button`,{onClick:()=>d(`settings`),children:`Settings`})]})]})]})]})]})}function JT(e){let t=e.sessions.filter(e=>!e.archivedAt),n=e=>t.filter(t=>t.parentId===e).sort(dC),r=new Set(e.projects.map(e=>e.name)),i=(e,t,r)=>[{s:e,depth:0,drag:t},...n(e.id).map(t=>({s:t,depth:1,drag:r?`c:${e.id}`:null}))],a=(e,n,r)=>{let a=new Set(t.filter(e).map(e=>e.id)),o=n?t.find(e=>e.id===n):void 0,s=t.filter(t=>e(t)&&t.id!==n&&(!t.parentId||!a.has(t.parentId))).sort(dC);return[...o?i(o,null,!!r):[],...s.flatMap(e=>i(e,r?`t:${r}`:null,!!r))]},o=[{name:x,project:null,rows:a(e=>e.project===x,null,x)},...e.projects.map(e=>({name:e.name,project:e,rows:a(t=>t.project===e.name,e.managerId,e.name)})),{name:AT,project:null,rows:a(e=>!r.has(e.project)&&e.project!==`~chats`,null,null)}].map(t=>({...t,archived:e.sessions.filter(e=>e.archivedAt&&jT(e,t.name,r)).length})).filter(e=>e.project||e.name===`~chats`||e.rows.length||e.archived),[s,c]=(0,v.useState)(()=>DC(localStorage)),[l,u]=(0,v.useState)(()=>kC(localStorage)),d=e=>c(t=>{let n=jC(t,e,e=>e===AT||e===`~chats`||r.has(e));return OC(localStorage,n),n}),f=e=>u(n=>{let r=jC(n,e,e=>t.some(t=>t.id===e));return AC(localStorage,r),r}),p=(e,t)=>e&&e.count>0&&(0,B.jsxs)(`span`,{className:`hidden-count${e.working?` working`:``}`,title:`${e.count} ${t} hidden${e.working?`, at least one working`:``}`,children:[e.working&&(0,B.jsx)(`span`,{className:`dot running`}),`+`,e.count]}),[m,h]=(0,v.useState)(null),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(``),S=(t,n)=>{if(n.length<=1)return e.onStart(t);b(``),h(m===t?null:t)},{nav:C,drag:w,handlers:T}=bC((t,n)=>void e.run(()=>t===`projects`?R.orderProjects(n):R.orderSessions(n))),E=e=>{if(!w||w.slot===null||w.group===`projects`)return null;let t=e.filter(e=>e.drag===w.group);return t.length?w.slot<t.length?{before:t[w.slot].s.id}:{after:w.group.startsWith(`t:`)?e[e.length-1].s.id:t[t.length-1].s.id}:null},D=o.filter(e=>e.project).map(e=>e.name),O=w?.group===`projects`&&w.slot!==null?w.slot<D.length?{before:D[w.slot]}:{after:D[D.length-1]}:null,k=(0,B.jsx)(`div`,{className:`drop-marker${w?.group.startsWith(`c:`)?` child`:``}`,"aria-hidden":`true`}),[ee]=qb(),[A]=ox(),j=$b(A),[M]=gx(),te=({s:t,depth:n,drag:r,hidden:i,folds:a,folded:o})=>{let s=`${$(t.createdAt)}${t.backgroundTasks>0?` · ${t.backgroundTasks} in background`:``}`,c=(()=>{let n=e.overview?.sessions[t.id]?.today??0,r=t.role===`manager`?e.sessions.filter(e=>e.parentId===t.id).reduce((t,n)=>t+(e.overview?.sessions[n.id]?.today??0),n):n,i=dw(t),a=t.status===`ended`?void 0:e.machine?.sessions[t.id],o=e.machine?.line.indexOf(t.id)??-1;return[t.project===`~chats`&&t.workDir?`in ${t.workDir.split(/[\\/]/).filter(Boolean).pop()}`:``,o>=0?`number ${o+1} in line`:``,t.paused?`paused`:``,t.priority===`normal`?``:rw[t.priority].toLowerCase(),a&&(a.cores>=.05||a.memBytes>0)?`${ew(a.cores)} · ${tw(a.memBytes)}`:``,r?`${Lv(r)}${t.role===`manager`&&r!==n?` team`:``} today`:``,i!=null&&t.status!==`ended`?`ctx ${zv(i)}`:``,t.pr?Bv(t.pr):t.branch??``].filter(Boolean).join(` · `)})();return(0,B.jsxs)(`div`,{className:`session-row`,children:[a&&(0,B.jsx)(`button`,{className:`fold-caret session-caret`,"aria-expanded":!o,"aria-label":`${o?`Unfold`:`Fold`} the sessions of ${t.title}`,title:o?`Show the sessions it runs`:`Fold the sessions it runs away`,onClick:()=>f(t.id),children:o?`▸`:`▾`}),g===t.id?(0,B.jsx)(`div`,{className:`session-item renaming${t.id===e.openId?` open`:``}${n?` child`:``}`,children:(0,B.jsx)(uC,{value:t.title,label:`New name for ${t.title}`,onDone:()=>_(null),onSave:n=>e.run(()=>R.rename(t.id,n))})}):(0,B.jsxs)(`button`,{className:`session-item${t.id===e.openId?` open`:``}${n?` child`:``}${w?.id===t.id?` dragging`:``}${Vb(ee,t).ended?` ended-row`:``}`,title:ex(A,Vb(ee,t).tooltip,s,c),onClick:()=>e.onOpen(t.id),onDoubleClick:()=>_(t.id),"data-drag":r??void 0,"data-drag-id":r?t.id:void 0,children:[Vb(ee,t).dot&&(0,B.jsx)(`span`,{className:`dot ${Lb(t)}`,title:Ib[t.status]}),(0,B.jsxs)(`span`,{className:`session-text`,children:[(0,B.jsxs)(`span`,{className:`session-title`,children:[t.role===`manager`&&(0,B.jsx)(`span`,{className:`chip`,children:`Manager`}),` `,(0,B.jsx)(cf,{colour:df(t,T_(e.projects,e.chats)),children:t.title})]}),j.time&&(0,B.jsx)(`span`,{className:`session-sub`,children:s}),j.usage&&c&&(0,B.jsx)(`span`,{className:`session-sub usage-line`,children:c})]}),(()=>{let n=wg(t,e.sessions);return n&&(0,B.jsx)(`span`,{className:`session-ship ${Lb(t)}`,children:(0,B.jsx)(Ng,{mode:n,width:10,sizeButton:!1,hideWhenSunk:!0,maxSize:j.shipMax})})})(),p(i,i?.count===1?`sub-session`:`sub-sessions`),(e.pending[t.id]??0)+(i?.pending??0)?(0,B.jsx)(`span`,{className:`badge`,children:(e.pending[t.id]??0)+(i?.pending??0)}):null]})]})},N=Fe(e.connection);return(0,B.jsxs)(`aside`,{className:`sidebar`,children:[(0,B.jsx)($v,{account:e.stripAccount,limits:e.limits,stops:e.usageStops,run:e.run}),NC(e.github,Date.now()).map(e=>(0,B.jsx)(`div`,{className:`github-budget muted ${PC(e)}`,title:`What is left of the GitHub budget Ledung's pull request checks use (the worst of GitHub's readings). Under 20 % left they run every 10 minutes, under 5 % not until the reset.`,children:MC(e,e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}))},`${e.container??``} ${e.host}`)),(0,B.jsx)(aw,{machine:e.machine,sessions:e.sessions,onOpen:e.onOpen,run:e.run}),(0,B.jsxs)(`button`,{className:`waiting-entry${Bm(e.openId)?` open`:``}${e.waiting?` has-items`:``}`,onClick:()=>e.onOpen(`waiting`),children:[(0,B.jsx)(`span`,{children:`Waiting for you`}),e.waiting?(0,B.jsx)(`span`,{className:`badge`,children:e.waiting}):(0,B.jsx)(`span`,{className:`muted`,children:`nothing`})]}),(0,B.jsxs)(`nav`,{className:`session-list`,"data-compact":A>1?A:void 0,ref:C,...T,children:[!e.projects.length&&(0,B.jsx)(`p`,{className:`muted project-empty`,children:`No projects yet. Add one in Settings (⚙ below).`}),o.map(t=>({...t,isFolded:s.includes(t.name),view:wC(t.rows,{foldedSessions:l,folded:s.includes(t.name),openId:e.openId,pending:e.pending})})).map(t=>(0,B.jsxs)(v.Fragment,{children:[O?.before===t.name&&k,(0,B.jsx)(`div`,{className:`project-group${w?.group===`projects`&&w.id===t.name?` dragging`:``}`,children:(0,B.jsxs)(Kd,{level:Bd(t.project),children:[(0,B.jsxs)(`div`,{className:`project-row`,children:[(0,B.jsx)(`button`,{className:`fold-caret`,"aria-expanded":!t.isFolded,"aria-label":`${t.isFolded?`Unfold`:`Fold`} ${t.name}`,title:t.isFolded?`Show its sessions`:`Fold its sessions away`,onClick:()=>d(t.name),children:t.isFolded?`▸`:`▾`}),t.project?(0,B.jsx)(`button`,{className:`project-name${e.openId===`p:${t.name}`||t.project.managerId&&e.openId===t.project.managerId?` open`:``}`,title:`${t.project.where}${t.project.managerId?``:` · manager not started yet`}`,onClick:()=>e.onOpen(t.project.managerId??`p:${t.name}`),"data-drag":`projects`,"data-drag-id":t.name,children:(()=>{let e=Nv(t.project.account),n=(0,B.jsx)(cf,{colour:t.project.colours.manager,children:t.name});return e?(0,B.jsxs)(`span`,{className:`project-name-stack`,children:[(0,B.jsx)(`span`,{className:`project-account`,title:`Runs on the Claude account ${e}`,children:e}),(0,B.jsx)(`span`,{className:`project-name-text`,children:n})]}):n})()}):t.name===`~chats`?(0,B.jsx)(`button`,{className:`project-name${e.openId===`chat`?` open`:``}`,title:`Sessions of your own with no project, workflow or manager`,onClick:()=>e.onOpen(`chat`),children:(0,B.jsx)(cf,{colour:e.chats?.colour??null,children:`Chats`})}):(0,B.jsx)(`span`,{className:`project-name muted`,children:t.name}),p(t.view.project,t.view.project?.count===1?`session`:`sessions`),t.view.project?.pending?(0,B.jsx)(`span`,{className:`badge`,children:t.view.project.pending}):null,t.name===`~chats`&&(0,B.jsxs)(`span`,{className:`project-actions`,children:[j.plusOnly?(0,B.jsx)(`button`,{className:`mini`,title:`New chat`,"aria-label":`New chat`,onClick:()=>e.onOpen(`chat`),children:`+`}):(0,B.jsx)(`button`,{className:`small`,title:`A Claude Code session of your own, with no project`,onClick:()=>e.onOpen(`chat`),children:`+ Chat`}),(0,B.jsx)(`button`,{className:`${j.plusOnly?`mini cog`:`small`}${Cf(e.openId)===`chats`?` on`:``}`,title:`Chats settings`,"aria-label":`Settings of chats`,onClick:()=>e.onOpen(`chats`),children:`⚙`})]}),t.project&&(0,B.jsxs)(`span`,{className:`project-actions`,children:[j.plusOnly?(0,B.jsx)(`button`,{className:`mini`,title:`New session in ${t.name}`,"aria-label":`New session in ${t.name}`,onClick:()=>S(t.name,t.project?.profileNames??e.profiles),children:`+`}):(0,B.jsx)(`button`,{className:`small`,title:`A session of your own in this project, outside its manager`,onClick:()=>S(t.name,t.project?.profileNames??e.profiles),children:`+ Session`}),(0,B.jsx)(`button`,{className:`${j.plusOnly?`mini cog`:`small`}${Cf(e.openId)===`ps:${t.name}`?` on`:``}`,title:`Project settings`,"aria-label":`Settings of ${t.name}`,onClick:()=>e.onOpen(`ps:${t.name}`),children:`⚙`})]})]}),t.project&&m===t.name&&(0,B.jsxs)(`div`,{className:`start-row`,children:[(0,B.jsxs)(`select`,{"aria-label":`Profile for a new session in ${t.name}`,value:y,onChange:e=>b(e.target.value),title:`Its session profile: what it gets of your own plugins, MCP servers, tools and settings`,children:[(0,B.jsx)(`option`,{value:``,children:t.project.profiles.session?`Project's: ${t.project.profiles.session}`:`Project's profile`}),(t.project.profileNames??e.profiles).map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))]}),(0,B.jsx)(`button`,{className:`small primary`,onClick:()=>{h(null),e.onStart(t.name,y||void 0)},children:`Start`}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>h(null),children:`Cancel`})]}),(()=>{let e=E(t.view.rows);return t.view.rows.map(t=>(0,B.jsxs)(v.Fragment,{children:[e?.before===t.s.id&&k,te(t),e?.after===t.s.id&&k]},t.s.id))})(),ux(M,t.archived,t.isFolded)&&(0,B.jsxs)(`button`,{className:`archived-link${e.openId===`a:${t.name}`?` open`:``}`,onClick:()=>e.onOpen(`a:${t.name}`),children:[`Archived (`,t.archived,`)`]})]})}),O?.after===t.name&&k]},t.name))]}),(0,B.jsxs)(`div`,{className:`connection ${e.connection}`,children:[(0,B.jsx)(`button`,{className:`icon settings-cog${IC(e.openId)?` on`:``}`,title:IC(e.openId)?`Close settings (Esc)`:`Settings: accounts, restart Ledung, add a project`,"aria-label":IC(e.openId)?`Close settings`:`Settings`,"aria-pressed":IC(e.openId),onClick:()=>IC(e.openId)?e.onCloseSettings():e.onOpen(`settings`),children:`⚙`}),(0,B.jsxs)(`span`,{className:`footer-chips`,children:[(0,B.jsxs)(`button`,{className:`board-chip usage-chip${Ie(e.board)?``:` ${N.className}`}${e.openId===`usage`||e.openId===`overview`?` on`:``}`,title:`${Ie(e.board)?``:`${N.text} `}Usage: tokens per day, project and model, shared usage, and every live session`,"aria-pressed":e.openId===`usage`||e.openId===`overview`,onClick:()=>e.onOpen(`usage`),children:[`Usage`,e.overview?` · ${Lv(e.overview.todayTokens)} today`:``]}),(0,B.jsx)(ut,{board:e.board,open:e.openId===`board`||!!GS(e.openId),connection:N,onClick:()=>e.onOpen(`board`)})]})]})]})}function YT(e){let{session:t,ledung:n,run:r}=e,[i,a]=(0,v.useState)(()=>KT(t.id)),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1);(0,v.useEffect)(()=>p(!1),[t.id]);let m=(0,v.useRef)(null),h=(0,v.useCallback)((e,t,n)=>{let r=n.length>2e3?`${n.slice(0,2e3)}…`:n;m.current?.(`> ${e}, ${$(t)}:\n${r.split(`
107
- `).map(e=>`> ${e}`).join(`
108
- `)}\n\n`)},[]),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(null),x=(0,v.useCallback)(e=>{l(!1),_(!1),b(null),s(t=>[...t,e])},[]),S=(0,v.useMemo)(()=>Object.values(n.questions),[n.questions]),C=()=>{l(!1),s([]),b(null),_(e=>!e)},w=t.status===`ended`,T=JC(t),E=Bd(n.projects.find(e=>e.name===t.project)),D=(0,v.useMemo)(()=>E_(t,T_(n.projects,n.chats)),[t.project,t.role,n.projects,n.chats]),O=(0,v.useCallback)(()=>r(n.loadEarlier),[n.loadEarlier]),k=(0,v.useCallback)(e=>n.sessions.find(t=>t.id===e)?.title??`unknown`,[n.sessions]),ee=qC(e.onOpenQuestion),A=n.board?.projects[t.project]?.repo,j=qC(t=>e.onOpenBoardThread(A,t)),M=()=>{a(e=>{try{localStorage.setItem(`ledung.technical.${t.id}`,e?`0`:`1`)}catch{}return!e})},te=!(t.status===`stopping`||t.status===`ended`&&!t.claudeSessionId),N=(0,v.useMemo)(()=>te?pS(n.macros??[],t.project):[],[n.macros,t.project,te]),P=qC((e,n)=>{let i=hS(e.text,t);gS(e,i,n)===`send`?r(()=>R.send(t.id,i.text)):m.current?.(i.text)});return(0,v.useEffect)(()=>{let e=N.filter(e=>e.key);if(!e.length)return;let t=t=>{if(t.repeat||t.isComposing||t.defaultPrevented)return;let n=cS(t),r=n&&e.find(e=>e.key===n);r&&(t.preventDefault(),P(r,!1))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[N]),(0,v.useEffect)(()=>{let e=e=>{QC(e)&&(e.preventDefault(),M())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t.id]),(0,B.jsxs)(Kd,{level:E,fill:!0,children:[(0,B.jsxs)(`header`,{className:`session-head${u?` details`:``}`,children:[(0,B.jsx)(`button`,{className:`phone-back`,"aria-label":`Back to the list`,title:`Back to the list`,onClick:e.onBack,children:`←`}),(0,B.jsxs)(`div`,{className:`session-head-text`,onClick:e=>{e.target.closest(`a, button`)||d(e=>!e)},children:[(0,B.jsxs)(`h2`,{children:[(0,B.jsx)(`span`,{className:`dot ${Lb(t)} phone-dot`,title:Ib[t.status]}),t.role===`manager`&&(0,B.jsx)(`span`,{className:`chip`,children:`Manager`}),` `,f?(0,B.jsx)(uC,{value:t.title,label:`New name for ${t.title}`,onDone:()=>p(!1),onSave:e=>r(()=>R.rename(t.id,e))}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(cf,{colour:df(t,T_(n.projects,n.chats)),children:t.title}),(0,B.jsx)(`button`,{className:`icon rename`,title:`Rename`,"aria-label":`Rename ${t.title}`,onClick:()=>p(!0),children:`✎`})]})]}),t.parentId&&(0,B.jsxs)(`div`,{className:`muted started-by`,children:[`Started by`,` `,(0,B.jsx)(`button`,{className:`link`,onClick:()=>location.hash=`#/s/${t.parentId}`,children:n.sessions.find(e=>e.id===t.parentId)?.title??`a manager`})]}),(0,B.jsxs)(`div`,{className:`muted`,children:[(0,B.jsx)(`span`,{className:`dot ${Lb(t)}`}),` `,Ib[t.status],t.status===`queued`&&n.machine&&n.machine.line.includes(t.id)?`: number ${n.machine.line.indexOf(t.id)+1} in line`:``,t.paused?` · Paused`:``,t.priority===`normal`?null:(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(`span`,{className:`chip prio-${t.priority}`,title:t.priorityNote??void 0,children:rw[t.priority]})]}),n.machine?.sessions[t.id]&&!w?` · ${ew(n.machine.sessions[t.id].cores)} · ${tw(n.machine.sessions[t.id].memBytes)}`:``,t.status===`ended`&&t.endReason?` · ${t.endReason}`:``,` · `,t.project===`~chats`?`Chat`:t.project,E?(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsxs)(`span`,{className:`chip lock ${E.toLowerCase()}`,title:Rd[E],children:[`Lockdown `,E]})]}):null,t.workDir?(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsxs)(`span`,{className:`mono`,title:t.project===`~chats`?`Works in ${t.workDir}`:`Works in ${t.workDir}, not the project folder`,children:[`in `,t.workDir.split(/[\\/]/).filter(Boolean).pop()]})]}):null,t.account?(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(`span`,{className:`chip`,title:`The Claude account this session runs under`,children:t.account})]}):null,t.model?` · ${t.model}`:``,t.profile&&t.profile!==`full`?(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(`span`,{className:`chip`,title:`Its session profile: what it gets of your own plugins, MCP servers and tools`,children:t.profile})]}):null,t.backgroundTasks>0?` · ${t.backgroundTasks} background task(s)`:``,t.branch?(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(`span`,{className:`mono`,children:t.branch})]}):null,t.pr?(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(`a`,{href:t.pr.url,target:`_blank`,rel:`noreferrer noopener`,title:`${t.pr.title} — checks ${t.pr.checks}`,children:Bv(t.pr)})]}):null,t.tickets.map(e=>(0,B.jsxs)(`span`,{children:[` · `,(0,B.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:e.id})]},e.id)),t.remoteControl?(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(tE,{rc:t.remoteControl})]}):null]})]}),(0,B.jsx)(XT,{before:(0,B.jsx)(`button`,{className:`small files-toggle${g?` on`:``}`,"aria-pressed":g,title:`This session's files and what it changed (a test feature)`,onClick:C,children:`Files`}),session:t,project:n.projects.find(e=>e.name===t.project)??null,away:n.away,run:r,showTechnical:i,onToggleTechnical:M,usage:n.overview?.sessions[t.id]?.total??null,showUsage:c,onToggleUsage:()=>{s([]),_(!1),b(null),l(e=>!e)}}),T.header.length>0&&(0,B.jsxs)(`div`,{className:`session-actions`,children:[T.header.includes(`startNow`)&&(0,B.jsx)(`button`,{className:`primary`,title:`Start this turn now, above the limit on working sessions`,onClick:()=>r(()=>R.startNow(t.id)),children:`Start now`}),T.header.includes(`clear`)&&(0,B.jsx)($T,{due:t.clearDue,onCancel:()=>r(()=>R.cancelClear(t.id))}),T.header.includes(`compacting`)&&(0,B.jsx)(eE,{compacting:t.compacting,by:t.compacting.requester===t.id?`the session itself`:`manager "${n.sessions.find(e=>e.id===t.compacting.requester)?.title??`a manager`}"`}),T.header.includes(`resume`)&&(0,B.jsx)(`button`,{className:`primary`,onClick:()=>r(()=>R.resume(t.id)),children:`Resume`}),T.header.includes(`archive`)&&(t.archivedAt?(0,B.jsx)(`button`,{title:`Back into the sidebar, still ended`,onClick:()=>r(()=>R.unarchive(t.id)),children:`Unarchive`}):(0,B.jsx)(`button`,{title:`Out of the sidebar, listed under the project's Archived; nothing is deleted`,onClick:()=>r(()=>R.archive(t.id)),children:`Archive`}))]})]}),e.cameFrom&&(0,B.jsxs)(`div`,{className:`came-from`,children:[(0,B.jsxs)(`button`,{className:`small`,onClick:()=>history.back(),children:[`← Back to `,e.cameFrom===`question`?`the question`:e.cameFrom===`shots`?`the screenshots`:`the queue`]}),(0,B.jsx)(`span`,{className:`muted`,children:`You came from Waiting for you; the browser's Back goes there too.`})]}),(0,B.jsxs)(`div`,{className:`session-body`,children:[(0,B.jsxs)(`div`,{className:`chat-column`,children:[(0,B.jsx)(wh,{messages:n.messages,permissions:n.permissions,showTechnical:i,hasEarlier:n.hasEarlier,onLoadEarlier:O,onOpenFile:x,questions:n.questions,userName:n.userName,onQuote:h,titleOf:k,sessionId:t.id,focusQuestion:e.focusQuestion,focusMessage:e.focusMessage??null,onOpenQuestion:ee,onOpenBoardThread:A?j:void 0,tint:D}),(0,B.jsx)(Lg,{session:t,sessions:n.sessions,messages:n.messages,extra:(0,B.jsx)(xS,{macros:N,onUse:P,onEdit:()=>location.hash=`#/settings/macros`},t.id)},t.id),(0,B.jsx)(QT,{session:t,tint:D,run:r,quoteInto:m,bangShell:n.bangShell})]}),c&&(0,B.jsx)(pw,{sessionId:t.id,onClose:()=>l(!1)}),o.length>0&&(0,B.jsx)(t_,{sessionId:t.id,stack:o,onOpen:x,onBack:()=>s(e=>e.slice(0,-1)),onClose:()=>s([])}),g&&(0,B.jsx)(h_,{session:t,sessions:n.sessions,questions:S,userName:n.userName,hidden:y!==null,onOpenFile:(e,t)=>b({stack:[e],folder:t}),onOpenQuestion:e.onOpenQuestion,onClose:()=>_(!1)}),g&&y&&(0,B.jsx)(t_,{sessionId:t.id,stack:y.stack,folder:y.folder,backToPane:!0,onOpen:e=>b(t=>t&&{...t,stack:[...t.stack,e]}),onBack:()=>b(e=>e&&e.stack.length>1?{...e,stack:e.stack.slice(0,-1)}:null),onClose:()=>{b(null),_(!1)}})]})]})}function XT(e){let{session:t,run:n}=e,[r,i]=(0,v.useState)(!1),a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=JC(t).menu,l=t.status===`ended`,u=e=>()=>{i(!1),e()};return(0,v.useEffect)(()=>{if(!r)return;o.current?.querySelector(`select:not(:disabled), input, button`)?.focus();let e=e=>{a.current?.contains(e.target)||i(!1)},t=e=>{$C(e)&&(e.preventDefault(),i(!1),s.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t,!0),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t,!0)}},[r]),(0,B.jsxs)(`div`,{className:`session-corner`,ref:a,children:[e.before,t.role===`manager`&&e.away&&(0,B.jsx)(ay,{away:e.away,onClick:()=>i(!0)}),(0,B.jsx)(`button`,{ref:s,className:`icon settings-cog${r?` on`:``}`,title:`Session settings: ${t.role===`manager`?`away, `:``}permissions, tool calls, usage, pause and stop`,"aria-label":`Session settings`,"aria-haspopup":`dialog`,"aria-expanded":r,"aria-controls":r?`session-menu`:void 0,onClick:()=>i(!r),children:`⚙`}),r&&(0,B.jsxs)(`div`,{className:`session-menu`,id:`session-menu`,role:`dialog`,"aria-label":`Session settings`,ref:o,children:[c.includes(`away`)&&(0,B.jsxs)(`div`,{className:`menu-row away-row`,children:[(0,B.jsx)(`span`,{className:`menu-label`,children:`Away`}),(0,B.jsx)(cy,{away:e.away,run:n})]}),c.includes(`permissions`)&&(0,B.jsxs)(`label`,{className:`mode menu-row`,title:PT[t.permissionMode],children:[(0,B.jsx)(`span`,{className:`menu-label`,children:`Permissions`}),(0,B.jsx)(`select`,{value:t.permissionMode,disabled:l||t.status===`stopping`,onChange:e=>n(()=>R.setPermissionMode(t.id,e.target.value)),children:b.map(e=>(0,B.jsx)(`option`,{value:e,title:PT[e],children:NT[e]},e))})]}),c.includes(`priority`)&&(0,B.jsxs)(`label`,{className:`mode menu-row`,title:t.priorityNote??`Who goes first when sessions wait for a free place`,children:[(0,B.jsx)(`span`,{className:`menu-label`,children:`Priority`}),(0,B.jsx)(`select`,{value:t.priority,disabled:l,onChange:e=>n(()=>R.setPriority(t.id,e.target.value)),children:C.map(e=>(0,B.jsx)(`option`,{value:e,children:rw[e]},e))})]}),c.includes(`toolCalls`)&&(0,B.jsxs)(`label`,{className:`toggle menu-row`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:e.showTechnical,onChange:e.onToggleTechnical}),` Show tool calls`,(0,B.jsx)(`kbd`,{title:`Works anywhere on this page, the message box included`,children:`Ctrl+O`})]}),c.includes(`usage`)&&(0,B.jsxs)(`button`,{className:`menu-row${e.showUsage?` on`:``}`,onClick:u(e.onToggleUsage),children:[`Usage`,e.usage==null?``:` · ${Lv(e.usage)}`]}),(c.includes(`pause`)||c.includes(`stop`))&&(0,B.jsxs)(`div`,{className:`menu-row menu-buttons`,children:[c.includes(`pause`)&&(0,B.jsx)(`button`,{title:t.paused?`Let it go on`:`The command running now finishes; the next tool call waits, and no new turn starts`,onClick:u(()=>void n(()=>R.setPaused(t.id,!t.paused))),children:t.paused?`Resume`:`Pause`}),c.includes(`stop`)&&(0,B.jsx)(`button`,{onClick:u(()=>void n(()=>R.stop(t.id))),children:`Stop`})]}),YC(t)&&(0,B.jsx)(ZT,{sessionId:t.id}),c.includes(`version`)&&(0,B.jsxs)(`div`,{className:`menu-row menu-info`,children:[(0,B.jsx)(`span`,{className:`menu-label`,children:`Claude Code`}),(0,B.jsx)(`span`,{className:`mono`,children:t.claudeVersion})]})]})]})}function ZT({sessionId:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null);(0,v.useEffect)(()=>{let t=!0;return R.mcpServers(e).then(e=>t&&n(e),e=>t&&i(e.message)),()=>{t=!1}},[e]);let s=async t=>{o(t),i(null);try{n(await R.reconnectMcp(e,t))}catch(e){i(e.message)}finally{o(null)}};return(0,B.jsxs)(`div`,{className:`menu-row mcp-row`,children:[(0,B.jsx)(`span`,{className:`menu-label`,children:`MCP servers`}),t===null&&!r&&(0,B.jsx)(`span`,{className:`muted`,children:`Asking Claude Code…`}),t?.length===0&&(0,B.jsx)(`span`,{className:`muted`,children:`None.`}),!!t?.length&&(0,B.jsx)(`ul`,{className:`mcp-servers`,children:t.map(e=>(0,B.jsxs)(`li`,{title:[e.version,e.tools?`${e.tools} tool${e.tools===1?``:`s`}`:``,e.error].filter(Boolean).join(` · `)||void 0,children:[(0,B.jsx)(`span`,{className:`dot mcp-${e.status}`}),(0,B.jsx)(`span`,{className:`mono`,children:e.name}),(0,B.jsx)(`span`,{className:`muted`,children:XC[e.status]??e.status}),e.canReconnect?(0,B.jsx)(`button`,{className:`small`,disabled:a!==null,onClick:()=>void s(e.name),children:a===e.name?`Reconnecting…`:`Reconnect`}):(0,B.jsx)(`span`,{className:`muted`,title:`Ledung's own tool server, inside Ledung`,children:`Ledung's`})]},e.name))}),r&&(0,B.jsx)(`span`,{className:`error`,children:r})]})}function QT({session:e,tint:t,run:n,quoteInto:r,bangShell:i}){let a=z(),[o,s]=KC(e.id),c=e.status===`ended`&&!!e.claudeSessionId,l=e.status===`ended`&&!c||e.status===`stopping`,u=ZC(e),{box:d,area:f,style:p,grip:m}=nT();(0,v.useEffect)(()=>(r.current=e=>{s(t=>t.trim()?`${t.trimEnd()}\n\n${e}`:e),f.current?.focus()},()=>{r.current=null}),[]),(0,v.useEffect)(()=>{e.project===`~chats`&&e.title===`New chat`&&!e.claudeSessionId&&f.current?.focus()},[e.id]);let[h,g]=(0,v.useState)(null),_=Jp(o),y=async(t,r)=>{let i=o;s(``),g(null),await n(async()=>{try{await R.shell(e.id,t,r)}catch(e){throw s(i),e}})},b=async()=>{let t=o;t.trim()&&(_?await n(async()=>{let t=await R.shellCheck(e.id,_);if(t.refused)throw Error(t.refused);t.rule?g({command:_,rule:t.rule}):await y(_,!1)}):(s(``),await n(async()=>{try{await R.send(e.id,t)}catch(e){throw s(t),e}})))};return(0,B.jsxs)(`div`,{className:`composer${t?` tinted`:``}`,style:t,ref:d,children:[m,(e.shell||h||_)&&(0,B.jsxs)(`div`,{className:`bang-strips`,children:[e.shell&&(0,B.jsxs)(`div`,{className:`bang-running`,role:`status`,children:[(0,B.jsxs)(`span`,{children:[`Running `,(0,B.jsxs)(`code`,{children:[`!`,e.shell.command]}),`…`]}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>void n(()=>R.shellStop(e.id)),children:`Stop`})]}),h&&(0,B.jsxs)(`div`,{className:`bang-ask`,role:`alert`,children:[(0,B.jsx)(`span`,{children:Yp(h.rule)}),(0,B.jsx)(`button`,{className:`small primary`,onClick:()=>void y(h.command,!0),children:`Run`}),(0,B.jsx)(`button`,{className:`small`,onClick:()=>g(null),children:`Cancel`})]}),_&&!h&&(0,B.jsx)(`div`,{className:`bang-hint muted`,children:Xp(i,e.runner)})]}),(0,B.jsx)(`textarea`,{...a,ref:f,style:p,value:o,disabled:l,placeholder:l?`This session has ended.`:c?`This session has ended; sending a message resumes it.`:eh()?`Message Claude`:`Message Claude (Enter to send, Shift+Enter for a new line)`,onChange:e=>{s(e.target.value),g(null)},onKeyDown:e=>{_T({key:e.key,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,isComposing:e.nativeEvent.isComposing},eh())&&(e.preventDefault(),b())},rows:3}),(0,B.jsxs)(`div`,{className:`composer-buttons`,children:[(0,B.jsx)(`button`,{className:`stop-sign`,"aria-label":`Interrupt`,title:u?`Interrupt`:`Interrupt: nothing to interrupt now`,disabled:!u,onClick:()=>void n(()=>R.interrupt(e.id)),children:`STOP`}),(0,B.jsx)(`button`,{className:`primary`,disabled:l||!o.trim()||!!_&&!!e.shell,onClick:()=>void b(),children:_?`Run`:`Send`})]})]})}function $T({due:e,onCancel:t}){let[n,r]=(0,v.useState)(Date.now());(0,v.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),500);return()=>clearInterval(e)},[]);let i=Math.max(0,Math.ceil((e-n)/1e3));return(0,B.jsxs)(`span`,{className:`clear-countdown`,role:`status`,children:[i>0?`Clearing the conversation in ${i} s`:`Clearing the conversation…`,` `,(0,B.jsx)(`button`,{className:`primary`,title:`Keep the conversation; whoever asked for the clear is told`,onClick:t,children:`Cancel clear`})]})}function eE({compacting:e,by:t}){let[n,r]=(0,v.useState)(Date.now());(0,v.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(e)},[]);let i=Math.max(0,Math.floor((n-e.startedAt)/1e3)),a=`${Math.floor(i/60)}:${String(i%60).padStart(2,`0`)}`,o=`Compact requested by ${t}${e.note?`. Note for the summary: ${e.note}`:``}`;return(0,B.jsxs)(`span`,{className:`compacting`,role:`status`,title:o,children:[`Compacting… `,a,e.note&&(0,B.jsxs)(`span`,{className:`compacting-note`,children:[`Note from `,t,`: `,e.note]})]})}function tE({rc:e}){if(e.state===`unavailable`)return(0,B.jsx)(`span`,{title:e.error??void 0,children:`Remote Control unavailable`});if(!e.url)return(0,B.jsx)(`span`,{children:`Remote Control starting…`});let t=e.bridge?` (bridge ${e.bridge})`:``;return(0,B.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,title:`Remote Control on${t}: this manager in the Claude app or on claude.ai`,children:`Remote Control`})}var nE=e=>e?.name===`NotAllowedError`?Error(ye):e;function rE(e){return e.failed?{title:e.failed===`The passkey check was cancelled.`?`The passkey check was cancelled`:`The passkey check didn't go through`,body:[...e.failed===`The passkey check was cancelled.`?[]:[e.failed],`Nothing was changed. Try again to get the Face ID or fingerprint prompt back.`],go:`Try again`}:e.kind===`unlock`?{title:`Unlock this device`,body:[`This device is locked. Next comes a Face ID, fingerprint, Touch ID or Windows Hello check that unlocks it for changes: for 30 minutes on a phone; a computer stays logged on until you log out.`,`A sensitive permission is also signed on its own, so then a second check follows straight after the first.`],go:`Continue`}:{title:`Sign with your passkey`,body:[`Sensitive permissions are signed one by one: next comes a Face ID or fingerprint check for this one.`,`When this device is locked it asks twice: first to unlock it, then to sign.`],go:`Continue`}}var iE=e=>{let t=``;for(let n of new Uint8Array(e))t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)},aE=e=>{let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`)+`=`.repeat((4-e.length%4)%4)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n};async function oE(e){let t=await navigator.credentials.get({publicKey:{challenge:aE(e.challenge),rpId:e.rpId,timeout:e.timeout,userVerification:`required`,allowCredentials:(e.allowCredentials??[]).map(e=>({type:`public-key`,id:aE(e.id)}))}}).catch(e=>{throw nE(e)});if(!t)throw Error(ye);let n=t.response,r={id:t.id,rawId:iE(t.rawId),type:t.type,clientExtensionResults:{},response:{clientDataJSON:iE(n.clientDataJSON),authenticatorData:iE(n.authenticatorData),signature:iE(n.signature),...n.userHandle?{userHandle:iE(n.userHandle)}:{}}};return iE(new TextEncoder().encode(JSON.stringify(r)))}async function sE(e){let t=e.user,n=await navigator.credentials.create({publicKey:{challenge:aE(e.challenge),rp:e.rp,user:{id:aE(t.id),name:t.name,displayName:t.displayName},pubKeyCredParams:e.pubKeyCredParams,timeout:e.timeout,attestation:`none`,authenticatorSelection:{residentKey:`discouraged`,userVerification:`required`}}});if(!n)throw Error(`Setting up the passkey was cancelled.`);let r=n.response;return{id:n.id,rawId:iE(n.rawId),type:n.type,clientExtensionResults:{},response:{clientDataJSON:iE(r.clientDataJSON),attestationObject:iE(r.attestationObject),transports:r.getTransports?.()??[]}}}var cE={sign:oE,create:sE};function lE(){let[e,t]=(0,v.useState)([]);(0,v.useEffect)(()=>(xe(e=>new Promise(n=>t(t=>[...t,{step:e,answer:n}]))),()=>xe(null)),[]);let n=e[0];if(!n)return null;let r=rE(n.step),i=e=>{t(e=>e.slice(1)),n.answer(e)};return(0,B.jsx)(`div`,{className:`passkey-backdrop`,children:(0,B.jsxs)(`div`,{className:`passkey-dialog`,role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`passkey-title`,children:[(0,B.jsx)(`h3`,{id:`passkey-title`,children:r.title}),r.body.map(e=>(0,B.jsx)(`p`,{children:e},e)),(0,B.jsxs)(`div`,{className:`passkey-actions`,children:[(0,B.jsx)(`button`,{onClick:()=>i(!1),children:`Cancel`}),(0,B.jsx)(`button`,{className:`primary`,autoFocus:!0,onClick:()=>i(!0),children:r.go})]})]})})}_e(cE),Fb(document.documentElement,Nb(localStorage)),window.addEventListener(`storage`,e=>{(e.key===`ledung.theme`||e.key===null)&&Fb(document.documentElement,Mb(e.newValue))}),CT(window),(0,y.createRoot)(document.getElementById(`root`)).render((0,B.jsxs)(v.StrictMode,{children:[(0,B.jsx)(qT,{}),(0,B.jsx)(lE,{})]}));export{o as n,l as r,Jg as t};