@epoch-agent/server 0.3.1 → 0.4.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.
- package/dist/index.d.ts +55 -16
- package/dist/index.js +73 -1
- package/dist/web/assets/index-B8SadfSi.js +373 -0
- package/dist/web/assets/index-YkNh8xAS.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +3 -3
- package/dist/web/assets/index-C8_G1o8e.js +0 -373
- package/dist/web/assets/index-DtAA7lvj.css +0 -1
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return te(e.type,t,e.props)}function T(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(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,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(T(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ae(a,u),c+=se(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ae(a,u++),c+=se(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return se(oe(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 ce(e,t,n){if(e==null)return e;var r=[],i=0;return se(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function le(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var E=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)},D={map:ce,forEach:function(e,t,n){ce(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ce(e,function(){t++}),t},toArray:function(e){return ce(e,function(e){return e})||[]},only:function(e){if(!T(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=D,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ee.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 te(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)ee.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 te(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=T,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:le}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,E)}catch(e){E(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,T());else{var t=n(l);t!==null&&ae(x,t.startTime-e)}}}var S=!1,C=-1,w=5,ee=-1;function te(){return g?!0:!(e.unstable_now()-ee<w)}function ne(){if(g=!1,S){var t=e.unstable_now();ee=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&&te());){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&&ae(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?T():S=!1}}}var T;if(typeof y==`function`)T=function(){y(ne)};else if(typeof MessageChannel<`u`){var re=new MessageChannel,ie=re.port2;re.port1.onmessage=ne,T=function(){ie.postMessage(null)}}else T=function(){_(ne,0)};function ae(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,ae(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,T()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function ce(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case re:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?ce(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var le=Array.isArray,E=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],O=-1;function fe(e){return{current:e}}function pe(e){0>O||(e.current=de[O],de[O]=null,O--)}function k(e,t){O++,de[O]=e.current,e.current=t}var me=fe(null),he=fe(null),ge=fe(null),A=fe(null);function _e(e,t){switch(k(ge,t),k(he,e),k(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}pe(me),k(me,e)}function j(){pe(me),pe(he),pe(ge)}function ve(e){e.memoizedState!==null&&k(A,e);var t=me.current,n=Ud(t,e.type);t!==n&&(k(he,e),k(me,n))}function M(e){he.current===e&&(pe(me),pe(he)),A.current===e&&(pe(A),$f._currentValue=ue)}var ye,be;function xe(e){if(ye===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||``,be=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+ye+e+be}var Se=!1;function Ce(e,t){if(!e||Se)return``;Se=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?xe(n):``}function we(e,t){switch(e.tag){case 26:case 27:case 5:return xe(e.type);case 16:return xe(`Lazy`);case 13:return e.child!==t&&t!==null?xe(`Suspense Fallback`):xe(`Suspense`);case 19:return xe(`SuspenseList`);case 0:case 15:return Ce(e.type,!1);case 11:return Ce(e.type.render,!1);case 1:return Ce(e.type,!0);case 31:return xe(`Activity`);default:return``}}function Te(e){try{var t=``,n=null;do t+=we(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var Ee=Object.prototype.hasOwnProperty,N=t.unstable_scheduleCallback,De=t.unstable_cancelCallback,Oe=t.unstable_shouldYield,ke=t.unstable_requestPaint,Ae=t.unstable_now,je=t.unstable_getCurrentPriorityLevel,Me=t.unstable_ImmediatePriority,Ne=t.unstable_UserBlockingPriority,Pe=t.unstable_NormalPriority,Fe=t.unstable_LowPriority,Ie=t.unstable_IdlePriority,Le=t.log,Re=t.unstable_setDisableYieldValue,ze=null,Be=null;function Ve(e){if(typeof Le==`function`&&Re(e),Be&&typeof Be.setStrictMode==`function`)try{Be.setStrictMode(ze,e)}catch{}}var He=Math.clz32?Math.clz32:Ge,Ue=Math.log,We=Math.LN2;function Ge(e){return e>>>=0,e===0?32:31-(Ue(e)/We|0)|0}var Ke=256,qe=262144,Je=4194304;function Ye(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Xe(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=Ye(n))):i=Ye(o):i=Ye(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ye(n))):i=Ye(o)):i=Ye(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 Ze(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qe(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 $e(){var e=Je;return Je<<=1,!(Je&62914560)&&(Je=4194304),e}function et(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function P(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function tt(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-He(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&&nt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function nt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-He(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function F(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-He(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function rt(e,t){var n=t&-t;return n=n&42?1:it(n),(n&(e.suspendedLanes|t))===0?n:0}function it(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 I(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function at(){var e=D.p;return e===0?(e=window.event,e===void 0?32:hp(e.type)):e}function ot(e,t){var n=D.p;try{return D.p=e,t()}finally{D.p=n}}var st=Math.random().toString(36).slice(2),ct=`__reactFiber$`+st,lt=`__reactProps$`+st,ut=`__reactContainer$`+st,dt=`__reactEvents$`+st,ft=`__reactListeners$`+st,pt=`__reactHandles$`+st,mt=`__reactResources$`+st,ht=`__reactMarker$`+st;function gt(e){delete e[ct],delete e[lt],delete e[dt],delete e[ft],delete e[pt]}function _t(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ut]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ff(e);e!==null;){if(n=e[ct])return n;e=ff(e)}return t}e=n,n=e.parentNode}return null}function vt(e){if(e=e[ct]||e[ut]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function yt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function bt(e){var t=e[mt];return t||=e[mt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function xt(e){e[ht]=!0}var St=new Set,Ct={};function wt(e,t){Tt(e,t),Tt(e+`Capture`,t)}function Tt(e,t){for(Ct[e]=t,e=0;e<t.length;e++)St.add(t[e])}var Et=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Dt={},Ot={};function kt(e){return Ee.call(Ot,e)?!0:Ee.call(Dt,e)?!1:Et.test(e)?Ot[e]=!0:(Dt[e]=!0,!1)}function At(e,t,n){if(kt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function jt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Mt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Nt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Pt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ft(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function It(e){if(!e._valueTracker){var t=Pt(e)?`checked`:`value`;e._valueTracker=Ft(e,t,``+e[t])}}function Lt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Pt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Rt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var zt=/[\n"\\]/g;function Bt(e){return e.replace(zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Vt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Nt(t)):e.value!==``+Nt(t)&&(e.value=``+Nt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ut(e,o,Nt(n)):Ut(e,o,Nt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Nt(s):e.removeAttribute(`name`)}function Ht(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){It(e);return}n=n==null?``:``+Nt(n),t=t==null?n:``+Nt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),It(e)}function Ut(e,t,n){t===`number`&&Rt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Wt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Nt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Gt(e,t,n){if(t!=null&&(t=``+Nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Nt(n)}function Kt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(le(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Nt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),It(e)}function qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Yt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Jt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Xt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Yt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Yt(e,o,t[o])}function Zt(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 Qt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),$t=/^[\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 en(e){return $t.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function tn(){}var nn=null;function rn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var an=null,on=null;function sn(e){var t=vt(e);if(t&&(e=t.stateNode)){var n=e[lt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Vt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Bt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[lt]||null;if(!a)throw Error(i(90));Vt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Lt(r)}break a;case`textarea`:Gt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Wt(e,!!n.multiple,t,!1)}}}var cn=!1;function ln(e,t,n){if(cn)return e(t,n);cn=!0;try{return e(t)}finally{if(cn=!1,(an!==null||on!==null)&&(bu(),an&&(t=an,e=on,on=an=null,sn(t),e)))for(t=0;t<e.length;t++)sn(e[t])}}function un(e,t){var n=e.stateNode;if(n===null)return null;var r=n[lt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var dn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),fn=!1;if(dn)try{var pn={};Object.defineProperty(pn,"passive",{get:function(){fn=!0}}),window.addEventListener(`test`,pn,pn),window.removeEventListener(`test`,pn,pn)}catch{fn=!1}var mn=null,hn=null,gn=null;function _n(){if(gn)return gn;var e,t=hn,n=t.length,r,i=`value`in mn?mn.value:mn.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 gn=i.slice(e,1<r?1-r:void 0)}function vn(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 yn(){return!0}function bn(){return!1}function xn(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)?yn:bn,this.isPropagationStopped=bn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=yn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=yn)},persist:function(){},isPersistent:yn}),t}var Sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cn=xn(Sn),wn=m({},Sn,{view:0,detail:0}),Tn=xn(wn),En,Dn,On,kn=m({},wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bn,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!==On&&(On&&e.type===`mousemove`?(En=e.screenX-On.screenX,Dn=e.screenY-On.screenY):Dn=En=0,On=e),En)},movementY:function(e){return`movementY`in e?e.movementY:Dn}}),An=xn(kn),jn=xn(m({},kn,{dataTransfer:0})),Mn=xn(m({},wn,{relatedTarget:0})),Nn=xn(m({},Sn,{animationName:0,elapsedTime:0,pseudoElement:0})),Pn=xn(m({},Sn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Fn=xn(m({},Sn,{data:0})),In={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Ln={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`},Rn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rn[e])?!!t[e]:!1}function Bn(){return zn}var Vn=xn(m({},wn,{key:function(e){if(e.key){var t=In[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=vn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Ln[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bn,charCode:function(e){return e.type===`keypress`?vn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?vn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Hn=xn(m({},kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Un=xn(m({},wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bn})),Wn=xn(m({},Sn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Gn=xn(m({},kn,{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})),Kn=xn(m({},Sn,{newState:0,oldState:0})),qn=[9,13,27,32],Jn=dn&&`CompositionEvent`in window,Yn=null;dn&&`documentMode`in document&&(Yn=document.documentMode);var Xn=dn&&`TextEvent`in window&&!Yn,Zn=dn&&(!Jn||Yn&&8<Yn&&11>=Yn),Qn=` `,$n=!1;function er(e,t){switch(e){case`keyup`:return qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function tr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var nr=!1;function rr(e,t){switch(e){case`compositionend`:return tr(t);case`keypress`:return t.which===32?($n=!0,Qn):null;case`textInput`:return e=t.data,e===Qn&&$n?null:e;default:return null}}function ir(e,t){if(nr)return e===`compositionend`||!Jn&&er(e,t)?(e=_n(),gn=hn=mn=null,nr=!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 Zn&&t.locale!==`ko`?null:t.data;default:return null}}var ar={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 or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ar[e.type]:t===`textarea`}function sr(e,t,n,r){an?on?on.push(r):on=[r]:an=r,t=Ed(t,`onChange`),0<t.length&&(n=new Cn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var cr=null,lr=null;function ur(e){yd(e,0)}function dr(e){if(Lt(yt(e)))return e}function fr(e,t){if(e===`change`)return t}var pr=!1;if(dn){var mr;if(dn){var hr=`oninput`in document;if(!hr){var gr=document.createElement(`div`);gr.setAttribute(`oninput`,`return;`),hr=typeof gr.oninput==`function`}mr=hr}else mr=!1;pr=mr&&(!document.documentMode||9<document.documentMode)}function _r(){cr&&(cr.detachEvent(`onpropertychange`,vr),lr=cr=null)}function vr(e){if(e.propertyName===`value`&&dr(lr)){var t=[];sr(t,lr,e,rn(e)),ln(ur,t)}}function yr(e,t,n){e===`focusin`?(_r(),cr=t,lr=n,cr.attachEvent(`onpropertychange`,vr)):e===`focusout`&&_r()}function br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return dr(lr)}function xr(e,t){if(e===`click`)return dr(t)}function Sr(e,t){if(e===`input`||e===`change`)return dr(t)}function Cr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var wr=typeof Object.is==`function`?Object.is:Cr;function Tr(e,t){if(wr(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(!Ee.call(t,i)||!wr(e[i],t[i]))return!1}return!0}function Er(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dr(e,t){var n=Er(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=Er(n)}}function Or(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Or(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rt(e.document)}return t}function Ar(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 jr=dn&&`documentMode`in document&&11>=document.documentMode,Mr=null,Nr=null,Pr=null,Fr=!1;function Ir(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fr||Mr==null||Mr!==Rt(r)||(r=Mr,`selectionStart`in r&&Ar(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}),Pr&&Tr(Pr,r)||(Pr=r,r=Ed(Nr,`onSelect`),0<r.length&&(t=new Cn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Mr)))}function Lr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Rr={animationend:Lr(`Animation`,`AnimationEnd`),animationiteration:Lr(`Animation`,`AnimationIteration`),animationstart:Lr(`Animation`,`AnimationStart`),transitionrun:Lr(`Transition`,`TransitionRun`),transitionstart:Lr(`Transition`,`TransitionStart`),transitioncancel:Lr(`Transition`,`TransitionCancel`),transitionend:Lr(`Transition`,`TransitionEnd`)},zr={},Br={};dn&&(Br=document.createElement(`div`).style,`AnimationEvent`in window||(delete Rr.animationend.animation,delete Rr.animationiteration.animation,delete Rr.animationstart.animation),`TransitionEvent`in window||delete Rr.transitionend.transition);function Vr(e){if(zr[e])return zr[e];if(!Rr[e])return e;var t=Rr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Br)return zr[e]=t[n];return e}var Hr=Vr(`animationend`),Ur=Vr(`animationiteration`),Wr=Vr(`animationstart`),Gr=Vr(`transitionrun`),Kr=Vr(`transitionstart`),qr=Vr(`transitioncancel`),Jr=Vr(`transitionend`),L=new Map,Yr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Yr.push(`scrollEnd`);function Xr(e,t){L.set(e,t),wt(t,[e])}var Zr=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)},Qr=[],$r=0,ei=0;function ti(){for(var e=$r,t=ei=$r=0;t<e;){var n=Qr[t];Qr[t++]=null;var r=Qr[t];Qr[t++]=null;var i=Qr[t];Qr[t++]=null;var a=Qr[t];if(Qr[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&&ai(n,i,a)}}function ni(e,t,n,r){Qr[$r++]=e,Qr[$r++]=t,Qr[$r++]=n,Qr[$r++]=r,ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ri(e,t,n,r){return ni(e,t,n,r),oi(e)}function ii(e,t){return ni(e,null,null,t),oi(e)}function ai(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-He(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function oi(e){if(50<du)throw du=0,fu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var si={};function ci(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 li(e,t,n,r){return new ci(e,t,n,r)}function ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function di(e,t){var n=e.alternate;return n===null?(n=li(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function fi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function pi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ui(e)&&(s=1);else if(typeof e==`string`)s=Wf(e,n,me.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case re:return e=li(31,n,t,a),e.elementType=re,e.lanes=o,e;case y:return mi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=li(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case ee:return e=li(13,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return e=li(19,n,t,a),e.elementType=te,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case ne:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=li(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function mi(e,t,n,r){return e=li(7,e,r,t),e.lanes=n,e}function hi(e,t,n){return e=li(6,e,null,t),e.lanes=n,e}function gi(e){var t=li(18,null,null,0);return t.stateNode=e,t}function _i(e,t,n){return t=li(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vi=new WeakMap;function yi(e,t){if(typeof e==`object`&&e){var n=vi.get(e);return n===void 0?(t={value:e,source:t,stack:Te(t)},vi.set(e,t),t):n}return{value:e,source:t,stack:Te(t)}}var bi=[],xi=0,Si=null,Ci=0,wi=[],Ti=0,Ei=null,Di=1,Oi=``;function ki(e,t){bi[xi++]=Ci,bi[xi++]=Si,Si=e,Ci=t}function Ai(e,t,n){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Ei=e;var r=Di;e=Oi;var i=32-He(r)-1;r&=~(1<<i),n+=1;var a=32-He(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Di=1<<32-He(t)+i|n<<i|r,Oi=a+e}else Di=1<<a|n<<i|r,Oi=e}function ji(e){e.return!==null&&(ki(e,1),Ai(e,1,0))}function Mi(e){for(;e===Si;)Si=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null;for(;e===Ei;)Ei=wi[--Ti],wi[Ti]=null,Oi=wi[--Ti],wi[Ti]=null,Di=wi[--Ti],wi[Ti]=null}function Ni(e,t){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Di=t.id,Oi=t.overflow,Ei=e}var Pi=null,Fi=null,R=!1,Ii=null,Li=!1,Ri=Error(i(519));function zi(e){throw Wi(yi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ri}function Bi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ct]=e,t[lt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),Ht(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Kt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=tn),t=!0):t=!1,t||zi(e,!0)}function Vi(e){for(Pi=e.return;Pi;)switch(Pi.tag){case 5:case 31:case 13:Li=!1;return;case 27:case 3:Li=!0;return;default:Pi=Pi.return}}function z(e){if(e!==Pi)return!1;if(!R)return Vi(e),R=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Wd(e.type,e.memoizedProps)),n=!n),n&&Fi&&zi(e),Vi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Fi=df(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Fi=df(e)}else t===27?(t=Fi,Qd(e.type)?(e=uf,uf=null,Fi=e):Fi=t):Fi=Pi?lf(e.stateNode.nextSibling):null;return!0}function Hi(){Fi=Pi=null,R=!1}function Ui(){var e=Ii;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),Ii=null),e}function Wi(e){Ii===null?Ii=[e]:Ii.push(e)}var Gi=fe(null),Ki=null,qi=null;function Ji(e,t,n){k(Gi,t._currentValue),t._currentValue=n}function Yi(e){e._currentValue=Gi.current,pe(Gi)}function Xi(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 Zi(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),Xi(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),Xi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Qi(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;wr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===A.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[$f]:e.push($f))}a=a.return}e!==null&&Zi(t,e,n,r),t.flags|=262144}function $i(e){for(e=e.firstContext;e!==null;){if(!wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ea(e){Ki=e,qi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ta(e){return ra(Ki,e)}function na(e,t){return Ki===null&&ea(e),ra(e,t)}function ra(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},qi===null){if(e===null)throw Error(i(308));qi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qi=qi.next=t;return n}var ia=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()})}},aa=t.unstable_scheduleCallback,oa=t.unstable_NormalPriority,sa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ca(){return{controller:new ia,data:new Map,refCount:0}}function la(e){e.refCount--,e.refCount===0&&aa(oa,function(){e.controller.abort()})}var ua=null,da=0,fa=0,pa=null;function ma(e,t){if(ua===null){var n=ua=[];da=0,fa=dd(),pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return da++,t.then(ha,ha),t}function ha(){if(--da===0&&ua!==null){pa!==null&&(pa.status=`fulfilled`);var e=ua;ua=null,fa=0,pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ga(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 _a=E.S;E.S=function(e,t){eu=Ae(),typeof t==`object`&&t&&typeof t.then==`function`&&ma(e,t),_a!==null&&_a(e,t)};var va=fe(null);function ya(){var e=va.current;return e===null?Vl.pooledCache:e}function ba(e,t){t===null?k(va,va.current):k(va,t.pool)}function xa(){var e=ya();return e===null?null:{parent:sa._currentValue,pool:e}}var Sa=Error(i(460)),Ca=Error(i(474)),wa=Error(i(542)),Ta={then:function(){}};function Ea(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Da(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(tn,tn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Aa(e),e;default:if(typeof t.status==`string`)t.then(tn,tn);else{if(e=Vl,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,Aa(e),e}throw ka=t,Sa}}function Oa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ka=e,Sa):e}}var ka=null;function B(){if(ka===null)throw Error(i(459));var e=ka;return ka=null,e}function Aa(e){if(e===Sa||e===wa)throw Error(i(483))}var ja=null,Ma=0;function Na(e){var t=Ma;return Ma+=1,ja===null&&(ja=[]),Da(ja,e,t)}function Pa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Fa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ia(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=di(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&Oa(i)===t.type)?(t=a(t,n.props),Pa(t,n),t.return=e,t):(t=pi(n.type,n.key,n.props,null,e.mode,r),Pa(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=_i(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=mi(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=hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=pi(t.type,t.key,t.props,null,e.mode,n),Pa(n,t),n.return=e,n;case v:return t=_i(t,e.mode,n),t.return=e,t;case T:return t=Oa(t),f(e,t,n)}if(le(t)||oe(t))return t=mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Na(t),n);if(t.$$typeof===C)return f(e,na(e,t),n);Fa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case T:return n=Oa(n),p(e,t,n,r)}if(le(n)||oe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Na(n),r);if(n.$$typeof===C)return p(e,t,na(e,n),r);Fa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=Oa(r),m(e,t,n,r,i)}if(le(r)||oe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Na(r),i);if(r.$$typeof===C)return m(e,t,n,na(t,r),i);Fa(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),R&&ki(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return R&&ki(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),R&&ki(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),R&&ki(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return R&&ki(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),R&&ki(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Oa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Pa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=mi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=pi(o.type,o.key,o.props,null,e.mode,c),Pa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=_i(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Oa(o),b(e,r,o,c)}if(le(o))return h(e,r,o,c);if(oe(o)){if(l=oe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Na(o),c);if(o.$$typeof===C)return b(e,r,na(e,o),c);Fa(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=hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ma=0;var i=b(e,t,n,r);return ja=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=li(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var La=Ia(!0),Ra=Ia(!1),za=!1;function Ba(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Va(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 Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,W&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=oi(e),ai(e,null,n),t}return ni(e,r,t,n),oi(e)}function Wa(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,F(e,n)}}function Ga(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ka=!1;function qa(){if(Ka){var e=pa;if(e!==null)throw e}}function Ja(e,t,n,r){Ka=!1;var i=e.updateQueue;za=!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?(K&f)===f:(r&f)===f){f!==0&&f===fa&&(Ka=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:za=!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),Y|=o,e.lanes=o,e.memoizedState=d}}function Ya(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Xa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ya(n[e],t)}var Za=fe(null),Qa=fe(0);function $a(e,t){e=Gl,k(Qa,e),k(Za,t),Gl=e|t.baseLanes}function eo(){k(Qa,Gl),k(Za,Za.current)}function to(){Gl=Qa.current,pe(Za),pe(Qa)}var no=fe(null),ro=null;function io(e){var t=e.alternate;k(lo,lo.current&1),k(no,e),ro===null&&(t===null||Za.current!==null||t.memoizedState!==null)&&(ro=e)}function ao(e){k(lo,lo.current),k(no,e),ro===null&&(ro=e)}function oo(e){e.tag===22?(k(lo,lo.current),k(no,e),ro===null&&(ro=e)):so(e)}function so(){k(lo,lo.current),k(no,no.current)}function co(e){pe(no),ro===e&&(ro=null),pe(lo)}var lo=fe(0);function uo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||of(n)||sf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var fo=0,V=null,H=null,po=null,mo=!1,ho=!1,go=!1,_o=0,vo=0,yo=null,bo=0;function xo(){throw Error(i(321))}function So(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wr(e[n],t[n]))return!1;return!0}function Co(e,t,n,r,i,a){return fo=a,V=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?zs:Bs,go=!1,a=n(r,i),go=!1,ho&&(a=To(t,n,r,i)),wo(e),a}function wo(e){E.H=Rs;var t=H!==null&&H.next!==null;if(fo=0,po=H=V=null,mo=!1,vo=0,yo=null,t)throw Error(i(300));e===null||rc||(e=e.dependencies,e!==null&&$i(e)&&(rc=!0))}function To(e,t,n,r){V=e;var a=0;do{if(ho&&(yo=null),vo=0,ho=!1,25<=a)throw Error(i(301));if(a+=1,po=H=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}E.H=Vs,o=t(n,r)}while(ho);return o}function Eo(){var e=E.H,t=e.useState()[0];return t=typeof t.then==`function`?No(t):t,e=e.useState()[0],(H===null?null:H.memoizedState)!==e&&(V.flags|=1024),t}function Do(){var e=_o!==0;return _o=0,e}function Oo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ko(e){if(mo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}mo=!1}fo=0,po=H=V=null,ho=!1,vo=_o=0,yo=null}function Ao(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return po===null?V.memoizedState=po=e:po=po.next=e,po}function jo(){if(H===null){var e=V.alternate;e=e===null?null:e.memoizedState}else e=H.next;var t=po===null?V.memoizedState:po.next;if(t!==null)po=t,H=e;else{if(e===null)throw V.alternate===null?Error(i(467)):Error(i(310));H=e,e={memoizedState:H.memoizedState,baseState:H.baseState,baseQueue:H.baseQueue,queue:H.queue,next:null},po===null?V.memoizedState=po=e:po=po.next=e}return po}function Mo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function No(e){var t=vo;return vo+=1,yo===null&&(yo=[]),e=Da(yo,e,t),t=V,(po===null?t.memoizedState:po.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?zs:Bs),e}function Po(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return No(e);if(e.$$typeof===C)return ta(e)}throw Error(i(438,String(e)))}function Fo(e){var t=null,n=V.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=V.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=Mo(),V.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]=ie;return t.index++,n}function Io(e,t){return typeof t==`function`?t(e):t}function Lo(e){return Ro(jo(),H,e)}function Ro(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(fo&f)===f:(K&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===fa&&(d=!0);else if((fo&p)===p){u=u.next,p===fa&&(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,V.lanes|=p,Y|=p;f=u.action,go&&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,V.lanes|=f,Y|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!wr(o,e.memoizedState)&&(rc=!0,d&&(n=pa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function zo(e){var t=jo(),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);wr(o,t.memoizedState)||(rc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Bo(e,t,n){var r=V,a=jo(),o=R;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!wr((H||a).memoizedState,n);if(s&&(a.memoizedState=n,rc=!0),a=a.queue,us(Uo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||po!==null&&po.memoizedState.tag&1){if(r.flags|=2048,U(9,{destroy:void 0},Ho.bind(null,r,a,n,t),null),Vl===null)throw Error(i(349));o||fo&127||Vo(r,t,n)}return n}function Vo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=V.updateQueue,t===null?(t=Mo(),V.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ho(e,t,n,r){t.value=n,t.getSnapshot=r,Wo(t)&&Go(e)}function Uo(e,t,n){return n(function(){Wo(t)&&Go(e)})}function Wo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wr(e,n)}catch{return!0}}function Go(e){var t=ii(e,2);t!==null&&hu(t,e,2)}function Ko(e){var t=Ao();if(typeof e==`function`){var n=e;if(e=n(),go){Ve(!0);try{n()}finally{Ve(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:e},t}function qo(e,t,n,r){return e.baseState=n,Ro(e,H,typeof r==`function`?r:Io)}function Jo(e,t,n,r,a){if(Fs(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)}};E.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Yo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Yo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=E.T,o={};E.T=o;try{var s=n(i,r),c=E.S;c!==null&&c(o,s),Xo(e,t,s)}catch(n){Qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),E.T=a}}else try{a=n(i,r),Xo(e,t,a)}catch(n){Qo(e,t,n)}}function Xo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Zo(e,t,n)},function(n){return Qo(e,t,n)}):Zo(e,t,n)}function Zo(e,t,n){t.status=`fulfilled`,t.value=n,$o(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Yo(e,n)))}function Qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,$o(t),t=t.next;while(t!==r)}e.action=null}function $o(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function es(e,t){return t}function ts(e,t){if(R){var n=Vl.formState;if(n!==null){a:{var r=V;if(R){if(Fi){b:{for(var i=Fi,a=Li;i.nodeType!==8;){if(!a){i=null;break b}if(i=lf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Fi=lf(i.nextSibling),r=i.data===`F!`;break a}}zi(r)}r=!1}r&&(t=n[0])}}return n=Ao(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:es,lastRenderedState:t},n.queue=r,n=Ms.bind(null,V,r),r.dispatch=n,r=Ko(!1),a=Ps.bind(null,V,!1,r.queue),r=Ao(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Jo.bind(null,V,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ns(e){return rs(jo(),H,e)}function rs(e,t,n){if(t=Ro(e,t,es)[0],e=Lo(Io)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=No(t)}catch(e){throw e===Sa?wa:e}else r=t;t=jo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(V.flags|=2048,U(9,{destroy:void 0},is.bind(null,i,n),null)),[r,a,e]}function is(e,t){e.action=t}function as(e){var t=jo(),n=H;if(n!==null)return rs(t,n,e);jo(),t=t.memoizedState,n=jo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function U(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=V.updateQueue,t===null&&(t=Mo(),V.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 os(){return jo().memoizedState}function ss(e,t,n,r){var i=Ao();V.flags|=e,i.memoizedState=U(1|t,{destroy:void 0},n,r===void 0?null:r)}function cs(e,t,n,r){var i=jo();r=r===void 0?null:r;var a=i.memoizedState.inst;H!==null&&r!==null&&So(r,H.memoizedState.deps)?i.memoizedState=U(t,a,n,r):(V.flags|=e,i.memoizedState=U(1|t,a,n,r))}function ls(e,t){ss(8390656,8,e,t)}function us(e,t){cs(2048,8,e,t)}function ds(e){V.flags|=4;var t=V.updateQueue;if(t===null)t=Mo(),V.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function fs(e){var t=jo().memoizedState;return ds({ref:t,nextImpl:e}),function(){if(W&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ps(e,t){return cs(4,2,e,t)}function ms(e,t){return cs(4,4,e,t)}function hs(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 gs(e,t,n){n=n==null?null:n.concat([e]),cs(4,4,hs.bind(null,t,e),n)}function _s(){}function vs(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&So(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ys(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&So(t,r[1]))return r[0];if(r=e(),go){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r}function bs(e,t,n){return n===void 0||fo&1073741824&&!(K&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),V.lanes|=e,Y|=e,n)}function xs(e,t,n,r){return wr(n,t)?n:Za.current===null?!(fo&42)||fo&1073741824&&!(K&261930)?(rc=!0,e.memoizedState=n):(e=mu(),V.lanes|=e,Y|=e,t):(e=bs(e,n,r),wr(e,t)||(rc=!0),e)}function Ss(e,t,n,r,i){var a=D.p;D.p=a!==0&&8>a?a:8;var o=E.T,s={};E.T=s,Ps(e,!1,t,n);try{var c=i(),l=E.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ns(e,t,ga(c,r),pu(e)):Ns(e,t,r,pu(e))}catch(n){Ns(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{D.p=a,o!==null&&s.types!==null&&(o.types=s.types),E.T=o}}function Cs(){}function ws(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ts(e).queue;Ss(e,a,t,ue,n===null?Cs:function(){return Es(e),n(r)})}function Ts(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Es(e){var t=Ts(e);t.next===null&&(t=e.alternate.memoizedState),Ns(e,t.next.queue,{},pu())}function Ds(){return ta($f)}function Os(){return jo().memoizedState}function ks(){return jo().memoizedState}function As(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Ha(n);var r=Ua(t,e,n);r!==null&&(hu(r,t,n),Wa(r,t,n)),t={cache:ca()},e.payload=t;return}t=t.return}}function js(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fs(e)?Is(t,n):(n=ri(e,t,n,r),n!==null&&(hu(n,e,r),Ls(n,t,r)))}function Ms(e,t,n){Ns(e,t,n,pu())}function Ns(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fs(e))Is(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,wr(s,o))return ni(e,t,i,0),Vl===null&&ti(),!1}catch{}if(n=ri(e,t,i,r),n!==null)return hu(n,e,r),Ls(n,t,r),!0}return!1}function Ps(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Fs(e)){if(t)throw Error(i(479))}else t=ri(e,n,r,2),t!==null&&hu(t,e,2)}function Fs(e){var t=e.alternate;return e===V||t!==null&&t===V}function Is(e,t){ho=mo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ls(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,F(e,n)}}var Rs={readContext:ta,use:Po,useCallback:xo,useContext:xo,useEffect:xo,useImperativeHandle:xo,useLayoutEffect:xo,useInsertionEffect:xo,useMemo:xo,useReducer:xo,useRef:xo,useState:xo,useDebugValue:xo,useDeferredValue:xo,useTransition:xo,useSyncExternalStore:xo,useId:xo,useHostTransitionStatus:xo,useFormState:xo,useActionState:xo,useOptimistic:xo,useMemoCache:xo,useCacheRefresh:xo};Rs.useEffectEvent=xo;var zs={readContext:ta,use:Po,useCallback:function(e,t){return Ao().memoizedState=[e,t===void 0?null:t],e},useContext:ta,useEffect:ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ss(4194308,4,hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ss(4194308,4,e,t)},useInsertionEffect:function(e,t){ss(4,2,e,t)},useMemo:function(e,t){var n=Ao();t=t===void 0?null:t;var r=e();if(go){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Ao();if(n!==void 0){var i=n(t);if(go){Ve(!0);try{n(t)}finally{Ve(!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=js.bind(null,V,e),[r.memoizedState,e]},useRef:function(e){var t=Ao();return e={current:e},t.memoizedState=e},useState:function(e){e=Ko(e);var t=e.queue,n=Ms.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:_s,useDeferredValue:function(e,t){return bs(Ao(),e,t)},useTransition:function(){var e=Ko(!1);return e=Ss.bind(null,V,e.queue,!0,!1),Ao().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=V,a=Ao();if(R){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Vl===null)throw Error(i(349));K&127||Vo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ls(Uo.bind(null,r,o,e),[e]),r.flags|=2048,U(9,{destroy:void 0},Ho.bind(null,r,o,n,t),null),n},useId:function(){var e=Ao(),t=Vl.identifierPrefix;if(R){var n=Oi,r=Di;n=(r&~(1<<32-He(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=_o++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=bo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ds,useFormState:ts,useActionState:ts,useOptimistic:function(e){var t=Ao();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ps.bind(null,V,!0,n),n.dispatch=t,[e,t]},useMemoCache:Fo,useCacheRefresh:function(){return Ao().memoizedState=As.bind(null,V)},useEffectEvent:function(e){var t=Ao(),n={impl:e};return t.memoizedState=n,function(){if(W&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Bs={readContext:ta,use:Po,useCallback:vs,useContext:ta,useEffect:us,useImperativeHandle:gs,useInsertionEffect:ps,useLayoutEffect:ms,useMemo:ys,useReducer:Lo,useRef:os,useState:function(){return Lo(Io)},useDebugValue:_s,useDeferredValue:function(e,t){return xs(jo(),H.memoizedState,e,t)},useTransition:function(){var e=Lo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:Os,useHostTransitionStatus:Ds,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){return qo(jo(),H,e,t)},useMemoCache:Fo,useCacheRefresh:ks};Bs.useEffectEvent=fs;var Vs={readContext:ta,use:Po,useCallback:vs,useContext:ta,useEffect:us,useImperativeHandle:gs,useInsertionEffect:ps,useLayoutEffect:ms,useMemo:ys,useReducer:zo,useRef:os,useState:function(){return zo(Io)},useDebugValue:_s,useDeferredValue:function(e,t){var n=jo();return H===null?bs(n,e,t):xs(n,H.memoizedState,e,t)},useTransition:function(){var e=zo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:Os,useHostTransitionStatus:Ds,useFormState:as,useActionState:as,useOptimistic:function(e,t){var n=jo();return H===null?(n.baseState=e,[e,n.queue.dispatch]):qo(n,H,e,t)},useMemoCache:Fo,useCacheRefresh:ks};Vs.useEffectEvent=fs;function Hs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Us={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ha(r);i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(hu(t,e,r),Wa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ha(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(hu(t,e,r),Wa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=Ha(n);r.tag=2,t!=null&&(r.callback=t),t=Ua(e,r,n),t!==null&&(hu(t,e,n),Wa(t,e,n))}};function Ws(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?!Tr(n,r)||!Tr(i,a):!0}function Gs(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&&Us.enqueueReplaceState(t,t.state,null)}function Ks(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function qs(e){Zr(e)}function Js(e){console.error(e)}function Ys(e){Zr(e)}function Xs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Zs(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 Qs(e,t,n){return n=Ha(n),n.tag=3,n.payload={element:null},n.callback=function(){Xs(e,t)},n}function $s(e){return e=Ha(e),e.tag=3,e}function ec(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Zs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Zs(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function tc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Qi(t,n,a,!0),n=no.current,n!==null){switch(n.tag){case 31:case 13:return ro===null?Du():n.alternate===null&&Kl===0&&(Kl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===Ta?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)),Gu(e,r,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Du(),!1}if(R)return t=no.current,t===null?(r!==Ri&&(t=Error(i(423),{cause:r}),Wi(yi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=yi(r,n),a=Qs(e.stateNode,r,a),Ga(e,a),Kl!==4&&(Kl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ri&&(e=Error(i(422),{cause:r}),Wi(yi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=yi(o,n),Xl===null?Xl=[o]:Xl.push(o),Kl!==4&&(Kl=2),t===null)return!0;r=yi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Qs(n.stateNode,r,e),Ga(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`&&(ru===null||!ru.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=$s(a),ec(a,e,n,r),Ga(n,a),!1}n=n.return}while(n!==null);return!1}var nc=Error(i(461)),rc=!1;function ic(e,t,n,r){t.child=e===null?Ra(t,null,n,r):La(t,e.child,n,r)}function ac(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ea(t),r=Co(e,t,n,o,a,i),s=Do(),e!==null&&!rc?(Oo(e,t,i),kc(e,t,i)):(R&&s&&ji(t),t.flags|=1,ic(e,t,r,i),t.child)}function oc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,sc(e,t,a,r,i)):(e=pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ac(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Tr:n,n(o,r)&&e.ref===t.ref)return kc(e,t,i)}return t.flags|=1,e=di(a,r),e.ref=t.ref,e.return=t,t.child=e}function sc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Tr(a,r)&&e.ref===t.ref){if(rc=!1,t.pendingProps=r=a,Ac(e,i))e.flags&131072&&(rc=!0);else return t.lanes=e.lanes,kc(e,t,i)}}return hc(e,t,n,r,i)}function cc(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 uc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ba(t,a===null?null:a.cachePool),a===null?eo():$a(t,a),oo(t);else return r=t.lanes=536870912,uc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ba(t,null),eo(),so(t)):(ba(t,a.cachePool),$a(t,a),so(t),t.memoizedState=null);return ic(e,t,i,n),t.child}function lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function uc(e,t,n,r,i){var a=ya();return a=a===null?null:{parent:sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ba(t,null),eo(),oo(t),e!==null&&Qi(e,t,r,!0),t.childLanes=i,null}function dc(e,t){return t=wc({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 La(t,e.child,null,n),e=dc(t,t.pendingProps),e.flags|=2,co(t),t.memoizedState=null,e}function pc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(R){if(r.mode===`hidden`)return e=dc(t,r),t.lanes=536870912,lc(null,e);if(ao(t),(e=Fi)?(e=af(e,Li),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw zi(t);return t.lanes=536870912,null}return dc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ao(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(rc||Qi(e,t,n,!1),a=(n&e.childLanes)!==0,rc||a){if(r=Vl,r!==null&&(s=rt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ii(e,s),hu(r,e,s),nc;Du(),t=fc(e,t,n)}else e=o.treeContext,Fi=lf(s.nextSibling),Pi=t,R=!0,Ii=null,Li=!1,e!==null&&Ni(t,e),t=dc(t,r),t.flags|=4096;return t}return e=di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mc(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 hc(e,t,n,r,i){return ea(t),n=Co(e,t,n,r,void 0,i),r=Do(),e!==null&&!rc?(Oo(e,t,i),kc(e,t,i)):(R&&r&&ji(t),t.flags|=1,ic(e,t,n,i),t.child)}function gc(e,t,n,r,i,a){return ea(t),t.updateQueue=null,n=To(t,r,n,i),wo(e),r=Do(),e!==null&&!rc?(Oo(e,t,a),kc(e,t,a)):(R&&r&&ji(t),t.flags|=1,ic(e,t,n,a),t.child)}function _c(e,t,n,r,i){if(ea(t),t.stateNode===null){var a=si,o=n.contextType;typeof o==`object`&&o&&(a=ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Us,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ba(t),o=n.contextType,a.context=typeof o==`object`&&o?ta(o):si,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Hs(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&&Us.enqueueReplaceState(a,a.state,null),Ja(t,r,a,i),qa(),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=Ks(n,s);a.props=c;var l=a.context,u=n.contextType;o=si,typeof u==`object`&&u&&(o=ta(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)&&Gs(t,a,r,o),za=!1;var f=t.memoizedState;a.state=f,Ja(t,r,a,i),qa(),l=t.memoizedState,s||f!==l||za?(typeof d==`function`&&(Hs(t,n,d,r),l=t.memoizedState),(c=za||Ws(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,Va(e,t),o=t.memoizedProps,u=Ks(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=si,typeof l==`object`&&l&&(c=ta(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)&&Gs(t,a,r,c),za=!1,f=t.memoizedState,a.state=f,Ja(t,r,a,i),qa();var p=t.memoizedState;o!==d||f!==p||za||e!==null&&e.dependencies!==null&&$i(e.dependencies)?(typeof s==`function`&&(Hs(t,n,s,r),p=t.memoizedState),(u=za||Ws(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&$i(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,mc(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=La(t,e.child,null,i),t.child=La(t,null,n,i)):ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=kc(e,t,i),e}function vc(e,t,n,r){return Hi(),t.flags|=256,ic(e,t,n,r),t.child}var yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bc(e){return{baseLanes:e,cachePool:xa()}}function xc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function Sc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(lo.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(R){if(a?io(t):so(t),(e=Fi)?(e=af(e,Li),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw zi(t);return sf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(so(t),a=t.mode,c=wc({mode:`hidden`,children:c},a),r=mi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(null,r)):(io(t),Cc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(io(t),t.flags&=-257,t=Tc(e,t,n)):t.memoizedState===null?(so(t),c=r.fallback,a=t.mode,r=wc({mode:`visible`,children:r.children},a),c=mi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,La(t,e.child,null,n),r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,t=lc(null,r)):(so(t),t.child=e.child,t.flags|=128,t=null);else if(io(t),sf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Wi({value:r,source:null,stack:null}),t=Tc(e,t,n)}else if(rc||Qi(e,t,n,!1),s=(n&e.childLanes)!==0,rc||s){if(s=Vl,s!==null&&(r=rt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ii(e,r),hu(s,e,r),nc;of(c)||Du(),t=Tc(e,t,n)}else of(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Fi=lf(c.nextSibling),Pi=t,R=!0,Ii=null,Li=!1,e!==null&&Ni(t,e),t=Cc(t,r.children),t.flags|=4096);return t}return a?(so(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=di(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=mi(c,a,n,null),c.flags|=2):c=di(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,lc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=bc(n):(a=c.cachePool,a===null?a=xa():(l=sa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(e.child,r)):(io(t),n=e.child,e=n.sibling,n=di(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Cc(e,t){return t=wc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function wc(e,t){return e=li(22,e,null,t),e.lanes=0,e}function Tc(e,t,n){return La(t,e.child,null,n),e=Cc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ec(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xi(e.return,t,n)}function Dc(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 Oc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=lo.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,k(lo,o),ic(e,t,r,n),r=R?Ci:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ec(e,n,t);else if(e.tag===19)Ec(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&uo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Dc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&uo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Dc(t,!0,n,null,a,r);break;case`together`:Dc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function kc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Y|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ac(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&$i(e)))}function jc(e,t,n){switch(t.tag){case 3:_e(t,t.stateNode.containerInfo),Ji(t,sa,e.memoizedState.cache),Hi();break;case 27:case 5:ve(t);break;case 4:_e(t,t.stateNode.containerInfo);break;case 10:Ji(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(io(t),e=kc(e,t,n),e===null?null:e.sibling):Sc(e,t,n):(io(t),t.flags|=128,null);io(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Oc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),k(lo,lo.current),r)break;return null;case 22:return t.lanes=0,cc(e,t,n,t.pendingProps);case 24:Ji(t,sa,e.memoizedState.cache)}return kc(e,t,n)}function Mc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)rc=!0;else{if(!Ac(e,n)&&!(t.flags&128))return rc=!1,jc(e,t,n);rc=!!(e.flags&131072)}}else rc=!1,R&&t.flags&1048576&&Ai(t,Ci,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Oa(t.elementType),t.type=e,typeof e==`function`)ui(e)?(r=Ks(e,r),t.tag=1,t=_c(null,t,e,r,n)):(t.tag=0,t=hc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=ac(null,t,e,r,n);break a}if(a===ne){t.tag=14,t=oc(null,t,e,r,n);break a}}throw t=ce(e)||e,Error(i(306,t,``))}}return t;case 0:return hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ks(r,t.pendingProps),_c(e,t,r,a,n);case 3:a:{if(_e(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Va(e,t),Ja(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ji(t,sa,r),r!==o.cache&&Zi(t,[sa],n,!0),qa(),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=yi(Error(i(424)),t),Wi(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(Fi=lf(e.firstChild),Pi=t,R=!0,Ii=null,Li=!0,n=Ra(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Hi(),r===a){t=kc(e,t,n);break a}ic(e,t,r,n)}t=t.child}return t;case 26:return mc(e,t),e===null?(n=Af(t.type,null,t.pendingProps,null))?t.memoizedState=n:R||(n=t.type,e=t.pendingProps,r=Vd(ge.current).createElement(n),r[ct]=t,r[lt]=e,Fd(r,n,e),xt(r),t.stateNode=r):t.memoizedState=Af(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ve(t),e===null&&R&&(r=t.stateNode=pf(t.type,t.pendingProps,ge.current),Pi=t,Li=!0,a=Fi,Qd(t.type)?(uf=a,Fi=lf(r.firstChild)):Fi=a),ic(e,t,t.pendingProps.children,n),mc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&R&&((a=r=Fi)&&(r=nf(r,t.type,t.pendingProps,Li),r===null?a=!1:(t.stateNode=r,Pi=t,Fi=lf(r.firstChild),Li=!1,a=!0)),a||zi(t)),ve(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Wd(a,o)?r=null:s!==null&&Wd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Co(e,t,Eo,null,null,n),$f._currentValue=a),mc(e,t),ic(e,t,r,n),t.child;case 6:return e===null&&R&&((e=n=Fi)&&(n=rf(n,t.pendingProps,Li),n===null?e=!1:(t.stateNode=n,Pi=t,Fi=null,e=!0)),e||zi(t)),null;case 13:return Sc(e,t,n);case 4:return _e(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=La(t,null,r,n):ic(e,t,r,n),t.child;case 11:return ac(e,t,t.type,t.pendingProps,n);case 7:return ic(e,t,t.pendingProps,n),t.child;case 8:return ic(e,t,t.pendingProps.children,n),t.child;case 12:return ic(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ji(t,t.type,r.value),ic(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ea(t),a=ta(a),r=r(a),t.flags|=1,ic(e,t,r,n),t.child;case 14:return oc(e,t,t.type,t.pendingProps,n);case 15:return sc(e,t,t.type,t.pendingProps,n);case 19:return Oc(e,t,n);case 31:return pc(e,t,n);case 22:return cc(e,t,n,t.pendingProps);case 24:return ea(t),r=ta(sa),e===null?(a=ya(),a===null&&(a=Vl,o=ca(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ba(t),Ji(t,sa,a)):((e.lanes&n)!==0&&(Va(e,t),Ja(t,null,null,n),qa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ji(t,sa,r),r!==a.cache&&Zi(t,[sa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ji(t,sa,r))),ic(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Nc(e){e.flags|=4}function Pc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw ka=Ta,Ca}}else e.flags&=-16777217}function Fc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Gf(t)){if(wu())e.flags|=8192;else throw ka=Ta,Ca}}function Ic(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:$e(),e.lanes|=t,Yl|=t)}function Lc(e,t){if(!R)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Rc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function zc(e,t,n){var r=t.pendingProps;switch(Mi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rc(t),null;case 1:return Rc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Yi(sa),j(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(z(t)?Nc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui())),Rc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Nc(t),o===null?(Rc(t),Pc(t,a,null,r,n)):(Rc(t),Fc(t,o))):o?o===e.memoizedState?(Rc(t),t.flags&=-16777217):(Nc(t),Rc(t),Fc(t,o)):(e=e.memoizedProps,e!==r&&Nc(t),Rc(t),Pc(t,a,e,r,n)),null;case 27:if(M(t),n=ge.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Rc(t),null}e=me.current,z(t)?Bi(t,e):(e=pf(a,r,n),t.stateNode=e,Nc(t))}return Rc(t),null;case 5:if(M(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Rc(t),null}if(o=me.current,z(t))Bi(t,o);else{var s=Vd(ge.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ct]=t,o[lt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Fd(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&&Nc(t)}}return Rc(t),Pc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ge.current,z(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Pi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||zi(t,!0)}else e=Vd(e).createTextNode(r),e[ct]=t,t.stateNode=e}return Rc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=z(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ct]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Rc(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(co(t),t):(co(t),null);if(t.flags&128)throw Error(i(558))}return Rc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=z(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ct]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Rc(t),a=!1}else a=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(co(t),t):(co(t),null)}return co(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),Ic(t,t.updateQueue),Rc(t),null);case 4:return j(),e===null&&Sd(t.stateNode.containerInfo),Rc(t),null;case 10:return Yi(t.type),Rc(t),null;case 19:if(pe(lo),r=t.memoizedState,r===null)return Rc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Lc(r,!1);else{if(Kl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=uo(e),o!==null){for(t.flags|=128,Lc(r,!1),e=o.updateQueue,t.updateQueue=e,Ic(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fi(n,e),n=n.sibling;return k(lo,lo.current&1|2),R&&ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ae()>tu&&(t.flags|=128,a=!0,Lc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=uo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ic(t,e),Lc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!R)return Rc(t),null}else 2*Ae()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Lc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Rc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ae(),e.sibling=null,n=lo.current,k(lo,a?n&1|2:n&1),R&&ki(t,r.treeForkCount),e);case 22:case 23:return co(t),to(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Rc(t),t.subtreeFlags&6&&(t.flags|=8192)):Rc(t),n=t.updateQueue,n!==null&&Ic(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&&pe(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yi(sa),Rc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Bc(e,t){switch(Mi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(sa),j(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return M(t),null;case 31:if(t.memoizedState!==null){if(co(t),t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(co(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(lo),null;case 4:return j(),null;case 10:return Yi(t.type),null;case 22:case 23:return co(t),to(),e!==null&&pe(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(sa),null;case 25:return null;default:return null}}function Vc(e,t){switch(Mi(t),t.tag){case 3:Yi(sa),j();break;case 26:case 27:case 5:M(t);break;case 4:j();break;case 31:t.memoizedState!==null&&co(t);break;case 13:co(t);break;case 19:pe(lo);break;case 10:Yi(t.type);break;case 22:case 23:co(t),to(),e!==null&&pe(va);break;case 24:Yi(sa)}}function Hc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Uc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Wc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xa(t,n)}catch(t){Z(e,e.return,t)}}}function Gc(e,t,n){n.props=Ks(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Kc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}}function Jc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Yc(e,t,n){try{var r=e.stateNode;Id(r,e.type,n,t),r[lt]=t}catch(t){Z(e,e.return,t)}}function Xc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qd(e.type)||e.tag===4}function Zc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Xc(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&&Qd(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 Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=tn));else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Fd(t,r,n),t[ct]=e,t[lt]=n}catch(t){Z(e,e.return,t)}}var tl=!1,nl=!1,rl=!1,il=typeof WeakSet==`function`?WeakSet:Set,al=null;function ol(e,t){if(e=e.containerInfo,zd=cp,e=kr(e),Ar(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Bd={focusedElem:e,selectionRange:n},cp=!1,al=t;al!==null;)if(t=al,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,al=e;else for(;al!==null;){switch(t=al,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ks(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)tf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:tf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,al=e;break}al=t.return}}function sl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Sl(e,n),r&4&&Hc(5,n);break;case 1:if(Sl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Ks(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}}r&64&&Wc(n),r&512&&Kc(n,n.return);break;case 3:if(Sl(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{Xa(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&el(n);case 26:case 5:Sl(e,n),t===null&&r&4&&Jc(n),r&512&&Kc(n,n.return);break;case 12:Sl(e,n);break;case 31:Sl(e,n),r&4&&pl(e,n);break;case 13:Sl(e,n),r&4&&ml(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),cf(e,n))));break;case 22:if(r=n.memoizedState!==null||tl,!r){t=t!==null&&t.memoizedState!==null||nl,i=tl;var a=nl;tl=r,(nl=t)&&!a?wl(e,n,!!(n.subtreeFlags&8772)):Sl(e,n),tl=i,nl=a}break;case 30:break;default:Sl(e,n)}}function cl(e){var t=e.alternate;t!==null&&(e.alternate=null,cl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&>(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 ll=null,ul=!1;function dl(e,t,n){for(n=n.child;n!==null;)fl(e,t,n),n=n.sibling}function fl(e,t,n){if(Be&&typeof Be.onCommitFiberUnmount==`function`)try{Be.onCommitFiberUnmount(ze,n)}catch{}switch(n.tag){case 26:nl||qc(n,t),dl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:nl||qc(n,t);var r=ll,i=ul;Qd(n.type)&&(ll=n.stateNode,ul=!1),dl(e,t,n),mf(n.stateNode),ll=r,ul=i;break;case 5:nl||qc(n,t);case 6:if(r=ll,i=ul,ll=null,dl(e,t,n),ll=r,ul=i,ll!==null){if(ul)try{(ll.nodeType===9?ll.body:ll.nodeName===`HTML`?ll.ownerDocument.body:ll).removeChild(n.stateNode)}catch(e){Z(n,t,e)}else try{ll.removeChild(n.stateNode)}catch(e){Z(n,t,e)}}break;case 18:ll!==null&&(ul?(e=ll,$d(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Pp(e)):$d(ll,n.stateNode));break;case 4:r=ll,i=ul,ll=n.stateNode.containerInfo,ul=!0,dl(e,t,n),ll=r,ul=i;break;case 0:case 11:case 14:case 15:Uc(2,n,t),nl||Uc(4,n,t),dl(e,t,n);break;case 1:nl||(qc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Gc(n,t,r)),dl(e,t,n);break;case 21:dl(e,t,n);break;case 22:nl=(r=nl)||n.memoizedState!==null,dl(e,t,n),nl=r;break;default:dl(e,t,n)}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Pp(e)}catch(e){Z(t,t.return,e)}}}function ml(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Pp(e)}catch(e){Z(t,t.return,e)}}function hl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new il),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new il),t;default:throw Error(i(435,e.tag))}}function gl(e,t){var n=hl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function _l(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Qd(c.type)){ll=c.stateNode,ul=!1;break a}break;case 5:ll=c.stateNode,ul=!1;break a;case 3:case 4:ll=c.stateNode.containerInfo,ul=!0;break a}c=c.return}if(ll===null)throw Error(i(160));fl(o,s,a),ll=null,ul=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yl(t,e),t=t.sibling}var vl=null;function yl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:_l(t,e),bl(e),r&4&&(Uc(3,e,e.return),Hc(3,e),Uc(5,e,e.return));break;case 1:_l(t,e),bl(e),r&512&&(nl||n===null||qc(n,n.return)),r&64&&tl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=vl;if(_l(t,e),bl(e),r&512&&(nl||n===null||qc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ht]||o[ct]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Fd(o,r,n),o[ct]=e,xt(o),r=o;break a;case`link`:var s=Hf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Hf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ct]=e,xt(o),r=o}e.stateNode=r}else Uf(a,e.type,e.stateNode)}else e.stateNode=Lf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Yc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Uf(a,e.type,e.stateNode):Lf(a,r,e.memoizedProps))}break;case 27:_l(t,e),bl(e),r&512&&(nl||n===null||qc(n,n.return)),n!==null&&r&4&&Yc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(_l(t,e),bl(e),r&512&&(nl||n===null||qc(n,n.return)),e.flags&32){a=e.stateNode;try{qt(a,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Yc(e,a,n===null?a:n.memoizedProps)),r&1024&&(rl=!0);break;case 6:if(_l(t,e),bl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Vf=null,a=vl,vl=_f(t.containerInfo),_l(t,e),vl=a,bl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Pp(t.containerInfo)}catch(t){Z(e,e.return,t)}rl&&(rl=!1,xl(e));break;case 4:r=vl,vl=_f(e.stateNode.containerInfo),_l(t,e),bl(e),vl=r;break;case 12:_l(t,e),bl(e);break;case 31:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 13:_l(t,e),bl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=Ae()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=tl,d=nl;if(tl=u||a,nl=d||l,_l(t,e),nl=d,tl=u,bl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||tl||nl||Cl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?ef(m,!0):ef(l.stateNode,!1)}catch(e){Z(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,gl(e,n))));break;case 19:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 30:break;case 21:break;default:_l(t,e),bl(e)}}function bl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Xc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;$c(e,Zc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(qt(o,``),n.flags&=-33),$c(e,Zc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Qc(e,Zc(e),s);break;default:throw Error(i(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;xl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Sl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)sl(e,t.alternate,t),t=t.sibling}function Cl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Uc(4,t,t.return),Cl(t);break;case 1:qc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Gc(t,t.return,n),Cl(t);break;case 27:mf(t.stateNode);case 26:case 5:qc(t,t.return),Cl(t);break;case 22:t.memoizedState===null&&Cl(t);break;case 30:Cl(t);break;default:Cl(t)}e=e.sibling}}function wl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:wl(i,a,n),Hc(4,a);break;case 1:if(wl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ya(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Wc(a),Kc(a,a.return);break;case 27:el(a);case 26:case 5:wl(i,a,n),n&&r===null&&o&4&&Jc(a),Kc(a,a.return);break;case 12:wl(i,a,n);break;case 31:wl(i,a,n),n&&o&4&&pl(i,a);break;case 13:wl(i,a,n),n&&o&4&&ml(i,a);break;case 22:a.memoizedState===null&&wl(i,a,n),Kc(a,a.return);break;case 30:break;default:wl(i,a,n)}t=t.sibling}}function Tl(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&&la(n))}function El(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e))}function Dl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ol(e,t,n,r),t=t.sibling}function Ol(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Dl(e,t,n,r),i&2048&&Hc(9,t);break;case 1:Dl(e,t,n,r);break;case 3:Dl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e)));break;case 12:if(i&2048){Dl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Dl(e,t,n,r);break;case 31:Dl(e,t,n,r);break;case 13:Dl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Dl(e,t,n,r):(a._visibility|=2,kl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Dl(e,t,n,r):Al(e,t),i&2048&&Tl(o,t);break;case 24:Dl(e,t,n,r),i&2048&&El(t.alternate,t);break;default:Dl(e,t,n,r)}}function kl(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:kl(a,o,s,c,i),Hc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,kl(a,o,s,c,i)):u._visibility&2?kl(a,o,s,c,i):Al(a,o),i&&l&2048&&Tl(o.alternate,o);break;case 24:kl(a,o,s,c,i),i&&l&2048&&El(o.alternate,o);break;default:kl(a,o,s,c,i)}t=t.sibling}}function Al(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:Al(n,r),i&2048&&Tl(r.alternate,r);break;case 24:Al(n,r),i&2048&&El(r.alternate,r);break;default:Al(n,r)}t=t.sibling}}var jl=8192;function Ml(e,t,n){if(e.subtreeFlags&jl)for(e=e.child;e!==null;)Nl(e,t,n),e=e.sibling}function Nl(e,t,n){switch(e.tag){case 26:Ml(e,t,n),e.flags&jl&&e.memoizedState!==null&&Kf(n,vl,e.memoizedState,e.memoizedProps);break;case 5:Ml(e,t,n);break;case 3:case 4:var r=vl;vl=_f(e.stateNode.containerInfo),Ml(e,t,n),vl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=jl,jl=16777216,Ml(e,t,n),jl=r):Ml(e,t,n));break;default:Ml(e,t,n)}}function Pl(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 Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];al=r,Rl(r,e)}Pl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Il(e),e=e.sibling}function Il(e){switch(e.tag){case 0:case 11:case 15:Fl(e),e.flags&2048&&Uc(9,e,e.return);break;case 3:Fl(e);break;case 12:Fl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ll(e)):Fl(e);break;default:Fl(e)}}function Ll(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];al=r,Rl(r,e)}Pl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Uc(8,t,t.return),Ll(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ll(t));break;default:Ll(t)}e=e.sibling}}function Rl(e,t){for(;al!==null;){var n=al;switch(n.tag){case 0:case 11:case 15:Uc(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:la(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,al=r;else a:for(n=e;al!==null;){r=al;var i=r.sibling,a=r.return;if(cl(r),r===n){al=null;break a}if(i!==null){i.return=a,al=i;break a}al=a}}}var zl={getCacheForType:function(e){var t=ta(sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ta(sa).controller.signal}},Bl=typeof WeakMap==`function`?WeakMap:Map,W=0,Vl=null,G=null,K=0,q=0,Hl=null,Ul=!1,Wl=!1,J=!1,Gl=0,Kl=0,Y=0,X=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return W&2&&K!==0?K&-K:E.T===null?at():dd()}function mu(){if(Jl===0){if(!(K&536870912)||R){var e=qe;qe<<=1,!(qe&3932160)&&(qe=262144),Jl=e}else Jl=536870912}return e=no.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===Vl&&(q===2||q===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,K,Jl,!1)),P(e,n),(!(W&2)||e!==Vl)&&(e===Vl&&(!(W&2)&&(X|=n),Kl===4&&yu(e,K,Jl,!1)),rd(e))}function gu(e,t,n){if(W&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ze(e,t),a=r?Au(e,t):Ou(e,t,!0),o=r;do{if(a===0){Wl&&!r&&yu(e,t,0,!1);break}if(n=e.current.alternate,o&&!vu(n)){a=Ou(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(J&&!l){c.errorRecoveryDisabledLanes|=o,X|=o,a=4;break a}o=Zl,Zl=a,o!==null&&(Zl===null?Zl=o:Zl.push.apply(Zl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Ul);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=$l+300-Ae(),10<a)){if(yu(r,t,Jl,!Ul),Xe(r,0,!0)!==0)break a;su=t,r.timeoutHandle=qd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,X,Yl,Ul,o,`Throttled`,-0,0),a);break a}_u(r,n,Zl,nu,Ql,t,Jl,X,Yl,Ul,o,null,-0,0)}break}while(1);rd(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tn},Nl(t,a,d);var m=(a&62914560)===a?$l-Ae():(a&4194048)===a?eu-Ae():0;if(m=Jf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(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(!wr(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 yu(e,t,n,r){t&=~ql,t&=~X,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-He(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&nt(e,n,t)}function bu(){return W&6?!0:(id(0,!1),!1)}function xu(){if(G!==null){if(q===0)var e=G.return;else e=G,qi=Ki=null,ko(e),ja=null,Ma=0,e=G;for(;e!==null;)Vc(e.alternate,e),e=e.return;G=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Jd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),Vl=e,G=n=di(e.current,null),K=t,q=0,Hl=null,Ul=!1,Wl=Ze(e,t),J=!1,Yl=Jl=ql=X=Y=Kl=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-He(r),a=1<<i;t|=e[i],r&=~a}return Gl=t,ti(),n}function Cu(e,t){V=null,E.H=Rs,t===Sa||t===wa?(t=B(),q=3):t===Ca?(t=B(),q=4):q=t===nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Hl=t,G===null&&(Kl=1,Xs(e,yi(t,e.current)))}function wu(){var e=no.current;return e===null?!0:(K&4194048)===K?ro===null:(K&62914560)===K||K&536870912?e===ro:!1}function Tu(){var e=E.H;return E.H=Rs,e===null?Rs:e}function Eu(){var e=E.A;return E.A=zl,e}function Du(){Kl=4,Ul||(K&4194048)!==K&&no.current!==null||(Wl=!0),!(Y&134217727)&&!(X&134217727)||Vl===null||yu(Vl,K,Jl,!1)}function Ou(e,t,n){var r=W;W|=2;var i=Tu(),a=Eu();(Vl!==e||K!==t)&&(nu=null,Su(e,t)),t=!1;var o=Kl;a:do try{if(q!==0&&G!==null){var s=G,c=Hl;switch(q){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:no.current===null&&(t=!0);var l=q;if(q=0,Hl=null,Pu(e,s,c,l),n&&Wl){o=0;break a}break;default:l=q,q=0,Hl=null,Pu(e,s,c,l)}}ku(),o=Kl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,qi=Ki=null,W=r,E.H=i,E.A=a,G===null&&(Vl=null,K=0,ti()),o}function ku(){for(;G!==null;)Mu(G)}function Au(e,t){var n=W;W|=2;var r=Tu(),a=Eu();Vl!==e||K!==t?(nu=null,tu=Ae()+500,Su(e,t)):Wl=Ze(e,t);a:do try{if(q!==0&&G!==null){t=G;var o=Hl;b:switch(q){case 1:q=0,Hl=null,Pu(e,t,o,1);break;case 2:case 9:if(Ea(o)){q=0,Hl=null,Nu(t);break}t=function(){q!==2&&q!==9||Vl!==e||(q=7),rd(e)},o.then(t,t);break a;case 3:q=7;break a;case 4:q=5;break a;case 7:Ea(o)?(q=0,Hl=null,Nu(t)):(q=0,Hl=null,Pu(e,t,o,7));break;case 5:var s=null;switch(G.tag){case 26:s=G.memoizedState;case 5:case 27:var c=G;if(s?Gf(s):c.stateNode.complete){q=0,Hl=null;var l=c.sibling;if(l!==null)G=l;else{var u=c.return;u===null?G=null:(G=u,Fu(u))}break b}}q=0,Hl=null,Pu(e,t,o,5);break;case 6:q=0,Hl=null,Pu(e,t,o,6);break;case 8:xu(),Kl=6;break a;default:throw Error(i(462))}}ju();break}catch(t){Cu(e,t)}while(1);return qi=Ki=null,E.H=r,E.A=a,W=n,G===null?(Vl=null,K=0,ti(),Kl):0}function ju(){for(;G!==null&&!Oe();)Mu(G)}function Mu(e){var t=Mc(e.alternate,e,Gl);e.memoizedProps=e.pendingProps,t===null?Fu(e):G=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=gc(n,t,t.pendingProps,t.type,void 0,K);break;case 11:t=gc(n,t,t.pendingProps,t.type.render,t.ref,K);break;case 5:ko(t);default:Vc(n,t),t=G=fi(t,Gl),t=Mc(n,t,Gl)}e.memoizedProps=e.pendingProps,t===null?Fu(e):G=t}function Pu(e,t,n,r){qi=Ki=null,ko(t),ja=null,Ma=0;var i=t.return;try{if(tc(e,i,t,n,K)){Kl=1,Xs(e,yi(n,e.current)),G=null;return}}catch(t){if(i!==null)throw G=i,t;Kl=1,Xs(e,yi(n,e.current)),G=null;return}t.flags&32768?(R||r===1?e=!0:Wl||K&536870912?e=!1:(Ul=e=!0,(r===2||r===9||r===3||r===6)&&(r=no.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Ul);return}e=t.return;var n=zc(t.alternate,t,Gl);if(n!==null){G=n;return}if(t=t.sibling,t!==null){G=t;return}G=t=e}while(t!==null);Kl===0&&(Kl=5)}function Iu(e,t){do{var n=Bc(e.alternate,e);if(n!==null){n.flags&=32767,G=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){G=e;return}G=e=n}while(e!==null);Kl=6,G=null}function Lu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(W&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ei,tt(e,n,o,s,c,l),e===Vl&&(G=Vl=null,K=0),ou=t,au=e,su=n,cu=o,lu=a,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Pe,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=E.T,E.T=null,a=D.p,D.p=2,s=W,W|=4;try{ol(e,t,n)}finally{W=s,D.p=a,E.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=E.T,E.T=null;var r=D.p;D.p=2;var i=W;W|=4;try{yl(t,e);var a=Bd,o=kr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Or(s.ownerDocument.documentElement,s)){if(c!==null&&Ar(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 _=Dr(s,h),v=Dr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}cp=!!zd,Bd=zd=null}finally{W=i,D.p=r,E.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=E.T,E.T=null;var r=D.p;D.p=2;var i=W;W|=4;try{sl(e,t.alternate,t)}finally{W=i,D.p=r,E.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,ke();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),I(n),t=t.stateNode,Be&&typeof Be.onCommitFiberRoot==`function`)try{Be.onCommitFiberRoot(ze,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=E.T,i=D.p,D.p=2,E.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{E.T=t,D.p=i}}su&3&&Hu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,id(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,la(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=I(su),r=E.T,a=D.p;try{D.p=32>n?32:n,E.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,W&6)throw Error(i(331));var c=W;if(W|=4,Il(o.current),Ol(o,o.current,s,n),W=c,id(0,!1),Be&&typeof Be.onPostCommitFiberRoot==`function`)try{Be.onPostCommitFiberRoot(ze,o)}catch{}return!0}finally{D.p=a,E.T=r,Vu(e,t)}}function Wu(e,t,n){t=yi(n,t),t=Qs(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(P(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=yi(n,e),n=$s(2),r=Ua(t,n,2),r!==null&&(ec(n,r,t,e),P(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Bl;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)||(J=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Vl===e&&(K&n)===n&&(Kl===4||Kl===3&&(K&62914560)===K&&300>Ae()-$l?!(W&2)&&Su(e,0):ql|=n,Yl===K&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=$e()),e=ii(e,t),e!==null&&(P(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(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),qu(e,n)}function Xu(e,t){return N(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;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-He(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=K,a=Xe(r,r===Vl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ze(r,a)||(n=!0,ld(r,a))}r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Kd()&&(e=nd);for(var t=Ae(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-He(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Qe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Vl,n=K,n=Xe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(q===2||q===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&De(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ze(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&De(r),I(n)){case 2:case 8:n=Ne;break;case 32:n=Pe;break;case 268435456:n=Ie;break;default:n=Pe}return r=cd.bind(null,e),n=N(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&De(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=K;return r=Xe(e,e===Vl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),sd(e,Ae()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Hu())return null;gu(e,t,!0)}function ud(){Xd(function(){W&6?N(Me,ad):od()})}function dd(){if(nd===0){var e=fa;e===0&&(e=Ke,Ke<<=1,!(Ke&261888)&&(Ke=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:en(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[lt]||null).action),o=r.submitter;o&&(t=(t=o[lt]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Cn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);ws(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),ws(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Yr.length;hd++){var gd=Yr[hd];Xr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Xr(Hr,`onAnimationEnd`),Xr(Ur,`onAnimationIteration`),Xr(Wr,`onAnimationStart`),Xr(`dblclick`,`onDoubleClick`),Xr(`focusin`,`onFocus`),Xr(`focusout`,`onBlur`),Xr(Gr,`onTransitionRun`),Xr(Kr,`onTransitionStart`),Xr(qr,`onTransitionCancel`),Xr(Jr,`onTransitionEnd`),Tt(`onMouseEnter`,[`mouseout`,`mouseover`]),Tt(`onMouseLeave`,[`mouseout`,`mouseover`]),Tt(`onPointerEnter`,[`pointerout`,`pointerover`]),Tt(`onPointerLeave`,[`pointerout`,`pointerover`]),wt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),wt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),wt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),wt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`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(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(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){Zr(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){Zr(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[dt];n===void 0&&(n=t[dt]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,St.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(hp(t)){case 2:var i=lp;break;case 8:i=up;break;default:i=dp}n=i.bind(null,t,n,e),i=void 0,!fn||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 wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=_t(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}ln(function(){var r=a,i=rn(n),s=[];a:{var c=L.get(e);if(c!==void 0){var l=Cn,u=e;switch(e){case`keypress`:if(vn(n)===0)break a;case`keydown`:case`keyup`:l=Vn;break;case`focusin`:u=`focus`,l=Mn;break;case`focusout`:u=`blur`,l=Mn;break;case`beforeblur`:case`afterblur`:l=Mn;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=An;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Un;break;case Hr:case Ur:case Wr:l=Nn;break;case Jr:l=Wn;break;case`scroll`:case`scrollend`:l=Tn;break;case`wheel`:l=Gn;break;case`copy`:case`cut`:case`paste`:l=Pn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Hn;break;case`toggle`:case`beforetoggle`:l=Kn}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=un(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==nn&&(u=n.relatedTarget||n.fromElement)&&(_t(u)||u[ut]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?_t(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=An,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Hn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:yt(l),h=u==null?c:yt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,_t(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?yt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=fr;else if(or(c)){if(pr)v=Sr;else{v=br;var y=yr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Zt(r.elementType)&&(v=fr):v=xr;if(v&&=v(e,r)){sr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ut(c,`number`,c.value)}switch(y=r?yt(r):window,e){case`focusin`:(or(y)||y.contentEditable===`true`)&&(Mr=y,Nr=r,Pr=null);break;case`focusout`:Pr=Nr=Mr=null;break;case`mousedown`:Fr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Fr=!1,Ir(s,n,i);break;case`selectionchange`:if(jr)break;case`keydown`:case`keyup`:Ir(s,n,i)}var b;if(Jn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else nr?er(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Zn&&n.locale!==`ko`&&(nr||x!==`onCompositionStart`?x===`onCompositionEnd`&&nr&&(b=_n()):(mn=i,hn=`value`in mn?mn.value:mn.textContent,nr=!0)),y=Ed(r,x),0<y.length&&(x=new Fn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=tr(n),b!==null&&(x.data=b)))),(b=Xn?rr(e,n):ir(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new Fn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(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=un(e,n),i!=null&&r.unshift(Td(e,i,a)),i=un(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(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=un(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=un(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
|
|
9
|
+
`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function Nd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&qt(e,``+r);break;case`className`:jt(e,`class`,r);break;case`tabIndex`:jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:jt(e,n,r);break;case`style`:Xt(e,r,o);break;case`data`:if(t!==`object`){jt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+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`&&Nd(e,t,`name`,a.name,a,null),Nd(e,t,`formEncType`,a.formEncType,a,null),Nd(e,t,`formMethod`,a.formMethod,a,null),Nd(e,t,`formTarget`,a.formTarget,a,null)):(Nd(e,t,`encType`,a.encType,a,null),Nd(e,t,`method`,a.method,a,null),Nd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=en(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),At(e,`popover`,r);break;case`xlinkActuate`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:At(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Qt.get(n)||n,At(e,n,r))}}function Pd(e,t,n,r,a,o){switch(n){case`style`:Xt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&qt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ct.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[lt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):At(e,n,r)}}}function Fd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Nd(e,t,o,s,n,null)}}a&&Nd(e,t,`srcSet`,n.srcSet,n,null),r&&Nd(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Nd(e,t,r,d,n,null)}}Ht(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Nd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Wt(e,!!r,n,!0):Wt(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Nd(e,t,s,c,n,null)}Kt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Nd(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Nd(e,t,u,r,n,null)}return;default:if(Zt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Pd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Nd(e,t,c,r,n,null))}function Id(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)||Nd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Nd(e,t,p,m,r,f)}}Vt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Nd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Nd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Wt(e,!!n,n?[]:``,!1):Wt(e,!!n,t,!0)):Wt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Nd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Nd(e,t,s,a,r,o)}Gt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Nd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Nd(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)&&Nd(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:Nd(e,t,u,p,r,m)}return;default:if(Zt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Pd(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||Pd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Nd(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||Nd(e,t,f,p,r,m)}function Ld(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Rd(){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&&Ld(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&&Ld(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 zd=null,Bd=null;function Vd(e){return e.nodeType===9?e:e.ownerDocument}function Hd(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 Ud(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 Wd(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 Gd=null;function Kd(){var e=window.event;return e&&e.type===`popstate`?e!==Gd&&(Gd=e,!0):(Gd=null,!1)}var qd=typeof setTimeout==`function`?setTimeout:void 0,Jd=typeof clearTimeout==`function`?clearTimeout:void 0,Yd=typeof Promise==`function`?Promise:void 0,Xd=typeof queueMicrotask==`function`?queueMicrotask:Yd===void 0?qd:function(e){return Yd.resolve(null).then(e).catch(Zd)};function Zd(e){setTimeout(function(){throw e})}function Qd(e){return e===`head`}function $d(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Pp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)mf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,mf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ht]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&mf(e.ownerDocument.body)}n=i}while(n);Pp(t)}function ef(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 tf(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`:tf(n),gt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function nf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[ht])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lf(e.nextSibling),e===null)break}return null}function rf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lf(e.nextSibling),e===null))return null;return e}function af(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lf(e.nextSibling),e===null))return null;return e}function of(e){return e.data===`$?`||e.data===`$~`}function sf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cf(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 lf(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 uf=null;function df(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ff(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 pf(e,t,n){switch(t=Vd(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 mf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);gt(e)}var hf=new Map,gf=new Set;function _f(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var vf=D.d;D.d={f:yf,r:bf,D:Cf,C:wf,L:Tf,m:Ef,X:Of,S:Df,M:kf};function yf(){var e=vf.f(),t=bu();return e||t}function bf(e){var t=vt(e);t!==null&&t.tag===5&&t.type===`form`?Es(t):vf.r(e)}var xf=typeof document>`u`?null:document;function Sf(e,t,n){var r=xf;if(r&&typeof t==`string`&&t){var i=Bt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),gf.has(i)||(gf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Fd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Cf(e){vf.D(e),Sf(`dns-prefetch`,e,null)}function wf(e,t){vf.C(e,t),Sf(`preconnect`,e,t)}function Tf(e,t,n){vf.L(e,t,n);var r=xf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Bt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Bt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Bt(n.imageSizes)+`"]`)):i+=`[href="`+Bt(e)+`"]`;var a=i;switch(t){case`style`:a=jf(e);break;case`script`:a=Ff(e)}hf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),hf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Mf(a))||t===`script`&&r.querySelector(If(a))||(t=r.createElement(`link`),Fd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Ef(e,t){vf.m(e,t);var n=xf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Bt(r)+`"][href="`+Bt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ff(e)}if(!hf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),hf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(If(a)))return}r=n.createElement(`link`),Fd(r,`link`,e),xt(r),n.head.appendChild(r)}}}function Df(e,t,n){vf.S(e,t,n);var r=xf;if(r&&e){var i=bt(r).hoistableStyles,a=jf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Mf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=hf.get(a))&&zf(e,n);var c=o=r.createElement(`link`);xt(c),Fd(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,Rf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Of(e,t){vf.X(e,t);var n=xf;if(n&&e){var r=bt(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),xt(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t){vf.M(e,t);var n=xf;if(n&&e){var r=bt(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),xt(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t,n,r){var a=(a=ge.current)?_f(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=jf(n.href),n=bt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=jf(n.href);var o=bt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Mf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),hf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},hf.set(e,n),o||Pf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Ff(n),n=bt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function jf(e){return`href="`+Bt(e)+`"`}function Mf(e){return`link[rel="stylesheet"][`+e+`]`}function Nf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Pf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Fd(t,`link`,n),xt(t),e.head.appendChild(t))}function Ff(e){return`[src="`+Bt(e)+`"]`}function If(e){return`script[async]`+e}function Lf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Bt(n.href)+`"]`);if(r)return t.instance=r,xt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),xt(r),Fd(r,`style`,a),Rf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=jf(n.href);var o=e.querySelector(Mf(a));if(o)return t.state.loading|=4,t.instance=o,xt(o),o;r=Nf(n),(a=hf.get(a))&&zf(r,a),o=(e.ownerDocument||e).createElement(`link`),xt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Fd(o,`link`,r),t.state.loading|=4,Rf(o,n.precedence,e),t.instance=o;case`script`:return o=Ff(n.src),(a=e.querySelector(If(o)))?(t.instance=a,xt(a),a):(r=n,(a=hf.get(o))&&(r=m({},n),Bf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),xt(a),Fd(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,Rf(r,n.precedence,e));return t.instance}function Rf(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 zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Vf=null;function Hf(e,t,n){if(Vf===null){var r=new Map,i=Vf=new Map;i.set(n,r)}else i=Vf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ht]||a[ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Uf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Wf(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 Gf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Kf(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=jf(r.href),a=t.querySelector(Mf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Yf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,xt(a);return}a=t.ownerDocument||t,r=Nf(r),(i=hf.get(i))&&zf(r,i),a=a.createElement(`link`),xt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Fd(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=Yf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var qf=0;function Jf(e,t){return e.stylesheets&&e.count===0&&Zf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&qf===0&&(qf=62500*Rd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Yf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xf=null;function Zf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xf=new Map,t.forEach(Qf,e),Xf=null,Yf.call(e))}function Qf(e,t){if(!(t.state.loading&4)){var n=Xf.get(e);if(n)var r=n.get(null);else{n=new Map,Xf.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=Yf.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 $f={$$typeof:C,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function ep(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=et(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=et(0),this.hiddenUpdates=et(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function tp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ep(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=li(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},Ba(a),e}function np(e){return e?(e=si,e):si}function rp(e,t,n,r,i,a){i=np(i),r.context===null?r.context=i:r.pendingContext=i,r=Ha(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ua(e,r,t),n!==null&&(hu(n,e,t),Wa(n,e,t))}function ip(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ap(e,t){ip(e,t),(e=e.alternate)&&ip(e,t)}function op(e){if(e.tag===13||e.tag===31){var t=ii(e,67108864);t!==null&&hu(t,e,67108864),ap(e,67108864)}}function sp(e){if(e.tag===13||e.tag===31){var t=pu();t=it(t);var n=ii(e,t);n!==null&&hu(n,e,t),ap(e,t)}}var cp=!0;function lp(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=2,dp(e,t,n,r)}finally{D.p=a,E.T=i}}function up(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=8,dp(e,t,n,r)}finally{D.p=a,E.T=i}}function dp(e,t,n,r){if(cp){var i=fp(r);if(i===null)wd(e,t,r,pp,n),wp(e,r);else if(Ep(i,e,t,n,r))r.stopPropagation();else if(wp(e,r),t&4&&-1<Cp.indexOf(e)){for(;i!==null;){var a=vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ye(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-He(o);s.entanglements[1]|=c,o&=~c}rd(a),!(W&6)&&(tu=Ae()+500,id(0,!1))}}break;case 31:case 13:s=ii(a,2),s!==null&&hu(s,a,2),bu(),ap(a,2)}if(a=fp(r),a===null&&wd(e,t,r,pp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function fp(e){return e=rn(e),mp(e)}var pp=null;function mp(e){if(pp=null,e=_t(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return pp=e,null}function hp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(je()){case Me:return 2;case Ne:return 8;case Pe:case Fe:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var gp=!1,_p=null,vp=null,yp=null,bp=new Map,xp=new Map,Sp=[],Cp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function wp(e,t){switch(e){case`focusin`:case`focusout`:_p=null;break;case`dragenter`:case`dragleave`:vp=null;break;case`mouseover`:case`mouseout`:yp=null;break;case`pointerover`:case`pointerout`:bp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:xp.delete(t.pointerId)}}function Tp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=vt(t),t!==null&&op(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ep(e,t,n,r,i){switch(t){case`focusin`:return _p=Tp(_p,e,t,n,r,i),!0;case`dragenter`:return vp=Tp(vp,e,t,n,r,i),!0;case`mouseover`:return yp=Tp(yp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return bp.set(a,Tp(bp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,xp.set(a,Tp(xp.get(a)||null,e,t,n,r,i)),!0}return!1}function Dp(e){var t=_t(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ot(e.priority,function(){sp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ot(e.priority,function(){sp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Op(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=fp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nn=r,n.target.dispatchEvent(r),nn=null}else return t=vt(n),t!==null&&op(t),e.blockedOn=n,!1;t.shift()}return!0}function kp(e,t,n){Op(e)&&n.delete(t)}function Ap(){gp=!1,_p!==null&&Op(_p)&&(_p=null),vp!==null&&Op(vp)&&(vp=null),yp!==null&&Op(yp)&&(yp=null),bp.forEach(kp),xp.forEach(kp)}function jp(e,n){e.blockedOn===n&&(e.blockedOn=null,gp||(gp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ap)))}var Mp=null;function Np(e){Mp!==e&&(Mp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Mp===e&&(Mp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(mp(r||n)===null)continue;break}var a=vt(n);a!==null&&(e.splice(t,3),t-=3,ws(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Pp(e){function t(t){return jp(t,e)}_p!==null&&jp(_p,e),vp!==null&&jp(vp,e),yp!==null&&jp(yp,e),bp.forEach(t),xp.forEach(t);for(var n=0;n<Sp.length;n++){var r=Sp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Sp.length&&(n=Sp[0],n.blockedOn===null);)Dp(n),n.blockedOn===null&&Sp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[lt]||null;if(typeof a==`function`)o||Np(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[lt]||null)s=o.formAction;else if(mp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Np(n)}}}function Fp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Ip(e){this._internalRoot=e}Lp.prototype.render=Ip.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;rp(n,pu(),e,t,null,null)},Lp.prototype.unmount=Ip.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;rp(e.current,2,null,e,null,null),bu(),t[ut]=null}};function Lp(e){this._internalRoot=e}Lp.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Sp.length&&t!==0&&t<Sp[n].priority;n++);Sp.splice(n,0,e),n===0&&Dp(e)}};var Rp=n.version;if(Rp!==`19.2.8`)throw Error(i(527,Rp,`19.2.8`));D.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var zp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:E,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Bp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bp.isDisabled&&Bp.supportsFiber)try{ze=Bp.inject(zp),Be=Bp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=qs,s=Js,c=Ys;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=tp(e,1,!1,null,null,n,r,null,o,s,c,Fp),e[ut]=t.current,Sd(e),new Ip(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_(),b=[{type:`openai`,label:`OpenAI`,apiKeyEnv:`OPENAI_API_KEY`,interactive:!0},{type:`anthropic`,label:`Anthropic`,apiKeyEnv:`ANTHROPIC_API_KEY`,interactive:!0},{type:`google`,label:`Google Gemini`,apiKeyEnv:`GOOGLE_GENERATIVE_AI_API_KEY`,interactive:!0},{type:`deepseek`,label:`DeepSeek`,apiKeyEnv:`DEEPSEEK_API_KEY`,interactive:!0},{type:`groq`,label:`Groq`,apiKeyEnv:`GROQ_API_KEY`,interactive:!0},{type:`mistral`,label:`Mistral`,apiKeyEnv:`MISTRAL_API_KEY`,interactive:!0},{type:`moonshotai`,label:`Moonshot / Kimi`,apiKeyEnv:`MOONSHOT_API_KEY`,interactive:!0},{type:`cohere`,label:`Cohere`,apiKeyEnv:`COHERE_API_KEY`,interactive:!0},{type:`xai`,label:`xAI / Grok`,apiKeyEnv:`XAI_API_KEY`,interactive:!0},{type:`perplexity`,label:`Perplexity`,apiKeyEnv:`PERPLEXITY_API_KEY`,interactive:!0},{type:`togetherai`,label:`Together AI`,apiKeyEnv:`TOGETHER_API_KEY`,interactive:!0},{type:`ollama`,label:`Ollama`,apiKeyEnv:null,interactive:!0},{type:`openai-compatible`,label:`OpenAI Compatible`,apiKeyEnv:`OPENAI_API_KEY`,interactive:!0},{type:`amazon-bedrock`,label:`Amazon Bedrock`,apiKeyEnv:`AWS_BEARER_TOKEN_BEDROCK`,interactive:!1},{type:`azure`,label:`Azure OpenAI`,apiKeyEnv:`AZURE_API_KEY`,interactive:!1}],x=b.map(e=>e.type);function S(e){return x.includes(e)}Array.from(new Set(b.map(e=>e.apiKeyEnv).filter(e=>e!==null)));function C(e){let t=e.trim();if(!t)return;let n=t.indexOf(`/`);if(n>0){let e=t.slice(0,n),r=t.slice(n+1);if(r&&S(e))return{provider:e,model:r}}return{model:t}}var w=[`default`,`acceptEdits`,`plan`,`auto`,`bypass`];function ee(e){return w.includes(e)}var te=[`file_read`,`file_write`,`command`,`network`,`code_exec`],ne=[5,10,15,20,30,60,120,180,240,360,480,720],T=`file_write(./reports/**)`,re=[{id:`repo-sweep`,trigger:{kind:`cron`,cycle:`daily`,at:`09:00`},permission:`default`,allowOperations:[`file_read`],allowRules:[`terminal(git status:*)`,`terminal(git branch:*)`,`terminal(git log:*)`,T]},{id:`todo-digest`,trigger:{kind:`cron`,cycle:`daily`,at:`08:30`},permission:`plan`,allowTools:[`todo`],allowOperations:[`file_read`],allowRules:[T]},{id:`weekly-digest`,trigger:{kind:`cron`,cycle:`weekly`,at:`18:00`,weekdays:[5]},permission:`default`,allowOperations:[`file_read`],allowRules:[`terminal(gh pr list:*)`,`terminal(gh issue list:*)`,`mcp__github__*`,T]},{id:`dep-checkup`,trigger:{kind:`cron`,cycle:`weekly`,at:`10:00`,weekdays:[1]},permission:`default`,allowOperations:[`file_read`],allowRules:[`terminal(pnpm outdated:*)`,`terminal(pnpm audit:*)`,T]},{id:`stale-docs`,trigger:{kind:`cron`,cycle:`monthly`,at:`07:30`,days:[1]},permission:`plan`,allowOperations:[`file_read`],allowRules:[T]},{id:`test-flake`,trigger:{kind:`cron`,cycle:`weekly`,at:`20:00`,weekdays:[3]},permission:`default`,allowOperations:[`file_read`],allowRules:[`terminal(pnpm test:*)`,`terminal(pnpm vitest:*)`,T],timeoutMs:24e5}];Object.freeze([`invalid-reference`,`self-reference`,`too-many`,`not-authorized`,`budget-exceeded`]);function ie(e){throw Error(`unhandled content part: ${JSON.stringify(e)}`)}new RegExp(String.raw`(^|\s)@([^\s${`,。;:!?、)】》」』(【《「『`}]+)`,`gu`);var ae=`[系统] `;function oe(e){if(e.startsWith(`[系统] `))return e.slice(ae.length)}function se(e){return e.inputTokens+(e.cacheHitTokens??0)+(e.cacheWriteTokens??0)}function ce(e,t){return e*t}function le(e,t,n){return e>=ce(t,n)}function E(e){return e.totalTokens??se(e)+e.outputTokens}var D=new Set([`connected`,`session-state`,`approval-resolved`,`question-resolved`,`stream-reset`,`session-cooled`]);function ue(e){return D.has(e.type)}var de=`token`;function O(){return e=>Object.keys(e)}O()({ok:!0,version:!0}),O()({root:!0,name:!0}),O()({root:!0,name:!0,extraRoots:!0,trusted:!0,instructionFiles:!0,skippedInstructionFiles:!0}),O()({contextLength:!0,threshold:!0,auto:!0}),O()({version:!0,nodeVersion:!0,platform:!0,homeDir:!0,dbPath:!0}),O()({sessionId:!0,model:!0,permission:!0,workspace:!0,knownWorkspaces:!0,usageScope:!0,compression:!0,provider:!0,tools:!0,diagnostics:!0,about:!0,lanExposed:!0,nativeDirPicker:!0}),O()({id:!0,state:!0,live:!0,title:!0,model:!0,messageCount:!0,costUsd:!0,startedAt:!0,updatedAt:!0,endedAt:!0,pendingApprovals:!0,pendingQuestions:!0,pendingSince:!0,workspace:!0,turnStartedAt:!0,lastFinish:!0,role:!0}),O()({reason:!0,durationMs:!0,runUsage:!0}),O()({sessions:!0}),O()({sessionId:!0,created:!0,workspace:!0}),O()({session:!0}),O()({deleted:!0,checkpointsRemoved:!0}),O()({title:!0}),O()({session:!0}),O()({messages:!0}),O()({message:!0}),O()({ref:!0}),O()({path:!0}),O()({image:!0}),O()({accepted:!0,queued:!0}),O()({aborted:!0}),O()({state:!0,approvals:!0}),O()({type:!0,requestId:!0,request:!0}),O()({outcome:!0}),O()({resolved:!0}),O()({state:!0,questions:!0}),O()({type:!0,requestId:!0,request:!0}),O()({answers:!0}),O()({resolved:!0}),O()({path:!0,status:!0,oldContent:!0,newContent:!0,oldBytes:!0,newBytes:!0}),O()({source:!0,root:!0,files:!0,truncated:!0,notes:!0}),O()({plan:!0,mode:!0}),O()({binding:!0}),O()({error:!0}),O()({info:!0,output:!0,omittedBytes:!0}),O()({tasks:!0}),O()({active:!0,from:!0}),O()({action:!0}),O()({mode:!0,changed:!0}),O()({turnIndex:!0,createdAt:!0,preview:!0,fileCount:!0,incomplete:!0}),O()({checkpoints:!0}),O()({path:!0,action:!0,drift:!0}),O()({turnIndex:!0,createdAt:!0,preview:!0,canRewindConversation:!0,incomplete:!0,files:!0,conflicts:!0}),O()({turnIndex:!0,scope:!0}),O()({restored:!0,deleted:!0,recreated:!0,skippedConflicts:!0}),O()({files:!0,messagesRemoved:!0}),O()({name:!0,description:!0}),O()({commands:!0}),O()({name:!0,warnings:!0}),O()({name:!0,path:!0,known:!0,readable:!0,group:!0}),O()({path:!0,parent:!0,entries:!0,omitted:!0,hidden:!0}),O()({parent:!0,name:!0}),O()({entry:!0}),O()({breakdown:!0}),O()({ran:!0,before:!0,after:!0}),O()({name:!0,description:!0,source:!0,tools:!0,skills:!0,maxTurns:!0,toolsCut:!0,skillsCut:!0}),O()({name:!0,category:!0,description:!0,tokens:!0,residency:!0,scope:!0,type:!0}),O()({name:!0,toolCount:!0}),O()({name:!0,state:!0,toolCount:!0,reconnectAttempts:!0,source:!0}),O()({root:!0,trusted:!0}),O()({roles:!0,skills:!0,builtinConnectors:!0,mcpServers:!0,project:!0}),O()({ok:!0,server:!0}),O()({name:!0,transport:!0}),O()({server:!0,configPath:!0}),O()({name:!0,body:!0,truncated:!0,bytes:!0}),O()({ok:!0,source:!0,form:!0,skills:!0,issues:!0,token:!0,detail:!0,reason:!0}),O()({ok:!0,imported:!0,skipped:!0,detail:!0,reason:!0}),O()({ok:!0,name:!0,path:!0,detail:!0,reason:!0}),O()({name:!0,description:!0}),O()({role:!0,path:!0}),O()({installed:!0,hits:!0,marketplaces:!0,pendingRestart:!0}),O()({ref:!0}),O()({ref:!0,token:!0}),O()({path:!0}),O()({path:!0,token:!0}),O()({source:!0}),O()({name:!0}),O()({name:!0,token:!0}),O()({ok:!0,preview:!0,token:!0,reason:!0,detail:!0}),O()({ok:!0,entry:!0,pendingRestart:!0,detail:!0,reason:!0}),O()({ok:!0,marketplace:!0,reason:!0,detail:!0}),O()({path:!0,message:!0}),O()({configPath:!0,text:!0,exists:!0,revision:!0,issues:!0}),O()({text:!0,revision:!0}),O()({configPath:!0,revision:!0,issues:!0}),O()({revision:!0}),O()({name:!0,action:!0}),O()({configPath:!0,revision:!0,issues:!0,changes:!0}),O()({level:!0,backend:!0,reason:!0,platform:!0,covers:!0,excludes:!0}),O()({verdict:!0,rule:!0,layer:!0}),O()({kind:!0,rule:!0,by:!0}),O()({present:!0,path:!0,rulesOnly:!0,bypassDisabled:!0}),O()({level:!0,configured:!0,configuredLayer:!0,rules:!0,shadows:!0,managed:!0,cached:!0}),O()({root:!0,name:!0,extraRoots:!0,trusted:!0,instructionFiles:!0,skippedInstructionFiles:!0,trustLevel:!0,unloadedExtraInstructionFiles:!0}),O()({root:!0,name:!0,level:!0,trusted:!0,current:!0}),O()({dir:!0,source:!0,ruleCount:!0}),O()({dirs:!0,projectSkipped:!0,skippedDir:!0}),O()({at:!0,toolName:!0,type:!0,target:!0,outcome:!0,code:!0}),O()({rows:!0,dropped:!0}),O()({sandbox:!0,permission:!0,workspace:!0,knownWorkspaces:!0,policy:!0,audit:!0}),O()({id:!0,toolName:!0,target:!0,scope:!0,decision:!0,at:!0}),O()({id:!0}),O()({revoked:!0,cached:!0}),O()({level:!0,reason:!0}),O()({level:!0,editable:!0,blocked:!0,planMode:!0}),O()({level:!0}),O()({ok:!0,changed:!0,state:!0}),O()({layer:!0,path:!0,apply:!0}),O()({layer:!0}),O()({key:!0,layer:!0,chain:!0,overridable:!0,writes:!0}),O()({rows:!0,overridableKeys:!0,managedPath:!0}),O()({key:!0,layer:!0,value:!0}),O()({key:!0,layer:!0,path:!0,value:!0,apply:!0}),O()({provider:!0,model:!0,origin:!0}),O()({selection:!0,configured:!0}),O()({model:!0}),O()({type:!0,label:!0,envVar:!0,hasKey:!0,keyHint:!0}),O()({providers:!0}),O()({provider:!0,models:!0,source:!0,status:!0}),O()({suggestions:!0}),O()({provider:!0,hasKey:!0,keyHint:!0,backend:!0,encrypted:!0,envPath:!0}),O()({verdict:!0,by:!0,conditional:!0}),O()({name:!0,description:!0,source:!0,type:!0,calls:!0}),O()({tools:!0,level:!0}),O()({path:!0,tool:!0,writes:!0,messageId:!0}),O()({changes:!0,root:!0}),O()({path:!0,ok:!0,kind:!0,bytes:!0,mtimeMs:!0,openable:!0}),O()({path:!0,ok:!0,refusal:!0}),O()({files:!0,overLimit:!0,root:!0}),O()({path:!0,text:!0,bytes:!0}),O()({ok:!0}),O()({backend:!0,canRegister:!0}),O()({maxTurns:!0,timeoutMs:!0,allowTools:!0,allowOperations:!0,allowRules:!0}),O()({schedule:!0,nextRunAt:!0,allowlistApplies:!0}),O()({schedules:!0,capability:!0,defaults:!0,recentRuns:!0}),O()({row:!0}),O()({runs:!0}),O()({name:!0,prompt:!0,permission:!0,trigger:!0,maxBudgetUsd:!0}),O()({ok:!0,issues:!0}),O()({removed:!0}),O()({status:!0,exitCode:!0}),O()({added:!0,row:!0}),O()({runId:!0}),O()({runId:!0,frames:!0,missing:!0,truncated:!0}),O()({items:!0}),O()({code:!0,message:!0}),O()({objective:!0,phase:!0,maxRounds:!0,roundsUsed:!0,createdAt:!0,updatedAt:!0}),O()({defaultMaxRounds:!0,maxRounds:!0,maxObjectiveChars:!0,maxReasonChars:!0}),O()({goal:!0,limits:!0}),O()({objective:!0}),O()({ok:!0,goal:!0}),O()({ok:!0,cleared:!0}),O()({sessionId:!0,sessionTitle:!0,goal:!0}),O()({items:!0}),O()({sessionId:!0,title:!0,updatedAt:!0,messageCount:!0,sameWorkspace:!0}),O()({candidates:!0}),O()({path:!0}),O()({candidates:!0,unmentionable:!0,truncated:!0});var fe=`epoch:sidebar-menu`,pe=[`zh`,`en`];function k(e){return pe.includes(e)}var me=`lang`,he=/\{(\w+)\}/g;function ge(e){let t=t=>e[t]??{};return(e,n,r)=>{let i=t(e)[n]??t(`zh`)[n]??n;return r?i.replace(he,(e,t)=>{let n=r[t];return n===void 0?e:String(n)}):i}}function A(e,t){let n=ge(e);return(e,r)=>n(t,e,r)}var _e=class extends Error{status;url;detail;code;constructor(e,t,n,r=``){super(`${e} ${t}${n?`: ${n}`:``}`),this.status=e,this.url=t,this.detail=n,this.code=r,this.name=`HttpError`}},j=class extends _e{constructor(e,t,n=``){super(401,e,t,n),this.name=`UnauthorizedError`}},ve=class extends _e{constructor(e,t,n=``){super(409,e,t,n),this.name=`TurnBusyError`}};function M(e,t,n,r){return e===401?new j(t,n,r):e===409?new ve(t,n,r):new _e(e,t,n,r)}function ye(e){return e instanceof _e&&e.status===404&&e.code===`unknown-session`}async function be(e){try{let t=await e.text();if(!t)return{detail:``,code:``};try{let e=JSON.parse(t)?.error;if(e&&typeof e==`object`){let{message:t,code:n}=e,r=typeof n==`string`?n:``;if(typeof t==`string`&&t)return{detail:t,code:r};if(r)return{detail:r,code:r}}if(typeof e==`string`&&e)return{detail:e,code:``}}catch{}return{detail:t.slice(0,200),code:``}}catch{return{detail:``,code:``}}}function xe(e,t){return t?`${e}${e.includes(`?`)?`&`:`?`}${me}=${t}`:e}async function Se(e,t,n={}){let{method:r=`GET`,body:i,signal:a,lang:o}=n,s=xe(t,o),c={method:r,credentials:`same-origin`,headers:i===void 0?void 0:{"Content-Type":`application/json`},body:i===void 0?void 0:JSON.stringify(i)};a&&(c.signal=a);let l=await e(s,c);if(!l.ok){let{detail:e,code:n}=await be(l);throw M(l.status,t,e,n)}if(l.status===204)return;let u=await l.text();return u?JSON.parse(u):void 0}function Ce(){return{search:window.location.search,pathname:window.location.pathname,hash:window.location.hash,replaceUrl:e=>window.history.replaceState(null,``,e)}}function we(e){let t=new URLSearchParams(e.search);t.delete(de);let n=t.toString();return`${e.pathname}${n?`?${n}`:``}${e.hash}`}async function Te(e,t){let n=new URLSearchParams(t.search).get(`token`)??void 0;try{let r=await e.config(n);return n&&t.replaceUrl(we(t)),{ok:!0,config:r}}catch(e){return e instanceof j?{ok:!1,unauthorized:!0}:{ok:!1,unauthorized:!1,message:e instanceof Error?e.message:String(e)}}}var Ee=`/api`;function N(e){return encodeURIComponent(e)}function De(e,t){let n=(e={})=>{let n=t?.();return n?{...e,lang:n}:e},r=t=>Se(e,`${Ee}${t}`,n()),i=(t,r)=>Se(e,`${Ee}${t}`,n({method:`POST`,body:r})),a=t=>Se(e,`${Ee}${t}`,n({method:`DELETE`})),o=(t,r)=>Se(e,`${Ee}${t}`,n({method:`PATCH`,body:r})),s=(t,r)=>Se(e,`${Ee}${t}`,n({method:`PUT`,body:r}));return{health:()=>r(`/health`),config:e=>r(e?`/config?token=${encodeURIComponent(e)}`:`/config`),listSessions:e=>{let t=e?.trim();return r(t?`/sessions?q=${encodeURIComponent(t)}`:`/sessions`)},getSession:e=>r(`/sessions/${N(e)}`),createSession:e=>{let t={...e?.workspace===void 0?{}:{workspace:e.workspace},...e?.create?{create:!0}:{},...e?.role===void 0?{}:{role:e.role},...e?.deferWorkspace?{deferWorkspace:!0}:{}};return i(`/sessions`,Object.keys(t).length===0?void 0:t)},deleteSession:e=>a(`/sessions/${N(e)}`),renameSession:(e,t)=>o(`/sessions/${N(e)}`,{title:t}),sessionWorkspace:e=>r(`/sessions/${N(e)}/workspace`),bindWorkspace:(e,t)=>i(`/sessions/${N(e)}/workspace`,t===null?{none:!0}:{root:t}),createWorkspaceDir:(e,t)=>i(`/workspaces`,{parent:e,name:t}),workspaceDirs:(e={})=>{let t=new URLSearchParams;e.path===void 0?e.at!==void 0&&t.set(`at`,e.at):t.set(`path`,e.path),e.hidden&&t.set(`hidden`,`1`);let n=t.size>0?`?${t.toString()}`:``;return r(`/workspaces/dirs${n}`)},pickDirectory:t=>Se(e,`${Ee}/workspaces/pick`,n({method:`POST`,body:{},...t?{signal:t}:{}})),sessionDiff:e=>r(`/sessions/${N(e)}/diff`),messages:e=>r(`/sessions/${N(e)}/messages`),send:(e,t,n)=>i(`/sessions/${N(e)}/messages`,{message:t,...n?{role:n}:{}}),abort:e=>i(`/sessions/${N(e)}/abort`),approvals:e=>r(`/sessions/${N(e)}/approvals`),respond:(e,t,n)=>i(`/approvals/${N(e)}`,{outcome:t,...n?{note:n}:{}}),questions:e=>r(`/sessions/${N(e)}/questions`),respondQuestion:(e,t)=>i(`/questions/${N(e)}`,{answers:t.answers,...t.skipped?{skipped:!0}:{}}),capabilities:e=>r(`/sessions/${N(e)}/capabilities`),skillBody:(e,t)=>r(`/sessions/${N(e)}/skills/${N(t)}`),reconnectMcp:e=>i(`/mcp/${N(e)}/reconnect`),previewSkillImport:e=>i(`/skills/import/preview`,{path:e}),importSkills:(e,t)=>i(`/skills/import`,{path:e,token:t}),removeSkill:e=>i(`/skills/remove`,{name:e}),addMcp:e=>i(`/mcp`,e),mcpConfig:()=>r(`/mcp/config`),saveMcpConfig:(e,t)=>s(`/mcp/config`,{text:e,revision:t}),applyMcpConfig:e=>i(`/mcp/config/apply`,{revision:e}),addRole:e=>i(`/roles`,e),plugins:()=>r(`/plugins`),previewPluginInstall:e=>i(`/plugins/install/preview`,{ref:e}),installPlugin:(e,t)=>i(`/plugins/install`,{ref:e,token:t}),previewLocalPluginInstall:e=>i(`/plugins/install/local/preview`,{path:e}),installLocalPlugin:(e,t)=>i(`/plugins/install/local`,{path:e,token:t}),addPluginMarketplace:e=>i(`/plugins/marketplaces`,{source:e}),removePluginMarketplace:e=>i(`/plugins/marketplaces/remove`,{name:e}),previewPluginUpdate:e=>i(`/plugins/update/preview`,{name:e}),updatePlugin:(e,t)=>i(`/plugins/update`,{name:e,token:t}),uninstallPlugin:e=>i(`/plugins/uninstall`,{name:e}),security:e=>r(`/sessions/${N(e)}/security`),tools:e=>r(`/sessions/${N(e)}/tools`),permission:e=>r(`/sessions/${N(e)}/permission`),setPermission:(e,t)=>i(`/sessions/${N(e)}/permission`,{level:t}),revokeApproval:(e,t)=>i(`/sessions/${N(e)}/approval-cache`,{id:t}),settings:e=>r(`/sessions/${N(e)}/settings`),writeSetting:(e,t)=>i(`/sessions/${N(e)}/settings`,t),model:e=>r(`/sessions/${N(e)}/model`),setModel:(e,t,n)=>i(`/sessions/${N(e)}/model`,{model:t,...n?.usedTokens===void 0?{}:{usedTokens:n.usedTokens}}),providers:()=>r(`/providers`),discoverModels:(e,t)=>i(`/providers/${N(e)}/models`,t?.refresh?{refresh:!0}:{}),setProviderKey:(e,t)=>i(`/providers/${N(e)}/key`,{apiKey:t}),commands:e=>r(`/sessions/${N(e)}/commands`),referenceCandidates:(e,t)=>r(t?`/sessions/${N(e)}/reference-candidates?q=${encodeURIComponent(t)}`:`/sessions/${N(e)}/reference-candidates`),fileCandidates:(e,t)=>r(t?`/sessions/${N(e)}/file-candidates?q=${encodeURIComponent(t)}`:`/sessions/${N(e)}/file-candidates`),fileStat:(e,t)=>{let n=t.map(e=>`path=${encodeURIComponent(e)}`).join(`&`);return r(`/sessions/${N(e)}/file-stat?${n}`)},fileText:(e,t)=>r(`/sessions/${N(e)}/file?path=${encodeURIComponent(t)}`),fileBytesUrl:(e,t)=>`${Ee}/sessions/${N(e)}/file-bytes?path=${encodeURIComponent(t)}`,openFile:(e,t)=>i(`/sessions/${N(e)}/file-open`,{path:t}),fileChanges:e=>r(`/sessions/${N(e)}/artifacts`),plan:e=>r(`/sessions/${N(e)}/plan`),planMode:(e,t)=>i(`/sessions/${N(e)}/plan`,{action:t}),goal:e=>r(`/sessions/${N(e)}/goal`),createGoal:(e,t)=>i(`/sessions/${N(e)}/goal`,t),updateGoal:(e,t)=>o(`/sessions/${N(e)}/goal`,t),clearGoal:e=>a(`/sessions/${N(e)}/goal`),blockedGoals:()=>r(`/goals/blocked`),tasks:e=>r(`/sessions/${N(e)}/tasks`),context:e=>r(`/sessions/${N(e)}/context`),compact:(e,t)=>i(`/sessions/${N(e)}/compact`,t===void 0?{}:{instruction:t}),checkpoints:e=>r(`/sessions/${N(e)}/checkpoints`),rewindPreview:(e,t)=>r(`/sessions/${N(e)}/checkpoints/${N(String(t))}`),rewind:(e,t,n)=>i(`/sessions/${N(e)}/rewind`,{turnIndex:t,scope:n.scope,...n.overwrite&&n.overwrite.length>0?{overwrite:n.overwrite}:{}}),artifactUrl:(e,t)=>`${Ee}/artifacts/${N(e)}/${N(t)}`,schedules:()=>r(`/schedules`),schedulePending:()=>r(`/schedules/pending`),schedule:e=>r(`/schedules/${N(e)}`),createSchedule:e=>i(`/schedules`,e),updateSchedule:(e,t)=>o(`/schedules/${N(e)}`,t),deleteSchedule:e=>a(`/schedules/${N(e)}`),scheduleRuns:e=>r(`/schedules/${N(e)}/runs`),runSchedule:e=>i(`/schedules/${N(e)}/run`),fixSchedule:(e,t)=>i(`/schedules/${N(e)}/fix`,{runId:t}),scheduleRecording:(e,t)=>r(`/schedules/${N(e)}/runs/${N(t)}/recording`)}}function Oe(e){let t=e.split(/[\\/]/);return t[t.length-1]??e}function ke(e){return e.startsWith(`/api/`)||e.startsWith(`http://`)||e.startsWith(`https://`)}function Ae(e,t,n){if(e)return e.startsWith(`data:`)||ke(e)?e:n(t,Oe(e))}function je(e,t,n){if(e.data)return`data:${e.mediaType};base64,${e.data}`;if(e.path)return ke(e.path)?e.path:n(t,Oe(e.path))}var Me={zh:{"web.session_store_unavailable":`会话持久化不可用(SQLite 没起来),这个操作做不了`,"web.title_required":`title 必须是非空字符串`,"web.session_cooled":`这个会话已被冷却(同时活跃的会话超出上限),重新打开它再发`,"web.session_unavailable":`建不出新会话:这个进程没有可用的模型 provider(配一把 API key 再试,或跑 epoch model)`,"web.session_unknown_role":`没有名为「{role}」的身份 —— 能力页那份列表可能已经旧了,刷新一下再选`,"web.workspace_must_be_string":`workspace 必须是非空字符串(服务端的绝对路径);不想绑工作区就整个别给这个字段`,"web.workspace_locked":`这个会话已经绑定了工作区,不能改({detail})。要换目录请新建一个会话 —— 中途换地盘会让前面那些工具调用里的相对路径指向另一个目录,而记录里没有任何地方写着从哪条开始换的`,"web.workspace_not_live":`这个进程手里没有这段会话,说不出它绑在哪儿 —— 工作区绑定活在进程内存里、不落盘(把这段会话接回这个进程才答得上来)`,"web.workspace_bind_both":`root 和 none 只能给一个:前者是「绑到这个目录」,后者是「明确不使用工作区」,两件事互斥`,"web.workspace_bind_neither":`要么给 root(服务端的绝对路径),要么给 none: true(明确不使用工作区)`,"web.workspace_already_decided":`这个会话的工作区已经定下来了(绑了目录,或者明确选过不使用),不能再改 —— 要换目录请新建一个会话`,"web.workspace_turn_running":`这一轮还在跑,先别换工作区 —— 等它跑完再挑一次(半路换根会让同一轮里的相对路径按两个目录解析)`,"web.workspace_defer_with_root":`workspace 和 deferWorkspace 只能给一个:前者是「建的时候就绑在这儿」,后者是「先建出来,地盘等会儿再选」`,"web.workspace_defer_needs_create":`deferWorkspace 要配 create: true —— 不带 create 的那一发是「给我现有的那个会话」,而它的工作区在装配时就定下来了`,"web.dirs_denied":`没权限列这个目录:{path}(它在那儿,但这个服务进程读不了它)`,"web.dirs_missing":`这条路径不存在:{path}`,"web.dirs_not_absolute":`要列的目录必须是绝对路径:{path} —— 这条路上没有「当前目录」这个概念`,"web.dirs_not_a_directory":`这是一个文件,不是目录:{path}(挑它所在的那个目录)`,"web.mkdir_exists":`这个目录已经有了:{path} —— 换个名字,或者回到列表里直接挑它(「新建」不会复用一个已经存在的目录)`,"web.mkdir_denied":`没权限在这儿建目录:{path}`,"web.mkdir_parent_missing":`上一层目录不存在,所以建不了 {path} —— 先把它建出来(这条路不会替你补建父目录)`,"web.mkdir_parent_not_absolute":`要在哪儿建必须给一条绝对路径:{parent}`,"web.mkdir_bad_name":`目录名只能是一段名字,不能带路径分隔符,也不能是 . 或 ..:{name}`,"web.mkdir_failed":`建不出这个目录:{path}`,"web.pick_prompt":`选一个工作区目录`,"web.pick_unavailable":`这台机器上弹不出系统目录框:它只在服务端和浏览器同机时才开(回环绑定、不是 ssh 起的、平台是 macOS 或 Windows)—— 用逐层浏览那一屏挑`,"web.pick_busy":`已经有一个目录选择框开着了 —— 去把它答掉(它可能被这扇窗口盖住了)`,"web.pick_failed":`系统目录框弹不出来:{detail}`,"web.plan_mode_unavailable":`这个进程没有 plan 模式(权限层没起来)`,"web.plan_mode_bad_action":`action 必须是 {actions} 之一`,"web.permission_unavailable":`这个进程没有权限层,档位改不了(它此刻显示的是配置里那一档)`,"web.permission_bad_level":`level 必须是 {levels} 之一`,"web.approval_cache_bad_id":`id 必须是一个非空字符串(取列表里那一条自己带的 id)`,"web.rewind_not_live":`这个进程手里没有这段会话,退不了 —— 检查点要由跑着它的那个进程来退(先把这段会话接回来再试)`,"web.rewind_bad_turn":`turnIndex 必须是非负整数(取检查点列表里的那个序号)`,"web.rewind_bad_scope":`scope 必须是 {scopes} 之一`,"web.rewind_bad_overwrite":`overwrite 必须是一组文件路径(用户逐个确认过的那几个);没有要覆盖的就整个别给这个字段`,"web.rewind_no_checkpoint":`没有第 {turn} 轮的检查点`,"web.settings_write_bad_request":`请求体要有 key(设置项的点分路径)、layer({layers} 之一)和 value(字符串 / 数字 / 布尔)`,"web.settings_write_unknown_key":`这个键这样改不了:要么它压根不在可写名单里(比如降级链 —— 它是一条有序的链,不是一个标量),要么这个键只写得进用户级、而请求写的是项目本地。项目级那两层只认 permissions / model / maxTurns,别的键写进去会被启动诊断报成「未知配置项」`,"web.settings_write_bad_value":`这个值不合这一项的值域(比如 maxTurns 要正整数),没有写进去`,"web.settings_write_unwritable":`{path} 这份文件这一层认不出它的写法(或者它已经坏了),没有覆盖它 —— 请自己编辑那个文件`,"web.settings_write_io":`写 {path} 失败:可能是没有写权限,或者那个目录建不出来`,"web.model_bad_request":`model 必须是非空字符串(模型名,或 provider/模型名);要回到配置里那个就给 null`,"web.mcp_unknown_server":`这个进程里没有名为「{name}」的 MCP server —— 连接是启动时按 mcp.json 建的,你手上这份清单可能已经旧了,刷新一下再看`,"web.skill_unknown":`没有名为「{name}」的技能 —— 能力页那份列表可能已经旧了,刷新一下再看`,"web.provider_unknown":`不支持名为「{name}」的 provider —— 可选的那几家是一份固定清单,你手上这份可能已经旧了,刷新一下再看`,"web.provider_key_not_applicable":`{name} 不用 API key —— 配一把进去也不会有人读它,这家现在就是通的`,"web.provider_key_empty":`没收到 key —— 把它粘进那个框再保存。(想撤掉已经配好的那把,这一版还没有入口,去 ~/.epoch 或者钥匙串里删)`,"web.mcp_add_lan_exposed":`这一档下加不了 MCP server —— 服务是用 --host 绑到回环之外的,而我们没法确认发出这一下的浏览器就在这台机器上。加一台等于往 mcp.json 里写一条「启动哪个可执行文件」,而那台当场就会被起起来,往后这台机器上每一次跑 epoch(含 CLI 和 TUI)也都会照着它起。出路两条:到跑着服务的那台机器上直接改那个文件;或者去掉 --host 重启一次。`,"web.mcp_add_bad_transport":`传输类型只能是 stdio / sse / http`,"web.mcp_add_bad_name":`server 名「{name}」不能用 —— 它会原样变成工具名的一部分,所以只收字母数字开头、由字母数字和 _ - 组成的名字(最长 48)。手写 mcp.json 不受这条管,这条只管从界面加的`,"web.mcp_add_taken":`已经有一台叫「{name}」的 MCP server 了(可能在你的 mcp.json 里,也可能是宿主或某个插件带来的)—— 换个名字。这里不覆盖也不自动改名:覆盖要删掉你手写的那一段,改名会让工具名和你敲进去的对不上`,"web.mcp_add_unwritable":`没往 mcp.json 里写任何东西 —— {detail}。先去那个文件那儿看一眼`,"web.mcp_config_lan_exposed":`这一档下 mcp.json 看不了也改不了 —— 服务是用 --host 绑到回环之外的,而我们没法确认发出这一下的浏览器就在这台机器上。那份文件里的环境变量是明文存的(可能有密钥),而它同时写得下「启动哪个可执行文件」。出路两条:到跑着服务的那台机器上直接改那个文件;或者去掉 --host 重启一次。`,"web.mcp_config_unreadable":`读不了 mcp.json —— {detail}。先去那个文件那儿看一眼`,"web.mcp_config_bad_body":`这一发的请求体不对:text 和 revision 两格都得是字符串,而 revision 要用上一次读到的那个`,"web.mcp_config_stale":`一个字节都没写 —— 盘上那份 mcp.json 已经不是你读到的那一份了(可能是你自己的编辑器刚存过,也可能是「添加 server」那张表单刚插了一台)。照着写下去会把那一笔盖掉,所以这里停住了:先重新读一遍,看清现在盘上是什么`,"web.mcp_config_unwritable":`没往 mcp.json 里写任何东西 —— {detail}。先去那个文件那儿看一眼`,"web.mcp_config_no_servers":`一台都没动 —— 盘上那份 mcp.json 读出来一台 server 都没有,而且它带着诊断:{detail}。照着应用会把你现在所有的 MCP 全部断开,所以这里停住了。最常见的原因是把 servers 这个键写成了 mcpServers。真要清空的话,写成 "servers": {} 再按一次`,"web.role_add_lan_exposed":`这一档下建不了身份 —— 服务是用 --host 绑到回环之外的,而我们没法确认发出这一下的浏览器就在这台机器上。身份的正文会进往后每一轮的上下文(描述那一格还会进每一次派活的工具描述),所以这条路只在默认的回环绑定下开。出路两条:到跑着服务的那台机器上,往 ~/.epoch/agents/ 里放一个 .md;或者去掉 --host 重启一次。`,"web.role_add_bad_field":`这一格填不下去:{detail}`,"web.plugin_write_lan_exposed":`这一档下装不了插件 —— 服务是用 --host 绑到回环之外的,而我们没法确认发出这一下的浏览器就在这台机器上。一包插件里可以带 hooks.json 和 mcp.json,那两样会在这台机器上「起子进程」(下一次启动就照着跑),所以这条路只在默认的回环绑定下开。出路两条:到跑着服务的那台机器上跑 epoch plugin install;或者去掉 --host 重启一次。`,"web.plugin_not_available":`这个界面上没有插件这条路 —— 装着这个引擎的程序没有预置任何插件市场,所以我们没有一张「能装什么」的单子可以给你挑。插件本身照旧装得上,只是在命令行上:epoch plugin marketplace add 加一个市场,然后 epoch plugin install。`,"web.schedule_store_unavailable":`定时任务读不出来 —— 存它们的数据库文件(家目录下的 sessions.db)这一次没能打开,所以这一片什么都做不了。任务本身没有丢,还在那个文件里。常见的原因是磁盘满了、那个文件的权限不对,或者那个路径上被放了一个同名的目录;启动时的诊断里那行 Schedules 会写出具体是哪一条。`,"web.schedule_unknown":`没有 id 为 {id} 的定时任务 —— 你手上这份列表可能已经旧了(另一个标签页或者命令行删过它),刷新一下再看`,"web.schedule_run_unknown":`这条任务的运行记录里没有 {runId} —— 运行记录有留存上限(每条任务最近 20 次),旧的那几次会被清掉`,"web.schedule_bad_field":`{field} 这一格的类型不对(是这个 JSON 读不懂,不是这个值不合理)`,"web.schedule_bad_permission":`权限档不认识 —— 这条路只收权限那枚胶囊上的那几档`,"web.schedule_bad_trigger":`读不懂这个触发器:kind 要是 cron / interval / once,而且每一档得带上自己那几个字段`,"web.schedule_bad_operation":`allowOperations 里有认不出来的操作类别,只收这几个:{types}`,"web.schedule_create_incomplete":`建一条定时任务至少要给 name / prompt / permission / trigger / maxBudgetUsd 五样`,"web.schedule_budget_required":`maxBudgetUsd 必填,而且没有默认值 —— 一个假默认会让「一觉醒来 40 美元」变成我们的错`,"web.schedule_fix_needs_run":`要给 runId:欠条挂在某一次运行上,而规则从库里那一条取(不收请求体里回传的规则)`,"web.goal_store_unavailable":`这台机器上没有目标存储(会话库没起来)—— 目标是落盘的状态,建了就没等于没有,所以这一格整个不给。看一眼诊断里会话库那一行`,"web.goal_bad_objective":`objective 得是一个字符串(是这个 JSON 读不懂,不是这句话不合理)—— 空字符串照收,那一档由引擎回 empty-objective`,"web.goal_bad_rounds":`maxRounds 得是一个整数(半轮不存在)。范围不在这儿判 —— 超出 1..999 由引擎回 bad-budget`,"web.goal_bad_action":`认不出动作「{action}」。这条路只收这几个:{known} —— 清掉目标走 DELETE,而报「卡住了」不在这条路上(那是模型和策略层的事)`,"web.goal_bad_evidence":`evidence 得是一个字符串 —— 空字符串照收,「说不出依据就说明还没完成」那句判断由引擎回 empty-evidence`,"web.reference_store_unavailable":`这台机器上没有会话库(SQLite 没起来),引用不了历史会话`,"web.file_candidates_no_workspace":`这个会话还没有绑工作区,列不了文件 —— 先在输入框底栏挑一个目录`,"web.file_list_unavailable":`工作区文件清单列不出来(没有 .git 也不是可读目录),补全用不了 —— 路径手打照样能附上`,"web.file_view_no_workspace":`这个会话还没有绑工作区,看不了文件 —— 先在输入框底栏挑一个目录`,"web.file_view_missing_path":`没说要看哪个文件(缺 path)`,"web.file_view_denied":`这个文件不在工作区里,或者被权限规则拦住了 —— 模型读不到的文件,这儿也看不到`,"web.file_view_missing":`这个文件现在不在那儿了`,"web.file_view_not_a_file":`这是一个目录,不是文件`,"web.file_view_unreadable":`这个文件读不出来(权限位、正在被写、或者盘出了问题)`,"web.file_view_too_large":`这个文件太大,站内看不了(上限 {max} 字节)—— 用默认应用打开,或者下载下来看`,"web.file_view_not_text":`这不是文本文件,取不到正文 —— 图片 / PDF / 媒体走字节那条路`,"web.file_open_extension_not_allowed":`这种文件不交给系统应用打开 —— 代码和文本站内就能看,而压缩包「打开」等于解压`,"web.file_open_not_same_machine":`这个浏览器不在服务那台机器上,打开了窗口也弹在别人屏幕上`,"web.file_open_launch_failed":`系统应用没起来`,"web.ui.conn.connecting":`连接中`,"web.ui.conn.open":`已连接`,"web.ui.conn.reconnecting":`重连中`,"web.ui.conn.closed":`已断开`,"web.ui.topbar.untitled":`未命名会话`,"web.ui.topbar.resyncing":`同步中`,"web.ui.topbar.inspector":`检视面板`,"web.ui.topbar.sidebar":`会话侧栏`,"web.ui.topbar.model_not_live":`这段会话不在这个进程里跑,这里写的是这次启动的默认模型 —— 它当时用的可能不是这一个。`,"web.ui.model.label":`这个会话此刻用的模型`,"web.ui.model.trigger":`{model} —— 点开换模型`,"web.ui.model.current":`{provider} · 正在用`,"web.ui.model.reset":`回到配置里那个`,"web.ui.model.placeholder":`敲一个模型名,回车`,"web.ui.model.rej_no_credential":`{provider} 没有可用凭据,切不过去。设一个 {env},或者跑 epoch model 配置`,"web.ui.model.rej_no_credential_bare":`{provider} 没有可用凭据,切不过去。跑 epoch model 配置`,"web.ui.model.rej_images":`{model} 不认图片,而这个会话里已经有图片了。换模型不清空上下文,切过去下一轮必然被 provider 拒`,"web.ui.model.rej_context":`上下文已用 {used},超过 {model} 的窗口({window})。先开一段新会话,或者换个窗口更大的模型`,"web.ui.model.cav_context_tight":`换过去了,但上下文已用 {used},接近 {model} 的窗口({window}),可能撑不过几轮`,"web.ui.model.cav_no_tools":`换过去了,但 {model} 不支持工具调用 —— 它只能聊天,读不了也写不了文件`,"web.ui.model.pick_provider":`提供商`,"web.ui.model.pick_provider_none":`挑一家…`,"web.ui.model.pick_model":`模型名称`,"web.ui.model.suggest_open":`看看探到了哪些模型`,"web.ui.model.provider_no_key":`{label}(没配 key)`,"web.ui.model.probe_probing":`正在问 {provider} 有哪些模型…不用等,上面直接敲一个也行`,"web.ui.model.probe_no_key":`{provider} 还没配 key,问不了它的模型清单。设一个 {env},或者跑 epoch model 配一把`,"web.ui.model.probe_no_key_bare":`{provider} 还没配 key,问不了它的模型清单。跑 epoch model 配一把`,"web.ui.model.probe_no_key_here":`{provider} 还没配 key,问不了它的模型清单 —— 上面那个 API Key 框填一把就行`,"web.ui.model.key_goto":`去设置页配`,"web.ui.model.probe_failed_cache":`没问通 {provider}(网络 / key 不对 / 那个地址没有 /models)。下面是上次探到的那一份,可能已经过期 —— 也可以直接敲`,"web.ui.model.probe_failed_static":`没问通 {provider}(网络 / key 不对 / 那个地址没有 /models)。下面是内置的那一份,可能已经过期 —— 也可以直接敲`,"web.ui.model.probe_empty":`{provider} 一个模型名都没给出来,内置清单里也是空的 —— 直接敲一个吧`,"web.ui.model.probe_ok":`从 {provider} 问到 {count} 个`,"web.ui.model.suggest_note":`这些是探到的建议,不是全部 —— 新模型、自建的多半不在里面,照旧直接敲`,"web.ui.model.refresh":`重新探`,"web.ui.model.refresh_hint":`绕开缓存,重新问一次这家 provider`,"web.ui.model.key_label":`API Key`,"web.ui.model.key_placeholder":`粘一把 key 进来`,"web.ui.model.key_save":`保存 Key`,"web.ui.model.key_saving":`存 Key…`,"web.ui.model.key_show":`显示`,"web.ui.model.key_hide":`隐藏`,"web.ui.model.key_has":`已配置 {hint}({env})。存一把新的会盖掉它`,"web.ui.model.key_none":`这把 key 优先进系统钥匙串;拿不到钥匙串才落 ~/.epoch/.env(0600)。写进去的是 {env}`,"web.ui.model.key_saved_secure":`已存进 {backend}(加密)。模型清单已经用新 key 重新问过一遍了`,"web.ui.model.key_saved_plain":`⚠️ 系统钥匙串用不了,这把 key 以明文存在了 {path}(权限 0600)。同机器上能读到这个文件的人就能拿到它`,"web.ui.newsession.open":`新建会话`,"web.ui.dirpick.back":`返回`,"web.ui.dirpick.anchors":`常去的地方`,"web.ui.dirpick.anchors_detail":`主目录、服务进程的启动目录、以及来过的工作区`,"web.ui.dirpick.up":`往上一层`,"web.ui.dirpick.back_last":`回到刚才那一层`,"web.ui.dirpick.loading":`读取中…`,"web.ui.dirpick.empty":`这一层没有子目录 —— 可以直接挑它,或者在下面敲一条路径`,"web.ui.dirpick.omitted":`这一层还有 {count} 个没列出来(一层最多列 1000 个)—— 要那些的话在下面敲路径`,"web.ui.dirpick.show_hidden":`显示隐藏目录(. 开头的)`,"web.ui.dirpick.show_hidden_count":`显示隐藏目录(. 开头的,这一层有 {count} 个)`,"web.ui.dirpick.unreadable":`没权限进这个目录:{path}`,"web.ui.dirpick.into_of":`进入 {name}({path})`,"web.ui.dirpick.use":`就用 {name}`,"web.ui.dirpick.use_here":`就选这一层`,"web.ui.dirpick.use_here_of":`就选这一层:{path}`,"web.ui.dirpick.known":`来过`,"web.ui.dirpick.manual_label":`或者直接敲一条绝对路径`,"web.ui.dirpick.manual_hint":`例如 /Users/you/work/repo`,"web.ui.dirpick.manual_go":`就用这个`,"web.ui.dirpick.new_label":`在这一层里新建一个目录`,"web.ui.dirpick.new_hint":`例如 my-project`,"web.ui.dirpick.new_go":`新建`,"web.ui.dirpick.new_trust_note":`新建的目录和挑一个既有目录同档:都未信任 —— 它的 .epoch/settings.json 和 CLAUDE.md 不会生效。要授信跑 epoch trust add。`,"web.ui.blank.title":`今天想做点什么?`,"web.ui.blank.cards":`建议`,"web.ui.sidebar.search":`搜索会话`,"web.ui.sidebar.automation":`自动化`,"web.ui.sidebar.automation_pending":`有 {count} 条定时任务欠着授权,到点了会再卡一次`,"web.ui.sidebar.settings":`设置`,"web.ui.sidebar.host_menu":`宿主菜单`,"web.ui.sidebar.cost":`花费`,"web.ui.sidebar.cost_of":"约 ${spent} / ${limit}","web.ui.sidebar.cost_est":`估算`,"web.ui.sidebar.tasks":`后台任务`,"web.ui.sidebar.tasks_of":`{running} 在跑 / {total}`,"web.ui.sidebar.diagnostic":`{module}:{detail}`,"web.ui.slist.tasks":`任务`,"web.ui.slist.spaces":`空间`,"web.ui.slist.unknown":`早先的会话`,"web.ui.slist.unknown_hint":`这个进程说不出它们在哪儿干过活 —— 不是它们没有工作区`,"web.ui.slist.awaiting":`待裁决`,"web.ui.slist.running":`进行中`,"web.ui.slist.updated_at":`最近活动`,"web.ui.slist.count":`{count} 条会话`,"web.ui.slist.new_in_space":`在「{name}」里开一段新会话`,"web.ui.slist.empty":`还没有会话`,"web.ui.slist.no_match":`没有匹配的会话`,"web.ui.slist.acts":`会话「{title}」的操作`,"web.ui.slist.rename":`重命名`,"web.ui.slist.rename_label":`会话标题`,"web.ui.slist.rename_do":`保存标题`,"web.ui.slist.delete":`删除会话`,"web.ui.slist.delete_ask":`删掉《{title}》?`,"web.ui.slist.delete_what":`对话、检查点、它绑的工作区一起删掉,删完拿不回来 —— 它改过的文件还在盘上,但退不回去了。`,"web.ui.slist.delete_running":`它这一轮正在跑,删掉会中止它。`,"web.ui.slist.delete_awaiting":`还有 {count} 条在等你裁决,删掉是放弃它们,不是拒绝。`,"web.ui.slist.delete_do":`删除`,"web.ui.slist.cancel":`取消`,"web.ui.slist.err_gone":`这段会话已经不在了。`,"web.ui.slist.err_title":`标题不能为空。`,"web.ui.slist.err_no_store":`这台机器上的会话库没起来,改不了也删不掉。`,"web.ui.inspector.patch":`补丁`,"web.ui.inspector.output":`输出`,"web.ui.inspector.artifact":`产物`,"web.ui.inspector.plan":`计划`,"web.ui.inspector.goal":`目标`,"web.ui.inspector.no_patch":`这一轮还没改过文件`,"web.ui.inspector.locate":`定位`,"web.ui.inspector.locate_folded":`时间线上现在没有这一行 —— 多半是被折叠条收起来了。展开那一段之后这个按钮就能用。`,"web.ui.output.title":`后台任务`,"web.ui.output.loading":`正在取任务…`,"web.ui.output.empty":`这个会话现在没有后台任务`,"web.ui.output.st_running":`运行中`,"web.ui.output.st_exited":`已结束,退出码 {code}`,"web.ui.output.st_killed":`已停止`,"web.ui.output.st_failed":`启动失败`,"web.ui.output.st_closed":`已关闭`,"web.ui.output.st_reaped":`已被回收(空闲超时),里面的环境没了`,"web.ui.output.kind_shell":`持久会话`,"web.ui.output.kind_agent":`子 agent`,"web.ui.output.dur":`用时 {value}`,"web.ui.output.out_bytes":`{bytes} 输出`,"web.ui.output.no_output":`这个任务还没有输出`,"web.ui.output.omitted":`只显示了末尾这一段,前面还有 {bytes} 没给。`,"web.ui.output.truncated":`这个任务的输出超过了上限,开头那一段已经被丢掉 —— 它拿不回来了,不在这儿也不在别处。`,"web.ui.output.sampled":`还在跑的任务,这里是一次取样:回合状态变化时重取一次,中间新产出的输出要等下一次。`,"web.ui.art.files":`工作区改动`,"web.ui.art.files_note":`这个会话在工作区里新建或改过的文件。`,"web.ui.art.files_empty":`这个会话还没改过工作区里的文件`,"web.ui.art.no_space":`这个会话没有工作区,所以没有「工作区改动」这回事。上一个进程留下的会话也会落在这儿 —— 工作区绑定只活在进程内存里。`,"web.ui.art.loading":`正在取清单…`,"web.ui.art.thin":`刷新之后回放出来的那些行只剩路径和次数:文件内容不落盘,所以点不开。`,"web.ui.art.created":`新建`,"web.ui.art.changed":`改动`,"web.ui.art.lines":`{count} 行`,"web.ui.art.writes":`写过 {count} 次`,"web.ui.art.tools":`工具产物`,"web.ui.art.tools_note":`工具吐出来的二进制:截图、音频、下载。`,"web.ui.art.tools_empty":`这一轮没有。今天只有 MCP 工具会产出它(image / audio / resource.blob 三支)。`,"web.ui.art.tool_gate":`它要过四道闸门才进上下文:能力、尺寸、落盘、成本。不吃图的模型上降级是主路径 —— 这里照常列出文件,但进模型的只是一句说明。`,"web.ui.art.back":`返回列表`,"web.ui.art.readonly":`只读`,"web.ui.art.copy_path":`复制路径`,"web.ui.art.by_created":`由 {tool} 新建`,"web.ui.art.by_changed":`由 {tool} 改动`,"web.ui.art.kind_binary":`二进制`,"web.ui.art.kind_charset":`编码探不出来`,"web.ui.art.opaque_binary":`这看着是二进制:里面有 NUL 字节,或者不可打印字符占了很大一片。铺开来是一屏替换字符,所以这儿不展示内容。`,"web.ui.art.opaque_charset":`这份内容不是 UTF-8 —— 可能是 GBK、UTF-16 这类别的编码,也可能是二进制。原始字节没到浏览器这边(补丁帧里带的已经是解过一道的字符串),所以到底是哪一种,这儿探不出来。探不出来就不猜,也就不画。`,"web.ui.art.lossy":`有 {count} 处字节没解出来。这个文件多半不是 UTF-8,而那几处的原文已经拿不回来了。`,"web.ui.art.clip_lines":`只显示了前 {shown} 行,这个文件一共 {total} 行。`,"web.ui.art.clip_chars":`在第 {line} 行上截断了 —— 这一行太长。这个文件一共 {total} 行。`,"web.ui.art.binary_note":`这类文件这儿看不了,用系统自带的程序打开。`,"web.ui.file.loading":`正在打开…`,"web.ui.file.denied":`这个文件不在工作区里,或者被权限规则拦住了 —— 模型读不到的文件,这儿也看不到。`,"web.ui.file.missing":`这个文件现在不在那儿了。`,"web.ui.file.not_a_file":`这是一个目录,不是文件。`,"web.ui.file.too_large":`这个文件太大,站内看不了。`,"web.ui.file.unreadable":`这个文件读不出来。`,"web.ui.file.no_answer":`服务端没有回答这条路径。`,"web.ui.file.no_session":`还没有会话,看不了文件。`,"web.ui.file.opaque":`这种文件浏览器画不出来。用你机器上的默认应用打开,或者下载下来看。`,"web.ui.file.open_with_app":`用默认应用打开`,"web.ui.file.download":`下载`,"web.ui.plan.empty":`这个会话还没有被批准的计划`,"web.ui.plan.empty_hint":`模型交上来的计划要你在输入区那块板上批一次;批过的那一份才会留在这儿。`,"web.ui.plan.loading":`正在取计划…`,"web.ui.plan.note":`这是当前生效的那一份 —— 计划改过就整份换掉,这儿不留历史。要看它怎么演进,翻时间线上那几次 exit_plan_mode。`,"web.ui.goal.loading":`正在取目标…`,"web.ui.goal.empty":`这个会话还没有目标`,"web.ui.goal.empty_hint":`目标回答的是「这个任务什么算完成、最多花多少轮」。长任务、尤其是交代完就走开的任务用得上:跑到预算尽头会留下一条「卡在哪」的记录,而不是只剩「模型不说话了」。`,"web.ui.goal.phase_active":`在跑`,"web.ui.goal.phase_paused":`已按停 —— 轮次不推进,目标留着`,"web.ui.goal.phase_blocked":`卡住了`,"web.ui.goal.phase_complete":`已完成`,"web.ui.goal.rounds":`{used} / {max} 轮`,"web.ui.goal.rounds_hint":`一轮 = 一条被你发出、并且被接纳的消息。同一条消息底下模型可能请求二十次,那算一轮。`,"web.ui.goal.evidence":`完成依据`,"web.ui.goal.objective_label":`目标`,"web.ui.goal.objective_hint":`写一句「什么算做完」,比如:把检视面板接上后台任务的输出,且 pnpm check 全绿`,"web.ui.goal.budget_label":`预算`,"web.ui.goal.budget_hint":`不填就是 {n} 轮(上限 {max})`,"web.ui.goal.budget_warn":`调小到已用轮次之下会当场把它变成「卡住了」—— 那是刻意的:这条路也是「就到这儿吧」的说法。反过来,给一个「预算用完」的目标加预算会直接放它继续。`,"web.ui.goal.evidence_label":`完成依据`,"web.ui.goal.evidence_hint":`凭什么算完成?说不出来就说明还没完成。`,"web.ui.goal.act_edit":`改措辞`,"web.ui.goal.act_budget":`改预算`,"web.ui.goal.act_pause":`按停`,"web.ui.goal.act_resume":`放行`,"web.ui.goal.act_complete":`报完成`,"web.ui.goal.act_clear":`清掉`,"web.ui.goal.save_create":`定下这个目标`,"web.ui.goal.save_edit":`改好了`,"web.ui.goal.save_budget":`改成这个数`,"web.ui.goal.save_complete":`记为完成`,"web.ui.goal.cancel":`算了`,"web.ui.goal.refuse.busy":`已经有一个还没结束的目标了。一个会话同时只有一个目标 —— 要么改现在这个,要么先清掉再建。`,"web.ui.goal.refuse.no_goal":`这个会话现在没有目标 —— 先定一条。`,"web.ui.goal.refuse.empty_objective":`目标不能是空的。写一句「什么算做完」,一句话就够。`,"web.ui.goal.refuse.objective_too_long":`目标太长了(上限 {chars} 字)。它是**完成判据**不是计划正文 —— 步骤那一份归「计划」那一格。`,"web.ui.goal.refuse.bad_budget":`预算要是 1 到 {max} 之间的整数。`,"web.ui.goal.refuse.bad_block_code":`阻塞码得是 kebab-case(像 needs-approval 那样)—— 它是给程序路由用的键,不是一句话。`,"web.ui.goal.refuse.empty_block_message":`报「卡住了」必须同时说清是什么卡住了 —— 只有码的话人看不懂。`,"web.ui.goal.refuse.empty_evidence":`报完成必须给依据。说不出来就说明还没完成。`,"web.ui.goal.refuse.wrong_phase":`现在这个状态下做不了这件事。已完成的目标改不动了(清掉再建一个);「预算用完」那一档要先加预算才放得行。`,"web.ui.goal.refuse.unavailable":`没写进去 —— 目标存储不可用(会话库出了问题)。看一眼侧栏底下那几行诊断。`,"web.ui.banner.dismiss":`知道了`,"web.ui.banner.session_gone":`这段对话在服务端上已经没有了 —— 多半是服务端重启过,重启会换一个新会话。这一段回不来了,不过新的那个可以接着用。`,"web.ui.banner.session_gone_open":`去当前会话`,"web.ui.banner.session_gone_stuck":`这段对话在服务端上已经没有了。`,"web.ui.thread.thinking_label":`深度思考`,"web.ui.thread.head_estimate":`预计 {tokens} token`,"web.ui.thread.head_est_badge":`估算`,"web.ui.thread.live_thinking":`思考中`,"web.ui.thread.live_running":`生成回复中`,"web.ui.thread.live_tool":`运行工具中`,"web.ui.thread.live_waiting":`等待模型响应`,"web.ui.thread.live_approval":`等你裁决`,"web.ui.thread.live_question":`等你回答`,"web.ui.thread.live_aborting":`正在终止…`,"web.ui.thread.live_spent":`已消耗 {tokens} token`,"web.ui.thread.queued":`{count} 条排队`,"web.ui.thread.stop":`终止`,"web.ui.thread.fold_tools":`{count} 次调用`,"web.ui.thread.fold_files":`{count} 个文件`,"web.ui.thread.fold_thoughts":`思考 {count} 段`,"web.ui.thread.fold_show":`展开`,"web.ui.thread.fold_hide":`收起`,"web.ui.thread.gate":`{tool} 停在这里等你裁决。下面那条链要过了闸才继续。`,"web.ui.thread.tool_pending":`执行中`,"web.ui.thread.tool_done":`完成`,"web.ui.thread.tool_error":`失败`,"web.ui.thread.art_in":`已进模型上下文`,"web.ui.thread.art_out":`未进模型上下文`,"web.ui.thread.art_unknown":`进没进上下文,这条流上没说`,"web.ui.thread.art_tokens":`约 {count} token`,"web.ui.thread.art_out_note":`模型只收到下面这句话,产物本身它没拿到。`,"web.ui.thread.art_unknown_note":`闸门的结论没上这条流,这里不替它猜。`,"web.ui.thread.art_no_file":`没能落盘 —— 这个产物打不开。`,"web.ui.thread.art_download":`下载 {name}`,"web.ui.thread.art_download_any":`下载这个产物`,"web.ui.thread.user_image_alt":`这条消息附的图片({mediaType})`,"web.ui.thread.user_image_alt_any":`这条消息附的图片`,"web.ui.thread.expand":`展开剩余 {count} 行`,"web.ui.thread.collapse":`收起`,"web.ui.thread.todo_title":`交付清单`,"web.ui.thread.todo_count":`已完成 {done} / {total}`,"web.ui.thread.patch_of":`补丁 {path}`,"web.ui.thread.patch_too_big":`内容超过逐行比对上限,只报行数变化`,"web.ui.thread.patch_opaque_old":`改之前那一份画不出来,改完之后那一份是正常文本。`,"web.ui.thread.patch_opaque_new":`改完之后那一份画不出来。`,"web.ui.thread.patch_opaque_both":`这份改动的两侧都画不出来。`,"web.ui.thread.code":`代码`,"web.ui.thread.copy_code":`复制代码`,"web.ui.thread.copied":`已复制`,"web.ui.thread.note_error":`错误`,"web.ui.thread.note_model":`模型:{model}`,"web.ui.thread.note_compression":`上下文压缩完成({count} 条)`,"web.ui.thread.note_summary":`会话结束,耗时 {duration}`,"web.ui.thread.act_copy":`复制这一轮的回复`,"web.ui.thread.act_rerun":`重跑这一轮`,"web.ui.thread.act_quote":`引用这一轮到输入框`,"web.ui.thread.act_inspect":`在检视面板打开`,"web.ui.thread.facts_tokens":`共 {tokens} token`,"web.ui.thread.facts_token_label":`token`,"web.ui.thread.facts_unknown":`未上报`,"web.ui.thread.facts_failover":`故障转移`,"web.ui.thread.facts_tools":`{count} 次工具`,"web.ui.thread.facts_no_tools":`无工具`,"web.ui.thread.act_rewind":`回退到这一轮之前`,"web.ui.thread.rewound_to":`已回退到「{text}」那一轮之前`,"web.ui.thread.rewound_here":`已回退到这一节点之前`,"web.ui.thread.rewound_failed":`尝试回退到「{text}」那一轮之前 —— 没退成`,"web.ui.thread.rewound_failed_here":`尝试回退到这一节点之前 —— 没退成`,"web.ui.thread.todo_why":`取消理由`,"web.ui.thread.head_ctx_line":`到压缩线`,"web.ui.thread.head_ctx_off":`到压缩线 · 无自动压缩`,"web.ui.rewind.title":`回退到这一轮之前`,"web.ui.rewind.loading":`正在读这一轮的检查点…`,"web.ui.rewind.act_restore":`改回`,"web.ui.rewind.act_delete":`删掉`,"web.ui.rewind.act_recreate":`重建`,"web.ui.rewind.act_skip":`不动`,"web.ui.rewind.files_head":`会动这 {count} 个文件`,"web.ui.rewind.files_none":`文件没有需要改的(现状已经等于快照)`,"web.ui.rewind.conflicts_head":`{count} 个文件在 agent 改完之后又被动过 —— 默认一个都不覆盖`,"web.ui.rewind.conflict_hint":`勾上的会被盖掉 —— 那是你自己改的那一份,不是 agent 的`,"web.ui.rewind.drift_changed":`之后被动过`,"web.ui.rewind.drift_unknown":`旧检查点,不确定`,"web.ui.rewind.scope_legend":`退哪一半`,"web.ui.rewind.scope_files":`只回退文件(对话保持现状,让它重来一遍)`,"web.ui.rewind.scope_conversation":`只回退对话(文件保持现状)`,"web.ui.rewind.scope_both":`两个都回退`,"web.ui.rewind.scope_conversation_off":`这条检查点不支持`,"web.ui.rewind.terminal_note":`只覆盖文件工具做的改动;terminal 里跑的命令改的文件不在范围内`,"web.ui.rewind.incomplete":`这条检查点不完整(有文件没存进来),只能恢复一部分`,"web.ui.rewind.conversation_warn":`我知道:对话回退是真删那之后的消息,不可撤销(不是隐藏起来,是删掉)`,"web.ui.rewind.run":`回退`,"web.ui.rewind.running":`正在回退…`,"web.ui.rewind.cancel":`取消`,"web.ui.rewind.close":`知道了`,"web.ui.rewind.failed":`回退失败:{reason}`,"web.ui.rewind.failed_atomic":`工作区一个字节都没改 —— 回退是原子的,失败就是什么都没动。`,"web.ui.rewind.done_restored":`{count} 个文件改回`,"web.ui.rewind.done_deleted":`{count} 个文件删掉`,"web.ui.rewind.done_recreated":`{count} 个文件重建`,"web.ui.rewind.done_nothing":`文件没有需要改的(现状已经等于快照)`,"web.ui.rewind.done_skipped":`{count} 个你改过的没覆盖`,"web.ui.rewind.done_messages":`对话删掉 {count} 条消息(不可撤销)`,"web.ui.dock.title_permission":`需要确认`,"web.ui.dock.title_plan":`计划待批准`,"web.ui.dock.title_question":`需要你选一下`,"web.ui.dock.queue":`还有 {count} 个排在后面`,"web.ui.dock.queue_questions":`还有 {count} 组问题`,"web.ui.dock.act_file_read":`读文件`,"web.ui.dock.act_file_write":`写文件`,"web.ui.dock.act_command":`执行命令`,"web.ui.dock.act_network":`网络请求`,"web.ui.dock.act_code_exec":`在沙箱内执行代码`,"web.ui.dock.fact_action":`动作`,"web.ui.dock.fact_target":`目标`,"web.ui.dock.fact_detail":`详情`,"web.ui.dock.fact_reason":`原因`,"web.ui.dock.target_none":`(无)`,"web.ui.dock.more_lines":`↓ 还有 {count} 行没显示`,"web.ui.dock.allow_once":`允许一次`,"web.ui.dock.allow_session":`本会话内始终允许`,"web.ui.dock.allow_session_hint":`退出即失效`,"web.ui.dock.allow_always":`永久允许`,"web.ui.dock.allow_always_hint":`写入 approvals.json`,"web.ui.dock.plan_execute_hint":`权限回到 {level}`,"web.ui.dock.plan_readonly_hint":`我自己动手`,"web.ui.dock.plan_readonly_forced":`你要求了全程只读`,"web.ui.dock.note_label":`要改的话,说一句:`,"web.ui.dock.note_placeholder":`比如:先只动 core,别碰 tui`,"web.ui.dock.q_free":`都不对,我自己写:`,"web.ui.dock.q_free_placeholder":`(可选)填了就以这一句为答案`,"web.ui.dock.q_submit":`提交`,"web.ui.dock.q_submit_partial":`还有 {count} 个没答,会告诉它「跳过」`,"web.ui.dock.q_skip":`跳过`,"web.ui.dock.q_skip_hint":`模型会自己挑一个默认继续`,"web.ui.crossbar.approval_one":`《{title}》在等你答一个审批`,"web.ui.crossbar.approval_n":`《{title}》在等你答 {count} 个审批`,"web.ui.crossbar.question_one":`《{title}》在等你答一个提问`,"web.ui.crossbar.question_n":`《{title}》在等你答 {count} 个提问`,"web.ui.crossbar.cold":`已冷却`,"web.ui.crossbar.cold_hint":`服务端此刻不持有它,点过去是从历史回放`,"web.ui.crossbar.more":`还有 {count} 个`,"web.ui.crossbar.go":`去处理`,"web.ui.crossbar.waited":`已等`,"web.ui.autobar.pending":`「{name}」上次到点没跑成:差 {count} 条授权,不补上下次还会卡`,"web.ui.autobar.more":`还有 {count} 条任务也在等`,"web.ui.autobar.fix":`加进授权清单`,"web.ui.autobar.fixing":`正在加…`,"web.ui.autobar.open":`去看看`,"web.ui.autobar.goal_blocked":`「{title}」的目标卡住了,那段会话不补上就不会往下走`,"web.ui.autobar.goal_open":`去那段会话`,"web.ui.toast.done":`《{title}》跑完了`,"web.ui.toast.max_turns":`《{title}》轮次用尽,没跑完`,"web.ui.toast.stalled":`《{title}》原地打转,已经停下`,"web.ui.toast.aborted":`《{title}》被中止了`,"web.ui.toast.filtered":`《{title}》被模型拒答了`,"web.ui.toast.compliance":`《{title}》触了内容合规限制`,"web.ui.toast.budget":`《{title}》触了预算上限,提前收工`,"web.ui.toast.failed":`《{title}》出错了`,"web.ui.toast.go":`查看`,"web.ui.cmd.context_desc":`看这段对话的上下文都花在哪儿了`,"web.ui.cmd.compact_desc":`压缩上下文,给接下来的对话腾出窗口`,"web.ui.cmd.compact_running":`正在压缩这段对话的上下文…`,"web.ui.cmd.compact_done":`已压缩:{before} → {after} 条。这段对话的记录一行都没少,变的是下一轮送进模型的那一份。`,"web.ui.cmd.compact_no_change":`没压动,还是 {n} 条 —— 这次的摘要没能让它变短。请求已经发出去了,那笔钱花掉了。`,"web.ui.cmd.compact_not_run":`这次没有压缩。`,"web.ui.cmd.compact_failed":`压缩没能完成,这段对话的上下文和刚才一模一样。`,"web.ui.composer.label":`消息`,"web.ui.composer.placeholder_idle":`说点什么…(回车发送,Shift+回车换行)`,"web.ui.composer.placeholder_running":`这一轮还在跑,发出去的会排在它后面`,"web.ui.composer.placeholder_offline":`和服务端断开了,正在重连…`,"web.ui.composer.placeholder_approval":`等你确认上面那个操作`,"web.ui.composer.placeholder_question":`等你回答上面那个问题`,"web.ui.composer.placeholder_no_session":`还没有会话`,"web.ui.composer.placeholder_no_provider":`这台机器还没有可用的模型 provider —— 换个会话也一样,去配一把 API key(或跑 epoch model)`,"web.ui.composer.placeholder_history":`这段对话说不出它当初在哪儿干活,接不回来了 —— 只能看,或者开一段新的`,"web.ui.composer.placeholder_gone":`这段对话在服务端上已经没有了,发不出去`,"web.ui.composer.hint_queue":`排队发送`,"web.ui.composer.send":`发送`,"web.ui.composer.usage_session":`本会话`,"web.ui.composer.usage_run":`最近一轮`,"web.ui.composer.usage_detail":`{scope}用量:{up}↑ {down}↓`,"web.ui.composer.commands_label":`斜杠命令`,"web.ui.composer.command_warnings":`/{name} 展开时有几处要说明:`,"web.ui.composer.builtin_notice":`/{name}`,"web.ui.composer.attach":`添加图片`,"web.ui.composer.remove_attach":`去掉 {name}`,"web.ui.composer.drop_hint":`松手,把图片加进这条消息`,"web.ui.composer.reading":`读取中…`,"web.ui.composer.reject_dismiss":`收起这几条`,"web.ui.composer.no_workspace":`不使用工作区`,"web.ui.composer.workspace_unknown":`工作区未知`,"web.ui.composer.workspace_unknown_hint":`这段会话是上一个进程留下的,这个进程还没把它接回来 —— 所以说不出它此刻绑在哪儿`,"web.ui.composer.workspace_diff_hint":`点开看这个目录现在有哪些改动`,"web.ui.composer.workspace_pick":`选择工作区`,"web.ui.composer.workspace_pick_label":`这段会话在哪个工作区里干活`,"web.ui.composer.workspace_here_current":`{name}(当前)`,"web.ui.composer.workspace_none_detail":`跑在服务进程启动的那个目录上 —— 不是一个碰不到文件的沙盒。按下去就定了,之后改不了`,"web.ui.composer.workspace_pick_note":`清单是本机最近用过的那几个目录。要在一个没来过的目录里开会话,先在那儿跑一次 epoch。`,"web.ui.composer.workspace_browse":`打开本地文件夹…`,"web.ui.composer.workspace_browse_detail":`逐层挑一个目录,或者直接敲一条绝对路径(列的是跑 epoch 那台机器上的目录)`,"web.ui.composer.workspace_browse_native":`弹一个系统对话框来挑(跑 epoch 那台机器上的)`,"web.ui.composer.permission":`权限:{level}`,"web.ui.composer.plan_mode":`计划模式`,"web.ui.composer.plan_on_hint":`进计划模式:模型先只读地调研、交一份计划给你批,期间不动文件`,"web.ui.composer.plan_off_hint":`退出计划模式,回到进入前那一档权限`,"web.ui.composer.plan_mode_why":`只读:模型能看能查,改不了文件;它交计划时你会收到一次审批`,"web.ui.composer.reject_not_image":`{name} 不是图片,这一轮只收图片`,"web.ui.composer.reject_too_big":`{name} 有 {size} MB,超过 {max} MB 的上限`,"web.ui.composer.reject_unreadable":`{name} 读不出来`,"web.ui.composer.reject_directory":`{name} 是个文件夹 —— 打开它,把里面的图拖进来`,"web.ui.composer.too_big":`这条消息 {size},一次最多发 {max}。去掉一张图,或者把粘进来的那段文字截短`,"web.ui.composer.expert_chip_title":`接下来每条消息都由「{role}」来答,点左边的 × 取消`,"web.ui.composer.identity_title":`这段会话以「{role}」的身份跑。它是建会话时定的,中途换不了。`,"web.ui.composer.expert_remove":`不再让「{role}」接手`,"web.ui.mention.palette_label":`可引用的会话`,"web.ui.mention.group_sessions":`会话`,"web.ui.mention.candidate_here":`{when} · {count} 条 · 本工作区`,"web.ui.mention.candidate_elsewhere":`{when} · {count} 条 · {where}`,"web.ui.mention.card_label":`引用`,"web.ui.mention.card_count":`附了 {kept} / {total} 条`,"web.ui.mention.card_truncated":`超了上限,只附了前 {kb}KB`,"web.ui.mention.omit_invalid_reference":`没找到唯一匹配的会话,没附上 —— 打 @: 在面板里挑一个,或把标题打得更全`,"web.ui.mention.omit_self_reference":`就是当前这段会话,没附上 —— 要接着聊本来就不用引用`,"web.ui.mention.omit_too_many":`超了一条消息最多 2 段的限制,没附上 —— 要更多历史用 session_search`,"web.ui.mention.omit_not_authorized":`这段会话不在可读范围里,没附上(默认只有当前工作区加本会话的血缘链;模型仍可调 session_search)`,"web.ui.mention.omit_budget_exceeded":`这条消息的附件总量已经用满,没附上(文件和会话共享 200KB)`,"web.ui.mention.omit_not_restored":`这条消息是从历史读回来的,引用内容不重读 —— 点侧栏打开那段会话看原文`,"web.ui.mention.group_files":`文件`,"web.ui.mention.file_palette_label":`可提及的文件`,"web.ui.mention.file_unmentionable":`还有 {count} 个匹配的文件路径带空白或特殊字符,@ 认不全 —— 想提它们就改文件名,或直接拖进输入框`,"web.ui.mention.file_truncated":`工作区文件太多,只列了一部分 —— 没找到的就把路径打全,手打照样能附上`,"web.ui.mention.file_card_label":`文件`,"web.ui.mention.file_card_bytes":`{size}`,"web.ui.mention.file_card_truncated":`超了上限,只附了前 {kb}KB`,"web.ui.mention.file_omit_binary":`是二进制文件,只附了路径没附内容 —— 模型要读可以自己调 file_read`,"web.ui.mention.file_omit_denied":`权限判定没放行(或不在这个工作区里),没附上 —— @ 这条路不弹审批;模型仍可调 file_read 走完整审批`,"web.ui.mention.file_omit_unreadable":`读不到(不存在或不是文件),没附上 —— 检查一下路径拼对没有`,"web.ui.mention.file_omit_over_limit":`这条消息附的文件个数或总量超了上限,没附上`,"web.ui.mention.file_omit_not_restored":`这条消息是从历史读回来的,附件内容不重读 —— 那个文件在工作区里,打开就能看`,"web.ui.perm.menu_label":`权限档位`,"web.ui.perm.lvl_plan":`只读`,"web.ui.perm.lvl_plan_detail":`只让它看和想。要动文件、跑命令,先给你一份计划`,"web.ui.perm.lvl_default":`按需确认`,"web.ui.perm.lvl_default_detail":`规则表说 ask 的那些逐条问你。默认档`,"web.ui.perm.lvl_accept_edits":`自动接受改动`,"web.ui.perm.lvl_accept_edits_detail":`改文件不再问,跑命令照旧问`,"web.ui.perm.lvl_auto":`信任它自己判断`,"web.ui.perm.lvl_auto_detail":`读写文件和联网都不问了,工作区外也一样;跑命令还是只问改动性的那些`,"web.ui.perm.lvl_bypass":`跳过全部检查`,"web.ui.perm.lvl_bypass_detail":`什么都不问,整条导轨会变红`,"web.ui.perm.blocked_managed":`这台机器装了企业托管设置,「跳过全部检查」那一档被它关掉了。详情见「设置 › 安全中心」`,"web.ui.perm.keep_env_pinned":`这一档只对当前这次有效:环境变量 EPOCH_PERMISSION 压着它,下次启动还是按那个来`,"web.ui.perm.keep_unwritable":`这一档只对当前这次有效:配置文件的写法这条路认不出来,没敢改它`,"web.ui.perm.keep_io":`这一档只对当前这次有效:配置文件没写成(盘是只读的,或者没有权限)`,"web.ui.perm.keep_no_config":`这一档只对当前这次有效:这个进程说不出用户配置文件在哪儿`,"web.ui.fatal.unauthorized":`没有访问凭据`,"web.ui.fatal.unauthorized_hint":`回到起 epoch web 的那个终端,用它打印的那条带 token 的地址重新打开。`,"web.ui.fatal.offline":`连不上本地服务`,"web.ui.settings.title":`设置`,"web.ui.settings.back":`返回会话`,"web.ui.settings.security":`安全中心`,"web.ui.settings.pane_model":`模型与 Provider`,"web.ui.settings.pane_memory":`记忆与上下文`,"web.ui.settings.pane_spend":`用量与花费`,"web.ui.settings.history_only":`这段会话只剩历史,引擎还没装起来 —— 点开一段旧会话只回放对话,装引擎要等你发下一条消息。这一屏问的是那台引擎此刻的状态,所以现在没有东西可看:回到会话里发一条,它会自己接回来。`,"web.ui.settings.pane_budget":`预算`,"web.ui.settings.pane_tools":`工具`,"web.ui.settings.pane_about":`关于`,"web.ui.settings.appearance":`外观`,"web.ui.settings.appearance_lede":`只影响这台机器上的这个浏览器。它不写进 config.yaml,也不跟着账号走 —— 我们没有账号。`,"web.ui.settings.appearance_note":`只有浅色和深色两套。颜色在这一稿里是有含义的(状态、语法、增删、权限),所以不开放自定义。`,"web.ui.settings.theme":`主题`,"web.ui.settings.theme_field":`配色`,"web.ui.settings.theme_system":`跟随系统`,"web.ui.settings.theme_light":`浅色`,"web.ui.settings.theme_dark":`深色`,"web.ui.settings.theme_hint":`跟随系统时随 prefers-color-scheme 实时切换,不用刷新。现在系统是{now}。`,"web.ui.settings.lang":`语言`,"web.ui.settings.lang_field":`界面语言`,"web.ui.settings.lang_system":`跟随浏览器`,"web.ui.settings.lang_zh":`中文`,"web.ui.settings.lang_en":`English`,"web.ui.settings.lang_hint":`只切前端自己的字。诊断和服务端返回的提示跟着 epoch web 那个进程的语言走,切成英文之后它们仍然是中文。`,"web.ui.spend.no_session":`还没有会话。这笔账的宾语是「这一段」—— 没有会话就没有东西可算,开一段之后再回来。`,"web.ui.spend.lede":`这段会话花了多少、贵在哪儿。数字来自每一轮跑完记下的账,跟着会话存,进程重启、只剩历史时都还在。`,"web.ui.spend.none_yet":`这段会话还没跑过一轮 —— 跑完第一轮,账会跟着出现。`,"web.ui.spend.none_recorded":`这段对话跑过,但每一轮的账没有被记下来(这段会话早于记账那一次改动)。这些数字不会自己回来。`,"web.ui.spend.g_total":`合计`,"web.ui.spend.g_turns":`逐轮`,"web.ui.spend.total_unmeasured":`这段会话跑了 {turns} 轮,但一轮的用量都没报上来,所以连 token 总数也没有。`,"web.ui.spend.partial":`上面这个金额只是其中 {priced} 轮的和 —— 另外 {unpriced} 轮报了用量,但那些轮用的模型查不到单价。下面那张表里费用那一格空着的就是它们。`,"web.ui.spend.unknown":`金额说不上来,不是没花钱:这几轮用的模型在这台机器上查不到单价,花了多少只有 provider 那一边知道。`,"web.ui.spend.unknown_hint":`更要紧的是:查不到单价时,成本上限会放过这几轮而不是拦着 —— 你配的那条「别超 $N」在这段时间里没有在守这段会话。`,"web.ui.spend.tok_input":`输入(非缓存)`,"web.ui.spend.tok_cache_hit":`输入 · 缓存命中`,"web.ui.spend.tok_cache_write":`输入 · 缓存写入`,"web.ui.spend.tok_output":`输出`,"web.ui.spend.tok_reasoning":`其中思考 {n}。它已经包含在上面这个数里。`,"web.ui.spend.tok_cache_note":`缓存命中按单独的价目算,通常远低于原价 —— 同样长的上下文,命中越多越便宜。`,"web.ui.spend.col_turn":`轮`,"web.ui.spend.col_model":`模型`,"web.ui.spend.col_tokens":`Token`,"web.ui.spend.col_cost":`费用`,"web.ui.spend.turn_n":`第 {n} 轮`,"web.ui.spend.turn_unmeasured":`这一轮没报用量(可能一次模型调用都没发生)。`,"web.ui.spend.turn_took":`用时 {d}`,"web.ui.spend.turn_tools":`工具 {n} 次`,"web.ui.set.no_session":`还没有会话。项目级那两层设置跟着工作区走,而工作区按会话绑 —— 没有会话就没有「哪一份 .epoch/settings.json」可说。`,"web.ui.set.loading":`正在读取设置来源…`,"web.ui.set.unset":`未设置`,"web.ui.set.why":`为什么是这个值`,"web.ui.set.chain_win":`生效`,"web.ui.set.g_other":`其它`,"web.ui.set.overridable_sum":`哪些键能被上层压过`,"web.ui.set.overridable":`只有这几个键能被项目级 / 项目本地 / 命令行 / 企业托管压过去:{keys}。其余每一项都只有内置默认和用户级两层 —— 写进 .epoch/settings.json 也不会生效,启动诊断里会报一条「未知配置项」。`,"web.ui.set.overridable_perm":`名单里的 permissions 是三张列表(allow / ask / deny),合并时取并集而不是高层覆盖,所以它的来源标注是逐条的 —— 在「安全中心 › 权限规则」那一节。`,"web.ui.set.managed_locked":`这一项由这台机器上的企业托管设置定,改用户级或项目级都不会生效。那份文件普通用户写不了,要改得找管理员。`,"web.ui.set.edit":`改`,"web.ui.set.cancel":`取消`,"web.ui.set.save":`保存`,"web.ui.set.new_value":`新的值`,"web.ui.set.write_layer":`写进`,"web.ui.set.write_file":`写进文件`,"web.ui.set.dirty":`未保存`,"web.ui.set.futile_shadowed":`写进{layer}也不会生效:{by}也写了这一项,它排在更上面,加载时会把你写的这个压回去。要让它生效,请改写{by}或更高的层。`,"web.ui.set.futile_untrusted":`这个工作区还没被信任,{layer}里的设置在加载时会被整份丢掉(只有 deny 规则例外),所以写进去等于没写。先在「安全中心 › 工作区与信任」里信任这个目录,或者改写用户级 —— 用户级不过信任闸门。`,"web.ui.set.wrote":`已写进{layer}:{value}`,"web.ui.set.wrote_stale":`这个进程启动时读过一次配置就不再重读,所以它现在用的仍然是 {value} —— 重启 epoch web 之后才会换成刚写的那个值。新开一个会话也不行,配置是整个进程一份。`,"web.ui.set.lede_model":`这个进程此刻在用的模型。改这里的行会写进 ~/.epoch/config.yaml。provider 和 API key 不在这一屏上 —— 那两样跑 epoch model 配。`,"web.ui.set.k_model":`主模型`,"web.ui.set.k_models_utility":`副模型`,"web.ui.set.h_models_utility":`压缩上下文、生成会话标题这类杂活用它。没配就一律走主模型。`,"web.ui.set.k_fallback_model":`降级模型`,"web.ui.set.k_fallback_providers":`降级链`,"web.ui.set.h_fallback_providers":`主 provider 连不上时按这个顺序往下试。`,"web.ui.set.lede_memory":`前两项决定一轮能装多少、能跑多少步;后两项决定装不下的时候怎么办。上下文窗口填大于模型真实上限的值只会换来一次 400。`,"web.ui.set.k_context_length":`上下文窗口(token)`,"web.ui.set.h_context_length":`只在模型元数据查不到时才用这个值兜底;查得到就以元数据为准,填了也不生效。下面那条压缩线算的是引擎真在用的那个窗口。`,"web.ui.set.k_max_turns":`单轮最多几步`,"web.ui.set.h_max_turns":`一轮里模型最多调用几次工具。到顶就停下来把话说完。`,"web.ui.set.k_compression_enabled":`快满时自动压缩`,"web.ui.set.h_compression_enabled":`压缩会把早期消息重写成一份摘要,原文仍在会话库里、模型能搜回来。压完在对话流里留一条记录。`,"web.ui.set.k_compression_threshold":`压到几成开始`,"web.ui.set.h_compression_threshold":`提示词占到上下文窗口的这个比例时开始压。0 到 1 之间。`,"web.ui.set.ctx_line":`这份配置下,提示词涨到 {tokens} token 时开始压缩 —— 上下文窗口 {window} 的 {percent}%。`,"web.ui.set.ctx_line_caveat":`这是那条线本身。刚压过不久、或者连着几次压缩都失败时,跨线了也会先不压。`,"web.ui.set.ctx_off":`自动压缩已关掉。长会话撞到上下文窗口上限时没有任何自动补救 —— 那一轮会直接失败,而且上下文不会自己变短。手动的 /compact 不受这个开关影响,仍然能用。`,"web.ui.set.ctx_not_overridable":`这两行只写得进用户级:能被项目级配置覆盖的键只有那三个(下面那份名单),压缩不在里面 —— 否则一个仓库就能让你在它里面开的长会话悄悄撞满窗口。`,"web.ui.set.budget_title":`此刻花在哪儿了`,"web.ui.set.budget_used":`已用 {used},占 {limit} 窗口的 {percent}%。`,"web.ui.set.budget_used_only":`已用 {used}。这个模型的上下文窗口查不到,所以说不出占了几成。`,"web.ui.set.budget_loading":`正在问这段对话此刻的构成…`,"web.ui.set.budget_error":`没问出这段对话此刻的构成。你手上这段对话没受影响,刷新一下再看。`,"web.ui.set.budget_compact":`现在压一次`,"web.ui.set.budget_compacting":`正在压缩…`,"web.ui.set.budget_compact_hint":`把早期消息重写成一份摘要,给接下来的对话腾出窗口。要发一次模型请求(花钱),但这段对话的记录一行都不会少 —— 变的只是下一轮送进模型的那一份。`,"web.ui.set.lede_budget":`金额只在配了上限之后才出现在界面上。没配上限时这几行都是「未设置」,那也是默认状态。`,"web.ui.set.k_budget_max_cost":`花费上限(美元)`,"web.ui.set.h_budget_max_cost":`按会话累计,不是单次请求的上限 —— 断了用 --resume 回来接着算。到线的那一轮不会先花掉再报:闸门在发下一发请求之前就拦。`,"web.ui.set.k_budget_max_tokens":`Token 上限`,"web.ui.set.h_budget_max_tokens":`两把尺子都配了的话,闸门报更紧的那一份。`,"web.ui.set.k_budget_warn_at":`用到几成时提醒`,"web.ui.set.h_budget_warn_at":`百分比。只在跨线那一次提醒,不每轮刷屏。`,"web.ui.set.k_budget_unknown_pricing":`模型没有定价数据时`,"web.ui.set.h_budget_unknown_pricing":`block 是直接拦下,warn 是告警放行。没有定价数据时花费是「不知道」而不是 0,两者必须分开处理。`,"web.ui.set.ex_budget_max_cost":`例如 5`,"web.ui.set.ex_budget_max_tokens":`例如 1000000`,"web.ui.set.ex_budget_warn_at":`例如 80`,"web.ui.set.blocked_empty":`这一格不能空着。清空不等于把这个配置项删掉 —— 这条路上没有删键这回事;要让它回到默认值,去上面那个文件里把这一行删掉。`,"web.ui.set.blocked_pick":`上面那排里挑一个。`,"web.ui.set.blocked_number":`这一格要一个数,「{text}」读不出数来。别带单位、别带千分位的逗号。`,"web.ui.set.blocked_boolean":`这一格只认 true 和 false 两个词 —— 它们是要写进 yaml 的那两个字面量。`,"web.ui.sec.lede":`这个 agent 现在能碰什么、谁在管着它。`,"web.ui.sec.no_session":`还没有会话。安全状态里有三样东西按会话绑:工作区、它的信任判定、以及跟着信任走的项目级策略目录 —— 没有会话就没有「哪一个」可说。`,"web.ui.sec.loading":`正在读取安全状态…`,"web.ui.sec.card_sandbox":`沙箱`,"web.ui.sec.card_perm":`权限档位`,"web.ui.sec.card_space":`工作区`,"web.ui.sec.card_rules":`生效规则`,"web.ui.sec.perm_d_managed":`被企业托管层锁住,这台机器上改不动。`,"web.ui.sec.perm_d_local":`这个会话此刻在跑的那一档,不是盘上写的那个。`,"web.ui.sec.space_none":`一个都不知道`,"web.ui.sec.space_all_trusted":`{count} 个 · 全已信任`,"web.ui.sec.space_untrusted":`{count} 个 · {untrusted} 个未信任`,"web.ui.sec.space_at":`当前绑在 {root}`,"web.ui.sec.space_unbound":`这个会话没绑工作区。`,"web.ui.sec.rules_n":`权限 {count} 条 · 策略 {policy} 条`,"web.ui.sec.rules_none":`一条都没有`,"web.ui.sec.g_sandbox":`沙箱`,"web.ui.sec.sb_field":`隔离后端`,"web.ui.sec.sb_os":`OS 级隔离({backend})`,"web.ui.sec.sb_process":`仅进程隔离({platform})`,"web.ui.sec.sb_absent":`未探测`,"web.ui.sec.sb_absent_d":`隔离层自己没起来,连探测到了什么都说不出。这不等于「仅进程隔离」。`,"web.ui.sec.sb_absent_long":`隔离层没起来,所以连探测到了什么都说不出。这不等于「仅进程隔离」—— 那是一个已知结论,而这里是一个未知。`,"web.ui.sec.sb_os_isolated":`{platform} 上的 {backend} 真把它关起来了,这一档没什么要解释的。`,"web.ui.sec.sb_backend_unavailable":`{platform} 本该有实现,但探测没过 —— 后端在,调不起来。`,"web.ui.sec.sb_backend_missing":`{platform} 上有实现,但依赖没装:Linux 要 bubblewrap,也可能是内核禁了非特权用户命名空间。`,"web.ui.sec.sb_platform_unsupported":`{platform} 上压根没有实现(Windows 要 AppContainer,Node 没有绑定),装什么都没用。`,"web.ui.sec.sb_switch":`沙箱开关`,"web.ui.sec.sb_switch_on":`开`,"web.ui.sec.sb_switch_off":`关`,"web.ui.sec.sb_switch_on_hint":`config.yaml 的 sandbox.terminal,默认开。`,"web.ui.sec.sb_switch_off_hint":`关着 —— terminal 的命令这次没有进沙箱,尽管下面那张清单还列着它。改回 config.yaml 的 sandbox.terminal。`,"web.ui.sec.sb_covers":`走沙箱的工具`,"web.ui.sec.sb_covers_none":`没有任何工具走隔离层。`,"web.ui.sec.sb_excludes":`明确不在沙箱里`,"web.ui.sec.sb_excludes_none":`没有点名在外的工具。`,"web.ui.sec.sb_excludes_why":`终端不走沙箱 —— 挡它的是危险命令表和权限闸门,「沙箱已启用」不包它。`,"web.ui.sec.g_perm":`权限档位`,"web.ui.sec.perm_field":`当前档位`,"web.ui.sec.perm_unknown":`读不出`,"web.ui.sec.perm_hint":`拿不准的时候默认怎么办。`,"web.ui.sec.managed_field":`企业托管`,"web.ui.sec.managed_on":`这台机器上有一份企业托管设置,它压过所有其他层。`,"web.ui.sec.managed_off":`这台机器上没有企业托管设置。这是常态。`,"web.ui.sec.managed_rules_only":`托管层打开了「只认托管的权限规则」:其余各层的三张表整份作废。`,"web.ui.sec.managed_bypass_off":`托管层禁掉了「跳过全部检查」那一档。`,"web.ui.sec.g_rules":`权限规则`,"web.ui.sec.rules_empty":`一条权限规则都没有,所有决定都落到上面那个档位上。`,"web.ui.sec.rules_no_exec":`allow 里放行任意代码执行的规则(比如 terminal(python:*))会在加载时被拒绝并告警:那等于把整个权限系统绕过去。`,"web.ui.sec.shadow_lede":`有规则被别的规则盖住了:`,"web.ui.sec.shadow_shadowed":`{rule} 永远不生效 —— {by} 把它整个盖住了。`,"web.ui.sec.shadow_partial":`{rule} 被 {by} 挖掉了一块。这往往是故意的。`,"web.ui.sec.shadow_redundant":`{rule} 写了等于没写 —— 同一张表里 {by} 已经更宽。`,"web.ui.sec.layer_builtin":`① 内置默认`,"web.ui.sec.layer_plugin":`①ᐟ⁵ 插件`,"web.ui.sec.layer_user":`② 用户级`,"web.ui.sec.layer_env":`环境变量`,"web.ui.sec.layer_project":`③ 项目级`,"web.ui.sec.layer_project_local":`④ 项目本地`,"web.ui.sec.layer_cli":`⑤ 命令行`,"web.ui.sec.layer_managed":`∞ 企业托管`,"web.ui.sec.layer_unknown":`config.yaml`,"web.ui.sec.g_space":`工作区与信任`,"web.ui.sec.known_field":`已知工作区`,"web.ui.sec.known_empty":`还没有任何目录被问过信任。`,"web.ui.sec.known_hint":`信任跟着目录走,不跟着会话走:同一个目录被两个会话绑上,信任状态也只有一份。`,"web.ui.sec.ws_current":`当前`,"web.ui.sec.ws_trusted":`已信任,它的 .epoch/ 会被读。`,"web.ui.sec.ws_gate_off":`信任闸门整个没开(trust.enabled 是 false),所以它按已信任算。`,"web.ui.sec.ws_refused":`你拒绝过它。它的 .epoch/ 一个字都不读。`,"web.ui.sec.ws_unknown":`还没问过。epoch trust add 之后才会读它的 .epoch/。`,"web.ui.sec.bound_field":`当前工作区`,"web.ui.sec.unbound":`这个会话没绑工作区 —— 这是真的一档,不是还没查到。相对路径没有基准,项目级的配置、角色、技能一律不加载。`,"web.ui.sec.main_field":`主根 {name}`,"web.ui.sec.main_hint":`相对路径只按主根解析。项目级的 .epoch/settings.json、agents/、skills/、policies/ 也只从这里发现。`,"web.ui.sec.loaded_files":`已加载的约定文件:`,"web.ui.sec.loaded_none":`这个根里没有约定文件。`,"web.ui.sec.skipped_line":`这些约定文件在,但一个字都没读。`,"web.ui.sec.skipped_why":`它们进的是 system prompt,所以要先过信任闸门。信任这个目录之后它们就会加载:`,"web.ui.sec.extra_field":`额外目录`,"web.ui.sec.layer_add_dir":`--add-dir`,"web.ui.sec.extra_none":`没有额外目录。`,"web.ui.sec.extra_desc":`只放行路径`,"web.ui.sec.extra_hint":`只是放宽了读写范围。它们不是第二个工作区:相对路径、项目配置、角色和技能都只认主根。`,"web.ui.sec.unloaded_extra":`额外目录里有约定文件,一律不加载:`,"web.ui.sec.unloaded_extra_way":`这一处和主根不同:信任了也不会加载,因为「额外目录的约定文件要单独过一次信任判定」这件事还没做。要它生效就把那个目录设成主根,或者把内容并进主根的约定文件。`,"web.ui.sec.trust_only_deny":`未信任的仓库里,权限规则只有 deny 那一张表生效 —— 它只能减,不能加。`,"web.ui.sec.trust_not_permission":`信任不改权限档位。它只回答「这个目录里的文件能不能影响我的指令」,不回答「这次操作要不要问你」—— 后者永远是上面那张规则表说了算。`,"web.ui.sec.g_policy":`策略规则`,"web.ui.sec.policy_lede":`和上面那张权限规则表是两套东西:权限规则管「要不要问我」,策略规则管「这个工具碰这个路径算什么」,而且 deny 的时候能带一句自己写的话给用户。`,"web.ui.sec.policy_none":`没有任何策略目录参与扫描。`,"web.ui.sec.policy_user":`用户级,跟着这台机器走。`,"web.ui.sec.policy_project":`项目级,跟着当前工作区走 —— 换个会话就是另一个仓库的。`,"web.ui.sec.policy_n":`{count} 条`,"web.ui.sec.policy_skipped":`{dir} 整份没加载 —— 那个工作区不受信任。`,"web.ui.sec.policy_skipped_why":`不是「只留 deny」,是一条都没读。`,"web.ui.sec.policy_asym":`这里和权限那边不对称,值得单独说一句:权限在未信任时只留 deny,策略是整份不加载。一条 [[rule]] 里工具名、路径模式、判定是绑在一起的,deny_message 还会原样显示给用户 —— 想留「只有 deny 生效」的口子,就得逐条重写别人写的规则语义。`,"web.ui.sec.g_audit":`判过什么`,"web.ui.sec.audit_lede":`权限层这一程的裁决,最新的在最前面。`,"web.ui.sec.audit_scope":`只记权限层做过的裁决,不是所有危险动作。`,"web.ui.sec.audit_col_at":`时间`,"web.ui.sec.audit_col_tool":`工具`,"web.ui.sec.audit_col_type":`类型`,"web.ui.sec.audit_col_target":`目标`,"web.ui.sec.audit_col_outcome":`结论`,"web.ui.sec.audit_col_code":`原因`,"web.ui.sec.audit_granted":`放行`,"web.ui.sec.audit_denied":`拦截`,"web.ui.sec.audit_dropped":`更早的 {dropped} 条已经被挤掉了 —— 这张表最多留 500 条。你看到的不是全部。`,"web.ui.sec.audit_ephemeral":`这本账只活在这个服务进程里:不落盘、不导出、也不进遥测。进程一退就没了,所以它不是一份完整的历史。`,"web.ui.sec.audit_code_dangerous_command":`命中危险命令表`,"web.ui.sec.audit_code_sensitive_path":`命中敏感路径表`,"web.ui.sec.audit_code_obfuscated":`命令含混淆构造,非交互下无人可确认`,"web.ui.sec.audit_code_rule_match":`命中权限规则`,"web.ui.sec.audit_code_policy_rule":`命中策略规则`,"web.ui.sec.audit_code_approval_cache":`你以前对这个目标做过同样的决定`,"web.ui.sec.audit_code_sandbox_isolation":`按实测的沙箱隔离级别判`,"web.ui.sec.audit_code_level_default":`没有规则命中,落到权限档位上`,"web.ui.sec.audit_code_headless_preauthorized":`非交互,命中预授权白名单`,"web.ui.sec.audit_code_headless_unauthorized":`非交互,未预授权`,"web.ui.sec.audit_code_user_approved":`你批准了`,"web.ui.sec.audit_code_user_denied":`你拒绝了`,"web.ui.sec.perm_where":`两档都在输入框那一行改:换一次立刻生效,同时记成下面这个起点(写进 ~/.epoch/config.yaml),新会话和下次启动都从它开始。`,"web.ui.sec.perm_now":`此刻`,"web.ui.sec.perm_default":`默认`,"web.ui.sec.perm_now_changed":`(本会话改过)`,"web.ui.sec.g_cached":`已记下的审批决定`,"web.ui.sec.cached_lede":`你在审批弹窗上点过的答案,这个进程记着,同样的操作不会再问你。撤销一条之后,它会重新问。`,"web.ui.sec.cached_not_rules":`这里撤的只是弹窗答案。上面那张规则表里的 deny 排在它前面 —— 撤了这一条,还是可能被那一条拦下。`,"web.ui.sec.cached_where":`「总是允许」写在 ~/.epoch/approvals.json,撤销会一起从盘上删掉;「拒绝」和「本次会话允许」只在内存里,进程退出就没了。`,"web.ui.sec.cached_bypass":`当前档位是 bypass,这一档整段不查这张表 —— 下面这些决定此刻都没在拦人,换回别的档才生效。`,"web.ui.sec.cached_revoke":`撤销`,"web.ui.sec.cached_revoke_one":`撤销 {target} 上的这条决定`,"web.ui.sec.cached_revoking":`撤销中…`,"web.ui.sec.cached_failed":`撤销失败:{message}`,"web.ui.sec.cached_d_deny":`拒绝`,"web.ui.sec.cached_d_session":`本次会话允许`,"web.ui.sec.cached_d_always":`总是允许`,"web.ui.sec.cached_scope_exact":`仅此目标`,"web.ui.sec.cached_scope_prefix":`含子目录`,"web.ui.cap.title":`能力`,"web.ui.cap.back":`返回会话`,"web.ui.cap.experts":`身份`,"web.ui.cap.skills":`技能`,"web.ui.cap.connectors":`连接器`,"web.ui.cap.search":`搜名字、描述、工具名`,"web.ui.cap.no_session":`还没有会话。这三栏是跟着会话走的 —— 「项目」那一层要看它绑的是哪个工作区。`,"web.ui.cap.loading":`正在取…`,"web.ui.cap.experts_lede":`身份是一段 prompt、一个工具集、一个轮数上限。主 agent 用 delegate_task 把活派出去,每个子 agent 以自己的身份跑在独立的上下文里,只把结论交回来。`,"web.ui.cap.skills_lede":`技能是渐进披露的:平时只有下面那一行进上下文,模型觉得用得上才去读正文。行尾那个数就是那一行每一轮的常驻开销 —— 真被挡在索引外的那几条,行尾会直说。`,"web.ui.cap.connectors_lede":`连接器是工具的来源。内置那几个随程序装好,不会连不上;MCP 那些是你自己配的,所以它们带状态。`,"web.ui.cap.g_builtin":`内置`,"web.ui.cap.g_plugin":`插件`,"web.ui.cap.g_host":`宿主`,"web.ui.cap.g_user":`我的`,"web.ui.cap.g_project":`项目`,"web.ui.cap.g_mcp":`MCP`,"web.ui.cap.g_builtin_roles":`装好就有的,不用配。同名的可以被下面几层覆盖掉。`,"web.ui.cap.g_plugin_roles":`装的插件带进来的,在插件自己的 agents/ 目录下。`,"web.ui.cap.g_user_roles":`~/.epoch/agents/ 下的 .md,每台机器一份,所有项目共用。`,"web.ui.cap.g_project_roles":`这个仓库 .epoch/agents/ 下的 .md,跟着仓库走;同名会盖掉上面几层。`,"web.ui.cap.g_host_roles":`装着这个引擎的那个应用自己带的,名字前面会加上它给的前缀。epoch plugin list 里查不到它们 —— 你没装过,也只能在那个应用自己的界面上管。`,"web.ui.cap.g_user_skills":`~/.epoch/skills/ 下每个技能一个目录,正文写在 SKILL.md 里。`,"web.ui.cap.g_plugin_skills":`装的插件带进来的,名字前面会加上插件名。`,"web.ui.cap.g_project_skills":`这个仓库 .epoch/skills/ 下的,跟着仓库走。`,"web.ui.cap.g_host_skills":`装着这个引擎的那个应用自己带的,名字前面会加上它给的前缀。它随那个应用一起升级,所以在这儿是只读的。`,"web.ui.cap.g_builtin_conn":`编进程序里的工具插件。这里只说有几个工具,不逐个列名字 —— 三十来个摊开会把下面 MCP 那几台挤出屏幕。`,"web.ui.cap.g_mcp_note":`你在 ~/.epoch/mcp.json 里配的。它们的工具名带 mcp__<服务器名>__ 前缀。`,"web.ui.cap.g_host_conn":`装着这个引擎的那个应用自己带的,不在你的 mcp.json 里,所以你既改不了也删不掉 —— 要管得去那个应用自己的界面。它们的名字带上了它给的前缀,工具名因此是 mcp__<前缀>__<服务器名>__ 开头。`,"web.ui.cap.g_plugin_conn":`装的插件在自己根目录下那份 mcp.json 里带的。名字前面加了插件名,工具名因此是 mcp__<插件名>__<服务器名>__ 开头。内容改不了,但 epoch plugin list 查得到是谁带来的,epoch plugin disable 能整个停掉。`,"web.ui.cap.project_locked_roles":`这个工作区还没被信任,我们没有读它的 .epoch/agents/ —— 所以这一组的数量也算不出来。信任之后再回来看。`,"web.ui.cap.locked_line":`这个工作区还没被信任,它的技能一个都没读。`,"web.ui.cap.locked_why":`不是「读了之后禁用」,是从头到尾没打开过那个目录。所以这里连有几个都列不出来。`,"web.ui.cap.locked_gate":`闸门挡的是:clone 一个仓库下来,它 .epoch/ 里带的东西不该在你还没看过之前就进模型的上下文。`,"web.ui.cap.summon":`使用`,"web.ui.cap.overrides_builtin":`覆盖了同名的内置角色`,"web.ui.cap.stat_tools":`工具`,"web.ui.cap.stat_turns":`轮数上限`,"web.ui.cap.unlimited":`不限`,"web.ui.cap.turns_global":`按全局`,"web.ui.cap.toolset":`工具集`,"web.ui.cap.toolset_n":`工具集({count})`,"web.ui.cap.unlimited_hint":`没写 tools,所以它拿到的是这一轮全部可用的工具。`,"web.ui.cap.skillset_n":`技能白名单({count})`,"web.ui.cap.skillset_hint":`⚠️ 它只管索引里列不列得出,不是一道墙 —— 没列出的技能,这个身份照样读得到正文。`,"web.ui.cap.skillset_none":`这张白名单是空的,所以它的技能索引里一条都不列。`,"web.ui.cap.list_sep":`、`,"web.ui.cap.narrowed":`{role} 声明的工具里有几个不在上一层的范围内,已经去掉:{cut}。工具白名单只能收窄,不能放宽。`,"web.ui.cap.narrowed_skills":`{role} 声明的技能里有几条不在上一层的范围内,索引里不会列出:{cut}。它们的正文照旧读得到 —— 收窄的是上下文预算,不是边界。`,"web.ui.cap.skill_tokens":`{tokens} tokens`,"web.ui.cap.skill_unindexed":`未进索引`,"web.ui.cap.skills_capped_note":"有 {count} 条被 `skills.maxIndexed` 截在索引外:它们不占每一轮的上下文,模型也列不出它们。那一格调大或者去掉就能恢复。","web.ui.cap.skills_role_note":`有 {count} 条不在这段会话身份的技能白名单里,所以没进索引。⚠️ 那不是一把锁:正文照旧读得到 —— 收窄的是上下文预算,不是可达性。`,"web.ui.cap.no_toggle":"没有「关掉一个技能」这个开关:只要文件在目录里,它就会被扫到。不想要它,用行尾那个「删除」把它连目录一起删掉(拿不回来);只是想省上下文的话,`skills.maxIndexed` 能给索引封顶。","web.ui.cap.import_entry":`导入技能`,"web.ui.cap.import_title":`导入技能`,"web.ui.cap.import_lede":`从这台跑着服务的机器上导入。接受一个含 SKILL.md 的文件夹、一棵「分类/名字」两层的技能树、一个打包好的 .zip,或者单独一份带 frontmatter 的 .md。`,"web.ui.cap.import_hint_local":`填服务端那台机器上的路径 —— 这条路不收上传的文件。`,"web.ui.cap.import_placeholder":`/Users/you/skills/my-skill`,"web.ui.cap.import_path_label":`要导入的绝对路径`,"web.ui.cap.import_look":`看看有什么`,"web.ui.cap.import_browse":`浏览目录`,"web.ui.cap.import_browse_off":`收起`,"web.ui.cap.import_pick_here":`就用这一层`,"web.ui.cap.import_count":`将导入 {count} 个技能({form})`,"web.ui.cap.import_form_markdown":`单份 .md`,"web.ui.cap.import_form_skill-dir":`一个技能文件夹`,"web.ui.cap.import_form_tree":`一棵技能树`,"web.ui.cap.import_form_archive":`一个压缩包`,"web.ui.cap.import_files":`{files} 个附属文件 · {bytes} 字节`,"web.ui.cap.import_no_desc":`(没有 description —— 它照样占 <available_skills> 里一行,但那一行只有名字,白花每一轮的 token,模型基本挑不中它)`,"web.ui.cap.import_conflict_refuse":` ⚠️ 用户级已经有同名的,这一份不会导入`,"web.ui.cap.import_conflict_shadowed":` ⚠️ 项目级有同名的,导进来也不生效(同名时项目级赢)`,"web.ui.cap.import_confirm":`确认导入这 {count} 个`,"web.ui.cap.import_issues":`这几条要看一眼:`,"web.ui.cap.import_skipped":`跳过了这几份:`,"web.ui.cap.import_done":`导入了 {count} 个,跳过 {skipped} 个`,"web.ui.cap.import_failed":`这条路径导不进来`,"web.ui.cap.import_again":`再导一份`,"web.ui.cap.skill_view":`查看正文`,"web.ui.cap.skill_back":`回到技能列表`,"web.ui.cap.skill_view_no_count":`看一眼不会影响它的评分 —— 那本账只记模型真的用过它的次数。`,"web.ui.cap.skill_truncated":`这份 SKILL.md 太大(一共 {bytes} 字节),下面只是开头那一截。要读全的话直接打开那个文件。`,"web.ui.cap.skill_bytes":`一共 {bytes} 字节`,"web.ui.cap.skill_remove":`删除`,"web.ui.cap.skill_remove_ask":`删掉 {name}?连它整个目录一起,删了拿不回来。`,"web.ui.cap.skill_remove_yes":`删除`,"web.ui.cap.skill_cancel":`取消`,"web.ui.cap.skill_removed":`已经删掉 {name}。刚刚被删掉的是这个目录:`,"web.ui.cap.plugins":`插件`,"web.ui.cap.plug_lede":`一个插件是一包扩展物:斜杠命令、身份、技能、hook、deny 规则、MCP server,包里还能带任意语言的脚本。装它有两条路:从已加的市场里挑一条,或者指一个本机上的插件目录(那一档只是建一条软链)。传文件传不了。`,"web.ui.cap.plug_installed_head":`装着的({count})`,"web.ui.cap.plug_installed_empty":`一个插件都没装。`,"web.ui.cap.plug_market_head":`市场里有什么({count})`,"web.ui.cap.plug_market_empty":`已加的市场里一个插件都没有 —— 市场是加上了,只是那份目录里没东西。`,"web.ui.cap.plug_market_none_added":`还没加过任何插件市场。按上面那个「添加」,或者指一个本机上的插件目录直接装。`,"web.ui.cap.plug_no_desc":`(这一条在市场目录里没写说明)`,"web.ui.cap.plug_add":`添加`,"web.ui.cap.plug_add_title":`添加插件`,"web.ui.cap.plug_add_back":`回到插件列表`,"web.ui.cap.plug_add_tab_local":`本地目录`,"web.ui.cap.plug_add_tab_market":`市场`,"web.ui.cap.plug_add_hint_local":`这是跑着这个服务的那台机器上的路径,不是你这台电脑上的。要绝对路径(/ 开头),指向一个插件目录 —— 里面得有 epoch-plugin.json。装它只是建一条软链:改源码、重启一次就生效。`,"web.ui.cap.plug_add_path_placeholder":`/home/you/dev/my-toolkit`,"web.ui.cap.plug_add_path_label":`插件目录的绝对路径`,"web.ui.cap.plug_add_look":`看看会装什么`,"web.ui.cap.plug_add_browse":`浏览…`,"web.ui.cap.plug_add_browse_off":`收起`,"web.ui.cap.plug_add_pick_here":`选这一层`,"web.ui.cap.plug_market_lede":`市场是一份插件目录(一份 JSON)。加它不装任何东西 —— 加完之后回列表那一屏挑要装哪一条,那条路上的安装前预览一点没变。`,"web.ui.cap.plug_market_placeholder":`/srv/market 或 github:acme/market`,"web.ui.cap.plug_market_label":`市场地址`,"web.ui.cap.plug_market_add":`添加市场`,"web.ui.cap.plug_market_add_failed":`这个市场加不进来`,"web.ui.cap.plug_market_none":`一个市场都没加。`,"web.ui.cap.plug_market_entries":`{count} 条`,"web.ui.cap.plug_market_remove":`移除`,"web.ui.cap.plug_market_remove_ask":`移除它?从它装的插件照旧留着,只是以后在这儿挑不到新的了。`,"web.ui.cap.plug_market_remove_yes":`移除`,"web.ui.cap.plug_market_remove_failed":`移除不了`,"web.ui.cap.plug_restart":`这一程动过插件,那些改动还没生效`,"web.ui.cap.plug_restart_why":`扩展物是在启动时加载的,所以刚装 / 更新 / 卸载的那些要下一程才算数 —— 这一程的命令表、hook、身份表一个字都没变。要它们生效:重启跑着这个界面的那个服务(终端里 Ctrl+C,再跑一次 epoch web)。如果这个界面是嵌在别的程序里的,那次重建只有那个程序做得到 —— 这一页上没有、也不会有一个「立即生效」的按钮。`,"web.ui.cap.plug_state_active":`已生效`,"web.ui.cap.plug_state_pending":`装完了,这一程还没加载它`,"web.ui.cap.plug_state_disabled":`已停用(epoch plugin enable 打开)`,"web.ui.cap.plug_state_off":`装着但这一程没加载它 —— 启动诊断里有一条说了为什么(版本不符 / 目录没了 / 清单坏了)`,"web.ui.cap.plug_state_stale":`这一程没加载它 —— 可能是它刚被装 / 更新过(那就重启一次),也可能是它出了事(启动诊断里有一条说了为什么)`,"web.ui.cap.plug_n_commands":`命令 {count}`,"web.ui.cap.plug_n_roles":`身份 {count}`,"web.ui.cap.plug_n_skills":`技能 {count}`,"web.ui.cap.plug_n_hooks":`hook {count}`,"web.ui.cap.plug_n_deny":`deny {count}`,"web.ui.cap.plug_n_mcp":`MCP {count}`,"web.ui.cap.plug_linked":`软链`,"web.ui.cap.plug_already":`已装上`,"web.ui.cap.plug_remote_off":` ⚠️ 它的来源要联网取(git clone / 下载解压),而远程那一档在这个部署上关着,所以装不了`,"web.ui.cap.plug_bad_source":` ⚠️ 市场目录里这一条的来源写错了,我们看不懂它 —— 得由出这份目录的人改`,"web.ui.cap.plug_install":`安装`,"web.ui.cap.plug_update":`更新`,"web.ui.cap.plug_uninstall":`卸载`,"web.ui.cap.plug_uninstall_ask":`卸载 {name}?`,"web.ui.cap.plug_uninstall_yes":`卸载`,"web.ui.cap.plug_cancel":`取消`,"web.ui.cap.plug_back":`回到插件列表`,"web.ui.cap.plug_will_install":`将安装 {name}@{version}`,"web.ui.cap.plug_will_update":`将更新到 {name}@{version}`,"web.ui.cap.plug_source":`来源`,"web.ui.cap.plug_checksum":`校验和(已核对)`,"web.ui.cap.plug_author":`作者`,"web.ui.cap.plug_homepage":`主页`,"web.ui.cap.plug_brings":`它会带来:`,"web.ui.cap.plug_brings_nothing":`没有任何扩展物 —— 装了等于没装,确认一下那个目录的结构对不对`,"web.ui.cap.plug_inv_commands":`斜杠命令 {count} 条:{names}`,"web.ui.cap.plug_inv_roles":`身份 {count} 个:{names}`,"web.ui.cap.plug_inv_skills":`技能 {count} 个:{names}`,"web.ui.cap.plug_inv_hooks":`⚠️ hook {count} 条({tally})—— hook 是 shell 命令,它们会在这台机器上跑起来`,"web.ui.cap.plug_inv_mcp":`⚠️ MCP server {count} 台:{names} —— 每一台都是一个会被起起来的子进程`,"web.ui.cap.plug_inv_deny":`deny 规则 {count} 条(插件只能收紧权限,不能放开)`,"web.ui.cap.plug_inv_ignored":`它的 settings.json 里这几个桶不生效:{buckets}(插件写的 allow / ask 一律忽略)`,"web.ui.cap.plug_inv_js":`它带了一个 tools/ 目录,但这一版「不在 epoch 进程里跑第三方 JS」—— 那个目录会被整个忽略。`,"web.ui.cap.plug_conflict":`⚠️ 已经装着 {name}@{version} 了,所以这一次会被拒。要换成这一份的话,先把那个卸掉。`,"web.ui.cap.plug_pending_hint":`按下去之后它会落到盘上,但「这一程不会生效」—— 扩展物在启动时加载。`,"web.ui.cap.plug_confirm":`确认安装`,"web.ui.cap.plug_confirm_update":`确认更新`,"web.ui.cap.plug_done":`已装上 {name}@{version}。`,"web.ui.cap.plug_done_update":`已更新到 {name}@{version}。`,"web.ui.cap.plug_preview_failed":`这一条装不了`,"web.ui.cap.plug_locked_lan":`这一档下装不了插件:服务是用 --host 绑到回环之外的,而我们没法确认你的浏览器就在跑服务的那台机器上。一包插件里可以带 hook(shell 命令)和 mcp.json(一台会被起起来的 server),也就是说这一下决定的是那台机器上会跑起什么进程 —— 所以这条路只在默认的回环绑定下开。要装的话:到那台机器上跑 epoch plugin install,或者去掉 --host 重启一次。下面这些照旧看得见,只是动不了。`,"web.ui.cap.plug_no_path":`这个界面上没有插件这条路`,"web.ui.cap.tool_count":`{count} 个工具`,"web.ui.cap.mcp_empty":`还没有配 MCP server。按上面那枚「添加 server」加一台,或者直接编辑 ~/.epoch/mcp.json。`,"web.ui.cap.mcp_connected":`已连接`,"web.ui.cap.mcp_failed":`连不上`,"web.ui.cap.mcp_login":`要登录`,"web.ui.cap.mcp_retries":`重试过 {count} 次。`,"web.ui.cap.mcp_failed_why":`它的工具这一轮整个不可用。改完 mcp.json 之后要重启 epoch web 才会重连。`,"web.ui.cap.mcp_login_why":`不是连不上,是没通过它那边的授权 —— 重连多少次都一样。在终端里跑下面这条:`,"web.ui.cap.mcp_reconnect":`重连`,"web.ui.cap.mcp_reconnecting":`重连中…`,"web.ui.cap.mcp_reconnect_scope":`这会影响这个进程里所有会话,不只是你正看着的这一段 —— MCP 连接是整个进程共用的一份。它按启动时读到的那份 mcp.json 重连,改过配置的话仍然要重启。`,"web.ui.cap.mcp_reconnect_after_login":`先跑上面那条 login,再按这里 —— 新凭据要重连一次才用得上。`,"web.ui.cap.mcp_add":`添加 server`,"web.ui.cap.mcp_add_title":`加一台 MCP server`,"web.ui.cap.mcp_add_name":`server 名`,"web.ui.cap.mcp_add_name_hint":`会变成工具名的一部分(mcp__<名字>__…),所以只收字母数字和 _ -。`,"web.ui.cap.mcp_add_transport":`传输类型`,"web.ui.cap.mcp_add_command":`可执行文件`,"web.ui.cap.mcp_add_args":`参数(一行一个)`,"web.ui.cap.mcp_add_url":`地址`,"web.ui.cap.mcp_add_env":`环境变量(一行一个 KEY=值)`,"web.ui.cap.mcp_add_env_hint":`这几行会明文写进 mcp.json。要存密钥的话别放这儿 —— 那条路是 epoch mcp login,凭据是加密存的。`,"web.ui.cap.mcp_add_scope":`这会写进 ~/.epoch/mcp.json —— 不只是这一段对话,也不只是这个进程:这台机器上以后每一次跑 epoch(含 CLI 和 TUI)都会看到它。加完当场连一次,工具这一轮就能用上。`,"web.ui.cap.mcp_add_submit":`加进去`,"web.ui.cap.mcp_add_submitting":`连接中…`,"web.ui.cap.mcp_add_cancel":`取消`,"web.ui.cap.mcp_add_done":`已写进 {path}。`,"web.ui.cap.mcp_add_offline":`配置加进去了,但这台现在连不上 —— 上面那张卡里有原因。配置没问题的话,等对面起来按一下「重连」就行。`,"web.ui.cap.mcp_add_locked":`这一档下没法从界面加 MCP server:服务是用 --host 绑到回环之外的,而我们没法确认你的浏览器就在跑服务的那台机器上。加一台等于往 mcp.json 里写一条「启动哪个可执行文件」——那台当场就会被起起来,而且这台机器上以后每一次跑 epoch(含 CLI 和 TUI)都会照着它起,不只是这一段对话。要加的话:到那台机器上直接改 ~/.epoch/mcp.json,或者去掉 --host 重启一次。`,"web.ui.cap.mcp_cfg_open":`看它的配置`,"web.ui.cap.mcp_cfg_title":`编辑 mcp.json`,"web.ui.cap.mcp_cfg_path":`配置文件路径:`,"web.ui.cap.mcp_cfg_dirty":`未保存`,"web.ui.cap.mcp_cfg_loading":`正在读那个文件…`,"web.ui.cap.mcp_cfg_absent":`这个文件还不存在 —— 下面那几行是模板,不是你的内容。按「保存」才会真的建出来。`,"web.ui.cap.mcp_cfg_editor":`mcp.json 的内容`,"web.ui.cap.mcp_cfg_locked":`这一档下看不了也改不了 mcp.json —— 服务是用 --host 绑到回环之外的,而我们没法确认发出这一下的浏览器就在这台机器上。那份文件里的环境变量是明文存的(可能有密钥),而它同时写得下「启动哪个可执行文件」。出路两条:到跑着服务的那台机器上直接改那个文件;或者去掉 --host 重启一次。`,"web.ui.cap.mcp_cfg_reload":`重新读一遍(会丢掉现在这份修改)`,"web.ui.cap.mcp_cfg_scope":`这一屏上有两个动作,改的不是同一样东西:「保存」只写 ~/.epoch/mcp.json —— 这台机器上以后每一次跑 epoch(含 CLI 和 TUI)都会读它;「应用到这个进程」才动正在跑的这些连接,而那影响这个进程里所有会话,不只是你正看着的这一段。删掉一台之后,正在用它的那些会话下一轮就调不到它的工具了。`,"web.ui.cap.mcp_cfg_save":`保存`,"web.ui.cap.mcp_cfg_saving":`正在写…`,"web.ui.cap.mcp_cfg_apply":`应用到这个进程`,"web.ui.cap.mcp_cfg_applying":`正在应用…`,"web.ui.cap.mcp_cfg_apply_dirty":`先保存 —— 「应用」读的是盘上那份,而你手上这份还没写下去。`,"web.ui.cap.mcp_cfg_close":`收起`,"web.ui.cap.mcp_cfg_saved":`已写进 {path}。`,"web.ui.cap.mcp_cfg_not_live":`这个进程里那几台还按启动时那份配置在跑 —— 按一下「应用到这个进程」,或者下次启动时自动生效。`,"web.ui.cap.mcp_cfg_applied":`这个进程里的 MCP 已经按盘上那份重排过了:`,"web.ui.cap.mcp_cfg_applied_none":`一台都没动 —— 盘上那份和这个进程里正在跑的那几台逐字一致。`,"web.ui.cap.mcp_cfg_act_added":`新连上了这一台`,"web.ui.cap.mcp_cfg_act_reconnected":`配置变了,按新配置重连过`,"web.ui.cap.mcp_cfg_act_unchanged":`没动(配置没变)`,"web.ui.cap.mcp_cfg_act_removed":`已断开,它的工具从这一轮起不可用`,"web.ui.cap.mcp_cfg_act_skipped":`这个名字被宿主或某个插件那批占着,所以这个进程里没加 —— 下次启动时你这台会赢`,"web.ui.cap.role_add":`新建身份`,"web.ui.cap.role_add_title":`新建一个身份`,"web.ui.cap.role_add_name":`名字`,"web.ui.cap.role_add_name_hint":`只收小写字母、数字和连字符。它同时是文件名,也是派活时用的那个词。`,"web.ui.cap.role_add_desc":`什么时候派给它`,"web.ui.cap.role_add_desc_hint":`这一句是写给主智能体看的,不是自我介绍 —— 它照着这句话决定要不要把活派过来,所以要写「什么时候该用我」。它还会进每一次派活的工具描述里。`,"web.ui.cap.role_add_prompt":`正文`,"web.ui.cap.role_add_prompt_hint":`这个身份工作时读到的那段话。留空也行 —— 那样它只换一句身份行和工具边界。`,"web.ui.cap.role_add_tools":`工具白名单(一行一个)`,"web.ui.cap.role_add_tools_hint":`留空 = 不限,跟着当前这一轮能用的全部工具走。写了就只给这几样。名字要和设置 › 工具那一页上的对得上。`,"web.ui.cap.role_add_skills":`技能白名单(一行一个)`,"web.ui.cap.role_add_skills_hint":`留空 = 不限,能力页上那些技能全都进它的索引。写了就只列这几条。名字照能力页技能那一栏抄(插件和宿主的带「前缀:」)。⚠️ 它只管索引里列不列得出,不是一道墙 —— 没列出的技能,这个身份照样读得到正文。`,"web.ui.cap.role_add_turns":`轮次上限`,"web.ui.cap.role_add_turns_hint":`留空 = 跟全局。1 到 200。`,"web.ui.cap.role_add_scope":`这会在 ~/.epoch/agents/ 里建一个 .md —— 不只是这一段对话,也不只是这个进程:这台机器上以后每一次跑 epoch(含 CLI 和 TUI)都会看到它。⚠️ 上面那两段文字会进模型的上下文(「什么时候派给它」那一句每一轮都进),所以写进去的东西和你在对话里说的话一样有分量。`,"web.ui.cap.role_add_submit":`建出来`,"web.ui.cap.role_add_submitting":`写入中…`,"web.ui.cap.role_add_cancel":`取消`,"web.ui.cap.role_add_done":`已写进 {path} —— 想接着改正文就去那个文件。`,"web.ui.cap.role_add_locked":`这一档下没法从界面新建身份:服务是用 --host 绑到回环之外的,而我们没法确认你的浏览器就在跑服务的那台机器上。身份的正文会进往后每一轮的上下文(「什么时候派给它」那一句还会进每一次派活的工具描述),所以这条路只在默认的回环绑定下开。要加的话:到那台机器上往 ~/.epoch/agents/ 里放一个 .md,或者去掉 --host 重启一次。`,"web.ui.cap.copy_cmd":`复制`,"web.ui.cap.trusted_at":`已信任 {root}`,"web.ui.cap.untrusted_at":`未信任 {root}`,"web.ui.cap.no_workspace":`这个会话没有绑工作区`,"web.ui.cap.summon_prefill":`让 {role} 来做:`,"web.ui.cap.open_session":`开一段新会话`,"web.ui.cap.open_session_here":`用 {role} 的身份在 {root} 开一段新会话;当前这段对话原样留着`,"web.ui.cap.open_session_nows":`用 {role} 的身份开一段新会话,同样不绑工作区;当前这段对话原样留着`,"web.ui.cap.open_session_failed":`开新会话没成:{detail}`,"web.ui.cap.take_over":`让它接手`,"web.ui.cap.take_over_title":`从下一条消息起由「{role}」来答;当前这段对话一个字都不动`,"web.ui.cap.take_over_on":`正在接手`,"web.ui.cap.take_over_on_title":`「{role}」正在接手接下来的消息 —— 要取消,回到对话里点输入框上那枚 chip 的 ×`,"web.ui.diff.title":`工作区改动`,"web.ui.diff.back":`返回会话`,"web.ui.diff.reload":`重新读`,"web.ui.diff.reload_hint":`再读一遍这个目录 —— 这一屏不会自己刷新`,"web.ui.diff.loading":`正在读…`,"web.ui.diff.failed":`读不到这个会话的工作区改动 —— 这一发没能打到本地服务。`,"web.ui.diff.pick":`左边挑一个文件。`,"web.ui.diff.scope_git":`这里列的是这个目录相对 git HEAD 的全部未提交改动 —— 包括你自己改的、别的程序改的,不只是这段会话。`,"web.ui.diff.status_added":`新增`,"web.ui.diff.status_modified":`修改`,"web.ui.diff.status_deleted":`删除`,"web.ui.diff.note_no_changes":`这个目录没有未提交的改动。`,"web.ui.diff.note_not_a_git_repo":`这个目录不是 git 仓库,所以这里改成列「这段会话经文件工具碰过的路径」。`,"web.ui.diff.note_no_workspace_history":`这个进程手上没有这段会话的文件记录(多半是上一个进程留下的会话),所以列不出改了哪些文件。`,"web.ui.diff.note_no_workspace":`这段会话没有绑工作区,没有目录可看。换目录要新建会话。`,"web.ui.diff.note_truncated":`改动的文件太多,这里只列了前 {count} 个。`,"web.ui.diff.omit_binary":`二进制`,"web.ui.diff.omit_binary_sized":`二进制,{bytes}`,"web.ui.diff.omit_too_large":`太大`,"web.ui.diff.omit_too_large_sized":`太大,{bytes}`,"web.ui.diff.omit_too_large_why":`这个文件超过了单文件 512 KB 的上限,两侧内容都没有取过来 —— 所以这儿画不出 diff,不是「它没改」。`,"web.ui.diff.omit_no_snapshot":`没有改前的样子`,"web.ui.diff.omit_no_snapshot_why":`这个目录不是 git 仓库,而这段会话动它之前的样子没有留底 —— 只知道它被改过,比不出改了哪几行。`,"web.ui.tools.no_session":`还没有会话,所以这张表算不出来 —— 判定要按某一段会话此刻的权限档来算。开一段会话之后再回来。`,"web.ui.tools.loading":`正在读…`,"web.ui.tools.lede":`这一轮发给模型的工具全在这儿:各是哪儿来的、干什么用的、这段会话调了几次,以及此刻谁在挡它。`,"web.ui.tools.axes":`「谁在挡它」按三轴现算:先看权限规则表里不带括号的整条规则,再看权限档,代码执行还要多看一道沙箱。三轴都不看参数 —— 敏感路径和危险命令那一层拦在更前面,只有真调用带着真参数进来才判得出来。所以某一次具体调用会不会被拦,这张表答不了。`,"web.ui.tools.level_line":`按「{level}」这一档算的。这一屏读一次就停了 —— 在输入框那一行换过档之后,得退出这一节再进来才会重算。`,"web.ui.tools.level_unknown":`取不到这段会话的权限档,所以这一次「谁在挡它」那一列算不出来。`,"web.ui.tools.ungraded_no_session":`取不到这段会话的权限档(多半是上一个进程留下的会话),所以下面整张表没有判定,只列工具本身。`,"web.ui.tools.ungraded_no_layer":`这个进程没有把权限判定发下来(权限那一层没起来),所以下面整张表没有判定,只列工具本身。`,"web.ui.tools.g_all":`全部工具`,"web.ui.tools.t_file_read":`读文件`,"web.ui.tools.t_file_write":`写文件`,"web.ui.tools.t_command":`执行命令`,"web.ui.tools.t_network":`访问网络`,"web.ui.tools.t_code_exec":`执行代码`,"web.ui.tools.t_other":`其它`,"web.ui.tools.col_tool":`工具`,"web.ui.tools.col_source":`来源`,"web.ui.tools.col_desc":`说明`,"web.ui.tools.col_gate":`谁在挡它`,"web.ui.tools.col_calls":`调用`,"web.ui.tools.v_allow":`放行`,"web.ui.tools.v_ask":`问一句`,"web.ui.tools.v_deny":`拒绝`,"web.ui.tools.v_depends":`看参数`,"web.ui.tools.v_none":`算不出`,"web.ui.tools.by_none":`没有判定`,"web.ui.tools.by_sandbox":`沙箱隔离`,"web.ui.tools.by_level":`{level} 档`,"web.ui.tools.by_rule":`一条规则`,"web.ui.tools.cond":`另有 {count} 条带参数的规则可能改判`,"web.ui.tools.how_to_block":`要挡住一个工具,就在权限规则表里加一条 deny。规则写进配置文件才算数,这个界面从头到尾不改配置 —— 安全中心那一屏能告诉你现在有哪些规则、各是哪一层加的。`,"web.ui.tools.goto_rules":`去看规则表`,"web.ui.tools.mcp_note":`MCP 服务器带来的工具也在这张表里,名字长这样:mcp__<服务器名>__<工具名>。「来源」那一列写着它是从哪台服务器来的。`,"web.ui.tip.what":`说明`,"web.ui.tip.about":`{name} 的说明`,"web.ui.about.loading":`正在读…`,"web.ui.about.lede":`出问题时把这一屏截下来贴进 issue,比描述现象快。`,"web.ui.about.g_machine":`这台机器`,"web.ui.about.k_version":`版本`,"web.ui.about.version_line":`epoch {version} · Node {node} · {platform}`,"web.ui.about.k_home":`数据目录`,"web.ui.about.home_hint":`会话、配置、日志都在这儿。设 EPOCH_HOME 可以把它整个挪到别处。`,"web.ui.about.k_db":`会话数据库`,"web.ui.about.db_hint":`所有会话的记录都在这一个文件里。它跟着数据目录和 profile 走 —— 换一个 profile 就是换一份互不相干的数据。`,"web.ui.about.k_profile":`Profile`,"web.ui.about.profile_hint":`用 EPOCH_PROFILE 或 --profile 选的。默认那一档不画这一行 —— 它出现在这儿,就说明上面两个路径和别人的不一样。`,"web.ui.about.g_diag":`启动诊断`,"web.ui.about.diag_lede":`这个进程起来的时候自检了这些。侧栏底下只画有问题的那几条,这儿是全部四档。`,"web.ui.about.diag_none":`这个进程一条诊断都没发下来。这不等于「一切正常」—— 自检过的模块即便没事也会记一条 ok。`,"web.ui.about.diag_line":`{module}:{detail}`,"web.ui.about.update_note":`在终端里敲这一条,它会查一次版本,并告诉你该怎么升级:`,"web.ui.auto.title":`自动化`,"web.ui.auto.back":`返回会话`,"web.ui.auto.tab_tasks":`定时任务`,"web.ui.auto.tab_runs":`运行记录`,"web.ui.auto.loading":`正在读…`,"web.ui.auto.dismiss":`知道了`,"web.ui.auto.notice_os":`不需要一直开着 epoch —— 定时任务由系统调度器唤起。但电脑关机、或者用户没登录时到点的那几次会跳过,不会补跑。`,"web.ui.auto.notice_unsupported":`本平台暂不支持把定时任务注册进系统调度器(现阶段只有 Windows 和 macOS)。任务建得出来,但到点了不会自己跑。`,"web.ui.auto.notice_host":`这个应用没有可以被系统调度器唤起的无界面入口。定时任务只在应用开着的时候跑:关掉应用,它们就不跑了。`,"web.ui.auto.empty_title":`开启你的第一个自动化任务`,"web.ui.auto.empty_hint":`到点了让 agent 替你做一件事:巡一遍仓库、汇总这周的 PR、扫一遍过期文档。跑完留下一份能读的东西。`,"web.ui.auto.new":`新建任务`,"web.ui.auto.tpl_use":`用这张模板`,"web.ui.auto.tpl_more":`从模板再加一条`,"web.ui.auto.tpl.repo_sweep.name":`每日仓库巡检`,"web.ui.auto.tpl.repo_sweep.desc":`有哪些分支没合、落后 main 多久了。每天早上一份。`,"web.ui.auto.tpl.repo_sweep.prompt":`巡一遍这个仓库,写一份今天的报告到 ./reports/repo-sweep.md(覆盖同名文件即可):
|
|
10
|
+
|
|
11
|
+
1. 还没合进 main 的本地分支,各自最后一次提交是什么时候、落后 main 多少个提交;
|
|
12
|
+
2. 有没有分支已经合过了但还留着(可以删的);
|
|
13
|
+
3. 工作区有没有没提交的改动。
|
|
14
|
+
|
|
15
|
+
用 git status / git branch / git log 就够。**不要跑 git fetch 或任何会写 .git 的命令**
|
|
16
|
+
—— 授权清单里没有它,而且巡检不该改任何东西。所以「落后多少」按本地已有的引用算,
|
|
17
|
+
报告里说清这一点。最后用三行以内说一句:今天有没有需要我处理的事。
|
|
18
|
+
`,"web.ui.auto.tpl.todo_digest.name":`每日待办摘要`,"web.ui.auto.tpl.todo_digest.desc":`把 todo 清单整理成一段能读的话,每天早上一份。`,"web.ui.auto.tpl.todo_digest.prompt":`读一遍当前的待办清单(todo 工具),写一份摘要到 ./reports/todo-digest.md(覆盖同名文件即可):
|
|
19
|
+
|
|
20
|
+
1. 今天该做的(进行中的 + 排在最前面的几条);
|
|
21
|
+
2. 挂了很久没动的,各自挂了多久;
|
|
22
|
+
3. 已经完成但还没清掉的。
|
|
23
|
+
|
|
24
|
+
**只读不改**:不要新增、完成或删除任何一条待办 —— 那是我的事。
|
|
25
|
+
最后用三行以内说一句:今天最该先做哪一件,为什么。
|
|
26
|
+
`,"web.ui.auto.tpl.weekly_digest.name":`每周 PR 与 issue 汇总`,"web.ui.auto.tpl.weekly_digest.desc":`这一周合了什么、还挂着什么。每周五傍晚一份。`,"web.ui.auto.tpl.weekly_digest.prompt":`汇总这个仓库最近 7 天的 PR 和 issue,写到 ./reports/weekly-digest.md(覆盖同名文件即可):
|
|
27
|
+
|
|
28
|
+
1. 这周合进去的 PR,各一句话说清改了什么;
|
|
29
|
+
2. 还开着的 PR,哪几个在等评审、哪几个在等作者;
|
|
30
|
+
3. 新开的 issue,以及挂了超过两周还没动的。
|
|
31
|
+
|
|
32
|
+
用 gh 命令(gh pr list / gh issue list)或者 github 那台 MCP,哪个能用用哪个。
|
|
33
|
+
两个都用不了的话,**不要改用别的办法猜** —— 在报告里如实写一句「这台机器上取不到
|
|
34
|
+
远端数据」,那比一份编出来的汇总有用。
|
|
35
|
+
`,"web.ui.auto.tpl.dep_checkup.name":`依赖升级体检`,"web.ui.auto.tpl.dep_checkup.desc":`哪些依赖该升了、有没有已知漏洞。每周一上午一份。`,"web.ui.auto.tpl.dep_checkup.prompt":`给这个仓库的依赖做一次体检,写到 ./reports/dep-checkup.md(覆盖同名文件即可):
|
|
36
|
+
|
|
37
|
+
1. 落后的依赖(pnpm outdated),按「主版本 / 次版本 / 补丁」分三组;
|
|
38
|
+
2. 已知漏洞(pnpm audit),按严重程度排;
|
|
39
|
+
3. 挑出三条**最该先升的**,各写一句为什么(安全 > 卡住别的升级 > 只是旧了)。
|
|
40
|
+
|
|
41
|
+
**不要真的升任何东西**:不跑 pnpm update、不改 package.json、不动 lockfile ——
|
|
42
|
+
授权清单里只有查的那几条命令,升级那一下由我来按。
|
|
43
|
+
`,"web.ui.auto.tpl.stale_docs.name":`过期文档扫描`,"web.ui.auto.tpl.stale_docs.desc":`README 里提到的命令和路径还在不在。每月 1 号一份。`,"web.ui.auto.tpl.stale_docs.prompt":`扫一遍这个仓库的文档(README 和 docs/ 下面那些),找出已经不成立的地方,
|
|
44
|
+
写到 ./reports/stale-docs.md(覆盖同名文件即可):
|
|
45
|
+
|
|
46
|
+
1. 文档里提到的命令,在 package.json 的 scripts 里还在不在;
|
|
47
|
+
2. 文档里提到的文件 / 目录路径,盘上还在不在;
|
|
48
|
+
3. 指向仓库内部的相对链接,目标还在不在。
|
|
49
|
+
|
|
50
|
+
这一档是**只读**的:除了那份报告,一个字都不要改 —— 文档怎么改是我的事,
|
|
51
|
+
你的活是把「哪一句现在是假话」找出来,每条带上文件和行号。
|
|
52
|
+
`,"web.ui.auto.tpl.test_flake.name":`测试 flake 复盘`,"web.ui.auto.tpl.test_flake.desc":`跑一遍测试,把不稳定的那几条挑出来。每周三晚上一份。`,"web.ui.auto.tpl.test_flake.prompt":`跑一遍这个仓库的测试,把结果和上一次的报告对一遍,写到
|
|
53
|
+
./reports/test-flake.md(覆盖同名文件即可):
|
|
54
|
+
|
|
55
|
+
1. 这次失败的用例,各自的报错第一行;
|
|
56
|
+
2. 和上一份报告比:这次新红的、上次红这次绿的(**那些就是 flake 嫌疑**);
|
|
57
|
+
3. 挑出最像 flake 的那几条,各写一句猜测(依赖时钟?依赖顺序?依赖外部服务?)。
|
|
58
|
+
|
|
59
|
+
测试可能跑很久,所以这条任务的超时放宽到了 40 分钟。跑不完就**如实写**跑到哪儿了,
|
|
60
|
+
不要为了出一份完整报告去挑着跑一部分然后当成全量。
|
|
61
|
+
`,"web.ui.auto.mark_host":`只在应用开着时跑`,"web.ui.auto.never_run":`还没跑过`,"web.ui.auto.next_none":`不会再触发`,"web.ui.auto.next_at":`下次 {when}`,"web.ui.auto.last_at":`上次 {status} · {when}`,"web.ui.auto.run_now":`先跑一次`,"web.ui.auto.enable":`启用`,"web.ui.auto.disable":`停用`,"web.ui.auto.edit":`编辑`,"web.ui.auto.remove":`删除`,"web.ui.auto.remove_confirm":`删掉「{name}」?系统调度器里那条注册会一起撤掉。运行录像留着。`,"web.ui.auto.form_new":`新建定时任务`,"web.ui.auto.form_edit":`编辑定时任务`,"web.ui.auto.g_what":`做什么`,"web.ui.auto.g_what_note":`到点了让它干的那件事`,"web.ui.auto.g_where":`在哪儿跑`,"web.ui.auto.g_where_note":`不填也能跑,各有一个确定的缺省`,"web.ui.auto.g_when":`什么时候跑`,"web.ui.auto.g_may":`能做什么`,"web.ui.auto.g_may_note":`这一组决定它半夜替你按下哪些「确认」`,"web.ui.auto.g_cost":`花多少`,"web.ui.auto.g_cost_note":`三把尺子,任何一把到顶都停`,"web.ui.auto.required":`必填`,"web.ui.auto.f_name":`名称`,"web.ui.auto.f_prompt":`提示词`,"web.ui.auto.f_prompt_hint":`到点了让 agent 做什么。写清楚做完要留下什么 —— 没人在旁边追问。`,"web.ui.auto.f_workdir":`工作空间(可选)`,"web.ui.auto.f_workdir_note":`不填就跑在 ~/.epoch/automation/<任务 id>/ 里。任何一个终端的当前目录它都不会继承。`,"web.ui.auto.f_workdir_default":`~/.epoch/automation/<任务 id>/`,"web.ui.auto.f_workdir_none":`不指定工作空间`,"web.ui.auto.f_model":`模型(可选)`,"web.ui.auto.f_model_hint":`不填就用配置里那个`,"web.ui.auto.f_model_provider_note":`挑了哪一家就记进这条任务,到点按它跑。⚠️ 到点时这台机器上这一家要是没配 key,它会退回默认模型接着跑,并在运行记录里记一条。`,"web.ui.auto.f_kind":`执行频率`,"web.ui.auto.k_daily":`每天`,"web.ui.auto.k_weekly":`每周`,"web.ui.auto.k_monthly":`每月`,"web.ui.auto.k_interval":`按间隔`,"web.ui.auto.k_once":`只跑一次`,"web.ui.auto.f_at":`时刻`,"web.ui.auto.f_date":`日期`,"web.ui.auto.f_every":`间隔`,"web.ui.auto.f_weekdays":`星期几`,"web.ui.auto.f_days":`几号`,"web.ui.auto.f_days_hint":`1, 15`,"web.ui.auto.f_days_note":`31 号在小月不触发 —— 两个平台的原生行为都是这样。`,"web.ui.auto.f_start":`生效开始(可选)`,"web.ui.auto.f_end":`生效结束(可选)`,"web.ui.auto.f_window_note":`两头都算在内。哪一头不填就是那一头不限。到点了但不在区间里的那几次会记成「跳过(不在生效区间)」,不会补跑。`,"web.ui.auto.f_window_once":`只跑一次的任务不能带生效区间 —— 它自己就是一个日期,所以这两格在这一档下填不了。`,"web.ui.auto.f_permission":`权限档`,"web.ui.auto.f_bypass_ack":`我明白:这个任务将在 {workDir} 里不经确认地做任何事,包括删文件和跑任意命令。`,"web.ui.auto.f_turns":`最多轮次`,"web.ui.auto.f_turns_hint":`一轮里模型最多调用几次工具,1 到 1000。到顶就停下来把话说完。`,"web.ui.auto.f_timeout":`超时(分钟)`,"web.ui.auto.f_timeout_note":`唯一能拦住「一条命令挂住了」的那把尺子。最多 24 小时。`,"web.ui.auto.f_budget":`这一次最多花多少(美元)`,"web.ui.auto.f_budget_why":`必填,而且我们不给默认值:这个任务没人看着,一个假默认会让「一觉醒来 40 美元」变成我们的错。`,"web.ui.auto.save_and_run":`保存并先跑一次`,"web.ui.auto.save_only":`只保存`,"web.ui.auto.cancel":`取消`,"web.ui.auto.blocked_budget":`填一个大于 0 的预算才能保存`,"web.ui.auto.blocked_bypass":`勾上那句确认才能保存`,"web.ui.auto.allow_title":`这个任务将不经确认地做这些事`,"web.ui.auto.allow_lede":`权限档回答「要不要人确认」,这份清单回答「要确认、但没人在,哪几条可以不问」。逐条列出来,是为了让你在保存前看得见。`,"web.ui.auto.allow_off_plan":`「只读」档天然零授权面,不需要清单。⚠️ 这一档判出来的拒绝**不是缺授权**:它不会记成欠条,往清单里加规则也不会有帮助 —— 要放开就换一档。`,"web.ui.auto.allow_off_bypass":`「跳过全部检查」下这份清单没有意义:任务会不经确认地做任何事。留着一份看起来在生效的清单,会让人以为自己还有一道边界。`,"web.ui.auto.allow_ops":`整类操作`,"web.ui.auto.allow_tools":`整个工具(一行一个)`,"web.ui.auto.allow_tools_hint":`terminal`,"web.ui.auto.allow_rules":`规则(一行一条)`,"web.ui.auto.allow_rules_hint":`terminal(git status)
|
|
62
|
+
file_write(./reports/**)
|
|
63
|
+
mcp__github__*`,"web.ui.auto.allow_rules_note":`连接器的免确认写成 mcp__<server>__*;「只许写这个目录」写成 file_write(<目录>/**)。`,"web.ui.auto.allow_scope":`这份清单只对这一条任务生效,不受全局非交互白名单影响。`,"web.ui.auto.reg_warn_source":`注册进去的是这个 checkout 的路径 —— 仓库移动或删除之后,这条任务会失败。`,"web.ui.auto.reg_unsupported":`本平台暂不支持注册定时任务(现阶段只有 Windows 和 macOS),所以它到点了不会自己跑。`,"web.ui.auto.reg_npx":`用 npx 跑的 epoch 不能注册定时任务:它的入口在临时缓存目录里,清一次缓存这条任务就废了。`,"web.ui.auto.reg_no_runner":`这个应用没有可以被系统调度器唤起的无界面入口,所以这条任务只在应用开着的时候跑。`,"web.ui.auto.reg_backend_error":`系统调度器那边报错了:{detail}`,"web.ui.auto.runs_empty_none":`还没有任何运行记录 —— 一条定时任务都还没建。去「定时任务」那个 tab 建一条。`,"web.ui.auto.runs_empty_never":`还没有任何运行记录。到点了它会自己跑;等不及的话,去「定时任务」那边点「先跑一次」。`,"web.ui.auto.run_manual":`手动`,"web.ui.auto.run_meta":`{turns} 轮 · {cost} 美元`,"web.ui.auto.run_orphan":`(任务已删除)`,"web.ui.auto.just_ran":`刚跑完:{status}`,"web.ui.auto.replay_show":`看录像`,"web.ui.auto.replay_hide":`收起录像`,"web.ui.auto.replay_loading":`正在读录像…`,"web.ui.auto.replay_none":`这一次没有录像(没起会话,或者已经被留存上限清掉了)。`,"web.ui.auto.replay_truncated":`这份录像太长,只画了前 {count} 帧。`,"web.ui.auto.pending_header":`有 {count} 条操作本该问你,但当时没人可问(欠条)`,"web.ui.auto.pending_rule":`→ {rule}`,"web.ui.auto.pending_no_rule":`(这一条反推不出精确规则)`,"web.ui.auto.pending_fix":`加进授权清单`,"web.ui.auto.pending_fixed":`✓ 已加 {count} 条:{rules}`,"web.ui.auto.pending_fixed_none":`一条都没加 —— 这几条反推不出精确规则,硬编一条只会往清单里塞个死规则。`,"web.ui.auto.issue.name_empty":`给它起个名字`,"web.ui.auto.issue.prompt_empty":`写清楚到点了让它做什么 —— 一个没有提示词的定时任务什么都不会做`,"web.ui.auto.issue.permission_unknown":`这个权限档不认识:{detail}`,"web.ui.auto.issue.work_dir_missing":`这个目录不存在:{detail}`,"web.ui.auto.issue.budget_missing":`填一个大于 0 的数(现在是 {detail})`,"web.ui.auto.issue.max_turns_invalid":`要是 1 到 1000 之间的整数(现在是 {detail})`,"web.ui.auto.issue.timeout_invalid":`要是正数,而且不超过 24 小时(现在是 {detail} 毫秒)`,"web.ui.auto.issue.trigger_time_invalid":`时刻要写成 HH:mm(现在是 {detail})`,"web.ui.auto.issue.trigger_weekdays_empty":`至少选一天`,"web.ui.auto.issue.trigger_days_invalid":`几号要在 1 到 31 之间({detail})`,"web.ui.auto.issue.trigger_interval_invalid":`这个间隔不行({detail} 分钟)—— 只能是 60 的约数或整小时数,因为 macOS 那侧只能列举时刻,除不尽的间隔在每小时边界上会漂`,"web.ui.auto.issue.trigger_once_date_invalid":`日期要写成 YYYY-MM-DD,而且得是真实存在的一天(现在是 {detail})`,"web.ui.auto.issue.trigger_once_past":`这个时刻已经过去了,存下来也永远不会触发({detail})`,"web.ui.auto.issue.date_range_invalid":`生效区间不对:{detail}`,"web.ui.auto.issue.date_range_on_once":`只跑一次的任务不能带生效区间 —— 它自己就是一个日期`,"web.ui.auto.issue.rule_invalid":`{detail}`,"web.ui.auto.issue.bypass_needs_workdir":`这一档必须绑定一个工作空间 —— 「跳过全部检查」加上一个不确定的目录,就是「无边界」的字面意思`,"web.ui.auto.issue.bypass_workdir_too_broad":`这一档的工作空间不能是家目录或根目录(现在是 {detail})`,"web.ui.auto.issue.bypass_needs_limits":`这一档下预算 / 轮次 / 超时三样都必须有值`,"web.ui.auto.issue.bypass_not_confirmed":`这一档要先勾上那句确认`,"web.route.deny_missing_credential":`缺少凭据:用 epoch web 打印的那条带 ?token= 的地址打开`,"web.route.deny_bad_token":`token 不对。服务每次启动都会换一个,请用最新那条地址`,"web.route.deny_bad_origin":`Origin 不被允许(防 DNS rebinding)`,"web.route.deny_bad_host":`Host 与本服务监听的地址对不上(防 DNS rebinding)`,"web.route.internal_error":`服务端内部错误`,"web.route.static_not_found":`找不到 {path}`,"web.bad_message":`message 必须是非空字符串或 EpochContentPart[]`,"web.session_busy":`会话正在 {state},排队已满,等这一轮结束再发`,"web.bad_outcome":`outcome 必须是 {choices}`,"web.approval_gone":`审批 {id} 已被答复或已失效`,"web.bad_answers":`answers 必须是「问句 → 字符串或字符串数组」的对象。答不上来就发 {json}`,"web.question_gone":`提问 {id} 已被答复或已失效`,"web.artifact_missing":`artifact 不存在`,"web.unknown_session":`没有会话 {id}`,"web.body_too_large":`请求体超过 {limit} 字节`,"web.body_read_failed":`读取请求体失败:{reason}`,"web.body_bad_json":`请求体不是合法 JSON:{reason}`,"web.no_endpoint":`没有这个端点:{method} {path}`,"web.method_not_allowed":`只支持 {allow}`,"web.placeholder_html_lang":`zh-CN`,"web.placeholder_ready":`服务端已就绪,鉴权 cookie 已下发。`,"web.placeholder_no_build":`前端产物尚未构建`,"web.placeholder_needs_build":`{no_build},先跑一次 {cmd}。`,"web.placeholder_rest":`现在可以直接用 REST / SSE:{endpoints}。`,"web.placeholder_endpoint_sep":`、`,"web.bad_port":`端口必须是 0-65535 的整数,收到 {value}`,"web.lan_needs_token":`--host {host} 会把服务暴露到回环之外,必须同时给 --token <随机串>,拒绝启动。`,"web.lan_needs_token_local":`本地使用请去掉 --host(默认只绑 127.0.0.1)。`,"web.lan_needs_token_lan":`真要给局域网用:{cmd}`,"web.listen_in_use":`端口 {port} 已被占用,换一个:epoch web --port {next}`,"web.listen_no_permission":`没有权限监听 {host}:{port}(1024 以下的端口需要管理员权限)`,"web.listen_no_address":`本机没有 {host} 这个地址`,"web.listen_failed":`监听 {host}:{port} 失败:{reason}`,"schedule.list_header":`定时任务:`,"schedule.list_empty":`还没有定时任务。`,"schedule.list_empty_hint":`建一条:epoch schedule add --name "每日巡检" --prompt "…" --daily 09:00 --budget 0.50`,"schedule.col_next":`下次`,"schedule.col_last":`上次`,"schedule.disabled_mark":`已停用`,"schedule.yes":`是`,"schedule.no":`否`,"schedule.field_enabled":`启用`,"schedule.field_trigger":`频率`,"schedule.field_window":`生效区间`,"schedule.field_next":`下次运行`,"schedule.field_workdir":`工作目录`,"schedule.field_model":`模型`,"schedule.field_permission":`权限档`,"schedule.field_limits":`三把尺子`,"schedule.field_backend":`注册在`,"schedule.field_prompt":`提示词`,"schedule.field_last_run":`上次运行:{when}`,"schedule.limits_value":`最多 {turns} 轮 · 最多 {budget} 美元 · 超过 {minutes} 分钟就掐`,"schedule.allowlist_header":`这个任务将不经确认地做这些事:`,"schedule.allowlist_empty":`(清单是空的 —— 撞到需要确认的操作会记一条欠条然后收尾)`,"schedule.allowlist_scope_note":`这份清单只对这一条任务生效,不受全局非交互白名单影响。`,"schedule.allowlist_bypass":`权限档是「跳过全部检查」:清单在这一档下没有意义,任务会不经确认地做任何事。`,"schedule.allowlist_readonly":`权限档是「只读」:天然零授权面,不需要清单。`,"schedule.created":`✓ 已建好并注册:{name}({id})`,"schedule.created_next":`先跑一次看看,缺什么授权当场就知道:epoch schedule run {id}`,"schedule.ask_name":`任务名`,"schedule.ask_prompt":`到点了让 agent 做什么`,"schedule.ask_at":`每天几点跑(HH:mm)`,"schedule.ask_budget":`这一次运行最多花多少美元`,"schedule.ask_permission":`权限档`,"schedule.permission.plan":`只读`,"schedule.permission.default":`按需确认`,"schedule.permission.accept_edits":`自动接受改动`,"schedule.permission.bypass":`跳过全部检查`,"schedule.permission.auto":`自动放行`,"schedule.trigger.daily":`每天 {at}`,"schedule.trigger.weekly":`每周 {days} {at}`,"schedule.trigger.monthly":`每月 {days} 号 {at}`,"schedule.trigger.every_minutes":`每 {n} 分钟`,"schedule.trigger.every_hours":`每 {n} 小时`,"schedule.trigger.once":`{date} {at}(只跑一次)`,"schedule.weekday.sun":`周日`,"schedule.weekday.mon":`周一`,"schedule.weekday.tue":`周二`,"schedule.weekday.wed":`周三`,"schedule.weekday.thu":`周四`,"schedule.weekday.fri":`周五`,"schedule.weekday.sat":`周六`,"schedule.status.ok":`成功`,"schedule.status.failed":`失败`,"schedule.status.denied":`缺授权`,"schedule.status.timeout":`超时`,"schedule.status.budget":`触顶`,"schedule.status.skipped_overlap":`跳过(上一次还在跑)`,"schedule.status.skipped_window":`跳过(不在生效区间)`,"schedule.status.missed":`错过`,"schedule.drift.missing_in_os":`库里有、系统里没有(注册丢了)`,"schedule.drift.orphan_in_os":`系统里有、库里没有(卸载残留)`,"schedule.drift.spec_mismatch":`两边都有但对不上`,"schedule.drift.never_registered":`库里那行说自己注册过,但没有系统侧标识`,"schedule.issue.name_empty":`名字不能是空的`,"schedule.issue.prompt_empty":`提示词不能是空的 —— 一个没有提示词的定时任务什么都不会做`,"schedule.issue.permission_unknown":`权限档不认识:{detail}`,"schedule.issue.work_dir_missing":`工作目录不存在:{detail}`,"schedule.issue.budget_missing":`--budget 必填,而且要是正数(现在是 {detail})`,"schedule.issue.max_turns_invalid":`--max-turns 要是 1 到 1000 之间的整数(现在是 {detail})`,"schedule.issue.timeout_invalid":`--timeout 要是正数且不超过 24 小时(现在是 {detail} 毫秒)`,"schedule.issue.trigger_time_invalid":`时刻要写成 HH:mm(现在是 {detail})`,"schedule.issue.trigger_weekdays_empty":`每周档至少要选一天`,"schedule.issue.trigger_days_invalid":`每月档的日子要在 1 到 31 之间({detail})`,"schedule.issue.trigger_interval_invalid":`间隔只能是 60 的约数或整小时数(现在是 {detail} 分钟)—— 判据是 launchd 那侧只能列举时刻,60 除不尽的间隔在每小时边界上会漂`,"schedule.issue.trigger_once_date_invalid":`日期要写成 YYYY-MM-DD,而且得是真实存在的一天(现在是 {detail})`,"schedule.issue.trigger_once_past":`这个时刻已经过去了,存下来也永远不会触发({detail})`,"schedule.issue.date_range_invalid":`生效区间不对:{detail}`,"schedule.issue.date_range_on_once":`只跑一次的任务不能带生效区间 —— 它自己就是一个日期`,"schedule.issue.rule_invalid":`{detail}`,"schedule.issue.bypass_needs_workdir":`「跳过全部检查」必须绑定一个工作区 —— 它加上一个不确定的目录就是「无边界」的字面意思`,"schedule.issue.bypass_workdir_too_broad":`「跳过全部检查」的工作区不能是家目录或根目录(现在是 {detail})`,"schedule.issue.bypass_needs_limits":`「跳过全部检查」下预算 / 轮次 / 超时三样都必须有值`,"schedule.issue.bypass_not_confirmed":`「跳过全部检查」要显式确认:加 --i-understand-bypass`,"schedule.run_start":`开始跑:{name}`,"schedule.run_meta":`{turns} 轮 · {cost} 美元{manual}`,"schedule.run_manual":` · 手动`,"schedule.fire_missing":`库里没有 {id} 这条任务,什么都没做`,"schedule.fire_disabled":`{id} 已停用,什么都没做`,"schedule.pending_header":`有 {n} 条操作因为没人可问而被拒了(欠条):`,"schedule.pending_line":`{tool} {target}`,"schedule.pending_fix":`加这条规则:{rule}`,"schedule.fix_hint":`把这些加进授权清单,下次到点就不会再卡:epoch schedule run {id} --fix`,"schedule.fix_done":`✓ 已追加 {n} 条规则进授权清单`,"schedule.fix_none":`没有可以自动追加的规则(这几条反推不出精确规则)`,"schedule.startup_pending":`⏰ 「{name}」上次到点没跑成:差 {n} 条授权。补上:epoch schedule run {id} --fix`,"schedule.startup_pending_more":`⏰ 「{name}」上次到点没跑成:差 {n} 条授权(另有 {rest} 条任务也在等)。补上:epoch schedule run {id} --fix`,"schedule.logs_empty":`还没有运行记录。`,"schedule.logs_recording":`── 最近一次的录像({path})`,"schedule.enabled_done":`✓ 已启用:{name}`,"schedule.disabled_done":`✓ 已停用(任务还在系统里,只是停着):{name}`,"schedule.removed":`✓ 已删除并撤掉系统注册:{name}`,"schedule.removed_logs_kept":`运行录像留着,在 {dir}/,要清自己删`,"schedule.doctor_clean":`✓ 查了 {n} 条,库里和系统里对得上`,"schedule.doctor_found":`发现 {n} 处对不上:`,"schedule.doctor_hint":`--repair 按库里那份重新注册(DB 是真源);--prune 撤掉系统里的孤儿`,"schedule.doctor_unsupported":`本平台暂不支持定时任务(现阶段只有 Windows 和 macOS)`,"schedule.doctor_repaired":`✓ 已重新注册:{name}`,"schedule.doctor_repair_failed":`✗ 重新注册失败:{name}({detail})`,"schedule.doctor_pruned":`✓ 已撤掉:{id}`,"schedule.doctor_prune_failed":`✗ 撤不掉:{id}({detail})`,"schedule.err_not_found":`找不到任务 {id}`,"schedule.err_not_found_hint":`用 epoch schedule list 看现有的`,"schedule.err_ambiguous":`{id} 这个前缀命中了多条,写全一点:`,"schedule.err_invalid":`这条任务有问题,一个字都没有保存:`,"schedule.err_no_trigger":`要给一个频率:--daily / --weekly / --monthly / --every / --once`,"schedule.err_many_triggers":`频率只能给一个`,"schedule.err_at_required":`--weekly / --monthly / --once 要配 --at HH:mm`,"schedule.err_weekday":`认不出星期:{value}`,"schedule.err_every":`--every 不认识:{value}`,"schedule.err_every_hint":`只能是这几个(它们同时是两个平台的公共能力):{values}`,"schedule.err_permission":`--permission 不认识:{value}`,"schedule.err_operation":`--allow-operation 不认识:{value}`,"schedule.err_budget":`--budget 要是一个正数:{value}`,"schedule.err_budget_hint":`不给默认值是刻意的:一个假默认会让「一觉醒来 40 美元」变成我们的错`,"schedule.err_missing_flags":`缺必填项,而且这里没有终端可以问`,"schedule.err_missing_flags_hint":`至少要给 --name --prompt --budget 和一个频率(--daily 之类)`,"schedule.err_npx":`用 npx 跑的 epoch 不能注册定时任务 —— 它的入口在临时缓存目录里,清一次缓存这条任务就废了`,"schedule.err_npx_hint":`先 npm i -g @epoch-agent/cli`,"schedule.err_no_host_runner":`这个宿主没有可以被系统调度器唤起的无界面入口,所以定时任务只能在应用开着的时候跑`,"schedule.err_no_host_runner_hint":`要让它在应用关掉之后也跑,宿主要提供 scheduleRunner(见 docs/EMBEDDING.md)`,"schedule.err_platform_unsupported":`本平台暂不支持注册定时任务(现阶段只有 Windows 和 macOS)`,"schedule.err_backend":`系统调度器那边报错了:{detail}`,"schedule.warn_source_entry":`⚠ 注册进去的是这个 checkout 的路径,仓库移动或删除之后这条任务会失败`,"message_part.file":`[文件 {path}]`,"message_part.file_truncated":`[文件 {path},已截断到 {bytes} 字节]`,"message_part.file_binary":`[文件 {path}:二进制文件,未附内容]`,"message_part.file_denied":`[文件 {path}:权限未放行,未附内容]`,"message_part.file_unreadable":`[文件 {path}:读取失败,未附内容]`,"message_part.file_over_limit":`[文件 {path}:超出本条消息的附件上限,未附内容]`,"message_part.file_not_restored":`[文件 {path}:会话恢复后不重读内容,需要就调 file_read]`,"message_part.image":`[图片 {mediaType}]`,"message_part.image_unknown_type":`[图片 未知类型]`,"message_part.session":`[引用会话「{name}」]`,"message_part.session_counted":`[引用会话「{name}」·当前面 {count} 条]`,"message_part.session_counted_of_total":`[引用会话「{name}」·当前面 {count} / 共 {total} 条]`,"message_part.session_invalid_reference":`[引用会话「{name}」未附内容:没找到唯一匹配的会话]`,"message_part.session_self_reference":`[引用会话「{name}」未附内容:引用的是当前这段会话]`,"message_part.session_too_many":`[引用会话「{name}」未附内容:超过一条消息能引用的会话个数]`,"message_part.session_not_authorized":`[引用会话「{name}」未附内容:这段会话不在可读范围里]`,"message_part.session_budget_exceeded":`[引用会话「{name}」未附内容:本条消息的附件总量已用满]`,"message_part.session_not_restored":`[引用会话「{name}」未附内容:会话恢复后不重读,需要就调 session_search]`,"approval.plan_head":`▣ 模型交了一份计划,等你批`,"approval.plan_previous_level":` 进入 plan 模式前的权限级别: {level}`,"approval.asks":`⚠️ {tool} 请求{what}`,"approval.target":` 目标: {target}`,"approval.target_none":`(无)`,"approval.detail":` 详情: {detail}`,"approval.reason":` 原因: {reason}`,"approval.headless_allowed":`[已放行] headless 预授权: {tool} {target}`,"approval.headless_denied":`[已拒绝] 非交互环境无法确认: {tool} {target}`,"approval.headless_denied_hint":`如需放行,加 --allow-tool {tool}、在 config.yaml 里配 headless.allowTools,或在 ~/.epoch/policies/ 加策略规则。`,"approval.ask":`是否允许?`,"approval.allow_always_cli":`永久允许(写入 approvals.json)`,"approval.plan_execute_back":`{label}(权限回到 {level})`,"approval.plan_ask":`这份计划?`,"approval.plan_revise_ask":`要改什么?`,"approval.plan_execute":`批准并执行`,"approval.plan_readonly":`批准,但保持只读`,"approval.plan_revise":`让我改一下`,"approval.deny":`拒绝`},en:{"web.session_store_unavailable":`session persistence is unavailable (SQLite did not start); this action cannot be performed`,"web.title_required":`title must be a non-empty string`,"web.session_cooled":`this session was cooled down (too many active sessions); reopen it and send again`,"web.session_unavailable":`cannot create a new session: this process has no usable model provider (configure an API key and retry, or run epoch model)`,"web.session_unknown_role":`no agent named "{role}" — the list on the capabilities page may be stale; refresh and pick again`,"web.workspace_must_be_string":`workspace must be a non-empty string (an absolute path on the server); omit the field entirely to bind no workspace`,"web.workspace_locked":`this session is already bound to a workspace and cannot be changed ({detail}). Start a new session to use another directory — switching mid-session would make the relative paths in earlier tool calls point at a different directory, with nothing in the record saying where the switch happened`,"web.workspace_not_live":`this process does not hold that session, so it cannot say where it is bound — workspace bindings live in process memory and are never persisted (bring the session back into this process to get an answer)`,"web.workspace_bind_both":`give either root or none, not both: the first means "bind to this directory", the second means "explicitly use no workspace" — they are mutually exclusive`,"web.workspace_bind_neither":`give either root (an absolute path on the server) or none: true (explicitly use no workspace)`,"web.workspace_already_decided":`this session's workspace is already settled (either bound to a directory or explicitly set to none) and cannot be changed — start a new session to use another directory`,"web.workspace_turn_running":`this turn is still running, so the workspace cannot be picked yet — try again once it finishes (switching roots mid-turn would resolve relative paths against two different directories)`,"web.workspace_defer_with_root":`give either workspace or deferWorkspace, not both: the first means "bind it at creation time", the second means "create it now and pick the directory later"`,"web.workspace_defer_needs_create":`deferWorkspace requires create: true — a request without create means "give me the existing session", whose workspace was settled at assembly time`,"web.dirs_denied":`no permission to list this directory: {path} (it is there, but this server process cannot read it)`,"web.dirs_missing":`no such path: {path}`,"web.dirs_not_absolute":`the directory to list must be an absolute path: {path} — there is no "current directory" on this route`,"web.dirs_not_a_directory":`that is a file, not a directory: {path} (pick the directory it lives in)`,"web.mkdir_exists":`that directory already exists: {path} — pick another name, or go back to the list and select it ("New" never reuses an existing directory)`,"web.mkdir_denied":`no permission to create a directory here: {path}`,"web.mkdir_parent_missing":`the parent directory does not exist, so {path} cannot be created — create it first (this route never creates parents for you)`,"web.mkdir_parent_not_absolute":`the location to create in must be an absolute path: {parent}`,"web.mkdir_bad_name":`the directory name must be a single segment with no path separators, and cannot be . or ..: {name}`,"web.mkdir_failed":`could not create that directory: {path}`,"web.pick_prompt":`Choose a workspace directory`,"web.pick_unavailable":`this machine cannot open a system directory dialog: it is only enabled when the server and the browser are on the same machine (loopback bind, not started over ssh, macOS or Windows) — use the built-in browser instead`,"web.pick_busy":`a directory dialog is already open — go answer it (this window may be covering it)`,"web.pick_failed":`the system directory dialog could not be opened: {detail}`,"web.plan_mode_unavailable":`this process has no plan mode (the permission layer did not start)`,"web.plan_mode_bad_action":`action must be one of {actions}`,"web.permission_unavailable":`this process has no permission layer, so the level cannot be changed (what you see is the value from the config file)`,"web.permission_bad_level":`level must be one of {levels}`,"web.approval_cache_bad_id":`id must be a non-empty string (use the id carried by the row in the list)`,"web.rewind_not_live":`this process does not hold that session, so it cannot be rewound — a rewind has to come from the process running it (bring the session back first)`,"web.rewind_bad_turn":`turnIndex must be a non-negative integer (take it from the checkpoint list)`,"web.rewind_bad_scope":`scope must be one of {scopes}`,"web.rewind_bad_overwrite":`overwrite must be a list of file paths (the ones the user confirmed one by one); omit the field entirely if there is nothing to overwrite`,"web.rewind_no_checkpoint":`no checkpoint for turn {turn}`,"web.settings_write_bad_request":`the body needs key (the dotted path of the setting), layer (one of {layers}) and value (string / number / boolean)`,"web.settings_write_unknown_key":`that key cannot be written this way: either it is not on the writable list at all (the fallback chain, for one — it is an ordered chain, not a scalar), or the key only writes to the user layer while the request asked for project-local. The project layers accept permissions / model / maxTurns only; anything else lands as an "unknown setting" in the startup diagnostics`,"web.settings_write_bad_value":`that value is outside this setting's domain (maxTurns must be a positive integer, for one), so nothing was written`,"web.settings_write_unwritable":`this layer does not recognise how {path} is written (or the file is already broken), so it was left alone — please edit that file yourself`,"web.settings_write_io":`writing {path} failed: possibly no write permission, or the directory could not be created`,"web.model_bad_request":`model must be a non-empty string (a model name, or provider/model); pass null to go back to the configured one`,"web.mcp_unknown_server":`This process has no MCP server named "{name}" — connections are built from mcp.json at startup, so the list you are holding may be stale. Refresh and look again.`,"web.skill_unknown":`No skill named "{name}" — the capability page list may be stale. Refresh and look again.`,"web.provider_unknown":`No provider named "{name}" is supported — the selectable set is a fixed list, so the one you are holding may be stale. Refresh and look again.`,"web.provider_key_not_applicable":`{name} does not use an API key — one stored here would never be read, and that provider already works as is`,"web.provider_key_empty":`No key received — paste it into the box and save. (There is no way to revoke an already-stored key from here yet; delete it from ~/.epoch or your keychain.)`,"web.mcp_add_lan_exposed":`MCP servers cannot be added in this mode — the server was bound outside the loopback interface with --host, so we cannot tell whether the browser sending this request is on this machine. Adding one writes "which executable to launch" into mcp.json; that server is started right away, and every future epoch run on this machine (including the CLI and the TUI) starts it too. Two ways forward: edit that file directly on the machine running the server, or drop --host and restart.`,"web.mcp_add_bad_transport":`Transport must be one of stdio / sse / http`,"web.mcp_add_bad_name":`The server name "{name}" cannot be used — it becomes part of the tool name verbatim, so only names starting with a letter or digit and made of letters, digits, _ and - are accepted (48 max). A hand-written mcp.json is not subject to this; only names added from the UI are.`,"web.mcp_add_taken":`There is already an MCP server named "{name}" (it may be in your mcp.json, or it may come from the host or a plugin) — pick another name. Nothing is overwritten and nothing is auto-renamed here: overwriting would delete the block you wrote by hand, and renaming would make the tool names disagree with what you typed.`,"web.mcp_add_unwritable":`Nothing was written to mcp.json — {detail}. Go and look at that file first.`,"web.mcp_config_lan_exposed":`mcp.json can neither be viewed nor edited in this mode — the server was bound outside the loopback interface with --host, so we cannot tell whether the browser sending this request is on this machine. Environment variables in that file are stored in cleartext (they may hold secrets), and the same file decides which executable gets launched. Two ways forward: edit that file directly on the machine running the server, or drop --host and restart.`,"web.mcp_config_unreadable":`mcp.json could not be read — {detail}. Go and look at that file first.`,"web.mcp_config_bad_body":`This request body is wrong: text and revision must both be strings, and revision must be the one from the last read.`,"web.mcp_config_stale":`Nothing was written — the mcp.json on disk is no longer the one you read (your own editor may have just saved it, or the "Add server" form may have just inserted one). Writing over it would erase that change, so this stopped here: read it again and see what is on disk now.`,"web.mcp_config_unwritable":`Nothing was written to mcp.json — {detail}. Go and look at that file first.`,"web.mcp_config_no_servers":`Nothing was touched — the mcp.json on disk parses to zero servers and it comes with diagnostics: {detail}. Applying that would disconnect every MCP server you have, so this stopped here. The most common cause is writing the key as mcpServers instead of servers. If you really do want an empty list, write "servers": {} and press again.`,"web.role_add_lan_exposed":`Identities cannot be created in this mode — the server was bound outside the loopback interface with --host, so we cannot tell whether the browser sending this request is on this machine. The body of an identity enters the context of every future turn (and its description enters the tool description of every delegation), so this path is only open under the default loopback binding. Two ways forward: go to the machine running the server and put a .md file in ~/.epoch/agents/, or drop --host and restart.`,"web.role_add_bad_field":`That field cannot be accepted: {detail}`,"web.plugin_write_lan_exposed":`Plugins cannot be installed in this mode — the server was bound outside the loopback interface with --host, so we cannot tell whether the browser sending this request is on this machine. A plugin bundle may carry hooks.json and mcp.json, and those two do start subprocesses on this machine (from the next launch onwards), so this path is only open under the default loopback binding. Two ways forward: run epoch plugin install on the machine running the server, or drop --host and restart.`,"web.plugin_not_available":`This interface has no plugin path — the program embedding this engine did not preset any plugin marketplace, so there is no list of "what can be installed" to pick from. Plugins can still be installed, just from the command line: epoch plugin marketplace add to add a marketplace, then epoch plugin install.`,"web.schedule_store_unavailable":`Scheduled tasks cannot be read — the database file that holds them (sessions.db in your home directory) failed to open this time, so nothing in this area works right now. The tasks themselves are not lost; they are still in that file. The usual causes are a full disk, wrong permissions on that file, or a directory sitting at that exact path. The Schedules line in the startup diagnostics says which one it was.`,"web.schedule_unknown":`No scheduled task with id {id} — the list you are holding may be stale (another tab or the command line may have deleted it). Refresh and look again.`,"web.schedule_run_unknown":`This task has no run {runId} in its history — run history is capped (the most recent 20 per task), and older ones get pruned.`,"web.schedule_bad_field":`The {field} field has the wrong type (this JSON is unreadable — it is not that the value is unreasonable).`,"web.schedule_bad_permission":`Unknown permission level — this route only accepts the levels on the permission pill.`,"web.schedule_bad_trigger":`Cannot read this trigger: kind must be cron / interval / once, and each one must carry its own fields.`,"web.schedule_bad_operation":`allowOperations contains an unrecognised operation type. Only these are accepted: {types}`,"web.schedule_create_incomplete":`Creating a scheduled task needs at least these five: name / prompt / permission / trigger / maxBudgetUsd.`,"web.schedule_budget_required":`maxBudgetUsd is required and has no default — a fake default would make "woke up to $40" our fault.`,"web.schedule_fix_needs_run":`runId is required: the IOUs hang off one particular run, and the rules are read from that row in the database (rules echoed back in the request body are not accepted).`,"web.goal_store_unavailable":`This machine has no goal store (the session database did not come up) — a goal is persisted state, so one that is created and then lost is worse than none. The whole panel is withheld. Check the session-database line in diagnostics.`,"web.goal_bad_objective":`objective must be a string (this JSON is unreadable — it is not that the sentence is unreasonable). An empty string is accepted; the engine answers that case with empty-objective.`,"web.goal_bad_rounds":`maxRounds must be an integer (half a round does not exist). The range is not checked here — outside 1..999 the engine answers bad-budget.`,"web.goal_bad_action":`Unknown action "{action}". This route only accepts: {known} — clearing a goal goes through DELETE, and reporting "blocked" is not on this route at all (that belongs to the model and the policy layer).`,"web.goal_bad_evidence":`evidence must be a string — an empty string is accepted; "if you cannot state the evidence, it is not done" is a judgement the engine makes with empty-evidence.`,"web.reference_store_unavailable":`This machine has no session database (SQLite did not come up), so no historical session can be referenced`,"web.file_candidates_no_workspace":`This session has no workspace bound, so no file list can be offered — pick a directory from the bar under the input box first`,"web.file_list_unavailable":`The workspace file list could not be produced (no .git and not a readable directory), so completion is unavailable — typing the path still attaches the file`,"web.file_view_no_workspace":`This session has no workspace bound, so no file can be shown — pick a directory from the bar under the input box first`,"web.file_view_missing_path":`No file was named (path is missing)`,"web.file_view_denied":`That file is outside the workspace, or a permission rule blocks it — what the model cannot read is not readable here either`,"web.file_view_missing":`That file is no longer there`,"web.file_view_not_a_file":`That is a directory, not a file`,"web.file_view_unreadable":`That file could not be read (permission bits, a write in progress, or a disk problem)`,"web.file_view_too_large":`That file is too large to view in place (limit {max} bytes) — open it with the default app, or download it`,"web.file_view_not_text":`That is not a text file, so there is no body to fetch — images, PDFs and media go through the bytes route`,"web.file_open_extension_not_allowed":`That kind of file is not handed to a system app — code and text are viewable in place, and "opening" an archive would extract it`,"web.file_open_not_same_machine":`This browser is not on the machine running the server, so any window would open on someone else screen`,"web.file_open_launch_failed":`The system app did not start`,"web.ui.conn.connecting":`Connecting`,"web.ui.conn.open":`Connected`,"web.ui.conn.reconnecting":`Reconnecting`,"web.ui.conn.closed":`Disconnected`,"web.ui.topbar.untitled":`Untitled session`,"web.ui.topbar.resyncing":`Catching up`,"web.ui.topbar.inspector":`Inspector`,"web.ui.topbar.sidebar":`Sessions sidebar`,"web.ui.topbar.model_not_live":`This session is not running in this process; the name here is the default model for this launch — it may not be the one it actually used.`,"web.ui.model.label":`Model this session is using right now`,"web.ui.model.trigger":`{model} — open to switch model`,"web.ui.model.current":`{provider} · in use`,"web.ui.model.reset":`Back to the configured one`,"web.ui.model.placeholder":`Type a model name, then Enter`,"web.ui.model.rej_no_credential":`no usable credential for {provider}, cannot switch. Set {env}, or run epoch model to configure it`,"web.ui.model.rej_no_credential_bare":`no usable credential for {provider}, cannot switch. Run epoch model to configure it`,"web.ui.model.rej_images":`{model} does not read images, and this session already has some. Switching does not clear the context, so the next turn would be rejected by the provider`,"web.ui.model.rej_context":`context is already at {used}, past the {model} window ({window}). Start a fresh session, or pick a model with a bigger window`,"web.ui.model.cav_context_tight":`switched, but context is already at {used} — close to the {model} window ({window}), so it may not last many turns`,"web.ui.model.cav_no_tools":`switched, but {model} does not support tool calls — it can only chat, and cannot read or write files`,"web.ui.model.pick_provider":`Provider`,"web.ui.model.pick_provider_none":`Pick one…`,"web.ui.model.pick_model":`Model name`,"web.ui.model.suggest_open":`See which models were found`,"web.ui.model.provider_no_key":`{label} (no key configured)`,"web.ui.model.probe_probing":`Asking {provider} which models it has… no need to wait — you can just type one above.`,"web.ui.model.probe_no_key":`No key configured for {provider}, so its model list cannot be fetched. Set {env}, or run epoch model.`,"web.ui.model.probe_no_key_bare":`No key configured for {provider}, so its model list cannot be fetched. Run epoch model to set one up.`,"web.ui.model.probe_no_key_here":`No key configured for {provider}, so its model list cannot be fetched — fill in the API Key box above.`,"web.ui.model.key_goto":`Configure it in settings`,"web.ui.model.probe_failed_cache":`Could not reach {provider} (network / bad key / that base URL has no /models). Below is what was fetched last time, which may be stale — you can also just type a name.`,"web.ui.model.probe_failed_static":`Could not reach {provider} (network / bad key / that base URL has no /models). Below is the built-in list, which may be stale — you can also just type a name.`,"web.ui.model.probe_empty":`{provider} returned no model names at all, and the built-in list is empty too — just type one.`,"web.ui.model.probe_ok":`Got {count} from {provider}`,"web.ui.model.suggest_note":`These are fetched suggestions, not the full set — new or self-hosted models will not be here. You can still just type one.`,"web.ui.model.refresh":`Re-fetch`,"web.ui.model.refresh_hint":`Bypass the cache and ask this provider again`,"web.ui.model.key_label":`API Key`,"web.ui.model.key_placeholder":`Paste a key here`,"web.ui.model.key_save":`Save key`,"web.ui.model.key_saving":`Saving key…`,"web.ui.model.key_show":`Show`,"web.ui.model.key_hide":`Hide`,"web.ui.model.key_has":`Configured: {hint} ({env}). Saving a new one overwrites it.`,"web.ui.model.key_none":`This key goes into the system keychain when one is available, otherwise into ~/.epoch/.env (mode 0600). It is stored as {env}.`,"web.ui.model.key_saved_secure":`Stored in {backend} (encrypted). The model list has been re-fetched with the new key.`,"web.ui.model.key_saved_plain":`⚠️ The system keychain was unavailable, so this key was stored in plaintext at {path} (mode 0600). Anyone who can read that file on this machine has the key.`,"web.ui.newsession.open":`New session`,"web.ui.dirpick.back":`Back`,"web.ui.dirpick.anchors":`Common places`,"web.ui.dirpick.anchors_detail":`Home, the server process directory, and workspaces you have visited`,"web.ui.dirpick.up":`Up one level`,"web.ui.dirpick.back_last":`Back where you were`,"web.ui.dirpick.loading":`Loading…`,"web.ui.dirpick.empty":`No subdirectories here — pick this one, or type a path below`,"web.ui.dirpick.omitted":`{count} more not listed at this level (1000 max per level) — type a path below to reach them`,"web.ui.dirpick.show_hidden":`Show hidden directories (starting with .)`,"web.ui.dirpick.show_hidden_count":`Show hidden directories (starting with ., {count} here)`,"web.ui.dirpick.unreadable":`no permission to enter this directory: {path}`,"web.ui.dirpick.into_of":`Enter {name} ({path})`,"web.ui.dirpick.use":`Use {name}`,"web.ui.dirpick.use_here":`Use this folder`,"web.ui.dirpick.use_here_of":`Use this folder: {path}`,"web.ui.dirpick.known":`visited`,"web.ui.dirpick.manual_label":`Or type an absolute path`,"web.ui.dirpick.manual_hint":`e.g. /Users/you/work/repo`,"web.ui.dirpick.manual_go":`Use this`,"web.ui.dirpick.new_label":`Create a directory here`,"web.ui.dirpick.new_hint":`e.g. my-project`,"web.ui.dirpick.new_go":`Create`,"web.ui.dirpick.new_trust_note":`A new directory is treated exactly like an existing one: untrusted — its .epoch/settings.json and CLAUDE.md will not take effect. Run epoch trust add to grant trust.`,"web.ui.blank.title":`What would you like to do?`,"web.ui.blank.cards":`Suggestions`,"web.ui.sidebar.search":`Search sessions`,"web.ui.sidebar.automation":`Automation`,"web.ui.sidebar.automation_pending":`{count} scheduled tasks are missing a grant; they will stall again on the next run`,"web.ui.sidebar.settings":`Settings`,"web.ui.sidebar.host_menu":`Host menu`,"web.ui.sidebar.cost":`Spend`,"web.ui.sidebar.cost_of":"~${spent} / ${limit}","web.ui.sidebar.cost_est":`Estimate`,"web.ui.sidebar.tasks":`Background tasks`,"web.ui.sidebar.tasks_of":`{running} running / {total}`,"web.ui.sidebar.diagnostic":`{module}: {detail}`,"web.ui.slist.tasks":`Tasks`,"web.ui.slist.spaces":`Spaces`,"web.ui.slist.unknown":`Earlier sessions`,"web.ui.slist.unknown_hint":`This process can't say where these worked — not that they have none`,"web.ui.slist.awaiting":`Needs you`,"web.ui.slist.running":`Running`,"web.ui.slist.updated_at":`Last active`,"web.ui.slist.count":`{count} sessions`,"web.ui.slist.new_in_space":`New session in “{name}”`,"web.ui.slist.empty":`No sessions yet`,"web.ui.slist.no_match":`No matching sessions`,"web.ui.slist.acts":`Actions for “{title}”`,"web.ui.slist.rename":`Rename`,"web.ui.slist.rename_label":`Session title`,"web.ui.slist.rename_do":`Save title`,"web.ui.slist.delete":`Delete session`,"web.ui.slist.delete_ask":`Delete “{title}”?`,"web.ui.slist.delete_what":`Its conversation, its checkpoints and its workspace binding all go, and none of it comes back — the files it changed stay on disk, but they can no longer be rewound.`,"web.ui.slist.delete_running":`It has a turn running right now; deleting aborts that turn.`,"web.ui.slist.delete_awaiting":`{count} request(s) are still waiting on you; deleting abandons them rather than denying them.`,"web.ui.slist.delete_do":`Delete`,"web.ui.slist.cancel":`Cancel`,"web.ui.slist.err_gone":`That session is already gone.`,"web.ui.slist.err_title":`The title cannot be empty.`,"web.ui.slist.err_no_store":`The session store on this machine did not start, so sessions cannot be renamed or deleted.`,"web.ui.inspector.patch":`Patch`,"web.ui.inspector.output":`Output`,"web.ui.inspector.artifact":`Artifacts`,"web.ui.inspector.plan":`Plan`,"web.ui.inspector.goal":`Goal`,"web.ui.inspector.no_patch":`No file changes in this turn yet`,"web.ui.inspector.locate":`Locate`,"web.ui.inspector.locate_folded":`That row is not on the timeline right now — most likely a fold bar has it collapsed. Expand that section and this button works.`,"web.ui.output.title":`Background tasks`,"web.ui.output.loading":`Loading tasks…`,"web.ui.output.empty":`This session has no background tasks right now`,"web.ui.output.st_running":`Running`,"web.ui.output.st_exited":`Finished, exit code {code}`,"web.ui.output.st_killed":`Stopped`,"web.ui.output.st_failed":`Failed to start`,"web.ui.output.st_closed":`Closed`,"web.ui.output.st_reaped":`Reclaimed after idle timeout — everything inside it is gone`,"web.ui.output.kind_shell":`persistent session`,"web.ui.output.kind_agent":`sub-agent`,"web.ui.output.dur":`{value} elapsed`,"web.ui.output.out_bytes":`{bytes} of output`,"web.ui.output.no_output":`This task has produced no output yet`,"web.ui.output.omitted":`Only the tail is shown; {bytes} before it were not sent.`,"web.ui.output.truncated":`This task’s output went over the cap, so the beginning was dropped — it is gone, here and everywhere else.`,"web.ui.output.sampled":`For tasks still running this is a single sample: it is re-read when the turn state changes, so anything produced in between waits for the next read.`,"web.ui.art.files":`Workspace changes`,"web.ui.art.files_note":`Files this session created or modified in the workspace.`,"web.ui.art.files_empty":`This session has not changed any file in the workspace`,"web.ui.art.no_space":`This session has no workspace, so there are no workspace changes to show. Sessions left over from a previous process land here too — workspace binding only lives in process memory.`,"web.ui.art.loading":`Loading the list…`,"web.ui.art.thin":`Rows replayed after a refresh only carry the path and the write count: file contents are not persisted, so they cannot be opened.`,"web.ui.art.created":`created`,"web.ui.art.changed":`changed`,"web.ui.art.lines":`{count} lines`,"web.ui.art.writes":`written {count} times`,"web.ui.art.tools":`Tool artifacts`,"web.ui.art.tools_note":`Binaries produced by tools: screenshots, audio, downloads.`,"web.ui.art.tools_empty":`None in this turn. Today only MCP tools produce them (image / audio / resource.blob).`,"web.ui.art.tool_gate":`They pass four gates before entering the context: capability, size, spooling, cost. On a model that takes no images, falling back is the main path — files are still listed here, but only a sentence about them reaches the model.`,"web.ui.art.back":`Back to list`,"web.ui.art.readonly":`read-only`,"web.ui.art.copy_path":`Copy path`,"web.ui.art.by_created":`created by {tool}`,"web.ui.art.by_changed":`changed by {tool}`,"web.ui.art.kind_binary":`binary`,"web.ui.art.kind_charset":`encoding unknown`,"web.ui.art.opaque_binary":`This looks like binary: it carries NUL bytes, or unprintable characters take up a large share of it. Laid out as text it is a screenful of replacement characters, so the content is not shown here.`,"web.ui.art.opaque_charset":`This content is not UTF-8 — it may be GBK, UTF-16 or another encoding, and it may just as well be binary. The raw bytes never reach the browser (a patch frame carries an already-decoded string), so which one it is cannot be told from here. Not knowing means not guessing, and not drawing it.`,"web.ui.art.lossy":`{count} byte sequences did not decode. This file is most likely not UTF-8, and the original text at those spots is gone for good.`,"web.ui.art.clip_lines":`Only the first {shown} lines are shown; this file has {total} lines.`,"web.ui.art.clip_chars":`Cut off on line {line} — that line is too long. This file has {total} lines.`,"web.ui.art.binary_note":`These files cannot be viewed here — open them with the program your system uses.`,"web.ui.file.loading":`Opening…`,"web.ui.file.denied":`That file is outside the workspace, or a permission rule blocks it — what the model cannot read is not viewable here either.`,"web.ui.file.missing":`That file is no longer there.`,"web.ui.file.not_a_file":`That is a directory, not a file.`,"web.ui.file.too_large":`That file is too large to view here.`,"web.ui.file.unreadable":`That file could not be read.`,"web.ui.file.no_answer":`The server gave no answer for that path.`,"web.ui.file.no_session":`No session yet, so no file can be shown.`,"web.ui.file.opaque":`The browser cannot render this kind of file. Open it with the default app on your machine, or download it.`,"web.ui.file.open_with_app":`Open with default app`,"web.ui.file.download":`Download`,"web.ui.plan.empty":`No approved plan in this session yet`,"web.ui.plan.empty_hint":`A plan the model hands in has to be approved once on the panel above the composer; only the approved one stays here.`,"web.ui.plan.loading":`Loading the plan…`,"web.ui.plan.note":`This is the one currently in effect — a revised plan replaces it wholesale, no history is kept here. To see how it evolved, look for the exit_plan_mode calls on the timeline.`,"web.ui.goal.loading":`Loading the goal…`,"web.ui.goal.empty":`No goal in this session yet`,"web.ui.goal.empty_hint":`A goal answers "what counts as done for this task, and how many rounds may it spend". It earns its keep on long tasks — especially the ones you walk away from: running out of budget leaves a record of where it got stuck, instead of just "the model stopped talking".`,"web.ui.goal.phase_active":`Running`,"web.ui.goal.phase_paused":`Paused — rounds are not advancing, the goal is kept`,"web.ui.goal.phase_blocked":`Blocked`,"web.ui.goal.phase_complete":`Complete`,"web.ui.goal.rounds":`{used} / {max} rounds`,"web.ui.goal.rounds_hint":`One round = one message from you that was accepted. The model may make twenty requests under a single message; that still counts as one round.`,"web.ui.goal.evidence":`Evidence`,"web.ui.goal.objective_label":`Goal`,"web.ui.goal.objective_hint":`Write one sentence for "what counts as done", e.g. wire the inspector to background task output, with pnpm check green`,"web.ui.goal.budget_label":`Budget`,"web.ui.goal.budget_hint":`Leave empty for {n} rounds (max {max})`,"web.ui.goal.budget_warn":`Lowering it below the rounds already used turns the goal into "blocked" right away — that is deliberate: this route is also how you say "that is far enough". The other way round, adding budget to a goal that ran out lets it carry on immediately.`,"web.ui.goal.evidence_label":`Evidence`,"web.ui.goal.evidence_hint":`On what grounds is this done? If you cannot say, it is not done.`,"web.ui.goal.act_edit":`Reword`,"web.ui.goal.act_budget":`Budget`,"web.ui.goal.act_pause":`Pause`,"web.ui.goal.act_resume":`Resume`,"web.ui.goal.act_complete":`Mark done`,"web.ui.goal.act_clear":`Clear`,"web.ui.goal.save_create":`Set this goal`,"web.ui.goal.save_edit":`Save wording`,"web.ui.goal.save_budget":`Save budget`,"web.ui.goal.save_complete":`Mark complete`,"web.ui.goal.cancel":`Cancel`,"web.ui.goal.refuse.busy":`There is already an unfinished goal. A session has exactly one goal at a time — either reword the current one, or clear it before creating another.`,"web.ui.goal.refuse.no_goal":`This session has no goal right now — set one first.`,"web.ui.goal.refuse.empty_objective":`A goal cannot be empty. Write one sentence for "what counts as done"; one sentence is enough.`,"web.ui.goal.refuse.objective_too_long":`That goal is too long (limit {chars} characters). It is a **completion criterion**, not the plan itself — the steps belong in the "Plan" tab.`,"web.ui.goal.refuse.bad_budget":`The budget must be a whole number between 1 and {max}.`,"web.ui.goal.refuse.bad_block_code":`A block code must be kebab-case (like needs-approval) — it is a routing key for programs, not a sentence.`,"web.ui.goal.refuse.empty_block_message":`Reporting "blocked" must also say what is blocking it — a code alone means nothing to a human.`,"web.ui.goal.refuse.empty_evidence":`Marking a goal done requires evidence. If you cannot state it, it is not done.`,"web.ui.goal.refuse.wrong_phase":`That cannot be done in the current state. A completed goal is frozen (clear it and set a new one); a goal that ran out of budget needs more budget before it can resume.`,"web.ui.goal.refuse.unavailable":`Nothing was written — the goal store is unavailable (something is wrong with the session database). Check the diagnostics at the bottom of the sidebar.`,"web.ui.banner.dismiss":`Got it`,"web.ui.banner.session_gone":`This conversation is gone on the server — most likely it restarted, and a restart starts a fresh session. This one is not coming back, but you can pick up in the new one.`,"web.ui.banner.session_gone_open":`Go to the current session`,"web.ui.banner.session_gone_stuck":`This conversation is gone on the server.`,"web.ui.thread.thinking_label":`Reasoning`,"web.ui.thread.head_estimate":`expected {tokens} tokens`,"web.ui.thread.head_est_badge":`estimate`,"web.ui.thread.live_thinking":`Thinking`,"web.ui.thread.live_running":`Generating a reply`,"web.ui.thread.live_tool":`Running a tool`,"web.ui.thread.live_waiting":`Waiting for the model`,"web.ui.thread.live_approval":`Waiting for your decision`,"web.ui.thread.live_question":`Waiting for your answer`,"web.ui.thread.live_aborting":`Stopping…`,"web.ui.thread.live_spent":`{tokens} tokens so far`,"web.ui.thread.queued":`{count} queued`,"web.ui.thread.stop":`Stop`,"web.ui.thread.fold_tools":`{count} calls`,"web.ui.thread.fold_files":`{count} files`,"web.ui.thread.fold_thoughts":`{count} thoughts`,"web.ui.thread.fold_show":`Show`,"web.ui.thread.fold_hide":`Hide`,"web.ui.thread.gate":`{tool} is stopped here waiting for your decision. The chain below cannot pass this gate until then.`,"web.ui.thread.tool_pending":`Running`,"web.ui.thread.tool_done":`Done`,"web.ui.thread.tool_error":`Failed`,"web.ui.thread.art_in":`In the model context`,"web.ui.thread.art_out":`Not in the model context`,"web.ui.thread.art_unknown":`This stream does not say whether it entered the context`,"web.ui.thread.art_tokens":`≈{count} tokens`,"web.ui.thread.art_out_note":`The model only received the line below; it never got the artifact itself.`,"web.ui.thread.art_unknown_note":`The gate verdict is not carried on this stream, so this is not guessing at it.`,"web.ui.thread.art_no_file":`Not spooled to disk — this artifact cannot be opened.`,"web.ui.thread.art_download":`Download {name}`,"web.ui.thread.art_download_any":`Download this artifact`,"web.ui.thread.user_image_alt":`Image attached to this message ({mediaType})`,"web.ui.thread.user_image_alt_any":`Image attached to this message`,"web.ui.thread.expand":`Expand {count} more lines`,"web.ui.thread.collapse":`Collapse`,"web.ui.thread.todo_title":`Delivery checklist`,"web.ui.thread.todo_count":`{done} / {total} done`,"web.ui.thread.patch_of":`Patch {path}`,"web.ui.thread.patch_too_big":`Too large to diff line by line; only the line counts are reported`,"web.ui.thread.patch_opaque_old":`The version before this change cannot be drawn; the one after it is normal text.`,"web.ui.thread.patch_opaque_new":`The version after this change cannot be drawn.`,"web.ui.thread.patch_opaque_both":`Neither side of this change can be drawn.`,"web.ui.thread.code":`Code`,"web.ui.thread.copy_code":`Copy code`,"web.ui.thread.copied":`Copied`,"web.ui.thread.note_error":`Error`,"web.ui.thread.note_model":`Model: {model}`,"web.ui.thread.note_compression":`Context compressed ({count} messages)`,"web.ui.thread.note_summary":`Session ended after {duration}`,"web.ui.thread.act_copy":`Copy this reply`,"web.ui.thread.act_rerun":`Run this turn again`,"web.ui.thread.act_quote":`Quote this turn in the composer`,"web.ui.thread.act_inspect":`Open in the inspector`,"web.ui.thread.facts_tokens":`{tokens} tokens`,"web.ui.thread.facts_token_label":`tokens`,"web.ui.thread.facts_unknown":`not reported`,"web.ui.thread.facts_failover":`failover`,"web.ui.thread.facts_tools":`{count} tool calls`,"web.ui.thread.facts_no_tools":`no tools`,"web.ui.thread.act_rewind":`Rewind to before this turn`,"web.ui.thread.rewound_to":`Rewound to before the turn “{text}”`,"web.ui.thread.rewound_here":`Rewound to before this point`,"web.ui.thread.rewound_failed":`Tried to rewind to before "{text}" — it did not go through`,"web.ui.thread.rewound_failed_here":`Tried to rewind to before this point — it did not go through`,"web.ui.thread.todo_why":`Cancellation reason`,"web.ui.thread.head_ctx_line":`at compaction line`,"web.ui.thread.head_ctx_off":`at compaction line · no auto-compaction`,"web.ui.rewind.title":`Rewind to before this turn`,"web.ui.rewind.loading":`Reading this turn’s checkpoint…`,"web.ui.rewind.act_restore":`restore`,"web.ui.rewind.act_delete":`delete`,"web.ui.rewind.act_recreate":`recreate`,"web.ui.rewind.act_skip":`leave`,"web.ui.rewind.files_head":`Will touch {count} file(s)`,"web.ui.rewind.files_none":`Nothing to change (the files already match the snapshot)`,"web.ui.rewind.conflicts_head":`{count} file(s) changed after the agent left them — none are overwritten by default`,"web.ui.rewind.conflict_hint":`Ticked ones get overwritten — those are your edits, not the agent’s`,"web.ui.rewind.drift_changed":`changed since`,"web.ui.rewind.drift_unknown":`old checkpoint, not sure`,"web.ui.rewind.scope_legend":`What to rewind`,"web.ui.rewind.scope_files":`Files only (the conversation stays, so it can try again)`,"web.ui.rewind.scope_conversation":`Conversation only (the files stay)`,"web.ui.rewind.scope_both":`Both`,"web.ui.rewind.scope_conversation_off":`not supported by this checkpoint`,"web.ui.rewind.terminal_note":`Only edits made by file tools are covered; files changed by commands run in the terminal are not`,"web.ui.rewind.incomplete":`This checkpoint is incomplete (some files were never captured), so only part of it can be restored`,"web.ui.rewind.conversation_warn":`I understand: rewinding the conversation really deletes the messages after this point — it is not undoable, and they are not merely hidden`,"web.ui.rewind.run":`Rewind`,"web.ui.rewind.running":`Rewinding…`,"web.ui.rewind.cancel":`Cancel`,"web.ui.rewind.close":`Got it`,"web.ui.rewind.failed":`Rewind failed: {reason}`,"web.ui.rewind.failed_atomic":`Not a single byte of the workspace was changed — the rewind is atomic, so a failure means nothing was touched.`,"web.ui.rewind.done_restored":`{count} file(s) restored`,"web.ui.rewind.done_deleted":`{count} file(s) deleted`,"web.ui.rewind.done_recreated":`{count} file(s) recreated`,"web.ui.rewind.done_nothing":`Nothing to change (the files already matched the snapshot)`,"web.ui.rewind.done_skipped":`{count} of your own edits were not overwritten`,"web.ui.rewind.done_messages":`{count} message(s) deleted from the conversation (not undoable)`,"web.ui.dock.title_permission":`Needs your confirmation`,"web.ui.dock.title_plan":`Plan awaiting approval`,"web.ui.dock.title_question":`Needs a choice from you`,"web.ui.dock.queue":`{count} more queued behind this`,"web.ui.dock.queue_questions":`{count} more sets of questions`,"web.ui.dock.act_file_read":`read a file`,"web.ui.dock.act_file_write":`write a file`,"web.ui.dock.act_command":`run a command`,"web.ui.dock.act_network":`make a network request`,"web.ui.dock.act_code_exec":`run code in the sandbox`,"web.ui.dock.fact_action":`Action`,"web.ui.dock.fact_target":`Target`,"web.ui.dock.fact_detail":`Detail`,"web.ui.dock.fact_reason":`Reason`,"web.ui.dock.target_none":`(none)`,"web.ui.dock.more_lines":`↓ {count} more lines below`,"web.ui.dock.allow_once":`Allow once`,"web.ui.dock.allow_session":`Always allow this session`,"web.ui.dock.allow_session_hint":`until you quit`,"web.ui.dock.allow_always":`Allow permanently`,"web.ui.dock.allow_always_hint":`writes approvals.json`,"web.ui.dock.plan_execute_hint":`permission returns to {level}`,"web.ui.dock.plan_readonly_hint":`I'll do it myself`,"web.ui.dock.plan_readonly_forced":`you asked for read-only throughout`,"web.ui.dock.note_label":`Say what to change:`,"web.ui.dock.note_placeholder":`e.g. only touch core for now, leave tui alone`,"web.ui.dock.q_free":`None of these — my own answer:`,"web.ui.dock.q_free_placeholder":`(optional) filling this in makes it the answer`,"web.ui.dock.q_submit":`Submit`,"web.ui.dock.q_submit_partial":`{count} unanswered; it will be told you skipped them`,"web.ui.dock.q_skip":`Skip`,"web.ui.dock.q_skip_hint":`the model picks a default and says which`,"web.ui.crossbar.approval_one":`“{title}” is waiting on one approval`,"web.ui.crossbar.approval_n":`“{title}” is waiting on {count} approvals`,"web.ui.crossbar.question_one":`“{title}” is waiting on one question`,"web.ui.crossbar.question_n":`“{title}” is waiting on {count} questions`,"web.ui.crossbar.cold":`cooled`,"web.ui.crossbar.cold_hint":`the server is not holding it right now; opening it replays history`,"web.ui.crossbar.more":`{count} more`,"web.ui.crossbar.go":`Go there`,"web.ui.crossbar.waited":`Waiting since`,"web.ui.autobar.pending":`"{name}" did not run last time: {count} grants missing, and it will stall again`,"web.ui.autobar.more":`{count} more tasks are waiting`,"web.ui.autobar.fix":`Add to allowlist`,"web.ui.autobar.fixing":`Adding…`,"web.ui.autobar.open":`Take a look`,"web.ui.autobar.goal_blocked":`"{title}" has a blocked goal — that session will not move on until it is unblocked`,"web.ui.autobar.goal_open":`Go to that session`,"web.ui.toast.done":`“{title}” finished its run`,"web.ui.toast.max_turns":`“{title}” ran out of turns before finishing`,"web.ui.toast.stalled":`“{title}” was going in circles and stopped`,"web.ui.toast.aborted":`“{title}” was stopped mid-run`,"web.ui.toast.filtered":`“{title}” was refused by the model`,"web.ui.toast.compliance":`“{title}” ran into a content compliance limit`,"web.ui.toast.budget":`“{title}” hit the budget cap and stopped early`,"web.ui.toast.failed":`“{title}” hit an error`,"web.ui.toast.go":`View`,"web.ui.cmd.context_desc":`See where this conversation is spending its context`,"web.ui.cmd.compact_desc":`Compact the context to free up window for what comes next`,"web.ui.cmd.compact_running":`Compacting this conversation’s context…`,"web.ui.cmd.compact_done":`Compacted: {before} → {after} messages. Not a line of this conversation was removed — what changed is what gets sent to the model next turn.`,"web.ui.cmd.compact_no_change":`Nothing to compact — still {n} messages. This summary did not make it shorter, and the request was already paid for.`,"web.ui.cmd.compact_not_run":`No compaction happened.`,"web.ui.cmd.compact_failed":`Compaction did not complete; this conversation’s context is exactly as it was.`,"web.ui.composer.label":`Message`,"web.ui.composer.placeholder_idle":`Say something… (Enter to send, Shift+Enter for a newline)`,"web.ui.composer.placeholder_running":`This turn is still running; what you send queues behind it`,"web.ui.composer.placeholder_offline":`Disconnected from the server, reconnecting…`,"web.ui.composer.placeholder_approval":`Waiting for you to confirm the action above`,"web.ui.composer.placeholder_question":`Waiting for you to answer the question above`,"web.ui.composer.placeholder_no_session":`No session yet`,"web.ui.composer.placeholder_no_provider":`No model provider is available on this machine — another session will not help; configure an API key (or run epoch model)`,"web.ui.composer.placeholder_history":`This conversation cannot say where it used to work, so it cannot be picked back up — read it, or start a new one`,"web.ui.composer.placeholder_gone":`This conversation is gone on the server; there is nothing to send to`,"web.ui.composer.hint_queue":`to queue`,"web.ui.composer.send":`Send`,"web.ui.composer.usage_session":`Session`,"web.ui.composer.usage_run":`Last run`,"web.ui.composer.usage_detail":`{scope} usage: {up}↑ {down}↓`,"web.ui.composer.commands_label":`Slash commands`,"web.ui.composer.command_warnings":`A few things to know about how /{name} expanded:`,"web.ui.composer.builtin_notice":`/{name}`,"web.ui.composer.attach":`Add an image`,"web.ui.composer.remove_attach":`Remove {name}`,"web.ui.composer.drop_hint":`Drop to add the image to this message`,"web.ui.composer.reading":`reading…`,"web.ui.composer.reject_dismiss":`Dismiss these`,"web.ui.composer.no_workspace":`No workspace`,"web.ui.composer.workspace_unknown":`Workspace unknown`,"web.ui.composer.workspace_unknown_hint":`This session was left over from an earlier process and has not been picked back up here — so this process cannot say what it is bound to right now`,"web.ui.composer.workspace_diff_hint":`Open to see what has changed in this directory`,"web.ui.composer.workspace_pick":`Pick a workspace`,"web.ui.composer.workspace_pick_label":`Which workspace this session works in`,"web.ui.composer.workspace_here_current":`{name} (current)`,"web.ui.composer.workspace_none_detail":`Runs in the directory the server process started in — not a sandbox that cannot touch files. This choice is final.`,"web.ui.composer.workspace_pick_note":`The list is the directories recently used on this machine. To start a session somewhere new, run epoch there once first.`,"web.ui.composer.workspace_browse":`Open a local folder…`,"web.ui.composer.workspace_browse_detail":`Walk down to a directory, or type an absolute path (lists directories on the machine running epoch)`,"web.ui.composer.workspace_browse_native":`Opens a system dialog (on the machine running epoch)`,"web.ui.composer.permission":`Permissions: {level}`,"web.ui.composer.plan_mode":`Plan mode`,"web.ui.composer.plan_on_hint":`Enter plan mode: the model researches read-only and hands you a plan to approve; it touches no files meanwhile`,"web.ui.composer.plan_off_hint":`Leave plan mode and go back to the permission level you were on`,"web.ui.composer.plan_mode_why":`Read-only: the model can look and search but cannot change files; you get an approval when it hands in the plan`,"web.ui.composer.reject_not_image":`{name} is not an image; this round only takes images`,"web.ui.composer.reject_too_big":`{name} is {size} MB, over the {max} MB limit`,"web.ui.composer.reject_unreadable":`{name} could not be read`,"web.ui.composer.reject_directory":`{name} is a folder — open it and drag the images inside`,"web.ui.composer.too_big":`This message is {size}; one message carries at most {max}. Drop an image, or shorten the pasted text`,"web.ui.composer.expert_chip_title":`Every following message is answered by "{role}" — press the × on the left to cancel`,"web.ui.composer.identity_title":`This session runs as "{role}". It was set when the session was created and cannot be changed.`,"web.ui.composer.expert_remove":`Stop letting "{role}" take over`,"web.ui.mention.palette_label":`Sessions you can reference`,"web.ui.mention.group_sessions":`Sessions`,"web.ui.mention.candidate_here":`{when} · {count} messages · this workspace`,"web.ui.mention.candidate_elsewhere":`{when} · {count} messages · {where}`,"web.ui.mention.card_label":`Reference`,"web.ui.mention.card_count":`{kept} / {total} messages attached`,"web.ui.mention.card_truncated":`Over the limit — only the first {kb}KB attached`,"web.ui.mention.omit_invalid_reference":`No unique matching session — not attached. Type @: to pick one from the panel, or type more of the title`,"web.ui.mention.omit_self_reference":`That is the current session — not attached. To continue it, no reference is needed`,"web.ui.mention.omit_too_many":`Over the 2-per-message limit — not attached. For more history use session_search`,"web.ui.mention.omit_not_authorized":`Not in the readable scope — not attached (by default only the current workspace plus this session's lineage; the model can still call session_search)`,"web.ui.mention.omit_budget_exceeded":`This message's attachment budget is spent — not attached (files and sessions share 200KB)`,"web.ui.mention.omit_not_restored":`This message was read back from history, so reference content is not re-read — open that session from the sidebar for the original`,"web.ui.mention.group_files":`Files`,"web.ui.mention.file_palette_label":`Files you can mention`,"web.ui.mention.file_unmentionable":`{count} more matching paths contain spaces or special characters that @ cannot express — rename them, or just drop them into the box`,"web.ui.mention.file_truncated":`Too many files in the workspace, only part is listed — type the full path if yours is missing; hand-typed paths attach fine`,"web.ui.mention.file_card_label":`File`,"web.ui.mention.file_card_bytes":`{size}`,"web.ui.mention.file_card_truncated":`Over the limit — only the first {kb}KB attached`,"web.ui.mention.file_omit_binary":`Binary file — path attached, content not. The model can call file_read itself to read it`,"web.ui.mention.file_omit_denied":`Permission did not allow it (or it is outside this workspace) — not attached. @ never prompts here; the model can still call file_read for the full approval flow`,"web.ui.mention.file_omit_unreadable":`Could not be read (missing or not a file) — not attached. Check the path`,"web.ui.mention.file_omit_over_limit":`Over this message's file count or total size cap — not attached`,"web.ui.mention.file_omit_not_restored":`This message was read back from history, so attachment content is not re-read — the file is in your workspace; open it there`,"web.ui.perm.menu_label":`Permission level`,"web.ui.perm.lvl_plan":`Read-only`,"web.ui.perm.lvl_plan_detail":`It can look and think. To touch files or run commands it hands you a plan first`,"web.ui.perm.lvl_default":`Ask when needed`,"web.ui.perm.lvl_default_detail":`Anything the rule lists mark ask gets asked, one by one. The default`,"web.ui.perm.lvl_accept_edits":`Auto-accept edits`,"web.ui.perm.lvl_accept_edits_detail":`File edits stop asking; commands still ask`,"web.ui.perm.lvl_auto":`Trust its judgement`,"web.ui.perm.lvl_auto_detail":`Reading, writing and network stop asking, outside the workspace too; commands still ask for the ones that change things`,"web.ui.perm.lvl_bypass":`Skip every check`,"web.ui.perm.lvl_bypass_detail":`Nothing is ever asked, and the whole rail turns red`,"web.ui.perm.blocked_managed":`This machine has enterprise managed settings, and they turn off the "Skip every check" level. See Settings › Security centre for details`,"web.ui.perm.keep_env_pinned":`This level applies to the current run only: EPOCH_PERMISSION overrides it, so the next start will use that instead`,"web.ui.perm.keep_unwritable":`This level applies to the current run only: your config file's layout isn't one this path recognises, so it was left alone`,"web.ui.perm.keep_io":`This level applies to the current run only: the config file could not be written (read-only disk, or no permission)`,"web.ui.perm.keep_no_config":`This level applies to the current run only: this process cannot tell where your user config file is`,"web.ui.fatal.unauthorized":`No access credential`,"web.ui.fatal.unauthorized_hint":`Go back to the terminal running epoch web and reopen the tokenised URL it printed.`,"web.ui.fatal.offline":`Cannot reach the local service`,"web.ui.settings.title":`Settings`,"web.ui.settings.back":`Back to session`,"web.ui.settings.security":`Security`,"web.ui.settings.pane_model":`Model & provider`,"web.ui.settings.pane_memory":`Memory & context`,"web.ui.settings.pane_spend":`Usage & spend`,"web.ui.settings.history_only":`This session is history only — no engine is running it yet. Opening an old session just replays the conversation; the engine is built when you send your next message. This pane asks that engine for its current state, so there is nothing to show yet: go back to the session, send a message, and it will be picked back up.`,"web.ui.settings.pane_budget":`Budget`,"web.ui.settings.pane_tools":`Tools`,"web.ui.settings.pane_about":`About`,"web.ui.settings.appearance":`Appearance`,"web.ui.settings.appearance_lede":`Affects this browser on this machine only. It is not written to config.yaml and does not follow an account — we have no accounts.`,"web.ui.settings.appearance_note":`Light and dark only. Colour carries meaning in this design (state, syntax, additions and deletions, permissions), so it is not user-configurable.`,"web.ui.settings.theme":`Theme`,"web.ui.settings.theme_field":`Colour scheme`,"web.ui.settings.theme_system":`Follow system`,"web.ui.settings.theme_light":`Light`,"web.ui.settings.theme_dark":`Dark`,"web.ui.settings.theme_hint":`When following the system it tracks prefers-color-scheme live, no reload needed. The system is currently {now}.`,"web.ui.settings.lang":`Language`,"web.ui.settings.lang_field":`Interface language`,"web.ui.settings.lang_system":`Follow browser`,"web.ui.settings.lang_zh":`中文`,"web.ui.settings.lang_en":`English`,"web.ui.settings.lang_hint":`This only switches the frontend own strings. Diagnostics and messages returned by the server follow the language of the epoch web process, so they stay in Chinese after you switch to English.`,"web.ui.spend.no_session":`No session yet. This ledger is about one session — with none open there is nothing to add up. Start one and come back.`,"web.ui.spend.lede":`What this session has spent and where it went. The numbers come from the record each finished turn leaves behind, stored with the session — they survive restarts and are still there on history-only sessions.`,"web.ui.spend.none_yet":`This session has not run a turn yet — the ledger appears after the first one finishes.`,"web.ui.spend.none_recorded":`This conversation has run, but the per-turn records were never written down (the session predates the change that records them). The numbers will not come back.`,"web.ui.spend.g_total":`Totals`,"web.ui.spend.g_turns":`Per turn`,"web.ui.spend.total_unmeasured":`This session ran {turns} turns, but no usage was ever reported, so there is not even a token total.`,"web.ui.spend.partial":`The amount above only covers {priced} of those turns — the other {unpriced} reported usage, but the model they ran on has no pricing data. In the table below they are the rows with an empty cost cell.`,"web.ui.spend.unknown":`The amount is unknown, not zero: the models used in these turns have no pricing data on this machine, so only the provider knows how much was really spent.`,"web.ui.spend.unknown_hint":`More important: with no pricing data, the cost limit lets these turns through instead of guarding them — the "do not exceed $N" limit you configured has not been protecting this session during that time.`,"web.ui.spend.tok_input":`Input (not cached)`,"web.ui.spend.tok_cache_hit":`Input · cache hits`,"web.ui.spend.tok_cache_write":`Input · cache writes`,"web.ui.spend.tok_output":`Output`,"web.ui.spend.tok_reasoning":`Of which reasoning: {n}. It is already included in the number above.`,"web.ui.spend.tok_cache_note":`Cache hits are priced separately, usually far below the full rate — the more hits, the cheaper the same amount of context.`,"web.ui.spend.col_turn":`Turns`,"web.ui.spend.col_model":`Model`,"web.ui.spend.col_tokens":`Tokens`,"web.ui.spend.col_cost":`Cost`,"web.ui.spend.turn_n":`Turn {n}`,"web.ui.spend.turn_unmeasured":`No usage was reported for this turn (maybe no model call happened at all).`,"web.ui.spend.turn_took":`{d}`,"web.ui.spend.turn_tools":`tool calls: {n}`,"web.ui.set.no_session":`No session yet. The two project-level settings layers follow the workspace, and the workspace is bound per session — with no session there is no "which .epoch/settings.json" to answer.`,"web.ui.set.loading":`Reading setting provenance…`,"web.ui.set.unset":`Not set`,"web.ui.set.why":`Why this value`,"web.ui.set.chain_win":`wins`,"web.ui.set.g_other":`Other`,"web.ui.set.overridable_sum":`Which keys upper layers can override`,"web.ui.set.overridable":`Only these keys can be overridden by the project, project-local, command-line or managed layers: {keys}. Every other setting has just two layers, built-in and user — putting one in .epoch/settings.json does nothing, and startup diagnostics will report it as an unknown config key.`,"web.ui.set.overridable_perm":`The permissions entry on that list is three lists (allow / ask / deny) merged as a union rather than an override, so its provenance is per rule — see Security › Permission rules.`,"web.ui.set.managed_locked":`This one is set by the managed settings on this machine; changing it at the user or project level has no effect. That file is not writable by an ordinary user — ask an administrator.`,"web.ui.set.edit":`Edit`,"web.ui.set.cancel":`Cancel`,"web.ui.set.save":`Save`,"web.ui.set.new_value":`New value`,"web.ui.set.write_layer":`Write to`,"web.ui.set.write_file":`Into file`,"web.ui.set.dirty":`Unsaved`,"web.ui.set.futile_shadowed":`Writing to {layer} will have no effect: {by} sets this too, and it ranks higher, so on load it overrides what you write here. To make it take effect, write to {by} or above.`,"web.ui.set.futile_untrusted":`This workspace is not trusted yet, so settings in {layer} are dropped wholesale on load (deny rules are the one exception) — writing there does nothing. Trust the directory under Security › Workspace & trust first, or write to the user layer instead: it does not go through the trust gate.`,"web.ui.set.wrote":`Written to {layer}: {value}`,"web.ui.set.wrote_stale":`This process read the config once at startup and never re-reads it, so it is still using {value} — restarting epoch web is what switches it to the value you just wrote. Starting a new session will not do it either; the config is one per process.`,"web.ui.set.lede_model":`The model this process is using right now. Changing a row here writes to ~/.epoch/config.yaml. The provider and API key are not on this screen — run epoch model for those.`,"web.ui.set.k_model":`Main model`,"web.ui.set.k_models_utility":`Utility model`,"web.ui.set.h_models_utility":`Used for chores like compacting context and titling sessions. Unset means everything goes to the main model.`,"web.ui.set.k_fallback_model":`Fallback model`,"web.ui.set.k_fallback_providers":`Fallback chain`,"web.ui.set.h_fallback_providers":`Tried in this order when the main provider is unreachable.`,"web.ui.set.lede_memory":`The first two decide how much fits in a turn and how many steps it may take; the last two decide what happens when it no longer fits. Setting a context window larger than the model really has buys you a 400.`,"web.ui.set.k_context_length":`Context window (tokens)`,"web.ui.set.h_context_length":`Only used as a fallback when the model metadata cannot be read; when it can, metadata wins and a configured value has no effect. The compression line below uses the window the engine actually runs on.`,"web.ui.set.k_max_turns":`Max steps per turn`,"web.ui.set.h_max_turns":`How many tool calls the model may make in one turn. On reaching the cap it stops and finishes its answer.`,"web.ui.set.k_compression_enabled":`Compact when nearly full`,"web.ui.set.h_compression_enabled":`Compaction rewrites earlier messages into a summary; the originals stay in the session store and the model can search them back. A note is left in the thread afterwards.`,"web.ui.set.k_compression_threshold":`Compact at`,"web.ui.set.h_compression_threshold":`Compaction starts once the prompt reaches this fraction of the context window. Between 0 and 1.`,"web.ui.set.ctx_line":`With this configuration, compaction starts once the prompt reaches {tokens} tokens — {percent}% of the {window}-token context window.`,"web.ui.set.ctx_line_caveat":`That is the line itself. Just after a compaction, or once several compactions in a row have failed, crossing it will not compact yet.`,"web.ui.set.ctx_off":`Auto-compaction is off. When a long session hits the context window there is no automatic rescue — that turn simply fails, and the context does not shrink on its own. Manual /compact is unaffected by this switch and still works.`,"web.ui.set.ctx_not_overridable":`These two rows can only be written to the user level: only three keys can be overridden by project-level config (the list below), and compaction is not one of them — otherwise a repository could quietly let long sessions opened inside it run into the window.`,"web.ui.set.budget_title":`Where it is going right now`,"web.ui.set.budget_used":`{used} used — {percent}% of the {limit} window.`,"web.ui.set.budget_used_only":`{used} used. This model has no known context window, so there is no percentage to report.`,"web.ui.set.budget_loading":`Asking what this conversation is made of right now…`,"web.ui.set.budget_error":`Could not read what this conversation is made of. The conversation itself is unaffected — refresh and try again.`,"web.ui.set.budget_compact":`Compact now`,"web.ui.set.budget_compacting":`Compacting…`,"web.ui.set.budget_compact_hint":`Rewrites earlier messages into a summary to free up window for what comes next. It sends one model request (so it costs money), but not a single line of this conversation is removed — only what gets sent to the model next turn changes.`,"web.ui.set.lede_budget":`Amounts only appear in the UI once a cap is configured. With no cap these rows read "Not set", which is also the default.`,"web.ui.set.k_budget_max_cost":`Spend cap (USD)`,"web.ui.set.h_budget_max_cost":`Accumulates per session — not a per-request cap — and --resume picks the count back up. The turn that crosses the line is not charged first and reported after: the gate stops it before the next request goes out.`,"web.ui.set.k_budget_max_tokens":`Token cap`,"web.ui.set.h_budget_max_tokens":`With both rulers configured, the gate reports whichever is tighter.`,"web.ui.set.k_budget_warn_at":`Warn at`,"web.ui.set.h_budget_warn_at":`Percent. Warns once, on crossing — not every turn.`,"web.ui.set.k_budget_unknown_pricing":`When the model has no pricing data`,"web.ui.set.h_budget_unknown_pricing":`block stops the call, warn lets it through with a warning. With no pricing data the cost is "unknown", not 0, and the two must be handled separately.`,"web.ui.set.ex_budget_max_cost":`e.g. 5`,"web.ui.set.ex_budget_max_tokens":`e.g. 1000000`,"web.ui.set.ex_budget_warn_at":`e.g. 80`,"web.ui.set.blocked_empty":`This cannot be empty. Clearing it is not the same as removing the setting — this path has no delete-key at all; to get the default back, delete that line in the file named above.`,"web.ui.set.blocked_pick":`Pick one from the row above.`,"web.ui.set.blocked_number":`This takes a number, and "{text}" does not read as one. No unit, no thousands separators.`,"web.ui.set.blocked_boolean":`This takes exactly true or false — those are the two literals that go into the yaml.`,"web.ui.sec.lede":`What this agent can touch right now, and what is holding it back.`,"web.ui.sec.no_session":`No session yet. Three things here are bound per session: the workspace, its trust verdict, and the project-level policy directory that follows that trust — with no session there is no "which one" to answer.`,"web.ui.sec.loading":`Reading security status…`,"web.ui.sec.card_sandbox":`Sandbox`,"web.ui.sec.card_perm":`Permission mode`,"web.ui.sec.card_space":`Workspaces`,"web.ui.sec.card_rules":`Active rules`,"web.ui.sec.perm_d_managed":`Locked by the managed layer; it cannot be changed on this machine.`,"web.ui.sec.perm_d_local":`The mode this session is running under right now — not the one written on disk.`,"web.ui.sec.space_none":`None known`,"web.ui.sec.space_all_trusted":`{count} · all trusted`,"web.ui.sec.space_untrusted":`{count} · {untrusted} untrusted`,"web.ui.sec.space_at":`Currently bound to {root}`,"web.ui.sec.space_unbound":`This session has no workspace.`,"web.ui.sec.rules_n":`{count} permission · {policy} policy`,"web.ui.sec.rules_none":`None at all`,"web.ui.sec.g_sandbox":`Sandbox`,"web.ui.sec.sb_field":`Isolation backend`,"web.ui.sec.sb_os":`OS-level isolation ({backend})`,"web.ui.sec.sb_process":`Process isolation only ({platform})`,"web.ui.sec.sb_absent":`Not probed`,"web.ui.sec.sb_absent_d":`The isolation layer itself did not come up, so it cannot even report what it found. This is not the same as "process isolation only".`,"web.ui.sec.sb_absent_long":`The isolation layer did not come up, so it cannot even report what it found. This is not the same as "process isolation only" — that is a known conclusion, and this is an unknown.`,"web.ui.sec.sb_os_isolated":`{backend} on {platform} really does hold it in; there is nothing more to explain here.`,"web.ui.sec.sb_backend_unavailable":`{platform} should have an implementation, but the probe failed — the backend is there and will not start.`,"web.ui.sec.sb_backend_missing":`{platform} has an implementation but the dependency is missing: Linux needs bubblewrap, or the kernel may have disabled unprivileged user namespaces.`,"web.ui.sec.sb_platform_unsupported":`{platform} has no implementation at all (Windows would need AppContainer and Node has no binding), so installing anything will not help.`,"web.ui.sec.sb_switch":`Sandbox switch`,"web.ui.sec.sb_switch_on":`on`,"web.ui.sec.sb_switch_off":`off`,"web.ui.sec.sb_switch_on_hint":`config.yaml sandbox.terminal, on by default.`,"web.ui.sec.sb_switch_off_hint":`Off — terminal commands are not sandboxed this run, even though the list below still names it. Set sandbox.terminal back in config.yaml.`,"web.ui.sec.sb_covers":`Tools that go through the sandbox`,"web.ui.sec.sb_covers_none":`No tool goes through the isolation layer.`,"web.ui.sec.sb_excludes":`Explicitly outside the sandbox`,"web.ui.sec.sb_excludes_none":`No tool is called out as being outside.`,"web.ui.sec.sb_excludes_why":`The terminal does not go through the sandbox — the dangerous-command table and the permission gate hold it back instead. "Sandbox on" does not cover it.`,"web.ui.sec.g_perm":`Permission mode`,"web.ui.sec.perm_field":`Current mode`,"web.ui.sec.perm_unknown":`unreadable`,"web.ui.sec.perm_hint":`What to do by default when in doubt.`,"web.ui.sec.managed_field":`Managed settings`,"web.ui.sec.managed_on":`This machine has a managed settings file, and it overrides every other layer.`,"web.ui.sec.managed_off":`This machine has no managed settings. That is the norm.`,"web.ui.sec.managed_rules_only":`The managed layer turned on "managed permission rules only": the three lists from every other layer are discarded wholesale.`,"web.ui.sec.managed_bypass_off":`The managed layer disabled the "skip all checks" mode.`,"web.ui.sec.g_rules":`Permission rules`,"web.ui.sec.rules_empty":`There are no permission rules at all; every decision falls through to the mode above.`,"web.ui.sec.rules_no_exec":`An allow rule that permits arbitrary code execution (terminal(python:*) and the like) is rejected with a warning at load time: it would route around the entire permission system.`,"web.ui.sec.shadow_lede":`Some rules are covered by others:`,"web.ui.sec.shadow_shadowed":`{rule} never takes effect — {by} covers it entirely.`,"web.ui.sec.shadow_partial":`{rule} has a hole punched in it by {by}. This is often deliberate.`,"web.ui.sec.shadow_redundant":`{rule} adds nothing — {by} in the same list is already broader.`,"web.ui.sec.layer_builtin":`① built-in`,"web.ui.sec.layer_plugin":`①ᐟ⁵ plugin`,"web.ui.sec.layer_user":`② user`,"web.ui.sec.layer_env":`environment`,"web.ui.sec.layer_project":`③ project`,"web.ui.sec.layer_project_local":`④ project-local`,"web.ui.sec.layer_cli":`⑤ command line`,"web.ui.sec.layer_managed":`∞ managed`,"web.ui.sec.layer_unknown":`config.yaml`,"web.ui.sec.g_space":`Workspace and trust`,"web.ui.sec.known_field":`Known workspaces`,"web.ui.sec.known_empty":`No directory has been asked about trust yet.`,"web.ui.sec.known_hint":`Trust follows the directory, not the session: bind one directory to two sessions and there is still only one trust verdict.`,"web.ui.sec.ws_current":`current`,"web.ui.sec.ws_trusted":`Trusted; its .epoch/ is read.`,"web.ui.sec.ws_gate_off":`The trust gate is off entirely (trust.enabled is false), so it counts as trusted.`,"web.ui.sec.ws_refused":`You refused it. Nothing in its .epoch/ is read.`,"web.ui.sec.ws_unknown":`Never asked. Its .epoch/ is read only after epoch trust add.`,"web.ui.sec.bound_field":`Current workspace`,"web.ui.sec.unbound":`This session has no workspace — a real state, not a pending lookup. Relative paths have no base, and project-level config, roles and skills are all left unloaded.`,"web.ui.sec.main_field":`Main root {name}`,"web.ui.sec.main_hint":`Relative paths resolve against the main root only. Project-level .epoch/settings.json, agents/, skills/ and policies/ are discovered here and nowhere else.`,"web.ui.sec.loaded_files":`Convention files loaded:`,"web.ui.sec.loaded_none":`This root has no convention files.`,"web.ui.sec.skipped_line":`These convention files exist, and not a word of them was read.`,"web.ui.sec.skipped_why":`They go into the system prompt, so they pass the trust gate first. Trust this directory and they will load:`,"web.ui.sec.extra_field":`Extra directories`,"web.ui.sec.layer_add_dir":`--add-dir`,"web.ui.sec.extra_none":`No extra directories.`,"web.ui.sec.extra_desc":`path allowance only`,"web.ui.sec.extra_hint":`These only widen what can be read and written. They are not a second workspace: relative paths, project config, agents and skills all resolve against the main root only.`,"web.ui.sec.unloaded_extra":`The extra directories contain convention files, and none of them are loaded:`,"web.ui.sec.unloaded_extra_way":`This differs from the main root: trusting will not load them either, because "convention files in extra directories need their own trust verdict" has not been built. To make them count, make that directory the main root, or fold their content into the main root convention file.`,"web.ui.sec.trust_only_deny":`In an untrusted repository only the deny list of its permission rules applies — it can subtract, never add.`,"web.ui.sec.trust_not_permission":`Trust does not change the permission mode. It answers only "may files in this directory influence my instructions", never "should this action ask you" — the rule table above always decides that.`,"web.ui.sec.g_policy":`Policy rules`,"web.ui.sec.policy_lede":`A different thing from the permission rule table above: permission rules govern "should this ask me", policy rules govern "what does this tool touching this path count as" — and a deny can carry a sentence you wrote to the user.`,"web.ui.sec.policy_none":`No policy directory takes part in the scan.`,"web.ui.sec.policy_user":`User level, follows this machine.`,"web.ui.sec.policy_project":`Project level, follows the current workspace — another session means another repository.`,"web.ui.sec.policy_n":`{count} rules`,"web.ui.sec.policy_skipped":`{dir} was not loaded at all — that workspace is untrusted.`,"web.ui.sec.policy_skipped_why":`Not "deny only": not one rule was read.`,"web.ui.sec.policy_asym":`This is asymmetric with permissions, which is worth stating outright: permissions keep deny when untrusted, policy is dropped wholesale. Within one [[rule]] the tool name, path pattern and decision are bound together and deny_message is shown to the user verbatim — leaving a "deny still applies" opening would mean rewriting the semantics of somebody else rules one by one.`,"web.ui.sec.g_audit":`What it decided`,"web.ui.sec.audit_lede":`Verdicts made by the permission layer this run, newest first.`,"web.ui.sec.audit_scope":`Only decisions the permission layer actually made — not every risky action.`,"web.ui.sec.audit_col_at":`Time`,"web.ui.sec.audit_col_tool":`Tool`,"web.ui.sec.audit_col_type":`Type`,"web.ui.sec.audit_col_target":`Target`,"web.ui.sec.audit_col_outcome":`Verdict`,"web.ui.sec.audit_col_code":`Reason`,"web.ui.sec.audit_granted":`Allowed`,"web.ui.sec.audit_denied":`Blocked`,"web.ui.sec.audit_dropped":`{dropped} earlier entries have been evicted — this table keeps at most 500. What you see is not all of it.`,"web.ui.sec.audit_ephemeral":`This ledger lives only inside the running server process: never written to disk, never exported, never sent to telemetry. It is gone when the process exits, so it is not a complete history.`,"web.ui.sec.audit_code_dangerous_command":`Matched the dangerous-command list`,"web.ui.sec.audit_code_sensitive_path":`Matched the sensitive-path list`,"web.ui.sec.audit_code_obfuscated":`Command is obfuscated and nobody could confirm it non-interactively`,"web.ui.sec.audit_code_rule_match":`Matched a permission rule`,"web.ui.sec.audit_code_policy_rule":`Matched a policy rule`,"web.ui.sec.audit_code_approval_cache":`You already made the same decision for this target`,"web.ui.sec.audit_code_sandbox_isolation":`Decided by the measured sandbox isolation level`,"web.ui.sec.audit_code_level_default":`No rule matched, so it fell through to the permission level`,"web.ui.sec.audit_code_headless_preauthorized":`Non-interactive, matched the pre-authorization list`,"web.ui.sec.audit_code_headless_unauthorized":`Non-interactive, not pre-authorized`,"web.ui.sec.audit_code_user_approved":`You approved it`,"web.ui.sec.audit_code_user_denied":`You denied it`,"web.ui.sec.perm_where":`Both come from the row under the composer: picking a level takes effect immediately and is recorded as the starting point below (written to ~/.epoch/config.yaml), which new sessions and the next start begin from.`,"web.ui.sec.perm_now":`Now`,"web.ui.sec.perm_default":`Default`,"web.ui.sec.perm_now_changed":`(changed in this session)`,"web.ui.sec.g_cached":`Remembered approval decisions`,"web.ui.sec.cached_lede":`Answers you gave in approval dialogs. This process remembers them, so the same operation is not asked again. Revoke one and it will ask again.`,"web.ui.sec.cached_not_rules":`This only revokes a dialog answer. A deny in the rule table above is checked first — after revoking this one, that one may still block you.`,"web.ui.sec.cached_where":`"Always allow" is stored in ~/.epoch/approvals.json and revoking deletes it from disk too; "deny" and "allow for this session" live only in memory and vanish when the process exits.`,"web.ui.sec.cached_bypass":`The current level is bypass, which skips this table entirely — none of the decisions below are blocking anything right now. They apply again at any other level.`,"web.ui.sec.cached_revoke":`Revoke`,"web.ui.sec.cached_revoke_one":`Revoke this decision on {target}`,"web.ui.sec.cached_revoking":`Revoking…`,"web.ui.sec.cached_failed":`Could not revoke: {message}`,"web.ui.sec.cached_d_deny":`Denied`,"web.ui.sec.cached_d_session":`Allowed this session`,"web.ui.sec.cached_d_always":`Always allowed`,"web.ui.sec.cached_scope_exact":`This target`,"web.ui.sec.cached_scope_prefix":`including subdirectories`,"web.ui.cap.title":`Capabilities`,"web.ui.cap.back":`Back to session`,"web.ui.cap.experts":`Identities`,"web.ui.cap.skills":`Skills`,"web.ui.cap.connectors":`Connectors`,"web.ui.cap.search":`Search names, descriptions, tool names`,"web.ui.cap.no_session":`No session yet. These three panes follow the session — the "Project" layer depends on which workspace it is bound to.`,"web.ui.cap.loading":`Loading…`,"web.ui.cap.experts_lede":`An identity is a prompt, a tool set and a turn limit. The main agent hands work off with delegate_task; each sub-agent runs under its own identity in a separate context and only hands back the conclusion.`,"web.ui.cap.skills_lede":`Skills are progressively disclosed: only the one line below enters the context, and the body is read only when the model decides it is relevant. The number at the end of each row is what that line costs every turn — rows that are held out of the index say so instead.`,"web.ui.cap.connectors_lede":`Connectors are where tools come from. The built-in ones ship with the program and cannot fail to connect; the MCP ones are yours to configure, which is why they carry a state.`,"web.ui.cap.g_builtin":`Built-in`,"web.ui.cap.g_plugin":`Plugins`,"web.ui.cap.g_host":`Host`,"web.ui.cap.g_user":`Mine`,"web.ui.cap.g_project":`Project`,"web.ui.cap.g_mcp":`MCP`,"web.ui.cap.g_builtin_roles":`Present out of the box, nothing to configure. Any of them can be overridden by a same-named entry in a layer below.`,"web.ui.cap.g_plugin_roles":`Brought in by installed plugins, from each plugin own agents/ directory.`,"web.ui.cap.g_user_roles":`.md files under ~/.epoch/agents/ — one set per machine, shared by every project.`,"web.ui.cap.g_project_roles":`.md files under this repository .epoch/agents/. They travel with the repository and override same-named entries above.`,"web.ui.cap.g_host_roles":`Shipped by the application this engine is embedded in; their names carry the prefix that application chose. They never show up in epoch plugin list — you did not install them, and only that application own UI can manage them.`,"web.ui.cap.g_user_skills":`One directory per skill under ~/.epoch/skills/, with the body in SKILL.md.`,"web.ui.cap.g_plugin_skills":`Brought in by installed plugins; their names are prefixed with the plugin name.`,"web.ui.cap.g_project_skills":`From this repository .epoch/skills/. They travel with the repository.`,"web.ui.cap.g_host_skills":`Shipped by the application this engine is embedded in; their names carry the prefix that application chose. They are upgraded together with that application, so they are read-only here.`,"web.ui.cap.g_builtin_conn":`Tool plugins compiled into the program. Only the tool count is shown, not every name — spelling out thirty-odd of them would push the MCP servers below off the screen.`,"web.ui.cap.g_mcp_note":`What you configured in ~/.epoch/mcp.json. Their tool names carry an mcp__<server>__ prefix.`,"web.ui.cap.g_host_conn":`Shipped by the application this engine is embedded in. They are not in your mcp.json, so you can neither edit nor remove them — only that application own UI can. Their names carry the prefix it chose, so their tool names start with mcp__<prefix>__<server>__.`,"web.ui.cap.g_plugin_conn":`Brought in by an installed plugin, from the mcp.json at its own root. Names are prefixed with the plugin name, so their tool names start with mcp__<plugin>__<server>__. You cannot edit their contents, but epoch plugin list tells you which plugin brought them and epoch plugin disable turns the whole thing off.`,"web.ui.cap.project_locked_roles":`This workspace is not trusted yet, so we never read its .epoch/agents/ — which means we cannot even tell you how many there are. Trust it and come back.`,"web.ui.cap.locked_line":`This workspace is not trusted yet; none of its skills were read.`,"web.ui.cap.locked_why":`This is not "read then disabled" — that directory was never opened at all, which is why not even a count can be listed here.`,"web.ui.cap.locked_gate":`What the gate stops: you clone a repository, and whatever it carries in .epoch/ should not reach the model context before you have looked at it.`,"web.ui.cap.summon":`Use`,"web.ui.cap.overrides_builtin":`Overrides the built-in of the same name`,"web.ui.cap.stat_tools":`Tools`,"web.ui.cap.stat_turns":`Turn limit`,"web.ui.cap.unlimited":`unrestricted`,"web.ui.cap.turns_global":`global`,"web.ui.cap.toolset":`Tool set`,"web.ui.cap.toolset_n":`Tool set ({count})`,"web.ui.cap.unlimited_hint":`It declares no tools, so it gets every tool available this round.`,"web.ui.cap.skillset_n":`Skill allowlist ({count})`,"web.ui.cap.skillset_hint":`⚠️ This only controls what the index lists — it is not a wall: this identity can still read the body of a skill that was left out.`,"web.ui.cap.skillset_none":`The allowlist is empty, so nothing at all is listed in its skill index.`,"web.ui.cap.list_sep":`, `,"web.ui.cap.narrowed":`Some tools declared by {role} were outside the range of the layer above and have been dropped: {cut}. A tool allowlist can only narrow, never widen.`,"web.ui.cap.narrowed_skills":`Some skills declared by {role} were outside the range of the layer above and will not be listed in the index: {cut}. Their bodies stay readable — narrowing is a context budget, not a boundary.`,"web.ui.cap.skill_tokens":`{tokens} tokens`,"web.ui.cap.skill_unindexed":`not in the index`,"web.ui.cap.skills_capped_note":"{count} skills are held out of the index by `skills.maxIndexed`: they cost nothing per turn, and the model cannot list them either. Raise or remove that setting to get them back.","web.ui.cap.skills_role_note":`{count} skills are outside this session identity's skill allowlist, so they are not indexed. ⚠️ That is not a lock: the bodies stay readable — narrowing is a context budget, not reachability.`,"web.ui.cap.no_toggle":'There is no "turn this skill off" switch: as long as the file is in the directory, it gets picked up. To drop one, use Delete on its row — that removes its directory for good; to just save context, `skills.maxIndexed` caps the index.',"web.ui.cap.import_entry":`Import a skill`,"web.ui.cap.import_title":`Import a skill`,"web.ui.cap.import_lede":`Import from the machine running the server. Accepts a folder containing SKILL.md, a two-level category/name skill tree, a .zip of either, or a single .md with frontmatter.`,"web.ui.cap.import_hint_local":`Give a path on the machine running the server — this route does not accept uploads.`,"web.ui.cap.import_placeholder":`/Users/you/skills/my-skill`,"web.ui.cap.import_path_label":`Absolute path to import`,"web.ui.cap.import_look":`See what is there`,"web.ui.cap.import_browse":`Browse directories`,"web.ui.cap.import_browse_off":`Collapse`,"web.ui.cap.import_pick_here":`Use this directory`,"web.ui.cap.import_count":`Will import {count} skill(s) ({form})`,"web.ui.cap.import_form_markdown":`a single .md`,"web.ui.cap.import_form_skill-dir":`one skill folder`,"web.ui.cap.import_form_tree":`a skill tree`,"web.ui.cap.import_form_archive":`an archive`,"web.ui.cap.import_files":`{files} extra file(s) · {bytes} bytes`,"web.ui.cap.import_no_desc":`(no description — it still takes a line in <available_skills>, but that line is just a name, so it burns tokens every turn and the model is unlikely to pick it)`,"web.ui.cap.import_conflict_refuse":` ⚠️ A user-level skill of this name exists; this one will not be imported`,"web.ui.cap.import_conflict_shadowed":` ⚠️ A project-level skill of this name exists; importing it has no effect (project-level wins)`,"web.ui.cap.import_confirm":`Import these {count}`,"web.ui.cap.import_issues":`Worth a look:`,"web.ui.cap.import_skipped":`Skipped:`,"web.ui.cap.import_done":`Imported {count}, skipped {skipped}`,"web.ui.cap.import_failed":`Nothing can be imported from that path`,"web.ui.cap.import_again":`Import another`,"web.ui.cap.skill_view":`View body`,"web.ui.cap.skill_back":`Back to skills`,"web.ui.cap.skill_view_no_count":`Looking at this will not affect its score — that tally only counts times the model actually used it.`,"web.ui.cap.skill_truncated":`This SKILL.md is large ({bytes} bytes in total); below is only the first stretch of it. Open the file directly to read the whole thing.`,"web.ui.cap.skill_bytes":`{bytes} bytes in total`,"web.ui.cap.skill_remove":`Delete`,"web.ui.cap.skill_remove_ask":`Delete {name}? Its whole directory goes with it, and this cannot be undone.`,"web.ui.cap.skill_remove_yes":`Delete`,"web.ui.cap.skill_cancel":`Cancel`,"web.ui.cap.skill_removed":`Deleted {name}. This is the directory that was just removed:`,"web.ui.cap.plugins":`Plugins`,"web.ui.cap.plug_lede":`A plugin is a bundle of extensions: slash commands, identities, skills, hooks, deny rules, MCP servers, plus scripts in any language. There are two ways in: pick one from a marketplace already added here, or point at a plugin directory on this machine (that tier only creates a symlink). Uploading a file is not one of them.`,"web.ui.cap.plug_installed_head":`Installed ({count})`,"web.ui.cap.plug_installed_empty":`No plugins installed.`,"web.ui.cap.plug_market_head":`In the marketplaces ({count})`,"web.ui.cap.plug_market_empty":`The marketplaces added here list no plugins — they were added, their catalogues are just empty.`,"web.ui.cap.plug_market_none_added":`No plugin marketplace has been added yet. Use Add above, or point at a plugin directory on this machine to install one directly.`,"web.ui.cap.plug_no_desc":`(no description for this entry in the marketplace catalogue)`,"web.ui.cap.plug_add":`Add`,"web.ui.cap.plug_add_title":`Add a plugin`,"web.ui.cap.plug_add_back":`Back to the plugin list`,"web.ui.cap.plug_add_tab_local":`Local directory`,"web.ui.cap.plug_add_tab_market":`Marketplace`,"web.ui.cap.plug_add_hint_local":`This is a path on the machine running this service, not on your computer. It has to be absolute and point at a plugin directory — one holding an epoch-plugin.json. Installing it only creates a symlink: edit the source and restart once for the change to take effect.`,"web.ui.cap.plug_add_path_placeholder":`/home/you/dev/my-toolkit`,"web.ui.cap.plug_add_path_label":`Absolute path of the plugin directory`,"web.ui.cap.plug_add_look":`See what it installs`,"web.ui.cap.plug_add_browse":`Browse…`,"web.ui.cap.plug_add_browse_off":`Collapse`,"web.ui.cap.plug_add_pick_here":`Pick this level`,"web.ui.cap.plug_market_lede":`A marketplace is a catalogue of plugins (one JSON file). Adding one installs nothing — once it is in, go back to the list and pick what to install there; the pre-install preview on that path is unchanged.`,"web.ui.cap.plug_market_placeholder":`/srv/market or github:acme/market`,"web.ui.cap.plug_market_label":`Marketplace address`,"web.ui.cap.plug_market_add":`Add marketplace`,"web.ui.cap.plug_market_add_failed":`That marketplace could not be added`,"web.ui.cap.plug_market_none":`No marketplace added.`,"web.ui.cap.plug_market_entries":`{count} entries`,"web.ui.cap.plug_market_remove":`Remove`,"web.ui.cap.plug_market_remove_ask":`Remove it? Plugins installed from it stay; you just will not be able to pick new ones here.`,"web.ui.cap.plug_market_remove_yes":`Remove`,"web.ui.cap.plug_market_remove_failed":`Could not remove it`,"web.ui.cap.plug_restart":`Plugins changed during this run; those changes have not taken effect`,"web.ui.cap.plug_restart_why":`Extensions are loaded at startup, so anything just installed / updated / uninstalled only counts from the next run — this run's command table, hooks and identity table are unchanged. To make them take effect: restart the service running this interface (Ctrl+C in the terminal, then run epoch web again). If this interface is embedded in another program, only that program can do the rebuild — there is no "apply now" button on this page, and there will not be one.`,"web.ui.cap.plug_state_active":`In effect`,"web.ui.cap.plug_state_pending":`Installed; this run has not loaded it`,"web.ui.cap.plug_state_disabled":`Disabled (epoch plugin enable turns it back on)`,"web.ui.cap.plug_state_off":`Installed but not loaded this run — a startup diagnostic says why (version mismatch / directory gone / broken manifest)`,"web.ui.cap.plug_state_stale":`Not loaded this run — it may have just been installed / updated (then restart), or it may have failed (a startup diagnostic says why)`,"web.ui.cap.plug_n_commands":`{count} cmd`,"web.ui.cap.plug_n_roles":`{count} identities`,"web.ui.cap.plug_n_skills":`{count} skills`,"web.ui.cap.plug_n_hooks":`{count} hooks`,"web.ui.cap.plug_n_deny":`{count} deny`,"web.ui.cap.plug_n_mcp":`{count} MCP`,"web.ui.cap.plug_linked":`symlink`,"web.ui.cap.plug_already":`Installed`,"web.ui.cap.plug_remote_off":` ⚠️ Its source has to be fetched over the network (git clone / download and unpack), and the remote tier is off in this deployment, so it cannot be installed`,"web.ui.cap.plug_bad_source":` ⚠️ The source of this entry in the marketplace catalogue is malformed and we cannot read it — whoever publishes that catalogue has to fix it`,"web.ui.cap.plug_install":`Install`,"web.ui.cap.plug_update":`Update`,"web.ui.cap.plug_uninstall":`Uninstall`,"web.ui.cap.plug_uninstall_ask":`Uninstall {name}?`,"web.ui.cap.plug_uninstall_yes":`Uninstall`,"web.ui.cap.plug_cancel":`Cancel`,"web.ui.cap.plug_back":`Back to plugins`,"web.ui.cap.plug_will_install":`Will install {name}@{version}`,"web.ui.cap.plug_will_update":`Will update to {name}@{version}`,"web.ui.cap.plug_source":`Source`,"web.ui.cap.plug_checksum":`Checksum (verified)`,"web.ui.cap.plug_author":`Author`,"web.ui.cap.plug_homepage":`Homepage`,"web.ui.cap.plug_brings":`It brings:`,"web.ui.cap.plug_brings_nothing":`No extensions at all — installing it changes nothing; check that the directory layout is right`,"web.ui.cap.plug_inv_commands":`{count} slash commands: {names}`,"web.ui.cap.plug_inv_roles":`{count} identities: {names}`,"web.ui.cap.plug_inv_skills":`{count} skills: {names}`,"web.ui.cap.plug_inv_hooks":`⚠️ {count} hooks ({tally}) — a hook is a shell command, and they will run on this machine`,"web.ui.cap.plug_inv_mcp":`⚠️ {count} MCP servers: {names} — each one is a subprocess that gets started`,"web.ui.cap.plug_inv_deny":`{count} deny rules (a plugin can only tighten permissions, never widen them)`,"web.ui.cap.plug_inv_ignored":`These buckets in its settings.json do not take effect: {buckets} (allow / ask written by a plugin are always ignored)`,"web.ui.cap.plug_inv_js":`It ships a tools/ directory, but this version does not run third-party JS inside the epoch process — that directory is ignored entirely.`,"web.ui.cap.plug_conflict":`⚠️ {name}@{version} is already installed, so this attempt will be refused. To swap in this one, uninstall that first.`,"web.ui.cap.plug_pending_hint":`Pressing this writes it to disk, but it will not take effect this run — extensions are loaded at startup.`,"web.ui.cap.plug_confirm":`Confirm install`,"web.ui.cap.plug_confirm_update":`Confirm update`,"web.ui.cap.plug_done":`Installed {name}@{version}.`,"web.ui.cap.plug_done_update":`Updated to {name}@{version}.`,"web.ui.cap.plug_preview_failed":`This entry cannot be installed`,"web.ui.cap.plug_locked_lan":`Plugins cannot be installed in this mode: the server was bound outside the loopback interface with --host, and we cannot tell whether your browser is on the machine running it. A plugin bundle may carry hooks (shell commands) and mcp.json (a server that gets started), which means this action decides what processes run on that machine — so this path is only open under the default loopback binding. To install one: run epoch plugin install on that machine, or drop --host and restart. Everything below is still visible, just not actionable.`,"web.ui.cap.plug_no_path":`This interface has no plugin path`,"web.ui.cap.tool_count":`{count} tools`,"web.ui.cap.mcp_empty":`No MCP server configured yet. Use "Add server" above, or edit ~/.epoch/mcp.json directly.`,"web.ui.cap.mcp_connected":`Connected`,"web.ui.cap.mcp_failed":`Unreachable`,"web.ui.cap.mcp_login":`Login required`,"web.ui.cap.mcp_retries":`Retried {count} times.`,"web.ui.cap.mcp_failed_why":`Its tools are entirely unavailable this round. After fixing mcp.json you have to restart epoch web for it to reconnect.`,"web.ui.cap.mcp_login_why":`It is reachable but not authorised — reconnecting will not help however many times you try. Run this in a terminal:`,"web.ui.cap.mcp_reconnect":`Reconnect`,"web.ui.cap.mcp_reconnecting":`Reconnecting…`,"web.ui.cap.mcp_reconnect_scope":`This affects every session in this process, not just the one you are looking at — the MCP connection is shared by the whole process. It reconnects using the mcp.json read at startup, so if you changed the config you still need a restart.`,"web.ui.cap.mcp_reconnect_after_login":`Run the login above first, then press here — new credentials only take effect after a reconnect.`,"web.ui.cap.mcp_add":`Add server`,"web.ui.cap.mcp_add_title":`Add an MCP server`,"web.ui.cap.mcp_add_name":`Server name`,"web.ui.cap.mcp_add_name_hint":`Becomes part of the tool names (mcp__<name>__…), so only letters, digits, _ and - are accepted.`,"web.ui.cap.mcp_add_transport":`Transport`,"web.ui.cap.mcp_add_command":`Executable`,"web.ui.cap.mcp_add_args":`Arguments (one per line)`,"web.ui.cap.mcp_add_url":`URL`,"web.ui.cap.mcp_add_env":`Environment variables (one KEY=value per line)`,"web.ui.cap.mcp_add_env_hint":`These lines are written to mcp.json in plaintext. Do not put secrets here — that path is epoch mcp login, where credentials are stored encrypted.`,"web.ui.cap.mcp_add_scope":`This is written to ~/.epoch/mcp.json — not just this conversation, and not just this process: every future epoch run on this machine (including the CLI and the TUI) will see it. It is connected right away, so its tools are usable this round.`,"web.ui.cap.mcp_add_submit":`Add it`,"web.ui.cap.mcp_add_submitting":`Connecting…`,"web.ui.cap.mcp_add_cancel":`Cancel`,"web.ui.cap.mcp_add_done":`Written to {path}.`,"web.ui.cap.mcp_add_offline":`The config was added, but this server is unreachable right now — the card above says why. If the config is right, press Reconnect once the other end is up.`,"web.ui.cap.mcp_add_locked":`MCP servers cannot be added from the UI in this mode: the server was bound outside the loopback interface with --host, and we cannot confirm your browser is on the machine running it. Adding one writes "which executable to launch" into mcp.json — that server is started right away, and every future epoch run on this machine (including the CLI and the TUI) starts it too, not just this conversation. To add one: edit ~/.epoch/mcp.json directly on that machine, or drop --host and restart.`,"web.ui.cap.mcp_cfg_open":`See its config`,"web.ui.cap.mcp_cfg_title":`Edit mcp.json`,"web.ui.cap.mcp_cfg_path":`Config file path:`,"web.ui.cap.mcp_cfg_dirty":`Unsaved`,"web.ui.cap.mcp_cfg_loading":`Reading that file…`,"web.ui.cap.mcp_cfg_absent":`This file does not exist yet — the lines below are a template, not your content. It is only created for real when you press Save.`,"web.ui.cap.mcp_cfg_editor":`Contents of mcp.json`,"web.ui.cap.mcp_cfg_locked":`mcp.json can neither be viewed nor edited in this mode — the server was bound outside the loopback interface with --host, so we cannot tell whether the browser sending this request is on this machine. Environment variables in that file are stored in cleartext (they may hold secrets), and the same file decides which executable gets launched. Two ways forward: edit that file directly on the machine running the server, or drop --host and restart.`,"web.ui.cap.mcp_cfg_reload":`Read it again (discards your current edits)`,"web.ui.cap.mcp_cfg_scope":`There are two actions on this screen and they change different things. Save only writes ~/.epoch/mcp.json — every future epoch run on this machine (including the CLI and the TUI) reads it. Apply to this process is what touches the live connections, and that affects every session in this process, not just the one you are looking at. Once a server is removed, sessions using it can no longer call its tools from the next turn on.`,"web.ui.cap.mcp_cfg_save":`Save`,"web.ui.cap.mcp_cfg_saving":`Writing…`,"web.ui.cap.mcp_cfg_apply":`Apply to this process`,"web.ui.cap.mcp_cfg_applying":`Applying…`,"web.ui.cap.mcp_cfg_apply_dirty":`Save first — Apply reads what is on disk, and your version has not been written yet.`,"web.ui.cap.mcp_cfg_close":`Collapse`,"web.ui.cap.mcp_cfg_saved":`Written to {path}.`,"web.ui.cap.mcp_cfg_not_live":`The servers in this process are still running with the config read at startup — press "Apply to this process", or let it take effect on the next start.`,"web.ui.cap.mcp_cfg_applied":`MCP in this process has been rearranged to match what is on disk:`,"web.ui.cap.mcp_cfg_applied_none":`Nothing changed — what is on disk matches the servers running in this process verbatim.`,"web.ui.cap.mcp_cfg_act_added":`newly connected`,"web.ui.cap.mcp_cfg_act_reconnected":`config changed, reconnected with the new one`,"web.ui.cap.mcp_cfg_act_removed":`disconnected; its tools are unavailable from this turn on`,"web.ui.cap.mcp_cfg_act_skipped":`this name is taken by the host or a plugin, so it was not added in this process — your server wins on the next start`,"web.ui.cap.mcp_cfg_act_unchanged":`untouched (config unchanged)`,"web.ui.cap.role_add":`New identity`,"web.ui.cap.role_add_title":`Create an identity`,"web.ui.cap.role_add_name":`Name`,"web.ui.cap.role_add_name_hint":`Lowercase letters, digits and hyphens only. It is both the file name and the word used to delegate work.`,"web.ui.cap.role_add_desc":`When to delegate to it`,"web.ui.cap.role_add_desc_hint":`This sentence is written for the main agent, not as a self-introduction — it decides whether to hand work over based on it, so describe when it should be used. It also enters the tool description of every delegation.`,"web.ui.cap.role_add_prompt":`Body`,"web.ui.cap.role_add_prompt_hint":`The passage this identity reads while it works. Leaving it empty is fine — then it only changes the identity line and the tool boundary.`,"web.ui.cap.role_add_tools":`Tool whitelist (one per line)`,"web.ui.cap.role_add_tools_hint":`Empty = unrestricted, it gets every tool available this round. Listing names restricts it to those. The names must match the ones on Settings › Tools.`,"web.ui.cap.role_add_skills":`Skill allowlist (one per line)`,"web.ui.cap.role_add_skills_hint":`Empty = unrestricted, every skill on the capability page enters its index. Listing names restricts the index to those. Copy the names off the Skills column ("prefix:" included for plugin- and host-provided ones). ⚠️ This only controls what the index lists — it is not a wall: this identity can still read the body of a skill that was left out.`,"web.ui.cap.role_add_turns":`Turn limit`,"web.ui.cap.role_add_turns_hint":`Empty = follow the global setting. 1 to 200.`,"web.ui.cap.role_add_scope":`This creates a .md file in ~/.epoch/agents/ — not just for this conversation, and not just for this process: every future epoch run on this machine (including the CLI and the TUI) will see it. ⚠️ Both passages above enter the model context ("when to delegate to it" on every single turn), so what you write here carries the same weight as what you say in a conversation.`,"web.ui.cap.role_add_submit":`Create it`,"web.ui.cap.role_add_submitting":`Writing…`,"web.ui.cap.role_add_cancel":`Cancel`,"web.ui.cap.role_add_done":`Written to {path} — go to that file to keep editing the body.`,"web.ui.cap.role_add_locked":`Identities cannot be created from the UI in this mode: the server was bound outside the loopback interface with --host, and we cannot confirm your browser is on the machine running it. The body of an identity enters the context of every future turn (and its "when to delegate to it" line enters the tool description of every delegation), so this path is only open under the default loopback binding. To add one: put a .md file in ~/.epoch/agents/ on that machine, or drop --host and restart.`,"web.ui.cap.copy_cmd":`Copy`,"web.ui.cap.trusted_at":`Trusted {root}`,"web.ui.cap.untrusted_at":`Not trusted {root}`,"web.ui.cap.no_workspace":`This session has no workspace bound`,"web.ui.cap.summon_prefill":`Have {role} do: `,"web.ui.cap.open_session":`New session`,"web.ui.cap.open_session_here":`Start a new session run by {role} in {root}; the conversation you are in stays exactly where it is`,"web.ui.cap.open_session_nows":`Start a new session run by {role}, with no workspace bound either; the conversation you are in stays exactly where it is`,"web.ui.cap.open_session_failed":`Could not start the session: {detail}`,"web.ui.cap.take_over":`Let it take over`,"web.ui.cap.take_over_title":`From your next message on, "{role}" answers; this conversation is untouched`,"web.ui.cap.take_over_on":`Taking over`,"web.ui.cap.take_over_on_title":`"{role}" is taking over the messages that follow — to cancel, go back to the conversation and press the × on the chip above the composer`,"web.ui.diff.title":`Workspace changes`,"web.ui.diff.back":`Back to session`,"web.ui.diff.reload":`Read again`,"web.ui.diff.reload_hint":`Read this directory again — this screen does not refresh itself`,"web.ui.diff.loading":`Reading…`,"web.ui.diff.failed":`Could not read this session’s workspace changes — the request never reached the local server.`,"web.ui.diff.pick":`Pick a file on the left.`,"web.ui.diff.scope_git":`This lists every uncommitted change in the directory relative to git HEAD — including your own edits and other programs’, not just this session’s.`,"web.ui.diff.status_added":`added`,"web.ui.diff.status_modified":`modified`,"web.ui.diff.status_deleted":`deleted`,"web.ui.diff.note_no_changes":`This directory has no uncommitted changes.`,"web.ui.diff.note_not_a_git_repo":`This directory is not a git repository, so what is listed here is the paths this session touched through the file tools.`,"web.ui.diff.note_no_workspace_history":`This process holds no file record for this session (most likely it was left behind by an earlier process), so the changed files cannot be listed.`,"web.ui.diff.note_no_workspace":`This session has no workspace bound, so there is no directory to look at. Changing directory means starting a new session.`,"web.ui.diff.note_truncated":`Too many files changed; only the first {count} are listed here.`,"web.ui.diff.omit_binary":`binary`,"web.ui.diff.omit_binary_sized":`binary, {bytes}`,"web.ui.diff.omit_too_large":`too large`,"web.ui.diff.omit_too_large_sized":`too large, {bytes}`,"web.ui.diff.omit_too_large_why":`This file is over the 512 KB per-file limit, so neither side’s contents were fetched — that is why there is no diff here, not because nothing changed.`,"web.ui.diff.omit_no_snapshot":`no before-state`,"web.ui.diff.omit_no_snapshot_why":`This directory is not a git repository, and no snapshot was kept of how the file looked before this session touched it — so all we know is that it changed, not which lines.`,"web.ui.tools.no_session":`No session yet, so this table cannot be computed — the verdicts are worked out against one session’s current permission level. Start a session and come back.`,"web.ui.tools.loading":`Reading…`,"web.ui.tools.lede":`Every tool sent to the model this turn: where it came from, what it does, how many times this session called it, and who is blocking it right now.`,"web.ui.tools.axes":`"Who is blocking it" is computed on three axes: the parenthesis-free rules in the permission table first, then the permission level, and for code execution one more pass over the sandbox. None of the three looks at arguments — the sensitive-path and dangerous-command layer sits ahead of them and can only decide once a real call arrives with real arguments. So whether one specific call gets blocked is not something this table can answer.`,"web.ui.tools.level_line":`Computed against the "{level}" level. This screen reads once and stops — after changing the level from the composer, you have to leave this section and come back for it to recompute.`,"web.ui.tools.level_unknown":`This session’s permission level could not be read, so the "who is blocking it" column could not be computed this time.`,"web.ui.tools.ungraded_no_session":`This session’s permission level could not be read (most likely the session was left behind by an earlier process), so nothing below is graded — only the tools themselves are listed.`,"web.ui.tools.ungraded_no_layer":`This process did not send the permission verdicts down (its permission layer never came up), so nothing below is graded — only the tools themselves are listed.`,"web.ui.tools.g_all":`All tools`,"web.ui.tools.t_file_read":`Read files`,"web.ui.tools.t_file_write":`Write files`,"web.ui.tools.t_command":`Run commands`,"web.ui.tools.t_network":`Network access`,"web.ui.tools.t_code_exec":`Execute code`,"web.ui.tools.t_other":`Other`,"web.ui.tools.col_tool":`Tool`,"web.ui.tools.col_source":`Source`,"web.ui.tools.col_desc":`What it does`,"web.ui.tools.col_gate":`Who blocks it`,"web.ui.tools.col_calls":`Calls`,"web.ui.tools.v_allow":`allowed`,"web.ui.tools.v_ask":`asks first`,"web.ui.tools.v_deny":`denied`,"web.ui.tools.v_depends":`depends`,"web.ui.tools.v_none":`no verdict`,"web.ui.tools.by_none":`not graded`,"web.ui.tools.by_sandbox":`sandbox isolation`,"web.ui.tools.by_level":`{level} level`,"web.ui.tools.by_rule":`a rule`,"web.ui.tools.cond":`{count} argument-scoped rules could change this`,"web.ui.tools.how_to_block":`To block a tool, add a deny rule to the permission table. Rules only count once they are in a config file, and this interface never writes config — the security centre shows which rules exist today and which layer each came from.`,"web.ui.tools.goto_rules":`Open the rule table`,"web.ui.tools.mcp_note":`Tools from MCP servers are in this table too, named mcp__<server>__<tool>. The Source column says which server each one came from.`,"web.ui.tip.what":`What this is`,"web.ui.tip.about":`About {name}`,"web.ui.about.loading":`Reading…`,"web.ui.about.lede":`When something goes wrong, paste a screenshot of this into the issue — it beats describing the symptoms.`,"web.ui.about.g_machine":`This machine`,"web.ui.about.k_version":`Version`,"web.ui.about.version_line":`epoch {version} · Node {node} · {platform}`,"web.ui.about.k_home":`Data directory`,"web.ui.about.home_hint":`Sessions, config and logs all live here. Set EPOCH_HOME to move the lot somewhere else.`,"web.ui.about.k_db":`Session database`,"web.ui.about.db_hint":`Every session’s record is in this one file. It follows the data directory and the profile — switching profile means switching to an entirely separate set of data.`,"web.ui.about.k_profile":`Profile`,"web.ui.about.profile_hint":`Chosen with EPOCH_PROFILE or --profile. The default profile does not draw this row — seeing it here means the two paths above differ from everyone else’s.`,"web.ui.about.g_diag":`Startup diagnostics`,"web.ui.about.diag_lede":`What this process checked as it came up. The sidebar only draws the ones with a problem; this is all four kinds.`,"web.ui.about.diag_none":`This process sent no diagnostics at all. That is not the same as "all clear" — a module that self-checked records an ok even when nothing is wrong.`,"web.ui.about.diag_line":`{module}: {detail}`,"web.ui.about.update_note":`Run this in a terminal: it checks for a new version and tells you how to upgrade:`,"web.ui.auto.title":`Automation`,"web.ui.auto.back":`Back to session`,"web.ui.auto.tab_tasks":`Scheduled tasks`,"web.ui.auto.tab_runs":`Run history`,"web.ui.auto.loading":`Loading…`,"web.ui.auto.dismiss":`Got it`,"web.ui.auto.notice_os":`You do not need to keep epoch running — the OS scheduler wakes these tasks up. But occurrences due while the machine is off, or while nobody is logged in, are skipped and never caught up.`,"web.ui.auto.notice_unsupported":`This platform cannot register scheduled tasks with the OS scheduler yet (Windows and macOS only for now). Tasks can be created, but nothing will fire them.`,"web.ui.auto.notice_host":`This app has no headless entry point the OS scheduler can wake. Scheduled tasks only run while the app is open: quit the app and they stop.`,"web.ui.auto.empty_title":`Start your first automation`,"web.ui.auto.empty_hint":`Have the agent do one thing for you on a schedule: sweep the repo, round up this week's PRs, scan for stale docs. Each run leaves something you can read.`,"web.ui.auto.new":`New task`,"web.ui.auto.tpl_use":`Use this template`,"web.ui.auto.tpl_more":`Add another from a template`,"web.ui.auto.tpl.repo_sweep.name":`Daily repo sweep`,"web.ui.auto.tpl.repo_sweep.desc":`Which branches are unmerged and how far behind main. One report every morning.`,"web.ui.auto.tpl.repo_sweep.prompt":`Sweep this repository and write today's report to ./reports/repo-sweep.md (overwriting it is fine):
|
|
64
|
+
|
|
65
|
+
1. local branches not yet merged into main, with the date of their last commit and how many commits they are behind main;
|
|
66
|
+
2. branches that were already merged but are still around (safe to delete);
|
|
67
|
+
3. whether the working tree has uncommitted changes.
|
|
68
|
+
|
|
69
|
+
git status / git branch / git log are enough. **Do not run git fetch or anything else that writes to .git**
|
|
70
|
+
— it is not on the allowlist, and a sweep should not change anything. So compute "behind by" from the
|
|
71
|
+
refs already present locally, and say so in the report. Finish with at most three lines: is there anything
|
|
72
|
+
here I need to deal with today?
|
|
73
|
+
`,"web.ui.auto.tpl.todo_digest.name":`Daily todo digest`,"web.ui.auto.tpl.todo_digest.desc":`Turns the todo list into something readable. One digest every morning.`,"web.ui.auto.tpl.todo_digest.prompt":`Read the current todo list (the todo tool) and write a digest to ./reports/todo-digest.md (overwriting it is fine):
|
|
74
|
+
|
|
75
|
+
1. what is due today (in progress, plus the top few queued);
|
|
76
|
+
2. items that have not moved in a long time, and for how long;
|
|
77
|
+
3. items that are done but not cleared yet.
|
|
78
|
+
|
|
79
|
+
**Read only**: do not add, complete or delete any todo — that is my call.
|
|
80
|
+
Finish with at most three lines: which one should I do first, and why.
|
|
81
|
+
`,"web.ui.auto.tpl.weekly_digest.name":`Weekly PR & issue digest`,"web.ui.auto.tpl.weekly_digest.desc":`What landed this week and what is still open. One report every Friday evening.`,"web.ui.auto.tpl.weekly_digest.prompt":`Round up the pull requests and issues of the last 7 days into ./reports/weekly-digest.md (overwriting it is fine):
|
|
82
|
+
|
|
83
|
+
1. PRs merged this week, one sentence each on what changed;
|
|
84
|
+
2. PRs still open, split into "waiting on review" and "waiting on the author";
|
|
85
|
+
3. issues opened this week, plus any older than two weeks with no activity.
|
|
86
|
+
|
|
87
|
+
Use the gh CLI (gh pr list / gh issue list) or the github MCP server, whichever works here.
|
|
88
|
+
If neither is available, **do not fall back to guessing** — write one honest line in the report saying
|
|
89
|
+
remote data could not be read on this machine. That is worth more than an invented digest.
|
|
90
|
+
`,"web.ui.auto.tpl.dep_checkup.name":`Dependency checkup`,"web.ui.auto.tpl.dep_checkup.desc":`What is behind and what has a known vulnerability. One report every Monday morning.`,"web.ui.auto.tpl.dep_checkup.prompt":`Give this repository's dependencies a checkup and write it to ./reports/dep-checkup.md (overwriting it is fine):
|
|
91
|
+
|
|
92
|
+
1. outdated packages (pnpm outdated), grouped into major / minor / patch;
|
|
93
|
+
2. known vulnerabilities (pnpm audit), ordered by severity;
|
|
94
|
+
3. the three that should be upgraded first, one sentence each on why (security > blocking other upgrades > merely old).
|
|
95
|
+
|
|
96
|
+
**Do not upgrade anything**: no pnpm update, no edits to package.json, do not touch the lockfile —
|
|
97
|
+
the allowlist only opens the read-only commands, and pressing the upgrade button is my job.
|
|
98
|
+
`,"web.ui.auto.tpl.stale_docs.name":`Stale docs scan`,"web.ui.auto.tpl.stale_docs.desc":`Whether the commands and paths the README mentions still exist. One report on the 1st.`,"web.ui.auto.tpl.stale_docs.prompt":`Scan this repository's documentation (README and everything under docs/) for statements that no longer
|
|
99
|
+
hold, and write them to ./reports/stale-docs.md (overwriting it is fine):
|
|
100
|
+
|
|
101
|
+
1. commands mentioned in the docs that are no longer in package.json's scripts;
|
|
102
|
+
2. file and directory paths mentioned in the docs that are no longer on disk;
|
|
103
|
+
3. relative links pointing inside the repository whose target is gone.
|
|
104
|
+
|
|
105
|
+
This one is **read only**: change nothing except that report — how the docs get fixed is my call.
|
|
106
|
+
Your job is to find which sentence is now false, each with a file and a line number.
|
|
107
|
+
`,"web.ui.auto.tpl.test_flake.name":`Test flake review`,"web.ui.auto.tpl.test_flake.desc":`Runs the suite and singles out the unstable ones. One report every Wednesday evening.`,"web.ui.auto.tpl.test_flake.prompt":`Run this repository's test suite, compare the result against the previous report, and write
|
|
108
|
+
./reports/test-flake.md (overwriting it is fine):
|
|
109
|
+
|
|
110
|
+
1. tests that failed this time, with the first line of each failure;
|
|
111
|
+
2. compared with the last report: newly red ones, and ones that were red then and are green now
|
|
112
|
+
(**those are the flake suspects**);
|
|
113
|
+
3. the ones that look most like flakes, each with one guess (clock dependent? order dependent?
|
|
114
|
+
depends on an external service?).
|
|
115
|
+
|
|
116
|
+
The suite can take a while, so this task's timeout is raised to 40 minutes. If it does not finish,
|
|
117
|
+
**say how far it got** — do not cherry-pick a subset and present it as a full run.
|
|
118
|
+
`,"web.ui.auto.mark_host":`Runs only while the app is open`,"web.ui.auto.never_run":`Never run`,"web.ui.auto.next_none":`Will not fire again`,"web.ui.auto.next_at":`Next {when}`,"web.ui.auto.last_at":`Last {status} · {when}`,"web.ui.auto.run_now":`Run once now`,"web.ui.auto.enable":`Enable`,"web.ui.auto.disable":`Disable`,"web.ui.auto.edit":`Edit`,"web.ui.auto.remove":`Delete`,"web.ui.auto.remove_confirm":`Delete "{name}"? Its registration in the OS scheduler goes with it. Run recordings are kept.`,"web.ui.auto.form_new":`New scheduled task`,"web.ui.auto.form_edit":`Edit scheduled task`,"web.ui.auto.g_what":`What it does`,"web.ui.auto.g_what_note":`The thing it runs when the time comes`,"web.ui.auto.g_where":`Where it runs`,"web.ui.auto.g_where_note":`Both optional — each has a definite default`,"web.ui.auto.g_when":`When it runs`,"web.ui.auto.g_may":`What it may do`,"web.ui.auto.g_may_note":`This group decides which confirmations it presses for you at night`,"web.ui.auto.g_cost":`How much it may spend`,"web.ui.auto.g_cost_note":`Three limits; hitting any one stops the run`,"web.ui.auto.required":`Required`,"web.ui.auto.f_name":`Name`,"web.ui.auto.f_prompt":`Prompt`,"web.ui.auto.f_prompt_hint":`What the agent should do when it fires. Say what it should leave behind — nobody will be there to ask.`,"web.ui.auto.f_workdir":`Workspace (optional)`,"web.ui.auto.f_workdir_note":`Left empty, it runs in ~/.epoch/automation/<task id>/. It never inherits any terminal's current directory.`,"web.ui.auto.f_workdir_default":`~/.epoch/automation/<task id>/`,"web.ui.auto.f_workdir_none":`No specific workspace`,"web.ui.auto.f_model":`Model (optional)`,"web.ui.auto.f_model_hint":`Empty uses the configured one`,"web.ui.auto.f_model_provider_note":`Whichever provider you pick is saved with the task and used when it fires. If that provider has no key on this machine at fire time, the run falls back to the default model and records a line about it.`,"web.ui.auto.f_kind":`Frequency`,"web.ui.auto.k_daily":`Daily`,"web.ui.auto.k_weekly":`Weekly`,"web.ui.auto.k_monthly":`Monthly`,"web.ui.auto.k_interval":`Every N`,"web.ui.auto.k_once":`Once`,"web.ui.auto.f_at":`Time`,"web.ui.auto.f_date":`Date`,"web.ui.auto.f_every":`Interval`,"web.ui.auto.f_weekdays":`Days of week`,"web.ui.auto.f_days":`Days of month`,"web.ui.auto.f_days_hint":`1, 15`,"web.ui.auto.f_days_note":`The 31st does not fire in short months — that is the native behaviour on both platforms.`,"web.ui.auto.f_start":`Active from (optional)`,"web.ui.auto.f_end":`Active until (optional)`,"web.ui.auto.f_window_note":`Both ends are inclusive. Leave an end blank and that end is unbounded. Firings that fall outside the range are recorded as "skipped (outside active range)" and are not made up later.`,"web.ui.auto.f_window_once":`A run-once task cannot carry an active range — it already is a single date, so these two cannot be filled in on this kind.`,"web.ui.auto.f_permission":`Permission level`,"web.ui.auto.f_bypass_ack":`I understand: this task will do anything without asking inside {workDir}, including deleting files and running arbitrary commands.`,"web.ui.auto.f_turns":`Max turns`,"web.ui.auto.f_turns_hint":`How many times the model may call a tool in one turn, 1 to 1000. On hitting the cap it stops and finishes its answer.`,"web.ui.auto.f_timeout":`Timeout (minutes)`,"web.ui.auto.f_timeout_note":`The only ruler that catches "a command hung" — turns and spend both stop growing there. 24 hours at most.`,"web.ui.auto.f_budget":`Max spend per run (USD)`,"web.ui.auto.f_budget_why":`Required, and we give no default: nobody is watching this task, and a fake default would make "woke up to $40" our fault.`,"web.ui.auto.save_and_run":`Save and run once`,"web.ui.auto.save_only":`Save only`,"web.ui.auto.cancel":`Cancel`,"web.ui.auto.blocked_budget":`Enter a budget above 0 to save`,"web.ui.auto.blocked_bypass":`Tick the acknowledgement to save`,"web.ui.auto.allow_title":`This task will do these without asking`,"web.ui.auto.allow_lede":`The permission level answers "does this need a human"; this list answers "it does, but nobody is there — which ones can go through anyway". Listed one by one so you can see them before you save.`,"web.ui.auto.allow_off_plan":`The read-only level has no authorisation surface at all, so no list is needed. ⚠️ What it denies is **not a missing grant**: it never becomes an IOU, and adding rules here will not help — change the level instead.`,"web.ui.auto.allow_off_bypass":`Under "skip every check" this list means nothing: the task will do anything without asking. Leaving a list that looks live would make you think you still have a boundary.`,"web.ui.auto.allow_ops":`Whole operation classes`,"web.ui.auto.allow_tools":`Whole tools (one per line)`,"web.ui.auto.allow_tools_hint":`terminal`,"web.ui.auto.allow_rules":`Rules (one per line)`,"web.ui.auto.allow_rules_hint":`terminal(git status)
|
|
119
|
+
file_write(./reports/**)
|
|
120
|
+
mcp__github__*`,"web.ui.auto.allow_rules_note":`A connector goes in as mcp__<server>__*; "only write this directory" goes in as file_write(<dir>/**).`,"web.ui.auto.allow_scope":`This list applies to this task only and is not affected by the global non-interactive allowlist.`,"web.ui.auto.reg_warn_source":`What got registered is this checkout's path — move or delete the repository and this task will fail.`,"web.ui.auto.reg_unsupported":`This platform cannot register scheduled tasks yet (Windows and macOS only for now), so nothing will fire it.`,"web.ui.auto.reg_npx":`An epoch run through npx cannot register scheduled tasks: its entry point lives in a temporary cache, and one cache clear kills the task.`,"web.ui.auto.reg_no_runner":`This app has no headless entry point the OS scheduler can wake, so this task only runs while the app is open.`,"web.ui.auto.reg_backend_error":`The OS scheduler reported an error: {detail}`,"web.ui.auto.runs_empty_none":`No runs yet — there is not a single scheduled task. Create one in the "Scheduled tasks" tab.`,"web.ui.auto.runs_empty_never":`No runs yet. It will fire on its own when due; if you cannot wait, hit "Run once now" over in the tasks tab.`,"web.ui.auto.run_manual":`manual`,"web.ui.auto.run_meta":"{turns} turns · ${cost}","web.ui.auto.run_orphan":`(task deleted)`,"web.ui.auto.just_ran":`Just ran: {status}`,"web.ui.auto.replay_show":`View recording`,"web.ui.auto.replay_hide":`Hide recording`,"web.ui.auto.replay_loading":`Loading recording…`,"web.ui.auto.replay_none":`No recording for this one (no session was started, or retention has pruned it).`,"web.ui.auto.replay_truncated":`This recording is long; only the first {count} frames are drawn.`,"web.ui.auto.pending_header":`{count} operations should have asked you, but nobody was there (IOUs)`,"web.ui.auto.pending_rule":`→ {rule}`,"web.ui.auto.pending_no_rule":`(no exact rule can be derived for this one)`,"web.ui.auto.pending_fix":`Add to the allowlist`,"web.ui.auto.pending_fixed":`✓ Added {count}: {rules}`,"web.ui.auto.pending_fixed_none":`Nothing was added — no exact rule can be derived for these, and hard-coding one would only put a dead rule in the list.`,"web.ui.auto.issue.name_empty":`Give it a name`,"web.ui.auto.issue.prompt_empty":`Say what it should do when it fires — a scheduled task with no prompt does nothing`,"web.ui.auto.issue.permission_unknown":`Unknown permission level: {detail}`,"web.ui.auto.issue.work_dir_missing":`This directory does not exist: {detail}`,"web.ui.auto.issue.budget_missing":`Enter a number above 0 (currently {detail})`,"web.ui.auto.issue.max_turns_invalid":`Must be a whole number between 1 and 1000 (currently {detail})`,"web.ui.auto.issue.timeout_invalid":`Must be positive and at most 24 hours (currently {detail} ms)`,"web.ui.auto.issue.trigger_time_invalid":`The time must be written HH:mm (currently {detail})`,"web.ui.auto.issue.trigger_weekdays_empty":`Pick at least one day`,"web.ui.auto.issue.trigger_days_invalid":`Days of month must be between 1 and 31 ({detail})`,"web.ui.auto.issue.trigger_interval_invalid":`That interval will not work ({detail} minutes) — only divisors of 60 and whole hours are allowed, because macOS can only enumerate times and an interval that does not divide evenly drifts at each hour boundary`,"web.ui.auto.issue.trigger_once_date_invalid":`The date must be written YYYY-MM-DD and must be a day that exists (currently {detail})`,"web.ui.auto.issue.trigger_once_past":`That moment has already passed; saving it would never fire ({detail})`,"web.ui.auto.issue.date_range_invalid":`The active range is wrong: {detail}`,"web.ui.auto.issue.date_range_on_once":`A run-once task cannot carry an active range — it is a date already`,"web.ui.auto.issue.rule_invalid":`{detail}`,"web.ui.auto.issue.bypass_needs_workdir":`This level must be bound to a workspace — "skip every check" plus an undefined directory is the literal meaning of "unbounded"`,"web.ui.auto.issue.bypass_workdir_too_broad":`The workspace for this level cannot be the home directory or the filesystem root (currently {detail})`,"web.ui.auto.issue.bypass_needs_limits":`Under this level, budget / turns / timeout must all have values`,"web.ui.auto.issue.bypass_not_confirmed":`This level needs the acknowledgement ticked first`,"web.route.deny_missing_credential":`missing credential: open the ?token= URL that epoch web printed`,"web.route.deny_bad_token":`wrong token. The server picks a new one on every start; use the newest URL`,"web.route.deny_bad_origin":`Origin is not allowed (DNS rebinding defence)`,"web.route.deny_bad_host":`Host does not match the address this server listens on (DNS rebinding defence)`,"web.route.internal_error":`internal server error`,"web.route.static_not_found":`not found: {path}`,"web.bad_message":`message has to be a non-empty string or EpochContentPart[]`,"web.session_busy":`The session is {state} and the queue is full; send again after this turn finishes`,"web.bad_outcome":`outcome has to be one of {choices}`,"web.approval_gone":`Approval {id} has already been answered or has expired`,"web.bad_answers":`answers has to be an object mapping question → string or array of strings. Send {json} if you cannot answer`,"web.question_gone":`Question {id} has already been answered or has expired`,"web.artifact_missing":`That artifact does not exist`,"web.unknown_session":`There is no session {id}`,"web.body_too_large":`The request body is over {limit} bytes`,"web.body_read_failed":`Reading the request body failed: {reason}`,"web.body_bad_json":`The request body is not valid JSON: {reason}`,"web.no_endpoint":`No such endpoint: {method} {path}`,"web.method_not_allowed":`Only {allow} is supported`,"web.placeholder_html_lang":`en`,"web.placeholder_ready":`The server is up and the auth cookie has been issued.`,"web.placeholder_no_build":`The frontend has not been built yet`,"web.placeholder_needs_build":`{no_build} — run {cmd} first.`,"web.placeholder_rest":`The REST / SSE endpoints already work: {endpoints}.`,"web.placeholder_endpoint_sep":`, `,"web.bad_port":`The port has to be an integer between 0 and 65535; got {value}`,"web.lan_needs_token":`--host {host} exposes the service beyond loopback, so --token <random> is required; refusing to start.`,"web.lan_needs_token_local":`For local use, drop --host (it binds 127.0.0.1 only by default).`,"web.lan_needs_token_lan":`If you really do want it on the LAN: {cmd}`,"web.listen_in_use":`Port {port} is already in use; try another: epoch web --port {next}`,"web.listen_no_permission":`No permission to listen on {host}:{port} (ports below 1024 need administrator rights)`,"web.listen_no_address":`This machine has no address {host}`,"web.listen_failed":`Listening on {host}:{port} failed: {reason}`,"schedule.list_header":`Scheduled tasks:`,"schedule.list_empty":`No scheduled tasks yet.`,"schedule.list_empty_hint":`Create one: epoch schedule add --name "daily sweep" --prompt "…" --daily 09:00 --budget 0.50`,"schedule.col_next":`next`,"schedule.col_last":`last`,"schedule.disabled_mark":`disabled`,"schedule.yes":`yes`,"schedule.no":`no`,"schedule.field_enabled":`Enabled`,"schedule.field_trigger":`Frequency`,"schedule.field_window":`Active window`,"schedule.field_next":`Next run`,"schedule.field_workdir":`Working directory`,"schedule.field_model":`Model`,"schedule.field_permission":`Permission level`,"schedule.field_limits":`Three limits`,"schedule.field_backend":`Registered in`,"schedule.field_prompt":`Prompt`,"schedule.field_last_run":`Last run: {when}`,"schedule.limits_value":`at most {turns} turns · at most {budget} USD · killed after {minutes} minutes`,"schedule.allowlist_header":`This task will do the following without asking:`,"schedule.allowlist_empty":`(the list is empty — anything needing approval becomes an IOU and the run ends)`,"schedule.allowlist_scope_note":`This list applies to this task only; the global non-interactive allowlist does not affect it.`,"schedule.allowlist_bypass":`Permission level is "skip all checks": the list means nothing here — the task will do anything without asking.`,"schedule.allowlist_readonly":`Permission level is "read-only": zero authorization surface by construction, no list needed.`,"schedule.created":`✓ Created and registered: {name} ({id})`,"schedule.created_next":`Run it once now and find out what authorization it is missing: epoch schedule run {id}`,"schedule.ask_name":`Task name`,"schedule.ask_prompt":`What should the agent do when it fires`,"schedule.ask_at":`What time each day (HH:mm)`,"schedule.ask_budget":`The most this single run may spend, in USD`,"schedule.ask_permission":`Permission level`,"schedule.permission.plan":`read-only`,"schedule.permission.default":`ask when needed`,"schedule.permission.accept_edits":`auto-accept edits`,"schedule.permission.bypass":`skip all checks`,"schedule.permission.auto":`auto-allow`,"schedule.trigger.daily":`every day at {at}`,"schedule.trigger.weekly":`every {days} at {at}`,"schedule.trigger.monthly":`day {days} of every month at {at}`,"schedule.trigger.every_minutes":`every {n} minutes`,"schedule.trigger.every_hours":`every {n} hours`,"schedule.trigger.once":`{date} {at} (once)`,"schedule.weekday.sun":`Sun`,"schedule.weekday.mon":`Mon`,"schedule.weekday.tue":`Tue`,"schedule.weekday.wed":`Wed`,"schedule.weekday.thu":`Thu`,"schedule.weekday.fri":`Fri`,"schedule.weekday.sat":`Sat`,"schedule.status.ok":`ok`,"schedule.status.failed":`failed`,"schedule.status.denied":`missing authorization`,"schedule.status.timeout":`timed out`,"schedule.status.budget":`limit reached`,"schedule.status.skipped_overlap":`skipped (previous run still going)`,"schedule.status.skipped_window":`skipped (outside the active window)`,"schedule.status.missed":`missed`,"schedule.drift.missing_in_os":`in the database, not in the OS (registration lost)`,"schedule.drift.orphan_in_os":`in the OS, not in the database (uninstall leftover)`,"schedule.drift.spec_mismatch":`in both, but they disagree`,"schedule.drift.never_registered":`the database row claims it was registered but carries no OS identifier`,"schedule.issue.name_empty":`the name cannot be empty`,"schedule.issue.prompt_empty":`the prompt cannot be empty — a scheduled task without one does nothing`,"schedule.issue.permission_unknown":`unknown permission level: {detail}`,"schedule.issue.work_dir_missing":`working directory does not exist: {detail}`,"schedule.issue.budget_missing":`--budget is required and must be positive (got {detail})`,"schedule.issue.max_turns_invalid":`--max-turns must be an integer between 1 and 1000 (got {detail})`,"schedule.issue.timeout_invalid":`--timeout must be positive and at most 24 hours (got {detail} ms)`,"schedule.issue.trigger_time_invalid":`the time must be HH:mm (got {detail})`,"schedule.issue.trigger_weekdays_empty":`the weekly schedule needs at least one day`,"schedule.issue.trigger_days_invalid":`days of the month must be between 1 and 31 ({detail})`,"schedule.issue.trigger_interval_invalid":`the interval must divide 60 or be a whole number of hours (got {detail} minutes) — launchd can only enumerate instants, so an interval that does not divide 60 drifts at every hour boundary`,"schedule.issue.trigger_once_date_invalid":`the date must be YYYY-MM-DD and must be a day that exists (got {detail})`,"schedule.issue.trigger_once_past":`that moment has already passed; even if saved it would never fire ({detail})`,"schedule.issue.date_range_invalid":`bad active window: {detail}`,"schedule.issue.date_range_on_once":`a one-shot task cannot carry an active window — it is a single date already`,"schedule.issue.rule_invalid":`{detail}`,"schedule.issue.bypass_needs_workdir":`"skip all checks" must be bound to a workspace — that level plus an undecided directory is the literal meaning of "unbounded"`,"schedule.issue.bypass_workdir_too_broad":`the workspace for "skip all checks" cannot be your home or the filesystem root (got {detail})`,"schedule.issue.bypass_needs_limits":`under "skip all checks" the budget, turn and timeout limits are all mandatory`,"schedule.issue.bypass_not_confirmed":`"skip all checks" needs an explicit acknowledgement: add --i-understand-bypass`,"schedule.run_start":`Running: {name}`,"schedule.run_meta":`{turns} turns · {cost} USD{manual}`,"schedule.run_manual":` · manual`,"schedule.fire_missing":`no task {id} in the database; did nothing`,"schedule.fire_disabled":`{id} is disabled; did nothing`,"schedule.pending_header":`{n} operations were denied because nobody was there to ask (IOUs):`,"schedule.pending_line":`{tool} {target}`,"schedule.pending_fix":`add this rule: {rule}`,"schedule.fix_hint":`Add these to the allowlist so the next run does not stall: epoch schedule run {id} --fix`,"schedule.fix_done":`✓ Appended {n} rules to the allowlist`,"schedule.fix_none":`nothing could be appended automatically (no exact rule can be derived from these)`,"schedule.startup_pending":`⏰ "{name}" did not run last time: {n} grants missing. Fix it: epoch schedule run {id} --fix`,"schedule.startup_pending_more":`⏰ "{name}" did not run last time: {n} grants missing ({rest} more tasks are waiting too). Fix it: epoch schedule run {id} --fix`,"schedule.logs_empty":`No runs recorded yet.`,"schedule.logs_recording":`── most recent recording ({path})`,"schedule.enabled_done":`✓ Enabled: {name}`,"schedule.disabled_done":`✓ Disabled (the task stays in the OS scheduler, just stopped): {name}`,"schedule.removed":`✓ Deleted and unregistered: {name}`,"schedule.removed_logs_kept":`The recordings are kept in {dir}/; delete them yourself if you want them gone`,"schedule.doctor_clean":`✓ Checked {n}; the database and the OS agree`,"schedule.doctor_found":`Found {n} disagreements:`,"schedule.doctor_hint":`--repair re-registers from the database (the database is the source of truth); --prune removes OS orphans`,"schedule.doctor_unsupported":`Scheduled tasks are not supported on this platform yet (Windows and macOS for now)`,"schedule.doctor_repaired":`✓ Re-registered: {name}`,"schedule.doctor_repair_failed":`✗ Could not re-register: {name} ({detail})`,"schedule.doctor_pruned":`✓ Unregistered: {id}`,"schedule.doctor_prune_failed":`✗ Could not unregister: {id} ({detail})`,"schedule.err_not_found":`no task {id}`,"schedule.err_not_found_hint":`Run epoch schedule list to see what exists`,"schedule.err_ambiguous":`the prefix {id} matches more than one task; be more specific:`,"schedule.err_invalid":`this task has problems and nothing was saved:`,"schedule.err_no_trigger":`a frequency is required: --daily / --weekly / --monthly / --every / --once`,"schedule.err_many_triggers":`only one frequency may be given`,"schedule.err_at_required":`--weekly / --monthly / --once need --at HH:mm`,"schedule.err_weekday":`unrecognized weekday: {value}`,"schedule.err_every":`unknown --every: {value}`,"schedule.err_every_hint":`Only these (they are exactly what both platforms can express): {values}`,"schedule.err_permission":`unknown --permission: {value}`,"schedule.err_operation":`unknown --allow-operation: {value}`,"schedule.err_budget":`--budget must be a positive number: {value}`,"schedule.err_budget_hint":`There is deliberately no default: a fake one would make "woke up to 40 dollars" our fault`,"schedule.err_missing_flags":`required values are missing and there is no terminal here to ask`,"schedule.err_missing_flags_hint":`At minimum give --name --prompt --budget and a frequency (--daily and friends)`,"schedule.err_npx":`An epoch run through npx cannot register scheduled tasks — its entry point lives in a temporary cache, so one cache clean breaks the task`,"schedule.err_npx_hint":`Install it first: npm i -g @epoch-agent/cli`,"schedule.err_no_host_runner":`This host has no headless entry point the OS scheduler can invoke, so scheduled tasks only run while the app is open`,"schedule.err_no_host_runner_hint":`To make them run after the app is closed, the host must provide scheduleRunner (see docs/EMBEDDING.md)`,"schedule.err_platform_unsupported":`Registering scheduled tasks is not supported on this platform yet (Windows and macOS for now)`,"schedule.err_backend":`the OS scheduler reported an error: {detail}`,"schedule.warn_source_entry":`⚠ The path registered points at this checkout; moving or deleting the repo will break this task`,"message_part.file":`[file {path}]`,"message_part.file_truncated":`[file {path}, truncated to {bytes} bytes]`,"message_part.file_binary":`[file {path}: binary file, no content attached]`,"message_part.file_denied":`[file {path}: the permission check did not allow it, no content attached]`,"message_part.file_unreadable":`[file {path}: could not be read, no content attached]`,"message_part.file_over_limit":`[file {path}: over this message's attachment limit, no content attached]`,"message_part.file_not_restored":`[file {path}: content is not re-read after a session is resumed; call file_read if you need it]`,"message_part.image":`[image {mediaType}]`,"message_part.image_unknown_type":`[image of unknown type]`,"message_part.session":`[referenced session "{name}"]`,"message_part.session_counted":`[referenced session "{name}" · {count} active message(s)]`,"message_part.session_counted_of_total":`[referenced session "{name}" · {count} of {total} active message(s)]`,"message_part.session_invalid_reference":`[referenced session "{name}" not attached: no single session matched]`,"message_part.session_self_reference":`[referenced session "{name}" not attached: it is this very session]`,"message_part.session_too_many":`[referenced session "{name}" not attached: too many sessions referenced in one message]`,"message_part.session_not_authorized":`[referenced session "{name}" not attached: that session is out of readable range]`,"message_part.session_budget_exceeded":`[referenced session "{name}" not attached: this message's attachment budget is used up]`,"message_part.session_not_restored":`[referenced session "{name}" not attached: not re-read after a session is resumed; call session_search if you need it]`,"approval.plan_head":`▣ The model handed in a plan for you to approve`,"approval.plan_previous_level":` Permission level before plan mode: {level}`,"approval.asks":`⚠️ {tool} wants to {what}`,"approval.target":` Target: {target}`,"approval.target_none":`(none)`,"approval.detail":` Detail: {detail}`,"approval.reason":` Reason: {reason}`,"approval.headless_allowed":`[allowed] pre-authorized for headless: {tool} {target}`,"approval.headless_denied":`[denied] cannot confirm in a non-interactive environment: {tool} {target}`,"approval.headless_denied_hint":`To allow it, pass --allow-tool {tool}, set headless.allowTools in config.yaml, or add a policy rule under ~/.epoch/policies/.`,"approval.ask":`Allow it?`,"approval.allow_always_cli":`Allow permanently (written to approvals.json)`,"approval.plan_execute_back":`{label} (permissions back to {level})`,"approval.plan_execute":`Approve and execute`,"approval.plan_readonly":`Approve, but stay read-only`,"approval.plan_revise":`Let me revise it`,"approval.deny":`Deny`,"approval.plan_ask":`This plan?`,"approval.plan_revise_ask":`What should change?`}};function Ne(e){return A(Me,e)}var Pe=`epoch.theme`,Fe=`epoch.lang`,Ie=`epoch.dirpick.hidden`,Le=`epoch.dirpick.at`,Re=[`on`,`off`],ze=`system`;function Be(e,t,n){let r=null;try{r=globalThis.localStorage?.getItem(e)??null}catch{}return r!==null&&t.includes(r)?r:n}function Ve(e,t){try{globalThis.localStorage?.setItem(e,t)}catch{}}function He(e,t){return Be(e,Re,t?`on`:`off`)===`on`}function Ue(e,t){Ve(e,t?`on`:`off`)}function We(e){let t=null;try{t=globalThis.localStorage?.getItem(e)??null}catch{}return t||void 0}function Ge(e,t){try{t?globalThis.localStorage?.setItem(e,t):globalThis.localStorage?.removeItem(e)}catch{}}var Ke=[ze,...pe],qe={zh:`zh-CN`,en:`en`};function Je(e){let t=e.split(/[.@]/)[0]?.replace(`_`,`-`).toLowerCase()??``;if(!(!t||t===`c`||t===`posix`))return t===`zh`||t.startsWith(`zh-`)?`zh`:`en`}function Ye(){let e=globalThis.navigator;return e?[...e.languages??[],e.language].filter(e=>typeof e==`string`&&e.length>0):[]}function Xe(e,t){if(k(e))return e;for(let e of t??Ye()){let t=Je(e);if(t)return t}return`zh`}function Ze(){return Be(Fe,Ke,ze)}function Qe(e){Ve(Fe,e)}function $e(e){document.documentElement.lang=qe[e]}var et=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})),P=o(((e,t)=>{t.exports=et()}))(),tt=v.createContext({pref:`system`,lang:`zh`,setPref:()=>void 0,t:Ne(`zh`)});function nt({children:e,initialPref:t}){let[n,r]=v.useState(t??Ze),i=Xe(n);v.useEffect(()=>$e(i),[i]);let a=v.useCallback(e=>{Qe(e),r(e)},[]),o=v.useMemo(()=>({pref:n,lang:i,setPref:a,t:Ne(i)}),[n,i,a]);return(0,P.jsx)(tt.Provider,{value:o,children:e})}function F(){return v.useContext(tt).t}function rt(){let{pref:e,lang:t,setPref:n}=v.useContext(tt);return{pref:e,lang:t,setPref:n}}var it={sm:`i i--sm`,md:`i`,lg:`i i--lg`};function I({name:e,size:t=`md`,label:n,className:r}){return(0,P.jsx)(`svg`,{className:r?`${it[t]} ${r}`:it[t],...n?{role:`img`,"aria-label":n}:{"aria-hidden":!0},children:(0,P.jsx)(`use`,{href:`#i-${e}`})})}function at(){return(0,P.jsx)(`svg`,{width:0,height:0,style:{position:`absolute`},"aria-hidden":!0,children:(0,P.jsxs)(`defs`,{children:[(0,P.jsxs)(`symbol`,{id:`i-arrow-left`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`m12 19-7-7 7-7`}),(0,P.jsx)(`path`,{d:`M19 12H5`})]}),(0,P.jsxs)(`symbol`,{id:`i-blocks`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`}),(0,P.jsx)(`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`})]}),(0,P.jsx)(`symbol`,{id:`i-check`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{d:`M20 6 9 17l-5-5`})}),(0,P.jsx)(`symbol`,{id:`i-chevron-down`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{d:`m6 9 6 6 6-6`})}),(0,P.jsx)(`symbol`,{id:`i-chevron-right`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{d:`m9 18 6-6-6-6`})}),(0,P.jsxs)(`symbol`,{id:`i-circle-alert`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,P.jsx)(`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`}),(0,P.jsx)(`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`})]}),(0,P.jsxs)(`symbol`,{id:`i-circle-x`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,P.jsx)(`path`,{d:`m15 9-6 6`}),(0,P.jsx)(`path`,{d:`m9 9 6 6`})]}),(0,P.jsxs)(`symbol`,{id:`i-copy`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),(0,P.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]}),(0,P.jsxs)(`symbol`,{id:`i-corner-down-left`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`}),(0,P.jsx)(`path`,{d:`m9 10-5 5 5 5`})]}),(0,P.jsxs)(`symbol`,{id:`i-cpu`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M12 20v2`}),(0,P.jsx)(`path`,{d:`M12 2v2`}),(0,P.jsx)(`path`,{d:`M17 20v2`}),(0,P.jsx)(`path`,{d:`M17 2v2`}),(0,P.jsx)(`path`,{d:`M2 12h2`}),(0,P.jsx)(`path`,{d:`M2 17h2`}),(0,P.jsx)(`path`,{d:`M2 7h2`}),(0,P.jsx)(`path`,{d:`M20 12h2`}),(0,P.jsx)(`path`,{d:`M20 17h2`}),(0,P.jsx)(`path`,{d:`M20 7h2`}),(0,P.jsx)(`path`,{d:`M7 20v2`}),(0,P.jsx)(`path`,{d:`M7 2v2`}),(0,P.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}),(0,P.jsx)(`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`})]}),(0,P.jsxs)(`symbol`,{id:`i-ellipsis-vertical`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`}),(0,P.jsx)(`circle`,{cx:`12`,cy:`5`,r:`1`}),(0,P.jsx)(`circle`,{cx:`12`,cy:`19`,r:`1`})]}),(0,P.jsxs)(`symbol`,{id:`i-file-diff`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}),(0,P.jsx)(`path`,{d:`M9 10h6`}),(0,P.jsx)(`path`,{d:`M12 13V7`}),(0,P.jsx)(`path`,{d:`M9 17h6`})]}),(0,P.jsx)(`symbol`,{id:`i-flag`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`})}),(0,P.jsx)(`symbol`,{id:`i-folder`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`})}),(0,P.jsx)(`symbol`,{id:`i-folder-open`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`})}),(0,P.jsxs)(`symbol`,{id:`i-info`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,P.jsx)(`path`,{d:`M12 16v-4`}),(0,P.jsx)(`path`,{d:`M12 8h.01`})]}),(0,P.jsxs)(`symbol`,{id:`i-layers`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`}),(0,P.jsx)(`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`}),(0,P.jsx)(`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`})]}),(0,P.jsxs)(`symbol`,{id:`i-list-checks`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M13 5h8`}),(0,P.jsx)(`path`,{d:`M13 12h8`}),(0,P.jsx)(`path`,{d:`M13 19h8`}),(0,P.jsx)(`path`,{d:`m3 17 2 2 4-4`}),(0,P.jsx)(`path`,{d:`m3 7 2 2 4-4`})]}),(0,P.jsxs)(`symbol`,{id:`i-lock`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}),(0,P.jsx)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]}),(0,P.jsxs)(`symbol`,{id:`i-panel-right`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,P.jsx)(`path`,{d:`M15 3v18`})]}),(0,P.jsxs)(`symbol`,{id:`i-plus`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M5 12h14`}),(0,P.jsx)(`path`,{d:`M12 5v14`})]}),(0,P.jsxs)(`symbol`,{id:`i-rotate-ccw`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,P.jsx)(`path`,{d:`M3 3v5h5`})]}),(0,P.jsxs)(`symbol`,{id:`i-settings-2`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M14 17H5`}),(0,P.jsx)(`path`,{d:`M19 7h-9`}),(0,P.jsx)(`circle`,{cx:`17`,cy:`17`,r:`3`}),(0,P.jsx)(`circle`,{cx:`7`,cy:`7`,r:`3`})]}),(0,P.jsx)(`symbol`,{id:`i-shield`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`})}),(0,P.jsxs)(`symbol`,{id:`i-sparkles`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`}),(0,P.jsx)(`path`,{d:`M20 2v4`}),(0,P.jsx)(`path`,{d:`M22 4h-4`}),(0,P.jsx)(`circle`,{cx:`4`,cy:`20`,r:`2`})]}),(0,P.jsx)(`symbol`,{id:`i-square`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`})}),(0,P.jsxs)(`symbol`,{id:`i-sun-moon`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M12 8a2.83 2.83 0 0 0 4 4 4 4 0 1 1-4-4`}),(0,P.jsx)(`path`,{d:`M12 2v2`}),(0,P.jsx)(`path`,{d:`M12 20v2`}),(0,P.jsx)(`path`,{d:`m4.9 4.9 1.4 1.4`}),(0,P.jsx)(`path`,{d:`m17.7 17.7 1.4 1.4`}),(0,P.jsx)(`path`,{d:`M2 12h2`}),(0,P.jsx)(`path`,{d:`M20 12h2`}),(0,P.jsx)(`path`,{d:`m6.3 17.7-1.4 1.4`}),(0,P.jsx)(`path`,{d:`m19.1 4.9-1.4 1.4`})]}),(0,P.jsxs)(`symbol`,{id:`i-terminal`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M12 19h8`}),(0,P.jsx)(`path`,{d:`m4 17 6-6-6-6`})]}),(0,P.jsxs)(`symbol`,{id:`i-text-quote`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M17 5H3`}),(0,P.jsx)(`path`,{d:`M21 12H8`}),(0,P.jsx)(`path`,{d:`M21 19H8`}),(0,P.jsx)(`path`,{d:`M3 12v7`})]}),(0,P.jsxs)(`symbol`,{id:`i-triangle-alert`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}),(0,P.jsx)(`path`,{d:`M12 9v4`}),(0,P.jsx)(`path`,{d:`M12 17h.01`})]}),(0,P.jsxs)(`symbol`,{id:`i-wallet`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1`}),(0,P.jsx)(`path`,{d:`M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4`})]}),(0,P.jsx)(`symbol`,{id:`i-wrench`,viewBox:`0 0 24 24`,children:(0,P.jsx)(`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`})}),(0,P.jsxs)(`symbol`,{id:`i-x`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M18 6 6 18`}),(0,P.jsx)(`path`,{d:`m6 6 12 12`})]}),(0,P.jsxs)(`symbol`,{id:`i-user-round`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`circle`,{cx:`12`,cy:`8`,r:`4`}),(0,P.jsx)(`path`,{d:`M4 21a8 8 0 0 1 16 0`})]}),(0,P.jsxs)(`symbol`,{id:`i-search`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,P.jsx)(`path`,{d:`m20 20-4.35-4.35`})]}),(0,P.jsxs)(`symbol`,{id:`i-pencil`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M3.5 20.5 5 16 17.5 3.5a2.12 2.12 0 0 1 3 3L8 19z`}),(0,P.jsx)(`path`,{d:`m15 6 3 3`})]}),(0,P.jsxs)(`symbol`,{id:`i-target`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,P.jsx)(`circle`,{cx:`12`,cy:`12`,r:`6`}),(0,P.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2`})]}),(0,P.jsxs)(`symbol`,{id:`i-gauge`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`m12 14 4-4`}),(0,P.jsx)(`path`,{d:`M4.21 12.5a9 9 0 0 1 15.58 0`})]}),(0,P.jsxs)(`symbol`,{id:`i-arrow-up-right`,viewBox:`0 0 24 24`,children:[(0,P.jsx)(`path`,{d:`M7 17 17 7`}),(0,P.jsx)(`path`,{d:`M11 7h6v6`})]})]})})}function ot(e){let[t,n]=v.useState([]),[r,i]=v.useState(),[a,o]=v.useState(),[s,c]=v.useState(),[l,u]=v.useState(),[d,f]=v.useState(),[p,m]=v.useState(),h=v.useRef(0),g=v.useRef(!1),_=v.useRef(!0);v.useEffect(()=>(_.current=!0,()=>{_.current=!1}),[]);let y=v.useCallback(()=>{g.current||(g.current=!0,e.providers().then(e=>{_.current&&n(e.providers)}).catch(()=>void 0))},[e]),b=v.useCallback((t,n)=>{let r=++h.current;i(t),c(`probing`),e.discoverModels(t,n?{refresh:!0}:{}).then(e=>{r===h.current&&(o(e.suggestions),c(e.suggestions.status))}).catch(()=>{r===h.current&&c(`probe-failed`)})},[e]),x=v.useCallback(async t=>{if(!r)return!1;u(`saving`),m(void 0);try{let i=await e.setProviderKey(r,t);return _.current?(f(i),u(`saved`),n(e=>e.map(e=>e.type===r?{...e,hasKey:i.hasKey,keyHint:i.keyHint}:e)),b(r,!0),!0):!1}catch(e){return _.current?(m(e instanceof Error?e.message:String(e)),u(`failed`),!1):!1}},[e,b,r]);return{providers:t,ensureProviders:y,...r?{provider:r}:{},select:v.useCallback(e=>{u(void 0),f(void 0),m(void 0),b(e,!1)},[b]),refresh:v.useCallback(()=>{r&&b(r,!0)},[b,r]),...a?{suggestions:a}:{},...s?{phase:s}:{},saveKey:x,...l?{keyPhase:l}:{},...d?{keyWrite:d}:{},...p?{keyError:p}:{}}}var st=h(),ct=6,lt=8;function ut(e,t,n){let r=e.top-ct-lt,i=n.height-e.bottom-ct-lt,a=t.height>r&&i>r?Math.min(e.bottom+ct,n.height-lt-t.height):Math.max(lt,e.top-ct-t.height),o=(e.left+e.right)/2-t.width/2;return{top:a,left:Math.max(lt,Math.min(o,n.width-lt-t.width))}}function dt({id:e,text:t,anchorRef:n}){let r=v.useRef(null);return v.useLayoutEffect(()=>{let e=r.current,t=n.current;if(!e||!t)return;let i=ut(t.getBoundingClientRect(),e.getBoundingClientRect(),{width:window.innerWidth,height:window.innerHeight});e.style.top=`${i.top}px`,e.style.left=`${i.left}px`}),(0,st.createPortal)((0,P.jsx)(`div`,{className:`tip__pop`,id:e,role:`tooltip`,ref:r,children:t}),document.body)}function ft(){let[e,t]=v.useState(!1);return v.useEffect(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t(!1)},r=()=>t(!1);return document.addEventListener(`keydown`,n),document.addEventListener(`scroll`,r,!0),()=>{document.removeEventListener(`keydown`,n),document.removeEventListener(`scroll`,r,!0)}},[e]),{open:e,bind:{onPointerEnter:()=>t(!0),onPointerLeave:()=>t(!1),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(e=>!e)}}}function pt({text:e,about:t,className:n}){let r=F(),i=v.useRef(null),a=v.useId(),{open:o,bind:s}=ft();return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`button`,{type:`button`,ref:i,className:n?`tip__btn ${n}`:`tip__btn`,"aria-label":t?r(`web.ui.tip.about`,{name:t}):r(`web.ui.tip.what`),"aria-expanded":o,"aria-describedby":o?a:void 0,...s,children:(0,P.jsx)(I,{name:`info`})}),o&&(0,P.jsx)(dt,{id:a,text:e,anchorRef:i})]})}function mt({text:e,children:t}){let n=v.useRef(null),r=v.useId(),{open:i,bind:a}=ft(),{onClick:o,...s}=a;return(0,P.jsxs)(P.Fragment,{children:[v.cloneElement(t,{ref:n,"aria-describedby":i?r:void 0,...s}),i&&(0,P.jsx)(dt,{id:r,text:e,anchorRef:n})]})}var ht=8,gt=6,_t=`data-anchored`;function vt(e,t,n,r=gt){let i=n.height-e.bottom-r-ht,a=e.top-r-ht,o=t.height>i&&a>i,s=Math.max(0,o?a:i),c=Math.min(t.height,s),l=Math.max(ht,o?e.top-r-c:e.bottom+r),u=e.left+t.width>n.width-ht?e.right-t.width:e.left;return{top:l,left:Math.max(ht,Math.min(u,n.width-ht-t.width)),maxHeight:s,up:o}}function yt({open:e,onClose:t,triggerRef:n,label:r,children:i}){let a=v.useRef(null),o=v.useCallback(()=>{let e=a.current,t=n.current;if(!e||!t)return;e.style.maxHeight=``;let r=vt(t.getBoundingClientRect(),e.getBoundingClientRect(),{width:window.innerWidth,height:window.innerHeight});e.style.top=`${r.top}px`,e.style.left=`${r.left}px`,e.style.maxHeight=`${r.maxHeight}px`},[n]);return v.useLayoutEffect(()=>{e&&o()}),v.useEffect(()=>{if(!e)return;let r=e=>{e.key===`Escape`&&(e.stopPropagation(),t(),n.current?.focus())},i=e=>{let r=e.target;r&&(a.current?.contains(r)||n.current?.contains(r)||(r instanceof Element?r:r.parentElement)?.closest(`[data-anchored]`)||t())},s=e=>{let r=e.target;if(!r||a.current?.contains(r))return;let i=n.current;i&&!r.contains(i)||t()},c=()=>o();return document.addEventListener(`keydown`,r,!0),document.addEventListener(`pointerdown`,i),document.addEventListener(`scroll`,s,!0),window.addEventListener(`resize`,c),()=>{document.removeEventListener(`keydown`,r,!0),document.removeEventListener(`pointerdown`,i),document.removeEventListener(`scroll`,s,!0),window.removeEventListener(`resize`,c)}},[e,t,n,o]),v.useEffect(()=>{e&&a.current?.querySelector(`input, button:not([disabled])`)?.focus()},[e]),e?(0,P.jsx)(`div`,{className:`menu`,ref:a,role:`group`,"aria-label":r,children:i}):null}function bt({onSelect:e,checked:t,disabled:n,title:r,detail:i,danger:a,unavailable:o}){return(0,P.jsxs)(`button`,{type:`button`,className:`menu__item${i?` menu__item--tall`:``}`,"data-danger":a?``:void 0,"data-unavailable":o?``:void 0,...t===void 0?{}:{role:`menuitemradio`,"aria-checked":t},disabled:(n??!1)||(o??!1),onClick:e,children:[t!==void 0&&(0,P.jsx)(I,{name:`check`,size:`sm`,className:`menu__tick`}),i?(0,P.jsxs)(`span`,{className:`menu__lines`,children:[(0,P.jsx)(`b`,{children:r}),(0,P.jsx)(`i`,{children:i})]}):r]})}function xt(){return(0,P.jsx)(`hr`,{className:`menu__sep`})}function St({tone:e=`info`,children:t}){return(0,P.jsxs)(`div`,{className:`menu__lock`,"data-tone":e,role:e===`warn`?`alert`:void 0,children:[(0,P.jsx)(I,{name:e===`warn`?`triangle-alert`:`info`,size:`sm`}),(0,P.jsx)(`div`,{children:t})]})}var Ct=2;function wt({open:e,anchorRef:t,onClose:n,className:r,children:i}){let a=v.useRef(null),o=v.useCallback(()=>{let e=a.current,n=t.current;if(!e||!n)return;e.style.maxHeight=``;let r=n.getBoundingClientRect();e.style.width=`${r.width}px`;let i=vt(r,{width:r.width,height:e.getBoundingClientRect().height},{width:window.innerWidth,height:window.innerHeight},Ct);e.style.top=`${i.top}px`,e.style.left=`${i.left}px`,e.style.maxHeight=`${i.maxHeight}px`},[t]);return v.useLayoutEffect(()=>{e&&o()}),v.useEffect(()=>{if(!e)return;let r=e=>{let r=e.target;if(!r||a.current?.contains(r))return;let i=t.current;i&&!r.contains(i)||n()},i=()=>o();return document.addEventListener(`scroll`,r,!0),window.addEventListener(`resize`,i),()=>{document.removeEventListener(`scroll`,r,!0),window.removeEventListener(`resize`,i)}},[e,n,o,t]),e?(0,st.createPortal)((0,P.jsx)(`div`,{className:r,ref:a,[_t]:``,children:i}),document.body):null}function Tt({catalog:e,value:t,onChange:n,onPick:r,onSubmit:i,keyField:a,onConfigureKey:o,busy:s,trailing:c}){let l=F(),{ensureProviders:u}=e;if(v.useEffect(()=>u(),[u]),e.providers.length===0)return null;let d=e.providers.find(t=>t.type===e.provider);return(0,P.jsxs)(`div`,{className:`mpick`,children:[(0,P.jsxs)(`div`,{className:`mpick__row`,children:[(0,P.jsx)(`label`,{className:`mpick__label`,htmlFor:`mpick-provider`,children:l(`web.ui.model.pick_provider`)}),(0,P.jsxs)(`div`,{className:`mpick__ctl`,children:[(0,P.jsxs)(`select`,{id:`mpick-provider`,className:`mpick__sel`,value:e.provider??``,onChange:t=>e.select(t.target.value),children:[e.provider===void 0&&(0,P.jsx)(`option`,{value:``,children:l(`web.ui.model.pick_provider_none`)}),e.providers.map(e=>(0,P.jsx)(`option`,{value:e.type,children:kt(e,l)},e.type))]}),e.provider!==void 0&&(0,P.jsxs)(`button`,{type:`button`,className:`btn btn--sm mpick__redo`,disabled:e.phase===`probing`,title:l(`web.ui.model.refresh_hint`),onClick:()=>e.refresh(),children:[(0,P.jsx)(I,{name:`rotate-ccw`,size:`sm`}),l(`web.ui.model.refresh`)]})]})]}),a&&d?.envVar&&(0,P.jsx)(Et,{catalog:e,chosen:d}),(0,P.jsx)(Ot,{catalog:e,value:t,onChange:n,onPick:r,...i?{onSubmit:i}:{},...s===void 0?{}:{busy:s},...c===void 0?{}:{trailing:c}}),e.phase&&(0,P.jsx)(At,{catalog:e,chosen:d,inlineKeyField:!!(a&&d?.envVar),...o?{onConfigureKey:o}:{}})]})}function Et({catalog:e,chosen:t}){let n=F(),[r,i]=v.useState(``),[a,o]=v.useState(!1),s=e.keyPhase===`saving`,c=()=>{let t=r.trim();!t||s||e.saveKey(t).then(e=>{e&&i(``)})};return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`mpick__row`,children:[(0,P.jsx)(`label`,{className:`mpick__label`,htmlFor:`mpick-key`,children:n(`web.ui.model.key_label`)}),(0,P.jsxs)(`div`,{className:`mpick__ctl`,children:[(0,P.jsx)(`input`,{id:`mpick-key`,className:`mpick__key`,type:a?`text`:`password`,autoComplete:`off`,spellCheck:!1,value:r,disabled:s,placeholder:t.keyHint??n(`web.ui.model.key_placeholder`),"aria-label":n(`web.ui.model.key_label`),onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&c()}}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--sm`,"aria-pressed":a,onClick:()=>o(e=>!e),children:n(a?`web.ui.model.key_hide`:`web.ui.model.key_show`)}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--sm btn--primary`,disabled:s||r.trim()===``,onClick:c,children:n(s?`web.ui.model.key_saving`:`web.ui.model.key_save`)})]})]}),(0,P.jsx)(`p`,{className:`mpick__keynote`,children:t.keyHint?n(`web.ui.model.key_has`,{hint:t.keyHint,env:t.envVar??``}):n(`web.ui.model.key_none`,{env:t.envVar??``})}),e.keyPhase===`saved`&&e.keyWrite&&(0,P.jsx)(Dt,{write:e.keyWrite}),e.keyPhase===`failed`&&e.keyError&&(0,P.jsx)(jt,{tone:`warn`,children:e.keyError})]})}function Dt({write:e}){let t=F();return(0,P.jsx)(jt,{tone:e.encrypted?`info`:`warn`,children:e.encrypted?t(`web.ui.model.key_saved_secure`,{backend:e.backend}):t(`web.ui.model.key_saved_plain`,{path:e.envPath??``})})}function Ot({catalog:e,value:t,onChange:n,onPick:r,onSubmit:i,busy:a,trailing:o}){let s=F(),[c,l]=v.useState(!1),[u,d]=v.useState(-1),f=e.suggestions?.models??[],p=`mpick-models`,m=v.useRef(null),h=v.useCallback(()=>{l(!1),d(-1)},[]);v.useEffect(()=>{h()},[e.provider,h]);let g=e=>{h(),r(e)};return(0,P.jsxs)(`div`,{className:`mpick__row`,children:[(0,P.jsx)(`label`,{className:`mpick__label`,htmlFor:`mpick-model`,children:s(`web.ui.model.pick_model`)}),(0,P.jsxs)(`div`,{className:`mpick__ctl mpick__ctl--combo`,children:[(0,P.jsxs)(`div`,{className:`mpick__combo`,ref:m,children:[(0,P.jsx)(`input`,{id:`mpick-model`,className:`mpick__input`,type:`text`,role:`combobox`,"aria-expanded":c,"aria-controls":p,"aria-autocomplete":`list`,"aria-activedescendant":u>=0?`${p}-${u}`:void 0,autoComplete:`off`,spellCheck:!1,value:t,placeholder:s(`web.ui.model.placeholder`),"aria-label":s(`web.ui.model.placeholder`),disabled:a,onChange:e=>{n(e.target.value),d(-1)},onKeyDown:e=>{if(!e.nativeEvent.isComposing){if(e.key===`ArrowDown`&&f.length>0){e.preventDefault(),l(!0),d(e=>(e+1)%f.length);return}if(e.key===`ArrowUp`&&f.length>0){e.preventDefault(),l(!0),d(e=>e<=0?f.length-1:e-1);return}if(e.key===`Escape`&&c){e.stopPropagation(),h();return}if(e.key===`Enter`){e.preventDefault();let n=u>=0?f[u]:void 0;if(n)return g(n);let r=t.trim();r&&i?.(r)}}}}),f.length>0&&(0,P.jsx)(`button`,{type:`button`,className:`mpick__caret`,"aria-label":s(`web.ui.model.suggest_open`),"aria-expanded":c,"aria-controls":p,disabled:a,onClick:()=>l(e=>!e),children:(0,P.jsx)(I,{name:`chevron-down`,size:`sm`})}),(0,P.jsxs)(wt,{open:c&&f.length>0,anchorRef:m,onClose:h,className:`mpick__pop`,children:[(0,P.jsx)(`ul`,{className:`mpick__list`,id:p,role:`listbox`,"aria-label":s(`web.ui.model.label`),children:f.map((e,n)=>(0,P.jsx)(`li`,{id:`${p}-${n}`,role:`option`,"aria-selected":e===t,className:`mpick__opt`,"data-active":n===u?``:void 0,onMouseDown:t=>{t.preventDefault(),g(e)},onMouseEnter:()=>d(n),children:e},e))}),(0,P.jsx)(`p`,{className:`mpick__note`,children:s(`web.ui.model.suggest_note`)})]})]}),o]})]})}function kt(e,t){return e.hasKey?e.label:t(`web.ui.model.provider_no_key`,{label:e.label})}function At({catalog:e,chosen:t,inlineKeyField:n,onConfigureKey:r}){let i=F(),a=t?.label??e.provider??``;switch(e.phase){case`probing`:return(0,P.jsx)(jt,{tone:`info`,children:i(`web.ui.model.probe_probing`,{provider:a})});case`no-key`:return(0,P.jsxs)(jt,{tone:`warn`,children:[n?i(`web.ui.model.probe_no_key_here`,{provider:a}):t?.envVar?i(`web.ui.model.probe_no_key`,{provider:a,env:t.envVar}):i(`web.ui.model.probe_no_key_bare`,{provider:a}),!n&&r&&(0,P.jsx)(`button`,{type:`button`,className:`btn btn--sm mpick__go`,onClick:r,children:i(`web.ui.model.key_goto`)})]});case`probe-failed`:return(0,P.jsx)(jt,{tone:`warn`,children:e.suggestions?.source===`cache`?i(`web.ui.model.probe_failed_cache`,{provider:a}):i(`web.ui.model.probe_failed_static`,{provider:a})});case`empty`:return(0,P.jsx)(jt,{tone:`warn`,children:i(`web.ui.model.probe_empty`,{provider:a})});default:return(0,P.jsx)(jt,{tone:`info`,children:i(`web.ui.model.probe_ok`,{provider:a,count:String(e.suggestions?.models.length??0)})})}}function jt({tone:e,children:t}){return(0,P.jsxs)(`p`,{className:`mpick__say`,"data-tone":e,...e===`warn`?{role:`alert`}:{},children:[(0,P.jsx)(I,{name:e===`warn`?`triangle-alert`:`info`,size:`sm`}),(0,P.jsx)(`span`,{children:t})]})}function Mt({catalog:e,value:t,onChange:n,disabled:r,label:i,hint:a,providerNote:o}){let s=F(),c=e!==void 0&&e.providers.length>0;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{className:`field__label`,children:[i,c&&o!==void 0&&(0,P.jsx)(pt,{text:o,about:i})]}),e!==void 0&&(0,P.jsx)(Tt,{catalog:e,value:t,onChange:n,onPick:n,busy:r}),!c&&(0,P.jsx)(`input`,{type:`text`,value:t,disabled:r,"aria-label":i,placeholder:s(`web.ui.model.placeholder`),onChange:e=>n(e.target.value)}),(0,P.jsx)(`span`,{className:`field__hint`,children:a})]})}function Nt(e,t,n){if(e===null)return null;let r=e.trim();return!r||t===void 0||t===n||C(r)?.provider!==void 0?e:`${t}/${r}`}function Pt({on:e,hidden:t,onToggle:n,className:r=`dirpick__hidden`}){let i=F();return(0,P.jsxs)(`label`,{className:r,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>n(e.target.checked)}),(0,P.jsx)(`span`,{children:t>0?i(`web.ui.dirpick.show_hidden_count`,{count:t}):i(`web.ui.dirpick.show_hidden`)})]})}function Ft(e,t){return e===`anchors`?{}:e===`home`?{at:`home`,hidden:t}:{path:e,hidden:t}}function It(e,t){let[n,r]=v.useState({state:`loading`}),[i,a]=v.useState(()=>We(`epoch.dirpick.at`)??`home`),[o,s]=v.useState(()=>He(Ie,!1)),c=v.useRef(!0),l=v.useRef(null),u=v.useCallback((e=`home`)=>{c.current=!1,r({state:`loading`}),a(e)},[]),d=v.useCallback(e=>{Ue(Ie,e),s(e)},[]);return v.useEffect(()=>{if(!e||!t)return;let n=!0;return r({state:`loading`}),e.workspaceDirs(Ft(i,o)).then(e=>{n&&(c.current=!1,e.path!==null&&Ge(Le,e.path),e.path!==null&&(l.current=e.path),r({state:`ready`,...e}))}).catch(e=>{if(!n)return;let t=c.current;if(c.current=!1,t&&i!==`home`&&i!==`anchors`){Ge(Le,void 0),a(`home`);return}let o=e?.detail??(e instanceof Error?e.message:``);r({state:`error`,message:typeof o==`string`&&o?o:String(e),path:i===`home`||i===`anchors`?null:i,back:l.current})}),()=>{n=!1}},[e,t,i,o]),{view:n,go:u,showHidden:o,setShowHidden:d}}function Lt({browser:e,onPick:t,busy:n,onBack:r,onCreate:i,createError:a,note:o}){let s=F(),{view:c,go:l,showHidden:u,setShowHidden:d}=e,f=c.state===`ready`?c.path:null;return(0,P.jsxs)(`div`,{className:`dirpick`,children:[(0,P.jsxs)(`div`,{className:`dirpick__bar`,children:[(0,P.jsxs)(`button`,{className:`dirpick__back`,type:`button`,onClick:r,title:s(`web.ui.dirpick.back`),children:[(0,P.jsx)(I,{name:`arrow-left`,size:`sm`}),s(`web.ui.dirpick.back`)]}),(0,P.jsx)(`span`,{className:`dirpick__where`,title:Ht(c,s),children:Vt(c,s)}),c.state===`ready`&&c.path!==null&&(0,P.jsxs)(`button`,{className:`dirpick__here`,type:`button`,disabled:n,title:s(`web.ui.dirpick.use_here_of`,{path:c.path}),onClick:()=>t(c.path??``),children:[(0,P.jsx)(I,{name:`check`,size:`sm`}),s(`web.ui.dirpick.use_here`)]})]}),o!==void 0&&o!==``&&(0,P.jsx)(St,{tone:`warn`,children:o}),c.state===`ready`&&c.parent!==null&&(0,P.jsx)(bt,{onSelect:()=>l(c.parent??void 0),disabled:n,title:s(`web.ui.dirpick.up`),detail:c.parent}),c.state===`ready`&&c.path!==null&&(0,P.jsx)(bt,{onSelect:()=>l(`anchors`),disabled:n,title:s(`web.ui.dirpick.anchors`),detail:s(`web.ui.dirpick.anchors_detail`)}),c.state===`ready`&&c.path!==null&&(0,P.jsx)(Pt,{on:u,hidden:c.hidden,onToggle:d}),c.state===`loading`&&(0,P.jsx)(St,{children:s(`web.ui.dirpick.loading`)}),c.state===`error`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(St,{tone:`warn`,children:c.message}),c.back!==null&&(0,P.jsx)(bt,{onSelect:()=>l(c.back??void 0),disabled:n,title:s(`web.ui.dirpick.back_last`),detail:c.back}),(0,P.jsx)(bt,{onSelect:()=>l(`anchors`),disabled:n,title:s(`web.ui.dirpick.anchors`),detail:s(`web.ui.dirpick.anchors_detail`)})]}),c.state===`ready`&&c.entries.map(e=>(0,P.jsx)(Rt,{entry:e,onPick:t,busy:n,go:l},e.path)),c.state===`ready`&&c.entries.length===0&&(0,P.jsx)(St,{children:s(`web.ui.dirpick.empty`)}),c.state===`ready`&&c.omitted>0&&(0,P.jsx)(St,{tone:`warn`,children:s(`web.ui.dirpick.omitted`,{count:c.omitted})}),(0,P.jsx)(xt,{}),i&&f!==null&&(0,P.jsx)(zt,{parent:f,onCreate:i,busy:n,...a===void 0?{}:{error:a}}),(0,P.jsx)(Bt,{onPick:t,busy:n})]})}function Rt({entry:e,onPick:t,busy:n,go:r}){let i=F(),a=n||!e.readable;return(0,P.jsxs)(`div`,{className:`dirpick__row`,"data-unreadable":e.readable?void 0:``,children:[(0,P.jsxs)(`button`,{className:`dirpick__pick`,type:`button`,onClick:()=>r(e.path),disabled:a,title:e.readable?i(`web.ui.dirpick.into_of`,{name:e.name,path:e.path}):i(`web.ui.dirpick.unreadable`,{path:e.path}),children:[(0,P.jsx)(I,{name:e.known?`folder-open`:`folder`,size:`sm`}),(0,P.jsx)(`span`,{className:`dirpick__name`,children:e.name}),e.known&&(0,P.jsx)(`span`,{className:`dirpick__tag`,children:i(`web.ui.dirpick.known`)})]}),(0,P.jsx)(`button`,{className:`dirpick__use`,type:`button`,onClick:()=>t(e.path),disabled:a,title:i(`web.ui.dirpick.use`,{name:e.name}),"aria-label":i(`web.ui.dirpick.use`,{name:e.name}),children:(0,P.jsx)(I,{name:`check`,size:`sm`})})]})}function zt({parent:e,onCreate:t,busy:n,error:r}){let i=F(),[a,o]=v.useState(``),s=a.trim(),c=()=>{!s||n||(t(e,s),o(``))};return(0,P.jsxs)(`div`,{className:`dirpick__manual`,children:[(0,P.jsx)(`label`,{className:`dirpick__label`,htmlFor:`dirpick-new`,children:i(`web.ui.dirpick.new_label`)}),(0,P.jsxs)(`div`,{className:`dirpick__entry`,children:[(0,P.jsx)(`input`,{id:`dirpick-new`,className:`input`,value:a,placeholder:i(`web.ui.dirpick.new_hint`),disabled:n,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),(0,P.jsx)(`button`,{className:`btn`,type:`button`,onClick:c,disabled:n||s.length===0,children:i(`web.ui.dirpick.new_go`)})]}),r&&(0,P.jsx)(St,{tone:`warn`,children:r}),(0,P.jsx)(`p`,{className:`dirpick__note`,children:i(`web.ui.dirpick.new_trust_note`)})]})}function Bt({onPick:e,busy:t}){let n=F(),[r,i]=v.useState(``),a=r.trim(),o=()=>{!a||t||e(a)};return(0,P.jsxs)(`div`,{className:`dirpick__manual`,children:[(0,P.jsx)(`label`,{className:`dirpick__label`,htmlFor:`dirpick-path`,children:n(`web.ui.dirpick.manual_label`)}),(0,P.jsxs)(`div`,{className:`dirpick__entry`,children:[(0,P.jsx)(`input`,{id:`dirpick-path`,className:`input`,value:r,placeholder:n(`web.ui.dirpick.manual_hint`),disabled:t,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())}}),(0,P.jsx)(`button`,{className:`btn btn--primary`,type:`button`,onClick:o,disabled:t||a.length===0,children:n(`web.ui.dirpick.manual_go`)})]})]})}function Vt(e,t){return e.state===`error`||e.state===`ready`?e.path??t(`web.ui.dirpick.anchors`):t(`web.ui.dirpick.anchors`)}function Ht(e,t){return Vt(e,t)}function Ut(e,t){let[n,r]=v.useState(!1),i=v.useRef(null);return v.useEffect(()=>()=>{i.current?.abort()},[]),{available:t,run:v.useCallback(async()=>{if(!e||!t||i.current)return{kind:`failed`,message:``};let n=new AbortController;i.current=n,r(!0);try{let t=await e.pickDirectory(n.signal);return`path`in t&&t.path?{kind:`picked`,path:t.path}:{kind:`canceled`}}catch(e){if(n.signal.aborted)return{kind:`canceled`};let t=e?.detail??(e instanceof Error?e.message:``);return{kind:`failed`,message:typeof t==`string`&&t?t:String(e)}}finally{i.current=null,r(!1)}},[e,t]),busy:n}}function Wt({view:e,choices:t,open:n,setOpen:r,close:i,triggerRef:a,client:o,nativeDirPicker:s=!1}){let c=F(),[l,u]=v.useState(!1),d=It(o,l),f=Gt(o,d),p=Ut(o,s),[m,h]=v.useState();v.useEffect(()=>{n||(u(!1),h(void 0))},[n]);let g=v.useCallback(()=>{if(!p.available)return u(!0);p.run().then(t=>{if(t.kind===`picked`)return e.pick(t.path);t.kind!==`canceled`&&(h(t.message),u(!0))})},[p,e]);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,className:`fact fact--menu`,ref:a,"aria-haspopup":`true`,"aria-expanded":n,disabled:e.busy,onClick:()=>r(e=>!e),children:[(0,P.jsx)(I,{name:`layers`,size:`sm`}),c(`web.ui.composer.workspace_pick`),(0,P.jsx)(I,{name:`chevron-down`,size:`sm`})]}),(0,P.jsxs)(yt,{open:n,onClose:i,triggerRef:a,label:c(`web.ui.composer.workspace_pick_label`),children:[l?(0,P.jsx)(Lt,{browser:d,onPick:e.pick,busy:e.busy||f.busy,onBack:()=>u(!1),...o?{onCreate:f.run}:{},...f.error===void 0?{}:{createError:f.error},...m===void 0?{}:{note:m}}):null,!l&&t.map(t=>(0,P.jsx)(bt,{onSelect:()=>e.pick(t.root),disabled:e.busy,title:t.current?c(`web.ui.composer.workspace_here_current`,{name:t.name}):t.name,detail:t.root??``},t.root??``)),!l&&t.length>0&&(0,P.jsx)(xt,{}),!l&&o&&(0,P.jsx)(bt,{onSelect:g,disabled:e.busy||p.busy,title:c(`web.ui.composer.workspace_browse`),detail:c(p.available?`web.ui.composer.workspace_browse_native`:`web.ui.composer.workspace_browse_detail`)}),!l&&(0,P.jsx)(bt,{onSelect:()=>e.pick(null),disabled:e.busy,title:c(`web.ui.composer.no_workspace`),detail:c(`web.ui.composer.workspace_none_detail`)}),e.error?(0,P.jsx)(St,{tone:`warn`,children:e.error}):!l&&(0,P.jsx)(St,{children:c(`web.ui.composer.workspace_pick_note`)})]})]})}function Gt(e,t){let[n,r]=v.useState(!1),[i,a]=v.useState(),{go:o}=t;return{run:v.useCallback((t,i)=>{!e||n||(r(!0),a(void 0),e.createWorkspaceDir(t,i).then(()=>{r(!1),o(t)}).catch(e=>{r(!1);let t=e?.detail??(e instanceof Error?e.message:``);a(typeof t==`string`&&t?t:String(e))}))},[n,e,o]),busy:n,...i===void 0?{}:{error:i}}}var Kt=`workdir-field-value`;function qt({value:e,onChange:t,choices:n=[],client:r,disabled:i,emptyLabel:a,label:o,clearLabel:s,labelledBy:c,nativeDirPicker:l=!1}){let u=F(),[d,f]=v.useState(!1),[p,m]=v.useState(!1),h=v.useRef(null),g=v.useCallback(()=>f(!1),[]),_=It(r,p),y=Gt(r,_),b=Ut(r,l),[x,S]=v.useState();v.useEffect(()=>{d||(m(!1),S(void 0))},[d]);let C=e=>{t(e),f(!1)},w=()=>{if(!b.available)return m(!0);b.run().then(e=>{if(e.kind===`picked`)return C(e.path);e.kind!==`canceled`&&(S(e.message),m(!0))})};return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,className:`autoform__pick`,ref:h,"aria-haspopup":`true`,"aria-expanded":d,...c===void 0?{}:{"aria-labelledby":`${c} ${Kt}`},disabled:i,title:e||a,onClick:()=>f(e=>!e),children:[(0,P.jsx)(I,{name:`layers`,size:`sm`}),(0,P.jsx)(`span`,{className:`autoform__pickval`,id:Kt,"data-empty":e?void 0:``,children:e||a}),(0,P.jsx)(I,{name:`chevron-down`,size:`sm`})]}),(0,P.jsxs)(yt,{open:d,onClose:g,triggerRef:h,label:o,children:[p?(0,P.jsx)(Lt,{browser:_,onPick:C,busy:i||y.busy,onBack:()=>m(!1),...r?{onCreate:y.run}:{},...y.error===void 0?{}:{createError:y.error},...x===void 0?{}:{note:x}}):null,!p&&n.map(e=>(0,P.jsx)(bt,{onSelect:()=>C(e.root??``),disabled:i,title:e.name,detail:e.root??``},e.root??``)),!p&&n.length>0&&(0,P.jsx)(xt,{}),!p&&r&&(0,P.jsx)(bt,{onSelect:w,disabled:i||b.busy,title:u(`web.ui.composer.workspace_browse`),detail:u(b.available?`web.ui.composer.workspace_browse_native`:`web.ui.composer.workspace_browse_detail`)}),!p&&(0,P.jsx)(bt,{onSelect:()=>C(``),disabled:i,title:s,detail:a})]})]})}function Jt(e){return e.split(`
|
|
121
|
+
`).map(e=>e.trim()).filter(e=>e.length>0)}function Yt({value:e,onChange:t,applies:n,reason:r,issues:i,disabled:a}){let o=F(),s=a||!n;return(0,P.jsxs)(`fieldset`,{className:`autoform__allow`,"data-off":n?void 0:``,children:[(0,P.jsx)(`legend`,{className:`field__label`,children:o(`web.ui.auto.allow_title`)}),r!==null&&(0,P.jsxs)(`p`,{className:`note`,"data-tone":`info`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`circle-alert`,size:`sm`})}),(0,P.jsx)(`span`,{children:o(r===`plan`?`web.ui.auto.allow_off_plan`:`web.ui.auto.allow_off_bypass`)})]}),n&&(0,P.jsx)(`p`,{className:`field__hint`,children:o(`web.ui.auto.allow_lede`)}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.allow_ops`)}),(0,P.jsx)(`span`,{className:`autoform__ops`,children:te.map(n=>(0,P.jsxs)(`label`,{className:`autoform__chk`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:e.allowOperations.includes(n),disabled:s,onChange:r=>t({...e,allowOperations:r.target.checked?[...e.allowOperations,n]:e.allowOperations.filter(e=>e!==n)})}),(0,P.jsx)(`code`,{children:n})]},n))})]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.allow_tools`)}),(0,P.jsx)(`textarea`,{rows:2,value:e.allowTools,disabled:s,placeholder:o(`web.ui.auto.allow_tools_hint`),onChange:n=>t({...e,allowTools:n.target.value})})]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.allow_rules`)}),(0,P.jsx)(`textarea`,{rows:3,value:e.allowRules,disabled:s,placeholder:o(`web.ui.auto.allow_rules_hint`),onChange:n=>t({...e,allowRules:n.target.value})}),(0,P.jsx)(`span`,{className:`field__hint`,children:o(`web.ui.auto.allow_rules_note`)})]}),i.map((e,t)=>(0,P.jsx)(`p`,{className:`autoform__err`,role:`alert`,children:e},`rule-issue-${t}`)),n&&(0,P.jsx)(`p`,{className:`field__hint`,children:o(`web.ui.auto.allow_scope`)})]})}var Xt={plan:{title:`web.ui.perm.lvl_plan`,detail:`web.ui.perm.lvl_plan_detail`},default:{title:`web.ui.perm.lvl_default`,detail:`web.ui.perm.lvl_default_detail`},acceptEdits:{title:`web.ui.perm.lvl_accept_edits`,detail:`web.ui.perm.lvl_accept_edits_detail`},auto:{title:`web.ui.perm.lvl_auto`,detail:`web.ui.perm.lvl_auto_detail`},bypass:{title:`web.ui.perm.lvl_bypass`,detail:`web.ui.perm.lvl_bypass_detail`}},Zt=[`plan`,`default`,`acceptEdits`,`auto`,`bypass`];function Qt(e,t){let n=Xt[e];return n?t(n.title):e}function $t(e,t){return e.kind===`refused`?t(en[e.reason]):e.message}var en={managed:`web.ui.perm.blocked_managed`},tn={"no-user-config":`web.ui.perm.keep_no_config`,unwritable:`web.ui.perm.keep_unwritable`,io:`web.ui.perm.keep_io`,"env-pinned":`web.ui.perm.keep_env_pinned`};function nn({view:e}){let t=F(),[n,r]=v.useState(!1),i=v.useRef(null),a=v.useCallback(()=>r(!1),[]),o=v.useRef(!1);if(v.useEffect(()=>{!o.current||e.busy||(o.current=!1,e.notRemembered||r(!1))},[e.busy,e.notRemembered]),e.level===null)return null;let s=Qt(e.level,t),c=t(`web.ui.composer.permission`,{level:s});return e.editable?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,className:`fact fact--menu`,ref:i,"data-perm":e.level,"aria-haspopup":`true`,"aria-expanded":n,"aria-label":c,disabled:e.busy,onClick:()=>r(e=>!e),children:[(0,P.jsx)(I,{name:`shield`,size:`sm`}),s,(0,P.jsx)(I,{name:`chevron-down`,size:`sm`})]}),(0,P.jsxs)(yt,{open:n,onClose:a,triggerRef:i,label:t(`web.ui.perm.menu_label`),children:[Zt.map(n=>{let r=e.blocked.find(e=>e.level===n);return(0,P.jsx)(bt,{checked:e.level===n,unavailable:r!==void 0,danger:n===`bypass`,title:t(Xt[n].title),detail:t(Xt[n].detail),onSelect:()=>{o.current=!0,e.set(n)}},n)}),e.blocked.length>0&&(0,P.jsx)(St,{tone:`warn`,children:t(`web.ui.perm.blocked_managed`)}),e.notRemembered&&(0,P.jsx)(St,{children:t(tn[e.notRemembered.reason])})]}),e.error&&(0,P.jsx)(`span`,{className:`fact fact--err`,role:`alert`,children:$t(e.error,t)}),e.notRemembered&&!n&&(0,P.jsx)(`span`,{className:`fact`,children:t(tn[e.notRemembered.reason])})]}):(0,P.jsx)(`span`,{className:`fact`,"data-perm":e.level,children:c})}var rn={"name-empty":`web.ui.auto.issue.name_empty`,"prompt-empty":`web.ui.auto.issue.prompt_empty`,"permission-unknown":`web.ui.auto.issue.permission_unknown`,"work-dir-missing":`web.ui.auto.issue.work_dir_missing`,"budget-missing":`web.ui.auto.issue.budget_missing`,"max-turns-invalid":`web.ui.auto.issue.max_turns_invalid`,"timeout-invalid":`web.ui.auto.issue.timeout_invalid`,"trigger-time-invalid":`web.ui.auto.issue.trigger_time_invalid`,"trigger-weekdays-empty":`web.ui.auto.issue.trigger_weekdays_empty`,"trigger-days-invalid":`web.ui.auto.issue.trigger_days_invalid`,"trigger-interval-invalid":`web.ui.auto.issue.trigger_interval_invalid`,"trigger-once-date-invalid":`web.ui.auto.issue.trigger_once_date_invalid`,"trigger-once-past":`web.ui.auto.issue.trigger_once_past`,"date-range-invalid":`web.ui.auto.issue.date_range_invalid`,"date-range-on-once":`web.ui.auto.issue.date_range_on_once`,"rule-invalid":`web.ui.auto.issue.rule_invalid`,"bypass-needs-workdir":`web.ui.auto.issue.bypass_needs_workdir`,"bypass-workdir-too-broad":`web.ui.auto.issue.bypass_workdir_too_broad`,"bypass-needs-limits":`web.ui.auto.issue.bypass_needs_limits`,"bypass-not-confirmed":`web.ui.auto.issue.bypass_not_confirmed`},an={ok:`schedule.status.ok`,failed:`schedule.status.failed`,denied:`schedule.status.denied`,timeout:`schedule.status.timeout`,budget:`schedule.status.budget`,"skipped-overlap":`schedule.status.skipped_overlap`,"skipped-window":`schedule.status.skipped_window`,missed:`schedule.status.missed`},on={0:`schedule.weekday.sun`,1:`schedule.weekday.mon`,2:`schedule.weekday.tue`,3:`schedule.weekday.wed`,4:`schedule.weekday.thu`,5:`schedule.weekday.fri`,6:`schedule.weekday.sat`};function sn(e){return e===`ok`?`ok`:e===`failed`||e===`denied`?`error`:`warn`}function cn(e,t){let n=an[e];return n?t(n):e}function ln(e,t){return e.kind===`interval`?e.everyMinutes<60?t(`schedule.trigger.every_minutes`,{n:e.everyMinutes}):t(`schedule.trigger.every_hours`,{n:e.everyMinutes/60}):e.kind===`once`?t(`schedule.trigger.once`,{date:e.date,at:e.at}):e.cycle===`daily`?t(`schedule.trigger.daily`,{at:e.at}):e.cycle===`weekly`?t(`schedule.trigger.weekly`,{days:e.weekdays.map(e=>t(on[e])).join(`/`),at:e.at}):t(`schedule.trigger.monthly`,{days:e.days.join(`/`),at:e.at})}function un(e,t){return t(on[e])}function dn(e,t){return t(rn[e.code],{detail:e.detail??``})}var fn={"name-empty":`name`,"prompt-empty":`prompt`,"permission-unknown":`permission`,"work-dir-missing":`workDir`,"budget-missing":`budget`,"max-turns-invalid":`maxTurns`,"timeout-invalid":`timeout`,"trigger-time-invalid":`trigger`,"trigger-weekdays-empty":`trigger`,"trigger-days-invalid":`trigger`,"trigger-interval-invalid":`trigger`,"trigger-once-date-invalid":`trigger`,"trigger-once-past":`trigger`,"date-range-invalid":`window`,"date-range-on-once":`window`,"rule-invalid":`allowlist`,"bypass-needs-workdir":`workDir`,"bypass-workdir-too-broad":`workDir`,"bypass-needs-limits":`permission`,"bypass-not-confirmed":`permission`};function pn(e,t){return e.filter(e=>fn[e.code]===t)}function mn(e){let t=new Set(Object.keys(fn));return e.filter(e=>!t.has(e.code))}function hn(e){let t=[`plan`,`default`,`acceptEdits`,`bypass`];return t.includes(e)?t:[...t,e]}var gn={"repo-sweep":{name:`web.ui.auto.tpl.repo_sweep.name`,desc:`web.ui.auto.tpl.repo_sweep.desc`,prompt:`web.ui.auto.tpl.repo_sweep.prompt`},"todo-digest":{name:`web.ui.auto.tpl.todo_digest.name`,desc:`web.ui.auto.tpl.todo_digest.desc`,prompt:`web.ui.auto.tpl.todo_digest.prompt`},"weekly-digest":{name:`web.ui.auto.tpl.weekly_digest.name`,desc:`web.ui.auto.tpl.weekly_digest.desc`,prompt:`web.ui.auto.tpl.weekly_digest.prompt`},"dep-checkup":{name:`web.ui.auto.tpl.dep_checkup.name`,desc:`web.ui.auto.tpl.dep_checkup.desc`,prompt:`web.ui.auto.tpl.dep_checkup.prompt`},"stale-docs":{name:`web.ui.auto.tpl.stale_docs.name`,desc:`web.ui.auto.tpl.stale_docs.desc`,prompt:`web.ui.auto.tpl.stale_docs.prompt`},"test-flake":{name:`web.ui.auto.tpl.test_flake.name`,desc:`web.ui.auto.tpl.test_flake.desc`,prompt:`web.ui.auto.tpl.test_flake.prompt`}},_n=6e4;function vn(e){return{name:``,prompt:``,workDir:``,model:``,permission:`default`,maxBudgetUsd:``,maxTurns:String(e.maxTurns),timeoutMin:String(Math.round(e.timeoutMs/_n)),trigger:{kind:`cron`,cycle:`daily`,at:`09:00`},startDate:``,endDate:``,allow:{allowTools:e.allowTools.join(`
|
|
122
|
+
`),allowOperations:e.allowOperations,allowRules:e.allowRules.join(`
|
|
123
|
+
`)},bypassAck:!1}}function yn(e,t,n){let r=gn[e.id];return{...vn(t),name:n(r.name),prompt:n(r.prompt),permission:e.permission,trigger:e.trigger,allow:{allowTools:(e.allowTools??[]).join(`
|
|
124
|
+
`),allowOperations:e.allowOperations??[],allowRules:(e.allowRules??[]).join(`
|
|
125
|
+
`)},...e.timeoutMs===void 0?{}:{timeoutMin:String(Math.round(e.timeoutMs/_n))}}}function bn(e,t,n,r){return n?{name:n.name,prompt:n.prompt,workDir:n.workDir,model:n.model??``,permission:n.permission,maxBudgetUsd:String(n.maxBudgetUsd),maxTurns:String(n.maxTurns),timeoutMin:String(Math.round(n.timeoutMs/_n)),trigger:n.trigger,startDate:n.startDate??``,endDate:n.endDate??``,allow:{allowTools:n.allowTools.join(`
|
|
126
|
+
`),allowOperations:n.allowOperations,allowRules:n.allowRules.join(`
|
|
127
|
+
`)},bypassAck:!1}:r?yn(r,e,t):vn(e)}function xn(e){let t=Number(e.trim());return e.trim().length>0&&Number.isFinite(t)&&t>0?t:null}var Sn=[0,1,2,3,4,5,6];function Cn(e,t,n){return e===`interval`?{kind:`interval`,everyMinutes:60}:e===`once`?{kind:`once`,date:``,at:n}:t===`weekly`?{kind:`cron`,cycle:`weekly`,at:n,weekdays:[]}:t===`monthly`?{kind:`cron`,cycle:`monthly`,at:n,days:[1]}:{kind:`cron`,cycle:`daily`,at:n}}function wn({value:e,onChange:t,disabled:n}){let r=F(),i=e.kind===`interval`?`09:00`:e.at,a=e.kind===`cron`?e.cycle:`daily`;return(0,P.jsxs)(`div`,{className:`autoform__trigger`,children:[(0,P.jsxs)(`div`,{className:`autoform__row`,children:[(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.auto.f_kind`)}),(0,P.jsxs)(`select`,{value:e.kind===`cron`?a:e.kind,disabled:n,onChange:e=>{let n=e.target.value;t(n===`interval`||n===`once`?Cn(n,a,i):Cn(`cron`,n,i))},children:[(0,P.jsx)(`option`,{value:`daily`,children:r(`web.ui.auto.k_daily`)}),(0,P.jsx)(`option`,{value:`weekly`,children:r(`web.ui.auto.k_weekly`)}),(0,P.jsx)(`option`,{value:`monthly`,children:r(`web.ui.auto.k_monthly`)}),(0,P.jsx)(`option`,{value:`interval`,children:r(`web.ui.auto.k_interval`)}),(0,P.jsx)(`option`,{value:`once`,children:r(`web.ui.auto.k_once`)})]})]}),e.kind===`once`&&(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.auto.f_date`)}),(0,P.jsx)(`input`,{type:`date`,value:e.date,disabled:n,onChange:n=>t({...e,date:n.target.value})})]}),e.kind!==`interval`&&(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.auto.f_at`)}),(0,P.jsx)(`input`,{type:`time`,value:e.at,disabled:n,onChange:n=>t({...e,at:n.target.value})})]}),e.kind===`interval`&&(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.auto.f_every`)}),(0,P.jsx)(`select`,{value:String(e.everyMinutes),disabled:n,onChange:e=>t({kind:`interval`,everyMinutes:Number(e.target.value)}),children:ne.map(e=>(0,P.jsx)(`option`,{value:e,children:e<60?r(`schedule.trigger.every_minutes`,{n:e}):r(`schedule.trigger.every_hours`,{n:e/60})},e))})]})]}),e.kind===`cron`&&e.cycle===`weekly`&&(0,P.jsxs)(`fieldset`,{className:`autoform__days`,children:[(0,P.jsx)(`legend`,{className:`field__label`,children:r(`web.ui.auto.f_weekdays`)}),Sn.map(i=>(0,P.jsxs)(`label`,{className:`autoform__chk`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:e.weekdays.includes(i),disabled:n,onChange:n=>t({...e,weekdays:n.target.checked?[...e.weekdays,i].sort((e,t)=>e-t):e.weekdays.filter(e=>e!==i)})}),(0,P.jsx)(`span`,{children:un(i,r)})]},i))]}),e.kind===`cron`&&e.cycle===`monthly`&&(0,P.jsx)(Tn,{days:e.days,disabled:n,onChange:n=>t({...e,days:n})})]})}function Tn({days:e,disabled:t,onChange:n}){let r=F(),[i,a]=v.useState(()=>e.join(`, `));return v.useEffect(()=>{a(t=>Dn(En(t),e)?t:e.join(`, `))},[e]),(0,P.jsxs)(`label`,{className:`autoform__months`,children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.auto.f_days`)}),(0,P.jsx)(`input`,{type:`text`,inputMode:`numeric`,value:i,disabled:t,placeholder:r(`web.ui.auto.f_days_hint`),onChange:e=>{a(e.target.value),n(En(e.target.value))}}),(0,P.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.auto.f_days_note`)})]})}function En(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0).map(e=>Number(e)).filter(e=>Number.isInteger(e))}function Dn(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}var On=`auto-workdir-label`;function kn({title:e,note:t,tone:n,children:r}){return(0,P.jsxs)(`section`,{className:`fgroup`,...n?{"data-tone":n}:{},children:[(0,P.jsx)(`h3`,{className:`fgroup__title`,children:e}),t&&(0,P.jsx)(`p`,{className:`fgroup__note`,children:t}),(0,P.jsx)(`div`,{className:`fgroup__body`,children:r})]})}function An({def:e,template:t,defaults:n,issues:r,catalog:i,workspaceChoices:a,client:o,nativeDirPicker:s,busy:c,onCancel:l,onSave:u}){let d=F(),[f,p]=v.useState(()=>bn(n,d,e,t)),m=v.useCallback(e=>p(t=>({...t,...e})),[]),h=xn(f.maxBudgetUsd),g=f.permission===`bypass`,_=f.permission!==`plan`&&!g,y=c||f.name.trim().length===0||f.prompt.trim().length===0||h===null||g&&!f.bypassAck,b=t=>{if(y||h===null)return;let n=xn(f.maxTurns),r=xn(f.timeoutMin),a={name:f.name.trim(),prompt:f.prompt,permission:f.permission,trigger:f.trigger,maxBudgetUsd:h,allowTools:Jt(f.allow.allowTools),allowOperations:f.allow.allowOperations,allowRules:Jt(f.allow.allowRules),...n===null?{}:{maxTurns:Math.round(n)},...r===null?{}:{timeoutMs:Math.round(r*_n)},...g?{bypassAcknowledged:!0}:{}},o=Nt(f.model.trim(),i?.provider);if(e){u({...a,workDir:f.workDir.trim()||null,model:Nt(f.model.trim(),i?.provider)||null,startDate:f.startDate||null,endDate:f.endDate||null},t);return}u({...a,...f.workDir.trim()?{workDir:f.workDir.trim()}:{},...o?{model:o}:{},...f.startDate?{startDate:f.startDate}:{},...f.endDate?{endDate:f.endDate}:{}},t)},x=e=>pn(r,e).map((e,t)=>(0,P.jsx)(`p`,{className:`autoform__err`,role:`alert`,children:dn(e,d)},`${e.code}-${t}`));return(0,P.jsxs)(`form`,{className:`autoform`,onSubmit:e=>{e.preventDefault(),b(!0)},children:[(0,P.jsx)(`h2`,{className:`autoform__title`,children:d(e?`web.ui.auto.form_edit`:`web.ui.auto.form_new`)}),(0,P.jsxs)(kn,{title:d(`web.ui.auto.g_what`),note:d(`web.ui.auto.g_what_note`),children:[(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,"data-req":d(`web.ui.auto.required`),children:d(`web.ui.auto.f_name`)}),(0,P.jsx)(`input`,{type:`text`,value:f.name,disabled:c,onChange:e=>m({name:e.target.value})}),x(`name`)]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,"data-req":d(`web.ui.auto.required`),children:d(`web.ui.auto.f_prompt`)}),(0,P.jsx)(`textarea`,{rows:4,value:f.prompt,disabled:c,placeholder:d(`web.ui.auto.f_prompt_hint`),onChange:e=>m({prompt:e.target.value})}),x(`prompt`)]})]}),(0,P.jsxs)(kn,{title:d(`web.ui.auto.g_where`),note:d(`web.ui.auto.g_where_note`),children:[(0,P.jsxs)(`div`,{className:`autoform__field`,children:[(0,P.jsx)(`span`,{className:`field__label`,id:On,children:d(`web.ui.auto.f_workdir`)}),(0,P.jsx)(qt,{value:f.workDir,onChange:e=>m({workDir:e}),disabled:c,emptyLabel:d(`web.ui.auto.f_workdir_default`),label:d(`web.ui.auto.f_workdir`),clearLabel:d(`web.ui.auto.f_workdir_none`),labelledBy:On,...a?{choices:a}:{},...o?{client:o}:{},...s===void 0?{}:{nativeDirPicker:s}}),(0,P.jsx)(`span`,{className:`field__hint`,children:d(`web.ui.auto.f_workdir_note`)}),x(`workDir`)]}),(0,P.jsx)(`div`,{className:`autoform__field`,children:(0,P.jsx)(Mt,{value:f.model,onChange:e=>m({model:e}),disabled:c,label:d(`web.ui.auto.f_model`),hint:d(`web.ui.auto.f_model_hint`),providerNote:d(`web.ui.auto.f_model_provider_note`),...i?{catalog:i}:{}})})]}),(0,P.jsxs)(kn,{title:d(`web.ui.auto.g_when`),children:[(0,P.jsx)(wn,{value:f.trigger,disabled:c,onChange:e=>m({trigger:e})}),x(`trigger`),(0,P.jsxs)(`div`,{className:`autoform__row`,children:[(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:d(`web.ui.auto.f_start`)}),(0,P.jsx)(`input`,{type:`date`,value:f.startDate,disabled:c||f.trigger.kind===`once`,onChange:e=>m({startDate:e.target.value})})]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:d(`web.ui.auto.f_end`)}),(0,P.jsx)(`input`,{type:`date`,value:f.endDate,disabled:c||f.trigger.kind===`once`,onChange:e=>m({endDate:e.target.value})})]})]}),(0,P.jsx)(`span`,{className:`field__hint`,children:d(f.trigger.kind===`once`?`web.ui.auto.f_window_once`:`web.ui.auto.f_window_note`)}),x(`window`)]}),(0,P.jsxs)(kn,{title:d(`web.ui.auto.g_may`),note:d(`web.ui.auto.g_may_note`),tone:`warn`,children:[(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:d(`web.ui.auto.f_permission`)}),(0,P.jsx)(`select`,{value:f.permission,disabled:c,onChange:e=>{let t=e.target.value;ee(t)&&m({permission:t,bypassAck:!1})},children:hn(f.permission).map(e=>(0,P.jsx)(`option`,{value:e,children:Qt(e,d)},e))}),x(`permission`)]}),g&&(0,P.jsxs)(`label`,{className:`autoform__ack`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:f.bypassAck,disabled:c,onChange:e=>m({bypassAck:e.target.checked})}),(0,P.jsx)(`span`,{children:d(`web.ui.auto.f_bypass_ack`,{workDir:f.workDir.trim()||d(`web.ui.auto.f_workdir_default`)})})]}),(0,P.jsx)(Yt,{value:f.allow,onChange:e=>m({allow:e}),applies:_,reason:f.permission===`plan`?`plan`:g?`bypass`:null,issues:pn(r,`allowlist`).map(e=>dn(e,d)),disabled:c})]}),(0,P.jsx)(kn,{title:d(`web.ui.auto.g_cost`),note:d(`web.ui.auto.g_cost_note`),children:(0,P.jsxs)(`div`,{className:`autoform__row`,children:[(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,"data-req":d(`web.ui.auto.required`),children:d(`web.ui.auto.f_budget`)}),(0,P.jsx)(`input`,{type:`number`,step:`0.01`,min:`0`,value:f.maxBudgetUsd,disabled:c,"aria-invalid":h===null,"aria-describedby":`auto-budget-why`,onChange:e=>m({maxBudgetUsd:e.target.value})}),(0,P.jsx)(`span`,{className:`field__hint`,id:`auto-budget-why`,children:d(`web.ui.auto.f_budget_why`)}),x(`budget`)]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:d(`web.ui.auto.f_turns`)}),(0,P.jsx)(`input`,{type:`number`,min:`1`,max:`1000`,value:f.maxTurns,disabled:c,onChange:e=>m({maxTurns:e.target.value})}),(0,P.jsx)(`span`,{className:`field__hint`,children:d(`web.ui.auto.f_turns_hint`)}),x(`maxTurns`)]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:d(`web.ui.auto.f_timeout`)}),(0,P.jsx)(`input`,{type:`number`,min:`1`,max:`1440`,value:f.timeoutMin,disabled:c,onChange:e=>m({timeoutMin:e.target.value})}),(0,P.jsx)(`span`,{className:`field__hint`,children:d(`web.ui.auto.f_timeout_note`)}),x(`timeout`)]})]})}),mn(r).map((e,t)=>(0,P.jsx)(`p`,{className:`autoform__err`,role:`alert`,children:dn(e,d)},`unplaced-${t}`)),(0,P.jsxs)(`div`,{className:`autoform__foot`,children:[(0,P.jsx)(`button`,{type:`submit`,className:`btn btn--primary`,disabled:y,children:d(`web.ui.auto.save_and_run`)}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost`,disabled:y,onClick:()=>b(!1),children:d(`web.ui.auto.save_only`)}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost`,disabled:c,onClick:l,children:d(`web.ui.auto.cancel`)}),h===null&&(0,P.jsxs)(`span`,{className:`autoform__blocked`,role:`status`,children:[(0,P.jsx)(I,{name:`circle-alert`,size:`sm`}),d(`web.ui.auto.blocked_budget`)]}),g&&!f.bypassAck&&(0,P.jsxs)(`span`,{className:`autoform__blocked`,role:`status`,children:[(0,P.jsx)(I,{name:`circle-alert`,size:`sm`}),d(`web.ui.auto.blocked_bypass`)]})]})]})}function jn({row:e,state:t,acts:n,onRename:r}){let i=F(),[a,o]=v.useState(!1),[s,c]=v.useState(!1),[l,u]=v.useState(!1),[d,f]=v.useState(),p=v.useRef(null),m=v.useRef(null),h=v.useCallback(()=>{o(!1),c(!1),f(void 0)},[]);v.useEffect(()=>{s&&m.current?.focus()},[s]);let g=e.title||i(`web.ui.topbar.untitled`);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`button`,{className:`srow__more`,type:`button`,ref:p,"aria-label":i(`web.ui.slist.acts`,{title:g}),"aria-haspopup":`true`,"aria-expanded":a,onClick:()=>a?h():o(!0),children:(0,P.jsx)(I,{name:`ellipsis-vertical`,size:`sm`})}),(0,P.jsx)(yt,{open:a,onClose:h,triggerRef:p,label:i(`web.ui.slist.acts`,{title:g}),children:(0,P.jsxs)(`div`,{className:`srowmenu`,children:[s?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`srowmenu__ask`,children:i(`web.ui.slist.delete_ask`,{title:g})}),(0,P.jsx)(`p`,{className:`srowmenu__what`,children:i(`web.ui.slist.delete_what`)}),t===`awaiting`&&(0,P.jsx)(`p`,{className:`srowmenu__what`,children:i(`web.ui.slist.delete_awaiting`,{count:e.pendingApprovals+e.pendingQuestions})}),t===`running`&&(0,P.jsx)(`p`,{className:`srowmenu__what`,children:i(`web.ui.slist.delete_running`)}),(0,P.jsxs)(`div`,{className:`srowmenu__exits`,children:[(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,ref:m,onClick:h,children:i(`web.ui.slist.cancel`)}),(0,P.jsx)(`button`,{className:`btn btn--danger btn--sm`,type:`button`,disabled:l,onClick:()=>{l||(u(!0),f(void 0),n.remove(e.id).then(e=>{if(u(!1),!e.ok){f(e.message);return}n.reload()}))},children:i(`web.ui.slist.delete_do`)})]})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(bt,{onSelect:()=>{h(),r()},title:i(`web.ui.slist.rename`)}),(0,P.jsx)(bt,{danger:!0,onSelect:()=>c(!0),title:i(`web.ui.slist.delete`)})]}),d&&(0,P.jsx)(St,{tone:`warn`,children:d})]})})]})}function Mn({row:e,acts:t,onDone:n}){let r=F(),[i,a]=v.useState(e.title??``),[o,s]=v.useState(!1),[c,l]=v.useState(),u=v.useRef(null),d=v.useRef(!1);return v.useEffect(()=>{let e=u.current;e&&(e.focus(),e.select())},[]),(0,P.jsxs)(`form`,{className:`srename`,onSubmit:r=>{if(r.preventDefault(),o)return;let a=i.trim();if(!a||a===(e.title??``)){n();return}d.current=!0,s(!0),l(void 0),t.rename(e.id,a).then(e=>{if(d.current=!1,s(!1),!e.ok){l(e.message);return}t.reload(),n()})},children:[(0,P.jsx)(`span`,{className:`srow__dot`,"aria-hidden":!0}),(0,P.jsx)(`input`,{className:`srename__input`,type:`text`,ref:u,value:i,disabled:o,"aria-label":r(`web.ui.slist.rename_label`),...c?{"aria-invalid":!0}:{},onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),n())},onBlur:()=>{d.current||n()}}),(0,P.jsx)(`button`,{className:`srename__go`,type:`submit`,disabled:o,"aria-label":r(`web.ui.slist.rename_do`),onMouseDown:e=>e.preventDefault(),children:(0,P.jsx)(I,{name:`corner-down-left`,size:`sm`})}),c&&(0,P.jsx)(`p`,{className:`srename__err`,role:`alert`,children:c})]})}function Nn(e,t){return e.updatedAt===t.updatedAt?e.id<t.id?-1:1:e.updatedAt===null?1:t.updatedAt===null?-1:t.updatedAt-e.updatedAt}function Pn(e){let t=[],n=[],r=new Map;for(let i of[...e].sort(Nn)){let e=i.workspace;if(e.state!==`bound`){(e.state===`none`?t:n).push(i);continue}let{root:a,name:o}=e.ref,s=r.get(a);s||(s={root:a,name:o,rows:[]},r.set(a,s)),s.rows.push(i)}return{tasks:t,spaces:[...r.values()],unknown:n}}function Fn(e){return e.pendingApprovals+e.pendingQuestions>0?`awaiting`:e.state===`idle`?`idle`:`running`}var In=[[`year`,31536e6],[`month`,2592e6],[`day`,864e5],[`hour`,36e5],[`minute`,6e4]];function Ln(e,t,n){let r=new Intl.RelativeTimeFormat(n,{numeric:`auto`}),i=e-t;for(let[e,t]of In){let n=Math.trunc(i/t);if(n!==0)return r.format(n,e)}return r.format(0,`minute`)}function Rn({row:e,current:t,now:n,locale:r,t:i,onOpen:a,acts:o}){let s=Fn(e),[c,l]=v.useState(!1),u=e.title||i(`web.ui.topbar.untitled`);return o&&c?(0,P.jsx)(`li`,{className:`srowbox`,children:(0,P.jsx)(Mn,{row:e,acts:o,onDone:()=>l(!1)})}):(0,P.jsxs)(`li`,{className:`srowbox`,children:[(0,P.jsxs)(`button`,{className:`srow`,type:`button`,"data-state":s,"aria-current":t,onClick:()=>a(e.id),children:[(0,P.jsx)(`span`,{className:`srow__dot`,"aria-hidden":!0}),(0,P.jsx)(`span`,{className:`srow__label`,children:u}),s===`awaiting`&&(0,P.jsx)(`span`,{className:`srow__pill`,children:i(`web.ui.slist.awaiting`)}),s===`running`&&(0,P.jsx)(`span`,{className:`srow__spin`,"aria-label":i(`web.ui.slist.running`)}),s===`idle`&&e.updatedAt!==null&&(0,P.jsx)(`span`,{className:`srow__meta`,title:i(`web.ui.slist.updated_at`),children:Ln(e.updatedAt,n,r)})]}),o&&(0,P.jsx)(jn,{row:e,state:s,acts:o,onRename:()=>l(!0)})]})}function zn({sessions:e,currentSessionId:t,onOpen:n,searching:r,acts:i,newSession:a}){let o=F(),{lang:s}=rt(),c=Date.now(),{tasks:l,spaces:u,unknown:d}=v.useMemo(()=>Pn(e),[e]);if(e.length===0)return(0,P.jsx)(`p`,{className:`slist__empty`,children:o(r?`web.ui.slist.no_match`:`web.ui.slist.empty`)});let f=e=>(0,P.jsx)(Rn,{row:e,current:e.id===t,now:c,locale:s,t:o,onOpen:n,...i?{acts:i}:{}},e.id);return(0,P.jsxs)(P.Fragment,{children:[l.length>0&&(0,P.jsxs)(`section`,{className:`section`,children:[(0,P.jsxs)(`h2`,{className:`section__title`,children:[o(`web.ui.slist.tasks`),(0,P.jsx)(`span`,{className:`section__count`,children:l.length})]}),(0,P.jsx)(`ul`,{className:`slist`,children:l.map(f)})]}),u.length>0&&(0,P.jsxs)(`section`,{className:`section`,children:[(0,P.jsxs)(`h2`,{className:`section__title`,children:[o(`web.ui.slist.spaces`),(0,P.jsx)(`span`,{className:`section__count`,children:u.length})]}),(0,P.jsx)(`ul`,{className:`slist`,children:u.map(e=>(0,P.jsx)(Bn,{space:e,render:f,...a?{newSession:a}:{}},e.root))})]}),d.length>0&&(0,P.jsxs)(`section`,{className:`section`,children:[(0,P.jsxs)(`h2`,{className:`section__title`,children:[o(`web.ui.slist.unknown`),(0,P.jsx)(`span`,{className:`section__count`,children:d.length})]}),(0,P.jsx)(`p`,{className:`section__note`,children:o(`web.ui.slist.unknown_hint`)}),(0,P.jsx)(`ul`,{className:`slist`,children:d.map(f)})]})]})}function Bn({space:e,render:t,newSession:n}){let r=F(),[i,a]=v.useState(!0);return(0,P.jsxs)(`li`,{className:`space`,...i?{"data-open":!0}:{},children:[(0,P.jsxs)(`div`,{className:`spacehead`,children:[(0,P.jsxs)(`button`,{className:`sprow`,type:`button`,"aria-expanded":i,onClick:()=>a(e=>!e),title:e.root,children:[(0,P.jsx)(`span`,{className:`sprow__caret`,children:(0,P.jsx)(I,{name:`chevron-right`,size:`sm`})}),(0,P.jsx)(`span`,{className:`sprow__folder`,children:(0,P.jsx)(I,{name:`folder`,size:`sm`})}),(0,P.jsx)(`span`,{className:`sprow__name`,children:e.name}),(0,P.jsx)(`span`,{className:`sprow__n`,"aria-label":r(`web.ui.slist.count`,{count:e.rows.length}),children:e.rows.length})]}),n&&(0,P.jsx)(`button`,{className:`sprow__add`,type:`button`,disabled:n.busy,title:r(`web.ui.slist.new_in_space`,{name:e.name}),"aria-label":r(`web.ui.slist.new_in_space`,{name:e.name}),onClick:()=>{a(!0),n.create(e.root)},children:(0,P.jsx)(I,{name:`plus`,size:`sm`})})]}),(0,P.jsx)(`ul`,{className:`slist slist--nested`,children:e.rows.map(t)})]})}function Vn(e){return e?.seq===void 0?{}:{seq:e.seq}}var Hn=20,Un=4e3;function Wn(e){let t=e.split(`
|
|
128
|
+
`),n=(t.length>Hn?t.slice(-20):t).join(`
|
|
129
|
+
`);return n.length>Un?n.slice(-4e3):n}function Gn(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r];if(i?.type!==`tool_group`)continue;let a=i.tools.findIndex(e=>e.callId===t);if(a===-1)continue;let o=[...i.tools];o[a]=n(o[a]);let s=[...e];return s[r]={...i,tools:o},s}return null}function Kn(e,t,n){let{pending:r,thought:i}=e;switch(t.type){case`reasoning-delta`:return{pending:r,thought:i+t.text};case`text-delta`:{if(!t.text)return e;let a=r[r.length-1];if(a?.type===`assistant`){let e=[...r];return e[e.length-1]={...a,text:a.text+t.text},{pending:e,thought:i}}return{pending:[...r,{type:`assistant`,text:t.text,...Vn(n)}],thought:i}}case`tool-call`:{let e={callId:t.callId,toolName:t.toolName,request:t.input,status:`pending`},a=r[r.length-1];if(a?.type===`tool_group`){let t=[...r];return t[t.length-1]={...a,tools:[...a.tools,e]},{pending:t,thought:i}}return{pending:[...r,{type:`tool_group`,tools:[e],...Vn(n)}],thought:i}}case`tool-output-delta`:{if(!t.text)return e;let n=Gn(r,t.callId,e=>({...e,liveOutput:Wn((e.liveOutput??``)+t.text)}));return n?{pending:n,thought:i}:e}case`tool-result`:{let n=Gn(r,t.callId,e=>{let{liveOutput:n,...r}=e;return{...r,status:t.ok?`done`:`error`,result:t.output,...t.artifacts&&t.artifacts.length>0?{artifacts:t.artifacts}:{}}});return n?{pending:n,thought:i}:e}case`diff`:return{pending:[...r,{type:`diff`,filePath:t.filePath,...t.oldContent===void 0?{}:{oldContent:t.oldContent},...t.newContent===void 0?{}:{newContent:t.newContent},...Vn(n)}],thought:i};case`notice`:return{pending:[...r,{type:`info`,text:t.text,...Vn(n)}],thought:i};case`error`:return{pending:[...r,{type:`error`,text:t.message,...Vn(n)}],thought:i};case`run-start`:case`finish`:case`usage`:case`turn-complete`:case`approval-request`:case`question`:return e;default:return e}}function qn(e){if(e===``)return[];let t=e.split(`
|
|
130
|
+
`);return t.length>1&&t[t.length-1]===``&&t.pop(),t}function Jn(e,t){let n=Array.from({length:e.length+1},()=>new Uint32Array(t.length+1));for(let r=e.length-1;r>=0;r--){let i=n[r],a=n[r+1];for(let n=t.length-1;n>=0;n--)i[n]=e[r]===t[n]?a[n+1]+1:Math.max(a[n],i[n+1])}return n}function Yn(e=``,t=``){let n=qn(e),r=qn(t);if(n.length>400||r.length>400)return{lines:[],added:r.length,removed:n.length,truncated:!0};let i=Jn(n,r),a=[],o=0,s=0,c=0,l=0;for(;c<n.length&&l<r.length;)n[c]===r[l]?(a.push({kind:`context`,text:n[c]}),c++,l++):i[c+1][l]>=i[c][l+1]?(a.push({kind:`remove`,text:n[c]}),s++,c++):(a.push({kind:`add`,text:r[l]}),o++,l++);for(;c<n.length;c++,s++)a.push({kind:`remove`,text:n[c]});for(;l<r.length;l++,o++)a.push({kind:`add`,text:r[l]});return{lines:a,added:o,removed:s,truncated:!1}}function Xn(e,t=1){let n=new Set;e.forEach((r,i)=>{if(r.kind!==`context`)for(let r=i-t;r<=i+t;r++)r>=0&&r<e.length&&n.add(r)});let r=[],i=!1;return e.forEach((e,t)=>{n.has(t)?(r.push(e),i=!1):i||=(r.push(null),!0)}),r}function Zn(e,t){let n=se(t)-(e.usage?se(e.usage):0);return n>0?{lastPromptTokens:n}:{}}function Qn(){return{pending:[],thought:``}}function $n(e,t){return{...e,id:t}}function er(e){for(let t=e.length-1;t>=0;t--)if(e[t]?.type===`user`)return e[t]}function tr(e,t,n){if(n.thought.length<=t.thought.length)return e;let r=n.thought.slice(t.thought.length),i=n.pending.length,a=e[e.length-1];return a&&a.at===i?[...e.slice(0,-1),{text:a.text+r,at:i}]:[...e,{text:r,at:i}]}function nr(e){let t=e.nextId,n=[],r=e.thoughtParts,i=0,a=e=>{for(;i<r.length&&r[i].at<=e;){let e=r[i];i+=1;let a=e.text.trim();a!==``&&n.push($n({type:`thinking`,thought:a},t++))}};return e.stream.pending.forEach((e,r)=>{a(r),n.push($n(e,t++))}),a(r.length>0?1/0:0),{...e,history:n.length>0?[...e.history,...n]:e.history,stream:Qn(),thoughtParts:[],nextId:t}}function rr(e,t,n){let r={...e,turn:t,sawLiveTurn:!0,sending:!1,aborting:!1,queued:t===`running`?Math.max(0,e.queued-1):e.queued,...t===`running`&&e.runStartedAt===void 0?{runStartedAt:n}:{}};if(t!==`idle`)return r;let i={...r,runUsage:void 0,runStartedAt:void 0,runToolCalls:0};return i.refetchOnIdle?i:nr(i)}function ir(e,t,n){switch(t.type){case`session-state`:return rr(e,t.state,n);case`approval-resolved`:return{...e,approvals:e.approvals.filter(e=>e.requestId!==t.requestId)};case`question-resolved`:return{...e,questions:e.questions.filter(e=>e.requestId!==t.requestId)};case`session-cooled`:return{...e,turn:`idle`};case`connected`:case`stream-reset`:return e}}function ar(e,t,n,r){let i=cr(n,r);if(!i)return e;let a=or(e.sessions,t,i),o=e.searchHits&&or(e.searchHits,t,i),s=e.currentSummary,c=s?.id===t?{...s,...i(s)}:s;return a===e.sessions&&o===e.searchHits&&c===s?e:{...e,sessions:a,searchHits:o,...c===s?{}:{currentSummary:c}}}function or(e,t,n){let r=!1,i=e.map(e=>e.id===t?(r=!0,{...e,...n(e)}):e);return r?i:e}function sr(e,t,n){return t===`idle`?{turnStartedAt:null}:t!==`running`||(e.turnStartedAt??null)!==null?{}:{turnStartedAt:n,lastFinish:null}}function cr(e,t){switch(e.type){case`session-state`:return n=>({state:e.state,...sr(n,e.state,t)});case`finish`:return n=>{let r=n.turnStartedAt??null;return{lastFinish:{reason:e.reason,durationMs:r===null?null:Math.max(0,t-r),runUsage:e.runUsage??null}}};case`approval-request`:return e=>({pendingApprovals:e.pendingApprovals+1,pendingSince:e.pendingSince??t});case`approval-resolved`:return e=>{let t=Math.max(0,e.pendingApprovals-1);return{pendingApprovals:t,pendingSince:t+e.pendingQuestions===0?null:e.pendingSince}};case`question`:return e=>({pendingQuestions:e.pendingQuestions+1,pendingSince:e.pendingSince??t});case`question-resolved`:return e=>{let t=Math.max(0,e.pendingQuestions-1);return{pendingQuestions:t,pendingSince:e.pendingApprovals+t===0?null:e.pendingSince}};case`session-cooled`:return()=>({live:!1,state:`idle`,turnStartedAt:null,lastFinish:null,pendingApprovals:0,pendingQuestions:0,pendingSince:null});default:return null}}function lr(e,t){let n=t.seq>0?{...e,lastSeq:t.seq}:e,r=t.sessionId===void 0?n:ar(n,t.sessionId,t.event,t.ts);if(t.sessionId!==void 0&&t.sessionId!==e.sessionId)return r;let{event:i}=t;if(ue(i))return ir(r,i,t.ts);if(i.type===`approval-request`){let e={requestId:i.requestId,request:i.request};return r.approvals.some(t=>t.requestId===e.requestId)?r:{...r,approvals:[...r.approvals,e]}}if(i.type===`question`){let e={requestId:i.requestId,request:i.request};return r.questions.some(t=>t.requestId===e.requestId)?r:{...r,questions:[...r.questions,e]}}if(i.type===`run-start`){let e={seq:t.seq,...i.role?{role:i.role}:{},estimatedTokens:i.estimatedTokens};return{...r,heads:[...r.heads,e]}}if(i.type===`usage`)return{...r,usage:i.cumulative,...Zn(r,i.cumulative),...i.run?{runUsage:i.run}:{}};if(i.type===`finish`){let e={seq:t.seq,toolCalls:r.runToolCalls,...i.runUsage?{usage:i.runUsage}:{},...i.model?{model:i.model}:{},...r.runStartedAt===void 0?{}:{durationMs:Math.max(0,t.ts-r.runStartedAt)}};return{...r,usage:i.usage,...Zn(r,i.usage),turns:[...r.turns,e]}}return i.type===`tool-call`?ur({...r,runToolCalls:r.runToolCalls+1},i,t.seq):ur(r,i,t.seq)}function ur(e,t,n){let r=Kn(e.stream,t,{seq:n});return r===e.stream?e:{...e,stream:r,thoughtParts:tr(e.thoughtParts,e.stream,r)}}function dr(e,t){switch(t.type){case`frame`:return lr(e,t.frame);case`connection`:return{...e,connection:t.state};case`session`:return fr(e,t.sessionId);case`sessions`:{let n=e.sessionId===void 0?void 0:t.sessions.find(t=>t.id===e.sessionId);return{...e,sessions:t.sessions,...n?{currentSummary:n}:{}}}case`search-hits`:return{...e,searchHits:t.hits};case`current-summary`:return t.summary.id===e.sessionId?{...e,currentSummary:t.summary}:e;case`submit`:return{...e,history:[...e.history,$n({type:`user`,text:t.text,...t.images&&t.images.length>0?{images:t.images}:{}},e.nextId)],nextId:e.nextId+1,sending:!0,commandNotice:void 0};case`queued`:return{...e,queued:e.queued+1,sending:!1};case`command`:return{...e,commandNotice:t.notice};case`references`:{let n=er(e.history);return n?{...e,history:e.history.map(e=>e.id===n.id?{...e,references:t.references}:e)}:e}case`files`:{let n=er(e.history);return n?{...e,history:e.history.map(e=>e.id===n.id?{...e,files:t.files}:e)}:e}case`aborted`:return{...e,queued:0,aborting:!0};case`abort-failed`:return{...e,aborting:!1};case`resyncing`:return{...e,resyncing:!0,sawLiveTurn:!1,refetchOnIdle:e.turn!==`idle`};case`replay`:{let n=e.nextId,r=n,i=e.sawLiveTurn?e.turn:t.turn,a=i!==`idle`;return{...e,turn:i,history:t.items.map(e=>$n(e,r++)),stream:a?e.stream:Qn(),thoughtParts:a?e.thoughtParts:[],nextId:r,approvals:t.approvals,questions:t.questions,turns:t.turns.map(({itemIndex:e,facts:t})=>({seq:0,itemId:n+e,toolCalls:t.toolCalls,...t.usage?{usage:t.usage}:{},...t.model?{model:t.model}:{},...t.durationMs===void 0?{}:{durationMs:t.durationMs}})),usage:t.usage,heads:[],queued:0,aborting:!1,resyncing:!1,refetchOnIdle:a,readOnly:t.readOnly}}case`approval-sent`:return{...e,approvals:e.approvals.filter(e=>e.requestId!==t.requestId)};case`question-sent`:return{...e,questions:e.questions.filter(e=>e.requestId!==t.requestId)};case`error`:return{...e,error:t.message,sending:!1};case`session-gone`:return{...e,sessionGone:!0,readOnly:`gone`,turn:`idle`,sending:!1,queued:0,aborting:!1,approvals:[],questions:[],error:void 0,resyncing:!1,refetchOnIdle:!1};case`recovery`:return{...e,recovery:t.sessionId};case`dismiss-error`:return{...e,error:void 0}}}function fr(e,t){let n=e.sessions.find(e=>e.id===t);return{sessionId:t,sessions:e.sessions,searchHits:e.searchHits,...n?{currentSummary:n}:{},readOnly:!1,sessionGone:!1,history:[],stream:Qn(),thoughtParts:[],nextId:1,turn:`idle`,sawLiveTurn:!1,connection:e.connection,approvals:[],questions:[],lastSeq:e.lastSeq,runToolCalls:0,turns:[],heads:[],sending:!1,queued:0,aborting:!1,commandNotice:void 0,resyncing:!1,refetchOnIdle:!1}}var pr={sessions:[],readOnly:!1,sessionGone:!1,history:[],stream:{pending:[],thought:``},thoughtParts:[],nextId:1,turn:`idle`,sawLiveTurn:!1,connection:`connecting`,approvals:[],questions:[],lastSeq:0,runToolCalls:0,turns:[],heads:[],sending:!1,queued:0,aborting:!1,resyncing:!1,refetchOnIdle:!1};function mr(e){return e.replace(/\s+/g,` `).trim()}function hr(e,t){let n=mr(t);return e.endsWith(`…`)?n.startsWith(e.slice(0,-1)):n===e}function gr(e,t){let n=[...t].sort((e,t)=>e.turnIndex-t.turnIndex),r=new Map,i=0;for(let t of e){if(t.userText===void 0)continue;let e=n.findIndex((e,n)=>n>=i&&hr(e.preview,t.userText));e<0||(r.set(t.key,n[e].turnIndex),i=e+1)}return r}function _r(e,t,n){let[r,i]=v.useState([]),[a,o]=v.useState(0);v.useEffect(()=>{if(!e||!t){i([]);return}let n=!0;return e.checkpoints(t).then(e=>{n&&i(e.checkpoints)}).catch(()=>{n&&i([])}),()=>{n=!1}},[e,t,n,a]);let s=v.useCallback(()=>o(e=>e+1),[]);return v.useMemo(()=>({checkpoints:r,reload:s}),[r,s])}function vr(e,t){switch(e){case`restore`:return t(`web.ui.rewind.act_restore`);case`delete`:return t(`web.ui.rewind.act_delete`);case`recreate`:return t(`web.ui.rewind.act_recreate`);case`skip`:return t(`web.ui.rewind.act_skip`)}}function yr(e,t){switch(e){case`changed-since`:return t(`web.ui.rewind.drift_changed`);case`unknown`:return t(`web.ui.rewind.drift_unknown`);case`as-agent-left-it`:return``}}function br(e){let t=e.split(/[\\/]/).filter(e=>e.length>0);return t.length<=3?e:`…/${t.slice(-3).join(`/`)}`}function xr(e,t){let n=e.files;if(n?.failed)return[t(`web.ui.rewind.failed`,{reason:n.failed}),t(`web.ui.rewind.failed_atomic`)];let r=[];return n&&(n.restored.length>0&&r.push(t(`web.ui.rewind.done_restored`,{count:n.restored.length})),n.deleted.length>0&&r.push(t(`web.ui.rewind.done_deleted`,{count:n.deleted.length})),n.recreated.length>0&&r.push(t(`web.ui.rewind.done_recreated`,{count:n.recreated.length})),r.length===0&&r.push(t(`web.ui.rewind.done_nothing`)),n.skippedConflicts.length>0&&r.push(t(`web.ui.rewind.done_skipped`,{count:n.skippedConflicts.length}))),e.messagesRemoved!==null&&r.push(t(`web.ui.rewind.done_messages`,{count:e.messagesRemoved})),r}function Sr({client:e,sessionId:t,turnIndex:n,onClose:r,onDone:i}){let a=F(),[o,s]=v.useState(`loading`),[c,l]=v.useState(null),[u,d]=v.useState(),[f,p]=v.useState([]),[m,h]=v.useState(`files`),[g,_]=v.useState(!1),[y,b]=v.useState([]);v.useEffect(()=>{let r=!0;return e.rewindPreview(t,n).then(e=>{r&&(l(e),s(`ready`))}).catch(e=>{r&&(d(e instanceof Error?e.message:String(e)),s(`ready`))}),()=>{r=!1}},[e,t,n]);let x=v.useCallback(e=>{p(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),S=v.useCallback(e=>{h(e),_(!1)},[]),C=v.useCallback(()=>{s(`running`),d(void 0),e.rewind(t,n,{scope:m,...f.length>0?{overwrite:f}:{}}).then(e=>{b(xr(e,a)),s(`done`),i(e)}).catch(e=>{d(e instanceof Error?e.message:String(e)),s(`ready`)})},[e,t,n,m,f,i,a]);return o===`done`?(0,P.jsxs)(`div`,{className:`rewind`,role:`group`,"aria-label":a(`web.ui.rewind.title`),children:[(0,P.jsx)(`ul`,{className:`rewind__done`,children:y.map(e=>(0,P.jsx)(`li`,{children:e},e))}),(0,P.jsx)(`div`,{className:`rewind__acts`,children:(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,onClick:r,children:a(`web.ui.rewind.close`)})})]}):(0,P.jsxs)(`div`,{className:`rewind`,role:`group`,"aria-label":a(`web.ui.rewind.title`),children:[o===`loading`&&(0,P.jsx)(`p`,{className:`rewind__hint`,children:a(`web.ui.rewind.loading`)}),u!==void 0&&(0,P.jsx)(`p`,{className:`rewind__err`,role:`alert`,children:u}),c&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Cr,{files:c.files}),(0,P.jsx)(wr,{files:c.conflicts,overwrite:f,onToggle:x}),(0,P.jsx)(`p`,{className:`rewind__warn`,children:a(`web.ui.rewind.terminal_note`)}),c.incomplete&&(0,P.jsx)(`p`,{className:`rewind__warn`,children:a(`web.ui.rewind.incomplete`)}),(0,P.jsx)(Tr,{scope:m,canRewindConversation:c.canRewindConversation,onPick:S}),m!==`files`&&c.canRewindConversation&&(0,P.jsxs)(`label`,{className:`rewind__confirm`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:g,onChange:e=>_(e.target.checked)}),(0,P.jsx)(`span`,{children:a(`web.ui.rewind.conversation_warn`)})]}),(0,P.jsxs)(`div`,{className:`rewind__acts`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,onClick:r,children:a(`web.ui.rewind.cancel`)}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--sm btn--danger`,disabled:o===`running`||m!==`files`&&!g,onClick:C,children:a(o===`running`?`web.ui.rewind.running`:`web.ui.rewind.run`)})]})]})]})}function Cr({files:e}){let t=F();return e.length===0?(0,P.jsx)(`p`,{className:`rewind__hint`,children:t(`web.ui.rewind.files_none`)}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`rewind__head`,children:t(`web.ui.rewind.files_head`,{count:e.length})}),(0,P.jsx)(`ul`,{className:`rewind__files`,children:e.map(e=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`rewind__act`,children:vr(e.action,t)}),(0,P.jsx)(`code`,{title:e.path,children:br(e.path)})]},e.path))})]})}function wr({files:e,overwrite:t,onToggle:n}){let r=F();return e.length===0?null:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`rewind__warn`,children:r(`web.ui.rewind.conflicts_head`,{count:e.length})}),(0,P.jsx)(`ul`,{className:`rewind__files rewind__files--conflict`,children:e.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:t.includes(e.path),onChange:()=>n(e.path)}),(0,P.jsx)(`span`,{className:`rewind__act`,children:vr(e.action,r)}),(0,P.jsx)(`code`,{title:e.path,children:br(e.path)}),(0,P.jsx)(`span`,{className:`rewind__drift`,children:yr(e.drift,r)})]})},e.path))}),(0,P.jsx)(`p`,{className:`rewind__hint`,children:r(`web.ui.rewind.conflict_hint`)})]})}function Tr({scope:e,canRewindConversation:t,onPick:n}){let r=F(),i=[{value:`files`,label:r(`web.ui.rewind.scope_files`),needsConversation:!1},{value:`conversation`,label:r(`web.ui.rewind.scope_conversation`),needsConversation:!0},{value:`both`,label:r(`web.ui.rewind.scope_both`),needsConversation:!0}];return(0,P.jsxs)(`fieldset`,{className:`rewind__scope`,children:[(0,P.jsx)(`legend`,{children:r(`web.ui.rewind.scope_legend`)}),i.map(i=>{let a=i.needsConversation&&!t;return(0,P.jsxs)(`label`,{"data-off":a?``:void 0,children:[(0,P.jsx)(`input`,{type:`radio`,name:`rewind-scope`,checked:e===i.value,disabled:a,onChange:()=>n(i.value)}),(0,P.jsx)(`span`,{children:i.label}),a&&(0,P.jsx)(`em`,{children:r(`web.ui.rewind.scope_conversation_off`)})]},i.value)})]})}var Er=32;function Dr(e){return!!e.files?.failed&&e.messagesRemoved===null}function Or(e){let[t,n]=v.useState([]);return v.useEffect(()=>{n(e=>e.length===0?e:[])},[e]),{marks:t,record:v.useCallback((e,t)=>{n(n=>[...n,{key:`rewound-${n.length}`,...e.userText===void 0?{}:{userText:e.userText},result:t}])},[])}}function kr(e){let t=e.replace(/\s+/g,` `).trim();return t.length>Er?`${t.slice(0,Er)}…`:t}function Ar({marks:e}){let t=F();return e.length===0?null:(0,P.jsx)(P.Fragment,{children:e.map(e=>{let n=xr(e.result,t),r=Dr(e.result);return(0,P.jsxs)(`li`,{className:`rewound`,"data-failed":r?`true`:void 0,children:[(0,P.jsx)(`p`,{className:`rewound__head`,children:e.userText===void 0?t(r?`web.ui.thread.rewound_failed_here`:`web.ui.thread.rewound_here`):t(r?`web.ui.thread.rewound_failed`:`web.ui.thread.rewound_to`,{text:kr(e.userText)})}),n.length>0&&(0,P.jsx)(`ul`,{className:`rewound__lines`,children:n.map(e=>(0,P.jsx)(`li`,{children:e},e))})]},e.key)})})}var jr=`ol.timeline`,Mr=new Set;function Nr(e){let t=e.join(`,`),n=v.useMemo(()=>t.split(`,`).filter(Boolean).map(Number),[t]),[r,i]=v.useState({live:!1,present:Mr});return v.useEffect(()=>{let e=()=>{let e=document.querySelector(jr)!==null,t=new Set(n.filter(e=>document.getElementById(Q_(e))!==null));i(n=>n.live===e&&Fr(n.present,t)?n:{live:e,present:t})};e();let t=new MutationObserver(e);return t.observe(document.body,{childList:!0,subtree:!0}),()=>t.disconnect()},[n]),e=>!r.live||r.present.has(e)}function Pr(e){let t=[];for(let n of e)n.seq!==void 0&&t.push(n.seq);return t}function Fr(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Ir({seq:e,anchored:t,onLocate:n,className:r,label:i=!1}){let a=F(),o=a(`web.ui.inspector.locate`),s=t?o:a(`web.ui.inspector.locate_folded`);return(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--sm ${r}`,type:`button`,disabled:!t,title:s,...i?{}:{"aria-label":s},onClick:()=>n(e),children:[(0,P.jsx)(I,{name:`corner-down-left`,size:`sm`}),i&&o]})}function Lr(e,t){let n=new Map,r=new Map;for(let e of t)n.set(e.filePath,e),r.set(e.filePath,(r.get(e.filePath)??0)+1);let i=e.map(e=>Rr(e.path,e.writes,n.get(e.path),e.tool)),a=new Set(e.map(e=>e.path));for(let[e,t]of n)a.has(e)||i.push(Rr(e,r.get(e)??1,t));return i}function Rr(e,t,n,r){return{path:e,writes:t,...r?{tool:r}:{},...n?.seq===void 0?{}:{seq:n.seq},...n?.oldContent===void 0?{}:{oldContent:n.oldContent},...n?.newContent===void 0?{}:{newContent:n.newContent}}}function zr(e,t){let n=[],r=(e,t)=>{if(e.type===`tool_group`||e.type===`tool_display_group`)for(let r of e.tools)for(let[i,a]of(r.artifacts??[]).entries())n.push({artifact:a,toolName:r.toolName,key:`${t}:${r.callId}:${i}`,...e.seq===void 0?{}:{seq:e.seq}})};for(let t of e)r(t,`h${t.id}`);for(let[e,n]of t.entries())r(n,`p${e}`);return n}function Br(e,t,n){let[r,i]=v.useState({changes:[],root:null,loading:!0}),a=n===void 0||n===`idle`;return v.useEffect(()=>{if(!e||!t||!a)return;let n=!0;return e.fileChanges(t).then(({changes:e,root:t})=>{n&&i({changes:e,root:t,loading:!1})}).catch(e=>{n&&i({changes:[],root:null,loading:!1,error:e instanceof Error?e.message:String(e)})}),()=>{n=!1}},[e,t,a]),r}function Vr(e){let t=F();return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Hr,{...e,t}),(0,P.jsx)(Kr,{...e,t})]})}function Hr({changes:e,bound:t,loading:n,error:r,onOpen:i,onLocate:a,t:o}){let s=e.some(e=>e.newContent===void 0),c=Nr(Pr(e));return(0,P.jsxs)(`div`,{className:`agroup`,children:[(0,P.jsxs)(`h3`,{className:`agroup__title`,children:[o(`web.ui.art.files`),e.length>0&&(0,P.jsx)(`span`,{className:`agroup__n`,children:e.length})]}),(0,P.jsx)(`p`,{className:`agroup__note`,children:o(`web.ui.art.files_note`)}),r?(0,P.jsx)(L,{tone:`error`,text:r}):e.length===0?(0,P.jsx)(`p`,{className:`empty`,children:o(n?`web.ui.art.loading`:t?`web.ui.art.files_empty`:`web.ui.art.no_space`)}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`ul`,{className:`alist`,children:e.map(e=>(0,P.jsx)(Ur,{row:e,t:o,anchored:e.seq!==void 0&&c(e.seq),...i?{onOpen:i}:{},...a?{onLocate:a}:{}},e.path))}),s&&(0,P.jsx)(L,{text:o(`web.ui.art.thin`)})]})]})}function Ur({row:e,t,anchored:n,onOpen:r,onLocate:i}){let a=e.path.slice(0,e.path.length-Oe(e.path).length),o=Wr(e,t),{seq:s}=e,c=e.newContent!==void 0&&r!==void 0,l=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(I,{name:`file-diff`,className:`arow__i`}),(0,P.jsxs)(`span`,{className:`arow__name`,children:[a&&(0,P.jsx)(`i`,{className:`arow__dir`,children:a}),Oe(e.path)]}),(0,P.jsx)(`span`,{className:`arow__meta`,children:o}),c&&(0,P.jsx)(I,{name:`chevron-right`,size:`sm`,className:`arow__go`})]});return(0,P.jsxs)(`li`,{className:`aitem`,children:[c?(0,P.jsx)(`button`,{className:`arow`,type:`button`,onClick:()=>r(e),children:l}):(0,P.jsx)(`div`,{className:`arow arow--flat`,children:l}),s!==void 0&&i&&(0,P.jsx)(Ir,{seq:s,anchored:n,onLocate:i,className:`aitem__locate`})]})}function Wr(e,t){let n=[];return e.newContent===void 0?e.tool&&n.push(e.tool):(n.push(t(e.oldContent===void 0?`web.ui.art.created`:`web.ui.art.changed`)),n.push(t(`web.ui.art.lines`,{count:Gr(e.newContent)}))),e.writes>1&&n.push(t(`web.ui.art.writes`,{count:e.writes})),n.join(` · `)}function Gr(e){if(e===``)return 0;let t=e.split(`
|
|
131
|
+
`);return t[t.length-1]===``&&t.pop(),t.length}function Kr({artifacts:e,resolveArtifact:t,t:n}){return(0,P.jsxs)(`div`,{className:`agroup`,children:[(0,P.jsxs)(`h3`,{className:`agroup__title`,children:[n(`web.ui.art.tools`),e.length>0&&(0,P.jsx)(`span`,{className:`agroup__n`,children:e.length})]}),(0,P.jsx)(`p`,{className:`agroup__note`,children:n(`web.ui.art.tools_note`)}),e.length===0?(0,P.jsx)(`p`,{className:`empty`,children:n(`web.ui.art.tools_empty`)}):(0,P.jsx)(`ul`,{className:`alist`,children:e.map(e=>(0,P.jsx)(qr,{row:e,src:t?.(e.artifact)},e.key))}),(0,P.jsx)(L,{text:n(`web.ui.art.tool_gate`)})]})}function qr({row:e,src:t}){let n=e.artifact.path?Oe(e.artifact.path):e.artifact.summary,r=`${e.toolName} · ${e.artifact.mediaType} · ${Jr(e.artifact.bytes)}`,i=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(I,{name:`layers`,className:`arow__i`}),(0,P.jsx)(`span`,{className:`arow__name`,children:n}),(0,P.jsx)(`span`,{className:`arow__meta`,children:r})]});return(0,P.jsx)(`li`,{className:`aitem`,children:t?(0,P.jsxs)(`a`,{className:`arow`,href:t,target:`_blank`,rel:`noreferrer`,children:[i,(0,P.jsx)(I,{name:`chevron-right`,size:`sm`,className:`arow__go`})]}):(0,P.jsx)(`div`,{className:`arow arow--flat`,children:i})})}function Jr(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function L({text:e,tone:t,className:n}){return(0,P.jsxs)(`p`,{className:n?`note ${n}`:`note`,...t?{"data-tone":t,role:`alert`}:{},children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:t?`circle-x`:`info`,size:`sm`})}),(0,P.jsx)(`span`,{children:e})]})}var Yr={binary:`web.ui.mention.file_omit_binary`,denied:`web.ui.mention.file_omit_denied`,unreadable:`web.ui.mention.file_omit_unreadable`,"over-limit":`web.ui.mention.file_omit_over_limit`,"not-restored":`web.ui.mention.file_omit_not_restored`};function Xr(e){return e.path}function Zr({file:e}){let t=F(),n=e.omitted;return(0,P.jsxs)(`div`,{className:`refcard`,"data-omitted":n??void 0,children:[(0,P.jsx)(`span`,{className:`refcard__label`,children:t(`web.ui.mention.file_card_label`)}),(0,P.jsx)(`span`,{className:`refcard__title`,children:Xr(e)}),n===void 0&&e.bytes!==void 0&&(0,P.jsx)(`span`,{className:`refcard__count`,children:t(`web.ui.mention.file_card_bytes`,{size:Jr(e.bytes)})}),n===void 0&&e.truncatedTo!==void 0&&(0,P.jsx)(`span`,{className:`refcard__note`,children:t(`web.ui.mention.file_card_truncated`,{kb:Math.max(1,Math.round(e.truncatedTo/1024))})}),n!==void 0&&(0,P.jsx)(`span`,{className:`refcard__note`,children:t(Yr[n])})]})}function Qr({files:e}){return!e||e.length===0?null:(0,P.jsx)(`div`,{className:`refcards`,children:e.map((e,t)=>(0,P.jsx)(Zr,{file:e},`${e.path}-${t}`))})}var $r={"invalid-reference":`web.ui.mention.omit_invalid_reference`,"self-reference":`web.ui.mention.omit_self_reference`,"too-many":`web.ui.mention.omit_too_many`,"not-authorized":`web.ui.mention.omit_not_authorized`,"budget-exceeded":`web.ui.mention.omit_budget_exceeded`,"not-restored":`web.ui.mention.omit_not_restored`};function ei(e){return e.title??e.sessionId??e.ref}function ti({reference:e}){let t=F(),n=e.omitted;return(0,P.jsxs)(`div`,{className:`refcard`,"data-omitted":n??void 0,children:[(0,P.jsx)(`span`,{className:`refcard__label`,children:t(`web.ui.mention.card_label`)}),(0,P.jsx)(`span`,{className:`refcard__title`,children:ei(e)}),n===void 0&&e.messageCount!==void 0&&(0,P.jsx)(`span`,{className:`refcard__count`,children:t(`web.ui.mention.card_count`,{kept:e.messageCount,total:e.totalMessages??e.messageCount})}),n===void 0&&e.truncatedTo!==void 0&&(0,P.jsx)(`span`,{className:`refcard__note`,children:t(`web.ui.mention.card_truncated`,{kb:Math.max(1,Math.round(e.truncatedTo/1024))})}),n!==void 0&&(0,P.jsx)(`span`,{className:`refcard__note`,children:t($r[n])})]})}function ni({references:e}){return!e||e.length===0?null:(0,P.jsx)(`div`,{className:`refcards`,children:e.map((e,t)=>(0,P.jsx)(ti,{reference:e},`${e.ref}-${t}`))})}function ri({todos:e}){let t=F(),n=e.filter(e=>e.status!==`cancelled`),r=n.filter(e=>e.status===`completed`).length;return(0,P.jsxs)(`div`,{className:`todo`,children:[(0,P.jsxs)(`p`,{className:`todo__head`,children:[t(`web.ui.thread.todo_title`),(0,P.jsx)(`span`,{className:`todo__n`,children:t(`web.ui.thread.todo_count`,{done:r,total:n.length})})]}),(0,P.jsx)(`ul`,{className:`todo__list`,children:e.map((e,n)=>(0,P.jsxs)(`li`,{className:`todo__item`,"data-st":e.status,children:[e.content,e.reason?(0,P.jsx)(`span`,{className:`todo__why`,title:t(`web.ui.thread.todo_why`),children:e.reason}):null]},n))})]})}function ii(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ai(e){if(Array.isArray(e))return e}function oi(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function si(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
132
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ci(e,t){return ai(e)||oi(e,t)||li(e,t)||si()}function li(e,t){if(e){if(typeof e==`string`)return ii(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ii(e,t):void 0}}var ui=Object.entries,di=Object.setPrototypeOf,fi=Object.isFrozen,pi=Object.getPrototypeOf,mi=Object.getOwnPropertyDescriptor,hi=Object.freeze,gi=Object.seal,_i=Object.create,vi=typeof Reflect<`u`&&Reflect,yi=vi.apply,bi=vi.construct;hi||=function(e){return e},gi||=function(e){return e},yi||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},bi||=function(e){return new e(...[...arguments].slice(1))};var xi=Bi(Array.prototype.forEach),Si=Bi(Array.prototype.lastIndexOf),Ci=Bi(Array.prototype.pop),wi=Bi(Array.prototype.push),Ti=Bi(Array.prototype.splice),Ei=Array.isArray,Di=Bi(String.prototype.toLowerCase),Oi=Bi(String.prototype.toString),ki=Bi(String.prototype.match),Ai=Bi(String.prototype.replace),ji=Bi(String.prototype.indexOf),Mi=Bi(String.prototype.trim),Ni=Bi(Number.prototype.toString),Pi=Bi(Boolean.prototype.toString),Fi=typeof BigInt>`u`?null:Bi(BigInt.prototype.toString),R=typeof Symbol>`u`?null:Bi(Symbol.prototype.toString),Ii=Bi(Object.prototype.hasOwnProperty),Li=Bi(Object.prototype.toString),Ri=Bi(RegExp.prototype.test),zi=Vi(TypeError);function Bi(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return yi(e,t,n)}}function Vi(e){return function(){return bi(e,[...arguments])}}function z(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Di;if(di&&di(e,null),!Ei(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(fi(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Hi(e){for(let t=0;t<e.length;t++)Ii(e,t)||(e[t]=null);return e}function Ui(e){let t=_i(null);for(let r of ui(e)){var n=ci(r,2);let i=n[0],a=n[1];Ii(e,i)&&(t[i]=Ei(a)?Hi(a):a&&typeof a==`object`&&a.constructor===Object?Ui(a):a)}return t}function Wi(e){switch(typeof e){case`string`:return e;case`number`:return Ni(e);case`boolean`:return Pi(e);case`bigint`:return Fi?Fi(e):`0`;case`symbol`:return R?R(e):`Symbol()`;case`undefined`:return Li(e);case`function`:case`object`:{if(e===null)return Li(e);let t=e,n=Gi(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Li(e)}return Li(e)}default:return Li(e)}}function Gi(e,t){for(;e!==null;){let n=mi(e,t);if(n){if(n.get)return Bi(n.get);if(typeof n.value==`function`)return Bi(n.value)}e=pi(e)}function n(){return null}return n}function Ki(e){try{return Ri(e,``),!0}catch{return!1}}var qi=hi(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Ji=hi(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Yi=hi([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Xi=hi([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Zi=hi(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Qi=hi([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),$i=hi([`#text`]),ea=hi(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),ta=hi(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),na=hi(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),ra=hi([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),ia=gi(/{{[\w\W]*|^[\w\W]*}}/g),aa=gi(/<%[\w\W]*|^[\w\W]*%>/g),oa=gi(/\${[\w\W]*/g),sa=gi(/^data-[\-\w.\u00B7-\uFFFF]+$/),ca=gi(/^aria-[\-\w]+$/),la=gi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ua=gi(/^(?:\w+script|data):/i),da=gi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fa=gi(/^html$/i),pa=gi(/^[a-z][.\w]*(-[.\w]+)+$/i),ma=gi(/<[/\w!]/g),ha=gi(/<[/\w]/g),ga=gi(/<\/no(script|embed|frames)/i),_a=gi(/\/>/i),va={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ya=function(){return typeof window>`u`?null:window},ba=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},xa=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Sa=function(e,t,n,r){return Ii(e,t)&&Ei(e[t])?z(r.base?Ui(r.base):{},e[t],r.transform):n};function Ca(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ya(),t=e=>Ca(e);if(t.version=`3.4.13`,t.removed=[],!e||!e.document||e.document.nodeType!==va.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Gi(d,`cloneNode`),p=Gi(d,`remove`),m=Gi(d,`nextSibling`),h=Gi(d,`childNodes`),g=Gi(d,`parentNode`),_=Gi(d,`shadowRoot`),v=Gi(d,`attributes`),y=o&&o.prototype?Gi(o.prototype,`nodeType`):null,b=o&&o.prototype?Gi(o.prototype,`nodeName`):null,x=o&&o.prototype?Gi(o.prototype,`ownerDocument`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let S,C=``,w,ee=!1,te=0,ne=function(){if(te>0)throw zi(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},T=function(e){ne(),te++;try{return S.createHTML(e)}finally{te--}},re=function(e){ne(),te++;try{return S.createScriptURL(e)}finally{te--}},ie=function(){return ee||=(w=ba(u,i),!0),w},ae=n,oe=ae.implementation,se=ae.createNodeIterator,ce=ae.createDocumentFragment,le=ae.getElementsByTagName,E=r.importNode,D=xa();t.isSupported=typeof ui==`function`&&typeof g==`function`&&oe&&oe.createHTMLDocument!==void 0;let ue=ia,de=aa,O=oa,fe=sa,pe=ca,k=ua,me=da,he=pa,ge=la,A=null,_e=z({},[...qi,...Ji,...Yi,...Zi,...$i]),j=null,ve=z({},[...ea,...ta,...na,...ra]),M=Object.seal(_i(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ye=null,be=null,xe=Object.seal(_i(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Se=!0,Ce=!0,we=!1,Te=!0,Ee=!1,N=!0,De=!1,Oe=!1,ke=null,Ae=null,je=!1,Me=!1,Ne=!1,Pe=!1,Fe=!0,Ie=!1,Le=`user-content-`,Re=!0,ze=!1,Be={},Ve=null,He=z({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ue=null,We=z({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ge=null,Ke=z({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),qe=`http://www.w3.org/1998/Math/MathML`,Je=`http://www.w3.org/2000/svg`,Ye=`http://www.w3.org/1999/xhtml`,Xe=Ye,Ze=!1,Qe=null,$e=z({},[qe,Je,Ye],Oi),et=hi([`mi`,`mo`,`mn`,`ms`,`mtext`]),P=z({},et),tt=hi([`annotation-xml`]),nt=z({},tt),F=z({},[`title`,`style`,`font`,`a`,`script`]),rt=null,it=[`application/xhtml+xml`,`text/html`],I=null,at=null,ot=n.createElement(`form`),st=function(e){return e instanceof RegExp||e instanceof Function},ct=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(at&&at===e)return;(!e||typeof e!=`object`)&&(e={}),e=Ui(e),rt=it.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,I=rt===`application/xhtml+xml`?Oi:Di,A=Sa(e,`ALLOWED_TAGS`,_e,{transform:I}),j=Sa(e,`ALLOWED_ATTR`,ve,{transform:I}),Qe=Sa(e,`ALLOWED_NAMESPACES`,$e,{transform:Oi}),Ge=Sa(e,`ADD_URI_SAFE_ATTR`,Ke,{transform:I,base:Ke}),Ue=Sa(e,`ADD_DATA_URI_TAGS`,We,{transform:I,base:We}),Ve=Sa(e,`FORBID_CONTENTS`,He,{transform:I}),ye=Sa(e,`FORBID_TAGS`,Ui({}),{transform:I}),be=Sa(e,`FORBID_ATTR`,Ui({}),{transform:I}),Be=Ii(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Ui(e.USE_PROFILES):e.USE_PROFILES:!1,Se=e.ALLOW_ARIA_ATTR!==!1,Ce=e.ALLOW_DATA_ATTR!==!1,we=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ee=e.SAFE_FOR_TEMPLATES||!1,N=e.SAFE_FOR_XML!==!1,De=e.WHOLE_DOCUMENT||!1,Me=e.RETURN_DOM||!1,Ne=e.RETURN_DOM_FRAGMENT||!1,Pe=e.RETURN_TRUSTED_TYPE||!1,je=e.FORCE_BODY||!1,Fe=e.SANITIZE_DOM!==!1,Ie=e.SANITIZE_NAMED_PROPS||!1,Re=e.KEEP_CONTENT!==!1,ze=e.IN_PLACE||!1,ge=Ki(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:la,Xe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ye,P=Ii(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?Ui(e.MATHML_TEXT_INTEGRATION_POINTS):z({},et),nt=Ii(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?Ui(e.HTML_INTEGRATION_POINTS):z({},tt);let t=Ii(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?Ui(e.CUSTOM_ELEMENT_HANDLING):_i(null);if(M=_i(null),Ii(t,`tagNameCheck`)&&st(t.tagNameCheck)&&(M.tagNameCheck=t.tagNameCheck),Ii(t,`attributeNameCheck`)&&st(t.attributeNameCheck)&&(M.attributeNameCheck=t.attributeNameCheck),Ii(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(M.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),gi(M),Ee&&(Ce=!1),Ne&&(Me=!0),Be&&(A=z({},$i),j=_i(null),Be.html===!0&&(z(A,qi),z(j,ea)),Be.svg===!0&&(z(A,Ji),z(j,ta),z(j,ra)),Be.svgFilters===!0&&(z(A,Yi),z(j,ta),z(j,ra)),Be.mathMl===!0&&(z(A,Zi),z(j,na),z(j,ra))),xe.tagCheck=null,xe.attributeCheck=null,Ii(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?xe.tagCheck=e.ADD_TAGS:Ei(e.ADD_TAGS)&&(A===_e&&(A=Ui(A)),z(A,e.ADD_TAGS,I))),Ii(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?xe.attributeCheck=e.ADD_ATTR:Ei(e.ADD_ATTR)&&(j===ve&&(j=Ui(j)),z(j,e.ADD_ATTR,I))),Ii(e,`ADD_URI_SAFE_ATTR`)&&Ei(e.ADD_URI_SAFE_ATTR)&&z(Ge,e.ADD_URI_SAFE_ATTR,I),Ii(e,`FORBID_CONTENTS`)&&Ei(e.FORBID_CONTENTS)&&(Ve===He&&(Ve=Ui(Ve)),z(Ve,e.FORBID_CONTENTS,I)),Ii(e,`ADD_FORBID_CONTENTS`)&&Ei(e.ADD_FORBID_CONTENTS)&&(Ve===He&&(Ve=Ui(Ve)),z(Ve,e.ADD_FORBID_CONTENTS,I)),Re&&(A[`#text`]=!0),De&&z(A,[`html`,`head`,`body`]),A.table&&(z(A,[`tbody`]),delete ye.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw zi(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw zi(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=S;S=e.TRUSTED_TYPES_POLICY;try{C=T(``)}catch(e){throw S=t,e}}else e.TRUSTED_TYPES_POLICY===null?(S=void 0,C=``):(S===void 0&&(S=ie()),S&&typeof C==`string`&&(C=T(``)));hi&&hi(e),at=e},lt=z({},[...Ji,...Yi,...Xi]),ut=z({},[...Zi,...Qi]),dt=function(e,t,n){return t.namespaceURI===Ye?e===`svg`:t.namespaceURI===qe?e===`svg`&&(n===`annotation-xml`||P[n]):!!lt[e]},ft=function(e,t,n){return t.namespaceURI===Ye?e===`math`:t.namespaceURI===Je?e===`math`&&nt[n]:!!ut[e]},pt=function(e,t,n){return t.namespaceURI===Je&&!nt[n]||t.namespaceURI===qe&&!P[n]?!1:!ut[e]&&(F[e]||!lt[e])},mt=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Xe,tagName:`template`});let n=Di(e.tagName),r=Di(t.tagName);return Qe[e.namespaceURI]?e.namespaceURI===Je?dt(n,t,r):e.namespaceURI===qe?ft(n,t,r):e.namespaceURI===Ye?pt(n,t,r):!!(rt===`application/xhtml+xml`&&Qe[e.namespaceURI]):!1},ht=function(e){wi(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw zi(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},gt=function(e){yt(e);let t=h(e);if(t){let e=[];xi(t,t=>{wi(e,t)}),xi(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},_t=function(e,n){try{wi(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{wi(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`){if(Me||Ne)try{ht(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},vt=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||j[I(i)]))try{e.removeAttribute(i)}catch{}}},yt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===va.element&&vt(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},bt=function(e){if(!N)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=y?y(e):e.nodeType;if(n===va.processingInstruction||n===va.comment&&Ri(ha,e.data)){try{p(e)}catch{}continue}if(n===va.element){let t=e,n=I(b?b(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&n!==`label`&&n!==`output`&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},xt=function(e){let t=null,r=null;if(je)e=`<remove></remove>`+e;else{let t=ki(e,/^[\r\n\t ]+/);r=t&&t[0]}rt===`application/xhtml+xml`&&Xe===Ye&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=S?T(e):e;if(Xe===Ye)try{t=new l().parseFromString(i,rt)}catch{}if(!t||!t.documentElement){t=oe.createDocument(Xe,`template`,null);try{t.documentElement.innerHTML=Ze?C:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Xe===Ye?le.call(t,De?`html`:`body`)[0]:De?t.documentElement:a},St=function(e){let t=x?x(e):e.ownerDocument;return se.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ct=function(e){return e=Ai(e,ue,` `),e=Ai(e,de,` `),e=Ai(e,O,` `),e},wt=function(e){e.normalize();let t=x?x(e):e.ownerDocument,n=se.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Ct(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&xi(i,e=>{Et(e.content)&&wt(e.content)})},Tt=function(e){let t=b?b(e):null;return typeof t!=`string`||I(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},Et=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===va.documentFragment}catch{return!1}},Dt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function Ot(e,n,r){e.length!==0&&xi(e,e=>{e.call(t,n,r,at)})}let kt=function(e,t){return!!(N&&e.hasChildNodes()&&!Dt(e.firstElementChild)&&Ri(ma,e.textContent)&&Ri(ma,e.innerHTML)||N&&e.namespaceURI===Ye&&t===`style`&&Dt(e.firstElementChild)||e.nodeType===va.processingInstruction||N&&e.nodeType===va.comment&&Ri(ha,e.data))},At=function(e,t,n){if(!ye[t]&&Ft(t)&&(M.tagNameCheck instanceof RegExp&&Ri(M.tagNameCheck,t)||M.tagNameCheck instanceof Function&&M.tagNameCheck(t)))return!1;if(Re&&!Ve[t]){let t=g(e),r=h(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,m(e))}}}return ht(e),!0},jt=function(e,t,n,r){return e.length===0?t:t===n||t===r?Ui(t):t},Mt=function(e,n){if(Ot(D.beforeSanitizeElements,e,null),e!==n&&g(e)===null)return ze&&yt(e),!0;if(Tt(e))return ht(e),!0;let r=I(b?b(e):e.nodeName);if(A=jt(D.uponSanitizeElement,A,_e,ke),Ot(D.uponSanitizeElement,e,{tagName:r,allowedTags:A}),e!==n&&g(e)===null)return ze&&yt(e),!0;if(kt(e,r))return ht(e),!0;if(ye[r]||!(xe.tagCheck instanceof Function&&xe.tagCheck(r))&&!A[r]){let t=At(e,r,n);return t===!1&&Ot(D.afterSanitizeElements,e,null),t}if((y?y(e):e.nodeType)===va.element&&!mt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Ri(ga,e.innerHTML))return ht(e),!0;if(Ee&&e.nodeType===va.text){let n=Ct(e.textContent);e.textContent!==n&&(wi(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Ot(D.afterSanitizeElements,e,null),!1},Nt=function(e,t,r){if(be[t]||N&&t===`patchsrc`||N&&t===`for`&&e!==`label`&&e!==`output`||Fe&&(t===`id`||t===`name`)&&(r in n||r in ot))return!1;let i=j[t]||xe.attributeCheck instanceof Function&&xe.attributeCheck(t,e);if(!(Ce&&Ri(fe,t))&&!(Se&&Ri(pe,t))){if(!i){if(!(Ft(e)&&(M.tagNameCheck instanceof RegExp&&Ri(M.tagNameCheck,e)||M.tagNameCheck instanceof Function&&M.tagNameCheck(e))&&(M.attributeNameCheck instanceof RegExp&&Ri(M.attributeNameCheck,t)||M.attributeNameCheck instanceof Function&&M.attributeNameCheck(t,e))||t===`is`&&M.allowCustomizedBuiltInElements&&(M.tagNameCheck instanceof RegExp&&Ri(M.tagNameCheck,r)||M.tagNameCheck instanceof Function&&M.tagNameCheck(r))))return!1}else if(!Ge[t]&&!Ri(ge,Ai(r,me,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ji(r,`data:`)===0&&Ue[e])&&!(we&&!Ri(k,Ai(r,me,``)))&&r)return!1}return!0},Pt=z({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Ft=function(e){return!Pt[Di(e)]&&Ri(he,e)},It=function(e,t,n,r){if(S&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return T(r);case`TrustedScriptURL`:return re(r)}return r},Lt=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),Tt(e)?ht(e):Ci(t.removed)}catch{_t(n,e)}},Rt=function(e){Ot(D.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||Tt(e))return;j=jt(D.uponSanitizeAttribute,j,ve,Ae);let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0},r=t.length,i=I(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=I(o),u=c,d=o===`value`?u:Mi(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,Ot(D.uponSanitizeAttribute,e,n),d=n.attrValue,Ie&&(l===`id`||l===`name`)&&ji(d,Le)!==0&&(_t(o,e),d=Le+d),N&&Ri(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){_t(o,e);continue}if(l===`attributename`&&ki(d,`href`)){_t(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){_t(o,e);continue}if(!Te&&Ri(_a,d)){_t(o,e);continue}if(Ee&&(d=Ct(d)),!Nt(i,l,d)){_t(o,e);continue}d=It(i,l,s,d),d!==u&&Lt(e,o,s,d)}}Ot(D.afterSanitizeAttributes,e,null)},zt=function(e){let t=null,n=St(e);for(Ot(D.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Ot(D.uponSanitizeShadowNode,t,null),Mt(t,e),Rt(t),Et(t.content)&&zt(t.content),(y?y(t):t.nodeType)===va.element){let e=_(t);Et(e)&&(Bt(e),zt(e))}Ot(D.afterSanitizeShadowDOM,e,null)},Bt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){zt(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===va.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&I(e)===`template`){let e=n.content;Et(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);Et(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ze=!e,Ze&&(e=`<!-->`),typeof e!=`string`&&!Dt(e)&&(e=Wi(e),typeof e!=`string`))throw zi(`dirty is not a string, aborting`);if(!t.isSupported)return e;Oe?(A=ke,j=Ae):ct(n),(D.uponSanitizeElement.length>0||D.uponSanitizeAttribute.length>0)&&(A=Ui(A)),D.uponSanitizeAttribute.length>0&&(j=Ui(j)),t.removed=[];let c=ze&&typeof e!=`string`&&Dt(e);if(c){bt(e);let t=b?b(e):e.nodeName;if(typeof t==`string`){let n=I(t);if(!A[n]||ye[n])throw gt(e),zi(`root node is forbidden and cannot be sanitized in-place`)}if(Tt(e))throw gt(e),zi(`root node is clobbered and cannot be sanitized in-place`);try{Bt(e)}catch(t){throw gt(e),t}}else if(Dt(e))i=xt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===va.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Bt(a);else{if(!Me&&!Ee&&!De&&e.indexOf(`<`)===-1)return S&&Pe?T(e):e;if(i=xt(e),!i)return Me?null:Pe?C:``}i&&je&&ht(i.firstChild);let l=c?e:i;try{let e=St(l);for(;o=e.nextNode();)Mt(o,l),Rt(o),Et(o.content)&&zt(o.content)}catch(n){throw c&&(gt(e),xi(t.removed,e=>{e.element&&yt(e.element)})),n}if(c)return xi(t.removed,e=>{e.element&&yt(e.element)}),Ee&&wt(e),e;if(Me){if(Ee&&wt(i),Ne)for(s=ce.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(j.shadowroot||j.shadowrootmode)&&(s=E.call(r,s,!0)),s}let u=De?i.outerHTML:i.innerHTML;return De&&A[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Ri(fa,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
133
|
+
`+u),Ee&&(u=Ct(u)),S&&Pe?T(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ct(e),Oe=!0,ke=A,Ae=j},t.clearConfig=function(){at=null,Oe=!1,ke=null,Ae=null,S=w,C=``},t.isValidAttribute=function(e,t,n){at||ct({});let r=I(e),i=I(t);return Nt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Ii(D,e)&&wi(D[e],t)},t.removeHook=function(e,t){if(Ii(D,e)){if(t!==void 0){let n=Si(D[e],t);return n===-1?void 0:Ti(D[e],n,1)[0]}return Ci(D[e])}},t.removeHooks=function(e){Ii(D,e)&&(D[e]=[])},t.removeAllHooks=function(){D=xa()},t}var wa=Ca();function Ta(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ea=Ta();function Da(e){Ea=e}var Oa={exec:()=>null};function ka(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function B(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(ja.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Aa=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),ja={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:ka(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ka(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:ka(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:ka(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:ka(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:ka(e=>RegExp(`^ {0,${e}}>`))},Ma=/^(?:[ \t]*(?:\n|$))+/,Na=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Pa=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Fa=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ia=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,La=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ra=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,za=B(Ra).replace(/bull/g,La).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Ba=B(Ra).replace(/bull/g,La).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Va=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Ha=/^[^\n]+/,Ua=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Wa=B(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Ua).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ga=B(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,La).getRegex(),Ka=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,qa=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ja=B(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,qa).replace(`tag`,Ka).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ya=e=>B(Va).replace(`hr`,Fa).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Ka).getRegex(),Xa=Ya(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Za=Ya(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Qa={blockquote:B(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Za).getRegex(),code:Na,def:Wa,fences:Pa,heading:Ia,hr:Fa,html:Ja,lheading:za,list:Ga,newline:Ma,paragraph:Xa,table:Oa,text:Ha},$a=B(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Fa).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Ka).getRegex(),eo={...Qa,lheading:Ba,table:$a,paragraph:B(Va).replace(`hr`,Fa).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,$a).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Ka).getRegex()},to={...Qa,html:B(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,qa).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Oa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:B(Va).replace(`hr`,Fa).replace(`heading`,` *#{1,6} *[^
|
|
134
|
+
]`).replace(`lheading`,za).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},no=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ro=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,io=/^( {2,}|\\)\n(?!\s*$)/,ao=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,oo=/[\p{P}\p{S}]/u,so=/[\s\p{P}\p{S}]/u,co=/[^\s\p{P}\p{S}]/u,lo=B(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,so).getRegex(),uo=/[\p{Pi}\p{Ps}"']/u,fo=/(?!~)[\p{P}\p{S}]/u,V=/(?!~)[\s\p{P}\p{S}]/u,H=/(?:[^\s\p{P}\p{S}]|~)/u,po=B(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Aa?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),mo=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ho=B(mo,`u`).replace(/punct/g,oo).getRegex(),go=B(mo,`u`).replace(/punct/g,fo).getRegex(),_o=B(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,uo).replace(/punct/g,oo).getRegex(),vo=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,yo=B(vo,`gu`).replace(/notPunctSpace/g,co).replace(/punctSpace/g,so).replace(/punct/g,oo).getRegex(),bo=B(vo,`gu`).replace(/notPunctSpace/g,H).replace(/punctSpace/g,V).replace(/punct/g,fo).getRegex(),xo=B(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,co).replace(/punctSpace/g,so).replace(/punct/g,oo).getRegex(),So=B(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,co).replace(/punctSpace/g,so).replace(/punct/g,oo).getRegex(),Co=B(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,co).replace(/punctSpace/g,so).replace(/punct/g,oo).getRegex(),wo=B(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,oo).getRegex(),To=B(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,co).replace(/punctSpace/g,so).replace(/punct/g,oo).getRegex(),Eo=B(/\\(punct)/,`gu`).replace(/punct/g,oo).getRegex(),Do=B(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Oo=B(qa).replace(`(?:-->|$)`,`-->`).getRegex(),ko=B(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Oo).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ao=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,jo=B(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,Ao).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Mo=B(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Ao).replace(`ref`,Ua).getRegex(),No=B(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Ua).getRegex(),Po=B(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Mo).replace(`nolink`,No).getRegex(),Fo=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Io={_backpedal:Oa,anyPunctuation:Eo,autolink:Do,blockSkip:po,br:io,code:ro,del:Oa,delLDelim:Oa,delRDelim:Oa,emStrongLDelim:ho,emStrongRDelimAst:yo,emStrongRDelimUnd:So,escape:no,link:jo,nolink:No,punctuation:lo,reflink:Mo,reflinkSearch:Po,tag:ko,text:ao,url:Oa},Lo={...Io,emStrongLDelim:_o,emStrongRDelimAst:xo,emStrongRDelimUnd:Co,link:B(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Ao).getRegex(),reflink:B(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Ao).getRegex()},Ro={...Io,emStrongRDelimAst:bo,emStrongLDelim:go,delLDelim:wo,delRDelim:To,url:B(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Fo).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:B(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Fo).getRegex()},zo={...Ro,br:B(io).replace(`{2,}`,`*`).getRegex(),text:B(Ro.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Bo={normal:Qa,gfm:eo,pedantic:to},Vo={normal:Io,gfm:Ro,breaks:zo,pedantic:Lo},Ho={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Uo=e=>Ho[e];function Wo(e,t){if(t){if(ja.escapeTest.test(e))return e.replace(ja.escapeReplace,Uo)}else if(ja.escapeTestNoEncode.test(e))return e.replace(ja.escapeReplaceNoEncode,Uo);return e}function Go(e){try{e=encodeURI(e).replace(ja.percentDecode,`%`)}catch{return null}return e}function Ko(e,t){let n=e.replace(ja.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(ja.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(ja.slashPipe,`|`);return n}function qo(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Jo(e){let t=e.split(`
|
|
135
|
+
`),n=t.length-1;for(;n>=0&&ja.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
136
|
+
`)}function Yo(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Xo(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Zo(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function Qo(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
137
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
138
|
+
`)}var $o=class{options;rules;lexer;constructor(e){this.options=e||Ea}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Jo(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Qo(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=qo(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:qo(t[0],`
|
|
139
|
+
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:qo(t[0],`
|
|
140
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=qo(t[0],`
|
|
141
|
+
`).split(`
|
|
142
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
143
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
144
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
145
|
+
${s}`:s,r=r?`${r}
|
|
146
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
|
|
147
|
+
`),o=t.raw+`
|
|
148
|
+
`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s,n=`${n}
|
|
149
|
+
${a}`,r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
150
|
+
`+e.join(`
|
|
151
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
152
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=Xo(t[2].split(`
|
|
153
|
+
`,1)[0],t[1].length),l=e.split(`
|
|
154
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
155
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
156
|
+
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
157
|
+
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
158
|
+
`+l}u=!l.trim(),r+=p+`
|
|
159
|
+
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]);let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1;if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Jo(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:qo(t[0],`
|
|
160
|
+
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Ko(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
161
|
+
`):[],a={type:`table`,raw:qo(t[0],`
|
|
162
|
+
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Ko(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:qo(t[0],`
|
|
163
|
+
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
164
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=qo(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Yo(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Zo(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Zo(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},es=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ea,this.options.tokenizer=this.options.tokenizer||new $o,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:ja,block:Bo.normal,inline:Vo.normal};this.options.pedantic?(t.block=Bo.pedantic,t.inline=Vo.pedantic):this.options.gfm&&(t.block=Bo.gfm,t.inline=this.options.breaks?Vo.breaks:Vo.gfm),this.tokenizer.rules=t}static get rules(){return{block:Bo,inline:Vo}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(ja.carriageReturn,`
|
|
165
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(ja.tabCharGlobal,` `).replace(ja.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
166
|
+
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
167
|
+
`)?``:`
|
|
168
|
+
`)+i.raw,n.text+=`
|
|
169
|
+
`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
170
|
+
`)?``:`
|
|
171
|
+
`)+i.raw,n.text+=`
|
|
172
|
+
`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
|
|
173
|
+
`)?``:`
|
|
174
|
+
`)+i.raw,r.text+=`
|
|
175
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
176
|
+
`)?``:`
|
|
177
|
+
`)+i.raw,n.text+=`
|
|
178
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links){let e=Object.keys(this.tokens.links);e.length>0&&(n=n.replace(this.tokenizer.rules.inline.reflinkSearch,t=>e.includes(t.slice(t.lastIndexOf(`[`)+1,-1))?`[`+`a`.repeat(t.length-2)+`]`:t))}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,`++`),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},ts=class{options;parser;constructor(e){this.options=e||Ea}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(ja.notSpaceStart)?.[0],i=e.replace(ja.endingNewline,``)+`
|
|
179
|
+
`;return r?`<pre><code class="language-`+Wo(r)+`">`+(n?i:Wo(i,!0))+`</code></pre>
|
|
180
|
+
`:`<pre><code>`+(n?i:Wo(i,!0))+`</code></pre>
|
|
181
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
182
|
+
${this.parser.parse(e)}</blockquote>
|
|
183
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
184
|
+
`}hr(e){return`<hr>
|
|
185
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
186
|
+
`+r+`</`+i+`>
|
|
187
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
188
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
189
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
190
|
+
<thead>
|
|
191
|
+
`+t+`</thead>
|
|
192
|
+
`+r+`</table>
|
|
193
|
+
`}tablerow({text:e}){return`<tr>
|
|
194
|
+
${e}</tr>
|
|
195
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
196
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Wo(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Go(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+Wo(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Go(e);if(i===null)return Wo(n);e=i;let a=`<img src="${e}" alt="${Wo(n)}"`;return t&&(a+=` title="${Wo(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Wo(e.text)}},ns=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},rs=class e{options;renderer;textRenderer;constructor(e){this.options=e||Ea,this.options.renderer=this.options.renderer||new ts,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ns}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},is=class{options;block;constructor(e){this.options=e||Ea}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?es.lex:es.lexInline}provideParser(e=this.block){return e?rs.parse:rs.parseInline}},as=new class{defaults=Ta();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=rs;Renderer=ts;TextRenderer=ns;Lexer=es;Tokenizer=$o;Hooks=is;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ts(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new $o(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new is;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=is.passThroughHooks.has(n)?e=>{if(this.defaults.async&&is.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return es.lex(e,t??this.defaults)}parser(e,t){return rs.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?es.lex:es.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?rs.parse:rs.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?es.lex:es.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?rs.parse:rs.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
197
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Wo(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function U(e,t){return as.parse(e,t)}U.options=U.setOptions=function(e){return as.setOptions(e),U.defaults=as.defaults,Da(U.defaults),U},U.getDefaults=Ta,U.defaults=Ea;function os(...e){return as.use(...e),U.defaults=as.defaults,Da(U.defaults),U}U.use=os,U.walkTokens=function(e,t){return as.walkTokens(e,t)},U.parseInline=as.parseInline,U.Parser=rs,U.parser=rs.parse,U.Renderer=ts,U.TextRenderer=ns,U.Lexer=es,U.lexer=es.lex,U.Tokenizer=$o,U.Hooks=is,U.parse=U,U.options,U.setOptions,U.walkTokens,U.parseInline,rs.parse,es.lex;var ss=v.createContext(null);function cs({value:e,children:t}){return(0,P.jsx)(ss.Provider,{value:e,children:t})}function ls(){return v.useContext(ss)}function us(e){let t=v.useMemo(()=>new Set,[e]);return v.useCallback(async n=>{if(!e)return new Set;let r=n.filter(e=>t.has(e)),i=n.filter(e=>!t.has(e));if(i.length===0)return new Set(r);try{let n=(await e(i)).files.filter(e=>e.ok).map(e=>e.path);for(let e of n)t.add(e);return new Set([...r,...n])}catch{return new Set(r)}},[e,t])}function ds(e){let t=ls(),[n,r]=v.useState(fs),i=e.filter(e=>!e.includes(`
|
|
198
|
+
`)).join(`
|
|
199
|
+
`);return v.useEffect(()=>{if(!t||i===``){r(fs);return}let e=!0;return t.verify(i.split(`
|
|
200
|
+
`)).then(t=>{e&&r(t)}),()=>{e=!1}},[t,i]),n}var fs=new Set;function ps({path:e,text:t}){let n=ls();return n?(0,P.jsx)(`button`,{type:`button`,className:`pathlink`,title:e,onClick:()=>n.open(e),children:t??e}):(0,P.jsx)(P.Fragment,{children:t??e})}var ms=`data-epoch-path`,hs=new Set([`PRE`,`A`,`BUTTON`]);function gs(e,t,n){let r=[...t].sort((e,t)=>t.length-e.length);r.length>0&&_s(e,r);let i=e=>{let t=e.target;if(!(t instanceof Element))return;let r=t.closest(`[${ms}]`)?.getAttribute(ms);r&&n(r)};return e.addEventListener(`click`,i),()=>e.removeEventListener(`click`,i)}function _s(e,t){let n=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:t=>{for(let n=t.parentElement;n&&n!==e;n=n.parentElement)if(hs.has(n.tagName))return NodeFilter.FILTER_REJECT;return NodeFilter.FILTER_ACCEPT}});for(let e=r.nextNode();e;e=r.nextNode())e.nodeValue&&e.nodeValue.trim()!==``&&n.push(e);for(let r of n)vs(r,t,e)}function vs(e,t,n){let r=[e.nodeValue??``];for(let e of t)for(let t=0;t<r.length;t+=1){let n=r[t];if(typeof n!=`string`)continue;let i=n.indexOf(e);i<0||(r.splice(t,1,n.slice(0,i),[e],n.slice(i+e.length)),t+=2)}if(r.every(e=>typeof e==`string`))return;let i=n.ownerDocument.createDocumentFragment();for(let e of r){if(typeof e==`string`){e!==``&&i.append(e);continue}let t=e[0]??``,r=n.ownerDocument.createElement(`button`);r.type=`button`,r.className=`pathlink`,r.setAttribute(ms,t),r.title=t,r.textContent=t,i.append(r)}e.replaceWith(i)}var ys=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function bs(e){return xs(e)}function xs(e){return Array.isArray(e)?Ss(e):e instanceof RegExp?e:typeof e==`object`?Cs(e):e}function Ss(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=xs(e[n]);return t}function Cs(e){let t={};for(let n in e)t[n]=xs(e[n]);return t}function ws(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Ts(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Ts(e.substring(0,e.length-1)):e.substr(~t+1)}var Es=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ds=class{static hasCaptures(e){return e!==null&&(Es.lastIndex=0,Es.test(e))}static replaceCaptures(e,t,n){return e.replace(Es,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Os(e,t){return e<t?-1:+(e>t)}function ks(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Os(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function As(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function js(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Ms=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Ns=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Rs(e),t)}static createFromParsedTheme(e,t){return Vs(e,t)}_cachedMatchRoot=new Ms(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Fs(e.parent,t.parentScopes));return n?new Ls(n.fontStyle,n.foreground,n.background):null}},Ps=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Fs(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Is(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Is(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Ls=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Rs(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&As(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&As(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new zs(l,u,e,o,s,c)}}return n}var zs=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},Bs=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(Bs||{});function Vs(e,t){e.sort((e,t)=>{let n=Os(e.scope,t.scope);return n!==0||(n=ks(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new Hs(t),o=new Ls(n,a.getId(r),a.getId(i)),s=new Gs(new Ws(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new Ns(a,o,s)}var Hs=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Us=Object.freeze([]),Ws=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Us,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Gs=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Ws.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(ks(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Ws(e,t,n,r,i))}},Ks=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Js(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function qs(e){return e}function Js(e){return e}function Ys(e,t){let n=[],r=Zs(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Xs(i)){let e=[];do e.push(i),i=r.next();while(Xs(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Xs(e){return!!e&&!!e.match(/[\w\.:]+/)}function Zs(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Qs(e){typeof e.dispose==`function`&&e.dispose()}var $s=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},ec=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},tc=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},nc=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new $s(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new tc;for(let n of e)rc(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof $s){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function rc(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof $s?ac({baseGrammar:a,selfGrammar:i},r):ic(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new $s(e))}function ic(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];oc([r],t,n)}}function ac(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&oc(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&oc(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function oc(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?ws({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&oc(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=fc(i);switch(a.kind){case 0:ac({...t,selfGrammar:t.baseGrammar},n);break;case 1:ac(t,n);break;case 2:ic(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?ic(a.ruleName,i,n):ac(i,n)}else a.kind===4?n.add(new ec(a.scopeName,a.ruleName)):n.add(new $s(a.scopeName))}}}var sc=class{kind=0},cc=class{kind=1},lc=class{constructor(e){this.ruleName=e}kind=2},uc=class{constructor(e){this.scopeName=e}kind=3},dc=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function fc(e){if(e===`$base`)return new sc;if(e===`$self`)return new cc;let t=e.indexOf(`#`);return t===-1?new uc(e):t===0?new lc(e.substring(1)):new dc(e.substring(0,t),e.substring(t+1))}var pc=/\\(\d+)/,mc=/\\(\d+)/g,hc=-1,gc=-2;function _c(e){return e}function vc(e){return e}var yc=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Ds.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Ds.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Ts(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Ds.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ds.replaceCaptures(this._contentName,e,t)}},bc=class extends yc{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},xc=class extends yc{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ec(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Dc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Sc=class extends yc{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Dc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Cc=class extends yc{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Ec(i,this.id),this.beginCaptures=a,this._end=new Ec(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Dc;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},wc=class extends yc{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Ec(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Ec(o,gc),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Dc;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Dc,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},Tc=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new bc(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new xc(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=ws({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Sc(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new wc(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Cc(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=fc(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Sc||e instanceof Cc||e instanceof wc)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ec=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&pc.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return mc.lastIndex=0,this.source.replace(mc,(e,t)=>js(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Dc=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Oc(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Oc(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Oc=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
201
|
+
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},kc=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Ac=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new kc(e,8),this._embeddedLanguagesMatcher=new jc(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new kc(0,0);_getBasicScopeAttributes=new Ms(e=>new kc(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},jc=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>js(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Mc=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Nc(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Pc(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Mc(i,!0);f()}return new Mc(i,!1);function f(){let o=Fc(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===hc){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Bc(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Cc){let r=o;Bc(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof wc){let r=o;Bc(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(Bc(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Pc(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof wc&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=zc(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==gc){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Bc(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Fc(e,t,n,r,i,a){let o=Ic(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Lc(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Ic(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Rc(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Lc(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Rc(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Rc(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function zc(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Bc(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Nc(e,p,n&&d.start===0,d.start,f,i,!1,0),Qs(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new Vc(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Vc=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Hc(e,t,n,r,i,a,o,s){return new Kc(e,t,n,r,i,a,o,s)}function Uc(e,t,n,r,i){let a=Ys(t,Wc),o=Tc.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function Wc(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(Gc(t[r],e))return n=r+1,!0;return!1})}function Gc(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var Kc=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Ac(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=qc(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=Ys(e,Wc);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Uc(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Uc(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(_c(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[vc(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=qc(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Tc.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Yc.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=Ks.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?Jc.createRootAndLookUpScopeName(a,r,this):Jc.createRoot(`unknown`,r),t=new Yc(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
202
|
+
`;let a=this.createOnigString(e),o=a.content.length,s=new Zc(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Nc(this,a,i,0,t,s,!0,r);return Qs(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function qc(e,t){return e=bs(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Jc=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Ps.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Ps(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Ps(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),Ks.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Yc=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?Jc.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:vc(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=Jc.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,_c(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Jc.fromExtension(r,n.contentNameScopesList))}},Xc=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):Ys(e,Wc).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Ys(e,Wc).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Zc=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=Ks.set(n,0,qs(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=Ks.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},Qc=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,Hc(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},$c=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Qc(Ns.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Ns.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Xc(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new nc(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},el=Yc.NULL;function tl(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function nl(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function rl(e){return Array.isArray(e)?e:[e]}async function il(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function al(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function ol(e){return e===`ansi`||al(e)}function sl(e){return e===`none`}function cl(e){return sl(e)}var ll=/(\r?\n)/g;function ul(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(ll),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var dl={light:`#333333`,dark:`#bbbbbb`},fl={light:`#fffffe`,dark:`#1e1e1e`},pl=`__shiki_resolved`;function ml(e){if(e?.[pl])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?dl.light:dl.dark,n||=t.type===`light`?fl.light:fl.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,pl,{enumerable:!1,writable:!1,value:!0}),t}async function hl(e){return[...new Set((await Promise.all(e.filter(e=>!ol(e)).map(async e=>await il(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function gl(e){return(await Promise.all(e.map(async e=>cl(e)?null:ml(await il(e))))).filter(e=>!!e)}function _l(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new ys(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var vl=class extends $c{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=ml(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Ns.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=_l(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new ys(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},yl=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},bl=0;function xl(e){bl+=1,e.warnings!==!1&&bl>=10&&bl%10==0&&console.warn(`[Shiki] ${bl} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new ys("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(ml),i=new vl(new yl(e.engine,n),r,n,e.langAlias),a;function o(t){return _l(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new ys(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new ys(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await hl(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await gl(e))}function g(){if(t)throw new ys(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--bl)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Sl(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([gl(e.themes||[]),hl(e.langs||[]),e.engine]);return xl({...e,themes:t,langs:n,engine:r})}var Cl=new WeakMap;function wl(e,t){Cl.set(e,t)}function Tl(e){return Cl.get(e)}var El=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(rl(n).map(e=>[e,el])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Dl(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Dl(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function Ol(e,t){if(!(e instanceof El))throw new ys(`Invalid grammar state`);return e.getInternalStack(t)}var kl=/,/,Al=/ /;function jl(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(al(e.resolveLangAlias(n.lang||`text`))||sl(r))return ul(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new ys(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new ys(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Nl(t,o,i,a,n)}function Ml(...e){if(e.length===2)return Tl(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(al(i)||sl(a))throw new ys(`Plain language does not have grammar state`);if(i===`ansi`)throw new ys(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new El(Pl(n,c,o,s,r).stateStack,c.name,o.name)}function Nl(e,t,n,r,i){let a=Pl(e,t,n,r,i),o=new El(a.stateStack,t.name,n.name);return wl(a.tokens,o),a.tokens}function Pl(e,t,n,r,i){let a=tl(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=ul(e),u=i.grammarState?Ol(i.grammarState,n.name)??el:i.grammarContextCode==null?el:Pl(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=nl(r[Ks.getForeground(s)],a),u=Ks.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=Ks.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(kl).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Al))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Fl(t.scopes):Il(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Fl(e){return e.map(e=>({scopeName:e}))}function Il(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:zl(e,i,t.slice(0,r))}}return n}function Ll(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Rl(e,t,n){if(!Ll(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Ll(e[r],n[i])&&--r,--i;return r===-1}function zl(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Rl(e,t,n)){r.push(a);break}return r}function Bl(e,t,n,r=jl){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:Tl(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=W(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new El(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&wl(s,c),s}function W(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var Vl=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],G=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};G.prototype.normal={},G.prototype.property={},G.prototype.space=void 0;function K(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new G(n,r,t)}function q(e){return e.toLowerCase()}var Hl=class{constructor(e,t){this.attribute=t,this.property=e}};Hl.prototype.attribute=``,Hl.prototype.booleanish=!1,Hl.prototype.boolean=!1,Hl.prototype.commaOrSpaceSeparated=!1,Hl.prototype.commaSeparated=!1,Hl.prototype.defined=!1,Hl.prototype.mustUseProperty=!1,Hl.prototype.number=!1,Hl.prototype.overloadedBoolean=!1,Hl.prototype.property=``,Hl.prototype.spaceSeparated=!1,Hl.prototype.space=void 0;var Ul=s({boolean:()=>J,booleanish:()=>Gl,commaOrSpaceSeparated:()=>Jl,commaSeparated:()=>ql,number:()=>Y,overloadedBoolean:()=>Kl,spaceSeparated:()=>X}),Wl=0,J=Yl(),Gl=Yl(),Kl=Yl(),Y=Yl(),X=Yl(),ql=Yl(),Jl=Yl();function Yl(){return 2**++Wl}var Xl=Object.keys(Ul),Zl=class extends Hl{constructor(e,t,n,r){let i=-1;if(super(e,t),Ql(this,`space`,r),typeof n==`number`)for(;++i<Xl.length;){let e=Xl[i];Ql(this,Xl[i],(n&Ul[e])===Ul[e])}}};Zl.prototype.defined=!0;function Ql(e,t,n){n&&(e[t]=n)}function $l(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Zl(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[q(r)]=r,n[q(a.attribute)]=r}return new G(t,n,e.space)}var eu=$l({properties:{ariaActiveDescendant:null,ariaAtomic:Gl,ariaAutoComplete:null,ariaBusy:Gl,ariaChecked:Gl,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:X,ariaCurrent:null,ariaDescribedBy:X,ariaDetails:null,ariaDisabled:Gl,ariaDropEffect:X,ariaErrorMessage:null,ariaExpanded:Gl,ariaFlowTo:X,ariaGrabbed:Gl,ariaHasPopup:null,ariaHidden:Gl,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:X,ariaLevel:Y,ariaLive:null,ariaModal:Gl,ariaMultiLine:Gl,ariaMultiSelectable:Gl,ariaOrientation:null,ariaOwns:X,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:Gl,ariaReadOnly:Gl,ariaRelevant:null,ariaRequired:Gl,ariaRoleDescription:X,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:Gl,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function tu(e,t){return t in e?e[t]:t}function nu(e,t){return tu(e,t.toLowerCase())}var ru=$l({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ql,acceptCharset:X,accessKey:X,action:null,allow:null,allowFullScreen:J,allowPaymentRequest:J,allowUserMedia:J,alpha:J,alt:null,as:null,async:J,autoCapitalize:null,autoComplete:X,autoFocus:J,autoPlay:J,blocking:X,capture:null,charSet:null,checked:J,cite:null,className:X,closedBy:null,colorSpace:null,cols:Y,colSpan:Y,command:null,commandFor:null,content:null,contentEditable:Gl,controls:J,controlsList:X,coords:Y|ql,crossOrigin:null,data:null,dateTime:null,decoding:null,default:J,defer:J,dir:null,dirName:null,disabled:J,download:Kl,draggable:Gl,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:J,formTarget:null,headers:X,height:Y,hidden:Kl,high:Y,href:null,hrefLang:null,htmlFor:X,httpEquiv:X,id:null,imageSizes:null,imageSrcSet:null,inert:J,inputMode:null,integrity:null,is:null,isMap:J,itemId:null,itemProp:X,itemRef:X,itemScope:J,itemType:X,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:J,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:J,muted:J,name:null,nonce:null,noModule:J,noValidate:J,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:J,optimum:Y,pattern:null,ping:X,placeholder:null,playsInline:J,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:J,referrerPolicy:null,rel:X,required:J,reversed:J,rows:Y,rowSpan:Y,sandbox:X,scope:null,scoped:J,seamless:J,selected:J,shadowRootClonable:J,shadowRootCustomElementRegistry:J,shadowRootDelegatesFocus:J,shadowRootMode:null,shadowRootSerializable:J,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:Gl,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:J,useMap:null,value:Gl,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:X,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:J,declare:J,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:J,noHref:J,noShade:J,noWrap:J,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:Gl,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:J,disablePictureInPicture:J,disableRemotePlayback:J,exportParts:ql,part:X,prefix:null,property:null,results:Y,security:null,unselectable:null},space:`html`,transform:nu}),iu=$l({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:Jl,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:X,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:J,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ql,g2:ql,glyphName:ql,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:Jl,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:X,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Jl,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Jl,rev:Jl,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Jl,requiredFeatures:Jl,requiredFonts:Jl,requiredFormats:Jl,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:Jl,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Jl,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Jl,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:tu}),au=$l({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()}}),ou=$l({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:nu}),su=$l({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),cu=/[A-Z]/g,lu=/-[a-z]/g,uu=/^data[-\w.:]+$/i;function du(e,t){let n=q(t),r=t,i=Hl;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&uu.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(lu,pu);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!lu.test(e)){let n=e.replace(cu,fu);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Zl}return new i(r,t)}function fu(e){return`-`+e.toLowerCase()}function pu(e){return e.charAt(1).toUpperCase()}var mu=K([eu,ru,au,ou,su],`html`),hu=K([eu,iu,au,ou,su],`svg`),gu={}.hasOwnProperty;function _u(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&gu.call(t,e)){let n=String(t[e]);i=gu.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var vu=/["&'<>`]/g,yu=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,bu=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,xu=/[|\\{}()[\]^$+*?.]/g,Su=new WeakMap;function Cu(e,t){if(e=e.replace(t.subset?wu(t.subset):vu,r),t.subset||t.escapeOnly)return e;return e.replace(yu,n).replace(bu,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function wu(e){let t=Su.get(e);return t||(t=Tu(e),Su.set(e,t)),t}function Tu(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(xu,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Eu=/[\dA-Fa-f]/;function Du(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Eu.test(String.fromCharCode(t))?r:r+`;`}var Ou=/\d/;function ku(e,t,n){let r=`&#`+String(e);return n&&t&&!Ou.test(String.fromCharCode(t))?r:r+`;`}var Au=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),ju={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},Mu=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Nu={}.hasOwnProperty,Pu={},Fu;for(Fu in ju)Nu.call(ju,Fu)&&(Pu[ju[Fu]]=Fu);var Iu=/[^\dA-Za-z]/;function Lu(e,t,n,r){let i=String.fromCharCode(e);if(Nu.call(Pu,i)){let e=Pu[i],a=`&`+e;return n&&Au.includes(e)&&!Mu.includes(e)&&(!r||t&&t!==61&&Iu.test(String.fromCharCode(t)))?a:a+`;`}return``}function Ru(e,t,n){let r=Du(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Lu(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=ku(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function zu(e,t){return Cu(e,Object.assign({format:Ru},t))}var Bu=/^>|^->|<!--|-->|--!>|<!-$/g,Vu=[`>`],Hu=[`<`,`>`];function Uu(e,t,n,r){return r.settings.bogusComments?`<?`+zu(e.value,Object.assign({},r.settings.characterReferences,{subset:Vu}))+`>`:`<!--`+e.value.replace(Bu,i)+`-->`;function i(e){return zu(e,Object.assign({},r.settings.characterReferences,{subset:Hu}))}}function Wu(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function Z(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 Gu(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function Ku(e){return e.join(` `).trim()}var qu=/[ \t\n\f\r]/g;function Ju(e){return typeof e==`object`?e.type===`text`&&Yu(e.value):Yu(e)}function Yu(e){return e.replace(qu,``)===``}var Xu=$u(1),Zu=$u(-1),Qu=[];function $u(e){return t;function t(t,n,r){let i=t?t.children:Qu,a=(n||0)+e,o=i[a];if(!r)for(;o&&Ju(o);)a+=e,o=i[a];return o}}var ed={}.hasOwnProperty;function td(e){return t;function t(t,n,r){return ed.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var nd=td({body:ad,caption:rd,colgroup:rd,dd:ld,dt:cd,head:rd,html:id,li:sd,optgroup:dd,option:fd,p:od,rp:ud,rt:ud,tbody:md,td:_d,tfoot:hd,th:_d,thead:pd,tr:gd});function rd(e,t,n){let r=Xu(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&Ju(r.value.charAt(0)))}function id(e,t,n){let r=Xu(n,t);return!r||r.type!==`comment`}function ad(e,t,n){let r=Xu(n,t);return!r||r.type!==`comment`}function od(e,t,n){let r=Xu(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function sd(e,t,n){let r=Xu(n,t);return!r||r.type===`element`&&r.tagName===`li`}function cd(e,t,n){let r=Xu(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function ld(e,t,n){let r=Xu(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function ud(e,t,n){let r=Xu(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function dd(e,t,n){let r=Xu(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function fd(e,t,n){let r=Xu(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function pd(e,t,n){let r=Xu(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function md(e,t,n){let r=Xu(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function hd(e,t,n){return!Xu(n,t)}function gd(e,t,n){let r=Xu(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function _d(e,t,n){let r=Xu(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var vd=td({body:bd,colgroup:xd,head:Q,html:yd,tbody:Sd});function yd(e){let t=Xu(e,-1);return!t||t.type!==`comment`}function Q(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function bd(e){let t=Xu(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&Ju(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function xd(e,t,n){let r=Zu(n,t),i=Xu(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&nd(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Sd(e,t,n){let r=Zu(n,t),i=Xu(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&nd(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Cd={name:[[`
|
|
203
|
+
\f\r &/=>`.split(``),`
|
|
204
|
+
\f\r "&'/=>\``.split(``)],[`\0
|
|
205
|
+
\f\r "&'/<=>`.split(``),`\0
|
|
206
|
+
\f\r "&'/<=>\``.split(``)]],unquoted:[[`
|
|
207
|
+
\f\r &>`.split(``),`\0
|
|
208
|
+
\f\r "&'<=>\``.split(``)],[`\0
|
|
209
|
+
\f\r "&'<=>\``.split(``),`\0
|
|
210
|
+
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function wd(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=hu);let l=Td(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!vd(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!nd(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Td(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Ed(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Ed(e,t,n){let r=du(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=zu(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Cd.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Gu:Ku)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=zu(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Cd.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&Z(n,o)>Z(n,e.alternative)&&(o=e.alternative),s=o+zu(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Cd.single:Cd.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Dd=[`<`,`&`];function Od(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:zu(e.value,Object.assign({},r.settings.characterReferences,{subset:Dd}))}function kd(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Od(e,t,n,r)}function Ad(e,t,n,r){return r.all(e)}var jd=_u(`type`,{invalid:Md,unknown:Nd,handlers:{comment:Uu,doctype:Wu,element:wd,raw:kd,root:Ad,text:Od}});function Md(e){throw Error("Expected node, not `"+e+"`")}function Nd(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Pd={},Fd={},Id=[];function Ld(e,t){let n=t||Pd,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Rd,all:zd,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Vl,characterReferences:n.characterReferences||Fd,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?hu:mu,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Rd(e,t,n){return jd(e,t,n,this)}function zd(e){let t=[],n=e&&e.children||Id,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var Bd=/\s+/g;function Vd(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(Bd)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(Bd);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function Hd(e){let t=ul(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}var Ud=[`color`,`background-color`];function Wd(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Gd(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function Kd(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=Gd(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return Wd(e,a)})):e}function qd(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>Jd(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&Ud.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new ys('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function Jd(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&Bs.Italic&&(t[`font-style`]=`italic`),e.fontStyle&Bs.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&Bs.Underline&&n.push(`underline`),e.fontStyle&Bs.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function Yd(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function Xd(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=Hd(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new ys(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new ys(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new ys(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));Zd(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return Kd(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new ys(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=Qd(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new ys(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new ys(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&Vd(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function Zd(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new ys(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new ys(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Qd(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Qd).join(``):``}var $d=[Xd()];function ef(e){let t=tf(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...$d]}function tf(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var nf=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],rf={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function af(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function of(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function sf(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)rf[r]&&t.push({type:`setDecoration`,value:rf[r]});else if(r<=29){let e=rf[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:nf[r-30]}});else if(r===38){let n=of(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:nf[r-40]}});else if(r===48){let n=of(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:nf[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:nf[r-100+8]}})}}return t}function cf(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=af(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=sf(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var lf={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function uf(e=lf){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<nf.length;e++)r.push(t(nf[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var df=/#([0-9a-f]{3,8})/i,ff=/var\((--[\w-]+-ansi-[\w-]+)\)/,pf={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function mf(e,t,n){let r=tl(e,n),i=ul(t),a=uf(Object.fromEntries(nf.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||pf[t]]}))),o=cf();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=nl(i,r),o=nl(o,r),n.decorations.has(`dim`)&&(i=hf(i));let s=Bs.None;return n.decorations.has(`bold`)&&(s|=Bs.Bold),n.decorations.has(`italic`)&&(s|=Bs.Italic),n.decorations.has(`underline`)&&(s|=Bs.Underline),n.decorations.has(`strikethrough`)&&(s|=Bs.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function hf(e){let t=e.match(df);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(ff);return n?`var(${n[1]}-dim)`:e}function gf(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!al(r)&&!sl(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return mf(r,t,n)}return jl(e,t,n)}function _f(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new ys("`themes` option must not be empty");let p=Bl(e,t,n,gf);if(c=Tl(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new ys(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>qd(e,h,u,l,d))),c&&wl(a,c);let g=f.map(e=>tl(e.theme,n));i=vf(f,m,g,u,l,`fg`,d),r=vf(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=tl(n.theme,n);a=gf(e,t,n);let l=e.getTheme(n.theme);r=nl(l.bg,s),i=nl(l.fg,s),o=l.name,c=Tl(a)}else throw new ys("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function vf(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=nl(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new ys('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${nl(t[r][a],n[r])||`inherit`}, ${nl(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var yf=/^\s+$/,bf=/^(\s*)(.*?)(\s*)$/;function xf(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>xf(e,t,n),codeToTokens:(t,n)=>_f(e,t,n)}){let i=t;for(let e of ef(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=_f(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Cf(a):d===`never`&&(a=wf(a)),f&&(a=Tf(a));let p={...r,get source(){return i}};for(let e of ef(n))a=e.tokens?.call(p,a)||a;return Sf(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Sf(e,t,n,r=Tl(e)){let i=ef(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:Vd,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
211
|
+
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=Yd(a.htmlStyle||Jd(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&wl(m,r),m}function Cf(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&Bs.Underline||i.fontStyle&Bs.Strikethrough));o&&yf.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function wf(e){return e.map(e=>e.flatMap(e=>{if(yf.test(e.content))return e;let t=e.content.match(bf);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Tf(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=Yd(e.htmlStyle||Jd(e)),i=Yd(n.htmlStyle||Jd(n)),a=e.fontStyle&&(e.fontStyle&Bs.Underline||e.fontStyle&Bs.Strikethrough),o=n.fontStyle&&(n.fontStyle&Bs.Underline||n.fontStyle&Bs.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Ef=Ld;function Df(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>xf(e,t,n),codeToTokens:(t,n)=>_f(e,t,n)},i=Ef(xf(e,t,n,r));for(let e of ef(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Of(e){let t=await Sl(e);return{getLastGrammarState:(...e)=>Ml(t,...e),codeToTokensBase:(e,n)=>gf(t,e,n),codeToTokensWithThemes:(e,n)=>Bl(t,e,n),codeToTokens:(e,n)=>_f(t,e,n),codeToHast:(e,n)=>xf(t,e,n),codeToHtml:(e,n)=>Df(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function kf(e={}){let{name:t=`css-variables`,variablePrefix:n=`--shiki-`,fontStyle:r=!0}=e,i=t=>e.variableDefaults?.[t]?`var(${n}${t}, ${e.variableDefaults[t]})`:`var(${n}${t})`,a={name:t,type:`dark`,colors:{"editor.foreground":i(`foreground`),"editor.background":i(`background`),"terminal.ansiBlack":i(`ansi-black`),"terminal.ansiRed":i(`ansi-red`),"terminal.ansiGreen":i(`ansi-green`),"terminal.ansiYellow":i(`ansi-yellow`),"terminal.ansiBlue":i(`ansi-blue`),"terminal.ansiMagenta":i(`ansi-magenta`),"terminal.ansiCyan":i(`ansi-cyan`),"terminal.ansiWhite":i(`ansi-white`),"terminal.ansiBrightBlack":i(`ansi-bright-black`),"terminal.ansiBrightRed":i(`ansi-bright-red`),"terminal.ansiBrightGreen":i(`ansi-bright-green`),"terminal.ansiBrightYellow":i(`ansi-bright-yellow`),"terminal.ansiBrightBlue":i(`ansi-bright-blue`),"terminal.ansiBrightMagenta":i(`ansi-bright-magenta`),"terminal.ansiBrightCyan":i(`ansi-bright-cyan`),"terminal.ansiBrightWhite":i(`ansi-bright-white`)},tokenColors:[{scope:[`keyword.operator.accessor`,`meta.group.braces.round.function.arguments`,`meta.template.expression`,`markup.fenced_code meta.embedded.block`],settings:{foreground:i(`foreground`)}},{scope:`emphasis`,settings:{fontStyle:`italic`}},{scope:[`strong`,`markup.heading.markdown`,`markup.bold.markdown`],settings:{fontStyle:`bold`}},{scope:[`markup.italic.markdown`],settings:{fontStyle:`italic`}},{scope:`meta.link.inline.markdown`,settings:{fontStyle:`underline`,foreground:i(`token-link`)}},{scope:[`string`,`markup.fenced_code`,`markup.inline`],settings:{foreground:i(`token-string`)}},{scope:[`comment`,`string.quoted.docstring.multi`],settings:{foreground:i(`token-comment`)}},{scope:[`constant.numeric`,`constant.language`,`constant.other.placeholder`,`constant.character.format.placeholder`,`variable.language.this`,`variable.other.object`,`variable.other.class`,`variable.other.constant`,`meta.property-name`,`meta.property-value`,`support`],settings:{foreground:i(`token-constant`)}},{scope:[`keyword`,`storage.modifier`,`storage.type`,`storage.control.clojure`,`entity.name.function.clojure`,`entity.name.tag.yaml`,`support.function.node`,`support.type.property-name.json`,`punctuation.separator.key-value`,`punctuation.definition.template-expression`],settings:{foreground:i(`token-keyword`)}},{scope:`variable.parameter.function`,settings:{foreground:i(`token-parameter`)}},{scope:[`support.function`,`entity.name.type`,`entity.other.inherited-class`,`meta.function-call`,`meta.instance.constructor`,`entity.other.attribute-name`,`entity.name.function`,`constant.keyword.clojure`],settings:{foreground:i(`token-function`)}},{scope:[`entity.name.tag`,`string.quoted`,`string.regexp`,`string.interpolated`,`string.template`,`string.unquoted.plain.out.yaml`,`keyword.other.template`],settings:{foreground:i(`token-string-expression`)}},{scope:[`punctuation.definition.arguments`,`punctuation.definition.dict`,`punctuation.separator`,`meta.function-call.arguments`],settings:{foreground:i(`token-punctuation`)}},{scope:[`markup.underline.link`,`punctuation.definition.metadata.markdown`],settings:{foreground:i(`token-link`)}},{scope:[`beginning.punctuation.definition.list.markdown`],settings:{foreground:i(`token-string`)}},{scope:[`punctuation.definition.string.begin.markdown`,`punctuation.definition.string.end.markdown`,`string.other.link.title.markdown`,`string.other.link.description.markdown`],settings:{foreground:i(`token-keyword`)}},{scope:[`markup.inserted`,`meta.diff.header.to-file`,`punctuation.definition.inserted`],settings:{foreground:i(`token-inserted`)}},{scope:[`markup.deleted`,`meta.diff.header.from-file`,`punctuation.definition.deleted`],settings:{foreground:i(`token-deleted`)}},{scope:[`markup.changed`,`punctuation.definition.changed`],settings:{foreground:i(`token-changed`)}}]};return r||(a.tokenColors=a.tokenColors?.map(e=>(e.settings?.fontStyle&&delete e.settings.fontStyle,e))),a}var Af=4294967295,jf=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:Af,end:Af,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function Mf(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Nf(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Pf=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),Ff=String.raw;function If(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Lf=Ff`\[\^?`,Rf=`c.? | C(?:-.?)?|${Ff`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Ff`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Ff`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Ff`o\{[^\}]*\}?`}|${Ff`\d{1,3}`}`,zf=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Bf=new RegExp(Ff`
|
|
212
|
+
\\ (?:
|
|
213
|
+
${Rf}
|
|
214
|
+
| [gk]<[^>]*>?
|
|
215
|
+
| [gk]'[^']*'?
|
|
216
|
+
| .
|
|
217
|
+
)
|
|
218
|
+
| \( (?:
|
|
219
|
+
\? (?:
|
|
220
|
+
[:=!>({]
|
|
221
|
+
| <[=!]
|
|
222
|
+
| <[^>]*>
|
|
223
|
+
| '[^']*'
|
|
224
|
+
| ~\|?
|
|
225
|
+
| #(?:[^)\\]|\\.?)*
|
|
226
|
+
| [^:)]*[:)]
|
|
227
|
+
)?
|
|
228
|
+
| \*[^\)]*\)?
|
|
229
|
+
)?
|
|
230
|
+
| (?:${zf.source})+
|
|
231
|
+
| ${Lf}
|
|
232
|
+
| .
|
|
233
|
+
`.replace(/\s+/g,``),`gsu`),Vf=new RegExp(Ff`
|
|
234
|
+
\\ (?:
|
|
235
|
+
${Rf}
|
|
236
|
+
| .
|
|
237
|
+
)
|
|
238
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
239
|
+
| ${Lf}
|
|
240
|
+
| &&
|
|
241
|
+
| .
|
|
242
|
+
`.replace(/\s+/g,``),`gsu`);function Hf(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=vp(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(Bf.lastIndex=0;s=Bf.exec(e);){let t=Uf(a,e,s[0],Bf.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(Bf.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?bp(e,u):e).flat(),flags:r}}function Uf(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=Wf(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:Jf(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:cp(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Yf(n)}}if(a===`K`)return{token:np(`keep`,n)};if(a===`N`||a===`R`)return{token:tp(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:tp(`any`,n)};if(a===`X`)return{token:tp(`text_segment`,n)};let e=Kf(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:pp(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:fp(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:ap(`group`,n)};if(n===`(?>`)return{token:ap(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:ap(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:ap(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:ap(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:ip(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
|
|
243
|
+
`,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:tp(`dot`,n)}:n===`^`||n===`$`?{token:Jf(e.singleline?{"^":Ff`\A`,$:Ff`\Z`}[n]:n,n)}:n===`|`?{token:qf(n)}:zf.test(n)?{tokens:xp(n)}:{token:Xf(Mf(n),n)}}function Wf(e,t,n){let r=[ep(t[1]===`^`,t)],i=1,a;for(Vf.lastIndex=n;a=Vf.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(ep(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(Xf(93,e));else if(i--,r.push(Zf(e)),!i)break}else{let t=Gf(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:Vf.lastIndex||e.length}}function Gf(e){if(e[0]===`\\`)return Kf(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Pf.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return tp(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?Qf(e):e===`&&`?$f(e):Xf(Mf(e),e)}function Kf(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return dp(e);if(`dDhHsSwW`.includes(n))return hp(e);if(e.startsWith(Ff`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return gp(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return Xf(Mf(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return Xf(yp(e),e);if(up.has(n))return Xf(up.get(n),e);if(/\d/.test(n))return rp(t,e);if(e===`\\`)throw Error(Ff`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return Xf(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function qf(e){return{type:`Alternator`,raw:e}}function Jf(e,t){return{type:`Assertion`,kind:e,raw:t}}function Yf(e){return{type:`Backreference`,raw:e}}function Xf(e,t){return{type:`Character`,value:e,raw:t}}function Zf(e){return{type:`CharacterClassClose`,raw:e}}function Qf(e){return{type:`CharacterClassHyphen`,raw:e}}function $f(e){return{type:`CharacterClassIntersector`,raw:e}}function ep(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function tp(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function np(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:If(n.flags),raw:t}}function rp(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function ip(e){return{type:`GroupClose`,raw:e}}function ap(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function op(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function sp(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function cp(e){return{type:`Subroutine`,raw:e}}var lp=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),up=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function dp(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return Xf(Mf(t.toUpperCase())-64,e)}function fp(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=_p(n),o=_p(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),np(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,ap(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function pp(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=lp.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return op(l,r??null,i?.split(`,`)??null,e)}function mp(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return sp(t,n,r,e)}function hp(e){let t=e[1].toLowerCase();return tp({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function gp(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return tp(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function _p(e){let t={};return e.includes(`i`)&&(t.ignoreCase=!0),e.includes(`m`)&&(t.dotAll=!0),e.includes(`x`)&&(t.extended=!0),Object.keys(t).length?t:null}function vp(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw Error(`Invalid or unspecified flag "y" mode`);t.textSegmentMode=e[n+2]===`g`?`grapheme`:`word`,n+=3;continue}t[{i:`ignoreCase`,m:`dotAll`,x:`extended`,D:`digitIsAscii`,P:`posixIsAscii`,S:`spaceIsAscii`,W:`wordIsAscii`}[r]]=!0}return t}function yp(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function bp(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[Yf(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(Ff`Octal encoded byte above 177 unsupported "${n}"`)}else r=Mf(t);a.push(Xf(r,(e===0?`\\`:``)+t))}return a}function xp(e){let t=[],n=new RegExp(zf,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(mp(e.slice(0,-1)));continue}}}t.push(mp(e))}return t}function Sp(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function Cp(e){return wp.has(e.type)}var wp=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function Tp(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=Hf(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return Fp();case`Assertion`:return Ep(n);case`Backreference`:return Dp(n,a);case`Character`:return zp(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return Op(n,a,t);case`CharacterClassOpen`:return kp(n,a,t);case`CharacterSet`:return Ap(n,a);case`Directive`:return Up(n.kind,{flags:n.flags});case`GroupOpen`:return jp(n,a,t);case`NamedCallout`:return qp(n.kind,n.tag,n.arguments);case`Quantifier`:return Mp(n,a);case`Subroutine`:return Np(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=Xp(Wp(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(Ff`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(Ff`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function Ep({kind:e}){return Ip(If({"^":`line_start`,$:`line_end`,"\\A":`string_start`,"\\b":`word_boundary`,"\\B":`word_boundary`,"\\G":`search_start`,"\\y":`text_segment_boundary`,"\\Y":`text_segment_boundary`,"\\z":`string_end`,"\\Z":`string_end_newline`}[e],`Unexpected assertion kind "${e}"`),{negate:e===Ff`\B`||e===Ff`\Y`})}function Dp({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`)}return t.hasNumberedRef=!0,Lp(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return Lp(r)}return i(+r)}function Op(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),Vp(o,e);throw Error(`Invalid character class range`)}return zp(Mf(`-`))}function kp({negate:e},t,n){let{tokens:r,walk:i}=t,a=[Bp()],o=r[t.nextIndex],s=sm(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(Bp()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=sm(r[t.nextIndex],o)}let c=Bp({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function Ap({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=om(n);if(Pf.has(r)&&!o?.has(r))e=`posix`,n=r;else return Qp(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?Jp(n,{negate:t}):Hp(e,{negate:t})}function jp(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=$p(e),l=c.type===`AbsenceFunction`,u=rm(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&Nf(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=cm(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(Fp()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(nm(t)||t.type===`CapturingGroup`)throw Error(e)}else if(nm(t)||rm(t)&&t.negate)throw Error(e)}}f=cm(r[t.nextIndex])}return t.nextIndex++,c}function Mp({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!Cp(a))throw Error(`Quantifier requires a repeatable token`);let o=Yp(e,t,n,a);return i.body.pop(),o}function Np({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=Zp(i);return r.push(o),o}function Pp(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:em(t?.body)}}function Fp(e){return{type:`Alternative`,body:tm(e?.body)}}function Ip(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function Lp(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function Rp(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!im(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:em(t?.body)}}function zp(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function Bp(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:tm(e?.body)}}function Vp(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function Hp(e,t){let n=!!t?.negate,r={type:`CharacterSet`,kind:e};return(e===`digit`||e===`hex`||e===`newline`||e===`space`||e===`word`)&&(r.negate=n),(e===`text_segment`||e===`newline`&&!n)&&(r.variableLength=!0),r}function Up(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:If(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function Wp(e){return{type:`Flags`,...e}}function Gp(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:em(e?.body)}}function Kp(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:em(e?.body)}}function qp(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function Jp(e,t){let n=!!t?.negate;if(!Pf.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function Yp(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function Xp(e,t){return{type:`Regex`,body:em(t?.body),flags:e}}function Zp(e){return{type:`Subroutine`,ref:e}}function Qp(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(om(e));if(!r){if(n.normalizeUnknownPropertyNames)r=am(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(Ff`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function $p({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return Pp(`repeater`);case`atomic`:return Gp({atomic:!0});case`capturing`:return Rp(i,{name:n});case`group`:return Gp({flags:e});case`lookahead`:case`lookbehind`:return Kp({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function em(e){if(e===void 0)e=[Fp()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function tm(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function nm(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function rm(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function im(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function am(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function om(e){return e.replace(/[- _]+/g,``).toLowerCase()}function sm(e,t){let n=t;return If(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function cm(e){return If(e,`Unclosed group`)}function lm(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){um(c).splice(Math.max(0,dm(s)+l),1),l--,u=!0},removeAllNextSiblings(){return um(c).splice(dm(s)+1)},removeAllPrevSiblings(){let e=dm(s)+l;return l-=e,um(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,dm(s)+l)]=e:If(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(um(c).splice(Math.max(0,dm(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,dm(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function um(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function dm(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var fm=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function pm(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function mm(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var hm=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function gm(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===hm.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?hm.CHAR_CLASS:hm.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function _m(e,t,n,r){gm(e,t,n,r)}function vm(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===hm.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function ym(e,t,n){return!!vm(e,t,0,n)}function bm(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var xm=new RegExp(String.raw`(?<noncapturingStart>${fm})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function Sm(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(xm.lastIndex=Number.isNaN(c)?0:c+7;f=xm.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),pm(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=gm(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},hm.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var Cm=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,wm=new RegExp(String.raw`
|
|
244
|
+
\\(?: \d+
|
|
245
|
+
| c[A-Za-z]
|
|
246
|
+
| [gk]<[^>]+>
|
|
247
|
+
| [pPu]\{[^\}]+\}
|
|
248
|
+
| u[A-Fa-f\d]{4}
|
|
249
|
+
| x[A-Fa-f\d]{2}
|
|
250
|
+
)
|
|
251
|
+
| \((?: \? (?: [:=!>]
|
|
252
|
+
| <(?:[=!]|[^>]+>)
|
|
253
|
+
| [A-Za-z\-]+:
|
|
254
|
+
| \(DEFINE\)
|
|
255
|
+
))?
|
|
256
|
+
| (?<qBase>${Cm})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
257
|
+
| \\?.
|
|
258
|
+
`.replace(/\s+/g,``),`gsu`);function Tm(e){if(!RegExp(`${Cm}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(wm.lastIndex=0;o=wm.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a){if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=mm(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}wm.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var Em=String.raw,Dm=Em`\(\?R=(?<rDepth>[^\)]+)\)|${Em`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,Om=Em`\(\?<(?![=!])(?<captureName>[^>]+)>`,km=Em`${Om}|(?<unnamed>\()(?!\?)`,Am=new RegExp(Em`${Om}|${Dm}|\(\?|\\?.`,`gsu`),jm=`Cannot use multiple overlapping recursions`;function Mm(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(Dm,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&ym(e,Em`\(\?\(DEFINE\)`,hm.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=ym(e,Em`\\[1-9]`,hm.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(Am.lastIndex=0;f=Am.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else{if(m){if(Nm(m),l)throw Error(jm);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(Am.lastIndex);if(ym(s,Dm,hm.DEFAULT))throw Error(jm);let c=m-1;e=Pm(t,s,c,!1,n,a,d),i=Lm(i,t,c,a.length,0,d);break}if(h){Nm(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(jm);break}if(!u)throw Error(Em`Recursive \g cannot be used outside the referenced group "${r===`external`?h:Em`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=bm(e,p);if(o&&ym(m,Em`${Om}|\((?!\?)`,hm.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=Pm(_,v,b,!0,n,a,d);i=Lm(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,Am.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),Am.lastIndex),s.set(p,Am.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),Am.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function Nm(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function Pm(e,t,n,r,i,a,o){let s=new Set;r&&_m(e+t,Om,({groups:{captureName:e}})=>{s.add(e)},hm.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${Fm(`(?:${e}`,`forward`,...c)}(?:)${Fm(`${t})`,`backward`,...c)}${t}`}function Fm(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=gm(e,Em`${km}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),Im(i,n),s?e:`(?<${t}${l}>`}return Em`\k<${c}${l}>`},hm.DEFAULT)}return c}function Im(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Lm(e,t,n,r,i,a){if(e.size&&r){let o=0;_m(t,km,()=>o++,hm.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var Rm=String.fromCodePoint,$=String.raw,zm={},Bm=globalThis.RegExp;zm.flagGroups=(()=>{try{new Bm(`(?i:)`)}catch{return!1}return!0})(),zm.unicodeSets=(()=>{try{new Bm(`[[]]`,`v`)}catch{return!1}return!0})(),zm.bugFlagVLiteralHyphenIsRange=zm.unicodeSets?(()=>{try{new Bm($`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,zm.bugNestedClassIgnoresNegation=zm.unicodeSets&&new Bm(`[[^a]]`,`v`).test(`a`);function Vm(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Hm(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Um(e,t){return Gm[e]>=Gm[t]}function Wm(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Gm={ES2025:2025,ES2024:2024,ES2018:2018},Km={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function qm(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!Km[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`auto`,verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target===`auto`&&(t.target=zm.flagGroups?`ES2025`:zm.unicodeSets?`ES2024`:`ES2018`),t}var Jm=`[ -\r ]`,Ym=new Set([Rm(304),Rm(305)]),Xm=$`[\p{L}\p{M}\p{N}\p{Pc}]`;function Zm(e){if(Ym.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=th.get(n),a=$m.get(n),o=eh.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var Qm=new Map(`C Other
|
|
259
|
+
Cc Control cntrl
|
|
260
|
+
Cf Format
|
|
261
|
+
Cn Unassigned
|
|
262
|
+
Co Private_Use
|
|
263
|
+
Cs Surrogate
|
|
264
|
+
L Letter
|
|
265
|
+
LC Cased_Letter
|
|
266
|
+
Ll Lowercase_Letter
|
|
267
|
+
Lm Modifier_Letter
|
|
268
|
+
Lo Other_Letter
|
|
269
|
+
Lt Titlecase_Letter
|
|
270
|
+
Lu Uppercase_Letter
|
|
271
|
+
M Mark Combining_Mark
|
|
272
|
+
Mc Spacing_Mark
|
|
273
|
+
Me Enclosing_Mark
|
|
274
|
+
Mn Nonspacing_Mark
|
|
275
|
+
N Number
|
|
276
|
+
Nd Decimal_Number digit
|
|
277
|
+
Nl Letter_Number
|
|
278
|
+
No Other_Number
|
|
279
|
+
P Punctuation punct
|
|
280
|
+
Pc Connector_Punctuation
|
|
281
|
+
Pd Dash_Punctuation
|
|
282
|
+
Pe Close_Punctuation
|
|
283
|
+
Pf Final_Punctuation
|
|
284
|
+
Pi Initial_Punctuation
|
|
285
|
+
Po Other_Punctuation
|
|
286
|
+
Ps Open_Punctuation
|
|
287
|
+
S Symbol
|
|
288
|
+
Sc Currency_Symbol
|
|
289
|
+
Sk Modifier_Symbol
|
|
290
|
+
Sm Math_Symbol
|
|
291
|
+
So Other_Symbol
|
|
292
|
+
Z Separator
|
|
293
|
+
Zl Line_Separator
|
|
294
|
+
Zp Paragraph_Separator
|
|
295
|
+
Zs Space_Separator
|
|
296
|
+
ASCII
|
|
297
|
+
ASCII_Hex_Digit AHex
|
|
298
|
+
Alphabetic Alpha
|
|
299
|
+
Any
|
|
300
|
+
Assigned
|
|
301
|
+
Bidi_Control Bidi_C
|
|
302
|
+
Bidi_Mirrored Bidi_M
|
|
303
|
+
Case_Ignorable CI
|
|
304
|
+
Cased
|
|
305
|
+
Changes_When_Casefolded CWCF
|
|
306
|
+
Changes_When_Casemapped CWCM
|
|
307
|
+
Changes_When_Lowercased CWL
|
|
308
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
309
|
+
Changes_When_Titlecased CWT
|
|
310
|
+
Changes_When_Uppercased CWU
|
|
311
|
+
Dash
|
|
312
|
+
Default_Ignorable_Code_Point DI
|
|
313
|
+
Deprecated Dep
|
|
314
|
+
Diacritic Dia
|
|
315
|
+
Emoji
|
|
316
|
+
Emoji_Component EComp
|
|
317
|
+
Emoji_Modifier EMod
|
|
318
|
+
Emoji_Modifier_Base EBase
|
|
319
|
+
Emoji_Presentation EPres
|
|
320
|
+
Extended_Pictographic ExtPict
|
|
321
|
+
Extender Ext
|
|
322
|
+
Grapheme_Base Gr_Base
|
|
323
|
+
Grapheme_Extend Gr_Ext
|
|
324
|
+
Hex_Digit Hex
|
|
325
|
+
IDS_Binary_Operator IDSB
|
|
326
|
+
IDS_Trinary_Operator IDST
|
|
327
|
+
ID_Continue IDC
|
|
328
|
+
ID_Start IDS
|
|
329
|
+
Ideographic Ideo
|
|
330
|
+
Join_Control Join_C
|
|
331
|
+
Logical_Order_Exception LOE
|
|
332
|
+
Lowercase Lower
|
|
333
|
+
Math
|
|
334
|
+
Noncharacter_Code_Point NChar
|
|
335
|
+
Pattern_Syntax Pat_Syn
|
|
336
|
+
Pattern_White_Space Pat_WS
|
|
337
|
+
Quotation_Mark QMark
|
|
338
|
+
Radical
|
|
339
|
+
Regional_Indicator RI
|
|
340
|
+
Sentence_Terminal STerm
|
|
341
|
+
Soft_Dotted SD
|
|
342
|
+
Terminal_Punctuation Term
|
|
343
|
+
Unified_Ideograph UIdeo
|
|
344
|
+
Uppercase Upper
|
|
345
|
+
Variation_Selector VS
|
|
346
|
+
White_Space space
|
|
347
|
+
XID_Continue XIDC
|
|
348
|
+
XID_Start XIDS`.split(/\s/).map(e=>[om(e),e])),$m=new Map([[`s`,Rm(383)],[Rm(383),`s`]]),eh=new Map([[Rm(223),Rm(7838)],[Rm(107),Rm(8490)],[Rm(229),Rm(8491)],[Rm(969),Rm(8486)]]),th=new Map([ih(453),ih(456),ih(459),ih(498),...ah(8072,8079),...ah(8088,8095),...ah(8104,8111),ih(8124),ih(8140),ih(8188)]),nh=new Map([[`alnum`,$`[\p{Alpha}\p{Nd}]`],[`alpha`,$`\p{Alpha}`],[`ascii`,$`\p{ASCII}`],[`blank`,$`[\p{Zs}\t]`],[`cntrl`,$`\p{Cc}`],[`digit`,$`\p{Nd}`],[`graph`,$`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,$`\p{Lower}`],[`print`,$`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,$`[\p{P}\p{S}]`],[`space`,$`\p{space}`],[`upper`,$`\p{Upper}`],[`word`,$`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,$`\p{AHex}`]]);function rh(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function ih(e){let t=Rm(e);return[t.toLowerCase(),t]}function ah(e,t){return rh(e,t).map(e=>ih(e))}var oh=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function sh(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};dh(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Um(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};lm(e,ch,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return lm(e,lh,a),lm(e,uh,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var ch={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=Gp();e.body[0].body.push(Kp({negate:!0,body:r}),Qp(`Any`));let i=Gp();i.body[0].body.push(Yp(`greedy`,0,1/0,e)),n(Ah(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];Hm(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=vh(t.get(e));if(n){let t=Gp({flags:n});t.body[0].body=e.body,e.body=[Ah(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(Ah(Kp({body:[Fp({body:[Ip(`string_end`)]}),Fp({body:[zp(10)]})]}),t));else if(c===`line_start`)o(Ah(Dh($`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&wh(e))o(Ah(Kp({negate:!0}),t));else if(d)throw Error($`Uses "\G" in a way that requires a subclass`);else o(kh(Ip(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(Ah(Dh($`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${Xm})(?!${Xm})|(?<!${Xm})(?=${Xm}))`,n=`(?:(?<=${Xm})(?=${Xm})|(?<!${Xm})(?!${Xm}))`;o(Ah(Dh(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Eh(n)&&(n=_h(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Eh(r)&&(r=_h(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(Ah(Bp({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(kh(Hp(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(Ah(Oh(Dh(Jm),l),t));return}if(s&&(c===`word`||u===`word`)){n(kh(Hp(`word`,{negate:l}),t));return}if(c===`any`)n(kh(Qp(`Any`),t));else if(c===`digit`)n(kh(Qp(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error($`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=$`\p{RI}{2}|${e}(?:\u200D${e})*`;n(Ah(Dh($`(?>\r\n|${i?$`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(kh(Qp(`AHex`,{negate:l}),t));else if(c===`newline`)n(Ah(Dh(l?`[^
|
|
349
|
+
]`:`(?>\r
|
|
350
|
+
?|[
|
|
351
|
+
\v\f
\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${Rm(e.codePointAt(0)-1)}${Rm(e.codePointAt(2)+1)}-\u{10FFFF}`),n(Ah(Dh(`[${e}]`),t))}else n(Ah(Oh(Dh(nh.get(u)),l),t))}else if(c===`property`)Qm.has(om(u))||(e.key=`sc`);else if(c===`space`)n(kh(Qp(`space`,{negate:l}),t));else if(c===`word`)n(Ah(Oh(Dh(Xm),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=Gp({flags:c});e.body[0].body=o(),i(Ah(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&Sp(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error($`Uses "\K" in a way that's unsupported`);let o=Kp({behind:!0});o.body[0].body=a(),i(Ah(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(Ah(Kp({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=Gp();t.body[0].body.push(e.body),e.body=Ah(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=xh(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error($`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Eh(n)&&(n=_h(n,t),e.ref=n)}},lh={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=kh(hh(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&Hm(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=Hm(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Vm(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?hh(0):mh(o,r.groupOriginByCopy,null),l=c;if(!s){let e=vh(gh(o,e=>e.type===`Group`&&!!e.flags)),t=e?Vm(r.globalFlags,e):r.globalFlags;fh(t,r.currentFlags)||(l=Gp({flags:yh(t)}),l.body[0].body.push(c))}n(Ah(l,t),{traverse:!s})}},uh={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>ph(t,e));i.length?i.length>1?n(Ah(Gp({atomic:!0,body:i.reverse().map(e=>Fp({body:[Lp(e.number)]}))}),t)):e.ref=i[0].number:n(Ah(Kp({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=Rp();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function dh(e){lm(e,{"*"({node:e,parent:t}){e.parent=t}})}function fh(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function ph(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=bh(n.parent);for(let r of t){if(r===n)break;if(r===e||Sh(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function mh(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=mh(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function hh(e){let t=Zp(e);return t.isRecursive=!0,t}function gh(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function _h(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function vh(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function yh({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function bh(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function xh(e){let t=e.find(e=>e.kind===`search_start`||Th(e,{negate:!1})||!Ch(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=xh(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function Sh(e,t){let n=bh(e)??[];for(let e of n)if(e===t||Sh(e,t))return!0;return!1}function Ch({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function wh(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function Th(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Sp(e.body[0],{type:`Assertion`,kind:`search_start`})}function Eh(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Dh(e,t){let n=Tp(e,{...t,unicodePropertyMap:Qm}).body;return n.length>1||n[0].body.length>1?Gp({body:n}):n[0].body[0]}function Oh(e,t){return e.negate=t,e}function kh(e,t){return e.parent=t,e}function Ah(e,t){return dh(e),e.parent=t,e}function jh(e,t){let n=qm(t),r=Um(n.target,`ES2024`),i=Um(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];lm(e,Mh,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,Wm(Nh[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&Hm(f._captureTransfers,e.transferTo,[]).push(t)}),f}var Mh={"*":{enter({node:e},t){if(Gh(e)){let n=t.getCurrentModI();t.pushModI(e.flags?Vm({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Gh(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){zh(Rm(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Bh(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&oh.has(e.value)&&t.setHasCasedChar()}},Nh={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?$`\B`:$`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=Rm(e),r=Vh(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&zh(n)){let e=Zm(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);zm.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(qh)&&(o=[zp(45),...o.filter(e=>!qh(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||zm.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=Gp(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=Fp({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(zm.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=Vh(n,i),o=Vh(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Hh(Bh(e)).forEach(e=>{s.add(Array.isArray(e)?`${Vh(e[0],i)}-${Vh(e[1],i)}`:Vh(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:$`[^\n]`;if(e===`digit`)return t?$`\D`:$`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&oh.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?$`\P`:$`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?$`\W`:$`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=Vm(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${Uh(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+Wh(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:$`\g<${t}&R=${r}>`}},Ph=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),Fh=new Set([`-`,`\\`,`]`,`^`,`[`]),Ih=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),Lh=new Map([[9,$`\t`],[10,$`\n`],[11,$`\v`],[12,$`\f`],[13,$`\r`],[8232,$`\u2028`],[8233,$`\u2029`],[65279,$`\uFEFF`]]),Rh=/^\p{Cased}$/u;function zh(e){return Rh.test(e)}function Bh(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=Rm(e);if(!zh(t))continue;let o=Zm(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function Vh(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(Lh.has(e))return Lh.get(e);if(e<32||e>126&&e<160||e>262143||t&&Kh(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?Ih:Fh:Ph,a=Rm(e);return(i.has(a)?`\\`:``)+a}function Hh(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function Uh(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function Wh({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function Gh({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function Kh(e){return e>47&&e<58}function qh({type:e,value:t}){return e===`Character`&&t===45}var Jh=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=Xh(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(Yh(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=Zh(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function Yh(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function Xh(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)Hm(n,t,{}).transferTo=e;return n}function Zh(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function Qh(e,t){let n=$h(e,t);return n.options?new Jh(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function $h(e,t){let n=qm(t),r=sh(Tp(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Qm}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=jh(r,n),a=Mm(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=Sm(Tm(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function eg(e,t){return Qh(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function tg(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>eg(e,{target:t.target}),{createScanner(e){return new jf(e,t)},createString(e){return{content:e}}}}var ng=`modulepreload`,rg=function(e){return`/`+e},ig={},ag=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),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?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=rg(t,n),t=s(t),t in ig)return;ig[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:ng,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}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)})},og={typescript:()=>ag(()=>import(`./typescript-bsJCZSQ-.js`),[]),json:()=>ag(()=>import(`./json-qhed-kSA.js`),[]),shellscript:()=>ag(()=>import(`./shellscript-CLZ0U2zV.js`),[]),yaml:()=>ag(()=>import(`./yaml-rwi0_p6S.js`),[]),markdown:()=>ag(()=>import(`./markdown-BYOwaDjH.js`),[]),diff:()=>ag(()=>import(`./diff-woXpYk--.js`),[])},sg={ts:`typescript`,typescript:`typescript`,mts:`typescript`,cts:`typescript`,js:`typescript`,javascript:`typescript`,jsx:`typescript`,tsx:`typescript`,mjs:`typescript`,cjs:`typescript`,json:`json`,jsonc:`json`,json5:`json`,sh:`shellscript`,bash:`shellscript`,zsh:`shellscript`,shell:`shellscript`,shellscript:`shellscript`,console:`shellscript`,yml:`yaml`,yaml:`yaml`,md:`markdown`,markdown:`markdown`,diff:`diff`,patch:`diff`},cg={"--shiki-token-comment":`tk-c`,"--shiki-token-keyword":`tk-k`,"--shiki-token-string":`tk-s`,"--shiki-token-string-expression":`tk-s`,"--shiki-token-link":`tk-s`,"--shiki-token-constant":`tk-n`,"--shiki-token-function":`tk-f`,"--shiki-token-parameter":`tk-p`,"--shiki-token-punctuation":`tk-p`},lg=`epoch`,ug=kf({name:lg,fontStyle:!1});function dg(e){if(!e)return;let t=/var\((--[\w-]+)\)/.exec(e)?.[1];return t?cg[t]:void 0}var fg,pg=new Set;function mg(){return fg??=Of({themes:[ug],langs:[],engine:tg({forgiving:!0})}),fg}function hg(e){if(e)return sg[e.trim().toLowerCase()]}async function gg(e,t){let n=og[t];if(n)try{let r=await mg();pg.has(t)||(await r.loadLanguage(await n()),pg.add(t));let{tokens:i}=r.codeToTokens(e,{lang:t,theme:lg});return i.map(e=>e.map(e=>{let t=dg(e.color);return t?{text:e.content,cls:t}:{text:e.content}}))}catch{return}}var _g=/(?:[A-Za-z]:)?[A-Za-z0-9_./\\~@+-]+/g,vg=/^\s{0,3}(?:```|~~~)/,yg=/\.[A-Za-z][A-Za-z0-9]{0,11}$/,bg=512;function xg(e){if(e.length<3||e.length>bg||e.startsWith(`//`))return!1;let t=e.split(/[\\/]/),n=t[t.length-1]??``;if(!yg.test(n))return!1;if(!e.includes(`/`)&&!e.includes(`\\`)){let e=n.lastIndexOf(`.`);if(n.length-e-1<2)return!1}return!0}function Sg(e){let t=[],n=!1;for(let r of e.split(`
|
|
352
|
+
`)){if(vg.test(r)){n=!n,t.push(``);continue}t.push(n?``:r)}return t.join(`
|
|
353
|
+
`)}function Cg(e){let t=e.length;for(;t>0&&`.-~@+/\\`.includes(e[t-1]??``);)--t;let n=0;for(;n<t&&`-+@`.includes(e[n]??``);)n+=1;return e.slice(n,t)}function wg(e,t=32){let n=new Set,r=[];for(let i of Sg(e).matchAll(_g)){let e=Cg(i[0]);if(!(!xg(e)||n.has(e))&&(n.add(e),r.push(e),r.length>=t))break}return r}wa.addHook(`afterSanitizeAttributes`,e=>{if(!(`setAttribute`in e)||e.nodeName!==`A`)return;let t=e;t.getAttribute(`href`)&&(t.setAttribute(`target`,`_blank`),t.setAttribute(`rel`,`noopener noreferrer`))});function Tg(e){return wa.sanitize(e,{USE_PROFILES:{html:!0,mathMl:!0},FORBID_TAGS:[`style`],FORBID_CONTENTS:[`style`,`script`]})}var Eg=(()=>{try{let e=Tg(`<script>__probe__<\/script><p>ok</p>`);return!e.includes(`script`)&&!e.includes(`__probe__`)&&e.includes(`<p>ok</p>`)}catch{return!1}})();Eg||console.error(`[epoch] DOMPurify 在这个环境里不可信,模型正文退回纯文本渲染`);function Dg(e){let t=U.lexer(e),n=[],r=[],i=()=>{if(r.length===0)return;let e=Object.assign(r,{links:t.links});n.push({kind:`html`,html:Tg(U.parser(e))}),r=[]};for(let e of t){if(e.type!==`code`){r.push(e);continue}i();let[t,...a]=String(e.lang??``).trim().split(/\s+/),o=a.join(` `);n.push({kind:`code`,...t?{lang:t}:{},...o?{caption:o}:{},code:String(e.text??``)})}return i(),n}var Og=1500;function kg({text:e}){let t=F(),[n,r]=v.useState(!1);v.useEffect(()=>{if(!n)return;let e=setTimeout(()=>r(!1),Og);return()=>clearTimeout(e)},[n]);let i=t(n?`web.ui.thread.copied`:`web.ui.thread.copy_code`);return(0,P.jsx)(`button`,{className:`code__copy`,type:`button`,"aria-label":i,title:i,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>r(!0))},children:(0,P.jsx)(I,{name:n?`check`:`copy`,size:`sm`})})}function Ag({lang:e,caption:t,code:n}){let r=F(),i=hg(e),[a,o]=v.useState();return v.useEffect(()=>{if(o(void 0),!i)return;let e=!0;return gg(n,i).then(t=>{e&&t&&o(t)}),()=>{e=!1}},[n,i]),(0,P.jsxs)(`figure`,{className:`code`,children:[(0,P.jsxs)(`figcaption`,{className:`code__head`,children:[(0,P.jsx)(`span`,{className:`code__lang`,children:e||r(`web.ui.thread.code`)}),t&&(0,P.jsx)(`span`,{children:t}),(0,P.jsx)(kg,{text:n})]}),(0,P.jsx)(`pre`,{children:(0,P.jsx)(`code`,{children:a?a.map((e,t)=>(0,P.jsxs)(v.Fragment,{children:[e.map((e,t)=>e.cls?(0,P.jsx)(`span`,{className:e.cls,children:e.text},t):(0,P.jsx)(v.Fragment,{children:e.text},t)),t<a.length-1&&`
|
|
354
|
+
`]},t)):n})})]})}function jg({text:e,caret:t}){let n=v.useMemo(()=>Eg?Dg(e):[],[e]),r=v.useRef(null),i=ds(v.useMemo(()=>Eg&&!t?wg(e):[],[e,t])),a=ls();return v.useEffect(()=>{let e=r.current;if(!(!e||!a||i.size===0))return gs(e,i,a.open)},[n,i,a]),Eg?(0,P.jsx)(`div`,{className:`prose`,ref:r,...t?{"data-live":``}:{},children:n.map((e,t)=>e.kind===`code`?(0,P.jsx)(Ag,{code:e.code,...e.lang?{lang:e.lang}:{},...e.caption?{caption:e.caption}:{}},t):(0,P.jsx)(`div`,{className:`prose__chunk`,dangerouslySetInnerHTML:{__html:e.html}},t))}):(0,P.jsx)(`div`,{className:`prose`,...t?{"data-live":``}:{},children:(0,P.jsx)(`p`,{className:`think__text`,children:e})})}var Mg=v.memo(jg),Ng=.02,Pg=.05,Fg=.25,Ig=.9,Lg=2e3,Rg=262144,zg={binary:{label:`web.ui.art.kind_binary`,why:`web.ui.art.opaque_binary`},undecodable:{label:`web.ui.art.kind_charset`,why:`web.ui.art.opaque_charset`}};function Bg(e){let t=0,n=0,r=0,i=0;for(let a=0;a<e.length;a+=1){let o=e.charCodeAt(a);o===0?(t+=1,a%2==1&&(i+=1)):o===65533?r+=1:(o<32&&o!==9&&o!==10&&o!==13||o===127)&&(n+=1)}let a=(e,i)=>({kind:e,evidence:i,lost:r,nul:t,ctrl:n});if(e.length===0)return a(`text`,`none`);if(t>0){let n=Math.max(i,t-i)/t;return t/e.length>=Fg&&n>=Ig?a(`undecodable`,`utf16`):a(`binary`,`nul`)}return n/e.length>=Ng?a(`binary`,`control`):r/e.length>=Pg?a(`undecodable`,`replacement`):a(`text`,r>0?`replacement`:`none`)}function Vg(e){let t=Gr(e),n=t>Lg,r=e.length>Rg;if(!n&&!r)return{text:e,clipped:!1,shownLines:t,totalLines:t};let i=n?Hg(e,Lg):e.length;if(i>262144){let n=e.slice(0,Rg);return{text:n,clipped:!0,shownLines:Gr(n),totalLines:t,by:`chars`}}return{text:e.slice(0,i),clipped:!0,shownLines:Lg,totalLines:t,by:`lines`}}function Hg(e,t){let n=0;for(let r=0;r<t;r+=1){let t=e.indexOf(`
|
|
355
|
+
`,n);if(t===-1)return e.length;n=t+1}return n}var Ug={add:`+`,remove:`-`,context:` `},Wg={add:`dl--add`,remove:`dl--del`,context:`dl--ctx`},Gg={old:`web.ui.thread.patch_opaque_old`,new:`web.ui.thread.patch_opaque_new`,both:`web.ui.thread.patch_opaque_both`};function Kg(e){let t=0,n=0;return e.map(e=>e===null?{line:e}:(e.kind!==`add`&&(t+=1),e.kind!==`remove`&&(n+=1),{line:e,...e.kind===`add`?{}:{oldNo:t},...e.kind===`remove`?{}:{newNo:n}}))}function qg(e,t){let n=e===void 0?void 0:Bg(e),r=t===void 0?void 0:Bg(t),i=n&&n.kind!==`text`?n.kind:void 0,a=r&&r.kind!==`text`?r.kind:void 0;if(!(!i&&!a))return{kind:i===`binary`||a===`binary`?`binary`:`undecodable`,side:i&&a?`both`:i?`old`:`new`}}function Jg(e,t){let n=qg(e,t);if(n)return{opaque:n};let r=Yn(e,t),i=t??e;return{diff:r,lines:Kg(Xn(r.lines)),lost:i===void 0?0:Bg(i).lost}}function Yg(e,t){return`${t(Gg[e.side])} ${t(zg[e.kind].why)}`}function Xg({filePath:e,oldContent:t,newContent:n,notice:r}){let i=F(),a=v.useMemo(()=>r?{notice:r}:Jg(t,n),[r,t,n]);return(0,P.jsxs)(`figure`,{className:`diff`,"aria-label":i(`web.ui.thread.patch_of`,{path:e}),children:[(0,P.jsxs)(`figcaption`,{className:`diff__head`,children:[(0,P.jsx)(`span`,{className:`diff__path`,children:e}),`notice`in a?(0,P.jsx)(`span`,{className:`diff__stat diff__stat--opaque`,children:a.notice.label}):`opaque`in a?(0,P.jsx)(`span`,{className:`diff__stat diff__stat--opaque`,children:i(zg[a.opaque.kind].label)}):(0,P.jsxs)(`span`,{className:`diff__stat`,children:[(0,P.jsxs)(`b`,{children:[`+`,a.diff.added]}),` `,(0,P.jsxs)(`i`,{children:[`−`,a.diff.removed]})]})]}),`notice`in a?(0,P.jsx)(L,{className:`diff__note`,text:a.notice.why}):`opaque`in a?(0,P.jsx)(L,{className:`diff__note`,text:Yg(a.opaque,i)}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Zg,{diff:a.diff,lines:a.lines}),a.lost>0&&(0,P.jsx)(L,{className:`diff__note`,text:i(`web.ui.art.lossy`,{count:a.lost})})]})]})}function Zg({diff:e,lines:t}){let n=F();return e.truncated?(0,P.jsx)(`div`,{className:`diff__body`,children:(0,P.jsxs)(`div`,{className:`dl dl--gap`,children:[(0,P.jsx)(`span`,{className:`dl__n`}),(0,P.jsx)(`span`,{className:`dl__n`}),(0,P.jsx)(`span`,{className:`dl__t`,children:n(`web.ui.thread.patch_too_big`)})]})}):(0,P.jsx)(`div`,{className:`diff__body`,children:t.map(({line:e,oldNo:t,newNo:n},r)=>e===null?(0,P.jsxs)(`div`,{className:`dl dl--gap`,children:[(0,P.jsx)(`span`,{className:`dl__n`}),(0,P.jsx)(`span`,{className:`dl__n`}),(0,P.jsx)(`span`,{className:`dl__t`,children:`⋯`})]},`gap-${r}`):(0,P.jsxs)(`div`,{className:`dl ${Wg[e.kind]}`,children:[(0,P.jsx)(`span`,{className:`dl__n`,children:t??``}),(0,P.jsx)(`span`,{className:`dl__n`,children:n??``}),(0,P.jsxs)(`span`,{className:`dl__t`,children:[Ug[e.kind],e.text]})]},`line-${r}`))})}function Qg(e){if(e.type===`user`)return oe(e.text)}var $g=1600;function e_(e){return e.toLocaleString(`en-US`)}function t_(e){if(e<1e3)return String(e);let t=Math.round(e/100)/10;return t<1e3?`${t}k`:`${Math.round(e/1e5)/10}M`}function n_(e){let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return r===0?`${n}m`:`${n}m ${r}s`}function r_(e){return`${e.split(`
|
|
356
|
+
`).map(e=>`> ${e}`).join(`
|
|
357
|
+
`)}\n\n`}function i_({text:e}){let t=F(),[n,r]=v.useState(!1);v.useEffect(()=>{if(!n)return;let e=setTimeout(()=>r(!1),$g);return()=>clearTimeout(e)},[n]);let i=t(n?`web.ui.thread.copied`:`web.ui.thread.act_copy`);return(0,P.jsx)(`button`,{className:`btn btn--ghost btn--icon`,type:`button`,"aria-label":i,title:i,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>r(!0))},children:(0,P.jsx)(I,{name:n?`check`:`copy`,size:`sm`})})}function a_({footer:e,configModel:t,onRerun:n,onQuote:r,onInspect:i,rewind:a}){let o=F(),{facts:s,userText:c,answer:l}=e,[u,d]=v.useState(!1),f=[];return s&&(f.push(s.usage?(0,P.jsx)(`b`,{title:e_(E(s.usage)),children:o(`web.ui.thread.facts_tokens`,{tokens:t_(E(s.usage))})},`tok`):(0,P.jsxs)(v.Fragment,{children:[o(`web.ui.thread.facts_token_label`),` `,(0,P.jsx)(`span`,{className:`unknown`,children:o(`web.ui.thread.facts_unknown`)})]},`tok`)),s.model&&f.push((0,P.jsxs)(v.Fragment,{children:[(0,P.jsx)(`code`,{children:s.model}),t!==void 0&&t!==s.model&&(0,P.jsxs)(P.Fragment,{children:[` `,(0,P.jsx)(`span`,{className:`est est--warn`,children:o(`web.ui.thread.facts_failover`)})]})]},`model`)),f.push((0,P.jsx)(v.Fragment,{children:s.toolCalls>0?o(`web.ui.thread.facts_tools`,{count:s.toolCalls}):o(`web.ui.thread.facts_no_tools`)},`tools`)),s.durationMs!==void 0&&f.push((0,P.jsx)(v.Fragment,{children:n_(s.durationMs)},`dur`))),(0,P.jsxs)(`li`,{className:`turnfoot`,children:[(0,P.jsxs)(`div`,{className:`turnfoot__acts`,children:[l!==``&&(0,P.jsx)(i_,{text:l}),c!==void 0&&n&&(0,P.jsx)(`button`,{className:`btn btn--ghost btn--icon`,type:`button`,"aria-label":o(`web.ui.thread.act_rerun`),title:o(`web.ui.thread.act_rerun`),onClick:()=>n(c),children:(0,P.jsx)(I,{name:`rotate-ccw`,size:`sm`})}),l!==``&&r&&(0,P.jsx)(`button`,{className:`btn btn--ghost btn--icon`,type:`button`,"aria-label":o(`web.ui.thread.act_quote`),title:o(`web.ui.thread.act_quote`),onClick:()=>r(r_(l)),children:(0,P.jsx)(I,{name:`text-quote`,size:`sm`})}),e.hasPatch&&i&&(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:i,children:o(`web.ui.thread.act_inspect`)}),a&&(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,"aria-expanded":u,onClick:()=>d(e=>!e),children:o(`web.ui.thread.act_rewind`)})]}),a&&u&&(0,P.jsx)(Sr,{client:a.client,sessionId:a.sessionId,turnIndex:a.turnIndex,onClose:()=>d(!1),onDone:a.onDone}),f.length>0&&(0,P.jsx)(`p`,{className:`turnfoot__facts`,children:f.map((e,t)=>(0,P.jsxs)(v.Fragment,{children:[t>0&&` · `,e]},t))})]})}function o_(e){return e.data!==void 0||e.estimatedTokens!==void 0?`in`:e.kind!==`image`||e.width!==void 0&&e.height!==void 0?`out`:`unknown`}function s_(e,t){return t(e===`in`?`web.ui.thread.art_in`:e===`out`?`web.ui.thread.art_out`:`web.ui.thread.art_unknown`)}function c_(e,t){if(e===`out`)return t(`web.ui.thread.art_out_note`);if(e===`unknown`)return t(`web.ui.thread.art_unknown_note`)}function l_({artifact:e,src:t,name:n,t:r}){return e.kind===`image`?(0,P.jsx)(`img`,{src:t,alt:e.summary,loading:`lazy`}):e.kind===`audio`?(0,P.jsx)(`audio`,{className:`tool__art-audio`,src:t,controls:!0,preload:`none`}):(0,P.jsxs)(`a`,{className:`tool__art-dl`,href:t,...n?{download:n}:{},target:`_blank`,rel:`noreferrer`,children:[(0,P.jsx)(`span`,{className:`tool__art-dl-name`,children:n?r(`web.ui.thread.art_download`,{name:n}):r(`web.ui.thread.art_download_any`)}),(0,P.jsx)(`span`,{className:`tool__art-dl-type`,children:e.mediaType})]})}function u_({artifact:e,src:t}){let n=F(),r=o_(e),i=c_(r,n),a=e.path?Oe(e.path):void 0;return(0,P.jsxs)(`figure`,{className:`tool__art`,"data-kind":e.kind,"data-admission":r,children:[t?(0,P.jsx)(l_,{artifact:e,src:t,name:a,t:n}):null,(0,P.jsxs)(`figcaption`,{className:`tool__art-cap`,children:[(0,P.jsxs)(`p`,{className:`tool__art-fact`,children:[(0,P.jsx)(`span`,{className:`tool__art-badge`,children:s_(r,n)}),e.estimatedTokens!==void 0&&(0,P.jsx)(`span`,{className:`tool__art-tokens`,title:e_(e.estimatedTokens),children:n(`web.ui.thread.art_tokens`,{count:t_(e.estimatedTokens)})})]}),i!==void 0&&(0,P.jsx)(`p`,{className:`tool__art-note`,children:i}),!t&&(0,P.jsx)(`p`,{className:`tool__art-note`,children:n(`web.ui.thread.art_no_file`)}),(0,P.jsx)(`p`,{className:`tool__art-sum`,children:e.summary})]})]})}var d_=160,f_=8;function p_(e,t){return t(e===`pending`?`web.ui.thread.tool_pending`:e===`error`?`web.ui.thread.tool_error`:`web.ui.thread.tool_done`)}var m_=[`command`,`path`,`filePath`,`file_path`,`url`,`pattern`,`query`,`target`,`paths`,`name`];function h_(e){return typeof e==`string`?e:e==null?String(e):typeof e==`object`?JSON.stringify(e):String(e)}function g_(e){return e.replace(/\s+/g,` `).trim()}var __=[`path`,`filePath`,`file_path`];function v_(e){if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e,n=[];for(let e of __){let r=t[e];typeof r==`string`&&r.trim()!==``&&n.push(r)}return n}function y_(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e,n=e=>{if(e!=null&&typeof e!=`object`)return g_(h_(e))||void 0};for(let e of m_){let r=n(t[e]);if(r)return{text:r,isPath:__.includes(e)}}for(let e of Object.values(t)){let t=n(e);if(t)return{text:t,isPath:!1}}}function b_({request:e,clickable:t}){if(!e||typeof e!=`object`||Array.isArray(e))return null;let n=Object.entries(e);return n.length===0?null:(0,P.jsx)(`dl`,{className:`tool__args`,children:n.map(([e,n])=>{let r=h_(n),i=r.length>d_,a=!i&&__.includes(e)&&t.has(r);return(0,P.jsxs)(v.Fragment,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:i?(0,P.jsxs)(`details`,{children:[(0,P.jsxs)(`summary`,{children:[r.slice(0,d_),`…`]}),(0,P.jsx)(`pre`,{children:r})]}):a?(0,P.jsx)(ps,{path:r}):r})]},e)})})}function x_({text:e}){let t=F(),[n,r]=v.useState(!1),i=e.split(`
|
|
358
|
+
`),a=i.length-f_,o=n||a<=0?e:i.slice(0,f_).join(`
|
|
359
|
+
`);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`pre`,{className:`tool__out`,children:o}),a>0&&(0,P.jsx)(`button`,{type:`button`,className:`tool__more`,onClick:()=>r(!n),children:n?t(`web.ui.thread.collapse`):t(`web.ui.thread.expand`,{count:a})})]})}function S_({text:e}){return(0,P.jsx)(`pre`,{className:`tool__out`,"data-live":``,children:e})}function C_({tool:e,resolveArtifact:t}){let n=F(),r=y_(e.request),i=e.status===`pending`&&e.liveOutput?e.liveOutput:void 0,a=!!e.request||!!e.artifacts?.length||i||e.result,o=ds(v.useMemo(()=>v_(e.request),[e.request]));return(0,P.jsxs)(`article`,{className:`tool`,"data-status":e.status,children:[(0,P.jsxs)(`header`,{className:`tool__head`,children:[(0,P.jsx)(`span`,{className:`tool__name`,children:e.toolName}),r&&(0,P.jsx)(`span`,{className:`tool__sig`,children:r.isPath&&o.has(r.text)?(0,P.jsx)(ps,{path:r.text}):r.text}),(0,P.jsx)(`span`,{className:`tool__stat`,children:p_(e.status,n)})]}),a&&(0,P.jsxs)(`div`,{className:`tool__body`,children:[(0,P.jsx)(b_,{request:e.request,clickable:o}),e.artifacts?.map((e,n)=>(0,P.jsx)(u_,{artifact:e,src:t?.(e)},`art-${n}`)),i&&(0,P.jsx)(S_,{text:i}),e.result?(0,P.jsx)(x_,{text:e.result}):null]})]})}function w_({images:e,resolveImage:t}){let n=F();return!e||e.length===0?null:(0,P.jsx)(`div`,{className:`userimgs`,children:e.map((e,r)=>{let i=t?.(e.image),a=e.mediaType?n(`web.ui.thread.user_image_alt`,{mediaType:e.mediaType}):n(`web.ui.thread.user_image_alt_any`);return(0,P.jsx)(`figure`,{className:`userimgs__item`,children:i===void 0?(0,P.jsx)(`figcaption`,{className:`userimgs__fallback`,children:a}):(0,P.jsx)(`img`,{className:`userimgs__img`,src:i,alt:a,loading:`lazy`})},r)})})}function T_({text:e}){let t=F();return(0,P.jsxs)(`blockquote`,{className:`think`,children:[(0,P.jsx)(`p`,{className:`think__label`,children:t(`web.ui.thread.thinking_label`)}),(0,P.jsx)(`p`,{className:`think__text`,children:e})]})}function E_({icon:e,text:t,tone:n}){return(0,P.jsxs)(`p`,{className:`note`,...n?{"data-tone":n}:{},children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:e,size:`sm`})}),(0,P.jsx)(`span`,{children:t})]})}function D_(e,t){switch(e.type){case`error`:return{icon:`circle-x`,text:e.text||t(`web.ui.thread.note_error`),tone:`error`};case`warning`:return{icon:`triangle-alert`,text:e.text};case`info`:case`hint`:return{icon:`info`,text:e.text};case`model`:return{icon:`info`,text:t(`web.ui.thread.note_model`,{model:e.model})};case`compression`:return{icon:`layers`,text:t(`web.ui.thread.note_compression`,{count:e.compressedCount})};case`session_summary`:return{icon:`info`,text:t(`web.ui.thread.note_summary`,{duration:e.duration})}}}function O_({row:e,resolveArtifact:t,resolveImage:n}){let r=F(),{body:i}=e;switch(i.type){case`tools`:return(0,P.jsx)(`div`,{className:`tools`,children:i.tools.map((e,n)=>(0,P.jsx)(C_,{tool:e,...t?{resolveArtifact:t}:{}},e.callId||n))});case`todos`:return(0,P.jsx)(ri,{todos:i.todos});case`think`:return(0,P.jsx)(T_,{text:i.text});case`gate`:return(0,P.jsx)(E_,{icon:`flag`,text:r(`web.ui.thread.gate`,{tool:i.toolName})});case`item`:{let{item:t}=i;switch(t.type){case`user`:{let e=Qg(t);return e===void 0?(0,P.jsxs)(`div`,{className:`said`,children:[(0,P.jsx)(w_,{images:t.images,...n?{resolveImage:n}:{}}),(0,P.jsx)(Qr,{files:t.files}),(0,P.jsx)(ni,{references:t.references}),t.text]}):(0,P.jsx)(E_,{icon:`user-round`,text:e})}case`assistant`:return(0,P.jsx)(Mg,{text:t.text,...e.live?{caret:!0}:{}});case`thinking`:return(0,P.jsx)(T_,{text:t.thought});case`diff`:return(0,P.jsx)(Xg,{filePath:t.filePath,...t.oldContent===void 0?{}:{oldContent:t.oldContent},...t.newContent===void 0?{}:{newContent:t.newContent}});case`tool_group`:case`tool_display_group`:return null;case`error`:case`warning`:case`info`:case`hint`:case`model`:case`compression`:case`session_summary`:{let e=D_(t,r);return(0,P.jsx)(E_,{icon:e.icon,text:e.text,...e.tone?{tone:e.tone}:{}})}}}}}function k_(e){return e.some(e=>e.status===`error`)?`error`:e.some(e=>e.status===`pending`)?`pending`:`done`}var A_=new Set([`pending`,`in_progress`,`completed`,`cancelled`]);function j_(e){if(!e||typeof e!=`object`)return;let t=e.todos;if(!Array.isArray(t))return;let n=[];for(let e of t){if(!e||typeof e!=`object`)continue;let{content:t,status:r,reason:i}=e;if(typeof t!=`string`||t===``)continue;let a=typeof r==`string`&&A_.has(r)?r:`pending`,o=a===`cancelled`&&typeof i==`string`?i.trim():``;n.push({content:t,status:a,...o?{reason:o}:{}})}return n.length>0?n:void 0}function M_(e,t,n){let r=[],i=[],a=()=>{i.length!==0&&(r.push({key:`${t}-t${r.length}`,kind:`tool`,status:k_(i),...e.seq===void 0?{}:{seq:e.seq},...n===void 0?{}:{id:n},body:{type:`tools`,tools:i}}),i=[])};for(let o of e.tools){let s=o.toolName===`todo`?j_(o.request):void 0;if(!s||o.status===`error`){i.push(o);continue}a(),r.push({key:`${t}-todo-${o.callId}`,kind:`todo`,status:o.status===`pending`?`pending`:`done`,...e.seq===void 0?{}:{seq:e.seq},...n===void 0?{}:{id:n},body:{type:`todos`,todos:s}})}return a(),r}function N_(e){switch(e.type){case`user`:return Qg(e)===void 0?`user`:`note`;case`assistant`:return`assistant`;case`thinking`:return`thinking`;case`diff`:return`diff`;default:return`note`}}function P_(e,t,n){return{key:t,kind:N_(e),...e.type===`error`?{status:`error`}:{},...e.seq===void 0?{}:{seq:e.seq},...n===void 0?{}:{id:n},body:{type:`item`,item:e}}}function F_(e){let t=[],n=(e,n,r)=>{if(e.type===`tool_group`||e.type===`tool_display_group`){t.push(...M_(e,n,r));return}t.push(P_(e,n,r))};for(let t of e.history)n(t,`h${t.id}`,t.id);let r=e.thoughtParts??[],i=0,a=e=>{for(;i<r.length&&r[i].at<=e;){let e=r[i];t.push({key:`thought-${i}`,kind:`thinking`,body:{type:`think`,text:e.text}}),i+=1}};r.length===0&&e.thought&&t.push({key:`thought`,kind:`thinking`,body:{type:`think`,text:e.thought}}),e.pending.forEach((e,t)=>{a(t),n(e,`p${t}`)}),a(1/0);let o=t.reduce((e,t,n)=>t.kind===`todo`?n:e,-1),s=t.filter((e,t)=>e.kind!==`todo`||t===o);for(let t of e.approvals)s.push({key:`gate-${t.requestId}`,kind:`gate`,body:{type:`gate`,toolName:t.request.toolName}});let c=s[s.length-1];return e.running&&c&&(s[s.length-1]={...c,live:!0}),s}function I_(e,t){for(let t of e)if((t.type===`tool_group`||t.type===`tool_display_group`)&&t.tools.some(e=>e.status===`pending`))return`tool`;return e[e.length-1]?.type===`assistant`?`streaming`:e.length===0&&t!==``?`thinking`:`waiting`}function L_(e){let t=[];for(let[n,r]of e.entries())r.kind===`user`&&t.push(n);return t}function R_(e,t){let n=L_(e),r=[];for(let[i,a]of n.entries()){let o=i===n.length-1;if(o&&t)continue;let s=o?e.length-1:(n[i+1]??e.length)-1;e.slice(a,s+1).some(e=>e.kind===`gate`)||r.push({start:a,end:s})}return r}function z_(e){let t,n;for(let r of e)r.seq!==void 0&&(t=t===void 0?r.seq:Math.min(t,r.seq),n=n===void 0?r.seq:Math.max(n,r.seq));return t===void 0||n===void 0?void 0:{min:t,max:n}}function B_(e,t){for(let n of e){if(n.id===void 0)continue;let e=t.get(n.id);if(e)return e}}function V_(e,t,n){let r=L_(e),i=[],a=new Map;for(let e of t)e.itemId!==void 0&&a.set(e.itemId,e);for(let{start:o,end:s}of R_(e,n)){let n=e.slice(o,s+1),c=r.find(e=>e>o),l=z_(n),u=c===void 0?void 0:z_(e.slice(c)),d=(l?t.find(e=>e.itemId===void 0&&e.seq>l.max&&(u===void 0||e.seq<u.min)):void 0)??B_(n,a),f,p=[],m=!1;for(let e of n){if(e.kind===`diff`&&(m=!0),e.body.type!==`item`)continue;let{item:t}=e.body;t.type===`user`&&f===void 0&&(f=t.text),t.type===`assistant`&&t.text&&p.push(t.text)}i.push({key:`foot-${e[o]?.key??o}`,after:s,...d?{facts:d}:{},...f===void 0?{}:{userText:f},answer:p.join(`
|
|
360
|
+
|
|
361
|
+
`),hasPatch:m})}return i}var H_=new Set([`thinking`,`tool`,`diff`]),U_=2;function W_(e,t){let n=[];for(let{start:r,end:i}of R_(e,t)){let t,a=r=>{if(t===void 0)return;let i=t;if(t=void 0,r-i<U_)return;let a=0,o=0,s=new Set;for(let t of e.slice(i,r))t.kind===`thinking`&&(o+=1),t.body.type===`tools`&&(a+=t.body.tools.length),t.body.type===`item`&&t.body.item.type===`diff`&&s.add(t.body.item.filePath);n.push({key:`fold-${e[i]?.key??i}`,start:i,end:r-1,toolCalls:a,files:s.size,thoughts:o})};for(let n=r;n<=i;n+=1){let r=e[n];if(r&&H_.has(r.kind)){t??=n;continue}a(n)}a(i+1)}return n}var G_=new Set([`user`,`note`,`gate`]);function K_(e,t){let n=new Map;if(t.length===0)return n;let r=L_(e);for(let[i,a]of r.entries()){let o=i===r.length-1?e.length-1:(r[i+1]??e.length)-1,s;for(let t=a;t<=o;t+=1){let n=e[t];if(n&&!G_.has(n.kind)){s=t;break}}if(s===void 0)continue;let c=z_(e.slice(s,o+1));if(!c)continue;let l=z_(e.slice(0,a)),u=t.find(e=>e.seq<c.min&&(l===void 0||e.seq>l.max));u&&n.set(s,u)}return n}var q_={builtin:`web.ui.cap.g_builtin`,plugin:`web.ui.cap.g_plugin`,host:`web.ui.cap.g_host`,user:`web.ui.cap.g_user`,project:`web.ui.cap.g_project`};function J_(e){return e<1e3?`~${e}`:`~${Math.round(e/1e3)}k`}function Y_(e){return e.slice(0,2)}function X_(e,t){if(t!==void 0&&le(e,t.contextLength,t.threshold))return t.auto?{key:`web.ui.thread.head_ctx_line`,className:`ctxline`}:{key:`web.ui.thread.head_ctx_off`,className:`ctxline ctxline--off`}}function Z_({head:e,compression:t}){let n=F(),{role:r}=e,i=X_(e.estimatedTokens,t);return(0,P.jsxs)(`div`,{className:`mhead`,children:[r&&(0,P.jsx)(`span`,{className:`mhead__ava`,"aria-hidden":`true`,children:Y_(r.name)}),(0,P.jsxs)(`span`,{className:`mhead__lines`,children:[r&&(0,P.jsxs)(`span`,{className:`mhead__name`,children:[r.name,r.source&&(0,P.jsx)(`span`,{className:`src-chip`,children:n(q_[r.source])})]}),(0,P.jsxs)(`span`,{className:`mhead__sub`,children:[(0,P.jsx)(`b`,{children:n(`web.ui.thread.head_estimate`,{tokens:J_(e.estimatedTokens)})}),` `,(0,P.jsx)(`span`,{className:`est`,children:n(`web.ui.thread.head_est_badge`)}),i&&(0,P.jsxs)(P.Fragment,{children:[` `,(0,P.jsx)(`span`,{className:i.className,children:n(i.key)})]})]})]})]})}function Q_(e){return`ev-${e}`}function $_({row:e,head:t,compression:n,resolveArtifact:r,resolveImage:i}){return(0,P.jsxs)(`li`,{className:`ev`,"data-kind":e.kind,...e.status?{"data-status":e.status}:{},...e.live?{"data-live":``}:{},...e.seq===void 0?{}:{"data-seq":e.seq,id:Q_(e.seq)},children:[(0,P.jsx)(`div`,{className:`ev__gutter`,children:(0,P.jsx)(`span`,{className:`ev__node`,"aria-hidden":`true`})}),(0,P.jsxs)(`div`,{className:`ev__body`,children:[t&&(0,P.jsx)(Z_,{head:t,...n?{compression:n}:{}}),(0,P.jsx)(O_,{row:e,...r?{resolveArtifact:r}:{},...i?{resolveImage:i}:{}})]})]})}function ev({fold:e,expanded:t,onToggle:n}){let r=F(),i=[];return e.toolCalls>0&&i.push(r(`web.ui.thread.fold_tools`,{count:e.toolCalls})),e.files>0&&i.push(r(`web.ui.thread.fold_files`,{count:e.files})),e.thoughts>0&&i.push(r(`web.ui.thread.fold_thoughts`,{count:e.thoughts})),(0,P.jsx)(`li`,{className:`fold`,children:(0,P.jsxs)(`button`,{className:`fold__bar`,type:`button`,"aria-expanded":t,title:r(t?`web.ui.thread.fold_hide`:`web.ui.thread.fold_show`),onClick:n,children:[(0,P.jsx)(I,{name:t?`chevron-down`:`chevron-right`,size:`sm`}),(0,P.jsx)(`span`,{className:`fold__what`,children:i.join(` · `)})]})})}function tv({turn:e,phase:t,runUsage:n,queued:r,aborting:i,onAbort:a}){let o=F();if(e===`idle`)return null;let s=o(i?`web.ui.thread.live_aborting`:e===`awaiting-approval`?`web.ui.thread.live_approval`:e===`awaiting-question`?`web.ui.thread.live_question`:t===`thinking`?`web.ui.thread.live_thinking`:t===`tool`?`web.ui.thread.live_tool`:t===`waiting`?`web.ui.thread.live_waiting`:`web.ui.thread.live_running`);return(0,P.jsxs)(`li`,{className:`livestat`,"aria-live":`polite`,children:[(0,P.jsx)(`span`,{className:`livestat__dot`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{children:s}),n&&(0,P.jsx)(`b`,{title:e_(E(n)),children:o(`web.ui.thread.live_spent`,{tokens:t_(E(n))})}),r>0&&(0,P.jsx)(`span`,{className:`livestat__queued`,children:o(`web.ui.thread.queued`,{count:r})}),e===`running`&&(0,P.jsx)(`button`,{type:`button`,className:`btn btn--icon btn--danger livestat__stop`,onClick:a,disabled:i,"aria-label":o(`web.ui.thread.stop`),title:o(`web.ui.thread.stop`),children:(0,P.jsx)(I,{name:`square`})})]})}function nv({history:e,pending:t,thought:n,thoughtParts:r,approvals:i,turn:a,turns:o,heads:s,compression:c,runUsage:l,queued:u=0,aborting:d=!1,onAbort:f,resolveArtifact:p,resolveImage:m,configModel:h,onRerun:g,onQuote:_,onInspect:y,rewind:b}){let x=v.useMemo(()=>F_({history:e,pending:t,thought:n,...r?{thoughtParts:r}:{},approvals:i,running:a===`running`}),[e,t,n,r,i,a]),S=v.useMemo(()=>V_(x,o??[],a!==`idle`),[x,o,a]),C=v.useMemo(()=>{let e=new Map;for(let t of S)e.set(t.after,t);return e},[S]),w=v.useMemo(()=>b?gr(S.map(e=>({key:e.key,...e.userText===void 0?{}:{userText:e.userText}})),b.checkpoints):new Map,[S,b]),ee=Or(b?.sessionId),te=v.useMemo(()=>{let e=new Map;for(let t of W_(x,a!==`idle`))e.set(t.start,t);return e},[x,a]),[ne,T]=v.useState(()=>new Set),re=v.useCallback(e=>{T(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),ie=v.useMemo(()=>{let e=new Map;for(let t of te.values())for(let n=t.start;n<=t.end;n+=1)e.set(n,t);return e},[te]),ae=v.useMemo(()=>K_(x,s??[]),[x,s]),oe=I_(t,n);return(0,P.jsxs)(`ol`,{className:`timeline`,children:[x.map((e,t)=>{let n=C.get(t),r=te.get(t),i=ie.get(t),a=i!==void 0&&!ne.has(i.key),o=n?w.get(n.key):void 0;return(0,P.jsxs)(v.Fragment,{children:[r&&(0,P.jsx)(ev,{fold:r,expanded:ne.has(r.key),onToggle:()=>re(r.key)}),!a&&(0,P.jsx)($_,{row:e,...ae.get(t)?{head:ae.get(t)}:{},...c?{compression:c}:{},...p?{resolveArtifact:p}:{},...m?{resolveImage:m}:{}}),n&&(0,P.jsx)(a_,{footer:n,...h===void 0?{}:{configModel:h},...g?{onRerun:g}:{},..._?{onQuote:_}:{},...y?{onInspect:y}:{},...b&&o!==void 0?{rewind:{client:b.client,sessionId:b.sessionId,turnIndex:o,onDone:e=>{ee.record(n,e),b.onDone(e)}}}:{}})]},e.key)}),(0,P.jsx)(Ar,{marks:ee.marks}),(0,P.jsx)(tv,{turn:a,phase:oe,...l?{runUsage:l}:{},queued:u,aborting:d,onAbort:f??(()=>void 0)})]})}function rv(e){let t=e[0]?.sessionId,n=t===void 0?pr:dr(pr,{type:`session`,sessionId:t});for(let t of e)n=dr(n,{type:`frame`,frame:t});return n}function iv({client:e,scheduleId:t,runId:n}){let r=F(),[i,a]=v.useState(),[o,s]=v.useState();return v.useEffect(()=>{let r=!0;return s(void 0),e.scheduleRecording(t,n).then(e=>{r&&a(e)}).catch(e=>{r&&s(e instanceof Error?e.message:String(e))}),()=>{r=!1}},[e,t,n]),o?(0,P.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:o})]}):i?i.missing?(0,P.jsx)(`p`,{className:`auto__hint`,children:r(`web.ui.auto.replay_none`)}):(0,P.jsx)(av,{data:i}):(0,P.jsx)(`p`,{className:`auto__hint`,children:r(`web.ui.auto.replay_loading`)})}function av({data:e}){let t=F(),n=v.useMemo(()=>rv(e.frames),[e.frames]);return(0,P.jsxs)(`div`,{className:`auto__replay`,children:[e.truncated&&(0,P.jsxs)(`p`,{className:`note`,"data-tone":`warn`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`triangle-alert`,size:`sm`})}),(0,P.jsx)(`span`,{children:t(`web.ui.auto.replay_truncated`,{count:e.frames.length})})]}),(0,P.jsx)(nv,{history:n.history,pending:n.stream.pending,thought:n.stream.thought,thoughtParts:n.thoughtParts,approvals:n.approvals,turn:`idle`,turns:n.turns,heads:n.heads})]})}function ov({client:e,runs:t,schedules:n,noSchedules:r,locale:i,onFix:a,busy:o}){let s=F(),c=v.useMemo(()=>{let e=new Map(n.map(e=>[e.id,e.name]));return t=>e.get(t)??s(`web.ui.auto.run_orphan`)},[n,s]);return t.length===0?(0,P.jsx)(`p`,{className:`auto__empty`,children:s(r?`web.ui.auto.runs_empty_none`:`web.ui.auto.runs_empty_never`)}):(0,P.jsx)(`ul`,{className:`auto__runs`,children:t.map(t=>(0,P.jsx)(sv,{run:t,name:c(t.scheduleId),locale:i,client:e,onFix:a,busy:o},t.id))})}function sv({run:e,name:t,locale:n,client:r,onFix:i,busy:a}){let o=F(),[s,c]=v.useState(!1),l=sn(e.status);return(0,P.jsxs)(`li`,{className:`run`,"data-tone":l,children:[(0,P.jsxs)(`div`,{className:`run__head`,children:[(0,P.jsx)(`span`,{className:`run__sign`,"aria-hidden":`true`,children:(0,P.jsx)(I,{name:l===`ok`?`check`:l===`error`?`circle-x`:`triangle-alert`,size:`sm`})}),(0,P.jsx)(`span`,{className:`run__name`,children:t}),(0,P.jsx)(`span`,{className:`run__status`,children:cn(e.status,o)}),e.manual&&(0,P.jsx)(`span`,{className:`run__manual`,children:o(`web.ui.auto.run_manual`)}),(0,P.jsx)(`span`,{className:`run__at`,title:new Date(e.startedAt).toLocaleString(),children:Ln(e.startedAt,Date.now(),n)}),(0,P.jsx)(`span`,{className:`run__meta`,children:o(`web.ui.auto.run_meta`,{turns:e.turns,cost:e.costUsd.toFixed(3)})}),(0,P.jsxs)(`button`,{type:`button`,className:`btn btn--ghost btn--sm run__toggle`,"aria-expanded":s,onClick:()=>c(e=>!e),children:[(0,P.jsx)(I,{name:s?`chevron-down`:`chevron-right`,size:`sm`}),o(s?`web.ui.auto.replay_hide`:`web.ui.auto.replay_show`)]})]}),e.reason&&(0,P.jsx)(`p`,{className:`run__reason`,children:e.reason}),e.pendingApprovals.length>0&&(0,P.jsx)(cv,{run:e,onFix:i,busy:a}),s&&(0,P.jsx)(iv,{client:r,scheduleId:e.scheduleId,runId:e.id})]})}function cv({run:e,onFix:t,busy:n}){let r=F(),[i,a]=v.useState(),o=e.pendingApprovals.some(e=>e.suggestedRule!==void 0);return(0,P.jsxs)(`div`,{className:`run__pending`,children:[(0,P.jsx)(`p`,{className:`run__pending-head`,children:r(`web.ui.auto.pending_header`,{count:e.pendingApprovals.length})}),(0,P.jsx)(`ul`,{className:`run__pending-list`,children:e.pendingApprovals.map((e,t)=>(0,P.jsxs)(`li`,{children:[(0,P.jsxs)(`code`,{children:[e.toolName,` `,e.target]}),e.suggestedRule?(0,P.jsx)(`span`,{className:`run__rule`,children:r(`web.ui.auto.pending_rule`,{rule:e.suggestedRule})}):(0,P.jsx)(`span`,{className:`run__rule`,"data-muted":``,children:r(`web.ui.auto.pending_no_rule`)})]},`${e.toolName}-${e.target}-${t}`))}),i===void 0?(0,P.jsx)(`button`,{type:`button`,className:`btn btn--primary btn--sm`,disabled:n||!o,onClick:()=>{t(e.scheduleId,e.id).then(e=>a(e??[]))},children:r(`web.ui.auto.pending_fix`)}):(0,P.jsx)(`p`,{className:`run__fixed`,children:i.length>0?r(`web.ui.auto.pending_fixed`,{count:i.length,rules:i.join(`, `)}):r(`web.ui.auto.pending_fixed_none`)})]})}function lv(e){return e.backend===null?`web.ui.auto.notice_unsupported`:e.canRegister?`web.ui.auto.notice_os`:`web.ui.auto.notice_host`}function uv({rows:e,capability:t,locale:n,busy:r,onNew:i,onPickTemplate:a,onEdit:o,onToggle:s,onRemove:c,onRun:l}){let u=F(),d=t.canRegister?`info`:`warn`;return(0,P.jsxs)(`div`,{className:`auto__tasks`,children:[(0,P.jsxs)(`p`,{className:`note`,"data-tone":d,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:t.canRegister?`circle-alert`:`triangle-alert`,size:`sm`})}),(0,P.jsx)(`span`,{children:u(lv(t))})]}),e.length===0?(0,P.jsxs)(`div`,{className:`auto__empty-state`,children:[(0,P.jsx)(`p`,{className:`auto__empty`,children:u(`web.ui.auto.empty_title`)}),(0,P.jsx)(`p`,{className:`auto__hint`,children:u(`web.ui.auto.empty_hint`)}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--primary`,disabled:r,onClick:i,children:u(`web.ui.auto.new`)}),(0,P.jsx)(fv,{busy:r,onPick:a})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`auto__toolbar`,children:(0,P.jsxs)(`button`,{type:`button`,className:`btn btn--primary btn--sm`,disabled:r,onClick:i,children:[(0,P.jsx)(I,{name:`plus`,size:`sm`}),u(`web.ui.auto.new`)]})}),(0,P.jsx)(`ul`,{className:`auto__list`,children:e.map(e=>(0,P.jsx)(dv,{row:e,locale:n,busy:r,onEdit:o,onToggle:s,onRemove:c,onRun:l},e.schedule.id))}),(0,P.jsx)(`h2`,{className:`auto__tpl-title`,children:u(`web.ui.auto.tpl_more`)}),(0,P.jsx)(fv,{busy:r,onPick:a})]})]})}function dv({row:e,locale:t,busy:n,onEdit:r,onToggle:i,onRemove:a,onRun:o}){let s=F(),c=e.schedule,l=c.permission===`bypass`;return(0,P.jsxs)(`li`,{className:`task`,"data-enabled":c.enabled?``:void 0,"data-danger":l?``:void 0,children:[(0,P.jsxs)(`div`,{className:`task__main`,children:[(0,P.jsx)(`span`,{className:`task__name`,children:c.name}),(0,P.jsx)(`span`,{className:`task__perm`,"data-danger":l?``:void 0,children:Qt(c.permission,s)}),c.osBackend===`host`&&(0,P.jsx)(`span`,{className:`task__host`,children:s(`web.ui.auto.mark_host`)})]}),(0,P.jsxs)(`div`,{className:`task__facts`,children:[(0,P.jsx)(`span`,{className:`task__trigger`,children:ln(c.trigger,s)}),(0,P.jsx)(`span`,{className:`task__next`,children:e.nextRunAt===null?s(`web.ui.auto.next_none`):s(`web.ui.auto.next_at`,{when:Ln(e.nextRunAt,Date.now(),t)})}),(0,P.jsx)(`span`,{className:`task__last`,children:c.lastStatus===void 0?s(`web.ui.auto.never_run`):(0,P.jsx)(`span`,{"data-tone":sn(c.lastStatus),children:s(`web.ui.auto.last_at`,{status:cn(c.lastStatus,s),when:c.lastRunAt===void 0?``:Ln(c.lastRunAt,Date.now(),t)})})})]}),(0,P.jsxs)(`div`,{className:`task__acts`,children:[(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,disabled:n,onClick:()=>o(e),children:s(`web.ui.auto.run_now`)}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,disabled:n,"aria-pressed":c.enabled,onClick:()=>i(e),children:c.enabled?s(`web.ui.auto.disable`):s(`web.ui.auto.enable`)}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,disabled:n,onClick:()=>r(e),children:s(`web.ui.auto.edit`)}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,"data-danger":``,disabled:n,onClick:()=>{window.confirm(s(`web.ui.auto.remove_confirm`,{name:c.name}))&&a(e)},children:s(`web.ui.auto.remove`)})]})]})}function fv({busy:e,onPick:t}){let n=F();return(0,P.jsx)(`ul`,{className:`auto__tpl`,children:re.map(r=>(0,P.jsxs)(`li`,{className:`tplcard`,children:[(0,P.jsx)(`p`,{className:`tplcard__name`,children:n(gn[r.id].name)}),(0,P.jsx)(`p`,{className:`tplcard__desc`,children:n(gn[r.id].desc)}),(0,P.jsxs)(`p`,{className:`tplcard__facts`,children:[(0,P.jsx)(`span`,{children:ln(r.trigger,n)}),(0,P.jsx)(`span`,{className:`tplcard__perm`,children:Qt(r.permission,n)})]}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--sm`,disabled:e,onClick:()=>t(r),children:n(`web.ui.auto.tpl_use`)})]},r.id))})}function pv(e){return e instanceof Error?e.message:String(e)}function mv(e,t){let[n,r]=v.useState(),[i,a]=v.useState(),[o,s]=v.useState(!1),[c,l]=v.useState(),[u,d]=v.useState(0);v.useEffect(()=>{if(!t)return;let n=!0;return a(void 0),e.schedules().then(e=>{n&&r(e)}).catch(e=>{n&&a(pv(e))}),()=>{n=!1}},[e,t,u]);let f=v.useCallback(()=>d(e=>e+1),[]),p=v.useCallback(async e=>{s(!0),a(void 0);try{return await e()}catch(e){a(pv(e));return}finally{s(!1)}},[]),m=v.useCallback(async t=>{let n=await p(()=>e.createSchedule(t));return n&&f(),n},[e,p,f]),h=v.useCallback(async(t,n)=>{let r=await p(()=>e.updateSchedule(t,n));return r&&f(),r},[e,p,f]),g=v.useCallback(async t=>{await p(()=>e.deleteSchedule(t)),f()},[e,p,f]),_=v.useCallback(async t=>{let n=await p(()=>e.runSchedule(t));n&&l({...n,scheduleId:t}),f()},[e,p,f]),y=v.useCallback(async(t,n)=>{let r=await p(()=>e.fixSchedule(t,n));return r&&f(),r?.added},[e,p,f]),b=v.useCallback(()=>l(void 0),[]);return{...n?{data:n}:{},...i===void 0?{}:{error:i},busy:o,...c?{lastRun:c}:{},reload:f,create:m,update:h,remove:g,run:_,fix:y,dismissRun:b}}function hv(e){let[t,n]=v.useState([]),[r,i]=v.useState(0);return v.useEffect(()=>{let t=!0;return e.schedulePending().then(e=>{t&&n(e.items)}).catch(()=>{t&&n([])}),()=>{t=!1}},[e,r]),{items:t,reload:v.useCallback(()=>i(e=>e+1),[])}}var gv=[{id:`tasks`,icon:`list-checks`,title:`web.ui.auto.tab_tasks`},{id:`runs`,icon:`layers`,title:`web.ui.auto.tab_runs`}];function _v({client:e,workspaceChoices:t,nativeDirPicker:n,onBack:r}){let i=F(),{lang:a}=rt(),[o,s]=v.useState(`tasks`),[c,l]=v.useState(null),[u,d]=v.useState([]),f=mv(e,!0),p=ot(e),m=f.data?.schedules??[],h=v.useCallback(async(e,t,n)=>{let r=n?await f.update(n,e):await f.create(e);return!r||(d(r.issues),!r.ok||!r.row)?!1:(l(null),t&&await f.run(r.row.schedule.id),!0)},[f]);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`nav`,{className:`navcol`,children:[(0,P.jsxs)(`div`,{className:`navcol__head`,children:[i(`web.ui.auto.title`),(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--sm navcol__back`,type:`button`,onClick:r,children:[(0,P.jsx)(I,{name:`arrow-left`,size:`sm`}),i(`web.ui.auto.back`)]})]}),(0,P.jsx)(`ul`,{className:`navcol__list`,children:gv.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,"aria-current":e.id===o?`true`:void 0,onClick:()=>{s(e.id),l(null),d([])},children:[(0,P.jsx)(`span`,{className:`navcol__sign`,children:(0,P.jsx)(I,{name:e.icon,size:`lg`})}),(0,P.jsx)(`span`,{children:i(e.title)}),(0,P.jsx)(`span`,{className:`navcol__n`,children:f.data===void 0?``:e.id===`tasks`?f.data.schedules.length:f.data.recentRuns.length})]})},e.id))})]}),(0,P.jsxs)(`section`,{className:`panelcol`,children:[(0,P.jsx)(`div`,{className:`panelcol__head`,children:(0,P.jsx)(`h1`,{className:`panelcol__title`,children:i(gv.find(e=>e.id===o)?.title??`web.ui.auto.title`)})}),(0,P.jsx)(`div`,{className:`panelcol__body`,children:(0,P.jsxs)(`div`,{className:`auto__pane`,children:[f.error!==void 0&&(0,P.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:f.error})]}),f.lastRun&&(0,P.jsx)(vv,{run:f.lastRun,busy:f.busy,onFix:f.fix,onDismiss:f.dismissRun}),f.data===void 0?(0,P.jsx)(`p`,{className:`auto__hint`,children:i(`web.ui.auto.loading`)}):c===null?o===`tasks`?(0,P.jsx)(uv,{rows:m,capability:f.data.capability,locale:a,busy:f.busy,onNew:()=>{d([]),l({})},onPickTemplate:e=>{d([]),l({template:e})},onEdit:e=>{d([]),l({row:e})},onToggle:e=>{f.update(e.schedule.id,{enabled:!e.schedule.enabled})},onRemove:e=>void f.remove(e.schedule.id),onRun:e=>void f.run(e.schedule.id)}):(0,P.jsx)(ov,{client:e,runs:f.data.recentRuns,schedules:m.map(e=>e.schedule),noSchedules:m.length===0,locale:a,onFix:f.fix,busy:f.busy}):(0,v.createElement)(An,{...c.row?{def:c.row.schedule}:{},...c.template?{template:c.template}:{},key:c.row?.schedule.id??c.template?.id??`blank`,defaults:f.data.defaults,issues:u,catalog:p,client:e,...t?{workspaceChoices:t}:{},...n===void 0?{}:{nativeDirPicker:n},busy:f.busy,onCancel:()=>{l(null),d([])},onSave:(e,t)=>h(e,t,c.row?.schedule.id)})]})})]})]})}function vv({run:e,busy:t,onFix:n,onDismiss:r}){let i=F();return(0,P.jsxs)(`div`,{className:`auto__lastrun`,children:[(0,P.jsxs)(`p`,{className:`auto__lastrun-head`,children:[(0,P.jsx)(`span`,{children:i(`web.ui.auto.just_ran`,{status:cn(e.status,i)})}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,onClick:r,children:i(`web.ui.auto.dismiss`)})]}),e.detail!==void 0&&(0,P.jsx)(`p`,{className:`run__reason`,children:e.detail}),e.run&&e.run.pendingApprovals.length>0&&(0,P.jsx)(cv,{run:e.run,onFix:n,busy:t})]})}var yv=1500;function bv({cmd:e}){let t=F(),[n,r]=v.useState(!1);v.useEffect(()=>{if(!n)return;let e=setTimeout(()=>r(!1),yv);return()=>clearTimeout(e)},[n]);let i=t(n?`web.ui.thread.copied`:`web.ui.cap.copy_cmd`);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`code`,{className:`cmd`,children:e}),(0,P.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>r(!0))},children:[(0,P.jsx)(I,{name:n?`check`:`copy`,size:`sm`}),i]})]})}function xv({title:e,note:t,tip:n,trust:r,children:i}){let a=F();return(0,P.jsxs)(`section`,{className:`cap__group`,children:[(0,P.jsxs)(`header`,{className:`cap__ghead`,children:[(0,P.jsxs)(`h2`,{className:`cap__gtitle`,children:[e,n!==void 0&&(0,P.jsx)(pt,{text:n,about:e})]}),t!==void 0&&(0,P.jsx)(`p`,{className:`cap__gnote`,children:t}),r&&(0,P.jsxs)(`span`,{className:`cap__trust`,"data-trust":r.trusted?`on`:`off`,children:[(0,P.jsx)(I,{name:r.trusted?`check`:`triangle-alert`,size:`sm`}),r.root?a(r.trusted?`web.ui.cap.trusted_at`:`web.ui.cap.untrusted_at`,{root:r.root}):a(`web.ui.cap.no_workspace`)]})]}),i]})}var Sv=[`stdio`,`sse`,`http`],Cv={name:``,transport:`stdio`,command:``,args:``,url:``,env:``};function wv(e){let t={};for(let n of e.split(`
|
|
362
|
+
`)){let e=n.indexOf(`=`);if(e<=0)continue;let r=n.slice(0,e).trim();r.length>0&&(t[r]=n.slice(e+1))}return t}function Tv(e){return e.split(`
|
|
363
|
+
`).filter(e=>e.length>0)}function Ev({client:e,lanExposed:t,onAdded:n}){let r=F(),[i,a]=v.useState(!1),[o,s]=v.useState(Cv),[c,l]=v.useState(!1),[u,d]=v.useState(),f=o.transport!==`stdio`,p=o.name.trim().length>0&&(f?o.url.trim():o.command.trim());return t?(0,P.jsx)(`p`,{className:`cap__foot`,"data-testid":`mcpadd-locked`,children:r(`web.ui.cap.mcp_add_locked`)}):i?(0,P.jsxs)(`form`,{className:`mcpadd`,onSubmit:t=>{if(t.preventDefault(),!p||c)return;l(!0),d(void 0);let r=wv(o.env),i=Tv(o.args);e.addMcp({name:o.name.trim(),transport:o.transport,...f?{}:o.command.trim()?{command:o.command.trim()}:{},...i.length>0?{args:i}:{},...f&&o.url.trim()?{url:o.url.trim()}:{},...Object.keys(r).length>0?{env:r}:{}}).then(e=>{n(e.server,e.configPath),a(!1),s(Cv)}).catch(e=>d(e instanceof Error?e.message:String(e))).finally(()=>l(!1))},children:[(0,P.jsx)(`h3`,{className:`mcpadd__title`,children:r(`web.ui.cap.mcp_add_title`)}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.mcp_add_name`)}),(0,P.jsx)(`input`,{type:`text`,value:o.name,autoFocus:!0,onChange:e=>s(t=>({...t,name:e.target.value}))}),(0,P.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.cap.mcp_add_name_hint`)})]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.mcp_add_transport`)}),(0,P.jsx)(`select`,{value:o.transport,onChange:e=>s(t=>({...t,transport:e.target.value})),children:Sv.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))})]}),f?(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.mcp_add_url`)}),(0,P.jsx)(`input`,{type:`text`,value:o.url,placeholder:`https://…`,onChange:e=>s(t=>({...t,url:e.target.value}))})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.mcp_add_command`)}),(0,P.jsx)(`input`,{type:`text`,value:o.command,placeholder:`npx`,onChange:e=>s(t=>({...t,command:e.target.value}))})]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.mcp_add_args`)}),(0,P.jsx)(`textarea`,{rows:3,value:o.args,onChange:e=>s(t=>({...t,args:e.target.value}))})]})]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.mcp_add_env`)}),(0,P.jsx)(`textarea`,{rows:2,value:o.env,onChange:e=>s(t=>({...t,env:e.target.value}))}),(0,P.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.cap.mcp_add_env_hint`)})]}),u!==void 0&&(0,P.jsxs)(`p`,{className:`mcpadd__error`,role:`alert`,children:[(0,P.jsx)(I,{name:`circle-x`,size:`sm`}),(0,P.jsx)(`span`,{children:u})]}),(0,P.jsx)(`p`,{className:`note-block`,children:r(`web.ui.cap.mcp_add_scope`)}),(0,P.jsxs)(`div`,{className:`mcpadd__act`,children:[(0,P.jsx)(`button`,{className:`btn btn--primary btn--sm`,type:`submit`,disabled:!p||c,children:r(c?`web.ui.cap.mcp_add_submitting`:`web.ui.cap.mcp_add_submit`)}),(0,P.jsx)(`button`,{className:`btn btn--sm`,type:`button`,disabled:c,onClick:()=>{a(!1),d(void 0)},children:r(`web.ui.cap.mcp_add_cancel`)})]})]}):(0,P.jsx)(`div`,{className:`mcpadd__bar`,children:(0,P.jsxs)(`button`,{className:`btn btn--sm`,type:`button`,onClick:()=>a(!0),children:[(0,P.jsx)(I,{name:`plus`,size:`sm`}),r(`web.ui.cap.mcp_add`)]})})}var Dv=`{
|
|
364
|
+
"servers": {}
|
|
365
|
+
}
|
|
366
|
+
`,Ov={added:`web.ui.cap.mcp_cfg_act_added`,reconnected:`web.ui.cap.mcp_cfg_act_reconnected`,unchanged:`web.ui.cap.mcp_cfg_act_unchanged`,removed:`web.ui.cap.mcp_cfg_act_removed`,skipped:`web.ui.cap.mcp_cfg_act_skipped`};function kv({client:e,lanExposed:t}){let n=F(),[r,i]=v.useState(!1),[a,o]=v.useState(`loading`),[s,c]=v.useState(),[l,u]=v.useState(``),[d,f]=v.useState(),[p,m]=v.useState(),[h,g]=v.useState(),_=v.useCallback(()=>{o(`loading`),f(void 0),m(void 0),g(void 0),e.mcpConfig().then(e=>{c({configPath:e.configPath,base:e.text,revision:e.revision,exists:e.exists,issues:e.issues}),u(e.exists?e.text:Dv)}).catch(e=>f(Fv(e))).finally(()=>o(`ready`))},[e]),y=s!==void 0&&l!==s.base;return t?(0,P.jsx)(`p`,{className:`cap__foot`,"data-testid":`mcpcfg-locked`,children:n(`web.ui.cap.mcp_cfg_locked`)}):r?(0,P.jsxs)(`section`,{className:`mcpcfg`,"data-testid":`mcpcfg`,children:[(0,P.jsx)(`h3`,{className:`mcpcfg__title`,children:n(`web.ui.cap.mcp_cfg_title`)}),s&&(0,P.jsxs)(`p`,{className:`mcpcfg__path`,children:[(0,P.jsx)(`span`,{className:`mcpcfg__path-label`,children:n(`web.ui.cap.mcp_cfg_path`)}),(0,P.jsx)(`code`,{children:s.configPath}),y&&(0,P.jsx)(`span`,{className:`mcpcfg__dirty`,children:n(`web.ui.cap.mcp_cfg_dirty`)})]}),a===`loading`&&(0,P.jsx)(`p`,{className:`mcpcfg__note`,children:n(`web.ui.cap.mcp_cfg_loading`)}),s&&!s.exists&&(0,P.jsx)(`p`,{className:`note-block`,children:n(`web.ui.cap.mcp_cfg_absent`)}),s&&(0,P.jsx)(Mv,{value:l,label:n(`web.ui.cap.mcp_cfg_editor`),readOnly:a!==`ready`,onChange:u}),s&&s.issues.length>0&&(0,P.jsx)(`ul`,{className:`mcpcfg__issues`,"data-testid":`mcpcfg-issues`,children:s.issues.map((e,t)=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(I,{name:`triangle-alert`,size:`sm`}),(0,P.jsx)(`span`,{children:e.message})]},t))}),d!==void 0&&(0,P.jsxs)(`div`,{className:`mcpcfg__error`,role:`alert`,children:[(0,P.jsxs)(`p`,{children:[(0,P.jsx)(I,{name:`circle-x`,size:`sm`}),(0,P.jsx)(`span`,{children:d})]}),(0,P.jsxs)(`button`,{className:`btn btn--sm`,type:`button`,onClick:_,disabled:a!==`ready`,children:[(0,P.jsx)(I,{name:`rotate-ccw`,size:`sm`}),n(`web.ui.cap.mcp_cfg_reload`)]})]}),p&&(0,P.jsx)(Av,{configPath:p.configPath,stale:y}),h&&(0,P.jsx)(jv,{changes:h}),(0,P.jsx)(`p`,{className:`note-block`,children:n(`web.ui.cap.mcp_cfg_scope`)}),(0,P.jsxs)(`div`,{className:`mcpcfg__act`,children:[(0,P.jsx)(`button`,{className:`btn btn--primary btn--sm`,type:`button`,disabled:!y||a!==`ready`,onClick:()=>{!s||!y||a!==`ready`||(o(`saving`),f(void 0),g(void 0),e.saveMcpConfig(l,s.revision).then(e=>{c({...s,base:l,revision:e.revision,exists:!0,issues:e.issues}),m({configPath:e.configPath})}).catch(e=>f(Fv(e))).finally(()=>o(`ready`)))},children:n(a===`saving`?`web.ui.cap.mcp_cfg_saving`:`web.ui.cap.mcp_cfg_save`)}),(0,P.jsx)(`button`,{className:`btn btn--sm`,type:`button`,disabled:y||a!==`ready`||s===void 0,onClick:()=>{!s||a!==`ready`||(o(`applying`),f(void 0),e.applyMcpConfig(s.revision).then(e=>{g(e.changes),c({...s,issues:e.issues})}).catch(e=>f(Fv(e))).finally(()=>o(`ready`)))},title:y?n(`web.ui.cap.mcp_cfg_apply_dirty`):void 0,children:n(a===`applying`?`web.ui.cap.mcp_cfg_applying`:`web.ui.cap.mcp_cfg_apply`)}),(0,P.jsx)(`button`,{className:`btn btn--sm`,type:`button`,disabled:a===`saving`||a===`applying`,onClick:()=>i(!1),children:n(`web.ui.cap.mcp_cfg_close`)})]})]}):(0,P.jsx)(`div`,{className:`mcpcfg__bar`,children:(0,P.jsxs)(`button`,{className:`btn btn--sm`,type:`button`,onClick:()=>{i(!0),_()},children:[(0,P.jsx)(I,{name:`settings-2`,size:`sm`}),n(`web.ui.cap.mcp_cfg_open`)]})})}function Av({configPath:e,stale:t}){let n=F();return(0,P.jsxs)(`p`,{className:`mcpcfg__receipt`,"data-testid":`mcpcfg-saved`,children:[(0,P.jsx)(I,{name:`check`,size:`sm`}),(0,P.jsxs)(`span`,{children:[n(`web.ui.cap.mcp_cfg_saved`,{path:e}),t?` ${n(`web.ui.cap.mcp_cfg_apply_dirty`)}`:` ${n(`web.ui.cap.mcp_cfg_not_live`)}`]})]})}function jv({changes:e}){let t=F();return e.length===0?(0,P.jsxs)(`p`,{className:`mcpcfg__receipt`,"data-testid":`mcpcfg-applied`,children:[(0,P.jsx)(I,{name:`info`,size:`sm`}),(0,P.jsx)(`span`,{children:t(`web.ui.cap.mcp_cfg_applied_none`)})]}):(0,P.jsxs)(`div`,{className:`mcpcfg__applied`,"data-testid":`mcpcfg-applied`,children:[(0,P.jsx)(`p`,{children:t(`web.ui.cap.mcp_cfg_applied`)}),(0,P.jsx)(`ul`,{children:e.map(e=>(0,P.jsxs)(`li`,{"data-action":e.action,children:[(0,P.jsx)(`code`,{children:e.name}),(0,P.jsx)(`span`,{children:t(Ov[e.action])}),e.server?.lastError!==void 0&&(0,P.jsx)(`span`,{className:`mcpcfg__why`,children:e.server.lastError})]},e.name))})]})}function Mv({value:e,label:t,readOnly:n,onChange:r}){let i=v.useRef(null),a=v.useRef(null),o=e.split(`
|
|
367
|
+
`);return(0,P.jsxs)(`div`,{className:`mcpcfg__editor`,children:[(0,P.jsx)(`div`,{className:`mcpcfg__gutter`,ref:i,"aria-hidden":`true`,children:o.map((e,t)=>(0,P.jsx)(`span`,{children:t+1},t))}),(0,P.jsxs)(`div`,{className:`mcpcfg__code`,children:[(0,P.jsx)(`pre`,{className:`mcpcfg__hl`,ref:a,"aria-hidden":`true`,children:(0,P.jsx)(`code`,{children:(0,P.jsx)(Nv,{text:e})})}),(0,P.jsx)(`textarea`,{className:`mcpcfg__ta`,value:e,"aria-label":t,readOnly:n,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,wrap:`off`,onScroll:e=>{let{scrollTop:t,scrollLeft:n}=e.currentTarget;i.current&&(i.current.scrollTop=t),a.current&&(a.current.scrollTop=t,a.current.scrollLeft=n)},onChange:e=>r(e.target.value)})]})]})}function Nv({text:e}){let[t,n]=v.useState();v.useEffect(()=>{let t=!0;return gg(e,`json`).then(e=>{t&&n(e)}),()=>{t=!1}},[e]);let r=t===void 0?void 0:Pv(t),i=r===e,a=r!==void 0&&!i&&`${r}\n`===e;return t===void 0||!i&&!a?(0,P.jsx)(P.Fragment,{children:e}):(0,P.jsxs)(P.Fragment,{children:[t.map((e,n)=>(0,P.jsxs)(v.Fragment,{children:[e.map((e,t)=>e.cls?(0,P.jsx)(`span`,{className:e.cls,children:e.text},t):(0,P.jsx)(v.Fragment,{children:e.text},t)),n<t.length-1&&`
|
|
368
|
+
`]},n)),a&&`
|
|
369
|
+
`]})}function Pv(e){return e.map(e=>e.map(e=>e.text).join(``)).join(`
|
|
370
|
+
`)}function Fv(e){return e instanceof Error?e.message:String(e)}var Iv={connected:`ok`,failed:`danger`,"needs-login":`warn`},Lv={connected:`ok`,failed:`failed`,"needs-login":`login`},Rv={connected:`web.ui.cap.mcp_connected`,failed:`web.ui.cap.mcp_failed`,"needs-login":`web.ui.cap.mcp_login`},zv=[{source:`user`,title:`web.ui.cap.g_mcp`,note:`web.ui.cap.g_mcp_note`},{source:`plugin`,title:`web.ui.cap.g_plugin`,note:`web.ui.cap.g_plugin_conn`},{source:`host`,title:`web.ui.cap.g_host`,note:`web.ui.cap.g_host_conn`}];function Bv({builtin:e,mcp:t,client:n,lanExposed:r}){let i=F(),[a,o]=v.useState({}),[s,c]=v.useState([]),[l,u]=v.useState(),d=s[0]===void 0?void 0:a[s[0].name]??s[0];return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`cap__lede`,children:i(`web.ui.cap.connectors_lede`)}),zv.map(e=>{let f=e.source===`user`?[...s,...t.filter(e=>e.source===`user`)]:t.filter(t=>t.source===e.source);return f.length===0&&e.source!==`user`?null:(0,P.jsxs)(xv,{title:i(e.title),note:i(e.note),children:[e.source===`user`&&n&&(0,P.jsxs)(`div`,{className:`cap__gacts`,children:[(0,P.jsx)(Ev,{client:n,lanExposed:r,onAdded:(e,t)=>{c(t=>[e,...t]),u(t)}}),(0,P.jsx)(kv,{client:n,lanExposed:r})]}),e.source===`user`&&l!==void 0&&(0,P.jsxs)(`p`,{className:`cap__foot`,children:[i(`web.ui.cap.mcp_add_done`,{path:l}),d!==void 0&&d.state!==`connected`&&(0,P.jsxs)(P.Fragment,{children:[` `,i(`web.ui.cap.mcp_add_offline`)]})]}),f.length===0?(0,P.jsx)(`p`,{className:`cap__foot`,children:i(`web.ui.cap.mcp_empty`)}):(0,P.jsx)(`div`,{className:`cards`,children:f.map(e=>(0,P.jsx)(Vv,{server:a[e.name]??e,...n?{client:n}:{},onPatched:e=>o(t=>({...t,[e.name]:e}))},e.name))})]},e.source)}),e.length>0&&(0,P.jsx)(xv,{title:i(`web.ui.cap.g_builtin`),note:i(`web.ui.cap.g_builtin_conn`),children:(0,P.jsx)(`ul`,{className:`slots`,"data-kind":`connector`,children:e.map(e=>(0,P.jsxs)(`li`,{className:`slot`,children:[(0,P.jsx)(`span`,{className:`slot__path`,children:(0,P.jsx)(`b`,{children:e.name})}),(0,P.jsx)(`span`,{className:`slot__stat`,children:i(`web.ui.cap.tool_count`,{count:e.toolCount})})]},e.name))})})]})}function Vv({server:e,client:t,onPatched:n}){let r=F(),[i,a]=v.useState(!1),[o,s]=v.useState();return(0,P.jsxs)(`article`,{className:`card card--conn`,"data-state":Lv[e.state],"data-source":e.source,children:[(0,P.jsxs)(`header`,{className:`card__head`,children:[(0,P.jsx)(`span`,{className:`card__ava`,"aria-hidden":!0,children:(0,P.jsx)(I,{name:`blocks`})}),(0,P.jsxs)(`span`,{className:`card__id`,children:[(0,P.jsxs)(`span`,{className:`card__nameline`,children:[(0,P.jsx)(`span`,{className:`card__name`,children:e.name}),(0,P.jsx)(`span`,{className:`card__badge`,"data-tone":Iv[e.state],children:r(`web.ui.cap.tool_count`,{count:e.toolCount})})]}),(0,P.jsx)(`span`,{className:`card__src`,children:r(Rv[e.state])})]})]}),e.state===`failed`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`card__desc`,children:r(`web.ui.cap.mcp_retries`,{count:e.reconnectAttempts})}),e.lastError!==void 0&&(0,P.jsx)(`p`,{className:`card__desc`,children:e.lastError}),(0,P.jsxs)(`p`,{className:`card__notice`,children:[(0,P.jsx)(`span`,{className:`card__nsign`,children:(0,P.jsx)(I,{name:`triangle-alert`,size:`sm`})}),(0,P.jsx)(`span`,{children:r(`web.ui.cap.mcp_failed_why`)})]})]}),e.state===`needs-login`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`card__desc`,children:r(`web.ui.cap.mcp_login_why`)}),(0,P.jsx)(`div`,{className:`card__act`,children:(0,P.jsx)(bv,{cmd:`epoch mcp login ${e.name}`})})]}),o!==void 0&&(0,P.jsxs)(`p`,{className:`card__notice`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`card__nsign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:o})]}),t&&(0,P.jsxs)(`footer`,{className:`card__foot`,children:[(0,P.jsx)(mt,{text:r(`web.ui.cap.mcp_reconnect_scope`),children:(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:()=>{!t||i||(a(!0),s(void 0),t.reconnectMcp(e.name).then(e=>n(e.server)).catch(e=>s(e instanceof Error?e.message:String(e))).finally(()=>a(!1)))},disabled:i,children:[i?(0,P.jsx)(`span`,{className:`card__spin`,"aria-hidden":!0}):(0,P.jsx)(I,{name:`rotate-ccw`,size:`sm`}),r(i?`web.ui.cap.mcp_reconnecting`:`web.ui.cap.mcp_reconnect`)]})}),e.state===`needs-login`&&(0,P.jsx)(`p`,{className:`card__hint`,children:r(`web.ui.cap.mcp_reconnect_after_login`)})]})]})}var Hv={name:``,description:``,prompt:``,tools:``,skills:``,maxTurns:``};function Uv(e){return e.split(`
|
|
371
|
+
`).map(e=>e.trim()).filter(e=>e.length>0)}function Wv({client:e,lanExposed:t,onAdded:n}){let r=F(),[i,a]=v.useState(!1),[o,s]=v.useState(Hv),[c,l]=v.useState(!1),[u,d]=v.useState(),f=o.name.trim().length>0&&o.description.trim().length>0;return t?(0,P.jsx)(`p`,{className:`cap__foot`,"data-testid":`roleadd-locked`,children:r(`web.ui.cap.role_add_locked`)}):i?(0,P.jsxs)(`form`,{className:`roleadd`,onSubmit:t=>{if(t.preventDefault(),!f||c)return;l(!0),d(void 0);let r=Uv(o.tools),i=Uv(o.skills),u=Number(o.maxTurns.trim()),p={name:o.name.trim(),description:o.description.trim(),...o.prompt.trim()?{prompt:o.prompt}:{},...r.length>0?{tools:r}:{},...i.length>0?{skills:i}:{},...Number.isFinite(u)&&u>0?{maxTurns:u}:{}};e.addRole(p).then(e=>{n(e.role,e.path),a(!1),s(Hv)}).catch(e=>d(e instanceof Error?e.message:String(e))).finally(()=>l(!1))},children:[(0,P.jsx)(`h3`,{className:`roleadd__title`,children:r(`web.ui.cap.role_add_title`)}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.role_add_name`)}),(0,P.jsx)(`input`,{type:`text`,value:o.name,autoFocus:!0,onChange:e=>s(t=>({...t,name:e.target.value}))}),(0,P.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.cap.role_add_name_hint`)})]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.role_add_desc`)}),(0,P.jsx)(`textarea`,{rows:2,value:o.description,onChange:e=>s(t=>({...t,description:e.target.value}))}),(0,P.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.cap.role_add_desc_hint`)})]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.role_add_prompt`)}),(0,P.jsx)(`textarea`,{rows:6,value:o.prompt,onChange:e=>s(t=>({...t,prompt:e.target.value}))}),(0,P.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.cap.role_add_prompt_hint`)})]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.role_add_tools`)}),(0,P.jsx)(`textarea`,{className:`roleadd__mono`,rows:3,value:o.tools,onChange:e=>s(t=>({...t,tools:e.target.value}))}),(0,P.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.cap.role_add_tools_hint`)})]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.role_add_skills`)}),(0,P.jsx)(`textarea`,{className:`roleadd__mono`,rows:3,value:o.skills,onChange:e=>s(t=>({...t,skills:e.target.value}))}),(0,P.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.cap.role_add_skills_hint`)})]}),(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.role_add_turns`)}),(0,P.jsx)(`input`,{type:`number`,min:1,max:200,value:o.maxTurns,onChange:e=>s(t=>({...t,maxTurns:e.target.value}))}),(0,P.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.cap.role_add_turns_hint`)})]}),u!==void 0&&(0,P.jsxs)(`p`,{className:`roleadd__error`,role:`alert`,children:[(0,P.jsx)(I,{name:`circle-x`,size:`sm`}),(0,P.jsx)(`span`,{children:u})]}),(0,P.jsx)(`p`,{className:`note-block`,children:r(`web.ui.cap.role_add_scope`)}),(0,P.jsxs)(`div`,{className:`roleadd__act`,children:[(0,P.jsx)(`button`,{className:`btn btn--primary btn--sm`,type:`submit`,disabled:!f||c,children:r(c?`web.ui.cap.role_add_submitting`:`web.ui.cap.role_add_submit`)}),(0,P.jsx)(`button`,{className:`btn btn--sm`,type:`button`,disabled:c,onClick:()=>{a(!1),d(void 0)},children:r(`web.ui.cap.role_add_cancel`)})]})]}):(0,P.jsx)(`div`,{className:`roleadd__bar`,children:(0,P.jsxs)(`button`,{className:`btn btn--sm`,type:`button`,onClick:()=>a(!0),children:[(0,P.jsx)(I,{name:`plus`,size:`sm`}),r(`web.ui.cap.role_add`)]})})}var Gv=[{source:`builtin`,title:`web.ui.cap.g_builtin`,note:`web.ui.cap.g_builtin_roles`},{source:`plugin`,title:`web.ui.cap.g_plugin`,note:`web.ui.cap.g_plugin_roles`},{source:`host`,title:`web.ui.cap.g_host`,note:`web.ui.cap.g_host_roles`},{source:`user`,title:`web.ui.cap.g_user`,note:`web.ui.cap.g_user_roles`},{source:`project`,title:`web.ui.cap.g_project`,note:`web.ui.cap.g_project_roles`}];function Kv({roles:e,project:t,onSummon:n,onTakeOver:r,pinnedRole:i,canSummon:a,newSession:o,client:s,lanExposed:c,onCreated:l}){let u=F(),[d,f]=v.useState(),[p,m]=v.useState(),h=v.useCallback(e=>{m(e),o?.create(t.root,e)},[o,t.root]);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`cap__lede`,children:u(`web.ui.cap.experts_lede`)}),(0,P.jsx)(Wv,{client:s,lanExposed:c,onAdded:(e,t)=>{f(t),l()}}),d!==void 0&&(0,P.jsx)(`p`,{className:`cap__foot`,children:u(`web.ui.cap.role_add_done`,{path:d})}),Gv.map(s=>{let c=e.filter(e=>e.source===s.source),l=s.source===`project`&&t.root!==null&&!t.trusted;return c.length===0&&!l?null:(0,P.jsx)(xv,{title:u(s.title),note:u(s.note),trust:s.source===`project`&&t.root!==null?t:null,children:l?(0,P.jsx)(`p`,{className:`cap__foot`,children:u(`web.ui.cap.project_locked_roles`)}):(0,P.jsx)(`div`,{className:`cards`,children:c.map(e=>(0,P.jsx)(qv,{role:e,onSummon:n,onTakeOver:r,pinned:i===e.name,canSummon:a,root:t.root,...o?{open:h,opening:o.busy,...o.error!==void 0&&p===e.name?{error:o.error}:{}}:{}},e.name))})},s.source)})]})}function qv({role:e,onSummon:t,onTakeOver:n,pinned:r,canSummon:i,root:a,open:o,opening:s,error:c}){let l=F(),u=e.toolsCut.length>0,d=a===null?l(`web.ui.cap.open_session_nows`,{role:e.name}):l(`web.ui.cap.open_session_here`,{role:e.name,root:a}),f=l(r?`web.ui.cap.take_over_on_title`:`web.ui.cap.take_over_title`,{role:e.name});return(0,P.jsxs)(`article`,{className:`card`,"data-source":e.source,children:[(0,P.jsxs)(`header`,{className:`card__head`,children:[(0,P.jsx)(`span`,{className:`card__ava`,"aria-hidden":!0,children:e.name.slice(0,2)}),(0,P.jsxs)(`span`,{className:`card__id`,children:[(0,P.jsx)(`span`,{className:`card__name`,children:e.name}),u&&(0,P.jsx)(`span`,{className:`card__src`,children:l(`web.ui.cap.overrides_builtin`)})]})]}),(0,P.jsx)(`p`,{className:`card__desc`,children:e.description}),(0,P.jsxs)(`p`,{className:`card__meta`,children:[(0,P.jsxs)(`span`,{className:`card__stat`,children:[l(`web.ui.cap.stat_tools`),` `,(0,P.jsx)(`b`,{children:e.tools===null?l(`web.ui.cap.unlimited`):e.tools.length})]}),(0,P.jsxs)(`span`,{className:`card__stat`,children:[l(`web.ui.cap.stat_turns`),` `,(0,P.jsx)(`b`,{children:e.maxTurns===null?l(`web.ui.cap.turns_global`):e.maxTurns})]})]}),(0,P.jsxs)(`details`,{className:`card__tools`,children:[(0,P.jsxs)(`summary`,{children:[(0,P.jsx)(I,{name:`chevron-right`,size:`sm`}),e.tools===null?l(`web.ui.cap.toolset`):l(`web.ui.cap.toolset_n`,{count:e.tools.length})]}),e.tools===null?(0,P.jsx)(`p`,{className:`card__hint`,children:l(`web.ui.cap.unlimited_hint`)}):(0,P.jsxs)(`div`,{className:`chips`,children:[e.tools.map(e=>(0,P.jsx)(`code`,{className:`chip`,children:e},e)),e.toolsCut.map(e=>(0,P.jsx)(`code`,{className:`chip`,"data-cut":``,children:e},`cut-${e}`))]})]}),e.skills!==null&&(0,P.jsxs)(`details`,{className:`card__tools`,"data-testid":`role-skills`,children:[(0,P.jsxs)(`summary`,{children:[(0,P.jsx)(I,{name:`chevron-right`,size:`sm`}),l(`web.ui.cap.skillset_n`,{count:e.skills.length})]}),e.skills.length===0?(0,P.jsx)(`p`,{className:`card__hint`,children:l(`web.ui.cap.skillset_none`)}):(0,P.jsx)(`div`,{className:`card__skillnames`,children:e.skills.map(e=>(0,P.jsx)(`code`,{className:`card__skill`,children:e},e))}),(0,P.jsx)(`p`,{className:`card__hint`,children:l(`web.ui.cap.skillset_hint`)})]}),(0,P.jsxs)(`footer`,{className:`card__foot`,children:[(0,P.jsx)(`button`,{className:`btn btn--sm card__call`,type:`button`,disabled:!i,onClick:()=>t(e.name),children:l(`web.ui.cap.summon`)}),(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--sm card__takeover`,type:`button`,disabled:!i||r,"aria-label":f,title:f,"aria-pressed":r,onClick:()=>n(e.name),children:[(0,P.jsx)(I,{name:`user-round`,size:`sm`}),l(r?`web.ui.cap.take_over_on`:`web.ui.cap.take_over`)]}),o&&(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--sm card__open`,type:`button`,disabled:s,"aria-label":d,title:d,onClick:()=>o(e.name),children:[(0,P.jsx)(I,{name:`plus`,size:`sm`}),l(`web.ui.cap.open_session`)]})]}),c!==void 0&&(0,P.jsxs)(`p`,{className:`card__notice`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`card__nsign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:l(`web.ui.cap.open_session_failed`,{detail:c})})]}),u&&(0,P.jsxs)(`p`,{className:`card__notice`,children:[(0,P.jsx)(`span`,{className:`card__nsign`,children:(0,P.jsx)(I,{name:`circle-alert`,size:`sm`})}),(0,P.jsx)(`span`,{children:l(`web.ui.cap.narrowed`,{role:e.name,cut:e.toolsCut.join(l(`web.ui.cap.list_sep`))})})]}),e.skillsCut.length>0&&(0,P.jsxs)(`p`,{className:`card__notice`,"data-testid":`role-skills-narrowed`,children:[(0,P.jsx)(`span`,{className:`card__nsign`,children:(0,P.jsx)(I,{name:`circle-alert`,size:`sm`})}),(0,P.jsx)(`span`,{children:l(`web.ui.cap.narrowed_skills`,{role:e.name,cut:e.skillsCut.join(l(`web.ui.cap.list_sep`))})})]})]})}function Jv({client:e,marketplaces:t,onBack:n,onPreviewLocal:r,onMarketsChanged:i,nativeDirPicker:a=!1}){let o=F(),[s,c]=v.useState(`local`);return(0,P.jsxs)(`div`,{className:`plugadd`,children:[(0,P.jsxs)(`div`,{className:`plugadd__head`,children:[(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--sm plugadd__back`,type:`button`,onClick:n,children:[(0,P.jsx)(I,{name:`arrow-left`,size:`sm`}),o(`web.ui.cap.plug_add_back`)]}),(0,P.jsx)(`b`,{className:`plugadd__title`,children:o(`web.ui.cap.plug_add_title`)})]}),(0,P.jsx)(`div`,{className:`plugadd__tabs`,role:`tablist`,children:[`local`,`market`].map(e=>(0,P.jsx)(`button`,{className:`plugadd__tab`,type:`button`,role:`tab`,"aria-selected":s===e,"data-on":s===e?`true`:void 0,onClick:()=>c(e),children:o(Yv[e])},e))}),s===`local`?(0,P.jsx)(Xv,{client:e,onPreview:r,nativeDirPicker:a}):(0,P.jsx)(Qv,{client:e,marketplaces:t,onChanged:i})]})}var Yv={local:`web.ui.cap.plug_add_tab_local`,market:`web.ui.cap.plug_add_tab_market`};function Xv({client:e,onPreview:t,nativeDirPicker:n}){let r=F(),[i,a]=v.useState(``),[o,s]=v.useState(!1),[c,l]=v.useState(),u=It(e,o),d=Ut(e,n),f=i.trim().length>0;return(0,P.jsxs)(`div`,{className:`plugadd__pane`,children:[(0,P.jsxs)(`p`,{className:`note`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`info`,size:`sm`})}),(0,P.jsx)(`span`,{children:r(`web.ui.cap.plug_add_hint_local`)})]}),(0,P.jsxs)(`form`,{className:`plugadd__form`,onSubmit:e=>{e.preventDefault(),f&&t(i.trim())},children:[(0,P.jsx)(`input`,{className:`input input--mono plugadd__path`,type:`text`,value:i,spellCheck:!1,placeholder:r(`web.ui.cap.plug_add_path_placeholder`),onChange:e=>a(e.target.value),"aria-label":r(`web.ui.cap.plug_add_path_label`)}),(0,P.jsx)(`button`,{className:`btn btn--sm`,type:`submit`,disabled:!f,children:r(`web.ui.cap.plug_add_look`)}),(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm plugadd__pick`,type:`button`,disabled:d.busy,onClick:()=>{if(o)return s(!1);if(!d.available)return s(!0);d.run().then(e=>{if(e.kind===`picked`)return a(e.path);e.kind!==`canceled`&&(l(e.message),s(!0))})},children:r(o?`web.ui.cap.plug_add_browse_off`:`web.ui.cap.plug_add_browse`)})]}),o&&(0,P.jsx)(Zv,{browser:u,onPick:a}),c!==void 0&&(0,P.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:c})]})]})}function Zv({browser:e,onPick:t}){let n=F(),{view:r,go:i,showHidden:a,setShowHidden:o}=e;return(0,P.jsxs)(`div`,{className:`plugadd__browse`,children:[(0,P.jsxs)(`div`,{className:`plugadd__crumb`,children:[(0,P.jsx)(`span`,{title:r.state===`ready`?r.path??``:``,children:r.state===`ready`?r.path??n(`web.ui.dirpick.anchors`):``}),r.state===`ready`&&r.path!==null&&(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:()=>t(r.path??``),children:n(`web.ui.cap.plug_add_pick_here`)})]}),r.state===`ready`&&r.path!==null&&(0,P.jsx)(Pt,{on:a,hidden:r.hidden,onToggle:o,className:`plugadd__hidden`}),r.state===`loading`&&(0,P.jsx)(`p`,{className:`cap__foot`,children:n(`web.ui.dirpick.loading`)}),r.state===`error`&&(0,P.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:r.message})]}),r.state===`ready`&&(0,P.jsxs)(`ul`,{className:`plugadd__dirs`,children:[r.parent!==null&&(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{className:`plugadd__dir`,type:`button`,onClick:()=>i(r.parent??void 0),children:n(`web.ui.dirpick.up`)})}),r.entries.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{className:`plugadd__dir`,type:`button`,disabled:!e.readable,title:e.path,onClick:()=>i(e.path),children:e.name})},e.path)),r.omitted>0&&(0,P.jsx)(`li`,{className:`plugadd__omitted`,children:n(`web.ui.dirpick.omitted`,{count:r.omitted})})]})]})}function Qv({client:e,marketplaces:t,onChanged:n}){let r=F(),[i,a]=v.useState(``),[o,s]=v.useState(!1),[c,l]=v.useState(),u=()=>{let t=i.trim();o||t.length===0||(s(!0),l(void 0),e.addPluginMarketplace(t).then(e=>{if(!e.ok)return l(e.detail??r(`web.ui.cap.plug_market_add_failed`));a(``),n()}).catch(e=>l(ey(e))).finally(()=>s(!1)))};return(0,P.jsxs)(`div`,{className:`plugadd__pane`,children:[(0,P.jsx)(`p`,{className:`cap__lede`,children:r(`web.ui.cap.plug_market_lede`)}),(0,P.jsxs)(`form`,{className:`plugadd__form`,onSubmit:e=>{e.preventDefault(),u()},children:[(0,P.jsx)(`input`,{className:`input input--mono plugadd__path`,type:`text`,value:i,spellCheck:!1,placeholder:r(`web.ui.cap.plug_market_placeholder`),onChange:e=>a(e.target.value),"aria-label":r(`web.ui.cap.plug_market_label`)}),(0,P.jsx)(`button`,{className:`btn btn--sm`,type:`submit`,disabled:o||i.trim().length===0,children:r(`web.ui.cap.plug_market_add`)})]}),c!==void 0&&(0,P.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:c})]}),t.length===0?(0,P.jsx)(`p`,{className:`cap__foot`,children:r(`web.ui.cap.plug_market_none`)}):(0,P.jsx)(`ul`,{className:`slots`,"data-act":`true`,children:t.map(t=>(0,P.jsx)($v,{market:t,onRemoved:n,client:e},t.name))})]})}function $v({market:e,onRemoved:t,client:n}){let r=F(),[i,a]=v.useState(!1),[o,s]=v.useState(!1),[c,l]=v.useState();return(0,P.jsxs)(`li`,{className:`slot`,children:[(0,P.jsx)(`span`,{className:`slot__path`,children:(0,P.jsx)(`b`,{children:e.name})}),(0,P.jsxs)(`span`,{className:`slot__desc`,children:[i?(0,P.jsx)(`b`,{className:`plug__ask`,children:r(`web.ui.cap.plug_market_remove_ask`)}):e.source,c!==void 0&&(0,P.jsx)(`b`,{className:`plug__err`,children:c})]}),(0,P.jsx)(`span`,{className:`slot__stat`,children:(0,P.jsx)(`span`,{className:`plug__tag`,children:r(`web.ui.cap.plug_market_entries`,{count:e.entries})})}),(0,P.jsx)(`span`,{className:`slot__act`,children:i?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`button`,{className:`btn btn--sm`,type:`button`,disabled:o,onClick:()=>{o||(s(!0),l(void 0),n.removePluginMarketplace(e.name).then(e=>{if(e.ok)return t();l(e.detail??r(`web.ui.cap.plug_market_remove_failed`))}).catch(e=>l(ey(e))).finally(()=>s(!1)))},children:r(`web.ui.cap.plug_market_remove_yes`)}),(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:()=>a(!1),children:r(`web.ui.cap.plug_cancel`)})]}):(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:()=>a(!0),children:r(`web.ui.cap.plug_market_remove`)})})]})}function ey(e){if(typeof e==`object`&&e&&`detail`in e){let t=e.detail;if(typeof t==`string`&&t.length>0)return t}return e instanceof Error?e.message:String(e)}var ty={active:`web.ui.cap.plug_state_active`,pending:`web.ui.cap.plug_state_pending`,disabled:`web.ui.cap.plug_state_disabled`,stale:`web.ui.cap.plug_state_stale`,off:`web.ui.cap.plug_state_off`};function ny({client:e,query:t,lanExposed:n,nativeDirPicker:r=!1}){let i=F(),[a,o]=v.useState(),[s,c]=v.useState(),[l,u]=v.useState({kind:`list`}),[d,f]=v.useState(0),[p,m]=v.useState(()=>new Set);if(v.useEffect(()=>{let t=!0;return c(void 0),e.plugins().then(e=>{t&&o(e)}).catch(e=>{t&&c(fy(e))}),()=>{t=!1}},[e,d]),s)return(0,P.jsx)(ly,{failure:s});if(!a)return(0,P.jsx)(`p`,{className:`cap__foot`,children:i(`web.ui.cap.loading`)});if(l.kind===`add`)return(0,P.jsx)(Jv,{client:e,marketplaces:a.marketplaces,nativeDirPicker:r,onBack:()=>u({kind:`list`}),onPreviewLocal:e=>u({kind:`preview`,mode:`local`,path:e}),onMarketsChanged:()=>f(e=>e+1)});if(l.kind===`preview`)return(0,P.jsx)(sy,{client:e,screen:l,onBack:()=>u({kind:`list`}),onDone:e=>{f(e=>e+1),m(t=>new Set(t).add(e))}});let h=a.installed.filter(e=>py(t,e.name,e.source)),g=a.hits.filter(e=>py(t,e.name,e.description,e.marketplace,...e.keywords));return(0,P.jsxs)(`div`,{className:`plug`,children:[(0,P.jsxs)(`div`,{className:`plug__top`,children:[(0,P.jsx)(`p`,{className:`cap__lede`,children:i(`web.ui.cap.plug_lede`)}),!n&&(0,P.jsxs)(`button`,{className:`btn btn--sm plug__add`,type:`button`,onClick:()=>u({kind:`add`}),children:[(0,P.jsx)(I,{name:`plus`,size:`sm`}),i(`web.ui.cap.plug_add`)]})]}),a.pendingRestart&&(0,P.jsx)(ry,{}),n&&(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,P.jsx)(`p`,{children:i(`web.ui.cap.plug_locked_lan`)})}),(0,P.jsxs)(`section`,{className:`plug__sec`,children:[(0,P.jsx)(`h2`,{className:`plug__head`,children:i(`web.ui.cap.plug_installed_head`,{count:a.installed.length})}),h.length===0?(0,P.jsx)(`p`,{className:`cap__foot`,children:i(`web.ui.cap.plug_installed_empty`)}):(0,P.jsx)(`ul`,{className:`slots`,...n?{}:{"data-act":`true`},children:h.map(t=>(0,P.jsx)(iy,{entry:t,pendingRestart:a.pendingRestart,justTouched:p.has(t.name),canWrite:!n,onUpdate:()=>u({kind:`preview`,mode:`update`,name:t.name}),onUninstalled:()=>f(e=>e+1),client:e},t.name))})]}),(0,P.jsxs)(`section`,{className:`plug__sec`,children:[(0,P.jsx)(`h2`,{className:`plug__head`,children:i(`web.ui.cap.plug_market_head`,{count:a.hits.length})}),g.length===0?(0,P.jsx)(`p`,{className:`cap__foot`,children:i(a.marketplaces.length===0?`web.ui.cap.plug_market_none_added`:`web.ui.cap.plug_market_empty`)}):(0,P.jsx)(`ul`,{className:`slots`,...n?{}:{"data-act":`true`},children:g.map(e=>(0,P.jsx)(oy,{hit:e,canWrite:!n,onInstall:()=>u({kind:`preview`,mode:`install`,ref:e.ref})},e.ref))})]})]})}function ry(){let e=F();return(0,P.jsxs)(`div`,{className:`note-block plug__restart`,"data-tone":`warn`,role:`status`,children:[(0,P.jsxs)(`p`,{className:`plug__restart-head`,children:[(0,P.jsx)(I,{name:`triangle-alert`,size:`sm`}),(0,P.jsx)(`b`,{children:e(`web.ui.cap.plug_restart`)})]}),(0,P.jsx)(`p`,{children:e(`web.ui.cap.plug_restart_why`)})]})}function iy({entry:e,pendingRestart:t,justTouched:n,canWrite:r,onUpdate:i,onUninstalled:a,client:o}){let s=F(),[c,l]=v.useState(!1),[u,d]=v.useState(!1),[f,p]=v.useState(),m=ay(e,t,n);return(0,P.jsxs)(`li`,{className:`slot`,"data-state":m,children:[(0,P.jsxs)(`span`,{className:`slot__path`,children:[(0,P.jsx)(`b`,{children:e.name}),(0,P.jsxs)(`i`,{children:[`@`,e.version]})]}),(0,P.jsxs)(`span`,{className:`slot__desc`,children:[c?(0,P.jsx)(`b`,{className:`plug__ask`,children:s(`web.ui.cap.plug_uninstall_ask`,{name:e.name})}):(0,P.jsxs)(P.Fragment,{children:[s(ty[m]),e.counts&&(0,P.jsx)(`i`,{className:`plug__counts`,children:dy(s,e.counts)})]}),f!==void 0&&(0,P.jsx)(`b`,{className:`plug__err`,children:f})]}),(0,P.jsxs)(`span`,{className:`slot__stat`,children:[e.linked&&(0,P.jsx)(`span`,{className:`plug__tag`,children:s(`web.ui.cap.plug_linked`)}),e.marketplace!==null&&(0,P.jsx)(`span`,{className:`plug__tag`,children:e.marketplace})]}),r&&(0,P.jsx)(`span`,{className:`slot__act`,children:c?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`button`,{className:`btn btn--sm`,type:`button`,disabled:u,onClick:()=>{u||(d(!0),p(void 0),o.uninstallPlugin(e.name).then(e=>{if(e.ok)return a();p(e.detail??``)}).catch(e=>p(fy(e).detail)).finally(()=>d(!1)))},children:s(`web.ui.cap.plug_uninstall_yes`)}),(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:()=>l(!1),children:s(`web.ui.cap.plug_cancel`)})]}):(0,P.jsxs)(P.Fragment,{children:[!e.linked&&(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:i,children:s(`web.ui.cap.plug_update`)}),(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:()=>l(!0),children:s(`web.ui.cap.plug_uninstall`)})]})})]})}function ay(e,t,n){return e.active?`active`:e.enabled?n?`pending`:t?`stale`:`off`:`disabled`}function oy({hit:e,canWrite:t,onInstall:n}){let r=F();return(0,P.jsxs)(`li`,{className:`slot`,children:[(0,P.jsxs)(`span`,{className:`slot__path`,children:[(0,P.jsxs)(`i`,{children:[e.marketplace,`/`]}),(0,P.jsx)(`b`,{children:e.name})]}),(0,P.jsxs)(`span`,{className:`slot__desc`,children:[e.description||r(`web.ui.cap.plug_no_desc`),!e.installable&&(0,P.jsx)(`b`,{className:`plug__warn`,children:r(e.sourceType===null?`web.ui.cap.plug_bad_source`:`web.ui.cap.plug_remote_off`)})]}),(0,P.jsx)(`span`,{className:`slot__stat`,children:e.category!==null&&(0,P.jsx)(`span`,{className:`plug__tag`,children:e.category})}),t&&(0,P.jsx)(`span`,{className:`slot__act`,children:e.installed?(0,P.jsx)(`span`,{className:`plug__tag`,children:r(`web.ui.cap.plug_already`)}):(0,P.jsx)(`button`,{className:`btn btn--sm`,type:`button`,disabled:!e.installable,onClick:n,children:r(`web.ui.cap.plug_install`)})})]})}function sy({client:e,screen:t,onBack:n,onDone:r}){let i=F(),[a,o]=v.useState(),[s,c]=v.useState(),[l,u]=v.useState(!1),[d,f]=v.useState(),p=t.mode===`install`?t.ref:t.mode===`local`?t.path:t.name;return v.useEffect(()=>{let n=!0;return f(void 0),(t.mode===`install`?e.previewPluginInstall(t.ref):t.mode===`local`?e.previewLocalPluginInstall(t.path):e.previewPluginUpdate(t.name)).then(e=>{n&&o(e)}).catch(e=>{n&&f(fy(e).detail)}),()=>{n=!1}},[e,t.mode,p]),(0,P.jsxs)(`div`,{className:`plug__prev`,children:[(0,P.jsxs)(`div`,{className:`plug__prev-head`,children:[(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:n,children:[(0,P.jsx)(I,{name:`arrow-left`,size:`sm`}),i(`web.ui.cap.plug_back`)]}),(0,P.jsx)(`b`,{children:p})]}),d!==void 0&&(0,P.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:d})]}),s===void 0?a===void 0?(0,P.jsx)(`p`,{className:`cap__foot`,children:i(`web.ui.cap.loading`)}):(0,P.jsx)(cy,{seen:a,mode:t.mode===`update`?`update`:`install`,busy:l,onConfirm:()=>{if(l||!a?.ok||a.token===null)return;u(!0),f(void 0);let n=a.token;(t.mode===`install`?e.installPlugin(t.ref,n):t.mode===`local`?e.installLocalPlugin(t.path,n):e.updatePlugin(t.name,n)).then(e=>{c({ok:e.ok,detail:e.detail??i(t.mode===`update`?`web.ui.cap.plug_done_update`:`web.ui.cap.plug_done`,{name:e.entry?.name??p,version:e.entry?.version??``})}),e.ok&&r(e.entry?.name??(t.mode===`update`?t.name:``))}).catch(e=>f(fy(e).detail)).finally(()=>u(!1))}}):(0,P.jsxs)(`div`,{className:`plug__result`,children:[(0,P.jsx)(`div`,{className:`note-block`,...s.ok?{}:{"data-tone":`warn`},children:(0,P.jsx)(`p`,{children:s.detail})}),s.ok&&(0,P.jsx)(ry,{}),(0,P.jsx)(`button`,{className:`btn btn--sm`,type:`button`,onClick:n,children:i(`web.ui.cap.plug_back`)})]})]})}function cy({seen:e,mode:t,busy:n,onConfirm:r}){let i=F();if(!e.ok||e.preview===null)return(0,P.jsx)(`div`,{className:`plug__result`,children:(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,P.jsx)(`p`,{children:e.detail??i(`web.ui.cap.plug_preview_failed`)})})});let a=e.preview,o=a.commands.length===0&&a.roles.length===0&&a.skills.length===0&&a.hooks.length===0&&a.mcpServers.length===0&&a.denyRules===0;return(0,P.jsxs)(`div`,{className:`plug__result`,children:[(0,P.jsx)(`p`,{className:`plug__title`,children:i(t===`install`?`web.ui.cap.plug_will_install`:`web.ui.cap.plug_will_update`,{name:a.name,version:a.version})}),a.description&&(0,P.jsx)(`p`,{className:`cap__lede`,children:a.description}),(0,P.jsxs)(`dl`,{className:`plug__facts`,children:[(0,P.jsx)(`dt`,{children:i(`web.ui.cap.plug_source`)}),(0,P.jsxs)(`dd`,{children:[(0,P.jsx)(`code`,{children:a.source}),` `,(0,P.jsxs)(`i`,{children:[`(`,a.sourceType,`)`]})]}),a.checksum!==null&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:i(`web.ui.cap.plug_checksum`)}),(0,P.jsx)(`dd`,{children:(0,P.jsx)(`code`,{children:a.checksum})})]}),a.author!==null&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:i(`web.ui.cap.plug_author`)}),(0,P.jsx)(`dd`,{children:a.author})]}),a.homepage!==null&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:i(`web.ui.cap.plug_homepage`)}),(0,P.jsx)(`dd`,{children:a.homepage})]})]}),(0,P.jsx)(`p`,{className:`plug__brings`,children:i(`web.ui.cap.plug_brings`)}),(0,P.jsxs)(`ul`,{className:`plug__inv`,children:[o&&(0,P.jsx)(`li`,{children:i(`web.ui.cap.plug_brings_nothing`)}),a.commands.length>0&&(0,P.jsx)(`li`,{children:i(`web.ui.cap.plug_inv_commands`,{count:a.commands.length,names:uy(i,a.commands)})}),a.roles.length>0&&(0,P.jsx)(`li`,{children:i(`web.ui.cap.plug_inv_roles`,{count:a.roles.length,names:uy(i,a.roles)})}),a.skills.length>0&&(0,P.jsx)(`li`,{children:i(`web.ui.cap.plug_inv_skills`,{count:a.skills.length,names:uy(i,a.skills)})}),a.hooks.length>0&&(0,P.jsx)(`li`,{className:`plug__danger`,children:i(`web.ui.cap.plug_inv_hooks`,{count:a.hooks.reduce((e,t)=>e+t.count,0),tally:uy(i,a.hooks.map(e=>`${e.type} × ${e.count}`))})}),a.mcpServers.length>0&&(0,P.jsx)(`li`,{className:`plug__danger`,children:i(`web.ui.cap.plug_inv_mcp`,{count:a.mcpServers.length,names:uy(i,a.mcpServers)})}),a.denyRules>0&&(0,P.jsx)(`li`,{children:i(`web.ui.cap.plug_inv_deny`,{count:a.denyRules})}),a.ignoredBuckets.length>0&&(0,P.jsx)(`li`,{children:i(`web.ui.cap.plug_inv_ignored`,{buckets:uy(i,a.ignoredBuckets)})}),a.hasJsTools&&(0,P.jsx)(`li`,{children:i(`web.ui.cap.plug_inv_js`)})]}),a.conflict!==null&&(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,P.jsx)(`p`,{children:i(`web.ui.cap.plug_conflict`,{name:a.conflict.name,version:a.conflict.version})})}),(0,P.jsx)(`p`,{className:`plug__pending-hint`,children:i(`web.ui.cap.plug_pending_hint`)}),(0,P.jsx)(`div`,{className:`plug__act`,children:(0,P.jsx)(`button`,{className:`btn btn--primary btn--sm`,type:`button`,disabled:n||a.conflict!==null,onClick:r,children:i(t===`install`?`web.ui.cap.plug_confirm`:`web.ui.cap.plug_confirm_update`)})})]})}function ly({failure:e}){let t=F();return e.code===`no-plugin-control`?(0,P.jsx)(`div`,{className:`plug`,children:(0,P.jsxs)(`div`,{className:`note-block`,children:[(0,P.jsx)(`p`,{children:(0,P.jsx)(`b`,{children:t(`web.ui.cap.plug_no_path`)})}),(0,P.jsx)(`p`,{children:e.detail})]})}):(0,P.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:e.detail})]})}function uy(e,t){return t.join(e(`web.ui.cap.list_sep`))}function dy(e,t){let n=[],r=(t,r)=>{t>0&&n.push(e(r,{count:t}))};return r(t.commands,`web.ui.cap.plug_n_commands`),r(t.roles,`web.ui.cap.plug_n_roles`),r(t.skills,`web.ui.cap.plug_n_skills`),r(t.hooks,`web.ui.cap.plug_n_hooks`),r(t.denyRules,`web.ui.cap.plug_n_deny`),r(t.mcpServers,`web.ui.cap.plug_n_mcp`),n.length===0?e(`web.ui.cap.plug_brings_nothing`):n.join(` · `)}function fy(e){let t=e,n=typeof t?.code==`string`?t.code:``,r=typeof t?.detail==`string`&&t.detail.length>0?t.detail:``;return r?{code:n,detail:r}:{code:n,detail:e instanceof Error?e.message:String(e)}}function py(e,...t){return!e||t.some(t=>t.toLowerCase().includes(e))}var my={markdown:`web.ui.cap.import_form_markdown`,"skill-dir":`web.ui.cap.import_form_skill-dir`,tree:`web.ui.cap.import_form_tree`,archive:`web.ui.cap.import_form_archive`};function hy({client:e,onBack:t,onImported:n,nativeDirPicker:r=!1}){let i=F(),[a,o]=v.useState(``),[s,c]=v.useState(),[l,u]=v.useState(),[d,f]=v.useState(!1),[p,m]=v.useState(),[h,g]=v.useState(!1),_=It(e,h),y=Ut(e,r),b=()=>{d||a.trim().length===0||(f(!0),u(void 0),m(void 0),e.previewSkillImport(a.trim()).then(c).catch(e=>m(xy(e))).finally(()=>f(!1)))};return(0,P.jsxs)(`div`,{className:`skimport`,children:[(0,P.jsxs)(`div`,{className:`skimport__head`,children:[(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--sm skimport__back`,type:`button`,onClick:t,children:[(0,P.jsx)(I,{name:`arrow-left`,size:`sm`}),i(`web.ui.cap.skill_back`)]}),(0,P.jsx)(`b`,{className:`skimport__title`,children:i(`web.ui.cap.import_title`)})]}),(0,P.jsx)(`p`,{className:`cap__lede`,children:i(`web.ui.cap.import_lede`)}),(0,P.jsxs)(`p`,{className:`note`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`info`,size:`sm`})}),(0,P.jsx)(`span`,{children:i(`web.ui.cap.import_hint_local`)})]}),(0,P.jsxs)(`form`,{className:`skimport__form`,onSubmit:e=>{e.preventDefault(),b()},children:[(0,P.jsx)(`input`,{className:`input input--mono skimport__path`,type:`text`,value:a,spellCheck:!1,placeholder:i(`web.ui.cap.import_placeholder`),onChange:e=>o(e.target.value),"aria-label":i(`web.ui.cap.import_path_label`)}),(0,P.jsx)(`button`,{className:`btn btn--sm`,type:`submit`,disabled:d||a.trim().length===0,children:i(`web.ui.cap.import_look`)}),(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm skimport__pick`,type:`button`,disabled:y.busy,onClick:()=>{if(h)return g(!1);if(!y.available)return g(!0);y.run().then(e=>{if(e.kind===`picked`)return o(e.path);e.kind!==`canceled`&&(m(e.message),g(!0))})},children:i(h?`web.ui.cap.import_browse_off`:`web.ui.cap.import_browse`)})]}),h&&(0,P.jsx)(gy,{browser:_,onPick:o}),p!==void 0&&(0,P.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:p})]}),l===void 0?s!==void 0&&(0,P.jsx)(_y,{preview:s,busy:d,onConfirm:()=>{d||!s?.ok||(f(!0),m(void 0),e.importSkills(s.source,s.token).then(e=>{u(e),e.imported.length>0&&n()}).catch(e=>m(xy(e))).finally(()=>f(!1)))}}):(0,P.jsx)(yy,{done:l,onAgain:()=>u(void 0)})]})}function gy({browser:e,onPick:t}){let n=F(),{view:r,go:i,showHidden:a,setShowHidden:o}=e;return(0,P.jsxs)(`div`,{className:`skimport__browse`,children:[(0,P.jsxs)(`div`,{className:`skimport__crumb`,children:[(0,P.jsx)(`span`,{title:r.state===`ready`?r.path??``:``,children:r.state===`ready`?r.path??n(`web.ui.dirpick.anchors`):``}),r.state===`ready`&&r.path!==null&&(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:()=>t(r.path??``),children:n(`web.ui.cap.import_pick_here`)})]}),r.state===`ready`&&r.path!==null&&(0,P.jsx)(Pt,{on:a,hidden:r.hidden,onToggle:o,className:`skimport__hidden`}),r.state===`loading`&&(0,P.jsx)(`p`,{className:`cap__foot`,children:n(`web.ui.dirpick.loading`)}),r.state===`error`&&(0,P.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:r.message})]}),r.state===`ready`&&(0,P.jsxs)(`ul`,{className:`skimport__dirs`,children:[r.parent!==null&&(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{className:`skimport__dir`,type:`button`,onClick:()=>i(r.parent??void 0),children:n(`web.ui.dirpick.up`)})}),r.entries.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{className:`skimport__dir`,type:`button`,disabled:!e.readable,title:e.path,onClick:()=>i(e.path),children:e.name})},e.path)),r.omitted>0&&(0,P.jsx)(`li`,{className:`skimport__omitted`,children:n(`web.ui.dirpick.omitted`,{count:r.omitted})})]})]})}function _y({preview:e,busy:t,onConfirm:n}){let r=F();if(!e.ok)return(0,P.jsxs)(`div`,{className:`skimport__result`,children:[(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,P.jsx)(`p`,{children:e.detail??r(`web.ui.cap.import_failed`)})}),(0,P.jsx)(by,{issues:e.issues,title:r(`web.ui.cap.import_issues`)})]});let i=e.skills.filter(e=>e.conflict?.verdict!==`refuse`);return(0,P.jsxs)(`div`,{className:`skimport__result`,children:[(0,P.jsx)(`p`,{className:`skimport__count`,children:r(`web.ui.cap.import_count`,{count:i.length,form:r(my[e.form??`tree`])})}),(0,P.jsx)(`ul`,{className:`slots`,children:e.skills.map(e=>(0,P.jsx)(vy,{skill:e},`${e.category}/${e.name}`))}),(0,P.jsx)(by,{issues:e.issues,title:r(`web.ui.cap.import_issues`)}),(0,P.jsx)(`div`,{className:`skimport__act`,children:(0,P.jsx)(`button`,{className:`btn btn--primary btn--sm`,type:`button`,disabled:t||i.length===0,onClick:n,children:r(`web.ui.cap.import_confirm`,{count:i.length})})})]})}function vy({skill:e}){let t=F(),n=e.conflict;return(0,P.jsxs)(`li`,{className:`slot`,"data-conflict":n?.verdict??void 0,children:[(0,P.jsxs)(`span`,{className:`slot__path`,children:[(0,P.jsxs)(`i`,{children:[e.category,`/`]}),(0,P.jsx)(`b`,{children:e.name})]}),(0,P.jsxs)(`span`,{className:`slot__desc`,children:[e.description||t(`web.ui.cap.import_no_desc`),n&&(0,P.jsx)(`b`,{className:`skimport__warn`,children:t(n.verdict===`refuse`?`web.ui.cap.import_conflict_refuse`:`web.ui.cap.import_conflict_shadowed`)})]}),(0,P.jsx)(`span`,{className:`slot__stat`,children:t(`web.ui.cap.import_files`,{files:e.files,bytes:e.bytes})})]})}function yy({done:e,onAgain:t}){let n=F();return(0,P.jsxs)(`div`,{className:`skimport__result`,children:[(0,P.jsx)(`div`,{className:`note-block`,...e.ok?{}:{"data-tone":`warn`},children:(0,P.jsx)(`p`,{children:e.detail??n(`web.ui.cap.import_done`,{count:e.imported.length,skipped:e.skipped.length})})}),e.imported.length>0&&(0,P.jsx)(`ul`,{className:`skimport__names`,children:e.imported.map(e=>(0,P.jsx)(`li`,{children:e},e))}),(0,P.jsx)(by,{issues:e.skipped,title:n(`web.ui.cap.import_skipped`)}),(0,P.jsx)(`div`,{className:`skimport__act`,children:(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:t,children:n(`web.ui.cap.import_again`)})})]})}function by({issues:e,title:t}){return e.length===0?null:(0,P.jsxs)(`div`,{className:`skimport__issues`,children:[(0,P.jsx)(`p`,{className:`skimport__issues-head`,children:t}),(0,P.jsx)(`ul`,{children:e.map((e,t)=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`code`,{children:e.path}),(0,P.jsx)(`span`,{children:e.message})]},`${e.path}-${t}`))})]})}function xy(e){let t=e?.detail;return typeof t==`string`&&t.length>0?t:e instanceof Error?e.message:String(e)}var Sy=[{scope:`user`,title:`web.ui.cap.g_user`,note:`web.ui.cap.g_user_skills`},{scope:`plugin`,title:`web.ui.cap.g_plugin`,note:`web.ui.cap.g_plugin_skills`},{scope:`host`,title:`web.ui.cap.g_host`,note:`web.ui.cap.g_host_skills`},{scope:`project`,title:`web.ui.cap.g_project`,note:`web.ui.cap.g_project_skills`}];function Cy({skills:e,project:t,client:n,sessionId:r,onWrote:i,nativeDirPicker:a}){let o=F(),[s,c]=v.useState(),[l,u]=v.useState(!1),[d,f]=v.useState(),p=n!==void 0&&r!==void 0,m=n!==void 0&&i!==void 0,h=e.filter(e=>e.residency===`capped`).length,g=e.filter(e=>e.residency===`role`).length;return s!==void 0&&n&&r?(0,P.jsx)(Ty,{client:n,sessionId:r,name:s,onBack:()=>c(void 0)}):l&&n&&i?(0,P.jsx)(hy,{client:n,onBack:()=>u(!1),onImported:i,...a===void 0?{}:{nativeDirPicker:a}}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`cap__lede`,children:o(`web.ui.cap.skills_lede`)}),h>0&&(0,P.jsxs)(`p`,{className:`note`,"data-testid":`skills-capped-note`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`info`,size:`sm`})}),(0,P.jsx)(`span`,{children:o(`web.ui.cap.skills_capped_note`,{count:h})})]}),g>0&&(0,P.jsxs)(`p`,{className:`note`,"data-testid":`skills-role-note`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`info`,size:`sm`})}),(0,P.jsx)(`span`,{children:o(`web.ui.cap.skills_role_note`,{count:g})})]}),m&&(0,P.jsx)(`div`,{className:`skimport__entry`,children:(0,P.jsxs)(`button`,{className:`btn btn--sm`,type:`button`,onClick:()=>u(!0),children:[(0,P.jsx)(I,{name:`plus`,size:`sm`}),o(`web.ui.cap.import_entry`)]})}),d&&(0,P.jsxs)(`div`,{className:`note-block skills__removed`,"data-testid":`skill-removed-note`,children:[(0,P.jsx)(`p`,{children:o(`web.ui.cap.skill_removed`,{name:d.name})}),(0,P.jsx)(`p`,{children:(0,P.jsx)(`code`,{children:d.path})})]}),Sy.map(r=>{let a=e.filter(e=>e.scope===r.scope),s=r.scope===`project`&&t.root!==null&&!t.trusted;return a.length===0&&!s?null:(0,P.jsx)(xv,{title:o(r.title),note:o(r.note),...r.scope===`user`?{tip:o(`web.ui.cap.no_toggle`)}:{},trust:r.scope===`project`&&t.root!==null?t:null,children:s?(0,P.jsx)(Ey,{root:t.root??``}):(0,P.jsx)(`ul`,{className:`slots`,...p||m&&r.scope===`user`?{"data-act":``}:{},children:a.map(e=>(0,P.jsx)(wy,{skill:e,...p?{onView:()=>c(e.name)}:{},...m&&r.scope===`user`&&n&&i?{remove:{client:n,onRemoved:t=>{f({name:e.name,path:t}),i()}}}:{}},`${e.category}/${e.name}`))})},r.scope)})]})}function wy({skill:e,onView:t,remove:n}){let r=F(),[i,a]=v.useState(!1),[o,s]=v.useState(!1),[c,l]=v.useState();return(0,P.jsxs)(`li`,{className:`slot`,children:[(0,P.jsxs)(`span`,{className:`slot__path`,children:[(0,P.jsxs)(`i`,{children:[e.category,`/`]}),(0,P.jsx)(`b`,{children:e.name})]}),(0,P.jsxs)(`span`,{className:`slot__desc`,children:[i?(0,P.jsx)(`b`,{className:`skill__ask`,children:r(`web.ui.cap.skill_remove_ask`,{name:e.name})}):e.description,c!==void 0&&(0,P.jsx)(`b`,{className:`skill__err`,children:c})]}),(0,P.jsx)(`span`,{className:`slot__stat`,"data-residency":e.residency,children:e.residency===`indexed`?r(`web.ui.cap.skill_tokens`,{tokens:e.tokens}):r(`web.ui.cap.skill_unindexed`)}),(t||n)&&(0,P.jsx)(`span`,{className:`slot__act`,children:i?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`button`,{className:`btn btn--sm`,type:`button`,disabled:o,onClick:()=>{!n||o||(s(!0),l(void 0),n.client.removeSkill(e.name).then(e=>{if(e.ok)return n.onRemoved(e.path??``);l(e.detail??``),a(!1)}).catch(e=>{l(e instanceof Error?e.message:String(e)),a(!1)}).finally(()=>s(!1)))},children:r(`web.ui.cap.skill_remove_yes`)}),(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:()=>a(!1),children:r(`web.ui.cap.skill_cancel`)})]}):(0,P.jsxs)(P.Fragment,{children:[t&&(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:t,children:r(`web.ui.cap.skill_view`)}),n&&(0,P.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:()=>a(!0),children:r(`web.ui.cap.skill_remove`)})]})})]})}function Ty({client:e,sessionId:t,name:n,onBack:r}){let i=F(),[a,o]=v.useState(),[s,c]=v.useState();return v.useEffect(()=>{let r=!0;return o(void 0),c(void 0),e.skillBody(t,n).then(e=>{r&&o({text:e.body,truncated:e.truncated,bytes:e.bytes})}).catch(e=>{r&&c(e instanceof Error?e.message:String(e))}),()=>{r=!1}},[e,t,n]),(0,P.jsxs)(`div`,{className:`skillbody`,children:[(0,P.jsxs)(`div`,{className:`skillbody__head`,children:[(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:r,children:[(0,P.jsx)(I,{name:`arrow-left`,size:`sm`}),i(`web.ui.cap.skill_back`)]}),(0,P.jsx)(`b`,{className:`skillbody__name`,children:n})]}),(0,P.jsx)(`p`,{className:`skillbody__note`,children:i(`web.ui.cap.skill_view_no_count`)}),s===void 0?a===void 0?(0,P.jsx)(`p`,{className:`cap__foot`,children:i(`web.ui.cap.loading`)}):(0,P.jsxs)(P.Fragment,{children:[a.truncated&&(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,P.jsx)(`p`,{children:i(`web.ui.cap.skill_truncated`,{bytes:a.bytes})})}),(0,P.jsx)(Mg,{text:a.text}),(0,P.jsx)(`p`,{className:`skillbody__size`,children:i(`web.ui.cap.skill_bytes`,{bytes:a.bytes})})]}):(0,P.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:s})]})]})}function Ey({root:e}){let t=F();return(0,P.jsxs)(`div`,{className:`locked`,children:[(0,P.jsx)(`p`,{className:`locked__line`,children:t(`web.ui.cap.locked_line`)}),(0,P.jsx)(`p`,{className:`locked__why`,children:t(`web.ui.cap.locked_why`)}),(0,P.jsx)(`p`,{className:`locked__why`,children:t(`web.ui.cap.locked_gate`)}),(0,P.jsx)(`div`,{className:`locked__act`,children:(0,P.jsx)(bv,{cmd:`epoch trust add ${e}`})})]})}var Dy=[{id:`experts`,icon:`user-round`,title:`web.ui.cap.experts`},{id:`skills`,icon:`sparkles`,title:`web.ui.cap.skills`},{id:`connectors`,icon:`blocks`,title:`web.ui.cap.connectors`},{id:`plugins`,icon:`layers`,title:`web.ui.cap.plugins`}];function Oy(e){return Dy.find(t=>t.id===e)?.title??``}function ky({client:e,sessionId:t,tab:n,onBack:r,sidebar:i,onSummon:a,onTakeOver:o,pinnedRole:s,canSummon:c,newSession:l,lanExposed:u,nativeDirPicker:d}){let f=F(),[p,m]=v.useState(``),[h,g]=v.useState(),[_,y]=v.useState(),[b,x]=v.useState(0);v.useEffect(()=>{if(!t)return;let n=!0;return y(void 0),e.capabilities(t).then(e=>{n&&g(e)}).catch(e=>{n&&y(e instanceof Error?e.message:String(e))}),()=>{n=!1}},[e,t,b]);let S=n===`experts`?h?.roles.length:n===`skills`?h?.skills.length:n===`connectors`?h&&h.builtinConnectors.length+h.mcpServers.length:void 0;return(0,P.jsxs)(`section`,{className:`panelcol`,children:[(0,P.jsxs)(`div`,{className:`panelcol__head`,children:[i&&(0,P.jsx)(`button`,{className:`btn btn--ghost btn--icon panelcol__nav`,type:`button`,"aria-pressed":i.open,"aria-label":f(`web.ui.topbar.sidebar`),title:f(`web.ui.topbar.sidebar`),onClick:i.onToggle,children:(0,P.jsx)(I,{name:`panel-right`})}),(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--sm cap__back`,type:`button`,onClick:r,children:[(0,P.jsx)(I,{name:`arrow-left`,size:`sm`}),f(`web.ui.cap.back`)]}),(0,P.jsx)(`h1`,{className:`panelcol__title`,children:f(Oy(n))}),(0,P.jsx)(`span`,{className:`panelcol__n`,children:S??``}),(0,P.jsxs)(`label`,{className:`cap__search`,children:[(0,P.jsx)(I,{name:`search`,size:`sm`}),(0,P.jsx)(`input`,{type:`search`,value:p,onChange:e=>m(e.target.value),placeholder:f(`web.ui.cap.search`),"aria-label":f(`web.ui.cap.search`)})]})]}),(0,P.jsx)(`div`,{className:`panelcol__body`,children:(0,P.jsx)(`div`,{className:`cap__pane`,children:(0,P.jsx)(Ay,{onWrote:()=>x(e=>e+1),tab:n,query:p.trim().toLowerCase(),data:h,..._===void 0?{}:{error:_},client:e,...t===void 0?{}:{sessionId:t},onSummon:a,onTakeOver:o,...s===void 0?{}:{pinnedRole:s},canSummon:c,...l?{newSession:l}:{},lanExposed:u,...d===void 0?{}:{nativeDirPicker:d}})})})]})}function Ay({tab:e,query:t,data:n,error:r,client:i,sessionId:a,onSummon:o,onTakeOver:s,pinnedRole:c,canSummon:l,newSession:u,onWrote:d,lanExposed:f,nativeDirPicker:p}){let m=F();if(e===`plugins`)return(0,P.jsx)(ny,{client:i,query:t,lanExposed:f,...p===void 0?{}:{nativeDirPicker:p}});if(a===void 0)return(0,P.jsx)(`p`,{className:`cap__foot`,children:m(`web.ui.cap.no_session`)});if(r)return(0,P.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:r})]});if(!n)return(0,P.jsx)(`p`,{className:`cap__foot`,children:m(`web.ui.cap.loading`)});if(e===`experts`){let e=n.roles.filter(e=>jy(t,e.name,e.description)||(e.tools??[]).some(e=>jy(t,e))||e.toolsCut.some(e=>jy(t,e)));return(0,P.jsx)(Kv,{roles:e,project:n.project,onSummon:o,onTakeOver:s,...c===void 0?{}:{pinnedRole:c},canSummon:l,...u?{newSession:u}:{},client:i,lanExposed:f,onCreated:d})}if(e===`skills`){let e=n.skills.filter(e=>jy(t,e.name,e.category,e.description));return(0,P.jsx)(Cy,{skills:e,project:n.project,client:i,sessionId:a,onWrote:d,...p===void 0?{}:{nativeDirPicker:p}})}return(0,P.jsx)(Bv,{builtin:n.builtinConnectors.filter(e=>jy(t,e.name)),mcp:n.mcpServers.filter(e=>jy(t,e.name)),client:i,lanExposed:f})}function jy(e,...t){return!e||t.some(t=>t.toLowerCase().includes(e))}var My=[],Ny=[];function Py(e){return e.length===0?Ny:e.map(e=>({kind:`prompt`,name:e.name,description:e.description,...e.argumentHint===void 0?{}:{argumentHint:e.argumentHint}}))}function Fy(e,t){let[n,r]=v.useState(My);return v.useEffect(()=>{if(!e||!t){r(My);return}let n=!0;return e.commands(t).then(e=>{n&&r(e.commands)}).catch(()=>{n&&r(My)}),()=>{n=!1}},[e,t]),n}function Iy(e,t){if(!t.startsWith(`/`)||t.includes(`
|
|
372
|
+
`))return Ny;let n=t.slice(1);if(/\s/.test(n))return Ny;let r=n.toLowerCase();return r?e.filter(e=>e.name.startsWith(r)):e}function Ly(e,t){return e.length===0?t:t.length===0?e:[...e,...t]}function Ry(e){return`/${e.name} `}function zy(e){return`cmdopt-${e}`}var By=`cmdpalette`;function Vy({matched:e,activeIndex:t,onPick:n,onHover:r}){let i=F();return(0,P.jsx)(`ul`,{id:By,className:`cmdpalette`,role:`listbox`,"aria-label":i(`web.ui.composer.commands_label`),children:e.map((e,i)=>(0,P.jsxs)(`li`,{id:zy(e.name),role:`option`,"aria-selected":i===t,className:`cmdpalette__row`,"data-active":i===t?`on`:void 0,"data-kind":e.kind,onMouseDown:t=>{t.preventDefault(),n(e)},onMouseEnter:()=>r(i),children:[(0,P.jsxs)(`span`,{className:`cmdpalette__name`,children:[`/`,e.name]}),e.kind===`prompt`&&e.argumentHint&&(0,P.jsx)(`span`,{className:`cmdpalette__hint`,children:e.argumentHint}),(0,P.jsx)(`span`,{className:`cmdpalette__desc`,children:e.description})]},e.name))})}function Hy(e,t){return t.ran?t.after>=t.before?{command:`compact`,text:e(`web.ui.cmd.compact_no_change`,{n:t.before}),pending:!1,tone:`warn`}:{command:`compact`,text:e(`web.ui.cmd.compact_done`,{before:t.before,after:t.after}),pending:!1,tone:`ok`}:{command:`compact`,text:t.reason??e(`web.ui.cmd.compact_not_run`),pending:!1,tone:`warn`}}function Uy(e){let{client:t,sessionId:n,readOnly:r,busy:i,t:a,openContextPane:o,setNotice:s}=e;if(!t||n===void 0||r)return Ny;let c=[{kind:`action`,name:`context`,description:a(`web.ui.cmd.context_desc`),run:o}];return i||c.push({kind:`action`,name:`compact`,description:a(`web.ui.cmd.compact_desc`),run:()=>{s({command:`compact`,text:a(`web.ui.cmd.compact_running`),pending:!0,tone:`ok`}),t.compact(n).then(e=>s(Hy(a,e))).catch(()=>{s({command:`compact`,text:a(`web.ui.cmd.compact_failed`),pending:!1,tone:`warn`})})}}),c}var Wy=4194304,Gy=16777216,Ky=64,qy=64;function Jy(e,t){let n=qy;for(let e of t)n+=e.bytes+(e.part.mediaType?.length??0)+Ky;if(!e)return n;n+=Ky;let r=n+e.length*6;return r<=16777216?r:n+new TextEncoder().encode(JSON.stringify(e)).length}function Yy(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`read failed`)),r.onload=()=>t(String(r.result)),r.readAsDataURL(e)})}async function Xy(e,t,n=[]){let r=[],i=n.map(e=>t(`web.ui.composer.reject_directory`,{name:e}));for(let n of e){if(!n.type.startsWith(`image/`)){i.push(t(`web.ui.composer.reject_not_image`,{name:n.name}));continue}if(n.size>4194304){i.push(t(`web.ui.composer.reject_too_big`,{name:n.name,size:Math.round(n.size/1024/1024),max:Math.round(Wy/1024/1024)}));continue}try{let e=await Yy(n);r.push({name:n.name,bytes:e.length,part:{type:`image`,image:e,mediaType:n.type}})}catch{i.push(t(`web.ui.composer.reject_unreadable`,{name:n.name}))}}return{ok:r,rejected:i}}function Zy({disabled:e,onPick:t}){let n=F(),r=v.useRef(null);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`button`,{type:`button`,className:`btn btn--icon`,disabled:e,"aria-label":n(`web.ui.composer.attach`),title:n(`web.ui.composer.attach`),onClick:()=>r.current?.click(),children:(0,P.jsx)(I,{name:`plus`})}),(0,P.jsx)(`input`,{ref:r,type:`file`,accept:`image/*`,multiple:!0,hidden:!0,onChange:e=>{t([...e.target.files??[]]),e.target.value=``}})]})}function Qy({attachments:e,reading:t=[],showBytes:n=!1,onRemove:r}){let i=F();return e.length===0&&t.length===0?null:(0,P.jsxs)(`div`,{className:`shots`,children:[e.map((e,t)=>(0,P.jsxs)(`figure`,{className:`shot`,title:e.name,children:[(0,P.jsx)(`img`,{className:`shot__img`,src:e.part.image,alt:e.name}),n&&(0,P.jsx)(`figcaption`,{className:`shot__size`,children:Jr(e.bytes)}),(0,P.jsx)(`button`,{type:`button`,className:`shot__x`,"aria-label":i(`web.ui.composer.remove_attach`,{name:e.name}),onClick:()=>r(t),children:(0,P.jsx)(I,{name:`x`,size:`sm`})})]},`${e.name}-${t}`)),t.map((e,t)=>(0,P.jsxs)(`div`,{className:`shot shot--reading`,title:e,children:[(0,P.jsx)(`span`,{className:`shot__spin`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`shot__name`,children:e}),(0,P.jsx)(`span`,{className:`shot__note`,children:i(`web.ui.composer.reading`)})]},`reading-${e}-${t}`))]})}var $y={text:``,attachments:[],rejected:[],reading:[],paletteClosed:!1};function eb(e){return e.text===``&&e.attachments.length===0&&e.rejected.length===0&&e.reading.length===0&&!e.paletteClosed}function tb(e,t){return e.trim()?`${e.trimEnd()}\n${t}`:t}function nb(e,t,n){return{...e,reading:t.length>0?e.reading.filter(e=>e!==t):e.reading,attachments:[...e.attachments,...n.ok],rejected:n.rejected.length>0?[...new Set([...e.rejected,...n.rejected])]:e.rejected}}function rb(e){let t=e.text.trim();if(!(!t&&e.attachments.length===0))return e.attachments.length===0?t:[...t?[{type:`text`,text:t}]:[],...e.attachments.map(e=>e.part)]}function ib(e){let[t,n]=v.useState(()=>new Map),r=v.useCallback((e,t)=>{n(n=>{let r=t(n.get(e)??$y),i=new Map(n);return eb(r)?i.delete(e):i.set(e,r),i})},[]),i=v.useCallback(t=>r(e,t),[r,e]);return{slot:t.get(e)??$y,patch:r,here:i}}function ab(e){let t=F(),{slot:n,patch:r,here:i}=ib(e),a=v.useCallback(e=>i(t=>({...t,text:e})),[i]),o=v.useCallback(e=>i(t=>({...t,text:tb(t.text,e)})),[i]),s=v.useCallback((n,i=[])=>{if(n.length===0&&i.length===0)return;let a=e,o=n.map(e=>e.name);o.length>0&&r(a,e=>({...e,reading:[...e.reading,o]})),Xy(n,t,i).then(e=>{r(a,t=>nb(t,o,e))})},[r,e,t]),c=v.useCallback(e=>i(t=>({...t,attachments:t.attachments.filter((t,n)=>n!==e)})),[i]),l=v.useCallback(()=>i(e=>({...e,rejected:[]})),[i]),u=v.useCallback(e=>i(t=>({...t,paletteClosed:e})),[i]),d=v.useCallback(()=>i(e=>({...$y,reading:e.reading})),[i]),f=v.useMemo(()=>Jy(n.text,n.attachments),[n.text,n.attachments]),p=v.useCallback(()=>rb(n),[n]);return v.useMemo(()=>({...n,bytes:f,oversize:f>Gy,setText:a,append:o,pick:s,removeAttachment:c,dismissRejected:l,setPaletteClosed:u,toMessage:p,sent:d}),[n,f,a,o,s,c,l,u,p,d])}function ob(e){let t=[],n=[],r=Array.from(e?.items??[]).filter(e=>e.kind===`file`);for(let[i,a]of[...e?.files??[]].entries())r[i]?.webkitGetAsEntry?.()?.isDirectory?n.push(a.name):t.push(a);return{files:t,directories:n}}var sb=new Set([`text/plain`,`text/html`]),cb=[`dragenter`,`dragover`,`drop`];function lb(e){let t=Array.from(e?.types??[]);return t.length===0||t.some(e=>!sb.has(e))}function ub({onFiles:e,disabled:t=!1}){let n=v.useRef(0),[r,i]=v.useState(!1),a=()=>{n.current=0,i(!1)};return v.useEffect(()=>{let e=e=>{e.defaultPrevented||lb(e.dataTransfer)&&e.preventDefault()};for(let t of cb)window.addEventListener(t,e);return()=>{for(let t of cb)window.removeEventListener(t,e)}},[]),{active:r&&!t,zone:{onDragEnter:e=>{e.preventDefault(),n.current+=1,i(!0)},onDragOver:e=>e.preventDefault(),onDragLeave:()=>{--n.current,n.current<=0&&a()},onDrop:n=>{n.preventDefault(),a(),!t&&e(ob(n.dataTransfer))}}}}function db(){let e=F();return(0,P.jsx)(`div`,{className:`dropzone`,role:`status`,children:(0,P.jsxs)(`span`,{className:`dropzone__box`,children:[(0,P.jsx)(I,{name:`plus`,size:`sm`}),e(`web.ui.composer.drop_hint`)]})})}function fb(e){let[t,n]=v.useState(()=>new Map),r=v.useCallback(t=>{n(n=>n.get(e)===t?n:new Map(n).set(e,t))},[e]),i=v.useCallback(()=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[e]),a=t.get(e);return v.useMemo(()=>({role:a,pin:r,clear:i}),[a,r,i])}function pb({role:e,onClear:t}){let n=F();return(0,P.jsxs)(`span`,{className:`xchip`,title:n(`web.ui.composer.expert_chip_title`,{role:e}),children:[(0,P.jsx)(`button`,{className:`xchip__x`,type:`button`,"aria-label":n(`web.ui.composer.expert_remove`,{role:e}),onClick:t,children:(0,P.jsx)(I,{name:`x`,size:`sm`})}),e]})}var mb=`refpalette`;function hb(e){return`refopt-${e}`}function gb(e){return e?e.split(/[\\/]/).filter(Boolean).pop()??e:``}function _b(e,t){let n=new Date(e),r=new Date(t).toDateString()===n.toDateString(),i=e=>String(e).padStart(2,`0`);return r?`${i(n.getHours())}:${i(n.getMinutes())}`:`${n.getMonth()+1}/${n.getDate()}`}function vb({candidates:e,activeIndex:t,onPick:n,onHover:r}){let i=F(),a=Date.now();return(0,P.jsxs)(`ul`,{id:mb,className:`cmdpalette`,role:`listbox`,"aria-label":i(`web.ui.mention.palette_label`),children:[(0,P.jsx)(`li`,{className:`cmdpalette__group`,role:`presentation`,children:i(`web.ui.mention.group_sessions`)}),e.map((e,o)=>(0,P.jsxs)(`li`,{id:hb(e.sessionId),role:`option`,"aria-selected":o===t,className:`cmdpalette__row`,"data-active":o===t?`on`:void 0,onMouseDown:t=>{t.preventDefault(),n(e)},onMouseEnter:()=>r(o),children:[(0,P.jsx)(`span`,{className:`refopt__title`,children:e.title}),(0,P.jsx)(`span`,{className:`refopt__meta`,children:e.sameWorkspace?i(`web.ui.mention.candidate_here`,{when:_b(e.updatedAt,a),count:e.messageCount}):i(`web.ui.mention.candidate_elsewhere`,{when:_b(e.updatedAt,a),count:e.messageCount,where:gb(e.cwd)})})]},e.sessionId))]})}var yb=`filepalette`;function bb(e){return`fileopt-${e}`}function xb(e){let t=e.split(`/`),n=t[t.length-1]??e,r=t.slice(0,-1).join(`/`);return{title:n,dir:r===``?null:r}}function Sb({candidates:e,activeIndex:t,onPick:n,onHover:r,unmentionable:i,truncated:a}){let o=F();return(0,P.jsxs)(`ul`,{id:yb,className:`cmdpalette`,role:`listbox`,"aria-label":o(`web.ui.mention.file_palette_label`),children:[(0,P.jsx)(`li`,{className:`cmdpalette__group`,role:`presentation`,children:o(`web.ui.mention.group_files`)}),e.map((e,i)=>{let{title:a,dir:o}=xb(e.path);return(0,P.jsxs)(`li`,{id:bb(e.path),role:`option`,"aria-selected":i===t,className:`cmdpalette__row`,"data-active":i===t?`on`:void 0,onMouseDown:t=>{t.preventDefault(),n(e)},onMouseEnter:()=>r(i),children:[(0,P.jsx)(`span`,{className:`refopt__title`,children:a}),o!==null&&(0,P.jsx)(`span`,{className:`refopt__meta`,children:o})]},e.path)}),i>0&&(0,P.jsx)(`li`,{className:`cmdpalette__group`,role:`presentation`,children:o(`web.ui.mention.file_unmentionable`,{count:i})}),a&&(0,P.jsx)(`li`,{className:`cmdpalette__group`,role:`presentation`,children:o(`web.ui.mention.file_truncated`)})]})}var Cb=`@:`;function wb(e){let t=-1;for(let n=e.length-1;n>=0;n--){let r=e[n]??``;if(/\s/.test(r))return-1;if(r===`@`){t=n;break}}if(t===-1)return-1;let n=t===0?``:e[t-1]??``;return n!==``&&!/\s/.test(n)?-1:t}function Tb(e,t){let n=e.slice(0,Math.max(0,Math.min(t,e.length))),r=wb(n);return r===-1||!n.startsWith(Cb,r)?null:{at:r,query:n.slice(r+2)}}function Eb(e,t){let n=e.slice(0,Math.max(0,Math.min(t,e.length))),r=wb(n);return r===-1||n.startsWith(Cb,r)?null:{at:r,query:n.slice(r+1)}}function Db(e,t,n){let r=`${e.slice(0,t.at)}${Cb}${n} `;return{text:`${r}${e.slice(t.at+2+t.query.length)}`,caret:r.length}}function Ob(e,t,n){let r=`${e.slice(0,t.at)}@${n} `;return{text:`${r}${e.slice(t.at+1+t.query.length)}`,caret:r.length}}var kb=[];function Ab(e,t){return jb(e,t,kb)}function jb(e,t,n){let[r,i]=v.useState(n);return v.useEffect(()=>{if(!e||t===null){i(n);return}let r=!0,a=setTimeout(()=>{e(t).then(e=>{r&&i(e)}).catch(()=>{r&&i(n)})},120);return()=>{r=!1,clearTimeout(a)}},[e,t,n]),r}var Mb={candidates:[],unmentionable:0,truncated:!1};function Nb(e,t){return jb(e,t,Mb)}var Pb={idle:`web.ui.composer.placeholder_idle`,running:`web.ui.composer.placeholder_running`,"awaiting-approval":`web.ui.composer.placeholder_approval`,"awaiting-question":`web.ui.composer.placeholder_question`},Fb={"no-provider":`web.ui.composer.placeholder_no_provider`,history:`web.ui.composer.placeholder_history`,gone:`web.ui.composer.placeholder_gone`},Ib=[],Lb={session:`web.ui.composer.usage_session`,run:`web.ui.composer.usage_run`};function Rb(e){let t=e.turn===`awaiting-approval`||e.turn===`awaiting-question`;return!!e.disabled||!!e.readOnly||t||e.connection!==`open`}function zb({draft:e,turn:t,sending:n,connection:r,disabled:i=!1,readOnly:a=!1,prefill:o,onPrefillDone:s,commands:c=My,builtins:l=Ny,commandNotice:u,builtinNotice:d,dropped:f,onDroppedDone:p,expert:m,usage:h,listSessionCandidates:g,listFileCandidates:_,onSend:y}){let b=F(),[x,S]=v.useState(!1),[C,w]=v.useState(0),[ee,te]=v.useState(0),[ne,T]=v.useState(0),[re,ie]=v.useState(0),ae=v.useRef(!1),oe=v.useRef(null),{append:ce,pick:le,setText:E}=e;v.useEffect(()=>{if(!o)return;o.replace===!0?E(o.text):ce(o.text);let e=oe.current,t=e&&requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(e.value.length,e.value.length)});return s?.(),()=>{t&&cancelAnimationFrame(t)}},[o,s,ce,E]);let D=e.reading.length>0;v.useEffect(()=>{if(!D){S(!1);return}let e=setTimeout(()=>S(!0),250);return()=>clearTimeout(e)},[D]);let ue=r!==`open`,de=Rb({turn:t,connection:r,disabled:i,readOnly:a}),O=Iy(v.useMemo(()=>Ly(l,Py(c)),[l,c]),e.text),fe=!de&&!e.paletteClosed&&O.length>0,pe=Math.min(C,O.length-1),k=O[pe],me=Tb(e.text,re),he=Ab(g,me===null?null:me.query),ge=!de&&!e.paletteClosed&&me!==null&&he.length>0,A=Math.min(ee,he.length-1),_e=he[A],j=Eb(e.text,re),ve=Nb(_,j===null?null:j.query),M=!de&&!e.paletteClosed&&j!==null&&ve.candidates.length>0,ye=Math.min(ne,ve.candidates.length-1),be=ve.candidates[ye],xe=t=>{let n=O.find(e=>e.name===t);if(n){if(n.kind===`action`){e.setText(``),e.setPaletteClosed(!1),w(0),oe.current?.focus(),n.run();return}e.setText(Ry(n)),w(0),oe.current?.focus()}},Se=t=>{if(!me)return;let n=Db(e.text,me,t);e.setText(n.text),ie(n.caret),te(0);let r=oe.current;r&&requestAnimationFrame(()=>{r.focus(),r.setSelectionRange(n.caret,n.caret)})},Ce=t=>{if(!j)return;let n=Ob(e.text,j,t);e.setText(n.text),ie(n.caret),T(0);let r=oe.current;r&&requestAnimationFrame(()=>{r.focus(),r.setSelectionRange(n.caret,n.caret)})},we=()=>{if(de||e.oversize)return;let t=e.toMessage();t!==void 0&&(y(t),e.sent())},Te=t=>{if(!(ae.current||t.nativeEvent.isComposing)){if(fe&&k){let n=O.length;if(t.key===`ArrowDown`)return t.preventDefault(),w(e=>(Math.min(e,n-1)+1)%n);if(t.key===`ArrowUp`)return t.preventDefault(),w(e=>(Math.min(e,n-1)-1+n)%n);if(t.key===`Escape`)return t.preventDefault(),e.setPaletteClosed(!0);if(t.key===`Tab`||t.key===`Enter`&&!t.shiftKey)return t.preventDefault(),xe(k.name)}if(ge&&_e&&me){let n=he.length;if(t.key===`ArrowDown`)return t.preventDefault(),te(e=>(Math.min(e,n-1)+1)%n);if(t.key===`ArrowUp`)return t.preventDefault(),te(e=>(Math.min(e,n-1)-1+n)%n);if(t.key===`Escape`)return t.preventDefault(),e.setPaletteClosed(!0);if(t.key===`Tab`||t.key===`Enter`&&!t.shiftKey)return t.preventDefault(),Se(_e.sessionId)}if(M&&be&&j){let n=ve.candidates.length;if(t.key===`ArrowDown`)return t.preventDefault(),T(e=>(Math.min(e,n-1)+1)%n);if(t.key===`ArrowUp`)return t.preventDefault(),T(e=>(Math.min(e,n-1)-1+n)%n);if(t.key===`Escape`)return t.preventDefault(),e.setPaletteClosed(!0);if(t.key===`Tab`||t.key===`Enter`&&!t.shiftKey)return t.preventDefault(),Ce(be.path)}t.key!==`Enter`||t.shiftKey||(t.preventDefault(),we())}};v.useEffect(()=>{f&&(le(f.files,f.directories),p?.())},[f,p,le]);let Ee=e=>{de||le([...e.clipboardData?.files??[]])},N=i?`web.ui.composer.placeholder_no_session`:a?Fb[a]:ue?`web.ui.composer.placeholder_offline`:Pb[t];return(0,P.jsxs)(`form`,{className:`composer`,"aria-disabled":de,"aria-busy":D,onSubmit:e=>{e.preventDefault(),we()},children:[fe&&(0,P.jsx)(Vy,{matched:O,activeIndex:pe,onPick:e=>xe(e.name),onHover:w}),ge&&(0,P.jsx)(vb,{candidates:he,activeIndex:A,onPick:e=>Se(e.sessionId),onHover:te}),M&&(0,P.jsx)(Sb,{candidates:ve.candidates,activeIndex:ye,onPick:e=>Ce(e.path),onHover:T,unmentionable:ve.unmentionable,truncated:ve.truncated}),(0,P.jsx)(Qy,{attachments:e.attachments,reading:x?e.reading.flat():Ib,showBytes:e.oversize,onRemove:e.removeAttachment}),(0,P.jsx)(`textarea`,{ref:oe,className:`composer__input`,value:e.text,rows:2,disabled:de,placeholder:b(N),"aria-label":b(`web.ui.composer.label`),role:`combobox`,"aria-expanded":fe||ge||M,"aria-controls":M?yb:ge?mb:By,"aria-autocomplete":`list`,...fe&&k?{"aria-activedescendant":zy(k.name)}:{},...ge&&_e?{"aria-activedescendant":hb(_e.sessionId)}:{},...M&&be?{"aria-activedescendant":bb(be.path)}:{},onChange:t=>{let n=t.target.value;e.setText(n),w(0),te(0),T(0),ie(t.target.selectionStart??0);let r=t.target.selectionStart??0;!n.startsWith(`/`)&&Tb(n,r)===null&&Eb(n,r)===null&&e.setPaletteClosed(!1)},onKeyDown:Te,onKeyUp:e=>ie(e.currentTarget.selectionStart??0),onClick:e=>ie(e.currentTarget.selectionStart??0),onSelect:e=>ie(e.currentTarget.selectionStart??0),onPaste:Ee,onCompositionStart:()=>ae.current=!0,onCompositionEnd:()=>ae.current=!1}),e.rejected.length>0&&(0,P.jsxs)(`div`,{className:`composer__rejects`,role:`status`,children:[(0,P.jsx)(`ul`,{className:`composer__reject`,children:e.rejected.map(e=>(0,P.jsx)(`li`,{children:e},e))}),(0,P.jsx)(`button`,{type:`button`,className:`composer__reject-x`,"aria-label":b(`web.ui.composer.reject_dismiss`),onClick:e.dismissRejected,children:(0,P.jsx)(I,{name:`x`,size:`sm`})})]}),u&&u.warnings.length>0&&(0,P.jsxs)(`ul`,{className:`composer__reject`,role:`status`,children:[(0,P.jsx)(`li`,{className:`composer__notice-head`,children:b(`web.ui.composer.command_warnings`,{name:u.name})}),u.warnings.map(e=>(0,P.jsx)(`li`,{children:e},e))]}),d&&(0,P.jsxs)(`ul`,{className:`composer__reject`,role:`status`,"data-tone":d.tone,children:[(0,P.jsx)(`li`,{className:`composer__notice-head`,children:b(`web.ui.composer.builtin_notice`,{name:d.command})}),(0,P.jsxs)(`li`,{children:[d.pending&&(0,P.jsx)(`span`,{className:`composer__notice-spin`,"aria-hidden":`true`}),d.text]})]}),e.oversize&&(0,P.jsx)(`p`,{className:`composer__oversize`,role:`alert`,children:b(`web.ui.composer.too_big`,{size:Jr(e.bytes),max:Jr(16777216)})}),(0,P.jsxs)(`div`,{className:`composer__bar`,children:[(0,P.jsx)(Zy,{disabled:de,onPick:le}),m?.role!==void 0&&(0,P.jsx)(pb,{role:m.role,onClear:m.clear}),h&&(0,P.jsxs)(`span`,{className:`composer__usage`,title:b(`web.ui.composer.usage_detail`,{scope:b(Lb[h.scope]),up:e_(se(h.tokens)),down:e_(h.tokens.outputTokens)}),children:[(0,P.jsx)(`span`,{className:`composer__usage-scope`,children:b(Lb[h.scope])}),(0,P.jsxs)(`b`,{children:[t_(se(h.tokens)),`↑ `,t_(h.tokens.outputTokens),`↓`]})]}),(t===`running`||n)&&(0,P.jsxs)(`span`,{className:`composer__hint`,children:[(0,P.jsx)(`kbd`,{children:(0,P.jsx)(I,{name:`corner-down-left`})}),` `,b(`web.ui.composer.hint_queue`)]}),(0,P.jsx)(`button`,{type:`submit`,className:`btn btn--primary`,disabled:de||e.oversize||e.toMessage()===void 0,children:b(`web.ui.composer.send`)})]})]})}var Bb={level:null,editable:!1,blocked:[],busy:!1,set:()=>{}};function Vb(e,t,n,r,i){let[a,o]=v.useState(Bb),s=v.useRef(0);v.useEffect(()=>{if(!e||!t){o(Bb);return}let n=!0,r=s.current;return e.permission(t).then(e=>{!n||s.current!==r||o({level:e.level,editable:e.editable,blocked:e.blocked,busy:!1})}).catch(()=>{n&&s.current===r&&o(e=>({...e,editable:!1,busy:!1}))}),()=>{n=!1}},[e,t,n]);let{adopt:c}=r,l=v.useCallback(n=>{!e||!t||(s.current+=1,o(e=>{let{error:t,...n}=e;return{...n,busy:!0}}),e.setPermission(t,n).then(e=>{o({level:e.state.level,editable:e.state.editable,blocked:e.state.blocked,busy:!1,...e.ok?{}:{error:{kind:`refused`,reason:e.refused??`managed`}},...e.notRemembered?{notRemembered:e.notRemembered}:{}}),c(e.state.planMode)}).catch(e=>{o(t=>({...t,busy:!1,error:{kind:`failed`,message:e instanceof Error?e.message:String(e)}}))}))},[e,t,c]);return v.useMemo(()=>({...a,level:a.level??i??null,set:l}),[a,i,l])}var Hb={available:!1,active:!1,from:null,busy:!1,toggle:()=>{},adopt:()=>{}};function Ub(e,t,n){let[r,i]=v.useState(Hb),a=v.useRef(0);v.useEffect(()=>{if(!e||!t){i(Hb);return}let n=!0,r=a.current;return e.plan(t).then(({mode:e})=>{!n||a.current!==r||i({available:e!==null,active:e?.active??!1,from:e?.from??null,busy:!1})}).catch(()=>{n&&a.current===r&&i(Hb)}),()=>{n=!1}},[e,t,n]);let o=v.useCallback(()=>{if(!e||!t)return;let n=r.active?`exit`:`enter`;a.current+=1,i(e=>{let{error:t,...n}=e;return{...n,busy:!0}}),e.planMode(t,n).then(({mode:e})=>{i({available:!0,active:e.active,from:e.from,busy:!1})}).catch(e=>{i(t=>({...t,busy:!1,error:e instanceof Error?e.message:String(e)}))})},[e,t,r.active]),s=v.useCallback(e=>{a.current+=1,i({available:e!==null,active:e?.active??!1,from:e?.from??null,busy:!1})},[]);return v.useMemo(()=>({...r,toggle:o,adopt:s}),[r,o,s])}function Wb({mode:e,readOnly:t=!1}){let n=F();return!e.available||t?null:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,className:`fact fact--toggle`,"aria-pressed":e.active,"data-on":e.active?``:void 0,disabled:e.busy,title:n(e.active?`web.ui.composer.plan_off_hint`:`web.ui.composer.plan_on_hint`),onClick:e.toggle,children:[(0,P.jsx)(I,{name:`list-checks`,size:`sm`}),n(`web.ui.composer.plan_mode`)]}),e.active&&(0,P.jsx)(`span`,{className:`fact fact--plan`,children:n(`web.ui.composer.plan_mode_why`)}),e.error&&(0,P.jsx)(`span`,{className:`fact fact--err`,role:`alert`,children:e.error})]})}function Gb({role:e}){let t=F();return e?(0,P.jsxs)(`span`,{className:`fact`,title:t(`web.ui.composer.identity_title`,{role:e.name}),children:[(0,P.jsx)(I,{name:`user-round`,size:`sm`}),e.name]}):null}var Kb={state:`pending`};function qb(e){return e.state===`bound`?{state:`bound`,workspace:e.workspace}:{state:e.state}}function Jb(e,t,n=`idle`){let[r,i]=v.useState(Kb),[a,o]=v.useState(!1),[s,c]=v.useState(),[l,u]=v.useState(0),d=v.useCallback(n=>{!e||!t||a||(o(!0),c(void 0),e.bindWorkspace(t,n).then(({binding:e})=>{o(!1),i(qb(e))}).catch(e=>{o(!1);let t=e?.detail??(e instanceof Error?e.message:``);c(typeof t==`string`&&t?t:String(e))}))},[a,e,t]);v.useEffect(()=>{if(!e||!t){i(Kb);return}i(Kb),o(!1),c(void 0);let n=!0;return e.sessionWorkspace(t).then(({binding:e})=>{n&&i(qb(e))}).catch(()=>{n&&i({state:`unknown`})}),()=>{n=!1}},[e,t,l]);let f=v.useRef(!0);return v.useEffect(()=>{let e=n===`idle`,t=f.current;f.current=e,!(e||!t)&&r.state===`unknown`&&u(e=>e+1)},[n,r.state]),v.useMemo(()=>r.state===`unbound`?{state:`unbound`,pick:d,busy:a,...s===void 0?{}:{error:s}}:r,[r,d,a,s])}function Yb({view:e,onOpenDiff:t,choices:n=[],client:r,nativeDirPicker:i}){let a=F(),[o,s]=v.useState(!1),c=v.useRef(null),l=v.useCallback(()=>s(!1),[]);if(e.state===`pending`)return null;if(e.state===`unbound`)return(0,P.jsx)(Wt,{view:e,choices:n,open:o,setOpen:s,close:l,triggerRef:c,...r?{client:r}:{},...i===void 0?{}:{nativeDirPicker:i}});let u=e.state===`bound`?e.workspace.root:e.state===`unknown`?a(`web.ui.composer.workspace_unknown_hint`):void 0;return e.state===`bound`&&t?(0,P.jsxs)(`button`,{className:`fact fact--link`,type:`button`,onClick:t,title:`${e.workspace.root}\n${a(`web.ui.composer.workspace_diff_hint`)}`,children:[(0,P.jsx)(I,{name:`layers`,size:`sm`}),e.workspace.name]}):(0,P.jsxs)(`span`,{className:`fact`,...u===void 0?{}:{title:u},children:[(0,P.jsx)(I,{name:`layers`,size:`sm`}),e.state===`bound`?e.workspace.name:a(e.state===`none`?`web.ui.composer.no_workspace`:`web.ui.composer.workspace_unknown`)]})}function Xb({workspace:e=Kb,workspaceChoices:t,nativeDirPicker:n,client:r,onOpenDiff:i,permission:a=Bb,planMode:o=Hb,readOnly:s=!1,role:c}){return(0,P.jsxs)(`div`,{className:`composer__foot`,children:[(0,P.jsx)(Yb,{view:e,...i?{onOpenDiff:i}:{},...t?{choices:t}:{},...r?{client:r}:{},...n===void 0?{}:{nativeDirPicker:n}}),(0,P.jsx)(Gb,{...c===void 0?{}:{role:c}}),(0,P.jsx)(nn,{view:a}),(0,P.jsx)(Wb,{mode:o,readOnly:s})]})}function Zb({kind:e,icon:t,title:n,queue:r,children:i,exits:a}){return(0,P.jsxs)(`div`,{className:`dock`,"data-kind":e,role:`group`,"aria-label":n,children:[(0,P.jsxs)(`div`,{className:`dock__head`,children:[(0,P.jsx)(`span`,{className:`dock__sign`,children:(0,P.jsx)(I,{name:t})}),(0,P.jsx)(`span`,{className:`dock__title`,children:n}),r&&(0,P.jsx)(`span`,{className:`dock__queue`,children:r})]}),(0,P.jsx)(`div`,{className:`dock__body`,children:i}),(0,P.jsx)(`div`,{className:`dock__foot`,children:(0,P.jsx)(`div`,{className:`dock__exits`,children:a})})]})}function Qb({label:e,hint:t,tone:n,primary:r,onClick:i}){return(0,P.jsxs)(`button`,{type:`button`,className:n===`danger`?`btn btn--danger`:n===`primary`?`btn btn--primary`:`btn`,autoFocus:r,onClick:i,children:[e,t&&(0,P.jsx)(`small`,{children:t})]})}function $b(e,t){switch(e){case`file_read`:return t(`web.ui.dock.act_file_read`);case`file_write`:return t(`web.ui.dock.act_file_write`);case`command`:return t(`web.ui.dock.act_command`);case`network`:return t(`web.ui.dock.act_network`);case`code_exec`:return t(`web.ui.dock.act_code_exec`)}}function ex({children:e}){let t=F(),n=v.useRef(null),[r,i]=v.useState(0);return v.useEffect(()=>{let e=n.current;if(!e)return;let t=()=>{let t=parseFloat(getComputedStyle(e).lineHeight),n=e.scrollHeight-e.scrollTop-e.clientHeight;if(!(t>0)||n<=1){i(0);return}i(Math.max(1,Math.round(n/t)))};t(),e.addEventListener(`scroll`,t,{passive:!0});let r=new ResizeObserver(t);return r.observe(e),()=>{e.removeEventListener(`scroll`,t),r.disconnect()}},[e]),(0,P.jsxs)(`dd`,{children:[(0,P.jsx)(`div`,{className:`facts__scroll`,ref:n,children:e}),r>0&&(0,P.jsx)(`span`,{className:`facts__more`,children:t(`web.ui.dock.more_lines`,{count:r})})]})}function tx({request:e,remaining:t,onRespond:n}){let r=F(),i=e.detail&&e.detail!==e.target?e.detail:void 0;return(0,P.jsx)(Zb,{kind:`permission`,icon:`flag`,title:r(`web.ui.dock.title_permission`),...t>0?{queue:r(`web.ui.dock.queue`,{count:t})}:{},exits:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Qb,{label:r(`approval.deny`),tone:`danger`,onClick:()=>n(`deny`)}),(0,P.jsx)(Qb,{label:r(`web.ui.dock.allow_always`),hint:r(`web.ui.dock.allow_always_hint`),onClick:()=>n(`allow-always`)}),(0,P.jsx)(Qb,{label:r(`web.ui.dock.allow_session`),hint:r(`web.ui.dock.allow_session_hint`),onClick:()=>n(`allow-session`)}),(0,P.jsx)(Qb,{label:r(`web.ui.dock.allow_once`),tone:`primary`,primary:!0,onClick:()=>n(`allow-once`)})]}),children:(0,P.jsxs)(`dl`,{className:`facts`,children:[(0,P.jsx)(`dt`,{children:r(`web.ui.dock.fact_action`)}),(0,P.jsxs)(ex,{children:[(0,P.jsx)(`code`,{children:e.toolName}),` `,$b(e.type,r)]}),(0,P.jsx)(`dt`,{children:r(`web.ui.dock.fact_target`)}),(0,P.jsx)(ex,{children:e.target||r(`web.ui.dock.target_none`)}),i&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:r(`web.ui.dock.fact_detail`)}),(0,P.jsx)(ex,{children:i})]}),e.reason&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:r(`web.ui.dock.fact_reason`)}),(0,P.jsx)(ex,{children:(0,P.jsx)(`em`,{children:e.reason})})]})]})})}function nx(e){return e.kind===`schedule`?e.schedule.at:e.goal.goal.updatedAt}function rx(e,t,n){let r=[...e.map(e=>({kind:`schedule`,schedule:e})),...t.filter(e=>e.sessionId!==n).map(e=>({kind:`goal`,goal:e}))].sort((e,t)=>nx(e)-nx(t)),i=r[0];return i?{item:i,more:r.length-1}:null}function ix({item:e,more:t,onFix:n,onOpen:r,onOpenSession:i}){let a=F(),[o,s]=v.useState(!1),c=e.kind===`goal`;return(0,P.jsxs)(`div`,{className:`autobar`,role:`status`,"data-kind":e.kind,children:[(0,P.jsx)(`span`,{className:`autobar__sign`,children:(0,P.jsx)(I,{name:c?`target`:`rotate-ccw`,size:`sm`})}),(0,P.jsx)(`span`,{className:`autobar__who`,children:e.kind===`goal`?a(`web.ui.autobar.goal_blocked`,{title:e.goal.sessionTitle||a(`web.ui.topbar.untitled`)}):a(`web.ui.autobar.pending`,{name:e.schedule.scheduleName,count:e.schedule.approvals.length})}),(0,P.jsx)(`code`,{className:`autobar__rule`,...e.kind===`goal`&&e.goal.goal.block?{title:e.goal.goal.block.message}:{},children:e.kind===`goal`?e.goal.goal.block?.code:e.schedule.approvals[0]?.suggestedRule}),t>0&&(0,P.jsx)(`span`,{className:`autobar__more`,children:a(`web.ui.autobar.more`,{count:t})}),e.kind===`schedule`&&n&&(0,P.jsx)(`button`,{type:`button`,className:`btn btn--primary btn--sm`,disabled:o,onClick:()=>{s(!0),n(e.schedule.scheduleId,e.schedule.runId).finally(()=>s(!1))},children:a(o?`web.ui.autobar.fixing`:`web.ui.autobar.fix`)}),e.kind===`goal`&&i&&(0,P.jsx)(`button`,{type:`button`,className:`btn btn--primary btn--sm`,onClick:()=>i(e.goal.sessionId),children:a(`web.ui.autobar.goal_open`)}),e.kind===`schedule`&&r&&(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,onClick:r,children:a(`web.ui.autobar.open`)})]})}function ax(e,t){return e.updatedAt===t.updatedAt?e.id<t.id?-1:1:e.updatedAt===null?1:t.updatedAt===null?-1:e.updatedAt-t.updatedAt}function ox(e,t){let n=[...e.filter(e=>e.id!==t&&e.pendingApprovals+e.pendingQuestions>0)].sort(ax),r=n[0];return r?{row:r,more:n.length-1}:null}function sx(e){return e.pendingApprovals>0?e.pendingApprovals===1?{key:`web.ui.crossbar.approval_one`,count:1}:{key:`web.ui.crossbar.approval_n`,count:e.pendingApprovals}:e.pendingQuestions===1?{key:`web.ui.crossbar.question_one`,count:1}:{key:`web.ui.crossbar.question_n`,count:e.pendingQuestions}}function cx({pick:e,onOpen:t}){let n=F(),{lang:r}=rt(),{row:i,more:a}=e,o=i.title||n(`web.ui.topbar.untitled`),s=sx(i);return(0,P.jsxs)(`div`,{className:`crossbar`,role:`status`,children:[(0,P.jsx)(`span`,{className:`crossbar__sign`,children:(0,P.jsx)(I,{name:`flag`,size:`sm`})}),(0,P.jsx)(`span`,{className:`crossbar__who`,children:n(s.key,{title:o,count:s.count})}),!i.live&&(0,P.jsx)(`span`,{className:`crossbar__cold`,title:n(`web.ui.crossbar.cold_hint`),children:n(`web.ui.crossbar.cold`)}),i.pendingSince!==null&&(0,P.jsx)(`span`,{className:`crossbar__age`,title:n(`web.ui.crossbar.waited`),children:Ln(i.pendingSince,Date.now(),r)}),a>0&&(0,P.jsx)(`span`,{className:`crossbar__more`,children:n(`web.ui.crossbar.more`,{count:a})}),(0,P.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>t(i.id),children:n(`web.ui.crossbar.go`)})]})}function lx({plan:e,remaining:t,onRespond:n}){let r=F(),[i,a]=v.useState(``),o=()=>{let e=i.trim();e?n(`plan-revise`,e):n(`plan-revise`)};return(0,P.jsxs)(Zb,{kind:`plan`,icon:`list-checks`,title:r(`web.ui.dock.title_plan`),...t>0?{queue:r(`web.ui.dock.queue`,{count:t})}:{},exits:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Qb,{label:r(`approval.deny`),tone:`danger`,onClick:()=>n(`deny`)}),(0,P.jsx)(Qb,{label:r(`approval.plan_revise`),onClick:o}),(0,P.jsx)(Qb,{label:r(`approval.plan_readonly`),hint:e.canExecute?r(`web.ui.dock.plan_readonly_hint`):r(`web.ui.dock.plan_readonly_forced`),onClick:()=>n(`plan-readonly`)}),e.canExecute&&(0,P.jsx)(Qb,{label:r(`approval.plan_execute`),hint:r(`web.ui.dock.plan_execute_hint`,{level:e.previousLevel}),tone:`primary`,primary:!0,onClick:()=>n(`plan-execute`)})]}),children:[(0,P.jsx)(`div`,{className:`dock__plan`,children:(0,P.jsx)(Mg,{text:e.markdown})}),(0,P.jsxs)(`label`,{className:`dock__note`,children:[(0,P.jsx)(`span`,{children:r(`web.ui.dock.note_label`)}),(0,P.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:r(`web.ui.dock.note_placeholder`)})]})]})}function ux(){return{picked:[],free:``}}function dx(e,t){let n=t.free.trim();if(e.multiSelect){let e=n?[...t.picked,n]:t.picked;return e.length>0?e:void 0}return n||t.picked[0]}function fx(e,t){let n={};return e.questions.forEach((e,r)=>{let i=dx(e,t[r]??ux());i!==void 0&&(n[e.question]=i)}),n}function px({item:e,index:t,total:n,draft:r,onChange:i}){let a=F(),o=`q-${t}`,s=t=>{if(!e.multiSelect){i({...r,picked:[t]});return}let n=r.picked.includes(t)?r.picked.filter(e=>e!==t):[...r.picked,t];i({...r,picked:n})};return(0,P.jsxs)(`fieldset`,{className:`question__item`,children:[(0,P.jsxs)(`legend`,{className:`question__legend`,children:[(0,P.jsx)(`span`,{className:`question__chip`,children:e.header.slice(0,12)}),n>1&&(0,P.jsxs)(`span`,{className:`question__ordinal`,children:[t+1,`/`,n]})]}),(0,P.jsx)(`p`,{className:`question__text`,children:e.question}),e.options.map(t=>(0,P.jsxs)(`label`,{className:`question__option`,children:[(0,P.jsx)(`input`,{type:e.multiSelect?`checkbox`:`radio`,name:o,"aria-label":t.label,checked:r.picked.includes(t.label),onChange:()=>s(t.label)}),(0,P.jsx)(`span`,{children:t.label}),t.description&&(0,P.jsx)(`small`,{children:t.description})]},t.label)),(0,P.jsxs)(`label`,{className:`question__free`,children:[(0,P.jsx)(`span`,{children:a(`web.ui.dock.q_free`)}),(0,P.jsx)(`input`,{type:`text`,value:r.free,onChange:e=>i({...r,free:e.target.value}),placeholder:a(`web.ui.dock.q_free_placeholder`)})]})]})}function mx({request:e,remaining:t,onAnswer:n}){let r=F(),i=v.useRef(null),[a,o]=v.useState(()=>e.questions.map(ux));v.useEffect(()=>{o(e.questions.map(ux)),i.current?.querySelector(`input`)?.focus()},[e]);let s=fx(e,a),c=Object.keys(s).length,l=e.questions.length-c;return(0,P.jsx)(Zb,{kind:`question`,icon:`info`,title:r(`web.ui.dock.title_question`),...t>0?{queue:r(`web.ui.dock.queue_questions`,{count:t})}:{},exits:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Qb,{label:r(`web.ui.dock.q_skip`),hint:r(`web.ui.dock.q_skip_hint`),onClick:()=>n(s,!0)}),(0,P.jsx)(Qb,{label:r(`web.ui.dock.q_submit`),...l>0?{hint:r(`web.ui.dock.q_submit_partial`,{count:l})}:{},tone:`primary`,onClick:()=>n(s,l>0)})]}),children:(0,P.jsx)(`div`,{ref:i,className:`question__list`,children:e.questions.map((t,n)=>(0,P.jsx)(px,{item:t,index:n,total:e.questions.length,draft:a[n]??ux(),onChange:e=>o(t=>t.map((t,r)=>r===n?e:t))},t.question))})})}function hx({approvals:e,questions:t,onRespond:n,onAnswer:r,sessions:i,currentSessionId:a,onOpenSession:o,pending:s,onFixPending:c,onOpenAutomation:l,blockedGoals:u}){let d=e[0];if(d){let t=e.length-1,r=d.request.plan;return r?(0,P.jsx)(lx,{plan:r,remaining:t,onRespond:(e,t)=>t===void 0?n(d.requestId,e):n(d.requestId,e,t)}):(0,P.jsx)(tx,{request:d.request,remaining:t,onRespond:e=>n(d.requestId,e)})}let f=t[0];if(f)return(0,P.jsx)(mx,{request:f.request,remaining:t.length-1,onAnswer:(e,t)=>r(f.requestId,e,t)});let p=o?ox(i??[],a):null;if(p&&o)return(0,P.jsx)(cx,{pick:p,onOpen:o});let m=rx(s??[],u??[],a);return m?(0,P.jsx)(ix,{item:m.item,more:m.more,...c?{onFix:c}:{},...l?{onOpen:l}:{},...o?{onOpenSession:o}:{}}):null}var gx={tasks:[],loading:!1};function _x(e,t,n){let[r,i]=v.useState({tasks:[],loading:!0}),a=v.useRef(t);return v.useEffect(()=>{if(a.current!==t&&(a.current=t,i({tasks:[],loading:!0})),!e||!t)return;let n=!0;return e.tasks(t).then(({tasks:e})=>{n&&i({tasks:e,loading:!1})}).catch(e=>{n&&i({tasks:[],loading:!1,error:e instanceof Error?e.message:String(e)})}),()=>{n=!1}},[e,t,n]),r}function vx({tasks:e,loading:t,error:n}){let r=F(),i=e.some(e=>e.info.status===`running`);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`agroup`,children:[(0,P.jsxs)(`h3`,{className:`agroup__title`,children:[r(`web.ui.output.title`),e.length>0&&(0,P.jsx)(`span`,{className:`agroup__n`,children:e.length})]}),n?(0,P.jsx)(L,{tone:`error`,text:n}):e.length===0?(0,P.jsx)(`p`,{className:`empty`,children:r(t?`web.ui.output.loading`:`web.ui.output.empty`)}):null]}),e.map(e=>(0,P.jsx)(yx,{task:e,t:r},e.info.id)),i&&(0,P.jsx)(L,{text:r(`web.ui.output.sampled`)})]})}function yx({task:e,t}){let{info:n}=e,r=xx(n,t);return(0,P.jsxs)(`div`,{className:`agroup`,children:[(0,P.jsxs)(`h3`,{className:`agroup__title tgroup__title`,children:[(0,P.jsx)(`span`,{className:`tgroup__id`,children:n.id}),r!==null&&(0,P.jsx)(`span`,{className:`tgroup__kind`,children:r}),(0,P.jsx)(`code`,{className:`tgroup__cmd`,title:n.label,children:n.label})]}),(0,P.jsxs)(`p`,{className:`tmeta`,children:[(0,P.jsx)(`b`,{"data-state":n.status,children:bx(n,t)}),(0,P.jsxs)(`span`,{children:[`pid `,n.pid]}),(0,P.jsx)(`span`,{children:t(`web.ui.output.dur`,{value:Cx(Sx(n))})}),(0,P.jsx)(`span`,{children:t(`web.ui.output.out_bytes`,{bytes:Jr(n.outputBytes)})})]}),e.output?(0,P.jsx)(`pre`,{className:`tout`,children:e.output}):(0,P.jsx)(`p`,{className:`empty`,children:t(`web.ui.output.no_output`)}),e.omittedBytes>0&&(0,P.jsx)(L,{text:t(`web.ui.output.omitted`,{bytes:Jr(e.omittedBytes)})}),n.truncated&&(0,P.jsx)(L,{text:t(`web.ui.output.truncated`)})]})}function bx(e,t){switch(e.status){case`running`:return t(`web.ui.output.st_running`);case`killed`:return t(`web.ui.output.st_killed`);case`failed`:return t(`web.ui.output.st_failed`);case`closed`:return t(`web.ui.output.st_closed`);case`reaped`:return t(`web.ui.output.st_reaped`);case`exited`:return t(`web.ui.output.st_exited`,{code:e.exitCode??`?`})}}function xx(e,t){return e.kind===`shell`?t(`web.ui.output.kind_shell`):e.kind===`agent`?t(`web.ui.output.kind_agent`):null}function Sx(e){return Math.max(0,(e.endedAt??Date.now())-e.startedAt)}function Cx(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function wx(e){return{total:e.length,running:e.filter(e=>e.info.status===`running`).length}}function Tx(e,t){let n=[],r=(e,t)=>{e.type===`diff`&&n.push({key:t,filePath:e.filePath,...e.oldContent===void 0?{}:{oldContent:e.oldContent},...e.newContent===void 0?{}:{newContent:e.newContent},...e.seq===void 0?{}:{seq:e.seq}})};for(let t of e)r(t,`h${t.id}`);for(let[e,n]of t.entries())r(n,`p${e}`);return n}function Ex({patches:e,onLocate:t}){let n=F(),r=Nr(Pr(e));return e.length===0?(0,P.jsx)(`p`,{className:`empty`,children:n(`web.ui.inspector.no_patch`)}):(0,P.jsx)(`div`,{className:`patches`,children:e.map(e=>(0,P.jsxs)(`div`,{className:`patches__item`,children:[(0,P.jsx)(Xg,{filePath:e.filePath,...e.oldContent===void 0?{}:{oldContent:e.oldContent},...e.newContent===void 0?{}:{newContent:e.newContent}}),e.seq!==void 0&&t&&(0,P.jsx)(Ir,{seq:e.seq,anchored:r(e.seq),onLocate:t,className:`patches__locate`,label:!0})]},e.key))})}var Dx={goal:null,loading:!0,busy:!1};function Ox(e){return e instanceof Error?e.message:String(e)}function kx(e,t,n,r=!0){let[i,a]=v.useState(Dx),o=n===void 0||n===`idle`;v.useEffect(()=>{if(!r||!e||!t)return;let n=!0;return e.goal(t).then(({goal:e,limits:t})=>{n&&a({goal:e,limits:t,loading:!1,busy:!1})}).catch(e=>{n&&a({goal:null,loading:!1,busy:!1,error:Ox(e)})}),()=>{n=!1}},[r,e,t,o]);let s=v.useCallback(async e=>{a(e=>({...e,busy:!0,error:void 0,refusal:void 0}));try{let t=await e();return a(e=>({...e,busy:!1,goal:t.ok?t.goal??null:e.goal,...t.ok?{}:{refusal:t.reason}})),t.ok}catch(e){return a(t=>({...t,busy:!1,error:Ox(e)})),!1}},[]),c=v.useCallback(async(n,r)=>!e||!t?!1:s(()=>e.createGoal(t,{objective:n,...r===void 0?{}:{maxRounds:r}})),[e,t,s]),l=v.useCallback(async n=>!e||!t?!1:s(()=>e.updateGoal(t,n)),[e,t,s]),u=v.useCallback(async()=>!e||!t?!1:s(async()=>{let n=await e.clearGoal(t);return n.ok?{ok:!0,goal:null}:{ok:!1,...n.reason?{reason:n.reason}:{}}}),[e,t,s]);return{...i,create:c,update:l,clear:u}}function Ax(e,t,n){let[r,i]=v.useState([]),a=t===void 0||t===`idle`;return v.useEffect(()=>{let t=!0;return e.blockedGoals().then(e=>{t&&i(e.items)}).catch(()=>{t&&i([])}),()=>{t=!1}},[e,a,n]),{items:r}}var jx=[`blocks`,`cpu`,`file-diff`,`flag`,`folder`,`gauge`,`info`,`layers`,`list-checks`,`lock`,`search`,`shield`,`sparkles`,`target`,`terminal`,`user-round`,`wallet`,`wrench`],Mx=`arrow-up-right`;function Nx(e,t){return e!==void 0&&jx.includes(e)?e:t}function Px(e){return Nx(e,Mx)}function Fx(e){let t={type:fe,id:e};window.parent.postMessage(t,`*`)}function Ix({items:e,onSelect:t}){let n=F();return e.length===0?null:(0,P.jsx)(`ul`,{className:`hostnav`,"aria-label":n(`web.ui.sidebar.host_menu`),children:e.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--row`,type:`button`,onClick:()=>t(e.id),children:[(0,P.jsx)(I,{name:Px(e.icon)}),(0,P.jsx)(`span`,{className:`hostnav__label`,title:e.label,children:e.label})]})},e.id))})}var Lx=`sparkles`,Rx=6;function zx(e){return(e%Rx+Rx)%Rx+1}function Bx({cards:e=[],onPick:t}){let n=F();return(0,P.jsxs)(`div`,{className:`blank`,children:[(0,P.jsx)(`h2`,{className:`blank__title`,children:n(`web.ui.blank.title`)}),e.length>0&&t!==void 0&&(0,P.jsx)(`ul`,{className:`blank__cards`,"aria-label":n(`web.ui.blank.cards`),children:e.map((e,n)=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{className:`blankcard`,type:`button`,"data-hue":zx(n),onClick:()=>t(e),children:[(0,P.jsxs)(`span`,{className:`blankcard__head`,children:[(0,P.jsx)(I,{name:Nx(e.icon,Lx)}),(0,P.jsx)(`span`,{className:`blankcard__title`,children:e.title})]}),e.subtitle!==void 0&&(0,P.jsx)(`span`,{className:`blankcard__sub`,children:e.subtitle})]})},e.id))})]})}function Vx(e,t){return e.map(e=>({root:e.root,name:e.name,current:e.root===t}))}function Hx(e,t){let[n,r]=v.useState(!1),[i,a]=v.useState(),o=v.useCallback(()=>a(void 0),[]),s=v.useCallback(i=>{n||(r(!0),a(void 0),e.createSession(i).then(e=>{r(!1),t(e.sessionId)}).catch(e=>{r(!1);let t=e?.detail??(e instanceof Error?e.message:``);a(typeof t==`string`&&t?t:String(e))}))},[n,e,t]);return{create:v.useCallback((e,t)=>s({...e===null?{}:{workspace:e},create:!0,...t===void 0?{}:{role:t}}),[s]),createDeferred:v.useCallback(()=>s({create:!0,deferWorkspace:!0}),[s]),busy:n,reset:o,...i===void 0?{}:{error:i}}}var Ux={"unknown-session":`web.ui.slist.err_gone`,"bad-title":`web.ui.slist.err_title`,"no-session-store":`web.ui.slist.err_no_store`};function Wx(e,t){let n=F(),{currentSessionId:r,homeSessionId:i,openSession:a,reloadCurrent:o}=t,s=v.useCallback(e=>{let t=e?.code,r=typeof t==`string`?Ux[t]:void 0;if(r)return n(r);let i=e?.detail;return typeof i==`string`&&i?i:e instanceof Error?e.message:String(e)},[n]),c=v.useCallback(e=>{if(e===r){if(i&&i!==e&&a){a(i);return}o()}},[r,i,a,o]),l=v.useCallback(async t=>{try{await e.deleteSession(t)}catch(e){if(!ye(e))return{ok:!1,message:s(e)}}return c(t),{ok:!0}},[e,s,c]),u=v.useCallback(async(t,n)=>{try{await e.renameSession(t,n)}catch(e){return{ok:!1,message:s(e)}}return{ok:!0}},[e,s]);return v.useMemo(()=>({rename:u,remove:l}),[u,l])}var Gx=[ze,`light`,`dark`],Kx=`(prefers-color-scheme: dark)`;function qx(e,t){return e===`light`||e===`dark`?e:t?`dark`:`light`}function Jx(){return globalThis.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1}function Yx(){return Be(Pe,Gx,ze)}function Xx(e){Ve(Pe,e)}function Zx(e){document.documentElement.dataset.theme=e}function Qx(e){let t=globalThis.matchMedia?.(Kx);if(!t)return()=>void 0;let n=t=>e(t.matches);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)}function $x(){let[e,t]=v.useState(Yx),[n,r]=v.useState(Jx);v.useEffect(()=>Qx(r),[]);let i=qx(e,n);return v.useEffect(()=>Zx(i),[i]),{pref:e,theme:i,prefersDark:n,setPref:v.useCallback(e=>{Xx(e),t(e)},[])}}var eS={ok:`check`,warn:`triangle-alert`,failed:`circle-alert`,skipped:`info`};function tS({about:e,diagnostics:t}){let n=F();if(!e)return(0,P.jsx)(`p`,{className:`panelcol__lede`,children:n(`web.ui.about.loading`)});let r=t??[];return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`panelcol__lede`,children:n(`web.ui.about.lede`)}),(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:n(`web.ui.about.g_machine`)}),(0,P.jsx)(nS,{name:n(`web.ui.about.k_version`),value:n(`web.ui.about.version_line`,{version:e.version,node:e.nodeVersion,platform:e.platform})}),(0,P.jsx)(nS,{name:n(`web.ui.about.k_home`),value:e.homeDir,hint:n(`web.ui.about.home_hint`)}),(0,P.jsx)(nS,{name:n(`web.ui.about.k_db`),value:e.dbPath,hint:n(`web.ui.about.db_hint`)}),e.profile!==void 0&&(0,P.jsx)(nS,{name:n(`web.ui.about.k_profile`),value:e.profile,hint:n(`web.ui.about.profile_hint`)})]}),(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:n(`web.ui.about.g_diag`)}),(0,P.jsx)(`p`,{className:`field__hint`,children:n(`web.ui.about.diag_lede`)}),r.length===0?(0,P.jsx)(`p`,{className:`field__hint`,children:n(`web.ui.about.diag_none`)}):(0,P.jsx)(`ul`,{className:`diag`,children:r.map((e,t)=>(0,P.jsxs)(`li`,{"data-level":e.status,children:[(0,P.jsx)(`span`,{className:`diag__sign`,children:(0,P.jsx)(I,{name:eS[e.status],size:`sm`})}),(0,P.jsx)(`span`,{children:n(`web.ui.about.diag_line`,{module:e.module,detail:e.detail})})]},`diag-${t}`))})]}),(0,P.jsxs)(`div`,{className:`note-block`,children:[(0,P.jsx)(`p`,{children:n(`web.ui.about.update_note`)}),(0,P.jsx)(`p`,{children:(0,P.jsx)(`code`,{className:`cmd`,children:`epoch upgrade`})})]})]})}function nS({name:e,value:t,hint:n}){return(0,P.jsxs)(`div`,{className:`field`,children:[(0,P.jsx)(`div`,{className:`field__head`,children:(0,P.jsx)(`span`,{className:`field__name`,children:e})}),(0,P.jsx)(`div`,{className:`field__ctl`,children:(0,P.jsx)(`code`,{className:`cmd`,children:t})}),n!==void 0&&(0,P.jsx)(`p`,{className:`field__hint`,children:n})]})}var rS=100;function iS(e,t,n){let[r,i]=v.useState({breakdown:null,loading:!0}),[a,o]=v.useState(0);v.useEffect(()=>{if(!e||t===void 0||!n){i({breakdown:null,loading:!1});return}let r=!0;return i({breakdown:null,loading:!0}),e.context(t).then(e=>{r&&i({breakdown:e.breakdown,loading:!1})}).catch(()=>{r&&i({breakdown:null,loading:!1,error:!0})}),()=>{r=!1}},[e,t,n,a]);let s=v.useCallback(()=>o(e=>e+1),[]);return{...r,reload:s}}function aS(e,t){return t.ran?t.after>=t.before?e(`web.ui.cmd.compact_no_change`,{n:t.before}):e(`web.ui.cmd.compact_done`,{before:t.before,after:t.after}):t.reason??e(`web.ui.cmd.compact_not_run`)}function oS({client:e,sessionId:t,readOnly:n=!1}){let r=F(),i=!n&&e!==void 0&&t!==void 0,a=iS(e,t,i),[o,s]=v.useState(!1),[c,l]=v.useState();if(!i)return null;if(a.loading)return(0,P.jsx)(`p`,{className:`field__hint`,children:r(`web.ui.set.budget_loading`)});if(a.error)return(0,P.jsx)(`p`,{className:`field__hint`,children:r(`web.ui.set.budget_error`)});let u=a.breakdown;if(!u)return null;let d=Math.max(...u.segments.map(e=>e.tokens),1),f=u.limit>0?Math.round(u.used/u.limit*100):null;return(0,P.jsxs)(`div`,{className:`setctx setbudget`,children:[(0,P.jsx)(`h3`,{className:`setbudget__title`,children:r(`web.ui.set.budget_title`)}),(0,P.jsx)(`p`,{className:`setctx__line`,children:f===null?r(`web.ui.set.budget_used_only`,{used:t_(u.used)}):r(`web.ui.set.budget_used`,{used:t_(u.used),limit:t_(u.limit),percent:String(f)})}),(0,P.jsx)(`ul`,{className:`setbudget__rows`,children:u.segments.map(e=>(0,P.jsxs)(`li`,{className:`setbudget__row`,children:[(0,P.jsx)(`span`,{className:`setbudget__label`,children:e.label}),(0,P.jsx)(`span`,{className:`setbudget__n`,title:String(e.tokens),children:t_(e.tokens)}),(0,P.jsx)(`span`,{className:`setbudget__bar`,"aria-hidden":`true`,children:(0,P.jsx)(`i`,{style:{width:`${Math.max(1,Math.round(e.tokens/d*rS))}%`}})}),e.detail&&(0,P.jsx)(`span`,{className:`setbudget__detail`,children:e.detail})]},e.label))}),u.hints.length>0&&(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:u.hints.map(e=>(0,P.jsx)(`p`,{children:e},e))}),(0,P.jsxs)(`div`,{className:`setbudget__act`,children:[(0,P.jsx)(`button`,{className:`btn`,type:`button`,disabled:o,onClick:()=>{!e||t===void 0||(s(!0),l(void 0),e.compact(t).then(e=>{l(aS(r,e)),a.reload()}).catch(()=>l(r(`web.ui.cmd.compact_failed`))).finally(()=>s(!1)))},children:r(o?`web.ui.set.budget_compacting`:`web.ui.set.budget_compact`)}),(0,P.jsx)(`p`,{className:`field__hint`,children:r(`web.ui.set.budget_compact_hint`)})]}),c&&(0,P.jsx)(`p`,{className:`setbudget__done`,role:`status`,children:c})]})}var sS=`compression.enabled`,cS=[sS,`compression.threshold`];function lS(e,t){return e.find(e=>e.key===t)?.value}function uS({rows:e,compression:t}){let n=F(),r=lS(e,sS);if(!t)return null;let{contextLength:i,threshold:a}=t,o=ce(i,a),s=Math.round(a*100);return(0,P.jsxs)(`div`,{className:`setctx`,children:[(0,P.jsx)(`p`,{className:`setctx__line`,children:n(`web.ui.set.ctx_line`,{tokens:e_(Math.floor(o)),window:e_(i),percent:String(s)})}),(0,P.jsx)(`p`,{className:`field__hint`,children:n(`web.ui.set.ctx_line_caveat`)}),r===!1&&(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,P.jsx)(`p`,{children:n(`web.ui.set.ctx_off`)})}),(0,P.jsx)(`div`,{className:`note-block`,children:(0,P.jsx)(`p`,{children:n(`web.ui.set.ctx_not_overridable`)})})]})}var dS={builtin:`web.ui.sec.layer_builtin`,plugin:`web.ui.sec.layer_plugin`,user:`web.ui.sec.layer_user`,env:`web.ui.sec.layer_env`,project:`web.ui.sec.layer_project`,projectLocal:`web.ui.sec.layer_project_local`,cli:`web.ui.sec.layer_cli`,managed:`web.ui.sec.layer_managed`,unknown:`web.ui.sec.layer_unknown`};function fS(e,t){let n=dS[e];return n?t(n):e}function pS({error:e}){let t=F();return ye(e)?(0,P.jsx)(`p`,{className:`panelcol__lede`,children:t(`web.ui.settings.history_only`)}):(0,P.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:e instanceof Error?e.message:String(e)})]})}var mS={model:[`model`,`models.utility`,`fallback.model`,`fallback.providers`],memory:[`contextLength`,`maxTurns`,...cS],budget:[`budget.maxCostUsd`,`budget.maxTokens`,`budget.warnAtPercent`,`budget.onUnknownPricing`]},hS={model:`web.ui.set.k_model`,"models.utility":`web.ui.set.k_models_utility`,"fallback.model":`web.ui.set.k_fallback_model`,"fallback.providers":`web.ui.set.k_fallback_providers`,contextLength:`web.ui.set.k_context_length`,maxTurns:`web.ui.set.k_max_turns`,"compression.enabled":`web.ui.set.k_compression_enabled`,"compression.threshold":`web.ui.set.k_compression_threshold`,"budget.maxCostUsd":`web.ui.set.k_budget_max_cost`,"budget.maxTokens":`web.ui.set.k_budget_max_tokens`,"budget.warnAtPercent":`web.ui.set.k_budget_warn_at`,"budget.onUnknownPricing":`web.ui.set.k_budget_unknown_pricing`},gS={"models.utility":`web.ui.set.h_models_utility`,"fallback.providers":`web.ui.set.h_fallback_providers`,contextLength:`web.ui.set.h_context_length`,maxTurns:`web.ui.set.h_max_turns`,"compression.enabled":`web.ui.set.h_compression_enabled`,"compression.threshold":`web.ui.set.h_compression_threshold`,"budget.maxCostUsd":`web.ui.set.h_budget_max_cost`,"budget.maxTokens":`web.ui.set.h_budget_max_tokens`,"budget.warnAtPercent":`web.ui.set.h_budget_warn_at`,"budget.onUnknownPricing":`web.ui.set.h_budget_unknown_pricing`},_S={"budget.maxCostUsd":`web.ui.set.ex_budget_max_cost`,"budget.maxTokens":`web.ui.set.ex_budget_max_tokens`,"budget.warnAtPercent":`web.ui.set.ex_budget_warn_at`},vS={model:{title:`web.ui.settings.pane_model`,lede:`web.ui.set.lede_model`},memory:{title:`web.ui.settings.pane_memory`,lede:`web.ui.set.lede_memory`},budget:{title:`web.ui.settings.pane_budget`,lede:`web.ui.set.lede_budget`}};function yS(e){return vS[e].title}function bS(e,t,n){let[r,i]=v.useState(),[a,o]=v.useState();return v.useEffect(()=>{if(!n||!t)return;let r=!0;return o(void 0),e.settings(t).then(e=>{r&&i(e)}).catch(e=>{r&&o(e)}),()=>{r=!1}},[e,t,n]),{...r?{data:r}:{},...a===void 0?{}:{error:a}}}var xS=`model`;function SS({pane:e,data:t,error:n,sessionId:r,client:i,compression:a,catalog:o,readOnly:s=!1}){let c=F();if(!r)return(0,P.jsx)(`p`,{className:`panelcol__lede`,children:c(`web.ui.set.no_session`)});if(n!==void 0)return(0,P.jsx)(pS,{error:n});if(!t)return(0,P.jsx)(`p`,{className:`panelcol__lede`,children:c(`web.ui.set.loading`)});let{own:l,orphans:u}=CS(e,t.rows);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`panelcol__lede`,children:c(vS[e].lede)}),(0,P.jsxs)(`div`,{className:`setgroup`,children:[l.map(e=>(0,P.jsx)(wS,{row:e,managedPath:t.managedPath,client:i,sessionId:r,...o&&e.key===xS?{catalog:o}:{}},e.key)),e===`memory`&&(0,P.jsx)(uS,{rows:t.rows,...a?{compression:a}:{}}),e===`memory`&&(0,P.jsx)(oS,{client:i,...r===void 0?{}:{sessionId:r},readOnly:s})]}),u.length>0&&(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:c(`web.ui.set.g_other`)}),u.map(e=>(0,P.jsx)(wS,{row:e,managedPath:t.managedPath,client:i,sessionId:r},e.key))]}),(0,P.jsx)(LS,{keys:t.overridableKeys})]})}function CS(e,t){let n=new Set(mS[e]),r=new Set(Object.values(mS).flat());return{own:mS[e].map(e=>t.find(t=>t.key===e)).filter(e=>e!==void 0&&n.has(e.key)),orphans:e===`model`?t.filter(e=>!r.has(e.key)):[]}}function wS({row:e,managedPath:t,client:n,sessionId:r,catalog:i}){let a=F(),o=hS[e.key],s=gS[e.key],[c,l]=v.useState(!1),[u,d]=v.useState();return(0,P.jsxs)(`div`,{className:`field`,children:[(0,P.jsxs)(`div`,{className:`field__head`,children:[(0,P.jsx)(`span`,{className:`field__name`,children:o?a(o):e.key}),s&&(0,P.jsx)(pt,{text:a(s),about:o?a(o):e.key}),(0,P.jsx)(`span`,{className:`layer`,"data-layer":e.layer,children:fS(e.layer,a)})]}),(0,P.jsxs)(`div`,{className:`field__ctl`,children:[(0,P.jsx)(`code`,{className:`cmd`,children:e.value===void 0?a(`web.ui.set.unset`):RS(e.value)}),e.writes.length>0&&!c&&(0,P.jsx)(`button`,{className:`btn btn--icon`,type:`button`,onClick:()=>l(!0),"aria-label":a(`web.ui.set.edit`),title:a(`web.ui.set.edit`),children:(0,P.jsx)(I,{name:`pencil`})})]}),e.layer===`managed`&&(0,P.jsx)(PS,{path:t}),c&&(0,P.jsx)(TS,{row:e,client:n,sessionId:r,...i?{catalog:i}:{},onDone:e=>{d(e),l(!1)},onCancel:()=>l(!1)}),u&&(0,P.jsx)(DS,{receipt:u,row:e}),e.overridable&&(0,P.jsx)(FS,{row:e,t:a})]})}function TS({row:e,client:t,sessionId:n,catalog:r,onDone:i,onCancel:a}){let o=F(),s=e.writes[0],c=e.value===void 0?``:RS(e.value),[l,u]=v.useState(c),[d,f]=v.useState(s.layer),[p,m]=v.useState(!1),[h,g]=v.useState(),_=e.writes.find(e=>e.layer===d)??s,y=kS(l,OS(e)),b=l!==c||d!==s.layer,x=MS(e),S=_S[e.key],C=b&&y===null?AS(l,e,x!==null,o):null,w=()=>{y===null||!b||p||(m(!0),g(void 0),t.writeSetting(n,{key:e.key,layer:d,value:y}).then(i).catch(e=>{g(e instanceof Error?e.message:String(e)),m(!1)}))},ee=b?(0,P.jsx)(`span`,{className:`setwrite__dirty`,children:o(`web.ui.set.dirty`)}):null;return(0,P.jsxs)(`div`,{className:`setwrite`,children:[r?(0,P.jsx)(Tt,{catalog:r,value:l,onChange:u,onPick:e=>u(e),onSubmit:w,busy:p,keyField:!0,...ee?{trailing:ee}:{}}):(0,P.jsxs)(`div`,{className:`setwrite__line setwrite__value`,children:[(0,P.jsx)(`span`,{className:`setwrite__label`,children:o(`web.ui.set.new_value`)}),(0,P.jsxs)(`div`,{className:`setwrite__field`,children:[x?(0,P.jsx)(jS,{choices:x,value:l.trim(),busy:p,label:o(`web.ui.set.new_value`),onPick:u}):(0,P.jsx)(`input`,{className:`input input--mono input--wide`,value:l,disabled:p,"aria-label":o(`web.ui.set.new_value`),...S?{placeholder:o(S)}:{},onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&w()}}),ee]})]}),(0,P.jsxs)(`div`,{className:`setwrite__line setwrite__layer`,children:[(0,P.jsx)(`span`,{className:`setwrite__label`,children:o(`web.ui.set.write_layer`)}),(0,P.jsx)(`div`,{className:`seg`,role:`group`,"aria-label":o(`web.ui.set.write_layer`),children:e.writes.map(e=>(0,P.jsx)(`button`,{type:`button`,"aria-pressed":e.layer===d,disabled:p,onClick:()=>f(e.layer),children:fS(e.layer,o)},e.layer))})]}),(0,P.jsxs)(`p`,{className:`setwrite__label setwrite__where`,children:[(0,P.jsx)(`span`,{children:o(`web.ui.set.write_file`)}),(0,P.jsx)(`code`,{children:_.path})]}),(0,P.jsx)(ES,{write:_}),h&&(0,P.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:h})]}),(0,P.jsxs)(`div`,{className:`setwrite__line setwrite__foot`,children:[C&&(0,P.jsxs)(`p`,{className:`setwrite__blocked`,role:`status`,children:[(0,P.jsx)(I,{name:`circle-alert`,size:`sm`}),(0,P.jsx)(`span`,{children:C})]}),(0,P.jsxs)(`div`,{className:`setwrite__actions`,children:[(0,P.jsx)(`button`,{className:`btn btn--sm`,type:`button`,disabled:p,onClick:a,children:o(`web.ui.set.cancel`)}),(0,P.jsx)(`button`,{className:`btn btn--sm btn--primary`,type:`button`,disabled:p||!b||y===null,onClick:w,children:o(`web.ui.set.save`)})]})]})]})}function ES({write:e}){let t=F();return e.futile?(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,P.jsx)(`p`,{children:e.futile.reason===`shadowed`?t(`web.ui.set.futile_shadowed`,{layer:fS(e.layer,t),by:e.futile.by?fS(e.futile.by,t):``}):t(`web.ui.set.futile_untrusted`,{layer:fS(e.layer,t)})})}):null}function DS({receipt:e,row:t}){let n=F();return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`setwrite__receipt`,children:[(0,P.jsx)(`span`,{children:n(`web.ui.set.wrote`,{layer:fS(e.layer,n),value:RS(e.value)})}),(0,P.jsx)(`code`,{children:e.path}),(0,P.jsx)(`span`,{children:n(`web.ui.set.wrote_stale`,{value:t.value===void 0?n(`web.ui.set.unset`):RS(t.value)})})]}),e.futile&&(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,P.jsx)(`p`,{children:e.futile.reason===`shadowed`?n(`web.ui.set.futile_shadowed`,{layer:fS(e.layer,n),by:e.futile.by?fS(e.futile.by,n):``}):n(`web.ui.set.futile_untrusted`,{layer:fS(e.layer,n)})})})]})}function OS(e){return e.valueKind??`string`}function kS(e,t){let n=e.trim();if(n.length===0)return null;if(t===`boolean`)return n===`true`||n!==`false`&&null;if(t!==`number`)return n;let r=Number(n);return Number.isFinite(r)?r:null}function AS(e,t,n,r){return e.trim().length===0?r(n?`web.ui.set.blocked_pick`:`web.ui.set.blocked_empty`):OS(t)===`boolean`?r(`web.ui.set.blocked_boolean`):r(`web.ui.set.blocked_number`,{text:e.trim()})}function jS({choices:e,value:t,busy:n,label:r,onPick:i}){return(0,P.jsx)(`div`,{className:`seg`,role:`group`,"aria-label":r,children:e.map(e=>(0,P.jsx)(`button`,{type:`button`,"aria-pressed":e===t,disabled:n,onClick:()=>i(e),children:(0,P.jsx)(`code`,{children:e})},e))})}function MS(e){return e.choices&&e.choices.length>0?e.choices:OS(e)===`boolean`?NS:null}var NS=[`true`,`false`];function PS({path:e}){let t=F();return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`p`,{className:`lockline`,children:[(0,P.jsx)(I,{name:`lock`,size:`sm`}),(0,P.jsx)(`span`,{children:t(`web.ui.set.managed_locked`)})]}),e!==null&&(0,P.jsx)(`p`,{className:`field__hint`,children:(0,P.jsx)(`code`,{children:e})})]})}function FS({row:e,t}){let n=e.chain.findIndex(t=>t.layer===e.layer);return(0,P.jsxs)(`details`,{className:`why`,children:[(0,P.jsxs)(`summary`,{children:[(0,P.jsx)(I,{name:`chevron-right`,size:`sm`}),t(`web.ui.set.why`)]}),(0,P.jsx)(`dl`,{className:`chain`,children:e.chain.map((e,r)=>(0,P.jsx)(IS,{step:e,won:r===n,t},e.layer))})]})}function IS({step:e,won:t,t:n}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:fS(e.layer,n)}),(0,P.jsx)(`dd`,{...t?{"data-win":``}:{},children:e.value===void 0?`—`:RS(e.value)}),(0,P.jsx)(`dd`,{className:`chain__win`,children:t?n(`web.ui.set.chain_win`):``})]})}function LS({keys:e}){let t=F();return(0,P.jsx)(`div`,{className:`note-block`,children:(0,P.jsxs)(`details`,{children:[(0,P.jsxs)(`summary`,{children:[(0,P.jsx)(I,{name:`chevron-right`,size:`sm`}),t(`web.ui.set.overridable_sum`)]}),(0,P.jsx)(`p`,{children:t(`web.ui.set.overridable`,{keys:e.join(` / `)})}),(0,P.jsx)(`p`,{children:t(`web.ui.set.overridable_perm`)})]})})}function RS(e){return Array.isArray(e)?e.join(` → `):String(e)}var zS={"dangerous-command":`web.ui.sec.audit_code_dangerous_command`,"sensitive-path":`web.ui.sec.audit_code_sensitive_path`,obfuscated:`web.ui.sec.audit_code_obfuscated`,"rule-match":`web.ui.sec.audit_code_rule_match`,"policy-rule":`web.ui.sec.audit_code_policy_rule`,"approval-cache":`web.ui.sec.audit_code_approval_cache`,"sandbox-isolation":`web.ui.sec.audit_code_sandbox_isolation`,"level-default":`web.ui.sec.audit_code_level_default`,"headless-preauthorized":`web.ui.sec.audit_code_headless_preauthorized`,"headless-unauthorized":`web.ui.sec.audit_code_headless_unauthorized`,"user-approved":`web.ui.sec.audit_code_user_approved`,"user-denied":`web.ui.sec.audit_code_user_denied`};function BS(e,t){let n=zS[e];return n?t(n):e}function VS({audit:e}){let t=F();if(e.rows.length===0)return null;let n=[...e.rows].reverse();return(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:t(`web.ui.sec.g_audit`)}),(0,P.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.audit_lede`)}),(0,P.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.audit_scope`)}),(0,P.jsxs)(`div`,{className:`audit`,children:[(0,P.jsxs)(`div`,{className:`audit__head`,"aria-hidden":`true`,children:[(0,P.jsx)(`span`,{children:t(`web.ui.sec.audit_col_at`)}),(0,P.jsx)(`span`,{children:t(`web.ui.sec.audit_col_tool`)}),(0,P.jsx)(`span`,{children:t(`web.ui.sec.audit_col_type`)}),(0,P.jsx)(`span`,{children:t(`web.ui.sec.audit_col_target`)}),(0,P.jsx)(`span`,{children:t(`web.ui.sec.audit_col_outcome`)}),(0,P.jsx)(`span`,{children:t(`web.ui.sec.audit_col_code`)})]}),n.map((e,n)=>(0,P.jsx)(HS,{row:e,t},`${e.at}:${e.toolName}:${n}`))]}),e.dropped>0&&(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,P.jsx)(`p`,{children:t(`web.ui.sec.audit_dropped`,{dropped:e.dropped})})}),(0,P.jsx)(`div`,{className:`note-block`,children:(0,P.jsx)(`p`,{children:t(`web.ui.sec.audit_ephemeral`)})})]})}function HS({row:e,t}){let n=new Date(e.at);return(0,P.jsxs)(`div`,{className:`audit__row`,"data-outcome":e.outcome,children:[(0,P.jsx)(`span`,{className:`audit__at`,title:n.toLocaleString(),children:n.toLocaleTimeString()}),(0,P.jsx)(`span`,{className:`audit__tool`,title:e.toolName,children:e.toolName}),(0,P.jsx)(`span`,{className:`audit__type`,children:e.type}),(0,P.jsx)(`span`,{className:`audit__target`,title:e.target,children:e.target}),(0,P.jsx)(`span`,{className:`audit__outcome`,children:t(e.outcome===`granted`?`web.ui.sec.audit_granted`:`web.ui.sec.audit_denied`)}),(0,P.jsx)(`span`,{className:`audit__code`,children:BS(e.code,t)})]})}var US={shadowed:`web.ui.sec.shadow_shadowed`,partial:`web.ui.sec.shadow_partial`,redundant:`web.ui.sec.shadow_redundant`},WS={deny:`web.ui.sec.cached_d_deny`,"allow-session":`web.ui.sec.cached_d_session`,"allow-always":`web.ui.sec.cached_d_always`};function GS({permission:e,client:t,sessionId:n}){let r=F(),{level:i,configured:a,configuredLayer:o,rules:s,shadows:c,managed:l}=e;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:r(`web.ui.sec.g_perm`)}),(0,P.jsxs)(`div`,{className:`field`,children:[(0,P.jsxs)(`div`,{className:`field__head`,children:[(0,P.jsx)(`span`,{className:`field__name`,children:r(`web.ui.sec.perm_field`)}),(0,P.jsx)(pt,{text:r(`web.ui.sec.perm_hint`),about:r(`web.ui.sec.perm_field`)})]}),(0,P.jsxs)(`div`,{className:`field__ctl`,children:[(0,P.jsxs)(`div`,{className:`permrow`,children:[(0,P.jsx)(`span`,{className:`permrow__when`,children:r(`web.ui.sec.perm_now`)}),(0,P.jsx)(`code`,{className:`cmd`,children:i===`unknown`?r(`web.ui.sec.perm_unknown`):i}),i!==a&&i!==`unknown`&&(0,P.jsx)(`span`,{className:`permrow__note`,children:r(`web.ui.sec.perm_now_changed`)})]}),(0,P.jsxs)(`div`,{className:`permrow`,children:[(0,P.jsx)(`span`,{className:`permrow__when`,children:r(`web.ui.sec.perm_default`)}),(0,P.jsx)(`code`,{className:`cmd`,children:a===`unknown`?r(`web.ui.sec.perm_unknown`):a}),(0,P.jsx)(`span`,{className:`layer`,"data-layer":o,children:fS(o,r)})]})]}),(0,P.jsx)(`p`,{className:`field__hint`,children:r(`web.ui.sec.perm_where`)})]}),(0,P.jsxs)(`div`,{className:`field`,children:[(0,P.jsxs)(`div`,{className:`field__head`,children:[(0,P.jsx)(`span`,{className:`field__name`,children:r(`web.ui.sec.managed_field`)}),l.present&&(0,P.jsx)(`span`,{className:`layer`,"data-layer":`managed`,children:r(`web.ui.sec.layer_managed`)})]}),l.present?(0,P.jsxs)(`p`,{className:`lockline`,children:[(0,P.jsx)(I,{name:`lock`,size:`sm`}),(0,P.jsx)(`span`,{children:r(`web.ui.sec.managed_on`)})]}):(0,P.jsx)(`p`,{className:`field__hint`,children:r(`web.ui.sec.managed_off`)}),(0,P.jsx)(`p`,{className:`field__hint`,children:(0,P.jsx)(`code`,{children:l.path})}),l.rulesOnly&&(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`danger`,children:(0,P.jsx)(`p`,{children:r(`web.ui.sec.managed_rules_only`)})}),l.bypassDisabled&&(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,P.jsx)(`p`,{children:r(`web.ui.sec.managed_bypass_off`)})})]})]}),(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:r(`web.ui.sec.g_rules`)}),s.length===0?(0,P.jsx)(`p`,{className:`sec__foot`,children:r(`web.ui.sec.rules_empty`)}):(0,P.jsx)(`div`,{className:`rules`,children:s.map((e,t)=>(0,P.jsxs)(`div`,{className:`rule`,"data-verdict":e.verdict,children:[(0,P.jsx)(`span`,{className:`rule__verdict`,children:e.verdict}),(0,P.jsx)(`span`,{className:`rule__pattern`,title:e.rule,children:e.rule}),(0,P.jsx)(`span`,{className:`rule__src`,children:fS(e.layer,r)})]},`${e.verdict}:${e.rule}:${t}`))}),c.length>0&&(0,P.jsxs)(`div`,{className:`note-block`,"data-tone":`warn`,children:[(0,P.jsx)(`p`,{children:r(`web.ui.sec.shadow_lede`)}),c.map((e,t)=>(0,P.jsx)(`p`,{children:r(US[e.kind],{rule:e.rule,by:e.by})},`${e.kind}:${e.rule}:${e.by}:${t}`))]}),(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`danger`,children:(0,P.jsx)(`p`,{children:r(`web.ui.sec.rules_no_exec`)})})]}),(0,P.jsx)(KS,{cached:e.cached,level:i,client:t,sid:n})]})}function KS({cached:e,level:t,client:n,sid:r}){let i=F(),[a,o]=v.useState(null),[s,c]=v.useState(null),[l,u]=v.useState();v.useEffect(()=>{o(null),u(void 0)},[e]);let d=a??e;if(d.length===0)return null;let f=e=>{c(e),u(void 0),n.revokeApproval(r,e).then(e=>o(e.cached)).catch(e=>u(e instanceof Error?e.message:String(e))).finally(()=>c(null))};return(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:i(`web.ui.sec.g_cached`)}),(0,P.jsx)(`p`,{className:`field__hint`,children:i(`web.ui.sec.cached_lede`)}),(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,P.jsx)(`p`,{children:i(`web.ui.sec.cached_not_rules`)})}),t===`bypass`&&(0,P.jsx)(`div`,{className:`note-block`,children:(0,P.jsx)(`p`,{children:i(`web.ui.sec.cached_bypass`)})}),(0,P.jsx)(`div`,{className:`approvals`,children:d.map(e=>(0,P.jsx)(qS,{row:e,t:i,busy:s===e.id,onRevoke:()=>f(e.id)},e.id))}),l!==void 0&&(0,P.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`span`,{children:i(`web.ui.sec.cached_failed`,{message:l})})]}),(0,P.jsx)(`p`,{className:`field__hint`,children:i(`web.ui.sec.cached_where`)})]})}function qS({row:e,t,busy:n,onRevoke:r}){let i=new Date(e.at);return(0,P.jsxs)(`div`,{className:`approval`,"data-decision":e.decision,children:[(0,P.jsx)(`span`,{className:`approval__decision`,children:t(WS[e.decision])}),(0,P.jsx)(`span`,{className:`approval__tool`,title:e.toolName,children:e.toolName}),(0,P.jsx)(`span`,{className:`approval__target`,title:e.target,children:e.target}),(0,P.jsx)(`span`,{className:`approval__scope`,children:t(e.scope===`prefix`?`web.ui.sec.cached_scope_prefix`:`web.ui.sec.cached_scope_exact`)}),(0,P.jsx)(`span`,{className:`approval__at`,title:i.toLocaleString(),children:i.toLocaleTimeString()}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--sm approval__revoke`,disabled:n,"aria-label":t(`web.ui.sec.cached_revoke_one`,{target:e.target}),onClick:r,children:t(n?`web.ui.sec.cached_revoking`:`web.ui.sec.cached_revoke`)})]})}function JS({policy:e}){let t=F(),{dirs:n,projectSkipped:r,skippedDir:i}=e;return(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:t(`web.ui.sec.g_policy`)}),(0,P.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.policy_lede`)}),n.length===0?(0,P.jsx)(`p`,{className:`sec__foot`,children:t(`web.ui.sec.policy_none`)}):(0,P.jsx)(`ul`,{className:`slots`,"data-kind":`policy`,children:n.map(e=>(0,P.jsxs)(`li`,{className:`slot`,children:[(0,P.jsx)(`code`,{className:`slot__path`,children:e.dir}),(0,P.jsx)(`span`,{className:`slot__desc`,children:t(YS(e))}),(0,P.jsx)(`span`,{className:`slot__stat`,children:t(`web.ui.sec.policy_n`,{count:e.ruleCount})})]},`${e.source}:${e.dir}`))}),r&&(0,P.jsxs)(`div`,{className:`note-block`,"data-tone":`warn`,children:[(0,P.jsx)(`p`,{children:t(`web.ui.sec.policy_skipped`,{dir:i??``})}),(0,P.jsx)(`p`,{children:t(`web.ui.sec.policy_skipped_why`)})]}),(0,P.jsx)(`div`,{className:`note-block`,children:(0,P.jsx)(`p`,{children:t(`web.ui.sec.policy_asym`)})})]})}function YS(e){return e.source===`user`?`web.ui.sec.policy_user`:`web.ui.sec.policy_project`}var XS={"os-isolated":`web.ui.sec.sb_os_isolated`,"backend-unavailable":`web.ui.sec.sb_backend_unavailable`,"backend-missing":`web.ui.sec.sb_backend_missing`,"platform-unsupported":`web.ui.sec.sb_platform_unsupported`};function ZS({sandbox:e}){let t=F();return(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:t(`web.ui.sec.g_sandbox`)}),e?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`field`,children:[(0,P.jsx)(`div`,{className:`field__head`,children:(0,P.jsx)(`span`,{className:`field__name`,children:t(`web.ui.sec.sb_field`)})}),(0,P.jsx)(`div`,{className:`field__ctl`,children:(0,P.jsx)(`code`,{className:`cmd`,children:e.backend})}),(0,P.jsx)(`p`,{className:`field__hint`,children:t(XS[e.reason],{backend:e.backend,platform:e.platform})})]}),(0,P.jsxs)(`div`,{className:`field`,children:[(0,P.jsx)(`div`,{className:`field__head`,children:(0,P.jsx)(`span`,{className:`field__name`,children:t(`web.ui.sec.sb_switch`)})}),(0,P.jsx)(`div`,{className:`field__ctl`,children:(0,P.jsx)(`code`,{className:`cmd`,children:t(e.terminalEnabled===!1?`web.ui.sec.sb_switch_off`:`web.ui.sec.sb_switch_on`)})}),e.terminalEnabled===!1?(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`danger`,children:(0,P.jsx)(`p`,{children:t(`web.ui.sec.sb_switch_off_hint`)})}):(0,P.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.sb_switch_on_hint`)})]}),(0,P.jsx)(QS,{nameKey:`web.ui.sec.sb_covers`,tools:e.covers,emptyKey:`web.ui.sec.sb_covers_none`}),(0,P.jsxs)(`div`,{className:`field`,children:[(0,P.jsx)(`div`,{className:`field__head`,children:(0,P.jsx)(`span`,{className:`field__name`,children:t(`web.ui.sec.sb_excludes`)})}),e.excludes.length===0?(0,P.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.sb_excludes_none`)}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`field__ctl`,children:e.excludes.map(e=>(0,P.jsx)(`code`,{className:`cmd`,children:e},e))}),(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`danger`,children:(0,P.jsx)(`p`,{children:t(`web.ui.sec.sb_excludes_why`)})})]})]})]}):(0,P.jsxs)(`p`,{className:`note`,"data-tone":`error`,children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:`triangle-alert`,size:`sm`})}),(0,P.jsx)(`span`,{children:t(`web.ui.sec.sb_absent_long`)})]})]})}function QS({nameKey:e,hintKey:t,tools:n,emptyKey:r}){let i=F();return(0,P.jsxs)(`div`,{className:`field`,children:[(0,P.jsx)(`div`,{className:`field__head`,children:(0,P.jsx)(`span`,{className:`field__name`,children:i(e)})}),n.length===0?(0,P.jsx)(`p`,{className:`field__hint`,children:i(r)}):(0,P.jsx)(`div`,{className:`field__ctl`,children:n.map(e=>(0,P.jsx)(`code`,{className:`cmd`,children:e},e))}),t!==void 0&&(0,P.jsx)(`p`,{className:`field__hint`,children:i(t)})]})}function $S({workspace:e,known:t}){let n=F();return(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:n(`web.ui.sec.g_space`)}),(0,P.jsxs)(`div`,{className:`field`,children:[(0,P.jsx)(`div`,{className:`field__head`,children:(0,P.jsx)(`span`,{className:`field__name`,children:n(`web.ui.sec.known_field`)})}),t.length===0?(0,P.jsx)(`p`,{className:`sec__foot`,children:n(`web.ui.sec.known_empty`)}):(0,P.jsx)(`ul`,{className:`slots`,"data-kind":`space`,children:t.map(e=>(0,P.jsxs)(`li`,{className:`slot`,...e.current?{"aria-current":`true`}:{},children:[(0,P.jsx)(`code`,{className:`slot__path`,children:e.root}),(0,P.jsx)(`span`,{className:`slot__desc`,children:n(eC(e.level,e.trusted))}),(0,P.jsx)(`span`,{className:`slot__stat`,children:e.current?n(`web.ui.sec.ws_current`):``})]},e.root))}),(0,P.jsx)(`p`,{className:`field__hint`,children:n(`web.ui.sec.known_hint`)})]}),e?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(tC,{workspace:e}),(0,P.jsx)(nC,{workspace:e})]}):(0,P.jsxs)(`div`,{className:`field`,children:[(0,P.jsx)(`div`,{className:`field__head`,children:(0,P.jsx)(`span`,{className:`field__name`,children:n(`web.ui.sec.bound_field`)})}),(0,P.jsx)(`p`,{className:`field__hint`,children:n(`web.ui.sec.unbound`)})]}),(0,P.jsxs)(`div`,{className:`note-block`,"data-tone":`warn`,children:[(0,P.jsx)(`p`,{children:n(`web.ui.sec.trust_only_deny`)}),(0,P.jsx)(`p`,{children:n(`web.ui.sec.trust_not_permission`)})]})]})}function eC(e,t){return t?e===`trusted`?`web.ui.sec.ws_trusted`:`web.ui.sec.ws_gate_off`:e===`untrusted`?`web.ui.sec.ws_refused`:`web.ui.sec.ws_unknown`}function tC({workspace:e}){let t=F();return(0,P.jsxs)(`div`,{className:`field`,children:[(0,P.jsxs)(`div`,{className:`field__head`,children:[(0,P.jsx)(`span`,{className:`field__name`,children:t(`web.ui.sec.main_field`,{name:e.name})}),(0,P.jsxs)(`span`,{className:`sec__trust`,"data-trust":e.trusted?`on`:`off`,children:[(0,P.jsx)(I,{name:e.trusted?`check`:`triangle-alert`,size:`sm`}),t(eC(e.trustLevel,e.trusted))]})]}),(0,P.jsx)(`p`,{className:`field__hint`,children:(0,P.jsx)(`code`,{children:e.root})}),(0,P.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.main_hint`)}),(0,P.jsx)(rC,{titleKey:`web.ui.sec.loaded_files`,emptyKey:`web.ui.sec.loaded_none`,files:e.instructionFiles}),e.skippedInstructionFiles.length>0&&(0,P.jsxs)(`div`,{className:`locked`,children:[(0,P.jsx)(`p`,{className:`locked__line`,children:t(`web.ui.sec.skipped_line`)}),(0,P.jsx)(`p`,{className:`locked__why`,children:t(`web.ui.sec.skipped_why`)}),(0,P.jsx)(`ul`,{className:`sec__files`,children:e.skippedInstructionFiles.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`code`,{children:e})},e))}),(0,P.jsx)(`div`,{className:`locked__act`,children:(0,P.jsx)(bv,{cmd:`epoch trust add ${e.root}`})})]})]})}function nC({workspace:e}){let t=F();return(0,P.jsxs)(`div`,{className:`field`,children:[(0,P.jsxs)(`div`,{className:`field__head`,children:[(0,P.jsx)(`span`,{className:`field__name`,children:t(`web.ui.sec.extra_field`)}),(0,P.jsx)(`span`,{className:`layer`,"data-layer":`cli`,children:t(`web.ui.sec.layer_add_dir`)})]}),e.extraRoots.length===0?(0,P.jsx)(`p`,{className:`sec__foot`,children:t(`web.ui.sec.extra_none`)}):(0,P.jsx)(`ul`,{className:`slots`,"data-kind":`root`,children:e.extraRoots.map(e=>(0,P.jsxs)(`li`,{className:`slot`,children:[(0,P.jsx)(`code`,{className:`slot__path`,children:e}),(0,P.jsx)(`span`,{className:`slot__desc`,children:t(`web.ui.sec.extra_desc`)})]},e))}),(0,P.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.extra_hint`)}),e.unloadedExtraInstructionFiles.length>0&&(0,P.jsxs)(`div`,{className:`note-block`,"data-tone":`warn`,children:[(0,P.jsx)(`p`,{children:t(`web.ui.sec.unloaded_extra`)}),(0,P.jsx)(`ul`,{className:`sec__files`,children:e.unloadedExtraInstructionFiles.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`code`,{children:e})},e))}),(0,P.jsx)(`p`,{children:t(`web.ui.sec.unloaded_extra_way`)})]})]})}function rC({titleKey:e,emptyKey:t,files:n}){let r=F();return n.length===0?(0,P.jsx)(`p`,{className:`field__hint`,children:r(t)}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`field__hint`,children:r(e)}),(0,P.jsx)(`ul`,{className:`sec__files`,children:n.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`code`,{children:e})},e))})]})}function iC({client:e,sessionId:t}){let n=F(),[r,i]=v.useState(),[a,o]=v.useState();return v.useEffect(()=>{if(!t)return;let n=!0;return o(void 0),e.security(t).then(e=>{n&&i(e)}).catch(e=>{n&&o(e)}),()=>{n=!1}},[e,t]),t?a===void 0?r?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`panelcol__lede`,children:n(`web.ui.sec.lede`)}),(0,P.jsx)(`div`,{className:`seccards`,children:oC(r,n).map(e=>(0,P.jsxs)(`div`,{className:`seccard`,...e.tone?{"data-tone":e.tone}:{},children:[(0,P.jsx)(`span`,{className:`seccard__k`,children:n(e.label)}),(0,P.jsx)(`b`,{className:`seccard__v`,children:e.value}),(0,P.jsx)(`span`,{className:`seccard__d`,children:e.desc})]},e.label))}),(0,P.jsx)(GS,{permission:r.permission,client:e,sessionId:t}),(0,P.jsx)($S,{workspace:r.workspace,known:r.knownWorkspaces}),(0,P.jsx)(ZS,{sandbox:r.sandbox}),(0,P.jsx)(JS,{policy:r.policy}),(0,P.jsx)(VS,{audit:r.audit})]}):(0,P.jsx)(`p`,{className:`sec__foot`,children:n(`web.ui.sec.loading`)}):(0,P.jsx)(pS,{error:a}):(0,P.jsx)(`p`,{className:`sec__foot`,children:n(`web.ui.sec.no_session`)})}function aC(e,t,n,r){return{label:e,value:t,desc:n,...r?{tone:r}:{}}}function oC(e,t){let{managed:n,level:r,rules:i,shadows:a}=e.permission,o=e.knownWorkspaces,s=o.filter(e=>!e.trusted).length,c=e.policy.dirs.reduce((e,t)=>e+t.ruleCount,0),l=n.present&&(n.rulesOnly||n.bypassDisabled),u=r===`bypass`||r===`unknown`?`warn`:l?`lock`:`ok`,d=a.some(e=>e.kind===`shadowed`);return[sC(e.sandbox,t),aC(`web.ui.sec.card_perm`,r===`unknown`?t(`web.ui.sec.perm_unknown`):r,t(l?`web.ui.sec.perm_d_managed`:`web.ui.sec.perm_d_local`),u),aC(`web.ui.sec.card_space`,o.length===0?t(`web.ui.sec.space_none`):s===0?t(`web.ui.sec.space_all_trusted`,{count:o.length}):t(`web.ui.sec.space_untrusted`,{count:o.length,untrusted:s}),e.workspace?t(`web.ui.sec.space_at`,{root:e.workspace.root}):t(`web.ui.sec.space_unbound`),o.length===0?void 0:s>0?`warn`:`ok`),aC(`web.ui.sec.card_rules`,t(`web.ui.sec.rules_n`,{count:i.length,policy:c}),cC(i,t),d?`warn`:void 0)]}function sC(e,t){if(!e)return aC(`web.ui.sec.card_sandbox`,t(`web.ui.sec.sb_absent`),t(`web.ui.sec.sb_absent_d`),`warn`);let n={backend:e.backend,platform:e.platform};return aC(`web.ui.sec.card_sandbox`,e.level===`os`?t(`web.ui.sec.sb_os`,n):t(`web.ui.sec.sb_process`,n),t(XS[e.reason],n),e.level===`os`?`ok`:`warn`)}function cC(e,t){if(e.length===0)return t(`web.ui.sec.rules_none`);let n=new Map;for(let t of e)n.set(t.layer,(n.get(t.layer)??0)+1);return[...n].map(([e,n])=>`${fS(e,t)} ${n}`).join(` / `)}var lC=100;function uC(e){return`$${e.toFixed(4)}`}function dC(e,t){return t===void 0?e:(e??0)+t}function fC(e){let t={},n=0,r=0,i;for(let a of e){let e=a.usage;e&&(n+=1,t.input=dC(t.input,e.inputTokens),t.output=dC(t.output,e.outputTokens),t.cacheHit=dC(t.cacheHit,e.cacheHitTokens),t.cacheWrite=dC(t.cacheWrite,e.cacheWriteTokens),t.reasoning=dC(t.reasoning,e.reasoningTokens),t.total=dC(t.total,E(e)),e.costUsd!==void 0&&(r+=1,i=(i??0)+e.costUsd))}return{turns:e.length,measured:n,priced:r,tokens:t,costUsd:i}}var pC=[{pick:`input`,label:`web.ui.spend.tok_input`},{pick:`cacheHit`,label:`web.ui.spend.tok_cache_hit`,tier:`cheap`},{pick:`cacheWrite`,label:`web.ui.spend.tok_cache_write`},{pick:`output`,label:`web.ui.spend.tok_output`}];function mC({sessionId:e,turns:t,hasHistory:n}){let r=F();if(e===void 0)return(0,P.jsx)(`p`,{className:`panelcol__lede`,children:r(`web.ui.spend.no_session`)});let i=fC(t);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`panelcol__lede`,children:r(`web.ui.spend.lede`)}),i.turns===0?(0,P.jsx)(`p`,{className:`field__hint`,children:r(n?`web.ui.spend.none_recorded`:`web.ui.spend.none_yet`)}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:r(`web.ui.spend.g_total`)}),(0,P.jsx)(gC,{tally:i,t:r})]}),(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:r(`web.ui.spend.g_turns`)}),(0,P.jsx)(vC,{turns:t,t:r})]})]})]})}function hC({label:e,value:t,title:n,badge:r}){return(0,P.jsxs)(`div`,{className:`spend__stat`,children:[(0,P.jsx)(`span`,{className:`spend__stat-n`,...n===void 0?{}:{title:n},children:t}),(0,P.jsxs)(`span`,{className:`spend__stat-k`,children:[(0,P.jsx)(`span`,{className:`spend__stat-label`,children:e}),r]})]})}function gC({tally:e,t}){let{turns:n,measured:r,priced:i,tokens:a,costUsd:o}=e,s=a.total;return(0,P.jsxs)(`div`,{className:`spend`,children:[(0,P.jsxs)(`div`,{className:`spend__hero`,children:[(0,P.jsx)(hC,{label:t(`web.ui.spend.col_turn`),value:String(n)}),r>0&&s!==void 0&&(0,P.jsx)(hC,{label:t(`web.ui.spend.col_tokens`),value:t_(s),title:e_(s)}),o!==void 0&&(0,P.jsx)(hC,{label:t(`web.ui.spend.col_cost`),value:uC(o),badge:(0,P.jsx)(`span`,{className:`est`,children:t(`web.ui.sidebar.cost_est`)})})]}),(r===0||s===void 0)&&(0,P.jsx)(`p`,{className:`spend__line`,children:t(`web.ui.spend.total_unmeasured`,{turns:String(n)})}),i>0&&i<r&&(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,P.jsx)(`p`,{children:t(`web.ui.spend.partial`,{priced:String(i),unpriced:String(r-i)})})}),r>0&&i===0&&(0,P.jsxs)(`div`,{className:`note-block`,"data-tone":`warn`,children:[(0,P.jsx)(`p`,{children:t(`web.ui.spend.unknown`)}),(0,P.jsx)(`p`,{children:t(`web.ui.spend.unknown_hint`)})]}),(0,P.jsx)(_C,{tokens:a,t})]})}function _C({tokens:e,t}){let n=pC.map(t=>({...t,n:e[t.pick]})).filter(e=>e.n!==void 0);if(n.length===0)return null;let r=Math.max(...n.map(e=>e.n),1);return(0,P.jsx)(`ul`,{className:`spend__rows`,children:n.map(n=>(0,P.jsxs)(`li`,{className:`spend__row`,...`tier`in n?{"data-tier":n.tier}:{},children:[(0,P.jsx)(`span`,{className:`spend__label`,children:t(n.label)}),(0,P.jsx)(`span`,{className:`spend__n`,title:e_(n.n),children:t_(n.n)}),(0,P.jsx)(`span`,{className:`spend__bar`,"aria-hidden":`true`,children:(0,P.jsx)(`i`,{style:{width:`${Math.max(1,Math.round(n.n/r*lC))}%`}})}),n.pick===`output`&&e.reasoning!==void 0&&(0,P.jsx)(`span`,{className:`spend__detail`,children:t(`web.ui.spend.tok_reasoning`,{n:t_(e.reasoning)})}),n.pick===`cacheHit`&&(0,P.jsx)(`span`,{className:`spend__detail`,children:t(`web.ui.spend.tok_cache_note`)})]},n.pick))})}function vC({turns:e,t}){return(0,P.jsxs)(`div`,{className:`spendturns`,children:[(0,P.jsxs)(`div`,{className:`spendturns__head`,"aria-hidden":`true`,children:[(0,P.jsx)(`span`,{children:t(`web.ui.spend.col_turn`)}),(0,P.jsx)(`span`,{children:t(`web.ui.spend.col_model`)}),(0,P.jsx)(`span`,{children:t(`web.ui.spend.col_tokens`)}),(0,P.jsx)(`span`,{children:t(`web.ui.spend.col_cost`)})]}),e.map((e,n)=>(0,P.jsx)(yC,{n:n+1,turn:e,t},e.itemId??e.seq))]})}function yC({n:e,turn:t,t:n}){let r=t.usage,i=r?E(r):void 0,a=r?.costUsd;return(0,P.jsxs)(`div`,{className:`spendturn`,children:[(0,P.jsx)(`span`,{className:`spendturn__idx`,children:n(`web.ui.spend.turn_n`,{n:String(e)})}),(0,P.jsx)(`span`,{className:`spendturn__model`,...t.model?{title:t.model}:{},children:t.model??``}),(0,P.jsx)(`span`,{className:`spendturn__tokens`,...i===void 0?{}:{title:e_(i)},children:i===void 0?``:t_(i)}),(0,P.jsx)(`span`,{className:`spendturn__usd`,children:a===void 0?``:uC(a)}),(0,P.jsx)(`span`,{className:`spendturn__meta`,children:r===void 0?n(`web.ui.spend.turn_unmeasured`):[...t.durationMs===void 0?[]:[n(`web.ui.spend.turn_took`,{d:n_(t.durationMs)})],n(`web.ui.spend.turn_tools`,{n:String(t.toolCalls)})].join(` · `)})]})}var bC={file_read:`web.ui.tools.t_file_read`,file_write:`web.ui.tools.t_file_write`,command:`web.ui.tools.t_command`,network:`web.ui.tools.t_network`,code_exec:`web.ui.tools.t_code_exec`},xC=[`file_read`,`file_write`,`command`,`network`,`code_exec`],SC={allow:`web.ui.tools.v_allow`,ask:`web.ui.tools.v_ask`,deny:`web.ui.tools.v_deny`,depends:`web.ui.tools.v_depends`};function CC({client:e,sessionId:t,onOpenSecurity:n}){let r=F(),[i,a]=v.useState(),[o,s]=v.useState();if(v.useEffect(()=>{if(!t)return;let n=!0;return s(void 0),e.tools(t).then(e=>{n&&a(e)}).catch(e=>{n&&s(e)}),()=>{n=!1}},[e,t]),!t)return(0,P.jsx)(`p`,{className:`panelcol__lede`,children:r(`web.ui.tools.no_session`)});if(o!==void 0)return(0,P.jsx)(pS,{error:o});if(!i)return(0,P.jsx)(`p`,{className:`panelcol__lede`,children:r(`web.ui.tools.loading`)});let c=i.tools.some(e=>e.gate!==void 0);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`p`,{className:`panelcol__lede`,children:[r(`web.ui.tools.lede`),(0,P.jsx)(pt,{text:r(`web.ui.tools.axes`),about:r(`web.ui.settings.pane_tools`)})]}),(0,P.jsx)(`p`,{className:`field__hint`,children:i.level===`unknown`?r(`web.ui.tools.level_unknown`):r(`web.ui.tools.level_line`,{level:i.level})}),!c&&(0,P.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,P.jsx)(`p`,{children:r(i.level===`unknown`?`web.ui.tools.ungraded_no_session`:`web.ui.tools.ungraded_no_layer`)})}),c?wC(i.tools).map(e=>(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:e.type===null?r(`web.ui.tools.t_other`):r(bC[e.type])}),(0,P.jsx)(TC,{rows:e.rows,level:i.level,t:r})]},e.type)):(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:r(`web.ui.tools.g_all`)}),(0,P.jsx)(TC,{rows:i.tools,level:i.level,t:r})]}),(0,P.jsxs)(`div`,{className:`note-block`,children:[(0,P.jsx)(`p`,{children:r(`web.ui.tools.how_to_block`)}),(0,P.jsx)(`p`,{children:(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:n,children:[(0,P.jsx)(I,{name:`shield`,size:`sm`}),r(`web.ui.tools.goto_rules`)]})})]}),(0,P.jsx)(`div`,{className:`note-block`,children:(0,P.jsx)(`p`,{children:r(`web.ui.tools.mcp_note`)})})]})}function wC(e){let t=[];for(let n of xC){let r=e.filter(e=>e.type===n);r.length>0&&t.push({type:n,rows:r})}let n=e.filter(e=>!xC.includes(e.type));return n.length>0&&t.push({type:null,rows:n}),t}function TC({rows:e,level:t,t:n}){return(0,P.jsxs)(`div`,{className:`settools`,children:[(0,P.jsxs)(`div`,{className:`settools__head`,"aria-hidden":`true`,children:[(0,P.jsx)(`span`,{children:n(`web.ui.tools.col_tool`)}),(0,P.jsx)(`span`,{children:n(`web.ui.tools.col_source`)}),(0,P.jsx)(`span`,{children:n(`web.ui.tools.col_desc`)}),(0,P.jsx)(`span`,{children:n(`web.ui.tools.col_gate`)}),(0,P.jsx)(`span`,{children:n(`web.ui.tools.col_calls`)})]}),e.map(e=>(0,P.jsx)(EC,{row:e,level:t,t:n},e.name))]})}function EC({row:e,level:t,t:n}){let r=e.gate,i=DC(r,t,n);return(0,P.jsxs)(`div`,{className:`settool`,"data-verdict":r?.verdict??`none`,"data-calls":e.calls,children:[(0,P.jsx)(`span`,{className:`settool__name`,title:e.name,children:e.name}),(0,P.jsx)(`span`,{className:`settool__src`,title:e.source,children:e.source}),(0,P.jsx)(`span`,{className:`settool__desc`,title:e.description,children:e.description}),(0,P.jsxs)(`span`,{className:`settool__gate`,children:[(0,P.jsx)(`span`,{className:`settool__verdict`,children:n(r?SC[r.verdict]:`web.ui.tools.v_none`)}),(0,P.jsx)(`span`,{className:`settool__by`,title:i,children:i}),r!==void 0&&r.conditional>0&&(0,P.jsx)(pt,{className:`settool__cond`,text:n(`web.ui.tools.cond`,{count:r.conditional}),about:e.name})]}),(0,P.jsx)(`span`,{className:`settool__calls`,children:e.calls})]})}function DC(e,t,n){if(e===void 0)return n(`web.ui.tools.by_none`);if(e.by===`sandbox`)return n(`web.ui.tools.by_sandbox`);if(e.by===`level`)return n(`web.ui.tools.by_level`,{level:t});let r=e.rule??n(`web.ui.tools.by_rule`);return e.layer===void 0?r:`${r} · ${fS(e.layer,n)}`}var OC={system:`web.ui.settings.theme_system`,light:`web.ui.settings.theme_light`,dark:`web.ui.settings.theme_dark`},kC={zh:`web.ui.settings.lang_zh`,en:`web.ui.settings.lang_en`};function AC({options:e,value:t,ariaLabel:n,onPick:r}){return(0,P.jsx)(`div`,{className:`seg`,role:`group`,"aria-label":n,children:e.map(e=>(0,P.jsx)(`button`,{type:`button`,"aria-pressed":e.value===t,onClick:()=>r(e.value),children:e.label},e.value))})}var jC=[{id:`model`,title:`web.ui.settings.pane_model`,icon:`cpu`},{id:`security`,title:`web.ui.settings.security`,icon:`shield`},{id:`tools`,title:`web.ui.settings.pane_tools`,icon:`wrench`},{id:`memory`,title:`web.ui.settings.pane_memory`,icon:`layers`},{id:`spend`,title:`web.ui.settings.pane_spend`,icon:`gauge`},{id:`budget`,title:`web.ui.settings.pane_budget`,icon:`wallet`},{id:`appearance`,title:`web.ui.settings.appearance`,icon:`sun-moon`},{id:`about`,title:`web.ui.settings.pane_about`,icon:`info`}];function MC(e){return e===`model`||e===`memory`||e===`budget`}function NC({onBack:e,client:t,sessionId:n,compression:r,about:i,diagnostics:a,initialPane:o,readOnly:s=!1,turns:c,hasHistory:l=!1}){let u=F(),[d,f]=v.useState(o??`model`),p=bS(t,n,MC(d)),m=ot(t);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`nav`,{className:`navcol`,children:[(0,P.jsxs)(`div`,{className:`navcol__head`,children:[u(`web.ui.settings.title`),(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--sm navcol__back`,type:`button`,onClick:e,children:[(0,P.jsx)(I,{name:`arrow-left`,size:`sm`}),u(`web.ui.settings.back`)]})]}),(0,P.jsx)(`ul`,{className:`navcol__list`,children:jC.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,...e.id===d?{"aria-current":`true`}:{},onClick:()=>f(e.id),children:[(0,P.jsx)(`span`,{className:`navcol__sign`,children:(0,P.jsx)(I,{name:e.icon,size:`lg`})}),(0,P.jsx)(`span`,{children:u(e.title)}),(0,P.jsx)(`span`,{})]})},e.id))})]}),(0,P.jsxs)(`section`,{className:`panelcol`,children:[(0,P.jsx)(`div`,{className:`panelcol__head`,children:(0,P.jsx)(`h1`,{className:`panelcol__title`,children:u(PC(d))})}),(0,P.jsx)(`div`,{className:`panelcol__body`,children:(0,P.jsx)(`div`,{className:`panelcol__inner`,children:MC(d)?(0,P.jsx)(SS,{pane:d,sessionId:n,client:t,catalog:m,readOnly:s,...r?{compression:r}:{},...p}):d===`security`?(0,P.jsx)(iC,{client:t,sessionId:n}):d===`tools`?(0,P.jsx)(CC,{client:t,sessionId:n,onOpenSecurity:()=>f(`security`)}):d===`spend`?(0,P.jsx)(mC,{sessionId:n,turns:c??[],hasHistory:l}):d===`about`?(0,P.jsx)(tS,{...i?{about:i}:{},...a?{diagnostics:a}:{}}):(0,P.jsx)(FC,{})})})]})]})}function PC(e){return MC(e)?yS(e):e===`security`?`web.ui.settings.security`:e===`tools`?`web.ui.settings.pane_tools`:e===`spend`?`web.ui.settings.pane_spend`:e===`about`?`web.ui.settings.pane_about`:`web.ui.settings.appearance`}function FC(){let e=F(),t=$x(),n=rt(),r=Gx.map(t=>({value:t,label:e(OC[t])})),i=[{value:ze,label:e(`web.ui.settings.lang_system`)},...pe.map(t=>({value:t,label:e(kC[t])}))];return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`panelcol__lede`,children:e(`web.ui.settings.appearance_lede`)}),(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:e(`web.ui.settings.theme`)}),(0,P.jsxs)(`div`,{className:`field`,children:[(0,P.jsx)(`div`,{className:`field__head`,children:(0,P.jsx)(`span`,{className:`field__name`,children:e(`web.ui.settings.theme_field`)})}),(0,P.jsx)(`div`,{className:`field__ctl`,children:(0,P.jsx)(AC,{options:r,value:t.pref,ariaLabel:e(`web.ui.settings.theme_field`),onPick:t.setPref})}),(0,P.jsx)(`p`,{className:`field__hint`,children:e(`web.ui.settings.theme_hint`,{now:e(t.prefersDark?OC.dark:OC.light)})})]})]}),(0,P.jsxs)(`div`,{className:`setgroup`,children:[(0,P.jsx)(`h2`,{className:`setgroup__title`,children:e(`web.ui.settings.lang`)}),(0,P.jsxs)(`div`,{className:`field`,children:[(0,P.jsx)(`div`,{className:`field__head`,children:(0,P.jsx)(`span`,{className:`field__name`,children:e(`web.ui.settings.lang_field`)})}),(0,P.jsx)(`div`,{className:`field__ctl`,children:(0,P.jsx)(AC,{options:i,value:n.pref,ariaLabel:e(`web.ui.settings.lang_field`),onPick:n.setPref})}),(0,P.jsx)(`p`,{className:`field__hint`,children:e(`web.ui.settings.lang_hint`)})]})]}),(0,P.jsx)(`div`,{className:`note-block`,children:(0,P.jsx)(`p`,{children:e(`web.ui.settings.appearance_note`)})})]})}function IC(e,t){let n=e instanceof Element?e:null;for(;n;){if(n.scrollWidth-n.clientWidth>1){let e=globalThis.getComputedStyle(n).overflowX;if(e===`auto`||e===`scroll`)return!0}if(n===t)return!1;n=n.parentElement}return!1}function LC({side:e,panelRef:t,scrimRef:n,closeDrawer:r}){v.useEffect(()=>{let i=t.current;if(e===null||!i)return;let a=n.current,o=null,s=(t,n)=>{let r=e===`left`?-t:t;i.style.setProperty(`--drawer-drag`,`${Math.round(r)}px`),a?.style.setProperty(`--drawer-progress`,(1-Math.min(1,t/n)).toFixed(3))},c=()=>{for(let e of[i,a])e?.style.setProperty(`--drawer-settle`,`var(--dur)`);i.style.setProperty(`--drawer-drag`,`0px`),a?.style.setProperty(`--drawer-progress`,`1`)},l=e=>{o=null;let t=e.touches.length===1?e.touches[0]:void 0;if(!t||IC(e.target,i))return;let n=i.getBoundingClientRect().width;if(!(n<=0)){for(let e of[i,a])e?.style.removeProperty(`--drawer-settle`);o={id:t.identifier,x0:t.clientX,y0:t.clientY,width:n,axis:null,travel:0,mark:{travel:0,at:e.timeStamp},speed:0,speedAt:e.timeStamp}}},u=t=>{if(!o)return;let n=t.touches.length===1?t.touches[0]:void 0;if(!n||n.identifier!==o.id){o=null,c();return}let r=n.clientX-o.x0,i=n.clientY-o.y0;if(o.axis===null){if(Math.abs(r)<10&&Math.abs(i)<10)return;if(Math.abs(i)>=Math.abs(r)){o=null;return}o.axis=`x`}t.preventDefault();let a=Math.max(0,e===`left`?-r:r),l=t.timeStamp-o.mark.at;l>0&&(o.speed=(a-o.mark.travel)/l,o.speedAt=t.timeStamp,o.mark={travel:a,at:t.timeStamp}),o.travel=a,s(a,o.width)},d=e=>{let t=o;if(o=null,!(!t||t.axis===null)){if(e.timeStamp-t.speedAt<=100&&t.speed>=.4||t.travel>=t.width*.5){r();return}c()}},f=()=>{o&&(o=null,c())};return i.addEventListener(`touchstart`,l,{passive:!0}),i.addEventListener(`touchmove`,u,{passive:!1}),i.addEventListener(`touchend`,d,{passive:!0}),i.addEventListener(`touchcancel`,f,{passive:!0}),()=>{i.removeEventListener(`touchstart`,l),i.removeEventListener(`touchmove`,u),i.removeEventListener(`touchend`,d),i.removeEventListener(`touchcancel`,f);for(let e of[i,a])e?.style.removeProperty(`--drawer-drag`),e?.style.removeProperty(`--drawer-progress`),e?.style.removeProperty(`--drawer-settle`)}},[e,t,n,r])}var RC=1180;function zC(e){let t=`(width <= ${e}px)`,n=v.useCallback(e=>{let n=globalThis.matchMedia?.(t);return n?(n.addEventListener(`change`,e),()=>n.removeEventListener(`change`,e)):()=>void 0},[t]),r=v.useCallback(()=>globalThis.matchMedia?.(t).matches??!1,[t]);return v.useSyncExternalStore(n,r,()=>!1)}function BC(){let e=zC(860),t=zC(RC),[n,r]=v.useState(!1),[i,a]=v.useState(null),o=v.useRef(null),s=v.useRef(null);return v.useEffect(()=>{a(n=>n===`sidebar`&&!e||n===`inspector`&&!t?null:n)},[e,t]),{inspectorShown:t?i===`inspector`:n,drawer:i,overlaySidebar:e,sidebarRef:o,inspectorRef:s,toggleInspector:v.useCallback(()=>{t?a(e=>e===`inspector`?null:`inspector`):r(e=>!e)},[t]),openInspector:v.useCallback(()=>{t?a(`inspector`):r(!0)},[t]),toggleSidebar:v.useCallback(()=>{a(e=>e===`sidebar`?null:`sidebar`)},[]),closeDrawer:v.useCallback(()=>a(null),[])}}function VC({panels:e}){let{drawer:t,closeDrawer:n,sidebarRef:r,inspectorRef:i}=e,a=t!==null,o=t===`sidebar`?r:i,s=v.useRef(null);return LC({side:t===null?null:t===`sidebar`?`left`:`right`,panelRef:o,scrimRef:s,closeDrawer:n}),v.useEffect(()=>{if(!a)return;let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a,n]),v.useEffect(()=>{if(!a)return;let e=document.activeElement;return o.current?.focus(),()=>{e instanceof HTMLElement&&e.focus()}},[a,o]),a?(0,P.jsx)(`div`,{className:`drawer-scrim`,role:`presentation`,ref:s,onClick:n}):null}var HC=1500;function UC({row:e,root:t,onBack:n}){let r=F(),i=Oe(e.path),a=e.path.slice(0,e.path.length-i.length),o=qC(t,e.path),s=e.newContent??``,c=v.useMemo(()=>Bg(s),[s]),l=v.useMemo(()=>Vg(s),[s]),u=c.kind===`text`?void 0:zg[c.kind];return(0,P.jsxs)(`div`,{className:`preview`,children:[(0,P.jsxs)(`header`,{className:`preview__head`,children:[(0,P.jsx)(`button`,{className:`btn btn--ghost btn--icon`,type:`button`,"aria-label":r(`web.ui.art.back`),title:r(`web.ui.art.back`),onClick:n,children:(0,P.jsx)(I,{name:`arrow-left`})}),(0,P.jsxs)(`span`,{className:`path preview__path`,title:o,children:[(0,P.jsx)(`i`,{children:a}),(0,P.jsx)(`b`,{children:i})]}),(0,P.jsx)(`span`,{className:`preview__ro`,children:r(`web.ui.art.readonly`)}),(0,P.jsx)(KC,{path:o,t:r})]}),(0,P.jsx)(`p`,{className:`preview__meta`,children:GC(e,c,r)}),(0,P.jsx)(`div`,{className:`preview__body`,children:u?(0,P.jsx)(L,{text:r(u.why)}):(0,P.jsx)(`pre`,{className:`preview__code`,children:(0,P.jsx)(`code`,{children:l.text})})}),!u&&l.clipped&&(0,P.jsx)(L,{className:`preview__note`,text:WC(l,r)}),!u&&c.lost>0&&(0,P.jsx)(L,{className:`preview__note`,text:r(`web.ui.art.lossy`,{count:c.lost})}),(0,P.jsx)(L,{className:`preview__note`,text:r(`web.ui.art.binary_note`)})]})}function WC(e,t){return e.by===`chars`?t(`web.ui.art.clip_chars`,{line:e.shownLines,total:e.totalLines}):t(`web.ui.art.clip_lines`,{shown:e.shownLines,total:e.totalLines})}function GC(e,t,n){let r=e.newContent??``,i=[];return t.kind===`text`?(i.push(n(`web.ui.art.lines`,{count:Gr(r)})),t.lost===0&&i.push(Jr(new TextEncoder().encode(r).length))):i.push(n(zg[t.kind].label)),e.tool&&i.push(n(e.oldContent===void 0?`web.ui.art.by_created`:`web.ui.art.by_changed`,{tool:e.tool})),i.join(` · `)}function KC({path:e,t}){let[n,r]=v.useState(!1);return v.useEffect(()=>{if(!n)return;let e=setTimeout(()=>r(!1),HC);return()=>clearTimeout(e)},[n]),(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>r(!0))},children:[(0,P.jsx)(I,{name:n?`check`:`copy`,size:`sm`}),t(n?`web.ui.thread.copied`:`web.ui.art.copy_path`)]})}function qC(e,t){if(e===null||JC(t))return t;let n=e.includes(`\\`)?`\\`:`/`;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${n===`\\`?t.replaceAll(`/`,`\\`):t}`}function JC(e){return/^([a-zA-Z]:[\\/]|[\\/])/.test(e)}function YC(e,t,n){let[r,i]=v.useState({phase:`loading`}),a=F();return v.useEffect(()=>{if(!t||!n){i({phase:`error`,message:a(`web.ui.file.no_session`)});return}let r=!0;return i({phase:`loading`}),(async()=>{try{let o=(await t.fileStat(n,[e])).files[0];if(!r)return;if(!o)return i({phase:`error`,message:a(`web.ui.file.no_answer`)});if(!o.ok)return i({phase:`error`,message:a(XC[o.refusal])});if(o.kind!==`text`)return i({phase:`ready`,stat:o});let s=await t.fileText(n,e);r&&i({phase:`ready`,stat:o,text:s.text})}catch(e){r&&i({phase:`error`,message:ZC(e,a)})}})(),()=>{r=!1}},[e,t,n,a]),r}var XC={denied:`web.ui.file.denied`,missing:`web.ui.file.missing`,"not-a-file":`web.ui.file.not_a_file`,"too-large":`web.ui.file.too_large`,unreadable:`web.ui.file.unreadable`};function ZC(e,t){let n=e instanceof Error?e.message:String(e);return n.trim()===``?t(`web.ui.file.unreadable`):n}function QC({path:e,client:t,sessionId:n,onBack:r}){let i=F(),a=YC(e,t,n),o=Oe(e),s=e.slice(0,e.length-o.length);return(0,P.jsxs)(`div`,{className:`preview`,children:[(0,P.jsxs)(`header`,{className:`preview__head`,children:[(0,P.jsx)(`button`,{className:`btn btn--ghost btn--icon`,type:`button`,"aria-label":i(`web.ui.art.back`),title:i(`web.ui.art.back`),onClick:r,children:(0,P.jsx)(I,{name:`arrow-left`})}),(0,P.jsxs)(`span`,{className:`path preview__path`,title:e,children:[(0,P.jsx)(`i`,{children:s}),(0,P.jsx)(`b`,{children:o})]}),(0,P.jsx)(`span`,{className:`preview__ro`,children:i(`web.ui.art.readonly`)}),(0,P.jsx)(KC,{path:e,t:i})]}),a.phase===`loading`&&(0,P.jsx)(`p`,{className:`preview__meta`,children:i(`web.ui.file.loading`)}),a.phase===`error`&&(0,P.jsx)(`div`,{className:`preview__body`,children:(0,P.jsx)(L,{tone:`error`,text:a.message})}),a.phase===`ready`&&a.stat.ok&&(0,P.jsx)($C,{stat:a.stat,...a.text===void 0?{}:{text:a.text},path:e,...t?{client:t}:{},...n?{sessionId:n}:{}})]})}function $C({stat:e,text:t,path:n,client:r,sessionId:i}){let a=F(),o=r&&i?r.fileBytesUrl(i,n):void 0;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`preview__meta`,children:nw(e,t,a)}),(0,P.jsx)(`div`,{className:`preview__body`,children:(0,P.jsx)(ew,{kind:e.kind,...t===void 0?{}:{text:t},...o?{src:o}:{}})}),t!==void 0&&(0,P.jsx)(tw,{text:t}),e.kind===`opaque`&&(0,P.jsx)(rw,{stat:e,path:n,...r?{client:r}:{},...i?{sessionId:i}:{},...o?{src:o}:{}})]})}function ew({kind:e,text:t,src:n}){let r=F();if(e===`text`){let e=Bg(t??``);return e.kind===`text`?(0,P.jsx)(`pre`,{className:`preview__code`,children:(0,P.jsx)(`code`,{children:Vg(t??``).text})}):(0,P.jsx)(L,{text:r(zg[e.kind].why)})}return n?e===`image`?(0,P.jsx)(`img`,{className:`preview__media`,src:n,alt:``}):e===`pdf`?(0,P.jsx)(`iframe`,{className:`preview__pdf`,src:n,title:``}):e===`audio`?(0,P.jsx)(`audio`,{className:`preview__media`,src:n,controls:!0}):e===`video`?(0,P.jsx)(`video`,{className:`preview__media`,src:n,controls:!0}):(0,P.jsx)(L,{text:r(`web.ui.file.opaque`)}):(0,P.jsx)(L,{text:r(`web.ui.file.no_session`)})}function tw({text:e}){let t=F(),n=Vg(e);return n.clipped?(0,P.jsx)(L,{className:`preview__note`,text:n.by===`chars`?t(`web.ui.art.clip_chars`,{line:n.shownLines,total:n.totalLines}):t(`web.ui.art.clip_lines`,{shown:n.shownLines,total:n.totalLines})}):null}function nw(e,t,n){let r=[];return t!==void 0&&r.push(n(`web.ui.art.lines`,{count:Gr(t)})),r.push(Jr(e.bytes)),e.mtimeMs>0&&r.push(new Date(e.mtimeMs).toLocaleString()),r.join(` · `)}function rw({stat:e,path:t,client:n,sessionId:r,src:i}){let a=F(),[o,s]=v.useState();return(0,P.jsxs)(`div`,{className:`preview__acts`,children:[e.openable&&n&&r&&(0,P.jsxs)(`button`,{className:`btn btn--sm`,type:`button`,onClick:()=>{s(void 0),n.openFile(r,t).then(e=>s(e.ok?void 0:e.message)).catch(e=>s(ZC(e,a)))},children:[(0,P.jsx)(I,{name:`arrow-up-right`,size:`sm`}),a(`web.ui.file.open_with_app`)]}),i&&(0,P.jsx)(`a`,{className:`btn btn--ghost btn--sm`,href:i,download:Oe(t),children:a(`web.ui.file.download`)}),o&&(0,P.jsx)(L,{tone:`error`,className:`preview__note`,text:o})]})}function iw({limits:e,busy:t,initial:n,mode:r,onSubmit:i,onCancel:a}){let o=F(),[s,c]=v.useState(n??``),[l,u]=v.useState(``);return(0,P.jsxs)(`form`,{className:`goal__form`,onSubmit:e=>{e.preventDefault();let t=l.trim();i(s,t===``?void 0:Number(t))},children:[(0,P.jsxs)(`label`,{className:`goal__field`,children:[(0,P.jsx)(`span`,{className:`goal__label`,children:o(`web.ui.goal.objective_label`)}),(0,P.jsx)(`textarea`,{className:`goal__text`,value:s,rows:3,disabled:t,placeholder:o(`web.ui.goal.objective_hint`),...e?{maxLength:e.maxObjectiveChars}:{},onChange:e=>c(e.target.value)})]}),r===void 0&&(0,P.jsxs)(`label`,{className:`goal__field goal__field--inline`,children:[(0,P.jsx)(`span`,{className:`goal__label`,children:o(`web.ui.goal.budget_label`)}),(0,P.jsx)(`input`,{className:`goal__num`,type:`number`,inputMode:`numeric`,min:1,value:l,disabled:t,placeholder:e?String(e.defaultMaxRounds):``,...e?{max:e.maxRounds}:{},onChange:e=>u(e.target.value)}),e&&(0,P.jsx)(`span`,{className:`goal__hint`,children:o(`web.ui.goal.budget_hint`,{n:e.defaultMaxRounds,max:e.maxRounds})})]}),(0,P.jsxs)(`div`,{className:`goal__acts`,children:[(0,P.jsx)(`button`,{type:`submit`,className:`btn btn--primary btn--sm`,disabled:t,children:o(r===`edit`?`web.ui.goal.save_edit`:`web.ui.goal.save_create`)}),a&&(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,onClick:a,children:o(`web.ui.goal.cancel`)})]})]})}function aw({limits:e,busy:t,initial:n,onSubmit:r,onCancel:i}){let a=F(),[o,s]=v.useState(String(n));return(0,P.jsxs)(`form`,{className:`goal__form`,onSubmit:e=>{e.preventDefault(),r(Number(o.trim()))},children:[(0,P.jsxs)(`label`,{className:`goal__field goal__field--inline`,children:[(0,P.jsx)(`span`,{className:`goal__label`,children:a(`web.ui.goal.budget_label`)}),(0,P.jsx)(`input`,{className:`goal__num`,type:`number`,inputMode:`numeric`,min:1,value:o,disabled:t,...e?{max:e.maxRounds}:{},onChange:e=>s(e.target.value)})]}),(0,P.jsx)(L,{text:a(`web.ui.goal.budget_warn`)}),(0,P.jsxs)(`div`,{className:`goal__acts`,children:[(0,P.jsx)(`button`,{type:`submit`,className:`btn btn--primary btn--sm`,disabled:t,children:a(`web.ui.goal.save_budget`)}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,onClick:i,children:a(`web.ui.goal.cancel`)})]})]})}function ow({limits:e,busy:t,onSubmit:n,onCancel:r}){let i=F(),[a,o]=v.useState(``);return(0,P.jsxs)(`form`,{className:`goal__form`,onSubmit:e=>{e.preventDefault(),n(a)},children:[(0,P.jsxs)(`label`,{className:`goal__field`,children:[(0,P.jsx)(`span`,{className:`goal__label`,children:i(`web.ui.goal.evidence_label`)}),(0,P.jsx)(`textarea`,{className:`goal__text`,value:a,rows:2,disabled:t,placeholder:i(`web.ui.goal.evidence_hint`),...e?{maxLength:e.maxReasonChars}:{},onChange:e=>o(e.target.value)})]}),(0,P.jsxs)(`div`,{className:`goal__acts`,children:[(0,P.jsx)(`button`,{type:`submit`,className:`btn btn--primary btn--sm`,disabled:t,children:i(`web.ui.goal.save_complete`)}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,onClick:r,children:i(`web.ui.goal.cancel`)})]})]})}var sw={active:{icon:`target`,key:`web.ui.goal.phase_active`},paused:{icon:`square`,key:`web.ui.goal.phase_paused`},blocked:{icon:`triangle-alert`,key:`web.ui.goal.phase_blocked`,tone:`warn`},complete:{icon:`check`,key:`web.ui.goal.phase_complete`,tone:`done`}},cw={busy:`web.ui.goal.refuse.busy`,"no-goal":`web.ui.goal.refuse.no_goal`,"empty-objective":`web.ui.goal.refuse.empty_objective`,"objective-too-long":`web.ui.goal.refuse.objective_too_long`,"bad-budget":`web.ui.goal.refuse.bad_budget`,"bad-block-code":`web.ui.goal.refuse.bad_block_code`,"empty-block-message":`web.ui.goal.refuse.empty_block_message`,"empty-evidence":`web.ui.goal.refuse.empty_evidence`,"wrong-phase":`web.ui.goal.refuse.wrong_phase`,unavailable:`web.ui.goal.refuse.unavailable`};function lw(e){let t=F(),{goal:n,limits:r,loading:i,error:a,refusal:o,busy:s}=e;return a?(0,P.jsx)(L,{text:a,tone:`error`}):n===null?i?(0,P.jsx)(`p`,{className:`empty`,children:t(`web.ui.goal.loading`)}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`empty`,children:t(`web.ui.goal.empty`)}),(0,P.jsx)(L,{text:t(`web.ui.goal.empty_hint`)}),o&&(0,P.jsx)(fw,{code:o,limits:r}),(0,P.jsx)(iw,{...r?{limits:r}:{},busy:s,onSubmit:(t,n)=>e.create(t,n)})]}):(0,P.jsx)(uw,{goal:n,...r?{limits:r}:{},busy:s,...o?{refusal:o}:{},onUpdate:e.update,onClear:e.clear})}function uw({goal:e,limits:t,busy:n,refusal:r,onUpdate:i,onClear:a}){let o=F(),[s,c]=v.useState(null),l=sw[e.phase],u=async e=>{await i(e)&&c(null)};return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`p`,{className:`goal__phase`,...l.tone?{"data-tone":l.tone}:{},children:[(0,P.jsx)(`span`,{className:`goal__sign`,children:(0,P.jsx)(I,{name:l.icon,size:`sm`})}),(0,P.jsx)(`span`,{children:o(l.key)}),(0,P.jsx)(`span`,{className:`goal__rounds`,title:o(`web.ui.goal.rounds_hint`),children:o(`web.ui.goal.rounds`,{used:e.roundsUsed,max:e.maxRounds})})]}),(0,P.jsx)(`p`,{className:`goal__objective`,children:e.objective}),e.block&&(0,P.jsxs)(`div`,{className:`goal__block`,role:`note`,children:[(0,P.jsx)(`code`,{className:`goal__code`,children:e.block.code}),(0,P.jsx)(`span`,{children:e.block.message})]}),e.completeEvidence!==void 0&&(0,P.jsxs)(`div`,{className:`goal__evidence`,children:[(0,P.jsx)(`span`,{className:`goal__label`,children:o(`web.ui.goal.evidence`)}),(0,P.jsx)(`span`,{children:e.completeEvidence})]}),r&&(0,P.jsx)(fw,{code:r,limits:t}),(0,P.jsx)(dw,{goal:e,busy:n,open:s,onOpen:c,onUpdate:u,onClear:a}),s===`edit`&&(0,P.jsx)(iw,{...t?{limits:t}:{},busy:n,initial:e.objective,mode:`edit`,onSubmit:e=>u({action:`edit`,objective:e}),onCancel:()=>c(null)}),s===`budget`&&(0,P.jsx)(aw,{...t?{limits:t}:{},busy:n,initial:e.maxRounds,onSubmit:e=>u({action:`budget`,maxRounds:e}),onCancel:()=>c(null)}),s===`complete`&&(0,P.jsx)(ow,{...t?{limits:t}:{},busy:n,onSubmit:e=>u({action:`complete`,evidence:e}),onCancel:()=>c(null)})]})}function dw({goal:e,busy:t,open:n,onOpen:r,onUpdate:i,onClear:a}){let o=F(),s=e.phase===`complete`;return(0,P.jsxs)(`div`,{className:`goal__acts`,children:[!s&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`button`,{type:`button`,className:`btn btn--sm`,disabled:t,"aria-pressed":n===`edit`,onClick:()=>r(n===`edit`?null:`edit`),children:o(`web.ui.goal.act_edit`)}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--sm`,disabled:t,"aria-pressed":n===`budget`,onClick:()=>r(n===`budget`?null:`budget`),children:o(`web.ui.goal.act_budget`)}),e.phase===`active`?(0,P.jsx)(`button`,{type:`button`,className:`btn btn--sm`,disabled:t,onClick:()=>void i({action:`pause`}),children:o(`web.ui.goal.act_pause`)}):(0,P.jsx)(`button`,{type:`button`,className:`btn btn--sm`,disabled:t,onClick:()=>void i({action:`resume`}),children:o(`web.ui.goal.act_resume`)}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--sm`,disabled:t,"aria-pressed":n===`complete`,onClick:()=>r(n===`complete`?null:`complete`),children:o(`web.ui.goal.act_complete`)})]}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--sm btn--ghost`,disabled:t,onClick:()=>void a(),children:o(`web.ui.goal.act_clear`)})]})}function fw({code:e,limits:t}){let n=F(),r=t===void 0?void 0:{chars:t.maxObjectiveChars,max:t.maxRounds};return(0,P.jsx)(L,{text:n(cw[e],r),tone:`error`})}function pw(e,t,n,r=!0){let[i,a]=v.useState({markdown:null,loading:!0}),o=n===void 0||n===`idle`;return v.useEffect(()=>{if(!r||!e||!t||!o)return;let n=!0;return e.plan(t).then(({plan:e})=>{n&&a({markdown:e,loading:!1})}).catch(e=>{n&&a({markdown:null,loading:!1,error:e instanceof Error?e.message:String(e)})}),()=>{n=!1}},[r,e,t,o]),i}function mw({markdown:e,loading:t,error:n}){let r=F();return n?(0,P.jsx)(hw,{text:n,tone:`error`}):e===null?t?(0,P.jsx)(`p`,{className:`empty`,children:r(`web.ui.plan.loading`)}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:`empty`,children:r(`web.ui.plan.empty`)}),(0,P.jsx)(hw,{text:r(`web.ui.plan.empty_hint`)})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(hw,{text:r(`web.ui.plan.note`)}),(0,P.jsx)(Mg,{text:e})]})}function hw({text:e,tone:t}){return(0,P.jsxs)(`p`,{className:`note`,...t?{"data-tone":t,role:`alert`}:{},children:[(0,P.jsx)(`span`,{className:`note__sign`,children:(0,P.jsx)(I,{name:t?`circle-x`:`info`,size:`sm`})}),(0,P.jsx)(`span`,{children:e})]})}var gw=[{id:`patch`,key:`web.ui.inspector.patch`,icon:`file-diff`},{id:`output`,key:`web.ui.inspector.output`,icon:`terminal`},{id:`artifact`,key:`web.ui.inspector.artifact`,icon:`layers`},{id:`plan`,key:`web.ui.inspector.plan`,icon:`list-checks`},{id:`goal`,key:`web.ui.inspector.goal`,icon:`target`}];function _w({patches:e=[],onLocate:t,client:n,sessionId:r,turn:i,previewPath:a,onClosePreviewPath:o,toolArtifacts:s=[],resolveArtifact:c,tasks:l=gx,rootRef:u}){let d=F(),[f,p]=v.useState(gw[0]?.id??`patch`),[m,h]=v.useState(),g=Br(n,r,i),_=v.useMemo(()=>Lr(g.changes,e),[g.changes,e]),y=pw(n,r,i,f===`plan`),b=kx(n,r,i,f===`goal`),x={patch:e.length,artifact:_.length,output:l.tasks.length};return(0,P.jsxs)(`aside`,{className:`inspector`,"data-mode":m||a!==void 0?`preview`:`list`,ref:u,tabIndex:-1,"aria-label":d(`web.ui.topbar.inspector`),children:[(0,P.jsx)(`div`,{className:`tabs`,role:`tablist`,children:gw.map(e=>(0,P.jsxs)(`button`,{id:`tab-${e.id}`,className:`tab`,role:`tab`,type:`button`,"aria-selected":e.id===f,"aria-controls":`panel-${e.id}`,"aria-label":d(e.key),title:d(e.key),onClick:()=>p(e.id),children:[(0,P.jsx)(I,{name:e.icon,size:`sm`}),(0,P.jsx)(`span`,{className:`tab__label`,children:d(e.key)}),(x[e.id]??0)>0&&(0,P.jsx)(`span`,{className:`tab__n`,children:x[e.id]})]},e.id))}),(0,P.jsx)(`div`,{className:`inspector__body`,children:gw.map(n=>(0,P.jsx)(`section`,{className:`inspector__panel`,id:`panel-${n.id}`,role:`tabpanel`,"aria-labelledby":`tab-${n.id}`,hidden:f!==n.id,children:n.id===`patch`?(0,P.jsx)(Ex,{patches:e,...t?{onLocate:t}:{}}):n.id===`artifact`?(0,P.jsx)(Vr,{changes:_,artifacts:s,bound:g.root!==null,loading:g.loading,...g.error===void 0?{}:{error:g.error},onOpen:h,...t?{onLocate:t}:{},...c?{resolveArtifact:c}:{}}):n.id===`plan`?(0,P.jsx)(mw,{markdown:y.markdown,loading:y.loading,...y.error===void 0?{}:{error:y.error}}):n.id===`goal`?(0,P.jsx)(lw,{goal:b.goal,...b.limits?{limits:b.limits}:{},loading:b.loading,busy:b.busy,...b.error===void 0?{}:{error:b.error},...b.refusal===void 0?{}:{refusal:b.refusal},create:b.create,update:b.update,clear:b.clear}):n.id===`output`?(0,P.jsx)(vx,{tasks:l.tasks,loading:l.loading,...l.error===void 0?{}:{error:l.error}}):null},n.id))}),a===void 0?m&&(0,P.jsx)(UC,{row:m,root:g.root,onBack:()=>h(void 0)}):(0,P.jsx)(QC,{path:a,...n?{client:n}:{},...r?{sessionId:r}:{},onBack:()=>o?.()})]})}function vw(e,t,n){let[r,i]=v.useState(),[a,o]=v.useState(),[s,c]=v.useState([]),[l,u]=v.useState(),[d,f]=v.useState(!1);v.useEffect(()=>{if(!t){i(void 0);return}let n=!0;return e.model(t).then(e=>{n&&(i(e.selection??void 0),o(e.configured??void 0))}).catch(()=>void 0),()=>{n=!1}},[e,t]);let p=v.useCallback(async r=>{if(!t)return null;f(!0);try{let a=await e.setModel(t,r,n===void 0?{}:{usedTokens:n});return a.ok?(i(a.selection),c(a.caveats),u(void 0),a):(u(a.rejection),c([]),a)}catch{return u(void 0),null}finally{f(!1)}},[e,t,n]);return{...r?{selection:r}:{},...a?{configured:a}:{},switchTo:p,caveats:s,...l?{rejection:l}:{},busy:d}}function yw({draft:e,busy:t,onChange:n,onSubmit:r}){let i=F();return(0,P.jsxs)(`form`,{className:`menu__search`,onSubmit:t=>{t.preventDefault();let n=e.trim();n&&r(n)},children:[(0,P.jsx)(I,{name:`search`,size:`sm`}),(0,P.jsx)(`input`,{type:`text`,value:e,placeholder:i(`web.ui.model.placeholder`),"aria-label":i(`web.ui.model.placeholder`),disabled:t,onChange:e=>n(e.target.value)})]})}function bw(e,t){switch(t.code){case`no-credential`:return t.envVar?e(`web.ui.model.rej_no_credential`,{provider:t.provider,env:t.envVar}):e(`web.ui.model.rej_no_credential_bare`,{provider:t.provider});case`images-unsupported`:return e(`web.ui.model.rej_images`,{model:t.model});case`context-overflow`:return e(`web.ui.model.rej_context`,{model:t.model,used:Sw(t.usedTokens),window:Sw(t.contextLength)})}}function xw(e,t){switch(t.code){case`context-tight`:return e(`web.ui.model.cav_context_tight`,{model:t.model,used:Sw(t.usedTokens),window:Sw(t.contextLength)});case`no-tools`:return e(`web.ui.model.cav_no_tools`,{model:t.model})}}function Sw(e){return e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function Cw({model:e,catalog:t,onConfigureKey:n}){let r=F(),[i,a]=v.useState(!1),[o,s]=v.useState(``),c=v.useRef(null),l=v.useCallback(()=>a(!1),[]),u=e.selection;if(!u)return null;let d=async n=>{let r=await e.switchTo(Nt(n,t?.provider,u.provider));r?.ok&&r.caveats.length===0&&(s(``),a(!1))};return(0,P.jsxs)(`span`,{children:[(0,P.jsxs)(`button`,{type:`button`,ref:c,className:`btn btn--ghost`,"aria-expanded":i,"aria-haspopup":`true`,"aria-label":r(`web.ui.model.trigger`,{model:u.model}),onClick:()=>a(e=>!e),children:[u.model,(0,P.jsx)(I,{name:`chevron-down`,size:`sm`})]}),(0,P.jsxs)(yt,{open:i,onClose:l,triggerRef:c,label:r(`web.ui.model.label`),children:[(0,P.jsx)(bt,{checked:!0,disabled:!0,title:u.model,detail:r(`web.ui.model.current`,{provider:u.provider}),onSelect:()=>void 0}),e.configured&&(0,P.jsx)(bt,{disabled:u.origin===`config`||e.busy,title:r(`web.ui.model.reset`),detail:e.configured,onSelect:()=>void d(null)}),(0,P.jsx)(xt,{}),t?(0,P.jsx)(Tt,{catalog:t,value:o,onChange:s,busy:e.busy,onPick:e=>void d(e),onSubmit:e=>void d(e),...n?{onConfigureKey:()=>{a(!1),n()}}:{}}):(0,P.jsx)(yw,{draft:o,busy:e.busy,onChange:s,onSubmit:e=>void d(e)}),e.rejection&&(0,P.jsx)(St,{tone:`warn`,children:(0,P.jsx)(`p`,{children:bw(r,e.rejection)})}),e.caveats.length>0&&(0,P.jsx)(St,{tone:`warn`,children:e.caveats.map(e=>(0,P.jsx)(`p`,{children:xw(r,e)},e.code))})]})]})}function ww({handle:e}){let t=F();return(0,P.jsxs)(`div`,{className:`newsession`,children:[(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--row`,type:`button`,disabled:e.busy,onClick:()=>e.createDeferred(),children:[(0,P.jsx)(I,{name:`plus`}),t(`web.ui.newsession.open`)]}),e.error&&(0,P.jsx)(`p`,{className:`newsession__err`,role:`alert`,children:e.error})]})}function Tw(){let e=globalThis.navigator;return e?[e.userAgentData?.platform,e.platform,e.userAgent].filter(e=>typeof e==`string`&&e.length>0):[]}function Ew(e=Tw()){return e.some(e=>/^(mac|iphone|ipad|ipod)/i.test(e)||/\b(macintosh|iphone|ipad)\b/i.test(e))}function Dw(e,t){return Ew(t)?`⌘${e}`:`Ctrl+${e}`}var Ow=`nav-capability-sub`;function kw({open:e,onToggle:t,onOpen:n,current:r}){let i=F(),a=r!==void 0;return(0,P.jsxs)(`div`,{className:`navgroup`,children:[(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--row navgroup__head`,type:`button`,"aria-expanded":e,"aria-controls":Ow,...a?{"aria-disabled":!0}:{},onClick:()=>{a||t()},children:[(0,P.jsx)(I,{name:`user-round`}),i(`web.ui.cap.title`),(0,P.jsx)(`span`,{className:`navgroup__mark`,"aria-hidden":`true`,children:(0,P.jsx)(I,{name:e?`chevron-down`:`chevron-right`,size:`sm`})})]}),e&&(0,P.jsx)(`ul`,{className:`navgroup__sub`,id:Ow,children:Dy.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--row`,type:`button`,"aria-current":e.id===r?`true`:void 0,onClick:()=>n(e.id),children:[(0,P.jsx)(I,{name:e.icon,size:`sm`}),i(e.title)]})},e.id))})]})}var Aw={warn:`triangle-alert`,failed:`circle-alert`},jw=200;function Mw({sessionId:e,brand:t,usage:n,usageScope:r,maxCostUsd:i,diagnostics:a,tasks:o,newSession:s,acts:c,menu:l,onMenuSelect:u,onOpenSettings:d,onOpenCapability:f,capTab:p,onOpenAutomation:m,pendingAutomation:h,sessions:g,hits:_,onOpenSession:y,onSearch:b,rootRef:x}){let S=F(),[C,w]=v.useState(``),[ee,te]=v.useState(!1),ne=_??g,T=p!==void 0||ee;v.useEffect(()=>{let e=setTimeout(()=>b(C.trim()||void 0),jw);return()=>clearTimeout(e)},[C,b]);let re=v.useCallback(()=>b(C.trim()||void 0),[b,C]),ie=(a??[]).filter(e=>e.status===`failed`||e.status===`warn`),ae=e&&r===`session`&&i!==void 0&&n?.costUsd!==void 0?{spent:n.costUsd,limit:i}:void 0,oe=o!==void 0&&o.total>0,se=ae!==void 0||oe,ce=se||ie.length>0,le=l!==void 0&&l.length>0&&u!==void 0?{items:l,onSelect:u}:void 0;return(0,P.jsxs)(`aside`,{className:`sidebar`,ref:x,tabIndex:-1,"aria-label":S(`web.ui.topbar.sidebar`),children:[(0,P.jsxs)(`div`,{className:`sidebar__head`,children:[t!==void 0&&(0,P.jsx)(`span`,{className:`brandslot`,title:t,children:t}),(0,P.jsxs)(`label`,{className:`ssearch`,children:[(0,P.jsx)(I,{name:`search`,size:`sm`}),(0,P.jsx)(`input`,{type:`search`,value:C,onChange:e=>w(e.target.value),placeholder:S(`web.ui.sidebar.search`),"aria-label":S(`web.ui.sidebar.search`)})]})]}),(0,P.jsxs)(`div`,{className:`sidebar__scroll`,children:[(0,P.jsxs)(`div`,{className:`actions`,children:[s&&(0,P.jsx)(ww,{...s}),(0,P.jsx)(kw,{open:T,onToggle:()=>te(e=>!e),onOpen:f,...p?{current:p}:{}}),(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--row`,type:`button`,onClick:m,children:[(0,P.jsx)(I,{name:`rotate-ccw`}),S(`web.ui.sidebar.automation`),h!==void 0&&h>0&&(0,P.jsx)(`span`,{className:`btn__dot`,title:S(`web.ui.sidebar.automation_pending`,{count:h}),"aria-label":S(`web.ui.sidebar.automation_pending`,{count:h})})]})]}),(0,P.jsx)(zn,{sessions:ne,...e?{currentSessionId:e}:{},onOpen:y,searching:C.trim().length>0,...c?{acts:{...c,reload:re}}:{},...s?{newSession:s.handle}:{}})]}),ce&&(0,P.jsxs)(`div`,{className:`sidebar__foot`,children:[se&&(0,P.jsxs)(`div`,{className:`meter`,children:[ae&&(0,P.jsxs)(`div`,{className:`meter__row`,children:[(0,P.jsx)(`span`,{children:S(`web.ui.sidebar.cost`)}),(0,P.jsxs)(`b`,{children:[S(`web.ui.sidebar.cost_of`,{spent:ae.spent.toFixed(3),limit:ae.limit.toFixed(2)}),` `,(0,P.jsx)(`span`,{className:`est`,children:S(`web.ui.sidebar.cost_est`)})]})]}),o!==void 0&&o.total>0&&(0,P.jsxs)(`div`,{className:`meter__row`,children:[(0,P.jsx)(`span`,{children:S(`web.ui.sidebar.tasks`)}),(0,P.jsx)(`b`,{children:S(`web.ui.sidebar.tasks_of`,{running:o.running,total:o.total})})]})]}),ie.length>0&&(0,P.jsx)(`ul`,{className:`diag`,children:ie.map((e,t)=>(0,P.jsxs)(`li`,{"data-level":e.status,children:[(0,P.jsx)(`span`,{className:`diag__sign`,children:(0,P.jsx)(I,{name:Aw[e.status],size:`sm`})}),(0,P.jsx)(`span`,{children:S(`web.ui.sidebar.diagnostic`,{module:e.module,detail:e.detail})})]},`diag-${t}`))})]}),(0,P.jsxs)(`div`,{className:`sidebar__end`,children:[le&&(0,P.jsx)(Ix,{...le}),(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--row`,type:`button`,onClick:d,children:[(0,P.jsx)(I,{name:`settings-2`}),S(`web.ui.sidebar.settings`),(0,P.jsx)(`kbd`,{children:Dw(`,`)})]})]})]})}var Nw=48;function Pw({children:e}){let t=v.useRef(null),[n,r]=v.useState(!0);return v.useEffect(()=>{let e=t.current;!e||!n||(e.scrollTop=e.scrollHeight)}),(0,P.jsx)(`div`,{className:`thread`,ref:t,onScroll:()=>{let e=t.current;if(!e)return;let n=e.scrollHeight-e.scrollTop-e.clientHeight;r(n<=Nw)},role:`log`,children:(0,P.jsx)(`div`,{className:`thread__column`,children:e})})}var Fw=8e3;function Iw(e,t,n){let r=new Map(e.map(e=>[e.id,e]));return t.filter(e=>{if(e.id===n)return!1;let t=r.get(e.id);return t===void 0||t.state===`idle`||e.state!==`idle`?!1:!(t.live&&!e.live)})}function Lw(e,t,n={}){let{ttlMs:r=Fw,now:i=Date.now}=n,[a,o]=v.useState([]),s=v.useRef(e),c=v.useRef(0),l=v.useRef(i);return l.current=i,v.useEffect(()=>{let n=Iw(s.current,e,t);if(s.current=e,n.length===0)return;let r=l.current();o(e=>[...e,...n.map(e=>(c.current+=1,{sessionId:e.id,title:e.title,finish:e.lastFinish??null,bornAt:r,key:`${e.id}#${c.current}`}))].slice(-3))},[e,t]),v.useEffect(()=>{if(a.length===0)return;let e=Math.min(...a.map(e=>e.bornAt+r)),t=setTimeout(()=>o(e=>e.filter(e=>e.bornAt+r>l.current())),Math.max(0,e-l.current()));return()=>clearTimeout(t)},[a,r]),{receipts:a,drop:v.useCallback(e=>{o(t=>t.filter(t=>t.key!==e))},[])}}var Rw={stop:{tone:`ok`,icon:`check`,key:`web.ui.toast.done`},"max-turns":{tone:`error`,icon:`x`,key:`web.ui.toast.max_turns`},stalled:{tone:`error`,icon:`x`,key:`web.ui.toast.stalled`},aborted:{tone:`error`,icon:`x`,key:`web.ui.toast.aborted`},"content-filter":{tone:`error`,icon:`x`,key:`web.ui.toast.filtered`},compliance:{tone:`error`,icon:`x`,key:`web.ui.toast.compliance`},"budget-exceeded":{tone:`error`,icon:`x`,key:`web.ui.toast.budget`},error:{tone:`error`,icon:`x`,key:`web.ui.toast.failed`}};function zw(e){return e?Rw[e.reason]:null}function Bw(e){if(!e)return null;let t={...e.durationMs===null?{}:{duration:n_(e.durationMs)},...e.runUsage===null?{}:{tokens:t_(E(e.runUsage))}};return t.duration===void 0&&t.tokens===void 0?null:t}function Vw({receipts:e,onOpen:t,onDrop:n}){let r=F();return(0,P.jsx)(`div`,{className:`toasts`,role:`status`,children:e.map(e=>{let i=e.title||r(`web.ui.topbar.untitled`),a=zw(e.finish),o=Bw(e.finish);return(0,P.jsxs)(`div`,{className:`toast`,...a?{"data-tone":a.tone}:{},children:[a&&(0,P.jsx)(`span`,{className:`toast__sign`,children:(0,P.jsx)(I,{name:a.icon,size:`sm`})}),(0,P.jsx)(`span`,{className:`toast__who`,children:r(a?.key??`web.ui.toast.done`,{title:i})}),o&&(0,P.jsx)(`span`,{className:`toast__stat`,children:[o.duration,o.tokens&&r(`web.ui.thread.facts_tokens`,{tokens:o.tokens})].filter(Boolean).join(` · `)}),t&&(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost`,onClick:()=>{t(e.sessionId),n?.(e.key)},children:r(`web.ui.toast.go`)})]},e.key)})})}var Hw={connecting:`web.ui.conn.connecting`,open:`web.ui.conn.open`,reconnecting:`web.ui.conn.reconnecting`,closed:`web.ui.conn.closed`};function Uw({title:e,model:t,modelControl:n,modelCatalog:r,onConfigureKey:i,otherSession:a,connection:o,resyncing:s,inspectorOpen:c,onToggleInspector:l,sidebar:u}){let d=F(),f=n?.selection!==void 0,p=a?d(`web.ui.topbar.model_not_live`):void 0;return(0,P.jsxs)(`header`,{className:`topbar`,children:[u&&(0,P.jsx)(`button`,{className:`btn btn--ghost btn--icon topbar__nav`,type:`button`,"aria-pressed":u.open,"aria-label":d(`web.ui.topbar.sidebar`),title:d(`web.ui.topbar.sidebar`),onClick:u.onToggle,children:(0,P.jsx)(I,{name:`panel-right`})}),(0,P.jsx)(`h1`,{className:`topbar__title`,...e?{title:e}:{},children:e||d(`web.ui.topbar.untitled`)}),(0,P.jsxs)(`div`,{className:`topbar__facts`,children:[f&&n?(0,P.jsx)(Cw,{model:n,...r?{catalog:r}:{},...i?{onConfigureKey:i}:{}}):t&&(p?(0,P.jsxs)(`span`,{title:p,children:[t,` `,(0,P.jsx)(I,{name:`info`,size:`sm`,label:p})]}):(0,P.jsx)(`span`,{children:t})),s&&(0,P.jsx)(`span`,{children:d(`web.ui.topbar.resyncing`)}),(0,P.jsx)(`span`,{className:`conn`,"data-conn":o,children:d(Hw[o])}),(0,P.jsx)(`button`,{className:`btn btn--ghost btn--icon`,type:`button`,"aria-pressed":c,"aria-label":d(`web.ui.topbar.inspector`),title:d(`web.ui.topbar.inspector`),onClick:l,children:(0,P.jsx)(I,{name:`panel-right`})})]})]})}function Ww(e){if(e.readOnly!==`history`)return e.readOnly;let t=e.currentSummary?.workspace;return t&&t.state!==`unknown`?!1:`history`}var Gw=2,Kw=[500,1e3,2e3,4e3,8e3,1e4];function qw(e){let t=new EventSource(e),n={get readyState(){return t.readyState},onopen:null,onmessage:null,onerror:null,close:()=>t.close()};return t.onopen=()=>n.onopen?.(),t.onmessage=e=>n.onmessage?.({data:String(e.data)}),t.onerror=()=>n.onerror?.(),n}function Jw(e){try{let t=JSON.parse(e);if(!t||typeof t!=`object`)return;let n=t;return typeof n.seq==`number`&&n.event?n:void 0}catch{return}}function Yw(e,t){let{onFrame:n,onConnectionChange:r,onResync:i,createSource:a=qw,schedule:o=(e,t)=>void setTimeout(e,t)}=t,s,c=0,l=0,u=!1,d=()=>{if(u)return;let e=Kw[Math.min(c,Kw.length-1)]??1e4;c+=1,o(()=>{u||(p(),i(`hard-reconnect`))},e)},f=e=>{let t=Jw(e);if(t){if(ue(t.event)&&t.event.type===`stream-reset`){i(t.event.reason);return}t.seq>0&&(l=t.seq),t.event.type!==`connected`&&n(t)}};function p(){r(c===0?`connecting`:`reconnecting`);let t=a(e);s=t,t.onopen=()=>{c=0,r(`open`)},t.onmessage=e=>f(e.data),t.onerror=()=>{if(t.readyState!==Gw){r(`reconnecting`);return}t.close(),r(`reconnecting`),d()}}return p(),{close:()=>{u=!0,s?.close(),r(`closed`)},lastSeq:()=>l}}var Xw={binary:`message_part.file_binary`,denied:`message_part.file_denied`,unreadable:`message_part.file_unreadable`,"over-limit":`message_part.file_over_limit`,"not-restored":`message_part.file_not_restored`},Zw={"invalid-reference":`message_part.session_invalid_reference`,"self-reference":`message_part.session_self_reference`,"too-many":`message_part.session_too_many`,"not-authorized":`message_part.session_not_authorized`,"budget-exceeded":`message_part.session_budget_exceeded`,"not-restored":`message_part.session_not_restored`};function Qw(e,t){return e.omitted?t(Xw[e.omitted],{path:e.path}):e.truncatedTo===void 0?t(`message_part.file`,{path:e.path}):t(`message_part.file_truncated`,{path:e.path,bytes:e.truncatedTo})}function $w(e,t){let n=e.title??e.sessionId??e.ref;return e.omitted?t(Zw[e.omitted],{name:n}):e.messageCount===void 0?t(`message_part.session`,{name:n}):e.totalMessages===void 0?t(`message_part.session_counted`,{name:n,count:e.messageCount}):t(`message_part.session_counted_of_total`,{name:n,count:e.messageCount,total:e.totalMessages})}function eT(e,t){return e.mediaType===void 0?t(`message_part.image_unknown_type`):t(`message_part.image`,{mediaType:e.mediaType})}function tT(e,t,n={}){return typeof e==`string`?e:e.map(e=>e.type===`text`?e.text:e.type===`file`?Qw(e,t):e.type===`session`?$w(e,t):e.type===`image`?n.imagesShownAsThumbnails?void 0:eT(e,t):ie(e)).filter(e=>e!==void 0).join(`
|
|
373
|
+
`)}function nT(e){if(typeof e==`string`)return[];let t=[];for(let n of e){if(n.type!==`image`)continue;let{type:e,...r}=n;t.push(r)}return t}function rT({client:e,dispatch:t,stateRef:n,fail:r,resync:i,refreshSessions:a}){let o=F();return(0,v.useMemo)(()=>({send:(i,a)=>{let{sessionId:s}=n.current;if(!s||Ww(n.current))return;let c=nT(i),l=tT(i,o,{imagesShownAsThumbnails:c.length>0}).trim();!l&&c.length===0||(t({type:`submit`,text:l,...c.length>0?{images:c}:{}}),e.send(s,i,a).then(e=>{e?.queued&&t({type:`queued`}),e?.command&&t({type:`command`,notice:e.command}),e?.references&&t({type:`references`,references:e.references}),e?.files&&t({type:`files`,files:e.files})}).catch(r))},abort:()=>{let i=n.current.sessionId;i&&(t({type:`aborted`}),e.abort(i).catch(e=>{t({type:`abort-failed`}),r(e)}))},respond:(n,i,a)=>{t({type:`approval-sent`,requestId:n}),e.respond(n,i,a).catch(r)},answerQuestion:(n,i)=>{t({type:`question-sent`,requestId:n}),e.respondQuestion(n,i).catch(r)},dismissError:()=>t({type:`dismiss-error`}),reloadMessages:()=>{let e=n.current.sessionId;e&&i(e)},refreshSessions:e=>a(e)}),[e,t,r,a,i,n,o])}function iT(e,t,n){let r=(0,v.useRef)(void 0),i=(0,v.useRef)(n);i.current=n;let a=(0,v.useCallback)(n=>{if(r.current=n,(async()=>{try{t({type:`sessions`,sessions:(await e.listSessions()).sessions})}catch{}})(),n===void 0){t({type:`search-hits`});return}(async()=>{try{let i=await e.listSessions(n);if(r.current!==n)return;t({type:`search-hits`,hits:i.sessions})}catch{}})()},[e,t]),o=(0,v.useCallback)(()=>a(r.current),[a]),s=(0,v.useCallback)(n=>{(async()=>{try{let{session:r}=await e.getSession(n);t({type:`current-summary`,summary:r})}catch{}})()},[e,t]);(0,v.useEffect)(()=>{a(void 0)},[a]);let c=(0,v.useRef)(void 0);(0,v.useEffect)(()=>{let e=n.sessionId;if(e===void 0||c.current===e)return;let t=c.current===void 0;c.current=e,!t&&(i.current.sessions.some(t=>t.id===e)||o())},[n.sessionId,o]);let l=(0,v.useRef)({running:!1});return(0,v.useEffect)(()=>{let{sessionId:e,turn:t,currentSummary:n}=i.current,r=t!==`idle`,a=l.current;l.current={...e?{sessionId:e}:{},running:r},!(!a.running||r||a.sessionId!==e)&&e!==void 0&&(n?.title||(o(),s(e)))},[n.turn,n.sessionId,o,s]),(0,v.useEffect)(()=>{let e=n.sessionId;e!==void 0&&n.currentSummary?.id!==e&&s(e)},[n.sessionId,n.currentSummary?.id,s]),{refreshSessions:a,refreshAgain:o}}function aT(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r?.type!==`tool_group`)continue;let i=r.tools.findIndex(e=>e.callId===t.toolCallId);if(i===-1)continue;let a=[...r.tools];a[i]={...a[i],status:`done`,result:t.output,...t.artifacts&&t.artifacts.length>0?{artifacts:t.artifacts}:{}},e[n]={...r,tools:a};return}}function oT(e,t){let n=t.reasoning?.trim();if(n&&e.push({type:`thinking`,thought:n}),t.content&&e.push({type:`assistant`,text:t.content}),!t.toolCalls||t.toolCalls.length===0)return;let r=t.toolCalls.map(e=>({callId:e.toolCallId,toolName:e.toolName,request:e.input,status:`pending`}));e.push({type:`tool_group`,tools:r})}function sT(e,t){let n=[],r=[];for(let i of e)switch(i.role){case`user`:n.push({type:`user`,text:tT(i.parts??i.content,t,{imagesShownAsThumbnails:!0}),...cT(i)});break;case`assistant`:{let e=n.length;oT(n,i),i.turnFacts&&n.length>e&&r.push({itemIndex:n.length-1,facts:i.turnFacts});break}case`tool`:for(let e of i.toolResults??[])aT(n,e)}return{items:n,turns:r}}function cT(e){let t=[],n=[],r=[];for(let i of e.parts??[])if(i.type===`session`){let{type:e,text:n,...r}=i;t.push(r)}else if(i.type===`file`){let{type:e,text:t,...r}=i;n.push(r)}else if(i.type===`image`){let{type:e,...t}=i;r.push(t)}return{...t.length>0?{references:t}:{},...n.length>0?{files:n}:{},...r.length>0?{images:r}:{}}}var lT=(0,v.createContext)(pr),uT=(0,v.createContext)(void 0);function dT(e){return e instanceof _e&&e.detail?e.detail:e instanceof Error?e.message:String(e)}async function fT(e){try{return await e}catch(e){if(e instanceof _e&&e.status===404)return null;throw e}}function pT({client:e,children:t,sessionId:n,provider:r,createSource:i}){let[a,o]=(0,v.useReducer)(dr,pr),s=(0,v.useRef)(a);s.current=a;let c=r!==null,l=F(),u=(0,v.useRef)(l);u.current=l;let d=(0,v.useRef)(void 0),f=(0,v.useRef)(!1),p=(0,v.useCallback)(async t=>{if(o({type:`session-gone`}),!f.current){f.current=!0;try{let{sessionId:n}=await e.createSession();n!==t&&o({type:`recovery`,sessionId:n})}catch{}}},[e]),m=(0,v.useCallback)(e=>{if(ye(e)){p(d.current);return}o({type:`error`,message:dT(e)})},[p]),h=(0,v.useCallback)(async t=>{o({type:`resyncing`});try{let[n,r,i]=await Promise.all([e.messages(t),fT(e.approvals(t)),fT(e.questions(t))]),a=r===null||i===null?c?`history`:`no-provider`:!1,s=sT(n.messages,u.current);o({type:`replay`,items:s.items,turns:s.turns,approvals:r?[...r.approvals]:[],questions:i?[...i.questions]:[],turn:r?.state??`idle`,readOnly:a,...n.usage?{usage:n.usage}:{}})}catch(e){m(e)}},[e,m,c]),{refreshSessions:g,refreshAgain:_}=iT(e,o,a);(0,v.useEffect)(()=>{let e=Yw(`/api/events`,{onFrame:e=>o({type:`frame`,frame:e}),onConnectionChange:e=>o({type:`connection`,state:e}),onResync:()=>{let e=d.current;e&&h(e),_()},...i?{createSource:i}:{}});return()=>e.close()},[e,i,_,h]),(0,v.useEffect)(()=>{let t=!1;return(async()=>{let r;try{r=n??(await e.createSession()).sessionId}catch(e){t||m(e);return}t||(d.current=r,f.current=!1,o({type:`session`,sessionId:r}),await h(r))})(),()=>{t=!0}},[n,e,m,h]),(0,v.useEffect)(()=>{!a.refetchOnIdle||a.resyncing||a.turn!==`idle`||a.sessionId&&h(a.sessionId)},[a.refetchOnIdle,a.resyncing,a.turn,a.sessionId,h]);let y=rT({client:e,dispatch:o,stateRef:s,fail:m,resync:h,refreshSessions:g});return(0,P.jsx)(lT.Provider,{value:a,children:(0,P.jsx)(uT.Provider,{value:y,children:t})})}function mT(){return(0,v.useContext)(lT)}function hT(){let e=(0,v.useContext)(uT);if(!e)throw Error(`useWebActions 必须在 WebStoreProvider 里用`);return e}var gT={binary:{plain:`web.ui.diff.omit_binary`,sized:`web.ui.diff.omit_binary_sized`},"too-large":{plain:`web.ui.diff.omit_too_large`,sized:`web.ui.diff.omit_too_large_sized`},"no-snapshot":{plain:`web.ui.diff.omit_no_snapshot`,sized:`web.ui.diff.omit_no_snapshot`}},_T={binary:zg.binary.why,"too-large":`web.ui.diff.omit_too_large_why`,"no-snapshot":`web.ui.diff.omit_no_snapshot_why`};function vT(e,t){if(!e.omitted)return;let n=e.newBytes??e.oldBytes,r=gT[e.omitted];return n===null?t(r.plain):t(r.sized,{bytes:Jr(n)})}function yT(e,t){let n=vT(e,t);if(!(n===void 0||!e.omitted))return{label:n,why:t(_T[e.omitted])}}function bT({file:e}){let t=yT(e,F());return t?(0,P.jsx)(Xg,{filePath:e.path,notice:t}):(0,P.jsx)(Xg,{filePath:e.path,...e.oldContent===null?{}:{oldContent:e.oldContent},...e.newContent===null?{}:{newContent:e.newContent}})}var xT={"no-changes":`web.ui.diff.note_no_changes`,"not-a-git-repo":`web.ui.diff.note_not_a_git_repo`,"no-workspace-history":`web.ui.diff.note_no_workspace_history`,"no-workspace":`web.ui.diff.note_no_workspace`,truncated:`web.ui.diff.note_truncated`},ST={added:{icon:`plus`,label:`web.ui.diff.status_added`},modified:{icon:`file-diff`,label:`web.ui.diff.status_modified`},deleted:{icon:`circle-x`,label:`web.ui.diff.status_deleted`}};function CT(e,t){let[n,r]=v.useState({state:`pending`}),[i,a]=v.useState(0);return v.useEffect(()=>{if(!e||!t){r({state:`pending`});return}r({state:`pending`});let n=!0;return e.sessionDiff(t).then(e=>{n&&r({state:`ok`,data:e})}).catch(()=>{n&&r({state:`error`})}),()=>{n=!1}},[e,t,i]),{view:n,reload:v.useCallback(()=>a(e=>e+1),[])}}function wT({client:e,sessionId:t,onBack:n}){let r=F(),{view:i,reload:a}=CT(e,t),[o,s]=v.useState(),c=i.state===`ok`?i.data.files:[],l=c.find(e=>e.path===o);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`nav`,{className:`navcol`,children:[(0,P.jsxs)(`div`,{className:`navcol__head`,children:[r(`web.ui.diff.title`),(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--sm navcol__back`,type:`button`,onClick:n,children:[(0,P.jsx)(I,{name:`arrow-left`,size:`sm`}),r(`web.ui.diff.back`)]})]}),(0,P.jsx)(`ul`,{className:`navcol__list`,children:c.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,"aria-current":e.path===o?`true`:void 0,onClick:()=>s(e.path),"aria-label":`${r(ST[e.status].label)} ${e.path}`,title:`${r(ST[e.status].label)} ${e.path}`,children:[(0,P.jsx)(`span`,{className:`navcol__sign`,"data-status":e.status,children:(0,P.jsx)(I,{name:ST[e.status].icon,size:`lg`})}),(0,P.jsx)(ET,{path:e.path}),(0,P.jsx)(`span`,{className:`navcol__n`,children:vT(e,r)??``})]})},e.path))})]}),(0,P.jsxs)(`section`,{className:`panelcol`,children:[(0,P.jsxs)(`div`,{className:`panelcol__head`,children:[(0,P.jsx)(`h1`,{className:`panelcol__title wsdiff__title`,children:l?(0,P.jsx)(ET,{path:l.path}):r(`web.ui.diff.title`)}),i.state===`ok`&&i.data.root!==``&&(0,P.jsxs)(`span`,{className:`wsdiff__root`,title:i.data.root,children:[(0,P.jsx)(I,{name:`folder`,size:`sm`}),i.data.root]}),(0,P.jsxs)(`button`,{className:`btn btn--ghost btn--sm wsdiff__reload`,type:`button`,onClick:a,disabled:i.state===`pending`,title:r(`web.ui.diff.reload_hint`),children:[(0,P.jsx)(I,{name:`rotate-ccw`,size:`sm`}),r(`web.ui.diff.reload`)]})]}),(0,P.jsx)(`div`,{className:`panelcol__body`,children:(0,P.jsx)(`div`,{className:`wsdiff__inner`,children:i.state===`pending`?(0,P.jsx)(L,{text:r(`web.ui.diff.loading`)}):i.state===`error`?(0,P.jsx)(L,{tone:`error`,text:r(`web.ui.diff.failed`)}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(TT,{data:i.data,t:r}),l?(0,P.jsx)(bT,{file:l}):c.length>0&&(0,P.jsx)(L,{text:r(`web.ui.diff.pick`)})]})})})]})]})}function TT({data:e,t}){return(0,P.jsxs)(P.Fragment,{children:[e.source===`git`&&e.files.length>0&&(0,P.jsx)(L,{text:t(`web.ui.diff.scope_git`)}),e.notes.map(n=>(0,P.jsx)(L,{text:t(xT[n],{count:e.files.length})},n))]})}function ET({path:e}){let t=e.lastIndexOf(`/`);return(0,P.jsxs)(`span`,{className:`wsdiff__path`,children:[t>=0&&(0,P.jsx)(`span`,{className:`wsdiff__dir`,children:e.slice(0,t+1)}),(0,P.jsx)(`span`,{className:`wsdiff__name`,children:e.slice(t+1)})]})}function DT({client:e,config:t,onOpenSession:n,sub:r}){let i=F(),a=mT(),o=hT(),{sessionId:s,recovery:c}=a,[l,u]=v.useState(null),[d,f]=v.useState(`experts`),[p,m]=v.useState(),[h,g]=v.useState(),_=l??(r===`diff`?`diff`:`thread`),y=BC(),b=ab(s),x=fb(s),[S,C]=v.useState(),w=Ub(e,s,a.turn),ee=Fy(e,s),te=Jb(e,s,a.turn),ne=vw(e,s,a.lastPromptTokens),T=ot(e),re=Vb(e,s,a.turn,w,t?.permission);v.useEffect(()=>{re.level&&(document.documentElement.dataset.permission=re.level)},[re.level]),v.useEffect(()=>{let e=e=>{e.key!==`,`||!(e.metaKey||e.ctrlKey)||(e.preventDefault(),u(e=>e===`settings`?null:`settings`))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let ie=v.useCallback(e=>{u(null),n?.(e)},[n]),ae=v.useCallback(()=>{u(null),s&&n?.(s)},[n,s]),oe=v.useCallback(e=>{C({text:i(`web.ui.cap.summon_prefill`,{role:e})}),ae()},[i,ae]),se=v.useCallback(e=>{x.pin(e),ae()},[x.pin,ae]),ce=v.useCallback(()=>C(void 0),[]),le=v.useCallback(e=>{g(void 0),o.send(e,x.role)},[o,x.role]),E=v.useCallback(async t=>s?(await e.referenceCandidates(s,t)).candidates:[],[e,s]),D=v.useCallback(async t=>s?await e.fileCandidates(s,t):{candidates:[],unmentionable:0,truncated:!1},[e,s]),ue=Hx(e,ie),de=Wx(e,{...s?{currentSessionId:s}:{},...t?{homeSessionId:t.sessionId}:{},...n?{openSession:ie}:{},reloadCurrent:o.reloadMessages}),O=v.useMemo(()=>{let e=a.currentSummary?.workspace;return Vx(t?.knownWorkspaces??[],e?.state===`bound`?e.ref.root:null)},[t,a.currentSummary]),fe=Ww(a),pe=v.useMemo(()=>Uy({client:e,sessionId:s,readOnly:!!fe,busy:a.turn!==`idle`,t:i,openContextPane:()=>{m(e=>({n:(e?.n??0)+1,pane:`memory`})),u(`settings`)},setNotice:g}),[e,s,fe,a.turn,i]),k=t!==void 0&&t.provider!==null&&n!==void 0,[me,he]=v.useState(),ge=v.useCallback(()=>he(void 0),[]),A=ub({onFiles:v.useCallback(e=>he(e),[]),disabled:Rb({turn:a.turn,connection:a.connection,disabled:!s,readOnly:fe})}),_e=v.useCallback(e=>le(e),[le]),j=v.useCallback(e=>C({text:e}),[]),ve=y.openInspector,M=_r(e,s,a.turn),ye=v.useCallback(e=>{e.messagesRemoved!==null&&o.reloadMessages(),M.reload()},[o,M]),be=v.useCallback(t=>s?je(t,s,e.artifactUrl):void 0,[e,s]),xe=v.useCallback(t=>s?Ae(t,s,e.artifactUrl):void 0,[e,s]),Se=v.useMemo(()=>Tx(a.history,a.stream.pending),[a.history,a.stream.pending]),Ce=v.useMemo(()=>zr(a.history,a.stream.pending),[a.history,a.stream.pending]),we=_x(e,s,a.turn),Te=v.useMemo(()=>wx(we.tasks),[we.tasks]),Ee=Lw(a.sessions,s),N=hv(e),De=Ax(e,a.turn,s),Oe=v.useCallback(async(t,n)=>{try{return await e.fixSchedule(t,n),N.reload(),!0}catch{return!1}},[e,N]),ke=v.useCallback(e=>{document.getElementById(Q_(e))?.scrollIntoView({block:`center`})},[]),[Me,Ne]=v.useState(),Pe=v.useCallback(e=>{Ne(e),ve()},[ve]),Fe=v.useCallback(()=>Ne(void 0),[]);v.useEffect(()=>Ne(void 0),[s]);let Ie=us(v.useMemo(()=>s?t=>e.fileStat(s,t):void 0,[e,s])),Le=v.useMemo(()=>({open:Pe,verify:Ie}),[Pe,Ie]);return(0,P.jsx)(cs,{value:Le,children:(0,P.jsxs)(`div`,{className:`app`,"data-view":_,"data-inspector":y.inspectorShown?`open`:`closed`,...y.drawer?{"data-drawer":y.drawer}:{},children:[(0,P.jsx)(at,{}),(0,P.jsx)(VC,{panels:y}),(0,P.jsx)(Mw,{...s?{sessionId:s}:{},rootRef:y.sidebarRef,...a.usage?{usage:a.usage}:{},...t?{usageScope:t.usageScope}:{},...t?.maxCostUsd===void 0?{}:{maxCostUsd:t.maxCostUsd},...t?.brand===void 0?{}:{brand:t.brand},...t?.diagnostics?{diagnostics:t.diagnostics}:{},...k?{newSession:{handle:ue}}:{},acts:de,...t?.sidebarMenu===void 0?{}:{menu:t.sidebarMenu},onMenuSelect:Fx,onOpenSettings:()=>{m(void 0),u(`settings`)},onOpenCapability:e=>{f(e),u(`cap`),y.closeDrawer()},..._===`cap`?{capTab:d}:{},onOpenAutomation:()=>u(`auto`),pendingAutomation:N.items.length,sessions:a.sessions,hits:a.searchHits,onOpenSession:ie,onSearch:o.refreshSessions,tasks:Te}),_===`settings`?(0,P.jsx)(NC,{...p?{initialPane:p.pane}:{},onBack:()=>u(null),client:e,...s?{sessionId:s}:{},...t?{compression:t.compression}:{},...t?{about:t.about}:{},...t?.diagnostics?{diagnostics:t.diagnostics}:{},readOnly:!!fe,turns:a.turns,hasHistory:a.history.length>0},p?.n??0):_===`cap`?(0,P.jsx)(ky,{tab:d,client:e,...s?{sessionId:s}:{},onBack:()=>u(null),...y.overlaySidebar?{sidebar:{open:y.drawer===`sidebar`,onToggle:y.toggleSidebar}}:{},onSummon:oe,onTakeOver:se,...x.role===void 0?{}:{pinnedRole:x.role},canSummon:s!==void 0&&!fe,...k?{newSession:ue}:{},lanExposed:t?.lanExposed??!0,nativeDirPicker:t?.nativeDirPicker??!1}):_===`auto`?(0,P.jsx)(_v,{client:e,workspaceChoices:O,nativeDirPicker:t?.nativeDirPicker??!1,onBack:()=>u(null)}):_===`diff`?(0,P.jsx)(wT,{client:e,...s?{sessionId:s}:{},onBack:ae}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`main`,{className:`main`,...A.zone,children:[A.active&&(0,P.jsx)(db,{}),(0,P.jsx)(Uw,{title:a.currentSummary?.title,...t?{model:t.model}:{},modelControl:ne,modelCatalog:T,onConfigureKey:()=>{m(e=>({n:(e?.n??0)+1,pane:`model`})),u(`settings`)},otherSession:t!==void 0&&s!==t.sessionId,connection:a.connection,resyncing:a.resyncing,inspectorOpen:y.inspectorShown,onToggleInspector:y.toggleInspector,...y.overlaySidebar?{sidebar:{open:y.drawer===`sidebar`,onToggle:y.toggleSidebar}}:{}}),(0,P.jsx)(`div`,{children:a.sessionGone?(0,P.jsxs)(`div`,{className:`banner`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`banner__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`p`,{children:i(c?`web.ui.banner.session_gone`:`web.ui.banner.session_gone_stuck`)}),c&&n&&(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost`,onClick:()=>n(c),children:i(`web.ui.banner.session_gone_open`)})]}):a.error&&(0,P.jsxs)(`div`,{className:`banner`,role:`alert`,children:[(0,P.jsx)(`span`,{className:`banner__sign`,children:(0,P.jsx)(I,{name:`circle-x`,size:`sm`})}),(0,P.jsx)(`p`,{children:a.error}),(0,P.jsx)(`button`,{type:`button`,className:`btn btn--ghost`,onClick:o.dismissError,children:i(`web.ui.banner.dismiss`)})]})}),(0,P.jsxs)(Pw,{children:[s&&!a.resyncing&&!fe&&a.history.length===0&&a.stream.pending.length===0&&(0,P.jsx)(Bx,{...t?.blankCards===void 0?{}:{cards:t.blankCards},onPick:e=>C({text:e.prompt,replace:!0})}),(0,P.jsx)(nv,{history:a.history,pending:a.stream.pending,thought:a.stream.thought,thoughtParts:a.thoughtParts,approvals:a.approvals,turn:a.turn,turns:a.turns,heads:a.heads,...t?{compression:t.compression}:{},...a.runUsage?{runUsage:a.runUsage}:{},queued:a.queued,aborting:a.aborting,onAbort:o.abort,resolveArtifact:be,resolveImage:xe,...t?{configModel:t.model}:{},onRerun:_e,onQuote:j,onInspect:ve,...s?{rewind:{client:e,sessionId:s,checkpoints:M.checkpoints,onDone:ye}}:{}})]}),(0,P.jsxs)(`div`,{className:`composer-region`,children:[(0,P.jsx)(Vw,{receipts:Ee.receipts,onDrop:Ee.drop,...n?{onOpen:ie}:{}}),(0,P.jsx)(hx,{approvals:a.approvals,questions:a.questions,onRespond:o.respond,onAnswer:(e,t,n)=>o.answerQuestion(e,{answers:t,...n?{skipped:!0}:{}}),sessions:a.sessions,...s?{currentSessionId:s}:{},...n?{onOpenSession:ie}:{},pending:N.items,onFixPending:Oe,onOpenAutomation:()=>u(`auto`),blockedGoals:De.items}),(0,P.jsx)(zb,{draft:b,turn:a.turn,sending:a.sending,connection:a.connection,disabled:!s,readOnly:fe,...S?{prefill:S}:{},onPrefillDone:ce,commands:ee,builtins:pe,listSessionCandidates:E,listFileCandidates:D,...a.commandNotice?{commandNotice:a.commandNotice}:{},...h?{builtinNotice:h}:{},...me?{dropped:me}:{},onDroppedDone:ge,expert:x,...s&&a.usage&&t?{usage:{tokens:a.usage,scope:t.usageScope}}:{},onSend:le}),(0,P.jsx)(Xb,{workspace:te,...a.currentSummary?.role?{role:a.currentSummary.role}:{},workspaceChoices:O,client:e,nativeDirPicker:t?.nativeDirPicker??!1,...s&&n?{onOpenDiff:()=>n(s,`diff`)}:{},permission:re,planMode:w,readOnly:!!fe})]})]}),y.inspectorShown&&(0,P.jsx)(_w,{rootRef:y.inspectorRef,patches:Se,onLocate:ke,...Me===void 0?{}:{previewPath:Me},onClosePreviewPath:Fe,client:e,...s?{sessionId:s}:{},turn:a.turn,toolArtifacts:Ce,resolveArtifact:be,tasks:we})]})]})})}function OT(e,t){let{lang:n}=rt(),[r,i]=v.useState(t),a=v.useRef(n);return v.useEffect(()=>{if(a.current===n)return;a.current=n;let t=!0;return e.config().then(e=>{t&&i(e)},()=>void 0),()=>{t=!1}},[e,n]),r}var kT=`/s/`;function AT(e){if(!e.startsWith(kT))return{kind:`home`};let t=e.slice(3).split(`/`),n=t[0]??``;if(!n)return{kind:`home`};let r;try{r=decodeURIComponent(n)}catch{return{kind:`home`}}return t[1]===`diff`?{kind:`session`,sessionId:r,sub:`diff`}:{kind:`session`,sessionId:r}}function jT(e,t){let n=`${kT}${encodeURIComponent(e)}`;return t===void 0?n:`${n}/${t}`}function MT(){return{pathname:()=>window.location.pathname,push:e=>window.history.pushState(null,``,e),replace:e=>window.history.replaceState(null,``,e),onPopState:e=>(window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e))}}function NT(e,t){let[n,r]=v.useState(()=>AT(e.pathname()));v.useEffect(()=>e.onPopState(()=>r(AT(e.pathname()))),[e]),v.useEffect(()=>{n.kind!==`home`||!t||(e.replace(jT(t)),r({kind:`session`,sessionId:t}))},[e,n.kind,t]);let i=v.useRef(n);return i.current=n,{route:n,go:v.useCallback((t,n)=>{let a=i.current;(a.kind!==`session`||a.sessionId!==t||a.sub!==n)&&(e.push(jT(t,n)),r(n===void 0?{kind:`session`,sessionId:t}:{kind:`session`,sessionId:t,sub:n}))},[e])}}function PT({titleKey:e,hintKey:t,hint:n}){let r=F();return(0,P.jsxs)(`div`,{className:`fatal`,role:`alert`,children:[(0,P.jsx)(`h1`,{children:r(e)}),(0,P.jsx)(`p`,{children:t?r(t):n})]})}function FT({client:e,config:t}){let n=v.useMemo(MT,[]),r=OT(e,t),{route:i,go:a}=NT(n,r.sessionId),o=i.kind===`session`?i.sessionId:r.sessionId,s=i.kind===`session`?i.sub:void 0;return(0,P.jsx)(pT,{client:e,sessionId:o,provider:r.provider,children:(0,P.jsx)(DT,{client:e,config:r,onOpenSession:a,sub:s})})}async function IT(){let e=document.getElementById(`root`);if(!e)throw Error(`index.html 里没有 #root`);let t=(0,y.createRoot)(e),n=De((e,t)=>fetch(e,t),()=>Xe(Ze())),r=await Te(n,Ce());if(!r.ok){t.render((0,P.jsx)(v.StrictMode,{children:(0,P.jsx)(nt,{children:r.unauthorized?(0,P.jsx)(PT,{titleKey:`web.ui.fatal.unauthorized`,hintKey:`web.ui.fatal.unauthorized_hint`}):(0,P.jsx)(PT,{titleKey:`web.ui.fatal.offline`,hint:r.message})})}));return}t.render((0,P.jsx)(v.StrictMode,{children:(0,P.jsx)(nt,{children:(0,P.jsx)(FT,{client:n,config:r.config})})}))}IT();
|