@open-mercato/cezar 0.9.1-pr694.813 → 0.9.1-pr694.821
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/codex-ui-mapper.js +27 -0
- package/dist/core/codex-ui-mapper.js.map +1 -1
- package/dist/server/forge/github.d.ts +1 -0
- package/dist/server/forge/github.js +12 -2
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/forge/types.d.ts +2 -0
- package/dist/server/project-context.d.ts +4 -0
- package/dist/server/project-context.js +2 -1
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/server.d.ts +5 -0
- package/dist/server/server.js +31 -9
- package/dist/server/server.js.map +1 -1
- package/package.json +1 -1
- package/web/dist/assets/arrow-left-BWue3Imk.js +1 -0
- package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
- package/web/dist/assets/{centered-state-D-hkkRHv.js → centered-state-DsblJe6Q.js} +2 -2
- package/web/dist/assets/{chunk-BO2N2NFS-DtrdTCWa.js → chunk-BO2N2NFS-DE6qKn3r.js} +8 -8
- package/web/dist/assets/circle-check-TKq6_8_Y.js +1 -0
- package/web/dist/assets/circle-x-bH39f-Yh.js +1 -0
- package/web/dist/assets/commit-list-CAwllMBX.js +1 -0
- package/web/dist/assets/compare-variants-JnaeMTz5.js +1 -0
- package/web/dist/assets/{core-DePtBHcl.js → core-BCsw8oQw.js} +1 -1
- package/web/dist/assets/diff-Drvekr61.js +3 -0
- package/web/dist/assets/{diff-view-BBgUutQ0.js → diff-view-Ct3kYFRM.js} +2 -2
- package/web/dist/assets/dist-CngV8tyE.js +1 -0
- package/web/dist/assets/{ellipsis-vertical-DFAnsUi4.js → ellipsis-vertical-WowqAN6-.js} +1 -1
- package/web/dist/assets/{file-vT36R94R.js → file-BWgi5VOt.js} +1 -1
- package/web/dist/assets/{git-pull-request-BvjQwr12.js → git-pull-request-D8yt-2Tr.js} +1 -1
- package/web/dist/assets/git-toolbar-BLqu97v8.js +1 -0
- package/web/dist/assets/github-hrWK-ST8.js +1 -0
- package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
- package/web/dist/assets/image-preview-B3W7bWIq.js +1 -0
- package/web/dist/assets/index-B96YnNHc.js +22 -0
- package/web/dist/assets/index-DdBHg6_F.css +2 -0
- package/web/dist/assets/lib-BQXq3kEf.js +1 -0
- package/web/dist/assets/lib-BxQXEXDF.js +1 -0
- package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
- package/web/dist/assets/project-router-CnKsyZKI.js +1 -0
- package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
- package/web/dist/assets/{refresh-cw-BgVxWSof.js → refresh-cw-CFp_jUZr.js} +1 -1
- package/web/dist/assets/repo-git-DnkvanyM.js +1 -0
- package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
- package/web/dist/assets/{run-diff-DeWQ1xve.js → run-diff-LyXkHJCR.js} +1 -1
- package/web/dist/assets/run-header-BtH23tbQ.js +1 -0
- package/web/dist/assets/{search-x-CbHLclyX.js → search-x-CaddQd7u.js} +1 -1
- package/web/dist/assets/skill-empty-hint-D5QzmqHj.js +1 -0
- package/web/dist/assets/skills-CE0HAI_G.js +1 -0
- package/web/dist/assets/{square-terminal-DRmz43dF.js → square-terminal-CoE5Kj-S.js} +1 -1
- package/web/dist/assets/tab-link-BbQLZUG5.js +1 -0
- package/web/dist/assets/task-changes-BYNpnV0E.js +1 -0
- package/web/dist/assets/task-commits-DRnMTXtG.js +1 -0
- package/web/dist/assets/task-files-DAqPuHp1.js +2 -0
- package/web/dist/assets/{task-thread-x1axqNnn.js → task-thread-DMM5s2zt.js} +2 -2
- package/web/dist/assets/textarea-Dd8d_Pwi.js +1 -0
- package/web/dist/assets/{trash-2-ObVP5T4c.js → trash-2-aYhsIRM2.js} +1 -1
- package/web/dist/assets/{triangle-alert-CHtGkjPK.js → triangle-alert-BMsU3ymT.js} +1 -1
- package/web/dist/assets/{upload-Dx__Y6Lu.js → upload-DH2pWIfO.js} +1 -1
- package/web/dist/assets/use-desktop-BAHxMKrE.js +1 -0
- package/web/dist/assets/utils-D27OaPrA.js +1 -0
- package/web/dist/assets/{workflows-C3gTBtmF.js → workflows-DCkK4Bsn.js} +2 -2
- package/web/dist/assets/zoomable-image-BBB-AoPi.js +1 -0
- package/web/dist/index.html +14 -12
- package/web/dist/assets/arrow-left-BmHnLe4M.js +0 -1
- package/web/dist/assets/bundle-mjs-BegPhL5c.js +0 -1
- package/web/dist/assets/circle-check-CH4jMJue.js +0 -1
- package/web/dist/assets/commit-list-BXNfseD5.js +0 -1
- package/web/dist/assets/compare-variants-CkvpSWZa.js +0 -1
- package/web/dist/assets/diff-CITBzanN.js +0 -3
- package/web/dist/assets/dist-C553orO_.js +0 -1
- package/web/dist/assets/git-toolbar-ChCEnVjR.js +0 -1
- package/web/dist/assets/github-B8nK4e73.js +0 -1
- package/web/dist/assets/highlighted-body-OFNGDK62-BuFJwunK.js +0 -1
- package/web/dist/assets/image-preview-B6kVovYD.js +0 -1
- package/web/dist/assets/index-BWzcnzgp.js +0 -30
- package/web/dist/assets/index-pJfUoRGK.css +0 -2
- package/web/dist/assets/lib-DPEZDBUN.js +0 -1
- package/web/dist/assets/lib-uHpeUPzK.js +0 -1
- package/web/dist/assets/mermaid-GHXKKRXX-CN2zQue0.js +0 -1
- package/web/dist/assets/project-router-C-gp_QmI.js +0 -1
- package/web/dist/assets/repo-git-DW8ekpNQ.js +0 -1
- package/web/dist/assets/run-header-BaLnTHQf.js +0 -1
- package/web/dist/assets/skill-empty-hint-CzXygdIH.js +0 -1
- package/web/dist/assets/skills-Bt9YVDdo.js +0 -1
- package/web/dist/assets/tab-link-C2tgsylt.js +0 -1
- package/web/dist/assets/task-changes-CluQWIkd.js +0 -1
- package/web/dist/assets/task-commits-BJRUd8fY.js +0 -1
- package/web/dist/assets/task-files-CpWfXD2B.js +0 -2
- package/web/dist/assets/textarea-BhdkPlu6.js +0 -1
- package/web/dist/assets/use-desktop-BB0Ck5sN.js +0 -1
- package/web/dist/assets/utils-B8xGEgP3.js +0 -1
- package/web/dist/assets/zoomable-image-Bb6ydBLq.js +0 -1
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/html-BY76lXLH.js","assets/css-BsVw1vtW.js","assets/javascript-BgS3c2Ky.js","assets/core-DePtBHcl.js","assets/lib-uHpeUPzK.js","assets/bundle-mjs-BegPhL5c.js","assets/task-thread-x1axqNnn.js","assets/centered-state-D-hkkRHv.js","assets/utils-B8xGEgP3.js","assets/run-header-BaLnTHQf.js","assets/circle-check-CH4jMJue.js","assets/trash-2-ObVP5T4c.js","assets/ellipsis-vertical-DFAnsUi4.js","assets/tab-link-C2tgsylt.js","assets/project-router-C-gp_QmI.js","assets/square-terminal-DRmz43dF.js","assets/git-pull-request-BvjQwr12.js","assets/search-x-CbHLclyX.js","assets/textarea-BhdkPlu6.js","assets/run-diff-DeWQ1xve.js","assets/lib-DPEZDBUN.js","assets/zoomable-image-Bb6ydBLq.js","assets/compare-variants-CkvpSWZa.js","assets/task-changes-CluQWIkd.js","assets/git-toolbar-ChCEnVjR.js","assets/file-vT36R94R.js","assets/use-desktop-BB0Ck5sN.js","assets/upload-Dx__Y6Lu.js","assets/diff-CITBzanN.js","assets/image-preview-B6kVovYD.js","assets/task-files-CpWfXD2B.js","assets/triangle-alert-CHtGkjPK.js","assets/task-commits-BJRUd8fY.js","assets/arrow-left-BmHnLe4M.js","assets/commit-list-BXNfseD5.js","assets/repo-git-DW8ekpNQ.js","assets/github-B8nK4e73.js","assets/refresh-cw-BgVxWSof.js","assets/workflows-C3gTBtmF.js","assets/skill-empty-hint-CzXygdIH.js","assets/skills-Bt9YVDdo.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e,c as t,i as n,o as r,s as i,u as a}from"./bundle-mjs-BegPhL5c.js";import{$ as o,$n as s,A as c,An as l,Bn as u,Bt as d,C as f,Cn as p,Ct as m,D as h,Dn as g,E as _,En as v,Et as y,Fn as b,G as x,Gn as S,Gt as C,H as w,Hn as ee,I as T,In as E,It as D,J as O,Jn as te,Kn as ne,Kt as re,Ln as ie,M as ae,Mn as k,N as A,Nn as oe,O as se,On as ce,Ot as j,P as le,Pn as M,Pt as ue,Q as de,Qn as fe,Rn as pe,Rt as me,S as he,Sn as ge,St as _e,T as ve,Tn as ye,Tt as N,U as be,Un as xe,Vn as Se,Wn as Ce,Wt as we,X as Te,Xn as Ee,Y as De,Yn as Oe,Z as ke,Zn as Ae,Zt as je,_ as Me,_n as Ne,_t as Pe,a as P,at as Fe,b as Ie,bn as Le,bt as Re,c as ze,cn as Be,d as Ve,dn as He,er as Ue,et as We,f as Ge,fn as Ke,g as qe,gt as Je,h as Ye,hn as Xe,i as F,in as Ze,j as Qe,jn as I,jt as $e,k as et,kn as tt,l as nt,ln as rt,m as it,mn as at,mt as ot,n as st,nr as ct,nt as lt,o as ut,on as dt,pt as ft,qn as pt,r as mt,s as ht,t as L,tr as gt,u as _t,un as vt,v as yt,vn as bt,vt as xt,w as St,wn as Ct,wt,x as Tt,xn as Et,xt as Dt,y as R,yn as Ot,yt as kt}from"./centered-state-D-hkkRHv.js";import{i as At,n as jt,r as z,t as B}from"./utils-B8xGEgP3.js";import{t as Mt}from"./search-x-CbHLclyX.js";import{t as Nt}from"./triangle-alert-CHtGkjPK.js";import{n as Pt,t as Ft}from"./textarea-BhdkPlu6.js";import{a as It,c as Lt,i as Rt,l as zt,n as Bt,o as Vt,r as Ht,s as Ut,t as Wt}from"./dist-C553orO_.js";import{a as Gt,c as Kt,d as qt,i as Jt,l as Yt,n as Xt,o as Zt,r as Qt,s as $t,t as V,u as en}from"./project-router-C-gp_QmI.js";import{i as tn,n as nn}from"./chunk-BO2N2NFS-DtrdTCWa.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)}})();var rn=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,D());else{var t=n(l);t!==null&&ne(x,t.startTime-e)}}var S=!1,C=-1,w=5,ee=-1;function T(){return g?!0:!(e.unstable_now()-ee<w)}function E(){if(g=!1,S){var t=e.unstable_now();ee=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&T());){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&&ne(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,te=O.port2;O.port1.onmessage=E,D=function(){te.postMessage(null)}}else D=function(){_(E,0)};function ne(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,ne(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),an=t(((e,t)=>{t.exports=rn()})),on=t((e=>{var t=an(),n=i(),a=r();function o(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 s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(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 l(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 u(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 d(e){if(c(e)!==e)throw Error(o(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return d(i),e;if(a===r)return d(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),te=Symbol.iterator;function ne(e){return typeof e!=`object`||!e?null:(e=te&&e[te]||e[`@@iterator`],typeof e==`function`?e:null)}var re=Symbol.for(`react.client.reference`);function ie(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case w:return`Suspense`;case ee:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?ie(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var ae=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},se=[],ce=-1;function j(e){return{current:e}}function le(e){0>ce||(e.current=se[ce],se[ce]=null,ce--)}function M(e,t){ce++,se[ce]=e.current,e.current=t}var ue=j(null),de=j(null),fe=j(null),pe=j(null);function me(e,t){switch(M(fe,t),M(de,e),M(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}le(ue),M(ue,e)}function he(){le(ue),le(de),le(fe)}function ge(e){e.memoizedState!==null&&M(pe,e);var t=ue.current,n=Hd(t,e.type);t!==n&&(M(de,e),M(ue,n))}function _e(e){de.current===e&&(le(ue),le(de)),pe.current===e&&(le(pe),Qf._currentValue=oe)}var ve,ye;function N(e){if(ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ve=t&&t[1]||``,ye=-1<e.stack.indexOf(`
|
|
3
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
-
`+ve+e+ye}var be=!1;function xe(e,t){if(!e||be)return``;be=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
-
`),l=s.split(`
|
|
6
|
-
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
-
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{be=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?N(n):``}function Se(e,t){switch(e.tag){case 26:case 27:case 5:return N(e.type);case 16:return N(`Lazy`);case 13:return e.child!==t&&t!==null?N(`Suspense Fallback`):N(`Suspense`);case 19:return N(`SuspenseList`);case 0:case 15:return xe(e.type,!1);case 11:return xe(e.type.render,!1);case 1:return xe(e.type,!0);case 31:return N(`Activity`);default:return``}}function Ce(e){try{var t=``,n=null;do t+=Se(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
-
Error generating stack: `+e.message+`
|
|
9
|
-
`+e.stack}}var we=Object.prototype.hasOwnProperty,Te=t.unstable_scheduleCallback,Ee=t.unstable_cancelCallback,De=t.unstable_shouldYield,Oe=t.unstable_requestPaint,ke=t.unstable_now,Ae=t.unstable_getCurrentPriorityLevel,je=t.unstable_ImmediatePriority,Me=t.unstable_UserBlockingPriority,Ne=t.unstable_NormalPriority,Pe=t.unstable_LowPriority,P=t.unstable_IdlePriority,Fe=t.log,Ie=t.unstable_setDisableYieldValue,Le=null,Re=null;function ze(e){if(typeof Fe==`function`&&Ie(e),Re&&typeof Re.setStrictMode==`function`)try{Re.setStrictMode(Le,e)}catch{}}var Be=Math.clz32?Math.clz32:Ue,Ve=Math.log,He=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(Ve(e)/He|0)|0}var We=256,Ge=262144,Ke=4194304;function qe(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 Je(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=qe(n))):i=qe(o):i=qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=qe(n))):i=qe(o)):i=qe(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 Ye(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xe(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 F(){var e=Ke;return Ke<<=1,!(Ke&62914560)&&(Ke=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function I(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-Be(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&&$e(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function $e(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Be(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Be(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function tt(e,t){var n=t&-t;return n=n&42?1:nt(n),(n&(e.suspendedLanes|t))===0?n:0}function nt(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 rt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function it(){var e=A.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function at(e,t){var n=A.p;try{return A.p=e,t()}finally{A.p=n}}var ot=Math.random().toString(36).slice(2),st=`__reactFiber$`+ot,ct=`__reactProps$`+ot,lt=`__reactContainer$`+ot,ut=`__reactEvents$`+ot,dt=`__reactListeners$`+ot,ft=`__reactHandles$`+ot,pt=`__reactResources$`+ot,mt=`__reactMarker$`+ot;function ht(e){delete e[st],delete e[ct],delete e[ut],delete e[dt],delete e[ft]}function L(e){var t=e[st];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lt]||n[st]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[st])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function gt(e){if(e=e[st]||e[lt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _t(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function vt(e){var t=e[pt];return t||=e[pt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function yt(e){e[mt]=!0}var bt=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+`Capture`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)bt.add(t[e])}var wt=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]*$`),Tt={},Et={};function Dt(e){return we.call(Et,e)?!0:we.call(Tt,e)?!1:wt.test(e)?Et[e]=!0:(Tt[e]=!0,!1)}function R(e,t,n){if(Dt(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 Ot(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 kt(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 At(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function z(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 B(e){if(!e._valueTracker){var t=jt(e)?`checked`:`value`;e._valueTracker=z(e,t,``+e[t])}}function Mt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=jt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Nt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Pt=/[\n"\\]/g;function Ft(e){return e.replace(Pt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function It(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+At(t)):e.value!==``+At(t)&&(e.value=``+At(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Rt(e,o,At(n)):Rt(e,o,At(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=``+At(s):e.removeAttribute(`name`)}function Lt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){B(e);return}n=n==null?``:``+At(n),t=t==null?n:``+At(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),B(e)}function Rt(e,t,n){t===`number`&&Nt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function zt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+At(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Bt(e,t,n){if(t!=null&&(t=``+At(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+At(n)}function Vt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(o(92));if(ae(r)){if(1<r.length)throw Error(o(93));r=r[0]}n=r}n??=``,t=n}n=At(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),B(e)}function Ht(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ut=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Wt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Ut.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Gt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(o(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 i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Wt(e,i,r)}else for(var a in t)t.hasOwnProperty(a)&&Wt(e,a,t[a])}function Kt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var qt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Jt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yt(e){return Jt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Xt(){}var Zt=null;function Qt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $t=null,V=null;function en(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[ct]||null;a:switch(e=t.stateNode,t.type){case`input`:if(It(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Ft(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[ct]||null;if(!i)throw Error(o(90));It(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Mt(r)}break a;case`textarea`:Bt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&zt(e,!!n.multiple,t,!1)}}}var tn=!1;function nn(e,t,n){if(tn)return e(t,n);tn=!0;try{return e(t)}finally{if(tn=!1,($t!==null||V!==null)&&(yu(),$t&&(t=$t,e=V,V=$t=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[ct]||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(o(231,t,typeof n));return n}var on=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),sn=!1;if(on)try{var cn={};Object.defineProperty(cn,"passive",{get:function(){sn=!0}}),window.addEventListener(`test`,cn,cn),window.removeEventListener(`test`,cn,cn)}catch{sn=!1}var ln=null,un=null,dn=null;function H(){if(dn)return dn;var e,t=un,n=t.length,r,i=`value`in ln?ln.value:ln.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return dn=i.slice(e,1<r?1-r:void 0)}function fn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function pn(){return!0}function mn(){return!1}function hn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?pn:mn,this.isPropagationStopped=mn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=pn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=pn)},persist:function(){},isPersistent:pn}),t}var gn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_n=hn(gn),vn=m({},gn,{view:0,detail:0}),yn=hn(vn),bn,U,xn,Sn=m({},vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nn,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!==xn&&(xn&&e.type===`mousemove`?(bn=e.screenX-xn.screenX,U=e.screenY-xn.screenY):U=bn=0,xn=e),bn)},movementY:function(e){return`movementY`in e?e.movementY:U}}),Cn=hn(Sn),wn=hn(m({},Sn,{dataTransfer:0})),Tn=hn(m({},vn,{relatedTarget:0})),En=hn(m({},gn,{animationName:0,elapsedTime:0,pseudoElement:0})),Dn=hn(m({},gn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),On=hn(m({},gn,{data:0})),kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},An={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`},jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Mn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jn[e])?!!t[e]:!1}function Nn(){return Mn}var Pn=hn(m({},vn,{key:function(e){if(e.key){var t=kn[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`?An[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nn,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}})),Fn=hn(m({},Sn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),In=hn(m({},vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nn})),Ln=hn(m({},gn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=hn(m({},Sn,{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})),zn=hn(m({},gn,{newState:0,oldState:0})),Bn=[9,13,27,32],Vn=on&&`CompositionEvent`in window,Hn=null;on&&`documentMode`in document&&(Hn=document.documentMode);var Un=on&&`TextEvent`in window&&!Hn,Wn=on&&(!Vn||Hn&&8<Hn&&11>=Hn),Gn=` `,Kn=!1;function qn(e,t){switch(e){case`keyup`:return Bn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Jn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Yn=!1;function Xn(e,t){switch(e){case`compositionend`:return Jn(t);case`keypress`:return t.which===32?(Kn=!0,Gn):null;case`textInput`:return e=t.data,e===Gn&&Kn?null:e;default:return null}}function Zn(e,t){if(Yn)return e===`compositionend`||!Vn&&qn(e,t)?(e=H(),dn=un=ln=null,Yn=!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 Wn&&t.locale!==`ko`?null:t.data;default:return null}}var Qn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Qn[e.type]:t===`textarea`}function er(e,t,n,r){$t?V?V.push(r):V=[r]:$t=r,t=Td(t,`onChange`),0<t.length&&(n=new _n(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function rr(e){vd(e,0)}function ir(e){if(Mt(_t(e)))return e}function ar(e,t){if(e===`change`)return t}var or=!1;if(on){var sr;if(on){var cr=`oninput`in document;if(!cr){var lr=document.createElement(`div`);lr.setAttribute(`oninput`,`return;`),cr=typeof lr.oninput==`function`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){tr&&(tr.detachEvent(`onpropertychange`,dr),nr=tr=null)}function dr(e){if(e.propertyName===`value`&&ir(nr)){var t=[];er(t,nr,e,Qt(e)),nn(rr,t)}}function fr(e,t,n){e===`focusin`?(ur(),tr=t,nr=n,tr.attachEvent(`onpropertychange`,dr)):e===`focusout`&&ur()}function pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ir(nr)}function mr(e,t){if(e===`click`)return ir(t)}function hr(e,t){if(e===`input`||e===`change`)return ir(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==`function`?Object.is:gr;function vr(e,t){if(_r(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!we.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nt(e.document)}return t}function Cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var wr=on&&`documentMode`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==Nt(r)||(r=Tr,`selectionStart`in r&&Cr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dr&&vr(Dr,r)||(Dr=r,r=Td(Er,`onSelect`),0<r.length&&(t=new _n(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var jr={animationend:Ar(`Animation`,`AnimationEnd`),animationiteration:Ar(`Animation`,`AnimationIteration`),animationstart:Ar(`Animation`,`AnimationStart`),transitionrun:Ar(`Transition`,`TransitionRun`),transitionstart:Ar(`Transition`,`TransitionStart`),transitioncancel:Ar(`Transition`,`TransitionCancel`),transitionend:Ar(`Transition`,`TransitionEnd`)},Mr={},Nr={};on&&(Nr=document.createElement(`div`).style,`AnimationEvent`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),`TransitionEvent`in window||delete jr.transitionend.transition);function Pr(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),Br=Pr(`transitioncancel`),Vr=Pr(`transitionend`),Hr=new Map,Ur=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Ur.push(`scrollEnd`);function Wr(e,t){Hr.set(e,t),St(t,[e])}var Gr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Kr=[],qr=0,Jr=0;function Yr(){for(var e=qr,t=Jr=qr=0;t<e;){var n=Kr[t];Kr[t++]=null;var r=Kr[t];Kr[t++]=null;var i=Kr[t];Kr[t++]=null;var a=Kr[t];if(Kr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&$r(n,i,a)}}function Xr(e,t,n,r){Kr[qr++]=e,Kr[qr++]=t,Kr[qr++]=n,Kr[qr++]=r,Jr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Zr(e,t,n,r){return Xr(e,t,n,r),ei(e)}function Qr(e,t){return Xr(e,null,null,t),ei(e)}function $r(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Be(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ei(e){if(50<uu)throw uu=0,du=null,Error(o(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,i,a){var s=0;if(r=e,typeof e==`function`)ii(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,ue.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case D:return e=ri(31,n,t,i),e.elementType=D,e.lanes=a,e;case v:return ci(n.children,i,a,t);case y:s=8,i|=24;break;case b:return e=ri(12,n,t,i|2),e.elementType=b,e.lanes=a,e;case w:return e=ri(13,n,t,i),e.elementType=w,e.lanes=a,e;case ee:return e=ri(19,n,t,i),e.elementType=ee,e.lanes=a,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case S:s=10;break a;case x:s=9;break a;case C:s=11;break a;case T:s=14;break a;case E:s=16,r=null;break a}s=29,n=Error(o(130,e===null?`null`:typeof e,``)),r=null}return t=ri(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,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:Ce(t)},fi.set(e,t),t):n}return{value:e,source:t,stack:Ce(t)}}var mi=[],hi=0,gi=null,_i=0,vi=[],yi=0,bi=null,xi=1,Si=``;function Ci(e,t){mi[hi++]=_i,mi[hi++]=gi,gi=e,_i=t}function wi(e,t,n){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,bi=e;var r=xi;e=Si;var i=32-Be(r)-1;r&=~(1<<i),n+=1;var a=32-Be(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xi=1<<32-Be(t)+i|n<<i|r,Si=a+e}else xi=1<<a|n<<i|r,Si=e}function Ti(e){e.return!==null&&(Ci(e,1),wi(e,1,0))}function Ei(e){for(;e===gi;)gi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null;for(;e===bi;)bi=vi[--yi],vi[yi]=null,Si=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null}function Di(e,t){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,xi=t.id,Si=t.overflow,bi=e}var Oi=null,ki=null,W=!1,Ai=null,ji=!1,Mi=Error(o(519));function Ni(e){throw zi(pi(Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Mi}function Pi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[st]=e,t[ct]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)$(gd[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),Lt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Vt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||jd(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=Xt),t=!0):t=!1,t||Ni(e,!0)}function Fi(e){for(Oi=e.return;Oi;)switch(Oi.tag){case 5:case 31:case 13:ji=!1;return;case 27:case 3:ji=!0;return;default:Oi=Oi.return}}function Ii(e){if(e!==Oi)return!1;if(!W)return Fi(e),W=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&ki&&Ni(e),Fi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));ki=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));ki=uf(e)}else t===27?(t=ki,Zd(e.type)?(e=lf,lf=null,ki=e):ki=t):ki=Oi?cf(e.stateNode.nextSibling):null;return!0}function Li(){ki=Oi=null,W=!1}function Ri(){var e=Ai;return e!==null&&(Xl===null?Xl=e:Xl.push.apply(Xl,e),Ai=null),e}function zi(e){Ai===null?Ai=[e]:Ai.push(e)}var Bi=j(null),Vi=null,Hi=null;function Ui(e,t,n){M(Bi,t._currentValue),t._currentValue=n}function Wi(e){e._currentValue=Bi.current,le(Bi)}function Gi(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 Ki(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var s=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Gi(a.return,n,e),r||(s=null);break a}a=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(o(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Gi(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function qi(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(o(387));if(s=s.memoizedProps,s!==null){var c=i.type;_r(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===pe.current){if(s=i.alternate,s===null)throw Error(o(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}i=i.return}e!==null&&Ki(t,e,n,r),t.flags|=262144}function Ji(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Yi(e){Vi=e,Hi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Xi(e){return Qi(Vi,e)}function Zi(e,t){return Vi===null&&Yi(e),Qi(e,t)}function Qi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Hi===null){if(e===null)throw Error(o(308));Hi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Hi=Hi.next=t;return n}var $i=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()})}},ea=t.unstable_scheduleCallback,ta=t.unstable_NormalPriority,G={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function na(){return{controller:new $i,data:new Map,refCount:0}}function ra(e){e.refCount--,e.refCount===0&&ea(ta,function(){e.controller.abort()})}var ia=null,aa=0,oa=0,sa=null;function ca(e,t){if(ia===null){var n=ia=[];aa=0,oa=ud(),sa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return aa++,t.then(la,la),t}function la(){if(--aa===0&&ia!==null){sa!==null&&(sa.status=`fulfilled`);var e=ia;ia=null,oa=0,sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var da=k.S;k.S=function(e,t){$l=ke(),typeof t==`object`&&t&&typeof t.then==`function`&&ca(e,t),da!==null&&da(e,t)};var fa=j(null);function pa(){var e=fa.current;return e===null?Ll.pooledCache:e}function ma(e,t){t===null?M(fa,fa.current):M(fa,t.pool)}function ha(){var e=pa();return e===null?null:{parent:G._currentValue,pool:e}}var ga=Error(o(460)),_a=Error(o(474)),va=Error(o(542)),ya={then:function(){}};function ba(e){return e=e.status,e===`fulfilled`||e===`rejected`}function xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Xt,Xt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e;default:if(typeof t.status==`string`)t.then(Xt,Xt);else{if(e=Ll,e!==null&&100<e.shellSuspendCounter)throw Error(o(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(o(459));var e=Ca;return Ca=null,e}function Ta(e){if(e===ga||e===va)throw Error(o(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===h?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(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 i(e,t){return e=ai(e,t),e.index=0,e.sibling=null,e}function a(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=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===v?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===E&&Sa(a)===t.type)?(t=i(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=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=ci(n,e.mode,r,a),t.return=e,t):(t=i(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 g:return n=si(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case _:return t=di(t,e.mode,n),t.return=e,t;case E:return t=Sa(t),f(e,t,n)}if(ae(t)||ne(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===S)return f(e,Zi(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 g:return n.key===i?l(e,t,n,r):null;case _:return n.key===i?u(e,t,n,r):null;case E:return n=Sa(n),p(e,t,n,r)}if(ae(n)||ne(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===S)return p(e,t,Zi(e,n),r);Aa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case _:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case E:return r=Sa(r),m(e,t,n,r,i)}if(ae(r)||ne(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Oa(r),i);if(r.$$typeof===S)return m(e,t,n,Zi(t,r),i);Aa(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),W&&Ci(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return W&&Ci(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),W&&Ci(i,h),l}function y(i,s,c,l){if(c==null)throw Error(o(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=a(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),W&&Ci(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return W&&Ci(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),W&&Ci(i,g),u}function b(e,r,a,c){if(typeof a==`object`&&a&&a.type===v&&a.key===null&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case g:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===v){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&Sa(l)===r.type){n(e,r.sibling),c=i(r,a.props),ka(c,a),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}a.type===v?(c=ci(a.props.children,e.mode,c,a.key),c.return=e,e=c):(c=si(a.type,a.key,a.props,null,e.mode,c),ka(c,a),c.return=e,e=c)}return s(e);case _:a:{for(l=a.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=di(a,e.mode,c),c.return=e,e=c}return s(e);case E:return a=Sa(a),b(e,r,a,c)}if(ae(a))return h(e,r,a,c);if(ne(a)){if(l=ne(a),typeof l!=`function`)throw Error(o(150));return a=l.call(a),y(e,r,a,c)}if(typeof a.then==`function`)return b(e,r,Oa(a),c);if(a.$$typeof===S)return b(e,r,Zi(e,a),c);Aa(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=li(a,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Da=0;var i=b(e,t,n,r);return Ea=null,i}catch(t){if(t===ga||t===va)throw t;var a=ri(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ma=ja(!0),Na=ja(!1),Pa=!1;function Fa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ia(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ei(e),$r(e,null,n),t}return Xr(e,r,t,n),ei(e)}function za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}function Ba(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Va=!1;function Ha(){if(Va){var e=sa;if(e!==null)throw e}}function Ua(e,t,n,r){Va=!1;var i=e.updateQueue;Pa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(X&f)===f:(r&f)===f){f!==0&&f===oa&&(Va=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Pa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Wl|=o,e.lanes=o,e.memoizedState=d}}function Wa(e,t){if(typeof e!=`function`)throw Error(o(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=j(null),qa=j(0);function Ja(e,t){e=Hl,M(qa,e),M(Ka,t),Hl=e|t.baseLanes}function Ya(){M(qa,Hl),M(Ka,Ka.current)}function Xa(){Hl=qa.current,le(Ka),le(qa)}var Za=j(null),Qa=null;function $a(e){var t=e.alternate;M(io,io.current&1),M(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){M(io,io.current),M(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(M(io,io.current),M(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){M(io,io.current),M(Za,Za.current)}function ro(e){le(Za),Qa===e&&(Qa=null),le(io)}var io=j(0);function ao(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var oo=0,K=null,q=null,so=null,co=!1,lo=!1,uo=!1,fo=0,po=0,mo=null,ho=0;function go(){throw Error(o(321))}function _o(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function vo(e,t,n,r,i,a){return oo=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Fs:Is,uo=!1,a=n(r,i),uo=!1,lo&&(a=bo(t,n,r,i)),yo(e),a}function yo(e){k.H=Ps;var t=q!==null&&q.next!==null;if(oo=0,so=q=K=null,co=!1,po=0,mo=null,t)throw Error(o(300));e===null||$s||(e=e.dependencies,e!==null&&Ji(e)&&($s=!0))}function bo(e,t,n,r){K=e;var i=0;do{if(lo&&(mo=null),po=0,lo=!1,25<=i)throw Error(o(301));if(i+=1,so=q=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}k.H=Ls,a=t(n,r)}while(lo);return a}function xo(){var e=k.H,t=e.useState()[0];return t=typeof t.then==`function`?Oo(t):t,e=e.useState()[0],(q===null?null:q.memoizedState)!==e&&(K.flags|=1024),t}function So(){var e=fo!==0;return fo=0,e}function Co(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function wo(e){if(co){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}co=!1}oo=0,so=q=K=null,lo=!1,po=fo=0,mo=null}function To(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return so===null?K.memoizedState=so=e:so=so.next=e,so}function Eo(){if(q===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=q.next;var t=so===null?K.memoizedState:so.next;if(t!==null)so=t,q=e;else{if(e===null)throw K.alternate===null?Error(o(467)):Error(o(310));q=e,e={memoizedState:q.memoizedState,baseState:q.baseState,baseQueue:q.baseQueue,queue:q.queue,next:null},so===null?K.memoizedState=so=e:so=so.next=e}return so}function Do(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oo(e){var t=po;return po+=1,mo===null&&(mo=[]),e=xa(mo,e,t),t=K,(so===null?t.memoizedState:so.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Fs:Is),e}function ko(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Oo(e);if(e.$$typeof===S)return Xi(e)}throw Error(o(438,String(e)))}function Ao(e){var t=null,n=K.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=K.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Do(),K.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=O;return t.index++,n}function jo(e,t){return typeof t==`function`?t(e):t}function Mo(e){return No(Eo(),q,e)}function No(e,t,n){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(oo&f)===f:(X&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===oa&&(d=!0);else if((oo&p)===p){u=u.next,p===oa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=a):l=l.next=f,K.lanes|=p,Wl|=p;f=u.action,uo&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,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=a):l=l.next=p,K.lanes|=f,Wl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=a:l.next=c,!_r(a,e.memoizedState)&&($s=!0,d&&(n=sa,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Po(e){var t=Eo(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);_r(a,t.memoizedState)||($s=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Fo(e,t,n){var r=K,i=Eo(),a=W;if(a){if(n===void 0)throw Error(o(407));n=n()}else n=t();var s=!_r((q||i).memoizedState,n);if(s&&(i.memoizedState=n,$s=!0),i=i.queue,os(Ro.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||so!==null&&so.memoizedState.tag&1){if(r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,i,n,t),null),Ll===null)throw Error(o(349));a||oo&127||Io(r,t,n)}return n}function Io(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=Do(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Lo(e,t,n,r){t.value=n,t.getSnapshot=r,zo(t)&&Bo(e)}function Ro(e,t,n){return n(function(){zo(t)&&Bo(e)})}function zo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Bo(e){var t=Qr(e,2);t!==null&&mu(t,e,2)}function Vo(e){var t=To();if(typeof e==`function`){var n=e;if(e=n(),uo){ze(!0);try{n()}finally{ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:e},t}function Ho(e,t,n,r){return e.baseState=n,No(e,q,typeof r==`function`?r:jo)}function Uo(e,t,n,r,i){if(js(e))throw Error(o(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};k.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,Wo(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Wo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=k.T,o={};k.T=o;try{var s=n(i,r),c=k.S;c!==null&&c(o,s),Go(e,t,s)}catch(n){qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),k.T=a}}else try{a=n(i,r),Go(e,t,a)}catch(n){qo(e,t,n)}}function Go(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ko(e,t,n)},function(n){return qo(e,t,n)}):Ko(e,t,n)}function Ko(e,t,n){t.status=`fulfilled`,t.value=n,Jo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Wo(e,n)))}function qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Jo(t),t=t.next;while(t!==r)}e.action=null}function Jo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Yo(e,t){return t}function Xo(e,t){if(W){var n=Ll.formState;if(n!==null){a:{var r=K;if(W){if(ki){b:{for(var i=ki,a=ji;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ki=cf(i.nextSibling),r=i.data===`F!`;break a}}Ni(r)}r=!1}r&&(t=n[0])}}return n=To(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:t},n.queue=r,n=Os.bind(null,K,r),r.dispatch=n,r=Vo(!1),a=As.bind(null,K,!1,r.queue),r=To(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Uo.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Zo(e){return Qo(Eo(),q,e)}function Qo(e,t,n){if(t=No(e,t,Yo)[0],e=Mo(jo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Oo(t)}catch(e){throw e===ga?va:e}else r=t;t=Eo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,ts(9,{destroy:void 0},$o.bind(null,i,n),null)),[r,a,e]}function $o(e,t){e.action=t}function es(e){var t=Eo(),n=q;if(n!==null)return Qo(t,n,e);Eo(),t=t.memoizedState,n=Eo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ts(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=Do(),K.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ns(){return Eo().memoizedState}function rs(e,t,n,r){var i=To();K.flags|=e,i.memoizedState=ts(1|t,{destroy:void 0},n,r===void 0?null:r)}function is(e,t,n,r){var i=Eo();r=r===void 0?null:r;var a=i.memoizedState.inst;q!==null&&r!==null&&_o(r,q.memoizedState.deps)?i.memoizedState=ts(t,a,n,r):(K.flags|=e,i.memoizedState=ts(1|t,a,n,r))}function as(e,t){rs(8390656,8,e,t)}function os(e,t){is(2048,8,e,t)}function ss(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=Do(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function cs(e){var t=Eo().memoizedState;return ss({ref:t,nextImpl:e}),function(){if(J&2)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function ls(e,t){return is(4,2,e,t)}function us(e,t){return is(4,4,e,t)}function ds(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fs(e,t,n){n=n==null?null:n.concat([e]),is(4,4,ds.bind(null,t,e),n)}function ps(){}function ms(e,t){var n=Eo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&_o(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hs(e,t){var n=Eo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&_o(t,r[1]))return r[0];if(r=e(),uo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r}function gs(e,t,n){return n===void 0||oo&1073741824&&!(X&261930)?e.memoizedState=t:(e.memoizedState=n,e=pu(),K.lanes|=e,Wl|=e,n)}function _s(e,t,n,r){return _r(n,t)?n:Ka.current===null?!(oo&42)||oo&1073741824&&!(X&261930)?($s=!0,e.memoizedState=n):(e=pu(),K.lanes|=e,Wl|=e,t):(e=gs(e,n,r),_r(e,t)||($s=!0),e)}function vs(e,t,n,r,i){var a=A.p;A.p=a!==0&&8>a?a:8;var o=k.T,s={};k.T=s,As(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ks(e,t,ua(c,r),fu(e)):ks(e,t,r,fu(e))}catch(n){ks(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{A.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function ys(){}function bs(e,t,n,r){if(e.tag!==5)throw Error(o(476));var i=xs(e).queue;vs(e,i,t,oe,n===null?ys:function(){return Ss(e),n(r)})}function xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:oe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ss(e){var t=xs(e);t.next===null&&(t=e.alternate.memoizedState),ks(e,t.next.queue,{},fu())}function Cs(){return Xi(Qf)}function ws(){return Eo().memoizedState}function Ts(){return Eo().memoizedState}function Es(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=La(n);var r=Ra(t,e,n);r!==null&&(mu(r,t,n),za(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Ds(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?Ms(t,n):(n=Zr(e,t,n,r),n!==null&&(mu(n,e,r),Ns(n,t,r)))}function Os(e,t,n){ks(e,t,n,fu())}function ks(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))Ms(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,_r(s,o))return Xr(e,t,i,0),Ll===null&&Yr(),!1}catch{}if(n=Zr(e,t,i,r),n!==null)return mu(n,e,r),Ns(n,t,r),!0}return!1}function As(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(o(479))}else t=Zr(e,n,r,2),t!==null&&mu(t,e,2)}function js(e){var t=e.alternate;return e===K||t!==null&&t===K}function Ms(e,t){lo=co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ns(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Ps={readContext:Xi,use:ko,useCallback:go,useContext:go,useEffect:go,useImperativeHandle:go,useLayoutEffect:go,useInsertionEffect:go,useMemo:go,useReducer:go,useRef:go,useState:go,useDebugValue:go,useDeferredValue:go,useTransition:go,useSyncExternalStore:go,useId:go,useHostTransitionStatus:go,useFormState:go,useActionState:go,useOptimistic:go,useMemoCache:go,useCacheRefresh:go};Ps.useEffectEvent=go;var Fs={readContext:Xi,use:ko,useCallback:function(e,t){return To().memoizedState=[e,t===void 0?null:t],e},useContext:Xi,useEffect:as,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),rs(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var n=To();t=t===void 0?null:t;var r=e();if(uo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=To();if(n!==void 0){var i=n(t);if(uo){ze(!0);try{n(t)}finally{ze(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ds.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=To();return e={current:e},t.memoizedState=e},useState:function(e){e=Vo(e);var t=e.queue,n=Os.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ps,useDeferredValue:function(e,t){return gs(To(),e,t)},useTransition:function(){var e=Vo(!1);return e=vs.bind(null,K,e.queue,!0,!1),To().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,i=To();if(W){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Ll===null)throw Error(o(349));X&127||Io(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,as(Ro.bind(null,r,a,e),[e]),r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,a,n,t),null),n},useId:function(){var e=To(),t=Ll.identifierPrefix;if(W){var n=Si,r=xi;n=(r&~(1<<32-Be(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=fo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=ho++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Cs,useFormState:Xo,useActionState:Xo,useOptimistic:function(e){var t=To();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=As.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ao,useCacheRefresh:function(){return To().memoizedState=Es.bind(null,K)},useEffectEvent:function(e){var t=To(),n={impl:e};return t.memoizedState=n,function(){if(J&2)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Is={readContext:Xi,use:ko,useCallback:ms,useContext:Xi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Mo,useRef:ns,useState:function(){return Mo(jo)},useDebugValue:ps,useDeferredValue:function(e,t){return _s(Eo(),q.memoizedState,e,t)},useTransition:function(){var e=Mo(jo)[0],t=Eo().memoizedState;return[typeof e==`boolean`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){return Ho(Eo(),q,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Is.useEffectEvent=cs;var Ls={readContext:Xi,use:ko,useCallback:ms,useContext:Xi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Po,useRef:ns,useState:function(){return Po(jo)},useDebugValue:ps,useDeferredValue:function(e,t){var n=Eo();return q===null?gs(n,e,t):_s(n,q.memoizedState,e,t)},useTransition:function(){var e=Po(jo)[0],t=Eo().memoizedState;return[typeof e==`boolean`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:es,useActionState:es,useOptimistic:function(e,t){var n=Eo();return q===null?(n.baseState=e,[e,n.queue.dispatch]):Ho(n,q,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Ls.useEffectEvent=cs;function Rs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fu(),i=La(r);i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(mu(t,e,r),za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fu(),i=La(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(mu(t,e,r),za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fu(),r=La(n);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,n),t!==null&&(mu(t,e,n),za(t,e,n))}};function Bs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!vr(n,r)||!vr(i,a):!0}function Vs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&zs.enqueueReplaceState(t,t.state,null)}function Hs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Us(e){Gr(e)}function Ws(e){console.error(e)}function Gs(e){Gr(e)}function Ks(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function qs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){Ks(e,t)},n}function Ys(e){return e=La(e),e.tag=3,e}function Xs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){qs(t,n,r),typeof i!=`function`&&(nu===null?nu=new Set([this]):nu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Zs(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&qi(t,n,i,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Qa===null?Eu():n.alternate===null&&Ul===0&&(Ul=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,i)),!1;case 22:return n.flags|=65536,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,i)),!1}throw Error(o(435,n.tag))}return Wu(e,r,i),Eu(),!1}if(W)return t=Za.current,t===null?(r!==Mi&&(t=Error(o(423),{cause:r}),zi(pi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=pi(r,n),i=Js(e.stateNode,r,i),Ba(e,i),Ul!==4&&(Ul=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Mi&&(e=Error(o(422),{cause:r}),zi(pi(e,n)))),!1;var a=Error(o(520),{cause:r});if(a=pi(a,n),Yl===null?Yl=[a]:Yl.push(a),Ul!==4&&(Ul=2),t===null)return!0;r=pi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Js(n.stateNode,r,e),Ba(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(nu===null||!nu.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Ys(i),Xs(i,e,n,r),Ba(n,i),!1}n=n.return}while(n!==null);return!1}var Qs=Error(o(461)),$s=!1;function ec(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function tc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Yi(t),r=vo(e,t,n,o,a,i),s=So(),e!==null&&!$s?(Co(e,t,i),Tc(e,t,i)):(W&&s&&Ti(t),t.flags|=1,ec(e,t,r,i),t.child)}function nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,rc(e,t,a,r,i)):(e=si(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ec(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return Tc(e,t,i)}return t.flags|=1,e=ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref)if($s=!1,t.pendingProps=r=a,Ec(e,i))e.flags&131072&&($s=!0);else return t.lanes=e.lanes,Tc(e,t,i)}return dc(e,t,n,r,i)}function ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return oc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ma(t,a===null?null:a.cachePool),a===null?Ya():Ja(t,a),to(t);else return r=t.lanes=536870912,oc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ma(t,null),Ya(),no(t)):(ma(t,a.cachePool),Ja(t,a),no(t),t.memoizedState=null);return ec(e,t,i,n),t.child}function ac(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function oc(e,t,n,r,i){var a=pa();return a=a===null?null:{parent:G._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ma(t,null),Ya(),to(t),e!==null&&qi(e,t,r,!0),t.childLanes=i,null}function sc(e,t){return t=bc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cc(e,t,n){return Ma(t,e.child,null,n),e=sc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function lc(e,t,n){var r=t.pendingProps,i=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(W){if(r.mode===`hidden`)return e=sc(t,r),t.lanes=536870912,ac(null,e);if(eo(t),(e=ki)?(e=rf(e,ji),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Ni(t);return t.lanes=536870912,null}return sc(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(eo(t),i)if(t.flags&256)t.flags&=-257,t=cc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if($s||qi(e,t,n,!1),i=(n&e.childLanes)!==0,$s||i){if(r=Ll,r!==null&&(s=tt(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,Qr(e,s),mu(r,e,s),Qs;Eu(),t=cc(e,t,n)}else e=a.treeContext,ki=cf(s.nextSibling),Oi=t,W=!0,Ai=null,ji=!1,e!==null&&Di(t,e),t=sc(t,r),t.flags|=4096;return t}return e=ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function dc(e,t,n,r,i){return Yi(t),n=vo(e,t,n,r,void 0,i),r=So(),e!==null&&!$s?(Co(e,t,i),Tc(e,t,i)):(W&&r&&Ti(t),t.flags|=1,ec(e,t,n,i),t.child)}function fc(e,t,n,r,i,a){return Yi(t),t.updateQueue=null,n=bo(t,r,n,i),yo(e),r=So(),e!==null&&!$s?(Co(e,t,a),Tc(e,t,a)):(W&&r&&Ti(t),t.flags|=1,ec(e,t,n,a),t.child)}function pc(e,t,n,r,i){if(Yi(t),t.stateNode===null){var a=ti,o=n.contextType;typeof o==`object`&&o&&(a=Xi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=zs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Fa(t),o=n.contextType,a.context=typeof o==`object`&&o?Xi(o):ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Rs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&zs.enqueueReplaceState(a,a.state,null),Ua(t,r,a,i),Ha(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Hs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ti,typeof u==`object`&&u&&(o=Xi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Vs(t,a,r,o),Pa=!1;var f=t.memoizedState;a.state=f,Ua(t,r,a,i),Ha(),l=t.memoizedState,s||f!==l||Pa?(typeof d==`function`&&(Rs(t,n,d,r),l=t.memoizedState),(c=Pa||Bs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ia(e,t),o=t.memoizedProps,u=Hs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ti,typeof l==`object`&&l&&(c=Xi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Vs(t,a,r,c),Pa=!1,f=t.memoizedState,a.state=f,Ua(t,r,a,i),Ha();var p=t.memoizedState;o!==d||f!==p||Pa||e!==null&&e.dependencies!==null&&Ji(e.dependencies)?(typeof s==`function`&&(Rs(t,n,s,r),p=t.memoizedState),(u=Pa||Bs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ji(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,uc(e,t),r=(t.flags&128)!=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)):ec(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Tc(e,t,i),e}function mc(e,t,n,r){return Li(),t.flags|=256,ec(e,t,n,r),t.child}var hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:ha()}}function _c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ql),e}function vc(e,t,n){var r=t.pendingProps,i=!1,a=(t.flags&128)!=0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(io.current&2)!=0),s&&(i=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(W){if(i?$a(t):no(t),(e=ki)?(e=rf(e,ji),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Ni(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(no(t),i=t.mode,c=bc({mode:`hidden`,children:c},i),r=ci(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(null,r)):($a(t),yc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(a)t.flags&256?($a(t),t.flags&=-257,t=xc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,i=t.mode,r=bc({mode:`visible`,children:r.children},i),c=ci(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ma(t,e.child,null,n),r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,t=ac(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(o(419)),r.stack=``,r.digest=s,zi({value:r,source:null,stack:null}),t=xc(e,t,n)}else if($s||qi(e,t,n,!1),s=(n&e.childLanes)!==0,$s||s){if(s=Ll,s!==null&&(r=tt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Qr(e,r),mu(s,e,r),Qs;af(c)||Eu(),t=xc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ki=cf(c.nextSibling),Oi=t,W=!0,Ai=null,ji=!1,e!==null&&Di(t,e),t=yc(t,r.children),t.flags|=4096);return t}return i?(no(t),c=r.fallback,i=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,i,n,null),c.flags|=2):c=ai(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ac(null,r),r=t.child,c=e.child.memoizedState,c===null?c=gc(n):(i=c.cachePool,i===null?i=ha():(l=G._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(e.child,r)):($a(t),n=e.child,e=n.sibling,n=ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function yc(e,t){return t=bc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function bc(e,t){return e=ri(22,e,null,t),e.lanes=0,e}function xc(e,t,n){return Ma(t,e.child,null,n),e=yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gi(e.return,t,n)}function Cc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function wc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,M(io,o),ec(e,t,r,n),r=W?_i:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Sc(e,n,t);else if(e.tag===19)Sc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ao(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ao(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cc(t,!0,n,null,a,r);break;case`together`:Cc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Tc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ec(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Ji(e))):!0}function Dc(e,t,n){switch(t.tag){case 3:me(t,t.stateNode.containerInfo),Ui(t,G,e.memoizedState.cache),Li();break;case 27:case 5:ge(t);break;case 4:me(t,t.stateNode.containerInfo);break;case 10:Ui(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($a(t),e=Tc(e,t,n),e===null?null:e.sibling):vc(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return wc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),M(io,io.current),r)break;return null;case 22:return t.lanes=0,ic(e,t,n,t.pendingProps);case 24:Ui(t,G,e.memoizedState.cache)}return Tc(e,t,n)}function Oc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)$s=!0;else{if(!Ec(e,n)&&!(t.flags&128))return $s=!1,Dc(e,t,n);$s=!!(e.flags&131072)}else $s=!1,W&&t.flags&1048576&&wi(t,_i,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Sa(t.elementType),t.type=e,typeof e==`function`)ii(e)?(r=Hs(e,r),t.tag=1,t=pc(null,t,e,r,n)):(t.tag=0,t=dc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===C){t.tag=11,t=tc(null,t,e,r,n);break a}else if(i===T){t.tag=14,t=nc(null,t,e,r,n);break a}}throw t=ie(e)||e,Error(o(306,t,``))}}return t;case 0:return dc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Hs(r,t.pendingProps),pc(e,t,r,i,n);case 3:a:{if(me(t,t.stateNode.containerInfo),e===null)throw Error(o(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,Ia(e,t),Ua(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ui(t,G,r),r!==a.cache&&Ki(t,[G],n,!0),Ha(),r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=mc(e,t,r,n);break a}else if(r!==i){i=pi(Error(o(424)),t),zi(i),t=mc(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(ki=cf(e.firstChild),Oi=t,W=!0,Ai=null,ji=!0,n=Na(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Li(),r===i){t=Tc(e,t,n);break a}ec(e,t,r,n)}t=t.child}return t;case 26:return uc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:W||(n=t.type,e=t.pendingProps,r=Bd(fe.current).createElement(n),r[st]=t,r[ct]=e,Pd(r,n,e),yt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ge(t),e===null&&W&&(r=t.stateNode=ff(t.type,t.pendingProps,fe.current),Oi=t,ji=!0,i=ki,Zd(t.type)?(lf=i,ki=cf(r.firstChild)):ki=i),ec(e,t,t.pendingProps.children,n),uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&W&&((i=r=ki)&&(r=tf(r,t.type,t.pendingProps,ji),r===null?i=!1:(t.stateNode=r,Oi=t,ki=cf(r.firstChild),ji=!1,i=!0)),i||Ni(t)),ge(t),i=t.type,a=t.pendingProps,s=e===null?null:e.memoizedProps,r=a.children,Ud(i,a)?r=null:s!==null&&Ud(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=vo(e,t,xo,null,null,n),Qf._currentValue=i),uc(e,t),ec(e,t,r,n),t.child;case 6:return e===null&&W&&((e=n=ki)&&(n=nf(n,t.pendingProps,ji),n===null?e=!1:(t.stateNode=n,Oi=t,ki=null,e=!0)),e||Ni(t)),null;case 13:return vc(e,t,n);case 4:return me(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):ec(e,t,r,n),t.child;case 11:return tc(e,t,t.type,t.pendingProps,n);case 7:return ec(e,t,t.pendingProps,n),t.child;case 8:return ec(e,t,t.pendingProps.children,n),t.child;case 12:return ec(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ui(t,t.type,r.value),ec(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Yi(t),i=Xi(i),r=r(i),t.flags|=1,ec(e,t,r,n),t.child;case 14:return nc(e,t,t.type,t.pendingProps,n);case 15:return rc(e,t,t.type,t.pendingProps,n);case 19:return wc(e,t,n);case 31:return lc(e,t,n);case 22:return ic(e,t,n,t.pendingProps);case 24:return Yi(t),r=Xi(G),e===null?(i=pa(),i===null&&(i=Ll,a=na(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},Fa(t),Ui(t,G,i)):((e.lanes&n)!==0&&(Ia(e,t),Ua(t,null,null,n),Ha()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,Ui(t,G,r),r!==i.cache&&Ki(t,[G],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ui(t,G,r))),ec(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function kc(e){e.flags|=4}function Ac(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(Cu())e.flags|=8192;else throw Ca=ya,_a}else e.flags&=-16777217}function jc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Cu())e.flags|=8192;else throw Ca=ya,_a}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:F(),e.lanes|=t,Jl|=t)}function Nc(e,t){if(!W)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Fc(e,t,n){var r=t.pendingProps;switch(Ei(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pc(t),null;case 1:return Pc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Wi(G),he(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ii(t)?kc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ri())),Pc(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(kc(t),a===null?(Pc(t),Ac(t,i,null,r,n)):(Pc(t),jc(t,a))):a?a===e.memoizedState?(Pc(t),t.flags&=-16777217):(kc(t),Pc(t),jc(t,a)):(e=e.memoizedProps,e!==r&&kc(t),Pc(t),Ac(t,i,e,r,n)),null;case 27:if(_e(t),n=fe.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return Pc(t),null}e=ue.current,Ii(t)?Pi(t,e):(e=ff(i,r,n),t.stateNode=e,kc(t))}return Pc(t),null;case 5:if(_e(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return Pc(t),null}if(a=ue.current,Ii(t))Pi(t,a);else{var s=Bd(fe.current);switch(a){case 1:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=s.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}a[st]=t,a[ct]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)a.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=a;a:switch(Pd(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&kc(t)}}return Pc(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(o(166));if(e=fe.current,Ii(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Oi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[st]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Ni(t,!0)}else e=Bd(e).createTextNode(r),e[st]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ii(t),n!==null){if(e===null){if(!r)throw Error(o(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(557));e[st]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=Ri(),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(o(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Ii(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(o(317));i[st]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),i=!1}else i=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)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,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Mc(t,t.updateQueue),Pc(t),null);case 4:return he(),e===null&&xd(t.stateNode.containerInfo),Pc(t),null;case 10:return Wi(t.type),Pc(t),null;case 19:if(le(io),r=t.memoizedState,r===null)return Pc(t),null;if(i=(t.flags&128)!=0,a=r.rendering,a===null)if(i)Nc(r,!1);else{if(Ul!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=ao(e),a!==null){for(t.flags|=128,Nc(r,!1),e=a.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oi(n,e),n=n.sibling;return M(io,io.current&1|2),W&&Ci(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ke()>eu&&(t.flags|=128,i=!0,Nc(r,!1),t.lanes=4194304)}else{if(!i)if(e=ao(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!a.alternate&&!W)return Pc(t),null}else 2*ke()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,i=!0,Nc(r,!1),t.lanes=4194304);r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}return r.tail===null?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ke(),e.sibling=null,n=io.current,M(io,i?n&1|2:n&1),W&&Ci(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Mc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&le(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Wi(G),Pc(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Ic(e,t){switch(Ei(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wi(G),he(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(o(340));Li()}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(o(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(io),null;case 4:return he(),null;case 10:return Wi(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&le(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wi(G),null;case 25:return null;default:return null}}function Lc(e,t){switch(Ei(t),t.tag){case 3:Wi(G),he();break;case 26:case 27:case 5:_e(t);break;case 4:he();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:le(io);break;case 10:Wi(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&le(fa);break;case 24:Wi(G)}}function Rc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Q(t,t.return,e)}}function zc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Q(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Q(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){Q(e,e.return,t)}}}function Vc(e,t,n){n.props=Hs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Q(e,t,n)}}function Hc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Q(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Q(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Q(e,t,n)}else n.current=null}function Wc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Q(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[ct]=t}catch(t){Q(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[st]=e,t[ct]=n}catch(t){Q(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,el=typeof WeakSet==`function`?WeakSet:Set,tl=null;function nl(e,t){if(e=e.containerInfo,Rd=sp,e=Sr(e),Cr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.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||i!==0&&f.nodeType!==3||(c=s+i),f!==a||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===i&&(c=s),p===a&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,tl=t;tl!==null;)if(t=tl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,tl=e;else for(;tl!==null;){switch(t=tl,a=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++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&a!==null){e=void 0,n=t,i=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var h=Hs(n.type,i);e=r.getSnapshotBeforeUpdate(h,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Q(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,tl=e;break}tl=t.return}}function rl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&Rc(5,n);break;case 1:if(vl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Q(n,n.return,e)}else{var i=Hs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Q(n,n.return,e)}}r&64&&Bc(n),r&512&&Hc(n,n.return);break;case 3:if(vl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ga(e,t)}catch(e){Q(n,n.return,e)}}break;case 27:t===null&&r&4&&Xc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Wc(n),r&512&&Hc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ll(e,n);break;case 13:vl(e,n),r&4&&ul(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Zc,!r){t=t!==null&&t.memoizedState!==null||Qc,i=Zc;var a=Qc;Zc=r,(Qc=t)&&!a?bl(e,n,(n.subtreeFlags&8772)!=0):vl(e,n),Zc=i,Qc=a}break;case 30:break;default:vl(e,n)}}function il(e){var t=e.alternate;t!==null&&(e.alternate=null,il(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ht(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var al=null,ol=!1;function sl(e,t,n){for(n=n.child;n!==null;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(Re&&typeof Re.onCommitFiberUnmount==`function`)try{Re.onCommitFiberUnmount(Le,n)}catch{}switch(n.tag){case 26:Qc||Uc(n,t),sl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Qc||Uc(n,t);var r=al,i=ol;Zd(n.type)&&(al=n.stateNode,ol=!1),sl(e,t,n),pf(n.stateNode),al=r,ol=i;break;case 5:Qc||Uc(n,t);case 6:if(r=al,i=ol,al=null,sl(e,t,n),al=r,ol=i,al!==null)if(ol)try{(al.nodeType===9?al.body:al.nodeName===`HTML`?al.ownerDocument.body:al).removeChild(n.stateNode)}catch(e){Q(n,t,e)}else try{al.removeChild(n.stateNode)}catch(e){Q(n,t,e)}break;case 18:al!==null&&(ol?(e=al,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(al,n.stateNode));break;case 4:r=al,i=ol,al=n.stateNode.containerInfo,ol=!0,sl(e,t,n),al=r,ol=i;break;case 0:case 11:case 14:case 15:zc(2,n,t),Qc||zc(4,n,t),sl(e,t,n);break;case 1:Qc||(Uc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Vc(n,t,r)),sl(e,t,n);break;case 21:sl(e,t,n);break;case 22:Qc=(r=Qc)||n.memoizedState!==null,sl(e,t,n),Qc=r;break;default:sl(e,t,n)}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Q(t,t.return,e)}}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Q(t,t.return,e)}}function dl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new el),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new el),t;default:throw Error(o(435,e.tag))}}function fl(e,t){var n=dl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function pl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],a=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){al=c.stateNode,ol=!1;break a}break;case 5:al=c.stateNode,ol=!1;break a;case 3:case 4:al=c.stateNode.containerInfo,ol=!0;break a}c=c.return}if(al===null)throw Error(o(160));cl(a,s,i),al=null,ol=!1,a=i.alternate,a!==null&&(a.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hl(t,e),t=t.sibling}var ml=null;function hl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pl(t,e),gl(e),r&4&&(zc(3,e,e.return),Rc(3,e),zc(5,e,e.return));break;case 1:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&64&&Zc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=ml;if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&4){var a=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,i=i.ownerDocument||i;b:switch(r){case`title`:a=i.getElementsByTagName(`title`)[0],(!a||a[mt]||a[st]||a.namespaceURI===`http://www.w3.org/2000/svg`||a.hasAttribute(`itemprop`))&&(a=i.createElement(r),i.head.insertBefore(a,i.querySelector(`head > title`))),Pd(a,r,n),a[st]=e,yt(a),r=a;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(a=s[c],a.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&a.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&a.getAttribute(`title`)===(n.title==null?null:n.title)&&a.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}a=i.createElement(r),Pd(a,r,n),i.head.appendChild(a);break;case`meta`:if(s=Vf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(a=s[c],a.getAttribute(`content`)===(n.content==null?null:``+n.content)&&a.getAttribute(`name`)===(n.name==null?null:n.name)&&a.getAttribute(`property`)===(n.property==null?null:n.property)&&a.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}a=i.createElement(r),Pd(a,r,n),i.head.appendChild(a);break;default:throw Error(o(468,r))}a[st]=e,yt(a),r=a}e.stateNode=r}else Hf(i,e.type,e.stateNode);else e.stateNode=If(i,r,e.memoizedProps);else a===r?r===null&&e.stateNode!==null&&Gc(e,e.memoizedProps,n.memoizedProps):(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?Hf(i,e.type,e.stateNode):If(i,r,e.memoizedProps))}break;case 27:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),n!==null&&r&4&&Gc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),e.flags&32){i=e.stateNode;try{Ht(i,``)}catch(t){Q(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,Gc(e,i,n===null?i:n.memoizedProps)),r&1024&&($c=!0);break;case 6:if(pl(t,e),gl(e),r&4){if(e.stateNode===null)throw Error(o(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Q(e,e.return,t)}}break;case 3:if(Bf=null,i=ml,ml=gf(t.containerInfo),pl(t,e),ml=i,gl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Q(e,e.return,t)}$c&&($c=!1,_l(e));break;case 4:r=ml,ml=gf(e.stateNode.containerInfo),pl(t,e),gl(e),ml=r;break;case 12:pl(t,e),gl(e);break;case 31:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 13:pl(t,e),gl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ql=ke()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Zc,d=Qc;if(Zc=u||i,Qc=d||l,pl(t,e),Qc=d,Zc=u,gl(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||Zc||Qc||yl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(a=l.stateNode,i)s=a.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Q(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){Q(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?$d(m,!0):$d(l.stateNode,!1)}catch(e){Q(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,fl(e,n))));break;case 19:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 30:break;case 21:break;default:pl(t,e),gl(e)}}function gl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kc(r)){n=r;break}r=r.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var i=n.stateNode;Yc(e,qc(e),i);break;case 5:var a=n.stateNode;n.flags&32&&(Ht(a,``),n.flags&=-33),Yc(e,qc(e),a);break;case 3:case 4:var s=n.stateNode.containerInfo;Jc(e,qc(e),s);break;default:throw Error(o(161))}}catch(t){Q(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rl(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zc(4,t,t.return),yl(t);break;case 1:Uc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Vc(t,t.return,n),yl(t);break;case 27:pf(t.stateNode);case 26:case 5:Uc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=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:bl(i,a,n),Rc(4,a);break;case 1:if(bl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Q(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Wa(c[i],s)}catch(e){Q(r,r.return,e)}}n&&o&64&&Bc(a),Hc(a,a.return);break;case 27:Xc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Wc(a),Hc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ll(i,a);break;case 13:bl(i,a,n),n&&o&4&&ul(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Hc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ra(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&Rc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e)));break;case 12:if(i&2048){Cl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Q(t,t.return,e)}}else Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Cl(e,t,n,r):El(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=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:Tl(a,o,s,c,i),Rc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):El(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function El(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:El(n,r),i&2048&&xl(r.alternate,r);break;case 24:El(n,r),i&2048&&Sl(r.alternate,r);break;default:El(n,r)}t=t.sibling}}var Dl=8192;function Ol(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)kl(e,t,n),e=e.sibling}function kl(e,t,n){switch(e.tag){case 26:Ol(e,t,n),e.flags&Dl&&e.memoizedState!==null&&Gf(n,ml,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,n);break;case 3:case 4:var r=ml;ml=gf(e.stateNode.containerInfo),Ol(e,t,n),ml=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Dl,Dl=16777216,Ol(e,t,n),Dl=r):Ol(e,t,n));break;default:Ol(e,t,n)}}function Al(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ml(e),e=e.sibling}function Ml(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&zc(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nl(e)):jl(e);break;default:jl(e)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zc(8,t,t.return),Nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nl(t));break;default:Nl(t)}e=e.sibling}}function Pl(e,t){for(;tl!==null;){var n=tl;switch(n.tag){case 0:case 11:case 15:zc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,tl=r;else a:for(n=e;tl!==null;){r=tl;var i=r.sibling,a=r.return;if(il(r),r===n){tl=null;break a}if(i!==null){i.return=a,tl=i;break a}tl=a}}}var Fl={getCacheForType:function(e){var t=Xi(G),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Xi(G).controller.signal}},Il=typeof WeakMap==`function`?WeakMap:Map,J=0,Ll=null,Y=null,X=0,Z=0,Rl=null,zl=!1,Bl=!1,Vl=!1,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=null,Xl=null,Zl=!1,Ql=0,$l=0,eu=1/0,tu=null,nu=null,ru=0,iu=null,au=null,ou=0,su=0,cu=null,lu=null,uu=0,du=null;function fu(){return J&2&&X!==0?X&-X:k.T===null?it():ud()}function pu(){if(ql===0)if(!(X&536870912)||W){var e=Ge;Ge<<=1,!(Ge&3932160)&&(Ge=262144),ql=e}else ql=536870912;return e=Za.current,e!==null&&(e.flags|=32),ql}function mu(e,t,n){(e===Ll&&(Z===2||Z===9)||e.cancelPendingCommit!==null)&&(xu(e,0),vu(e,X,ql,!1)),Qe(e,n),(!(J&2)||e!==Ll)&&(e===Ll&&(!(J&2)&&(Gl|=n),Ul===4&&vu(e,X,ql,!1)),nd(e))}function hu(e,t,n){if(J&6)throw Error(o(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ye(e,t),i=r?ku(e,t):Du(e,t,!0),a=r;do{if(i===0){Bl&&!r&&vu(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!_u(n)){i=Du(e,t,!1),a=!1;continue}if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)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;i=Yl;var l=c.current.memoizedState.isDehydrated;if(l&&(xu(c,s).flags|=256),s=Du(c,s,!1),s!==2){if(Vl&&!l){c.errorRecoveryDisabledLanes|=a,Gl|=a,i=4;break a}a=Xl,Xl=i,a!==null&&(Xl===null?Xl=a:Xl.push.apply(Xl,a))}i=s}if(a=!1,i!==2)continue}}if(i===1){xu(e,0),vu(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:vu(r,t,ql,!zl);break a;case 2:Xl=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=Ql+300-ke(),10<i)){if(vu(r,t,ql,!zl),Je(r,0,!0)!==0)break a;ou=t,r.timeoutHandle=Kd(gu.bind(null,r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,a,`Throttled`,-0,0),i);break a}gu(r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,a,null,-0,0)}}break}while(1);nd(e)}function gu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt},kl(t,a,d);var m=(a&62914560)===a?Ql-ke():(a&4194048)===a?$l-ke():0;if(m=qf(d,m),m!==null){ou=a,e.cancelPendingCommit=m(Iu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),vu(e,a,o,!l);return}}Iu(e,t,a,n,r,i,o,s,c)}function _u(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!_r(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function vu(e,t,n,r){t&=~Kl,t&=~Gl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Be(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&$e(e,n,t)}function yu(){return J&6?!0:(rd(0,!1),!1)}function bu(){if(Y!==null){if(Z===0)var e=Y.return;else e=Y,Hi=Vi=null,wo(e),Ea=null,Da=0,e=Y;for(;e!==null;)Lc(e.alternate,e),e=e.return;Y=null}}function xu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ou=0,bu(),Ll=e,Y=n=ai(e.current,null),X=t,Z=0,Rl=null,zl=!1,Bl=Ye(e,t),Vl=!1,Jl=ql=Kl=Gl=Wl=Ul=0,Xl=Yl=null,Zl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Be(r),a=1<<i;t|=e[i],r&=~a}return Hl=t,Yr(),n}function Su(e,t){K=null,k.H=Ps,t===ga||t===va?(t=wa(),Z=3):t===_a?(t=wa(),Z=4):Z=t===Qs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Rl=t,Y===null&&(Ul=1,Ks(e,pi(t,e.current)))}function Cu(){var e=Za.current;return e===null?!0:(X&4194048)===X?Qa===null:(X&62914560)===X||X&536870912?e===Qa:!1}function wu(){var e=k.H;return k.H=Ps,e===null?Ps:e}function Tu(){var e=k.A;return k.A=Fl,e}function Eu(){Ul=4,zl||(X&4194048)!==X&&Za.current!==null||(Bl=!0),!(Wl&134217727)&&!(Gl&134217727)||Ll===null||vu(Ll,X,ql,!1)}function Du(e,t,n){var r=J;J|=2;var i=wu(),a=Tu();(Ll!==e||X!==t)&&(tu=null,xu(e,t)),t=!1;var o=Ul;a:do try{if(Z!==0&&Y!==null){var s=Y,c=Rl;switch(Z){case 8:bu(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=Z;if(Z=0,Rl=null,Nu(e,s,c,l),n&&Bl){o=0;break a}break;default:l=Z,Z=0,Rl=null,Nu(e,s,c,l)}}Ou(),o=Ul;break}catch(t){Su(e,t)}while(1);return t&&e.shellSuspendCounter++,Hi=Vi=null,J=r,k.H=i,k.A=a,Y===null&&(Ll=null,X=0,Yr()),o}function Ou(){for(;Y!==null;)ju(Y)}function ku(e,t){var n=J;J|=2;var r=wu(),i=Tu();Ll!==e||X!==t?(tu=null,eu=ke()+500,xu(e,t)):Bl=Ye(e,t);a:do try{if(Z!==0&&Y!==null){t=Y;var a=Rl;b:switch(Z){case 1:Z=0,Rl=null,Nu(e,t,a,1);break;case 2:case 9:if(ba(a)){Z=0,Rl=null,Mu(t);break}t=function(){Z!==2&&Z!==9||Ll!==e||(Z=7),nd(e)},a.then(t,t);break a;case 3:Z=7;break a;case 4:Z=5;break a;case 7:ba(a)?(Z=0,Rl=null,Mu(t)):(Z=0,Rl=null,Nu(e,t,a,7));break;case 5:var s=null;switch(Y.tag){case 26:s=Y.memoizedState;case 5:case 27:var c=Y;if(s?Wf(s):c.stateNode.complete){Z=0,Rl=null;var l=c.sibling;if(l!==null)Y=l;else{var u=c.return;u===null?Y=null:(Y=u,Pu(u))}break b}}Z=0,Rl=null,Nu(e,t,a,5);break;case 6:Z=0,Rl=null,Nu(e,t,a,6);break;case 8:bu(),Ul=6;break a;default:throw Error(o(462))}}Au();break}catch(t){Su(e,t)}while(1);return Hi=Vi=null,k.H=r,k.A=i,J=n,Y===null?(Ll=null,X=0,Yr(),Ul):0}function Au(){for(;Y!==null&&!De();)ju(Y)}function ju(e){var t=Oc(e.alternate,e,Hl);e.memoizedProps=e.pendingProps,t===null?Pu(e):Y=t}function Mu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fc(n,t,t.pendingProps,t.type,void 0,X);break;case 11:t=fc(n,t,t.pendingProps,t.type.render,t.ref,X);break;case 5:wo(t);default:Lc(n,t),t=Y=oi(t,Hl),t=Oc(n,t,Hl)}e.memoizedProps=e.pendingProps,t===null?Pu(e):Y=t}function Nu(e,t,n,r){Hi=Vi=null,wo(t),Ea=null,Da=0;var i=t.return;try{if(Zs(e,i,t,n,X)){Ul=1,Ks(e,pi(n,e.current)),Y=null;return}}catch(t){if(i!==null)throw Y=i,t;Ul=1,Ks(e,pi(n,e.current)),Y=null;return}t.flags&32768?(W||r===1?e=!0:Bl||X&536870912?e=!1:(zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fu(t,e)):Pu(t)}function Pu(e){var t=e;do{if(t.flags&32768){Fu(t,zl);return}e=t.return;var n=Fc(t.alternate,t,Hl);if(n!==null){Y=n;return}if(t=t.sibling,t!==null){Y=t;return}Y=t=e}while(t!==null);Ul===0&&(Ul=5)}function Fu(e,t){do{var n=Ic(e.alternate,e);if(n!==null){n.flags&=32767,Y=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Y=e;return}Y=e=n}while(e!==null);Ul=6,Y=null}function Iu(e,t,n,r,i,a,s,c,l){e.cancelPendingCommit=null;do Vu();while(ru!==0);if(J&6)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(a=t.lanes|t.childLanes,a|=Jr,I(e,n,a,s,c,l),e===Ll&&(Y=Ll=null,X=0),au=t,iu=e,ou=n,su=a,cu=i,lu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(Ne,function(){return Hu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=k.T,k.T=null,i=A.p,A.p=2,s=J,J|=4;try{nl(e,t,n)}finally{J=s,A.p=i,k.T=r}}ru=1,Lu(),Ru(),zu()}}function Lu(){if(ru===1){ru=0;var e=iu,t=au,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=J;J|=4;try{hl(t,e);var a=zd,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=br(s,h),v=br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{J=i,A.p=r,k.T=n}}e.current=t,ru=2}}function Ru(){if(ru===2){ru=0;var e=iu,t=au,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=J;J|=4;try{rl(e,t.alternate,t)}finally{J=i,A.p=r,k.T=n}}ru=3}}function zu(){if(ru===4||ru===3){ru=0,Oe();var e=iu,t=au,n=ou,r=lu;t.subtreeFlags&10256||t.flags&10256?ru=5:(ru=0,au=iu=null,Bu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(nu=null),rt(n),t=t.stateNode,Re&&typeof Re.onCommitFiberRoot==`function`)try{Re.onCommitFiberRoot(Le,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=k.T,i=A.p,A.p=2,k.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{k.T=t,A.p=i}}ou&3&&Vu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===du?uu++:(uu=0,du=e):uu=0,rd(0,!1)}}function Bu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Vu(){return Lu(),Ru(),zu(),Hu()}function Hu(){if(ru!==5)return!1;var e=iu,t=su;su=0;var n=rt(ou),r=k.T,i=A.p;try{A.p=32>n?32:n,k.T=null,n=cu,cu=null;var a=iu,s=ou;if(ru=0,au=iu=null,ou=0,J&6)throw Error(o(331));var c=J;if(J|=4,Ml(a.current),wl(a,a.current,s,n),J=c,rd(0,!1),Re&&typeof Re.onPostCommitFiberRoot==`function`)try{Re.onPostCommitFiberRoot(Le,a)}catch{}return!0}finally{A.p=i,k.T=r,Bu(e,t)}}function Uu(e,t,n){t=pi(n,t),t=Js(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(Qe(e,2),nd(e))}function Q(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=pi(n,e),n=Ys(2),r=Ra(t,n,2),r!==null&&(Xs(n,r,t,e),Qe(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Il;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Vl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ll===e&&(X&n)===n&&(Ul===4||Ul===3&&(X&62914560)===X&&300>ke()-Ql?!(J&2)&&xu(e,0):Kl|=n,Jl===X&&(Jl=0)),nd(e)}function Ku(e,t){t===0&&(t=F()),e=Qr(e,t),e!==null&&(Qe(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return Te(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Be(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=X,a=Je(r,r===Ll?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ye(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=ke(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}ru!==0&&ru!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Be(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Xe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ll,n=X,n=Je(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Z===2||Z===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ee(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ye(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ee(r),rt(n)){case 2:case 8:n=Me;break;case 32:n=Ne;break;case 268435456:n=P;break;default:n=Ne}return r=sd.bind(null,e),n=Te(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ee(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(ru!==0&&ru!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Vu()&&e.callbackNode!==n)return null;var r=X;return r=Je(e,e===Ll?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(hu(e,r,t),od(e,ke()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Vu())return null;hu(e,t,!0)}function ld(){Yd(function(){J&6?Te(je,id):ad()})}function ud(){if(td===0){var e=oa;e===0&&(e=We,We<<=1,!(We&261888)&&(We=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Yt(``+e)}function fd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[ct]||null).action),o=r.submitter;o&&(t=(t=o[ct]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new _n(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);bs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),bs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Ur.length;md++){var hd=Ur[md];Wr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Wr(Fr,`onAnimationEnd`),Wr(Ir,`onAnimationIteration`),Wr(Lr,`onAnimationStart`),Wr(`dblclick`,`onDoubleClick`),Wr(`focusin`,`onFocus`),Wr(`focusout`,`onBlur`),Wr(Rr,`onTransitionRun`),Wr(zr,`onTransitionStart`),Wr(Br,`onTransitionCancel`),Wr(Vr,`onTransitionEnd`),Ct(`onMouseEnter`,[`mouseout`,`mouseover`]),Ct(`onMouseLeave`,[`mouseout`,`mouseover`]),Ct(`onPointerEnter`,[`pointerout`,`pointerover`]),Ct(`onPointerLeave`,[`pointerout`,`pointerover`]),St(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),St(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),St(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),St(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=(t&4)!=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){Gr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[ut];n===void 0&&(n=t[ut]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,bt.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!sn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Cd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=L(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}nn(function(){var r=a,i=Qt(n),o=[];a:{var s=Hr.get(e);if(s!==void 0){var l=_n,u=e;switch(e){case`keypress`:if(fn(n)===0)break a;case`keydown`:case`keyup`:l=Pn;break;case`focusin`:u=`focus`,l=Tn;break;case`focusout`:u=`blur`,l=Tn;break;case`beforeblur`:case`afterblur`:l=Tn;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=Cn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=In;break;case Fr:case Ir:case Lr:l=En;break;case Vr:l=Ln;break;case`scroll`:case`scrollend`:l=yn;break;case`wheel`:l=Rn;break;case`copy`:case`cut`:case`paste`:l=Dn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Fn;break;case`toggle`:case`beforetoggle`:l=zn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;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(wd(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,s&&n!==Zt&&(u=n.relatedTarget||n.fromElement)&&(L(u)||u[lt]))break a;if((l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?L(u):null,u!==null&&(f=c(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Cn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Fn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?s:_t(l),h=u==null?s:_t(u),s=new d(g,m+`leave`,l,n,i),s.target=f,s.relatedTarget=h,g=null,L(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(o,s,l,d,!1),u!==null&&f!==null&&Dd(o,f,u,d,!0)}}a:{if(s=r?_t(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var v=ar;else if($n(s))if(or)v=hr;else{v=pr;var y=fr}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&Kt(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){er(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Rt(s,`number`,s.value)}switch(y=r?_t(r):window,e){case`focusin`:($n(y)||y.contentEditable===`true`)&&(Tr=y,Er=r,Dr=null);break;case`focusout`:Dr=Er=Tr=null;break;case`mousedown`:Or=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Or=!1,kr(o,n,i);break;case`selectionchange`:if(wr)break;case`keydown`:case`keyup`:kr(o,n,i)}var b;if(Vn)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 Yn?qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Wn&&n.locale!==`ko`&&(Yn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Yn&&(b=H()):(ln=i,un=`value`in ln?ln.value:ln.textContent,Yn=!0)),y=Td(r,x),0<y.length&&(x=new On(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=Jn(n),b!==null&&(x.data=b)))),(b=Un?Xn(e,n):Zn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new On(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),pd(o,e,r,n,i)}vd(o,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=rn(e,n),i!=null&&r.unshift(wd(e,i,a)),i=rn(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=rn(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=rn(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
|
|
10
|
-
`).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,i,a){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ht(e,``+r);break;case`className`:Ot(e,`class`,r);break;case`tabIndex`:Ot(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ot(e,n,r);break;case`style`:Gt(e,r,a);break;case`data`:if(t!==`object`){Ot(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof a==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,i.name,i,null),Md(e,t,`formEncType`,i.formEncType,i,null),Md(e,t,`formMethod`,i.formMethod,i,null),Md(e,t,`formTarget`,i.formTarget,i,null)):(Md(e,t,`encType`,i.encType,i,null),Md(e,t,`method`,i.method,i,null),Md(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Yt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),R(e,`popover`,r);break;case`xlinkActuate`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:R(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=qt.get(n)||n,R(e,n,r))}}function Nd(e,t,n,r,i,a){switch(n){case`style`:Gt(e,r,a);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ht(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!xt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),a=e[ct]||null,a=a==null?null:a[n],typeof a==`function`&&e.removeEventListener(t,a,i),typeof r==`function`)){typeof a!=`function`&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):R(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:Md(e,t,a,s,n,null)}}i&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=a=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(o(137,t));break;default:Md(e,t,r,d,n,null)}}Lt(e,a,c,l,u,s,i,!1);return;case`select`:for(i in $(`invalid`,e),r=s=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Md(e,t,i,c,n,null)}t=a,n=s,e.multiple=!!r,t==null?n!=null&&zt(e,!!r,n,!0):zt(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(o(91));break;default:Md(e,t,s,c,n,null)}Vt(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:Md(e,t,u,r,n,null)}return;default:if(Kt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Md(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:a=m;break;case`name`:i=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(o(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}It(e,s,c,l,u,d,a,i);return;case`select`:for(a in m=s=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||Md(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:p=a;break;case`defaultValue`:c=a;break;case`multiple`:s=a;default:a!==l&&Md(e,t,i,a,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?zt(e,!!n,n?[]:``,!1):zt(e,!!n,t,!0)):zt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Md(e,t,c,null,r,i)}for(s in r)if(i=r[s],a=n[s],r.hasOwnProperty(s)&&(i!=null||a!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(o(91));break;default:i!==a&&Md(e,t,s,i,r,a)}Bt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Md(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Md(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(o(137,t));break;default:Md(e,t,u,p,r,m)}return;default:if(Kt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),ht(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[mt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(o(452));return e;case`head`:if(e=t.head,!e)throw Error(o(453));return e;case`body`:if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ht(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=A.d;A.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=yu();return e||t}function yf(e){var t=gt(e);t!==null&&t.tag===5&&t.type===`form`?Ss(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Ft(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ft(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ft(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ft(n.imageSizes)+`"]`)):i+=`[href="`+Ft(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ft(r)+`"][href="`+Ft(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),yt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=vt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);yt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=vt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),yt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=vt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),yt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=fe.current)?gf(i):null;if(!i)throw Error(o(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=vt(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var a=vt(i).hoistableStyles,s=a.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=i.querySelector(jf(e)))&&!a._p&&(s.instance=a,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),a||Nf(i,e,n,s.state))),t&&r===null)throw Error(o(528,``));return s}if(t&&r!==null)throw Error(o(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=vt(i).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(o(444,e))}}function Af(e){return`href="`+Ft(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),yt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Ft(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ft(n.href)+`"]`);if(r)return t.instance=r,yt(r),r;var i=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),yt(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var a=e.querySelector(jf(i));if(a)return t.state.loading|=4,t.instance=a,yt(a),a;r=Mf(n),(i=mf.get(i))&&Rf(r,i),a=(e.ownerDocument||e).createElement(`link`),yt(a);var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(a,`link`,r),t.state.loading|=4,Lf(a,n.precedence,e),t.instance=a;case`script`:return a=Pf(n.src),(i=e.querySelector(Ff(a)))?(t.instance=i,yt(i),i):(r=n,(i=mf.get(a))&&(r=m({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),yt(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(o(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[mt]||a[st]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,yt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),yt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:S,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ri(3,null,null,t),e.current=a,a.stateNode=e,t=na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Fa(a),e}function tp(e){return e?(e=ti,e):ti}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=La(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ra(e,r,t),n!==null&&(mu(n,e,t),za(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=Qr(e,67108864);t!==null&&mu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=fu();t=nt(t);var n=Qr(e,t);n!==null&&mu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=2,up(e,t,n,r)}finally{A.p=a,k.T=i}}function lp(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=8,up(e,t,n,r)}finally{A.p=a,k.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=gt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=qe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Be(o);s.entanglements[1]|=c,o&=~c}nd(a),!(J&6)&&(eu=ke()+500,rd(0,!1))}}break;case 31:case 13:s=Qr(a,2),s!==null&&mu(s,a,2),yu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=Qt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=L(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l(t),e!==null)return e;e=null}else if(n===31){if(e=u(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ae()){case je:return 2;case Me:return 8;case Ne:case Pe:return 32;case P:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=gt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=L(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=l(n),t!==null){e.blockedOn=t,at(e.priority,function(){op(n)});return}}else if(t===31){if(t=u(n),t!==null){e.blockedOn=t,at(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Zt=r,n.target.dispatchEvent(r),Zt=null}else return t=gt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=gt(n);a!==null&&(e.splice(t,3),t-=3,bs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ct]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ct]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current;np(n,fu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),yu(),t[lt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=it();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.7`)throw Error(o(527,Lp,`19.2.7`));A.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(o(188)):(e=Object.keys(e).join(`,`),Error(o(268,e)));return e=f(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:k,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Le=zp.inject(Rp),Re=zp}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(o(299));var n=!1,r=``,i=Us,a=Ws,c=Gs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,i,a,c,Pp),e[lt]=t.current,xd(e),new Fp(t)}})),sn=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=on()})),cn=class extends ct{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new ee({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=ln(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=ln(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=ln(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=ln(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){S.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Oe(t,e))}findAll(e={}){return this.getAll().filter(t=>Oe(e,t))}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return S.batch(()=>Promise.all(e.map(e=>e.continue().catch(Ae))))}};function ln(e){return e.options.scope?.id}var un=class extends ct{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??te(r,t),a=this.get(i);return a||(a=new xe({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){S.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ee(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Ee(e,t)):t}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){S.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){S.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},dn=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new un,this.#t=e.mutationCache||new cn,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=gt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Ce.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(s(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=ne(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return S.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;S.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return S.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=S.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Ae).catch(Ae)}invalidateQueries(e,t={}){return S.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=S.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Ae)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Ae)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(s(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ae).catch(Ae)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ae).catch(Ae)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Ce.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(pt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{fe(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(pt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{fe(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=te(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Ue&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},H=a(i(),1),fn=sn();function pn(e,t){if(e===`ping`)return{project:null,event:{type:`ping`}};let n;try{n=JSON.parse(t)}catch{return null}if(!mn(n))return null;let r=n.project;if(typeof r!=`string`||r===``)return null;switch(e){case`run`:{let{project:e,...t}=n;return hn(t)?{project:r,event:{type:`run`,run:t}}:null}case`run-deleted`:{let e=n.id;return typeof e==`string`&&e?{project:r,event:{type:`run-deleted`,id:e}}:null}case`todos`:return Array.isArray(n.items)?{project:r,event:{type:`todos`,items:n.items}}:null;case`usage`:return mn(n.usage)?{project:r,event:{type:`usage`,usage:n.usage}}:null;default:return null}}function mn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function hn(e){return mn(e)&&typeof e.id==`string`&&e.id!==``}function gn(e,t){if(!e)return;let n=e.findIndex(e=>e.id===t.id);if(n>=0){let r=[...e];return r[n]=vn(e[n],t),r}let r=t.createdAt??``,i=e.findIndex(e=>(e.createdAt??``).localeCompare(r)<0),a=[...e];return a.splice(i<0?e.length:i,0,t),a}function _n(e,t){if(!e)return;let n=e.filter(e=>e.id!==t);return n.length===e.length?e:n}function vn(e,t){return e?.usage?{...t,usage:e.usage}:t}var yn=Object.freeze({});function bn(){let e=yn,t=new Set;return{subscribe(e){return t.add(e),()=>t.delete(e)},get:()=>e,set(n){e=n;for(let e of t)e()}}}var U=e(),xn=`/api/workspace/events`,Sn=2,Cn=3e3,wn=[`run`,`run-deleted`,`todos`,`usage`,`ping`],Tn=[`project-added`,`project-removed`,`checkout-progress`,`automation-change`],En=new Set;function Dn(e){return En.add(e),()=>{En.delete(e)}}function On(e){e.invalidateQueries({queryKey:c.runs.all}),e.invalidateQueries({queryKey:c.todos}),e.invalidateQueries({queryKey:c.health}),e.invalidateQueries({queryKey:c.worktrees}),e.invalidateQueries({queryKey:N.providerStatus})}function kn(e){return At()??e.getQueryData(c.health)?.bootProject}function An(e,t,n){switch(n.type){case`run`:{e.setQueryData(c.runs.list(),e=>gn(e,n.run));let t=c.runs.detail(n.run.id);e.getQueryData(t)!==void 0&&e.setQueryData(t,e=>vn(e,n.run));let r=c.runs.changes(n.run.id);e.getQueryData(r)!==void 0&&e.invalidateQueries({queryKey:r}),e.invalidateQueries({queryKey:c.worktrees});return}case`run-deleted`:e.setQueryData(c.runs.list(),e=>_n(e,n.id)),e.removeQueries({queryKey:c.runs.detail(n.id)}),e.removeQueries({queryKey:c.runs.diff(n.id)}),e.invalidateQueries({queryKey:c.worktrees});return;case`todos`:e.setQueryData(c.todos,n.items);return;case`usage`:t.set(n.usage);return;case`ping`:return}}function jn(e,t=xn){let n=Se();(0,H.useEffect)(()=>{let r=globalThis.EventSource;if(typeof r!=`function`)return;let i=null,a,o=!1,s=!1,c=!1,l=!1,u=()=>{c=!0,l=!1;let e=N.providerStatus;n.cancelQueries({queryKey:e,exact:!0}).then(()=>n.invalidateQueries({queryKey:e,exact:!0,refetchType:`active`})).finally(()=>{if(s||!l){c=!1;return}u()})},d=()=>{s||a!==void 0||(a=setTimeout(()=>{a=void 0,s||f()},Cn))},f=()=>{i?.close(),i=new r(t,{withCredentials:!0}),i.addEventListener(`open`,()=>{o&&On(n),o=!0});for(let t of wn)i.addEventListener(t,r=>{let i=pn(t,r.data);i&&(i.project!==null&&i.project!==kn(n)||An(n,e,i.event))});for(let e of Tn)i.addEventListener(e,t=>{let r;try{r=JSON.parse(t.data)}catch{return}e!==`checkout-progress`&&e!==`automation-change`&&n.invalidateQueries({queryKey:N.projects});for(let t of[...En])t(e,r)});i.addEventListener(`provider-status`,e=>{let t;try{t=JSON.parse(e.data)}catch{return}let r=ge(t);if(!r)return;let i=N.providerStatus,a=Et(n.getQueryData(i),r);if(a!==void 0){n.setQueryData(i,a);return}if(c){l=!0;return}u()}),i.addEventListener(`error`,()=>{i?.readyState===Sn&&d()})},p=()=>{document.visibilityState===`visible`&&(On(n),(!i||i.readyState===Sn)&&(clearTimeout(a),a=void 0,f()))},m=()=>{clearTimeout(a),a=void 0,i?.close()},h=e=>{e.persisted&&(On(n),f())};return document.addEventListener(`visibilitychange`,p),window.addEventListener(`pagehide`,m),window.addEventListener(`pageshow`,h),f(),()=>{s=!0,clearTimeout(a),document.removeEventListener(`visibilitychange`,p),window.removeEventListener(`pagehide`,m),window.removeEventListener(`pageshow`,h),i?.close(),i=null}},[n,e,t])}var Mn=(0,H.createContext)(null);function Nn({children:e}){let[t]=(0,H.useState)(bn);return jn(t),be(),(0,U.jsx)(Mn.Provider,{value:t,children:e})}function Pn(e){let t=(0,H.useContext)(Mn),n=t?t.get:In;return(0,H.useSyncExternalStore)(t?t.subscribe:Fn,()=>e?n()[e]:void 0,()=>void 0)}var Fn=()=>()=>void 0,In=()=>yn;function Ln(){return new dn({defaultOptions:{queries:{refetchInterval:!1,staleTime:5*6e4,gcTime:30*6e4,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:(e,t)=>t instanceof y&&t.status>=400&&t.status<500?!1:e<1},mutations:{retry:!1}}})}var Rn=z(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),zn=z(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Bn=z(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Vn=z(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),Hn=z(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Un=z(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Wn=z(`bookmark`,[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]),Gn=z(`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`}]]),Kn=z(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),qn=z(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Jn=z(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Yn=z(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Xn=z(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),Zn=z(`corner-left-up`,[[`path`,{d:`M14 9 9 4 4 9`,key:`1af5af`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]),Qn=z(`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`}]]),$n=z(`file-cog`,[[`path`,{d:`M15 8a1 1 0 0 1-1-1V2a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8z`,key:`1ckgky`}],[`path`,{d:`M20 8v12a2 2 0 0 1-2 2h-4.182`,key:`1726p0`}],[`path`,{d:`m3.305 19.53.923-.382`,key:`ao1pio`}],[`path`,{d:`M4 10.592V4a2 2 0 0 1 2-2h8`,key:`1foop0`}],[`path`,{d:`m4.228 16.852-.924-.383`,key:`1fv9zy`}],[`path`,{d:`m5.852 15.228-.383-.923`,key:`1a9hc2`}],[`path`,{d:`m5.852 20.772-.383.924`,key:`1sh9ke`}],[`path`,{d:`m8.148 15.228.383-.923`,key:`4yu6lf`}],[`path`,{d:`m8.53 21.696-.382-.924`,key:`18b0s9`}],[`path`,{d:`m9.773 16.852.922-.383`,key:`ti6xop`}],[`path`,{d:`m9.773 19.148.922.383`,key:`rws47d`}],[`circle`,{cx:`7`,cy:`18`,r:`3`,key:`lvkj7j`}]]),er=z(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 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.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),tr=z(`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`}]]),nr=z(`folder-search`,[[`path`,{d:`M10.7 20H4a2 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.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),rr=z(`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`}]]),ir=z(`folders`,[[`path`,{d:`M20 5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h2.5a1.5 1.5 0 0 1 1.2.6l.6.8a1.5 1.5 0 0 0 1.2.6z`,key:`a4852j`}],[`path`,{d:`M3 8.268a2 2 0 0 0-1 1.738V19a2 2 0 0 0 2 2h11a2 2 0 0 0 1.732-1`,key:`yxbcw3`}]]),ar=z(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),or=z(`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`}]]),sr=z(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),cr=z(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),lr=z(`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`}]]),ur=z(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),dr=z(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),fr=z(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),pr=z(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),mr=z(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),hr=z(`notebook-pen`,[[`path`,{d:`M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4`,key:`re6nr2`}],[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`path`,{d:`M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`pqwjuv`}]]),gr=z(`package-check`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`m16 17 2 2 4-4`,key:`uh5qu3`}],[`path`,{d:`M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753`,key:`kpkbpo`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),_r=z(`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`}]]),vr=z(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),yr=z(`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`}]]),br=z(`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`}]]),xr=z(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Sr=z(`scale`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]),Cr=z(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),wr=z(`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`}]]),Tr=z(`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`}]]),Er=z(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Dr=z(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Or=z(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),kr=z(`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`}]]);function Ar(e){let t=e+`CollectionProvider`,[n,r]=Ie(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=H.useRef(null),a=H.useRef(new Map).current;return(0,U.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=St(s),l=H.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=_(t,a(s,n).collectionRef);return(0,U.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=St(u),p=H.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=H.useRef(null),s=_(t,o),c=a(u,n);return H.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,U.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return H.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var jr=H.createContext(void 0);function Mr(e){let t=H.useContext(jr);return e||t||`ltr`}var Nr=`AlertDialog`,[Pr,Fr]=Ie(Nr,[zt]),Ir=zt(),Lr=e=>{let{__scopeAlertDialog:t,...n}=e,r=Ir(t);return(0,U.jsx)(Wt,{...r,...n,modal:!0})};Lr.displayName=Nr;var Rr=`AlertDialogTrigger`,zr=H.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Ir(n);return(0,U.jsx)(Lt,{...i,...r,ref:t})});zr.displayName=Rr;var Br=`AlertDialogPortal`,Vr=e=>{let{__scopeAlertDialog:t,...n}=e,r=Ir(t);return(0,U.jsx)(Vt,{...r,...n})};Vr.displayName=Br;var Hr=`AlertDialogOverlay`,Ur=H.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Ir(n);return(0,U.jsx)(It,{...i,...r,ref:t})});Ur.displayName=Hr;var Wr=`AlertDialogContent`,[Gr,Kr]=Pr(Wr),qr=H.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=Ir(n),o=_(t,H.useRef(null)),s=H.useRef(null);return(0,U.jsx)(Gr,{scope:n,cancelRef:s,children:(0,U.jsx)(Ht,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:R(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})});qr.displayName=Wr;var Jr=`AlertDialogTitle`,Yr=H.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Ir(n);return(0,U.jsx)(Ut,{...i,...r,ref:t})});Yr.displayName=Jr;var Xr=`AlertDialogDescription`,Zr=H.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Ir(n);return(0,U.jsx)(Rt,{...i,...r,ref:t})});Zr.displayName=Xr;var Qr=`AlertDialogAction`,$r=H.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Ir(n);return(0,U.jsx)(Bt,{...i,...r,ref:t})});$r.displayName=Qr;var ei=`AlertDialogCancel`,ti=H.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Kr(ei,n),a=Ir(n),o=_(t,i);return(0,U.jsx)(Bt,{...a,...r,ref:o})});ti.displayName=ei;var ni=Lr,ri=Vr,ii=Ur,ai=qr,oi=$r,si=ti,ci=Yr,li=Zr;function ui(e){let t=H.useRef({value:e,previous:e});return H.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function di(e){let[t,n]=H.useState(void 0);return yt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var fi=[`top`,`right`,`bottom`,`left`],pi=Math.min,mi=Math.max,hi=Math.round,gi=Math.floor,_i=e=>({x:e,y:e}),vi={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function yi(e,t,n){return mi(e,pi(t,n))}function bi(e,t){return typeof e==`function`?e(t):e}function xi(e){return e.split(`-`)[0]}function Si(e){return e.split(`-`)[1]}function Ci(e){return e===`x`?`y`:`x`}function wi(e){return e===`y`?`height`:`width`}function Ti(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ei(e){return Ci(Ti(e))}function Di(e,t,n){n===void 0&&(n=!1);let r=Si(e),i=Ei(e),a=wi(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Fi(o)),[o,Fi(o)]}function Oi(e){let t=Fi(e);return[ki(e),t,ki(t)]}function ki(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var W=[`left`,`right`],Ai=[`right`,`left`],ji=[`top`,`bottom`],Mi=[`bottom`,`top`];function Ni(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ai:W:t?W:Ai;case`left`:case`right`:return t?ji:Mi;default:return[]}}function Pi(e,t,n,r){let i=Si(e),a=Ni(xi(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ki)))),a}function Fi(e){let t=xi(e);return vi[t]+e.slice(t.length)}function Ii(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Li(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ii(e)}function Ri(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function zi(e,t,n){let{reference:r,floating:i}=e,a=Ti(t),o=Ei(t),s=wi(o),c=xi(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Si(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Bi(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=bi(t,e),p=Li(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ri(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Ri(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Vi=50,Hi=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Bi},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=zi(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Vi&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=zi(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ui=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=bi(e,t)||{};if(l==null)return{};let d=Li(u),f={x:n,y:r},p=Ei(i),m=wi(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,ee=C/2-h[m]/2-1,T=pi(d[_],ee),E=pi(d[v],ee),D=C-h[m]-E,O=C/2-h[m]/2+w,te=yi(T,O,D),ne=!c.arrow&&Si(i)!=null&&O!==te&&a.reference[m]/2-(O<T?T:E)-h[m]/2<0,re=ne?O<T?O-T:O-D:0;return{[p]:f[p]+re,data:{[p]:te,centerOffset:O-te-re,...ne&&{alignmentOffset:re}},reset:ne}}}),Wi=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=bi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=xi(r),_=Ti(o),v=xi(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Fi(o)]:Oi(o)),x=p!==`none`;!d&&x&&b.push(...Pi(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],ee=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Di(r,a,y);w.push(C[e[0]],C[e[1]])}if(ee=[...ee,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Ti(t))||ee.every(e=>Ti(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:ee},reset:{placement:t}};let n=ee.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=ee.filter(e=>{if(x){let t=Ti(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Gi(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ki(e){return fi.some(t=>e[t]>=0)}var qi=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=bi(e,t);switch(i){case`referenceHidden`:{let e=Gi(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ki(e)}}}case`escaped`:{let e=Gi(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ki(e)}}}default:return{}}}}},Ji=new Set([`left`,`top`]);async function Yi(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=xi(n),s=Si(n),c=Ti(n)===`y`,l=Ji.has(o)?-1:1,u=a&&c?-1:1,d=bi(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Xi=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Yi(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Zi=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=bi(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ti(i),p=Ci(f),m=u[p],h=u[f],g=(e,t)=>yi(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Qi=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=bi(e,t),u={x:n,y:r},d=Ti(i),f=Ci(d),p=u[f],m=u[d],h=bi(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ji.has(xi(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},$i=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=bi(e,t),c=await i.detectOverflow(t,s),l=xi(n),u=Si(n),d=Ti(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=pi(p-c[m],g),y=pi(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*mi(c.left,c.right):S=p-2*mi(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function ea(){return typeof window<`u`}function ta(e){return ra(e)?(e.nodeName||``).toLowerCase():`#document`}function G(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function na(e){return((ra(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ra(e){return ea()?e instanceof Node||e instanceof G(e).Node:!1}function ia(e){return ea()?e instanceof Element||e instanceof G(e).Element:!1}function aa(e){return ea()?e instanceof HTMLElement||e instanceof G(e).HTMLElement:!1}function oa(e){return!ea()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof G(e).ShadowRoot}function sa(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=va(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ca(e){return/^(table|td|th)$/.test(ta(e))}function la(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ua=/transform|translate|scale|rotate|perspective|filter/,da=/paint|layout|strict|content/,fa=e=>!!e&&e!==`none`,pa;function ma(e){let t=ia(e)?va(e):e;return fa(t.transform)||fa(t.translate)||fa(t.scale)||fa(t.rotate)||fa(t.perspective)||!ga()&&(fa(t.backdropFilter)||fa(t.filter))||ua.test(t.willChange||``)||da.test(t.contain||``)}function ha(e){let t=ba(e);for(;aa(t)&&!_a(t);){if(ma(t))return t;if(la(t))return null;t=ba(t)}return null}function ga(){return pa??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),pa}function _a(e){return/^(html|body|#document)$/.test(ta(e))}function va(e){return G(e).getComputedStyle(e)}function ya(e){return ia(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ba(e){if(ta(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||oa(e)&&e.host||na(e);return oa(t)?t.host:t}function xa(e){let t=ba(e);return _a(t)?(e.ownerDocument||e).body:aa(t)&&sa(t)?t:xa(t)}function Sa(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=xa(e),i=r===e.ownerDocument?.body,a=G(r);if(i){let e=Ca(a);return t.concat(a,a.visualViewport||[],sa(r)?r:[],e&&n?Sa(e):[])}else return t.concat(r,Sa(r,[],n))}function Ca(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wa(e){let t=va(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=aa(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=hi(n)!==a||hi(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ta(e){return ia(e)?e:e.contextElement}function Ea(e){let t=Ta(e);if(!aa(t))return _i(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=wa(t),o=(a?hi(n.width):n.width)/r,s=(a?hi(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Da=_i(0);function Oa(e){let t=G(e);return!ga()||!t.visualViewport?Da:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ka(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===G(e)}function Aa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ta(e),o=_i(1);t&&(r?ia(r)&&(o=Ea(r)):o=Ea(e));let s=ka(a,n,r)?Oa(a):_i(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=G(a),t=ia(r)?G(r):r,n=e,i=Ca(n);for(;i&&t!==n;){let e=Ea(i),t=i.getBoundingClientRect(),r=va(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=G(i),i=Ca(n)}}return Ri({width:u,height:d,x:c,y:l})}function ja(e,t){let n=ya(e).scrollLeft;return t?t.left+n:Aa(na(e)).left+n}function Ma(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ja(e,n),y:n.top+t.scrollTop}}function Na(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=na(r),s=t?la(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=_i(1),u=_i(0),d=aa(r);if((d||!a)&&((ta(r)!==`body`||sa(o))&&(c=ya(r)),d)){let e=Aa(r);l=Ea(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Ma(o,c):_i(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Pa(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Fa(e){let t=ya(e),n=e.ownerDocument.body,r=mi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=mi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+ja(e),o=-t.scrollTop;return va(n).direction===`rtl`&&(a+=mi(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ia=25;function La(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=G(e),a=na(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ga()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(ja(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Ia&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ra(e,t){let n=Aa(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ea(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function za(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=La(e,n,t);else if(t===`document`)r=Fa(na(e));else if(ia(t))r=Ra(t,n);else{let n=Oa(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ri(r)}function Ba(e,t){let n=t.get(e);if(n)return n;let r=Sa(e,[],!1).filter(e=>ia(e)&&ta(e)!==`body`),i=null,a=va(e).position===`fixed`,o=a?ba(e):e;for(;ia(o)&&!_a(o);){let e=va(o),t=ma(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ba(o)}return t.set(e,r),r}function Va(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?la(t)?[]:Ba(t,this._c):[].concat(n),r],o=za(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=za(t,a[e],i);s=mi(n.top,s),c=pi(n.right,c),l=pi(n.bottom,l),u=mi(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ha(e){let{width:t,height:n}=wa(e);return{width:t,height:n}}function Ua(e,t,n){let r=aa(t),i=na(t),a=n===`fixed`,o=Aa(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=_i(0);if((r||!a)&&((ta(t)!==`body`||sa(i))&&(s=ya(t)),r)){let e=Aa(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=ja(i));let l=i&&!r&&!a?Ma(i,s):_i(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Wa(e){return va(e).position===`static`}function Ga(e,t){if(!aa(e)||va(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return na(e)===n&&(n=n.ownerDocument.body),n}function Ka(e,t){let n=G(e);if(la(e))return n;if(!aa(e)){let t=ba(e);for(;t&&!_a(t);){if(ia(t)&&!Wa(t))return t;t=ba(t)}return n}let r=Ga(e,t);for(;r&&ca(r)&&Wa(r);)r=Ga(r,t);return r&&_a(r)&&Wa(r)&&!ma(r)?n:r||ha(e)||n}var qa=async function(e){let t=this.getOffsetParent||Ka,n=this.getDimensions,r=await n(e.floating);return{reference:Ua(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ja(e){return va(e).direction===`rtl`}var Ya={convertOffsetParentRelativeRectToViewportRelativeRect:Na,getDocumentElement:na,getClippingRect:Va,getOffsetParent:Ka,getElementRects:qa,getClientRects:Pa,getDimensions:Ha,getScale:Ea,isElement:ia,isRTL:Ja};function Xa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Za(e,t,n){let r=null,i,a=na(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=gi(d),h=gi(a.clientWidth-(u+f)),g=gi(a.clientHeight-(d+p)),_=gi(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:mi(0,pi(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Xa(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=G(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Qa(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ta(e),u=i||a?[...l?Sa(l):[],...t?Sa(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Za(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Aa(e):null;c&&g();function g(){let t=Aa(e);h&&!Xa(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var $a=Xi,eo=Zi,to=Wi,no=$i,ro=qi,io=Ui,ao=Qi,oo=(e,t,n)=>{let r=new Map,i=n??{},a={...Ya,...i.platform,_c:r};return Hi(e,t,{...i,platform:a})},K=a(r(),1),q=typeof document<`u`?H.useLayoutEffect:function(){};function so(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!so(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!so(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function co(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lo(e,t){let n=co(e);return Math.round(t*n)/n}function uo(e){let t=H.useRef(e);return q(()=>{t.current=e}),t}function fo(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=H.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=H.useState(r);so(f,r)||p(r);let[m,h]=H.useState(null),[g,_]=H.useState(null),v=H.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=H.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=H.useRef(null),C=H.useRef(null),w=H.useRef(u),ee=c!=null,T=uo(c),E=uo(i),D=uo(l),O=H.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};E.current&&(e.platform=E.current),oo(S.current,C.current,e).then(e=>{let t={...e,isPositioned:D.current!==!1};te.current&&!so(w.current,t)&&(w.current=t,K.flushSync(()=>{d(t)}))})},[f,t,n,E,D]);q(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let te=H.useRef(!1);q(()=>(te.current=!0,()=>{te.current=!1}),[]),q(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(T.current)return T.current(b,x,O);O()}},[b,x,O,T,ee]);let ne=H.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),re=H.useMemo(()=>({reference:b,floating:x}),[b,x]),ie=H.useMemo(()=>{let e={position:n,left:0,top:0};if(!re.floating)return e;let t=lo(re.floating,u.x),r=lo(re.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...co(re.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,re.floating,u.x,u.y]);return H.useMemo(()=>({...u,update:O,refs:ne,elements:re,floatingStyles:ie}),[u,O,ne,re,ie])}var po=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:io({element:r.current,padding:i}).fn(n):r?io({element:r,padding:i}).fn(n):{}}}},mo=(e,t)=>{let n=$a(e);return{name:n.name,fn:n.fn,options:[e,t]}},ho=(e,t)=>{let n=eo(e);return{name:n.name,fn:n.fn,options:[e,t]}},go=(e,t)=>({fn:ao(e).fn,options:[e,t]}),_o=(e,t)=>{let n=to(e);return{name:n.name,fn:n.fn,options:[e,t]}},vo=(e,t)=>{let n=no(e);return{name:n.name,fn:n.fn,options:[e,t]}},yo=(e,t)=>{let n=ro(e);return{name:n.name,fn:n.fn,options:[e,t]}},bo=(e,t)=>{let n=po(e);return{name:n.name,fn:n.fn,options:[e,t]}},xo=`Arrow`,So=H.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,U.jsx)(Tt.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,U.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});So.displayName=xo;var Co=So,wo=`Popper`,[To,Eo]=Ie(wo),[Do,Oo]=To(wo),ko=e=>{let{__scopePopper:t,children:n}=e,[r,i]=H.useState(null),[a,o]=H.useState(void 0);return(0,U.jsx)(Do,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};ko.displayName=wo;var Ao=`PopperAnchor`,jo=H.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Oo(Ao,n),o=H.useRef(null),s=a.onAnchorChange,c=_(t,H.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=H.useRef(null);H.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Vo(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,U.jsx)(Tt.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});jo.displayName=Ao;var Mo=`PopperContent`,[No,Po]=To(Mo),Fo=H.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Oo(Mo,n),[v,y]=H.useState(null),b=_(t,y),[x,S]=H.useState(null),C=di(x),w=C?.width??0,ee=C?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,te={padding:E,boundary:D.filter(zo),altBoundary:O},{refs:ne,floatingStyles:re,placement:ie,isPositioned:ae,middlewareData:k}=fo({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>Qa(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[mo({mainAxis:i+ee,alignmentAxis:o}),c&&ho({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?go():void 0,...te}),c&&_o({...te}),vo({...te,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&bo({element:x,padding:s}),Bo({arrowWidth:w,arrowHeight:ee}),f&&yo({strategy:`referenceHidden`,...te,boundary:O?te.boundary:void 0})]}),A=g.setPlacementState;yt(()=>(A(ie),()=>{A(void 0)}),[ie,A]);let[oe,se]=Vo(ie),ce=it(m);yt(()=>{ae&&ce?.()},[ae,ce]);let j=k.arrow?.x,le=k.arrow?.y,M=k.arrow?.centerOffset!==0,[ue,de]=H.useState();return yt(()=>{v&&de(window.getComputedStyle(v).zIndex)},[v]),(0,U.jsx)(`div`,{ref:ne.setFloating,"data-radix-popper-content-wrapper":``,style:{...re,transform:ae?re.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ue,"--radix-popper-transform-origin":[k.transformOrigin?.x,k.transformOrigin?.y].join(` `),...k.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,U.jsx)(No,{scope:n,placedSide:oe,placedAlign:se,onArrowChange:S,arrowX:j,arrowY:le,shouldHideArrow:M,children:(0,U.jsx)(Tt.div,{"data-side":oe,"data-align":se,...h,ref:b,style:{...h.style,animation:ae?void 0:`none`}})})})});Fo.displayName=Mo;var Io=`PopperArrow`,Lo={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ro=H.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Po(Io,n),a=Lo[i.placedSide];return(0,U.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,U.jsx)(Co,{...r,ref:t,style:{...r.style,display:`block`}})})});Ro.displayName=Io;function zo(e){return e!==null}var Bo=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Vo(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Vo(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Ho=ko,Uo=jo,Wo=Fo,Go=Ro,Ko=!1;function qo(){let[e,t]=H.useState(Ko);return H.useEffect(()=>{Ko||(Ko=!0,t(!0))},[]),e}var Jo=H.useSyncExternalStore;function Yo(){return()=>{}}function Xo(){return Jo(Yo,()=>!0,()=>!1)}var Zo=typeof Jo==`function`?Xo:qo,Qo=`rovingFocusGroup.onEntryFocus`,$o={bubbles:!1,cancelable:!0},es=`RovingFocusGroup`,[ts,ns,rs]=Ar(es),[is,as]=Ie(es,[rs]),[os,ss]=is(es),cs=H.forwardRef((e,t)=>(0,U.jsx)(ts.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,U.jsx)(ts.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,U.jsx)(ls,{...e,ref:t})})}));cs.displayName=es;var ls=H.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=H.useRef(null),p=_(t,f),m=Mr(a),[h,g]=Me({prop:o,defaultProp:s??null,onChange:c,caller:es}),[v,y]=H.useState(!1),b=it(l),x=ns(n),S=H.useRef(!1),[C,w]=H.useState(0);return H.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Qo,b),()=>e.removeEventListener(Qo,b)},[b]),(0,U.jsx)(os,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:H.useCallback(e=>g(e),[g]),onItemShiftTab:H.useCallback(()=>y(!0),[]),onFocusableItemAdd:H.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:H.useCallback(()=>w(e=>e-1),[]),children:(0,U.jsx)(Tt.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:R(e.onMouseDown,()=>{S.current=!0}),onFocus:R(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Qo,$o);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);hs([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:R(e.onBlur,()=>y(!1))})})}),us=`RovingFocusGroupItem`,ds=H.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Ye(),l=a||c,u=ss(us,n),d=u.currentTabStopId===l,f=ns(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Zo();return yt(()=>{if(!(!g||!r))return p(),()=>m()},[g,r,p,m]),H.useEffect(()=>{if(!(g||!r))return p(),()=>m()},[g,r,p,m]),(0,U.jsx)(ts.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,U.jsx)(Tt.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:R(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:R(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:R(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ms(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?gs(n,r+1):n.slice(r+1)}setTimeout(()=>hs(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});ds.displayName=us;var fs={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function ps(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function ms(e,t,n){let r=ps(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return fs[r]}function hs(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function gs(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var _s=cs,vs=ds,ys=[`Enter`,` `],bs=[`ArrowDown`,`PageUp`,`Home`],xs=[`ArrowUp`,`PageDown`,`End`],Ss=[...bs,...xs],Cs={ltr:[...ys,`ArrowRight`],rtl:[...ys,`ArrowLeft`]},ws={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Ts=`Menu`,[Es,Ds,Os]=Ar(Ts),[ks,As]=Ie(Ts,[Os,Eo,as]),js=Eo(),Ms=as(),[Ns,Ps]=ks(Ts),[Fs,Is]=ks(Ts),Ls=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=js(t),[c,l]=H.useState(null),u=H.useRef(!1),d=it(a),f=Mr(i);return H.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),H.useEffect(()=>{if(!n)return;let e=()=>d(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,U.jsx)(Ho,{...s,children:(0,U.jsx)(Ns,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,U.jsx)(Fs,{scope:t,onClose:H.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Ls.displayName=Ts;var Rs=`MenuAnchor`,zs=H.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=js(n);return(0,U.jsx)(Uo,{...i,...r,ref:t})});zs.displayName=Rs;var Bs=`MenuPortal`,[Vs,Hs]=ks(Bs,{forceMount:void 0}),Us=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Ps(Bs,t);return(0,U.jsx)(Vs,{scope:t,forceMount:n,children:(0,U.jsx)(qe,{present:n||a.open,children:(0,U.jsx)(_t,{asChild:!0,container:i,children:r})})})};Us.displayName=Bs;var Ws=`MenuContent`,[Gs,Ks]=ks(Ws),qs=H.forwardRef((e,t)=>{let n=Hs(Ws,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ps(Ws,e.__scopeMenu),o=Is(Ws,e.__scopeMenu);return(0,U.jsx)(Es.Provider,{scope:e.__scopeMenu,children:(0,U.jsx)(qe,{present:r||a.open,children:(0,U.jsx)(Es.Slot,{scope:e.__scopeMenu,children:o.modal?(0,U.jsx)(Js,{...i,ref:t}):(0,U.jsx)(Ys,{...i,ref:t})})})})}),Js=H.forwardRef((e,t)=>{let n=Ps(Ws,e.__scopeMenu),r=H.useRef(null),i=_(t,r);return H.useEffect(()=>{let e=r.current;if(e)return ht(e)},[]),(0,U.jsx)(Zs,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:R(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ys=H.forwardRef((e,t)=>{let n=Ps(Ws,e.__scopeMenu);return(0,U.jsx)(Zs,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Xs=St(`MenuContent.ScrollLock`),Zs=H.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Ps(Ws,n),v=Is(Ws,n),y=js(n),b=Ms(n),x=Ds(n),[S,C]=H.useState(null),w=H.useRef(null),ee=_(t,w,g.onContentChange),T=H.useRef(0),E=H.useRef(``),D=H.useRef(0),O=H.useRef(null),te=H.useRef(`right`),ne=H.useRef(0),re=m?ze:H.Fragment,ie=m?{as:Xs,allowPinchZoom:!0}:void 0,ae=e=>{let t=E.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Fc(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};H.useEffect(()=>()=>window.clearTimeout(T.current),[]),nt();let k=H.useCallback(e=>te.current===O.current?.side&&Lc(e,O.current?.area),[]);return(0,U.jsx)(Gs,{scope:n,searchRef:E,onItemEnter:H.useCallback(e=>{k(e)&&e.preventDefault()},[k]),onItemLeave:H.useCallback(e=>{k(e)||(w.current?.focus(),C(null))},[k]),onTriggerLeave:H.useCallback(e=>{k(e)&&e.preventDefault()},[k]),pointerGraceTimerRef:D,onPointerGraceIntentChange:H.useCallback(e=>{O.current=e},[]),children:(0,U.jsx)(re,{...ie,children:(0,U.jsx)(Ve,{asChild:!0,trapped:i,onMountAutoFocus:R(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,U.jsx)(Ge,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,U.jsx)(_s,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:R(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,U.jsx)(Wo,{role:`menu`,"aria-orientation":`vertical`,"data-state":Ac(g.open),"data-radix-menu-content":``,dir:v.dir,...y,...h,ref:ee,style:{outline:`none`,...h.style},onKeyDown:R(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ae(e.key));let i=w.current;if(e.target!==i||!Ss.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);xs.includes(e.key)&&a.reverse(),Nc(a)}),onBlur:R(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:R(e.onPointerMove,Rc(e=>{let t=e.target,n=ne.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>ne.current?`right`:`left`;te.current=t,ne.current=e.clientX}}))})})})})})})});qs.displayName=Ws;var Qs=`MenuGroup`,$s=H.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,U.jsx)(Tt.div,{role:`group`,...r,ref:t})});$s.displayName=Qs;var ec=`MenuLabel`,tc=H.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,U.jsx)(Tt.div,{...r,ref:t})});tc.displayName=ec;var nc=`MenuItem`,rc=`menu.itemSelect`,ic=H.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=H.useRef(null),o=Is(nc,e.__scopeMenu),s=Ks(nc,e.__scopeMenu),c=_(t,a),l=H.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(rc,{bubbles:!0,cancelable:!0});e.addEventListener(rc,e=>r?.(e),{once:!0}),he(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,U.jsx)(ac,{...i,ref:c,disabled:n,onClick:R(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:R(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:R(e.onKeyDown,e=>{n||e.target!==e.currentTarget||s.searchRef.current!==``&&e.key===` `||ys.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});ic.displayName=nc;var ac=H.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Ks(nc,n),s=Ms(n),c=H.useRef(null),l=_(t,c),[u,d]=H.useState(!1),[f,p]=H.useState(``);return H.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,U.jsx)(Es.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,U.jsx)(vs,{asChild:!0,...s,focusable:!r,children:(0,U.jsx)(Tt.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:R(e.onPointerMove,Rc(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:R(e.onPointerLeave,Rc(e=>o.onItemLeave(e))),onFocus:R(e.onFocus,()=>d(!0)),onBlur:R(e.onBlur,()=>d(!1))})})})}),oc=`MenuCheckboxItem`,sc=H.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,U.jsx)(hc,{scope:e.__scopeMenu,checked:n,children:(0,U.jsx)(ic,{role:`menuitemcheckbox`,"aria-checked":jc(n)?`mixed`:n,...i,ref:t,"data-state":Mc(n),onSelect:R(i.onSelect,()=>r?.(jc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});sc.displayName=oc;var cc=`MenuRadioGroup`,[lc,uc]=ks(cc,{value:void 0,onValueChange:()=>{}}),dc=H.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=it(r);return(0,U.jsx)(lc,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,U.jsx)($s,{...i,ref:t})})});dc.displayName=cc;var fc=`MenuRadioItem`,pc=H.forwardRef((e,t)=>{let{value:n,...r}=e,i=uc(fc,e.__scopeMenu),a=n===i.value;return(0,U.jsx)(hc,{scope:e.__scopeMenu,checked:a,children:(0,U.jsx)(ic,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Mc(a),onSelect:R(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});pc.displayName=fc;var mc=`MenuItemIndicator`,[hc,gc]=ks(mc,{checked:!1}),_c=H.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=gc(mc,n);return(0,U.jsx)(qe,{present:r||jc(a.checked)||a.checked===!0,children:(0,U.jsx)(Tt.span,{...i,ref:t,"data-state":Mc(a.checked)})})});_c.displayName=mc;var vc=`MenuSeparator`,yc=H.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,U.jsx)(Tt.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});yc.displayName=vc;var bc=`MenuArrow`,xc=H.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=js(n);return(0,U.jsx)(Go,{...i,...r,ref:t})});xc.displayName=bc;var Sc=`MenuSub`,[Cc,wc]=ks(Sc),Tc=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Ps(Sc,t),o=js(t),[s,c]=H.useState(null),[l,u]=H.useState(null),d=it(i);return H.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,U.jsx)(Ho,{...o,children:(0,U.jsx)(Ns,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,U.jsx)(Cc,{scope:t,contentId:Ye(),triggerId:Ye(),trigger:s,onTriggerChange:c,children:n})})})};Tc.displayName=Sc;var Ec=`MenuSubTrigger`,Dc=H.forwardRef((e,t)=>{let n=Ps(Ec,e.__scopeMenu),r=Is(Ec,e.__scopeMenu),i=wc(Ec,e.__scopeMenu),a=Ks(Ec,e.__scopeMenu),o=H.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=H.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);H.useEffect(()=>u,[u]),H.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=_(t,i.onTriggerChange);return(0,U.jsx)(zs,{asChild:!0,...l,children:(0,U.jsx)(ac,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":Ac(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:R(e.onPointerMove,Rc(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:R(e.onPointerLeave,Rc(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:R(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||a.searchRef.current!==``&&t.key===` `||Cs[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Dc.displayName=Ec;var Oc=`MenuSubContent`,kc=H.forwardRef((e,t)=>{let n=Hs(Ws,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Ps(Ws,e.__scopeMenu),s=Is(Ws,e.__scopeMenu),c=wc(Oc,e.__scopeMenu),l=H.useRef(null),u=_(t,l);return(0,U.jsx)(Es.Provider,{scope:e.__scopeMenu,children:(0,U.jsx)(qe,{present:r||o.open,children:(0,U.jsx)(Es.Slot,{scope:e.__scopeMenu,children:(0,U.jsx)(Zs,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:R(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:R(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:R(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=ws[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});kc.displayName=Oc;function Ac(e){return e?`open`:`closed`}function jc(e){return e===`indeterminate`}function Mc(e){return jc(e)?`indeterminate`:e?`checked`:`unchecked`}function Nc(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Pc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Fc(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Pc(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ic(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Lc(e,t){return t?Ic({x:e.clientX,y:e.clientY},t):!1}function Rc(e){return t=>t.pointerType===`mouse`?e(t):void 0}var zc=Ls,Bc=zs,Vc=Us,Hc=qs,Uc=$s,Wc=tc,Gc=ic,Kc=sc,qc=dc,Jc=pc,Yc=_c,Xc=yc,Zc=xc,Qc=Dc,$c=kc,el=`DropdownMenu`,[tl,nl]=Ie(el,[As]),rl=As(),[il,al]=tl(el),ol=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=rl(t),l=H.useRef(null),[u,d]=Me({prop:i,defaultProp:a??!1,onChange:o,caller:el});return(0,U.jsx)(il,{scope:t,triggerId:Ye(),triggerRef:l,contentId:Ye(),open:u,onOpenChange:d,onOpenToggle:H.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,U.jsx)(zc,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};ol.displayName=el;var sl=`DropdownMenuTrigger`,cl=H.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=al(sl,n),o=rl(n),s=_(t,a.triggerRef);return(0,U.jsx)(Bc,{asChild:!0,...o,children:(0,U.jsx)(Tt.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:R(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:R(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});cl.displayName=sl;var ll=`DropdownMenuPortal`,ul=e=>{let{__scopeDropdownMenu:t,...n}=e,r=rl(t);return(0,U.jsx)(Vc,{...r,...n})};ul.displayName=ll;var dl=`DropdownMenuContent`,fl=H.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=al(dl,n),a=rl(n),o=H.useRef(!1);return(0,U.jsx)(Hc,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:R(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:R(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});fl.displayName=dl;var pl=`DropdownMenuGroup`,ml=H.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=rl(n);return(0,U.jsx)(Uc,{...i,...r,ref:t})});ml.displayName=pl;var hl=`DropdownMenuLabel`,gl=H.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=rl(n);return(0,U.jsx)(Wc,{...i,...r,ref:t})});gl.displayName=hl;var _l=`DropdownMenuItem`,vl=H.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=rl(n);return(0,U.jsx)(Gc,{...i,...r,ref:t})});vl.displayName=_l;var yl=`DropdownMenuCheckboxItem`,bl=H.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=rl(n);return(0,U.jsx)(Kc,{...i,...r,ref:t})});bl.displayName=yl;var xl=`DropdownMenuRadioGroup`,Sl=H.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=rl(n);return(0,U.jsx)(qc,{...i,...r,ref:t})});Sl.displayName=xl;var Cl=`DropdownMenuRadioItem`,wl=H.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=rl(n);return(0,U.jsx)(Jc,{...i,...r,ref:t})});wl.displayName=Cl;var Tl=`DropdownMenuItemIndicator`,El=H.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=rl(n);return(0,U.jsx)(Yc,{...i,...r,ref:t})});El.displayName=Tl;var Dl=`DropdownMenuSeparator`,Ol=H.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=rl(n);return(0,U.jsx)(Xc,{...i,...r,ref:t})});Ol.displayName=Dl;var kl=`DropdownMenuArrow`,Al=H.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=rl(n);return(0,U.jsx)(Zc,{...i,...r,ref:t})});Al.displayName=kl;var jl=`DropdownMenuSubTrigger`,Ml=H.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=rl(n);return(0,U.jsx)(Qc,{...i,...r,ref:t})});Ml.displayName=jl;var Nl=`DropdownMenuSubContent`,Pl=H.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=rl(n);return(0,U.jsx)($c,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Pl.displayName=Nl;var Fl=ol,Il=cl,J=ul,Ll=fl,Y=gl,X=vl,Z=Sl,Rl=wl,zl=El,Bl=Ol,Vl=`Label`,Hl=H.forwardRef((e,t)=>(0,U.jsx)(Tt.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Hl.displayName=Vl;var Ul=Hl,Wl=`Popover`,[Gl,Kl]=Ie(Wl,[Eo]),ql=Eo(),[Jl,Yl]=Gl(Wl),Xl=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=ql(t),c=H.useRef(null),[l,u]=H.useState(!1),[d,f]=Me({prop:r,defaultProp:i??!1,onChange:a,caller:Wl});return(0,U.jsx)(Ho,{...s,children:(0,U.jsx)(Jl,{scope:t,contentId:Ye(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:H.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:H.useCallback(()=>u(!0),[]),onCustomAnchorRemove:H.useCallback(()=>u(!1),[]),modal:o,children:n})})};Xl.displayName=Wl;var Zl=`PopoverAnchor`,Ql=H.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Yl(Zl,n),a=ql(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return H.useEffect(()=>(o(),()=>s()),[o,s]),(0,U.jsx)(Uo,{...a,...r,ref:t})});Ql.displayName=Zl;var $l=`PopoverTrigger`,eu=H.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Yl($l,n),a=ql(n),o=_(t,i.triggerRef),s=(0,U.jsx)(Tt.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":hu(i.open),...r,ref:o,onClick:R(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,U.jsx)(Uo,{asChild:!0,...a,children:s})});eu.displayName=$l;var tu=`PopoverPortal`,[nu,ru]=Gl(tu,{forceMount:void 0}),iu=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Yl(tu,t);return(0,U.jsx)(nu,{scope:t,forceMount:n,children:(0,U.jsx)(qe,{present:n||a.open,children:(0,U.jsx)(_t,{asChild:!0,container:i,children:r})})})};iu.displayName=tu;var au=`PopoverContent`,ou=H.forwardRef((e,t)=>{let n=ru(au,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Yl(au,e.__scopePopover);return(0,U.jsx)(qe,{present:r||a.open,children:a.modal?(0,U.jsx)(cu,{...i,ref:t}):(0,U.jsx)(lu,{...i,ref:t})})});ou.displayName=au;var su=St(`PopoverContent.RemoveScroll`),cu=H.forwardRef((e,t)=>{let n=Yl(au,e.__scopePopover),r=H.useRef(null),i=_(t,r),a=H.useRef(!1);return H.useEffect(()=>{let e=r.current;if(e)return ht(e)},[]),(0,U.jsx)(ze,{as:su,allowPinchZoom:!0,children:(0,U.jsx)(uu,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:R(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:R(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:R(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),lu=H.forwardRef((e,t)=>{let n=Yl(au,e.__scopePopover),r=H.useRef(!1),i=H.useRef(!1);return(0,U.jsx)(uu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),uu=H.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Yl(au,n),p=ql(n);return nt(),(0,U.jsx)(Ve,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,U.jsx)(Ge,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,U.jsx)(Wo,{"data-state":hu(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),du=`PopoverClose`,fu=H.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Yl(du,n);return(0,U.jsx)(Tt.button,{type:`button`,...r,ref:t,onClick:R(e.onClick,()=>i.onOpenChange(!1))})});fu.displayName=du;var pu=`PopoverArrow`,mu=H.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=ql(n);return(0,U.jsx)(Go,{...i,...r,ref:t})});mu.displayName=pu;function hu(e){return e?`open`:`closed`}var gu=Xl,_u=Ql,vu=eu,yu=iu,bu=ou,xu=`Switch`,[Su,Cu]=Ie(xu),[wu,Tu]=Su(xu);function Eu(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Me({prop:n,defaultProp:i??!1,onChange:c,caller:xu}),[m,h]=H.useState(null),[g,_]=H.useState(null),v={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:H.useRef(!1),required:l,defaultChecked:i,isFormControl:!m||!!o||!!m.closest(`form`),bubbleInput:g,setBubbleInput:_};return(0,U.jsx)(wu,{scope:t,...v,children:Pu(d)?d(v):r})}var Du=`SwitchTrigger`,Ou=H.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=Tu(Du,e),h=_(r,u),g=H.useRef(c);return H.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,U.jsx)(Tt.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":Fu(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:h,onClick:R(t,e=>{d(e=>!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});Ou.displayName=Du;var ku=H.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,U.jsx)(Eu,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ou,{...d,ref:t,__scopeSwitch:n}),e&&(0,U.jsx)(Nu,{__scopeSwitch:n})]})})});ku.displayName=xu;var Au=`SwitchThumb`,ju=H.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=Tu(Au,n);return(0,U.jsx)(Tt.span,{"data-state":Fu(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});ju.displayName=Au;var Mu=`SwitchBubbleInput`,Nu=H.forwardRef(({__scopeSwitch:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=Tu(Mu,e),m=_(n,p),h=ui(a),g=di(r);H.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});n.call(e,a),e.dispatchEvent(t)}},[f,h,a,i]);let v=H.useRef(a);return(0,U.jsx)(Tt.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??v.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});Nu.displayName=Mu;function Pu(e){return typeof e==`function`}function Fu(e){return e?`checked`:`unchecked`}var Iu=h(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-destructive-foreground focus-visible:ring-destructive/20 [a&]:hover:bg-destructive/90`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function Lu({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,U.jsx)(n?f:`span`,{"data-slot":`badge`,"data-variant":t,className:B(Iu({variant:t}),e),...r})}function Ru({...e}){return(0,U.jsx)(Wt,{"data-slot":`dialog`,...e})}function zu({...e}){return(0,U.jsx)(Vt,{"data-slot":`dialog-portal`,...e})}function Bu({...e}){return(0,U.jsx)(Bt,{"data-slot":`dialog-close`,...e})}function Vu({className:e,...t}){return(0,U.jsx)(It,{"data-slot":`dialog-overlay`,className:B(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Hu({className:e,children:t,showCloseButton:n=!0,...r}){return(0,U.jsxs)(zu,{"data-slot":`dialog-portal`,children:[(0,U.jsx)(Vu,{}),(0,U.jsxs)(Ht,{"data-slot":`dialog-content`,className:B(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,U.jsxs)(Bt,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,U.jsx)(Pt,{}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Uu({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`dialog-header`,className:B(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function Q({className:e,showCloseButton:t=!1,children:n,...r}){return(0,U.jsxs)(`div`,{"data-slot":`dialog-footer`,className:B(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,U.jsx)(Bt,{asChild:!0,children:(0,U.jsx)(P,{variant:`outline`,children:`Close`})})]})}function Wu({className:e,...t}){return(0,U.jsx)(Ut,{"data-slot":`dialog-title`,className:B(`text-lg leading-none font-semibold`,e),...t})}function Gu({className:e,...t}){return(0,U.jsx)(Rt,{"data-slot":`dialog-description`,className:B(`text-sm text-muted-foreground`,e),...t})}function Ku({open:e,onOpenChange:t}){let[n,r]=(0,H.useState)(null),[i,a]=(0,H.useState)(null),s=T(n),c=De(),l=o(),u=b(),d=new Set((c.data?.projects??[]).map(e=>e.root)),f=e=>{r(e),a(null),l.reset()},p=i?.path??s.data?.path??null,m=s.data?.parent??null;return(0,U.jsx)(Ru,{open:e,onOpenChange:t,children:(0,U.jsxs)(Hu,{"data-slot":`add-project-dialog`,className:`sm:max-w-lg`,children:[(0,U.jsxs)(Uu,{children:[(0,U.jsx)(Wu,{children:`Open local folder`}),(0,U.jsx)(Gu,{children:`Pick the folder cezar should run in. Git repos are marked; any folder works.`})]}),(0,U.jsx)(`p`,{"data-slot":`fs-breadcrumb`,className:`truncate font-mono text-[11.5px] text-soft-foreground`,title:s.data?.path??void 0,children:s.data?.path??(s.isError?``:`Loading…`)}),s.isError?(0,U.jsx)(`p`,{"data-slot":`fs-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:s.error instanceof Error?s.error.message:`could not list that folder`}):(0,U.jsxs)(`ul`,{"data-slot":`fs-listing`,className:`max-h-64 divide-y divide-border/60 overflow-y-auto overscroll-contain rounded-md border border-border`,children:[m===null?null:(0,U.jsx)(`li`,{className:`flex`,children:(0,U.jsxs)(`button`,{type:`button`,"data-slot":`fs-up`,onClick:()=>f(m),className:`flex flex-1 items-center gap-2 px-3 py-2 text-left text-[13px] hover:bg-muted`,children:[(0,U.jsx)(Zn,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),`Up one level`]})}),(s.data?.dirs??[]).map(e=>(0,U.jsxs)(`li`,{className:`flex items-stretch`,children:[(0,U.jsxs)(`button`,{type:`button`,"data-slot":`fs-dir`,"aria-pressed":i?.path===e.path,onClick:()=>a(e),onDoubleClick:()=>f(e.path),className:B(`flex min-w-0 flex-1 items-center gap-2 px-3 py-2 text-left text-[13px] hover:bg-muted`,i?.path===e.path&&`bg-muted`),children:[(0,U.jsx)(rr,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`truncate`,children:e.name}),e.isRepo?(0,U.jsx)(Lu,{variant:`outline`,className:`shrink-0 text-[10px]`,children:`git`}):null,d.has(e.path)?(0,U.jsx)(Lu,{variant:`ghost`,className:`shrink-0 text-[10px] text-muted-foreground`,children:`already added`}):null]}),(0,U.jsx)(`button`,{type:`button`,"data-slot":`fs-enter`,"aria-label":`Open ${e.name}`,onClick:()=>f(e.path),className:`flex shrink-0 items-center px-2.5 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,U.jsx)(qn,{className:`size-3.5`,"aria-hidden":`true`})})]},e.path)),s.data&&s.data.dirs.length===0?(0,U.jsx)(`li`,{className:`px-3 py-2 text-[13px] text-muted-foreground`,children:`No subfolders here — “Add project” registers this folder.`}):null]}),s.data?.truncated?(0,U.jsx)(`p`,{"data-slot":`fs-truncated`,className:`text-[11.5px] text-muted-foreground`,children:`Too many folders to list — only the first ones are shown.`}):null,l.isError?(0,U.jsx)(`p`,{"data-slot":`add-project-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:l.error instanceof Error?l.error.message:`could not add that folder`}):null,(0,U.jsxs)(Q,{className:`min-w-0 sm:items-center sm:justify-between`,children:[(0,U.jsx)(`span`,{"data-slot":`add-project-target`,className:`min-w-0 truncate font-mono text-[11.5px] text-muted-foreground`,title:p??void 0,children:p??``}),(0,U.jsxs)(`span`,{className:`flex shrink-0 gap-2`,children:[(0,U.jsx)(P,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,U.jsx)(P,{"data-slot":`add-project-confirm`,disabled:p===null||l.isPending,onClick:()=>{p===null||l.isPending||l.mutate(p,{onSuccess:({project:e})=>{t(!1),u(`/p/${encodeURIComponent(e.id)}/`)}})},children:l.isPending?`Adding…`:`Add project`})]})]})]})})}function qu({className:e,type:t,...n}){return(0,U.jsx)(`input`,{type:t,"data-slot":`input`,className:B(`h-9 w-full min-w-0 rounded-md border border-input bg-card px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-soft-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20`,e),...n})}function Ju({className:e,...t}){return(0,U.jsx)(Ul,{"data-slot":`label`,className:B(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function Yu({open:e,onOpenChange:t}){let[n,r]=(0,H.useState)(``),[i,a]=(0,H.useState)(``),[o,s]=(0,H.useState)(null),c=De(),l=A(),u=b(),d=(0,H.useMemo)(()=>`co-${Math.random().toString(36).slice(2)}-${Date.now().toString(36)}`,[]),f=(0,H.useRef)(d);f.current=d,(0,H.useEffect)(()=>Dn((e,t)=>{if(e!==`checkout-progress`)return;let n=t;n?.checkoutId===f.current&&(n.phase===`cloning`&&n.line?s(n.line):n.phase!==`cloning`&&s(null))}),[]);let p=(0,H.useMemo)(()=>{let e=n.trim().replace(/\/+$/,``).replace(/\.git$/,``).split(`/`).pop()??``;return e.includes(`:`)?e.split(`:`).pop()??``:e},[n]),m=i.trim()===``?p:i.trim(),h=c.data?.projectsDir??``,_=m===``?``:`${h.replace(/\/+$/,``)}/${m}`,v=()=>{n.trim()===``||l.isPending||(s(null),l.mutate({url:n.trim(),checkoutId:d,...i.trim()===``?{}:{name:i.trim()}},{onSuccess:({project:e})=>{t(!1),u(`/p/${encodeURIComponent(e.id)}/`)}}))};return(0,U.jsx)(Ru,{open:e,onOpenChange:e=>l.isPending?void 0:t(e),children:(0,U.jsxs)(Hu,{"data-slot":`clone-project-dialog`,className:`sm:max-w-lg`,children:[(0,U.jsxs)(Uu,{children:[(0,U.jsx)(Wu,{children:`Clone from GitHub`}),(0,U.jsxs)(Gu,{children:[`cezar clones with `,(0,U.jsx)(`code`,{children:`gh`}),` into your checkout root and adds the result as a project.`]})]}),(0,U.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,U.jsx)(Ju,{htmlFor:`clone-url`,children:`Repository`}),(0,U.jsx)(qu,{id:`clone-url`,"data-slot":`clone-url`,autoFocus:!0,placeholder:`owner/repo or https://github.com/owner/repo`,value:n,disabled:l.isPending,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&v()}})]}),(0,U.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,U.jsx)(Ju,{htmlFor:`clone-name`,children:`Folder name`}),(0,U.jsx)(qu,{id:`clone-name`,"data-slot":`clone-name`,placeholder:p===``?`repo`:p,value:i,disabled:l.isPending,onChange:e=>a(e.target.value)}),(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,U.jsx)(`p`,{"data-slot":`clone-target`,className:`min-w-0 flex-1 truncate font-mono text-[11.5px] text-soft-foreground`,title:_,children:_}),l.isPending?(0,U.jsx)(P,{"data-slot":`clone-root-settings`,variant:`ghost`,size:`icon-sm`,className:`size-7`,"aria-label":`Edit checkout root`,title:`Edit checkout root`,disabled:!0,children:(0,U.jsx)(wr,{className:`size-3.5`,"aria-hidden":`true`})}):(0,U.jsx)(P,{asChild:!0,variant:`ghost`,size:`icon-sm`,className:`size-7`,children:(0,U.jsx)(g,{to:`/settings/global/projects`,"data-slot":`clone-root-settings`,"aria-label":`Edit checkout root`,title:`Edit checkout root`,children:(0,U.jsx)(wr,{className:`size-3.5`,"aria-hidden":`true`})})})]})]}),l.isPending?(0,U.jsx)(`p`,{"data-slot":`clone-progress`,className:`truncate font-mono text-[11.5px] text-muted-foreground`,children:o??`Starting the clone…`}):null,l.isError?(0,U.jsx)(`p`,{"data-slot":`clone-error`,className:`text-[13px] text-danger`,children:l.error instanceof Error?l.error.message:`could not clone that repository`}):null,(0,U.jsxs)(Q,{children:[(0,U.jsx)(P,{variant:`outline`,disabled:l.isPending,onClick:()=>t(!1),children:`Cancel`}),(0,U.jsx)(P,{"data-slot":`clone-confirm`,disabled:n.trim()===``||m===``||l.isPending,onClick:v,children:l.isPending?`Cloning…`:`Clone`})]})]})})}function Xu(e){return(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,...e,children:(0,U.jsx)(`path`,{d:`M12 1.9a10.1 10.1 0 0 0-3.2 19.7c.5.1.7-.2.7-.5v-1.8c-2.8.6-3.4-1.2-3.4-1.2-.5-1.2-1.1-1.5-1.1-1.5-.9-.6.1-.6.1-.6 1 .1 1.5 1 1.5 1 .9 1.6 2.4 1.1 3 .9.1-.7.4-1.1.6-1.4-2.2-.3-4.6-1.1-4.6-5 0-1.1.4-2 1-2.7-.1-.3-.4-1.3.1-2.7 0 0 .9-.3 2.8 1a9.6 9.6 0 0 1 5 0c1.9-1.3 2.8-1 2.8-1 .5 1.4.2 2.4.1 2.7.6.7 1 1.6 1 2.7 0 3.9-2.4 4.7-4.6 5 .4.3.7.9.7 1.9v2.8c0 .3.2.6.7.5A10.1 10.1 0 0 0 12 1.9z`})})}var Zu=[{to:`/`,label:`Tasks`,icon:ur,match:[`/`,`/tasks`,`/compare`]},{to:`/inbox`,label:`Inbox`,icon:cr,match:[`/inbox`],badge:`inbox-count`,inbox:!0},{to:`/git`,label:`Git`,icon:or,match:[`/git`]},{to:`/github`,label:`GitHub`,icon:Xu,match:[`/github`],forge:!0},{to:`/automations`,label:`Automations`,icon:kr,match:[`/automations`],forge:!0},{to:`/skills`,label:`Skills`,icon:Tr,match:[`/skills`],badge:`skills-update`},{to:`/workflows`,label:`Workflows`,icon:Or,match:[`/workflows`]},{to:`/settings`,label:`Settings`,icon:wr,match:[`/settings`]}];function Qu({forge:e=!1,inbox:t=!1}={}){return Zu.filter(n=>(!n.forge||e)&&(!n.inbox||t))}function $u(e,t){return t===`/`?e===`/`:e===t||e.startsWith(t+`/`)}function ed(e){let t=null;for(let n of Zu)for(let r of n.match)$u(e,r)&&(t===null||r.length>t.length)&&(t={to:n.to,length:r.length});return t?.to??null}function td(e){let t=ed(e);return Zu.find(e=>e.to===t)??null}var nd=h(`inline-block size-[7px] shrink-0 rounded-full`,{variants:{tone:{success:`bg-success`,pending:`bg-pending`,danger:`bg-danger`,violet:`bg-violet`,neutral:`bg-soft-foreground`},pulse:{true:`animate-pulse`,false:``}},defaultVariants:{tone:`neutral`,pulse:!1}});function rd({className:e,tone:t=`neutral`,pulse:n=!1,...r}){return(0,U.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,className:B(nd({tone:t,pulse:n,className:e})),...r})}var id=`cez-theme`,ad=`(prefers-color-scheme: light)`,od=`dark`;function sd(e){return e===`light`||e===`dark`||e===`system`?e:od}function cd(e,t){return e===`light`||e===`system`&&t?`light`:`dark`}function ld(){try{return sd(localStorage.getItem(id))}catch{return od}}function ud(e){try{localStorage.setItem(id,e)}catch{}}function dd(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(ad).matches}function fd(e,t){e.classList.toggle(`light`,t===`light`),e.style.colorScheme=t}var pd=H.createContext(null);function md({children:e}){let[t,n]=H.useState(ld),[r,i]=H.useState(dd);H.useEffect(()=>{let e=window.matchMedia?.(ad);if(!e)return;i(e.matches);let t=e=>i(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let a=cd(t,r);H.useLayoutEffect(()=>{fd(document.documentElement,a)},[a]);let o=H.useCallback(e=>{n(e),ud(e)},[]),s=H.useMemo(()=>({theme:t,resolvedTheme:a,setTheme:o}),[t,a,o]);return(0,U.jsx)(pd.Provider,{value:s,children:e})}function hd(){let e=H.useContext(pd);if(!e)throw Error(`cezar: useTheme() must be called inside <ThemeProvider>`);return e}var gd={light:`dark`,dark:`system`,system:`light`},_d={light:Dr,dark:mr,system:pr},vd={light:`light`,dark:`dark`,system:`system`};function $({className:e}){let{theme:t,setTheme:n}=hd(),r=gd[t],i=_d[t];return(0,U.jsx)(P,{type:`button`,variant:`ghost`,size:`icon-sm`,className:e,"data-slot":`theme-toggle`,"data-theme-pref":t,title:`Theme: ${vd[t]}`,"aria-label":`Theme: ${vd[t]}. Switch to ${vd[r]}.`,onClick:()=>n(r),children:(0,U.jsx)(i,{"aria-hidden":`true`})})}var yd=1,bd=.9,xd=.8,Sd=.17,Cd=.1,wd=.999,Td=.9999,Ed=.99,Dd=/[\\\/_+.#"@\[\(\{&]/,Od=/[\\\/_+.#"@\[\(\{&]/g,kd=/[\s-]/,Ad=/[\s-]/g;function jd(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?yd:Ed;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=jd(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=yd:Dd.test(e.charAt(l-1))?(d*=xd,p=e.slice(i,l-1).match(Od),p&&i>0&&(d*=wd**+p.length)):kd.test(e.charAt(l-1))?(d*=bd,m=e.slice(i,l-1).match(Ad),m&&i>0&&(d*=wd**+m.length)):(d*=Sd,i>0&&(d*=wd**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Td)),(d<Cd&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=jd(e,t,n,r,l+1,a+2,o),f*Cd>d&&(d=f*Cd)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Md(e){return e.toLowerCase().replace(Ad,` `)}function Nd(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,jd(e,t,Md(e),Md(t),0,0,{})}var Pd=`[cmdk-group=""]`,Fd=`[cmdk-group-items=""]`,Id=`[cmdk-group-heading=""]`,Ld=`[cmdk-item=""]`,Rd=`${Ld}:not([aria-disabled="true"])`,zd=`cmdk-item-select`,Bd=`data-value`,Vd=(e,t,n)=>Nd(e,t,n),Hd=H.createContext(void 0),Ud=()=>H.useContext(Hd),Wd=H.createContext(void 0),Gd=()=>H.useContext(Wd),Kd=H.createContext(void 0),qd=H.forwardRef((e,t)=>{let n=cf(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=cf(()=>new Set),i=cf(()=>new Map),a=cf(()=>new Map),o=cf(()=>new Set),s=of(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=Ye(),y=Ye(),b=Ye(),x=H.useRef(null),S=df();sf(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),sf(()=>{S(6,O)},[]);let C=H.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)D(),T(),S(1,E);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=te()?.id,C.emit()}),r||S(5,O),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=H.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,ee(t,r)),S(2,()=>{T(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{D(),T(),n.current.value||E(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=te();S(4,()=>{D(),t?.getAttribute(`id`)===e&&E(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function ee(e,t){let r=s.current?.filter??Vd;return e?r(e,n.current.search,t):0}function T(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;ne().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Fd);t?t.appendChild(e.parentElement===t?e:e.closest(`${Fd} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Fd} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${Pd}[${Bd}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function E(){let e=ne().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Bd);C.setState(`value`,e||void 0)}function D(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=ee(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function O(){var e;let t=te();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Pd)?.querySelector(Id))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function te(){return x.current?.querySelector(`${Ld}[aria-selected="true"]`)}function ne(){return Array.from(x.current?.querySelectorAll(Rd)||[])}function re(e){let t=ne()[e];t&&C.setState(`value`,t.getAttribute(Bd))}function ie(e){var t;let n=te(),r=ne(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(Bd))}function ae(e){let t=te()?.closest(Pd),n;for(;t&&!n;)t=e>0?rf(t,Pd):af(t,Pd),n=t?.querySelector(Rd);n?C.setState(`value`,n.getAttribute(Bd)):ie(e)}let k=()=>re(ne().length-1),A=e=>{e.preventDefault(),e.metaKey?k():e.altKey?ae(1):ie(1)},oe=e=>{e.preventDefault(),e.metaKey?re(0):e.altKey?ae(-1):ie(-1)};return H.createElement(Tt.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&A(e);break;case`ArrowDown`:A(e);break;case`p`:case`k`:g&&e.ctrlKey&&oe(e);break;case`ArrowUp`:oe(e);break;case`Home`:e.preventDefault(),re(0);break;case`End`:e.preventDefault(),k();break;case`Enter`:{e.preventDefault();let t=te();if(t){let e=new Event(zd);t.dispatchEvent(e)}}}}},H.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:mf},c),pf(e,e=>H.createElement(Wd.Provider,{value:C},H.createElement(Hd.Provider,{value:w},e))))}),Jd=H.forwardRef((e,t)=>{let n=Ye(),r=H.useRef(null),i=H.useContext(Kd),a=Ud(),o=of(e),s=o.current?.forceMount??i?.forceMount;sf(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=uf(n,r,[e.value,e.children,r],e.keywords),l=Gd(),u=lf(e=>e.value&&e.value===c.current),d=lf(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);H.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(zd,f),()=>t.removeEventListener(zd,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return H.createElement(Tt.div,{ref:ve(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),Yd=H.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=Ye(),s=H.useRef(null),c=H.useRef(null),l=Ye(),u=Ud(),d=lf(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));sf(()=>u.group(o),[]),uf(o,s,[e.value,e.heading,c]);let f=H.useMemo(()=>({id:o,forceMount:i}),[i]);return H.createElement(Tt.div,{ref:ve(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&H.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),pf(e,e=>H.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},H.createElement(Kd.Provider,{value:f},e))))}),Xd=H.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=H.useRef(null),a=lf(e=>!e.search);return!n&&!a?null:H.createElement(Tt.div,{ref:ve(i,t),...r,"cmdk-separator":``,role:`separator`})}),Zd=H.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Gd(),o=lf(e=>e.search),s=lf(e=>e.selectedItemId),c=Ud();return H.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),H.createElement(Tt.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Qd=H.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=H.useRef(null),o=H.useRef(null),s=lf(e=>e.selectedItemId),c=Ud();return H.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),H.createElement(Tt.div,{ref:ve(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},pf(e,e=>H.createElement(`div`,{ref:ve(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),$d=H.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return H.createElement(Wt,{open:n,onOpenChange:r},H.createElement(Vt,{container:o},H.createElement(It,{"cmdk-overlay":``,className:i}),H.createElement(Ht,{"aria-label":e.label,"cmdk-dialog":``,className:a},H.createElement(qd,{ref:t,...s}))))}),ef=H.forwardRef((e,t)=>lf(e=>e.filtered.count===0)?H.createElement(Tt.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),tf=H.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return H.createElement(Tt.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},pf(e,e=>H.createElement(`div`,{"aria-hidden":!0},e)))}),nf=Object.assign(qd,{List:Qd,Item:Jd,Input:Zd,Group:Yd,Separator:Xd,Dialog:$d,Empty:ef,Loading:tf});function rf(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function af(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function of(e){let t=H.useRef(e);return sf(()=>{t.current=e}),t}var sf=typeof window>`u`?H.useEffect:H.useLayoutEffect;function cf(e){let t=H.useRef();return t.current===void 0&&(t.current=e()),t}function lf(e){let t=Gd(),n=()=>e(t.snapshot());return H.useSyncExternalStore(t.subscribe,n,n)}function uf(e,t,n,r=[]){let i=H.useRef(),a=Ud();return sf(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Bd,s),i.current=s}),i}var df=()=>{let[e,t]=H.useState(),n=cf(()=>new Map);return sf(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function ff(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function pf({asChild:e,children:t},n){return e&&H.isValidElement(t)?H.cloneElement(ff(t),{ref:t.ref},n(t.props.children)):n(t)}var mf={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function hf({className:e,...t}){return(0,U.jsx)(nf,{"data-slot":`command`,className:B(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function gf({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!0,...a}){return(0,U.jsxs)(Ru,{...a,children:[(0,U.jsxs)(Uu,{className:`sr-only`,children:[(0,U.jsx)(Wu,{children:e}),(0,U.jsx)(Gu,{children:t})]}),(0,U.jsx)(Hu,{className:B(`overflow-hidden p-0`,r),showCloseButton:i,children:(0,U.jsx)(hf,{className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})})]})}function _f({className:e,...t}){return(0,U.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b px-3`,children:[(0,U.jsx)(Cr,{className:`size-4 shrink-0 opacity-50`}),(0,U.jsx)(nf.Input,{"data-slot":`command-input`,className:B(`flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function vf({className:e,...t}){return(0,U.jsx)(nf.List,{"data-slot":`command-list`,className:B(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...t})}function yf({...e}){return(0,U.jsx)(nf.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function bf({className:e,...t}){return(0,U.jsx)(nf.Group,{"data-slot":`command-group`,className:B(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function xf({className:e,...t}){return(0,U.jsx)(nf.Separator,{"data-slot":`command-separator`,className:B(`-mx-1 h-px bg-border`,e),...t})}function Sf({className:e,...t}){return(0,U.jsx)(nf.Item,{"data-slot":`command-item`,className:B(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function Cf({className:e,...t}){return(0,U.jsx)(`span`,{"data-slot":`command-shortcut`,className:B(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}var wf={permission:0,error:1,waiting:2,running:3,unseen:4,none:5};function Tf(e){return!1}function Ef(e){return!1}function Df(e){return Tf(e)?{bucket:`permission`,tone:`violet`,pulse:!0,label:`needs permission`}:e.status===`failed`?{bucket:`error`,tone:`danger`,pulse:!1,label:`failed`}:e.status===`waiting`?{bucket:`waiting`,tone:`pending`,pulse:!0,label:`needs you`}:e.status===`review`?{bucket:`waiting`,tone:`violet`,pulse:!0,label:`needs review`}:e.status===`running`&&e.activity===`monitoring`?{bucket:`running`,tone:`violet`,pulse:!0,label:`monitoring`}:e.status===`running`?{bucket:`running`,tone:`violet`,pulse:!0,label:`running`}:Ef(e)?{bucket:`unseen`,tone:`violet`,pulse:!1,label:`unseen`}:e.status===`queued`?{bucket:`none`,tone:`neutral`,pulse:!1,label:`queued`}:e.status===`done`?{bucket:`none`,tone:`success`,pulse:!1,label:`done`}:{bucket:`none`,tone:`neutral`,pulse:!1,label:`cancelled`}}function Of(e){return wf[Df(e).bucket]<=wf.waiting}function kf(e,t=Date.now()){if(!e)return``;let n=new Date(e).getTime();if(Number.isNaN(n))return``;let r=Math.max(0,(t-n)/1e3);return r<60?`${Math.floor(r)}s`:r<3600?`${Math.floor(r/60)}m`:r<86400?`${Math.floor(r/3600)}h`:`${Math.floor(r/86400)}d`}function Af(e){return!Number.isFinite(e)||e<=0?`0`:e>=1e6?`${(Math.floor(e/1e5)/10).toFixed(1)}M`:e>=1e3?`${(Math.floor(e/100)/10).toFixed(1)}k`:String(Math.floor(e))}var jf=new Set([`ai`,`cezar`,`agents`,`team`]);function Mf(e){return jf.has(e.source)}function Nf(e){return[...e].sort((e,t)=>Number(!Mf(e))-Number(!Mf(t)))}var Pf=5;function Ff(e,t,{mostUsedLimit:n=Pf}={}){let r=e.map((e,n)=>({skill:e,index:n,count:Lf(t,e.name)})).filter(e=>e.count>0).sort((e,t)=>t.count-e.count||Number(!Mf(e.skill))-Number(!Mf(t.skill))||e.index-t.index).slice(0,n).map(e=>e.skill),i=new Set(r),a=e.filter(e=>!i.has(e));return{mostUsed:r,project:a.filter(Mf),global:a.filter(e=>!Mf(e))}}function If(e,t){let n=Ff(e,t);return[...n.mostUsed,...n.project,...n.global]}function Lf(e,t){if(!e||!Object.hasOwn(e,t))return 0;let n=e[t];return typeof n==`number`?n:0}function Rf(e,t){return{...e,[t]:Lf(e,t)+1}}function zf(e,t){if(t===``)return!0;let n=e.toLowerCase(),r=t.toLowerCase(),i=0;for(let e of r){if(i=n.indexOf(e,i),i===-1)return!1;i+=1}return!0}function Bf(e,t){let n=[];for(let r of e)for(let e of r.steps??[])e.skill===t&&n.push(`${r.name} › ${e.name??e.id}`);return n}var Vf=/[\s\-/_.]/;function Hf(e,t){let n=0;for(let r=e.indexOf(t);r!==-1;r=e.indexOf(t,r+1)){let i=1,a=e[r-1];if(r===0||a!==void 0&&Vf.test(a)){let n=e[r+t.length];i=n===void 0||Vf.test(n)?3:2}if(i>n&&(n=i),n===3)break}return n}function Uf(e,t,n){let r=t.toLowerCase().split(/\s+/).filter(Boolean);if(r.length===0)return 1;let i=[e,...n??[]].join(` `).toLowerCase(),a=0;for(let e of r){let t=Hf(i,e);if(t===0)return 0;a+=t}return a/(r.length*3)}function Wf(e,t){if(t===``)return 1;let n=e.toLowerCase(),r=t.toLowerCase();if(n===r)return 6;if(n.startsWith(r))return 5;let i=n.indexOf(r);if(i>0){let e=n[i-1];return e!==void 0&&Vf.test(e)?4:3}return+!!zf(n,r)}function Gf(e,t){let n=e.split(`-`).filter(Boolean);return t?[...n,t]:n}var Kf=10;function qf(e,t,n){let r=n.toLowerCase().split(/\s+/).filter(Boolean);if(r.length===0)return 1;let i=0;for(let n of r){let r=Wf(e,n),a=t?Wf(t,n):0;if(r===0&&a===0)return 0;i+=r>0?r+Kf:a}return i}var Jf=.5;function Yf(e,t,n){return t.trim()===``?[...e]:e.map((e,r)=>{let i=qf(e.name,e.description,t),a=Lf(n,e.name),o=Math.min(a,Pf)*Jf;return{item:e,index:r,count:a,score:i>0?i+o:0}}).filter(e=>e.score>0).sort((e,t)=>t.score-e.score||t.count-e.count||e.index-t.index).map(e=>e.item)}function Xf(e,t,n){return Yf(e,t,n)}function Zf(e,t){return Yf(e,t)}function Qf(e,t,n){return Yf(If(e,n),t,n)}var $f=[`Needs you`,`Working`,`Recent`,`Archived`],ep={waiting:0,review:1,running:2,queued:3},tp=e=>ep[e.status]??9;function np(e,t){return t===`archived`?`Archived`:e.status===`waiting`||e.status===`review`?`Needs you`:e.status===`running`||e.status===`queued`?`Working`:`Recent`}function rp(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function ip(e){return e.title.replace(/ \([A-C]\)$/,``)}function ap(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return new Map(t.map((e,t)=>[e.id,t+1]))}function op(e,t){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,t)=>{let n=tp(e)-tp(t);return n===0?t.createdAt.localeCompare(e.createdAt):n})}function sp(e,t){let n=ap(e),r=op(e,t),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])},o=new Set;for(let e of r){if(e.groupId){if(o.has(e.groupId))continue;o.add(e.groupId);let n=r.filter(t=>t.groupId===e.groupId).sort((e,t)=>(e.variant??``).localeCompare(t.variant??``));if(n.length>1){a(np(e,t),{kind:`group`,groupId:e.groupId,title:ip(e),members:n});continue}}a(np(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null})}return $f.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function cp(e,t){let n=[],r=t;for(let t of e){if(r<=0)break;let e=t.rows.slice(0,r);r-=e.length,n.push({label:t.label,rows:e})}return n}function lp(e){let t=0,n=0,r=0;for(let i of e){if(i.archived){n+=1;continue}t+=1,(i.status===`waiting`||i.status===`review`)&&(r+=1)}return{active:t,archived:n,waiting:r}}function up(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable?!0:e.closest(`[contenteditable=""], [contenteditable="true"]`)!==null}function dp(e){return e instanceof HTMLElement&&e.closest(`[cmdk-input]`)!==null}function fp(e,t){return!(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey||e.repeat||up(e.target)&&!dp(e.target))}function pp(e,t){let n=H.useRef(t);H.useLayoutEffect(()=>{n.current=t}),H.useEffect(()=>{let t=t=>{fp(t,e)&&(t.preventDefault(),n.current(t))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function mp(e,t){return!(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.repeat||up(e.target))}function hp(e,t){let n=H.useRef(t);H.useLayoutEffect(()=>{n.current=t}),H.useEffect(()=>{let t=t=>{mp(t,e)&&n.current(t)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}var gp=`cezar:open-command-palette`;function _p(){window.dispatchEvent(new Event(gp))}function vp(e){return[...e].sort((e,t)=>Date.parse(t.createdAt)-Date.parse(e.createdAt))}function yp(){let[e,t]=H.useState(!1),n=Kt();pp(`k`,()=>t(e=>!e));let r=H.useCallback(()=>{t(!1),n(`/new`)},[n]);return pp(`n`,r),hp(`c`,r),H.useEffect(()=>{let e=()=>t(!0);return window.addEventListener(gp,e),()=>window.removeEventListener(gp,e)},[]),(0,U.jsx)(gf,{open:e,onOpenChange:t,title:`Command palette`,description:`Search tasks, views, actions, and skills`,showCloseButton:!1,children:(0,U.jsx)(bp,{close:()=>t(!1)})})}function bp({close:e}){let t=Kt(),{theme:n,setTheme:r}=hd(),i=ot(),a=Je(),o=kt(),s=w(),c=Date.now(),l=H.useMemo(()=>vp(i.data??[]),[i.data]),u=o.data?.skillUsage,d=H.useMemo(()=>If(a.data??[],u),[a.data,u]),f=n=>{e(),t(n)},p=gd[n];return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(_f,{placeholder:`Search tasks, views, actions, skills…`}),(0,U.jsxs)(vf,{children:[(0,U.jsx)(yf,{children:`Nothing matches.`}),(0,U.jsxs)(bf,{heading:`Views`,children:[Qu({forge:s.data?.forge?.available===!0,inbox:s.data?.capabilities.followups===!0}).map(e=>{let t=e.icon;return(0,U.jsxs)(Sf,{value:`view ${e.label}`,"data-slot":`palette-view`,"data-nav-to":e.to,onSelect:()=>f(e.to),children:[(0,U.jsx)(t,{"aria-hidden":`true`}),e.label]},e.to)}),(0,U.jsxs)(Sf,{value:`view new task`,"data-slot":`palette-view`,"data-nav-to":`/new`,onSelect:()=>f(`/new`),children:[(0,U.jsx)(xr,{"aria-hidden":`true`}),`New task`,(0,U.jsx)(Cf,{children:`C`})]})]}),l.length>0?(0,U.jsx)(bf,{heading:`Tasks`,children:l.map(e=>{let t=Df(e);return(0,U.jsxs)(Sf,{value:`task ${rp(e)} ${e.id}`,"data-slot":`palette-task`,"data-run-id":e.id,onSelect:()=>f(`/tasks/${e.id}`),children:[(0,U.jsx)(rd,{tone:t.tone,pulse:t.pulse,"aria-label":t.label,role:`img`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:rp(e)}),(0,U.jsx)(`span`,{className:`shrink-0 text-xs text-soft-foreground tabular-nums`,children:kf(e.finishedAt??e.createdAt,c)})]},e.id)})}):null,(0,U.jsxs)(bf,{heading:`Actions`,children:[(0,U.jsxs)(Sf,{value:`action toggle theme`,"data-slot":`palette-action`,"data-action":`toggle-theme`,onSelect:()=>{r(p),e()},children:[(0,U.jsx)(mr,{"aria-hidden":`true`}),`Toggle theme`,(0,U.jsxs)(Cf,{className:`tracking-normal`,children:[n,` → `,p]})]}),(0,U.jsxs)(Sf,{value:`action new task`,"data-slot":`palette-action`,"data-action":`new-task`,onSelect:()=>f(`/new`),children:[(0,U.jsx)(xr,{"aria-hidden":`true`}),`New task`]})]}),d.length>0?(0,U.jsx)(bf,{heading:`Skills`,children:d.map(e=>(0,U.jsxs)(Sf,{value:`skill ${e.name} ${e.path}`,keywords:e.description?[e.description]:void 0,"data-slot":`palette-skill`,"data-skill":e.name,onSelect:()=>f(`/new?skill=${encodeURIComponent(e.name)}`),children:[(0,U.jsx)(`span`,{className:`shrink-0 font-medium`,children:e.name}),e.description?(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null]},e.path))}):null]})]})}function xp({...e}){return(0,U.jsx)(Fl,{"data-slot":`dropdown-menu`,...e})}function Sp({...e}){return(0,U.jsx)(Il,{"data-slot":`dropdown-menu-trigger`,...e})}function Cp({className:e,sideOffset:t=4,...n}){return(0,U.jsx)(J,{children:(0,U.jsx)(Ll,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:B(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function wp({className:e,inset:t,variant:n=`default`,...r}){return(0,U.jsx)(X,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:B(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Tp({...e}){return(0,U.jsx)(Z,{"data-slot":`dropdown-menu-radio-group`,...e})}function Ep({className:e,children:t,...n}){return(0,U.jsxs)(Rl,{"data-slot":`dropdown-menu-radio-item`,className:B(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,U.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,U.jsx)(zl,{children:(0,U.jsx)(Jn,{className:`size-2 fill-current`})})}),t]})}function Dp({className:e,inset:t,...n}){return(0,U.jsx)(Y,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:B(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function Op({className:e,...t}){return(0,U.jsx)(Bl,{"data-slot":`dropdown-menu-separator`,className:B(`-mx-1 my-1 h-px bg-border`,e),...t})}function kp({...e}){return(0,U.jsx)(Wt,{"data-slot":`sheet`,...e})}function Ap({...e}){return(0,U.jsx)(Lt,{"data-slot":`sheet-trigger`,...e})}function jp({...e}){return(0,U.jsx)(Bt,{"data-slot":`sheet-close`,...e})}function Mp({...e}){return(0,U.jsx)(Vt,{"data-slot":`sheet-portal`,...e})}function Np({className:e,...t}){return(0,U.jsx)(It,{"data-slot":`sheet-overlay`,className:B(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Pp({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,U.jsxs)(Mp,{children:[(0,U.jsx)(Np,{}),(0,U.jsxs)(Ht,{"data-slot":`sheet-content`,className:B(`fixed z-50 flex flex-col gap-4 bg-background shadow-modal transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500`,n===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`,n===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,n===`top`&&`inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,n===`bottom`&&`inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,e),...i,children:[t,r&&(0,U.jsxs)(Bt,{className:`absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,U.jsx)(Pt,{className:`size-4`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Fp({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`sheet-header`,className:B(`flex flex-col gap-1.5 p-4`,e),...t})}function Ip({className:e,...t}){return(0,U.jsx)(Ut,{"data-slot":`sheet-title`,className:B(`font-semibold text-foreground`,e),...t})}function Lp({className:e,...t}){return(0,U.jsx)(Rt,{"data-slot":`sheet-description`,className:B(`text-sm text-muted-foreground`,e),...t})}var Rp=`/assets/open-mercato-toBr6SOa.svg`,zp=`(min-width: 768px)`,Bp=H.createContext(void 0);function Vp(){return H.useContext(Bp)}function Hp({children:e,repo:t=null,inboxCount:n=null,skillsUpdateAvailable:r=!1,version:i=null,latestVersion:a=null,taskQuickList:o,toolsMenu:s,forgeAvailable:c=!0,inboxAvailable:l=!0,singleProject:u=!1,banner:d,projectGroups:f}){let{pathname:p}=M(),m=Zt(p),h=ed(m),g=td(m),[_,v]=H.useState(!1),y=H.useRef(null);H.useLayoutEffect(()=>{let e=y.current;e&&(e.scrollTop=0)},[p]),H.useEffect(()=>{v(!1)},[p]),H.useEffect(()=>{let e=window.matchMedia?.(zp);if(!e)return;e.matches&&v(!1);let t=e=>{e.matches&&v(!1)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let b={activeTo:h,items:Qu({forge:c,inbox:l}),repo:t,inboxCount:l?n:null,skillsUpdateAvailable:r,version:i,latestVersion:a,taskQuickList:o,toolsMenu:s,projectGroups:f,singleProject:u};return(0,U.jsx)(kp,{open:_,onOpenChange:v,children:(0,U.jsxs)(`div`,{"data-slot":`app-shell`,className:`flex h-dvh overflow-hidden bg-background text-foreground pl-[env(safe-area-inset-left)] pr-[env(safe-area-inset-right)]`,children:[(0,U.jsx)(Up,{...b}),(0,U.jsx)(Wp,{...b,onNavigate:()=>v(!1)}),(0,U.jsxs)(`div`,{className:`grid min-w-0 flex-1 grid-rows-[auto_auto_1fr_auto] overflow-hidden`,children:[(0,U.jsx)(Zp,{title:g?.label??`cezar`}),d?(0,U.jsx)(`div`,{"data-slot":`banner-slot`,className:`row-start-2`,children:d}):null,(0,U.jsx)(`main`,{ref:y,"data-slot":`main`,className:`row-start-3 min-h-0 overflow-y-auto overscroll-contain`,children:e}),(0,U.jsx)(`div`,{"data-slot":`composer`,className:`row-start-4 pb-[env(safe-area-inset-bottom)]`})]})]})})}function Up(e){return(0,U.jsx)(`aside`,{"data-slot":`sidebar`,className:`hidden w-[264px] shrink-0 flex-col border-r border-border bg-sidebar md:flex`,children:(0,U.jsx)(Gp,{...e})})}function Wp({onNavigate:e,...t}){return(0,U.jsxs)(Pp,{side:`left`,"data-slot":`mobile-nav-drawer`,showCloseButton:!1,className:`w-[264px] gap-0 border-border bg-sidebar p-0 sm:max-w-none md:hidden`,"aria-describedby":void 0,children:[(0,U.jsx)(Ip,{className:`sr-only`,children:`Navigation`}),(0,U.jsx)(Gp,{...t,onNavigate:e,headerAction:(0,U.jsx)(jp,{asChild:!0,children:(0,U.jsx)(P,{variant:`ghost`,size:`icon`,"aria-label":`Close menu`,className:`-mr-2 size-11`,children:(0,U.jsx)(Pt,{className:`size-[17px]`,"aria-hidden":`true`})})})})]})}function Gp({activeTo:e,items:t,repo:n,inboxCount:r,skillsUpdateAvailable:i,version:a,latestVersion:o,taskQuickList:s,toolsMenu:c,projectGroups:l,singleProject:u,onNavigate:d,headerAction:f}){return(0,U.jsxs)(`div`,{"data-slot":`sidebar-content`,className:`flex min-h-0 flex-1 flex-col pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-[9px] px-3.5 pt-3.5 pb-2.5`,children:[(0,U.jsx)(Xp,{}),(0,U.jsx)(`span`,{className:`text-[15px] font-semibold`,children:`cezar`}),n&&!l?(0,U.jsxs)(`span`,{"data-slot":`repo-chip`,className:`ml-auto truncate font-mono text-[11px] font-medium text-soft-foreground`,children:[n.name,` / `,n.branch]}):null,f?(0,U.jsx)(`div`,{className:B(`shrink-0`,(!n||l)&&`ml-auto`),children:f}):null]}),(0,U.jsxs)(`div`,{className:`flex gap-1.5 px-2.5 pt-1 pb-2`,children:[(0,U.jsx)(P,{asChild:!0,variant:`contrast`,className:`relative min-w-0 flex-1 justify-center`,children:(0,U.jsxs)(V,{to:`/new`,onClick:d,children:[(0,U.jsx)(xr,{className:`size-[15px]`,"aria-hidden":`true`}),`New task`,(0,U.jsx)(`kbd`,{"aria-hidden":`true`,className:`absolute right-2.5 rounded-[5px] border border-b-2 border-contrast-foreground/25 bg-transparent px-[5px] py-px font-mono text-[10.5px] font-medium text-contrast-foreground/60`,children:`C`})]})}),u?null:(0,U.jsx)(qp,{})]}),l?(0,U.jsx)(`div`,{"data-slot":`project-groups`,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-1.5 pb-2`,children:(0,U.jsx)(Bp.Provider,{value:d,children:l})}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`nav`,{"aria-label":`Main`,className:`px-2.5 py-1.5`,children:t.map(t=>{let n=t.to===e,a=t.icon;return(0,U.jsxs)(V,{to:t.to,onClick:d,"aria-current":n?`page`:void 0,className:B(`flex h-11 w-full items-center gap-2.5 rounded-md px-2.5 text-[13.5px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground md:h-[34px]`,n&&`bg-muted font-semibold text-foreground`),children:[(0,U.jsx)(a,{className:`size-4 shrink-0`,"aria-hidden":`true`}),t.label,t.badge===`inbox-count`&&r?(0,U.jsx)(`span`,{"data-slot":`nav-badge`,className:`ml-auto rounded-full bg-violet px-1.5 py-px text-[10.5px] font-semibold text-violet-foreground`,children:r}):null,t.badge===`skills-update`&&i?(0,U.jsxs)(`span`,{"data-slot":`nav-update-marker`,className:`ml-auto flex items-center`,children:[(0,U.jsx)(`span`,{className:`size-1.5 rounded-full bg-violet`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Skills update available`})]}):null]},t.to)})}),(0,U.jsx)(`div`,{"data-slot":`task-quick-list`,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-2.5 pb-2`,children:s})]}),(0,U.jsxs)(`div`,{"data-slot":`sidebar-footer`,className:`flex flex-wrap items-center gap-2 gap-y-1.5 border-t border-border px-3.5 py-2.5`,children:[(0,U.jsx)(`div`,{"data-slot":`tools-menu`,children:c}),a?(0,U.jsx)(Yp,{version:a,latestVersion:o}):null,(0,U.jsx)(Jp,{}),(0,U.jsx)(Kp,{onNavigate:d,className:`ml-auto`}),(0,U.jsx)($,{})]})]})}function Kp({className:e,onNavigate:t}){return(0,U.jsx)(P,{asChild:!0,variant:`ghost`,size:`icon`,className:B(`size-7`,e),children:(0,U.jsx)(g,{to:`/settings/global`,"data-slot":`global-settings-link`,"aria-label":`Global settings`,title:`Global settings`,onClick:t,children:(0,U.jsx)(wr,{className:`size-4`,"aria-hidden":`true`})})})}function qp(){let[e,t]=H.useState(!1),[n,r]=H.useState(!1);return(0,U.jsxs)(xp,{children:[(0,U.jsx)(Sp,{asChild:!0,children:(0,U.jsx)(P,{variant:`outline`,size:`icon`,"aria-label":`Add project`,title:`Add project`,className:`size-11 shrink-0 md:size-9`,children:(0,U.jsx)(tr,{className:`size-4`,"aria-hidden":`true`})})}),(0,U.jsxs)(Cp,{align:`start`,className:`w-56`,children:[(0,U.jsx)(Dp,{className:`text-xs text-soft-foreground`,children:`Add project`}),(0,U.jsxs)(wp,{"data-slot":`add-project-local`,onSelect:()=>t(!0),children:[(0,U.jsx)(rr,{"aria-hidden":`true`}),`Open local folder…`]}),(0,U.jsxs)(wp,{"data-slot":`add-project-clone`,onSelect:()=>r(!0),children:[(0,U.jsx)(Xu,{"aria-hidden":`true`}),`Clone from GitHub…`]})]}),e?(0,U.jsx)(Ku,{open:!0,onOpenChange:t}):null,n?(0,U.jsx)(Yu,{open:!0,onOpenChange:r}):null]})}function Jp(){return(0,U.jsxs)(`button`,{type:`button`,"data-slot":`command-palette-hint`,title:`Command palette (⌘K / Ctrl+K)`,"aria-label":`Open the command palette`,onClick:()=>_p(),className:`flex items-center gap-1 rounded-full border border-border px-1.5 py-px font-mono text-[10px] font-medium text-soft-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,U.jsx)(Cr,{className:`size-[9px]`,"aria-hidden":`true`}),`⌘K`]})}function Yp({version:e,latestVersion:t}){let n=!!(t&&t!==e);return(0,U.jsxs)(`span`,{"data-slot":`version-chip`,"data-update-available":n?`true`:void 0,title:n?`update available: v${t}`:void 0,className:`flex items-center gap-1 rounded-full border border-border px-1.5 py-px font-mono text-[10px] font-medium text-soft-foreground`,children:[n?(0,U.jsx)(rd,{tone:`pending`,pulse:!0,className:`size-[5px]`}):null,`v`,e]})}function Xp(){return(0,U.jsx)(`img`,{src:Rp,alt:``,"aria-hidden":`true`,"data-slot":`brand-tile`,className:`size-[26px] shrink-0 rounded-sm`})}function Zp({title:e}){return(0,U.jsx)(`header`,{"data-slot":`mobile-top-bar`,className:`row-start-1 border-b border-border bg-card pt-[env(safe-area-inset-top)] md:hidden`,children:(0,U.jsxs)(`div`,{className:`flex h-[52px] items-center gap-2.5 px-3`,children:[(0,U.jsx)(Ap,{asChild:!0,children:(0,U.jsx)(P,{variant:`ghost`,size:`icon`,"aria-label":`Open menu`,className:`-ml-1.5 size-11`,children:(0,U.jsx)(dr,{className:`size-[17px]`,"aria-hidden":`true`})})}),(0,U.jsx)(`span`,{className:`truncate text-[14.5px] font-semibold`,children:e}),(0,U.jsx)(`div`,{"data-slot":`mobile-status`,className:`ml-auto flex items-center gap-2`})]})})}var Qp=H.createContext(null);function $p({children:e}){let[t,n]=H.useState(`active`),r=H.useMemo(()=>[t,n],[t]);return(0,U.jsx)(Qp.Provider,{value:r,children:e})}function em(){let e=H.useContext(Qp);if(!e)throw Error(`useListView must be used inside a <ListViewProvider>`);return e}var tm=[`claude`,`codex`,`opencode`],nm={claude:`Claude Code`,codex:`Codex`,opencode:`OpenCode`};function rm(e){if(typeof e!=`object`||!e||Array.isArray(e))return{};let t=e,n={};for(let e of tm){let r=t[e];typeof r==`string`&&r.length>0&&r.length<=128&&(n[e]=r)}return n}function im(e,t){if(!e)return[];let n=new Map(e.providers.map(e=>[e.provider,e]));return tm.flatMap(e=>{let r=n.get(e);return r?.status!==`disconnected`||!r.authFailureId||t[e]===r.authFailureId?[]:[{provider:e,label:nm[e],authFailureId:r.authFailureId}]})}function am(e,t){return{...e,...Object.fromEntries(t.map(({provider:e,authFailureId:t})=>[e,t]))}}function om({status:e,pending:t,error:n,dismissals:r,onDismissAuthFailures:i}){if(t||!e)return null;let a;try{a=p(e)}catch{return null}let o=im(a,r);if(o.length>0)return(0,U.jsxs)(`div`,{"data-slot":`provider-banner`,role:`alert`,className:`flex min-h-9 items-center gap-2 border-b border-border bg-destructive/10 px-4 text-sm text-foreground`,children:[(0,U.jsx)(rd,{tone:`danger`}),(0,U.jsxs)(`span`,{children:[`Provider authentication failed during a task:`,` `,o.map(({label:e})=>e).join(`, `),`.`]}),(0,U.jsx)(V,{to:`/settings/agents#providers`,className:`ml-auto shrink-0 font-medium underline underline-offset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:`Open agent settings`}),(0,U.jsx)(`button`,{type:`button`,"aria-label":`Dismiss provider authentication alert`,onClick:()=>i(o),className:`shrink-0 rounded-sm p-1 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,U.jsx)(Pt,{className:`size-4`,"aria-hidden":`true`})})]});if(n||a.providers.some(e=>e.enabled&&e.status===`connected`))return null;let s=a.providers.some(e=>e.status===`connected`),c=a.providers.some(e=>e.status===`unknown`);return(0,U.jsxs)(`div`,{"data-slot":`provider-banner`,role:`status`,className:`flex min-h-9 items-center gap-2 border-b border-border bg-muted/50 px-4 text-sm text-muted-foreground`,children:[(0,U.jsx)(rd,{tone:c?`danger`:`pending`}),(0,U.jsx)(`span`,{children:s?`No agent provider is enabled.`:c?`No connected provider could be verified.`:`No agent provider credentials were found.`}),(0,U.jsx)(V,{to:`/settings/agents#providers`,className:`ml-auto shrink-0 font-medium text-foreground underline underline-offset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:`Configure providers`})]})}function sm(e){if(!(typeof e!=`object`||!e||Array.isArray(e)))return e}function cm(){let e=Te(),t=m(),n=Se(),r=(0,H.useRef)(Promise.resolve()),i=(0,H.useRef)(0),a=(0,H.useRef)(0),o=(0,H.useRef)(sm(t.data));(0,H.useEffect)(()=>{a.current===0&&(o.current=sm(t.data))},[t.data]);let s=(0,H.useCallback)(e=>{let t=N.uiState,s=sm(n.getQueryData(t)),c=am(rm(s?.dismissedProviderAuthFailures),e),l={...s,dismissedProviderAuthFailures:c};a.current+=1,n.setQueryData(t,l);let u=++i.current;r.current=r.current.then(async()=>{try{let e=await He({dismissedProviderAuthFailures:c});o.current=sm(e),u===i.current&&n.setQueryData(t,e)}catch(e){u===i.current&&(o.current===void 0?n.removeQueries({queryKey:t,exact:!0}):n.setQueryData(t,o.current),n.invalidateQueries({queryKey:t}),F(e instanceof Error?e.message:String(e),{tone:`danger`}))}finally{--a.current}})},[n]);return(0,U.jsx)(om,{status:e.data,pending:e.isPending,error:e.isError,dismissals:rm(sm(t.data)?.dismissedProviderAuthFailures),onDismissAuthFailures:s})}function lm({stat:e,className:t}){return(0,U.jsxs)(`span`,{"data-slot":`diff-stat`,title:`+${e.adds} −${e.dels} across ${e.files} ${e.files===1?`file`:`files`}`,className:B(`font-mono text-xs font-semibold tabular-nums`,t),children:[(0,U.jsxs)(`span`,{className:`text-success`,children:[`+`,e.adds]}),` `,(0,U.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.dels]})]})}function um({reference:e,taskTitle:t,className:n,compact:r=!1}){let{kind:i,number:a,url:o}=e,s=B(`inline-flex h-[22px] items-center gap-1 rounded-full border border-violet/35 px-2 font-mono text-[11px] font-semibold text-violet`,n),c=r&&i===`PR`?`PR`:a?`${i===`Issue`?`Issue `:``}#${a}`:i;return!o||!jt(o)?(0,U.jsx)(`span`,{"data-slot":i===`PR`?`pr-chip`:`issue-chip`,className:s,children:c}):(0,U.jsxs)(`a`,{"data-slot":i===`PR`?`pr-chip`:`issue-chip`,href:o,target:`_blank`,rel:`noopener noreferrer`,title:o,"aria-label":`Open the ${i===`PR`?`pull request`:`issue`} for ${t}`,className:B(s,`hover:bg-violet/10`),children:[c,(0,U.jsx)(Vn,{className:`size-2.5`,"aria-hidden":`true`})]})}var dm=new Set([`running`,`waiting`]),fm=new Set([`done`,`failed`,`review`,`cancelled`]),pm=new Set([`done`,`failed`,`cancelled`]);function mm(e){return e?e>=1024**3?`${(e/1024**3).toFixed(1)} GB`:e>=1024**2?`${Math.round(e/1024**2)} MB`:`${Math.round(e/1024)} kB`:``}function hm(e){return e?`$${e>=10?e.toFixed(0):e.toFixed(2)}`:``}function gm(e){if(e.workflow===`(planned)`||e.workflow===`(inbox)`){let t=e.steps.find(e=>e.kind===`agent`);if(t?.name)return t.name}return e.workflow}function _m(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>[rp(e),e.branch??``,e.workflow,gm(e)].some(e=>e.toLowerCase().includes(n))):[...e]}function vm(e){return e.filter(e=>!e.archived&&pm.has(e.status)).length}function ym(e){return e.pullRequestUrl??e.referencedPullRequestUrl}function bm(e){return e.referencedIssueUrl}function xm(e){let t=ym(e),n=t?Number(Sm(t)):e.prNumber;if(n&&Number.isInteger(n))return{kind:`PR`,number:n,...t?{url:t}:{}};let r=bm(e),i=e.issueNumber??(r?Number(Sm(r)):void 0);if(i&&Number.isInteger(i))return{kind:`Issue`,number:i,...r?{url:r}:{}}}function Sm(e){let t=e.split(`/`).pop()??``;return/^\d+$/.test(t)?t:null}function Cm(e,t){let n=dm.has(e.status)?t:void 0;if(n)return{cpu:{text:`${n.cpuPct.toFixed(0)}%`,kind:`live`},mem:{text:mm(n.rssBytes),kind:`live`}};let r=mm(e.peakRssBytes);return{cpu:{text:``,kind:`none`},mem:r?{text:`peak ${r}`,kind:`peak`,title:`peak — run finished${e.peakProcCount?` · ${e.peakProcCount} procs`:``}`}:{text:``,kind:`none`}}}function wm(e,t){let n=e.filter(e=>t===`archived`?e.archived:!e.archived),r=new Map;for(let e of n){if(!e.groupId)continue;let t=r.get(e.groupId);t?t.push(e):r.set(e.groupId,[e])}return[...r.entries()].flatMap(([e,t])=>{let n=t[0];return!n||t.length<2||!t.every(e=>fm.has(e.status))?[]:[{groupId:e,title:ip(n),count:t.length}]})}function Tm(e){let[t,n]=H.useState(()=>Date.now());return H.useEffect(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function Em({runs:e,view:t,onViewChange:n,currentRunId:r=null,now:i=Date.now()}){let a=lp(e),o=sp(e,t);return(0,U.jsxs)(`div`,{"data-slot":`quick-list`,children:[(0,U.jsx)(`div`,{className:`sticky top-0 z-10 bg-sidebar pt-2 pb-1`,children:(0,U.jsxs)(`div`,{className:`inline-flex w-full gap-0.5 rounded-md bg-muted p-[3px]`,children:[(0,U.jsxs)(Om,{view:`active`,current:t,onSelect:n,count:a.active,children:[`Active`,a.waiting>0&&t!==`active`?(0,U.jsx)(rd,{tone:`pending`,pulse:!0,"data-slot":`waiting-dot`,"aria-label":`needs you`}):null]}),(0,U.jsx)(Om,{view:`archived`,current:t,onSelect:n,count:a.archived,children:`Archived`})]})}),o.length===0?(0,U.jsx)(`p`,{className:`px-3 py-3.5 text-xs text-soft-foreground`,children:t===`archived`?`Nothing archived yet.`:`No tasks yet — describe one.`}):(0,U.jsx)(Dm,{buckets:o,currentRunId:r,now:i})]})}function Dm({buckets:e,currentRunId:t=null,now:n=Date.now(),scope:r=null}){let[i,a]=H.useState(()=>new Set),o=e=>a(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,U.jsx)(U.Fragment,{children:e.map(e=>(0,U.jsxs)(`div`,{"data-slot":`quick-list-bucket`,"data-bucket":e.label,children:[(0,U.jsx)(`h2`,{className:`px-3 pt-2.5 pb-1 text-[11px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:e.label}),e.rows.map(e=>(0,U.jsx)(km,{row:e,currentRunId:t,now:n,scope:r,expanded:e.kind===`group`&&i.has(e.groupId),onToggle:o},e.kind===`group`?e.groupId:e.run.id))]},e.label))})}function Om({view:e,current:t,onSelect:n,count:r,children:i}){let a=e===t;return(0,U.jsxs)(`button`,{type:`button`,"data-slot":`view-tab`,"data-view":e,"aria-pressed":a,onClick:()=>n(e),className:B(`flex h-7 flex-1 items-center justify-center gap-1.5 rounded-[7px] text-[12.5px] font-medium text-muted-foreground`,a&&`bg-card font-semibold text-foreground shadow-xs`),children:[i,r>0?(0,U.jsx)(`span`,{className:`font-mono text-[11px] tabular-nums`,children:r}):null]})}function km({row:e,currentRunId:t,now:n,scope:r,expanded:i,onToggle:a}){return e.kind===`run`?(0,U.jsx)(Am,{run:e.run,queuePosition:e.queuePosition,currentRunId:t,now:n,scope:r}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex items-center rounded-sm hover:bg-muted`,children:[(0,U.jsxs)(`button`,{type:`button`,"data-slot":`group-tile`,"data-group-id":e.groupId,"aria-expanded":i,onClick:()=>a(e.groupId),className:`flex min-w-0 flex-1 items-center gap-2 px-2.5 py-[7px] text-left`,children:[(0,U.jsx)(Kn,{className:B(`size-3 shrink-0 text-soft-foreground transition-transform`,!i&&`-rotate-90`),"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:e.title}),(0,U.jsxs)(`span`,{className:`shrink-0 rounded-full bg-muted px-1.5 py-px font-mono text-[10.5px] font-semibold text-muted-foreground`,children:[`×`,e.members.length]})]}),(0,U.jsx)(V,{to:Gt(r,`/compare/${e.groupId}`),"data-slot":`group-compare`,title:`Compare the variants`,"aria-label":`Compare the variants of ${e.title}`,className:`mr-1.5 inline-flex size-6 shrink-0 items-center justify-center rounded-sm text-soft-foreground hover:bg-violet/10 hover:text-violet`,children:(0,U.jsx)(Sr,{className:`size-3.5`,"aria-hidden":`true`})})]}),i?e.members.map(e=>(0,U.jsx)(Am,{run:e,queuePosition:null,currentRunId:t,now:n,scope:r,variant:!0},e.id)):null]})}function Am({run:e,queuePosition:t,currentRunId:n,now:r,scope:i,variant:a=!1}){let o=Df(e),s=e.id===n,c=ym(e),l=a?``:t===null?kf(e.finishedAt??e.createdAt,r):`#${t}`;return(0,U.jsxs)(`div`,{"data-slot":`task-row`,"data-run-id":e.id,"data-active":s?`true`:void 0,className:B(`flex items-center rounded-sm hover:bg-muted`,s&&`bg-muted`,a&&`pl-4`),children:[(0,U.jsxs)(V,{to:Gt(i,`/tasks/${e.id}`),title:rp(e),"aria-current":s?`page`:void 0,className:`flex min-w-0 flex-1 items-center gap-2 px-2.5 py-[7px]`,children:[a?(0,U.jsx)(`span`,{className:`inline-flex size-[15px] shrink-0 items-center justify-center rounded-full bg-violet/15 font-mono text-[9.5px] font-semibold text-violet`,children:e.variant??`?`}):null,(0,U.jsx)(rd,{tone:o.tone,pulse:o.pulse,"aria-label":o.label,role:`img`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:a?jm(e):rp(e)}),e.diffStat?(0,U.jsx)(lm,{stat:e.diffStat,className:`shrink-0 text-[10.5px]`}):null,c||!l?null:(0,U.jsx)(`span`,{className:`shrink-0 text-[11px] text-soft-foreground tabular-nums`,children:l})]}),c&&jt(c)?(0,U.jsx)(um,{reference:{kind:`PR`,...Sm(c)?{number:Number(Sm(c))}:{},url:c},taskTitle:rp(e),compact:!0,className:`mr-2.5 h-auto shrink-0 gap-[3px] px-1.5 py-px text-[10.5px]`}):null]})}function jm(e){let t=[e.runner??`claude`];return e.tokensUsed>0&&t.push(Af(e.tokensUsed)),t.join(` · `)}function Mm(){let e=ot(),[t,n]=em(),r=Yt(`/tasks/:id/*`),i=Yt(`/tasks/:id`),a=Tm(3e4);return e.data?(0,U.jsx)(Em,{runs:e.data,view:t,onViewChange:n,currentRunId:r?.params.id??i?.params.id??null,now:a}):null}var Nm=10,Pm=400;function Fm(e,t,n){let r=e?.[t];return r===void 0?t!==n:r}function Im(e){let t=Se(),n=m().data?.sidebar?.collapsed,r=H.useRef(null),i=H.useRef(null),a=H.useCallback(()=>{i.current=null;let e=r.current;e&&(r.current=null,He({sidebar:e}).then(e=>t.setQueryData(N.uiState,e)).catch(e=>{F(e instanceof Error?e.message:String(e),{tone:`danger`}),t.invalidateQueries({queryKey:N.uiState})}))},[t]);return H.useEffect(()=>()=>{i.current!==null&&(clearTimeout(i.current),a())},[a]),{collapsed:n,toggle:H.useCallback(n=>{let o=t.getQueryData(N.uiState),s=o?.sidebar?.collapsed,c={...o?.sidebar,collapsed:{...s,[n]:!Fm(s,n,e)}};t.setQueryData(N.uiState,{...o,sidebar:c}),r.current=c,i.current!==null&&clearTimeout(i.current),i.current=setTimeout(a,Pm)},[e,a,t])}}function Lm({projects:e,bootProjectId:t,forgeAvailable:n=!1,inboxAvailable:r=!1,inboxCount:i=null,skillsUpdateAvailable:a=!1}){let{pathname:o}=M(),s=Jt(o)??t,{collapsed:c,toggle:l}=Im(s),[u]=em(),d=ed(Zt(o)),f=Yt(`/tasks/:id/*`),p=Yt(`/tasks/:id`),m=f?.params.id??p?.params.id??null,h=Tm(3e4);return(0,U.jsx)(`div`,{"data-slot":`project-group-list`,children:H.useMemo(()=>[...e].sort((e,t)=>t.lastOpenedAt.localeCompare(e.lastOpenedAt)),[e]).map(e=>(0,U.jsx)(Rm,{project:e,boot:e.id===t,active:e.id===s,collapsed:Fm(c,e.id,s),onToggle:l,view:u,activeTo:d,currentRunId:m,now:h,forgeAvailable:n,inboxAvailable:r,inboxCount:i,skillsUpdateAvailable:a},e.id))})}function Rm({project:e,boot:t,active:n,collapsed:r,onToggle:i,view:a,activeTo:o,currentRunId:s,now:c,forgeAvailable:l,inboxAvailable:u,inboxCount:d,skillsUpdateAvailable:f}){let p=e.status===`missing`,m=O(e.id,!r&&!p,t),h=Vp(),g=m.data?lp(m.data).waiting:0,_=m.data?cp(sp(m.data,a),Nm):[];if(p)return(0,U.jsx)(`div`,{"data-slot":`project-group`,"data-project":e.id,"data-status":`missing`,className:`mb-1`,children:(0,U.jsxs)(`div`,{"data-slot":`project-group-header`,title:`${e.root} is gone — remove it in Global settings → Projects`,className:`flex h-11 w-full items-center gap-[7px] rounded-lg px-2 text-[13px] font-semibold opacity-55 md:h-[34px]`,children:[(0,U.jsx)(`span`,{className:`w-3 shrink-0`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`truncate`,children:e.name}),(0,U.jsx)(`span`,{"data-slot":`project-missing`,className:`ml-auto shrink-0 rounded-full bg-danger/15 px-[7px] py-px text-[10px] font-medium text-danger`,children:`folder not found`})]})});let v=`project-group-${e.id}`;return(0,U.jsxs)(`div`,{"data-slot":`project-group`,"data-project":e.id,"data-status":e.status,"data-collapsed":r?``:void 0,className:`mb-1`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),"aria-expanded":!r,"aria-controls":v,"data-slot":`project-group-header`,className:B(`flex h-11 w-full items-center gap-[7px] rounded-lg px-2 text-left text-[13px] font-semibold transition-colors hover:bg-muted md:h-[34px]`,n&&`bg-muted`),children:[(0,U.jsx)(Kn,{className:B(`size-3 shrink-0 text-muted-foreground transition-transform`,r&&`-rotate-90`),"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`truncate`,children:e.name}),g?(0,U.jsx)(`span`,{"data-slot":`project-attention`,title:`${g} task${g===1?``:`s`} need${g===1?`s`:``} you`,className:`shrink-0 rounded-full bg-violet px-1.5 py-px text-[10.5px] font-semibold text-violet-foreground`,children:g}):null,e.branch?(0,U.jsx)(`span`,{"data-slot":`project-branch`,className:`ml-auto max-w-[92px] truncate font-mono text-[10.5px] font-medium text-soft-foreground`,children:e.branch}):null]}),r?null:(0,U.jsxs)(`div`,{id:v,"data-slot":`project-group-body`,className:`mt-1 ml-[14px] border-l border-border pl-2`,children:[(0,U.jsx)(`nav`,{"aria-label":`${e.name} navigation`,children:Qu({forge:l,inbox:u}).map(t=>{let r=n&&t.to===o,i=t.icon;return(0,U.jsxs)(V,{to:Gt(e.id,t.to),onClick:h,"aria-current":r?`page`:void 0,className:B(`flex h-11 w-full items-center gap-2.5 rounded-md px-2.5 text-[13px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground md:h-[30px]`,r&&`bg-muted font-semibold text-foreground`),children:[(0,U.jsx)(i,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t.label,t.badge===`inbox-count`&&n&&d?(0,U.jsx)(`span`,{"data-slot":`nav-badge`,className:`ml-auto rounded-full bg-violet px-1.5 py-px text-[10.5px] font-semibold text-violet-foreground`,children:d}):null,t.badge===`skills-update`&&n&&f?(0,U.jsxs)(`span`,{"data-slot":`nav-update-marker`,className:`ml-auto flex items-center`,children:[(0,U.jsx)(`span`,{className:`size-1.5 rounded-full bg-violet`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Skills update available`})]}):null]},t.to)})}),(0,U.jsx)(Dm,{buckets:_,currentRunId:n?s:null,now:c,scope:e.id}),(0,U.jsx)(V,{to:Gt(e.id,`/`),onClick:h,"data-slot":`project-group-more`,className:`flex h-9 items-center rounded-md px-3 text-[12px] text-muted-foreground transition-colors hover:text-foreground md:h-7`,children:`More…`})]})]})}function zm(e){let t=e.checks.filter(e=>!e.available).map(e=>e.name),n=`cezar v${e.version}`;return t.length?`${n} · needs attention: ${t.join(`, `)}`:n}function Bm(e){return e.forge?.available?null:e.forge?`GitHub is unreachable — ${e.forge.reason??`unknown reason`}. The GitHub tab is hidden until it comes back.`:`No GitHub remote detected — the GitHub tab is hidden. Every plain-git feature still works.`}function Vm({health:e}){if(!e)return null;let t=e.checks.every(e=>e.available);return(0,U.jsxs)(xp,{children:[(0,U.jsx)(Sp,{asChild:!0,children:(0,U.jsxs)(`button`,{type:`button`,"data-slot":`tools-menu-trigger`,title:zm(e),className:`flex items-center gap-1.5 rounded-full border border-border px-2 py-0.5 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,U.jsx)(rd,{tone:t?`success`:`pending`}),`Tools`,(0,U.jsx)(Kn,{className:`size-[11px]`,"aria-hidden":`true`})]})}),(0,U.jsxs)(Cp,{side:`top`,align:`start`,"data-slot":`tools-menu-content`,className:`w-[240px]`,children:[(0,U.jsx)(Dp,{className:`text-[11px] font-semibold tracking-[.04em] text-soft-foreground uppercase`,children:`Installed tools`}),e.checks.map(e=>e.available?(0,U.jsx)(Hm,{check:e},e.name):(0,U.jsx)(Um,{check:e},e.name)),Bm(e)?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Op,{}),(0,U.jsx)(`p`,{"data-slot":`forge-note`,className:`px-2 py-1.5 text-[11px] leading-snug text-muted-foreground`,children:Bm(e)})]}):null,(0,U.jsx)(Op,{}),(0,U.jsx)(wp,{asChild:!0,children:(0,U.jsxs)(V,{to:`/settings/agents`,"data-slot":`tools-settings`,className:`gap-2 text-[12.5px] text-muted-foreground`,children:[(0,U.jsx)(wr,{className:`size-3.5`,"aria-hidden":`true`}),`Tool settings`]})})]})]})}function Hm({check:e}){return(0,U.jsxs)(`div`,{"data-slot":`tool-row`,"data-tool":e.name,"data-available":`true`,className:`flex items-center gap-2 rounded-sm px-2 py-1.5`,children:[(0,U.jsx)(rd,{tone:`success`}),(0,U.jsx)(`span`,{className:`font-mono text-[12.5px] font-medium`,children:e.name}),(0,U.jsx)(`span`,{"data-slot":`tool-version`,className:`ml-auto font-mono text-[11.5px] font-medium text-muted-foreground tabular-nums`,children:e.version??`not found`})]})}function Um({check:e}){return(0,U.jsx)(wp,{asChild:!0,children:(0,U.jsxs)(V,{to:`/settings/agents`,"data-slot":`tool-row`,"data-tool":e.name,"data-available":`false`,className:`flex-col items-stretch gap-1`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(rd,{tone:`danger`}),(0,U.jsx)(`span`,{className:`font-mono text-[12.5px] font-medium`,children:e.name}),(0,U.jsx)(`span`,{"data-slot":`tool-version`,className:`ml-auto font-mono text-[11.5px] font-medium text-muted-foreground`,children:`not found`})]}),(0,U.jsxs)(`span`,{className:`flex items-end justify-between gap-3 pl-[15px]`,children:[e.hint?(0,U.jsx)(`span`,{"data-slot":`tool-hint`,className:`min-w-0 text-[11px] leading-snug text-muted-foreground`,children:e.hint}):null,(0,U.jsx)(`span`,{"data-slot":`tool-setup`,className:`ml-auto shrink-0 text-[11.5px] font-semibold text-violet`,children:`Set up →`})]})]})})}function Wm(e){return e?.trim()||null}function Gm({projectName:e,pageLabel:t}){let n=Wm(e),r=Wm(t);return n&&r?`${n} — ${r} · cezar`:n?`${n} · cezar`:r?`${r} · cezar`:`cezar`}function Km(e){let t=Gm(e);(0,H.useEffect)(()=>{document.title=t},[t])}function qm(){return(0,U.jsx)(`div`,{"data-route":`compare`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(L,{icon:(0,U.jsx)(se,{className:`motion-safe:animate-spin`}),tone:`neutral`,title:`Loading variants…`,subtitle:`Fetching every variant's status, spend and diff summary.`})})}function Jm(){return(0,U.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(L,{icon:(0,U.jsx)(se,{className:`motion-safe:animate-spin`}),tone:`neutral`,title:`Loading GitHub…`,subtitle:`Fetching open issues and pull requests.`})})}function Ym(e,t,n=24){return[t,...(e??[]).filter(e=>!(e.source===t.source&&e.ref===t.ref))].slice(0,n)}var Xm=[{id:`claude`,label:`claude`,desc:`Claude Code CLI`},{id:`codex`,label:`codex`,desc:`OpenAI Codex (app-server)`},{id:`opencode`,label:`opencode`,desc:`OpenCode (serve)`}],Zm={claude:[{id:``,label:`auto`,desc:`Pick the best model per step`},{id:`opus`,label:`opus`,desc:`Deep reasoning for hard tasks`},{id:`sonnet`,label:`sonnet`,desc:`Fast and cheap`},{id:`haiku`,label:`haiku`,desc:`Fastest — simple, scoped tasks`},{id:`claude-fable-5`,label:`Fable 5`,desc:`Most capable — the Claude 5 family`},{id:`claude-opus-4-8`,label:`Opus 4.8`,desc:`Pinned version`},{id:`claude-sonnet-5`,label:`Sonnet 5`,desc:`Pinned version`},{id:`claude-haiku-4-5`,label:`Haiku 4.5`,desc:`Pinned version`}],codex:[{id:``,label:`auto`,desc:`Use your Codex default model`}],opencode:[{id:``,label:`auto`,desc:`Use your OpenCode default model`},{id:`anthropic/claude-opus-4-8`,label:`claude-opus-4.8`,desc:`via Anthropic`},{id:`anthropic/claude-sonnet-5`,label:`claude-sonnet-5`,desc:`via Anthropic`},{id:`openai/gpt-5.1`,label:`gpt-5.1`,desc:`via OpenAI`},{id:`openai/gpt-5.1-codex`,label:`gpt-5.1-codex`,desc:`via OpenAI`}]};function Qm(e,t){return!e||Zm[t].some(t=>t.id===e)?!1:Object.entries(Zm).some(([n,r])=>n!==t&&r.some(t=>t.id!==``&&t.id===e))}function $m(e,t,n=[]){let r=[...Zm[e]??Zm.claude];if(e!==`codex`)return r;let i=new Set(r.map(e=>e.id));for(let e of t?.models??[])!e.id||i.has(e.id)||(i.add(e.id),r.push({id:e.id,label:e.label||e.id,desc:e.description}));for(let t of n)!t||i.has(t)||Qm(t,e)||(i.add(t),r.push({id:t,label:t,desc:`Custom or legacy model`}));return r}function eh(e,t,n=!1){if(e===`codex`){if(t?.stale)return`Using cached Codex model list`;if(n||t?.source===`unavailable`)return`Latest Codex models unavailable`}}function th(e){let t=Xm.map(e=>e.id).filter(t=>e.some(e=>e.name===t&&e.available));return t.length>0?t:[`claude`]}function nh(e,t,n){return e!==null&&t.includes(e)?e:t.includes(n)?n:t[0]??`claude`}function rh(e,t,n,r){let i=$m(t,r,[e,n?.[t]]);if(e!==null&&i.some(t=>t.id===e))return e;let a=n?.[t];return a!==void 0&&i.some(e=>e.id===a)?a:``}function ih(e,t,n){return e.source===`skill`?t.some(t=>t.name===e.ref):n.some(t=>t.name===e.ref)}function ah(e,t,n){for(let r of e)if(r&&ih(r,t,n))return r;if(n.some(e=>e.name===`quick-task`))return{source:`workflow`,ref:`quick-task`};let r=t[0];return r?{source:`skill`,ref:r.name}:{source:`workflow`,ref:n[0]?.name??`quick-task`}}function oh(e){let{task:t,source:n,model:r,runner:i,defaultRunner:a,variants:o,images:s,worktree:c,autonomous:l,generateFollowups:u,todoId:d}=e;return{task:t,...n.source===`skill`?{steps:[{id:`task`,name:n.ref,skill:n.ref,prompt:`{{task}}`}]}:{workflow:n.ref},model:r||void 0,runner:i===a?void 0:i,variants:o>1?o:void 0,images:s.length>0?[...s]:void 0,worktree:c===!1&&o<=1?!1:void 0,autonomous:l===!0||void 0,generateFollowups:u!==!1&&void 0,todoId:d||void 0}}function sh(e){let t=`runs`in e?e.runs[0]:e;return t?`/tasks/${t.id}`:`/`}var ch=`inline-flex h-[26px] items-center gap-1.5 rounded-full border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-55`,lh=(0,U.jsx)(Kn,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`});function uh({slot:e,ariaLabel:t,label:n,value:r,options:i,onPick:a,disabled:o=!1,hint:s,disabledHint:c,status:l}){let u=(0,U.jsxs)(`button`,{type:`button`,"data-slot":e,"aria-label":t,disabled:o,title:o?c:s,className:ch,children:[n,lh]});return o?(0,U.jsx)(`span`,{title:c,className:`inline-flex`,children:u}):(0,U.jsxs)(xp,{children:[(0,U.jsx)(Sp,{asChild:!0,children:u}),(0,U.jsxs)(Cp,{align:`start`,"data-testid":`${e}-menu`,children:[(0,U.jsx)(Tp,{value:r,onValueChange:a,children:i.map(e=>(0,U.jsx)(Ep,{value:e.value,className:`gap-2.5`,children:(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,U.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:e.label}),e.desc?(0,U.jsx)(`span`,{className:`text-[11.5px] text-muted-foreground`,children:e.desc}):null]})},e.value))}),l?(0,U.jsx)(wp,{disabled:!0,className:`border-t border-border text-[11.5px] text-muted-foreground`,children:l}):null]})]})}function dh({runners:e,value:t,onPick:n,disabled:r=!1}){return(0,U.jsx)(uh,{slot:`runner-pill`,ariaLabel:`Runner`,label:t,value:t,disabled:r,onPick:e=>n(e),options:Xm.filter(t=>e.includes(t.id)).map(e=>({value:e.id,label:e.label,desc:e.desc}))})}function fh(e){let t=w(),n=Te(),r=le(),i=ft(),a=ye(n.data),o=t.data?.defaultRunner,s=nh(e.runner,a,o??a[0]??`claude`);return{runner:s,model:rh(e.model,s,r.data?.defaultModels,i.data),runners:a,defaultRunner:o,canRun:n.isSuccess&&a.length>0,providerPending:n.isPending,providerError:n.isError}}function ph(e){return{runner:e.defaultRunner!==void 0&&e.runner===e.defaultRunner?void 0:e.runner,model:e.model||void 0}}function mh({pick:e,onChange:t,disabled:n=!1}){let{runner:r,model:i,runners:a,canRun:o}=fh(e),s=le(),c=ft(),l=$m(r,c.data,[e.model,s.data?.defaultModels?.[r]]),u=n||!o;return(0,U.jsxs)(U.Fragment,{children:[a.length>1?(0,U.jsx)(dh,{runners:a,value:r,disabled:u,onPick:e=>t({runner:e,model:null})}):null,(0,U.jsx)(uh,{slot:`model-pill`,ariaLabel:`Model`,label:l.find(e=>e.id===i).label,value:i,disabled:u,onPick:n=>t({...e,model:n}),options:l.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:eh(r,c.data,c.isError)})]})}function hh(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function gh(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=hh(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(hh(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function _h(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:hh(e)}:{top:0,bottom:0}}function vh(e,t=0){let n=typeof t==`number`?{top:t,right:t,bottom:t,left:t}:t;return{top:(n.top??0)+e.top,right:n.right??0,bottom:(n.bottom??0)+e.bottom,left:n.left??0}}function yh(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(_h(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function bh(){let[e,t]=(0,H.useState)({top:0,bottom:0});return(0,H.useEffect)(()=>yh(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function xh(e){let t=(0,H.useRef)(e);t.current=e,(0,H.useEffect)(()=>{let e=document.documentElement;return gh(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}function Sh({...e}){return(0,U.jsx)(gu,{"data-slot":`popover`,...e})}function Ch({...e}){return(0,U.jsx)(vu,{"data-slot":`popover-trigger`,...e})}function wh({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:r,...i}){let a=bh();return(0,U.jsx)(yu,{children:(0,U.jsx)(bu,{"data-slot":`popover-content`,align:t,sideOffset:n,collisionPadding:vh(a,r),className:B(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...i})})}function Th({...e}){return(0,U.jsx)(_u,{"data-slot":`popover-anchor`,...e})}function Eh({templates:e,onInsert:t,triggerClassName:n,disabled:r,iconOnly:i=!1}){let[a,o]=(0,H.useState)(!1),s=(0,H.useRef)(null),c=Kt();return e.length===0?null:(0,U.jsxs)(Sh,{open:a,onOpenChange:o,children:[(0,U.jsx)(Ch,{asChild:!0,children:(0,U.jsxs)(`button`,{type:`button`,"data-slot":`prompt-template-trigger`,"aria-label":`Insert a prompt template`,title:`Insert a prompt template`,disabled:r,className:B(`inline-flex h-[26px] items-center gap-1.5 rounded-full border border-border bg-card text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50`,i?`w-[26px] justify-center px-0`:`px-2.5`,n),children:[(0,U.jsx)(hr,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),i?null:(0,U.jsxs)(U.Fragment,{children:[`templates`,(0,U.jsx)(Kn,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})]})}),(0,U.jsx)(wh,{align:`start`,sideOffset:8,"data-slot":`prompt-template-menu`,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,onCloseAutoFocus:e=>e.preventDefault(),children:(0,U.jsxs)(hf,{filter:Uf,children:[(0,U.jsx)(_f,{placeholder:`search templates…`,onInput:()=>s.current?.scrollTo(0,0)}),(0,U.jsxs)(vf,{ref:s,"data-slot":`prompt-template-list-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,U.jsx)(yf,{children:`Nothing matches.`}),(0,U.jsx)(bf,{heading:`Insert a template`,children:e.map(e=>(0,U.jsxs)(Sf,{value:`template ${e.label} ${e.id}`,keywords:[e.text,...e.skills??[]],"data-slot":`prompt-template-option`,"data-template":e.id,title:e.text,className:`flex-col items-start gap-0.5`,onSelect:()=>{t(e.text),o(!1)},children:[(0,U.jsxs)(`span`,{className:`flex w-full items-center gap-1.5`,children:[(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12.5px] font-medium text-foreground`,children:e.label}),e.skills&&e.skills.length>0?(0,U.jsxs)(`span`,{"data-slot":`prompt-template-assigned`,title:`Applied automatically with: ${e.skills.join(`, `)}`,className:`inline-flex shrink-0 items-center gap-0.5 text-[10px] font-medium text-violet`,children:[(0,U.jsx)(Tr,{"aria-hidden":`true`,className:`size-2.5`}),e.skills.length]}):null]}),(0,U.jsx)(`span`,{className:`line-clamp-1 text-[11px] text-soft-foreground`,children:e.text})]},e.id))}),(0,U.jsx)(xf,{}),(0,U.jsx)(bf,{children:(0,U.jsx)(Sf,{value:`edit prompt templates settings`,"data-slot":`prompt-template-settings`,className:`text-[12px] text-muted-foreground`,onSelect:()=>{o(!1),c(`/settings/prompt-templates`)},children:`Edit templates…`})})]})]})})]})}var Dh=80,Oh=2e3,kh=50,Ah=200,jh=50,Mh=[{id:`add-tests`,label:`Add tests`,text:`Also add or update tests covering this change.`},{id:`explain-change`,label:`Explain the change`,text:`Explain what changed and why before finishing.`},{id:`keep-minimal`,label:`Keep it minimal`,text:`Keep the change as small and targeted as possible — no unrelated refactors.`},{id:`update-docs`,label:`Update docs`,text:`Also update any relevant documentation or comments.`},{id:`check-edge-cases`,label:`Double-check edge cases`,text:`Double-check edge cases and error handling before finishing.`}];function Nh(e){return!!e&&typeof e==`object`}function Ph(e){if(e===void 0||!Array.isArray(e))return Mh.map(e=>({...e}));let t=new Set,n=[];for(let r of e){if(!Nh(r))continue;let e=typeof r.id==`string`?r.id.trim():``,i=typeof r.label==`string`?r.label.trim():``,a=typeof r.text==`string`?r.text.trim():``;if(!e||!i||!a||t.has(e))continue;t.add(e);let o=Fh(r.skills);if(n.push({id:e,label:i.slice(0,Dh),text:a.slice(0,Oh),...o.length>0?{skills:o}:{}}),n.length>=kh)break}return n}function Fh(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();if(!(!e||t.has(e))&&(t.add(e.slice(0,Ah)),t.size>=jh))break}return[...t]}function Ih(e,t){if(t.length===0)return[];let n=new Set(t);return e.filter(e=>e.skills?.some(e=>n.has(e)))}function Lh(e,t){return Ih(e,t).map(e=>e.text).join(`
|
|
11
|
-
|
|
12
|
-
`)}function Rh(e,t,n,r=``){if(e===``||e===r||e===t){let e=r&&n?`${r}\n\n${n}`:r||n;return{text:e,applied:n?e:``}}return{text:e,applied:t}}function zh(){return`tpl-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Bh(e,t,n){let r=Math.max(0,Math.min(t,e.length)),i=e.slice(0,r),a=e.slice(r),o=``;i.length>0&&(o=i.endsWith(`
|
|
13
|
-
|
|
14
|
-
`)?``:i.endsWith(`
|
|
15
|
-
`)?`
|
|
16
|
-
`:`
|
|
17
|
-
|
|
18
|
-
`);let s=a.replace(/^[ \t]+/,``),c=``;return s.length>0&&(c=s.startsWith(`
|
|
19
|
-
|
|
20
|
-
`)?``:s.startsWith(`
|
|
21
|
-
`)?`
|
|
22
|
-
`:`
|
|
23
|
-
|
|
24
|
-
`),{text:i+o+n+c+s,caret:i.length+o.length+n.length}}var Vh=Df({status:`waiting`});function Hh(e){return e.filter(e=>!e.startedTaskId)}function Uh(e){return e.runnable??!!(e.suggestedSkill||e.suggestedPrompt)}function Wh(){let e=w(),t=e.data?.capabilities.followups===!0,n=e.data!==void 0&&!t,r=xt(!n),i=ot(),a=r.data===void 0?void 0:Hh(r.data);return(0,U.jsxs)(`div`,{"data-route":`inbox`,className:`flex min-h-full flex-col`,children:[(0,U.jsxs)(`header`,{className:`sticky top-0 z-10 hidden h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5 md:flex`,children:[(0,U.jsx)(`h1`,{className:`text-base font-semibold`,children:`Inbox`}),(0,U.jsx)(`p`,{className:`text-[13px] text-soft-foreground`,children:n?`Disabled for this server; per-task Notes still run.`:`Follow-ups agents suggested when they finished a task.`})]}),(0,U.jsx)(`div`,{className:`flex flex-1 flex-col p-3 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-5 md:pb-5`,children:n?(0,U.jsx)(L,{icon:(0,U.jsx)(cr,{}),tone:`neutral`,title:`The follow-up inbox is off`,subtitle:`Agents are not asked to leave follow-ups. Set CEZ_FOLLOWUPS=1 and restart cezar to turn the inbox on.`,heading:`h2`}):a===void 0?r.isError?(0,U.jsx)(L,{icon:(0,U.jsx)(Nt,{}),tone:`danger`,title:`Could not load the inbox`,subtitle:r.error.message,heading:`h2`}):null:a.length===0?e.isPending?null:(0,U.jsx)(L,{icon:(0,U.jsx)(cr,{}),tone:`neutral`,title:`Inbox empty`,subtitle:`Agents drop follow-up suggestions here when they finish a task.`,heading:`h2`}):(0,U.jsx)(`ul`,{"data-slot":`todo-list`,className:`mx-auto flex w-full max-w-3xl flex-col gap-2.5`,children:a.map(e=>(0,U.jsx)(Gh,{todo:e,sourceTaskExists:e.taskId===void 0?null:i.data?.some(t=>t.id===e.taskId)??!1},e.id))})})]})}function Gh({todo:e,sourceTaskExists:t}){let n=Kt(),r=Se(),i=kt(),[a,o]=(0,H.useState)({runner:null,model:null}),s=fh(a),[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(``),p=(0,H.useRef)(null),m=Ph(i.data?.promptTemplates),h=e=>{let t=p.current?.selectionStart??d.length,n=Bh(d,t,e);f(n.text),requestAnimationFrame(()=>{p.current?.focus(),p.current?.setSelectionRange(n.caret,n.caret)})},g=pe({mutationFn:async()=>s.canRun?Ot(e.id,{...ph(s),prompt:d.trim()||void 0}):null,onSuccess:e=>{if(e===null)return;let{run:t}=e;r.invalidateQueries({queryKey:c.todos}),r.invalidateQueries({queryKey:c.runs.all}),n(`/tasks/${t.id}`)},onError:e=>F(e.message,{tone:`danger`})}),_=pe({mutationFn:()=>Xe(e.id),onSuccess:()=>{r.setQueryData(c.todos,t=>t?.filter(t=>t.id!==e.id)),r.invalidateQueries({queryKey:c.todos})},onError:e=>F(e.message,{tone:`danger`})}),v=g.isPending||_.isPending,y=Uh(e);return(0,U.jsxs)(`li`,{"data-slot":`todo-card`,"data-id":e.id,className:`flex flex-col gap-2.5 rounded-lg border border-border bg-card p-4 shadow-xs`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.jsx)(rd,{tone:Vh.tone,pulse:Vh.pulse,title:Vh.label,className:`mt-[5px]`}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`p`,{"data-slot":`todo-summary`,className:`text-sm leading-snug font-medium text-foreground`,children:e.summary}),(0,U.jsxs)(`div`,{"data-slot":`todo-meta`,className:`mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-soft-foreground`,children:[e.ts?(0,U.jsxs)(`span`,{children:[kf(e.ts),` ago`]}):null,e.action?(0,U.jsx)(`span`,{children:e.action}):null,e.taskId===void 0?null:t?(0,U.jsx)(V,{to:`/tasks/${e.taskId}`,"data-slot":`todo-source`,className:`text-muted-foreground underline decoration-border underline-offset-2 hover:text-foreground`,children:`source task`}):(0,U.jsx)(`span`,{"data-slot":`todo-source-gone`,children:`source task deleted`}),jt(e.prUrl)?(0,U.jsx)(`a`,{href:e.prUrl,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`todo-pr`,className:`text-muted-foreground underline decoration-border underline-offset-2 hover:text-foreground`,children:`PR`}):null,e.suggestedSkill?(0,U.jsxs)(`span`,{"data-slot":`todo-skill`,className:`font-mono`,children:[`skill: `,e.suggestedSkill]}):null]})]}),(0,U.jsx)(`div`,{className:`flex shrink-0 items-center gap-1.5 self-center`,children:y?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(P,{type:`button`,variant:`contrast`,size:`sm`,"data-action":`todo-run`,title:`Start a task from this follow-up`,disabled:v||!s.canRun,onClick:()=>g.mutate(),children:[(0,U.jsx)(br,{"aria-hidden":`true`,className:`size-3`}),`Run`]}),(0,U.jsx)(P,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`todo-dismiss`,title:`Check off (remove)`,disabled:v,onClick:()=>_.mutate(),children:`Dismiss`})]}):(0,U.jsxs)(P,{type:`button`,variant:`contrast`,size:`sm`,"data-action":`todo-acknowledge`,title:`Acknowledge and remove this note`,disabled:v,onClick:()=>_.mutate(),children:[(0,U.jsx)(et,{"aria-hidden":`true`,className:`size-3`}),`Acknowledge`]})})]}),y?(0,U.jsxs)(`div`,{"data-slot":`todo-engine`,className:`flex flex-wrap items-center gap-2 pl-5`,children:[(0,U.jsx)(mh,{pick:a,onChange:o,disabled:v||!s.canRun}),!s.providerPending&&!s.canRun?(0,U.jsxs)(`span`,{"data-slot":`todo-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[s.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this follow-up.`,(0,U.jsx)(V,{to:`/settings/agents#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null]}):null,y?l?(0,U.jsxs)(`div`,{"data-slot":`todo-instructions`,className:`flex flex-col gap-2 pl-5`,children:[(0,U.jsx)(Ft,{ref:p,"data-slot":`todo-instructions-input`,"aria-label":`Extra instructions for this follow-up`,value:d,onChange:e=>f(e.target.value),placeholder:`Add instructions for the agent… (appended to the suggestion above)`,maxLength:2e4,className:`min-h-16 text-[13px]`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(Eh,{templates:m,onInsert:h}),(0,U.jsx)(`button`,{type:`button`,"data-slot":`todo-instructions-hide`,onClick:()=>u(!1),className:`text-xs font-medium text-muted-foreground underline decoration-border underline-offset-2 hover:text-foreground`,children:`Hide`})]})]}):(0,U.jsx)(`button`,{type:`button`,"data-slot":`todo-instructions-toggle`,onClick:()=>u(!0),className:`self-start pl-5 text-xs font-medium text-muted-foreground underline decoration-border underline-offset-2 hover:text-foreground`,children:d.trim()?`Edit instructions (added)`:`+ Add instructions`}):null]})}function Kh(e){return!(e.key!==`Enter`||e.shiftKey||e.altKey||e.repeat||e.isComposing)}function qh(e=typeof navigator>`u`?``:navigator.platform){return/mac|iphone|ipad|ipod/i.test(e)?`⌘↵`:`Ctrl+↵`}async function Jh(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));let r=btoa(n);return{mediaType:e.type,data:r,preview:`data:${e.type};base64,${r}`,name:e.name||`pasted image`}}function Yh(e,t){let n=[],r=[],i=t;for(let t of e)if(t.type.startsWith(`image/`)){if(t.size>5242880){r.push(`${t.name||`image`} is too large (max 5 MB)`);continue}if(i>=4){r.push(`${t.name||`image`} skipped — max 4 images per message`);continue}n.push(t),i+=1}return{accepted:n,rejected:r}}var Xh=new Set([`/`,`@`]);function Zh(e,t){for(let n=t-1;n>=0;--n){let r=e[n];if(/\s/.test(r))return null;if(Xh.has(r))return n>0&&!/\s/.test(e[n-1])?null:{trigger:r,start:n,query:e.slice(n+1,t)}}return null}function Qh(e,t,n,r){let i=`${t.trigger}${r} `;return{text:e.slice(0,t.start)+i+e.slice(n),caret:t.start+i.length}}function $h(){let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition}function eg(e,t){let n=e,r=``;for(let e=t.resultIndex;e<t.results.length;e+=1){let i=t.results[e],a=i[0]?.transcript??``;i.isFinal?n+=a:r+=a}return{finalText:n,interim:r}}function tg(e){let[t,n]=H.useState(null),r=H.useRef(null),i=H.useRef(``),[a]=H.useState(()=>$h()!==void 0),o=H.useCallback(()=>{let e=r.current;r.current=null,i.current=``,n(null),e&&(e.onresult=null,e.onerror=null,e.onend=null,e.abort())},[]);return H.useEffect(()=>o,[o]),{supported:a,recording:t,start:H.useCallback(()=>{if(r.current)return;let t=$h();if(!t)return;let a;try{a=new t,a.lang=navigator.language||`en-US`,a.continuous=!0,a.interimResults=!0;let s=Date.now();a.onresult=e=>{let t=eg(i.current,e);i.current=t.finalText,n({transcript:t.finalText+t.interim,startedAt:s})},a.onerror=t=>{e(`Dictation failed${t.error?` — ${t.error}`:``}`),o()},a.start(),r.current=a,n({transcript:``,startedAt:s})}catch{e(`Dictation failed — the microphone could not be started`),o()}},[e,o]),cancel:H.useCallback(()=>o(),[o]),finish:H.useCallback(()=>{let e=r.current,a=(i.current+``).trim()===``?``:i.current,o=t?.transcript??a;return e&&(e.onresult=null,e.onerror=null,e.onend=null,e.stop()),r.current=null,i.current=``,n(null),o.trim()},[t])}}function ng(e,t){let n=Math.max(0,Math.floor((t-e)/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,`0`)}`}var rg={KeyA:`Yes, approved.`,KeyC:`Continue.`};function ig({onSubmit:e,value:t,onValueChange:n,autoFocus:r=!1,footerStart:i,footerEnd:a,sendAriaLabel:o=`Send`,disabled:s=!1,disabledReason:l=`Session closed — Continue to reopen.`,allowEmptySubmit:u=!1,placeholder:d=`Reply — / for skills, @ for files…`,ariaLabel:f=`Reply to the agent`,autocompleteSkills:p=!0,quickReplies:m=!1,getMentionCandidates:h,ref:g}){let[_,v]=(0,H.useState)(``),y=t??_,b=(0,H.useRef)(y);b.current=y;let x=(0,H.useRef)(n);x.current=n;let S=(0,H.useCallback)(e=>{let t=typeof e==`function`?e(b.current):e;v(t),x.current?.(t)},[]),[C,w]=(0,H.useState)([]),ee=(0,H.useRef)(C);ee.current=C;let[T,E]=(0,H.useState)(!1),[D,O]=(0,H.useState)(null),[te,ne]=(0,H.useState)(``),[re,ie]=(0,H.useState)(!1),ae=(0,H.useRef)(null),k=(0,H.useRef)(null),A=(0,H.useRef)(null),oe=Je(p&&re),se=kt(),ce=Se(),j=tg(e=>F(e,{tone:`danger`}));(0,H.useEffect)(()=>{r&&ae.current?.focus()},[]),(0,H.useImperativeHandle)(g,()=>({insertAtCaret:e=>{let t=ae.current,n=Bh(b.current,t?.selectionStart??b.current.length,e);S(n.text),A.current=n.caret,t?.focus()}}),[S]);let le=(0,H.useCallback)(()=>{let e=ae.current;if(!e||s){O(null);return}let t=Zh(e.value,e.selectionStart??e.value.length);if(t?.trigger===`/`&&!p||t?.trigger===`@`&&h===void 0)return O(null);t?.trigger===`/`&&ie(!0),O(t)},[p,s,h]),M=(0,H.useMemo)(()=>D===null?[]:D.trigger===`/`?Qf(oe.data??[],D.query,se.data?.skillUsage).map(e=>({value:`${e.name} ${e.path}`,insert:e.name,label:e.name,description:e.description,emphasized:Mf(e)})):(h?.()??[]).filter(e=>zf(e,D.query)).map(e=>({value:e,insert:e,label:e,emphasized:!1})),[h,oe.data,D,se.data?.skillUsage]),ue=M.some(e=>e.value===te)?te:M[0]?.value,de=D!==null,fe=(0,H.useCallback)(()=>O(null),[]),pe=e=>{let t=ae.current;if(!t||D===null)return;let n=t.selectionStart??t.value.length,r=Qh(t.value,D,n,e.insert);D.trigger===`/`&&se.data!==void 0&&rt({skillUsage:Rf(se.data.skillUsage,e.insert)}).then(()=>ce.invalidateQueries({queryKey:c.uiState})).catch(()=>{}),S(r.text),A.current=r.caret,O(null),t.focus()};(0,H.useLayoutEffect)(()=>{let e=A.current,t=ae.current;e!==null&&t&&(t.setSelectionRange(e,e),A.current=null)},[y]),(0,H.useLayoutEffect)(()=>{let e=ae.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,220)}px`)},[y]);let me=(0,H.useCallback)(e=>{if(s)return;let t=Yh(e,ee.current.length);for(let e of t.rejected)F(e,{tone:`danger`});for(let e of t.accepted)Jh(e).then(e=>w(t=>t.length>=4?t:[...t,e]))},[s]),he=e=>{let t=[...e.clipboardData?.items??[]].filter(e=>e.type.startsWith(`image/`)).map(e=>e.getAsFile()).filter(e=>e!==null);t.length!==0&&(e.preventDefault(),me(t))},ge=e=>{let t=[...e.dataTransfer?.files??[]];t.length!==0&&(e.preventDefault(),me(t))},_e=(0,H.useCallback)(async(t,n,r)=>{let i=t.trim();if(!(s||T)&&!(i===``&&n.length===0&&!u)){E(!0);try{await e(i,n.map(({mediaType:e,data:t})=>({mediaType:e,data:t})))}catch(e){F(e instanceof Error?e.message:String(e),{tone:`danger`}),r&&(S(e=>e===``?t:`${t}\n${e}`),w(e=>[...n,...e].slice(0,4)))}finally{E(!1)}}},[u,T,s,e]),ve=(0,H.useCallback)(()=>{if(y.trim()===``&&C.length===0&&!u)return;let e=y,t=C;S(``),w([]),O(null),_e(e,t,!0)},[u,C,_e,y]),ye=e=>{if(de){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),M.length===0)return;let t=M.findIndex(e=>e.value===ue),n=e.key===`ArrowDown`?1:-1,r=M[(t+n+M.length)%M.length];ne(r.value);return}if(e.key===`Escape`){e.preventDefault(),fe();return}if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey){let t=M.find(e=>e.value===ue);if(t){e.preventDefault(),pe(t);return}fe()}}Kh({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.preventDefault(),ve())};(0,H.useEffect)(()=>{if(!m||s)return;let e=e=>{if(!e.altKey||e.metaKey||e.ctrlKey||e.repeat)return;let t=rg[e.code];t!==void 0&&(e.preventDefault(),_e(t,[],!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,m,_e]);let N=e=>{let t=j.finish();if(t===``)return;let n=y.trim()===``?t:`${y.replace(/\s*$/,``)} ${t}`;if(e){S(``),w([]),_e(n,C,!0);return}S(n),A.current=n.length,ae.current?.focus()},be=j.recording;return(0,U.jsxs)(Sh,{open:de,onOpenChange:e=>e?void 0:fe(),children:[(0,U.jsx)(Th,{asChild:!0,children:(0,U.jsxs)(`div`,{ref:k,"data-slot":`composer`,"data-disabled":s||void 0,onDrop:ge,onDragOver:e=>e.preventDefault(),className:B(`rounded-xl border border-border bg-card shadow-xs transition-[border-color,box-shadow]`,`focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/15`,s&&`opacity-80`),children:[C.length>0?(0,U.jsx)(`div`,{"data-slot":`composer-thumbs`,className:`flex flex-wrap gap-2 px-4 pt-3`,children:C.map((e,t)=>(0,U.jsxs)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,title:`Click to remove`,className:`group relative size-12 overflow-hidden rounded-md border border-border`,onClick:()=>w(e=>e.filter((e,n)=>n!==t)),children:[(0,U.jsx)(`img`,{src:e.preview,alt:``,className:`size-full object-cover`}),(0,U.jsx)(`span`,{className:`absolute inset-0 hidden items-center justify-center bg-background/70 group-hover:flex group-focus-visible:flex`,children:(0,U.jsx)(Pt,{"aria-hidden":`true`,className:`size-4`})})]},`${e.name}-${t}`))}):null,(0,U.jsx)(`textarea`,{ref:ae,rows:2,value:y,disabled:s,"aria-label":f,placeholder:s?l:d,className:`block max-h-[220px] min-h-[54px] w-full resize-none bg-transparent px-4 pt-3 pb-1 text-base leading-normal outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed md:text-sm`,onChange:e=>{S(e.target.value),le()},onKeyDown:ye,onSelect:le,onPaste:he}),be?(0,U.jsx)(og,{transcript:be.transcript,startedAt:be.startedAt,onCancel:j.cancel,onInsert:()=>N(!1),onInsertAndSend:()=>N(!0)}):(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 gap-y-1.5 px-2 pt-1.5 pb-2`,children:[(0,U.jsxs)(`div`,{"data-slot":`composer-footer-start`,className:`flex min-w-0 flex-wrap items-center gap-1`,children:[(0,U.jsx)(ag,{disabled:s,onFiles:me}),i]}),(0,U.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[j.supported?(0,U.jsxs)(P,{type:`button`,variant:`ghost`,size:`sm`,disabled:s,"aria-label":`Start dictation`,title:`Dictation`,className:`h-8 gap-1.5 px-2.5 text-xs font-medium text-muted-foreground`,onClick:j.start,children:[(0,U.jsx)(fr,{"aria-hidden":`true`,className:`size-3.5`}),`Dictation`]}):null,a?(0,U.jsx)(`div`,{"data-slot":`composer-footer-end`,className:`flex items-center gap-1.5`,children:a}):null,(0,U.jsx)(P,{type:`button`,size:`icon-sm`,"aria-label":o,disabled:s||T||y.trim()===``&&C.length===0&&!u,className:`size-8`,onClick:ve,children:(0,U.jsx)(Hn,{"aria-hidden":`true`})})]})]})]})}),(0,U.jsx)(wh,{side:`top`,align:`start`,sideOffset:8,className:`w-80 max-w-[calc(100vw-2rem)] p-0`,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{k.current?.contains(e.target)&&e.preventDefault()},children:(0,U.jsx)(hf,{shouldFilter:!1,value:ue??``,onValueChange:ne,children:(0,U.jsx)(vf,{"data-slot":`composer-menu`,"data-trigger":D?.trigger,className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] p-1`,children:M.length===0?(0,U.jsx)(`p`,{className:`px-3 py-4 text-center text-xs text-muted-foreground`,children:D?.trigger===`@`?`No files seen in this session yet — full file search arrives with the Files tab.`:oe.isPending?`Loading skills…`:`No matching skills.`}):M.map(e=>(0,U.jsxs)(Sf,{value:e.value,"data-slot":`composer-menu-item`,"data-emphasized":e.emphasized||void 0,onSelect:()=>pe(e),children:[(0,U.jsx)(`span`,{className:B(`shrink-0 truncate`,e.emphasized&&`font-semibold`,D?.trigger===`@`&&`font-mono text-xs`),children:e.label}),e.description?(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null]},e.value))})})})]})}function ag({disabled:e,onFiles:t}){let n=(0,H.useRef)(null);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(P,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Attach images`,title:`Attach an image (or paste a screenshot)`,disabled:e,className:`size-8 text-muted-foreground`,onClick:()=>n.current?.click(),children:(0,U.jsx)(vr,{"aria-hidden":`true`,className:`size-[15px]`})}),(0,U.jsx)(`input`,{ref:n,type:`file`,accept:`image/*`,multiple:!0,className:`hidden`,"aria-hidden":`true`,tabIndex:-1,onChange:e=>{t([...e.target.files??[]]),e.target.value=``}})]})}function og({transcript:e,startedAt:t,onCancel:n,onInsert:r,onInsertAndSend:i}){let a=Tm(1e3);return(0,U.jsxs)(`div`,{"data-slot":`dictation-overlay`,role:`status`,"aria-label":`Dictation in progress`,className:`flex items-center gap-2.5 rounded-b-xl border-t border-border bg-muted/60 px-3 py-2`,children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 flex-none animate-pulse rounded-full bg-danger motion-reduce:animate-none`}),(0,U.jsx)(`span`,{"data-slot":`dictation-timer`,className:`text-xs font-medium text-muted-foreground tabular-nums`,children:ng(t,a)}),(0,U.jsx)(`span`,{"data-slot":`dictation-transcript`,"aria-live":`polite`,className:`min-w-0 flex-1 truncate text-sm text-foreground`,children:e===``?(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:`Listening…`}):e}),(0,U.jsx)(P,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Cancel dictation`,className:`size-8 text-muted-foreground`,onClick:n,children:(0,U.jsx)(Pt,{"aria-hidden":`true`})}),(0,U.jsx)(P,{type:`button`,variant:`outline`,size:`icon-sm`,"aria-label":`Insert transcription`,className:`size-8`,onClick:r,children:(0,U.jsx)(et,{"aria-hidden":`true`})}),(0,U.jsx)(P,{type:`button`,size:`icon-sm`,"aria-label":`Insert transcription and send`,className:`size-8`,onClick:i,children:(0,U.jsx)(Hn,{"aria-hidden":`true`})})]})}var sg={name:`cezar-syn`,type:`dark`,fg:`var(--syn-var)`,bg:`transparent`,settings:[{scope:[`keyword`,`storage`,`constant.language`,`variable.language`,`entity.other.attribute-name`,`support.type.property-name`],settings:{foreground:`var(--syn-key)`}},{scope:[`string`,`punctuation.definition.string`],settings:{foreground:`var(--syn-str)`}},{scope:[`entity.name.function`,`support.function`,`entity.name.tag`,`entity.name.type`,`entity.name.class`,`support.class`,`support.type`],settings:{foreground:`var(--syn-fn)`}},{scope:[`comment`,`punctuation.definition.comment`],settings:{foreground:`var(--syn-com)`}},{scope:[`constant.numeric`,`constant.character`,`constant.other`,`support.constant`,`keyword.other.unit`],settings:{foreground:`var(--syn-num)`}},{scope:[`punctuation`,`keyword.operator`,`meta.brace`,`punctuation.separator`,`punctuation.terminator`],settings:{foreground:`var(--syn-punc)`}},{scope:[`variable`,`entity.name.variable`],settings:{foreground:`var(--syn-var)`}}]},cg={typescript:()=>n(()=>import(`./typescript-bsJCZSQ-.js`),[]),tsx:()=>n(()=>import(`./tsx-udAQXfEw.js`),[]),javascript:()=>n(()=>import(`./javascript-BgS3c2Ky.js`),[]),jsx:()=>n(()=>import(`./jsx-Bz0zcwM4.js`),[]),json:()=>n(()=>import(`./json-qhed-kSA.js`),[]),jsonc:()=>n(()=>import(`./jsonc-CYpm1nAK.js`),[]),shellscript:()=>n(()=>import(`./shellscript-CLZ0U2zV.js`),[]),python:()=>n(()=>import(`./python-gzcpVVnB.js`),[]),markdown:()=>n(()=>import(`./markdown-BYOwaDjH.js`),[]),css:()=>n(()=>import(`./css-BsVw1vtW.js`),[]),html:()=>n(()=>import(`./html-BY76lXLH.js`),__vite__mapDeps([0,1,2])),diff:()=>n(()=>import(`./diff-woXpYk--.js`),[]),yaml:()=>n(()=>import(`./yaml-rwi0_p6S.js`),[]),toml:()=>n(()=>import(`./toml-CcmNWLt0.js`),[]),go:()=>n(()=>import(`./go-rLFTqkRN.js`),[]),rust:()=>n(()=>import(`./rust-Cfkwpbl8.js`),[]),sql:()=>n(()=>import(`./sql-BsFa4tDR.js`),[])},lg={ts:`typescript`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,bash:`shellscript`,sh:`shellscript`,shell:`shellscript`,zsh:`shellscript`,console:`shellscript`,py:`python`,md:`markdown`,yml:`yaml`,golang:`go`,rs:`rust`,vue:`html`,xml:`html`},ug=new Set([``,`plaintext`,`text`,`txt`,`plain`]);function dg(e){let t=e.trim().toLowerCase();return t in cg?t:lg[t]??null}function fg(e){return ug.has(e.trim().toLowerCase())}function pg(){return[...Object.keys(cg),...Object.keys(lg),...ug].filter(e=>e!==``)}function mg(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);if(n<=0)return null;let r=t.slice(n+1).toLowerCase();return dg({mts:`typescript`,cts:`typescript`,htm:`html`}[r]??r)}var hg=null,gg=null,_g=new Set,vg=new Map;function yg(){return gg??=Promise.all([n(()=>import(`./core-DePtBHcl.js`),__vite__mapDeps([3,4,5])),n(()=>import(`./engine-javascript-FQvzRocB.js`),[])]).then(async([{createHighlighterCore:e},{createJavaScriptRegexEngine:t}])=>(hg=await e({themes:[sg],langs:[],engine:t({forgiving:!0})}),hg)),gg}function bg(e){let t=dg(e);if(t===null||_g.has(t))return Promise.resolve();let n=vg.get(t);return n||(n=yg().then(async e=>{await e.loadLanguage(await cg[t]()),_g.add(t)}).catch(()=>{vg.delete(t)}),vg.set(t,n)),n}function xg(e){return{tokens:e.split(`
|
|
25
|
-
`).map(e=>[{content:e}]),fg:`var(--syn-var)`,bg:`transparent`}}function Sg(e,t,n={}){if(fg(t))return xg(e);let r=dg(t);if(r===null)return xg(e);if(!hg||!_g.has(r))return null;try{let t=hg.codeToTokens(e,{lang:r,theme:sg.name,tokenizeTimeLimit:n.tokenizeTimeLimit});return{tokens:t.tokens.map(e=>e.map(({content:e,color:t})=>({content:e,color:t}))),fg:t.fg??`var(--syn-var)`,bg:`transparent`}}catch{return xg(e)}}async function Cg(e,t,n={}){return Sg(e,t,n)||(await bg(t),Sg(e,t,n)??xg(e))}var wg={name:`shiki`,type:`code-highlighter`,getThemes:()=>[sg,sg],getSupportedLanguages:()=>pg(),supportsLanguage:e=>pg().includes(String(e).toLowerCase()),highlight:({code:e,language:t},n)=>Sg(e,String(t))||(Cg(e,String(t)).then(e=>n?.(e)),null)};function Tg(){let e=t=>{if(!t.children)return;let n=[];for(let r of t.children)if(r.type===`text`&&r.value?.includes(`
|
|
26
|
-
`)){let e=r.value.split(/\r?\n/);e.forEach((t,r)=>{r>0&&!(t===``&&r===e.length-1)&&n.push({type:`break`}),t&&n.push({type:`text`,value:t})})}else e(r),n.push(r);t.children=n};return e}var Eg=[...Object.values(nn),Tg],Dg=[`p`,`strong`,`em`,`del`,`code`,`a`],Og={p:`span`,a:`span`},kg=(0,H.memo)(function({children:e,breaks:t=!1,inline:n=!1}){return(0,U.jsx)(tn,{className:n?`thread-markdown thread-markdown-inline`:`thread-markdown`,plugins:{code:wg},shikiTheme:[sg,sg],remarkPlugins:t?Eg:void 0,allowedElements:n?Dg:void 0,unwrapDisallowed:n||void 0,components:n?Og:void 0,controls:{code:{copy:!0,download:!1},table:!1,mermaid:!1},lineNumbers:!1,children:e})});function Ag({source:e,className:t}){return(0,U.jsx)(`span`,{"data-slot":`skill-source`,"data-source":e,className:B(`shrink-0 rounded-full border border-border px-2 py-px font-mono text-[10.5px]`,Mf({source:e})?`font-semibold text-foreground`:`text-soft-foreground`,t),children:e})}function jg({skill:e,usedBy:t,heading:n=`h2`}){return(0,U.jsxs)(`div`,{"data-slot":`skill-detail`,className:`min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2.5`,children:[(0,U.jsx)(n,{className:`min-w-0 font-mono text-lg font-semibold break-all`,children:e.name}),(0,U.jsx)(Ag,{source:e.source})]}),(0,U.jsxs)(`p`,{"data-slot":`skill-path`,className:`mt-1 font-mono text-[10.5px] break-all text-soft-foreground`,children:[e.path,e.team?` · from ${e.team.repo}`:``]}),e.description?(0,U.jsx)(`p`,{"data-slot":`skill-description`,className:`mt-2.5 text-[13px] text-muted-foreground`,children:e.description}):null,t===void 0?null:(0,U.jsxs)(`section`,{"data-slot":`skill-used-by`,className:`mt-5`,children:[(0,U.jsx)(`h3`,{className:`text-[11px] font-semibold tracking-[.04em] text-soft-foreground uppercase`,children:`Used by`}),t.length>0?(0,U.jsx)(`ul`,{className:`mt-1.5 flex flex-col gap-1`,children:t.map(e=>(0,U.jsxs)(`li`,{className:`flex items-center gap-1.5 font-mono text-xs text-muted-foreground`,children:[(0,U.jsx)(Bn,{"aria-hidden":`true`,className:`size-3 shrink-0 text-soft-foreground`}),e]},e))}):(0,U.jsx)(`p`,{className:`mt-1.5 text-xs text-soft-foreground`,children:`Not referenced by any workflow yet — quick-task picks it up when the task mentions it.`})]}),(0,U.jsxs)(`section`,{className:`mt-5`,children:[(0,U.jsx)(`h3`,{className:`text-[11px] font-semibold tracking-[.04em] text-soft-foreground uppercase`,children:`Content`}),(0,U.jsx)(`div`,{"data-slot":`skill-body`,className:`mt-2 text-sm`,children:(0,U.jsx)(kg,{children:e.body})})]})]})}function Mg({skill:e,onClose:t}){return(0,U.jsx)(Ru,{open:e!==null,onOpenChange:e=>e?void 0:t(),children:(0,U.jsx)(Hu,{"data-slot":`skill-preview`,className:`block max-h-[80dvh] overflow-y-auto sm:max-w-2xl`,children:e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Wu,{className:`sr-only`,children:e.name}),(0,U.jsx)(Gu,{className:`sr-only`,children:`Read-only skill preview`}),(0,U.jsx)(jg,{skill:e,heading:`h3`}),(0,U.jsx)(`p`,{className:`mt-5`,children:(0,U.jsx)(V,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-preview-manage`,onClick:t,className:`text-xs font-semibold text-violet hover:underline`,children:`Open in the Skills catalog`})})]}):null})})}function Ng(e,t,n){let r=e.skill===``?{source:`workflow`,ref:`quick-task`}:{source:`skill`,ref:e.skill};return oh({task:e.ref,source:r,model:``,runner:t,defaultRunner:n,variants:1,images:[],todoId:e.todo})}function Pg(e,t){return e.kind===`failed`?{message:`Auto-start failed: ${e.message} — review and press Start`,tone:`danger`}:e.kind===`blocked`?{message:`Auto-start blocked (bad key) — review and press Start`,tone:`danger`}:t===``?{message:`Prefilled from link — review and press Start`,tone:`default`}:{message:`Unknown skill "${t}" — prefilled for quick-task; review and press Start`,tone:`danger`}}function Fg(e,t){return`Use the "${e}" skill on: ${t}`}function Ig(e){let t=e.configuredAutonomous===`source-dependent`?e.source===`skill`:e.configuredAutonomous,n=e.interactive!==!0&&void 0;return{autonomous:e.planFirst?!1:e.explicitAutonomous??n??t,worktree:e.hasGit?e.variants>1||e.forceWorktree===!0?!0:e.explicitWorktree??n??e.configuredWorktree:!1}}var Lg={text:``,source:null,runner:null,model:null,variants:1,planFirst:!1,worktree:null,autonomous:null,generateFollowups:null},Rg=`cez-new-task-draft`;function zg(e){return e===null?Rg:`${Rg}:${e}`}function Bg(e){let t=e&&typeof e==`object`?e:{};return{text:typeof t.text==`string`?t.text:``,source:Vg(t.source)?t.source:null,runner:typeof t.runner==`string`?t.runner:null,model:typeof t.model==`string`?t.model:null,variants:t.variants===2||t.variants===3?t.variants:1,planFirst:t.planFirst===!0,worktree:typeof t.worktree==`boolean`?t.worktree:null,autonomous:typeof t.autonomous==`boolean`?t.autonomous:null,generateFollowups:typeof t.generateFollowups==`boolean`?t.generateFollowups:null}}function Vg(e){return!!e&&typeof e==`object`&&(e.source===`skill`||e.source===`workflow`)&&typeof e.ref==`string`}var Hg=new Map;function Ug(e=null){let t=zg(e),n=Hg.get(t);if(n)return{...n};let r;try{let e=localStorage.getItem(t);r=e?Bg(JSON.parse(e)):{...Lg}}catch{r={...Lg}}return Hg.set(t,r),{...r}}function Wg(e,t=null){let n=zg(t);Hg.set(n,{...e});try{localStorage.setItem(n,JSON.stringify(e))}catch{}}function Gg(e=null){Wg({...Ug(e),text:``},e)}function Kg(e){let t=typeof e==`string`?new URLSearchParams(e):e;return{skill:(t.get(`skill`)??``).trim(),ref:(t.get(`ref`)??t.get(`task`)??``).trim(),auto:t.get(`auto`)===`1`,key:t.get(`key`)??``,todo:(t.get(`todo`)??``).trim()}}function qg(e,t,n){return{task:e,steps:[...n.steps],rationale:n.rationale,fallback:n.fallback,images:[...t]}}function Jg(e,t){return!Number.isInteger(t)||t<0||t>=e.length?[...e]:e.filter((e,n)=>n!==t)}function Yg(e,t,n){let r=[...e];if(!Number.isInteger(t)||t<0||t>=r.length)return r;let i=Math.max(0,Math.min(r.length-1,n));if(i===t)return r;let[a]=r.splice(t,1);return r.splice(i,0,a),r}function Xg(e){return e.command??e.prompt??``}function Zg(e,t=120){let n=e.split(`
|
|
27
|
-
`)[0]??``;return n.length>t?`${n.slice(0,t-1)}…`:n}function Qg(e){let{task:t,steps:n,model:r,runner:i,defaultRunner:a,variants:o,images:s,generateFollowups:c,todoId:l}=e;return{task:t,steps:[...n],model:r||void 0,runner:i===a?void 0:i,variants:o>1?o:void 0,images:s.length>0?[...s]:void 0,generateFollowups:c!==!1&&void 0,todoId:l||void 0}}function $g({...e}){return(0,U.jsx)(ni,{"data-slot":`alert-dialog`,...e})}function e_({...e}){return(0,U.jsx)(ri,{"data-slot":`alert-dialog-portal`,...e})}function t_({className:e,...t}){return(0,U.jsx)(ii,{"data-slot":`alert-dialog-overlay`,className:B(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function n_({className:e,...t}){return(0,U.jsxs)(e_,{children:[(0,U.jsx)(t_,{}),(0,U.jsx)(ai,{"data-slot":`alert-dialog-content`,className:B(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-md`,e),...t})]})}function r_({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:B(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function i_({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:B(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function a_({className:e,...t}){return(0,U.jsx)(ci,{"data-slot":`alert-dialog-title`,className:B(`text-lg leading-none font-semibold`,e),...t})}function o_({className:e,...t}){return(0,U.jsx)(li,{"data-slot":`alert-dialog-description`,className:B(`text-sm text-muted-foreground`,e),...t})}function s_({className:e,...t}){return(0,U.jsx)(oi,{"data-slot":`alert-dialog-action`,className:B(ut({variant:`contrast`}),e),...t})}function c_({className:e,...t}){return(0,U.jsx)(si,{"data-slot":`alert-dialog-cancel`,className:B(ut({variant:`outline`}),e),...t})}function l_({plan:e,starting:t,startAvailable:n,startUnavailableReason:r,startUnavailableAction:i,onStepsChange:a,onStart:o,onDiscard:s}){let[c,l]=(0,H.useState)(null),[u,d]=(0,H.useState)(null),f=()=>{l(null),d(null)},p=(t,n)=>{t.preventDefault(),c!==null&&c!==n&&a(Yg(e.steps,c,n)),f()},m=e.steps.length===0;return(0,U.jsx)(Ru,{open:!0,onOpenChange:e=>e?void 0:s(),children:(0,U.jsxs)(Hu,{"data-slot":`plan-review`,showCloseButton:!1,className:B(`top-0 left-0 flex h-dvh w-full max-w-full translate-x-0 translate-y-0 flex-col gap-0 rounded-none p-0`,`sm:top-1/2 sm:left-1/2 sm:h-auto sm:max-h-[85dvh] sm:max-w-[680px] sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-xl`),children:[(0,U.jsxs)(Uu,{className:`gap-1 border-b border-border px-5 pt-4 pb-3.5 text-left sm:text-left`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,U.jsx)(Wu,{className:`text-[11px] font-semibold tracking-[0.08em] text-muted-foreground uppercase`,children:`Proposed chain`}),(0,U.jsx)(Bu,{"aria-label":`Discard the plan`,className:`-mt-1 -mr-1 rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,U.jsx)(Pt,{"aria-hidden":`true`,className:`size-4`})})]}),(0,U.jsx)(Gu,{"data-slot":`plan-task`,title:e.task,className:`truncate text-[13.5px] font-medium text-foreground`,children:Zg(e.task)}),e.fallback?(0,U.jsx)(`p`,{"data-slot":`plan-fallback`,className:`text-xs text-soft-foreground italic`,children:`planner unavailable — single-step plan`}):e.rationale===``?null:(0,U.jsx)(`p`,{"data-slot":`plan-rationale`,className:`text-xs text-muted-foreground`,children:e.rationale})]}),(0,U.jsx)(`ol`,{"data-slot":`plan-steps`,className:`flex-1 space-y-2 overflow-y-auto px-5 py-4`,children:m?(0,U.jsx)(`li`,{className:`py-6 text-center text-sm text-muted-foreground`,children:`(no steps left — discard and plan again)`}):e.steps.map((t,n)=>(0,U.jsxs)(`li`,{"data-slot":`plan-step`,"data-step-id":t.id,draggable:!0,onDragStart:()=>l(n),onDragOver:e=>{e.preventDefault(),d(n)},onDragLeave:()=>d(e=>e===n?null:e),onDrop:e=>p(e,n),onDragEnd:f,className:B(`flex items-center gap-2.5 rounded-lg border border-border bg-card-2 px-3 py-2.5`,c===n&&`opacity-50`,u===n&&c!==null&&c!==n&&`border-ring`),children:[(0,U.jsx)(sr,{"aria-hidden":`true`,className:`size-3.5 shrink-0 cursor-grab text-soft-foreground`}),(0,U.jsx)(`span`,{className:`w-5 shrink-0 font-mono text-[11px] text-soft-foreground tabular-nums`,children:String(n+1).padStart(2,`0`)}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(`span`,{className:`truncate text-[13px] font-semibold`,children:t.name??t.id}),t.skill?(0,U.jsx)(`span`,{"data-slot":`plan-badge-skill`,title:`skill`,className:`shrink-0 rounded-full bg-violet/15 px-1.5 py-px font-mono text-[10.5px] font-medium text-violet`,children:t.skill}):null,t.command?(0,U.jsx)(`span`,{"data-slot":`plan-badge-check`,className:`shrink-0 rounded-full bg-muted px-1.5 py-px text-[10.5px] font-medium text-muted-foreground`,children:`check`}):null]}),(0,U.jsx)(`p`,{className:`truncate font-mono text-[11.5px] text-muted-foreground`,children:Xg(t)})]}),(0,U.jsxs)(`span`,{className:`flex shrink-0 items-center`,children:[(0,U.jsx)(P,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-slot":`plan-step-up`,"aria-label":`Move step ${n+1} up`,disabled:n===0,className:`size-7 text-muted-foreground`,onClick:()=>a(Yg(e.steps,n,n-1)),children:(0,U.jsx)(Hn,{"aria-hidden":`true`,className:`size-3.5`})}),(0,U.jsx)(P,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-slot":`plan-step-down`,"aria-label":`Move step ${n+1} down`,disabled:n===e.steps.length-1,className:`size-7 text-muted-foreground`,onClick:()=>a(Yg(e.steps,n,n+1)),children:(0,U.jsx)(zn,{"aria-hidden":`true`,className:`size-3.5`})}),(0,U.jsx)(P,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-slot":`plan-step-remove`,"aria-label":`Remove step ${n+1}`,className:`size-7 text-muted-foreground hover:text-danger`,onClick:()=>a(Jg(e.steps,n)),children:(0,U.jsx)(Pt,{"aria-hidden":`true`,className:`size-3.5`})})]})]},t.id))}),!n&&r?(0,U.jsxs)(`p`,{id:`plan-start-guidance`,className:`flex flex-wrap items-center gap-1.5 border-t border-border px-5 pt-3 text-xs text-muted-foreground`,children:[(0,U.jsx)(`span`,{children:r}),i]}):null,(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-5 py-3.5 pb-[max(14px,env(safe-area-inset-bottom))]`,children:[(0,U.jsxs)(P,{type:`button`,"data-slot":`plan-start`,disabled:m||t||!n,title:n?void 0:r,"aria-describedby":!n&&r?`plan-start-guidance`:void 0,onClick:o,children:[(0,U.jsx)(br,{"aria-hidden":`true`,className:`size-3.5`}),t?`Starting…`:`Start`]}),(0,U.jsx)(u_,{steps:e.steps,disabled:m}),(0,U.jsx)(P,{type:`button`,variant:`ghost`,className:`ml-auto`,onClick:s,children:`Discard`})]})]})})}function u_({steps:e,disabled:t}){let n=Se(),[r,i]=(0,H.useState)(!1),[a,o]=(0,H.useState)(``),[s,l]=(0,H.useState)(!1),[u,f]=(0,H.useState)(!1),p=async t=>{let r=a.trim();if(!(r===``||u)){f(!0);try{let a=await d({name:r,steps:e,...t?{overwrite:!0}:{}});F(`Saved — ${a.path.split(`/`).pop()??a.path}`),n.invalidateQueries({queryKey:c.workflows}),l(!1),i(!1),o(``)}catch(e){e instanceof y&&e.exists===!0?l(!0):F(e instanceof Error?e.message:String(e),{tone:`danger`})}finally{f(!1)}}};return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(P,{type:`button`,variant:`outline`,"data-slot":`plan-save`,disabled:t,onClick:()=>i(!0),children:`Save as chain`}),(0,U.jsx)(Ru,{open:r,onOpenChange:e=>i(!!e),children:(0,U.jsxs)(Hu,{"data-slot":`plan-save-dialog`,className:`sm:max-w-sm`,showCloseButton:!1,children:[(0,U.jsxs)(Uu,{children:[(0,U.jsx)(Wu,{children:`Save as chain`}),(0,U.jsx)(Gu,{children:`Saves these steps as a reusable workflow — it joins the picker like any other chain.`})]}),(0,U.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),p(!1)},children:[(0,U.jsx)(qu,{value:a,onChange:e=>o(e.target.value),"aria-label":`Chain name`,placeholder:`e.g. fix-and-verify-v2`,maxLength:80,autoFocus:!0}),(0,U.jsxs)(Q,{className:`mt-4`,children:[(0,U.jsx)(P,{type:`button`,variant:`outline`,onClick:()=>i(!1),children:`Cancel`}),(0,U.jsx)(P,{type:`submit`,disabled:a.trim()===``||u,children:u?`Saving…`:`Save`})]})]})]})}),(0,U.jsx)($g,{open:s,onOpenChange:e=>e?void 0:l(!1),children:(0,U.jsxs)(n_,{"data-slot":`plan-overwrite-dialog`,children:[(0,U.jsxs)(r_,{children:[(0,U.jsxs)(a_,{children:[`Overwrite “`,a.trim(),`”?`]}),(0,U.jsx)(o_,{children:`A chain with this name already exists. Overwriting replaces its steps with this plan.`})]}),(0,U.jsxs)(i_,{children:[(0,U.jsx)(c_,{children:`Keep the existing chain`}),(0,U.jsx)(s_,{onClick:()=>void p(!0),children:`Overwrite`})]})]})})]})}function d_(){let[e]=ie(),t=Kt(),n=Se(),{projectId:r}=E(),i=qt().projectId,a=De(),[o]=(0,H.useState)(()=>Kg(e)),s=w(),l=Dt(),u=Je(),d=lt(),f=kt(),p=le(),m=_e(),[h,g]=(0,H.useState)(()=>({...Ug(i),...o.ref===``?{}:{text:o.ref},...o.skill===``?{}:{source:{source:`skill`,ref:o.skill}}}));(0,H.useEffect)(()=>{Wg(h,i)},[h,i]);let _=e=>g(t=>({...t,...e})),v=f.data?.recentSources,y=u.data,b=f.data?.skillUsage,x=(0,H.useMemo)(()=>If(y??[],b),[y,b]),S=l.data?.workflows??[],C=a.data?.projects??[],ee=u.data!==void 0&&l.data!==void 0&&!f.isPending,T=ah([h.source,f.data?.lastTask],x,S),D=T.source===`workflow`?S.find(e=>e.name===T.ref):void 0,O=T.source===`skill`?x.find(e=>e.name===T.ref):void 0,te=(0,H.useRef)(null),ne=(0,H.useMemo)(()=>Ph(f.data?.promptTemplates),[f.data?.promptTemplates]),re=Lh(ne,T.source===`skill`?[T.ref]:[]),ae=(0,H.useRef)(h.text);ae.current=h.text;let k=(0,H.useRef)(``);(0,H.useEffect)(()=>{if(!ee)return;let e=Rh(ae.current,k.current,re);k.current=e.applied,e.text!==ae.current&&_({text:e.text})},[re,ee]);let A=Te(),oe=ye(A.data),se=s.data?.defaultRunner,ce=se??`claude`,j=oe.length>0?nh(h.runner,oe,ce):null,M=j??ce,ue=A.isSuccess&&oe.length>0,de=ft(),fe=j===null?[]:$m(j,de.data,[h.model,p.data?.defaultModels?.[j]]),pe=j===null?``:rh(h.model,j,p.data?.defaultModels,de.data),he=(0,H.useRef)(!1);(0,H.useEffect)(()=>{let e=ue&&!he.current;he.current=ue,e&&document.activeElement===document.body&&document.querySelector(`textarea[aria-label="Describe a task for the agent"]`)?.focus()},[ue]);let ge=s.data===void 0||s.data.repo!==null,ve=ge?h.variants:1,N=T.source===`skill`||T.ref===`quick-task`||D?.steps.length===1,be=ge,xe=!N||ve>1,Ce=Ig({hasGit:ge,variants:ve,forceWorktree:!N,planFirst:h.planFirst,explicitAutonomous:h.autonomous,explicitWorktree:h.worktree,interactive:O?.interactive,configuredAutonomous:m.data?.composerDefaults?.autonomous??m.data?.composerDefaults?.inheritedAutonomous??`source-dependent`,configuredWorktree:m.data?.composerDefaults?.worktree??m.data?.composerDefaults?.inheritedWorktree??!0,source:T.source}),we=Ce.worktree,Ee=Ce.autonomous,Oe=s.data===void 0||s.data.capabilities.followups,ke=Oe?h.generateFollowups??f.data?.lastGenerateFollowups??!0:!1,[Ae,Me]=(0,H.useState)(null),[Ne,Pe]=(0,H.useState)(!1),[P,Fe]=(0,H.useState)(!1),[Ie,Le]=(0,H.useState)(()=>o.auto&&o.ref!==``),[Re,ze]=(0,H.useState)(()=>!o.auto&&o.ref!==``?{kind:`prefill`}:null),Be=(0,H.useRef)(!1),Ve=(0,H.useRef)(!1);(0,H.useEffect)(()=>{Be.current||(Be.current=!0,e.toString()!==``&&t(`/new`,{replace:!0}))},[]),(0,H.useEffect)(()=>{if(!Ve.current&&!(!o.auto||o.ref===``)&&!A.isPending){if(!ue||j===null){Ve.current=!0,ze({kind:`prefill`}),Le(!1);return}if(!s.isPending){if(Ve.current=!0,se===void 0){ze({kind:`prefill`}),Le(!1);return}(async()=>{let e=``;try{e=(await je()).key}catch{}if(e!==``&&o.key===e)try{let e=await me(Ng(o,j,se));Gg(i),n.invalidateQueries({queryKey:c.runs.all}),t(sh(e));return}catch(e){ze({kind:`failed`,message:e instanceof Error?e.message:String(e)})}else ze({kind:`blocked`});Le(!1)})()}}},[se,s.isPending,A.isPending,ue,j]),(0,H.useEffect)(()=>{if(Re===null||!ee)return;ze(null);let e=o.skill!==``&&!x.some(e=>e.name===o.skill)?o.skill:``;e!==``&&_({text:Fg(o.skill,o.ref),...S.some(e=>e.name===`quick-task`)?{source:{source:`workflow`,ref:`quick-task`}}:{}});let{message:t,tone:n}=Pg(Re,e);F(t,{tone:n}),document.querySelector(`[data-slot="composer"] button[aria-label="Start task"], [data-slot="composer"] button[aria-label="Plan task"]`)?.focus()},[Re,ee]);let He=async(e,r)=>{if(!ue||j===null)throw Error(A.isPending?`Checking agent providers…`:A.isError?`Provider authentication could not be verified.`:`Connect an agent provider before starting a task.`);if(!ee)throw Error(`Still loading workflows and skills — try again in a second.`);if(h.planFirst){Pe(!0);try{Me(qg(e,r,await dt(e))),_({text:e})}finally{Pe(!1)}return}let a=await me(oh({task:e,source:T,model:pe,runner:j,defaultRunner:se,variants:ve,images:r,worktree:we,autonomous:Ee,generateFollowups:ke,todoId:o.todo}));rt({lastTask:T,recentSources:Ym(v,T),...Oe?{lastGenerateFollowups:ke}:{},...T.source===`skill`&&f.data!==void 0?{skillUsage:Rf(f.data.skillUsage,T.ref)}:{}}).then(()=>n.invalidateQueries({queryKey:c.uiState})).catch(()=>{}),Gg(i),n.invalidateQueries({queryKey:c.runs.all}),t(sh(a))},Ue=async()=>{if(!(Ae===null||Ae.steps.length===0||P||!ue||j===null)){Fe(!0);try{let e=await me(Qg({task:Ae.task,steps:Ae.steps,model:pe,runner:j,defaultRunner:se,variants:ve,images:Ae.images,generateFollowups:ke,todoId:o.todo}));Oe&&rt({lastGenerateFollowups:ke}).then(()=>n.invalidateQueries({queryKey:c.uiState})).catch(()=>{}),Gg(i),Me(null),n.invalidateQueries({queryKey:c.runs.all}),t(sh(e))}catch(e){F(e instanceof Error?e.message:String(e),{tone:`danger`})}finally{Fe(!1)}}};return Ie?(0,U.jsxs)(`div`,{"data-route":`new`,className:`relative isolate flex min-h-full flex-col items-center justify-center overflow-x-clip px-6`,children:[(0,U.jsx)(st,{}),(0,U.jsxs)(`div`,{"data-slot":`auto-starting`,role:`status`,className:`text-center`,children:[(0,U.jsx)(`h1`,{className:`animate-pulse text-lg font-semibold tracking-tight`,children:`Starting task…`}),(0,U.jsx)(`p`,{className:`mt-1.5 text-[13.5px] text-muted-foreground`,children:`Launched from a bookmarklet — taking you to the run.`})]})]}):(0,U.jsxs)(`div`,{"data-route":`new`,className:`relative isolate flex min-h-full flex-col items-center overflow-x-clip px-6 pt-[clamp(32px,7vh,84px)] pb-16 max-md:px-3.5 max-md:pt-7`,children:[(0,U.jsx)(st,{}),(0,U.jsxs)(`div`,{className:`w-full max-w-[720px]`,children:[(0,U.jsxs)(`header`,{className:`mb-6 text-center max-md:mb-4`,children:[(0,U.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight max-md:text-base`,children:`What should the agent work on?`}),(0,U.jsx)(`p`,{className:`mt-1.5 text-[13.5px] text-muted-foreground max-md:text-xs`,children:`Runs in an isolated worktree — review everything before it lands.`})]}),(0,U.jsx)(ig,{ref:te,onSubmit:He,value:h.text,onValueChange:e=>_({text:e}),autoFocus:!0,placeholder:`Describe a task for the agent — / for skills…`,ariaLabel:`Describe a task for the agent`,sendAriaLabel:h.planFirst?`Plan task`:`Start task`,disabled:!ue||P,disabledReason:A.isPending?`Checking agent providers…`:A.isError?`Provider authentication could not be verified.`:`Connect an agent provider before starting a task.`,autocompleteSkills:!0,footerStart:(0,U.jsxs)(U.Fragment,{children:[C.length>1&&r!==void 0?(0,U.jsx)(g_,{projects:C,projectId:r,onPick:e=>t(`/p/${encodeURIComponent(e)}/new`,{replace:!0})}):null,(0,U.jsx)(__,{source:T,ready:ee,skills:x,skillUsage:b,workflows:S,onPick:e=>_({source:e})}),(0,U.jsx)(Eh,{templates:ne,iconOnly:!0,onInsert:e=>te.current?.insertAtCaret(e)}),oe.length>1?(0,U.jsx)(dh,{runners:oe,value:M,disabled:!ue,onPick:e=>_({runner:e,model:null})}):null,(0,U.jsx)(uh,{slot:`model-pill`,ariaLabel:`Model`,label:fe.find(e=>e.id===pe)?.label??`auto`,value:pe,disabled:!ue,onPick:e=>_({model:e}),options:fe.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:eh(M,de.data,de.isError)}),(0,U.jsx)(uh,{slot:`variants-pill`,ariaLabel:`Parallel variants`,label:ve>1?`×${ve} variants`:`×1`,value:String(ve),onPick:e=>_({variants:Number(e)}),disabled:!ge,hint:`How many times to run this task in parallel — each variant gets its own worktree, and you pick the diff you keep. ×1 runs it once.`,disabledHint:`Parallel variants need a git repository — each variant runs in its own worktree.`,options:[{value:`1`,label:`×1`,desc:`One run`},{value:`2`,label:`×2 variants`,desc:`Two competing runs — pick the diff you keep`},{value:`3`,label:`×3 variants`,desc:`Three competing runs — pick the diff you keep`}]}),be?(0,U.jsx)(f_,{on:we,disabled:xe,disabledReason:ve>1?`Parallel variants always use isolated worktrees`:`Multi-step workflows require an isolated worktree`,onChange:e=>_({worktree:e})}):null,(0,U.jsx)(p_,{on:Ee,disabled:h.planFirst,onChange:e=>_({autonomous:e})}),O?.interactive&&(h.autonomous===null||h.worktree===null)?(0,U.jsx)(`p`,{className:`basis-full text-xs text-muted-foreground`,"data-slot":`interactive-skill-hint`,children:`This skill recommends an interactive run in the current checkout. You can change either setting.`}):null,Oe?(0,U.jsx)(m_,{on:ke,onChange:e=>_({generateFollowups:e})}):null,d.data?(0,U.jsx)(v_,{repo:d.data}):null]}),footerEnd:(0,U.jsxs)(U.Fragment,{children:[!ue&&!A.isPending?(0,U.jsx)(V,{to:`/settings/agents#providers`,className:`text-xs font-medium text-foreground underline underline-offset-4`,children:`Configure providers`}):null,(0,U.jsx)(y_,{planFirst:h.planFirst,planning:Ne,onModeChange:e=>_({planFirst:e})}),(0,U.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-[10.5px] font-medium text-muted-foreground`,children:qh()})]})}),(0,U.jsx)(x_,{onPick:e=>_({text:e})})]}),Ae===null?null:(0,U.jsx)(l_,{plan:Ae,starting:P,startAvailable:ue,startUnavailableReason:A.isPending?`Checking agent providers…`:A.isError?`Provider authentication could not be verified.`:`Connect an agent provider before starting a task.`,startUnavailableAction:A.isPending?void 0:(0,U.jsx)(V,{to:`/settings/agents#providers`,children:`Configure providers`}),onStepsChange:e=>Me(t=>t&&{...t,steps:e}),onStart:()=>void Ue(),onDiscard:()=>Me(null)})]})}function f_({on:e,disabled:t,disabledReason:n,onChange:r}){return(0,U.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":e,disabled:t,"data-slot":`worktree-toggle`,onClick:()=>r(!e),title:t?n:e?`Runs in an isolated worktree — uncheck to run in the repo working tree`:`Runs in the repo working tree — check to isolate in a worktree`,className:B(ch,e&&`border-primary/60 text-foreground`),children:[e?(0,U.jsx)(et,{"aria-hidden":`true`,className:`size-3 shrink-0 text-primary`}):(0,U.jsx)(Er,{"aria-hidden":`true`,className:`size-3 shrink-0 text-soft-foreground`}),`Worktree`]})}function p_({on:e,disabled:t,onChange:n}){return(0,U.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":e,disabled:t,"data-slot":`autonomous-toggle`,onClick:()=>n(!e),title:t?`Plan-first runs are interactive — autonomous is unavailable`:e?`Autonomous — the agent runs to completion without pausing for you`:`Runs interactively — check to let the agent finish without pausing for you`,className:B(ch,e&&!t&&`border-primary/60 text-foreground`),children:[e?(0,U.jsx)(et,{"aria-hidden":`true`,className:`size-3 shrink-0 text-primary`}):(0,U.jsx)(Er,{"aria-hidden":`true`,className:`size-3 shrink-0 text-soft-foreground`}),`Autonomous`]})}function m_({on:e,onChange:t}){return(0,U.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":e,"data-slot":`generate-followups-toggle`,onClick:()=>t(!e),title:e?`Agents can add newly discovered follow-up work to the task inbox`:`Follow-up generation is off; agents still maintain the handoff journal`,className:B(ch,e&&`border-primary/60 text-foreground`),children:[e?(0,U.jsx)(et,{"aria-hidden":`true`,className:`size-3 shrink-0 text-primary`}):(0,U.jsx)(Er,{"aria-hidden":`true`,className:`size-3 shrink-0 text-soft-foreground`}),`Follow-ups`]})}function h_(e,t){let n=t.trim().toLowerCase();if(n===``)return[...e];let r=e=>{let t=e.name.toLowerCase(),r=e.id.toLowerCase();return t.startsWith(n)||r.startsWith(n)?0:t.includes(n)||r.includes(n)?1:2};return e.map((e,t)=>({project:e,rank:r(e),index:t})).filter(e=>e.rank<2).sort((e,t)=>e.rank-t.rank||e.index-t.index).map(e=>e.project)}function g_({projects:e,projectId:t,onPick:n}){let[r,i]=(0,H.useState)(!1),[a,o]=(0,H.useState)(``),s=e.find(e=>e.id===t),c=h_(e,a);return(0,U.jsxs)(Sh,{open:r,onOpenChange:e=>{i(e),e||o(``)},children:[(0,U.jsx)(Ch,{asChild:!0,children:(0,U.jsxs)(`button`,{type:`button`,"data-slot":`project-pill`,"aria-label":`Project`,title:`Which project this task runs in — its skills, workflows, settings and draft`,className:B(ch,`border-foreground/60 font-semibold text-foreground`),children:[(0,U.jsx)(tr,{"aria-hidden":`true`,className:`size-3 shrink-0 text-soft-foreground`}),(0,U.jsx)(`span`,{className:`max-w-40 truncate`,children:s?.name??t}),lh]})}),(0,U.jsx)(wh,{align:`start`,sideOffset:8,className:`w-[300px] max-w-[calc(100vw-2rem)] p-0`,children:(0,U.jsxs)(hf,{shouldFilter:!1,children:[(0,U.jsx)(_f,{placeholder:`search projects…`,value:a,onValueChange:o}),(0,U.jsxs)(vf,{"data-slot":`project-menu`,className:`max-h-[min(18rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[c.length===0?(0,U.jsx)(yf,{children:`Nothing matches.`}):null,c.map(e=>(0,U.jsxs)(Sf,{value:e.id,keywords:[e.name],"data-slot":`project-option`,"data-project-id":e.id,disabled:e.status===`missing`,onSelect:()=>{n(e.id),i(!1)},children:[(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,children:e.name}),e.status===`missing`?(0,U.jsx)(`span`,{className:`shrink-0 text-[11px] text-soft-foreground`,children:`folder not found`}):e.branch===void 0?null:(0,U.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-soft-foreground`,children:e.branch}),e.id===t?(0,U.jsx)(et,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},e.id))]}),(0,U.jsx)(`p`,{className:`border-t border-border px-3 py-2 text-[11px] leading-snug text-soft-foreground`,children:`Skills, workflows, settings and the draft re-resolve against the selected project.`})]})})]})}function __({source:e,ready:t,skills:n,skillUsage:r,workflows:i,onPick:a}){let[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(``),[u,d]=(0,H.useState)(null),f=(0,H.useRef)(null),{mostUsed:p,project:m,global:h}=Ff(Xf(n,c,r),r),g=Zf(i,c),_=p.length===0&&m.length===0&&h.length===0&&g.length===0,v=e=>{a(e),s(!1)},y=(t,n)=>{let r=e.source===`skill`&&e.ref===t.name;return(0,U.jsxs)(Sf,{value:`skill ${t.name} ${t.path}`,keywords:Gf(t.name,t.description),"data-slot":`source-option`,"data-source-kind":`skill`,"data-source-ref":t.name,onSelect:()=>v({source:`skill`,ref:t.name}),children:[(0,U.jsx)(`span`,{className:B(`shrink-0 font-mono text-xs`,n&&`font-semibold`),children:t.name}),t.description?(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:t.description}):null,(0,U.jsx)(`button`,{type:`button`,"data-slot":`source-skill-view`,"aria-label":`View skill ${t.name}`,title:`View skill`,onClick:e=>{e.preventDefault(),e.stopPropagation(),d(t)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,U.jsx)(Qn,{"aria-hidden":`true`,className:`size-3.5`})}),r?(0,U.jsx)(et,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},t.path)};return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Mg,{skill:u,onClose:()=>d(null)}),(0,U.jsxs)(Sh,{open:o,onOpenChange:e=>{s(e),e||l(``)},children:[(0,U.jsx)(Ch,{asChild:!0,children:(0,U.jsxs)(`button`,{type:`button`,"data-slot":`source-pill`,"aria-label":`Choose a skill or workflow`,disabled:!t,className:B(ch,`border-foreground/60 font-mono text-[11.5px] font-semibold text-foreground`),children:[e.source===`skill`?(0,U.jsx)(Tr,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}):(0,U.jsx)(Or,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),(0,U.jsx)(`span`,{className:`max-w-44 truncate`,children:t?e.ref:`…`}),lh]})}),(0,U.jsx)(wh,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,U.jsxs)(hf,{shouldFilter:!1,children:[(0,U.jsx)(_f,{placeholder:`search skills & workflows…`,value:c,onValueChange:l,onInput:()=>f.current?.scrollTo(0,0)}),(0,U.jsxs)(vf,{ref:f,"data-slot":`source-menu`,className:`max-h-[min(18rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[_?(0,U.jsx)(yf,{children:`Nothing matches.`}):null,p.length>0?(0,U.jsx)(bf,{heading:`Most used`,children:p.map(e=>y(e,Mf(e)))}):null,m.length>0?(0,U.jsx)(bf,{heading:`Project skills`,children:m.map(e=>y(e,!0))}):null,g.length>0?(0,U.jsx)(bf,{heading:`Workflows`,children:g.map(t=>{let n=e.source===`workflow`&&e.ref===t.name;return(0,U.jsxs)(Sf,{value:`workflow ${t.name}`,keywords:Gf(t.name,t.description),"data-slot":`source-option`,"data-source-kind":`workflow`,"data-source-ref":t.name,onSelect:()=>v({source:`workflow`,ref:t.name}),children:[(0,U.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:t.name}),t.description?(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:t.description}):null,n?(0,U.jsx)(et,{"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-primary`}):null]},t.name)})}):null,h.length>0?(0,U.jsx)(bf,{heading:`Global`,children:h.map(e=>y(e,!1))}):null]})]})})]})]})}function v_({repo:e}){let t=Se(),n=pe({mutationFn:e=>Be({baseBranch:e}),onSuccess:e=>{t.invalidateQueries({queryKey:c.repo}),F(e.baseBranch?`New tasks will branch off "${e.baseBranch}" (PRs target it too).`:`Base branch cleared — new tasks fork from the checked-out branch.`)},onError:e=>F(e.message,{tone:`danger`})});return e.info?(0,U.jsx)(uh,{slot:`base-pill`,ariaLabel:`Base branch`,label:(0,U.jsxs)(`span`,{className:`font-mono text-[11.5px]`,children:[`base: `,e.baseBranch??e.info.branch]}),value:e.baseBranch??``,onPick:e=>n.mutate(e===``?null:e),options:[{value:``,label:`follow checked-out branch (${e.info.branch})`,desc:`New task worktrees fork from whatever branch is checked out`},...e.branches.map(e=>({value:e,label:e}))]}):null}function y_({planFirst:e,planning:t,onModeChange:n}){return(0,U.jsxs)(`div`,{"data-slot":`mode-seg`,role:`radiogroup`,"aria-label":`Run mode`,className:`inline-flex items-center gap-0.5 rounded-lg bg-muted p-[3px]`,children:[(0,U.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":!e,onClick:()=>n(!1),className:B(`h-6 rounded-md px-2 text-xs transition-colors`,e?`font-medium text-muted-foreground hover:text-foreground`:`bg-card font-semibold text-foreground shadow-xs`),children:`Start`}),(0,U.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e,"aria-busy":t||void 0,"data-slot":`mode-plan`,onClick:()=>n(!0),className:B(`h-6 rounded-md px-2 text-xs transition-colors`,e?`bg-contrast font-semibold text-contrast-foreground ring-2 ring-ring/55`:`font-medium text-muted-foreground hover:text-foreground`,t&&`animate-pulse`),children:t?`Planning…`:`Plan first`})]})}var b_=[`Fix a failing or flaky test`,`Summarize recent commits on this branch`,`Update the README for recent changes`];function x_({onPick:e}){return(0,U.jsx)(`div`,{className:`mt-7 flex flex-wrap justify-center gap-2 max-md:justify-start`,children:b_.map(t=>(0,U.jsxs)(`button`,{type:`button`,"data-slot":`suggested-chip`,onClick:()=>e(t),className:`inline-flex h-[30px] items-center gap-1.5 rounded-full border border-border px-3 text-[12.5px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,U.jsx)(Tr,{"aria-hidden":`true`,className:`size-3 shrink-0 text-soft-foreground`}),t]},t))})}function S_(){return(0,U.jsx)(`div`,{"data-route":`not-found`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(L,{icon:(0,U.jsx)(Xn,{}),tone:`neutral`,title:`Page not found`,subtitle:`Nothing lives at this address. The link may be mistyped, or it points at something that is gone.`,actions:(0,U.jsx)(P,{asChild:!0,variant:`outline`,children:(0,U.jsx)(V,{to:`/`,children:`Back to tasks`})})})})}function C_(){return(0,U.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(L,{icon:(0,U.jsx)(se,{className:`motion-safe:animate-spin`}),tone:`neutral`,title:`Loading repository…`,subtitle:`Fetching the repo's git state.`})})}function w_(){return(0,U.jsxs)(`div`,{"data-route":`skills`,className:`flex min-h-full flex-col`,children:[(0,U.jsxs)(`header`,{className:`sticky top-0 z-10 hidden h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5 md:flex`,children:[(0,U.jsx)(`h1`,{className:`text-base font-semibold`,children:`Skills`}),(0,U.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Markdown playbooks agents can follow.`})]}),(0,U.jsx)(`p`,{"data-slot":`skills-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading skills…`})]})}function T_({projectId:e,registry:t}){let n=t.projects.length?t.projects:[{id:t.bootProject,name:t.bootProject}];return(0,U.jsx)(`div`,{"data-route":`unknown-project`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(L,{icon:(0,U.jsx)(nr,{}),tone:`neutral`,title:`“${e}” isn’t registered here`,subtitle:`This cezar doesn’t serve a project by that id. The link may come from another machine’s workspace — these are the projects registered on this one:`,children:(0,U.jsx)(`ul`,{"data-slot":`registered-projects`,className:`mx-auto flex w-full max-w-xs flex-col gap-1.5 text-left`,children:n.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(g,{to:`/p/${encodeURIComponent(e.id)}/`,className:`flex items-baseline gap-2 rounded-md border border-border bg-card px-3 py-2 text-sm font-medium text-foreground shadow-xs transition-colors hover:bg-card-2`,children:[e.name||e.id,(0,U.jsxs)(`span`,{className:`font-mono text-[11px] font-normal text-soft-foreground`,children:[`/p/`,e.id]})]})},e.id))})})})}function E_(){return(0,U.jsx)(`div`,{"data-route":`workflows`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(L,{icon:(0,U.jsx)(se,{className:`motion-safe:animate-spin`}),tone:`neutral`,title:`Loading workflows…`,subtitle:`Fetching the saved chains and the skills palette.`})})}function D_({tab:e}){return(0,U.jsx)(`div`,{"data-route":`task-${e}`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(L,{icon:(0,U.jsx)(se,{className:`motion-safe:animate-spin`}),tone:`neutral`,title:e===`changes`?`Loading changes…`:`Loading files…`,subtitle:`Fetching the run record.`})})}function O_({tab:e,error:t}){let n=t instanceof y&&t.status===404;return(0,U.jsx)(`div`,{"data-route":`task-${e}`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(L,{icon:n?(0,U.jsx)(Mt,{}):(0,U.jsx)(Nt,{}),tone:n?`neutral`:`danger`,title:n?`Task not found`:`Could not load this task`,subtitle:n?`No run has this id. It may have been deleted, or the link is from another machine.`:t.message,actions:(0,U.jsx)(P,{asChild:!0,variant:`outline`,children:(0,U.jsx)(V,{to:`/`,children:`Back to tasks`})})})})}function k_(){return(0,U.jsx)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(L,{icon:(0,U.jsx)(se,{className:`motion-safe:animate-spin`}),tone:`neutral`,title:`Loading task…`,subtitle:`Fetching the run and its session transcript.`})})}var A_=1500;function j_(e,t){let n=(0,H.useMemo)(()=>e.split(`
|
|
28
|
-
`).map(e=>[{content:e}]),[e]),r=(0,H.useMemo)(()=>dg(t),[t]),i=n.length>A_,[a,o]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(r===null||i)return;let t=!1;return Cg(e,r).then(n=>{t||o({key:e,tokens:n.tokens})}),()=>{t=!0}},[e,r,i]),r===null||i?n:a?.key===e?a.tokens:Sg(e,r)?.tokens??n}var M_=`m-0 min-h-full w-full whitespace-pre font-mono text-xs leading-[1.7] px-3 py-2 [tab-size:2]`;function N_({value:e,onChange:t,language:n,readOnly:r,className:i,...a}){let o=j_(e,n),s=(0,H.useRef)(null),c=(0,H.useRef)(null),l=()=>{let e=c.current,t=s.current;!e||!t||(t.scrollTop=e.scrollTop,t.scrollLeft=e.scrollLeft)};return(0,H.useLayoutEffect)(l,[e]),(0,U.jsxs)(`div`,{"data-slot":`code-editor`,className:B(`relative overflow-hidden rounded-md border border-input bg-card`,i),children:[(0,U.jsx)(`pre`,{ref:s,"aria-hidden":`true`,className:B(M_,`pointer-events-none absolute inset-0 overflow-auto text-soft-foreground`),children:o.map((e,t)=>(0,U.jsx)(`span`,{className:`block`,children:e.length===0?`
|
|
29
|
-
`:(0,U.jsxs)(U.Fragment,{children:[e.map((e,t)=>(0,U.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t)),`
|
|
30
|
-
`]})},t))}),(0,U.jsx)(`textarea`,{ref:c,"data-slot":`code-editor-input`,value:e,readOnly:r,onChange:e=>t?.(e.target.value),onScroll:l,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`,autoComplete:`off`,wrap:`off`,className:B(M_,`relative block resize-none overflow-auto bg-transparent text-transparent caret-foreground outline-none`,`selection:bg-primary/30 focus-visible:ring-0`,r&&`cursor-default`),...a})]})}var P_=`An editor-plus-commit: a saved change reaches a run after you commit it to the base branch.`;function F_(e){return t=>t.runners.includes(e)}function I_(e,t,n,r){let i=F_(e);return{id:t,label:n,note:r,files:t===`mcp`?e=>i(e)&&(e.holdsMcp===!0||e.kind===`mcp`):e=>i(e)&&e.kind===t}}var L_=[{id:`claude`,label:`Claude`,groups:[I_(`claude`,`settings`,`Settings`),I_(`claude`,`mcp`,`MCP`,`A dedicated .mcp.json (key: mcpServers), shared via version control.`),I_(`claude`,`memory`,`Memory & instructions`)]},{id:`codex`,label:`Codex`,note:P_,groups:[I_(`codex`,`settings`,`Settings`),I_(`codex`,`mcp`,`MCP`,`Inside config.toml under [mcp_servers.<id>] — the same file as Codex’s settings.`),I_(`codex`,`memory`,`Memory & instructions`)]},{id:`opencode`,label:`OpenCode`,note:P_,groups:[I_(`opencode`,`settings`,`Settings`),I_(`opencode`,`mcp`,`MCP`,`Under the "mcp" key in opencode.json — the same file as OpenCode’s settings.`),I_(`opencode`,`memory`,`Memory & instructions`)]}];function R_(e){let t=L_.find(t=>t.id===e);if(!t)throw Error(`no agent descriptor for ${e}`);return t}function z_(e){return e.seeded?`Copied into each run’s worktree — takes effect on your next run.`:e.tracked===`tracked`?`Runs read the committed copy — this edit applies after you commit it.`:e.tracked===`outside-repo`?`Applies to every session on this machine.`:`Personal, git-ignored.`}function B_(){let e=Qe(),t=w(),n=(0,H.useMemo)(()=>t.data?th(t.data.checks):L_.map(e=>e.id),[t.data]);return e.isPending?(0,U.jsx)(`p`,{"data-slot":`agent-config-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading agent config…`}):e.isError?(0,U.jsx)(L,{icon:(0,U.jsx)($n,{}),tone:`danger`,title:`Agent config did not load`,subtitle:e.error.message,heading:`h2`}):(0,U.jsx)(V_,{listing:e.data,installed:n})}function V_({listing:e,installed:t}){let[n,r]=(0,H.useState)(`claude`),[i,a]=(0,H.useState)(null),o=R_(n),s=e.files.find(e=>e.id===i)??null,c=e=>{r(e),a(null)};return(0,U.jsxs)(`div`,{"data-slot":`agent-config`,className:`flex flex-col gap-4 p-4 md:p-6`,children:[!e.editable&&(0,U.jsx)(`div`,{"data-slot":`agent-config-readonly`,className:`rounded-md border border-border bg-muted/40 px-3 py-2 text-[13px] text-soft-foreground`,children:`Read-only: agent config is edited from the machine that owns the checkout (this cockpit runs in hosted mode). You can still see every file and which one wins.`}),(0,U.jsx)(`div`,{"data-slot":`agent-config-agents`,role:`tablist`,className:`flex flex-wrap gap-1 rounded-md bg-muted/40 p-1`,children:L_.map(e=>(0,U.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":e.id===o.id,"data-slot":`agent-config-agent`,"data-agent":e.id,"data-selected":e.id===o.id,onClick:()=>c(e.id),className:B(`flex items-center gap-2 rounded-md px-3 py-1.5 text-[13px] transition-colors`,e.id===o.id?`bg-background font-semibold shadow-sm`:`hover:bg-muted/60`),children:[e.label,!t.includes(e.id)&&(0,U.jsx)(Lu,{variant:`outline`,className:`text-[10px] text-soft-foreground`,children:`not installed`})]},e.id))}),o.note&&(0,U.jsx)(`p`,{"data-slot":`agent-config-agent-note`,className:`text-[12px] text-soft-foreground`,children:o.note}),(0,U.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[minmax(0,20rem)_minmax(0,1fr)]`,children:[(0,U.jsx)(`nav`,{"data-slot":`agent-config-nav`,className:`flex flex-col gap-5`,children:(0,U.jsx)(H_,{agent:o,listing:e,selectedId:i,onSelect:a})}),(0,U.jsx)(`div`,{"data-slot":`agent-config-editor-pane`,children:s?(0,U.jsx)(W_,{file:s},s.id):(0,U.jsx)(`div`,{className:`flex h-full min-h-40 items-center justify-center rounded-md border border-dashed border-border text-[13px] text-soft-foreground`,children:`Select a config file to view or edit it.`})})]})]})}function H_({agent:e,listing:t,selectedId:n,onSelect:r}){return(0,U.jsx)(U.Fragment,{children:e.groups.map(i=>{let a=t.files.filter(i.files),o=e.id===`claude`&&i.id===`mcp`;return a.length===0&&!(o&&t.userMcp)?null:(0,U.jsxs)(`section`,{"data-slot":`agent-config-group`,"data-group":i.id,"data-agent":e.id,children:[(0,U.jsx)(`p`,{className:`mb-1 text-[11px] font-medium uppercase tracking-wide text-soft-foreground`,children:i.label}),i.note&&(0,U.jsx)(`p`,{className:`mb-2 text-[12px] text-soft-foreground`,children:i.note}),(0,U.jsx)(`ul`,{className:`flex flex-col gap-1`,children:a.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,"data-slot":`agent-config-file`,"data-selected":e.id===n,onClick:()=>r(e.id),className:B(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] transition-colors`,e.id===n?`bg-primary/15 text-foreground`:`hover:bg-muted/60`),children:[(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[12px]`,children:e.label}),e.seeded&&(0,U.jsx)(Lu,{variant:`outline`,className:`shrink-0 text-[10px]`,children:`seeded`}),!e.exists&&(0,U.jsx)(`span`,{className:`shrink-0 text-[11px] text-soft-foreground`,children:`absent`})]})},e.id))}),o&&t.userMcp&&(0,U.jsx)(U_,{userMcp:t.userMcp})]},i.id)})})}function U_({userMcp:e}){return(0,U.jsxs)(`div`,{"data-slot":`agent-config-user-mcp`,className:`mt-3`,children:[(0,U.jsx)(`h4`,{className:`mb-1 text-[12px] font-semibold`,children:`User & local scopes`}),(0,U.jsxs)(`p`,{className:`mb-2 text-[12px] text-soft-foreground`,children:[`Managed by `,(0,U.jsx)(`code`,{className:`font-mono`,children:`claude mcp add`}),` in `,e.path,` — cezar does not edit Claude’s state file.`]}),e.readable?e.servers.length>0?(0,U.jsx)(`ul`,{className:`flex flex-wrap gap-1`,children:e.servers.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsx)(Lu,{variant:`outline`,className:`font-mono text-[11px]`,children:e})},e))}):(0,U.jsx)(`p`,{className:`text-[12px] text-soft-foreground`,children:`No user-scoped MCP servers.`}):(0,U.jsx)(`p`,{className:`text-[12px] text-soft-foreground`,children:`Could not read the file.`})]})}function W_({file:e}){let t=ae(e.id),n=ke(e.id),[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(!1),[s,c]=(0,H.useState)(null),l=t.data?.version??null;(0,H.useEffect)(()=>{t.data&&(i(t.data.content),o(!1),c(null))},[t.data?.version,t.data]);let u=r??t.data?.content??``,d=t.data?u!==t.data.content:!1,f=e.writable;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.label}),(0,U.jsx)(Lu,{variant:`outline`,className:`text-[10px] uppercase`,children:e.format}),(0,U.jsx)(`a`,{href:e.docsUrl,target:`_blank`,rel:`noreferrer`,className:`text-[12px] text-soft-foreground underline hover:text-foreground`,children:`docs`})]}),(0,U.jsx)(`p`,{"data-slot":`agent-config-precedence`,className:`text-[12px] text-soft-foreground`,children:e.precedence}),(0,U.jsxs)(`p`,{"data-slot":`agent-config-effect`,className:`text-[12px] text-foreground/80`,children:[z_(e),e.hotReload?` ${e.hotReload}`:``]}),t.isPending?(0,U.jsx)(`p`,{className:`text-[13px] text-soft-foreground`,children:`Loading file…`}):t.isError?(0,U.jsx)(`p`,{className:`text-[13px] text-destructive`,children:t.error.message}):(0,U.jsx)(N_,{value:u,language:e.format,readOnly:!f,onChange:i,"aria-label":`${e.label} contents`,className:`h-[26rem]`}),s&&(0,U.jsx)(`p`,{"data-slot":`agent-config-format-error`,className:`text-[12px] text-destructive`,children:s}),a&&(0,U.jsxs)(`div`,{"data-slot":`agent-config-conflict`,className:`flex items-center justify-between gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px]`,children:[(0,U.jsx)(`span`,{children:`The file changed on disk since you opened it.`}),(0,U.jsx)(P,{size:`sm`,variant:`outline`,onClick:()=>void t.refetch(),children:`Reload from disk`})]}),f&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(P,{size:`sm`,onClick:()=>{c(null),o(!1),n.mutate({content:u,version:l},{onSuccess:()=>{i(null),F(`${e.exists?`Saved`:`Created`} ${e.label}`)},onError:e=>{e instanceof y&&e.status===409?o(!0):e instanceof y&&e.status===400?c(e.message):F(e.message,{tone:`danger`})}})},disabled:!d||n.isPending,children:e.exists?`Save`:`Create`}),(0,U.jsx)(P,{size:`sm`,variant:`ghost`,onClick:()=>i(null),disabled:!d||n.isPending,children:`Revert`}),d&&(0,U.jsx)(`span`,{className:`text-[12px] text-soft-foreground`,children:`Unsaved changes`})]})]})}function G_({className:e,size:t=`default`,...n}){return(0,U.jsx)(ku,{"data-slot":`switch`,"data-size":t,className:B(`peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...n,children:(0,U.jsx)(ju,{"data-slot":`switch-thumb`,className:B(`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0`)})})}var K_=[{id:`claude`,label:`Claude Code`,login:`claude auth login`},{id:`codex`,label:`Codex`,login:`codex login`},{id:`opencode`,label:`OpenCode`,login:`opencode auth login`}],q_=e=>({claude:e,codex:e,opencode:e}),J_={connected:{label:`Credentials found`,tone:`success`},disconnected:{label:`Not connected`,tone:`pending`},"not-installed":{label:`Not installed`,tone:`neutral`},unknown:{label:`Could not verify`,tone:`danger`}};function Y_(e,t,n){return{providers:e.providers.map(e=>e.provider===t?{...e,enabled:n}:e)}}function X_(){let e=Te(),t=de(),n=Fe(),r=Se(),[i,a]=(0,H.useState)(null),o=(0,H.useRef)(Promise.resolve()),s=(0,H.useRef)(q_(0)),c=(0,H.useRef)(q_(0)),l=(0,H.useRef)(e.data);(0,H.useEffect)(()=>{i&&Ct(e.data,i.provider)?.status===`connected`&&a(null)},[i,e.data]),(0,H.useEffect)(()=>{if(e.data){if(Object.values(c.current).every(e=>e===0)||!l.current){l.current=e.data;return}l.current={providers:e.data.providers.map(e=>({...e,enabled:c.current[e.provider]>0?Ct(l.current,e.provider)?.enabled??e.enabled:e.enabled}))}}},[e.data]);let u=(0,H.useCallback)((e,t)=>{let n=N.providerStatus,i=r.getQueryData(n);if(!i)return;l.current||=i;let a=Y_(i,e,t);c.current[e]+=1,r.setQueryData(n,a);let u=++s.current[e];o.current=o.current.then(async()=>{try{let i=await bt(e,t),a=Ct(i,e)?.enabled;if(a===void 0)return;if(l.current=Y_(l.current??i,e,a),u===s.current[e]){let t=r.getQueryData(n);r.setQueryData(n,t?Y_(t,e,a):i)}}catch(t){if(u===s.current[e]){let i=Ct(l.current,e)?.enabled,a=r.getQueryData(n);a&&i!==void 0?r.setQueryData(n,Y_(a,e,i)):l.current?r.setQueryData(n,l.current):r.removeQueries({queryKey:n,exact:!0}),F(t instanceof Error?t.message:String(t),{tone:`danger`})}}finally{--c.current[e]}})},[r]),d=pe({mutationFn:ue,onSuccess:async e=>{a(null),F(e.opened?`Finish signing in in the terminal, then check again.`:`Provider is already connected.`),await r.invalidateQueries({queryKey:N.providerStatus})},onError:(e,t)=>{if(e instanceof y&&e.command){let n=K_.find(e=>e.id===t)?.label??t;a({provider:t,label:n,message:e.message,command:e.command});return}F(e.message,{tone:`danger`})}}),f=async e=>{try{await navigator.clipboard.writeText(e),F(`Command copied`)}catch{F(`Could not copy the command`,{tone:`danger`})}};return(0,U.jsxs)(`section`,{id:`providers`,"data-slot":`provider-settings`,className:`scroll-mt-20`,children:[(0,U.jsxs)(`div`,{className:`mb-2`,children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Providers`}),(0,U.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Connect the coding agents available on this computer.`})]}),e.isError?(0,U.jsxs)(`div`,{role:`alert`,className:`mb-3 flex flex-wrap items-center justify-between gap-2 rounded-md border border-danger/30 bg-danger/5 px-3 py-2.5`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:`Provider status could not be loaded`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.error.message})]}),(0,U.jsx)(P,{type:`button`,variant:`outline`,size:`sm`,disabled:e.isFetching,onClick:()=>void e.refetch(),children:`Retry`})]}):null,(0,U.jsx)(`div`,{className:`flex flex-col gap-2`,children:K_.map(r=>{let a=Ct(e.data,r.id),o=a?.status,s=o?J_[o]:e.isPending?{label:`Checking…`,tone:`neutral`}:J_.unknown,c=d.isPending&&d.variables===r.id,l=o===`disconnected`||o===`unknown`,p=a?.authFailureId;return(0,U.jsxs)(H.Fragment,{children:[(0,U.jsxs)(`div`,{"data-slot":`provider-card`,"data-provider":r.id,className:`rounded-md border border-border bg-card px-3.5 py-3`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h3`,{className:`text-[13px] font-semibold text-foreground`,children:r.label}),(0,U.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,U.jsx)(rd,{tone:s.tone,pulse:e.isPending}),(0,U.jsx)(`span`,{children:s.label}),a?.enabled===!1?(0,U.jsx)(`span`,{children:`Disabled`}):null]}),o===`not-installed`?(0,U.jsxs)(`p`,{className:`mt-1.5 text-xs text-soft-foreground`,children:[`Install `,r.label,`, then run `,(0,U.jsx)(`code`,{children:r.login}),`.`]}):o===`unknown`||e.isError&&!o?(0,U.jsx)(`p`,{className:`mt-1.5 text-xs text-soft-foreground`,children:`Verification failed. Check again when the provider is available.`}):a?.hint?(0,U.jsx)(`p`,{className:`mt-1.5 text-xs text-soft-foreground`,children:a.hint}):null]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o===`not-installed`?null:(0,U.jsx)(G_,{checked:a?.enabled??!0,"aria-label":`Use ${r.label}`,onCheckedChange:e=>u(r.id,e)}),l?(0,U.jsx)(P,{type:`button`,variant:`ghost`,size:`sm`,disabled:t.isPending,onClick:()=>t.mutate(void 0,{onError:e=>F(e.message,{tone:`danger`})}),children:`Check again`}):null,o===`disconnected`?(0,U.jsx)(P,{type:`button`,variant:`outline`,size:`sm`,disabled:d.isPending,onClick:()=>d.mutate(r.id),children:c?`Opening…`:`Connect`}):null,p===void 0?null:(0,U.jsx)(P,{type:`button`,variant:`outline`,size:`sm`,disabled:n.isPending,onClick:()=>n.mutate({provider:r.id,authFailureId:p},{onSuccess:()=>F(`${r.label} can be tried again.`),onError:e=>F(e.message,{tone:`danger`})}),children:`Try again`})]})]}),p===void 0?null:(0,U.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`Use this after completing the provider sign-in flow. cezar cannot validate the credential without a task/model request; it will verify it on the next task.`})]}),i?.provider===r.id&&o!==`connected`?(0,U.jsxs)(`div`,{role:`region`,"aria-label":`${i.label} manual sign-in`,className:`rounded-md border border-pending/40 bg-pending/5 px-3.5 py-3`,children:[(0,U.jsx)(`p`,{className:`text-[13px] text-foreground`,children:i.message}),(0,U.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(`code`,{className:`min-w-0 flex-1 overflow-x-auto rounded-sm bg-muted px-2 py-1.5 text-xs`,children:i.command}),(0,U.jsx)(P,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void f(i.command),children:`Copy command`})]})]}):null]},r.id)})})]})}var Z_=2e4;function Q_(){let e=le(),t=ft(),n=Te();return e.isPending?(0,U.jsx)(`p`,{"data-slot":`agents-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading agent settings…`}):e.isError?(0,U.jsx)(L,{icon:(0,U.jsx)(Gn,{}),tone:`danger`,title:`Agent settings did not load`,subtitle:e.error.message,heading:`h2`}):(0,U.jsx)($_,{config:e.data,catalog:t.data,providerStatus:n})}function $_({config:e,catalog:t,providerStatus:n}){let r=lt(),i=Se(),a=pe({mutationFn:e=>Be(e),onSuccess:e=>{i.setQueryData(c.config,e),i.invalidateQueries({queryKey:c.health}),i.invalidateQueries({queryKey:c.repo})},onError:e=>F(e.message,{tone:`danger`})}),[o,s]=(0,H.useState)(e.systemPrompt??``),l=o.trim(),u=l===(e.systemPrompt??``),d=l.length>Z_;return(0,U.jsxs)(`div`,{"data-slot":`agents-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-7 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,U.jsx)(X_,{}),(0,U.jsxs)(ev,{title:`Default runner`,hint:`Preselected for new tasks and used by the chain planner. Each task can still pick another runner.`,children:[(0,U.jsx)(`div`,{role:`radiogroup`,"aria-label":`Default runner`,"data-slot":`agents-runner`,className:`inline-flex w-fit gap-0.5 rounded-md border border-border bg-card p-0.5`,children:Xm.map(t=>{let r=t.id===e.defaultRunner,i=Ct(n.data,t.id),o=!n.isPending&&!n.isError&&i?.enabled===!0&&i.status===`connected`,s=n.isPending?`Checking provider authentication…`:n.isError?`Provider authentication could not be verified.`:i?.enabled===!1?`This provider is disabled. Enable it above or choose another provider.`:o?void 0:`Connect this provider before selecting it.`;return(0,U.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-value":t.id,title:s??t.desc,disabled:a.isPending||!o,onClick:()=>a.mutate({defaultRunner:t.id}),className:B(`rounded-sm px-3 py-1.5 font-mono text-[13px] font-medium transition-colors disabled:opacity-50`,r?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:t.label},t.id)})}),!n.isPending&&!n.isError&&Ct(n.data,e.defaultRunner)?.enabled===!1?(0,U.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`This provider is disabled. Enable it above or choose another provider.`}):null]}),(0,U.jsx)(ev,{title:`Default models`,hint:`The model preselected in the composer for each runner. Auto lets the runner decide per task.`,children:(0,U.jsx)(`div`,{className:`flex max-w-md flex-col gap-2`,children:Xm.map(r=>{let i=Ct(n.data,r.id),o=!n.isPending&&!n.isError&&i?.enabled===!0&&i.status===`connected`,s=n.isPending?`Checking provider authentication…`:n.isError?`Provider authentication could not be verified.`:i?.enabled===!1?`This provider is disabled. Enable it above or choose another provider.`:o?void 0:`Connect this provider before selecting it.`;return(0,U.jsxs)(`label`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`span`,{className:`w-24 shrink-0 font-mono text-xs text-muted-foreground`,children:r.label}),(0,U.jsxs)(`select`,{"aria-label":`Default model for ${r.label}`,"data-slot":`agents-model`,"data-runner":r.id,value:e.defaultModels[r.id]??``,title:s??r.desc,disabled:a.isPending||!o,onChange:e=>a.mutate({defaultModels:{[r.id]:e.target.value||null}}),className:`block w-full rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[$m(r.id,t,[e.defaultModels[r.id]]).map(e=>(0,U.jsx)(`option`,{value:e.id,children:e.id===``?`auto (default)`:e.label},e.id)),eh(r.id,t)?(0,U.jsx)(`option`,{disabled:!0,children:eh(r.id,t)}):null]})]},r.id)})})}),(0,U.jsxs)(ev,{title:`System prompt`,hint:`Extra instructions appended to every run, whichever runner executes it. This is the only place it is edited.`,children:[(0,U.jsx)(Ft,{"aria-label":`System prompt`,"data-slot":`agents-system-prompt`,value:o,onChange:e=>s(e.target.value),placeholder:`Extra rules for every agent run — conventions, tone, review requirements…`,className:`min-h-32 max-w-xl`}),(0,U.jsxs)(`div`,{className:`flex max-w-xl items-center gap-3`,children:[(0,U.jsx)(P,{type:`button`,variant:`outline`,size:`sm`,"data-action":`agents-save-prompt`,disabled:u||d||a.isPending,onClick:()=>a.mutate({systemPrompt:l===``?null:l},{onSuccess:()=>F(l===``?`System prompt cleared`:`System prompt saved`)}),children:`Save`}),d?(0,U.jsxs)(`p`,{"data-slot":`agents-prompt-limit`,className:`text-[11px] text-danger`,children:[l.length.toLocaleString(),` characters — the limit is`,` `,Z_.toLocaleString(),`.`]}):(0,U.jsx)(`p`,{className:`text-[11px] text-soft-foreground`,children:`Leave empty and save to clear. Applied to new runs only.`})]})]}),(0,U.jsx)(ev,{title:`Live title updates`,hint:`Refresh a task's short title through the namer model as the run progresses. A manual rename always wins and stops updates for that task.`,children:(0,U.jsxs)(`label`,{className:`flex w-fit items-center gap-3`,children:[(0,U.jsx)(G_,{"aria-label":`Live title updates`,"data-slot":`agents-live-title-updates`,checked:e.liveTitleUpdates??!0,disabled:a.isPending,onCheckedChange:e=>a.mutate({liveTitleUpdates:e},{onSuccess:()=>F(e?`Live title updates on`:`Live title updates off`)})}),(0,U.jsxs)(`span`,{className:`text-[13px] text-muted-foreground`,children:[e.liveTitleUpdates??!0?`On`:`Off`,e.liveTitleUpdates===null&&` (default)`]})]})}),(0,U.jsx)(ev,{title:`Review changes before finishing`,hint:`When on, a task with changes pauses so you can Accept, Send back, or open a Draft PR. Autonomous tasks always skip this and finish on their own. Default: off — tasks finish without asking.`,children:(0,U.jsxs)(`label`,{className:`flex w-fit items-center gap-3`,children:[(0,U.jsx)(G_,{"aria-label":`Review changes before finishing`,"data-slot":`agents-review-gate`,checked:e.reviewGate??!1,disabled:a.isPending,onCheckedChange:e=>a.mutate({reviewGate:e},{onSuccess:()=>F(e?`Review gate on`:`Review gate off`)})}),(0,U.jsxs)(`span`,{className:`text-[13px] text-muted-foreground`,children:[e.reviewGate??!1?`On`:`Off`,e.reviewGate===null&&` (default)`]})]})}),(0,U.jsx)(ev,{title:`Base branch`,hint:`New task worktrees branch from this and draft PRs target it. Also settable from the Git view.`,children:r.data?.info?(0,U.jsxs)(`select`,{"aria-label":`Base branch`,"data-slot":`agents-base-branch`,value:e.baseBranch??``,disabled:a.isPending,onChange:e=>a.mutate({baseBranch:e.target.value||null}),className:`block w-full max-w-md rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,U.jsx)(`option`,{value:``,children:`follow checked-out branch (default)`}),r.data.branches.map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))]}):(0,U.jsx)(`p`,{"data-slot":`agents-base-branch-unavailable`,className:`text-[13px] text-soft-foreground`,children:r.isPending?`Loading branches…`:`Not a git repository — tasks run in place, no branching.`})})]})}function ev({title:e,hint:t,children:n}){return(0,U.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:e}),(0,U.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:t})]}),n]})}var tv=`cez-accent`,nv=`cez-density`,rv=`lime`,iv=`comfortable`;function av(e){return e===`lime`||e===`violet`?e:rv}function ov(e){return e===`comfortable`||e===`compact`||e===`ultra`?e:iv}function sv(e){let t=e&&typeof e==`object`?e:{};return{accent:av(t.accent),density:ov(t.density)}}function cv(){try{return{accent:av(localStorage.getItem(tv)),density:ov(localStorage.getItem(nv))}}catch{return{accent:rv,density:iv}}}function lv(e){try{localStorage.setItem(tv,e.accent),localStorage.setItem(nv,e.density)}catch{}}function uv(e,t){t.accent===`lime`?delete e.dataset.accent:e.dataset.accent=t.accent,t.density===`comfortable`?delete e.dataset.density:e.dataset.density=t.density}var dv=H.createContext(null);function fv({children:e}){let t=Se(),n=m(),[r,i]=H.useState(cv),a=n.data;H.useEffect(()=>{if(a===void 0)return;let e=sv(a.appearance);i(e),lv(e)},[a]),H.useLayoutEffect(()=>{uv(document.documentElement,r)},[r]);let o=H.useCallback(e=>{i(e),lv(e),He({appearance:e}).then(e=>t.setQueryData(N.uiState,e)).catch(e=>{F(e instanceof Error?e.message:String(e),{tone:`danger`}),t.invalidateQueries({queryKey:N.uiState})})},[t]),s=H.useCallback(e=>o({accent:e,density:r.density}),[o,r.density]),c=H.useCallback(e=>o({accent:r.accent,density:e}),[o,r.accent]),l=H.useMemo(()=>({accent:r.accent,density:r.density,setAccent:s,setDensity:c}),[r,s,c]);return(0,U.jsx)(dv.Provider,{value:l,children:e})}function pv(){let e=H.useContext(dv);if(!e)throw Error(`cezar: useAppearance() must be called inside <AppearanceProvider>`);return e}var mv=[{value:`system`,label:`System`,icon:pr},{value:`light`,label:`Light`,icon:Dr},{value:`dark`,label:`Dark`,icon:mr}],hv=[{value:`lime`,label:`Lime`,swatch:`var(--accent-lime)`},{value:`violet`,label:`Violet`,swatch:`var(--violet)`}],gv=[{value:`comfortable`,label:`Comfortable`},{value:`compact`,label:`Compact`},{value:`ultra`,label:`Compact for real`}];function _v({slot:e,label:t,value:n,options:r,onChange:i}){return(0,U.jsx)(`div`,{role:`radiogroup`,"aria-label":t,"data-slot":e,className:`inline-flex w-fit gap-0.5 rounded-md border border-border bg-card p-0.5`,children:r.map(e=>{let t=e.value===n;return(0,U.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,"data-value":e.value,onClick:()=>i(e.value),className:B(`flex items-center gap-2 rounded-sm px-3 py-1.5 text-[13px] font-medium transition-colors`,t?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:[e.icon?(0,U.jsx)(e.icon,{"aria-hidden":`true`,className:`size-3.5`}):null,e.swatch?(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`size-3 rounded-full border border-border`,style:{background:e.swatch}}):null,e.label]},e.value)})})}function vv({title:e,hint:t,children:n}){return(0,U.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:e}),(0,U.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:t})]}),n]})}function yv(){let{theme:e,setTheme:t}=hd(),{accent:n,density:r,setAccent:i,setDensity:a}=pv();return(0,U.jsxs)(`div`,{"data-slot":`appearance-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-7 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,U.jsx)(vv,{title:`Theme`,hint:`System follows your OS preference. Applies to this browser.`,children:(0,U.jsx)(_v,{slot:`appearance-theme`,label:`Theme`,value:e,options:mv,onChange:t})}),(0,U.jsx)(vv,{title:`Accent`,hint:`The primary action color. Saved with this repo's cockpit state.`,children:(0,U.jsx)(_v,{slot:`appearance-accent`,label:`Accent`,value:n,options:hv,onChange:i})}),(0,U.jsx)(vv,{title:`Density`,hint:`Compact tightens spacing across the cockpit — text stays the same size.`,children:(0,U.jsx)(_v,{slot:`appearance-density`,label:`Density`,value:r,options:gv,onChange:a})})]})}var bv=`http://localhost:4321`;function xv(e,t,n,r=bv,i=null){let a=e=>encodeURIComponent(e).replaceAll(`'`,`%27`),o=`(()=>{const m=location.href.match(/^https:\\/\\/github\\.com\\/([^\\/]+)\\/([^\\/]+)\\/(pull|issues)\\/\\d+/);if(!m){alert('Open a GitHub PR or issue first');return;}const q='${`${e?`skill=${a(e)}&`:``}auto=${t?`1`:`0`}&key=${a(n)}&ref=`}'+encodeURIComponent(location.href);open('${r.replaceAll(`'`,`%27`)}${i===null||i===``?`/new`:`/p/${a(i)}/new`}?'+q,'_blank');})();`;return`javascript:${encodeURIComponent(o)}`}function Sv(){let e=Je();return e.isPending?(0,U.jsx)(`p`,{"data-slot":`bookmarklets-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading bookmarklets…`}):e.isError?(0,U.jsx)(L,{icon:(0,U.jsx)(Nt,{}),tone:`danger`,heading:`h2`,title:`Could not load bookmarklets`,subtitle:e.error.message}):(0,U.jsx)(`div`,{className:`flex min-h-full flex-1 overflow-y-auto px-4 py-5 md:px-7`,children:(0,U.jsx)(Cv,{skills:Nf(e.data??[])})})}function Cv({skills:e}){let t=x(),n=w(),r=De(),[i,a]=(0,H.useState)(!1),[o,s]=(0,H.useState)(``),c=t.data?.key??``,l=window.location.origin,u=$t()??n.data?.bootProject??null,d=r.data?.projects.find(e=>e.id===u)?.name??nb(n.data)?.name??null,f=o.trim().toLowerCase(),p=e.filter(e=>e.name.toLowerCase().includes(f));return(0,U.jsxs)(`div`,{"data-slot":`bookmarklet-panel`,className:`mx-auto w-full max-w-2xl`,children:[(0,U.jsx)(`h2`,{className:`text-base font-semibold`,children:`Run from GitHub`}),(0,U.jsxs)(`p`,{className:`mt-2 text-[13px] leading-relaxed text-muted-foreground`,children:[`Drag a button below to your browser's bookmarks bar. On any GitHub PR or issue, click it to open this cockpit directly. The cockpit must be running: `,(0,U.jsx)(`span`,{className:`font-mono`,children:`npx cezar`}),`.`]}),(0,U.jsxs)(`label`,{className:`mt-4 flex items-center gap-2 text-[13px] font-medium`,children:[(0,U.jsx)(`input`,{type:`checkbox`,"data-slot":`bm-auto`,checked:i,onChange:e=>a(e.target.checked),className:`size-3.5`}),`One-click launch (auto-submit)`,` `,(0,U.jsx)(`span`,{className:`font-normal text-soft-foreground`,children:`— re-drag the buttons after changing this`})]}),(0,U.jsx)(`div`,{"data-slot":`bm-generic`,className:`mt-4`,children:(0,U.jsx)(wv,{label:d?`cezar (${d}): this PR/issue`:`cezar: this PR/issue`,url:xv(``,!1,c,l,u),hint:`prefills the form — nothing starts by itself`})}),(0,U.jsx)(qu,{"data-slot":`bm-filter`,placeholder:`Filter skills…`,"aria-label":`Filter bookmarklet skills`,value:o,onChange:e=>s(e.target.value),className:`mt-5 h-8 text-[13px]`}),(0,U.jsx)(`div`,{"data-slot":`bm-list`,className:`mt-3 flex flex-col gap-2`,children:p.length>0?p.map(e=>(0,U.jsx)(wv,{label:d?`/${e.name} (${d})`:`/${e.name}`,url:xv(e.name,i,c,l,u),hint:e.source},e.path)):(0,U.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:e.length>0?`(no skills match)`:`(no skills yet — the generic launcher above still works)`})})]})}function wv({label:e,url:t,hint:n}){let r=(0,H.useRef)(null);(0,H.useEffect)(()=>{r.current?.setAttribute(`href`,t)},[t]);let i=async()=>{try{await navigator.clipboard.writeText(t),F(`Bookmarklet URL copied.`)}catch{F(`Copy failed — drag the button instead.`,{tone:`danger`})}};return(0,U.jsxs)(`div`,{"data-slot":`bm-row`,className:`flex min-w-0 items-center gap-2.5`,children:[(0,U.jsxs)(`a`,{ref:r,draggable:!0,"data-slot":`bm-link`,title:`Drag me to your bookmarks bar`,onClick:e=>{e.preventDefault(),F(`Drag me to your bookmarks bar`)},className:`inline-flex shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 py-1 font-mono text-xs font-medium text-foreground shadow-xs transition-colors hover:bg-muted`,children:[(0,U.jsx)(kr,{"aria-hidden":`true`,className:`size-3 text-primary`}),e]}),(0,U.jsx)(`button`,{type:`button`,"data-slot":`bm-copy`,title:`Copy the bookmarklet URL`,onClick:()=>void i(),className:`shrink-0 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,children:`Copy`}),n?(0,U.jsx)(`span`,{className:`min-w-0 truncate text-[11px] text-soft-foreground`,children:n}):null]})}function Tv(e){return{enabled:(e&&typeof e==`object`?e:{}).enabled===!0}}function Ev(){let e=globalThis.Notification;if(typeof e!=`function`)return`unsupported`;let t=e.permission;return t===`granted`||t===`denied`?t:`default`}function Dv(e,t){let n=new Map,r=[];for(let i of t??[]){n.set(i.id,i.status);let t=e.get(i.id);t===void 0||t===i.status||Of(i)&&r.push(i)}return{entering:r,statuses:n}}function Ov(e){return e.enabled&&e.hidden&&e.permission===`granted`}function kv(e){let t=Df(e).label;return{title:e.titleSummary??e.title,body:`Task ${t}`,tag:`cezar-run-${e.id}`}}function Av(){let e=Se(),t=m(),[n,r]=H.useState(!1),[i,a]=H.useState(Ev),o=t.data;H.useEffect(()=>{o!==void 0&&r(Tv(o.notifications).enabled)},[o]);let s=H.useCallback(t=>{r(t),He({notifications:{enabled:t}}).then(t=>e.setQueryData(N.uiState,t)).catch(t=>{F(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:N.uiState})})},[e]),c=H.useCallback(e=>{if(!e){s(!1);return}if(Ev()!=="default"){s(!0);return}s(!0),Notification.requestPermission().then(e=>a(e)).catch(()=>a(Ev()))},[s]),l=i===`unsupported`;return(0,U.jsx)(`div`,{"data-slot":`notifications-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-7 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:(0,U.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:(0,U.jsx)(`label`,{htmlFor:`notifications-enabled`,children:`Notify when an agent needs you`})}),(0,U.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`A browser notification when a task starts waiting, asks for review, or fails — only while this tab is in the background. Off by default.`})]}),(0,U.jsx)(G_,{id:`notifications-enabled`,"data-slot":`notifications-toggle`,checked:n,disabled:l,onCheckedChange:c})]}),l?(0,U.jsx)(`p`,{"data-slot":`notifications-unsupported`,className:`text-[13px] text-muted-foreground`,children:`This browser does not support notifications, so the toggle is unavailable here.`}):null,!l&&n&&i===`denied`?(0,U.jsx)(`p`,{"data-slot":`notifications-denied`,className:`text-[13px] text-danger`,children:`This browser is blocking notifications for the cockpit. The preference is saved, but nothing will be delivered here until you allow notifications in the browser's site settings.`}):null]})})}function jv({title:e,hint:t,children:n}){return(0,U.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:e}),(0,U.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:t})]}),n]})}var Mv=1,Nv={ok:`ok`,"not-git":`no git repo`,missing:`folder not found`};function Pv(e){let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function Fv(){let e=_e(),t=De();return e.isPending||t.isPending?(0,U.jsx)(`p`,{"data-slot":`projects-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading projects…`}):e.isError||t.isError?(0,U.jsx)(L,{icon:(0,U.jsx)(ir,{}),tone:`danger`,title:`Project settings did not load`,subtitle:(e.error??t.error)?.message,heading:`h2`}):(0,U.jsx)(Iv,{config:e.data,registry:t.data})}function Iv({config:e,registry:t}){return(0,U.jsxs)(`div`,{"data-slot":`projects-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-7 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,U.jsx)(Lv,{configKey:`browseRoot`,value:e.browseRoot,title:`Default browse folder`,hint:`Where “Open local folder…” starts. The picker cannot navigate above this folder.`,placeholder:`~/`,slot:`browse`,savedLabel:`Browse folder`,footer:`Only affects folder browsing; GitHub checkouts use the separate checkout folder.`}),(0,U.jsx)(Lv,{configKey:`projectsDir`,value:e.projectsDir,title:`Default checkout folder`,hint:`Where “Clone from GitHub” puts new projects: <folder>/<project name>.`,placeholder:`~/cezar/projects`,slot:`checkout`,savedLabel:`Checkout folder`,footer:`Only affects new checkouts; projects already registered keep their location.`,refreshProjects:!0}),(0,U.jsx)(Rv,{registry:t,workspaceMax:e.resources.maxParallel})]})}function Lv({configKey:e,value:t,title:n,hint:r,placeholder:i,slot:a,savedLabel:o,footer:s,refreshProjects:c=!1}){let l=Se(),u=pe({mutationFn:t=>vt(e===`browseRoot`?{browseRoot:t}:{projectsDir:t}),onSuccess:t=>{l.setQueryData(N.config,t),e===`browseRoot`?l.invalidateQueries({queryKey:N.fsBrowseRoot}):c&&l.invalidateQueries({queryKey:N.projects})}}),[d,f]=(0,H.useState)(t),p=d.trim(),m=p===t,h=u.isError?u.error.message:null;return(0,U.jsxs)(jv,{title:n,hint:`${r} ${e===`browseRoot`?`Choose an existing folder; it is verified writable before saving.`:`The folder is created recursively if needed, then verified writable before saving.`}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`input`,{type:`text`,spellCheck:!1,"aria-label":n,"aria-invalid":h!==null,"data-slot":`projects-${a}-root`,value:d,disabled:u.isPending,placeholder:i,onChange:e=>{f(e.target.value),u.isError&&u.reset()},className:`block w-full max-w-sm rounded-md border border-input bg-card px-3 py-1.5 font-mono text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-danger disabled:opacity-50`}),(0,U.jsx)(P,{type:`button`,variant:`outline`,size:`sm`,"data-action":`projects-save-${a}-root`,disabled:m||p===``||u.isPending,onClick:()=>u.mutate(p,{onSuccess:()=>F(`${o} set to ${p}`)}),children:`Save`})]}),h===null?(0,U.jsx)(`p`,{className:`text-[11px] text-soft-foreground`,children:s}):(0,U.jsxs)(`p`,{"data-slot":`projects-${a}-root-error`,role:`alert`,className:`text-[11px] text-danger`,children:[h,` — setting unchanged`]})]})}function Rv({registry:e,workspaceMax:t}){let[n,r]=(0,H.useState)(null),i=We();return(0,U.jsxs)(jv,{title:`Registered projects`,hint:`Every folder cezar has run in, plus the ones added from the GUI. “Max parallel” caps how many of that project's tasks run at once; the workspace limit (${t}) still applies as an overall ceiling, so a per-project value above it has no extra effect until the workspace limit is raised. Removing a project only unregisters it — no files on disk are deleted.`,children:[e.projects.length===0?(0,U.jsx)(`p`,{"data-slot":`projects-empty`,className:`text-[13px] text-soft-foreground`,children:`No projects registered yet.`}):(0,U.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-border`,children:(0,U.jsxs)(`table`,{className:`w-full border-collapse text-sm`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Projects registered in this workspace`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{className:`border-b border-border text-left text-[12px] text-soft-foreground`,children:[(0,U.jsx)(`th`,{scope:`col`,className:`px-3 py-2 font-medium`,children:`Project`}),(0,U.jsx)(`th`,{scope:`col`,className:`px-3 py-2 font-medium`,children:`Status`}),(0,U.jsx)(`th`,{scope:`col`,className:`px-3 py-2 font-medium`,children:`Max parallel`}),(0,U.jsx)(`th`,{scope:`col`,className:`px-3 py-2 font-medium`,children:`Added`}),(0,U.jsx)(`th`,{scope:`col`,className:`px-3 py-2 font-medium text-right`,children:`Actions`})]})}),(0,U.jsx)(`tbody`,{children:e.projects.map(n=>(0,U.jsx)(zv,{project:n,isBoot:n.id===e.bootProject,workspaceMax:t,disabled:i.isPending,onRemove:()=>r(n)},n.id))})]})}),(0,U.jsx)($g,{open:n!==null,onOpenChange:e=>!e&&r(null),children:(0,U.jsxs)(n_,{children:[(0,U.jsxs)(r_,{children:[(0,U.jsxs)(a_,{children:[`Remove `,n?.name,` from the workspace?`]}),(0,U.jsxs)(o_,{children:[`This only unregisters the project — `,(0,U.jsx)(`strong`,{children:`nothing on disk is deleted`}),`. The folder, its git history and its task history all stay exactly where they are, and opening it again re-registers it with everything intact.`,(0,U.jsx)(`span`,{className:`mt-1 block truncate font-mono text-[11px] text-foreground`,title:n?.root,children:n?.root})]})]}),(0,U.jsxs)(i_,{children:[(0,U.jsx)(c_,{children:`Keep it`}),(0,U.jsx)(s_,{"data-action":`projects-confirm-remove`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{if(!n)return;let{id:e,name:t}=n;r(null),i.mutate(e,{onSuccess:()=>F(`${t} removed from the workspace — its files are untouched`),onError:e=>F(e.message,{tone:`danger`})})},children:`Remove from list`})]})]})})]})}function zv({project:e,isBoot:t,workspaceMax:n,disabled:r,onRemove:i}){return(0,U.jsxs)(`tr`,{"data-slot":`project-row`,"data-project":e.id,className:`border-b border-border last:border-0`,children:[(0,U.jsxs)(`th`,{scope:`row`,className:`max-w-[260px] px-3 py-2 text-left font-normal`,children:[(0,U.jsx)(`span`,{className:`block truncate text-foreground`,children:e.name}),(0,U.jsx)(`span`,{className:`block truncate font-mono text-[11px] text-soft-foreground`,title:e.root,children:e.root})]}),(0,U.jsxs)(`td`,{className:`px-3 py-2`,children:[(0,U.jsx)(`span`,{"data-slot":`project-status`,className:e.status===`missing`?`text-[12px] text-danger`:`text-[12px] text-soft-foreground`,children:Nv[e.status]}),e.status===`missing`?null:(0,U.jsxs)(`span`,{className:`ml-1 text-[11px] text-soft-foreground`,children:[`· `,e.source]})]}),(0,U.jsx)(`td`,{className:`px-3 py-2`,children:(0,U.jsx)(Bv,{project:e,workspaceMax:n})}),(0,U.jsx)(`td`,{className:`px-3 py-2 tabular-nums text-soft-foreground`,children:Pv(e.addedAt)}),(0,U.jsx)(`td`,{className:`px-3 py-2 text-right`,children:(0,U.jsx)(P,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`project-remove`,"aria-label":`Unregister ${e.name} (no files are deleted)`,title:t?`cezar is serving this project — it re-registers itself at every start`:void 0,disabled:r||t,onClick:i,children:`Remove`})})]})}function Bv({project:e,workspaceMax:t}){let n=Re(),r=e.maxParallel===void 0?``:String(e.maxParallel);return(0,U.jsxs)(`select`,{"aria-label":`Max parallel tasks for ${e.name}`,"data-slot":`project-max-parallel`,value:r,disabled:n.isPending,onChange:r=>{let i=r.target.value,a=i===``?null:Number(i);n.mutate({id:e.id,maxParallel:a},{onSuccess:()=>F(a===null?`${e.name} inherits the workspace limit (${t})`:`${e.name} runs at most ${a} task${a===1?``:`s`} at a time`),onError:e=>F(e.message,{tone:`danger`})})},className:`block w-44 rounded-md border border-input bg-card px-2 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,U.jsxs)(`option`,{value:``,children:[`Inherit workspace (`,t,`)`]}),Array.from({length:16},(e,t)=>t+Mv).map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))]})}function Vv(){let e=kt();return e.isPending?(0,U.jsx)(`p`,{"data-slot":`prompt-templates-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading prompt templates…`}):e.isError?(0,U.jsx)(L,{icon:(0,U.jsx)(hr,{}),tone:`danger`,title:`Prompt templates did not load`,subtitle:e.error.message,heading:`h2`}):(0,U.jsx)(Hv,{initial:Ph(e.data.promptTemplates)})}function Hv({initial:e}){let t=Se(),n=Je(),r=kt(),[i,a]=(0,H.useState)(e),[o,s]=(0,H.useState)(``),[l,u]=(0,H.useState)(``),d=pe({mutationFn:e=>rt({promptTemplates:e}),onSuccess:e=>{t.setQueryData(c.uiState,e),F(`Prompt templates saved`)},onError:e=>F(e.message,{tone:`danger`})}),f=JSON.stringify(i)!==JSON.stringify(e),p=i.some(e=>e.label.trim()===``||e.text.trim()===``),m=(e,t)=>a(n=>n.map(n=>n.id===e?{...n,...t}:n)),h=(e,t)=>a(n=>n.map(n=>{if(n.id!==e)return n;let r=n.skills??[],i=r.includes(t)?r.filter(e=>e!==t):[...r,t],{skills:a,...o}=n;return i.length>0?{...o,skills:i}:o})),g=e=>a(t=>t.filter(t=>t.id!==e));return(0,U.jsx)(`div`,{"data-slot":`prompt-templates-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-7 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:(0,U.jsxs)(Wv,{title:`Prompt templates`,hint:`Reusable snippets you can insert into a prompt — the new-task composer, the GitHub hand-over, and the Inbox's “Add instructions” box all offer this list. Assign a template to a skill and it fills the prompt in for you when you pick that skill, as long as you have not typed anything yet.`,children:[(0,U.jsx)(`div`,{"data-slot":`prompt-template-list`,className:`flex flex-col gap-3`,children:i.length===0?(0,U.jsx)(`p`,{"data-slot":`prompt-templates-empty`,className:`text-[13px] text-soft-foreground`,children:`No templates. Add one below, or reset to the built-ins.`}):i.map(e=>(0,U.jsxs)(`div`,{"data-slot":`prompt-template-row`,"data-template":e.id,className:`flex flex-col gap-1.5 rounded-md border border-border bg-card p-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(qu,{"aria-label":`Label for ${e.label||`this template`}`,"data-slot":`prompt-template-label-input`,value:e.label,maxLength:80,onChange:t=>m(e.id,{label:t.target.value}),className:`flex-1`}),(0,U.jsx)(P,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`prompt-template-remove`,title:`Remove this template`,onClick:()=>g(e.id),children:(0,U.jsx)(Pt,{"aria-hidden":`true`,className:`size-3.5`})})]}),(0,U.jsx)(Ft,{"aria-label":`Text for ${e.label||`this template`}`,"data-slot":`prompt-template-text-input`,value:e.text,maxLength:2e3,onChange:t=>m(e.id,{text:t.target.value}),className:`min-h-14 text-[13px]`}),(0,U.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-1.5`,children:[(0,U.jsx)(Uv,{label:e.label,skills:n.data??[],skillUsage:r.data?.skillUsage,selected:e.skills??[],onToggle:t=>h(e.id,t)}),(e.skills??[]).map(t=>(0,U.jsxs)(`button`,{type:`button`,"data-slot":`prompt-template-skill-chip`,"data-skill":t,title:`Stop applying “${e.label}” automatically with ${t}`,onClick:()=>h(e.id,t),className:`inline-flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-px font-mono text-[11px] font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[t,(0,U.jsx)(Pt,{"aria-hidden":`true`,className:`size-3`})]},t))]})]},e.id))}),(0,U.jsxs)(`div`,{"data-slot":`prompt-template-new`,className:`flex flex-col gap-1.5 rounded-md border border-dashed border-border p-3`,children:[(0,U.jsx)(qu,{"aria-label":`New template label`,"data-slot":`prompt-template-new-label`,placeholder:`Label (e.g. "Add tests")`,value:o,maxLength:80,onChange:e=>s(e.target.value)}),(0,U.jsx)(Ft,{"aria-label":`New template text`,"data-slot":`prompt-template-new-text`,placeholder:`The instructions to insert…`,value:l,maxLength:2e3,onChange:e=>u(e.target.value),className:`min-h-14 text-[13px]`}),(0,U.jsxs)(P,{type:`button`,variant:`outline`,size:`sm`,"data-action":`prompt-template-add`,disabled:!o.trim()||!l.trim(),onClick:()=>{let e=o.trim(),t=l.trim();!e||!t||(a(n=>[...n,{id:zh(),label:e,text:t}]),s(``),u(``))},className:`self-start`,children:[(0,U.jsx)(xr,{"aria-hidden":`true`,className:`size-3.5`}),`Add template`]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(P,{type:`button`,variant:`contrast`,size:`sm`,"data-action":`prompt-templates-save`,disabled:!f||p||d.isPending,onClick:()=>d.mutate(i),children:`Save`}),(0,U.jsx)(P,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`prompt-templates-reset`,disabled:d.isPending,onClick:()=>a(Mh.map(e=>({...e}))),children:`Reset to defaults`}),p?(0,U.jsx)(`p`,{"data-slot":`prompt-templates-invalid`,className:`text-[11px] text-danger`,children:`Every template needs both a label and text.`}):null]})]})})}function Uv({label:e,skills:t,skillUsage:n,selected:r,onToggle:i}){let[a,o]=(0,H.useState)(!1),s=(0,H.useRef)(null),{mostUsed:c,project:l,global:u}=Ff(t,n),d=(e,t)=>{let n=r.includes(e.name);return(0,U.jsxs)(Sf,{value:`skill ${e.name} ${e.path}`,keywords:Gf(e.name,e.description),"data-slot":`prompt-template-skill-option`,"data-skill":e.name,"data-selected":n?`true`:void 0,onSelect:()=>i(e.name),children:[(0,U.jsx)(`span`,{className:B(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.description?(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,n?(0,U.jsx)(et,{"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-primary`}):null]},e.path)};return(0,U.jsxs)(Sh,{open:a,onOpenChange:o,children:[(0,U.jsx)(Ch,{asChild:!0,children:(0,U.jsxs)(`button`,{type:`button`,"data-slot":`prompt-template-skills-trigger`,"aria-label":`Apply ${e||`this template`} automatically with a skill`,title:`Pick the skills this template applies itself to`,disabled:t.length===0,className:B(`inline-flex h-[26px] items-center gap-1.5 rounded-full border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50`,r.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,U.jsx)(Tr,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),t.length===0?`no skills found`:`apply with…`,(0,U.jsx)(Kn,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,U.jsx)(wh,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,U.jsxs)(hf,{filter:Uf,children:[(0,U.jsx)(_f,{placeholder:`search skills…`,onInput:()=>s.current?.scrollTo(0,0)}),(0,U.jsxs)(vf,{ref:s,"data-slot":`prompt-template-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,U.jsx)(yf,{children:`Nothing matches.`}),c.length>0?(0,U.jsx)(bf,{heading:`Most used`,children:c.map(e=>d(e,Mf(e)))}):null,l.length>0?(0,U.jsx)(bf,{heading:`Project skills`,children:l.map(e=>d(e,!0))}):null,u.length>0?(0,U.jsx)(bf,{heading:`Global`,children:u.map(e=>d(e,!1))}):null]})]})})]})}function Wv({title:e,hint:t,children:n}){return(0,U.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:e}),(0,U.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:t})]}),n]})}var Gv=1,Kv=1,qv=60,Jv=256;function Yv(){let e=_e();return e.isPending?(0,U.jsx)(`p`,{"data-slot":`resources-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading resource settings…`}):e.isError?(0,U.jsx)(L,{icon:(0,U.jsx)(ar,{}),tone:`danger`,title:`Resource settings did not load`,subtitle:e.error.message,heading:`h2`}):(0,U.jsx)(Xv,{config:e.data})}function Xv({config:e}){let t=Se(),n=pe({mutationFn:e=>vt(e),onSuccess:e=>t.setQueryData(N.config,e),onError:e=>F(e.message,{tone:`danger`})}),[r,i]=(0,H.useState)(e.resources.memoryLimitMb?String(e.resources.memoryLimitMb):``),a=e.resources.monitoringWakeIntervalMinutes??null,[o,s]=(0,H.useState)(a===null?`park`:`interval`),[c,l]=(0,H.useState)(String(a??5)),u=Number(c),d=!Number.isInteger(u)||u<Kv||u>qv,f=o===`park`?a===null:!d&&a===u,p=()=>n.mutate({resources:{monitoringWakeIntervalMinutes:o===`park`?null:u}},{onSuccess:()=>F(o===`park`?`Monitoring will stay parked`:`Monitoring will re-check every ${u} minutes`)}),m=r.trim()===``?0:Number(r),h=r.trim()!==``&&(!Number.isInteger(m)||m<Jv),_=(e.resources.memoryLimitMb??0)===(h?-1:m),v=()=>n.mutate({resources:{memoryLimitMb:m===0?null:m}},{onSuccess:()=>F(m===0?`Memory limit cleared`:`Memory limit set to ${m} MiB`)}),y=e.composerDefaults??{autonomous:null,worktree:null,inheritedAutonomous:`source-dependent`,inheritedWorktree:!0},b=(e,t)=>n.mutate({composerDefaults:{[e]:t===`inherit`?null:t===`on`}});return(0,U.jsxs)(`div`,{"data-slot":`resources-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-7 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,U.jsxs)(jv,{title:`Max parallel tasks`,hint:`How many tasks run at once across every project. The rest wait in the queue. A non-git directory always runs one at a time.`,children:[(0,U.jsx)(`select`,{"aria-label":`Max parallel tasks`,"data-slot":`resources-max-parallel`,value:e.resources.maxParallel,disabled:n.isPending,onChange:e=>n.mutate({resources:{maxParallel:Number(e.target.value)}}),className:`block w-28 rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:Array.from({length:16},(e,t)=>t+Gv).map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))}),(0,U.jsxs)(`p`,{className:`text-[11px] text-soft-foreground`,children:[`Need a different limit for one project?`,` `,(0,U.jsx)(g,{to:`/settings/global/projects`,"data-slot":`resources-project-limits-link`,className:`font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground`,children:`Configure per-project limits`}),`.`]})]}),(0,U.jsxs)(jv,{title:`Extra monitoring sessions`,hint:`How many agent sessions may wait on CI, sub-agents, or monitored commands without using an active task slot. Extra sessions stay alive but pause the queue.`,children:[(0,U.jsx)(`select`,{"aria-label":`Extra monitoring sessions`,"data-slot":`resources-max-monitoring`,value:e.resources.maxMonitoringSessions??2,disabled:n.isPending,onChange:e=>n.mutate({resources:{maxMonitoringSessions:Number(e.target.value)}}),className:`block w-28 rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:Array.from({length:17},(e,t)=>(0,U.jsx)(`option`,{value:t,children:t},t))}),(0,U.jsxs)(`p`,{className:`text-[11px] text-soft-foreground`,children:[`Capacity: `,e.resources.maxParallel,` active + `,e.resources.maxMonitoringSessions??2,` monitoring. Set 0 to make monitoring share active slots.`]})]}),(0,U.jsxs)(jv,{title:`Monitoring wake-up`,hint:`Park uses no model turns. Re-check sends the same agent a follow-up on this cadence until work completes or the 40-wakeup safety cap is reached.`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsxs)(`select`,{"aria-label":`Monitoring wake-up`,"data-slot":`resources-monitoring-wake-mode`,value:o,disabled:n.isPending,onChange:e=>s(e.target.value),className:`rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,U.jsx)(`option`,{value:`park`,children:`Park until resumed`}),(0,U.jsx)(`option`,{value:`interval`,children:`Re-check on an interval`})]}),o===`interval`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`input`,{type:`number`,min:Kv,max:qv,"aria-label":`Wake interval in minutes`,"data-slot":`resources-monitoring-wake-interval`,value:c,disabled:n.isPending,onChange:e=>l(e.target.value),className:`block w-24 rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`}),(0,U.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:`minutes`})]}):null,(0,U.jsx)(P,{type:`button`,variant:`outline`,size:`sm`,"data-action":`resources-save-monitoring-wake`,disabled:f||o===`interval`&&d||n.isPending,onClick:p,children:`Save`})]}),o===`interval`&&d?(0,U.jsx)(`p`,{"data-slot":`resources-monitoring-wake-invalid`,className:`text-[11px] text-danger`,children:`Enter a whole number from 1 to 60 minutes.`}):(0,U.jsx)(`p`,{className:`text-[11px] text-soft-foreground`,children:`Applied consistently to Claude, Codex and OpenCode.`})]}),(0,U.jsxs)(jv,{title:`Per-task memory limit`,hint:`When a task's whole process tree crosses this, the engine pauses it with a warning and starts the next queued task. Leave empty for no limit.`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`input`,{type:`number`,inputMode:`numeric`,min:Jv,step:256,"aria-label":`Per-task memory limit in MiB`,"data-slot":`resources-memory-limit`,value:r,disabled:n.isPending,placeholder:`no limit`,onChange:e=>i(e.target.value),className:`block w-32 rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`}),(0,U.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:`MiB`}),(0,U.jsx)(P,{type:`button`,variant:`outline`,size:`sm`,"data-action":`resources-save-memory`,disabled:_||h||n.isPending,onClick:v,children:`Save`})]}),h?(0,U.jsxs)(`p`,{"data-slot":`resources-memory-invalid`,className:`text-[11px] text-danger`,children:[`Enter a whole number of at least `,Jv,` MiB, or leave empty for no limit.`]}):(0,U.jsx)(`p`,{className:`text-[11px] text-soft-foreground`,children:`Applies to newly started tasks.`})]}),(0,U.jsxs)(jv,{title:`New task defaults`,hint:`Set stable composer defaults across projects. Explicit choices and run-shape constraints still win.`,children:[(0,U.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,"data-slot":`resources-composer-defaults`,children:[(0,U.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:`Autonomous by default`}),(0,U.jsxs)(`select`,{"aria-label":`Autonomous by default`,value:y.autonomous===null?`inherit`:y.autonomous?`on`:`off`,disabled:n.isPending,onChange:e=>b(`autonomous`,e.target.value),className:`rounded-md border border-input bg-card px-3 py-1.5 shadow-xs outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:[(0,U.jsx)(`option`,{value:`inherit`,children:`Inherit environment`}),(0,U.jsx)(`option`,{value:`on`,children:`On`}),(0,U.jsx)(`option`,{value:`off`,children:`Off`})]}),(0,U.jsxs)(`span`,{className:`text-[11px] text-soft-foreground`,children:[`Inherited: `,y.inheritedAutonomous===`source-dependent`?`Source-dependent — skills on, workflows off`:y.inheritedAutonomous?`On`:`Off`]})]}),(0,U.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:`Use a worktree by default`}),(0,U.jsxs)(`select`,{"aria-label":`Use a worktree by default`,value:y.worktree===null?`inherit`:y.worktree?`on`:`off`,disabled:n.isPending,onChange:e=>b(`worktree`,e.target.value),className:`rounded-md border border-input bg-card px-3 py-1.5 shadow-xs outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:[(0,U.jsx)(`option`,{value:`inherit`,children:`Inherit environment`}),(0,U.jsx)(`option`,{value:`on`,children:`On`}),(0,U.jsx)(`option`,{value:`off`,children:`Off`})]}),(0,U.jsxs)(`span`,{className:`text-[11px] text-soft-foreground`,children:[`Inherited: `,y.inheritedWorktree?`On`:`Off`]})]})]}),(0,U.jsx)(`p`,{className:`text-[11px] text-soft-foreground`,children:`Interactive skills may recommend both off. Multi-step and parallel runs remain isolated.`})]})]})}function Zv(){let e=_e(),t=De().data?.bootProject??``,n=Pe(t,!!t);return e.isPending?(0,U.jsx)(`p`,{"data-slot":`skills-settings-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading skill settings…`}):e.isError?(0,U.jsx)(L,{icon:(0,U.jsx)(gr,{}),tone:`danger`,title:`Skill settings did not load`,subtitle:e.error.message,heading:`h2`}):(0,U.jsx)(Qv,{config:e.data,update:n.data,updateError:n.error})}function Qv({config:e,update:t,updateError:n}){let r=Se(),i=pe({mutationFn:e=>vt(e),onSuccess:e=>r.setQueryData(N.config,e),onError:e=>F(e.message,{tone:`danger`})}),a=e.skillsAutoUpdate===null,o=(()=>{if(n)return`Installation status is unavailable right now.`;if(!t)return`Checking tracked Open Mercato installations…`;if(t.status===`unavailable`)return t.scopes.find(e=>e.reason)?.reason??`Automatic skill updates are unavailable.`;if(t.scopes.every(e=>e.skills.length===0))return`No tracked Open Mercato installation found.`;let e=new Set(t.scopes.flatMap(e=>e.skills)).size;return`${e} tracked Open Mercato skill${e===1?``:`s`} found.`})();return(0,U.jsx)(`div`,{"data-slot":`skills-settings-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-4 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:(0,U.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:(0,U.jsx)(`label`,{htmlFor:`skills-auto-update`,children:`Update Open Mercato skills automatically`})}),(0,U.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Checks installed Open Mercato skills in the background and applies available updates. Other skills and untracked folders are never changed.`})]}),(0,U.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:[(0,U.jsx)(G_,{id:`skills-auto-update`,"data-slot":`skills-auto-update`,checked:e.effectiveSkillsAutoUpdate,disabled:i.isPending,onCheckedChange:e=>i.mutate({skillsAutoUpdate:e})}),(0,U.jsxs)(`span`,{className:`text-[11px] text-soft-foreground`,children:[e.effectiveSkillsAutoUpdate?`On`:`Off`,a?` (default)`:``]})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-md border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground`,children:[(0,U.jsx)(`span`,{children:a?`No override is saved. CEZ_SKILLS_AUTO_UPDATE supplies the inherited default when set; otherwise it is on.`:`An explicit workspace override is saved.`}),(0,U.jsx)(P,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`skills-use-default`,disabled:a||i.isPending,onClick:()=>i.mutate({skillsAutoUpdate:null}),children:`Use default`})]}),(0,U.jsx)(`p`,{"data-slot":`skills-installation-status`,role:n||t?.status===`unavailable`?`status`:void 0,className:`text-[13px] text-soft-foreground`,children:o})]})})}function $v(){let e=wt(),t=Se(),[n,r]=(0,H.useState)(null),i=()=>t.invalidateQueries({queryKey:c.worktrees}),a=pe({mutationFn:()=>Ke(),onSuccess:e=>{i(),F(e.reclaimed.length===0?`Nothing to reclaim — all worktrees are within the limit`:`Reclaimed ${e.reclaimed.length} worktree${e.reclaimed.length===1?``:`s`} (branch kept)`)},onError:e=>F(e.message,{tone:`danger`})}),o=pe({mutationFn:e=>at(e),onSuccess:()=>{i(),F(`Worktree removed`)},onError:e=>F(e.message,{tone:`danger`})});if(e.isPending)return(0,U.jsx)(`p`,{"data-slot":`worktrees-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading worktrees…`});if(e.isError)return(0,U.jsxs)(`p`,{"data-slot":`worktrees-error`,className:`text-[13px] text-danger`,children:[`Worktrees did not load: `,e.error.message]});let{worktrees:s,totalBytes:l,keep:u}=e.data,d=a.isPending||o.isPending;return(0,U.jsxs)(`div`,{"data-slot":`worktrees-panel`,className:`flex flex-col gap-3`,children:[s.length===0?(0,U.jsx)(`p`,{"data-slot":`worktrees-empty`,className:`text-[13px] text-soft-foreground`,children:`No task worktrees on disk.`}):(0,U.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-border`,children:(0,U.jsxs)(`table`,{className:`w-full border-collapse text-sm`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Task worktrees currently materialized on disk`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{className:`border-b border-border text-left text-[12px] text-soft-foreground`,children:[(0,U.jsx)(`th`,{scope:`col`,className:`px-3 py-2 font-medium`,children:`Task`}),(0,U.jsx)(`th`,{scope:`col`,className:`px-3 py-2 font-medium`,children:`Status`}),(0,U.jsx)(`th`,{scope:`col`,className:`px-3 py-2 font-medium`,children:`Size`}),(0,U.jsx)(`th`,{scope:`col`,className:`px-3 py-2 font-medium`,children:`Age`}),(0,U.jsx)(`th`,{scope:`col`,className:`px-3 py-2 font-medium text-right`,children:`Actions`})]})}),(0,U.jsx)(`tbody`,{children:s.map(e=>(0,U.jsx)(ey,{worktree:e,disabled:d,onDelete:()=>r({kind:`delete`,runId:e.runId,title:e.title})},e.runId))})]})}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,U.jsxs)(`p`,{"data-slot":`worktrees-footer`,className:`text-[12px] text-soft-foreground`,children:[s.length,` worktree`,s.length===1?``:`s`,l===null?` · size unavailable`:` · ${mm(l)||`0 kB`} on disk`,` · `,u===0?`keeping all (unlimited)`:`keeping the last ${u}`]}),(0,U.jsx)(P,{type:`button`,variant:`outline`,size:`sm`,"data-action":`worktrees-reclaim-now`,disabled:d,onClick:()=>r({kind:`reclaim`}),children:`Reclaim now`})]}),(0,U.jsx)($g,{open:n!==null,onOpenChange:e=>!e&&r(null),children:(0,U.jsxs)(n_,{children:[(0,U.jsxs)(r_,{children:[(0,U.jsx)(a_,{children:n?.kind===`delete`?`Delete this worktree?`:`Reclaim old worktrees?`}),(0,U.jsx)(o_,{children:n?.kind===`delete`?(0,U.jsxs)(U.Fragment,{children:[`This removes the worktree directory and its branch — the local-only work is not recoverable afterwards.`,(0,U.jsx)(`span`,{className:`mt-1 block truncate font-medium text-foreground`,title:n.title,children:n.title})]}):`Finished worktrees beyond the keep-limit are reclaimed now (directory only). Their branches are kept, so the work stays recoverable.`})]}),(0,U.jsxs)(i_,{children:[(0,U.jsx)(c_,{children:`Keep it`}),(0,U.jsx)(s_,{"data-action":`worktrees-confirm`,className:n?.kind===`delete`?`bg-danger text-danger-foreground hover:brightness-[0.96]`:void 0,onClick:()=>{n?.kind===`reclaim`?a.mutate():n?.kind===`delete`&&o.mutate(n.runId),r(null)},children:n?.kind===`delete`?`Delete`:`Reclaim now`})]})]})})]})}function ey({worktree:e,disabled:t,onDelete:n}){return(0,U.jsxs)(`tr`,{"data-slot":`worktree-row`,"data-run":e.runId,className:`border-b border-border last:border-0`,children:[(0,U.jsxs)(`th`,{scope:`row`,className:`max-w-[220px] px-3 py-2 text-left font-normal`,children:[(0,U.jsx)(`span`,{className:`block truncate text-foreground`,title:e.title,children:e.title}),(0,U.jsx)(`span`,{className:`block truncate font-mono text-[11px] text-soft-foreground`,children:e.branch??e.runId.slice(0,8)})]}),(0,U.jsxs)(`td`,{className:`px-3 py-2`,children:[(0,U.jsx)(`span`,{className:`text-[12px] text-soft-foreground`,children:e.status}),e.reclaimable?(0,U.jsx)(`span`,{"data-slot":`worktree-reclaimable`,className:`ml-1 text-[11px] text-soft-foreground`,children:`(reclaimable)`}):null]}),(0,U.jsx)(`td`,{className:`px-3 py-2 tabular-nums text-soft-foreground`,children:e.sizeBytes===null?`—`:mm(e.sizeBytes)||`0 kB`}),(0,U.jsx)(`td`,{className:`px-3 py-2 tabular-nums text-soft-foreground`,children:kf(e.finishedAt??void 0)||`—`}),(0,U.jsx)(`td`,{className:`px-3 py-2 text-right`,children:(0,U.jsx)(P,{type:`button`,variant:`ghost`,size:`sm`,"data-action":`worktree-delete`,"aria-label":`Delete the worktree for ${e.title}`,disabled:t,onClick:n,children:`Delete`})})]})}var ty=0,ny=1e3;function ry(){let e=le();return e.isPending?(0,U.jsx)(`p`,{"data-slot":`worktrees-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading worktree settings…`}):e.isError?(0,U.jsx)(L,{icon:(0,U.jsx)(er,{}),tone:`danger`,title:`Worktree settings did not load`,subtitle:e.error.message,heading:`h2`}):(0,U.jsx)(iy,{config:e.data})}function iy({config:e}){let t=Se(),n=pe({mutationFn:e=>Be(e),onSuccess:e=>t.setQueryData(c.config,e),onError:e=>F(e.message,{tone:`danger`})}),[r,i]=(0,H.useState)(String(e.worktreeRetention)),a=Number(r),o=r.trim()===``||!Number.isInteger(a)||a<ty||a>ny,s=e.worktreeRetention===(o?-1:a);return(0,U.jsxs)(`div`,{"data-slot":`worktrees-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-7 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,U.jsxs)(jv,{title:`Keep last N worktrees`,hint:`Older finished worktrees are reclaimed to free disk; their branch is kept so the work stays recoverable. 0 = unlimited. In-review and running tasks are never reclaimed, so the count on disk can exceed this.`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`input`,{type:`number`,inputMode:`numeric`,min:ty,max:ny,step:1,"aria-label":`Keep last N finished worktrees`,"data-slot":`resources-worktree-retention`,value:r,disabled:n.isPending,onChange:e=>i(e.target.value),className:`block w-32 rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`}),(0,U.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:`worktrees`}),(0,U.jsx)(P,{type:`button`,variant:`outline`,size:`sm`,"data-action":`resources-save-retention`,disabled:s||o||n.isPending,onClick:()=>n.mutate({worktreeRetention:a},{onSuccess:()=>{t.invalidateQueries({queryKey:c.worktrees}),F(a===0?`Keeping all worktrees (unlimited)`:`Keeping the last ${a} finished worktree${a===1?``:`s`}`)}}),children:`Save`})]}),o?(0,U.jsxs)(`p`,{"data-slot":`resources-retention-invalid`,className:`text-[11px] text-danger`,children:[`Enter a whole number from `,ty,` to `,ny,` (0 = unlimited).`]}):(0,U.jsx)(`p`,{className:`text-[11px] text-soft-foreground`,children:a===0?`Keeping every finished worktree.`:`Keeping the last ${a} finished worktree${a===1?``:`s`} on disk.`})]}),(0,U.jsx)(jv,{title:`Worktrees`,hint:`Task worktrees currently on disk. Delete one to reclaim its space now, or reclaim everything past the keep-limit at once. Branches are always kept, so the work stays recoverable.`,children:(0,U.jsx)($v,{})})]})}function ay(e,t){return function(){return(0,U.jsx)(L,{icon:(0,U.jsx)(t,{}),tone:`neutral`,title:e,subtitle:`This section arrives in a later phase of the redesign.`,heading:`h2`})}}var oy=[{id:`agents`,title:`Agents`,description:`Default runner, models and system prompt.`,icon:Gn,component:Q_,scope:`project`},{id:`agent-config`,title:`Agent config`,description:`Edit the coding agents’ own config files, per scope.`,icon:$n,component:B_,scope:`project`},{id:`worktrees`,title:`Worktrees`,description:`How many finished task worktrees this project keeps on disk.`,icon:er,component:ry,scope:`project`},{id:`bookmarklets`,title:`Bookmarklets`,description:`Launch skills from a GitHub PR or issue.`,icon:Wn,component:Sv,scope:`project`},{id:`prompt-templates`,title:`Prompt templates`,description:`Reusable snippets for follow-up instructions.`,icon:hr,component:Vv,scope:`project`},{id:`appearance`,title:`Appearance`,description:`Theme, accent and density.`,icon:_r,component:yv,scope:`global`},{id:`notifications`,title:`Notifications`,description:`Browser notifications when an agent needs you.`,icon:Un,component:Av,scope:`global`},{id:`resources`,title:`Resources`,description:`Parallel tasks and per-task memory limit, across every project.`,icon:ar,component:Yv,scope:`global`},{id:`skills`,title:`Skills`,description:`Updates for skills installed on this machine.`,icon:gr,component:Zv,scope:`global`},{id:`projects`,title:`Projects`,description:`The workspace registry and where GitHub checkouts land.`,icon:ir,component:Fv,scope:`global`},{id:`keyboard`,title:`Keyboard`,description:`Shortcuts.`,icon:lr,component:ay(`Keyboard`,lr),scope:`global`,hidden:!0}];function sy(e,t){return oy.filter(n=>!n.hidden&&n.scope===e&&!(t?.singleProject===!0&&n.id===`projects`))}function cy(e,t){return e===`global`?`/settings/global/${t}`:`/settings/${t}`}function ly(e){return e===`global`?`/settings/global`:`/settings`}function uy(e){return e===`global`?{Link:g,NavLink:ce}:{Link:V,NavLink:Xt}}function dy({scope:e,activeId:t,capabilities:n}){let{NavLink:r}=uy(e);return(0,U.jsxs)(`nav`,{"aria-label":`Settings sections`,"data-slot":`settings-nav`,"data-scope":e,className:`hidden w-52 shrink-0 flex-col gap-1 border-r border-border p-3 md:flex`,children:[sy(e,n).map(n=>(0,U.jsxs)(r,{to:cy(e,n.id),"data-section":n.id,"aria-current":n.id===t?`page`:void 0,className:B(`flex items-center gap-2.5 rounded-md px-2.5 py-2 text-[13px] font-medium transition-colors`,n.id===t?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/60 hover:text-foreground`),children:[(0,U.jsx)(n.icon,{"aria-hidden":`true`,className:`size-4 shrink-0`}),n.title]},n.id)),e===`global`?(0,U.jsx)(`p`,{className:`mt-auto px-2.5 pt-3 text-[11px] text-soft-foreground`,children:`Stored in ~/.cezar`}):null]})}function fy({scope:e,activeId:t,capabilities:n}){let{NavLink:r}=uy(e);return(0,U.jsx)(`nav`,{"aria-label":`Settings sections`,"data-slot":`settings-nav-mobile`,className:`flex shrink-0 gap-1.5 overflow-x-auto border-b border-border px-3 py-2.5 md:hidden`,children:sy(e,n).map(n=>(0,U.jsx)(r,{to:cy(e,n.id),"data-section":n.id,"aria-current":n.id===t?`page`:void 0,className:B(`rounded-full border px-3 py-1.5 text-[13px] font-medium whitespace-nowrap transition-colors`,n.id===t?`border-transparent bg-contrast text-contrast-foreground`:`border-border bg-card text-muted-foreground`),children:n.title},n.id))})}function py({section:e,scope:t,capabilities:n}){let r=e.component;return(0,U.jsxs)(`div`,{"data-route":t===`global`?`settings-global-${e.id}`:`settings-${e.id}`,className:`flex min-h-full flex-col`,children:[(0,U.jsxs)(`header`,{className:`sticky top-0 z-10 hidden h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5 md:flex`,children:[(0,U.jsx)(`h1`,{className:`text-base font-semibold`,children:e.title}),(0,U.jsx)(`p`,{className:`text-[13px] text-soft-foreground`,children:e.description}),t===`global`?(0,U.jsx)(`span`,{"data-slot":`settings-scope-chip`,className:`ml-auto text-[11px] text-soft-foreground`,children:`Global settings`}):null]}),(0,U.jsxs)(`div`,{className:`flex flex-1 flex-col md:flex-row`,children:[(0,U.jsx)(dy,{scope:t,activeId:e.id,capabilities:n}),(0,U.jsx)(fy,{scope:t,activeId:e.id,capabilities:n}),(0,U.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:(0,U.jsx)(r,{})})]})]})}function my({scope:e,capabilities:t}){let{Link:n}=uy(e),r=e===`global`;return(0,U.jsxs)(`div`,{"data-route":r?`settings-global`:`settings`,className:`flex min-h-full flex-col`,children:[(0,U.jsxs)(`header`,{className:`sticky top-0 z-10 hidden h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5 md:flex`,children:[(0,U.jsx)(`h1`,{className:`text-base font-semibold`,children:r?`Global settings`:`Settings`}),(0,U.jsx)(`p`,{className:`text-[13px] text-soft-foreground`,children:r?`Preferences for you and this machine, shared by every project.`:`Configure this project and its agents.`})]}),(0,U.jsxs)(`div`,{className:`flex flex-1 flex-col md:flex-row`,children:[(0,U.jsx)(dy,{scope:e,activeId:null,capabilities:t}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col p-3 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-5 md:pb-5`,children:[(0,U.jsx)(`ul`,{"data-slot":`settings-index`,className:`mx-auto flex w-full max-w-2xl flex-col gap-2.5`,children:sy(e,t).map(t=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(n,{to:cy(e,t.id),"data-section":t.id,className:`flex items-center gap-3.5 rounded-lg border border-border bg-card p-4 shadow-xs transition-colors hover:bg-card-2`,children:[(0,U.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-md border border-border bg-muted text-muted-foreground`,children:(0,U.jsx)(t.icon,{"aria-hidden":`true`,className:`size-4`})}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:t.title}),(0,U.jsx)(`span`,{className:`block text-xs text-soft-foreground`,children:t.description})]}),(0,U.jsx)(qn,{"aria-hidden":`true`,className:`size-4 shrink-0 text-soft-foreground`})]})},t.id))}),(0,U.jsx)(`p`,{className:`mx-auto mt-4 w-full max-w-2xl text-[12px] text-soft-foreground`,children:r?(0,U.jsx)(U.Fragment,{children:`Agents, worktrees, bookmarklets and prompt templates are per project.`}):(0,U.jsxs)(U.Fragment,{children:[`Appearance, notifications, host resources and the project registry live in`,` `,(0,U.jsx)(g,{to:ly(`global`),"data-slot":`settings-global-link`,className:`underline underline-offset-2 hover:text-foreground`,children:`Global settings`}),`.`]})})]})]})]})}function hy(e,t){let[n,r]=(0,H.useState)(!1),[i,a]=(0,H.useState)(``),o=(0,H.useRef)(!1);return{editing:n,draft:i,setDraft:a,begin:()=>{a(e),o.current=!1,r(!0)},commit:()=>{if(o.current)return;o.current=!0,r(!1);let n=i.trim();n.length===0||n===e||t(n)},cancel:()=>{o.current=!0,r(!1)}}}function gy({editor:e,className:t}){return(0,U.jsx)(`input`,{"data-slot":`title-input`,"aria-label":`Task title`,autoFocus:!0,value:e.draft,onChange:t=>e.setDraft(t.target.value),onBlur:e.commit,onKeyDown:t=>{t.key===`Enter`?(t.preventDefault(),e.commit()):t.key===`Escape`&&(t.preventDefault(),e.cancel())},className:B(`w-full min-w-0 rounded-sm border border-border bg-card px-1.5 py-0.5 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,t)})}function _y({className:e,dot:t,pulse:n=!1,children:r,...i}){return(0,U.jsxs)(`span`,{"data-slot":`pill`,className:B(`inline-flex items-center gap-1.5 rounded-full bg-muted px-2.5 py-[3px] text-xs font-medium whitespace-nowrap text-muted-foreground`,e),...i,children:[t?(0,U.jsx)(rd,{tone:t,pulse:n}):null,r]})}function vy({runs:e,view:t,onViewChange:n,onArchiveFinished:r,onRename:i,now:a=Date.now()}){let[o,s]=H.useState(``),c=e??[],l=lp(c),u=op(_m(c,o),t),d=ap(c),f=wm(_m(c,o),t),p=vm(c);return(0,U.jsxs)(`div`,{"data-route":`tasks`,className:`flex min-h-full flex-col`,children:[(0,U.jsxs)(`header`,{className:`sticky top-0 z-10 hidden h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5 md:flex`,children:[(0,U.jsx)(`h1`,{className:`text-base font-semibold`,children:`Tasks`}),(0,U.jsxs)(`div`,{className:`inline-flex gap-0.5 rounded-md bg-muted p-[3px]`,children:[(0,U.jsx)(by,{view:`active`,current:t,onSelect:n,count:l.active,children:`Active`}),(0,U.jsx)(by,{view:`archived`,current:t,onSelect:n,count:l.archived,children:`Archived`})]}),(0,U.jsx)(`div`,{className:`flex-1`}),t===`active`&&p>0?(0,U.jsxs)(P,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`archive-finished`,onClick:r,children:[(0,U.jsx)(Rn,{className:`size-3.5`,"aria-hidden":`true`}),`Archive finished`]}):null,(0,U.jsxs)(`div`,{className:`relative w-60`,children:[(0,U.jsx)(Cr,{className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-soft-foreground`,"aria-hidden":`true`}),(0,U.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:`Search tasks…`,"aria-label":`Search tasks`,className:`h-9 w-full rounded-md border border-input bg-card pr-3 pl-8 text-[13px] text-foreground outline-none placeholder:text-soft-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-1 flex-col p-3 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-5 md:pb-5`,children:[e===void 0?null:u.length===0?(0,U.jsx)(yy,{view:t,query:o}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{"data-slot":`tasks-table`,className:`hidden overflow-x-auto rounded-lg border border-border bg-card shadow-xs md:block`,children:(0,U.jsxs)(`table`,{className:`w-full min-w-[1040px] border-collapse`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(xy,{children:`Status`}),(0,U.jsx)(xy,{children:`Task`}),(0,U.jsx)(xy,{children:`Workflow`}),(0,U.jsx)(xy,{children:`Branch`}),(0,U.jsx)(xy,{children:`±`}),(0,U.jsx)(xy,{children:`Ref`}),(0,U.jsx)(xy,{right:!0,children:`Tokens`}),(0,U.jsx)(xy,{right:!0,children:`Cost`}),(0,U.jsx)(xy,{right:!0,children:`CPU`}),(0,U.jsx)(xy,{right:!0,children:`Mem`}),(0,U.jsx)(xy,{right:!0,children:`Started`})]})}),(0,U.jsx)(`tbody`,{className:`[&>tr:last-child>td]:border-b-0`,children:u.map(e=>(0,U.jsx)(Cy,{run:e,queuePosition:e.status===`queued`?d.get(e.id)??null:null,onRename:i,now:a},e.id))})]})}),(0,U.jsx)(`div`,{"data-slot":`task-cards`,className:`flex flex-col gap-2.5 md:hidden`,children:u.map(e=>(0,U.jsx)(Dy,{run:e,queuePosition:e.status===`queued`?d.get(e.id)??null:null,now:a},e.id))})]}),f.map(e=>(0,U.jsxs)(`div`,{"data-slot":`compare-strip`,"data-group-id":e.groupId,className:`mt-3.5 flex flex-wrap items-center gap-2.5 rounded-lg border border-border bg-card px-3.5 py-2.5 text-[12.5px] text-muted-foreground shadow-xs`,children:[(0,U.jsx)(Sr,{className:`size-[15px] shrink-0 text-soft-foreground`,"aria-hidden":`true`}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{className:`font-semibold text-foreground`,children:e.title}),` — `,e.count,` variants finished`]}),(0,U.jsx)(P,{asChild:!0,variant:`outline`,size:`sm`,className:`md:ml-auto`,children:(0,U.jsx)(V,{to:`/compare/${e.groupId}`,children:`Compare`})})]},e.groupId))]}),(0,U.jsx)(V,{to:`/new`,"data-slot":`new-task-fab`,"aria-label":`New task`,className:`fixed right-4 bottom-[calc(16px+env(safe-area-inset-bottom))] z-20 inline-flex size-14 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-modal md:hidden`,children:(0,U.jsx)(xr,{className:`size-[22px]`,"aria-hidden":`true`})})]})}function yy({view:e,query:t}){let n=t.trim(),r=n?`search-miss`:e===`archived`?`archive`:`no-tasks`;return(0,U.jsx)(`div`,{"data-slot":`tasks-empty`,"data-empty-kind":r,className:`flex flex-1 flex-col`,children:r===`search-miss`?(0,U.jsx)(L,{heading:`h2`,icon:(0,U.jsx)(Mt,{}),tone:`neutral`,title:`No matching tasks`,subtitle:`No tasks match “${n}”.`}):r===`archive`?(0,U.jsx)(L,{heading:`h2`,icon:(0,U.jsx)(Rn,{}),tone:`neutral`,title:`Nothing archived yet`,subtitle:`Finished tasks you archive land here.`}):(0,U.jsx)(L,{heading:`h2`,icon:(0,U.jsx)(ur,{}),tone:`primary`,backdrop:!0,title:`No tasks yet`,subtitle:`Describe a task to get started.`,actions:(0,U.jsx)(P,{asChild:!0,children:(0,U.jsxs)(V,{to:`/new`,children:[(0,U.jsx)(xr,{"aria-hidden":`true`}),`New task`]})})})})}function by({view:e,current:t,onSelect:n,count:r,children:i}){let a=e===t;return(0,U.jsxs)(`button`,{type:`button`,"data-slot":`overview-tab`,"data-view":e,"aria-pressed":a,onClick:()=>n(e),className:B(`flex h-7 items-center justify-center gap-1.5 rounded-[7px] px-3 text-[12.5px] font-medium text-muted-foreground`,a&&`bg-card font-semibold text-foreground shadow-xs`),children:[i,r>0?(0,U.jsx)(`span`,{className:`font-mono text-[11px] tabular-nums`,children:r}):null]})}function xy({children:e,right:t=!1}){return(0,U.jsx)(`th`,{className:B(`h-[38px] border-b border-border px-2.5 text-left text-[11px] font-semibold tracking-[0.05em] whitespace-nowrap text-soft-foreground uppercase first:pl-4 last:pr-4`,t&&`text-right`),children:e})}var Sy=`h-11 border-b border-border px-2.5 whitespace-nowrap first:pl-4 last:pr-4`;function Cy({run:e,queuePosition:t,onRename:n,now:r}){let i=Kt(),a=Df(e),o=`/tasks/${e.id}`,s=hm(e.costUsd),c=xm(e);return(0,U.jsxs)(`tr`,{"data-slot":`task-table-row`,"data-run-id":e.id,onClick:e=>{e.target.closest(`a, button, input`)||i(o)},className:`group/row cursor-pointer hover:bg-muted`,children:[(0,U.jsx)(`td`,{className:Sy,children:(0,U.jsx)(_y,{dot:a.tone,pulse:a.pulse,children:a.label})}),(0,U.jsx)(`td`,{className:B(Sy,`w-[34%] max-w-0`),children:(0,U.jsx)(wy,{run:e,to:o,onRename:n})}),(0,U.jsx)(`td`,{className:B(Sy,`text-[12.5px] text-muted-foreground`),children:gm(e)}),(0,U.jsx)(`td`,{className:Sy,children:e.branch?(0,U.jsx)(Ay,{branch:e.branch}):(0,U.jsx)(Oy,{})}),(0,U.jsx)(`td`,{className:Sy,children:e.diffStat?(0,U.jsx)(lm,{stat:e.diffStat}):(0,U.jsx)(Oy,{})}),(0,U.jsx)(`td`,{className:Sy,children:c?(0,U.jsx)(um,{reference:c,taskTitle:rp(e)}):(0,U.jsx)(Oy,{})}),(0,U.jsx)(`td`,{className:B(Sy,`text-right font-mono text-xs text-muted-foreground tabular-nums`),children:Af(e.tokensUsed)}),(0,U.jsx)(`td`,{className:B(Sy,`text-right font-mono text-xs text-muted-foreground tabular-nums`),children:s||(0,U.jsx)(Oy,{})}),t===null?(0,U.jsx)(Ty,{run:e}):(0,U.jsxs)(`td`,{"data-slot":`queue-note`,colSpan:2,className:B(Sy,`text-right font-mono text-[11.5px] text-soft-foreground`),children:[`#`,t,` in queue`]}),(0,U.jsx)(`td`,{className:B(Sy,`text-right text-xs text-soft-foreground tabular-nums`),children:kf(e.startedAt??e.createdAt,r)})]})}function wy({run:e,to:t,onRename:n}){let r=rp(e),i=hy(r,t=>n(e.id,t));return i.editing?(0,U.jsx)(gy,{editor:i,className:`text-[13px] font-medium`}):(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,U.jsx)(V,{to:t,title:r,className:`min-w-0 truncate text-[13px] font-medium`,children:r}),(0,U.jsx)(`button`,{type:`button`,"data-slot":`row-rename`,"aria-label":`Rename task`,onClick:i.begin,className:`shrink-0 rounded-sm p-0.5 text-soft-foreground opacity-0 transition-opacity group-hover/row:opacity-100 hover:text-foreground focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,U.jsx)(yr,{className:`size-3`,"aria-hidden":`true`})})]})}function Ty({run:e}){let t=Cm(e,Pn(e.id));return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ey,{column:`cpu`,cell:t.cpu}),(0,U.jsx)(Ey,{column:`mem`,cell:t.mem})]})}function Ey({column:e,cell:t}){return(0,U.jsx)(`td`,{"data-usage":e,"data-usage-kind":t.kind,title:t.title,className:B(Sy,`text-right font-mono tabular-nums`,t.kind===`live`&&`bg-violet/5 text-xs font-medium text-foreground`,t.kind===`peak`&&`text-[11.5px] text-soft-foreground`,t.kind===`none`&&`text-xs text-soft-foreground`),children:t.text||`—`})}function Dy({run:e,queuePosition:t,now:n}){let r=Kt(),i=Df(e),a=`/tasks/${e.id}`,o=xm(e);return(0,U.jsxs)(`div`,{"data-slot":`task-card`,"data-run-id":e.id,onClick:e=>{e.target.closest(`a`)||r(a)},className:`cursor-pointer rounded-lg border border-border bg-card px-3.5 py-3 shadow-xs`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,U.jsx)(_y,{dot:i.tone,pulse:i.pulse,className:`mt-px shrink-0`,children:i.label}),(0,U.jsx)(V,{to:a,className:`min-w-0 flex-1 text-[13.5px] leading-[1.35] font-medium`,children:rp(e)}),(0,U.jsx)(`span`,{className:`mt-0.5 shrink-0 text-[11.5px] text-soft-foreground tabular-nums`,children:kf(e.finishedAt??e.createdAt,n)})]}),(0,U.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5 font-mono text-[11.5px] font-medium text-muted-foreground tabular-nums`,children:[(0,U.jsx)(`span`,{children:gm(e)}),t===null?(0,U.jsxs)(U.Fragment,{children:[e.branch?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ky,{}),(0,U.jsx)(`span`,{children:e.branch})]}):null,e.diffStat?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ky,{}),(0,U.jsx)(lm,{stat:e.diffStat,className:`text-[11.5px]`})]}):null,e.tokensUsed>0?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ky,{}),(0,U.jsx)(`span`,{children:Af(e.tokensUsed)})]}):null]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ky,{}),(0,U.jsxs)(`span`,{"data-slot":`queue-note`,children:[`#`,t,` in queue`]})]}),o?(0,U.jsx)(um,{reference:o,taskTitle:rp(e),className:`h-5`}):null]})]})}function Oy(){return(0,U.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:`—`})}function ky(){return(0,U.jsx)(`span`,{className:`text-soft-foreground`,"aria-hidden":`true`,children:`·`})}function Ay({branch:e}){return(0,U.jsx)(`span`,{className:`rounded-[6px] bg-muted px-1.5 py-0.5 font-mono text-[11.5px] font-medium text-muted-foreground`,children:e})}function jy(){let e=ot(),[t,n]=em(),r=Se(),i=pe({mutationFn:j,onSuccess:()=>r.invalidateQueries({queryKey:c.runs.all})}),a=pe({mutationFn:({id:e,title:t})=>Ze(e,{title:t}),onSuccess:()=>r.invalidateQueries({queryKey:c.runs.all}),onError:e=>F(e.message,{tone:`danger`})}),o=Tm(3e4);return(0,U.jsx)(vy,{runs:e.data,view:t,onViewChange:n,onArchiveFinished:()=>i.mutate(),onRename:(e,t)=>a.mutate({id:e,title:t}),now:o})}function My({mode:e=`list`}){let{automationId:t}=E(),n=Kt(),r=$t(),[i,a]=(0,H.useState)(),[o,s]=(0,H.useState)(``),[c,l]=(0,H.useState)({}),u=()=>re().then(a).catch(e=>s(String(e)));if((0,H.useEffect)(()=>{u()},[]),(0,H.useEffect)(()=>Dn((e,t)=>{if(e!==`automation-change`)return;let n=t;typeof n.project==`string`&&(r===null||n.project===r)&&u()}),[r]),e===`new`)return(0,U.jsx)(Py,{onSaved:()=>{n(`/automations`),u()}});if(e===`edit`){let e=i?.automations.find(e=>e.id===t);return e?(0,U.jsx)(Py,{automation:e,onSaved:()=>{n(`/automations`),u()}}):(0,U.jsx)(Iy,{text:`Loading automation…`})}if(e===`log`){let e=i?.automations.find(e=>e.id===t);return t?(0,U.jsx)(Ny,{automationId:t,automationName:e?.name}):(0,U.jsx)(Iy,{text:`Automation not found.`})}let d=async e=>{l(t=>({...t,[e.id]:`Checking…`}));try{let{checkId:t}=await $e(e.id,`preview`);for(let n=0;n<60;n+=1){let n=await we(t);if(n.status===`complete`){l(t=>({...t,[e.id]:`${n.matches??0} match${n.matches===1?``:`es`} found; no tasks launched.`})),u();return}if(n.status===`error`)throw Error(n.error??`Preview failed`);await new Promise(e=>setTimeout(e,500))}throw Error(`Preview is still running`)}catch(t){l(n=>({...n,[e.id]:t instanceof Error?t.message:String(t)}))}};return(0,U.jsx)(Fy,{title:`Automations`,subtitle:`Checks run while cezar is open. No webhook or public URL required.`,action:(0,U.jsx)(P,{asChild:!0,children:(0,U.jsxs)(V,{to:`/automations/new`,children:[(0,U.jsx)(xr,{}),`New automation`]})}),children:o?(0,U.jsx)(Iy,{text:o}):i?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`mb-4 rounded-lg border bg-muted/30 px-4 py-3 text-sm`,children:[(0,U.jsxs)(`span`,{className:`font-medium`,children:[`GitHub `,i.available?`available`:`unavailable`]}),(0,U.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · Scheduler `,i.scheduler.state,i.reason?` · ${i.reason}`:``]})]}),i.automations.length===0?(0,U.jsx)(Iy,{text:`No automations yet. Create one paused, test its bounded filter, then enable it from a current-time baseline.`}):(0,U.jsx)(`div`,{className:`grid gap-3`,children:i.automations.map(e=>(0,U.jsxs)(`article`,{className:`rounded-xl border bg-card p-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`font-semibold`,children:e.name}),(0,U.jsxs)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:[e.events.join(`, `),` · every `,Math.round(e.intervalSeconds/60),` min`]})]}),(0,U.jsx)(`span`,{className:`rounded-full border px-2 py-1 text-xs`,children:e.enabled?`Enabled`:`Paused`})]}),(0,U.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,U.jsxs)(P,{size:`sm`,variant:`outline`,onClick:()=>void d(e),disabled:c[e.id]===`Checking…`,children:[(0,U.jsx)(br,{}),`Test filter`]}),(0,U.jsx)(P,{size:`sm`,variant:`outline`,onClick:()=>void Ne(e.id,!e.enabled).then(u),children:e.enabled?`Pause`:`Enable`}),(0,U.jsx)(P,{size:`sm`,variant:`ghost`,asChild:!0,children:(0,U.jsx)(V,{to:`/automations/${e.id}`,children:`Edit`})}),(0,U.jsx)(P,{size:`sm`,variant:`ghost`,asChild:!0,children:(0,U.jsx)(V,{to:`/automations/${e.id}/log`,children:`View log`})})]}),c[e.id]&&(0,U.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,role:`status`,children:c[e.id]})]},e.id))})]}):(0,U.jsx)(Iy,{text:`Loading automations…`})})}function Ny({automationId:e,automationName:t}){let[n,r]=(0,H.useState)(),[i,a]=(0,H.useState)(``),o=()=>C(e).then(({records:e})=>r(e)).catch(e=>a(String(e)));return(0,H.useEffect)(()=>{o()},[e]),(0,H.useEffect)(()=>Dn((t,n)=>{t===`automation-change`&&n.automationId===e&&o()}),[e]),(0,U.jsx)(Fy,{title:`Execution log`,subtitle:t??`Automation activity`,action:(0,U.jsx)(P,{variant:`outline`,asChild:!0,children:(0,U.jsx)(V,{to:`/automations`,children:`Back to automations`})}),children:i?(0,U.jsx)(Iy,{text:i}):n?n.length===0?(0,U.jsx)(Iy,{text:`No checks have run yet.`}):(0,U.jsx)(`ol`,{className:`grid gap-3`,"aria-label":`Automation execution log`,children:n.map(e=>(0,U.jsxs)(`li`,{className:`rounded-xl border bg-card p-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,U.jsx)(`span`,{className:`font-medium capitalize`,children:e.result.replace(`-`,` `)}),(0,U.jsx)(`time`,{className:`text-xs text-muted-foreground`,dateTime:e.ts,children:new Date(e.ts).toLocaleString()})]}),e.reason&&(0,U.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.reason}),(e.githubUrl||e.runId)&&(0,U.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-3 text-sm`,children:[e.githubUrl&&(0,U.jsx)(`a`,{className:`underline underline-offset-4`,href:e.githubUrl,target:`_blank`,rel:`noreferrer`,children:e.githubTitle??`GitHub #${e.githubNumber??``}`}),e.runId&&(0,U.jsx)(V,{className:`underline underline-offset-4`,to:`/runs/${e.runId}`,children:`Open task`})]})]},e.seq))}):(0,U.jsx)(Iy,{text:`Loading execution log…`})})}function Py({automation:e,onSaved:t}){let[n,r]=(0,H.useState)(e?.name??``),[i,a]=(0,H.useState)(e?.task.prompt??`Review {{github.url}}`),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(``);return(0,U.jsx)(Fy,{title:e?`Edit automation`:`New automation`,subtitle:`Define a bounded GitHub trigger and the ordinary cezar task it launches.`,children:(0,U.jsxs)(`form`,{className:`grid max-w-3xl gap-6`,onSubmit:async r=>{r.preventDefault(),l(``);try{e?await Le(e.id,{name:n,description:e.description,events:e.events,intervalSeconds:e.intervalSeconds,filters:e.filters,task:{...e.task,prompt:i},enabled:e.enabled,expectedRevision:e.revision}):await D({name:n,events:[`issue.opened`],intervalSeconds:300,filters:{lookbackDays:7,maxRecords:25},task:{prompt:i,workflow:`quick-task`},enable:o}),t()}catch(e){l(String(e))}},children:[(0,U.jsxs)(`fieldset`,{className:`grid gap-4 rounded-xl border p-5`,children:[(0,U.jsx)(`legend`,{className:`px-2 font-semibold`,children:`When GitHub changes`}),(0,U.jsxs)(`div`,{className:`grid gap-2`,children:[(0,U.jsx)(Ju,{htmlFor:`automation-name`,children:`Name`}),(0,U.jsx)(qu,{id:`automation-name`,value:n,onChange:e=>r(e.target.value),required:!0})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,U.jsx)(Yn,{className:`size-4`}),`New issue · every 5 minutes · last 7 days · maximum 25 records`]})]}),(0,U.jsxs)(`fieldset`,{className:`grid gap-4 rounded-xl border p-5`,children:[(0,U.jsx)(`legend`,{className:`px-2 font-semibold`,children:`What task to run`}),(0,U.jsxs)(`div`,{className:`grid gap-2`,children:[(0,U.jsx)(Ju,{htmlFor:`automation-prompt`,children:`Prompt`}),(0,U.jsx)(Ft,{id:`automation-prompt`,value:i,onChange:e=>a(e.target.value),rows:8,required:!0})]}),(0,U.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Placeholders include `,`{{github.number}}`,`, `,`{{github.title}}`,`, `,`{{github.url}}`,`, and `,`{{github.labels}}`,`. GitHub content is appended as untrusted context.`]})]}),(0,U.jsxs)(`fieldset`,{className:`rounded-xl border p-5`,children:[(0,U.jsx)(`legend`,{className:`px-2 font-semibold`,children:`Review and enable`}),(0,U.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>s(e.target.checked)}),`Save and enable from a current-time baseline (existing matches will not launch)`]})]}),c&&(0,U.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:c}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(P,{type:`submit`,children:`Save automation`}),(0,U.jsx)(P,{type:`button`,variant:`outline`,onClick:t,children:`Cancel`})]})]})})}function Fy({title:e,subtitle:t,action:n,children:r}){return(0,U.jsxs)(`main`,{className:`mx-auto w-full max-w-6xl p-4 sm:p-6`,children:[(0,U.jsxs)(`header`,{className:`mb-6 flex flex-wrap items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,U.jsx)(Or,{className:`size-5`}),(0,U.jsx)(`h1`,{className:`text-2xl font-semibold`,children:e})]}),(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t})]}),n]}),r]})}function Iy({text:e}){return(0,U.jsx)(`div`,{className:`rounded-xl border border-dashed p-8 text-center text-sm text-muted-foreground`,children:e})}var Ly=(0,H.lazy)(()=>n(()=>import(`./task-thread-x1axqNnn.js`).then(e=>({default:e.TaskThreadRoute})),__vite__mapDeps([6,5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),Ry=(0,H.lazy)(()=>n(()=>import(`./compare-variants-CkvpSWZa.js`).then(e=>({default:e.CompareVariantsRoute})),__vite__mapDeps([22,5,7,8,17,19,14]))),zy=(0,H.lazy)(()=>n(()=>import(`./task-changes-CluQWIkd.js`).then(e=>({default:e.TaskChangesRoute})),__vite__mapDeps([23,5,7,8,9,10,11,12,13,14,15,24,25,26,16,27,18,28,29,21]))),By=(0,H.lazy)(()=>n(()=>import(`./task-files-CpWfXD2B.js`).then(e=>({default:e.TaskFilesRoute})),__vite__mapDeps([30,5,7,8,9,10,11,12,13,14,15,25,31]))),Vy=(0,H.lazy)(()=>n(()=>import(`./task-commits-BJRUd8fY.js`).then(e=>({default:e.TaskCommitsRoute})),__vite__mapDeps([32,5,7,8,9,10,11,12,13,14,15,33,26,17,31,28,29,21,34,20]))),Hy=(0,H.lazy)(()=>n(()=>import(`./repo-git-DW8ekpNQ.js`).then(e=>({default:e.RepoGitRoute})),__vite__mapDeps([35,5,7,8,33,13,14,24,12,25,26,16,15,27,17,31,28,29,21,34,20]))),Uy=(0,H.lazy)(()=>n(()=>import(`./github-B8nK4e73.js`).then(e=>({default:e.GithubRoute})),__vite__mapDeps([36,5,7,8,33,13,14,16,37,31,18,28,29,21]))),Wy=(0,H.lazy)(()=>n(()=>import(`./github-B8nK4e73.js`).then(e=>({default:e.GithubIndexRoute})),__vite__mapDeps([36,5,7,8,33,13,14,16,37,31,18,28,29,21]))),Gy=(0,H.lazy)(()=>n(()=>import(`./workflows-C3gTBtmF.js`).then(e=>({default:e.WorkflowsRoute})),__vite__mapDeps([38,5,7,8,11,39,15,31,27,18]))),Ky=(0,H.lazy)(()=>n(()=>import(`./skills-Bt9YVDdo.js`).then(e=>({default:e.SkillsRoute})),__vite__mapDeps([40,5,7,8,33,10,39,37,31,14])));function qy(){let e=M();return(0,U.jsx)(Qt,{to:{pathname:`/skills`,search:e.search,hash:e.hash},replace:!0})}function Jy({sectionId:e}){let t=M();return(0,U.jsx)(tt,{to:{pathname:cy(`global`,e),search:t.search,hash:t.hash},replace:!0})}function Yy(){return(0,U.jsx)(`div`,{"data-route":`scope-resolving`,className:`flex min-h-full flex-col`,children:(0,U.jsx)(`p`,{className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:`Loading…`})})}function Xy(){let{projectId:e=``}=E(),t=M(),n=De(),r=w();if(e==="default"){let e=n.data?.bootProject??(n.isError?r.data?.bootProject:void 0);if(e!==void 0){let n=t.pathname.replace(/^\/p\/default(?=\/|$)/,``);return(0,U.jsx)(tt,{to:`/p/${encodeURIComponent(e)}${n||`/`}${t.search}${t.hash}`,replace:!0})}if(!n.isError)return(0,U.jsx)(Yy,{})}if(n.data){if(!(n.data.bootProject===e||n.data.projects.some(t=>t.id===e)))return(0,U.jsx)(T_,{projectId:e,registry:n.data})}else if(!n.isError)return(0,U.jsx)(Yy,{});return(0,U.jsx)(en,{projectId:n.data?.bootProject===e?null:e,children:(0,U.jsx)(l,{},e)})}function Zy(){let{projectId:e=``}=E();return(0,U.jsx)(d_,{},e)}function Qy(){let e=M(),t=w();if(t.data===void 0)return(0,U.jsx)(Yy,{});let n=t.data.bootProject??`default`,r=e.pathname===`/p`||e.pathname===`/p/`?`/`:e.pathname;return(0,U.jsx)(tt,{to:`/p/${encodeURIComponent(n)}${r}${e.search}${e.hash}`,replace:!0})}var $y=[{pattern:`/`,pageLabel:`Tasks`},{pattern:`/new`,pageLabel:`New task`},{pattern:`/compare/:groupId`,pageLabel:`Compare`},{pattern:`/git/*`,pageLabel:`Git`},{pattern:`/github/*`,pageLabel:`GitHub`},{pattern:`/automations/*`,pageLabel:`Automations`},{pattern:`/skills`,pageLabel:`Skills`},{pattern:`/inbox`,pageLabel:`Inbox`},{pattern:`/workflows/*`,pageLabel:`Workflows`},{pattern:`/settings/*`,pageLabel:`Settings`}];function eb(e){let t=Zt(e),n=oe({path:`/tasks/:id/*`,end:!0},t);return n?{pageLabel:null,taskId:n.params.id??null}:{pageLabel:$y.find(({pattern:e})=>oe({path:e,end:!0},t))?.pageLabel??null,taskId:null}}function tb(){let e=w().data?.capabilities;return(0,U.jsxs)(k,{children:[(0,U.jsxs)(I,{path:`/p/:projectId`,element:(0,U.jsx)(Xy,{}),children:[(0,U.jsx)(I,{index:!0,element:(0,U.jsx)(jy,{})}),(0,U.jsx)(I,{path:`new`,element:(0,U.jsx)(Zy,{})}),(0,U.jsx)(I,{path:`tasks/:id`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(k_,{}),children:(0,U.jsx)(Ly,{})})}),(0,U.jsx)(I,{path:`tasks/:id/changes`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(D_,{tab:`changes`}),children:(0,U.jsx)(zy,{})})}),(0,U.jsx)(I,{path:`tasks/:id/files`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(D_,{tab:`files`}),children:(0,U.jsx)(By,{})})}),(0,U.jsx)(I,{path:`tasks/:id/commits`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(D_,{tab:`changes`}),children:(0,U.jsx)(Vy,{})})}),(0,U.jsx)(I,{path:`tasks/:id/commits/:sha`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(D_,{tab:`changes`}),children:(0,U.jsx)(Vy,{})})}),(0,U.jsx)(I,{path:`compare/:groupId`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(qm,{}),children:(0,U.jsx)(Ry,{})})}),(0,U.jsx)(I,{path:`git`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(C_,{}),children:(0,U.jsx)(Hy,{tab:`changes`})})}),(0,U.jsx)(I,{path:`git/commits`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(C_,{}),children:(0,U.jsx)(Hy,{tab:`commits`})})}),(0,U.jsx)(I,{path:`git/commits/:sha`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(C_,{}),children:(0,U.jsx)(Hy,{tab:`commits`})})}),(0,U.jsx)(I,{path:`git/branches`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(C_,{}),children:(0,U.jsx)(Hy,{tab:`branches`})})}),(0,U.jsx)(I,{path:`github`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(Jm,{}),children:(0,U.jsx)(Wy,{})})}),(0,U.jsx)(I,{path:`github/prs`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(Jm,{}),children:(0,U.jsx)(Uy,{view:`prs`})})}),(0,U.jsx)(I,{path:`github/issues/:n`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(Jm,{}),children:(0,U.jsx)(Uy,{view:`issues`})})}),(0,U.jsx)(I,{path:`github/prs/:n`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(Jm,{}),children:(0,U.jsx)(Uy,{view:`prs`})})}),(0,U.jsx)(I,{path:`github/prs/:n/changes`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(Jm,{}),children:(0,U.jsx)(Uy,{view:`prs`,changes:!0})})}),(0,U.jsx)(I,{path:`automations`,element:(0,U.jsx)(My,{})}),(0,U.jsx)(I,{path:`automations/new`,element:(0,U.jsx)(My,{mode:`new`})}),(0,U.jsx)(I,{path:`automations/:automationId`,element:(0,U.jsx)(My,{mode:`edit`})}),(0,U.jsx)(I,{path:`automations/:automationId/log`,element:(0,U.jsx)(My,{mode:`log`})}),(0,U.jsx)(I,{path:`skills`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(w_,{}),children:(0,U.jsx)(Ky,{})})}),(0,U.jsx)(I,{path:`inbox`,element:(0,U.jsx)(Wh,{})}),(0,U.jsx)(I,{path:`workflows`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(E_,{}),children:(0,U.jsx)(Gy,{})})}),(0,U.jsx)(I,{path:`workflows/:name`,element:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(E_,{}),children:(0,U.jsx)(Gy,{})})}),(0,U.jsx)(I,{path:`settings`,element:(0,U.jsx)(my,{scope:`project`,capabilities:e})}),(0,U.jsx)(I,{path:`settings/skills`,element:(0,U.jsx)(qy,{})}),sy(`project`,e).map(t=>(0,U.jsx)(I,{path:`settings/${t.id}`,element:(0,U.jsx)(py,{section:t,scope:`project`,capabilities:e})},t.id)),sy(`global`,e).map(e=>(0,U.jsx)(I,{path:`settings/${e.id}`,element:(0,U.jsx)(Jy,{sectionId:e.id})},e.id)),(0,U.jsx)(I,{path:`*`,element:(0,U.jsx)(S_,{})})]}),(0,U.jsx)(I,{path:`/settings/global`,element:(0,U.jsx)(my,{scope:`global`,capabilities:e})}),sy(`global`,e).map(t=>(0,U.jsx)(I,{path:cy(`global`,t.id),element:(0,U.jsx)(py,{section:t,scope:`global`,capabilities:e})},t.id)),(0,U.jsx)(I,{path:`*`,element:(0,U.jsx)(Qy,{})})]})}function nb(e){let t=e?.repo;if(!t)return null;let n=t.root.replace(/[\\/]+$/,``).split(/[\\/]/).pop();return n?{name:n,branch:t.branch}:null}function rb(e){return e?.available===!0&&(e.status===`available`||e.status===`error`)}function ib({children:e}){let{pathname:t}=M(),n=$t(),r=w(),i=r.data?.capabilities.followups===!0,a=xt(i),o=rb(Pe(n??``,n!==null).data),s=De().data,c=eb(t),l=s?.bootProject??r.data?.bootProject??null,u=n!==null&&n===l,d=s?.projects.find(e=>e.id===n),f=O(n??``,d!==void 0&&c.taskId!==null,s?.bootProject===n).data,p=t===`/settings/global`||t.startsWith(`/settings/global/`)?null:d?.name??(u?nb(r.data)?.name??null:null),m=c.taskId?f?.find(e=>e.id===c.taskId):void 0;Km({projectName:p,pageLabel:m?rp(m):c.pageLabel});let h=s&&s.projects.length>1?s:null;return(0,U.jsxs)($p,{children:[(0,U.jsx)(Hp,{repo:nb(r.data),version:r.data?.version??null,latestVersion:r.data?.latestVersion??null,inboxCount:a.data?.length??null,skillsUpdateAvailable:o,forgeAvailable:r.data?.forge?.available===!0,inboxAvailable:i,banner:(0,U.jsx)(cm,{}),singleProject:r.data?.capabilities.singleProject===!0,taskQuickList:(0,U.jsx)(Mm,{}),projectGroups:h?(0,U.jsx)(Lm,{projects:h.projects,bootProjectId:h.bootProject,forgeAvailable:r.data?.forge?.available===!0,inboxAvailable:i,inboxCount:a.data?.length??null,skillsUpdateAvailable:o}):void 0,toolsMenu:(0,U.jsx)(Vm,{health:r.data}),children:e}),(0,U.jsx)(yp,{})]})}function ab(){let e=Se(),t=Tv(m().data?.notifications).enabled,n=(0,H.useRef)(t);n.current=t;let r=(0,H.useRef)(new Map);return(0,H.useEffect)(()=>{let t=pt(c.runs.list()),i=e=>{let{entering:t,statuses:i}=Dv(r.current,e);if(r.current=i,t.length!==0&&Ov({enabled:n.current,hidden:document.visibilityState===`hidden`,permission:Ev()}))for(let e of t)ob(e)};return i(e.getQueryData(c.runs.list())),e.getQueryCache().subscribe(e=>{e.query.queryHash!==t||e.type!==`updated`||i(e.query.state.data)})},[e]),null}function ob(e){let t=globalThis.Notification;if(typeof t!=`function`)return;let n=kv(e);try{new t(n.title,{body:n.body,tag:n.tag})}catch{}}function sb(){let[e]=(0,H.useState)(Ln);return(0,U.jsx)(u,{client:e,children:(0,U.jsxs)(Nn,{children:[(0,U.jsx)(ab,{}),(0,U.jsx)(md,{children:(0,U.jsx)(fv,{children:(0,U.jsxs)(v,{children:[(0,U.jsx)(ib,{children:(0,U.jsx)(tb,{})}),(0,U.jsx)(mt,{})]})})})]})})}var cb=document.getElementById(`root`);if(!cb)throw Error(`cezar: #root container is missing from index.html`);(0,fn.createRoot)(cb).render((0,U.jsx)(H.StrictMode,{children:(0,U.jsx)(sb,{})}));export{bm as $,yr as $t,Ph as A,Df as At,uh as B,Ru as Bt,Sg as C,Ff as Ct,qh as D,Bf as Dt,Kh as E,Gf as Et,Ch as F,Sf as Ft,rh as G,Wu as Gt,ch as H,Gu as Ht,xh as I,vf as It,Jm as J,Tr as Jt,nh as K,kr as Kt,mh as L,rd as Lt,Eh as M,yf as Mt,Sh as N,bf as Nt,Lh as O,Af as Ot,wh as P,_f as Pt,Sm as Q,br as Qt,ph as R,Xu as Rt,Cg as S,If as St,ig as T,Zf as Tt,eh as U,Q as Ut,dh as V,Hu as Vt,$m as W,Uu as Wt,fm as X,Sr as Xt,qm as Y,Cr as Yt,hm as Z,xr as Zt,a_ as _,rp as _t,k_ as a,qn as an,Pp as at,Ag as b,Mf as bt,E_ as c,zn as cn,Ip as ct,s_ as d,wp as dt,sr as en,ym as et,c_ as f,Dp as ft,r_ as g,ap as gt,i_ as h,ip as ht,Cv as i,Jn as in,kp as it,Rh as j,hf as jt,Bh as k,kf as kt,C_ as l,Rn as ln,xp as lt,o_ as m,Sp as mt,gy as n,rr as nn,um as nt,O_ as o,Kn as on,Lp as ot,n_ as p,Op as pt,sh as q,Or as qt,hy as r,Qn as rn,lm as rt,D_ as s,Gn as sn,Fp as st,_y as t,or as tn,gm as tt,$g as u,Cp as ut,jg as v,Rf as vt,mg as w,Xf as wt,kg as x,Nf as xt,Mg as y,Qf as yt,fh as z,qu as zt};
|