@netnodeag/kraftwerk 0.54.0 → 0.55.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.
Files changed (36) hide show
  1. package/dist/cli/init.js +2 -0
  2. package/dist/inspector/chat/sessions.js +3 -1
  3. package/inspector/dist/assets/{dist-ByiXz4TR.js → dist-BE34pwMP.js} +1 -1
  4. package/inspector/dist/assets/{dist-Bx7GKFmy.js → dist-BEsFc6FD.js} +1 -1
  5. package/inspector/dist/assets/{dist-BUqCaEU2.js → dist-Bvh8zyxa.js} +1 -1
  6. package/inspector/dist/assets/{dist-yMnOsWJc.js → dist-CFA64Yc7.js} +1 -1
  7. package/inspector/dist/assets/dist-CUM-iKNF.js +1 -0
  8. package/inspector/dist/assets/{dist-DiJi5Oj5.js → dist-CcIFukP1.js} +1 -1
  9. package/inspector/dist/assets/{dist-nr-aInCP.js → dist-Cude8a0m.js} +1 -1
  10. package/inspector/dist/assets/{dist-bY9OPiz6.js → dist-T8k-QVDQ.js} +1 -1
  11. package/inspector/dist/assets/{dist-CzRSjkPt.js → dist-U99ikhIT.js} +1 -1
  12. package/inspector/dist/assets/{dist-CYN-kVi9.js → dist-zx0nNkxV.js} +1 -1
  13. package/inspector/dist/assets/{dist-C8DnORyS.js → dist-zzOk7PS8.js} +1 -1
  14. package/inspector/dist/assets/editor-DaJiuQSH.js +117 -0
  15. package/inspector/dist/assets/index-ClLft79D.css +1 -0
  16. package/inspector/dist/assets/index-DSeNsrDz.js +224 -0
  17. package/inspector/dist/index.html +2 -2
  18. package/package.json +1 -1
  19. package/inspector/dist/assets/dist-DNSyvq_9.js +0 -1
  20. package/inspector/dist/assets/editor-CJj1y1g9.js +0 -120
  21. package/inspector/dist/assets/index-fICe4HKG.js +0 -221
  22. package/inspector/dist/assets/index-hkfqFX7i.css +0 -1
  23. package/inspector/dist/assets/roboto-latin-400-normal-BqEyEoaF.woff2 +0 -0
  24. package/inspector/dist/assets/roboto-latin-400-normal-D27F5sTu.woff +0 -0
  25. package/inspector/dist/assets/roboto-latin-500-normal-7RbcRiD8.woff2 +0 -0
  26. package/inspector/dist/assets/roboto-latin-500-normal-fsTFPL3E.woff +0 -0
  27. package/inspector/dist/assets/roboto-latin-600-normal-CzqH9ZEY.woff2 +0 -0
  28. package/inspector/dist/assets/roboto-latin-600-normal-X4S5XP0J.woff +0 -0
  29. package/inspector/dist/assets/roboto-latin-700-normal-BZpUvMxY.woff2 +0 -0
  30. package/inspector/dist/assets/roboto-latin-700-normal-YuyVweIx.woff +0 -0
  31. package/inspector/dist/assets/roboto-mono-latin-400-normal-DBZPkcnn.woff +0 -0
  32. package/inspector/dist/assets/roboto-mono-latin-400-normal-GekRknry.woff2 +0 -0
  33. package/inspector/dist/assets/roboto-mono-latin-500-normal-D6j6AMzd.woff +0 -0
  34. package/inspector/dist/assets/roboto-mono-latin-500-normal-pxIOXZmA.woff2 +0 -0
  35. package/inspector/dist/assets/roboto-mono-latin-700-normal-CHYrj1DZ.woff +0 -0
  36. package/inspector/dist/assets/roboto-mono-latin-700-normal-foxDnrFi.woff2 +0 -0
@@ -1,221 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editor-CJj1y1g9.js","assets/dist-H3rerbMg.js","assets/dist-Bx7GKFmy.js","assets/dist-nr-aInCP.js","assets/dist-yMnOsWJc.js","assets/dist-CPlSMtdY.js","assets/editor-B1Jq9YIq.css"])))=>i.map(i=>d[i]);
2
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function j(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 te(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),te(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=te(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+A(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(j(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 M(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(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 N=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)},P={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=P,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ne}},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,N)}catch(e){N(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function j(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var te=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var ne=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},F=[],ie=-1;function ae(e){return{current:e}}function I(e){0>ie||(e.current=F[ie],F[ie]=null,ie--)}function L(e,t){ie++,F[ie]=e.current,e.current=t}var oe=ae(null),se=ae(null),ce=ae(null),le=ae(null);function ue(e,t){switch(L(ce,t),L(se,e),L(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}I(oe),L(oe,e)}function R(){I(oe),I(se),I(ce)}function de(e){e.memoizedState!==null&&L(le,e);var t=oe.current,n=Hd(t,e.type);t!==n&&(L(se,e),L(oe,n))}function z(e){se.current===e&&(I(oe),I(se)),le.current===e&&(I(le),Qf._currentValue=re)}var fe,pe;function me(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1<e.stack.indexOf(`
3
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
- `+fe+e+pe}var he=!1;function ge(e,t){if(!e||he)return``;he=!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(`
5
- `),l=s.split(`
6
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{he=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?me(n):``}function _e(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return e.child!==t&&t!==null?me(`Suspense Fallback`):me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 15:return ge(e.type,!1);case 11:return ge(e.type.render,!1);case 1:return ge(e.type,!0);case 31:return me(`Activity`);default:return``}}function ve(e){try{var t=``,n=null;do t+=_e(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
- Error generating stack: `+e.message+`
9
- `+e.stack}}var B=Object.prototype.hasOwnProperty,ye=t.unstable_scheduleCallback,be=t.unstable_cancelCallback,xe=t.unstable_shouldYield,Se=t.unstable_requestPaint,Ce=t.unstable_now,we=t.unstable_getCurrentPriorityLevel,Te=t.unstable_ImmediatePriority,Ee=t.unstable_UserBlockingPriority,De=t.unstable_NormalPriority,Oe=t.unstable_LowPriority,ke=t.unstable_IdlePriority,Ae=t.log,je=t.unstable_setDisableYieldValue,Me=null,Ne=null;function V(e){if(typeof Ae==`function`&&je(e),Ne&&typeof Ne.setStrictMode==`function`)try{Ne.setStrictMode(Me,e)}catch{}}var Pe=Math.clz32?Math.clz32:Le,Fe=Math.log,Ie=Math.LN2;function Le(e){return e>>>=0,e===0?32:31-(Fe(e)/Ie|0)|0}var Re=256,ze=262144,Be=4194304;function Ve(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 He(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=Ve(n))):i=Ve(o):i=Ve(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ve(n))):i=Ve(o)):i=Ve(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 Ue(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function We(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 Ge(){var e=Be;return Be<<=1,!(Be&62914560)&&(Be=4194304),e}function Ke(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Je(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-Pe(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&&Ye(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ye(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Pe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Xe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Pe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ze(e,t){var n=t&-t;return n=n&42?1:Qe(n),(n&(e.suspendedLanes|t))===0?n:0}function Qe(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 $e(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function et(){var e=P.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function tt(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var nt=Math.random().toString(36).slice(2),rt=`__reactFiber$`+nt,it=`__reactProps$`+nt,at=`__reactContainer$`+nt,ot=`__reactEvents$`+nt,st=`__reactListeners$`+nt,ct=`__reactHandles$`+nt,lt=`__reactResources$`+nt,ut=`__reactMarker$`+nt;function dt(e){delete e[rt],delete e[it],delete e[ot],delete e[st],delete e[ct]}function ft(e){var t=e[rt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[at]||n[rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[rt])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function pt(e){if(e=e[rt]||e[at]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function mt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ht(e){var t=e[lt];return t||=e[lt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function gt(e){e[ut]=!0}var _t=new Set,vt={};function yt(e,t){bt(e,t),bt(e+`Capture`,t)}function bt(e,t){for(vt[e]=t,e=0;e<t.length;e++)_t.add(t[e])}var xt=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]*$`),St={},Ct={};function wt(e){return B.call(Ct,e)?!0:B.call(St,e)?!1:xt.test(e)?Ct[e]=!0:(St[e]=!0,!1)}function Tt(e,t,n){if(wt(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 Et(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 Dt(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 Ot(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function kt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function At(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 jt(e){if(!e._valueTracker){var t=kt(e)?`checked`:`value`;e._valueTracker=At(e,t,``+e[t])}}function Mt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=kt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Nt(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 Pt=/[\n"\\]/g;function Ft(e){return e.replace(Pt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function It(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=``+Ot(t)):e.value!==``+Ot(t)&&(e.value=``+Ot(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Rt(e,o,Ot(n)):Rt(e,o,Ot(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=``+Ot(s):e.removeAttribute(`name`)}function Lt(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)){jt(e);return}n=n==null?``:``+Ot(n),t=t==null?n:``+Ot(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),jt(e)}function Rt(e,t,n){t===`number`&&Nt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function zt(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=``+Ot(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 Bt(e,t,n){if(t!=null&&(t=``+Ot(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ot(n)}function Vt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ot(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),jt(e)}function Ht(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ut=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 Wt(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||Ut.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Gt(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&&Wt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Wt(e,o,t[o])}function Kt(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`]]),Jt=/^[\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 Yt(e){return Jt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Xt(){}var Zt=null;function Qt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $t=null,en=null;function tn(e){var t=pt(e);if(t&&(e=t.stateNode)){var n=e[it]||null;a:switch(e=t.stateNode,t.type){case`input`:if(It(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="`+Ft(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[it]||null;if(!a)throw Error(i(90));It(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&&Mt(r)}break a;case`textarea`:Bt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&zt(e,!!n.multiple,t,!1)}}}var nn=!1;function rn(e,t,n){if(nn)return e(t,n);nn=!0;try{return e(t)}finally{if(nn=!1,($t!==null||en!==null)&&(yu(),$t&&(t=$t,e=en,en=$t=null,tn(t),e)))for(t=0;t<e.length;t++)tn(e[t])}}function an(e,t){var n=e.stateNode;if(n===null)return null;var r=n[it]||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 on=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),sn=!1;if(on)try{var cn={};Object.defineProperty(cn,"passive",{get:function(){sn=!0}}),window.addEventListener(`test`,cn,cn),window.removeEventListener(`test`,cn,cn)}catch{sn=!1}var ln=null,un=null,dn=null;function H(){if(dn)return dn;var e,t=un,n=t.length,r,i=`value`in ln?ln.value:ln.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 dn=i.slice(e,1<r?1-r:void 0)}function fn(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 pn(){return!0}function mn(){return!1}function hn(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)?pn:mn,this.isPropagationStopped=mn,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=pn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=pn)},persist:function(){},isPersistent:pn}),t}var gn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_n=hn(gn),vn=m({},gn,{view:0,detail:0}),yn=hn(vn),bn,xn,Sn,Cn=m({},vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pn,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!==Sn&&(Sn&&e.type===`mousemove`?(bn=e.screenX-Sn.screenX,xn=e.screenY-Sn.screenY):xn=bn=0,Sn=e),bn)},movementY:function(e){return`movementY`in e?e.movementY:xn}}),wn=hn(Cn),Tn=hn(m({},Cn,{dataTransfer:0})),En=hn(m({},vn,{relatedTarget:0})),Dn=hn(m({},gn,{animationName:0,elapsedTime:0,pseudoElement:0})),On=hn(m({},gn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),kn=hn(m({},gn,{data:0})),An={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},jn={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`},Mn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Nn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mn[e])?!!t[e]:!1}function Pn(){return Nn}var Fn=hn(m({},vn,{key:function(e){if(e.key){var t=An[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pn,charCode:function(e){return e.type===`keypress`?fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),In=hn(m({},Cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ln=hn(m({},vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pn})),Rn=hn(m({},gn,{propertyName:0,elapsedTime:0,pseudoElement:0})),zn=hn(m({},Cn,{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})),Bn=hn(m({},gn,{newState:0,oldState:0})),Vn=[9,13,27,32],Hn=on&&`CompositionEvent`in window,Un=null;on&&`documentMode`in document&&(Un=document.documentMode);var Wn=on&&`TextEvent`in window&&!Un,Gn=on&&(!Hn||Un&&8<Un&&11>=Un),Kn=` `,qn=!1;function Jn(e,t){switch(e){case`keyup`:return Vn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Yn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Xn=!1;function Zn(e,t){switch(e){case`compositionend`:return Yn(t);case`keypress`:return t.which===32?(qn=!0,Kn):null;case`textInput`:return e=t.data,e===Kn&&qn?null:e;default:return null}}function U(e,t){if(Xn)return e===`compositionend`||!Hn&&Jn(e,t)?(e=H(),dn=un=ln=null,Xn=!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 Gn&&t.locale!==`ko`?null:t.data;default:return null}}var Qn={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 $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Qn[e.type]:t===`textarea`}function er(e,t,n,r){$t?en?en.push(r):en=[r]:$t=r,t=Td(t,`onChange`),0<t.length&&(n=new _n(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function rr(e){vd(e,0)}function ir(e){if(Mt(mt(e)))return e}function ar(e,t){if(e===`change`)return t}var or=!1;if(on){var sr;if(on){var cr=`oninput`in document;if(!cr){var lr=document.createElement(`div`);lr.setAttribute(`oninput`,`return;`),cr=typeof lr.oninput==`function`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){tr&&(tr.detachEvent(`onpropertychange`,dr),nr=tr=null)}function dr(e){if(e.propertyName===`value`&&ir(nr)){var t=[];er(t,nr,e,Qt(e)),rn(rr,t)}}function fr(e,t,n){e===`focusin`?(ur(),tr=t,nr=n,tr.attachEvent(`onpropertychange`,dr)):e===`focusout`&&ur()}function pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ir(nr)}function mr(e,t){if(e===`click`)return ir(t)}function hr(e,t){if(e===`input`||e===`change`)return ir(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==`function`?Object.is:gr;function vr(e,t){if(_r(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(!B.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(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=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nt(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=Nt(e.document)}return t}function Cr(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 wr=on&&`documentMode`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==Nt(r)||(r=Tr,`selectionStart`in r&&Cr(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}),Dr&&vr(Dr,r)||(Dr=r,r=Td(Er,`onSelect`),0<r.length&&(t=new _n(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var jr={animationend:Ar(`Animation`,`AnimationEnd`),animationiteration:Ar(`Animation`,`AnimationIteration`),animationstart:Ar(`Animation`,`AnimationStart`),transitionrun:Ar(`Transition`,`TransitionRun`),transitionstart:Ar(`Transition`,`TransitionStart`),transitioncancel:Ar(`Transition`,`TransitionCancel`),transitionend:Ar(`Transition`,`TransitionEnd`)},Mr={},Nr={};on&&(Nr=document.createElement(`div`).style,`AnimationEvent`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),`TransitionEvent`in window||delete jr.transitionend.transition);function Pr(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),Br=Pr(`transitioncancel`),Vr=Pr(`transitionend`),Hr=new Map,Ur=`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(` `);Ur.push(`scrollEnd`);function Wr(e,t){Hr.set(e,t),yt(t,[e])}var Gr=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)},Kr=[],qr=0,Jr=0;function Yr(){for(var e=qr,t=Jr=qr=0;t<e;){var n=Kr[t];Kr[t++]=null;var r=Kr[t];Kr[t++]=null;var i=Kr[t];Kr[t++]=null;var a=Kr[t];if(Kr[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&&$r(n,i,a)}}function Xr(e,t,n,r){Kr[qr++]=e,Kr[qr++]=t,Kr[qr++]=n,Kr[qr++]=r,Jr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Zr(e,t,n,r){return Xr(e,t,n,r),ei(e)}function Qr(e,t){return Xr(e,null,null,t),ei(e)}function $r(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-Pe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ei(e){if(50<uu)throw uu=0,du=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ti={};function ni(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 ri(e,t,n,r){return new ni(e,t,n,r)}function ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ai(e,t){var n=e.alternate;return n===null?(n=ri(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 oi(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 si(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ii(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,oe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ri(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return ci(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ri(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ri(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ri(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ri(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ci(e,t,n,r){return e=ri(7,e,r,t),e.lanes=n,e}function li(e,t,n){return e=ri(6,e,null,t),e.lanes=n,e}function ui(e){var t=ri(18,null,null,0);return t.stateNode=e,t}function di(e,t,n){return t=ri(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var fi=new WeakMap;function pi(e,t){if(typeof e==`object`&&e){var n=fi.get(e);return n===void 0?(t={value:e,source:t,stack:ve(t)},fi.set(e,t),t):n}return{value:e,source:t,stack:ve(t)}}var mi=[],hi=0,gi=null,_i=0,vi=[],yi=0,bi=null,xi=1,Si=``;function Ci(e,t){mi[hi++]=_i,mi[hi++]=gi,gi=e,_i=t}function wi(e,t,n){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,bi=e;var r=xi;e=Si;var i=32-Pe(r)-1;r&=~(1<<i),n+=1;var a=32-Pe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xi=1<<32-Pe(t)+i|n<<i|r,Si=a+e}else xi=1<<a|n<<i|r,Si=e}function Ti(e){e.return!==null&&(Ci(e,1),wi(e,1,0))}function Ei(e){for(;e===gi;)gi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null;for(;e===bi;)bi=vi[--yi],vi[yi]=null,Si=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null}function Di(e,t){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,xi=t.id,Si=t.overflow,bi=e}var Oi=null,W=null,G=!1,ki=null,Ai=!1,ji=Error(i(519));function Mi(e){throw Ri(pi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ji}function Ni(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[rt]=e,t[it]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)$(gd[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),Lt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Vt(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||jd(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=Xt),t=!0):t=!1,t||Mi(e,!0)}function Pi(e){for(Oi=e.return;Oi;)switch(Oi.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:Oi=Oi.return}}function Fi(e){if(e!==Oi)return!1;if(!G)return Pi(e),G=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Ud(e.type,e.memoizedProps)),n=!n),n&&W&&Mi(e),Pi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));W=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));W=uf(e)}else t===27?(t=W,Zd(e.type)?(e=lf,lf=null,W=e):W=t):W=Oi?cf(e.stateNode.nextSibling):null;return!0}function Ii(){W=Oi=null,G=!1}function Li(){var e=ki;return e!==null&&(Xl===null?Xl=e:Xl.push.apply(Xl,e),ki=null),e}function Ri(e){ki===null?ki=[e]:ki.push(e)}var zi=ae(null),Bi=null,Vi=null;function Hi(e,t,n){L(zi,t._currentValue),t._currentValue=n}function Ui(e){e._currentValue=zi.current,I(zi)}function Wi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Gi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Wi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Wi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ki(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===le.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Gi(t,e,n,r),t.flags|=262144}function qi(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ji(e){Bi=e,Vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yi(e){return Zi(Bi,e)}function Xi(e,t){return Bi===null&&Ji(e),Zi(e,t)}function Zi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Vi===null){if(e===null)throw Error(i(308));Vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vi=Vi.next=t;return n}var Qi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},$i=t.unstable_scheduleCallback,ea=t.unstable_NormalPriority,ta={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function na(){return{controller:new Qi,data:new Map,refCount:0}}function ra(e){e.refCount--,e.refCount===0&&$i(ea,function(){e.controller.abort()})}var ia=null,aa=0,oa=0,sa=null;function ca(e,t){if(ia===null){var n=ia=[];aa=0,oa=ud(),sa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return aa++,t.then(la,la),t}function la(){if(--aa===0&&ia!==null){sa!==null&&(sa.status=`fulfilled`);var e=ia;ia=null,oa=0,sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var da=N.S;N.S=function(e,t){$l=Ce(),typeof t==`object`&&t&&typeof t.then==`function`&&ca(e,t),da!==null&&da(e,t)};var fa=ae(null);function pa(){var e=fa.current;return e===null?Ll.pooledCache:e}function ma(e,t){t===null?L(fa,fa.current):L(fa,t.pool)}function ha(){var e=pa();return e===null?null:{parent:ta._currentValue,pool:e}}var ga=Error(i(460)),_a=Error(i(474)),va=Error(i(542)),ya={then:function(){}};function ba(e){return e=e.status,e===`fulfilled`||e===`rejected`}function xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Xt,Xt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e;default:if(typeof t.status==`string`)t.then(Xt,Xt);else{if(e=Ll,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e}throw Ca=t,ga}}function Sa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ca=e,ga):e}}var Ca=null;function wa(){if(Ca===null)throw Error(i(459));var e=Ca;return Ca=null,e}function Ta(e){if(e===ga||e===va)throw Error(i(483))}var Ea=null,Da=0;function Oa(e){var t=Da;return Da+=1,Ea===null&&(Ea=[]),xa(Ea,e,t)}function ka(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Aa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ja(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ai(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=li(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Sa(i)===t.type)?(t=a(t,n.props),ka(t,n),t.return=e,t):(t=si(n.type,n.key,n.props,null,e.mode,r),ka(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=di(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=ci(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=li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=si(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case v:return t=di(t,e.mode,n),t.return=e,t;case O:return t=Sa(t),f(e,t,n)}if(ne(t)||j(t))return t=ci(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Oa(t),n);if(t.$$typeof===C)return f(e,Xi(e,t),n);Aa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Sa(n),p(e,t,n,r)}if(ne(n)||j(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Oa(n),r);if(n.$$typeof===C)return p(e,t,Xi(e,n),r);Aa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Sa(r),m(e,t,n,r,i)}if(ne(r)||j(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Oa(r),i);if(r.$$typeof===C)return m(e,t,n,Xi(t,r),i);Aa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),G&&Ci(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return G&&Ci(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),G&&Ci(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),G&&Ci(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return G&&Ci(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),G&&Ci(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Sa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ka(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=ci(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=si(o.type,o.key,o.props,null,e.mode,c),ka(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=di(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Sa(o),b(e,r,o,c)}if(ne(o))return h(e,r,o,c);if(j(o)){if(l=j(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Oa(o),c);if(o.$$typeof===C)return b(e,r,Xi(e,o),c);Aa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Da=0;var i=b(e,t,n,r);return Ea=null,i}catch(t){if(t===ga||t===va)throw t;var a=ri(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ma=ja(!0),Na=ja(!1),Pa=!1;function Fa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ia(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ei(e),$r(e,null,n),t}return Xr(e,r,t,n),ei(e)}function za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}function Ba(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Va=!1;function Ha(){if(Va){var e=sa;if(e!==null)throw e}}function Ua(e,t,n,r){Va=!1;var i=e.updateQueue;Pa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(X&f)===f:(r&f)===f){f!==0&&f===oa&&(Va=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Pa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Wl|=o,e.lanes=o,e.memoizedState=d}}function Wa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ga(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Wa(n[e],t)}var Ka=ae(null),qa=ae(0);function Ja(e,t){e=Hl,L(qa,e),L(Ka,t),Hl=e|t.baseLanes}function Ya(){L(qa,Hl),L(Ka,Ka.current)}function Xa(){Hl=qa.current,I(Ka),I(qa)}var Za=ae(null),Qa=null;function $a(e){var t=e.alternate;L(io,io.current&1),L(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){L(io,io.current),L(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(L(io,io.current),L(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){L(io,io.current),L(Za,Za.current)}function ro(e){I(Za),Qa===e&&(Qa=null),I(io)}var io=ae(0);function ao(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var oo=0,K=null,q=null,so=null,co=!1,lo=!1,uo=!1,fo=0,po=0,mo=null,ho=0;function go(){throw Error(i(321))}function _o(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function vo(e,t,n,r,i,a){return oo=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Fs:Is,uo=!1,a=n(r,i),uo=!1,lo&&(a=bo(t,n,r,i)),yo(e),a}function yo(e){N.H=Ps;var t=q!==null&&q.next!==null;if(oo=0,so=q=K=null,co=!1,po=0,mo=null,t)throw Error(i(300));e===null||$s||(e=e.dependencies,e!==null&&qi(e)&&($s=!0))}function bo(e,t,n,r){K=e;var a=0;do{if(lo&&(mo=null),po=0,lo=!1,25<=a)throw Error(i(301));if(a+=1,so=q=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Ls,o=t(n,r)}while(lo);return o}function xo(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Oo(t):t,e=e.useState()[0],(q===null?null:q.memoizedState)!==e&&(K.flags|=1024),t}function So(){var e=fo!==0;return fo=0,e}function Co(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function wo(e){if(co){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}co=!1}oo=0,so=q=K=null,lo=!1,po=fo=0,mo=null}function To(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return so===null?K.memoizedState=so=e:so=so.next=e,so}function Eo(){if(q===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=q.next;var t=so===null?K.memoizedState:so.next;if(t!==null)so=t,q=e;else{if(e===null)throw K.alternate===null?Error(i(467)):Error(i(310));q=e,e={memoizedState:q.memoizedState,baseState:q.baseState,baseQueue:q.baseQueue,queue:q.queue,next:null},so===null?K.memoizedState=so=e:so=so.next=e}return so}function Do(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oo(e){var t=po;return po+=1,mo===null&&(mo=[]),e=xa(mo,e,t),t=K,(so===null?t.memoizedState:so.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Fs:Is),e}function ko(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Oo(e);if(e.$$typeof===C)return Yi(e)}throw Error(i(438,String(e)))}function Ao(e){var t=null,n=K.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=K.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=Do(),K.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ee;return t.index++,n}function jo(e,t){return typeof t==`function`?t(e):t}function Mo(e){return No(Eo(),q,e)}function No(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(oo&f)===f:(X&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===oa&&(d=!0);else if((oo&p)===p){u=u.next,p===oa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,K.lanes|=p,Wl|=p;f=u.action,uo&&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,K.lanes|=f,Wl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&($s=!0,d&&(n=sa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Po(e){var t=Eo(),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);_r(o,t.memoizedState)||($s=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Fo(e,t,n){var r=K,a=Eo(),o=G;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((q||a).memoizedState,n);if(s&&(a.memoizedState=n,$s=!0),a=a.queue,os(Ro.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||so!==null&&so.memoizedState.tag&1){if(r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,a,n,t),null),Ll===null)throw Error(i(349));o||oo&127||Io(r,t,n)}return n}function Io(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=Do(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Lo(e,t,n,r){t.value=n,t.getSnapshot=r,zo(t)&&Bo(e)}function Ro(e,t,n){return n(function(){zo(t)&&Bo(e)})}function zo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Bo(e){var t=Qr(e,2);t!==null&&mu(t,e,2)}function Vo(e){var t=To();if(typeof e==`function`){var n=e;if(e=n(),uo){V(!0);try{n()}finally{V(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:e},t}function Ho(e,t,n,r){return e.baseState=n,No(e,q,typeof r==`function`?r:jo)}function Uo(e,t,n,r,a){if(js(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)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Wo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Wo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Go(e,t,s)}catch(n){qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Go(e,t,a)}catch(n){qo(e,t,n)}}function Go(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ko(e,t,n)},function(n){return qo(e,t,n)}):Ko(e,t,n)}function Ko(e,t,n){t.status=`fulfilled`,t.value=n,Jo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Wo(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,Jo(t),t=t.next;while(t!==r)}e.action=null}function Jo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Yo(e,t){return t}function Xo(e,t){if(G){var n=Ll.formState;if(n!==null){a:{var r=K;if(G){if(W){b:{for(var i=W,a=Ai;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){W=cf(i.nextSibling),r=i.data===`F!`;break a}}Mi(r)}r=!1}r&&(t=n[0])}}return n=To(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:t},n.queue=r,n=Os.bind(null,K,r),r.dispatch=n,r=Vo(!1),a=As.bind(null,K,!1,r.queue),r=To(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Uo.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Zo(e){return Qo(Eo(),q,e)}function Qo(e,t,n){if(t=No(e,t,Yo)[0],e=Mo(jo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Oo(t)}catch(e){throw e===ga?va:e}else r=t;t=Eo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,ts(9,{destroy:void 0},$o.bind(null,i,n),null)),[r,a,e]}function $o(e,t){e.action=t}function es(e){var t=Eo(),n=q;if(n!==null)return Qo(t,n,e);Eo(),t=t.memoizedState,n=Eo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ts(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=Do(),K.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 ns(){return Eo().memoizedState}function rs(e,t,n,r){var i=To();K.flags|=e,i.memoizedState=ts(1|t,{destroy:void 0},n,r===void 0?null:r)}function is(e,t,n,r){var i=Eo();r=r===void 0?null:r;var a=i.memoizedState.inst;q!==null&&r!==null&&_o(r,q.memoizedState.deps)?i.memoizedState=ts(t,a,n,r):(K.flags|=e,i.memoizedState=ts(1|t,a,n,r))}function as(e,t){rs(8390656,8,e,t)}function os(e,t){is(2048,8,e,t)}function ss(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=Do(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function cs(e){var t=Eo().memoizedState;return ss({ref:t,nextImpl:e}),function(){if(J&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ls(e,t){return is(4,2,e,t)}function us(e,t){return is(4,4,e,t)}function ds(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 fs(e,t,n){n=n==null?null:n.concat([e]),is(4,4,ds.bind(null,t,e),n)}function ps(){}function ms(e,t){var n=Eo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&_o(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hs(e,t){var n=Eo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&_o(t,r[1]))return r[0];if(r=e(),uo){V(!0);try{e()}finally{V(!1)}}return n.memoizedState=[r,t],r}function gs(e,t,n){return n===void 0||oo&1073741824&&!(X&261930)?e.memoizedState=t:(e.memoizedState=n,e=pu(),K.lanes|=e,Wl|=e,n)}function _s(e,t,n,r){return _r(n,t)?n:Ka.current===null?!(oo&42)||oo&1073741824&&!(X&261930)?($s=!0,e.memoizedState=n):(e=pu(),K.lanes|=e,Wl|=e,t):(e=gs(e,n,r),_r(e,t)||($s=!0),e)}function vs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,As(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ks(e,t,ua(c,r),fu(e)):ks(e,t,r,fu(e))}catch(n){ks(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function ys(){}function bs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=xs(e).queue;vs(e,a,t,re,n===null?ys:function(){return Ss(e),n(r)})}function xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ss(e){var t=xs(e);t.next===null&&(t=e.alternate.memoizedState),ks(e,t.next.queue,{},fu())}function Cs(){return Yi(Qf)}function ws(){return Eo().memoizedState}function Ts(){return Eo().memoizedState}function Es(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=La(n);var r=Ra(t,e,n);r!==null&&(mu(r,t,n),za(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Ds(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?Ms(t,n):(n=Zr(e,t,n,r),n!==null&&(mu(n,e,r),Ns(n,t,r)))}function Os(e,t,n){ks(e,t,n,fu())}function ks(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))Ms(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,_r(s,o))return Xr(e,t,i,0),Ll===null&&Yr(),!1}catch{}if(n=Zr(e,t,i,r),n!==null)return mu(n,e,r),Ns(n,t,r),!0}return!1}function As(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(i(479))}else t=Zr(e,n,r,2),t!==null&&mu(t,e,2)}function js(e){var t=e.alternate;return e===K||t!==null&&t===K}function Ms(e,t){lo=co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ns(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}var Ps={readContext:Yi,use:ko,useCallback:go,useContext:go,useEffect:go,useImperativeHandle:go,useLayoutEffect:go,useInsertionEffect:go,useMemo:go,useReducer:go,useRef:go,useState:go,useDebugValue:go,useDeferredValue:go,useTransition:go,useSyncExternalStore:go,useId:go,useHostTransitionStatus:go,useFormState:go,useActionState:go,useOptimistic:go,useMemoCache:go,useCacheRefresh:go};Ps.useEffectEvent=go;var Fs={readContext:Yi,use:ko,useCallback:function(e,t){return To().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:as,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),rs(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var n=To();t=t===void 0?null:t;var r=e();if(uo){V(!0);try{e()}finally{V(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=To();if(n!==void 0){var i=n(t);if(uo){V(!0);try{n(t)}finally{V(!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=Ds.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=To();return e={current:e},t.memoizedState=e},useState:function(e){e=Vo(e);var t=e.queue,n=Os.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ps,useDeferredValue:function(e,t){return gs(To(),e,t)},useTransition:function(){var e=Vo(!1);return e=vs.bind(null,K,e.queue,!0,!1),To().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,a=To();if(G){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ll===null)throw Error(i(349));X&127||Io(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,as(Ro.bind(null,r,o,e),[e]),r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,o,n,t),null),n},useId:function(){var e=To(),t=Ll.identifierPrefix;if(G){var n=Si,r=xi;n=(r&~(1<<32-Pe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=fo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=ho++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Cs,useFormState:Xo,useActionState:Xo,useOptimistic:function(e){var t=To();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=As.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ao,useCacheRefresh:function(){return To().memoizedState=Es.bind(null,K)},useEffectEvent:function(e){var t=To(),n={impl:e};return t.memoizedState=n,function(){if(J&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Is={readContext:Yi,use:ko,useCallback:ms,useContext:Yi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Mo,useRef:ns,useState:function(){return Mo(jo)},useDebugValue:ps,useDeferredValue:function(e,t){return _s(Eo(),q.memoizedState,e,t)},useTransition:function(){var e=Mo(jo)[0],t=Eo().memoizedState;return[typeof e==`boolean`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){return Ho(Eo(),q,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Is.useEffectEvent=cs;var Ls={readContext:Yi,use:ko,useCallback:ms,useContext:Yi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Po,useRef:ns,useState:function(){return Po(jo)},useDebugValue:ps,useDeferredValue:function(e,t){var n=Eo();return q===null?gs(n,e,t):_s(n,q.memoizedState,e,t)},useTransition:function(){var e=Po(jo)[0],t=Eo().memoizedState;return[typeof e==`boolean`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:es,useActionState:es,useOptimistic:function(e,t){var n=Eo();return q===null?(n.baseState=e,[e,n.queue.dispatch]):Ho(n,q,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Ls.useEffectEvent=cs;function Rs(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 zs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fu(),i=La(r);i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(mu(t,e,r),za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fu(),i=La(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(mu(t,e,r),za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fu(),r=La(n);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,n),t!==null&&(mu(t,e,n),za(t,e,n))}};function Bs(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?!vr(n,r)||!vr(i,a):!0}function Vs(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&&zs.enqueueReplaceState(t,t.state,null)}function Hs(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 Us(e){Gr(e)}function Ws(e){console.error(e)}function Gs(e){Gr(e)}function Ks(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function qs(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 Js(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){Ks(e,t)},n}function Ys(e){return e=La(e),e.tag=3,e}function Xs(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(){qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){qs(t,n,r),typeof i!=`function`&&(nu===null?nu=new Set([this]):nu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Zs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ki(t,n,a,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Qa===null?Eu():n.alternate===null&&Ul===0&&(Ul=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,a)),!1;case 22:return n.flags|=65536,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,a)),!1}throw Error(i(435,n.tag))}return Wu(e,r,a),Eu(),!1}if(G)return t=Za.current,t===null?(r!==ji&&(t=Error(i(423),{cause:r}),Ri(pi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=pi(r,n),a=Js(e.stateNode,r,a),Ba(e,a),Ul!==4&&(Ul=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ji&&(e=Error(i(422),{cause:r}),Ri(pi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=pi(o,n),Yl===null?Yl=[o]:Yl.push(o),Ul!==4&&(Ul=2),t===null)return!0;r=pi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Js(n.stateNode,r,e),Ba(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(nu===null||!nu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ys(a),Xs(a,e,n,r),Ba(n,a),!1}n=n.return}while(n!==null);return!1}var Qs=Error(i(461)),$s=!1;function ec(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function tc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ji(t),r=vo(e,t,n,o,a,i),s=So(),e!==null&&!$s?(Co(e,t,i),Tc(e,t,i)):(G&&s&&Ti(t),t.flags|=1,ec(e,t,r,i),t.child)}function nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,rc(e,t,a,r,i)):(e=si(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ec(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return Tc(e,t,i)}return t.flags|=1,e=ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref){if($s=!1,t.pendingProps=r=a,Ec(e,i))e.flags&131072&&($s=!0);else return t.lanes=e.lanes,Tc(e,t,i)}}return dc(e,t,n,r,i)}function ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return oc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ma(t,a===null?null:a.cachePool),a===null?Ya():Ja(t,a),to(t);else return r=t.lanes=536870912,oc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ma(t,null),Ya(),no(t)):(ma(t,a.cachePool),Ja(t,a),no(t),t.memoizedState=null);return ec(e,t,i,n),t.child}function ac(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function oc(e,t,n,r,i){var a=pa();return a=a===null?null:{parent:ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ma(t,null),Ya(),to(t),e!==null&&Ki(e,t,r,!0),t.childLanes=i,null}function sc(e,t){return t=bc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cc(e,t,n){return Ma(t,e.child,null,n),e=sc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function lc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(G){if(r.mode===`hidden`)return e=sc(t,r),t.lanes=536870912,ac(null,e);if(eo(t),(e=W)?(e=rf(e,Ai),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,W=null)):e=null,e===null)throw Mi(t);return t.lanes=536870912,null}return sc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(eo(t),a){if(t.flags&256)t.flags&=-257,t=cc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if($s||Ki(e,t,n,!1),a=(n&e.childLanes)!==0,$s||a){if(r=Ll,r!==null&&(s=Ze(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Qr(e,s),mu(r,e,s),Qs;Eu(),t=cc(e,t,n)}else e=o.treeContext,W=cf(s.nextSibling),Oi=t,G=!0,ki=null,Ai=!1,e!==null&&Di(t,e),t=sc(t,r),t.flags|=4096;return t}return e=ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function dc(e,t,n,r,i){return Ji(t),n=vo(e,t,n,r,void 0,i),r=So(),e!==null&&!$s?(Co(e,t,i),Tc(e,t,i)):(G&&r&&Ti(t),t.flags|=1,ec(e,t,n,i),t.child)}function fc(e,t,n,r,i,a){return Ji(t),t.updateQueue=null,n=bo(t,r,n,i),yo(e),r=So(),e!==null&&!$s?(Co(e,t,a),Tc(e,t,a)):(G&&r&&Ti(t),t.flags|=1,ec(e,t,n,a),t.child)}function pc(e,t,n,r,i){if(Ji(t),t.stateNode===null){var a=ti,o=n.contextType;typeof o==`object`&&o&&(a=Yi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=zs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Fa(t),o=n.contextType,a.context=typeof o==`object`&&o?Yi(o):ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Rs(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&&zs.enqueueReplaceState(a,a.state,null),Ua(t,r,a,i),Ha(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Hs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ti,typeof u==`object`&&u&&(o=Yi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Vs(t,a,r,o),Pa=!1;var f=t.memoizedState;a.state=f,Ua(t,r,a,i),Ha(),l=t.memoizedState,s||f!==l||Pa?(typeof d==`function`&&(Rs(t,n,d,r),l=t.memoizedState),(c=Pa||Bs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ia(e,t),o=t.memoizedProps,u=Hs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ti,typeof l==`object`&&l&&(c=Yi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Vs(t,a,r,c),Pa=!1,f=t.memoizedState,a.state=f,Ua(t,r,a,i),Ha();var p=t.memoizedState;o!==d||f!==p||Pa||e!==null&&e.dependencies!==null&&qi(e.dependencies)?(typeof s==`function`&&(Rs(t,n,s,r),p=t.memoizedState),(u=Pa||Bs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&qi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,uc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ma(t,e.child,null,i),t.child=Ma(t,null,n,i)):ec(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Tc(e,t,i),e}function mc(e,t,n,r){return Ii(),t.flags|=256,ec(e,t,n,r),t.child}var hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:ha()}}function _c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ql),e}function vc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(io.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(G){if(a?$a(t):no(t),(e=W)?(e=rf(e,Ai),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,W=null)):e=null,e===null)throw Mi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(no(t),a=t.mode,c=bc({mode:`hidden`,children:c},a),r=ci(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(null,r)):($a(t),yc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?($a(t),t.flags&=-257,t=xc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,a=t.mode,r=bc({mode:`visible`,children:r.children},a),c=ci(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ma(t,e.child,null,n),r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,t=ac(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ri({value:r,source:null,stack:null}),t=xc(e,t,n)}else if($s||Ki(e,t,n,!1),s=(n&e.childLanes)!==0,$s||s){if(s=Ll,s!==null&&(r=Ze(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Qr(e,r),mu(s,e,r),Qs;af(c)||Eu(),t=xc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,W=cf(c.nextSibling),Oi=t,G=!0,ki=null,Ai=!1,e!==null&&Di(t,e),t=yc(t,r.children),t.flags|=4096);return t}return a?(no(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ai(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ci(c,a,n,null),c.flags|=2):c=ai(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ac(null,r),r=t.child,c=e.child.memoizedState,c===null?c=gc(n):(a=c.cachePool,a===null?a=ha():(l=ta._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(e.child,r)):($a(t),n=e.child,e=n.sibling,n=ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function yc(e,t){return t=bc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function bc(e,t){return e=ri(22,e,null,t),e.lanes=0,e}function xc(e,t,n){return Ma(t,e.child,null,n),e=yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,n)}function Cc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function wc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,L(io,o),ec(e,t,r,n),r=G?_i:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Sc(e,n,t);else if(e.tag===19)Sc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ao(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ao(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cc(t,!0,n,null,a,r);break;case`together`:Cc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Tc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ki(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ec(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&qi(e)))}function Dc(e,t,n){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),Hi(t,ta,e.memoizedState.cache),Ii();break;case 27:case 5:de(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:Hi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($a(t),e=Tc(e,t,n),e===null?null:e.sibling):vc(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Ki(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return wc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),L(io,io.current),r)break;return null;case 22:return t.lanes=0,ic(e,t,n,t.pendingProps);case 24:Hi(t,ta,e.memoizedState.cache)}return Tc(e,t,n)}function Oc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)$s=!0;else{if(!Ec(e,n)&&!(t.flags&128))return $s=!1,Dc(e,t,n);$s=!!(e.flags&131072)}}else $s=!1,G&&t.flags&1048576&&wi(t,_i,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Sa(t.elementType),t.type=e,typeof e==`function`)ii(e)?(r=Hs(e,r),t.tag=1,t=pc(null,t,e,r,n)):(t.tag=0,t=dc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=tc(null,t,e,r,n);break a}if(a===D){t.tag=14,t=nc(null,t,e,r,n);break a}}throw t=M(e)||e,Error(i(306,t,``))}}return t;case 0:return dc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Hs(r,t.pendingProps),pc(e,t,r,a,n);case 3:a:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ia(e,t),Ua(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Hi(t,ta,r),r!==o.cache&&Gi(t,[ta],n,!0),Ha(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=mc(e,t,r,n);break a}if(r!==a){a=pi(Error(i(424)),t),Ri(a),t=mc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(W=cf(e.firstChild),Oi=t,G=!0,ki=null,Ai=!0,n=Na(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ii(),r===a){t=Tc(e,t,n);break a}ec(e,t,r,n)}t=t.child}return t;case 26:return uc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:G||(n=t.type,e=t.pendingProps,r=Bd(ce.current).createElement(n),r[rt]=t,r[it]=e,Pd(r,n,e),gt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return de(t),e===null&&G&&(r=t.stateNode=ff(t.type,t.pendingProps,ce.current),Oi=t,Ai=!0,a=W,Zd(t.type)?(lf=a,W=cf(r.firstChild)):W=a),ec(e,t,t.pendingProps.children,n),uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&G&&((a=r=W)&&(r=tf(r,t.type,t.pendingProps,Ai),r===null?a=!1:(t.stateNode=r,Oi=t,W=cf(r.firstChild),Ai=!1,a=!0)),a||Mi(t)),de(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=vo(e,t,xo,null,null,n),Qf._currentValue=a),uc(e,t),ec(e,t,r,n),t.child;case 6:return e===null&&G&&((e=n=W)&&(n=nf(n,t.pendingProps,Ai),n===null?e=!1:(t.stateNode=n,Oi=t,W=null,e=!0)),e||Mi(t)),null;case 13:return vc(e,t,n);case 4:return ue(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):ec(e,t,r,n),t.child;case 11:return tc(e,t,t.type,t.pendingProps,n);case 7:return ec(e,t,t.pendingProps,n),t.child;case 8:return ec(e,t,t.pendingProps.children,n),t.child;case 12:return ec(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Hi(t,t.type,r.value),ec(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ji(t),a=Yi(a),r=r(a),t.flags|=1,ec(e,t,r,n),t.child;case 14:return nc(e,t,t.type,t.pendingProps,n);case 15:return rc(e,t,t.type,t.pendingProps,n);case 19:return wc(e,t,n);case 31:return lc(e,t,n);case 22:return ic(e,t,n,t.pendingProps);case 24:return Ji(t),r=Yi(ta),e===null?(a=pa(),a===null&&(a=Ll,o=na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Fa(t),Hi(t,ta,a)):((e.lanes&n)!==0&&(Ia(e,t),Ua(t,null,null,n),Ha()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Hi(t,ta,r),r!==a.cache&&Gi(t,[ta],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Hi(t,ta,r))),ec(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function kc(e){e.flags|=4}function Ac(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Cu())e.flags|=8192;else throw Ca=ya,_a}}else e.flags&=-16777217}function jc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t)){if(Cu())e.flags|=8192;else throw Ca=ya,_a}}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ge(),e.lanes|=t,Jl|=t)}function Nc(e,t){if(!G)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Fc(e,t,n){var r=t.pendingProps;switch(Ei(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pc(t),null;case 1:return Pc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ui(ta),R(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?kc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li())),Pc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(kc(t),o===null?(Pc(t),Ac(t,a,null,r,n)):(Pc(t),jc(t,o))):o?o===e.memoizedState?(Pc(t),t.flags&=-16777217):(kc(t),Pc(t),jc(t,o)):(e=e.memoizedProps,e!==r&&kc(t),Pc(t),Ac(t,a,e,r,n)),null;case 27:if(z(t),n=ce.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}e=oe.current,Fi(t)?Ni(t,e):(e=ff(a,r,n),t.stateNode=e,kc(t))}return Pc(t),null;case 5:if(z(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}if(o=oe.current,Fi(t))Ni(t,o);else{var s=Bd(ce.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[rt]=t,o[it]=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(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&kc(t)}}return Pc(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ce.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Oi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[rt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Mi(t,!0)}else e=Bd(e).createTextNode(r),e[rt]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Fi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[rt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ro(t),t):(ro(t),null);if(t.flags&128)throw Error(i(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Fi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[rt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),a=!1}else a=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ro(t),t):(ro(t),null)}return ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Mc(t,t.updateQueue),Pc(t),null);case 4:return R(),e===null&&xd(t.stateNode.containerInfo),Pc(t),null;case 10:return Ui(t.type),Pc(t),null;case 19:if(I(io),r=t.memoizedState,r===null)return Pc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Nc(r,!1);else{if(Ul!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Nc(r,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oi(n,e),n=n.sibling;return L(io,io.current&1|2),G&&Ci(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ce()>eu&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=ao(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!G)return Pc(t),null}else 2*Ce()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ce(),e.sibling=null,n=io.current,L(io,a?n&1|2:n&1),G&&Ci(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Mc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&I(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ta),Pc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ic(e,t){switch(Ei(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),R(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return z(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(io),null;case 4:return R(),null;case 10:return Ui(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&I(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(ta),null;case 25:return null;default:return null}}function Lc(e,t){switch(Ei(t),t.tag){case 3:Ui(ta),R();break;case 26:case 27:case 5:z(t);break;case 4:R();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:I(io);break;case 10:Ui(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&I(fa);break;case 24:Ui(ta)}}function Rc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Q(t,t.return,e)}}function zc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Q(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Q(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){Q(e,e.return,t)}}}function Vc(e,t,n){n.props=Hs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Q(e,t,n)}}function Hc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Q(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Q(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){Q(e,t,n)}else n.current=null}}function Wc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Q(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[it]=t}catch(t){Q(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[rt]=e,t[it]=n}catch(t){Q(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,el=typeof WeakSet==`function`?WeakSet:Set,tl=null;function nl(e,t){if(e=e.containerInfo,Rd=sp,e=Sr(e),Cr(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(zd={focusedElem:e,selectionRange:n},sp=!1,tl=t;tl!==null;)if(t=tl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,tl=e;else for(;tl!==null;){switch(t=tl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Hs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Q(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,tl=e;break}tl=t.return}}function rl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&Rc(5,n);break;case 1:if(vl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Q(n,n.return,e)}else{var i=Hs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Q(n,n.return,e)}}}r&64&&Bc(n),r&512&&Hc(n,n.return);break;case 3:if(vl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ga(e,t)}catch(e){Q(n,n.return,e)}}break;case 27:t===null&&r&4&&Xc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Wc(n),r&512&&Hc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ll(e,n);break;case 13:vl(e,n),r&4&&ul(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Zc,!r){t=t!==null&&t.memoizedState!==null||Qc,i=Zc;var a=Qc;Zc=r,(Qc=t)&&!a?bl(e,n,!!(n.subtreeFlags&8772)):vl(e,n),Zc=i,Qc=a}break;case 30:break;default:vl(e,n)}}function il(e){var t=e.alternate;t!==null&&(e.alternate=null,il(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&dt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var al=null,ol=!1;function sl(e,t,n){for(n=n.child;n!==null;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(Ne&&typeof Ne.onCommitFiberUnmount==`function`)try{Ne.onCommitFiberUnmount(Me,n)}catch{}switch(n.tag){case 26:Qc||Uc(n,t),sl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Qc||Uc(n,t);var r=al,i=ol;Zd(n.type)&&(al=n.stateNode,ol=!1),sl(e,t,n),pf(n.stateNode),al=r,ol=i;break;case 5:Qc||Uc(n,t);case 6:if(r=al,i=ol,al=null,sl(e,t,n),al=r,ol=i,al!==null){if(ol)try{(al.nodeType===9?al.body:al.nodeName===`HTML`?al.ownerDocument.body:al).removeChild(n.stateNode)}catch(e){Q(n,t,e)}else try{al.removeChild(n.stateNode)}catch(e){Q(n,t,e)}}break;case 18:al!==null&&(ol?(e=al,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(al,n.stateNode));break;case 4:r=al,i=ol,al=n.stateNode.containerInfo,ol=!0,sl(e,t,n),al=r,ol=i;break;case 0:case 11:case 14:case 15:zc(2,n,t),Qc||zc(4,n,t),sl(e,t,n);break;case 1:Qc||(Uc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Vc(n,t,r)),sl(e,t,n);break;case 21:sl(e,t,n);break;case 22:Qc=(r=Qc)||n.memoizedState!==null,sl(e,t,n),Qc=r;break;default:sl(e,t,n)}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Q(t,t.return,e)}}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Q(t,t.return,e)}}function dl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new el),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new el),t;default:throw Error(i(435,e.tag))}}function fl(e,t){var n=dl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function pl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){al=c.stateNode,ol=!1;break a}break;case 5:al=c.stateNode,ol=!1;break a;case 3:case 4:al=c.stateNode.containerInfo,ol=!0;break a}c=c.return}if(al===null)throw Error(i(160));cl(o,s,a),al=null,ol=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hl(t,e),t=t.sibling}var ml=null;function hl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pl(t,e),gl(e),r&4&&(zc(3,e,e.return),Rc(3,e),zc(5,e,e.return));break;case 1:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&64&&Zc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=ml;if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ut]||o[rt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[rt]=e,gt(o),r=o;break a;case`link`:var s=Vf(`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),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`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),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[rt]=e,gt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode)}else e.stateNode=If(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Gc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),n!==null&&r&4&&Gc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),e.flags&32){a=e.stateNode;try{Ht(a,``)}catch(t){Q(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Gc(e,a,n===null?a:n.memoizedProps)),r&1024&&($c=!0);break;case 6:if(pl(t,e),gl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Q(e,e.return,t)}}break;case 3:if(Bf=null,a=ml,ml=gf(t.containerInfo),pl(t,e),ml=a,gl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Q(e,e.return,t)}$c&&($c=!1,_l(e));break;case 4:r=ml,ml=gf(e.stateNode.containerInfo),pl(t,e),gl(e),ml=r;break;case 12:pl(t,e),gl(e);break;case 31:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 13:pl(t,e),gl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ql=Ce()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Zc,d=Qc;if(Zc=u||a,Qc=d||l,pl(t,e),Qc=d,Zc=u,gl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Zc||Qc||yl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Q(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Q(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Q(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,fl(e,n))));break;case 19:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 30:break;case 21:break;default:pl(t,e),gl(e)}}function gl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Yc(e,qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Ht(o,``),n.flags&=-33),Yc(e,qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Jc(e,qc(e),s);break;default:throw Error(i(161))}}catch(t){Q(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rl(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zc(4,t,t.return),yl(t);break;case 1:Uc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Vc(t,t.return,n),yl(t);break;case 27:pf(t.stateNode);case 26:case 5:Uc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:bl(i,a,n),Rc(4,a);break;case 1:if(bl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Q(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Wa(c[i],s)}catch(e){Q(r,r.return,e)}}n&&o&64&&Bc(a),Hc(a,a.return);break;case 27:Xc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Wc(a),Hc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ll(i,a);break;case 13:bl(i,a,n),n&&o&4&&ul(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Hc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ra(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&Rc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e)));break;case 12:if(i&2048){Cl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Q(t,t.return,e)}}else Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Cl(e,t,n,r):El(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Tl(a,o,s,c,i),Rc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):El(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function El(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:El(n,r),i&2048&&xl(r.alternate,r);break;case 24:El(n,r),i&2048&&Sl(r.alternate,r);break;default:El(n,r)}t=t.sibling}}var Dl=8192;function Ol(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)kl(e,t,n),e=e.sibling}function kl(e,t,n){switch(e.tag){case 26:Ol(e,t,n),e.flags&Dl&&e.memoizedState!==null&&Gf(n,ml,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,n);break;case 3:case 4:var r=ml;ml=gf(e.stateNode.containerInfo),Ol(e,t,n),ml=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Dl,Dl=16777216,Ol(e,t,n),Dl=r):Ol(e,t,n));break;default:Ol(e,t,n)}}function Al(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ml(e),e=e.sibling}function Ml(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&zc(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nl(e)):jl(e);break;default:jl(e)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zc(8,t,t.return),Nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nl(t));break;default:Nl(t)}e=e.sibling}}function Pl(e,t){for(;tl!==null;){var n=tl;switch(n.tag){case 0:case 11:case 15:zc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,tl=r;else a:for(n=e;tl!==null;){r=tl;var i=r.sibling,a=r.return;if(il(r),r===n){tl=null;break a}if(i!==null){i.return=a,tl=i;break a}tl=a}}}var Fl={getCacheForType:function(e){var t=Yi(ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Yi(ta).controller.signal}},Il=typeof WeakMap==`function`?WeakMap:Map,J=0,Ll=null,Y=null,X=0,Z=0,Rl=null,zl=!1,Bl=!1,Vl=!1,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=null,Xl=null,Zl=!1,Ql=0,$l=0,eu=1/0,tu=null,nu=null,ru=0,iu=null,au=null,ou=0,su=0,cu=null,lu=null,uu=0,du=null;function fu(){return J&2&&X!==0?X&-X:N.T===null?et():ud()}function pu(){if(ql===0){if(!(X&536870912)||G){var e=ze;ze<<=1,!(ze&3932160)&&(ze=262144),ql=e}else ql=536870912}return e=Za.current,e!==null&&(e.flags|=32),ql}function mu(e,t,n){(e===Ll&&(Z===2||Z===9)||e.cancelPendingCommit!==null)&&(xu(e,0),vu(e,X,ql,!1)),qe(e,n),(!(J&2)||e!==Ll)&&(e===Ll&&(!(J&2)&&(Gl|=n),Ul===4&&vu(e,X,ql,!1)),nd(e))}function hu(e,t,n){if(J&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ue(e,t),a=r?ku(e,t):Du(e,t,!0),o=r;do{if(a===0){Bl&&!r&&vu(e,t,0,!1);break}if(n=e.current.alternate,o&&!_u(n)){a=Du(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=Yl;var l=c.current.memoizedState.isDehydrated;if(l&&(xu(c,s).flags|=256),s=Du(c,s,!1),s!==2){if(Vl&&!l){c.errorRecoveryDisabledLanes|=o,Gl|=o,a=4;break a}o=Xl,Xl=a,o!==null&&(Xl===null?Xl=o:Xl.push.apply(Xl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){xu(e,0),vu(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:vu(r,t,ql,!zl);break a;case 2:Xl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Ql+300-Ce(),10<a)){if(vu(r,t,ql,!zl),He(r,0,!0)!==0)break a;ou=t,r.timeoutHandle=Kd(gu.bind(null,r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,`Throttled`,-0,0),a);break a}gu(r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,null,-0,0)}break}while(1);nd(e)}function gu(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:Xt},kl(t,a,d);var m=(a&62914560)===a?Ql-Ce():(a&4194048)===a?$l-Ce():0;if(m=qf(d,m),m!==null){ou=a,e.cancelPendingCommit=m(Iu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),vu(e,a,o,!l);return}}Iu(e,t,a,n,r,i,o,s,c)}function _u(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(!_r(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 vu(e,t,n,r){t&=~Kl,t&=~Gl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Pe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ye(e,n,t)}function yu(){return J&6?!0:(rd(0,!1),!1)}function bu(){if(Y!==null){if(Z===0)var e=Y.return;else e=Y,Vi=Bi=null,wo(e),Ea=null,Da=0,e=Y;for(;e!==null;)Lc(e.alternate,e),e=e.return;Y=null}}function xu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ou=0,bu(),Ll=e,Y=n=ai(e.current,null),X=t,Z=0,Rl=null,zl=!1,Bl=Ue(e,t),Vl=!1,Jl=ql=Kl=Gl=Wl=Ul=0,Xl=Yl=null,Zl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Pe(r),a=1<<i;t|=e[i],r&=~a}return Hl=t,Yr(),n}function Su(e,t){K=null,N.H=Ps,t===ga||t===va?(t=wa(),Z=3):t===_a?(t=wa(),Z=4):Z=t===Qs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Rl=t,Y===null&&(Ul=1,Ks(e,pi(t,e.current)))}function Cu(){var e=Za.current;return e===null?!0:(X&4194048)===X?Qa===null:(X&62914560)===X||X&536870912?e===Qa:!1}function wu(){var e=N.H;return N.H=Ps,e===null?Ps:e}function Tu(){var e=N.A;return N.A=Fl,e}function Eu(){Ul=4,zl||(X&4194048)!==X&&Za.current!==null||(Bl=!0),!(Wl&134217727)&&!(Gl&134217727)||Ll===null||vu(Ll,X,ql,!1)}function Du(e,t,n){var r=J;J|=2;var i=wu(),a=Tu();(Ll!==e||X!==t)&&(tu=null,xu(e,t)),t=!1;var o=Ul;a:do try{if(Z!==0&&Y!==null){var s=Y,c=Rl;switch(Z){case 8:bu(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=Z;if(Z=0,Rl=null,Nu(e,s,c,l),n&&Bl){o=0;break a}break;default:l=Z,Z=0,Rl=null,Nu(e,s,c,l)}}Ou(),o=Ul;break}catch(t){Su(e,t)}while(1);return t&&e.shellSuspendCounter++,Vi=Bi=null,J=r,N.H=i,N.A=a,Y===null&&(Ll=null,X=0,Yr()),o}function Ou(){for(;Y!==null;)ju(Y)}function ku(e,t){var n=J;J|=2;var r=wu(),a=Tu();Ll!==e||X!==t?(tu=null,eu=Ce()+500,xu(e,t)):Bl=Ue(e,t);a:do try{if(Z!==0&&Y!==null){t=Y;var o=Rl;b:switch(Z){case 1:Z=0,Rl=null,Nu(e,t,o,1);break;case 2:case 9:if(ba(o)){Z=0,Rl=null,Mu(t);break}t=function(){Z!==2&&Z!==9||Ll!==e||(Z=7),nd(e)},o.then(t,t);break a;case 3:Z=7;break a;case 4:Z=5;break a;case 7:ba(o)?(Z=0,Rl=null,Mu(t)):(Z=0,Rl=null,Nu(e,t,o,7));break;case 5:var s=null;switch(Y.tag){case 26:s=Y.memoizedState;case 5:case 27:var c=Y;if(s?Wf(s):c.stateNode.complete){Z=0,Rl=null;var l=c.sibling;if(l!==null)Y=l;else{var u=c.return;u===null?Y=null:(Y=u,Pu(u))}break b}}Z=0,Rl=null,Nu(e,t,o,5);break;case 6:Z=0,Rl=null,Nu(e,t,o,6);break;case 8:bu(),Ul=6;break a;default:throw Error(i(462))}}Au();break}catch(t){Su(e,t)}while(1);return Vi=Bi=null,N.H=r,N.A=a,J=n,Y===null?(Ll=null,X=0,Yr(),Ul):0}function Au(){for(;Y!==null&&!xe();)ju(Y)}function ju(e){var t=Oc(e.alternate,e,Hl);e.memoizedProps=e.pendingProps,t===null?Pu(e):Y=t}function Mu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fc(n,t,t.pendingProps,t.type,void 0,X);break;case 11:t=fc(n,t,t.pendingProps,t.type.render,t.ref,X);break;case 5:wo(t);default:Lc(n,t),t=Y=oi(t,Hl),t=Oc(n,t,Hl)}e.memoizedProps=e.pendingProps,t===null?Pu(e):Y=t}function Nu(e,t,n,r){Vi=Bi=null,wo(t),Ea=null,Da=0;var i=t.return;try{if(Zs(e,i,t,n,X)){Ul=1,Ks(e,pi(n,e.current)),Y=null;return}}catch(t){if(i!==null)throw Y=i,t;Ul=1,Ks(e,pi(n,e.current)),Y=null;return}t.flags&32768?(G||r===1?e=!0:Bl||X&536870912?e=!1:(zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fu(t,e)):Pu(t)}function Pu(e){var t=e;do{if(t.flags&32768){Fu(t,zl);return}e=t.return;var n=Fc(t.alternate,t,Hl);if(n!==null){Y=n;return}if(t=t.sibling,t!==null){Y=t;return}Y=t=e}while(t!==null);Ul===0&&(Ul=5)}function Fu(e,t){do{var n=Ic(e.alternate,e);if(n!==null){n.flags&=32767,Y=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Y=e;return}Y=e=n}while(e!==null);Ul=6,Y=null}function Iu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Vu();while(ru!==0);if(J&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Jr,Je(e,n,o,s,c,l),e===Ll&&(Y=Ll=null,X=0),au=t,iu=e,ou=n,su=o,cu=a,lu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(De,function(){return Hu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=J,J|=4;try{nl(e,t,n)}finally{J=s,P.p=a,N.T=r}}ru=1,Lu(),Ru(),zu()}}function Lu(){if(ru===1){ru=0;var e=iu,t=au,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=J;J|=4;try{hl(t,e);var a=zd,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(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 _=br(s,h),v=br(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}}sp=!!Rd,zd=Rd=null}finally{J=i,P.p=r,N.T=n}}e.current=t,ru=2}}function Ru(){if(ru===2){ru=0;var e=iu,t=au,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=J;J|=4;try{rl(e,t.alternate,t)}finally{J=i,P.p=r,N.T=n}}ru=3}}function zu(){if(ru===4||ru===3){ru=0,Se();var e=iu,t=au,n=ou,r=lu;t.subtreeFlags&10256||t.flags&10256?ru=5:(ru=0,au=iu=null,Bu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(nu=null),$e(n),t=t.stateNode,Ne&&typeof Ne.onCommitFiberRoot==`function`)try{Ne.onCommitFiberRoot(Me,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.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{N.T=t,P.p=i}}ou&3&&Vu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===du?uu++:(uu=0,du=e):uu=0,rd(0,!1)}}function Bu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Vu(){return Lu(),Ru(),zu(),Hu()}function Hu(){if(ru!==5)return!1;var e=iu,t=su;su=0;var n=$e(ou),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=cu,cu=null;var o=iu,s=ou;if(ru=0,au=iu=null,ou=0,J&6)throw Error(i(331));var c=J;if(J|=4,Ml(o.current),wl(o,o.current,s,n),J=c,rd(0,!1),Ne&&typeof Ne.onPostCommitFiberRoot==`function`)try{Ne.onPostCommitFiberRoot(Me,o)}catch{}return!0}finally{P.p=a,N.T=r,Bu(e,t)}}function Uu(e,t,n){t=pi(n,t),t=Js(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(qe(e,2),nd(e))}function Q(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=pi(n,e),n=Ys(2),r=Ra(t,n,2),r!==null&&(Xs(n,r,t,e),qe(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Il;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Vl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ll===e&&(X&n)===n&&(Ul===4||Ul===3&&(X&62914560)===X&&300>Ce()-Ql?!(J&2)&&xu(e,0):Kl|=n,Jl===X&&(Jl=0)),nd(e)}function Ku(e,t){t===0&&(t=Ge()),e=Qr(e,t),e!==null&&(qe(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(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),Ku(e,n)}function Yu(e,t){return ye(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;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-Pe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=X,a=He(r,r===Ll?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ue(r,a)||(n=!0,cd(r,a))}r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=Ce(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}ru!==0&&ru!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Pe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=We(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ll,n=X,n=He(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Z===2||Z===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&be(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ue(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&be(r),$e(n)){case 2:case 8:n=Ee;break;case 32:n=De;break;case 268435456:n=ke;break;default:n=De}return r=sd.bind(null,e),n=ye(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&be(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(ru!==0&&ru!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Vu()&&e.callbackNode!==n)return null;var r=X;return r=He(e,e===Ll?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(hu(e,r,t),od(e,Ce()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Vu())return null;hu(e,t,!0)}function ld(){Yd(function(){J&6?ye(Te,id):ad()})}function ud(){if(td===0){var e=oa;e===0&&(e=Re,Re<<=1,!(Re&261888)&&(Re=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Yt(``+e)}function fd(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 pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[it]||null).action),o=r.submitter;o&&(t=(t=o[it]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new _n(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);bs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),bs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Ur.length;md++){var hd=Ur[md];Wr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Wr(Fr,`onAnimationEnd`),Wr(Ir,`onAnimationIteration`),Wr(Lr,`onAnimationStart`),Wr(`dblclick`,`onDoubleClick`),Wr(`focusin`,`onFocus`),Wr(`focusout`,`onBlur`),Wr(Rr,`onTransitionRun`),Wr(zr,`onTransitionStart`),Wr(Br,`onTransitionCancel`),Wr(Vr,`onTransitionEnd`),bt(`onMouseEnter`,[`mouseout`,`mouseover`]),bt(`onMouseLeave`,[`mouseout`,`mouseover`]),bt(`onPointerEnter`,[`pointerout`,`pointerover`]),bt(`onPointerLeave`,[`pointerout`,`pointerover`]),yt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),yt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),yt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),yt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),yt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),yt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`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(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(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){Gr(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){Gr(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[ot];n===void 0&&(n=t[ot]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,_t.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!sn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Cd(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=ft(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}rn(function(){var r=a,i=Qt(n),s=[];a:{var c=Hr.get(e);if(c!==void 0){var l=_n,u=e;switch(e){case`keypress`:if(fn(n)===0)break a;case`keydown`:case`keyup`:l=Fn;break;case`focusin`:u=`focus`,l=En;break;case`focusout`:u=`blur`,l=En;break;case`beforeblur`:case`afterblur`:l=En;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=wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Tn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Ln;break;case Fr:case Ir:case Lr:l=Dn;break;case Vr:l=Rn;break;case`scroll`:case`scrollend`:l=yn;break;case`wheel`:l=zn;break;case`copy`:case`cut`:case`paste`:l=On;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=In;break;case`toggle`:case`beforetoggle`:l=Bn}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=an(m,p),g!=null&&d.push(wd(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!==Zt&&(u=n.relatedTarget||n.fromElement)&&(ft(u)||u[at]))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?ft(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=wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=In,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:mt(l),h=u==null?c:mt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ft(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=Ed,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&&Dd(s,c,l,d,!1),u!==null&&f!==null&&Dd(s,f,u,d,!0)}}a:{if(c=r?mt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ar;else if($n(c)){if(or)v=hr;else{v=pr;var y=fr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Kt(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){er(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Rt(c,`number`,c.value)}switch(y=r?mt(r):window,e){case`focusin`:($n(y)||y.contentEditable===`true`)&&(Tr=y,Er=r,Dr=null);break;case`focusout`:Dr=Er=Tr=null;break;case`mousedown`:Or=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Or=!1,kr(s,n,i);break;case`selectionchange`:if(wr)break;case`keydown`:case`keyup`:kr(s,n,i)}var b;if(Hn)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 Xn?Jn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Gn&&n.locale!==`ko`&&(Xn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Xn&&(b=H()):(ln=i,un=`value`in ln?ln.value:ln.textContent,Xn=!0)),y=Td(r,x),0<y.length&&(x=new kn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Yn(n),b!==null&&(x.data=b)))),(b=Wn?Zn(e,n):U(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),pd(s,e,r,n,i)}vd(s,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(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=an(e,n),i!=null&&r.unshift(wd(e,i,a)),i=an(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(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=an(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=an(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
10
- `).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ht(e,``+r);break;case`className`:Et(e,`class`,r);break;case`tabIndex`:Et(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Et(e,n,r);break;case`style`:Gt(e,r,o);break;case`data`:if(t!==`object`){Et(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=Yt(``+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`&&Md(e,t,`name`,a.name,a,null),Md(e,t,`formEncType`,a.formEncType,a,null),Md(e,t,`formMethod`,a.formMethod,a,null),Md(e,t,`formTarget`,a.formTarget,a,null)):(Md(e,t,`encType`,a.encType,a,null),Md(e,t,`method`,a.method,a,null),Md(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`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=Yt(``+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`:$(`beforetoggle`,e),$(`toggle`,e),Tt(e,`popover`,r);break;case`xlinkActuate`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Tt(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,Tt(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Gt(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`?Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ht(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!vt.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[it]||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,``):Tt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,o,s,n,null)}}a&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Md(e,t,r,d,n,null)}}Lt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Md(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&zt(e,!!r,n,!0):zt(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Md(e,t,s,c,n,null)}Vt(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:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Md(e,t,u,r,n,null)}return;default:if(Kt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(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)||Md(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&&Md(e,t,p,m,r,f)}}It(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)||Md(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&&Md(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?zt(e,!!n,n?[]:``,!1):zt(e,!!n,t,!0)):zt(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:Md(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&&Md(e,t,s,a,r,o)}Bt(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:Md(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:Md(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)&&Md(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:Md(e,t,u,p,r,m)}return;default:if(Kt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(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||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(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||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){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&&Id(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&&Id(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 Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(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 Hd(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 Ud(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 Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e!==Wd&&(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(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),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ut]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body)}n=i}while(n);Np(t)}function $d(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 ef(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`:ef(n),dt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(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[ut])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=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(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 cf(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 lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(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 ff(e,t,n){switch(t=Bd(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 pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);dt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=P.d;P.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=yu();return e||t}function yf(e){var t=pt(e);t!==null&&t.tag===5&&t.type===`form`?Ss(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Ft(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),gt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ft(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ft(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ft(n.imageSizes)+`"]`)):i+=`[href="`+Ft(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),gt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ft(r)+`"][href="`+Ft(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),gt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=ht(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);gt(c),Pd(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,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=ht(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),gt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=ht(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),gt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=ce.current)?gf(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=Af(n.href),n=ht(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=Af(n.href);var o=ht(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(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.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},mf.set(e,n),o||Nf(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=Pf(n),n=ht(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 Af(e){return`href="`+Ft(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(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}),Pd(t,`link`,n),gt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Ft(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ft(n.href)+`"]`);if(r)return t.instance=r,gt(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`),gt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,gt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),gt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,gt(a),a):(r=n,(a=mf.get(o))&&(r=m({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),gt(a),Pd(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,Lf(r,n.precedence,e));return t.instance}function Lf(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 Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,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[ut]||a[rt]||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 Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(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=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,gt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),gt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(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=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.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=Jf.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 Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function $f(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=Ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ke(0),this.hiddenUpdates=Ke(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 ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ri(3,null,null,t),e.current=a,a.stateNode=e,t=na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Fa(a),e}function tp(e){return e?(e=ti,e):ti}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=La(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ra(e,r,t),n!==null&&(mu(n,e,t),za(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=Qr(e,67108864);t!==null&&mu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=fu();t=Qe(t);var n=Qr(e,t);n!==null&&mu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,up(e,t,n,r)}finally{P.p=a,N.T=i}}function lp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,up(e,t,n,r)}finally{P.p=a,N.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ve(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Pe(o);s.entanglements[1]|=c,o&=~c}nd(a),!(J&6)&&(eu=Ce()+500,rd(0,!1))}}break;case 31:case 13:s=Qr(a,2),s!==null&&mu(s,a,2),yu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=Qt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=ft(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 fp=e,null}function mp(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(we()){case Te:return 2;case Ee:return 8;case De:case Oe:return 32;case ke:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(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=pt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=ft(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,tt(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,tt(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Zt=r,n.target.dispatchEvent(r),Zt=null}else return t=pt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=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(pp(r||n)===null)continue;break}var a=pt(n);a!==null&&(e.splice(t,3),t-=3,bs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.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[it]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[it]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){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 Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,fu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),yu(),t[at]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.8`)throw Error(i(527,Lp,`19.2.8`));P.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 Rp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Me=zp.inject(Rp),Ne=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Us,s=Ws,c=Gs;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=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[at]=t.current,xd(e),new Fp(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=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})),x=o(((e,t)=>{t.exports=b()})),S=x();function C({name:e,fill:t,className:n}){return(0,S.jsx)(`span`,{className:`ms material-symbols-rounded${t?` ms-fill`:``}${e===`progress_activity`?` ms-spin`:``}${n?` ${n}`:``}`,"aria-hidden":!0,children:e})}function w(){let[e,t]=(0,v.useState)(()=>window.location.hash.slice(1)||`/`);return(0,v.useEffect)(()=>{let e=()=>t(window.location.hash.slice(1)||`/`);return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),e}var T=`kraftwerk inspector`,E=``,D=0;function O(){let e=E?`${E} — ${T}`:T;document.title=D>0?`(${D}) ${e}`:e}function k(e){e!==D&&(D=e,O())}function ee(e){T=e,O()}function A(e){E=e,O()}function j(e,t){t?.replace?window.location.replace(`#${e}`):window.location.hash=e}async function te(e){let t=await fetch(`/api/workspaces/start`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({root:e})}),n=await t.json();if(!n.ok)throw Error(n.error||`HTTP ${t.status}`);if(window.dispatchEvent(new Event(`kw-meta-refresh`)),n.live&&n.url)return n.url;for(let t=0;t<12;t++){await new Promise(e=>setTimeout(e,1e3));try{let t=(await fetch(`/api/meta`,{cache:`no-store`}).then(e=>e.json())).switcher?.find(t=>t.root===e&&t.live);if(t)return t.url}catch{}}throw Error(`started, but the UI did not answer yet — see ~/.kraftwerk/logs`)}function M({href:e,...t}){return(0,S.jsx)(`a`,{href:`#${e}`,...t})}var ne=`kw-expert`,N=(()=>{try{return localStorage.getItem(ne)!==`off`}catch{return!0}})(),P=new Set;document.documentElement.dataset.expert=N?`on`:`off`;function re(e){N=e,document.documentElement.dataset.expert=e?`on`:`off`;try{localStorage.setItem(ne,e?`on`:`off`)}catch{}P.forEach(e=>e())}function F(){return(0,v.useSyncExternalStore)(e=>(P.add(e),()=>P.delete(e)),()=>N)}var ie={git:!1,repos:!1,vibeables:!1,projects:!1},ae=new Set;function I(e){(e.git!==ie.git||e.repos!==ie.repos||e.vibeables!==ie.vibeables||e.projects!==ie.projects)&&(ie=e,ae.forEach(e=>e()))}function L(){return(0,v.useSyncExternalStore)(e=>(ae.add(e),()=>ae.delete(e)),()=>ie)}function oe(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return(t>>>0)%360}function se(e,t){return e||`hsl(${oe(t)} 58% 46%)`}function ce(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(t){let e=t[1].length===3?t[1].split(``).map(e=>e+e).join(``):t[1];return[0,2,4].map(t=>parseInt(e.slice(t,t+2),16))}let n=/^hsl\(\s*([\d.]+)[ ,]+([\d.]+)%[ ,]+([\d.]+)%/i.exec(e.trim());if(!n)return null;let r=n[1]/360,i=n[2]/100,a=n[3]/100,o=a<.5?a*(1+i):a+i-a*i,s=2*a-o,c=e=>(e=(e+1)%1,e<1/6?s+(o-s)*6*e:e<1/2?o:e<2/3?s+(o-s)*(2/3-e)*6:s);return[c(r+1/3),c(r),c(r-1/3)].map(e=>Math.round(e*255))}var le=(e,t,n)=>e.map((e,r)=>Math.round(e+(t[r]-e)*n)),ue=e=>`#`+e.map(e=>e.toString(16).padStart(2,`0`)).join(``);function R([e,t,n]){let r=e=>(e/=255)<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*r(e)+.7152*r(t)+.0722*r(n)}function de(e,t){let n=R(e),r=R(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function z(e,t,n,r){let i=e;for(let a=0;a<=1&&de(i,t)<n;a+=.04)i=le(e,r,a);return i}var fe=[255,255,255],pe=[0,0,0],me=[38,37,35];function he(e){let t=ce(e);if(!t)return null;let n=z(t,fe,4.5,pe),r=le(t,fe,.84),i=le(t,fe,.88),a=z(le(t,fe,.4),me,4.5,fe),o=le(t,pe,.42),s=le(t,pe,.6);return{"--wsp-l-primary":ue(n),"--wsp-l-on-primary":ue(fe),"--wsp-l-primary-container":ue(r),"--wsp-l-on-primary-container":ue(z(le(t,pe,.6),r,4.5,pe)),"--wsp-l-secondary-container":ue(i),"--wsp-l-on-secondary-container":ue(z(le(t,pe,.65),i,4.5,pe)),"--wsp-d-primary":ue(a),"--wsp-d-on-primary":ue(z(le(t,pe,.7),a,4.5,pe)),"--wsp-d-primary-container":ue(o),"--wsp-d-on-primary-container":ue(z(le(t,fe,.8),o,4.5,fe)),"--wsp-d-secondary-container":ue(s),"--wsp-d-on-secondary-container":ue(z(le(t,fe,.85),s,4.5,fe))}}function ge(e){let t=e.split(/[^\p{L}\p{N}]+/u).filter(Boolean);return t.length===0?`?`:(t.length>=2?t[0][0]+t[1][0]:t[0].slice(0,2)).toUpperCase()}function _e({icon:e,name:t,color:n,seed:r,ambiguous:i,className:a}){let o={"--ws-c":se(n,r)};return(0,S.jsxs)(`span`,{className:`ws-tile${e?``:` ws-tile-mono`}${a?` ${a}`:``}`,style:o,"aria-hidden":!0,children:[e||ge(t),e&&i&&(0,S.jsx)(`span`,{className:`ws-tile-badge`,children:ge(t)})]})}async function ve(e,t){let n=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t??{})}),r=await n.json().catch(()=>({}));return!n.ok&&!r.error&&(r.error=`HTTP ${n.status}`),r}function B(e,t,n=6e3){let[r,i]=(0,v.useState)(null),a=(0,v.useRef)(e);return a.current=e,(0,v.useEffect)(()=>{let e=!0,r,o=async()=>{if(a.current){try{let t=await fetch(a.current,{cache:`no-store`});t.ok&&e&&i(await t.json())}catch{}e&&(r=setTimeout(o,t?1500:n))}};return o(),()=>{e=!1,clearTimeout(r)}},[e,t,n]),r}function ye(e){if(e==null)return`—`;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m${String(t%60).padStart(2,`0`)}s`}function be(e){return e==null?`—`:`$${e.toFixed(2)}`}function xe(e){return e?e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e):`0`}function Se(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} K`:`${(e/1024/1024).toFixed(1)} M`}function Ce(e){if(!e)return`—`;let t=new Date(e),n=new Date,r=t.toDateString()===n.toDateString(),i=t.toTimeString().slice(0,5);return r?i:`${t.toISOString().slice(5,10)} ${i}`}function we(e){if(!e)return`—`;let t=Date.now()-Date.parse(e);if(t<6e4)return`just now`;let n=Math.floor(t/6e4);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let i=Math.floor(r/24);return i<7?`${i}d ago`:new Date(e).toISOString().slice(5,10)}function Te({since:e}){let[,t]=(0,v.useState)(0);return(0,v.useEffect)(()=>{let e=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(e)},[]),e?(0,S.jsx)(`span`,{className:`num`,children:ye(Date.now()-Date.parse(e))}):null}function Ee({status:e}){return(0,S.jsx)(`span`,{className:`lamp ${e}`})}function De({status:e}){return(0,S.jsx)(`span`,{className:`status-word ${e}`,children:e})}function Oe({runId:e,decision:t}){let{request:n,answer:r}=t,[i,a]=(0,v.useState)(n.options.length===1?n.options[0].value:null),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null),f=e=>n.options.find(t=>t.value===e)?.label??e;if(r)return(0,S.jsx)(`section`,{className:`panel decision-panel is-decided`,"aria-label":`decision`,children:(0,S.jsxs)(`div`,{className:`decision-body`,children:[(0,S.jsx)(`div`,{className:`decision-title`,children:n.title??`Decision`}),(0,S.jsxs)(`div`,{className:`decision-answer`,children:[(0,S.jsx)(`span`,{className:`chip status ok`,children:f(r.decision)}),r.note&&(0,S.jsxs)(`span`,{className:`decision-note`,children:[`“`,r.note,`”`]}),r.decidedAt&&(0,S.jsx)(`span`,{className:`decision-when num`,children:Ce(r.decidedAt)})]})]})});let p=!!i&&!c&&(n.note!==`required`||!!o.trim());async function m(){if(!p)return;l(!0),d(null);let t=await fetch(`/api/runs/${encodeURIComponent(e)}/decision`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({decision:i,note:o.trim()})}).catch(()=>null);t?.ok||(d((await t?.json().catch(()=>null))?.error??`could not save the decision`),l(!1))}return(0,S.jsx)(`section`,{className:`panel decision-panel`,"aria-label":`decision needed`,children:(0,S.jsxs)(`div`,{className:`decision-body`,children:[(0,S.jsxs)(`div`,{className:`decision-head`,children:[(0,S.jsx)(`span`,{className:`lamp running`}),(0,S.jsx)(`div`,{className:`decision-title`,children:n.title??`This run needs your decision`})]}),n.prompt&&(0,S.jsx)(`p`,{className:`decision-prompt`,children:n.prompt}),(0,S.jsx)(`div`,{className:`tabs decision-options`,role:`radiogroup`,"aria-label":`options`,children:n.options.map(e=>(0,S.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":i===e.value,className:i===e.value?`active`:``,onClick:()=>a(e.value),children:e.label??e.value},e.value))}),n.note!==!1&&(0,S.jsxs)(`label`,{className:`m3-field`,children:[(0,S.jsx)(`input`,{type:`text`,value:o,placeholder:` `,"aria-label":`note`,onChange:e=>s(e.target.value),onKeyDown:e=>e.key===`Enter`&&m()}),(0,S.jsx)(`span`,{className:`m3-field-label`,children:n.note===`required`?`Note (required)`:`Note`})]}),u&&(0,S.jsx)(`div`,{className:`m3-error`,children:u}),(0,S.jsx)(`div`,{className:`m3-actions`,children:(0,S.jsx)(`button`,{className:`m3-filled-btn`,onClick:m,disabled:!p,children:c?`Saving…`:`Submit decision`})})]})})}function ke(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ae=ke();function je(e){Ae=e}var Me={exec:()=>null};function Ne(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 V(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(Fe.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Pe=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),Fe={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:Ne(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Ne(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Ne(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Ne(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Ne(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:Ne(e=>RegExp(`^ {0,${e}}>`))},Ie=/^(?:[ \t]*(?:\n|$))+/,Le=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Re=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ze=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Be=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ve=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,He=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ue=V(He).replace(/bull/g,Ve).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(),We=V(He).replace(/bull/g,Ve).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(),Ge=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Ke=/^[^\n]+/,qe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Je=V(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,qe).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ye=V(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ve).getRegex(),Xe=`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`,Ze=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Qe=V(`^ {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`,Ze).replace(`tag`,Xe).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$e=e=>V(Ge).replace(`hr`,ze).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`,Xe).getRegex(),et=$e(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),tt=$e(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),nt={blockquote:V(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,tt).getRegex(),code:Le,def:Je,fences:Re,heading:Be,hr:ze,html:Qe,lheading:Ue,list:Ye,newline:Ie,paragraph:et,table:Me,text:Ke},rt=V(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,ze).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`,Xe).getRegex(),it={...nt,lheading:We,table:rt,paragraph:V(Ge).replace(`hr`,ze).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,rt).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`,Xe).getRegex()},at={...nt,html:V(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Ze).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:Me,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:V(Ge).replace(`hr`,ze).replace(`heading`,` *#{1,6} *[^
11
- ]`).replace(`lheading`,Ue).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},ot=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,st=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ct=/^( {2,}|\\)\n(?!\s*$)/,lt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ut=/[\p{P}\p{S}]/u,dt=/[\s\p{P}\p{S}]/u,ft=/[^\s\p{P}\p{S}]/u,pt=V(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,dt).getRegex(),mt=/[\p{Pi}\p{Ps}"']/u,ht=/(?!~)[\p{P}\p{S}]/u,gt=/(?!~)[\s\p{P}\p{S}]/u,_t=/(?:[^\s\p{P}\p{S}]|~)/u,vt=V(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Pe?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),yt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,bt=V(yt,`u`).replace(/punct/g,ut).getRegex(),xt=V(yt,`u`).replace(/punct/g,ht).getRegex(),St=V(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,mt).replace(/punct/g,ut).getRegex(),Ct=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,wt=V(Ct,`gu`).replace(/notPunctSpace/g,ft).replace(/punctSpace/g,dt).replace(/punct/g,ut).getRegex(),Tt=V(Ct,`gu`).replace(/notPunctSpace/g,_t).replace(/punctSpace/g,gt).replace(/punct/g,ht).getRegex(),Et=V(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,ft).replace(/punctSpace/g,dt).replace(/punct/g,ut).getRegex(),Dt=V(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,ft).replace(/punctSpace/g,dt).replace(/punct/g,ut).getRegex(),Ot=V(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,ft).replace(/punctSpace/g,dt).replace(/punct/g,ut).getRegex(),kt=V(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,ut).getRegex(),At=V(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,ft).replace(/punctSpace/g,dt).replace(/punct/g,ut).getRegex(),jt=V(/\\(punct)/,`gu`).replace(/punct/g,ut).getRegex(),Mt=V(/^<(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(),Nt=V(Ze).replace(`(?:-->|$)`,`-->`).getRegex(),Pt=V(`^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`,Nt).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ft=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,It=V(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,Ft).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Lt=V(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Ft).replace(`ref`,qe).getRegex(),Rt=V(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,qe).getRegex(),zt=V(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Lt).replace(`nolink`,Rt).getRegex(),Bt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Vt={_backpedal:Me,anyPunctuation:jt,autolink:Mt,blockSkip:vt,br:ct,code:st,del:Me,delLDelim:Me,delRDelim:Me,emStrongLDelim:bt,emStrongRDelimAst:wt,emStrongRDelimUnd:Dt,escape:ot,link:It,nolink:Rt,punctuation:pt,reflink:Lt,reflinkSearch:zt,tag:Pt,text:lt,url:Me},Ht={...Vt,emStrongLDelim:St,emStrongRDelimAst:Et,emStrongRDelimUnd:Ot,link:V(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Ft).getRegex(),reflink:V(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Ft).getRegex()},Ut={...Vt,emStrongRDelimAst:Tt,emStrongLDelim:xt,delLDelim:kt,delRDelim:At,url:V(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Bt).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:V(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Bt).getRegex()},Wt={...Ut,br:V(ct).replace(`{2,}`,`*`).getRegex(),text:V(Ut.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Gt={normal:nt,gfm:it,pedantic:at},Kt={normal:Vt,gfm:Ut,breaks:Wt,pedantic:Ht},qt={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Jt=e=>qt[e];function Yt(e,t){if(t){if(Fe.escapeTest.test(e))return e.replace(Fe.escapeReplace,Jt)}else if(Fe.escapeTestNoEncode.test(e))return e.replace(Fe.escapeReplaceNoEncode,Jt);return e}function Xt(e){try{e=encodeURI(e).replace(Fe.percentDecode,`%`)}catch{return null}return e}function Zt(e,t){let n=e.replace(Fe.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Fe.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(Fe.slashPipe,`|`);return n}function Qt(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 $t(e){let t=e.split(`
12
- `),n=t.length-1;for(;n>=0&&Fe.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
13
- `)}function en(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 tn(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 nn(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function rn(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
14
- `).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(`
15
- `)}var an=class{options;rules;lexer;constructor(e){this.options=e||Ae}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]:$t(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=rn(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=Qt(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:Qt(t[0],`
16
- `),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:Qt(t[0],`
17
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Qt(t[0],`
18
- `).split(`
19
- `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;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(`
20
- `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
21
- $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
22
- ${s}`:s,r=r?`${r}
23
- ${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(`
24
- `),o=t.raw+`
25
- `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s,n=`${n}
26
- ${a}`,r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
27
- `+e.join(`
28
- `),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(`
29
- `);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=tn(t[2].split(`
30
- `,1)[0],t[1].length),l=e.split(`
31
- `,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+`
32
- `,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(`
33
- `,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+=`
34
- `+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+=`
35
- `+l}u=!l.trim(),r+=p+`
36
- `,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)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!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))}for(let e of i.items){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)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=$t(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:Qt(t[0],`
37
- `),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=Zt(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
38
- `):[],a={type:`table`,raw:Qt(t[0],`
39
- `),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(Zt(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:Qt(t[0],`
40
- `),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)===`
41
- `?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=Qt(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=en(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)),nn(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 nn(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}}}},on=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ae,this.options.tokenizer=this.options.tokenizer||new an,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:Fe,block:Gt.normal,inline:Kt.normal};this.options.pedantic?(t.block=Gt.pedantic,t.inline=Kt.pedantic):this.options.gfm&&(t.block=Gt.gfm,t.inline=this.options.breaks?Kt.breaks:Kt.gfm),this.tokenizer.rules=t}static get rules(){return{block:Gt,inline:Kt}}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(Fe.carriageReturn,`
42
- `),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(Fe.tabCharGlobal,` `).replace(Fe.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+=`
43
- `: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(`
44
- `)?``:`
45
- `)+i.raw,n.text+=`
46
- `+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(`
47
- `)?``:`
48
- `)+i.raw,n.text+=`
49
- `+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(`
50
- `)?``:`
51
- `)+i.raw,r.text+=`
52
- `+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(`
53
- `)?``:`
54
- `)+i.raw,n.text+=`
55
- `+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}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,e.slice(n+1,-1))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,n.slice(r+1,-1)))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),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)}},sn=class{options;parser;constructor(e){this.options=e||Ae}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Fe.notSpaceStart)?.[0],i=e.replace(Fe.endingNewline,``)+`
56
- `;return r?`<pre><code class="language-`+Yt(r)+`">`+(n?i:Yt(i,!0))+`</code></pre>
57
- `:`<pre><code>`+(n?i:Yt(i,!0))+`</code></pre>
58
- `}blockquote({tokens:e}){return`<blockquote>
59
- ${this.parser.parse(e)}</blockquote>
60
- `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
61
- `}hr(e){return`<hr>
62
- `}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+`>
63
- `+r+`</`+i+`>
64
- `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
65
- `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
66
- `}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>
67
- <thead>
68
- `+t+`</thead>
69
- `+r+`</table>
70
- `}tablerow({text:e}){return`<tr>
71
- ${e}</tr>
72
- `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
73
- `}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>${Yt(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=Xt(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+Yt(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=Xt(e);if(i===null)return Yt(n);e=i;let a=`<img src="${e}" alt="${Yt(n)}"`;return t&&(a+=` title="${Yt(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Yt(e.text)}},cn=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}},ln=class e{options;renderer;textRenderer;constructor(e){this.options=e||Ae,this.options.renderer=this.options.renderer||new sn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new cn}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}},un=class{options;block;constructor(e){this.options=e||Ae}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?on.lex:on.lexInline}provideParser(e=this.block){return e?ln.parse:ln.parseInline}},dn=new class{defaults=ke();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ln;Renderer=sn;TextRenderer=cn;Lexer=on;Tokenizer=an;Hooks=un;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 sn(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 an(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 un;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]=un.passThroughHooks.has(n)?e=>{if(this.defaults.async&&un.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 on.lex(e,t??this.defaults)}parser(e,t){return ln.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?on.lex:on.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?ln.parse:ln.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?on.lex:on.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?ln.parse:ln.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+=`
74
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Yt(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function H(e,t){return dn.parse(e,t)}H.options=H.setOptions=function(e){return dn.setOptions(e),H.defaults=dn.defaults,je(H.defaults),H},H.getDefaults=ke,H.defaults=Ae;function fn(...e){return dn.use(...e),H.defaults=dn.defaults,je(H.defaults),H}H.use=fn,H.walkTokens=function(e,t){return dn.walkTokens(e,t)},H.parseInline=dn.parseInline,H.Parser=ln,H.parser=ln.parse,H.Renderer=sn,H.TextRenderer=cn,H.Lexer=on,H.lexer=on.lex,H.Tokenizer=an,H.Hooks=un,H.parse=H,H.options,H.setOptions,H.walkTokens,H.parseInline,ln.parse,on.lex;function pn(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 mn(e){if(Array.isArray(e))return e}function hn(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 gn(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
75
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _n(e,t){return mn(e)||hn(e,t)||vn(e,t)||gn()}function vn(e,t){if(e){if(typeof e==`string`)return pn(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)?pn(e,t):void 0}}var yn=Object.entries,bn=Object.setPrototypeOf,xn=Object.isFrozen,Sn=Object.getPrototypeOf,Cn=Object.getOwnPropertyDescriptor,wn=Object.freeze,Tn=Object.seal,En=Object.create,Dn=typeof Reflect<`u`&&Reflect,On=Dn.apply,kn=Dn.construct;wn||=function(e){return e},Tn||=function(e){return e},On||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},kn||=function(e){return new e(...[...arguments].slice(1))};var An=Xn(Array.prototype.forEach),jn=Xn(Array.prototype.lastIndexOf),Mn=Xn(Array.prototype.pop),Nn=Xn(Array.prototype.push),Pn=Xn(Array.prototype.splice),Fn=Array.isArray,In=Xn(String.prototype.toLowerCase),Ln=Xn(String.prototype.toString),Rn=Xn(String.prototype.match),zn=Xn(String.prototype.replace),Bn=Xn(String.prototype.indexOf),Vn=Xn(String.prototype.trim),Hn=Xn(Number.prototype.toString),Un=Xn(Boolean.prototype.toString),Wn=typeof BigInt>`u`?null:Xn(BigInt.prototype.toString),Gn=typeof Symbol>`u`?null:Xn(Symbol.prototype.toString),Kn=Xn(Object.prototype.hasOwnProperty),qn=Xn(Object.prototype.toString),Jn=Xn(RegExp.prototype.test),Yn=Zn(TypeError);function Xn(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return On(e,t,n)}}function Zn(e){return function(){return kn(e,[...arguments])}}function U(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:In;if(bn&&bn(e,null),!Fn(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(xn(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Qn(e){for(let t=0;t<e.length;t++)Kn(e,t)||(e[t]=null);return e}function $n(e){let t=En(null);for(let r of yn(e)){var n=_n(r,2);let i=n[0],a=n[1];Kn(e,i)&&(t[i]=Fn(a)?Qn(a):a&&typeof a==`object`&&a.constructor===Object?$n(a):a)}return t}function er(e){switch(typeof e){case`string`:return e;case`number`:return Hn(e);case`boolean`:return Un(e);case`bigint`:return Wn?Wn(e):`0`;case`symbol`:return Gn?Gn(e):`Symbol()`;case`undefined`:return qn(e);case`function`:case`object`:{if(e===null)return qn(e);let t=e,n=tr(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:qn(e)}return qn(e)}default:return qn(e)}}function tr(e,t){for(;e!==null;){let n=Cn(e,t);if(n){if(n.get)return Xn(n.get);if(typeof n.value==`function`)return Xn(n.value)}e=Sn(e)}function n(){return null}return n}function nr(e){try{return Jn(e,``),!0}catch{return!1}}var rr=wn(`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(`.`)),ir=wn(`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(`.`)),ar=wn([`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`]),or=wn([`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`]),sr=wn(`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(`.`)),cr=wn([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),lr=wn([`#text`]),ur=wn(`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(`.`)),dr=wn(`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.pointer-events.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.vector-effect.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(`.`)),fr=wn(`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(`.`)),pr=wn([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),mr=Tn(/{{[\w\W]*|^[\w\W]*}}/g),hr=Tn(/<%[\w\W]*|^[\w\W]*%>/g),gr=Tn(/\${[\w\W]*/g),_r=Tn(/^data-[\-\w.\u00B7-\uFFFF]+$/),vr=Tn(/^aria-[\-\w]+$/),yr=Tn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),br=Tn(/^(?:\w+script|data):/i),xr=Tn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Sr=Tn(/^html$/i),Cr=Tn(/^[a-z][.\w]*(-[.\w]+)+$/i),wr=Tn(/<[/\w!]/g),Tr=Tn(/<[/\w]/g),Er=Tn(/<\/no(script|embed|frames)/i),Dr=Tn(/\/>/i),Or={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},kr=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],Ar=wn(U({},kr)),jr=function(){let e={};return An(kr,t=>{e[t]=Tn(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),wn(e)}(),Mr=function(){return typeof window>`u`?null:window},Nr=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}},Pr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Fr=function(e,t,n,r){return Kn(e,t)&&Fn(e[t])?U(r.base?$n(r.base):{},e[t],r.transform):n},Ir=function(e,t,n){let r=Kn(e,t)?e[t]:void 0;return r&&typeof r==`object`?$n(r):n()};function Lr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Mr(),t=e=>Lr(e);if(t.version=`3.4.14`,t.removed=[],!e||!e.document||e.document.nodeType!==Or.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=tr(d,`cloneNode`),p=tr(d,`remove`),m=tr(d,`nextSibling`),h=tr(d,`childNodes`),g=tr(d,`parentNode`),_=tr(d,`shadowRoot`),v=tr(d,`attributes`),y=o&&o.prototype?tr(o.prototype,`nodeType`):null,b=o&&o.prototype?tr(o.prototype,`nodeName`):null,x=o&&o.prototype?tr(o.prototype,`ownerDocument`):null,S=function(e){return y?y(e):e.nodeType},C=function(e){return b?b(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let w,T=``,E,D=!1,O=0,k=function(){if(O>0)throw Yn(`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.`)},ee=function(e){k(),O++;try{return w.createHTML(e)}finally{O--}},A=function(e){k(),O++;try{return w.createScriptURL(e)}finally{O--}},j=function(){return D||=(E=Nr(u,i),!0),E},te=n,M=te.implementation,ne=te.createNodeIterator,N=te.createDocumentFragment,P=te.getElementsByTagName,re=r.importNode,F=Pr();t.isSupported=typeof yn==`function`&&typeof g==`function`&&M&&M.createHTMLDocument!==void 0;let ie=mr,ae=hr,I=gr,L=_r,oe=vr,se=br,ce=xr,le=Cr,ue=yr,R=null,de=U({},[...rr,...ir,...ar,...sr,...lr]),z=null,fe=U({},[...ur,...dr,...fr,...pr]),pe=Object.seal(En(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}})),me=null,he=null,ge=Object.seal(En(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),_e=!0,ve=!0,B=!1,ye=!0,be=!1,xe=!0,Se=!1,Ce=!1,we=null,Te=null,Ee=!1,De=!1,Oe=!1,ke=!1,Ae=!0,je=!1,Me=`user-content-`,Ne=!0,V=!1,Pe={},Fe=null,Ie=U({},`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(`.`)),Le=null,Re=U({},[`audio`,`video`,`img`,`source`,`image`,`track`]),ze=null,Be=U({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ve=`http://www.w3.org/1998/Math/MathML`,He=`http://www.w3.org/2000/svg`,Ue=`http://www.w3.org/1999/xhtml`,We=Ue,Ge=!1,Ke=null,qe=U({},[Ve,He,Ue],Ln),Je=wn([`mi`,`mo`,`mn`,`ms`,`mtext`]),Ye=U({},Je),Xe=wn([`annotation-xml`]),Ze=U({},Xe),Qe=U({},[`title`,`style`,`font`,`a`,`script`]),$e=null,et=[`application/xhtml+xml`,`text/html`],tt=null,nt=null,rt=n.createElement(`form`),it=function(e){return e instanceof RegExp||e instanceof Function},at=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(nt&&nt===e)return;(!e||typeof e!=`object`)&&(e={}),e=$n(e),$e=et.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,tt=$e===`application/xhtml+xml`?Ln:In,R=Fr(e,`ALLOWED_TAGS`,de,{transform:tt}),z=Fr(e,`ALLOWED_ATTR`,fe,{transform:tt}),Ke=Fr(e,`ALLOWED_NAMESPACES`,qe,{transform:Ln}),ze=Fr(e,`ADD_URI_SAFE_ATTR`,Be,{transform:tt,base:Be}),Le=Fr(e,`ADD_DATA_URI_TAGS`,Re,{transform:tt,base:Re}),Fe=Fr(e,`FORBID_CONTENTS`,Ie,{transform:tt}),me=Fr(e,`FORBID_TAGS`,$n({}),{transform:tt}),he=Fr(e,`FORBID_ATTR`,$n({}),{transform:tt}),Pe=Kn(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?$n(e.USE_PROFILES):e.USE_PROFILES:!1,_e=e.ALLOW_ARIA_ATTR!==!1,ve=e.ALLOW_DATA_ATTR!==!1,B=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,be=e.SAFE_FOR_TEMPLATES||!1,xe=e.SAFE_FOR_XML!==!1,Se=e.WHOLE_DOCUMENT||!1,De=e.RETURN_DOM||!1,Oe=e.RETURN_DOM_FRAGMENT||!1,ke=e.RETURN_TRUSTED_TYPE||!1,Ee=e.FORCE_BODY||!1,Ae=e.SANITIZE_DOM!==!1,je=e.SANITIZE_NAMED_PROPS||!1,Ne=e.KEEP_CONTENT!==!1,V=e.IN_PLACE||!1,ue=nr(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:yr,We=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ue,Ye=Ir(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>U({},Je)),Ze=Ir(e,`HTML_INTEGRATION_POINTS`,()=>U({},Xe));let t=Ir(e,`CUSTOM_ELEMENT_HANDLING`,()=>En(null));if(pe=En(null),Kn(t,`tagNameCheck`)&&it(t.tagNameCheck)&&(pe.tagNameCheck=t.tagNameCheck),Kn(t,`attributeNameCheck`)&&it(t.attributeNameCheck)&&(pe.attributeNameCheck=t.attributeNameCheck),Kn(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(pe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Tn(pe),be&&(ve=!1),Oe&&(De=!0),Pe&&(R=U({},lr),z=En(null),Pe.html===!0&&(U(R,rr),U(z,ur)),Pe.svg===!0&&(U(R,ir),U(z,dr),U(z,pr)),Pe.svgFilters===!0&&(U(R,ar),U(z,dr),U(z,pr)),Pe.mathMl===!0&&(U(R,sr),U(z,fr),U(z,pr))),ge.tagCheck=null,ge.attributeCheck=null,Kn(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ge.tagCheck=e.ADD_TAGS:Fn(e.ADD_TAGS)&&(R===de&&(R=$n(R)),U(R,e.ADD_TAGS,tt))),Kn(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ge.attributeCheck=e.ADD_ATTR:Fn(e.ADD_ATTR)&&(z===fe&&(z=$n(z)),U(z,e.ADD_ATTR,tt))),Kn(e,`ADD_FORBID_CONTENTS`)&&Fn(e.ADD_FORBID_CONTENTS)&&(Fe===Ie&&(Fe=$n(Fe)),U(Fe,e.ADD_FORBID_CONTENTS,tt)),Ne&&(R[`#text`]=!0),Se&&U(R,[`html`,`head`,`body`]),R.table&&(U(R,[`tbody`]),delete me.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Yn(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Yn(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=w;w=e.TRUSTED_TYPES_POLICY;try{T=ee(``)}catch(e){throw w=t,e}}else e.TRUSTED_TYPES_POLICY===null?(w=void 0,T=``):(w===void 0&&(w=j()),w&&typeof T==`string`&&(T=ee(``)));wn&&wn(e),nt=e},ot=U({},[...ir,...ar,...or]),st=U({},[...sr,...cr]),ct=function(e,t,n){return t.namespaceURI===Ue?e===`svg`:t.namespaceURI===Ve?e===`svg`&&(n===`annotation-xml`||Ye[n]):!!ot[e]},lt=function(e,t,n){return t.namespaceURI===Ue?e===`math`:t.namespaceURI===He?e===`math`&&Ze[n]:!!st[e]},ut=function(e,t,n){return t.namespaceURI===He&&!Ze[n]||t.namespaceURI===Ve&&!Ye[n]?!1:!st[e]&&(Qe[e]||!ot[e])},dt=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:We,tagName:`template`});let n=In(e.tagName),r=In(t.tagName);return Ke[e.namespaceURI]?e.namespaceURI===He?ct(n,t,r):e.namespaceURI===Ve?lt(n,t,r):e.namespaceURI===Ue?ut(n,t,r):!!($e===`application/xhtml+xml`&&Ke[e.namespaceURI]):!1},ft=function(e){Nn(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw Yn(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},pt=function(e,t,n){try{e.removeAttributeNode(t)}catch{try{e.removeAttribute(n)}catch{}}},mt=function(e){_t(e);let t=h(e);if(t){let e=[];An(t,t=>{Nn(e,t)}),An(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;typeof i==`string`&&pt(e,r,i)}},ht=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}Nn(t.removed,{attribute:r||null,from:n});try{r?n.removeAttributeNode(r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(De||Oe)try{ft(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},gt=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;typeof i!=`string`||z[tt(i)]||pt(e,r,i)}},_t=function(e){let t=[e];for(;t.length>0;){let e=t.pop();S(e)===Or.element&&gt(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},vt=function(e,t){return xe?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},yt=function(e){if(!xe)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=S(e);if(n===Or.processingInstruction||n===Or.comment&&Jn(Tr,e.data)){try{p(e)}catch{}continue}if(n===Or.element){let t=e,n=tt(C(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&vt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},bt=function(e){let t=null,r=null;if(Ee)e=`<remove></remove>`+e;else{let t=Rn(e,/^[\r\n\t ]+/);r=t&&t[0]}$e===`application/xhtml+xml`&&We===Ue&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=w?ee(e):e;if(We===Ue)try{t=new l().parseFromString(i,$e)}catch{}if(!t||!t.documentElement){t=M.createDocument(We,`template`,null);try{t.documentElement.innerHTML=Ge?T:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),We===Ue?P.call(t,Se?`html`:`body`)[0]:Se?t.documentElement:a},xt=function(e){let t=x?x(e):e.ownerDocument;return ne.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},St=function(e){return e=zn(e,ie,` `),e=zn(e,ae,` `),e=zn(e,I,` `),e},Ct=function(e){e.normalize();let t=x?x(e):e.ownerDocument,n=ne.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=St(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&An(i,e=>{Tt(e.content)&&Ct(e.content)})},wt=function(e){let t=b?b(e):null;return typeof t!=`string`||tt(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)},Tt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===Or.documentFragment}catch{return!1}},Et=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function Dt(e,n,r){e.length!==0&&An(e,e=>{e.call(t,n,r,nt)})}let Ot=function(e,t){return!!(xe&&e.hasChildNodes()&&!Et(e.firstElementChild)&&Jn(wr,e.textContent)&&Jn(wr,e.innerHTML)||xe&&e.namespaceURI===Ue&&Ar[t]&&(Et(e.firstElementChild)||typeof e.textContent==`string`&&Jn(jr[t],e.textContent))||e.nodeType===Or.processingInstruction||xe&&e.nodeType===Or.comment&&Jn(Tr,e.data))},kt=function(e,t){return e instanceof RegExp?Jn(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},At=function(e,t,n){if(!me[t]&&It(t)&&kt(pe.tagNameCheck,t))return!1;if(Ne&&!Fe[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 ft(e),!0},jt=function(e,t,n,r){return e.length===0?t:t===n||t===r?$n(t):t},Mt=function(e,t){return e===t||g(e)!==null?!1:(V&&_t(e),!0)},Nt=function(e,n){if(Dt(F.beforeSanitizeElements,e,null),Mt(e,n))return!0;if(wt(e))return ft(e),!0;let r=tt(C(e));if(R=jt(F.uponSanitizeElement,R,de,we),Dt(F.uponSanitizeElement,e,{tagName:r,allowedTags:R}),Mt(e,n))return!0;if(Ot(e,r))return ft(e),!0;if(me[r]||!(ge.tagCheck instanceof Function&&ge.tagCheck(r))&&!R[r]){let t=At(e,r,n);return t===!1&&Dt(F.afterSanitizeElements,e,null),t}if(S(e)===Or.element&&!dt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Jn(Er,e.innerHTML))return ft(e),!0;if(be&&e.nodeType===Or.text){let n=St(e.textContent);e.textContent!==n&&(Nn(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Dt(F.afterSanitizeElements,e,null),!1},Pt=function(e,t,r){if(he[t]||vt(t,e)||Ae&&(t===`id`||t===`name`)&&(r in n||r in rt))return!1;let i=z[t]||ge.attributeCheck instanceof Function&&ge.attributeCheck(t,e);return ve&&Jn(L,t)||_e&&Jn(oe,t)?!0:i?ze[t]||Jn(ue,zn(r,ce,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Bn(r,`data:`)===0&&Le[e]||B&&!Jn(se,zn(r,ce,``))?!0:!r:It(e)&&kt(pe.tagNameCheck,e)&&kt(pe.attributeNameCheck,t,e)||t===`is`&&pe.allowCustomizedBuiltInElements&&kt(pe.tagNameCheck,r)},Ft=U({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),It=function(e){return!Ft[In(e)]&&Jn(le,e)},Lt=function(e,t,n,r){if(w&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ee(r);case`TrustedScriptURL`:return A(r)}return r},Rt=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),wt(e)?ft(e):Mn(t.removed)}catch{ht(n,e)}},zt=function(e){Dt(F.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||wt(e))return;z=jt(F.uponSanitizeAttribute,z,fe,Te);let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0},r=t.length,i=tt(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=tt(o),u=c,d=o===`value`?u:Vn(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,Dt(F.uponSanitizeAttribute,e,n),d=n.attrValue,je&&(l===`id`||l===`name`)&&Bn(d,Me)!==0&&(ht(o,e,a),d=Me+d),xe&&Jn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){ht(o,e,a);continue}if(l===`attributename`&&Rn(d,`href`)){ht(o,e,a);continue}if(!n.forceKeepAttr){if(!n.keepAttr){ht(o,e,a);continue}if(!ye&&Jn(Dr,d)){ht(o,e,a);continue}if(be&&(d=St(d)),!Pt(i,l,d)){ht(o,e,a);continue}d=Lt(i,l,s,d),d!==u&&Rt(e,o,s,d)}}Dt(F.afterSanitizeAttributes,e,null)},Bt=function(e){let t=null,n=xt(e);for(Dt(F.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Dt(F.uponSanitizeShadowNode,t,null),Nt(t,e),zt(t),Tt(t.content)&&Bt(t.content),S(t)===Or.element){let e=_(t);Tt(e)&&(Vt(e),Bt(e))}Dt(F.afterSanitizeShadowDOM,e,null)},Vt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Bt(e.shadow);continue}let n=e.node,r=S(n)===Or.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`&&tt(e)===`template`){let e=n.content;Tt(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);Tt(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(Ge=!e,Ge&&(e=`<!-->`),typeof e!=`string`&&!Et(e)&&(e=er(e),typeof e!=`string`))throw Yn(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ce?(R=we,z=Te):at(n),(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&(R=$n(R)),F.uponSanitizeAttribute.length>0&&(z=$n(z)),t.removed=[];let c=V&&typeof e!=`string`&&Et(e);if(c){yt(e);let t=C(e);if(typeof t==`string`){let n=tt(t);if(!R[n]||me[n])throw mt(e),Yn(`root node is forbidden and cannot be sanitized in-place`)}if(wt(e))throw mt(e),Yn(`root node is clobbered and cannot be sanitized in-place`);try{Vt(e)}catch(t){throw mt(e),t}}else if(Et(e))i=bt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Or.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Vt(a);else{if(!De&&!be&&!Se&&e.indexOf(`<`)===-1)return w&&ke?ee(e):e;if(i=bt(e),!i)return De?null:ke?T:``}i&&Ee&&ft(i.firstChild);let l=c?e:i;try{let e=xt(l);for(;o=e.nextNode();)Nt(o,l),zt(o),Tt(o.content)&&Bt(o.content)}catch(n){throw c&&(mt(e),An(t.removed,e=>{e.element&&_t(e.element)})),n}if(c)return An(t.removed,e=>{e.element&&_t(e.element)}),be&&Ct(e),e;if(De){if(be&&Ct(i),Oe)for(s=N.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(z.shadowroot||z.shadowrootmode)&&(s=re.call(r,s,!0)),s}let u=Se?i.outerHTML:i.innerHTML;return Se&&R[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Jn(Sr,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
76
- `+u),be&&(u=St(u)),w&&ke?ee(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};at(e),Ce=!0,we=R,Te=z},t.clearConfig=function(){nt=null,Ce=!1,we=null,Te=null,w=E,T=``},t.isValidAttribute=function(e,t,n){nt||at({});let r=tt(e),i=tt(t);return Pt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Kn(F,e)&&Nn(F[e],t)},t.removeHook=function(e,t){if(Kn(F,e)){if(t!==void 0){let n=jn(F[e],t);return n===-1?void 0:Pn(F[e],n,1)[0]}return Mn(F[e])}},t.removeHooks=function(e){Kn(F,e)&&(F[e]=[])},t.removeAllHooks=function(){F=Pr()},t}var Rr=Lr();async function zr(e,t){let n=await fetch(`/api/chats/${e}/vibeable`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({slug:t})}),r=await n.json();if(!n.ok)throw Error(r.error||`HTTP ${n.status}`);return r}function Br({chatId:e,onClose:t,onOpened:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(``);(0,v.useEffect)(()=>{let e=!0;return fetch(`/api/vibeables`,{cache:`no-store`}).then(e=>e.json()).then(t=>e&&i(t)).catch(t=>e&&u(t.message)),()=>{e=!1}},[]),(0,v.useEffect)(()=>{let e=e=>e.key===`Escape`&&t();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]);let d=async t=>{c(t),u(``);try{n(await zr(e,t))}catch(e){u(e.message),c(``)}},f=async t=>{t.preventDefault();let r=a.trim();if(r){c(`new`),u(``);try{let t=await fetch(`/api/vibeables`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:r})}),i=await t.json();if(!t.ok)throw Error(i.error||`HTTP ${t.status}`);n(await zr(e,i.slug))}catch(e){u(e.message),c(``)}}},p=r?.vibeables??[];return(0,S.jsx)(`div`,{className:`vibeable-overlay`,onMouseDown:e=>e.target===e.currentTarget&&t(),children:(0,S.jsxs)(`div`,{className:`vibeable-picker`,role:`dialog`,"aria-label":`Open a vibeable`,children:[(0,S.jsxs)(`div`,{className:`vibeable-picker-head`,children:[(0,S.jsx)(C,{name:`web`}),(0,S.jsx)(`h2`,{children:`Open a vibeable`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`button`,{className:`icon-btn`,onClick:t,title:`Close`,"aria-label":`Close`,children:(0,S.jsx)(C,{name:`close`})})]}),(0,S.jsx)(`p`,{className:`vibeable-picker-hint`,children:`A small app built live in this chat: the agent works inside its folder, and every saved file shows up in the preview pane.`}),r&&!r.enabled&&(0,S.jsxs)(`div`,{className:`vibeable-picker-off`,children:[`Vibeables are off. Turn them on in `,(0,S.jsx)(`a`,{href:`#/settings`,children:`settings`}),` first.`]}),r?.enabled&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`form`,{className:`vibeable-new`,onSubmit:e=>void f(e),children:[(0,S.jsx)(`input`,{value:a,placeholder:`new vibeable, e.g. team-dashboard`,"aria-label":`new vibeable name`,onChange:e=>o(e.target.value),autoFocus:!0,disabled:!!s}),(0,S.jsxs)(`button`,{className:`ws-btn primary`,type:`submit`,disabled:!!s||!a.trim(),children:[(0,S.jsx)(C,{name:s===`new`?`progress_activity`:`add`,className:`ms-sm`}),s===`new`?`creating…`:`create`]})]}),(0,S.jsxs)(`div`,{className:`vibeable-picker-list`,children:[p.length===0&&(0,S.jsx)(`div`,{className:`vibeable-picker-empty`,children:`No vibeables yet — create one above.`}),p.map(e=>(0,S.jsxs)(`button`,{className:`vibeable-repo`,disabled:!!s,onClick:()=>void d(e.slug),children:[(0,S.jsx)(`span`,{className:`vibeable-repo-icon`,children:(0,S.jsx)(C,{name:s===e.slug?`progress_activity`:e.dev?`terminal`:`web`})}),(0,S.jsxs)(`span`,{className:`vibeable-repo-main`,children:[(0,S.jsx)(`span`,{className:`vibeable-repo-name`,children:e.slug}),(0,S.jsxs)(`span`,{className:`vibeable-repo-sub`,children:[e.configError?e.configError:e.dev?`dev: ${e.dev}`:e.hasIndex?`static`:`no index.html yet`,e.updatedAt?` · ${we(e.updatedAt)}`:``]})]}),(0,S.jsx)(C,{name:`chevron_right`,className:`vibeable-repo-go`})]},e.slug))]})]}),l&&(0,S.jsx)(`div`,{className:`settings-err vibeable-picker-err`,children:l})]})})}function Vr({chatId:e,slug:t,agentBusy:n,onClosed:r}){let[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(0),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(!1),g=(0,v.useRef)(null),_=(0,v.useCallback)(async()=>{try{let e=await fetch(`/api/vibeables/${encodeURIComponent(t)}`,{cache:`no-store`}),n=await e.json();if(!e.ok)throw Error(n.error||`HTTP ${e.status}`);a(n),d(``)}catch(e){d(e.message)}},[t]);(0,v.useEffect)(()=>{_();let e=new EventSource(`/api/vibeables/${encodeURIComponent(t)}/events`),n;return e.onmessage=e=>{let t=JSON.parse(e.data);if(t.type===`change`)s(e=>e+1),l(t.files.slice(0,3).join(`, `)+(t.files.length>3?` +${t.files.length-3}`:``)),clearTimeout(n),n=setTimeout(()=>l(``),2500);else if(t.type===`dev`&&t.dev){let e=t.dev;a(t=>t&&{...t,dev:e,mode:e.running?`dev`:`static`})}else t.type===`error`&&d(t.message)},()=>{e.close(),clearTimeout(n)}},[t,_]);let y=!!i?.dev?.running;(0,v.useEffect)(()=>{if(!y||!m)return;let e=setInterval(()=>void _(),2e3);return()=>clearInterval(e)},[y,m,_]);let b=i?`${i.url}?v=${o}`:``,x=()=>s(e=>e+1),w=async e=>{p(e),d(``);try{let n=await fetch(`/api/vibeables/${encodeURIComponent(t)}/dev/${e}`,{method:`POST`}),r=await n.json();if(!n.ok)throw Error(r.error||`HTTP ${n.status}`);a(r),e===`start`&&h(!0)}catch(e){d(e.message)}finally{p(``)}},T=async()=>{if(e&&r){p(`close`),d(``);try{r(await zr(e,null))}catch(e){d(e.message),p(``)}}},E=i?.dev,D=E?.running?E.ready?{cls:`ok`,text:`dev :${E.port}`}:{cls:`running`,text:`starting…`}:E&&E.exitCode!==void 0?{cls:`failed`,text:`dev exited${E.exitCode==null?``:` (${E.exitCode})`}`}:{cls:`ok`,text:`static`};return(0,S.jsxs)(`aside`,{className:`vibeable-pane`,"data-vibe":t,children:[(0,S.jsxs)(`div`,{className:`vibeable-bar`,children:[(0,S.jsx)(C,{name:`web`,className:`vibeable-bar-icon`}),(0,S.jsx)(`span`,{className:`vibeable-name`,title:i?.path,children:t}),(0,S.jsxs)(`span`,{className:`vibeable-mode ${D.cls}`,title:E?.command?`dev: ${E.command}`:i?.dir,children:[(0,S.jsx)(`span`,{className:`lamp ${D.cls}`}),D.text]}),c&&(0,S.jsxs)(`span`,{className:`vibeable-flash`,title:c,children:[(0,S.jsx)(C,{name:`bolt`,className:`ms-sm`}),` reloaded`]}),(0,S.jsx)(`span`,{className:`spacer`}),i?.config.dev&&(E?.running?(0,S.jsx)(`button`,{className:`icon-btn`,onClick:()=>void w(`stop`),disabled:!!f,title:`Stop the dev server (${i.config.dev})`,"aria-label":`stop dev server`,children:(0,S.jsx)(C,{name:f===`stop`?`progress_activity`:`stop`})}):(0,S.jsx)(`button`,{className:`icon-btn vibeable-play`,onClick:()=>void w(`start`),disabled:!!f,title:`Start the dev server: ${i.config.dev}`,"aria-label":`start dev server`,children:(0,S.jsx)(C,{name:f===`start`?`progress_activity`:`play_arrow`})})),E&&(0,S.jsx)(`button`,{className:`icon-btn${m?` active`:``}`,onClick:()=>h(e=>!e),title:`Dev server output`,"aria-label":`dev server output`,children:(0,S.jsx)(C,{name:`terminal`})}),(0,S.jsx)(`button`,{className:`icon-btn`,onClick:x,title:`Reload the preview`,"aria-label":`reload preview`,children:(0,S.jsx)(C,{name:`refresh`})}),(0,S.jsx)(`button`,{className:`icon-btn`,onClick:()=>window.open(i?.url??``,`_blank`,`noopener`),disabled:!i,title:`Open in a new tab`,"aria-label":`open in new tab`,children:(0,S.jsx)(C,{name:`open_in_new`})}),e&&r&&(0,S.jsx)(`button`,{className:`icon-btn`,onClick:()=>void T(),disabled:!!f||n,title:n?`The agent is working — close the preview when the turn is done`:`Close the preview (the agent returns to the project root)`,"aria-label":`close preview`,children:(0,S.jsx)(C,{name:f===`close`?`progress_activity`:`close`})})]}),(u||i?.configError)&&(0,S.jsxs)(`div`,{className:`vibeable-err`,children:[(0,S.jsx)(`span`,{children:u||i?.configError}),u&&(0,S.jsx)(`button`,{className:`vibeable-err-x`,onClick:()=>d(``),"aria-label":`dismiss`,children:(0,S.jsx)(C,{name:`close`,className:`ms-sm`})})]}),i?.config.dev&&!E?.running&&!u&&(0,S.jsxs)(`div`,{className:`vibeable-note`,children:[`This app has a dev command (`,(0,S.jsx)(`code`,{children:i.config.dev}),`). Showing the static folder until you start it.`]}),b&&(0,S.jsx)(`iframe`,{ref:g,className:`vibeable-frame`,src:b,title:`vibeable ${t}`,sandbox:`allow-scripts allow-forms allow-popups allow-modals allow-downloads`,allow:`clipboard-write`}),!b&&!u&&(0,S.jsx)(`div`,{className:`empty`,children:`loading…`}),m&&E&&(0,S.jsx)(`pre`,{className:`vibeable-log`,"aria-label":`dev server log`,children:E.log.length?E.log.join(`
77
- `):`(no output yet)`})]})}function Hr({chatId:e,slug:t,onClosed:n}){let[r,i]=(0,v.useState)(``);return(0,S.jsxs)(`aside`,{className:`vibeable-pane vibeable-pane-off`,"data-vibe":t,children:[(0,S.jsxs)(`div`,{className:`vibeable-bar`,children:[(0,S.jsx)(C,{name:`web`,className:`vibeable-bar-icon`}),(0,S.jsx)(`span`,{className:`vibeable-name`,children:t}),(0,S.jsxs)(`span`,{className:`vibeable-mode failed`,children:[(0,S.jsx)(`span`,{className:`lamp failed`}),`vibeables are off`]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`button`,{className:`icon-btn`,onClick:()=>zr(e,null).then(n).catch(e=>i(e.message)),title:`Detach the app from this chat`,"aria-label":`close preview`,children:(0,S.jsx)(C,{name:`close`})})]}),(0,S.jsxs)(`div`,{className:`vibeable-note`,children:[`This chat has `,(0,S.jsx)(`b`,{children:t}),` open, but vibeables were switched off in `,(0,S.jsx)(`a`,{href:`#/settings`,children:`settings`}),`. Turn them back on to see the preview, or detach the app.`]}),r&&(0,S.jsx)(`div`,{className:`vibeable-err`,children:(0,S.jsx)(`span`,{children:r})})]})}var Ur=`kw-vibeable-agent`;async function Wr(e,t){let n=await fetch(`/api/chats`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:t,scope:{kind:`general`}})}),r=await n.json();if(!n.ok||!r.id)throw Error(r.error||`HTTP ${n.status}`);await zr(r.id,e),j(`/agents/chats/${r.id}`)}function Gr({slug:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)({}),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(()=>{try{let e=localStorage.getItem(Ur);return e===`codex`||e===`pi`?e:`claude`}catch{return`claude`}}),_=F(),y=(0,v.useCallback)(async()=>{try{let e=await fetch(`/api/vibeables`,{cache:`no-store`});if(!e.ok)throw Error(`HTTP ${e.status}`);n(await e.json()),i(``)}catch(e){i(e.message||`could not load vibeables`)}},[]);(0,v.useEffect)(()=>{let e=!0,t,n=async()=>{await y(),e&&(t=setTimeout(n,15e3))};return n(),()=>{e=!1,clearTimeout(t)}},[y]);let b=[...t?.vibeables??[]].sort((e,t)=>(t.updatedAt??``).localeCompare(e.updatedAt??``)),x=s.trim().toLowerCase(),w=x?b.filter(e=>e.slug.toLowerCase().includes(x)):b,T=e===`new`,E=e&&!T?b.find(t=>t.slug===e):void 0;(0,v.useEffect)(()=>{y()},[e,y]);let D=b[0]?.slug;(0,v.useEffect)(()=>{!e&&D&&j(`/vibeables/${encodeURIComponent(D)}`,{replace:!0})},[e,D]);let O=(e,t)=>u(n=>({...n,[e]:t})),k=e=>u(t=>{let n={...t};return delete n[e],n}),ee=(e,t)=>f(n=>({...n,[e]:t.message})),A=async e=>{e.preventDefault();let t=a.trim();if(t&&!l.__new){O(`__new`,`create`),f(e=>({...e,__new:``}));try{let e=await fetch(`/api/vibeables`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:t})}),n=await e.json();if(!e.ok)throw Error(n.error||`HTTP ${e.status}`);o(``),await y(),j(`/vibeables/${encodeURIComponent(n.slug??t)}`)}catch(e){ee(`__new`,e)}finally{k(`__new`)}}},te=async e=>{O(e,`open`);try{await Wr(e,h)}catch(t){ee(e,t),k(e)}},ne=async e=>{O(e,`remove`),m(!1);try{let t=await fetch(`/api/vibeables/${encodeURIComponent(e)}`,{method:`DELETE`}),n=await t.json();if(!t.ok||!n.ok)throw Error(n.error||`failed`);await y(),j(`/vibeables`,{replace:!0})}catch(t){ee(e,t),y()}finally{k(e)}},N=e=>{g(e);try{localStorage.setItem(Ur,e)}catch{}},P=e=>e.configError?{label:`config error`,cls:`failed`}:e.hasIndex?{label:e.dev?`dev`:`static`,cls:`ok`}:{label:`no index.html yet`,cls:`pending`},re;if(t&&!t.enabled)re=(0,S.jsx)(`div`,{className:`empty`,children:t.error&&!/are off/.test(t.error)?(0,S.jsx)(`span`,{className:`settings-err`,children:t.error}):(0,S.jsxs)(S.Fragment,{children:[`Vibeables are off. Turn them on in `,(0,S.jsx)(`a`,{href:`#/settings`,children:`settings`}),` or add a `,(0,S.jsx)(`code`,{children:`vibeables:`}),` block to kraftwerk.yml.`]})});else if(!t)re=(0,S.jsx)(`div`,{className:`empty`,children:`loading…`});else if(T||b.length===0)re=(0,S.jsxs)(`form`,{className:`empty empty-action`,onSubmit:e=>void A(e),children:[(0,S.jsxs)(`div`,{className:`know-newbundle`,children:[(0,S.jsx)(`input`,{value:a,placeholder:`e.g. team-dashboard`,"aria-label":`new vibeable name`,onChange:e=>o(e.target.value),autoFocus:!0}),(0,S.jsxs)(`button`,{className:`run-btn`,type:`submit`,disabled:!!l.__new||!a.trim(),children:[(0,S.jsx)(C,{name:l.__new?`progress_activity`:`add`,className:`ms-sm`}),l.__new?`creating…`:`new vibeable`]})]}),d.__new&&(0,S.jsx)(`div`,{className:`settings-err`,children:d.__new}),(0,S.jsxs)(`div`,{className:`settings-note`,children:[`A small app built live with an agent. One folder each under `,(0,S.jsx)(`code`,{title:t.root,children:t.root}),`; part of the workspace, commit it from the git screen.`]})]});else if(e&&!E)re=(0,S.jsxs)(`div`,{className:`empty`,children:[`no vibeable named `,e]});else if(E){let e=E,t=P(e),n=l[e.slug];re=(0,S.jsxs)(`div`,{className:`chat-main vibe-main`,children:[(0,S.jsxs)(`div`,{className:`detail-head`,children:[(0,S.jsx)(Ee,{status:t.cls}),(0,S.jsx)(`h1`,{children:e.slug}),(0,S.jsx)(`span`,{className:`status-word ${t.cls}`,children:t.label}),e.updatedAt&&(0,S.jsxs)(`span`,{className:`rid`,title:e.updatedAt,children:[`changed `,we(e.updatedAt)]}),_&&(0,S.jsx)(`span`,{className:`rid`,title:e.path,children:e.path}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`label`,{className:`vibeables-agent`,children:(0,S.jsxs)(`select`,{value:h,onChange:e=>N(e.target.value),"aria-label":`agent for new chats`,children:[(0,S.jsx)(`option`,{value:`claude`,children:`claude`}),(0,S.jsx)(`option`,{value:`codex`,children:`codex`}),(0,S.jsx)(`option`,{value:`pi`,children:`pi`})]})}),(0,S.jsxs)(`button`,{className:`run-btn`,disabled:!!n,onClick:()=>void te(e.slug),title:`Start a ${h} chat with this app in the preview pane`,children:[(0,S.jsx)(C,{name:n===`open`?`progress_activity`:`chat`,className:`ms-sm`}),` open in chat`]}),p?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`button`,{className:`stop-btn`,onClick:()=>void ne(e.slug),children:[(0,S.jsx)(C,{name:`delete`,className:`ms-sm`}),` confirm remove`]}),(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>m(!1),children:`cancel`})]}):(0,S.jsxs)(`button`,{className:`stop-btn`,disabled:!!n,onClick:()=>m(!0),title:`Delete the folder; its history stays in the workspace git`,children:[(0,S.jsx)(C,{name:`delete`,className:`ms-sm`}),` remove`]})]}),(e.configError||d[e.slug])&&(0,S.jsx)(`div`,{className:`settings-err`,children:e.configError||d[e.slug]}),(0,S.jsx)(Vr,{slug:e.slug},e.slug)]})}else re=(0,S.jsx)(`div`,{className:`empty`,children:`loading…`});return(0,S.jsxs)(`div`,{className:`runs-screen vibeables-screen`,children:[(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`vibeables`}),(0,S.jsx)(`span`,{className:`spacer`}),t?.enabled&&(0,S.jsx)(`span`,{className:`microlabel num`,children:b.length}),t?.enabled&&(0,S.jsxs)(M,{href:`/vibeables/new`,className:`open-raw`,children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new`]})]}),(0,S.jsxs)(`label`,{className:`side-filter`,children:[(0,S.jsx)(C,{name:`filter_list`,className:`ms-sm`}),(0,S.jsx)(`input`,{type:`search`,value:s,placeholder:`search vibeables`,"aria-label":`search vibeables`,onChange:e=>c(e.target.value)})]}),(0,S.jsxs)(`div`,{className:`side-list`,children:[w.map(t=>{let n=P(t);return(0,S.jsxs)(M,{href:`/vibeables/${encodeURIComponent(t.slug)}`,className:`side-row vibeable-row ${t.slug===e?`active`:``}`,"data-vibeable":t.slug,children:[(0,S.jsx)(`span`,{className:`lamp ${n.cls}`}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsxs)(`div`,{className:`side-row-top`,children:[(0,S.jsx)(`span`,{className:`side-wf`,children:t.slug}),t.updatedAt&&(0,S.jsx)(`span`,{className:`side-when num`,title:t.updatedAt,children:we(t.updatedAt)})]}),(0,S.jsx)(`div`,{className:`side-row-sub`,children:(0,S.jsxs)(`span`,{className:`side-req`,children:[n.label,t.dev?` · ${t.dev}`:``]})})]})]},t.slug)}),t&&b.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`nothing built yet`}),t&&b.length>0&&w.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no vibeable matches`}),r&&(0,S.jsx)(`div`,{className:`viewer-note settings-err`,children:r})]})]}),(0,S.jsx)(`div`,{className:`runs-main`,children:re})]})}function Kr({seg:e}){let t=e[0]&&e[0]!==`new`?decodeURIComponent(e[0]):void 0,n=e[0]===`new`?`new`:t&&e[1]===`edit`?`edit`:t?`channel`:`home`,r=B(`/api/channels`,!1,4e3),i=B(`/api/agents`,!1,15e3),a=r?.channels??[],o=t?a.find(e=>e.slug===t):void 0,s=a.reduce((e,t)=>!e||t.updatedAt>e.updatedAt?t:e,void 0);(0,v.useEffect)(()=>{n===`home`&&s&&j(`/channels/${encodeURIComponent(s.slug)}`,{replace:!0})},[n,s?.slug]);let c;return c=n===`new`?(0,S.jsx)(Jr,{agents:i?.agents??[]}):n===`edit`&&o?(0,S.jsx)(Jr,{channel:o,agents:i?.agents??[]},o.slug):n===`channel`&&o?(0,S.jsx)(`div`,{className:`chat-main`,children:(0,S.jsx)(oi,{id:o.chatId,channel:o,agents:i?.agents??[]},o.chatId)}):n===`channel`&&r?(0,S.jsx)(`div`,{className:`empty`,children:`channel not found`}):n===`channel`||!r||s?(0,S.jsx)(`div`,{className:`empty`,children:`loading…`}):(0,S.jsx)(qr,{}),(0,S.jsxs)(`div`,{className:`runs-screen channels-screen`,children:[(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`channels`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(M,{href:`/channels/new`,className:`open-raw`,children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new`]})]}),(0,S.jsxs)(`div`,{className:`side-list`,children:[a.map(e=>(0,S.jsxs)(M,{href:`/channels/${encodeURIComponent(e.slug)}`,className:`side-row ${e.slug===t?`active`:``}`,children:[(0,S.jsx)(`span`,{className:`lamp ${e.awaitingApproval?`blocked`:e.busy?`running`:`pending`}`,title:e.awaitingApproval?`waiting for your approval`:e.busy?`an agent is working`:void 0}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsx)(`div`,{className:`side-row-top`,children:(0,S.jsxs)(`span`,{className:`side-wf`,children:[`#`,e.slug]})}),(0,S.jsxs)(`div`,{className:`side-row-sub`,children:[(0,S.jsxs)(`span`,{className:`side-req`,children:[e.name,e.project?` · 📁 ${e.project}`:``,e.members.length?` · ${e.members.map(e=>`@${e}`).join(` `)}`:``]}),(0,S.jsx)(`span`,{className:`side-when num`,children:Ce(e.updatedAt)})]})]})]},e.slug)),r&&a.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no channels yet — create one, or add a coworker to an agent session or a project chat`})]})]}),(0,S.jsx)(`div`,{className:`runs-main`,children:c})]})}function qr(){return(0,S.jsx)(`div`,{className:`empty empty-action`,children:(0,S.jsxs)(M,{href:`/channels/new`,className:`run-btn`,children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new channel`]})})}function Jr({channel:e,agents:t}){let[n,r]=(0,v.useState)(e?.name??``),[i,a]=(0,v.useState)(e?.purpose??``),[o,s]=(0,v.useState)(e?.members??[]),[c,l]=(0,v.useState)(e?.responder??``),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(``),m=t.filter(e=>!e.archived);function h(e,t){s(n=>t?[...n.filter(t=>t!==e),e]:n.filter(t=>t!==e)),!t&&c===e&&l(``)}async function g(){d(!0),p(``);try{let t=await fetch(e?`/api/channels/${encodeURIComponent(e.slug)}`:`/api/channels`,{method:e?`PUT`:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:n,purpose:i,members:o,responder:c||null})}),r=await t.json();if(!t.ok||r.error)throw Error(r.error??`HTTP ${t.status}`);j(`/channels/${encodeURIComponent(r.slug)}`)}catch(e){p(e.message)}d(!1)}async function _(){e&&window.confirm(`Delete #${e.slug} and its transcript?`)&&(await fetch(`/api/channels/${encodeURIComponent(e.slug)}`,{method:`DELETE`}).catch(()=>{}),j(`/channels`))}return(0,S.jsx)(`div`,{className:`new-chat`,children:(0,S.jsxs)(`div`,{className:`panel new-chat-panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:e?`edit #${e.slug}`:`new channel`}),(0,S.jsx)(`span`,{className:`spacer`}),e&&(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>void _(),children:[(0,S.jsx)(C,{name:`delete`,className:`ms-sm`}),` delete`]})]}),(0,S.jsxs)(`div`,{className:`agent-form`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,children:[`name`,(0,S.jsx)(`input`,{value:n,placeholder:`e.g. Website relaunch`,onChange:e=>r(e.target.value),autoFocus:!0})]}),(0,S.jsxs)(`label`,{className:`agent-field`,children:[`purpose — one line the agents read`,(0,S.jsx)(`input`,{value:i,placeholder:`what this channel is for`,onChange:e=>a(e.target.value)})]}),(0,S.jsxs)(`div`,{className:`agent-field`,children:[`members — agents in this channel`,(0,S.jsxs)(`div`,{className:`wf-checks`,children:[m.map(e=>(0,S.jsxs)(`label`,{children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:o.includes(e.slug),onChange:t=>h(e.slug,t.target.checked)}),(0,S.jsxs)(`b`,{children:[e.emoji,` `,e.name]}),(0,S.jsxs)(`span`,{className:`opt-hint`,children:[` — @`,e.slug,e.description?` · ${e.description}`:``]})]},e.slug)),m.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no agents yet — create one on the agents screen first`})]})]}),(0,S.jsxs)(`label`,{className:`agent-field`,children:[`responder — answers when a message mentions nobody`,(0,S.jsxs)(`select`,{value:c,onChange:e=>l(e.target.value),children:[(0,S.jsx)(`option`,{value:``,children:`nobody (agents only answer when @mentioned)`}),o.map(e=>(0,S.jsxs)(`option`,{value:e,children:[`@`,e]},e))]})]}),f&&(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,f]}),(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsx)(`button`,{className:`run-btn`,disabled:u||!n.trim()||o.length===0,onClick:()=>void g(),children:u?`saving…`:e?`save`:`create channel`}),(0,S.jsx)(M,{href:e?`/channels/${encodeURIComponent(e.slug)}`:`/channels`,className:`open-raw`,children:`cancel`})]})]})]})})}function Yr({chatId:e,agentSlug:t,project:n,title:r,onClose:i,onCreated:a}){let[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(r||``),[u,d]=(0,v.useState)([]),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(``);(0,v.useEffect)(()=>{fetch(`/api/agents`).then(e=>e.json()).then(e=>s(e.agents.filter(e=>!e.archived&&e.slug!==t))).catch(()=>{})},[t]);async function g(){p(!0),h(``);try{let n=await fetch(`/api/channels/from-chat`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({chatId:e,name:c,members:t?[t,...u]:u,responder:t??u[0]})}),r=await n.json();if(!n.ok||!r.slug)throw Error(r.error??`HTTP ${n.status}`);i(),a?a(r.slug):j(`/channels/${encodeURIComponent(r.slug)}`)}catch(e){h(e.message)}p(!1)}return(0,S.jsx)(`div`,{className:`dialog-backdrop`,onMouseDown:e=>e.target===e.currentTarget&&i(),children:(0,S.jsxs)(`div`,{className:`dialog`,role:`dialog`,"aria-label":`Add a coworker`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`add a coworker`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`button`,{className:`open-raw`,onClick:i,children:(0,S.jsx)(C,{name:`close`,className:`ms-sm`})})]}),(0,S.jsxs)(`div`,{className:`agent-form`,children:[(0,S.jsx)(`p`,{className:`viewer-note`,children:t?(0,S.jsxs)(S.Fragment,{children:[`This session becomes a channel: @`,t,` stays and keeps its memory, the agents you pick join, and everyone reads the same transcript. @`,t,` answers when nobody is mentioned.`]}):(0,S.jsxs)(S.Fragment,{children:[`This chat becomes a channel session of the project `,(0,S.jsx)(`b`,{children:n}),` and stays here: the agents you pick join with everything said so far and the project's brief, state, records and links. The first one you pick answers when nobody is mentioned.`]})}),(0,S.jsxs)(`label`,{className:`agent-field`,children:[`channel name`,(0,S.jsx)(`input`,{value:c,placeholder:`e.g. Website relaunch`,onChange:e=>l(e.target.value),autoFocus:!0})]}),(0,S.jsxs)(`div`,{className:`agent-field`,children:[`invite`,(0,S.jsxs)(`div`,{className:`wf-checks`,children:[o.map(e=>(0,S.jsxs)(`label`,{children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:u.includes(e.slug),onChange:t=>d(n=>t.target.checked?[...n,e.slug]:n.filter(t=>t!==e.slug))}),(0,S.jsxs)(`b`,{children:[e.emoji,` `,e.name]}),(0,S.jsxs)(`span`,{className:`opt-hint`,children:[` — @`,e.slug,e.description?` · ${e.description}`:``]})]},e.slug)),o.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no other agents to invite yet`})]})]}),m&&(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,m]}),(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsx)(`button`,{className:`run-btn`,disabled:f||!c.trim()||u.length===0,onClick:()=>void g(),children:f?`creating…`:`create channel`}),(0,S.jsx)(`button`,{className:`open-raw`,onClick:i,children:`cancel`})]})]})]})})}var Xr=`kw-me`;function Zr(){try{return localStorage.getItem(Xr)||``}catch{return``}}function Qr(e){try{localStorage.setItem(Xr,e)}catch{}}var $r=[{id:`claude`,label:`claude`,hint:`Claude Code via ACP`},{id:`codex`,label:`codex`,hint:`Codex (ChatGPT) via ACP`},{id:`pi`,label:`pi`,hint:`pi coding agent`}];async function ei(e,t,n){let r=await(await fetch(`/api/chats`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:e,scope:t,...n?{resume:n}:{}})})).json();r.id&&j(r.scope?.kind===`agent`?`/agents/${encodeURIComponent(r.scope.slug)}/chat/${r.id}`:r.scope?.kind===`project`?`/projects/${encodeURIComponent(r.scope.slug)}/chat/${r.id}`:`/agents/chats/${r.id}`)}function ti(){let[e,t]=(0,v.useState)(`claude`),[n,r]=(0,v.useState)(!0),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(null);return(0,v.useEffect)(()=>s(null),[e]),(0,S.jsxs)(`div`,{className:`new-chat`,children:[(0,S.jsx)(`div`,{className:`page-head`,children:(0,S.jsx)(`h1`,{children:`new chat`})}),(0,S.jsxs)(`section`,{className:`panel new-chat-panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`agent`})}),(0,S.jsx)(`div`,{className:`agent-pick`,children:$r.map(n=>(0,S.jsxs)(`button`,{className:`agent-pick-btn ${e===n.id?`active`:``}`,onClick:()=>t(n.id),children:[(0,S.jsx)(`b`,{children:n.label}),(0,S.jsx)(`span`,{children:n.hint})]},n.id))}),(0,S.jsx)(`div`,{className:`run-opts`,style:{padding:`0 16px 14px`},children:(0,S.jsxs)(`label`,{children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>r(e.target.checked)}),`kraftwerk-aware`,(0,S.jsx)(`span`,{className:`opt-hint`,children:`— agent gets workflows + recent runs as context`})]})}),(0,S.jsx)(`div`,{style:{padding:`0 16px 16px`},children:(0,S.jsx)(`button`,{className:`run-btn`,disabled:i,onClick:async()=>{a(!0),await ei(e,{kind:n?`kraftwerk`:`general`}),a(!1)},children:i?`starting…`:`start chat`})})]}),e!==`pi`&&(0,S.jsxs)(`section`,{className:`panel new-chat-panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`continue a session`}),(0,S.jsx)(`span`,{className:`spacer`}),o===null&&(0,S.jsxs)(`button`,{className:`ws-btn`,onClick:async()=>{s(`loading`);let t=await fetch(`/api/agent-sessions?agent=${e}`).then(e=>e.ok?e.json():{sessions:[]}).catch(()=>({sessions:[]}));s((t.sessions??[]).slice(0,20))},children:[(0,S.jsx)(C,{name:`history`,className:`ms-sm`}),` list `,e,` sessions`]})]}),o===`loading`&&(0,S.jsxs)(`div`,{className:`empty`,children:[`asking `,e,`…`]}),Array.isArray(o)&&o.length===0&&(0,S.jsxs)(`div`,{className:`empty`,children:[`no `,e,` sessions in this project`]}),Array.isArray(o)&&o.length>0&&(0,S.jsx)(`div`,{className:`session-list`,children:o.map(t=>(0,S.jsxs)(`button`,{className:`session-row`,disabled:i,title:t.sessionId,onClick:async()=>{a(!0),await ei(e,{kind:n?`kraftwerk`:`general`},t.sessionId),a(!1)},children:[(0,S.jsx)(`span`,{className:`session-title`,children:t.title||t.sessionId.slice(0,8)}),t.updatedAt&&(0,S.jsx)(`span`,{className:`session-when`,children:new Date(t.updatedAt).toLocaleString()})]},t.sessionId))})]})]})}function ni(e,t){fetch(`/api/chats/${e}/cancel`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t?{agent:t}:{})}).catch(()=>{})}var ri=(e,t=90)=>{let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t)}…`:n};function ii(e,t){let n=RegExp(`(^|[^a-z0-9-])@${t.replace(/[.*+?^${}()|[\\]\\]/g,`\\$&`)}(?![a-z0-9-])`,`i`),r,i,a=!1,o=``;for(let s of e){if(s.from?.kind!==`agent`||s.from.slug!==t){(s.type===`user_message`||s.type===`text`)&&n.test(s.text)&&(r=ri(s.text));continue}switch(s.type){case`turn_start`:a=!0,i=void 0,o=``;break;case`turn_end`:case`error`:a=!1;break;case`tool_call`:a&&(i=ri(`${s.kind&&s.kind!==`other`?`${s.kind}: `:``}${s.title}`));break;case`text`:a&&(o+=s.text,(!i||i.startsWith(`says: `))&&(i=ri(`says: ${o}`)))}}return{task:r,now:i}}function ai(e,t){let n=e=>!t&&!e||t?.kind===`agent`&&e?.kind===`agent`&&e.slug===t.slug,r=null,i,a=[],o=[],s;for(let t of e)n(t.from)&&(t.type===`plan`?r=t.entries:t.type===`usage`?i={used:t.used,size:t.size,costUsd:t.costUsd}:t.type===`commands`?a=t.commands:t.type===`config`?o=t.options:t.type===`auth`&&(s=t));return{plan:r,usage:i,commands:a,config:o,auth:s}}function oi({id:e,agentName:t,agentDescription:n,channel:r,agents:i,onConverted:a}){let[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)([]),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(null),[x,w]=(0,v.useState)(null),T=L(),E=(0,v.useMemo)(()=>ai(c),[c]);(0,v.useEffect)(()=>{let t=!0,n=null;return fetch(`/api/chats/${e}`).then(e=>e.ok?e.json():Promise.reject()).then(r=>{if(!t)return;s(r.meta),l(r.events);let i=r.events[r.events.length-1]?.seq??0;n=new EventSource(`/api/chats/${e}/events?after=${i}`),n.onmessage=e=>{let t=JSON.parse(e.data);l(e=>e.some(e=>e.seq===t.seq)?e:[...e,t])}}).catch(()=>t&&d(!0)),()=>{t=!1,n?.close()}},[e]);let D=(0,v.useMemo)(()=>{if(!r)return[];let e=new Set;for(let t of c)t.from?.kind===`agent`&&(t.type===`turn_start`&&e.add(t.from.slug),(t.type===`turn_end`||t.type===`error`)&&e.delete(t.from.slug));return[...e]},[c,r]),O=(0,v.useMemo)(()=>{if(r)return D.length>0;for(let e=c.length-1;e>=0;e--){let t=c[e].type;if(t===`user_message`)return!0;if(t===`turn_end`||t===`error`)return!1}return!1},[c,r,D]),k=(0,v.useMemo)(()=>{if(o?.title)return o.title;let e=c.find(e=>e.type===`user_message`);return e&&e.type===`user_message`?e.text.replace(/\s+/g,` `).trim().slice(0,80):``},[o,c]);if((0,v.useEffect)(()=>o?r?(A(`#${r.slug} · ${r.name}`),()=>A(``)):(A([t??(o.scope.kind===`agent`?o.scope.slug:o.agent),n,k||`new chat`].filter(Boolean).join(` · `)),()=>A(``)):void 0,[o,k,t,n,r]),u)return(0,S.jsx)(`div`,{className:`empty`,children:`chat not found`});if(!o)return(0,S.jsx)(`div`,{className:`empty`,children:`loading…`});let ee=new Map((i??[]).map(e=>[e.slug,e]));return r?(0,S.jsx)(`div`,{className:`chat-split`,children:(0,S.jsxs)(`div`,{className:`chat-thread channel-thread`,children:[(0,S.jsxs)(`div`,{className:`detail-head channel-head`,children:[(0,S.jsx)(`span`,{className:`lamp ${O?`running`:`ok`}`}),(0,S.jsxs)(`h1`,{children:[`#`,r.slug]}),(0,S.jsx)(`span`,{className:`channel-name`,children:r.name}),(0,S.jsx)(`span`,{className:`spacer`}),D.length>0&&(0,S.jsxs)(`button`,{className:`stop-btn`,title:`interrupt every agent working in this channel`,onClick:()=>ni(e),children:[(0,S.jsx)(C,{name:`stop`,className:`ms-sm`}),` stop all (`,D.length,`)`]}),(0,S.jsxs)(M,{href:`/channels/${encodeURIComponent(r.slug)}/edit`,className:`open-raw`,title:`members, purpose, responder`,children:[(0,S.jsx)(C,{name:`tune`,className:`ms-sm`}),` members`]})]}),(0,S.jsxs)(`div`,{className:`channel-members`,children:[r.purpose&&(0,S.jsx)(`span`,{className:`channel-purpose`,children:r.purpose}),r.members.map(t=>{let n=ee.get(t),i=D.includes(t),a=ii(c,t);return(0,S.jsxs)(`div`,{className:`member-chip ${i?`working`:``} ${x===t?`focused`:``}`,title:n?.description,children:[(0,S.jsxs)(`button`,{className:`member-open`,onClick:()=>w(x===t?null:t),title:x===t?`back to the channel`:`look at @${t}'s session`,children:[(0,S.jsxs)(`span`,{className:`agent-avatar sm`,children:[(0,S.jsx)(`span`,{"aria-hidden":!0,children:n?.emoji??`🤖`}),(0,S.jsx)(`span`,{className:`lamp ${i?`running`:`idle`}`})]}),(0,S.jsxs)(`span`,{className:`member-text`,children:[(0,S.jsxs)(`span`,{className:`member-line`,children:[(0,S.jsx)(`span`,{className:`member-name`,children:n?.name??t}),(0,S.jsxs)(`span`,{className:`member-handle`,children:[`@`,t]}),r.responder===t&&(0,S.jsx)(`span`,{className:`chip`,children:`responder`})]}),(a.task||a.now)&&(0,S.jsx)(`span`,{className:`member-activity`,children:i?a.now?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`now`}),` `,a.now]}):(0,S.jsxs)(S.Fragment,{children:[`working on: `,a.task]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`last`}),` `,a.task]})})]})]}),i&&(0,S.jsx)(`button`,{className:`member-stop`,title:`interrupt @${t}`,onClick:()=>ni(e,t),children:(0,S.jsx)(C,{name:`stop`,className:`ms-sm`})}),(0,S.jsx)(M,{href:`/agents/${encodeURIComponent(t)}/info`,className:`member-info`,title:`agent definition`,children:(0,S.jsx)(C,{name:`info`,className:`ms-sm`})})]},t)})]}),x&&(0,S.jsxs)(`div`,{className:`focus-bar`,children:[(0,S.jsxs)(`button`,{className:`ws-btn`,onClick:()=>w(null),children:[(0,S.jsx)(C,{name:`arrow_back`,className:`ms-sm`}),` channel`]}),(0,S.jsxs)(`span`,{className:`focus-title`,children:[ee.get(x)?.emoji??`🤖`,` @`,x,`'s session — everything this agent did, tools included`]}),(0,S.jsx)(`span`,{className:`spacer`}),D.includes(x)&&(0,S.jsxs)(`button`,{className:`stop-btn`,onClick:()=>ni(e,x),children:[(0,S.jsx)(C,{name:`stop`,className:`ms-sm`}),` stop @`,x]})]}),(0,S.jsx)(ui,{id:e,events:c,busy:O,channel:r,agentMap:ee,working:D,focus:x??void 0}),(0,S.jsx)(bi,{id:e,busy:O,scope:o.scope,channel:r,agentMap:ee})]})}):(0,S.jsxs)(`div`,{className:`chat-split${o.vibeable?` open`:``}`,children:[(0,S.jsxs)(`div`,{className:`chat-thread`,children:[(0,S.jsxs)(`div`,{className:`detail-head`,children:[(0,S.jsx)(`span`,{className:`lamp ${O?`running`:`ok`}`}),(0,S.jsx)(`h1`,{children:k||`new chat`}),(o.scope.kind===`agent`&&!o.scope.routine||o.scope.kind===`project`)&&(0,S.jsxs)(`button`,{className:`ws-btn coworker-btn`,onClick:()=>h(!0),title:o.scope.kind===`project`?`Turn this chat into a channel of the project and invite agents`:`Turn this session into a channel and invite more agents`,disabled:O,children:[(0,S.jsx)(C,{name:`group_add`,className:`ms-sm`}),` add coworker`]}),o.agent!==`pi`&&o.sessions?.main&&(0,S.jsxs)(`button`,{className:`ws-btn fork-btn${o.agent===`codex`?` muted`:``}`,disabled:O||g,"aria-disabled":o.agent===`codex`,title:o.agent===`codex`?`not supported: codex has no session fork`:`Branch this conversation: a new chat with the same history, the original stays as it is`,onClick:async()=>{if(o.agent===`codex`)return b(`fork is not supported by codex`);_(!0);let t=await fetch(`/api/chats/${e}/fork`,{method:`POST`}),n=await t.json().catch(()=>({}));if(_(!1),!t.ok||!n.id)return alert(n.error??`fork failed (${t.status})`);j(n.scope?.kind===`agent`?`/agents/${encodeURIComponent(n.scope.slug)}/chat/${n.id}`:`/agents/chats/${n.id}`)},children:[(0,S.jsx)(C,{name:`call_split`,className:`ms-sm`}),` `,g?`forking…`:`fork`]}),y&&(0,S.jsx)(`span`,{className:`fork-note`,children:y}),!o.vibeable&&T.vibeables&&(0,S.jsxs)(`button`,{className:`ws-btn vibeable-open`,onClick:()=>p(!0),title:`Build a small app live: a preview pane next to this chat`,disabled:O,children:[(0,S.jsx)(C,{name:`web`,className:`ms-sm`}),` vibeable`]}),(0,S.jsx)(`span`,{className:`chip agent`,children:o.agent}),(0,S.jsx)(_i,{id:e,live:E}),o.scope.kind===`run`&&(0,S.jsx)(M,{href:`/runs/${o.scope.runId}`,className:`chip`,children:o.scope.runId}),o.scope.kind===`kraftwerk`&&(0,S.jsx)(`span`,{className:`chip`,children:`kraftwerk-aware`}),o.scope.kind===`knowledge`&&(0,S.jsxs)(M,{href:o.scope.bundle?`/knowledge/${encodeURIComponent(o.scope.bundle)}`:`/knowledge`,className:`chip`,children:[`knowledge`,o.scope.bundle?`:${o.scope.bundle}`:``]}),o.scope.kind===`agent`&&(0,S.jsxs)(M,{href:`/agents/${encodeURIComponent(o.scope.slug)}/info`,className:`chip`,children:[`agent:`,o.scope.slug]}),(0,S.jsx)(`span`,{className:`rid`,title:o.cwd,children:o.cwd})]}),(0,S.jsx)(ui,{id:e,events:c,busy:O}),(0,S.jsx)(bi,{id:e,busy:O,scope:o.scope,commands:E.commands,canSteer:o.agent!==`pi`})]}),o.vibeable&&T.vibeables&&(0,S.jsx)(Vr,{chatId:e,slug:o.vibeable,agentBusy:O,onClosed:s},o.vibeable),o.vibeable&&!T.vibeables&&(0,S.jsx)(Hr,{chatId:e,slug:o.vibeable,onClosed:s}),f&&(0,S.jsx)(Br,{chatId:e,onClose:()=>p(!1),onOpened:e=>{s(e),p(!1)}}),m&&o.scope.kind===`agent`&&(0,S.jsx)(Yr,{chatId:e,agentSlug:o.scope.slug,title:k,onClose:()=>h(!1)}),m&&o.scope.kind===`project`&&(0,S.jsx)(Yr,{chatId:e,project:o.scope.slug,title:k||t||``,onClose:()=>h(!1),onCreated:a})]})}var si=(e,t)=>!e&&!t||!!e&&!!t&&e.kind===t.kind&&(e.kind===`human`?e.name===t.name:e.slug===t.slug);function ci(e){let t=[],n=new Map,r=new Map,i=new Map,a=new Map,o=new Map,s=new Map,c,l;for(let u of e){let e=`subagent`in u&&u.subagent?r.get(u.subagent):void 0,d=e?e.children:t,f=d[d.length-1];switch(u.type){case`user_message`:c=u.text,d.push({kind:`user`,text:u.text,steered:u.steered,attachments:u.attachments,key:`e${u.seq}`,from:u.from});break;case`text`:f?.kind===`agent`&&si(f.from,u.from)?f.text+=u.text:d.push({kind:`agent`,text:u.text,key:`e${u.seq}`,from:u.from});break;case`thought`:f?.kind===`thought`&&si(f.from,u.from)?f.text+=u.text:d.push({kind:`thought`,text:u.text,key:`e${u.seq}`,from:u.from});break;case`tool_call`:{let e={kind:`tool`,callId:u.callId,title:u.title,toolKind:u.kind,status:u.status,compaction:u.compaction,key:`e${u.seq}`,from:u.from};n.set(u.callId,e),d.push(e);break}case`tool_update`:{let e=n.get(u.callId);e&&(u.title&&(e.title=u.title),u.status&&(e.status=u.status),u.compaction&&(e.compaction={...e.compaction,...u.compaction}));break}case`subagent`:{let e={kind:`subagent`,sessionId:u.sessionId,name:u.name,task:u.task,children:[],key:`e${u.seq}`,from:u.from};r.set(u.sessionId,e),t.push(e);break}case`subagent_state`:{let e=r.get(u.sessionId);e&&(e.state=u.state);break}case`task`:{let e={kind:`task`,taskId:u.taskId,name:u.name,taskType:u.taskType,description:u.description,canStop:u.canStop,state:`running`,key:`e${u.seq}`,from:u.from};i.set(u.taskId,e),d.push(e);break}case`task_update`:{let e=i.get(u.taskId);e&&(u.description&&(e.description=u.description),u.summary&&(e.summary=u.summary),u.state&&(e.state=u.state));break}case`permission_request`:s.set(u.requestId,d.length),d.push({kind:`permission`,requestId:u.requestId,title:u.title,options:u.options,resolved:void 0,key:`e${u.seq}`,from:u.from});break;case`permission_resolved`:{let e=s.get(u.requestId);e!=null&&(d[e].resolved=u.optionId);break}case`error`:d.push({kind:`error`,text:u.message,key:`e${u.seq}`,from:u.from});break;case`failure`:{let{type:e,seq:n,ts:r,from:i,...o}=u,s=a.get(o.id);if(s&&o.revision>=s.failure.revision)s.failure=o,s.resolved=!1,s.retryText=c;else if(!s){let e={kind:`failure`,failure:o,resolved:!1,retryText:c,key:`e${u.seq}`,from:i};a.set(o.id,e),t.push(e)}break}case`turn_end`:for(let e of a.values())e.resolved=!0;break;case`plan`:u.entries===null?l&&(l.removed=!0):l&&!l.removed?l.entries=u.entries:(l={kind:`plan`,entries:u.entries,removed:!1,key:`e${u.seq}`,from:u.from},t.push(l));break;case`files_changed`:(u.paths.length>0||u.uncertainty)&&t.push({kind:`files`,paths:u.paths,complete:u.complete,...u.uncertainty?{note:u.uncertainty}:{},key:`e${u.seq}`,from:u.from});break;case`elicitation_request`:{let e={kind:`question`,requestId:u.requestId,message:u.message,fields:u.fields,key:`e${u.seq}`,from:u.from};o.set(u.requestId,e),t.push(e);break}case`elicitation_resolved`:{let e=o.get(u.requestId);e&&(e.resolved={action:u.action,...u.action===`accept`?{content:u.content}:{}});break}}}return t}var li=new Set([`tool`,`thought`,`subagent`,`task`,`files`]);function ui({id:e,events:t,busy:n,channel:r,agentMap:i,working:a,focus:o}){let s=F(),c=(0,v.useMemo)(()=>{let e=ci(o?t.filter(e=>e.from?.kind===`human`||e.from?.kind===`agent`&&e.from.slug===o):t);return s||o?e:e.filter(e=>!li.has(e.kind))},[t,s,o]),l=(0,v.useRef)(null),u=(0,v.useRef)(!0);return(0,v.useEffect)(()=>{let e=l.current;e&&u.current&&(e.scrollTop=e.scrollHeight)},[c,n]),(0,S.jsxs)(`div`,{className:`chat-scroll`,ref:l,onScroll:e=>{let t=e.currentTarget;u.current=t.scrollHeight-t.scrollTop-t.clientHeight<60},children:[c.length===0&&(0,S.jsx)(`div`,{className:`empty`,children:r?`say something — @mention an agent to wake it${r.responder?`, or just write: @${r.responder} answers`:``}`:`say something — the agent starts on your first message`}),c.map((t,n)=>{let a=c[n-1],o=r&&t.kind!==`error`&&(!a||!si(a.from,t.from)||a.kind===`error`)?t.from:void 0;return(0,S.jsxs)(`div`,{className:`turn ${t.from?.kind===`human`?`human`:t.from?.kind===`agent`?`agent`:``}`,children:[o&&(0,S.jsx)(di,{from:o,agentMap:i}),(0,S.jsx)(pi,{b:t,chatId:e})]},t.key)}),n&&(0,S.jsxs)(`div`,{className:`chat-working`,children:[(0,S.jsx)(`span`,{className:`lamp running`}),` `,r&&a?.length?a.map(e=>`${i?.get(e)?.emoji??``} @${e}`).join(`, `)+(a.length===1?` is working…`:` are working…`):`working…`]})]})}function di({from:e,agentMap:t}){if(e.kind===`human`)return(0,S.jsxs)(`div`,{className:`byline human`,children:[(0,S.jsx)(`span`,{className:`byline-avatar`,children:e.name.slice(0,1).toUpperCase()}),(0,S.jsx)(`span`,{className:`byline-name`,children:e.name})]});let n=t?.get(e.slug);return(0,S.jsxs)(M,{href:`/agents/${encodeURIComponent(e.slug)}/info`,className:`byline agent`,children:[(0,S.jsx)(`span`,{className:`byline-avatar`,children:n?.emoji??`🤖`}),(0,S.jsx)(`span`,{className:`byline-name`,children:n?.name??e.slug}),(0,S.jsxs)(`span`,{className:`byline-handle`,children:[`@`,e.slug]})]})}function fi({text:e}){let t=(0,v.useMemo)(()=>Rr.sanitize(H.parse(e,{async:!1})),[e]);return(0,S.jsx)(`div`,{className:`msg agent md-body chat-md`,dangerouslySetInnerHTML:{__html:t}})}function pi({b:e,chatId:t}){switch(e.kind){case`user`:return(0,S.jsxs)(`div`,{className:`msg user${e.steered?` steered`:``}`,children:[e.steered&&(0,S.jsx)(`span`,{className:`microlabel steer-label`,children:`steered in`}),e.text,e.attachments&&e.attachments.length>0&&(0,S.jsx)(`div`,{className:`attachments`,children:e.attachments.map(e=>{let n=`/api/chats/${t}/attachments/${encodeURIComponent(e.name)}`;return e.mimeType.startsWith(`image/`)?(0,S.jsx)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,title:e.name,children:(0,S.jsx)(`img`,{src:n,alt:e.name})},e.name):(0,S.jsxs)(`a`,{className:`file-link`,href:n,target:`_blank`,rel:`noreferrer`,children:[(0,S.jsx)(C,{name:`attach_file`,className:`ms-sm`}),` `,e.name]},e.name)})})]});case`agent`:return(0,S.jsx)(fi,{text:e.text});case`thought`:return(0,S.jsxs)(`details`,{className:`msg thought`,children:[(0,S.jsx)(`summary`,{children:`thinking`}),(0,S.jsx)(`div`,{children:e.text})]});case`tool`:return(0,S.jsxs)(`div`,{className:`tool-card ${e.status??``}${e.compaction?` compaction`:``}`,children:[(0,S.jsx)(`span`,{className:`lamp ${e.status===`completed`?`ok`:e.status===`failed`?`failed`:`running`}`}),(0,S.jsx)(`span`,{className:`chip tool-kind`,children:e.compaction?`compact`:e.toolKind}),(0,S.jsx)(`span`,{className:`tool-title`,children:e.compaction?gi(e.compaction,e.status):e.title})]});case`subagent`:return(0,S.jsxs)(`details`,{className:`subagent-card ${e.state??`running`}`,open:!e.state,children:[(0,S.jsxs)(`summary`,{children:[(0,S.jsx)(`span`,{className:`lamp ${e.state===`completed`?`ok`:e.state===`failed`?`failed`:e.state?`idle`:`running`}`}),(0,S.jsx)(`span`,{className:`chip tool-kind`,children:`subagent`}),(0,S.jsxs)(`span`,{className:`tool-title`,children:[(0,S.jsx)(`b`,{children:e.name}),` — `,e.task,e.state&&e.state!==`completed`&&(0,S.jsxs)(`span`,{className:`subagent-state`,children:[` · `,e.state]})]})]}),(0,S.jsxs)(`div`,{className:`subagent-body`,children:[e.children.length===0&&(0,S.jsx)(`div`,{className:`subagent-empty`,children:`working…`}),e.children.map(e=>(0,S.jsx)(pi,{b:e,chatId:t},e.key))]})]});case`task`:return(0,S.jsxs)(`div`,{className:`tool-card task-card ${e.state??``}`,children:[(0,S.jsx)(`span`,{className:`lamp ${e.state===`completed`?`ok`:e.state===`failed`?`failed`:e.state===`running`?`running`:`idle`}`}),(0,S.jsx)(`span`,{className:`chip tool-kind`,children:e.taskType}),(0,S.jsxs)(`span`,{className:`tool-title`,children:[(0,S.jsx)(`b`,{children:e.name}),` — `,e.summary??e.description,e.state&&e.state!==`running`&&e.state!==`completed`&&(0,S.jsxs)(`span`,{className:`subagent-state`,children:[` · `,e.state]})]}),e.canStop&&(e.state===`running`||e.state===`paused`)&&(0,S.jsxs)(`button`,{className:`task-stop`,title:`stop this background task (the turn goes on)`,onClick:()=>fetch(`/api/chats/${t}/task-stop`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({taskId:e.taskId})}).catch(()=>{}),children:[(0,S.jsx)(C,{name:`stop`,className:`ms-sm`}),` stop`]})]});case`plan`:return(0,S.jsxs)(`div`,{className:`plan-card${e.removed?` removed`:``}`,children:[(0,S.jsxs)(`div`,{className:`plan-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`plan`}),(0,S.jsxs)(`span`,{className:`plan-count`,children:[e.entries.filter(e=>e.status===`completed`).length,`/`,e.entries.length]})]}),(0,S.jsx)(`ul`,{children:e.entries.map((e,t)=>(0,S.jsxs)(`li`,{className:`plan-${e.status} prio-${e.priority}`,children:[(0,S.jsx)(C,{name:e.status===`completed`?`check_circle`:e.status===`in_progress`?`play_circle`:`radio_button_unchecked`,className:`ms-sm`}),(0,S.jsx)(`span`,{children:e.content})]},t))})]});case`files`:return(0,S.jsxs)(`div`,{className:`tool-card files-card`,children:[(0,S.jsx)(`span`,{className:`lamp ok`}),(0,S.jsx)(`span`,{className:`chip tool-kind`,children:`changed`}),(0,S.jsxs)(`span`,{className:`tool-title`,children:[e.paths.join(`
78
- `),(!e.complete||e.note)&&(0,S.jsxs)(`span`,{className:`subagent-state`,children:[` · `,e.note??`list may be incomplete`]})]})]});case`question`:return(0,S.jsx)(vi,{b:e,chatId:t});case`permission`:return(0,S.jsx)(yi,{b:e,chatId:t});case`error`:return(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,e.text]});case`failure`:return(0,S.jsx)(hi,{b:e,chatId:t})}}var mi={retry:`try again`,login:`sign in again`,new_session:`start a fresh session`};function hi({b:e,chatId:t}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null),o=e.failure,s=!e.resolved&&!i;async function c(n){if(n===`login`){a(`Sign in again in a terminal (claude login, or codex login), then send your message again.`);return}r(!0);try{if(n===`retry`){if(!e.retryText)return a(`nothing to retry — send a message`);await fetch(`/api/chats/${t}/message`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:e.retryText})})}else{let e=await fetch(`/api/chats/${t}/reset-session`,{method:`POST`});e.ok||a((await e.json().catch(()=>({}))).error??`reset failed (${e.status})`)}}catch{}finally{r(!1)}}return(0,S.jsxs)(`div`,{className:`failure-card ${o.severity} ${s?`live`:`settled`}`,children:[(0,S.jsxs)(`div`,{className:`failure-title`,children:[(0,S.jsx)(C,{name:o.severity===`warning`?`warning`:`error`,className:`ms-sm`}),(0,S.jsx)(`span`,{className:`microlabel`,children:o.category}),` `,o.title]}),o.details&&(0,S.jsx)(`div`,{className:`failure-details`,children:o.details}),i&&(0,S.jsx)(`div`,{className:`failure-details`,children:i}),s&&o.actions.length>0&&(0,S.jsx)(`div`,{className:`failure-actions`,children:o.actions.map(e=>(0,S.jsx)(`button`,{className:`ws-btn`,disabled:n,onClick:()=>c(e),children:mi[e]},e))})]})}function gi(e,t){let n=e=>e>=1e4?`${Math.round(e/1e3)}k`:String(e),r=[t===`completed`?`context compacted`:t===`failed`?`compaction failed`:`compacting context`];return e.preTokens!=null&&e.postTokens!=null?r.push(`${n(e.preTokens)} → ${n(e.postTokens)} tokens`):e.preTokens!=null&&r.push(`${n(e.preTokens)} tokens`),e.trigger&&r.push(e.trigger),e.error&&r.push(e.error),r.join(` · `)}function _i({id:e,live:t}){let n=F(),[r,i]=(0,v.useState)(null),a=t.config.filter(e=>e.category===`model`||e.category===`thought_level`);async function o(t,n){i(t.id);let r=await fetch(`/api/chats/${e}/config`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({configId:t.id,value:n})}).catch(()=>null);i(null),r&&!r.ok&&alert((await r.json().catch(()=>({}))).error??`setting refused (${r.status})`)}return(0,S.jsxs)(S.Fragment,{children:[t.auth&&(0,S.jsxs)(`span`,{className:`chip auth ${t.auth.kind}`,title:[t.auth.detail,t.auth.email,t.auth.organization,t.auth.plan].filter(Boolean).join(` · `),children:[(0,S.jsx)(C,{name:t.auth.kind===`none`?`person_off`:`person`,className:`ms-sm`}),` `,t.auth.email??t.auth.label]}),n&&t.usage&&t.usage.size>0&&(0,S.jsxs)(`span`,{className:`chip usage`,title:`${t.usage.used.toLocaleString()} of ${t.usage.size.toLocaleString()} context tokens${t.usage.costUsd==null?``:` · $${t.usage.costUsd.toFixed(2)} so far`}`,children:[Math.round(100*t.usage.used/t.usage.size),`% ctx`,t.usage.costUsd!=null&&` · $${t.usage.costUsd.toFixed(2)}`]}),n&&a.map(e=>e.type===`select`?(0,S.jsx)(`select`,{className:`config-select`,value:e.value,disabled:r===e.id,title:e.description??e.name,onChange:t=>o(e,t.target.value),children:e.choices.map(e=>(0,S.jsxs)(`option`,{value:e.value,title:e.description,children:[e.group?`${e.group} · `:``,e.name]},e.value))},e.id):(0,S.jsxs)(`label`,{className:`chip config-bool`,title:e.description??e.name,children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:e.value,disabled:r===e.id,onChange:t=>o(e,t.target.checked)}),` `,e.name]},e.id))]})}function vi({b:e,chatId:t}){let[n,r]=(0,v.useState)({}),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(null),c=e.resolved===void 0&&!o;async function l(r){a(!0);try{let i=await fetch(`/api/chats/${t}/elicitation`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({requestId:e.requestId,action:r,...r===`accept`?{content:n}:{}})});i.ok||s((await i.json().catch(()=>({}))).error??`request failed (${i.status})`)}catch{}a(!1)}let u=(e,t)=>r(n=>({...n,[e]:t})),d=e.fields.some(e=>e.required&&(n[e.key]===void 0||n[e.key]===``));return(0,S.jsxs)(`div`,{className:`perm-card question-card ${c?`pending`:``}`,children:[(0,S.jsxs)(`div`,{className:`perm-title`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`question`}),` `,e.message]}),c?(0,S.jsxs)(`div`,{className:`question-fields`,children:[e.fields.map(e=>(0,S.jsxs)(`label`,{className:`question-field ${e.kind}${e.custom?` custom`:``}`,children:[(e.title||e.description)&&!e.custom&&(0,S.jsxs)(`span`,{className:`question-label`,children:[e.title&&(0,S.jsx)(`b`,{children:e.title}),e.description&&(0,S.jsxs)(`span`,{children:[` `,e.description]})]}),e.kind===`select`&&(0,S.jsx)(`div`,{className:`question-options`,children:e.options?.map(t=>(0,S.jsx)(`button`,{className:`perm-btn ${n[e.key]===t.value?`allow`:``}`,title:t.description,onClick:()=>u(e.key,t.value),children:t.label},t.value))}),e.kind===`multiselect`&&(0,S.jsx)(`div`,{className:`question-options`,children:e.options?.map(t=>{let r=n[e.key]??[],i=r.includes(t.value);return(0,S.jsx)(`button`,{className:`perm-btn ${i?`allow`:``}`,title:t.description,onClick:()=>u(e.key,i?r.filter(e=>e!==t.value):[...r,t.value]),children:t.label},t.value)})}),e.kind===`text`&&(0,S.jsx)(`input`,{type:`text`,placeholder:e.custom?`or type your own answer`:e.title??e.key,value:n[e.key]??``,onChange:t=>u(e.key,t.target.value)}),e.kind===`number`&&(0,S.jsx)(`input`,{type:`number`,value:n[e.key]??``,onChange:t=>u(e.key,t.target.value===``?``:Number(t.target.value))}),e.kind===`boolean`&&(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:n[e.key]===!0,onChange:t=>u(e.key,t.target.checked)}),` `,e.title??e.key]})]},e.key)),(0,S.jsxs)(`div`,{className:`perm-actions`,children:[(0,S.jsx)(`button`,{className:`perm-btn allow`,disabled:i||d,onClick:()=>l(`accept`),children:`answer`}),(0,S.jsx)(`button`,{className:`perm-btn deny`,disabled:i,onClick:()=>l(`decline`),children:`skip`})]})]}):(0,S.jsx)(`div`,{className:`perm-resolved`,children:o?`→ ${o}`:e.resolved?.action===`accept`?`→ ${Object.values(e.resolved.content??{}).filter(e=>e!==``&&e!==void 0&&!(Array.isArray(e)&&e.length===0)).map(e=>Array.isArray(e)?e.join(`, `):String(e)).join(` · `)||`answered`}`:e.resolved?.action===`decline`?`→ skipped`:`→ dismissed`})]})}function yi({b:e,chatId:t}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null),o=e.resolved===void 0&&!i;async function s(n){r(!0);try{let r=await fetch(`/api/chats/${t}/permission`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({requestId:e.requestId,optionId:n})});if(!r.ok){let e=await r.json().catch(()=>({}));a(e.error??`request failed (${r.status})`)}}catch{}r(!1)}return(0,S.jsxs)(`div`,{className:`perm-card ${o?`pending`:``}`,children:[(0,S.jsxs)(`div`,{className:`perm-title`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`permission`}),` `,e.title]}),o?(0,S.jsx)(`div`,{className:`perm-actions`,children:e.options.map(e=>(0,S.jsx)(`button`,{className:`perm-btn ${e.kind?.startsWith(`allow`)?`allow`:`deny`}`,disabled:n,onClick:()=>s(e.optionId),children:e.name},e.optionId))}):(0,S.jsx)(`div`,{className:`perm-resolved`,children:e.resolved?`→ ${e.options.find(t=>t.optionId===e.resolved)?.name??e.resolved}`:i?`→ ${i}`:`→ dismissed`})]})}function bi({id:e,busy:t,scope:n,channel:r,agentMap:i,commands:a=[],canSteer:o}){let[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)([]),[p,m]=(0,v.useState)(0),[h,g]=(0,v.useState)(!1);async function _(t){for(let n of Array.from(t)){m(e=>e+1);try{let t=await fetch(`/api/chats/${e}/attachments`,{method:`POST`,headers:{"content-type":n.type||`application/octet-stream`,"x-file-name":encodeURIComponent(n.name||`pasted.png`)},body:n}),r=await t.json();t.ok?f(e=>[...e,{...r,...n.type.startsWith(`image/`)?{preview:URL.createObjectURL(n)}:{}}]):u(r.error??`upload failed (${t.status})`)}catch{u(`upload failed`)}finally{m(e=>e-1)}}}let[y,b]=(0,v.useState)([]),[x,w]=(0,v.useState)(0),[T,E]=(0,v.useState)(!1),[D,O]=(0,v.useState)(Zr),[k,ee]=(0,v.useState)(!1),A=(0,v.useRef)(null),j=(0,v.useRef)(null),te=t&&!r&&!!o,M=t&&!r&&!o;(0,v.useEffect)(()=>{let e=!0;return(async()=>{try{let t=(await fetch(`/api/skills`).then(e=>e.json())).skills??[];if(n?.kind===`agent`){let[e,r]=await Promise.all([fetch(`/api/agents/${encodeURIComponent(n.slug)}`).then(e=>e.ok?e.json():null).catch(()=>null),fetch(`/api/agents/${encodeURIComponent(n.slug)}/skills`).then(e=>e.ok?e.json():null).catch(()=>null)]);if(e&&Array.isArray(e.skills)){let n=new Set(e.skills.map(e=>e.toLowerCase()));t=t.filter(e=>n.has(e.name.toLowerCase()))}let i=r?.skills??[],a=new Set(i.map(e=>e.name.toLowerCase()));t=[...i,...t.filter(e=>!a.has(e.name.toLowerCase()))]}e&&b(t)}catch{}})(),()=>{e=!1}},[e]);let ne=/^\/([\w-]*)$/.exec(s)?.[1],N=ne!==void 0&&!T?y.filter(e=>e.name.toLowerCase().startsWith(ne.toLowerCase())):[],P=new Set(y.map(e=>e.name.toLowerCase())),re=ne!==void 0&&!T?a.filter(e=>e.name.toLowerCase().startsWith(ne.toLowerCase())&&!P.has(e.name.toLowerCase())):[],F=A.current?.selectionStart??s.length,ie=r&&!T?/(^|\s)@([a-z0-9-]*)$/i.exec(s.slice(0,F)):null,ae=ie&&r?r.members.filter(e=>e.startsWith(ie[2].toLowerCase())||(i?.get(e)?.name??``).toLowerCase().startsWith(ie[2].toLowerCase())):[],I=[...N.map(e=>({id:`/${e.name}`,label:`/${e.name}`,hint:e.description,src:e.source,pick:()=>{c(`/${e.name} `),w(0)}})),...re.map(e=>({id:`/${e.name}`,label:`/${e.name}${e.hint?` ${e.hint}`:``}`,hint:e.description,src:`agent`,pick:()=>{c(`/${e.name} `),w(0)}})),...ae.map(e=>({id:`@${e}`,label:`${i?.get(e)?.emoji??`🤖`} @${e}`,hint:i?.get(e)?.name,pick:()=>{let t=s.slice(0,F).replace(/@[a-z0-9-]*$/i,`@${e} `);c(t+s.slice(F)),w(0),requestAnimationFrame(()=>{let e=A.current;e&&(e.selectionStart=e.selectionEnd=t.length)})}}))].slice(0,15),L=I.length>0,oe=Math.min(x,I.length-1);async function se(){let t=s.trim();if(!t&&d.length===0||M||p>0)return;let n=d.map(({preview:e,...t})=>t);c(``),f([]),u(null);let i=await fetch(`/api/chats/${e}/${te?`steer`:`message`}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:t,...n.length?{attachments:n}:{},...r?{from:D||`you`}:{}})}).catch(()=>null);i&&!i.ok&&(u((await i.json().catch(()=>({}))).error??`not sent (${i.status})`),c(t),f(d))}return(0,S.jsxs)(`div`,{className:`composer${h?` dragging`:``}`,onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),g(!0))},onDragLeave:()=>g(!1),onDrop:e=>{e.dataTransfer.files.length&&(e.preventDefault(),g(!1),_(e.dataTransfer.files))},children:[d.length>0&&(0,S.jsxs)(`div`,{className:`composer-files`,children:[d.map(e=>(0,S.jsxs)(`span`,{className:`file-chip`,title:`${e.name} · ${Math.round(e.size/1024)} KB`,children:[e.preview?(0,S.jsx)(`img`,{src:e.preview,alt:e.name}):(0,S.jsx)(C,{name:`attach_file`,className:`ms-sm`}),e.name.replace(/^\d{8}-\d{6}-/,``),(0,S.jsx)(`button`,{title:`remove`,onClick:()=>f(t=>t.filter(t=>t.name!==e.name)),children:(0,S.jsx)(C,{name:`close`,className:`ms-sm`})})]},e.name)),p>0&&(0,S.jsx)(`span`,{className:`file-chip`,children:`uploading…`})]}),r&&(0,S.jsxs)(`div`,{className:`composer-me`,children:[`posting as`,` `,k?(0,S.jsx)(`input`,{autoFocus:!0,value:D,placeholder:`your name`,onChange:e=>O(e.target.value),onBlur:()=>{Qr(D.trim()),ee(!1)},onKeyDown:e=>{(e.key===`Enter`||e.key===`Escape`)&&e.target.blur()}}):(0,S.jsxs)(`button`,{className:`me-name`,onClick:()=>ee(!0),title:`change your name`,children:[D||`you`,` `,(0,S.jsx)(C,{name:`edit`,className:`ms-sm`})]})]}),L&&(0,S.jsx)(`div`,{className:`skill-menu`,children:I.map((e,t)=>(0,S.jsxs)(`button`,{className:t===oe?`active`:``,onMouseDown:t=>{t.preventDefault(),e.pick()},children:[(0,S.jsx)(`b`,{children:e.label}),e.hint&&(0,S.jsxs)(`span`,{children:[` — `,e.hint]}),e.src&&(0,S.jsx)(`span`,{className:`skill-src`,children:e.src})]},e.id))}),l&&(0,S.jsx)(`div`,{className:`composer-problem`,children:l}),(0,S.jsx)(`textarea`,{ref:A,value:s,placeholder:M?`agent is working…`:te?`agent is working — a message now steers it mid-turn`:r?`message the channel · @ to mention an agent, / for skills, Enter to send`:`message · Enter to send, Shift+Enter for newline, / for skills, drop or paste files`,rows:Math.min(6,Math.max(1,s.split(`
79
- `).length)),onChange:e=>{c(e.target.value),w(0),E(!1)},onPaste:e=>{let t=Array.from(e.clipboardData.items).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>!!e);t.length&&(e.preventDefault(),_(t))},onKeyDown:e=>{if(L){if(e.key===`ArrowDown`)return e.preventDefault(),w((oe+1)%I.length);if(e.key===`ArrowUp`)return e.preventDefault(),w((oe-1+I.length)%I.length);if(e.key===`Tab`||e.key===`Enter`)return e.preventDefault(),I[oe].pick();if(e.key===`Escape`)return e.preventDefault(),E(!0)}e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),se())}}),t&&(0,S.jsxs)(`button`,{className:`stop-btn`,onClick:()=>fetch(`/api/chats/${e}/cancel`,{method:`POST`}).catch(()=>{}),children:[(0,S.jsx)(C,{name:`stop`,className:`ms-sm`}),` stop`]}),!M&&(0,S.jsx)(`button`,{className:`ws-btn attach-btn`,title:`attach files (or drop / paste them)`,onClick:()=>j.current?.click(),children:(0,S.jsx)(C,{name:`attach_file`,className:`ms-sm`})}),(0,S.jsx)(`input`,{ref:j,type:`file`,multiple:!0,hidden:!0,onChange:e=>{e.target.files?.length&&_(e.target.files),e.target.value=``}}),!M&&(0,S.jsxs)(`button`,{className:`run-btn`,disabled:!s.trim()&&d.length===0||p>0,onClick:se,title:te?`hand this into the running turn`:void 0,children:[(0,S.jsx)(C,{name:te?`alt_route`:`send`,className:`ms-sm`}),` `,te?`steer`:`send`]})]})}function xi({id:e,workflow:t}){let n=B(`/api/runs`,!0),r=n?.runs??[],[i,a]=(0,v.useState)(t??``),o=(0,v.useMemo)(()=>{let e=i.trim().toLowerCase();return e?r.filter(t=>[t.workflow,t.request,t.id].some(t=>t?.toLowerCase().includes(e))):r},[r,i]);return(0,S.jsxs)(`div`,{className:`runs-screen`,children:[(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsx)(M,{href:`/workflows`,className:`side-back`,title:`back to workflows`,children:(0,S.jsx)(C,{name:`arrow_back`,className:`ms-sm`})}),(0,S.jsx)(`span`,{className:`microlabel`,children:`runs`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`span`,{className:`microlabel num`,children:i?`${o.length} / ${r.length}`:r.length})]}),(0,S.jsxs)(`label`,{className:`side-filter`,children:[(0,S.jsx)(C,{name:`filter_list`,className:`ms-sm`}),(0,S.jsx)(`input`,{type:`search`,value:i,placeholder:`filter by workflow or request`,"aria-label":`filter runs`,onChange:e=>a(e.target.value)})]}),(0,S.jsxs)(`div`,{className:`side-list`,children:[o.map(t=>(0,S.jsx)(Si,{r:t,active:t.id===e},t.id)),n&&r.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no runs yet`}),r.length>0&&o.length===0&&(0,S.jsxs)(`div`,{className:`viewer-note`,children:[`no run matches “`,i,`”`]})]})]}),(0,S.jsx)(`div`,{className:`runs-main`,children:(0,S.jsx)(Ci,{id:e},e)})]})}function Si({r:e,active:t}){return(0,S.jsxs)(M,{href:`/runs/${e.id}`,className:`side-row ${t?`active`:``}`,children:[(0,S.jsx)(Ee,{status:e.status}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsxs)(`div`,{className:`side-row-top`,children:[(0,S.jsx)(`span`,{className:`side-wf`,children:e.workflow??`unknown`}),(0,S.jsx)(`span`,{className:`side-when num`,children:Ce(e.startedAt)})]}),(0,S.jsxs)(`div`,{className:`side-row-sub`,children:[(0,S.jsx)(`span`,{className:`side-req`,title:e.request,children:e.status===`running`&&e.currentPhase?`${e.currentPhase}`:e.request??``}),(0,S.jsx)(`span`,{className:`side-meta num`,children:e.status===`running`?(0,S.jsx)(Te,{since:e.startedAt}):ye(e.durationMs)})]})]})]})}function Ci({id:e}){let t=B(`/api/runs/${e}`,!0),n=t?.status===`running`,[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(null),l=F();if(!t)return(0,S.jsx)(`div`,{className:`empty`,children:`loading…`});let u=t.files.some(e=>e.name===`runner.json`),d=r??(n?`run`:`artifacts`),f=l?t.files.length:t.files.filter(e=>!W(e.name)).length;async function p(){o(!0),c(null);let t=await fetch(`/api/runs/${e}/stop`,{method:`POST`}).catch(()=>null);t?.ok||(o(!1),c((await t?.json().catch(()=>null))?.error??`stop failed`))}async function m(){if(!window.confirm(`Remove run ${e} and all its files?`))return;c(null);let n=await fetch(`/api/runs/${e}`,{method:`DELETE`}).catch(()=>null);if(n?.ok){j(t?.workflow?`/workflows/${encodeURIComponent(t.workflow)}`:`/workflows`);return}c((await n?.json().catch(()=>null))?.error??`remove failed`)}return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`detail-head`,children:[(0,S.jsx)(Ee,{status:t.status}),(0,S.jsx)(`h1`,{children:t.workflow?(0,S.jsx)(M,{href:`/workflows/${encodeURIComponent(t.workflow)}`,title:`open workflow`,children:t.workflow}):`unknown workflow`}),(0,S.jsx)(De,{status:t.status}),u&&(0,S.jsxs)(`span`,{className:`chip sandbox-chip`,children:[(0,S.jsx)(C,{name:`science`,className:`ms-sm`}),` sandbox`]}),(0,S.jsx)(`span`,{className:`rid`,children:e.replace(/^run-/,``)}),n?(0,S.jsx)(`button`,{className:`stop-btn`,onClick:p,disabled:a,children:a?`stopping…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`stop`,className:`ms-sm`}),` stop`]})}):(0,S.jsxs)(`button`,{className:`stop-btn`,onClick:m,title:`delete this run's folder`,children:[(0,S.jsx)(C,{name:`delete`,className:`ms-sm`}),` remove`]}),s&&(0,S.jsx)(`span`,{className:`run-action-error`,children:s}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`button`,{className:`open-raw`,title:`chat with an agent about this run`,onClick:()=>void ei(`claude`,{kind:`run`,runId:e}),children:`⌬ discuss`}),(0,S.jsxs)(`nav`,{className:`tabs`,children:[(0,S.jsx)(`button`,{className:d===`run`?`active`:``,onClick:()=>i(`run`),children:`run`}),(0,S.jsxs)(`button`,{className:d===`artifacts`?`active`:``,onClick:()=>i(`artifacts`),children:[`artifacts `,(0,S.jsxs)(`span`,{className:`num`,children:[`(`,f,`)`]})]})]})]}),t.request&&(0,S.jsx)(`p`,{className:`detail-req`,children:t.request}),d===`run`?(0,S.jsx)(wi,{run:t,live:n}):(0,S.jsx)(ki,{id:e,files:t.files,live:n})]})}function wi({run:e,live:t}){return(0,S.jsxs)(`div`,{className:`run-tab`,children:[e.decision&&(0,S.jsx)(Oe,{runId:e.id,decision:e.decision}),(0,S.jsxs)(`div`,{className:`statgrid`,children:[(0,S.jsxs)(`div`,{className:`stat`,children:[(0,S.jsx)(`div`,{className:`microlabel`,children:`phases`}),(0,S.jsxs)(`div`,{className:`v num`,children:[e.phasesDone,e.phasesTotal==null?``:` / ${e.phasesTotal}`]})]}),(0,S.jsxs)(`div`,{className:`stat`,children:[(0,S.jsx)(`div`,{className:`microlabel`,children:`duration`}),(0,S.jsx)(`div`,{className:`v num`,children:t?(0,S.jsx)(Te,{since:e.startedAt}):ye(e.durationMs)})]}),(0,S.jsxs)(`div`,{className:`stat`,children:[(0,S.jsx)(`div`,{className:`microlabel`,children:`cost`}),(0,S.jsx)(`div`,{className:`v num`,children:be(e.costUsd??Ei(e.phases))})]}),(0,S.jsxs)(`div`,{className:`stat`,children:[(0,S.jsx)(`div`,{className:`microlabel`,children:`tokens in / out`}),(0,S.jsxs)(`div`,{className:`v num`,children:[xe(Ti(e.phases,`tokensIn`)),` / `,xe(Ti(e.phases,`tokensOut`))]})]})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`phase timeline`}),(0,S.jsx)(`span`,{className:`spacer`}),t&&(0,S.jsxs)(`span`,{className:`live-note`,children:[(0,S.jsx)(`span`,{className:`lamp running`}),` live · polling`]})]}),(0,S.jsx)(`div`,{className:`phases`,children:e.phases.map(e=>(0,S.jsx)(Di,{p:e},e.phase))})]})]})}function Ti(e,t){return e.reduce((e,n)=>e+(n[t]??0),0)}function Ei(e){return e.reduce((e,t)=>e+(t.costUsd??0),0)}function Di({p:e}){let t=e.gates.filter(e=>!e.passed);return(0,S.jsxs)(`div`,{className:`phase-row`,children:[(0,S.jsx)(Ee,{status:e.status}),(0,S.jsxs)(`div`,{className:`phase-top`,children:[(0,S.jsx)(`span`,{className:`phase-name`,children:e.phase}),e.kind===`agent`?(0,S.jsxs)(`span`,{className:`chip agent`,children:[e.agent,e.model?` · ${e.model}`:``,e.protocol?` · ${e.protocol}`:``]}):(0,S.jsx)(`span`,{className:`chip`,children:`script`}),e.status===`skipped`&&(0,S.jsx)(`span`,{className:`chip status skipped`,children:`skipped`}),(0,S.jsxs)(`span`,{className:`right num`,children:[e.attempts>1&&(0,S.jsxs)(`span`,{children:[`att `,e.attempts]}),e.status===`running`?(0,S.jsx)(Te,{since:e.startedAt}):e.durationMs!=null&&(0,S.jsx)(`span`,{children:ye(e.durationMs)}),e.kind===`agent`&&e.tokensIn!=null&&(0,S.jsxs)(`span`,{children:[xe(e.tokensIn),` / `,xe(e.tokensOut)]}),e.costUsd!=null&&e.costUsd>0&&(0,S.jsx)(`span`,{children:be(e.costUsd)})]})]}),e.status===`running`&&e.lastActivity&&(0,S.jsx)(`div`,{className:`phase-activity`,children:e.lastActivity}),e.summary&&e.status!==`running`&&(0,S.jsx)(`div`,{className:`phase-sub`,children:e.summary}),e.gates.length>0&&(0,S.jsx)(`div`,{className:`gate-line`,children:e.gates.map(e=>(0,S.jsxs)(`span`,{className:`gate ${e.passed?``:`failed`}`,title:e.failure??``,children:[(0,S.jsx)(C,{name:e.passed?`check`:`close`,className:`ms-sm`}),` `,e.gate]},e.gate))}),t.map(e=>(0,S.jsx)(`div`,{className:`gate-fail-msg`,children:e.failure},e.gate))]})}var Oi=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`]);function W(e){return e===`runner.json`||e.endsWith(`.jsonl`)||e.endsWith(`.log`)}function G(e){let t=[`report.html`,`recommendation.md`].find(t=>e.some(e=>e.name===t));if(t)return t;let n=e=>{let t=e.split(`.`).pop()?.toLowerCase()??``;return[`html`,`md`,`markdown`,`pdf`].includes(t)||Oi.has(t)?0:W(e)?2:1},r=null;for(let t of e)(!r||n(t.name)<n(r.name))&&(r=t);return r?.name??null}function ki({id:e,files:t,live:n}){let[r,i]=(0,v.useState)(null),a=F(),o=(0,v.useMemo)(()=>a?t:t.filter(e=>!W(e.name)),[t,a]);return(0,v.useEffect)(()=>{!a&&r&&W(r)&&i(null)},[a,r]),(0,v.useEffect)(()=>{r||o.length===0||i(G(o))},[o,r]),(0,S.jsxs)(`div`,{className:`art-layout`,children:[(0,S.jsxs)(`section`,{className:`panel art-files`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsxs)(`span`,{className:`microlabel`,children:[`files `,(0,S.jsxs)(`span`,{className:`num`,children:[`(`,o.length,`)`]})]})}),(0,S.jsxs)(`div`,{className:`file-list`,children:[o.map(e=>(0,S.jsxs)(`button`,{className:`file-row ${r===e.name?`active`:``}`,onClick:()=>i(e.name),children:[(0,S.jsx)(`span`,{className:`fname`,children:e.name}),(0,S.jsx)(`span`,{className:`fsize num`,children:Se(e.size)})]},e.name)),o.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:t.length>0?`no result files — raw run files live in expert mode`:`no files yet`})]})]}),(0,S.jsxs)(`section`,{className:`panel art-viewer`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:r??`viewer`}),(0,S.jsx)(`span`,{className:`spacer`}),r&&(0,S.jsx)(`a`,{className:`open-raw`,href:`/api/runs/${e}/file?name=${encodeURIComponent(r)}&raw=1`,target:`_blank`,children:`open raw ↗`})]}),r?(0,S.jsx)(Ai,{id:e,name:r,live:n}):(0,S.jsx)(`div`,{className:`empty`,children:`select a file`})]})]})}function Ai({id:e,name:t,live:n}){let r=t.split(`.`).pop()?.toLowerCase()??``,i=`/api/runs/${e}/file?name=${encodeURIComponent(t)}&raw=1`;return r===`html`?(0,S.jsx)(`div`,{className:`viewer`,children:(0,S.jsx)(`div`,{className:`viewer-body`,children:(0,S.jsx)(`iframe`,{src:i,sandbox:`allow-scripts`,allow:`clipboard-write`,title:t})})}):r===`pdf`?(0,S.jsx)(`div`,{className:`viewer`,children:(0,S.jsx)(`div`,{className:`viewer-body`,children:(0,S.jsx)(`iframe`,{src:i,title:t})})}):Oi.has(r)?(0,S.jsx)(`div`,{className:`viewer`,children:(0,S.jsx)(`div`,{className:`viewer-body`,children:(0,S.jsx)(`img`,{src:i,alt:t})})}):r===`md`||r===`markdown`?(0,S.jsx)(ji,{id:e,name:t,live:n}):(0,S.jsx)(Mi,{id:e,name:t,live:n})}function ji({id:e,name:t,live:n}){let[r,i]=(0,v.useState)(`rendered`),a=B(`/api/runs/${e}/file?name=${encodeURIComponent(t)}`,n),o=(0,v.useMemo)(()=>a?Rr.sanitize(H.parse(a.content,{async:!1})):``,[a?.content]);return(0,S.jsxs)(`div`,{className:`viewer`,children:[(0,S.jsxs)(`div`,{className:`viewer-note md-toolbar`,children:[(0,S.jsxs)(`div`,{className:`tabs`,children:[(0,S.jsx)(`button`,{className:r===`rendered`?`active`:``,onClick:()=>i(`rendered`),children:`rendered`}),(0,S.jsx)(`button`,{className:r===`source`?`active`:``,onClick:()=>i(`source`),children:`source`})]}),a?.truncated&&(0,S.jsxs)(`span`,{children:[`large file — showing the last `,Se(4e5)]})]}),(0,S.jsx)(`div`,{className:`viewer-body`,children:a?r===`rendered`?(0,S.jsx)(`div`,{className:`md-body`,dangerouslySetInnerHTML:{__html:o}}):(0,S.jsx)(`pre`,{children:a.content||`(empty)`}):(0,S.jsx)(`pre`,{children:`loading…`})})]})}function Mi({id:e,name:t,live:n}){let r=B(`/api/runs/${e}/file?name=${encodeURIComponent(t)}`,n);return(0,S.jsxs)(`div`,{className:`viewer`,children:[r?.truncated&&(0,S.jsxs)(`div`,{className:`viewer-note`,children:[`large file — showing the last `,Se(4e5)]}),(0,S.jsx)(`div`,{className:`viewer-body`,children:(0,S.jsx)(`pre`,{children:r?r.content||`(empty)`:`loading…`})})]})}function Ni(){return B(`/api/workflows/any/run`,!1,15e3)}var Pi=e=>!!e?.available&&!!e?.image;function Fi(e){return e?e.available?e.image?`isolated container per run`:"image missing — run `kraftwerk runner build`":`Docker is not running`:``}async function Ii(e,t){let n=await fetch(`/api/workflows/${encodeURIComponent(e)}/run`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),r=await n.json();if(!n.ok)throw Error(r.error??`HTTP ${n.status}`);return r.runId}function Li(e,t,n,r){let[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(!0),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(null),m=Ni();(0,v.useEffect)(()=>{!i&&n&&a(n)},[n]),(0,v.useEffect)(()=>{m&&!Pi(m)&&s(!1)},[m]);let h=!u&&(!t||!!i.trim())&&(!o||Pi(m));async function g(){if(h){d(!0),p(null);try{let t=await Ii(e,{request:i.trim(),sandbox:o,ssh:c});r?(r(t),d(!1)):j(`/runs/${t}`)}catch(e){p(e.message),d(!1)}}}return{request:i,setRequest:a,sandbox:o,setSandbox:s,ssh:c,setSsh:l,busy:u,error:f,docker:m,canRun:h,launch:g}}function Ri({slug:e,usesRequest:t,initialRequest:n,onLaunched:r}){let i=Li(e,t,n,r);return(0,S.jsxs)(`div`,{className:`run-launcher`,children:[(0,S.jsxs)(`div`,{className:`run-launcher-main`,children:[t?(0,S.jsxs)(`label`,{className:`m3-field`,children:[(0,S.jsx)(`input`,{type:`text`,value:i.request,placeholder:` `,"aria-label":`request`,onChange:e=>i.setRequest(e.target.value),onKeyDown:e=>e.key===`Enter`&&i.launch()}),(0,S.jsx)(`span`,{className:`m3-field-label`,children:`Request`})]}):(0,S.jsx)(`span`,{className:`run-norequest`,children:`This workflow takes no request.`}),(0,S.jsxs)(`button`,{className:`m3-filled-btn run-go`,onClick:i.launch,disabled:!i.canRun,children:[(0,S.jsx)(C,{name:`play_arrow`}),` `,i.busy?`Starting…`:`Run`]})]}),(0,S.jsxs)(`div`,{className:`m3-switches run-switches`,children:[(0,S.jsx)(zi,{label:`Docker sandbox`,hint:Fi(i.docker),checked:i.sandbox,onChange:i.setSandbox}),i.sandbox&&(0,S.jsx)(zi,{label:`Forward SSH agent`,hint:`keys and known hosts from this machine`,checked:i.ssh,onChange:i.setSsh})]}),i.error&&(0,S.jsx)(`div`,{className:`m3-error`,children:i.error})]})}function zi({label:e,hint:t,checked:n,onChange:r}){return(0,S.jsxs)(`button`,{type:`button`,className:`m3-switch-row`,role:`switch`,"aria-checked":n,onClick:()=>r(!n),children:[(0,S.jsxs)(`span`,{className:`m3-switch-text`,children:[(0,S.jsx)(`span`,{className:`m3-switch-label`,children:e}),t&&(0,S.jsx)(`span`,{className:`m3-switch-hint`,children:t})]}),(0,S.jsx)(`span`,{className:`m3-switch ${n?`on`:``}`,"aria-hidden":!0,children:(0,S.jsx)(`span`,{className:`m3-switch-knob`})})]})}function Bi(e,t){let n=e.filter(e=>e.workflow===(t.name??t.slug));return{count:n.length,last:n[0]}}function Vi(e,t){return`/runs/${e.id}?workflow=${encodeURIComponent(t.name??t.slug)}`}function Hi(){let e=B(`/api/workflows`,!1),t=B(`/api/runs`,!1),n=Ni(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(null),d=e?.workflows??[],f=t?.runs??[],p=(0,v.useMemo)(()=>{let e=r.trim().toLowerCase();return e?d.filter(t=>[t.name,t.slug,t.description].some(t=>t?.toLowerCase().includes(e))):d},[d,r]);async function m(e){if(e.usesRequest)return o(e);c(e.slug),u(null);try{j(`/runs/${await Ii(e.slug,{request:``,sandbox:Pi(n),ssh:!1})}`)}catch(t){u(`${e.name??e.slug}: ${t.message}`),c(null)}}return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`page-head`,children:[(0,S.jsx)(`h1`,{children:`Workflows`}),(0,S.jsxs)(`nav`,{className:`tabs`,"aria-label":`workflows sections`,children:[(0,S.jsxs)(M,{href:`/workflows`,className:`active`,children:[`workflows `,(0,S.jsxs)(`span`,{className:`num`,children:[`(`,d.length,`)`]})]}),(0,S.jsxs)(M,{href:`/runs`,children:[`runs `,(0,S.jsxs)(`span`,{className:`num`,children:[`(`,f.length,`)`]})]})]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`label`,{className:`wf-search`,children:[(0,S.jsx)(C,{name:`search`}),(0,S.jsx)(`input`,{type:`search`,value:r,placeholder:`search workflows`,"aria-label":`search workflows`,onChange:e=>i(e.target.value)})]})]}),l&&(0,S.jsx)(`div`,{className:`gate-fail-msg wf-error`,children:l}),e&&d.length===0&&(0,S.jsxs)(`div`,{className:`empty`,children:[`No workflows found — expected `,(0,S.jsx)(`code`,{children:`src/workflows/`}),` or `,(0,S.jsx)(`code`,{children:`workflows/`}),` `,`next to the output folder.`]}),d.length>0&&(0,S.jsxs)(`div`,{className:`wf-list`,role:`list`,children:[p.map(e=>{let t=Bi(f,e);return(0,S.jsxs)(`div`,{className:`wf-row`,role:`listitem`,children:[(0,S.jsx)(Ee,{status:t.last?.status??`idle`}),(0,S.jsxs)(`div`,{className:`wf-row-main`,children:[(0,S.jsxs)(`div`,{className:`wf-row-top`,children:[(0,S.jsx)(M,{href:`/workflows/${encodeURIComponent(e.slug)}`,className:`wf-name`,children:e.name??e.slug}),e.error&&(0,S.jsx)(`span`,{className:`status-word failed`,children:`broken`}),(0,S.jsxs)(`span`,{className:`wf-meta num`,children:[e.agents,` agents · `,e.steps,` steps`,e.usesRequest?``:` · no request`]})]}),(0,S.jsx)(`p`,{className:`wf-desc`,title:e.error??e.description??``,children:e.error??e.description??``})]}),t.last?(0,S.jsxs)(M,{href:Vi(t.last,e),className:`wf-runs`,title:`show the runs of this workflow`,children:[(0,S.jsx)(C,{name:`history`,className:`ms-sm`}),(0,S.jsxs)(`span`,{className:`num`,children:[t.count,` `,t.count===1?`run`:`runs`]}),(0,S.jsxs)(`span`,{className:`wf-last`,children:[`· `,(0,S.jsx)(De,{status:t.last.status}),` `,we(t.last.updatedAt)]})]}):(0,S.jsx)(`span`,{className:`wf-runs none num`,children:`no runs yet`}),(0,S.jsx)(`button`,{className:`run-btn wf-run`,disabled:!!e.error||s===e.slug,title:e.usesRequest?`run with a request…`:`run now`,onClick:()=>void m(e),children:s===e.slug?`starting…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`play_arrow`,className:`ms-sm`}),` run`,e.usesRequest?`…`:``]})})]},e.slug)}),p.length===0&&(0,S.jsxs)(`div`,{className:`viewer-note wf-nomatch`,children:[`no workflow matches “`,r,`”`]})]}),a&&(0,S.jsx)(Ui,{w:a,lastRequest:Bi(f,a).last?.request,onClose:()=>o(null)})]})}function Ui({w:e,lastRequest:t,onClose:n}){let r=Li(e.slug,e.usesRequest,t),i=e.name??e.slug;return(0,v.useEffect)(()=>{let e=e=>e.key===`Escape`&&n();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]),(0,S.jsx)(`div`,{className:`dialog-backdrop`,onMouseDown:e=>e.target===e.currentTarget&&n(),children:(0,S.jsxs)(`div`,{className:`m3-dialog`,role:`dialog`,"aria-label":`Run ${i}`,"aria-describedby":`run-dialog-desc`,children:[(0,S.jsxs)(`h2`,{className:`m3-headline`,children:[`Run `,i]}),(0,S.jsxs)(`p`,{className:`m3-supporting`,id:`run-dialog-desc`,children:[e.description&&(0,S.jsxs)(S.Fragment,{children:[e.description,` `]}),(0,S.jsxs)(`span`,{className:`m3-facts num`,children:[e.agents,` agents · `,e.steps,` steps ·`,` `,(0,S.jsx)(M,{href:`/workflows/${encodeURIComponent(e.slug)}`,children:`details`})]})]}),(0,S.jsxs)(`label`,{className:`m3-field`,children:[(0,S.jsx)(`input`,{type:`text`,value:r.request,placeholder:` `,autoFocus:!0,"aria-label":`request`,onChange:e=>r.setRequest(e.target.value),onKeyDown:e=>e.key===`Enter`&&r.launch()}),(0,S.jsx)(`span`,{className:`m3-field-label`,children:`Request`}),(0,S.jsx)(`span`,{className:`m3-field-support`,children:`What the workflow should work on — a topic, URL, host …`})]}),(0,S.jsxs)(`div`,{className:`m3-switches`,children:[(0,S.jsx)(zi,{label:`Run in Docker sandbox`,hint:Fi(r.docker),checked:r.sandbox,onChange:r.setSandbox}),r.sandbox&&(0,S.jsx)(zi,{label:`Forward SSH agent`,hint:`keys and known hosts from this machine`,checked:r.ssh,onChange:r.setSsh})]}),r.error&&(0,S.jsx)(`div`,{className:`m3-error`,children:r.error}),(0,S.jsxs)(`div`,{className:`m3-actions`,children:[(0,S.jsx)(`button`,{className:`m3-text-btn`,onClick:n,children:`Cancel`}),(0,S.jsx)(`button`,{className:`m3-filled-btn`,onClick:r.launch,disabled:!r.canRun,children:r.busy?`Starting…`:`Run`})]})]})})}var Wi=`\0done`,Gi=5;function Ki(e,t){return e.status===`ok`?Wi:e.currentPhase&&t.includes(e.currentPhase)?e.currentPhase:t[0]??Wi}function qi({wf:e,runs:t,agentIdx:n,runsHref:r}){let i=e.steps.map(e=>e.name),a=new Map([...i,Wi].map(e=>[e,[]]));for(let e of t)a.get(Ki(e,i)).push(e);let o=a.get(Wi)??[];return(0,S.jsxs)(`div`,{className:`board`,children:[e.steps.map((e,t)=>{let i=e.agent?n.get(e.agent)??0:null,o=a.get(e.name)??[];return(0,S.jsxs)(`div`,{className:`board-col`,"data-step":e.name,children:[(0,S.jsxs)(`div`,{className:`board-col-head`,children:[(0,S.jsx)(`span`,{className:`step-index num ${i==null?`is-script`:`aid-${i}`}`,children:t+1}),(0,S.jsx)(`span`,{className:`board-col-name`,title:e.name,children:e.name}),(0,S.jsx)(`span`,{className:`board-col-count num`,children:o.length})]}),(0,S.jsx)(Ji,{cards:o,moreHref:r})]},e.name)}),(0,S.jsxs)(`div`,{className:`board-col is-done`,"data-step":`done`,children:[(0,S.jsxs)(`div`,{className:`board-col-head`,children:[(0,S.jsx)(`span`,{className:`step-index`,children:`✓`}),(0,S.jsx)(`span`,{className:`board-col-name`,children:`done`}),(0,S.jsx)(`span`,{className:`board-col-count num`,children:o.length})]}),(0,S.jsx)(Ji,{cards:o,moreHref:r})]})]})}function Ji({cards:e,moreHref:t}){return(0,S.jsxs)(`div`,{className:`board-col-cards`,children:[e.slice(0,Gi).map(e=>(0,S.jsx)(Yi,{r:e},e.id)),e.length===0&&(0,S.jsx)(`div`,{className:`board-col-empty`,children:`—`}),e.length>Gi&&(0,S.jsxs)(M,{href:t,className:`board-more`,children:[`+ `,e.length-Gi,` more ↗`]})]})}function Yi({r:e}){let t=e.request??e.id.replace(/^run-/,``);return(0,S.jsxs)(M,{href:`/runs/${e.id}`,className:`board-card is-${e.status}`,children:[(0,S.jsxs)(`div`,{className:`board-card-top`,children:[(0,S.jsx)(Ee,{status:e.status}),(0,S.jsx)(`span`,{className:`board-card-title`,title:t,children:t})]}),(0,S.jsxs)(`div`,{className:`board-card-meta num`,children:[(0,S.jsx)(`span`,{children:Ce(e.startedAt)}),(0,S.jsx)(`span`,{children:e.status===`running`?(0,S.jsx)(Te,{since:e.startedAt}):ye(e.durationMs)}),e.costUsd!=null&&e.costUsd>0&&(0,S.jsx)(`span`,{children:be(e.costUsd)})]}),e.awaitingDecision&&(0,S.jsx)(`span`,{className:`chip decision`,children:`decision needed`}),(e.status===`failed`||e.status===`aborted`)&&(0,S.jsx)(`span`,{className:`chip status ${e.status}`,children:e.status})]})}function Xi({slug:e,tab:t}){let n=B(`/api/workflows/${encodeURIComponent(e)}`,!1),[r,i]=(0,v.useState)(0),[a,o]=(0,v.useState)(0),s=B(`/api/runs`,a>0||Date.now()-r<2e4);if(!n)return(0,S.jsx)(`div`,{className:`empty`,children:`loading…`});if(n.error)return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)($i,{slug:n.slug}),(0,S.jsxs)(`div`,{className:`empty`,children:[(0,S.jsx)(`span`,{className:`status-word failed`,children:`broken workflow`}),(0,S.jsx)(`pre`,{style:{marginTop:12,textAlign:`left`},children:n.error})]})]});let c=new Map(n.agents.map((e,t)=>[e.id,t%4])),l=(s?.runs??[]).filter(e=>e.workflow===n.name||e.workflow===n.slug),u=`/workflows/${encodeURIComponent(n.slug)}`,d=l.filter(e=>e.status===`running`).length;return d!==a&&o(d),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)($i,{slug:n.slug}),(0,S.jsxs)(`div`,{className:`detail-head`,children:[(0,S.jsx)(`h1`,{children:n.name??n.slug}),(0,S.jsx)(`span`,{className:`rid mono`,children:n.dir}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`nav`,{className:`tabs`,"aria-label":`workflow sections`,children:[(0,S.jsx)(M,{href:u,className:t===`overview`?`active`:``,children:`overview`}),(0,S.jsx)(M,{href:`${u}/details`,className:t===`details`?`active`:``,children:`details`}),(0,S.jsxs)(M,{href:`${u}/runs`,className:t===`runs`?`active`:``,children:[`runs `,(0,S.jsxs)(`span`,{className:`num`,children:[`(`,l.length,`)`]})]})]})]}),n.description&&(0,S.jsx)(`p`,{className:`detail-req`,children:n.description}),t===`overview`&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`section`,{className:`panel run-panel`,style:{marginBottom:18},children:(0,S.jsx)(Ri,{slug:n.slug,usesRequest:n.usesRequest,initialRequest:l[0]?.request,onLaunched:()=>i(Date.now())})}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsxs)(`span`,{className:`microlabel`,children:[`board`,` `,(0,S.jsxs)(`span`,{className:`num`,children:[`(`,l.length,` runs`,d>0?`, ${d} live`:``,`)`]})]}),(0,S.jsx)(`span`,{className:`spacer`}),l[0]&&(0,S.jsx)(M,{href:`${u}/runs`,className:`open-raw`,children:`all runs ↗`})]}),(0,S.jsx)(qi,{wf:n,runs:l,agentIdx:c,runsHref:`${u}/runs`})]})]}),t===`details`&&(0,S.jsx)(Zi,{wf:n,agentIdx:c}),t===`runs`&&(0,S.jsx)(Qi,{runs:l})]})}function Zi({wf:e,agentIdx:t}){return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`statgrid`,children:[(0,S.jsxs)(`div`,{className:`stat`,children:[(0,S.jsx)(`div`,{className:`microlabel`,children:`agents`}),(0,S.jsx)(`div`,{className:`v num`,children:e.agents.length})]}),(0,S.jsxs)(`div`,{className:`stat`,children:[(0,S.jsx)(`div`,{className:`microlabel`,children:`steps`}),(0,S.jsxs)(`div`,{className:`v num`,children:[e.steps.length,` `,(0,S.jsxs)(`span`,{style:{color:`var(--muted)`,fontWeight:400},children:[`(`,e.steps.filter(e=>e.kind===`agent`).length,` agent ·`,` `,e.steps.filter(e=>e.kind===`script`).length,` script)`]})]})]}),e.workspace&&(0,S.jsxs)(`div`,{className:`stat`,style:{maxWidth:420},children:[(0,S.jsx)(`div`,{className:`microlabel`,children:`workspace`}),(0,S.jsx)(`div`,{className:`wf-workspace mono`,children:e.workspace})]})]}),(0,S.jsxs)(`section`,{className:`panel`,style:{marginBottom:18},children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`agents`})}),(0,S.jsxs)(`div`,{className:`agent-grid`,children:[e.agents.map(e=>(0,S.jsx)(ea,{a:e,idx:t.get(e.id)??0},e.id)),e.agents.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no agents — script-only workflow`})]})]}),(0,S.jsxs)(`div`,{className:`columns`,children:[(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`pipeline`})}),(0,S.jsx)(`div`,{className:`pipeline`,children:e.steps.map((e,n)=>(0,S.jsx)(ta,{s:e,i:n,idx:e.agent?t.get(e.agent)??0:null},e.name))})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsxs)(`span`,{className:`microlabel`,children:[`folder `,(0,S.jsxs)(`span`,{className:`num`,children:[`(`,e.files.length,` files)`]})]})}),(0,S.jsx)(`div`,{className:`file-list`,children:e.files.map(e=>(0,S.jsx)(`div`,{className:`file-row`,style:{cursor:`default`},children:(0,S.jsx)(`span`,{className:`fname`,children:e})},e))})]})]})]})}function Qi({runs:e}){return e.length===0?(0,S.jsx)(`div`,{className:`empty`,children:`no runs of this workflow yet`}):(0,S.jsx)(`div`,{className:`run-list`,children:e.map(e=>{let t=e.phasesTotal??0,n=t>0?Math.round(e.phasesDone/t*100):e.status===`ok`?100:0;return(0,S.jsxs)(M,{href:`/runs/${e.id}`,className:`run-card is-${e.status}`,children:[(0,S.jsx)(Ee,{status:e.status}),(0,S.jsx)(`span`,{className:`rid`,children:e.id.replace(/^run-/,``)}),(0,S.jsx)(`span`,{className:`req`,title:e.request,children:e.status===`running`&&e.currentPhase?e.currentPhase:e.request??``}),(0,S.jsxs)(`span`,{className:`meta`,children:[e.awaitingDecision&&(0,S.jsx)(`span`,{className:`chip decision`,children:`decision needed`}),(0,S.jsx)(De,{status:e.status}),(0,S.jsx)(`span`,{className:`progress-track`,title:`${e.phasesDone}${t?` / ${t}`:``} steps`,children:(0,S.jsx)(`i`,{style:{width:`${n}%`}})}),(0,S.jsx)(`span`,{className:`num`,children:e.status===`running`?(0,S.jsx)(Te,{since:e.startedAt}):ye(e.durationMs)}),(0,S.jsx)(`span`,{className:`num`,children:be(e.costUsd)}),(0,S.jsx)(`span`,{className:`num`,children:Ce(e.startedAt)})]})]},e.id)})})}function $i({slug:e}){return(0,S.jsxs)(`nav`,{className:`crumbs`,children:[(0,S.jsx)(M,{href:`/workflows`,children:`workflows`}),(0,S.jsx)(`span`,{className:`sep`,children:`/`}),(0,S.jsx)(`span`,{className:`mono`,children:e})]})}function ea({a:e,idx:t}){return(0,S.jsxs)(`div`,{className:`agent-card aid-${t}`,children:[(0,S.jsxs)(`div`,{className:`agent-head`,children:[(0,S.jsx)(`span`,{className:`agent-dot`}),(0,S.jsx)(`b`,{children:e.name??e.id}),(0,S.jsxs)(`code`,{className:`agent-id`,children:[`[`,e.id,`]`]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`span`,{className:`chip`,children:[e.model??`default`,e.effort?` · ${e.effort}`:``,e.protocol===`acp`?` · acp`:``]})]}),e.tools.length>0&&(0,S.jsx)(`div`,{className:`agent-tools`,children:e.tools.map(e=>(0,S.jsx)(`span`,{className:`tool-chip`,children:e},e))}),e.persona&&(0,S.jsx)(`p`,{className:`agent-persona`,children:e.persona})]})}function ta({s:e,i:t,idx:n}){let r=e.kind===`script`?e.script:e.prompt;return(0,S.jsxs)(`div`,{className:`step-node`,children:[(0,S.jsx)(`div`,{className:`step-index num ${n==null?`is-script`:`aid-${n}`}`,children:t+1}),(0,S.jsxs)(`div`,{className:`step-body`,children:[(0,S.jsxs)(`div`,{className:`phase-top`,children:[(0,S.jsx)(`span`,{className:`phase-name`,children:e.name}),e.kind===`agent`?(0,S.jsxs)(`span`,{className:`chip agent-chip aid-${n??0}`,children:[`agent · `,e.agent]}):(0,S.jsxs)(`span`,{className:`chip`,children:[`script`,e.sourceRef?` · ${e.sourceRef}`:``]})]}),r&&(0,S.jsxs)(`details`,{className:`step-source`,children:[(0,S.jsx)(`summary`,{children:e.kind===`agent`?`prompt`:`script`}),(0,S.jsx)(`pre`,{children:r})]}),e.gates.length>0&&(0,S.jsx)(`div`,{className:`gate-line`,children:e.gates.map(e=>(0,S.jsxs)(`span`,{className:`gate neutral`,children:[`⛨ `,e]},e))})]})]})}var na=e=>e===`ok`?`ok`:e===`running`?`running`:e===`aborted`?`aborted`:`failed`,ra=e=>e===`ok`?`done`:e===`running`?`working`:e===`aborted`?`stopped`:`failed`;function ia(e){return e.scope.kind===`channel`?`/channels/${e.scope.slug}`:e.scope.kind===`project`?`/projects/${e.scope.slug}/chat/${e.id}`:e.scope.kind===`agent`?`/agents/${e.scope.slug}/chat/${e.id}`:`/agents/chats/${e.id}`}function aa(e){switch(e.scope.kind){case`agent`:return e.scope.slug;case`channel`:return`#${e.scope.slug}`;case`run`:return e.scope.runId;case`knowledge`:return e.scope.bundle?`knowledge:${e.scope.bundle}`:`knowledge`;case`kraftwerk`:return`kraftwerk-aware`;case`project`:return`project:${e.scope.slug}`;default:return`general`}}function oa(e){return e.length>64?`${e.slice(0,46)}…${e.slice(-14)}`:e}function sa(){let e=B(`/api/runs`,!1),t=B(`/api/chats`,!1),n=B(`/api/knowledge`,!1),r=B(`/api/agents`,!1),i=B(`/api/workflows`,!1),a=B(`/api/skills`,!1),o=B(`/api/meta`,!1),[s,c]=(0,v.useState)(`all`),l=e?.runs??[],u=t?.chats??[],d=n?.bundles??[],f=(a?.skills??[]).filter(e=>e.source===`workspace`),p=[[i?.workflows.length,`workflows`,`/workflows`],[e?l.length:void 0,`runs`,`/runs`],[n?d.length:void 0,`bundles`,`/knowledge`],[a?f.length:void 0,`skills`,`/skills`],[t?u.length:void 0,`chats`,`/agents/chats`]],m=l.filter(e=>e.status===`failed`&&Date.now()-Date.parse(e.updatedAt)<864e5);return(0,S.jsxs)(`div`,{className:`dash`,children:[(0,S.jsxs)(`div`,{className:`page-head`,children:[(0,S.jsxs)(`h1`,{children:[o?.projectIcon?`${o.projectIcon} `:``,o?.projectName||`workspace`]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`span`,{className:`dash-mini`,children:p.map(([e,t,n])=>(0,S.jsxs)(M,{href:n,children:[(0,S.jsx)(`b`,{className:`num`,children:e??`…`}),` `,t]},t))}),(0,S.jsx)(ca,{workflows:i?.workflows??[]})]}),(0,S.jsx)(la,{agents:r?.agents.filter(e=>!e.archived),chats:u}),m.length>0&&s!==`failed`&&(0,S.jsxs)(`button`,{className:`dash-alert`,onClick:()=>c(`failed`),children:[`⚠ `,m.length,` run`,m.length===1?``:`s`,` failed in the last 24 h — review`]}),(0,S.jsx)(fa,{runs:l,chats:u,bundles:d,agents:r?.agents??[],workflows:i?.workflows??[],filter:s,setFilter:c})]})}function ca({workflows:e}){let[t,n]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{if(!t)return;let e=e=>{e.target.closest(`.wf-pick-wrap`)||n(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[t]),(0,S.jsxs)(`div`,{className:`dash-actions`,children:[(0,S.jsxs)(`button`,{className:`run-btn dash-newchat`,onClick:()=>j(`/agents/chats/new`),children:[(0,S.jsx)(C,{name:`forum`}),` new chat`]}),(0,S.jsxs)(`span`,{className:`wf-pick-wrap`,children:[(0,S.jsxs)(`button`,{className:`run-btn tonal`,"aria-haspopup":`menu`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,S.jsx)(C,{name:`play_arrow`}),` run workflow`]}),t&&(0,S.jsxs)(`div`,{className:`wf-pick-pop`,role:`menu`,children:[e.length===0&&(0,S.jsx)(`span`,{className:`wf-pick-empty`,children:`no workflows yet`}),e.map(e=>(0,S.jsxs)(M,{href:`/workflows/${encodeURIComponent(e.slug)}`,className:`wf-pick-item`,role:`menuitem`,children:[(0,S.jsx)(`span`,{className:`wf-pick-name`,children:e.name??e.slug}),e.description&&(0,S.jsx)(`span`,{className:`wf-pick-desc`,children:e.description})]},e.slug))]})]})]})}function la({agents:e,chats:t}){let n=F();return e&&e.length===0?(0,S.jsx)(`section`,{className:`panel dash-agents-empty`,children:(0,S.jsx)(`div`,{className:`viewer-note`,children:n?(0,S.jsxs)(S.Fragment,{children:[`No agents yet — `,(0,S.jsx)(M,{href:`/agents/new`,children:`create your first agent`}),` and it will show up here, ready to chat.`]}):(0,S.jsx)(S.Fragment,{children:`No agents yet — ask an expert-mode user to create one.`})})}):(0,S.jsx)(`div`,{className:`dash-agents`,children:(e??[]).map(e=>{let n=t.filter(t=>t.scope.kind===`agent`&&t.scope.slug===e.slug),r=n.find(e=>e.awaitingApproval),i=n.find(e=>e.busy),a=()=>j(`/agents/${encodeURIComponent(e.slug)}`);return(0,S.jsxs)(`div`,{className:`dash-agent`,role:`link`,tabIndex:0,onClick:a,onKeyDown:e=>{e.key===`Enter`&&a()},children:[(0,S.jsxs)(`div`,{className:`dash-agent-id`,children:[(0,S.jsxs)(`span`,{className:`agent-avatar lg`,children:[(0,S.jsx)(`span`,{"aria-hidden":!0,children:e.emoji}),(0,S.jsx)(`span`,{className:`lamp ${i?`running`:`idle`}`})]}),(0,S.jsx)(`span`,{className:`dash-agent-name`,children:e.name}),e.description&&(0,S.jsx)(`span`,{className:`dash-agent-desc`,children:e.description})]}),(0,S.jsxs)(`div`,{className:`dash-agent-foot`,children:[(0,S.jsx)(`span`,{className:`dash-agent-state`,children:r?(0,S.jsx)(M,{href:`/agents/${encodeURIComponent(e.slug)}/chat/${r.id}`,className:`chip attention`,onClick:e=>e.stopPropagation(),children:`needs approval`}):i&&(0,S.jsx)(M,{href:`/agents/${encodeURIComponent(e.slug)}/chat/${i.id}`,onClick:e=>e.stopPropagation(),children:`working…`})}),(0,S.jsxs)(`button`,{className:`run-btn dash-chat-btn`,onClick:t=>{t.stopPropagation(),ei(`claude`,{kind:`agent`,slug:e.slug})},children:[(0,S.jsx)(C,{name:`chat_bubble`,className:`ms-sm`}),` chat`]})]})]},e.slug)})})}function ua(e){if(e.lamp===`running`)return`now`;let t=new Date(e.at),n=new Date;if(t.toDateString()===n.toDateString())return`today`;let r=new Date(n);return r.setDate(r.getDate()-1),t.toDateString()===r.toDateString()?`yesterday`:`earlier`}var da=[[`all`,`all`],[`run`,`runs`],[`session`,`chats`],[`knowledge`,`knowledge`]];function fa({runs:e,chats:t,bundles:n,agents:r,workflows:i,filter:a,setFilter:o}){let s=F(),c=(0,v.useMemo)(()=>{let o=[],c=e=>e?i.find(t=>t.slug===e)?.name??e:void 0;for(let t of e)o.push({at:t.updatedAt,kind:`run`,emoji:`⚙️`,title:c(t.workflow)??t.id,sub:t.request??``,href:`/runs/${t.id}`,lamp:na(t.status),status:ra(t.status)});for(let e of t){let t=e.scope.kind===`agent`?r.find(t=>e.scope.kind===`agent`&&t.slug===e.scope.slug):void 0;o.push({at:e.updatedAt,kind:`session`,emoji:t?t.emoji||`🤖`:`💬`,title:t?t.name:e.title||`new chat`,sub:t?`${e.title||`new chat`}${s?` · ${e.agent}`:``}`:s?`${e.agent} · ${aa(e)}`:aa(e),href:ia(e),lamp:e.awaitingApproval?`blocked`:e.busy?`running`:`ok`,status:e.awaitingApproval?`needs approval`:e.busy?`working`:void 0})}for(let e of n)e.updatedAt&&o.push({at:e.updatedAt,kind:`knowledge`,emoji:`📚`,title:e.name,sub:`${e.concepts} concepts`,href:`/knowledge/${encodeURIComponent(e.name)}`,lamp:`ok`});return(a===`all`?o:a===`failed`?o.filter(e=>e.kind===`run`&&e.lamp===`failed`):o.filter(e=>e.kind===a)).sort((e,t)=>{let n=Number(t.lamp===`running`)-Number(e.lamp===`running`);return n===0?t.at.localeCompare(e.at):n}).slice(0,15)},[e,t,n,r,s,a]),l=``;return(0,S.jsxs)(`section`,{className:`panel dash-feed`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`activity`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`span`,{className:`dash-feed-filter`,children:[da.map(([e,t])=>(0,S.jsx)(`button`,{className:`feed-chip ${a===e?`on`:``}`,onClick:()=>o(e),children:t},e)),a===`failed`&&(0,S.jsxs)(`button`,{className:`feed-chip on failed`,onClick:()=>o(`all`),children:[`failed `,(0,S.jsx)(C,{name:`close`,className:`ms-sm`})]})]})]}),c.length===0?(0,S.jsx)(`div`,{className:`viewer-note`,children:a===`all`?`nothing yet — run a workflow or start a session`:`nothing here for this filter`}):(0,S.jsx)(`div`,{className:`m3-list`,children:c.map(e=>{let t=ua(e),n=t===l?null:t;return l=t,(0,S.jsxs)(`div`,{className:`feed-group`,children:[n&&(0,S.jsx)(`div`,{className:`feed-day microlabel`,children:n}),(0,S.jsxs)(M,{href:e.href,className:`m3-row m3-link`,children:[(0,S.jsxs)(`span`,{className:`agent-avatar`,children:[(0,S.jsx)(`span`,{"aria-hidden":!0,children:e.emoji}),e.lamp===`running`&&(0,S.jsx)(`span`,{className:`lamp running`})]}),(0,S.jsx)(`span`,{className:`chip dash-kind ${e.kind}`,children:e.kind===`session`?`chat`:e.kind}),(0,S.jsxs)(`span`,{className:`m3-body`,children:[(0,S.jsx)(`span`,{className:`m3-head`,children:oa(e.title)}),e.sub&&(0,S.jsx)(`span`,{className:`m3-sub`,children:oa(e.sub)})]}),e.status&&(0,S.jsx)(`span`,{className:`chip status ${e.lamp}`,children:e.status}),(0,S.jsx)(`span`,{className:`side-when num`,title:new Date(e.at).toLocaleString(),children:we(e.at)}),(0,S.jsx)(`span`,{className:`m3-chev`,children:(0,S.jsx)(C,{name:`chevron_right`})})]})]},`${e.kind}:${e.href}:${e.at}`)})})]})}async function pa(e,t){let n=window.open(``,`_blank`);if(!n)return;let r=t?`${e}/${t}`:e;n.document.write(`<title>${_a(r)}</title><body style="font-family:system-ui;padding:40px;color:#555">preparing ${_a(r)}…</body>`);let i=t=>`/api/knowledge/${encodeURIComponent(e)}/concept?id=${encodeURIComponent(t)}`,a,o=``;try{let[n,r]=await Promise.all([t?Promise.resolve([t]):fetch(`/api/knowledge/${encodeURIComponent(e)}`).then(e=>e.json()).then(e=>e.concepts.map(e=>e.id)),fetch(`/api/meta`).then(e=>e.json()).catch(()=>({}))]);if(o=r.projectName??``,a=await Promise.all(n.map(e=>fetch(i(e)).then(e=>e.json()))),a.some(e=>typeof e?.id!=`string`))throw Error(`missing concept`)}catch{n.document.body.textContent=`could not load "${r}"`;return}let s=[],c=a.map(e=>{let t=[e.type,e.generated?.at?`updated ${e.generated.at.slice(0,10)}`:``,e.trustTier===`human-reviewed`?`human-reviewed`:``,(e.tags??[]).map(e=>`#${e}`).join(` `)].filter(Boolean).join(` · `),{md:n,notes:r}=ha(ma(e.body??``,null)),i=!e.title||e.title===e.id||e.title===e.id.split(`/`).pop(),{html:a,title:o}=ga(Rr.sanitize(H.parse(n,{async:!1})),{title:e.title||e.id,meta:t,titleIsFallback:i});return s.push(o),`<article>
80
- ${a}
81
- ${r.length?`<ol class="notes">${r.map(e=>`<li id="fn-${_a(e.id)}">${Rr.sanitize(H.parseInline(e.text,{async:!1}))}</li>`).join(``)}</ol>`:``}
82
- </article>`}).join(`
83
- `),l=new Date().toISOString().slice(0,10),u=o?`${_a(o)} · ${_a(e)}`:_a(e),d=t?s[0]||r:e,f=t?``:`<h1 class="cover">${_a(e)}</h1>
84
- <div class="cover-sub">${o?`${_a(o)} · `:``}knowledge bundle · ${a.length} concept${a.length===1?``:`s`} · exported ${l}</div>`,p=`<!doctype html>
85
- <html>
86
- <head>
87
- <meta charset="utf-8">
88
- <title>${_a(d)}</title>
89
- <style>
90
- :root { color-scheme: light; }
91
- /* Page margins live in the sheet itself (repeating thead/tfoot cells +
92
- cell padding), not in @page — print dialogs that override or drop CSS
93
- page margins (macOS system dialog, "Margins: None") then still print
94
- the intended layout. Top 14mm, right 48mm (notes), bottom 16mm, left 20mm. */
95
- @page { size: A4; margin: 0; }
96
- * { box-sizing: border-box; }
97
- body {
98
- margin: 0; background: #e9e5df;
99
- font: 10pt/1.5 -apple-system, "Segoe UI", system-ui, sans-serif; color: #1c1b19;
100
- font-feature-settings: "kern", "liga", "tnum";
101
- -webkit-print-color-adjust: exact; print-color-adjust: exact;
102
- }
103
- .no-print {
104
- position: sticky; top: 0; z-index: 1; display: flex; gap: 12px; align-items: center;
105
- padding: 10px 24px; background: #f4efea; border-bottom: 1px solid #ded6cb; font-size: 13px;
106
- }
107
- .no-print button {
108
- font: inherit; font-weight: 600; padding: 6px 16px; cursor: pointer;
109
- background: #191919; color: #fff; border: none; border-radius: 999px;
110
- }
111
- /* Screen preview mimics the printed page incl. the note gutter. */
112
- .sheet {
113
- width: 210mm; margin: 24px auto; background: #fff;
114
- border-collapse: separate; border-spacing: 0; box-shadow: 0 2px 12px rgba(0,0,0,.12);
115
- }
116
- .sheet > thead > tr > td { padding: 14mm 48mm 0 20mm; vertical-align: top; }
117
- .sheet > tbody > tr > td { padding: 0 48mm 0 20mm; vertical-align: top; }
118
- .sheet > tfoot > tr > td { padding: 16mm 0 0; }
119
-
120
- /* Running header */
121
- .runhead {
122
- display: flex; justify-content: space-between; gap: 16px;
123
- font-size: 7.5pt; line-height: 1; color: #6b6660; letter-spacing: 0.08em; text-transform: uppercase;
124
- padding-bottom: 6px; border-bottom: 0.5pt solid #1c1b19; margin-bottom: 30px;
125
- }
126
-
127
- /* Cover */
128
- .cover { margin: 0 0 3px; font-size: 22pt; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
129
- .cover-sub { color: #6b6660; font-size: 8.5pt; margin-bottom: 26px; }
130
-
131
- /* Concept */
132
- article { margin-top: 36px; }
133
- article:first-of-type { margin-top: 0; }
134
- article header { break-inside: avoid; break-after: avoid; margin-bottom: 12px; }
135
- article h1 { font-size: 16pt; font-weight: 700; margin: 0 0 3px; letter-spacing: -0.015em; line-height: 1.2; }
136
- article .meta { color: #6b6660; font-size: 8pt; letter-spacing: 0.01em; }
137
-
138
- /* Type scale for body headings (concept body starts at h2 after demotion) */
139
- h2 { font-size: 13pt; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; margin: 22px 0 6px; break-after: avoid; }
140
- h3 { font-size: 11pt; font-weight: 650; line-height: 1.3; margin: 18px 0 4px; break-after: avoid; }
141
- h4 { font-size: 9.5pt; font-weight: 650; color: #3d3a36; margin: 14px 0 2px; break-after: avoid; }
142
- h5, h6 { font-size: 10pt; font-weight: 650; margin: 12px 0 2px; }
143
- h2 + h3, h3 + h4 { margin-top: 6px; }
144
- .keep { break-inside: avoid; }
145
-
146
- /* Copy */
147
- p, ul, ol { margin: 0 0 8px; orphans: 3; widows: 3; }
148
- ul, ol { padding-left: 16px; }
149
- li { margin: 0 0 3px; padding-left: 2px; }
150
- li > p { margin: 0; }
151
- li::marker { color: #8a857e; }
152
- ul ul, ol ol, ul ol, ol ul { margin: 2px 0 0; }
153
- strong { font-weight: 650; }
154
- em { font-style: italic; }
155
- a { color: inherit; text-decoration-color: #b8b2aa; text-decoration-thickness: 0.5pt; text-underline-offset: 2px; }
156
- hr { border: 0; border-top: 0.5pt solid #ded6cb; margin: 14px 0; }
157
- code { font: 8.5pt/1.4 ui-monospace, "SF Mono", Menlo, monospace; background: #f2ede7; padding: 0 3px; border-radius: 3px; }
158
- pre { background: #f2ede7; padding: 8px 10px; border-radius: 4px; overflow-x: auto; white-space: pre-wrap; margin: 4px 0 10px; }
159
- pre code { background: none; padding: 0; }
160
- blockquote { margin: 6px 0 10px; padding: 1px 0 1px 12px; border-left: 2px solid #c9c2b8; color: #4d4944; }
161
- img { max-width: 100%; }
162
- li:has(> input[type="checkbox"]) { list-style: none; margin-left: -16px; }
163
- input[type="checkbox"] { width: 9px; height: 9px; margin: 0 6px 0 0; vertical-align: -0.5px; }
164
- pre, blockquote, table, img { break-inside: avoid; }
165
-
166
- /* Tables: hairline rules, tabular figures, tight leading */
167
- table.md { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 8.75pt; line-height: 1.35; }
168
- table.md th, table.md td { padding: 4px 10px 4px 0; text-align: left; vertical-align: top; border-bottom: 0.5pt solid #ded6cb; }
169
- table.md th:last-child, table.md td:last-child { padding-right: 0; }
170
- table.md th { font-weight: 650; padding-bottom: 5px; border-top: 0.5pt solid #1c1b19; border-bottom: 0.5pt solid #1c1b19; color: #1c1b19; }
171
- table.md tr:last-child td { border-bottom: 0.5pt solid #1c1b19; }
172
- table.md .nw { white-space: nowrap; }
173
-
174
- /* Footnotes */
175
- .fnref { font-size: 6.5pt; line-height: 0; margin-left: 1px; color: #6b6660; }
176
- .fnref + .fnref::before { content: ","; }
177
- .notes { margin: 14px 0 0; padding: 8px 0 0 14px; border-top: 0.5pt solid #ded6cb; font-size: 8pt; line-height: 1.4; color: #6b6660; }
178
- .notes li { margin: 0 0 2px; }
179
- @media print {
180
- body { background: #fff; }
181
- .no-print { display: none; }
182
- .sheet { width: 100%; margin: 0; box-shadow: none; }
183
- .runhead { margin-bottom: 24px; }
184
- }
185
- </style>
186
- </head>
187
- <body>
188
- <div class="no-print">
189
- <span>Use “Save as PDF” in the print dialog.</span>
190
- <button onclick="window.print()">print / save as PDF</button>
191
- </div>
192
- <table class="sheet">
193
- <thead><tr><td>
194
- <div class="runhead"><span>${u}</span><span>${l}</span></div>
195
- </td></tr></thead>
196
- <tbody><tr><td>
197
- ${f}
198
- ${c}
199
- </td></tr></tbody>
200
- <tfoot><tr><td></td></tr></tfoot>
201
- </table>
202
- <script>setTimeout(() => window.print(), 400);<\/script>
203
- </body>
204
- </html>`;n.location.href=URL.createObjectURL(new Blob([p],{type:`text/html`}))}function ma(e,t){return e.split(/(```[\s\S]*?```|`[^`]*`)/).map((e,n)=>n%2==1?e:e.replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(e,n,r)=>{let i=n.trim().replace(/\.md$/,``),a=(r??i).trim();return t===null?a:`[${a}](#/knowledge/${encodeURIComponent(t)}/${i})`})).join(``)}function ha(e){let t=[];return{md:e.replace(/^\[\^([^\]]+)\]:[ \t]*(.+)$/gm,(e,n,r)=>(t.push({id:n,text:r.trim()}),``)).replace(/\[\^([^\]]+)\]/g,(e,n)=>{let r=t.findIndex(e=>e.id===n);return r>=0?`<sup class="fnref">${r+1}</sup>`:``}),notes:t}}function ga(e,t){let n=new DOMParser().parseFromString(e,`text/html`),r=t.title,i=n.body.firstElementChild;t.titleIsFallback&&i?.tagName===`H1`&&(r=i.textContent?.trim()||r,i.remove());let a=n.createElement(`header`);a.innerHTML=`<h1>${_a(r)}</h1><div class="meta">${_a(t.meta)}</div>`,n.body.prepend(a);for(let e of n.querySelectorAll(`table`)){e.classList.add(`md`);for(let t of e.querySelectorAll(`th, td`))(t.textContent??``).trim().length<=14&&t.classList.add(`nw`)}for(let e of[5,4,3,2,1])for(let t of Array.from(n.body.querySelectorAll(`:scope > h${e}`))){let r=n.createElement(`h${e+1}`);r.innerHTML=t.innerHTML,t.replaceWith(r)}for(let e of Array.from(n.body.querySelectorAll(`:scope > header, :scope > h2, :scope > h3, :scope > h4`))){let t=e.nextElementSibling;if(!t||/^H[1-6]$/.test(t.tagName))continue;let r=n.createElement(`div`);r.className=`keep`,e.replaceWith(r),r.append(e,t)}return{html:n.body.innerHTML,title:r}}function _a(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function va(e,t){return`/edit/${encodeURIComponent(e)}/${t.split(`/`).map(encodeURIComponent).join(`/`)}`}function ya({bundle:e,conceptId:t}){let n=B(`/api/knowledge`,!1),r=n?.bundles??[],i=e===`new`,a=r.reduce((e,t)=>!e||(t.updatedAt??``)>(e.updatedAt??``)?t:e,void 0);return(0,v.useEffect)(()=>{!e&&a&&j(`/knowledge/${encodeURIComponent(a.name)}`,{replace:!0})},[e,a?.name]),(0,S.jsxs)(`div`,{className:`runs-screen`,children:[(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`bundles`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(M,{href:`/knowledge/new`,className:`open-raw`,children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new`]})]}),(0,S.jsxs)(`div`,{className:`side-list`,children:[r.map(t=>(0,S.jsxs)(M,{href:`/knowledge/${encodeURIComponent(t.name)}`,className:`side-row ${t.name===e?`active`:``}`,children:[(0,S.jsx)(`span`,{className:`lamp ok`}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsxs)(`div`,{className:`side-row-top`,children:[(0,S.jsx)(`span`,{className:`side-wf`,children:t.name}),(0,S.jsx)(`span`,{className:`side-when num`,children:t.concepts})]}),(0,S.jsx)(`div`,{className:`side-row-sub`,children:(0,S.jsxs)(`span`,{className:`side-req`,children:[t.okfVersion?`okf ${t.okfVersion}`:`okf`,t.updatedAt?` · ${t.updatedAt.slice(0,10)}`:``]})})]})]},t.name)),n&&r.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no bundles yet`})]})]}),(0,S.jsx)(`div`,{className:`runs-main`,children:e&&!i?(0,S.jsx)(Ca,{name:e,conceptId:t},e):i||n&&!a?(0,S.jsx)(ba,{}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})})]})}function ba(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1);async function o(){let t=e.trim();if(!t)return;a(!0),r(``);let n=await(await fetch(`/api/knowledge`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:t})})).json();a(!1),n.error?r(n.error):j(`/knowledge/${encodeURIComponent(t)}`)}return(0,S.jsxs)(`div`,{className:`empty empty-action`,children:[(0,S.jsxs)(`div`,{className:`know-newbundle`,children:[(0,S.jsx)(`input`,{value:e,placeholder:`bundle name, e.g. customer-support`,onChange:e=>t(e.target.value),onKeyDown:e=>e.key===`Enter`&&void o(),autoFocus:!0}),(0,S.jsx)(`button`,{className:`run-btn`,disabled:!e.trim()||i,onClick:o,children:i?`creating…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new bundle`]})})]}),n&&(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,n]})]})}function xa({tier:e}){return(0,S.jsx)(`span`,{className:`chip trust ${e}`,children:e})}var Sa=`@activity`;function Ca({name:e,conceptId:t}){let n=B(`/api/knowledge/${encodeURIComponent(e)}`,!1);if(!n)return(0,S.jsx)(`div`,{className:`empty`,children:`loading…`});if(`error`in n)return(0,S.jsx)(`div`,{className:`empty`,children:`bundle not found`});let r=t===Sa?`activity`:`pages`,i=n.concepts,a=r===`pages`?t&&i.some(e=>e.id===t)?t:i[0]?.id:void 0,o=`/knowledge/${encodeURIComponent(e)}`;return(0,S.jsxs)(`div`,{className:`agent-view`,children:[(0,S.jsxs)(`div`,{className:`page-head`,children:[(0,S.jsx)(`h1`,{children:e}),(0,S.jsxs)(`span`,{className:`count`,children:[i.length,` pages`]}),(0,S.jsxs)(`div`,{className:`tabs`,children:[(0,S.jsx)(M,{href:o,className:r===`pages`?`active`:``,children:`pages`}),(0,S.jsx)(M,{href:`${o}/${Sa}`,className:r===`activity`?`active`:``,children:`activity`})]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>void pa(e),children:[(0,S.jsx)(C,{name:`picture_as_pdf`,className:`ms-sm`}),` export PDF`]}),(0,S.jsx)(`button`,{className:`run-btn`,onClick:()=>void ei(`claude`,{kind:`knowledge`,bundle:e}),children:`curate in chat`})]}),r===`activity`?n.log?(0,S.jsx)(Ea,{name:e,log:n.log}):(0,S.jsx)(`section`,{className:`panel`,children:(0,S.jsx)(`div`,{className:`viewer-note`,children:`no activity yet`})}):i.length===0?(0,S.jsx)(`section`,{className:`panel`,children:(0,S.jsxs)(`div`,{className:`viewer-note`,children:[`No pages yet — start a chat to author some, or write one with`,` `,(0,S.jsxs)(`code`,{children:[`kraftwerk knowledge put `,e,`/<path>`]}),`.`]})}):(0,S.jsxs)(`div`,{className:`wiki`,children:[(0,S.jsx)(`aside`,{className:`wiki-side`,children:(0,S.jsx)(Oa,{concepts:i,base:o,selected:a})}),(0,S.jsx)(`div`,{className:`wiki-main`,children:a&&(0,S.jsx)(Aa,{bundle:e,conceptId:a},a)})]})]})}function wa(e){let t=[];for(let n of e.split(`
205
- `)){let e=n.match(/^##\s+(\d{4}-\d{2}-\d{2})/);if(e){t.push({date:e[1],entries:[]});continue}let r=n.match(/^[*-]\s+\*\*([^*]+)\*\*:\s*(.*)$/);r&&t.length>0&&t[t.length-1].entries.push({kind:r[1].toLowerCase(),text:r[2]})}return t.filter(e=>e.entries.length>0)}function Ta(e,t){let n=[],r=/\[([^\]]+)\]\(\/?([^)]+?)\.md\)/g,i=0,a;for(;a=r.exec(t);)a.index>i&&n.push(t.slice(i,a.index)),n.push((0,S.jsx)(M,{href:`/knowledge/${encodeURIComponent(e)}/${a[2].replace(/^\//,``)}`,children:a[1]},a.index)),i=a.index+a[0].length;return i<t.length&&n.push(t.slice(i)),n}function Ea({name:e,log:t}){let n=wa(t),[r,i]=(0,v.useState)(!1);return(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`activity`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>i(!r),children:r?`timeline`:`raw log`})]}),r||n.length===0?(0,S.jsx)(`div`,{className:`viewer-body`,children:(0,S.jsx)(`pre`,{children:t})}):(0,S.jsx)(`div`,{className:`know-log`,children:n.map(t=>(0,S.jsxs)(v.Fragment,{children:[(0,S.jsx)(`div`,{className:`m3-subhead num`,children:t.date}),t.entries.map((t,n)=>(0,S.jsxs)(`div`,{className:`know-log-row`,children:[(0,S.jsx)(`span`,{className:`chip log-kind log-${t.kind}`,children:t.kind}),(0,S.jsx)(`span`,{className:`know-log-text`,children:Ta(e,t.text)})]},n))]},t.date))})]})}function Da(e){let t={name:``,path:``,folders:[],pages:[],total:0};for(let n of e){let e=n.id.split(`/`),r=t;r.total++;for(let t of e.slice(0,-1)){let e=r.folders.find(e=>e.name===t);e||(e={name:t,path:r.path?`${r.path}/${t}`:t,folders:[],pages:[],total:0},r.folders.push(e)),r=e,r.total++}r.pages.push(n)}let n=e=>{e.folders.sort((e,t)=>e.name.localeCompare(t.name)),e.pages.sort((e,t)=>e.title.localeCompare(t.title)),e.folders.forEach(n)};return n(t),t}function Oa({concepts:e,base:t,selected:n}){let r=(0,v.useMemo)(()=>Da(e),[e]),[i,a]=(0,v.useState)(()=>new Set);return(0,v.useEffect)(()=>{n&&n.includes(`/`)&&a(e=>{let t=new Set(e),r=n.split(`/`).slice(0,-1);for(let e=1;e<=r.length;e++)t.delete(r.slice(0,e).join(`/`));return t.size===e.size?e:t})},[n]),(0,S.jsx)(ka,{folder:r,base:t,selected:n,closed:i,toggle:e=>a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})})}function ka({folder:e,base:t,selected:n,closed:r,toggle:i}){return(0,S.jsxs)(S.Fragment,{children:[e.pages.map(e=>(0,S.jsxs)(M,{href:`${t}/${e.id}`,className:`wiki-page ${e.id===n?`active`:``}`,title:`${e.id}.md`,children:[(0,S.jsx)(`span`,{className:`wiki-page-title`,children:e.title}),(e.stale||e.error)&&(0,S.jsx)(`span`,{className:`wiki-dot`,title:e.error??`stale`})]},e.id)),e.folders.map(e=>{let a=!r.has(e.path),o=!!n&&n.startsWith(`${e.path}/`);return(0,S.jsxs)(v.Fragment,{children:[(0,S.jsxs)(`button`,{type:`button`,className:`wiki-folder ${a?`open`:``} ${o&&!a?`holds`:``}`,onClick:()=>i(e.path),"aria-expanded":a,title:`${e.path}/`,children:[(0,S.jsx)(C,{name:`chevron_right`,className:`ms-sm wiki-folder-chev`}),(0,S.jsx)(`span`,{className:`wiki-folder-name`,children:e.name}),(0,S.jsx)(`span`,{className:`wiki-folder-count num`,children:e.total})]}),a&&(0,S.jsx)(`div`,{className:`wiki-branch`,children:(0,S.jsx)(ka,{folder:e,base:t,selected:n,closed:r,toggle:i})})]},e.path)})]})}function Aa({bundle:e,conceptId:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(`rendered`),y=(0,v.useMemo)(()=>n?Rr.sanitize(H.parse(ma(n.body,e),{async:!1})):``,[n?.body,e]),b=()=>{fetch(`/api/knowledge/${encodeURIComponent(e)}/concept?id=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():Promise.reject()).then(r).catch(()=>a(!0))};(0,v.useEffect)(()=>{if(c)return;let n=!0,i,o=async()=>{try{let i=await fetch(`/api/knowledge/${encodeURIComponent(e)}/concept?id=${encodeURIComponent(t)}`,{cache:`no-store`});if(i.ok){let e=await i.json();n&&(a(!1),r(t=>JSON.stringify(t)===JSON.stringify(e)?t:e))}else i.status===404&&n&&a(!0)}catch{}n&&(i=setTimeout(o,6e3))};return o(),()=>{n=!1,clearTimeout(i)}},[e,t,c]);async function x(){s(!0),await fetch(`/api/knowledge/${encodeURIComponent(e)}/verify`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:t})}).catch(()=>{}),s(!1),b()}async function w(){p(!0),h(``);let n=await fetch(`/api/knowledge/${encodeURIComponent(e)}/concept`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:t,content:u})}).then(e=>e.json()).catch(()=>({error:`save failed`}));p(!1),n.error?h(n.error):(r(n),l(!1))}return i?(0,S.jsx)(`div`,{className:`empty`,children:`concept not found`}):n?(0,S.jsxs)(`div`,{className:`agent-view`,children:[(0,S.jsxs)(`div`,{className:`detail-head`,children:[(0,S.jsx)(`h1`,{children:n.title}),n.type&&(0,S.jsx)(`span`,{className:`chip agent`,children:n.type}),(0,S.jsx)(xa,{tier:n.trustTier}),n.status!==`stable`&&(0,S.jsx)(`span`,{className:`chip ${n.status}`,children:n.status}),n.stale&&(0,S.jsxs)(`span`,{className:`chip stale`,children:[`stale since `,n.staleAfter?.slice(0,10)]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(M,{href:va(e,n.id),className:`open-raw`,title:`Full-screen document editor with autosave`,children:[(0,S.jsx)(C,{name:`edit_document`,className:`ms-sm`}),` open in editor`]}),(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>void pa(e,n.id),children:[(0,S.jsx)(C,{name:`picture_as_pdf`,className:`ms-sm`}),` export PDF`]}),(0,S.jsx)(`button`,{className:`run-btn`,disabled:o,onClick:x,children:o?`verifying…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`check`,className:`ms-sm`}),` verify (human)`]})})]}),n.error&&(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,n.error]}),(0,S.jsxs)(`div`,{className:`detail-cols`,children:[(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`content`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`span`,{className:`side-meta`,children:[e,`/`,n.id,`.md`]}),c?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>{l(!1),h(``)},children:`cancel`}),(0,S.jsx)(`button`,{className:`open-raw`,disabled:f,onClick:w,children:f?`saving…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`check`,className:`ms-sm`}),` save`]})})]}):(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>{d(n.raw),l(!0),h(``)},children:[(0,S.jsx)(C,{name:`edit`,className:`ms-sm`}),` edit`]})]}),c?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`textarea`,{className:`concept-edit`,value:u,rows:Math.min(40,Math.max(18,u.split(`
206
- `).length+2)),onChange:e=>d(e.target.value),spellCheck:!1}),(0,S.jsxs)(`div`,{className:`viewer-note`,children:[`full file (frontmatter + markdown body) — saving stamps provenance as`,` `,(0,S.jsx)(`code`,{children:`human:user`}),` and logs an update.`]})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`viewer-note md-toolbar`,children:(0,S.jsxs)(`div`,{className:`tabs`,children:[(0,S.jsx)(`button`,{className:g===`rendered`?`active`:``,onClick:()=>_(`rendered`),children:`rendered`}),(0,S.jsx)(`button`,{className:g===`source`?`active`:``,onClick:()=>_(`source`),children:`source`})]})}),(0,S.jsx)(`div`,{className:`viewer-body`,children:g===`rendered`?(0,S.jsx)(`div`,{className:`md-body concept-md`,dangerouslySetInnerHTML:{__html:y}}):(0,S.jsx)(`pre`,{children:n.body.trim()||`(empty body)`})})]}),m&&(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,m]})]}),(0,S.jsxs)(`aside`,{className:`detail-rail`,children:[(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`about`})}),(0,S.jsxs)(`div`,{className:`rail-list`,children:[(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`trust`}),(0,S.jsx)(`span`,{className:`v`,children:(0,S.jsx)(xa,{tier:n.trustTier})})]}),(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`generated`}),(0,S.jsx)(`span`,{className:`v ${n.generated?``:`dim`}`,children:n.generated?`${n.generated.by??`?`} · ${(n.generated.at??`?`).slice(0,10)}`:`not stamped`})]}),(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`verified`}),n.verified.length===0?(0,S.jsx)(`span`,{className:`v dim`,children:`never`}):n.verified.map((e,t)=>(0,S.jsxs)(`span`,{className:`v`,children:[e.by??`?`,` · `,(e.at??`?`).slice(0,10)]},t))]}),n.staleAfter&&(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`stale after`}),(0,S.jsxs)(`span`,{className:`v ${n.stale?``:`dim`}`,children:[n.staleAfter.slice(0,10),n.stale&&(0,S.jsx)(`span`,{className:`chip stale`,children:`stale`})]})]}),n.tags.length>0&&(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`tags`}),(0,S.jsx)(`span`,{className:`m3-chips`,children:n.tags.map(e=>(0,S.jsx)(`span`,{className:`chip`,children:e},e))})]})]})]}),n.sources.length>0&&(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`sources`})}),(0,S.jsx)(`div`,{className:`rail-list`,children:n.sources.map((e,t)=>(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsxs)(`span`,{className:`v`,children:[e.resource?.startsWith(`http`)?(0,S.jsx)(`a`,{href:e.resource,target:`_blank`,rel:`noreferrer`,children:e.title??e.resource}):e.title??e.resource??`?`,e.id&&(0,S.jsxs)(`span`,{className:`know-id`,children:[`[^`,e.id,`]`]})]}),(0,S.jsx)(`span`,{className:`v dim`,children:[e.author,e.usage_count==null?null:`${e.usage_count} uses`,e.last_modified?`mod ${e.last_modified.slice(0,10)}`:null].filter(Boolean).join(` · `)})]},t))})]})]})]})]}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})}var ja={workspace:`workspace`,project:`.claude`,user:`global`,agent:`agent`};function Ma(e){return(0,S.jsx)(`span`,{className:`chip skill-src ${e}`,children:ja[e]})}function Na({name:e}){let t=B(`/api/skills`,!1),n=t?.skills??[],r=n.filter(e=>e.source===`workspace`),i=n.filter(e=>e.source!==`workspace`),a=r[0]??i[0];(0,v.useEffect)(()=>{!e&&a&&j(`/skills/${encodeURIComponent(a.name)}`,{replace:!0})},[e,a?.name]);let o=t=>(0,S.jsxs)(M,{href:`/skills/${encodeURIComponent(t.name)}`,className:`side-row ${t.name===e?`active`:``}`,children:[(0,S.jsx)(`span`,{className:`lamp ${t.source===`workspace`?`ok`:`dim`}`}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsxs)(`div`,{className:`side-row-top`,children:[(0,S.jsxs)(`span`,{className:`side-wf`,children:[`/`,t.name]}),t.source!==`workspace`&&Ma(t.source)]}),(0,S.jsx)(`div`,{className:`side-row-sub`,children:(0,S.jsx)(`span`,{className:`side-req`,children:t.description||`no description`})})]})]},`${t.source}:${t.name}`);return(0,S.jsxs)(`div`,{className:`runs-screen`,children:[(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsx)(`div`,{className:`side-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`workspace skills`})}),(0,S.jsxs)(`div`,{className:`side-list`,children:[r.map(o),t&&r.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no workspace skills yet`}),i.length>0&&(0,S.jsxs)(v.Fragment,{children:[(0,S.jsx)(`div`,{className:`side-head skills-local-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`local (this machine / repo)`})}),i.map(o)]})]})]}),(0,S.jsx)(`div`,{className:`runs-main`,children:e?(0,S.jsx)(Fa,{name:e},e):t&&!a?(0,S.jsx)(Pa,{root:t.root}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})})]})}function Pa({root:e}){return(0,S.jsx)(`div`,{className:`empty empty-action`,children:(0,S.jsxs)(`span`,{children:[`Create `,(0,S.jsxs)(`code`,{children:[e,`/<name>/SKILL.md`]}),` and it appears here and in every session's `,(0,S.jsx)(`code`,{children:`/`}),` menu.`]})})}function Fa({name:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(`rendered`),s=(0,v.useMemo)(()=>t?t.content.replace(/^---\r?\n[\s\S]*?\r?\n---(\r?\n|$)/,``):``,[t?.content]),c=(0,v.useMemo)(()=>t?Rr.sanitize(H.parse(s,{async:!1})):``,[s]);return(0,v.useEffect)(()=>{fetch(`/api/skills/${encodeURIComponent(e)}`).then(e=>e.ok?e.json():Promise.reject()).then(n).catch(()=>i(!0))},[e]),r?(0,S.jsx)(`div`,{className:`empty`,children:`skill not found`}):t?(0,S.jsxs)(`div`,{className:`agent-view`,children:[(0,S.jsxs)(`div`,{className:`detail-head`,children:[(0,S.jsxs)(`h1`,{children:[`/`,t.name]}),Ma(t.source)]}),t.description&&(0,S.jsx)(`div`,{className:`know-intro skill-desc`,children:t.description}),(0,S.jsxs)(`div`,{className:`detail-cols`,children:[(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`SKILL.md`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`div`,{className:`tabs`,children:[(0,S.jsx)(`button`,{className:a===`rendered`?`active`:``,onClick:()=>o(`rendered`),children:`rendered`}),(0,S.jsx)(`button`,{className:a===`source`?`active`:``,onClick:()=>o(`source`),children:`source`})]})]}),(0,S.jsx)(`div`,{className:`viewer-body`,children:a===`rendered`?(0,S.jsx)(`div`,{className:`md-body concept-md`,dangerouslySetInnerHTML:{__html:c}}):(0,S.jsx)(`pre`,{children:t.content.trim()||`(empty)`})})]}),(0,S.jsx)(`aside`,{className:`detail-rail`,children:(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`about`})}),(0,S.jsxs)(`div`,{className:`rail-list`,children:[(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`source`}),(0,S.jsx)(`span`,{className:`v`,children:t.source===`workspace`?`workspace — git-tracked, shared with the team`:t.source===`project`?`repo .claude/skills — tracked, but outside the workspace root`:`global ~/.claude/skills — only on this machine`})]}),(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`path`}),(0,S.jsx)(`span`,{className:`v mono skill-path`,title:t.path,children:t.path})]}),(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`invoke`}),(0,S.jsxs)(`span`,{className:`v`,children:[(0,S.jsxs)(`code`,{children:[`/`,t.name]}),` in any session`]})]}),t.files.length>0&&(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`bundled files`}),t.files.map(e=>(0,S.jsx)(`span`,{className:`v mono`,children:e},e))]})]})]})})]})]}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})}var Ia=[``,`low`,`medium`,`high`,`xhigh`,`max`],La=[`🤖`,`🧑‍💻`,`🎧`,`🛠️`,`📊`,`✍️`,`🔍`,`🧹`,`📦`,`🚀`];function Ra({seg:e}){let t=e[0]&&e[0]!==`new`&&e[0]!==`chats`?decodeURIComponent(e[0]):void 0,n=e[0]===`new`?`new`:e[0]===`chats`?`chats`:e[1]===`edit`?`edit`:e[1]===`info`?`info`:e[1]===`chat`?`chat`:t?`agent`:`home`,r=n===`chats`&&e[1]===`new`,i=n===`chat`?e[2]:n===`chats`&&!r?e[1]:void 0,a=B(`/api/agents`,!1),o=F(),[s,c]=(0,v.useState)(()=>{try{let e=JSON.parse(localStorage.getItem(`kw-agent-groups`)??`[]`);return Array.isArray(e)?e.map(String):[]}catch{return[]}}),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(null),[b,x]=(0,v.useState)(null),[w,T]=(0,v.useState)({}),E=(a?.agents??[]).map(e=>w[e.slug]===void 0?e:{...e,group:w[e.slug]||void 0});(0,v.useEffect)(()=>{T(e=>{let t={...e},n=!1;for(let e of a?.agents??[])t[e.slug]!==void 0&&(e.group??``)===t[e.slug]&&(delete t[e.slug],n=!0);return n?t:e})},[a]);let D=E.filter(e=>!e.archived),O=E.filter(e=>e.archived),[k,ee]=(0,v.useState)(!1),A=[...new Set([...D.map(e=>e.group??``).filter(Boolean),...s])].sort((e,t)=>e.localeCompare(t)),j=D.filter(e=>!e.group);function te(e){c(e);try{localStorage.setItem(`kw-agent-groups`,JSON.stringify(e))}catch{}}function ne(){let e=d.trim();u(!1),f(``),e&&!A.includes(e)&&te([...s,e])}function N(e,t){m(null);let n=t.trim();if(n&&n!==e){for(let t of E.filter(t=>t.group===e))P(t.slug,n);s.includes(e)&&te([...new Set(s.map(t=>t===e?n:t))])}}async function P(e,t){if((E.find(t=>t.slug===e)?.group??``)!==t){T(n=>({...n,[e]:t}));try{let n=await fetch(`/api/agents/${encodeURIComponent(e)}`);if(!n.ok)throw Error();let r=await n.json();if(!(await fetch(`/api/agents/${encodeURIComponent(e)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({...r,group:t||void 0})})).ok)throw Error()}catch{T(t=>{let n={...t};return delete n[e],n})}}}let re=e=>o?{onDragOver:t=>{_!=null&&(t.preventDefault(),t.dataTransfer.dropEffect=`move`,b!==e&&x(e))},onDrop:t=>{t.preventDefault();let n=t.dataTransfer.getData(`text/plain`)||_;n&&P(n,e),y(null),x(null)}}:{},ie=e=>(0,S.jsxs)(M,{href:`/agents/${encodeURIComponent(e.slug)}`,className:`side-row ${e.slug===t?`active`:``} ${_===e.slug?`dragging`:``}`,draggable:o,onDragStart:t=>{t.dataTransfer.setData(`text/plain`,e.slug),t.dataTransfer.effectAllowed=`move`,y(e.slug)},onDragEnd:()=>{y(null),x(null)},children:[(0,S.jsx)(`span`,{className:`agent-avatar sm`,children:(0,S.jsx)(`span`,{"aria-hidden":!0,children:e.emoji})}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsx)(`div`,{className:`side-row-top`,children:(0,S.jsx)(`span`,{className:`side-wf`,children:e.name})}),(0,S.jsx)(`div`,{className:`side-row-sub`,children:(0,S.jsx)(`span`,{className:`side-req`,children:e.description||e.harness})})]})]},e.slug),ae=e=>(0,S.jsxs)(M,{href:`/agents/${encodeURIComponent(e.slug)}/info`,className:`side-row archived-row ${e.slug===t?`active`:``}`,children:[(0,S.jsx)(`span`,{className:`agent-avatar sm`,children:(0,S.jsx)(`span`,{"aria-hidden":!0,children:e.emoji})}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsx)(`div`,{className:`side-row-top`,children:(0,S.jsx)(`span`,{className:`side-wf`,children:e.name})}),(0,S.jsx)(`div`,{className:`side-row-sub`,children:(0,S.jsx)(`span`,{className:`side-req`,children:e.description||e.harness})})]})]},e.slug),I;I=n===`new`?(0,S.jsx)(Za,{},`new`):n===`edit`&&t?(0,S.jsx)(Za,{slug:t},t):n===`chat`&&t&&i?(0,S.jsx)(`div`,{className:`chat-main`,children:(0,S.jsx)(oi,{id:i,agentName:E.find(e=>e.slug===t)?.name??t,agentDescription:E.find(e=>e.slug===t)?.description},i)}):n===`chats`?i?(0,S.jsx)(`div`,{className:`chat-main`,children:(0,S.jsx)(oi,{id:i},i)}):r?(0,S.jsx)(ti,{}):(0,S.jsx)(Ha,{}):n===`info`&&t?(0,S.jsx)(qa,{slug:t},t):t?(0,S.jsx)(Va,{slug:t},t):a?D.length?(0,S.jsx)(Ga,{agents:D}):(0,S.jsx)(Ka,{}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`});let L=(n===`agent`||n===`info`||n===`chat`)&&t?E.find(e=>e.slug===t)?.knowledge??[]:[],[oe,se]=(0,v.useState)(()=>localStorage.getItem(`kw-kside`)!==`hidden`),[ce,le]=(0,v.useState)(()=>Number(localStorage.getItem(`kw-kside-w`))||460),ue=L.length>0&&oe;function R(e){se(e),localStorage.setItem(`kw-kside`,e?`open`:`hidden`)}function de(e){le(e),localStorage.setItem(`kw-kside-w`,String(e))}return(0,S.jsxs)(`div`,{className:`runs-screen agents-screen ${t||n===`chats`?`has-sessions`:``} ${ue?`has-knowledge`:``}`,style:ue?{"--kside-w":`${ce}px`}:void 0,children:[(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`agents`}),(0,S.jsx)(`span`,{className:`spacer`}),o&&(0,S.jsxs)(M,{href:`/agents/new`,className:`open-raw`,children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new`]})]}),(0,S.jsxs)(`div`,{className:`side-list`,children:[(0,S.jsxs)(M,{href:`/agents/chats`,className:`side-row side-general ${n===`chats`?`active`:``}`,children:[(0,S.jsx)(`span`,{className:`agent-avatar sm`,children:(0,S.jsx)(`span`,{"aria-hidden":!0,children:`💬`})}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsx)(`div`,{className:`side-row-top`,children:(0,S.jsx)(`span`,{className:`side-wf`,children:`General Chats`})}),(0,S.jsx)(`div`,{className:`side-row-sub`,children:(0,S.jsx)(`span`,{className:`side-req`,children:`chats without an agent`})})]})]}),(0,S.jsxs)(`div`,{className:`side-group ${_&&b===``?`drop-over`:``}`,...re(``),children:[j.map(ie),_!=null&&j.length===0&&(0,S.jsx)(`div`,{className:`side-group-empty`,children:`no group — drop here`})]}),A.map(e=>{let t=D.filter(t=>t.group===e);return(0,S.jsxs)(`div`,{className:`side-group ${_&&b===e?`drop-over`:``}`,...re(e),children:[(0,S.jsxs)(`div`,{className:`side-group-head`,children:[p===e?(0,S.jsx)(`input`,{className:`side-group-rename`,autoFocus:!0,value:h,onChange:e=>g(e.target.value),onKeyDown:t=>{t.key===`Enter`&&N(e,h),t.key===`Escape`&&m(null)},onBlur:()=>N(e,h)}):(0,S.jsx)(`span`,{className:`microlabel`,children:e}),(0,S.jsx)(`span`,{className:`side-group-count num`,children:t.length}),(0,S.jsx)(`span`,{className:`spacer`}),o&&p!==e&&(0,S.jsx)(`button`,{className:`side-group-x`,title:`Rename group`,onClick:()=>{m(e),g(e)},children:(0,S.jsx)(C,{name:`edit`,className:`ms-sm`})}),o&&t.length===0&&s.includes(e)&&(0,S.jsx)(`button`,{className:`side-group-x`,title:`Remove empty group`,onClick:()=>te(s.filter(t=>t!==e)),children:(0,S.jsx)(C,{name:`close`,className:`ms-sm`})})]}),t.map(ie),t.length===0&&(0,S.jsx)(`div`,{className:`side-group-empty`,children:o?`drag agents here`:`no agents`})]},e)}),O.length>0&&(0,S.jsxs)(`div`,{className:`side-group side-archived`,children:[(0,S.jsxs)(`button`,{className:`side-archived-toggle`,"aria-expanded":k,onClick:()=>ee(e=>!e),children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`archived`}),(0,S.jsx)(`span`,{className:`side-group-count num`,children:O.length}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(C,{name:k?`expand_less`:`expand_more`,className:`ms-sm`})]}),k&&O.map(ae)]}),a&&E.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no agents yet`}),o&&(l?(0,S.jsx)(`div`,{className:`side-group-new`,children:(0,S.jsx)(`input`,{autoFocus:!0,value:d,placeholder:`group name, e.g. Team Content`,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&ne(),e.key===`Escape`&&(u(!1),f(``))},onBlur:ne})}):(0,S.jsxs)(`button`,{className:`side-group-add`,onClick:()=>u(!0),children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` group`]}))]})]}),t&&(0,S.jsx)(Ua,{slug:t,chatId:i}),n===`chats`&&(0,S.jsx)(Wa,{chatId:i}),(0,S.jsx)(`div`,{className:`runs-main`,children:I}),ue&&(0,S.jsx)(za,{bundles:L,onHide:()=>R(!1),onResize:de}),L.length>0&&!oe&&(0,S.jsxs)(`button`,{className:`kside-reopen`,onClick:()=>R(!0),title:`Show knowledge sidebar`,children:[(0,S.jsx)(C,{name:`menu_book`,className:`ms-sm`}),` knowledge`]})]})}function za({bundles:e,onHide:t,onResize:n}){let[r,i]=(0,v.useState)({}),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)({}),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(``);(0,v.useEffect)(()=>{i({});let t=!0,n,r=async()=>{await Promise.all(e.map(async e=>{try{let n=await fetch(`/api/knowledge/${encodeURIComponent(e)}`,{cache:`no-store`}),r=n.ok?await n.json():null;t&&i(t=>JSON.stringify(t[e])===JSON.stringify(r)?t:{...t,[e]:r})}catch{t&&i(t=>e in t?t:{...t,[e]:null})}})),t&&(n=setTimeout(r,6e3))};return r(),()=>{t=!1,clearTimeout(n)}},[e.join(`,`)]),(0,v.useEffect)(()=>{if(!a||d===a)return;let e=a.indexOf(`::`),t=a.slice(0,e),n=a.slice(e+2),r=!0,i,o=async()=>{try{let e=await fetch(`/api/knowledge/${encodeURIComponent(t)}/concept?id=${encodeURIComponent(n)}`,{cache:`no-store`}),i=e.ok?await e.json():null;r&&c(e=>JSON.stringify(e[a])===JSON.stringify(i)?e:{...e,[a]:i})}catch{r&&c(e=>a in e?e:{...e,[a]:null})}r&&(i=setTimeout(o,6e3))};return o(),()=>{r=!1,clearTimeout(i)}},[a,d]);function b(e,t){let n=`${e}::${t}`;o(a===n?null:n)}async function x(e,t){let n=`${e}::${t}`;g(!0),y(``);try{let r=await(await fetch(`/api/knowledge/${encodeURIComponent(e)}/concept`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:t,content:p})})).json();r.error?y(r.error):(c(e=>({...e,[n]:r})),f(null))}catch(e){y(e.message)}g(!1)}return(0,S.jsxs)(`aside`,{className:`runs-side knowledge-side`,children:[(0,S.jsx)(`div`,{className:`kside-resizer`,title:`Drag to resize`,onMouseDown:e=>{e.preventDefault();let t=e.clientX,r=e.currentTarget.parentElement.offsetWidth,i=e=>n(Math.min(900,Math.max(280,r+(t-e.clientX)))),a=()=>{window.removeEventListener(`mousemove`,i),window.removeEventListener(`mouseup`,a)};window.addEventListener(`mousemove`,i),window.addEventListener(`mouseup`,a)}}),(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsxs)(`span`,{className:`kside-headline`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`knowledge`}),(0,S.jsx)(`span`,{className:`kside-hint`,children:`read & kept current by this agent`})]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`button`,{className:`open-raw`,onClick:t,title:`Hide knowledge sidebar`,children:[`hide `,(0,S.jsx)(C,{name:`close`,className:`ms-sm`})]})]}),(0,S.jsx)(`div`,{className:`side-list`,children:e.map(e=>{let t=r[e],n=l[e]===!0;return(0,S.jsxs)(`div`,{className:`kside-bundle`,children:[(0,S.jsxs)(`div`,{className:`kside-bundle-head`,children:[(0,S.jsxs)(`button`,{className:`kside-bundle-toggle`,"aria-expanded":!n,onClick:()=>u({...l,[e]:!n}),children:[(0,S.jsx)(`span`,{className:`kside-chev ${n?``:`open`}`,"aria-hidden":!0,children:(0,S.jsx)(C,{name:`chevron_right`,className:`ms-sm`})}),(0,S.jsx)(`span`,{className:`kside-bundle-name`,children:e}),t&&(0,S.jsx)(`span`,{className:`kside-count num`,children:t.concepts.length})]}),(0,S.jsx)(`button`,{className:`kside-open`,title:`Export this bundle as PDF`,onClick:()=>void pa(e),children:(0,S.jsx)(C,{name:`picture_as_pdf`,className:`ms-sm`})}),(0,S.jsx)(M,{href:`/knowledge/${encodeURIComponent(e)}`,className:`kside-open`,title:`Open this bundle on the knowledge screen`,children:`↗`})]}),!n&&t===null&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`bundle not found`}),!n&&t?.concepts.map(t=>{let n=`${e}::${t.id}`,r=a===n,i=`/knowledge/${encodeURIComponent(e)}/${t.id.split(`/`).map(encodeURIComponent).join(`/`)}`;return(0,S.jsxs)(`div`,{className:`kside-concept ${r?`open`:``}`,children:[(0,S.jsxs)(`button`,{className:`kside-row`,"aria-expanded":r,title:t.description||void 0,onClick:()=>b(e,t.id),children:[(0,S.jsx)(`span`,{className:`kside-chev ${r?`open`:``}`,"aria-hidden":!0,children:(0,S.jsx)(C,{name:`chevron_right`,className:`ms-sm`})}),(0,S.jsx)(`span`,{className:`kside-title`,children:t.title||t.id}),t.stale&&(0,S.jsx)(`span`,{className:`kside-stale`,title:`Past its stale-after date — ask the agent to re-verify it`,children:`stale`})]}),r&&(0,S.jsx)(`div`,{className:`kside-card`,ref:e=>e?.scrollIntoView({block:`nearest`}),children:s[n]===void 0?(0,S.jsx)(`div`,{className:`viewer-note`,children:`loading…`}):s[n]===null?(0,S.jsx)(`div`,{className:`viewer-note`,children:`could not load concept`}):d===n?(0,S.jsxs)(`div`,{className:`kside-edit`,children:[(0,S.jsx)(`textarea`,{className:`concept-edit`,value:p,rows:Math.min(28,Math.max(10,p.split(`
207
- `).length+2)),onChange:e=>m(e.target.value),spellCheck:!1}),(0,S.jsxs)(`div`,{className:`kside-actions`,children:[(0,S.jsx)(`button`,{className:`open-raw`,disabled:h,onClick:()=>f(null),children:`cancel`}),(0,S.jsx)(`button`,{className:`open-raw`,disabled:h,onClick:()=>x(e,t.id),children:h?`saving…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`check`,className:`ms-sm`}),` save`]})})]}),_&&(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,_]})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`kside-card-bar`,children:[t.type&&(0,S.jsx)(`span`,{className:`kside-type`,children:t.type}),Ba(t)&&(0,S.jsxs)(`span`,{className:`kside-updated num`,children:[`updated `,Ce(Ba(t))]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>{m(s[n].raw),f(n),y(``)},children:[(0,S.jsx)(C,{name:`edit`,className:`ms-sm`}),` edit`]}),(0,S.jsxs)(M,{href:va(e,t.id),className:`open-raw`,title:`Full-screen document editor with autosave`,children:[(0,S.jsx)(C,{name:`edit_document`,className:`ms-sm`}),` editor`]}),(0,S.jsx)(M,{href:i,className:`open-raw`,children:`open ↗`})]}),(0,S.jsx)(`div`,{className:`kside-md md-body`,dangerouslySetInnerHTML:{__html:Rr.sanitize(H.parse(s[n].body??``,{async:!1}))}})]})})]},t.id)}),!n&&t&&t.concepts.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no concepts yet`})]},e)})})]})}function Ba(e){return[e.generated?.at,...e.verified.map(e=>e.at)].filter(e=>typeof e==`string`&&e.length>0).sort().pop()}function Va({slug:e}){let[t,n]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let t=!0;return n(!1),fetch(`/api/chats`).then(e=>e.json()).then(r=>{if(!t)return;let i=r.chats.find(t=>t.scope.kind===`agent`&&t.scope.slug===e);i?j(`/agents/${encodeURIComponent(e)}/chat/${i.id}`,{replace:!0}):n(!0)}).catch(()=>t&&n(!0)),()=>{t=!1}},[e]),t?(0,S.jsx)(qa,{slug:e}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})}function Ha(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=!0;return fetch(`/api/chats`).then(e=>e.json()).then(n=>{if(!e)return;let r=n.chats.find(e=>e.scope.kind!==`agent`&&e.scope.kind!==`channel`&&e.scope.kind!==`project`);r?j(`/agents/chats/${r.id}`,{replace:!0}):t(!0)}).catch(()=>e&&t(!0)),()=>{e=!1}},[]),e?(0,S.jsx)(ti,{}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})}function Ua({slug:e,chatId:t}){let n=B(`/api/chats`,!1),r=(n?.chats??[]).filter(t=>t.scope.kind===`agent`&&t.scope.slug===e),[i,a]=(0,v.useState)(!1);return(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`sessions`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(M,{href:`/agents/${encodeURIComponent(e)}/info`,className:`open-raw`,title:`agent profile & settings`,children:`profile`}),(0,S.jsx)(`button`,{className:`open-raw`,disabled:i,onClick:async()=>{a(!0),await ei(`claude`,{kind:`agent`,slug:e}),a(!1)},children:i?`…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new`]})})]}),(0,S.jsxs)(`div`,{className:`side-list`,children:[r.map(n=>(0,S.jsxs)(M,{href:`/agents/${encodeURIComponent(e)}/chat/${n.id}`,className:`side-row ${n.id===t?`active`:``}`,children:[(0,S.jsx)(`span`,{className:`lamp ${n.awaitingApproval?`blocked`:n.busy?`running`:`pending`}`,title:n.awaitingApproval?`waiting for your approval`:void 0}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsx)(`div`,{className:`side-row-top`,children:(0,S.jsx)(`span`,{className:`side-wf`,children:n.title||`new session`})}),(0,S.jsx)(`div`,{className:`side-row-sub`,children:(0,S.jsx)(`span`,{className:`side-when num`,children:Ce(n.updatedAt)})})]}),(0,S.jsx)(`button`,{type:`button`,className:`row-x`,title:`delete session`,onClick:async r=>{r.preventDefault(),r.stopPropagation(),window.confirm(`Delete session "${n.title||n.id}"?`)&&(await fetch(`/api/chats/${n.id}`,{method:`DELETE`}).catch(()=>{}),n.id===t&&j(`/agents/${encodeURIComponent(e)}`))},children:(0,S.jsx)(C,{name:`close`,className:`ms-sm`})})]},n.id)),n&&r.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no sessions yet`})]})]})}function Wa({chatId:e}){let t=B(`/api/chats`,!1),n=(t?.chats??[]).filter(e=>e.scope.kind!==`agent`&&e.scope.kind!==`channel`&&e.scope.kind!==`project`);return(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`chats`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(M,{href:`/agents/chats/new`,className:`open-raw`,children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new`]})]}),(0,S.jsxs)(`div`,{className:`side-list`,children:[n.map(t=>(0,S.jsxs)(M,{href:`/agents/chats/${t.id}`,className:`side-row ${t.id===e?`active`:``}`,children:[(0,S.jsx)(`span`,{className:`lamp ${t.awaitingApproval?`blocked`:t.busy?`running`:`pending`}`,title:t.awaitingApproval?`waiting for your approval`:void 0}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsx)(`div`,{className:`side-row-top`,children:(0,S.jsx)(`span`,{className:`side-wf`,children:t.title||`new chat`})}),(0,S.jsxs)(`div`,{className:`side-row-sub`,children:[(0,S.jsxs)(`span`,{className:`side-req`,children:[t.agent,t.scope.kind===`run`?` · ${t.scope.runId}`:t.scope.kind===`kraftwerk`?` · kraftwerk`:t.scope.kind===`knowledge`?` · knowledge${t.scope.bundle?`:${t.scope.bundle}`:``}`:``]}),(0,S.jsx)(`span`,{className:`side-when num`,children:Ce(t.updatedAt)})]})]}),(0,S.jsx)(`button`,{type:`button`,className:`row-x`,title:`delete chat`,onClick:async n=>{n.preventDefault(),n.stopPropagation(),window.confirm(`Delete chat "${t.title||t.id}"?`)&&(await fetch(`/api/chats/${t.id}`,{method:`DELETE`}).catch(()=>{}),t.id===e&&j(`/agents/chats`))},children:(0,S.jsx)(C,{name:`close`,className:`ms-sm`})})]},t.id)),t&&n.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no chats yet`})]})]})}function Ga({agents:e}){return(0,v.useEffect)(()=>{let t=!0,n=()=>j(`/agents/${encodeURIComponent(e[0].slug)}`,{replace:!0});return fetch(`/api/chats`).then(e=>e.json()).then(r=>{if(!t)return;let i=new Set(e.map(e=>e.slug)),a=r.chats.find(e=>e.scope.kind===`agent`&&i.has(e.scope.slug));a&&a.scope.kind===`agent`?j(`/agents/${encodeURIComponent(a.scope.slug)}/chat/${a.id}`,{replace:!0}):n()}).catch(()=>t&&n()),()=>{t=!1}},[e.map(e=>e.slug).join(`,`)]),(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})}function Ka(){let e=F();return(0,S.jsx)(`div`,{className:`empty empty-action`,children:e?(0,S.jsxs)(`button`,{className:`run-btn`,onClick:()=>j(`/agents/new`),children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` create your first agent`]}):(0,S.jsx)(`span`,{children:`Creating agents needs expert mode — flip the switch in the top bar.`})})}function qa({slug:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)([]),[h,g]=(0,v.useState)(!0),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(``),w=B(`/api/workflows`,!1),T=B(`/api/knowledge`,!1),E=B(`/api/skills`,!1);(0,v.useEffect)(()=>{let t=!0;return fetch(`/api/agents/${encodeURIComponent(e)}`).then(e=>e.ok?e.json():Promise.reject()).then(e=>t&&n(e)).catch(()=>t&&i(!0)),()=>{t=!1}},[e]);async function D(r){if(t){y(!0),x(``);try{let i=await(await fetch(`/api/agents/${encodeURIComponent(e)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({name:t.name,emoji:t.emoji,description:t.description,harness:t.harness,model:t.model,effort:t.effort,group:t.group,system:t.system,workflows:t.workflows,knowledge:t.knowledge,skills:t.skills,...r})})).json();i.error?x(i.error):(n(i),u(``))}catch(e){x(e.message)}y(!1)}}function O(e,t){m(t?[...p,e]:p.filter(t=>t!==e))}async function k(t){y(!0),x(``);try{let r=await(await fetch(`/api/agents/${encodeURIComponent(e)}/archive`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({archived:t})})).json();r.error?x(r.error):n(r)}catch(e){x(e.message)}y(!1)}if(r)return(0,S.jsx)(`div`,{className:`empty`,children:`agent not found`});if(!t)return(0,S.jsx)(`div`,{className:`empty`,children:`loading…`});let ee=e=>(0,S.jsxs)(`div`,{className:`agent-form-row`,style:{marginTop:8},children:[(0,S.jsx)(`button`,{className:`run-btn`,disabled:_,onClick:()=>void D(e),children:_?`saving…`:`save`}),(0,S.jsx)(`button`,{className:`open-raw`,disabled:_,onClick:()=>(u(``),x(``)),children:`cancel`})]});return(0,S.jsxs)(`div`,{className:`agent-view`,children:[(0,S.jsxs)(`div`,{className:`detail-head`,children:[(0,S.jsx)(`span`,{className:`agent-avatar lg`,children:(0,S.jsx)(`span`,{"aria-hidden":!0,children:t.emoji})}),(0,S.jsx)(`h1`,{children:t.name}),(0,S.jsx)(`span`,{className:`chip agent`,children:t.harness}),t.model&&(0,S.jsx)(`span`,{className:`chip`,children:t.model}),t.effort&&(0,S.jsxs)(`span`,{className:`chip`,children:[`effort: `,t.effort]}),t.archived&&(0,S.jsxs)(`span`,{className:`chip archived-chip`,children:[(0,S.jsx)(C,{name:`inventory_2`,className:`ms-sm`}),` archived`]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(M,{href:`/agents/${encodeURIComponent(e)}/edit`,className:`open-raw`,children:`edit`}),t.archived?(0,S.jsxs)(`button`,{className:`run-btn tonal`,disabled:_,onClick:()=>void k(!1),children:[(0,S.jsx)(C,{name:`unarchive`,className:`ms-sm`}),` `,_?`…`:`unarchive`]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`button`,{className:`open-raw`,disabled:_,title:`Hide this agent from the roster — restorable any time`,onClick:()=>void k(!0),children:[(0,S.jsx)(C,{name:`archive`,className:`ms-sm`}),` archive`]}),(0,S.jsx)(`button`,{className:`run-btn`,disabled:a,onClick:async()=>{o(!0),await ei(`claude`,{kind:`agent`,slug:e}),o(!1)},children:a?`starting…`:`new session`})]})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`m3-list`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`m3-row m3-toggle`,onClick:()=>c(!s),children:[(0,S.jsx)(`span`,{className:`m3-ico`,children:(0,S.jsx)(C,{name:`badge`})}),(0,S.jsxs)(`span`,{className:`m3-body`,children:[(0,S.jsx)(`span`,{className:`m3-head`,children:`role`}),!s&&(0,S.jsx)(`span`,{className:`m3-sub m3-ellipsis`,children:(t.system||``).trim().split(`
208
- `)[0]||`empty — expand to give this agent a role`})]}),(0,S.jsx)(`span`,{className:`m3-chev ${s?`open`:``}`,children:(0,S.jsx)(C,{name:`expand_more`,className:`ms-sm`})})]}),s&&l!==`role`&&(0,S.jsxs)(`div`,{className:`m3-expand`,children:[(0,S.jsx)(`pre`,{children:t.system||`(empty — click edit to give this agent a role)`}),(0,S.jsxs)(`div`,{className:`agent-form-row`,style:{marginTop:10},children:[(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>{f(t.system),u(`role`),x(``)},children:[(0,S.jsx)(C,{name:`edit`,className:`ms-sm`}),` edit role`]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`span`,{className:`m3-sub`,children:[`agents/`,t.slug,`/system.md`]})]})]}),s&&l===`role`&&(0,S.jsxs)(`div`,{className:`m3-expand`,children:[(0,S.jsx)(`textarea`,{className:`concept-edit`,rows:Math.min(24,Math.max(8,d.split(`
209
- `).length+2)),value:d,placeholder:`You are the ... for this project. Your job is ...`,onChange:e=>f(e.target.value),spellCheck:!1}),ee({system:d})]}),(0,S.jsxs)(`div`,{className:`m3-row`,children:[(0,S.jsx)(`span`,{className:`m3-ico`,children:(0,S.jsx)(C,{name:`account_tree`})}),(0,S.jsxs)(`span`,{className:`m3-body`,children:[(0,S.jsx)(`span`,{className:`m3-head`,children:`workflows`}),l===`workflows`?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`wf-checks`,children:[(w?.workflows??[]).map(e=>(0,S.jsxs)(`label`,{children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:p.includes(e.slug),onChange:t=>O(e.slug,t.target.checked)}),(0,S.jsx)(`b`,{children:e.slug}),e.description&&(0,S.jsxs)(`span`,{className:`opt-hint`,children:[` — `,e.description]})]},e.slug)),(w?.workflows??[]).length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no workflows in this project`})]}),ee({workflows:p})]}):t.workflows.length===0?(0,S.jsx)(`span`,{className:`m3-sub`,children:`none connected — the agent can run any workflow you connect`}):(0,S.jsx)(`span`,{className:`m3-chips`,children:t.workflows.map(e=>(0,S.jsx)(M,{href:`/workflows/${encodeURIComponent(e)}`,className:`chip`,children:e},e))})]}),l!==`workflows`&&(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>{m(t.workflows),u(`workflows`),x(``)},children:`edit`})]}),(0,S.jsxs)(`div`,{className:`m3-row`,children:[(0,S.jsx)(`span`,{className:`m3-ico`,children:(0,S.jsx)(C,{name:`menu_book`})}),(0,S.jsxs)(`span`,{className:`m3-body`,children:[(0,S.jsx)(`span`,{className:`m3-head`,children:`knowledge`}),l===`knowledge`?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`wf-checks`,children:[(T?.bundles??[]).map(e=>(0,S.jsxs)(`label`,{children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:p.includes(e.name),onChange:t=>O(e.name,t.target.checked)}),(0,S.jsx)(`b`,{children:e.name}),(0,S.jsxs)(`span`,{className:`opt-hint`,children:[` — `,e.concepts,` concepts`]})]},e.name)),(T?.bundles??[]).length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no knowledge bundles in this project`})]}),ee({knowledge:p})]}):t.knowledge.length===0?(0,S.jsx)(`span`,{className:`m3-sub`,children:`none connected — connected bundles are read and kept current by the agent`}):(0,S.jsx)(`span`,{className:`m3-chips`,children:t.knowledge.map(e=>(0,S.jsx)(M,{href:`/knowledge/${encodeURIComponent(e)}`,className:`chip`,children:e},e))})]}),l!==`knowledge`&&(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>{m(t.knowledge),u(`knowledge`),x(``)},children:`edit`})]}),(0,S.jsxs)(`div`,{className:`m3-row`,children:[(0,S.jsx)(`span`,{className:`m3-ico`,children:(0,S.jsx)(C,{name:`extension`})}),(0,S.jsxs)(`span`,{className:`m3-body`,children:[(0,S.jsx)(`span`,{className:`m3-head`,children:`shared skills`}),l===`skills`?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`wf-checks`,children:[(0,S.jsxs)(`label`,{children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:h,onChange:e=>g(e.target.checked)}),(0,S.jsx)(`b`,{children:`all skills`}),(0,S.jsx)(`span`,{className:`opt-hint`,children:` — every discovered skill, including future ones`})]}),!h&&(E?.skills??[]).map(e=>(0,S.jsxs)(`label`,{children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:p.includes(e.name),onChange:t=>O(e.name,t.target.checked)}),(0,S.jsxs)(`b`,{children:[`/`,e.name]}),e.description&&(0,S.jsxs)(`span`,{className:`opt-hint`,children:[` — `,e.description]})]},e.name)),!h&&(E?.skills??[]).length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no skills found (.claude/skills, project or user)`})]}),ee({skills:h?void 0:p})]}):t.skills===void 0?(0,S.jsx)(`span`,{className:`m3-sub`,children:`all discovered skills (default) — invoke with /name in a session`}):t.skills.length===0?(0,S.jsx)(`span`,{className:`m3-sub`,children:`none — this agent runs without skills`}):(0,S.jsx)(`span`,{className:`m3-chips`,children:t.skills.map(e=>(0,S.jsxs)(`span`,{className:`chip`,children:[`/`,e]},e))})]}),l!==`skills`&&(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>{g(t.skills===void 0),m(t.skills??[]),u(`skills`),x(``)},children:`edit`})]})]}),b&&(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,b]})]}),(0,S.jsx)(Ya,{slug:e}),(0,S.jsx)(Xa,{slug:e})]})}var Ja=`---
210
- description: What this skill is for (one line)
211
- ---
212
-
213
- Instructions this agent follows when the skill applies or is invoked with /<name>.
214
- `;function Ya({slug:e}){let t=B(`/api/agents/${encodeURIComponent(e)}/skills`,!1)?.skills??[],[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(``);async function c(t){s(``);let n=await fetch(`/api/agents/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}`),i=await n.json().catch(()=>null);if(!n.ok||!i||i.error)return void s(i?.error??`could not load skill`);r({name:t,content:i.content??``,isNew:!1})}async function l(){if(!n)return;a(!0),s(``);let t=await(await fetch(`/api/agents/${encodeURIComponent(e)}/skills`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:n.name,content:n.content})})).json().catch(()=>({error:`save failed`}));a(!1),t.error?s(t.error):r(null)}async function u(t){window.confirm(`Delete skill "/${t}" of this agent (its folder is removed)?`)&&(await fetch(`/api/agents/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}`,{method:`DELETE`}).catch(()=>{}),n?.name===t&&r(null))}return(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`own skills — only this agent`}),(0,S.jsx)(`span`,{className:`spacer`}),!n&&(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>{r({name:``,content:Ja,isNew:!0}),s(``)},children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new skill`]})]}),t.length===0&&!n&&(0,S.jsxs)(`div`,{className:`viewer-note`,children:[`none — skills in `,(0,S.jsxs)(`code`,{children:[`agents/`,e,`/skills/`]}),` are private to this agent; skills for every agent live in the workspace skills folder.`]}),t.length>0&&!n&&(0,S.jsx)(`div`,{className:`m3-list`,children:t.map(e=>(0,S.jsxs)(`div`,{className:`m3-row`,children:[(0,S.jsx)(`span`,{className:`m3-ico`,children:(0,S.jsx)(C,{name:`extension`})}),(0,S.jsxs)(`span`,{className:`m3-body`,children:[(0,S.jsxs)(`span`,{className:`m3-head`,children:[`/`,e.name]}),(0,S.jsx)(`span`,{className:`m3-sub`,children:e.description||(0,S.jsx)(`code`,{children:`SKILL.md`})})]}),(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>void c(e.name),children:[(0,S.jsx)(C,{name:`edit`,className:`ms-sm`}),` edit`]}),(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>void u(e.name),children:(0,S.jsx)(C,{name:`close`,className:`ms-sm`})})]},e.name))}),n&&(0,S.jsxs)(`div`,{className:`agent-form`,children:[(0,S.jsx)(`div`,{className:`agent-form-row`,children:(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`name — invoked as /<name>`,(0,S.jsx)(`input`,{value:n.name,placeholder:`e.g. report-html`,disabled:!n.isNew,onChange:e=>r({...n,name:e.target.value})})]})}),(0,S.jsxs)(`label`,{className:`agent-field`,children:[`SKILL.md — frontmatter (description) + the instructions`,(0,S.jsx)(`textarea`,{className:`concept-edit`,rows:Math.min(28,Math.max(12,n.content.split(`
215
- `).length+2)),value:n.content,spellCheck:!1,onChange:e=>r({...n,content:e.target.value})})]}),(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsx)(`button`,{className:`run-btn`,disabled:i||!n.name.trim(),onClick:()=>void l(),children:i?`saving…`:`save`}),(0,S.jsx)(`button`,{className:`open-raw`,disabled:i,onClick:()=>r(null),children:`cancel`})]})]}),o&&(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,o]})]})}function Xa({slug:e}){let t=B(`/api/agents/${encodeURIComponent(e)}/routines`,!1)?.routines??[],[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``);async function c(t){a(``);let n=await(await fetch(`/api/agents/${encodeURIComponent(e)}/routines`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})).json();return!n.error||(a(n.error),!1)}async function l(t){s(t),a(``);let n=await(await fetch(`/api/agents/${encodeURIComponent(e)}/routines/${encodeURIComponent(t)}/run`,{method:`POST`})).json();s(``),n.error?a(n.error):n.chatId&&j(`/agents/${encodeURIComponent(e)}/chat/${n.chatId}`)}async function u(t){window.confirm(`Delete routine "${t}"?`)&&await fetch(`/api/agents/${encodeURIComponent(e)}/routines/${encodeURIComponent(t)}`,{method:`DELETE`}).catch(()=>{})}return(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`routines — scheduled prompts`}),(0,S.jsx)(`span`,{className:`spacer`}),!n&&(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>r({name:``,schedule:`0 9 * * 1-5`,prompt:``,enabled:!0}),children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new routine`]})]}),t.length===0&&!n&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`none — a routine messages this agent on a schedule (cron, server local time) and each run opens a new session with the result.`}),t.length>0&&(0,S.jsx)(`div`,{className:`m3-list`,children:t.map(t=>(0,S.jsxs)(`div`,{className:`m3-row`,children:[(0,S.jsx)(`span`,{className:`m3-ico`,children:(0,S.jsx)(C,{name:`schedule`})}),(0,S.jsxs)(`span`,{className:`m3-body`,children:[(0,S.jsxs)(`span`,{className:`m3-head`,children:[t.name,t.lastError&&(0,S.jsx)(`span`,{className:`chip stale`,title:t.lastError,children:`error`}),t.awaitingApproval&&t.lastChatId&&(0,S.jsx)(M,{href:`/agents/${encodeURIComponent(e)}/chat/${t.lastChatId}`,className:`chip attention`,title:`the last run asked for a permission nobody has answered yet`,children:`needs approval`})]}),(0,S.jsxs)(`span`,{className:`m3-sub`,children:[(0,S.jsx)(`code`,{children:t.schedule}),t.enabled?t.nextRunAt?` · next ${Ce(t.nextRunAt)}`:``:` · paused`,` · `,t.lastChatId?(0,S.jsxs)(M,{href:`/agents/${encodeURIComponent(e)}/chat/${t.lastChatId}`,children:[`last run `,Ce(t.lastRunAt)]}):`never ran`]})]}),(0,S.jsx)(`button`,{className:`open-raw`,disabled:o===t.id,onClick:()=>l(t.id),children:o===t.id?`starting…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`play_arrow`,className:`ms-sm`}),` run`]})}),(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>r({id:t.id,name:t.name,schedule:t.schedule,prompt:t.prompt,enabled:t.enabled}),children:`edit`}),(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>void u(t.id),children:`delete`}),(0,S.jsxs)(`label`,{className:`m3-switch`,title:t.enabled?`enabled — click to pause`:`paused — click to enable`,children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:t.enabled,onChange:()=>void c({id:t.id,name:t.name,schedule:t.schedule,prompt:t.prompt,enabled:!t.enabled})}),(0,S.jsx)(`span`,{className:`m3-switch-track`})]})]},t.id))}),n&&(0,S.jsxs)(`div`,{className:`agent-form`,children:[(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`name`,(0,S.jsx)(`input`,{value:n.name,placeholder:`e.g. Morning report`,onChange:e=>r({...n,name:e.target.value})})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{width:200},children:[`schedule (cron)`,(0,S.jsx)(`input`,{value:n.schedule,placeholder:`0 9 * * 1-5`,onChange:e=>r({...n,schedule:e.target.value})})]}),(0,S.jsxs)(`label`,{className:`agent-field wf-checks`,style:{width:90},children:[`enabled`,(0,S.jsxs)(`label`,{children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:n.enabled,onChange:e=>r({...n,enabled:e.target.checked})}),`on`]})]})]}),(0,S.jsxs)(`label`,{className:`agent-field`,children:[`prompt — what to ask this agent on each run`,(0,S.jsx)(`textarea`,{rows:5,value:n.prompt,placeholder:`Check ... and summarize what changed.`,onChange:e=>r({...n,prompt:e.target.value})})]}),(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsx)(`button`,{className:`run-btn`,disabled:!n.name.trim()||!n.prompt.trim(),onClick:async()=>{await c(n)&&r(null)},children:n.id?`save routine`:`create routine`}),(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>(r(null),a(``)),children:`cancel`})]})]}),i&&(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,i]})]})}function Za({slug:e}){let[t,n]=(0,v.useState)(e?null:u()),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),s=B(`/api/workflows`,!1)?.workflows??[],c=B(`/api/knowledge`,!1)?.bundles??[],l=B(`/api/skills`,!1)?.skills??[];(0,v.useEffect)(()=>{e&&fetch(`/api/agents/${encodeURIComponent(e)}`).then(e=>e.ok?e.json():Promise.reject()).then(e=>n({name:e.name,emoji:e.emoji,description:e.description??``,harness:e.harness,model:e.model??``,effort:e.effort??``,group:e.group??``,system:e.system,workflows:e.workflows,knowledge:e.knowledge??[],skillsAll:e.skills===void 0,skills:e.skills??[]})).catch(()=>i(`agent not found`))},[e]);function u(){return{name:``,emoji:`🤖`,description:``,harness:`claude`,model:``,effort:``,group:``,system:``,workflows:[],knowledge:[],skillsAll:!0,skills:[]}}async function d(){if(!t)return;o(!0),i(``);let n=await(await fetch(e?`/api/agents/${encodeURIComponent(e)}`:`/api/agents`,{method:e?`PUT`:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...t,skills:t.skillsAll?void 0:t.skills})})).json();o(!1),n.error?i(n.error):j(`/agents/${encodeURIComponent(n.slug)}/info`)}async function f(){e&&window.confirm(`Delete agent "${e}" and its definition folder?`)&&(await fetch(`/api/agents/${encodeURIComponent(e)}`,{method:`DELETE`}).catch(()=>{}),j(`/agents`))}if(!t)return(0,S.jsx)(`div`,{className:`empty`,children:r||`loading…`});let p=e=>n({...t,...e});return(0,S.jsxs)(`div`,{className:`new-chat`,children:[(0,S.jsx)(`div`,{className:`page-head`,children:(0,S.jsx)(`h1`,{children:e?`edit ${e}`:`new agent`})}),(0,S.jsx)(`section`,{className:`panel new-chat-panel`,children:(0,S.jsxs)(`div`,{className:`agent-form`,children:[(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`name`,(0,S.jsx)(`input`,{value:t.name,placeholder:`e.g. Max`,onChange:e=>p({name:e.target.value})})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{width:90},children:[`emoji`,(0,S.jsx)(`input`,{value:t.emoji,onChange:e=>p({emoji:e.target.value})})]})]}),(0,S.jsx)(`div`,{className:`emoji-pick`,children:La.map(e=>(0,S.jsx)(`button`,{type:`button`,className:t.emoji===e?`active`:``,onClick:()=>p({emoji:e}),children:e},e))}),(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`description`,(0,S.jsx)(`input`,{value:t.description,placeholder:`one line: what this agent is for`,onChange:e=>p({description:e.target.value})})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{width:180},children:[`group`,(0,S.jsx)(`input`,{value:t.group,placeholder:`none`,onChange:e=>p({group:e.target.value})})]})]}),(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,style:{width:140},children:[`harness`,(0,S.jsxs)(`select`,{value:t.harness,onChange:e=>p({harness:e.target.value}),children:[(0,S.jsx)(`option`,{value:`claude`,children:`claude`}),(0,S.jsx)(`option`,{value:`codex`,children:`codex`}),(0,S.jsx)(`option`,{value:`pi`,children:`pi`})]})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`model`,(0,S.jsx)(`input`,{value:t.model,placeholder:`harness default — e.g. sonnet, gpt-5.6-sol`,onChange:e=>p({model:e.target.value})})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{width:140},children:[`effort`,(0,S.jsx)(`select`,{value:t.effort,onChange:e=>p({effort:e.target.value}),children:Ia.map(e=>(0,S.jsx)(`option`,{value:e,children:e||`default`},e))})]})]}),(0,S.jsxs)(`label`,{className:`agent-field`,children:[`system prompt — the agent's role`,(0,S.jsx)(`textarea`,{rows:10,value:t.system,placeholder:`You are the ... for this project. Your job is ...`,onChange:e=>p({system:e.target.value})})]}),(0,S.jsxs)(`div`,{className:`agent-field`,children:[(0,S.jsx)(`span`,{className:`agent-field-label`,children:`connected workflows — autoloaded into the agent's context; it can run them`}),(0,S.jsxs)(`div`,{className:`wf-checks`,children:[s.map(e=>(0,S.jsxs)(`label`,{children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:t.workflows.includes(e.slug),onChange:n=>p({workflows:n.target.checked?[...t.workflows,e.slug]:t.workflows.filter(t=>t!==e.slug)})}),(0,S.jsx)(`b`,{children:e.slug}),e.description&&(0,S.jsxs)(`span`,{className:`opt-hint`,children:[` — `,e.description]})]},e.slug)),s.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no workflows in this project`})]})]}),(0,S.jsxs)(`div`,{className:`agent-field`,children:[(0,S.jsx)(`span`,{className:`agent-field-label`,children:`connected knowledge — OKF bundles the agent consults and maintains`}),(0,S.jsxs)(`div`,{className:`wf-checks`,children:[c.map(e=>(0,S.jsxs)(`label`,{children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:t.knowledge.includes(e.name),onChange:n=>p({knowledge:n.target.checked?[...t.knowledge,e.name]:t.knowledge.filter(t=>t!==e.name)})}),(0,S.jsx)(`b`,{children:e.name}),(0,S.jsxs)(`span`,{className:`opt-hint`,children:[` — `,e.concepts,` concepts`]})]},e.name)),c.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no knowledge bundles in this project`})]})]}),(0,S.jsxs)(`div`,{className:`agent-field`,children:[(0,S.jsx)(`span`,{className:`agent-field-label`,children:`connected skills — workspace skill packages (see the skills tab); invoked with /name in sessions`}),(0,S.jsxs)(`div`,{className:`wf-checks`,children:[(0,S.jsxs)(`label`,{children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:t.skillsAll,onChange:e=>p({skillsAll:e.target.checked})}),(0,S.jsx)(`b`,{children:`all skills`}),(0,S.jsx)(`span`,{className:`opt-hint`,children:` — every discovered skill, including future ones`})]}),!t.skillsAll&&l.map(e=>(0,S.jsxs)(`label`,{children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:t.skills.includes(e.name),onChange:n=>p({skills:n.target.checked?[...t.skills,e.name]:t.skills.filter(t=>t!==e.name)})}),(0,S.jsxs)(`b`,{children:[`/`,e.name]}),e.description&&(0,S.jsxs)(`span`,{className:`opt-hint`,children:[` — `,e.description]})]},e.name)),!t.skillsAll&&l.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no skills found (.claude/skills, project or user)`})]})]}),r&&(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,r]}),(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsx)(`button`,{className:`run-btn`,disabled:!t.name.trim()||a,onClick:d,children:a?`saving…`:e?`save`:`create`}),(0,S.jsx)(`span`,{className:`spacer`}),e&&(0,S.jsx)(`button`,{className:`stop-btn`,onClick:f,children:`delete agent`})]})]})})]})}var Qa={enabled:!1,remote:`origin`,branch:``,interval:`300`,autosync:`pull`};function $a(e){let t=e.config.git;return t?{enabled:t.enabled!==!1,remote:t.remote??Qa.remote,branch:t.branch??``,interval:String(t.interval??Qa.interval),autosync:t.autosync??Qa.autosync}:Qa}var eo={enabled:!1,root:``};function to(e){let t=e.config.repos;return t?{enabled:t.enabled!==!1,root:t.root??``}:eo}function no(e){let t=e.config.vibeables;return t?{enabled:t.enabled!==!1,root:t.root??``}:eo}function ro(e){let t=e.config.projects;return t?{enabled:t.enabled!==!1,root:t.root??``}:eo}function io(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!1);if((0,v.useEffect)(()=>{let e=!0,n=()=>fetch(`/api/meta`,{cache:`no-store`}).then(e=>e.json()).then(n=>e&&n.cloud&&t(n.cloud)).catch(()=>{});n();let r=setInterval(n,1e4);return()=>{e=!1,clearInterval(r)}},[]),!e)return null;let i=e.state===`connected`?e.account?`claimed`:`unclaimed`:e.state,a=e.state===`connected`&&e.account?`ok`:e.state===`error`?`failed`:``;return(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`cloud`}),(0,S.jsx)(`span`,{className:`status-word ${a}`,children:i}),(0,S.jsx)(`span`,{className:`spacer`}),e.url&&(0,S.jsxs)(`a`,{className:`run-btn tonal`,href:e.url,target:`_blank`,rel:`noreferrer`,children:[(0,S.jsx)(C,{name:`cloud`,className:`ms-sm`}),` open the cloud`]})]}),(0,S.jsxs)(`div`,{className:`agent-form`,children:[e.state===`off`&&(0,S.jsxs)(`div`,{className:`settings-note`,children:[`Off — `,(0,S.jsx)(`code`,{children:`cloud.enabled: false`}),` in kraftwerk.yml or `,(0,S.jsx)(`code`,{children:`KRAFTWERK_CLOUD_URL=off`}),` in the environment. Every other`,(0,S.jsx)(`code`,{children:` kraftwerk ui`}),` registers with the kraftwerk cloud on start, so its owner can see it running from anywhere.`]}),e.state===`connecting`&&(0,S.jsxs)(`div`,{className:`settings-note`,children:[`Registering with `,e.url,` …`]}),e.state===`error`&&(0,S.jsxs)(`div`,{className:`settings-note`,children:[`Could not reach `,e.url,`: `,e.error,`. Retrying every `,e.interval??60,`s — the UI works as before meanwhile.`]}),e.state===`connected`&&e.account&&(0,S.jsxs)(`div`,{className:`settings-note`,children:[`This workspace is registered at `,(0,S.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:e.url}),` under `,(0,S.jsx)(`strong`,{children:e.account}),`. Last heartbeat `,e.lastSeen?new Date(e.lastSeen).toLocaleTimeString():`pending`,`.`]}),e.state===`connected`&&!e.account&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`settings-note`,children:[`Registered at `,(0,S.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:e.url}),`, not yet under an account. Sign in there and enter this code — or open the link — and the workspace shows up under `,(0,S.jsx)(`em`,{children:`My instances`}),`:`]}),(0,S.jsxs)(`div`,{className:`cloud-claim`,children:[(0,S.jsx)(`code`,{className:`cloud-claim-code`,children:e.claimCode??`…`}),e.claimCode&&(0,S.jsxs)(`button`,{className:`run-btn tonal`,onClick:()=>{navigator.clipboard.writeText(e.claimCode),r(!0),setTimeout(()=>r(!1),1500)},children:[(0,S.jsx)(C,{name:`content_copy`,className:`ms-sm`}),` `,n?`copied`:`copy`]}),e.claimUrl&&(0,S.jsxs)(`a`,{className:`run-btn`,href:e.claimUrl,target:`_blank`,rel:`noreferrer`,children:[(0,S.jsx)(C,{name:`link`,className:`ms-sm`}),` claim in the cloud`]})]}),(0,S.jsxs)(`div`,{className:`settings-note`,children:[`A claim made there reaches this instance with the next heartbeat (every `,e.interval??60,`s). To keep this workspace out of the cloud, set `,(0,S.jsx)(`code`,{children:`cloud.enabled: false`}),` in kraftwerk.yml.`]})]})]})]})}function ao(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)([]),[u,d]=(0,v.useState)(Qa),[f,p]=(0,v.useState)(eo),[m,h]=(0,v.useState)(eo),[g,_]=(0,v.useState)(eo),[y,b]=(0,v.useState)(!1),[x,w]=(0,v.useState)(!1),[T,E]=(0,v.useState)(!1),[D,O]=(0,v.useState)(``);(0,v.useEffect)(()=>{fetch(`/api/settings`).then(e=>e.json()).then(e=>{t(e),r(e.config.name??``),a(e.config.icon??``),s(e.config.color??``),l(e.config.switcher??[]),d($a(e)),p(to(e)),h(no(e)),_(ro(e))}).catch(()=>O(`could not load settings`))},[]);let k=()=>{b(!0),E(!1),O(``)};async function ee(){w(!0),O(``);try{let e=await fetch(`/api/settings`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({name:n,icon:i,color:o,switcher:c,git:{...u,interval:u.interval===``?void 0:Number(u.interval)},repos:f,vibeables:m,projects:g})}),r=await e.json();if(!e.ok)throw Error(r.error||`save failed`);t(r),l(r.config.switcher??[]),d($a(r)),p(to(r)),h(no(r)),_(ro(r)),b(!1),E(!0),window.dispatchEvent(new Event(`kw-meta-refresh`))}catch(e){O(e.message)}finally{w(!1)}}let A=(e,t)=>{l(n=>n.map((n,r)=>r===e?{...n,...t}:n)),k()},j=e=>{d(t=>({...t,...e})),k()},te=e=>{p(t=>({...t,...e})),k()},M=e=>{h(t=>({...t,...e})),k()},ne=e=>{_(t=>({...t,...e})),k()};if(!e)return(0,S.jsx)(`div`,{className:`empty`,children:D||`loading…`});let N=[[`port`,String(e.resolved.port),`kraftwerk ui listens here (CLI --port wins)`],[`workflows`,e.resolved.workflowsRoot??`— none found`,`workflow definitions`],[`output`,e.resolved.outputDir,`run artifacts`],[`knowledge`,e.config.knowledge??`knowledge`,`OKF knowledge bundles`],[`agents`,e.config.agents??`agents`,`agent definitions`],[`skills`,e.config.skills??`skills`,`workspace skills`]];return(0,S.jsxs)(`div`,{className:`settings-screen`,children:[(0,S.jsxs)(`div`,{className:`settings-head`,children:[(0,S.jsxs)(`h1`,{children:[(0,S.jsx)(C,{name:`settings`,className:`ms-lg`}),` Settings`]}),(0,S.jsx)(`span`,{className:`spacer`}),D&&(0,S.jsx)(`span`,{className:`settings-err`,children:D}),T&&!y&&(0,S.jsxs)(`span`,{className:`settings-saved`,children:[(0,S.jsx)(C,{name:`check`,className:`ms-sm`}),` saved`]}),(0,S.jsx)(`button`,{className:`run-btn`,disabled:x||!y,onClick:()=>void ee(),children:x?`saving…`:`save changes`})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`workspace`})}),(0,S.jsxs)(`div`,{className:`agent-form`,children:[(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,style:{width:90},children:[`icon`,(0,S.jsx)(`input`,{value:i,placeholder:`🤖`,onChange:e=>{a(e.target.value),k()}})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`name`,(0,S.jsx)(`input`,{value:n,placeholder:`my workspace`,onChange:e=>{r(e.target.value),k()}})]}),(0,S.jsxs)(`label`,{className:`agent-field settings-color`,style:{width:130},title:`Accent in the workspace switcher; empty = derived from the folder`,children:[`color`,(0,S.jsxs)(`span`,{className:`settings-color-row`,children:[(0,S.jsx)(`input`,{type:`color`,value:/^#[0-9a-f]{6}$/i.test(o)?o:`#888888`,onChange:e=>{s(e.target.value),k()}}),(0,S.jsx)(`input`,{value:o,placeholder:`auto`,onChange:e=>{s(e.target.value),k()}})]})]})]}),(0,S.jsx)(`div`,{className:`settings-note`,children:`Shown in the header, browser tab and to other workspaces discovering this one.`})]})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`workspace switcher`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`button`,{className:`run-btn tonal`,onClick:()=>{l(e=>[...e,{name:``,url:`http://localhost:`}]),k()},children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` add entry`]})]}),(0,S.jsxs)(`div`,{className:`agent-form`,children:[c.length===0&&(0,S.jsx)(`div`,{className:`settings-note`,children:`No manual entries.`}),c.map((e,t)=>(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,style:{width:70},children:[`icon`,(0,S.jsx)(`input`,{value:e.icon??``,placeholder:`•`,onChange:e=>A(t,{icon:e.target.value})})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`name`,(0,S.jsx)(`input`,{value:e.name,placeholder:`other workspace`,onChange:e=>A(t,{name:e.target.value})})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1.4},children:[`url`,(0,S.jsx)(`input`,{value:e.url,placeholder:`http://localhost:1982`,onChange:e=>A(t,{url:e.target.value})})]}),(0,S.jsx)(`button`,{className:`row-x settings-row-x`,title:`remove entry`,onClick:()=>{l(e=>e.filter((e,n)=>n!==t)),k()},children:(0,S.jsx)(C,{name:`close`,className:`ms-sm`})})]},t)),(0,S.jsx)(`div`,{className:`settings-note`,children:`Running workspaces on this machine are discovered automatically — manual entries are for remote instances or extra links.`})]})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`git sync`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`a`,{className:`run-btn tonal`,href:`#/git`,children:[(0,S.jsx)(C,{name:`account_tree`,className:`ms-sm`}),` open git`]})]}),(0,S.jsxs)(`div`,{className:`agent-form`,children:[(0,S.jsxs)(`label`,{className:`settings-check`,children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:u.enabled,onChange:e=>j({enabled:e.target.checked})}),`sync workflows, knowledge, agents and skills with a git remote`]}),u.enabled&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`remote`,(0,S.jsx)(`input`,{value:u.remote,placeholder:`origin`,onChange:e=>j({remote:e.target.value})})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`branch`,(0,S.jsx)(`input`,{value:u.branch,placeholder:`checked-out branch`,onChange:e=>j({branch:e.target.value})})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{width:120},children:[`interval (s)`,(0,S.jsx)(`input`,{type:`number`,min:0,step:1,value:u.interval,placeholder:`300`,onChange:e=>j({interval:e.target.value})})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{width:150},children:[`autosync`,(0,S.jsxs)(`select`,{value:u.autosync,onChange:e=>j({autosync:e.target.value}),children:[(0,S.jsx)(`option`,{value:`pull`,children:`fetch and pull`}),(0,S.jsx)(`option`,{value:`off`,children:`fetch only`})]})]})]}),(0,S.jsx)(`div`,{className:`settings-note`,children:`The interval fetches in the background (0 turns the timer off); with autosync on it also fast-forwards when behind and nothing is modified locally. Commit and push stay manual on the git screen.`})]})]})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`repositories`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`a`,{className:`run-btn tonal`,href:`#/repos`,children:[(0,S.jsx)(C,{name:`source`,className:`ms-sm`}),` open repositories`]})]}),(0,S.jsxs)(`div`,{className:`agent-form`,children:[(0,S.jsxs)(`label`,{className:`settings-check`,children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:f.enabled,onChange:e=>te({enabled:e.target.checked})}),`keep git repositories the agents work on under one folder`]}),f.enabled&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`agent-form-row`,children:(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`repos root`,(0,S.jsx)(`input`,{value:f.root,placeholder:`repos`,onChange:e=>te({root:e.target.value})})]})}),(0,S.jsxs)(`div`,{className:`settings-note`,children:[`Relative to the project root. Saving creates the folder and adds it to .gitignore; every agent gets the list of clones as context and can add more with `,(0,S.jsx)(`code`,{children:`kraftwerk repos add`}),`.`]})]})]})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`vibeables`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`a`,{className:`run-btn tonal`,href:`#/vibeables`,children:[(0,S.jsx)(C,{name:`web`,className:`ms-sm`}),` open vibeables`]})]}),(0,S.jsxs)(`div`,{className:`agent-form`,children:[(0,S.jsxs)(`label`,{className:`settings-check`,children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:m.enabled,onChange:e=>M({enabled:e.target.checked})}),`build small apps live in a chat, with a preview pane next to the thread`]}),m.enabled&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`agent-form-row`,children:(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`vibeables root`,(0,S.jsx)(`input`,{value:m.root,placeholder:`kraftwerk-data/vibeables`,onChange:e=>M({root:e.target.value})})]})}),(0,S.jsxs)(`div`,{className:`settings-note`,children:[`Relative to the project root, one folder per app. Part of the workspace: versioned with it on the git screen, not git-ignored. Every chat gets a `,(0,S.jsx)(`b`,{children:`vibeable`}),` button; the agent then works inside the app folder.`]})]})]})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`projects`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`a`,{className:`run-btn tonal`,href:`#/projects`,children:[(0,S.jsx)(C,{name:`folder_special`,className:`ms-sm`}),` open projects`]})]}),(0,S.jsxs)(`div`,{className:`agent-form`,children:[(0,S.jsxs)(`label`,{className:`settings-check`,children:[(0,S.jsx)(`input`,{type:`checkbox`,checked:g.enabled,onChange:e=>ne({enabled:e.target.checked})}),`gather a goal, its brief, systems of record and links in one folder, and chat inside it`]}),g.enabled&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`agent-form-row`,children:(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`projects root`,(0,S.jsx)(`input`,{value:g.root,placeholder:`kraftwerk-data/projects`,onChange:e=>ne({root:e.target.value})})]})}),(0,S.jsx)(`div`,{className:`settings-note`,children:`Relative to the project root, one folder per project (project.yml, brief.md, state.md, log.md). Part of the workspace: versioned with it on the git screen. A chat opened in a project starts with all of it as context.`})]})]})]}),(0,S.jsx)(io,{}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`paths & port`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`code`,{className:`settings-file`,title:e.configPath,children:e.exists?e.configPath:`${e.configPath} (not created yet)`})]}),(0,S.jsx)(`div`,{className:`settings-kv-list`,children:N.map(([e,t,n])=>(0,S.jsxs)(`div`,{className:`settings-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:e}),(0,S.jsx)(`code`,{children:t}),(0,S.jsx)(`span`,{className:`settings-kv-hint`,children:n})]},e))}),(0,S.jsxs)(`div`,{className:`settings-note`,style:{padding:`0 18px 14px`},children:[`Read-only here — edit `,(0,S.jsx)(`code`,{children:`kraftwerk.yml`}),` directly to change these.`]})]})]})}var oo={running:{label:`running`},stopped:{label:`stopped`},died:{label:`died`,note:`was killed or crashed`},missing:{label:`missing`,note:`folder is gone`},orphaned:{label:`orphaned`,note:`no kraftwerk.yml any more`}};function K(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)({}),[o,s]=(0,v.useState)({}),[c,l]=(0,v.useState)(null),u=(0,v.useCallback)(async()=>{try{let e=await fetch(`/api/workspaces`,{cache:`no-store`});if(e.ok){t(await e.json()),r(``);return}r(e.status===404?`This workspace runs a kraftwerk without the workspaces API. Update it and restart its UI.`:`Could not load the workspace registry (HTTP ${e.status}).`)}catch(e){r(e.message||`Could not reach this workspace's server.`)}},[]);(0,v.useEffect)(()=>{let e=!0,t,n=async()=>{await u(),e&&(t=setTimeout(n,6e3))};return n(),()=>{e=!1,clearTimeout(t)}},[u]);let d=e=>e.root??e.url,f=async(e,t)=>{let n=d(e);a(e=>({...e,[n]:t})),s(e=>({...e,[n]:``})),l(null);try{let n=t===`stop`?{root:e.root,url:e.url}:{root:e.root},r=await ve(`/api/workspaces/${t}`,n);if(!r.ok)throw Error(r.error||`failed`);window.dispatchEvent(new Event(`kw-meta-refresh`))}catch(e){s(t=>({...t,[n]:e.message}))}finally{a(e=>{let t={...e};return delete t[n],t}),u()}},p=e?.filter(e=>e.live).length??0,m=new Map;for(let t of e??[])t.icon&&m.set(t.icon,(m.get(t.icon)??0)+1);let h=e=>!!e&&(m.get(e)??0)>1;return(0,S.jsxs)(`div`,{className:`settings-screen ws-screen`,children:[(0,S.jsxs)(`div`,{className:`settings-head`,children:[(0,S.jsxs)(`h1`,{children:[(0,S.jsx)(C,{name:`hub`,className:`ms-lg`}),` Workspaces`]}),(0,S.jsx)(`span`,{className:`spacer`}),e&&(0,S.jsxs)(`span`,{className:`settings-note`,children:[e.length,` known · `,p,` running`]}),e&&n&&(0,S.jsx)(`span`,{className:`settings-err`,children:n})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`workspaces on this machine`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`span`,{className:`settings-note`,children:[`registry: `,(0,S.jsx)(`code`,{children:`~/.kraftwerk/workspaces`})]})]}),!e&&!n&&(0,S.jsx)(`div`,{className:`ws-empty`,children:`loading…`}),!e&&n&&(0,S.jsxs)(`div`,{className:`ws-empty ws-load-error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,n]}),e&&e.length===0&&(0,S.jsx)(`div`,{className:`ws-empty`,children:`No workspaces known yet.`}),e?.map(e=>{let t=d(e),n=i[t],r=!e.live&&!!e.root&&(e.exists===!1||e.hasConfig===!1);return(0,S.jsxs)(`div`,{className:`ws-row state-${e.state} ${e.current?`current`:``}`,children:[(0,S.jsx)(_e,{className:`ws-icon`,icon:e.icon,name:e.name,color:e.color,seed:e.root??e.url,ambiguous:h(e.icon)}),(0,S.jsxs)(`div`,{className:`ws-main`,children:[(0,S.jsxs)(`div`,{className:`ws-title`,children:[e.live&&!e.current?(0,S.jsx)(`a`,{href:e.url,className:`ws-name${e.named===!1?` unnamed`:``}`,children:e.name}):(0,S.jsx)(`span`,{className:`ws-name${e.named===!1?` unnamed`:``}`,children:e.name}),e.current&&(0,S.jsx)(`span`,{className:`switcher-hint`,children:`current`}),(0,S.jsxs)(`span`,{className:`ws-state ws-state-${e.state}`,children:[e.live&&(0,S.jsx)(`span`,{className:`live-dot`}),oo[e.state].label]}),oo[e.state].note&&(0,S.jsx)(`span`,{className:`ws-note`,children:oo[e.state].note})]}),(0,S.jsx)(`div`,{className:`ws-root`,title:e.root,children:e.rootLabel??(0,S.jsx)(`span`,{className:`ws-dim`,children:`no root recorded (started by an older version)`})}),(0,S.jsxs)(`div`,{className:`ws-meta`,children:[e.state!==`missing`&&e.state!==`orphaned`&&(0,S.jsx)(`span`,{children:e.url.replace(/^https?:\/\//,``)}),e.counts&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`span`,{children:[e.counts.agents,` agents`]}),(0,S.jsxs)(`span`,{children:[e.counts.workflows,` workflows`]}),(0,S.jsxs)(`span`,{children:[e.counts.runs,` runs`]}),(0,S.jsxs)(`span`,{children:[e.counts.chats,` chats`]})]}),e.lastStarted&&(0,S.jsxs)(`span`,{title:e.lastStarted,children:[`started `,we(e.lastStarted)]}),!e.live&&e.lastStopped&&(0,S.jsxs)(`span`,{title:e.lastStopped,children:[`stopped `,we(e.lastStopped)]}),e.startCount!=null&&(0,S.jsxs)(`span`,{children:[e.startCount,`× launched`]}),e.firstSeen&&(0,S.jsxs)(`span`,{title:e.firstSeen,children:[`first seen `,we(e.firstSeen)]})]}),o[t]&&(0,S.jsx)(`div`,{className:`settings-err`,children:o[t]})]}),(0,S.jsxs)(`div`,{className:`ws-actions`,children:[e.live&&!e.current&&(0,S.jsxs)(`a`,{className:`ws-btn`,href:e.url,title:`Open this workspace`,children:[(0,S.jsx)(C,{name:`open_in_new`,className:`ms-sm`}),` open`]}),!e.live&&e.root&&e.exists!==!1&&!e.dirGone&&(0,S.jsxs)(`button`,{className:`ws-btn primary`,disabled:!!n,onClick:()=>void f(e,`start`),children:[(0,S.jsx)(C,{name:n===`start`?`progress_activity`:`play_arrow`,className:`ms-sm`}),n===`start`?`starting…`:`start`]}),e.live&&!e.current&&(0,S.jsxs)(`button`,{className:`ws-btn danger`,disabled:!!n,onClick:()=>void f(e,`stop`),children:[(0,S.jsx)(C,{name:n===`stop`?`progress_activity`:`stop`,className:`ms-sm`}),n===`stop`?`stopping…`:`stop`]}),r&&c!==t&&(0,S.jsxs)(`button`,{className:`ws-btn`,disabled:!!n,title:`Drop this project from the registry (files untouched)`,onClick:()=>l(t),children:[(0,S.jsx)(C,{name:`delete`,className:`ms-sm`}),` remove`]}),r&&c===t&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`button`,{className:`ws-btn danger`,onClick:()=>void f(e,`forget`),children:[(0,S.jsx)(C,{name:`delete`,className:`ms-sm`}),` confirm remove`]}),(0,S.jsx)(`button`,{className:`ws-btn`,onClick:()=>l(null),children:`cancel`})]})]})]},t)})]}),(0,S.jsxs)(`p`,{className:`settings-note`,children:[`Start launches `,(0,S.jsx)(`code`,{children:`kraftwerk ui`}),` detached in the project root (log in `,(0,S.jsx)(`code`,{children:`~/.kraftwerk/logs`}),`). Stop sends SIGTERM to the running server. Remove is offered only for records whose root no longer holds a `,(0,S.jsx)(`code`,{children:`kraftwerk.yml`}),` — the same from the terminal:`,` `,(0,S.jsx)(`code`,{children:`kraftwerk workspaces`}),`.`]})]})}function q(e){if(e<60)return`${e}s`;let t=Math.round(e/60);if(t<60)return`${t} min`;let n=Math.floor(t/60),r=t%60;return r?`${n} h ${r} min`:`${n} h`}var so=[[/^(\+\+\+|---|diff |index )/,`d-meta`],[/^@@/,`d-hunk`],[/^\+/,`d-add`],[/^-/,`d-del`]],co=e=>so.find(([t])=>t.test(e))?.[1]??``;function lo({file:e}){return(0,S.jsx)(uo,{url:`/api/git/diff?path=${encodeURIComponent(e)}`})}function uo({url:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``);return(0,v.useEffect)(()=>{let t=!0;return n(null),o(``),fetch(e).then(e=>e.json()).then(e=>{t&&(n(e.diff??``),i(!!e.truncated),o(e.error??``))}).catch(()=>t&&o(`could not load the diff`)),()=>{t=!1}},[e]),a?(0,S.jsx)(`div`,{className:`git-diff git-diff-error`,children:a}):t===null?(0,S.jsx)(`div`,{className:`git-diff`,children:`loading…`}):t.trim()?(0,S.jsxs)(`pre`,{className:`git-diff`,children:[t.split(`
216
- `).map((e,t)=>(0,S.jsxs)(`span`,{className:co(e),children:[e||` `,`
217
- `]},t)),r&&(0,S.jsxs)(`span`,{className:`d-meta`,children:[`… diff truncated, see the rest in a terminal`,`
218
- `]})]}):(0,S.jsx)(`div`,{className:`git-diff`,children:`no textual diff (binary or empty)`})}function fo(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(new Set),[i,a]=(0,v.useState)(new Set),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),m=(0,v.useCallback)(async()=>{try{let e=await fetch(`/api/git`,{cache:`no-store`});e.ok&&t(await e.json())}catch{}},[]);(0,v.useEffect)(()=>{let e=!0,t,n=async()=>{await m(),e&&(t=setTimeout(n,6e3))};return n(),()=>{e=!1,clearTimeout(t)}},[m]),(0,v.useEffect)(()=>{if(!e?.files)return;let t=new Set(e.files.filter(e=>e.syncable).map(e=>e.path));r(e=>{let n=new Set([...e].filter(e=>t.has(e)));return n.size===e.size?e:n})},[e]);let h=async(e,t)=>{l(e),d(``),p(``);try{let n=await ve(`/api/git/${e}`,t);n.ok?p(e===`push`?`pushed`:e===`pull`?`pulled`:`fetched`):d(n.error||`${e} failed`)}catch(t){d(t.message||`${e} failed`)}finally{l(``)}m()},g=async()=>{l(`commit`),d(``),p(``);try{let e=await ve(`/api/git/commit`,{paths:[...n],message:o});e.ok?(p(`committed ${n.size} file${n.size===1?``:`s`}`),r(new Set),s(``)):d(e.error||`commit failed`)}catch(e){d(e.message||`commit failed`)}finally{l(``)}m()};if(!e)return(0,S.jsx)(`div`,{className:`settings-screen`,children:(0,S.jsx)(`div`,{className:`ws-empty`,children:`loading…`})});if(!e.enabled)return(0,S.jsxs)(`div`,{className:`settings-screen`,children:[(0,S.jsx)(`div`,{className:`settings-head`,children:(0,S.jsxs)(`h1`,{children:[(0,S.jsx)(C,{name:`cloud_sync`,className:`ms-lg`}),` Git sync`]})}),(0,S.jsx)(`section`,{className:`panel`,children:(0,S.jsxs)(`div`,{className:`ws-empty`,children:[`Git sync is off. Turn it on in `,(0,S.jsx)(`a`,{href:`#/settings`,children:`settings`}),`, or add a `,(0,S.jsx)(`code`,{children:`git:`}),` block to kraftwerk.yml.`]})})]});let _=(e.files??[]).filter(e=>e.syncable),y=(e.files??[]).filter(e=>!e.syncable),b=(e,t)=>r(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r});return(0,S.jsxs)(`div`,{className:`settings-screen ws-screen`,children:[(0,S.jsxs)(`div`,{className:`settings-head`,children:[(0,S.jsxs)(`h1`,{children:[(0,S.jsx)(C,{name:`cloud_sync`,className:`ms-lg`}),` Git sync`]}),(0,S.jsx)(`span`,{className:`spacer`}),f&&(0,S.jsxs)(`span`,{className:`settings-saved`,children:[(0,S.jsx)(C,{name:`check`,className:`ms-sm`}),` `,f]}),u&&(0,S.jsx)(`span`,{className:`settings-err`,children:u})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`branch`}),(0,S.jsx)(`span`,{className:`spacer`}),e.lastFetch&&(0,S.jsxs)(`span`,{className:`settings-note`,title:e.lastFetch,children:[`fetched `,we(e.lastFetch)]}),e.lastError&&(0,S.jsxs)(`span`,{className:`settings-err git-sync-err`,title:e.lastError,children:[(0,S.jsx)(C,{name:`cloud_off`,className:`ms-sm`}),` `,e.lastError.split(`
219
- `)[0]]})]}),e.error?(0,S.jsxs)(`div`,{className:`ws-empty ws-load-error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,e.error]}):(0,S.jsxs)(`div`,{className:`git-head`,children:[(0,S.jsxs)(`div`,{className:`git-branch`,children:[(0,S.jsx)(C,{name:`account_tree`,className:`ms-sm`}),(0,S.jsx)(`strong`,{children:e.branch}),e.upstream?(0,S.jsxs)(`span`,{className:`settings-note`,children:[`tracking `,e.upstream]}):(0,S.jsx)(`span`,{className:`settings-note`,children:`no upstream yet, push sets one`})]}),(0,S.jsxs)(`div`,{className:`git-counts`,children:[e.diverged&&(0,S.jsx)(`span`,{className:`git-diverged`,children:`diverged, resolve in a terminal`}),!!e.behind&&(0,S.jsxs)(`span`,{className:`git-behind`,children:[e.behind,` behind`]}),!!e.ahead&&(0,S.jsxs)(`span`,{className:`git-ahead`,children:[e.ahead,` ahead`]}),!e.ahead&&!e.behind&&(0,S.jsx)(`span`,{className:`settings-note`,children:`up to date`})]}),(0,S.jsxs)(`div`,{className:`ws-actions`,children:[(0,S.jsxs)(`button`,{className:`ws-btn`,disabled:!!c,onClick:()=>void h(`fetch`),children:[(0,S.jsx)(C,{name:c===`fetch`?`progress_activity`:`refresh`,className:`ms-sm`}),` fetch`]}),(0,S.jsxs)(`button`,{className:`ws-btn`,disabled:!!c||!e.behind||e.diverged,title:e.diverged?`Diverged. Resolve in a terminal.`:`Fast-forward to the remote`,onClick:()=>void h(`pull`),children:[(0,S.jsx)(C,{name:c===`pull`?`progress_activity`:`download`,className:`ms-sm`}),` pull`]}),(0,S.jsxs)(`button`,{className:`ws-btn primary`,disabled:!!c||!e.ahead&&!!e.upstream,title:e.upstream?`Push to the upstream`:`Push and set the upstream`,onClick:()=>void h(`push`),children:[(0,S.jsx)(C,{name:c===`push`?`progress_activity`:`upload`,className:`ms-sm`}),` push`]})]})]})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`changes`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`span`,{className:`settings-note`,children:_.length===0?`workspace clean`:`${n.size} of ${_.length} selected`})]}),_.length===0&&y.length===0&&(0,S.jsx)(`div`,{className:`ws-empty`,children:`Nothing changed under the workspace paths.`}),_.map(e=>(0,S.jsxs)(`div`,{className:`git-row`,children:[(0,S.jsx)(`label`,{className:`git-pick`,children:(0,S.jsx)(`input`,{type:`checkbox`,checked:n.has(e.path),onChange:t=>b(e.path,t.target.checked)})}),(0,S.jsxs)(`button`,{className:`git-file`,onClick:()=>a(t=>{let n=new Set(t);return n.has(e.path)?n.delete(e.path):n.add(e.path),n}),children:[(0,S.jsx)(C,{name:i.has(e.path)?`expand_more`:`chevron_right`,className:`ms-sm`}),(0,S.jsx)(`span`,{className:`git-status s-${e.status}`,children:e.status}),(0,S.jsx)(`span`,{className:`git-path`,children:e.path})]}),i.has(e.path)&&(0,S.jsx)(lo,{file:e.path})]},e.path)),_.length>0&&(0,S.jsxs)(`div`,{className:`git-commit`,children:[(0,S.jsx)(`input`,{className:`git-message`,placeholder:`Commit message`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!c&&o.trim()&&n.size>0&&g()}}),(0,S.jsx)(`button`,{className:`ws-btn`,disabled:n.size===_.length,onClick:()=>r(new Set(_.map(e=>e.path))),children:`select all`}),(0,S.jsxs)(`button`,{className:`ws-btn primary`,disabled:!!c||n.size===0||!o.trim(),onClick:()=>void g(),children:[(0,S.jsx)(C,{name:c===`commit`?`progress_activity`:`check`,className:`ms-sm`}),`commit `,n.size||``]})]}),y.length>0&&(0,S.jsxs)(`details`,{className:`git-blocked`,children:[(0,S.jsxs)(`summary`,{children:[y.length,e.blockedHidden?`+`:``,` change`,y.length===1&&!e.blockedHidden?``:`s`,` outside the workspace paths`]}),y.map(e=>(0,S.jsxs)(`div`,{className:`git-row blocked`,children:[(0,S.jsx)(`span`,{className:`git-status s-blocked`,children:e.status}),(0,S.jsx)(`span`,{className:`git-path`,children:e.path}),(0,S.jsx)(`span`,{className:`settings-note`,children:e.reason})]},e.path)),!!e.blockedHidden&&(0,S.jsx)(`div`,{className:`git-row blocked`,children:(0,S.jsxs)(`span`,{className:`settings-note`,children:[`and `,e.blockedHidden,` more, not listed`]})})]})]}),(0,S.jsxs)(`p`,{className:`settings-note`,children:[`Synced paths: `,(e.scope??[]).map((e,t)=>(0,S.jsxs)(`span`,{children:[t>0&&`, `,(0,S.jsx)(`code`,{children:e})]},e)),`. Run artifacts and files like `,(0,S.jsx)(`code`,{children:`.env`}),` are never staged.`,` `,e.interval?`Fetches every ${q(e.interval)}${e.autosync===`pull`?` and fast-forwards when the working tree is clean`:``}. `:`Background fetching is off. `,`Commit and push are always manual.`]})]})}var po=e=>e.replace(/^https?:\/\//,``).replace(/^git@([^:]+):/,`$1/`).replace(/\.git$/,``),mo=e=>e.error?{label:`unreadable`,cls:`missing`}:e.dirty?{label:`${e.dirty} changed`,cls:`died`}:e.ahead?{label:`${e.ahead} to push`,cls:`running`}:e.behind?{label:`${e.behind} behind`,cls:`stopped`}:{label:`clean`,cls:`running`},ho=e=>!!(e.error||e.dirty||e.ahead===void 0||e.ahead);function go({slug:e}){return e?(0,S.jsx)(_o,{slug:e}):(0,S.jsx)(vo,{})}function _o({slug:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(0),h=F(),g=(0,v.useCallback)(async()=>{try{let t=await fetch(`/api/repos/${encodeURIComponent(e)}`,{cache:`no-store`}),r=await t.json();if(!t.ok)throw Error(r.error||`HTTP ${t.status}`);n(r),i(``)}catch(e){i(e.message||`could not load the repository`)}},[e]);(0,v.useEffect)(()=>{let e=!0,t,n=async()=>{await g(),e&&(t=setTimeout(n,5e3))};return n(),()=>{e=!1,clearTimeout(t)}},[g,p]);let _=async()=>{u(`update`),f(``);try{let t=await fetch(`/api/repos/${encodeURIComponent(e)}/update`,{method:`POST`}),n=await t.json();if(!t.ok||!n.ok)throw Error(n.error||`failed`);n.error&&f(n.error)}catch(e){f(e.message)}finally{u(``),m(e=>e+1)}};if(r&&!t)return(0,S.jsxs)(`div`,{className:`settings-screen ws-screen repos-screen repo-page`,children:[(0,S.jsxs)(`div`,{className:`settings-head`,children:[(0,S.jsxs)(M,{href:`/repos`,className:`open-raw`,title:`all repositories`,children:[(0,S.jsx)(C,{name:`arrow_back`,className:`ms-sm`}),` repositories`]}),(0,S.jsxs)(`h1`,{children:[(0,S.jsx)(C,{name:`folder_data`,className:`ms-lg`}),` `,e]})]}),(0,S.jsx)(`div`,{className:`settings-err`,children:r})]});if(!t)return(0,S.jsx)(`div`,{className:`empty`,children:`loading…`});let y=mo(t),b=t.commits.filter(e=>e.local).length;return(0,S.jsxs)(`div`,{className:`settings-screen ws-screen repos-screen repo-page`,children:[(0,S.jsxs)(`div`,{className:`settings-head`,children:[(0,S.jsxs)(M,{href:`/repos`,className:`open-raw`,title:`all repositories`,children:[(0,S.jsx)(C,{name:`arrow_back`,className:`ms-sm`}),` repositories`]}),(0,S.jsxs)(`h1`,{children:[(0,S.jsx)(C,{name:`folder_data`,className:`ms-lg`}),` `,t.slug]}),t.branch&&(0,S.jsx)(`span`,{className:`repo-branch`,children:t.branch}),t.upstream&&(0,S.jsxs)(`span`,{className:`settings-note`,title:`upstream`,children:[`→ `,t.upstream]}),(0,S.jsx)(`span`,{className:`ws-state ws-state-${y.cls}`,children:y.label}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`button`,{className:`ws-btn`,disabled:!!l,onClick:()=>void _(),title:`git fetch, then fast-forward when clean`,children:[(0,S.jsx)(C,{name:l===`update`?`progress_activity`:`sync`,className:`ms-sm`}),l===`update`?`updating…`:`update`]})]}),(0,S.jsxs)(`div`,{className:`settings-note repo-facts`,children:[t.url&&(0,S.jsx)(`span`,{title:t.url,children:po(t.url)}),h&&(0,S.jsx)(`span`,{title:t.path,children:t.path}),t.head&&(0,S.jsxs)(`span`,{children:[`at `,(0,S.jsx)(`code`,{children:t.head}),t.committedAt?` · ${we(t.committedAt)}`:``]}),!!t.ahead&&(0,S.jsxs)(`span`,{children:[t.ahead,` to push`]}),!!t.behind&&(0,S.jsxs)(`span`,{children:[t.behind,` behind`]}),t.updatedAt&&(0,S.jsxs)(`span`,{children:[`changed `,we(t.updatedAt)]})]}),(t.error||d||r)&&(0,S.jsx)(`div`,{className:`settings-err`,children:t.error||d||r}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`changes · working tree against HEAD`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`span`,{className:`settings-note`,children:[t.files.length,` file`,t.files.length===1?``:`s`,t.insertions||t.deletions?(0,S.jsxs)(S.Fragment,{children:[` · `,(0,S.jsxs)(`span`,{className:`d-add`,children:[`+`,t.insertions]}),` `,(0,S.jsxs)(`span`,{className:`d-del`,children:[`−`,t.deletions]})]}):null]})]}),t.files.length===0&&(0,S.jsx)(`div`,{className:`ws-empty`,children:`Clean — nothing changed since the last commit.`}),t.files.map(n=>(0,S.jsxs)(`div`,{className:`repo-file ${a===n.path?`open`:``}`,"data-file":n.path,children:[(0,S.jsxs)(`button`,{className:`repo-file-row`,onClick:()=>o(a===n.path?null:n.path),children:[(0,S.jsx)(C,{name:a===n.path?`expand_more`:`chevron_right`,className:`ms-sm`}),(0,S.jsx)(`span`,{className:`git-code git-code-${n.status}`,children:n.status}),(0,S.jsx)(`span`,{className:`repo-file-path`,children:n.path})]}),a===n.path&&(0,S.jsx)(uo,{url:`/api/repos/${encodeURIComponent(e)}/diff?path=${encodeURIComponent(n.path)}&v=${encodeURIComponent(t.updatedAt??``)}`})]},n.path))]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`commits · newest first`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`span`,{className:`settings-note`,children:b?`${b} not pushed`:t.commits.length?`all pushed`:``})]}),t.commits.length===0&&(0,S.jsx)(`div`,{className:`ws-empty`,children:`No commits yet.`}),t.commits.map(t=>(0,S.jsxs)(`div`,{className:`repo-commit ${s===t.hash?`open`:``} ${t.local?`local`:``}`,"data-commit":t.short,children:[(0,S.jsxs)(`button`,{className:`repo-file-row`,onClick:()=>c(s===t.hash?null:t.hash),title:t.hash,children:[(0,S.jsx)(C,{name:s===t.hash?`expand_more`:`chevron_right`,className:`ms-sm`}),(0,S.jsx)(`code`,{children:t.short}),(0,S.jsx)(`span`,{className:`repo-file-path`,children:t.subject}),t.local&&(0,S.jsx)(`span`,{className:`chip`,children:`not pushed`}),(0,S.jsxs)(`span`,{className:`settings-note`,children:[t.author,` · `,we(t.committedAt)]})]}),s===t.hash&&(0,S.jsx)(uo,{url:`/api/repos/${encodeURIComponent(e)}/commits/${t.hash}`})]},t.hash))]})]})}function vo(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)({}),[o,s]=(0,v.useState)({}),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(``),x=F(),w=(0,v.useCallback)(async()=>{try{let e=await fetch(`/api/repos`,{cache:`no-store`});if(!e.ok)throw Error(`HTTP ${e.status}`);t(await e.json()),r(``)}catch(e){r(e.message||`could not load repositories`)}},[]);(0,v.useEffect)(()=>{let e=!0,t,n=async()=>{await w(),e&&(t=setTimeout(n,15e3))};return n(),()=>{e=!1,clearTimeout(t)}},[w]);let T=async(e,t,n=!1)=>{a(n=>({...n,[e]:t})),s(t=>({...t,[e]:``})),l(null);try{let r=t===`update`?await fetch(`/api/repos/${encodeURIComponent(e)}/update`,{method:`POST`}):await fetch(`/api/repos/${encodeURIComponent(e)}${n?`?force=1`:``}`,{method:`DELETE`}),i=await r.json();if(!r.ok||!i.ok)throw Error(i.error||`failed`);i.error&&s(t=>({...t,[e]:i.error}))}catch(t){s(n=>({...n,[e]:t.message}))}finally{a(t=>{let n={...t};return delete n[e],n}),w()}},E=async e=>{if(e.preventDefault(),u.trim()&&!g){_(!0),b(``);try{let e=await fetch(`/api/repos`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({url:u.trim(),name:f.trim()||void 0,branch:m.trim()||void 0})}),t=await e.json();if(!e.ok)throw Error(t.error||`clone failed`);d(``),p(``),h(``),await w()}catch(e){b(e.message)}finally{_(!1)}}},D=[...e?.repos??[]].sort((e,t)=>(t.updatedAt??``).localeCompare(e.updatedAt??``));return(0,S.jsxs)(`div`,{className:`settings-screen ws-screen repos-screen`,children:[(0,S.jsxs)(`div`,{className:`settings-head`,children:[(0,S.jsxs)(`h1`,{children:[(0,S.jsx)(C,{name:`source`,className:`ms-lg`}),` Repositories`]}),(0,S.jsx)(`span`,{className:`spacer`}),e?.enabled&&(0,S.jsxs)(`span`,{className:`settings-note`,children:[D.length,` cloned`]}),n&&(0,S.jsx)(`span`,{className:`settings-err`,children:n})]}),e&&!e.enabled&&(0,S.jsx)(`section`,{className:`panel`,children:(0,S.jsx)(`div`,{className:`ws-empty`,children:e.error&&!/are off/.test(e.error)?(0,S.jsx)(`span`,{className:`settings-err`,children:e.error}):(0,S.jsxs)(S.Fragment,{children:[`Repositories are off. Turn them on in `,(0,S.jsx)(`a`,{href:`#/settings`,children:`settings`}),` or add a `,(0,S.jsx)(`code`,{children:`repos:`}),` block to kraftwerk.yml.`]})})}),e?.enabled&&(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`add a repository`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`span`,{className:`settings-note`,children:[`clones into `,(0,S.jsx)(`code`,{title:e.root,children:e.root})]})]}),(0,S.jsxs)(`form`,{className:`agent-form`,onSubmit:e=>void E(e),children:[(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:2},children:[`url`,(0,S.jsx)(`input`,{value:u,placeholder:`https://github.com/org/repo.git, git@host:org/repo.git or github:org/repo`,onChange:e=>d(e.target.value),autoFocus:!0})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`name`,(0,S.jsx)(`input`,{value:f,placeholder:`from the url`,onChange:e=>p(e.target.value)})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{width:140},children:[`branch`,(0,S.jsx)(`input`,{value:m,placeholder:`default`,onChange:e=>h(e.target.value)})]}),(0,S.jsxs)(`button`,{className:`ws-btn primary`,type:`submit`,disabled:g||!u.trim(),children:[(0,S.jsx)(C,{name:g?`progress_activity`:`download`,className:`ms-sm`}),g?`cloning…`:`clone`]})]}),y&&(0,S.jsx)(`div`,{className:`settings-err`,children:y}),(0,S.jsxs)(`div`,{className:`settings-note`,children:[`Uses your own git credentials and never prompts: a private remote must already work from a terminal. Agents see every clone here and can add more with `,(0,S.jsx)(`code`,{children:`kraftwerk repos add`}),`.`]})]})]}),e?.enabled&&(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`cloned repositories · newest change first`})}),D.length===0&&(0,S.jsx)(`div`,{className:`ws-empty`,children:`Nothing cloned yet.`}),D.map(e=>{let t=i[e.slug],n=mo(e);return(0,S.jsxs)(`div`,{className:`ws-row repo-row state-${n.cls}`,"data-repo":e.slug,children:[(0,S.jsx)(`span`,{className:`switcher-icon ws-icon`,children:(0,S.jsx)(C,{name:`folder_data`})}),(0,S.jsxs)(`div`,{className:`ws-main`,children:[(0,S.jsxs)(`div`,{className:`ws-title`,children:[(0,S.jsx)(M,{href:`/repos/${encodeURIComponent(e.slug)}`,className:`ws-name`,title:`changes and commits`,children:e.slug}),e.branch&&(0,S.jsx)(`span`,{className:`repo-branch`,children:e.branch}),(0,S.jsx)(`span`,{className:`ws-state ws-state-${n.cls}`,children:n.label}),e.updatedAt&&(0,S.jsxs)(`span`,{className:`vibeable-when`,title:e.updatedAt,children:[`changed `,we(e.updatedAt)]})]}),e.url&&(0,S.jsx)(`div`,{className:`ws-root`,title:e.url,children:po(e.url)}),x&&(0,S.jsx)(`div`,{className:`ws-root ws-dim`,title:e.path,children:e.path}),(0,S.jsxs)(`div`,{className:`ws-meta`,children:[e.head&&(0,S.jsxs)(`span`,{title:e.committedAt,children:[(0,S.jsx)(`code`,{children:e.head}),` `,e.subject,e.committedAt?` · ${we(e.committedAt)}`:``]}),!!e.behind&&!!e.dirty&&(0,S.jsxs)(`span`,{children:[`behind by `,e.behind]}),e.error&&(0,S.jsx)(`span`,{className:`settings-err`,children:e.error})]}),o[e.slug]&&(0,S.jsx)(`div`,{className:`settings-err`,children:o[e.slug]})]}),(0,S.jsxs)(`div`,{className:`ws-actions`,children:[(0,S.jsxs)(M,{href:`/repos/${encodeURIComponent(e.slug)}`,className:`ws-btn`,title:`changed files with diffs, recent commits`,children:[(0,S.jsx)(C,{name:`difference`,className:`ms-sm`}),` changes`]}),(0,S.jsxs)(`button`,{className:`ws-btn`,disabled:!!t,onClick:()=>void T(e.slug,`update`),title:`git fetch, then fast-forward when clean`,children:[(0,S.jsx)(C,{name:t===`update`?`progress_activity`:`sync`,className:`ms-sm`}),t===`update`?`updating…`:`update`]}),c!==e.slug&&(0,S.jsxs)(`button`,{className:`ws-btn`,disabled:!!t,onClick:()=>l(e.slug),title:`Delete the clone`,children:[(0,S.jsx)(C,{name:`delete`,className:`ms-sm`}),` remove`]}),c===e.slug&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`button`,{className:`ws-btn danger`,onClick:()=>void T(e.slug,`remove`,ho(e)),children:[(0,S.jsx)(C,{name:`delete`,className:`ms-sm`}),e.dirty||e.ahead?`delete with local changes`:ho(e)?`delete anyway`:`confirm remove`]}),(0,S.jsx)(`button`,{className:`ws-btn`,onClick:()=>l(null),children:`cancel`})]})]})]},e.slug)})]})]})}var yo=[`active`,`paused`,`done`,`archived`],bo={active:`running`,paused:`aborted`,done:`ok`,archived:`aborted`},xo={"my-netnode":`my.netnode.ch`,"google-drive":`Google Drive`,github:`GitHub`,bitbucket:`Bitbucket`,notion:`Notion`,slack:`Slack`,url:`Link`},So=e=>xo[e]??e,Co=[{id:`claude`,label:`claude`,hint:`Claude Code via ACP`},{id:`codex`,label:`codex`,hint:`Codex (ChatGPT) via ACP`},{id:`pi`,label:`pi`,hint:`pi coding agent`}],wo=[``,`low`,`medium`,`high`,`xhigh`,`max`],To=e=>[e.harness,e.model,e.effort?`effort ${e.effort}`:``].filter(Boolean).join(` · `),Eo=(e,t)=>(e??[]).filter(e=>e.scope.kind===`project`&&e.scope.slug===t||e.project===t),Do=(e,t)=>`/projects/${encodeURIComponent(t)}/chat/${e.id}`;async function Oo(e,t){let n=await fetch(`/api/projects/${encodeURIComponent(e)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),r=await n.json();if(!n.ok)throw Error(r.error||`HTTP ${n.status}`);return r}function ko({seg:e}){let t=e[0]&&e[0]!==`new`?decodeURIComponent(e[0]):void 0,n=e[0]===`new`?`new`:e[1]===`info`?`info`:e[1]===`chat`?`chat`:t?`project`:`home`,r=n===`chat`?e[2]:void 0,[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``),c=F(),l=(0,v.useCallback)(async()=>{try{let e=await fetch(`/api/projects`,{cache:`no-store`});if(!e.ok)throw Error(`HTTP ${e.status}`);a(await e.json()),s(``)}catch(e){s(e.message||`could not load projects`)}},[]);(0,v.useEffect)(()=>{let e=!0,t,n=async()=>{await l(),e&&(t=setTimeout(n,15e3))};return n(),()=>{e=!1,clearTimeout(t)}},[l]),(0,v.useEffect)(()=>{l()},[t,n,l]);let u=i?.projects??[],d=t?u.find(e=>e.slug===t):void 0,f=[...u].sort((e,t)=>(t.updatedAt??``).localeCompare(e.updatedAt??``))[0]?.slug;(0,v.useEffect)(()=>{n===`home`&&f&&j(`/projects/${encodeURIComponent(f)}`,{replace:!0})},[n,f]);let p;return p=i&&!i.enabled?(0,S.jsx)(`div`,{className:`empty`,children:i.error&&!/are off/.test(i.error)?(0,S.jsx)(`span`,{className:`settings-err`,children:i.error}):(0,S.jsxs)(S.Fragment,{children:[`Projects are off. Turn them on in `,(0,S.jsx)(`a`,{href:`#/settings`,children:`settings`}),` or add a `,(0,S.jsx)(`code`,{children:`projects:`}),` block to kraftwerk.yml.`]})}):i?n===`new`||n===`home`&&u.length===0?(0,S.jsx)(Ao,{root:i.root,onCreated:l}):n===`home`?(0,S.jsx)(`div`,{className:`empty`,children:`loading…`}):t&&!d?(0,S.jsxs)(`div`,{className:`empty`,children:[`no project named `,t]}):n===`chat`&&t&&r?(0,S.jsx)(`div`,{className:`chat-main`,children:(0,S.jsx)(No,{chatId:r,title:d?.title??t,goal:d?.goal},r)}):n===`info`&&t?(0,S.jsx)(Io,{slug:t,onChanged:l},t):t?(0,S.jsx)(jo,{slug:t,title:d?.title??t},t):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`}),(0,S.jsxs)(`div`,{className:`runs-screen agents-screen projects-screen ${t?`has-sessions`:``}`,children:[(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`projects`}),(0,S.jsx)(`span`,{className:`spacer`}),i?.enabled&&(0,S.jsx)(`span`,{className:`microlabel num`,children:u.length}),i?.enabled&&(c||u.length===0)&&(0,S.jsxs)(M,{href:`/projects/new`,className:`open-raw`,children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new`]})]}),(0,S.jsxs)(`div`,{className:`side-list`,children:[u.map(e=>(0,S.jsxs)(M,{href:`/projects/${encodeURIComponent(e.slug)}`,className:`side-row ${e.slug===t?`active`:``}`,"data-project":e.slug,children:[(0,S.jsx)(`span`,{className:`lamp ${e.configError?`failed`:bo[e.status]}`,title:e.status}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsxs)(`div`,{className:`side-row-top`,children:[(0,S.jsx)(`span`,{className:`side-wf`,children:e.title}),e.updatedAt&&(0,S.jsx)(`span`,{className:`side-when num`,title:e.updatedAt,children:we(e.updatedAt)})]}),(0,S.jsx)(`div`,{className:`side-row-sub`,children:(0,S.jsx)(`span`,{className:`side-req`,children:e.configError?e.configError:e.goal||e.status})})]})]},e.slug)),i&&i.enabled&&u.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no projects yet`}),o&&(0,S.jsx)(`div`,{className:`viewer-note settings-err`,children:o})]})]}),t&&d&&(0,S.jsx)(Po,{slug:t,chatId:r}),(0,S.jsx)(`div`,{className:`runs-main`,children:p})]})}function Ao({root:e,onCreated:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``),u=async e=>{e.preventDefault();let r=n.trim();if(r&&!o){s(!0),l(``);try{let e=await fetch(`/api/projects`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({title:r,goal:i.trim()})}),n=await e.json();if(!e.ok)throw Error(n.error||`HTTP ${e.status}`);j(`/projects/${encodeURIComponent(n.slug)}/info`),t()}catch(e){l(e.message)}finally{s(!1)}}};return(0,S.jsxs)(`form`,{className:`new-chat`,onSubmit:e=>void u(e),children:[(0,S.jsx)(`div`,{className:`page-head`,children:(0,S.jsx)(`h1`,{children:`new project`})}),(0,S.jsx)(`section`,{className:`panel`,children:(0,S.jsxs)(`div`,{className:`agent-form`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,children:[`title`,(0,S.jsx)(`input`,{value:n,placeholder:`e.g. Relaunch netnode.ch`,"aria-label":`project title`,autoFocus:!0,onChange:e=>r(e.target.value)})]}),(0,S.jsxs)(`label`,{className:`agent-field`,children:[`goal (one line)`,(0,S.jsx)(`input`,{value:i,placeholder:`e.g. Ship the new site on NodeHive by November`,"aria-label":`project goal`,onChange:e=>a(e.target.value)})]}),(0,S.jsx)(`div`,{className:`agent-form-row`,children:(0,S.jsxs)(`button`,{className:`run-btn`,type:`submit`,disabled:o||!n.trim(),children:[(0,S.jsx)(C,{name:o?`progress_activity`:`add`,className:`ms-sm`}),o?`creating…`:`create project`]})}),c&&(0,S.jsx)(`div`,{className:`settings-err`,children:c}),(0,S.jsxs)(`div`,{className:`settings-note`,children:[`One folder each under `,(0,S.jsx)(`code`,{title:e,children:e}),` with project.yml, brief.md, state.md and log.md; part of the workspace, commit it from the git screen. Chats opened in the project carry all of it as context.`]})]})})]})}function jo({slug:e,title:t}){let[n,r]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let t=!0;return r(!1),fetch(`/api/chats`).then(e=>e.json()).then(n=>{if(!t)return;let i=n.chats.find(t=>t.scope.kind===`project`&&t.scope.slug===e);i?j(`/projects/${encodeURIComponent(e)}/chat/${i.id}`,{replace:!0}):r(!0)}).catch(()=>t&&r(!0)),()=>{t=!1}},[e]),n?(0,S.jsx)(Mo,{slug:e,title:t}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})}function Mo({slug:e,title:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let t=!0;return fetch(`/api/projects/${encodeURIComponent(e)}`).then(e=>e.ok?e.json():Promise.reject(Error(String(e.status)))).then(e=>t&&r(e)).catch(()=>{}),()=>{t=!1}},[e]);let o=Co.find(e=>e.id===n?.harness)??Co[0];return(0,S.jsxs)(`div`,{className:`new-chat`,children:[(0,S.jsx)(`div`,{className:`page-head`,children:(0,S.jsxs)(`h1`,{children:[`new chat in `,t]})}),(0,S.jsxs)(`section`,{className:`panel new-chat-panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`runs on`})}),(0,S.jsx)(`div`,{className:`agent-pick`,children:(0,S.jsxs)(`button`,{className:`agent-pick-btn active`,disabled:i||!n,onClick:async()=>{a(!0),await ei(o.id,{kind:`project`,slug:e}),a(!1)},children:[(0,S.jsx)(`b`,{children:i?`starting…`:`start chat`}),(0,S.jsx)(`span`,{children:n?`${To(n)} — ${o.hint}`:`…`})]})}),(0,S.jsxs)(`div`,{className:`settings-note`,style:{padding:`0 18px 14px`},children:[`The chat starts with the project's brief, state, systems of record and links as context. Harness, model and effort are set on the `,(0,S.jsx)(M,{href:`/projects/${encodeURIComponent(e)}/info`,children:`project page`}),`, like an agent's.`]})]})]})}function No({chatId:e,title:t,goal:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(0);(0,v.useEffect)(()=>{let t=!0;return fetch(`/api/chats/${e}`).then(e=>e.ok?e.json():Promise.reject(Error(String(e.status)))).then(e=>t&&i(e.meta.scope)).catch(()=>t&&o(!0)),()=>{t=!1}},[e,s]);let l=r?.kind===`channel`?r.slug:void 0,u=B(l?`/api/channels`:``,!1,4e3),d=B(l?`/api/agents`:``,!1,8e3);if(a)return(0,S.jsx)(`div`,{className:`empty`,children:`chat not found`});if(!r)return(0,S.jsx)(`div`,{className:`empty`,children:`loading…`});if(l){let t=u?.channels.find(e=>e.slug===l);return u?t?(0,S.jsx)(oi,{id:e,channel:t,agents:d?.agents??[]},`${e}:channel`):(0,S.jsxs)(`div`,{className:`empty`,children:[`channel #`,l,` is gone — its definition under channels/ was removed`]}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})}return(0,S.jsx)(oi,{id:e,agentName:t,agentDescription:n,onConverted:()=>c(e=>e+1)},`${e}:${s}`)}function Po({slug:e,chatId:t}){let n=B(`/api/chats?for=${encodeURIComponent(t??``)}`,!1),r=Eo(n?.chats,e),[i,a]=(0,v.useState)(!1);return(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`chats`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(M,{href:`/projects/${encodeURIComponent(e)}/info`,className:`open-raw`,title:`project page: brief, state, records, links`,children:`info`}),(0,S.jsx)(`button`,{className:`open-raw`,disabled:i,onClick:async()=>{a(!0),await ei(`claude`,{kind:`project`,slug:e}),a(!1)},children:i?`…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new`]})})]}),(0,S.jsxs)(`div`,{className:`side-list`,children:[r.map(n=>(0,S.jsxs)(M,{href:Do(n,e),className:`side-row ${n.id===t?`active`:``}`,children:[(0,S.jsx)(`span`,{className:`lamp ${n.awaitingApproval?`blocked`:n.busy?`running`:`pending`}`,title:n.awaitingApproval?`waiting for your approval`:void 0}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsx)(`div`,{className:`side-row-top`,children:(0,S.jsxs)(`span`,{className:`side-wf`,children:[n.scope.kind===`channel`&&(0,S.jsx)(C,{name:`forum`,className:`ms-sm`}),n.scope.kind===`channel`?n.title||`#${n.scope.slug}`:n.title||`new chat`]})}),(0,S.jsxs)(`div`,{className:`side-row-sub`,children:[(0,S.jsx)(`span`,{className:`side-req`,children:n.scope.kind===`channel`?`channel session · #${n.scope.slug}`:n.agent}),(0,S.jsx)(`span`,{className:`side-when num`,children:Ce(n.updatedAt)})]})]}),(0,S.jsx)(`button`,{type:`button`,className:`row-x`,title:`delete chat`,onClick:async r=>{r.preventDefault(),r.stopPropagation(),window.confirm(`Delete chat "${n.title||n.id}"?`)&&(await fetch(`/api/chats/${n.id}`,{method:`DELETE`}).catch(()=>{}),n.id===t&&j(`/projects/${encodeURIComponent(e)}`))},children:(0,S.jsx)(C,{name:`close`,className:`ms-sm`})})]},n.id)),n&&r.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no chats yet`})]})]})}var Fo=[{kind:`knowledge`,label:`knowledge`,icon:`menu_book`,href:e=>`/knowledge/${encodeURIComponent(e)}`},{kind:`vibeables`,label:`vibeables`,icon:`web`,href:e=>`/vibeables/${encodeURIComponent(e)}`},{kind:`repos`,label:`repositories`,icon:`source`},{kind:`workflows`,label:`workflows`,icon:`account_tree`,href:e=>`/workflows/${encodeURIComponent(e)}`},{kind:`agents`,label:`agents`,icon:`groups`,href:e=>`/agents/${encodeURIComponent(e)}`}];function Io({slug:e,onChanged:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(``),[x,w]=(0,v.useState)(`active`),[T,E]=(0,v.useState)(`claude`),[D,O]=(0,v.useState)(``),[k,ee]=(0,v.useState)(``),[A,te]=(0,v.useState)(``),[M,ne]=(0,v.useState)(``),[N,P]=(0,v.useState)(!1),[re,ie]=(0,v.useState)(``),ae=F(),I=e=>{r(e),_(e.title),b(e.goal),w(e.status),E(e.harness),O(e.model??``),ee(e.effort??``),te(e.brief),ne(e.state),P(!1)};(0,v.useEffect)(()=>{let t=!0;return fetch(`/api/projects/${encodeURIComponent(e)}`).then(e=>e.ok?e.json():Promise.reject(Error(String(e.status)))).then(e=>t&&I(e)).catch(()=>t&&a(!0)),()=>{t=!1}},[e]);let L=()=>{P(!0),d(!1),s(``)},oe=async(n,i={})=>{l(!0),s(``);try{let a=await Oo(e,n);i.keepEdits?r(a):I(a),d(!i.keepEdits),await t()}catch(e){s(e.message)}finally{l(!1)}},se=async()=>{l(!0);try{let n=await fetch(`/api/projects/${encodeURIComponent(e)}`,{method:`DELETE`}),r=await n.json();if(!n.ok||!r.ok)throw Error(r.error||`failed`);await t(),j(`/projects`,{replace:!0})}catch(e){s(e.message),l(!1)}},ce=async()=>{let t=re.trim();if(t){l(!0),s(``);try{let n=await fetch(`/api/projects/${encodeURIComponent(e)}/log`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({entry:t})}),i=await n.json();if(!n.ok||!i.ok)throw Error(i.error||`failed`);ie(``),r(e=>e&&{...e,log:i.log??e.log})}catch(e){s(e.message)}finally{l(!1)}}};return i?(0,S.jsx)(`div`,{className:`empty`,children:`project not found`}):n?(0,S.jsxs)(`div`,{className:`chat-main project-page`,children:[(0,S.jsxs)(`div`,{className:`detail-head`,children:[(0,S.jsx)(`span`,{className:`agent-avatar lg`,children:(0,S.jsx)(`span`,{"aria-hidden":!0,children:`📁`})}),(0,S.jsx)(`h1`,{children:n.title}),(0,S.jsx)(`span`,{className:`chip status ${bo[n.status]}`,children:n.status}),(0,S.jsx)(`span`,{className:`chip`,title:`harness · model · effort every chat in this project runs on`,children:To(n)}),ae&&(0,S.jsx)(`span`,{className:`rid`,title:n.path,children:n.path}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`button`,{className:`run-btn`,disabled:f,onClick:async()=>{p(!0),await ei(`claude`,{kind:`project`,slug:e}),p(!1)},children:f?`starting…`:`new chat`})]}),n.configError&&(0,S.jsxs)(`div`,{className:`settings-err`,children:[`project.yml: `,n.configError]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`project`}),(0,S.jsx)(`span`,{className:`spacer`}),u&&!N&&(0,S.jsx)(`span`,{className:`settings-note`,children:`saved`}),(0,S.jsx)(`button`,{className:`run-btn`,disabled:c||!N,onClick:()=>void oe({title:g,goal:y,status:x,harness:T,model:D,effort:k,brief:A,state:M}),children:c?`saving…`:`save changes`})]}),(0,S.jsxs)(`div`,{className:`agent-form`,children:[(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`title`,(0,S.jsx)(`input`,{value:g,"aria-label":`title`,onChange:e=>{_(e.target.value),L()}})]}),(0,S.jsxs)(`label`,{className:`agent-field`,children:[`status`,(0,S.jsx)(`select`,{value:x,"aria-label":`status`,onChange:e=>{w(e.target.value),L()},children:yo.map(e=>(0,S.jsx)(`option`,{value:e,children:e},e))})]})]}),(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,style:{width:140},children:[`harness`,(0,S.jsx)(`select`,{value:T,"aria-label":`harness`,onChange:e=>{E(e.target.value),L()},children:Co.map(e=>(0,S.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`model`,(0,S.jsx)(`input`,{value:D,"aria-label":`model`,placeholder:`harness default — e.g. sonnet, gpt-5.6-sol`,onChange:e=>{O(e.target.value),L()}})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{width:140},children:[`effort`,(0,S.jsx)(`select`,{value:k,"aria-label":`effort`,onChange:e=>{ee(e.target.value),L()},children:wo.map(e=>(0,S.jsx)(`option`,{value:e,children:e||`default`},e))})]})]}),(0,S.jsxs)(`label`,{className:`agent-field`,children:[`goal (one line)`,(0,S.jsx)(`input`,{value:y,"aria-label":`goal`,placeholder:`what the project is for`,onChange:e=>{b(e.target.value),L()}})]}),(0,S.jsxs)(`label`,{className:`agent-field`,children:[`brief.md — what done looks like, constraints, stakeholders`,(0,S.jsx)(`textarea`,{rows:10,value:A,"aria-label":`brief`,onChange:e=>{te(e.target.value),L()}})]}),(0,S.jsxs)(`label`,{className:`agent-field`,children:[`state.md — current state, rewritten at the end of a session`,(0,S.jsx)(`textarea`,{rows:6,value:M,"aria-label":`state`,onChange:e=>{ne(e.target.value),L()}})]}),o&&(0,S.jsx)(`div`,{className:`settings-err`,children:o})]})]}),(0,S.jsx)(Vo,{records:n.records,saving:c,onSave:e=>oe({records:e},{keepEdits:!0})}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`links`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`span`,{className:`settings-note`,children:`by name; a target that is missing in this workspace is marked`})]}),(0,S.jsx)(`div`,{className:`m3-list`,children:Fo.map(i=>(0,S.jsx)(zo,{kind:i.kind,label:i.label,icon:i.icon,href:i.href,links:n.links[i.kind],saving:c,onChange:(n,a)=>void Lo(e,i.kind,n,a,e=>{r(e),t()},s)},i.kind))})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`log`}),(0,S.jsx)(`span`,{className:`spacer`})]}),(0,S.jsx)(`div`,{className:`agent-form`,children:(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`new entry — a decision, a milestone`,(0,S.jsx)(`input`,{value:re,"aria-label":`log entry`,placeholder:`e.g. Decided on NodeHive as the CMS`,onChange:e=>ie(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),ce())}})]}),(0,S.jsxs)(`button`,{className:`run-btn tonal`,disabled:c||!re.trim(),onClick:()=>void ce(),children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` log`]})]})}),(0,S.jsx)(`div`,{className:`md-body project-log`,dangerouslySetInnerHTML:{__html:Rr.sanitize(H.parse(n.log||`_no entries yet_`,{async:!1}))}})]}),ae&&(0,S.jsx)(`section`,{className:`panel`,children:(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`danger zone`}),(0,S.jsx)(`span`,{className:`spacer`}),m?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`button`,{className:`stop-btn`,disabled:c,onClick:()=>void se(),children:[(0,S.jsx)(C,{name:`delete`,className:`ms-sm`}),` confirm remove`]}),(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>h(!1),children:`cancel`})]}):(0,S.jsxs)(`button`,{className:`stop-btn`,disabled:c,onClick:()=>h(!0),title:`Delete the folder; its history stays in the workspace git`,children:[(0,S.jsx)(C,{name:`delete`,className:`ms-sm`}),` remove project`]})]})})]}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})}async function Lo(e,t,n,r,i,a){try{let a=await fetch(`/api/projects/${encodeURIComponent(e)}/links`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:t,target:n,remove:r})}),o=await a.json();if(!a.ok)throw Error(o.error||`HTTP ${a.status}`);i(o)}catch(e){a(e.message)}}async function Ro(e){switch(e){case`knowledge`:return(await(await fetch(`/api/knowledge`)).json()).bundles.map(e=>({slug:e.name,hint:`${e.concepts} concepts`}));case`vibeables`:return(await(await fetch(`/api/vibeables`)).json()).vibeables.map(e=>({slug:e.slug,hint:e.dev?`dev`:`static`}));case`repos`:return(await(await fetch(`/api/repos`)).json()).repos.map(e=>({slug:e.slug,hint:e.branch}));case`workflows`:return(await(await fetch(`/api/workflows`)).json()).workflows.map(e=>({slug:e.slug,hint:e.description??e.name}));case`agents`:return(await(await fetch(`/api/agents`)).json()).agents.filter(e=>!e.archived).map(e=>({slug:e.slug,hint:`${e.emoji} ${e.name}`}))}}function zo({kind:e,label:t,icon:n,href:r,links:i,saving:a,onChange:o}){let[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(``);(0,v.useEffect)(()=>{if(!s||l)return;let t=!0;return Ro(e).then(e=>t&&u(e)).catch(()=>t&&u([])),()=>{t=!1}},[s,l,e]);let p=new Set(i.map(e=>e.slug)),m=(l??[]).filter(e=>!p.has(e.slug));return(0,S.jsxs)(`div`,{className:`m3-row`,"data-link-kind":e,children:[(0,S.jsx)(`span`,{className:`m3-ico`,children:(0,S.jsx)(C,{name:n})}),(0,S.jsxs)(`span`,{className:`m3-body`,children:[(0,S.jsx)(`span`,{className:`m3-head`,children:t}),i.length===0&&!s&&(0,S.jsx)(`span`,{className:`m3-sub`,children:`none linked`}),i.length>0&&(0,S.jsx)(`span`,{className:`m3-chips`,children:i.map(e=>(0,S.jsxs)(`span`,{className:`chip ${e.found?``:`attention`}`,title:e.found?e.label:`configured but not found in this workspace`,children:[r&&e.found?(0,S.jsx)(M,{href:r(e.slug),children:e.slug}):e.slug,!e.found&&` · not found`,(0,S.jsx)(`button`,{type:`button`,className:`chip-x`,"aria-label":`unlink ${e.slug}`,disabled:a,onClick:()=>o(e.slug,!0),children:(0,S.jsx)(C,{name:`close`,className:`ms-sm`})})]},e.slug))}),s&&(0,S.jsx)(`span`,{className:`agent-form-row`,style:{marginTop:6},children:l===null?(0,S.jsx)(`span`,{className:`m3-sub`,children:`loading…`}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`select`,{"aria-label":`link ${t}`,value:d,onChange:e=>f(e.target.value),children:[(0,S.jsx)(`option`,{value:``,children:m.length?`pick ${t}…`:`nothing to link`}),m.map(e=>(0,S.jsxs)(`option`,{value:e.slug,children:[e.slug,e.hint?` — ${e.hint}`:``]},e.slug))]}),(0,S.jsx)(`button`,{className:`run-btn tonal`,disabled:a||!d,onClick:()=>{o(d,!1),f(``),c(!1)},children:`link`}),(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>c(!1),children:`cancel`})]})})]}),!s&&(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>c(!0),children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` link`]})]})}var Bo={kind:`url`};function Vo({records:e,saving:t,onSave:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),s=e=>i(t=>({...t??Bo,...e})),c=e=>{let t={kind:e.kind.trim().toLowerCase()||`url`};for(let n of[`title`,`url`,`workspace`,`note`]){let r=(e[n]??``).trim();r&&(t[n]=r)}return t};return(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`systems of record`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`span`,{className:`settings-note`,children:`where the truth is managed outside kraftwerk — context for the agent, not a credential`}),!r&&(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>i({...Bo}),children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` add`]})]}),(0,S.jsxs)(`div`,{className:`m3-list`,children:[e.map((r,i)=>(0,S.jsxs)(`div`,{className:`m3-row`,"data-record-kind":r.kind,children:[(0,S.jsx)(`span`,{className:`m3-ico`,children:(0,S.jsx)(C,{name:`database`})}),(0,S.jsxs)(`span`,{className:`m3-body`,children:[(0,S.jsxs)(`span`,{className:`m3-head`,children:[So(r.kind),r.title&&(0,S.jsx)(`span`,{className:`m3-sub`,children:r.title}),r.workspace&&(0,S.jsxs)(`span`,{className:`chip`,children:[`workspace `,r.workspace]})]}),(r.url||r.note)&&(0,S.jsxs)(`span`,{className:`m3-sub`,children:[r.url&&(0,S.jsx)(`a`,{href:r.url,target:`_blank`,rel:`noreferrer`,children:r.url}),r.url&&r.note&&` — `,r.note]})]}),(0,S.jsx)(`button`,{className:`open-raw`,"aria-label":`remove record ${r.title??r.kind}`,disabled:t,onClick:()=>void n(e.filter((e,t)=>t!==i)),children:(0,S.jsx)(C,{name:`close`,className:`ms-sm`})})]},i)),e.length===0&&!r&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`none yet — e.g. a my.netnode.ch workspace, a Google Drive folder, a board`}),r&&(0,S.jsxs)(`div`,{className:`agent-form`,children:[(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,children:[`kind`,a?(0,S.jsx)(`input`,{value:r.kind,"aria-label":`record kind`,placeholder:`e.g. jira`,onChange:e=>s({kind:e.target.value})}):(0,S.jsxs)(`select`,{value:r.kind,"aria-label":`record kind`,onChange:e=>{e.target.value===`__other`?(o(!0),s({kind:``})):s({kind:e.target.value})},children:[Object.entries(xo).map(([e,t])=>(0,S.jsx)(`option`,{value:e,children:t},e)),(0,S.jsx)(`option`,{value:`__other`,children:`other…`})]})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`title`,(0,S.jsx)(`input`,{value:r.title??``,"aria-label":`record title`,placeholder:`e.g. Contracts folder`,onChange:e=>s({title:e.target.value})})]}),(0,S.jsxs)(`label`,{className:`agent-field`,children:[`workspace / id`,(0,S.jsx)(`input`,{value:r.workspace??``,"aria-label":`record workspace`,placeholder:`e.g. 22`,onChange:e=>s({workspace:e.target.value})})]})]}),(0,S.jsx)(`div`,{className:`agent-form-row`,children:(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`url`,(0,S.jsx)(`input`,{value:r.url??``,"aria-label":`record url`,placeholder:`https://…`,onChange:e=>s({url:e.target.value})})]})}),(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`note — what lives there and how it is usually reached`,(0,S.jsx)(`input`,{value:r.note??``,"aria-label":`record note`,placeholder:`e.g. tickets and roadmap; the my CLI`,onChange:e=>s({note:e.target.value})})]}),(0,S.jsx)(`button`,{className:`run-btn tonal`,disabled:t||!r.kind.trim(),onClick:async()=>{await n([...e,c(r)]),i(null),o(!1)},children:`add record`}),(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>{i(null),o(!1)},children:`cancel`})]})]})]})]})}var Ho=40,Uo=/Mac|iPhone|iPad/.test(navigator.platform),Wo=null,Go=e=>(e?.workspaces??[]).flatMap(e=>[...e.agents.map(t=>({kind:`agent`,agent:t,ws:e,key:`${e.url}|agent|${t.slug}`})),...(e.channels??[]).map(t=>({kind:`channel`,channel:t,ws:e,key:`${e.url}|channel|${t.slug}`}))]),Ko=e=>e.kind===`agent`?e.agent.name:e.channel.name,qo=e=>e.kind===`agent`?e.agent.description:e.channel.purpose,Jo=e=>e.kind===`agent`?`/agents/${encodeURIComponent(e.agent.slug)}`:`/channels/${encodeURIComponent(e.channel.slug)}`;function Yo(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean);if(n.length===0)return e;let r=[],i=new Map;for(let t of e){i.has(t.ws)||i.set(t.ws,i.size);let e=Ko(t).toLowerCase(),a=[e,...t.kind===`agent`?[t.agent.slug,t.agent.description??``,t.agent.group??``,`agent`]:[t.channel.slug,t.channel.purpose??``,`channel`],t.ws.name].join(` `).toLowerCase();if(!n.every(e=>a.includes(e)))continue;let o=e.startsWith(n[0])?0:e.includes(n[0])?1:2;r.push({hit:t,score:o,ws:i.get(t.ws)})}return r.sort((e,t)=>e.ws-t.ws||e.score-t.score).map(e=>e.hit)}function Xo(e){let t=[];for(let n of e){let e=t.find(e=>e.ws===n.ws);e?e.hits.push(n):t.push({ws:n.ws,hits:[n]})}return t}async function Zo(e){let t=Jo(e);if(e.ws.current)return j(t);let n=e.ws.live||!e.ws.root?e.ws.url:await te(e.ws.root);window.location.assign(`${n.replace(/\/+$/,``)}/#${t}`)}function Qo(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`k`&&(e.preventDefault(),t(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`button`,{type:`button`,className:`search-btn`,onClick:()=>t(!0),title:`jump to an agent or channel`,"aria-label":`search`,children:[(0,S.jsx)(C,{name:`search`}),(0,S.jsx)(`kbd`,{className:`kbd`,children:Uo?`⌘K`:`Ctrl K`})]}),e&&(0,S.jsx)($o,{onClose:()=>t(!1)})]})}function $o({onClose:e}){let[t,n]=(0,v.useState)(Wo),[r,i]=(0,v.useState)(Wo===null),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(0),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(``),h=(0,v.useRef)(null);(0,v.useEffect)(()=>{let e=!0;return fetch(`/api/search/agents`,{cache:`no-store`}).then(e=>e.ok?e.json():Promise.reject(Error(String(e.status)))).then(t=>{Wo=t,e&&n(t)}).catch(()=>e&&o(!0)).finally(()=>e&&i(!1)),()=>{e=!1}},[]);let g=(0,v.useMemo)(()=>Go(t),[t]),_=(0,v.useMemo)(()=>Yo(g,s).slice(0,Ho),[g,s]),y=(0,v.useMemo)(()=>Xo(_),[_]),b=Math.min(l,Math.max(_.length-1,0));(0,v.useEffect)(()=>{h.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[b,_]);let x=t=>{if(!d){if(t.ws.current||t.ws.live){e(),Zo(t);return}f(t.key),m(``),Zo(t).catch(e=>{f(null),m(`${t.ws.name}: ${e.message}`)})}},w=t=>{if(t.key===`ArrowDown`)t.preventDefault(),u(_.length?(b+1)%_.length:0);else if(t.key===`ArrowUp`)t.preventDefault(),u(_.length?(b-1+_.length)%_.length:0);else if(t.key===`Enter`){t.preventDefault();let e=_[b];e&&x(e)}else t.key===`Escape`&&(t.preventDefault(),e())},T;if(_.length>0){let e=-1;T=(0,S.jsx)(`ul`,{className:`palette-list`,role:`listbox`,"aria-label":`agents and channels`,ref:h,children:y.map(t=>(0,S.jsxs)(v.Fragment,{children:[(0,S.jsxs)(`li`,{className:`palette-group`,role:`presentation`,title:t.ws.current?`this workspace`:t.ws.url,children:[t.ws.icon&&(0,S.jsx)(`span`,{"aria-hidden":!0,children:t.ws.icon}),(0,S.jsx)(`span`,{className:`palette-group-name`,children:t.ws.name}),t.ws.current?(0,S.jsx)(`span`,{className:`palette-group-note`,children:`this workspace`}):t.ws.live?(0,S.jsx)(C,{name:`open_in_new`,className:`ms-sm`}):(0,S.jsx)(`span`,{className:`palette-chip`,children:`stopped`})]}),t.hits.map(t=>{let n=++e;return(0,S.jsxs)(`li`,{role:`option`,"aria-selected":n===b,className:`palette-item${n===b?` active`:``}`,onMouseMove:()=>n!==b&&u(n),onClick:()=>x(t),children:[(0,S.jsx)(`span`,{className:`palette-emoji`,"aria-hidden":!0,children:t.kind===`agent`?t.agent.emoji:(0,S.jsx)(C,{name:`forum`})}),(0,S.jsxs)(`span`,{className:`palette-text`,children:[(0,S.jsx)(`span`,{className:`palette-name`,children:Ko(t)}),qo(t)&&(0,S.jsx)(`span`,{className:`palette-sub`,children:qo(t)})]}),d===t.key?(0,S.jsx)(C,{name:`progress_activity`,className:`ms-sm`}):t.kind===`channel`&&(0,S.jsx)(`span`,{className:`palette-chip`,children:`channel`})]},t.key)})]},t.ws.url||t.ws.name))})}else T=a?(0,S.jsx)(`div`,{className:`palette-empty`,children:`could not load the agents and channels`}):r?(0,S.jsx)(`div`,{className:`palette-empty`,children:`looking for agents and channels…`}):g.length===0?(0,S.jsxs)(`div`,{className:`palette-empty`,children:[`no agents yet — `,(0,S.jsx)(`a`,{href:`#/agents/new`,onClick:e,children:`create one`})]}):(0,S.jsxs)(`div`,{className:`palette-empty`,children:[`no agent or channel matches “`,s,`”`]});return(0,S.jsx)(`div`,{className:`palette-backdrop`,onMouseDown:e,children:(0,S.jsxs)(`div`,{className:`palette`,role:`dialog`,"aria-label":`jump to an agent or channel`,onMouseDown:e=>e.stopPropagation(),onKeyDown:w,children:[(0,S.jsxs)(`div`,{className:`palette-input`,children:[(0,S.jsx)(C,{name:`search`}),(0,S.jsx)(`input`,{autoFocus:!0,value:s,onChange:e=>{c(e.target.value),u(0)},placeholder:`jump to an agent or channel…`,"aria-label":`search`,autoComplete:`off`,spellCheck:!1}),r&&t&&(0,S.jsx)(C,{name:`progress_activity`,className:`ms-sm`}),(0,S.jsx)(`kbd`,{className:`kbd`,children:`esc`})]}),T,(0,S.jsxs)(`div`,{className:`palette-foot`,children:[(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`kbd`,{className:`kbd`,children:`↑`}),(0,S.jsx)(`kbd`,{className:`kbd`,children:`↓`}),` move`]}),(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`kbd`,{className:`kbd`,children:`↵`}),` open`]}),d&&(0,S.jsxs)(`span`,{className:`palette-note`,children:[(0,S.jsx)(C,{name:`progress_activity`,className:`ms-sm`}),` starting the workspace…`]}),p&&(0,S.jsxs)(`span`,{className:`palette-warn`,title:p,children:[(0,S.jsx)(C,{name:`warning`,className:`ms-sm`}),` `,p]})]})]})})}var es=`modulepreload`,ts=function(e){return`/`+e},ns={},rs=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=ts(t,n),t=s(t),t in ns)return;ns[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`:es,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)})},is=(0,v.lazy)(()=>rs(()=>import(`./editor-CJj1y1g9.js`).then(e=>({default:e.EditorScreen})),__vite__mapDeps([0,1,2,3,4,5,6])).catch(e=>{let t=`kw-chunk-reload`;if(sessionStorage.getItem(t)!==location.hash)return sessionStorage.setItem(t,location.hash),location.reload(),new Promise(()=>{});throw e}));function as(){let[e,t=``]=w().split(`?`),n=e.split(`/`).filter(Boolean),r=new URLSearchParams(t).get(`workflow`)??void 0,[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(!0),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(!1),[x,T]=(0,v.useState)(!1),[E,D]=(0,v.useState)(!1),[O,k]=(0,v.useState)([]);(0,v.useEffect)(()=>{let e=!0,t,n=async()=>{try{let t=await fetch(`/api/meta`,{cache:`no-store`}).then(e=>e.json());if(!e)return;a(t.projectName??``),s(t.projectIcon??``),l(t.projectColor??``),d(t.projectNamed!==!1),p(t.projectRootLabel??``),h(t.projectRoot??``),_(!!t.git),b(!!t.repos),T(!!t.vibeables),D(!!t.projects),I({git:!!t.git,repos:!!t.repos,vibeables:!!t.vibeables,projects:!!t.projects}),k(Array.isArray(t.switcher)?t.switcher:[])}catch{}e&&(t=setTimeout(n,3e4))};n();let r=()=>{clearTimeout(t),n()};return window.addEventListener(`kw-meta-refresh`,r),()=>{e=!1,clearTimeout(t),window.removeEventListener(`kw-meta-refresh`,r)}},[]),(0,v.useEffect)(()=>{if(ee(i?`${i} — kraftwerk`:`kraftwerk inspector`),!o)return;let e=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="0.9em" font-size="85">${o}</text></svg>`,t=document.querySelector(`link[rel="icon"]`);t||(t=document.createElement(`link`),t.rel=`icon`,document.head.appendChild(t)),t.href=`data:image/svg+xml,${encodeURIComponent(e)}`},[i,o]);let A;if(n[0]===`runs`&&n[1])A=(0,S.jsx)(xi,{id:n[1],workflow:r});else if(n[0]===`runs`)A=(0,S.jsx)(ps,{});else if(n[0]===`workflows`&&n[1]){let e=n[2]===`details`||n[2]===`runs`?n[2]:`overview`;A=(0,S.jsx)(Xi,{slug:decodeURIComponent(n[1]),tab:e})}else A=n[0]===`workflows`?(0,S.jsx)(Hi,{}):n[0]===`chats`?(0,S.jsx)(Ra,{seg:n}):n[0]===`skills`?(0,S.jsx)(Na,{name:n[1]?decodeURIComponent(n[1]):void 0}):n[0]===`settings`?(0,S.jsx)(ao,{}):n[0]===`workspaces`?(0,S.jsx)(K,{}):n[0]===`git`?(0,S.jsx)(fo,{}):n[0]===`repos`?(0,S.jsx)(go,{slug:n[1]?decodeURIComponent(n[1]):void 0}):n[0]===`vibeables`?(0,S.jsx)(Gr,{slug:n[1]?decodeURIComponent(n[1]):void 0}):n[0]===`projects`?(0,S.jsx)(ko,{seg:n.slice(1)}):n[0]===`agents`||n[0]===`team`?(0,S.jsx)(Ra,{seg:n.slice(1)}):n[0]===`channels`?(0,S.jsx)(Kr,{seg:n.slice(1)}):n[0]===`knowledge`?(0,S.jsx)(ya,{bundle:n[1]?decodeURIComponent(n[1]):void 0,conceptId:n.length>2?n.slice(2).map(decodeURIComponent).join(`/`):void 0}):(0,S.jsx)(sa,{});if((0,v.useEffect)(()=>{let e=document.documentElement,t=m||i,n=t?he(se(c,t)):null;if(!n){delete e.dataset.wsAccent;return}for(let[t,r]of Object.entries(n))e.style.setProperty(t,r);e.dataset.wsAccent=``},[c,m,i]),n[0]===`edit`&&n[1]&&n.length>2)return(0,S.jsx)(v.Suspense,{fallback:(0,S.jsx)(`div`,{className:`empty`,children:`loading editor…`}),children:(0,S.jsx)(is,{bundle:decodeURIComponent(n[1]),conceptId:n.slice(2).map(decodeURIComponent).join(`/`)},n.slice(1).join(`/`))});let j=(...e)=>e.includes(n[0]??``)?`active`:``;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`header`,{className:`topbar`,style:{"--ws-c":se(c,m||i)},children:[(0,S.jsxs)(`span`,{className:`wordmark`,children:[(0,S.jsx)(`a`,{href:`#/`,className:`home-link`,title:`Dashboard`,children:i?(0,S.jsx)(_e,{className:`home-tile`,icon:o,name:i,color:c,seed:m||i}):(0,S.jsx)(C,{name:`home`})}),i&&(0,S.jsx)(fs,{name:i,icon:o,color:c,named:u,root:f,seed:m||i,entries:O})]}),(0,S.jsxs)(`nav`,{children:[(0,S.jsxs)(`a`,{href:`#/channels`,className:j(`channels`),children:[(0,S.jsx)(C,{name:`forum`}),` channels`]}),E&&(0,S.jsxs)(`a`,{href:`#/projects`,className:j(`projects`),children:[(0,S.jsx)(C,{name:`folder_special`}),` projects`]}),(0,S.jsxs)(`a`,{href:`#/agents`,className:j(`agents`,`team`,`chats`),children:[(0,S.jsx)(C,{name:`groups`}),` agents`]}),(0,S.jsxs)(`a`,{href:`#/workflows`,className:j(`workflows`,`runs`),children:[(0,S.jsx)(C,{name:`account_tree`}),` workflows`]}),(0,S.jsxs)(`a`,{href:`#/knowledge`,className:j(`knowledge`),children:[(0,S.jsx)(C,{name:`menu_book`}),` knowledge`]}),(0,S.jsxs)(`a`,{href:`#/skills`,className:j(`skills`)+` nav-expert`,children:[(0,S.jsx)(C,{name:`extension`}),` skills`]}),y&&(0,S.jsxs)(`a`,{href:`#/repos`,className:j(`repos`)+` nav-expert`,children:[(0,S.jsx)(C,{name:`source`}),` repositories`]}),x&&(0,S.jsxs)(`a`,{href:`#/vibeables`,className:j(`vibeables`),children:[(0,S.jsx)(C,{name:`web`}),` vibeables`]}),g&&(0,S.jsx)(os,{active:n[0]===`git`})]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(Qo,{}),(0,S.jsx)(bs,{}),(0,S.jsx)(gs,{}),(0,S.jsx)(_s,{}),(0,S.jsx)(xs,{})]}),(0,S.jsx)(`main`,{className:`shell`,children:A})]})}function os({active:e}){let t=B(`/api/git`,!1,15e3),n=t?.files?.filter(e=>e.syncable).length??0;return(0,S.jsxs)(`a`,{href:`#/git`,className:e?`nav-expert active`:`nav-expert`,children:[(0,S.jsx)(C,{name:`cloud_sync`}),` git`,!!t?.behind&&(0,S.jsxs)(`span`,{className:`git-badge behind`,children:[t.behind,`↓`]}),!!t?.ahead&&(0,S.jsxs)(`span`,{className:`git-badge ahead`,children:[t.ahead,`↑`]}),!t?.ahead&&!t?.behind&&!!n&&(0,S.jsx)(`span`,{className:`git-badge dirty`,children:n})]})}function ss(e){try{let t=new URL(e);return t.hostname===`localhost`||t.hostname===`127.0.0.1`?`:${t.port||(t.protocol===`https:`?443:80)}`:t.host}catch{return e.replace(/^https?:\/\//,``)}}function cs({label:e}){return e?(0,S.jsx)(`span`,{className:`switcher-root`,title:e,children:(0,S.jsx)(`span`,{dir:`ltr`,children:e})}):null}function ls({name:e,named:t}){let n=t===!1;return(0,S.jsx)(`span`,{className:`switcher-name${n?` unnamed`:``}`,title:n?`${e} — folder name; set name: in kraftwerk.yml`:e,children:e})}function us({entry:e,ambiguous:t}){let[n,r]=(0,v.useState)(`idle`),[i,a]=(0,v.useState)(``),o=e.exists===!1,s=async()=>{r(`starting`),a(``);try{window.location.assign(await te(e.root))}catch(e){r(`error`),a(e.message)}};return(0,S.jsxs)(`span`,{className:`switcher-item stopped ${o?`missing`:``}`,role:`menuitem`,style:{"--ws-c":se(e.color,e.root??e.url)},children:[(0,S.jsx)(_e,{icon:e.icon,name:e.name,color:e.color,seed:e.root??e.url,ambiguous:t}),(0,S.jsxs)(`span`,{className:`switcher-text`,children:[(0,S.jsx)(ls,{name:e.name,named:e.named}),n===`error`?(0,S.jsx)(`span`,{className:`switcher-sub switcher-err`,title:i,children:i}):o?(0,S.jsx)(`span`,{className:`switcher-sub`,children:`folder missing`}):(0,S.jsx)(cs,{label:e.rootLabel})]}),(0,S.jsxs)(`span`,{className:`switcher-side`,children:[(0,S.jsx)(`span`,{className:`switcher-port`,children:ss(e.url)}),(0,S.jsxs)(`button`,{className:`switcher-start`,disabled:o||n===`starting`,title:o?`The project folder no longer exists`:`Start the UI for this project`,onClick:e=>{e.stopPropagation(),s()},children:[n===`starting`?(0,S.jsx)(C,{name:`progress_activity`}):(0,S.jsx)(C,{name:`play_arrow`}),n===`starting`?`starting`:`start`]})]})]})}function ds({entry:e,ambiguous:t}){let n=e.root??e.url;return(0,S.jsxs)(`a`,{className:`switcher-item${e.live?` live`:``}`,role:`menuitem`,href:e.url,style:{"--ws-c":se(e.color,n)},children:[(0,S.jsx)(_e,{icon:e.icon,name:e.name,color:e.color,seed:n,ambiguous:t}),(0,S.jsxs)(`span`,{className:`switcher-text`,children:[(0,S.jsx)(ls,{name:e.name,named:e.named}),(0,S.jsx)(cs,{label:e.rootLabel??(e.root?void 0:e.url.replace(/^https?:\/\//,``))})]}),(0,S.jsx)(`span`,{className:`switcher-side`,children:(0,S.jsxs)(`span`,{className:`switcher-port`,children:[e.live&&(0,S.jsx)(`span`,{className:`live-dot`,title:`running`}),ss(e.url)]})})]})}function fs({name:e,icon:t,color:n,named:r,root:i,seed:a,entries:o}){let[s,c]=(0,v.useState)(!1),l=F();if((0,v.useEffect)(()=>{if(!s)return;let e=e=>{e.target.closest(`.switcher-wrap`)||c(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[s]),o.length===0)return(0,S.jsx)(`span`,{className:`env-name`,title:i||`Project (kraftwerk.yml: name)`,children:e});let u=new Map;for(let e of[t,...o.map(e=>e.icon)])e&&u.set(e,(u.get(e)??0)+1);let d=e=>!!e&&(u.get(e)??0)>1,f=[{key:`running`,label:`running`,items:o.filter(e=>e.live===!0)},{key:`stopped`,label:`stopped`,items:o.filter(e=>e.live===!1)},{key:`linked`,label:`linked`,items:o.filter(e=>e.live===void 0)}].filter(e=>e.items.length>0),p=a||e;return(0,S.jsxs)(`span`,{className:`switcher-wrap`,children:[(0,S.jsxs)(`button`,{className:`env-name env-switch`,title:i?`${i} — switch workspace`:`Switch workspace`,"aria-haspopup":`menu`,"aria-expanded":s,onClick:()=>c(e=>!e),children:[e,(0,S.jsx)(C,{name:`expand_more`})]}),s&&(0,S.jsxs)(`div`,{className:`switcher-pop`,role:`menu`,children:[(0,S.jsx)(`div`,{className:`switcher-head`,children:`Workspaces`}),(0,S.jsxs)(`span`,{className:`switcher-item current`,"aria-current":`true`,style:{"--ws-c":se(n,p)},children:[(0,S.jsx)(_e,{icon:t,name:e,color:n,seed:p,ambiguous:d(t)}),(0,S.jsxs)(`span`,{className:`switcher-text`,children:[(0,S.jsx)(ls,{name:e,named:r}),i?(0,S.jsx)(cs,{label:i}):(0,S.jsx)(`span`,{className:`switcher-sub`,children:`this workspace`})]}),(0,S.jsx)(`span`,{className:`switcher-side`,children:(0,S.jsx)(C,{name:`check`,className:`switcher-check`})})]}),f.map(e=>(0,S.jsxs)(`div`,{className:`switcher-group switcher-group-${e.key}`,role:`group`,"aria-label":e.label,children:[(0,S.jsx)(`div`,{className:`switcher-group-head`,children:e.label}),e.items.map(e=>e.live===!1&&e.root?(0,S.jsx)(us,{entry:e,ambiguous:d(e.icon)},e.root):(0,S.jsx)(ds,{entry:e,ambiguous:d(e.icon)},e.root??e.url))]},e.key)),l&&(0,S.jsxs)(`a`,{className:`switcher-foot`,href:`#/workspaces`,role:`menuitem`,onClick:()=>c(!1),children:[(0,S.jsx)(C,{name:`hub`}),` manage workspaces`]})]})]})}function ps(){let[e,t]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let e=!0;return fetch(`/api/runs`).then(e=>e.json()).then(n=>{e&&(n.runs.length>0?j(`/runs/${n.runs[0].id}`,{replace:!0}):t({outputDir:n.outputDir}))}).catch(()=>{}),()=>{e=!1}},[]),e?(0,S.jsxs)(`div`,{className:`empty`,children:[`No runs found in `,(0,S.jsx)(`code`,{children:e.outputDir}),`. Start one from the`,` `,(0,S.jsx)(`a`,{href:`#/workflows`,children:`workflows`}),` list or with `,(0,S.jsx)(`code`,{children:`kraftwerk run <workflow> [request]`}),`.`]}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})}async function ms(e){await fetch(`/api/restart`,{method:`POST`}).catch(()=>{});for(let t=0;t<60;t++){await new Promise(e=>setTimeout(e,500));try{if((await fetch(`/api/meta`,{cache:`no-store`}).then(e=>e.json())).version===e)break}catch{}}location.reload()}var hs=`kw-version-changed`;function gs(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=!0,n,r=async()=>{clearTimeout(n);try{let n=await fetch(`/api/meta`,{cache:`no-store`}).then(e=>e.json());e&&t(n)}catch{}e&&(n=setTimeout(r,3e4))};r();let i=()=>void r();return window.addEventListener(hs,i),()=>{e=!1,clearTimeout(n),window.removeEventListener(hs,i)}},[]);let i=e?.restartable&&e.diskVersion&&e.diskVersion!==e.version?e.diskVersion:null;async function a(){i&&(r(!0),await ms(i))}return!i&&!n?null:(0,S.jsx)(`button`,{className:`relaunch-note`,disabled:n,title:`v${i} is installed on disk, the server still runs v${e?.version}. Click to relaunch with the new version.`,onClick:()=>void a(),children:n?`relaunching…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`restart_alt`,className:`ms-sm`}),` v`,i,` ready — relaunch`]})})}function _s(){let e=F();return(0,S.jsxs)(`button`,{className:`expert-toggle ${e?`on`:``}`,title:e?`Expert mode on — full detail`:`Expert mode off — simplified view`,"aria-pressed":e,onClick:()=>re(!e),children:[(0,S.jsx)(`span`,{className:`expert-track`,children:(0,S.jsx)(`span`,{className:`expert-knob`})}),`expert`]})}var vs={approval:`gavel`,routine_done:`schedule`,routine_failed:`schedule`,run_done:`account_tree`,run_failed:`account_tree`},ys=`kw.notif.toast.dismissed`;function bs(){let[e,t]=(0,v.useState)(!1),n=B(`/api/notifications`,!1,5e3),[r,i]=(0,v.useState)(()=>typeof Notification>`u`?`unsupported`:Notification.permission),[a,o]=(0,v.useState)(()=>{try{return localStorage.getItem(ys)===`1`}catch{return!1}}),s=(0,v.useRef)(null),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null);(0,v.useEffect)(()=>l(null),[n]);let f=c??n,p=f?.items??[],m=f?.unread??0;(0,v.useEffect)(()=>k(m),[m]),(0,v.useEffect)(()=>{if(n){if(!s.current){s.current=new Set(p.map(e=>e.id));return}for(let e of p)if(!s.current.has(e.id)&&(s.current.add(e.id),!(e.readAt||r!==`granted`)&&(document.hidden||location.hash!==`#${e.href}`)))try{let t=new Notification(e.title,{body:e.body,tag:e.id});t.onclick=()=>{window.focus(),g(e),t.close()}}catch{}}},[n]),(0,v.useEffect)(()=>{if(!e)return;let n=e=>{e.target.closest(`.notif-wrap`)||t(!1)};return window.addEventListener(`mousedown`,n),()=>window.removeEventListener(`mousedown`,n)},[e]);async function h(e,t){try{let n=await fetch(e,{method:e.endsWith(`/notifications`)?`DELETE`:`POST`,headers:{"content-type":`application/json`},body:t===void 0?void 0:JSON.stringify(t)});if(!n.ok)return;let r=await n.json();l(`items`in r?r:{items:[],unread:0})}catch{}}function g(e){t(!1),e.readAt||h(`/api/notifications/read`,{ids:[e.id]}),j(e.href)}async function _(e){d(e.id);try{let n=await(await fetch(`/api/notifications/${encodeURIComponent(e.id)}/diagnose`,{method:`POST`})).json();n.href?(t(!1),j(n.href)):n.error&&alert(n.error)}catch{}d(null)}async function y(){typeof Notification>`u`||i(await Notification.requestPermission())}function b(){o(!0);try{localStorage.setItem(ys,`1`)}catch{}}let x=r==="default"&&!a;return(0,S.jsxs)(`span`,{className:`notif-wrap`,children:[(0,S.jsxs)(`button`,{className:`info-btn notif-btn ${m?`has-unread`:``}`,title:m?`${m} item${m===1?``:`s`} need your attention`:`Notifications`,"aria-label":`Notifications`,onClick:()=>t(e=>!e),children:[(0,S.jsx)(C,{name:m?`notifications_active`:`notifications`}),m>0&&(0,S.jsx)(`span`,{className:`notif-badge`,children:m>99?`99+`:m})]}),e&&(0,S.jsxs)(`div`,{className:`info-pop notif-pop`,role:`menu`,children:[(0,S.jsxs)(`div`,{className:`notif-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`notifications`}),(0,S.jsx)(`span`,{className:`spacer`}),m>0&&(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>void h(`/api/notifications/read`),children:`mark all read`}),p.length>0&&(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>void h(`/api/notifications`),children:`clear`})]}),x&&(0,S.jsxs)(`div`,{className:`notif-hint`,children:[(0,S.jsx)(`span`,{children:`Get a system notification when something needs you, even with this tab in the background.`}),(0,S.jsxs)(`span`,{className:`notif-hint-actions`,children:[(0,S.jsx)(`button`,{className:`ws-btn primary`,onClick:()=>void y(),children:`enable`}),(0,S.jsx)(`button`,{className:`ws-btn`,onClick:b,children:`not now`})]})]}),r===`denied`&&(0,S.jsx)(`div`,{className:`notif-hint muted`,children:`Browser notifications are blocked for this site — allow them in the address bar to get system alerts.`}),p.length===0?(0,S.jsx)(`div`,{className:`notif-empty`,children:`nothing needs you right now`}):(0,S.jsx)(`div`,{className:`notif-list`,children:p.slice(0,50).map(e=>(0,S.jsxs)(`div`,{className:`notif-row ${e.readAt?``:`unread`} ${e.kind}`,role:`button`,tabIndex:0,onClick:()=>g(e),onKeyDown:t=>{t.key===`Enter`&&g(e)},children:[(0,S.jsx)(`span`,{className:`notif-ico`,children:(0,S.jsx)(C,{name:vs[e.kind]})}),(0,S.jsxs)(`span`,{className:`notif-body`,children:[(0,S.jsx)(`span`,{className:`notif-title`,children:e.title}),e.body&&(0,S.jsx)(`span`,{className:`notif-sub`,children:e.body}),e.diagnose&&(0,S.jsx)(`span`,{className:`notif-actions`,children:(0,S.jsxs)(`button`,{className:`ws-btn notif-diagnose`,disabled:u===e.id,title:`Open a chat that finds the cause and proposes the fix`,onClick:t=>{t.stopPropagation(),_(e)},children:[(0,S.jsx)(C,{name:u===e.id?`progress_activity`:`troubleshoot`,className:`ms-sm`}),u===e.id?`starting…`:`diagnose`]})})]}),(0,S.jsx)(`span`,{className:`notif-when num`,children:we(e.at)})]},e.id))})]})]})}function xs(){let[e,t]=(0,v.useState)(!1),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``);(0,v.useEffect)(()=>{if(!e)return;fetch(`/api/runs`).then(e=>e.json()).then(r).catch(()=>{}),fetch(`/api/workflows`).then(e=>e.json()).then(a).catch(()=>{}),fetch(`/api/meta`).then(e=>e.json()).then(e=>s(e.version)).catch(()=>{});let n=e=>{e.target.closest(`.info-wrap`)||t(!1)};return window.addEventListener(`mousedown`,n),()=>window.removeEventListener(`mousedown`,n)},[e]);let c=n?.runs[0];return(0,S.jsxs)(`span`,{className:`info-wrap`,children:[(0,S.jsx)(`button`,{className:`info-btn`,title:`Project info`,"aria-label":`Project info`,onClick:()=>t(e=>!e),children:(0,S.jsx)(C,{name:`info`})}),e&&(0,S.jsxs)(`div`,{className:`info-pop`,children:[(0,S.jsxs)(`div`,{className:`info-row`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`Workflows`}),(0,S.jsx)(`span`,{className:`info-v`,children:i?`${i.workflows.length} discovered`:`…`}),(0,S.jsx)(`code`,{className:`info-path`,title:i?.root,children:i?.root??``})]}),(0,S.jsxs)(`div`,{className:`info-row`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`Runs`}),(0,S.jsxs)(`span`,{className:`info-v`,children:[n?`${n.runs.length} total`:`…`,c?` · latest ${c.status}`:``]}),(0,S.jsx)(`code`,{className:`info-path`,title:n?.outputDir,children:n?.outputDir??``})]}),(0,S.jsxs)(`div`,{className:`info-row info-actions`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`Workspace`}),(0,S.jsxs)(`a`,{className:`update-btn`,href:`#/settings`,onClick:()=>t(!1),children:[(0,S.jsx)(C,{name:`settings`,className:`ms-sm`}),` settings`]})]}),(0,S.jsxs)(`div`,{className:`info-row info-actions`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`Theme`}),(0,S.jsx)(ws,{})]}),(0,S.jsxs)(`div`,{className:`info-row info-actions`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`Version`}),(0,S.jsx)(`span`,{className:`info-v mono`,children:o?`kraftwerk ${o}`:`…`}),(0,S.jsx)(Cs,{})]})]})]})}function Ss(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++)if((n[e]??0)!==(r[e]??0))return(n[e]??0)<(r[e]??0);return!1}function Cs(){let[e,t]=(0,v.useState)(`idle`),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1);async function u(){t(`busy`);try{let e=await fetch(`/api/update-check`,{cache:`no-store`}),n=await e.json();if(!e.ok||!n.latest)throw Error();r(n),t(`done`)}catch{t(`err`)}}let d=i?.state===`running`;(0,v.useEffect)(()=>{if(!d)return;let e=!0,t=setInterval(async()=>{try{let t=await fetch(`/api/update`,{cache:`no-store`}).then(e=>e.json());if(!e)return;a(t),t.state!==`running`&&window.dispatchEvent(new Event(hs))}catch{}},1e3);return()=>{e=!1,clearInterval(t)}},[d]);async function f(){if(!n)return;s(``);let e=await fetch(`/api/update`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({version:n.latest})}),t=await e.json();e.ok?a(t):s(t.error??`update refused`)}if(i&&i.state!==`idle`&&n){let e=i.log[i.log.length-1]??``;return i.state===`running`?(0,S.jsxs)(`span`,{className:`update-result update-progress`,children:[(0,S.jsx)(C,{name:`progress_activity`,className:`ms-sm ms-spin`}),` installing v`,n.latest,`…`,e&&(0,S.jsx)(`code`,{className:`update-log`,title:i.log.join(`
220
- `),children:e})]}):i.state===`done`?(0,S.jsxs)(`span`,{className:`update-result newer`,children:[`v`,n.latest,` installed —`,` `,i.restartable?(0,S.jsxs)(`button`,{className:`update-btn`,disabled:c,onClick:()=>{l(!0),ms(n.latest)},children:[(0,S.jsx)(C,{name:`restart_alt`,className:`ms-sm`}),` `,c?`relaunching…`:`relaunch`]}):(0,S.jsxs)(S.Fragment,{children:[`restart `,(0,S.jsx)(`code`,{children:`kraftwerk ui`}),` to use it`]})]}):(0,S.jsxs)(`span`,{className:`update-result update-failed`,title:i.log.join(`
221
- `),children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` install failed`,e?` — ${e}`:``,` · `,(0,S.jsxs)(`code`,{children:[`npm i -g `,n.name,`@latest`]})]})}return e===`done`&&n?Ss(n.current,n.latest)?(0,S.jsxs)(`span`,{className:`update-result newer`,children:[`v`,n.latest,` available —`,` `,o?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`span`,{className:`update-refused`,title:o,children:o}),` · `,(0,S.jsxs)(`code`,{children:[`npm i -g `,n.name,`@latest`]})]}):(0,S.jsxs)(`button`,{className:`update-btn`,onClick:()=>void f(),children:[(0,S.jsx)(C,{name:`download`,className:`ms-sm`}),` update now`]})]}):(0,S.jsxs)(`span`,{className:`update-result`,children:[(0,S.jsx)(C,{name:`check`,className:`ms-sm`}),` up to date`]}):(0,S.jsx)(`button`,{className:`update-btn`,disabled:e===`busy`,onClick:()=>void u(),children:e===`busy`?`checking…`:e===`err`?`npm unreachable — retry`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`sync`,className:`ms-sm`}),` check for updates`]})})}function ws(){return(0,S.jsx)(`button`,{className:`theme-btn`,onClick:()=>{let e=document.documentElement,t=e.dataset.theme===`light`?`dark`:`light`;e.dataset.theme=t;try{localStorage.setItem(`kw-theme`,t)}catch{}},children:`day / night`})}(0,y.createRoot)(document.getElementById(`root`)).render((0,S.jsx)(v.StrictMode,{children:(0,S.jsx)(as,{})}));export{x as a,o as c,A as i,s as l,C as n,h as o,j as r,d as s,rs as t,l as u};