ledung 1.6.0 → 1.7.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.
@@ -0,0 +1,109 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WorkflowView-CyCShexJ.js","assets/WorkflowView-DLioOiRN.css"])))=>i.map(i=>d[i]);
2
+ 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 A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ee=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 te(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,ee)}catch(e){ee(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ne(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 te(ne.bind(null,e))}var re={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=re,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=ne,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=te,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&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.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`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),re=Symbol.for(`react.lazy`),ie=Symbol.for(`react.activity`),ae=Symbol.for(`react.legacy_hidden`),oe=Symbol.for(`react.memo_cache_sentinel`),se=Symbol.for(`react.view_transition`),ce=Symbol.for(`react.recoverable`),le=Symbol.iterator;function ue(e){return typeof e!=`object`||!e?null:(e=le&&e[le]||e[`@@iterator`],typeof e==`function`?e:null)}var de=Symbol.for(`react.client.reference`);function fe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case ie:return`Activity`;case se:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?fe(e.type)||`Memo`:t;case re:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}var pe=Array.isArray,L=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},he=[],ge=-1;function _e(e){return{current:e}}function ve(e){0>ge||(e.current=he[ge],he[ge]=null,ge--)}function ye(e,t){ge++,he[ge]=e.current,e.current=t}var be=_e(null),xe=_e(null),Se=_e(null),Ce=_e(null);function we(e,t){switch(ye(Se,t),ye(xe,e),ye(be,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ve(be),ye(be,e)}function Te(){ve(be),ve(xe),ve(Se)}function Ee(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,ye(Ce,e)),t=be.current;var n=dp(t,e.type);t!==n&&(ye(xe,e),ye(be,n))}function De(e){xe.current===e&&(ve(be),ve(xe)),Ce.current===e&&(ve(Ce),sh._currentValue=me)}var Oe,ke;function Ae(e){if(Oe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Oe=t&&t[1]||``,ke=-1<e.stack.indexOf(`
3
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
+ `+Oe+e+ke}var je=!1;function Me(e,t){if(!e||je)return``;je=!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(`
5
+ `),l=s.split(`
6
+ `);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=`
7
+ `+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{je=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ae(n):``}function z(e,t){switch(e.tag){case 26:case 27:case 5:return Ae(e.type);case 16:return Ae(`Lazy`);case 13:return e.child!==t&&t!==null?Ae(`Suspense Fallback`):Ae(`Suspense`);case 19:return Ae(`SuspenseList`);case 0:case 15:return Me(e.type,!1);case 11:return Me(e.type.render,!1);case 1:return Me(e.type,!0);case 31:return Ae(`Activity`);case 30:return Ae(`ViewTransition`);default:return``}}function B(e){try{var t=``,n=null;do t+=z(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
+ Error generating stack: `+e.message+`
9
+ `+e.stack}}var Ne=Object.prototype.hasOwnProperty,Pe=t.unstable_scheduleCallback,Fe=t.unstable_cancelCallback,Ie=t.unstable_shouldYield,Le=t.unstable_requestPaint,Re=t.unstable_now,ze=t.unstable_getCurrentPriorityLevel,Be=t.unstable_ImmediatePriority,Ve=t.unstable_UserBlockingPriority,He=t.unstable_NormalPriority,Ue=t.unstable_LowPriority,We=t.unstable_IdlePriority,Ge=t.log,Ke=t.unstable_setDisableYieldValue,qe=null,Je=null;function Ye(e){if(typeof Ge==`function`&&Ke(e),Je&&typeof Je.setStrictMode==`function`)try{Je.setStrictMode(qe,e)}catch{}}var Xe=Math.clz32?Math.clz32:$e,Ze=Math.log,Qe=Math.LN2;function $e(e){return e>>>=0,e===0?32:31-(Ze(e)/Qe|0)|0}var et=256,tt=262144,nt=4194304;function rt(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 it(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=rt(n))):i=rt(o):i=rt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=rt(n))):i=rt(o)):i=rt(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 at(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ot(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-Xe(n),i=1<<r;t|=e[r],n&=~i}return t}function st(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 ct(){var e=nt;return nt<<=1,!(nt&62914560)&&(nt=4194304),e}function lt(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-Xe(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-Xe(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-Xe(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=R.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function vt(e,t){var n=R.p;try{return R.p=e,t()}finally{R.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=fm(e);e!==null;){if(n=e[bt])return n;e=fm(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 Ne.call(Ht,e)?!0:Ne.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 Kt(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 qt(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 Jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Yt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Xt(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 Zt(e){if(!e._valueTracker){var t=Yt(e)?`checked`:`value`;e._valueTracker=Xt(e,t,``+e[t])}}function Qt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Yt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var $t=/[\n"\\]/g;function en(e){return e.replace($t,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function tn(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=``+Jt(t)):e.value!==``+Jt(t)&&(e.value=``+Jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):rn(e,Jt(n)):o===`number`&&e.value==t?rn(e,Jt(e.value)):rn(e,Jt(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=``+Jt(s):e.removeAttribute(`name`)}function nn(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)){Zt(e);return}n=n==null?``:``+Jt(n),t=t==null?n:``+Jt(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),Zt(e)}function rn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function an(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=``+Jt(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 on(e,t,n){t!=null&&(t=``+Jt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Jt(n)}function sn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(pe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Zt(e)}function cn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ln=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 un(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||ln.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function dn(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&&(un(e,a,r),V=!0)}else for(var o in t)t.hasOwnProperty(o)&&un(e,o,t[o])}function fn(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 pn=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`]]),mn=/^[\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 hn(e){return mn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function gn(){}var H=null;function _n(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vn=null,U=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(tn(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="`+en(``+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));tn(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&&Qt(r)}break a;case`textarea`:on(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&an(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,(vn!==null||U!==null)&&(Ld(),vn&&(t=vn,e=U,U=vn=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 W=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}})),$n=Nn(D({},Vn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),er=Nn(D({},Pn,{submitter:0})),G=Nn(D({},In,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qn})),tr=Nn(D({},Pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),nr=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})),rr=Nn(D({},Pn,{newState:0,oldState:0,source:0})),ir=[9,13,27,32],ar=Cn&&`CompositionEvent`in window,or=null;Cn&&`documentMode`in document&&(or=document.documentMode);var sr=Cn&&`TextEvent`in window&&!or,cr=Cn&&(!ar||or&&8<or&&11>=or),lr=` `,ur=!1;function dr(e,t){switch(e){case`keyup`:return ir.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function fr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var pr=!1;function mr(e,t){switch(e){case`compositionend`:return fr(t);case`keypress`:return t.which===32?(ur=!0,lr):null;case`textInput`:return e=t.data,e===lr&&ur?null:e;default:return null}}function hr(e,t){if(pr)return e===`compositionend`||!ar&&dr(e,t)?(e=kn(),On=Dn=En=null,pr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return cr&&t.locale!==`ko`?null:t.data;default:return null}}var gr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function _r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!gr[e.type]:t===`textarea`}function vr(e,t,n,r){vn?U?U.push(r):U=[r]:vn=r,t=qf(t,`onChange`),0<t.length&&(n=new Fn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var yr=null,br=null;function xr(e){Bf(e,0)}function Sr(e){if(Qt(Mt(e)))return e}function Cr(e,t){if(e===`change`)return t}var wr=!1;if(Cn){var Tr;if(Cn){var Er=`oninput`in document;if(!Er){var Dr=document.createElement(`div`);Dr.setAttribute(`oninput`,`return;`),Er=typeof Dr.oninput==`function`}Tr=Er}else Tr=!1;wr=Tr&&(!document.documentMode||9<document.documentMode)}function Or(){yr&&(yr.detachEvent(`onpropertychange`,kr),br=yr=null)}function kr(e){if(e.propertyName===`value`&&Sr(br)){var t=[];vr(t,br,e,_n(e)),xn(xr,t)}}function Ar(e,t,n){e===`focusin`?(Or(),yr=t,br=n,yr.attachEvent(`onpropertychange`,kr)):e===`focusout`&&Or()}function jr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Sr(br)}function Mr(e,t){if(e===`click`)return Sr(t)}function Nr(e,t){if(e===`input`||e===`change`)return Sr(t)}function Pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Fr=typeof Object.is==`function`?Object.is:Pr;function Ir(e,t){if(Fr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ne.call(t,i)||!Fr(e[i],t[i]))return!1}return!0}function Lr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Rr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zr(e,t){var n=Rr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Rr(n)}}function Br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lr(e.document)}return t}function Hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ur=Cn&&`documentMode`in document&&11>=document.documentMode,Wr=null,Gr=null,Kr=null,qr=!1;function Jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qr||Wr==null||Wr!==Lr(r)||(r=Wr,`selectionStart`in r&&Hr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Kr&&Ir(Kr,r)||(Kr=r,r=qf(Gr,`onSelect`),0<r.length&&(t=new Fn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Wr)))}function Yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Xr={animationend:Yr(`Animation`,`AnimationEnd`),animationiteration:Yr(`Animation`,`AnimationIteration`),animationstart:Yr(`Animation`,`AnimationStart`),transitionrun:Yr(`Transition`,`TransitionRun`),transitionstart:Yr(`Transition`,`TransitionStart`),transitioncancel:Yr(`Transition`,`TransitionCancel`),transitionend:Yr(`Transition`,`TransitionEnd`)},Zr={},Qr={};Cn&&(Qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Xr.animationend.animation,delete Xr.animationiteration.animation,delete Xr.animationstart.animation),`TransitionEvent`in window||delete Xr.transitionend.transition);function $r(e){if(Zr[e])return Zr[e];if(!Xr[e])return e;var t=Xr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Qr)return Zr[e]=t[n];return e}var ei=$r(`animationend`),ti=$r(`animationiteration`),ni=$r(`animationstart`),ri=$r(`transitionrun`),ii=$r(`transitionstart`),ai=$r(`transitioncancel`),oi=$r(`transitionend`),si=new Map,ci=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);ci.push(`scrollEnd`);function li(e,t){si.set(e,t),Rt(t,[e])}var ui=0;function di(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=vd.identifierPrefix;var n=ui++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function fi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ed;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function pi(e,t){return e=fi(e),t=fi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var mi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},hi=[],gi=0,_i=0;function vi(){for(var e=gi,t=_i=gi=0;t<e;){var n=hi[t];hi[t++]=null;var r=hi[t];hi[t++]=null;var i=hi[t];hi[t++]=null;var a=hi[t];if(hi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Si(n,i,a)}}function yi(e,t,n,r){hi[gi++]=e,hi[gi++]=t,hi[gi++]=n,hi[gi++]=r,_i|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function bi(e,t,n,r){return yi(e,t,n,r),Ci(e)}function xi(e,t){return yi(e,null,null,t),Ci(e)}function Si(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Xe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ci(e){if(50<Dd)throw Dd=0,Od=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var wi={};function Ti(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ei(e,t,n,r){return new Ti(e,t,n,r)}function Di(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Oi(e,t){var n=e.alternate;return n===null?(n=Ei(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ki(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ai(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Di(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,be.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ie:return e=Ei(31,n,t,a),e.elementType=ie,e.lanes=o,e;case j:return ji(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Ei(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case ee:return e=Ei(13,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return e=Ei(19,n,t,a),e.elementType=te,e.lanes=o,e;case ae:case se:return e=a|32,e=Ei(30,n,t,e),e.elementType=se,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case ne:s=14;break a;case re:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ei(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ji(e,t,n,r){return e=Ei(7,e,r,t),e.lanes=n,e}function Mi(e,t,n){return e=Ei(6,e,null,t),e.lanes=n,e}function Ni(e){var t=Ei(18,null,null,0);return t.stateNode=e,t}function Pi(e,t,n){return t=Ei(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fi=new WeakMap;function Ii(e,t){if(typeof e==`object`&&e){var n=Fi.get(e);return n===void 0?(t={value:e,source:t,stack:B(t)},Fi.set(e,t),t):n}return{value:e,source:t,stack:B(t)}}var Li=[],K=0,Ri=null,q=0,zi=[],Bi=0,Vi=null,Hi=1,J=``;function Ui(e,t){Li[K++]=q,Li[K++]=Ri,Ri=e,q=t}function Wi(e,t,n){zi[Bi++]=Hi,zi[Bi++]=J,zi[Bi++]=Vi,Vi=e;var r=Hi;e=J;var i=32-Xe(r)-1;r&=~(1<<i),n+=1;var a=32-Xe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Hi=1<<32-Xe(t)+i|n<<i|r,J=a+e}else Hi=1<<a|n<<i|r,J=e}function Gi(e){e.return!==null&&(Ui(e,1),Wi(e,1,0))}function Ki(e){for(;e===Ri;)Ri=Li[--K],Li[K]=null,q=Li[--K],Li[K]=null;for(;e===Vi;)Vi=zi[--Bi],zi[Bi]=null,J=zi[--Bi],zi[Bi]=null,Hi=zi[--Bi],zi[Bi]=null}function qi(e,t){zi[Bi++]=Hi,zi[Bi++]=J,zi[Bi++]=Vi,Hi=t.id,J=t.overflow,Vi=e}var Ji=null,Yi=null,Y=!1,Xi=null,Zi=!1,Qi=Error(i(519));function $i(e){throw aa(Ii(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Qi}function ea(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[bt]=e,t[xt]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)$(Rf[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),nn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),sn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||$f(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=gn),t=!0):t=!1,t||$i(e,!0)}function ta(e){for(Ji=e.return;Ji;)switch(Ji.tag){case 5:case 31:case 13:Zi=!1;return;case 27:case 3:Zi=!0;return;default:Ji=Ji.return}}function na(e){if(e!==Ji)return!1;if(!Y)return ta(e),Y=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&Yi&&$i(e),ta(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Yi=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Yi=dm(e)}else t===27?(t=Yi,Sp(e.type)?(e=um,um=null,Yi=e):Yi=t):Yi=Ji?lm(e.stateNode.nextSibling):null;return!0}function ra(){Yi=Ji=null,Y=!1}function ia(){var e=Xi;return e!==null&&(ud===null?ud=e:ud.push.apply(ud,e),Xi=null),e}function aa(e){Xi===null?Xi=[e]:Xi.push(e)}var oa=_e(null),sa=null,ca=null;function la(e,t,n){ye(oa,t._currentValue),t._currentValue=n}function ua(e){e._currentValue=oa.current,ve(oa)}function da(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 fa(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),da(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),da(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),da(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 pa(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Fr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ce.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}a=a.return}return e!==null&&fa(t,e,n,r),t.flags|=262144,e!==null}function ma(e){for(e=e.firstContext;e!==null;){if(!Fr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ha(e){sa=e,ca=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ga(e){return va(sa,e)}function _a(e,t){return sa===null&&ha(e),va(e,t)}function va(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ca===null){if(e===null)throw Error(i(308));ca=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ca=ca.next=t;return n}var ya=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()})}},ba=t.unstable_scheduleCallback,xa=t.unstable_NormalPriority,Sa={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ca(){return{controller:new ya,data:new Map,refCount:0}}function wa(e){e.refCount--,e.refCount===0&&ba(xa,function(){e.controller.abort()})}function Ta(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 Ea=null;function Da(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Oa=null,ka=0,Aa=0,ja=null;function Ma(e,t){if(Oa===null){var n=Oa=[];ka=0,Aa=Nf(),ja={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ka++,t.then(Na,Na),t}function Na(){if(--ka===0&&(Ea=null,Oa!==null)){ja!==null&&(ja.status=`fulfilled`);var e=Oa;Oa=null,Aa=0,ja=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Pa(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 Fa=L.S;L.S=function(e,t){if(pd=Re(),typeof t==`object`&&t&&typeof t.then==`function`&&Ma(e,t),Ea!==null)for(var n=yf;n!==null;)Ta(n,Ea),n=n.next;if(n=e.types,n!==null){for(var r=yf;r!==null;)Ta(r,n),r=r.next;if(Aa!==0){r=Ea,r===null&&(r=Ea=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Fa!==null&&Fa(e,t)};var Ia=_e(null);function La(){var e=Ia.current;return e===null?Xu.pooledCache:e}function Ra(e,t){t===null?ye(Ia,Ia.current):ye(Ia,t.pool)}function za(){var e=La();return e===null?null:{parent:Sa._currentValue,pool:e}}var Ba=Error(i(460)),Va=Error(i(474)),Ha=Error(i(542)),Ua={then:function(){}};function Wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ga(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(gn,gn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ya(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(gn,gn);else{if(e=Xu,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ya(e),e}throw qa=t,Ba}}function Ka(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(qa=e,Ba):e}}var qa=null;function Ja(){if(qa===null)throw Error(i(459));var e=qa;return qa=null,e}function Ya(e){if(e===Ba||e===Ha)throw Error(i(483))}var Xa=null,Za=0;function Qa(e){var t=Za;return Za+=1,Xa===null&&(Xa=[]),Ga(Xa,e,t)}function $a(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function eo(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 to(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Oi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Mi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),$a(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===re&&Ka(i)===t.type)?(t=a(t,n.props),$a(t,n),t.return=e,t):(t=Ai(n.type,n.key,n.props,null,e.mode,r),$a(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Pi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ji(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Mi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ai(t.type,t.key,t.props,null,e.mode,n),$a(n,t),n.return=e,n;case A:return t=Pi(t,e.mode,n),t.return=e,t;case re:return t=Ka(t),f(e,t,n)}if(pe(t)||ue(t))return t=ji(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Qa(t),n);if(t.$$typeof===F)return f(e,_a(e,t),n);eo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case re:return n=Ka(n),p(e,t,n,r)}if(pe(n)||ue(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Qa(n),r);if(n.$$typeof===F)return p(e,t,_a(e,n),r);eo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case re:return r=Ka(r),m(e,t,n,r,i)}if(pe(r)||ue(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Qa(r),i);if(r.$$typeof===F)return m(e,t,n,_a(t,r),i);eo(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),Y&&Ui(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 Y&&Ui(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)}),Y&&Ui(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),Y&&Ui(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 Y&&Ui(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)}),Y&&Ui(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),$a(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===re&&Ka(l)===r.type){n(e,r.sibling),c=a(r,o.props),$a(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=ji(o.props.children,e.mode,c,o.key),$a(c,o),c.return=e,e=c):(c=Ai(o.type,o.key,o.props,null,e.mode,c),$a(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Pi(o,e.mode,c),c.return=e,e=c}return s(e);case re:return o=Ka(o),_(e,r,o,c)}if(pe(o))return h(e,r,o,c);if(ue(o)){if(l=ue(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,Qa(o),c);if(o.$$typeof===F)return _(e,r,_a(e,o),c);eo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Mi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Za=0;var i=_(e,t,n,r);return Xa=null,i}catch(t){if(t===Ba||t===Ha)throw t;var a=Ei(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var no=to(!0),ro=to(!1),io=!1;function ao(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function oo(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 so(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function co(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Yu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ci(e),Si(e,null,n),t}return yi(e,r,t,n),Ci(e)}function lo(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 uo(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 fo=!1;function po(){if(fo){var e=ja;if(e!==null)throw e}}function mo(e,t,n,r){fo=!1;var i=e.updateQueue;io=!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?(Q&f)===f:(r&f)===f){f!==0&&f===Aa&&(fo=!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:io=!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),id|=o,e.lanes=o,e.memoizedState=d}}function ho(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function go(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ho(n[e],t)}var _o=_e(null),vo=_e(0);function yo(e,t){e=nd,ye(vo,e),ye(_o,t),nd=e|t.baseLanes}function bo(){ye(vo,nd),ye(_o,_o.current)}function xo(){nd=vo.current,ve(_o),ve(vo)}var So=_e(null),Co=null;function wo(e){var t=e.alternate;ye(ko,ko.current&1),ye(So,e),Co===null&&(t===null||_o.current!==null||t.memoizedState!==null)&&(Co=e)}function To(e){ye(ko,ko.current),ye(So,e),Co===null&&(Co=e)}function Eo(e){e.tag===22?(ye(ko,ko.current),ye(So,e),Co===null&&(Co=e)):Do()}function Do(){ye(ko,ko.current),ye(So,So.current)}function Oo(e){ve(So),Co===e&&(Co=null),ve(ko)}var ko=_e(0);function Ao(e,t){ye(So,So.current),ye(ko,t)}function jo(e){ve(ko),ve(So),Co===e&&(Co=null)}function Mo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var No=0,X=null,Po=null,Fo=null,Io=!1,Lo=!1,Ro=!1,zo=0,Bo=0,Vo=null,Ho=0;function Uo(){throw Error(i(321))}function Wo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Fr(e[n],t[n]))return!1;return!0}function Go(e,t,n,r,i,a){return No=a,X=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,L.H=e===null||e.memoizedState===null?cc:lc,Ro=!1,a=n(r,i),Ro=!1,Lo&&(a=qo(t,n,r,i)),Ko(e),a}function Ko(e){L.H=sc;var t=Po!==null&&Po.next!==null;if(No=0,Fo=Po=X=null,Io=!1,Bo=0,Vo=null,t)throw Error(i(300));e===null||Ec||(e=e.dependencies,e!==null&&ma(e)&&(Ec=!0))}function qo(e,t,n,r){X=e;var a=0;do{if(Lo&&(Vo=null),Bo=0,Lo=!1,25<=a)throw Error(i(301));if(a+=1,Fo=Po=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}L.H=uc,o=t(n,r)}while(Lo);return o}function Jo(){var e=L.H,t=e.useState()[0];return t=typeof t.then==`function`?ts(t):t,e=e.useState()[0],(Po===null?null:Po.memoizedState)!==e&&(X.flags|=1024),t}function Yo(){var e=zo!==0;return zo=0,e}function Xo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Zo(e){if(Io){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Io=!1}No=0,Fo=Po=X=null,Lo=!1,Bo=zo=0,Vo=null}function Qo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fo===null?X.memoizedState=Fo=e:Fo=Fo.next=e,Fo}function $o(){if(Po===null){var e=X.alternate;e=e===null?null:e.memoizedState}else e=Po.next;var t=Fo===null?X.memoizedState:Fo.next;if(t!==null)Fo=t,Po=e;else{if(e===null)throw X.alternate===null?Error(i(467)):Error(i(310));Po=e,e={memoizedState:Po.memoizedState,baseState:Po.baseState,baseQueue:Po.baseQueue,queue:Po.queue,next:null},Fo===null?X.memoizedState=Fo=e:Fo=Fo.next=e}return Fo}function es(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ts(e){var t=Bo;return Bo+=1,Vo===null&&(Vo=[]),e=Ga(Vo,e,t),t=X,(Fo===null?t.memoizedState:Fo.next)===null&&(t=t.alternate,L.H=t===null||t.memoizedState===null?cc:lc),e}function ns(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ts(e);if(e.$$typeof===ce)return;if(e.$$typeof===F)return ga(e)}throw Error(i(438,String(e)))}function rs(e){var t=null,n=X.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=X.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=es(),X.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]=oe;return t.index++,n}function is(e,t){return typeof t==`function`?t(e):t}function as(e){return os($o(),Po,e)}function os(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?(No&f)===f:(Q&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===Aa&&(d=!0);else if((No&p)===p){u=u.next,p===Aa&&(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,X.lanes|=p,id|=p;f=u.action,Ro&&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,X.lanes|=f,id|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Fr(o,e.memoizedState)&&(Ec=!0,d&&(n=ja,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 ss(e){var t=$o(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Fr(o,t.memoizedState)||(Ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function cs(e,t,n){var r=X,a=$o(),o=Y;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Fr((Po||a).memoizedState,n);if(s&&(a.memoizedState=n,Ec=!0),a=a.queue,Ns(ds.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Fo!==null&&!!(Fo.memoizedState.tag&1),Os(e?9:8,{destroy:void 0},us.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Xu===null)throw Error(i(349));o||No&127||ls(r,t,n)}return n}function ls(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=X.updateQueue,t===null?(t=es(),X.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function us(e,t,n,r){t.value=n,t.getSnapshot=r,fs(t)&&ps(e)}function ds(e,t,n){return n(function(){fs(t)&&ps(e)})}function fs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Fr(e,n)}catch{return!0}}function ps(e){var t=xi(e,2);t!==null&&Md(t,e,2)}function ms(e){var t=Qo();if(typeof e==`function`){var n=e;if(e=n(),Ro){Ye(!0);try{n()}finally{Ye(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:e},t}function hs(e,t,n,r){return e.baseState=n,os(e,Po,typeof r==`function`?r:is)}function gs(e,t,n,r,a){if(ic(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)}};L.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,_s(t,o)):(o.next=n.next,t.pending=n.next=o)}}function _s(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=L.T,o={};o.types=a===null?null:a.types,L.T=o;try{var s=n(i,r),c=L.S;c!==null&&c(o,s),vs(e,t,s)}catch(n){bs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),L.T=a}}else try{a=n(i,r),vs(e,t,a)}catch(n){bs(e,t,n)}}function vs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ys(e,t,n)},function(n){return bs(e,t,n)}):ys(e,t,n)}function ys(e,t,n){t.status=`fulfilled`,t.value=n,xs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,_s(e,n)))}function bs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,xs(t),t=t.next;while(t!==r)}e.action=null}function xs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ss(e,t){return t}function Cs(e,t){if(Y){var n=Xu.formState;if(n!==null){a:{var r=X;if(Y){if(Yi){b:{for(var i=Yi,a=Zi;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Yi=lm(i.nextSibling),r=i.data===`F!`;break a}}$i(r)}r=!1}r&&(t=n[0])}}return n=Qo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ss,lastRenderedState:t},n.queue=r,n=tc.bind(null,X,r),r.dispatch=n,r=ms(!1),a=rc.bind(null,X,!1,r.queue),r=Qo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=gs.bind(null,X,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ws(e){return Ts($o(),Po,e)}function Ts(e,t,n){if(t=os(e,t,Ss)[0],e=as(is)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ts(t)}catch(e){throw e===Ba?Ha:e}else r=t;t=$o();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(X.flags|=2048,Os(9,{destroy:void 0},Es.bind(null,i,n),null)),[r,a,e]}function Es(e,t){e.action=t}function Ds(e){var t=$o(),n=Po;if(n!==null)return Ts(t,n,e);$o(),t=t.memoizedState,n=$o();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Os(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=X.updateQueue,t===null&&(t=es(),X.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 ks(){return $o().memoizedState}function As(e,t,n,r){var i=Qo();X.flags|=e,i.memoizedState=Os(1|t,{destroy:void 0},n,r===void 0?null:r)}function js(e,t,n,r){var i=$o();r=r===void 0?null:r;var a=i.memoizedState.inst;Po!==null&&r!==null&&Wo(r,Po.memoizedState.deps)?i.memoizedState=Os(t,a,n,r):(X.flags|=e,i.memoizedState=Os(1|t,a,n,r))}function Ms(e,t){As(8390656,8,e,t)}function Ns(e,t){js(2048,8,e,t)}function Ps(e){X.flags|=4;var t=X.updateQueue;if(t===null)t=es(),X.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Fs(e){var t=$o().memoizedState;return Ps({ref:t,nextImpl:e}),function(){if(Yu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Is(e,t){return js(4,2,e,t)}function Ls(e,t){return js(4,4,e,t)}function Rs(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 zs(e,t,n){n=n==null?null:n.concat([e]),js(4,4,Rs.bind(null,t,e),n)}function Bs(){}function Vs(e,t){var n=$o();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Wo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Hs(e,t){var n=$o();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Wo(t,r[1]))return r[0];if(r=e(),Ro){Ye(!0);try{e()}finally{Ye(!1)}}return n.memoizedState=[r,t],r}function Us(e,t,n){return n===void 0||No&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ad(),X.lanes|=e,id|=e,n)}function Ws(e,t,n,r){return Fr(n,t)?n:_o.current===null?!(No&106)||No&1073741824&&!(Q&261930)?(Ec=!0,e.memoizedState=n):(e=Ad(),X.lanes|=e,id|=e,t):(e=Us(e,n,r),Fr(e,t)||(Ec=!0),e)}function Gs(e,t,n,r,i){var a=R.p;R.p=a!==0&&8>a?a:8;var o=L.T,s={};s.types=o===null?null:o.types,L.T=s,rc(e,!1,t,n);try{var c=i(),l=L.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?nc(e,t,Pa(c,r),kd(e)):nc(e,t,r,kd(e))}catch(n){nc(e,t,{then:function(){},status:`rejected`,reason:n},kd())}finally{R.p=a,o!==null&&s.types!==null&&(o.types=s.types),L.T=o}}function Ks(){}function qs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Js(e).queue;Gs(e,a,t,me,n===null?Ks:function(){return Ys(e),n(r)})}function Js(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:me},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ys(e){var t=Js(e);t.next===null&&(t=e.alternate.memoizedState),nc(e,t.next.queue,{},kd())}function Xs(){return ga(sh)}function Zs(){return $o().memoizedState}function Qs(){return $o().memoizedState}function $s(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=kd();e=so(n);var r=co(t,e,n);r!==null&&(Md(r,t,n),lo(r,t,n)),t={cache:Ca()},e.payload=t;return}t=t.return}}function ec(e,t,n){var r=kd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ic(e)?ac(t,n):(n=bi(e,t,n,r),n!==null&&(Md(n,e,r),oc(n,t,r)))}function tc(e,t,n){nc(e,t,n,kd())}function nc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ic(e))ac(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Fr(s,o))return yi(e,t,i,0),Xu===null&&vi(),!1}catch{}if(n=bi(e,t,i,r),n!==null)return Md(n,e,r),oc(n,t,r),!0}return!1}function rc(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ic(e)){if(t)throw Error(i(479))}else t=bi(e,n,r,2),t!==null&&Md(t,e,2)}function ic(e){var t=e.alternate;return e===X||t!==null&&t===X}function ac(e,t){Lo=Io=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function oc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pt(e,n)}}var sc={readContext:ga,use:ns,useCallback:Uo,useContext:Uo,useEffect:Uo,useImperativeHandle:Uo,useLayoutEffect:Uo,useInsertionEffect:Uo,useMemo:Uo,useReducer:Uo,useRef:Uo,useState:Uo,useDebugValue:Uo,useDeferredValue:Uo,useTransition:Uo,useSyncExternalStore:Uo,useId:Uo,useHostTransitionStatus:Uo,useFormState:Uo,useActionState:Uo,useOptimistic:Uo,useMemoCache:Uo,useCacheRefresh:Uo,useEffectEvent:Uo},cc={readContext:ga,use:ns,useCallback:function(e,t){return Qo().memoizedState=[e,t===void 0?null:t],e},useContext:ga,useEffect:Ms,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),As(4194308,4,Rs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return As(4194308,4,e,t)},useInsertionEffect:function(e,t){As(4,2,e,t)},useMemo:function(e,t){var n=Qo();t=t===void 0?null:t;var r=e();if(Ro){Ye(!0);try{e()}finally{Ye(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Qo();if(n!==void 0){var i=n(t);if(Ro){Ye(!0);try{n(t)}finally{Ye(!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=ec.bind(null,X,e),[r.memoizedState,e]},useRef:function(e){var t=Qo();return e={current:e},t.memoizedState=e},useState:function(e){e=ms(e);var t=e.queue,n=tc.bind(null,X,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Bs,useDeferredValue:function(e,t){return Us(Qo(),e,t)},useTransition:function(){var e=ms(!1);return e=Gs.bind(null,X,e.queue,!0,!1),Qo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=X,a=Qo();if(Y){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xu===null)throw Error(i(349));Q&127||ls(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ms(ds.bind(null,r,o,e),[e]),r.flags|=2048,Os(9,{destroy:void 0},us.bind(null,r,o,n,t),null),n},useId:function(){var e=Qo(),t=Xu.identifierPrefix;if(Y){var n=J,r=Hi;n=(r&~(1<<32-Xe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=zo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Ho++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Xs,useFormState:Cs,useActionState:Cs,useOptimistic:function(e){var t=Qo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=rc.bind(null,X,!0,n),n.dispatch=t,[e,t]},useMemoCache:rs,useCacheRefresh:function(){return Qo().memoizedState=$s.bind(null,X)},useEffectEvent:function(e){var t=Qo(),n={impl:e};return t.memoizedState=n,function(){if(Yu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},lc={readContext:ga,use:ns,useCallback:Vs,useContext:ga,useEffect:Ns,useImperativeHandle:zs,useInsertionEffect:Is,useLayoutEffect:Ls,useMemo:Hs,useReducer:as,useRef:ks,useState:function(){return as(is)},useDebugValue:Bs,useDeferredValue:function(e,t){return Ws($o(),Po.memoizedState,e,t)},useTransition:function(){var e=as(is)[0],t=$o().memoizedState;return[typeof e==`boolean`?e:ts(e),t]},useSyncExternalStore:cs,useId:Zs,useHostTransitionStatus:Xs,useFormState:ws,useActionState:ws,useOptimistic:function(e,t){return hs($o(),Po,e,t)},useMemoCache:rs,useCacheRefresh:Qs,useEffectEvent:Fs},uc={readContext:ga,use:ns,useCallback:Vs,useContext:ga,useEffect:Ns,useImperativeHandle:zs,useInsertionEffect:Is,useLayoutEffect:Ls,useMemo:Hs,useReducer:ss,useRef:ks,useState:function(){return ss(is)},useDebugValue:Bs,useDeferredValue:function(e,t){var n=$o();return Po===null?Us(n,e,t):Ws(n,Po.memoizedState,e,t)},useTransition:function(){var e=ss(is)[0],t=$o().memoizedState;return[typeof e==`boolean`?e:ts(e),t]},useSyncExternalStore:cs,useId:Zs,useHostTransitionStatus:Xs,useFormState:Ds,useActionState:Ds,useOptimistic:function(e,t){var n=$o();return Po===null?(n.baseState=e,[e,n.queue.dispatch]):hs(n,Po,e,t)},useMemoCache:rs,useCacheRefresh:Qs,useEffectEvent:Fs};function dc(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 fc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=kd(),i=so(r);i.payload=t,n!=null&&(i.callback=n),t=co(e,i,r),t!==null&&(Md(t,e,r),lo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=kd(),i=so(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=co(e,i,r),t!==null&&(Md(t,e,r),lo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kd(),r=so(n);r.tag=2,t!=null&&(r.callback=t),t=co(e,r,n),t!==null&&(Md(t,e,n),lo(t,e,n))}};function pc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ir(n,r)||!Ir(i,a):!0}function mc(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&&fc.enqueueReplaceState(t,t.state,null)}function hc(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 gc(e){mi(e)}function _c(e){console.error(e)}function vc(e){mi(e)}function yc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function bc(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 xc(e,t,n){return n=so(n),n.tag=3,n.payload={element:null},n.callback=function(){yc(e,t)},n}function Sc(e){return e=so(e),e.tag=3,e}function Cc(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(){bc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){bc(t,n,r),typeof i!=`function`&&(gd===null?gd=new Set([this]):gd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function wc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&pa(t,n,a,!0),n=So.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Co===null?Wd():n.alternate===null&&rd===0&&(rd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ua?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),pf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ua?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)),pf(e,r,a)),!1}throw Error(i(435,n.tag))}return pf(e,r,a),Wd(),!1}if(Y)return t=So.current,t===null?(r!==Qi&&(t=Error(i(423),{cause:r}),aa(Ii(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ii(r,n),a=xc(e.stateNode,r,a),uo(e,a),rd!==4&&(rd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Qi&&(e=Error(i(422),{cause:r}),aa(Ii(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ii(o,n),ld===null?ld=[o]:ld.push(o),rd!==4&&(rd=2),t===null)return!0;r=Ii(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=xc(n.stateNode,r,e),uo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(gd===null||!gd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Sc(a),Cc(a,e,n,r),uo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Tc=Error(i(461)),Ec=!1;function Dc(e,t,n,r){t.child=e===null?ro(t,null,n,r):no(t,e.child,n,r)}function Oc(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 ha(t),r=Go(e,t,n,o,a,i),s=Yo(),e!==null&&!Ec?(Xo(e,t,i),nl(e,t,i)):(Y&&s&&Gi(t),t.flags|=1,Dc(e,t,r,i),t.child)}function kc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Di(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Ac(e,t,a,r,i)):(e=Ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!rl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ir:n,n(o,r)&&e.ref===t.ref)return nl(e,t,i)}return t.flags|=1,e=Oi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ir(a,r)&&e.ref===t.ref){if(Ec=!1,t.pendingProps=r=a,rl(e,i))e.flags&131072&&(Ec=!0);else return t.lanes=e.lanes,nl(e,t,i)}}return Rc(e,t,n,r,i)}function jc(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 Nc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ra(t,a===null?null:a.cachePool),a===null?bo():yo(t,a),Eo(t);else return r=t.lanes=536870912,Nc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ra(t,null),bo(),Do()):(Ra(t,a.cachePool),yo(t,a),Do(),t.memoizedState=null);return Dc(e,t,i,n),t.child}function Mc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Nc(e,t,n,r,i){var a=La();return a=a===null?null:{parent:Sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ra(t,null),bo(),Eo(t),e!==null&&pa(e,t,r,!0),t.childLanes=i,null}function Pc(e,t){return t=qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Fc(e,t,n){return no(t,e.child,null,n),e=Pc(t,t.pendingProps),e.flags|=2,Oo(t),t.memoizedState=null,e}function Ic(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Y){if(r.mode===`hidden`)return e=Pc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Mc(null,e);if(To(t),(e=Yi)?(e=am(e,Zi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Vi===null?null:{id:Hi,overflow:J},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Ji=t,Yi=null)):e=null,e===null)throw $i(t);return t.lanes=536870912,null}return Pc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(To(t),a){if(t.flags&256)t.flags&=-257,t=Fc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Ec||pa(e,t,n,!1),a=(n&e.childLanes)!==0,Ec||a){if(_o.current===null){if(r=Xu,r!==null&&(s=mt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,xi(e,s),Md(r,e,s),Tc;Wd()}t=Fc(e,t,n)}else e=o.treeContext,Yi=lm(s.nextSibling),Ji=t,Y=!0,Xi=null,Zi=!1,e!==null&&qi(t,e),t=Pc(t,r),t.flags|=134221824;return t}return e=Oi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Lc(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 Rc(e,t,n,r,i){return ha(t),n=Go(e,t,n,r,void 0,i),r=Yo(),e!==null&&!Ec?(Xo(e,t,i),nl(e,t,i)):(Y&&r&&Gi(t),t.flags|=1,Dc(e,t,n,i),t.child)}function zc(e,t,n,r,i,a){return ha(t),t.updateQueue=null,n=qo(t,r,n,i),Ko(e),r=Yo(),e!==null&&!Ec?(Xo(e,t,a),nl(e,t,a)):(Y&&r&&Gi(t),t.flags|=1,Dc(e,t,n,a),t.child)}function Bc(e,t,n,r,i){if(ha(t),t.stateNode===null){var a=wi,o=n.contextType;typeof o==`object`&&o&&(a=ga(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=fc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ao(t),o=n.contextType,a.context=typeof o==`object`&&o?ga(o):wi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(dc(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&&fc.enqueueReplaceState(a,a.state,null),mo(t,r,a,i),po(),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=hc(n,s);a.props=c;var l=a.context,u=n.contextType;o=wi,typeof u==`object`&&u&&(o=ga(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)&&mc(t,a,r,o),io=!1;var f=t.memoizedState;a.state=f,mo(t,r,a,i),po(),l=t.memoizedState,s||f!==l||io?(typeof d==`function`&&(dc(t,n,d,r),l=t.memoizedState),(c=io||pc(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,oo(e,t),o=t.memoizedProps,u=hc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=wi,typeof l==`object`&&l&&(c=ga(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)&&mc(t,a,r,c),io=!1,f=t.memoizedState,a.state=f,mo(t,r,a,i),po();var p=t.memoizedState;o!==d||f!==p||io||e!==null&&e.dependencies!==null&&ma(e.dependencies)?(typeof s==`function`&&(dc(t,n,s,r),p=t.memoizedState),(u=io||pc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ma(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,Lc(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=no(t,e.child,null,i),t.child=no(t,null,n,i)):Dc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=nl(e,t,i),e}function Vc(e,t,n,r){return ra(),t.flags|=256,Dc(e,t,n,r),t.child}var Hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Uc(e){return{baseLanes:e,cachePool:za()}}function Wc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=sd),e}function Gc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(ko.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(Y){if(i?wo(t):Do(),(e=Yi)?(e=am(e,Zi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Vi===null?null:{id:Hi,overflow:J},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Ji=t,Yi=null)):e=null,e===null)throw $i(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Do(),i=t.mode,a=qc({mode:`hidden`,children:a},i),r=ji(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Uc(n),r.childLanes=Wc(e,o,n),t.memoizedState=Hc,Mc(null,r)):(wo(t),Kc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Yc(e,t,a,o,r,c,s,n)}return i?(Do(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Oi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=ji(i,a,n,null),i.flags|=2):i=Oi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Mc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Uc(n):(a=i.cachePool,a===null?a=za():(s=Sa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Wc(e,o,n),t.memoizedState=Hc,Mc(e.child,r)):(wo(t),n=e.child,e=n.sibling,n=Oi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Kc(e,t){return t=qc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function qc(e,t){return e=Ei(22,e,null,t),e.lanes=0,e}function Jc(e,t,n){return no(t,e.child,null,n),e=Kc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Yc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(wo(t),t.flags&=-257,Jc(e,t,c)):t.memoizedState===null?(Do(),o=a.fallback,s=t.mode,a=qc({mode:`visible`,children:a.children},s),o=ji(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,no(t,e.child,null,c),a=t.child,a.memoizedState=Uc(c),a.childLanes=Wc(e,r,c),t.memoizedState=Hc,Mc(null,a)):(Do(),t.child=e.child,t.flags|=128,null);if(wo(t),sm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,aa({value:a,source:null,stack:null})),Jc(e,t,c)}if(Ec||pa(e,t,c,!1),r=(c&e.childLanes)!==0,Ec||r){if(_o.current!==null)return Jc(e,t,c);if(r=Xu,r!==null&&(a=mt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,xi(e,a),Md(r,e,a),Tc;return om(o)||Wd(),Jc(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Yi=lm(o.nextSibling),Ji=t,Y=!0,Xi=null,Zi=!1,e!==null&&qi(t,e),t=Kc(t,a.children),t.flags|=134221824,t)}function Xc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),da(e.return,t,n)}function Zc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Mo(n)===null&&(t=e),e=e.sibling}return t}function Qc(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 $c(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 el(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ko.current;if(t.flags&128)return Ao(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ao(t,o),i===`backwards`&&e!==null?($c(e),Dc(e,t,r,n),$c(e)):Dc(e,t,r,n),r=Y?q:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xc(e,n,t);else if(e.tag===19)Xc(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=Zc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,$c(t)),Qc(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&&Mo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Qc(t,!0,n,null,a,r);break;case`together`:Qc(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Zc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Qc(t,!1,i,n,a,r)}return t.child}function tl(e,t,n){var r=t.pendingProps;return la(t,t.type,r.value),Dc(e,t,r.children,n),t.child}function nl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),id|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(pa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function rl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ma(e)))}function il(e,t,n){switch(t.tag){case 3:we(t,t.stateNode.containerInfo),la(t,Sa,e.memoizedState.cache),ra();break;case 27:case 5:Ee(t);break;case 4:we(t,t.stateNode.containerInfo);break;case 10:la(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,To(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return wo(t),t.flags|=128,null;r=pa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Gc(e,t,n):(wo(t),e=nl(e,t,n),e===null?null:e.sibling)}wo(t);break;case 19:if(t.flags&128)return el(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(pa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return el(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ao(t,ko.current),r)break;return null;case 22:return t.lanes=0,jc(e,t,n,t.pendingProps);case 24:la(t,Sa,e.memoizedState.cache)}return nl(e,t,n)}function al(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ec=!0;else{if(!rl(e,n)&&!(t.flags&128))return Ec=!1,il(e,t,n);Ec=!!(e.flags&131072)}}else Ec=!1,Y&&t.flags&1048576&&Wi(t,q,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ka(t.elementType),t.type=e,typeof e==`function`)Di(e)?(r=hc(e,r),t.tag=1,t=Bc(null,t,e,r,n)):(t.tag=0,t=Rc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=Oc(null,t,e,r,n);break a}if(a===ne){t.tag=14,t=kc(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=tl(null,t,n);break a}}throw t=fe(e)||e,Error(i(306,t,``))}}return t;case 0:return Rc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=hc(r,t.pendingProps),Bc(e,t,r,a,n);case 3:a:{if(we(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,oo(e,t),mo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,la(t,Sa,r),r!==o.cache&&fa(t,[Sa],n,!0),po(),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=Vc(e,t,r,n);break a}if(r!==a){a=Ii(Error(i(424)),t),aa(a),t=Vc(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(Yi=lm(e.firstChild),Ji=t,Y=!0,Xi=null,Zi=!0,n=ro(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ra(),r===a){t=nl(e,t,n);break a}Dc(e,t,r,n)}t=t.child}return t;case 26:return Lc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Y||(t.stateNode=fp(t.type,t.pendingProps,Se.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ee(t),e===null&&Y&&(r=t.stateNode=hm(t.type,t.pendingProps,Se.current),Ji=t,Zi=!0,a=Yi,Sp(t.type)?(um=a,Yi=lm(r.firstChild)):Yi=a),Dc(e,t,t.pendingProps.children,n),Lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Y&&((a=r=Yi)&&(r=rm(r,t.type,t.pendingProps,Zi),r===null?a=!1:(t.stateNode=r,Ji=t,Yi=lm(r.firstChild),Zi=!1,a=!0)),a||$i(t)),Ee(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(a,o)?r=null:s!==null&&pp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Go(e,t,Jo,null,null,n),sh._currentValue=a),Lc(e,t),Dc(e,t,r,n),t.child;case 6:return e===null&&Y&&((e=n=Yi)&&(n=im(n,t.pendingProps,Zi),n===null?e=!1:(t.stateNode=n,Ji=t,Yi=null,e=!0)),e||$i(t)),null;case 13:return Gc(e,t,n);case 4:return we(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=no(t,null,r,n):Dc(e,t,r,n),t.child;case 11:return Oc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Lc(e,t),Dc(e,t,r,n),t.child;case 8:return Dc(e,t,t.pendingProps.children,n),t.child;case 12:return Dc(e,t,t.pendingProps.children,n),t.child;case 10:return tl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ha(t),a=ga(a),r=r(a),t.flags|=1,Dc(e,t,r,n),t.child;case 14:return kc(e,t,t.type,t.pendingProps,n);case 15:return Ac(e,t,t.type,t.pendingProps,n);case 19:return el(e,t,n);case 31:return Ic(e,t,n);case 22:return jc(e,t,n,t.pendingProps);case 24:return ha(t),r=ga(Sa),e===null?(a=La(),a===null&&(a=Xu,o=Ca(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ao(t),la(t,Sa,a)):((e.lanes&n)!==0&&(oo(e,t),mo(t,null,null,n),po()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,la(t,Sa,r),r!==a.cache&&fa(t,[Sa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),la(t,Sa,r))),Dc(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:Y&&Gi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Lc(e,t),Dc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ol(e){e.flags|=4}function sl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Vd())e.flags|=8192;else throw qa=Ua,Va}}else e.flags&=-16777217}function cl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Vd())e.flags|=8192;else throw qa=Ua,Va}}function ll(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ct(),e.lanes|=t,cd|=t)}function ul(e,t){if(!Y)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 dl(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 fl(e,t,n){var r=t.pendingProps;switch(Ki(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dl(t),null;case 1:return dl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ua(Sa),Te(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(na(t)?ol(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ia())),dl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ol(t),o===null?(dl(t),sl(t,a,null,r,n)):(dl(t),cl(t,o))):o?o===e.memoizedState?(dl(t),t.flags&=-16777217):(ol(t),dl(t),cl(t,o)):(e=e.memoizedProps,e!==r&&ol(t),dl(t),sl(t,a,e,r,n)),null;case 27:if(De(t),n=Se.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return dl(t),t.subtreeFlags&=-33554433,null}e=be.current,na(t)?ea(t,e):(e=hm(a,r,n),t.stateNode=e,ol(t))}return dl(t),t.subtreeFlags&=-33554433,null;case 5:if(De(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return dl(t),t.subtreeFlags&=-33554433,null}if(o=be.current,na(t))ea(t,o);else{var s=lp(Se.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(np(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ol(t)}}return dl(t),t.subtreeFlags&=-33554433,sl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Se.current,na(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ji,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[bt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||$i(t,!0)}else e=lp(e).createTextNode(r),e[bt]=t,t.stateNode=e}return dl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=na(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 ra(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dl(t),e=!1}else n=ia(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Oo(t),t):(Oo(t),null);if(t.flags&128)throw Error(i(558))}return dl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=na(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 ra(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dl(t),a=!1}else a=ia(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Oo(t),t):(Oo(t),null)}return Oo(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),ll(t,t.updateQueue),dl(t),null);case 4:return Te(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,dl(t),null;case 10:return ua(t.type),dl(t),null;case 19:if(jo(t),r=t.memoizedState,r===null)return dl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)ul(r,!1);else{if(rd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Mo(e),o!==null){for(t.flags|=128,ul(r,!1),e=o.updateQueue,t.updateQueue=e,ll(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ki(n,e),n=n.sibling;return Ao(t,ko.current&1|2),Y&&Ui(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Re()>md&&(t.flags|=128,a=!0,ul(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Mo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ll(t,e),ul(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!Y)return dl(t),null}else 2*Re()-r.renderingStartTime>md&&n!==536870912&&(t.flags|=128,a=!0,ul(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=Re(),e.sibling=null,o=ko.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||Y?Ao(t,o):(n=o,ye(So,t),ye(ko,n),Co===null&&(Co=t)),Y&&Ui(t,r.treeForkCount),e}return dl(t),null;case 22:case 23:return Oo(t),xo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(dl(t),t.subtreeFlags&6&&(t.flags|=8192)):dl(t),n=t.updateQueue,n!==null&&ll(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&&ve(Ia),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ua(Sa),dl(t),null;case 25:return null;case 30:return t.flags|=33554432,dl(t),null}throw Error(i(156,t.tag))}function pl(e,t){switch(Ki(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ua(Sa),Te(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return De(t),null;case 31:if(t.memoizedState!==null){if(Oo(t),t.alternate===null)throw Error(i(340));ra()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Oo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ra()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return jo(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 Te(),null;case 10:return ua(t.type),null;case 22:case 23:return Oo(t),xo(),e!==null&&ve(Ia),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ua(Sa),null;case 25:return null;default:return null}}function ml(e,t){switch(Ki(t),t.tag){case 3:ua(Sa),Te();break;case 26:case 27:case 5:De(t);break;case 4:Te();break;case 31:t.memoizedState!==null&&Oo(t);break;case 13:Oo(t);break;case 19:jo(t);break;case 10:ua(t.type);break;case 22:case 23:Oo(t),xo(),e!==null&&ve(Ia);break;case 24:ua(Sa)}}function hl(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){ff(t,t.return,e)}}function gl(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){ff(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ff(t,t.return,e)}}function _l(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{go(t,n)}catch(t){ff(e,e.return,t)}}}function vl(e,t,n){n.props=hc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ff(e,t,n)}}function yl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=di(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);m(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){ff(e,t,n)}}function bl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ff(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){ff(e,t,n)}else n.current=null}}function xl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function Sl(e){for(var t=e.return;t!==null&&(Tl(t)&&em(e.stateNode,t.stateNode),!wl(t));)t=t.return}function Cl(e){for(var t=e.return;t!==null&&(Tl(t)&&tm(e.stateNode,t.stateNode),!wl(t));)t=t.return}function wl(e){return e.tag===5||e.tag===3||e.tag===27}function Tl(e){return e&&e.tag===7&&e.stateNode!==null}function El(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){ff(e,e.return,t)}}function Dl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[xt]=t}catch(t){ff(e,e.return,t)}}function Ol(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function kl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ol(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Al(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=gn)),xl(e,r),V=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Al(e,t,n,r),e=e.sibling;e!==null;)Al(e,t,n,r),e=e.sibling}function jl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),xl(e,r),V=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(jl(e,t,n,r),e=e.sibling;e!==null;)jl(e,t,n,r),e=e.sibling}function Ml(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[bt]=e,t[xt]=n}catch(t){ff(e,e.return,t)}}var Nl=!1,Pl=null;function Fl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Nl=!0)}var Il=null;function Ll(){var e=Il;return Il=null,e}var Rl=0;function zl(e,t,n,r,i){return Rl=0,Bl(e.child,t,n,r,i)}function Bl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Nl=!0,Tp(o,Rl===0?t:t+`_`+Rl,n),Rl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Bl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Vl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Vl(e.child,t)),e=e.sibling}function Hl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Hl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=pi(t.default,t.share),t!==`none`&&(zl(e,n,t,null,!1)||Vl(e.child,!1))}e=e.sibling}}function Ul(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=di(r,n),a=pi(r.default,n.paired?r.share:r.enter);a===`none`?Hl(e):zl(e,i,a,null,!1)?(Hl(e),n.paired||t||jd(e,r.onEnter)):Vl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ul(e,t),e=e.sibling;else Hl(e)}function Wl(e){if(Pl!==null&&Pl.size!==0){var t=Pl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=pi(n.default,n.share);if(a!==`none`&&(zl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,jd(e,n.onShare)):Vl(e.child,!1)),t.delete(r),t.size===0)break}}}Wl(e)}e=e.sibling}}}function Gl(e){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode),r=Pl===null?void 0:Pl.get(n),i=pi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(zl(e,n,i,null,!1)?r===void 0?jd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Pl.delete(n),jd(e,t.onShare)):Vl(e.child,!1)),Pl!==null&&Wl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e),e=e.sibling;else Pl!==null&&Wl(e)}function Kl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode);t=pi(t.default,t.update),e.flags&=-5,t!==`none`&&zl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Kl(e);e=e.sibling}}function ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Vl(e.child,!1))}ql(e)}e=e.sibling}}function Jl(e){if(e.tag===30)e.stateNode.paired=null,Vl(e.child,!1),ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e),e=e.sibling;else ql(e)}function Yl(e){for(e=e.child;e!==null;)e.tag===30?Vl(e.child,!1):e.subtreeFlags&33554432&&Yl(e),e=e.sibling}function Xl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Rl<a.length){var l=a[Rl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Rl===0?n:n+`_`+Rl,i),s&&e.flags&4||(Il===null&&(Il=[]),Il.push(c,Rl===0?r:r+`_`+Rl,t.memoizedProps)),Rl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Xl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Zl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=di(n,r),a=pi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Rl=0,i=Xl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||jd(e,n.onUpdate))}else e.subtreeFlags&33554432&&Zl(e,t);e=e.sibling}}var Ql=!1,$l=!1,eu=!1,tu=!1,nu=typeof WeakSet==`function`?WeakSet:Set,ru=null,iu=!1,au=!1,ou=!1,su=!1;function cu(e,t,n){if(e=e.containerInfo,sp=gh,e=Vr(e),Hr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,ru=t,t=n?9270:1024;ru!==null;){if(e=ru,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Gl(r[a]);if(e.alternate===null&&e.flags&2)n&&Fl(e),lu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Gl(r),lu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Fl(e),lu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ru=r):(n&&Kl(e),lu(n))}}Pl=null}function lu(e){for(;ru!==null;){var t=ru,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=hc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){ff(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=di(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=pi(a.default,a.update),a!==`none`&&zl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,ru=r;break}ru=t.return}}function uu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Au(e,n),r&4&&hl(5,n);break;case 1:if(Au(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ff(n,n.return,e)}else{var i=hc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ff(n,n.return,e)}}}r&64&&_l(n),r&512&&yl(n,n.return);break;case 3:if(Au(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{go(e,t)}catch(e){ff(n,n.return,e)}}break;case 27:t===null&&r&4&&Ml(n);case 26:case 5:Au(e,n),t===null&&r&4&&El(n),r&512&&yl(n,n.return);break;case 12:Au(e,n);break;case 31:Au(e,n),r&4&&yu(e,n);break;case 13:Au(e,n),r&4&&bu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||Ql,!r){var a=t!==null&&t.memoizedState!==null||$l;t=Ql,i=$l,Ql=r,($l=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Mu(e,n,r)):Au(e,n),Ql=t,$l=i}break;case 30:Au(e,n),r&512&&yl(n,n.return);break;case 7:r&512&&yl(n,n.return);default:Au(e,n)}}function du(e,t){for(e=e.child;e!==null;)fu(e,t),e=e.sibling}function fu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){ff(e,e.return,t)}pu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,V=!0}catch(t){ff(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){ff(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&du(e,t);break;default:du(e,t)}}function pu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:fu(n,r);break a;case 22:n.memoizedState===null&&pu(n,r);break a;default:pu(n,r)}}e=e.sibling}}function mu(e){var t=e.alternate;t!==null&&(e.alternate=null,mu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&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 hu=null,gu=!1;function _u(e,t,n){for(n=n.child;n!==null;)vu(e,t,n),n=n.sibling}function vu(e,t,n){if(Je&&typeof Je.onCommitFiberUnmount==`function`)try{Je.onCommitFiberUnmount(qe,n)}catch{}switch(n.tag){case 26:$l||bl(n,t),_u(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!$l&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$l||bl(n,t),Cl(n);var r=hu,i=gu;Sp(n.type)&&(hu=n.stateNode,gu=!1),_u(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),hu=r,gu=i;break;case 5:$l||bl(n,t),Cl(n);case 6:if(n.tag===6&&Cl(n),r=hu,i=gu,hu=null,_u(e,t,n),hu=r,gu=i,hu!==null){if(gu)try{(hu.nodeType===9?hu.body:hu.nodeName===`HTML`?hu.ownerDocument.body:hu).removeChild(n.stateNode),V=!0}catch(e){ff(n,t,e)}else try{hu.removeChild(n.stateNode),V=!0}catch(e){ff(n,t,e)}}break;case 18:hu!==null&&(gu?(e=hu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(hu,n.stateNode));break;case 4:r=hu,i=gu,hu=n.stateNode.containerInfo,gu=!0,_u(e,t,n),hu=r,gu=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),$l||gl(4,n,t),_u(e,t,n);break;case 1:$l||(bl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&vl(n,t,r)),_u(e,t,n);break;case 21:_u(e,t,n);break;case 22:$l=(r=$l)||n.memoizedState!==null,_u(e,t,n),$l=r;break;case 30:bl(n,t),_u(e,t,n);break;case 7:$l||bl(n,t),_u(e,t,n);break;default:_u(e,t,n)}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){ff(t,t.return,e)}}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){ff(t,t.return,e)}}function xu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nu),t;default:throw Error(i(435,e.tag))}}function Su(e,t){var n=xu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=_f.bind(null,e,t);t.then(r,r)}})}function Cu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){hu=l.stateNode,gu=!1;break a}break;case 5:hu=l.stateNode,gu=!1;break a;case 3:case 4:hu=l.stateNode.containerInfo,gu=!0;break a}l=l.return}if(hu===null)throw Error(i(160));vu(s,c,o),hu=null,gu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tu(t,e,n),t=t.sibling}var wu=null;function Tu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Cu(t,e,n),Eu(e),a&4&&(gl(3,e,e.return),hl(3,e),gl(5,e,e.return));break;case 1:Cu(t,e,n),Eu(e),a&512&&($l||r===null||bl(r,r.return)),a&64&&Ql&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=wu,Cu(t,e,n),Eu(e),a&512&&($l||r===null||bl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(Ql)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[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`))),np(r,t,n),r[bt]=e,Pt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[bt]=e,Pt(r),t=r}e.stateNode=t}}else Ql||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Dl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||$l||t.parentNode.removeChild(t)):a.count--,n===null?Ql||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:Cu(t,e,n),Eu(e),a&512&&($l||r===null||bl(r,r.return)),r!==null&&a&4&&Dl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=eu,eu=!1,Cu(t,e,n),eu=o,Eu(e),a&512&&($l||r===null||bl(r,r.return)),e.flags&32){t=e.stateNode;try{cn(t,``),V=!0}catch(t){ff(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Dl(e,t,r===null?t:r.memoizedProps)),a&1024&&(tu=!0);break;case 6:if(Cu(t,e,n),Eu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,V=!0}catch(t){ff(e,e.return,t)}}break;case 3:if(V=!1,Wm=null,o=wu,wu=bm(t.containerInfo),Cu(t,e,n),wu=o,Eu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){ff(e,e.return,t)}tu&&(tu=!1,Du(e)),V=!1;break;case 4:a=eu,eu=Ql,r=Wt(),o=wu,wu=bm(e.stateNode.containerInfo),Cu(t,e,n),Eu(e),wu=o,V&&au&&(ou=!0),V=r,eu=a;break;case 12:Cu(t,e,n),Eu(e);break;case 31:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 13:Cu(t,e,n),Eu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(fd=Re()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Ql,l=$l,u=eu;Ql=c||o,eu=u||o,$l=l||s,Cu(t,e,n),$l=l,eu=u,Ql=c,Eu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Ql||$l||(t=s||$l,n=Ql,r=$l,Ql=o||Ql,$l=t,ju(e,2),Ql=n,$l=r),!o&&eu||du(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Su(e,n))));break;case 19:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 30:a&512&&($l||r===null||bl(r,r.return)),a=Wt(),o=au,s=(n&335544064)===n,c=e.memoizedProps,au=s&&pi(c.default,c.update)!==`none`,Cu(t,e,n),Eu(e),s&&r!==null&&V&&(e.flags|=4),au=o,V=a;break;case 21:break;case 7:a&512&&($l||r===null||bl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Cu(t,e,n),Eu(e)}}function Eu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ol(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Tl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(wl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;jl(e,kl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(cn(l,``),n.flags&=-33),jl(e,kl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Al(e,kl(e),u,s);break;default:throw Error(i(161))}}catch(t){ff(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Du(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Du(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Ou(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ku(t,e),t=t.sibling;else Zl(t,!1)}function ku(e,t){var n=e.alternate;if(n===null)Ul(e,!1);else switch(e.tag){case 3:if(su=iu=!1,Ll(),Ou(t,e),!iu&&!ou){if(e=Il,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),su=!0}Il=null;break;case 5:Ou(t,e);break;case 4:r=iu,iu=!1,Ou(t,e),iu&&(ou=!0),iu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Ou(t,e):Ul(e,!1));break;case 30:r=iu,i=Ll(),iu=!1,Ou(t,e),iu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=di(a,o),o=di(n.memoizedProps,o);var s=pi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Rl=0,t=Xl(e,n,t,o,s,a,!0),Rl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(jd(e,e.memoizedProps.onUpdate),Il=i):i!==null&&(i.push.apply(i,Il),Il=i),iu=e.flags&32?!0:r;break;default:Ou(t,e)}}function Au(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)uu(e,t.alternate,t),t=t.sibling}function ju(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:gl(4,n,n.return),ju(n,r);break;case 1:bl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&vl(n,n.return,i),ju(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:bl(n,n.return),n.tag!==5&&n.tag!==27||Cl(n),ju(n,r);break;case 6:Cl(n);break;case 26:bl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||$l||i.parentNode.removeChild(i),ju(n,r);break;case 22:n.memoizedState===null&&ju(n,r);break;case 30:bl(n,n.return),ju(n,r);break;case 7:bl(n,n.return);default:ju(n,r)}e=e.sibling}}function Mu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Mu(i,a,n),hl(4,a);break;case 1:if(Mu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ff(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++)ho(l[i],c)}catch(e){ff(r,r.return,e)}}s&&o&64&&_l(a),yl(a,a.return);break;case 27:n&2&&Ml(a);case 5:a.tag!==5&&a.tag!==27||Sl(a),Mu(i,a,n),s&&r===null&&o&4&&El(a),yl(a,a.return);break;case 6:Sl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Ql||Km(bm(c.ownerDocument),a.type,c),Mu(i,a,n),s&&r===null&&o&4&&El(a),yl(a,a.return);break;case 12:Mu(i,a,n);break;case 31:Mu(i,a,n),s&&o&4&&yu(i,a);break;case 13:Mu(i,a,n),s&&o&4&&bu(i,a);break;case 22:a.memoizedState===null&&Mu(i,a,n),yl(a,a.return);break;case 30:Mu(i,a,n),yl(a,a.return);break;case 7:yl(a,a.return);default:Mu(i,a,n)}t=t.sibling}}function Nu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&wa(n))}function Pu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&wa(e))}function Fu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Iu(e,t,n,r),t=t.sibling;else i&&Yl(t)}function Iu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Jl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Fu(e,t,n,r),a&2048&&hl(9,t);break;case 1:Fu(e,t,n,r);break;case 3:Fu(e,t,n,r),i&&su&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&wa(a)));break;case 12:if(a&2048){Fu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){ff(t,t.return,e)}}else Fu(e,t,n,r);break;case 31:Fu(e,t,n,r);break;case 13:Fu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Jl(t),o._visibility&2?Fu(e,t,n,r):(o._visibility|=2,Lu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Jl(s),o._visibility&2?Fu(e,t,n,r):Ru(e,t)),a&2048&&Nu(s,t);break;case 24:Fu(e,t,n,r),a&2048&&Pu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Vl(a.child,!0),Vl(t.child,!0))),Fu(e,t,n,r);break;default:Fu(e,t,n,r)}}function Lu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Lu(a,o,s,c,i),hl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Lu(a,o,s,c,i)):u._visibility&2?Lu(a,o,s,c,i):Ru(a,o),i&&l&2048&&Nu(o.alternate,o);break;case 24:Lu(a,o,s,c,i),i&&l&2048&&Pu(o.alternate,o);break;default:Lu(a,o,s,c,i)}t=t.sibling}}function Ru(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ru(n,r),i&2048&&Nu(r.alternate,r);break;case 24:Ru(n,r),i&2048&&Pu(r.alternate,r);break;default:Ru(n,r)}t=t.sibling}}var zu=8192;function Bu(e,t,n){if(e.subtreeFlags&zu)for(e=e.child;e!==null;)Vu(e,t,n),e=e.sibling}function Vu(e,t,n){switch(e.tag){case 26:Bu(e,t,n),e.flags&zu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,wu,e.memoizedState,e.memoizedProps));break;case 5:Bu(e,t,n),e.flags&zu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=wu;wu=bm(e.stateNode.containerInfo),Bu(e,t,n),wu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=zu,zu=16777216,Bu(e,t,n),zu=r):Bu(e,t,n));break;case 30:if((e.flags&zu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Pl===null&&(Pl=new Map),Pl.set(r,i)}Bu(e,t,n);break;default:Bu(e,t,n)}}function Hu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Uu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Wu(e),e=e.sibling}function Wu(e){switch(e.tag){case 0:case 11:case 15:Uu(e),e.flags&2048&&gl(9,e,e.return);break;case 3:Uu(e);break;case 12:Uu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Gu(e)):Uu(e);break;default:Uu(e)}}function Gu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gl(8,t,t.return),Gu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Gu(t));break;default:Gu(t)}e=e.sibling}}function Ku(e,t){for(;ru!==null;){var n=ru;switch(n.tag){case 0:case 11:case 15:gl(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:wa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ru=r;else a:for(n=e;ru!==null;){r=ru;var i=r.sibling,a=r.return;if(mu(r),r===n){ru=null;break a}if(i!==null){i.return=a,ru=i;break a}ru=a}}}var qu={getCacheForType:function(e){var t=ga(Sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ga(Sa).controller.signal}},Ju=typeof WeakMap==`function`?WeakMap:Map,Yu=0,Xu=null,Z=null,Q=0,Zu=0,Qu=null,$u=!1,ed=!1,td=!1,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=null,ud=null,dd=!1,fd=0,pd=0,md=1/0,hd=null,gd=null,_d=0,vd=null,yd=null,bd=0,xd=0,Sd=null,Cd=null,wd=null,Td=null,Ed=null,Dd=0,Od=null;function kd(){return Yu&2&&Q!==0?Q&-Q:L.T===null?_t():Nf()}function Ad(){if(sd===0){if(!(Q&536870912)||Y){var e=tt;tt<<=1,!(tt&3932160)&&(tt=262144),sd=e}else sd=536870912}return e=So.current,e!==null&&(e.flags|=32),sd}function jd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(di(e.memoizedProps,n))),Td===null&&(Td=[]),Td.push(t.bind(null,r))}}function Md(e,t,n){(e===Xu&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)&&(zd(e,0),Id(e,Q,sd,!1)),ut(e,n),(!(Yu&2)||e!==Xu)&&(e===Xu&&(!(Yu&2)&&(ad|=n),rd===4&&Id(e,Q,sd,!1)),Tf(e))}function Nd(e,t,n){if(Yu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||at(e,t),a=r?qd(e,t):Gd(e,t,!0),o=r;do{if(a===0){ed&&!r&&Id(e,t,0,!1);break}if(n=e.current.alternate,o&&!Fd(n))a=Gd(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=ld;var l=c.current.memoizedState.isDehydrated;if(l&&(zd(c,s).flags|=256),s=Gd(c,s,!1),s!==2&&s!==6){if(td&&!l){c.errorRecoveryDisabledLanes|=o,ad|=o,a=4;break a}o=ud,ud=a,o!==null&&(ud===null?ud=o:ud.push.apply(ud,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){zd(e,0),Id(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:Id(r,t,sd,!$u);break a;case 2:ud=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=fd+300-Re(),10<a)){if(Id(r,t,sd,!$u),it(r,0,!0)!==0)break a;bd=t,r.timeoutHandle=gp(Pd.bind(null,r,n,ud,hd,dd,t,sd,ad,cd,$u,o,`Throttled`,-0,0),a);break a}Pd(r,n,ud,hd,dd,t,sd,ad,cd,$u,o,null,-0,0)}break}}while(1);Tf(e)}function Pd(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:gn},Pl=null,Vu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?fd-Re():(a&4194048)===a?pd-Re():0,m=eh(d,m),m!==null)?(bd=a,e.cancelPendingCommit=m(ef.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Id(e,a,o,!l)):ef(e,t,a,n,r,i,o,s,c,l,u,d)}function Fd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Fr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Id(e,t,n,r){t=ot(e,t),t&=~od,t&=~ad,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Xe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ft(e,n,t)}function Ld(){return Yu&6?!0:(Ef(0,!1),!1)}function Rd(){if(Z!==null){if(Zu===0)var e=Z.return;else e=Z,ca=sa=null,Zo(e),Xa=null,Za=0,e=Z;for(;e!==null;)ml(e.alternate,e),e=e.return;Z=null}}function zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bd=0,Rd(),Xu=e,Z=n=Oi(e.current,null),Q=t,Zu=0,Qu=null,$u=!1,ed=at(e,t),td=!1,cd=sd=od=ad=id=rd=0,ud=ld=null,dd=!1,nd=ot(e,t),vi(),n}function Bd(e,t){X=null,L.H=sc,t===Ba||t===Ha?(t=Ja(),Zu=3):t===Va?(t=Ja(),Zu=4):Zu=t===Tc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Qu=t,Z===null&&(rd=1,yc(e,Ii(t,e.current)))}function Vd(){var e=So.current;return e===null?!0:(Q&4194048)===Q?Co===null:(Q&62914560)===Q||Q&536870912?e===Co:!1}function Hd(){var e=L.H;return L.H=sc,e===null?sc:e}function Ud(){var e=L.A;return L.A=qu,e}function Wd(){rd=4,$u||(Q&4194048)!==Q&&So.current!==null||(ed=!0),!(id&134217727)&&!(ad&134217727)||Xu===null||Id(Xu,Q,sd,!1)}function Gd(e,t,n){var r=Yu;Yu|=2;var i=Hd(),a=Ud();(Xu!==e||Q!==t)&&(hd=null,zd(e,t)),t=!1;var o=rd;a:do try{if(Zu!==0&&Z!==null){var s=Z,c=Qu;switch(Zu){case 8:Rd(),o=6;break a;case 3:case 2:case 9:case 6:So.current===null&&(t=!0);var l=Zu;if(Zu=0,Qu=null,Zd(e,s,c,l),n&&ed){o=0;break a}break;default:l=Zu,Zu=0,Qu=null,Zd(e,s,c,l)}}Kd(),o=rd;break}catch(t){Bd(e,t)}while(1);return t&&e.shellSuspendCounter++,ca=sa=null,Yu=r,L.H=i,L.A=a,Z===null&&(Xu=null,Q=0,vi()),o}function Kd(){for(;Z!==null;)Yd(Z)}function qd(e,t){var n=Yu;Yu|=2;var r=Hd(),a=Ud();Xu!==e||Q!==t?(hd=null,md=Re()+500,zd(e,t)):ed=at(e,t);a:do try{if(Zu!==0&&Z!==null){t=Z;var o=Qu;b:switch(Zu){case 1:Zu=0,Qu=null,Zd(e,t,o,1);break;case 2:case 9:if(Wa(o)){Zu=0,Qu=null,Xd(t);break}t=function(){Zu!==2&&Zu!==9||Xu!==e||(Zu=7),Tf(e)},o.then(t,t);break a;case 3:Zu=7;break a;case 4:Zu=5;break a;case 7:Wa(o)?(Zu=0,Qu=null,Xd(t)):(Zu=0,Qu=null,Zd(e,t,o,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Ym(s):c.stateNode.complete){Zu=0,Qu=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,Qd(u))}break b}}Zu=0,Qu=null,Zd(e,t,o,5);break;case 6:Zu=0,Qu=null,Zd(e,t,o,6);break;case 8:Rd(),rd=6;break a;default:throw Error(i(462))}}Jd();break}catch(t){Bd(e,t)}while(1);return ca=sa=null,L.H=r,L.A=a,Yu=n,Z===null?(Xu=null,Q=0,vi(),rd):0}function Jd(){for(;Z!==null&&!Ie();)Yd(Z)}function Yd(e){var t=al(e.alternate,e,nd);e.memoizedProps=e.pendingProps,t===null?Qd(e):Z=t}function Xd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=zc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=zc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:Zo(t);var r=t;r===Ji&&(Y?(ta(r),r.tag===5&&r.stateNode!=null&&(Yi=r.stateNode)):(ta(r),Y=!0));default:ml(n,t),t=Z=ki(t,nd),t=al(n,t,nd)}e.memoizedProps=e.pendingProps,t===null?Qd(e):Z=t}function Zd(e,t,n,r){ca=sa=null,Zo(t),Xa=null,Za=0;var i=t.return;try{if(wc(e,i,t,n,Q)){rd=1,yc(e,Ii(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;rd=1,yc(e,Ii(n,e.current)),Z=null;return}t.flags&32768?(Y||r===1?e=!0:ed||Q&536870912?e=!1:($u=e=!0,(r===2||r===9||r===3||r===6)&&(r=So.current,r!==null&&r.tag===13&&(r.flags|=16384))),$d(t,e)):Qd(t)}function Qd(e){var t=e;do{if(t.flags&32768){$d(t,$u);return}e=t.return;var n=fl(t.alternate,t,nd);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);rd===0&&(rd=5)}function $d(e,t){do{var n=pl(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);rd=6,Z=null}function ef(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do lf();while(_d!==0);if(Yu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Xu&&(Z=Xu=null,Q=0),yd=t,vd=e,bd=n,Sd=a,Cd=r,tf(e,t,n,s,c,l,f)}}function tf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(xd=s,s|=_i,dt(e,n,s,r,i,a),Td=null,(n&335544064)===n?(Ed=Da(e),r=10262):(Ed=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,vf(He,function(){return uf(),null})):(e.callbackNode=null,e.callbackPriority=0),Nl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=L.T,L.T=null,i=R.p,R.p=2,a=Yu,Yu|=4;try{cu(e,t,n)}finally{Yu=a,R.p=i,L.T=r}}_d=1,Nl?wd=Mp(o,e.containerInfo,Ed,af,of,rf,sf,uf,nf,null,null):(af(),of(),sf())}function nf(e){if(_d!==0){var t=vd.onRecoverableError;t(e,{componentStack:null})}}function rf(){_d===3&&(_d=0,ku(yd,vd),_d=4)}function af(){if(_d===1){_d=0;var e=vd,t=yd,n=bd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=L.T,L.T=null;var i=R.p;R.p=2;var a=Yu;Yu|=4;try{au=ou=!1,Tu(t,e,n),n=cp;var o=Vr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Br(s.ownerDocument.documentElement,s)){if(c!==null&&Hr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=zr(s,h),v=zr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{Yu=a,R.p=i,L.T=r}}e.current=t,_d=2}}function of(){if(_d===2){_d=0;var e=vd,t=yd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=L.T,L.T=null;var r=R.p;R.p=2;var i=Yu;Yu|=4;try{uu(e,t.alternate,t)}finally{Yu=i,R.p=r,L.T=n}}_d=3}}function sf(){if(_d===4||_d===3){_d=0;var e=wd;wd=null,Le();var t=vd,n=yd,r=bd,i=Cd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?_d=5:(_d=0,yd=vd=null,cf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(gd=null),gt(r),n=n.stateNode,Je&&typeof Je.onCommitFiberRoot==`function`)try{Je.onCommitFiberRoot(qe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=L.T,a=R.p,R.p=2,L.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{L.T=n,R.p=a}}if(i=Td,o=Ed,Ed=null,i!==null&&(Td=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);bd&3&&lf(),Tf(t),a=t.pendingLanes,r&261930&&a&42?t===Od?Dd++:(Dd=0,Od=t):(Dd=0,Od=null),Ef(0,!1)}}function cf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,wa(t)))}function lf(){return wd!==null&&(wd.skipTransition(),wd=null),af(),of(),sf(),uf()}function uf(){if(_d!==5)return!1;var e=vd,t=xd;xd=0;var n=gt(bd),r=L.T,a=R.p;try{R.p=32>n?32:n,L.T=null,n=Sd,Sd=null;var o=vd,s=bd;if(_d=0,yd=vd=null,bd=0,Yu&6)throw Error(i(331));var c=Yu;if(Yu|=4,Wu(o.current),Iu(o,o.current,s,n),Yu=c,Ef(0,!1),Je&&typeof Je.onPostCommitFiberRoot==`function`)try{Je.onPostCommitFiberRoot(qe,o)}catch{}return!0}finally{R.p=a,L.T=r,cf(e,t)}}function df(e,t,n){t=Ii(n,t),t=xc(e.stateNode,t,2),e=co(e,t,2),e!==null&&(ut(e,2),Tf(e))}function ff(e,t,n){if(e.tag===3)df(e,e,n);else for(;t!==null;){if(t.tag===3){df(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(gd===null||!gd.has(r))){e=Ii(n,e),n=Sc(2),r=co(t,n,2),r!==null&&(Cc(n,r,t,e),ut(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ju;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(td=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xu===e&&(Q&n)===n&&(rd===4||rd===3&&(Q&62914560)===Q&&300>Re()-fd?Yu&2?od|=n:zd(e,0):od|=n,cd===Q&&(cd=0)),Tf(e)}function hf(e,t){t===0&&(t=ct()),e=xi(e,t),e!==null&&(ut(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(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),hf(e,n)}function vf(e,t){return Pe(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;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-Xe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=Q,a=it(r,r===Xu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||at(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&hp()&&(e=wf);for(var t=Re(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}_d!==0&&_d!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Xe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=st(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Xu,n=Q,n=it(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Fe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||at(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Fe(r),gt(n)){case 2:case 8:n=Ve;break;case 32:n=He;break;case 268435456:n=We;break;default:n=He}return r=Af.bind(null,e),n=Pe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Fe(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(_d!==0&&_d!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lf()&&e.callbackNode!==n)return null;var r=Q;return r=it(e,e===Xu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Nd(e,r,t),kf(e,Re()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(lf())return null;Nd(e,t,!0)}function Mf(){bp(function(){Yu&6?Pe(Be,Df):Of()})}function Nf(){if(wf===0){var e=Aa;e===0&&(e=et,et<<=1,!(et&261888)&&(et=256)),wf=e}return wf}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:hn(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[xt]||null).action),o=r.submitter;o&&(t=(t=o[xt]||null)?Pf(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(wf!==0){var e=new FormData(i,o);qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<ci.length;If++){var Lf=ci[If];li(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}li(ei,`onAnimationEnd`),li(ti,`onAnimationIteration`),li(ni,`onAnimationStart`),li(`dblclick`,`onDoubleClick`),li(`focusin`,`onFocus`),li(`focusout`,`onBlur`),li(ri,`onTransitionRun`),li(ii,`onTransitionStart`),li(ai,`onTransitionCancel`),li(oi,`onTransitionEnd`),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 Rf=`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(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){mi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){mi(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[Ct];n===void 0&&(n=t[Ct]=new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,It.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!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 Gf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=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=_n(n),s=[];a:{var c=si.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=W;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=G;break;case ei:case ti:case ni:l=Gn;break;case oi:l=tr;break;case`scroll`:case`scrollend`:l=Ln;break;case`wheel`:l=nr;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=$n;break;case`submit`:l=er;break;case`toggle`:case`beforetoggle`:l=rr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Sn(m,p),g!=null&&d.push(Kf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==H&&(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=$n,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,Jf):null,c!==null&&Yf(s,u,c,d,!1),l!==null&&f!==null&&Yf(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 _=Cr;else if(_r(c)){if(wr)_=Nr;else{_=jr;var v=Ar}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&fn(r.elementType)&&(_=Cr):_=Mr;if(_&&=_(e,r)){vr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Mt(r):window,e){case`focusin`:(_r(v)||v.contentEditable===`true`)&&(Wr=v,Gr=r,Kr=null);break;case`focusout`:Kr=Gr=Wr=null;break;case`mousedown`:qr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:qr=!1,Jr(s,n,i);break;case`selectionchange`:if(Ur)break;case`keydown`:case`keyup`:Jr(s,n,i)}var y;if(ar)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else pr?dr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(cr&&n.locale!==`ko`&&(pr||b!==`onCompositionStart`?b===`onCompositionEnd`&&pr&&(y=kn()):(En=i,Dn=`value`in En?En.value:En.textContent,pr=!0)),v=qf(r,b),0<v.length&&(b=new qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=fr(n),y!==null&&(b.data=y)))),(y=sr?mr(e,n):hr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Ff(s,e,r,n,i)}Bf(s,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Sn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=Sn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Sn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=Sn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
10
+ `).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||cn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&cn(e,``+r);else return;break;case`className`:Kt(e,`class`,r);break;case`tabIndex`:Kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Kt(e,n,r);break;case`style`:dn(e,r,o);return;case`data`:if(t!==`object`){Kt(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=hn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,a.name,a,null),ep(e,t,`formEncType`,a.formEncType,a,null),ep(e,t,`formMethod`,a.formMethod,a,null),ep(e,t,`formTarget`,a.formTarget,a,null)):(ep(e,t,`encType`,a.encType,a,null),ep(e,t,`method`,a.method,a,null),ep(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=hn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=gn);return;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`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=hn(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`:$(`beforetoggle`,e),$(`toggle`,e),Gt(e,`popover`,r);break;case`xlinkActuate`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:qt(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=pn.get(n)||n,Gt(e,n,r);else return}V=!0}function tp(e,t,n,r,a,o){switch(n){case`style`:dn(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`)cn(e,r);else if(typeof r==`number`||typeof r==`bigint`)cn(e,``+r);else return;break;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=gn);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 np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ep(e,t,o,s,n,null)}}a&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:ep(e,t,r,d,n,null)}}nn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ep(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&an(e,!!r,n,!0):an(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:ep(e,t,s,c,n,null)}sn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)$(Rf[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ep(e,t,u,r,n,null)}return;default:if(fn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(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&&ep(e,t,p,m,r,f)}}tn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||ep(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(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&&ep(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?an(e,!!n,n?[]:``,!1):an(e,!!n,t,!0)):an(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(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&&ep(e,t,s,a,r,o)}on(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(V=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(fn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[bt]=r,n[xt]=t,np(n,e,t),Pt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Dt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=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 Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),Zp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),kt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[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=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===gn&&(e.onclick=null),kt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);kt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=R.d;R.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Ld();return e||t}function Cm(e){var t=jt(e);t!==null&&t.tag===5&&t.type===`form`?Ys(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=en(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Pt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+en(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+en(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+en(n.imageSizes)+`"]`)):i+=`[href="`+en(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Ot]=!0,o.onload=o.onerror=function(){Ft(o)}),Pt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+en(r)+`"][href="`+en(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Pt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Nt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Pt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Nt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Pt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Nt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Pt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=Se.current)?bm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=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=Pm(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(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=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 Pm(e){return`href="`+en(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ot]){r.loading=1;return}}else t=e.createElement(`link`),t[Ot]=!0,t.onload=t.onerror=Ft.bind(null,t),np(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 Rm(e){return`[src="`+en(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+en(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),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,Pt(o),o;r=Im(n),(a=vm.get(a))&&Hm(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}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,Pt(a),a):(r=n,(a=vm.get(o))&&(r=D({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Pt(a),np(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[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 Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Pt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:F,Provider:null,Consumer:null,_currentValue:me,_currentValue2:me,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=lt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lt(0),this.hiddenUpdates=lt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ei(3,null,null,t),e.current=a,a.stateNode=e,t=Ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ao(a),e}function uh(e){return e?(e=wi,e):wi}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=so(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=co(e,r,t),n!==null&&(Md(n,e,t),lo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=xi(e,67108864);t!==null&&Md(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=kd();t=ht(t);var n=xi(e,t);n!==null&&Md(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=2,yh(e,t,n,r)}finally{R.p=a,L.T=i}}function vh(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=8,yh(e,t,n,r)}finally{R.p=a,L.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=jt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=rt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Xe(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(Yu&6)&&(md=Re()+500,Ef(0,!1))}}break;case 31:case 13:s=xi(a,2),s!==null&&Md(s,a,2),Ld(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=_n(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(ze()){case Be:return 2;case Ve:return 8;case He:case Ue:return 32;case We: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&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=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(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,vt(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);H=r,n.target.dispatchEvent(r),H=null}else return t=jt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=jt(n);a!==null&&(e.splice(t,3),t-=3,qs(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;dh(n,kd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Ld(),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`));R.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:L,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{qe=Jh.inject(qh),Je=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=gc,s=_c,c=vc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[St]=t.current,Uf(e),new Wh(t)}})),_=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_(),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 A=[{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 j(e,t){return A.find(n=>n.kind===t&&n.pattern===e)?.name}function M(e,t){return A.filter(n=>!(n.kind===`command`?e:t).includes(n.pattern))}function N(e){let t=M(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 P=[`Blocks a finished PR`,`Blocks a card from Ready`,`Process`,`Housekeeping`,`Record only`],F=`Accepted.`,I=`Changes needed:`;function ee(e,t){let n=t.trim();return e===`accept`?{answer:n?`${F}\n\n${n}`:F}:n?{answer:`${I} ${n}`}:{problem:`Say what needs changing in the box first.`}}var te=/\s*\(recommended\)\s*$/i,ne=e=>e.replace(/\*\*|`/g,``);function re(e){let t=e.match(/^\*\*(.+?)\*\*[.:]?\s*([\s\S]*)$/);return t?{label:t[1].replace(/\.$/,``),detail:t[2].trim()}:{label:e,detail:``}}function ie(e){return`${e.key} — ${ne(re(e.text).label)}`}function ae(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(`
11
+ `)}`),n.push(`Answered "${F}" or "${I} …" on the review page.`),n.join(`
12
+
13
+ `)}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(`
14
+ `)),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(`
15
+
16
+ `)}function oe(e){let t=e.details;if(t?.review)return{structured:!0,title:t.title||de(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||de(t.issue||e.question),issue:[t.issue,se(e.question,t)].filter(Boolean).join(`
17
+
18
+ `)||(t.title?``:e.question),evidence:t.evidence??``,options:t.options?.length?t.options.map(e=>({key:e.key,...re(e.text),cost:e.cost??``,answer:ie(e)})):ue(e.options).options,opinions:ce(t,t.options?.length?null:ue(e.options).recommended),tier:t.tier??null,rank:t.rank??null,refs:t.refs??[],review:null};let{options:n,recommended:r}=ue(e.options);return{structured:!1,title:de(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 se(e,t){let n=e.trim();return!n||n===t.issue?.trim()||n===t.title?.trim()||n===ae(void 0,t).trim()?``:e}function ce(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 le(e){return new Set(e.map(e=>e.pick).filter(e=>e!==null)).size>1}function ue(e){let t=null;return{options:(e??[]).map((e,n)=>{let r=String(n+1);return te.test(e)&&!t&&(t=r),{key:r,label:e.replace(te,``),detail:``,cost:``,answer:e}}),recommended:t}}function de(e){let t=e.split(`
19
+ `);if(t.length>2&&t[0].trim().length<=110&&!t[1].trim())return ne(t[0].trim()).replace(/^#+\s*/,``);let n=ne(e).replace(/\s+/g,` `).trim(),r=n.match(/^(.{10,110}?[.?!])(\s|$)/);return r?r[1]:n.slice(0,100)+(n.length>100?`…`:``)}function fe(e,t){return e&&t.includes(e)?e:null}function pe(e){let t=[];for(let n of e)for(let e of n)t.includes(e)||t.push(e);return t}function L(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 R=()=>globalThis.location?.protocol===`https:`,me=null,he=e=>{me=e},ge=()=>{if(!me)throw Error(`This browser has no passkeys.`);return me},_e=`The passkey check was cancelled.`,ve=null,ye=e=>{ve=e},be=!1;async function xe(e,t,n){let r=t===`/api/device-unlock`?`unlock`:`sign`;if(ve&&(r===`unlock`||!be)){if(!await ve({kind:r}))throw Error(_e);be=!0}for(;;){let i=await z(`POST`,`/api/passkey-challenge`,{method:e,path:t,body:n});try{return await ge().sign(i)}catch(e){let t=e instanceof Error?e.message:String(e);if(!ve||!await ve({kind:r,failed:t}))throw e}}}var Se=null,Ce=[],we=e=>{Se=e,e&&Ce.splice(0).forEach(t=>t(e))},Te=()=>{Se=null},Ee=null,De=null,Oe=e=>{Ee=e};function ke(e){let t=new WebSocket(e);return De=t,t.addEventListener(`close`,()=>{De===t&&Te()}),t}var Ae=5e3;function je(){return Se?Promise.resolve(Se):new Promise(e=>{let t=t=>{clearTimeout(n),e(t)},n=setTimeout(()=>{Ce=Ce.filter(e=>e!==t),e(null)},Ae);Ce.push(t)})}var Me=async e=>(await e.clone().json().catch(()=>({}))).error;async function z(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 je():null,s=await i(o);if(a&&s.status===403&&o&&Ee&&(await Me(s))?.startsWith(`Only Ledung's open page can do this`)&&Se===o&&(Te(),Ee()),a&&s.status===403&&Se!==o){let e=await je();e&&(s=await i(o=e))}let c=async()=>a&&R()&&s.status===403?Me(s):void 0;await c()===`This device is locked: unlock it with its passkey to make changes from here.`&&(await z(`POST`,`/api/device-unlock`,{}),s=await i(o)),a&&R()&&s.status===403&&await c()===`This needs your passkey.`&&(s=await i(o,await xe(e,t,r??``)));let l=await s.json().catch(()=>({}));if(!s.ok)throw Error(l.error??`Request failed (${s.status}).`);return l}var B={messages:(e,t)=>z(`GET`,`/api/sessions/${e}/messages?limit=500${t?`&before=${t}`:``}`),messagesAfter:(e,t)=>z(`GET`,`/api/sessions/${e}/messages?limit=500&after=${t}`),start:(e,t)=>z(`POST`,`/api/sessions`,{project:e,role:`session`,...t?{profile:t}:{}}),startChat:e=>z(`POST`,`/api/chats-new`,e),updateChats:e=>z(`POST`,`/api/chats`,{sensitive:e}),setChatsColour:e=>z(`POST`,`/api/chats-colour`,{colour:e}),editComputer:(e,t)=>z(`POST`,`/api/computers`,{id:e,...t}),send:(e,t)=>z(`POST`,`/api/sessions/${e}/messages`,{text:t}),shellCheck:(e,t)=>z(`GET`,`/api/sessions/${e}/shell-check?command=${encodeURIComponent(t)}`),shell:(e,t,n)=>z(`POST`,`/api/sessions/${e}/shell`,{command:t,confirmed:n}),shellStop:e=>z(`POST`,`/api/sessions/${e}/shell-stop`,{}),secrets:e=>z(`GET`,`/api/sessions/${e}/secrets`),addSecret:(e,t)=>z(`POST`,`/api/sessions/${e}/secrets`,t),editSecret:(e,t,n)=>z(`POST`,`/api/sessions/${e}/secret-edit`,{secret:t,...n}),removeSecret:(e,t)=>z(`POST`,`/api/sessions/${e}/secret-remove`,{secret:t}),setPermissionMode:(e,t)=>z(`POST`,`/api/sessions/${e}/permission-mode`,{mode:t}),interrupt:e=>z(`POST`,`/api/sessions/${e}/interrupt`,{}),mcpServers:e=>z(`GET`,`/api/sessions/${e}/mcp`),reconnectMcp:(e,t)=>z(`POST`,`/api/sessions/${e}/mcp-reconnect`,{name:t}),stop:e=>z(`POST`,`/api/sessions/${e}/stop`,{}),resume:e=>z(`POST`,`/api/sessions/${e}/resume`,{}),archive:e=>z(`POST`,`/api/sessions/${e}/archive`,{}),unarchive:e=>z(`POST`,`/api/sessions/${e}/unarchive`,{}),rename:(e,t)=>z(`POST`,`/api/sessions/${e}/rename`,{title:t}),restart:()=>z(`POST`,`/api/restart`,{}),stopLedung:()=>z(`POST`,`/api/stop`,{}),shortcuts:()=>z(`GET`,`/api/shortcuts`),shortcutsAct:e=>z(`POST`,`/api/shortcuts`,{action:e}),updateStatus:()=>z(`GET`,`/api/update`),updateCheck:()=>z(`POST`,`/api/update-check`,{}),update:()=>z(`POST`,`/api/update`,{}),updateChannel:e=>z(`POST`,`/api/update-channel`,{channel:e}),certificateCheck:()=>z(`POST`,`/api/certificate-check`,{}),remoteLink:()=>z(`GET`,`/api/remote-link`),remoteJoin:e=>z(`POST`,`/api/remote-join`,{code:e}),remoteLeave:()=>z(`POST`,`/api/remote-leave`,{}),relayAdmin:()=>z(`GET`,`/api/relay-admin`),setRelayAdmin:e=>z(`POST`,`/api/relay-admin`,e),makeRelayAdminKey:()=>z(`POST`,`/api/relay-admin-key`,{}),relayComputers:()=>z(`GET`,`/api/relay-computers`),relayInvite:(e,t)=>z(`POST`,`/api/relay-invite`,{owner:e,...t?{name:t}:{}}),revokeRelayInvite:e=>z(`POST`,`/api/relay-invites/${encodeURIComponent(e)}/revoke`,{}),approveComputer:e=>z(`POST`,`/api/relay-computers/${encodeURIComponent(e)}/approve`,{}),computerAdded:e=>z(`POST`,`/api/relay-computers/${encodeURIComponent(e)}/added`,{}),usage:e=>z(`GET`,`/api/usage?${new URLSearchParams(Object.entries(e).filter(([,e])=>e)).toString()}`),sessionUsage:e=>z(`GET`,`/api/sessions/${e}/usage`),overview:()=>z(`GET`,`/api/overview`),answerQuestion:(e,t)=>z(`POST`,`/api/questions/${e}/answer`,{answer:t}),withdrawQuestion:e=>z(`POST`,`/api/questions/${e}/withdraw`,{}),evidenceText:(e,t)=>z(`GET`,`/api/questions/${e}/evidence/${t}`),file:(e,t,n)=>z(`GET`,`/api/sessions/${e}/file?path=${encodeURIComponent(t)}${n?`&in=${n}`:``}`),paneFolders:e=>z(`GET`,`/api/sessions/${e}/folders`),tree:(e,t,n)=>z(`GET`,`/api/sessions/${e}/tree?in=${t}&path=${encodeURIComponent(n)}`),changes:e=>z(`GET`,`/api/sessions/${e}/changes`),sendLineComments:(e,t)=>z(`POST`,`/api/sessions/${e}/line-comments`,t),decide:(e,t)=>z(`POST`,`/api/permissions/${e}`,t),projects:()=>z(`GET`,`/api/projects`),setProjectColours:(e,t)=>z(`POST`,`/api/projects/${encodeURIComponent(e)}/colours`,t),orderProjects:e=>z(`POST`,`/api/projects-order`,{names:e}),orderSessions:e=>z(`POST`,`/api/sessions-order`,{ids:e}),accounts:()=>z(`GET`,`/api/accounts`),checkSignIn:()=>z(`POST`,`/api/signin-check`),addAccount:e=>z(`POST`,`/api/accounts`,e),setAccountChoices:e=>z(`POST`,`/api/account-choices`,e),openAccountFolder:e=>z(`POST`,`/api/accounts/${encodeURIComponent(e)}/open-folder`,{}),removeAccount:e=>z(`POST`,`/api/accounts/${encodeURIComponent(e)}/remove`,{}),addProject:e=>z(`POST`,`/api/projects`,e),createProject:e=>z(`POST`,`/api/projects-new`,e),updateProject:(e,t)=>z(`POST`,`/api/projects/${encodeURIComponent(e)}`,t),renameProject:(e,t,n)=>z(`POST`,`/api/projects/${encodeURIComponent(e)}/rename`,{name:t,...n?{settings:n}:{}}),removeProject:e=>z(`POST`,`/api/projects/${encodeURIComponent(e)}/remove`,{}),messageManager:(e,t)=>z(`POST`,`/api/projects/${encodeURIComponent(e)}/manager`,{text:t}),browse:e=>z(`GET`,`/api/browse${e?`?path=${encodeURIComponent(e)}`:``}`),containers:()=>z(`GET`,`/api/containers`),skills:e=>z(`GET`,`/api/skills${e?`?project=${encodeURIComponent(e)}`:``}`),setSkillDefaults:e=>z(`POST`,`/api/skill-defaults`,e),setMacros:e=>z(`POST`,`/api/macros`,{macros:e}),profiles:()=>z(`GET`,`/api/profiles`),claudeCode:()=>z(`GET`,`/api/claude-code`),browseContainer:(e,t,n)=>z(`GET`,`/api/browse-container?${new URLSearchParams({container:e,user:t,path:n??``}).toString()}`),workflowCheck:(e,t,n)=>z(`GET`,`/api/workflow-check?${new URLSearchParams({path:e??``,config:t??``,workflow:n??``}).toString()}`),projectsFolder:()=>z(`GET`,`/api/projects-folder`),flow:e=>z(`GET`,`/api/projects/${encodeURIComponent(e)}/flow`),saveFlow:(e,t)=>z(`POST`,`/api/projects/${encodeURIComponent(e)}/flow`,{files:t}),machine:()=>z(`GET`,`/api/machine`),setLimit:e=>z(`POST`,`/api/limit`,{limit:e}),setUsageStop:(e,t,n)=>z(`POST`,`/api/usage-stops`,{account:e,kind:t,percent:n}),liftUsageStop:(e,t)=>z(`POST`,`/api/usage-lift`,{account:e,kind:t}),away:(e,t)=>z(`POST`,`/api/away`,{until:e,allow:t}),back:()=>z(`DELETE`,`/api/away`),setPriority:(e,t)=>z(`POST`,`/api/sessions/${e}/priority`,{priority:t}),setPaused:(e,t)=>z(`POST`,`/api/sessions/${e}/pause`,{paused:t}),cancelClear:e=>z(`POST`,`/api/sessions/${e}/cancel-clear`,{}),startNow:e=>z(`POST`,`/api/sessions/${e}/start-now`,{}),turns:e=>z(`GET`,`/api/sessions/${e}/turns`),board:()=>z(`GET`,`/api/board`),boardThreads:()=>z(`GET`,`/api/board-threads`),boardThread:(e,t)=>z(`GET`,`/api/board-thread?${new URLSearchParams({repo:e,id:t}).toString()}`),boardPeople:e=>z(`GET`,`/api/board-projects/${encodeURIComponent(e)}/people`),boardRepos:(e,t=!1)=>z(`GET`,`/api/board-projects/${encodeURIComponent(e)}/repos${t?`?refresh=1`:``}`),boardOwners:()=>z(`GET`,`/api/board-owners`),usagePublish:()=>z(`GET`,`/api/usage-publish`),setUsagePublish:(e,t,n)=>z(`POST`,`/api/usage-publish`,{enabled:e,repo:t,...n}),usagePublishRepos:(e=!1)=>z(`GET`,`/api/usage-publish-repos${e?`?refresh=1`:``}`),revealUsageKey:()=>z(`POST`,`/api/usage-key-reveal`,{}),setUsageKey:e=>z(`POST`,`/api/usage-key`,{key:e}),takeLinkedUsageKey:()=>z(`POST`,`/api/usage-key`,{fromLinked:!0}),sharedUsage:(e=!1)=>z(`GET`,`/api/usage-shared${e?`?fresh=1`:``}`),removeSharedUsage:e=>z(`POST`,`/api/usage-shared-remove`,{id:e,confirm:!0}),createBoardRepo:(e,t)=>z(`POST`,`/api/board-repos`,{owner:e,name:t,confirm:!0}),setBoardProject:(e,t)=>z(`POST`,`/api/board-projects/${encodeURIComponent(e)}`,t),typicalCosts:(e=30)=>z(`GET`,`/api/typical-costs?days=${e}`),links:()=>z(`GET`,`/api/links`),linkCode:()=>z(`POST`,`/api/links-code`,{}),joinLink:(e,t)=>z(`POST`,`/api/links-join`,{code:e,name:t}),unlink:e=>z(`POST`,`/api/links/${encodeURIComponent(e)}/remove`,{}),linkDevicePair:e=>z(`POST`,`/api/link-device-pair`,{id:e}),dismissLinkPairing:e=>z(`POST`,`/api/link-pairings/${encodeURIComponent(e)}/dismiss`,{}),devices:()=>z(`GET`,`/api/devices`),pairDevice:(e=`phone`)=>z(`POST`,`/api/devices-pair`,{kind:e}),revokeDevice:e=>z(`POST`,`/api/devices/${encodeURIComponent(e)}/revoke`,{}),thisDevice:()=>z(`GET`,`/api/device`),unlockDevice:()=>z(`POST`,`/api/device-unlock`,{}),passkeyEnrolLink:()=>z(`POST`,`/api/passkey-enrol-link`,{}),logOutDevice:()=>z(`POST`,`/api/device-logout`,{}),pushState:()=>z(`GET`,`/api/push`),pushOn:e=>z(`POST`,`/api/push`,{subscription:e}),pushOff:()=>z(`POST`,`/api/push-off`,{}),renameDevice:e=>z(`POST`,`/api/device-name`,{name:e}),addPasskey:async()=>{let e=await z(`POST`,`/api/passkey-options`,{});return z(`POST`,`/api/passkey`,{response:await ge().create(e)})}};function Ne(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 Pe(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 Fe=`
20
+
21
+ ---
22
+
23
+ `,Ie=/^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 Le(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 Re(e){let t=Ie.exec(e);if(!t)return null;let n=Le(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(`
24
+ `)?null:{...n,threadId:t[1],title:t[2],to:t[4],text:i.slice(0,a),note:o.trim()}}function ze(e){let t=[],n=[],r=()=>{n.length&&t.push({type:`text`,text:n.join(Fe)}),n.length=0},i=0;for(;i<=e.length;){let a=e.slice(i),o=Ue(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(Fe);if(n.push(s<0?a:a.slice(0,s)),s<0)break;i+=s+7}return r(),t}function Be(e,t,n,r){if(!e||t)return null;let i=ze(n??``);return r?i:i.filter(e=>e.type===`board`||e.text.split(Fe).some(He))}var Ve=/^(?:.*\. )?(?:Your task, from your manager|Message from your manager)(?: ".*")?:$/,He=e=>Ve.test(e.split(`
25
+ `,1)[0]);function Ue(e){let t=Ie.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(Fe,a),s=o<0?e.length:o,c=Re(e.slice(0,s));return c?{mark:c,length:s}:null}var We=e=>/(^|__)board_post$/.test(e);function Ge(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 Ke(e,t){return t.toLowerCase().split(/\s+/).filter(Boolean).every(t=>e.toLowerCase().includes(t))}function qe(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=>Ke(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())&&Ke(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 Je(e){return`${e.trim().toLowerCase().replace(/[^a-z0-9_.-]+/g,`-`).replace(/^[-.]+|[-.]+$/g,``).replace(/-{2,}/g,`-`)||`ledung`}-board`.slice(0,100)}var Ye=`ledung.autocorrect`;function Xe(e){try{return e.getItem(Ye)===`1`}catch{return!1}}function Ze(e,t){try{t?e.setItem(Ye,`1`):e.removeItem(Ye)}catch{}}var Qe={autoCorrect:`off`},$e={};function et(e){return e?$e:Qe}var tt=[{id:`system`,label:`System`},{id:`light`,label:`Light`},{id:`dark`,label:`Dark`}],nt=`ledung.theme`;function rt(e){return e===`light`||e===`dark`?e:`system`}function it(e){try{return rt(e.getItem(nt))}catch{return`system`}}function at(e,t){try{t===`system`?e.removeItem(nt):e.setItem(nt,t)}catch{}}function ot(e,t){t===`system`?e.removeAttribute(`data-theme`):e.setAttribute(`data-theme`,t)}var st={starting:`Ready`,idle:`Ready`,queued:`Waiting for a free place`,running:`Working`,waiting:`Needs your answer`,stopping:`Stopping`,ended:`Ended`};function ct(e){return e.status===`starting`||e.paused&&e.status===`running`?`idle`:e.status}var lt=`ledung.statusDot`;function ut(e){try{return e.getItem(lt)===`1`}catch{return!1}}function dt(e,t){try{t?e.setItem(lt,`1`):e.removeItem(lt)}catch{}}function ft(e,t){return e?{dot:!0,ended:!1}:{dot:!1,tooltip:st[t.status],ended:t.status===`ended`}}var pt=`ledung.archivedLink`;function mt(e){try{return e.getItem(pt)===`1`}catch{return!1}}function ht(e,t){try{t?e.setItem(pt,`1`):e.removeItem(pt)}catch{}}function gt(e,t,n){return e&&t>0&&!n}var _t=`ledung.compactSidebar`,vt=3,yt=[{step:1,label:`None`},{step:2,label:`Less padding, no time row`},{step:3,label:`Name + ship`},{step:4,label:`Tightest`}],bt=e=>e===1||e===2||e===3||e===4?e:null;function xt(e){try{return bt(Number(e.getItem(`ledung.compactSidebar`)))??vt}catch{return vt}}function St(e,t){try{t===vt?e.removeItem(_t):e.setItem(_t,String(t))}catch{}}function Ct(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 wt(e,t,n,r){let i=[t??``,...e>1?[n,r]:[]].filter(Boolean);return i.length?i.join(`
26
+ `):void 0}var Tt={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 Et(e,t){return e?t===`manager`||e.sessions===`same`?e.manager:e.sessions===`none`?null:e.sessions:null}var Dt=[`green`,`purple`,`teal`,`amber`,`pink`,`orange`];function Ot(e){return Tt[e]}function kt(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 At=3e3,jt=`ledung:paired?`,Mt=`ledung:paired`;function Nt(e,t,n,r=`not-paired`){return!!e.linked&&!e.here&&!t&&!n&&r===`not-paired`}function Pt(){return jt}function Ft(e,t){return t&&e===jt?Mt:null}function It(e,t){let n;try{n=new URL(t).origin}catch{return!1}return e.fromFrame&&e.origin===n&&e.data===Mt}function Lt(e,t){return t!==null&&e.some(e=>e.id===t&&!e.here)?t:null}function Rt(e){let t=/^#\/c\/([^/]+)$/.exec(e);if(!t)return null;try{return decodeURIComponent(t[1]).toLowerCase()}catch{return null}}function zt(e){if(!e)return;let{light:t,dark:n}=Ot(e.colour);return{"--cc-light":t,"--cc-dark":n}}function Bt(e=globalThis){return e.self!==e.top}function Vt(e){return e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}function Ht(e,t,n){return e.here?t===null?0:n:e.waiting??0}var Ut=[nt,Ye,lt,pt,_t],V=16,Wt=`ledung:settings?`,Gt=`ledung:settings`,Kt=`ledung:setting`,qt=e=>typeof e==`string`&&Ut.includes(e),Jt=e=>typeof e==`string`&&e.length<=V,Yt=e=>typeof e==`object`&&e&&!Array.isArray(e)?e:null;function Xt(e){let t={};for(let[n,r]of Object.entries(Yt(e)??{}))qt(n)&&Jt(r)&&(t[n]=r);return t}function Zt(e){return`ledung.frameSettings.${e}`}function Qt(e,t){try{let n=e.getItem(Zt(t));return n===null?null:Xt(JSON.parse(n))}catch{return null}}function $t(e,t,n,r){let i;try{i=new URL(t).origin}catch{return null}if(!e.fromFrame||e.origin!==i)return null;let a=Yt(e.data);if(a?.type===Wt)return{type:Gt,settings:Qt(r,n)};if(a?.type===Kt&&qt(a.key)&&(a.value===null||Jt(a.value))){let e={...Qt(r,n)};a.value===null?delete e[a.key]:e[a.key]=a.value;try{r.setItem(Zt(n),JSON.stringify(e))}catch{}}return null}function en(e,t,n,r){let i=$t(e,t.url,t.id,n);return i&&r(i),It(e,t.url)}function tn(){return{type:Wt}}function nn(e,t){let n=Yt(e);if(t&&n?.type===Gt)return n.settings===null?null:Xt(n.settings)}function rn(e,t){try{for(let n of Ut){let r=t[n];r===void 0?e.removeItem(n):e.setItem(n,r)}}catch{}}function an(e){let t=[];try{for(let n of Ut){let r=e.getItem(n);Jt(r)&&t.push({type:Kt,key:n,value:r})}}catch{}return t}function on(e,t){return{getItem:t=>e().getItem(t),setItem:(n,r)=>{e().setItem(n,r),qt(n)&&Jt(r)&&t({type:Kt,key:n,value:r})},removeItem:n=>{e().removeItem(n),qt(n)&&t({type:Kt,key:n,value:null})}}}var sn=null,cn=e=>{sn!==null&&window.parent.postMessage(e,sn)},ln=on(()=>localStorage,cn);function un(){Bt()&&(window.addEventListener(`message`,e=>{let t=nn(e.data,e.source===window.parent);if(t!==void 0){if(sn=e.origin,t===null)for(let e of an(localStorage))cn(e);else rn(localStorage,t),window.dispatchEvent(new StorageEvent(`storage`,{key:null}))}}),window.parent.postMessage(tn(),`*`))}var dn=new Set,fn=Xe(localStorage),pn=e=>{fn=e;for(let e of dn)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.autocorrect`||e.key===null)&&pn(Xe(localStorage))});var mn=e=>(dn.add(e),()=>{dn.delete(e)}),hn=()=>fn;function gn(){return[(0,v.useSyncExternalStore)(mn,hn),e=>{Ze(ln,e),pn(e)}]}function H(){return et((0,v.useSyncExternalStore)(mn,hn))}var _n=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})),vn=o(((e,t)=>{t.exports=_n()})),U=vn();function yn({board:e,open:t,connection:n,onClick:r}){let i=Pe(e);return i?(0,U.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 bn=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`},xn=e=>e.trim().replace(/^@/,``),Sn=(e,t)=>e.toLowerCase()===t.toLowerCase(),Cn=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,wn=e=>e.state===`ok`?`On`:e.state===`starting`?`Starting`:e.state===`error`?`Problem`:`Off`;function Tn({board:e}){return e?.configured?(0,U.jsxs)(`section`,{className:`board-settings`,children:[(0,U.jsx)(`h3`,{children:`Message board`}),(0,U.jsxs)(`p`,{className:`muted`,children:[e.identity?(0,U.jsxs)(U.Fragment,{children:[`Every board posts as `,(0,U.jsxs)(`strong`,{children:[`@`,e.identity]}),`, the GitHub login of this computer (`,(0,U.jsx)(`span`,{className:`mono`,children:`gh`}),`).`]}):(0,U.jsxs)(U.Fragment,{children:[`Boards post as this computer's GitHub login (`,(0,U.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,U.jsx)(En,{repo:t,board:e},t.repo))]}):(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Message board`}),(0,U.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 En({repo:e,board:t}){let n=e.state===`ok`?`ok`:e.state===`error`?`warn`:`idle`;return(0,U.jsxs)(`div`,{className:`board-block`,children:[(0,U.jsxs)(`p`,{className:`board-state`,children:[(0,U.jsx)(`span`,{className:`board-dot ${n}`,"aria-hidden":`true`}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`mono`,children:e.repo}),` · `,wn(e),e.state===`ok`||e.state===`error`?(0,U.jsxs)(U.Fragment,{children:[` · checked `,bn(e.lastPollAt)]}):null]})]}),e.error&&(0,U.jsx)(`p`,{className:`board-error`,children:e.error}),(0,U.jsxs)(`p`,{className:`muted`,children:[`Projects: `,e.projects.map((n,r)=>(0,U.jsxs)(`span`,{children:[r?`, `:``,n,t.projects[n]?.enabled?``:` (off)`,e.frontDesk===n?` (front desk)`:``]},n)),e.frontDesk?null:(0,U.jsxs)(U.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,U.jsxs)(`ul`,{className:`board-counts`,children:[e.ignored.map(e=>(0,U.jsxs)(`li`,{children:[e.count,` post`,e.count===1?``:`s`,` from `,(0,U.jsxs)(`strong`,{children:[`@`,e.login]}),` ignored: no project here allows them (last `,bn(e.lastAt),`).`]},e.login)),e.quiet>0&&(0,U.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,U.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 Dn=(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}},On=e=>e.split(/[\s,]+/).filter(Boolean).map(e=>e.replace(/^#/,``).toLowerCase()).join(` `);function kn(e,t){let n=e.repo.trim();return[e.enabled!==t.enabled,n!==t.repo,e.frontDesk!==t.frontDesk,On(e.channels)!==On(t.channels),e.allow.length!==t.allow.length||e.allow.some(e=>!t.allow.some(t=>Sn(t,e)))].filter(Boolean).length}function An(e){let t=e.repo.trim();return t&&!Cn.test(t)?`The board repository is owner/name.`:e.enabled&&!t?`Name the board repository to turn the board on.`:null}function jn(e,t){let n=t.repo.trim();return B.setBoardProject(e,{enabled:t.enabled,repo:n||null,allow:t.allow,channels:t.channels.split(/[\s,]+/).filter(Boolean),frontDesk:t.frontDesk&&!!n})}function Mn({board:e,project:t,projects:n,form:r,onChange:i}){let a=H(),o=Dn(e,t),s=e=>i({...r,...e}),c=r.repo.trim(),l=!c||Cn.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,U.jsxs)(`div`,{className:`board-settings`,children:[(0,U.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,U.jsxs)(`label`,{className:`toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:r.enabled,onChange:e=>s({enabled:e.target.checked})}),` Use the board in this project`]}),u.length>0&&(0,U.jsxs)(`label`,{className:`board-channels`,children:[`Copy from another project`,(0,U.jsxs)(`select`,{"aria-label":`Copy the board settings from`,value:``,onChange:e=>h(e.target.value),children:[(0,U.jsx)(`option`,{value:``,children:`Choose a project…`}),u.map(t=>(0,U.jsxs)(`option`,{value:t,children:[t,` (`,e.projects[t].repo,`)`]},t))]})]}),(0,U.jsx)(Nn,{project:t,value:r.repo,ok:l,onChange:e=>s({repo:e})}),c&&l&&(0,U.jsxs)(`div`,{className:`board-warning`,children:[(0,U.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,U.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,U.jsxs)(U.Fragment,{children:[` Also on this board here: `,f.join(`, `),`.`]})]}),c&&l&&(0,U.jsx)(In,{project:t,savedRepo:o.repo,repo:c,allow:r.allow,active:d?.state===`ok`,onChange:e=>s({allow:e})}),m.length>0&&(0,U.jsx)(`ul`,{className:`board-counts`,children:m.map(e=>(0,U.jsxs)(`li`,{children:[e.count,` post`,e.count===1?``:`s`,` to this project ignored from `,(0,U.jsxs)(`strong`,{children:[`@`,e.login]}),`, who isn't on its list (last `,bn(e.lastAt),`).`,` `,!r.allow.some(t=>Sn(t,e.login))&&(0,U.jsxs)(`button`,{className:`small`,onClick:()=>s({allow:[...r.allow,e.login]}),children:[`Allow @`,e.login]})]},e.login))}),(0,U.jsxs)(`label`,{className:`toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:r.frontDesk,disabled:!c||!l,onChange:e=>s({frontDesk:e.target.checked})}),` `,(0,U.jsxs)(`span`,{children:[`Front desk on this board: gets posts addressed to just `,(0,U.jsxs)(`span`,{className:`mono`,children:[`@`,e?.identity??`you`]})]})]}),p&&p!==t&&r.frontDesk&&(0,U.jsxs)(`p`,{className:`muted`,children:[p,` is the front desk now; saving moves it here.`]}),p&&p!==t&&!r.frontDesk&&(0,U.jsxs)(`p`,{className:`muted`,children:[`The front desk on this board is `,p,`.`]}),(0,U.jsxs)(`label`,{className:`board-channels`,children:[`Channels it follows`,(0,U.jsx)(`input`,{...a,value:r.channels,disabled:!r.enabled,placeholder:`#ledung #ops`,onChange:e=>s({channels:e.target.value})})]}),(0,U.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,U.jsx)(`p`,{className:`muted`,children:`Name the board repository to turn it on.`})]})}function Nn({project:e,value:t,ok:n,onChange:r,load:i,label:a=`Board repository`,newName:o}){let s=H(),[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=>B.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=qe(f,x),E=x.trim(),D=Cn.test(E)&&!T.used.some(e=>e.repo.toLowerCase()===E.toLowerCase())&&!T.others.some(e=>e.repo.toLowerCase()===E.toLowerCase());return(0,U.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,U.jsxs)(`label`,{className:`board-channels`,children:[a,(0,U.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,U.jsxs)(`div`,{className:`repo-list`,id:`repo-picker-list`,role:`listbox`,children:[(0,U.jsxs)(`div`,{className:`board-block-head`,children:[(0,U.jsx)(`span`,{className:`muted`,children:m?`Reading your repositories…`:f?`${f.repos.length}${f.truncated?`+`:``} repositories you can reach`:``}),(0,U.jsx)(`button`,{type:`button`,className:`small`,disabled:m,onClick:()=>S(!0),title:`Read the list from GitHub again`,children:`Refresh`})]}),g&&(0,U.jsx)(`p`,{className:`board-error`,children:g}),f?.error&&(0,U.jsxs)(`p`,{className:`board-error`,children:[f.error,` You can still type owner/name.`]}),T.used.length>0&&(0,U.jsx)(`p`,{className:`repo-head`,children:`Boards your other projects use`}),T.used.map(e=>(0,U.jsx)(Pn,{row:e,onPick:w},`u${e.repo}`)),T.others.length>0&&(0,U.jsx)(`p`,{className:`repo-head`,children:`Your GitHub repositories`}),T.others.map(e=>(0,U.jsx)(Pn,{row:e,onPick:w},e.repo)),T.hidden>0&&(0,U.jsxs)(`p`,{className:`muted`,children:[T.hidden,` more: type to narrow the list.`]}),D&&(0,U.jsxs)(`button`,{type:`button`,role:`option`,className:`repo-row`,onClick:()=>w(E),children:[(0,U.jsxs)(`span`,{className:`mono`,children:[`Use `,E]}),(0,U.jsx)(`span`,{className:`muted`,children:` (typed; checked when you save)`})]}),f&&!f.error&&!T.used.length&&!T.others.length&&!D&&(0,U.jsx)(`p`,{className:`muted`,children:`Nothing matches. Type the whole name as owner/name to use a repository that isn't listed.`}),(0,U.jsxs)(`button`,{type:`button`,className:`small repo-create`,onClick:()=>d(!0),children:[`Create a new private `,o?``:`board `,`repo…`]})]}),!n&&!c&&(0,U.jsx)(`p`,{className:`board-error`,children:`Write the repository as owner/name.`}),c&&u&&(0,U.jsx)(Fn,{project:e,name:o,onCancel:()=>d(!1),onCreated:w})]})}function Pn({row:e,onPick:t}){return(0,U.jsxs)(`button`,{type:`button`,role:`option`,className:`repo-row`,onClick:()=>t(e.repo),children:[(0,U.jsx)(`span`,{className:`mono repo-name`,children:e.repo}),e.private!==null&&(0,U.jsx)(`span`,{className:`chip ${e.private?``:`warn`}`,children:e.private?`private`:`public`}),e.projects.length>0&&(0,U.jsxs)(`span`,{className:`muted`,children:[` used by `,e.projects.join(`, `)]})]})}function Fn({project:e,name:t,onCancel:n,onCreated:r}){let i=H(),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(()=>t??Je(e)),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(!1);(0,v.useEffect)(()=>{B.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 B.createBoardRepo(s,l)).repo)}catch(e){f(e.message),m(!1)}};return(0,U.jsxs)(`div`,{className:`repo-list repo-create-form`,role:`dialog`,"aria-label":`Create a new private ${t?``:`board `}repository`,children:[(0,U.jsxs)(`h4`,{children:[`Create a new private `,t?``:`board `,`repository`]}),(0,U.jsxs)(`p`,{className:`muted`,children:[`This creates a new `,(0,U.jsx)(`strong`,{children:`private`}),` repository on GitHub, as your `,(0,U.jsx)(`span`,{className:`mono`,children:`gh`}),` login. Only you can see it until you add people on GitHub.`]}),(0,U.jsxs)(`label`,{className:`board-channels`,children:[`Owner`,(0,U.jsxs)(`select`,{value:s,disabled:!a||p,onChange:e=>c(e.target.value),children:[!a&&(0,U.jsx)(`option`,{children:`Reading your accounts…`}),(a??[]).map(e=>(0,U.jsxs)(`option`,{value:e.login,children:[e.login,e.kind===`user`?` (you)`:` (organisation)`]},e.login))]})]}),(0,U.jsxs)(`label`,{className:`board-channels`,children:[`Name`,(0,U.jsx)(`input`,{...i,className:`mono`,value:l,disabled:p,"aria-invalid":!h,onChange:e=>u(e.target.value.trim())})]}),!h&&(0,U.jsx)(`p`,{className:`board-error`,children:`Use letters, digits, - _ and . only.`}),d&&(0,U.jsx)(`p`,{className:`board-error`,children:d}),(0,U.jsxs)(`div`,{className:`board-add`,children:[(0,U.jsx)(`button`,{type:`button`,disabled:p||!s||!h,onClick:()=>void g(),children:p?`Creating…`:`Confirm: create ${s}/${l}`}),(0,U.jsx)(`button`,{type:`button`,disabled:p,onClick:n,children:`Cancel`})]})]})}function In({project:e,savedRepo:t,repo:n,allow:r,active:i,onChange:a}){let o=H(),[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),B.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=>Sn(t,e)),y=e=>a(_(e)?r.filter(t=>!Sn(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=xn(p);e&&(m(``),_(e)||a([...r,e]))};return(0,U.jsxs)(`div`,{className:`board-block`,children:[(0,U.jsxs)(`div`,{className:`board-block-head`,children:[(0,U.jsx)(`h4`,{children:`Who may post to this project's manager`}),(0,U.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,U.jsx)(`p`,{className:`board-error`,children:d}),!h&&(0,U.jsxs)(`p`,{className:`muted`,children:[`Save to see who has access to `,n,`.`]}),s?.note&&(0,U.jsx)(`p`,{className:`muted`,children:s.note}),s&&s.source!==`none`&&(0,U.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,U.jsxs)(`ul`,{className:`board-people`,children:[(s?.people??[]).map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`label`,{className:`toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:_(e.id),onChange:()=>y(e.id)}),e.avatarUrl?(0,U.jsx)(`img`,{className:`avatar`,src:e.avatarUrl,alt:``,width:28,height:28,loading:`lazy`}):(0,U.jsx)(`span`,{className:`avatar blank`,"aria-hidden":`true`}),(0,U.jsxs)(`span`,{className:`person`,children:[(0,U.jsx)(`span`,{children:e.name??e.id}),e.name&&(0,U.jsxs)(`span`,{className:`muted`,children:[` @`,e.id]})]}),b.has(e.id.toLowerCase())&&(0,U.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,U.jsx)(`li`,{children:(0,U.jsxs)(`label`,{className:`toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:!0,onChange:()=>y(e)}),(0,U.jsx)(`span`,{className:`avatar blank`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`person`,children:(0,U.jsxs)(`span`,{children:[`@`,e]})}),s?.source===`collaborators`&&(0,U.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,U.jsx)(`li`,{className:`muted`,children:`No one is listed. Type a login below.`})]}),(0,U.jsxs)(`div`,{className:`board-add`,children:[(0,U.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,U.jsx)(`button`,{className:`small`,disabled:!xn(p),onClick:C,children:`Allow`})]})]})}var Ln={out:`Post from this manager`,ledung:`Board message`,typed:`Typed on the board`};function Rn({mark:e,time:t,onOpenThread:n}){let r=e.kind===`out`?(0,U.jsxs)(U.Fragment,{children:[`to `,e.to]}):e.kind===`ledung`?(0,U.jsxs)(U.Fragment,{children:[`from `,(0,U.jsxs)(`strong`,{children:[`@`,e.author]}),`'s Ledung`,e.project?` (project ${e.project})`:``]}):(0,U.jsxs)(U.Fragment,{children:[`typed on `,e.service||`the board`,` by `,(0,U.jsxs)(`strong`,{children:[`@`,e.author]})]});return(0,U.jsxs)(`div`,{className:`msg board-post ${e.kind}`,children:[(0,U.jsxs)(`div`,{className:`msg-meta`,children:[(0,U.jsx)(`span`,{className:`who`,children:Ln[e.kind]}),(0,U.jsx)(`span`,{className:`board-from`,children:r}),t]}),(0,U.jsxs)(`div`,{className:`board-thread`,children:[`Thread `,e.threadId?`#${e.threadId} `:``,e.title&&(0,U.jsxs)(U.Fragment,{children:[`“`,e.title,`”`]}),n&&e.threadId&&(0,U.jsxs)(U.Fragment,{children:[` · `,(0,U.jsx)(`button`,{className:`link`,onClick:()=>n(e.threadId),children:`Open in Board`})]}),e.kind!==`out`&&e.to&&(0,U.jsxs)(`span`,{className:`muted`,children:[` · to `,e.to]})]}),(0,U.jsx)(`div`,{className:`msg-body plain`,children:e.text}),(0,U.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 zn(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Bn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hn={};function Un(e,t){return((t||Hn).jsx?Vn:Bn).test(e)}var Wn=/[ \t\n\f\r]/g;function Gn(e){return typeof e==`object`?e.type===`text`&&Kn(e.value):Kn(e)}function Kn(e){return e.replace(Wn,``)===``}var qn=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};qn.prototype.normal={},qn.prototype.property={},qn.prototype.space=void 0;function Jn(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new qn(n,r,t)}function Yn(e){return e.toLowerCase()}var Xn=class{constructor(e,t){this.attribute=t,this.property=e}};Xn.prototype.attribute=``,Xn.prototype.booleanish=!1,Xn.prototype.boolean=!1,Xn.prototype.commaOrSpaceSeparated=!1,Xn.prototype.commaSeparated=!1,Xn.prototype.defined=!1,Xn.prototype.mustUseProperty=!1,Xn.prototype.number=!1,Xn.prototype.overloadedBoolean=!1,Xn.prototype.property=``,Xn.prototype.spaceSeparated=!1,Xn.prototype.space=void 0;var Zn=s({boolean:()=>W,booleanish:()=>$n,commaOrSpaceSeparated:()=>rr,commaSeparated:()=>nr,number:()=>G,overloadedBoolean:()=>er,spaceSeparated:()=>tr}),Qn=0,W=ir(),$n=ir(),er=ir(),G=ir(),tr=ir(),nr=ir(),rr=ir();function ir(){return 2**++Qn}var ar=Object.keys(Zn),or=class extends Xn{constructor(e,t,n,r){let i=-1;if(super(e,t),sr(this,`space`,r),typeof n==`number`)for(;++i<ar.length;){let e=ar[i];sr(this,ar[i],(n&Zn[e])===Zn[e])}}};or.prototype.defined=!0;function sr(e,t,n){n&&(e[t]=n)}function cr(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new or(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Yn(r)]=r,n[Yn(a.attribute)]=r}return new qn(t,n,e.space)}var lr=cr({properties:{ariaActiveDescendant:null,ariaAtomic:$n,ariaAutoComplete:null,ariaBusy:$n,ariaChecked:$n,ariaColCount:G,ariaColIndex:G,ariaColSpan:G,ariaControls:tr,ariaCurrent:null,ariaDescribedBy:tr,ariaDetails:null,ariaDisabled:$n,ariaDropEffect:tr,ariaErrorMessage:null,ariaExpanded:$n,ariaFlowTo:tr,ariaGrabbed:$n,ariaHasPopup:null,ariaHidden:$n,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:tr,ariaLevel:G,ariaLive:null,ariaModal:$n,ariaMultiLine:$n,ariaMultiSelectable:$n,ariaOrientation:null,ariaOwns:tr,ariaPlaceholder:null,ariaPosInSet:G,ariaPressed:$n,ariaReadOnly:$n,ariaRelevant:null,ariaRequired:$n,ariaRoleDescription:tr,ariaRowCount:G,ariaRowIndex:G,ariaRowSpan:G,ariaSelected:$n,ariaSetSize:G,ariaSort:null,ariaValueMax:G,ariaValueMin:G,ariaValueNow:G,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function ur(e,t){return t in e?e[t]:t}function dr(e,t){return ur(e,t.toLowerCase())}var fr=cr({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:nr,acceptCharset:tr,accessKey:tr,action:null,allow:null,allowFullScreen:W,allowPaymentRequest:W,allowUserMedia:W,alpha:W,alt:null,as:null,async:W,autoCapitalize:null,autoComplete:tr,autoFocus:W,autoPlay:W,blocking:tr,capture:null,charSet:null,checked:W,cite:null,className:tr,closedBy:null,colorSpace:null,cols:G,colSpan:G,command:null,commandFor:null,content:null,contentEditable:$n,controls:W,controlsList:tr,coords:G|nr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:W,defer:W,dir:null,dirName:null,disabled:W,download:er,draggable:$n,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:W,formTarget:null,headers:tr,height:G,hidden:er,high:G,href:null,hrefLang:null,htmlFor:tr,httpEquiv:tr,id:null,imageSizes:null,imageSrcSet:null,inert:W,inputMode:null,integrity:null,is:null,isMap:W,itemId:null,itemProp:tr,itemRef:tr,itemScope:W,itemType:tr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:W,low:G,manifest:null,max:null,maxLength:G,media:null,method:null,min:null,minLength:G,multiple:W,muted:W,name:null,nonce:null,noModule:W,noValidate:W,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:W,optimum:G,pattern:null,ping:tr,placeholder:null,playsInline:W,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:W,referrerPolicy:null,rel:tr,required:W,reversed:W,rows:G,rowSpan:G,sandbox:tr,scope:null,scoped:W,seamless:W,selected:W,shadowRootClonable:W,shadowRootCustomElementRegistry:W,shadowRootDelegatesFocus:W,shadowRootMode:null,shadowRootSerializable:W,shape:null,size:G,sizes:null,slot:null,span:G,spellCheck:$n,src:null,srcDoc:null,srcLang:null,srcSet:null,start:G,step:null,style:null,tabIndex:G,target:null,title:null,translate:null,type:null,typeMustMatch:W,useMap:null,value:$n,width:G,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:tr,axis:null,background:null,bgColor:null,border:G,borderColor:null,bottomMargin:G,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:W,declare:W,event:null,face:null,frame:null,frameBorder:null,hSpace:G,leftMargin:G,link:null,longDesc:null,lowSrc:null,marginHeight:G,marginWidth:G,noResize:W,noHref:W,noShade:W,noWrap:W,object:null,profile:null,prompt:null,rev:null,rightMargin:G,rules:null,scheme:null,scrolling:$n,standby:null,summary:null,text:null,topMargin:G,valueType:null,version:null,vAlign:null,vLink:null,vSpace:G,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:W,disablePictureInPicture:W,disableRemotePlayback:W,exportParts:nr,part:tr,prefix:null,property:null,results:G,security:null,unselectable:null},space:`html`,transform:dr}),pr=cr({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:rr,accentHeight:G,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:G,amplitude:G,arabicForm:null,ascent:G,attributeName:null,attributeType:null,azimuth:G,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:G,by:null,calcMode:null,capHeight:G,className:tr,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:G,diffuseConstant:G,direction:null,display:null,dur:null,divisor:G,dominantBaseline:null,download:W,dx:null,dy:null,edgeMode:null,editable:null,elevation:G,enableBackground:null,end:null,event:null,exponent:G,externalResourcesRequired:null,fill:null,fillOpacity:G,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:nr,g2:nr,glyphName:nr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:G,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:G,horizOriginX:G,horizOriginY:G,id:null,ideographic:G,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:G,k:G,k1:G,k2:G,k3:G,k4:G,kernelMatrix:rr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:G,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:G,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:G,overlineThickness:G,paintOrder:null,panose1:null,path:null,pathLength:G,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:tr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:G,pointsAtY:G,pointsAtZ:G,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:rr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:rr,rev:rr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:rr,requiredFeatures:rr,requiredFonts:rr,requiredFormats:rr,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:G,specularExponent:G,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:G,strikethroughThickness:G,string:null,stroke:null,strokeDashArray:rr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:G,strokeOpacity:G,strokeWidth:null,style:null,surfaceScale:G,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:rr,tabIndex:G,tableValues:null,target:null,targetX:G,targetY:G,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:rr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:G,underlineThickness:G,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:G,values:null,vAlphabetic:G,vMathematical:G,vectorEffect:null,vHanging:G,vIdeographic:G,version:null,vertAdvY:G,vertOriginX:G,vertOriginY:G,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:G,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:ur}),mr=cr({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()}}),hr=cr({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:dr}),gr=cr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),_r={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`},vr=/[A-Z]/g,yr=/-[a-z]/g,br=/^data[-\w.:]+$/i;function xr(e,t){let n=Yn(t),r=t,i=Xn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&br.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(yr,Cr);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!yr.test(e)){let n=e.replace(vr,Sr);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=or}return new i(r,t)}function Sr(e){return`-`+e.toLowerCase()}function Cr(e){return e.charAt(1).toUpperCase()}var wr=Jn([lr,fr,mr,hr,gr],`html`),Tr=Jn([lr,pr,mr,hr,gr],`svg`);function Er(e){return e.join(` `).trim()}var Dr=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(`
27
+ `);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})),Or=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(Dr());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}})),kr=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))}})),Ar=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Or()),r=kr();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})),jr=Nr(`end`),Mr=Nr(`start`);function Nr(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 Pr(e){let t=Mr(e),n=jr(e);if(t&&n)return{start:t,end:n}}function Fr(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Lr(e.position):`start`in e||`end`in e?Lr(e):`line`in e||`column`in e?Ir(e):``}function Ir(e){return Rr(e&&e.line)+`:`+Rr(e&&e.column)}function Lr(e){return Ir(e&&e.start)+`-`+Ir(e&&e.end)}function Rr(e){return e&&typeof e==`number`?e:1}var zr=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=Fr(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}};zr.prototype.file=``,zr.prototype.name=``,zr.prototype.reason=``,zr.prototype.message=``,zr.prototype.stack=``,zr.prototype.column=void 0,zr.prototype.line=void 0,zr.prototype.ancestors=void 0,zr.prototype.cause=void 0,zr.prototype.fatal=void 0,zr.prototype.place=void 0,zr.prototype.ruleId=void 0,zr.prototype.source=void 0;var Br=l(Ar(),1),Vr={}.hasOwnProperty,Hr=new Map,Ur=/[A-Z]/g,Wr=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Gr=new Set([`td`,`th`]),Kr=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function qr(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=ii(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=ri(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`?Tr:wr,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Jr(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Jr(e,t,n){if(t.type===`element`)return Yr(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Xr(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Qr(e,t,n);if(t.type===`mdxjsEsm`)return Zr(e,t);if(t.type===`root`)return $r(e,t,n);if(t.type===`text`)return ei(e,t)}function Yr(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Tr,e.schema=i),e.ancestors.push(t);let a=ui(e,t.tagName,!1),o=ai(e,t),s=si(e,t);return Wr.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Gn(e)})),ti(e,o,a,t),ni(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Xr(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)}di(e,t.position)}function Zr(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);di(e,t.position)}function Qr(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Tr,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:ui(e,t.name,!0),o=oi(e,t),s=si(e,t);return ti(e,o,a,t),ni(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function $r(e,t,n){let r={};return ni(r,si(e,t)),e.create(t,e.Fragment,r,n)}function ei(e,t){return t.value}function ti(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ni(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function ri(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 ii(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Mr(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 ai(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Vr.call(t.properties,i)){let a=ci(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Gr.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 oi(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 di(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 di(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function si(e,t){let n=[],r=-1,i=e.passKeys?new Map:Hr;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=Jr(e,a,o);s!==void 0&&n.push(s)}return n}function ci(e,t,n){let r=xr(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?zn(n):Er(n)),r.property===`style`){let t=typeof n==`object`?n:li(e,String(n));return e.stylePropertyNameCase===`css`&&(t=fi(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?_r[r.property]||r.property:r.attribute,n]}}function li(e,t){try{return(0,Br.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new zr("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=Kr+`#cannot-parse-style-attribute`,r}}function ui(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=Un(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=Un(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Vr.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);di(e)}function di(e,t){let n=new zr("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=Kr+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function fi(e){let t={},n;for(n in e)Vr.call(e,n)&&(t[pi(n)]=e[n]);return t}function pi(e){let t=e.replace(Ur,mi);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function mi(e){return`-`+e.toLowerCase()}var hi={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`]},gi={};function _i(e,t){let n=t||gi;return vi(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function vi(e,t,n){if(bi(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 yi(e.children,t,n)}return Array.isArray(e)?yi(e,t,n):``}function yi(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=vi(e[i],t,n);return r.join(``)}function bi(e){return!!(e&&typeof e==`object`)}var xi=document.createElement(`i`);function Si(e){let t=`&`+e+`;`;xi.innerHTML=t;let n=xi.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Ci(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 wi(e,t){return e.length>0?(Ci(e,e.length,0,t),e):t}var Ti={}.hasOwnProperty;function Ei(e){let t={},n=-1;for(;++n<e.length;)Di(t,e[n]);return t}function Di(e,t){let n;for(n in t){let r=(Ti.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Ti.call(r,a)||(r[a]=[]);let e=i[a];Oi(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Oi(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Ci(e,0,0,r)}function ki(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 Ai(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var ji=Vi(/[A-Za-z]/),Mi=Vi(/[\dA-Za-z]/),Ni=Vi(/[#-'*+\--9=?A-Z^-~]/);function Pi(e){return e!==null&&(e<32||e===127)}var Fi=Vi(/\d/),Ii=Vi(/[\dA-Fa-f]/),Li=Vi(/[!-/:-@[-`{-~]/);function K(e){return e!==null&&e<-2}function Ri(e){return e!==null&&(e<0||e===32)}function q(e){return e===-2||e===-1||e===32}var zi=Vi(/\p{P}|\p{S}/u),Bi=Vi(/\s/);function Vi(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Hi(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Mi(e.charCodeAt(n+1))&&Mi(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 J(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return q(r)?(e.enter(n),s(r)):t(r)}function s(r){return q(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function Ui(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&q(t)?(e.enter(r),c(t)):l(t)}function c(t){return q(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Wi={tokenize:Gi};function Gi(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`),J(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 K(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Ki=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){qi(this,e,t,n,!1)}addBefore(e,t,n){qi(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 qi(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 Ji={tokenize:Y},Yi={tokenize:Xi};function Y(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 Ki;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(Yi,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(Yi,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 K(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 Ki;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 Xi(e,t,n){return J(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Zi(e){if(e===null||Ri(e)||Bi(e))return 1;if(zi(e))return 2}function Qi(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 $i={name:`attention`,resolveAll:ea,tokenize:ta};function ea(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};na(o,-a),na(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=wi(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=wi(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=wi(r,Qi(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=wi(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=wi(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),Ci(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 ta(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Zi(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=Zi(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 na(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var ra={name:`autolink`,tokenize:ia};function ia(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 ji(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Mi(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||Mi(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||Pi(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Ni(t)?(e.consume(t),l):n(t)}function u(e){return Mi(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||Mi(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var aa={partial:!0,tokenize:oa};function oa(e,t,n){return r;function r(t){return q(t)?J(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||K(e)?t(e):n(e)}}var sa={continuation:{tokenize:la},exit:ua,name:`blockQuote`,tokenize:ca};function ca(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return q(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function la(e,t,n){let r=this;return i;function i(t){return q(t)?J(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(sa,t,n)(r)}}function ua(e){e.exit(`blockQuote`)}var da={name:`characterEscape`,tokenize:fa};function fa(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 Li(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var pa={name:`characterReference`,tokenize:ma};function ma(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=Mi,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=Ii,u):(e.enter(`characterReferenceValue`),a=7,o=Fi,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Mi&&!Si(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 ha={partial:!0,tokenize:ga};function ga(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 _a={concrete:!0,name:`codeFenced`,tokenize:va};function va(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),q(t)?J(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||K(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(ha,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||K(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),J(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||K(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||K(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&q(t)?J(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||K(t)?e.check(ha,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||K(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),q(t)?J(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),q(t)?J(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||K(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var ya={name:`codeIndented`,tokenize:xa},ba={partial:!0,tokenize:Sa};function xa(e,t,n){return r;function r(t){return e.enter(`codeIndented`),Ui(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):K(t)?e.attempt(ba,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||K(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Sa(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):K(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):Ui(e,t,a,`linePrefix`,4,4)(o)}function a(e){return K(e)?i(e):n(e)}}var Ca={name:`codeText`,previous:Ta,resolve:wa,tokenize:Ea};function wa(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 Ta(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ea(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)):K(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||K(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 Da=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&&Oa(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),Oa(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Oa(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);Oa(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Oa(this.left,t.reverse())}}}};function Oa(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 ka(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Da(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,Aa(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 Ci(e,0,1/0,u.slice(0)),!l}function Aa(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 ja={resolve:Na,tokenize:Pa},Ma={partial:!0,tokenize:Fa};function Na(e){return ka(e),e}function Pa(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):K(t)?e.check(Ma,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 Fa(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,a,`linePrefix`)}function a(i){if(i===null||K(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 Ia(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||Pi(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||K(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||Ri(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||Pi(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 La(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):K(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||K(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!q(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Ra(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):K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||K(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 za(e,t){let n;return r;function r(i){return K(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):q(i)?J(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Ba={name:`definition`,tokenize:Ha},Va={partial:!0,tokenize:Ua};function Ha(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return La.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Ai(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 Ri(t)?za(e,l)(t):l(t)}function l(t){return Ia(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Va,d,d)(t)}function d(t){return q(t)?J(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||K(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Ua(e,t,n){return r;function r(t){return Ri(t)?za(e,i)(t):n(t)}function i(t){return Ra(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return q(t)?J(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||K(e)?t(e):n(e)}}var Wa={name:`hardBreakEscape`,tokenize:Ga};function Ga(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return K(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Ka={name:`headingAtx`,resolve:qa,tokenize:Ja};function qa(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`};Ci(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Ja(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||Ri(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||K(n)?(e.exit(`atxHeading`),t(n)):q(n)?J(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||Ri(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Ya=`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(`.`),Xa=[`pre`,`script`,`style`,`textarea`],Za={concrete:!0,name:`htmlFlow`,resolveTo:$a,tokenize:eo},Qa={partial:!0,tokenize:to};function $a(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 eo(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):ji(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):ji(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return ji(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Ri(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Xa.includes(l)?(i=1,r.interrupt?t(s):O(s)):Ya.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||Mi(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return q(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||ji(t)?(e.consume(t),b):q(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Mi(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):q(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):q(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||K(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||Ri(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||q(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||K(t)?O(t):q(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),ee):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):K(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Qa,te,k)(t)):t===null||K(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(ha,A,te)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||K(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return Xa.includes(n)?(e.consume(t),ee):O(t)}return ji(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),ee):t===45&&i===2?(e.consume(t),I):O(t)}function ee(t){return t===null||K(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),ee)}function te(n){return e.exit(`htmlFlow`),t(n)}}function to(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(aa,t,n)}}var no={name:`htmlText`,tokenize:ro};function ro(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):ji(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):ji(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):K(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):K(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):K(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):K(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return ji(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Mi(t)?(e.consume(t),S):C(t)}function C(t){return K(t)?(o=C,N(t)):q(t)?(e.consume(t),C):M(t)}function w(t){return t===45||Mi(t)?(e.consume(t),w):t===47||t===62||Ri(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||ji(t)?(e.consume(t),E):K(t)?(o=T,N(t)):q(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||Mi(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):K(t)?(o=D,N(t)):q(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):K(t)?(o=O,N(t)):q(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):K(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Ri(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Ri(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return q(t)?J(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var io={name:`labelEnd`,resolveAll:co,resolveTo:lo,tokenize:uo},ao={tokenize:fo},oo={tokenize:po},so={tokenize:mo};function co(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&&Ci(e,0,e.length,n),e}function lo(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=wi(o,e.slice(i+1,i+r+3)),o=wi(o,[[`enter`,l,t]]),o=wi(o,Qi(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=wi(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=wi(o,e.slice(a+1)),o=wi(o,[[`exit`,s,t]]),Ci(e,i,e.length,o),e}function uo(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(Ai(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(ao,u,o?u:d)(t):t===91?e.attempt(oo,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(so,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function fo(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 Ri(t)?za(e,a)(t):a(t)}function a(t){return t===41?u(t):Ia(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Ri(t)?za(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Ra(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Ri(t)?za(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 po(e,t,n){let r=this;return i;function i(t){return La.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Ai(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function mo(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 ho={name:`labelStartImage`,resolveAll:io.resolveAll,tokenize:go};function go(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 _o={name:`labelStartLink`,resolveAll:io.resolveAll,tokenize:vo};function vo(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 yo={name:`lineEnding`,tokenize:bo};function bo(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}}var xo={name:`thematicBreak`,tokenize:So};function So(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||K(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),q(t)?J(e,s,`whitespace`)(t):s(t))}}var Co={continuation:{tokenize:Do},exit:ko,name:`list`,tokenize:Eo},wo={partial:!0,tokenize:Ao},To={partial:!0,tokenize:Oo};function Eo(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:Fi(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(xo,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 Fi(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(aa,r.interrupt?n:u,e.attempt(wo,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return q(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Do(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(aa,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,J(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!q(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(To,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,J(e,e.attempt(Co,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Oo(e,t,n){let r=this;return J(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 ko(e){e.exit(this.containerState.type)}function Ao(e,t,n){let r=this;return J(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!q(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var jo={name:`setextUnderline`,resolveTo:Mo,tokenize:No};function Mo(e,t){let n=new Ki,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 No(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),q(t)?J(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||K(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var X={tokenize:Po};function Po(e){let t=this,n=e.attempt(aa,r,e.attempt(this.parser.constructs.flowInitial,i,J(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ja,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 Fo={resolveAll:zo()},Io=Ro(`string`),Lo=Ro(`text`);function Ro(e){return{resolveAll:zo(e===`text`?Bo: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 zo(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 Bo(e,t){let n=new Ki,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 Vo=s({attentionMarkers:()=>Yo,contentInitial:()=>Uo,disable:()=>Xo,document:()=>Ho,flow:()=>Go,flowInitial:()=>Wo,insideSpan:()=>Jo,string:()=>Ko,text:()=>qo}),Ho={42:Co,43:Co,45:Co,48:Co,49:Co,50:Co,51:Co,52:Co,53:Co,54:Co,55:Co,56:Co,57:Co,62:sa},Uo={91:Ba},Wo={[-2]:ya,[-1]:ya,32:ya},Go={35:Ka,42:xo,45:[jo,xo],60:Za,61:jo,95:xo,96:_a,126:_a},Ko={38:pa,92:da},qo={[-5]:yo,[-4]:yo,[-3]:yo,33:ho,38:pa,42:$i,60:[ra,no],91:_o,92:[Wa,da],93:io,95:$i,96:Ca},Jo={null:[$i,Fo]},Yo={null:[42,95]},Xo={null:[]};function Zo(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=wi(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Qi(a,l.events,l),l.events):[]}function f(e,t){return $o(p(e),t)}function p(e){return Qo(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){K(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&&Ci(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 Qo(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 $o(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=`
28
+ `;break;case-3:o=`\r
29
+ `;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 es(e){let t={constructs:Ei([Vo,...(e||{}).extensions||[]]),content:n(Wi),defined:[],document:n(Ji),flow:n(X),lazy:{},string:n(Io),text:n(Lo)};return t;function n(e){return n;function n(n){return Zo(t,e,n)}}}function ts(e){for(;!ka(e););return e}var ns=/[\0\t\n\r]/g;function rs(){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;){ns.lastIndex=c;let n=ns.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 is=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function as(e){return e.replace(is,os)}function os(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return ki(n.slice(t?2:1),t?16:10)}return Si(n)||e}var ss={}.hasOwnProperty;function cs(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),ls(n)(ts(es(n).document().write(rs()(e,t,!0))))}function ls(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(_e),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(R),blockQuote:o(ue),characterEscape:E,characterReference:E,codeFenced:o(de),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(de,s),codeText:o(fe,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(L),hardBreakEscape:o(me),hardBreakTrailing:o(me),htmlFlow:o(he,s),htmlFlowData:E,htmlText:o(he,s),htmlTextData:E,image:o(ge),label:s,link:o(_e),listItem:o(ye),listItemValue:p,listOrdered:o(ve,f),listUnordered:o(ve),paragraph:o(be),reference:re,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(R),strong:o(xe),thematicBreak:o(Ce)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:le,autolinkProtocol:ce,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:oe,characterReference:se,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(P),label:I,labelText:F,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ie,resourceDestinationString:ee,resourceTitleString:te,resource:ne,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};ds(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]),ss.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]||ps).call(o,void 0,e[0])}for(r.position={start:us(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:us(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:us(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+"` ("+Fr({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ps).call(this,e,r[0])),n.position.end=us(e.end)}function d(){return _i(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=Ai(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=Se(),n.position={start:us(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=us(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=us(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function F(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=as(t),n.identifier=Ai(t).toLowerCase()}function I(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ne(){this.data.inReference=void 0}function re(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ai(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ae(e){this.data.characterReferenceType=e.type}function oe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=ki(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Si(t);let i=this.stack[this.stack.length-1];i.value+=r}function se(e){let t=this.stack.pop();t.position.end=us(e.end)}function ce(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function le(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ue(){return{type:`blockquote`,children:[],position:void 0}}function de(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function fe(){return{type:`inlineCode`,value:``,position:void 0}}function pe(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function L(){return{type:`emphasis`,children:[],position:void 0}}function R(){return{type:`heading`,depth:0,children:[],position:void 0}}function me(){return{type:`break`,position:void 0}}function he(){return{type:`html`,value:``,position:void 0}}function ge(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function _e(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function ve(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function ye(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function be(){return{type:`paragraph`,children:[],position:void 0}}function xe(){return{type:`strong`,children:[],position:void 0}}function Se(){return{type:`text`,value:``,position:void 0}}function Ce(){return{type:`thematicBreak`,position:void 0}}}function us(e){return{line:e.line,column:e.column,offset:e.offset}}function ds(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?ds(e,r):fs(e,r)}}function fs(e,t){let n;for(n in t)if(ss.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 ps(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Fr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fr({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Fr({start:t.start,end:t.end})+`) is still open`)}function ms(e){let t=this;t.parser=n;function n(n){return cs(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function hs(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 gs(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
30
+ `}]}function _s(e,t){let n=t.value?t.value+`
31
+ `:``,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 vs(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ys(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bs(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Hi(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 xs(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 Ss(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Cs(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 ws(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Cs(e,t);let i={src:Hi(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 Ts(e,t){let n={src:Hi(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 Es(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 Ds(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Cs(e,t);let i={href:Hi(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 Os(e,t){let n={href:Hi(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 ks(e,t,n){let r=e.all(t),i=n?As(n):js(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:`
32
+ `}),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:`
33
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function As(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=js(n[r])}return t}function js(e){return e.spread??e.children.length>1}function Ms(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 Ns(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ps(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Fs(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Is(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=Mr(t.children[1]),o=jr(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 Ls(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 Rs(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var zs=9,Bs=32;function Vs(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Hs(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Hs(t.slice(i),i>0,!1)),a.join(``)}function Hs(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===zs||t===Bs;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===zs||t===Bs;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Us(e,t){let n={type:`text`,value:Vs(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ws(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Gs={blockquote:hs,break:gs,code:_s,delete:vs,emphasis:ys,footnoteReference:bs,heading:xs,html:Ss,imageReference:ws,image:Ts,inlineCode:Es,linkReference:Ds,link:Os,listItem:ks,list:Ms,paragraph:Ns,root:Ps,strong:Fs,table:Is,tableCell:Rs,tableRow:Ls,text:Us,thematicBreak:Ws,toml:Ks,yaml:Ks,definition:Ks,footnoteDefinition:Ks};function Ks(){}var{defineProperty:qs}=Object,Js=typeof self==`object`?self:globalThis,Ys=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Js[e](t)},Xs=(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__`?qs(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 Js[e]==`function`?Ys(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(Ys(a,o),i)};return r},Zs=e=>Xs(new Map,e)(0),Qs=``,{toString:$s}={},{keys:ec,is:tc}=Object,nc=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=$s.call(e).slice(8,-1);switch(n){case`Array`:return[1,Qs];case`Object`:return[2,Qs];case`Date`:return[3,Qs];case`RegExp`:return[4,Qs];case`Map`:return[5,Qs];case`Set`:return[6,Qs];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},rc=([e,t])=>e===0&&(t===`function`||t===`symbol`),ic=(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]=nc(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&tc(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 ec(o))(e||!rc(nc(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?Qs: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||!(rc(nc(n))||rc(nc(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!rc(nc(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},ac=(e,{json:t,lossy:n}={})=>{let r=[];return ic(!(t||n),!!t,new Map,r)(e),r},oc=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Zs(ac(e,t)):structuredClone(e):(e,t)=>Zs(ac(e,t));function sc(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 cc(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function lc(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||sc,r=e.options.footnoteBackLabel||cc,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=Hi(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:{...oc(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
34
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
35
+ `}]}}var uc=(function(e){if(e==null)return hc;if(typeof e==`function`)return mc(e);if(typeof e==`object`)return Array.isArray(e)?dc(e):fc(e);if(typeof e==`string`)return pc(e);throw Error(`Expected function, string, or object as test`)});function dc(e){let t=[],n=-1;for(;++n<e.length;)t[n]=uc(e[n]);return mc(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function fc(e){let t=e;return mc(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function pc(e){return mc(t);function t(t){return t&&t.type===e}}function mc(e){return t;function t(t,n,r){return!!(gc(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function hc(){return!0}function gc(e){return typeof e==`object`&&!!e&&`type`in e}function _c(e){return e}var vc=[];function yc(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=uc(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 (`+_c(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=vc,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=bc(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 bc(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?vc:[e]}function xc(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),yc(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 Sc={}.hasOwnProperty,Cc={};function wc(e,t){let n=t||Cc,r=new Map,i=new Map,a={all:s,applyData:Ec,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Gs,...n.handlers},one:o,options:n,patch:Tc,wrap:Oc};return xc(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(Sc.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=oc(n);return r.children=a.all(e),r}return oc(e)}return(a.options.unknownHandler||Dc)(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=kc(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=kc(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Tc(e,t){e.position&&(t.position=Pr(e))}function Ec(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,oc(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Dc(e,t){let n=t.data||{},r=`value`in t&&!(Sc.call(n,`hProperties`)||Sc.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 Oc(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
36
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
37
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
38
+ `}),n}function kc(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ac(e,t){let n=wc(e,t),r=n.one(e,void 0),i=lc(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
39
+ `},i)),a}function jc(e,t){return e&&`run`in e?async function(n,r){let i=Ac(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Ac(n,{file:r,...e||t})}}function Mc(e){if(e)throw e}var Nc=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 Pc(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 Fc(){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?Ic(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 Ic(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 Lc={basename:Rc,dirname:zc,extname:Bc,join:Vc,sep:`/`};function Rc(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Wc(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 zc(e){if(Wc(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 Bc(e){Wc(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 Vc(...e){let t=-1,n;for(;++t<e.length;)Wc(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Hc(n)}function Hc(e){Wc(e);let t=e.codePointAt(0)===47,n=Uc(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Uc(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 Wc(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Gc={cwd:Kc};function Kc(){return`/`}function qc(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Jc(e){if(typeof e==`string`)e=new URL(e);else if(!qc(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 Yc(e)}function Yc(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 Xc=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Zc=class{constructor(e){let t;t=e?qc(e)?{path:e}:typeof e==`string`||tl(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Gc.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Xc.length;){let e=Xc[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)Xc.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Lc.basename(this.path):void 0}set basename(e){$c(e,`basename`),Qc(e,`basename`),this.path=Lc.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Lc.dirname(this.path):void 0}set dirname(e){el(this.basename,`dirname`),this.path=Lc.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Lc.extname(this.path):void 0}set extname(e){if(Qc(e,`extname`),el(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=Lc.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){qc(e)&&(e=Jc(e)),$c(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Lc.basename(this.path,this.extname):void 0}set stem(e){$c(e,`stem`),Qc(e,`stem`),this.path=Lc.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 zr(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 Qc(e,t){if(e&&e.includes(Lc.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Lc.sep+"`")}function $c(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function el(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function tl(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var nl=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),rl=l(Nc(),1),il={}.hasOwnProperty,al=new class e extends nl{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=Fc()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,rl.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(cl(`data`,this.frozen),this.namespace[e]=t,this):il.call(this.namespace,e)&&this.namespace[e]||void 0:e?(cl(`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=dl(e),n=this.parser||this.Parser;return ol(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),ol(`process`,this.parser||this.Parser),sl(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=dl(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);pl(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(),ol(`processSync`,this.parser||this.Parser),sl(`processSync`,this.compiler||this.Compiler),this.process(e,r),ul(`processSync`,`process`,t),n;function r(e,r){t=!0,Mc(e),n=r}}run(e,t,n){ll(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=dl(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),ul(`runSync`,`run`,n),r;function i(e,t){Mc(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=dl(t),r=this.compiler||this.Compiler;return sl(`stringify`,r),ll(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(cl(`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,rl.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];Pc(o)&&Pc(r)&&(r=(0,rl.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function ol(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function sl(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function cl(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 ll(e){if(!Pc(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function ul(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function dl(e){return fl(e)?e:new Zc(e)}function fl(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function pl(e){return typeof e==`string`||ml(e)}function ml(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var hl=[],gl={allowDangerousHtml:!0},_l=/^(https?|ircs?|mailto|xmpp)$/i,vl=[{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 yl(e){let t=bl(e),n=xl(e);return Sl(t.runSync(t.parse(n),n),e)}function bl(e){let t=e.rehypePlugins||hl,n=e.remarkPlugins||hl,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...gl}:gl;return al().use(ms).use(n).use(jc,r).use(t)}function xl(e){let t=e.children||``,n=new Zc;return typeof t==`string`?n.value=t:``+t,n}function Sl(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Cl;for(let e of vl)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return xc(e,l),qr(e,{Fragment:U.Fragment,components:i,ignoreInvalidStyle:!0,jsx:U.jsx,jsxs:U.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 hi)if(Object.hasOwn(hi,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=hi[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 Cl(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||_l.test(e.slice(0,t))?e:``}function wl(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 Tl(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function El(e,t,n){let r=uc((n||{}).ignore||[]),i=Dl(t),a=-1;for(;++a<i.length;)yc(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 Dl(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([Ol(e[0]),kl(e[1])])}return t}function Ol(e){return typeof e==`string`?new RegExp(Tl(e),`g`):e}function kl(e){return typeof e==`function`?e:function(){return e}}var Al=`phrasing`,jl=[`autolink`,`link`,`image`,`label`];function Ml(){return{transforms:[Bl],enter:{literalAutolink:Pl,literalAutolinkEmail:Fl,literalAutolinkHttp:Fl,literalAutolinkWww:Fl},exit:{literalAutolink:zl,literalAutolinkEmail:Rl,literalAutolinkHttp:Il,literalAutolinkWww:Ll}}}function Nl(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Al,notInConstruct:jl},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Al,notInConstruct:jl},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Al,notInConstruct:jl}]}}function Pl(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Fl(e){this.config.enter.autolinkProtocol.call(this,e)}function Il(e){this.config.exit.autolinkProtocol.call(this,e)}function Ll(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 Rl(e){this.config.exit.autolinkEmail.call(this,e)}function zl(e){this.exit(e)}function Bl(e){El(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Vl],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Hl]],{ignore:[`link`,`linkReference`]})}function Vl(e,t,n,r,i){let a=``;if(!Gl(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Ul(n)))return!1;let o=Wl(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 Hl(e,t,n,r){return!Gl(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Ul(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 Wl(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=wl(e,`(`),a=wl(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 Gl(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Bi(n)||zi(n))&&(!t||n!==47)}tu.peek=eu;function Kl(){this.buffer()}function ql(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Jl(){this.buffer()}function Yl(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Xl(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ai(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Zl(e){this.exit(e)}function Ql(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ai(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $l(e){this.exit(e)}function eu(){return`[`}function tu(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 nu(){return{enter:{gfmFootnoteCallString:Kl,gfmFootnoteCall:ql,gfmFootnoteDefinitionLabelString:Jl,gfmFootnoteDefinition:Yl},exit:{gfmFootnoteCallString:Xl,gfmFootnoteCall:Zl,gfmFootnoteDefinitionLabelString:Ql,gfmFootnoteDefinition:$l}}}function ru(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:tu},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?`
40
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?au:iu))),s(),o}}function iu(e,t,n){return t===0?e:au(e,t,n)}function au(e,t,n){return(n?``:` `)+e}var ou=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];du.attention=fu,du.peek=pu;function su(){return{canContainEols:[`delete`],enter:{strikethrough:lu},exit:{strikethrough:uu}}}function cu(){return{handlers:{delete:du},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:ou}]}}function lu(e){this.enter({type:`delete`,children:[],position:void 0},e)}function uu(e){this.exit(e)}function du(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 fu(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function pu(){return`~`}function mu(e){return e.length}function hu(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||mu,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=gu(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]=_u(r[d]);else{let e=_u(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(`
41
+ `)}function gu(e){return e==null?``:String(e)}function _u(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 vu=uc([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function yu(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()),bu);return i(),o}function bu(e,t,n){return`>`+(n?``:` `)+e}function xu(e,t){return Su(e,t.inConstruct,!0)&&!Su(e,t.notInConstruct,!1)}function Su(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 Cu(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
42
+ `&&!e.before&&!e.after&&xu(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
43
+ `}function wu(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 Tu(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 Eu(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Du(e,t,n,r){let i=Eu(n),a=e.value||``;if(Tu(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Ou);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(wu(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:`
44
+ `,encode:["`"],...o.current()})),t()}return u+=o.move(`
45
+ `),a&&(u+=o.move(a+`
46
+ `)),u+=o.move(s),c(),u}function Ou(e,t,n){return(n?``:` `)+e}function ku(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Au(e,t,n,r){let i=ku(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?` `:`
47
+ `,...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 ju(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}Mu.attention=Nu,Mu.peek=Pu;function Mu(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function Nu(e,t){return{construct:`emphasis`,markers:ju(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function Pu(e,t,n){return n.options.emphasis||`*`}function Fu(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Iu(e,t){let n=!1;return xc(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)&&_i(e)&&(t.options.setext||n))}function Lu(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Iu(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
48
+ `,after:`
49
+ `});return r(),t(),o+`
50
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
51
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
52
+ `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=Fu(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Ru.peek=zu;function Ru(e){return e.value||``}function zu(){return`<`}Bu.peek=Vu;function Bu(e,t,n,r){let i=ku(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 Vu(){return`!`}Hu.peek=Uu;function Hu(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 Uu(){return`!`}Wu.peek=Gu;function Wu(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 Gu(){return"`"}function Ku(e,t){let n=_i(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))}qu.peek=Ju;function qu(e,t,n,r){let i=ku(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(Ku(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 Ju(e,t,n){return Ku(e,n)?`<`:`[`}Yu.peek=Xu;function Yu(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 Xu(){return`[`}function Z(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 Q(e){let t=Z(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 Zu(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Qu(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 $u(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Zu(n):Z(n),s=e.ordered?o===`.`?`)`:`.`:Q(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),Qu(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 ed(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 td(e,t,n,r){let i=ed(n),a=n.bulletCurrent||Z(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 nd(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function rd(e,t,n,r){if(!e.children.some(function(e){return vu(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function id(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ad.attention=od,ad.peek=sd;function ad(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function od(e,t){return{construct:`strong`,markers:id(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function sd(e,t,n){return n.options.strong||`*`}function cd(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 ld(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 ud(e,t,n){let r=(Qu(n)+(n.options.ruleSpaces?` `:``)).repeat(ld(n));return n.options.ruleSpaces?r.slice(0,-1):r}var dd={blockquote:yu,break:Cu,code:Du,definition:Au,emphasis:Mu,hardBreak:Cu,heading:Lu,html:Ru,image:Bu,imageReference:Hu,inlineCode:Wu,link:qu,linkReference:Yu,list:$u,listItem:td,paragraph:nd,root:rd,strong:ad,text:cd,thematicBreak:ud};function fd(){return{enter:{table:pd,tableData:_d,tableHeader:_d,tableRow:hd},exit:{codeText:vd,table:md,tableData:gd,tableHeader:gd,tableRow:gd}}}function pd(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 md(e){this.exit(e),this.data.inTable=void 0}function hd(e){this.enter({type:`tableRow`,children:[]},e)}function gd(e){this.exit(e)}function _d(e){this.enter({type:`tableCell`,children:[]},e)}function vd(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,yd));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function yd(e,t){return t===`|`?t:e}function bd(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
53
+ `,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(`
54
+ `))}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 hu(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=dd.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function xd(){return{exit:{taskListCheckValueChecked:Cd,taskListCheckValueUnchecked:Cd,paragraph:wd}}}function Sd(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Td}}}function Cd(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function wd(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 Td(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=dd.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 Ed(){return[Ml(),nu(),su(),fd(),xd()]}function Dd(e){return{extensions:[Nl(),ru(e),cu(),bd(e),Sd()]}}var Od={tokenize:Hd,partial:!0},kd={tokenize:Ud,partial:!0},Ad={tokenize:Wd,partial:!0},jd={tokenize:Gd,partial:!0},Md={tokenize:Kd,partial:!0},Nd={name:`wwwAutolink`,tokenize:Bd,previous:qd},Pd={name:`protocolAutolink`,tokenize:Vd,previous:Jd},Fd={name:`emailAutolink`,tokenize:zd,previous:Yd},Id={};function Ld(){return{text:Id}}for(var Rd=48;Rd<123;)Id[Rd]=Fd,Rd++,Rd===58?Rd=65:Rd===91&&(Rd=97);Id[43]=Fd,Id[45]=Fd,Id[46]=Fd,Id[95]=Fd,Id[72]=[Fd,Pd],Id[104]=[Fd,Pd],Id[87]=[Fd,Nd],Id[119]=[Fd,Nd];function zd(e,t,n){let r=this,i,a;return o;function o(t){return!Xd(t)||!Yd.call(r,r.previous)||Zd(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Xd(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Md,u,l)(t):t===45||t===95||Mi(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&&ji(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Bd(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!qd.call(r,r.previous)||Zd(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Od,e.attempt(kd,e.attempt(Ad,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Vd(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Jd.call(r,r.previous)&&!Zd(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(ji(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||Pi(t)||Ri(t)||Bi(t)||zi(t)?n(t):e.attempt(kd,e.attempt(Ad,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Hd(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 Ud(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(jd,c,s)(t):t===null||Ri(t)||Bi(t)||t!==45&&zi(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 Wd(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(jd,t,a)(o):o===null||Ri(o)||Bi(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Gd(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||Ri(o)||Bi(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Ri(e)||Bi(e)?t(e):r(e)}function a(e){return ji(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):ji(t)?(e.consume(t),o):n(t)}}function Kd(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Mi(e)?n(e):t(e)}}function qd(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ri(e)}function Jd(e){return!ji(e)}function Yd(e){return!(e===47||Xd(e))}function Xd(e){return e===43||e===45||e===46||e===95||Mi(e)}function Zd(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 Qd={tokenize:sf,partial:!0};function $d(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:rf,continuation:{tokenize:af},exit:of}},text:{91:{name:`gfmFootnoteCall`,tokenize:nf},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:ef,resolveTo:tf}}}}function ef(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=Ai(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 tf(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 nf(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||Ri(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Ai(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Ri(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 rf(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||Ri(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Ai(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Ri(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),J(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function af(e,t,n){return e.check(aa,t,e.attempt(Qd,t,n))}function of(e){e.exit(`gfmFootnoteDefinition`)}function sf(e,t,n){let r=this;return J(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 cf(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&&Ci(o,o.length,0,Qi(s,e.slice(r+1,n),t)),Ci(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Ci(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=Zi(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=Zi(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var lf=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){uf(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 uf(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 df(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 ff(){return{flow:{null:{name:`table`,tokenize:pf,resolveAll:mf}}}}function pf(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):K(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):q(t)?J(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||Ri(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,q(t)?J(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return q(t)?J(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||K(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return q(t)?J(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||K(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||K(n)?(e.exit(`tableRow`),t(n)):q(n)?J(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Ri(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 mf(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 lf;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(gf(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=hf(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=hf(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=hf(f,t,o,i,n,d)):(o[0]=o[1],d=hf(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&gf(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=df(t.events,n))}return e}function hf(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},_f(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=_f(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=_f(t.events,n[2]),a=_f(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({},_f(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function gf(e,t,n,r,i){let a=[],o=_f(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 _f(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var vf={name:`tasklistCheck`,tokenize:bf};function yf(){return{text:{91:vf}}}function bf(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 Ri(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 K(r)?t(r):q(r)?e.check({tokenize:xf},t,n)(r):n(r)}}function xf(e,t,n){return J(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Sf(e){return Ei([Ld(),$d(),cf(e),ff(),yf()])}var Cf={};function wf(e){let t=this,n=e||Cf,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Sf(n)),a.push(Ed()),o.push(Dd(n))}var Tf=e=>/\.(png|jpe?g)$/i.test(e.replace(/[?#].*$/,``)),Ef=(e,t,n)=>t.startsWith(`board:`)?`/api/board-attachment?file=${encodeURIComponent(t)}`:`/api/sessions/${e}/image?path=${encodeURIComponent(t)}${n?`&in=${n}`:``}`;function Df(e){let[t,n]=(0,v.useState)(null),r=Ef(e.sessionId,e.path,e.folder);return t?(0,U.jsxs)(`p`,{className:`error`,children:[e.alt?`${e.alt}: `:``,t]}):(0,U.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 Of(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 kf({text:e,label:t=`Copy`}){let[n,r]=(0,v.useState)(!1);return(0,U.jsx)(`button`,{type:`button`,className:`copy-button`,onClick:async()=>{await Of(e),r(!0),setTimeout(()=>r(!1),1500)},children:n?`Copied`:t})}function Af(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(Af).join(``):e&&typeof e==`object`&&`props`in e?Af(e.props.children):``}function jf(e){return e.startsWith(`#`)?!1:/^[a-zA-Z]:[\\/]/.test(e)||e.startsWith(`file:`)?!0:!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)}function Mf(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 Nf({text:e,baseDir:t=``,onOpenFile:n,sessionId:r}){return(0,U.jsx)(`div`,{className:`markdown`,children:(0,U.jsx)(yl,{remarkPlugins:[wf],components:{pre:({children:e})=>{let t=Af(e).replace(/\n$/,``);return(0,U.jsxs)(`div`,{className:`code-block`,children:[(0,U.jsx)(kf,{text:t}),(0,U.jsx)(`pre`,{children:e})]})},a:({href:e,children:r})=>n&&e&&jf(e)?(0,U.jsx)(`a`,{href:e,className:`file-link`,onClick:r=>{r.preventDefault(),n(Mf(t,e))},children:r}):(0,U.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||!jf(a)||a.startsWith(`file:`))return(0,U.jsxs)(`span`,{className:`image-note`,children:[`[image not shown`,i?`: ${i}`:``,`]`]});let o=Mf(t,a.replace(/[?#].*$/,``));return!Tf(o)||o.startsWith(`..`)?(0,U.jsxs)(`span`,{className:`image-note`,children:[`[image not shown`,i?`: ${i}`:``,`: only PNG and JPEG images inside the project]`]}):(0,U.jsx)(Df,{sessionId:r,path:o,alt:i,onClick:()=>n?.(o)})},table:({children:e})=>(0,U.jsx)(`div`,{className:`table-scroll`,children:(0,U.jsx)(`table`,{children:e})})},children:e})})}var Pf=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Ff=e=>B.usagePublishRepos(e);function If(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 Lf({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)(()=>{B.usagePublish().then(e=>r(e),()=>{}),B.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(`
55
+ `);if((0,v.useEffect)(()=>{n&&(s(n.repo??``),l(h),d(g?g.split(`
56
+ `):[]))},[n?.repo,h,g]),!n)return null;let _=o.trim(),y=!_||Pf.test(_),b=c||u.length>0,x=c!==h||[...u].sort().join(`
57
+ `)!==g||_!==(n.repo??``),S=()=>t(async()=>{r(await B.setUsagePublish(b,_||null,{allAccounts:c,accounts:[...u].sort()})),a(await B.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,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Not set up`}),(0,U.jsxs)(`div`,{className:`offline`,children:[(0,U.jsx)(`span`,{className:`offline-name`,children:`Publish usage`}),(0,U.jsx)(`span`,{className:`offline-why`,children:`Share this computer's usage totals with your other computers through a GitHub repository.`}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>p(!0),children:`Set up ›`})]})]});let D=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`muted`,children:[`Shares this computer's usage totals with a GitHub repository, through your `,(0,U.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,U.jsxs)(`div`,{role:`group`,"aria-label":`Accounts to publish`,children:[(0,U.jsx)(`h4`,{children:`Accounts`}),(0,U.jsxs)(`label`,{className:`toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>l(e.target.checked)}),` `,(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`field-name`,children:`All accounts`}),` `,(0,U.jsx)(`span`,{className:`muted`,children:`(every Claude account on this computer, ones added later too)`})]})]}),C.map(t=>(0,U.jsxs)(`label`,{className:`toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:c||u.includes(t),disabled:c,onChange:e=>T(t,e.target.checked)}),` `,(0,U.jsxs)(`span`,{children:[(0,U.jsxs)(`span`,{className:`field-name`,children:[`Publish `,t]}),` `,(0,U.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,U.jsx)(Nn,{project:``,label:`Default usage repository`,newName:`ledung-usage`,value:o,ok:y,onChange:s,load:Ff}),(0,U.jsxs)(`p`,{className:`muted`,children:[`Every project publishes here unless its own settings name a usage repository of its own.`,!!n.projectRepos?.length&&(0,U.jsxs)(U.Fragment,{children:[` Projects with their own: `,n.projectRepos.map((e,t)=>(0,U.jsxs)(`span`,{children:[t?`; `:``,e.projects.join(`, `),` → `,(0,U.jsx)(`span`,{className:`mono`,children:e.repo})]},e.repo)),`.`]})]}),(b||_)&&(0,U.jsxs)(`div`,{className:`board-warning`,children:[(0,U.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,U.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,U.jsx)(`button`,{disabled:!x||!y||b&&!_,onClick:()=>void S(),children:`Save`}),b&&!_&&(0,U.jsx)(`span`,{className:`muted`,children:` Choose the repository to publish to.`}),!b&&n.enabled&&(0,U.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,U.jsxs)(`p`,{className:`muted`,children:[`Publishes as `,(0,U.jsx)(`strong`,{children:n.computer}),n.lastPublishedAt?`; last published ${If(n.lastPublishedAt)}`:``,`.`,n.error&&(0,U.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,U.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,U.jsx)(Rf,{view:n,onView:r,run:t}),i?.repo&&(0,U.jsx)(zf,{shared:i,onShared:a,run:t})]});return E?(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Not set up`}),(0,U.jsxs)(`div`,{className:`offline-open`,role:`group`,"aria-label":`Publish usage`,children:[(0,U.jsxs)(`h4`,{children:[(0,U.jsx)(`span`,{children:`Publish usage`}),(0,U.jsx)(`button`,{className:`small`,"aria-label":`Close Publish usage`,title:`Close`,onClick:()=>p(!1),children:`✕`})]}),D]})]}):(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Publish usage`}),D]})}function Rf({view:e,onView:t,run:n}){let r=H(),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``);return(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h4`,{children:`Usage key`}),(0,U.jsxs)(`p`,{className:`muted`,children:[`Makes a project's `,(0,U.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,U.jsxs)(`div`,{className:`board-add`,children:[e.hasKey&&!i&&(0,U.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>a((await B.revealUsageKey()).key)),children:`Show the key`}),i&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`mono`,children:i}),` `,(0,U.jsx)(kf,{text:i}),` `,(0,U.jsx)(`button`,{className:`small`,onClick:()=>a(null),children:`Hide`})]}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await B.takeLinkedUsageKey())),children:`Take a linked computer's key`})]}),(0,U.jsxs)(`div`,{className:`board-add`,children:[(0,U.jsx)(`input`,{...r,className:`mono`,value:o,placeholder:`Paste a usage key from another computer`,onChange:e=>s(e.target.value.trim())}),(0,U.jsx)(`button`,{className:`small`,disabled:!o,onClick:()=>void n(async()=>{t(await B.setUsageKey(o)),s(``),a(null)}),children:`Use this key`})]})]})}function zf({shared:e,onShared:t,run:n}){let[r,i]=(0,v.useState)(null);return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h4`,{children:[`Computers publishing to `,e.repo]}),e.error&&(0,U.jsx)(`p`,{className:`board-error`,children:e.error}),!e.entries.length&&!e.error&&(0,U.jsx)(`p`,{className:`muted`,children:`None yet.`}),(0,U.jsx)(`ul`,{className:`board-counts`,children:e.entries.map(a=>(0,U.jsxs)(`li`,{children:[(0,U.jsx)(Bf,{entry:a}),a.stale&&!a.own&&e.canRemove&&(r===a.id?(0,U.jsxs)(U.Fragment,{children:[` `,(0,U.jsx)(`button`,{className:`small danger`,onClick:()=>void n(async()=>{t(await B.removeSharedUsage(a.id)),i(null)}),children:`Confirm: remove its usage`}),` `,(0,U.jsx)(`button`,{className:`small`,onClick:()=>i(null),children:`Cancel`})]}):(0,U.jsxs)(U.Fragment,{children:[` `,(0,U.jsx)(`button`,{className:`small`,onClick:()=>i(a.id),children:`Remove…`})]}))]},a.id))}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await B.sharedUsage(!0))),children:`Check again`})]})}function Bf({entry:e}){let t=`${e.computer??`A computer`}${e.login?` (@${e.login})`:``}${e.own?`, this computer`:``}`;return e.state===`newer`?(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:t}),`: published by a newer Ledung. Update Ledung to read it.`]}):e.state===`invalid`?(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:t}),`: its file can't be read (`,e.reason,`).`]}):(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:t}),e.asOf?`, as of ${If(e.asOf)}`:``,e.stale&&(0,U.jsx)(`span`,{className:`chip warn`,children:`silent for 30 days`})]})}function $({value:e,onChange:t}){let n=e.usageRepo.trim();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Vf,{value:e.publishUsageName,onChange:n=>t({...e,publishUsageName:n})}),(0,U.jsx)(Nn,{project:``,label:(0,U.jsx)(`span`,{className:`field-name`,children:`Usage repository`}),newName:`ledung-usage`,value:e.usageRepo,ok:!n||Pf.test(n),onChange:n=>t({...e,usageRepo:n}),load:Ff}),(0,U.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 Vf({value:e,onChange:t}){return(0,U.jsxs)(`label`,{className:`toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` `,(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`field-name`,children:`Publish its usage under its name`}),` `,(0,U.jsx)(`span`,{className:`muted`,children:`(when usage is published in Settings; otherwise it shows as other# and four characters)`})]})]})}var Hf=`ledung.waitingFilter`;function Uf(e){try{let t=JSON.parse(e.getItem(Hf)??`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 Wf(e,t){try{e.setItem(Hf,JSON.stringify(t))}catch{}}function Gf(e,t,n){let r=Uf(e);(r.one===t||r.hidden.includes(t))&&Wf(e,{mode:r.mode,one:r.one===t?n:r.one,hidden:r.hidden.map(e=>e===t?n:e)})}function Kf(e,t,n,r,i){let a=e.map(e=>{let r=oe(e),i=t(e.sessionId);return{q:e,v:r,project:i,tier:fe(r.tier,n(i))}}),o=L(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 qf={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 Jf(e){return e===`A`?1:2}function Yf(e){let t=e?.lockdown?.level;return t===`A`||t===`B`?t:null}function Xf(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 Zf(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 Qf=10,$f=0;function ep(){if($f)return $f;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`&&($f=t),t||6}function tp({level:e,fill:t,children:n}){return e?(0,U.jsx)(np,{level:e,fill:!!t,children:n}):(0,U.jsx)(U.Fragment,{children:n})}function np({level:e,fill:t,children:n}){let r=(0,v.useRef)(null),i=(0,v.useRef)(null),[a,o]=(0,v.useState)(null),s=Jf(e);(0,v.useLayoutEffect)(()=>{let e=()=>{let e=r.current,n=i.current;if(!e||!n)return;let a=ep(),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/Qf)),f=Math.max(0,(t-d*Qf)/2)}else{let e=n.clientHeight-(parseFloat(getComputedStyle(n).paddingBottom)||0),t=Math.max(1,Math.ceil(e/Qf-.01));d=t+2*s,p=Math.max(0,t*Qf-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&&($f=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*Qf;return(0,U.jsxs)(`div`,{ref:r,className:`lframe ${e.toLowerCase()}${t?` fill`:``}`,"data-lock":e,children:[(0,U.jsx)(`pre`,{className:`lframe-border`,"aria-hidden":`true`,style:a?{left:a.padX,top:a.padY,width:a.cols*c,height:a.rows*Qf}:void 0,children:a&&Zf(Xf(e,a.cols,a.rows)).map((e,t)=>(0,U.jsxs)(`span`,{children:[t>0&&`
58
+ `,e.map((e,t)=>e.kind?(0,U.jsx)(`span`,{className:`k-${e.kind}`,children:e.text},t):e.text)]},t))}),(0,U.jsx)(`div`,{ref:i,className:`lframe-inner`,style:{margin:`${u}px ${l}px`,paddingBottom:a?.extra||void 0},children:n})]})}var rp={manager:`on`,session:`off`};function ip(e,t,n){return n?.[e]?.newSkills??t[e]?.newSkills??rp[e]}function ap(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)&&ip(t,n,r)===`on`}function op(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 sp=(e,t,n)=>!!(e?.[t]?.on?.includes(n)||e?.[t]?.off?.includes(n)),cp=[{role:`manager`,label:`Manager`},{role:`session`,label:`Sessions`}],lp={personal:`Personal`,"claude.ai":`From claude.ai`};function up(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),B.skills(e).then(e=>{t&&n(e)},e=>{t&&i(e.message)}),()=>{t=!1}},[e]),{list:t,error:r}}function dp({list:e,error:t,value:n,onChange:r,defaults:i}){if(t)return(0,U.jsxs)(`p`,{className:`error`,children:[`Couldn't list the skills: `,t]});if(!e)return(0,U.jsx)(`p`,{className:`muted`,children:`Looking for your skills…`});let a=i??{},o=i?n:void 0,s=(e,t)=>i?ap(e,t,a,o):ap(e,t,n,void 0),c=new Set(e.skills.map(e=>e.name)),l=[...new Set(cp.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,U.jsxs)(`div`,{className:`skill-picker`,children:[(0,U.jsxs)(`table`,{children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Skill`}),cp.map(({role:e,label:t})=>(0,U.jsx)(`th`,{children:t},e))]})}),(0,U.jsxs)(`tbody`,{children:[(0,U.jsxs)(`tr`,{className:`skill-new`,children:[(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`strong`,{children:`New skills`}),(0,U.jsxs)(`div`,{className:`muted`,children:[`A skill with no tick chosen`,i?` here or in Settings`:``,`, such as one you add later.`]})]}),cp.map(({role:e,label:t})=>(0,U.jsx)(`td`,{children:i?(0,U.jsxs)(`select`,{"aria-label":`New skills, ${t}`,value:n[e]?.newSkills??``,onChange:t=>u(e,t.target.value||null),children:[(0,U.jsxs)(`option`,{value:``,children:[`Settings: `,ip(e,a,void 0)]}),(0,U.jsx)(`option`,{value:`on`,children:`on`}),(0,U.jsx)(`option`,{value:`off`,children:`off`})]}):(0,U.jsxs)(`select`,{"aria-label":`New skills, ${t}`,value:ip(e,n,void 0),onChange:t=>u(e,t.target.value),children:[(0,U.jsx)(`option`,{value:`on`,children:`on`}),(0,U.jsx)(`option`,{value:`off`,children:`off`})]})},e))]}),d.map(e=>[(0,U.jsx)(`tr`,{className:`skill-group`,children:(0,U.jsx)(`td`,{colSpan:3,children:lp[e.source]})},`h-${e.source}`),...e.skills.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`span`,{className:`mono`,children:e.name}),e.description&&(0,U.jsx)(`div`,{className:`muted`,children:e.description})]}),cp.map(({role:t,label:a})=>{let o=sp(n,t,e.name);return(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`input`,{type:`checkbox`,"aria-label":`${e.name}, ${a}`,checked:s(e.name,t),onChange:i=>r(op(n,t,e.name,i.target.checked))}),i&&o&&(0,U.jsx)(`button`,{type:`button`,className:`small skill-clear`,title:`Follow Settings again`,onClick:()=>r(op(n,t,e.name,null)),children:`here ✕`})]},t)})]},e.name))]),l.length>0&&(0,U.jsx)(`tr`,{className:`skill-group`,children:(0,U.jsx)(`td`,{colSpan:3,children:`Not on this computer any more`})}),l.map(e=>(0,U.jsxs)(`tr`,{className:`skill-gone`,children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(`span`,{className:`mono`,children:e})}),cp.map(({role:t,label:i})=>(0,U.jsx)(`td`,{children:sp(n,t,e)&&(0,U.jsxs)(`button`,{type:`button`,className:`small skill-clear`,"aria-label":`Clear ${e}, ${i}`,onClick:()=>r(op(n,t,e,null)),children:[n[t]?.on?.includes(e)?`on`:`off`,` ✕`]})},t))]},`gone-${e}`))]})]}),!e.skills.length&&(0,U.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,U.jsxs)(`p`,{className:`muted`,children:[`Plugin skills go on and off with their plugin, in the session profile: `,e.plugins.join(`, `),`.`]})]})}function fp(e,t,n){if(!e)return``;let r=e.skills.length,i=r=>e.skills.filter(e=>n?ap(e.name,r,n,t):ap(e.name,r,t,void 0)).length;return`manager ${i(`manager`)} of ${r}, sessions ${i(`session`)} of ${r}`}function pp({run:e}){let{list:t,error:n}=up(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,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Skills`}),(0,U.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,U.jsxs)(`details`,{children:[(0,U.jsxs)(`summary`,{children:[`Default skills`,t&&r?`: ${fp(t,r,null)}`:``]}),(0,U.jsx)(dp,{list:t,error:n,value:r??{},onChange:e=>{i(e),o(!1)},defaults:null}),(0,U.jsx)(`button`,{className:`primary`,disabled:!r,onClick:()=>void e(async()=>{i(await B.setSkillDefaults(r??{})),o(!0)}),children:`Save`}),a&&(0,U.jsx)(`span`,{className:`muted`,children:` Saved.`})]})]})}function mp({colour:e,children:t}){if(!e)return(0,U.jsx)(U.Fragment,{children:t});let n=Tt[e];return(0,U.jsx)(`span`,{className:`named`,style:{"--name-light":n.light,"--name-dark":n.dark},children:t})}function hp({project:e,run:t}){let n=n=>t(()=>B.setProjectColours(e.name,n)),{manager:r,sessions:i}=e.colours,a=Object.keys(Tt),o=(e,t,n,r)=>(0,U.jsx)(`button`,{type:`button`,className:`swatch${t?` on`:``}`,"aria-pressed":t,title:Tt[e].label,"aria-label":`${r}: ${Tt[e].label}`,onClick:n,children:(0,U.jsx)(mp,{colour:e,children:`●`})},e);return(0,U.jsxs)(`div`,{className:`name-colours`,children:[(0,U.jsxs)(`div`,{className:`name-colour-row`,role:`group`,"aria-label":`Manager name colour`,children:[(0,U.jsxs)(`div`,{className:`name-colour-head`,children:[(0,U.jsx)(`span`,{className:`name-colour-label field-name`,children:`Manager name`}),(0,U.jsx)(`button`,{type:`button`,className:`small${r===null?` on`:``}`,"aria-pressed":r===null,onClick:()=>n({manager:null,sessions:i}),children:`None`})]}),(0,U.jsx)(`div`,{className:`swatches`,children:a.map(e=>o(e,r===e,()=>n({manager:e,sessions:i}),`Manager name`))})]}),(0,U.jsxs)(`div`,{className:`name-colour-row`,role:`group`,"aria-label":`Its sessions' name colour`,children:[(0,U.jsxs)(`div`,{className:`name-colour-head`,children:[(0,U.jsx)(`span`,{className:`name-colour-label field-name`,children:`Its sessions' names`}),(0,U.jsx)(`button`,{type:`button`,className:`small${i===`same`?` on`:``}`,"aria-pressed":i===`same`,onClick:()=>n({manager:r,sessions:`same`}),children:`Same as manager`}),(0,U.jsx)(`button`,{type:`button`,className:`small${i===`none`?` on`:``}`,"aria-pressed":i===`none`,onClick:()=>n({manager:r,sessions:`none`}),children:`None`})]}),(0,U.jsx)(`div`,{className:`swatches`,children:a.map(e=>o(e,i===e,()=>n({manager:r,sessions:e}),`Its sessions' names`))})]})]})}function gp({colour:e,run:t}){let n=e=>t(()=>B.setChatsColour(e));return(0,U.jsx)(`div`,{className:`name-colours`,children:(0,U.jsxs)(`div`,{className:`name-colour-row`,role:`group`,"aria-label":`Chats' name colour`,children:[(0,U.jsxs)(`div`,{className:`name-colour-head`,children:[(0,U.jsx)(`span`,{className:`name-colour-label field-name`,children:`Chats' names`}),(0,U.jsx)(`button`,{type:`button`,className:`small${e===null?` on`:``}`,"aria-pressed":e===null,onClick:()=>n(null),children:`None`})]}),(0,U.jsx)(`div`,{className:`swatches`,children:Object.keys(Tt).map(t=>(0,U.jsx)(`button`,{type:`button`,className:`swatch${e===t?` on`:``}`,"aria-pressed":e===t,title:Tt[t].label,"aria-label":`Chats' names: ${Tt[t].label}`,onClick:()=>n(t),children:(0,U.jsx)(mp,{colour:t,children:`●`})},t))})]})})}function _p(e,t){return Et(t.find(t=>t.name===e.project)?.colours,e.role)}var vp=[{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:`Stop Ledung`,about:`Stops Ledung and its sessions`,keywords:[`quit`,`exit`,`shut down`,`close`,`background`]},{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`]},{label:`Start at sign-in`,about:`Start Ledung in the background when you sign in`,keywords:[`startup`,`autostart`,`login`,`log in`,`boot`,`windows`,`launch agent`]},{label:`Log`,about:`Where a background Ledung writes what it says`,keywords:[`log`,`output`,`console`,`debug`,`ledung.log`]}]},{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`]},{label:`Update channel`,about:`Public releases only, or dev builds too (npm installs)`,keywords:[`channel`,`dev`,`public`,`npm`,`beta`]}]}],yp=vp[0].id,bp=e=>`settings:${e}`,xp={usageStop:`Usage stops`,claudeProblem:`Claude Code`,configProblem:`Config file`};function Sp(e){let t=vp.find(t=>t.settings.some(t=>t.label===xp[e]));return t?bp(t.id):`settings`}function Cp(e,t){if(e===`accounts`)return`claude`;let n=e?.startsWith(`settings:`)?e.slice(9):null;return n&&vp.some(e=>e.id===n)?n:t?null:yp}var wp=[{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`]},{label:`Drawn workflow`,about:`The process as a diagram, to see and edit`,keywords:[`diagram`,`flow`,`builder`,`draw`]}]},{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`]}]}],Tp=[{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 Ep(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 Dp=(e,t)=>e===null?`chats:${t}`:`ps:${e}/${t}`;function Op(e,t){let n=e.project===null?Tp:wp;return e.group&&n.some(t=>t.id===e.group)?e.group:t?null:n[0].id}function kp(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 Ap(e){if(!e)return null;if(e===`settings`||e===`accounts`||e.startsWith(`settings:`))return`ledung`;if(e===`add`)return e;let t=Ep(e);return t?t.project===null?`chats`:`ps:${t.project}`:null}function jp(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 Mp=e=>e?``:`off`;function Np(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 Pp(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 Fp(e){return[{id:`ledung`,label:`Ledung`,groups:vp,viewOf:bp},{id:`chats`,label:`Chats`,groups:Tp,viewOf:e=>Dp(null,e)},...e.map(e=>({id:`ps:${e.name}`,label:e.name,groups:wp,viewOf:t=>Dp(e.name,t)}))]}var Ip=e=>e.normalize(`NFD`).replace(/[̀-ͯ]/g,``).toLowerCase().replace(/[^\p{L}\p{N}]+/gu,` `).trim(),Lp=e=>Ip(e).split(` `).filter(Boolean),Rp={label:4,keyword:3,group:2,about:1};function zp(e,t,n=null){let r=Lp(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=Lp(t.label);for(let o of t.settings){s++;let c=[[Rp.label,Lp(o.label)],[Rp.keyword,(o.keywords??[]).flatMap(Lp)],[Rp.group,n],[Rp.about,Lp(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=Ip(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 Bp=(e,t,n)=>zp(e,Fp(t),n);function Vp(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null);(0,v.useEffect)(()=>{B.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(()=>B.updateStatus().then(n,()=>{}),1e3);return()=>clearInterval(e)},[a]),{view:t,error:r,act:e=>{i(null),e().then(n,e=>i(e.message))}}}function Hp(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 Up(e){let t=Vp(e.hellos),n=Pp(t.view),r=Ap(e.view),i=!!t.view?.check&&!t.view.check.upToDate,a=Kp(r,e.projects,t=>{t!==e.view&&e.onOpen(t)});return(0,U.jsx)(Wp.Provider,{value:a,children:(0,U.jsxs)(`div`,{className:`page-view settings-frame`,children:[(0,U.jsxs)(`header`,{className:`session-head settings-head`,children:[(0,U.jsxs)(`div`,{className:`session-head-text`,children:[(0,U.jsx)(`h2`,{children:`Settings`}),(0,U.jsx)(`div`,{className:`muted`,children:`One place for Ledung, chats and every project.`})]}),(0,U.jsxs)(`div`,{className:`session-corner settings-version`,children:[(0,U.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,U.jsxs)(U.Fragment,{children:[` · `,n]})]}),e.canRestart?(0,U.jsx)(em,{hellos:e.hellos}):(0,U.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,U.jsx)(`nav`,{className:`settings-tabs`,role:`tablist`,"aria-label":`Settings`,children:kp(e.projects).map(t=>(0,U.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,U.jsx)(`div`,{className:`settings-tab-body`,children:e.children(t)})]})})}var Wp=(0,v.createContext)(null),Gp=e=>e instanceof HTMLElement&&(e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`);function Kp(e,t,n){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(null),s=(0,v.useRef)(null),c=(0,v.useMemo)(()=>Bp(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&&!Gp(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 qp=`section h3, section h4, label.toggle, .compact-slider > span, .offline-name, .field-name`;function Jp(e,t){if(!e)return null;let n=Ip(t),r=[...e.querySelectorAll(qp)].find(e=>{let t=Ip(e.textContent??``);return t===n||t===`run a ${n}`});return r?r.closest(`.field, .offline`)??r.closest(`label, details, .compact-slider`)??r:null}var Yp=2500,Xp=2e3;function Zp({search:e}){let t=H();return(0,U.jsxs)(`div`,{className:`settings-search`,children:[(0,U.jsx)(`span`,{className:`settings-search-icon`,"aria-hidden":!0,children:`⌕`}),(0,U.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,U.jsx)(`button`,{type:`button`,className:`settings-search-clear`,"aria-label":`Clear search`,title:`Clear search`,onClick:()=>{e.setQuery(``),e.input.current?.focus()},children:`×`}):(0,U.jsx)(`kbd`,{children:`/`})]})}function Qp({search:e}){let t=e.query.trim();return e.hits.length?(0,U.jsxs)(`div`,{className:`search-results`,role:`region`,"aria-label":`Search results`,children:[(0,U.jsxs)(`p`,{className:`muted`,children:[e.hits.length,` setting`,e.hits.length===1?``:`s`,` match "`,t,`"`]}),(0,U.jsx)(`ul`,{children:e.hits.map(t=>(0,U.jsx)(`li`,{children:(0,U.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,U.jsxs)(`span`,{className:`search-hit-name`,children:[t.label,t.storedIn&&(0,U.jsxs)(U.Fragment,{children:[` `,(0,U.jsx)(tm,{kind:t.storedIn})]})]}),(0,U.jsxs)(`span`,{className:`search-hit-path`,children:[t.tabLabel,` › `,t.groupLabel]}),t.about&&(0,U.jsx)(`span`,{className:`search-hit-about muted`,children:t.about})]})},`${t.tab}/${t.group}/${t.label}`))})]}):(0,U.jsx)(`div`,{className:`search-results`,role:`region`,"aria-label":`Search results`,children:(0,U.jsxs)(`p`,{className:`muted`,children:[`No setting matches "`,t,`".`]})})}var $p=6e4;function em({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`),$p);return()=>clearTimeout(e)},[r]),r===`restarting`?(0,U.jsx)(`span`,{className:`muted`,children:`Restarting…`}):t?(0,U.jsxs)(`span`,{className:`restart-confirm`,children:[(0,U.jsx)(`span`,{className:`muted`,children:`Sessions keep running and reconnect.`}),(0,U.jsx)(`button`,{className:`small primary`,onClick:async()=>{o(e),n(!1),i(`restarting`);try{await B.restart()}catch{i(`failed`),n(!1)}},children:`Restart`}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>n(!1),children:`Cancel`})]}):(0,U.jsxs)(`span`,{className:`restart-confirm`,children:[r===`failed`&&(0,U.jsx)(`span`,{className:`restart-problem`,children:`The restart was refused.`}),r===`timeout`&&(0,U.jsx)(`span`,{className:`restart-problem`,children:`Ledung hasn't come back yet. Check its window, or its log when it runs in the background.`}),(0,U.jsx)(`button`,{className:`small`,title:`Restart Ledung on its newest version`,onClick:()=>{i(`idle`),n(!0)},children:`Restart Ledung`})]})}function tm({kind:e}){return(0,U.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 nm(e){let t=(0,v.useContext)(Wp),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=Jp(r.current,i.label);a?(a.classList.add(`search-found`),a.scrollIntoView({block:`center`}),setTimeout(()=>a.classList.remove(`search-found`),Yp),t.reached(i.n)):Date.now()-e<Xp?n=setTimeout(o,100):t.reached(i.n)};return o(),()=>clearTimeout(n)},[a,i?.n]);let o=(0,U.jsxs)(`div`,{className:`settings-side`,children:[t&&(0,U.jsx)(Zp,{search:t}),n&&e.current===null?(0,U.jsx)(Qp,{search:t}):(0,U.jsx)(rm,{...e})]});if(e.current===null)return(0,U.jsxs)(`div`,{className:`settings-split narrow`,children:[o,e.foot]});let s=e.groups.find(t=>t.id===e.current)?.label??``;return(0,U.jsxs)(`div`,{className:`settings-split${e.narrow?` narrow`:``}`,children:[!e.narrow&&o,(0,U.jsxs)(`div`,{className:`settings-main`,children:[n&&!e.narrow&&(0,U.jsx)(Qp,{search:t}),(0,U.jsxs)(`div`,{className:`settings-content`,role:`region`,"aria-label":s,ref:r,hidden:n&&!e.narrow,children:[e.narrow&&(0,U.jsxs)(`div`,{className:`settings-group-head`,children:[(0,U.jsx)(`button`,{className:`small`,onClick:()=>e.onOpen(null),children:`← All settings`}),(0,U.jsx)(`h3`,{children:s})]}),e.children]}),e.foot]})]})}function rm(e){return(0,U.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,U.jsxs)(v.Fragment,{children:[r&&(0,U.jsx)(`div`,{className:`settings-menu-sep`}),r&&t.part===`browser`&&(0,U.jsx)(`div`,{className:`settings-menu-cap`,children:`This browser`}),(0,U.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,U.jsxs)(`span`,{children:[t.label,i&&(0,U.jsx)(`span`,{className:`unsaved-mark`,title:`Changed, not saved yet`,"aria-label":`(not saved)`,children:` •`})]}),(0,U.jsxs)(`span`,{className:`muted`,children:[e.words[t.id]??``,e.narrow&&` ›`]})]})]},t.id)})})}function im(e){return!e.count&&!e.saved?null:(0,U.jsxs)(`div`,{className:`save-bar`,role:`region`,"aria-label":`Unsaved changes`,children:[(0,U.jsxs)(`span`,{className:`muted`,children:[e.count?`${e.count} unsaved change${e.count===1?``:`s`}`:`Saved.`,e.count>0&&(0,U.jsxs)(U.Fragment,{children:[` · `,e.note]}),e.count>0&&e.disabled&&(0,U.jsxs)(U.Fragment,{children:[` · `,(0,U.jsx)(`span`,{className:`error`,children:e.disabled})]})]}),(0,U.jsx)(`span`,{className:`grow`}),e.count>0&&(0,U.jsx)(`button`,{className:`small`,disabled:e.busy,onClick:e.onDiscard,children:`Discard`}),e.count>0&&(0,U.jsx)(`button`,{className:`small primary`,disabled:e.busy||!!e.disabled,onClick:e.onSave,children:e.busy?`Saving…`:`Save`})]})}function am({follows:e,text:t,onReset:n}){return(0,U.jsxs)(`span`,{className:`inherit${e?``:` over`}`,children:[t,!e&&(0,U.jsxs)(U.Fragment,{children:[` · `,(0,U.jsx)(`button`,{type:`button`,className:`link`,onClick:e=>{e.preventDefault(),n()},children:`Reset`})]})]})}var om=`(max-width: 760px)`;function sm(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 cm(e,t,n){return Math.round(Math.min(n,Math.max(t,e)))}function lm(e){let t=e==null?NaN:Number(e);return Number.isFinite(t)&&t>0?t:null}function um(e,t,n,r,i){return e===(t===`width`?`ArrowRight`:`ArrowDown`)?cm(n+20,r,i):e===(t===`width`?`ArrowLeft`:`ArrowUp`)?cm(n-20,r,i):e===`Home`?r:e===`End`?i:null}function dm(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 fm=(e=``)=>({name:e,account:``,model:``,managerModel:``,permissionMode:``,managerGrant:``,projectToolsUnasked:!1,projectSettingsTools:!1,publishUsageName:!1,usageRepo:``,managerProfile:``,sessionProfile:``,skills:{},...N({commandPatterns:[],pathPatterns:[]}),devShipCommand:``,ticketPattern:``,ticketUrl:``,questionTiers:P.join(`
59
+ `),extraFolders:``,workflowUse:null,workflowName:``,workflowConfig:``,lockdownLevel:`off`,lockdownBoard:!1,lockdownRemoteControl:!1,lockdownNetwork:``,lockdownDockerNetwork:``});function pm(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(`
60
+ `),extraFolders:e.extraFolders.join(`
61
+ `),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(`
62
+ `),lockdownDockerNetwork:e.lockdown.dockerNetwork??``}}function mm(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}:{}}}:{},...hm(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()}}:{},..._m(gm(e.questionTiers),P)||!gm(e.questionTiers).length?{}:{questionTiers:gm(e.questionTiers)},...gm(e.extraFolders).length?{extraFolders:gm(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}:{},...gm(e.lockdownNetwork).length?{network:gm(e.lockdownNetwork)}:{},...e.lockdownDockerNetwork.trim()?{dockerNetwork:e.lockdownDockerNetwork.trim()}:{}}}}}var hm=e=>Object.values(e).some(e=>e&&(e.newSkills||e.on?.length||e.off?.length)),gm=e=>[...new Set(e.split(`
63
+ `).map(e=>e.trim()).filter(Boolean))],_m=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),vm=(e,t)=>e.workflowUse??!t;function ym(e,t,n){return t?{...e,workflowUse:n?!0:null,workflowName:t}:{...e,workflowUse:n?null:!1,workflowName:``}}var bm={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`},xm=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Sm(e,t){return Object.keys(bm).filter(n=>!xm(e[n],t[n]))}function Cm(e,t){return e===``||typeof e==`object`&&!hm(e)?{follows:!0,text:`Ledung default: ${t}`}:{follows:!1,text:`Overrides Ledung (${t})`}}var wm={account:``,model:``,managerModel:``,permissionMode:``,skills:{},managerProfile:``,sessionProfile:``};function Tm(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 Em={default:`Ask`,acceptEdits:`Accept edits`,auto:`Auto`,plan:`Plan`};function Dm({name:e,hint:t,line:n,children:r}){let i=(0,v.useId)();return(0,U.jsxs)(`div`,{className:`field`,children:[(0,U.jsxs)(`label`,{htmlFor:i,children:[(0,U.jsx)(`span`,{className:`field-name`,children:e}),t&&(0,U.jsxs)(U.Fragment,{children:[` `,(0,U.jsx)(`span`,{className:`muted`,children:t})]})]}),n,r(i)]})}function Om(e,t,n){if(!e.defaults)return null;let r=Cm(e.value[t],n);return(0,U.jsx)(am,{follows:r.follows,text:r.text,onReset:()=>e.onChange({...e.value,[t]:wm[t]})})}var km=(e,t)=>n=>e.onChange({...e.value,[t]:n.target.value});function Am(e){let t=H();return(0,U.jsx)(Dm,{name:`Name`,children:n=>(0,U.jsx)(`input`,{id:n,...t,value:e.value.name,onChange:km(e,`name`),maxLength:48,placeholder:`e.g. Website`})})}function jm(e){return(0,U.jsx)(Dm,{name:`Claude account`,hint:`(for its manager and all its sessions)`,line:Om(e,`account`,`this computer's own login`),children:t=>(0,U.jsxs)(`select`,{id:t,value:e.value.account,onChange:km(e,`account`),children:[(0,U.jsx)(`option`,{value:``,children:`default: this computer's own login`}),e.accounts.map(t=>(0,U.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 Mm(e){let t=H();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Dm,{name:`Model`,hint:`(empty: from the project's Claude settings, else Claude Code's default)`,line:Om(e,`model`,`the project's Claude settings, else Claude Code's`),children:n=>(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`input`,{id:n,...t,value:e.value.model,onChange:km(e,`model`),list:`ledung-models`,placeholder:`opus, sonnet, haiku or a full model name`}),(0,U.jsxs)(`datalist`,{id:`ledung-models`,children:[(0,U.jsx)(`option`,{value:`opus`}),(0,U.jsx)(`option`,{value:`sonnet`}),(0,U.jsx)(`option`,{value:`haiku`})]})]})}),(0,U.jsx)(Dm,{name:`Model for its manager`,hint:`(empty: the same as its sessions)`,line:Om(e,`managerModel`,`the same as its sessions`),children:n=>(0,U.jsx)(`input`,{id:n,...t,value:e.value.managerModel,onChange:km(e,`managerModel`),list:`ledung-models`,placeholder:`opus, sonnet, haiku or a full model name`})})]})}function Nm(e){return(0,U.jsx)(Dm,{name:`Permissions for new sessions`,line:Om(e,`permissionMode`,`Ask`),children:t=>(0,U.jsxs)(`select`,{id:t,value:e.value.permissionMode,onChange:km(e,`permissionMode`),children:[(0,U.jsx)(`option`,{value:``,children:`Ask (default)`}),b.filter(e=>e!=="default").map(e=>(0,U.jsx)(`option`,{value:e,children:Em[e]},e))]})})}function Pm(e){let t=H();return(0,U.jsx)(Dm,{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,U.jsx)(`textarea`,{id:n,...t,rows:2,value:e.value.extraFolders,onChange:km(e,`extraFolders`),className:`mono`})})}function Fm(e){let t=H();return(0,U.jsx)(Dm,{name:`What the manager may decide for you`,hint:`(empty: it asks you about everything)`,children:n=>(0,U.jsx)(`textarea`,{id:n,...t,rows:2,value:e.value.managerGrant,onChange:km(e,`managerGrant`),placeholder:`e.g. Ordinary development decisions: code structure, naming, which tests to add.`})})}function Im(e){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`label`,{className:`toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e.value.projectToolsUnasked,onChange:t=>e.onChange({...e.value,projectToolsUnasked:t.target.checked})}),` `,(0,U.jsx)(`span`,{className:`field-name`,children:`Its manager adds projects and starts or stops other managers without asking you`})]}),(0,U.jsxs)(`label`,{className:`toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e.value.projectSettingsTools,onChange:t=>e.onChange({...e.value,projectSettingsTools:t.target.checked})}),` `,(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`field-name`,children:`Its manager reads and changes workflow settings of your projects`}),` `,(0,U.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 Lm(e){let t=H();return(0,U.jsx)(Dm,{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,U.jsx)(`input`,{id:n,...t,value:e.value.devShipCommand,onChange:km(e,`devShipCommand`),className:`mono`})})}function Rm(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,U.jsx)(Dm,{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&&Om(e,t,e.defaults.profiles[e.role]),children:i=>(0,U.jsxs)(`select`,{id:i,value:n,onChange:km(e,t),children:[(0,U.jsx)(`option`,{value:``,children:`default (from the config)`}),r.map(t=>(0,U.jsxs)(`option`,{value:t,children:[t,e.profiles.includes(t)?``:` — not in the config`]},t))]})})}function zm(e){let{list:t,error:n}=up(e.project);return(0,U.jsxs)(`div`,{className:`field`,children:[e.defaults&&Om(e,`skills`,`Settings → Sessions → Skills${t?`, ${fp(t,{},t.defaults)}`:``}`),(0,U.jsxs)(`details`,{className:`skills-choice`,children:[(0,U.jsxs)(`summary`,{children:[(0,U.jsx)(`span`,{className:`field-name`,children:`Skills`}),t?`: ${fp(t,e.value.skills,t.defaults)}`:``,` `,(0,U.jsx)(`span`,{className:`muted`,children:`(which of your own skills its manager and sessions get; unchosen ones follow Settings)`})]}),(0,U.jsx)(dp,{list:t,error:n,value:e.value.skills,onChange:t=>e.onChange({...e.value,skills:t}),defaults:t?.defaults??{}})]})]})}function Bm(e,t,n){let[r,i]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let r=!0;return B.workflowCheck(e,t.trim()||void 0,n||void 0).then(e=>{r&&i(e)},()=>{}),()=>{r=!1}},[e,t,n]),r}function Vm({check:e,settings:t,container:n}){return!e?.on||!vm(t,n)||e.exists!==!1?null:(0,U.jsxs)(`p`,{className:`banner`,children:[`This project has no `,(0,U.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 Hm(e){let t=H(),{workflow:n,container:r}=e;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Dm,{name:`Workflow`,hint:`(its sessions are told to read the process first)`,children:t=>(0,U.jsxs)(`select`,{id:t,value:vm(e.value,r)?e.value.workflowName||n.workflows[0]:``,onChange:t=>e.onChange(ym(e.value,t.target.value,r)),children:[(0,U.jsx)(`option`,{value:``,children:`None`}),n.workflows.map(e=>(0,U.jsx)(`option`,{value:e,children:e},e)),e.value.workflowName&&!n.workflows.includes(e.value.workflowName)&&(0,U.jsxs)(`option`,{value:e.value.workflowName,children:[e.value.workflowName,` (not in the config)`]})]})}),vm(e.value,r)&&n.on&&(0,U.jsx)(Dm,{name:`Project config for the workflow`,hint:`(inside the project folder; empty: ${n.projectConfig})`,children:n=>(0,U.jsx)(`input`,{id:n,...t,value:e.value.workflowConfig,onChange:km(e,`workflowConfig`),className:`mono`})})]})}function Um(e){let t=H();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Dm,{name:`Ticket pattern`,hint:`(e.g. [A-Z]+-\\d+)`,children:n=>(0,U.jsx)(`input`,{id:n,...t,value:e.value.ticketPattern,onChange:km(e,`ticketPattern`),className:`mono`})}),(0,U.jsx)(Dm,{name:`Ticket link`,hint:`({id} is replaced by the ticket)`,children:n=>(0,U.jsx)(`input`,{id:n,...t,value:e.value.ticketUrl,onChange:km(e,`ticketUrl`),className:`mono`,placeholder:`https://tracker.example/browse/{id}`})})]})}function Wm(e){let t=H();return(0,U.jsx)(Dm,{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,U.jsx)(`textarea`,{id:n,...t,rows:5,value:e.value.questionTiers,onChange:km(e,`questionTiers`),onBlur:()=>{gm(e.value.questionTiers).length||e.onChange({...e.value,questionTiers:P.join(`
64
+ `)})}})})}function Gm({value:e,onChange:t,heading:n=!0}){let r=H(),[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=M(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,U.jsxs)(`div`,{className:`sensitive-list`,children:[(0,U.jsx)(`p`,{children:n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`strong`,{children:`Always goes to you`}),` `,(0,U.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,U.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,U.jsx)(`p`,{className:`muted`,children:`Nothing is sensitive here; every action is decided by the permission mode and the manager.`}),(0,U.jsx)(`ul`,{children:u.map(e=>{let t=j(e.pattern,e.kind);return(0,U.jsxs)(`li`,{children:[(0,U.jsxs)(`span`,{className:`sensitive-entry`,children:[(0,U.jsx)(`span`,{children:t??(e.kind===`command`?`Commands matching`:`Files matching`)}),(0,U.jsx)(`code`,{className:t?`muted`:void 0,children:e.pattern})]}),(0,U.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,U.jsx)(`p`,{children:(0,U.jsxs)(`button`,{type:`button`,className:`small`,onClick:()=>t(N(e)),children:[`Add suggested (`,d.length,` of `,A.length,` not in the list)`]})}),(0,U.jsxs)(`div`,{className:`sensitive-add`,children:[(0,U.jsxs)(`select`,{value:i,onChange:e=>a(e.target.value),"aria-label":`What the pattern is matched against`,children:[(0,U.jsx)(`option`,{value:`command`,children:`A command`}),(0,U.jsx)(`option`,{value:`path`,children:`A file path`})]}),(0,U.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,U.jsx)(`button`,{type:`button`,className:`small`,onClick:p,disabled:!o.trim(),children:`Add`})]}),c&&(0,U.jsx)(`p`,{className:`error`,children:c})]})}function Km({value:e,onChange:t,accounts:n,profiles:r,container:i,workflow:a,lockdownB:o}){let s={value:e,onChange:t};return(0,U.jsxs)(`div`,{className:`form`,children:[(0,U.jsx)(Am,{...s}),(0,U.jsx)(jm,{...s,accounts:n,container:i}),(0,U.jsx)(Mm,{...s}),(0,U.jsx)(Nm,{...s}),(0,U.jsx)(Fm,{...s}),(0,U.jsx)(Im,{...s}),(0,U.jsx)($,{value:e,onChange:t}),(0,U.jsx)(qm,{value:e,onChange:t,levelB:o,container:i}),(0,U.jsx)(Rm,{...s,role:`manager`,profiles:r}),(0,U.jsx)(Rm,{...s,role:`session`,profiles:r}),(0,U.jsx)(zm,{...s,project:void 0}),!!a?.workflows.length&&(0,U.jsx)(Hm,{...s,workflow:a,container:!!i}),(0,U.jsxs)(`details`,{children:[(0,U.jsxs)(`summary`,{children:[`More: actions that always go to you, tickets, question tiers`,i?``:` and extra folders`]}),(0,U.jsx)(Gm,{value:e,onChange:t}),(0,U.jsx)(Lm,{...s}),(0,U.jsx)(Um,{...s}),(0,U.jsx)(Wm,{...s}),!i&&(0,U.jsx)(Pm,{...s})]})]})}function qm({value:e,onChange:t,levelB:n,container:r}){let i=H(),a=e.lockdownLevel!==`off`,o=e.lockdownLevel===`B`;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{className:`field-name`,children:`Lockdown`}),` `,(0,U.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,U.jsxs)(`select`,{value:e.lockdownLevel,onChange:n=>t({...e,lockdownLevel:n.target.value}),children:[(0,U.jsx)(`option`,{value:`off`,children:`Off (default): managers and sessions reach it as usual`}),(0,U.jsx)(`option`,{value:`A`,children:`Level A: nothing reaches in; it may still reach out`}),(0,U.jsxs)(`option`,{value:`B`,disabled:!!n&&!o,children:[`Level B, nearly air-gapped: nothing reaches in or out`,n?`: not available here`:``]})]})]}),n&&(0,U.jsx)(`p`,{className:`muted`,children:n}),a&&(0,U.jsxs)(U.Fragment,{children:[(0,U.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,U.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,U.jsxs)(`label`,{className:`toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e.lockdownBoard,onChange:n=>t({...e,lockdownBoard:n.target.checked})}),` `,`Keep the message board on for it`]}),(0,U.jsxs)(`label`,{className:`toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e.lockdownRemoteControl,onChange:n=>t({...e,lockdownRemoteControl:n.target.checked})}),` `,`Keep Remote Control for its manager`]}),o&&!r&&(0,U.jsxs)(`label`,{children:[`Hosts its shell commands may reach `,(0,U.jsx)(`span`,{className:`muted`,children:`(one per line, such as registry.npmjs.org or *.example.com; empty: no network)`}),(0,U.jsx)(`textarea`,{...i,rows:3,value:e.lockdownNetwork,onChange:n=>t({...e,lockdownNetwork:n.target.value})})]}),o&&r&&(0,U.jsxs)(`label`,{children:[`Its island network `,(0,U.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,U.jsx)(`input`,{...i,value:e.lockdownDockerNetwork,onChange:n=>t({...e,lockdownDockerNetwork:n.target.value})})]})]})]})}function Jm(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,U.jsxs)(`div`,{className:`browser`,children:[r&&(0,U.jsx)(`p`,{className:`error`,children:r}),a&&(0,U.jsx)(`p`,{className:`muted`,children:`Loading folders…`}),t&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`browser-head`,children:[(0,U.jsx)(`button`,{className:`small`,disabled:!t.parent,onClick:()=>s(t.parent??void 0),title:`One folder up`,children:`↑ Up`}),(0,U.jsx)(`span`,{className:`mono browser-path`,children:t.path})]}),t.roots.length>1&&(0,U.jsx)(`div`,{className:`browser-roots`,children:t.roots.map(e=>(0,U.jsx)(`button`,{className:`small`,onClick:()=>s(e),children:e},e))}),(0,U.jsxs)(`ul`,{className:`browser-list`,children:[!t.entries.length&&(0,U.jsx)(`li`,{className:`muted`,children:`No folders here.`}),t.entries.map(e=>(0,U.jsxs)(`li`,{children:[(0,U.jsxs)(`button`,{className:`link`,onClick:()=>s(e.path),children:[`📁 `,e.name]}),e.git!==null&&(0,U.jsxs)(`span`,{className:`muted`,children:[` · git`,e.git?` · ${e.git}`:``]}),e.project&&(0,U.jsxs)(`span`,{className:`chip`,children:[`project `,e.project]})]},e.path))]}),(0,U.jsx)(`div`,{className:`browser-foot`,children:(0,U.jsx)(`button`,{className:`primary`,onClick:()=>e.onPick(t.path),children:e.pickLabel})})]})]})}function Ym({run:e,onAdded:t,accounts:n,defaultAccount:r,profiles:i,lockdownB:a}){let o=H(),[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)(()=>({...fm(),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,A]=(0,v.useState)(!1),[j,M]=(0,v.useState)(``),[N,P]=(0,v.useState)(null),[F,I]=(0,v.useState)(!1),ee=Bm(s===`local`&&l?l:void 0,S.workflowConfig,S.workflowName),te=ee&&s!==`local`?{...ee,exists:s!==`new`&&null}:ee,ne=()=>{m(null),g(!0),B.containers().then(f,e=>m(e.message)).finally(()=>g(!1))};(0,v.useEffect)(()=>{u(null),P(null),s===`docker`&&ne(),s===`docker`&&n.find(e=>e.name===S.account)?.kind===`folder`&&C(e=>({...e,account:``})),s===`new`&&!T&&B.projectsFolder().then(e=>E(e.path),()=>{})},[s]);let re=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)})},ie=()=>e(async()=>{I(!0);let e=ee?.workflows[0],n=e&&!S.workflowName&&vm(S,s===`docker`)?{...S,workflowName:e}:S;try{if(s===`new`){let e=await B.createProject({parent:T??void 0,github:k,task:j.trim()||void 0,settings:mm(n,null)});e.warning&&P(e.warning),t(e.project)}else t(s===`local`?await B.addProject({...mm(n,null),runner:`local`,path:l}):await B.addProject({...mm(n,null),runner:`docker`,container:_,pathInContainer:l,...b?{user:b}:{}}))}finally{I(!1)}}),ae=S.name.trim()&&(s===`new`||l);return(0,U.jsxs)(`div`,{className:`page-view`,children:[(0,U.jsx)(`header`,{className:`session-head`,children:(0,U.jsxs)(`div`,{className:`session-head-text`,children:[(0,U.jsx)(`h2`,{children:`Add a project`}),(0,U.jsx)(`div`,{className:`muted`,children:`A project is a folder where Claude Code works, with its settings and one manager.`})]})}),(0,U.jsxs)(`div`,{className:`page-body`,children:[(0,U.jsxs)(`div`,{className:`segmented`,role:`tablist`,children:[(0,U.jsx)(`button`,{className:s===`local`?`on`:``,onClick:()=>c(`local`),children:`Folder on this computer`}),(0,U.jsx)(`button`,{className:s===`docker`?`on`:``,onClick:()=>c(`docker`),children:`Folder in a container`}),(0,U.jsx)(`button`,{className:s===`new`?`on`:``,onClick:()=>c(`new`),children:`New project`})]}),s===`local`&&(l?(0,U.jsxs)(`p`,{children:[`Folder: `,(0,U.jsx)(`span`,{className:`mono`,children:l}),` `,(0,U.jsx)(`button`,{className:`small`,onClick:()=>u(null),children:`Change`})]}):(0,U.jsx)(Jm,{load:B.browse,reloadKey:`local`,onPick:re,pickLabel:`Use this folder`})),s===`docker`&&(0,U.jsxs)(U.Fragment,{children:[p&&(0,U.jsx)(`p`,{className:`error`,children:p}),h&&(0,U.jsx)(`p`,{className:`muted`,children:`Looking for running containers…`}),!h&&(d||p)&&(0,U.jsx)(`p`,{children:(0,U.jsx)(`button`,{className:`small`,onClick:ne,children:`Refresh containers`})}),d&&!d.length&&(0,U.jsx)(`p`,{className:`muted`,children:`No containers are running. Start the container first.`}),d&&d.length>0&&(0,U.jsxs)(`div`,{className:`form`,children:[(0,U.jsxs)(`label`,{children:[`Container`,(0,U.jsxs)(`select`,{value:_,onChange:e=>{y(e.target.value),x(d.find(t=>t.name===e.target.value)?.user??``),u(null)},children:[(0,U.jsx)(`option`,{value:``,children:`Choose a running container`}),d.map(e=>(0,U.jsxs)(`option`,{value:e.name,children:[e.name,` (`,e.image,`)`]},e.name))]})]}),(0,U.jsxs)(`label`,{children:[`Run as user `,(0,U.jsx)(`span`,{className:`muted`,children:`(empty: the container's default)`}),(0,U.jsx)(`input`,{...o,value:b,onChange:e=>x(e.target.value)})]})]}),_&&(l?(0,U.jsxs)(`p`,{children:[`Folder: `,(0,U.jsxs)(`span`,{className:`mono`,children:[_,`:`,l]}),` `,(0,U.jsx)(`button`,{className:`small`,onClick:()=>u(null),children:`Change`})]}):(0,U.jsx)(Jm,{load:e=>B.browseContainer(_,b,e),reloadKey:`${_}|${b}`,onPick:re,pickLabel:`Use this folder`}))]}),s===`new`&&(0,U.jsxs)(`div`,{className:`form`,children:[(0,U.jsx)(`p`,{className:`muted`,children:`Ledung creates a folder named after the project, with a git repository.`}),D?(0,U.jsx)(Jm,{load:B.browse,reloadKey:`parent`,start:T??void 0,onPick:e=>{E(e),O(!1)},pickLabel:`Create it in this folder`}):(0,U.jsxs)(`p`,{children:[`In: `,(0,U.jsx)(`span`,{className:`mono`,children:T??`…`}),` `,(0,U.jsx)(`button`,{className:`small`,onClick:()=>O(!0),children:`Change`})]}),(0,U.jsxs)(`label`,{className:`toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:k,onChange:e=>A(e.target.checked)}),` Create a private GitHub repository too`]}),(0,U.jsxs)(`label`,{children:[`What is the project for? `,(0,U.jsx)(`span`,{className:`muted`,children:`(optional: given to its manager as its first task)`}),(0,U.jsx)(`textarea`,{...o,rows:3,value:j,onChange:e=>M(e.target.value)})]})]}),(s===`new`||l)&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h3`,{children:`Settings`}),(0,U.jsx)(Km,{value:S,onChange:C,accounts:n,profiles:i,container:s===`docker`,workflow:ee,lockdownB:a}),(0,U.jsx)(Vm,{check:te,settings:S,container:s===`docker`}),(0,U.jsx)(`button`,{className:`primary`,disabled:!ae||F,onClick:()=>void ie(),children:F?`Adding…`:s===`new`?`Create project`:`Add project`})]}),N&&(0,U.jsx)(`p`,{className:`banner`,children:N})]})]})}function Xm({view:e,project:t,projects:n,run:r,onOpen:i,onRemoved:a,onRenamed:o,onWorkflow:s,accounts:c,profiles:l,board:u,lockdownB:d}){let f=Hp(om),p=Op(Ep(e)??{project:t.name,group:null},f),m=dm(pm(t),(e,t)=>Sm(e,t).length>0),h=dm(Dn(u,t.name),(e,t)=>kn(t,e)>0),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(!1),[C,w]=(0,v.useState)(null);(0,v.useEffect)(()=>{B.profiles().then(w,()=>{})},[]),(0,v.useEffect)(()=>{if(!y)return;let e=setTimeout(()=>b(!1),3e3);return()=>clearTimeout(e)},[y]);let T=m.value,E=t.runner===`docker`,D=Bm(t.runner===`local`?t.path:void 0,T.workflowConfig,T.workflowName),O={value:T,onChange:e=>{m.set(e),b(!1)},defaults:{profiles:Tm(C,D?.on&&vm(T,E)&&(T.workflowName||D.workflows[0])||null)}},k=Sm(m.saved,T),A=kn(h.value,h.saved),j=k.length+A,M=new Set(k.map(e=>bm[e]));A&&M.add(`board`);let N=T.name.trim()!==t.name,P={safety:String(T.commandPatterns.length+T.pathPatterns.length),powers:T.lockdownLevel===`off`?``:`lockdown ${T.lockdownLevel}`,board:h.saved.enabled?``:`off`},F=()=>r(async()=>{_(!0);try{if(A&&(await jn(t.name,h.value),h.done(h.value)),k.length&&N){let e=(await B.renameProject(t.name,T.name.trim(),mm(T,t))).name;Gf(localStorage,t.name,e),o(p?Dp(e,p):`ps:${e}`);return}k.length&&m.done(pm(await B.updateProject(t.name,mm(T,t)))),b(!0)}finally{_(!1)}}),I=()=>{m.discard(),h.discard()},ee=(A?An(h.value):null)??(T.name.trim()?null:`The project needs a name.`);return(0,U.jsxs)(nm,{groups:wp,current:p,words:P,marked:M,narrow:f,onOpen:e=>i(e===null?`ps:${t.name}`:Dp(t.name,e)),foot:(0,U.jsx)(im,{count:j,saved:y,busy:g,note:N?`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:ee,onSave:()=>void F(),onDiscard:I}),children:[p===`general`&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`General`}),(0,U.jsx)(`p`,{className:`muted mono tab-where`,children:t.where}),(0,U.jsxs)(`div`,{className:`form`,children:[(0,U.jsx)(Am,{...O}),(0,U.jsx)(jm,{...O,accounts:c,container:E}),(0,U.jsx)(Mm,{...O}),(0,U.jsx)(Nm,{...O}),!E&&(0,U.jsx)(Pm,{...O}),(0,U.jsx)($,{value:T,onChange:O.onChange})]})]}),p===`safety`&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`What always goes to you`}),(0,U.jsx)(`div`,{className:`safety`,children:(0,U.jsx)(Gm,{value:T,onChange:O.onChange,heading:!1})})]}),p===`powers`&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Manager's powers`}),(0,U.jsxs)(`div`,{className:`form`,children:[(0,U.jsx)(Fm,{...O}),(0,U.jsx)(Im,{...O}),(0,U.jsx)(Lm,{...O}),(0,U.jsx)(qm,{value:T,onChange:O.onChange,levelB:d,container:E})]})]}),p===`skills`&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Skills & profiles`}),(0,U.jsxs)(`div`,{className:`form`,children:[(0,U.jsx)(zm,{...O,project:t.name}),(0,U.jsx)(Rm,{...O,role:`manager`,profiles:l}),(0,U.jsx)(Rm,{...O,role:`session`,profiles:l})]})]}),p===`look`&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Look`}),(0,U.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,U.jsx)(hp,{project:t,run:r})]}),p===`workflow`&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Workflow`}),(0,U.jsx)(`p`,{children:(0,U.jsx)(`button`,{className:`small`,title:`The project's process as a diagram, to see and edit (issue #310)`,onClick:s,children:`Show the drawn workflow`})}),D?.workflows.length?(0,U.jsx)(`div`,{className:`form`,children:(0,U.jsx)(Hm,{...O,workflow:D,container:E})}):(0,U.jsxs)(`p`,{children:[(0,U.jsx)(`span`,{className:`field-name`,children:`Workflow`}),`: `,(0,U.jsx)(`span`,{className:`muted`,children:D?`none is configured in Ledung's config ("workflow" or "workflows").`:`looking…`})]}),t.runner===`local`&&(0,U.jsx)(Vm,{check:D,settings:T,container:!1})]}),p===`tickets`&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Tickets & questions`}),(0,U.jsxs)(`div`,{className:`form`,children:[(0,U.jsx)(Um,{...O}),(0,U.jsx)(Wm,{...O})]})]}),p===`board`&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Message board`}),(0,U.jsx)(Mn,{board:u,project:t.name,projects:n,form:h.value,onChange:e=>{h.set(e),b(!1)}})]}),p===`remove`&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Remove project`}),(0,U.jsx)(`p`,{className:`muted`,children:`Takes the project off the list and stops its sessions. Their history stays, and the folder is not touched.`}),x?(0,U.jsxs)(`span`,{className:`restart-confirm`,children:[(0,U.jsxs)(`button`,{className:`small primary`,onClick:()=>void r(async()=>{await B.removeProject(t.name),a()}),children:[`Remove `,t.name]}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>S(!1),children:`Cancel`})]}):(0,U.jsx)(`button`,{onClick:()=>S(!0),children:`Remove project…`})]})]})}function Zm({project:e,run:t,onStarted:n}){let r=H(),[i,a]=(0,v.useState)(``);return(0,U.jsx)(tp,{level:Yf(e),fill:!0,children:(0,U.jsxs)(`div`,{className:`page-view`,children:[(0,U.jsx)(`header`,{className:`session-head`,children:(0,U.jsxs)(`div`,{className:`session-head-text`,children:[(0,U.jsx)(`h2`,{children:e.name}),(0,U.jsx)(`div`,{className:`muted mono`,children:e.where})]})}),(0,U.jsxs)(`div`,{className:`page-body`,children:[(0,U.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,U.jsxs)(`div`,{className:`composer`,children:[(0,U.jsx)(`textarea`,{...r,rows:4,value:i,onChange:e=>a(e.target.value),placeholder:`Message the manager of ${e.name}`}),(0,U.jsx)(`button`,{className:`primary`,disabled:!i.trim(),onClick:()=>void t(async()=>n((await B.messageManager(e.name,i)).id)),children:`Start manager`})]})]})]})})}var Qm={default:`Ask`,acceptEdits:`Accept edits`,auto:`Auto`,plan:`Plan`};function $m({chats:e,profiles:t,run:n,onStarted:r}){let i=H(),[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 B.startChat({...a?{folder:a}:{},...l.trim()?{model:l.trim()}:{},...d?{profile:d}:{},...p?{permissionMode:p}:{}})).id)}finally{g(!1)}});return(0,U.jsxs)(`div`,{className:`page-view`,children:[(0,U.jsx)(`header`,{className:`session-head`,children:(0,U.jsxs)(`div`,{className:`session-head-text`,children:[(0,U.jsx)(`h2`,{children:`New chat`}),(0,U.jsx)(`div`,{className:`muted`,children:`A Claude Code session of your own, with no project, workflow or manager. It asks you directly.`})]})}),(0,U.jsxs)(`div`,{className:`page-body`,children:[(0,U.jsxs)(`div`,{className:`form`,children:[s?(0,U.jsx)(Jm,{load:B.browse,reloadKey:`chat`,start:_||void 0,onPick:e=>{o(e),c(!1)},pickLabel:`Chat in this folder`}):(0,U.jsxs)(`p`,{children:[`Folder: `,(0,U.jsx)(`span`,{className:`mono`,children:_||`…`}),` `,(0,U.jsx)(`button`,{className:`small`,onClick:()=>c(!0),children:`Change`})]}),(0,U.jsxs)(`label`,{children:[`Model `,(0,U.jsx)(`span`,{className:`muted`,children:`(empty: Claude Code's own default)`}),(0,U.jsx)(`input`,{...i,value:l,onChange:e=>u(e.target.value),placeholder:`opus, sonnet, haiku or a full model name`})]}),t.length>1&&(0,U.jsxs)(`label`,{children:[`Profile `,(0,U.jsx)(`span`,{className:`muted`,children:`(what it gets of your own plugins, MCP servers and tools)`}),(0,U.jsxs)(`select`,{value:d,onChange:e=>f(e.target.value),children:[(0,U.jsx)(`option`,{value:``,children:`full: your whole setup`}),t.filter(e=>e!==`full`).map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))]})]}),(0,U.jsxs)(`label`,{children:[`Permission mode `,(0,U.jsx)(`span`,{className:`muted`,children:`(changeable in the chat; what always goes to you is asked in every mode)`}),(0,U.jsx)(`select`,{value:y,onChange:e=>m(e.target.value),children:b.map(e=>(0,U.jsx)(`option`,{value:e,children:Qm[e]},e))})]})]}),(0,U.jsx)(`button`,{className:`primary`,disabled:h||s||!e,onClick:()=>void x(),children:h?`Starting…`:`Start chat`})]})]})}function eh({view:e,chats:t,run:n,onOpen:r}){let i=Hp(om),a=Op(Ep(e)??{project:null,group:null},i),o=dm({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,U.jsx)(`div`,{className:`page-body`,children:(0,U.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 B.updateChats({...o.value,mcpTools:t.sensitive.mcpTools})).sensitive;o.done({commandPatterns:e.commandPatterns,pathPatterns:e.pathPatterns}),u(!0)}finally{c(!1)}});return(0,U.jsxs)(nm,{groups:Tp,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`:Dp(null,e)),foot:(0,U.jsx)(im,{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,U.jsxs)(`section`,{children:[(0,U.jsxs)(`div`,{className:`settings-h`,children:[(0,U.jsx)(`h3`,{children:`General`}),(0,U.jsx)(tm,{kind:`config`})]}),(0,U.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,U.jsxs)(`p`,{children:[(0,U.jsx)(`span`,{className:`field-name`,children:`Folder`}),`: `,(0,U.jsx)(`span`,{className:`mono`,children:t.folder})]}),(0,U.jsxs)(`p`,{children:[(0,U.jsx)(`span`,{className:`field-name`,children:`Permission mode`}),`: `,Qm[t.permissionMode]]})]}),a===`safety`&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`What always goes to you`}),(0,U.jsxs)(`div`,{className:`safety`,children:[(0,U.jsx)(Gm,{value:o.value,onChange:e=>{o.set(e),u(!1)},heading:!1}),f.length>0&&(0,U.jsxs)(`p`,{className:`muted`,children:[`Also always asked, from Ledung's config: `,f.map((e,t)=>(0,U.jsxs)(v.Fragment,{children:[t?`, `:``,(0,U.jsx)(`code`,{children:e})]},e)),`.`]})]})]}),a===`look`&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Look`}),(0,U.jsx)(`p`,{className:`muted`,children:`The chats' names in the sidebar and their headers. Saved at once, for every browser.`}),(0,U.jsx)(gp,{colour:t.colour,run:n})]})]})}function th(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 nh(e){let t=e.trimStart();return t.startsWith(`!`)&&t.slice(1).trim()||null}function rh(e){return`This matches ${e.replace(/^command matches /,``)}; run it?`}function ih(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 ah(e){return e===`mcp__ledung__ask_user`}var oh=200;function sh(e){let t=e.trim();return t.length>0&&t.length<=oh&&!t.includes("```")&&!/\n\s*\n/.test(t)&&!/^\s*([-*+•]|\d+[.)])\s/m.test(t)}function ch(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=ah(e.name)?t:-1,r=[]):e.kind===`text`&&!e.sub&&n>=0&&sh(e.text)&&r.push(t)}),i(),t}function lh(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 uh(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 dh(e){let t=Number(e?.ledung_cut?.chars??0);return Number.isFinite(t)&&t>0?t:0}var fh=(e=>`Ledung has delivered messages for you. They are attached as context and are not from ${e}.`)(``).slice(0,-1);function ph(e){let t=e.split(`
65
+
66
+ `),n=t.at(-1);return!n.startsWith(fh)||!n.endsWith(`.`)||n.includes(`
67
+ `)?e:t.slice(0,-1).join(`
68
+
69
+ `)}var mh=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 mh{};function hh(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 gh(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 _h(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 vh(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 yh(e,t){return _h(e,t,``)}function bh(e,t){return vh(e,t,``)}function xh(e,t){return t.slice(0,Sh(e,t))}function Sh(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 Ch(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 wh(e,t){if(t)return Eh(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function Th(e,t){if(t)return Eh(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function Eh(e,t){if(!t)return[Th(e),wh(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=Ch(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var Dh=`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}`,Oh=RegExp(`[${Dh}]+|\\s+|[^${Dh}]`,`ug`);new class extends mh{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=Ch(e,r)}else n=e.match(Oh)||[];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)&&kh(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&kh(n,i,r,null,t.intlSegmenter),e}};function kh(e,t,n,r,i){if(t&&n){let[a,o]=Eh(t.value,i),[s,c]=Eh(n.value,i);if(e){let r=hh(a,s);e.value=vh(e.value,s,r),t.value=yh(t.value,r),n.value=yh(n.value,r)}if(r){let e=gh(o,c);r.value=_h(r.value,c,e),t.value=bh(t.value,e),n.value=bh(n.value,e)}}else if(n){if(e){let e=Th(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=Th(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=Th(r.value,i),[a,o]=Eh(t.value,i),s=hh(n,a);t.value=yh(t.value,s);let c=gh(yh(n,s),o);t.value=bh(t.value,c),r.value=_h(r.value,n,c),e.value=vh(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=Th(r.value,i),n=xh(wh(t.value,i),e);t.value=bh(t.value,n)}else if(e){let n=xh(wh(e.value,i),Th(t.value,i));t.value=yh(t.value,n)}}new class extends mh{tokenize(e){let t=RegExp(`(\\r?\\n)|[${Dh}]+|[^\\S\\n\\r]+|[^${Dh}]`,`ug`);return e.match(t)||[]}};var Ah=new class extends mh{constructor(){super(...arguments),this.tokenize=Mh}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
70
+ `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
71
+ `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
72
+ `)&&(e=e.slice(0,-1)),t.endsWith(`
73
+ `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function jh(e,t,n){return Ah.diff(e,t,n)}function Mh(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
74
+ `));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 Nh(e){return e==`.`||e==`!`||e==`?`}new class extends mh{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(Nh(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 mh{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends mh{constructor(){super(...arguments),this.tokenize=Mh}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(Ph(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 Ph(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]=Ph(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]=Ph(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends mh{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Fh({before:e,after:t}){let n=jh(e,t);return(0,U.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(`
75
+ `);return(0,U.jsxs)(`span`,{className:n,children:[i.map(e=>`${r} ${e}`).join(`
76
+ `),`
77
+ `]},t)})})}function Ih({text:e}){return(0,U.jsxs)(`div`,{className:`code-block`,children:[(0,U.jsx)(kf,{text:e}),(0,U.jsx)(`pre`,{children:(0,U.jsx)(`code`,{children:e})})]})}function Lh(e){return typeof e.file_path==`string`?e.file_path:typeof e.path==`string`?e.path:null}function Rh(e,t){return e===`Bash`&&typeof t.command==`string`?t.command.split(`
78
+ `)[0]:Lh(t)||(typeof t.pattern==`string`?t.pattern:typeof t.url==`string`?t.url:typeof t.description==`string`?t.description:``)}function zh({toolName:e,input:t}){let n=Lh(t);switch(e){case`Bash`:return(0,U.jsxs)(U.Fragment,{children:[t.description&&(0,U.jsx)(`p`,{className:`muted`,children:t.description}),(0,U.jsx)(Ih,{text:String(t.command??``)}),t.run_in_background&&(0,U.jsx)(`p`,{className:`muted`,children:`Runs in the background.`})]});case`Edit`:return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`path`,children:[n,t.replace_all?` (every occurrence)`:``]}),(0,U.jsx)(Fh,{before:String(t.old_string??``),after:String(t.new_string??``)})]});case`MultiEdit`:return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{className:`path`,children:n}),(t.edits??[]).map((e,t)=>(0,U.jsx)(Fh,{before:String(e.old_string??``),after:String(e.new_string??``)},t))]});case`Write`:return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`path`,children:[n,` (whole file)`]}),(0,U.jsx)(Fh,{before:``,after:String(t.content??``)})]});case`NotebookEdit`:return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{className:`path`,children:t.notebook_path}),(0,U.jsx)(Ih,{text:String(t.new_source??``)})]});default:return(0,U.jsx)(Ih,{text:JSON.stringify(t,null,2)})}}function Bh({permission:e,managerTitle:t}){return e.toolName===`AskUserQuestion`?(0,U.jsx)(Hh,{permission:e}):(0,U.jsx)(Vh,{permission:e,managerTitle:t})}function Vh({permission:e,managerTitle:t}){let n=H(),[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 B.decide(e.id,{behavior:t,scope:n,message:t===`deny`?r:void 0})}catch(e){u(e.message),c(!1)}};return(0,U.jsxs)(`div`,{className:`card permission`,children:[(0,U.jsxs)(`div`,{className:`card-head`,children:[(0,U.jsxs)(`strong`,{children:[`Permission: `,e.toolName]}),e.title&&(0,U.jsxs)(`span`,{className:`muted`,children:[` · `,e.title]}),e.addressedTo!==`user`&&(0,U.jsxs)(`span`,{className:`muted`,children:[` · `,e.sensitive?`with`:`for`,` manager "`,t??`manager`,`"`,e.sensitive?``:` to decide`]})]}),e.sensitive&&(0,U.jsxs)(`p`,{className:`sensitive-note`,children:[(0,U.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,U.jsxs)(`span`,{className:`muted`,children:[`(`,e.sensitive,`)`]})]}),e.uac&&(0,U.jsxs)(`p`,{className:`sensitive-note`,children:[(0,U.jsx)(`strong`,{children:`Administrator`}),`: `,`This raises a UAC prompt on the PC's desktop; allow it only when you are at the PC.`,` `,(0,U.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,U.jsx)(`p`,{className:`muted`,children:e.reason}),(0,U.jsx)(zh,{toolName:e.toolName,input:e.input}),r&&(0,U.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,U.jsxs)(`div`,{className:`actions`,children:[(0,U.jsx)(`button`,{className:`allow`,disabled:s,onClick:()=>d(`allow`),children:`Allow once`}),!e.sensitive&&(0,U.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,U.jsx)(`button`,{className:`deny`,disabled:s,onClick:()=>d(`deny`),children:`Deny`}):(0,U.jsx)(`button`,{className:`deny`,disabled:s,onClick:()=>i(!0),children:`Deny…`}),e.uac&&(0,U.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,U.jsx)(`p`,{className:`error`,children:l})]})}function Hh({permission:e}){let t=H(),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 B.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,U.jsxs)(`div`,{className:`card question`,children:[n.map(e=>(0,U.jsxs)(`fieldset`,{children:[(0,U.jsxs)(`legend`,{children:[e.header&&(0,U.jsx)(`span`,{className:`chip`,children:e.header}),` `,e.question]}),e.options.map(t=>{let n=(r[e.question]??[]).includes(t.label);return(0,U.jsxs)(`button`,{type:`button`,className:`option${n?` on`:``}`,onClick:()=>d(e,t.label),children:[(0,U.jsx)(`strong`,{children:t.label}),t.description&&(0,U.jsxs)(`span`,{className:`muted`,children:[` `,t.description]})]},t.label)}),(0,U.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,U.jsxs)(`div`,{className:`actions`,children:[(0,U.jsx)(`button`,{className:`allow`,disabled:s||!p,onClick:()=>m(`allow`),children:`Answer`}),(0,U.jsx)(`button`,{className:`deny`,disabled:s,onClick:()=>m(`deny`),children:`Decline`})]}),l&&(0,U.jsx)(`p`,{className:`error`,children:l})]})}var Uh=[`pass`,`fail`,`unsure`],Wh={pass:`Pass`,fail:`Fail`,unsure:`Unsure`},Gh={pass:`looks right`,fail:`looks off`,unsure:`can't tell`},Kh=e=>e.replace(/\s+/g,` `).trim();function qh(e,t,n=``){let r=e=>t[e]?.verdict??null,i=Uh.map(t=>[Wh[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=Kh(t[n]?.note??``);return`- ${Kh(e.group)} · ${Kh(e.path)}: ${i?Wh[i]:`no verdict`}${a?` — ${a}`:``}`}),s=n.trim();return[`Screenshot verdicts: ${i.join(` · `)}`,...o,...s?[``,s]:[]].join(`
79
+ `)}var Jh=e=>e===`waiting`||!!e?.startsWith(`q:`);function Yh(e,t,n){return Jh(n)?Jh(e)?{depth:t.depth+1,root:t.root}:{depth:1,root:!1}:{depth:0,root:!1}}function Xh(e){return e>0?{back:1}:{queue:!0}}function Zh(e,t,n,r,i){if(r===i)return{verdict:null,to:n};let a=Qh(e,t,n+1);return{verdict:i,to:a>=0&&a!==n?a:Math.min(n+1,e.length-1)}}function Qh(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 $h(e,t,n,r){let i=e.filter(e=>!t(e)).length;return i?n===null?{send:!1,to:Qh(e,t,0),missing:i}:r-n<500?{send:!1,tooSoon:!0}:{send:!0}:{send:!0}}var eg=e=>(e.ctrlKey||e.metaKey)&&e.key===`Enter`,tg=e=>eg(e)&&!e.repeat,ng=new Map,rg=(e,t)=>({judged:{},note:``,paths:e.map(e=>e.path),project:t,carried:{},touched:{}});function ig(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 ag=e=>[...new Set(Object.values(e.carried))].sort((e,t)=>e-t),og=e=>Object.values(e.judged).filter(e=>e.verdict).length,sg=(e,t)=>e>0&&t>0&&e<=t*.6,cg=()=>typeof matchMedia==`function`&&matchMedia(`(pointer: coarse)`).matches;function lg({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,U.jsxs)(`div`,{className:`withdraw-row asking`,role:`group`,"aria-label":`Withdraw the question`,children:[(0,U.jsx)(`span`,{children:`Withdraw it for the asker? It leaves the queue.`}),(0,U.jsx)(`button`,{className:`small deny`,disabled:e,onClick:t,children:`Yes, withdraw`}),(0,U.jsx)(`button`,{ref:i,className:`small`,disabled:e,onClick:()=>r(!1),children:`Keep it`})]}):(0,U.jsx)(`div`,{className:`withdraw-row`,children:(0,U.jsx)(`button`,{className:`small`,disabled:e,title:`Withdraw it for the asker; it leaves the queue`,onClick:()=>r(!0),children:`Withdraw…`})})}var ug=`ledung-shots-order`;function dg(e){let t=e.opinions.find(e=>e.verdict)?.verdict;return t===`fail`?0:t===`unsure`?1:t===`pass`?3:2}function fg(e){let t=H(),n=e.question,r=n.status===`open`,i=t=>r?ig(n.id,t,ng,t=>e.withdrawnIds.includes(t)):t,[a,o]=(0,v.useState)(()=>{let t=i(ng.get(n.id)??rg(n.shots,e.session.project));return ng.set(n.id,t),t}),[s,c]=(0,v.useState)(()=>{try{return localStorage.getItem(ug)===`off-first`}catch{return!1}}),l=(0,v.useMemo)(()=>{let e=n.shots.map((e,t)=>t);return s?e.sort((e,t)=>dg(n.shots[e])-dg(n.shots[t])||e-t):e},[n.shots,s]),[u,d]=(0,v.useState)(()=>{let e=$h(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=>{ng.set(n.id,e),o(e),b(null)},C=e.withdrawnIds.join(`,`);(0,v.useEffect)(()=>{let e=ng.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),A=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)},j=e=>{if(!r)return;let{verdict:t,to:n}=Zh(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)},M=e=>x({...a,judged:{...a.judged,[T]:{verdict:D?.verdict??null,note:e}}}),N=()=>{let e=!s;try{localStorage.setItem(ug,e?`off-first`:`as-taken`)}catch{}c(e);let t=n.shots.map((e,t)=>t),r=e?t.sort((e,t)=>dg(n.shots[e])-dg(n.shots[t])||e-t):t;d(Math.max(0,r.indexOf(T)))},P=async t=>{h(!0),_(null);try{await t(),ng.delete(n.id),e.onDone?.()}catch(e){_(e.message)}finally{h(!1)}},F=()=>{if(m)return;if(!O)return _(`Judge at least one shot first.`);let e=$h(l,e=>a.judged[e]?.verdict,y,Date.now());`tooSoon`in e||(`to`in e?(b(Date.now()),_(null),k(e.to)):P(()=>B.answerQuestion(n.id,qh(n.shots,a.judged,a.note))))},I=n.shots.length-O,ee=y!==null&&I>0,te=ag(a),ne=a.carried[T];(0,v.useEffect)(()=>{let t=t=>{let n=/^(TEXTAREA|INPUT|SELECT)$/.test(document.activeElement?.tagName??``);if(eg(t)&&r){t.preventDefault(),tg(t)&&F();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`)A(1);else if(i===`ArrowUp`)A(-1);else if(i===`1`||i===`2`||i===`3`)j(Uh[Number(i)-1]);else if((i===`n`||i===`N`)&&r)p(e=>e+1);else if(i===`o`||i===`O`)N();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 re=(0,v.useRef)(null),ie=(0,v.useRef)(null),ae=(0,v.useRef)(null),[oe,se]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=re.current,t=ie.current;if(!e||!t)return;let n=new ResizeObserver(()=>{let n=getComputedStyle(t);se(sg(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=ie.current,t=ae.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 ce=[];l.forEach((e,t)=>{let r=n.shots[e].group;ce.at(-1)?.name===r?ce.at(-1).items.push(t):ce.push({name:r,items:[t]})});let le=(0,U.jsxs)(U.Fragment,{children:[ne!==void 0&&(0,U.jsxs)(`p`,{className:`carried-hint`,children:[`Carried over from #`,ne,`, withdrawn: check it still holds for this picture.`]}),(0,U.jsx)(`div`,{className:`vbtns`,children:Uh.map((e,t)=>(0,U.jsxs)(`button`,{className:`${e}${D?.verdict===e?` on`:``}`,"aria-pressed":D?.verdict===e,onClick:()=>j(e),children:[Wh[e],(0,U.jsx)(`kbd`,{children:t+1})]},e))})]});return(0,U.jsxs)(`div`,{className:`shots${oe?` pin`:``}`,ref:re,children:[(0,U.jsxs)(`div`,{className:`shot-main`,children:[(0,U.jsxs)(`div`,{className:`shot-top`,ref:ie,children:[(0,U.jsxs)(`div`,{className:`stage`,children:[(0,U.jsx)(Df,{sessionId:n.sessionId,path:E.path,alt:`${E.group} ${E.path}`},`${n.id}:${T}`),l.length>1&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{className:`nav l`,onClick:()=>k(w-1),"aria-label":`Previous screenshot`,children:`‹`}),(0,U.jsx)(`button`,{className:`nav r`,onClick:()=>k(w+1),"aria-label":`Next screenshot`,children:`›`})]})]}),r&&(0,U.jsx)(`div`,{className:`shot-vbar`,role:`group`,"aria-label":`Your verdict`,children:le})]}),(0,U.jsx)(`nav`,{className:`strip`,"aria-label":`Screenshots`,children:ce.map(e=>(0,U.jsxs)(`div`,{className:`sgrp`,children:[(0,U.jsxs)(`span`,{children:[e.name,` · `,e.items.filter(e=>a.judged[l[e]]?.verdict).length,`/`,e.items.length]}),(0,U.jsx)(`div`,{children:e.items.map(t=>{let r=l[t],i=a.judged[r];return(0,U.jsxs)(`button`,{className:`thumb`,"aria-current":t===w,"aria-label":`${e.name} ${n.shots[r].path}`,onClick:()=>k(t),children:[(0,U.jsx)(`img`,{src:Ef(n.sessionId,n.shots[r].path),alt:``}),(0,U.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,U.jsxs)(`aside`,{className:`slip`,"aria-live":`polite`,children:[(0,U.jsxs)(`div`,{className:`meta`,children:[(0,U.jsxs)(`strong`,{children:[`Question #`,n.id]}),(0,U.jsx)(`span`,{className:`chip`,children:S(e.session.project)}),(0,U.jsx)(`span`,{className:`muted`,children:Og(n.askedAt)}),(0,U.jsx)(`button`,{className:`link slip-session`,onClick:e.session.onOpen,children:e.session.title})]}),(0,U.jsxs)(`div`,{className:`slip-question`,children:[(0,U.jsx)(`strong`,{className:`slip-title`,children:e.title}),e.refersTo,(0,U.jsx)(`div`,{className:`question-text prose`,children:(0,U.jsx)(Nf,{text:e.issue||n.question,sessionId:n.sessionId})}),e.evidence&&(0,U.jsxs)(`div`,{className:`sblk`,children:[(0,U.jsx)(`span`,{className:`lbl`,children:`Evidence`}),(0,U.jsx)(`div`,{className:`question-text prose`,children:(0,U.jsx)(Nf,{text:e.evidence,sessionId:n.sessionId})})]}),!!e.options?.length&&(0,U.jsxs)(`div`,{className:`sblk`,children:[(0,U.jsx)(`span`,{className:`lbl`,children:`Options`}),(0,U.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,U.jsxs)(`li`,{children:[(0,U.jsx)(`strong`,{children:t.label.replace(/\*\*/g,``)}),t.detail&&(0,U.jsx)(`div`,{className:`prose`,children:(0,U.jsx)(Nf,{text:t.detail,sessionId:n.sessionId})}),t.cost&&(0,U.jsxs)(`div`,{className:`muted`,children:[(0,U.jsx)(`b`,{children:`Cost`}),` · `,t.cost]}),r.length>0&&(0,U.jsxs)(`div`,{className:`picked-by`,children:[(0,U.jsx)(`b`,{children:`Picked by`}),` `,r.join(`, `)]})]},t.key)})}),(0,U.jsx)(`span`,{className:`muted hint`,children:`Your verdicts on the shots are the answer.`})]})]}),(0,U.jsx)(`h3`,{ref:ae,children:E.group}),(0,U.jsxs)(`div`,{className:`meta`,children:[(0,U.jsxs)(`span`,{className:`chip`,children:[w+1,` / `,l.length]}),E.facts.map(e=>(0,U.jsx)(`span`,{className:`chip`,children:e},e)),(0,U.jsx)(`span`,{className:`chip mono`,children:E.path})]}),(0,U.jsxs)(`div`,{className:`sblk`,children:[(0,U.jsx)(`span`,{className:`lbl`,children:`Look for`}),(0,U.jsx)(`p`,{children:E.lookFor})]}),E.doneWhen&&(0,U.jsxs)(`div`,{className:`sblk`,children:[(0,U.jsx)(`span`,{className:`lbl`,children:`Judge against (the done-condition)`}),(0,U.jsx)(`p`,{children:E.doneWhen})]}),E.opinions.length>0&&(0,U.jsxs)(`div`,{className:`sblk`,children:[(0,U.jsx)(`span`,{className:`lbl`,children:`What the others thought`}),E.opinions.map((e,t)=>(0,U.jsxs)(`div`,{className:`op${e.verdict?` ${e.verdict}`:``}`,children:[(0,U.jsx)(`small`,{children:e.who}),e.verdict&&(0,U.jsx)(`strong`,{className:e.verdict,children:Gh[e.verdict]}),(0,U.jsx)(`p`,{children:e.text})]},t))]}),r?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`sblk slip-verdict`,children:[(0,U.jsx)(`span`,{className:`lbl`,children:`Your verdict`}),le]}),(0,U.jsxs)(`div`,{className:`sblk`,children:[(0,U.jsx)(`label`,{className:`lbl`,htmlFor:`shot-note`,children:`Note on this shot`}),(0,U.jsx)(pg,{value:D?.note??``,focus:f,onChange:M},`${n.id}:${T}`)]}),(0,U.jsxs)(`div`,{className:`send-blk`,children:[(0,U.jsxs)(`div`,{className:I?`shot-count missing`:`muted`,children:[O,` of `,n.shots.length,` judged`,I>0&&` · ${I} without a verdict`]}),te.length>0&&(0,U.jsxs)(`p`,{className:`muted`,children:[Object.keys(a.carried).length,` verdict`,Object.keys(a.carried).length===1?``:`s`,` carried over from `,te.map(e=>`#${e}`).join(`, `),`, withdrawn while you judged `,te.length===1?`it`:`them`,`; ringed on the strip until you judge `,Object.keys(a.carried).length===1?`it`:`them`,` here.`]}),(0,U.jsx)(`label`,{className:`lbl`,htmlFor:`shot-answer-note`,children:`Note to the asker (optional)`}),(0,U.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,U.jsx)(`div`,{className:`actions`,children:(0,U.jsx)(`button`,{className:ee?`deny`:`allow`,disabled:m||!O,onClick:F,children:ee?`Send with ${I} without a verdict`:`Send verdicts`})}),ee&&I>0?(0,U.jsxs)(`p`,{className:`error`,children:[I===1?`1 shot has`:`${I} shots have`,` no verdict yet; this is the first. Give `,I===1?`it`:`them`,` one, or press "Send with `,I,` without a verdict" to send `,I===1?`it`:`them`,` as "no verdict".`]}):(0,U.jsxs)(`span`,{className:`muted hint`,children:[O>0&&I>0&&`Send shows the shots without a verdict first. `,(0,U.jsxs)(`span`,{className:`kbd-hint`,children:[(0,U.jsx)(`kbd`,{children:`Ctrl`}),`+`,(0,U.jsx)(`kbd`,{children:`Enter`}),` sends`]})]}),g&&(0,U.jsx)(`p`,{className:`error`,children:g}),(0,U.jsx)(lg,{busy:m,onWithdraw:()=>void P(()=>B.withdrawQuestion(n.id))})]})]}):(0,U.jsx)(`div`,{className:`send-blk`,children:n.status===`answered`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`span`,{className:`lbl`,children:[`Answer`,n.answeredBy===`user`?` from ${e.userName}`:``]}),(0,U.jsx)(`pre`,{className:`shot-answer`,children:n.answer}),(0,U.jsx)(`span`,{className:`muted`,children:n.deliveredAt?`delivered ${Og(n.deliveredAt)}`:`not delivered yet: it goes in as soon as the session is free`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`muted`,children:[`Withdrawn`,n.withdrawnReason?`: ${n.withdrawnReason}`:``]}),og(a)>0&&(0,U.jsxs)(`p`,{className:`error`,children:[`It was withdrawn while you judged it: your `,og(a),` verdict`,og(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,U.jsx)(`div`,{children:(0,U.jsx)(`button`,{className:`small${s?` on`:``}`,"aria-pressed":s,onClick:N,title:`Order (O)`,children:`Looks off first`})}),(0,U.jsxs)(`div`,{className:`keys`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`←`}),(0,U.jsx)(`kbd`,{children:`→`}),` shot`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`↑`}),(0,U.jsx)(`kbd`,{children:`↓`}),` issue`]}),r&&(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`1`}),(0,U.jsx)(`kbd`,{children:`2`}),(0,U.jsx)(`kbd`,{children:`3`}),` verdict, then next`]}),r&&(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`N`}),` note`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`O`}),` order`]}),e.onGoToConversation&&(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`C`}),` conversation`]}),e.onToggleSidebar&&(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`S`}),` sidebar`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`Esc`}),` queue`]})]})]})]})}function pg(e){let t=H(),[n,r]=(0,v.useState)(null),[i]=(0,v.useState)(e.focus);return(0,v.useEffect)(()=>{e.focus!==i&&n?.focus()},[e.focus]),(0,U.jsx)(`textarea`,{...t,id:`shot-note`,ref:r,className:`answer-box`,rows:2,placeholder:cg()?`Write here`:`N to write, Esc to leave`,value:e.value,onChange:t=>e.onChange(t.target.value)})}var mg=e=>e.shots?.length?`${e.shots.length} screenshot${e.shots.length===1?``:`s`}`:null;function hg(e){let t=H(),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:mg(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,U.jsx)(`button`,{className:`small`,onClick:e.onOpenInDesk,children:f}):(0,U.jsx)(`a`,{className:`button-link`,href:`#/waiting/q/${n.id}`,children:f})),m=n.shots?.length?(0,U.jsx)(`div`,{className:`chat-thumbs`,children:n.shots.map((e,t)=>(0,U.jsx)(`img`,{src:Ef(n.sessionId,e.path),alt:e.path,title:`${e.group} · ${e.path}`},t))}):null,h=(0,U.jsxs)(`div`,{className:`card-head`,children:[(0,U.jsxs)(`strong`,{children:[`Question #`,n.id]}),e.from&&(0,U.jsxs)(U.Fragment,{children:[` · from `,(0,U.jsx)(`strong`,{children:e.from})]}),e.session&&(0,U.jsxs)(U.Fragment,{children:[` · `,(0,U.jsx)(`button`,{className:`link`,onClick:e.session.onOpen,children:e.session.title}),(0,U.jsxs)(`span`,{className:`muted`,children:[` (`,S(e.session.project),`)`]})]}),(0,U.jsxs)(`span`,{className:`muted`,children:[` · `,Og(n.askedAt)]}),n.addressedTo!==`user`&&(0,U.jsxs)(`span`,{className:`muted`,children:[` · to manager "`,e.titleOf?.(n.addressedTo)??`manager`,`"`]}),n.aboutQuestion!==null&&(0,U.jsxs)(`span`,{className:`muted`,children:[` · about #`,n.aboutQuestion]}),d&&(0,U.jsxs)(U.Fragment,{children:[` `,(0,U.jsx)(`span`,{className:`chip shot-chip`,children:d})]}),u&&(0,U.jsxs)(U.Fragment,{children:[` `,(0,U.jsx)(`span`,{className:`chip review-chip`,children:`Review`})]})]}),g=u?(0,U.jsx)(`div`,{className:`question-text`,children:(0,U.jsx)(`strong`,{children:u.title})}):(0,U.jsx)(`div`,{className:`question-text`,children:(0,U.jsx)(Nf,{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,U.jsxs)(`div`,{id:`qc-${n.id}`,className:`card question-open${e.focus?` focus`:``}`,children:[h,g,m,n.aboutRequest&&(0,U.jsxs)(`p`,{className:`sensitive-note`,children:[(0,U.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,U.jsx)(`div`,{className:`question-options`,children:n.options.map(e=>(0,U.jsx)(`button`,{type:`button`,className:`option${r===e?` on`:``}`,onClick:()=>i(e),children:e},e))}),!p&&(0,U.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,U.jsxs)(`div`,{className:`actions`,children:[p||(0,U.jsx)(`button`,{className:`allow`,disabled:a||!r.trim(),onClick:()=>l(()=>B.answerQuestion(n.id,r)),children:`Answer`}),e.onOpenInDesk&&!p&&(0,U.jsx)(`button`,{className:`small`,title:`Open it in Waiting for you`,onClick:e.onOpenInDesk,children:`Open in Waiting for you`})]}),s&&(0,U.jsx)(`p`,{className:`error`,children:s}),(0,U.jsx)(lg,{busy:a,onWithdraw:()=>void l(()=>B.withdrawQuestion(n.id))})]}):(0,U.jsxs)(`div`,{id:`qc-${n.id}`,className:`card question-done ${n.status}${e.focus?` focus`:``}`,children:[h,g,m,n.status===`answered`?(0,U.jsxs)(`p`,{children:[(0,U.jsxs)(`strong`,{children:[_,`:`]}),` `,d||u?(0,U.jsxs)(`span`,{className:`shot-answer`,children:[`
80
+ `,n.answer]}):n.answer,(0,U.jsxs)(`span`,{className:`muted`,children:[` · `,n.deliveredAt?`delivered ${Og(n.deliveredAt)}`:`not delivered yet: it goes in as soon as the session is free`]})]}):(0,U.jsxs)(`p`,{className:`muted`,children:[`Withdrawn`,n.withdrawnReason?`: ${n.withdrawnReason}`:``]}),p&&(0,U.jsx)(`div`,{className:`actions`,children:p})]})}var gg=80;function _g(e,t,n){return n<=0?null:Math.max(0,e-t-n)}function vg(e){return e<gg}function yg(e,t,n,r){return Math.max(0,n-r-(e?0:t))}function bg(e){return e.addressedTo===`user`?e.sessionId:e.addressedTo}function xg(e,t=null){return t===null?`#/s/${e}`:`#/s/${e}/q/${t}`}function Sg(e){let t=e.match(/^#\/s\/([\w-]+)(?:\/q\/(\d+))?$/);return t?{sessionId:t[1],questionId:t[2]?Number(t[2]):null}:null}function Cg(e,t){return`#/s/${e}/m/${t}`}function wg(e){let t=e.match(/^#\/s\/([\w-]+)\/m\/(\d+)$/);return t?{sessionId:t[1],messageId:Number(t[2])}:null}function Tg(e,t,n){return e.filter(e=>e.sessionId!==t&&bg(e)===t&&(n===null||e.askedAt>=n)).sort((e,t)=>e.askedAt-t.askedAt||e.id-t.id)}function Eg(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 Dg(e,t,n){return t?[...e]:e.filter(e=>e.id===n)}function Og(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 kg(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>e?.type===`text`?e.text:e?.type===`image`?`[image]`:``).join(`
81
+ `):``}function Ag(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:kg(e.content),isError:!!e.is_error,cut:dh(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:`${lh(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=ch(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 jg(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 Mg={allowed:`Allowed`,denied:`Denied`,cancelled:`Withdrawn`},Ng=(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)(()=>Ag(t),[t]),c=e.focusQuestion??null,l=(0,v.useMemo)(()=>i?Dg(Tg(Object.values(e.questions),i,o),r,c):[],[e.questions,i,o,r,c]),u=(0,v.useMemo)(()=>Eg(s,l.map(e=>({key:`q${e.id}`,at:e.askedAt,type:`question`,questionId:e.id}))),[s,l]),d=(0,v.useMemo)(()=>jg(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=yg(p.current,y.current,e.scrollHeight,e.clientHeight))});return t.observe(e),()=>t.disconnect()},[]),(0,U.jsxs)(`div`,{className:`messages`,ref:f,onScroll:e=>{let t=e.currentTarget,n=_g(t.scrollHeight,t.scrollTop,t.clientHeight);n!==null&&(y.current=n,p.current=vg(n))},children:[e.hasEarlier&&(0,U.jsx)(`button`,{className:`load-earlier`,onClick:e.onLoadEarlier,children:`Load earlier messages`}),u.map(t=>(0,U.jsx)(Ig,{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 Pg(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`&&Pg(n[e],r[e]))}function Fg(e,t){let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>n===`item`||n===`decision`?Pg(e[n],t[n]):e[n]===t[n])}var Ig=(0,v.memo)(function(e){let{item:t,showTechnical:n,sessionId:r}=e,i=(0,U.jsx)(`time`,{className:`time`,children:Og(t.at)}),a=(n,r)=>e.onQuote&&(0,U.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?ph(t.text):t.text,o=r||t.context||``,s=Be(t.byLedung,r,t.context,n);return s&&!s.length?null:s?.some(e=>e.type===`board`)?(0,U.jsx)(`div`,{className:`board-delivery`,children:s.map((t,n)=>t.type===`board`?(0,U.jsx)(Rn,{mark:t.mark,time:i,onOpenThread:e.onOpenBoardThread},n):(0,U.jsxs)(`div`,{className:`msg delivery answer`,children:[(0,U.jsxs)(`div`,{className:`msg-meta`,children:[(0,U.jsx)(`span`,{className:`who`,children:`Delivered by Ledung`}),i]}),(0,U.jsx)(`div`,{className:`msg-body plain`,children:t.text})]},n))}):(0,U.jsxs)(`div`,{className:`msg ${r?`user`:`delivery`}${t.byLedung?` answer`:``}`,children:[(0,U.jsxs)(`div`,{className:`msg-meta`,children:[(0,U.jsx)(`span`,{className:`who`,children:t.byLedung?`Delivered by Ledung`:e.userName}),i,a(t.byLedung?`Ledung`:e.userName,o)]}),(0,U.jsx)(`div`,{className:`msg-body plain`,children:o}),t.context&&r&&(0,U.jsxs)(`details`,{className:`delivered-context`,children:[(0,U.jsxs)(`summary`,{children:[`Attached context (not from `,e.userName,`)`]}),(0,U.jsx)(`div`,{className:`plain`,children:t.context})]})]})}case`assistant`:return(t.sub||t.quiet)&&!n?null:(0,U.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,U.jsxs)(`div`,{className:`msg-meta`,children:[(0,U.jsx)(`span`,{className:`who`,children:t.sub?`Subagent`:`Claude`}),i,a(t.sub?`Subagent`:`Claude`,t.text)]}),(0,U.jsx)(`div`,{className:`msg-body`,children:(0,U.jsx)(Nf,{text:t.text,onOpenFile:e.onOpenFile})})]});case`event`:return(0,U.jsxs)(`div`,{className:`event`,children:[t.text,` `,i]});case`shell`:{let n=t.block,r=th(n);return(0,U.jsxs)(`div`,{className:`msg user shell`,children:[(0,U.jsxs)(`div`,{className:`msg-meta`,children:[(0,U.jsxs)(`span`,{className:`who`,children:[e.userName,` ran`]}),i]}),(0,U.jsxs)(`pre`,{className:`shell-output`,children:[(0,U.jsxs)(`span`,{className:`shell-command`,children:[`$ `,n.command]}),n.stdout?`
82
+ ${n.stdout.replace(/\s+$/,``)}`:``,n.stderr?(0,U.jsx)(`span`,{className:`shell-stderr`,children:`
83
+ ${n.stderr.replace(/\s+$/,``)}`}):null]}),(0,U.jsx)(`div`,{className:`shell-footer${r.problem?` problem`:``}`,children:r.text})]})}case`question`:{let t=e.question;return t?(0,U.jsx)(hg,{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,U.jsxs)(`div`,{className:`divider`,children:[(0,U.jsx)(`span`,{children:t.text}),` `,i]});case`note`:return t.technical&&!n?null:(0,U.jsxs)(`div`,{className:`note${t.technical?` technical`:``}`,children:[t.text,` `,i]});case`tool`:if(We(t.name)&&!t.sub){let n=Ge(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,U.jsxs)(`div`,{className:`board-delivery${t.result?.isError?` failed`:``}`,children:[(0,U.jsx)(Rn,{mark:r,time:i,onOpenThread:e.onOpenBoardThread}),t.result&&(0,U.jsx)(`div`,{className:`note board-result${t.result.isError?` failed`:``}`,children:t.result.text.slice(0,400)})]})}return n?(0,U.jsxs)(`details`,{className:`tool${t.result?.isError?` failed`:``}`,children:[(0,U.jsxs)(`summary`,{children:[(0,U.jsx)(`span`,{className:`tool-name`,children:t.name}),` `,(0,U.jsx)(`span`,{className:`tool-summary`,children:Rh(t.name,t.input)}),` `,i]}),(0,U.jsx)(`pre`,{className:`tool-input`,children:JSON.stringify(t.input,null,2)}),t.result&&(0,U.jsx)(`pre`,{className:`tool-result`,children:t.result.text.slice(0,2e4)}),t.result&&t.result.cut>0&&(0,U.jsx)(`div`,{className:`note technical tool-cut`,children:uh(t.result.cut)})]}):null;case`permission`:{let r=e.live;if(r?.status===`pending`)return(0,U.jsx)(Bh,{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?`${Mg[a.behavior]??a.behavior}${a.scope===`session`?` for this session`:``}${o}`:`Asked`;return(0,U.jsxs)(`div`,{className:`note decision ${a?.behavior??``}`,children:[s,`: `,t.toolName,` `,(0,U.jsx)(`span`,{className:`tool-summary`,children:Rh(t.toolName,t.input)}),a?.message&&a.behavior===`denied`?` (“${a.message}”)`:``,` `,i]})}}},Fg),Lg=`~-~~^~-~~~^-~~-~^~~-~^~-~~`,Rg=[` |\\ `,` |_\\ `,`\\____/`],zg=[``,` |\\ `,`\\__/`],Bg=[``,` /| `,`\\__/`],Vg=[` |\\ `,` /|_\\`,` \\__/`],Hg=[` | `,` /|\\ `,` \\_/ `],Ug=[` | `,` /|\\ `,` /_|_\\ `,` \\___/ `];function Wg(e,t){let n=e.width,r=Array.from({length:4},()=>Array(n).fill(` `));r[3]=Array.from({length:n},(e,n)=>Lg[(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(`
84
+ `)}var Gg=e=>({[e-1]:`=`,[e-2]:`=`}),Kg=(e,t)=>Array(e).fill(t);function qg(e){let t=Math.round((e-6)/2)-1,n={width:e,sprites:[{rows:Ug,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:Hg,x:r,y:1,overWater:!0},{rows:Hg,x:i,y:1,overWater:!0},...n.sprites]},sideAt:t=>({width:e,sprites:[{rows:Rg,x:t}],water:Gg(t)})}}function Jg(e){return e?.sprites?.at(-1)?.x??-6}function Yg(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 Xg(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:zg,x:e-t})),{rows:Rg,x:e}],water:{...t,...Gg(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 Zg(e,t,n=20){let r=qg(n),i=r.stop,a=[...Yg(r,e),...Kg(3,{width:n,sprites:[{rows:Vg,x:i}]}),...Kg(3,{width:n,sprites:[{rows:Hg,x:i}]}),...Kg(4,{width:n,sprites:[{rows:Hg,x:i}],water:{[i+1]:`(`,[i+5]:`)`}}),...Kg(4,{...r.near,water:{[i]:`(`,[i+7]:`)`}})];if(t===`fleet`)return Qg(r,a);let o=a.length;return a.push(...$g(r,t)),{scenes:a,loopFrom:o}}function Qg(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:zg,x:i},{rows:Bg,x:a},...r],water:{[i-1]:`-`,[a+4]:`-`}})}n.push(...Kg(3,{width:e.width,sprites:[e.gathered.sprites[0],{rows:Bg,x:e.right+1},...r]}));let i=n.length;return n.push(e.gathered),{scenes:n,loopFrom:i}}function $g(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:zg,x:t},...e.near.sprites],water:{[t-1]:`-`}});return n}function e_(e,t=20){return{scenes:$g(qg(t),e),loopFrom:0}}function t_(e=20){return Qg(qg(e))}function n_(e=0,t=20){let n=qg(t),r=n.stop,i=n.left-1,a=n.right+3,o=e=>[{rows:zg,x:i+e},{rows:zg,x:a+e}],s=[...Kg(3,{width:t,sprites:[n.gathered.sprites[0],n.gathered.sprites[1],{rows:Hg,x:r}],water:{[r+2]:`.`,[r+4]:`.`}}),...Kg(3,{width:t,sprites:[...o(0),{rows:Vg,x:r}]}),...Kg(2,{width:t,sprites:[...o(0),{rows:Rg,x:r}]})];for(let e=1;i+e<t;e++)s.push({width:t,sprites:[...o(e),{rows:Rg,x:r+e}],water:{[i+e-1]:`-`,[a+e-1]:`-`,...Gg(r+e)}});let c=s.length;return s.push(...Xg(-6,e,t).scenes),{scenes:s,loopFrom:c}}function r_(e=20){let t=n_(0,e),n=Zg(-6,`none`,e);return{scenes:[...t.scenes.slice(0,t.loopFrom),...n.scenes],loopFrom:t.loopFrom+n.loopFrom}}function i_(e=0,t=20){let n=qg(t).stop,r=[...Kg(3,{width:t,sprites:[{rows:Hg,x:n}],water:{[n+2]:`.`,[n+4]:`.`}}),...Kg(3,{width:t,sprites:[{rows:Vg,x:n}]}),...Kg(2,{width:t,sprites:[{rows:Rg,x:n}]})],i=r.length;return r.push(...Xg(n+1,e,t).scenes),{scenes:r,loopFrom:i}}function a_(e,t=20){let n=qg(t),r=n.stop+1,i=e=>({width:t,...e}),a=[...Yg(n,e,r),...Kg(3,i({sprites:[{rows:Rg,x:r,shear:[1,0,0]}]})),...Kg(3,i({sprites:[{rows:Rg,x:r,shear:[2,1,0]}],marks:[{x:r-1,y:2,ch:`~`},{x:r+6,y:2,ch:`~`}]})),...Kg(3,i({sprites:[{rows:Rg,x:r,y:1,shear:[2,1,0]}],water:{[r]:`*`,[r+6]:`*`}})),...Kg(3,i({sprites:[{rows:Rg,x:r,y:2,shear:[2,1,0]}],water:{[r+2]:`o`}})),...Kg(2,i({marks:[{x:r+3,y:2,ch:`o`}],water:{[r+3]:`.`}})),...Kg(2,i({marks:[{x:r+3,y:1,ch:`o`},{x:r+2,y:2,ch:`.`}]})),...Kg(2,i({marks:[{x:r+3,y:0,ch:`.`},{x:r+2,y:1,ch:`o`}]})),...Kg(2,i({marks:[{x:r+2,y:0,ch:`.`}]}))],o=a.length;return a.push(i({})),{scenes:a,loopFrom:o}}function o_(e=20){return{scenes:[{width:e}],loopFrom:0}}function s_(e=20){let t=qg(e),n=Math.max(t.left,0),r=[];for(let i=-4;i<=n;i++)r.push({width:e,sprites:[{rows:zg,x:i},...t.near.sprites],water:{[i-1]:`-`}});let i=r.length,a=r=>({width:e,sprites:[{rows:zg,x:n},...t.near.sprites],marks:r?[{x:n+1,y:0,ch:`.`}]:[]});return r.push(...Kg(3,a(!0)),...Kg(3,a(!1))),{scenes:r,loopFrom:i}}function c_(e=20){let t=qg(e),n=t.stop,r=Math.max(t.left,0),i={rows:zg,x:r},a=[...Kg(3,{width:e,sprites:[i,{rows:Hg,x:n}],water:{[n+2]:`.`,[n+4]:`.`}}),...Kg(3,{width:e,sprites:[i,{rows:Vg,x:n}]}),...Kg(2,{width:e,sprites:[i,{rows:Rg,x:n}]})];for(let t=n+1;t<e;t++)a.push({width:e,sprites:[i,{rows:Rg,x:t}],water:Gg(t)});for(let t=r+1;t<=n+1;t++)a.push({width:e,sprites:[{rows:zg,x:t}],water:{[t-1]:`-`}});a.push(...Kg(3,{width:e,sprites:[{rows:Hg,x:n}]}),...Kg(4,{width:e,sprites:[{rows:Hg,x:n}],water:{[n+1]:`(`,[n+5]:`)`}}));let o=a.length;return a.push(t.near),{scenes:a,loopFrom:o}}function l_(e=20){let t=qg(e),n=[];for(let r=Math.max(t.left,0)+1;r<e;r++)n.push({width:e,sprites:[{rows:zg,x:r},...t.near.sprites],water:{[r-1]:`-`}});let r=n.length;return n.push(t.near),{scenes:n,loopFrom:r}}var u_=[50,33,25,20,10],d_=[Rg,[` |\\ `,` |.\\ `,`\\____/`],[` |\\ `,` | \\ `,`\\_.__/`],[` | `,` |\\ `,`\\_.__/`],[` / `,` |\\ `,`\\_. _/`],[` , `,` /| `,`\\_. ./`],[` `,` , `,`\\_. /`]],f_=[zg,[``,` |\\ `,`\\_./`],[``,` |. `,`\\_./`],[``,` | `,`\\_./`],[``,` / `,`\\_./`],[``,` , `,`\\. /`],[``,` `,` ._,`]],p_=d_.length-1,m_={ship:{stages:d_,length:6},boat:{stages:f_,length:4}},h_=(e,t)=>e.map(e=>[...e.padEnd(t)].reverse().map(e=>e===`/`?`\\`:e===`\\`?`/`:e).join(``)),g_={ship:d_.map(e=>h_(e,6)),boat:f_.map(e=>h_(e,4))},__=[1,2,5,10,20,25],v_=(e,t=`ship`)=>__.find(n=>n>=50/(e-m_[t].length))??25;function y_(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=v_(t,n);return Math.floor(r/i)*i}var b_=e=>e<90?0:Math.min(p_,Math.floor((e-90)/2)+1),x_=(e,t,n=`ship`)=>Math.round(e/100*(t-m_[n].length)),S_=(e,t)=>({...e>=3?{[t-3]:`.`,[t-5]:`,`}:{},...e>=5?{[t-7]:`.`}:{},...e>=p_?{[t+1]:`o`,[t+5]:`o`,[t-9]:`,`}:{}}),C_=e=>Object.fromEntries(Array.from({length:Math.max(0,e)},(e,t)=>[t,`_`])),w_={0:[` _ `,`| |`,`|_|`],1:[` `,`|`,`|`],2:[` _ `,` _|`,`|_ `],3:[` _ `,` _|`,` _|`],4:[` `,`|_|`,` |`],5:[` _ `,`|_ `,` _|`],6:[` _ `,`|_ `,`|_|`],7:[` _ `,` |`,` |`],8:[` _ `,`|_|`,`|_|`],9:[` _ `,`|_|`,` _|`],"%":[` `,`o/ `,`/o `]},T_=e=>[0,1,2].map(t=>[...e].map(e=>w_[e]?.[t]??``).join(` `));function E_(e,t,n,r,i=`ship`){let a=T_(r),o=r===`100%`?`100%`:`00%`,s=[];return T_(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:m_[i].stages[t],x:n,shear:t===4&&i===`ship`?[1,0,0]:[]}],water:{...C_(n),...t>=p_?{}:Gg(n),...S_(t,n)},marks:s},number:s}}function D_(e,t,n,r=`ship`){let i=m_[r].length,a={...t>=p_?{}:{[n+i]:`=`,[n+i+1]:`=`},...t>=3?{[n+i+2]:`.`,[n+i+4]:`,`}:{}};return{width:e,sprites:[{rows:g_[r][t],x:n,shear:t===4&&r===`ship`?[-1,0,0]:[]}],water:{...C_(n),...a}}}function O_(e,t,n=`ship`){return{width:e,sprites:[{rows:m_[n].stages[0],x:t}],water:n===`ship`?Gg(t):{[t-1]:`-`}}}var k_=(e,t,n=96)=>Math.round((e-1)/(t-1)*(n-6)),A_=(e,t,n=96)=>k_(e,t,n)+3-1;function j_(e,t,n,r,i=96){let a=r?n===`right`?Gg(e):{[e+6]:`=`,[e+6+1]:`=`}:{};for(let e=1;e<=t;e++)a[A_(e,t,i)]=`o`;return{width:i,sprites:[{rows:n===`right`?Rg:g_.ship[0],x:e}],water:a}}var M_=180;function N_(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 P_=[7,6,5,4],F_=5,I_=e=>P_[(P_.indexOf(e)+1)%P_.length],L_=new Map;function R_(e,t){let n=L_.get(e);if(n)return n;let r=()=>{try{let n=Number(localStorage.getItem(e));return P_.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 L_.set(e,o),o}function z_(e,t){let n=R_(e,t),r=(0,v.useSyncExternalStore)(n.subscribe,n.get);return{size:r,next:I_(r),step:()=>n.set(I_(r))}}function B_(e,t,n,r,i){let a=Jg(n?.scenes[r]);if(t?.kind===`clearing`&&e.kind!==`clearing`&&e.kind!==`sunk`)return e.clearedAt!=null&&e.clearedAt!==t.clearedAt?c_(i):l_(i);switch(e.kind){case`clearing`:return s_(i);case`working`:return t?.kind===`stopped`?t.behind===`fleet`?n_(e.followers,i):i_(e.followers,i):Xg(t?a:-6,e.followers,i);case`stopped`:return t?.kind===`working`?Zg(a,e.behind,i):t?.kind===`stopped`&&t.behind!==`fleet`&&e.behind===`fleet`?t_(i):t?.kind===`stopped`&&t.behind===`fleet`&&e.behind===`none`?r_(i):e_(e.behind,i);case`sunk`:return t&&t.kind!==`sunk`?a_(a,i):o_(i)}}var V_=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function H_({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}=z_(`ledung.shipSize`,F_),m=(o.current?.oneShot??!1)&&s.current<o.current.loopFrom;if(!V_(c.current,e)&&!m){let n=a&&e.kind===`working`?Xg(4,e.followers,t):B_(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)},M_);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,U.jsx)(`pre`,{className:`sailing-ship`,style:{fontSize:`${i?Math.min(d,i):d}px`},"aria-hidden":`true`,children:Wg(g,a?0:l)});return n?(0,U.jsx)(`button`,{type:`button`,className:`ship-button`,title:`Ship size ${d}px: click for ${f}px`,onClick:p,children:_}):_}function U_(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=Rh(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 W_(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 G_(e){return e.status===`ended`&&/exited with code [1-9]|stopped unexpectedly/.test(e.endReason??``)}function K_({session:e,sessions:t,messages:n,extra:r}){let i=(0,v.useMemo)(()=>U_(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=N_(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,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`working-label`,children:t}),e.status===`running`&&i.uacWait&&(0,U.jsxs)(`span`,{className:`uac-hint`,children:[` · `,`may be waiting for UAC on the PC`]}),e.status===`running`&&i.since&&(0,U.jsxs)(`span`,{className:`muted`,children:[` · `,W_(a-i.since)]})]})}else if(e.status===`starting`)u=`done`,d=(0,U.jsx)(`span`,{className:`working-label`,children:`Ready`});else if(e.status===`idle`)u=`done`,d=(0,U.jsxs)(`span`,{className:`working-label`,children:[`Done`,i.finishedAt?` at ${Og(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=G_(e);u=t?`failed`:`done`;let n=e.endedAt?` at ${Og(e.endedAt)}`:``;d=(0,U.jsx)(`span`,{className:`working-label`,children:t?`Ended with an error${n}`:`Ended${n}${e.endReason?` · ${e.endReason.split(`
85
+ `)[0]}`:``}`})}else return null;return l?(0,U.jsxs)(`div`,{className:`status-line ${u}`,role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(H_,{mode:l}),d,r]}):null}var q_=`modulepreload`,J_=function(e){return`/`+e},Y_={},X_=function(e){return e.pathname.endsWith(`.css`)},Z_=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},Q_=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=J_(t,n);let r=s(t),i=X_(r);return Z_(Y_,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`:q_,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)})},$_={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`},ev={dockerfile:`dockerfile`,".gitignore":`bash`};function tv(e){let t=e.split(`/`).pop().toLowerCase();if(ev[t])return ev[t];let n=t.lastIndexOf(`.`);return n===-1?null:$_[t.slice(n+1)]??null}var nv=(e,t=e.split(`
86
+ `).length)=>e.length<=262144&&t<=8e3;function rv(e){let t=[],n=[],r=``;for(let i of e.split(/(<span[^>]*>|<\/span>|\n)/))i&&(i===`
87
+ `?(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 iv(e,t){let n=tv(e.path);if(!t||!n)return null;let r=e.hunks.flatMap(e=>e.lines);if(!nv(r.map(e=>e.text).join(`
88
+ `),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(`
89
+ `),n);e.forEach((e,t)=>i.set(e,r[t]??``))}return i}var av=null;function ov(){return av??=Q_(()=>import(`./highlightCore-DaAZQhSS.js`).then(e=>e.highlight),[]),av}function sv(){let[e,t]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let e=!0;return ov().then(n=>e&&t({fn:n}),()=>{}),()=>{e=!1}},[]),e?.fn??null}function cv(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function lv({text:e,path:t}){let n=e.replace(/\n$/,``).split(`
90
+ `),r=sv(),i=tv(t),a=(0,v.useMemo)(()=>r&&i&&nv(e,n.length)?r(n.join(`
91
+ `),i):null,[r,i,e]);return(0,U.jsx)(`pre`,{className:`file-text numbered hl`,style:{"--ln-width":`${String(n.length).length+1}ch`},children:(0,U.jsx)(`code`,{children:a?a.map((e,t)=>(0,U.jsx)(`span`,{className:`ln-row`,dangerouslySetInnerHTML:{__html:`${e}\n`}},t)):n.map((e,t)=>(0,U.jsxs)(`span`,{className:`ln-row`,children:[e,`
92
+ `]},t))})})}function uv(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=Tf(t);return(0,v.useEffect)(()=>{if(s(!1),c)return;let n=!0;return r(null),a(null),B.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,U.jsxs)(`aside`,{className:`file-panel`,"aria-label":`File`,children:[(0,U.jsxs)(`header`,{className:`file-head`,children:[(e.stack.length>1||e.backToPane)&&(0,U.jsx)(`button`,{className:`small`,onClick:e.onBack,children:e.backToPane&&e.stack.length===1?`‹ Files`:`Back`}),(0,U.jsx)(`span`,{className:`file-path`,title:!c&&n?.path||t,children:!c&&n?.path||t}),c&&(0,U.jsx)(`button`,{className:`small`,onClick:()=>s(!o),children:o?`Fit to panel`:`Full size`}),!c&&n&&(0,U.jsx)(kf,{text:n.content,label:`Copy all`}),(0,U.jsx)(`button`,{className:`small`,onClick:e.onClose,"aria-label":`Close`,children:`Close`})]}),(0,U.jsxs)(`div`,{className:`file-body`,children:[!c&&i&&(0,U.jsx)(`p`,{className:`error`,children:i}),c&&(0,U.jsx)(Df,{sessionId:e.sessionId,path:t,folder:e.folder,full:o,onClick:()=>s(!o)},t),!c&&!n&&!i&&(0,U.jsx)(`p`,{className:`muted`,children:`Loading…`}),!c&&n?.kind===`markdown`&&(0,U.jsx)(Nf,{text:n.content,baseDir:cv(n.path),onOpenFile:e.onOpen,sessionId:e.sessionId}),!c&&n?.kind===`text`&&(0,U.jsx)(lv,{text:n.content,path:n.path})]})]})}var dv=300;function fv(e){let t=e.replace(/\t/g,` `).trim();return t.length>dv?`${t.slice(0,dv)}…`:t}function pv(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(`
93
+ `).map(e=>` ${e}`).join(`
94
+ `);return`${t+1}. ${r} ${n} ${fv(e.lineText)}\n${i}`})].join(`
95
+ `)}function mv(e,t,n){let r=t.trim();return e===`accept`?`${F}\n\n${r?`${r}\n\n`:``}Notes, not blocking:\n${n}`:`${I} ${r?`${r}\n\n`:``}${n}`}function hv(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 gv(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 _v=e=>`ledung.lineComments.${e}`;function vv(e,t){try{let n=JSON.parse(e.getItem(_v(t))??`[]`);return Array.isArray(n)?n.filter(e=>e&&typeof e.id==`string`&&typeof e.body==`string`):[]}catch{return[]}}function yv(e,t,n){try{n.length?e.setItem(_v(t),JSON.stringify(n)):e.removeItem(_v(t))}catch{}}var bv=(e,t)=>e.path===t.path&&e.line===t.line&&e.side===t.side;function xv(e,t){let n=e.filter(e=>e.id!==t.id&&!bv(e,t));if(!t.body.trim())return n;let r=e.findIndex(e=>e.id===t.id||bv(e,t));if(r===-1)return[...n,t];let i=[...n];return i.splice(Math.min(r,i.length),0,t),i}var Sv=`(max-width: 760px)`;function Cv(){let[e,t]=(0,v.useState)(()=>typeof matchMedia==`function`&&matchMedia(Sv).matches);return(0,v.useEffect)(()=>{if(typeof matchMedia!=`function`)return;let e=matchMedia(Sv),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function wv(e){let[t,n]=(0,v.useState)(`files`),[r,i]=(0,v.useState)(()=>vv(localStorage,e.session.id));return(0,v.useEffect)(()=>yv(localStorage,e.session.id,r),[e.session.id,r]),(0,U.jsxs)(`aside`,{className:`file-panel files-pane`,"aria-label":`Files`,hidden:e.hidden,children:[(0,U.jsxs)(`header`,{className:`file-head`,children:[(0,U.jsx)(`strong`,{children:`Files`}),(0,U.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,U.jsx)(`span`,{className:`spacer`}),(0,U.jsx)(`button`,{className:`small`,onClick:e.onClose,"aria-label":`Close the Files pane`,children:`Close`})]}),(0,U.jsxs)(`div`,{className:`pane-tabs`,role:`tablist`,children:[(0,U.jsx)(`button`,{role:`tab`,"aria-selected":t===`files`,className:t===`files`?`on`:``,onClick:()=>n(`files`),children:`Files`}),(0,U.jsxs)(`button`,{role:`tab`,"aria-selected":t===`changes`,className:t===`changes`?`on`:``,onClick:()=>n(`changes`),children:[`Changes`,r.length?(0,U.jsxs)(`span`,{className:`chip draft`,children:[r.length,` draft`]}):null]})]}),(0,U.jsx)(`div`,{className:`pane-body`,hidden:t!==`files`,children:(0,U.jsx)(Tv,{session:e.session,onOpenFile:e.onOpenFile})}),(0,U.jsx)(`div`,{className:`pane-body`,hidden:t!==`changes`,children:(0,U.jsx)(Ov,{...e,drafts:r,setDrafts:i,active:t===`changes`})})]})}function Tv(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=H();(0,v.useEffect)(()=>{B.paneFolders(t).then(e=>r(e.folders),e=>a(e.message))},[t]);let h=e=>{B.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,U.jsx)(`p`,{className:`error pane-note`,children:i}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`pane-tools`,children:[n&&n.length>1&&(0,U.jsx)(`div`,{className:`seg-control`,role:`radiogroup`,"aria-label":`Which folder`,children:n.map(e=>(0,U.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,U.jsx)(`div`,{className:`muted mono pane-root`,title:C.path,children:C.path}),(0,U.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,U.jsxs)(`div`,{className:`tree`,role:`tree`,children:[S&&`error`in S&&(0,U.jsx)(`p`,{className:`error pane-note`,children:S.error}),!S&&(0,U.jsx)(`p`,{className:`muted pane-note`,children:`Loading…`}),x&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`muted pane-note`,children:[x.length,` match`,x.length===1?``:`es`,` in the folders opened so far.`]}),x.map(e=>(0,U.jsx)(Ev,{e,depth:0,label:e.path,open:u.has(e.path),onClick:()=>g(e)},e.path))]}),!x&&_.map(({e,depth:t})=>(0,U.jsxs)(v.Fragment,{children:[(0,U.jsx)(Ev,{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,U.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,U.jsx)(`p`,{className:`muted pane-note`,style:{paddingLeft:`${(t+1)*14+8}px`},children:`Loading…`})]},e.path)),S&&!(`error`in S)&&S.truncated&&(0,U.jsx)(`p`,{className:`muted pane-note`,children:`Only the first 1000 names are shown.`})]}),(0,U.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 Ev(e){let{e:t}=e,n=t.name.lastIndexOf(`.`),r=e.label??t.name;return(0,U.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,U.jsx)(`span`,{className:`tree-caret`,"aria-hidden":`true`,children:t.dir?t.skipped?`·`:e.open?`▾`:`▸`:``}),t.dir?(0,U.jsxs)(`span`,{children:[r,`/`]}):n>0&&!e.label?(0,U.jsxs)(`span`,{children:[t.name.slice(0,n),(0,U.jsx)(`span`,{className:`ext`,children:t.name.slice(n)})]}):(0,U.jsx)(`span`,{children:r}),t.skipped&&(0,U.jsx)(`span`,{className:`tree-note`,children:t.skipped===`heavy`?`not listed`:`ignored`})]})}var Dv=e=>e.kind===`del`?{line:e.old,side:`old`}:{line:e.new,side:`new`};function Ov(e){let t=e.session.id,n=Cv(),[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),B.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=>xv(e,t)),u(null),m(null)};return a?(0,U.jsxs)(`p`,{className:`error pane-note`,children:[a,` `,(0,U.jsx)(`button`,{className:`small`,onClick:g,children:`Try again`})]}):r?(0,U.jsxs)(`div`,{className:`changes-tab`,children:[(0,U.jsxs)(`div`,{className:`changes-head`,children:[(0,U.jsx)(`span`,{children:r.problem??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`strong`,{children:[_.length,` file`,_.length===1?``:`s`]}),` `,(0,U.jsxs)(`span`,{className:`plus`,children:[`+`,y]}),` `,(0,U.jsxs)(`span`,{className:`minus`,children:[`−`,b]}),(0,U.jsxs)(`span`,{className:`muted`,children:[` · `,r.branch??`HEAD`,` against `,r.base,` · at `,(0,U.jsx)(`span`,{className:`mono`,children:r.head?.slice(0,7)})]})]})}),(0,U.jsx)(`button`,{className:`small`,onClick:g,title:`Read the changes again`,children:`Refresh`})]}),r.truncated&&(0,U.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,U.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,U.jsxs)(`div`,{className:`file-step`,children:[(0,U.jsx)(`button`,{className:`small`,"aria-label":`Previous file`,disabled:s===0,onClick:()=>c(s-1),children:`‹`}),(0,U.jsx)(`select`,{value:s,onChange:e=>c(Number(e.target.value)),"aria-label":`Changed file`,children:_.map((e,t)=>(0,U.jsxs)(`option`,{value:t,children:[e.path,` · `,t+1,` of `,_.length]},e.path))}),(0,U.jsx)(`button`,{className:`small`,"aria-label":`Next file`,disabled:s>=_.length-1,onClick:()=>c(s+1),children:`›`})]}),!n&&_.length>1&&(0,U.jsx)(`ul`,{className:`changed-files`,children:_.map(n=>{let r=e.drafts.filter(e=>e.path===n.path).length;return(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`button`,{className:`link mono`,onClick:()=>document.getElementById(kv(t,n.path))?.scrollIntoView({block:`start`}),children:n.path}),r>0&&(0,U.jsx)(`span`,{className:`chip draft`,children:r}),(0,U.jsxs)(`span`,{className:`plus`,children:[`+`,n.added]}),` `,(0,U.jsxs)(`span`,{className:`minus`,children:[`−`,n.removed]})]},n.path)})}),x.map(n=>(0,U.jsx)(Av,{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,U.jsx)(Mv,{...e,sending:d,setSending:f,sent:p,setSent:m})]}):(0,U.jsx)(`p`,{className:`muted pane-note`,children:`Loading the changes…`})}var kv=(e,t)=>`diff-${e}-${t}`;function Av(e){let t=e.file,n=sv(),r=(0,v.useMemo)(()=>iv(t,n),[t,n]);return(0,U.jsxs)(`section`,{className:`diff-file`,id:kv(e.sessionId,t.path),children:[(0,U.jsxs)(`header`,{className:`diff-file-head`,children:[(0,U.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,U.jsx)(`span`,{className:`chip`,children:t.status}),(0,U.jsxs)(`span`,{className:`plus`,children:[`+`,t.added]}),` `,(0,U.jsxs)(`span`,{className:`minus`,children:[`−`,t.removed]}),t.status!==`deleted`&&!t.binary&&(0,U.jsx)(`button`,{className:`small`,onClick:e.onWhole,title:`Open the whole file, read-only`,children:`Whole file`})]}),t.binary&&(0,U.jsx)(`p`,{className:`muted pane-note`,children:`A binary file: not shown.`}),!t.binary&&!t.hunks.length&&(0,U.jsx)(`p`,{className:`muted pane-note`,children:`Renamed or its mode changed; no lines differ.`}),(0,U.jsxs)(`table`,{className:`diff-table`,children:[(0,U.jsxs)(`colgroup`,{children:[(0,U.jsx)(`col`,{className:`c-ln`}),(0,U.jsx)(`col`,{className:`c-ln`}),(0,U.jsx)(`col`,{})]}),(0,U.jsx)(`tbody`,{children:t.hunks.map((n,i)=>(0,U.jsxs)(v.Fragment,{children:[(0,U.jsx)(`tr`,{className:`hunk`,children:(0,U.jsx)(`td`,{colSpan:3,className:`mono`,children:n.header})}),n.lines.map((n,i)=>{let a=Dv(n),o=e.drafts.filter(e=>bv(e,{path:t.path,...a})),s=e.editing===n;return(0,U.jsxs)(v.Fragment,{children:[(0,U.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,U.jsx)(`td`,{className:`ln`,children:n.old??``}),(0,U.jsx)(`td`,{className:`ln`,children:n.new??``}),(0,U.jsxs)(`td`,{className:`code hl`,children:[(0,U.jsx)(`span`,{className:`mark`,children:n.kind===`add`?`+`:n.kind===`del`?`−`:` `}),r?.has(n)?(0,U.jsx)(`span`,{dangerouslySetInnerHTML:{__html:r.get(n)}}):n.text]})]}),o.map(t=>(0,U.jsx)(`tr`,{className:`comment-row`,children:(0,U.jsx)(`td`,{colSpan:3,children:(0,U.jsxs)(`div`,{className:`line-comment`,children:[(0,U.jsxs)(`div`,{className:`line-comment-head`,children:[(0,U.jsx)(`strong`,{children:e.userName}),` `,(0,U.jsx)(`span`,{className:`chip draft`,children:`draft`}),` `,(0,U.jsxs)(`span`,{className:`muted`,children:[`line `,t.line,t.side===`old`?` (old)`:``]}),(0,U.jsx)(`span`,{className:`spacer`}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>e.onEdit(n),children:`Edit`}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>e.onRemove(t),children:`Delete`})]}),(0,U.jsx)(`div`,{className:`line-comment-body`,children:t.body})]})})},t.id)),s&&(0,U.jsx)(`tr`,{className:`comment-row`,children:(0,U.jsx)(`td`,{colSpan:3,children:(0,U.jsx)(jv,{path:t.path,line:n,head:e.head,existing:o[0]??null,onCancel:()=>e.onEdit(null),onSave:e.onSave})})})]},i)})]},i))})]})]})}function jv(e){let[t,n]=(0,v.useState)(e.existing?.body??``),r=H(),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=Dv(e.line),s=sv(),c=tv(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,U.jsxs)(`div`,{ref:a,className:`comment-editor`,role:`dialog`,"aria-label":`Comment on line ${o.line}`,onClick:e=>e.stopPropagation(),children:[(0,U.jsxs)(`div`,{className:`comment-editor-head`,children:[(0,U.jsxs)(`strong`,{children:[`Comment on line `,o.line,o.side===`old`?` (old)`:``]}),(0,U.jsx)(`span`,{className:`muted mono`,children:e.path})]}),(0,U.jsxs)(`pre`,{className:`quoted-line hl ${e.line.kind}`,children:[e.line.kind===`add`?`+ `:e.line.kind===`del`?`− `:` `,l===null?e.line.text:(0,U.jsx)(`span`,{dangerouslySetInnerHTML:{__html:l}})]}),(0,U.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,U.jsx)(`p`,{className:`muted`,children:`Kept as a draft until you send; nothing reaches the worker yet.`}),(0,U.jsxs)(`div`,{className:`send`,children:[(0,U.jsx)(`button`,{onClick:e.onCancel,children:`Cancel`}),(0,U.jsx)(`button`,{className:`primary`,onClick:u,children:e.existing?`Save comment`:`Add comment`})]})]})}function Mv(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=H(),u=(0,v.useMemo)(()=>gv(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?pv(e.drafts,e.session.title):``,m=u?mv(r,a,p):hv(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 B.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,U.jsxs)(`div`,{className:`comment-bar`,children:[t&&f>0&&(0,U.jsxs)(`div`,{className:`send-panel`,children:[(0,U.jsxs)(`h4`,{children:[`Send `,f,` comment`,f===1?``:`s`]}),u?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`muted`,children:[`With your answer to the open review`,` `,(0,U.jsx)(`button`,{className:`link`,onClick:()=>e.onOpenQuestion(u.id),children:u.details?.title??`#${u.id}`}),`.`]}),(0,U.jsxs)(`label`,{className:`radio`,children:[(0,U.jsx)(`input`,{type:`radio`,checked:r===`changes`,onChange:()=>i(`changes`)}),` `,(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:`As “Changes needed”`}),(0,U.jsx)(`br`,{}),(0,U.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,U.jsxs)(`label`,{className:`radio`,children:[(0,U.jsx)(`input`,{type:`radio`,checked:r===`accept`,onChange:()=>i(`accept`)}),` `,(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:`As notes with “Accept”`}),(0,U.jsx)(`br`,{}),(0,U.jsx)(`span`,{className:`muted`,children:`Small things the worker may take or leave; the change can go ahead.`})]})]})]}):(0,U.jsxs)(`p`,{className:`muted`,children:[`No review is open for this session, so they go `,d?(0,U.jsxs)(U.Fragment,{children:[`to its manager `,(0,U.jsx)(`strong`,{children:d.title})]}):(0,U.jsxs)(U.Fragment,{children:[`to `,(0,U.jsx)(`strong`,{children:e.session.title}),` itself`]}),` as one message from you`,d?`, to hand on as a review round`:``,`.`]}),(0,U.jsx)(`textarea`,{...l,className:`box`,placeholder:`A note above the comments (optional)`,value:a,onChange:e=>o(e.target.value)}),(0,U.jsxs)(`details`,{className:`send-preview`,children:[(0,U.jsx)(`summary`,{children:`What goes`}),(0,U.jsx)(`pre`,{children:m})]}),(0,U.jsxs)(`div`,{className:`send`,children:[(0,U.jsx)(`button`,{onClick:()=>n(!1),children:`Cancel`}),(0,U.jsx)(`button`,{className:`primary`,disabled:e.sending,onClick:()=>void h(),children:u?r===`accept`?`Send with Accept`:`Send changes needed`:`Send`}),(0,U.jsx)(`span`,{className:`status`,role:`status`,children:s})]})]}),(0,U.jsxs)(`div`,{className:`comment-bar-row`,children:[(0,U.jsx)(`span`,{children:f?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`strong`,{children:[f,` comment`,f===1?``:`s`]}),` `,(0,U.jsx)(`span`,{className:`chip draft`,children:`draft`})]}):(0,U.jsx)(`span`,{className:`muted`,children:e.sent??`Click a line to comment on it.`})}),(0,U.jsxs)(`button`,{className:`primary`,disabled:!f,onClick:()=>n(!t),"aria-expanded":t,children:[`Send`,u?` with review`:``,` ▾`]})]})]})}function Nv(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 Pv(e,t){return[...e,{name:x,colours:{manager:t?.colour??null,sessions:`same`}}]}function Fv(e,t){if(!e)return;let n=Et(t.find(t=>t.name===e.project)?.colours,e.role);if(!n)return;let r=Tt[n];return{"--name-light":r.light,"--name-dark":r.dark}}function Iv(e,t){return[e,t&&S(t)].filter(Boolean).join(` - `)||`Question`}function Lv(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,U.jsx)(zv,{o:t.original,nav:i,tint:e.tintOf(t.original.sessionId)},`original`)),(t.sources??[]).forEach((e,n)=>r.push((0,U.jsx)(Vv,{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,U.jsx)(Uv,{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,U.jsxs)(U.Fragment,{children:[`Your answer goes to `,(0,U.jsx)(`strong`,{children:n(t.sessionId)}),`, which passes it on to `,n(t.original.sessionId),`.`]}):(0,U.jsxs)(U.Fragment,{children:[`Asked by `,(0,U.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,U.jsxs)(`section`,{className:`block refers`,children:[(0,U.jsx)(`h4`,{children:`What it refers to`}),o&&(0,U.jsx)(`div`,{className:`refers-note muted`,children:o}),r]})}var Rv=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function zv({o:e,nav:t,tint:n}){let{nameOf:r}=t,i=oe(e),a=[`asked ${Og(e.askedAt)}`,i.options.length?Rv(i.options.length,`option`):``,i.opinions.length?Rv(i.opinions.length,`opinion`):``,e.status===`open`?``:e.status].filter(Boolean).join(` · `);return(0,U.jsxs)(`details`,{className:`ref-box original name-tinted${n?` tinted`:``}`,style:n,children:[(0,U.jsxs)(`summary`,{children:[(0,U.jsxs)(`strong`,{children:[`Original question #`,e.id]}),` `,(0,U.jsxs)(`span`,{className:`muted`,children:[`from `,r(e.sessionId),` · `,a]})]}),(0,U.jsx)(Bv,{o:e,nav:t})]})}function Bv({o:e,nav:t,children:n}){let{nameOf:r}=t,i=oe(e),a=r(e.sessionId),o=e=>e??a,s=t=>(0,U.jsx)(Nf,{text:t,sessionId:e.sessionId});return(0,U.jsxs)(`div`,{className:`ref-body`,children:[(0,U.jsx)(`h5`,{className:`ref-title`,children:i.title}),i.issue&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h6`,{children:`The issue`}),(0,U.jsx)(`div`,{className:`prose`,children:s(i.issue)})]}),i.options.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h6`,{children:`Options`}),(0,U.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,U.jsxs)(`li`,{className:t.length?`picked`:``,children:[(0,U.jsxs)(`b`,{children:[i.structured?`${e.key} · `:``,e.label.replace(/\*\*/g,``)]}),e.detail&&(0,U.jsxs)(U.Fragment,{children:[` — `,(0,U.jsx)(`span`,{className:`prose inline`,children:s(e.detail.replace(/^[—–-]\s*/,``))})]}),e.cost&&(0,U.jsxs)(`span`,{className:`muted`,children:[` Cost: `,e.cost]}),t.length>0&&(0,U.jsxs)(`span`,{className:`ref-pick`,children:[` `,t.map(e=>`${e}'s pick`).join(`, `)]})]},e.key)})})]}),i.opinions.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h6`,{children:`Opinions`}),(0,U.jsx)(`ul`,{className:`ref-ops`,children:i.opinions.map((e,t)=>(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`b`,{children:o(e.who)}),` `,e.pick?`picks ${e.pick}`:`no pick among the options`,e.why?`: `:``,e.why&&(0,U.jsx)(`span`,{className:`prose inline`,children:s(e.why)})]},t))})]}),i.evidence&&(0,U.jsxs)(`details`,{className:`ev`,children:[(0,U.jsx)(`summary`,{children:`Evidence`}),(0,U.jsx)(`div`,{className:`prose`,children:s(i.evidence)})]}),e.sources?.length?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h6`,{children:`What it refers to`}),e.sources.map((n,r)=>(0,U.jsx)(Vv,{src:n,askedAt:e.askedAt,...t},r))]}):null,n]})}function Vv({src:e,askedAt:t,...n}){let{userName:r,nameOf:i,onOpenMessage:a,onOpenQuestion:o}=n;if(`error`in e)return(0,U.jsx)(Hv,{src:e});let s=(e,t)=>(0,U.jsx)(`button`,{className:`link`,onClick:e=>{e.preventDefault(),t()},children:e}),c=e=>(0,U.jsxs)(`div`,{className:`muted ref-cut`,children:[`Cut here: the rest is `,e,`.`]});if(e.kind===`reply`){let t=i(e.sessionId);return(0,U.jsxs)(`details`,{className:`ref-box source reply`,children:[(0,U.jsxs)(`summary`,{children:[(0,U.jsxs)(`strong`,{children:[`Reply from `,t]}),` `,(0,U.jsxs)(`span`,{className:`muted`,children:[`· its reply of `,Og(e.at),`, word for word`,a?` · `:``]}),a&&s(`open in its conversation`,()=>a(e.sessionId,e.messageId))]}),(0,U.jsxs)(`div`,{className:`ref-body`,children:[(0,U.jsx)(`div`,{className:`prose ref-source`,children:(0,U.jsx)(Nf,{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 ${Og(Date.parse(e.at))}`:``;return(0,U.jsxs)(`details`,{className:`ref-box source comment`,children:[(0,U.jsxs)(`summary`,{children:[(0,U.jsxs)(`strong`,{children:[n,` on `,/\/pull\/\d+/.test(e.url)?`PR `:``,`#`,e.number]}),` `,(0,U.jsxs)(`span`,{className:`muted`,children:[`· `,e.repo.split(`/`)[1],` · by `,e.author,i,r,` · fetched `,Og(t),` · `]}),(0,U.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,onClick:e=>e.stopPropagation(),children:`open on GitHub`})]}),(0,U.jsxs)(`div`,{className:`ref-body`,children:[(0,U.jsx)(`div`,{className:`prose ref-source`,children:e.text.trim()?(0,U.jsx)(Nf,{text:e.text}):(0,U.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}`:``} ${Og(l.answeredAt??l.askedAt)}`:l.status===`open`?`still open when attached`:l.status,f=o?.(l.id)??null;return(0,U.jsxs)(`details`,{className:`ref-box source question`,children:[(0,U.jsxs)(`summary`,{children:[(0,U.jsxs)(`strong`,{children:[`Earlier question #`,l.id]}),` `,(0,U.jsxs)(`span`,{className:`muted`,children:[`· from `,i(l.sessionId),` · asked `,Og(l.askedAt),` · `,d,f?` · `:``]}),f&&s(`open it`,f)]}),(0,U.jsx)(Bv,{o:l,nav:n,children:l.answer!==null&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h6`,{children:`The answer`}),(0,U.jsxs)(`div`,{className:`ref-line`,children:[(0,U.jsx)(`div`,{className:`ref-who`,children:u??`Answer`}),(0,U.jsx)(`div`,{className:`plain`,children:l.answer})]})]})})]})}function Hv({src:e}){let t=e.kind===`reply`?`A session's reply`:e.kind===`comment`?`A GitHub comment`:`An earlier question`;return(0,U.jsxs)(`details`,{className:`ref-box source failed`,open:!0,children:[(0,U.jsxs)(`summary`,{children:[(0,U.jsxs)(`strong`,{children:[t,` could not be attached`]}),` `,(0,U.jsxs)(`span`,{className:`muted`,children:[`· `,e.named]})]}),(0,U.jsx)(`div`,{className:`ref-body`,children:(0,U.jsx)(`div`,{className:`ref-failed`,children:e.error})})]})}function Uv({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,U.jsxs)(`details`,{className:`ref-box earlier`,children:[(0,U.jsxs)(`summary`,{children:[(0,U.jsx)(`strong`,{children:`Earlier in the conversation`}),` `,(0,U.jsxs)(`span`,{className:`muted`,children:[`· the `,t.length===1?`message`:`${t.length} messages`,` `,a,` had just before asking · `]}),(0,U.jsx)(`button`,{className:`link`,onClick:e=>{e.preventDefault(),i()},children:`open the conversation`})]}),(0,U.jsx)(`div`,{className:`ref-body`,children:t.map((t,n)=>(0,U.jsxs)(`div`,{className:`ref-line ${t.kind}`,children:[(0,U.jsxs)(`div`,{className:`ref-who`,children:[o(t),` · `,Og(t.at)]}),(0,U.jsx)(`div`,{className:`prose`,children:(0,U.jsx)(Nf,{text:t.text,sessionId:e.sessionId})}),t.cut&&(0,U.jsx)(`div`,{className:`muted ref-cut`,children:`Cut here: the rest is in the conversation.`})]},n))})]})}var Wv=8;function Gv({review:e,sessionId:t}){let n=e=>(0,U.jsx)(`div`,{className:`issue prose`,children:(0,U.jsx)(Nf,{text:e,sessionId:t})});return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`section`,{className:`block`,children:[(0,U.jsx)(`h4`,{children:`What we were solving`}),n(e.solving)]}),(0,U.jsxs)(`section`,{className:`block`,children:[(0,U.jsx)(`h4`,{children:`What was done`}),n(e.done)]}),e.notes&&(0,U.jsxs)(`section`,{className:`block`,children:[(0,U.jsx)(`h4`,{children:`Notes`}),n(e.notes)]})]})}function Kv(e){let{q:t,evidence:n}=e,r=n.filter(e=>e.kind!==`text`);return(0,U.jsxs)(`section`,{className:`block`,children:[(0,U.jsx)(`h4`,{children:`Evidence`}),r.length>0&&(0,U.jsx)(`div`,{className:`rev-thumbs`,children:r.map((n,r)=>(0,U.jsxs)(`figure`,{children:[(0,U.jsx)(qv,{q:t,ev:n,onOpen:()=>e.onShow(r)}),(0,U.jsx)(`figcaption`,{children:n.caption})]},r))}),n.map((e,n)=>e.kind===`text`?(0,U.jsx)(Yv,{q:t,n,ev:e},n):null),e.shown!==null&&r[e.shown]&&(0,U.jsx)(Jv,{q:t,images:r,at:e.shown,onShow:e.onShow})]})}function qv({q:e,ev:t,onOpen:n}){let[r,i]=(0,v.useState)(!1);return(0,U.jsx)(`button`,{className:`rev-thumb`,"aria-label":`Open large: ${t.caption}`,onClick:n,children:r?(0,U.jsx)(`span`,{className:`rev-thumb-problem`,children:`Can't be shown`}):(0,U.jsx)(`img`,{src:Ef(e.sessionId,t.file),alt:``,onError:()=>i(!0)})})}function Jv(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,U.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,U.jsxs)(`div`,{className:`rev-large-bar`,children:[(0,U.jsxs)(`span`,{className:`rev-large-caption`,children:[r.caption,` `,(0,U.jsxs)(`span`,{className:`muted`,children:[`· `,n+1,` / `,t.length]})]}),(0,U.jsx)(`button`,{ref:a,className:`icon`,"aria-label":`Close: back to the review`,title:`Close (Esc)`,onClick:()=>e.onShow(null),children:(0,U.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M3.5 3.5l9 9M12.5 3.5l-9 9`})})})]}),(0,U.jsxs)(`div`,{className:`rev-large-stage`,children:[(0,U.jsx)(Df,{sessionId:e.q.sessionId,path:r.file,alt:r.caption},r.file),t.length>1&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{className:`nav l`,onClick:()=>i(-1),"aria-label":`Previous screenshot`,children:`‹`}),(0,U.jsx)(`button`,{className:`nav r`,onClick:()=>i(1),"aria-label":`Next screenshot`,children:`›`})]})]})]})}function Yv({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 B.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(`
96
+ `),u=l.length>Wv;return(0,U.jsxs)(`div`,{className:`rev-text`,children:[(0,U.jsxs)(`div`,{className:`rev-text-head`,children:[(0,U.jsx)(`span`,{className:`rev-text-caption`,children:n.caption}),(0,U.jsx)(`span`,{className:`chip mono`,children:n.file.replace(/^board:[^/]+\/[^/]+\//,`board: `)}),r!==null&&(0,U.jsxs)(`span`,{className:`muted`,children:[l.length,` line`,l.length===1?``:`s`]})]}),a?(0,U.jsx)(`p`,{className:`error`,children:a}):r===null?(0,U.jsx)(`p`,{className:`muted`,children:`Loading…`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`pre`,{className:`rev-text-body${s?` open`:``}`,tabIndex:s?0:void 0,children:s?r:l.slice(0,Wv).join(`
97
+ `)}),u&&(0,U.jsx)(`button`,{className:`small rev-text-toggle`,"aria-expanded":s,onClick:()=>c(!s),children:s?`Fold`:`Show all ${l.length} lines`})]})]})}function Xv(e){let t=H(),{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=ee(e,r);`problem`in t?(o(t.problem),l.current?.focus()):d(()=>B.answerQuestion(n.id,t.answer))};if(n.status===`answered`){let t=n.answer??``,r=t.startsWith(F),i=r?t.slice(F.length).trim():t.startsWith(`Changes needed:`)?t.slice(I.length).trim():t;return(0,U.jsxs)(`section`,{className:`block`,children:[(0,U.jsx)(`h4`,{children:`Answer`}),(0,U.jsxs)(`div`,{className:`rev-verdict ${r?`accepted`:`changes`}`,children:[(0,U.jsx)(`strong`,{children:r?`Accepted`:`Changes needed`}),i&&(0,U.jsx)(`div`,{className:`rev-verdict-text`,children:i}),(0,U.jsxs)(`div`,{className:`muted`,children:[e.answeredBy,` · `,Og(n.answeredAt??n.askedAt),` · `,n.deliveredAt?`delivered ${Og(n.deliveredAt)}`:`not delivered yet: it goes in as soon as the session is free`]})]})]})}return n.status===`withdrawn`?(0,U.jsxs)(`section`,{className:`block`,children:[(0,U.jsx)(`h4`,{children:`Withdrawn`}),(0,U.jsx)(`div`,{className:`answered-box withdrawn`,children:(0,U.jsxs)(`div`,{className:`muted`,children:[`Withdrawn`,n.withdrawnReason?`: ${n.withdrawnReason}`:``]})})]}):(0,U.jsxs)(`section`,{className:`block`,children:[(0,U.jsx)(`h4`,{children:`Your answer`}),(0,U.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,U.jsx)(`textarea`,{...t,id:`rev-${n.id}`,ref:l,className:`box`,placeholder:cg()?`Write here`:`N to write, Esc to leave`,value:r,onChange:e=>{i(e.target.value),o(``)}}),(0,U.jsxs)(`div`,{className:`send`,children:[(0,U.jsx)(`button`,{className:`allow`,disabled:s,onClick:()=>f(`accept`),children:`Accept`}),(0,U.jsx)(`button`,{className:`deny`,disabled:s,onClick:()=>f(`changes`),children:`Changes needed`}),(0,U.jsx)(`span`,{className:`status`,role:`status`,children:a})]}),(0,U.jsx)(lg,{busy:s,onWithdraw:()=>void d(()=>B.withdrawQuestion(n.id))})]})}function Zv({remote:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(``),a=H(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(!1),f=()=>void B.remoteLink().then(n,()=>n(null));if((0,v.useEffect)(f,[e?.publicName]),!t)return null;if(t.source===`config`)return(0,U.jsxs)(`p`,{className:`muted`,children:[`This relay is set in the config file (`,(0,U.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,U.jsxs)(`div`,{className:`relay-join`,children:[n&&(0,U.jsx)(`p`,{className:`remote-state connected`,children:`Connected, certificate ok. Pair your phone in Phones below.`}),!n&&t?.state===`waiting-caa`&&(0,U.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,U.jsxs)(`div`,{className:`restart-confirm`,children:[(0,U.jsx)(`span`,{children:`Leave the relay? Phones stop reaching this Ledung at once; joining again needs a new code.`}),(0,U.jsx)(`button`,{className:`small danger`,disabled:o,onClick:()=>p(B.remoteLeave),children:`Leave`}),(0,U.jsx)(`button`,{className:`small`,disabled:o,onClick:()=>d(!1),children:`Cancel`})]}):(0,U.jsx)(`button`,{className:`small`,onClick:()=>d(!0),children:`Leave this relay`}),c&&(0,U.jsx)(`p`,{className:`restart-problem`,children:c})]})}return(0,U.jsxs)(`div`,{className:`relay-join`,children:[(0,U.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,U.jsxs)(`div`,{className:`relay-row`,children:[(0,U.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,U.jsx)(`button`,{disabled:o||!r.trim(),onClick:()=>p(()=>B.remoteJoin(r)),children:o?`Joining…`:`Join with a code`})]}),c&&(0,U.jsx)(`p`,{className:`restart-problem`,children:c})]})}function Qv({view:e,onView:t,run:n,newComputers:r}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ey,{view:e,onView:t,run:n}),e.relay&&e.keySha256&&(0,U.jsx)(ty,{run:n,newComputers:r,tokenSet:e.tokenSet})]})}var $v=e=>!!e.relay||!!e.keySha256;function ey({view:e,onView:t,run:n}){let[r,i]=(0,v.useState)(e.relay??``),a=H(),[o,s]=(0,v.useState)(``);return(0,U.jsxs)(`div`,{className:`relay-admin`,children:[(0,U.jsxs)(`div`,{className:`relay-row`,children:[(0,U.jsxs)(`label`,{children:[`Relay `,(0,U.jsx)(`input`,{...a,value:r,onChange:e=>i(e.target.value),placeholder:`wss://relay.example.org`,spellCheck:!1})]}),(0,U.jsx)(`button`,{className:`small`,disabled:r.trim()===(e.relay??``),onClick:()=>void n(async()=>t(await B.setRelayAdmin({relay:r}))),children:`Save`})]}),(0,U.jsxs)(`p`,{className:`muted`,children:[`Admin key: `,e.keySha256?(0,U.jsxs)(U.Fragment,{children:[`made. Its SHA-256 goes in the relay's config as `,(0,U.jsx)(`code`,{children:`"adminKeySha256"`}),`: `,(0,U.jsx)(`code`,{className:`remote-record`,children:e.keySha256}),` `,(0,U.jsx)(kf,{text:e.keySha256})]}):`none yet. Ledung makes it and keeps it in its data folder; only its SHA-256 goes to the relay.`]}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await B.makeRelayAdminKey())),children:e.keySha256?`Make a new admin key`:`Make admin key`}),(0,U.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,U.jsxs)(`div`,{className:`relay-row`,children:[(0,U.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,U.jsx)(`button`,{className:`small`,disabled:!o.trim(),onClick:()=>void n(async()=>{t(await B.setRelayAdmin({cloudflareToken:o})),s(``)}),children:`Save token`}),e.tokenSet&&(0,U.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await B.setRelayAdmin({cloudflareToken:``}))),children:`Remove token`})]})]})}function ty({run:e,newComputers:t,tokenSet:n}){let[r,i]=(0,v.useState)(``),a=H(),[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 B.relayComputers().then(e=>{d(e.invites),p(null)},e=>p(e.message));return(0,v.useEffect)(m,[]),(0,U.jsxs)(`div`,{className:`relay-invites`,children:[(0,U.jsx)(`h4`,{children:`Invite a computer`}),(0,U.jsxs)(`div`,{className:`relay-row`,children:[(0,U.jsx)(`input`,{...a,value:r,onChange:e=>i(e.target.value),placeholder:`Whose computer`,"aria-label":`Owner`}),(0,U.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,U.jsx)(`button`,{disabled:!r.trim(),onClick:()=>void e(async()=>{l(await B.relayInvite(r,o.trim()||void 0)),i(``),s(``),m()}),children:`Invite`})]}),c&&(0,U.jsxs)(`div`,{className:`relay-code`,children:[(0,U.jsxs)(`p`,{children:[`Join code for `,c.owner,`'s computer, `,(0,U.jsx)(`b`,{children:c.host}),`. It is shown only now, works once, and runs out at `,new Date(c.expiresAt).toLocaleString(),`:`]}),(0,U.jsxs)(`p`,{children:[(0,U.jsx)(`code`,{className:`remote-record`,children:c.code}),` `,(0,U.jsx)(kf,{text:c.code})]}),(0,U.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,U.jsx)(`p`,{className:`restart-problem`,children:f}),u&&u.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h4`,{children:`Not used yet`}),(0,U.jsx)(`ul`,{className:`relay-list`,children:u.map(t=>(0,U.jsxs)(`li`,{children:[t.host,` for `,t.owner,`, until `,new Date(t.expiresAt).toLocaleString(),` `,(0,U.jsx)(`button`,{className:`small`,onClick:()=>void e(async()=>{await B.revokeRelayInvite(t.id),m()}),children:`Revoke`})]},t.id))})]}),t.length>0&&(0,U.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 ny({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,U.jsxs)(`div`,{className:`new-computer`,children:[(0,U.jsxs)(`div`,{className:`new-computer-head`,children:[`New computer `,(0,U.jsx)(`code`,{children:e.name}),` for `,e.owner]}),(0,U.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,U.jsx)(`p`,{children:(0,U.jsx)(`code`,{className:`remote-record`,children:e.record})}),(0,U.jsxs)(`div`,{className:`restart-confirm`,children:[e.approvable&&(0,U.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(()=>B.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,U.jsx)(kf,{text:e.record}),!e.approvable&&(0,U.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(()=>B.computerAdded(e.name)),children:`I added it`})]}),!e.approvable&&(0,U.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,U.jsx)(`p`,{className:`restart-problem`,children:n})]})}function ry({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,U.jsxs)(`div`,{className:`new-computer`,children:[(0,U.jsx)(`div`,{className:`new-computer-head`,children:c?(0,U.jsxs)(U.Fragment,{children:[e.computer,` paired `,(0,U.jsx)(`code`,{children:c.name}),` through the link`]}):(0,U.jsxs)(U.Fragment,{children:[e.computer,` opened a pairing through the link`]})}),(0,U.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,U.jsxs)(`div`,{className:`restart-confirm`,children:[c&&(0,U.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(async()=>{await B.revokeDevice(c.id),await B.dismissLinkPairing(e.id)}),children:`Remove device`}),(0,U.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(()=>B.dismissLinkPairing(e.id)),title:`Takes this card away; the device stays in Settings → Phones`,children:`OK`})]}),n&&(0,U.jsx)(`p`,{className:`restart-problem`,children:n})]})}var iy=e=>e.status===`open`&&e.addressedTo===`user`,ay=e=>e.status===`pending`&&e.addressedTo===`user`;function oy(e,t){return e.filter(iy).length+t.filter(ay).length}var sy=[`var(--s2)`,`var(--s4)`,`var(--s1)`,`var(--s7)`,`var(--s5)`,`var(--s3)`],cy=`var(--s-other)`;function ly(e){let[t,n]=(0,v.useState)(()=>Uf(localStorage)),r=e=>{n(e),Wf(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=>Fv(i(t),Pv(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=pe(e.projects.map(e=>e.questionTiers)),p=e=>e===null?cy:sy[f.indexOf(e)%sy.length]??cy,m=pe(e.projects.filter(e=>d(e.name)).map(e=>e.questionTiers)),{items:h,forYou:g,done:_,listFor:y}=Kf(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,U.jsxs)(`header`,{className:`desk-head`,children:[(0,U.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,U.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,"aria-hidden":`true`,children:[(0,U.jsx)(`rect`,{x:`1.5`,y:`2.5`,width:`13`,height:`11`,rx:`2`}),(0,U.jsx)(`path`,{d:`M6 2.5v11`})]})}),(0,U.jsxs)(`div`,{className:`head-main`,children:[(0,U.jsxs)(`div`,{className:`head-text`,children:[(0,U.jsx)(`h2`,{children:`Waiting for you`}),(0,U.jsx)(`div`,{className:`muted`,children:t})]}),(0,U.jsx)(`div`,{className:`head-controls`,children:n})]}),r&&(0,U.jsxs)(`button`,{className:`small conv`,title:`Go to conversation (C): ${o(bg(r))}`,onClick:()=>e.onGoToConversation(r.id),children:[(0,U.jsx)(uy,{}),(0,U.jsx)(`span`,{className:`conv-text`,children:`Go to conversation`})]}),(0,U.jsx)(`button`,{className:`icon`,title:`Close: back to the view before`,"aria-label":`Close`,onClick:e.onClose,children:(0,U.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,U.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,U.jsxs)(`div`,{className:`waiting-view desk-view`,children:[w(``,(0,U.jsx)(`button`,{onClick:()=>e.onOpenQuestion(null),children:`← Queue`})),(0,U.jsx)(`div`,{className:`desk`,children:(0,U.jsx)(`div`,{className:`desk-body`,children:(0,U.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,U.jsx)(hy,{ctx:T,item:C,list:t,onAnswered:n},C.q.id):C.q.shots?(0,U.jsx)(gy,{ctx:T,item:C,list:t,onAnswered:e.onLeaveShots},C.q.id):(0,U.jsx)(yy,{ctx:T,item:C,list:t,onAnswered:n},C.q.id)}return(0,U.jsx)(my,{ctx:T,filter:t,setFilter:r,projectNames:u,waitingIn:S,forYou:g,done:_,permsForYou:b,tiers:m})}var uy=()=>(0,U.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M2.5 3.5h11v7h-6l-3 2.5v-2.5h-2z`})});function dy(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 fy=e=>e.trim().split(`
98
+ `)[0]??``,py=e=>e.replace(/\*\*|`|^#+\s*/gm,``).replace(/\s+/g,` `).trim().slice(0,180);function my(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]})};dy((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,U.jsxs)(`div`,{className:`qrow-wrap`,children:[(0,U.jsxs)(`button`,{className:`qrow name-tinted${c?` tinted`:``}${s?` done`:``}`,style:c,onClick:()=>t.onOpenQuestion(i.id),children:[(0,U.jsx)(`span`,{className:`border-label`,children:Iv(e.tier,e.project)}),(0,U.jsx)(`span`,{className:`place`,children:s?i.status===`answered`?`✓`:`–`:r??`·`}),(0,U.jsxs)(`span`,{className:`t`,children:[o.title,le(o.opinions)&&!s&&(0,U.jsxs)(U.Fragment,{children:[` `,(0,U.jsx)(`span`,{className:`split`,children:`They disagree`})]})]}),s?i.status===`answered`?(0,U.jsxs)(`span`,{className:`pill`,children:[i.answeredBy===`user`?`You`:`Manager`,` · `,Og(i.answeredAt??i.askedAt)]}):(0,U.jsx)(`span`,{className:`pill grey`,children:`Withdrawn`}):(0,U.jsx)(`span`,{className:`when`,children:Og(i.askedAt)}),(0,U.jsxs)(`span`,{className:`meta`,children:[(0,U.jsxs)(`span`,{children:[`#`,i.id]}),(0,U.jsx)(`span`,{children:n(i.sessionId)}),i.aboutQuestion!==null&&(0,U.jsxs)(`span`,{children:[`· about #`,i.aboutQuestion]}),!o.structured&&(0,U.jsx)(`span`,{className:`chip`,children:`plain`}),o.review&&(0,U.jsx)(`span`,{className:`chip review-chip`,children:`Review`}),i.shots&&(0,U.jsx)(`span`,{className:`chip shot-chip`,children:mg(i)})]}),(0,U.jsx)(`span`,{className:`excerpt`,children:s?i.status===`answered`?py(i.answer??``):i.withdrawnReason??``:py(o.review?fy(o.review.solving):o.issue)})]}),(0,U.jsx)(`button`,{className:`icon conv-row`,title:`Go to conversation: ${n(bg(i))}`,"aria-label":`Go to conversation of question #${i.id}`,onClick:()=>t.onGoToConversation(i.id),children:(0,U.jsx)(uy,{})})]},i.id)},m=e=>(0,U.jsxs)(`div`,{className:`waiting-permission`,children:[(0,U.jsxs)(`div`,{className:`waiting-from`,children:[(0,U.jsx)(`button`,{className:`link`,onClick:()=>t.onOpenSession(e.sessionId),children:r(e.sessionId)}),(0,U.jsxs)(`span`,{className:`muted`,children:[` (`,S(t.sessions.find(t=>t.id===e.sessionId)?.project??``),`) · `,Og(e.at)]})]}),(0,U.jsx)(Bh,{permission:e})]},e.id),h=(e,t,n)=>(0,U.jsxs)(`h3`,{className:`group-head`,style:{"--c":t},children:[(0,U.jsx)(`i`,{}),e,n!==void 0&&(0,U.jsx)(`span`,{className:`count`,children:n})]}),g=(0,U.jsxs)(`div`,{className:`filter`,children:[(0,U.jsxs)(`div`,{className:`seg-control`,role:`group`,"aria-label":`Show`,children:[(0,U.jsx)(`button`,{className:s.mode===`one`?`on`:``,"aria-pressed":s.mode===`one`,onClick:()=>l(`one`),children:`One project`}),(0,U.jsx)(`button`,{className:s.mode===`all`?`on`:``,"aria-pressed":s.mode===`all`,onClick:()=>l(`all`),children:`All`})]}),(0,U.jsx)(`div`,{className:`projs`,children:e.projectNames.map(t=>{let n=s.mode===`all`?!s.hidden.includes(t):t===s.one;return(0,U.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,U.jsx)(`span`,{className:`box`,children:n?`✓`:``}),S(t),` `,(0,U.jsx)(`b`,{children:e.waitingIn(t)})]},t)})})]}),_=0;return(0,U.jsxs)(`div`,{className:`waiting-view desk-view`,children:[o((0,U.jsxs)(`span`,{className:`tally`,children:[(0,U.jsx)(`b`,{children:d}),` waiting · `,(0,U.jsx)(`b`,{children:f}),` answered`]}),g),(0,U.jsx)(`div`,{className:`desk`,children:(0,U.jsxs)(`div`,{className:`desk-body`,children:[(0,U.jsxs)(`p`,{className:`lede muted`,children:[`Ordered by what each answer unblocks, and each answer takes you to the next.`,(0,U.jsxs)(`span`,{className:`kbd-hint`,children:[` `,(0,U.jsx)(`kbd`,{children:`Enter`}),` opens the first question.`]})]}),!d&&(0,U.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,U.jsxs)(U.Fragment,{children:[h(`New computers`,`var(--warn-border)`,t.newComputers.length),t.newComputers.map(e=>(0,U.jsx)(ny,{computer:e,run:t.run},e.name))]}),t.linkPairings.length>0&&(0,U.jsxs)(U.Fragment,{children:[h(`Paired through the link`,`var(--warn-border)`,t.linkPairings.length),t.linkPairings.map(e=>(0,U.jsx)(ry,{pairing:e,run:t.run},e.id))]}),e.permsForYou.length>0&&(0,U.jsxs)(U.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,U.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,U.jsxs)(U.Fragment,{children:[h(`Answered recently`,`var(--ok)`),e.done.map(e=>p(e,null))]}),(0,U.jsxs)(`div`,{className:`keys`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`Enter`}),` first question`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`1`}),`–`,(0,U.jsx)(`kbd`,{children:`9`}),` open by place`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`P`}),` next project`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`A`}),` one project / all`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(uy,{}),` on a row: its conversation`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`S`}),` hide / show sidebar`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`Esc`}),` close`]})]})]})})]})}function hy({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())};dy((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=>Nv([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`,A=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,U.jsxs)(`div`,{className:`waiting-view desk-view`,children:[l(A,(0,U.jsxs)(`div`,{className:`qbar`,children:[(0,U.jsx)(`button`,{onClick:()=>i.onOpenQuestion(null),children:`← Queue`}),(0,U.jsx)(`button`,{disabled:C<=0,"aria-label":`Previous question`,title:`Previous question (←)`,onClick:()=>w(-1),children:`←`}),(0,U.jsx)(`button`,{disabled:C<0||C>=n.length-1,"aria-label":`Next question`,title:`Next question (→)`,onClick:()=>w(1),children:`→`})]}),u),(0,U.jsx)(`div`,{className:`desk${_===null?``:` locked`}`,children:(0,U.jsxs)(`div`,{className:`desk-body review`,children:[(0,U.jsxs)(`div`,{className:`qhead name-tinted${s(u.sessionId)?` tinted`:``}`,style:s(u.sessionId),children:[(0,U.jsx)(`span`,{className:`border-label`,children:Iv(p,f)}),(0,U.jsxs)(`div`,{className:`meta`,children:[(0,U.jsx)(`span`,{className:`chip review-chip`,children:`Review`}),(0,U.jsxs)(`strong`,{children:[`#`,u.id]}),(0,U.jsx)(`span`,{className:`chip`,children:S(f)}),(0,U.jsxs)(`span`,{className:`muted`,children:[`· `,(0,U.jsx)(`button`,{className:`link`,onClick:()=>i.onOpenSession(u.sessionId),children:E}),` · asked `,Og(u.askedAt)]}),u.addressedTo!==`user`&&(0,U.jsxs)(`span`,{className:`muted`,children:[`· to manager "`,o(u.addressedTo),`"`]})]}),(0,U.jsx)(`h3`,{children:d.title}),d.refs.length>0&&(0,U.jsx)(`div`,{className:`refs`,children:d.refs.map(e=>{let t=O(e);return t?(0,U.jsx)(`a`,{className:`chip`,href:t,target:`_blank`,rel:`noreferrer noopener`,children:e},e):(0,U.jsx)(`span`,{className:`chip`,children:e},e)})})]}),u.status===`open`&&u.addressedTo!==`user`&&(0,U.jsxs)(`div`,{className:`handled`,children:[`Manager "`,o(u.addressedTo),`" is handling this. Answer it here yourself and the manager is told.`]}),(0,U.jsx)(Lv,{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,U.jsx)(Gv,{review:m,sessionId:u.sessionId}),h.length>0&&(0,U.jsx)(Kv,{q:u,evidence:h,shown:_,onShow:T}),(0,U.jsx)(Xv,{q:u,answeredBy:k,noteFocus:b,onAnswered:()=>r(u.id)}),(0,U.jsxs)(`div`,{className:`keys`,children:[u.status===`open`&&(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`N`}),` note`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`←`}),(0,U.jsx)(`kbd`,{children:`→`}),` previous / next`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`C`}),` conversation`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`Esc`}),` queue`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`S`}),` sidebar`]})]})]})})]})}function gy({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,U.jsxs)(`div`,{className:`waiting-view desk-view`,children:[s(p,(0,U.jsxs)(`div`,{className:`qbar`,children:[(0,U.jsx)(`button`,{onClick:()=>i.onOpenQuestion(null),children:`← Queue`}),(0,U.jsx)(`button`,{disabled:d<=0,"aria-label":`Previous question`,title:`Previous question`,onClick:()=>f(-1),children:`←`}),(0,U.jsx)(`button`,{disabled:d<0||d>=n.length-1,"aria-label":`Next question`,title:`Next question`,onClick:()=>f(1),children:`→`})]}),c),(0,U.jsx)(fg,{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,U.jsx)(Lv,{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 _y({opinions:e,whoOf:t}){let n=e.length;return n?n===1?(0,U.jsx)(`div`,{className:`legend`,children:(0,U.jsxs)(`span`,{children:[`Green border: `,t(e[0]),`'s pick`]})}):n>5?(0,U.jsx)(`div`,{className:`legend`,children:(0,U.jsxs)(`span`,{children:[n,` opinions: each option says who picked it`]})}):(0,U.jsxs)(`div`,{className:`legend`,children:[(0,U.jsxs)(`span`,{children:[`Green border in `,n,` parts, one per opinion, left to right:`]}),e.map((e,r)=>(0,U.jsxs)(`span`,{children:[(0,U.jsx)(vy,{i:r,n}),t(e)]},r)),(0,U.jsx)(`span`,{children:`Whole border: they all agree`})]}):null}var vy=({i:e,n:t})=>(0,U.jsx)(`span`,{className:`part-key`,"aria-hidden":`true`,children:Array.from({length:t},(t,n)=>(0,U.jsx)(`i`,{className:n===e?`on`:``},n))});function yy({ctx:e,item:t,list:n,onAnswered:r}){let i=H(),{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),A=f.options.length+1,j=!d.aboutRequest;(0,v.useEffect)(()=>{g===`other`&&D.current?.focus()},[g]);let M=e=>{let t=n[k+e];k>=0&&t&&a.onOpenQuestion(t.q.id)},N=e=>{_(e),w(``)},P=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=j&&x.trim()?`${e}\n\nNote: ${x.trim()}`:e;E(!0),w(``);try{await B.answerQuestion(d.id,t),r(d.id)}catch(e){w(e.message),E(!1)}},F=async()=>{E(!0);try{await B.withdrawQuestion(d.id),r(d.id)}catch(e){w(e.message),E(!1)}};dy((e,t)=>{if((e.ctrlKey||e.metaKey)&&e.key===`Enter`){e.preventDefault(),P();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`)M(1);else if(e.key===`ArrowLeft`)M(-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(),N(f.options[t-1].key)):t===A&&(e.preventDefault(),N(`other`))}else n===`n`&&j&&(e.preventDefault(),O.current?.focus())});let I=o(d.sessionId),ee=l(p)?.tickets??void 0,te=e=>Nv([e],ee)[0]?.url,ne=d.status===`answered`&&d.answer!==null?f.options.find(e=>d.answer===e.answer||d.answer.startsWith(`${e.answer}\n\nNote: `))?.key??null:null,re=d.answeredBy===`user`?d.forwardedFrom===null?a.userName:`${a.userName} (passed on by the manager)`:`Manager "${s(d.answeredBy??``)}", under its standing grant`,ie=e=>{let t=f.options.findIndex(t=>t.key===e);return t<0?e:`${t+1} · ${f.options[t].label.replace(/\*\*/g,``)}`},ae=d.status===`open`?d.addressedTo===`user`?`${k+1} of ${n.length} waiting`:`Manager "${s(d.addressedTo)}" is handling it`:d.status===`answered`?`Answered`:`Withdrawn`,oe=e=>(0,U.jsx)(Nf,{text:e,sessionId:d.sessionId}),se=f.opinions,ce=se.length<=5,ue=e=>e.who??I,de=e=>({"--i":e,"--n":se.length});return(0,U.jsxs)(`div`,{className:`waiting-view desk-view`,children:[u(ae,(0,U.jsxs)(`div`,{className:`qbar`,children:[(0,U.jsx)(`button`,{onClick:()=>a.onOpenQuestion(null),children:`← Queue`}),(0,U.jsx)(`button`,{disabled:k<=0,"aria-label":`Previous question`,title:`Previous question (←)`,onClick:()=>M(-1),children:`←`}),(0,U.jsx)(`button`,{disabled:k<0||k>=n.length-1,"aria-label":`Next question`,title:`Next question (→)`,onClick:()=>M(1),children:`→`})]}),d),(0,U.jsx)(`div`,{className:`desk`,children:(0,U.jsxs)(`div`,{className:`desk-body`,children:[(0,U.jsxs)(`div`,{className:`qhead name-tinted${c(d.sessionId)?` tinted`:``}`,style:c(d.sessionId),children:[(0,U.jsx)(`span`,{className:`border-label`,children:Iv(m,p)}),(0,U.jsxs)(`div`,{className:`meta`,children:[(0,U.jsxs)(`strong`,{children:[`Question #`,d.id]}),(0,U.jsxs)(`span`,{className:`muted`,children:[`· `,(0,U.jsx)(`button`,{className:`link`,onClick:()=>a.onOpenSession(d.sessionId),children:I}),` · asked `,Og(d.askedAt)]}),d.addressedTo!==`user`&&(0,U.jsxs)(`span`,{className:`muted`,children:[`· to manager "`,s(d.addressedTo),`"`]}),!f.structured&&(0,U.jsx)(`span`,{className:`chip`,title:`Asked with text and option labels only`,children:`plain question`}),!f.structured&&(0,U.jsx)(`span`,{className:`muted touch-only`,children:`· asked with text and option labels only`})]}),(0,U.jsx)(`h3`,{children:f.title}),f.refs.length>0&&(0,U.jsx)(`div`,{className:`refs`,children:f.refs.map(e=>{let t=te(e);return t?(0,U.jsx)(`a`,{className:`chip`,href:t,target:`_blank`,rel:`noreferrer noopener`,children:e},e):(0,U.jsx)(`span`,{className:`chip`,children:e},e)})})]}),h&&d.addressedTo!==`user`&&(0,U.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,U.jsxs)(`p`,{className:`sensitive-note`,children:[(0,U.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,U.jsx)(Lv,{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,U.jsxs)(`section`,{className:`block`,children:[(0,U.jsx)(`h4`,{children:`The issue`}),(0,U.jsx)(`div`,{className:`issue prose`,children:oe(f.issue)})]}),f.evidence&&(0,U.jsx)(`section`,{className:`block`,children:(0,U.jsxs)(`details`,{className:`ev`,children:[(0,U.jsx)(`summary`,{children:`Evidence`}),(0,U.jsx)(`div`,{className:`prose`,children:oe(f.evidence)})]})}),d.status===`answered`&&(0,U.jsxs)(`section`,{className:`block`,children:[(0,U.jsx)(`h4`,{children:`Answer`}),(0,U.jsxs)(`div`,{className:`answered-box`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`strong`,{children:[re,`:`]}),` `,d.answer]}),(0,U.jsxs)(`div`,{className:`muted`,children:[`answered `,Og(d.answeredAt??d.askedAt),` · `,d.deliveredAt?`delivered ${Og(d.deliveredAt)}`:`not delivered yet: it goes in as soon as the session is free`]})]})]}),d.status===`withdrawn`&&(0,U.jsxs)(`section`,{className:`block`,children:[(0,U.jsx)(`h4`,{children:`Withdrawn`}),(0,U.jsx)(`div`,{className:`answered-box withdrawn`,children:(0,U.jsxs)(`div`,{className:`muted`,children:[`Withdrawn`,d.withdrawnReason?`: ${d.withdrawnReason}`:``]})})]}),(f.options.length>0||h)&&(0,U.jsxs)(`section`,{className:`block opts-block`,children:[(0,U.jsx)(`h4`,{children:`Options`}),f.options.length>0&&(0,U.jsx)(_y,{opinions:se,whoOf:ue}),(0,U.jsxs)(`div`,{className:`opts`,role:`radiogroup`,"aria-label":`Options`,children:[f.options.map((e,t)=>{let n=h?g===e.key:ne===e.key;return(0,U.jsxs)(`button`,{className:`opt${n?` on`:``}`,role:`radio`,"aria-checked":n,disabled:!h,onClick:()=>N(e.key),children:[(0,U.jsx)(`span`,{className:`k`,children:t+1}),(0,U.jsxs)(`span`,{className:`lab`,children:[f.structured&&(0,U.jsx)(`span`,{className:`letter`,children:e.key}),e.label.replace(/\*\*/g,``)]}),e.detail&&(0,U.jsx)(`span`,{className:`det prose`,children:oe(e.detail)}),e.cost&&(0,U.jsxs)(`span`,{className:`cost muted`,children:[(0,U.jsx)(`b`,{children:`Cost`}),` · `,e.cost]}),ce&&se.map((t,n)=>t.pick===e.key&&(0,U.jsxs)(v.Fragment,{children:[(0,U.jsx)(`span`,{className:`edge${n===0?` first`:``}${n===se.length-1?` last`:``}`,style:de(n)}),(0,U.jsx)(`span`,{className:`tag who`,style:de(n),title:ue(t),children:ue(t)})]},n)),se.some(t=>t.pick===e.key)&&(0,U.jsxs)(`span`,{className:`picked-by${ce?` touch-only`:``}`,children:[(0,U.jsx)(`b`,{children:`Picked by`}),` `,se.filter(t=>t.pick===e.key).map(ue).join(`, `)]}),!h&&n&&(0,U.jsx)(`span`,{className:`tag answer`,children:`Answer`})]},e.key)}),h&&(0,U.jsxs)(`button`,{className:`opt${g===`other`?` on`:``}`,role:`radio`,"aria-checked":g===`other`,onClick:()=>N(`other`),children:[(0,U.jsx)(`span`,{className:`k`,children:A}),(0,U.jsx)(`span`,{className:`lab`,children:`Other answer`}),(0,U.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,U.jsx)(`textarea`,{...i,ref:D,className:`box`,placeholder:`Your answer, in your own words`,value:y,onChange:e=>b(e.target.value)})]}),(f.structured||se.length>0)&&(0,U.jsxs)(`section`,{className:`block`,children:[(0,U.jsxs)(`h4`,{children:[`Opinions`,le(se)&&(0,U.jsx)(`span`,{className:`split`,children:`They disagree`})]}),se.length?(0,U.jsx)(`div`,{className:`recs`,children:se.map((e,t)=>(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`rec-label muted`,children:[ce&&se.length>1&&(0,U.jsx)(vy,{i:t,n:se.length}),ue(e),e.who===null&&` (asker)`]}),(0,U.jsxs)(`div`,{className:`rec${e.pick?``:` empty`}`,children:[(0,U.jsx)(`div`,{className:`pick`,children:e.pick?ie(e.pick):`No pick among the options`}),(0,U.jsx)(`div`,{className:`prose`,children:e.why?oe(e.why):(0,U.jsx)(`span`,{className:`none`,children:f.structured?`No reason given.`:`Marked "(recommended)"; a plain question gives no reason.`})})]})]},t))}):(0,U.jsx)(`div`,{className:`rec empty`,children:(0,U.jsx)(`div`,{className:`none`,children:`No opinions given.`})})]}),h&&(0,U.jsxs)(`section`,{className:`block note-block`,children:[j&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`h4`,{children:[`Note `,(0,U.jsx)(`span`,{className:`opt-in`,children:`(optional, goes with the answer)`})]}),(0,U.jsx)(`textarea`,{...i,ref:O,className:`box`,placeholder:`Anything to go with the answer`,value:x,onChange:e=>S(e.target.value)})]}),(0,U.jsxs)(`div`,{className:`send`,children:[(0,U.jsx)(`button`,{className:`primary`,disabled:!g||T,onClick:()=>void P(),children:`Send answer`}),(0,U.jsxs)(`span`,{className:`muted send-hint`,children:[(0,U.jsx)(`kbd`,{children:`Ctrl`}),`/`,(0,U.jsx)(`kbd`,{children:`⌘`}),`+`,(0,U.jsx)(`kbd`,{children:`Enter`}),` sends`]}),(0,U.jsx)(`span`,{className:`status`,role:`status`,children:C})]}),(0,U.jsx)(lg,{busy:T,onWithdraw:()=>void F()})]}),(0,U.jsxs)(`div`,{className:`keys`,children:[h&&(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`1`}),`–`,(0,U.jsx)(`kbd`,{children:A}),` pick (`,A,`: other)`]}),h&&j&&(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`N`}),` note`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`←`}),(0,U.jsx)(`kbd`,{children:`→`}),` previous / next`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`C`}),` conversation`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`Esc`}),` queue`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`kbd`,{children:`S`}),` sidebar`]})]})]})}),h&&(0,U.jsxs)(`div`,{className:`send-bar`,children:[(0,U.jsx)(`span`,{className:`send-pick${g?``:` muted`}`,children:g===null?`No option picked yet`:g===`other`?`${A} · Other answer`:ie(g)}),(0,U.jsx)(`button`,{className:`primary`,disabled:!g||T,onClick:()=>void P(),children:`Send answer`}),C&&(0,U.jsx)(`span`,{className:`status`,role:`status`,children:C})]})]})}var by=e=>Math.max(0,Math.min(100,Math.floor(Math.round((e??0)*1e4)/100)));function xy(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-by(e.utilization);return`${Math.max(1,t)}% to stop`}var Sy={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 Cy(e,t,n){if(e==null)return``;let r=Math.ceil((e-t)/6e4),i=`${Sy[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 wy(e,t){let n=xy(e),r=e.holding||e.utilization==null?n[0].toUpperCase()+n.slice(1):`${by(e.utilization)}% · ${n}`,i=Cy(e.resetsAt,t,e.kind);return i?`${r} · ${i}`:r}var Ty=180;function Ey({scene:e,step:t,number:n,cls:r}){let i=Wg(e,t),a=Wg({...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]!==`
99
+ `?(c&&s.push(c),c=``,s.push((0,U.jsx)(`span`,{className:r,children:i[e]},e))):c+=i[e];return c&&s.push(c),s}function Dy(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 Oy({utilization:e,label:t,hull:n=`ship`}){let{size:r,next:i,step:a}=z_(`ledung.limitShipSize`,5),o=(0,v.useRef)(null),[s,c]=(0,v.useState)(u_.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=Dy(o.current,r);c(u_.find(n=>n*t<=e.clientWidth)??u_.at(-1))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[r]);let f=y_(e*100,s,n),p=(0,v.useRef)(null),m=p.current??={mode:null,x:x_(f,s,n),stage:b_(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),Ty);return()=>clearInterval(e)},[l]);let h=m.at!==u;m.at=u;let g,_=[],y=m.stage;if(m.mode===`leaving`)g=D_(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=O_(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=x_(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=b_(f),{scene:g,number:_}=E_(s,y,m.x,`${by(e)}%`,n)}let b=y>=p_?`limit-ship-hull wreck`:y>0?`limit-ship-hull breaking`:`limit-ship-hull`;return(0,U.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,U.jsx)(`pre`,{className:`sailing-ship`,style:{fontSize:`${r}px`},"aria-hidden":`true`,children:(0,U.jsx)(Ey,{scene:g,step:l?0:u,number:_,cls:b})})})}var ky=[[`five_hour`,`5-hour`],[`seven_day`,`Weekly`]],Ay=e=>ky.find(([t])=>t===e)?.[1]??e;function jy(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`${Ay(e.kind)} usage${e.account==="default"?``:` of account ${e.account}`} reached the stop at ${e.percent}%${t}: new turns are held${n}.`}function My({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,U.jsxs)(`div`,{className:`limit-stop${e.holding?` held`:``}`,children:[(0,U.jsx)(`span`,{children:wy(e,n)}),e.holding&&(0,U.jsx)(`button`,{className:`small primary`,onClick:()=>void t(()=>B.liftUsageStop(e.account,e.kind)),children:`Lift`})]})}function Ny(e){let t=[`default`,...e.accounts.map(e=>e.name)];return(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Usage stops`}),(0,U.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,U.jsx)(`code`,{children:`usageStops`}),`.`]}),t.map(n=>(0,U.jsxs)(`div`,{children:[t.length>1&&(0,U.jsx)(`strong`,{children:n==="default"?`This computer's login`:n}),ky.map(([t,r])=>{let i=e.usageStops.find(e=>e.account===n&&e.kind===t);return(0,U.jsx)(Py,{account:n,kind:t,label:r,stop:i,run:e.run},`${t}:${i?.percent??``}`)})]},n))]})}function Py(e){let[t,n]=(0,v.useState)(e.stop?String(e.stop.percent):``),r=e.stop,i=()=>void e.run(()=>B.setUsageStop(e.account,e.kind,t.trim()?Number(t):null));return(0,U.jsxs)(`div`,{className:`row`,style:{display:`flex`,gap:`0.5rem`,alignItems:`center`,flexWrap:`wrap`},children:[(0,U.jsxs)(`label`,{children:[e.label,` `,(0,U.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,U.jsx)(`button`,{className:`small`,disabled:t.trim()===(r?String(r.percent):``),onClick:i,children:`Save`}),r?.holding&&(0,U.jsx)(`button`,{className:`small primary`,onClick:()=>void e.run(()=>B.liftUsageStop(e.account,e.kind)),children:`Lift`}),(0,U.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 Fy=36e5,Iy={five_hour:5*Fy,seven_day:168*Fy};function Ly(e,t,n,r=Date.now()){let i=Iy[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 Ry(e,t,n,r=Date.now()){let i=Ly(e,t,n,r);return i==null?Iy[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 zy(e,t){if(!e)return null;let n=e.match(/^ps?:([^/]+)/);return n?n[1]:t.find(t=>t.id===e)?.project??null}function By(e,t,n,r){let i=n.find(n=>n.name===zy(e,t));return i?{account:i.account??`default`,remember:!0}:{account:r??n[0]?.account??`default`,remember:!1}}var Vy=e=>e==="default"?`Default`:e,Hy=e=>e&&e!=="default"?e:null;function Uy(e,t){return e.resetsAt!=null&&e.resetsAt<=t}function Wy(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 Gy(e,t){return t-(e.seenAt??e.at)>=36e5?Wy(e,t):null}function Ky(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 qy(e){return e==null?`—`:e>=100?`$${Math.round(e).toLocaleString(`en-US`)}`:e>=1?`$${e.toFixed(2)}`:`$${e.toFixed(3)}`}var Jy=e=>`${Math.round(e*100)}%`;function Yy(e){let t={passing:` ✓`,failing:` ✗`,running:` …`,none:``}[e.checks],n=e.state===`open`?``:` (${e.state})`;return`PR #${e.number}${t}${n}`}var Xy=[`opus-5-5`,`sonnet-5-5`,`haiku-5-5`,`fable-5-1`,`opus-5`,`sonnet-5`,`haiku-4-5`],Zy=[`user`,`answer`,`manager`,`ledung`,`unknown`],Qy={user:`You typed`,answer:`Your answer`,manager:`A manager`,ledung:`Ledung update`,unknown:`Unknown`};function $y(e,t){let n;return n=e===`model`?[...Xy,...t.filter(e=>!Xy.includes(e)).sort()]:e===`trigger`?Zy:[...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 eb({items:e}){return(0,U.jsx)(`div`,{className:`viz-legend`,children:e.map(e=>(0,U.jsxs)(`span`,{className:`viz-legend-item`,children:[(0,U.jsx)(`span`,{className:`viz-swatch${e.textured?` textured`:``}`,style:{background:e.color}}),e.label]},e.label))})}function tb({children:e}){return(0,U.jsx)(`div`,{className:`viz-tip`,role:`tooltip`,children:e})}function nb(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,U.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,U.jsxs)(`div`,{className:`viz-bars`,style:{height:r+22},onMouseLeave:()=>n(null),children:[(0,U.jsx)(`div`,{className:`viz-grid`,style:{height:r},children:o.map(e=>(0,U.jsx)(`div`,{className:`viz-gridline`,style:{bottom:`${e/a*100}%`},children:(0,U.jsx)(`span`,{children:Ky(e)})},e))}),(0,U.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,U.jsxs)(`div`,{className:`viz-col${t===o?` active`:``}`,onMouseEnter:()=>n(o),onClick:()=>n(t===o?null:o),children:[(0,U.jsx)(`div`,{className:`viz-stack`,style:{height:`${i[o]/a*100}%`},children:c.map(e=>(0,U.jsx)(`div`,{className:`viz-seg${r.textured?` textured`:``}`,style:{flexGrow:r.values[e.key],background:e.color}},e.key))}),t===o&&(0,U.jsxs)(tb,{children:[(0,U.jsx)(`strong`,{children:r.label}),r.note&&(0,U.jsx)(`div`,{className:`muted`,children:r.note}),c.slice().reverse().map(e=>(0,U.jsxs)(`div`,{className:`viz-tip-row`,children:[(0,U.jsx)(`span`,{className:`viz-swatch`,style:{background:e.color}}),` `,e.label,(0,U.jsx)(`span`,{className:`viz-tip-num`,children:Ky(r.values[e.key]??0)})]},e.key)),c.length>1&&(0,U.jsxs)(`div`,{className:`viz-tip-row total`,children:[`Total `,(0,U.jsx)(`span`,{className:`viz-tip-num`,children:Ky(i[o])})]})]}),o%s===0&&(0,U.jsx)(`span`,{className:`viz-xlabel`,children:r.short??r.label})]},o)})})]})}function rb({label:e,value:t,sub:n}){return(0,U.jsxs)(`div`,{className:`viz-tile`,children:[(0,U.jsx)(`div`,{className:`viz-tile-label`,children:e}),(0,U.jsx)(`div`,{className:`viz-tile-value`,children:t}),n&&(0,U.jsx)(`div`,{className:`viz-tile-sub`,children:n})]})}var ib={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`},ab={five_hour:`boat`,seven_day:`ship`},ob={allowed:{label:`OK`,icon:`●`,cls:`good`},allowed_warning:{label:`Close to the limit`,icon:`▲`,cls:`warning`},rejected:{label:`Limit reached`,icon:`■`,cls:`critical`}},sb=(e,t)=>Cy(e,Date.now(),t);function cb({account:e,limits:t,stops:n=[],run:r}){let i=t.filter(t=>(t.account??`default`)===e),a=(0,U.jsxs)(`div`,{className:`limits-account-name muted`,children:[Vy(e),!i.length&&` · no data yet`]});return i.length?(0,U.jsxs)(`div`,{className:`limits-account`,children:[a,(0,U.jsx)(lb,{limits:i,stops:n.filter(t=>t.account===e),run:r},e)]}):(0,U.jsx)(`div`,{className:`limits-account`,children:a})}function lb({limits:e,stops:t,run:n}){let r=Date.now();return(0,U.jsx)(`div`,{className:`limits`,children:e.map(e=>{if(Uy(e,r))return(0,U.jsxs)(`div`,{className:`limit limit-reset${ab[e.kind]?` with-ship`:``}`,title:`${ib[e.kind]??e.kind}: the window has reset since the last reading (${Wy(e,r)}). A new one comes with the next turn on this account.`,children:[(0,U.jsxs)(`div`,{className:`limit-head`,children:[(0,U.jsx)(`span`,{children:ib[e.kind]??e.kind}),(0,U.jsx)(`span`,{className:`limit-status`,children:`reset`})]}),(0,U.jsx)(`div`,{className:`limit-sub muted`,children:(0,U.jsx)(`span`,{children:`no reading since the reset`})})]},e.kind);let i=Gy(e,r),a=ob[e.status]??{label:e.status,icon:`●`,cls:`good`},o=e.utilization==null?void 0:ab[e.kind],s=o&&e.utilization!=null?Ry(e.kind,e.utilization,e.resetsAt):null,c=t.find(t=>t.kind===e.kind);return(0,U.jsxs)(`div`,{className:`limit${o?` with-ship`:``}`,title:`${ib[e.kind]??e.kind}: ${a.label}${e.utilization==null?``:`, ${Jy(e.utilization)} used`}${s?.share==null?``:`, about ${Jy(s.share)} by the reset at this pace`}. ${sb(e.resetsAt,e.kind)}. Reading ${Wy(e,r)}: Ledung hears the limits during a session's turn.`,children:[!o&&(0,U.jsxs)(`div`,{className:`limit-head`,children:[(0,U.jsx)(`span`,{children:ib[e.kind]??e.kind}),(0,U.jsxs)(`span`,{className:`limit-status ${a.cls}`,children:[a.icon,` `,e.utilization==null?a.label:Jy(e.utilization)]})]}),o&&e.utilization!=null?(0,U.jsx)(`div`,{className:`limit-ship-box`,children:(0,U.jsx)(Oy,{utilization:e.utilization,label:ib[e.kind],hull:o})}):e.utilization!=null&&(0,U.jsx)(`div`,{className:`limit-track`,children:(0,U.jsx)(`div`,{className:`limit-fill ${a.cls}`,style:{width:`${Math.min(100,e.utilization*100)}%`}})}),(0,U.jsxs)(`div`,{className:`limit-sub muted`,children:[(0,U.jsx)(`span`,{children:c&&n?``:sb(e.resetsAt,e.kind)}),s&&(s.share==null?(0,U.jsx)(`span`,{className:`limit-forecast`,title:s.why,children:`≈ — by reset`}):(0,U.jsxs)(`span`,{className:`limit-forecast${s.share>=1?` over`:``}`,children:[`≈ `,Jy(s.share),` by reset`]}))]}),i&&(0,U.jsx)(`div`,{className:`limit-sub limit-age`,children:i}),c&&n&&(0,U.jsx)(My,{stop:c,run:n})]},e.kind)})})}function ub(e){let t=[...e.sessions].sort((e,t)=>(t.endedAt??t.createdAt)-(e.endedAt??e.createdAt));return(0,U.jsxs)(`div`,{className:`waiting-view`,children:[(0,U.jsx)(`header`,{className:`session-head`,children:(0,U.jsxs)(`div`,{className:`session-head-text`,children:[(0,U.jsxs)(`h2`,{children:[`Archived · `,e.title]}),(0,U.jsx)(`div`,{className:`muted`,children:t.length?`${t.length} archived; nothing is deleted. Writing to one resumes it.`:`No archived sessions.`})]})}),(0,U.jsx)(`div`,{className:`waiting-list`,children:t.map(t=>{let n=e.overview?.sessions[t.id]?.total;return(0,U.jsxs)(`div`,{className:`archived-row`,children:[(0,U.jsxs)(`div`,{className:`archived-text`,children:[(0,U.jsx)(`button`,{className:`link`,onClick:()=>e.onOpenSession(t.id),children:t.title}),(0,U.jsxs)(`div`,{className:`muted`,children:[t.endedAt?`ended ${Og(t.endedAt)}`:`ended`,t.endReason?` · ${t.endReason}`:``,n?` · ${Ky(n)}`:``]})]}),(0,U.jsxs)(`div`,{className:`archived-actions`,children:[t.claudeSessionId&&(0,U.jsx)(`button`,{className:`primary`,onClick:()=>e.run(()=>B.resume(t.id)),children:`Resume`}),(0,U.jsx)(`button`,{onClick:()=>e.run(()=>B.unarchive(t.id)),children:`Unarchive`})]})]},t.id)})})]})}var db={merge:`merge`,devShip:`dev ship`,computerControl:`computer control`},fb=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,hour12:!1}),pb=e=>{let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`};function mb({away:e,onClick:t}){return(0,U.jsxs)(`button`,{className:`small away-marker`,title:`Away mode is on; open the session settings to end it`,onClick:t,children:[`Away until `,fb(e.until)]})}function hb({away:e,run:t}){let n=e.allow.length?e.allow.map(e=>db[e]).join(`, `):`nothing`;return(0,U.jsxs)(`div`,{className:`banner away`,role:`status`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsxs)(`strong`,{children:[`Away until `,fb(e.until)]}),` · managers may: `,n]}),(0,U.jsx)(`button`,{className:`small`,title:`End away mode now`,onClick:()=>void t(()=>B.back()),children:`Back`})]})}function gb({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,U.jsxs)(`form`,{className:`away-form`,onSubmit:e=>{e.preventDefault(),n(async()=>{await B.away(i,o),r()})},children:[(0,U.jsxs)(`label`,{children:[`Away until `,(0,U.jsx)(`input`,{type:`time`,value:i,onChange:e=>a(e.target.value),required:!0})]}),(0,U.jsxs)(`span`,{className:`away-kinds`,children:[`Managers may:`,w.map(e=>(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:o.includes(e),onChange:()=>c(e)}),` `,db[e]]},e))]}),(0,U.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,U.jsxs)(`span`,{className:`away-actions`,children:[(0,U.jsx)(`button`,{type:`submit`,className:`primary small`,children:t}),(0,U.jsx)(`button`,{type:`button`,className:`small`,onClick:r,children:`Cancel`})]})]})}function _b({away:e,run:t}){let[n,r]=(0,v.useState)(!1);if(e){let i=e.allow.length?e.allow.map(e=>db[e]).join(`, `):`nothing`;return(0,U.jsxs)(`div`,{className:`away-entry`,children:[(0,U.jsxs)(`div`,{className:`away-strip`,role:`status`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsxs)(`strong`,{children:[`Away until `,fb(e.until)]}),` · allowed: `,i]}),(0,U.jsxs)(`span`,{className:`away-actions`,children:[(0,U.jsx)(`button`,{className:`small${n?` on`:``}`,title:`Change the time or what managers may do, and stay away`,onClick:()=>r(!n),children:`Change…`}),(0,U.jsx)(`button`,{className:`small`,title:`End away mode now`,onClick:()=>{r(!1),t(()=>B.back())},children:`Back`})]})]}),n&&(0,U.jsx)(gb,{initial:{until:pb(e.until),allow:e.allow},submit:`Change`,run:t,close:()=>r(!1)})]})}return(0,U.jsxs)(`div`,{className:`away-entry`,children:[(0,U.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,U.jsx)(gb,{initial:{until:`08:00`,allow:T},submit:`Start`,run:t,close:()=>r(!1)})]})}function vb(e,t){return!!e&&t?.role!==`manager`}var yb=45;function bb({step:e,labels:t,onPick:n,children:r}){let i=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,a=t.length,o=k_(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))},yb);return()=>clearTimeout(e)},[s,o,i]),s!==o&&(l.current=o>s?`right`:`left`);let d=Wg(j_(s,a,l.current,s!==o),u.current).split(`
100
+ `);return(0,U.jsxs)(`span`,{className:`boat-slider`,style:{"--boat-width":96,"--boat-ship":6},children:[(0,U.jsxs)(`span`,{className:`boat-track`,children:[(0,U.jsxs)(`pre`,{className:`sailing-ship`,"aria-hidden":`true`,children:[d.slice(0,3).join(`
101
+ `),`
102
+ `,(0,U.jsx)(`span`,{className:`boat-water`,children:d[3]})]}),r]}),(0,U.jsx)(`span`,{className:`boat-marks`,"aria-hidden":`true`,children:t.map((t,r)=>(0,U.jsx)(`span`,{className:r+1===e?`on`:void 0,style:{"--at":(A_(r+1,a)+.5)/96},onClick:e=>{e.preventDefault(),n(r+1)},children:t},t))})]})}var xb={workflow:`workflow`,computer:`this computer`,"workflow+computer":`workflow, changed on this computer`};function Sb(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null);(0,v.useEffect)(()=>{B.profiles().then(t,e=>r(e.message))},[]);let i=(e?.groups.length??0)>1;return(0,U.jsxs)(`section`,{children:[(0,U.jsxs)(`div`,{className:`settings-h`,children:[(0,U.jsx)(`h3`,{children:`Session profiles`}),(0,U.jsx)(tm,{kind:`config`})]}),(0,U.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,U.jsx)(`p`,{className:`error`,children:n}),e?.groups.map(e=>(0,U.jsxs)(`div`,{className:`profiles-group`,children:[i&&(0,U.jsx)(`h4`,{children:e.workflow===null?`Chats and projects without a workflow's profiles`:`Workflow "${e.workflow}"`}),e.file&&(0,U.jsxs)(`p`,{className:`muted`,children:[`From `,(0,U.jsx)(`code`,{children:e.file})]}),e.warning&&(0,U.jsx)(`div`,{className:`board-warning`,role:`alert`,children:e.warning}),(0,U.jsxs)(`table`,{className:`plain`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Profile`}),(0,U.jsx)(`th`,{children:`From`}),(0,U.jsx)(`th`,{children:`About`})]})}),(0,U.jsxs)(`tbody`,{children:[(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:`full`}),(0,U.jsx)(`td`,{children:`built in`}),(0,U.jsx)(`td`,{className:`muted`,children:`Everything you have set up, as outside Ledung.`})]}),e.profiles.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.name}),(0,U.jsx)(`td`,{children:xb[e.source]}),(0,U.jsxs)(`td`,{className:`muted`,children:[e.about??``,e.allow.length>0&&(0,U.jsxs)(`div`,{children:[`Allows without asking: `,e.allow.map((e,t)=>(0,U.jsxs)(`span`,{children:[t?`, `:``,(0,U.jsx)(`code`,{children:e})]},e))]}),e.mcp.length>0&&(0,U.jsxs)(`div`,{children:[`Runs MCP servers: `,e.mcp.map((e,t)=>(0,U.jsxs)(`span`,{children:[t?`, `:``,(0,U.jsx)(`code`,{children:e})]},e))]})]})]},e.name))]})]}),(0,U.jsxs)(`p`,{className:`muted`,children:[`Default for managers: `,e.defaults.manager??`full`,` · for sessions: `,e.defaults.session??`full`,e.pluginsOff.length>0&&(0,U.jsxs)(U.Fragment,{children:[` · plugins off where installed: `,e.pluginsOff.join(`, `)]})]})]},e.workflow??``))]})}var Cb={installed:`your installed Claude Code`,path:`the Claude Code the config names`,bundled:`the copy that came with Ledung`};function wb(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?Cb[e.claudeProgram.kind]:`not recorded (started before Ledung recorded it)`,path:e.runner===`docker`?null:e.claudeProgram?.path??null,version:e.claudeVersion}))}function Tb(e,t){let n=[t.getHours(),t.getMinutes(),t.getSeconds()].map(e=>String(e).padStart(2,`0`)).join(`:`);return e?`Checked again at ${n}: still the same.`:`Checked again at ${n}: no problem found.`}function Eb(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 Db({check:e,primary:t=!0}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null),o=async()=>{r(!0),a(null);try{a(Tb(await e(),new Date))}catch(e){a(`Couldn't check: ${e.message}`)}finally{r(!1)}};return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{className:t?`small primary`:`small`,disabled:n,"aria-busy":n,onClick:()=>void o(),children:n?`Checking…`:`Check again`}),i&&(0,U.jsx)(`span`,{className:`muted`,role:`status`,children:i})]})}function Ob({text:e}){return(0,U.jsx)(U.Fragment,{children:Eb(e).map((e,t)=>e.kind===`code`?(0,U.jsx)(`code`,{children:e.text},t):e.kind===`link`?(0,U.jsx)(`a`,{href:e.text,target:`_blank`,rel:`noreferrer`,children:e.text},t):e.text)})}function kb({looked:e}){return(0,U.jsxs)(`details`,{className:`looked`,children:[(0,U.jsxs)(`summary`,{children:[`Where Ledung looked (`,e.length,`)`]}),(0,U.jsx)(`ul`,{className:`mono`,children:e.map(e=>(0,U.jsx)(`li`,{children:e},e))})]})}var Ab=e=>e.charAt(0).toUpperCase()+e.slice(1);function jb({sessions:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),a=()=>B.claudeCode().then(e=>(n(e),i(null),e),e=>{throw i(e.message),e});(0,v.useEffect)(()=>{a().catch(()=>{})},[]);let o=wb(e),s=t?.program;return(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Claude Code`}),(0,U.jsxs)(`p`,{className:`muted`,children:[`Ledung runs your Claude Code: the `,(0,U.jsx)(`code`,{children:`claude`}),` on the PATH or where its installer puts it, else the Claude desktop app's own copy`,t?.required&&(0,U.jsxs)(U.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,U.jsx)(`p`,{className:`error`,children:r}),t?.problem&&(0,U.jsx)(`div`,{className:`board-warning`,role:`alert`,children:(0,U.jsx)(Ob,{text:t.problem})}),t&&(0,U.jsx)(`table`,{className:`plain`,children:(0,U.jsxs)(`tbody`,{children:[(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`New sessions run`}),(0,U.jsx)(`td`,{children:s?(0,U.jsxs)(U.Fragment,{children:[Ab(s.app?`the Claude desktop app's own Claude Code`:Cb[s.kind]),` `,s.version&&(0,U.jsxs)(U.Fragment,{children:[`· `,s.version]}),(0,U.jsx)(`div`,{className:`muted mono`,children:s.path})]}):`Nothing: sessions don't start`})]}),t.installed&&t.installed.path!==s?.path&&(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Found`}),(0,U.jsxs)(`td`,{children:[Ab(t.installed.app?`the Claude desktop app's own Claude Code`:Cb[t.installed.kind]),` · `,t.installed.version??`version unknown`,(0,U.jsx)(`div`,{className:`muted mono`,children:t.installed.path})]})]})]})}),t?.looked&&t.looked.length>0&&(0,U.jsx)(kb,{looked:t.looked}),(0,U.jsx)(`p`,{children:(0,U.jsx)(Db,{primary:!1,check:async()=>!!(await a()).problem})}),o.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h4`,{children:`Running sessions`}),(0,U.jsxs)(`table`,{className:`plain`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Session`}),(0,U.jsx)(`th`,{children:`Runs`}),(0,U.jsx)(`th`,{children:`Version`})]})}),(0,U.jsx)(`tbody`,{children:o.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsxs)(`td`,{children:[e.title,(0,U.jsx)(`div`,{className:`muted`,children:e.project})]}),(0,U.jsxs)(`td`,{children:[Ab(e.runs),e.path&&(0,U.jsx)(`div`,{className:`muted mono`,children:e.path})]}),(0,U.jsx)(`td`,{className:`mono`,children:e.version??``})]},e.id))})]})]})]})}function Mb(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 Nb=7,Pb=864e5;function Fb(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<Nb*Pb,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 ${Nb} 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 Ib=function(e,t){let n=e,r=Rb[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=Bb.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=Bb.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=Bb.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=Bb.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=Bb.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=Bb.getErrorCorrectPolynomial(l),d=Hb(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=Ub.getRSBlocks(e,t),i=Wb();for(let t=0;t<n.length;t+=1){let r=n[t];i.put(r.getMode(),4),i.put(r.getLength(),Bb.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=Gb(e);break;case`Alphanumeric`:n=Kb(e);break;case`Byte`:n=qb(e);break;case`Kanji`:n=Jb(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=Ub.getRSBlocks(e,r),n=Wb();for(let t=0;t<s.length;t++){let r=s[t];n.put(r.getMode(),4),n.put(r.getLength(),Bb.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 $b(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+=`
103
+ `}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+`
104
+ `}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};Ib.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},Ib.createStringToBytes=function(e,t){let n=function(){let n=Zb(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 Lb={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Rb={L:1,M:0,Q:3,H:2},zb={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Bb=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 zb.PATTERN000:return function(e,t){return(e+t)%2==0};case zb.PATTERN001:return function(e,t){return e%2==0};case zb.PATTERN010:return function(e,t){return t%3==0};case zb.PATTERN011:return function(e,t){return(e+t)%3==0};case zb.PATTERN100:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case zb.PATTERN101:return function(e,t){return e*t%2+e*t%3==0};case zb.PATTERN110:return function(e,t){return(e*t%2+e*t%3)%2==0};case zb.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=Hb([1],0);for(let n=0;n<e;n+=1)t=t.multiply(Hb([1,Vb.gexp(n)],0));return t},r.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case Lb.MODE_NUMBER:return 10;case Lb.MODE_ALPHA_NUM:return 9;case Lb.MODE_8BIT_BYTE:return 8;case Lb.MODE_KANJI:return 8;default:throw`mode:`+e}else if(t<27)switch(e){case Lb.MODE_NUMBER:return 12;case Lb.MODE_ALPHA_NUM:return 11;case Lb.MODE_8BIT_BYTE:return 16;case Lb.MODE_KANJI:return 10;default:throw`mode:`+e}else if(t<41)switch(e){case Lb.MODE_NUMBER:return 14;case Lb.MODE_ALPHA_NUM:return 13;case Lb.MODE_8BIT_BYTE:return 16;case Lb.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}(),Vb=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}(),Hb=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]^=Vb.gexp(Vb.glog(r.getAt(n))+Vb.glog(e.getAt(i)));return Hb(t,0)},r.mod=function(e){if(r.getLength()-e.getLength()<0)return r;let t=Vb.glog(r.getAt(0))-Vb.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]^=Vb.gexp(Vb.glog(e.getAt(r))+t);return Hb(n,0).mod(e)},r},Ub=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 Rb.L:return e[(t-1)*4+0];case Rb.M:return e[(t-1)*4+1];case Rb.Q:return e[(t-1)*4+2];case Rb.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}(),Wb=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},Gb=function(e){let t=Lb.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},Kb=function(e){let t=Lb.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},qb=function(e){let t=Lb.MODE_8BIT_BYTE,n=Ib.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},Jb=function(e){let t=Lb.MODE_KANJI,n=Ib.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},Yb=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},Xb=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},Zb=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},Qb=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=Yb(),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},$b=function(e,t,n){let r=Qb(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=Yb();r.write(i);let a=Xb(),o=i.toByteArray();for(let e=0;e<o.length;e+=1)a.writeByte(o[e]);return a.flush(),`data:image/gif;base64,`+a};Ib.stringToBytes;var ex=/^[0-9A-Z $%*+\-./:]*$/,tx=.3,nx=e=>e.toUpperCase();function rx(e){let t=Ib(0,`H`);t.addData(e,ex.test(e)?`Alphanumeric`:`Byte`),t.make();let n=t.getModuleCount(),r=Math.floor(n*tx);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 ix(e){return e.secure&&e.serviceWorker&&e.pushManager?`yes`:/iPhone|iPad|iPod/.test(e.userAgent)&&!e.standalone?`home-screen`:`no`}var ax=()=>ix({secure:window.isSecureContext,serviceWorker:`serviceWorker`in navigator,pushManager:`PushManager`in window,userAgent:navigator.userAgent,standalone:navigator.standalone===!0||matchMedia(`(display-mode: standalone)`).matches});function ox(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 sx(e,t){return!e||e.byteLength!==t.length?!1:new Uint8Array(e).every((e,n)=>e===t[n])}async function cx(){return await navigator.serviceWorker.register(`/sw.js`,{scope:`/`}),navigator.serviceWorker.ready}async function lx(){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 B.pushState(),t=await cx(),n=ox(e),r=await t.pushManager.getSubscription();r&&!sx(r.options.applicationServerKey,n)&&(await r.unsubscribe(),r=null),r??=await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:n}),await B.pushOn(r.toJSON())}async function ux(){await B.pushOff(),await(await(await navigator.serviceWorker.getRegistration(`/`))?.pushManager.getSubscription())?.unsubscribe()}async function dx(){let{on:e}=await B.pushState();return e?!!await(await navigator.serviceWorker.getRegistration(`/`))?.pushManager.getSubscription():!1}function fx(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 px=e=>e?new Date(e).toLocaleString():`never`;function mx({text:e}){let{n:t,dark:n,logo:r}=rx(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,U.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,U.jsx)(`rect`,{width:t+8,height:t+8,fill:`#fff`}),(0,U.jsx)(`path`,{d:i.join(``),fill:`#000`}),(0,U.jsx)(`image`,{href:`/icon.svg?v=2`,x:a,y:a,width:o,height:o})]})}function hx({run:e,linked:t=!1}){let[n,r]=(0,v.useState)(null);return(0,v.useEffect)(()=>{B.thisDevice().then(r,()=>r({remote:!1}))},[]),n?(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Phones`}),n.remote?(0,U.jsx)(gx,{device:n.device,mayAddPasskey:n.mayAddPasskey,unlockedUntil:n.unlockedUntil,linked:t,run:e,onChange:()=>B.thisDevice().then(r)}):(0,U.jsx)(bx,{run:e})]}):null}function gx(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,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`muted`,children:[`This device is paired as `,(0,U.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,U.jsxs)(U.Fragment,{children:[(0,U.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,U.jsx)(`p`,{children:a?(0,U.jsx)(U.Fragment,{children:`🔓 Logged on: changes need nothing more until you log out, or until 14 days without use.`}):(0,U.jsx)(U.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,U.jsx)(`button`,{onClick:()=>void e.run(async()=>{await B.logOutDevice(),e.onChange()}),children:`Log out`}):(0,U.jsx)(`button`,{onClick:()=>void e.run(async()=>{await B.unlockDevice(),e.onChange()}),children:`Log on`}),Bt()&&(0,U.jsx)(vx,{linked:e.linked})]}):t.passkey?(0,U.jsxs)(U.Fragment,{children:[(0,U.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,U.jsx)(`p`,{children:a?(0,U.jsxs)(U.Fragment,{children:[`🔓 Unlocked for changes until `,new Date(n).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),`.`]}):(0,U.jsx)(U.Fragment,{children:`🔒 Locked: from here you can look, not change anything. Unlocking takes the passkey once and lasts 30 minutes.`})}),!a&&(0,U.jsx)(`button`,{onClick:()=>void e.run(async()=>{await B.unlockDevice(),e.onChange()}),children:`Unlock`}),Bt()?(0,U.jsx)(vx,{linked:e.linked}):(0,U.jsx)(yx,{run:e.run,onChange:e.onChange})]}):e.mayAddPasskey&&Bt()?(0,U.jsx)(_x,{run:e.run,onChange:e.onChange}):e.mayAddPasskey?(0,U.jsxs)(U.Fragment,{children:[(0,U.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,U.jsx)(`button`,{onClick:()=>void e.run(async()=>{await B.addPasskey(),e.onChange()}),children:`Set up passkey`})]}):(0,U.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 _x({run:e,onChange:t}){let[n,r]=(0,v.useState)(null);return(0,v.useEffect)(()=>{if(!n)return;let e=setInterval(()=>{B.thisDevice().then(e=>{e.remote&&e.device.passkey&&t()},()=>{}),Date.now()>n.expiresAt&&r(null)},2e3);return()=>clearInterval(e)},[n,t]),(0,U.jsxs)(U.Fragment,{children:[(0,U.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,U.jsxs)(`p`,{children:[(0,U.jsx)(`a`,{className:`button-link`,href:n.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open the passkey window`}),` `,(0,U.jsx)(`span`,{className:`muted`,children:`· then come back here`})]}):(0,U.jsx)(`button`,{onClick:()=>void e(async()=>r(await B.passkeyEnrolLink())),children:`Set up passkey`})]})}function vx({linked:e}){return(0,U.jsx)(`p`,{className:`muted push-switch framed-push`,children:fx(e)})}function yx({run:e,onChange:t}){let n=ax(),[r,i]=(0,v.useState)(null);if((0,v.useEffect)(()=>{n===`yes`&&dx().then(i,()=>i(!1))},[n]),n===`home-screen`)return(0,U.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,U.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?lx():ux()),i(n)}finally{t()}});return(0,U.jsxs)(`div`,{className:`push-switch`,children:[(0,U.jsxs)(`label`,{className:`toggle`,title:`A notification on this phone when something new waits for you, even with Ledung closed`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>a(e.target.checked)}),` Push notifications to this phone`]}),(0,U.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 bx({run:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(Date.now()),s=()=>B.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,U.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,U.jsxs)(U.Fragment,{children:[(0,U.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,U.jsx)(`p`,{className:`muted`,children:`No paired devices.`}),t.devices.map(t=>(0,U.jsxs)(`div`,{className:`device-row`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`b`,{children:t.name}),` `,(0,U.jsxs)(`span`,{className:`muted`,children:[`· `,t.kind===`computer`?`computer`:`phone`,` · paired `,t.pairedVia?`through the link from ${t.pairedVia} `:``,px(t.createdAt),` · last used `,px(t.lastUsedAt),` · `,t.passkey?`passkey added ${px(t.passkeyAt)}`:`no passkey`]})]}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>void e(async()=>{await B.revokeDevice(t.id),await s()}),children:`Revoke`})]},t.id)),c?(0,U.jsxs)(`div`,{className:`pairing`,children:[c.kind===`phone`&&(0,U.jsx)(mx,{text:nx(c.url)}),c.kind===`computer`?(0,U.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,U.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,U.jsx)(`p`,{className:`pair-code`,children:(0,U.jsx)(`b`,{children:new URL(c.url).pathname.split(`/`).pop().toUpperCase()})}),(0,U.jsx)(`code`,{className:`pair-link`,children:c.url})]}):(0,U.jsx)(`p`,{className:`device-pair-buttons`,children:[`phone`,`computer`].map(n=>(0,U.jsx)(`button`,{onClick:()=>void e(async()=>{let e=await B.pairDevice(n);o(Date.now()),i({...e,before:t.devices.length})}),children:n===`phone`?`Pair a phone`:`Pair a computer`},n))})]})}var xx=e=>e?new Date(e).toLocaleString():`never`;function Sx({run:e}){let t=H(),[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=()=>B.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,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Linked computers`}),n.problem?(0,U.jsx)(`p`,{className:`muted`,children:n.problem}):(0,U.jsxs)(U.Fragment,{children:[(0,U.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,U.jsx)(`p`,{className:`muted`,children:`No linked computers.`}),n.links.map(t=>(0,U.jsxs)(`div`,{className:`device-row`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`b`,{children:t.name}),` `,(0,U.jsxs)(`span`,{className:`muted`,children:[`· `,t.publicName,` · linked `,xx(t.linkedAt),` · last heard from `,xx(t.lastUsedAt)]})]}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>void e(async()=>{await B.unlink(t.id),await f()}),children:`Unlink`})]},t.id)),p?(0,U.jsxs)(`div`,{className:`pairing`,children:[(0,U.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,U.jsx)(`code`,{className:`pair-link`,children:p.code}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>void navigator.clipboard?.writeText(p.code),children:`Copy`})]}):(0,U.jsx)(`button`,{onClick:()=>void e(async()=>{let e=await B.linkCode();d(Date.now()),a({...e,before:n.links.length})}),children:`Link a computer`}),(0,U.jsxs)(`div`,{className:`link-join`,children:[(0,U.jsx)(`p`,{className:`muted`,children:`Or link with a code made on the other computer:`}),(0,U.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,U.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,U.jsx)(`button`,{disabled:!o.trim(),onClick:()=>void e(async()=>{await B.joinLink(o.trim(),c.trim()),s(``),l(``),await f()}),children:`Link`})]})]})]})}function Cx({computers:e,run:t}){return e.length?(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Computers`}),(0,U.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,U.jsx)(wx,{computer:e,run:t},e.id))]}):null}function wx({computer:e,run:t}){let n=H(),[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(()=>B.editComputer(e.id,{name:r.trim()||null})),c=e.here?`${e.name} (this computer)`:e.name;return(0,U.jsxs)(`div`,{className:`computer-row`,role:`group`,"aria-label":`Computer ${c}`,children:[(0,U.jsxs)(`div`,{className:`computer-name`,children:[(0,U.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,U.jsx)(`button`,{className:`small primary`,onClick:()=>void s(),children:`Save`}),e.here&&(0,U.jsx)(`span`,{className:`muted`,children:`This computer`}),a&&!o&&(0,U.jsx)(`button`,{className:`small`,title:`Back to ${e.config.name} in ${Tt[e.config.colour].label.toLowerCase()}, as the config has it`,onClick:()=>void t(()=>B.editComputer(e.id,{name:null,colour:null})),children:`Use the config's`})]}),(0,U.jsx)(`div`,{className:`swatches`,children:Dt.map(n=>(0,U.jsx)(`button`,{type:`button`,className:`swatch${e.colour===n?` on`:``}`,"aria-pressed":e.colour===n,title:Tt[n].label,"aria-label":`${c}: ${Tt[n].label}`,onClick:()=>void t(()=>B.editComputer(e.id,{colour:n})),children:(0,U.jsx)(mp,{colour:n,children:`●`})},n))})]})}function Tx(e){let t=/^(\d+)\.(\d+)\.0$/.exec(e);return t?t[2]===`0`?`v${t[1]}`:`v${t[1]}.${t[2]}`:`v${e}`}var Ex=new Set,Dx=ut(localStorage),Ox=e=>{Dx=e;for(let e of Ex)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.statusDot`||e.key===null)&&Ox(ut(localStorage))});var kx=e=>(Ex.add(e),()=>{Ex.delete(e)}),Ax=()=>Dx;function jx(){return[(0,v.useSyncExternalStore)(kx,Ax),e=>{dt(ln,e),Ox(e)}]}var Mx=new Set,Nx=xt(localStorage),Px=e=>{Nx=e;for(let e of Mx)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.compactSidebar`||e.key===null)&&Px(xt(localStorage))});var Fx=e=>(Mx.add(e),()=>{Mx.delete(e)}),Ix=()=>Nx;function Lx(){return[(0,v.useSyncExternalStore)(Fx,Ix),e=>{St(ln,e),Px(e)}]}var Rx=new Set,zx=mt(localStorage),Bx=e=>{zx=e;for(let e of Rx)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.archivedLink`||e.key===null)&&Bx(mt(localStorage))});var Vx=e=>(Rx.add(e),()=>{Rx.delete(e)}),Hx=()=>zx;function Ux(){return[(0,v.useSyncExternalStore)(Vx,Hx),e=>{ht(ln,e),Bx(e)}]}var Wx=`ledung.installDismissed`,Gx=(e,t)=>/Macintosh/.test(e)&&/Safari\//.test(e)&&!/Chrome|Chromium|CriOS|Edg|OPR|Firefox|FxiOS/.test(e)&&t<=1,Kx=(e,t)=>/iPhone|iPad|iPod/.test(e)||/Macintosh/.test(e)&&t>1,qx=e=>/Chrome|Chromium|Edg\//.test(e);function Jx(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.`}:Gx(e.userAgent,e.maxTouchPoints)?{kind:`dock`}:Kx(e.userAgent,e.maxTouchPoints)?{kind:`none`,reason:`On an iPhone or iPad, use Share → Add to Home Screen in Safari.`}:e.secure?qx(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 Yx(e){try{return e.getItem(Wx)===`1`}catch{return!1}}function Xx(e){try{e.setItem(Wx,`1`)}catch{}}var Zx=(e,t)=>!t&&e.kind!==`none`,Qx=matchMedia(`(display-mode: standalone)`),$x=null,eS=!1,tS=!1,nS=Yx(localStorage),rS=new Set,iS=()=>Jx({standalone:Qx.matches||navigator.standalone===!0,installed:eS,offer:$x!==null,refused:tS,framed:Bt(),secure:window.isSecureContext,userAgent:navigator.userAgent,maxTouchPoints:navigator.maxTouchPoints??0}),aS={install:iS(),notice:!1},oS=()=>{let e=iS();aS={install:e,notice:Zx(e,nS)};for(let e of rS)e()};aS.notice=Zx(aS.install,nS),window.addEventListener(`beforeinstallprompt`,e=>{e.preventDefault(),$x=e,tS=!1,oS()}),window.addEventListener(`appinstalled`,()=>{eS=!0,$x=null,oS()}),Qx.addEventListener(`change`,oS),window.addEventListener(`storage`,e=>{(e.key===`ledung.installDismissed`||e.key===null)&&(nS=Yx(localStorage),oS())});var sS=e=>(rS.add(e),()=>{rS.delete(e)}),cS=()=>aS;async function lS(){let e=$x;e&&($x=null,await e.prompt(),(await e.userChoice).outcome===`accepted`?eS=!0:tS=!0,oS())}var uS=()=>{Xx(localStorage),nS=!0,oS()};function dS(){return{...(0,v.useSyncExternalStore)(sS,cS),onInstall:lS,onDismiss:uS}}var fS=(0,U.jsxs)(U.Fragment,{children:[`In Safari, choose `,(0,U.jsx)(`b`,{children:`File → Add to Dock`}),`.`]});function pS({app:e,run:t}){return(0,U.jsxs)(`div`,{className:`banner install`,children:[(0,U.jsxs)(`span`,{children:[`Ledung can run as an app, in a window of its own.`,e.install.kind===`dock`&&(0,U.jsxs)(U.Fragment,{children:[` `,fS]})]}),e.install.kind===`button`&&(0,U.jsx)(`button`,{className:`small primary`,onClick:()=>void t(e.onInstall),children:`Install as app`}),(0,U.jsx)(`button`,{className:`small`,onClick:e.onDismiss,children:`Not now`})]})}function mS({run:e}){let t=dS(),{install:n}=t;return n.kind===`none`&&!n.reason?null:(0,U.jsxs)(`section`,{children:[(0,U.jsxs)(`div`,{className:`settings-h`,children:[(0,U.jsx)(`h3`,{children:`App`}),(0,U.jsx)(tm,{kind:`browser`})]}),(0,U.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,U.jsx)(`button`,{className:`primary`,onClick:()=>void e(t.onInstall),children:`Install as app`}),n.kind===`dock`&&(0,U.jsx)(`p`,{children:fS}),n.kind===`none`&&(0,U.jsx)(`p`,{className:`muted`,children:n.reason})]})}function hS(e,t){return!!e&&!t&&e.available&&!e.asked&&e.places.length>0&&!e.places.some(e=>e.present)}function gS(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 _S(e){return e.kind===`mac`?`Add a Ledung icon to ${gS(e)}?`:`Add a Ledung icon to your ${gS(e)}?`}var vS={desktop:`on your Desktop`,"start-menu":`in the Start menu`,applications:`in Applications`};function yS(e){let t=e.places.map(e=>vS[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 bS=`It opens this page, and starts Ledung first if it isn't running.`,xS=null,SS=null,CS=new Set,wS=e=>{xS=e;for(let e of CS)e()};function TS(){return SS??=B.shortcuts().then(wS,()=>wS(null)),SS}var ES=e=>(CS.add(e),()=>{CS.delete(e)});function DS(){return(0,v.useEffect)(()=>void TS(),[]),{view:(0,v.useSyncExternalStore)(ES,()=>xS),act:async e=>wS(await B.shortcutsAct(e))}}function OS({run:e}){let{view:t,act:n}=DS(),[r,i]=(0,v.useState)(!1);if(!t||!hS(t,Bt()))return null;let a=t=>e(async()=>{await n(t),r&&await n(`sign-in-on`)});return(0,U.jsxs)(`div`,{className:`banner install`,children:[(0,U.jsxs)(`span`,{children:[_S(t),` `,bS]}),t.signIn.available&&!t.signIn.on&&(0,U.jsxs)(`label`,{className:`toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>i(e.target.checked)}),` `,t.signIn.label]}),(0,U.jsx)(`button`,{className:`small primary`,onClick:()=>void a(`add`),children:`Yes`}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>void a(`decline`),children:`No`})]})}function kS({run:e}){let{view:t,act:n}=DS();if(!t)return null;let r=t.places.filter(e=>!e.present),i=t.places.filter(e=>e.present);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Shortcuts`}),t.available?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`muted`,children:[yS(t),` `,bS,` Ledung then runs in the background, with no window; Stop Ledung below stops it.`]}),(0,U.jsx)(`ul`,{className:`shortcut-places`,children:t.places.map(e=>(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`b`,{children:e.label}),` `,(0,U.jsx)(`span`,{className:`muted`,children:e.present?`added`:`not there`})]},e.id))}),(0,U.jsxs)(`div`,{className:`restart-confirm`,children:[r.length>0&&(0,U.jsx)(`button`,{className:`small primary`,onClick:()=>void e(()=>n(`add`)),children:`Add shortcuts`}),i.length>0&&(0,U.jsx)(`button`,{className:`small`,onClick:()=>void e(()=>n(`remove`)),children:`Remove`})]})]}):(0,U.jsx)(`p`,{className:`muted`,children:t.reason})]}),(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Start at sign-in`}),t.signIn.available?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`label`,{className:`toggle`,title:t.signIn.file??void 0,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:t.signIn.on,onChange:t=>void e(()=>n(t.target.checked?`sign-in-on`:`sign-in-off`))}),` `,t.signIn.label]}),(0,U.jsxs)(`p`,{className:`muted`,children:[`Ledung starts in the background, without opening its page; open it with the icon or the `,(0,U.jsx)(`code`,{children:`ledung`}),` command. Only for you, and no administrator rights are needed.`]})]}):(0,U.jsx)(`p`,{className:`muted`,children:t.signIn.reason})]}),(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Log`}),(0,U.jsxs)(`p`,{className:`muted`,children:[t.log.active?`This Ledung runs in the background; what it says goes to`:`Started in the background, Ledung writes what it says to`,` `,(0,U.jsx)(`code`,{children:t.log.file}),t.log.active?`.`:`. This one was started in a terminal or window, so it says it there.`]})]})]})}function AS(){let{view:e}=DS(),[t,n]=(0,v.useState)(`idle`);return!e||Bt()?null:(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Stop Ledung`}),(0,U.jsxs)(`p`,{className:`muted`,children:[`Stops Ledung and its sessions; resume a session after the next start to continue it. Start Ledung again with its icon or the `,(0,U.jsx)(`code`,{children:`ledung`}),` command.`]}),t===`stopped`?(0,U.jsx)(`p`,{children:`Ledung has stopped. This page stays as it was until Ledung runs again.`}):t===`confirming`?(0,U.jsxs)(`span`,{className:`restart-confirm`,children:[(0,U.jsx)(`span`,{className:`muted`,children:`Running sessions stop.`}),(0,U.jsx)(`button`,{className:`small primary`,onClick:async()=>{try{await B.stopLedung(),n(`stopped`)}catch{n(`failed`)}},children:`Stop Ledung`}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>n(`idle`),children:`Cancel`})]}):(0,U.jsxs)(`span`,{className:`restart-confirm`,children:[t===`failed`&&(0,U.jsx)(`span`,{className:`restart-problem`,children:`Ledung refused to stop.`}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>n(`confirming`),children:`Stop Ledung`})]})]})}function jS(e){return e===`token`?`Signed in with a long-lived token`:e===`login`?`Signed in with /login`:e===`key`?`Signed in with an API key`:e===`other`?`Signed in`:`Not signed in, or not checked yet`}function MS(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 ${Og(e.seenAt)})`:``)}function NS({text:e}){return(0,U.jsxs)(`div`,{className:`sign-in-command`,children:[(0,U.jsx)(`code`,{className:`remote-record`,children:e}),` `,(0,U.jsx)(kf,{text:e})]})}function PS({command:e}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`muted`,children:[`With a long-lived token: get one with `,(0,U.jsx)(`span`,{className:`mono`,children:`claude setup-token`}),`, then run this in your own terminal on this computer and paste it. It goes straight into Claude Code's sign-in; Ledung never receives it.`]}),(0,U.jsx)(NS,{text:e})]})}function FS(e){let t=H(),[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,U.jsxs)(`select`,{value:e.choices[t]??``,onChange:n=>void e.run(()=>B.setAccountChoices({[t]:n.target.value||null})),children:[(0,U.jsx)(`option`,{value:``,children:`default: this computer's own login`}),e.accounts.map(e=>(0,U.jsxs)(`option`,{value:e.name,children:[e.name,e.email?` (${e.email})`:``]},e.name))]});return(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Accounts`}),(0,U.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,U.jsx)(`span`,{className:`mono`,children:`claudeAccounts`}),` in the config file (see ledung.config.example.json).`]}),e.configFileProblems.map(e=>(0,U.jsx)(`div`,{className:`banner`,children:e},e)),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`table`,{className:`plain`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Account`}),(0,U.jsx)(`th`,{children:`Logged in as`}),(0,U.jsx)(`th`,{children:`Used by`}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[(0,U.jsxs)(`tr`,{children:[(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`strong`,{children:`default`}),(0,U.jsx)(`div`,{className:`muted`,children:`this computer's own Claude Code login`})]}),(0,U.jsxs)(`td`,{children:[MS(e.defaultIdentity),(0,U.jsx)(`div`,{className:`muted`,children:jS(e.defaultIdentity?.signInKind)})]}),(0,U.jsx)(`td`,{children:c(null)}),(0,U.jsx)(`td`,{})]}),e.accounts.map(t=>(0,U.jsxs)(v.Fragment,{children:[(0,U.jsxs)(`tr`,{children:[(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`strong`,{children:t.name}),t.whatItIsFor&&(0,U.jsx)(`div`,{children:t.whatItIsFor}),t.inConfigFile&&(0,U.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,U.jsxs)(`div`,{className:`muted`,children:[`sign-in folder `,(0,U.jsx)(`span`,{className:`mono`,children:t.configDir})]}),(0,U.jsxs)(`div`,{className:`muted`,children:[`in containers `,(0,U.jsx)(`span`,{className:`mono`,children:t.containerDir??`~/.ledung-accounts/${t.name}`})]})]}),(0,U.jsxs)(`td`,{children:[MS(t),(0,U.jsx)(`div`,{className:`muted`,children:jS(t.signInKind)})]}),(0,U.jsx)(`td`,{children:c(t.name)}),(0,U.jsxs)(`td`,{className:`account-actions`,children:[(0,U.jsx)(`button`,{className:`small`,disabled:e.remote,title:e.remote?`Only on the computer Ledung runs on`:`Show ${t.configDir}`,onClick:()=>void e.run(()=>B.openAccountFolder(t.name)),children:`Open folder`}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>void e.run(()=>B.removeAccount(t.name)),children:`Remove`})]})]}),(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{colSpan:4,children:(0,U.jsxs)(`details`,{children:[(0,U.jsx)(`summary`,{className:`muted`,children:`Sign in, or change how it is signed in`}),t.loginCommand&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`muted`,children:[`With Claude Code's own `,(0,U.jsx)(`span`,{className:`mono`,children:`/login`}),`: run this in a terminal on this computer, then type `,(0,U.jsx)(`span`,{className:`mono`,children:`/login`}),`.`]}),(0,U.jsx)(NS,{text:t.loginCommand})]}),t.tokenCommand&&(0,U.jsx)(PS,{command:t.tokenCommand}),(0,U.jsxs)(`p`,{className:`muted`,children:[`Either one replaces the sign-in that is there. For a project in a container, sign in inside the container with `,(0,U.jsx)(`span`,{className:`mono`,children:`/login`}),`.`]})]})})})]},t.name))]})]}),(0,U.jsxs)(`p`,{children:[(0,U.jsx)(`button`,{className:`small`,onClick:()=>void e.run(()=>B.checkSignIn()),children:`Check again`}),` `,(0,U.jsx)(`span`,{className:`muted`,children:`after signing in from a terminal, to see it here`})]}),(0,U.jsxs)(`div`,{className:`form`,children:[(0,U.jsxs)(`label`,{children:[`Account for chats `,(0,U.jsx)(`span`,{className:`muted`,children:`(new chats run on it; a running chat keeps its account until it restarts)`}),l(`chats`)]}),(0,U.jsxs)(`label`,{children:[`Account for new projects `,(0,U.jsx)(`span`,{className:`muted`,children:`(chosen for you in Add project)`}),l(`newProjects`)]})]}),(0,U.jsx)(`h4`,{children:`Add an account`}),(0,U.jsxs)(`div`,{className:`form`,children:[(0,U.jsxs)(`label`,{children:[`Name `,(0,U.jsx)(`span`,{className:`muted`,children:`(e.g. personal, work)`}),(0,U.jsx)(`input`,{...t,value:n,onChange:e=>r(e.target.value),maxLength:32})]}),(0,U.jsxs)(`label`,{children:[`Sign-in folder in containers `,(0,U.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,U.jsx)(`input`,{...t,value:i,onChange:e=>a(e.target.value),className:`mono`,placeholder:`~/.ledung-accounts/name`})]}),(0,U.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,U.jsx)(`span`,{className:`mono`,children:`/login`}),` as shown (for a container project, inside the container), or put in a long-lived token with the command shown. Ledung never sees or keeps a sign-in token.`]}),(0,U.jsx)(`button`,{className:`primary`,disabled:!n.trim(),onClick:()=>void e.run(async()=>{s(await B.addAccount({name:n.trim(),...i.trim()?{containerDir:i.trim()}:{}})),a(``),r(``)}),children:`Add account`})]}),o&&(0,U.jsxs)(`div`,{className:`banner`,children:[`Added `,(0,U.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. With Claude Code's own `,(0,U.jsx)(`span`,{className:`mono`,children:`/login`}),`: run this in a terminal on this computer, then type `,(0,U.jsx)(`span`,{className:`mono`,children:`/login`}),` and sign in with this account.`,o.loginCommand&&(0,U.jsx)(NS,{text:o.loginCommand}),`For a container project, the same inside the container:`,(0,U.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'`}),o.tokenCommand&&(0,U.jsx)(PS,{command:o.tokenCommand})]})]})]})}var IS=4e3,LS=[`Ctrl`,`Alt`,`Shift`,`Cmd`],RS=/^(?:(?:Ctrl|Alt|Shift|Cmd)\+)+(?:[A-Z]|[0-9])$/;function zS(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 BS(e){if(!RS.test(e))return!1;let t=e.split(`+`).slice(0,-1);return t.every((e,n)=>n===0||LS.indexOf(e)>LS.indexOf(t[n-1]))}function VS(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 HS(e,t,n){if(!BS(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 US(e,t,n=3){let r=[];for(let i of`123456789`){let a=`Ctrl+Shift+${i}`;if(HS(a,e,t)||r.push(a),r.length===n)break}return r}function WS(e,t){return e.filter(e=>e.project===null||e.project===t)}var GS=[`issue`,`branch`,`pr`,`project`,`session`];function KS(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 qS(e,t,n){return!(n?!e.send:e.send)||t.missing.length||t.text.trimStart().startsWith(`!`)?`insert`:`send`}function JS(e,t,n){let r=e.slice(),[i]=r.splice(t,1);return r.splice(n,0,i),r}function YS(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 ${IS} 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=HS(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 XS=()=>typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent);function ZS(e,t){let n=e.send?`Sends`:`Puts in the message box`,r=e.key?` · ${VS(e.key,t)}`:``;return`${n}: ${e.text}${r}\nShift+click: ${e.send?`put it in the message box`:`send it`}`}function QS(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=XS();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,U.jsxs)(`span`,{className:`macro-bar`,ref:i,children:[(0,U.jsx)(`span`,{className:`macro-chips`,ref:r,children:t.map((e,t)=>(0,U.jsxs)(`button`,{className:`board-chip macro-chip`,title:ZS(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,U.jsx)(`span`,{className:`macro-send`,"aria-label":`sends`,children:` ↵`})]},e.id))}),(0,U.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,U.jsxs)(`div`,{className:`macro-menu`,role:`menu`,children:[u.map(e=>(0,U.jsxs)(`button`,{role:`menuitem`,title:ZS(e,l),onClick:t=>d(e,t.shiftKey),children:[(0,U.jsxs)(`span`,{children:[e.name,e.send&&(0,U.jsx)(`span`,{className:`macro-send`,children:` ↵`})]}),e.key?(0,U.jsx)(`kbd`,{children:VS(e.key,l)}):(0,U.jsx)(`span`,{})]},e.id)),u.length>0&&(0,U.jsx)(`hr`,{}),(0,U.jsx)(`button`,{role:`menuitem`,className:`muted`,onClick:()=>{c(!1),e.onEdit()},children:`Edit macros…`})]})]})}var $S=()=>`m-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`,eC=(e,t)=>e!==null&&e!==`~chats`&&!t.some(t=>t.name===e),tC=(e,t)=>e===null?`Global`:`${S(e)}${eC(e,t)?` (removed)`:``}`;function nC(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),a=XS(),o=t=>e.run(()=>B.setMacros(t)),s=t&&e.macros.some(e=>e.id===t.id)?t.id:null;return(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`div`,{className:`settings-h`,children:(0,U.jsx)(`h3`,{children:`Macros`})}),(0,U.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,U.jsx)(`ul`,{className:`macro-list`,children:e.macros.map((t,c)=>(0,U.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(JS(e.macros,r,c)),i(null)},children:[t.chip?(0,U.jsxs)(`span`,{className:`board-chip macro-chip static`,children:[t.name,t.send&&(0,U.jsx)(`span`,{className:`macro-send`,children:` ↵`})]}):(0,U.jsxs)(`span`,{className:`macro-keyonly`,title:`No chip: this one is on its keybind only`,children:[t.name,t.send&&(0,U.jsx)(`span`,{className:`macro-send`,children:` ↵`}),` `,(0,U.jsx)(`span`,{className:`muted`,children:`· keybind only`})]}),(0,U.jsx)(`span`,{className:`mono macro-text`,title:t.text,children:t.text}),(0,U.jsx)(`span`,{className:`muted macro-what`,children:t.send?`Sends`:`Inserts`}),t.key?(0,U.jsx)(`kbd`,{children:VS(t.key,a)}):(0,U.jsx)(`span`,{className:`muted macro-nokey`,children:`no key`}),(0,U.jsx)(`span`,{className:`chip macro-scope`,title:tC(t.project,e.projects),children:tC(t.project,e.projects)}),(0,U.jsx)(`span`,{className:`macro-move`,title:`Drag to reorder`,"aria-hidden":!0,children:`⋮⋮`}),(0,U.jsxs)(`span`,{className:`macro-row-buttons`,children:[c>0&&(0,U.jsx)(`button`,{className:`small macro-up`,title:`Move up`,"aria-label":`Move ${t.name} up`,onClick:()=>void o(JS(e.macros,c,c-1)),children:`↑`}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>n({...t}),children:`Edit`})]})]},t.id))}),t?(0,U.jsx)(rC,{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,U.jsx)(`button`,{className:`primary`,onClick:()=>n({id:$S(),name:``,text:``,send:!1,key:null,chip:!0,project:null}),children:`Add macro`})]})}function rC(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=H(),c=e=>n(t=>({...t,...e})),l=r?t.key:null,u=l?HS(l,e.macros,t.id):null,d={...t,key:l},f=YS([d]),p=US(e.macros,t.id),m=!t.name.trim()||!t.text.trim()||r&&!t.key||!!u&&`refused`in u||!!f;return(0,U.jsxs)(`div`,{className:`form macro-form`,children:[(0,U.jsx)(`h4`,{children:e.isNew?`New macro`:`Edit “${e.draft.name}”`}),(0,U.jsxs)(`label`,{children:[`Name`,(0,U.jsx)(`input`,{...s,value:t.name,maxLength:40,placeholder:`Run checks`,onChange:e=>c({name:e.target.value})})]}),(0,U.jsxs)(`label`,{children:[`Text`,(0,U.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,U.jsxs)(`span`,{className:`muted macro-hint`,children:[`Placeholders: `,GS.map(e=>(0,U.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,U.jsxs)(`div`,{className:`field`,children:[(0,U.jsx)(`span`,{children:`When used`}),(0,U.jsxs)(`span`,{className:`segmented macro-seg`,children:[(0,U.jsx)(`button`,{className:`small${t.send?``:` on`}`,"aria-pressed":!t.send,onClick:()=>c({send:!1}),children:`Put it in the message box`}),(0,U.jsx)(`button`,{className:`small${t.send?` on`:``}`,"aria-pressed":t.send,onClick:()=>c({send:!0}),children:`Send it at once`})]}),(0,U.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,U.jsxs)(`label`,{children:[`Where`,(0,U.jsxs)(`select`,{value:t.project??``,onChange:e=>c({project:e.target.value||null}),children:[(0,U.jsx)(`option`,{value:``,children:`Global (every project)`}),e.projects.map(e=>(0,U.jsx)(`option`,{value:e.name,children:e.name},e.name)),eC(e.draft.project,e.projects)&&(0,U.jsx)(`option`,{value:e.draft.project,children:tC(e.draft.project,e.projects)}),(0,U.jsx)(`option`,{value:x,children:`Chats`})]})]}),(0,U.jsxs)(`label`,{className:`toggle macro-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:t.chip,onChange:e=>c({chip:e.target.checked})}),` Show as a chip in the info bar`]}),(0,U.jsxs)(`label`,{className:`toggle macro-switch`,children:[(0,U.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,U.jsxs)(`div`,{className:`macro-sub`,children:[(0,U.jsxs)(`span`,{className:`macro-keyrow`,children:[(0,U.jsx)(`input`,{...s,className:`mono macro-keyin${u&&`refused`in u?` bad`:``}`,readOnly:!0,"aria-label":`Keybind`,value:a?`Press the keys…`:t.key?VS(t.key,e.mac):``,onFocus:()=>o(!0),onBlur:()=>o(!1),onKeyDown:e=>{if(e.key===`Tab`||e.key===`Escape`)return;e.preventDefault();let t=zS(e.nativeEvent);t&&(c({key:t}),e.target.blur())}}),(0,U.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,U.jsx)(`span`,{className:`macro-conflict`,role:`alert`,children:u.refused}),u&&`warning`in u&&(0,U.jsx)(`span`,{className:`macro-warning`,children:u.warning}),u&&p.length>0&&(0,U.jsxs)(`span`,{className:`macro-hint`,children:[`Free: `,p.map(t=>(0,U.jsx)(`button`,{className:`link macro-free`,onClick:()=>c({key:t}),children:(0,U.jsx)(`kbd`,{children:VS(t,e.mac)})},t))]}),!u&&(0,U.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,U.jsx)(`span`,{className:`macro-conflict`,children:`With neither a chip nor a keybind nothing could use it.`}),(0,U.jsxs)(`div`,{className:`macro-keyrow`,children:[(0,U.jsx)(`button`,{className:`primary`,disabled:m,onClick:()=>void e.onSave(d),children:`Save`}),(0,U.jsx)(`button`,{onClick:e.onCancel,children:`Cancel`}),e.onDelete&&(0,U.jsx)(`button`,{className:`deny macro-delete`,onClick:()=>void e.onDelete(),children:`Delete`})]})]})}function iC(e){let t=Hp(om),n=Cp(e.view,t),r={update:Pp(e.update.view),remote:Mp(e.remote),notifications:e.notify.possible&&!e.notify.on&&!Bt()?`off`:``};return(0,U.jsx)(nm,{groups:vp,current:n,words:r,narrow:t,onOpen:t=>e.onOpen(t===null?`settings`:bp(t)),children:n!==null&&(0,U.jsx)(aC,{group:n,...e})})}function aC(e){switch(e.group){case`update`:{let t=Np(e.update.view);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Update Ledung`}),t.update&&(0,U.jsx)(`p`,{className:`muted`,children:t.update}),(0,U.jsx)(_C,{update:e.update})]}),(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Restart Ledung`}),(0,U.jsx)(`p`,{className:`muted`,children:t.restart}),!!e.config?.restartFor.length&&(0,U.jsx)(`p`,{className:`config-restart`,children:sC(e.config)}),e.canRestart?(0,U.jsx)(em,{hellos:e.hellos}):(0,U.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,U.jsx)(AS,{}),(0,U.jsx)(kS,{run:e.run})]})}case`claude`:return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(FS,{accounts:e.accounts,choices:e.accountChoices,defaultIdentity:e.defaultIdentity,configFileProblems:e.accountProblems,projects:e.projects,run:e.run,remote:e.throughPublicName}),(0,U.jsx)(Ny,{accounts:e.accounts,usageStops:e.usageStops,run:e.run}),(0,U.jsx)(jb,{sessions:e.sessions}),(0,U.jsx)(Lf,{accounts:e.accounts,run:e.run})]});case`sessions`:return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(pp,{run:e.run}),(0,U.jsx)(Sb,{})]});case`macros`:return(0,U.jsx)(nC,{macros:e.macros,projects:e.projects,run:e.run});case`remote`:return(0,U.jsx)(oC,{...e});case`look`:return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`section`,{children:[(0,U.jsxs)(`div`,{className:`settings-h`,children:[(0,U.jsx)(`h3`,{children:`Appearance`}),(0,U.jsx)(tm,{kind:`browser`})]}),(0,U.jsx)(mC,{})]}),(0,U.jsxs)(`section`,{children:[(0,U.jsxs)(`div`,{className:`settings-h`,children:[(0,U.jsx)(`h3`,{children:`Typing`}),(0,U.jsx)(tm,{kind:`browser`})]}),(0,U.jsx)(uC,{})]}),(0,U.jsxs)(`section`,{children:[(0,U.jsxs)(`div`,{className:`settings-h`,children:[(0,U.jsx)(`h3`,{children:`Sidebar`}),(0,U.jsx)(tm,{kind:`browser`})]}),(0,U.jsx)(dC,{}),(0,U.jsx)(fC,{}),(0,U.jsx)(pC,{})]}),(0,U.jsx)(mS,{run:e.run})]});case`notifications`:return(0,U.jsxs)(`section`,{children:[(0,U.jsxs)(`div`,{className:`settings-h`,children:[(0,U.jsx)(`h3`,{children:`Notifications`}),(0,U.jsx)(tm,{kind:`browser`})]}),(0,U.jsx)(lC,{notify:e.notify,linked:e.computers.some(e=>e.linked)})]});case`config`:return e.config?(0,U.jsx)(cC,{config:e.config}):(0,U.jsx)(`p`,{className:`muted`,children:`…`});default:return(0,U.jsx)(xC,{source:e.source,update:e.update})}}function oC(e){let[t,n]=(0,v.useState)(void 0),[r,i]=(0,v.useState)(null);(0,v.useEffect)(()=>{B.relayAdmin().then(n,()=>n(null))},[]);let a=jp({remote:e.remote,relaySetUp:t?$v(t):null,boardConfigured:!!e.board?.configured}),o=t&&(0,U.jsx)(Qv,{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,U.jsx)(yC,{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:Dp(s,`board`)}:void 0}].filter(e=>e.state===`off`||e.state===`needs`);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Cx,{computers:e.computers,run:e.run}),a.remote===`on`&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Remote access`}),(0,U.jsx)(yC,{remote:e.remote})]}),a.phones===`on`&&(0,U.jsx)(hx,{run:e.run,linked:e.computers.some(e=>e.linked)},e.remote?.publicName??`none`),a.linked===`on`&&(0,U.jsx)(Sx,{run:e.run},`linked-${e.remote?.publicName??`none`}-${e.remote?.tls??``}`),a.relay===`on`&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Relay`}),o]}),a.board===`on`&&(0,U.jsx)(Tn,{board:e.board}),c.length>0&&(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`Not set up`}),c.map(t=>r===t.id&&t.state===`off`&&t.form?(0,U.jsxs)(`div`,{className:`offline-open`,role:`group`,"aria-label":t.name,children:[(0,U.jsxs)(`h4`,{children:[(0,U.jsx)(`span`,{children:t.name}),(0,U.jsx)(`button`,{className:`small`,"aria-label":`Close ${t.name}`,title:`Close`,onClick:()=>i(null),children:`✕`})]}),t.form]},t.id):(0,U.jsxs)(`div`,{className:`offline${t.state===`needs`?` needs`:``}`,children:[(0,U.jsx)(`span`,{className:`offline-name`,children:t.name}),(0,U.jsx)(`span`,{className:`offline-why`,children:t.state===`needs`?`Needs remote access first.`:t.why}),t.state===`off`&&t.form&&(0,U.jsx)(`button`,{className:`small${t.primary?` primary`:``}`,onClick:()=>i(t.id),children:`Set up ›`}),t.state===`off`&&t.go&&(0,U.jsx)(`button`,{className:`small`,onClick:()=>e.onOpen(t.go.view),children:t.go.label})]},t.id))]})]})}function sC(e){return`Restart Ledung to apply: ${e.restartFor.join(`, `)}`}function cC(e){let t=e.config,n=new Date(t.readAt).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`});return(0,U.jsxs)(`section`,{children:[(0,U.jsxs)(`div`,{className:`settings-h`,children:[(0,U.jsx)(`h3`,{children:`Config file`}),(0,U.jsx)(tm,{kind:`config`})]}),(0,U.jsxs)(`p`,{className:`muted`,children:[`Ledung reads `,(0,U.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,U.jsx)(`p`,{children:t.reloaded?`Last reloaded ${n}.`:`Read at start, ${n}; not changed since.`}),t.problem&&(0,U.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,U.jsx)(`p`,{className:`config-restart`,children:sC(t)})]})}function lC({notify:e,linked:t}){return Bt()?(0,U.jsx)(vx,{linked:t}):e.possible?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`label`,{className:`toggle`,title:`A browser notification when something new needs your answer and this page is in the background`,children:[(0,U.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,U.jsx)(`p`,{className:`muted`,children:`While a Ledung page is open in this browser.`}),e.denied&&(0,U.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,U.jsx)(`p`,{className:`muted`,children:`Notifications work when this page is opened on this computer at 127.0.0.1.`})}function uC(){let[e,t]=gn();return(0,U.jsxs)(U.Fragment,{children:[(0,U.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,U.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` Autocorrect`]}),(0,U.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 dC(){let[e,t]=jx();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`label`,{className:`toggle`,title:`The coloured dot left of each session in the sidebar; the ship shows much the same`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` Status dot`]}),(0,U.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 fC(){let[e,t]=Ux();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`label`,{className:`toggle`,title:`The Archived (N) entry under each project in the sidebar, which opens its archived sessions`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` Show "Archived" in the sidebar`]}),(0,U.jsx)(`p`,{className:`muted`,children:`Off: no Archived entry under the projects; switch it on to open their archived sessions.`})]})}function pC(){let[e,t]=Lx(),n=yt.find(t=>t.step===e).label;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`label`,{className:`compact-slider`,title:`Less padding and fewer rows on each session in the sidebar; the ship always stays`,children:[(0,U.jsx)(`span`,{children:`Compact sidebar`}),(0,U.jsx)(bb,{step:e,labels:yt.map(e=>e.label),onPick:e=>t(e),children:(0,U.jsx)(`input`,{type:`range`,min:1,max:yt.length,step:1,value:e,list:`compact-steps`,"aria-valuetext":n,onChange:e=>t(Number(e.target.value))})})]}),(0,U.jsx)(`datalist`,{id:`compact-steps`,children:yt.map(e=>(0,U.jsx)(`option`,{value:e.step,label:e.label},e.step))}),(0,U.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 mC(){let[e,t]=(0,v.useState)(()=>it(localStorage)),n=e=>{t(e),at(ln,e),ot(document.documentElement,e)};return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`seg-control`,role:`group`,"aria-label":`Colour scheme`,children:tt.map(t=>(0,U.jsx)(`button`,{className:e===t.id?`on`:``,"aria-pressed":e===t.id,onClick:()=>n(t.id),children:t.label},t.id))}),(0,U.jsx)(`p`,{className:`muted`,children:`System follows the computer's light or dark setting.`})]})}var hC=e=>e?e.slice(0,7):`unknown commit`,gC={waiting:`○`,running:`…`,done:`✓`,failed:`✗`};function _C({update:e}){let{view:t,error:n,act:r}=e,[i,a]=(0,v.useState)(!1);if(n)return(0,U.jsx)(`p`,{className:`restart-problem`,children:n});if(!t)return(0,U.jsx)(`p`,{className:`muted`,children:`…`});if(t.npm)return(0,U.jsx)(vC,{update:e});if(!t.available)return(0,U.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,U.jsxs)(`div`,{className:`update-panel`,children:[(0,U.jsxs)(`p`,{className:`muted`,children:[`Running `,t.running?.commit?(0,U.jsx)(`code`,{children:hC(t.running.commit)}):`an unknown commit (its source is not a git clone)`,`, built from `,(0,U.jsx)(`code`,{children:t.running?.source}),`.`]}),(0,U.jsxs)(`div`,{className:`restart-confirm`,children:[(0,U.jsx)(`button`,{className:`small`,disabled:o,onClick:()=>{a(!1),r(B.updateCheck)},children:t.checking?`Checking…`:`Check for updates`}),s&&!t.checking&&(s.upToDate?(0,U.jsxs)(`span`,{className:`update-ok`,children:[`Up to date (`,hC(s.latest),`)`]}):(0,U.jsxs)(`span`,{children:[s.behind,` new change`,s.behind===1?``:`s`,` on main (`,hC(s.latest),`)`,s.commitKnown?``:`, counted from the source folder`]}))]}),t.checkError&&(0,U.jsx)(`pre`,{className:`update-output restart-problem`,children:t.checkError}),s&&!s.upToDate&&s.changes.length>0&&(0,U.jsx)(`ul`,{className:`update-changes`,children:s.changes.map((e,t)=>(0,U.jsx)(`li`,{children:e},t))}),c&&!t.canRestart&&(0,U.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,U.jsxs)(`div`,{className:`restart-confirm`,children:[(0,U.jsx)(`span`,{className:`muted`,children:`Pull main, npm install, npm run release, then restart. Sessions keep running.`}),(0,U.jsx)(`button`,{className:`small primary`,onClick:()=>{a(!1),r(B.update)},children:`Update now`}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>a(!1),children:`Cancel`})]}):(0,U.jsx)(`div`,{className:`restart-confirm`,children:(0,U.jsx)(`button`,{className:`small primary`,onClick:()=>a(!0),children:`Update Ledung`})})),t.steps.length>0&&(0,U.jsx)(`ol`,{className:`update-steps`,children:t.steps.map(e=>(0,U.jsxs)(`li`,{className:`update-step ${e.state}`,children:[(0,U.jsx)(`span`,{className:`update-mark`,children:gC[e.state]}),` `,e.label,e.state===`failed`&&e.output&&(0,U.jsx)(`pre`,{className:`update-output`,children:e.output})]},e.label))}),t.refused&&(0,U.jsx)(`p`,{className:`restart-problem`,children:t.refused}),t.restarting&&(0,U.jsx)(`p`,{className:`muted`,children:`The new release is built. Restarting into it…`})]})}function vC({update:e}){let{view:t,act:n}=e,[r,i]=(0,v.useState)(!1);if(!t?.npm)return null;let a=t.checking||t.updating||t.restarting,o=t.npmCheck&&t.npmCheck.channel===(t.channel??`public`)?t.npmCheck:null,s=!!o?.offered&&!o.upToDate&&!t.updating&&!t.restarting,c=SC[t.channel??`public`];return(0,U.jsxs)(`div`,{className:`update-panel`,children:[(0,U.jsxs)(`p`,{className:`muted`,children:[`Running Ledung `,(0,U.jsx)(`code`,{children:Tx(t.npm.version)}),`, installed from npm, on the `,c,` channel (Settings → About).`]}),(0,U.jsxs)(`div`,{className:`restart-confirm`,children:[(0,U.jsx)(`button`,{className:`small`,disabled:a,onClick:()=>{i(!1),n(B.updateCheck)},children:t.checking?`Checking…`:`Check for updates`}),o&&!t.checking&&(o.offered?o.upToDate?(0,U.jsxs)(`span`,{className:`update-ok`,children:[`Up to date (`,c,`: `,Tx(o.offered),`)`]}):(0,U.jsxs)(`span`,{children:[Tx(o.offered),` is out on `,c]}):(0,U.jsxs)(`span`,{children:[`npm has no `,c,` version yet`]}))]}),t.checkError&&(0,U.jsx)(`pre`,{className:`update-output restart-problem`,children:t.checkError}),s&&!t.canRestart&&(0,U.jsx)(`p`,{className:`muted`,children:t.reason}),s&&t.canRestart&&(r?(0,U.jsxs)(`div`,{className:`restart-confirm`,children:[(0,U.jsxs)(`span`,{className:`muted`,children:[`npm install -g ledung@`,o.offered,`, then restart. Sessions keep running.`]}),(0,U.jsx)(`button`,{className:`small primary`,onClick:()=>{i(!1),n(B.update)},children:`Update now`}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>i(!1),children:`Cancel`})]}):(0,U.jsx)(`div`,{className:`restart-confirm`,children:(0,U.jsx)(`button`,{className:`small primary`,onClick:()=>i(!0),children:`Update Ledung`})})),t.steps.length>0&&(0,U.jsx)(`ol`,{className:`update-steps`,children:t.steps.map((e,t)=>(0,U.jsxs)(`li`,{className:`update-step ${e.state}`,children:[(0,U.jsx)(`span`,{className:`update-mark`,children:gC[e.state]}),` `,e.label,e.state===`failed`&&e.output&&(0,U.jsx)(`pre`,{className:`update-output`,children:e.output})]},t))}),t.refused&&(0,U.jsx)(`p`,{className:`restart-problem`,children:t.refused}),t.restarting&&(0,U.jsx)(`p`,{className:`muted`,children:`The new version is installed. Restarting into it…`}),!t.steps.length&&!s&&(0,U.jsx)(`p`,{className:`muted`,children:t.reason})]})}function yC(e){let t=Mb(e.remote);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{className:`remote-state ${e.remote?.state??`off`}`,children:t.label}),t.detail&&(0,U.jsx)(`p`,{className:`muted`,children:t.detail}),e.remote?.tls&&(0,U.jsx)(`p`,{className:`remote-tls`,children:e.remote.tls}),e.remote?.certificate&&(0,U.jsx)(bC,{cert:e.remote.certificate}),(0,U.jsx)(Zv,{remote:e.remote})]})}function bC({cert:e}){let t=Fb(e,Date.now()),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null);return(0,U.jsxs)(`div`,{className:`remote-certificate`,children:[(0,U.jsx)(`p`,{className:t.warn?`remote-tls`:`remote-state connected`,children:t.label}),t.detail&&(0,U.jsx)(`p`,{className:`muted`,children:t.detail}),t.copy&&e.accountUrl&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`muted`,children:[`ACME account (`,e.acme,`): `,(0,U.jsx)(`code`,{children:e.accountUrl}),` `,(0,U.jsx)(kf,{text:e.accountUrl})]}),e.record&&(0,U.jsxs)(`p`,{className:`muted`,children:[`CAA record: `,(0,U.jsx)(`code`,{className:`remote-record`,children:e.record}),` `,(0,U.jsx)(kf,{text:e.record})]}),(0,U.jsx)(`div`,{className:`restart-confirm`,children:(0,U.jsx)(`button`,{className:`small`,disabled:n,onClick:()=>{r(!0),a(null),B.certificateCheck().catch(e=>a(e.message)).finally(()=>r(!1))},children:n?`Checking…`:`Check now`})})]}),i&&(0,U.jsx)(`p`,{className:`restart-problem`,children:i})]})}function xC({source:e,update:t}){return(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h3`,{children:`About`}),(0,U.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,U.jsxs)(`p`,{className:`muted`,children:[`It runs Anthropic's Claude Agent SDK and Claude Code, installed from npm under `,(0,U.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,U.jsxs)(`p`,{className:`muted`,children:[`Running `,(0,U.jsx)(`code`,{children:e.version}),`. `,(0,U.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:`Source`})]}),t.view&&(0,U.jsx)(CC,{update:t})]})}var SC={public:`Public`,dev:`Dev`};function CC({update:e}){let t=e.view,n=t.channel??`public`;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h3`,{children:`Update channel`}),(0,U.jsx)(`div`,{className:`restart-confirm`,role:`radiogroup`,"aria-label":`Update channel`,children:[`public`,`dev`].map(r=>(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`input`,{type:`radio`,name:`update-channel`,checked:n===r,disabled:t.updating||t.restarting,onChange:()=>e.act(()=>B.updateChannel(r))}),` `,SC[r]]},r))}),(0,U.jsxs)(`p`,{className:`muted`,children:[n===`dev`?`Dev: updates to dev builds, made after changes are merged and before a public release, as well as public releases.`:`Public: updates to public releases only, as npm install -g ledung gets them.`,` `,t.npm?`Check for updates is under Update & restart.`:`This Ledung updates from main in the folder it was built from, so the channel applies only once it is installed from npm.`]})]})}var wC=(e,t)=>`bt:${e}#${t}`;function TC(e){let t=/^bt:([^#]+)#(.+)$/.exec(e??``);return t?{repo:t[1],id:t[2]}:null}var EC=(e,t)=>`#/board/${e}/${encodeURIComponent(t)}`;function DC(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 OC(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 kC(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 AC={project:``,repo:``,unreadOnly:!1,notDelivered:!1},jC=e=>e.dropped+e.refused+e.unsent>0,MC=(e,t=``)=>t?e.unread[t]??0:Object.values(e.unread).reduce((e,t)=>e+t,0);function NC(e,t){return e.filter(e=>(!t.repo||e.repo===t.repo)&&(!t.project||e.projects.includes(t.project))&&(!t.unreadOnly||MC(e,t.project)>0)&&(!t.notDelivered||jC(e)))}var PC=e=>e&&/^https:\/\//.test(e)?e:null;function FC(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 IC=AC,LC=e=>e.length>4?`${e.slice(0,4).join(`, `)} +${e.length-4}`:e.join(`, `);function RC(e){let{data:t,error:n}=FC(()=>B.boardThreads(),[e.board]),[r,i]=(0,v.useState)(IC),a=e=>i(t=>IC={...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)(()=>NC(t?.threads??[],r),[t,r]),l=r.project||r.repo||r.unreadOnly||r.notDelivered;return(0,U.jsxs)(`div`,{className:`waiting-view board-view`,children:[(0,U.jsxs)(`header`,{className:`session-head`,children:[(0,U.jsxs)(`div`,{className:`session-head-text`,children:[(0,U.jsx)(`h2`,{children:`Board`}),(0,U.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,U.jsx)(`div`,{className:`session-corner`,children:(0,U.jsx)(`button`,{className:`small`,onClick:e.onOpenSettings,children:`Board settings`})})]}),(0,U.jsxs)(`div`,{className:`board-filters`,role:`group`,"aria-label":`Filter threads`,children:[o.length>1&&(0,U.jsxs)(`label`,{children:[`Project`,(0,U.jsxs)(`select`,{value:r.project,onChange:e=>a({project:e.target.value}),children:[(0,U.jsx)(`option`,{value:``,children:`All projects`}),o.map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))]})]}),s.length>1&&(0,U.jsxs)(`label`,{children:[`Board`,(0,U.jsxs)(`select`,{value:r.repo,onChange:e=>a({repo:e.target.value}),children:[(0,U.jsx)(`option`,{value:``,children:`All boards`}),s.map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))]})]}),(0,U.jsxs)(`label`,{className:`toggle`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:r.unreadOnly,onChange:e=>a({unreadOnly:e.target.checked})}),` Unread only`]}),(0,U.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,U.jsx)(`input`,{type:`checkbox`,checked:r.notDelivered,onChange:e=>a({notDelivered:e.target.checked})}),` Not delivered`]}),l&&(0,U.jsx)(`button`,{className:`small`,onClick:()=>{IC=AC,i(AC)},children:`Clear filters`})]}),(0,U.jsxs)(`div`,{className:`waiting-list board-list`,children:[n&&(0,U.jsx)(`p`,{className:`board-error`,children:n}),!t&&!n&&(0,U.jsx)(`p`,{className:`muted`,children:`Reading the board…`}),t&&c.length===0&&(0,U.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,U.jsx)(zC,{t,filters:r,onOpen:e.onOpen,showRepo:s.length>1},`${t.repo}#${t.id}`)),t?.truncated&&(0,U.jsxs)(`p`,{className:`muted`,children:[`Only the `,t.threads.length,` most recent threads are listed.`]})]})]})}function zC({t:e,filters:t,onOpen:n,showRepo:r}){let i=MC(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,U.jsxs)(`button`,{className:`board-thread-card${i?` unread`:``}`,onClick:()=>n(wC(e.repo,e.id)),children:[(0,U.jsxs)(`span`,{className:`board-thread-top`,children:[(0,U.jsxs)(`span`,{className:`board-thread-title`,children:[i>0&&(0,U.jsx)(`span`,{className:`unread-dot`,"aria-label":`unread`}),e.onlyDropped?`Thread ${e.id} (dropped posts only)`:e.title]}),(0,U.jsx)(`span`,{className:`muted board-thread-time`,children:Og(e.updatedAt)})]}),(0,U.jsxs)(`span`,{className:`board-thread-meta muted`,children:[(0,U.jsx)(`span`,{className:`mono`,children:r?`${e.repo} #${e.id}`:`#${e.id}`}),e.participants.length>0&&(0,U.jsxs)(U.Fragment,{children:[` · `,LC(e.participants)]})]}),(0,U.jsxs)(`span`,{className:`board-thread-chips`,children:[i>0&&(0,U.jsxs)(`span`,{className:`chip accent`,children:[i,` unread`]}),e.projects.map(e=>(0,U.jsx)(`span`,{className:`chip`,children:e},e)),a.map(e=>(0,U.jsx)(`span`,{className:`chip warn`,children:e},e))]}),o&&(0,U.jsxs)(`span`,{className:`board-thread-last`,children:[(0,U.jsxs)(`strong`,{children:[s,`:`]}),` `,o.text||`(empty)`]})]})}function BC(e){let{data:t,error:n}=FC(()=>B.boardThread(e.repo,e.id),[e.repo,e.id,e.board]),r=t=>e.projects.find(e=>e.name===t)?.managerId??null,i=PC(t?.url??null);return(0,U.jsxs)(`div`,{className:`waiting-view board-view`,children:[(0,U.jsxs)(`header`,{className:`session-head`,children:[(0,U.jsxs)(`div`,{className:`session-head-text`,children:[(0,U.jsx)(`h2`,{children:t&&!t.missing?t.title:`Thread ${e.id}`}),(0,U.jsxs)(`div`,{className:`muted`,children:[(0,U.jsxs)(`span`,{className:`mono`,children:[e.repo,` #`,e.id]}),t&&t.participants.length>0&&(0,U.jsxs)(U.Fragment,{children:[` · `,LC(t.participants)]})]})]}),(0,U.jsx)(`div`,{className:`session-corner`,children:(0,U.jsx)(`button`,{className:`small`,onClick:e.onBack,children:`← Board`})})]}),(0,U.jsxs)(`div`,{className:`waiting-list board-thread-page`,children:[(0,U.jsxs)(`p`,{className:`muted board-readonly`,children:[`Read-only: nothing is posted from here and opening this does not mark anything read.`,i&&(0,U.jsxs)(U.Fragment,{children:[` `,(0,U.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,children:[`Open the thread on `,t?.service??`the board`]}),`.`]})]}),n&&(0,U.jsx)(`p`,{className:`board-error`,children:n}),!t&&!n&&(0,U.jsx)(`p`,{className:`muted`,children:`Reading the thread…`}),t?.missing&&(0,U.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,U.jsxs)(`p`,{className:`muted`,children:[`Only the latest `,t.posts.length,` posts are shown.`]}),t?.posts.map(n=>(0,U.jsx)(HC,{p:n,service:t.service,managerOf:r,onOpen:e.onOpen},n.id))]})]})}function VC({files:e}){return(0,U.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=Ef(``,e.file);return(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,children:(0,U.jsx)(`img`,{src:n,alt:e.name})}),(0,U.jsx)(`span`,{children:r})]},t)}let i=e.pruned?`pruned`:e.error?`not fetched: ${e.error}`:`in the board cache`;return(0,U.jsx)(`li`,{className:`muted`,children:(0,U.jsxs)(`span`,{children:[r,` · `,i]})},t)})})}function HC({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=PC(e.url);return(0,U.jsxs)(`div`,{className:`msg board-post board-post-card ${i}${e.text===null?` dropped`:``}${a?` unread`:``}`,children:[(0,U.jsxs)(`div`,{className:`msg-meta`,children:[(0,U.jsx)(`span`,{className:`who`,children:OC(e,t)}),a&&(0,U.jsx)(`span`,{className:`chip accent`,children:`unread`}),(0,U.jsx)(`time`,{className:`time`,children:Og(e.at)}),o&&(0,U.jsxs)(`a`,{className:`board-post-link`,href:o,target:`_blank`,rel:`noopener noreferrer`,children:[`on `,t]})]}),e.recipients.length>0&&(0,U.jsxs)(`div`,{className:`board-thread`,children:[`To `,e.recipients.join(`, `)]}),e.text===null?(0,U.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,U.jsx)(`div`,{className:`msg-body plain`,children:e.text}),e.attachments.length>0&&(0,U.jsx)(VC,{files:e.attachments}),(0,U.jsx)(`ul`,{className:`board-delivery-list`,children:kC(e).map((e,t)=>{let i=e.project?n(e.project):null;return(0,U.jsxs)(`li`,{className:`delivery-${e.level}`,children:[e.text,i&&(0,U.jsxs)(U.Fragment,{children:[` · `,(0,U.jsxs)(`button`,{className:`link`,onClick:()=>r(i),children:[e.project,`'s manager chat`]})]})]},t)})})]})}var UC=80;function WC({value:e,onSave:t,onDone:n,label:r}){let i=H(),[a,o]=(0,v.useState)(e),s=a.replace(/\s+/g,` `).trim();return(0,U.jsx)(`input`,{...i,className:`name-editor`,"aria-label":r,autoFocus:!0,maxLength:UC,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 GC(e,t){return KC(e)-KC(t)||(e.position!==null&&t.position!==null?e.position-t.position:t.createdAt-e.createdAt)}function KC(e){return e.position===null?e.status===`ended`?2:0:1}function qC(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 JC(e,t){let n=e.findIndex(e=>t<e);return n<0?e.length:n}function YC(e,t,n){let r=e.indexOf(t);return n===r||n===r+1}var XC=5,ZC=450,QC=8,$C=28;function ew(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=JC(i.map(t=>{let n=u(t,e.group).getBoundingClientRect();return n.top+n.height/2}),r);return YC(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,qC(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+$C?r.scrollBy(0,-10):e>i.bottom-$C&&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)},ZC);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>QC&&f(!1);return}if(t<XC)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 tw=`ledung.sidebar.folded`,nw=`ledung.sidebar.foldedSessions`,rw=(e,t,n)=>({count:(e?.count??0)+1,pending:(e?.pending??0)+(n[t.s.id]??0),working:(e?.working??!1)||ct(t.s)===`running`});function iw(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=rw(r,o,t.pending):a&&(a.hidden=rw(a.hidden,o,t.pending))}),t.folded&&!r&&(r={count:0,pending:0,working:!1}),{rows:n,project:r}}function aw(e,t){try{let n=JSON.parse(e.getItem(t)??`[]`);return Array.isArray(n)?n.filter(e=>typeof e==`string`):[]}catch{return[]}}function ow(e,t,n){try{n.length?e.setItem(t,JSON.stringify(n)):e.removeItem(t)}catch{}}var sw=e=>aw(e,tw),cw=(e,t)=>ow(e,tw,t),lw=e=>aw(e,nw),uw=(e,t)=>ow(e,nw,t);function dw(e,t,n=()=>!0){let r=e.filter(e=>e!==t&&n(e));return e.includes(t)?r:[...r,t]}function fw(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 pw(e,t){return e.filter(e=>e.resetAt>t)}function mw(e){return e.polling===`stopped`?`critical`:e.polling===`slow`?`warning`:``}var hw=[`settings`,`accounts`,`add`,`chats`],gw=e=>!!e&&(hw.includes(e)||/^(settings|chats):/.test(e));function _w(e,t,n){return gw(n)?gw(e)?{depth:t.depth+1,root:t.root}:{depth:1,root:!1}:{depth:0,root:!1}}function vw(e){return e.depth>0&&!e.root?{back:e.depth}:{start:!0}}var yw=e=>e.key===`Escape`&&!e.defaultPrevented&&!e.isComposing,bw=e=>e===null?`phone-list`:`phone-pane`;function xw(e){return e?.ledungFromList===!0?{back:1}:{open:null}}var Sw=e=>e?null:`overview`,Cw=e=>`ledung.draft.${e}`;function ww(e,t){try{return e.getItem(Cw(t))??``}catch{return``}}function Tw(e,t,n){try{n?e.setItem(Cw(t),n):e.removeItem(Cw(t))}catch{}}function Ew(e,t=localStorage){let[n,r]=(0,v.useState)(()=>ww(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,Tw(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,(0,v.useCallback)(n=>{i.current=n,a.current=n,Tw(t,e,n),r(n)},[t,e])]}function Dw(e){let t=(0,v.useRef)(e);return(0,v.useLayoutEffect)(()=>{t.current=e}),(0,v.useCallback)((...e)=>t.current(...e),[])}function Ow(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 kw=e=>e.status!==`ended`&&e.status!==`stopping`,Aw={connected:`connected`,failed:`failed`,"needs-auth":`needs sign-in`,pending:`starting`,disabled:`disabled`},jw=e=>e.status===`running`||e.status===`waiting`,Mw=e=>e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey&&!e.isComposing&&(/^[a-z]$/i.test(e.key)?e.key.toLowerCase()===`o`:e.code===`KeyO`),Nw=e=>e.key===`Escape`&&!e.defaultPrevented&&!e.isComposing;function Pw(e){return`${e<10?e.toFixed(1):Math.round(e)} ${e>=.95&&e<1.05?`core`:`cores`}`}function Fw(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 Iw(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 Lw={normal:`Normal`,high:`High`,critical:`Critical`};function Rw({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,U.jsxs)(`div`,{className:`limit`,title:`${e}: ${r}${a===`good`?``:a===`warning`?` (busy)`:` (full)`}`,children:[(0,U.jsxs)(`div`,{className:`limit-head`,children:[(0,U.jsx)(`span`,{children:e}),(0,U.jsxs)(`span`,{className:`limit-status ${a}`,children:[o,` `,Math.round(i*100),`%`]})]}),(0,U.jsx)(`div`,{className:`limit-track`,children:(0,U.jsx)(`div`,{className:`limit-fill ${a}`,style:{width:`${Math.min(100,i*100)}%`}})}),(0,U.jsx)(`div`,{className:`limit-sub muted`,children:r})]})}function zw(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(()=>B.setLimit(i)).finally(()=>r(String(t.limit)))},a=t=>e.sessions.find(e=>e.id===t)?.title??`a session`;return(0,U.jsxs)(`section`,{className:`machine`,"aria-label":`Machine`,children:[(0,U.jsxs)(`div`,{className:`limits`,children:[(0,U.jsx)(Rw,{label:`CPU`,used:t.cores,total:t.cpus,text:`${Pw(t.cores)} of ${t.cpus}`}),(0,U.jsx)(Rw,{label:`Memory`,used:t.memUsed,total:t.memTotal,text:`${Fw(t.memUsed)} of ${Fw(t.memTotal)}`}),t.docker&&(0,U.jsx)(Rw,{label:`Docker memory`,used:t.docker.memUsed,total:t.docker.memTotal,text:`${Fw(t.docker.memUsed)} of ${Fw(t.docker.memTotal)} · ${Pw(t.docker.cores)}`})]}),(0,U.jsxs)(`div`,{className:`machine-working`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:t.working}),` of `]}),(0,U.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,U.jsxs)(`span`,{children:[` working`,t.line.length?` · ${t.line.length} waiting`:``]})]}),t.line.length>0&&(0,U.jsx)(`ol`,{className:`machine-line`,children:t.line.map(t=>{let n=e.sessions.find(e=>e.id===t);return(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`button`,{className:`link`,onClick:()=>e.onOpen(t),children:a(t)}),n&&n.priority!==`normal`&&(0,U.jsx)(`span`,{className:`chip prio-${n.priority}`,children:Lw[n.priority]}),(0,U.jsx)(`button`,{className:`small`,title:`Start this turn now, above the limit`,onClick:()=>void e.run(()=>B.startNow(t)),children:`Start now`})]},t)})})]})}function Bw({sessionId:e}){let[t,n]=(0,v.useState)(null);if((0,v.useEffect)(()=>{let t=!0,r=()=>B.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,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h3`,{children:`Machine use per turn`}),(0,U.jsx)(`p`,{className:`muted`,children:`No turns measured yet.`})]});let r=t.slice(-60);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h3`,{children:`CPU per turn`}),(0,U.jsx)(Vw,{values:r.map(e=>({value:e.peakCores,label:`${new Date(e.startedAt).toLocaleTimeString()}: peak ${Pw(e.peakCores)}, average ${Pw(e.avgCores)}`})),format:Pw}),(0,U.jsx)(`h3`,{children:`Memory per turn`}),(0,U.jsx)(Vw,{values:r.map(e=>({value:e.peakMem,label:`${new Date(e.startedAt).toLocaleTimeString()}: peak ${Fw(e.peakMem)}`})),format:Fw}),(0,U.jsx)(`div`,{className:`table-scroll`,children:(0,U.jsxs)(`table`,{className:`plain calls`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Started`}),(0,U.jsx)(`th`,{className:`num`,children:`Took`}),(0,U.jsx)(`th`,{className:`num`,children:`Avg CPU`}),(0,U.jsx)(`th`,{className:`num`,children:`Peak CPU`}),(0,U.jsx)(`th`,{className:`num`,children:`Peak memory`}),(0,U.jsx)(`th`,{children:`Commands`})]})}),(0,U.jsx)(`tbody`,{children:t.slice().reverse().map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`nowrap`,children:new Date(e.startedAt).toLocaleTimeString()}),(0,U.jsx)(`td`,{className:`num`,children:Iw(e.durationMs)}),(0,U.jsx)(`td`,{className:`num`,children:e.avgCores.toFixed(2)}),(0,U.jsx)(`td`,{className:`num`,children:e.peakCores.toFixed(2)}),(0,U.jsx)(`td`,{className:`num`,children:Fw(e.peakMem)}),(0,U.jsx)(`td`,{className:`mono`,children:e.commands.join(`, `)||(0,U.jsx)(`span`,{className:`muted`,children:`none`})})]},e.startedAt))})]})})]})}function Vw({values:e,format:t}){let n=Math.max(...e.map(e=>e.value),0);return(0,U.jsxs)(`div`,{className:`mini-bars`,role:`img`,"aria-label":`Highest: ${t(n)}`,children:[(0,U.jsx)(`span`,{className:`mini-max muted`,children:t(n)}),e.map((e,t)=>(0,U.jsx)(`div`,{className:`mini-col`,title:e.label,children:(0,U.jsx)(`div`,{className:`mini-bar`,style:{height:`${n>0?Math.max(2,e.value/n*100):0}%`}})},t))]})}function Hw(){let[e,t]=(0,v.useState)(null);return(0,v.useEffect)(()=>{B.typicalCosts(30).then(t,()=>t([]))},[]),(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h2`,{children:`Typical machine use per turn`}),(0,U.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,U.jsx)(`div`,{className:`table-scroll`,children:(0,U.jsxs)(`table`,{className:`plain`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Project`}),(0,U.jsx)(`th`,{children:`Command`}),(0,U.jsx)(`th`,{className:`num`,children:`Turns`}),(0,U.jsx)(`th`,{className:`num`,children:`Avg CPU`}),(0,U.jsx)(`th`,{className:`num`,children:`Peak CPU`}),(0,U.jsx)(`th`,{className:`num`,children:`Peak memory`}),(0,U.jsx)(`th`,{className:`num`,children:`Duration`})]})}),(0,U.jsx)(`tbody`,{children:e.slice(0,50).map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:S(e.project)}),(0,U.jsx)(`td`,{className:`mono`,children:e.command||(0,U.jsx)(`span`,{className:`muted`,children:`no commands`})}),(0,U.jsx)(`td`,{className:`num`,children:e.turns}),(0,U.jsx)(`td`,{className:`num`,children:Pw(e.avgCores)}),(0,U.jsx)(`td`,{className:`num`,children:Pw(e.peakCores)}),(0,U.jsx)(`td`,{className:`num`,children:Fw(e.peakMem)}),(0,U.jsx)(`td`,{className:`num`,children:Iw(e.durationMs)})]},`${e.project} ${e.command}`))})]})}):(0,U.jsx)(`p`,{className:`muted`,children:`No turns measured yet.`}):(0,U.jsx)(`p`,{className:`muted`,children:`Loading…`})]})}function Uw(e,t){let n=e=>`${Math.round(e/1e3)}k`;return`${n(e)}${t?` of ${n(t)}`:``}`}var Ww={...st,waiting:`Needs an answer`};function Gw(e){return e.contextTokens&&e.contextWindow?e.contextTokens/e.contextWindow:null}function Kw(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,U.jsx)(`div`,{className:`overview`,children:(0,U.jsxs)(`div`,{className:`overview-list`,children:[(0,U.jsxs)(`div`,{className:`muted`,children:[e.overview?`${Ky(e.overview.todayTokens)} tokens today`:``,o?` · ${o} ended session${o===1?``:`s`} not shown`:``]}),!a.length&&(0,U.jsx)(`p`,{className:`muted`,children:`No sessions are running.`}),a.map(n=>{let r=e.overview?.sessions[n.id],i=Gw(n),a=!!n.parentId&&t.has(n.parentId);return(0,U.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,U.jsxs)(`div`,{className:`overview-top`,children:[(0,U.jsx)(`span`,{className:`dot ${ct(n)}`}),(0,U.jsxs)(`span`,{className:`overview-title`,children:[n.role===`manager`&&(0,U.jsx)(`span`,{className:`chip`,children:`Manager`}),` `,n.title]}),e.waitingBySession[n.id]?(0,U.jsx)(`span`,{className:`badge`,children:e.waitingBySession[n.id]}):null]}),(0,U.jsxs)(`div`,{className:`overview-facts`,children:[(0,U.jsxs)(`span`,{children:[Ww[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,U.jsx)(`span`,{className:`chip prio-${n.priority}`,title:n.priorityNote??void 0,children:Lw[n.priority]}),e.machine?.sessions[n.id]&&(0,U.jsxs)(`span`,{title:`CPU and memory of everything this session runs`,children:[Pw(e.machine.sessions[n.id].cores),` · `,Fw(e.machine.sessions[n.id].memBytes)]}),(0,U.jsx)(`span`,{children:S(n.project)}),n.branch&&(0,U.jsx)(`span`,{className:`mono`,children:n.branch}),n.pr&&(0,U.jsx)(`a`,{href:n.pr.url,target:`_blank`,rel:`noreferrer noopener`,onClick:e=>e.stopPropagation(),title:`${n.pr.title} — checks ${n.pr.checks}`,children:Yy(n.pr)}),n.tickets.map(e=>(0,U.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,onClick:e=>e.stopPropagation(),children:e.id},e.id)),r&&(0,U.jsxs)(`span`,{title:`Tokens today / in total`,children:[Ky(r.today),` today · `,Ky(r.total),` total · `,qy(r.costTotal)]}),n.contextTokens!=null&&(0,U.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?``:`${Jy(i)} · `,Uw(n.contextTokens,n.contextWindow)]}),n.backgroundTasks>0&&(0,U.jsxs)(`span`,{children:[n.backgroundTasks,` in background`]})]}),r?.lastReply&&(0,U.jsxs)(`div`,{className:`overview-last`,children:[(0,U.jsx)(`span`,{className:`muted`,children:r.lastReplyAt?Og(r.lastReplyAt):``}),` `,r.lastReply.split(`
105
+ `)[0]]})]},n.id)})]})})}function qw({sessionId:e,onClose:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{let t=!0,n=()=>B.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)(()=>$y(`model`,n?.models??[]),[n?.models]),s=n?.totals,c=n?n.calls.slice(-120):[];return(0,U.jsxs)(`aside`,{className:`file-panel`,"aria-label":`Usage`,children:[(0,U.jsxs)(`header`,{className:`file-head`,children:[(0,U.jsx)(`span`,{className:`file-path`,children:`Usage of this session`}),(0,U.jsx)(`button`,{className:`small`,onClick:t,children:`Close`})]}),(0,U.jsxs)(`div`,{className:`file-body`,children:[i&&(0,U.jsx)(`p`,{className:`error`,children:i}),!n&&!i&&(0,U.jsx)(`p`,{className:`muted`,children:`Loading…`}),n&&s&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`tiles`,children:[(0,U.jsx)(rb,{label:`Tokens`,value:Ky(s.tokens),sub:`${s.calls} model calls`}),(0,U.jsx)(rb,{label:`API-equivalent cost`,value:qy(s.cost)}),(0,U.jsx)(rb,{label:`Cache read share`,value:s.tokens?Jy(s.cacheRead/s.tokens):`—`}),(0,U.jsx)(rb,{label:`In subagents`,value:s.tokens?Jy(s.subagentTokens/s.tokens):`—`})]}),(0,U.jsx)(`h3`,{children:`Tokens per model call`}),(0,U.jsx)(eb,{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,U.jsx)(nb,{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: ${Qy[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,U.jsx)(Bw,{sessionId:e}),(0,U.jsx)(`h3`,{children:`Model calls`}),(0,U.jsx)(`div`,{className:`table-scroll`,children:(0,U.jsxs)(`table`,{className:`plain calls`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Time`}),(0,U.jsx)(`th`,{children:`Model`}),(0,U.jsx)(`th`,{className:`num`,children:`Input`}),(0,U.jsx)(`th`,{className:`num`,children:`Cache write`}),(0,U.jsx)(`th`,{className:`num`,children:`Cache read`}),(0,U.jsx)(`th`,{className:`num`,children:`Output`}),(0,U.jsx)(`th`,{className:`num`,children:`Thinking`}),(0,U.jsx)(`th`,{className:`num`,children:`Tokens`}),(0,U.jsx)(`th`,{className:`num`,children:`Cache %`}),(0,U.jsx)(`th`,{className:`num`,children:`Cost`}),(0,U.jsx)(`th`,{className:`num`,children:`Running`}),(0,U.jsx)(`th`,{children:`Who`})]})}),(0,U.jsx)(`tbody`,{children:(()=>{let e=0;return n.calls.map((t,n)=>(e+=t.cost??0,(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`nowrap`,children:new Date(t.at).toLocaleTimeString()}),(0,U.jsxs)(`td`,{className:`nowrap`,children:[(0,U.jsx)(`span`,{className:`viz-swatch`,style:{background:o(t.model)}}),` `,t.model]}),(0,U.jsx)(`td`,{className:`num`,children:Ky(t.input)}),(0,U.jsx)(`td`,{className:`num`,children:Ky(t.cacheWrite)}),(0,U.jsx)(`td`,{className:`num`,children:Ky(t.cacheRead)}),(0,U.jsx)(`td`,{className:`num`,children:Ky(t.output)}),(0,U.jsx)(`td`,{className:`num muted`,children:t.thinking?`~${Ky(t.thinking)}`:``}),(0,U.jsx)(`td`,{className:`num strong`,children:Ky(t.tokens)}),(0,U.jsx)(`td`,{className:`num`,children:t.tokens?Jy(t.cacheRead/t.tokens):``}),(0,U.jsx)(`td`,{className:`num`,children:qy(t.cost)}),(0,U.jsx)(`td`,{className:`num muted`,children:qy(e)}),(0,U.jsx)(`td`,{className:`muted nowrap`,children:t.subagent?`subagent: ${t.subagent}`:Qy[t.trigger]??t.trigger})]},n)))})()})]})})]})]})]})}var Jw=864e5,Yw=Jw;function Xw(e,t){return t.fingerprint??`${e.login}/${e.computerId}/${t.label}`}var Zw=e=>e.input+e.cacheWrite+e.cacheRead+e.output;function Qw(e){return e.entries.find(e=>e.own)?.login??null}function $w(e,t){let n=Qw(e);return e.entries.flatMap(e=>e.state===`ok`&&e.file&&(!t||e.file.login===n)?[e.file]:[])}function eT(e){return e.flatMap(e=>e.accounts.map(t=>({file:e,account:t,key:Xw(e,t)})))}function tT(e,t,n){if(e===`all`)return null;let r;if(e===`week`){let e=eT(t).flatMap(({account:e})=>e.limits.filter(e=>e.kind===`seven_day`&&e.resetsAt&&e.resetsAt>n).map(e=>e.resetsAt-Iy.seven_day));r=e.length?Math.min(...e):n-6*Jw}else r=n-(Number(e.replace(`d`,``))-1)*Jw;return nT(r)}function nT(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function rT(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=nT(t),c=Number.isFinite(a)?nT(a):null;for(let t of e.daily)!r(t)||t.t<s||c&&t.t>=c||(o+=t.cost);return o}function iT(e){let t=/^seven_day_(opus|sonnet|haiku|fable)$/.exec(e)?.[1];return t?e=>e.toLowerCase().includes(t):void 0}var aT=[`five_hour`,`seven_day`,`seven_day_opus`,`seven_day_sonnet`];function oT(e,t){let n=new Map;for(let t of eT(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)=>(aT.indexOf(e)+1||99)-(aT.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?Uy(r,t):!1,o=Iy[e]??Iy.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:rT(t.account,s,iT(e))})),l=c.reduce((e,t)=>e+t.cost,0);return{kind:e,reading:r,reset:a,pace:r&&!a&&r.utilization!=null?Ly(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 sT(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 cT(e,t,n,r){let i=new Map,a=new Set;for(let r of eT(e))for(let e of r.account.daily){if(n&&e.t<n)continue;let o=sT(t,r,e);a.add(o);let s=i.get(e.t)??Object.create(null);s[o]=(s[o]??0)+Zw(e),i.set(e.t,s)}let o=n??[...i.keys()].sort()[0],s=nT(r),c=[];if(o)for(let e=new Date(`${o}T12:00:00`);nT(e.getTime())<=s;e.setDate(e.getDate()+1)){let t=nT(e.getTime());c.push({day:t,values:i.get(t)??Object.create(null)})}return{keys:[...a].sort(),columns:c}}function lT(e,t,n){return eT(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+Zw(t),0),cost:a.reduce((e,t)=>e+t.cost,0),asOf:e.asOf,stale:n-e.asOf>Yw}}).sort((e,t)=>e.login.localeCompare(t.login)||e.account.localeCompare(t.account)||e.computer.localeCompare(t.computer))}var uT=[[`week`,`Since weekly reset`],[`7d`,`7 days`],[`30d`,`30 days`],[`90d`,`90 days`],[`all`,`All time`]],dT=[[`person`,`person`],[`account`,`account`],[`computer`,`computer`],[`model`,`model`],[`project`,`project`]],fT={five_hour:`5-hour`,seven_day:`Weekly`,seven_day_opus:`Weekly Opus`,seven_day_sonnet:`Weekly Sonnet`},pT={allowed:{cls:`good`,icon:`●`,label:`OK`},allowed_warning:{cls:`warning`,icon:`▲`,label:`Close to the limit`},rejected:{cls:`critical`,icon:`■`,label:`Limit reached`}};function mT(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function hT(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let e=!0,n=()=>B.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,U.jsx)(`p`,{className:`error`,children:n}):e?(0,U.jsx)(gT,{view:e,now:Date.now()}):(0,U.jsx)(`p`,{className:`muted`,children:`Loading…`})}function gT({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=Qw(e),u=(0,v.useMemo)(()=>$w(e,r),[e,r]),d=tT(a,u,t),f=(0,v.useMemo)(()=>oT(u,t),[u,t]),p=(0,v.useMemo)(()=>cT(u,s,d,t),[u,s,d,t]),m=(0,v.useMemo)(()=>lT(u,d,t),[u,d,t]),h=$y(`project`,[...new Set($w(e,!1).map(e=>e.computerId))]),g=$y(s===`model`?`model`:`project`,p.keys);if(!e.repo)return(0,U.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,U.jsxs)(`div`,{className:`shared-usage`,children:[(0,U.jsxs)(`div`,{className:`filters`,children:[(0,U.jsxs)(`label`,{children:[`Period `,(0,U.jsx)(`select`,{value:a,onChange:e=>o(e.target.value),children:uT.map(([e,t])=>(0,U.jsx)(`option`,{value:e,children:t},e))})]}),(0,U.jsxs)(`label`,{className:`shared-mine`,title:l?`Only ${l}'s own computers`:`Mine needs this computer to publish its usage too`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:r,disabled:!l,onChange:e=>i(e.target.checked)}),` Mine`]})]}),e.error&&(0,U.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,U.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,U.jsx)(`p`,{className:`muted`,children:r?`None of your computers has published yet.`:`No computer has published yet.`}),f.length>0&&(0,U.jsx)(`div`,{className:`shared-cards`,children:f.map(e=>(0,U.jsx)(_T,{card:e,now:t,color:h},e.fingerprint))}),u.length>0&&(0,U.jsxs)(`section`,{className:`card viz-card`,children:[(0,U.jsxs)(`div`,{className:`viz-card-head`,children:[(0,U.jsx)(`h3`,{children:`Daily tokens`}),(0,U.jsxs)(`div`,{className:`seg-control shared-stack`,role:`group`,"aria-label":`Stack by`,children:[(0,U.jsx)(`span`,{className:`muted`,children:`by`}),dT.map(([e,t])=>(0,U.jsx)(`button`,{className:s===e?`on`:``,onClick:()=>c(e),children:t},e))]})]}),(0,U.jsx)(eb,{items:_}),(0,U.jsx)(nb,{columns:y,series:_})]}),m.length>0&&(0,U.jsxs)(`section`,{className:`card viz-card`,children:[(0,U.jsx)(`h3`,{children:`Who's who`}),(0,U.jsx)(`div`,{className:`table-scroll`,children:(0,U.jsxs)(`table`,{className:`plain`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Person`}),(0,U.jsx)(`th`,{children:`Account`}),(0,U.jsx)(`th`,{children:`Computer`}),(0,U.jsx)(`th`,{className:`num`,children:`Tokens`}),(0,U.jsx)(`th`,{className:`num`,children:`Cost`}),(0,U.jsx)(`th`,{children:`Last published`})]})}),(0,U.jsx)(`tbody`,{children:m.map((e,n)=>{let r=m[n-1],i=r?.login===e.login;return(0,U.jsxs)(`tr`,{className:e.stale?`shared-stale`:``,children:[(0,U.jsx)(`td`,{children:i?``:e.login}),(0,U.jsx)(`td`,{children:i&&r?.fingerprint===e.fingerprint?``:e.account}),(0,U.jsxs)(`td`,{className:`nowrap`,children:[(0,U.jsx)(`span`,{className:`viz-swatch`,style:{background:h(e.computerId)}}),` `,e.computer]}),(0,U.jsx)(`td`,{className:`num`,children:Ky(e.tokens)}),(0,U.jsx)(`td`,{className:`num`,children:qy(e.cost)}),(0,U.jsxs)(`td`,{className:`nowrap`,children:[Wy({at:e.asOf,resetsAt:null},t).replace(/^as of /,``),e.stale&&(0,U.jsx)(`span`,{className:`shared-stale-mark`,title:`No publish for over a day`,children:` · stale`})]})]},`${e.computerId}-${e.fingerprint}`)})})]})})]})]})}function _T({card:e,now:t,color:n}){return(0,U.jsxs)(`section`,{className:`card viz-card shared-card`,children:[(0,U.jsx)(`h3`,{children:e.label}),(0,U.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,U.jsx)(`div`,{className:`muted`,children:`no data yet`}),e.rows.map(e=>{let r=mT(fT,e.kind)??e.kind;if(!e.reading)return null;if(e.reset)return(0,U.jsxs)(`div`,{className:`shared-limit limit-reset`,title:`${r}: the window has reset since the last reading (${Wy(e.reading,t)}).`,children:[(0,U.jsxs)(`div`,{className:`limit-head`,children:[(0,U.jsx)(`span`,{children:r}),(0,U.jsx)(`span`,{className:`limit-status`,children:`reset`})]}),(0,U.jsx)(`div`,{className:`limit-sub muted`,children:(0,U.jsx)(`span`,{children:`no reading since the reset`})})]},e.kind);let i=e.reading.utilization,a=Gy(e.reading,t),o=Math.min(100,(i??0)*100),s=mT(pT,e.reading.status)??{cls:`good`,icon:`●`,label:e.reading.status},c=e.shares.map(e=>`${e.computer} (${e.login}): ${Jy(e.share)}, ${qy(e.cost)}`).join(`
106
+ `);return(0,U.jsxs)(`div`,{className:`shared-limit`,children:[(0,U.jsxs)(`div`,{className:`limit-head`,children:[(0,U.jsx)(`span`,{children:r}),(0,U.jsxs)(`span`,{className:`limit-status ${s.cls}`,title:s.label,children:[s.icon,` `,i==null?s.label:Jy(i)]})]}),(0,U.jsx)(`div`,{className:`limit-track shared-track`,title:c||`No use recorded in this window`,children:(0,U.jsx)(`div`,{className:`shared-fill`,style:{width:`${o}%`},children:e.shares.length?e.shares.map(e=>(0,U.jsx)(`div`,{className:`shared-seg`,style:{flexGrow:e.share,background:n(e.computerId)}},e.computerId)):(0,U.jsx)(`div`,{className:`shared-seg limit-fill ${s.cls}`,style:{flexGrow:1}})})}),(0,U.jsxs)(`div`,{className:`limit-sub muted`,children:[(0,U.jsx)(`span`,{children:e.shares.map(e=>`${e.computer} ${Jy(e.share)}`).join(` · `)}),(0,U.jsxs)(`span`,{className:`limit-forecast${e.pace!=null&&e.pace>=1?` over`:``}`,children:[`≈ `,e.pace==null?`—`:Jy(e.pace),` by reset`]})]}),a&&(0,U.jsx)(`div`,{className:`limit-sub limit-age`,children:a})]},e.kind)})]})}function vT(){return(0,U.jsx)(`div`,{className:`usage-body`,children:(0,U.jsx)(hT,{})})}var yT=[[`week`,`Since weekly reset`],[`7d`,`7 days`],[`30d`,`30 days`],[`90d`,`90 days`],[`all`,`All time`]];function bT(e){return new Date(`${e}T12:00:00`).toLocaleDateString([],{weekday:`short`,day:`numeric`})}var xT=[[`computer`,`This computer`],[`shared`,`Shared`],[`sessions`,`Sessions`]];function ST(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,U.jsxs)(`div`,{className:`usage`,children:[(0,U.jsx)(`header`,{className:`session-head`,children:(0,U.jsx)(`div`,{className:`session-head-text`,children:(0,U.jsx)(`h2`,{children:`Usage`})})}),(0,U.jsx)(`div`,{className:`pane-tabs`,role:`tablist`,"aria-label":`Usage`,children:xT.map(([e,t])=>(0,U.jsx)(`button`,{role:`tab`,"aria-selected":r===e,className:r===e?`on`:``,onClick:()=>i(e),children:t},e))}),r===`computer`?(0,U.jsx)(CT,{onOpenSession:e.onOpenSession}):r===`shared`?(0,U.jsx)(vT,{}):(0,U.jsx)(Kw,{sessions:e.sessions,overview:e.overview,machine:e.machine,waitingBySession:e.waitingBySession,onOpenSession:e.onOpenSession})]})}function CT({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;B.usage(t).then(t=>e&&i(t),t=>e&&o(t.message));let n=setInterval(()=>B.usage(t).then(t=>e&&i(t),()=>{}),3e4);return()=>{e=!1,clearInterval(n)}},[t]);let d=(0,v.useMemo)(()=>({model:$y(`model`,r?.options.models??[]),project:$y(`project`,r?.options.projects??[]),trigger:$y(`trigger`,Zy)}),[r?.options.models,r?.options.projects]);if(a)return(0,U.jsx)(`div`,{className:`usage-body`,children:(0,U.jsx)(`p`,{className:`error`,children:a})});if(!r)return(0,U.jsx)(`div`,{className:`usage-body`,children:(0,U.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():Zy.filter(e=>r.daily.some(t=>t.byTrigger[e]))).map(e=>({key:e,label:s===`trigger`?Qy[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:bT(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,U.jsxs)(`div`,{className:`usage-body`,children:[(0,U.jsxs)(`div`,{className:`muted`,children:[`Since `,new Date(r.since||Date.now()).toLocaleString([],{dateStyle:`medium`,timeStyle:`short`}),r.since===0?` (all time)`:``]}),(0,U.jsxs)(`div`,{className:`filters`,children:[(0,U.jsxs)(`label`,{children:[`Period `,(0,U.jsx)(`select`,{value:t.period,onChange:e=>f({period:e.target.value}),children:yT.map(([e,t])=>(0,U.jsx)(`option`,{value:e,children:t},e))})]}),(0,U.jsxs)(`label`,{children:[`Project `,(0,U.jsxs)(`select`,{value:t.project??``,onChange:e=>f({project:e.target.value||void 0}),children:[(0,U.jsx)(`option`,{value:``,children:`All`}),r.options.projects.map(e=>(0,U.jsx)(`option`,{value:e,children:S(e)},e))]})]}),(r.options.accounts?.length??0)>1&&(0,U.jsxs)(`label`,{children:[`Account `,(0,U.jsxs)(`select`,{value:t.account??``,onChange:e=>f({account:e.target.value||void 0}),children:[(0,U.jsx)(`option`,{value:``,children:`All`}),r.options.accounts.map(e=>(0,U.jsx)(`option`,{children:e},e))]})]}),(0,U.jsxs)(`label`,{children:[`Model `,(0,U.jsxs)(`select`,{value:t.model??``,onChange:e=>f({model:e.target.value||void 0}),children:[(0,U.jsx)(`option`,{value:``,children:`All`}),r.options.models.map(e=>(0,U.jsx)(`option`,{children:e},e))]})]}),(0,U.jsxs)(`label`,{children:[`Branch `,(0,U.jsxs)(`select`,{value:t.branch??``,onChange:e=>f({branch:e.target.value||void 0}),children:[(0,U.jsx)(`option`,{value:``,children:`All`}),r.options.branches.map(e=>(0,U.jsx)(`option`,{children:e},e))]})]}),(0,U.jsxs)(`label`,{children:[`Role `,(0,U.jsxs)(`select`,{value:t.role??``,onChange:e=>f({role:e.target.value||void 0}),children:[(0,U.jsx)(`option`,{value:``,children:`All`}),(0,U.jsx)(`option`,{value:`manager`,children:`Managers`}),(0,U.jsx)(`option`,{value:`session`,children:`Sessions`})]})]}),(0,U.jsxs)(`label`,{children:[`Started by `,(0,U.jsxs)(`select`,{value:t.trigger??``,onChange:e=>f({trigger:e.target.value||void 0}),children:[(0,U.jsx)(`option`,{value:``,children:`All`}),Zy.map(e=>(0,U.jsx)(`option`,{value:e,children:Qy[e]},e))]})]}),g&&(0,U.jsx)(`button`,{className:`small`,onClick:()=>n({period:t.period}),children:`Clear filters`})]}),(0,U.jsxs)(`div`,{className:`tiles`,children:[(0,U.jsx)(rb,{label:`Tokens`,value:Ky(p.tokens),sub:`${Ky(p.output)} output`}),(0,U.jsx)(rb,{label:`API-equivalent cost`,value:qy(p.cost),sub:`not what a plan charges`}),(0,U.jsx)(rb,{label:`Model calls`,value:p.calls.toLocaleString(),sub:`${p.sessions} session${p.sessions===1?``:`s`}`}),(0,U.jsx)(rb,{label:`Cache read share`,value:p.tokens?Jy(p.cacheRead/p.tokens):`—`,sub:`higher is cheaper`}),(0,U.jsx)(rb,{label:`In subagents`,value:p.tokens?Jy(p.subagentTokens/p.tokens):`—`})]}),(0,U.jsxs)(`section`,{className:`card viz-card`,children:[(0,U.jsxs)(`div`,{className:`viz-card-head`,children:[(0,U.jsx)(`h3`,{children:`Daily tokens`}),(0,U.jsx)(`div`,{className:`seg-control`,role:`group`,"aria-label":`Split by`,children:[`model`,`project`,`trigger`].map(e=>(0,U.jsx)(`button`,{className:s===e?`on`:``,onClick:()=>c(e),children:e===`trigger`?`started by`:`by ${e}`},e))})]}),(0,U.jsx)(eb,{items:m}),(0,U.jsx)(nb,{columns:h,series:m})]}),(0,U.jsxs)(`section`,{className:`card viz-card`,children:[(0,U.jsx)(`h3`,{children:`Project × model`}),(0,U.jsx)(`div`,{className:`table-scroll`,children:(0,U.jsxs)(`table`,{className:`matrix`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Project`}),r.models.map(e=>(0,U.jsxs)(`th`,{className:`num`,children:[(0,U.jsx)(`span`,{className:`viz-swatch`,style:{background:d.model(e)}}),` `,e]},e)),(0,U.jsx)(`th`,{className:`num`,children:`Total`}),(0,U.jsx)(`th`,{className:`num`,children:`Cost`}),(0,U.jsx)(`th`,{className:`num`,title:`Share of tokens used by subagents`,children:`Sub`})]})}),(0,U.jsx)(`tbody`,{children:r.matrix.map(e=>(0,U.jsxs)(v.Fragment,{children:[(0,U.jsxs)(`tr`,{className:`matrix-row`,children:[(0,U.jsxs)(`td`,{children:[e.roles.length>1&&(0,U.jsx)(`button`,{className:`caret`,"aria-label":`Show roles`,onClick:()=>u(t=>({...t,[e.project]:!t[e.project]})),children:l[e.project]?`▾`:`▸`}),(0,U.jsx)(`button`,{className:`link`,onClick:()=>f({project:e.project}),children:S(e.project)})]}),r.models.map(t=>(0,U.jsx)(`td`,{className:`num`,children:e.byModel[t]?Ky(e.byModel[t]):``},t)),(0,U.jsx)(`td`,{className:`num strong`,children:Ky(e.tokens)}),(0,U.jsx)(`td`,{className:`num`,children:qy(e.cost)}),(0,U.jsx)(`td`,{className:`num muted`,children:e.subagentShare?Jy(e.subagentShare):``})]}),l[e.project]&&e.roles.map(e=>(0,U.jsxs)(`tr`,{className:`matrix-sub`,children:[(0,U.jsxs)(`td`,{children:[`↳ `,e.role===`manager`?`managers`:`sessions`]}),r.models.map(t=>(0,U.jsx)(`td`,{className:`num`,children:e.byModel[t]?Ky(e.byModel[t]):``},t)),(0,U.jsx)(`td`,{className:`num`,children:Ky(e.tokens)}),(0,U.jsx)(`td`,{className:`num`,children:qy(e.cost)}),(0,U.jsx)(`td`,{className:`num muted`,children:e.subagentShare?Jy(e.subagentShare):``})]},e.role))]},e.project))})]})})]}),(0,U.jsxs)(`section`,{className:`card viz-card`,children:[(0,U.jsx)(`h3`,{children:`Recent sessions`}),(0,U.jsx)(`div`,{className:`table-scroll`,children:(0,U.jsxs)(`table`,{className:`plain`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Last call`}),(0,U.jsx)(`th`,{children:`Session`}),(0,U.jsx)(`th`,{children:`Project`}),(0,U.jsx)(`th`,{children:`Branch`}),(0,U.jsx)(`th`,{children:`Models`}),(0,U.jsx)(`th`,{className:`num`,children:`Calls`}),(0,U.jsx)(`th`,{className:`num`,children:`Tokens`}),(0,U.jsx)(`th`,{className:`num`,children:`Cost`}),(0,U.jsx)(`th`,{className:`num`,children:`Sub`})]})}),(0,U.jsx)(`tbody`,{children:r.recent.map(t=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`nowrap`,children:Og(t.lastAt)}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`link`,onClick:()=>e(t.sessionId),children:[t.role===`manager`?`Manager · `:``,t.title]})}),(0,U.jsx)(`td`,{children:S(t.project)}),(0,U.jsx)(`td`,{className:`muted`,children:t.branch??``}),(0,U.jsx)(`td`,{className:`muted`,children:t.models.join(`, `)}),(0,U.jsx)(`td`,{className:`num`,children:t.calls}),(0,U.jsx)(`td`,{className:`num`,children:Ky(t.tokens)}),(0,U.jsx)(`td`,{className:`num`,children:qy(t.cost)}),(0,U.jsx)(`td`,{className:`num muted`,children:t.subagentShare?Jy(t.subagentShare):``})]},t.sessionId))})]})})]}),(0,U.jsx)(Hw,{})]})}function wT(e){try{return lm(localStorage.getItem(`ledung.sidebar.${e}`))}catch{return null}}function TT(e,t){try{t==null?localStorage.removeItem(`ledung.sidebar.${e}`):localStorage.setItem(`ledung.sidebar.${e}`,String(t))}catch{}}function ET(){let[e,t]=(0,v.useState)(()=>window.matchMedia(om).matches),[n,r]=(0,v.useState)({w:window.innerWidth,h:window.innerHeight}),[i,a]=(0,v.useState)(()=>({width:wT(`width`),height:wT(`height`)})),o=e?`height`:`width`;(0,v.useEffect)(()=>{let e=window.matchMedia(om),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}=sm(o,e?n.h:n.w),u=cm(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=>{TT(o,e),a(t=>({...t,[o]:e}))};return(0,U.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(cm(e?t.clientY-n.top:t.clientX-n.left,s,c))},onDoubleClick:()=>d(null),onKeyDown:e=>{let t=um(e.key,o,u,s,c);t!=null&&(e.preventDefault(),d(t))}})}var DT=`ledung.composer.height`,OT=.75;function kT(e,t,n,r,i,a){return Math.ceil(Math.max(e,t*n+r+i,a))}function AT(e,t,n){return{min:e,max:Math.max(e,Math.floor(t*OT-n))}}function jT(e,t,n,r,i){return cm(e+(t-n),r,i)}function MT(e,t,n,r){return e===`ArrowUp`?cm(t+20,n,r):e===`ArrowDown`?cm(t-20,n,r):e===`Home`?n:e===`End`?r:null}function NT(e){try{return lm(e.getItem(DT))}catch{return null}}function PT(e,t){try{t==null?e.removeItem(DT):e.setItem(DT,String(t))}catch{}}function FT(){try{return localStorage}catch{return null}}function IT(){let e=(0,v.useRef)(null),t=(0,v.useRef)(null),[n,r]=(0,v.useState)(()=>{let e=FT();return e?NT(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 AT(kT(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?cm(n,i.min,i.max):n,c=e=>{let t=FT();t&&PT(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(jT(t.h,t.y,e.clientY,i.min,i.max))},f=()=>{l.current=null},p=(0,U.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=MT(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 LT(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 RT(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}}var zT=[`once`,`session`,`kept`,`project`],BT={once:`Once: this message`,session:`This session`,kept:`This session, until removed`,project:`All sessions of the project, until removed`},VT=e=>`[🔑 ${e}]`,HT=/\[🔑 ([a-z][a-z0-9._-]{0,39})\]/g;function UT(e){return[...new Set([...e.matchAll(HT)].map(e=>e[1]))]}var WT=e=>e.toUpperCase().replace(/[^A-Z0-9]/g,`_`),GT=new Set(`PATH.HOME.USER.USERNAME.LOGNAME.SHELL.PWD.OLDPWD.TMP.TEMP.TMPDIR.LANG.TERM.IFS.ENV.PS1.PS2.PS4.PROMPT_COMMAND.HOSTNAME.SHLVL.CDPATH.SHELLOPTS.BASHOPTS.NODE_OPTIONS.PATHEXT.COMSPEC.SYSTEMROOT.WINDIR.APPDATA.LOCALAPPDATA.USERPROFILE.PROGRAMFILES.HOMEDRIVE.HOMEPATH.EDITOR.VISUAL.PAGER.LESS.LESSOPEN.ZDOTDIR.HISTFILE.PSMODULEPATH.PROMPT.MAIL.TZ.DISPLAY.SHELL_SESSION_HISTORY.PERLLIB.GEM_HOME.GEM_PATH.CARGO_HOME.GOPATH.GOFLAGS.MAKEFLAGS.CC.CXX`.split(`.`)),KT=`LEDUNG_.CLAUDE_.ANTHROPIC_.BASH_.LD_.DYLD_.LC_.MCP_.OTEL_.GIT_.NODE_.NPM_CONFIG_.PYTHON.PERL.RUBY.JAVA_.XDG_.MSYS.SSH_.SSL_.DOCKER_.KUBE.ELECTRON_.CURL_.REQUESTS_.GH_HOST.GH_CONFIG`.split(`.`),qT=[`_PROXY`];function JT(e){if(!/^[a-z][a-z0-9._-]{0,39}$/.test(e))return`A name is 1 to 40 small letters, digits, "-", "_" or ".", starting with a letter.`;let t=WT(e);return GT.has(t)||KT.some(e=>t.startsWith(e))||qT.some(e=>t.endsWith(e))||t===`NO_PROXY`?`$${t} is used by the shell, Claude Code or Ledung; choose another name.`:null}var YT=[[/^(?:gh[pousr]_|github_pat_)/,`github-token`],[/^npm_/,`npm-token`],[/^sk-/,`api-key`],[/^AKIA[0-9A-Z]{16}$/,`aws-key`],[/^xox[abposr]-/,`slack-token`],[/^eyJ[\w-]+\.eyJ/,`jwt`],[/^-----BEGIN [A-Z ]*PRIVATE KEY-----/,`private-key`]],XT={password:`password`,passwd:`password`,pwd:`password`,pw:`password`,pass:`password`,passphrase:`passphrase`,pin:`pin`,token:`token`,secret:`secret`,key:`key`,apikey:`api-key`,code:`code`,credential:`credential`,credentials:`credential`},ZT=new Set([`the`,`my`,`a`,`an`,`is`,`your`,`our`,`this`,`that`,`here`,`use`,`with`,`for`,`and`,`to`,`it`,`of`,`new`,`as`,`its`,`are`,`was`]);function QT(e,t,n=[]){let r=YT.find(([e])=>e.test(t.trim()))?.[1];if(!r){let t=e.toLowerCase().match(/[a-z0-9]+/g)?.slice(-5)??[];for(let e=t.length-1;e>=0&&!r;e--){let n=XT[t[e]];if(!n)continue;let i=t[e-1];r=i&&!ZT.has(i)&&/^[a-z][a-z0-9]{0,15}$/.test(i)&&!XT[i]?`${i}-${n}`:n,i===`api`&&n===`key`&&(r=`api-key`)}}if(r??=`secret`,JT(r)&&(r=`secret`),!n.includes(r))return r;for(let e=2;;e++)if(!n.includes(`${r}-${e}`))return`${r}-${e}`}function $T(e,t,n){let r=Math.min(t,n),i=Math.max(t,n);for(;r<i&&/\s/.test(e[r]);)r++;for(;i>r&&/\s/.test(e[i-1]);)i--;if(r>=i)return null;for(let t of e.matchAll(/\[🔑 [^\]\n]*\]/g))if(t.index<i&&t.index+t[0].length>r)return null;return{start:r,end:i}}function eE(e,t,n,r,i){let a=VT(i),o=n.slice(0,r.start)+a+n.slice(r.end);return Tw(e,t,o),{text:o,caret:r.start+a.length}}function tE(e,t,n){let r=e.slice(0,t),i=e.slice(t),a=`${r&&!/\s$/.test(r)?` `:``}${VT(n)}${i&&!/^\s/.test(i)?` `:``}`;return{text:r+a+i,caret:r.length+a.length}}function nE(e,t,n){let r=VT(t);return n===null?e.split(`${r} `).join(``).split(r).join(``):e.split(r).join(VT(n))}function rE(e,t){let n=UT(e);return{known:n.map(e=>t.find(t=>t.name===e)).filter(e=>!!e),missing:n.filter(e=>!t.some(t=>t.name===e))}}var iE=new Map;function aE(e,t){for(let n of iE.get(e)??[])n(t)}function oE(e,t){let n=iE.get(e)??new Set;return n.add(t),iE.set(e,n),()=>{n.delete(t),n.size||iE.delete(e)}}function sE(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)([]),[A,j]=(0,v.useState)([]),[M,N]=(0,v.useState)([]),[P,F]=(0,v.useState)([]),[I,ee]=(0,v.useState)(null),[te,ne]=(0,v.useState)([]),[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,L]=(0,v.useState)({chats:null,newProjects:null}),[R,me]=(0,v.useState)([`full`]),[he,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,Te]=(0,v.useState)([]),[Ee,De]=(0,v.useState)(null),[Ae,je]=(0,v.useState)(null),[Me,z]=(0,v.useState)([]),[Ne,Pe]=(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 B.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 RT(n.id,t=>B.messagesAfter(e,t));He.current===e&&f(e=>LT(e,r))},[We]),Ke=(0,v.useCallback)(async()=>{let e=He.current,t=d[0];if(!e||!t)return;let n=await B.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=ke(`${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`secrets`:aE(t.sessionId,t.secrets);break;case`hello`:Ve.current===null?Ve.current=t.build:Ve.current!==t.build&&x(!0),we(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),j(t.usageStops??[]),N(t.macros??[]),ue(t.away??null),o(t.sessions),c(t.projects),Se(t.board??null),Te(t.github??[]),me(t.profiles??[`full`]),ge(t.lockdownB??null),ve(t.bangShell??`Git Bash`),De(t.remote??null),je(t.chats??null),z(t.computers??[]),Pe(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(()=>{}),B.machine().then(ce,()=>{}),B.accounts().then(e=>{fe(e.accounts),be(e.defaultIdentity),L(e.choices),F(e.signedOut??[]),ee(e.claudeProblem??null),ne(e.claudeLooked??[]),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`:N(t.macros);break;case`usageStops`:j(t.usageStops);break;case`config`:Be(t.config);break;case`projects`:c(t.projects);break;case`accounts`:fe(t.accounts),be(t.defaultIdentity),L(t.choices),F(t.signedOut??[]),ee(t.claudeProblem??null),ne(t.claudeLooked??[]),ie(t.configFileProblems??[]);break;case`board`:Se(t.board);break;case`github`:Te(t.github);break;case`remote`:De(t.remote);break;case`newComputers`:Pe(t.computers);break;case`linkPairings`:Ie(t.pairings);break;case`chats`:je(t.chats);break;case`computers`:z(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(),Oe(()=>{r||(clearTimeout(a),e&&(e.onopen=e.onclose=e.onmessage=null,e.close()),t=500,s())}),()=>{r=!0,Oe(null),clearTimeout(a),e?.close()}},[Ge]),(0,v.useEffect)(()=>{let e=!0,t=()=>B.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:A,macros:M,signedOut:P,claudeProblem:I,claudeLooked:te,accountProblems:re,overview:ae,machine:se,away:le,accounts:de,accountChoices:pe,defaultIdentity:ye,board:xe,github:Ce,remote:Ee,computers:Me,newComputers:Ne,linkPairings:Fe,throughPublicName:Le,configStatus:ze,chats:Ae,profiles:R,lockdownB:he,bangShell:_e,sessions:a,projects:s,permissions:l,messages:d,hasEarlier:p,loadEarlier:Ke}}var cE=(e,t=140)=>{let n=e.split(`
107
+ `).map(e=>e.trim()).find(Boolean)??``;return n.length>t?`${n.slice(0,t-1)}…`:n},lE=e=>typeof e==`string`?e:``;function uE(e){let t=e.input.questions;return cE(lE(Array.isArray(t)?t[0]?.question:void 0)||e.title||lE(e.input.command)||lE(e.input.file_path)||e.reason||``)}function dE(e,t,n){return[...e.filter(iy).map(e=>({id:`q${e.id}`,sessionId:e.sessionId,title:`Question from ${n(e.sessionId)}`,body:cE(e.question)})),...t.filter(ay).map(e=>{let t=uE(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 fE={five_hour:`5-hour`,seven_day:`weekly`};function pE(e){return e.filter(e=>e.holding).map(e=>({id:`stop:${e.account}:${e.kind}:${e.resetsAt??``}`,sessionId:`settings`,title:`Usage stop reached: ${fE[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 mE(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 hE=()=>window.isSecureContext&&`Notification`in window,gE=`ledung.notify`,_E=()=>{try{return localStorage.getItem(gE)===`1`}catch{return!1}};function vE(e){let t=hE(),[n,r]=(0,v.useState)(_E),[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=mE(s.current,[...dE(e.questions,e.permissions,t=>e.sessions.find(e=>e.id===t)?.title??`a session`),...pE(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(gE,`0`)}catch{}return}let t=Notification.permission===`granted`?`granted`:await Notification.requestPermission();a(t);let n=t===`granted`;r(n);try{localStorage.setItem(gE,n?`1`:`0`)}catch{}}}}function yE(e,t){return e.key!==`Enter`||e.isComposing?!1:t?e.ctrlKey||e.metaKey:!e.shiftKey}var bE=80;function xE(e,t,n){if(Math.abs(n-1)>.01)return 0;let r=Math.round(e-t);return r>=bE?r:0}var SE=new Set([`button`,`checkbox`,`color`,`file`,`hidden`,`image`,`radio`,`range`,`reset`,`submit`]);function CE(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`&&!SE.has((e.type??`text`).toLowerCase())}var wE=400;function TE(e){let t=e.visualViewport;if(!t)return;let n=e.document,r=n.documentElement,i=0,a=()=>{let a=CE(n.activeElement)?xE(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,wE)};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 EE=(0,U.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,"aria-hidden":`true`,children:[(0,U.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`}),(0,U.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 DE(e){return(0,U.jsxs)(U.Fragment,{children:[EE,`Remote`,e&&(0,U.jsxs)(`span`,{className:`long`,children:[`\xA0`,`· `,e]})]})}function OE({frame:e,shown:t=null,onShow:n,waiting:r=0}){let{tabs:i,remote:a,here:o}=e;return i?(0,U.jsxs)(`nav`,{className:`ctabs`,"aria-label":`Computers`,children:[i.map(e=>{let i=Ht(e,t,r),a=i?(0,U.jsx)(`span`,{className:`badge`,title:`${i} waiting for you on ${e.name}`,"aria-label":`${i} waiting for you`,children:i}):null,o=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`sw`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`nm`,children:e.name}),a]}),s=e.here?t===null:t===e.id;return e.here?s||!n?(0,U.jsx)(`span`,{className:`ctab on`,style:zt(e),"aria-current":`page`,children:o},e.id):(0,U.jsx)(`button`,{type:`button`,className:`ctab`,style:zt(e),onClick:()=>n(null),children:o},e.id):e.url?(0,U.jsx)(`a`,{className:`ctab${s?` on`:``}`,style:zt(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&&Vt(t)&&(t.preventDefault(),n(e.id))},children:o},e.id):null}),(0,U.jsx)(`span`,{className:`spacer`}),a&&(0,U.jsx)(`span`,{className:`remote-tag`,role:`status`,children:DE(o?.name)})]}):a?(0,U.jsx)(`div`,{className:`remote-band`,role:`status`,children:DE(o?.name)}):null}function kE({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)en({data:e.data,origin:e.origin,fromFrame:e.source===l.current[t.id]?.contentWindow},{id:t.id,url:t.url},localStorage,t=>e.source.postMessage(t,e.origin))&&(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(Pt(),new URL(e.url).origin),u.current[e.id]=setTimeout(()=>c(t=>({...t,[e.id]:`not-paired`})),At)};return d.length?(0,U.jsx)(U.Fragment,{children:d.map(e=>(0,U.jsxs)(`div`,{className:`cframe-box`,hidden:n!==e.id,children:[Nt(e,r,i,s[e.id]??`unknown`)&&!a[e.id]&&(0,U.jsx)(AE,{computer:e,onCode:t=>o(n=>({...n,[e.id]:t}))}),a[e.id]?(0,U.jsx)(`iframe`,{className:`cframe`,style:zt(e),src:a[e.id],title:`${e.name}'s Ledung`,allow:`publickey-credentials-get; publickey-credentials-create`},`pairing`):(0,U.jsx)(`iframe`,{className:`cframe`,style:zt(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 AE({computer:e,onCode:t}){let[n,r]=(0,v.useState)(`offer`),[i,a]=(0,v.useState)(null);return(0,U.jsxs)(`div`,{className:`cframe-bar`,style:zt(e),role:n===`offer`?void 0:`alertdialog`,"aria-label":`Pair through the link with ${e.name}`,children:[n===`offer`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`span`,{children:[`Not paired with `,e.name,` in this tab? It is linked with this computer.`]}),(0,U.jsx)(`button`,{type:`button`,className:`small`,onClick:()=>r(`confirm`),children:`Pair through the link`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`span`,{children:[`Pair this browser with `,(0,U.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,U.jsx)(`button`,{type:`button`,className:`small`,disabled:n===`busy`,onClick:()=>{r(`busy`),a(null),B.linkDevicePair(e.id).then(({url:e})=>t(e),e=>{a(e.message),r(`offer`)})},children:n===`busy`?`Pairing…`:`Pair`}),(0,U.jsx)(`button`,{type:`button`,className:`small`,disabled:n===`busy`,onClick:()=>r(`offer`),children:`Cancel`})]}),i&&(0,U.jsx)(`span`,{className:`restart-problem`,children:i})]})}function jE(e,t){(0,v.useEffect)(()=>{if(t)return;let n=()=>{let t=Rt(location.hash);t&&(history.replaceState(history.state,``,location.pathname+location.search),e(t))};return n(),window.addEventListener(`hashchange`,n),()=>window.removeEventListener(`hashchange`,n)},[])}var ME=[`Claude gets only the name; the value is in the environment of the session's commands, as $NAME.`,`A session that was running before this Ledung release gets its secrets from its next start or resume.`,`Claude Code's PowerShell tool and MCP servers see only the secrets the session had when it started (never a "once" one), and keep them until it restarts, even when removed.`,`While the session can use a secret, its value is in a file only you can read.`];function NE(e,t){let n=getComputedStyle(e),r=document.createElement(`div`);for(let e of[`boxSizing`,`width`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`borderTopWidth`,`borderRightWidth`,`borderBottomWidth`,`borderLeftWidth`,`borderStyle`,`fontFamily`,`fontSize`,`fontWeight`,`fontStyle`,`letterSpacing`,`lineHeight`,`textTransform`,`wordSpacing`,`tabSize`])r.style[e]=n[e];Object.assign(r.style,{position:`absolute`,visibility:`hidden`,top:`0`,left:`-9999px`,whiteSpace:`pre-wrap`,overflowWrap:`break-word`,overflow:`hidden`}),r.textContent=e.value.slice(0,t);let i=document.createElement(`span`);i.textContent=`​`,r.appendChild(i),document.body.appendChild(r);let a=parseFloat(n.lineHeight)||parseFloat(n.fontSize)*1.3,o={left:i.offsetLeft-e.scrollLeft,top:i.offsetTop-e.scrollTop+a};return r.remove(),o}function PE({left:e,top:t,onLock:n}){return(0,U.jsx)(`button`,{type:`button`,className:`secret-key-float`,style:{left:e,top:t},title:`Lock the selected text as a secret: Claude gets its name, never the value`,"aria-label":`Lock the selected text as a secret`,onPointerDown:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onClick:n,children:`🔑`})}function FE({value:e,onChange:t,disabled:n}){return(0,U.jsx)(`select`,{value:e,disabled:n,onChange:e=>t(e.target.value),"aria-label":`How long it lasts`,children:zT.map(e=>(0,U.jsx)(`option`,{value:e,children:BT[e]},e))})}function IE({known:e,missing:t,onOpen:n}){return!e.length&&!t.length?null:(0,U.jsxs)(`div`,{className:`secret-chips`,"aria-label":`Locked secrets in this message`,children:[e.map(e=>(0,U.jsxs)(`button`,{type:`button`,className:`secret-chip`,title:`$${e.env} · ${BT[e.lifetime]}: change or remove`,onClick:()=>n(e.id),children:[`🔑 `,e.name]},e.id)),t.map(e=>(0,U.jsxs)(`span`,{className:`secret-chip gone`,title:`This secret was removed: Claude gets the text as typed`,children:[`🔑 `,e]},e))]})}function LE({sessionId:e,secret:t,running:n,run:r,onRenamed:i,onRemoved:a,onClose:o}){let s=H(),[c,l]=(0,v.useState)(t.name),u=(0,v.useRef)(null);(0,v.useEffect)(()=>l(t.name),[t.name]),(0,v.useEffect)(()=>{u.current?.focus(),u.current?.select()},[t.id]);let d=c===t.name?null:JT(c),f=()=>{if(c===t.name||d)return;let n=t.name;r(async()=>{await B.editSecret(e,t.id,{name:c}),i(n,c)})};return(0,U.jsxs)(`div`,{className:`secret-pop`,role:`dialog`,"aria-label":`Locked secret`,children:[(0,U.jsxs)(`div`,{className:`secret-pop-head`,children:[(0,U.jsx)(`strong`,{children:`🔑 Locked`}),(0,U.jsxs)(`span`,{className:`muted`,children:[`Claude gets `,(0,U.jsxs)(`code`,{children:[`$`,t.env]}),`, never the value.`]})]}),(0,U.jsxs)(`label`,{className:`secret-field`,children:[(0,U.jsx)(`span`,{children:`Name`}),(0,U.jsx)(`input`,{...s,ref:u,value:c,spellCheck:!1,autoCapitalize:`off`,onChange:e=>l(e.target.value.toLowerCase()),onBlur:f,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),f()):e.key===`Escape`&&o()}})]}),d&&(0,U.jsx)(`span`,{className:`error`,children:d}),(0,U.jsxs)(`label`,{className:`secret-field`,children:[(0,U.jsx)(`span`,{children:`Lasts`}),(0,U.jsx)(FE,{value:t.lifetime,onChange:n=>void r(()=>B.editSecret(e,t.id,{lifetime:n}))})]}),n&&!t.reachesNow&&(0,U.jsx)(`span`,{className:`muted small-note`,children:ME[1]}),(0,U.jsxs)(`div`,{className:`secret-pop-buttons`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>void r(async()=>{await B.removeSecret(e,t.id),a(t.name)}),children:`Remove`}),(0,U.jsx)(`button`,{type:`button`,className:`primary`,onClick:()=>{f(),o()},children:`Done`})]})]})}function RE({sessionId:e,taken:t,run:n,onLocked:r,onClose:i}){let a=H(),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(()=>QT(``,``,t)),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(`session`),m=(0,v.useRef)(null);(0,v.useEffect)(()=>m.current?.focus(),[]);let h=JT(c),g=()=>{o&&!h&&n(async()=>{await B.addSecret(e,{name:c,value:o,lifetime:f}),s(``),r(c)})};return(0,U.jsxs)(`div`,{className:`secret-pop`,role:`dialog`,"aria-label":`Lock a secret`,children:[(0,U.jsxs)(`div`,{className:`secret-pop-head`,children:[(0,U.jsx)(`strong`,{children:`🔑 Lock a secret`}),(0,U.jsx)(`span`,{className:`muted`,children:`Paste or type it; it is never shown, and Claude gets only its name.`})]}),(0,U.jsxs)(`label`,{className:`secret-field`,children:[(0,U.jsx)(`span`,{children:`Secret`}),(0,U.jsx)(`input`,{ref:m,type:`password`,autoComplete:`off`,value:o,onChange:e=>{s(e.target.value),u||l(QT(``,e.target.value,t))},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),g()):e.key===`Escape`&&i()}})]}),(0,U.jsxs)(`label`,{className:`secret-field`,children:[(0,U.jsx)(`span`,{children:`Name`}),(0,U.jsx)(`input`,{...a,value:c,spellCheck:!1,autoCapitalize:`off`,onChange:e=>{d(!0),l(e.target.value.toLowerCase())}})]}),h&&c&&(0,U.jsx)(`span`,{className:`error`,children:h}),(0,U.jsxs)(`label`,{className:`secret-field`,children:[(0,U.jsx)(`span`,{children:`Lasts`}),(0,U.jsx)(FE,{value:f,onChange:p})]}),(0,U.jsxs)(`div`,{className:`secret-pop-buttons`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:i,children:`Cancel`}),(0,U.jsx)(`button`,{type:`button`,className:`primary`,disabled:!o||!!h,onClick:g,children:`Lock`})]})]})}function zE({sessionId:e,secrets:t,running:n,run:r}){return(0,U.jsxs)(`div`,{className:`menu-row secrets-row`,children:[(0,U.jsx)(`span`,{className:`menu-label`,children:`Secrets`}),!t.length&&(0,U.jsx)(`span`,{className:`muted`,children:`None. Select text in the message box and press 🔑 to lock one.`}),!!t.length&&(0,U.jsx)(`ul`,{className:`secrets-list`,children:t.map(t=>(0,U.jsxs)(`li`,{children:[(0,U.jsxs)(`span`,{className:`secret-name`,children:[`🔑 `,t.name,` `,(0,U.jsxs)(`code`,{className:`muted`,children:[`$`,t.env]}),n&&!t.reachesNow&&(0,U.jsx)(`span`,{className:`muted`,title:ME[1],children:` · from the next start`})]}),(0,U.jsx)(FE,{value:t.lifetime,onChange:n=>void r(()=>B.editSecret(e,t.id,{lifetime:n}))}),(0,U.jsx)(`button`,{type:`button`,className:`small`,onClick:()=>void r(()=>B.removeSecret(e,t.id)),children:`Remove`})]},t.id))}),(0,U.jsxs)(`details`,{className:`secrets-limits`,children:[(0,U.jsx)(`summary`,{className:`muted`,children:`How far a secret reaches`}),(0,U.jsx)(`ul`,{children:ME.map(e=>(0,U.jsx)(`li`,{children:e},e))})]})]})}function BE(e){let[t,n]=(0,v.useState)([]),r=(0,v.useCallback)(async()=>{aE(e,await B.secrets(e))},[e]);return(0,v.useEffect)(()=>{n([]);let t=oE(e,n);return r().catch(()=>{}),t},[e,r]),[t,r]}function VE(e){let t=e instanceof Error?`${e.name}: ${e.message}`:String(e);return/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|ChunkLoadError|Loading chunk \S+ failed|Unable to preload CSS/i.test(t)}function HE(e){return e instanceof Error?e.stack&&e.stack.includes(e.message)?e.stack:`${e.name}: ${e.message}${e.stack?`\n${e.stack}`:``}`:String(e)}var UE=`main`;function WE(e,t){let n=`#/wf/${encodeURIComponent(e)}`;return t&&t!==UE?`${n}/${t}`:n}function GE(e){let t=/^#\/wf\/([^/]+)(?:\/([^/]+))?$/.exec(e);if(!t)return null;let n;try{n=decodeURIComponent(t[1])}catch{return null}return{project:n,flow:t[2]===void 0||t[2]===UE?null:t[2]}}var KE=null;function qE(e){KE=e}function JE(e){return KE?GE(e)?.project===KE.project?null:KE:null}var YE=0,XE=()=>{YE=Date.now()},ZE=(e=1e3)=>Date.now()-YE<e,QE=`Removed projects`;function $E(e,t,n){return t===QE?!n.has(e.project)&&e.project!==`~chats`:e.project===t}var eD=Bt();eD&&window.addEventListener(`message`,e=>{let t=Ft(e.data,e.source===window.parent);t&&window.parent.postMessage(t,e.origin)});var tD={default:`Ask`,acceptEdits:`Accept edits`,auto:`Auto`,plan:`Plan`},nD={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.`},rD=[`waiting`,`usage`,`overview`,`board`,`settings`,`add`,`accounts`,`chat`,`chats`],iD=e=>!!e&&!rD.includes(e)&&!e.includes(`:`),aD=(0,v.lazy)(()=>Q_(()=>import(`./WorkflowView-CyCShexJ.js`).then(e=>({default:e.WorkflowView})),__vite__mapDeps([0,1]))),oD=class extends v.Component{state={failed:!1,error:null};static getDerivedStateFromError(e){return{failed:!0,error:e}}componentDidCatch(e,t){console.error(`Ledung: this page failed.`,e,t.componentStack??``)}render(){if(!this.state.failed)return this.props.children;let e=VE(this.state.error);return(0,U.jsx)(`div`,{className:`page-view`,children:(0,U.jsxs)(`div`,{className:`page-body`,children:[(0,U.jsx)(`p`,{children:e?`This page couldn't be loaded; Ledung may have been updated since this page was opened.`:`This page ran into an error while showing it, so reloading may not help: the details below say what went wrong.`}),(0,U.jsx)(`button`,{className:`primary`,onClick:()=>location.reload(),children:`Reload`}),(0,U.jsxs)(`details`,{className:`page-error-details`,open:!e,children:[(0,U.jsx)(`summary`,{children:`Details`}),(0,U.jsx)(`pre`,{className:`mono`,children:HE(this.state.error)})]})]})})}};function sD(){let e=location.hash.match(/^#\/waiting\/q\/(\d+)$/);if(e)return`q:${e[1]}`;let t=DC(location.hash);if(t)return wC(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=GE(location.hash);if(i)return`wf:${i.project}`;try{let e=location.hash.match(/^#\/ps\/([^/]+)\/([a-z]+)$/);if(e)return`ps:${decodeURIComponent(e[1])}/${e[2]}`;let t=location.hash.match(/^#\/(p|ps|a)\/(.+)$/);if(t)return`${t[1]}:${decodeURIComponent(t[2])}`}catch{return null}return(Sg(location.hash)??wg(location.hash))?.sessionId??null}function cD(e){if(!e)return``;if(rD.includes(e))return`#/${e}`;let t=TC(e);if(t)return EC(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=Ep(e);if(n?.project!=null&&n.group)return`#/ps/${encodeURIComponent(n.project)}/${n.group}`;let r=e.match(/^(p|ps|a|wf):(.+)$/);return r?`#/${r[1]}/${encodeURIComponent(r[2])}`:`#/s/${e}`}var lD=()=>history.state??{},uD=()=>Number(lD().ledungDesk??0),dD=()=>lD().ledungDeskRoot===!0;function fD(e){Jh(e)&&lD().ledungDesk===void 0&&history.replaceState({...lD(),ledungDesk:0,ledungDeskRoot:!0},``)}function pD(){let e=history.state??{};return{depth:Number(e.ledungSettings??0),root:e.ledungSettingsRoot===!0}}function mD(e){gw(e)&&(history.state??{}).ledungSettings===void 0&&history.replaceState({...history.state??{},ledungSettings:1,ledungSettingsRoot:!0},``)}var hD=`ledung.waitingSidebar`;function gD(e){try{return localStorage.getItem(`ledung.technical.${e}`)===`1`}catch{return!1}}function _D(){let[e,t]=(0,v.useState)(sD()),[n,r]=(0,v.useState)(location.hash),i=sE(iD(e)?e:null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)([]);jE(e=>{c(e),u(t=>t.includes(e)?t:[...t,e])},eD);let d=(0,v.useRef)({hash:location.hash,state:history.state});(0,v.useEffect)(()=>{fD(sD()),mD(sD()),d.current={hash:location.hash,state:history.state};let e=()=>{let e=JE(location.hash);e?(history.pushState(d.current.state,``,d.current.hash||location.pathname),XE(),e.ask(()=>{qE(null),history.back()})):(fD(sD()),mD(sD()),d.current={hash:location.hash,state:history.state},t(sD()),r(location.hash))};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let f=n=>{let i=cD(n),a=JE(i);if(a)a.ask(()=>{qE(null),f(n)});else{if(i!==location.hash){let t=Yh(e,{depth:uD(),root:dD()},n),r=_w(e,pD(),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)}},p=e=>{history.replaceState(history.state,``,cD(e)),t(e),r(location.hash)},m=(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??bg(o);location.hash=xg(c,n),history.replaceState({...history.state??{},ledungDesk:0,ledungDeskRoot:!1,ledungFrom:s},``),t(c),r(location.hash)},h=(n,a)=>{let o=e===`waiting`?`queue`:e?.startsWith(`q:`)?i.questions[Number(e.slice(2))]?.shots?`shots`:`question`:void 0;location.hash=Cg(n,a),history.replaceState({...history.state??{},ledungDesk:0,ledungDeskRoot:!1,ledungFrom:o},``),t(n),r(location.hash)},g=()=>{let e=uD();e>0&&!dD()?history.go(-e):f(Sw(window.matchMedia(om).matches))},_=()=>{`back`in xw(history.state)?history.back():f(null)},y=()=>{`back`in Xh(uD())?history.back():f(`waiting`)},b=()=>{let e=vw(pD());`back`in e?history.go(-e.back):f(null)},x=gw(e),C=(0,v.useRef)(b);C.current=b,(0,v.useEffect)(()=>{if(!x)return;let e=e=>{yw(e)&&(e.preventDefault(),C.current())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[x]),(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&&!ZE()&&(n?history.back():history.forward())},100)};return window.addEventListener(`mouseup`,e),()=>window.removeEventListener(`mouseup`,e)},[]);let[w,T]=(0,v.useState)(()=>{try{return localStorage.getItem(hD)===`hidden`}catch{return!1}}),E=()=>{T(!w);try{localStorage.setItem(hD,w?`shown`:`hidden`)}catch{}},D=Jh(e)&&w,O=(0,v.useMemo)(()=>Object.values(i.questions).sort((e,t)=>t.id-e.id),[i.questions]),k=(0,v.useMemo)(()=>Object.values(i.permissions),[i.permissions]),A=oy(O,k)+i.newComputers.length+i.linkPairings.length,j=dS(),M=vE({loaded:i.loaded,questions:O,permissions:k,sessions:i.sessions,usageStops:i.usageStops,onOpenSession:f});(0,v.useEffect)(()=>{document.title=A?`(${A}) Project Ledung`:`Project Ledung`},[A]);let N=(0,v.useMemo)(()=>{let e={};for(let t of k)t.status===`pending`&&(e[t.sessionId]=(e[t.sessionId]??0)+1);for(let t of O)t.status===`open`&&(e[t.sessionId]=(e[t.sessionId]??0)+1);return e},[k,O]),P=i.sessions.find(t=>t.id===e)??null,F=Ap(e),I=F?.startsWith(`ps:`)?i.projects.find(e=>e.name===F.slice(3)):void 0,ee=F===`ledung`?t=>(0,U.jsx)(iC,{view:e,update:t,run:ae,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:M,onOpen:f}):F===`add`?()=>(0,U.jsx)(Ym,{run:ae,accounts:i.accounts,defaultAccount:i.accountChoices.newProjects,profiles:i.profiles,lockdownB:i.lockdownB,onAdded:e=>f(e.managerId??`p:${e.name}`)}):F===`chats`?()=>(0,U.jsx)(eh,{view:e,chats:i.chats,run:ae,onOpen:f}):I?()=>(0,U.jsx)(Xm,{view:e,board:i.board,projects:i.projects,project:I,run:ae,accounts:i.accounts,profiles:I.profileNames??i.profiles,lockdownB:i.lockdownB,onOpen:f,onRemoved:()=>f(null),onRenamed:p,onWorkflow:()=>f(`wf:${I.name}`)},I.name):null,[te,ne]=(0,v.useState)(()=>{try{return localStorage.getItem(`ledung.limitAccount`)}catch{return null}}),re=By(e,i.sessions,i.projects,te),ie=re.account;(0,v.useEffect)(()=>{if(re.remember&&re.account!==te){ne(re.account);try{localStorage.setItem(`ledung.limitAccount`,re.account)}catch{}}},[re.remember,re.account,te]);let ae=async e=>{o(null);try{await e()}catch(e){o(e.message)}},oe=(0,U.jsxs)(U.Fragment,{children:[i.updated&&(0,U.jsxs)(`div`,{className:`banner updated`,children:[(0,U.jsx)(`span`,{children:`Ledung was updated — reload`}),(0,U.jsx)(`button`,{className:`small primary`,onClick:()=>location.reload(),children:`Reload`})]}),i.away&&vb(i.away,P)&&(0,U.jsx)(hb,{away:i.away,run:ae}),j.notice&&(0,U.jsx)(pS,{app:j,run:ae}),(0,U.jsx)(OS,{run:ae}),i.usageStops.filter(e=>e.holding).map(e=>(0,U.jsxs)(`div`,{className:`banner updated`,children:[(0,U.jsx)(`span`,{children:jy(e)}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>void ae(()=>B.liftUsageStop(e.account,e.kind)),children:`Lift`}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>f(Sp(`usageStop`)),children:`Settings`})]},`${e.account}:${e.kind}`)),i.claudeProblem&&(0,U.jsxs)(`div`,{className:`banner updated signin`,role:`alert`,children:[(0,U.jsx)(`span`,{children:(0,U.jsx)(Ob,{text:i.claudeProblem})}),(0,U.jsx)(Db,{check:async()=>!!(await B.checkSignIn()).claudeProblem}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>f(Sp(`claudeProblem`)),children:`Settings`}),i.claudeLooked.length>0&&(0,U.jsx)(kb,{looked:i.claudeLooked})]}),i.configStatus?.problem&&(0,U.jsxs)(`div`,{className:`banner updated signin`,role:`alert`,children:[(0,U.jsxs)(`span`,{children:[`The config file was changed but not applied: `,i.configStatus.problem]}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>f(Sp(`configProblem`)),children:`Settings`})]}),i.signedOut.map(e=>(0,U.jsxs)(`div`,{className:`banner updated signin`,children:[(0,U.jsx)(`span`,{children:e.help.split("`").map((e,t)=>t%2?(0,U.jsx)(`code`,{children:e},t):e)}),(0,U.jsx)(Db,{check:async()=>!!(await B.checkSignIn()).signedOut?.some(t=>t.account===e.account)}),e.account!=="default"&&(0,U.jsx)(`button`,{className:`small`,onClick:()=>f(`settings:claude`),children:`Accounts`})]},`signin:${e.account}`)),a&&(0,U.jsxs)(`div`,{className:`banner error`,onClick:()=>o(null),children:[a,` `,(0,U.jsx)(`span`,{className:`muted`,children:`(click to dismiss)`})]})]}),se=kt(i.computers,i.throughPublicName,eD),ce=Lt(i.computers,s);return(0,U.jsxs)(`div`,{className:`page${se.remote?` remote`:``}`,style:zt(se.here),children:[(0,U.jsx)(OE,{frame:se,shown:ce,onShow:e=>{c(e),e&&!l.includes(e)&&u(t=>[...t,e])},waiting:A}),(0,U.jsx)(kE,{computers:i.computers,opened:l,shown:ce,throughPublicName:i.throughPublicName,framed:eD}),(0,U.jsxs)(`div`,{className:`app ${bw(e)}${D?` no-sidebar`:``}`,hidden:ce!==null,children:[e===null&&(0,U.jsx)(`div`,{className:`phone-banners`,children:oe}),(0,U.jsx)(vD,{sessions:i.sessions,projects:i.projects,chats:i.chats,pending:N,waiting:A,limits:i.limits,usageStops:i.usageStops,github:i.github,stripAccount:ie,overview:i.overview,machine:i.machine,run:ae,openId:e,onOpen:f,onCloseSettings:b,profiles:i.profiles,onStart:(e,t)=>ae(async()=>f((await B.start(e,t)).id)),connection:i.connection,board:i.board}),!D&&(0,U.jsx)(ET,{}),(0,U.jsxs)(`main`,{className:`main`,children:[oe,e!==null&&!P&&(0,U.jsx)(`div`,{className:`phone-bar`,children:(0,U.jsx)(`button`,{className:`phone-back`,onClick:_,children:`← List`})}),e===`usage`||e===`overview`?(0,U.jsx)(ST,{sessionsOpen:e===`overview`,onSessions:e=>f(e?`overview`:`usage`),sessions:i.sessions,overview:i.overview,machine:i.machine,waitingBySession:N,onOpenSession:f}):Jh(e)?(0,U.jsx)(ly,{questions:O,permissions:k,sessions:i.sessions,projects:i.projects,chats:i.chats,userName:i.userName,questionId:e?.startsWith(`q:`)?Number(e.slice(2)):null,onOpenQuestion:e=>f(e===null?`waiting`:`q:${e}`),onOpenSession:f,onGoToConversation:m,onGoToMessage:h,onClose:g,onLeaveShots:y,sidebarHidden:w,onToggleSidebar:E,newComputers:i.newComputers,linkPairings:i.linkPairings,run:ae}):e===`board`?(0,U.jsx)(RC,{board:i.board,onOpen:f,onOpenSettings:()=>f(`settings`)}):TC(e)?(0,U.jsx)(BC,{repo:TC(e).repo,id:TC(e).id,board:i.board,projects:i.projects,onOpen:f,onBack:()=>f(`board`)},e):ee?(0,U.jsx)(Up,{view:e,projects:i.projects,source:i.source,canRestart:i.canRestart,hellos:i.hellos,onOpen:f,children:ee}):e===`chat`?(0,U.jsx)($m,{chats:i.chats,profiles:i.profiles,run:ae,onStarted:f}):e?.startsWith(`a:`)?(0,U.jsx)(ub,{title:S(e.slice(2)),sessions:i.sessions.filter(t=>t.archivedAt&&$E(t,e.slice(2),new Set(i.projects.map(e=>e.name)))),overview:i.overview,run:ae,onOpenSession:f},e):e?.startsWith(`wf:`)&&i.projects.some(t=>t.name===e.slice(3))?(0,U.jsx)(oD,{children:(0,U.jsx)(v.Suspense,{fallback:(0,U.jsx)(`div`,{className:`page-view`,children:(0,U.jsx)(`p`,{className:`muted page-body`,children:`Loading the workflow page…`})}),children:(0,U.jsx)(aD,{project:e.slice(3),shownFlow:GE(n)?.flow??null,onShowFlow:t=>{location.hash=WE(e.slice(3),t)},onRenamedFlow:t=>{try{history.replaceState(history.state,``,WE(e.slice(3),t))}catch(e){console.warn(`Ledung: the address could not follow the flow shown.`,e)}d.current={hash:location.hash,state:history.state},r(location.hash)},profiles:i.projects.find(t=>t.name===e.slice(3))?.profileNames??i.profiles,onSettings:()=>f(Dp(e.slice(3),`workflow`))})})},e):e?.startsWith(`p:`)&&i.projects.some(t=>t.name===e.slice(2))?(0,U.jsx)(Zm,{project:i.projects.find(t=>t.name===e.slice(2)),run:ae,onStarted:f},e):P?(0,U.jsx)(yD,{session:P,ledung:i,pendingCount:N[P.id]??0,run:ae,focusQuestion:Sg(n)?.questionId??null,focusMessage:wg(n)?.messageId??null,cameFrom:lD().ledungFrom??null,onOpenQuestion:e=>f(`q:${e}`),onOpenBoardThread:(e,t)=>f(wC(e,t)),onOpenWorkflow:e=>f(`wf:${e}`),onBack:_},P.id):(0,U.jsxs)(`div`,{className:`empty`,children:[(0,U.jsx)(`h1`,{children:`Project Ledung`}),(0,U.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,U.jsxs)(`div`,{className:`empty-actions`,children:[!i.projects.length&&(0,U.jsx)(`button`,{className:`primary`,onClick:()=>f(`add`),children:`Add a project`}),(0,U.jsx)(`button`,{onClick:()=>f(`chat`),children:`New chat`}),(0,U.jsx)(`button`,{onClick:()=>f(`settings`),children:`Settings`})]})]})]})]})]})}function vD(e){let t=e.sessions.filter(e=>!e.archivedAt),n=e=>t.filter(t=>t.parentId===e).sort(GC),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(GC);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:QE,project:null,rows:a(e=>!r.has(e.project)&&e.project!==`~chats`,null,null)}].map(t=>({...t,archived:e.sessions.filter(e=>e.archivedAt&&$E(e,t.name,r)).length})).filter(e=>e.project||e.name===`~chats`||e.rows.length||e.archived),[s,c]=(0,v.useState)(()=>sw(localStorage)),[l,u]=(0,v.useState)(()=>lw(localStorage)),d=e=>c(t=>{let n=dw(t,e,e=>e===QE||e===`~chats`||r.has(e));return cw(localStorage,n),n}),f=e=>u(n=>{let r=dw(n,e,e=>t.some(t=>t.id===e));return uw(localStorage,r),r}),p=(e,t)=>e&&e.count>0&&(0,U.jsxs)(`span`,{className:`hidden-count${e.working?` working`:``}`,title:`${e.count} ${t} hidden${e.working?`, at least one working`:``}`,children:[e.working&&(0,U.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}=ew((t,n)=>void e.run(()=>t===`projects`?B.orderProjects(n):B.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,U.jsx)(`div`,{className:`drop-marker${w?.group.startsWith(`c:`)?` child`:``}`,"aria-hidden":`true`}),[A]=jx(),[j]=Lx(),M=Ct(j),[N]=Ux(),P=({s:t,depth:n,drag:r,hidden:i,folds:a,folded:o})=>{let s=`${Og(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=Gw(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`?``:Lw[t.priority].toLowerCase(),a&&(a.cores>=.05||a.memBytes>0)?`${Pw(a.cores)} · ${Fw(a.memBytes)}`:``,r?`${Ky(r)}${t.role===`manager`&&r!==n?` team`:``} today`:``,i!=null&&t.status!==`ended`?`ctx ${Jy(i)}`:``,t.pr?Yy(t.pr):t.branch??``].filter(Boolean).join(` · `)})();return(0,U.jsxs)(`div`,{className:`session-row`,children:[a&&(0,U.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,U.jsx)(`div`,{className:`session-item renaming${t.id===e.openId?` open`:``}${n?` child`:``}`,children:(0,U.jsx)(WC,{value:t.title,label:`New name for ${t.title}`,onDone:()=>_(null),onSave:n=>e.run(()=>B.rename(t.id,n))})}):(0,U.jsxs)(`button`,{className:`session-item${t.id===e.openId?` open`:``}${n?` child`:``}${w?.id===t.id?` dragging`:``}${ft(A,t).ended?` ended-row`:``}`,title:wt(j,ft(A,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:[ft(A,t).dot&&(0,U.jsx)(`span`,{className:`dot ${ct(t)}`,title:st[t.status]}),(0,U.jsxs)(`span`,{className:`session-text`,children:[(0,U.jsxs)(`span`,{className:`session-title`,children:[t.role===`manager`&&(0,U.jsx)(`span`,{className:`chip`,children:`Manager`}),` `,(0,U.jsx)(mp,{colour:_p(t,Pv(e.projects,e.chats)),children:t.title})]}),M.time&&(0,U.jsx)(`span`,{className:`session-sub`,children:s}),M.usage&&c&&(0,U.jsx)(`span`,{className:`session-sub usage-line`,children:c})]}),(()=>{let n=N_(t,e.sessions);return n&&(0,U.jsx)(`span`,{className:`session-ship ${ct(t)}`,children:(0,U.jsx)(H_,{mode:n,width:10,sizeButton:!1,hideWhenSunk:!0,maxSize:M.shipMax})})})(),p(i,i?.count===1?`sub-session`:`sub-sessions`),(e.pending[t.id]??0)+(i?.pending??0)?(0,U.jsx)(`span`,{className:`badge`,children:(e.pending[t.id]??0)+(i?.pending??0)}):null]})]})},F=Ne(e.connection);return(0,U.jsxs)(`aside`,{className:`sidebar`,children:[(0,U.jsx)(cb,{account:e.stripAccount,limits:e.limits,stops:e.usageStops,run:e.run}),pw(e.github,Date.now()).map(e=>(0,U.jsx)(`div`,{className:`github-budget muted ${mw(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:fw(e,e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}))},`${e.container??``} ${e.host}`)),(0,U.jsx)(zw,{machine:e.machine,sessions:e.sessions,onOpen:e.onOpen,run:e.run}),(0,U.jsxs)(`button`,{className:`waiting-entry${Jh(e.openId)?` open`:``}${e.waiting?` has-items`:``}`,onClick:()=>e.onOpen(`waiting`),children:[(0,U.jsx)(`span`,{children:`Waiting for you`}),e.waiting?(0,U.jsx)(`span`,{className:`badge`,children:e.waiting}):(0,U.jsx)(`span`,{className:`muted`,children:`nothing`})]}),(0,U.jsxs)(`nav`,{className:`session-list`,"data-compact":j>1?j:void 0,ref:C,...T,children:[!e.projects.length&&(0,U.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:iw(t.rows,{foldedSessions:l,folded:s.includes(t.name),openId:e.openId,pending:e.pending})})).map(t=>(0,U.jsxs)(v.Fragment,{children:[O?.before===t.name&&k,(0,U.jsx)(`div`,{className:`project-group${w?.group===`projects`&&w.id===t.name?` dragging`:``}`,children:(0,U.jsxs)(tp,{level:Yf(t.project),children:[(0,U.jsxs)(`div`,{className:`project-row`,children:[(0,U.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,U.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=Hy(t.project.account),n=(0,U.jsx)(mp,{colour:t.project.colours.manager,children:t.name});return e?(0,U.jsxs)(`span`,{className:`project-name-stack`,children:[(0,U.jsx)(`span`,{className:`project-account`,title:`Runs on the Claude account ${e}`,children:e}),(0,U.jsx)(`span`,{className:`project-name-text`,children:n})]}):n})()}):t.name===`~chats`?(0,U.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,U.jsx)(mp,{colour:e.chats?.colour??null,children:`Chats`})}):(0,U.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,U.jsx)(`span`,{className:`badge`,children:t.view.project.pending}):null,t.name===`~chats`&&(0,U.jsxs)(`span`,{className:`project-actions`,children:[M.plusOnly?(0,U.jsx)(`button`,{className:`mini`,title:`New chat`,"aria-label":`New chat`,onClick:()=>e.onOpen(`chat`),children:`+`}):(0,U.jsx)(`button`,{className:`small`,title:`A Claude Code session of your own, with no project`,onClick:()=>e.onOpen(`chat`),children:`+ Chat`}),(0,U.jsx)(`button`,{className:`${M.plusOnly?`mini cog`:`small`}${Ap(e.openId)===`chats`?` on`:``}`,title:`Chats settings`,"aria-label":`Settings of chats`,onClick:()=>e.onOpen(`chats`),children:`⚙`})]}),t.project&&(0,U.jsxs)(`span`,{className:`project-actions`,children:[M.plusOnly?(0,U.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,U.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,U.jsx)(`button`,{className:`${M.plusOnly?`mini cog`:`small`}${Ap(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,U.jsxs)(`div`,{className:`start-row`,children:[(0,U.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,U.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,U.jsx)(`option`,{value:e,children:e},e))]}),(0,U.jsx)(`button`,{className:`small primary`,onClick:()=>{h(null),e.onStart(t.name,y||void 0)},children:`Start`}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>h(null),children:`Cancel`})]}),(()=>{let e=E(t.view.rows);return t.view.rows.map(t=>(0,U.jsxs)(v.Fragment,{children:[e?.before===t.s.id&&k,P(t),e?.after===t.s.id&&k]},t.s.id))})(),gt(N,t.archived,t.isFolded)&&(0,U.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,U.jsxs)(`div`,{className:`connection ${e.connection}`,children:[(0,U.jsx)(`button`,{className:`icon settings-cog${gw(e.openId)?` on`:``}`,title:gw(e.openId)?`Close settings (Esc)`:`Settings: accounts, restart Ledung, add a project`,"aria-label":gw(e.openId)?`Close settings`:`Settings`,"aria-pressed":gw(e.openId),onClick:()=>gw(e.openId)?e.onCloseSettings():e.onOpen(`settings`),children:`⚙`}),(0,U.jsxs)(`span`,{className:`footer-chips`,children:[(0,U.jsxs)(`button`,{className:`board-chip usage-chip${Pe(e.board)?``:` ${F.className}`}${e.openId===`usage`||e.openId===`overview`?` on`:``}`,title:`${Pe(e.board)?``:`${F.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?` · ${Ky(e.overview.todayTokens)} today`:``]}),(0,U.jsx)(yn,{board:e.board,open:e.openId===`board`||!!TC(e.openId),connection:F,onClick:()=>e.onOpen(`board`)})]})]})]})}function yD(e){let{session:t,ledung:n,run:r}=e,[i,a]=(0,v.useState)(()=>gD(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}, ${Og(t)}:\n${r.split(`
108
+ `).map(e=>`> ${e}`).join(`
109
+ `)}\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=Ow(t),E=Yf(n.projects.find(e=>e.name===t.project)),D=(0,v.useMemo)(()=>Fv(t,Pv(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]),A=Dw(e.onOpenQuestion),j=n.board?.projects[t.project]?.repo,M=Dw(t=>e.onOpenBoardThread(j,t)),N=()=>{a(e=>{try{localStorage.setItem(`ledung.technical.${t.id}`,e?`0`:`1`)}catch{}return!e})},P=!(t.status===`stopping`||t.status===`ended`&&!t.claudeSessionId),F=(0,v.useMemo)(()=>P?WS(n.macros??[],t.project):[],[n.macros,t.project,P]),I=Dw((e,n)=>{let i=KS(e.text,t);qS(e,i,n)===`send`?r(()=>B.send(t.id,i.text)):m.current?.(i.text)});return(0,v.useEffect)(()=>{let e=F.filter(e=>e.key);if(!e.length)return;let t=t=>{if(t.repeat||t.isComposing||t.defaultPrevented)return;let n=zS(t),r=n&&e.find(e=>e.key===n);r&&(t.preventDefault(),I(r,!1))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[F]),(0,v.useEffect)(()=>{let e=e=>{Mw(e)&&(e.preventDefault(),N())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t.id]),(0,U.jsxs)(tp,{level:E,fill:!0,children:[(0,U.jsxs)(`header`,{className:`session-head${u?` details`:``}`,children:[(0,U.jsx)(`button`,{className:`phone-back`,"aria-label":`Back to the list`,title:`Back to the list`,onClick:e.onBack,children:`←`}),(0,U.jsxs)(`div`,{className:`session-head-text`,onClick:e=>{e.target.closest(`a, button`)||d(e=>!e)},children:[(0,U.jsxs)(`h2`,{children:[(0,U.jsx)(`span`,{className:`dot ${ct(t)} phone-dot`,title:st[t.status]}),t.role===`manager`&&(0,U.jsx)(`span`,{className:`chip`,children:`Manager`}),` `,f?(0,U.jsx)(WC,{value:t.title,label:`New name for ${t.title}`,onDone:()=>p(!1),onSave:e=>r(()=>B.rename(t.id,e))}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(mp,{colour:_p(t,Pv(n.projects,n.chats)),children:t.title}),(0,U.jsx)(`button`,{className:`icon rename`,title:`Rename`,"aria-label":`Rename ${t.title}`,onClick:()=>p(!0),children:`✎`})]})]}),t.parentId&&(0,U.jsxs)(`div`,{className:`muted started-by`,children:[`Started by`,` `,(0,U.jsx)(`button`,{className:`link`,onClick:()=>location.hash=`#/s/${t.parentId}`,children:n.sessions.find(e=>e.id===t.parentId)?.title??`a manager`})]}),(0,U.jsxs)(`div`,{className:`muted`,children:[(0,U.jsx)(`span`,{className:`dot ${ct(t)}`}),` `,st[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,U.jsxs)(U.Fragment,{children:[` · `,(0,U.jsx)(`span`,{className:`chip prio-${t.priority}`,title:t.priorityNote??void 0,children:Lw[t.priority]})]}),n.machine?.sessions[t.id]&&!w?` · ${Pw(n.machine.sessions[t.id].cores)} · ${Fw(n.machine.sessions[t.id].memBytes)}`:``,t.status===`ended`&&t.endReason?` · ${t.endReason}`:``,` · `,t.project===`~chats`?`Chat`:t.project,E?(0,U.jsxs)(U.Fragment,{children:[` · `,(0,U.jsxs)(`span`,{className:`chip lock ${E.toLowerCase()}`,title:qf[E],children:[`Lockdown `,E]})]}):null,t.workDir?(0,U.jsxs)(U.Fragment,{children:[` · `,(0,U.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,U.jsxs)(U.Fragment,{children:[` · `,(0,U.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,U.jsxs)(U.Fragment,{children:[` · `,(0,U.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,U.jsxs)(U.Fragment,{children:[` · `,(0,U.jsx)(`span`,{className:`mono`,children:t.branch})]}):null,t.pr?(0,U.jsxs)(U.Fragment,{children:[` · `,(0,U.jsx)(`a`,{href:t.pr.url,target:`_blank`,rel:`noreferrer noopener`,title:`${t.pr.title} — checks ${t.pr.checks}`,children:Yy(t.pr)})]}):null,t.tickets.map(e=>(0,U.jsxs)(`span`,{children:[` · `,(0,U.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:e.id})]},e.id)),t.remoteControl?(0,U.jsxs)(U.Fragment,{children:[` · `,(0,U.jsx)(ED,{rc:t.remoteControl})]}):null]})]}),(0,U.jsx)(bD,{before:(0,U.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:N,usage:n.overview?.sessions[t.id]?.total??null,showUsage:c,onToggleUsage:()=>{s([]),_(!1),b(null),l(e=>!e)},onOpenWorkflow:()=>e.onOpenWorkflow(t.project)}),T.header.length>0&&(0,U.jsxs)(`div`,{className:`session-actions`,children:[T.header.includes(`startNow`)&&(0,U.jsx)(`button`,{className:`primary`,title:`Start this turn now, above the limit on working sessions`,onClick:()=>r(()=>B.startNow(t.id)),children:`Start now`}),T.header.includes(`clear`)&&(0,U.jsx)(wD,{due:t.clearDue,onCancel:()=>r(()=>B.cancelClear(t.id))}),T.header.includes(`compacting`)&&(0,U.jsx)(TD,{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,U.jsx)(`button`,{className:`primary`,onClick:()=>r(()=>B.resume(t.id)),children:`Resume`}),T.header.includes(`archive`)&&(t.archivedAt?(0,U.jsx)(`button`,{title:`Back into the sidebar, still ended`,onClick:()=>r(()=>B.unarchive(t.id)),children:`Unarchive`}):(0,U.jsx)(`button`,{title:`Out of the sidebar, listed under the project's Archived; nothing is deleted`,onClick:()=>r(()=>B.archive(t.id)),children:`Archive`}))]})]}),e.cameFrom&&(0,U.jsxs)(`div`,{className:`came-from`,children:[(0,U.jsxs)(`button`,{className:`small`,onClick:()=>history.back(),children:[`← Back to `,e.cameFrom===`question`?`the question`:e.cameFrom===`shots`?`the screenshots`:`the queue`]}),(0,U.jsx)(`span`,{className:`muted`,children:`You came from Waiting for you; the browser's Back goes there too.`})]}),(0,U.jsxs)(`div`,{className:`session-body`,children:[(0,U.jsxs)(`div`,{className:`chat-column`,children:[(0,U.jsx)(Ng,{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:A,onOpenBoardThread:j?M:void 0,tint:D}),(0,U.jsx)(K_,{session:t,sessions:n.sessions,messages:n.messages,extra:(0,U.jsx)(QS,{macros:F,onUse:I,onEdit:()=>location.hash=`#/settings/macros`},t.id)},t.id),(0,U.jsx)(CD,{session:t,tint:D,run:r,quoteInto:m,bangShell:n.bangShell})]}),c&&(0,U.jsx)(qw,{sessionId:t.id,onClose:()=>l(!1)}),o.length>0&&(0,U.jsx)(uv,{sessionId:t.id,stack:o,onOpen:x,onBack:()=>s(e=>e.slice(0,-1)),onClose:()=>s([])}),g&&(0,U.jsx)(wv,{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,U.jsx)(uv,{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 bD(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=Ow(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=>{Nw(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,U.jsxs)(`div`,{className:`session-corner`,ref:a,children:[e.before,t.role===`manager`&&e.away&&(0,U.jsx)(mb,{away:e.away,onClick:()=>i(!0)}),(0,U.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,U.jsxs)(`div`,{className:`session-menu`,id:`session-menu`,role:`dialog`,"aria-label":`Session settings`,ref:o,children:[c.includes(`away`)&&(0,U.jsxs)(`div`,{className:`menu-row away-row`,children:[(0,U.jsx)(`span`,{className:`menu-label`,children:`Away`}),(0,U.jsx)(_b,{away:e.away,run:n})]}),t.role===`manager`&&e.project&&(0,U.jsx)(`button`,{className:`menu-row`,onClick:u(e.onOpenWorkflow),children:`Workflow`}),c.includes(`permissions`)&&(0,U.jsxs)(`label`,{className:`mode menu-row`,title:nD[t.permissionMode],children:[(0,U.jsx)(`span`,{className:`menu-label`,children:`Permissions`}),(0,U.jsx)(`select`,{value:t.permissionMode,disabled:l||t.status===`stopping`,onChange:e=>n(()=>B.setPermissionMode(t.id,e.target.value)),children:b.map(e=>(0,U.jsx)(`option`,{value:e,title:nD[e],children:tD[e]},e))})]}),c.includes(`priority`)&&(0,U.jsxs)(`label`,{className:`mode menu-row`,title:t.priorityNote??`Who goes first when sessions wait for a free place`,children:[(0,U.jsx)(`span`,{className:`menu-label`,children:`Priority`}),(0,U.jsx)(`select`,{value:t.priority,disabled:l,onChange:e=>n(()=>B.setPriority(t.id,e.target.value)),children:C.map(e=>(0,U.jsx)(`option`,{value:e,children:Lw[e]},e))})]}),c.includes(`toolCalls`)&&(0,U.jsxs)(`label`,{className:`toggle menu-row`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e.showTechnical,onChange:e.onToggleTechnical}),` Show tool calls`,(0,U.jsx)(`kbd`,{title:`Works anywhere on this page, the message box included`,children:`Ctrl+O`})]}),c.includes(`usage`)&&(0,U.jsxs)(`button`,{className:`menu-row${e.showUsage?` on`:``}`,onClick:u(e.onToggleUsage),children:[`Usage`,e.usage==null?``:` · ${Ky(e.usage)}`]}),(c.includes(`pause`)||c.includes(`stop`))&&(0,U.jsxs)(`div`,{className:`menu-row menu-buttons`,children:[c.includes(`pause`)&&(0,U.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(()=>B.setPaused(t.id,!t.paused))),children:t.paused?`Resume`:`Pause`}),c.includes(`stop`)&&(0,U.jsx)(`button`,{onClick:u(()=>void n(()=>B.stop(t.id))),children:`Stop`})]}),(0,U.jsx)(SD,{session:t,run:n}),kw(t)&&(0,U.jsx)(xD,{sessionId:t.id}),c.includes(`version`)&&(0,U.jsxs)(`div`,{className:`menu-row menu-info`,children:[(0,U.jsx)(`span`,{className:`menu-label`,children:`Claude Code`}),(0,U.jsx)(`span`,{className:`mono`,children:t.claudeVersion})]})]})]})}function xD({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 B.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 B.reconnectMcp(e,t))}catch(e){i(e.message)}finally{o(null)}};return(0,U.jsxs)(`div`,{className:`menu-row mcp-row`,children:[(0,U.jsx)(`span`,{className:`menu-label`,children:`MCP servers`}),t===null&&!r&&(0,U.jsx)(`span`,{className:`muted`,children:`Asking Claude Code…`}),t?.length===0&&(0,U.jsx)(`span`,{className:`muted`,children:`None.`}),!!t?.length&&(0,U.jsx)(`ul`,{className:`mcp-servers`,children:t.map(e=>(0,U.jsxs)(`li`,{title:[e.version,e.tools?`${e.tools} tool${e.tools===1?``:`s`}`:``,e.error].filter(Boolean).join(` · `)||void 0,children:[(0,U.jsx)(`span`,{className:`dot mcp-${e.status}`}),(0,U.jsx)(`span`,{className:`mono`,children:e.name}),(0,U.jsx)(`span`,{className:`muted`,children:Aw[e.status]??e.status}),e.canReconnect?(0,U.jsx)(`button`,{className:`small`,disabled:a!==null,onClick:()=>void s(e.name),children:a===e.name?`Reconnecting…`:`Reconnect`}):(0,U.jsx)(`span`,{className:`muted`,title:`Ledung's own tool server, inside Ledung`,children:`Ledung's`})]},e.name))}),r&&(0,U.jsx)(`span`,{className:`error`,children:r})]})}function SD({session:e,run:t}){let[n]=BE(e.id);return(0,U.jsx)(zE,{sessionId:e.id,secrets:n,running:e.status!==`ended`&&e.status!==`stopping`,run:t})}function CD({session:e,tint:t,run:n,quoteInto:r,bangShell:i}){let a=H(),[o,s,c]=Ew(e.id),l=e.status===`ended`&&!!e.claudeSessionId,u=e.status===`ended`&&!l||e.status===`stopping`,d=jw(e),{box:f,area:p,style:m,grip:h}=IT(),[g]=BE(e.id),[_,y]=(0,v.useState)(null),[b,x]=(0,v.useState)(null),[S,C]=(0,v.useState)(null),w=e.status!==`ended`&&e.status!==`stopping`,T=(0,v.useCallback)(()=>{let e=p.current,t=e&&!u&&document.activeElement===e?$T(e.value,e.selectionStart,e.selectionEnd):null;if(!e||!t)return y(null);let n=NE(e,t.end),r=e.offsetLeft+Math.min(Math.max(n.left,4),e.clientWidth-36),i=e.offsetTop+Math.min(Math.max(n.top+2,4),e.clientHeight-30);y({...t,left:r,top:i})},[u]);(0,v.useEffect)(()=>(document.addEventListener(`selectionchange`,T),()=>document.removeEventListener(`selectionchange`,T)),[T]);let E=()=>{let t=p.current;if(!t||!_)return;let r=t.value,i=r.slice(_.start,_.end),a=QT(r.slice(0,_.start),i,g.map(e=>e.name)),o=eE(localStorage,e.id,r,_,a);c(o.text),y(null),requestAnimationFrame(()=>t.setSelectionRange(o.caret,o.caret)),n(async()=>{try{let t=await B.addSecret(e.id,{name:a,value:i,lifetime:`session`});x(t.id)}catch(e){throw s(e=>e.split(`[🔑 ${a}]`).join(i)),e}})},D=rE(o,g),O=b?g.find(e=>e.id===b):void 0,k=!O&&S===null&&(D.known.length>0||D.missing.length>0);(0,v.useEffect)(()=>(r.current=e=>{s(t=>t.trim()?`${t.trimEnd()}\n\n${e}`:e),p.current?.focus()},()=>{r.current=null}),[]),(0,v.useEffect)(()=>{e.project===`~chats`&&e.title===`New chat`&&!e.claudeSessionId&&p.current?.focus()},[e.id]);let[A,j]=(0,v.useState)(null),M=nh(o),N=async(t,r)=>{let i=o;s(``),j(null),await n(async()=>{try{await B.shell(e.id,t,r)}catch(e){throw s(i),e}})},P=async()=>{let t=o;t.trim()&&(M?await n(async()=>{let t=await B.shellCheck(e.id,M);if(t.refused)throw Error(t.refused);t.rule?j({command:M,rule:t.rule}):await N(M,!1)}):(s(``),await n(async()=>{try{await B.send(e.id,t)}catch(e){throw s(t),e}})))};return(0,U.jsxs)(`div`,{className:`composer${t?` tinted`:``}`,style:t,ref:f,children:[h,O&&(0,U.jsx)(LE,{sessionId:e.id,secret:O,running:w,run:n,onRenamed:(e,t)=>c(nE(p.current?.value??o,e,t)),onRemoved:e=>{c(nE(p.current?.value??o,e,null)),x(null)},onClose:()=>{x(null),p.current?.focus()}}),S!==null&&!O&&(0,U.jsx)(RE,{sessionId:e.id,taken:g.map(e=>e.name),run:n,onLocked:e=>{let t=tE(p.current?.value??o,S,e);c(t.text),C(null),requestAnimationFrame(()=>{p.current?.focus(),p.current?.setSelectionRange(t.caret,t.caret)})},onClose:()=>{C(null),p.current?.focus()}}),_&&(0,U.jsx)(PE,{left:_.left,top:_.top,onLock:E}),(e.shell||A||M||k)&&(0,U.jsxs)(`div`,{className:`bang-strips`,children:[k&&(0,U.jsx)(IE,{known:D.known,missing:D.missing,onOpen:x}),e.shell&&(0,U.jsxs)(`div`,{className:`bang-running`,role:`status`,children:[(0,U.jsxs)(`span`,{children:[`Running `,(0,U.jsxs)(`code`,{children:[`!`,e.shell.command]}),`…`]}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>void n(()=>B.shellStop(e.id)),children:`Stop`})]}),A&&(0,U.jsxs)(`div`,{className:`bang-ask`,role:`alert`,children:[(0,U.jsx)(`span`,{children:rh(A.rule)}),(0,U.jsx)(`button`,{className:`small primary`,onClick:()=>void N(A.command,!0),children:`Run`}),(0,U.jsx)(`button`,{className:`small`,onClick:()=>j(null),children:`Cancel`})]}),M&&!A&&(0,U.jsx)(`div`,{className:`bang-hint muted`,children:ih(i,e.runner)})]}),(0,U.jsx)(`textarea`,{...a,ref:p,style:m,value:o,disabled:u,placeholder:u?`This session has ended.`:l?`This session has ended; sending a message resumes it.`:cg()?`Message Claude`:`Message Claude (Enter to send, Shift+Enter for a new line)`,onChange:e=>{s(e.target.value),j(null)},onSelect:T,onBlur:()=>y(null),onKeyDown:e=>{yE({key:e.key,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,isComposing:e.nativeEvent.isComposing},cg())&&(e.preventDefault(),P())},rows:3}),(0,U.jsxs)(`div`,{className:`composer-buttons`,children:[(0,U.jsx)(`button`,{className:`stop-sign`,"aria-label":`Interrupt`,title:d?`Interrupt`:`Interrupt: nothing to interrupt now`,disabled:!d,onClick:()=>void n(()=>B.interrupt(e.id)),children:`STOP`}),(0,U.jsxs)(`div`,{className:`send-row`,children:[(0,U.jsx)(`button`,{className:`secret-key`,title:`Lock a secret: type or paste it into a masked field; Claude gets only its name`,"aria-label":`Lock a secret`,disabled:u,onClick:()=>{x(null),C(S===null?p.current?.selectionStart??o.length:null)},children:`🔑`}),(0,U.jsx)(`button`,{className:`primary`,disabled:u||!o.trim()||!!M&&!!e.shell,onClick:()=>void P(),children:M?`Run`:`Send`})]})]})]})}function wD({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,U.jsxs)(`span`,{className:`clear-countdown`,role:`status`,children:[i>0?`Clearing the conversation in ${i} s`:`Clearing the conversation…`,` `,(0,U.jsx)(`button`,{className:`primary`,title:`Keep the conversation; whoever asked for the clear is told`,onClick:t,children:`Cancel clear`})]})}function TD({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,U.jsxs)(`span`,{className:`compacting`,role:`status`,title:o,children:[`Compacting… `,a,e.note&&(0,U.jsxs)(`span`,{className:`compacting-note`,children:[`Note from `,t,`: `,e.note]})]})}function ED({rc:e}){if(e.state===`unavailable`)return(0,U.jsx)(`span`,{title:e.error??void 0,children:`Remote Control unavailable`});if(!e.url)return(0,U.jsx)(`span`,{children:`Remote Control starting…`});let t=e.bridge?` (bridge ${e.bridge})`:``;return(0,U.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 DD=e=>e?.name===`NotAllowedError`?Error(_e):e;function OD(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 kD=e=>{let t=``;for(let n of new Uint8Array(e))t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)},AD=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 jD(e){let t=await navigator.credentials.get({publicKey:{challenge:AD(e.challenge),rpId:e.rpId,timeout:e.timeout,userVerification:`required`,allowCredentials:(e.allowCredentials??[]).map(e=>({type:`public-key`,id:AD(e.id)}))}}).catch(e=>{throw DD(e)});if(!t)throw Error(_e);let n=t.response,r={id:t.id,rawId:kD(t.rawId),type:t.type,clientExtensionResults:{},response:{clientDataJSON:kD(n.clientDataJSON),authenticatorData:kD(n.authenticatorData),signature:kD(n.signature),...n.userHandle?{userHandle:kD(n.userHandle)}:{}}};return kD(new TextEncoder().encode(JSON.stringify(r)))}async function MD(e){let t=e.user,n=await navigator.credentials.create({publicKey:{challenge:AD(e.challenge),rp:e.rp,user:{id:AD(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:kD(n.rawId),type:n.type,clientExtensionResults:{},response:{clientDataJSON:kD(r.clientDataJSON),attestationObject:kD(r.attestationObject),transports:r.getTransports?.()??[]}}}var ND={sign:jD,create:MD};function PD(){let[e,t]=(0,v.useState)([]);(0,v.useEffect)(()=>(ye(e=>new Promise(n=>t(t=>[...t,{step:e,answer:n}]))),()=>ye(null)),[]);let n=e[0];if(!n)return null;let r=OD(n.step),i=e=>{t(e=>e.slice(1)),n.answer(e)};return(0,U.jsx)(`div`,{className:`passkey-backdrop`,children:(0,U.jsxs)(`div`,{className:`passkey-dialog`,role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`passkey-title`,children:[(0,U.jsx)(`h3`,{id:`passkey-title`,children:r.title}),r.body.map(e=>(0,U.jsx)(`p`,{children:e},e)),(0,U.jsxs)(`div`,{className:`passkey-actions`,children:[(0,U.jsx)(`button`,{onClick:()=>i(!1),children:`Cancel`}),(0,U.jsx)(`button`,{className:`primary`,autoFocus:!0,onClick:()=>i(!0),children:r.go})]})]})})}he(ND),ot(document.documentElement,it(localStorage)),window.addEventListener(`storage`,e=>{e.key===`ledung.theme`?ot(document.documentElement,rt(e.newValue)):e.key===null&&ot(document.documentElement,it(localStorage))}),un(),TE(window),(0,y.createRoot)(document.getElementById(`root`)).render((0,U.jsxs)(v.StrictMode,{children:[(0,U.jsx)(_D,{}),(0,U.jsx)(PD,{})]}));export{vn as a,B as c,o as d,l as f,Nf as i,h as l,rv as n,H as o,om as r,Tt as s,qE as t,d as u};