@spencer-kit/coder-studio 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,111 +0,0 @@
1
- import{r as e,t}from"./rolldown-runtime-S-ySWqyJ.js";import{Bt as n,Ft as r,It as i,Lt as a,Mt as o,Nt as s,Pt as c,Rt as l,zt as u}from"./monaco-editor-CZixARFH.js";import{n as d,t as f}from"./xterm-0bvFymvt.js";(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function p(e){return`init`in e}function m(e){return!!e.write}function h(e){return!!e.onMount}function g(e){return`v`in e||`e`in e}function _(e){if(`e`in e)throw e.e;return e.v}function v(e){return typeof e?.then==`function`}function y(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function b(e,t,n){let r=n.get(e)?.t,i=t.p;if(!r?.size)return i;if(!i.size)return r;let a=new Set(r);for(let e of i)a.add(e);return a}var x=(e,t,...n)=>t.read(...n),S=(e,t,...n)=>t.write(...n),C=(e,t)=>t.INTERNAL_onInit?.call(t,e),w=(e,t,n)=>t.onMount?.call(t,n),T=(e,t)=>{var n;let r=R(e),i=r[0],a=r[6],o=r[9],s=i.get(t);return s||(s={d:new Map,p:new Set,n:0},i.set(t,s),(n=a.i)==null||n.call(a,t),o?.(e,t)),s},E=e=>{let t=R(e),n=t[1],r=t[3],i=t[4],a=t[5],o=t[6],s=t[13];if(!o.f&&!r.size&&!i.size&&!a.size)return;let c=[],l=e=>{try{e()}catch(e){c.push(e)}};do{o.f&&l(o.f);let t=new Set;for(let e of r){let r=n.get(e)?.l;if(r)for(let e of r)t.add(e)}r.clear();for(let e of a)t.add(e);a.clear();for(let e of i)t.add(e);i.clear();for(let e of t)l(e);r.size&&s(e)}while(r.size||a.size||i.size);if(c.length)throw AggregateError(c)},D=e=>{let t=R(e),n=t[1],r=t[2],i=t[3],a=t[11],o=t[14],s=t[17];if(!i.size)return;let c=[],l=[],u=new WeakSet,d=new WeakSet,f=[],p=[];for(let t of i)f.push(t),p.push(a(e,t));for(;f.length;){let t=f.length-1,i=f[t],o=p[t];if(d.has(i)){f.pop(),p.pop();continue}if(u.has(i)){r.get(i)===o.n&&(c.push(i),l.push(o)),d.add(i),f.pop(),p.pop();continue}u.add(i);for(let t of b(i,o,n))u.has(t)||(f.push(t),p.push(a(e,t)))}for(let t=c.length-1;t>=0;--t){let n=c[t],a=l[t],u=!1;for(let e of a.d.keys())if(e!==n&&i.has(e)){u=!0;break}u&&(r.set(n,a.n),o(e,n),s(e,n)),r.delete(n)}},O=(e,t)=>{var n,r;let i=R(e),a=i[1],o=i[2],s=i[3],c=i[6],l=i[7],u=i[11],d=i[12],f=i[13],h=i[14],b=i[16],x=i[17],S=i[20],C=i[26],w=i[28],T=u(e,t),E=w[0];if(g(T)){if(a.has(t)&&o.get(t)!==T.n||T.m===E)return T.m=E,T;let n=!1;for(let[t,r]of T.d)if(h(e,t).n!==r){n=!0;break}if(!n)return T.m=E,T}let D=!0,O=new Set(T.d.keys()),k=()=>{for(let e of O)T.d.delete(e)},A=()=>{if(a.has(t)){let n=!s.size;x(e,t),n&&(f(e),d(e))}},j=n=>{var r;if(n===t){let t=u(e,n);if(!g(t))if(p(n))S(e,n,n.init);else throw Error(`no atom init`);return _(t)}let i=h(e,n);try{return _(i)}finally{O.delete(n),T.d.set(n,i.n),v(T.v)&&y(t,T.v,i),a.has(t)&&((r=a.get(n))==null||r.t.add(t)),D||A()}},M,N,P={get signal(){return M||=new AbortController,M.signal},get setSelf(){return!N&&m(t)&&(N=(...n)=>{if(!D)try{return b(e,t,...n)}finally{f(e),d(e)}}),N}},F=T.n,ee=o.get(t)===F;try{let r=l(e,t,j,P);if(S(e,t,r),v(r)){C(e,r,()=>M?.abort());let t=()=>{k(),A()};r.then(t,t)}else k();return(n=c.r)==null||n.call(c,t),T.m=E,T}catch(e){return delete T.v,T.e=e,++T.n,T.m=E,T}finally{D=!1,T.n!==F&&ee&&(o.set(t,T.n),s.add(t),(r=c.c)==null||r.call(c,t))}},k=(e,t)=>{let n=R(e),r=n[1],i=n[2],a=n[11],o=[t];for(;o.length;){let t=o.pop(),n=a(e,t);for(let s of b(t,n,r)){let t=a(e,s);i.get(s)!==t.n&&(i.set(s,t.n),o.push(s))}}},A=(e,t,...n)=>{let r=R(e),i=r[3],a=r[6],o=r[8],s=r[11],c=r[12],l=r[13],u=r[14],d=r[15],f=r[16],m=r[17],h=r[20],g=r[28],v=!0,y=t=>_(u(e,t)),b=(n,...r)=>{var o;let u=s(e,n);try{if(n===t){if(!p(n))throw Error(`atom not writable`);let t=u.n,s=r[0];h(e,n,s),m(e,n),t!==u.n&&(++g[0],i.add(n),d(e,n),(o=a.c)==null||o.call(a,n));return}else return f(e,n,...r)}finally{v||(l(e),c(e))}};try{return o(e,t,y,b,...n)}finally{v=!1}},j=(e,t)=>{var n;let r=R(e),i=r[1],a=r[3],o=r[6],s=r[11],c=r[15],l=r[18],u=r[19],d=s(e,t),f=i.get(t);if(f&&d.d.size>0){for(let[r,i]of d.d)if(!f.d.has(r)){let u=s(e,r);l(e,r).t.add(t),f.d.add(r),i!==u.n&&(a.add(r),c(e,r),(n=o.c)==null||n.call(o,r))}for(let n of f.d)d.d.has(n)||(f.d.delete(n),u(e,n)?.t.delete(t))}},M=(e,t)=>{var n;let r=R(e),i=r[1],a=r[4],o=r[6],s=r[10],c=r[11],l=r[12],u=r[13],d=r[14],f=r[16],p=r[18],g=c(e,t),_=i.get(t);if(!_){d(e,t);for(let n of g.d.keys())p(e,n).t.add(t);_={l:new Set,d:new Set(g.d.keys()),t:new Set},i.set(t,_),m(t)&&h(t)&&a.add(()=>{let n=!0,r=(...r)=>{try{return f(e,t,...r)}finally{n||(u(e),l(e))}};try{let i=s(e,t,r);i&&(_.u=()=>{n=!0;try{i()}finally{n=!1}})}finally{n=!1}}),(n=o.m)==null||n.call(o,t)}return _},N=(e,t)=>{var n;let r=R(e),i=r[1],a=r[5],o=r[6],s=r[11],c=r[19],l=s(e,t),u=i.get(t);if(!u||u.l.size)return u;let d=!1;for(let e of u.t)if(i.get(e)?.d.has(t)){d=!0;break}if(!d){u.u&&a.add(u.u),u=void 0,i.delete(t);for(let n of l.d.keys())c(e,n)?.t.delete(t);(n=o.u)==null||n.call(o,t);return}return u},P=(e,t,n)=>{let r=R(e),i=r[11],a=r[27],o=i(e,t),s=`v`in o,c=o.v;if(v(n))for(let r of o.d.keys())y(t,n,i(e,r));o.v=n,delete o.e,(!s||!Object.is(c,o.v))&&(++o.n,v(c)&&a(e,c))},F=(e,t)=>{let n=R(e)[14];return _(n(e,t))},ee=(e,t,...n)=>{let r=R(e),i=r[3],a=r[12],o=r[13],s=r[16],c=i.size;try{return s(e,t,...n)}finally{i.size!==c&&(o(e),a(e))}},te=(e,t,n)=>{let r=R(e),i=r[12],a=r[18],o=r[19],s=a(e,t).l;return s.add(n),i(e),()=>{s.delete(n),o(e,t),i(e)}},ne=(e,t,n)=>{let r=R(e)[25],i=r.get(t);if(!i){i=new Set,r.set(t,i);let e=()=>r.delete(t);t.then(e,e)}i.add(n)},I=(e,t)=>{R(e)[25].get(t)?.forEach(e=>e())},L=new WeakMap,R=e=>L.get(e);function re(e){let t=R(e),n=t[24];return n?n(t):t}function ie(...e){let t={get(e){let n=R(t)[21];return n(t,e)},set(e,...n){let r=R(t)[22];return r(t,e,...n)},sub(e,n){let r=R(t)[23];return r(t,e,n)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,ee,te,void 0,new WeakMap,ne,I,[0]].map((t,n)=>e[n]||t);return L.set(t,Object.freeze(n)),t}var ae=0;function z(e,t){let n=`atom${++ae}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=oe,r.write=se),t&&(r.write=t),r}function oe(e){return e(this)}function se(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}var ce;function le(){return ce?ce():ie()}var ue;function de(){return ue||=le(),ue}var fe=t((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 A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(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 N(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,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(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(A,`$&/`)+`/`)+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+j(a,u),c+=N(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+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(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 ee=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},te={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(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=te,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:F}},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,ee)}catch(e){ee(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.5`})),pe=t(((e,t)=>{t.exports=fe()})),B=e(pe(),1),me=(0,B.createContext)(void 0);function he(e){let t=(0,B.useContext)(me);return e?.store||t||de()}function ge({children:e,store:t}){let n=(0,B.useRef)(null);return t?(0,B.createElement)(me.Provider,{value:t},e):(n.current===null&&(n.current=le()),(0,B.createElement)(me.Provider,{value:n.current},e))}var _e=e=>typeof e?.then==`function`,ve=e=>{e.status||(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}))},ye=B.use||(e=>{if(e.status===`pending`)throw e;if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:(ve(e),e)}),be=new WeakMap,xe=(e,t,n)=>{let r=re(e)[26],i=be.get(t);return i||(i=new Promise((a,o)=>{let s=t,c=e=>t=>{s===e&&a(t)},l=e=>t=>{s===e&&o(t)},u=()=>{try{let t=n();_e(t)?(be.set(t,i),s=t,t.then(c(t),l(t)),r(e,t,u)):a(t)}catch(e){o(e)}};t.then(c(t),l(t)),r(e,t,u)}),be.set(t,i)),i};function V(e,t){let{delay:n,unstable_promiseStatus:r=!B.use}=t||{},i=he(t),[[a,o,s],c]=(0,B.useReducer)(t=>{let n=i.get(e);return Object.is(t[0],n)&&t[1]===i&&t[2]===e?t:[n,i,e]},void 0,()=>[i.get(e),i,e]),l=a;if((o!==i||s!==e)&&(c(),l=i.get(e)),(0,B.useEffect)(()=>{let t=i.sub(e,()=>{if(r)try{let t=i.get(e);_e(t)&&ve(xe(i,t,()=>i.get(e)))}catch{}if(typeof n==`number`){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
2
-
3
- Migration guide:
4
-
5
- Create a custom hook like the following.
6
-
7
- function useAtomValueWithDelay<Value>(
8
- atom: Atom<Value>,
9
- options: { delay: number },
10
- ): Value {
11
- const { delay } = options
12
- const store = useStore(options)
13
- const [value, setValue] = useState(() => store.get(atom))
14
- useEffect(() => {
15
- const unsub = store.sub(atom, () => {
16
- setTimeout(() => setValue(store.get(atom)), delay)
17
- })
18
- return unsub
19
- }, [store, atom, delay])
20
- return value
21
- }
22
- `),setTimeout(c,n);return}c()});return c(),t},[i,e,n,r]),(0,B.useDebugValue)(l),_e(l)){let t=xe(i,l,()=>i.get(e));return r&&ve(t),ye(t)}return l}function H(e,t){let n=he(t);return(0,B.useCallback)((...t)=>n.set(e,...t),[n,e])}function Se(e,t){return[V(e,t),H(e,t)]}var Ce=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),we=t(((e,t)=>{t.exports=Ce()})),Te=t((e=>{var t=pe();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.5`})),Ee=t(((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=Te()})),De=t((e=>{var t=we(),n=pe(),r=Ee();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 d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var M=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,F={pending:!1,data:null,method:null,action:null},ee=[],te=-1;function ne(e){return{current:e}}function I(e){0>te||(e.current=ee[te],ee[te]=null,te--)}function L(e,t){te++,ee[te]=e.current,e.current=t}var R=ne(null),re=ne(null),ie=ne(null),ae=ne(null);function z(e,t){switch(L(ie,t),L(re,e),L(R,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Gd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Gd(t),e=Kd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}I(R),L(R,e)}function oe(){I(R),I(re),I(ie)}function se(e){e.memoizedState!==null&&L(ae,e);var t=R.current,n=Kd(t,e.type);t!==n&&(L(re,e),L(R,n))}function ce(e){re.current===e&&(I(R),I(re)),ae.current===e&&(I(ae),ep._currentValue=F)}var le,ue;function de(e){if(le===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);le=t&&t[1]||``,ue=-1<e.stack.indexOf(`
23
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
24
- `+le+e+ue}var fe=!1;function B(e,t){if(!e||fe)return``;fe=!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(`
25
- `),l=s.split(`
26
- `);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=`
27
- `+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{fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?de(n):``}function me(e,t){switch(e.tag){case 26:case 27:case 5:return de(e.type);case 16:return de(`Lazy`);case 13:return e.child!==t&&t!==null?de(`Suspense Fallback`):de(`Suspense`);case 19:return de(`SuspenseList`);case 0:case 15:return B(e.type,!1);case 11:return B(e.type.render,!1);case 1:return B(e.type,!0);case 31:return de(`Activity`);default:return``}}function he(e){try{var t=``,n=null;do t+=me(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
28
- Error generating stack: `+e.message+`
29
- `+e.stack}}var ge=Object.prototype.hasOwnProperty,_e=t.unstable_scheduleCallback,ve=t.unstable_cancelCallback,ye=t.unstable_shouldYield,be=t.unstable_requestPaint,xe=t.unstable_now,V=t.unstable_getCurrentPriorityLevel,H=t.unstable_ImmediatePriority,Se=t.unstable_UserBlockingPriority,Ce=t.unstable_NormalPriority,Te=t.unstable_LowPriority,De=t.unstable_IdlePriority,Oe=t.log,ke=t.unstable_setDisableYieldValue,Ae=null,je=null;function Me(e){if(typeof Oe==`function`&&ke(e),je&&typeof je.setStrictMode==`function`)try{je.setStrictMode(Ae,e)}catch{}}var Ne=Math.clz32?Math.clz32:Ie,Pe=Math.log,Fe=Math.LN2;function Ie(e){return e>>>=0,e===0?32:31-(Pe(e)/Fe|0)|0}var Le=256,Re=262144,ze=4194304;function Be(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 Ve(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=Be(n))):i=Be(o):i=Be(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Be(n))):i=Be(o)):i=Be(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 He(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ue(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 We(){var e=ze;return ze<<=1,!(ze&62914560)&&(ze=4194304),e}function Ge(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ke(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function qe(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-Ne(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&&Je(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Je(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ne(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ye(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ne(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Xe(e,t){var n=t&-t;return n=n&42?1:Ze(n),(n&(e.suspendedLanes|t))===0?n:0}function Ze(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 Qe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function $e(){var e=P.p;return e===0?(e=window.event,e===void 0?32:gp(e.type)):e}function et(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var tt=Math.random().toString(36).slice(2),nt=`__reactFiber$`+tt,rt=`__reactProps$`+tt,it=`__reactContainer$`+tt,at=`__reactEvents$`+tt,ot=`__reactListeners$`+tt,st=`__reactHandles$`+tt,ct=`__reactResources$`+tt,lt=`__reactMarker$`+tt;function ut(e){delete e[nt],delete e[rt],delete e[at],delete e[ot],delete e[st]}function dt(e){var t=e[nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[it]||n[nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=hf(e);e!==null;){if(n=e[nt])return n;e=hf(e)}return t}e=n,n=e.parentNode}return null}function ft(e){if(e=e[nt]||e[it]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function mt(e){var t=e[ct];return t||=e[ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ht(e){e[lt]=!0}var gt=new Set,_t={};function vt(e,t){yt(e,t),yt(e+`Capture`,t)}function yt(e,t){for(_t[e]=t,e=0;e<t.length;e++)gt.add(t[e])}var bt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),xt={},St={};function Ct(e){return ge.call(St,e)?!0:ge.call(xt,e)?!1:bt.test(e)?St[e]=!0:(xt[e]=!0,!1)}function wt(e,t,n){if(Ct(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 Tt(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 Et(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 Dt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ot(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function kt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function At(e){if(!e._valueTracker){var t=Ot(e)?`checked`:`value`;e._valueTracker=kt(e,t,``+e[t])}}function jt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ot(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Mt(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 Nt=/[\n"\\]/g;function Pt(e){return e.replace(Nt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ft(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=``+Dt(t)):e.value!==``+Dt(t)&&(e.value=``+Dt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Lt(e,o,Dt(n)):Lt(e,o,Dt(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=``+Dt(s):e.removeAttribute(`name`)}function It(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)){At(e);return}n=n==null?``:``+Dt(n),t=t==null?n:``+Dt(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),At(e)}function Lt(e,t,n){t===`number`&&Mt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Rt(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=``+Dt(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 zt(e,t,n){if(t!=null&&(t=``+Dt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Dt(n)}function Bt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(M(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Dt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),At(e)}function Vt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ht=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 Ut(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||Ht.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Wt(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&&Ut(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ut(e,o,t[o])}function Gt(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 Kt=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`]]),qt=/^[\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 Jt(e){return qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Yt(){}var Xt=null;function Zt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qt=null,$t=null;function en(e){var t=ft(e);if(t&&(e=t.stateNode)){var n=e[rt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ft(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="`+Pt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[rt]||null;if(!a)throw Error(i(90));Ft(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&jt(r)}break a;case`textarea`:zt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Rt(e,!!n.multiple,t,!1)}}}var tn=!1;function nn(e,t,n){if(tn)return e(t,n);tn=!0;try{return e(t)}finally{if(tn=!1,(Qt!==null||$t!==null)&&(wu(),Qt&&(t=Qt,e=$t,$t=Qt=null,en(t),e)))for(t=0;t<e.length;t++)en(e[t])}}function rn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[rt]||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 an=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),on=!1;if(an)try{var sn={};Object.defineProperty(sn,`passive`,{get:function(){on=!0}}),window.addEventListener(`test`,sn,sn),window.removeEventListener(`test`,sn,sn)}catch{on=!1}var cn=null,ln=null,un=null;function dn(){if(un)return un;var e,t=ln,n=t.length,r,i=`value`in cn?cn.value:cn.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 un=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 f(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=f({},gn,{view:0,detail:0}),yn=hn(vn),bn,xn,Sn,Cn=f({},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(f({},Cn,{dataTransfer:0})),En=hn(f({},vn,{relatedTarget:0})),Dn=hn(f({},gn,{animationName:0,elapsedTime:0,pseudoElement:0})),On=hn(f({},gn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),kn=hn(f({},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(f({},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(f({},Cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ln=hn(f({},vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pn})),Rn=hn(f({},gn,{propertyName:0,elapsedTime:0,pseudoElement:0})),zn=hn(f({},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(f({},gn,{newState:0,oldState:0})),Vn=[9,13,27,32],Hn=an&&`CompositionEvent`in window,Un=null;an&&`documentMode`in document&&(Un=document.documentMode);var Wn=an&&`TextEvent`in window&&!Un,Gn=an&&(!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 Qn(e,t){if(Xn)return e===`compositionend`||!Hn&&Jn(e,t)?(e=dn(),un=ln=cn=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 $n={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 er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!$n[e.type]:t===`textarea`}function tr(e,t,n,r){Qt?$t?$t.push(r):$t=[r]:Qt=r,t=Ad(t,`onChange`),0<t.length&&(n=new _n(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var nr=null,rr=null;function ir(e){Cd(e,0)}function ar(e){if(jt(pt(e)))return e}function or(e,t){if(e===`change`)return t}var sr=!1;if(an){var cr;if(an){var lr=`oninput`in document;if(!lr){var ur=document.createElement(`div`);ur.setAttribute(`oninput`,`return;`),lr=typeof ur.oninput==`function`}cr=lr}else cr=!1;sr=cr&&(!document.documentMode||9<document.documentMode)}function dr(){nr&&(nr.detachEvent(`onpropertychange`,fr),rr=nr=null)}function fr(e){if(e.propertyName===`value`&&ar(rr)){var t=[];tr(t,rr,e,Zt(e)),nn(ir,t)}}function pr(e,t,n){e===`focusin`?(dr(),nr=t,rr=n,nr.attachEvent(`onpropertychange`,fr)):e===`focusout`&&dr()}function mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ar(rr)}function hr(e,t){if(e===`click`)return ar(t)}function gr(e,t){if(e===`input`||e===`change`)return ar(t)}function _r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var vr=typeof Object.is==`function`?Object.is:_r;function yr(e,t){if(vr(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(!ge.call(t,i)||!vr(e[i],t[i]))return!1}return!0}function br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xr(e,t){var n=br(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=br(n)}}function Sr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mt(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=Mt(e.document)}return t}function wr(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 Tr=an&&`documentMode`in document&&11>=document.documentMode,Er=null,Dr=null,Or=null,kr=!1;function Ar(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kr||Er==null||Er!==Mt(r)||(r=Er,`selectionStart`in r&&wr(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}),Or&&yr(Or,r)||(Or=r,r=Ad(Dr,`onSelect`),0<r.length&&(t=new _n(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Er)))}function jr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Mr={animationend:jr(`Animation`,`AnimationEnd`),animationiteration:jr(`Animation`,`AnimationIteration`),animationstart:jr(`Animation`,`AnimationStart`),transitionrun:jr(`Transition`,`TransitionRun`),transitionstart:jr(`Transition`,`TransitionStart`),transitioncancel:jr(`Transition`,`TransitionCancel`),transitionend:jr(`Transition`,`TransitionEnd`)},Nr={},Pr={};an&&(Pr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Mr.animationend.animation,delete Mr.animationiteration.animation,delete Mr.animationstart.animation),`TransitionEvent`in window||delete Mr.transitionend.transition);function Fr(e){if(Nr[e])return Nr[e];if(!Mr[e])return e;var t=Mr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Pr)return Nr[e]=t[n];return e}var Ir=Fr(`animationend`),Lr=Fr(`animationiteration`),Rr=Fr(`animationstart`),zr=Fr(`transitionrun`),Br=Fr(`transitionstart`),Vr=Fr(`transitioncancel`),Hr=Fr(`transitionend`),Ur=new Map,Wr=`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(` `);Wr.push(`scrollEnd`);function Gr(e,t){Ur.set(e,t),vt(t,[e])}var Kr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},qr=[],Jr=0,Yr=0;function U(){for(var e=Jr,t=Yr=Jr=0;t<e;){var n=qr[t];qr[t++]=null;var r=qr[t];qr[t++]=null;var i=qr[t];qr[t++]=null;var a=qr[t];if(qr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&$r(n,i,a)}}function Xr(e,t,n,r){qr[Jr++]=e,qr[Jr++]=t,qr[Jr++]=n,qr[Jr++]=r,Yr|=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-Ne(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<hu)throw hu=0,gu=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=qf(e,n,R.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=ri(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return ci(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=ri(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=ri(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=ri(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=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:he(t)},fi.set(e,t),t):n}return{value:e,source:t,stack:he(t)}}var mi=[],hi=0,gi=null,_i=0,vi=[],yi=0,W=null,bi=1,xi=``;function Si(e,t){mi[hi++]=_i,mi[hi++]=gi,gi=e,_i=t}function Ci(e,t,n){vi[yi++]=bi,vi[yi++]=xi,vi[yi++]=W,W=e;var r=bi;e=xi;var i=32-Ne(r)-1;r&=~(1<<i),n+=1;var a=32-Ne(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,bi=1<<32-Ne(t)+i|n<<i|r,xi=a+e}else bi=1<<a|n<<i|r,xi=e}function wi(e){e.return!==null&&(Si(e,1),Ci(e,1,0))}function Ti(e){for(;e===gi;)gi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null;for(;e===W;)W=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null,bi=vi[--yi],vi[yi]=null}function Ei(e,t){vi[yi++]=bi,vi[yi++]=xi,vi[yi++]=W,bi=t.id,xi=t.overflow,W=e}var Di=null,Oi=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[nt]=e,t[rt]=r,n){case`dialog`:J(`cancel`,t),J(`close`,t);break;case`iframe`:case`object`:case`embed`:J(`load`,t);break;case`video`:case`audio`:for(n=0;n<xd.length;n++)J(xd[n],t);break;case`source`:J(`error`,t);break;case`img`:case`image`:case`link`:J(`error`,t),J(`load`,t);break;case`details`:J(`toggle`,t);break;case`input`:J(`invalid`,t),It(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:J(`invalid`,t);break;case`textarea`:J(`invalid`,t),Bt(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||Fd(t.textContent,n)?(r.popover!=null&&(J(`beforetoggle`,t),J(`toggle`,t)),r.onScroll!=null&&J(`scroll`,t),r.onScrollEnd!=null&&J(`scrollend`,t),r.onClick!=null&&(t.onclick=Yt),t=!0):t=!1,t||Mi(e,!0)}function Pi(e){for(Di=e.return;Di;)switch(Di.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:Di=Di.return}}function Fi(e){if(e!==Di)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`)||qd(e.type,e.memoizedProps)),n=!n),n&&Oi&&Mi(e),Pi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=mf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=mf(e)}else t===27?(t=Oi,tf(e.type)?(e=pf,pf=null,Oi=e):Oi=t):Oi=Di?ff(e.stateNode.nextSibling):null;return!0}function Ii(){Oi=Di=null,G=!1}function Li(){var e=ki;return e!==null&&(tu===null?tu=e:tu.push.apply(tu,e),ki=null),e}function Ri(e){ki===null?ki=[e]:ki.push(e)}var zi=ne(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;vr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ae.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ep]:e.push(ep))}a=a.return}e!==null&&Gi(t,e,n,r),t.flags|=262144}function qi(e){for(e=e.firstContext;e!==null;){if(!vr(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:b,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=gd(),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){iu=xe(),typeof t==`object`&&t&&typeof t.then==`function`&&ca(e,t),da!==null&&da(e,t)};var fa=ne(null);function pa(){var e=fa.current;return e===null?zl.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(Yt,Yt),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(Yt,Yt);else{if(e=zl,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===p?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===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&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 m:return n=si(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case h:return t=di(t,e.mode,n),t.return=e,t;case T:return t=Sa(t),f(e,t,n)}if(M(t)||k(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===b)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 m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=Sa(n),p(e,t,n,r)}if(M(n)||k(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===b)return p(e,t,Xi(e,n),r);Aa(e,n)}return null}function _(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 m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=Sa(r),_(e,t,n,r,i)}if(M(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Oa(r),i);if(r.$$typeof===b)return _(e,t,n,Xi(t,r),i);Aa(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),G&&Si(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return G&&Si(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),G&&Si(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),G&&Si(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return G&&Si(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),G&&Si(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&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}else t(e,r);r=r.sibling}o.type===g?(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 h: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}else{n(e,r);break}else t(e,r);r=r.sibling}c=di(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Sa(o),x(e,r,o,c)}if(M(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Oa(o),c);if(o.$$typeof===b)return x(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=x(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,Rl&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,Ye(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 p=s.lane&-536870913,m=p!==s.lane;if(m?(Vl&p)===p:(r&p)===p){p!==0&&p===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;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Pa=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,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),Yl|=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=ne(null),qa=ne(0);function Ja(e,t){e=ql,L(qa,e),L(Ka,t),ql=e|t.baseLanes}function Ya(){L(qa,ql),L(Ka,Ka.current)}function Xa(){ql=qa.current,I(Ka),I(qa)}var Za=ne(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=ne(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||lf(n)||uf(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,so=null,co=null,lo=!1,uo=!1,fo=!1,po=0,mo=0,ho=null,go=0;function _o(){throw Error(i(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vr(e[n],t[n]))return!1;return!0}function yo(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?Is:Ls,fo=!1,a=n(r,i),fo=!1,uo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){N.H=Fs;var t=so!==null&&so.next!==null;if(oo=0,co=so=K=null,lo=!1,mo=0,ho=null,t)throw Error(i(300));e===null||ec||(e=e.dependencies,e!==null&&qi(e)&&(ec=!0))}function xo(e,t,n,r){K=e;var a=0;do{if(uo&&(ho=null),mo=0,uo=!1,25<=a)throw Error(i(301));if(a+=1,co=so=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=Rs,o=t(n,r)}while(uo);return o}function So(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?ko(t):t,e=e.useState()[0],(so===null?null:so.memoizedState)!==e&&(K.flags|=1024),t}function Co(){var e=po!==0;return po=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}oo=0,co=so=K=null,uo=!1,mo=po=0,ho=null}function Eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return co===null?K.memoizedState=co=e:co=co.next=e,co}function Do(){if(so===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=so.next;var t=co===null?K.memoizedState:co.next;if(t!==null)co=t,so=e;else{if(e===null)throw K.alternate===null?Error(i(467)):Error(i(310));so=e,e={memoizedState:so.memoizedState,baseState:so.baseState,baseQueue:so.baseQueue,queue:so.queue,next:null},co===null?K.memoizedState=co=e:co=co.next=e}return co}function Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=mo;return mo+=1,ho===null&&(ho=[]),e=xa(ho,e,t),t=K,(co===null?t.memoizedState:co.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Is:Ls),e}function Ao(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ko(e);if(e.$$typeof===b)return Yi(e)}throw Error(i(438,String(e)))}function jo(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=Oo(),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]=D;return t.index++,n}function Mo(e,t){return typeof t==`function`?t(e):t}function No(e){return Po(Do(),so,e)}function Po(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:(Vl&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,Yl|=p;f=u.action,fo&&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,Yl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!vr(o,e.memoizedState)&&(ec=!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 Fo(e){var t=Do(),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);vr(o,t.memoizedState)||(ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Io(e,t,n){var r=K,a=Do(),o=G;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!vr((so||a).memoizedState,n);if(s&&(a.memoizedState=n,ec=!0),a=a.queue,ss(zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||co!==null&&co.memoizedState.tag&1){if(r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,a,n,t),null),zl===null)throw Error(i(349));o||oo&127||Lo(r,t,n)}return n}function Lo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=Oo(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Bo(t)&&Vo(e)}function zo(e,t,n){return n(function(){Bo(t)&&Vo(e)})}function Bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vr(e,n)}catch{return!0}}function Vo(e){var t=Qr(e,2);t!==null&&yu(t,e,2)}function Ho(e){var t=Eo();if(typeof e==`function`){var n=e;if(e=n(),fo){Me(!0);try{n()}finally{Me(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t}function Uo(e,t,n,r){return e.baseState=n,Po(e,so,typeof r==`function`?r:Mo)}function Wo(e,t,n,r,a){if(Ms(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,Go(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Go(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),Ko(e,t,s)}catch(n){Jo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){Jo(e,t,n)}}function Ko(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){qo(e,t,n)},function(n){return Jo(e,t,n)}):qo(e,t,n)}function qo(e,t,n){t.status=`fulfilled`,t.value=n,Yo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function Jo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Yo(t),t=t.next;while(t!==r)}e.action=null}function Yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xo(e,t){return t}function Zo(e,t){if(G){var n=zl.formState;if(n!==null){a:{var r=K;if(G){if(Oi){b:{for(var i=Oi,a=Ai;i.nodeType!==8;){if(!a){i=null;break b}if(i=ff(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Oi=ff(i.nextSibling),r=i.data===`F!`;break a}}Mi(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:t},n.queue=r,n=ks.bind(null,K,r),r.dispatch=n,r=Ho(!1),a=js.bind(null,K,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Wo.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Qo(e){return $o(Do(),so,e)}function $o(e,t,n){if(t=Po(e,t,Xo)[0],e=No(Mo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ko(t)}catch(e){throw e===ga?va:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,ns(9,{destroy:void 0},es.bind(null,i,n),null)),[r,a,e]}function es(e,t){e.action=t}function ts(e){var t=Do(),n=so;if(n!==null)return $o(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=Oo(),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 rs(){return Do().memoizedState}function is(e,t,n,r){var i=Eo();K.flags|=e,i.memoizedState=ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function as(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;so!==null&&r!==null&&vo(r,so.memoizedState.deps)?i.memoizedState=ns(t,a,n,r):(K.flags|=e,i.memoizedState=ns(1|t,a,n,r))}function os(e,t){is(8390656,8,e,t)}function ss(e,t){as(2048,8,e,t)}function cs(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=Oo(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ls(e){var t=Do().memoizedState;return cs({ref:t,nextImpl:e}),function(){if(Rl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function us(e,t){return as(4,2,e,t)}function ds(e,t){return as(4,4,e,t)}function fs(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 ps(e,t,n){n=n==null?null:n.concat([e]),as(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),fo){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r}function _s(e,t,n){return n===void 0||oo&1073741824&&!(Vl&261930)?e.memoizedState=t:(e.memoizedState=n,e=vu(),K.lanes|=e,Yl|=e,n)}function vs(e,t,n,r){return vr(n,t)?n:Ka.current===null?!(oo&42)||oo&1073741824&&!(Vl&261930)?(ec=!0,e.memoizedState=n):(e=vu(),K.lanes|=e,Yl|=e,t):(e=_s(e,n,r),vr(e,t)||(ec=!0),e)}function ys(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,js(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,ua(c,r),_u(e)):As(e,t,r,_u(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},_u())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ss(e).queue;ys(e,a,t,F,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},_u())}function ws(){return Yi(ep)}function Ts(){return Do().memoizedState}function Es(){return Do().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=_u();e=La(n);var r=Ra(t,e,n);r!==null&&(yu(r,t,n),za(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=_u();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=Zr(e,t,n,r),n!==null&&(yu(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,_u())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(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,vr(s,o))return Xr(e,t,i,0),zl===null&&U(),!1}catch{}if(n=Zr(e,t,i,r),n!==null)return yu(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:gd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=Zr(e,n,r,2),t!==null&&yu(t,e,2)}function Ms(e){var t=e.alternate;return e===K||t!==null&&t===K}function Ns(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}var Fs={readContext:Yi,use:Ao,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};Fs.useEffectEvent=_o;var Is={readContext:Yi,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),is(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(fo){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(fo){Me(!0);try{n(t)}finally{Me(!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=Os.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=ks.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=ys.bind(null,K,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,a=Eo();if(G){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),zl===null)throw Error(i(349));Vl&127||Lo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,os(zo.bind(null,r,o,e),[e]),r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=zl.identifierPrefix;if(G){var n=xi,r=bi;n=(r&~(1<<32-Ne(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=po++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ws,useFormState:Zo,useActionState:Zo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Eo().memoizedState=Ds.bind(null,K)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(Rl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:No,useRef:rs,useState:function(){return No(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){return vs(Do(),so.memoizedState,e,t)},useTransition:function(){var e=No(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){return Uo(Do(),so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Ls.useEffectEvent=ls;var Rs={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Fo,useRef:rs,useState:function(){return Fo(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){var n=Do();return so===null?_s(n,e,t):vs(n,so.memoizedState,e,t)},useTransition:function(){var e=Fo(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){var n=Do();return so===null?(n.baseState=e,[e,n.queue.dispatch]):Uo(n,so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Rs.useEffectEvent=ls;function zs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_u(),i=La(r);i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(yu(t,e,r),za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_u(),i=La(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(yu(t,e,r),za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_u(),r=La(n);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,n),t!==null&&(yu(t,e,n),za(t,e,n))}};function Vs(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?!yr(n,r)||!yr(i,a):!0}function Hs(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&&Bs.enqueueReplaceState(t,t.state,null)}function Us(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=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ws(e){Kr(e)}function Gs(e){console.error(e)}function Ks(e){Kr(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(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 Ys(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=La(e),e.tag=3,e}function Zs(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(){Js(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Js(t,n,r),typeof i!=`function`&&(su===null?su=new Set([this]):su.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Qs(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?ju():n.alternate===null&&Jl===0&&(Jl=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),Xu(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)),Xu(e,r,a)),!1}throw Error(i(435,n.tag))}return Xu(e,r,a),ju(),!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=Ys(e.stateNode,r,a),Ba(e,a),Jl!==4&&(Jl=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),eu===null?eu=[o]:eu.push(o),Jl!==4&&(Jl=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=Ys(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`&&(su===null||!su.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Xs(a),Zs(a,e,n,r),Ba(n,a),!1}n=n.return}while(n!==null);return!1}var $s=Error(i(461)),ec=!1;function tc(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function nc(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=yo(e,t,n,o,a,i),s=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(G&&s&&wi(t),t.flags|=1,tc(e,t,r,i),t.child)}function rc(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,ic(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,!Dc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?yr:n,n(o,r)&&e.ref===t.ref)return Ec(e,t,i)}return t.flags|=1,e=ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(yr(a,r)&&e.ref===t.ref)if(ec=!1,t.pendingProps=r=a,Dc(e,i))e.flags&131072&&(ec=!0);else return t.lanes=e.lanes,Ec(e,t,i)}return fc(e,t,n,r,i)}function ac(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 sc(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,sc(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 tc(e,t,i,n),t.child}function oc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sc(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 cc(e,t){return t=xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lc(e,t,n){return Ma(t,e.child,null,n),e=cc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function uc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(G){if(r.mode===`hidden`)return e=cc(t,r),t.lanes=536870912,oc(null,e);if(eo(t),(e=Oi)?(e=cf(e,Ai),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:W===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return t.lanes=536870912,null}return cc(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=lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ec||Ki(e,t,n,!1),a=(n&e.childLanes)!==0,ec||a){if(r=zl,r!==null&&(s=Xe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Qr(e,s),yu(r,e,s),$s;ju(),t=lc(e,t,n)}else e=o.treeContext,Oi=ff(s.nextSibling),Di=t,G=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=cc(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 dc(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 fc(e,t,n,r,i){return Ji(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(G&&r&&wi(t),t.flags|=1,tc(e,t,n,i),t.child)}function pc(e,t,n,r,i,a){return Ji(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!ec?(wo(e,t,a),Ec(e,t,a)):(G&&r&&wi(t),t.flags|=1,tc(e,t,n,a),t.child)}function mc(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=Bs,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`&&(zs(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&&Bs.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=Us(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)&&Hs(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`&&(zs(t,n,d,r),l=t.memoizedState),(c=Pa||Vs(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=Us(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)&&Hs(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`&&(zs(t,n,s,r),p=t.memoizedState),(u=Pa||Vs(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,dc(e,t),r=(t.flags&128)!=0,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)):tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ec(e,t,i),e}function hc(e,t,n,r){return Ii(),t.flags|=256,tc(e,t,n,r),t.child}var gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _c(e){return{baseLanes:e,cachePool:ha()}}function vc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Ql),e}function yc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(io.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(G){if(a?$a(t):no(t),(e=Oi)?(e=cf(e,Ai),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:W===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return uf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(no(t),a=t.mode,c=xc({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=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(null,r)):($a(t),bc(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=Sc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,a=t.mode,r=xc({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=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,t=oc(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),uf(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=Sc(e,t,n)}else if(ec||Ki(e,t,n,!1),s=(n&e.childLanes)!==0,ec||s){if(s=zl,s!==null&&(r=Xe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Qr(e,r),yu(s,e,r),$s;lf(c)||ju(),t=Sc(e,t,n)}else lf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Oi=ff(c.nextSibling),Di=t,G=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=bc(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,oc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=_c(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=vc(e,s,n),t.memoizedState=gc,oc(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 bc(e,t){return t=xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function xc(e,t){return e=ri(22,e,null,t),e.lanes=0,e}function Sc(e,t,n){return Ma(t,e.child,null,n),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,n)}function wc(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 Tc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,L(io,o),tc(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&&Cc(e,n,t);else if(e.tag===19)Cc(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),wc(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}wc(t,!0,n,null,a,r);break;case`together`:wc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ec(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Yl|=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 Dc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&qi(e))):!0}function Oc(e,t,n){switch(t.tag){case 3:z(t,t.stateNode.containerInfo),Hi(t,ta,e.memoizedState.cache),Ii();break;case 27:case 5:se(t);break;case 4:z(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=Ec(e,t,n),e===null?null:e.sibling):yc(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ki(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Tc(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,ac(e,t,n,t.pendingProps);case 24:Hi(t,ta,e.memoizedState.cache)}return Ec(e,t,n)}function kc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ec=!0;else{if(!Dc(e,n)&&!(t.flags&128))return ec=!1,Oc(e,t,n);ec=!!(e.flags&131072)}else ec=!1,G&&t.flags&1048576&&Ci(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=Us(e,r),t.tag=1,t=mc(null,t,e,r,n)):(t.tag=0,t=fc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=nc(null,t,e,r,n);break a}else if(a===w){t.tag=14,t=rc(null,t,e,r,n);break a}}throw t=j(e)||e,Error(i(306,t,``))}}return t;case 0:return fc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Us(r,t.pendingProps),mc(e,t,r,a,n);case 3:a:{if(z(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=hc(e,t,r,n);break a}else if(r!==a){a=pi(Error(i(424)),t),Ri(a),t=hc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Oi=ff(e.firstChild),Di=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=Ec(e,t,n);break a}tc(e,t,r,n)}t=t.child}return t;case 26:return dc(e,t),e===null?(n=Nf(t.type,null,t.pendingProps,null))?t.memoizedState=n:G||(n=t.type,e=t.pendingProps,r=Wd(ie.current).createElement(n),r[nt]=t,r[rt]=e,Rd(r,n,e),ht(r),t.stateNode=r):t.memoizedState=Nf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return se(t),e===null&&G&&(r=t.stateNode=gf(t.type,t.pendingProps,ie.current),Di=t,Ai=!0,a=Oi,tf(t.type)?(pf=a,Oi=ff(r.firstChild)):Oi=a),tc(e,t,t.pendingProps.children,n),dc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&G&&((a=r=Oi)&&(r=of(r,t.type,t.pendingProps,Ai),r===null?a=!1:(t.stateNode=r,Di=t,Oi=ff(r.firstChild),Ai=!1,a=!0)),a||Mi(t)),se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,qd(a,o)?r=null:s!==null&&qd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=yo(e,t,So,null,null,n),ep._currentValue=a),dc(e,t),tc(e,t,r,n),t.child;case 6:return e===null&&G&&((e=n=Oi)&&(n=sf(n,t.pendingProps,Ai),n===null?e=!1:(t.stateNode=n,Di=t,Oi=null,e=!0)),e||Mi(t)),null;case 13:return yc(e,t,n);case 4:return z(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):tc(e,t,r,n),t.child;case 11:return nc(e,t,t.type,t.pendingProps,n);case 7:return tc(e,t,t.pendingProps,n),t.child;case 8:return tc(e,t,t.pendingProps.children,n),t.child;case 12:return tc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Hi(t,t.type,r.value),tc(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,tc(e,t,r,n),t.child;case 14:return rc(e,t,t.type,t.pendingProps,n);case 15:return ic(e,t,t.type,t.pendingProps,n);case 19:return Tc(e,t,n);case 31:return uc(e,t,n);case 22:return ac(e,t,n,t.pendingProps);case 24:return Ji(t),r=Yi(ta),e===null?(a=pa(),a===null&&(a=zl,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))),tc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ac(e){e.flags|=4}function jc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Ou())e.flags|=8192;else throw Ca=ya,_a}else e.flags&=-16777217}function Mc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Jf(t))if(Ou())e.flags|=8192;else throw Ca=ya,_a}function Nc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:We(),e.lanes|=t,$l|=t)}function Pc(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 Fc(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 Ic(e,t,n){var r=t.pendingProps;switch(Ti(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fc(t),null;case 1:return Fc(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),oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?Ac(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li())),Fc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ac(t),o===null?(Fc(t),jc(t,a,null,r,n)):(Fc(t),Mc(t,o))):o?o===e.memoizedState?(Fc(t),t.flags&=-16777217):(Ac(t),Fc(t),Mc(t,o)):(e=e.memoizedProps,e!==r&&Ac(t),Fc(t),jc(t,a,e,r,n)),null;case 27:if(ce(t),n=ie.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}e=R.current,Fi(t)?Ni(t,e):(e=gf(a,r,n),t.stateNode=e,Ac(t))}return Fc(t),null;case 5:if(ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}if(o=R.current,Fi(t))Ni(t,o);else{var s=Wd(ie.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[nt]=t,o[rt]=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(Rd(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&&Ac(t)}}return Fc(t),jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ie.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Di,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[nt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Fd(e.nodeValue,n)),e||Mi(t,!0)}else e=Wd(e).createTextNode(r),e[nt]=t,t.stateNode=e}return Fc(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[nt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(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 Fc(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[nt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(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),Nc(t,t.updateQueue),Fc(t),null);case 4:return oe(),e===null&&Ed(t.stateNode.containerInfo),Fc(t),null;case 10:return Ui(t.type),Fc(t),null;case 19:if(I(io),r=t.memoizedState,r===null)return Fc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Pc(r,!1);else{if(Jl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Pc(r,!1),e=o.updateQueue,t.updateQueue=e,Nc(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&&Si(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&xe()>au&&(t.flags|=128,a=!0,Pc(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,Nc(t,e),Pc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!G)return Fc(t),null}else 2*xe()-r.renderingStartTime>au&&n!==536870912&&(t.flags|=128,a=!0,Pc(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?(Fc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=xe(),e.sibling=null,n=io.current,L(io,a?n&1|2:n&1),G&&Si(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)&&(Fc(t),t.subtreeFlags&6&&(t.flags|=8192)):Fc(t),n=t.updateQueue,n!==null&&Nc(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),Fc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Lc(e,t){switch(Ti(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ce(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 oe(),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 Rc(e,t){switch(Ti(t),t.tag){case 3:Ui(ta),oe();break;case 26:case 27:case 5:ce(t);break;case 4:oe();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 zc(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){Yu(t,t.return,e)}}function Bc(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){Yu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Yu(t,t.return,e)}}function Vc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){Yu(e,e.return,t)}}}function Hc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Yu(e,t,n)}}function Uc(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){Yu(e,t,n)}}function Wc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Yu(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){Yu(e,t,n)}else n.current=null}function Gc(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){Yu(e,e.return,t)}}function Kc(e,t,n){try{var r=e.stateNode;zd(r,e.type,n,t),r[rt]=t}catch(t){Yu(e,e.return,t)}}function qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tf(e.type)||e.tag===4}function Jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||qc(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&&tf(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 Yc(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=Yt));else if(r!==4&&(r===27&&tf(e.type)&&(n=e.stateNode,t=null),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,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&&tf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Rd(t,r,n),t[nt]=e,t[rt]=n}catch(t){Yu(e,e.return,t)}}var Qc=!1,$c=!1,el=!1,tl=typeof WeakSet==`function`?WeakSet:Set,nl=null;function rl(e,t){if(e=e.containerInfo,Hd=lp,e=Cr(e),wr(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(Ud={focusedElem:e,selectionRange:n},lp=!1,nl=t;nl!==null;)if(t=nl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,nl=e;else for(;nl!==null;){switch(t=nl,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=Us(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Yu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)af(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:af(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,nl=e;break}nl=t.return}}function il(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:yl(e,n),r&4&&zc(5,n);break;case 1:if(yl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Yu(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Yu(n,n.return,e)}}r&64&&Vc(n),r&512&&Uc(n,n.return);break;case 3:if(yl(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){Yu(n,n.return,e)}}break;case 27:t===null&&r&4&&Zc(n);case 26:case 5:yl(e,n),t===null&&r&4&&Gc(n),r&512&&Uc(n,n.return);break;case 12:yl(e,n);break;case 31:yl(e,n),r&4&&ul(e,n);break;case 13:yl(e,n),r&4&&dl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=$u.bind(null,n),df(e,n))));break;case 22:if(r=n.memoizedState!==null||Qc,!r){t=t!==null&&t.memoizedState!==null||$c,i=Qc;var a=$c;Qc=r,($c=t)&&!a?xl(e,n,(n.subtreeFlags&8772)!=0):yl(e,n),Qc=i,$c=a}break;case 30:break;default:yl(e,n)}}function al(e){var t=e.alternate;t!==null&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ut(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 ol=null,sl=!1;function cl(e,t,n){for(n=n.child;n!==null;)ll(e,t,n),n=n.sibling}function ll(e,t,n){if(je&&typeof je.onCommitFiberUnmount==`function`)try{je.onCommitFiberUnmount(Ae,n)}catch{}switch(n.tag){case 26:$c||Wc(n,t),cl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$c||Wc(n,t);var r=ol,i=sl;tf(n.type)&&(ol=n.stateNode,sl=!1),cl(e,t,n),_f(n.stateNode),ol=r,sl=i;break;case 5:$c||Wc(n,t);case 6:if(r=ol,i=sl,ol=null,cl(e,t,n),ol=r,sl=i,ol!==null)if(sl)try{(ol.nodeType===9?ol.body:ol.nodeName===`HTML`?ol.ownerDocument.body:ol).removeChild(n.stateNode)}catch(e){Yu(n,t,e)}else try{ol.removeChild(n.stateNode)}catch(e){Yu(n,t,e)}break;case 18:ol!==null&&(sl?(e=ol,nf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Pp(e)):nf(ol,n.stateNode));break;case 4:r=ol,i=sl,ol=n.stateNode.containerInfo,sl=!0,cl(e,t,n),ol=r,sl=i;break;case 0:case 11:case 14:case 15:Bc(2,n,t),$c||Bc(4,n,t),cl(e,t,n);break;case 1:$c||(Wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Hc(n,t,r)),cl(e,t,n);break;case 21:cl(e,t,n);break;case 22:$c=(r=$c)||n.memoizedState!==null,cl(e,t,n),$c=r;break;default:cl(e,t,n)}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Pp(e)}catch(e){Yu(t,t.return,e)}}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Pp(e)}catch(e){Yu(t,t.return,e)}}function fl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tl),t;default:throw Error(i(435,e.tag))}}function pl(e,t){var n=fl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=ed.bind(null,e,t);t.then(r,r)}})}function ml(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(tf(c.type)){ol=c.stateNode,sl=!1;break a}break;case 5:ol=c.stateNode,sl=!1;break a;case 3:case 4:ol=c.stateNode.containerInfo,sl=!0;break a}c=c.return}if(ol===null)throw Error(i(160));ll(o,s,a),ol=null,sl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gl(t,e),t=t.sibling}var hl=null;function gl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ml(t,e),_l(e),r&4&&(Bc(3,e,e.return),zc(3,e),Bc(5,e,e.return));break;case 1:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),r&64&&Qc&&(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=hl;if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(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[lt]||o[nt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Rd(o,r,n),o[nt]=e,ht(o),r=o;break a;case`link`:var s=Gf(`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),Rd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Gf(`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),Rd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[nt]=e,ht(o),r=o}e.stateNode=r}else Kf(a,e.type,e.stateNode);else e.stateNode=Bf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Kc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Kf(a,e.type,e.stateNode):Bf(a,r,e.memoizedProps))}break;case 27:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),n!==null&&r&4&&Kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),e.flags&32){a=e.stateNode;try{Vt(a,``)}catch(t){Yu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Kc(e,a,n===null?a:n.memoizedProps)),r&1024&&(el=!0);break;case 6:if(ml(t,e),_l(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Yu(e,e.return,t)}}break;case 3:if(Wf=null,a=hl,hl=bf(t.containerInfo),ml(t,e),hl=a,_l(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Pp(t.containerInfo)}catch(t){Yu(e,e.return,t)}el&&(el=!1,vl(e));break;case 4:r=hl,hl=bf(e.stateNode.containerInfo),ml(t,e),_l(e),hl=r;break;case 12:ml(t,e),_l(e);break;case 31:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 13:ml(t,e),_l(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ru=xe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Qc,d=$c;if(Qc=u||a,$c=d||l,ml(t,e),$c=d,Qc=u,_l(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Qc||$c||bl(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){Yu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Yu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?rf(m,!0):rf(l.stateNode,!1)}catch(e){Yu(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,pl(e,n))));break;case 19:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 30:break;case 21:break;default:ml(t,e),_l(e)}}function _l(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Xc(e,Jc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Vt(o,``),n.flags&=-33),Xc(e,Jc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Yc(e,Jc(e),s);break;default:throw Error(i(161))}}catch(t){Yu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)il(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bc(4,t,t.return),bl(t);break;case 1:Wc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Hc(t,t.return,n),bl(t);break;case 27:_f(t.stateNode);case 26:case 5:Wc(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function xl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,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:xl(i,a,n),zc(4,a);break;case 1:if(xl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Yu(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){Yu(r,r.return,e)}}n&&o&64&&Vc(a),Uc(a,a.return);break;case 27:Zc(a);case 26:case 5:xl(i,a,n),n&&r===null&&o&4&&Gc(a),Uc(a,a.return);break;case 12:xl(i,a,n);break;case 31:xl(i,a,n),n&&o&4&&ul(i,a);break;case 13:xl(i,a,n),n&&o&4&&dl(i,a);break;case 22:a.memoizedState===null&&xl(i,a,n),Uc(a,a.return);break;case 30:break;default:xl(i,a,n)}t=t.sibling}}function Sl(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 Cl(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 wl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tl(e,t,n,r),t=t.sibling}function Tl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:wl(e,t,n,r),i&2048&&zc(9,t);break;case 1:wl(e,t,n,r);break;case 3:wl(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){wl(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){Yu(t,t.return,e)}}else wl(e,t,n,r);break;case 31:wl(e,t,n,r);break;case 13:wl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?wl(e,t,n,r):(a._visibility|=2,El(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?wl(e,t,n,r):Dl(e,t),i&2048&&Sl(o,t);break;case 24:wl(e,t,n,r),i&2048&&Cl(t.alternate,t);break;default:wl(e,t,n,r)}}function El(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!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:El(a,o,s,c,i),zc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,El(a,o,s,c,i)):u._visibility&2?El(a,o,s,c,i):Dl(a,o),i&&l&2048&&Sl(o.alternate,o);break;case 24:El(a,o,s,c,i),i&&l&2048&&Cl(o.alternate,o);break;default:El(a,o,s,c,i)}t=t.sibling}}function Dl(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:Dl(n,r),i&2048&&Sl(r.alternate,r);break;case 24:Dl(n,r),i&2048&&Cl(r.alternate,r);break;default:Dl(n,r)}t=t.sibling}}var Ol=8192;function kl(e,t,n){if(e.subtreeFlags&Ol)for(e=e.child;e!==null;)Al(e,t,n),e=e.sibling}function Al(e,t,n){switch(e.tag){case 26:kl(e,t,n),e.flags&Ol&&e.memoizedState!==null&&Yf(n,hl,e.memoizedState,e.memoizedProps);break;case 5:kl(e,t,n);break;case 3:case 4:var r=hl;hl=bf(e.stateNode.containerInfo),kl(e,t,n),hl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ol,Ol=16777216,kl(e,t,n),Ol=r):kl(e,t,n));break;default:kl(e,t,n)}}function jl(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 Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nl(e),e=e.sibling}function Nl(e){switch(e.tag){case 0:case 11:case 15:Ml(e),e.flags&2048&&Bc(9,e,e.return);break;case 3:Ml(e);break;case 12:Ml(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pl(e)):Ml(e);break;default:Ml(e)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bc(8,t,t.return),Pl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pl(t));break;default:Pl(t)}e=e.sibling}}function Fl(e,t){for(;nl!==null;){var n=nl;switch(n.tag){case 0:case 11:case 15:Bc(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,nl=r;else a:for(n=e;nl!==null;){r=nl;var i=r.sibling,a=r.return;if(al(r),r===n){nl=null;break a}if(i!==null){i.return=a,nl=i;break a}nl=a}}}var Il={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}},Ll=typeof WeakMap==`function`?WeakMap:Map,Rl=0,zl=null,Bl=null,Vl=0,Hl=0,Ul=null,Wl=!1,Gl=!1,Kl=!1,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=0,eu=null,tu=null,nu=!1,ru=0,iu=0,au=1/0,ou=null,su=null,cu=0,lu=null,uu=null,du=0,fu=0,pu=null,mu=null,hu=0,gu=null;function _u(){return Rl&2&&Vl!==0?Vl&-Vl:N.T===null?$e():gd()}function vu(){if(Ql===0)if(!(Vl&536870912)||G){var e=Re;Re<<=1,!(Re&3932160)&&(Re=262144),Ql=e}else Ql=536870912;return e=Za.current,e!==null&&(e.flags|=32),Ql}function yu(e,t,n){(e===zl&&(Hl===2||Hl===9)||e.cancelPendingCommit!==null)&&(Eu(e,0),Cu(e,Vl,Ql,!1)),Ke(e,n),(!(Rl&2)||e!==zl)&&(e===zl&&(!(Rl&2)&&(Xl|=n),Jl===4&&Cu(e,Vl,Ql,!1)),cd(e))}function bu(e,t,n){if(Rl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||He(e,t),a=r?Pu(e,t):Mu(e,t,!0),o=r;do{if(a===0){Gl&&!r&&Cu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Su(n)){a=Mu(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=eu;var l=c.current.memoizedState.isDehydrated;if(l&&(Eu(c,s).flags|=256),s=Mu(c,s,!1),s!==2){if(Kl&&!l){c.errorRecoveryDisabledLanes|=o,Xl|=o,a=4;break a}o=tu,tu=a,o!==null&&(tu===null?tu=o:tu.push.apply(tu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Eu(e,0),Cu(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:Cu(r,t,Ql,!Wl);break a;case 2:tu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=ru+300-xe(),10<a)){if(Cu(r,t,Ql,!Wl),Ve(r,0,!0)!==0)break a;du=t,r.timeoutHandle=Xd(xu.bind(null,r,n,tu,ou,nu,t,Ql,Xl,$l,Wl,o,`Throttled`,-0,0),a);break a}xu(r,n,tu,ou,nu,t,Ql,Xl,$l,Wl,o,null,-0,0)}}break}while(1);cd(e)}function xu(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:Yt},Al(t,a,d);var m=(a&62914560)===a?ru-xe():(a&4194048)===a?iu-xe():0;if(m=Zf(d,m),m!==null){du=a,e.cancelPendingCommit=m(Vu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Cu(e,a,o,!l);return}}Vu(e,t,a,n,r,i,o,s,c)}function Su(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(!vr(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 Cu(e,t,n,r){t&=~Zl,t&=~Xl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ne(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Je(e,n,t)}function wu(){return Rl&6?!0:(ld(0,!1),!1)}function Tu(){if(Bl!==null){if(Hl===0)var e=Bl.return;else e=Bl,Vi=Bi=null,To(e),Ea=null,Da=0,e=Bl;for(;e!==null;)Rc(e.alternate,e),e=e.return;Bl=null}}function Eu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Zd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),du=0,Tu(),zl=e,Bl=n=ai(e.current,null),Vl=t,Hl=0,Ul=null,Wl=!1,Gl=He(e,t),Kl=!1,$l=Ql=Zl=Xl=Yl=Jl=0,tu=eu=null,nu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ne(r),a=1<<i;t|=e[i],r&=~a}return ql=t,U(),n}function Du(e,t){K=null,N.H=Fs,t===ga||t===va?(t=wa(),Hl=3):t===_a?(t=wa(),Hl=4):Hl=t===$s?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ul=t,Bl===null&&(Jl=1,qs(e,pi(t,e.current)))}function Ou(){var e=Za.current;return e===null?!0:(Vl&4194048)===Vl?Qa===null:(Vl&62914560)===Vl||Vl&536870912?e===Qa:!1}function ku(){var e=N.H;return N.H=Fs,e===null?Fs:e}function Au(){var e=N.A;return N.A=Il,e}function ju(){Jl=4,Wl||(Vl&4194048)!==Vl&&Za.current!==null||(Gl=!0),!(Yl&134217727)&&!(Xl&134217727)||zl===null||Cu(zl,Vl,Ql,!1)}function Mu(e,t,n){var r=Rl;Rl|=2;var i=ku(),a=Au();(zl!==e||Vl!==t)&&(ou=null,Eu(e,t)),t=!1;var o=Jl;a:do try{if(Hl!==0&&Bl!==null){var s=Bl,c=Ul;switch(Hl){case 8:Tu(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=Hl;if(Hl=0,Ul=null,Ru(e,s,c,l),n&&Gl){o=0;break a}break;default:l=Hl,Hl=0,Ul=null,Ru(e,s,c,l)}}Nu(),o=Jl;break}catch(t){Du(e,t)}while(1);return t&&e.shellSuspendCounter++,Vi=Bi=null,Rl=r,N.H=i,N.A=a,Bl===null&&(zl=null,Vl=0,U()),o}function Nu(){for(;Bl!==null;)Iu(Bl)}function Pu(e,t){var n=Rl;Rl|=2;var r=ku(),a=Au();zl!==e||Vl!==t?(ou=null,au=xe()+500,Eu(e,t)):Gl=He(e,t);a:do try{if(Hl!==0&&Bl!==null){t=Bl;var o=Ul;b:switch(Hl){case 1:Hl=0,Ul=null,Ru(e,t,o,1);break;case 2:case 9:if(ba(o)){Hl=0,Ul=null,Lu(t);break}t=function(){Hl!==2&&Hl!==9||zl!==e||(Hl=7),cd(e)},o.then(t,t);break a;case 3:Hl=7;break a;case 4:Hl=5;break a;case 7:ba(o)?(Hl=0,Ul=null,Lu(t)):(Hl=0,Ul=null,Ru(e,t,o,7));break;case 5:var s=null;switch(Bl.tag){case 26:s=Bl.memoizedState;case 5:case 27:var c=Bl;if(s?Jf(s):c.stateNode.complete){Hl=0,Ul=null;var l=c.sibling;if(l!==null)Bl=l;else{var u=c.return;u===null?Bl=null:(Bl=u,zu(u))}break b}}Hl=0,Ul=null,Ru(e,t,o,5);break;case 6:Hl=0,Ul=null,Ru(e,t,o,6);break;case 8:Tu(),Jl=6;break a;default:throw Error(i(462))}}Fu();break}catch(t){Du(e,t)}while(1);return Vi=Bi=null,N.H=r,N.A=a,Rl=n,Bl===null?(zl=null,Vl=0,U(),Jl):0}function Fu(){for(;Bl!==null&&!ye();)Iu(Bl)}function Iu(e){var t=kc(e.alternate,e,ql);e.memoizedProps=e.pendingProps,t===null?zu(e):Bl=t}function Lu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=pc(n,t,t.pendingProps,t.type,void 0,Vl);break;case 11:t=pc(n,t,t.pendingProps,t.type.render,t.ref,Vl);break;case 5:To(t);default:Rc(n,t),t=Bl=oi(t,ql),t=kc(n,t,ql)}e.memoizedProps=e.pendingProps,t===null?zu(e):Bl=t}function Ru(e,t,n,r){Vi=Bi=null,To(t),Ea=null,Da=0;var i=t.return;try{if(Qs(e,i,t,n,Vl)){Jl=1,qs(e,pi(n,e.current)),Bl=null;return}}catch(t){if(i!==null)throw Bl=i,t;Jl=1,qs(e,pi(n,e.current)),Bl=null;return}t.flags&32768?(G||r===1?e=!0:Gl||Vl&536870912?e=!1:(Wl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),Bu(t,e)):zu(t)}function zu(e){var t=e;do{if(t.flags&32768){Bu(t,Wl);return}e=t.return;var n=Ic(t.alternate,t,ql);if(n!==null){Bl=n;return}if(t=t.sibling,t!==null){Bl=t;return}Bl=t=e}while(t!==null);Jl===0&&(Jl=5)}function Bu(e,t){do{var n=Lc(e.alternate,e);if(n!==null){n.flags&=32767,Bl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Bl=e;return}Bl=e=n}while(e!==null);Jl=6,Bl=null}function Vu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Ku();while(cu!==0);if(Rl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Yr,qe(e,n,o,s,c,l),e===zl&&(Bl=zl=null,Vl=0),uu=t,lu=e,du=n,fu=o,pu=a,mu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,td(Ce,function(){return qu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Rl,Rl|=4;try{rl(e,t,n)}finally{Rl=s,P.p=a,N.T=r}}cu=1,Hu(),Uu(),Wu()}}function Hu(){if(cu===1){cu=0;var e=lu,t=uu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Rl;Rl|=4;try{gl(t,e);var a=Ud,o=Cr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Sr(s.ownerDocument.documentElement,s)){if(c!==null&&wr(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 _=xr(s,h),v=xr(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}}lp=!!Hd,Ud=Hd=null}finally{Rl=i,P.p=r,N.T=n}}e.current=t,cu=2}}function Uu(){if(cu===2){cu=0;var e=lu,t=uu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Rl;Rl|=4;try{il(e,t.alternate,t)}finally{Rl=i,P.p=r,N.T=n}}cu=3}}function Wu(){if(cu===4||cu===3){cu=0,be();var e=lu,t=uu,n=du,r=mu;t.subtreeFlags&10256||t.flags&10256?cu=5:(cu=0,uu=lu=null,Gu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(su=null),Qe(n),t=t.stateNode,je&&typeof je.onCommitFiberRoot==`function`)try{je.onCommitFiberRoot(Ae,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}}du&3&&Ku(),cd(e),i=e.pendingLanes,n&261930&&i&42?e===gu?hu++:(hu=0,gu=e):hu=0,ld(0,!1)}}function Gu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Ku(){return Hu(),Uu(),Wu(),qu()}function qu(){if(cu!==5)return!1;var e=lu,t=fu;fu=0;var n=Qe(du),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=pu,pu=null;var o=lu,s=du;if(cu=0,uu=lu=null,du=0,Rl&6)throw Error(i(331));var c=Rl;if(Rl|=4,Nl(o.current),Tl(o,o.current,s,n),Rl=c,ld(0,!1),je&&typeof je.onPostCommitFiberRoot==`function`)try{je.onPostCommitFiberRoot(Ae,o)}catch{}return!0}finally{P.p=a,N.T=r,Gu(e,t)}}function Ju(e,t,n){t=pi(n,t),t=Ys(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(Ke(e,2),cd(e))}function Yu(e,t,n){if(e.tag===3)Ju(e,e,n);else for(;t!==null;){if(t.tag===3){Ju(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(su===null||!su.has(r))){e=pi(n,e),n=Xs(2),r=Ra(t,n,2),r!==null&&(Zs(n,r,t,e),Ke(r,2),cd(r));break}}t=t.return}}function Xu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ll;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)||(Kl=!0,i.add(n),e=Zu.bind(null,e,t,n),t.then(e,e))}function Zu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,zl===e&&(Vl&n)===n&&(Jl===4||Jl===3&&(Vl&62914560)===Vl&&300>xe()-ru?!(Rl&2)&&Eu(e,0):Zl|=n,$l===Vl&&($l=0)),cd(e)}function Qu(e,t){t===0&&(t=We()),e=Qr(e,t),e!==null&&(Ke(e,t),cd(e))}function $u(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Qu(e,n)}function ed(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Qu(e,n)}function td(e,t){return _e(e,t)}var nd=null,rd=null,id=!1,ad=!1,od=!1,sd=0;function cd(e){e!==rd&&e.next===null&&(rd===null?nd=rd=e:rd=rd.next=e),ad=!0,id||(id=!0,hd())}function ld(e,t){if(!od&&ad){od=!0;do for(var n=!1,r=nd;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-Ne(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,md(r,a))}else a=Vl,a=Ve(r,r===zl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||He(r,a)||(n=!0,md(r,a));r=r.next}while(n);od=!1}}function ud(){dd()}function dd(){ad=id=!1;var e=0;sd!==0&&Yd()&&(e=sd);for(var t=xe(),n=null,r=nd;r!==null;){var i=r.next,a=fd(r,t);a===0?(r.next=null,n===null?nd=i:n.next=i,i===null&&(rd=n)):(n=r,(e!==0||a&3)&&(ad=!0)),r=i}cu!==0&&cu!==5||ld(e,!1),sd!==0&&(sd=0)}function fd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ne(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ue(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=zl,n=Vl,n=Ve(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Hl===2||Hl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ve(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||He(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ve(r),Qe(n)){case 2:case 8:n=Se;break;case 32:n=Ce;break;case 268435456:n=De;break;default:n=Ce}return r=pd.bind(null,e),n=_e(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ve(r),e.callbackPriority=2,e.callbackNode=null,2}function pd(e,t){if(cu!==0&&cu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ku()&&e.callbackNode!==n)return null;var r=Vl;return r=Ve(e,e===zl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(bu(e,r,t),fd(e,xe()),e.callbackNode!=null&&e.callbackNode===n?pd.bind(null,e):null)}function md(e,t){if(Ku())return null;bu(e,t,!0)}function hd(){$d(function(){Rl&6?_e(H,ud):dd()})}function gd(){if(sd===0){var e=oa;e===0&&(e=Le,Le<<=1,!(Le&261888)&&(Le=256)),sd=e}return sd}function q(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Jt(``+e)}function _d(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 vd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=q((i[rt]||null).action),o=r.submitter;o&&(t=(t=o[rt]||null)?q(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(sd!==0){var e=o?_d(i,o):new FormData(i);xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?_d(i,o):new FormData(i),xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var yd=0;yd<Wr.length;yd++){var bd=Wr[yd];Gr(bd.toLowerCase(),`on`+(bd[0].toUpperCase()+bd.slice(1)))}Gr(Ir,`onAnimationEnd`),Gr(Lr,`onAnimationIteration`),Gr(Rr,`onAnimationStart`),Gr(`dblclick`,`onDoubleClick`),Gr(`focusin`,`onFocus`),Gr(`focusout`,`onBlur`),Gr(zr,`onTransitionRun`),Gr(Br,`onTransitionStart`),Gr(Vr,`onTransitionCancel`),Gr(Hr,`onTransitionEnd`),yt(`onMouseEnter`,[`mouseout`,`mouseover`]),yt(`onMouseLeave`,[`mouseout`,`mouseover`]),yt(`onPointerEnter`,[`pointerout`,`pointerover`]),yt(`onPointerLeave`,[`pointerout`,`pointerover`]),vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var xd=`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(` `),Sd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(xd));function Cd(e,t){t=(t&4)!=0;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){Kr(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){Kr(e)}i.currentTarget=null,a=c}}}}function J(e,t){var n=t[at];n===void 0&&(n=t[at]=new Set);var r=e+`__bubble`;n.has(r)||(Dd(t,e,2,!1),n.add(r))}function wd(e,t,n){var r=0;t&&(r|=4),Dd(n,e,r,t)}var Td=`_reactListening`+Math.random().toString(36).slice(2);function Ed(e){if(!e[Td]){e[Td]=!0,gt.forEach(function(t){t!==`selectionchange`&&(Sd.has(t)||wd(t,!1,e),wd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Td]||(t[Td]=!0,wd(`selectionchange`,!1,t))}}function Dd(e,t,n,r){switch(gp(t)){case 2:var i=up;break;case 8:i=dp;break;default:i=fp}n=i.bind(null,t,n,e),i=void 0,!on||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 Od(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=dt(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}nn(function(){var r=a,i=Zt(n),s=[];a:{var c=Ur.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 Ir:case Lr:case Rr:l=Dn;break;case Hr: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)!=0,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=rn(m,p),g!=null&&d.push(kd(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!==Xt&&(u=n.relatedTarget||n.fromElement)&&(dt(u)||u[it]))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?dt(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:pt(l),h=u==null?c:pt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,dt(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=jd,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&&Md(s,c,l,d,!1),u!==null&&f!==null&&Md(s,f,u,d,!0)}}a:{if(c=r?pt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=or;else if(er(c))if(sr)v=gr;else{v=mr;var y=pr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Gt(r.elementType)&&(v=or):v=hr;if(v&&=v(e,r)){tr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Lt(c,`number`,c.value)}switch(y=r?pt(r):window,e){case`focusin`:(er(y)||y.contentEditable===`true`)&&(Er=y,Dr=r,Or=null);break;case`focusout`:Or=Dr=Er=null;break;case`mousedown`:kr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:kr=!1,Ar(s,n,i);break;case`selectionchange`:if(Tr)break;case`keydown`:case`keyup`:Ar(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=dn()):(cn=i,ln=`value`in cn?cn.value:cn.textContent,Xn=!0)),y=Ad(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):Qn(e,n))&&(x=Ad(r,`onBeforeInput`),0<x.length&&(y=new kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),vd(s,e,r,n,i)}Cd(s,t)})}function kd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ad(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=rn(e,n),i!=null&&r.unshift(kd(e,i,a)),i=rn(e,t),i!=null&&r.push(kd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function jd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Md(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=rn(n,a),l!=null&&o.unshift(kd(n,l,c))):i||(l=rn(n,a),l!=null&&o.push(kd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Nd=/\r\n?/g,Pd=/\u0000|\uFFFD/g;function Y(e){return(typeof e==`string`?e:``+e).replace(Nd,`
30
- `).replace(Pd,``)}function Fd(e,t){return t=Y(t),Y(e)===t}function Id(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Vt(e,``+r);break;case`className`:Tt(e,`class`,r);break;case`tabIndex`:Tt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Tt(e,n,r);break;case`style`:Wt(e,r,o);break;case`data`:if(t!==`object`){Tt(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=Jt(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Id(e,t,`name`,a.name,a,null),Id(e,t,`formEncType`,a.formEncType,a,null),Id(e,t,`formMethod`,a.formMethod,a,null),Id(e,t,`formTarget`,a.formTarget,a,null)):(Id(e,t,`encType`,a.encType,a,null),Id(e,t,`method`,a.method,a,null),Id(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`onScroll`:r!=null&&J(`scroll`,e);break;case`onScrollEnd`:r!=null&&J(`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=Jt(``+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`:J(`beforetoggle`,e),J(`toggle`,e),wt(e,`popover`,r);break;case`xlinkActuate`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:wt(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=Kt.get(n)||n,wt(e,n,r))}}function Ld(e,t,n,r,a,o){switch(n){case`style`:Wt(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`?Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Vt(e,``+r);break;case`onScroll`:r!=null&&J(`scroll`,e);break;case`onScrollEnd`:r!=null&&J(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!_t.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[rt]||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,``):wt(e,n,r)}}}function Rd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:J(`error`,e),J(`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:Id(e,t,o,s,n,null)}}a&&Id(e,t,`srcSet`,n.srcSet,n,null),r&&Id(e,t,`src`,n.src,n,null);return;case`input`:J(`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:Id(e,t,r,d,n,null)}}It(e,o,c,l,u,s,a,!1);return;case`select`:for(a in J(`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:Id(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Rt(e,!!r,n,!0):Rt(e,!!r,t,!1);return;case`textarea`:for(s in J(`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:Id(e,t,s,c,n,null)}Bt(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:Id(e,t,l,r,n,null)}return;case`dialog`:J(`beforetoggle`,e),J(`toggle`,e),J(`cancel`,e),J(`close`,e);break;case`iframe`:case`object`:J(`load`,e);break;case`video`:case`audio`:for(r=0;r<xd.length;r++)J(xd[r],e);break;case`image`:J(`error`,e),J(`load`,e);break;case`details`:J(`toggle`,e);break;case`embed`:case`source`:case`link`:J(`error`,e),J(`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:Id(e,t,u,r,n,null)}return;default:if(Gt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Ld(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Id(e,t,c,r,n,null))}function zd(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)||Id(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&&Id(e,t,p,m,r,f)}}Ft(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)||Id(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&&Id(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Rt(e,!!n,n?[]:``,!1):Rt(e,!!n,t,!0)):Rt(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:Id(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&&Id(e,t,s,a,r,o)}zt(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:Id(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:Id(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)&&Id(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:Id(e,t,u,p,r,m)}return;default:if(Gt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Ld(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||Ld(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Id(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||Id(e,t,f,p,r,m)}function Bd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Vd(){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&&Bd(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&&Bd(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 Hd=null,Ud=null;function Wd(e){return e.nodeType===9?e:e.ownerDocument}function Gd(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 Kd(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 qd(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 Jd=null;function Yd(){var e=window.event;return e&&e.type===`popstate`?e===Jd?!1:(Jd=e,!0):(Jd=null,!1)}var Xd=typeof setTimeout==`function`?setTimeout:void 0,Zd=typeof clearTimeout==`function`?clearTimeout:void 0,Qd=typeof Promise==`function`?Promise:void 0,$d=typeof queueMicrotask==`function`?queueMicrotask:Qd===void 0?Xd:function(e){return Qd.resolve(null).then(e).catch(ef)};function ef(e){setTimeout(function(){throw e})}function tf(e){return e===`head`}function nf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Pp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_f(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_f(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[lt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_f(e.ownerDocument.body);n=i}while(n);Pp(t)}function rf(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 af(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`:af(n),ut(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function of(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[lt])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=ff(e.nextSibling),e===null)break}return null}function sf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=ff(e.nextSibling),e===null))return null;return e}function cf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=ff(e.nextSibling),e===null))return null;return e}function lf(e){return e.data===`$?`||e.data===`$~`}function uf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function df(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 ff(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 pf=null;function mf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return ff(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function hf(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 gf(e,t,n){switch(t=Wd(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 _f(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ut(e)}var vf=new Map,yf=new Set;function bf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var xf=P.d;P.d={f:Sf,r:Cf,D:Ef,C:Df,L:Of,m:kf,X:jf,S:Af,M:Mf};function Sf(){var e=xf.f(),t=wu();return e||t}function Cf(e){var t=ft(e);t!==null&&t.tag===5&&t.type===`form`?Cs(t):xf.r(e)}var wf=typeof document>`u`?null:document;function Tf(e,t,n){var r=wf;if(r&&typeof t==`string`&&t){var i=Pt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),yf.has(i)||(yf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Rd(t,`link`,e),ht(t),r.head.appendChild(t)))}}function Ef(e){xf.D(e),Tf(`dns-prefetch`,e,null)}function Df(e,t){xf.C(e,t),Tf(`preconnect`,e,t)}function Of(e,t,n){xf.L(e,t,n);var r=wf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Pt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Pt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Pt(n.imageSizes)+`"]`)):i+=`[href="`+Pt(e)+`"]`;var a=i;switch(t){case`style`:a=Pf(e);break;case`script`:a=Rf(e)}vf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Ff(a))||t===`script`&&r.querySelector(zf(a))||(t=r.createElement(`link`),Rd(t,`link`,e),ht(t),r.head.appendChild(t)))}}function kf(e,t){xf.m(e,t);var n=wf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Pt(r)+`"][href="`+Pt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rf(e)}if(!vf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),vf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zf(a)))return}r=n.createElement(`link`),Rd(r,`link`,e),ht(r),n.head.appendChild(r)}}}function Af(e,t,n){xf.S(e,t,n);var r=wf;if(r&&e){var i=mt(r).hoistableStyles,a=Pf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Ff(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vf.get(a))&&Hf(e,n);var c=o=r.createElement(`link`);ht(c),Rd(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,Vf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jf(e,t){xf.X(e,t);var n=wf;if(n&&e){var r=mt(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=f({src:e,async:!0},t),(t=vf.get(i))&&Uf(e,t),a=n.createElement(`script`),ht(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t){xf.M(e,t);var n=wf;if(n&&e){var r=mt(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=vf.get(i))&&Uf(e,t),a=n.createElement(`script`),ht(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t,n,r){var a=(a=ie.current)?bf(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=Pf(n.href),n=mt(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=Pf(n.href);var o=mt(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(Ff(e)))&&!o._p&&(s.instance=o,s.state.loading=5),vf.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},vf.set(e,n),o||Lf(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=Rf(n),n=mt(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 Pf(e){return`href="`+Pt(e)+`"`}function Ff(e){return`link[rel="stylesheet"][`+e+`]`}function If(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Lf(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}),Rd(t,`link`,n),ht(t),e.head.appendChild(t))}function Rf(e){return`[src="`+Pt(e)+`"]`}function zf(e){return`script[async]`+e}function Bf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Pt(n.href)+`"]`);if(r)return t.instance=r,ht(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ht(r),Rd(r,`style`,a),Vf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pf(n.href);var o=e.querySelector(Ff(a));if(o)return t.state.loading|=4,t.instance=o,ht(o),o;r=If(n),(a=vf.get(a))&&Hf(r,a),o=(e.ownerDocument||e).createElement(`link`),ht(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Rd(o,`link`,r),t.state.loading|=4,Vf(o,n.precedence,e),t.instance=o;case`script`:return o=Rf(n.src),(a=e.querySelector(zf(o)))?(t.instance=a,ht(a),a):(r=n,(a=vf.get(o))&&(r=f({},n),Uf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ht(a),Rd(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,Vf(r,n.precedence,e));return t.instance}function Vf(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 Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wf=null;function Gf(e,t,n){if(Wf===null){var r=new Map,i=Wf=new Map;i.set(n,r)}else i=Wf,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[lt]||a[nt]||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 Kf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qf(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 Jf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Yf(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=Pf(r.href),a=t.querySelector(Ff(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=X.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ht(a);return}a=t.ownerDocument||t,r=If(r),(i=vf.get(i))&&Hf(r,i),a=a.createElement(`link`),ht(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Rd(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=X.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Xf=0;function Zf(e,t){return e.stylesheets&&e.count===0&&Z(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Z(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Xf===0&&(Xf=62500*Vd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Z(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Xf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function X(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Z(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qf=null;function Z(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qf=new Map,t.forEach($f,e),Qf=null,X.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Qf.get(e);if(n)var r=n.get(null);else{n=new Map,Qf.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=X.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 ep={$$typeof:b,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function tp(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=Ge(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ge(0),this.hiddenUpdates=Ge(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 np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(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 rp(e){return e?(e=ti,e):ti}function ip(e,t,n,r,i,a){i=rp(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&&(yu(n,e,t),za(n,e,t))}function ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){ap(e,t),(e=e.alternate)&&ap(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=Qr(e,67108864);t!==null&&yu(t,e,67108864),op(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=_u();t=Ze(t);var n=Qr(e,t);n!==null&&yu(n,e,t),op(e,t)}}var lp=!0;function up(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,fp(e,t,n,r)}finally{P.p=a,N.T=i}}function dp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,fp(e,t,n,r)}finally{P.p=a,N.T=i}}function fp(e,t,n,r){if(lp){var i=pp(r);if(i===null)Od(e,t,r,mp,n),wp(e,r);else if(Ep(i,e,t,n,r))r.stopPropagation();else if(wp(e,r),t&4&&-1<Cp.indexOf(e)){for(;i!==null;){var a=ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Be(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ne(o);s.entanglements[1]|=c,o&=~c}cd(a),!(Rl&6)&&(au=xe()+500,ld(0,!1))}}break;case 31:case 13:s=Qr(a,2),s!==null&&yu(s,a,2),wu(),op(a,2)}if(a=pp(r),a===null&&Od(e,t,r,mp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Od(e,t,r,null,n)}}function pp(e){return e=Zt(e),hp(e)}var mp=null;function hp(e){if(mp=null,e=dt(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 mp=e,null}function gp(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(V()){case H:return 2;case Se:return 8;case Ce:case Te:return 32;case De:return 268435456;default:return 32}default:return 32}}var _p=!1,vp=null,yp=null,bp=null,xp=new Map,Q=new Map,Sp=[],Cp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function wp(e,t){switch(e){case`focusin`:case`focusout`:vp=null;break;case`dragenter`:case`dragleave`:yp=null;break;case`mouseover`:case`mouseout`:bp=null;break;case`pointerover`:case`pointerout`:xp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Q.delete(t.pointerId)}}function Tp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ft(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ep(e,t,n,r,i){switch(t){case`focusin`:return vp=Tp(vp,e,t,n,r,i),!0;case`dragenter`:return yp=Tp(yp,e,t,n,r,i),!0;case`mouseover`:return bp=Tp(bp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return xp.set(a,Tp(xp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Q.set(a,Tp(Q.get(a)||null,e,t,n,r,i)),!0}return!1}function Dp(e){var t=dt(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,et(e.priority,function(){cp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,et(e.priority,function(){cp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Op(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Xt=r,n.target.dispatchEvent(r),Xt=null}else return t=ft(n),t!==null&&sp(t),e.blockedOn=n,!1;t.shift()}return!0}function kp(e,t,n){Op(e)&&n.delete(t)}function Ap(){_p=!1,vp!==null&&Op(vp)&&(vp=null),yp!==null&&Op(yp)&&(yp=null),bp!==null&&Op(bp)&&(bp=null),xp.forEach(kp),Q.forEach(kp)}function jp(e,n){e.blockedOn===n&&(e.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ap)))}var Mp=null;function Np(e){Mp!==e&&(Mp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Mp===e&&(Mp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(hp(r||n)===null)continue;break}var a=ft(n);a!==null&&(e.splice(t,3),t-=3,xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Pp(e){function t(t){return jp(t,e)}vp!==null&&jp(vp,e),yp!==null&&jp(yp,e),bp!==null&&jp(bp,e),xp.forEach(t),Q.forEach(t);for(var n=0;n<Sp.length;n++){var r=Sp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Sp.length&&(n=Sp[0],n.blockedOn===null);)Dp(n),n.blockedOn===null&&Sp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[rt]||null;if(typeof a==`function`)o||Np(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[rt]||null)s=o.formAction;else if(hp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Np(n)}}}function Fp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Ip(e){this._internalRoot=e}Lp.prototype.render=Ip.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ip(n,_u(),e,t,null,null)},Lp.prototype.unmount=Ip.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ip(e.current,2,null,e,null,null),wu(),t[it]=null}};function Lp(e){this._internalRoot=e}Lp.prototype.unstable_scheduleHydration=function(e){if(e){var t=$e();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Sp.length&&t!==0&&t<Sp[n].priority;n++);Sp.splice(n,0,e),n===0&&Dp(e)}};var Rp=n.version;if(Rp!==`19.2.5`)throw Error(i(527,Rp,`19.2.5`));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:d(e),e=e===null?null:e.stateNode,e};var zp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Bp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bp.isDisabled&&Bp.supportsFiber)try{Ae=Bp.inject(zp),je=Bp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ws,s=Gs,c=Ks;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=np(e,1,!1,null,null,n,r,null,o,s,c,Fp),e[it]=t.current,Ed(e),new Ip(t)}})),Oe=t(((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=De()})),ke=`popstate`;function Ae(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function je(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Ie(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Le(t)}return ze(t,n,null,e)}function Me(e,t){if(e===!1||e==null)throw Error(t)}function Ne(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Pe(){return Math.random().toString(36).substring(2,10)}function Fe(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Ie(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Re(t):t,state:n,key:t&&t.key||r||Pe(),unstable_mask:i}}function Le({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Re(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ze(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Ae(e)?e:Ie(h.location,e,t);n&&n(r,e),l=u()+1;let d=Fe(r,l),f=h.createHref(r.unstable_mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Ae(e)?e:Ie(h.location,e,t);n&&n(r,e),l=u();let i=Fe(r,l),d=h.createHref(r.unstable_mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Be(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(ke,d),c=e,()=>{i.removeEventListener(ke,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Be(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),Me(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:Le(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function Ve(e,t,n=`/`){return He(e,t,n,!1)}function He(e,t,n,r){let i=ot((typeof t==`string`?Re(t):t).pathname||`/`,n);if(i==null)return null;let a=We(e);Ke(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=at(i);o=nt(a[e],t,r)}return o}function Ue(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function We(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;Me(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=ht([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(Me(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),We(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:et(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Ge(e.path))a(e,t,!0,n)}),t}function Ge(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Ge(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Ke(e){e.sort((e,t)=>e.score===t.score?tt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var qe=/^:[\w-]+$/,Je=3,Ye=2,Xe=1,Ze=10,Qe=-2,$e=e=>e===`*`;function et(e,t){let n=e.split(`/`),r=n.length;return n.some($e)&&(r+=Qe),t&&(r+=Ye),n.filter(e=>!$e(e)).reduce((e,t)=>e+(qe.test(t)?Je:t===``?Xe:Ze),r)}function tt(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function nt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=rt({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=rt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:ht([a,u.pathname]),pathnameBase:_t(ht([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=ht([a,u.pathnameBase]))}return o}function rt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=it(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function it(e,t=!1,n=!0){Ne(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function at(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Ne(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ot(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var st=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ct(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Re(e):e,a;return n?(n=mt(n),a=n.startsWith(`/`)?lt(n.substring(1),`/`):lt(n,t)):a=t,{pathname:a,search:vt(r),hash:yt(i)}}function lt(e,t){let n=gt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ut(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function dt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ft(e){let t=dt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function pt(e,t,n,r=!1){let i;typeof e==`string`?i=Re(e):(i={...e},Me(!i.pathname||!i.pathname.includes(`?`),ut(`?`,`pathname`,`search`,i)),Me(!i.pathname||!i.pathname.includes(`#`),ut(`#`,`pathname`,`hash`,i)),Me(!i.search||!i.search.includes(`#`),ut(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=ct(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var mt=e=>e.replace(/\/\/+/g,`/`),ht=e=>mt(e.join(`/`)),gt=e=>e.replace(/\/+$/,``),_t=e=>gt(e).replace(/^\/*/,`/`),vt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,yt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,bt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function xt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function St(e){return ht(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ct=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function wt(e,t){let n=e;if(typeof n!=`string`||!st.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ct)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=ot(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Ne(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Tt=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Tt);var Et=[`GET`,...Tt];new Set(Et);var Dt=B.createContext(null);Dt.displayName=`DataRouter`;var Ot=B.createContext(null);Ot.displayName=`DataRouterState`;var kt=B.createContext(!1);function At(){return B.useContext(kt)}var jt=B.createContext({isTransitioning:!1});jt.displayName=`ViewTransition`;var Mt=B.createContext(new Map);Mt.displayName=`Fetchers`;var Nt=B.createContext(null);Nt.displayName=`Await`;var Pt=B.createContext(null);Pt.displayName=`Navigation`;var Ft=B.createContext(null);Ft.displayName=`Location`;var It=B.createContext({outlet:null,matches:[],isDataRoute:!1});It.displayName=`Route`;var Lt=B.createContext(null);Lt.displayName=`RouteError`;var Rt=`REACT_ROUTER_ERROR`,zt=`REDIRECT`,Bt=`ROUTE_ERROR_RESPONSE`;function Vt(e){if(e.startsWith(`${Rt}:${zt}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Ht(e){if(e.startsWith(`${Rt}:${Bt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new bt(t.status,t.statusText,t.data)}catch{}}function Ut(e,{relative:t}={}){Me(Wt(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=B.useContext(Pt),{hash:i,pathname:a,search:o}=Xt(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:ht([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Wt(){return B.useContext(Ft)!=null}function Gt(){return Me(Wt(),`useLocation() may be used only in the context of a <Router> component.`),B.useContext(Ft).location}var Kt=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function qt(e){B.useContext(Pt).static||B.useLayoutEffect(e)}function Jt(){let{isDataRoute:e}=B.useContext(It);return e?gn():Yt()}function Yt(){Me(Wt(),`useNavigate() may be used only in the context of a <Router> component.`);let e=B.useContext(Dt),{basename:t,navigator:n}=B.useContext(Pt),{matches:r}=B.useContext(It),{pathname:i}=Gt(),a=JSON.stringify(ft(r)),o=B.useRef(!1);return qt(()=>{o.current=!0}),B.useCallback((r,s={})=>{if(Ne(o.current,Kt),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=pt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:ht([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}B.createContext(null);function Xt(e,{relative:t}={}){let{matches:n}=B.useContext(It),{pathname:r}=Gt(),i=JSON.stringify(ft(n));return B.useMemo(()=>pt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Zt(e,t){return Qt(e,t)}function Qt(e,t,n){Me(Wt(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=B.useContext(Pt),{matches:i}=B.useContext(It),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;vn(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
31
-
32
- Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Gt(),d;if(t){let e=typeof t==`string`?Re(t):t;Me(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=Ve(e,{pathname:p});Ne(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Ne(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=on(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:ht([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:ht([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?B.createElement(Ft.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...d},navigationType:`POP`}},h):h}function $t(){let e=hn(),t=xt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=B.createElement(B.Fragment,null,B.createElement(`p`,null,`💿 Hey developer 👋`),B.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,B.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,B.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),B.createElement(B.Fragment,null,B.createElement(`h2`,null,`Unexpected Application Error!`),B.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?B.createElement(`pre`,{style:i},n):null,o)}var en=B.createElement($t,null),tn=class extends B.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ht(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:B.createElement(It.Provider,{value:this.props.routeContext},B.createElement(Lt.Provider,{value:e,children:this.props.component}));return this.context?B.createElement(rn,{error:e},t):t}};tn.contextType=kt;var nn=new WeakMap;function rn({children:e,error:t}){let{basename:n}=B.useContext(Pt);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Vt(t.digest);if(e){let r=nn.get(t);if(r)throw r;let i=wt(e.location,n);if(Ct&&!nn.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw nn.set(t,n),n}return B.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function an({routeContext:e,match:t,children:n}){let r=B.useContext(Dt);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),B.createElement(It.Provider,{value:e},n)}function on(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);Me(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:St(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||en,o&&(s<0&&c===0?(vn(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?B.createElement(n.route.Component,null):n.route.element?n.route.element:e,B.createElement(an,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?B.createElement(tn,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function sn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cn(e){let t=B.useContext(Dt);return Me(t,sn(e)),t}function ln(e){let t=B.useContext(Ot);return Me(t,sn(e)),t}function un(e){let t=B.useContext(It);return Me(t,sn(e)),t}function dn(e){let t=un(e),n=t.matches[t.matches.length-1];return Me(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function fn(){return dn(`useRouteId`)}function pn(){return ln(`useNavigation`).navigation}function mn(){let{matches:e,loaderData:t}=ln(`useMatches`);return B.useMemo(()=>e.map(e=>Ue(e,t)),[e,t])}function hn(){let e=B.useContext(Lt),t=ln(`useRouteError`),n=dn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function gn(){let{router:e}=cn(`useNavigate`),t=dn(`useNavigate`),n=B.useRef(!1);return qt(()=>{n.current=!0}),B.useCallback(async(r,i={})=>{Ne(n.current,Kt),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var _n={};function vn(e,t,n){!t&&!_n[e]&&(_n[e]=!0,Ne(!1,n))}B.memo(yn);function yn({routes:e,future:t,state:n,isStatic:r,onError:i}){return Qt(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function bn(e){Me(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function xn({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){Me(!Wt(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=B.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Re(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,unstable_mask:m}=n,h=B.useMemo(()=>{let e=ot(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,unstable_mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return Ne(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:B.createElement(Pt.Provider,{value:c},B.createElement(Ft.Provider,{children:t,value:h}))}function Sn({children:e,location:t}){return Zt(Cn(e),t)}B.Component;function Cn(e,t=[]){let n=[];return B.Children.forEach(e,(e,r)=>{if(!B.isValidElement(e))return;let i=[...t,r];if(e.type===B.Fragment){n.push.apply(n,Cn(e.props.children,i));return}Me(e.type===bn,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Me(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Cn(e.props.children,i)),n.push(a)}),n}var wn=`get`,Tn=`application/x-www-form-urlencoded`;function En(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Dn(e){return En(e)&&e.tagName.toLowerCase()===`button`}function On(e){return En(e)&&e.tagName.toLowerCase()===`form`}function kn(e){return En(e)&&e.tagName.toLowerCase()===`input`}function An(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function jn(e,t){return e.button===0&&(!t||t===`_self`)&&!An(e)}var Mn=null;function Nn(){if(Mn===null)try{new FormData(document.createElement(`form`),0),Mn=!1}catch{Mn=!0}return Mn}var Pn=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Fn(e){return e!=null&&!Pn.has(e)?(Ne(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tn}"`),null):e}function In(e,t){let n,r,i,a,o;if(On(e)){let o=e.getAttribute(`action`);r=o?ot(o,t):null,n=e.getAttribute(`method`)||wn,i=Fn(e.getAttribute(`enctype`))||Tn,a=new FormData(e)}else if(Dn(e)||kn(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?ot(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||wn,i=Fn(e.getAttribute(`formenctype`))||Fn(o.getAttribute(`enctype`))||Tn,a=new FormData(o,e),!Nn()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(En(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=wn,r=null,i=Tn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ln={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Rn=/[&><\u2028\u2029]/g;function zn(e){return e.replace(Rn,e=>Ln[e])}function Bn(e,t){if(e===!1||e==null)throw Error(t)}function Vn(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&ot(i.pathname,t)===`/`?i.pathname=`${gt(t)}/_root.${r}`:i.pathname=`${gt(i.pathname)}.${r}`,i}async function Hn(e,t){if(e.id in t)return t[e.id];try{let r=await n(()=>import(e.module),[]);return t[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Un(e){return e!=null&&typeof e.page==`string`}function Wn(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Gn(e,t,n){return Xn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Hn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Wn).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Kn(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function qn(e,t,{includeHydrateFallback:n}={}){return Jn(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Jn(e){return[...new Set(e)]}function Yn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Xn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Un(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Yn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Zn(){let e=B.useContext(Dt);return Bn(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Qn(){let e=B.useContext(Ot);return Bn(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var $n=B.createContext(void 0);$n.displayName=`FrameworkContext`;function er(){let e=B.useContext($n);return Bn(e,`You must render this element inside a <HydratedRouter> element`),e}function tr(e,t){let n=B.useContext($n),[r,i]=B.useState(!1),[a,o]=B.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=B.useRef(null);B.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),B.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:nr(s,p),onBlur:nr(c,m),onMouseEnter:nr(l,p),onMouseLeave:nr(u,m),onTouchStart:nr(d,p)}]:[a,f,{}]:[!1,f,{}]}function nr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function rr({page:e,...t}){let n=At(),{router:r}=Zn(),i=B.useMemo(()=>Ve(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?B.createElement(ar,{page:e,matches:i,...t}):B.createElement(or,{page:e,matches:i,...t}):null}function ir(e){let{manifest:t,routeModules:n}=er(),[r,i]=B.useState([]);return B.useEffect(()=>{let r=!1;return Gn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function ar({page:e,matches:t,...n}){let r=Gt(),{future:i}=er(),{basename:a}=Zn(),o=B.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Vn(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return B.createElement(B.Fragment,null,o.map(e=>B.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function or({page:e,matches:t,...n}){let r=Gt(),{future:i,manifest:a,routeModules:o}=er(),{basename:s}=Zn(),{loaderData:c,matches:l}=Qn(),u=B.useMemo(()=>Kn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=B.useMemo(()=>Kn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=B.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Vn(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=B.useMemo(()=>qn(d,a),[d,a]),m=ir(d);return B.createElement(B.Fragment,null,f.map(e=>B.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>B.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>B.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function sr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}B.Component;var cr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{cr&&(window.__reactRouterVersion=`7.14.2`)}catch{}function lr({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=B.useRef();i.current??=je({window:r,v5Compat:!0});let a=i.current,[o,s]=B.useState({action:a.action,location:a.location}),c=B.useCallback(e=>{n===!1?s(e):B.startTransition(()=>s(e))},[n]);return B.useLayoutEffect(()=>a.listen(c),[a,c]),B.createElement(xn,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}function ur({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=B.useState({action:n.action,location:n.location}),o=B.useCallback(e=>{r===!1?a(e):B.startTransition(()=>a(e))},[r]);return B.useLayoutEffect(()=>n.listen(o),[n,o]),B.createElement(xn,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}ur.displayName=`unstable_HistoryRouter`;var dr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fr=B.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,unstable_mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,unstable_useTransitions:_}=B.useContext(Pt),v=typeof l==`string`&&dr.test(l),y=wt(l,h);l=y.to;let b=Ut(l,{relative:r}),x=Gt(),S=null;if(o){let e=pt(o,[],x.unstable_mask?x.unstable_mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:ht([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=tr(n,p),E=yr(l,{replace:a,unstable_mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),k=B.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:sr(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?B.createElement(B.Fragment,null,k,B.createElement(rr,{page:b})):k});fr.displayName=`Link`;var pr=B.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Xt(a,{relative:c.relative}),d=Gt(),f=B.useContext(Ot),{navigator:p,basename:m}=B.useContext(Pt),h=f!=null&&kr(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=ot(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return B.createElement(fr,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});pr.displayName=`NavLink`;var mr=B.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=wn,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:h}=B.useContext(Pt),g=Sr(),_=Cr(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&dr.test(s);return B.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f});h&&n!==!1?B.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});mr.displayName=`Form`;function hr({getKey:e,storageKey:t,...n}){let r=B.useContext($n),{basename:i}=B.useContext(Pt),a=Gt(),o=mn();Dr({getKey:e,storageKey:t});let s=B.useMemo(()=>{if(!r||!e)return null;let t=Er(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return B.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${zn(JSON.stringify(t||wr))}, ${zn(JSON.stringify(s))})`}})}hr.displayName=`ScrollRestoration`;function gr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _r(e){let t=B.useContext(Dt);return Me(t,gr(e)),t}function vr(e){let t=B.useContext(Ot);return Me(t,gr(e)),t}function yr(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=Jt(),d=Gt(),f=Xt(e,{relative:o});return B.useCallback(p=>{if(jn(p,t)){p.preventDefault();let t=n===void 0?Le(d)===Le(f):n,m=()=>u(e,{replace:t,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c});l?B.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var br=0,xr=()=>`__${String(++br)}__`;function Sr(){let{router:e}=_r(`useSubmit`),{basename:t}=B.useContext(Pt),n=fn(),r=e.fetch,i=e.navigate;return B.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=In(e,t);a.navigate===!1?await r(a.fetcherKey||xr(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Cr(e,{relative:t}={}){let{basename:n}=B.useContext(Pt),r=B.useContext(It);Me(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Xt(e||`.`,{relative:t})},o=Gt();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:ht([n,a.pathname])),Le(a)}var wr=`react-router-scroll-positions`,Tr={};function Er(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:ot(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Dr({getKey:e,storageKey:t}={}){let{router:n}=_r(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=vr(`useScrollRestoration`),{basename:a}=B.useContext(Pt),o=Gt(),s=mn(),c=pn();B.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Or(B.useCallback(()=>{if(c.state===`idle`){let t=Er(o,s,a,e);Tr[t]=window.scrollY}try{sessionStorage.setItem(t||wr,JSON.stringify(Tr))}catch(e){Ne(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(B.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||wr);e&&(Tr=JSON.parse(e))}catch{}},[t]),B.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Tr,()=>window.scrollY,e?(t,n)=>Er(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),B.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{Ne(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Or(e,t){let{capture:n}=t||{};B.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function kr(e,{relative:t}={}){let n=B.useContext(jt);Me(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=_r(`useViewTransitionState`),i=Xt(e,{relative:t});if(!n.isTransitioning)return!1;let a=ot(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ot(n.nextLocation.pathname,r)||n.nextLocation.pathname;return rt(i.pathname,o)!=null||rt(i.pathname,a)!=null}var Ar=e(Oe(),1),jr=`(max-width: 899px), (pointer: coarse)`,Mr=e=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>void 0;let t=window.matchMedia(jr);return typeof t.addEventListener==`function`?(t.addEventListener(`change`,e),()=>{t.removeEventListener(`change`,e)}):(t.addListener(e),()=>{t.removeListener(e)})},Nr=()=>typeof window>`u`||typeof window.matchMedia!=`function`?`desktop`:window.matchMedia(jr).matches?`mobile`:`desktop`,Pr=()=>`desktop`;function Fr(){return(0,B.useSyncExternalStore)(Mr,Nr,Pr)}var Ir=Symbol(``),Lr=e=>typeof e?.then==`function`;function Rr(e=()=>{try{return window.localStorage}catch{return}},t){let n,r,i={getItem:(i,a)=>{let o=e=>{if(e||=``,n!==e){try{r=JSON.parse(e,t?.reviver)}catch{return a}n=e}return r},s=e()?.getItem(i)??null;return Lr(s)?s.then(o):o(s)},setItem:(n,r)=>e()?.setItem(n,JSON.stringify(r,t?.replacer)),removeItem:t=>e()?.removeItem(t)},a=e=>(t,n,r)=>e(t,e=>{let t;try{t=JSON.parse(e||``)}catch{t=r}n(t)}),o;try{o=e()?.subscribe}catch{}return!o&&typeof window<`u`&&typeof window.addEventListener==`function`&&window.Storage&&(o=(t,n)=>{if(!(e()instanceof window.Storage))return()=>{};let r=r=>{r.storageArea===e()&&r.key===t&&n(r.newValue)};return window.addEventListener(`storage`,r),()=>{window.removeEventListener(`storage`,r)}}),o&&(i.subscribe=a(o)),i}var zr=Rr();function Br(e,t,n=zr,r){let i=z(r?.getOnInit?n.getItem(e,t):t);return i.onMount=r=>(r(n.getItem(e,t)),n.subscribe?.call(n,e,r,t)),z(e=>e(i),(r,a,o)=>{let s=typeof o==`function`?o(r(i)):o;return s===Ir?(a(i,t),n.removeItem(e)):Lr(s)?s.then(t=>(a(i,t),n.setItem(e,t))):(a(i,s),n.setItem(e,s))})}var Vr=Br(`ui.theme`,`dark`),Hr=Br(`ui.locale`,`zh`),Ur=z(!1),Wr=z(!1),Gr=z(null),Kr=z(null),qr=86400;function Jr(e){return typeof e!=`number`||!Number.isFinite(e)||!Number.isSafeInteger(e)||e<1||e>86400?600:e}var Yr;function U(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var Xr=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Zr=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Yr=globalThis).__zod_globalConfig??(Yr.__zod_globalConfig={});var Qr=globalThis.__zod_globalConfig;function $r(e){return e&&Object.assign(Qr,e),Qr}function ei(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function ti(e,t){return typeof t==`bigint`?t.toString():t}function ni(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function ri(e){return e==null}function ii(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ai(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var oi=Symbol(`evaluating`);function si(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==oi)return r===void 0&&(r=oi,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ci(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function li(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function ui(e){return JSON.stringify(e)}function di(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var fi=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function pi(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var mi=ni(()=>{if(Qr.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function hi(e){if(pi(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(pi(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function gi(e){return hi(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var _i=new Set([`string`,`number`,`symbol`]);function vi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function yi(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function W(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function bi(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var xi={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Si(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return yi(e,li(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return ci(this,`shape`,e),e},checks:[]}))}function Ci(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return yi(e,li(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return ci(this,`shape`,r),r},checks:[]}))}function wi(e,t){if(!hi(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return yi(e,li(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ci(this,`shape`,n),n}}))}function Ti(e,t){if(!hi(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return yi(e,li(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ci(this,`shape`,n),n}}))}function Ei(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return yi(e,li(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ci(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Di(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return yi(t,li(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return ci(this,`shape`,i),i},checks:[]}))}function Oi(e,t,n){return yi(t,li(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return ci(this,`shape`,i),i}}))}function G(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ki(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Ai(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ji(e){return typeof e==`string`?e:e?.message}function Mi(e,t,n){let r=e.message?e.message:ji(e.inst?._zod.def?.error?.(e))??ji(t?.error?.(e))??ji(n.customError?.(e))??ji(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Ni(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Pi(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Fi=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,ti,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Ii=U(`$ZodError`,Fi),Li=U(`$ZodError`,Fi,{Parent:Error});function Ri(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function zi(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var Bi=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Xr;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Mi(e,a,$r())));throw fi(t,i?.callee),t}return o.value},Vi=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Mi(e,a,$r())));throw fi(t,i?.callee),t}return o.value},Hi=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Xr;return a.issues.length?{success:!1,error:new(e??Ii)(a.issues.map(e=>Mi(e,i,$r())))}:{success:!0,data:a.value}},Ui=Hi(Li),Wi=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Mi(e,i,$r())))}:{success:!0,data:a.value}},Gi=Wi(Li),Ki=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Bi(e)(t,n,i)},qi=e=>(t,n,r)=>Bi(e)(t,n,r),Ji=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Vi(e)(t,n,i)},Yi=e=>async(t,n,r)=>Vi(e)(t,n,r),Xi=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Hi(e)(t,n,i)},Zi=e=>(t,n,r)=>Hi(e)(t,n,r),Qi=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Wi(e)(t,n,i)},$i=e=>async(t,n,r)=>Wi(e)(t,n,r),ea=/^[cC][0-9a-z]{6,}$/,ta=/^[0-9a-z]+$/,na=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ra=/^[0-9a-vA-V]{20}$/,ia=/^[A-Za-z0-9]{27}$/,aa=/^[a-zA-Z0-9_-]{21}$/,oa=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sa=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ca=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,la=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ua=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function da(){return new RegExp(ua,`u`)}var fa=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pa=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ma=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ha=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ga=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_a=/^[A-Za-z0-9_-]*$/,va=/^https?$/,ya=/^\+[1-9]\d{6,14}$/,ba=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,xa=RegExp(`^${ba}$`);function Sa(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ca(e){return RegExp(`^${Sa(e)}$`)}function wa(e){let t=Sa({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${ba}T(?:${r})$`)}var Ta=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Ea=/^-?\d+$/,Da=/^-?\d+(?:\.\d+)?$/,Oa=/^(?:true|false)$/i,ka=/^[^A-Z]*$/,Aa=/^[^a-z]*$/,ja=U(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ma={number:`number`,bigint:`bigint`,object:`date`},Na=U(`$ZodCheckLessThan`,(e,t)=>{ja.init(e,t);let n=Ma[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pa=U(`$ZodCheckGreaterThan`,(e,t)=>{ja.init(e,t);let n=Ma[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fa=U(`$ZodCheckMultipleOf`,(e,t)=>{ja.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):ai(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ia=U(`$ZodCheckNumberFormat`,(e,t)=>{ja.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=xi[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Ea)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),La=U(`$ZodCheckMaxLength`,(e,t)=>{var n;ja.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ri(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Ni(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ra=U(`$ZodCheckMinLength`,(e,t)=>{var n;ja.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ri(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Ni(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),za=U(`$ZodCheckLengthEquals`,(e,t)=>{var n;ja.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ri(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Ni(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ba=U(`$ZodCheckStringFormat`,(e,t)=>{var n,r;ja.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Va=U(`$ZodCheckRegex`,(e,t)=>{Ba.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ha=U(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ka,Ba.init(e,t)}),Ua=U(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Aa,Ba.init(e,t)}),Wa=U(`$ZodCheckIncludes`,(e,t)=>{ja.init(e,t);let n=vi(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ga=U(`$ZodCheckStartsWith`,(e,t)=>{ja.init(e,t);let n=RegExp(`^${vi(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ka=U(`$ZodCheckEndsWith`,(e,t)=>{ja.init(e,t);let n=RegExp(`.*${vi(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),qa=U(`$ZodCheckOverwrite`,(e,t)=>{ja.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Ja=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
33
- `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
34
- `))}},Ya={major:4,minor:4,patch:3},Xa=U(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ya;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=G(e),i;for(let a of t){if(a._zod.def.when){if(ki(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Xr;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=G(e,t))});else{if(e.issues.length===t)continue;r||=G(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(G(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Xr;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Xr;return o.then(e=>t(e,r,a))}return t(o,r,a)}}si(e,`~standard`,()=>({validate:t=>{try{let n=Ui(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Gi(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Za=U(`$ZodString`,(e,t)=>{Xa.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ta(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Qa=U(`$ZodStringFormat`,(e,t)=>{Ba.init(e,t),Za.init(e,t)}),$a=U(`$ZodGUID`,(e,t)=>{t.pattern??=sa,Qa.init(e,t)}),eo=U(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=ca(e)}else t.pattern??=ca();Qa.init(e,t)}),to=U(`$ZodEmail`,(e,t)=>{t.pattern??=la,Qa.init(e,t)}),no=U(`$ZodURL`,(e,t)=>{Qa.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===va.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),ro=U(`$ZodEmoji`,(e,t)=>{t.pattern??=da(),Qa.init(e,t)}),io=U(`$ZodNanoID`,(e,t)=>{t.pattern??=aa,Qa.init(e,t)}),ao=U(`$ZodCUID`,(e,t)=>{t.pattern??=ea,Qa.init(e,t)}),oo=U(`$ZodCUID2`,(e,t)=>{t.pattern??=ta,Qa.init(e,t)}),K=U(`$ZodULID`,(e,t)=>{t.pattern??=na,Qa.init(e,t)}),so=U(`$ZodXID`,(e,t)=>{t.pattern??=ra,Qa.init(e,t)}),co=U(`$ZodKSUID`,(e,t)=>{t.pattern??=ia,Qa.init(e,t)}),lo=U(`$ZodISODateTime`,(e,t)=>{t.pattern??=wa(t),Qa.init(e,t)}),uo=U(`$ZodISODate`,(e,t)=>{t.pattern??=xa,Qa.init(e,t)}),fo=U(`$ZodISOTime`,(e,t)=>{t.pattern??=Ca(t),Qa.init(e,t)}),po=U(`$ZodISODuration`,(e,t)=>{t.pattern??=oa,Qa.init(e,t)}),mo=U(`$ZodIPv4`,(e,t)=>{t.pattern??=fa,Qa.init(e,t),e._zod.bag.format=`ipv4`}),ho=U(`$ZodIPv6`,(e,t)=>{t.pattern??=pa,Qa.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),go=U(`$ZodCIDRv4`,(e,t)=>{t.pattern??=ma,Qa.init(e,t)}),_o=U(`$ZodCIDRv6`,(e,t)=>{t.pattern??=ha,Qa.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function vo(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var yo=U(`$ZodBase64`,(e,t)=>{t.pattern??=ga,Qa.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{vo(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function bo(e){if(!_a.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return vo(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var xo=U(`$ZodBase64URL`,(e,t)=>{t.pattern??=_a,Qa.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{bo(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),So=U(`$ZodE164`,(e,t)=>{t.pattern??=ya,Qa.init(e,t)});function Co(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var wo=U(`$ZodJWT`,(e,t)=>{Qa.init(e,t),e._zod.check=n=>{Co(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),To=U(`$ZodNumber`,(e,t)=>{Xa.init(e,t),e._zod.pattern=e._zod.bag.pattern??Da,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Eo=U(`$ZodNumberFormat`,(e,t)=>{Ia.init(e,t),To.init(e,t)}),Do=U(`$ZodBoolean`,(e,t)=>{Xa.init(e,t),e._zod.pattern=Oa,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Oo=U(`$ZodUnknown`,(e,t)=>{Xa.init(e,t),e._zod.parse=e=>e}),ko=U(`$ZodNever`,(e,t)=>{Xa.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Ao(e,t,n){e.issues.length&&t.issues.push(...Ai(n,e.issues)),t.value[n]=e.value}var jo=U(`$ZodArray`,(e,t)=>{Xa.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Ao(t,n,e))):Ao(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Mo(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Ai(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function No(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=bi(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Po(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Mo(e,n,i,t,u,d))):Mo(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Fo=U(`$ZodObject`,(e,t)=>{if(Xa.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=ni(()=>No(t));si(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=pi,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Mo(n,t,e,s,r,i))):Mo(a,t,e,s,r,i)}return i?Po(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Io=U(`$ZodObjectJIT`,(e,t)=>{Fo.init(e,t);let n=e._zod.parse,r=ni(()=>No(t)),i=e=>{let t=new Ja([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=ui(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=ui(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
35
- if (${n}.issues.length) {
36
- if (${o} in input) {
37
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
38
- ...iss,
39
- path: iss.path ? [${o}, ...iss.path] : [${o}]
40
- })));
41
- }
42
- }
43
-
44
- if (${n}.value === undefined) {
45
- if (${o} in input) {
46
- newResult[${o}] = undefined;
47
- }
48
- } else {
49
- newResult[${o}] = ${n}.value;
50
- }
51
-
52
- `):c?t.write(`
53
- if (${n}.issues.length) {
54
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
55
- ...iss,
56
- path: iss.path ? [${o}, ...iss.path] : [${o}]
57
- })));
58
- }
59
-
60
- if (${n}.value === undefined) {
61
- if (${o} in input) {
62
- newResult[${o}] = undefined;
63
- }
64
- } else {
65
- newResult[${o}] = ${n}.value;
66
- }
67
-
68
- `):t.write(`
69
- const ${n}_present = ${o} in input;
70
- if (${n}.issues.length) {
71
- payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
72
- ...iss,
73
- path: iss.path ? [${o}, ...iss.path] : [${o}]
74
- })));
75
- }
76
- if (!${n}_present && !${n}.issues.length) {
77
- payload.issues.push({
78
- code: "invalid_type",
79
- expected: "nonoptional",
80
- input: undefined,
81
- path: [${o}]
82
- });
83
- }
84
-
85
- if (${n}_present) {
86
- if (${n}.value === undefined) {
87
- newResult[${o}] = undefined;
88
- } else {
89
- newResult[${o}] = ${n}.value;
90
- }
91
- }
92
-
93
- `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=pi,s=!Qr.jitless,c=s&&mi.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Po([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Lo(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!G(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Mi(e,r,$r())))}),t)}var Ro=U(`$ZodUnion`,(e,t)=>{Xa.init(e,t),si(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),si(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),si(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),si(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ii(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Lo(t,r,e,i)):Lo(o,r,e,i)}}),zo=U(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Ro.init(e,t);let n=e._zod.parse;si(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=ni(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!pi(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Bo=U(`$ZodIntersection`,(e,t)=>{Xa.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Ho(e,t,n)):Ho(e,i,a)}});function Vo(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(hi(e)&&hi(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Vo(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Vo(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ho(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),G(e))return e;let o=Vo(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Uo=U(`$ZodRecord`,(e,t)=>{Xa.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!hi(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>Mi(e,r,$r())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...Ai(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...Ai(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&Da.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Mi(e,r,$r())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Ai(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Ai(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Wo=U(`$ZodEnum`,(e,t)=>{Xa.init(e,t);let n=ei(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>_i.has(typeof e)).map(e=>typeof e==`string`?vi(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Go=U(`$ZodLiteral`,(e,t)=>{if(Xa.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?vi(e):e?vi(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Ko=U(`$ZodTransform`,(e,t)=>{Xa.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Zr(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new Xr;return n.value=i,n.fallback=!0,n}});function qo(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Jo=U(`$ZodOptional`,(e,t)=>{Xa.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,si(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),si(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ii(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>qo(e,r)):qo(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Yo=U(`$ZodExactOptional`,(e,t)=>{Jo.init(e,t),si(e._zod,`values`,()=>t.innerType._zod.values),si(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Xo=U(`$ZodNullable`,(e,t)=>{Xa.init(e,t),si(e._zod,`optin`,()=>t.innerType._zod.optin),si(e._zod,`optout`,()=>t.innerType._zod.optout),si(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ii(e.source)}|null)$`):void 0}),si(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Zo=U(`$ZodDefault`,(e,t)=>{Xa.init(e,t),e._zod.optin=`optional`,si(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Qo(e,t)):Qo(r,t)}});function Qo(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var $o=U(`$ZodPrefault`,(e,t)=>{Xa.init(e,t),e._zod.optin=`optional`,si(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),es=U(`$ZodNonOptional`,(e,t)=>{Xa.init(e,t),si(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ts(t,e)):ts(i,e)}});function ts(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var ns=U(`$ZodCatch`,(e,t)=>{Xa.init(e,t),e._zod.optin=`optional`,si(e._zod,`optout`,()=>t.innerType._zod.optout),si(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Mi(e,n,$r()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Mi(e,n,$r()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),rs=U(`$ZodPipe`,(e,t)=>{Xa.init(e,t),si(e._zod,`values`,()=>t.in._zod.values),si(e._zod,`optin`,()=>t.in._zod.optin),si(e._zod,`optout`,()=>t.out._zod.optout),si(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>is(e,t.in,n)):is(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>is(e,t.out,n)):is(r,t.out,n)}});function is(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var as=U(`$ZodReadonly`,(e,t)=>{Xa.init(e,t),si(e._zod,`propValues`,()=>t.innerType._zod.propValues),si(e._zod,`values`,()=>t.innerType._zod.values),si(e._zod,`optin`,()=>t.innerType?._zod?.optin),si(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(os):os(r)}});function os(e){return e.value=Object.freeze(e.value),e}var ss=U(`$ZodCustom`,(e,t)=>{ja.init(e,t),Xa.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>cs(t,n,r,e));cs(i,n,r,e)}});function cs(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Pi(e))}}var ls,us=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ds(){return new us}(ls=globalThis).__zod_globalRegistry??(ls.__zod_globalRegistry=ds());var fs=globalThis.__zod_globalRegistry;function ps(e,t){return new e({type:`string`,...W(t)})}function ms(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...W(t)})}function hs(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...W(t)})}function gs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...W(t)})}function _s(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...W(t)})}function vs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...W(t)})}function ys(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...W(t)})}function bs(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...W(t)})}function xs(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...W(t)})}function Ss(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...W(t)})}function Cs(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...W(t)})}function ws(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...W(t)})}function Ts(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...W(t)})}function Es(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...W(t)})}function Ds(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...W(t)})}function Os(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...W(t)})}function ks(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...W(t)})}function As(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...W(t)})}function js(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...W(t)})}function Ms(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...W(t)})}function Ns(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...W(t)})}function Ps(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...W(t)})}function Fs(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...W(t)})}function Is(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...W(t)})}function Ls(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...W(t)})}function Rs(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...W(t)})}function zs(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...W(t)})}function Bs(e,t){return new e({type:`number`,checks:[],...W(t)})}function Vs(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...W(t)})}function Hs(e,t){return new e({type:`boolean`,...W(t)})}function Us(e){return new e({type:`unknown`})}function Ws(e,t){return new e({type:`never`,...W(t)})}function Gs(e,t){return new Na({check:`less_than`,...W(t),value:e,inclusive:!1})}function Ks(e,t){return new Na({check:`less_than`,...W(t),value:e,inclusive:!0})}function qs(e,t){return new Pa({check:`greater_than`,...W(t),value:e,inclusive:!1})}function Js(e,t){return new Pa({check:`greater_than`,...W(t),value:e,inclusive:!0})}function Ys(e,t){return new Fa({check:`multiple_of`,...W(t),value:e})}function Xs(e,t){return new La({check:`max_length`,...W(t),maximum:e})}function Zs(e,t){return new Ra({check:`min_length`,...W(t),minimum:e})}function Qs(e,t){return new za({check:`length_equals`,...W(t),length:e})}function $s(e,t){return new Va({check:`string_format`,format:`regex`,...W(t),pattern:e})}function ec(e){return new Ha({check:`string_format`,format:`lowercase`,...W(e)})}function tc(e){return new Ua({check:`string_format`,format:`uppercase`,...W(e)})}function nc(e,t){return new Wa({check:`string_format`,format:`includes`,...W(t),includes:e})}function rc(e,t){return new Ga({check:`string_format`,format:`starts_with`,...W(t),prefix:e})}function ic(e,t){return new Ka({check:`string_format`,format:`ends_with`,...W(t),suffix:e})}function ac(e){return new qa({check:`overwrite`,tx:e})}function oc(e){return ac(t=>t.normalize(e))}function sc(){return ac(e=>e.trim())}function cc(){return ac(e=>e.toLowerCase())}function lc(){return ac(e=>e.toUpperCase())}function uc(){return ac(e=>di(e))}function dc(e,t,n){return new e({type:`array`,element:t,...W(n)})}function fc(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...W(n)})}function pc(e,t){let n=mc(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Pi(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Pi(r))}},e(t.value,t)),t);return n}function mc(e,t){let n=new ja({check:`custom`,...W(t)});return n._zod.check=e,n}function hc(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??fs,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function gc(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,gc(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&yc(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function _c(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
94
-
95
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function vc(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:xc(t,`input`,e.processors),output:xc(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function yc(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return yc(r.element,n);if(r.type===`set`)return yc(r.valueType,n);if(r.type===`lazy`)return yc(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return yc(r.innerType,n);if(r.type===`intersection`)return yc(r.left,n)||yc(r.right,n);if(r.type===`record`||r.type===`map`)return yc(r.keyType,n)||yc(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:yc(r.in,n)||yc(r.out,n);if(r.type===`object`){for(let e in r.shape)if(yc(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(yc(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(yc(e,n))return!0;return!!(r.rest&&yc(r.rest,n))}return!1}var bc=(e,t={})=>n=>{let r=hc({...n,processors:t});return gc(e,r),_c(r,e),vc(r,e)},xc=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=hc({...i??{},target:a,io:t,processors:n});return gc(e,o),_c(o,e),vc(o,e)},Sc={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Cc=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Sc[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},wc=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Tc=(e,t,n,r)=>{n.type=`boolean`},Ec=(e,t,n,r)=>{n.not={}},Dc=(e,t,n,r)=>{let i=e._zod.def,a=ei(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Oc=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},kc=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Ac=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},jc=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=gc(a.element,t,{...r,path:[...r.path,`items`]})},Mc=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=gc(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=gc(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Nc=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>gc(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Pc=(e,t,n,r)=>{let i=e._zod.def,a=gc(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=gc(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Fc=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=gc(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=gc(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=gc(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Ic=(e,t,n,r)=>{let i=e._zod.def,a=gc(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Lc=(e,t,n,r)=>{let i=e._zod.def;gc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Rc=(e,t,n,r)=>{let i=e._zod.def;gc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},zc=(e,t,n,r)=>{let i=e._zod.def;gc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Bc=(e,t,n,r)=>{let i=e._zod.def;gc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Vc=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;gc(o,t,r);let s=t.seen.get(e);s.ref=o},Hc=(e,t,n,r)=>{let i=e._zod.def;gc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Uc=(e,t,n,r)=>{let i=e._zod.def;gc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Wc=U(`ZodISODateTime`,(e,t)=>{lo.init(e,t),_l.init(e,t)});function Gc(e){return Is(Wc,e)}var Kc=U(`ZodISODate`,(e,t)=>{uo.init(e,t),_l.init(e,t)});function qc(e){return Ls(Kc,e)}var Jc=U(`ZodISOTime`,(e,t)=>{fo.init(e,t),_l.init(e,t)});function Yc(e){return Rs(Jc,e)}var Xc=U(`ZodISODuration`,(e,t)=>{po.init(e,t),_l.init(e,t)});function Zc(e){return zs(Xc,e)}var Qc=U(`ZodError`,(e,t)=>{Ii.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>zi(e,t)},flatten:{value:t=>Ri(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ti,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ti,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),$c=Bi(Qc),el=Vi(Qc),tl=Hi(Qc),nl=Wi(Qc),rl=Ki(Qc),il=qi(Qc),al=Ji(Qc),ol=Yi(Qc),sl=Xi(Qc),cl=Zi(Qc),ll=Qi(Qc),ul=$i(Qc),dl=new WeakMap;function fl(e,t,n){let r=Object.getPrototypeOf(e),i=dl.get(r);if(i||(i=new Set,dl.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var pl=U(`ZodType`,(e,t)=>(Xa.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:xc(e,`input`),output:xc(e,`output`)}}),e.toJSONSchema=bc(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>$c(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>tl(e,t,n),e.parseAsync=async(t,n)=>el(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>nl(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>rl(e,t,n),e.decode=(t,n)=>il(e,t,n),e.encodeAsync=async(t,n)=>al(e,t,n),e.decodeAsync=async(t,n)=>ol(e,t,n),e.safeEncode=(t,n)=>sl(e,t,n),e.safeDecode=(t,n)=>cl(e,t,n),e.safeEncodeAsync=async(t,n)=>ll(e,t,n),e.safeDecodeAsync=async(t,n)=>ul(e,t,n),fl(e,`ZodType`,{check(...e){let t=this.def;return this.clone(li(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return yi(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Au(e,t))},superRefine(e,t){return this.check(ju(e,t))},overwrite(e){return this.check(ac(e))},optional(){return fu(this)},exactOptional(){return mu(this)},nullable(){return gu(this)},nullish(){return fu(gu(this))},nonoptional(e){return Su(this,e)},array(){return Jl(this)},or(e){return Ql([this,e])},and(e){return nu(this,e)},transform(e){return Eu(this,uu(e))},default(e){return vu(this,e)},prefault(e){return bu(this,e)},catch(e){return wu(this,e)},pipe(e){return Eu(this,e)},readonly(){return Ou(this)},describe(e){let t=this.clone();return fs.add(t,{description:e}),t},meta(...e){if(e.length===0)return fs.get(this);let t=this.clone();return fs.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,`description`,{get(){return fs.get(e)?.description},configurable:!0}),e)),ml=U(`_ZodString`,(e,t)=>{Za.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cc(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,fl(e,`_ZodString`,{regex(...e){return this.check($s(...e))},includes(...e){return this.check(nc(...e))},startsWith(...e){return this.check(rc(...e))},endsWith(...e){return this.check(ic(...e))},min(...e){return this.check(Zs(...e))},max(...e){return this.check(Xs(...e))},length(...e){return this.check(Qs(...e))},nonempty(...e){return this.check(Zs(1,...e))},lowercase(e){return this.check(ec(e))},uppercase(e){return this.check(tc(e))},trim(){return this.check(sc())},normalize(...e){return this.check(oc(...e))},toLowerCase(){return this.check(cc())},toUpperCase(){return this.check(lc())},slugify(){return this.check(uc())}})}),hl=U(`ZodString`,(e,t)=>{Za.init(e,t),ml.init(e,t),e.email=t=>e.check(ms(vl,t)),e.url=t=>e.check(bs(xl,t)),e.jwt=t=>e.check(Fs(Il,t)),e.emoji=t=>e.check(xs(Sl,t)),e.guid=t=>e.check(hs(yl,t)),e.uuid=t=>e.check(gs(bl,t)),e.uuidv4=t=>e.check(_s(bl,t)),e.uuidv6=t=>e.check(vs(bl,t)),e.uuidv7=t=>e.check(ys(bl,t)),e.nanoid=t=>e.check(Ss(Cl,t)),e.guid=t=>e.check(hs(yl,t)),e.cuid=t=>e.check(Cs(wl,t)),e.cuid2=t=>e.check(ws(Tl,t)),e.ulid=t=>e.check(Ts(El,t)),e.base64=t=>e.check(Ms(Nl,t)),e.base64url=t=>e.check(Ns(Pl,t)),e.xid=t=>e.check(Es(Dl,t)),e.ksuid=t=>e.check(Ds(Ol,t)),e.ipv4=t=>e.check(Os(kl,t)),e.ipv6=t=>e.check(ks(Al,t)),e.cidrv4=t=>e.check(As(jl,t)),e.cidrv6=t=>e.check(js(Ml,t)),e.e164=t=>e.check(Ps(Fl,t)),e.datetime=t=>e.check(Gc(t)),e.date=t=>e.check(qc(t)),e.time=t=>e.check(Yc(t)),e.duration=t=>e.check(Zc(t))});function gl(e){return ps(hl,e)}var _l=U(`ZodStringFormat`,(e,t)=>{Qa.init(e,t),ml.init(e,t)}),vl=U(`ZodEmail`,(e,t)=>{to.init(e,t),_l.init(e,t)}),yl=U(`ZodGUID`,(e,t)=>{$a.init(e,t),_l.init(e,t)}),bl=U(`ZodUUID`,(e,t)=>{eo.init(e,t),_l.init(e,t)}),xl=U(`ZodURL`,(e,t)=>{no.init(e,t),_l.init(e,t)}),Sl=U(`ZodEmoji`,(e,t)=>{ro.init(e,t),_l.init(e,t)}),Cl=U(`ZodNanoID`,(e,t)=>{io.init(e,t),_l.init(e,t)}),wl=U(`ZodCUID`,(e,t)=>{ao.init(e,t),_l.init(e,t)}),Tl=U(`ZodCUID2`,(e,t)=>{oo.init(e,t),_l.init(e,t)}),El=U(`ZodULID`,(e,t)=>{K.init(e,t),_l.init(e,t)}),Dl=U(`ZodXID`,(e,t)=>{so.init(e,t),_l.init(e,t)}),Ol=U(`ZodKSUID`,(e,t)=>{co.init(e,t),_l.init(e,t)}),kl=U(`ZodIPv4`,(e,t)=>{mo.init(e,t),_l.init(e,t)}),Al=U(`ZodIPv6`,(e,t)=>{ho.init(e,t),_l.init(e,t)}),jl=U(`ZodCIDRv4`,(e,t)=>{go.init(e,t),_l.init(e,t)}),Ml=U(`ZodCIDRv6`,(e,t)=>{_o.init(e,t),_l.init(e,t)}),Nl=U(`ZodBase64`,(e,t)=>{yo.init(e,t),_l.init(e,t)}),Pl=U(`ZodBase64URL`,(e,t)=>{xo.init(e,t),_l.init(e,t)}),Fl=U(`ZodE164`,(e,t)=>{So.init(e,t),_l.init(e,t)}),Il=U(`ZodJWT`,(e,t)=>{wo.init(e,t),_l.init(e,t)}),Ll=U(`ZodNumber`,(e,t)=>{To.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wc(e,t,n,r),fl(e,`ZodNumber`,{gt(e,t){return this.check(qs(e,t))},gte(e,t){return this.check(Js(e,t))},min(e,t){return this.check(Js(e,t))},lt(e,t){return this.check(Gs(e,t))},lte(e,t){return this.check(Ks(e,t))},max(e,t){return this.check(Ks(e,t))},int(e){return this.check(Bl(e))},safe(e){return this.check(Bl(e))},positive(e){return this.check(qs(0,e))},nonnegative(e){return this.check(Js(0,e))},negative(e){return this.check(Gs(0,e))},nonpositive(e){return this.check(Ks(0,e))},multipleOf(e,t){return this.check(Ys(e,t))},step(e,t){return this.check(Ys(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Rl(e){return Bs(Ll,e)}var zl=U(`ZodNumberFormat`,(e,t)=>{Eo.init(e,t),Ll.init(e,t)});function Bl(e){return Vs(zl,e)}var Vl=U(`ZodBoolean`,(e,t)=>{Do.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tc(e,t,n,r)});function Hl(e){return Hs(Vl,e)}var Ul=U(`ZodUnknown`,(e,t)=>{Oo.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Wl(){return Us(Ul)}var Gl=U(`ZodNever`,(e,t)=>{ko.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ec(e,t,n,r)});function Kl(e){return Ws(Gl,e)}var ql=U(`ZodArray`,(e,t)=>{jo.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jc(e,t,n,r),e.element=t.element,fl(e,`ZodArray`,{min(e,t){return this.check(Zs(e,t))},nonempty(e){return this.check(Zs(1,e))},max(e,t){return this.check(Xs(e,t))},length(e,t){return this.check(Qs(e,t))},unwrap(){return this.element}})});function Jl(e,t){return dc(ql,e,t)}var Yl=U(`ZodObject`,(e,t)=>{Io.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mc(e,t,n,r),si(e,`shape`,()=>t.shape),fl(e,`ZodObject`,{keyof(){return ou(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Wl()})},loose(){return this.clone({...this._zod.def,catchall:Wl()})},strict(){return this.clone({...this._zod.def,catchall:Kl()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return wi(this,e)},safeExtend(e){return Ti(this,e)},merge(e){return Ei(this,e)},pick(e){return Si(this,e)},omit(e){return Ci(this,e)},partial(...e){return Di(du,this,e[0])},required(...e){return Oi(xu,this,e[0])}})});function Xl(e,t){return new Yl({type:`object`,shape:e??{},...W(t)})}var Zl=U(`ZodUnion`,(e,t)=>{Ro.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nc(e,t,n,r),e.options=t.options});function Ql(e,t){return new Zl({type:`union`,options:e,...W(t)})}var $l=U(`ZodDiscriminatedUnion`,(e,t)=>{Zl.init(e,t),zo.init(e,t)});function eu(e,t,n){return new $l({type:`union`,options:t,discriminator:e,...W(n)})}var tu=U(`ZodIntersection`,(e,t)=>{Bo.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pc(e,t,n,r)});function nu(e,t){return new tu({type:`intersection`,left:e,right:t})}var ru=U(`ZodRecord`,(e,t)=>{Uo.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fc(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function iu(e,t,n){return!t||!t._zod?new ru({type:`record`,keyType:gl(),valueType:e,...W(t)}):new ru({type:`record`,keyType:e,valueType:t,...W(n)})}var au=U(`ZodEnum`,(e,t)=>{Wo.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dc(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new au({...t,checks:[],...W(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new au({...t,checks:[],...W(r),entries:i})}});function ou(e,t){return new au({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...W(t)})}var su=U(`ZodLiteral`,(e,t)=>{Go.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oc(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function cu(e,t){return new su({type:`literal`,values:Array.isArray(e)?e:[e],...W(t)})}var lu=U(`ZodTransform`,(e,t)=>{Ko.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ac(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Zr(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Pi(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Pi(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function uu(e){return new lu({type:`transform`,transform:e})}var du=U(`ZodOptional`,(e,t)=>{Jo.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fu(e){return new du({type:`optional`,innerType:e})}var pu=U(`ZodExactOptional`,(e,t)=>{Yo.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mu(e){return new pu({type:`optional`,innerType:e})}var hu=U(`ZodNullable`,(e,t)=>{Xo.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ic(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gu(e){return new hu({type:`nullable`,innerType:e})}var _u=U(`ZodDefault`,(e,t)=>{Zo.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function vu(e,t){return new _u({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():gi(t)}})}var yu=U(`ZodPrefault`,(e,t)=>{$o.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bu(e,t){return new yu({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():gi(t)}})}var xu=U(`ZodNonOptional`,(e,t)=>{es.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Su(e,t){return new xu({type:`nonoptional`,innerType:e,...W(t)})}var Cu=U(`ZodCatch`,(e,t)=>{ns.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function wu(e,t){return new Cu({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Tu=U(`ZodPipe`,(e,t)=>{rs.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vc(e,t,n,r),e.in=t.in,e.out=t.out});function Eu(e,t){return new Tu({type:`pipe`,in:e,out:t})}var Du=U(`ZodReadonly`,(e,t)=>{as.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ou(e){return new Du({type:`readonly`,innerType:e})}var ku=U(`ZodCustom`,(e,t)=>{ss.init(e,t),pl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kc(e,t,n,r)});function Au(e,t={}){return fc(ku,e,t)}function ju(e,t){return pc(e,t)}var Mu={Output:1,Replay:2,Input:3,Snapshot:4},Nu=e=>{let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t.byteLength<16)throw Error(`Terminal binary frame is too short`);let n=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:n.getUint8(0),type:n.getUint8(1),flags:n.getUint16(2),meta:n.getUint32(4),streamId:n.getUint32(8),payloadSize:n.getUint32(12)},i=t.subarray(16);if(i.byteLength!==r.payloadSize)throw Error(`Terminal binary frame payload length mismatch`);return{header:r,payload:i}},Pu=e=>{let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t.byteLength<16)throw Error(`Terminal output frame is too short`);let n=new DataView(t.buffer,t.byteOffset,t.byteLength),r=n.getUint8(0);if(r!==2)throw Error(`Expected output frame version 2, got ${r}`);let i=n.getUint16(2,!1),a=n.getUint32(4,!1),o=n.getUint32(8,!1),s=n.getUint32(12,!1);if(t.byteLength<16+i)throw Error(`Terminal output frame topic is truncated`);let c=new TextDecoder().decode(t.subarray(16,16+i)),l=t.subarray(16+i);if(l.byteLength!==s)throw Error(`Terminal output frame payload length mismatch`);return{topic:c,seq:a,streamId:o,payload:l}},Fu=Xl({kind:cu(`command`),id:gl().uuid(),op:gl(),args:Wl()}),Iu=Xl({kind:cu(`result`),id:gl().uuid(),ok:Hl(),data:Wl().optional(),error:Xl({code:gl(),message:gl(),details:Wl().optional()}).optional()}),Lu=Xl({kind:cu(`event`),topic:gl(),seq:Rl().int().nonnegative(),timestamp:Rl().int().positive(),data:Wl()});eu(`kind`,[Fu,Xl({kind:cu(`subscribe`),topics:Jl(gl())}),Xl({kind:cu(`unsubscribe`),topics:Jl(gl())}),Xl({kind:cu(`resync`),lastSeen:iu(gl(),Rl())})]),eu(`kind`,[Iu,Lu]);var Ru={connectionStatus:`connection.status`,connectionReady:`connection.ready`,workspaceMeta:e=>`workspace.${e}.meta`,workspaceFsDirty:e=>`workspace.${e}.fs.dirty`,workspaceGitState:e=>`workspace.${e}.git.state`,workspaceAll:e=>`workspace.${e}.*`,sessionState:(e,t)=>`workspace.${e}.session.${t}.state`,sessionLifecycle:(e,t)=>`workspace.${e}.session.${t}.lifecycle`,sessionProgress:(e,t)=>`workspace.${e}.session.${t}.progress`,sessionsAll:e=>`workspace.${e}.session.*`,terminalCreated:(e,t)=>`workspace.${e}.terminal.${t}.created`,terminalOutput:(e,t)=>`workspace.${e}.terminal.${t}.output`,terminalExit:(e,t)=>`workspace.${e}.terminal.${t}.exit`,terminalsAll:e=>`workspace.${e}.terminal.*`,notificationToast:`notification.toast`,supervisorState:(e,t)=>`workspace.${e}.session.${t}.supervisor.state`,supervisorCycle:(e,t)=>`workspace.${e}.session.${t}.supervisor.cycle`};function zu(e,t){if(e===t||e===`*`)return!0;let n=e.split(`.`),r=t.split(`.`);for(let e=0;e<n.length;e++){let t=n[e];if(t===`*`){if(e===n.length-1)return!0;continue}if(e>=r.length||t!==r[e])return!1}return n.length<=r.length}var Bu=class extends Error{constructor(e){super(e.message),this.name=`CommandResultError`,this.code=e.code,this.details=e.details}},Vu={maxAttempts:30,baseDelayMs:1e3,maxDelayMs:3e4},Hu=3e4,Uu=()=>{if(typeof globalThis.crypto?.randomUUID==`function`)return globalThis.crypto.randomUUID();let e=new Uint8Array(16);globalThis.crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20)].join(`-`)},Wu=class{constructor(e,t={}){this.ws=null,this.connectDeferred=null,this.pendingCommands=new Map,this.eventListeners=new Map,this.statusListeners=new Set,this.lastSeenSeq=new Map,this.pendingBinaryStreamIds=new Map,this.orphanBinaryPayloads=new Map,this.nextTerminalInputStreamId=1,this.reconnectAttempts=0,this.reconnectTimer=null,this.isManualClose=!1,this.status=`disconnected`,this.url=e,this.reconnectConfig={...Vu,...t}}async connect(){if(this.ws?.readyState===WebSocket.OPEN&&this.status===`connected`)return Promise.resolve();if(this.connectDeferred)return this.connectDeferred.promise;this.isManualClose=!1,this.setStatus(`connecting`);let e,t,n=new Promise((n,r)=>{e=n,t=r});this.connectDeferred={promise:n,resolve:e,reject:t};try{let e=new WebSocket(this.url);this.ws=e,e.binaryType=`arraybuffer`,e.onopen=()=>{if(this.ws!==e)return;this.setStatus(`connected`),this.reconnectAttempts=0;let t=Array.from(this.eventListeners.keys());if(t.length>0){let n={kind:`subscribe`,topics:t};e.send(JSON.stringify(n))}this.lastSeenSeq.size>0&&this.resync(),this.resolveConnectDeferred()},e.onmessage=t=>{if(this.ws===e)try{if(typeof t.data==`string`){let e=JSON.parse(t.data);this.handleMessage(e);return}if(t.data instanceof ArrayBuffer){this.handleBinaryMessage(new Uint8Array(t.data));return}console.error(`Unsupported WebSocket message type:`,typeof t.data)}catch(e){console.error(`Failed to parse WebSocket message:`,e)}},e.onclose=t=>{this.ws===e&&(this.handleClose(t.code,t.reason),this.rejectConnectDeferred(Error(`WebSocket closed: ${t.reason||t.code}`)))},e.onerror=t=>{this.ws===e&&console.error(`WebSocket error:`,t)}}catch(e){this.rejectConnectDeferred(e instanceof Error?e:Error(String(e)))}return n}disconnect(e){this.isManualClose=!0,this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null),this.rejectConnectDeferred(Error(`WebSocket disconnected`)),this.rejectPendingCommands(Error(`WebSocket disconnected`)),this.clearBinaryCommandState(),this.ws&&=(this.ws.close(1e3,e||`client_disconnect`),null),this.setStatus(`disconnected`)}recoverConnection(e=`manual_retry`){let t=this.getStatus();t===`connected`||t===`connecting`||t===`rejected`||(this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null),this.reconnectAttempts=0,console.log(`[WsClient] Recovering connection after ${e}`),this.connect().catch(e=>{console.error(`Recovery connect failed:`,e)}))}async sendCommand(e,t,n={}){return new Promise((r,i)=>{if(!this.ws||this.ws.readyState!==WebSocket.OPEN){i(Error(`WebSocket not connected`));return}let a=Uu(),o=n.timeoutMs??Hu,s=setTimeout(()=>{this.cleanupTimedOutBinaryCommand(a),this.pendingCommands.delete(a),i(Error(`Command timeout: ${e}`))},o);this.pendingCommands.set(a,{resolve:r,reject:i,timeoutId:s});let c={kind:`command`,id:a,op:e,args:t};this.ws.send(JSON.stringify(c))})}async sendTerminalInput(e,t,n,r){return new Promise((i,a)=>{if(!this.ws||this.ws.readyState!==WebSocket.OPEN){a(Error(`WebSocket not connected`));return}let o=Uu(),s=this.allocateTerminalInputStreamId(),c=setTimeout(()=>{this.cleanupTimedOutBinaryCommand(o),this.pendingCommands.delete(o),a(Error(`Command timeout: terminal.input`))},Hu);this.pendingCommands.set(o,{resolve:i,reject:a,timeoutId:c});let l={kind:`command`,id:o,op:`terminal.input`,args:{terminalId:e,transport:`binary`,streamId:s,size:t.byteLength,activity:n,submittedText:r}};this.ws.send(JSON.stringify(l)),this.ws.send(t)})}subscribe(e,t){let n=[];for(let r of e)this.eventListeners.has(r)||(this.eventListeners.set(r,new Set),n.push(r)),this.eventListeners.get(r).add(t);if(n.length>0&&this.ws&&this.ws.readyState===WebSocket.OPEN){let e={kind:`subscribe`,topics:n};this.ws.send(JSON.stringify(e))}return()=>{let n=[];for(let r of e){let e=this.eventListeners.get(r);e&&(e.delete(t),e.size===0&&(this.eventListeners.delete(r),n.push(r)))}if(n.length>0&&this.ws&&this.ws.readyState===WebSocket.OPEN){let e={kind:`unsubscribe`,topics:n};this.ws.send(JSON.stringify(e))}}}onStatus(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}getStatus(){return this.status}handleMessage(e){if(e.kind===`result`){let t=this.pendingCommands.get(e.id);if(t){if(e.ok&&this.isTerminalBinaryCommandResult(e.data)){let n=this.getExpectedFrameType(e.data),r=this.orphanBinaryPayloads.get(e.data.streamId);if(r){if(this.orphanBinaryPayloads.delete(e.data.streamId),clearTimeout(r.timeoutId),r.frameType===n){clearTimeout(t.timeoutId),this.pendingCommands.delete(e.id),t.resolve({...e.data,bytes:r.bytes});return}console.warn(`Discarding terminal binary frame with unexpected type`,{streamId:e.data.streamId,expectedFrameType:n,actualFrameType:r.frameType})}t.terminalBinary=e.data,t.binaryStreamId=e.data.streamId,this.pendingBinaryStreamIds.set(e.data.streamId,{commandId:e.id,expectedFrameType:n});return}clearTimeout(t.timeoutId),this.pendingCommands.delete(e.id),e.ok?t.resolve(e.data):t.reject(new Bu({code:e.error?.code??`command_failed`,message:e.error?.message??`Command failed`,details:e.error?.details}))}}else e.kind===`event`&&(this.lastSeenSeq.set(e.topic,e.seq),this.notifyEventListeners(e.topic,e.data,e.seq))}handleBinaryMessage(e){if(e.length===0)return;if(e[0]===2){let t=Pu(e);this.notifyEventListeners(t.topic,{transport:`binary`,streamId:t.streamId,size:t.payload.byteLength,bytes:t.payload},t.seq);return}let{header:t,payload:n}=Nu(e),r=this.pendingBinaryStreamIds.get(t.streamId);if(!r){let e=this.orphanBinaryPayloads.get(t.streamId);e&&clearTimeout(e.timeoutId),this.orphanBinaryPayloads.set(t.streamId,{frameType:t.type,bytes:n,timeoutId:setTimeout(()=>{this.orphanBinaryPayloads.delete(t.streamId)},Hu)});return}if(t.type!==r.expectedFrameType){console.warn(`Discarding terminal binary frame with unexpected type`,{streamId:t.streamId,expectedFrameType:r.expectedFrameType,actualFrameType:t.type});return}this.pendingBinaryStreamIds.delete(t.streamId);let i=this.pendingCommands.get(r.commandId);i?.terminalBinary&&(clearTimeout(i.timeoutId),this.pendingCommands.delete(r.commandId),i.resolve({...i.terminalBinary,bytes:n}))}notifyEventListeners(e,t,n){for(let[r,i]of this.eventListeners.entries())if(zu(r,e))for(let r of i)try{r(e,t,n)}catch(t){console.error(`Error in event listener for ${e}:`,t)}}isTerminalBinaryCommandResult(e){return typeof e==`object`&&!!e&&`status`in e&&`transport`in e&&`streamId`in e&&`size`in e&&e.status===`ok`&&e.transport===`binary`}getExpectedFrameType(e){return`source`in e?Mu.Snapshot:Mu.Replay}cleanupTimedOutBinaryCommand(e){let t=this.pendingCommands.get(e)?.binaryStreamId;if(t==null)return;this.pendingBinaryStreamIds.delete(t);let n=this.orphanBinaryPayloads.get(t);n&&(clearTimeout(n.timeoutId),this.orphanBinaryPayloads.delete(t))}clearBinaryCommandState(){this.pendingBinaryStreamIds.clear();for(let e of this.orphanBinaryPayloads.values())clearTimeout(e.timeoutId);this.orphanBinaryPayloads.clear()}resolveConnectDeferred(){let e=this.connectDeferred;e&&(this.connectDeferred=null,e.resolve())}rejectConnectDeferred(e){let t=this.connectDeferred;t&&(this.connectDeferred=null,t.reject(e))}rejectPendingCommands(e){for(let[t,n]of this.pendingCommands)clearTimeout(n.timeoutId),n.reject(e),this.pendingCommands.delete(t)}allocateTerminalInputStreamId(){let e=this.nextTerminalInputStreamId;return this.nextTerminalInputStreamId+=1,e}handleClose(e,t){if(this.ws=null,this.rejectPendingCommands(Error(`WebSocket disconnected`)),this.clearBinaryCommandState(),e===4001||e===4002){this.setStatus(`rejected`);return}this.isManualClose||this.scheduleReconnect()}scheduleReconnect(){if(this.reconnectAttempts>=this.reconnectConfig.maxAttempts){console.error(`Max reconnect attempts reached`),this.setStatus(`disconnected`);return}this.setStatus(`reconnecting`);let e=Math.min(this.reconnectConfig.baseDelayMs*2**this.reconnectAttempts,this.reconnectConfig.maxDelayMs);this.reconnectAttempts++,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect().catch(e=>{console.error(`Reconnect failed:`,e)})},e)}resync(){if(!this.ws||this.ws.readyState!==WebSocket.OPEN||this.lastSeenSeq.size===0)return;let e={kind:`resync`,lastSeen:Object.fromEntries(this.lastSeenSeq)};this.ws.send(JSON.stringify(e))}setStatus(e){this.status=e;for(let t of this.statusListeners)try{t(e)}catch(e){console.error(`Error in status listener:`,e)}}};function Gu(){return typeof window>`u`?`ws://127.0.0.1:4173/ws`:`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}/ws`}var Ku=z(null),qu=z(`connecting`),Ju=z(null),Yu=z(!1),Xu=z(null),Zu=z(0),Qu=z(null),$u=z(null),ed=z(e=>{let t=e(Ku);return async(e,n,r)=>{if(!t)return{ok:!1,error:{code:`no_client`,message:`WebSocket client not initialized`}};try{return{ok:!0,data:await t.sendCommand(e,n,r)}}catch(e){return e instanceof Bu?{ok:!1,error:{code:e.code,message:e.message,details:e.details}}:{ok:!1,error:{code:`command_error`,message:e instanceof Error?e.message:`Unknown error`}}}}});z(`tab_${Date.now()}_${Math.random().toString(36).substring(2,9)}`);var td=z(new Map);z(e=>t=>e(td).get(t)?.isController??!1),z(e=>t=>e(td).get(t)?.reason),z(e=>{let t=e(td);for(let e of t.values())if(!e.isController)return!0;return!1});function nd(e,t){let n=null,r=new Map,i=new Set;function a(i){let s;if(t===void 0)s=r.get(i);else for(let[e,n]of r)if(t(e,i)){s=n;break}if(s!==void 0)if(n?.(s[1],i))a.remove(i);else return s[0];let c=e(i);return r.set(i,[c,Date.now()]),o(`CREATE`,i,c),c}function o(e,t,n){for(let r of i)r({type:e,param:t,atom:n})}return a.unstable_listen=e=>(i.add(e),()=>{i.delete(e)}),a.getParams=()=>r.keys(),a.remove=e=>{if(t===void 0){if(!r.has(e))return;let[t]=r.get(e);r.delete(e),o(`REMOVE`,e,t)}else for(let[n,[i]]of r)if(t(n,e)){r.delete(n),o(`REMOVE`,n,i);break}},a.setShouldRemove=e=>{if(n=e,n)for(let[e,[t,i]]of r)n(i,e)&&(r.delete(e),o(`REMOVE`,e,t))},a}var rd=z(null),id=z({}),ad=z([]),od=z(`idle`),sd=z(null),cd=nd(e=>z(t=>t(id)[e])),ld=z(e=>{let t=e(ad),n=e(id),r=new Set(Object.keys(n)),i=t.filter(e=>r.has(e)),a=new Set(i),o=Object.keys(n).filter(e=>!a.has(e));return[...i,...o]}),ud=z(e=>e(ld).map(t=>e(cd(t))).filter(e=>!!e)),dd=z(e=>{if(e(od)!==`ready`)return null;let t=e(rd),n=e(id);return t&&n[t]?t:e(ld)[0]??null}),fd=z(e=>{let t=e(dd);return t?e(cd(t)):null}),pd=z({}),md=nd(e=>z(t=>{let n=t(pd);return Object.values(n).filter(t=>t.workspaceId===e)})),hd=nd(e=>z(t=>t(pd)[e]));z(e=>{let t=e(dd);return t?e(md(t)).find(e=>e.state===`running`||e.state===`idle`)??null:null}),nd(e=>z(t=>{let n=t(md(e)),r={draft:0,starting:0,running:0,idle:0,ended:0};for(let e of n)r[e.state]++;return r}));function gd(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=gd(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function q(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=gd(e))&&(r&&(r+=` `),r+=t);return r}function _d(e){return e.target===e.currentTarget}function vd(e){return e.key===`Escape`}var yd=[`a[href]`,`area[href]`,`button:not([disabled]):not([tabindex="-1"])`,`input:not([disabled]):not([type="hidden"]):not([tabindex="-1"])`,`select:not([disabled]):not([tabindex="-1"])`,`textarea:not([disabled]):not([tabindex="-1"])`,`iframe:not([tabindex="-1"])`,`object:not([tabindex="-1"])`,`embed:not([tabindex="-1"])`,`[contenteditable="true"]`,`[tabindex]:not([tabindex="-1"])`].join(`, `);function bd(e){return e instanceof HTMLElement}function xd(e){return Array.from(e.querySelectorAll(yd)).filter(e=>!e.hidden&&e.getAttribute(`aria-hidden`)!==`true`)}function Sd(e,t){let n=typeof t==`function`?t():t;return n&&e.contains(n)&&!n.hasAttribute(`disabled`)?n:xd(e)[0]??e}function Cd(e,t){if(t.key!==`Tab`)return;let n=xd(e);if(n.length===0){t.preventDefault(),e.focus();return}let r=n[0],i=n[n.length-1],a=bd(document.activeElement)?document.activeElement:null;if(t.shiftKey){(!a||a===r||!e.contains(a))&&(t.preventDefault(),i.focus());return}(!a||a===i||!e.contains(a))&&(t.preventDefault(),r.focus())}function J(e){e instanceof HTMLElement&&e.isConnected&&e.focus()}var wd=e(Ee(),1);function Td({children:e}){let t=typeof document>`u`?null:document.body;return t?(0,wd.createPortal)(e,t):null}var Ed=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Dd=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Od=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),kd=e=>{let t=Od(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ad={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},jd=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Md=(0,B.createContext)({}),Nd=()=>(0,B.useContext)(Md),Pd=(0,B.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Nd()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,B.createElement)(`svg`,{ref:c,...Ad,width:t??l??Ad.width,height:t??l??Ad.height,stroke:e??f,strokeWidth:m,className:Ed(`lucide`,p,i),...!a&&!jd(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,B.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Y=(e,t)=>{let n=(0,B.forwardRef)(({className:n,...r},i)=>(0,B.createElement)(Pd,{ref:i,iconNode:t,className:Ed(`lucide-${Dd(kd(e))}`,`lucide-${e}`,n),...r}));return n.displayName=kd(e),n},Fd=Y(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),Id=Y(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Ld=Y(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Rd=Y(`arrow-up-from-line`,[[`path`,{d:`m18 9-6-6-6 6`,key:`kcunyi`}],[`path`,{d:`M12 3v14`,key:`7cf3v8`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),zd=Y(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Bd=Y(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Vd=Y(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Hd=Y(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ud=Y(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Wd=Y(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Gd=Y(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),Kd=Y(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),qd=Y(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),Jd=Y(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Yd=Y(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Xd=Y(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Zd=Y(`diff`,[[`path`,{d:`M12 3v14`,key:`7cf3v8`}],[`path`,{d:`M5 10h14`,key:`elsbfy`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),Qd=Y(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),$d=Y(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ef=Y(`file-braces-corner`,[[`path`,{d:`M14 22h4a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v6`,key:`14cnrg`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M5 14a1 1 0 0 0-1 1v2a1 1 0 0 1-1 1 1 1 0 0 1 1 1v2a1 1 0 0 0 1 1`,key:`sr0ebq`}],[`path`,{d:`M9 22a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-2a1 1 0 0 0-1-1`,key:`w793db`}]]),tf=Y(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),nf=Y(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),rf=Y(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),af=Y(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),of=Y(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),sf=Y(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),cf=Y(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),lf=Y(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),uf=Y(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),df=Y(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),ff=Y(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),pf=Y(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),mf=Y(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),hf=Y(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),gf=Y(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),_f=Y(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),vf=Y(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),yf=Y(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),bf=Y(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),xf=Y(`panel-bottom`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]),Sf=Y(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Cf=Y(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),wf=Y(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Tf=Y(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Ef=Y(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Df=Y(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Of=Y(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),kf=Y(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Af=Y(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),jf=Y(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Mf=Y(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Nf=Y(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Pf=Y(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Ff=Y(`square-centerline-dashed-vertical`,[[`path`,{d:`M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3`,key:`14bfxa`}],[`path`,{d:`M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3`,key:`14rx03`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}]]),If=Y(`square-centerline-dashed-horizontal`,[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3`,key:`1i73f7`}],[`path`,{d:`M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3`,key:`saxlbk`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 14v2`,key:`8jcxud`}],[`path`,{d:`M12 8v2`,key:`1woqiv`}],[`path`,{d:`M12 2v2`,key:`tus03m`}]]),Lf=Y(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),Rf=Y(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),zf=Y(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Bf=Y(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Vf=Y(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Hf=Y(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Uf=Y(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Wf={app:{name:`Coder Studio`,description:`Agent-First Development Environment`},common:{loading:`Loading...`,error:`Error`,success:`Success`,warning:`Warning`,info:`Info`,confirm:`Confirm`,cancel:`Cancel`,save:`Save`,delete:`Delete`,edit:`Edit`,view:`View`,close:`Close`,yes:`Yes`,no:`No`,ok:`OK`,all:`All`},action:{open:`Open`,open_workspace:`Open Workspace`,close_workspace:`Close Workspace`,create_session:`Create Session`,stop_session:`Stop Session`,resume_session:`Resume Session`,save_file:`Save File`,save_all:`Save All`,save:`Save`,discard_changes:`Discard Changes`,commit:`Commit`,push:`Push`,pull:`Pull`,refresh:`Refresh`,settings:`Settings`,cancel:`Cancel`,confirm:`Confirm`,close:`Close`,apply:`Apply`,reset:`Reset`,search:`Search`,search_files:`Search Files`,search_commands:`Search Commands`,back:`Back`},label:{workspace:`Workspace`,agent:`Agent`,session:`Session`,terminal:`Terminal`,file:`File`,git:`Git`,settings:`Settings`,provider:`Provider`,status:`Status`,progress:`Progress`},provider:{install:{cta:{start:`Start Session`,install_and_start:`Install & Start`,installing:`Installing...`,manual:`View Install Steps`},status:{installing:`Installing provider CLI...`,failed:`Automatic install failed`},open_docs:`Open official docs`,nodejs:{manual:`Install Node.js from the official download page.`},claude:{manual:`Then run npm install -g @anthropic-ai/claude-code.`},codex:{manual:`Then run npm install -g @openai/codex.`}}},status:{starting:`Starting`,running:`Running`,idle:`Idle`,busy:`Busy`,ended:`Ended`,unavailable:`Unavailable`,connecting:`Connecting`,connected:`Connected`,disconnected:`Disconnected`,reconnecting:`Reconnecting`,rejected:`Rejected`},workspace:{title:`Workspace`,tabs:`Workspace tabs`,open:`Open`,close:`Close`,path:`Path`,no_workspace:`No workspace open`,fullscreen:{unsupported_title:`Fullscreen unavailable`,unsupported_body:`Fullscreen is not available in this browser.`,enter_failed_title:`Could not enter fullscreen`,enter_failed_body:`The browser denied the fullscreen request.`,exit_failed_title:`Could not exit fullscreen`,exit_failed_body:`The browser could not exit fullscreen right now.`},open_hint:`Click the button below to open a project directory`,loading_title:`Loading workspaces`,loading_description:`Preparing your workspace list and restoring the last active session.`,load_failed_title:`Failed to load workspaces`,load_failed_description:`Failed to fetch workspace list`,launch:{kicker:`START WORKSPACE`,title:`Open Workspace`,home_directory:`Home Directory`,go_up:`Go Up`,no_directories:`No directories found`,items_count:`{count} items`,enter_folder:`Enter {name}`,enter_folder_action:`Enter folder →`,cancel:`Cancel`,start:`Start Workspace`,starting:`Starting...`,hint:`Select a directory to use as the workspace root.`,browse_failed:`Failed to browse directories`,select_required:`Please select a directory`,open_failed:`Failed to open workspace`},runtime_check:{title:`Runtime Check`,checking:`Checking runtime environment...`,success:`Runtime environment check passed`,failed:`Runtime environment check failed`,missing_git:`Git command not found`,missing_node:`Node.js not found`,missing_provider:`{provider} CLI not found`}},mobile:{dock:{aria_label:`Mobile dock`,open_agent:`Open Agent sheet`,open_files:`Open Files sheet`,open_terminal:`Open Terminal sheet`},agent:{title:`Agent Sessions`,close_current_session:`Close Current Session`,providers:`Session providers`,start_session:`Start {provider} session`,starting:`Starting...`,start_new_session:`Start new session`,active_agents:`Active agents`,switch_to_agent:`Switch to agent {name}`,empty:`No active sessions`},supervisor:{open_sheet:`Open Supervisor sheet`},topbar:{switch_workspace:`Switch workspace`,open_settings:`Open settings`,open_more_actions:`Open more actions`,more_actions:`More Actions`},sheet:{dismiss:`Dismiss current sheet`,region:`{title} sheet`},files:{tabs:`Files sheet tabs`,git_diff:`Git`,editor_fallback:`Editor`},workspace_drawer:{aria_label:`Workspace drawer`,close:`Close workspace drawer`,select_title:`Select workspace`,switch_to_workspace:`Switch to workspace {name}`,close_workspace:`Close workspace {name}`},empty:{start_session:`Start a new agent session for this workspace.`,files_terminal_hint:`Files and Terminal stay available from the bottom bar.`}},session:{title:`Session`,create:`Create Session`,stop:`Stop`,resume:`Resume`,no_session:`No active session`,provider_select:`Select Provider`,state:{starting:`Starting...`,running:`Running`,idle:`Waiting for input`,busy:`Executing`,ended:`Stopped`,unavailable:`Unavailable`},resume_unavailable:`This session cannot be resumed`,progress:{thinking:`Thinking...`,executing:`Executing...`,waiting:`Waiting for response...`}},terminal:{title:`Terminal`,kicker:`TERMINAL`,new_terminal:`New Terminal`,close_terminal:`Close Terminal`,shell:`Shell Terminal`,agent:`Agent Terminal`,reconnect_hint:`Connection lost, reconnecting...`,no_terminal:`No terminals`,empty_hint:`Launch a shell to inspect files, run commands, and verify changes without leaving the workspace.`,load_failed_title:`Could not load terminals`,load_failed_body:`Refresh the workspace connection and try again.`,create_failed_title:`Could not create terminal`,create_failed_body:`The shell process could not be started. Check the server runtime and shell configuration.`,create_unavailable_title:`No workspace selected`,create_unavailable_body:`Open or switch to a workspace before creating a terminal.`,hide:`Hide Terminal`,show:`Show Terminal`,selector:{switch:`Switch terminal`,title:`Terminal Sessions`,current:`Current terminal`,indexed:`Terminal {index}`},mobile_input:{shortcuts:`Terminal shortcut keys`,ctrl:`Ctrl`,ctrl_armed:`Ctrl armed`,ctrl_locked:`Ctrl locked`,shift:`Shift`,shift_armed:`Shift armed`,escape:`Escape`,tab:`Tab`,enter:`Enter`,up:`Up arrow`,down:`Down arrow`,left:`Left arrow`,right:`Right arrow`},replay:{queued_title:`Waiting in queue ({count} ahead)`,up_next:`Up next...`,loading_title:`Restoring terminal output...`,loading_body:`This terminal is unavailable while history is being restored. Please wait until recovery finishes before continuing. Larger histories may take longer to restore.`,failed_title:`Terminal history could not be restored`,failed_body:`New output will keep streaming. Refresh manually only if you need the missing history.`,closed_title:`This session has been closed`,closed_body:`Start a new session to continue.`,truncated_title:`Terminal history is partial`,truncated_body:`Older output has already fallen out of the replay buffer, but new output will continue to stream.`}},file:{title:`Files`,modified:`Modified`,unsaved:`Unsaved`,dirty:`Has unsaved changes`,visible_count:`{count} files`,empty_directory:`Empty directory`,new_file:`New File`,new_folder:`New Folder`,collapse_all:`Collapse All`,rename:`Rename`,delete:`Delete`,delete_confirm:`Are you sure you want to delete "{name}"?`,path:`Path`,path_required:`Enter a path`,invalid_file_path:`File paths cannot end with /`,path_helper_file:`Enter a workspace-relative path, for example src/demo/new-file.ts`,path_helper_folder:`Enter a workspace-relative path, for example src/demo/new-folder`,create_failed:`Failed to create item`,delete_failed:`Failed to delete file`,conflict:`File has been modified externally`,conflict_message:`The file may have been modified outside the editor. Discard local changes and reload?`},code_editor:{saving:`Saving...`,edit_as_text:`Edit as text`,preview_as_image:`Preview as image`,mode_text:`Text`,mode_image:`Image`,open_failed_title:`Failed to open file`,empty_hint:`Select a file on the left to open it in the editor.`,modified_on_disk:`This file changed on disk after you opened it. Save carefully or reload the file.`,deleted_on_disk:`This file was deleted on disk after you opened it.`},git:{title:`Git`,changes:`Changes`,staged:`Staged`,modified:`Modified`,deleted:`Deleted`,unstaged:`Unstaged`,untracked:`Untracked`,no_changes:`No changes`,commit:`Commit`,commit_message:`Commit Message`,commit_placeholder:`Enter commit message...`,commit_summary_placeholder:`Enter commit message...`,commit_staged_count:`{count} staged`,nothing_staged:`Nothing staged`,latest_commit:`Latest Commit`,history:`History`,show_all_history:`Show all history`,change_count:`{count} changes`,no_commits:`No commits yet`,stage:`Stage`,unstage:`Unstage`,stage_all:`Stage All`,unstage_all:`Unstage All`,stage_failed_title:`Stage failed`,unstage_failed_title:`Unstage failed`,discard:`Discard`,discard_all:`Discard All`,discard_failed_title:`Discard failed`,discard_file_confirm_title:`Discard File Changes`,discard_file_confirm_message:`Are you sure you want to discard changes in "{path}"?`,discard_all_confirm_title:`Discard All Changes`,discard_all_confirm_message:`Are you sure you want to discard changes in {count} files?`,discard_confirm_irreversible:`This action cannot be undone.`,commit_failed_title:`Commit failed`,branch:`Branch`,switch_branch:`Switch Branch`,current_branch:`Current Branch`,no_branch:`Not on any branch`,ahead:`{count} commits ahead`,behind:`{count} commits behind`,synced:`Synced with remote`,push_confirm_title:`Push Changes`,push_confirm_message:`Do you want to push {count} local commits to the remote?`,pull_confirm_title:`Pull Changes`,pull_confirm_message:`Do you want to pull {count} remote commits into your local branch?`,sync_confirm_helper:`This action updates your current branch and workspace state.`,push_success_title:`Push completed`,push_success_body:`Local commits were pushed to the remote.`,push_success_target:`Pushed to {target}`,pull_success_title:`Pull completed`,pull_success_body:`Latest remote commits were pulled into your local branch.`,pull_success_target:`Pulled updates from {target}`,sync_up_to_date:`{target} is already up to date`,push_in_progress:`Pushing...`,pull_in_progress:`Pulling...`,push_failed_title:`Push failed`,pull_failed_title:`Pull failed`,fetch_success_title:`Fetched from remote`,fetch_success_body:`Remote tracking branches are up to date.`,fetch_failed_title:`Fetch failed`,fetch_refresh_failed_body:`Fetched from remote, but refreshing local git state failed.`,fetch_in_progress:`Fetching...`,fetch_label:`Fetch`,fetch_last_at:`Last fetched {when}`,fetch_last_never:`Never fetched`,operation_push:`push`,operation_pull:`pull`,operation_fetch:`fetch`,auth_required_message:`Authentication is required for {remote}.`,auth_failed_invalid:`Credentials for {remote} were rejected. Enter a valid username and password or personal access token to continue.`,auth_failed_forbidden:`Credentials for {remote} were accepted, but this account is not allowed to {operation}.`,auth_failed_unsupported:`Authentication failed for {remote}. Configure SSH keys or a credential helper, then try again.`,auth_helper_http:`Enter your Git username and password or a personal access token to retry this operation.`,auth_helper_unsupported:`This remote does not support in-app authentication. Configure SSH keys or a credential helper, then try again.`,auth_username:`Username`,auth_password:`Password or token`,auth_username_placeholder:`Git username`,auth_password_placeholder:`Password or personal access token`,branch_remote:`Remote`,quick_pick:{search_placeholder:`Search branches or create new branch...`,loading:`Loading branches...`,empty_filtered:`No branches found`,empty_idle:`Type to search branches`,create:`Create branch: {name}`,confirm_create:`Confirm create branch: {name}`},statusbar:{changes:`Uncommitted file changes`,ahead:`Local commits to push`,behind:`Remote commits to pull`}},worktree:{title:`Worktree`,status_tab:`Status`,diff_tab:`Diff`,tree_tab:`Tree`,path:`Path`,branch:`Branch`,changes:`Changes`,loading:`Loading...`,empty_tree:`Empty tree`,clean:`Clean`,dirty:`Dirty`,dirty_status:`Has changes`,staged_count:`Staged: {count}`,modified_count:`Modified: {count}`,untracked_count:`Untracked: {count}`,list_title:`Worktrees`,list_empty:`No worktrees`,list_open_label:`Open worktree list`,list_error:`Failed to load: {error}`,manage:`Manage`,new:`New`,current:`Current`,summary_total:`{count} worktrees`,summary_dirty:`{count} dirty`,summary_current:`Current: {name}`,summary_no_current:`Current: unavailable`,create_title:`Create Worktree`,create_submit:`Create`,create_path_hint:`Path must be absolute. The suggested path is derived from the current workspace path.`,create_path_absolute_required:`Path must be an absolute path.`,create_failed_title:`Failed to create worktree`,create_success_title:`Worktree created`,create_success_body:`{name} is ready.`,remove_confirm:`Remove worktree?`,remove_force_confirm:`Force remove dirty worktree?`,remove_failed_title:`Failed to remove worktree`,remove_success_title:`Worktree removed`,remove_success_body:`Worktree removed.`,force_remove:`Force Remove`,remove_row_label:`Remove {name}`,selection_removed:`The selected worktree is no longer available.`},settings:{title:`Settings`,general:`General`,appearance:`Appearance`,providers:`Providers`,autosave_hint:`Settings saved automatically`,load_failed:`Failed to load settings`,load_failed_unknown:`Server did not return settings data`,notifications:`Notifications`,notifications_channel_hint:`No notification while you are in the originating workspace; an in-app banner if you are in another workspace; a system notification when the window is hidden.`,notifications_enabled:`Enable completion notifications`,notifications_enabled_hint:`Send notification when Agent session completes`,notification_sound:`Notification sound`,notification_sound_hint:`Play a completion chime when a notification fires`,notification_status:`Notification Status`,notification_status_available:`Available`,notification_status_limited:`Limited`,notification_status_limited_hint:`System notifications on this mobile browser are inconsistent; browser permission does not guarantee delivery.`,notification_status_unsupported:`Unsupported`,notification_status_unsupported_hint:`This browser environment does not support this notification path.`,notification_permission:`Notification Permission`,permission_granted:`Granted`,permission_denied:`Denied`,permission_request:`Request Permission`,permission_unavailable:`Unavailable`,permission_limited_hint:`Even with notification permission allowed, this mobile browser may still fail to show system notifications reliably.`,supervisor:{title:`Supervisor`,hint:`Maximum time the supervisor evaluator can run before the server aborts it.`,evaluation_timeout:`Supervisor Evaluation Timeout (seconds)`,validation_error:`Enter a whole number between 1 and {max} seconds.`},terminal_renderer:`Terminal Renderer`,terminal_renderer_hint:`Choose terminal rendering mode`,terminal_standard:`Standard`,terminal_compatibility:`Compatibility Mode`,provider:{title:`Provider Settings`,status:`Status`,capability:`Capability Level`,capability_full:`Full Support`,capability_limited:`Limited Support`,capability_unsupported:`Unsupported`,hooks_registered:`Hooks Registered`,hooks_unregistered:`Hooks Not Registered`,hooks_error:`Hooks Registration Failed`,hooks:`Hooks Integration`,hooks_hint:`Inject Provider-specific hooks into current workspace`,hooks_inject:`Inject Hooks`,configure:`Configure`,reset:`Reset`,config:`Configuration`,base:`Base Settings`,config_file:`Config File`,open_config_file_editor:`Open Config File Editor`,back_to_base:`Back to Base Settings`,startup_args:`Startup Command Args`,startup_args_hint:`Enter one startup argument per line. Each saved line is appended to the provider launch command.`,startup_args_placeholder:`--verbose
96
- --debug`},theme:{title:`Theme`,dark:`Dark`,light:`Light`,system:`System`,hint:`Choose app theme`},language:{title:`Language`,zh:`中文`,en:`English`,hint:`Select interface language`},auth:{title:`Authentication`,password:`Password`,password_set:`Set Password`,password_change:`Change Password`,password_remove:`Remove Password`},shortcuts:{title:`Keyboard Shortcuts`,reset_all:`Reset All`,capture_hint:`Press new shortcut combination`,reset_hint:`Reset to default`},config_files:{title:`Config Files`,codex_config:`Codex Config`,claude_config:`Claude Config`,path_label:`Path`,unsaved_changes:`Unsaved changes`,saving:`Saving...`,save_success:`Config saved successfully`,save_success_with_backup:`Updated {configPath} and created backup {backupPath}`,backup_created:`Backup saved to {path}`,save_failed:`Failed to save config`,load_failed:`Failed to load config`,file_not_found:`Config file does not exist. Edit and save to create it.`,status_saved:`Saved`,collapse:`Collapse`,format:`Format`,format_hint:`Format JSON code`,file_not_found_hint:`Edit and save to create the config file.`},permission_denied_hint:`Browser or system notification permission may be blocked. Check site settings and device notification settings.`,permission_unavailable_hint:`This environment cannot request browser notification permission`},auth:{description:`Enter your password to continue to the current workspace.`,hint:`Enter the access password configured for this deployment.`,blocked_until:`Too many attempts. Try again after {time}, or ask an administrator to unblock access.`,blocked_generic:`Too many attempts. Try again later, or ask an administrator to unblock access.`,status_title:`Access verification`,status_loading:`Checking the access state for this deployment.`,status_unavailable:`The authentication service is temporarily unavailable. Please try again shortly.`,status_not_configured:`Authentication is not configured on this deployment.`},connection:{title:`Connection`,status:`Status`,reconnecting:`Reconnecting...`,reconnect_failed:`Reconnection failed`,another_tab:`Another tab is active`,takeover:`Take Control`,server_shutdown:`Server has shut down`,backpressure_warning:`Network congested, some output may be lost`},supervisor:{title:`Supervisor`,empty:`Supervisor is not enabled`,latest_evaluation:`Latest evaluation`,state:{inactive:`Inactive`,idle:`Idle`,evaluating:`Evaluating`,injecting:`Injecting`,paused:`Paused`,error:`Error`},trigger:{manual:`MANUAL`,auto:`AUTO`},cycle:{no_guidance:`No guidance injected this cycle`,evaluating:`Evaluating...`,waiting:`Waiting for evaluation result`},field:{objective:`Objective`,current_objective:`Current objective`,objective_placeholder:`Describe what Supervisor should watch, for example:
97
- - Finish implementing user authentication
98
- - Fix all failing unit tests
99
- - Reduce P95 latency below 100ms`,objective_helper:`The more specific and measurable the target, the better the evaluation. Include completion criteria when possible.`,evaluator:`Evaluator`,evaluator_helper:`The provider that evaluates progress and suggests the next step. It can differ from the execution provider.`},action:{enable:`Enable Supervisor`,enable_objective:`Enable Objective`,edit_objective:`Edit Objective`,disable:`Disable Supervisor`,pause:`Pause`,resume:`Resume`,trigger:`Trigger Evaluation`,pause_failed:`Failed to pause Supervisor`,resume_failed:`Failed to resume Supervisor`,trigger_failed:`Failed to trigger evaluation`},dialog:{enable:{title:`Enable Supervisor`,subtitle:`Describe an objective and Supervisor will evaluate progress and suggest the next step after each turn.`,confirm:`Enable`},edit:{title:`Edit Supervisor`,subtitle:`Adjust the objective or switch evaluators without clearing evaluation history.`,confirm:`Save`},disable:{title:`Disable Supervisor`,subtitle:`Stop automatic evaluation. The current session's supervision cycles will be removed.`,confirm:`Disable`,warning_title:`Disabling stops evaluation cycles`,warning_body:`Supervisor will be removed from the current session and its cycle history will be cleared. You can enable it again later, but previous records cannot be restored.`}}},command:{palette:`Command Palette`,no_results:`No results found`,shortcut:{save:`Save`,save_all:`Save All`,search:`Search`,search_files:`Search Files`,command_palette:`Command Palette`,toggle_focus:`Toggle Focus Mode`,toggle_sidebar:`Toggle Sidebar`,toggle_terminal:`Toggle Terminal Panel`}},notification:{success:`Success`,error:`Error`,warning:`Warning`,info:`Info`,session_turn_completed:`Session turn completed`,file_saved:`File saved`,committed:`Committed`,session_completed_title:`{session} completed`,session_completed_body:`Agent session has finished executing`,session_ended:`Session ended`,session_ended_hint:`The session has stopped running`},error:{unknown:`Unknown error`,network:`Network error`,not_found:`Not found`,permission_denied:`Permission denied`,validation:`Validation failed`,conflict:`Resource conflict`},welcome:{kicker:`DEPLOY ONCE, CODE EVERYWHERE`,title:`Welcome to Coder Studio`,description:`Deploy your coding workspace once, then keep working from wherever you are. Same workspace, same context, across all your devices.`,features:{agent_first:{title:`Agent-first AI coding`,description:`Launch AI sessions that write, test, and deploy code.`},git_tools:{title:`Built-in Git tools`,description:`Stage, commit, and manage branches without leaving the IDE.`},terminals:{title:`Integrated terminals`,description:`Run commands and scripts alongside your AI sessions.`}}},not_found:{kicker:`ROUTE NOT FOUND`,title:`Page not found`,description:`The route you opened does not exist in this workspace shell.`,path_label:`Requested path`,go_home:`Go Home`},confirm:{save_changes:`Save changes?`,discard_changes:`Discard changes?`,delete_file:`Delete this file?`,stop_session:`Stop session?`,close_workspace:`Close workspace?`},placeholder:{search:`Type to search...`,command:`Type a command or shortcut...`,commit_message:`Enter commit message`},tooltip:{focus_mode:`Focus Mode: Hide sidebar and bottom panel`,split_horizontal:`Split panel horizontally`,split_vertical:`Split panel vertically`,close_pane:`Close panel`,new_workspace:`New workspace`,quick_actions:`Quick Actions`,enter_fullscreen:`Enter Fullscreen`,exit_fullscreen:`Exit Fullscreen`,show_terminal:`Show Terminal`,hide_terminal:`Hide Terminal`,show_files:`Show Files`,hide_files:`Hide Files`},time:{just_now:`Just now`,seconds_ago:`{count} seconds ago`,minutes_ago:`{count} minutes ago`,hours_ago:`{count} hours ago`,days_ago:`{count} days ago`},fencing:{observer_mode:`Read-only mode — another tab is the controller`,takeover:`Take over`,takeover_failed:`Takeover failed — controller is still active`}},Gf={app:{name:`Coder Studio`,description:`Agent-First Development Environment`},common:{loading:`加载中...`,error:`错误`,success:`成功`,warning:`警告`,info:`信息`,confirm:`确认`,cancel:`取消`,save:`保存`,delete:`删除`,edit:`编辑`,view:`查看`,close:`关闭`,yes:`是`,no:`否`,ok:`确定`,all:`全部`},action:{open:`打开`,open_workspace:`打开工作区`,close_workspace:`关闭工作区`,create_session:`创建会话`,stop_session:`停止会话`,resume_session:`恢复会话`,save_file:`保存文件`,save_all:`保存全部`,save:`保存`,discard_changes:`放弃更改`,commit:`提交`,push:`推送`,pull:`拉取`,refresh:`刷新`,settings:`设置`,cancel:`取消`,confirm:`确认`,close:`关闭`,apply:`应用`,reset:`重置`,search:`搜索`,search_files:`搜索文件`,search_commands:`搜索命令`,back:`返回`},label:{workspace:`工作区`,agent:`Agent`,session:`会话`,terminal:`终端`,file:`文件`,git:`Git`,settings:`设置`,provider:`Provider`,status:`状态`,progress:`进度`},provider:{install:{cta:{start:`启动会话`,install_and_start:`安装并启动`,installing:`安装中...`,manual:`查看安装步骤`},status:{installing:`正在安装 Provider CLI...`,failed:`自动安装失败`},open_docs:`打开官方文档`,nodejs:{manual:`请先从 Node.js 官方下载页安装 Node.js。`},claude:{manual:`然后执行 npm install -g @anthropic-ai/claude-code。`},codex:{manual:`然后执行 npm install -g @openai/codex。`}}},status:{starting:`启动中`,running:`运行中`,idle:`空闲`,busy:`忙碌`,ended:`已结束`,unavailable:`不可用`,connecting:`连接中`,connected:`已连接`,disconnected:`已断开`,reconnecting:`重连中`,rejected:`被拒绝`},workspace:{title:`工作区`,tabs:`工作区标签`,open:`打开`,close:`关闭`,path:`路径`,no_workspace:`未打开工作区`,fullscreen:{unsupported_title:`当前无法全屏`,unsupported_body:`当前浏览器不支持全屏功能。`,enter_failed_title:`进入全屏失败`,enter_failed_body:`浏览器拒绝了全屏请求。`,exit_failed_title:`退出全屏失败`,exit_failed_body:`浏览器暂时无法退出全屏。`},open_hint:`点击下方按钮打开一个项目目录`,loading_title:`正在加载工作区`,loading_description:`正在准备工作区列表并恢复上次活跃的会话。`,load_failed_title:`工作区加载失败`,load_failed_description:`获取工作区列表失败`,launch:{kicker:`启动工作区`,title:`打开工作区`,home_directory:`主目录`,go_up:`返回上一级`,no_directories:`未找到目录`,items_count:`{count} 项`,enter_folder:`进入 {name}`,enter_folder_action:`进入文件夹 →`,cancel:`取消`,start:`启动工作区`,starting:`启动中...`,hint:`选择一个目录作为工作区根目录。`,browse_failed:`浏览目录失败`,select_required:`请选择一个目录`,open_failed:`打开工作区失败`},runtime_check:{title:`运行时检查`,checking:`正在检查运行时环境...`,success:`运行时环境检查通过`,failed:`运行时环境检查失败`,missing_git:`未找到 Git 命令`,missing_node:`未找到 Node.js`,missing_provider:`未找到 {provider} CLI`}},mobile:{dock:{aria_label:`移动底栏`,open_agent:`打开 Agent 面板`,open_files:`打开文件面板`,open_terminal:`打开终端面板`},agent:{title:`Agent 会话`,close_current_session:`关闭当前会话`,providers:`会话提供方`,start_session:`启动 {provider} 会话`,starting:`正在启动…`,start_new_session:`启动新会话`,active_agents:`活跃 Agent`,switch_to_agent:`切换到 Agent {name}`,empty:`暂无活跃会话`},supervisor:{open_sheet:`打开 Supervisor 面板`},topbar:{switch_workspace:`切换工作区`,open_settings:`打开设置`,open_more_actions:`打开更多操作`,more_actions:`更多操作`},sheet:{dismiss:`关闭当前面板`,region:`{title}面板`},files:{tabs:`文件面板标签`,git_diff:`Git`,editor_fallback:`编辑器`},workspace_drawer:{aria_label:`工作区抽屉`,close:`关闭工作区抽屉`,select_title:`选择工作区`,switch_to_workspace:`切换到工作区 {name}`,close_workspace:`关闭工作区 {name}`},empty:{start_session:`为当前工作区启动一个新的 Agent 会话。`,files_terminal_hint:`文件和终端可继续通过底部栏访问。`}},session:{title:`会话`,create:`创建会话`,stop:`停止`,resume:`恢复`,no_session:`无活跃会话`,provider_select:`选择 Provider`,state:{starting:`启动中...`,running:`运行中`,idle:`等待指令`,busy:`执行中`,ended:`已停止`,unavailable:`不可用`},resume_unavailable:`此会话无法恢复`,progress:{thinking:`正在思考...`,executing:`正在执行...`,waiting:`等待响应...`}},terminal:{title:`终端`,kicker:`TERMINAL`,new_terminal:`新建终端`,close_terminal:`关闭终端`,shell:`Shell 终端`,agent:`Agent 终端`,reconnect_hint:`连接已断开,正在重连...`,no_terminal:`暂无终端`,empty_hint:`启动一个 Shell 来查看文件、运行命令,并在不离开工作区的情况下验证更改。`,load_failed_title:`加载终端失败`,load_failed_body:`请刷新工作区连接后重试。`,create_failed_title:`创建终端失败`,create_failed_body:`Shell 进程启动失败,请检查服务端运行环境和 Shell 配置。`,create_unavailable_title:`当前没有已选中的工作区`,create_unavailable_body:`请先打开或切换到一个工作区,再新建终端。`,hide:`隐藏终端`,show:`显示终端`,selector:{switch:`切换终端`,title:`终端会话`,current:`当前终端`,indexed:`终端 {index}`},mobile_input:{shortcuts:`终端快捷按键`,ctrl:`Ctrl`,ctrl_armed:`Ctrl 已待命`,ctrl_locked:`Ctrl 已锁定`,shift:`Shift`,shift_armed:`Shift 已待命`,escape:`Esc`,tab:`Tab`,enter:`Enter`,up:`上方向键`,down:`下方向键`,left:`左方向键`,right:`右方向键`},replay:{queued_title:`等待队列中(前方还有 {count} 个)`,up_next:`即将开始…`,loading_title:`正在恢复终端内容…`,loading_body:`恢复期间暂时无法使用当前终端;请耐心等待,历史内容恢复完成后再继续。内容较多时可能需要更久。`,failed_title:`历史内容恢复失败`,failed_body:`新输出仍会继续显示;如果需要完整历史,再手动刷新页面。`,closed_title:`该会话已被关闭`,closed_body:`请重新开启新会话。`,truncated_title:`历史内容不完整`,truncated_body:`较早的终端输出已被回放缓冲区淘汰,后续输出仍会继续显示。`}},file:{title:`文件`,modified:`已修改`,unsaved:`未保存`,dirty:`有未保存更改`,visible_count:`{count} 个文件`,empty_directory:`空文件夹`,new_file:`新建文件`,new_folder:`新建文件夹`,collapse_all:`折叠全部`,rename:`重命名`,delete:`删除`,delete_confirm:`确定要删除 "{name}" 吗?`,path:`路径`,path_required:`请输入路径`,invalid_file_path:`文件路径不能以 / 结尾`,path_helper_file:`输入工作区内的相对路径,例如 src/demo/new-file.ts`,path_helper_folder:`输入工作区内的相对路径,例如 src/demo/new-folder`,create_failed:`创建失败`,delete_failed:`删除失败`,conflict:`文件已被外部程序修改`,conflict_message:`文件可能已被编辑器外部修改。要放弃本地更改并重新加载吗?`},code_editor:{saving:`保存中...`,edit_as_text:`以文本编辑`,preview_as_image:`以图像预览`,mode_text:`文本`,mode_image:`图像`,open_failed_title:`打开文件失败`,empty_hint:`从左侧选择一个文件以在编辑器中打开。`,modified_on_disk:`该文件在打开后已被磁盘上的其他操作修改。请谨慎保存或重新加载文件。`,deleted_on_disk:`该文件在打开后已被磁盘上的其他操作删除。`},git:{title:`Git`,changes:`更改`,staged:`已暂存`,modified:`已修改`,deleted:`已删除`,unstaged:`未暂存`,untracked:`未跟踪`,no_changes:`无更改`,commit:`提交`,commit_message:`提交信息`,commit_placeholder:`输入提交信息...`,commit_summary_placeholder:`输入提交信息...`,commit_staged_count:`已暂存 {count}`,nothing_staged:`没有可提交的已暂存更改`,latest_commit:`最新提交`,history:`历史`,show_all_history:`查看全部`,change_count:`{count} 处更改`,no_commits:`暂无提交`,stage:`暂存`,unstage:`取消暂存`,stage_all:`暂存全部`,unstage_all:`取消暂存全部`,stage_failed_title:`暂存失败`,unstage_failed_title:`取消暂存失败`,discard:`放弃`,discard_all:`放弃全部`,discard_failed_title:`放弃失败`,discard_file_confirm_title:`放弃文件更改`,discard_file_confirm_message:`确定要放弃 “{path}” 的更改吗?`,discard_all_confirm_title:`放弃所有更改`,discard_all_confirm_message:`确定要放弃 {count} 个文件的更改吗?`,discard_confirm_irreversible:`此操作不可恢复。`,commit_failed_title:`提交失败`,branch:`分支`,switch_branch:`切换分支`,current_branch:`当前分支`,no_branch:`不在任何分支上`,ahead:`领先 {count} 个提交`,behind:`落后 {count} 个提交`,synced:`与远程同步`,push_confirm_title:`推送更改`,push_confirm_message:`是否将 {count} 个本地提交推送到远端?`,pull_confirm_title:`拉取更改`,pull_confirm_message:`是否从远端拉取 {count} 个最新提交到本地?`,sync_confirm_helper:`该操作会更新当前分支和工作区状态。`,push_success_title:`推送完成`,push_success_body:`本地提交已推送到远端。`,push_success_target:`已推送到 {target}`,pull_success_title:`拉取完成`,pull_success_body:`已拉取远端最新提交到当前分支。`,pull_success_target:`已从 {target} 拉取更新`,sync_up_to_date:`{target} 已是最新`,push_in_progress:`推送中...`,pull_in_progress:`拉取中...`,push_failed_title:`推送失败`,pull_failed_title:`拉取失败`,fetch_success_title:`已从远端获取`,fetch_success_body:`远端跟踪分支已更新。`,fetch_failed_title:`获取失败`,fetch_refresh_failed_body:`已从远端获取,但刷新本地 Git 状态失败。`,fetch_in_progress:`获取中...`,fetch_label:`获取`,fetch_last_at:`上次获取于 {when}`,fetch_last_never:`尚未获取`,operation_push:`推送`,operation_pull:`拉取`,operation_fetch:`获取`,auth_required_message:`{remote} 需要认证。`,auth_failed_invalid:`{remote} 的凭证被拒绝,请输入有效的用户名和密码或个人访问令牌后重试。`,auth_failed_forbidden:`{remote} 已接受当前凭证,但该账号没有执行 {operation} 的权限。`,auth_failed_unsupported:`{remote} 认证失败。请先配置 SSH key 或 credential helper,再重试。`,auth_helper_http:`请输入 Git 用户名和密码,或个人访问令牌后重试。`,auth_helper_unsupported:`当前远端不支持应用内认证。请先配置 SSH key 或 credential helper,再重试。`,auth_username:`用户名`,auth_password:`密码或令牌`,auth_username_placeholder:`Git 用户名`,auth_password_placeholder:`密码或个人访问令牌`,branch_remote:`远程`,quick_pick:{search_placeholder:`搜索分支或创建新分支...`,loading:`正在加载分支...`,empty_filtered:`未找到分支`,empty_idle:`输入以搜索分支`,create:`创建分支:{name}`,confirm_create:`确认创建分支:{name}`},statusbar:{changes:`未提交的文件变更`,ahead:`待推送的本地提交`,behind:`远端有新提交待拉取`}},worktree:{title:`工作树`,status_tab:`状态`,diff_tab:`差异`,tree_tab:`树`,path:`路径`,branch:`分支`,changes:`更改`,loading:`加载中...`,empty_tree:`空目录树`,clean:`干净`,dirty:`有更改`,dirty_status:`有更改`,staged_count:`已暂存:{count}`,modified_count:`已修改:{count}`,untracked_count:`未跟踪:{count}`,list_title:`工作树列表`,list_empty:`暂无工作树`,list_open_label:`查看工作树`,list_error:`加载失败:{error}`,manage:`管理`,new:`新建`,current:`当前`,summary_total:`{count} 个工作树`,summary_dirty:`{count} 个有更改`,summary_current:`当前:{name}`,summary_no_current:`当前:不可用`,create_title:`新建工作树`,create_submit:`创建`,create_path_hint:`路径必须是绝对路径。默认建议路径会基于当前工作区路径生成。`,create_path_absolute_required:`路径必须是绝对路径。`,create_failed_title:`创建工作树失败`,create_success_title:`工作树已创建`,create_success_body:`{name} 已可用。`,remove_confirm:`确认删除这个工作树?`,remove_force_confirm:`强制删除有更改的工作树?`,remove_failed_title:`删除工作树失败`,remove_success_title:`工作树已删除`,remove_success_body:`工作树已删除。`,force_remove:`强制删除`,remove_row_label:`删除 {name}`,selection_removed:`所选工作树已不可用。`},settings:{title:`设置`,general:`通用`,appearance:`外观`,providers:`Providers`,autosave_hint:`设置已自动保存`,load_failed:`设置加载失败`,load_failed_unknown:`未收到服务端返回的设置数据`,notifications:`通知`,notifications_channel_hint:`当前 workspace 处于活跃状态时不会通知;切换到其他 workspace 显示页面横幅;窗口不可见时使用系统通知。`,notifications_enabled:`启用完成通知`,notifications_enabled_hint:`当 Agent 会话完成时发送通知`,notification_sound:`通知声音`,notification_sound_hint:`通知触发时播放完成提示音`,notification_status:`通知状态`,notification_status_available:`可用`,notification_status_limited:`受限`,notification_status_limited_hint:`当前移动端浏览器中的系统通知支持不稳定,浏览器权限不代表一定能正常送达。`,notification_status_unsupported:`不支持`,notification_status_unsupported_hint:`当前浏览器环境不支持此通知方式。`,notification_permission:`通知权限`,permission_granted:`已授权`,permission_denied:`已拒绝`,permission_request:`请求授权`,permission_unavailable:`不可用`,permission_limited_hint:`当前移动端浏览器内即使允许通知权限,也可能无法稳定展示系统通知。`,supervisor:{title:`Supervisor`,hint:`限制 Supervisor 评估器的最长运行时间,超过后服务端会主动中止本轮评估。`,evaluation_timeout:`Supervisor 超时(秒)`,validation_error:`请输入 1 到 {max} 秒之间的整数。`},terminal_renderer:`终端渲染器`,terminal_renderer_hint:`选择终端渲染模式`,terminal_standard:`标准`,terminal_compatibility:`兼容模式`,provider:{title:`Provider 设置`,status:`状态`,capability:`能力等级`,capability_full:`完整支持`,capability_limited:`有限支持`,capability_unsupported:`不支持`,hooks_registered:`Hooks 已注册`,hooks_unregistered:`Hooks 未注册`,hooks_error:`Hooks 注册失败`,hooks:`Hooks 集成`,hooks_hint:`将 Provider 特定的 hooks 注入到当前工作区`,hooks_inject:`注入 Hooks`,configure:`配置`,reset:`重置`,config:`配置`,base:`基础配置`,config_file:`配置文件`,open_config_file_editor:`打开配置文件编辑`,back_to_base:`返回基础配置`,startup_args:`启动命令参数`,startup_args_hint:`每行填写一个启动参数,保存后会追加到 Provider 启动命令后面。`,startup_args_placeholder:`--verbose
100
- --debug`},theme:{title:`主题`,dark:`深色`,light:`浅色`,system:`跟随系统`,hint:`选择应用主题`},language:{title:`语言`,zh:`中文`,en:`English`,hint:`选择界面语言`},auth:{title:`认证`,password:`密码`,password_set:`设置密码`,password_change:`修改密码`,password_remove:`移除密码`},shortcuts:{title:`快捷键`,reset_all:`重置全部`,capture_hint:`按下新的快捷键组合`,reset_hint:`重置为默认`},config_files:{title:`配置文件`,codex_config:`Codex 配置`,claude_config:`Claude 配置`,path_label:`路径`,unsaved_changes:`未保存的更改`,saving:`保存中...`,save_success:`配置保存成功`,save_success_with_backup:`已更新 {configPath},并创建备份 {backupPath}`,backup_created:`备份已保存到 {path}`,save_failed:`配置保存失败`,load_failed:`配置加载失败`,file_not_found:`配置文件不存在,编辑并保存以创建。`,status_saved:`已保存`,collapse:`折叠`,format:`格式化`,format_hint:`格式化 JSON 代码`,file_not_found_hint:`编辑并保存以创建配置文件。`},permission_denied_hint:`浏览器或系统通知权限可能已阻止,请检查站点设置和设备通知设置`,permission_unavailable_hint:`当前环境无法请求浏览器通知权限`},auth:{description:`输入密码后继续进入当前工作区。`,hint:`请输入当前部署配置的访问密码。`,blocked_until:`尝试次数过多,请于 {time} 后再试,或联系管理员解禁。`,blocked_generic:`尝试次数过多,请稍后再试,或联系管理员解禁。`,status_title:`访问验证`,status_loading:`正在检查当前部署的访问状态。`,status_unavailable:`暂时无法连接鉴权服务,请稍后重试。`,status_not_configured:`当前部署未配置鉴权。`},connection:{title:`连接`,status:`状态`,reconnecting:`正在重新连接...`,reconnect_failed:`重连失败`,another_tab:`另一个标签页已激活`,takeover:`接管控制权`,server_shutdown:`服务器已关闭`,backpressure_warning:`网络拥堵,部分输出可能丢失`},supervisor:{title:`Supervisor`,empty:`Supervisor 未启用`,latest_evaluation:`最近一次评估`,state:{inactive:`未启用`,idle:`空闲`,evaluating:`评估中`,injecting:`注入中`,paused:`已暂停`,error:`错误`},trigger:{manual:`手动`,auto:`自动`},cycle:{no_guidance:`本轮无需注入 guidance`,evaluating:`评估中…`,waiting:`等待评估结果`},field:{objective:`目标描述`,current_objective:`当前目标`,objective_placeholder:`描述希望 Supervisor 盯住的目标,例如:
101
- - 完成用户认证功能的实现
102
- - 修复所有失败的单元测试
103
- - 把 P95 响应时间压到 100ms 以内`,objective_helper:`越具体、越可衡量,评估效果越好。建议包含完成条件。`,evaluator:`评估方`,evaluator_helper:`用于评估进度并生成下一步指引的 provider,与执行方可不相同。`},action:{enable:`启用 Supervisor`,enable_objective:`启用目标`,edit_objective:`编辑目标`,disable:`禁用 Supervisor`,pause:`暂停`,resume:`恢复`,trigger:`触发评估`,pause_failed:`暂停失败`,resume_failed:`恢复失败`,trigger_failed:`触发评估失败`},dialog:{enable:{title:`启用 Supervisor`,subtitle:`描述一个目标,Supervisor 会在每轮结束后自动评估并提示下一步`,confirm:`启用`},edit:{title:`编辑 Supervisor`,subtitle:`调整目标描述或切换评估方,历史评估不会被清除`,confirm:`保存`},disable:{title:`禁用 Supervisor`,subtitle:`停止自动评估。当前会话的监督周期将被移除`,confirm:`禁用`,warning_title:`禁用后会停止评估周期`,warning_body:`当前会话的 Supervisor 将被移除,历史 cycles 会一并清理。可重新启用,但无法恢复记录。`}}},command:{palette:`命令面板`,no_results:`未找到结果`,shortcut:{save:`保存`,save_all:`保存全部`,search:`搜索`,search_files:`搜索文件`,command_palette:`命令面板`,toggle_focus:`切换专注模式`,toggle_sidebar:`切换侧边栏`,toggle_terminal:`切换终端面板`}},notification:{success:`成功`,error:`错误`,warning:`警告`,info:`信息`,session_turn_completed:`会话回合完成`,file_saved:`文件已保存`,committed:`已提交`,session_completed_title:`{session} 已完成`,session_completed_body:`Agent 会话已完成执行`,session_ended:`会话已结束`,session_ended_hint:`会话已停止运行`},error:{unknown:`未知错误`,network:`网络错误`,not_found:`未找到`,permission_denied:`权限不足`,validation:`数据验证失败`,conflict:`资源冲突`},welcome:{kicker:`一次部署,随处编码`,title:`欢迎使用 Coder Studio`,description:`只需部署一次编码工作区,即可在任何地方继续工作。同一个工作区,同一个上下文,跨所有设备。`,features:{agent_first:{title:`以 Agent 为核心的 AI 编码`,description:`启动能够编写、测试和部署代码的 AI 会话。`},git_tools:{title:`内置 Git 工具`,description:`无需离开 IDE,就能暂存、提交并管理分支。`},terminals:{title:`集成终端`,description:`在 AI 会话旁边直接运行命令和脚本。`}}},not_found:{kicker:`路由不存在`,title:`页面不存在`,description:`你访问的路径不在当前工作台的前端路由中。`,path_label:`请求路径`,go_home:`返回首页`},confirm:{save_changes:`是否保存更改?`,discard_changes:`确定要放弃更改吗?`,delete_file:`确定要删除此文件吗?`,stop_session:`确定要停止会话吗?`,close_workspace:`确定要关闭工作区吗?`},placeholder:{search:`输入关键词搜索...`,command:`输入命令名称或快捷键...`,commit_message:`输入提交信息`},tooltip:{focus_mode:`专注模式:隐藏侧边栏和底部面板`,split_horizontal:`水平分割面板`,split_vertical:`垂直分割面板`,close_pane:`关闭面板`,new_workspace:`新建工作区`,quick_actions:`快捷操作`,enter_fullscreen:`进入全屏`,exit_fullscreen:`退出全屏`,show_terminal:`显示终端`,hide_terminal:`隐藏终端`,show_files:`显示文件`,hide_files:`隐藏文件`},time:{just_now:`刚刚`,seconds_ago:`{count} 秒前`,minutes_ago:`{count} 分钟前`,hours_ago:`{count} 小时前`,days_ago:`{count} 天前`},fencing:{observer_mode:`只读模式 — 另一个标签页正在控制`,takeover:`接管控制`,takeover_failed:`接管失败 — 控制器仍然活跃`}},Kf={zh:{name:`中文`,data:Gf},en:{name:`English`,data:Wf}};function qf(e,t){let n=t.split(`.`),r=e;for(let e of n){if(typeof r!=`object`||!r)return;r=r[e]}return typeof r==`string`?r:void 0}function Jf(e){let t=Kf[e]?.data??Gf;function n(e,n){let r=qf(t,e);if(r===void 0)return console.warn(`Translation missing for key: ${e}`),e;if(n)for(let[e,t]of Object.entries(n))r=r.replace(RegExp(`\\{${e}\\}`,`g`),String(t));return r}return n}var Yf=z(e=>Jf(e(Hr)));function Xf(e,t){let n=Date.now()-e,r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24),s=new Intl.RelativeTimeFormat(t===`zh`?`zh-CN`:`en-US`,{numeric:`auto`});return o>0?s.format(-o,`day`):a>0?s.format(-a,`hour`):i>0?s.format(-i,`minute`):s.format(-r,`second`)}function Zf(e,t,n){return new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en-US`,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,...n}).format(e)}function X(){return V(Yf)}var Qf=t((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})),Z=t(((e,t)=>{t.exports=Qf()}))();function $f({title:e,kicker:t,onBack:n,backLabel:r,headerAction:i}){return(0,Z.jsxs)(`div`,{className:`page-header`,children:[(0,Z.jsxs)(`div`,{className:`page-header__leading`,children:[(0,Z.jsxs)(`button`,{type:`button`,className:`page-header__back`,onClick:n,"aria-label":r,children:[(0,Z.jsx)(Id,{size:16}),(0,Z.jsx)(`span`,{children:r})]}),(0,Z.jsxs)(`div`,{className:`page-header__copy`,children:[t?(0,Z.jsx)(`div`,{className:`page-header__kicker`,children:t}):null,(0,Z.jsx)(`h2`,{className:`page-header__title`,children:e})]})]}),i?(0,Z.jsx)(`div`,{className:`page-header__actions`,children:i}):null]})}function ep({title:e,body:t,onClose:n,kicker:r,onBack:i,footer:a,headerAction:o,bodyClassName:s,contentClassName:c,fullscreen:l=!1,backLabel:u}){let d=X(),f=i??n,p=u??d(`action.back`);return(0,Z.jsxs)(`div`,{className:`mobile-sheet-layer`,children:[(0,Z.jsx)(`button`,{type:`button`,className:`mobile-sheet-layer__backdrop`,"aria-label":d(`mobile.sheet.dismiss`),onClick:n}),(0,Z.jsxs)(`section`,{className:q(`mobile-sheet`,l?`mobile-sheet--fullscreen`:null,c),"aria-label":d(`mobile.sheet.region`,{title:e}),role:`region`,children:[l?null:(0,Z.jsx)(`div`,{className:`mobile-sheet__handle`,"aria-hidden":`true`}),(0,Z.jsx)(`div`,{className:`mobile-sheet__header`,children:(0,Z.jsx)($f,{title:e,kicker:r,onBack:f,backLabel:p,headerAction:o})}),(0,Z.jsx)(`div`,{className:q(`mobile-sheet__body`,s),children:t}),a?(0,Z.jsx)(`div`,{className:`mobile-sheet__footer`,children:a}):null]})]})}var tp={triggerWrapper:`_triggerWrapper_3dhkg_1`,content:`_content_3dhkg_5`,menu:`_menu_3dhkg_17`,item:`_item_3dhkg_23`,itemDanger:`_itemDanger_3dhkg_48`,itemDisabled:`_itemDisabled_3dhkg_57`,itemIcon:`_itemIcon_3dhkg_67`,itemLabel:`_itemLabel_3dhkg_74`},np=8,rp=8;function ip(e){return(0,B.isValidElement)(e)}function ap(e){return e.reduce((e,t,n)=>(t.disabled||e.push(n),e),[])}function op(e,t,n){let r=ap(e);if(r.length===0)return null;if(t===null)return n===1?r[0]??null:r[r.length-1]??null;let i=r.indexOf(t);if(i===-1)return n===1?r[0]??null:r[r.length-1]??null;let a=r[i+n];return a===void 0?n===1?r[0]??null:r[r.length-1]??null:a}function sp({children:e,items:t,title:n,open:r,onOpenChange:i,forceMode:a=`auto`,placement:o=`bottom-start`,contentClassName:s,sheetBodyClassName:c}){let l=Fr(),u=(0,B.useRef)(null),d=(0,B.useRef)(null),f=(0,B.useRef)([]),p=(0,B.useRef)(null),m=(0,B.useId)(),h=a===`desktop`?`desktop`:a===`mobile`?`mobile`:l,g=r&&h===`desktop`,_=r&&h===`mobile`,[v,y]=(0,B.useState)({left:np,top:np,visibility:`hidden`}),[b,x]=(0,B.useState)(null),S=B.Children.only(e);if((0,B.useLayoutEffect)(()=>{if(r)return p.current=document.activeElement,()=>{J(p.current),p.current=null}},[r]),(0,B.useEffect)(()=>{if(!r){x(null);return}x(e=>e!==null&&t[e]&&!t[e]?.disabled?e:op(t,e,1))},[t,r]),(0,B.useLayoutEffect)(()=>{if(!g||!u.current||!d.current){y(e=>e.visibility===`hidden`?e:{...e,visibility:`hidden`});return}let e=()=>{if(!u.current||!d.current)return;let e=u.current.getBoundingClientRect(),t=d.current.getBoundingClientRect(),n=o===`bottom-end`?e.right-t.width:e.left,r=Math.max(np,window.innerWidth-t.width-np),i=Math.min(r,Math.max(np,n)),a=e.bottom+rp;y({left:i,top:a+t.height<=window.innerHeight-np?a:Math.max(np,e.top-t.height-rp),visibility:`visible`})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[g,o]),(0,B.useLayoutEffect)(()=>{!g||b===null||f.current[b]?.focus()},[b,g]),(0,B.useEffect)(()=>{if(!g)return;let e=e=>{e.target instanceof Node&&(u.current?.contains(e.target)||d.current?.contains(e.target)||i(!1))},t=e=>{vd(e)&&(e.preventDefault(),i(!1))};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[g,i]),!ip(S))throw Error(`ActionMenu requires a single trigger React element.`);let C=async e=>{e.disabled||(i(!1),await Promise.resolve(),await e.onSelect())},w=(0,B.cloneElement)(S,{"aria-controls":g?m:void 0,"aria-expanded":r,"aria-haspopup":`menu`,onClick:e=>{S.props.onClick?.(e),e.defaultPrevented||i(!r)},onKeyDown:e=>{if(S.props.onKeyDown?.(e),!e.defaultPrevented){if(e.key===`ArrowDown`){if(e.preventDefault(),!r){x(op(t,null,1)),i(!0);return}x(e=>op(t,e,1));return}if(e.key===`ArrowUp`){if(e.preventDefault(),!r){x(op(t,null,-1)),i(!0);return}x(e=>op(t,e,-1));return}if((e.key===`Enter`||e.key===` `)&&!r){e.preventDefault(),x(op(t,null,1)),i(!0);return}vd(e)&&r&&(e.preventDefault(),i(!1))}}}),T=(0,Z.jsx)(`div`,{className:tp.menu,id:m,role:`menu`,"aria-label":n,children:t.map((e,n)=>{let r=e.tone??`default`;return(0,Z.jsxs)(`button`,{ref:e=>{f.current[n]=e},type:`button`,className:q(tp.item,r===`danger`?tp.itemDanger:null,e.disabled?tp.itemDisabled:null),disabled:e.disabled,onClick:()=>{C(e)},onKeyDown:n=>{if(n.key===`ArrowDown`){n.preventDefault(),x(e=>op(t,e,1));return}if(n.key===`ArrowUp`){n.preventDefault(),x(e=>op(t,e,-1));return}if((n.key===`Enter`||n.key===` `)&&!e.disabled){n.preventDefault(),C(e);return}vd(n)&&(n.preventDefault(),n.stopPropagation(),i(!1))},role:`menuitem`,tabIndex:b===n?0:-1,children:[e.icon?(0,Z.jsx)(`span`,{className:tp.itemIcon,children:e.icon}):null,(0,Z.jsx)(`span`,{className:tp.itemLabel,children:e.label})]},e.id)})});return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:tp.triggerWrapper,ref:u,children:w}),g?(0,Z.jsx)(Td,{children:(0,Z.jsx)(`div`,{className:q(tp.content,s),ref:d,style:{left:`${v.left}px`,top:`${v.top}px`,visibility:v.visibility},children:T})}):null,_?(0,Z.jsx)(ep,{title:n,body:T,bodyClassName:q(`mobile-sheet__body--flush`,c),onClose:()=>i(!1)}):null]})}var cp={badge:`_badge_glfln_1`};function lp({className:e,count:t,max:n=99,...r}){if(t<=0)return null;let i=t>n?`${n}+`:String(t);return(0,Z.jsx)(`span`,{...r,className:q(cp.badge,`topbar-unread`,e),children:i})}var up={btn:`_btn_59wz6_1`,primary:`_primary_59wz6_36`,secondary:`_secondary_59wz6_47`,ghost:`_ghost_59wz6_62`,danger:`_danger_59wz6_75`,sm:`_sm_59wz6_81`,lg:`_lg_59wz6_89`,label:`_label_59wz6_97`,icon:`_icon_59wz6_102`,loading:`_loading_59wz6_107`,spinner:`_spinner_59wz6_111`},dp={primary:up.primary??``,secondary:up.secondary??``,ghost:up.ghost??``,danger:up.danger??``},fp={sm:up.sm,md:void 0,lg:up.lg},pp={primary:`btn-primary`,secondary:`btn-secondary`,ghost:`btn-ghost`,danger:`btn-danger`},mp={sm:`btn-sm`,md:void 0,lg:`btn-lg`},hp=({children:e,leadingIcon:t,loading:n,trailingIcon:r})=>(0,Z.jsxs)(Z.Fragment,{children:[n?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:q(up.spinner,`animate-spin`)}):null,t?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:up.icon,children:t}):null,(0,Z.jsx)(`span`,{className:up.label,children:e}),r?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:up.icon,children:r}):null]}),gp=e=>{let{as:t=`button`,children:n,className:r,variant:i=`secondary`,size:a=`md`,loading:o=!1,leadingIcon:s,trailingIcon:c}=e,l=q(up.btn,dp[i],fp[a],`btn`,pp[i],mp[a],o?up.loading:void 0,r),u=(0,Z.jsx)(hp,{children:n,leadingIcon:s,loading:o,trailingIcon:c});if(t===`a`){let{as:t,children:n,className:r,leadingIcon:i,loading:a,size:s,trailingIcon:c,variant:d,...f}=e;return(0,Z.jsx)(`a`,{...f,"aria-busy":o?`true`:void 0,className:l,children:u})}let{as:d,children:f,className:p,disabled:m,leadingIcon:h,loading:g,size:_,trailingIcon:v,type:y,variant:b,...x}=e;return(0,Z.jsx)(`button`,{...x,"aria-busy":o?`true`:void 0,className:l,disabled:m||o,type:y??`button`,children:u})},_p={root:`_root_1ojt1_1`,ghost:`_ghost_1ojt1_30`,filled:`_filled_1ojt1_40`,sm:`_sm_1ojt1_51`,lg:`_lg_1ojt1_57`,icon:`_icon_1ojt1_63`},vp={ghost:_p.ghost,filled:_p.filled},yp={sm:_p.sm,md:void 0,lg:_p.lg},bp={ghost:`btn-ghost`,filled:`btn-secondary`},xp={sm:`btn-sm`,md:void 0,lg:`btn-lg`},Q=({"aria-label":e,className:t,icon:n,size:r=`md`,type:i,variant:a=`ghost`,...o})=>(0,Z.jsx)(`button`,{...o,"aria-label":e,className:q(_p.root,vp[a],yp[r],`btn`,bp[a],xp[r],t),type:i??`button`,children:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:_p.icon,children:n})}),Sp={overlay:`_overlay_1duw8_1`,card:`_card_1duw8_13`,sm:`_sm_1duw8_28`,md:`_md_1duw8_32`,lg:`_lg_1duw8_36`,full:`_full_1duw8_41`,header:`_header_1duw8_46`,title:`_title_1duw8_56`,body:`_body_1duw8_67`,footer:`_footer_1duw8_76`},Cp=(0,B.createContext)(null),wp={sm:Sp.sm,md:Sp.md,lg:Sp.lg,full:Sp.full},Tp={sm:void 0,md:void 0,lg:`modal-card-lg`,full:void 0};function Ep({children:e,className:t,dismissible:n=!0,initialFocus:r,onOpenChange:i,open:a,size:o=`md`}){let s=(0,B.useRef)(null),c=(0,B.useRef)(null),l=(0,B.useId)(),u=(0,B.useMemo)(()=>({titleId:l}),[l]);return(0,B.useLayoutEffect)(()=>{if(!a)return;c.current=document.activeElement;let e=s.current;if(e)return Sd(e,r).focus(),()=>{J(c.current),c.current=null}},[r,a]),a?(0,Z.jsx)(Td,{children:(0,Z.jsx)(`div`,{className:q(Sp.overlay,`modal-overlay`),onClick:e=>{n&&_d(e)&&i(!1)},children:(0,Z.jsx)(Cp.Provider,{value:u,children:(0,Z.jsx)(`div`,{"aria-labelledby":l,"aria-modal":`true`,className:q(Sp.card,wp[o],`modal-card`,Tp[o],t),onKeyDown:e=>{if(vd(e)){n&&(e.preventDefault(),e.stopPropagation(),i(!1));return}Cd(e.currentTarget,e)},ref:s,role:`dialog`,tabIndex:-1,children:e})})})}):null}function Dp({className:e,...t}){return(0,Z.jsx)(`div`,{...t,className:q(Sp.header,`modal-header`,e)})}function Op({className:e,...t}){let n=(0,B.useContext)(Cp),r=(0,B.useId)(),i=n?.titleId??r;return(0,Z.jsx)(`h2`,{...t,className:q(Sp.title,`modal-title`,e),id:i})}function kp({className:e,...t}){return(0,Z.jsx)(`div`,{...t,className:q(Sp.body,`modal-body`,e)})}function Ap({className:e,...t}){return(0,Z.jsx)(`div`,{...t,className:q(Sp.footer,`modal-footer`,e)})}var jp={body:`_body_1te92_1`,titleDanger:`_titleDanger_1te92_9`,iconDanger:`_iconDanger_1te92_13`},Mp={default:`primary`,danger:`danger`};function Np({cancelDisabled:e=!1,cancelText:t,className:n,closeDisabled:r=!1,closeLabel:i=`Close`,confirmButtonProps:a,confirmDisabled:o=!1,confirmText:s,description:c,dismissible:l=!0,initialFocus:u,onConfirm:d,onOpenChange:f,open:p,title:m,tone:h=`default`}){let{className:g,disabled:_,...v}=a??{};return(0,Z.jsxs)(Ep,{className:n,dismissible:l,initialFocus:u,onOpenChange:f,open:p,children:[(0,Z.jsxs)(Dp,{children:[(0,Z.jsxs)(Op,{className:q(h===`danger`?jp.titleDanger:void 0),children:[h===`danger`?(0,Z.jsx)(Vf,{"aria-hidden":`true`,className:jp.iconDanger,size:16}):null,(0,Z.jsx)(`span`,{children:m})]}),l||r?(0,Z.jsx)(Q,{"aria-label":i,className:`modal-close`,disabled:r,icon:(0,Z.jsx)(Hf,{size:14}),onClick:()=>f(!1),size:`sm`}):null]}),c?(0,Z.jsx)(kp,{className:jp.body,children:c}):null,(0,Z.jsxs)(Ap,{children:[(0,Z.jsx)(gp,{disabled:e,onClick:()=>f(!1),children:t}),(0,Z.jsx)(gp,{...v,className:g,disabled:o||_,onClick:d,variant:Mp[h],children:s})]})]})}var Pp={root:`_root_ua36l_1`,icon:`_icon_ua36l_13`,title:`_title_ua36l_20`,description:`_description_ua36l_26`,action:`_action_ua36l_33`};function Fp(e,t){if(e==null||typeof e==`boolean`)return null;if((0,B.isValidElement)(e)){let n=e;return(0,B.cloneElement)(n,{className:q(n.props.className,t)})}return(0,Z.jsx)(`div`,{className:t,children:e})}function Ip({action:e,className:t,description:n,icon:r,title:i,...a}){return(0,Z.jsxs)(`div`,{...a,className:q(Pp.root,t),children:[Fp(r,Pp.icon),Fp(i,Pp.title),Fp(n,Pp.description),e?(0,Z.jsx)(`div`,{className:Pp.action,children:e}):null]})}var Lp={input:`_input_y1v5b_1`,sm:`_sm_y1v5b_27`,lg:`_lg_y1v5b_33`,invalid:`_invalid_y1v5b_39`},Rp={sm:Lp.sm,md:void 0,lg:Lp.lg},zp={sm:`input-sm`,md:void 0,lg:`input-lg`},Bp=(0,B.forwardRef)(function({className:e,htmlSize:t,invalid:n,size:r=`md`,...i},a){let o=n===void 0?i[`aria-invalid`]:n?`true`:`false`;return(0,Z.jsx)(`input`,{...i,ref:a,size:t,"aria-invalid":o,className:q(Lp.input,Rp[r],`input`,zp[r],n?Lp.invalid:void 0,e)})}),Vp={kbd:`_kbd_kd5ca_1`,interactive:`_interactive_kd5ca_14`,sm:`_sm_kd5ca_26`},Hp={sm:Vp.sm,md:void 0},Up=({children:e,className:t,interactive:n=!1,onKeyDown:r,size:i=`md`,tabIndex:a,...o})=>(0,Z.jsx)(`kbd`,{...o,className:q(Vp.kbd,Hp[i],n?Vp.interactive:void 0,`shortcuts-key`,t),onKeyDown:e=>{n&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.currentTarget.click()),r?.(e)},role:n?`button`:o.role,tabIndex:n?a??0:a,children:e}),Wp={notice:`_notice_1jarg_1`,info:`_info_1jarg_13`,success:`_success_1jarg_18`,warning:`_warning_1jarg_23`,error:`_error_1jarg_28`,copy:`_copy_1jarg_33`,title:`_title_1jarg_41`,message:`_message_1jarg_47`,action:`_action_1jarg_53`},Gp={info:Wp.info,success:Wp.success,warning:Wp.warning,error:Wp.error},Kp={info:void 0,success:void 0,warning:void 0,error:`settings-page__notice--error`};function qp({action:e,className:t,message:n,title:r,tone:i=`info`,...a}){return(0,Z.jsxs)(`div`,{...a,className:q(Wp.notice,Gp[i],`settings-page__notice`,Kp[i],t),children:[r||n?(0,Z.jsxs)(`div`,{className:q(Wp.copy,`settings-page__notice-copy`),children:[r?(0,Z.jsx)(`span`,{className:q(Wp.title,`settings-page__notice-title`),children:r}):null,n?(0,Z.jsx)(`span`,{className:q(Wp.message,`settings-page__notice-message`),children:n}):null]}):null,e?(0,Z.jsx)(`div`,{className:Wp.action,children:e}):null]})}var Jp={pill:`_pill_120wz_1`,active:`_active_120wz_29`,icon:`_icon_120wz_35`};function Yp({active:e=!1,children:t,className:n,disabled:r=!1,leadingIcon:i,selected:a=!1,...o}){let s=e||a;return(0,Z.jsxs)(`button`,{...o,"aria-pressed":s,className:q(Jp.pill,s?Jp.active:void 0,`settings-pill`,s?`settings-pill-active`:void 0,r?`settings-pill-disabled`:void 0,n),disabled:r,type:`button`,children:[i?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:Jp.icon,children:i}):null,(0,Z.jsx)(`span`,{children:t})]})}var Xp={triggerWrapper:`_triggerWrapper_trseu_1`,content:`_content_trseu_6`},Zp=8,Qp=8;function $p(e){return(0,B.isValidElement)(e)}function em({children:e,content:t,title:n,open:r,onOpenChange:i,forceMode:a=`auto`,placement:o=`bottom-start`,contentClassName:s,sheetBodyClassName:c}){let l=Fr(),u=(0,B.useRef)(null),d=(0,B.useRef)(null),f=(0,B.useRef)(null),p=(0,B.useId)(),m=a===`desktop`?`desktop`:a===`mobile`?`mobile`:l,h=r&&m===`desktop`,g=r&&m===`mobile`,[_,v]=(0,B.useState)({left:Zp,top:Zp,visibility:`hidden`}),y=B.Children.only(e);if((0,B.useLayoutEffect)(()=>{if(r)return f.current=document.activeElement,()=>{J(f.current),f.current=null}},[r]),(0,B.useLayoutEffect)(()=>{if(!h||!u.current||!d.current){v(e=>e.visibility===`hidden`?e:{...e,visibility:`hidden`});return}let e=()=>{if(!u.current||!d.current)return;let e=u.current.getBoundingClientRect(),t=d.current.getBoundingClientRect(),n=o===`bottom-end`?e.right-t.width:e.left,r=Math.max(Zp,window.innerWidth-t.width-Zp),i=Math.min(r,Math.max(Zp,n)),a=e.bottom+Qp;v({left:i,top:a+t.height<=window.innerHeight-Zp?a:Math.max(Zp,e.top-t.height-Qp),visibility:`visible`})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[h,o]),(0,B.useLayoutEffect)(()=>{!h||!d.current||d.current.focus()},[h]),(0,B.useEffect)(()=>{if(!h)return;let e=e=>{e.target instanceof Node&&(u.current?.contains(e.target)||d.current?.contains(e.target)||i(!1))},t=e=>{vd(e)&&(e.preventDefault(),i(!1))};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[h,i]),!$p(y))throw Error(`Popover requires a single trigger React element.`);let b=(0,B.cloneElement)(y,{"aria-controls":h?p:void 0,"aria-expanded":r,"aria-haspopup":`dialog`,onClick:e=>{y.props.onClick?.(e),e.defaultPrevented||i(!r)},onKeyDown:e=>{if(y.props.onKeyDown?.(e),!e.defaultPrevented){if(e.key===`ArrowDown`&&!r){e.preventDefault(),i(!0);return}vd(e)&&r&&(e.preventDefault(),i(!1))}}});return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:Xp.triggerWrapper,ref:u,children:b}),h?(0,Z.jsx)(Td,{children:(0,Z.jsx)(`div`,{"aria-label":n,"aria-modal":`false`,className:q(Xp.content,s),id:p,onKeyDown:e=>{vd(e)&&(e.preventDefault(),e.stopPropagation(),i(!1))},ref:d,role:`dialog`,style:{left:`${_.left}px`,top:`${_.top}px`,visibility:_.visibility},tabIndex:-1,children:t})}):null,g?(0,Z.jsx)(ep,{body:(0,Z.jsx)(`div`,{children:t}),bodyClassName:c,onClose:()=>i(!1),title:n}):null]})}var tm={root:`_root_1348s_1`,fill:`_fill_1348s_7`,success:`_success_1348s_14`,warning:`_warning_1348s_18`,error:`_error_1348s_22`,info:`_info_1348s_26`,neutral:`_neutral_1348s_30`,indeterminate:`_indeterminate_1348s_34`,progressBarIndeterminate:`_progressBarIndeterminate_1348s_1`},nm={success:tm.success,warning:tm.warning,error:tm.error,info:tm.info,neutral:tm.neutral};function rm(e,t,n){return Math.min(Math.max(e,t),n)}function im({className:e,fillClassName:t,indeterminate:n=!1,max:r,style:i,tone:a,value:o,...s}){let c=s[`aria-hidden`]===!0||s[`aria-hidden`]===`true`,l=r>0?r:0,u=rm(o,0,l),d=l>0?rm(u/l*100,0,100):0;return(0,Z.jsx)(`div`,{...s,"aria-valuemax":c?void 0:l,"aria-valuemin":c?void 0:0,"aria-valuenow":c||n?void 0:u,className:q(tm.root,n?tm.indeterminate:void 0,e),role:c?void 0:`progressbar`,style:i,children:(0,Z.jsx)(`div`,{className:q(tm.fill,nm[a],t),style:n?void 0:{"--progress-bar-width":`${d}%`}})})}var am={tabs:`_tabs_29j1i_1`,tabList:`_tabList_29j1i_5`,tab:`_tab_29j1i_1`,tabActive:`_tabActive_29j1i_71`,panel:`_panel_29j1i_6`},om=(0,B.createContext)(null);function sm(e){let t=(0,B.useContext)(om);if(!t)throw Error(`${e} must be used within Tabs`);return t}function cm({children:e,className:t,orientation:n=`horizontal`,value:r,onValueChange:i,"aria-label":a,...o}){let s=(0,B.useId)(),c=(0,B.useRef)(new Map),[l,u]=(0,B.useState)({}),d=(0,B.useCallback)(e=>{let t=c.current.get(e);if(t)return t;let n={tabId:`${s}-tab-${c.current.size}`,panelId:`${s}-panel-${c.current.size}`};return c.current.set(e,n),n},[s]),f=(0,B.useCallback)(e=>{u(t=>t[e]?t:{...t,[e]:!0})},[]),p=(0,B.useCallback)(e=>{u(t=>{if(!t[e])return t;let n={...t};return delete n[e],n})},[]),m=(0,B.useMemo)(()=>({value:r,onValueChange:i,orientation:n,listLabel:a,ensureTabIds:d,hasPanel:e=>!!l[e],registerPanel:f,unregisterPanel:p}),[a,d,i,n,l,f,p,r]);return(0,Z.jsx)(om.Provider,{value:m,children:(0,Z.jsx)(`div`,{...o,className:q(am.tabs,t),"data-orientation":n,children:e})})}function lm({children:e,className:t,orientation:n,...r}){let i=sm(`TabList`),a=n??i.orientation;return(0,Z.jsx)(`div`,{...r,"aria-label":r[`aria-label`]??i.listLabel,"aria-orientation":a===`vertical`?`vertical`:void 0,className:q(am.tabList,t),"data-orientation":a,role:`tablist`,children:e})}function um({children:e,className:t,value:n,onClick:r,onKeyDown:i,...a}){let o=sm(`Tab`),s=o.value===n,c=o.ensureTabIds(n),l=e=>{if(i?.(e),e.defaultPrevented)return;let t=e.currentTarget.closest(`[role="tablist"]`);if(!t)return;let n=t.getAttribute(`aria-orientation`)===`vertical`?`vertical`:`horizontal`,r=Array.from(t.querySelectorAll(`button[role="tab"]:not(:disabled)`)),a=r.indexOf(e.currentTarget);if(a===-1)return;let s=t=>{let n=r[t];n?.focus();let i=n?.dataset.value;i&&o.onValueChange(i),e.preventDefault()};n===`horizontal`&&e.key===`ArrowRight`||n===`vertical`&&e.key===`ArrowDown`?s((a+1)%r.length):n===`horizontal`&&e.key===`ArrowLeft`||n===`vertical`&&e.key===`ArrowUp`?s((a-1+r.length)%r.length):e.key===`Home`?s(0):e.key===`End`&&s(r.length-1)};return(0,Z.jsx)(`button`,{...a,"aria-controls":o.hasPanel(n)?c.panelId:void 0,"aria-selected":s,className:q(am.tab,s?am.tabActive:void 0,s?`active`:void 0,t),"data-state":s?`active`:`inactive`,"data-value":n,id:c.tabId,onClick:e=>{r?.(e),e.defaultPrevented||o.onValueChange(n)},onKeyDown:l,role:`tab`,tabIndex:s?0:-1,type:`button`,children:e})}function dm({children:e,className:t,value:n,...r}){let i=sm(`TabPanel`),a=i.value===n,o=i.ensureTabIds(n),{registerPanel:s,unregisterPanel:c}=i;return(0,B.useLayoutEffect)(()=>(s(n),()=>{c(n)}),[s,c,n]),(0,Z.jsx)(`div`,{...r,"aria-labelledby":o.tabId,className:q(am.panel,t),hidden:!a,id:o.panelId,role:`tabpanel`,children:e})}var fm={segmentedControl:`_segmentedControl_19foh_1`,segmentedControlOption:`_segmentedControlOption_19foh_18`};function pm({options:e,value:t,onChange:n,size:r=`md`,className:i,optionClassName:a,...o}){return(0,Z.jsx)(cm,{onValueChange:n,value:e.some(e=>e.value===t)?t:e.find(e=>!e.disabled)?.value??t,children:(0,Z.jsx)(lm,{...o,className:q(fm.segmentedControl,i),"data-size":r,children:e.map(e=>(0,Z.jsx)(um,{className:q(fm.segmentedControlOption,a),"data-size":r,disabled:e.disabled,value:e.value,children:e.label},e.value))})})}function mm({title:e,onBack:t,backLabel:n=`Back`,backAriaLabel:r,kicker:i,rightSlot:a,titleAs:o=`h2`}){return(0,Z.jsxs)(`div`,{className:`page-header`,children:[(0,Z.jsxs)(`div`,{className:`page-header__leading`,children:[t?(0,Z.jsxs)(`button`,{type:`button`,className:`page-header__back`,onClick:t,"aria-label":r??n,children:[(0,Z.jsx)(Id,{size:16}),(0,Z.jsx)(`span`,{children:n})]}):null,(0,Z.jsxs)(`div`,{className:`page-header__copy`,children:[i?(0,Z.jsx)(`div`,{className:`page-header__kicker`,children:i}):null,(0,Z.jsx)(o,{className:`page-header__title`,children:e})]})]}),a?(0,Z.jsx)(`div`,{className:`page-header__actions`,children:a}):null]})}var hm={minHeight:`auto`,padding:`var(--sp-6) var(--sp-4)`,gap:0},gm={minHeight:`auto`,padding:`var(--sp-6) var(--sp-4)`,gap:0},_m={color:`var(--text-secondary)`,fontSize:`inherit`,fontWeight:`var(--font-normal)`,lineHeight:`inherit`},vm={color:`var(--text-tertiary)`,fontSize:`inherit`,fontWeight:`var(--font-normal)`,lineHeight:`inherit`};function ym({title:e,sections:t,selectedId:n,presentation:r=`sheet`,searchable:i=!1,searchPlaceholder:a,searchValue:o,onSearchValueChange:s,create:c,closeOnSelect:l=!0,loading:u=!1,loadingText:d,emptyText:f,kicker:p,onBack:m,onSelect:h,onClose:g}){let _=X(),[v,y]=(0,B.useState)(``),b=(0,B.useId)(),x=o??v,S=x.trim().toLowerCase(),C=d??_(`common.loading`),w=f??_(`command.no_results`),T=a??_(`action.search`),E=e=>{o===void 0&&y(e),s?.(e)},D=(0,B.useMemo)(()=>S?t.map(e=>e.kind===`options`?{...e,items:e.items.filter(e=>[e.label,e.description??``,e.meta??``,...e.keywords??[]].join(` `).toLowerCase().includes(S))}:e):t,[S,t]),O=D.some(e=>e.items.length>0),k=!!(c?.visible&&x.trim()),A=!!(k&&c?.disabled?.(x.trim())),j=(e,t)=>{Promise.resolve(t()).catch(t=>{console.error(`MobileSelectSheet ${e} failed`,t)})},M=e=>{j(`select`,async()=>{await h(e),l&&g()})},N=e=>{j(`action`,e)},P=e=>{j(`action`,e)},F=()=>{!c||!x.trim()||j(`create`,()=>c.onCreate(x.trim()))},ee=(0,Z.jsxs)(Z.Fragment,{children:[i?(0,Z.jsxs)(`div`,{className:`mobile-select-sheet__search`,children:[(0,Z.jsx)(`label`,{className:`mobile-select-sheet__search-label`,htmlFor:b,children:_(`action.search`)}),(0,Z.jsx)(`input`,{id:b,type:`text`,className:`mobile-select-sheet__search-input`,placeholder:T,value:x,onChange:e=>E(e.target.value)})]}):null,(0,Z.jsx)(`div`,{className:`mobile-select-sheet__content`,children:u?(0,Z.jsx)(Ip,{className:`mobile-select-sheet__loading`,role:`status`,style:gm,title:(0,Z.jsx)(`div`,{style:_m,children:C})}):(0,Z.jsxs)(Z.Fragment,{children:[D.map(e=>e.items.length===0&&e.kind===`options`?null:(0,Z.jsxs)(`div`,{className:`mobile-select-sheet__section`,children:[e.title?(0,Z.jsx)(`div`,{className:`mobile-select-sheet__section-title`,children:e.title}):null,(0,Z.jsx)(`div`,{className:`mobile-select-sheet__list`,children:e.kind===`options`?e.items.map(t=>{let r=t.id===n,i=`${e.id}-${t.id}-label`,a=[t.description?`${e.id}-${t.id}-description`:null,t.meta?`${e.id}-${t.id}-meta`:null].filter(Boolean).join(` `),o=(0,Z.jsxs)(`button`,{type:`button`,className:`mobile-select-sheet__item ${t.tone===`danger`?`mobile-select-sheet__item--danger`:``}`,"aria-pressed":r,"aria-labelledby":i,"aria-describedby":a||void 0,disabled:t.disabled,onClick:()=>M(t.id),children:[t.icon?(0,Z.jsx)(`span`,{className:`mobile-select-sheet__item-icon`,"aria-hidden":`true`,children:t.icon}):null,(0,Z.jsxs)(`span`,{className:`mobile-select-sheet__item-copy`,children:[(0,Z.jsx)(`span`,{id:i,className:`mobile-select-sheet__item-label`,children:t.label}),t.description?(0,Z.jsx)(`span`,{id:`${e.id}-${t.id}-description`,className:`mobile-select-sheet__item-description`,children:t.description}):null,t.meta?(0,Z.jsx)(`span`,{id:`${e.id}-${t.id}-meta`,className:`mobile-select-sheet__item-meta`,children:t.meta}):null]}),t.badge?(0,Z.jsx)(Vm,{color:`neutral`,caps:!1,className:`mobile-select-sheet__item-badge`,children:t.badge}):null]});return t.trailingAction?(0,Z.jsxs)(`div`,{className:`mobile-select-sheet__item-row`,"data-selected":r?`true`:`false`,children:[o,(0,Z.jsx)(Q,{"aria-label":t.trailingAction.ariaLabel,className:`mobile-select-sheet__item-side-action ${t.trailingAction.tone===`danger`?`mobile-select-sheet__item-side-action--danger`:``}`,disabled:t.disabled||t.trailingAction.disabled,icon:(0,Z.jsx)(`span`,{className:`mobile-select-sheet__item-side-action-icon`,children:t.trailingAction.icon}),onClick:()=>P(t.trailingAction.onAction),size:`lg`,variant:`ghost`})]},t.id):(0,Z.jsx)(`div`,{"data-selected":r?`true`:`false`,children:o},t.id)}):e.items.map(t=>{let n=`${e.id}-${t.id}-label`,r=t.description?`${e.id}-${t.id}-description`:void 0;return(0,Z.jsxs)(`button`,{type:`button`,className:`mobile-select-sheet__item mobile-select-sheet__item--action ${t.tone===`danger`?`mobile-select-sheet__item--danger`:``}`,"aria-labelledby":n,"aria-describedby":r,disabled:t.disabled,onClick:()=>N(t.onAction),children:[t.icon?(0,Z.jsx)(`span`,{className:`mobile-select-sheet__item-icon`,"aria-hidden":`true`,children:t.icon}):null,(0,Z.jsxs)(`span`,{className:`mobile-select-sheet__item-copy`,children:[(0,Z.jsx)(`span`,{id:n,className:`mobile-select-sheet__item-label`,children:t.label}),t.description?(0,Z.jsx)(`span`,{id:r,className:`mobile-select-sheet__item-description`,children:t.description}):null]})]},t.id)})})]},e.id)),k?(0,Z.jsx)(`div`,{className:`mobile-select-sheet__section`,children:(0,Z.jsx)(`div`,{className:`mobile-select-sheet__list`,children:(()=>{let e=`mobile-select-create-label`;return(0,Z.jsx)(`button`,{type:`button`,className:`mobile-select-sheet__item mobile-select-sheet__item--create`,"aria-labelledby":e,disabled:A,onClick:F,children:(0,Z.jsx)(`span`,{className:`mobile-select-sheet__item-copy`,children:(0,Z.jsx)(`span`,{id:e,className:`mobile-select-sheet__item-label`,children:c?.label(x.trim())})})})})()})}):null,!O&&!k?(0,Z.jsx)(Ip,{className:`mobile-select-sheet__empty`,style:hm,title:(0,Z.jsx)(`div`,{style:vm,children:w})}):null]})})]});return r===`inline`?(0,Z.jsxs)(`div`,{className:`mobile-inline-sheet`,role:`dialog`,"aria-label":e,children:[(0,Z.jsx)(`div`,{className:`mobile-inline-sheet__handle`,"aria-hidden":`true`}),(0,Z.jsx)(`div`,{className:`mobile-inline-sheet__header`,children:(0,Z.jsx)(mm,{title:e,titleAs:`h3`,onBack:m,backLabel:_(`action.back`)})}),(0,Z.jsx)(`div`,{className:`mobile-inline-sheet__body`,children:(0,Z.jsx)(`div`,{className:`mobile-select-sheet mobile-select-sheet--inline`,children:ee})})]}):(0,Z.jsx)(ep,{title:e,body:(0,Z.jsx)(`div`,{className:`mobile-select-sheet`,children:ee}),onClose:g,kicker:p,onBack:m,bodyClassName:`mobile-sheet__body--flush`,fullscreen:!0})}var bm={root:`_root_skc9v_1`,native:`_native_skc9v_6`,mobileTrigger:`_mobileTrigger_skc9v_11`,mobileValue:`_mobileValue_skc9v_20`,mobileIcon:`_mobileIcon_skc9v_25`,listbox:`_listbox_skc9v_30`,option:`_option_skc9v_46`,optionSelected:`_optionSelected_skc9v_60`,optionDisabled:`_optionDisabled_skc9v_64`},xm={sm:Lp.sm,md:void 0,lg:Lp.lg},Sm={sm:`input-sm`,md:void 0,lg:`input-lg`};function Cm(e,t,n){return n||(t===void 0?``:e.find(e=>e.value===t)?.label??t)}function wm({className:e,invalid:t,size:n}){return q(Lp.input,xm[n],`input`,Sm[n],`mobile-select-trigger`,bm.mobileTrigger,t?Lp.invalid:void 0,e)}function Tm({ariaLabel:e,ariaLabelledBy:t,includeValueInAriaLabel:n,selectedLabel:r,valueId:i}){let a=t?`${t} ${i}`:void 0;return{resolvedAriaLabel:!t&&e&&n?`${e} ${r}`:e,resolvedAriaLabelledBy:a}}function Em(e){let t=Fr(),n=(0,B.useId)(),[r,i]=(0,B.useState)(!1),a=(0,B.useRef)(null),o=(0,B.useRef)(null),s=(0,B.useRef)(null),c=(0,B.useRef)(`selected`),l=e.size??`md`,u=e.invalid===void 0?e[`aria-invalid`]:e.invalid?`true`:`false`,d=e.mobile!==!0&&e.desktopMode===`listbox`,f=d?t:`desktop`,p=d&&f===`desktop`;if((0,B.useEffect)(()=>{if(!r||!p)return;let e=e=>{e.target instanceof Node&&(a.current?.contains(e.target)||i(!1))};return document.addEventListener(`pointerdown`,e),()=>{document.removeEventListener(`pointerdown`,e)}},[r,p]),(0,B.useEffect)(()=>{if(!r||!p)return;let e=Array.from(s.current?.querySelectorAll(`[role="option"]:not([aria-disabled="true"])`)??[]);e.length!==0&&(c.current===`last`?e.at(-1):s.current?.querySelector(`[role="option"][aria-selected="true"]:not([aria-disabled="true"])`)??e[0])?.focus()},[r,p,e.options,e.value]),(0,B.useEffect)(()=>{i(!1)},[d,f]),e.mobile){let{"aria-label":t,"aria-labelledby":r,className:i,disabled:a,id:o,invalid:s,onClick:c,onOpen:d,options:f,size:p,value:m,valueLabel:h,includeValueInAriaLabel:g=!0,..._}=e,v=Cm(f,m,h),y=`${o??n}-value`,{resolvedAriaLabel:b,resolvedAriaLabelledBy:x}=Tm({ariaLabel:t,ariaLabelledBy:r,includeValueInAriaLabel:g,selectedLabel:v,valueId:y});return(0,Z.jsxs)(`button`,{..._,id:o,type:`button`,disabled:a,"aria-invalid":u,"aria-label":b,"aria-haspopup":_[`aria-haspopup`]??`dialog`,"aria-labelledby":x||void 0,className:wm({className:i,invalid:s,size:l}),onClick:e=>{c?.(e),!e.defaultPrevented&&!a&&!e.currentTarget.disabled&&d()},children:[(0,Z.jsx)(`span`,{id:y,className:q(`mobile-select-trigger__value`,bm.mobileValue),children:v}),(0,Z.jsx)(Hd,{size:16,className:q(`mobile-select-trigger__icon`,bm.mobileIcon),"aria-hidden":`true`})]})}if(e.desktopMode===`listbox`){let{"aria-label":t,"aria-labelledby":d,className:m,desktopMode:h,disabled:g,id:_,invalid:v,mobileSheetPresentation:y=`sheet`,mobileSheetTitle:b,onClick:x,onKeyDown:S,onValueChange:C,options:w,size:T,value:E,...D}=e,O=Cm(w,E),k=`${_??n}-listbox`,A=`${_??n}-value`,{resolvedAriaLabel:j,resolvedAriaLabelledBy:M}=Tm({ariaLabel:t,ariaLabelledBy:d,includeValueInAriaLabel:!0,selectedLabel:O,valueId:A}),N=(e=!1)=>{i(!1),e&&o.current?.focus()},P=e=>{C?.(e),N(!0)},F=()=>Array.from(s.current?.querySelectorAll(`[role="option"]:not([aria-disabled="true"])`)??[]),ee=e=>{if(e.key===`Tab`){N(!1);return}if(e.key===`Escape`){e.preventDefault(),N(!0);return}let t=F();if(t.length===0)return;let n=t.findIndex(e=>e===document.activeElement);if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let r=e.key===`ArrowUp`?t.length-1:0;t[n===-1?r:(n+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus();return}if(e.key===`Home`||e.key===`End`){e.preventDefault(),t[e.key===`Home`?0:t.length-1]?.focus();return}if(e.key!==`Enter`&&e.key!==` `)return;let r=e.target instanceof HTMLElement?e.target.closest(`[role="option"][data-option-value]`):null,i=r?.dataset.optionValue;!i||r?.getAttribute(`aria-disabled`)===`true`||(e.preventDefault(),P(i))},te=e=>{if(S?.(e),!(e.defaultPrevented||g||e.currentTarget.disabled)){if(e.key===`Escape`){N(!0);return}f===`desktop`&&(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),c.current=e.key===`ArrowUp`?`last`:`selected`,i(!0))}},ne=y===`inline`?()=>i(!1):void 0;return(0,Z.jsxs)(`div`,{ref:a,className:bm.root,children:[(0,Z.jsxs)(`button`,{...D,ref:o,id:_,type:`button`,disabled:g,"aria-controls":p&&r?k:void 0,"aria-expanded":r,"aria-invalid":u,"aria-label":j,"aria-haspopup":f===`mobile`?`dialog`:`listbox`,"aria-labelledby":M||void 0,className:wm({className:m,invalid:v,size:l}),onClick:e=>{x?.(e),!e.defaultPrevented&&!g&&!e.currentTarget.disabled&&(r||(c.current=`selected`),i(e=>!e))},onKeyDown:te,children:[(0,Z.jsx)(`span`,{id:A,className:q(`mobile-select-trigger__value`,bm.mobileValue),children:O}),(0,Z.jsx)(Hd,{size:16,className:q(`mobile-select-trigger__icon`,bm.mobileIcon),"aria-hidden":`true`})]}),p&&r?(0,Z.jsx)(`div`,{id:k,ref:s,role:`listbox`,"aria-label":t,"aria-labelledby":d,className:bm.listbox,onKeyDown:ee,children:w.map(e=>{let t=e.value===E;return(0,Z.jsx)(`div`,{role:`option`,id:`${k}-${e.value}`,"aria-disabled":e.disabled?`true`:void 0,"aria-selected":t,className:q(bm.option,t?bm.optionSelected:void 0,e.disabled?bm.optionDisabled:void 0),"data-option-value":e.value,tabIndex:-1,onClick:()=>{e.disabled||P(e.value)},children:e.label},e.value)})}):null,f===`mobile`&&r?(0,Z.jsx)(ym,{title:b,presentation:y,sections:[{kind:`options`,id:`${_??n}-options`,items:w.map(e=>({id:e.value,label:e.label,disabled:e.disabled}))}],selectedId:E,onBack:ne,onClose:()=>i(!1),onSelect:e=>{C?.(e)}}):null]})}let{className:m,htmlSize:h,invalid:g,onChange:_,onValueChange:v,options:y,size:b,...x}=e;return(0,Z.jsx)(`select`,{...x,size:h,"aria-invalid":u,className:q(Lp.input,xm[l],`input`,Sm[l],bm.native,g?Lp.invalid:void 0,m),onChange:e=>{_?.(e),v?.(e.target.value)},children:y.map(e=>(0,Z.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))})}var Dm={spinner:`_spinner_16qlq_1`},Om={sm:`12px`,md:`16px`,lg:`20px`};function km({className:e,label:t,size:n=`md`,style:r,...i}){return(0,Z.jsx)(`span`,{...i,"aria-label":t,className:q(Dm.spinner,`animate-spin`,e),role:`status`,style:{"--spinner-size":Om[n],...r}})}var Am={dot:`_dot_vc87z_1`,pulse:`_pulse_vc87z_12`,statusDotPulse:`_statusDotPulse_vc87z_1`},jm={success:`var(--color-success)`,warning:`var(--color-warning)`,error:`var(--color-error)`,info:`var(--color-info)`,neutral:`var(--text-tertiary)`},Mm={sm:`6px`,md:`8px`,lg:`10px`};function Nm({className:e,pulse:t=!1,size:n=`md`,style:r,tone:i=`neutral`,"aria-hidden":a=!0,...o}){return(0,Z.jsx)(`span`,{...o,"aria-hidden":a,className:q(Am.dot,t?Am.pulse:void 0,e),style:{"--status-dot-current-color":jm[i],"--status-dot-current-size":Mm[n],...r}})}var Pm={switch:`_switch_1j7uc_1`,track:`_track_1j7uc_26`,checked:`_checked_1j7uc_51`,thumb:`_thumb_1j7uc_56`},Fm={sm:{trackWidth:`32px`,trackHeight:`18px`,thumbSize:`14px`,offset:`2px`,translateX:`14px`},md:{trackWidth:`36px`,trackHeight:`20px`,thumbSize:`16px`,offset:`2px`,translateX:`16px`}};function Im({checked:e,className:t,disabled:n=!1,onCheckedChange:r,onClick:i,size:a=`md`,style:o,...s}){let c=Fm[a];return(0,Z.jsx)(`button`,{...s,"aria-checked":e,className:q(Pm.switch,e?Pm.checked:void 0,t),disabled:n,onClick:t=>{i?.(t),!(n||t.defaultPrevented)&&r(!e)},role:`switch`,style:{"--switch-track-width":c.trackWidth,"--switch-track-height":c.trackHeight,"--switch-thumb-size":c.thumbSize,"--switch-thumb-offset":c.offset,"--switch-thumb-translate-x":c.translateX,...o},type:`button`,children:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:Pm.track,children:(0,Z.jsx)(`span`,{className:Pm.thumb})})})}var Lm={tag:`_tag_27mfm_1`,sm:`_sm_27mfm_16`,noCaps:`_noCaps_27mfm_22`,blue:`_blue_27mfm_26`,green:`_green_27mfm_32`,amber:`_amber_27mfm_38`,pink:`_pink_27mfm_44`,purple:`_purple_27mfm_50`,neutral:`_neutral_27mfm_56`},Rm={blue:Lm.blue,green:Lm.green,amber:Lm.amber,pink:Lm.pink,purple:Lm.purple,neutral:Lm.neutral},zm={blue:`badge-blue`,green:`badge-green`,amber:`badge-amber`,pink:`badge-pink`,purple:`badge-purple`,neutral:`badge-gray`},Bm={sm:Lm.sm,md:void 0};function Vm({caps:e=!0,className:t,color:n=`neutral`,size:r=`md`,...i}){return(0,Z.jsx)(`span`,{...i,className:q(Lm.tag,Rm[n],Bm[r],e?void 0:Lm.noCaps,`badge`,zm[n],t)})}var Hm={input:`_input_1syx3_1`,textarea:`_textarea_1syx3_27`,lg:`_lg_1syx3_34`,invalid:`_invalid_1syx3_40`},Um={md:void 0,lg:Hm.lg},Wm={md:void 0,lg:`textarea-lg`};function Gm(e,t){if(typeof e==`function`){e(t);return}e&&(e.current=t)}function Km(e){e&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`)}var qm=(0,B.forwardRef)(function({autoResize:e=!1,className:t,invalid:n,onChange:r,size:i=`md`,...a},o){let s=(0,B.useRef)(null),c=n===void 0?a[`aria-invalid`]:n?`true`:`false`;return(0,B.useEffect)(()=>{!e||!s.current||Km(s.current)},[e,a.defaultValue,a.value]),(0,Z.jsx)(`textarea`,{...a,"aria-invalid":c,className:q(Hm.input,Hm.textarea,Um[i],`input`,`textarea`,Wm[i],n?Hm.invalid:void 0,t),onChange:t=>{e&&Km(t.currentTarget),r?.(t)},ref:e=>{s.current=e,Gm(o,e)}})}),Jm={viewport:`_viewport_d9ios_1`,mobile:`_mobile_d9ios_14`,toast:`_toast_d9ios_24`,slideIn:`_slideIn_d9ios_1`,clickable:`_clickable_d9ios_41`,success:`_success_d9ios_50`,error:`_error_d9ios_54`,warning:`_warning_d9ios_58`,info:`_info_d9ios_62`,icon:`_icon_d9ios_66`,content:`_content_d9ios_87`,title:`_title_d9ios_95`,body:`_body_d9ios_102`,action:`_action_d9ios_110`,close:`_close_d9ios_126`},Ym={success:Jm.success,error:Jm.error,warning:Jm.warning,info:Jm.info},Xm={success:`toast--success`,error:`toast--error`,warning:`toast--warning`,info:`toast--info`};function Zm({children:e,className:t,mobile:n=!1,...r}){return(0,Z.jsx)(`div`,{...r,className:q(Jm.viewport,n?Jm.mobile:void 0,`toast-container`,n?`toast-container--mobile`:void 0,t),children:e})}function Qm({actionLabel:e,className:t,closeLabel:n=`Dismiss`,description:r,icon:i,onAction:a,onClick:o,onDismiss:s,title:c,tone:l,...u}){let d=typeof o==`function`,{"aria-live":f,...p}=u;return(0,Z.jsxs)(`div`,{...p,"aria-live":f,className:q(Jm.toast,Ym[l],d?Jm.clickable:void 0,`toast`,Xm[l],t),onClick:o,role:`alert`,children:[i?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:q(Jm.icon,`toast__icon`),children:i}):null,(0,Z.jsxs)(`div`,{className:q(Jm.content,`toast__content`),children:[(0,Z.jsx)(`span`,{className:q(Jm.title,`toast__title`),children:c}),r?(0,Z.jsx)(`span`,{className:q(Jm.body,`toast__body`),children:r}):null]}),e&&a?(0,Z.jsx)(`button`,{className:Jm.action,onClick:e=>{e.stopPropagation(),a()},type:`button`,children:e}):null,(0,Z.jsx)(Q,{"aria-label":n,className:q(Jm.close,`toast__close`),icon:(0,Z.jsx)(Hf,{size:14}),onClick:e=>{e.stopPropagation(),s()},size:`sm`})]})}var $m={disabledTriggerWrapper:`_disabledTriggerWrapper_15c9s_1`,tooltip:`_tooltip_15c9s_5`};function eh(e){return(0,B.isValidElement)(e)}function $({children:e,content:t,disabled:n=!1}){let r=B.Children.only(e),i=Fr(),a=(0,B.useId)(),o=(0,B.useRef)(null),s=(0,B.useRef)(null),[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)({left:0,top:0});if(!eh(r))return r;let m=!n&&i===`desktop`,h=m&&(c||u),g=r.props.disabled===!0,_=r.props[`aria-describedby`],v=(0,B.useMemo)(()=>h?[_,a].filter(Boolean).join(` `):_,[_,h,a]);(0,B.useLayoutEffect)(()=>{if(!h||!o.current||!s.current)return;let e=o.current.getBoundingClientRect(),t=s.current.getBoundingClientRect(),n=e.left+e.width/2-t.width/2,r=Math.max(8,window.innerWidth-t.width-8),i=Math.min(r,Math.max(8,n)),a=e.top-t.height-8,c=e.bottom+8,l=Math.max(8,window.innerHeight-t.height-8);p({left:i,top:Math.max(8,a>=8?a:Math.min(l,c))})},[h]);let y=g?(0,B.cloneElement)(r,{"aria-describedby":v}):(0,B.cloneElement)(r,{"aria-describedby":v,onBlur:e=>{r.props.onBlur?.(e),d(!1)},onFocus:e=>{r.props.onFocus?.(e),!e.defaultPrevented&&m&&(o.current=e.currentTarget,d(!0))},onMouseEnter:e=>{r.props.onMouseEnter?.(e),!e.defaultPrevented&&m&&(o.current=e.currentTarget,l(!0))},onMouseLeave:e=>{r.props.onMouseLeave?.(e),l(!1)}});return(0,Z.jsxs)(Z.Fragment,{children:[g?(0,Z.jsx)(`span`,{className:$m.disabledTriggerWrapper,onMouseEnter:e=>{!e.defaultPrevented&&m&&(o.current=e.currentTarget,l(!0))},onMouseLeave:()=>{l(!1)},children:y}):y,h?(0,Z.jsx)(Td,{children:(0,Z.jsx)(`div`,{className:q($m.tooltip),id:a,ref:s,role:`tooltip`,style:{left:`${f.left}px`,top:`${f.top}px`},children:t})}):null]})}var th={minHeight:`auto`,padding:0,gap:`var(--sp-5)`,alignItems:`stretch`,textAlign:`left`};function nh(){let e=X(),[,t]=Se(Ur),n=V(Hr),r=V($u),i=Fr()===`mobile`,[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(null),[l,u]=(0,B.useState)(!1),[d,f]=(0,B.useState)(r===null),[p,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(!1);(0,B.useEffect)(()=>{if(r!==null){f(!1),m(!1),g(r===!1),r===!1&&t(!0);return}(async()=>{try{let e=await(await fetch(`/auth/status`)).json();m(!1),g(e.authEnabled===!1),e.authEnabled===!1||e.authenticated===!0?t(!0):t(!1)}catch{m(!0),g(!1)}finally{f(!1)}})()},[r,t]);let _=e(d?`status.connecting`:p?`status.unavailable`:h?`auth.status_not_configured`:`auth.description`),v=e(d?`auth.status_loading`:p?`auth.status_unavailable`:h?`auth.status_not_configured`:`auth.hint`),y=`auth-status-panel${p||s?` auth-status-panel-error`:``}`,b=e(d||l?`status.connecting`:`action.confirm`),x=t=>typeof t!=`number`||Number.isNaN(t)?e(`auth.blocked_generic`):e(`auth.blocked_until`,{time:Zf(t,n,{year:`numeric`,month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1})});return(0,Z.jsx)(`div`,{className:[`welcome-container`,`auth-screen`,i?`welcome-container--mobile auth-screen--mobile`:``].filter(Boolean).join(` `),children:(0,Z.jsxs)(`div`,{className:[`welcome-card`,`auth-card-shell`,i?`welcome-card--mobile auth-card-shell--mobile`:``].filter(Boolean).join(` `),children:[(0,Z.jsx)(Ip,{style:th,title:(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`welcome-kicker`,children:`CODER STUDIO`}),(0,Z.jsx)(`h1`,{className:`welcome-title`,children:e(`app.name`)})]}),description:(0,Z.jsx)(`p`,{className:`welcome-body auth-card-desc`,children:_})}),(0,Z.jsxs)(`div`,{className:y,children:[(0,Z.jsx)(`div`,{className:`auth-status-eyebrow`,children:e(`auth.status_title`)}),(0,Z.jsx)(`p`,{className:`auth-status-detail`,children:s??v})]}),(0,Z.jsxs)(`form`,{className:`auth-form`,onSubmit:async n=>{n.preventDefault(),u(!0),c(null);try{let e=await fetch(`/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({password:a})});if(!e.ok){let t=await e.json().catch(()=>({error:`Login failed`}));if(t?.blocked===!0){c(x(t.blockedUntil));return}c(t.error||`Login failed`);return}let n=await e.json();(n.authEnabled===!1||n.ok)&&t(!0)}catch{c(e(`error.network`))}finally{u(!1)}},children:[(0,Z.jsx)(Bp,{className:`auth-input`,type:`password`,size:`lg`,value:a,onChange:e=>o(e.target.value),"aria-label":e(`settings.auth.password`),placeholder:e(`settings.auth.password`)}),(0,Z.jsx)(gp,{className:`auth-submit`,variant:`primary`,size:`lg`,type:`submit`,disabled:d||l||!a.trim(),children:b})]})]})})}var rh={claude:`Claude`,codex:`Codex`};function ih(e){return rh[e]?rh[e]:e?e.charAt(0).toUpperCase()+e.slice(1):`Agent`}function ah(e){if(!e)return``;let t=e.name?.trim();if(t)return oh(t);let n=e.path?.trim();return n?oh(n):``}function oh(e){let t=e.replace(/[/\\]+$/,``),n=t.split(/[/\\]/);return n[n.length-1]||t}function sh(e){if(!Number.isFinite(e)||e<0)return``;if(e<1e3)return`<1s`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return n<60?r===0?`${n}m`:`${n}m ${r}s`:`${Math.floor(n/60)}h ${n%60}m`}var ch=nd(e=>z(null)),lh=nd(e=>z(!1)),uh=nd(e=>z(new Set)),dh=nd(e=>z({})),fh=nd(e=>z(null)),ph=nd(e=>z(0));nd(e=>z(t=>{let n=t(fh(e));return n?t(dh(e))[n]??null:null})),nd(e=>z(t=>{let n=t(dh(e));return Object.values(n).filter(e=>e.isDirty).length}));var mh=nd(e=>z(null)),hh=nd(e=>z(null)),gh=nd(e=>z(!1));nd(e=>z(t=>{let n=t(mh(e));return n?n.staged.length>0||n.modified.length>0||n.untracked.length>0||n.deleted.length>0:!1})),nd(e=>z(t=>{let n=t(mh(e));return n?{staged:n.staged.length,unstaged:n.modified.length+n.deleted.length,untracked:n.untracked.length,total:n.staged.length+n.modified.length+n.untracked.length+n.deleted.length}:{staged:0,unstaged:0,untracked:0,total:0}}));var _h=nd(e=>z({current:``,branches:[],loading:!1})),vh=z({visible:!1,inputValue:``}),yh=nd(e=>Br(`coder-studio:git-commit-draft:${e}`,``)),bh=nd(e=>z({items:[],loading:!1})),xh=nd(e=>z({status:`idle`})),Sh=Br(`ui.focusMode`,!1),Ch=Br(`ui.leftPanelWidth`,280),wh=Br(`ui.bottomPanelHeight`,200),Th=Br(`ui.sidebarCollapsed`,!1),Eh=Br(`ui.terminalPanelVisible`,!0);function Dh(e){let t=X(),n=Gt(),r=Jt(),i=V(ed),a=H(rd),o=H(id),s=H(ad),c=H(od),l=H(sd),[u,d]=(0,B.useState)(``),[f,p]=(0,B.useState)([]),[m,h]=(0,B.useState)(null),[g,_]=(0,B.useState)(null),[v,y]=(0,B.useState)(!1),[b,x]=(0,B.useState)(!0),[S,C]=(0,B.useState)(null),w=t(`workspace.launch.title`),T=t(`workspace.launch.hint`),E=[`/`,`~`,`/home/spencer`];(0,B.useEffect)(()=>{let t=t=>{t.key===`Escape`&&e()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e]);let D=(0,B.useCallback)(async e=>{x(!0),C(null);try{let n=await i(`workspace.browse`,{path:e});if(!n.ok||!n.data){C(n.error?.message||t(`workspace.launch.browse_failed`));return}d(n.data.currentPath),p(n.data.directories),h(n.data.parentPath)}catch(e){C(e instanceof Error?e.message:String(e))}finally{x(!1)}},[i]);(0,B.useEffect)(()=>{D()},[D]);let O=(0,B.useCallback)(e=>{_(null),D(e)},[D]),k=(0,B.useCallback)(e=>{_(e)},[]),A=(0,B.useCallback)(async()=>{if(!g){C(t(`workspace.launch.select_required`));return}y(!0),C(null);try{let u=await i(`workspace.open`,{path:g});u.ok&&u.data?.id?(a(u.data.id),o(e=>({...e,[u.data.id]:u.data})),s(e=>e.includes(u.data.id)?e:[u.data.id,...e]),c(`ready`),l(null),n.pathname!==`/workspace`&&r(`/workspace`),e()):C(u.error?.message||t(`workspace.launch.open_failed`))}catch(e){C(e instanceof Error?e.message:String(e))}finally{y(!1)}},[i,n.pathname,r,e,g,a,s,o,l,c,t]);return{browsing:b,currentPath:u,directories:f,error:S,getShortPath:(0,B.useCallback)(e=>{if(e===`~`)return`~`;if(e===`/`)return`/`;let t=e.match(/^\/home\/[^/]+/);return t?e.replace(t[0],`~`):e},[]),handleNavigate:O,handleOpen:A,handleSelect:k,launchHint:T,launchTitle:w,loading:v,parentPath:m,rootPaths:E,selectedPath:g}}function Oh(e,t){let n=V(Ku),[r,i]=(0,B.useState)(`status`),[a,o]=(0,B.useState)(null),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)([]),[d,f]=(0,B.useState)(!1),[p,m]=(0,B.useState)(null);return(0,B.useEffect)(()=>{if(!t||!n||!e){o(null),c(``),u([]);return}f(!0),m(null),(async()=>{try{r===`status`?o((await n.sendCommand(`worktree.status`,{workspaceId:e,worktreePath:t.path})).status):r===`diff`?c((await n.sendCommand(`worktree.diff`,{workspaceId:e,worktreePath:t.path})).diff):r===`tree`&&u((await n.sendCommand(`worktree.tree`,{workspaceId:e,worktreePath:t.path})).tree)}catch(e){m(e instanceof Error?e.message:`Failed to load data`)}finally{f(!1)}})()},[r,e,t,n]),{activeTab:r,diff:s,error:p,handleTabChange:(0,B.useCallback)(e=>{i(e)},[]),loading:d,status:a,tree:l}}var kh={minHeight:`auto`,padding:`var(--sp-6)`,gap:0},Ah={padding:`var(--sp-8)`,gap:`var(--sp-2)`},jh={margin:0,color:`var(--text-tertiary)`,fontWeight:`var(--font-normal)`},Mh={position:`absolute`,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function Nh({onClose:e}){let t=Fr()===`mobile`,n=X(),{browsing:r,currentPath:i,directories:a,error:o,getShortPath:s,handleNavigate:c,handleOpen:l,handleSelect:u,launchHint:d,launchTitle:f,loading:p,parentPath:m,rootPaths:h,selectedPath:g}=Dh(e),_=(0,Z.jsxs)(`div`,{className:`launch-body`,children:[(0,Z.jsxs)(`div`,{className:`folder-picker`,children:[(0,Z.jsxs)(`div`,{className:`fp-toolbar`,children:[(0,Z.jsxs)(`button`,{className:`fp-btn`,onClick:()=>c(`~`),children:[(0,Z.jsx)(ff,{size:12}),n(`workspace.launch.home_directory`)]}),m&&(0,Z.jsxs)(`button`,{className:`fp-btn`,onClick:()=>c(m),children:[(0,Z.jsx)(zd,{size:12}),n(`workspace.launch.go_up`)]})]}),(0,Z.jsxs)(`div`,{className:`fp-root-chips`,children:[h.map(e=>(0,Z.jsx)(`span`,{className:`fp-chip ${i===e?`active`:``}`,onClick:()=>c(e),children:e},e)),i&&!h.includes(i)&&(0,Z.jsx)(`span`,{className:`fp-chip active`,children:s(i)})]}),(0,Z.jsx)(`div`,{className:`fp-dir-list`,children:r?(0,Z.jsx)(Ip,{className:`directory-loading`,icon:(0,Z.jsx)(km,{label:n(`common.loading`)}),style:Ah,title:(0,Z.jsx)(`span`,{style:Mh,children:n(`common.loading`)})}):a.length===0?(0,Z.jsx)(Ip,{className:`directory-empty`,style:kh,title:(0,Z.jsx)(`p`,{style:jh,children:n(`workspace.launch.no_directories`)})}):a.map(e=>(0,Z.jsxs)(`div`,{className:`fp-dir ${g===e.path?`selected`:``}`,onClick:()=>u(e.path),onDoubleClick:()=>c(e.path),children:[(0,Z.jsx)(`span`,{className:`fp-dir-icon`,children:(0,Z.jsx)(lf,{size:14})}),(0,Z.jsx)(`span`,{className:`fp-dir-name ${g===e.path?`selected`:``}`,children:e.name}),e.itemCount!==void 0&&(0,Z.jsx)(`span`,{className:`fp-dir-hint`,children:n(`workspace.launch.items_count`,{count:e.itemCount})}),g===e.path&&(0,Z.jsx)(`button`,{className:`fp-dir-action`,type:`button`,"aria-label":n(`workspace.launch.enter_folder`,{name:e.name}),onClick:t=>{t.stopPropagation(),c(e.path)},children:n(`workspace.launch.enter_folder_action`)})]},e.path))})]}),o&&(0,Z.jsx)(`div`,{className:`form-error`,style:{marginTop:`var(--sp-3)`},children:o})]}),v=(0,Z.jsx)(`div`,{className:`mobile-launch-sheet__footer`,children:(0,Z.jsx)(`button`,{className:`launch-start-btn launch-start-btn--mobile`,onClick:()=>void l(),disabled:p||!g,children:n(p?`workspace.launch.starting`:`workspace.launch.start`)})});return t?(0,Z.jsx)(ep,{kicker:n(`workspace.launch.kicker`),title:f,body:_,footer:v,fullscreen:!0,bodyClassName:`mobile-sheet__body--flush mobile-sheet__body--fullscreen mobile-launch-sheet`,contentClassName:`mobile-sheet--launch`,onClose:e}):(0,Z.jsx)(`div`,{className:`launch-overlay`,onClick:e,children:(0,Z.jsxs)(`div`,{className:`launch-modal`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsxs)(`div`,{className:`launch-header`,children:[(0,Z.jsxs)(`div`,{className:`launch-header-left`,children:[(0,Z.jsx)(`div`,{className:`launch-kicker`,children:n(`workspace.launch.kicker`)}),(0,Z.jsx)(`div`,{className:`launch-title`,children:f}),(0,Z.jsx)(`div`,{className:`launch-hint`,children:d})]}),(0,Z.jsx)(`div`,{className:`launch-header-right`,children:(0,Z.jsx)(Q,{"aria-label":n(`action.close`),className:`launch-close-btn`,icon:(0,Z.jsx)(Hf,{size:16}),onClick:e,size:`sm`})})]}),_,(0,Z.jsx)(`div`,{className:`launch-footer`,children:(0,Z.jsx)(`button`,{className:`launch-start-btn launch-start-btn--desktop`,onClick:()=>void l(),disabled:p||!g,children:n(p?`workspace.launch.starting`:`workspace.launch.start`)})})]})})}var Ph={minHeight:`auto`,padding:`var(--sp-8)`,gap:0},Fh={margin:0,color:`var(--text-tertiary)`,fontWeight:`var(--font-normal)`};function Ih(){let e=X(),t=Gt(),n=Jt(),r=Fr()===`mobile`,[i,a]=Se(Wr),[o,s]=Se(Sh),[c,l]=Se(Th),[u,d]=Se(Eh),[f,p]=Se(wh),m=V(dd),h=H(rd),g=V(ud),[_,v]=(0,B.useState)(``),[y,b]=(0,B.useState)(0),[x,S]=(0,B.useState)(!1),C=(0,B.useRef)(null),w=Lh({shellKind:r?`mobile`:`desktop`,focusMode:o,setFocusMode:s,sidebarCollapsed:c,setSidebarCollapsed:l,terminalPanelVisible:u,setTerminalPanelVisible:d,bottomPanelHeight:f,setBottomPanelHeight:p,activeWorkspaceId:m,setActiveWorkspaceId:h,workspaces:g,locationPathname:t.pathname,navigate:n,t:e,setShowWorkspaceLaunch:e=>{e&&a(!1),S(e)}}).filter(e=>{let t=_.toLowerCase();return e.label.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.shortcut&&e.shortcut.toLowerCase().includes(t)});(0,B.useEffect)(()=>{i&&(C.current?.focus(),v(``),b(0))},[i]);let T=(0,B.useCallback)(e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),b(e=>e<w.length-1?e+1:e);break;case`ArrowUp`:e.preventDefault(),b(e=>e>0?e-1:e);break;case`Enter`:e.preventDefault(),w[y]&&(w[y].action(),a(!1));break;case`Escape`:e.preventDefault(),a(!1);break}},[w,y,a]);(0,B.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),a(!i))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i,a]);let E=e=>{e.action(),a(!1)},D=(0,Z.jsxs)(`div`,{className:`command-palette-search`,children:[(0,Z.jsx)(jf,{size:16,className:`command-palette-search-icon`}),(0,Z.jsx)(`input`,{ref:C,type:`text`,className:`command-palette-input`,placeholder:e(`placeholder.command`),value:_,onChange:e=>{v(e.target.value),b(0)}})]}),O=(0,Z.jsx)(`div`,{className:`command-palette-list`,children:w.length>0?w.map((e,t)=>(0,Z.jsxs)(`div`,{className:`command-palette-item ${t===y?`command-palette-item-selected`:``}`,onClick:()=>E(e),onMouseEnter:()=>b(t),children:[(0,Z.jsxs)(`div`,{className:`command-palette-item-content`,children:[(0,Z.jsx)(`span`,{className:`command-palette-item-label`,children:e.label}),(0,Z.jsx)(`span`,{className:`command-palette-item-desc`,children:e.description})]}),e.shortcut?(0,Z.jsx)(`span`,{className:`command-palette-item-shortcut`,children:e.shortcut}):null]},e.id)):(0,Z.jsx)(Ip,{className:`command-palette-empty`,style:Ph,title:(0,Z.jsx)(`p`,{style:Fh,children:e(`command.no_results`)})})});return x?(0,Z.jsx)(Nh,{onClose:()=>S(!1)}):i?r?(0,Z.jsx)(ep,{title:`Quick Actions`,kicker:e(`command.palette`).toUpperCase(),onClose:()=>a(!1),bodyClassName:`mobile-sheet__body--flush`,contentClassName:`command-palette-sheet-layer`,body:(0,Z.jsx)(`div`,{className:`command-palette-sheet-shell`,onKeyDown:T,children:(0,Z.jsxs)(`div`,{className:`command-palette-sheet`,children:[(0,Z.jsxs)(`div`,{className:`command-palette-sheet__search`,children:[D,(0,Z.jsxs)(`div`,{className:`command-palette-sheet__meta`,children:[(0,Z.jsx)(`span`,{className:`command-palette-hint`,children:e(`placeholder.command`)}),(0,Z.jsxs)(`span`,{className:`command-palette-meta`,children:[w.length,` actions`]})]})]}),O]})})}):(0,Z.jsx)(`div`,{className:`command-palette-overlay`,onClick:()=>a(!1),children:(0,Z.jsxs)(`div`,{className:`command-palette`,onClick:e=>e.stopPropagation(),onKeyDown:T,children:[(0,Z.jsxs)(`div`,{className:`command-palette-header`,children:[(0,Z.jsx)(`span`,{className:`command-palette-kicker`,children:e(`command.palette`).toUpperCase()}),(0,Z.jsxs)(`span`,{className:`command-palette-meta`,children:[w.length,` actions`]})]}),D,(0,Z.jsx)(`div`,{className:`command-palette-hint`,children:e(`placeholder.command`)}),O]})}):null}function Lh(e){let{shellKind:t,focusMode:n,setFocusMode:r,sidebarCollapsed:i,setSidebarCollapsed:a,terminalPanelVisible:o,setTerminalPanelVisible:s,bottomPanelHeight:c,setBottomPanelHeight:l,activeWorkspaceId:u,setActiveWorkspaceId:d,workspaces:f,locationPathname:p,navigate:m,t:h,setShowWorkspaceLaunch:g}=e,_=[{id:`new-workspace`,label:h(`workspace.open`),description:h(`workspace.open_hint`),shortcut:`Ctrl+N`,action:()=>{g(!0)}},{id:`open-home`,label:h(`workspace.title`),description:h(`action.back`),action:()=>m(`/`)},{id:`open-settings`,label:h(`action.settings`),description:h(`settings.title`),shortcut:`Ctrl+,`,action:()=>{m(`/settings`)}}];return t===`desktop`&&_.push({id:`toggle-focus-mode`,label:h(`tooltip.focus_mode`),description:h(n?`action.close`:`action.open`),shortcut:`F`,action:()=>r(!n)},{id:`enable-focus-mode`,label:`${h(`action.open`)} Focus Mode`,description:h(`tooltip.focus_mode`),action:()=>r(!0)},{id:`disable-focus-mode`,label:`${h(`action.close`)} Focus Mode`,description:h(`tooltip.focus_mode`),action:()=>r(!1)},{id:`toggle-sidebar`,label:h(`command.shortcut.toggle_sidebar`),description:h(i?`action.open`:`action.close`),action:()=>a(!i)},{id:`toggle-terminal`,label:h(`terminal.title`),description:h(o?`action.close`:`action.open`),action:()=>{s(!o),!o&&c===0&&l(200)}},{id:`show-terminal`,label:`${h(`action.open`)} ${h(`terminal.title`)}`,description:h(`command.shortcut.toggle_terminal`),action:()=>{s(!0),c===0&&l(200)}},{id:`hide-terminal`,label:`${h(`action.close`)} ${h(`terminal.title`)}`,description:h(`command.shortcut.toggle_terminal`),action:()=>s(!1)}),f.forEach(e=>{let t=ah(e)||e.id;_.push({id:`switch-workspace-${e.id}`,label:`${h(`workspace.title`)}: ${t}`,description:e.path||e.id,action:()=>{d(e.id),p!==`/workspace`&&m(`/workspace`)}})}),u&&_.push({id:`go-home`,label:h(`action.back`),description:h(`workspace.no_workspace`),action:()=>{d(null),m(`/`)}}),_}var Rh={minHeight:`auto`,padding:0,gap:`var(--sp-5)`};function zh(){let e=X(),t=Jt(),n=Gt(),r=Fr()===`mobile`;return(0,Z.jsx)(`div`,{className:`welcome-container ${r?`welcome-container--mobile`:``}`,children:(0,Z.jsxs)(`div`,{className:`welcome-card ${r?`welcome-card--mobile`:``}`,children:[(0,Z.jsx)(Ip,{style:Rh,title:(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`welcome-kicker`,children:e(`not_found.kicker`)}),(0,Z.jsx)(`h1`,{className:`welcome-title`,children:e(`not_found.title`)})]}),description:(0,Z.jsx)(`div`,{className:`welcome-content`,children:(0,Z.jsx)(`p`,{className:`welcome-body`,children:e(`not_found.description`)})}),action:(0,Z.jsx)(`button`,{className:`welcome-btn`,onClick:()=>t(`/`),children:(0,Z.jsx)(`span`,{children:e(`not_found.go_home`)})})}),(0,Z.jsxs)(`div`,{className:`auth-status-panel`,children:[(0,Z.jsx)(`div`,{className:`auth-status-eyebrow`,children:e(`not_found.path_label`)}),(0,Z.jsx)(`p`,{className:`auth-status-detail`,children:n.pathname})]})]})})}var Bh=Br(`ui.notificationPreferences`,{enabled:!0,soundEnabled:!0}),Vh=z([]),Hh=z(null,(e,t,n)=>{let r=`toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,i={...n,id:r,createdAt:Date.now()};t(Vh,e=>[...e.slice(-4),i])}),Uh=z(null,(e,t,n)=>{t(Vh,e=>e.filter(e=>e.id!==n))});function Wh(e){let{workspaceId:t,sessionId:n,setPendingFocus:r,setActiveWorkspaceId:i,navigate:a}=e;if(typeof window>`u`)return;i(t),r(n);let o=`/workspace`;window.location.pathname!==o&&(a?a(o):(window.history.pushState({},``,o),window.dispatchEvent(new PopStateEvent(`popstate`))))}var Gh={success:Jd,error:Kd,warning:Vf,info:mf};function Kh({toast:e}){let t=H(Uh),n=H(rd),r=H(Gr),i=Jt(),a=Gh[e.kind],o=e.duration??5e3;(0,B.useEffect)(()=>{if(o<=0)return;let n=setTimeout(()=>t(e.id),o);return()=>clearTimeout(n)},[e.id,o,t]);let s=(0,B.useCallback)(()=>{e.workspaceId&&e.sessionId?Wh({workspaceId:e.workspaceId,sessionId:e.sessionId,setPendingFocus:r,setActiveWorkspaceId:n,navigate:i}):e.workspaceId&&(n(e.workspaceId),window.location.pathname!==`/workspace`&&i(`/workspace`)),t(e.id)},[e.workspaceId,e.sessionId,i,t,n,r]);return(0,Z.jsx)(Qm,{description:e.body,icon:(0,Z.jsx)(a,{size:16}),onClick:e.workspaceId?s:void 0,onDismiss:()=>t(e.id),title:e.title,tone:e.kind})}function qh(){let e=V(Vh),t=Fr()===`mobile`;return e.length===0?null:(0,Z.jsx)(Zm,{"aria-live":`polite`,mobile:t,children:e.map(e=>(0,Z.jsx)(Kh,{toast:e},e.id))})}var Jh=4e3,Yh=new Set([`running`]),Xh=new Set([`idle`,`ended`]);function Zh(e,t,n,r,i){return n===e?r===`mobile`?i===t:!0:!1}function Qh(e,t){return e?`system`:t?`none`:`toast`}function $h(){return!!(typeof document<`u`&&document.hidden)}async function eg(){try{let e=new Audio(`/task-complete.wav`);e.volume=.75,await e.play();return}catch{}try{let e=window.AudioContext||window.webkitAudioContext;if(!e)return;let t=new e,n=t.currentTime,r=t.createOscillator(),i=t.createGain();r.type=`sine`,r.frequency.value=880,i.gain.setValueAtTime(.25,n),i.gain.exponentialRampToValueAtTime(.001,n+.3),r.connect(i).connect(t.destination),r.start(n),r.stop(n+.3);let a=t.createOscillator(),o=t.createGain();a.type=`sine`,a.frequency.value=660,o.gain.setValueAtTime(.25,n+.15),o.gain.exponentialRampToValueAtTime(.001,n+.5),a.connect(o).connect(t.destination),a.start(n+.15),a.stop(n+.5),setTimeout(()=>t.close(),2e3)}catch{}}function tg(e){if(`Notification`in window&&Notification.permission===`granted`)try{let t=new Notification(e.title,{body:e.body,tag:e.tag,silent:!0});t.onclick=()=>{window.focus(),Wh({workspaceId:e.workspaceId,sessionId:e.sessionId,setActiveWorkspaceId:e.setActiveWorkspaceId,setPendingFocus:e.setPendingFocus}),t.close()}}catch{}}function ng(){let e=V(pd),t=V(qu),n=V(ed),r=V(Bh),i=H(Bh),a=V(dd),o=V(Kr),s=H(rd),c=H(Hh),l=H(Gr),u=X(),d=Fr(),f=he(),p=(0,B.useRef)(new Map);(0,B.useEffect)(()=>{if(t!==`connected`)return;let e=!1;return(async()=>{let t=await n(`settings.get`,{});e||!t.ok||!t.data||i({enabled:typeof t.data[`notifications.enabled`]==`boolean`?t.data[`notifications.enabled`]:!0,soundEnabled:typeof t.data[`notifications.soundEnabled`]==`boolean`?t.data[`notifications.soundEnabled`]:!0})})(),()=>{e=!0}},[t,n,i]),(0,B.useEffect)(()=>{let t=p.current;for(let n of Object.values(e)){let e=t.get(n.id),i=e?.state,p=n.state,m=Yh.has(p)&&(!e||!Yh.has(e.state)),h={state:p,activeSince:m?Date.now():e?.activeSince??(Yh.has(p)?Date.now():null),notifiedForTurn:m?!1:e?.notifiedForTurn??!1};if(t.set(n.id,h),!r.enabled||!i||!Yh.has(i)||!Xh.has(p)||h.notifiedForTurn)continue;if(p===`idle`&&h.activeSince!==null&&Date.now()-h.activeSince<Jh){h.notifiedForTurn=!0;continue}h.notifiedForTurn=!0;let g=$h(),_=Qh(g,g?!1:Zh(n.workspaceId,n.id,a,d,o));if(_===`none`)continue;let v=u(`notification.session_completed_title`,{session:n.title?.trim()||rg(n.id)}),y=f.get(id)[n.workspaceId],b=[],x=ih(n.providerId).replace(/\s+/g,` `).trim();x&&b.push(x);let S=ah(y??null).replace(/\s+/g,` `).trim();S&&b.push(S);let C=h.activeSince===null?null:Date.now()-h.activeSince,w=C===null?``:sh(C);w&&b.push(w);let T=b.join(` · `),E=u(p===`ended`?`notification.session_ended_hint`:`notification.session_turn_completed`),D=[];T&&D.push(T),D.push(E);let O=D.join(`
104
- `);r.soundEnabled&&eg(),_===`system`?tg({title:v,body:O,tag:`session-${n.id}-${h.activeSince??`unknown`}`,workspaceId:n.workspaceId,sessionId:n.id,setActiveWorkspaceId:s,setPendingFocus:l}):c({kind:`success`,title:v,body:O,workspaceId:n.workspaceId,sessionId:n.id,duration:6e3})}let n=new Set(Object.keys(e));for(let e of t.keys())n.has(e)||t.delete(e)},[e,r,a,o,d,c,s,l,f,u])}function rg(e){let t=e.match(/(\d+)/)?.[1];return t?`SESSION-${t.slice(-2).padStart(2,`0`)}`:e.replace(/[_-]/g,` `).toUpperCase()}var ig=globalThis;ig.MonacoEnvironment??={getWorker(e,t){return t===`json`?new s:t===`css`||t===`scss`||t===`less`?new r:t===`html`||t===`handlebars`||t===`razor`?new c:t===`typescript`||t===`javascript`?new o:new i}};var ag=({workspaceId:e,filePath:t,content:n,visible:r=!0,onContentChange:i,onSave:o})=>{let s=V(Vr),c=(0,B.useRef)(null),d=(0,B.useRef)(null),f=(0,B.useRef)(r),p=(0,B.useRef)(i),m=(0,B.useRef)(o);(0,B.useEffect)(()=>{p.current=i},[i]),(0,B.useEffect)(()=>{m.current=o},[o]);let h=og(t),g=s===`light`?`vs`:`vs-dark`;return(0,B.useEffect)(()=>{if(!c.current||d.current)return;let e=u.create(c.current,{value:n,language:h,theme:g,fontSize:13,fontFamily:`JetBrains Mono, monospace`,minimap:{enabled:!1},scrollBeyondLastLine:!1,padding:{top:12,bottom:12},automaticLayout:!0});d.current=e;let t=e.onDidChangeModelContent(()=>{p.current?.(e.getValue())});return e.addCommand(l.CtrlCmd|a.KeyS,()=>{m.current?.()}),()=>{t.dispose(),e.dispose(),d.current=null}},[]),(0,B.useEffect)(()=>{let e=d.current;if(!e)return;let t=e.getModel();t&&u.setModelLanguage(t,h)},[h]),(0,B.useEffect)(()=>{u.setTheme(g)},[g]),(0,B.useEffect)(()=>{let e=d.current;!e||e.getValue()===n||e.setValue(n)},[n]),(0,B.useEffect)(()=>{let e=d.current,t=f.current;f.current=r,!(!e||!r||t)&&e.layout()},[r]),(0,Z.jsx)(`div`,{ref:c,className:`monaco-host`})};function og(e){return{ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,json:`json`,md:`markdown`,css:`css`,scss:`scss`,html:`html`,py:`python`,go:`go`,rs:`rust`,java:`java`,cpp:`cpp`,c:`c`,yaml:`yaml`,yml:`yaml`,sh:`shell`,bash:`shell`}[e.split(`.`).pop()?.toLowerCase()||``]||`plaintext`}var sg={minHeight:`200px`,padding:0,gap:0},cg={margin:0,color:`var(--text-tertiary)`,fontSize:`var(--text-base)`,fontWeight:`var(--font-normal)`};function lg({configType:e,visible:t=!0,fillHeight:n=!1}){let r=X(),i=V(ed),a=H(Hh),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(``),[f,p]=(0,B.useState)(!0),[m,h]=(0,B.useState)(!0),[g,_]=(0,B.useState)(!1),[v,y]=(0,B.useState)(null),[b,x]=(0,B.useState)(()=>{let t=localStorage.getItem(`config-expanded-${e}`);return t===null?!0:t===`true`}),S=(0,B.useMemo)(()=>g?`saving`:v?`error`:o===c?`saved`:`dirty`,[g,v,o,c]),C=S===`dirty`;(0,B.useEffect)(()=>{let t=!1;return(async()=>{h(!0),y(null);try{let n=await i(`settings.readConfigFile`,{configType:e});if(t)return;n.ok&&n.data?(s(n.data.content),l(n.data.content),d(n.data.configPath),p(n.data.exists)):y(n.error?.message??r(`settings.config_files.load_failed`))}catch{t||y(r(`settings.config_files.load_failed`))}finally{t||h(!1)}})(),()=>{t=!0}},[e,i,r]),(0,B.useEffect)(()=>{localStorage.setItem(`config-expanded-${e}`,String(b))},[b,e]);let w=(0,B.useCallback)(async()=>{if(!(!C||g)){_(!0);try{let t=await i(`settings.writeConfigFile`,{configType:e,content:o});if(t.ok&&t.data?.success)a({kind:`success`,title:r(`settings.config_files.save_success`),body:t.data.backupPath?r(`settings.config_files.save_success_with_backup`,{configPath:u,backupPath:t.data.backupPath}):void 0}),p(!0),l(o),y(null);else{let e=t.error?.message??t.data?.error;y(e??`Save failed`),a({kind:`error`,title:r(`settings.config_files.save_failed`),body:e})}}catch(e){y(e instanceof Error?e.message:`Save failed`),a({kind:`error`,title:r(`settings.config_files.save_failed`)})}finally{_(!1)}}},[e,o,C,g,i,a,r]),T=(0,B.useCallback)(()=>{s(c),y(null)},[c]),E=(0,B.useCallback)(()=>{if(e===`claude`)try{let e=JSON.parse(o);s(JSON.stringify(e,null,2)),a({kind:`success`,title:`JSON formatted`})}catch{a({kind:`error`,title:`Invalid JSON`,body:`Cannot format invalid JSON`})}},[e,o,a]),D=(0,B.useCallback)(e=>{s(e),y(null)},[]),O=(0,B.useCallback)(()=>{x(e=>!e)},[]);return m?(0,Z.jsx)(`div`,{className:`config-card`,children:(0,Z.jsx)(Ip,{className:`config-card-loading`,style:sg,title:(0,Z.jsx)(`p`,{style:cg,children:r(`common.loading`)})})}):v&&!u?(0,Z.jsx)(`div`,{className:`config-card`,children:(0,Z.jsx)(`div`,{className:`config-card-error`,children:(0,Z.jsx)(`span`,{className:`config-card-error-message`,children:v})})}):(0,Z.jsxs)(`div`,{className:`config-card ${n?`config-card--fill-height`:``}`,children:[(0,Z.jsxs)(`div`,{className:`config-card-header`,onClick:O,children:[(0,Z.jsxs)(`div`,{className:`config-card-title`,children:[(0,Z.jsx)(ef,{size:16}),(0,Z.jsx)($,{content:u,children:(0,Z.jsx)(`span`,{className:`config-card-path`,children:u})})]}),(0,Z.jsx)(`div`,{className:`config-card-header-right`,children:b?(0,Z.jsx)(Wd,{size:16}):(0,Z.jsx)(Hd,{size:16})})]}),b&&(0,Z.jsxs)(`div`,{className:`config-card-body ${n?`config-card-body--fill-height`:``}`,children:[!f&&(0,Z.jsx)(Ip,{className:`config-empty-state`,description:(0,Z.jsx)(`div`,{className:`config-empty-desc`,children:r(`settings.config_files.file_not_found_hint`)}),icon:(0,Z.jsx)(`div`,{className:`config-empty-icon`,children:`📭`}),title:(0,Z.jsx)(`div`,{className:`config-empty-title`,children:r(`settings.config_files.file_not_found`)})}),(0,Z.jsx)(ag,{workspaceId:`config-editor-${e}`,filePath:u,content:o,onContentChange:D,visible:t}),(0,Z.jsxs)(`div`,{className:`config-card-actions`,children:[(0,Z.jsx)(`div`,{className:`config-actions-left`,children:(0,Z.jsx)(()=>{if(!f&&!g&&!v&&!C)return(0,Z.jsxs)(`div`,{className:`config-status config-status--warning`,children:[(0,Z.jsx)(Xd,{size:14}),(0,Z.jsx)(`span`,{children:r(`settings.config_files.file_not_found_hint`)})]});let e={saved:{icon:Jd,color:`success`,text:r(`settings.config_files.status_saved`)},dirty:{icon:Xd,color:`warning`,text:r(`settings.config_files.unsaved_changes`)},saving:{color:`info`,text:r(`settings.config_files.saving`)},error:{icon:Yd,color:`error`,text:r(`settings.config_files.save_failed`)}}[S];return(0,Z.jsxs)(`div`,{className:`config-status config-status--${e.color}`,children:[S===`saving`?(0,Z.jsx)(km,{label:e.text,size:`sm`}):(0,Z.jsx)(e.icon,{size:14}),(0,Z.jsx)(`span`,{children:e.text})]})},{})}),(0,Z.jsxs)(`div`,{className:`config-actions-right`,children:[e===`claude`&&(0,Z.jsx)($,{content:r(`settings.config_files.format_hint`),children:(0,Z.jsxs)(gp,{size:`sm`,onClick:E,children:[(0,Z.jsx)(Pf,{size:14}),(0,Z.jsx)(`span`,{children:r(`settings.config_files.format`)})]})}),(0,Z.jsx)(gp,{size:`sm`,onClick:T,disabled:!C||g,children:r(`action.reset`)}),(0,Z.jsx)(gp,{variant:`primary`,size:`sm`,onClick:w,disabled:!C||g,children:r(g?`settings.config_files.saving`:`action.save`)})]})]})]})]})}function ug(e){return e.split(`
105
- `).map(e=>e.trim()).filter(e=>e.length>0)}function dg(e,t){return Object.fromEntries(e.map(e=>[e.id,t()]))}function fg({providers:e,additionalArgsById:t,setAdditionalArgsById:n,isMobile:r,onLayoutModeChange:i}){let a=X(),o=V(ed),s=V(qu),[c,l]=(0,B.useState)(e[0]?.id??`claude`),[u,d]=(0,B.useState)(`base`),[f,p]=(0,B.useState)(`base`),[m,h]=(0,B.useState)(()=>dg(e,()=>``)),[g,_]=(0,B.useState)(()=>dg(e,()=>!1)),v=(0,B.useRef)(dg(e,()=>0));(0,B.useEffect)(()=>{e.some(e=>e.id===c)||l(e[0]?.id??`claude`)},[e,c]),(0,B.useEffect)(()=>{h(t=>{let n=dg(e,()=>``),r=!1;for(let i of e)i.id in t?n[i.id]=t[i.id]:r=!0;return Object.keys(t).length!==e.length&&(r=!0),r?n:t}),_(t=>{let n=dg(e,()=>!1),r=!1;for(let i of e)i.id in t?n[i.id]=t[i.id]:r=!0;return Object.keys(t).length!==e.length&&(r=!0),r?n:t});let t=dg(e,()=>0);for(let n of e)n.id in v.current&&(t[n.id]=v.current[n.id]);v.current=t},[e]);let y=e.find(e=>e.id===c),b=y?t[y.id]??``:``,x=(0,B.useMemo)(()=>ug(b),[b]),S=r?f===`base`:u===`base`,C=r?f===`config`:u===`config`,w=y?m[y.id]??``:``,T=C;(0,B.useEffect)(()=>{i?.(T?`fill-height`:`default`)},[i,T]),(0,B.useEffect)(()=>{if(s!==`connected`||!y)return;let e=(v.current[y.id]??0)+1;v.current[y.id]=e;let t=!1;return(async()=>{let n=await o(`settings.previewCommand`,{providerId:y.id,config:{additionalArgs:x}});t||v.current[y.id]===e&&h(e=>({...e,[y.id]:n.ok&&n.data?n.data.preview:`Error loading preview`}))})(),()=>{t=!0}},[x,b,s,o,y]),(0,B.useEffect)(()=>{!y||!C||_(e=>e[y.id]?e:{...e,[y.id]:!0})},[y,C]);let E=e=>{l(e),r&&p(`base`)},D=async(e,t)=>{await o(`settings.update`,{settings:{providers:{[e]:{additionalArgs:ug(t)}}}})};return(0,Z.jsxs)(`div`,{className:`settings-section ${T?`settings-section--fill-height settings-provider-section--config-active`:``}`,children:[(0,Z.jsx)(pm,{"aria-label":a(`settings.providers`),className:`settings-provider-tabs`,onChange:e=>E(e),optionClassName:`settings-provider-tab`,options:e.map(e=>({label:e.displayName,value:e.id})),value:c}),r?null:(0,Z.jsx)(pm,{className:`settings-provider-subnav`,"aria-label":a(`settings.provider.config`),onChange:e=>d(e),optionClassName:`settings-provider-subnav-button`,options:[{label:a(`settings.provider.base`),value:`base`},{label:a(`settings.provider.config_file`),value:`config`}],value:u}),y&&S?(0,Z.jsxs)(`div`,{className:`settings-provider-content ${T?`settings-provider-content--fill-height`:``}`,children:[(0,Z.jsxs)(`div`,{className:`settings-group`,children:[(0,Z.jsx)(`h3`,{className:`settings-group-title`,children:a(`settings.provider.config`)}),(0,Z.jsx)(`p`,{className:`settings-group-desc`,children:a(`settings.provider.startup_args_hint`)}),(0,Z.jsxs)(`div`,{className:`settings-config-field`,children:[(0,Z.jsx)(`label`,{className:`settings-config-label`,htmlFor:`provider-startup-args`,children:a(`settings.provider.startup_args`)}),(0,Z.jsx)(qm,{id:`provider-startup-args`,className:`settings-provider-args-input`,rows:4,placeholder:a(`settings.provider.startup_args_placeholder`),value:b,onChange:e=>{let t=e.target.value;n(e=>({...e,[y.id]:t})),D(y.id,t)}})]})]}),(0,Z.jsxs)(`div`,{className:`settings-group`,children:[(0,Z.jsx)(`h3`,{className:`settings-group-title`,children:`Command Preview`}),(0,Z.jsx)(`p`,{className:`settings-group-desc`,children:`Preview of the effective provider command`}),(0,Z.jsx)(`div`,{className:`settings-config-field`,children:(0,Z.jsx)(`code`,{className:`settings-command-preview`,children:w})})]}),r?(0,Z.jsxs)(`button`,{type:`button`,className:`settings-provider-mobile-entry`,"aria-label":a(`settings.provider.open_config_file_editor`),onClick:()=>p(`config`),children:[(0,Z.jsx)(`span`,{className:`settings-provider-mobile-entry__title`,children:a(`settings.provider.open_config_file_editor`)}),(0,Z.jsx)(`span`,{className:`settings-provider-mobile-entry__meta`,children:y.id===`codex`?a(`settings.config_files.codex_config`):a(`settings.config_files.claude_config`)})]}):null]}):null,(0,Z.jsx)(`div`,{className:`settings-provider-config-stack ${T?`settings-provider-config-stack--fill-height`:``}`,children:e.filter(e=>g[e.id]||y?.id===e.id&&C).map(e=>{let t=y?.id===e.id&&C;return(0,Z.jsx)(`div`,{className:`settings-provider-config-panel ${T?`settings-provider-config-panel--fill-height`:``} ${t?``:`settings-provider-config-panel-hidden`}`,"aria-hidden":!t,children:(0,Z.jsx)(`div`,{className:`settings-provider-content ${T?`settings-provider-content--fill-height`:``}`,children:(0,Z.jsxs)(`div`,{className:`settings-group ${T?`settings-group--fill-height`:``}`,children:[r?(0,Z.jsx)(`div`,{className:`settings-provider-mobile-config-header`,children:(0,Z.jsx)(`button`,{type:`button`,className:`settings-link`,onClick:()=>p(`base`),children:a(`settings.provider.back_to_base`)})}):null,(0,Z.jsx)(`h3`,{className:`settings-group-title`,children:a(`settings.config_files.title`)}),(0,Z.jsx)(`p`,{className:`settings-group-desc`,children:e.id===`codex`?a(`settings.config_files.codex_config`):a(`settings.config_files.claude_config`)}),(0,Z.jsx)(lg,{configType:e.id,visible:t,fillHeight:T})]})})},e.id)})})]})}function pg({historyIndex:e,historyLength:t,hasActiveWorkspace:n}){return(typeof e==`number`?e>0:t>1)?`history`:n?`/workspace`:`/`}function mg(e){let{history:t,hasActiveWorkspace:n}=e,r=t.state;return pg({historyIndex:r?.idx??null,historyLength:t.length,hasActiveWorkspace:n})}function hg(e){return mg({history:typeof window<`u`?window.history:{state:null,length:1},hasActiveWorkspace:e})}var gg=[{id:`general`,labelKey:`settings.general`,Icon:Nf},{id:`providers`,labelKey:`settings.providers`,Icon:df},{id:`appearance`,labelKey:`settings.appearance`,Icon:bf},{id:`shortcuts`,labelKey:`settings.shortcuts.title`,Icon:hf}],_g=gg.filter(e=>e.id!==`shortcuts`),vg=[{id:`command-palette.toggle`,name:`命令面板`,description:`打开/关闭命令面板`,defaultBinding:`Mod+K`,category:`global`},{id:`workspace.new`,name:`新建工作区`,description:`打开新的工作区标签`,defaultBinding:`Mod+N`,category:`global`},{id:`workspace.previous`,name:`上一个工作区`,description:`切换到上一个工作区标签`,defaultBinding:`Mod+Shift+[`,category:`global`},{id:`workspace.next`,name:`下一个工作区`,description:`切换到下一个工作区标签`,defaultBinding:`Mod+Shift+]`,category:`global`},{id:`focus-mode.toggle`,name:`专注模式`,description:`切换专注模式(隐藏非必要面板)`,defaultBinding:`F`,category:`global`},{id:`agent.split-vertical`,name:`垂直分屏`,description:`垂直分割 Agent 面板`,defaultBinding:`Mod+D`,category:`workspace`},{id:`agent.split-horizontal`,name:`水平分屏`,description:`水平分割 Agent 面板`,defaultBinding:`Mod+Shift+D`,category:`workspace`},{id:`editor.save`,name:`保存文件`,description:`保存当前编辑的文件`,defaultBinding:`Mod+S`,category:`editor`}],yg=Br(`ui.customShortcuts`,{});function bg(e){return e.replace(`Mod`,navigator.platform.includes(`Mac`)?`⌘`:`Ctrl`).replace(`Shift`,`⇧`).replace(`Alt`,navigator.platform.includes(`Mac`)?`⌥`:`Alt`)}function xg(e,t){return t[e]||vg.find(t=>t.id===e)?.defaultBinding||``}var Sg={global:`全局`,workspace:`工作区`,editor:`编辑器`,terminal:`终端`};function Cg(){let e=X(),t=V(ed),n=e(`settings.shortcuts.reset_hint`),[r,i]=Se(yg),[a,o]=(0,B.useState)(null),[s,c]=(0,B.useState)(`global`),l=(0,B.useRef)(null);(0,B.useEffect)(()=>{a&&l.current&&l.current.focus()},[a]);let u=(0,B.useCallback)((e,n)=>{e.preventDefault(),e.stopPropagation();let r=[];if((navigator.platform.includes(`Mac`)?e.metaKey:e.ctrlKey)&&r.push(`Mod`),e.shiftKey&&r.push(`Shift`),e.altKey&&r.push(`Alt`),e.key.length===1)r.push(e.key.toUpperCase());else if(e.key===`Escape`){o(null);return}else r.push(e.key);let a=r.join(`+`);i(e=>({...e,[n]:a})),t(`settings.update`,{settings:{shortcuts:{[n]:a}}}),o(null)},[i,t]),d=(0,B.useCallback)(e=>{i(t=>{let n={...t};return delete n[e],n}),t(`settings.update`,{settings:{shortcuts:{[e]:null}}})},[i,t]),f=(0,B.useCallback)(()=>{i({}),t(`settings.update`,{settings:{shortcuts:{}}})},[i,t]),p=vg.filter(e=>e.category===s);return(0,Z.jsxs)(`div`,{className:`settings-section`,children:[(0,Z.jsx)(pm,{"aria-label":e(`settings.shortcuts.title`),className:`shortcuts-category-tabs`,onChange:e=>c(e),optionClassName:`shortcuts-category-tab`,options:Object.keys(Sg).map(e=>({label:Sg[e],value:e})),size:`sm`,value:s}),(0,Z.jsx)(`div`,{className:`shortcuts-list`,children:p.map(e=>{let t=xg(e.id,r),i=r[e.id]!==void 0,s=a===e.id,c=`shortcut-name-${e.id}`,f=`shortcut-description-${e.id}`;return(0,Z.jsxs)(`div`,{className:`shortcuts-item ${i?`shortcuts-item-custom`:``}`,children:[(0,Z.jsxs)(`div`,{className:`shortcuts-info`,children:[(0,Z.jsx)(`span`,{id:c,className:`shortcuts-name`,children:e.name}),(0,Z.jsx)(`span`,{id:f,className:`shortcuts-desc`,children:e.description})]}),(0,Z.jsx)(`div`,{className:`shortcuts-binding`,children:s?(0,Z.jsx)(Bp,{ref:l,type:`text`,className:`shortcuts-capture`,"aria-labelledby":c,"aria-describedby":f,placeholder:`按下快捷键...`,autoFocus:!0,onKeyDown:t=>u(t,e.id),onBlur:()=>o(null),readOnly:!0}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Up,{className:`shortcuts-key`,interactive:!0,onClick:()=>o(e.id),children:bg(t)}),i&&(0,Z.jsx)($,{content:n,children:(0,Z.jsx)(Q,{"aria-label":n,icon:`↺`,onClick:()=>d(e.id),size:`sm`})})]})})]},e.id)})}),(0,Z.jsx)(`div`,{className:`shortcuts-footer`,children:(0,Z.jsx)(gp,{onClick:f,variant:`secondary`,children:e(`settings.shortcuts.reset_all`)})})]})}var wg=gg[0].id;function Tg(){if(typeof window>`u`)return!1;let e=window.navigator;return window.matchMedia?.(`(display-mode: standalone)`).matches===!0||e.standalone===!0}function Eg(){if(typeof window>`u`)return!1;let{userAgent:e=``,maxTouchPoints:t=0,platform:n=``}=window.navigator,r=e.toLowerCase();return/android|iphone|ipad|ipod|mobile/.test(r)||n===`MacIntel`&&t>1}function Dg(){return typeof window>`u`||!(`Notification`in window)?`unsupported`:Eg()?Tg()?`available`:`limited`:`available`}function Og(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`).join(`
106
- `):``}function kg(e,t){return Object.fromEntries(t.map(t=>[t.id,Og(e[`providers.${t.id}.additionalArgs`])]))}function Ag(){let e=X(),t=e(`settings.load_failed_unknown`),n=Jt(),r=Fr()===`mobile`,i=V(ed),a=V(qu),o=V(Qu),s=V(dd),[c,l]=(0,B.useState)(()=>r?{kind:`root`,lastSection:wg}:{kind:`detail`,section:wg}),[u]=(0,B.useState)([{id:`claude`,displayName:`Claude`},{id:`codex`,displayName:`Codex`}]),[d,f]=(0,B.useState)(!0),[p,m]=(0,B.useState)(!0),[h,g]=(0,B.useState)(600),[_,v]=(0,B.useState)(`standard`),[y,b]=(0,B.useState)({}),[x,S]=(0,B.useState)(`default`),[C,w]=(0,B.useState)(null),[T,E]=(0,B.useState)(0),[D,O]=Se(Hr),[k,A]=Se(Vr),j=H(Bh),M=(0,B.useRef)(t),N=(0,B.useRef)({locale:0,terminalRenderer:0}),P=c.kind===`detail`?c.section:c.lastSection,F=r?_g:gg,ee=F.find(e=>e.id===P)??F[0];(0,B.useEffect)(()=>{M.current=t},[t]),(0,B.useEffect)(()=>{l(e=>r?e.kind===`root`?e:{kind:`root`,lastSection:e.section}:e.kind===`detail`?e:{kind:`detail`,section:e.lastSection})},[r]),(0,B.useEffect)(()=>{if(a!==`connected`)return;let e=!1;return(async()=>{let t={...N.current},n=await i(`settings.get`,{});if(!n.ok||!n.data){e||w(n.error?.message??M.current);return}let r=n.data;e||(w(null),typeof r[`notifications.enabled`]==`boolean`&&f(r[`notifications.enabled`]),typeof r[`notifications.soundEnabled`]==`boolean`&&m(r[`notifications.soundEnabled`]),g(Jr(r[`supervisor.evaluationTimeoutSec`])),j({enabled:typeof r[`notifications.enabled`]==`boolean`?r[`notifications.enabled`]:!0,soundEnabled:typeof r[`notifications.soundEnabled`]==`boolean`?r[`notifications.soundEnabled`]:!0}),(r[`appearance.terminalRenderer`]===`standard`||r[`appearance.terminalRenderer`]===`compatibility`)&&N.current.terminalRenderer===t.terminalRenderer&&v(r[`appearance.terminalRenderer`]),(r[`appearance.locale`]===`zh`||r[`appearance.locale`]===`en`)&&N.current.locale===t.locale&&O(r[`appearance.locale`]),b(kg(r,u)))})(),()=>{e=!0}},[a,i,O,j,T]);let te=e=>{N.current.locale+=1,O(e)},ne=e=>{N.current.terminalRenderer+=1,v(e)};(0,B.useEffect)(()=>{P!==`providers`&&S(`default`)},[P]);let I=()=>{let e=hg(!!s);if(e===`history`){n(-1);return}n(e)},L=()=>{if(r&&c.kind===`detail`){l({kind:`root`,lastSection:c.section});return}I()},R=()=>{switch(P){case`general`:return(0,Z.jsx)(Ng,{notificationsEnabled:d,setNotificationsEnabled:f,soundEnabled:p,setSoundEnabled:m,supervisorEvaluationTimeoutSec:h,setSupervisorEvaluationTimeoutSec:g});case`appearance`:return(0,Z.jsx)(Pg,{locale:D,setLocale:te,terminalRenderer:_,setTerminalRenderer:ne,theme:k,setTheme:A});case`providers`:return(0,Z.jsx)(fg,{providers:u,additionalArgsById:y,setAdditionalArgsById:b,isMobile:r,onLayoutModeChange:S});case`shortcuts`:return r?null:(0,Z.jsx)(Cg,{});default:return null}},re=()=>(0,Z.jsx)(`main`,{className:`settings-content settings-content--mobile-root`,children:(0,Z.jsx)(`div`,{className:`settings-mobile-list`,children:F.map(({id:t,labelKey:n,Icon:r})=>(0,Z.jsxs)(`button`,{type:`button`,className:`settings-mobile-item`,onClick:()=>l({kind:`detail`,section:t}),children:[(0,Z.jsx)(`span`,{className:`settings-mobile-item__icon`,children:(0,Z.jsx)(r,{size:18})}),(0,Z.jsx)(`span`,{className:`settings-mobile-item__label`,children:e(n)}),(0,Z.jsx)(Ud,{size:16,className:`settings-mobile-item__arrow`})]},t))})}),ie=r&&c.kind===`root`,ae=e(r?ie?`settings.title`:ee.labelKey:`settings.title`);return(0,Z.jsxs)(`div`,{className:`settings-page ${r?`settings-page--mobile`:``}`,children:[(0,Z.jsx)(`header`,{className:`settings-header`,children:(0,Z.jsx)(mm,{title:ae,titleAs:`div`,onBack:L,backLabel:e(`action.back`)})}),ie?re():(0,Z.jsxs)(`div`,{className:`settings-body ${r?`settings-body--mobile`:``} ${x===`fill-height`?`settings-body--fill-height`:``}`,children:[r?null:(0,Z.jsx)(`aside`,{className:`settings-sidebar`,children:(0,Z.jsx)(`nav`,{className:`settings-nav`,children:F.map(({id:t,labelKey:n,Icon:r})=>(0,Z.jsx)(jg,{icon:(0,Z.jsx)(r,{size:16}),label:e(n),active:P===t,onClick:()=>l({kind:`detail`,section:t})},t))})}),(0,Z.jsxs)(`main`,{className:`settings-content ${r?`settings-content--mobile`:``} ${x===`fill-height`?`settings-content--fill-height`:``}`,children:[C&&(0,Z.jsx)(qp,{role:`alert`,tone:`error`,title:e(`settings.load_failed`),message:C,action:(0,Z.jsx)(`button`,{type:`button`,className:`settings-link`,onClick:()=>E(e=>e+1),children:e(`action.refresh`)})}),R()]})]}),(0,Z.jsxs)(`footer`,{className:`settings-footer ${r?`settings-footer--mobile`:``}`,children:[(0,Z.jsx)(`span`,{className:`settings-autosave`,children:e(`settings.autosave_hint`)}),(0,Z.jsxs)(`span`,{className:`settings-version`,children:[`v`,o?.version??`0.0.0`]})]})]})}function jg({icon:e,label:t,active:n,onClick:r}){return(0,Z.jsxs)(`button`,{className:`settings-nav-item ${n?`settings-nav-item-active`:``}`,onClick:r,children:[(0,Z.jsx)(`span`,{className:`settings-nav-icon`,children:e}),(0,Z.jsx)(`span`,{className:`settings-nav-label`,children:t}),n&&(0,Z.jsx)(Ud,{size:14,className:`settings-nav-arrow`})]})}function Mg(e){let t=e.trim();if(!/^\d+$/.test(t))return null;let n=Number(t);return!Number.isSafeInteger(n)||n<1||n>86400?null:n}function Ng({notificationsEnabled:e,setNotificationsEnabled:t,soundEnabled:n,setSoundEnabled:r,supervisorEvaluationTimeoutSec:i,setSupervisorEvaluationTimeoutSec:a}){let o=X(),s=(0,B.useId)(),c=(0,B.useId)(),l=(0,B.useId)(),u=(0,B.useId)(),d=V(ed),f=H(Bh),[p,m]=(0,B.useState)(`unavailable`),[h,g]=(0,B.useState)(`unsupported`),[_,v]=(0,B.useState)(String(i)),[y,b]=(0,B.useState)(null),x=async e=>await d(`settings.update`,{settings:e}),S=e=>{f(e)};(0,B.useEffect)(()=>{if(g(Dg()),`Notification`in window){m(Notification.permission);return}m(`unavailable`)},[]),(0,B.useEffect)(()=>{v(String(i))},[i]),(0,B.useEffect)(()=>{b(null)},[i]);let C=async()=>{`Notification`in window&&m(await Notification.requestPermission())},w=async()=>{let e=Mg(_);if(e===null){v(String(i)),b(o(`settings.supervisor.validation_error`,{max:qr}));return}if(e===i){v(String(e)),b(null);return}let t=await x({supervisor:{evaluationTimeoutSec:e}});if(!t.ok){v(String(i)),b(t.error?.message||o(`settings.config_files.save_failed`));return}a(e),v(String(e)),b(null)};return(0,Z.jsxs)(`div`,{className:`settings-section`,children:[(0,Z.jsxs)(`div`,{className:`settings-group`,children:[(0,Z.jsx)(`h3`,{className:`settings-group-title`,children:o(`settings.notifications`)}),(0,Z.jsx)(`p`,{className:`settings-group-desc`,children:o(`settings.notifications_channel_hint`)}),(0,Z.jsxs)(`div`,{className:`settings-toggle-row`,children:[(0,Z.jsxs)(`div`,{className:`settings-toggle-info`,children:[(0,Z.jsx)(`span`,{className:`settings-toggle-label`,id:s,children:o(`settings.notifications_enabled`)}),(0,Z.jsx)(`span`,{className:`settings-toggle-desc`,id:c,children:o(`settings.notifications_enabled_hint`)})]}),(0,Z.jsx)(Im,{"aria-describedby":c,"aria-labelledby":s,checked:e,className:`settings-toggle`,onCheckedChange:e=>{t(e),S({enabled:e,soundEnabled:n}),x({notifications:{enabled:e}})}})]}),(0,Z.jsxs)(`div`,{className:`settings-toggle-row`,children:[(0,Z.jsxs)(`div`,{className:`settings-toggle-info`,children:[(0,Z.jsx)(`span`,{className:`settings-toggle-label`,id:l,children:o(`settings.notification_sound`)}),(0,Z.jsx)(`span`,{className:`settings-toggle-desc`,id:u,children:o(`settings.notification_sound_hint`)})]}),(0,Z.jsx)(Im,{"aria-describedby":u,"aria-labelledby":l,checked:n,className:`settings-toggle`,disabled:!e,onCheckedChange:t=>{r(t),S({enabled:e,soundEnabled:t}),x({notifications:{soundEnabled:t}})}})]}),(0,Z.jsxs)(`div`,{className:`settings-info-row`,children:[(0,Z.jsx)(`span`,{className:`settings-info-label`,children:o(`settings.notification_status`)}),(0,Z.jsxs)(`span`,{className:`settings-info-value settings-capability-${h}`,children:[h===`available`&&o(`settings.notification_status_available`),h===`limited`&&(0,Z.jsxs)(Z.Fragment,{children:[o(`settings.notification_status_limited`),(0,Z.jsx)(`span`,{className:`settings-status-hint`,children:o(`settings.notification_status_limited_hint`)})]}),h===`unsupported`&&(0,Z.jsxs)(Z.Fragment,{children:[o(`settings.notification_status_unsupported`),(0,Z.jsx)(`span`,{className:`settings-status-hint`,children:o(`settings.notification_status_unsupported_hint`)})]})]})]}),(0,Z.jsxs)(`div`,{className:`settings-info-row`,children:[(0,Z.jsx)(`span`,{className:`settings-info-label`,children:o(`settings.notification_permission`)}),(0,Z.jsxs)(`span`,{className:`settings-info-value settings-permission-${p}`,children:[p===`granted`&&o(`settings.permission_granted`),p===`denied`&&(0,Z.jsxs)(Z.Fragment,{children:[o(`settings.permission_denied`),(0,Z.jsx)(`span`,{className:`settings-status-hint`,children:o(`settings.permission_denied_hint`)})]}),p===`default`&&h===`available`&&(0,Z.jsx)(`button`,{className:`settings-link`,onClick:C,children:o(`settings.permission_request`)}),p===`default`&&h===`limited`&&(0,Z.jsxs)(Z.Fragment,{children:[o(`settings.permission_unavailable`),(0,Z.jsx)(`span`,{className:`settings-status-hint`,children:o(`settings.permission_limited_hint`)})]}),p===`unavailable`&&(0,Z.jsxs)(Z.Fragment,{children:[o(`settings.permission_unavailable`),(0,Z.jsx)(`span`,{className:`settings-status-hint`,children:o(`settings.permission_unavailable_hint`)})]})]})]})]}),(0,Z.jsxs)(`div`,{className:`settings-group`,children:[(0,Z.jsx)(`h3`,{className:`settings-group-title`,children:o(`settings.supervisor.title`)}),(0,Z.jsx)(`p`,{className:`settings-group-desc`,children:o(`settings.supervisor.hint`)}),(0,Z.jsxs)(`div`,{className:`settings-config-field settings-config-field--inline`,children:[(0,Z.jsx)(`label`,{className:`settings-config-label`,htmlFor:`supervisor-evaluation-timeout`,children:o(`settings.supervisor.evaluation_timeout`)}),(0,Z.jsx)(`div`,{className:`settings-config-control`,children:(0,Z.jsx)(Bp,{id:`supervisor-evaluation-timeout`,className:`settings-input-compact`,type:`number`,min:1,max:qr,step:1,inputMode:`numeric`,invalid:!!y,value:_,onChange:e=>{v(e.target.value),y&&b(null)},onBlur:()=>{w()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),w())}})}),y?(0,Z.jsx)(`span`,{className:`form-error`,role:`alert`,children:y}):null]})]})]})}function Pg({locale:e,setLocale:t,terminalRenderer:n,setTerminalRenderer:r,theme:i,setTheme:a}){let o=X(),s=(0,B.useId)(),c=(0,B.useId)(),l=(0,B.useId)(),u=(0,B.useId)(),d=(0,B.useId)(),f=(0,B.useId)(),p=V(ed),m=async e=>{await p(`settings.update`,{settings:e})},h=e=>{a(e),document.documentElement.setAttribute(`data-theme`,e),m({appearance:{theme:e}})};return(0,Z.jsxs)(`div`,{className:`settings-section`,children:[(0,Z.jsxs)(`div`,{className:`settings-group`,children:[(0,Z.jsx)(`h3`,{className:`settings-group-title`,id:s,children:o(`settings.theme.title`)}),(0,Z.jsx)(`p`,{className:`settings-group-desc`,id:c,children:o(`settings.theme.hint`)}),(0,Z.jsxs)(`div`,{"aria-describedby":c,"aria-labelledby":s,className:`settings-pills`,role:`group`,children:[(0,Z.jsx)(Yp,{leadingIcon:i===`dark`?(0,Z.jsx)(Vd,{size:12}):void 0,onClick:()=>h(`dark`),active:i===`dark`,children:o(`settings.theme.dark`)}),(0,Z.jsx)(Yp,{leadingIcon:i===`light`?(0,Z.jsx)(Vd,{size:12}):void 0,onClick:()=>h(`light`),active:i===`light`,children:o(`settings.theme.light`)})]})]}),(0,Z.jsxs)(`div`,{className:`settings-group`,children:[(0,Z.jsx)(`h3`,{className:`settings-group-title`,id:l,children:o(`settings.terminal_renderer`)}),(0,Z.jsx)(`p`,{className:`settings-group-desc`,id:u,children:o(`settings.terminal_renderer_hint`)}),(0,Z.jsxs)(`div`,{"aria-describedby":u,"aria-labelledby":l,className:`settings-pills`,role:`group`,children:[(0,Z.jsx)(Yp,{leadingIcon:n===`standard`?(0,Z.jsx)(Vd,{size:12}):void 0,onClick:()=>{r(`standard`),m({appearance:{terminalRenderer:`standard`}})},active:n===`standard`,children:o(`settings.terminal_standard`)}),(0,Z.jsx)(Yp,{leadingIcon:n===`compatibility`?(0,Z.jsx)(Vd,{size:12}):void 0,onClick:()=>{r(`compatibility`),m({appearance:{terminalRenderer:`compatibility`}})},active:n===`compatibility`,children:o(`settings.terminal_compatibility`)})]})]}),(0,Z.jsxs)(`div`,{className:`settings-group`,children:[(0,Z.jsx)(`h3`,{className:`settings-group-title`,id:d,children:o(`settings.language.title`)}),(0,Z.jsx)(`p`,{className:`settings-group-desc`,id:f,children:o(`settings.language.hint`)}),(0,Z.jsxs)(`div`,{"aria-describedby":f,"aria-labelledby":d,className:`settings-pills`,role:`group`,children:[(0,Z.jsx)(Yp,{leadingIcon:e===`zh`?(0,Z.jsx)(Vd,{size:12}):void 0,onClick:()=>{t(`zh`),m({appearance:{locale:`zh`}})},active:e===`zh`,children:o(`settings.language.zh`)}),(0,Z.jsx)(Yp,{leadingIcon:e===`en`?(0,Z.jsx)(Vd,{size:12}):void 0,onClick:()=>{t(`en`),m({appearance:{locale:`en`}})},active:e===`en`,children:o(`settings.language.en`)})]})]})]})}var Fg={minHeight:`auto`,padding:0,gap:`var(--sp-5)`},Ig=()=>{let e=X(),t=Jt(),[n,r]=(0,B.useState)(!1),i=Fr()===`mobile`,a=[{icon:(0,Z.jsx)(Uf,{size:18}),title:e(`welcome.features.agent_first.title`),description:e(`welcome.features.agent_first.description`)},{icon:(0,Z.jsx)(uf,{size:18}),title:e(`welcome.features.git_tools.title`),description:e(`welcome.features.git_tools.description`)},{icon:(0,Z.jsx)(zf,{size:18}),title:e(`welcome.features.terminals.title`),description:e(`welcome.features.terminals.description`)}];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`welcome-container ${i?`welcome-container--mobile`:``}`,children:(0,Z.jsxs)(`div`,{className:`welcome-card ${i?`welcome-card--mobile`:``}`,children:[(0,Z.jsx)(Ip,{style:Fg,title:(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`welcome-kicker`,children:e(`welcome.kicker`)}),(0,Z.jsx)(`h1`,{className:`welcome-title`,children:e(`welcome.title`)})]}),description:(0,Z.jsx)(`p`,{className:`welcome-body`,children:e(`welcome.description`)}),action:(0,Z.jsxs)(`button`,{className:`welcome-btn`,onClick:()=>{r(!0)},children:[(0,Z.jsx)(Ef,{size:18}),(0,Z.jsx)(`span`,{children:e(`action.open_workspace`)})]})}),(0,Z.jsxs)(`button`,{className:`welcome-link`,onClick:()=>{t(`/settings`)},children:[(0,Z.jsx)(Nf,{size:14}),(0,Z.jsx)(`span`,{children:e(`action.settings`)})]}),(0,Z.jsx)(`div`,{className:`welcome-divider`}),(0,Z.jsx)(`div`,{className:`welcome-features`,children:a.map((e,t)=>(0,Z.jsxs)(`div`,{className:`welcome-feature`,children:[(0,Z.jsx)(`div`,{className:`welcome-feature-icon`,children:e.icon}),(0,Z.jsxs)(`div`,{className:`welcome-feature-text`,children:[(0,Z.jsx)(`div`,{className:`welcome-feature-title`,children:e.title}),(0,Z.jsx)(`div`,{className:`welcome-feature-desc`,children:e.description})]})]},t))})]})}),n?(0,Z.jsx)(Nh,{onClose:()=>r(!1)}):null]})};function Lg(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.id==`string`&&typeof t.path==`string`&&typeof t.uiState==`object`&&t.uiState!==null}function Rg(e){let t=V(ed),n=H(id),r=he();return{persistUiState:(0,B.useCallback)(async i=>{if(!e||e.startsWith(`__workspace_`))return!1;let a=r.get(id)[e];if(!a)return!1;let o={...a.uiState,leftPanelWidth:r.get(Ch),bottomPanelHeight:r.get(wh),focusMode:r.get(Sh),...i};n(t=>{let n=t[e];return n?{...t,[e]:{...n,uiState:o}}:t});try{let r=await t(`workspace.uiState.set`,{workspaceId:e,uiState:o});return r.ok?(Lg(r.data)&&n(t=>({...t,[e]:r.data})),!0):(console.error(`Failed to persist workspace ui state:`,r.error?.message),!1)}catch(e){return console.error(`Failed to persist workspace ui state:`,e),!1}},[t,n,r,e])}}var zg=`ui.paneLayout.`,Bg=`ui.paneRatio.`,Vg={id:`root`,type:`leaf`},Hg=nd(e=>z(Vg));function Ug(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Wg(e){let t=Ug();if(!t)return null;try{let n=t.getItem(`${zg}${e}`);return n?JSON.parse(n):null}catch{return null}}function Gg(e){let t=Ug();if(t)try{t.removeItem(`${zg}${e}`)}catch{}}function Kg(e,t){let n=Ug();if(!n)return null;try{let r=n.getItem(`${Bg}${e}.${t}`);if(r===null)return null;let i=Number(r);return Number.isFinite(i)?i:null}catch{return null}}function qg(e,t,n){let r=Ug();if(r)try{r.setItem(`${Bg}${e}.${t}`,String(n))}catch{}}function Jg(e){return{id:e,type:`leaf`}}function Yg(e,t){return{id:e,type:`leaf`,sessionId:t}}function Xg(e,t,n){if(e.type===`leaf`){if(e.id!==t)return e;let r=`split-${e.id}-${n}-${Date.now()}`;return{id:r,type:`split`,direction:n,ratio:.5,children:[{...e},Jg(`${r}-draft`)]}}let r=e.children??[],i=!1,a=r.map(e=>{let r=Xg(e,t,n);return r!==e&&(i=!0),r});return i?{...e,children:a}:e}function Zg(e,t,n){if(e.type===`leaf`){if(e.sessionId!==t)return e;let r=`split-${e.id}-${n}-${Date.now()}`;return{id:r,type:`split`,direction:n,ratio:.5,children:[{...e},Jg(`${r}-draft`)]}}let r=e.children??[],i=!1,a=r.map(e=>{let r=Zg(e,t,n);return r!==e&&(i=!0),r});return i?{...e,children:a}:e}function Qg(e,t,n){if(e.type===`leaf`)return e.id===t?{...e,sessionId:n}:e;let r=e.children??[],i=!1,a=r.map(e=>{let r=Qg(e,t,n);return r!==e&&(i=!0),r});return i?{...e,children:a}:e}function $g(e,t){return t.startsWith(`__draft__`)?t_(e,t.replace(`__draft__`,``)):n_(e,t)}function e_(e,t){if(e.type===`leaf`)return e.id===t&&!e.sessionId?null:e;let n=e.children??[],r=!1,i=[];for(let e of n){let n=e_(e,t);n!==e&&(r=!0),n!==null&&i.push(n)}return r?i.length===1?i[0]:i.length===0?null:{...e,children:i}:e}function t_(e,t){return e_(e,t)??{id:e.id,type:`leaf`}}function n_(e,t){if(e.type===`leaf`)return e.sessionId===t?{id:e.id,type:`leaf`}:e;let n=e.children??[],r=!1,i=n.map(e=>{let n=n_(e,t);return n!==e&&(r=!0),n});return r?{...e,children:i}:e}function r_(e){return e.type===`leaf`?e.sessionId?[e.sessionId]:[]:e.children?.flatMap(e=>r_(e))??[]}function i_(e,t,n,r=`horizontal`){let i=s_(e,t);if(i)return i;if(n){let i=c_(e,t,r,n);if(i)return i}return c_(e,t,r)||(e.type===`leaf`&&!e.sessionId?{...e,sessionId:t}:{id:`root`,type:`leaf`,sessionId:t})}function a_(e){if(e.length===0)return{id:`root`,type:`leaf`};if(e.length===1)return{id:`fallback-leaf-1`,type:`leaf`,sessionId:e[0]};let[t,...n]=e;return{id:`split-fallback-1`,type:`split`,direction:`horizontal`,ratio:.5,children:[{id:`fallback-leaf-1`,type:`leaf`,sessionId:t},l_(n,2)]}}function o_(e,t){if(e.type===`leaf`)return e.sessionId&&!t.has(e.sessionId)?{id:e.id,type:`leaf`}:e;let n=e.children??[],r=!1,i=n.map(e=>{let n=o_(e,t);return n!==e&&(r=!0),n});return r?i.length===1?i[0]:{...e,children:i}:e}function s_(e,t){if(e.type===`leaf`)return e.sessionId?null:{...e,sessionId:t};let n=e.children??[];for(let r=0;r<n.length;r+=1){let i=n[r],a=s_(i,t);if(a)return{...e,children:n.map((e,t)=>t===r?a:e)}}return null}function c_(e,t,n,r){if(e.type===`leaf`){if(!e.sessionId||r&&e.sessionId!==r)return null;let i=`split-${e.id}-${n}-${Date.now()}`;return{id:i,type:`split`,direction:n,ratio:.5,children:[{...e},Yg(`${i}-session`,t)]}}let i=e.children??[];for(let a=0;a<i.length;a+=1){let o=i[a],s=c_(o,t,n,r);if(s)return{...e,children:i.map((e,t)=>t===a?s:e)}}return null}function l_(e,t){if(e.length===1)return{id:`fallback-leaf-${t}`,type:`leaf`,sessionId:e[0]};let[n,...r]=e;return{id:`split-fallback-${t}`,type:`split`,direction:`horizontal`,ratio:.5,children:[{id:`fallback-leaf-${t}`,type:`leaf`,sessionId:n},l_(r,t+1)]}}function u_(e){let t=H(Hg(e)),n=he(),{persistUiState:r}=Rg(e),i=(0,B.useCallback)(i=>{let a=n.get(Hg(e)),o=typeof i==`function`?i(a):i;return t(o),r({paneLayout:o}),o},[r,t,n,e]),a=(0,B.useCallback)((e,t)=>{i(n=>Zg(n,e,t))},[i]),o=(0,B.useCallback)((e,t)=>{i(n=>Xg(n,e,t))},[i]),s=(0,B.useCallback)(e=>{i(t=>$g(t,e))},[i]),c=(0,B.useCallback)(e=>{i(t=>t_(t,e))},[i]),l=(0,B.useCallback)((e,t)=>{i(n=>Qg(n,e,t))},[i]),u=(0,B.useCallback)(e=>{i({id:`root`,type:`leaf`,sessionId:e})},[i]);return{appendSession:(0,B.useCallback)((e,t,n=`horizontal`)=>{i(r=>i_(r,e,t,n))},[i]),assignSession:l,closeDraftPane:c,closeSessionPane:s,replaceWithSession:u,splitDraftPane:o,splitSessionPane:a}}var d_=new TextEncoder,f_=100,p_=5e3;function m_(e){return new Promise(t=>{setTimeout(t,e)})}function h_(){let e=V(ed),t=V(Ku),n=he(),r=(0,B.useCallback)(async t=>{let n=await e(`session.stop`,{sessionId:t});n.ok||console.error(`Failed to stop session:`,n.error?.message)},[e]);return{closeSession:(0,B.useCallback)(async t=>{let r=n.get(hd(t));if(!r)return;if(r.state===`ended`){let n=await e(`session.remove`,{sessionId:t});n.ok||console.error(`Failed to remove ended session:`,n.error?.message);return}let i=await e(`session.stop`,{sessionId:t});if(!i.ok&&i.error?.code!==`invalid_state`){console.error(`Failed to stop session before removal:`,i.error?.message);return}let a=Date.now()+p_;for(;Date.now()<a;){let r=n.get(hd(t));if(!r)return;if(r.state===`ended`){let n=await e(`session.remove`,{sessionId:t});n.ok||console.error(`Failed to remove ended session:`,n.error?.message);return}await m_(f_)}console.error(`Timed out waiting for session to end before removal:`,t)},[e,n]),submitSessionPrompt:(0,B.useCallback)(async(e,n)=>{let r=n.trim();if(!t||!r)return!1;try{return await t.sendTerminalInput(e,d_.encode(`${r}\r`),`submit`,r),!0}catch(e){return console.error(`Failed to submit session prompt:`,e),!1}},[t]),stopSession:r}}function g_(e,t){let n=V(fd),r=e===void 0?n:e,i=r?.id??`__workspace_empty__`,a=t?.disabled??!1,o=V(ed),s=V(qu),c=V(md(i)),l=V(Hg(i)),u=H(pd),d=H(Hg(i)),f=he(),{persistUiState:p}=Rg(i);return(0,B.useEffect)(()=>{if(a||!r||s!==`connected`)return;let e=!1;return o(`session.list`,{workspaceId:r.id}).then(t=>{if(e||!t.ok||!t.data){console.error(`Failed to fetch sessions:`,t.error?.message);return}let n=t.data;u(e=>{let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e.workspaceId!==r.id));for(let e of n)t[e.id]=e;return t});let a=f.get(Hg(i)),o=__(r?.uiState.paneLayout),s=o?null:Wg(r.id),c=o??s??a??Vg,l=new Set(n.filter(e=>e.state!==`draft`).map(e=>e.id)),m=n.filter(e=>e.state!==`draft`),h=o_(c,l),g=h;h!==a&&d(h),r_(h).length>0||m.length>0&&(g=a_(m.map(e=>e.id)),d(g)),o||(s!==null||r_(g).length>0)&&p({paneLayout:g}).then(e=>{e&&s!==null&&Gg(r.id)})}).catch(t=>{e||console.error(`Failed to fetch sessions:`,t)}),()=>{e=!0}},[s,a,o,p,d,u,f,r?.id,i]),{workspace:r,workspaceId:i,sessions:c,paneLayout:l,setPaneLayout:d}}function __(e){return e?{...e,children:e.children?.map(e=>__(e)??Vg)}:null}function v_(e){return{providerId:e,available:!0,missingCommands:[],missingPrerequisites:[],autoInstallSupported:!1,installReadiness:`ready`,manualGuideKeys:[],docUrls:{provider:``,prerequisites:{}}}}function y_(e){return{claude:{runtime:e?.claude??v_(`claude`),loading:!1},codex:{runtime:e?.codex??v_(`codex`),loading:!1}}}function b_(e,t,n){let[r,i]=(0,B.useState)(y_()),a=(0,B.useRef)({});(0,B.useEffect)(()=>{let t=!1;return(async()=>{let n=await e(`provider.runtimeStatus`,{});if(!t){if(!n.ok||!n.data){i(e=>({claude:{...e.claude,...y_().claude},codex:{...e.codex,...y_().codex}}));return}i(e=>({claude:{...e.claude,...y_(n.data.providers).claude},codex:{...e.codex,...y_(n.data.providers).codex}}))}})(),()=>{t=!0;for(let e of Object.values(a.current))typeof e==`number`&&window.clearTimeout(e)}},[e]);let o=async()=>{let t=await e(`provider.runtimeStatus`,{});!t.ok||!t.data||i(e=>({claude:{...e.claude,runtime:t.data.providers.claude,loading:!1},codex:{...e.codex,runtime:t.data.providers.codex,loading:!1}}))},s=(e,t,n)=>{i(r=>({...r,[e]:{...r[e],loading:!1,inlineError:n,installJob:r[e].installJob?{...r[e].installJob,failure:t}:r[e].installJob}}))};return{states:r,launch:async c=>{let l=r[c].runtime;if(!l)return;if(i(e=>({...e,[c]:{...e[c],loading:!0,inlineError:void 0}})),l.available){let r=await e(`session.create`,{workspaceId:t,providerId:c});if(r.ok&&r.data){n(r.data,c),i(e=>({...e,[c]:{...e[c],loading:!1}}));return}r.error?.code===`provider_cli_missing`&&await o(),i(e=>({...e,[c]:{...e[c],loading:!1,inlineError:r.error?.message}}));return}if(!l.autoInstallSupported){i(e=>({...e,[c]:{...e[c],loading:!1,inlineError:`manual`}}));return}let u=await e(`provider.install.start`,{providerId:c});if(!u.ok||!u.data){i(e=>({...e,[c]:{...e[c],loading:!1,inlineError:u.error?.message}}));return}if(i(e=>({...e,[c]:{...e[c],installJob:u.data,loading:!1}})),u.data.status===`failed`){s(c,u.data.failure,u.data.failure?.message);return}if(u.data.status===`succeeded`){await o();let r=await e(`session.create`,{workspaceId:t,providerId:c});r.ok&&r.data&&n(r.data,c);return}let d=async()=>{let r=await e(`provider.install.get`,{jobId:u.data.jobId});if(!r.ok||!r.data){i(e=>({...e,[c]:{...e[c],loading:!1,inlineError:r.error?.message}}));return}if(i(e=>({...e,[c]:{...e[c],installJob:r.data,loading:!1,inlineError:void 0}})),r.data.status===`queued`||r.data.status===`running`){a.current[c]=window.setTimeout(d,1500);return}if(r.data.status===`failed`){s(c,r.data.failure,r.data.failure?.message);return}await o();let l=await e(`session.create`,{workspaceId:t,providerId:c});if(l.ok&&l.data){n(l.data,c);return}i(e=>({...e,[c]:{...e[c],inlineError:l.error?.message,loading:!1}}))};a.current[c]=window.setTimeout(d,1500)}}}var x_=({workspaceId:e,paneId:t,onAssignSession:n,onClosePane:r,onReplaceWithSession:i,onSplitPane:a})=>{let o=X(),s=V(ed),c=H(pd),{states:l,launch:u}=b_(s,e,(e,r)=>{c(t=>({...t,[e.id]:e})),t?n?.(t,e.id):i?.(e.id)}),d=e=>{let t=l[e];return t.loading||t.installJob?.status===`queued`||t.installJob?.status===`running`?o(`provider.install.cta.installing`):t.runtime?.available?o(`provider.install.cta.start`):t.runtime?.autoInstallSupported?o(`provider.install.cta.install_and_start`):o(`provider.install.cta.manual`)},f=e=>{let t=l[e],n=t.installJob?.failure;return n?{message:n.message,docUrl:n.docUrls.provider}:t.inlineError&&t.inlineError!==`manual`?{message:t.inlineError,docUrl:t.runtime?.docUrls.provider}:t.inlineError===`manual`||t.runtime?.autoInstallSupported===!1?{message:t.runtime?.manualGuideKeys.map(e=>o(e)).join(` `),docUrl:t.runtime?.docUrls.provider}:{docUrl:t.runtime?.docUrls.provider}},p=Object.values(l).some(e=>e.loading||e.installJob?.status===`queued`||e.installJob?.status===`running`);return(0,Z.jsxs)(`div`,{className:`session-card agent-pane`,children:[(0,Z.jsxs)(`div`,{className:`session-header`,children:[(0,Z.jsxs)(`div`,{className:`session-header-left`,children:[(0,Z.jsx)(Nm,{tone:`neutral`,className:`session-dot session-dot-idle`}),(0,Z.jsx)(`div`,{className:`session-header-copy`,children:(0,Z.jsxs)(`div`,{className:`session-title-row`,children:[(0,Z.jsx)(`span`,{className:`session-title`,children:o(`session.provider_select`)||`New Session`}),(0,Z.jsx)(Vm,{color:`neutral`,className:`session-state-badge`,children:`DRAFT`})]})})]}),(0,Z.jsxs)(`div`,{className:`session-header-actions`,children:[(0,Z.jsx)($,{content:`Split horizontal`,children:(0,Z.jsx)(Q,{"aria-label":`Split horizontal`,className:`session-action-btn`,icon:(0,Z.jsx)(If,{size:13}),onClick:()=>{t&&a?.(t,`horizontal`)},size:`sm`})}),(0,Z.jsx)($,{content:`Split vertical`,children:(0,Z.jsx)(Q,{"aria-label":`Split vertical`,className:`session-action-btn`,icon:(0,Z.jsx)(Ff,{size:13}),onClick:()=>{t&&a?.(t,`vertical`)},size:`sm`})}),(0,Z.jsx)($,{content:`Close`,children:(0,Z.jsx)(Q,{"aria-label":`Close`,className:`session-action-btn session-action-btn-close`,icon:(0,Z.jsx)(Hf,{size:14}),onClick:()=>{t&&r?.(t)},size:`sm`})})]})]}),(0,Z.jsx)(`div`,{className:`agent-draft-launcher`,children:(0,Z.jsxs)(`div`,{className:`agent-draft-content`,children:[(0,Z.jsx)(`span`,{className:`agent-draft-kicker`,children:`SESSION LAUNCHER`}),(0,Z.jsx)(`p`,{className:`agent-draft-description`,children:`选择一个 AI 会话,在当前 workspace 里继续查看文件、运行命令和推进代码修改。`}),(0,Z.jsx)(`div`,{className:`agent-draft-providers`,children:[{id:`claude`,title:`Claude`,meta:`analysis`,icon:(0,Z.jsx)(Pf,{size:18}),description:`更适合长上下文梳理、方案分析和代码审查。`,className:`agent-provider-card-claude`},{id:`codex`,title:`Codex`,meta:`workspace`,icon:(0,Z.jsx)(Bd,{size:18}),description:`更适合终端操作、直接改文件和逐步修复问题。`,className:`agent-provider-card-codex`}].map(e=>{let t=l[e.id],n=f(e.id),r=t.loading||t.installJob?.status===`queued`||t.installJob?.status===`running`;return(0,Z.jsx)(gp,{className:`agent-provider-card ${e.className}`,disabled:p,leadingIcon:(0,Z.jsx)(`span`,{className:`agent-provider-card-icon`,children:e.icon}),onClick:()=>{u(e.id)},trailingIcon:(0,Z.jsx)(Ld,{size:16,className:`agent-provider-card-arrow`}),variant:`secondary`,children:(0,Z.jsxs)(`span`,{className:`agent-provider-card-body`,children:[(0,Z.jsxs)(`span`,{className:`agent-provider-card-title-row`,children:[(0,Z.jsx)(`span`,{className:`agent-provider-card-title`,children:e.title}),(0,Z.jsx)(`span`,{className:`agent-provider-card-meta`,children:e.meta})]}),(0,Z.jsx)(`span`,{className:`agent-provider-card-desc`,children:e.description}),(0,Z.jsx)(`span`,{className:`agent-provider-card-cta`,children:d(e.id)}),r?(0,Z.jsx)(`span`,{className:`agent-provider-card-status`,children:o(`provider.install.status.installing`)}):null,n.message?(0,Z.jsxs)(`span`,{className:`agent-provider-card-guide`,children:[(0,Z.jsx)(`span`,{children:n.message}),n.docUrl?(0,Z.jsx)(`a`,{href:n.docUrl,target:`_blank`,rel:`noreferrer`,children:o(`provider.install.open_docs`)}):null]}):null]})},e.id)})})]})})]})},S_=({splitId:e,direction:t,ratio:n,children:r,onRatioCommit:i})=>{let[a,o]=(0,B.useState)(n),s=(0,B.useRef)(null),c=(0,B.useRef)(!1),l=(0,B.useRef)(n),u=(0,B.useCallback)(()=>{c.current=!0,l.current=a,document.body.classList.add(`is-resizing-panels`)},[a]),d=(0,B.useCallback)(e=>{if(!c.current||!s.current)return;let n=s.current.getBoundingClientRect(),r=t===`horizontal`?n.width:n.height,i=t===`horizontal`?e.clientX-n.left:e.clientY-n.top,a=Math.max(.1,Math.min(.9,i/r));o(a),l.current=a},[t]),f=(0,B.useCallback)(()=>{c.current&&(c.current=!1,document.body.classList.remove(`is-resizing-panels`),i?.(l.current))},[i]);(0,B.useEffect)(()=>(document.addEventListener(`mousemove`,d),document.addEventListener(`mouseup`,f),()=>{document.removeEventListener(`mousemove`,d),document.removeEventListener(`mouseup`,f)}),[d,f]),(0,B.useEffect)(()=>{o(n),l.current=n},[n,e]);let[p,m]=Array.isArray(r)?r:[r],h=t===`horizontal`?{gridTemplateColumns:`${a*100}% 8px ${(1-a)*100}%`}:{gridTemplateRows:`${a*100}% 8px ${(1-a)*100}%`};return(0,Z.jsxs)(`div`,{ref:s,className:`pane-layout pane-layout-${t}`,style:{display:`grid`,...h},children:[(0,Z.jsx)(`div`,{className:`pane-layout-child`,children:p}),(0,Z.jsx)(`div`,{className:`pane-layout-divider`,onMouseDown:u,role:`separator`,"aria-orientation":t===`horizontal`?`vertical`:`horizontal`}),(0,Z.jsx)(`div`,{className:`pane-layout-child`,children:m})]})},C_=z(new Map),w_=z(new Map),T_=nd(e=>z(!1)),E_=z({open:!1,sessionId:null,mode:`enable`,draftObjective:``,draftEvaluatorProviderId:`claude`});z(e=>t=>e(C_).get(t));var D_=`__supervisor-empty__`;function O_(e){let t=e?.id??D_,n=V(ed),r=V(T_(t)),i=H(T_(t)),a=H(C_),o=H(w_),s=H(E_);return(0,B.useEffect)(()=>{if(!e||r||e.capability!==`full`||e.state===`draft`||e.state===`ended`)return;let t=!1;return n(`supervisor.get`,{sessionId:e.id}).then(n=>{if(t||!n.ok)return;let r=n.data?.supervisor??null;r?(a(t=>{let n=new Map(t);return n.set(e.id,r),n}),o(e=>{let t=new Map(e);return t.set(r.id,r.cycles??[]),t})):a(t=>{let n=new Map(t);return n.delete(e.id),n}),i(!0)}),()=>{t=!0}},[n,r,e,o,i,a]),{openDialog:(0,B.useCallback)((e,n)=>{s({open:!0,sessionId:t,mode:e,draftObjective:n?.objective??``,draftEvaluatorProviderId:n?.evaluatorProviderId??`claude`})},[t,s])}}var k_=[{id:`claude`,label:`Claude`},{id:`codex`,label:`Codex`}],A_={open:!1,sessionId:null,mode:`enable`,draftObjective:``,draftEvaluatorProviderId:`claude`};function j_({workspaceId:e,sessionId:t}){let[n,r]=Se(E_),i=V(C_),a=V(ed),o=X(),s=t??n.sessionId,c=s?i.get(s):void 0,l=n.open&&(!t||n.sessionId===t),u=n.mode,d={title:o(`supervisor.dialog.${u}.title`),subtitle:o(`supervisor.dialog.${u}.subtitle`),confirm:o(`supervisor.dialog.${u}.confirm`)},f=u===`disable`,p=c?.objective??n.draftObjective,m=(0,B.useCallback)(()=>{r(A_)},[r]);return{dialog:n,supervisor:c,isVisible:l,mode:u,copy:d,isDisable:f,disableObjective:p,close:m,updateDraft:(0,B.useCallback)(e=>{r(t=>({...t,...e}))},[r]),confirm:(0,B.useCallback)(async()=>{if(!n.sessionId)return!1;if(n.mode===`disable`)return c&&(await a(`supervisor.delete`,{id:c.id})).ok?(m(),!0):!1;let t=n.draftObjective.trim();return t?n.mode===`enable`?(await a(`supervisor.create`,{sessionId:n.sessionId,workspaceId:e,objective:t,evaluatorProviderId:n.draftEvaluatorProviderId})).ok?(m(),!0):!1:c&&(await a(`supervisor.update`,{id:c.id,objective:t,evaluatorProviderId:n.draftEvaluatorProviderId})).ok?(m(),!0):!1:!1},[m,n,a,c,e])}}var M_=k_.map(e=>({value:e.id,label:e.label}));function N_({mode:e}){return e===`enable`?(0,Z.jsx)($d,{size:14}):e===`edit`?(0,Z.jsx)(wf,{size:14}):(0,Z.jsx)(Df,{size:14})}function P_({mode:e,draftObjective:t,draftEvaluatorProviderId:n,disableObjective:r,onDraftObjectiveChange:i,onDraftEvaluatorProviderChange:a}){let o=X(),s=(0,B.useId)(),c=(0,B.useId)(),l=(0,B.useId)();return e===`disable`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`supervisor-danger-callout`,role:`alert`,children:[(0,Z.jsx)(Vf,{size:16,className:`supervisor-danger-callout-icon`,"aria-hidden":`true`}),(0,Z.jsxs)(`div`,{className:`supervisor-danger-callout-copy`,children:[(0,Z.jsx)(`strong`,{children:o(`supervisor.dialog.disable.warning_title`)}),(0,Z.jsx)(`small`,{children:o(`supervisor.dialog.disable.warning_body`)})]})]}),(0,Z.jsxs)(`div`,{className:`form-group`,children:[(0,Z.jsx)(`label`,{children:o(`supervisor.field.current_objective`)}),(0,Z.jsx)(`pre`,{className:`objective-preview`,children:r})]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`form-group`,children:[(0,Z.jsx)(`label`,{htmlFor:`objective`,children:o(`supervisor.field.objective`)}),(0,Z.jsx)(qm,{id:`objective`,size:`lg`,rows:5,value:t,onChange:e=>i(e.target.value),"aria-describedby":s,placeholder:o(`supervisor.field.objective_placeholder`),autoFocus:!0}),(0,Z.jsx)(`span`,{id:s,className:`dialog-helper`,children:o(`supervisor.field.objective_helper`)})]}),(0,Z.jsxs)(`div`,{className:`form-group`,children:[(0,Z.jsx)(`label`,{id:c,htmlFor:`evaluator-provider`,children:o(`supervisor.field.evaluator`)}),(0,Z.jsx)(Em,{id:`evaluator-provider`,desktopMode:`listbox`,mobileSheetTitle:o(`supervisor.field.evaluator`),mobileSheetPresentation:`inline`,options:M_,value:n,"aria-labelledby":c,"aria-describedby":l,onValueChange:a}),(0,Z.jsx)(`span`,{id:l,className:`dialog-helper`,children:o(`supervisor.field.evaluator_helper`)})]})]})}function F_({workspaceId:e,sessionId:t}){let n=Fr(),r=X(),{dialog:i,isVisible:a,mode:o,copy:s,isDisable:c,disableObjective:l,close:u,updateDraft:d,confirm:f}=j_({workspaceId:e,sessionId:t});return!a||n===`mobile`?null:(0,Z.jsxs)(Ep,{className:`supervisor-dialog supervisor-dialog--${o}`,onOpenChange:u,open:!0,children:[(0,Z.jsxs)(Dp,{children:[(0,Z.jsxs)(`div`,{className:`supervisor-dialog-header`,children:[(0,Z.jsx)(`span`,{className:`supervisor-dialog-header-icon`,"aria-hidden":`true`,children:(0,Z.jsx)(N_,{mode:o})}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(Op,{children:s.title}),(0,Z.jsx)(`span`,{className:`supervisor-dialog-subtitle`,children:s.subtitle})]})]}),(0,Z.jsx)(Q,{"aria-label":r(`action.close`),icon:(0,Z.jsx)(Hf,{size:14}),onClick:u,size:`sm`})]}),(0,Z.jsx)(kp,{children:(0,Z.jsx)(P_,{mode:o,draftObjective:i.draftObjective,draftEvaluatorProviderId:i.draftEvaluatorProviderId,disableObjective:l,onDraftObjectiveChange:e=>d({draftObjective:e}),onDraftEvaluatorProviderChange:e=>d({draftEvaluatorProviderId:e})})}),(0,Z.jsxs)(Ap,{children:[(0,Z.jsx)(gp,{onClick:u,children:r(`action.cancel`)}),(0,Z.jsx)(gp,{variant:c?`danger`:`primary`,onClick:()=>{f()},disabled:!c&&!i.draftObjective.trim(),children:s.confirm})]})]})}var I_={inactive:`supervisor-state-inactive`,idle:`supervisor-state-idle`,evaluating:`supervisor-state-evaluating`,injecting:`supervisor-state-injecting`,paused:`supervisor-state-paused`,error:`supervisor-state-error`};function L_({sessionId:e}){let t=V(C_),n=V(w_),r=V(ed),i=H(E_),a=X(),o=t.get(e),[s,c]=(0,B.useState)(null);(0,B.useEffect)(()=>{if(!s)return;let e=window.setTimeout(()=>c(null),6e3);return()=>window.clearTimeout(e)},[s]);let l=(0,B.useCallback)(t=>{i({open:!0,sessionId:e,mode:t,draftObjective:o?.objective??``,draftEvaluatorProviderId:o?.evaluatorProviderId??`claude`})},[e,i,o]),u=(0,B.useCallback)(async(e,t,n)=>{c(null);let i=await r(e,{id:t});i.ok||c(i.error?.message?`${n}: ${i.error.message}`:n)},[r]),d=(0,B.useCallback)(async()=>{o&&await u(`supervisor.pause`,o.id,a(`supervisor.action.pause_failed`))},[u,o,a]),f=(0,B.useCallback)(async()=>{o&&await u(`supervisor.resume`,o.id,a(`supervisor.action.resume_failed`))},[u,o,a]),p=(0,B.useCallback)(async()=>{o&&await u(`supervisor.trigger`,o.id,a(`supervisor.action.trigger_failed`))},[u,o,a]),m=o?[...n.get(o.id)??o.cycles??[]].sort((e,t)=>(t.completedAt??t.createdAt)-(e.completedAt??e.createdAt)):[],h=m[0],g=h?h.result??h.errorReason??(h.status===`completed`?a(`supervisor.cycle.no_guidance`):h.status===`evaluating`?a(`supervisor.cycle.evaluating`):a(`supervisor.cycle.waiting`)):null;return{actionError:s,cycles:m,handlePause:d,handleResume:f,handleTrigger:p,isBusy:o?.state===`evaluating`||o?.state===`injecting`,latestCycle:h,latestCycleText:g,openDialog:l,stateClass:o?I_[o.state]:I_.inactive,stateLabel:a(`supervisor.state.${o?o.state:`inactive`}`),supervisor:o}}function R_({sessionId:e,workspaceId:t}){let n=X(),{actionError:r,handlePause:i,handleResume:a,handleTrigger:o,isBusy:s,latestCycle:c,latestCycleText:l,openDialog:u,stateClass:d,stateLabel:f,supervisor:p}=L_({sessionId:e});return p?(0,Z.jsxs)(`div`,{className:`supervisor-card ${d}`,"data-workspace-id":t,children:[(0,Z.jsxs)(`div`,{className:`supervisor-strip-row`,children:[(0,Z.jsxs)(`span`,{className:`supervisor-strip-eyebrow`,children:[(0,Z.jsx)(`span`,{className:`supervisor-pulse ${d}`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`supervisor-label`,children:n(`supervisor.title`)})]}),(0,Z.jsx)(`span`,{className:`supervisor-state-tag ${d}`,children:f}),(0,Z.jsxs)(`div`,{className:`supervisor-actions`,children:[(0,Z.jsx)($,{content:n(`supervisor.action.edit_objective`),children:(0,Z.jsx)(Q,{"aria-label":n(`supervisor.action.edit_objective`),className:`supervisor-icon-btn`,icon:(0,Z.jsx)(wf,{size:12}),onClick:()=>u(`edit`),size:`sm`})}),p.state===`paused`?(0,Z.jsx)($,{content:n(`supervisor.action.resume`),children:(0,Z.jsx)(Q,{"aria-label":n(`supervisor.action.resume`),className:`supervisor-icon-btn`,icon:(0,Z.jsx)(Tf,{size:12}),onClick:()=>{a()},size:`sm`})}):(0,Z.jsx)($,{content:n(`supervisor.action.pause`),children:(0,Z.jsx)(Q,{"aria-label":n(`supervisor.action.pause`),className:`supervisor-icon-btn`,disabled:s,icon:(0,Z.jsx)(Cf,{size:12}),onClick:()=>{i()},size:`sm`})}),(0,Z.jsx)($,{content:n(`supervisor.action.trigger`),children:(0,Z.jsx)(Q,{"aria-label":n(`supervisor.action.trigger`),className:`supervisor-icon-btn`,disabled:s,icon:(0,Z.jsx)(qd,{size:12}),onClick:()=>{o()},size:`sm`})}),(0,Z.jsx)($,{content:n(`supervisor.action.disable`),children:(0,Z.jsx)(Q,{"aria-label":n(`supervisor.action.disable`),className:`supervisor-icon-btn supervisor-icon-btn-danger`,icon:(0,Z.jsx)(Df,{size:12}),onClick:()=>u(`disable`),size:`sm`})})]})]}),(0,Z.jsxs)(`div`,{className:`supervisor-objective-row`,onDoubleClick:()=>u(`edit`),children:[(0,Z.jsx)($,{content:p.objective,children:(0,Z.jsx)(`span`,{className:`supervisor-objective-text`,children:p.objective})}),(0,Z.jsx)(`span`,{className:`supervisor-provider-pill`,children:p.evaluatorProviderId})]}),c?(0,Z.jsx)(`ol`,{className:`supervisor-history-list`,"aria-label":n(`supervisor.latest_evaluation`),children:(0,Z.jsxs)(`li`,{className:`supervisor-history-item`,"data-trigger":c.trigger,children:[(0,Z.jsx)(`span`,{className:`supervisor-history-trigger`,children:c.trigger===`manual`?n(`supervisor.trigger.manual`):n(`supervisor.trigger.auto`)}),(0,Z.jsx)(`span`,{className:`supervisor-history-result`,children:l})]})}):null,r?(0,Z.jsx)(`div`,{className:`supervisor-error`,role:`alert`,children:r}):p.errorReason?(0,Z.jsx)(`div`,{className:`supervisor-error`,role:`alert`,children:p.errorReason}):null]}):(0,Z.jsx)(`div`,{className:`supervisor-card supervisor-card-inactive`,children:(0,Z.jsx)($,{content:n(`supervisor.action.enable`),children:(0,Z.jsxs)(`button`,{className:`supervisor-enable-btn`,onClick:()=>u(`enable`),"aria-label":n(`supervisor.action.enable`),children:[(0,Z.jsx)($d,{size:13}),(0,Z.jsx)(`span`,{children:n(`supervisor.title`)})]})})})}var z_=nd(e=>z({chunks:[],lastSeq:0})),B_=nd(e=>z(null));nd(e=>z(e=>[]));var V_=2,H_={focused:0,"visible-active":1,"visible-other":2,background:3};function U_(e,t){return H_[e]-H_[t]}function W_(e){let t=Math.max(1,e?.concurrency??V_),n=new Map,r=[],i=new Map,a=()=>{r.forEach((e,t)=>{for(let n of e.positionListeners)n(t)})},o=()=>{for(;n.size<t&&r.length>0;){let e=r.shift();if(!e)break;e.running=!0,n.set(e.terminalId,e),e.handle.isGranted=!0,e.grantedResolved||(e.grantedResolved=!0,e.resolveGranted())}a()},s=e=>{let t=r.findIndex(t=>t.terminalId===e);return t>=0?(r.splice(t,1),a(),!0):!1},c=e=>{let t=s(e.terminalId),r=n.delete(e.terminalId);!t&&!r||(i.delete(e.terminalId),r&&o())},l=(e,t)=>{if(e.tier=t,e.running)return;let n=r.findIndex(t=>t.terminalId===e.terminalId);if(n<0)return;r.splice(n,1);let i=r.findIndex(e=>U_(t,e.tier)<0);i<0&&(i=r.length),r.splice(i,0,e),o()},u=e=>{let t=r.findIndex(t=>U_(e.tier,t.tier)<0);t<0&&(t=r.length),r.splice(t,0,e),o()};return{request(e){let a=i.get(e.terminalId);if(a)return U_(e.tier,a.tier)<0&&l(a,e.tier),a.handle;let o=()=>{},s=new Promise(e=>{o=e}),d={};return d.terminalId=e.terminalId,d.tier=e.tier,d.granted=s,d.resolveGranted=o,d.grantedResolved=!1,d.running=!1,d.positionListeners=new Set,d.handle={granted:s,isGranted:!1,promote:e=>l(d,e),release:()=>c(d),subscribePosition:e=>{d.positionListeners.add(e);let t=r.findIndex(e=>e.terminalId===d.terminalId);return t>=0&&e(t),()=>{d.positionListeners.delete(e)}}},i.set(e.terminalId,d),n.size<t?(d.running=!0,n.set(d.terminalId,d),d.handle.isGranted=!0,d.grantedResolved=!0,d.resolveGranted()):u(d),d.handle},inspect(){return{running:Array.from(n.keys()),queued:r.map((e,t)=>({terminalId:e.terminalId,tier:e.tier,queuePosition:t}))}}}}var G_=W_(),K_=400,q_=[{id:`escape`,text:`Esc`},{id:`tab`,text:`Tab`},{id:`arrow_up`,text:`↑`},{id:`arrow_left`,text:`←`},{id:`arrow_down`,text:`↓`},{id:`arrow_right`,text:`→`},{id:`enter`,text:`Enter`}];function J_(e,t){switch(e){case`escape`:return t.escape;case`tab`:return t.tab;case`enter`:return t.enter;case`arrow_up`:return t.up;case`arrow_down`:return t.down;case`arrow_left`:return t.left;case`arrow_right`:return t.right}}function Y_({ctrlMode:e,shiftArmed:t,disabled:n=!1,labels:r,onKeyPress:i,onCtrlTap:a,onCtrlLongPress:o,onShiftTap:s}){let c=(0,B.useRef)(null),l=(0,B.useRef)(!1),u=(0,B.useRef)(null),d=n,f=()=>{c.current!==null&&(clearTimeout(c.current),c.current=null)};(0,B.useEffect)(()=>{d&&(f(),l.current=!1,u.current=null)},[d]),(0,B.useEffect)(()=>()=>{f()},[]);let p=()=>{d||(f(),l.current=!1,u.current=null,c.current=setTimeout(()=>{l.current=!0,u.current=`pointer`,o()},K_))},m=()=>{f(),l.current=!1,u.current=null},h=()=>{d||f()},g=e=>{if(!d){if(l.current){let t=u.current===`pointer`||u.current===`keyboard`&&e.detail===0;if(l.current=!1,u.current=null,t)return}a()}},_=e=>{d||(e.key===`Enter`||e.key===` `)&&e.altKey&&(e.preventDefault(),f(),l.current=!0,u.current=`keyboard`,o())},v=e===`locked`?r.ctrlLocked:e===`armed`?r.ctrlArmed:r.ctrl,y=t?r.shiftArmed:r.shift;return(0,Z.jsx)(`div`,{className:`mobile-terminal-input-bar`,"data-expanded":`true`,"data-disabled":n?`true`:`false`,children:(0,Z.jsxs)(`div`,{className:`mobile-terminal-input-bar__keys`,role:`group`,"aria-label":r.shortcuts,children:[(0,Z.jsx)(`button`,{type:`button`,className:`mobile-terminal-input-bar__key mobile-terminal-input-bar__ctrl`,"data-ctrl-mode":e,"aria-pressed":e!==`off`,"aria-label":v,"aria-keyshortcuts":`Alt+Enter Alt+Space`,disabled:d,onPointerDown:p,onPointerUp:h,onPointerCancel:m,onPointerLeave:m,onClick:g,onKeyDown:_,children:`Ctrl`}),(0,Z.jsx)(`button`,{type:`button`,className:`mobile-terminal-input-bar__key mobile-terminal-input-bar__shift`,"data-shift-armed":t?`true`:`false`,"aria-pressed":t,"aria-label":y,disabled:d,onClick:s,children:`Shift`}),q_.map(e=>(0,Z.jsx)(`button`,{type:`button`,className:`mobile-terminal-input-bar__key`,"aria-label":J_(e.id,r),disabled:d,onClick:()=>i(e.id),children:e.text},e.id))]})})}var X_={escape:`\x1B`,tab:` `,enter:`\r`,arrow_up:`\x1B[A`,arrow_down:`\x1B[B`,arrow_left:`\x1B[D`,arrow_right:`\x1B[C`},Z_={tab:`\x1B[Z`,arrow_up:`\x1B[1;2A`,arrow_down:`\x1B[1;2B`,arrow_left:`\x1B[1;2D`,arrow_right:`\x1B[1;2C`},Q_=`control`;function $_(e,t){return t?.shift?Z_[e]??X_[e]:X_[e]}function ev(e){return e===`off`?`armed`:`off`}function tv(){return`locked`}function nv(e,t){if(t===`off`)return{data:e,nextCtrlMode:`off`};if(!/^[A-Za-z]$/.test(e))return{data:e,nextCtrlMode:t};let n=e.toUpperCase();return{data:String.fromCharCode(n.charCodeAt(0)-64),nextCtrlMode:t===`armed`?`off`:`locked`,activity:Q_}}var rv=12e4;function iv(e){return e instanceof Error&&e.message.includes(`Command timeout: terminal.replay`)||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`&&String(e.message).includes(`Command timeout: terminal.replay`)?`timeout`:`failed`}function av(e){return`'${e.replace(/'/g,`'\\''`)}'`}var ov=class extends Error{constructor(e,t,n){super(n??e),this.code=e,this.status=t,this.name=`UploadError`}};async function sv(e){let t=new FormData;t.append(`workspaceId`,e.workspaceId);for(let n of e.files)t.append(`files`,n,n.name);let n;try{n=await fetch(`/api/uploads`,{method:`POST`,body:t,credentials:`include`})}catch(e){throw new ov(`network_error`,0,e.message)}let r;try{r=await n.json()}catch{r={}}if(!n.ok||!r.ok)throw new ov(r.error??`http_${n.status}`,n.status);return r.files??[]}function cv(e){let{containerRef:t,workspaceId:n,sendTextToTerminal:r,enabled:i}=e,[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(0),c=(0,B.useRef)(0),l=(0,B.useRef)(0),u=(0,B.useRef)(new Map),d=(0,B.useRef)(Promise.resolve()),f=H(Hh),p=(0,B.useCallback)(async()=>{for(;u.current.has(l.current);){let e=l.current,t=u.current.get(e)??null;u.current.delete(e),l.current+=1,t&&await r(t)}},[r]),m=(0,B.useCallback)(async(e,t)=>{u.current.set(e,t),d.current=d.current.then(()=>p()),await d.current},[p]),h=(0,B.useCallback)(async e=>{if(e.length===0)return;let t=c.current;c.current+=1,s.current+=1,o(!0);try{let r=await sv({workspaceId:n,files:e});if(r.length===0){await m(t,null);return}await m(t,`${r.map(e=>av(e.path)).join(` `)} `)}catch(e){await m(t,null),f({kind:`error`,title:`Upload failed`,body:`Could not upload file(s): ${e instanceof ov?e.code:`unknown`}`,duration:5e3})}finally{s.current=Math.max(0,s.current-1),o(s.current>0)}},[f,m,n]);return(0,B.useEffect)(()=>{let e=t.current;if(!e||!i)return;let n=e=>{let t=e.clipboardData?.files;!t||t.length===0||(e.preventDefault(),e.stopPropagation(),h(Array.from(t)))},r=e=>{let t=e.dataTransfer?.files;!t||t.length===0||(e.preventDefault(),e.stopPropagation(),h(Array.from(t)))},a=e=>{Array.from(e.dataTransfer?.types??[]).includes(`Files`)&&e.preventDefault()};return e.addEventListener(`paste`,n,{capture:!0}),e.addEventListener(`drop`,r,{capture:!0}),e.addEventListener(`dragover`,a,{capture:!0}),()=>{e.removeEventListener(`paste`,n,{capture:!0}),e.removeEventListener(`drop`,r,{capture:!0}),e.removeEventListener(`dragover`,a,{capture:!0})}},[t,i,h]),{busy:a}}var lv=({state:e,queuePosition:t})=>{let n=X(),r=e===`granting`?n(`terminal.replay.loading_title`):t===0?n(`terminal.replay.up_next`):n(`terminal.replay.queued_title`,{count:t??0});return(0,Z.jsx)(`div`,{className:`xterm-replay-overlay xterm-replay-overlay--placeholder`,role:`status`,"aria-live":`polite`,children:(0,Z.jsxs)(`div`,{className:`xterm-replay-overlay__card`,children:[e===`granting`?(0,Z.jsx)(`div`,{className:`xterm-replay-overlay__spinner`,"aria-hidden":`true`}):null,(0,Z.jsx)(`div`,{className:`xterm-replay-overlay__title`,children:r})]})})},uv=16,dv=80,fv=.12,pv=.02,mv=.92,hv=16,gv=new Set([`\x1B[I`,`\x1B[O`]);function _v(e){return/^\x1b\[\d+;\d+R$/.test(e)||/^\x1b\[(?:\?|>)(?:\d+;)*\d*c$/.test(e)}function vv(e){return gv.has(e)?`system`:e.includes(`\r`)||e.includes(`
107
- `)?`submit`:`typing`}function yv(e){let t=e.length;for(;t>0;){let n=e[t-1];if(!n||!/\s/.test(n))break;--t}for(;t>0;){let n=e[t-1];if(!n||/\s/.test(n))break;--t}return e.slice(0,t)}function bv(e,t,n){if(n===`system`)return{nextDraft:e};let r=e,i;for(let e=0;e<t.length;e+=1){let n=t[e];if(n===`\x1B`){let n=t.slice(e).match(/^\x1b(?:\[[0-9;?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\)|P[\s\S]*?\x1b\\|[@-_])/);if(n){e+=n[0].length-1;continue}}if(n===``||n===`\b`){r=r.slice(0,-1);continue}if(n===``){r=``;continue}if(n===``){r=yv(r);continue}if(n===``){r=``,i=void 0;continue}if(n===`\r`||n===`
108
- `){i=r.length>0?r:i,r=``;continue}n>=` `&&(r+=n)}return{nextDraft:r,submittedText:i}}function xv(e,t){return e?`item`in e&&typeof e.item==`function`?e.item(t):e[t]??null:null}function Sv(e,t){if(t===null||!e)return null;for(let n=0;n<e.length;n+=1){let r=xv(e,n);if(r?.identifier===t)return r}return null}function Cv(e,t){if(e.rows>0){let n=e.element?.querySelector(`.xterm-screen`),r=n instanceof HTMLElement?n.getBoundingClientRect().height:t.getBoundingClientRect().height;if(r>0)return r/e.rows}return uv}var wv={dark:{background:`#0b1218`,foreground:`#e5edf3`,cursor:`#78d7b2`,cursorAccent:`#0b1218`,selectionBackground:`#1e3040`,selectionForeground:`#e5edf3`,black:`#0a1014`,red:`#ff9eb0`,green:`#78d7b2`,yellow:`#f1b86a`,blue:`#6cb6ff`,magenta:`#c792ea`,cyan:`#78d7b2`,white:`#9fb0bc`,brightBlack:`#4a5b6a`,brightRed:`#ff9eb0`,brightGreen:`#78d7b2`,brightYellow:`#f1b86a`,brightBlue:`#6cb6ff`,brightMagenta:`#c792ea`,brightCyan:`#78d7b2`,brightWhite:`#e5edf3`},light:{background:`#fafbfc`,foreground:`#1f2328`,cursor:`#0969da`,cursorAccent:`#fafbfc`,selectionBackground:`#dde4ea`,selectionForeground:`#1f2328`,black:`#24292f`,red:`#cf222e`,green:`#1a7f37`,yellow:`#9a6700`,blue:`#0969da`,magenta:`#8250df`,cyan:`#1b7c83`,white:`#57606a`,brightBlack:`#8b949e`,brightRed:`#cf222e`,brightGreen:`#1a7f37`,brightYellow:`#9a6700`,brightBlue:`#0969da`,brightMagenta:`#8250df`,brightCyan:`#1b7c83`,brightWhite:`#1f2328`}};function Tv(e){return wv[e]}function Ev(e){return e.type!==`keydown`||e.shiftKey||e.altKey?!1:(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`v`}var Dv=new TextEncoder,Ov=new TextDecoder(`utf-8`,{fatal:!1}),kv=`coderStudio.terminalTrace`;function Av(){try{return globalThis.localStorage?.getItem(kv)===`1`}catch{return!1}}function jv(){if(typeof document>`u`)return Promise.resolve();let e=document.fonts;return e?.ready?e.ready.then(()=>void 0,()=>void 0):Promise.resolve()}function Mv(e,t){return e.split(t).length-1}function Nv(e){let t=typeof e==`string`?e:Ov.decode(e);return{length:typeof e==`string`?e.length:e.byteLength,syncStart:Mv(t,`\x1B[?2026h`),syncEnd:Mv(t,`\x1B[?2026l`),clearToEnd:Mv(t,`\x1B[J`),clearScreen:Mv(t,`\x1B[2J`),eraseLine:Mv(t,`\x1B[K`),cursorHome:Mv(t,`\x1B[1;1H`),dsr:Mv(t,`\x1B[6n`),da:Mv(t,`\x1B[c`),reverseIndex:Mv(t,`\x1BM`),cursorMoves:t.match(/\x1b\[[0-9;]*[Hf]/g)?.length??0,scrollRegions:t.match(/\x1b\[[0-9;]*r/g)?.slice(0,6)??[]}}function Pv(e,t,n={}){Av()&&console.debug(`[terminal-trace]`,{at:Math.round(performance.now()*100)/100,terminalId:e,event:t,...n})}function Fv(e,t){let n=Math.min(t,e.chunks.length);return n===0?e:{...e,chunks:e.chunks.slice(n)}}function Iv({terminalId:e,workspaceId:t,readOnly:n=!1,isActiveSession:r=!1,terminalKind:i}){let a=X(),o=Fr(),s=V(Vr),c=V(Ku),l=V(ed),[u,p]=Se(z_(e)),m=V(B_(e)),h=i??m?.kind??`shell`,g=!n&&m?.alive!==!1,_=(0,B.useRef)(null),v=(0,B.useRef)(null),y=(0,B.useRef)(null),b=(0,B.useRef)(null),x=(0,B.useRef)(null),S=(0,B.useRef)(!1),C=(0,B.useRef)([]),w=(0,B.useRef)(null),T=(0,B.useRef)(!0),E=(0,B.useRef)(null),D=(0,B.useRef)([]),O=(0,B.useRef)(!1),k=(0,B.useRef)(0),A=(0,B.useRef)(`idle`),j=(0,B.useRef)(null),M=(0,B.useRef)(0),N=(0,B.useRef)(null),P=(0,B.useRef)(0),F=(0,B.useRef)(0),ee=(0,B.useRef)(s),te=(0,B.useRef)(``),ne=(0,B.useRef)(0),I=(0,B.useRef)(null),L=(0,B.useRef)(!1),R=(0,B.useRef)(null),re=(0,B.useRef)({activeTouchId:null,lastClientY:0,carryPx:0,pxPerLine:null,velocityPxPerMs:0,lastMomentumFrameAt:0,momentumFrameId:null,samples:[]}),[ie,ae]=(0,B.useState)({kind:`loading`}),[z,oe]=(0,B.useState)(o===`mobile`?{kind:`granted`}:{kind:`idle`}),[se,ce]=(0,B.useState)(`off`),[le,ue]=(0,B.useState)(!1),de=(0,B.useRef)(`off`),fe=(0,B.useRef)(!1),[pe,me]=(0,B.useState)(()=>!c||typeof c.getStatus!=`function`?`disconnected`:c.getStatus()),he=(0,B.useRef)(()=>{}),ge=(0,B.useRef)(()=>{});(0,B.useEffect)(()=>(S.current=!0,()=>{S.current=!1}),[]),(0,B.useEffect)(()=>{ee.current=s},[s]),(0,B.useLayoutEffect)(()=>{if(o===`mobile`){oe({kind:`granted`}),L.current=!0,I.current=null;return}L.current=!1;let t=m?.alive===!1?`background`:r?`visible-active`:`visible-other`,n=G_.request({terminalId:e,tier:t});I.current=n,oe(n.isGranted?{kind:`granted`}:{kind:`idle`});let i=!1,a=n.subscribePosition(e=>{i||oe({kind:`queued`,queuePosition:e})});return n.isGranted||n.granted.then(()=>{i||oe({kind:`granted`})}),()=>{i=!0,a(),L.current||=(n.release(),!0),I.current=null}},[e,o]),(0,B.useEffect)(()=>{if(o===`mobile`)return;let e=m?.alive===!1?`background`:r?`visible-active`:`visible-other`;I.current?.promote(e)},[r,m?.alive,o]),(0,B.useEffect)(()=>{v.current&&(v.current.options.theme=Tv(s))},[s]),(0,B.useEffect)(()=>{let e=_.current;if(!e||typeof window>`u`||typeof window.matchMedia!=`function`||!window.matchMedia(`(pointer: coarse)`).matches)return;let t=re.current,n=()=>{t.momentumFrameId!==null&&(cancelAnimationFrame(t.momentumFrameId),t.momentumFrameId=null),t.velocityPxPerMs=0,t.lastMomentumFrameAt=0},r=(e,n)=>{t.samples.push({clientY:e,at:n});let r=n-dv;for(;t.samples.length>0&&t.samples[0].at<r;)t.samples.shift()},i=()=>{if(t.samples.length<2){t.velocityPxPerMs=0;return}let e=t.samples[0],n=t.samples[t.samples.length-1],r=n.at-e.at;if(r<=0){t.velocityPxPerMs=0;return}t.velocityPxPerMs=(e.clientY-n.clientY)/r},a=(n,r)=>{let i=n.buffer.active.baseY;if(i<=0)return t.carryPx=0,`blocked`;t.carryPx+=r;let a=t.pxPerLine??=Cv(n,e),o=t.carryPx>0?Math.floor(t.carryPx/a):Math.ceil(t.carryPx/a);if(o===0)return`buffered`;let s=n.buffer.active.viewportY,c=i-s,l=o>0?Math.min(o,c):Math.max(o,-s);return l===0?(t.carryPx=0,`blocked`):(n.scrollLines(l),t.carryPx-=l*a,`scrolled`)},o=e=>{if(t.momentumFrameId===null)return;let r=v.current;if(!r){n();return}let i=t.lastMomentumFrameAt>0?t.lastMomentumFrameAt:e-hv,s=Math.max(1,Math.min(64,e-i));t.lastMomentumFrameAt=e;let c=a(r,t.velocityPxPerMs*s),l=mv**+(s/hv);if(t.velocityPxPerMs*=l,c===`blocked`||Math.abs(t.velocityPxPerMs)<=pv){t.carryPx=0,n(),t.pxPerLine=null;return}t.momentumFrameId=requestAnimationFrame(o)},s=()=>{n(),t.activeTouchId=null,t.lastClientY=0,t.carryPx=0,t.pxPerLine=null,t.samples=[]},c=i=>{if(i.touches.length!==1){s();return}let a=xv(i.touches,0);if(!a){s();return}n(),t.activeTouchId=a.identifier,t.lastClientY=a.clientY,t.carryPx=0,t.pxPerLine=v.current?Cv(v.current,e):uv,t.samples=[],r(a.clientY,performance.now())},l=e=>{let n=Sv(e.changedTouches,t.activeTouchId),o=v.current;if(!n||!o)return;if(o.buffer.active.baseY<=0){t.lastClientY=n.clientY,t.carryPx=0,t.samples=[],t.velocityPxPerMs=0;return}let s=t.lastClientY-n.clientY;t.lastClientY=n.clientY,r(n.clientY,performance.now()),i();let c=a(o,s);(c===`buffered`||c===`scrolled`)&&e.cancelable&&e.preventDefault()},u=e=>{if(Sv(e.changedTouches,t.activeTouchId)){let n=Sv(e.changedTouches,t.activeTouchId);if(n&&(r(n.clientY,performance.now()),i()),t.activeTouchId=null,t.lastClientY=0,t.samples=[],Math.abs(t.velocityPxPerMs)>=fv){t.lastMomentumFrameAt=0,t.momentumFrameId=requestAnimationFrame(o);return}t.carryPx=0,t.pxPerLine=null,t.velocityPxPerMs=0}},d=()=>{s()};return e.addEventListener(`touchstart`,c,{passive:!0}),e.addEventListener(`touchmove`,l,{passive:!1}),e.addEventListener(`touchend`,u,{passive:!0}),e.addEventListener(`touchcancel`,d,{passive:!0}),()=>{e.removeEventListener(`touchstart`,c),e.removeEventListener(`touchmove`,l),e.removeEventListener(`touchend`,u),e.removeEventListener(`touchcancel`,d),s()}},[]);let _e=(0,B.useCallback)(()=>{x.current!==null&&cancelAnimationFrame(x.current),x.current=requestAnimationFrame(()=>{x.current=null;try{let t=v.current?{cols:v.current.cols,rows:v.current.rows}:null;y.current?.fit(),Pv(e,`fit`,{before:t,after:v.current?{cols:v.current.cols,rows:v.current.rows}:null})}catch(e){console.error(`Failed to fit xterm instance:`,e)}finally{let e=C.current;C.current=[];for(let t of e)t()}})},[e]),ve=(0,B.useCallback)(()=>new Promise(e=>{C.current.push(e)}),[]),ye=(0,B.useCallback)(e=>{de.current=e,ce(e)},[]),be=(0,B.useCallback)(e=>{fe.current=e,ue(e)},[]),xe=(0,B.useCallback)(()=>{v.current?.focus()},[]),H=(0,B.useCallback)(async(t,n)=>{if(P.current>0&&_v(t)){Pv(e,`input.suppressed-replay-response`,{summary:Nv(t)});return}if(!T.current)return;if(!c){console.error(`Cannot send terminal input: WebSocket not connected`);return}let r=ne.current+1;ne.current=r;let i=de.current,a=te.current,o=nv(t,i),s=o.activity??n??vv(o.data),{nextDraft:l,submittedText:u}=bv(a,o.data,s);try{o.nextCtrlMode!==i&&ye(o.nextCtrlMode),Pv(e,`input`,{activity:s,summary:Nv(o.data)}),te.current=l,await c.sendTerminalInput(e,Dv.encode(o.data),s,u)}catch(e){ne.current===r&&(te.current=a,o.nextCtrlMode!==i&&de.current===o.nextCtrlMode&&ye(i)),console.error(`Failed to send terminal input:`,e)}},[e,ye,c]),Ce=(0,B.useCallback)(async({cols:t,rows:n})=>{if(!T.current)return;let r=E.current;if(r&&r.cols===t&&r.rows===n)return;E.current={cols:t,rows:n},Pv(e,`resize.dispatch`,{previousSize:r,nextSize:{cols:t,rows:n}});let i=await l(`terminal.resize`,{terminalId:e,cols:t,rows:n});i.ok||console.error(`Failed to sync terminal size:`,i.error),Pv(e,`resize.result`,{nextSize:{cols:t,rows:n},ok:i.ok,error:i.ok?void 0:i.error})},[e,l]),{busy:we}=cv({containerRef:_,workspaceId:t,sendTextToTerminal:(0,B.useCallback)(async e=>{await H(e)},[H]),enabled:g});(0,B.useEffect)(()=>{T.current=g,v.current&&(v.current.options.disableStdin=!g||we,v.current.options.cursorBlink=g&&!we)},[g,we]),(0,B.useEffect)(()=>{if(!c){me(`disconnected`);return}if(typeof c.getStatus==`function`?me(c.getStatus()):me(`connected`),typeof c.onStatus==`function`)return c.onStatus(e=>{me(e)})},[c]),(0,B.useLayoutEffect)(()=>{ye(`off`),be(!1),te.current=``,ne.current+=1},[e,ye,be]),(0,B.useEffect)(()=>{he.current=H},[H]),(0,B.useEffect)(()=>{ge.current=Ce},[Ce]),(0,B.useEffect)(()=>{if(o!==`mobile`&&z.kind!==`granted`||!_.current)return;let n=!1,r=null,i=F.current+1;F.current=i,P.current=0,R.current=null,N.current=null,O.current=!1,k.current=0,A.current=`idle`,j.current=null,D.current=[],E.current=null,ae({kind:`loading`});let a=new f({theme:Tv(ee.current),fontFamily:`JetBrains Mono, Fira Code, SF Mono, monospace`,fontSize:11,scrollback:5e3,cursorBlink:g&&!we,cursorStyle:`block`,disableStdin:!g||we,allowProposedApi:!0}),s=new d;a.loadAddon(s),a.onResize(e=>{ge.current(e)}),a.onData(e=>{he.current(e)}),a.attachCustomKeyEventHandler(e=>!Ev(e)),a.open(_.current),Pv(e,`mount.open`),v.current=a,y.current=s,_e();let u=ve();o!==`mobile`&&u.then(async()=>{await jv(),!(n||!S.current)&&_e()}).catch(()=>{});let m=async()=>{c&&(typeof c.getStatus!=`function`||typeof c.onStatus!=`function`||c.getStatus()!==`connected`&&await new Promise(e=>{let t=!1,n=()=>{t||(t=!0,r?.(),r=null,e())};r=c.onStatus(e=>{e===`connected`&&n()}),c.getStatus()===`connected`&&n()}))},h=u.then(async()=>{if(!c||(await m(),n||!S.current))return;let{cols:e,rows:t}=a;await ge.current({cols:e,rows:t})}),C=(e,t)=>{P.current+=1;let n=!1,r=()=>{n||(n=!0,F.current===i&&(P.current=Math.max(0,P.current-1),t?.()))};try{a.write(e,r)}catch(e){throw r(),e}},w=Ru.terminalOutput(t,e),T=Ru.terminalExit(t,e),te=e=>{let t=D.current;D.current=[];let n=[],r=e;for(let e of t)e.seq<=r||(n.push(e),r=e.seq);return{entries:n,latestCoveredSeq:r}},ne=e=>{A.current=`done`,j.current=null,e&&N.current===e&&(N.current=`reconnect`),R.current?.()},re=(t,n,r)=>{if(k.current=n,O.current=!0,r.length===0){M.current=Math.max(M.current,n),ne(t);return}let o=r.length,s=e=>{!S.current||F.current!==i||(M.current=Math.max(M.current,e),o=Math.max(0,o-1),o===0&&ne(t))};for(let t of r){if(t.resetTerminalBeforeWrite&&typeof v.current?.reset==`function`&&v.current.reset(),t.kind===`historical`?Pv(e,`write.historical`,{seq:t.seq,size:t.bytes.byteLength,summary:Nv(t.bytes)}):Pv(e,`write.pending-replay-chunk`,{seq:t.seq,summary:Nv(t.bytes)}),t.kind===`historical`){C(t.bytes,()=>{s(t.seq)});continue}a.write(t.bytes,()=>{s(t.seq)})}},ie=(e,t)=>{if(!S.current||!v.current||!e)return;let n=j.current,r=k.current,i=[];e.ok&&e.data?.status===t.successStatus?(t.successBytes&&i.push({kind:`historical`,bytes:t.successBytes,seq:t.coveredSeq??r,resetTerminalBeforeWrite:t.resetTerminalBeforeWrite}),r=t.coveredSeq??r,ae({kind:`ready`}),o!==`mobile`&&(I.current?.release(),L.current=!0)):e.data?.status===`too_old`?(v.current&&v.current.writeln(`\r
109
- \x1B[33m[Session history truncated - output exceeds buffer size]\x1B[0m`),ae({kind:`degraded`,reason:`truncated`}),o!==`mobile`&&(I.current?.release(),L.current=!0)):e.data?.status===`unknown`?(ae({kind:`degraded`,reason:`closed`}),o!==`mobile`&&(I.current?.release(),L.current=!0)):e.ok||(console.error(`Failed to replay terminal output:`,e.error),ae({kind:`degraded`,reason:iv(e.error)}),o!==`mobile`&&(I.current?.release(),L.current=!0));let{entries:a,latestCoveredSeq:s}=te(r);r=s;for(let e of a)i.push({kind:`pending`,bytes:e.bytes,seq:e.seq});p(e=>({...e,chunks:[],lastSeq:Math.max(e.lastSeq,r)})),re(n,r,i)},oe=e=>{ie(e,{successStatus:`ok`,successBytes:e?.data?.bytes,coveredSeq:e?.data?.seq})},se=e=>{if(console.error(`Failed to recover terminal output:`,e),!S.current||!v.current)return;let t=j.current;ae({kind:`degraded`,reason:iv(e)}),o!==`mobile`&&(I.current?.release(),L.current=!0),p(e=>({...e,chunks:[],lastSeq:Math.max(e.lastSeq,k.current)}));let{entries:n,latestCoveredSeq:r}=te(k.current);re(t,r,n.map(e=>({kind:`pending`,bytes:e.bytes,seq:e.seq})))},ce=t=>{c&&(A.current=`in-flight`,O.current=!1,ae({kind:`loading`}),c.sendCommand(`terminal.snapshot`,{terminalId:e},{timeoutMs:rv}).then(e=>({ok:!0,data:e})).catch(e=>({ok:!1,error:e})).then(e=>{if(!(!S.current||!v.current)){if(e.ok&&e.data?.status===`ok`&&e.data.bytes&&typeof e.data.seq==`number`){ie(e,{successStatus:`ok`,successBytes:e.data.bytes,coveredSeq:e.data.seq,resetTerminalBeforeWrite:t?.resetTerminalBeforeWrite});return}if(t?.onUnavailable){t.onUnavailable(e);return}se(e.ok?Error(`terminal.snapshot returned status ${e.data?.status??`unknown`}`):e.error)}}))},le=(t,n)=>{c&&(A.current=`in-flight`,O.current=!1,t===0&&ae({kind:`loading`}),Pv(e,`replay.request`,{lastSeq:t}),(c?c.sendCommand(`terminal.replay`,{terminalId:e,lastSeq:t},{timeoutMs:rv}).then(e=>({ok:!0,data:e})):l(`terminal.replay`,{terminalId:e,lastSeq:t})).then(e=>{if(e.ok&&e.data?.status===`too_old`&&n?.onTooOld){n.onTooOld();return}oe(e)}).catch(e=>{if(n?.onError){n.onError(e);return}se(e)}))},ue=()=>{N.current||=j.current??`reconnect`,A.current=`idle`,j.current=null,O.current=!1,R.current?.()},de=()=>typeof c.getStatus==`function`?c.getStatus():`connected`,fe=(t,n)=>{let r=de();if(N.current===`reconnect`||r===`disconnected`||r===`reconnecting`){Pv(e,`reconnect.snapshot-fallback.defer-until-reconnect`,{lastSeq:M.current,reason:t,error:n?String(n):void 0,connectionStatus:r}),ue();return}Pv(e,`reconnect.snapshot-fallback`,{lastSeq:M.current,reason:t,error:n?String(n):void 0}),ce({resetTerminalBeforeWrite:!0,onUnavailable:t=>{let n=de();if(N.current===`reconnect`||n===`disconnected`||n===`reconnecting`){Pv(e,`reconnect.snapshot.defer-until-reconnect`,{reason:t.ok?t.data?.status??`unsupported`:String(t.error),connectionStatus:n}),ue();return}se(t.ok?Error(`terminal.snapshot returned status ${t.data?.status??`unknown`}`):t.error)}})},pe=t=>{if(c){if(j.current=t,t===`reconnect`){ae({kind:`loading`}),le(M.current,{onTooOld:()=>{fe(`too_old`)},onError:e=>{fe(`error`,e)}});return}ce({onUnavailable:t=>{let n=de();if(N.current===`initial`||n===`disconnected`||n===`reconnecting`){Pv(e,`snapshot.defer-until-reconnect`,{reason:t.ok?t.data?.status??`unsupported`:String(t.error),connectionStatus:n}),ue();return}Pv(e,`snapshot.fallback`,{reason:t.ok?t.data?.status??`unsupported`:String(t.error)}),le(0)}})}};return R.current=()=>{if(!N.current||typeof c.getStatus==`function`&&c.getStatus()!==`connected`||A.current===`in-flight`)return;let e=N.current;N.current=null,pe(e)},c&&(b.current=c.subscribe([w,T],(t,n,r)=>{if(t===w){let t=n;if(Pv(e,`live.output`,{seq:r,replayCompleted:O.current,replayedSeq:k.current,size:t.bytes.byteLength,summary:Nv(t.bytes)}),!O.current){D.current.push({bytes:t.bytes,seq:r});return}if(r<=k.current){Pv(e,`live.drop-covered`,{seq:r,replayedSeq:k.current});return}let i=r-t.bytes.byteLength;if(i>k.current){Pv(e,`live.gap`,{seq:r,chunkStartSeq:i,replayedSeq:k.current}),D.current.push({bytes:t.bytes,seq:r}),p(e=>({chunks:[],lastSeq:k.current})),le(k.current);return}p(e=>r<=e.lastSeq?e:{chunks:[...e.chunks,t.bytes],lastSeq:r}),k.current=r}else if(t===T){let e=n;v.current&&v.current.writeln(`\r\n[Process exited with code ${e.code}]`)}})),(async()=>{await h,S.current&&pe(`initial`)})().catch(e=>{se(e)}),()=>{if(n=!0,R.current=null,N.current=null,F.current===i&&(F.current+=1,P.current=0),r&&=(r(),null),b.current&&=(b.current(),null),x.current!==null&&(cancelAnimationFrame(x.current),x.current=null),v.current){try{v.current.dispose()}catch(e){console.error(`Failed to dispose xterm instance:`,e)}v.current=null,y.current=null}}},[l,z.kind,_e,p,e,h,o,t,c]),(0,B.useEffect)(()=>{if(!(!c||typeof c.onStatus!=`function`))return c.onStatus(e=>{if(e===`disconnected`||e===`reconnecting`){A.current!==`idle`&&(N.current=j.current??`reconnect`);return}e!==`connected`||!N.current||R.current?.()})},[c]),(0,B.useEffect)(()=>{let t=v.current;if(!t)return;let{chunks:n}=u,r=n.length;if(r>0){let i=Array(n.length),a=u.lastSeq;for(let e=n.length-1;e>=0;--e)i[e]=a,a-=n[e]?.byteLength??0;for(let r=0;r<n.length;r++){let a=n[r];if(!a)continue;let o=i[r]??u.lastSeq;Pv(e,`write.live-buffer`,{index:r,lastSeq:u.lastSeq,summary:Nv(a)}),t.write(a,()=>{M.current=Math.max(M.current,o)})}p(e=>Fv(e,r))}},[z.kind,u,p,e]),(0,B.useEffect)(()=>{let t=_.current,n=y.current;if(!t||!n)return;let r=new ResizeObserver(()=>{Pv(e,`resize-observer`,{clientWidth:t.clientWidth,clientHeight:t.clientHeight}),w.current!==null&&clearTimeout(w.current),w.current=setTimeout(()=>{w.current=null,_e()},150)});return r.observe(t),()=>{r.disconnect(),w.current!==null&&(clearTimeout(w.current),w.current=null)}},[z.kind,_e,e]),(0,B.useEffect)(()=>{m?.alive&&v.current&&v.current.focus()},[m?.alive]);let Te=o===`mobile`&&g,Ee=!g||we||pe!==`connected`,De={shortcuts:a(`terminal.mobile_input.shortcuts`),ctrl:a(`terminal.mobile_input.ctrl`),ctrlArmed:a(`terminal.mobile_input.ctrl_armed`),ctrlLocked:a(`terminal.mobile_input.ctrl_locked`),shift:a(`terminal.mobile_input.shift`),shiftArmed:a(`terminal.mobile_input.shift_armed`),escape:a(`terminal.mobile_input.escape`),tab:a(`terminal.mobile_input.tab`),enter:a(`terminal.mobile_input.enter`),up:a(`terminal.mobile_input.up`),down:a(`terminal.mobile_input.down`),left:a(`terminal.mobile_input.left`),right:a(`terminal.mobile_input.right`)},Oe=(0,B.useCallback)(async e=>{xe();let t=fe.current;t&&be(!1),await H($_(e,{shift:t}))},[xe,H,be]),ke=(0,B.useCallback)(()=>{xe(),ye(ev(de.current))},[xe,ye]),Ae=(0,B.useCallback)(()=>{xe(),ye(tv())},[xe,ye]),je=(0,B.useCallback)(()=>{xe(),be(!fe.current)},[xe,be]),Me=ie.kind!==`ready`&&(o===`mobile`||z.kind===`granted`),Ne=``,Pe=``,Fe=`xterm-replay-overlay`;return ie.kind===`loading`?(Ne=a(`terminal.replay.loading_title`),Pe=a(`terminal.replay.loading_body`)):(Fe+=` xterm-replay-overlay--degraded`,Ne=ie.reason===`truncated`?a(`terminal.replay.truncated_title`):ie.reason===`closed`?a(`terminal.replay.closed_title`):a(`terminal.replay.failed_title`),Pe=ie.reason===`truncated`?a(`terminal.replay.truncated_body`):ie.reason===`closed`?a(`terminal.replay.closed_body`):a(`terminal.replay.failed_body`)),(0,Z.jsxs)(`div`,{className:`xterm-host-shell${Te?` xterm-host-shell--mobile-input`:``}`,children:[Te?(0,Z.jsx)(Y_,{ctrlMode:se,shiftArmed:le,disabled:Ee,labels:De,onKeyPress:e=>{Oe(e)},onCtrlTap:ke,onCtrlLongPress:Ae,onShiftTap:je}):null,(0,Z.jsx)(`div`,{ref:_,className:`xterm-host`,style:{width:`100%`,minHeight:0,overflow:`hidden`},onFocusCapture:()=>{g&&I.current?.promote(`focused`)},onMouseDown:()=>{g&&I.current?.promote(`focused`)}}),we?(0,Z.jsx)(`div`,{role:`status`,"aria-live":`polite`,style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:`rgba(0,0,0,0.35)`,pointerEvents:`none`,zIndex:5,fontSize:12,color:`var(--text-muted, #ddd)`},children:`Uploading…`}):null,o!==`mobile`&&z.kind===`queued`?(0,Z.jsx)(lv,{state:`queued`,queuePosition:z.queuePosition}):null,Me?(0,Z.jsx)(`div`,{className:Fe,role:`status`,"aria-live":`polite`,children:(0,Z.jsxs)(`div`,{className:`xterm-replay-overlay__card`,children:[ie.kind===`loading`?(0,Z.jsx)(`div`,{className:`xterm-replay-overlay__spinner`,"aria-hidden":`true`}):null,(0,Z.jsx)(`div`,{className:`xterm-replay-overlay__title`,children:Ne}),Pe?(0,Z.jsx)(`div`,{className:`xterm-replay-overlay__body`,children:Pe}):null]})}):null]})}var Lv=({sessionId:e,showHeaderActions:t=!0,showSupervisorInline:n=!0,terminalReadOnlyOverride:r,headerAccessory:i,onClose:a,onSplitHorizontal:o,onSplitVertical:s,onStop:c})=>{let l=V(hd(e)),u=V(cd(l?.workspaceId??`__workspace_empty__`)),d=V(Gr),f=H(Gr),p=(0,B.useRef)(null),[m,h]=(0,B.useState)(!1);O_(l);let{persistUiState:g}=Rg(l?.workspaceId??`__workspace_empty__`);if((0,B.useEffect)(()=>{if(d!==e)return;let t=p.current;t&&t.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`nearest`}),h(!0),f(null);let n=setTimeout(()=>h(!1),1400);return()=>clearTimeout(n)},[d,e,f]),!l)return null;let _=Rv(l.state),v=l.title?.trim()||Gv(l.id),y=qv(l.providerId),b=Kv(l.state),x=r??!Jv(l.state),S=u?.uiState.activeSessionId===l.id;return(0,Z.jsxs)(`div`,{ref:p,className:`session-card agent-pane${m?` session-card--focus-pulse`:``}`,"data-session-id":e,onClick:e=>{let t=e.target;t instanceof HTMLElement&&(t.closest(`button, a, input, textarea, select, [role="button"]`)||g({activeSessionId:l.id}))},children:[(0,Z.jsx)(im,{"aria-hidden":`true`,className:`session-progress`,fillClassName:`session-progress-bar ${Bv(l.state)}`,max:100,tone:zv(l.state),value:_}),(0,Z.jsxs)(`div`,{className:`session-header`,children:[(0,Z.jsxs)(`div`,{className:`session-header-left`,children:[(0,Z.jsx)(Nm,{tone:Hv(l.state),pulse:Uv(l.state),className:`session-dot ${Vv(l.state)}`}),(0,Z.jsx)(`div`,{className:`session-header-copy`,children:(0,Z.jsxs)(`div`,{className:`session-title-row`,children:[(0,Z.jsx)(`span`,{className:`session-title`,children:v}),(0,Z.jsx)(Vm,{color:`blue`,className:`session-provider-badge`,children:y}),(0,Z.jsx)(Vm,{color:Wv(l.state),className:`session-state-badge`,caps:!1,children:b})]})})]}),t||i?(0,Z.jsxs)(`div`,{className:`session-header-right`,children:[i?(0,Z.jsx)(`div`,{className:`session-header-accessory`,children:i}):null,t?(0,Z.jsxs)(`div`,{className:`session-header-actions`,children:[l.state===`running`?(0,Z.jsx)($,{content:`Stop`,children:(0,Z.jsx)(Q,{"aria-label":`Stop`,className:`session-action-btn`,icon:(0,Z.jsx)(Rf,{size:13}),onClick:()=>void c?.(),size:`sm`})}):null,(0,Z.jsx)($,{content:`Split horizontal`,children:(0,Z.jsx)(Q,{"aria-label":`Split horizontal`,className:`session-action-btn`,icon:(0,Z.jsx)(If,{size:13}),onClick:()=>o?.(),size:`sm`})}),(0,Z.jsx)($,{content:`Split vertical`,children:(0,Z.jsx)(Q,{"aria-label":`Split vertical`,className:`session-action-btn`,icon:(0,Z.jsx)(Ff,{size:13}),onClick:()=>s?.(),size:`sm`})}),(0,Z.jsx)($,{content:`Close`,children:(0,Z.jsx)(Q,{"aria-label":`Close`,className:`session-action-btn session-action-btn-close`,icon:(0,Z.jsx)(Hf,{size:14}),onClick:()=>void a?.(),size:`sm`})})]}):null]}):null]}),n&&l.capability===`full`&&l.state!==`draft`&&l.state!==`ended`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(R_,{sessionId:l.id,workspaceId:l.workspaceId}),(0,Z.jsx)(F_,{workspaceId:l.workspaceId,sessionId:l.id})]}):null,(0,Z.jsx)(`div`,{className:`session-terminal`,children:(0,Z.jsx)(Iv,{terminalId:l.terminalId,workspaceId:l.workspaceId,readOnly:x,isActiveSession:S,terminalKind:`agent`})})]})};function Rv(e){switch(e){case`starting`:return 18;case`running`:return 42;case`ended`:return 100;default:return 8}}function zv(e){switch(e){case`starting`:return`warning`;case`running`:return`info`;case`idle`:return`neutral`;case`ended`:return`success`;default:return`neutral`}}function Bv(e){switch(e){case`starting`:return`session-progress-starting`;case`running`:return`session-progress-running`;case`idle`:return`session-progress-idle`;case`ended`:return`session-progress-complete`;default:return`session-progress-idle`}}function Vv(e){switch(e){case`starting`:return`session-dot-starting`;case`running`:return`session-dot-running`;case`ended`:return`session-dot-complete`;default:return`session-dot-idle`}}function Hv(e){switch(e){case`starting`:return`warning`;case`running`:return`info`;case`ended`:return`success`;default:return`neutral`}}function Uv(e){switch(e){case`starting`:return!0;default:return!1}}function Wv(e){switch(e){case`starting`:return`amber`;case`running`:return`green`;case`ended`:return`blue`;default:return`neutral`}}function Gv(e){let t=e.match(/(\d+)/)?.[1];return t?`SESSION-${t.slice(-2).padStart(2,`0`)}`:e.replace(/[_-]/g,` `).toUpperCase()}function Kv(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function qv(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}function Jv(e){return e===`running`||e===`idle`||e===`starting`}var Yv={margin:0,color:`var(--text-tertiary)`,fontWeight:`var(--font-normal)`},Xv=({hydrateSessions:e=!0})=>{let t=X(),n=V(fd),{workspaceId:r,sessions:i,paneLayout:a}=g_(n,{disabled:!e}),o=u_(r),s=h_(),c=r_(a).length>0,l=i.length===0&&(c||a.type===`leaf`&&!a.sessionId&&a.id===`root`);return n?l?(0,Z.jsx)(x_,{workspaceId:r,onReplaceWithSession:o.replaceWithSession}):(0,Z.jsx)(`div`,{className:`agent-panes`,children:(0,Z.jsx)(Zv,{node:a,workspaceId:r,onCloseSession:o.closeSessionPane,onSplitDraftPane:o.splitDraftPane,onSplitSession:o.splitSessionPane,onCloseDraftPane:o.closeDraftPane,onAssignSession:o.assignSession,onReplaceWithSession:o.replaceWithSession,onCloseSessionCommand:s.closeSession,onStopSession:s.stopSession})}):(0,Z.jsx)(`div`,{className:`agent-panes-empty`,children:(0,Z.jsx)(Ip,{style:{padding:0},title:(0,Z.jsx)(`p`,{style:Yv,children:t(`workspace.no_workspace`)})})})},Zv=({node:e,workspaceId:t,onAssignSession:n,onCloseDraftPane:r,onCloseSession:i,onCloseSessionCommand:a,onReplaceWithSession:o,onSplitDraftPane:s,onSplitSession:c,onStopSession:l})=>{if(e.type===`leaf`)return e.sessionId?(0,Z.jsx)(Lv,{sessionId:e.sessionId,onClose:async()=>{i(e.sessionId),await a(e.sessionId)},onSplitHorizontal:()=>c(e.sessionId,`horizontal`),onSplitVertical:()=>c(e.sessionId,`vertical`),onStop:()=>l(e.sessionId)}):(0,Z.jsx)(x_,{workspaceId:t,paneId:e.id,onAssignSession:n,onClosePane:r,onReplaceWithSession:o,onSplitPane:s});let u=Kg(t,e.id)??e.ratio??.5;return(0,Z.jsx)(S_,{splitId:e.id,direction:e.direction||`horizontal`,ratio:u,onRatioCommit:n=>qg(t,e.id,n),children:e.children?.map(e=>(0,Z.jsx)(Zv,{node:e,workspaceId:t,onAssignSession:n,onCloseDraftPane:r,onCloseSession:i,onCloseSessionCommand:a,onReplaceWithSession:o,onSplitDraftPane:s,onSplitSession:c,onStopSession:l},e.id))})};function Qv(){let e=V(fd),t=V(ed),n=H(hh(e?.id??``)),[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(null),[s,c]=(0,B.useState)(null),[l,u]=(0,B.useState)(null),d=e?.id,[f,p]=Se(fh(d??``)),[m,h]=Se(dh(d??``)),g=V(ph(d??``)),_=d?m[f??``]:void 0,v=(0,B.useCallback)(async(e,n)=>{if(!d)return;c(t=>t?.path===e?null:t);let r=await t(`file.read`,{workspaceId:d,path:e});if(!r.ok||!r.data){let t=r.error?.message??`Failed to open file`;console.error(`Failed to open file:`,t),c({path:e,message:t});return}let i=r.data;if(n?.forceText&&i.kind===`image`&&i.isTextBacked){try{let t=await fetch(i.url,{credentials:`include`});if(!t.ok){let n=`Failed to fetch text-backed image bytes: ${t.status}`;console.error(n),c({path:e,message:n});return}let n={kind:`text`,path:e,content:await t.text(),baseHash:``,isDirty:!1,viewingTextBackedImageAsText:!0};h(t=>({...t,[e]:n})),c(t=>t?.path===e?null:t)}catch(t){let n=t instanceof Error?t.message:`Failed to fetch text-backed image bytes`;console.error(`Failed to fetch text-backed image bytes:`,t),c({path:e,message:n})}return}let a=i.kind===`text`?{kind:`text`,path:e,content:i.content,baseHash:i.baseHash,isDirty:!1,externalState:void 0}:{kind:`image`,path:e,mime:i.mime,url:i.url,size:i.size,isTextBacked:i.isTextBacked,externalState:void 0};h(t=>({...t,[e]:a})),u(t=>t?.path===e?null:t),c(t=>t?.path===e?null:t)},[t,h,d]),y=(0,B.useCallback)(async()=>{if(!d||!_||_.kind!==`text`||r)return;i(!0),o(null);let e=await t(`file.write`,{workspaceId:d,path:_.path,content:_.content,baseHash:_.baseHash||void 0});e.ok&&e.data?(h(t=>{let n=t[_.path];return!n||n.kind!==`text`?t:{...t,[_.path]:{...n,baseHash:e.data.newHash,isDirty:!1,externalState:void 0}}}),u(e=>e?.path===_.path?null:e)):o(e.error?.message??`Failed to save file`),i(!1)},[_,t,r,h,d]),b=(0,B.useCallback)(e=>{!d||!_||_.kind!==`text`||h(t=>{let n=t[_.path];return!n||n.kind!==`text`?t:{...t,[_.path]:{...n,content:e,isDirty:e!==n.content}}})},[_,h,d]);(0,B.useEffect)(()=>{!d||!f||m[f]||v(f)},[f,v,m,d]),(0,B.useEffect)(()=>{if(!d||g<=0)return;let e=Object.entries(m);if(e.length===0)return;let n=!1;return(async()=>{for(let[r,i]of e){let e=await t(`file.read`,{workspaceId:d,path:r});if(n)return;if(!e.ok||!e.data){let t=e.error?.code===`not_found`;h(e=>{let n=e[r];return n?{...e,[r]:{...n,externalState:t?`deleted`:n.externalState}}:e}),t&&f===r&&u({path:r,status:`deleted`});continue}let a=e.data;if(i.kind===`text`&&a.kind===`text`){if(a.baseHash===i.baseHash)continue;if(i.isDirty){h(e=>{let t=e[r];return!t||t.kind!==`text`?e:{...e,[r]:{...t,externalState:`modified`}}}),f===r&&u({path:r,status:`modified`});continue}h(e=>({...e,[r]:{kind:`text`,path:r,content:a.content,baseHash:a.baseHash,isDirty:!1,externalState:void 0,viewingTextBackedImageAsText:i.viewingTextBackedImageAsText}})),f===r&&u(e=>e?.path===r?null:e);continue}if(i.kind===`image`&&a.kind===`image`){if(i.url===a.url&&i.size===a.size)continue;h(e=>({...e,[r]:{kind:`image`,path:r,mime:a.mime,url:a.url,size:a.size,isTextBacked:a.isTextBacked,externalState:void 0}})),f===r&&u(e=>e?.path===r?null:e);continue}h(e=>{let t={...e};return delete t[r],t}),f===r&&u({path:r,status:`modified`})}})(),()=>{n=!0}},[f,t,g,m,h,d]);let x=(0,B.useCallback)(()=>{if(!d)return;let e=_?.path;p(null),e&&h(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n}),o(null)},[_,p,h,d]),S=(0,B.useCallback)(()=>{if(!d||!_)return;let e=_.path,t=_.kind===`image`;h(t=>{let n={...t};return delete n[e],n}),v(e,t?{forceText:!0}:void 0)},[_,v,h,d]),C=(0,B.useCallback)(async()=>{if(!d||!_)return!1;let e=await t(`git.diff`,{workspaceId:d,path:_.path,staged:!1});return!e.ok||!e.data?!1:(n({path:_.path,diff:e.data.diff,staged:!1}),!0)},[_,t,n,d]),w=_?.kind===`text`,T=_?.kind===`image`,E=T&&_.isTextBacked||w&&_.viewingTextBackedImageAsText===!0,D=!!(w&&_.isDirty&&!r),O=f&&s?.path===f?s.message:null;return{activeFilePath:f,activeExternalStatus:f&&l?.path===f?l.status:null,activeLoadError:O,canSave:D,currentFile:_,handleClose:x,handleContentChange:b,handleSave:y,isImageFile:T,isSaving:r,isSvgTextBacked:E,isTextFile:w,openInDiffMode:C,saveError:a,toggleSvgTextMode:S,workspace:e,workspaceId:d}}function $v(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}function ey(e){return(e.split(`/`)[1]??e).split(`+`)[0].replace(/^x-/,``).toUpperCase()}var ty=({url:e,mime:t,sizeBytes:n,alt:r})=>{let[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{a(null),s(!1)},[e]),(0,Z.jsxs)(`div`,{className:`image-preview`,children:[(0,Z.jsx)(`div`,{className:`image-preview-canvas`,children:o?(0,Z.jsx)(Ip,{className:`git-diff-empty`,description:(0,Z.jsx)(`p`,{className:`git-diff-empty-body`,children:`The image could not be loaded. The file may have been moved or is larger than the browser allows.`}),title:(0,Z.jsx)(`p`,{className:`git-diff-empty-title`,children:`Preview unavailable`})}):(0,Z.jsx)(`img`,{className:`image-preview-img`,src:e,alt:r,draggable:!1,onLoad:e=>{let t=e.currentTarget;a({w:t.naturalWidth,h:t.naturalHeight})},onError:()=>s(!0)})}),(0,Z.jsxs)(`div`,{className:`image-preview-meta`,children:[(0,Z.jsx)(`span`,{className:`image-preview-type`,children:ey(t)}),i&&(0,Z.jsxs)(`span`,{className:`image-preview-dim`,children:[i.w,` × `,i.h]}),(0,Z.jsx)(`span`,{className:`image-preview-size`,children:$v(n)})]})]})},ny=({state:e,variant:t=`full`})=>{let n=X(),{canSave:r,handleClose:i,handleSave:a,isImageFile:o,isSaving:s,isSvgTextBacked:c,toggleSvgTextMode:l}=e,u=n(s?`code_editor.saving`:`action.save_file`),d=n(o?`code_editor.edit_as_text`:`code_editor.preview_as_image`),f=n(o?`code_editor.mode_text`:`code_editor.mode_image`);return t===`mobile`?(0,Z.jsxs)(`div`,{className:`mobile-sheet__header-actions`,children:[c?(0,Z.jsx)($,{content:d,children:(0,Z.jsx)(Q,{"aria-label":d,className:`mobile-sheet__action mobile-sheet__action--icon`,icon:o?(0,Z.jsx)(af,{size:16}):(0,Z.jsx)(pf,{size:16}),onClick:l})}):null,(0,Z.jsx)(`button`,{type:`button`,className:`mobile-sheet__action`,onClick:a,disabled:!r,"aria-label":u,children:u})]}):(0,Z.jsxs)(`div`,{className:`code-mode-toggle`,children:[c&&(0,Z.jsx)($,{content:d,children:(0,Z.jsxs)(`button`,{type:`button`,className:`code-mode-btn`,onClick:l,"aria-label":d,children:[o?(0,Z.jsx)(af,{size:12}):(0,Z.jsx)(pf,{size:12}),(0,Z.jsx)(`span`,{children:f})]})}),(0,Z.jsx)($,{content:u,disabled:!r,children:(0,Z.jsxs)(`button`,{type:`button`,className:`code-mode-btn`,onClick:a,disabled:!r,"aria-label":u,children:[(0,Z.jsx)(Af,{size:12}),(0,Z.jsx)(`span`,{children:u})]})}),(0,Z.jsx)($,{content:n(`action.close`),children:(0,Z.jsx)(Q,{"aria-label":n(`action.close`),className:`code-mode-btn`,icon:(0,Z.jsx)(Hf,{size:12}),onClick:i,size:`sm`})})]})},ry=({state:e,chrome:t=`full`})=>{let n=X(),{activeFilePath:r,activeExternalStatus:i,activeLoadError:a,currentFile:o,handleContentChange:s,handleSave:c,isImageFile:l,isTextFile:u,saveError:d,workspace:f}=e;if(!f)return(0,Z.jsx)(`div`,{className:`workspace-git-view`,children:(0,Z.jsx)(`div`,{className:`code-editor workspace-git-editor`,children:(0,Z.jsx)(`div`,{className:`code-editor-body`,children:(0,Z.jsx)(Ip,{className:`git-diff-empty`,title:(0,Z.jsx)(`p`,{className:`git-diff-empty-title`,children:n(`workspace.no_workspace`)})})})})});let p=u&&o.isDirty?(0,Z.jsx)(`span`,{className:`dirty-indicator`,children:`*`}):null;return(0,Z.jsx)(`div`,{className:`workspace-git-view`,children:(0,Z.jsxs)(`div`,{className:`code-editor workspace-git-editor`,children:[t===`full`?(0,Z.jsxs)(`div`,{className:`code-editor-header`,children:[(0,Z.jsx)(`span`,{className:`code-file-path`,children:o?(0,Z.jsxs)(Z.Fragment,{children:[o.path,p]}):r||n(`file.title`)}),(0,Z.jsx)(ny,{state:e})]}):null,d&&(0,Z.jsxs)(`div`,{className:`code-editor-error`,role:`alert`,children:[(0,Z.jsx)(Kd,{size:14}),(0,Z.jsx)(`span`,{children:d})]}),i&&(0,Z.jsxs)(`div`,{className:`code-editor-error`,role:`alert`,children:[(0,Z.jsx)(Kd,{size:14}),(0,Z.jsx)(`span`,{children:n(i===`deleted`?`code_editor.deleted_on_disk`:`code_editor.modified_on_disk`)})]}),(0,Z.jsx)(`div`,{className:`code-editor-body`,children:u?(0,Z.jsx)(ag,{workspaceId:f.id,filePath:o.path,content:o.content,onContentChange:s,onSave:c}):l?(0,Z.jsx)(ty,{url:o.url,mime:o.mime,sizeBytes:o.size,alt:o.path}):a?(0,Z.jsx)(Ip,{className:`git-diff-empty`,description:(0,Z.jsx)(`p`,{className:`git-diff-empty-body`,children:a}),role:`alert`,title:(0,Z.jsx)(`p`,{className:`git-diff-empty-title`,children:n(`code_editor.open_failed_title`)})}):r?(0,Z.jsx)(Ip,{className:`git-diff-empty`,title:(0,Z.jsxs)(`p`,{className:`git-diff-empty-title`,children:[n(`status.connecting`),`…`]})}):(0,Z.jsx)(Ip,{className:`git-diff-empty`,description:(0,Z.jsx)(`p`,{className:`git-diff-empty-body`,children:n(`code_editor.empty_hint`)}),title:(0,Z.jsx)(`p`,{className:`git-diff-empty-title`,children:n(`file.title`)})})})]})})},iy=({chrome:e=`full`,editorState:t})=>(0,Z.jsx)(ry,{state:t??Qv(),chrome:e}),ay=`__terminal_panel_empty__`;function oy(e,t){let n=new Set(t),r=[...t];for(let t of e)n.has(t)||(n.add(t),r.push(t));return r}function sy(e){return{id:e.id,workspaceId:e.workspaceId,kind:e.kind,alive:e.alive,exitCode:e.exitCode,title:e.title}}function cy(){let e=X(),t=V(dd),n=V(ed),r=V(Ku),i=H(Hh),a=he(),[o,s]=(0,B.useState)([]),[c,l]=(0,B.useState)(null),u=(0,B.useRef)(null),d=V(B_(c??ay)),f=c?d:null;(0,B.useEffect)(()=>{if(!t){s([]),l(null);return}let r=!1;return s([]),l(null),n(`terminal.list`,{workspaceId:t}).then(t=>{if(r)return;if(!t.ok||!t.data){console.error(`Failed to fetch terminals:`,t.error?.message),i({kind:`error`,title:e(`terminal.load_failed_title`),body:t.error?.message??e(`terminal.load_failed_body`)});return}let n=t.data.filter(e=>e.kind===`shell`),o=n.map(e=>e.id);for(let e of n)a.set(B_(e.id),sy(e));s(e=>oy(e,o)),l(e=>e??o[0]??null)}).catch(t=>{r||(console.error(`Failed to fetch terminals:`,t),i({kind:`error`,title:e(`terminal.load_failed_title`),body:t instanceof Error?t.message:e(`terminal.load_failed_body`)}))}),()=>{r=!0}},[t,n,i,a,e]),(0,B.useEffect)(()=>{if(!r||!t)return;let e=Ru.terminalsAll(t);return u.current=r.subscribe([e],(e,t,n)=>{let r=e.split(`.`);if(r.length<5)return;let i=r[3],o=r[4];if(o===`created`){let e=t;if(e.kind!==`shell`)return;s(t=>t.includes(e.id)?t:[...t,e.id]),l(e.id);return}if(o!==`output`)return;let c=a.get(B_(i));if(!c||c.kind!==`shell`)return;let u=t,d=z_(i),f=a.get(d);n<=f.lastSeq||a.set(d,{chunks:[...f.chunks,u.bytes],lastSeq:n})}),()=>{u.current?.(),u.current=null}},[t,a,r]);let p=(0,B.useCallback)(async()=>{if(!t){i({kind:`warning`,title:e(`terminal.create_unavailable_title`),body:e(`terminal.create_unavailable_body`)});return}try{let r=await n(`terminal.create`,{workspaceId:t,kind:`shell`});if(!r.ok||!r.data){i({kind:`error`,title:e(`terminal.create_failed_title`),body:r.error?.message??e(`terminal.create_failed_body`)});return}let o=r.data;a.set(B_(o.id),sy(o)),s(e=>e.includes(o.id)?e:[...e,o.id]),l(o.id)}catch(t){i({kind:`error`,title:e(`terminal.create_failed_title`),body:t instanceof Error?t.message:e(`terminal.create_failed_body`)})}},[t,n,i,a,e]);return{activeTerminalId:c,activeTerminalMeta:f,activeWorkspaceId:t,handleCloseTerminal:(0,B.useCallback)(async e=>{(await n(`terminal.close`,{terminalId:e})).ok&&s(t=>{let n=t.filter(t=>t!==e);return l(t=>t===e?n[0]??null:t),n})},[n]),handleCreateTerminal:p,handleSwitchTerminal:(0,B.useCallback)(e=>{l(e)},[]),hasTerminals:o.length>0,terminalIds:o}}function ly(e,t,n){let r=e?.title?.trim(),i=uy(r);return!r||dy(r,n)?`${i??n} — ${t+1}`:i?`${i} — ${t+1}`:r}function uy(e){if(!e)return null;let t=e.split(/[\\/]/).pop()?.trim();if(!t)return null;let n=t.toLowerCase().replace(/\.exe$/,``);return new Set([`bash`,`cmd`,`csh`,`fish`,`ksh`,`powershell`,`pwsh`,`sh`,`tcsh`,`zsh`]).has(n)?n:null}function dy(e,t){let n=e.toLowerCase();return n===t.trim().toLowerCase()||n===`shell terminal`||n===`shell 终端`}function fy({id:e,index:t,isActive:n,onSelect:r,onClose:i}){let a=X(),o=ly(V(B_(e)),t,a(`terminal.shell`));return(0,Z.jsxs)(`div`,{className:`terminal-selector-item ${n?`terminal-selector-item-active`:``}`,children:[(0,Z.jsx)(`button`,{type:`button`,className:`terminal-selector-item-trigger`,onClick:r,children:(0,Z.jsx)(`span`,{className:`terminal-selector-item-title`,children:o})}),(0,Z.jsx)(Q,{"aria-label":a(`action.close`),className:`terminal-selector-item-close`,icon:(0,Z.jsx)(Hf,{size:12}),onClick:e=>{e.stopPropagation(),i()},size:`sm`})]})}function py({id:e,index:t,isActive:n,onSelect:r,onClose:i}){let a=X(),o=ly(V(B_(e)),t,a(`terminal.shell`));return(0,Z.jsxs)(`div`,{className:`terminal-tab-shell ${n?`active`:``}`,role:`presentation`,children:[(0,Z.jsx)(um,{className:`terminal-tab ${n?`terminal-tab-active`:``}`,onClick:r,value:e,children:(0,Z.jsx)(`span`,{className:`terminal-tab-title`,children:o})}),(0,Z.jsx)(Q,{"aria-label":a(`action.close`),className:`terminal-tab-close`,icon:(0,Z.jsx)(Hf,{size:12}),onClick:e=>{e.stopPropagation(),i()},size:`sm`})]})}function my({chrome:e=`default`}){let t=X(),n=he(),[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(!1),{activeTerminalId:s,activeTerminalMeta:c,activeWorkspaceId:l,handleCloseTerminal:u,handleCreateTerminal:d,handleSwitchTerminal:f,hasTerminals:p,terminalIds:m}=cy(),h=s?m.indexOf(s):0,g=ly(c,h>=0?h:0,t(`terminal.shell`)),_=s??m[0]??``,v=e===`mobile-fullscreen`,y=p&&(!v||m.length>1),b=m.length>1&&!v,x=m.map((e,r)=>({value:e,label:ly(n.get(B_(e)),r,t(`terminal.shell`))}));return(0,B.useEffect)(()=>{(!y||m.length<=1)&&(i(!1),o(!1))},[y,m.length]),(0,Z.jsxs)(`div`,{className:`bottom-terminal${v?` bottom-terminal--mobile-fullscreen`:``}`,children:[(0,Z.jsxs)(`div`,{className:`terminal-toolbar`,children:[(0,Z.jsx)(`div`,{className:`terminal-toolbar-left`,children:v?null:(0,Z.jsxs)(`div`,{className:`terminal-title-stack`,children:[(0,Z.jsx)(`span`,{className:`terminal-kicker`,children:t(`terminal.kicker`)}),c?(0,Z.jsx)(`span`,{className:`terminal-title`,children:g}):null]})}),(0,Z.jsxs)(`div`,{className:`terminal-toolbar-right`,children:[p&&(0,Z.jsxs)(Z.Fragment,{children:[y?(0,Z.jsxs)(`div`,{className:`terminal-selector`,children:[v?(0,Z.jsx)(Em,{mobile:!0,"aria-label":t(`terminal.selector.switch`),"aria-expanded":a,className:`terminal-selector-btn`,includeValueInAriaLabel:!1,options:x,value:_,valueLabel:g,onClick:e=>{a&&(e.preventDefault(),o(!1))},onOpen:()=>o(!0)}):m.length>1?(0,Z.jsx)(em,{content:(0,Z.jsx)(Z.Fragment,{children:m.map((e,t)=>(0,Z.jsx)(fy,{id:e,index:t,isActive:e===s,onSelect:()=>{f(e),i(!1)},onClose:()=>{i(!1),u(e)}},e))}),contentClassName:`terminal-selector-dropdown`,forceMode:`desktop`,open:r,placement:`bottom-end`,title:t(`terminal.selector.title`),onOpenChange:i,children:(0,Z.jsxs)(`button`,{type:`button`,className:`terminal-selector-btn`,"aria-label":g,children:[(0,Z.jsx)(`span`,{children:g}),(0,Z.jsx)(Hd,{size:12})]})}):(0,Z.jsxs)(`button`,{type:`button`,className:`terminal-selector-btn`,"aria-label":g,children:[(0,Z.jsx)(`span`,{children:g}),(0,Z.jsx)(Hd,{size:12})]}),v&&a?(0,Z.jsx)(ym,{title:t(`terminal.selector.title`),sections:[{kind:`options`,id:`terminals`,items:x.map((e,n)=>({id:e.value,label:e.label,meta:e.value===s?t(`terminal.selector.current`):t(`terminal.selector.indexed`,{index:n+1})}))}],selectedId:s,onSelect:f,onClose:()=>o(!1)}):null]}):null,(0,Z.jsx)(`div`,{className:`terminal-toolbar-actions`,children:(0,Z.jsx)($,{content:t(`action.close`),children:(0,Z.jsx)(Q,{className:`panel-toolbar-btn`,"aria-label":t(`terminal.close_terminal`),icon:(0,Z.jsx)(Hf,{size:14}),onClick:()=>{s&&(i(!1),o(!1),u(s))},size:`sm`})})})]}),(0,Z.jsx)(`div`,{className:`terminal-toolbar-actions`,children:(0,Z.jsx)($,{content:t(`action.open`),children:(0,Z.jsx)(Q,{className:`panel-toolbar-btn`,"aria-label":t(`terminal.new_terminal`),icon:(0,Z.jsx)(Ef,{size:14}),onClick:d,size:`sm`})})})]})]}),(0,Z.jsx)(`div`,{className:`bottom-terminal-content`,children:p?(0,Z.jsxs)(Z.Fragment,{children:[b?(0,Z.jsx)(cm,{"aria-label":t(`terminal.selector.title`),className:`bottom-terminal-tabs-nav`,onValueChange:f,value:_,children:(0,Z.jsx)(lm,{className:`bottom-terminal-tabs`,children:m.map((e,t)=>(0,Z.jsx)(py,{id:e,index:t,isActive:e===_,onSelect:()=>f(e),onClose:()=>u(e)},e))})}):null,c&&l&&(0,Z.jsx)(`div`,{className:`bottom-terminal-xterm`,children:(0,Z.jsx)(Iv,{terminalId:c.id,workspaceId:l,terminalKind:c.kind??`shell`})})]}):(0,Z.jsx)(Ip,{action:(0,Z.jsx)(gp,{variant:`primary`,size:`sm`,onClick:d,leadingIcon:(0,Z.jsx)(Ef,{size:14}),children:t(`terminal.new_terminal`)}),className:`bottom-terminal-empty`,description:(0,Z.jsx)(`p`,{className:`bottom-terminal-empty-hint`,children:t(`terminal.empty_hint`)}),icon:(0,Z.jsx)(zf,{size:32,className:`bottom-terminal-empty-icon`}),title:(0,Z.jsx)(`p`,{className:`bottom-terminal-empty-text`,children:t(`terminal.no_terminal`)})})})]})}function hy({controller:e,className:t,iconSize:n,dataTestId:r}){let i=X();if(!e)return null;let a=e.isFullscreen?i(`tooltip.exit_fullscreen`):i(`tooltip.enter_fullscreen`);return(0,Z.jsx)($,{content:a,children:(0,Z.jsx)(Q,{"aria-label":a,className:t,"data-testid":r,icon:(0,Z.jsx)(e.isFullscreen?vf:gf,{size:n}),onClick:()=>{e.toggleFullscreen()}})})}var gy=()=>{let e=X(),t=V(qu);if(t===`connected`)return null;let n=`connection-status-${t}`,r=`connection-status-dot connection-status-dot-${t}`,i=e(`status.${t}`);return(0,Z.jsx)($,{content:i,children:(0,Z.jsxs)(`div`,{className:`connection-status ${n}`,"aria-label":i,children:[(0,Z.jsx)(Nm,{tone:_y(t),size:`sm`,pulse:vy(t),className:r}),(0,Z.jsx)(`span`,{className:`connection-status-text`,children:i})]})})};function _y(e){switch(e){case`connected`:return`success`;case`disconnected`:return`error`;default:return`warning`}}function vy(e){switch(e){case`connecting`:case`reconnecting`:return!0;default:return!1}}function yy(){let e=Jt(),t=V(ed),n=V(ad),r=H(rd),i=H(id),a=H(ad);return(0,B.useCallback)(async(o,s)=>{let c=await t(`workspace.close`,{id:o});if(!c.ok)return console.error(`Failed to close workspace:`,c.error?.message),!1;let l=n.filter(e=>e!==o);return i(e=>{let t={...e};return delete t[o],t}),a(l),r(e=>e===o?l[0]??null:e),l.length===0&&s?.navigateHomeWhenEmpty&&e(`/`,{replace:!0}),!0},[t,e,r,a,i,n])}var by=({workspace:e,isActive:t})=>{let n=X(),r=H(rd),i=yy(),a=ah(e)||e.id;return(0,Z.jsxs)(`div`,{className:`topbar-tab-shell ${t?`active`:``}`,role:`presentation`,children:[(0,Z.jsxs)(um,{className:`topbar-tab`,onClick:()=>{r(e.id)},value:e.id,children:[(0,Z.jsx)(`span`,{className:`topbar-dot ${e.isActive?`active`:`idle`}`}),(0,Z.jsx)($,{content:e.path||e.id,children:(0,Z.jsx)(`span`,{className:`topbar-tab-name`,children:a})}),(0,Z.jsx)(lp,{count:e.unreadCount??0,max:9})]}),(0,Z.jsx)(Q,{className:`topbar-close`,"aria-label":n(`action.close_workspace`),icon:(0,Z.jsx)(Hf,{size:14}),onClick:async t=>{t.stopPropagation(),await i(e.id)},size:`sm`})]})},xy={width:`auto`,minHeight:`auto`,padding:0,gap:0},Sy={color:`var(--text-tertiary)`,fontSize:`var(--text-sm)`,fontWeight:`var(--font-normal)`},Cy=({fullscreenController:e})=>{let t=X(),n=Jt(),r=V(ud),i=V(dd)??r[0]?.id??``,a=H(rd),[o,s]=Se(Wr),[c,l]=Se(Eh),[u,d]=Se(Th),[f,p]=(0,B.useState)(!1);return(0,Z.jsxs)(`header`,{className:`app-topbar`,children:[(0,Z.jsxs)(`div`,{className:`topbar-tabs`,children:[r.length===0?(0,Z.jsx)(Ip,{className:`topbar-empty-state`,style:xy,title:(0,Z.jsx)(`span`,{className:`topbar-hint`,style:Sy,children:t(`workspace.no_workspace`)})}):(0,Z.jsx)(cm,{"aria-label":t(`workspace.tabs`),className:`topbar-tabs-nav`,onValueChange:a,value:i,children:(0,Z.jsx)(lm,{className:`topbar-tablist`,children:r.map(e=>(0,Z.jsx)(by,{workspace:e,isActive:e.id===i},e.id))})}),(0,Z.jsx)($,{content:t(`tooltip.new_workspace`),children:(0,Z.jsx)(Q,{"aria-label":t(`tooltip.new_workspace`),className:`topbar-add`,icon:(0,Z.jsx)(Ef,{size:14}),onClick:()=>p(!0)})})]}),(0,Z.jsxs)(`div`,{className:`topbar-actions`,children:[(0,Z.jsx)(gy,{}),(0,Z.jsx)($,{content:t(`tooltip.quick_actions`),children:(0,Z.jsxs)(`button`,{className:`topbar-btn topbar-quick-actions`,onClick:()=>s(!o),"aria-label":t(`tooltip.quick_actions`),children:[(0,Z.jsx)(jf,{size:14}),(0,Z.jsx)(`span`,{className:`topbar-btn-label`,children:t(`tooltip.quick_actions`)})]})}),(0,Z.jsx)($,{content:t(c?`tooltip.hide_terminal`:`tooltip.show_terminal`),children:(0,Z.jsx)(Q,{"aria-label":t(c?`tooltip.hide_terminal`:`tooltip.show_terminal`),className:`topbar-btn ${c?`topbar-btn--active`:`topbar-btn--muted`}`,icon:(0,Z.jsx)(xf,{size:14}),onClick:()=>l(!c)})}),(0,Z.jsx)($,{content:t(u?`tooltip.show_files`:`tooltip.hide_files`),children:(0,Z.jsx)(Q,{"aria-label":t(u?`tooltip.show_files`:`tooltip.hide_files`),className:`topbar-btn ${u?`topbar-btn--muted`:`topbar-btn--active`}`,icon:(0,Z.jsx)(Sf,{size:14}),onClick:()=>d(!u)})}),(0,Z.jsx)($,{content:t(`settings.title`),children:(0,Z.jsx)(Q,{"aria-label":t(`settings.title`),className:`topbar-btn`,"data-testid":`settings-open`,icon:(0,Z.jsx)(Nf,{size:14}),onClick:()=>n(`/settings`)})}),(0,Z.jsx)(hy,{controller:e,className:`topbar-btn`,iconSize:14,dataTestId:`workspace-fullscreen-open`})]}),f?(0,Z.jsx)(Nh,{onClose:()=>p(!1)}):null]})};function wy(e){return e?.source===`commit`}var Ty=180*1e3,Ey={push:`git.operation_push`,pull:`git.operation_pull`,fetch:`git.operation_fetch`};function Dy(e,t){return e&&t?`${e}/${t}`:null}function Oy(e){let t=X(),n=V(ed),r=H(Hh),i=H(mh(e)),a=H(_h(e)),o=H(lh(e)),s=H(xh(e)),[c,l]=(0,B.useState)(null),[u,d]=(0,B.useState)(null),f=(0,B.useCallback)(e=>e.canPrompt?e.reason===`invalid_credentials`?t(`git.auth_failed_invalid`,{remote:e.remoteLabel}):e.reason===`authorization_failed`?t(`git.auth_failed_forbidden`,{remote:e.remoteLabel,operation:t(Ey[e.operation])}):t(`git.auth_required_message`,{remote:e.remoteLabel}):t(`git.auth_failed_unsupported`,{remote:e.remoteLabel}),[t]),p=(0,B.useCallback)((e,n,r)=>{if(e===`git.fetch`)return n.message||r;let i=Dy(n.remote,n.branch);return i?e===`git.push`?n.updated?t(`git.push_success_target`,{target:i}):t(`git.sync_up_to_date`,{target:i}):n.updated?t(`git.pull_success_target`,{target:i}):t(`git.sync_up_to_date`,{target:i}):n.message||r},[t]),m=(0,B.useCallback)(async()=>{if(!e)return!1;let[t,r]=await Promise.all([n(`git.branches`,{workspaceId:e}),n(`git.status`,{workspaceId:e})]);return t.ok&&t.data?a({current:t.data.current,branches:t.data.branches,loading:!1}):a(e=>({...e,loading:!1})),r.ok&&r.data&&i(r.data),t.ok&&r.ok},[n,a,i,e]),h=(0,B.useCallback)(async(i,a)=>{if(!e)return!1;let c=i===`git.fetch`;c?(s(e=>({...e,status:`fetching`,error:void 0})),l(`fetch`)):l(i===`git.push`?`push`:`pull`);try{let l=await n(i,{workspaceId:e,...a.auth?{auth:a.auth}:{}},{timeoutMs:Ty});if(!l.ok||!l.data?.success){let e=l.error?.message??l.data?.message;if((l.error?.code===`git_auth_required`||l.error?.code===`git_auth_failed`)&&l.error.details&&typeof l.error.details==`object`){c&&s(t=>({...t,status:`error`,error:e}));let t=l.error.details,n=i===`git.push`?`push`:i===`git.pull`?`pull`:`fetch`;return d({intent:n,details:{...t,usernameHint:u?.intent===n?u.details.usernameHint:t.usernameHint}}),!1}return a.auth&&d(null),c&&s(t=>({...t,status:`error`,error:e})),r({kind:`error`,title:a.errorTitle,body:e}),console.error(`Failed to run ${i}:`,e),!1}if(!await m()&&c){let e=t(`git.fetch_refresh_failed_body`);return s(t=>({...t,status:`error`,error:e})),r({kind:`error`,title:a.errorTitle,body:e}),!1}return a.markFileTreeStale&&o(!0),c&&s({status:`idle`,lastFetchAt:Date.now()}),r({kind:`success`,title:a.successTitle,body:p(i,l.data,a.fallbackSuccessBody)}),!0}finally{l(null)}},[u,n,p,r,m,s,o,t,e]),g=(0,B.useCallback)(async e=>h(`git.push`,{successTitle:t(`git.push_success_title`),fallbackSuccessBody:t(`git.push_success_body`),errorTitle:t(`git.push_failed_title`),auth:e}),[h,t]),_=(0,B.useCallback)(async e=>h(`git.pull`,{successTitle:t(`git.pull_success_title`),fallbackSuccessBody:t(`git.pull_success_body`),errorTitle:t(`git.pull_failed_title`),markFileTreeStale:!0,auth:e}),[h,t]);return{authPrompt:u,clearAuthPrompt:()=>d(null),setAuthPrompt:d,getAuthPromptMessage:f,handleFetch:(0,B.useCallback)(async e=>h(`git.fetch`,{successTitle:t(`git.fetch_success_title`),fallbackSuccessBody:t(`git.fetch_success_body`),errorTitle:t(`git.fetch_failed_title`),auth:e}),[h,t]),handlePull:_,handlePush:g,refreshBranchState:m,syncingIntent:c}}function ky(e){let t=[{title:`staged`,type:`staged`,changes:e.staged},{title:`modified`,type:`modified`,changes:e.modified},{title:`deleted`,type:`deleted`,changes:e.deleted},{title:`untracked`,type:`untracked`,changes:e.untracked}];for(let e of t)if(e.changes[0])return{change:e.changes[0],type:e.type};return null}function Ay(e,t){let n=[{type:`staged`,changes:e.staged},{type:`modified`,changes:e.modified},{type:`deleted`,changes:e.deleted},{type:`untracked`,changes:e.untracked}];for(let e of n){let n=e.changes.find(e=>e.path===t);if(n)return{change:n,type:e.type}}return null}function jy({workspaceId:e,refreshToken:t=0,onPreviewOpen:n,initialHistoryLimit:r=5}){let i=X(),a=V(mh(e)),o=V(hh(e)),s=V(gh(e)),c=V(ed),l=H(Hh),u=H(mh(e)),d=H(_h(e)),f=H(hh(e)),p=H(gh(e)),[m,h]=Se(yh(e)),[g,_]=(0,B.useState)(!1),[v,y]=(0,B.useState)([]),[b,x]=(0,B.useState)(r),[S,C]=(0,B.useState)(!1),[w,T]=(0,B.useState)(null),E=(0,B.useRef)(!1),D=(0,B.useRef)(!1),O=(0,B.useCallback)(e=>{d({current:e?.current??``,branches:e?.branches??[],loading:!1})},[d]),k=(0,B.useCallback)(e=>{f(e)},[f]),A=(0,B.useCallback)(async(t,n)=>{let r=await c(`git.diff`,{workspaceId:e,path:t.path,staged:n===`staged`});if(!r.ok||!r.data)return console.error(`Failed to get diff:`,r.error?.message),null;let i={path:t.path,diff:r.data.diff,staged:n===`staged`,source:`file`};return p(!1),k(i),i},[c,p,k,e]),j=(0,B.useCallback)(async t=>{let r=await c(`git.show`,{workspaceId:e,sha:t.sha});if(!r.ok||!r.data)return console.error(`Failed to get commit diff:`,r.error?.message),null;let i={path:t.sha,title:`${t.shortSha} · ${t.subject}`,diff:r.data.diff,source:`commit`};return p(!1),k(i),n?.(i),i},[c,n,p,k,e]),M=(0,B.useCallback)(async(e,t)=>{let r=await A(e,t);r&&n?.(r)},[n,A]),N=(0,B.useCallback)(async()=>{if(!e)return;d(e=>({...e,loading:!0,error:void 0}));let t=await c(`git.branches`,{workspaceId:e});if(!t.ok||!t.data){d(e=>({...e,loading:!1,error:t.error?.message??`Failed to load branches`})),console.error(`Failed to load git branches:`,t.error?.message);return}O(t.data)},[c,d,O,e]),P=(0,B.useCallback)(async(t=b)=>{if(e){C(!0);try{let n=await c(`git.log`,{workspaceId:e,limit:t});if(!n.ok){console.error(`Failed to load git history:`,n.error?.message),y([]);return}y(Array.isArray(n.data?.entries)?n.data.entries:[])}finally{C(!1)}}},[c,b,e]),F=(0,B.useCallback)(async()=>{if(e){if(E.current){D.current=!0;return}E.current=!0,_(!0);try{let t=await c(`git.status`,{workspaceId:e});if(!t.ok||!t.data){console.error(`Failed to load git status:`,t.error?.message);return}if(u(t.data),s){k(null);return}if(wy(o))return;let n=(o?Ay(t.data,o.path):null)??ky(t.data);if(!n){k(null);return}(!o||o.path!==n.change.path||!!o.staged!=(n.type===`staged`))&&await A(n.change,n.type)}finally{E.current=!1,_(!1),D.current&&(D.current=!1,queueMicrotask(()=>{F()}))}}},[o,s,c,A,u,k,e]);(0,B.useEffect)(()=>{!a&&!E.current&&F()},[a,F]),(0,B.useEffect)(()=>{N()},[N]),(0,B.useEffect)(()=>{P(b)},[a?.headSha,b,P]),(0,B.useEffect)(()=>{if(!a||s||wy(o))return;if(o){let e=Ay(a,o.path);if(e&&!!o.staged==(e.type===`staged`))return}let e=ky(a);if(!e){k(null);return}A(e.change,e.type)},[o,s,a,A,k]),(0,B.useEffect)(()=>{t>0&&!E.current&&F()},[t,F]);let ee=(0,B.useCallback)(async(e,t,n,r,i)=>{let a=await c(e,t);return a.ok?(i?.(),await F(),!0):(l({kind:`error`,title:r,body:a.error?.message??n}),console.error(n,a.error?.message),!1)},[c,F,l]),te=(0,B.useCallback)(async t=>{t.length!==0&&await ee(`git.stage`,{workspaceId:e,paths:t},`Failed to stage all:`,i(`git.stage_failed_title`))},[ee,i,e]),ne=(0,B.useCallback)(async t=>{t.length!==0&&await ee(`git.unstage`,{workspaceId:e,paths:t},`Failed to unstage all:`,i(`git.unstage_failed_title`))},[ee,i,e]),I=(0,B.useCallback)(async()=>{await te([...a?.modified.map(e=>e.path)??[],...a?.deleted.map(e=>e.path)??[],...a?.untracked.map(e=>e.path)??[]])},[a,te]),L=(0,B.useCallback)(async()=>{await ne(a?.staged.map(e=>e.path)??[])},[a,ne]),R=(0,B.useCallback)(()=>{let e=[...a?.staged.map(e=>e.path)??[],...a?.modified.map(e=>e.path)??[],...a?.deleted.map(e=>e.path)??[],...a?.untracked.map(e=>e.path)??[]];e.length&&T({scope:`all`,paths:e})},[a]),re=(0,B.useCallback)(e=>{e.length&&T({scope:`all`,paths:e})},[]),ie=(0,B.useCallback)(e=>{T({scope:`single`,paths:[e],filePath:e})},[]),ae=(0,B.useCallback)(()=>{T(null)},[]),z=(0,B.useCallback)(async()=>{if(!w)return;let t=w;T(null),await ee(`git.discard`,{workspaceId:e,paths:t.paths},t.scope===`all`?`Failed to discard all:`:`Failed to discard:`,i(`git.discard_failed_title`))},[w,ee,i,e]),oe=(0,B.useCallback)(async()=>{!m.trim()||!a?.staged.length||await ee(`git.commit`,{workspaceId:e,message:m.trim()},`Failed to commit:`,i(`git.commit_failed_title`),()=>h(``))},[m,a?.staged.length,ee,i,e]),se=!!(a&&(a.staged.length>0||a.modified.length>0||a.untracked.length>0||a.deleted.length>0));return{commitMessage:m,diffPreview:o,gitState:a,groups:(0,B.useMemo)(()=>[{title:`staged`,changes:(a?.staged??[]).map(e=>({change:e,type:`staged`}))},{title:`changes`,changes:[...(a?.modified??[]).map(e=>({change:e,type:`modified`})),...(a?.deleted??[]).map(e=>({change:e,type:`deleted`})),...(a?.untracked??[]).map(e=>({change:e,type:`untracked`}))]}].filter(e=>e.changes.length>0),[a]),hasChanges:se,history:v,historyLimit:b,historyLoading:S,isLoading:g,pendingDiscard:w,canShowMoreHistory:b<10&&v.length>0,setCommitMessage:h,handleCancelDiscard:ae,handleCommit:oe,handleConfirmDiscard:z,handleDiscardAll:R,handleRequestDiscardPaths:re,handleRequestDiscardSingle:ie,handleStageAll:I,handleStagePaths:te,handleUnstageAll:L,handleUnstagePaths:ne,loadGitStatus:F,loadGitHistory:P,openDiff:M,openHistoryDiff:j,requestDiff:A,runGitMutation:ee,showMoreHistory:()=>x(10),t:i}}function My(e){let t=V(hh(e)),n=H(hh(e)),r=H(gh(e));return{closePreview:()=>{r(!0),n(null)},preview:t}}function Ny(){let e=X(),t=V(vh),n=H(vh),r=V(ed),i=t.workspaceId,a=V(_h(i??``)),o=H(_h(i??``)),{refreshBranchState:s}=Oy(i??``),[c,l]=(0,B.useState)(t.inputValue),[u,d]=(0,B.useState)(0),[f,p]=(0,B.useState)(null);(0,B.useEffect)(()=>{l(t.inputValue)},[t.inputValue]),(0,B.useEffect)(()=>{t.visible&&(d(0),p(null))},[t.visible]),(0,B.useEffect)(()=>{if(!t.visible||!i)return;if(a.branches.length>0){o(e=>({...e,loading:!1,error:void 0}));return}let e=!1;return o(e=>({...e,loading:!0,error:void 0})),r(`git.branches`,{workspaceId:i}).then(t=>{if(!e){if(!t.ok||!t.data){o(e=>({...e,loading:!1,error:t.error?.message??`Failed to load branches`})),console.error(`Failed to load git branches:`,t.error?.message);return}o({current:t.data.current,branches:t.data.branches,loading:!1})}}).catch(t=>{e||(o(e=>({...e,loading:!1,error:t instanceof Error?t.message:`Failed to load branches`})),console.error(`Failed to load git branches:`,t))}),()=>{e=!0}},[a.branches.length,r,t.visible,o,i]);let m=c.trim(),h=(0,B.useMemo)(()=>a.branches.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())),[a.branches,c]),g=h.find(e=>e.name.toLowerCase()===c.toLowerCase()),_=(0,B.useMemo)(()=>{let t=[];return h.forEach(e=>{t.push({type:`branch`,branch:e,label:e.name})}),!g&&m&&!a.loading&&t.push({type:f===m?`confirm-create`:`create`,label:e(f===m?`git.quick_pick.confirm_create`:`git.quick_pick.create`,{name:m})}),t},[a.loading,g,h,f,e,m]),v=(0,B.useCallback)(()=>{p(null),n({visible:!1,inputValue:``})},[n]),y=(0,B.useCallback)(e=>{e&&p(e)},[]),b=(0,B.useCallback)(async e=>{if(!i)return;let t=await r(`git.checkout`,{workspaceId:i,ref:e});if(!t.ok||!t.data?.success){console.error(`Failed to checkout branch:`,t.error?.message??t.data?.message);return}await s(),v()},[r,v,s,i]);return{branchList:a,displayItems:_,filteredBranches:h,handleBranchCreate:(0,B.useCallback)(async e=>{if(!i||!e)return;let t=await r(`git.checkout`,{workspaceId:i,ref:e,createBranch:!0});if(!t.ok||!t.data?.success){console.error(`Failed to create branch:`,t.error?.message??t.data?.message);return}await s(),v()},[r,v,s,i]),handleBranchSelect:b,handleClose:v,handleRequestBranchCreate:y,inputValue:c,pendingCreateBranchName:f,quickPickState:t,selectedIndex:u,setInputValue:l,setPendingCreateBranchName:p,setSelectedIndex:d,trimmedInput:m}}function Py(e){let t=e;return e.fullscreenElement??t.webkitCurrentFullScreenElement??null}function Fy(e){if(!e)return null;let t=e;return typeof t.requestFullscreen==`function`?t.requestFullscreen.bind(t):typeof t.webkitRequestFullscreen==`function`?t.webkitRequestFullscreen.bind(t):typeof t.webkitRequestFullScreen==`function`?t.webkitRequestFullScreen.bind(t):null}function Iy(e){let t=e;return typeof e.exitFullscreen==`function`?e.exitFullscreen.bind(e):typeof t.webkitExitFullscreen==`function`?t.webkitExitFullscreen.bind(e):typeof t.webkitCancelFullScreen==`function`?t.webkitCancelFullScreen.bind(e):null}function Ly(e){return!!(Fy(e)&&Iy(document))}function Ry(e){return e instanceof Error&&e.message.trim().length>0?e.message:null}function zy(e){let t=X(),n=H(Hh),[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(!1),s=(0,B.useCallback)(()=>{n({kind:`info`,title:t(`workspace.fullscreen.unsupported_title`),body:t(`workspace.fullscreen.unsupported_body`)})},[n,t]);(0,B.useEffect)(()=>{let t=()=>{let t=e.current;i(Ly(t)),o(!!(t&&Py(document)===t))};return t(),document.addEventListener(`fullscreenchange`,t),document.addEventListener(`webkitfullscreenchange`,t),()=>{document.removeEventListener(`fullscreenchange`,t),document.removeEventListener(`webkitfullscreenchange`,t)}},[e]);let c=(0,B.useCallback)(async()=>{let r=e.current,i=Fy(r);if(!i||!Iy(document)){s();return}try{await Promise.resolve(i())}catch(e){console.warn(`Failed to enter fullscreen`,e),n({kind:`warning`,title:t(`workspace.fullscreen.enter_failed_title`),body:Ry(e)??t(`workspace.fullscreen.enter_failed_body`)})}},[n,s,t,e]),l=(0,B.useCallback)(async()=>{let e=Iy(document);if(Py(document)){if(!e){s();return}try{await Promise.resolve(e())}catch(e){console.warn(`Failed to exit fullscreen`,e),n({kind:`warning`,title:t(`workspace.fullscreen.exit_failed_title`),body:Ry(e)??t(`workspace.fullscreen.exit_failed_body`)})}}},[n,s,t]);return{supported:r,isFullscreen:a,enterFullscreen:c,exitFullscreen:l,toggleFullscreen:(0,B.useCallback)(async()=>{if(e.current&&Py(document)===e.current){await l();return}await c()},[c,l,e])}}var By=220,Vy=120;function Hy(e,t,n){if(e>0)return e;let r=Number.parseFloat(t);return Number.isFinite(r)&&r>0?r:n}function Uy(){let[e,t]=Se(Ch),[n,r]=Se(wh),i=(0,B.useRef)(!1),a=(0,B.useRef)(null),o=(0,B.useRef)(0),s=(0,B.useRef)(0),c=(0,B.useRef)(e),l=(0,B.useRef)(null),u=(0,B.useCallback)(n=>{n.preventDefault(),i.current=!0,o.current=n.clientX,s.current=Hy(a.current?.offsetWidth??0,a.current?.style.width??``,e),c.current=s.current,document.body.classList.add(`is-resizing-panels`);let r=e=>{if(!i.current)return;let t=e.clientX-o.current,n=Math.max(By,s.current+t);c.current=n,a.current&&(a.current.style.width=`${n}px`)},l=()=>{i.current=!1,document.body.classList.remove(`is-resizing-panels`),t(c.current),document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,l)};document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,l)},[t,e]),d=(0,B.useRef)(!1),f=(0,B.useRef)(0),p=(0,B.useRef)(0),m=(0,B.useRef)(n);return{bottomPanelHeight:n,bottomPanelRef:l,handleBottomMouseDown:(0,B.useCallback)(e=>{e.preventDefault(),d.current=!0,f.current=e.clientY,p.current=Hy(l.current?.offsetHeight??0,l.current?.style.height??``,n),m.current=p.current,document.body.classList.add(`is-resizing-panels`);let t=e=>{if(!d.current)return;let t=f.current-e.clientY,n=Math.max(Vy,p.current+t);m.current=n,l.current&&(l.current.style.height=`${n}px`)},i=()=>{d.current=!1,document.body.classList.remove(`is-resizing-panels`),r(m.current),document.removeEventListener(`mousemove`,t),document.removeEventListener(`mouseup`,i)};document.addEventListener(`mousemove`,t),document.addEventListener(`mouseup`,i)},[r,n]),handleLeftMouseDown:u,leftPanelRef:a,leftPanelWidth:e}}function Wy(){let e=V(fd),t=e?.id??`__workspace_placeholder__`,n=V(dd),r=H(rd),i=V(ud),a=V(mh(t)),o=V(fh(t)),s=V(hh(t)),c=V(Sh),l=V(Eh),u=V(Th),{sessions:d,paneLayout:f}=g_(e),p=V(ed),m=H(vh),h=he(),g=Uy(),_=u_(t),v=h_(),{persistUiState:y}=Rg(t),[b,x]=(0,B.useState)(`files`),[S,C]=(0,B.useState)(null),[w,T]=(0,B.useState)(0),[E,D]=(0,B.useState)(null),[O,k]=(0,B.useState)({kind:`root`}),[A,j]=(0,B.useState)(null);(0,B.useEffect)(()=>{if(!e){r(null);return}return r(e.id),()=>{r(t=>t===e.id?null:t)}},[r,e]),(0,B.useEffect)(()=>{if(!e||a)return;let t=!1;return p(`git.status`,{workspaceId:e.id}).then(n=>{t||!n.ok||!n.data||h.set(mh(e.id),n.data)}).catch(e=>{t||console.error(`Failed to load git status:`,e)}),()=>{t=!0}},[p,a,h,e]);let M=(0,B.useCallback)(()=>{e&&(x(`git`),m({visible:!0,workspaceId:e.id,inputValue:``}))},[m,e]),N=(0,B.useCallback)(()=>{C(e=>({id:(e?.id??0)+1,mode:`file`,baseDir:null}))},[]),P=(0,B.useCallback)(()=>{C(e=>({id:(e?.id??0)+1,mode:`folder`,baseDir:null}))},[]),F=(0,B.useCallback)(()=>{C(null)},[]),ee=(0,B.useCallback)(()=>{T(e=>e+1)},[]),te=(0,B.useMemo)(()=>{let e=new Map(d.map(e=>[e.id,e]));return Array.from(new Set(r_(f))).map(t=>e.get(t)).filter(e=>!!e)},[f,d]),ne=e?.uiState?.activeSessionId??null;(0,B.useEffect)(()=>{if(te.some(e=>e.id===A))return;if(ne&&te.some(e=>e.id===ne)){j(ne);return}let e=[...te].sort((e,t)=>t.lastActiveAt-e.lastActiveAt)[0];j(e?.id??te[0]?.id??null)},[A,te,ne]),(0,B.useEffect)(()=>{if(!e||A===null&&e.uiState.activeSessionId)return;let t=A??void 0;e.uiState.activeSessionId!==t&&y({activeSessionId:t})},[A,y,e]);let I=te.find(e=>e.id===A)??null,L=(0,B.useCallback)(e=>{j(e)},[]),R=(0,B.useCallback)(e=>{_.appendSession(e,A,`vertical`),j(e)},[A,_]),re=(0,B.useCallback)(async e=>{_.closeSessionPane(e),await v.closeSession(e),j(t=>t===e?te.filter(t=>t.id!==e)[0]?.id??null:t)},[te,_,v]),ie=(0,B.useCallback)(e=>{D(e),e!==`files`&&k({kind:`root`})},[]),ae=(0,B.useCallback)(()=>{D(null),k({kind:`root`})},[]),z=(0,B.useCallback)(e=>{k(e)},[]);return{activeSession:I,activeFilePath:o,activeWorkspaceId:n,createRequest:S,diffPreview:s,focusMode:c,gitState:a,handleConsumeCreateRequest:F,handleOpenBranchSwitcher:M,handleOpenFileCreate:N,handleOpenFolderCreate:P,handleRefreshSidebarPanel:ee,handleMobileSessionCreated:R,mainAreaMode:b===`git`&&s?`diff`:o?`editor`:`agent`,mobileActiveSessionId:A,mobileFilesRoute:O,mobileSheet:E,openMobileSheet:ie,orderedSessions:te,paneLayout:f,panelRefreshToken:w,closeMobileSession:re,selectMobileSession:L,sessions:d,setSidebarTab:x,sidebarCollapsed:u,sidebarTab:b,closeMobileSheet:ae,terminalPanelVisible:l,updateMobileFilesRoute:z,workspace:e,workspaces:i,workspaceId:t,...g}}function Gy({workspaceId:e,refreshToken:t=0,createRequest:n=null,onCreateRequestConsumed:r,onSelectFile:i}){let a=X(),o=V(ch(e)),s=V(lh(e)),c=V(fh(e)),l=V(ed),u=H(ch(e)),d=H(lh(e)),f=H(fh(e)),p=H(dh(e)),m=V(uh(e)),h=H(uh(e)),[g,_]=(0,B.useState)(!1),[v,y]=(0,B.useState)(null),[b,x]=(0,B.useState)(null),[S,C]=(0,B.useState)(null),w=(0,B.useRef)(t),T=(0,B.useRef)(0),E=(0,B.useCallback)(async()=>{if(!e||g)return!1;_(!0);let t=await l(`file.readTree`,{workspaceId:e});if(t.ok&&t.data){let e=new Map;return e.set(`.`,t.data.children),u(e),h(new Set),_(!1),!0}return t.ok||console.error(`Failed to load file tree:`,t.error?.message),_(!1),!1},[e,g,l,u,h]),D=(0,B.useCallback)(async t=>{if(!e||v===t||m.has(t))return;y(t);let n=await l(`file.readTree`,{workspaceId:e,subPath:t});n.ok&&n.data&&(u(e=>{if(!e)return e;let r=new Map(e);return r.set(t,n.data.children),r}),h(e=>new Set(e).add(t))),y(null)},[e,v,m,l,u,h]),O=(0,B.useCallback)(async t=>{if(!e)return[];let n=await l(`file.search`,{workspaceId:e,query:t,limit:10});return!n.ok||!n.data?[]:n.data.files},[l,e]),k=(0,B.useCallback)((e,t)=>{x({mode:e,draftPath:t?`${t.replace(/\/+$/,``)}/`:``,error:null})},[]),A=(0,B.useCallback)(()=>{x(null)},[]),j=(0,B.useCallback)(e=>{x(t=>t&&{...t,draftPath:e,error:null})},[]),M=(0,B.useCallback)(async()=>{if(!b)return;let t=b.draftPath.trim();if(!t){x(e=>e&&{...e,error:a(`file.path_required`)});return}if(b.mode===`file`&&t.endsWith(`/`)){x(e=>e&&{...e,error:a(`file.invalid_file_path`)});return}let n=await l(b.mode===`file`?`file.create`:`file.mkdir`,{workspaceId:e,path:t});if(!n.ok){x(e=>e&&{...e,error:n.error?.message??a(`file.create_failed`)});return}await E(),A(),b.mode===`file`&&f(t)},[b,l,e,E,A,f,a]),N=(0,B.useCallback)(()=>{C(null)},[]),P=(0,B.useCallback)(async()=>{if(!S)return;let t=await l(`file.delete`,{workspaceId:e,path:S.path});if(!t.ok){C(e=>e&&{...e,error:t.error?.message??a(`file.delete_failed`)});return}c===S.path&&f(null),p(e=>{if(!(S.path in e))return e;let t={...e};return delete t[S.path],t}),await E(),C(null)},[S,l,e,c,f,p,E,a]);return(0,B.useEffect)(()=>{!o&&!g&&E()},[o,g,E]),(0,B.useEffect)(()=>{s&&!g&&(d(!1),E())},[s,g,E,d]),(0,B.useEffect)(()=>{t<=w.current||g||(w.current=t,E())},[t,g,E]),(0,B.useEffect)(()=>{!n||n.id<=T.current||(T.current=n.id,k(n.mode,n.baseDir),r?.())},[n,k,r]),{activeFilePath:c,createDialog:b,fileTree:o,isLoading:g,isLoadingDir:v,pendingDelete:S,cancelDelete:N,confirmDelete:P,handleSelectFile:(0,B.useCallback)(e=>{f(e),i?.(e)},[i,f]),loadChildren:D,loadSearchResults:O,openCreateDialog:k,requestDelete:C,submitCreateDialog:M,updateDraftPath:j,closeCreateDialog:A}}var Ky={minHeight:`auto`,padding:`var(--sp-4)`,gap:0},qy={margin:0,color:`var(--text-tertiary)`,fontSize:`inherit`,fontWeight:`var(--font-normal)`},Jy={display:`block`,width:`auto`,minHeight:`auto`,padding:0,gap:0,textAlign:`left`},Yy={margin:0,color:`inherit`,fontSize:`inherit`,fontWeight:`inherit`};function Xy({title:e}){return(0,Z.jsx)(Ip,{className:`file-tree-empty`,style:Ky,title:(0,Z.jsx)(`p`,{style:qy,children:e})})}function Zy({className:e,title:t}){return(0,Z.jsx)(Ip,{className:e,style:Jy,title:(0,Z.jsx)(`p`,{style:Yy,children:t})})}var Qy=({workspaceId:e,refreshToken:t=0,createRequest:n=null,onCreateRequestConsumed:r,onSelectFile:i,onVisibleCountChange:a,collapseVersion:o=0,variant:s=`desktop`})=>{let c=X(),{activeFilePath:l,createDialog:u,fileTree:d,isLoading:f,isLoadingDir:p,pendingDelete:m,cancelDelete:h,confirmDelete:g,handleSelectFile:_,loadChildren:v,loadSearchResults:y,openCreateDialog:b,requestDelete:x,submitCreateDialog:S,updateDraftPath:C,closeCreateDialog:w}=Gy({workspaceId:e,refreshToken:t,createRequest:n,onCreateRequestConsumed:r,onSelectFile:i}),[T,E]=(0,B.useState)(``),D=T.trim(),O=(0,B.useMemo)(()=>d?ab(ib(d)):[],[d]),[k,A]=(0,B.useState)([]),[j,M]=(0,B.useState)(!1),N=(0,B.useRef)(0),P=D.length>0,F=(0,B.useMemo)(()=>P?k.length:rb(O),[P,k.length,O]);return(0,B.useEffect)(()=>{let e=!1;if(!P)return A([]),M(!1),()=>{e=!0};M(!0);let t=++N.current,n=setTimeout(()=>{(async()=>{let n=await y(D);e||t!==N.current||(A(n),M(!1))})()},150);return()=>{e=!0,clearTimeout(n)}},[P,y,D]),(0,B.useEffect)(()=>{a?.(F,j||f)},[f,a,j,F]),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`file-tree-shell file-tree-shell--${s}`,children:[(0,Z.jsxs)(`label`,{className:`file-tree-search`,htmlFor:`file-tree-search-${e}`,children:[(0,Z.jsx)(jf,{size:14,className:`file-tree-search-icon`,"aria-hidden":`true`}),(0,Z.jsx)(`input`,{id:`file-tree-search-${e}`,className:`file-tree-search-input`,type:`search`,value:T,onChange:e=>E(e.target.value),placeholder:c(`action.search_files`),"aria-label":c(`action.search_files`)})]}),(0,Z.jsx)(`div`,{className:`file-tree`,children:P?j?(0,Z.jsx)(Xy,{title:c(`common.loading`)}):k.length>0?k.map(e=>(0,Z.jsx)($y,{node:e,selectedPath:l,onRequestDelete:(e,t)=>x({path:e,name:t,error:null}),onSelectFile:_},e.path)):(0,Z.jsx)(Xy,{title:c(`command.no_results`)}):d&&d.size>0?O.map(e=>(0,Z.jsx)(eb,{node:e,depth:0,selectedPath:l,onRequestCreate:b,onRequestDelete:(e,t)=>x({path:e,name:t,error:null}),onSelectFile:_,onLoadChildren:v,isLoadingDir:p,collapseVersion:o},e.path)):(0,Z.jsx)(Xy,{title:c(f?`common.loading`:`file.title`)})})]}),(0,Z.jsx)(tb,{dialog:u,onCancel:w,onConfirm:S,onDraftPathChange:C}),(0,Z.jsx)(nb,{pendingDelete:m,onCancel:h,onConfirm:g})]})},$y=({node:e,selectedPath:t,onRequestDelete:n,onSelectFile:r})=>{let i=X(),a=ob(e,!1),o=e.path.includes(`/`)?e.path.slice(0,e.path.lastIndexOf(`/`)):``;return(0,Z.jsxs)(`div`,{className:`tree-item ${t===e.path?`selected`:``}`,onClick:()=>r(e.path),style:{paddingLeft:12},children:[(0,Z.jsx)(`span`,{className:`tree-chevron`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`tree-icon ${sb(e,!1)}`,children:(0,Z.jsx)(a,{size:14})}),(0,Z.jsxs)(`span`,{className:`tree-search-labels`,children:[(0,Z.jsx)(`span`,{className:`tree-label`,children:e.name}),o?(0,Z.jsx)(`span`,{className:`tree-search-path`,children:o}):null]}),(0,Z.jsx)(`div`,{className:`tree-item-actions`,children:(0,Z.jsx)($,{content:i(`file.delete`),children:(0,Z.jsx)(Q,{"aria-label":`${i(`file.delete`)} ${e.path}`,className:`git-row-action`,icon:(0,Z.jsx)(Bf,{size:12}),onClick:t=>{t.stopPropagation(),n(e.path,e.name)},size:`sm`})})})]})},eb=({node:e,depth:t,selectedPath:n,onRequestCreate:r,onRequestDelete:i,onSelectFile:a,onLoadChildren:o,isLoadingDir:s,collapseVersion:c})=>{let l=X(),u=e.kind===`dir`,[d,f]=(0,B.useState)(u&&t===0&&[`app`,`packages`,`src`].includes(e.name.toLowerCase())),p=(0,B.useRef)(!1);(0,B.useEffect)(()=>{e.children&&(p.current=!1)},[e.children]),(0,B.useEffect)(()=>{u&&d&&!e.children&&!p.current&&(p.current=!0,o(e.path))},[u,d,e.children,e.path,o]),(0,B.useEffect)(()=>{c>0&&f(!1)},[c]);let m=()=>{u?(d||o(e.path),f(!d)):a(e.path)},h=t*14+16,g=ob(e,d);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`tree-item ${n===e.path?`selected`:``}`,onClick:m,style:{paddingLeft:h},children:[(0,Z.jsx)(`span`,{className:`tree-chevron`,"aria-hidden":`true`,children:u?d?(0,Z.jsx)(Hd,{size:14}):(0,Z.jsx)(Ud,{size:14}):null}),(0,Z.jsx)(`span`,{className:`tree-icon ${sb(e,d)}`,children:(0,Z.jsx)(g,{size:14})}),(0,Z.jsx)(`span`,{className:`tree-label`,children:e.name}),(0,Z.jsx)(`div`,{className:`tree-item-actions`,children:u?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{content:l(`file.new_file`),children:(0,Z.jsx)(Q,{"aria-label":`${l(`file.new_file`)} ${e.path}`,className:`git-row-action`,icon:(0,Z.jsx)(rf,{size:12}),onClick:t=>{t.stopPropagation(),r(`file`,e.path)},size:`sm`})}),(0,Z.jsx)($,{content:l(`file.new_folder`),children:(0,Z.jsx)(Q,{"aria-label":`${l(`file.new_folder`)} ${e.path}`,className:`git-row-action`,icon:(0,Z.jsx)(cf,{size:12}),onClick:t=>{t.stopPropagation(),r(`folder`,e.path)},size:`sm`})}),(0,Z.jsx)($,{content:l(`file.delete`),children:(0,Z.jsx)(Q,{"aria-label":`${l(`file.delete`)} ${e.path}`,className:`git-row-action`,icon:(0,Z.jsx)(Bf,{size:12}),onClick:t=>{t.stopPropagation(),i(e.path,e.name)},size:`sm`})})]}):(0,Z.jsx)($,{content:l(`file.delete`),children:(0,Z.jsx)(Q,{"aria-label":`${l(`file.delete`)} ${e.path}`,className:`git-row-action`,icon:(0,Z.jsx)(Bf,{size:12}),onClick:t=>{t.stopPropagation(),i(e.path,e.name)},size:`sm`})})})]}),u&&d&&e.children&&(0,Z.jsxs)(`div`,{className:`tree-children`,children:[ab(e.children).map(e=>(0,Z.jsx)(eb,{node:e,depth:t+1,selectedPath:n,onRequestCreate:r,onRequestDelete:i,onSelectFile:a,onLoadChildren:o,isLoadingDir:s,collapseVersion:c},e.path)),e.children.length===0&&!s&&(0,Z.jsx)(Zy,{className:`tree-empty-hint`,title:l(`file.empty_directory`)})]}),u&&d&&!e.children&&s===e.path&&(0,Z.jsx)(Zy,{className:`tree-loading`,title:l(`common.loading`)})]})},tb=({dialog:e,onCancel:t,onConfirm:n,onDraftPathChange:r})=>{let i=X(),a=(0,B.useRef)(null);if(!e)return null;let o=`file-path-helper`,s=e.error?`file-path-error`:void 0,c=e.mode===`file`?i(`file.path_helper_file`):i(`file.path_helper_folder`),l=[o,s].filter(Boolean).join(` `);return(0,Z.jsxs)(Ep,{initialFocus:()=>a.current,onOpenChange:t,open:!0,children:[(0,Z.jsxs)(Dp,{children:[(0,Z.jsxs)(Op,{children:[e.mode===`file`?(0,Z.jsx)(rf,{"aria-hidden":`true`,size:16}):(0,Z.jsx)(cf,{"aria-hidden":`true`,size:16}),(0,Z.jsx)(`span`,{children:e.mode===`file`?i(`file.new_file`):i(`file.new_folder`)})]}),(0,Z.jsx)(Q,{"aria-label":i(`action.close`),icon:(0,Z.jsx)(Hf,{size:14}),onClick:t,size:`sm`})]}),(0,Z.jsx)(kp,{children:(0,Z.jsxs)(`div`,{className:`form-group`,children:[(0,Z.jsx)(`label`,{htmlFor:`file-path`,children:i(`file.path`)}),(0,Z.jsx)(Bp,{id:`file-path`,ref:a,value:e.draftPath,onChange:e=>r(e.target.value),placeholder:e.mode===`file`?`src/demo/new-file.ts`:`src/demo/new-folder`,"aria-describedby":l,invalid:!!e.error,autoFocus:!0}),(0,Z.jsx)(`span`,{id:o,className:`dialog-helper`,children:c}),e.error?(0,Z.jsx)(`span`,{id:s,className:`form-error`,role:`alert`,children:e.error}):null]})}),(0,Z.jsxs)(Ap,{children:[(0,Z.jsx)(gp,{onClick:t,children:i(`action.cancel`)}),(0,Z.jsx)(gp,{variant:`primary`,onClick:()=>{n()},children:i(`action.confirm`)})]})]})},nb=({pendingDelete:e,onCancel:t,onConfirm:n})=>{let r=X();return e?(0,Z.jsx)(Np,{open:!0,onOpenChange:t,title:r(`file.delete`),description:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{children:r(`file.delete_confirm`,{name:e.name})}),e.error?(0,Z.jsx)(`span`,{className:`form-error`,role:`alert`,children:e.error}):null]}),cancelText:r(`action.cancel`),closeLabel:r(`action.close`),confirmText:r(`action.confirm`),onConfirm:()=>{n()},tone:`danger`}):null};function rb(e){return e.reduce((e,t)=>t.kind===`file`?e+1:e+rb(t.children??[]),0)}function ib(e){let t=n=>n.map(n=>n.kind===`dir`&&e.has(n.path)?{...n,children:t(e.get(n.path))}:n);return t(e.get(`.`)??[])}function ab(e){return[...e].sort((e,t)=>e.kind===t.kind?e.name.localeCompare(t.name):e.kind===`dir`?-1:1)}function ob(e,t){if(e.kind===`dir`)return t?sf:lf;switch(e.name.split(`.`).pop()?.toLowerCase()){case`ts`:case`tsx`:case`js`:case`jsx`:case`mjs`:case`cjs`:case`py`:case`go`:case`rs`:case`java`:return tf;case`json`:case`yaml`:case`yml`:case`toml`:case`lock`:return ef;case`md`:case`txt`:return af;case`png`:case`jpg`:case`jpeg`:case`gif`:case`svg`:case`webp`:return nf;default:return of}}function sb(e,t){if(e.kind===`dir`)return`folder`;switch(e.name.split(`.`).pop()?.toLowerCase()){case`ts`:case`tsx`:case`js`:case`jsx`:case`mjs`:case`cjs`:case`py`:case`go`:case`rs`:case`java`:return`code`;case`json`:case`yaml`:case`yml`:case`toml`:case`lock`:return`data`;case`md`:case`txt`:return`doc`;case`png`:case`jpg`:case`jpeg`:case`gif`:case`svg`:case`webp`:return`media`;default:return`file`}}function cb(e){return e.startsWith(`diff --git`)||e.startsWith(`index `)||e.startsWith(`--- `)||e.startsWith(`+++ `)||e.startsWith(`@@`)?`meta`:e.startsWith(`+`)?`added`:e.startsWith(`-`)?`removed`:`context`}var lb=({workspaceId:e,onClose:t,showCloseButton:n=!0})=>{let r=X(),{preview:i,closePreview:a}=My(e),o=t??a,s=(0,B.useMemo)(()=>i?.diff.split(`
110
- `).map((e,t)=>({id:`${t}:${e}`,line:e,tone:cb(e),lineNumber:t+1}))??[],[i]);return(0,Z.jsx)(`div`,{className:`workspace-git-view`,children:(0,Z.jsxs)(`div`,{className:`code-editor workspace-git-editor`,children:[(0,Z.jsxs)(`div`,{className:`code-editor-header`,children:[(0,Z.jsx)(`span`,{className:`code-file-path`,children:i?.title??i?.path??`Select a changed file to inspect`}),i&&n?(0,Z.jsx)(`div`,{className:`code-mode-toggle`,children:(0,Z.jsx)($,{content:r(`action.close`),children:(0,Z.jsx)(Q,{"aria-label":r(`action.close`),className:`code-mode-btn`,icon:(0,Z.jsx)(Hf,{size:12}),onClick:o,size:`sm`})})}):null]}),(0,Z.jsx)(`div`,{className:`code-editor-body`,children:i?(0,Z.jsx)(`div`,{className:`code-lines git-diff-lines`,children:s.map(e=>(0,Z.jsxs)(`div`,{className:`code-line git-diff-line git-diff-line-${e.tone}`,children:[(0,Z.jsx)(`span`,{className:`code-line-num`,children:e.lineNumber}),(0,Z.jsx)(`span`,{className:`git-diff-line-text`,children:e.line||` `})]},e.id))}):(0,Z.jsx)(Ip,{className:`git-diff-empty`,description:(0,Z.jsx)(`p`,{className:`git-diff-empty-body`,children:`Select a staged or modified file on the left to inspect its diff.`}),title:(0,Z.jsx)(`p`,{className:`git-diff-empty-title`,children:r(`label.git`)})})})]})})};function ub(e){return e.trim().replace(/[^a-zA-Z0-9._-]+/g,`-`).replace(/^-+|-+$/g,``)}function db(e,t){let n=e.trim(),r=n.replace(/[\\/]+$/,``)||n,i=n.includes(`\\`)?`\\`:`/`,a=/^([A-Za-z]:)([\\/]*)(.*)$/.exec(n),o=/^(\\\\|\/\/)([^\\/]+)[\\/]+([^\\/]+)(?:[\\/]+(.*))?$/.exec(n),s=``,c=r;a?(s=`${a[1]}${i}`,c=a[3].replace(/[\\/]+$/,``).replace(/^[\\/]+/,``)):o?(s=`${o[1]}${o[2]}${i}${o[3]}${i}`,c=(o[4]??``).replace(/[\\/]+$/,``).replace(/^[\\/]+/,``)):(r.startsWith(`/`)||r.startsWith(`\\`))&&(s=r[0],c=r.replace(/^[\\/]+/,``));let l=c.split(/[\\/]+/).filter(Boolean),u=l.pop()??`worktree`,d=l.length>0?`${l.join(i)}${i}`:``,f=ub(t||`worktree`);return`${s}${d}${u}-${f}`}function fb(e){let t=e.trim();return t?/^[A-Za-z]:[\\/]+$/.test(t)?`${t.slice(0,2)}${t.includes(`\\`)?`\\`:`/`}`:t.replace(/[\\/]+$/,``)||t:``}function pb(e){return/^(?:\/|[A-Za-z]:[\\/]|\\\\)/.test(e)}function mb(e){let t=X(),n=V(ed),r=V(cd(e)),[i,a]=Se(bh(e)),o=H(rd),s=H(id),c=H(ad),l=H(od),u=H(sd),d=H(Hh),f=(0,B.useCallback)(async()=>{if(!e)return!1;a(e=>({...e,loading:!0,error:void 0}));let t=await n(`worktree.list`,{workspaceId:e});return!t.ok||!t.data?(a(e=>({...e,loading:!1,error:t.error?.message??`Failed to load worktrees`})),!1):(a({items:t.data.worktrees,loading:!1,lastLoadedAt:Date.now()}),!0)},[n,a,e]),p=(0,B.useCallback)(async(r,i)=>{let a=fb(i);if(!a||!pb(a)){let e=t(`worktree.create_path_absolute_required`);return d({kind:`error`,title:t(`worktree.create_failed_title`),body:e}),{ok:!1,error:e}}let o=await n(`worktree.create`,{workspaceId:e,branch:r,path:a});if(!o.ok||!o.data?.worktree){let e=o.error?.message??`Failed to create worktree`;return d({kind:`error`,title:t(`worktree.create_failed_title`),body:e}),{ok:!1,error:e}}return await f(),d({kind:`success`,title:t(`worktree.create_success_title`),body:t(`worktree.create_success_body`,{name:o.data.worktree.name})}),{ok:!0,worktree:o.data.worktree}},[n,f,d,t,e]),m=(0,B.useCallback)(async(r,i=!1)=>{let a=await n(`worktree.remove`,{workspaceId:e,worktreePath:r,force:i});if(!a.ok){let e=a.error?.message??`Failed to remove worktree`;return d({kind:`error`,title:t(`worktree.remove_failed_title`),body:e}),{ok:!1,error:e}}return await f(),d({kind:`success`,title:t(`worktree.remove_success_title`),body:t(`worktree.remove_success_body`)}),{ok:!0}},[n,f,d,t,e]),h=(0,B.useMemo)(()=>i.items.find(e=>e.path===r?.path)??null,[i.items,r?.path]),g=(0,B.useMemo)(()=>i.items.filter(e=>e.status===`dirty`).length,[i.items]),_=(0,B.useCallback)(e=>r?.path?db(r.path,e):``,[r?.path]),v=(0,B.useCallback)(async e=>{let r=await n(`workspace.open`,{path:e});if(!r.ok||!r.data?.id){let e=r.error?.message??`Failed to open worktree`;return d({kind:`error`,title:t(`workspace.launch.open_failed`),body:e}),{ok:!1,error:e}}return o(r.data.id),s(e=>({...e,[r.data.id]:r.data})),c(e=>e.includes(r.data.id)?e:[r.data.id,...e]),l(`ready`),u(null),{ok:!0,workspace:r.data}},[n,d,o,c,s,u,l,t]);return{createWorktree:p,currentWorktree:h,dirtyCount:g,hasWorkspace:!!r,list:i,loadWorktrees:f,openWorktree:v,removeWorktreeByPath:m,suggestedPathForBranch:_}}var hb={minHeight:`auto`,padding:`var(--sp-4)`,gap:0},gb={margin:0,color:`var(--text-tertiary)`,fontWeight:`var(--font-normal)`};function _b({title:e}){return(0,Z.jsx)(Ip,{className:`worktree-loading`,style:hb,title:(0,Z.jsx)(`p`,{style:gb,children:e})})}function vb({workspaceId:e,worktree:t,mobile:n=!1}){let r=X(),{activeTab:i,diff:a,error:o,handleTabChange:s,loading:c,status:l,tree:u}=Oh(e,t);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:n?`mobile-worktree-sheet__summary`:void 0,children:(0,Z.jsxs)(`div`,{className:`worktree-chips`,children:[(0,Z.jsxs)(`span`,{className:`worktree-chip worktree-chip-branch`,children:[`🌿 `,t.branch]}),(0,Z.jsxs)(`span`,{className:`worktree-chip worktree-chip-path`,children:[`📁 `,t.path]}),(0,Z.jsx)(`span`,{className:`worktree-chip worktree-chip-status ${t.status===`clean`?`worktree-clean`:`worktree-dirty`}`,children:t.status===`clean`?`✓ ${r(`worktree.clean`)}`:`● ${r(`worktree.dirty_status`)}`})]})}),(0,Z.jsxs)(cm,{"aria-label":r(`worktree.title`),onValueChange:e=>s(e),value:i,children:[(0,Z.jsx)(lm,{className:`worktree-tabs${n?` mobile-worktree-sheet__tabs`:``}`,children:[`status`,`diff`,`tree`].map(e=>(0,Z.jsx)(um,{className:`worktree-tab`,value:e,children:r(e===`status`?`worktree.status_tab`:e===`diff`?`worktree.diff_tab`:`worktree.tree_tab`)},e))}),(0,Z.jsxs)(`div`,{className:n?`mobile-worktree-sheet__content`:void 0,children:[(0,Z.jsxs)(dm,{className:`worktree-content`,value:`status`,children:[o?(0,Z.jsx)(`div`,{className:`worktree-error`,children:o}):null,c?(0,Z.jsx)(_b,{title:r(`worktree.loading`)}):(0,Z.jsxs)(`div`,{className:`worktree-status-tab`,children:[(0,Z.jsxs)(`div`,{className:`worktree-info-row`,children:[(0,Z.jsx)(`span`,{className:`worktree-info-label`,children:r(`worktree.path`)}),(0,Z.jsx)(`span`,{className:`worktree-info-value`,children:t.path})]}),(0,Z.jsxs)(`div`,{className:`worktree-info-row`,children:[(0,Z.jsx)(`span`,{className:`worktree-info-label`,children:r(`worktree.branch`)}),(0,Z.jsx)(`span`,{className:`worktree-info-value`,children:t.branch})]}),(0,Z.jsxs)(`div`,{className:`worktree-info-row`,children:[(0,Z.jsx)(`span`,{className:`worktree-info-label`,children:r(`git.latest_commit`)}),(0,Z.jsx)(`span`,{className:`worktree-info-value`,children:l?.headShortSha||t.commit?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`code`,{children:l?.headShortSha??t.commit}),l?.headSubject?` ${l.headSubject}`:``]}):r(`git.no_commits`)})]}),(0,Z.jsxs)(`div`,{className:`worktree-info-row`,children:[(0,Z.jsx)(`span`,{className:`worktree-info-label`,children:r(`label.status`)}),(0,Z.jsx)(`span`,{className:`worktree-info-value`,children:t.status===`clean`?r(`worktree.clean`):r(`worktree.dirty`)})]}),l?(0,Z.jsxs)(`div`,{className:`worktree-changes`,children:[(0,Z.jsx)(`h4`,{children:r(`worktree.changes`)}),l.staged.length>0?(0,Z.jsx)(`div`,{className:`worktree-change-group`,children:(0,Z.jsx)(`span`,{children:r(`worktree.staged_count`,{count:l.staged.length})})}):null,l.modified.length>0?(0,Z.jsx)(`div`,{className:`worktree-change-group`,children:(0,Z.jsx)(`span`,{children:r(`worktree.modified_count`,{count:l.modified.length})})}):null,l.untracked.length>0?(0,Z.jsx)(`div`,{className:`worktree-change-group`,children:(0,Z.jsx)(`span`,{children:r(`worktree.untracked_count`,{count:l.untracked.length})})}):null]}):null]})]}),(0,Z.jsxs)(dm,{className:`worktree-content`,value:`diff`,children:[o?(0,Z.jsx)(`div`,{className:`worktree-error`,children:o}):null,c?(0,Z.jsx)(_b,{title:r(`worktree.loading`)}):(0,Z.jsx)(`div`,{className:`worktree-diff-tab`,children:a?(0,Z.jsx)(`pre`,{className:`worktree-diff-output`,children:a}):(0,Z.jsx)(Ip,{className:`worktree-empty`,style:hb,title:(0,Z.jsx)(`p`,{style:gb,children:r(`git.no_changes`)})})})]}),(0,Z.jsxs)(dm,{className:`worktree-content`,value:`tree`,children:[o?(0,Z.jsx)(`div`,{className:`worktree-error`,children:o}):null,c?(0,Z.jsx)(_b,{title:r(`worktree.loading`)}):(0,Z.jsx)(`div`,{className:`worktree-tree-tab`,children:u.length>0?(0,Z.jsx)(`div`,{className:`worktree-tree`,children:u.map(e=>(0,Z.jsxs)(`div`,{className:`worktree-tree-node`,children:[(0,Z.jsx)(`span`,{className:`worktree-tree-icon`,children:e.kind===`dir`?`📁`:`📄`}),(0,Z.jsx)(`span`,{className:`worktree-tree-name`,children:e.name})]},e.path))}):(0,Z.jsx)(Ip,{className:`worktree-empty`,style:hb,title:(0,Z.jsx)(`p`,{style:gb,children:r(`worktree.empty_tree`)})})})]})]})]})]})}var yb={minHeight:`auto`,padding:`var(--sp-4) 0`,gap:0},bb={margin:0,color:`var(--text-tertiary)`,fontWeight:`var(--font-normal)`};function xb({title:e}){return(0,Z.jsx)(Ip,{className:`worktree-loading`,style:yb,title:(0,Z.jsx)(`p`,{style:bb,children:e})})}function Sb({workspaceId:e,openView:t,onClose:n}){let r=Fr()===`mobile`,i=X(),{createWorktree:a,currentWorktree:o,list:s,loadWorktrees:c,removeWorktreeByPath:l,suggestedPathForBranch:u}=mb(e),[d,f]=(0,B.useState)(`list`),[p,m]=(0,B.useState)(null),[h,g]=(0,B.useState)(``),[_,v]=(0,B.useState)(``),[y,b]=(0,B.useState)(!1),[x,S]=(0,B.useState)(null),[C,w]=(0,B.useState)(null),[T,E]=(0,B.useState)(null),[D,O]=(0,B.useState)(null),k=(0,B.useRef)(!1),A=(0,B.useRef)(null),j=()=>{g(``),v(``),b(!1),w(null)};(0,B.useEffect)(()=>{if(!t){k.current=!1;return}k.current||(k.current=!0,O(null),E(null),S(null),m(null),t===`create`?(j(),f(`create`)):f(`list`),!s.lastLoadedAt&&!s.loading&&c())},[s.lastLoadedAt,s.loading,c,t]),(0,B.useEffect)(()=>{d!==`create`||y||v(h.trim()?u(h):``)},[h,y,u,d]);let M=(0,B.useMemo)(()=>s.items.find(e=>e.path===p)??null,[s.items,p]),N=(0,B.useMemo)(()=>s.items.find(e=>e.path===x)??null,[x,s.items]);if((0,B.useEffect)(()=>{d===`detail`&&p&&!M&&(O(i(`worktree.selection_removed`)),m(null),f(`list`))},[M,p,i,d]),!t)return null;let P=d===`detail`&&M?M.name:i(d===`create`?`worktree.create_title`:`worktree.list_title`),F=h.trim().length>0&&/^(?:\/|[A-Za-z]:[\\/]|\\\\)/.test(_.trim()),ee=`worktree-path-hint-${e}`,te=()=>{E(null),S(null),f(`list`)},ne=()=>{j(),S(null),m(null),O(null),f(`create`)},I=()=>{N&&(E(null),l(N.path,N.status===`dirty`).then(e=>{if(e.ok){te();return}E(e.error)}))},L=d===`detail`&&M?(0,Z.jsx)(`div`,{className:r?`mobile-worktree-sheet`:void 0,children:(0,Z.jsx)(vb,{workspaceId:e,worktree:M,mobile:r})}):d===`create`?(0,Z.jsxs)(`form`,{className:`worktree-manager__form`,onSubmit:e=>{e.preventDefault(),w(null),a(h.trim(),_.trim()).then(e=>{if(e.ok){j(),f(`list`);return}w(e.error)})},children:[C?(0,Z.jsx)(`div`,{className:`worktree-error`,children:C}):null,(0,Z.jsxs)(`div`,{className:`worktree-manager__field`,children:[(0,Z.jsx)(`label`,{className:`worktree-manager__field-label`,htmlFor:`worktree-branch-${e}`,children:i(`worktree.branch`)}),(0,Z.jsx)(Bp,{id:`worktree-branch-${e}`,ref:A,value:h,onChange:e=>g(e.target.value),placeholder:`feature/worktree-manager`,autoFocus:!0})]}),(0,Z.jsxs)(`div`,{className:`worktree-manager__field`,children:[(0,Z.jsx)(`label`,{className:`worktree-manager__field-label`,htmlFor:`worktree-path-${e}`,children:i(`worktree.path`)}),(0,Z.jsx)(Bp,{id:`worktree-path-${e}`,value:_,onChange:e=>{b(!0),v(e.target.value)},placeholder:`/home/spencer/workspace/coder-studio-feature-worktree-manager`,"aria-describedby":ee}),(0,Z.jsx)(`span`,{id:ee,className:`worktree-manager__field-hint`,children:i(`worktree.create_path_hint`)})]}),(0,Z.jsxs)(`div`,{className:`worktree-manager__form-actions`,children:[(0,Z.jsx)(gp,{variant:`secondary`,onClick:()=>f(`list`),children:i(`action.cancel`)}),(0,Z.jsx)(gp,{type:`submit`,variant:`primary`,disabled:!F,children:i(`worktree.create_submit`)})]})]}):d===`confirm-delete`&&N?(0,Z.jsxs)(`div`,{className:`worktree-manager__confirm`,children:[T?(0,Z.jsx)(`div`,{className:`worktree-error`,children:T}):null,(0,Z.jsx)(`p`,{children:N.status===`dirty`?i(`worktree.remove_force_confirm`):i(`worktree.remove_confirm`)}),(0,Z.jsx)(`code`,{className:`worktree-manager__confirm-path`,children:N.path}),(0,Z.jsxs)(`div`,{className:`worktree-manager__confirm-actions`,children:[(0,Z.jsx)(gp,{variant:`secondary`,onClick:te,children:i(`action.cancel`)}),(0,Z.jsx)(gp,{variant:`danger`,onClick:()=>{I()},children:N.status===`dirty`?i(`worktree.force_remove`):i(`common.delete`)})]})]}):(0,Z.jsxs)(`div`,{className:`worktree-manager__list`,children:[D?(0,Z.jsx)(`div`,{className:`worktree-error`,children:D}):null,s.error?(0,Z.jsxs)(`div`,{className:`worktree-error`,children:[(0,Z.jsx)(`div`,{children:s.error}),(0,Z.jsx)(gp,{variant:`secondary`,size:`sm`,onClick:()=>void c(),children:i(`action.refresh`)})]}):null,s.loading&&s.items.length===0?(0,Z.jsx)(xb,{title:i(`worktree.loading`)}):s.error&&s.items.length===0?null:s.items.length===0?(0,Z.jsx)(Ip,{className:`worktree-empty`,style:yb,title:(0,Z.jsx)(`p`,{style:bb,children:i(`worktree.list_empty`)})}):s.items.map((e,t)=>{let n=o?.path===e.path,r=t===0;return(0,Z.jsxs)(`div`,{className:`worktree-manager__row`,children:[(0,Z.jsxs)(`button`,{type:`button`,className:`worktree-manager__row-main`,onClick:()=>{O(null),m(e.path),f(`detail`)},children:[(0,Z.jsx)(`span`,{className:`worktree-manager__row-name`,children:e.name}),(0,Z.jsxs)(`div`,{className:`worktree-manager__meta`,children:[(0,Z.jsxs)(`span`,{className:`worktree-chip worktree-chip-branch`,children:[`🌿 `,e.branch]}),(0,Z.jsx)(`span`,{className:`worktree-chip worktree-chip-status ${e.status===`clean`?`worktree-clean`:`worktree-dirty`}`,children:e.status===`clean`?i(`worktree.clean`):i(`worktree.dirty_status`)}),n?(0,Z.jsx)(`span`,{className:`worktree-chip`,children:i(`worktree.current`)}):null]}),(0,Z.jsx)(`span`,{className:`worktree-manager__row-path`,children:e.path})]}),!n&&!r?(0,Z.jsx)(gp,{"aria-label":i(`worktree.remove_row_label`,{name:e.name}),size:`sm`,variant:`ghost`,onClick:()=>{E(null),S(e.path),f(`confirm-delete`)},children:i(`common.delete`)}):null]},e.path)})]});return!r&&d===`confirm-delete`&&N?(0,Z.jsx)(Np,{open:!0,className:`worktree-manager-surface`,title:i(`common.delete`),description:(0,Z.jsxs)(`div`,{className:`worktree-manager__confirm`,children:[T?(0,Z.jsx)(`div`,{className:`worktree-error`,children:T}):null,(0,Z.jsx)(`p`,{children:N.status===`dirty`?i(`worktree.remove_force_confirm`):i(`worktree.remove_confirm`)}),(0,Z.jsx)(`code`,{className:`worktree-manager__confirm-path`,children:N.path})]}),cancelText:i(`action.cancel`),closeLabel:i(`action.close`),confirmText:N.status===`dirty`?i(`worktree.force_remove`):i(`common.delete`),onOpenChange:e=>{e||te()},onConfirm:I,tone:`danger`}):r?(0,Z.jsx)(ep,{kicker:i(`worktree.title`).toUpperCase(),title:P,body:(0,Z.jsx)(`div`,{className:`worktree-manager-surface`,children:L}),bodyClassName:`mobile-sheet__body--flush`,contentClassName:`mobile-sheet--worktree`,onBack:d===`list`?void 0:()=>f(`list`),headerAction:d===`list`?(0,Z.jsx)(gp,{size:`sm`,variant:`primary`,onClick:ne,children:i(`worktree.new`)}):void 0,onClose:n}):(0,Z.jsxs)(Ep,{className:`worktree-manager-surface`,initialFocus:()=>d===`create`?A.current:null,onOpenChange:e=>{e||n()},open:!0,size:`lg`,children:[(0,Z.jsxs)(Dp,{children:[(0,Z.jsx)(`div`,{className:`worktree-header-info`,children:(0,Z.jsx)(Op,{children:P})}),(0,Z.jsxs)(`div`,{className:`worktree-manager-surface__header-actions`,children:[d===`list`?(0,Z.jsx)(gp,{size:`sm`,variant:`primary`,onClick:ne,children:i(`worktree.new`)}):(0,Z.jsx)(gp,{size:`sm`,variant:`ghost`,onClick:()=>f(`list`),children:i(`action.back`)}),(0,Z.jsx)(gp,{size:`sm`,variant:`ghost`,onClick:n,children:i(`action.close`)})]})]}),L]})}var Cb={minHeight:`auto`,padding:`12px 0`,gap:`4px`},wb={margin:0,color:`var(--text-tertiary)`,fontSize:`inherit`,fontWeight:`var(--font-normal)`};function Tb({title:e,action:t}){return(0,Z.jsx)(Ip,{action:t,className:`git-panel-empty`,style:Cb,title:(0,Z.jsx)(`p`,{style:wb,children:e})})}var Eb=({workspaceId:e,refreshToken:t=0,onPreviewOpen:n,variant:r=`desktop`})=>{let i=r===`mobile`,a=V(Hr)===`zh`?`zh`:`en`,o=X(),{commitMessage:s,diffPreview:c,gitState:l,groups:u,history:d,historyLoading:f,isLoading:p,pendingDiscard:m,setCommitMessage:h,handleCancelDiscard:g,handleCommit:_,handleConfirmDiscard:v,handleRequestDiscardPaths:y,handleRequestDiscardSingle:b,handleStagePaths:x,handleUnstagePaths:S,openHistoryDiff:C,openDiff:w,runGitMutation:T}=jy({workspaceId:e,refreshToken:t,onPreviewOpen:n,initialHistoryLimit:20}),{currentWorktree:E,hasWorkspace:D,list:O,loadWorktrees:k,openWorktree:A}=mb(e),[j,M]=(0,B.useState)(null),[N,P]=(0,B.useState)(!1),[F,ee]=(0,B.useState)(!1),te=(0,B.useRef)(!1),[ne,I]=(0,B.useState)(()=>i?{staged:!1,changes:!0}:{staged:!1,changes:!1});(0,B.useEffect)(()=>{te.current=!1},[e]),(0,B.useEffect)(()=>{if(!D){te.current=!1;return}O.lastLoadedAt||O.loading||te.current||(te.current=!0,k())},[D,O.lastLoadedAt,O.loading,k]);let L=l?.staged.length??0,R=!!s.trim()&&L>0,re=async e=>{if(E?.path===e.path){M(`list`);return}await A(e.path)};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`git-panel git-panel--${r}`,children:(0,Z.jsxs)(`div`,{className:`git-panel-scroll`,children:[(0,Z.jsxs)(`section`,{className:`git-commit-block`,children:[(0,Z.jsx)(qm,{className:`git-commit-input`,placeholder:o(`git.commit_summary_placeholder`),value:s,onChange:e=>h(e.target.value),rows:3,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),_())}}),(0,Z.jsx)(`div`,{className:`git-commit-actions`,children:(0,Z.jsx)($,{content:o(R?`git.commit`:`git.nothing_staged`),children:(0,Z.jsxs)(`button`,{className:`git-commit-primary`,onClick:()=>void _(),disabled:!R,type:`button`,children:[(0,Z.jsx)(`span`,{children:o(`git.commit`)}),(0,Z.jsx)(zd,{size:14})]})})})]}),(0,Z.jsxs)(`section`,{className:`git-panel-section`,children:[(0,Z.jsxs)(`div`,{className:`git-panel-section-header`,children:[(0,Z.jsxs)(`button`,{type:`button`,className:`git-panel-section-toggle`,onClick:()=>P(e=>!e),"aria-expanded":N,children:[(0,Z.jsx)(`span`,{children:o(`worktree.list_title`)}),(0,Z.jsx)(`span`,{className:`git-panel-section-count`,children:O.items.length}),(0,Z.jsx)(`span`,{className:`git-panel-section-chevron ${N?`expanded`:``}`,children:(0,Z.jsx)(Hd,{size:14})})]}),(0,Z.jsxs)(`button`,{type:`button`,className:`git-panel-section-link`,onClick:()=>M(`create`),children:[`+ `,o(`worktree.new`)]})]}),N?(0,Z.jsx)(`div`,{className:`git-panel-section-body`,children:O.loading&&O.items.length===0?(0,Z.jsx)(Tb,{title:o(`worktree.loading`)}):O.error?(0,Z.jsx)(Tb,{action:(0,Z.jsx)(`button`,{type:`button`,className:`git-panel-section-link`,onClick:()=>void k(),children:o(`action.refresh`)}),title:O.error}):O.items.length===0?(0,Z.jsx)(Tb,{title:o(`worktree.list_empty`)}):O.items.map(e=>(0,Z.jsxs)(`button`,{type:`button`,className:`git-worktree-row ${E?.path===e.path?`active`:``}`,onClick:()=>void re(e),children:[(0,Z.jsx)(`span`,{className:`git-worktree-row__dot git-worktree-row__dot-${e.status}`,"aria-hidden":`true`}),(0,Z.jsxs)(`span`,{className:`git-worktree-row__copy`,children:[(0,Z.jsx)(`span`,{className:`git-worktree-row__name`,children:e.name}),(0,Z.jsxs)(`span`,{className:`git-worktree-row__meta`,children:[e.branch,` ·`,` `,e.status===`clean`?o(`worktree.clean`):o(`worktree.dirty_status`)]})]}),E?.path===e.path?(0,Z.jsx)(`span`,{className:`git-worktree-row__chip`,children:o(`worktree.current`)}):null]},e.path))}):null]}),(0,Z.jsx)(`div`,{className:`git-panel-groups`,children:l&&u.length>0?u.map(t=>(0,Z.jsx)(Db,{title:t.title,changes:t.changes,mobile:i,collapsed:ne[t.title]??!1,selectedPath:c?.path??null,onToggleCollapsed:()=>I(e=>({...e,[t.title]:!(e[t.title]??!1)})),onStageAll:async()=>{if(t.title===`staged`){await S(t.changes.map(({change:e})=>e.path));return}await x(t.changes.map(({change:e})=>e.path))},onDiscardAll:()=>y(t.changes.map(({change:e})=>e.path)),onViewDiff:w,onRunMutation:T,onRequestDiscard:b,workspaceId:e},t.title)):(0,Z.jsx)(Tb,{title:o(p?`common.loading`:`git.no_changes`)})}),(0,Z.jsxs)(`section`,{className:`git-panel-section git-panel-section-history`,children:[(0,Z.jsx)(`div`,{className:`git-panel-section-header`,children:(0,Z.jsxs)(`button`,{type:`button`,className:`git-panel-section-toggle`,onClick:()=>ee(e=>!e),"aria-expanded":F,children:[(0,Z.jsx)(`span`,{children:o(`git.history`)}),(0,Z.jsx)(`span`,{className:`git-panel-section-chevron ${F?`expanded`:``}`,children:(0,Z.jsx)(Hd,{size:14})})]})}),F?(0,Z.jsx)(`div`,{className:`git-panel-section-body`,children:f&&d.length===0?(0,Z.jsx)(Tb,{title:o(`common.loading`)}):d.length===0?(0,Z.jsx)(Tb,{title:o(`git.no_commits`)}):d.map((e,t)=>(0,Z.jsx)(kb,{entry:e,isCurrent:t===0,locale:a,onOpen:C},e.sha))}):null]})]})}),(0,Z.jsx)(Sb,{workspaceId:e,openView:j,onClose:()=>M(null)}),(0,Z.jsx)(Ab,{discard:m,onCancel:g,onConfirm:v})]})},Db=({title:e,changes:t,collapsed:n,mobile:r,selectedPath:i,workspaceId:a,onDiscardAll:o,onRequestDiscard:s,onRunMutation:c,onStageAll:l,onToggleCollapsed:u,onViewDiff:d})=>{let f=X(),p=e===`staged`?`git.staged`:`git.changes`,m=f(e===`staged`?`git.unstage_all`:`git.stage_all`);return(0,Z.jsxs)(`section`,{className:`git-panel-section git-panel-section-changes`,children:[(0,Z.jsxs)(`div`,{className:`git-panel-section-header`,children:[(0,Z.jsxs)(`button`,{type:`button`,className:`git-panel-section-toggle`,onClick:u,"aria-expanded":!n,children:[(0,Z.jsx)(`span`,{children:f(p)}),(0,Z.jsx)(`span`,{className:`git-panel-section-count`,children:t.length}),(0,Z.jsx)(`span`,{className:`git-panel-section-chevron ${n?``:`expanded`}`,children:(0,Z.jsx)(Hd,{size:14})})]}),(0,Z.jsxs)(`div`,{className:`git-panel-section-actions`,children:[(0,Z.jsx)($,{content:m,children:(0,Z.jsx)(`button`,{type:`button`,className:`git-panel-section-link`,onClick:()=>void l(),children:m})}),e===`changes`?(0,Z.jsx)($,{content:f(`git.discard_all`),children:(0,Z.jsx)(`button`,{type:`button`,className:`git-panel-section-link`,onClick:()=>void o(),children:f(`git.discard_all`)})}):null]})]}),n?null:(0,Z.jsx)(`div`,{className:`git-panel-section-body`,children:t.map(({change:e,type:t})=>(0,Z.jsx)(Ob,{change:e,type:t,mobile:r,workspaceId:a,selected:i===e.path,onViewDiff:d,onRunMutation:c,onRequestDiscard:s},`${t}:${e.path}`))})]})},Ob=({change:e,type:t,mobile:n,workspaceId:r,selected:i,onViewDiff:a,onRunMutation:o,onRequestDiscard:s})=>{let c=X(),l=(0,B.useMemo)(()=>e.path.split(`/`),[e.path]),u=l[l.length-1]??e.path,d=l.length>1?`${l.slice(0,-1).join(`/`)}/`:``,f=Mb(e,t),p=Nb(e,t),m=c(t===`staged`?`git.unstage`:`git.stage`),h=c(`git.discard`),g=t===`staged`?(0,Z.jsx)(yf,{size:12}):(0,Z.jsx)(Ef,{size:12}),_=async()=>{if(t===`staged`){await o(`git.unstage`,{workspaceId:r,paths:[e.path]},`Failed to unstage:`,c(`git.unstage_failed_title`));return}await o(`git.stage`,{workspaceId:r,paths:[e.path]},`Failed to stage:`,c(`git.stage_failed_title`))};return(0,Z.jsxs)(`div`,{className:`git-row ${i?`active`:``} ${n?`mobile`:``}`,onClick:()=>void a(e,t),role:`button`,tabIndex:0,onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),a(e,t))},children:[(0,Z.jsx)(`span`,{className:`git-row-status-badge git-row-status-badge-${p}`,children:f}),(0,Z.jsxs)(`div`,{className:`git-row-content`,children:[(0,Z.jsx)(`span`,{className:`git-row-name`,children:u}),(0,Z.jsxs)(`span`,{className:`git-row-meta`,children:[d?(0,Z.jsx)(`span`,{className:`git-row-dir`,children:d}):null,e.oldPath?(0,Z.jsx)(`span`,{className:`git-row-rename`,children:e.oldPath}):null]})]}),(0,Z.jsxs)(`div`,{className:`git-row-actions`,children:[(0,Z.jsx)($,{content:m,children:(0,Z.jsx)(Q,{"aria-label":m,className:`git-row-action`,icon:g,onClick:e=>{e.stopPropagation(),_()},size:`sm`,type:`button`,variant:`ghost`})}),(0,Z.jsx)($,{content:h,children:(0,Z.jsx)(Q,{"aria-label":h,className:`git-row-action`,icon:(0,Z.jsx)(kf,{size:12}),onClick:t=>{t.stopPropagation(),s(e.path)},size:`sm`,type:`button`,variant:`ghost`})})]})]})};function kb({entry:e,isCurrent:t,locale:n,onOpen:r}){return(0,Z.jsxs)(`button`,{type:`button`,className:`git-history-row ${t?`current`:``}`,onClick:()=>void r(e),children:[(0,Z.jsx)(`span`,{className:`git-history-row__dot`,"aria-hidden":`true`}),(0,Z.jsxs)(`div`,{className:`git-history-row__copy`,children:[(0,Z.jsx)($,{content:e.subject,children:(0,Z.jsx)(`span`,{className:`git-history-row__title`,children:e.subject})}),(0,Z.jsxs)(`span`,{className:`git-history-row__meta`,children:[e.shortSha,` · `,e.authorName]})]}),(0,Z.jsx)(`span`,{className:`git-history-row__when`,children:Xf(e.authoredAt,n)})]})}var Ab=({discard:e,onCancel:t,onConfirm:n})=>{let r=X();return e?(0,Z.jsx)(Np,{open:!0,onOpenChange:t,title:e.scope===`all`?r(`git.discard_all_confirm_title`):r(`git.discard_file_confirm_title`),description:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{children:e.scope===`all`?r(`git.discard_all_confirm_message`,{count:e.paths.length}):r(`git.discard_file_confirm_message`,{path:e.filePath??e.paths[0]??``})}),(0,Z.jsx)(`p`,{className:`dialog-helper`,children:r(`git.discard_confirm_irreversible`)})]}),cancelText:r(`action.cancel`),closeLabel:r(`action.close`),confirmText:r(`git.discard`),onConfirm:()=>{n()},tone:`danger`}):null};function jb(e,t){return e.status?e.status:t===`deleted`?`deleted`:t===`untracked`?`untracked`:`modified`}function Mb(e,t){switch(jb(e,t)){case`added`:return`A`;case`deleted`:return`D`;case`renamed`:return`R`;case`untracked`:return`?`;default:return`M`}}function Nb(e,t){return jb(e,t)}var Pb={minHeight:`auto`,padding:`var(--sp-8)`,gap:0},Fb={margin:0,color:`var(--text-tertiary)`,fontWeight:`var(--font-normal)`};function Ib({title:e}){return(0,Z.jsx)(Ip,{className:`branch-quick-pick-empty`,style:Pb,title:(0,Z.jsx)(`p`,{style:Fb,children:e})})}function Lb(){let{branchList:e,displayItems:t,handleBranchCreate:n,handleBranchSelect:r,handleClose:i,handleRequestBranchCreate:a,inputValue:o,selectedIndex:s,setInputValue:c,setPendingCreateBranchName:l,setSelectedIndex:u,trimmedInput:d}=Ny(),f=(0,B.useRef)(null),p=(0,B.useRef)(null);return(0,B.useEffect)(()=>{let e=window.setTimeout(()=>{f.current?.focus()},0);return()=>{window.clearTimeout(e)}},[]),(0,B.useEffect)(()=>{p.current&&p.current.querySelector(`.branch-quick-pick-item:nth-child(${s+1})`)?.scrollIntoView({block:`nearest`})},[s]),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`branch-quick-pick-search`,children:(0,Z.jsx)(`input`,{ref:f,type:`text`,className:`branch-quick-pick-input`,placeholder:`Search branches or create new branch...`,value:o,onChange:e=>{c(e.target.value),l(null),u(0)},onKeyDown:e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),u(e=>e<t.length-1?e+1:e);break;case`ArrowUp`:e.preventDefault(),u(e=>e>0?e-1:e);break;case`Enter`:if(e.preventDefault(),t[s]){let e=t[s];e.type===`branch`&&e.branch?r(e.branch.name):e.type===`create`?a(d):e.type===`confirm-create`&&n(d)}break;case`Escape`:e.preventDefault(),i();break}}})}),(0,Z.jsx)(`div`,{className:`branch-quick-pick-list`,ref:p,children:e.loading?(0,Z.jsx)(Ib,{title:`Loading branches...`}):t.length>0?t.map((e,t)=>(0,Z.jsx)(`div`,{className:`branch-quick-pick-item ${t===s?`branch-quick-pick-item-selected`:``}`,onClick:()=>{e.type===`branch`&&e.branch?r(e.branch.name):e.type===`create`?a(d):e.type===`confirm-create`&&n(d)},onMouseEnter:()=>u(t),children:e.type===`branch`&&e.branch?(0,Z.jsxs)(Z.Fragment,{children:[e.branch.isCurrent&&(0,Z.jsx)(`span`,{className:`branch-quick-pick-check`,children:(0,Z.jsx)(Vd,{size:14})}),(0,Z.jsx)(`span`,{className:`branch-quick-pick-name`,children:e.branch.name}),e.branch.isRemote&&(0,Z.jsx)(Vm,{color:`neutral`,caps:!1,className:`branch-quick-pick-badge`,children:`Remote`})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`branch-quick-pick-create-icon`,children:(0,Z.jsx)(Ef,{size:14})}),(0,Z.jsx)(`span`,{className:`branch-quick-pick-create-label`,children:e.label})]})},e.type===`branch`?e.branch?.name:`create`)):(0,Z.jsx)(Ib,{title:o?`No branches found`:`Type to search branches`})}),(0,Z.jsxs)(`div`,{className:`branch-quick-pick-hint`,children:[(0,Z.jsx)(`span`,{children:`↑↓ Navigate`}),(0,Z.jsx)(`span`,{children:`↵ Select`}),(0,Z.jsx)(`span`,{children:`Esc Close`})]})]})}function Rb({children:e,workspaceId:t,onOpenBranchSwitcher:n}){let r=Fr(),i=X(),a=V(vh),o=H(vh);return r===`mobile`||!n?e:(0,Z.jsx)(em,{content:(0,Z.jsx)(Lb,{}),contentClassName:`branch-quick-pick`,forceMode:`desktop`,onOpenChange:e=>{if(e){n();return}o({visible:!1,inputValue:``})},open:a.visible&&a.workspaceId===t,title:i(`git.branch`),children:e})}function zb(){let e=Fr(),t=X(),{branchList:n,displayItems:r,handleBranchCreate:i,handleBranchSelect:a,handleClose:o,handleRequestBranchCreate:s,inputValue:c,quickPickState:l,selectedIndex:u,setInputValue:d,setPendingCreateBranchName:f,setSelectedIndex:p,trimmedInput:m}=Ny(),h=e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),p(e=>e<r.length-1?e+1:e);break;case`ArrowUp`:e.preventDefault(),p(e=>e>0?e-1:e);break;case`Enter`:if(e.preventDefault(),r[u]){let e=r[u];e.type===`branch`&&e.branch?a(e.branch.name):e.type===`create`?s(m):e.type===`confirm-create`&&i(m)}break;case`Escape`:e.preventDefault(),o();break}};if(!l.visible||e!==`mobile`)return null;let g=r[u]??null,_=g?.type===`branch`&&g.branch?g.branch.name:null,v=r.some(e=>e.type===`branch`&&e.branch?.name.toLowerCase()===m.toLowerCase()),y=r.filter(e=>e.type===`branch`&&e.branch).map(e=>({id:e.branch.name,label:e.branch.name,badge:e.branch.isRemote?t(`git.branch_remote`):void 0})),b=r.find(e=>e.type===`create`||e.type===`confirm-create`);return(0,Z.jsx)(`div`,{onKeyDown:h,children:(0,Z.jsx)(ym,{title:t(`git.branch`),searchable:!0,searchPlaceholder:t(`git.quick_pick.search_placeholder`),searchValue:c,onSearchValueChange:e=>{d(e),f(null),p(0)},sections:[{kind:`options`,id:`branches`,items:y}],selectedId:_,loading:n.loading,loadingText:t(`git.quick_pick.loading`),emptyText:t(c?`git.quick_pick.empty_filtered`:`git.quick_pick.empty_idle`),create:{visible:!!m&&!v,label:()=>b?.label??t(`git.quick_pick.create`,{name:m}),onCreate:async()=>{if(b?.type===`confirm-create`){await i(m);return}s(m),p(r.length-1)}},onClose:o,onSelect:a})})}var Bb=({workspaceId:e,gitState:t,inline:n=!1,onRefresh:r})=>{let i=X(),a=V(Hr),o=V(xh(e)),{authPrompt:s,clearAuthPrompt:c,getAuthPromptMessage:l,handleFetch:u,handlePull:d,handlePush:f,syncingIntent:p}=Oy(e),m=`git-auth-form-${e}`,[h,g]=(0,B.useState)(null),[_,v]=(0,B.useState)({username:``,password:``});if((0,B.useLayoutEffect)(()=>{if(!s){v({username:``,password:``});return}v(e=>({username:e.username||s.details.usernameHint||``,password:``}))},[s]),!t)return null;let y=t.staged.length+t.modified.length+t.untracked.length+t.deleted.length,b=t.ahead,x=t.behind,S=o.status===`fetching`,C=o.lastFetchAt?i(`git.fetch_last_at`,{when:Zf(o.lastFetchAt,a)}):i(`git.fetch_last_never`),w=i(S?`git.fetch_in_progress`:`git.fetch_label`),T=h?.intent===`push`?i(`git.push_confirm_title`):i(`git.pull_confirm_title`),E=h?.intent===`push`?i(`git.push_confirm_message`,{count:h.count}):i(`git.pull_confirm_message`,{count:h?.count??0}),D=h?.intent===`push`?i(`action.push`):i(`action.pull`),O=h?.intent===`push`?i(`git.push_in_progress`):i(`git.pull_in_progress`),k=!!(h&&p===h.intent),A=s?.intent,j=A??h?.intent??`pull`,M=i(A===`push`?`action.push`:A===`pull`?`action.pull`:`git.fetch_label`),N=i(A===`push`?`git.push_in_progress`:A===`pull`?`git.pull_in_progress`:`git.fetch_in_progress`),P=!!(A&&p===A),F=k||P,ee=!!(h&&!s),te=!!s,ne=(e,t)=>{t<=0||g({intent:e,count:t})},I=()=>{F||(g(null),c())},L=e=>{e||I()},R=async()=>{if(h){if(h.intent===`push`){await f()&&g(null);return}await d()&&g(null)}},re=async()=>{if(!s)return;let e={username:_.username.trim(),password:_.password};!e.username||!e.password||(s.intent===`push`?await f(e):s.intent===`pull`?await d(e):await u(e))&&(c(),g(null),r?.())},ie=async()=>{await u()&&r?.()};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`git-status-bar${n?` git-status-bar--inline`:``}`,children:[(0,Z.jsx)($,{content:i(`git.statusbar.changes`),children:(0,Z.jsxs)(`span`,{className:`git-status-bar__item`,children:[(0,Z.jsx)(Zd,{size:13,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`git-status-bar__value`,children:y})]})}),(0,Z.jsx)($,{content:i(`git.statusbar.ahead`),children:(0,Z.jsxs)(`button`,{className:`git-status-bar__item git-status-bar__item--actionable git-status-bar__item--ahead`,type:`button`,"aria-label":i(`action.push`),disabled:b<=0,onClick:()=>ne(`push`,b),children:[(0,Z.jsx)(Rd,{size:13,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`git-status-bar__value`,children:b})]})}),(0,Z.jsx)($,{content:i(`git.statusbar.behind`),children:(0,Z.jsxs)(`button`,{className:`git-status-bar__item git-status-bar__item--actionable git-status-bar__item--behind`,type:`button`,"aria-label":i(`action.pull`),disabled:x<=0,onClick:()=>ne(`pull`,x),children:[(0,Z.jsx)(Fd,{size:13,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`git-status-bar__value`,children:x})]})}),(0,Z.jsx)($,{content:C,children:(0,Z.jsx)(Q,{"aria-label":w,className:`git-status-bar__item git-status-bar__item--actionable`,disabled:S,icon:(0,Z.jsx)(Of,{size:13,"aria-hidden":`true`,className:S?`spin`:void 0}),onClick:()=>void ie(),size:`sm`})})]}),ee?(0,Z.jsx)(Np,{className:`git-status-bar__confirm`,dismissible:!F,closeDisabled:F,open:!0,onOpenChange:L,title:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Vf,{size:16}),(0,Z.jsx)(`span`,{children:T})]}),description:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{children:E}),(0,Z.jsx)(`p`,{className:`dialog-helper`,children:i(`git.sync_confirm_helper`)})]}),cancelDisabled:F,cancelText:i(`action.cancel`),closeLabel:i(`action.close`),confirmText:k?O:D,confirmDisabled:k,onConfirm:()=>{R()}}):null,te?(0,Z.jsxs)(Ep,{className:`git-status-bar__confirm`,dismissible:!F,open:!0,onOpenChange:L,children:[(0,Z.jsxs)(Dp,{children:[(0,Z.jsxs)(Op,{children:[(0,Z.jsx)(Vf,{size:16}),(0,Z.jsx)(`span`,{children:i(j===`push`?`git.push_confirm_title`:j===`pull`?`git.pull_confirm_title`:`git.fetch_label`)})]}),(0,Z.jsx)(Q,{"aria-label":i(`action.close`),disabled:F,icon:(0,Z.jsx)(Hf,{size:14}),onClick:I,size:`sm`})]}),(0,Z.jsx)(kp,{children:s.details.canPrompt?(0,Z.jsxs)(`form`,{id:m,className:`form-group`,onSubmit:e=>{e.preventDefault(),re()},children:[(0,Z.jsx)(`p`,{children:l(s.details)}),(0,Z.jsx)(`span`,{className:`dialog-helper`,children:i(`git.auth_helper_http`)}),(0,Z.jsx)(`label`,{htmlFor:`git-auth-username-${e}`,children:i(`git.auth_username`)}),(0,Z.jsx)(Bp,{id:`git-auth-username-${e}`,value:_.username,onChange:e=>v(t=>({...t,username:e.target.value})),placeholder:s.details.usernameHint??i(`git.auth_username_placeholder`),autoFocus:!0,disabled:P}),(0,Z.jsx)(`label`,{htmlFor:`git-auth-password-${e}`,children:i(`git.auth_password`)}),(0,Z.jsx)(Bp,{id:`git-auth-password-${e}`,type:`password`,value:_.password,onChange:e=>v(t=>({...t,password:e.target.value})),placeholder:i(`git.auth_password_placeholder`),disabled:P})]}):(0,Z.jsxs)(`div`,{className:`form-group`,children:[(0,Z.jsx)(`p`,{children:l(s.details)}),(0,Z.jsx)(`span`,{className:`dialog-helper`,children:i(`git.auth_helper_unsupported`)})]})}),(0,Z.jsxs)(Ap,{children:[(0,Z.jsx)(gp,{onClick:I,disabled:F,children:i(`action.cancel`)}),(0,Z.jsx)(gp,{variant:`primary`,form:s.details.canPrompt?m:void 0,type:s.details.canPrompt?`submit`:`button`,disabled:!s.details.canPrompt||P||!_.username.trim()||!_.password,children:P?N:M})]})]}):null]})};function Vb({"aria-controls":e,"aria-expanded":t,"aria-haspopup":n,ariaLabel:r,branchName:i,branchSummary:a,disabled:o,onClick:s,onKeyDown:c}){return(0,Z.jsx)($,{content:i,children:(0,Z.jsxs)(`button`,{type:`button`,className:`git-panel-status-strip__branch`,onClick:s,onKeyDown:c,"aria-controls":e,"aria-expanded":t,"aria-haspopup":n,"aria-label":r,disabled:o,children:[(0,Z.jsx)(uf,{size:11}),(0,Z.jsx)(`span`,{className:`git-panel-status-strip__branch-text`,children:i})]})})}function Hb({workspaceId:e,gitState:t,onOpenBranchSwitcher:n,align:r=`end`}){let i=X(),a=Fr(),o=t?.branch?.trim()||i(`git.no_branch`),s=t&&(t.ahead>0||t.behind>0)?[t.ahead>0?`↑${t.ahead}`:null,t.behind>0?`↓${t.behind}`:null].filter(Boolean).join(` `):null,c=(0,Z.jsx)(Vb,{ariaLabel:`${i(`git.current_branch`)}: ${o}`,branchName:o,branchSummary:s,disabled:!n,onClick:a===`mobile`?n:void 0});return(0,Z.jsxs)(`div`,{className:`git-panel-status-strip git-panel-status-strip--${r}`,children:[a===`desktop`&&n?(0,Z.jsx)(Rb,{workspaceId:e,onOpenBranchSwitcher:n,children:c}):c,(0,Z.jsx)(`div`,{className:`git-panel-status-strip__meta`,children:(0,Z.jsx)(Bb,{workspaceId:e,gitState:t,inline:!0})})]})}function Ub({workspaceId:e,gitState:t,onOpenBranchSwitcher:n,flush:r=!1,align:i=`end`}){return(0,Z.jsx)(`div`,{className:`workspace-status-bar${r?` workspace-status-bar--flush`:``}`,children:(0,Z.jsx)(Hb,{align:i,workspaceId:e,gitState:t,onOpenBranchSwitcher:n})})}var Wb=()=>{let e=(0,B.useRef)(null),t=zy(e),[n,r]=(0,B.useState)(0),i=X(),{createRequest:a,focusMode:o,gitState:s,handleBottomMouseDown:c,handleConsumeCreateRequest:l,handleLeftMouseDown:u,handleOpenBranchSwitcher:d,handleOpenFileCreate:f,handleOpenFolderCreate:p,leftPanelWidth:m,leftPanelRef:h,mainAreaMode:g,setSidebarTab:_,sidebarCollapsed:v,sidebarTab:y,terminalPanelVisible:b,workspace:x,bottomPanelHeight:S,bottomPanelRef:C,workspaceId:w}=Wy(),T=H(fh(w)),E=H(Th),{closePreview:D}=My(w);return(0,B.useEffect)(()=>{let e=e=>{if(e.metaKey||e.ctrlKey){if(e.key.toLowerCase()===`b`){e.preventDefault(),E(e=>!e);return}if(e.key===`1`){e.preventDefault(),_(`files`);return}e.key===`2`&&(e.preventDefault(),_(`git`))}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[E,_]),x?(0,Z.jsxs)(`div`,{ref:e,className:`workspace-page`,children:[(0,Z.jsx)(Cy,{fullscreenController:t}),(0,Z.jsxs)(`div`,{className:`workspace-body`,children:[!o&&!v&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`aside`,{ref:h,className:`left-panel`,style:{width:`${m}px`},children:(0,Z.jsxs)(`div`,{className:`nav-panel workspace-sidebar-panel`,children:[(0,Z.jsxs)(`div`,{className:`workspace-sidebar-panel__header`,children:[(0,Z.jsx)(cm,{"aria-label":`Workspace sections`,onValueChange:_,value:y,children:(0,Z.jsxs)(lm,{className:`workspace-sidebar-panel__tabs`,children:[(0,Z.jsx)(um,{className:`workspace-sidebar-panel__tab`,value:`files`,children:(0,Z.jsx)(`span`,{children:i(`file.title`)})}),(0,Z.jsx)(um,{className:`workspace-sidebar-panel__tab`,value:`git`,children:(0,Z.jsx)(`span`,{children:i(`label.git`)})})]})}),(0,Z.jsx)(`div`,{className:`workspace-sidebar-panel__actions`,children:y===`files`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{content:i(`file.new_file`),children:(0,Z.jsx)(Q,{className:`panel-toolbar-btn`,"aria-label":i(`file.new_file`),icon:(0,Z.jsx)(rf,{size:14}),onClick:f,size:`sm`})}),(0,Z.jsx)($,{content:i(`file.new_folder`),children:(0,Z.jsx)(Q,{className:`panel-toolbar-btn`,"aria-label":i(`file.new_folder`),icon:(0,Z.jsx)(cf,{size:14}),onClick:p,size:`sm`})}),(0,Z.jsx)($,{content:i(`file.collapse_all`),children:(0,Z.jsx)(Q,{className:`panel-toolbar-btn`,"aria-label":i(`file.collapse_all`),icon:(0,Z.jsx)(Gd,{size:14}),onClick:()=>r(e=>e+1),size:`sm`})})]}):null})]}),(0,Z.jsx)(`div`,{className:`workspace-sidebar-panel__body`,children:y===`files`?(0,Z.jsx)(Qy,{workspaceId:x.id,createRequest:a,onCreateRequestConsumed:l,collapseVersion:n,variant:`desktop`}):(0,Z.jsx)(Eb,{workspaceId:x.id,variant:`desktop`})})]})}),(0,Z.jsx)(`div`,{className:`split-divider-v`,onMouseDown:u,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize left panel`})]}),(0,Z.jsxs)(`div`,{className:`workspace-main-area`,children:[g===`diff`?(0,Z.jsx)(lb,{workspaceId:x.id,onClose:()=>{D(),T(null)}}):g===`editor`?(0,Z.jsx)(iy,{}):(0,Z.jsx)(`div`,{className:`agent-panes`,children:(0,Z.jsx)(Xv,{hydrateSessions:!1})}),!o&&b&&(0,Z.jsx)(`div`,{className:`split-divider-h`,onMouseDown:c,role:`separator`,"aria-orientation":`horizontal`,"aria-label":`Resize bottom panel`}),!o&&b&&(0,Z.jsx)(`div`,{ref:C,className:`workspace-bottom-panel`,style:{height:`${S}px`},children:(0,Z.jsx)(my,{})})]})]}),(0,Z.jsx)(Ub,{align:`start`,workspaceId:x.id,gitState:s,onOpenBranchSwitcher:d})]}):(0,Z.jsx)(`div`,{className:`workspace-page workspace-page-empty`,children:(0,Z.jsx)(`div`,{className:`workspace-empty-content`,children:(0,Z.jsx)(`div`,{className:`workspace-empty-inner`,children:(0,Z.jsx)(Ip,{style:{minHeight:`auto`,padding:0},title:(0,Z.jsx)(`p`,{children:i(`workspace.no_workspace`)})})})})})},Gb={minHeight:`auto`,padding:0,gap:0,alignItems:`stretch`,justifyContent:`flex-start`,textAlign:`left`};function Kb({title:e,description:t,testId:n}){return(0,Z.jsx)(`div`,{className:`workspace-resolving-shell`,"data-testid":n,children:(0,Z.jsx)(`div`,{className:`workspace-resolving-card`,children:(0,Z.jsx)(Ip,{style:Gb,title:(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`workspace-resolving-kicker`,children:X()(`workspace.title`)}),(0,Z.jsx)(`div`,{className:`workspace-resolving-title`,children:e})]}),description:(0,Z.jsx)(`div`,{className:`workspace-resolving-desc`,children:t})})})})}function qb({title:e,description:t}){let n=X();return(0,Z.jsx)(Kb,{title:e??n(`workspace.load_failed_title`),description:t??n(`workspace.load_failed_description`)})}function Jb(){let e=X();return(0,Z.jsx)(Kb,{testId:`workspace-resolving-shell`,title:e(`workspace.loading_title`),description:e(`workspace.loading_description`)})}function Yb({children:e}){let t=V(fd),n=V(od),r=V(sd);return!t&&n===`error`?(0,Z.jsx)(qb,{description:r??`Failed to fetch workspace list`}):!t&&(n===`idle`||n===`loading`)?(0,Z.jsx)(Jb,{}):(0,Z.jsx)(Z.Fragment,{children:e})}function Xb(){let e=(0,B.useRef)(0),t=Jt(),n=Gt(),r=V(qu),i=V(ed),a=V(ud),o=V(Ur),s=V($u),c=V(od),l=H(id),u=H(ad),d=H(od),f=H(sd);(0,B.useEffect)(()=>{if(s===null)return;let p=s===!0;if(p&&!o){if(n.pathname!==`/login`){t(`/login`,{replace:!0});return}return}if(n.pathname===`/login`&&(!p||o)){t(`/`,{replace:!0});return}if(!(n.pathname!==`/`&&n.pathname!==`/workspace`)){if(c===`idle`){if(r!==`connected`)return;let t=e.current+1;e.current=t,d(`loading`),f(null),i(`workspace.list`,{}).then(n=>{if(e.current!==t)return;if(!n.ok){d(`error`),f(n.error?.message??`Failed to fetch workspace list`);return}let r=Array.isArray(n.data)?n.data:[],i={};for(let e of r)i[e.id]=e;l(i),u(r.map(e=>e.id)),d(`ready`),f(null)}).catch(n=>{e.current===t&&(d(`error`),f(n instanceof Error?n.message:`Failed to fetch workspace list`))});return}if(c===`ready`){if(n.pathname===`/`&&a.length>0){t(`/workspace`,{replace:!0});return}n.pathname===`/workspace`&&a.length===0&&t(`/`,{replace:!0})}}},[s,o,r,i,n.pathname,t,u,l,f,d,a.length,c])}function Zb(){let e=V(qu);return e===`connected`||e===`connecting`?null:e===`reconnecting`?(0,Z.jsx)(`div`,{className:`connection-banner`,role:`status`,"aria-live":`polite`,children:(0,Z.jsx)(`span`,{children:`正在重新连接...`})}):(0,Z.jsx)(`div`,{className:`connection-banner connection-banner--error`,role:`status`,"aria-live":`polite`,children:(0,Z.jsx)(`span`,{children:e===`rejected`?`另一个标签页已激活`:`连接已断开`})})}var Qb={minHeight:`auto`,padding:0,gap:`var(--sp-3)`,alignItems:`stretch`,justifyContent:`flex-start`,textAlign:`left`};function $b(){Xb();let e=V(Ur),t=V($u),n=Gt(),r=t===!0,i=t===null;return!(r&&!e&&n.pathname===`/login`)&&!i&&n.pathname.startsWith(`/settings`),(0,Z.jsxs)(`div`,{className:`app`,children:[(0,Z.jsx)(Zb,{}),(0,Z.jsx)(`main`,{className:`main-content`,children:i?(0,Z.jsx)(`div`,{className:`app-loading-shell`,children:(0,Z.jsx)(`div`,{className:`app-loading-card`,children:(0,Z.jsx)(Ip,{style:Qb,title:(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`app-loading-kicker`,children:`CODER STUDIO`}),(0,Z.jsx)(`h1`,{className:`app-loading-title`,children:`正在连接工作区...`})]}),description:(0,Z.jsx)(`p`,{className:`app-loading-desc`,children:`正在同步认证与连接状态,随后会自动进入当前 workspace。`})})})}):(0,Z.jsxs)(Sn,{children:[(0,Z.jsx)(bn,{path:`/`,element:(0,Z.jsx)(Ig,{})}),(0,Z.jsx)(bn,{path:`/login`,element:(0,Z.jsx)(nh,{})}),(0,Z.jsx)(bn,{path:`/workspace`,element:(0,Z.jsx)(Yb,{children:(0,Z.jsx)(Wb,{})})}),(0,Z.jsx)(bn,{path:`/settings`,element:(0,Z.jsx)(Ag,{})}),(0,Z.jsx)(bn,{path:`*`,element:(0,Z.jsx)(zh,{})})]})}),(0,Z.jsx)(Ih,{}),(0,Z.jsx)(qh,{})]})}function ex({sessionId:e,onOpen:t}){let n=V(C_),r=V(w_),i=X(),a=(0,B.useMemo)(()=>{if(!e)return null;let t=n.get(e);if(!t)return{state:`inactive`,label:i(`supervisor.title`)};let a=r.get(t.id)??t.cycles??[],o=[...a].sort((e,t)=>(t.completedAt??t.createdAt)-(e.completedAt??e.createdAt))[0];return{state:t.state,label:o?.result??o?.errorReason??(a.length>0?`cycle ${a.length}`:t.objective)}},[r,e,n,i]);return a?(0,Z.jsxs)(`button`,{type:`button`,className:`mobile-supervisor-badge mobile-supervisor-badge--${a.state}`,"aria-label":i(`mobile.supervisor.open_sheet`),onClick:t,children:[(0,Z.jsx)(`span`,{className:`mobile-supervisor-badge__icon`,"aria-hidden":`true`,children:(0,Z.jsx)($d,{size:13})}),(0,Z.jsx)(`span`,{className:`mobile-supervisor-badge__label`,children:a.label})]}):null}var tx={minHeight:0,padding:`var(--sp-4)`,gap:`var(--sp-2)`,alignItems:`stretch`,textAlign:`left`},nx={width:`auto`,maxWidth:`none`,color:`inherit`,fontSize:`inherit`,fontWeight:`inherit`,lineHeight:`inherit`};function rx({sessionId:e,workspaceId:t,onClose:n}){let r=X(),[i,a]=(0,B.useState)(null),o=H(E_),{dialog:s,supervisor:c,mode:l,copy:u,isDisable:d,disableObjective:f,close:p,updateDraft:m,confirm:h}=j_({workspaceId:t,sessionId:e});(0,B.useEffect)(()=>{if(!s.open||s.sessionId!==e){a(null);return}a(s.mode)},[s.mode,s.open,s.sessionId,e]);let g=t=>{o({open:!0,sessionId:e,mode:t,draftObjective:c?.objective??``,draftEvaluatorProviderId:c?.evaluatorProviderId??`claude`}),a(t)};return i?(0,Z.jsx)(ep,{title:u.title,kicker:r(`supervisor.title`),onBack:()=>{p(),a(null)},onClose:()=>{p(),a(null),n()},bodyClassName:`mobile-sheet__body--supervisor-detail`,contentClassName:`mobile-supervisor-sheet mobile-supervisor-sheet--detail`,body:(0,Z.jsxs)(`div`,{className:`mobile-supervisor-sheet__detail`,children:[(0,Z.jsxs)(`div`,{className:`mobile-supervisor-sheet__detail-header`,children:[(0,Z.jsx)(`span`,{className:`supervisor-dialog-header-icon`,"aria-hidden":`true`,children:(0,Z.jsx)(N_,{mode:l})}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h3`,{children:u.title}),(0,Z.jsx)(`p`,{children:u.subtitle})]})]}),(0,Z.jsx)(P_,{mode:l,draftObjective:s.draftObjective,draftEvaluatorProviderId:s.draftEvaluatorProviderId,disableObjective:f,onDraftObjectiveChange:e=>m({draftObjective:e}),onDraftEvaluatorProviderChange:e=>m({draftEvaluatorProviderId:e})})]}),footer:(0,Z.jsxs)(`div`,{className:`mobile-supervisor-sheet__footer`,children:[(0,Z.jsx)(gp,{onClick:()=>{p(),a(null)},children:r(`action.cancel`)}),(0,Z.jsx)(gp,{variant:d?`danger`:`primary`,onClick:()=>{h()},disabled:!d&&!s.draftObjective.trim(),children:u.confirm})]})}):(0,Z.jsx)(ep,{title:r(`supervisor.title`),kicker:r(`supervisor.title`),onClose:n,contentClassName:`mobile-supervisor-sheet mobile-supervisor-sheet--root`,body:(0,Z.jsx)(`div`,{className:`mobile-supervisor-sheet__root`,children:c?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(R_,{sessionId:e,workspaceId:t}),(0,Z.jsxs)(`div`,{className:`mobile-supervisor-sheet__actions`,children:[(0,Z.jsx)(gp,{onClick:()=>g(`edit`),children:r(`supervisor.action.edit_objective`)}),(0,Z.jsx)(gp,{onClick:()=>g(`disable`),children:r(`supervisor.action.disable`)})]})]}):(0,Z.jsx)(Ip,{className:`mobile-supervisor-sheet__empty`,style:tx,title:(0,Z.jsx)(`div`,{style:nx,children:(0,Z.jsx)(`h3`,{children:r(`supervisor.title`)})}),description:(0,Z.jsx)(`div`,{style:nx,children:(0,Z.jsx)(`p`,{children:r(`supervisor.empty`)})}),action:(0,Z.jsx)(`div`,{style:{width:`100%`},children:(0,Z.jsx)(gp,{variant:`primary`,onClick:()=>g(`enable`),children:r(`supervisor.action.enable_objective`)})})})})})}var ix=`(orientation: landscape)`,ax=`(max-height: 540px)`;function ox(){if(typeof window>`u`||typeof window.matchMedia!=`function`)return`default`;let e=window.matchMedia(ix).matches,t=window.matchMedia(ax).matches;return e&&t?`landscape-compact`:`default`}function sx(){let[e,t]=(0,B.useState)(ox);return(0,B.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(ix),n=window.matchMedia(ax),r=()=>{t(ox())};return e.addEventListener(`change`,r),n.addEventListener(`change`,r),r(),()=>{e.removeEventListener(`change`,r),n.removeEventListener(`change`,r)}},[]),e}var cx=`(prefers-reduced-motion: reduce)`;function lx(){return typeof window>`u`||typeof window.matchMedia!=`function`?`default`:window.matchMedia(cx).matches?`reduced`:`default`}function ux(){let[e,t]=(0,B.useState)(lx);return(0,B.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(cx),n=()=>{t(e.matches?`reduced`:`default`)};return e.addEventListener(`change`,n),n(),()=>{e.removeEventListener(`change`,n)}},[]),e}function dx(){let[e,t]=(0,B.useState)(0);return(0,B.useEffect)(()=>{let e=window.visualViewport;if(!e){t(0);return}let n=()=>{let n=Math.max(window.innerHeight-e.height-e.offsetTop,0);t(Math.round(n))};return n(),e.addEventListener(`resize`,n),e.addEventListener(`scroll`,n),()=>{e.removeEventListener(`resize`,n),e.removeEventListener(`scroll`,n)}},[]),e}function fx(e){if(e.title?.trim())return e.title.trim();if(e.providerId)return e.providerId.replace(/\b\w/g,e=>e.toUpperCase());let t=e.id.match(/(\d+)/)?.[1];return t?`SESSION-${t.slice(-2).padStart(2,`0`)}`:e.id.replace(/[_-]/g,` `).toUpperCase()}function px({activeSessionId:e,activeWorkspaceId:t,defaultMode:n=`list`,sessions:r,onClose:i,onCloseSession:a,onSelectSession:o,onSessionCreated:s}){let c=V(ed),l=H(pd),u=X(),[d,f]=(0,B.useState)(n===`create`?`providers`:`sessions`),p=r.find(t=>t.id===e)??r[0]??null,m=!!t,h=[{id:`claude`,title:`Claude`,icon:(0,Z.jsx)(Pf,{size:16})},{id:`codex`,title:`Codex`,icon:(0,Z.jsx)(Bd,{size:16})}],g=()=>{f(n===`create`?`providers`:`sessions`),i()},{states:_,launch:v}=b_(c,t??`__workspace_placeholder__`,(e,t)=>{l(t=>({...t,[e.id]:e})),s(e.id),g()}),y=[{kind:`actions`,id:`agent-actions`,items:[{id:`create`,label:u(`action.create_session`),icon:(0,Z.jsx)(Ef,{size:16}),onAction:()=>f(`providers`),disabled:!m}]},{kind:`options`,id:`sessions`,items:r.length>0?r.map(e=>({id:e.id,label:fx(e),description:u(`mobile.agent.switch_to_agent`,{name:fx(e)}),meta:e.providerId.toUpperCase(),trailingAction:{id:`${e.id}-close`,ariaLabel:u(`mobile.agent.close_current_session`),icon:(0,Z.jsx)(Hf,{size:16}),tone:`danger`,onAction:async()=>{await a(e.id),g()}}})):[]}],b=[{kind:`options`,id:`providers`,items:h.map(e=>{let t=_[e.id],n=t.loading||t.installJob?.status===`queued`||t.installJob?.status===`running`;return{id:e.id,label:e.title,description:u(`mobile.agent.start_session`,{provider:e.title}),meta:u(n?`mobile.agent.starting`:`mobile.agent.start_new_session`),icon:e.icon,disabled:!m||n}})}];return(0,Z.jsx)(ym,{title:u(d===`sessions`?`mobile.agent.title`:`session.provider_select`),sections:d===`sessions`?y:b,selectedId:d===`sessions`?p?.id??null:null,emptyText:d===`sessions`?u(`mobile.agent.empty`):void 0,closeOnSelect:!1,onBack:d===`providers`?()=>f(`sessions`):void 0,onClose:g,onSelect:e=>{if(d===`sessions`){o(e),g();return}return v(e)}})}function mx({activeItem:e,onSelectItem:t}){let n=X();return(0,Z.jsxs)(`nav`,{className:`mobile-dock`,"aria-label":n(`mobile.dock.aria_label`),children:[(0,Z.jsxs)(`button`,{type:`button`,className:`mobile-dock__item ${e===`agent`?`mobile-dock__item--active`:``}`,onClick:()=>t(`agent`),"aria-label":n(`mobile.dock.open_agent`),children:[(0,Z.jsx)(`span`,{className:`mobile-dock__icon`,"aria-hidden":`true`,children:(0,Z.jsx)(Bd,{size:18})}),(0,Z.jsx)(`span`,{className:`mobile-dock__label`,children:n(`label.agent`)})]}),(0,Z.jsxs)(`button`,{type:`button`,className:`mobile-dock__item ${e===`files`?`mobile-dock__item--active`:``}`,onClick:()=>t(`files`),"aria-label":n(`mobile.dock.open_files`),children:[(0,Z.jsx)(`span`,{className:`mobile-dock__icon`,"aria-hidden":`true`,children:(0,Z.jsx)(sf,{size:18})}),(0,Z.jsx)(`span`,{className:`mobile-dock__label`,children:n(`file.title`)})]}),(0,Z.jsxs)(`button`,{type:`button`,className:`mobile-dock__item ${e===`terminal`?`mobile-dock__item--active`:``}`,onClick:()=>t(`terminal`),"aria-label":n(`mobile.dock.open_terminal`),children:[(0,Z.jsx)(`span`,{className:`mobile-dock__icon`,"aria-hidden":`true`,children:(0,Z.jsx)(Lf,{size:18})}),(0,Z.jsx)(`span`,{className:`mobile-dock__label`,children:n(`label.terminal`)})]})]})}function hx({workspaceId:e,route:t,activeTab:n,createRequest:r=null,onCreateRequestConsumed:i,collapseVersion:a=0,onCreateFile:o,onCreateFolder:s,onCollapseAll:c,onRouteChange:l,onTabChange:u,onCloseSheet:d,editorState:f}){let p=X(),{closePreview:m}=My(e);return t.kind===`editor`?(0,Z.jsx)(`div`,{className:`mobile-files-sheet`,children:(0,Z.jsx)(`div`,{className:`mobile-files-sheet__detail`,children:(0,Z.jsx)(iy,{chrome:`content-only`,editorState:f})})}):t.kind===`diff`?(0,Z.jsx)(`div`,{className:`mobile-files-sheet`,children:(0,Z.jsx)(`div`,{className:`mobile-files-sheet__detail`,children:(0,Z.jsx)(lb,{workspaceId:e,onClose:()=>{m(),d?.()},showCloseButton:!1})})}):(0,Z.jsxs)(`div`,{className:`mobile-files-sheet mobile-files-sheet--root`,children:[(0,Z.jsxs)(`div`,{className:`mobile-files-sheet__segmented`,children:[(0,Z.jsx)(cm,{"aria-label":p(`mobile.files.tabs`),onValueChange:e=>u?.(e),value:n,children:(0,Z.jsxs)(lm,{className:`mobile-files-sheet__tabs`,children:[(0,Z.jsx)(um,{className:`mobile-files-sheet__segment`,value:`files`,children:(0,Z.jsx)(`span`,{children:p(`file.title`)})}),(0,Z.jsx)(um,{className:`mobile-files-sheet__segment`,value:`git`,children:(0,Z.jsx)(`span`,{children:p(`label.git`)})})]})}),n===`files`?(0,Z.jsxs)(`div`,{className:`mobile-files-sheet__tab-actions`,children:[(0,Z.jsx)($,{content:p(`file.new_file`),children:(0,Z.jsx)(Q,{className:`mobile-files-sheet__tab-action`,"aria-label":p(`file.new_file`),icon:(0,Z.jsx)(rf,{size:14}),onClick:o,size:`sm`})}),(0,Z.jsx)($,{content:p(`file.new_folder`),children:(0,Z.jsx)(Q,{className:`mobile-files-sheet__tab-action`,"aria-label":p(`file.new_folder`),icon:(0,Z.jsx)(cf,{size:14}),onClick:s,size:`sm`})}),(0,Z.jsx)($,{content:p(`file.collapse_all`),children:(0,Z.jsx)(Q,{className:`mobile-files-sheet__tab-action`,"aria-label":p(`file.collapse_all`),icon:(0,Z.jsx)(Gd,{size:14}),onClick:c,size:`sm`})})]}):null]}),(0,Z.jsx)(`div`,{className:`mobile-files-sheet__content`,children:n===`files`?(0,Z.jsx)(Qy,{workspaceId:e,createRequest:r,onCreateRequestConsumed:i,onSelectFile:e=>l?.({kind:`editor`,path:e}),collapseVersion:a,variant:`mobile`}):(0,Z.jsx)(Eb,{workspaceId:e,onPreviewOpen:e=>{l?.({kind:`diff`,path:e.path})},variant:`mobile`})})]})}function gx({activeWorkspace:e,drawerOpen:t,fullscreenController:n,onOpenSettings:r,onToggleDrawer:i}){let a=X(),o=H(Wr),[s,c]=(0,B.useState)(!1),l=ah(e)||a(`mobile.workspace_drawer.select_title`);return(0,Z.jsxs)(`header`,{className:`mobile-topbar`,children:[(0,Z.jsxs)(`button`,{type:`button`,className:`mobile-topbar__workspace-button`,onClick:()=>{i()},"aria-label":a(`mobile.topbar.switch_workspace`),"aria-expanded":t,children:[(0,Z.jsx)(`span`,{className:`mobile-topbar__workspace-leading`,"aria-hidden":`true`,children:(0,Z.jsx)(_f,{size:18})}),(0,Z.jsxs)(`span`,{className:`mobile-topbar__workspace-copy`,children:[(0,Z.jsx)(`span`,{className:`mobile-topbar__workspace-label`,children:a(`label.workspace`)}),(0,Z.jsx)(`span`,{className:`mobile-topbar__workspace-name`,children:l})]})]}),(0,Z.jsxs)(`div`,{className:`mobile-topbar__actions`,children:[(0,Z.jsx)(sp,{forceMode:`mobile`,items:[{id:`settings`,label:a(`settings.title`),icon:(0,Z.jsx)(Mf,{size:16}),onSelect:()=>{r()}},{id:`quick-actions`,label:a(`tooltip.quick_actions`),icon:(0,Z.jsx)(jf,{size:16}),onSelect:()=>{o(!0)}}],onOpenChange:c,open:s,title:a(`mobile.topbar.more_actions`),children:(0,Z.jsx)(Q,{"aria-label":a(`mobile.topbar.open_more_actions`),className:`mobile-topbar__icon-button`,icon:(0,Z.jsx)(Qd,{size:18})})}),(0,Z.jsx)(hy,{controller:n,className:`mobile-topbar__icon-button`,iconSize:18,dataTestId:`mobile-fullscreen-toggle`})]})]})}function _x({activeWorkspaceId:e,isOpen:t,workspaces:n,onClose:r,onOpenWorkspaceLauncher:i}){let a=Jt(),o=H(rd),s=X(),c=yy();return t?(0,Z.jsxs)(`div`,{className:`mobile-drawer-layer`,children:[(0,Z.jsx)(`button`,{type:`button`,className:`mobile-drawer-layer__backdrop`,"aria-label":s(`mobile.workspace_drawer.close`),onClick:r}),(0,Z.jsxs)(`aside`,{className:`mobile-workspace-drawer`,"aria-label":s(`mobile.workspace_drawer.aria_label`),children:[(0,Z.jsxs)(`div`,{className:`mobile-workspace-drawer__header`,children:[(0,Z.jsx)(`div`,{className:`mobile-workspace-drawer__kicker`,children:s(`label.workspace`)}),(0,Z.jsx)(`h2`,{className:`mobile-workspace-drawer__title`,children:s(`mobile.workspace_drawer.select_title`)})]}),(0,Z.jsx)(`div`,{className:`mobile-workspace-drawer__list`,children:n.map(t=>{let n=ah(t)||t.id;return(0,Z.jsxs)(`div`,{className:`mobile-workspace-drawer__item ${t.id===e?`mobile-workspace-drawer__item--active`:``}`,children:[(0,Z.jsxs)(`button`,{type:`button`,className:`mobile-workspace-drawer__item-main`,"aria-label":s(`mobile.workspace_drawer.switch_to_workspace`,{name:n}),onClick:()=>{o(t.id),a(`/workspace`),r()},children:[(0,Z.jsx)(`span`,{className:`mobile-workspace-drawer__item-name`,children:n}),(0,Z.jsx)(`span`,{className:`mobile-workspace-drawer__item-path`,children:t.path})]}),(0,Z.jsx)(Q,{"aria-label":s(`mobile.workspace_drawer.close_workspace`,{name:n}),className:`mobile-workspace-drawer__item-close`,icon:(0,Z.jsx)(Hf,{size:16}),onClick:()=>{c(t.id,{navigateHomeWhenEmpty:!0}).then(e=>{e&&r()})},size:`lg`})]},t.id)})}),(0,Z.jsx)(`div`,{className:`mobile-workspace-drawer__footer`,children:(0,Z.jsx)(`button`,{type:`button`,className:`mobile-workspace-drawer__footer-button`,onClick:()=>{i(),r()},children:s(`tooltip.new_workspace`)})})]})]}):null}function vx(){let e=(0,B.useRef)(null),t=zy(e),n=X(),r=Jt(),i=V(Gr),a=H(Kr),{activeSession:o,activeWorkspaceId:s,closeMobileSession:c,closeMobileSheet:l,handleMobileSessionCreated:u,handleOpenBranchSwitcher:d,gitState:f,mobileActiveSessionId:p,mobileFilesRoute:m,mobileSheet:h,openMobileSheet:g,orderedSessions:_,selectMobileSession:v,updateMobileFilesRoute:y,workspace:b,workspaces:x}=Wy(),[S,C]=(0,B.useState)(!1),[w,T]=(0,B.useState)(!1),[E,D]=(0,B.useState)(`files`),[O,k]=(0,B.useState)(null),[A,j]=(0,B.useState)(0),[M,N]=(0,B.useState)(!1),P=dx(),F=sx(),ee=ux(),te=Qv();(0,B.useEffect)(()=>{i&&i!==p&&_.some(e=>e.id===i)&&v(i)},[p,_,i,v]),(0,B.useEffect)(()=>(a(p),()=>{a(null)}),[p,a]);let ne=m.kind===`editor`?n(`file.title`):m.kind===`diff`?n(`label.git`):null,I=e=>{k(t=>({id:(t?.id??0)+1,mode:e,baseDir:null}))},L=m.kind===`editor`?(0,Z.jsx)(ny,{state:te,variant:`mobile`}):null,R=h===`files`?{title:m.kind===`editor`?m.path.split(`/`).pop()??n(`mobile.files.editor_fallback`):m.kind===`diff`?m.path.split(`/`).pop()??n(`worktree.diff_tab`):n(E===`files`?`file.title`:`label.git`),body:s?(0,Z.jsx)(hx,{workspaceId:s,route:m,activeTab:E,createRequest:O,onCreateRequestConsumed:()=>k(null),collapseVersion:A,onCreateFile:()=>I(`file`),onCreateFolder:()=>I(`folder`),onCollapseAll:()=>j(e=>e+1),onRouteChange:y,onTabChange:D,onCloseSheet:l,editorState:te}):null,footer:s?(0,Z.jsx)(Ub,{workspaceId:s,gitState:f,onOpenBranchSwitcher:d,flush:!0}):null,kicker:ne,onBack:m.kind===`root`?void 0:()=>y({kind:`root`}),backLabel:n(`action.back`),headerAction:L,fullscreen:!0,bodyClassName:`mobile-sheet__body--flush mobile-sheet__body--fullscreen`,contentClassName:`mobile-sheet--files`}:h===`terminal`?{title:n(`label.terminal`),body:(0,Z.jsx)(`div`,{className:`mobile-terminal-sheet mobile-terminal-sheet--fullscreen`,children:(0,Z.jsx)(my,{chrome:`mobile-fullscreen`})}),footer:s?(0,Z.jsx)(Ub,{workspaceId:s,gitState:f,onOpenBranchSwitcher:d,flush:!0}):null,kicker:null,fullscreen:!0,bodyClassName:`mobile-sheet__body--flush mobile-sheet__body--fullscreen`,contentClassName:`mobile-sheet--terminal`}:null,re=e=>{if(e===`agent`){T(e=>!e);return}T(!1),g(e)},ie=w?`agent`:h===`files`||h===`terminal`?h:null;return(0,Z.jsxs)(`div`,{ref:e,className:`mobile-shell mobile-shell--${F} mobile-shell--motion-${ee}`,"data-testid":`mobile-shell`,"data-layout-mode":F,"data-motion-mode":ee,children:[(0,Z.jsx)(gx,{activeWorkspace:b,drawerOpen:S,fullscreenController:t,onOpenSettings:()=>{T(!1),r(`/settings`)},onToggleDrawer:()=>{T(!1),C(e=>!e)}}),(0,Z.jsx)(`main`,{className:`mobile-shell__viewport`,children:(0,Z.jsx)(`div`,{className:`mobile-shell__content`,children:_.length>0?(0,Z.jsx)(Z.Fragment,{children:o?(0,Z.jsx)(`section`,{className:`mobile-shell__agent-stage`,children:(0,Z.jsx)(Lv,{sessionId:o.id,showHeaderActions:!1,showSupervisorInline:!1,headerAccessory:(0,Z.jsx)(ex,{sessionId:o.id,onOpen:()=>{T(!1),g(`supervisor`)}})})}):null}):(0,Z.jsx)(`section`,{className:`mobile-shell__agent-empty`,"data-testid":`mobile-agent-empty`,children:(0,Z.jsx)(`div`,{className:`mobile-shell__empty-content`,children:(0,Z.jsx)(Ip,{style:{minHeight:`auto`,padding:0},title:(0,Z.jsx)(`p`,{children:n(`mobile.empty.start_session`)}),description:(0,Z.jsx)(`div`,{className:`mobile-shell__placeholder-copy`,children:(0,Z.jsx)(`p`,{children:n(`mobile.empty.files_terminal_hint`)})}),action:(0,Z.jsx)(`button`,{type:`button`,className:`mobile-shell__empty-cta`,onClick:()=>T(!0),children:n(`action.create_session`)})})})})})}),(0,Z.jsxs)(`div`,{className:`mobile-shell__bottom-stack`,"data-testid":`mobile-bottom-stack`,style:{"--mobile-keyboard-inset":`${P}px`},children:[(0,Z.jsx)(`div`,{className:`mobile-dock-shell`,children:(0,Z.jsx)(mx,{activeItem:ie,onSelectItem:re})}),s?(0,Z.jsx)(Ub,{workspaceId:s,gitState:f,onOpenBranchSwitcher:d}):null]}),w?(0,Z.jsx)(px,{activeSessionId:p,activeWorkspaceId:s,defaultMode:_.length===0?`create`:`list`,sessions:_,onClose:()=>T(!1),onCloseSession:c,onSelectSession:v,onSessionCreated:u}):null,h===`supervisor`&&o?(0,Z.jsx)(rx,{sessionId:o.id,workspaceId:o.workspaceId,onClose:()=>{T(!1),l()}}):null,R?(0,Z.jsx)(ep,{title:R.title,body:R.body,onClose:()=>{T(!1),l()},kicker:R.kicker??void 0,onBack:R.onBack,backLabel:R.backLabel,headerAction:`headerAction`in R?R.headerAction:void 0,bodyClassName:R.bodyClassName,contentClassName:R.contentClassName,footer:`footer`in R?R.footer:void 0,fullscreen:R.fullscreen}):null,(0,Z.jsx)(_x,{activeWorkspaceId:s,isOpen:S,workspaces:x,onClose:()=>C(!1),onOpenWorkspaceLauncher:()=>{T(!1),N(!0)}}),M?(0,Z.jsx)(Nh,{onClose:()=>N(!1)}):null]})}var yx={minHeight:`auto`,padding:0,gap:`var(--sp-3)`,alignItems:`stretch`,justifyContent:`flex-start`,textAlign:`left`};function bx(){Xb();let e=V($u)===null;return(0,Z.jsxs)(`div`,{className:`app`,children:[(0,Z.jsx)(Zb,{}),(0,Z.jsx)(`main`,{className:`main-content`,children:e?(0,Z.jsx)(`div`,{className:`app-loading-shell`,children:(0,Z.jsx)(`div`,{className:`app-loading-card`,children:(0,Z.jsx)(Ip,{style:yx,title:(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`app-loading-kicker`,children:`CODER STUDIO`}),(0,Z.jsx)(`h1`,{className:`app-loading-title`,children:`正在连接工作区...`})]}),description:(0,Z.jsx)(`p`,{className:`app-loading-desc`,children:`正在同步认证与连接状态,随后会自动进入当前 workspace。`})})})}):(0,Z.jsxs)(Sn,{children:[(0,Z.jsx)(bn,{path:`/`,element:(0,Z.jsx)(Ig,{})}),(0,Z.jsx)(bn,{path:`/login`,element:(0,Z.jsx)(nh,{})}),(0,Z.jsx)(bn,{path:`/workspace`,element:(0,Z.jsx)(Yb,{children:(0,Z.jsx)(vx,{})})}),(0,Z.jsx)(bn,{path:`/settings`,element:(0,Z.jsx)(Ag,{})}),(0,Z.jsx)(bn,{path:`*`,element:(0,Z.jsx)(zh,{})})]})}),(0,Z.jsx)(Ih,{}),(0,Z.jsx)(zb,{}),(0,Z.jsx)(qh,{})]})}function xx(){return Fr()===`mobile`?(0,Z.jsx)(bx,{}):(0,Z.jsx)($b,{})}function Sx(){return(0,Z.jsx)(lr,{children:(0,Z.jsx)(xx,{})})}var Cx=null,wx=null,Tx={refreshGit:!1,refreshBranches:!1,refreshWorktrees:!1,markTreeStale:!1,refreshEditorBuffers:!1};function Ex(e){return e===`fs_change`}function Dx(e,t){return{refreshGit:e.refreshGit||!!t.refreshGit,refreshBranches:e.refreshBranches||!!t.refreshBranches,refreshWorktrees:e.refreshWorktrees||!!t.refreshWorktrees,markTreeStale:e.markTreeStale||!!t.markTreeStale,refreshEditorBuffers:e.refreshEditorBuffers||!!t.refreshEditorBuffers}}function Ox(e,t){let n=e.match(/^workspace\.([^.]+)\.(fs\.dirty|git\.state)$/);if(!n)return null;let r=n[1];if(n[2]===`fs.dirty`){let e=t??{};return{workspaceId:r,hint:{refreshGit:!0,refreshBranches:e.reason===`git_metadata`,refreshWorktrees:e.reason===`git_metadata`,markTreeStale:Ex(e.reason),refreshEditorBuffers:e.reason===`fs_change`||e.reason===`file_content`}}}let i=t??{};return{workspaceId:r,hint:{refreshGit:!0,refreshBranches:!!i.branchChanged,refreshWorktrees:!!i.worktreeChanged,markTreeStale:!!i.treeChanged,refreshEditorBuffers:!!i.treeChanged}}}function kx({children:e}){let[,t]=Se(Ku),n=V($u),r=V(Ur),i=V(qu),a=V(rd),o=H(qu),s=H(Ju),c=H(Qu),l=H($u),u=H(Zu),d=H(Xu),f=H(Yu),p=H(id),m=H(pd),h=H(C_),g=H(w_),_=he(),v=V(ed);ng();let y=(0,B.useRef)(null),b=(0,B.useRef)(v),x=(0,B.useRef)(new Map),S=(0,B.useRef)(new Map),C=(0,B.useRef)(a),w=(0,B.useRef)(i),T=(0,B.useRef)({mode:`inactive`,workspaceId:null});return(0,B.useEffect)(()=>{b.current=v},[v]),(0,B.useEffect)(()=>{C.current=a},[a]),(0,B.useEffect)(()=>{w.current=i},[i]),(0,B.useEffect)(()=>{let e=localStorage.getItem(`ui.theme`);if(e)try{let t=JSON.parse(e);(t===`light`||t===`dark`)&&document.documentElement.setAttribute(`data-theme`,t)}catch{}},[]),(0,B.useEffect)(()=>{(async()=>{try{let e=await(await fetch(`/auth/status`)).json();l(!!e.authEnabled),_.set(Ur,!!e.authenticated||e.authEnabled===!1)}catch{_.set(Ur,!1)}})()},[l,_]),(0,B.useEffect)(()=>{if(n===null)return;if(n===!0&&!r){wx&&=(clearTimeout(wx),null),Cx&&=(Cx.disconnect(`auth_required`),null),y.current=null,t(null),o(`connecting`),s(null),c(null),u(0),d(null),f(!1);return}let e=e=>{o(e),e===`reconnecting`&&(u(e=>e+1),d(Date.now())),(e===`disconnected`||e===`rejected`)&&f(!1),e===`connected`&&p(!0)},i=e=>{b.current(`git.status`,{workspaceId:e}).then(t=>{t.ok&&t.data&&_.set(mh(e),t.data)}).catch(e=>{console.error(`[Git Status] git.status command threw error:`,e)})},a=()=>{if(T.current.mode===`inactive`)return;let e=y.current;e&&(T.current={mode:`inactive`,workspaceId:null},e.sendCommand(`workspace.deactivate`,{}).catch(()=>{}))},l=e=>{let t=T.current;if(t.mode===`active`&&t.workspaceId===e)return;let n=y.current;n&&(T.current={mode:`active`,workspaceId:e},n.sendCommand(`workspace.activate`,{workspaceId:e}).catch(()=>{}))},p=(e=!1)=>{if(document.visibilityState===`hidden`){a();return}let t=C.current;if(!t){a();return}e&&(T.current={mode:`inactive`,workspaceId:null}),l(t)},m=e=>{b.current(`git.branches`,{workspaceId:e}).then(t=>{if(t.ok&&t.data){_.set(_h(e),{current:t.data.current,branches:t.data.branches,loading:!1});return}_.set(_h(e),e=>({...e,loading:!1,error:t.error?.message??e.error}))}).catch(e=>{console.error(`[Git Branches] git.branches command threw error:`,e)})},h=e=>{_.set(bh(e),e=>({...e,loading:!0,error:void 0})),b.current(`worktree.list`,{workspaceId:e}).then(t=>{if(t.ok&&t.data&&Array.isArray(t.data.worktrees)){_.set(bh(e),{items:t.data.worktrees,loading:!1,lastLoadedAt:Date.now()});return}_.set(bh(e),e=>({...e,loading:!1,error:t.error?.message??e.error}))}).catch(t=>{console.error(`[Worktree List] worktree.list command threw error:`,t),_.set(bh(e),e=>({...e,loading:!1,error:t instanceof Error?t.message:String(t)}))})},g=(e,t)=>{let n=Dx(S.current.get(e)??Tx,t);if(S.current.set(e,n),x.current.get(e))return;let r=setTimeout(()=>{x.current.delete(e);let t=S.current.get(e)??Tx;S.current.delete(e),t.markTreeStale&&_.set(lh(e),!0),t.refreshEditorBuffers&&_.set(ph(e),e=>e+1),t.refreshGit&&i(e),t.refreshBranches&&m(e),t.refreshWorktrees&&h(e)},60);x.current.set(e,r)},v=(e,t,n)=>{let r=Ox(e,t);r&&g(r.workspaceId,r.hint);try{jx(e,t,_)}catch(t){console.error(`Error handling event for topic ${e}:`,t)}},w=[`connection.*`,`workspace.*`];if(wx&&=(clearTimeout(wx),null),Cx){y.current=Cx,t(Cx);let n=Cx.getStatus();o(n);let r=Cx.onStatus(e),i=Cx.subscribe(w,v);(n===`disconnected`||n===`reconnecting`)&&Cx.recoverConnection(`manual_retry`);let a=()=>{p(),document.visibilityState===`visible`&&y.current?.recoverConnection(`visibility_resume`)},s=()=>{y.current?.recoverConnection(`network_online`)};return p(),document.addEventListener(`visibilitychange`,a),window.addEventListener(`online`,s),()=>{document.removeEventListener(`visibilitychange`,a),window.removeEventListener(`online`,s),r(),i(),x.current.forEach(e=>clearTimeout(e)),x.current.clear(),S.current.clear(),y.current=null,Cx&&(wx=setTimeout(()=>{Cx&&=(Cx.disconnect(`app_unmount`),null),wx=null},50))}}let E=new Wu(Gu());Cx=E,y.current=E,t(E);let D=E.onStatus(e),O=E.subscribe(w,v);E.connect().catch(e=>{console.error(`Failed to connect WebSocket:`,e),s(e.message||`Connection failed`)});let k=()=>{p(),document.visibilityState===`visible`&&y.current?.recoverConnection(`visibility_resume`)},A=()=>{y.current?.recoverConnection(`network_online`)};return p(),document.addEventListener(`visibilitychange`,k),window.addEventListener(`online`,A),()=>{document.removeEventListener(`visibilitychange`,k),window.removeEventListener(`online`,A),D(),O(),x.current.forEach(e=>clearTimeout(e)),x.current.clear(),S.current.clear(),y.current=null,wx=setTimeout(()=>{Cx&&=(Cx.disconnect(`app_unmount`),null),wx=null},50)}},[t,o,s,c,l,u,d,f,p,m,h,g,_,n,r]),(0,B.useEffect)(()=>{if(n===null)return;if(n===!0&&!r){T.current={mode:`inactive`,workspaceId:null};return}if(i!==`connected`)return;if(document.visibilityState===`hidden`){if(T.current.mode!==`inactive`){let e=y.current;if(!e)return;T.current={mode:`inactive`,workspaceId:null},e.sendCommand(`workspace.deactivate`,{}).catch(()=>{})}return}if(!a){if(T.current.mode!==`inactive`){let e=y.current;if(!e)return;T.current={mode:`inactive`,workspaceId:null},e.sendCommand(`workspace.deactivate`,{}).catch(()=>{})}return}if(T.current.mode===`active`&&T.current.workspaceId===a)return;let e=y.current;e&&(T.current={mode:`active`,workspaceId:a},e.sendCommand(`workspace.activate`,{workspaceId:a}).catch(()=>{}))},[a,n,r,i]),(0,Z.jsx)(Z.Fragment,{children:e})}function Ax(e,t){let n=e;return typeof n.version!=`string`||typeof n.serverInstanceId!=`string`?!1:(t.set(Qu,{version:n.version,serverInstanceId:n.serverInstanceId,authEnabled:typeof n.authEnabled==`boolean`?n.authEnabled:void 0}),typeof n.isWriter==`boolean`&&t.set(Yu,n.isWriter),!0)}function jx(e,t,n){if(e===`connection.ready`){Ax(t,n),n.set(Ju,null);return}if(e===`connection.status`){let e=t;e.status===`connected`&&Ax(t,n),e.status===`connected`&&e.authEnabled===!1&&n.set(Ur,!0),e.status===`error`&&e.message&&n.set(Ju,e.message);return}let r=e.match(/^workspace\.([^.]+)\.(.+)$/);if(r){let e=r[1],i=r[2];if(i===`meta`){let r=t;if(!(n.get(id)[e]||r.path))return;n.set(id,t=>({...t,[e]:{...t[e],...r,id:e}})),n.set(ad,t=>t.includes(e)?t:[...t,e]),n.set(od,`ready`),n.set(sd,null);return}if(i===`fs.dirty`){if(Ex((t??{}).reason)){let t=lh(e);n.set(t,!0)}return}if(i===`git.state`)return;let a=i.match(/^session\.([^.]+)\.(.+)$/);if(a){let e=a[1],r=a[2];if(r===`lifecycle`){if(t.event===`removed`){let t=n.get(pd)[e];t?.terminalId&&n.set(B_(t.terminalId),null),n.set(pd,t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})}return}if(r===`state`){let e=t;n.set(pd,t=>({...t,[e.id]:e}));return}if(r===`progress`){console.log(`Session ${e} progress:`,t);return}if(r===`supervisor.state`){let e=t;if(e.event===`deleted`&&e.supervisorId)n.set(C_,t=>{let n=new Map(t);for(let[t,r]of n.entries())if(r.id===e.supervisorId){n.delete(t);break}return n}),n.set(w_,t=>{let n=new Map(t);return n.delete(e.supervisorId),n});else if(e.supervisor){let t=e.supervisor;n.set(C_,e=>{let n=new Map(e);return n.set(t.sessionId,t),n}),Array.isArray(t.cycles)&&n.set(w_,e=>{let n=new Map(e);return n.set(t.id,t.cycles),n})}return}if(r===`supervisor.cycle`){let e=t,r=e.cycle.supervisorId;n.set(w_,t=>{let n=new Map(t),i=(n.get(r)??[]).filter(t=>t.id!==e.cycle.id);return n.set(r,[e.cycle,...i].slice(0,20)),n});return}}let o=i.match(/^terminal\.([^.]+)\.(.+)$/);if(o){let r=o[1],i=o[2];if(i===`created`){let i=t,a=B_(r);n.set(a,{id:i.id,workspaceId:e,kind:i.kind,alive:!0,title:i.title});return}if(i===`output`)return;if(i===`exit`){let e=t,i=B_(r),a=n.get(i);a&&n.set(i,{...a,exitCode:e.code,alive:!1});return}}}console.log(`Unhandled event topic: ${e}`,t)}Ar.createRoot(document.getElementById(`root`)).render((0,Z.jsx)(ge,{children:(0,Z.jsx)(kx,{children:(0,Z.jsx)(Sx,{})})}));
111
- //# sourceMappingURL=index-tpaaY-08.js.map