@deslop/workbench 0.0.384 → 0.0.391
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/{anthropic-C02QVQ9u.mjs → anthropic-DcE0yHBZ.mjs} +5 -5
- package/dist/{azure-openai-responses-CUFLNwdy.mjs → azure-openai-responses-ecGypQVA.mjs} +4 -4
- package/dist/client/assets/-workbench-terminal-BXoM87zf.js +145 -0
- package/dist/client/assets/agent-15Ys-EV7.js +1 -0
- package/dist/client/assets/agent-CwZrrVgw.js +2 -0
- package/dist/client/assets/{dialog-B0kBnYwI.js → dialog-D3SsOi-l.js} +17 -17
- package/dist/client/assets/{diff-o4xLJTw0.js → diff-CSExRPif.js} +51 -49
- package/dist/client/assets/diff-Dwyi9RiJ.js +2 -0
- package/dist/client/assets/{external-link-D7Q28KpR.js → external-link-Dg1sMSmg.js} +1 -1
- package/dist/client/assets/fallbacks-D1MIlTO6.js +16 -0
- package/dist/client/assets/index-B2S_w1d1.css +2 -0
- package/dist/client/assets/{index-ClCMMzj9.js → index-YdollqUD.js} +3 -3
- package/dist/client/assets/input-DZnkCVx3.js +1 -0
- package/dist/client/assets/portless-DGijexQV.js +2 -0
- package/dist/client/assets/portless-DSDYE-Pc.js +1 -0
- package/dist/client/assets/resizable-BWgF68j6.js +1 -0
- package/dist/client/assets/route-BuzkrubX.js +45 -0
- package/dist/client/assets/route-D3fj0Kxy.js +2 -0
- package/dist/client/assets/{run-wjcPjpA5.js → run-ByOu_fKi.js} +1 -1
- package/dist/client/assets/run-D-KGLETl.js +2 -0
- package/dist/client/assets/{sonner-DgKrvTU1.js → sonner-vAlNGB2c.js} +1 -1
- package/dist/client/assets/state-DipxiPcD.js +2 -0
- package/dist/client/assets/terminal-dP11iiPC.js +1 -0
- package/dist/client/assets/terminal-zDmQe2b5.js +2 -0
- package/dist/client/assets/{triangle-alert-cDPYgb7f.js → triangle-alert-CHTnDlTF.js} +1 -1
- package/dist/client/index.html +11 -11
- package/dist/{github-copilot-headers-B--aVYl2.mjs → github-copilot-headers-P0xZolzq.mjs} +2 -2
- package/dist/{google-DHtiCcEt.mjs → google-Jzn1v4-q.mjs} +4 -4
- package/dist/{google-shared-BT0mQb3v.mjs → google-shared-DNNqX1gf.mjs} +3 -3
- package/dist/{google-vertex-CRkz0MgQ.mjs → google-vertex-z0Cbw7eq.mjs} +4 -4
- package/dist/{hash-CDrrQIkY.mjs → hash-CScAQ-b_.mjs} +1 -1
- package/dist/{headers-m19bM8_9.mjs → headers-oksLmLNC.mjs} +1 -1
- package/dist/{mistral-DXtHhhUc.mjs → mistral-CxEIkz4y.mjs} +4 -4
- package/dist/{openai-codex-responses-BSLixEC8.mjs → openai-codex-responses-7ZUsVcbT.mjs} +6 -6
- package/dist/{openai-completions-CE-LDmL4.mjs → openai-completions-CaGFVr3X.mjs} +48 -10
- package/dist/{openai-responses-41QiypX_.mjs → openai-responses-Vjw8-3qm.mjs} +5 -5
- package/dist/{openai-responses-shared-BAoGGIxP.mjs → openai-responses-shared-DtEshy-7.mjs} +4 -4
- package/dist/{openrouter-CDq1vETJ.mjs → openrouter-CZ-H_QwG.mjs} +3 -3
- package/dist/{sanitize-unicode-CPcy0g31.mjs → sanitize-unicode-BbVojtka.mjs} +1 -1
- package/dist/server.js +2543 -1879
- package/dist/{transform-messages-CUKh2_5w.mjs → transform-messages-CLmkH5Gu.mjs} +2 -2
- package/package.json +1 -1
- package/dist/client/assets/-workbench-terminal-nnzNYgEY.js +0 -145
- package/dist/client/assets/agent-CnBPS10_.js +0 -1
- package/dist/client/assets/agent-XCbfwj2z.js +0 -2
- package/dist/client/assets/diff-ClnF3EUN.js +0 -2
- package/dist/client/assets/fallbacks-DwGmG_0c.js +0 -16
- package/dist/client/assets/index-DT_QSnKQ.css +0 -2
- package/dist/client/assets/input-CEh4Uy0l.js +0 -1
- package/dist/client/assets/portless-BEzC3sH4.js +0 -2
- package/dist/client/assets/portless-DLmFLaZz.js +0 -1
- package/dist/client/assets/resizable-A9BpOcmt.js +0 -1
- package/dist/client/assets/route-Da0uHKH9.js +0 -45
- package/dist/client/assets/route-ULg8h9n0.js +0 -2
- package/dist/client/assets/run-DY23jobN.js +0 -2
- package/dist/client/assets/state-_2CmL5IM.js +0 -2
- package/dist/client/assets/terminal-BC9WKciF.js +0 -1
- package/dist/client/assets/terminal-Bn9lFOEg.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,r as n,t as r}from"./compiler-runtime-CLAvuQ-D.js";import{A as i,S as a,c as o,g as s,h as c,l,m as u,p as d,s as f}from"./fallbacks-D1MIlTO6.js";import{c as p,h as m,i as h,s as g,u as _}from"./resizable-BWgF68j6.js";var v=e(n(),1),y=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),b={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},x={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},S={disabled:!1,...x},C={valid(e){return e===null?null:e?{[y.valid]:``}:{[y.invalid]:``}}},w={invalid:void 0,name:void 0,validityData:{state:b,errors:[],error:``,value:``,initialValue:null},setValidityData:l,disabled:void 0,touched:x.touched,setTouched:l,dirty:x.dirty,setDirty:l,filled:x.filled,setFilled:l,focused:x.focused,setFocused:l,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:S,markedDirtyRef:{current:!1},registerFieldControl:l,validation:{getValidationProps:(e,t=o)=>t,inputRef:{current:null},registerInput:l,commit:async()=>{},change:l}},T=v.createContext(w);function E(e=!0){let t=v.useContext(T);if(t.setValidityData===l&&!e)throw Error(d(28));return t}var D=v.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:l,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function O(){return v.useContext(D)}var k=v.createContext({controlId:void 0,registerControlId:l,labelId:void 0,setLabelId:l,messageIds:[],setMessageIds:l,getDescriptionProps:e=>e});function A(){return v.useContext(k)}function j({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=v.useRef(e!==void 0),[a,o]=v.useState(t);return[i?e:a,v.useCallback(e=>{i||o(e)},[])]}function M(e,t,n,r,i=!0,a){let{registerFieldControl:o}=E(),s=v.useRef(null);s.current||=Symbol(),u(()=>{let c=s.current;if(!(!c||!i))return o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}),()=>{o(c,void 0)}},[e,i,r,t,a,o,n])}function N(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:o}=A(),d=p(t),f=n?i:void 0,m=s(()=>Symbol(`labelable-control`)),h=v.useRef(!1),g=v.useRef(t!=null),_=c(()=>{!h.current||o===l||(h.current=!1,o(m.current,void 0))});return u(()=>{if(o===l)return;let e;if(n){let n=r?.current;e=a(n)&&n.closest(`label`)!=null?t??null:f??d}else if(t!=null)g.current=!0,e=t;else if(g.current)e=d;else{_();return}if(e===void 0){_();return}h.current=!0,o(m.current,e)},[t,r,f,o,n,d,m,_]),v.useEffect(()=>_,[_]),i??d}var P=v.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:l,defaultValue:d,autoFocus:p=!1,style:y,...b}=e,{state:x,name:S,disabled:w,setTouched:T,setDirty:D,validityData:k,setFocused:P,setFilled:F,validationMode:I,validation:L}=E(),{clearErrors:R}=O(),z=w||s,B=S??a,V={...x,disabled:z},{labelId:H}=A(),U=N({id:i});u(()=>{let e=o!=null;L.inputRef.current?.value||e&&o!==``?F(!0):e&&o===``&&F(!1)},[L.inputRef,F,o]);let W=v.useRef(null);u(()=>{p&&W.current===h(g(W.current))&&P(!0)},[p,P]);let[G]=j({controlled:o,default:d,name:`FieldControl`,state:`value`}),K=o!==void 0,q=K?G:void 0,J=c(()=>L.inputRef.current?.value);return M(L.inputRef,U,q,J,!z,a),f(`input`,e,{ref:[t,W],state:V,props:[{id:U,disabled:z,name:B,ref:L.inputRef,"aria-labelledby":H,autoFocus:p,...K?{value:q}:{defaultValue:d},onChange(e){let t=e.currentTarget.value;l?.(t,_(m,e.nativeEvent)),D(t!==k.initialValue),F(t!==``),e.nativeEvent.defaultPrevented||(R(B),L.change(t))},onFocus(){P(!0)},onBlur(e){T(!0),P(!1),I===`onBlur`&&L.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(T(!0),L.commit(e.currentTarget.value))}},b,e=>L.getValidationProps(z,e)],stateAttributesMapping:C})}),F=t(),I=v.forwardRef(function(e,t){return(0,F.jsx)(P,{ref:t,...e})}),L=r();function R(e){let t=(0,L.c)(10),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({className:n,type:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let o;t[4]===n?o=t[5]:(o=i(`border-input file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:disabled:bg-input/80 h-8 w-full min-w-0 rounded-none border bg-transparent px-2.5 py-1 font-normal transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:font-normal focus-visible:ring-1 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-1`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==o||t[8]!==a?(s=(0,F.jsx)(I,{type:a,"data-slot":`input`,className:o,...r}),t[6]=r,t[7]=o,t[8]=a,t[9]=s):s=t[9],s}export{R as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/portless-DSDYE-Pc.js","assets/rolldown-runtime-QTnfLwEv.js","assets/compiler-runtime-CLAvuQ-D.js","assets/fallbacks-D1MIlTO6.js","assets/triangle-alert-CHTnDlTF.js","assets/resizable-BWgF68j6.js","assets/external-link-Dg1sMSmg.js","assets/state-DipxiPcD.js","assets/input-DZnkCVx3.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Fs as e,Is as t,Mt as n,Ot as r,nt as i,rt as a}from"./fallbacks-D1MIlTO6.js";import{t as o}from"./preload-helper-CjdClQve.js";var s=t(`/(home)/$worktree/portless`)({component:e(()=>o(()=>import(`./portless-DSDYE-Pc.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8])),`component`),validateSearch:n(a({origin:r(i)}))});export{s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,r as n,t as r}from"./compiler-runtime-CLAvuQ-D.js";import{A as i,As as a,Br as o,Fo as s,Gr as c,I as l,Ir as u,J as d,Ka as f,L as p,Lr as m,Ms as h,N as g,Ns as _,Ot as v,R as y,Rr as b,Ur as x,Va as ee,Vr as S,Wr as C,a as w,en as T,gs as E,mo as te,n as ne,nt as D,o as re,oo as ie,r as O,rt as k,ut as A,yt as j}from"./fallbacks-D1MIlTO6.js";import{t as M}from"./triangle-alert-CHTnDlTF.js";import{n as N,r as P,t as F,y as I}from"./resizable-BWgF68j6.js";import{t as L}from"./external-link-Dg1sMSmg.js";import{j as R,o as z,r as B}from"./state-DipxiPcD.js";import{t as V}from"./portless-DGijexQV.js";import{t as H}from"./input-DZnkCVx3.js";var U=_(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),ae=_(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),W=_(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),G=_(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),K=_(`file-clock`,[[`path`,{d:`M16 22h2a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v2.85`,key:`ryk6xj`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 14v2.2l1.6 1`,key:`6m4bie`}],[`circle`,{cx:`8`,cy:`16`,r:`6`,key:`10v15b`}]]),q=_(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),J=_(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Y=r(),X=e(n(),1),Z=t();function Q(e,t){return`${e}${x(`/`)(t)?t:`/${t}`}`}function oe(e){if(e===``)return`localhost:0000`;try{return new URL(e).host}catch{return a(e,o(/^https?:\/\//u,``))}}var se=A([k({deslopBrowserFavicon:d(!0),href:v(D)}),k({deslopBrowserLocation:d(!0),path:v(D)}),k({deslopBrowserLog:d(!0),level:D,message:D})]);function ce(e){return a(p(e),y(`error`,()=>`text-destructive`),y(`warn`,()=>`text-chart-2`),y(`info`,()=>`text-chart-1`),y(`debug`,()=>`text-chart-4`),l(()=>`text-muted-foreground`))}function le(e){return a(p(e.level),y(`error`,()=>(0,Z.jsx)(U,{className:`size-3.5`})),y(`warn`,()=>(0,Z.jsx)(M,{className:`size-3.5`})),y(`info`,()=>(0,Z.jsx)(h,{className:`size-3.5`})),y(`debug`,()=>(0,Z.jsx)(G,{className:`size-3.5`})),l(()=>(0,Z.jsx)(I,{className:`size-2`})))}function $(e){let t=(0,Y.c)(3),n=e.origin??``,r;return t[0]!==n||t[1]!==e.className?(r=(0,Z.jsx)(ue,{className:e.className,origin:n},n),t[0]=n,t[1]=e.className,t[2]=r):r=t[2],r}function ue(e){let t=(0,X.useRef)(null),n=(0,X.useRef)(0),[r,l]=(0,X.useState)(()=>({address:`/`,currentUrl:b(e.origin)?Q(e.origin,`/`):``,faviconUrl:void 0,frameKey:0,isLoading:b(e.origin),logs:f()}));(0,X.useLayoutEffect)(()=>{function t(t){t.origin===e.origin&&a(j(se)(t.data),s({onNone:()=>{},onSome:e=>{l(t=>{if(`deslopBrowserFavicon`in e)return{...t,faviconUrl:e.href};if(`deslopBrowserLocation`in e)return{...t,address:e.path??`/`};let r=C(e.message);if(x(`[vite]`)(e.message)||u(`react scan`)(r)||u(`react-scan`)(r)||u(`react grab`)(r)||u(`react-grab`)(r))return t;let i={id:n.current++,level:e.level,message:e.message,time:T()};return{...t,logs:[...te(t.logs,199),i]}})}}))}return window.addEventListener(`message`,t),()=>{window.removeEventListener(`message`,t)}},[e.origin]);function d(){if(m(e.origin))return;let t=Q(e.origin,c(r.address)||`/`);l(e=>({...e,currentUrl:t,faviconUrl:void 0,isLoading:!0,logs:[]}))}function p(){m(e.origin)||(l(e=>({...e,logs:[]})),t.current?.contentWindow?.postMessage({deslopBrowserClear:!0},e.origin))}function h(){try{t.current?.contentWindow?.history.back()}catch{}}function _(){try{t.current?.contentWindow?.history.forward()}catch{}}return(0,Z.jsxs)(`div`,{className:i(`bg-background flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden border`,e.className),children:[(0,Z.jsxs)(`form`,{className:`bg-muted/30 flex shrink-0 items-center gap-1 border-b p-2`,onSubmit:e=>{e.preventDefault(),d()},children:[(0,Z.jsx)(w,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Back`,onClick:h,children:(0,Z.jsx)(ae,{className:`size-3.5`})}),(0,Z.jsx)(w,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Forward`,onClick:_,children:(0,Z.jsx)(W,{className:`size-3.5`})}),(0,Z.jsx)(w,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Reload`,onClick:()=>{l(e=>({...e,frameKey:e.frameKey+1,isLoading:!0,logs:[]}))},children:(0,Z.jsx)(q,{className:`size-3.5`})}),(0,Z.jsx)(`div`,{className:`border-border flex h-8 w-8 shrink-0 items-center justify-center border`,children:E(r.faviconUrl)&&(0,Z.jsx)(`img`,{src:r.faviconUrl,alt:``,className:`size-4`})}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Z.jsx)(`div`,{className:`border-input bg-secondary text-secondary-foreground/70 flex h-8 min-w-0 shrink items-center border px-2 text-xs`,children:(0,Z.jsx)(`span`,{className:`min-w-0 overflow-hidden text-ellipsis whitespace-nowrap`,children:oe(e.origin)})}),(0,Z.jsx)(H,{value:x(`/`)(r.address)?S(1)(r.address):r.address,placeholder:``,className:`min-w-[7rem] flex-1 text-xs`,onChange:e=>{let t=`/${a(e.currentTarget.value,o(/^\/+/u,``))}`;l(e=>({...e,address:t}))}})]}),(0,Z.jsx)(`a`,{className:re({size:`icon`,variant:`outline`}),"aria-label":`Open top-level preview`,href:b(r.currentUrl)?r.currentUrl:void 0,target:`_blank`,rel:`noopener noreferrer`,children:(0,Z.jsx)(L,{className:`size-3.5`})}),b(e.origin)&&(0,Z.jsx)(w,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Clear cookies`,onClick:p,children:(0,Z.jsx)(J,{className:`size-3.5`})})]}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[m(e.origin)?(0,Z.jsx)(ne,{message:`Start a dev server in this worktree terminal to open a browser preview.`}):(0,Z.jsxs)(P,{orientation:`vertical`,className:`min-h-0 flex-1`,children:[(0,Z.jsx)(N,{defaultSize:`100%`,minSize:`40%`,children:(0,Z.jsxs)(`div`,{className:`relative h-full min-h-0 w-full`,children:[(0,Z.jsx)(`iframe`,{ref:t,title:r.currentUrl,src:r.currentUrl,className:`bg-background h-full min-h-0 w-full border-0`,onLoad:()=>{l(e=>({...e,isLoading:!1}))}},r.frameKey),r.isLoading&&(0,Z.jsx)(`div`,{className:`bg-background absolute inset-0 flex`,children:(0,Z.jsx)(O,{})})]})}),(0,Z.jsx)(F,{}),(0,Z.jsx)(N,{collapsible:!0,collapsedSize:0,defaultSize:0,minSize:0,maxSize:`50%`,children:(0,Z.jsx)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:(0,Z.jsx)(`div`,{className:i(`min-h-0 flex-1 overflow-auto font-mono text-xs`,r.logs.length===0&&`hidden`),children:ie(r.logs,e=>(0,Z.jsxs)(`div`,{className:`grid grid-cols-[8rem_1rem_minmax(0,1fr)] gap-3 px-2 py-1`,children:[(0,Z.jsx)(`span`,{className:`overflow-hidden whitespace-nowrap select-none`,children:g(e.time)}),(0,Z.jsx)(`span`,{className:i(`flex shrink-0 items-center select-none`,ce(e.level)),title:e.level,children:(0,Z.jsx)(le,{level:e.level})}),(0,Z.jsx)(`span`,{className:`min-w-0 break-words whitespace-pre-wrap select-text`,children:e.message})]},e.id))})})})]}),(0,Z.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center justify-between border-b px-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 font-mono text-xs`,children:[(0,Z.jsx)(K,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:r.logs.length})]}),(0,Z.jsx)(w,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Clear browser logs`,onClick:()=>{l(e=>({...e,logs:[]}))},children:(0,Z.jsx)(J,{className:`size-3.5`})})]})]})]})}function de(){let e=(0,Y.c)(9),t=V.useParams(),n=V.useSearch(),r;e[0]===t.worktree?r=e[1]:(r=B(t.worktree),e[0]=t.worktree,e[1]=r);let i=R(r),o=i.value.activeWorktree?.root??``,s;e[2]===o?s=e[3]:(s=z(o),e[2]=o,e[3]=s);let c=R(s);if(!i.value.activeWorktree)return;let l;e[4]!==c||e[5]!==n.origin?(l=E(n.origin)&&a(c.value,ee(n.origin))?n.origin:c.value[0],e[4]=c,e[5]=n.origin,e[6]=l):l=e[6];let u=l,d;return e[7]===u?d=e[8]:(d=(0,Z.jsx)(`div`,{className:`bg-background h-full min-h-0 min-w-0 p-2`,children:(0,Z.jsx)($,{className:`h-full min-h-0 w-full min-w-0`,origin:u})}),e[7]=u,e[8]=d),d}export{de as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,r as n,t as r}from"./compiler-runtime-CLAvuQ-D.js";import{A as i,D as a,Ns as o,_ as s,c}from"./fallbacks-D1MIlTO6.js";var l=o(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),u=`none`,d=`trigger-press`,f=`trigger-hover`,p=`outside-press`,m=`close-press`,h=`focus-out`,g=`escape-key`,_=`imperative-action`;function v(e,t,n,r){let i=!1,a=!1,o=r??c;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var y=e(n(),1),b=0;function x(e,t=`mui`){let[n,r]=y.useState(e),i=e||n;return y.useEffect(()=>{n??(b+=1,r(`${t}-${b}`))},[n,t]),i}var S=s.useId;function C(e,t){if(S!==void 0){let n=S();return e??(t?`${t}-${n}`:n)}return x(e,t)}function w(e){return C(e,`base-ui`)}function T(e){return e?.ownerDocument||document}function E(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function D(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&a(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ee(e){return`composedPath`in e?e.composedPath()[0]:e.target}var O=r(),k=t();function te(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function ne(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function re(e){return e/100*window.innerHeight}function ie(e){return e/100*window.innerWidth}function ae(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function A({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=ae(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=ne(t,i);break;case`em`:r=te(t,i);break;case`vh`:r=re(i);break;case`vw`:r=ie(i);break}return r}function j(e){return parseFloat(e.toFixed(3))}function M({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function oe(e){let{panels:t}=e,n=M({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=j(A({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=j(A({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=j(A({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=j(A({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function N(e,t=`Assertion error`){if(!e)throw Error(t)}function se(e,t){return Array.from(t).sort(e===`horizontal`?ce:le)}function ce(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function le(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function ue(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function de(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function fe({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=de(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return N(i,`No rect found`),i}var pe;function me(){return pe===void 0&&(pe=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),pe}function he(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=se(n,Array.from(t.children).filter(ue).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,fe({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=me()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:M({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var ge=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},P=new Map,_e=new ge;function ve(e){P=new Map(P),P.delete(e)}function ye(e,t){for(let[t]of P)if(t.id===e)return t}function F(e,t){for(let[t,n]of P)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function I(){return P}function be(e,t){return _e.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function L(e,t){let n=P.get(e);P=new Map(P),P.set(e,t),_e.emit(`groupChange`,{group:e,prev:n,next:t})}function xe(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=de(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function Se(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Ce(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:ke(e),b:ke(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();N(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:Oe(De(n.a)),b:Oe(De(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var we=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Te(e){let t=getComputedStyle(Ae(e)??e).display;return t===`flex`||t===`inline-flex`}function Ee(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Te(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||we.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function De(e){let t=e.length;for(;t--;){let n=e[t];if(N(n,`Missing node`),Ee(n))return n}return null}function Oe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function ke(e){let t=[];for(;e;)t.push(e),e=Ae(e);return t}function Ae(e){let{parentNode:t}=e;return Se(t)?t.host:t}function je(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Me({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!ue(n)||n.contains(e)||e.contains(n))return!0;if(Ce(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(je(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Ne(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=he(r),a=xe(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&Me({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function Pe(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function R(e,t,n=0){return Math.abs(j(e)-j(t))<=n}function z(e,t){return R(e,t)?0:e>t?1:-1}function B({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(z(r,c)<0)if(a){let e=(i+c)/2;r=z(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=j(r),r}function V({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(R(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;N(u!=null,`Invalid first pivot index`),N(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];N(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(N(n!=null,`Previous layout not found for panel index ${t}`),R(n,i)){let t=o-n;z(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];N(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(N(n!=null,`Previous layout not found for panel index ${t}`),R(n,o)){let t=n-i;z(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];N(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&z(i,c)<0)if(e>0){let t=c-o,n=t/2;z(i+e,c)<0&&(e=z(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;z(i-e,c)<0&&(e=z(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];N(e!=null,`Previous layout not found for panel index ${r}`);let a=B({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];N(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=B({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!R(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(Pe(c,l))return i;{let t=e<0?d:u,r=s[t];N(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=B({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!R(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];N(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=B({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(R(i,s)||(t-=s-i,l[r]=s),R(t,0))break;e>0?r--:r++}}}if(!R(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function H(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||z(e[n],t[n])!==0)return!1;return!0}function U({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!R(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];N(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];N(i!=null,`No layout data found for index ${e}`);let o=r[e];N(o!=null,`No layout data found for index ${e}`);let s=B({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!R(a,0))for(let e=0;e<t.length;e++){let n=r[e];N(n!=null,`No layout data found for index ${e}`);let i=n+a,o=B({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,R(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function Fe({groupId:e,panelId:t}){let n=()=>{let t=I();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=({nextSize:e,panels:n,prevLayout:r,derivedPanelConstraints:i})=>{let o=a(),s=n.findIndex(e=>e.id===t),c=s===0,l=s===n.length-1;if(l&&e<o&&(c||n.slice(0,s).every((e,t)=>{let n=i[t];return n?.collapsible&&R(n.collapsedSize,r[n.panelId])}))){let e=n.slice(0,s).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:j(100-e)}}return V({delta:l?o-e:e-o,initialLayout:r,panelConstraints:i,pivotIndices:l?[s-1,s]:[s,s+1],prevLayout:r,trigger:`imperative-api`})},s=e=>{if(e===a())return;let{defaultLayoutDeferred:t,derivedPanelConstraints:r,group:i,groupSize:s,layout:c,separatorToPanels:l}=n(),u=U({layout:o({nextSize:e,panels:i.panels,prevLayout:c,derivedPanelConstraints:r}),panelConstraints:r});H(c,u)||L(i,{defaultLayoutDeferred:t,derivedPanelConstraints:r,groupSize:s,layout:u,separatorToPanels:l})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),o=a();e&&o!==t&&(n.expandToSize=o,s(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:o}=i(),c=a();if(e&&c===t){let e=o.expandToSize??n;e===0&&(e=1),s(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&R(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=M({group:t});s(j(A({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function Ie(e){e.defaultPrevented||Ne(e,I()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=Fe({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function W(e){let t=I();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function Le({groupId:e}){let t=()=>{let t=I();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=U({layout:e,panelConstraints:r});return n?o:(H(o,c)||L(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function G(e,t){let n=W(e),r=F(n.id,!0),i=n.separators.find(t=>t.element===e);N(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);N(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=Le({groupId:n.id}).getLayout(),c=U({layout:V({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});H(s,c)||L(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function Re(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=W(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&G(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&G(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&G(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&G(t,-5);break;case`End`:e.preventDefault(),G(t,100);break;case`Enter`:{e.preventDefault();let n=W(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=F(n.id,!0),o=n.separators.find(e=>e.element===t);N(o,`Matching separator not found`);let s=a.get(o);N(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(N(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];G(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=W(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);N(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),G(t,-100);break}}var K={cursorFlags:0,state:`inactive`},ze=new ge;function q(){return K}function Be(e){return ze.addListener(`change`,e)}function Ve(e){let t=K,n={...K};n.cursorFlags=e,K=n,ze.emit(`change`,{prev:t,next:n})}function J(e){let t=K;K=e,ze.emit(`change`,{prev:t,next:e})}function He(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=I(),n=Ne(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),J({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var Ue=e=>e,We=()=>{},Ge=1,Ke=2,qe=4,Je=8,Ye=3,Xe=12,Y;function Ze(){return Y===void 0&&(Y=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(Y=!0)),Y}function Qe({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&Ze()){let t=(e&Ge)!==0,n=(e&Ke)!==0,r=(e&qe)!==0,i=(e&Je)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return Ze()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var $e=new WeakMap;function et(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=$e.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=q();switch(r.state){case`active`:case`hover`:{let e=Qe({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}$e.set(e,{prevStyle:t,styleSheet:n})}function tt({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=V({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(H(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?Ge:Ke;break;case`vertical`:s|=d<0?qe:Je;break}}else L(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&Ye:c|=s&Ye,t.movementY===0?c|=o&Xe:c|=s&Xe,Ve(c),et(e)}function nt(e){let t=I(),n=q();switch(n.state){case`active`:tt({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function rt(e){if(e.defaultPrevented)return;let t=q(),n=I();switch(t.state){case`active`:if(e.buttons===0){J({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=F(e.group.id,!0);L(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}tt({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=Ne(e,n);r.length===0?t.state!==`inactive`&&J({cursorFlags:0,state:`inactive`}):J({cursorFlags:0,hitRegions:r,state:`hover`}),et(e.currentTarget);break}}}function it(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(q().state){case`hover`:J({cursorFlags:0,state:`inactive`})}}function at(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=q();switch(t.state){case`active`:J({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(et(e.currentTarget),t.hitRegions.forEach(e=>{let t=F(e.group.id,!0);L(e.group,t)}),e.preventDefault())}}function ot(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=j(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=j((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function st(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=M({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:j(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function ct(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function lt({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=j(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=j((r[e]??0)/a*l);else{let e=j(l/c.length);for(let t of c)u[t]=e}return u}function ut(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var X=new Map;function dt(e){let t=!0;N(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=M({group:e});if(t===0)return;let n=F(e.id);if(!n)return;let r=oe(e),i=n.defaultLayoutDeferred?ot(r):n.layout,a=U({layout:lt({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&H(n.layout,a)&&ct(n.derivedPanelConstraints,r)&&n.groupSize===t)return;L(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else st(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{N(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=M({group:e}),s=oe(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(ut(e.panels,l)||(l=void 0));let u=U({layout:e.mutableState.layouts[c]??l??ot(s),panelConstraints:s}),d=e.element.ownerDocument;X.set(d,(X.get(d)??0)+1);let f=new Map;return he(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),L(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{N(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,Re)}),X.get(d)===1&&(d.addEventListener(`dblclick`,Ie,!0),d.addEventListener(`pointerdown`,He,!0),d.addEventListener(`pointerleave`,nt),d.addEventListener(`pointermove`,rt),d.addEventListener(`pointerout`,it),d.addEventListener(`pointerup`,at,!0)),function(){t=!1,X.set(d,Math.max(0,(X.get(d)??0)-1)),ve(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,Re)}),X.get(d)||(d.removeEventListener(`dblclick`,Ie,!0),d.removeEventListener(`pointerdown`,He,!0),d.removeEventListener(`pointerleave`,nt),d.removeEventListener(`pointermove`,rt),d.removeEventListener(`pointerout`,it),d.removeEventListener(`pointerup`,at,!0)),a.disconnect()}}function ft(){let[e,t]=(0,y.useState)({});return[e,(0,y.useCallback)(()=>t({}),[])]}function pt(e){let t=(0,y.useId)();return`${e??t}`}var Z=typeof window<`u`?y.useLayoutEffect:y.useEffect;function Q(e){let t=(0,y.useRef)(e);return Z(()=>{t.current=e},[e]),(0,y.useCallback)((...e)=>t.current?.(...e),[t])}function mt(...e){return Q(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function ht(e){let t=(0,y.useRef)({...e});return Z(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var gt=(0,y.createContext)(null);function _t(e,t){let n=(0,y.useRef)({getLayout:()=>({}),setLayout:Ue});(0,y.useImperativeHandle)(t,()=>n.current,[]),Z(()=>{Object.assign(n.current,Le({groupId:e}))})}function vt({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,y.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=Q(e=>{H(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=Q(e=>{H(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=pt(s),v=(0,y.useRef)(null),[b,x]=ft(),S=(0,y.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),C=mt(v,a);_t(_,o);let w=Q((e,t)=>{let r=q(),i=ye(e),a=F(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),T=ht({defaultLayout:n,disableCursor:r}),E=(0,y.useMemo)(()=>({get disableCursor(){return!!T.disableCursor},getPanelStyles:w,id:_,orientation:u,registerPanel:e=>{let t=S.current;return t.panels=se(u,[...t.panels,e]),x(),()=>{t.panels=t.panels.filter(t=>t!==e),x()}},registerSeparator:e=>{let t=S.current;return t.separators=se(u,[...t.separators,e]),x(),()=>{t.separators=t.separators.filter(t=>t!==e),x()}},updatePanelProps:(e,{disabled:t})=>{let n=S.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=ye(_),i=F(_);r&&i&&L(r,{...i,derivedPanelConstraints:oe(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=S.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[w,_,x,u,T]),D=(0,y.useRef)(null);return Z(()=>{let e=v.current;if(e===null)return;let t=S.current,n;if(T.defaultLayout!==void 0&&Object.keys(T.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=T.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!T.disableCursor,expandedPanelSizes:S.current.lastExpandedPanelSizes,layouts:S.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};D.current=r;let a=dt(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=F(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=be(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=R(t.collapsedSize,i[t.panelId]),a=R(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=q().state!==`active`;h(i),o&&g(i)});return()=>{D.current=null,a(),l()}},[i,_,g,h,u,b,T]),(0,y.useEffect)(()=>{let e=D.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,k.jsx)(gt.Provider,{value:E,children:(0,k.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:C,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}vt.displayName=`Group`;function $(){let e=(0,y.useContext)(gt);return N(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function yt(e,t){let{id:n}=$(),r=(0,y.useRef)({collapse:We,expand:We,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:We});(0,y.useImperativeHandle)(t,()=>r.current,[]),Z(()=>{Object.assign(r.current,Fe({groupId:n,panelId:e}))})}function bt({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=pt(c),_=ht({disabled:a}),v=(0,y.useRef)(null),b=mt(v,o),{getPanelStyles:x,id:S,orientation:C,registerPanel:w,updatePanelProps:T}=$(),E=d!==null,D=Q((e,t,n)=>{d?.(e,c,n)});Z(()=>{let e=v.current;if(e!==null)return w({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:E?D:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,E,g,h,l,u,D,w,_]),(0,y.useEffect)(()=>{T(g,{disabled:a})},[a,g,T]),yt(g,f);let ee=()=>{let e=x(S,g);if(e)return JSON.stringify(e)},O=(0,y.useSyncExternalStore)(e=>be(S,e),ee,ee),te;return te=O?JSON.parse(O):i===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:i},(0,k.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:b,style:{...xt,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...te},children:(0,k.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:C===`horizontal`?`pan-y`:`pan-x`},children:e})})}bt.displayName=`Panel`;var xt={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function St({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=U({layout:V({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=U({layout:V({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function Ct({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=pt(a),l=ht({disabled:n,disableDoubleClick:r}),[u,d]=(0,y.useState)({}),[f,p]=(0,y.useState)(`inactive`),[m,h]=(0,y.useState)(!1),g=(0,y.useRef)(null),_=mt(g,i),{disableCursor:v,id:b,orientation:x,registerSeparator:S,updateSeparatorProps:C}=$(),w=x===`horizontal`?`vertical`:`horizontal`;Z(()=>{let e=g.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=S(t),r=Be(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=be(b,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(St({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[b,c,S,l]),(0,y.useEffect)(()=>{C(c,{disabled:n,disableDoubleClick:r})},[n,r,c,C]);let T;n&&!v&&(T=`not-allowed`);let E;if(n)E=`disabled`;else switch(f){case`active`:E=`active`;break;default:E=m?`focus`:f}return(0,k.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":w,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":E,"data-testid":c,id:c,onBlur:()=>h(!1),onFocus:()=>h(!0),ref:_,role:`separator`,style:{flexBasis:`auto`,cursor:T,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}Ct.displayName=`Separator`;function wt(e){let t=(0,O.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`flex h-full w-full aria-[orientation=vertical]:flex-col`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,k.jsx)(vt,{"data-slot":`resizable-panel-group`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Tt(e){let t=(0,O.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,k.jsx)(bt,{"data-slot":`resizable-panel`,...n}),t[2]=n,t[3]=r),r}function Et(e){let t=(0,O.c)(12),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({withHandle:a,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let o;t[4]===n?o=t[5]:(o=i(`bg-border ring-offset-background focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),t[4]=n,t[5]=o);let s;t[6]===a?s=t[7]:(s=a&&(0,k.jsx)(`div`,{className:`bg-border z-10 flex h-6 w-1 shrink-0 rounded-none`}),t[6]=a,t[7]=s);let c;return t[8]!==r||t[9]!==o||t[10]!==s?(c=(0,k.jsx)(Ct,{"data-slot":`resizable-handle`,className:o,...r,children:s}),t[8]=r,t[9]=o,t[10]=s,t[11]=c):c=t[11],c}export{f as _,D as a,w as c,m as d,g as f,p as g,u as h,E as i,C as l,_ as m,Tt as n,ee as o,h as p,wt as r,T as s,Et as t,v as u,d as v,l as y};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,r as n,t as r}from"./compiler-runtime-CLAvuQ-D.js";import{$t as i,A as a,As as o,Bt as s,Dc as c,Eo as l,Fr as u,Gr as d,Hr as f,Ht as p,I as m,Ja as h,L as g,Lr as _,M as v,N as y,No as b,Ns as x,O as S,Oo as C,R as w,Rr as T,Rs as ee,Ua as te,Ur as ne,Us as re,Ut as E,Va as D,Vr as ie,Ws as ae,Ya as O,a as k,cr as oe,do as A,gs as se,j,jo as ce,k as M,ko as le,oo as N,po as ue,r as de,to as fe,uo as pe,vn as me,xs as he,zr as ge,zt as _e}from"./fallbacks-D1MIlTO6.js";import{r as ve,t as ye}from"./route-D3fj0Kxy.js";import{C as be,S as xe,a as Se,c as P,f as Ce,i as we,l as Te,n as Ee,o as De,r as Oe,s as ke,t as Ae,u as je}from"./dialog-D3SsOi-l.js";import{n as F}from"./sonner-vAlNGB2c.js";import{n as Me,r as Ne,t as Pe}from"./resizable-BWgF68j6.js";import{B as Fe,C as Ie,M as Le,N as Re,P as ze,T as Be,f as Ve,g as He,h as Ue,i as We,j as Ge,k as I,m as L,p as Ke,s as qe,w as Je,z as Ye}from"./state-DipxiPcD.js";function Xe(e){let t=c({warn:e?.router===void 0}),n=e?.router||t;return ae(n.stores.__store,re(e,n))}var Ze=x(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Qe=x(`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`}]]),$e=x(`calendar-days`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),et=x(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),tt=x(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),nt=x(`git-branch-plus`,[[`path`,{d:`M6 3v12`,key:`qpgusn`}],[`path`,{d:`M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`,key:`1d02ji`}],[`path`,{d:`M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z`,key:`chk6ph`}],[`path`,{d:`M15 6a9 9 0 0 0-9 9`,key:`or332x`}],[`path`,{d:`M18 15v6`,key:`9wciyi`}],[`path`,{d:`M21 18h-6`,key:`139f0c`}]]),rt=x(`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`}]]),it=x(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),at=x(`memory-stick`,[[`path`,{d:`M12 12v-2`,key:`fwoke6`}],[`path`,{d:`M12 18v-2`,key:`qj6yno`}],[`path`,{d:`M16 12v-2`,key:`heuere`}],[`path`,{d:`M16 18v-2`,key:`s1ct0w`}],[`path`,{d:`M2 11h1.5`,key:`15p63e`}],[`path`,{d:`M20 18v-2`,key:`12ehxp`}],[`path`,{d:`M20.5 11H22`,key:`khsy7a`}],[`path`,{d:`M4 18v-2`,key:`1c3oqr`}],[`path`,{d:`M8 12v-2`,key:`1mwtfd`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`rect`,{x:`2`,y:`6`,width:`20`,height:`10`,rx:`2`,key:`1qcswk`}]]),ot=x(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),st=x(`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`}]]),ct=x(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),lt=x(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ut=x(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),dt=x(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ft=x(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),R=e(n(),1),z=r(),B=t(),pt=[`claude`,`codex`];function mt(e){return e>=90?`text-destructive`:e>=75?`text-amber-500`:`text-foreground`}function ht(e){let t=(0,z.c)(16),n;if(t[0]!==e.icon||t[1]!==e.window.resetsAt||t[2]!==e.window.utilization){let r=o(C(e.window.resetsAt),l(i)),a;t[4]===e.icon?a=t[5]:(a=(0,B.jsx)(`span`,{className:`text-muted-foreground flex shrink-0 items-center [&_svg]:size-2.5`,children:e.icon}),t[4]=e.icon,t[5]=a);let s;t[6]===e.window.utilization?s=t[7]:(s=mt(e.window.utilization),t[6]=e.window.utilization,t[7]=s);let c;t[8]===e.window.utilization?c=t[9]:(c=Math.round(e.window.utilization),t[8]=e.window.utilization,t[9]=c);let u;t[10]!==s||t[11]!==c?(u=(0,B.jsxs)(`span`,{className:s,children:[c,`%`]}),t[10]=s,t[11]=c,t[12]=u):u=t[12];let d;t[13]!==a||t[14]!==u?(d=(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[a,u]}),t[13]=a,t[14]=u,t[15]=d):d=t[15],n=(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center justify-between gap-1.5 px-2.5`,children:[d,b(r)&&(0,B.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate`,title:`resets ${y(r.value)}`,children:v(r.value)})]}),t[0]=e.icon,t[1]=e.window.resetsAt,t[2]=e.window.utilization,t[3]=n}else n=t[3];return n}function gt(e){let t=(0,z.c)(12),n;t[0]===e.icon?n=t[1]:(n=(0,B.jsx)(`span`,{className:`text-muted-foreground flex shrink-0 items-center [&_svg]:size-2.5`,children:e.icon}),t[0]=e.icon,t[1]=n);let r;t[2]===e.utilization?r=t[3]:(r=mt(e.utilization),t[2]=e.utilization,t[3]=r);let i;t[4]===e.utilization?i=t[5]:(i=Math.round(e.utilization),t[4]=e.utilization,t[5]=i);let a;t[6]!==r||t[7]!==i?(a=(0,B.jsxs)(`span`,{className:r,children:[i,`%`]}),t[6]=r,t[7]=i,t[8]=a):a=t[8];let o;return t[9]!==n||t[10]!==a?(o=(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 px-2.5`,children:[n,a]}),t[9]=n,t[10]=a,t[11]=o):o=t[11],o}function _t(){let e=(0,z.c)(17),t=Le(qe);if(Ye(t)){let n;e[0]===t.cause?n=e[1]:(n=j(t.cause),e[0]=t.cause,e[1]=n);let r;e[2]===t.cause?r=e[3]:(r=j(t.cause),e[2]=t.cause,e[3]=r);let i;return e[4]!==n||e[5]!==r?(i=(0,B.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center truncate px-2.5`,title:n,children:r}),e[4]=n,e[5]=r,e[6]=i):i=e[6],i}if(!Fe(t)){let t;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsx)(`span`,{className:`text-muted-foreground flex flex-1 items-center px-2.5`,children:`…`}),e[7]=t):t=e[7],t}let n;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,B.jsx)(tt,{}),e[8]=n):n=e[8];let r;e[9]===t.value.cpuUtilization?r=e[10]:(r=(0,B.jsx)(gt,{icon:n,utilization:t.value.cpuUtilization}),e[9]=t.value.cpuUtilization,e[10]=r);let i;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,B.jsx)(at,{}),e[11]=i):i=e[11];let a;e[12]===t.value.memoryUtilization?a=e[13]:(a=(0,B.jsx)(gt,{icon:i,utilization:t.value.memoryUtilization}),e[12]=t.value.memoryUtilization,e[13]=a);let o;return e[14]!==r||e[15]!==a?(o=(0,B.jsxs)(B.Fragment,{children:[r,a]}),e[14]=r,e[15]=a,e[16]=o):o=e[16],o}function vt(e){let t=(0,z.c)(19),n;t[0]===e.layer?n=t[1]:(n=Ve(e.layer),t[0]=e.layer,t[1]=n);let r=Le(n);if(Ye(r)){let e;t[2]===r.cause?e=t[3]:(e=j(r.cause),t[2]=r.cause,t[3]=e);let n;t[4]===r.cause?n=t[5]:(n=j(r.cause),t[4]=r.cause,t[5]=n);let i;return t[6]!==e||t[7]!==n?(i=(0,B.jsx)(`span`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center truncate px-2.5`,title:e,children:n}),t[6]=e,t[7]=n,t[8]=i):i=t[8],i}if(!Fe(r)){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,B.jsx)(`span`,{className:`text-muted-foreground flex flex-1 items-center px-2.5`,children:`…`}),t[9]=e):e=t[9],e}let i;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,B.jsx)(et,{}),t[10]=i):i=t[10];let a;t[11]===r.value.fiveHour?a=t[12]:(a=(0,B.jsx)(ht,{icon:i,window:r.value.fiveHour}),t[11]=r.value.fiveHour,t[12]=a);let o;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,B.jsx)($e,{}),t[13]=o):o=t[13];let s;t[14]===r.value.weekly?s=t[15]:(s=(0,B.jsx)(ht,{icon:o,window:r.value.weekly}),t[14]=r.value.weekly,t[15]=s);let c;return t[16]!==a||t[17]!==s?(c=(0,B.jsxs)(B.Fragment,{children:[a,s]}),t[16]=a,t[17]=s,t[18]=c):c=t[18],c}function yt(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-col divide-y border-t font-mono text-[11px]`,children:[(0,B.jsxs)(`div`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:[(0,B.jsx)(`span`,{className:`flex w-8 shrink-0 items-center justify-center`,children:(0,B.jsx)(tt,{className:`text-muted-foreground size-3`})}),(0,B.jsx)(_t,{})]}),pt.map(bt)]}),e[0]=t):t=e[0],t}function bt(e){return(0,B.jsxs)(`div`,{className:`flex h-7 min-w-0 items-stretch divide-x`,children:[(0,B.jsx)(`span`,{className:`flex w-8 shrink-0 items-center justify-center`,children:(0,B.jsx)(je,{layer:e})}),(0,B.jsx)(vt,{layer:e})]},e)}var xt=1,St=.9,Ct=.8,wt=.17,Tt=.1,Et=.999,Dt=.9999,Ot=.99,kt=/[\\\/_+.#"@\[\(\{&]/,At=/[\\\/_+.#"@\[\(\{&]/g,jt=/[\s-]/,Mt=/[\s-]/g;function Nt(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?xt:Ot;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=Nt(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=xt:kt.test(e.charAt(l-1))?(d*=Ct,p=e.slice(i,l-1).match(At),p&&i>0&&(d*=Et**+p.length)):jt.test(e.charAt(l-1))?(d*=St,m=e.slice(i,l-1).match(Mt),m&&i>0&&(d*=Et**+m.length)):(d*=wt,i>0&&(d*=Et**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Dt)),(d<Tt&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Nt(e,t,n,r,l+1,a+2,o),f*Tt>d&&(d=f*Tt)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Pt(e){return e.toLowerCase().replace(Mt,` `)}function Ft(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Nt(e,t,Pt(e),Pt(t),0,0,{})}typeof window<`u`&&window.document&&window.document.createElement;function V(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function It(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function H(...e){return t=>{let n=!1,r=e.map(e=>{let r=It(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():It(e[t],null)}}}}function U(...e){return R.useCallback(H(...e),e)}function Lt(e,t){let n=R.createContext(t),r=e=>{let{children:t,...r}=e,i=R.useMemo(()=>r,Object.values(r));return(0,B.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=R.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Rt(e,t=[]){let n=[];function r(t,r){let i=R.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=R.useMemo(()=>o,Object.values(o));return(0,B.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=R.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>R.createContext(e));return function(n){let r=n?.[e]||t;return R.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,zt(i,...t)]}function zt(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return R.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Bt=globalThis?.document?R.useLayoutEffect:()=>{},Vt=R.useId||(()=>void 0),Ht=0;function W(e){let[t,n]=R.useState(Vt());return Bt(()=>{e||n(e=>e??String(Ht++))},[e]),e||(t?`radix-${t}`:``)}var Ut=R.useInsertionEffect||Bt;function Wt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Gt({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=R.useRef(e!==void 0);R.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,R.useCallback(t=>{if(s){let n=Kt(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Gt({defaultProp:e,onChange:t}){let[n,r]=R.useState(e),i=R.useRef(n),a=R.useRef(t);return Ut(()=>{a.current=t},[t]),R.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Kt(e){return typeof e==`function`}var qt=e(ee(),1);function Jt(e){let t=Yt(e),n=R.forwardRef((e,n)=>{let{children:r,...i}=e,a=R.Children.toArray(r),o=a.find(Zt);if(o){let e=o.props.children,r=a.map(t=>t===o?R.Children.count(e)>1?R.Children.only(null):R.isValidElement(e)?e.props.children:null:t);return(0,B.jsx)(t,{...i,ref:n,children:R.isValidElement(e)?R.cloneElement(e,void 0,r):null})}return(0,B.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Yt(e){let t=R.forwardRef((e,t)=>{let{children:n,...r}=e;if(R.isValidElement(n)){let e=$t(n),i=Qt(r,n.props);return n.type!==R.Fragment&&(i.ref=t?H(t,e):e),R.cloneElement(n,i)}return R.Children.count(n)>1?R.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xt=Symbol(`radix.slottable`);function Zt(e){return R.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Xt}function Qt(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function $t(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var G=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Jt(`Primitive.${t}`),r=R.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function en(e,t){e&&qt.flushSync(()=>e.dispatchEvent(t))}function tn(e){let t=R.useRef(e);return R.useEffect(()=>{t.current=e}),R.useMemo(()=>(...e)=>t.current?.(...e),[])}function nn(e,t=globalThis?.document){let n=tn(e);R.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var rn=`DismissableLayer`,an=`dismissableLayer.update`,on=`dismissableLayer.pointerDownOutside`,sn=`dismissableLayer.focusOutside`,cn,ln=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),un=R.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=R.useContext(ln),[u,d]=R.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=R.useState({}),m=U(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=pn(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=mn(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return nn(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),R.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(cn=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),hn(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=cn)}},[u,f,n,l]),R.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),hn())},[u,l]),R.useEffect(()=>{let e=()=>p({});return document.addEventListener(an,e),()=>document.removeEventListener(an,e)},[]),(0,B.jsx)(G.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:V(e.onFocusCapture,S.onFocusCapture),onBlurCapture:V(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,x.onPointerDownCapture)})});un.displayName=rn;var dn=`DismissableLayerBranch`,fn=R.forwardRef((e,t)=>{let n=R.useContext(ln),r=R.useRef(null),i=U(t,r);return R.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,B.jsx)(G.div,{...e,ref:i})});fn.displayName=dn;function pn(e,t=globalThis?.document){let n=tn(e),r=R.useRef(!1),i=R.useRef(()=>{});return R.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){gn(on,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function mn(e,t=globalThis?.document){let n=tn(e),r=R.useRef(!1);return R.useEffect(()=>{let e=e=>{e.target&&!r.current&&gn(sn,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hn(){let e=new CustomEvent(an);document.dispatchEvent(e)}function gn(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?en(i,a):i.dispatchEvent(a)}var _n=`focusScope.autoFocusOnMount`,vn=`focusScope.autoFocusOnUnmount`,yn={bubbles:!1,cancelable:!0},bn=`FocusScope`,xn=R.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=R.useState(null),l=tn(i),u=tn(a),d=R.useRef(null),f=U(t,e=>c(e)),p=R.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:K(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||K(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&K(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),R.useEffect(()=>{if(s){On.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(_n,yn);s.addEventListener(_n,l),s.dispatchEvent(t),t.defaultPrevented||(Sn(jn(wn(s)),{select:!0}),document.activeElement===e&&K(s))}return()=>{s.removeEventListener(_n,l),setTimeout(()=>{let t=new CustomEvent(vn,yn);s.addEventListener(vn,u),s.dispatchEvent(t),t.defaultPrevented||K(e??document.body,{select:!0}),s.removeEventListener(vn,u),On.remove(p)},0)}}},[s,l,u,p]);let m=R.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Cn(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&K(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&K(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,B.jsx)(G.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});xn.displayName=bn;function Sn(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(K(r,{select:t}),document.activeElement!==n)return}function Cn(e){let t=wn(e);return[Tn(t,e),Tn(t.reverse(),e)]}function wn(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Tn(e,t){for(let n of e)if(!En(n,{upTo:t}))return n}function En(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Dn(e){return e instanceof HTMLInputElement&&`select`in e}function K(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Dn(e)&&t&&e.select()}}var On=kn();function kn(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=An(e,t),e.unshift(t)},remove(t){e=An(e,t),e[0]?.resume()}}}function An(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jn(e){return e.filter(e=>e.tagName!==`A`)}var Mn=`Portal`,Nn=R.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=R.useState(!1);Bt(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?qt.createPortal((0,B.jsx)(G.div,{...r,ref:t}),o):null});Nn.displayName=Mn;function Pn(e,t){return R.useReducer((e,n)=>t[e][n]??e,e)}var Fn=e=>{let{present:t,children:n}=e,r=In(t),i=typeof n==`function`?n({present:r.isPresent}):R.Children.only(n),a=U(r.ref,Rn(i));return typeof n==`function`||r.isPresent?R.cloneElement(i,{ref:a}):null};Fn.displayName=`Presence`;function In(e){let[t,n]=R.useState(),r=R.useRef(null),i=R.useRef(e),a=R.useRef(`none`),[o,s]=Pn(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return R.useEffect(()=>{let e=Ln(r.current);a.current=o===`mounted`?e:`none`},[o]),Bt(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Ln(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Bt(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Ln(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Ln(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:R.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Ln(e){return e?.animationName||`none`}function Rn(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zn=0;function Bn(){R.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Vn()),document.body.insertAdjacentElement(`beforeend`,e[1]??Vn()),zn++,()=>{zn===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),zn--}},[])}function Vn(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var q=function(){return q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},q.apply(this,arguments)};function Hn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Un(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Wn=`right-scroll-bar-position`,Gn=`width-before-scroll-bar`,Kn=`with-scroll-bars-hidden`,qn=`--removed-body-scroll-bar-size`;function Jn(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Yn(e,t){var n=(0,R.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Xn=typeof window<`u`?R.useLayoutEffect:R.useEffect,Zn=new WeakMap;function Qn(e,t){var n=Yn(t||null,function(t){return e.forEach(function(e){return Jn(e,t)})});return Xn(function(){var t=Zn.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Jn(e,null)}),i.forEach(function(e){r.has(e)||Jn(e,a)})}Zn.set(n,e)},[e]),n}function $n(e){return e}function er(e,t){t===void 0&&(t=$n);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function tr(e){e===void 0&&(e={});var t=er(null);return t.options=q({async:!0,ssr:!1},e),t}var nr=function(e){var t=e.sideCar,n=Hn(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return R.createElement(r,q({},n))};nr.isSideCarExport=!0;function rr(e,t){return e.useMedium(t),nr}var ir=tr(),ar=function(){},or=R.forwardRef(function(e,t){var n=R.useRef(null),r=R.useState({onScrollCapture:ar,onWheelCapture:ar,onTouchMoveCapture:ar}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Hn(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Qn([n,t]),C=q(q({},b),i);return R.createElement(R.Fragment,null,u&&R.createElement(x,{sideCar:ir,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?R.cloneElement(R.Children.only(s),q(q({},C),{ref:S})):R.createElement(v,q({},C,{className:c,ref:S}),s))});or.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},or.classNames={fullWidth:Gn,zeroRight:Wn};var sr,cr=function(){if(sr)return sr;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function lr(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=cr();return t&&e.setAttribute(`nonce`,t),e}function ur(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dr(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var fr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=lr())&&(ur(t,n),dr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pr=function(){var e=fr();return function(t,n){R.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},mr=function(){var e=pr();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},hr={left:0,top:0,right:0,gap:0},gr=function(e){return parseInt(e||``,10)||0},_r=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[gr(n),gr(r),gr(i)]},vr=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return hr;var t=_r(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},yr=mr(),br=`data-scroll-locked`,xr=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
+
.${Kn} {
|
|
3
|
+
overflow: hidden ${r};
|
|
4
|
+
padding-right: ${s}px ${r};
|
|
5
|
+
}
|
|
6
|
+
body[${br}] {
|
|
7
|
+
overflow: hidden ${r};
|
|
8
|
+
overscroll-behavior: contain;
|
|
9
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
+
padding-left: ${i}px;
|
|
11
|
+
padding-top: ${a}px;
|
|
12
|
+
padding-right: ${o}px;
|
|
13
|
+
margin-left:0;
|
|
14
|
+
margin-top:0;
|
|
15
|
+
margin-right: ${s}px ${r};
|
|
16
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.${Wn} {
|
|
20
|
+
right: ${s}px ${r};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.${Gn} {
|
|
24
|
+
margin-right: ${s}px ${r};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.${Wn} .${Wn} {
|
|
28
|
+
right: 0 ${r};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.${Gn} .${Gn} {
|
|
32
|
+
margin-right: 0 ${r};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[${br}] {
|
|
36
|
+
${qn}: ${s}px;
|
|
37
|
+
}
|
|
38
|
+
`},Sr=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Cr=function(){R.useEffect(function(){return document.body.setAttribute(br,(Sr()+1).toString()),function(){var e=Sr()-1;e<=0?document.body.removeAttribute(br):document.body.setAttribute(br,e.toString())}},[])},wr=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Cr();var a=R.useMemo(function(){return vr(i)},[i]);return R.createElement(yr,{styles:xr(a,!t,i,n?``:`!important`)})},Tr=!1;if(typeof window<`u`)try{var Er=Object.defineProperty({},"passive",{get:function(){return Tr=!0,!0}});window.addEventListener(`test`,Er,Er),window.removeEventListener(`test`,Er,Er)}catch{Tr=!1}var J=Tr?{passive:!1}:!1,Dr=function(e){return e.tagName===`TEXTAREA`},Or=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Dr(e)&&n[t]===`visible`)},kr=function(e){return Or(e,`overflowY`)},Ar=function(e){return Or(e,`overflowX`)},jr=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Pr(e,r)){var i=Fr(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Mr=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Nr=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Pr=function(e,t){return e===`v`?kr(t):Ar(t)},Fr=function(e,t){return e===`v`?Mr(t):Nr(t)},Ir=function(e,t){return e===`h`&&t===`rtl`?-1:1},Lr=function(e,t,n,r,i){var a=Ir(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Fr(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Pr(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Rr=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zr=function(e){return[e.deltaX,e.deltaY]},Br=function(e){return e&&`current`in e?e.current:e},Vr=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Hr=function(e){return`
|
|
39
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
+
`},Ur=0,Wr=[];function Gr(e){var t=R.useRef([]),n=R.useRef([0,0]),r=R.useRef(),i=R.useState(Ur++)[0],a=R.useState(mr)[0],o=R.useRef(e);R.useEffect(function(){o.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Un([e.lockRef.current],(e.shards||[]).map(Br),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=R.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Rr(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=jr(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=jr(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Lr(h,t,e,h===`h`?s:c,!0)},[]),c=R.useCallback(function(e){var n=e;if(!(!Wr.length||Wr[Wr.length-1]!==a)){var r=`deltaY`in n?zr(n):Rr(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Vr(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Br).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=R.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Kr(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=R.useCallback(function(e){n.current=Rr(e),r.current=void 0},[]),d=R.useCallback(function(t){l(t.type,zr(t),t.target,s(t,e.lockRef.current))},[]),f=R.useCallback(function(t){l(t.type,Rr(t),t.target,s(t,e.lockRef.current))},[]);R.useEffect(function(){return Wr.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,J),document.addEventListener(`touchmove`,c,J),document.addEventListener(`touchstart`,u,J),function(){Wr=Wr.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,J),document.removeEventListener(`touchmove`,c,J),document.removeEventListener(`touchstart`,u,J)}},[]);var p=e.removeScrollBar,m=e.inert;return R.createElement(R.Fragment,null,m?R.createElement(a,{styles:Hr(i)}):null,p?R.createElement(wr,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Kr(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var qr=rr(ir,Gr),Jr=R.forwardRef(function(e,t){return R.createElement(or,q({},e,{ref:t,sideCar:qr}))});Jr.classNames=or.classNames;var Yr=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Xr=new WeakMap,Zr=new WeakMap,Qr={},$r=0,ei=function(e){return e&&(e.host||ei(e.parentNode))},ti=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ei(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},ni=function(e,t,n,r){var i=ti(t,Array.isArray(e)?e:[e]);Qr[n]||(Qr[n]=new WeakMap);var a=Qr[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Xr.get(e)||0)+1,l=(a.get(e)||0)+1;Xr.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Zr.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),$r++,function(){o.forEach(function(e){var t=Xr.get(e)-1,i=a.get(e)-1;Xr.set(e,t),a.set(e,i),t||(Zr.has(e)||e.removeAttribute(r),Zr.delete(e)),i||e.removeAttribute(n)}),$r--,$r||(Xr=new WeakMap,Xr=new WeakMap,Zr=new WeakMap,Qr={})}},ri=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Yr(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ni(r,i,n,`aria-hidden`)):function(){return null}},ii=`Dialog`,[ai,oi]=Rt(ii),[si,Y]=ai(ii),ci=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=R.useRef(null),c=R.useRef(null),[l,u]=Wt({prop:r,defaultProp:i??!1,onChange:a,caller:ii});return(0,B.jsx)(si,{scope:t,triggerRef:s,contentRef:c,contentId:W(),titleId:W(),descriptionId:W(),open:l,onOpenChange:u,onOpenToggle:R.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};ci.displayName=ii;var li=`DialogTrigger`,ui=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(li,n),a=U(t,i.triggerRef);return(0,B.jsx)(G.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ki(i.open),...r,ref:a,onClick:V(e.onClick,i.onOpenToggle)})});ui.displayName=li;var di=`DialogPortal`,[fi,pi]=ai(di,{forceMount:void 0}),mi=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Y(di,t);return(0,B.jsx)(fi,{scope:t,forceMount:n,children:R.Children.map(r,e=>(0,B.jsx)(Fn,{present:n||a.open,children:(0,B.jsx)(Nn,{asChild:!0,container:i,children:e})}))})};mi.displayName=di;var hi=`DialogOverlay`,gi=R.forwardRef((e,t)=>{let n=pi(hi,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Y(hi,e.__scopeDialog);return a.modal?(0,B.jsx)(Fn,{present:r||a.open,children:(0,B.jsx)(vi,{...i,ref:t})}):null});gi.displayName=hi;var _i=Jt(`DialogOverlay.RemoveScroll`),vi=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(hi,n);return(0,B.jsx)(Jr,{as:_i,allowPinchZoom:!0,shards:[i.contentRef],children:(0,B.jsx)(G.div,{"data-state":ki(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),X=`DialogContent`,yi=R.forwardRef((e,t)=>{let n=pi(X,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Y(X,e.__scopeDialog);return(0,B.jsx)(Fn,{present:r||a.open,children:a.modal?(0,B.jsx)(bi,{...i,ref:t}):(0,B.jsx)(xi,{...i,ref:t})})});yi.displayName=X;var bi=R.forwardRef((e,t)=>{let n=Y(X,e.__scopeDialog),r=R.useRef(null),i=U(t,n.contentRef,r);return R.useEffect(()=>{let e=r.current;if(e)return ri(e)},[]),(0,B.jsx)(Si,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:V(e.onFocusOutside,e=>e.preventDefault())})}),xi=R.forwardRef((e,t)=>{let n=Y(X,e.__scopeDialog),r=R.useRef(!1),i=R.useRef(!1);return(0,B.jsx)(Si,{...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()}})}),Si=R.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Y(X,n),c=R.useRef(null),l=U(t,c);return Bn(),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(xn,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,B.jsx)(un,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":ki(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ni,{titleId:s.titleId}),(0,B.jsx)(Fi,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Ci=`DialogTitle`,wi=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(Ci,n);return(0,B.jsx)(G.h2,{id:i.titleId,...r,ref:t})});wi.displayName=Ci;var Ti=`DialogDescription`,Ei=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(Ti,n);return(0,B.jsx)(G.p,{id:i.descriptionId,...r,ref:t})});Ei.displayName=Ti;var Di=`DialogClose`,Oi=R.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Y(Di,n);return(0,B.jsx)(G.button,{type:`button`,...r,ref:t,onClick:V(e.onClick,()=>i.onOpenChange(!1))})});Oi.displayName=Di;function ki(e){return e?`open`:`closed`}var Ai=`DialogTitleWarning`,[ji,Mi]=Lt(Ai,{contentName:X,titleName:Ci,docsSlug:`dialog`}),Ni=({titleId:e})=>{let t=Mi(Ai),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
42
|
+
|
|
43
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
|
+
|
|
45
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return R.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Pi=`DialogDescriptionWarning`,Fi=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Mi(Pi).contentName}}.`;return R.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Ii=ci,Li=mi,Ri=gi,zi=yi,Bi=Symbol.for(`react.lazy`),Vi=R.use;function Hi(e){return typeof e==`object`&&!!e&&`then`in e}function Ui(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Bi&&`_payload`in e&&Hi(e._payload)}function Wi(e){let t=Gi(e),n=R.forwardRef((e,n)=>{let{children:r,...i}=e;Ui(r)&&typeof Vi==`function`&&(r=Vi(r._payload));let a=R.Children.toArray(r),o=a.find(qi);if(o){let e=o.props.children,r=a.map(t=>t===o?R.Children.count(e)>1?R.Children.only(null):R.isValidElement(e)?e.props.children:null:t);return(0,B.jsx)(t,{...i,ref:n,children:R.isValidElement(e)?R.cloneElement(e,void 0,r):null})}return(0,B.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Gi(e){let t=R.forwardRef((e,t)=>{let{children:n,...r}=e;if(Ui(n)&&typeof Vi==`function`&&(n=Vi(n._payload)),R.isValidElement(n)){let e=Yi(n),i=Ji(r,n.props);return n.type!==R.Fragment&&(i.ref=t?H(t,e):e),R.cloneElement(n,i)}return R.Children.count(n)>1?R.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ki=Symbol(`radix.slottable`);function qi(e){return R.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ki}function Ji(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Yi(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Z=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Wi(`Primitive.${t}`),r=R.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Xi=`[cmdk-group=""]`,Zi=`[cmdk-group-items=""]`,Qi=`[cmdk-group-heading=""]`,$i=`[cmdk-item=""]`,ea=`${$i}:not([aria-disabled="true"])`,ta=`cmdk-item-select`,na=`data-value`,ra=(e,t,n)=>Ft(e,t,n),ia=R.createContext(void 0),aa=()=>R.useContext(ia),oa=R.createContext(void 0),sa=()=>R.useContext(oa),ca=R.createContext(void 0),la=R.forwardRef((e,t)=>{let n=Sa(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Sa(()=>new Set),i=Sa(()=>new Map),a=Sa(()=>new Map),o=Sa(()=>new Set),s=xa(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=W(),y=W(),b=W(),x=R.useRef(null),S=wa();Q(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),Q(()=>{S(6,re)},[]);let C=R.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`)ne(),ee(),S(1,te);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=E()?.id,C.emit()}),r||S(5,re),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=R.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,T(t,r)),S(2,()=>{ee(),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,()=>{ne(),ee(),n.current.value||te(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=E();S(4,()=>{ne(),t?.getAttribute(`id`)===e&&te(),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 T(e,t){let r=s.current?.filter??ra;return e?r(e,n.current.search,t):0}function ee(){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;D().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(Zi);t?t.appendChild(e.parentElement===t?e:e.closest(`${Zi} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Zi} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${Xi}[${na}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function te(){let e=D().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(na);C.setState(`value`,e||void 0)}function ne(){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=T(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 re(){var e;let t=E();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Xi)?.querySelector(Qi))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function E(){return x.current?.querySelector(`${$i}[aria-selected="true"]`)}function D(){return Array.from(x.current?.querySelectorAll(ea)||[])}function ie(e){let t=D()[e];t&&C.setState(`value`,t.getAttribute(na))}function ae(e){var t;let n=E(),r=D(),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(na))}function O(e){let t=E()?.closest(Xi),n;for(;t&&!n;)t=e>0?ya(t,Xi):ba(t,Xi),n=t?.querySelector(ea);n?C.setState(`value`,n.getAttribute(na)):ae(e)}let k=()=>ie(D().length-1),oe=e=>{e.preventDefault(),e.metaKey?k():e.altKey?O(1):ae(1)},A=e=>{e.preventDefault(),e.metaKey?ie(0):e.altKey?O(-1):ae(-1)};return R.createElement(Z.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&&oe(e);break;case`ArrowDown`:oe(e);break;case`p`:case`k`:g&&e.ctrlKey&&A(e);break;case`ArrowUp`:A(e);break;case`Home`:e.preventDefault(),ie(0);break;case`End`:e.preventDefault(),k();break;case`Enter`:{e.preventDefault();let t=E();if(t){let e=new Event(ta);t.dispatchEvent(e)}}}}},R.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:Da},c),Ea(e,e=>R.createElement(oa.Provider,{value:C},R.createElement(ia.Provider,{value:w},e))))}),ua=R.forwardRef((e,t)=>{let n=W(),r=R.useRef(null),i=R.useContext(ca),a=aa(),o=xa(e),s=o.current?.forceMount??i?.forceMount;Q(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Ca(n,r,[e.value,e.children,r],e.keywords),l=sa(),u=$(e=>e.value&&e.value===c.current),d=$(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);R.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(ta,f),()=>t.removeEventListener(ta,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 R.createElement(Z.div,{ref:H(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)}),da=R.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=W(),s=R.useRef(null),c=R.useRef(null),l=W(),u=aa(),d=$(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Q(()=>u.group(o),[]),Ca(o,s,[e.value,e.heading,c]);let f=R.useMemo(()=>({id:o,forceMount:i}),[i]);return R.createElement(Z.div,{ref:H(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&R.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),Ea(e,e=>R.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},R.createElement(ca.Provider,{value:f},e))))}),fa=R.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=R.useRef(null),a=$(e=>!e.search);return!n&&!a?null:R.createElement(Z.div,{ref:H(i,t),...r,"cmdk-separator":``,role:`separator`})}),pa=R.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=sa(),o=$(e=>e.search),s=$(e=>e.selectedItemId),c=aa();return R.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),R.createElement(Z.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)}})}),ma=R.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=R.useRef(null),o=R.useRef(null),s=$(e=>e.selectedItemId),c=aa();return R.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)}}},[]),R.createElement(Z.div,{ref:H(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},Ea(e,e=>R.createElement(`div`,{ref:H(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),ha=R.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return R.createElement(Ii,{open:n,onOpenChange:r},R.createElement(Li,{container:o},R.createElement(Ri,{"cmdk-overlay":``,className:i}),R.createElement(zi,{"aria-label":e.label,"cmdk-dialog":``,className:a},R.createElement(la,{ref:t,...s}))))}),ga=R.forwardRef((e,t)=>$(e=>e.filtered.count===0)?R.createElement(Z.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),_a=R.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return R.createElement(Z.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Ea(e,e=>R.createElement(`div`,{"aria-hidden":!0},e)))}),va=Object.assign(la,{List:ma,Item:ua,Input:pa,Group:da,Separator:fa,Dialog:ha,Empty:ga,Loading:_a});function ya(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ba(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function xa(e){let t=R.useRef(e);return Q(()=>{t.current=e}),t}var Q=typeof window>`u`?R.useEffect:R.useLayoutEffect;function Sa(e){let t=R.useRef();return t.current===void 0&&(t.current=e()),t}function $(e){let t=sa(),n=()=>e(t.snapshot());return R.useSyncExternalStore(t.subscribe,n,n)}function Ca(e,t,n,r=[]){let i=R.useRef(),a=aa();return Q(()=>{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(na,s),i.current=s}),i}var wa=()=>{let[e,t]=R.useState(),n=Sa(()=>new Map);return Q(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Ta(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Ea({asChild:e,children:t},n){return e&&R.isValidElement(t)?R.cloneElement(Ta(t),{ref:t.ref},n(t.props.children)):n(t)}var Da={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Oa(e){let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`group/input-group border-input has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot][aria-invalid=true]]:border-destructive has-disabled:bg-input/50 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 relative flex h-8 w-full min-w-0 items-center rounded-none border transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-1 has-[[data-slot][aria-invalid=true]]:ring-1 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,B.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}var ka=S(`text-muted-foreground h-auto gap-2 py-1.5 font-normal group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-none [&>svg:not([class*='size-'])]:size-3 flex cursor-text items-center justify-center select-none`,{variants:{align:{"inline-start":`pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem] order-first`,"inline-end":`pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem] order-last`,"block-start":`px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start`,"block-end":`px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start`}},defaultVariants:{align:`inline-start`}});function Aa(e){let t=(0,z.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let o=i===void 0?`inline-start`:i,s;t[4]!==o||t[5]!==n?(s=a(ka({align:o}),n),t[4]=o,t[5]=n,t[6]=s):s=t[6];let c;return t[7]!==o||t[8]!==r||t[9]!==s?(c=(0,B.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":o,className:s,onClick:ja,...r}),t[7]=o,t[8]=r,t[9]=s,t[10]=c):c=t[10],c}function ja(e){e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()}S(`gap-2 font-normal shadow-none flex items-center`,{variants:{size:{xs:`h-6 gap-1 rounded-none px-1.5 [&>svg:not([class*='size-'])]:size-3`,sm:``,"icon-xs":`size-6 rounded-none p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function Ma(e){let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`bg-popover text-popover-foreground flex size-full flex-col overflow-hidden rounded-none`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,B.jsx)(va,{"data-slot":`command`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function Na(e){let t=(0,z.c)(24),n,r,i,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],c=t[6]):({title:o,description:s,children:n,className:r,showCloseButton:c,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=c);let l=o===void 0?`Command Palette`:o,u=s===void 0?`Search for a command to run...`:s,d=c===void 0?!1:c,f;t[7]===r?f=t[8]:(f=a(`top-1/3 translate-y-0 overflow-hidden rounded-none p-0`,r),t[7]=r,t[8]=f);let p;t[9]===l?p=t[10]:(p=(0,B.jsx)(De,{children:l}),t[9]=l,t[10]=p);let m;t[11]===u?m=t[12]:(m=(0,B.jsx)(Oe,{children:u}),t[11]=u,t[12]=m);let h;t[13]!==p||t[14]!==m?(h=(0,B.jsxs)(Se,{className:`sr-only`,children:[p,m]}),t[13]=p,t[14]=m,t[15]=h):h=t[15];let g;t[16]!==n||t[17]!==d||t[18]!==f||t[19]!==h?(g=(0,B.jsxs)(Ee,{className:f,showCloseButton:d,children:[h,n]}),t[16]=n,t[17]=d,t[18]=f,t[19]=h,t[20]=g):g=t[20];let _;return t[21]!==i||t[22]!==g?(_=(0,B.jsx)(Ae,{...i,children:g}),t[21]=i,t[22]=g,t[23]=_):_=t[23],_}function Pa(e){let t=(0,z.c)(11),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`w-full font-normal outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,n),t[3]=n,t[4]=i);let o;t[5]!==r||t[6]!==i?(o=(0,B.jsx)(va.Input,{"data-slot":`command-input`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7];let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,B.jsx)(Aa,{children:(0,B.jsx)(lt,{className:`size-3 shrink-0 opacity-50`})}),t[8]=s):s=t[8];let c;return t[9]===o?c=t[10]:(c=(0,B.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`border-b pb-0`,children:(0,B.jsxs)(Oa,{className:`border-input/30 bg-input/30 h-8 border-none shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[o,s]})}),t[9]=o,t[10]=c),c}function Fa(e){let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`no-scrollbar max-h-72 scroll-py-0 overflow-x-hidden overflow-y-auto outline-none`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,B.jsx)(va.List,{"data-slot":`command-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function Ia(e){let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`py-6 text-center font-normal`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,B.jsx)(va.Empty,{"data-slot":`command-empty`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function La(e){let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden font-normal **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:font-normal`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,B.jsx)(va.Group,{"data-slot":`command-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function Ra(e){let t=(0,z.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let o;t[4]===r?o=t[5]:(o=a(`group/command-item data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-none px-2 py-2 font-normal outline-hidden select-none in-data-[slot=dialog-content]:rounded-none! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3`,r),t[4]=r,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,B.jsx)(xe,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`}),t[6]=s):s=t[6];let c;return t[7]!==n||t[8]!==i||t[9]!==o?(c=(0,B.jsxs)(va.Item,{"data-slot":`command-item`,className:o,...i,children:[n,s]}),t[7]=n,t[8]=i,t[9]=o,t[10]=c):c=t[10],c}function za(e){let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`text-muted-foreground group-data-selected/command-item:text-foreground ml-auto font-normal tracking-widest`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,B.jsx)(`span`,{"data-slot":`command-shortcut`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}var Ba=Re(e=>ze(L.runtime.atom(me(L,t=>T(e)?t(`projects.branches`,{cwd:e}):oe(He.make({branches:[],defaultBranch:`main`}))),{initialValue:He.make({branches:[],defaultBranch:`main`})})));function Va(){let e=(0,z.c)(24),t=ye.useNavigate(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={select:Ha},e[0]=n):n=e[0];let r=Xe(n),i;e[1]===r.activeWorktreeId?i=e[2]:(i=We(r.activeWorktreeId),e[1]=r.activeWorktreeId,e[2]=i);let a=Ge(i),o,s,c,l,u;e[3]===t?(o=e[4],s=e[5],c=e[6],l=e[7],u=e[8]):(o=e=>{(0,R.startTransition)(()=>{t({params:{worktree:Ke(e)},to:`/$worktree/diff`})})},s=e=>{(0,R.startTransition)(()=>{t({params:{worktree:Ke(e)},to:`/$worktree/terminal`})})},c=(e,n)=>{(0,R.startTransition)(()=>{t({params:{worktree:Ke(e)},search:{origin:n},to:`/$worktree/portless`})})},l=(e,n)=>{(0,R.startTransition)(()=>{t({params:{worktree:Ke(e)},search:{agentId:n},to:`/$worktree/agent`})})},u=(e,n,r)=>{(0,R.startTransition)(()=>{t({params:{worktree:Ke(e)},search:{inactive:r,sessionId:n},to:`/$worktree/run`})})},e[3]=t,e[4]=o,e[5]=s,e[6]=c,e[7]=l,e[8]=u);let d;e[9]!==a.value.activeProject||e[10]!==a.value.activeWorktree||e[11]!==a.value.agentProfiles||e[12]!==a.value.projects||e[13]!==r.activeView||e[14]!==o||e[15]!==s||e[16]!==c||e[17]!==l||e[18]!==u?(d=(0,B.jsx)(Me,{defaultSize:`22%`,minSize:`16%`,maxSize:`34%`,children:(0,B.jsx)(uo,{activeProject:a.value.activeProject,activeWorktree:a.value.activeWorktree,activeView:r.activeView,agentProfiles:a.value.agentProfiles,projects:a.value.projects,selectWorktree:o,selectTerminal:s,selectPortless:c,selectAgent:l,selectRun:u})}),e[9]=a.value.activeProject,e[10]=a.value.activeWorktree,e[11]=a.value.agentProfiles,e[12]=a.value.projects,e[13]=r.activeView,e[14]=o,e[15]=s,e[16]=c,e[17]=l,e[18]=u,e[19]=d):d=e[19];let f;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,B.jsx)(Pe,{}),e[20]=f):f=e[20];let p;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,B.jsx)(Me,{defaultSize:`86%`,minSize:`60%`,children:(0,B.jsx)(`div`,{className:`flex h-full min-h-0 flex-col`,children:(0,B.jsx)(ve,{})})}),e[21]=p):p=e[21];let m;return e[22]===d?m=e[23]:(m=(0,B.jsx)(`div`,{className:`bg-background h-full min-h-0 flex-1 overflow-hidden`,children:(0,B.jsxs)(Ne,{orientation:`horizontal`,className:`h-full min-h-0 overflow-hidden`,children:[d,f,p]})}),e[22]=d,e[23]=m),m}function Ha(e){return{activeView:o(g(e.location.pathname),w(u(`/terminal`),qa),w(u(`/portless`),Ka),w(u(`/run`),Ga),w(u(`/agent`),Wa),m(Ua)),activeWorktreeId:f(`/`)(e.location.pathname)[1]}}function Ua(){return`diff`}function Wa(){return`agent`}function Ga(){return`run`}function Ka(){return`portless`}function qa(){return`terminal`}function Ja(e){return o(f(`/`)(e),pe,O(e=>T(e)&&e!==`.`),le(()=>e))}function Ya(e){let t=ne(`/home/`)(e)?o(f(`/`)(e),ue(3),fe(`/`)):void 0;return se(t)&&ne(`${t}/`)(e)?`~/${ie(ge(t)+1)(e)}`:Ja(e)}function Xa(e){let t=(0,z.c)(4);if(e.root){let n=e.dirty?`text-amber-500`:`text-current`,r;return t[0]===n?r=t[1]:(r=(0,B.jsx)(ot,{className:n}),t[0]=n,t[1]=r),r}let n=e.dirty?`text-amber-500`:`text-current`,r;return t[2]===n?r=t[3]:(r=(0,B.jsx)(ut,{className:n}),t[2]=n,t[3]=r),r}function Za(e,t){return{cwd:e,sessionId:t.sessionId}}function Qa(e){return{cwd:e.script.cwd,sessionId:e.script.sessionId}}function $a(e){return T(d(e))&&!/\s/u.test(e)}function eo(e){return[...e].toSorted((e,t)=>e.taskId.localeCompare(t.taskId))}function to(e){return[...e].toSorted((e,t)=>e.script.taskId.localeCompare(t.script.taskId))}function no(e){let t=(0,z.c)(10),n=(0,R.useState)(!1),r,i;if(t[0]!==n||t[1]!==e.cwd||t[2]!==e.runStatuses||t[3]!==e.scripts||t[4]!==e.selectRun){i=Symbol.for(`react.early_return_sentinel`);bb0:{let a=eo(e.scripts);if(a.length===0){i=null;break bb0}let o;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,B.jsx)(be,{}),t[7]=o):o=t[7];let s;t[8]===n?s=t[9]:(s=(0,B.jsx)(P,{icon:o,selected:!1,onClick:()=>{n[1](ro)},children:`scripts`}),t[8]=n,t[9]=s),r=(0,B.jsxs)(`li`,{className:`w-full min-w-0`,children:[s,n[0]&&(0,B.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:a.map(t=>(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(de,{}),children:(0,B.jsx)(io,{cwd:e.cwd,run:t,status:e.runStatuses[t.sessionId]??{state:`idle`,title:``},selectRun:e.selectRun})},t.sessionId))})]})}t[0]=n,t[1]=e.cwd,t[2]=e.runStatuses,t[3]=e.scripts,t[4]=e.selectRun,t[5]=r,t[6]=i}else r=t[5],i=t[6];return i===Symbol.for(`react.early_return_sentinel`)?r:i}function ro(e){return!e}function io(e){let t=Za(e.cwd,e.run),n=I(L.mutation(`terminal.restart`),{mode:`promise`}),r=I(L.mutation(`terminal.stop`),{mode:`promise`}),i=(0,R.useState)(!1);async function a(){if(!i[0]){i[1](!0);try{await(Ue(e.status.state)&&e.status.state!==`idle`?r({payload:t}):n({payload:t}))}catch(e){F.error(j(e))}finally{i[1](!1)}}}return(0,B.jsx)(`li`,{className:`w-full min-w-0`,children:(0,B.jsx)(P,{actions:(0,B.jsx)(`span`,{className:`flex h-full items-center justify-end`,children:(0,B.jsx)(k,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:i[0],onClick:e=>{e.stopPropagation(),a()},title:Ue(e.status.state)&&e.status.state!==`idle`?`Stop ${e.run.taskId}`:`Start ${e.run.taskId}`,children:o(g({active:Ue(e.status.state)&&e.status.state!==`idle`,pending:i[0]}),w({pending:!0},()=>(0,B.jsx)(M,{className:`size-2.5 border opacity-60`})),w({active:!0},()=>(0,B.jsx)(ut,{className:`size-3`})),m(()=>(0,B.jsx)(st,{className:`size-3`})))})}),icon:(0,B.jsx)(Ce,{state:e.status.state}),selected:!1,title:e.run.command,onClick:()=>{e.selectRun(e.cwd,e.run.sessionId,e.status.state===`idle`)},children:e.run.taskId})})}function ao(e){let t=(0,z.c)(8),n;t[0]===e.runs?n=t[1]:(n=to(e.runs),t[0]=e.runs,t[1]=n);let r=n;if(r.length===0)return null;let i;return t[2]!==e.cwd||t[3]!==e.runStatuses||t[4]!==e.selectPortless||t[5]!==e.selectRun||t[6]!==r?(i=(0,B.jsx)(oo,{cwd:e.cwd,runs:r,runStatuses:e.runStatuses,selectPortless:e.selectPortless,selectRun:e.selectRun}),t[2]=e.cwd,t[3]=e.runStatuses,t[4]=e.selectPortless,t[5]=e.selectRun,t[6]=r,t[7]=i):i=t[7],i}function oo(e){let t=(0,R.useState)(!0),n=I(L.mutation(`terminal.restart`),{mode:`promise`}),r=I(L.mutation(`terminal.stop`),{mode:`promise`}),i=(0,R.useState)(!1);async function a(){if(!i[0]){i[1](!0);try{for(let t of e.runs){let i=Qa(t);A(e.runs,t=>Ue(e.runStatuses[t.script.sessionId]?.state??`idle`)&&e.runStatuses[t.script.sessionId]?.state!==`idle`)?await r({payload:i}):await n({payload:i})}}catch(e){F.error(j(e))}finally{i[1](!1)}}}return(0,B.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,B.jsx)(P,{actions:(0,B.jsx)(k,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:i[0],onClick:e=>{e.stopPropagation(),a()},title:A(e.runs,t=>Ue(e.runStatuses[t.script.sessionId]?.state??`idle`)&&e.runStatuses[t.script.sessionId]?.state!==`idle`)?`Stop deslop`:`Start deslop`,children:o(g({active:A(e.runs,t=>Ue(e.runStatuses[t.script.sessionId]?.state??`idle`)&&e.runStatuses[t.script.sessionId]?.state!==`idle`),pending:i[0]}),w({pending:!0},()=>(0,B.jsx)(M,{className:`size-2.5 border opacity-60`})),w({active:!0},()=>(0,B.jsx)(ut,{className:`size-3`})),m(()=>(0,B.jsx)(st,{className:`size-3`})))}),icon:(0,B.jsx)(it,{}),selected:!1,onClick:()=>{t[1](e=>!e)},children:`deslop`}),t[0]&&(0,B.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:N(e.runs,t=>(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(de,{}),children:(0,B.jsx)(so,{run:t,status:e.runStatuses[t.script.sessionId]??{state:`idle`,title:``},selectPortless:e.selectPortless,selectRun:e.selectRun})},t.script.sessionId))})]})}function so(e){let t=(0,z.c)(16),n;t[0]===e?n=t[1]:(n=t=>{t.stopPropagation(),e.selectPortless(e.run.script.cwd,e.run.origin.origin)},t[0]=e,t[1]=n);let r=`Open ${e.run.script.taskId} preview`,i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,B.jsx)(it,{className:`size-3`}),t[2]=i):i=t[2];let a;t[3]!==n||t[4]!==r?(a=(0,B.jsx)(k,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,onClick:n,title:r,children:i}),t[3]=n,t[4]=r,t[5]=a):a=t[5];let o;t[6]===e.status.state?o=t[7]:(o=(0,B.jsx)(Ce,{state:e.status.state}),t[6]=e.status.state,t[7]=o);let s=e.run.script.command??e.run.script.taskId,c;t[8]===e?c=t[9]:(c=()=>{e.selectRun(e.run.script.cwd,e.run.script.sessionId,e.status.state===`idle`)},t[8]=e,t[9]=c);let l;return t[10]!==e.run.script.taskId||t[11]!==a||t[12]!==o||t[13]!==s||t[14]!==c?(l=(0,B.jsx)(`li`,{className:`w-full min-w-0`,children:(0,B.jsx)(P,{actions:a,icon:o,selected:!1,title:s,onClick:c,children:e.run.script.taskId})}),t[10]=e.run.script.taskId,t[11]=a,t[12]=o,t[13]=s,t[14]=c,t[15]=l):l=t[15],l}function co(e){let t=(0,z.c)(17),n;t[0]===e?n=t[1]:(n=t=>{t.stopPropagation(),e.onStop()},t[0]=e,t[1]=n);let r=`Stop ${e.session.label}`,i;t[2]===e.stopping?i=t[3]:(i=e.stopping?(0,B.jsx)(M,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(ut,{className:`size-3`}),t[2]=e.stopping,t[3]=i);let a;t[4]!==e.stopping||t[5]!==n||t[6]!==r||t[7]!==i?(a=(0,B.jsx)(k,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:e.stopping,onClick:n,title:r,children:i}),t[4]=e.stopping,t[5]=n,t[6]=r,t[7]=i,t[8]=a):a=t[8];let o;t[9]===e.session.state.state?o=t[10]:(o=(0,B.jsx)(Ce,{state:e.session.state.state}),t[9]=e.session.state.state,t[10]=o);let s=e.session.state.title?`Title: ${e.session.state.title}`:e.session.label,c=e.session.state.title===``?e.session.label:e.session.state.title,l;return t[11]!==e.onSelect||t[12]!==a||t[13]!==o||t[14]!==s||t[15]!==c?(l=(0,B.jsx)(`li`,{className:`w-full min-w-0`,children:(0,B.jsx)(P,{actions:a,icon:o,selected:!1,title:s,onClick:e.onSelect,children:c})}),t[11]=e.onSelect,t[12]=a,t[13]=o,t[14]=s,t[15]=c,t[16]=l):l=t[16],l}function lo(e){let t=I(L.mutation(`agents.create`),{mode:`promise`}),n=I(L.mutation(`agents.remove`),{mode:`promise`}),r=(0,R.useState)(()=>s()),i=(0,R.useState)(()=>s());async function a(n){if(!p(r[0],n.id)){r[1](e=>_e(e,n.id));try{let r=await t({payload:{cwd:e.cwd,profileId:n.id}});e.selectAgent(e.cwd,r.uuid)}catch(e){F.error(j(e))}finally{r[1](e=>E(e,n.id))}}}async function c(t){if(!p(i[0],t.uuid)){i[1](e=>_e(e,t.uuid));try{await n({payload:{cwd:e.cwd,uuid:t.uuid}})}catch(e){F.error(j(e))}finally{i[1](e=>E(e,t.uuid))}}}return(0,B.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,B.jsx)(P,{icon:(0,B.jsx)(Qe,{}),selected:!1,children:`agents`}),(0,B.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:N(e.profiles,t=>{let n=o(e.sessions,h(e=>e.profileId===t.id));return(0,B.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,B.jsx)(P,{actions:(0,B.jsx)(k,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`text-muted-foreground hover:text-foreground`,disabled:p(r[0],t.id),onClick:e=>{e.stopPropagation(),a(t)},title:`Start ${t.label}`,children:p(r[0],t.id)?(0,B.jsx)(M,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(st,{className:`size-3`})}),icon:(0,B.jsx)(je,{layer:t.icon}),selected:!1,children:t.label}),n.length>0&&(0,B.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:N(n,t=>(0,B.jsx)(co,{session:t,onSelect:()=>{e.selectAgent(e.cwd,t.uuid)},onStop:()=>{c(t)},stopping:p(i[0],t.uuid)},t.uuid))})]},t.id)})})]})}function uo(e){let t=I(L.mutation(`projects.fix`),{mode:`promise`}),n=I(L.mutation(`projects.createWorktree`),{mode:`promise`}),r=I(L.mutation(`projects.deleteWorktree`),{mode:`promise`}),[i,a]=(0,R.useState)(()=>({actionsOpen:!1,branch:``,createWorktreeProjectRoot:e.activeProject?.repository.root,creatingBranch:``,deleteDialogOpen:!1,deletingWorktree:!1,fixingProject:``})),s=o(e.projects,O(e=>e.repository.root===i.createWorktreeProjectRoot),ce)??e.activeProject,c=Ge(Ba(s?.repository.root??``)),l=o(c.value.branches,h(e=>e.type===`local`),N(e=>e.name)),u=o(c.value.branches,h(e=>T(e.name)),h(e=>e.type===`local`||!D(l,e.name)),te((e,t)=>e.name===t.name&&e.type===t.type&&e.remote===t.remote),h(e=>!o(s?.worktrees??[],N(e=>e.branch??``),h(T),D(e.name)))),f=d(i.branch),p=o(u,A(e=>e.name===f));async function v(t){let r=t?.name??f;if(_(r)||T(i.creatingBranch))return;if(he(t)&&!$a(r)){F.error(`Branch names cannot contain spaces.`);return}let o=he(t)?Je.make({}):g(t).pipe(w({type:`local`},()=>Ie.make({})),m(e=>Be.make({remote:e.remote??`origin`})));a(e=>({...e,creatingBranch:r}));try{let t=await n({payload:{branch:r,cwd:(s??e.activeProject)?.repository.root??``,source:o}});a(e=>({...e,actionsOpen:!1,branch:``})),e.selectWorktree(t)}catch(e){F.error(j(e))}finally{a(e=>({...e,creatingBranch:``}))}}async function y(){if(!(!e.activeWorktree||i.deletingWorktree)){a(e=>({...e,deletingWorktree:!0}));try{await r({payload:{cwd:e.activeWorktree.root}}),a(e=>({...e,deleteDialogOpen:!1}))}catch(e){F.error(j(e))}finally{a(e=>({...e,deletingWorktree:!1}))}}}async function b(e){a(t=>({...t,fixingProject:e}));try{await t({payload:{cwd:e}})}catch(e){F.error(j(e))}finally{a(e=>({...e,fixingProject:``}))}}return(0,B.jsxs)(`div`,{className:`flex h-full flex-col border-r`,children:[(0,B.jsxs)(`div`,{className:`grid h-8 grid-cols-[minmax(0,1fr)_auto] items-center border-b`,children:[(0,B.jsx)(k,{type:`button`,variant:`ghost`,size:`sm`,className:`text-muted-foreground hover:text-foreground flex h-full w-full min-w-0 justify-start px-3 text-left`,onClick:()=>{e.activeWorktree&&navigator.clipboard.writeText(e.activeWorktree.root)},children:(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:e.activeWorktree?Ya(e.activeWorktree.root):`No worktree selected`})}),e.activeWorktree&&e.activeWorktree.root!==e.activeProject?.repository.root&&(0,B.jsx)(k,{type:`button`,variant:`destructive`,size:`icon`,className:`h-8 w-8`,disabled:i.deletingWorktree,onClick:()=>{a(e=>({...e,deleteDialogOpen:!0}))},title:`Delete worktree`,children:i.deletingWorktree?(0,B.jsx)(M,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(ft,{className:`size-3`})})]}),(0,B.jsx)(Ae,{open:i.deleteDialogOpen,onOpenChange:e=>{a(t=>({...t,deleteDialogOpen:e}))},children:(0,B.jsxs)(Ee,{showCloseButton:!i.deletingWorktree,children:[(0,B.jsxs)(Se,{children:[(0,B.jsx)(De,{children:`Delete worktree`}),(0,B.jsx)(Oe,{children:e.activeWorktree?`Delete ${e.activeWorktree.branch??Ja(e.activeWorktree.root)}?`:`No worktree selected.`})]}),(0,B.jsxs)(we,{children:[(0,B.jsx)(k,{type:`button`,variant:`outline`,disabled:i.deletingWorktree,onClick:()=>{a(e=>({...e,deleteDialogOpen:!1}))},children:`Cancel`}),(0,B.jsxs)(k,{type:`button`,variant:`destructive`,disabled:!e.activeWorktree||i.deletingWorktree,onClick:()=>{y(),a(e=>({...e,actionsOpen:!1}))},children:[i.deletingWorktree?(0,B.jsx)(M,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(ft,{className:`size-3`}),`Delete`]})]})]})}),(0,B.jsx)(Na,{open:i.actionsOpen,onOpenChange:e=>{a(t=>({...t,actionsOpen:e}))},title:`Create worktree`,description:`Create or open a worktree branch.`,className:`sm:max-w-2xl`,children:(0,B.jsxs)(Ma,{onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&a(e=>({...e,actionsOpen:!1}))},children:[(0,B.jsx)(Pa,{placeholder:`Find or create branch in ${s?Ja(s.repository.root):`workspace`}...`,value:i.branch,onValueChange:e=>{a(t=>({...t,branch:e}))},onKeyDown:e=>{e.key===`Enter`&&T(f)&&s&&(e.preventDefault(),v(o(u,O(e=>e.name===f),ce)))}}),(0,B.jsxs)(Fa,{children:[(0,B.jsx)(Ia,{children:T(f)&&!$a(f)?`Branch names cannot contain spaces.`:`No matching branch.`}),s&&(0,B.jsxs)(La,{children:[T(f)&&$a(f)&&!p&&(0,B.jsxs)(Ra,{value:f,disabled:T(i.creatingBranch),onSelect:()=>{v()},children:[i.creatingBranch===f?(0,B.jsx)(M,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(nt,{}),(0,B.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Create `,f]}),(0,B.jsxs)(za,{children:[`origin/`,c.value.defaultBranch]})]}),N(u,e=>{let t=i.creatingBranch===e.name?(0,B.jsx)(M,{className:`size-2.5 border opacity-60`}):g(e.type).pipe(w(`local`,()=>(0,B.jsx)(rt,{})),m(()=>(0,B.jsx)(it,{})));return(0,B.jsxs)(Ra,{value:e.name,onSelect:()=>{a(t=>({...t,branch:e.name})),v(e)},children:[t,(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,B.jsx)(za,{children:e.type})]},`${e.type}:${e.remote??``}:${e.name}`)})]})]})]})}),(0,B.jsx)(ke,{className:`min-h-0 flex-1 overflow-y-auto px-0 py-1`,children:(0,B.jsx)(Te,{children:N(e.projects,t=>{let n=ce(O(t.worktrees,e=>e.root===t.repository.root))??t.worktrees[0];return(0,B.jsxs)(`li`,{className:`min-w-0 py-1 first:pt-0`,children:[(0,B.jsxs)(`div`,{className:`text-foreground grid h-7 w-full min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2 px-3 pr-2 text-left font-normal hover:bg-transparent`,children:[(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,B.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center [&_svg]:size-3`,children:(0,B.jsx)(Ze,{})}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,B.jsx)(`button`,{type:`button`,className:`tree-label flex min-w-0 items-center gap-1.5 text-left`,onClick:()=>{n&&e.selectWorktree(n.root)},children:(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:Ja(t.repository.root)})})})]}),(0,B.jsxs)(`span`,{className:`flex items-center`,children:[(0,B.jsx)(k,{variant:`ghost`,size:`icon-xs`,className:`h-5 w-5 rounded-none opacity-70 hover:opacity-100`,disabled:i.fixingProject===t.repository.root,onClick:e=>{e.stopPropagation(),b(t.repository.root)},title:`Fix repo state`,children:i.fixingProject===t.repository.root?(0,B.jsx)(M,{className:`size-2.5 border opacity-60`}):(0,B.jsx)(ct,{className:`size-3`})}),(0,B.jsx)(k,{variant:`ghost`,size:`icon-xs`,className:`h-5 w-5 rounded-none opacity-70 hover:opacity-100`,onClick:e=>{e.stopPropagation(),a(e=>({...e,actionsOpen:!0,branch:``,createWorktreeProjectRoot:t.repository.root}))},title:`Create worktree`,children:(0,B.jsx)(nt,{className:`size-3`})})]})]}),(0,B.jsx)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:N(t.worktrees,n=>(0,B.jsxs)(`li`,{className:`w-full min-w-0`,children:[(0,B.jsx)(P,{icon:(0,B.jsx)(Xa,{dirty:!1,root:n.root===t.repository.root}),selected:e.activeView===`diff`&&e.activeWorktree?.root===n.root,onClick:()=>{e.selectWorktree(n.root)},children:n.branch??Ja(n.root)},n.root),(0,B.jsxs)(`ul`,{className:`border-border/70 ml-[19px] flex flex-col border-l pl-2`,children:[(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(de,{}),children:(0,B.jsx)(lo,{cwd:n.root,profiles:e.agentProfiles,sessions:n.agents,selectAgent:e.selectAgent})}),(0,B.jsx)(`li`,{className:`w-full min-w-0`,children:(0,B.jsx)(P,{icon:(0,B.jsx)(dt,{}),selected:e.activeView===`terminal`&&e.activeWorktree?.root===n.root,onClick:()=>{e.selectTerminal(n.root)},children:`terminal`})}),(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(de,{}),children:(0,B.jsx)(ao,{cwd:n.root,runStatuses:n.runStatuses,runs:n.portlessRuns,selectPortless:e.selectPortless,selectRun:e.selectRun})}),(0,B.jsx)(R.Suspense,{fallback:(0,B.jsx)(de,{}),children:(0,B.jsx)(no,{cwd:n.root,runStatuses:n.runStatuses,scripts:n.scriptRuns,selectRun:e.selectRun})})]})]},n.root))})]},t.repository.gitDirectory)})})}),(0,B.jsx)(yt,{})]})}export{Va as component};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/route-BuzkrubX.js","assets/rolldown-runtime-QTnfLwEv.js","assets/compiler-runtime-CLAvuQ-D.js","assets/fallbacks-D1MIlTO6.js","assets/dialog-D3SsOi-l.js","assets/resizable-BWgF68j6.js","assets/preload-helper-CjdClQve.js","assets/sonner-vAlNGB2c.js","assets/triangle-alert-CHTnDlTF.js","assets/state-DipxiPcD.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{n as t,r as n}from"./compiler-runtime-CLAvuQ-D.js";import{$s as r,Cc as i,Dc as a,Ec as o,Fs as s,Is as c,Mt as l,Qs as u,Sc as d,Tc as f,Vs as p,Ws as m,Xs as h,Ys as g,Zs as _,_c as v,ac as y,bc as b,cc as x,dc as S,ec as C,fc as w,gc as T,hc as E,ic as D,lc as ee,mc as O,nc as k,oc as te,pc as ne,qs as A,rc as j,rt as re,sc as ie,tc as ae,uc as oe,wc as M,xc as se,yc as N,zs as ce}from"./fallbacks-D1MIlTO6.js";import{t as le}from"./preload-helper-CjdClQve.js";function ue(e){let t=e;return{get(){return t},set(e){t=N(e,t)}}}function de(e){return{get(){return e()}}}function fe(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>P(o,_.get())),x=r(()=>P(s,v.get())),S=r(()=>P(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=oe(64);function ee(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let O={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:ee,setMatches:k,setPending:te,setCached:ne};k(e.matches),a?.(O);function k(e){F(e,o,_,n,i)}function te(e){F(e,s,v,n,i)}function ne(e){F(e,c,y,n,i)}return O}function P(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function F(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}ne(n.get(),a)||n.set(a)})}function pe(){try{return sessionStorage}catch{return}}var me=`tsr-scroll-restoration-v1_3`,he=pe();function ge(){try{return JSON.parse(he?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function _e(){try{he?.setItem(me,JSON.stringify(I))}catch{}}var I=ge(),ve=`data-scroll-restoration-id`,ye=e=>e.state.__TSR_key||e.href;function be(e){let t=e.getAttribute(ve);if(t)return`[${ve}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var L=!1,R=`window`;function xe(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Se(e){let t=[];for(let n of e){if(n===R)continue;let e=xe(n);e&&t.push(e)}return t}function Ce(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||ye,a=new Map,o=(e,t,n)=>{let r=a.get(e)||{};r.scrollX=t,r.scrollY=n,a.set(e,r)},s=e=>{if(!(L||!r.restoring))if(e.target===document)o(R,scrollX,scrollY);else{let t=e.target;o(t,t.scrollLeft,t.scrollTop)}},c=e=>{if(!r.restoring)return;let t=I[e]||={};for(let[e,n]of a)e===R?t[R]=n:e.isConnected&&(t[be(e)]=n)};n&&!r.restoration&&(r.restoration=!0,L=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,s,!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&c(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{c(i(e.stores.resolvedLocation.get()??e.stores.location.get())),_e()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c;if(a.clear(),s||(r.next=!0),typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let l=i(t.toLocation),u=t.fromLocation&&i(t.fromLocation);if(r.restoring&&u&&u!==l){let e=I[u];if(e){let t=I[l];for(let n in e){if(n===R){if(s)continue}else{let e=xe(n);if(!e||s&&o&&(c??=Se(o),c.includes(e)))continue}t||=I[l]={},t[n]??=e[n]}}}L=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){let s=it.get(t.toLocation),u=e&&i&&(s===`PUSH`||s===`REPLACE`),d=r.restoring?I[l]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:r}=d[e];if(e===R){if(u)continue;scrollTo({top:r,left:t,behavior:n}),a=!0}else{let n=xe(e);n&&(n.scrollLeft=t,n.scrollTop=r)}}if(!a&&!e){let e={top:0,left:0,behavior:n};if(scrollTo(e),o){c??=Se(o);for(let t of c)t.scrollTo(e)}}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{L=!1}}))}function we(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Te(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Ee(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Te(r):Array.isArray(t)?t.push(Te(r)):n[e]=[t,Te(r)]}return n}var De=ke(JSON.parse),Oe=Ae(JSON.stringify,JSON.parse);function ke(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Ee(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Ae(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=we(e,r);return t?`?${t}`:``}}var je=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Me=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),z=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),B=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Ne=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},V=(e,t,n)=>{if(!(!A(n)&&!h(n)))throw A(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:A(n)?`redirected`:h(n)?`notFound`:r.status===`pending`?`success`:r.status,context:B(e,t.index),isFetching:!1,error:n})),h(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),A(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Pe=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Fe=(e,t,n)=>{let r=B(e,n);e.updateMatch(t,e=>({...e,context:r}))},H=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,V(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,V(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!A(n)&&!h(n)&&(e.serialError??=n)},Ie=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!z(e,t)&&(n.options.loader||n.options.beforeLoad||Ke(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{je(e)},i);r._nonReactive.pendingTimeout=t}},Le=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Ie(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&V(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},Re=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=O(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&H(e,n,o),s&&H(e,n,s),Ie(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},f=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),f()});return}i._nonReactive.beforeLoadPromise=O();let p={...B(e,n,!1),...i.__routeContext},{search:m,params:g,cause:_}=i,v=z(e,t),y={search:m,abortController:c,params:g,preload:v,context:p,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?`preload`:_,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},b=r=>{if(r===void 0){e.router.batch(()=>{u(),f()});return}(A(r)||h(r))&&(u(),H(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),f()})},x;try{if(x=r.options.beforeLoad(y),d(x))return u(),x.catch(t=>{H(e,n,t)}).then(b)}catch(t){u(),H(e,n,t)}b(x)},ze=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>Re(e,n,t,i),s=()=>{if(Pe(e,n))return;let t=Le(e,n,i);return d(t)?t.then(o):o()};return a()},Be=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Ve=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=B(e,r),d=z(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},He=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{U(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Ve(e,t,n,r,i)),l=!!s&&d(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;V(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:B(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:B(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,h(t)&&await i.options.notFoundComponent?.preload?.(),V(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,V(e,e.router.getMatch(n),t)}!A(o)&&!h(o)&&await U(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:B(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),V(e,r,t)}},Ue=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(Ve(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await He(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){A(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await He(e,t,i,n,d):Fe(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Pe(e,i)){if(!e.router.getMatch(i))return e.matches[n];Fe(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=z(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&V(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=O(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function We(e){let t=e,n=[];Me(t.router)&&je(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=ze(t,e);d(n)&&await n}catch(e){if(A(e))throw e;if(h(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Ne(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(Ue(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(A(e))throw e;h(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=Ne(t,l);e===void 0&&S();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await U(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await U(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Be(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let f=je(t);if(d(f)&&await f,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Ge(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function U(e,t=W){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===W?(()=>{if(e._componentsPromise===void 0){let t=Ge(e,W);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Ge(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Ke(e){for(let t of W)if(e.options[t]?.preload)return!0;return!1}var W=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function qe(e){return{input:({url:t})=>{for(let n of e)t=Ye(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Xe(e[n],t);return t}}}function Je(e){let t=k(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=C([`/`,t,e.pathname]),e)}}function Ye(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Xe(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}var G=`__TSR_index`,Ze=`popstate`,Qe=`beforeunload`;function $e(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=K(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[G];i=et(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[G];i=et(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[G]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function et(e,t){t||={};let n=rt();return{...t,key:n,__TSR_key:n,[G]:e}}function tt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>K(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=rt();t.history.replaceState({[G]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=K(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[G]-l.state[G],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=$e({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Qe,S,{capture:!0}),t.removeEventListener(Ze,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Qe,S,{capture:!0}),t.addEventListener(Ze,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function nt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function K(e,t){let n=nt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=rt();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[G]:0,key:a,__TSR_key:a}}}function rt(){return(Math.random()+1).toString(36).substring(7)}function q(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var it=new WeakMap,at=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=u(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=tt()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=oe(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=fe(st(this.latestLocation),e),Ce(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=k(o);t&&t!==`/`&&e.push(Je({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:qe(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=ee(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&x(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:E(e).path,external:!1,searchStr:o,search:M(t?.search,i),hash:E(r.slice(1)).path,state:f(t?.state,a)}}let o=new URL(i,this.origin),s=Ye(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:E(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:M(t?.search,c),hash:E(s.hash.slice(1)).path,state:f(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>ae({base:e,to:t.includes(`//`)?_(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>ct({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(n);t.from;let a=t.unsafeRelative===`path`?n.pathname:t.from??i.fullPath,o=t.to?`${t.to}`:void 0,s=i.search,c=Object.assign(Object.create(null),i.params),l=o?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(a,`.`),u=o?this.resolvePathWithBase(l,o):l,d=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?c:Object.assign(c,N(t.params,c)),p=this.routesByPath[j(u)],m;if(p)m=this.getRouteBranch(p);else if(u.includes(`$`))m=[];else{let e=this.getMatchedRoutes(u);m=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(m=[...m,this.options.notFoundRoute])}if(m.length&&b(d))for(let e of m){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(d,t(d))}catch{}}let h=e.leaveParams?u:E(r({path:u,params:d,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,g=s;if(e._includeValidateSearch&&this.options.search?.strict){let e={};m.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Y(t.options.validateSearch,{...e,...g}))}catch{}}),g=e}g=lt({search:g,dest:t,destRoutes:m,_includeValidateSearch:e._includeValidateSearch}),g=M(s,g);let _=this.options.stringifySearch(g),y=t.hash===!0?n.hash:t.hash?N(t.hash,n.hash):void 0,x=y?`#${y}`:``,S=t.state===!0?n.state:t.state?N(t.state,n.state):{};S=f(n.state,S);let C=`${h}${_}${x}`,w,T,D=!1;if(this.rewrite){let e=new URL(C,this.origin),t=Xe(this.rewrite,e);w=e.href.replace(e.origin,``),t.origin===this.origin?T=t.pathname+t.search+t.hash:(T=t.href,D=!0)}else w=v(C),T=w;return{publicHref:T,href:w,pathname:h,search:g,searchStr:_,state:S,hash:y??``,external:D,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=y(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,N(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=T(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=j(this.latestLocation.href)===j(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=O(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=K(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Ye(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(se(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t?it.set(this.latestLocation,t):it.delete(this.latestLocation);let n=this.latestLocation,r=q(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await We({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){A(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):h(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(q(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&se(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=U,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await We({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(A(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});h(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=ie(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!T(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?T(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Oe,parseSearch:e.parseSearch??De,protocolAllowlist:e.protocolAllowlist??w}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=D(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:i,routeParams:a}=n,{matchedRoutes:o}=n,s=!1;(i?i.path!==`/`&&a[`**`]:j(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?dt(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map;for(let e of this.stores.matchStores.values())e.routeId&&u.set(e.routeId,e.get());for(let n=0;n<o.length;n++){let i=o[n],s=l[n-1],d,p,m;{let n=s?.search??e.search,r=s?._strictSearch??void 0;try{let e=Y(i.options.validateSearch,{...n})??void 0;d={...n,...e},p={...r,...e},m=void 0}catch(e){let r=e;if(e instanceof J||(r=new J(e.message,{cause:e})),t?.throwOnError)throw r;d=n,p={},m=r}}let g=i.options.loaderDeps?.({search:d})??``,_=g?JSON.stringify(g):``,{interpolatedPath:v,usedParams:y}=r({path:i.fullPath,params:a,decoder:this.pathParamsDecoder,server:this.isServer}),b=i.id+v+_,x=this.getMatch(b),S=u.get(i.id),C=x?._strictParams??y,w;if(!x)try{ft(i,C)}catch(e){if(w=h(e)||A(e)?e:new ot(e.message,{cause:e}),t?.throwOnError)throw w}Object.assign(a,C);let T=S?`stay`:`enter`,E;if(x)E={...x,cause:T,params:S?.params??a,_strictParams:C,search:M(S?S.search:x.search,d),_strictSearch:p};else{let e=i.options.loader||i.options.beforeLoad||i.lazyFn||Ke(i)?`pending`:`success`;E={id:b,ssr:i.options.ssr,index:n,routeId:i.id,params:S?.params??a,_strictParams:C,pathname:v,updatedAt:Date.now(),search:S?M(S.search,d):d,_strictSearch:p,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:w,__routeContext:void 0,_nonReactive:{loadPromise:O()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:T,loaderDeps:S?f(S.loaderDeps,g):g,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:i.options.staticData||{},fullPath:i.fullPath}}t?.preload||(E.globalNotFound=c===i.id),E.searchError=m;let D=this.getParentContext(s);E.context={...D,...E.__routeContext,...E.__beforeLoadContext},l[n]=E}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],i=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?M(o.params,a):a,!i){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=i(t),a={...e.search};for(let e of t)try{Object.assign(a,Y(e.options.validateSearch,a))}catch{}let o=i(this.stores.matchesId.get()),s=o&&this.stores.matchStores.get(o)?.get(),c=s&&s.routeId===r.id&&s.pathname===e.pathname,l;if(c)l=s.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{ft(n,e)}catch{}l=e}return{matchedRoutes:t,fullPath:r.fullPath,search:a,params:l}}},J=class extends Error{},ot=class extends Error{};function st(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Y(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new J(`Async validation not supported`);if(n.issues)throw new J(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function ct({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=j(e),a,o=te(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function lt({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return ut(n)(e,t,r??!1)}function ut(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=Y(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=N(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function dt(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return g}function ft(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}var X=e(n(),1),Z=t();function pt(e){let t=e.errorComponent??Q;return(0,Z.jsx)(mt,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?X.createElement(t,{error:n,reset:r}):e.children})}var mt=class extends X.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Q({error:e}){let[t,n]=X.useState(!1);return(0,Z.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,Z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,Z.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,Z.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,Z.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,Z.jsx)(`div`,{children:(0,Z.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,Z.jsx)(`code`,{children:e.message}):null})}):null]})}function ht(e){let t=a(),n=`not-found-${m(t.stores.location,e=>e.pathname)}-${m(t.stores.status,e=>e)}`;return(0,Z.jsx)(pt,{getResetKey:()=>n,onCatch:(t,n)=>{if(h(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(h(t))return e.fallback?.(t);throw t},children:e.children})}function gt(){return(0,Z.jsx)(`p`,{children:`Not Found`})}function $(e){return(0,Z.jsx)(Z.Fragment,{children:e.children})}function _t(e,t,n){return t.options.notFoundComponent?(0,Z.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,Z.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,Z.jsx)(gt,{})}var vt=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,yt=(e,t)=>e[0]===t[0]&&e[1]===t[1],bt=X.memo(function({matchId:e}){let t=a(),n=t.stores.matchStores.get(e);n||S();let r=m(t.stores.loadedAt,e=>e),i=m(n,e=>e,vt);return(0,Z.jsx)(xt,{router:t,matchId:e,resetKey:r,matchState:X.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function xt({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,s=a?(0,Z.jsx)(a,{}):null,c=i.options.errorComponent??e.options.defaultErrorComponent,l=i.options.onCatch??e.options.defaultOnCatch,u=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,d=r.ssr===!1||r.ssr===`data-only`,f=(!i.isRoot||i.options.wrapInSuspense||d)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||d))?X.Suspense:$,p=c?pt:$,m=u?ht:$;return(0,Z.jsxs)(i.isRoot?i.options.shellComponent??$:$,{children:[(0,Z.jsx)(o.Provider,{value:t,children:(0,Z.jsx)(f,{fallback:s,children:(0,Z.jsx)(p,{getResetKey:()=>n,errorComponent:c||Q,onCatch:(e,t)=>{if(h(e))throw e.routeId??=r.routeId,e;l?.(e,t)},children:(0,Z.jsx)(m,{fallback:e=>{if(e.routeId??=r.routeId,!u||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return X.createElement(u,e)},children:d||r._displayPending?(0,Z.jsx)(ce,{fallback:s,children:(0,Z.jsx)(Ct,{matchId:t})}):(0,Z.jsx)(Ct,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(St,{}),(e.options.scrollRestoration,null)]}):null]})}function St(){let e=a(),t=X.useRef();return p(()=>{let n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:`onRendered`,...q(e.stores.location.get(),r??n)}),t.current=n},[m(e.stores.resolvedLocation,e=>e?.state.__TSR_key),e]),null}var Ct=X.memo(function({matchId:e}){let t=a(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||S();let i=m(r,e=>e),o=i.routeId,s=t.routesById[o],c=X.useMemo(()=>{let e=(t.routesById[o].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:o,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[o,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),l=X.useMemo(()=>{let e=s.options.component??t.options.defaultComponent;return e?(0,Z.jsx)(e,{},c):(0,Z.jsx)(wt,{})},[c,s.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=s.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=O();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return h(i.error)||S(),_t(t,s,i.error);if(i.status===`redirected`)throw A(i.error)||S(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return l}),wt=X.memo(function(){let e=a(),t=X.useContext(o),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=m(a,e=>[e?.routeId,e?.globalNotFound??!1],yt),i=m(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let s=n?e.routesById[n]:void 0,c=e.options.defaultPendingComponent?(0,Z.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return s||S(),_t(e,s,void 0);if(!i)return null;let l=(0,Z.jsx)(bt,{matchId:i});return n===`__root__`?(0,Z.jsx)(X.Suspense,{fallback:c,children:l}):l}),Tt=c(`/(home)`)({component:s(()=>le(()=>import(`./route-BuzkrubX.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),`component`),validateSearch:l(re({}))});export{pt as a,q as c,$ as i,ue as l,bt as n,Q as o,wt as r,at as s,Tt as t,de as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./compiler-runtime-CLAvuQ-D.js";import{n}from"./fallbacks-
|
|
1
|
+
import{n as e,t}from"./compiler-runtime-CLAvuQ-D.js";import{n}from"./fallbacks-D1MIlTO6.js";import{j as r,r as i}from"./state-DipxiPcD.js";import{t as a}from"./run-D-KGLETl.js";import{t as o}from"./-workbench-terminal-BXoM87zf.js";var s=t(),c=e();function l(){let e=(0,s.c)(9),t=a.useParams(),l=a.useSearch(),u;e[0]===t.worktree?u=e[1]:(u=i(t.worktree),e[0]=t.worktree,e[1]=u);let d=r(u);if(!d.value.activeWorktree)return;if(l.inactive===!0){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsx)(`div`,{className:`bg-background h-full min-h-0 min-w-0 p-2`,children:(0,c.jsx)(n,{message:`This script has not been started yet. Use the play button to start it.`})}),e[2]=t):t=e[2],t}let f;e[3]!==d.value.activeWorktree.root||e[4]!==l.sessionId?(f={cwd:d.value.activeWorktree.root,sessionId:l.sessionId},e[3]=d.value.activeWorktree.root,e[4]=l.sessionId,e[5]=f):f=e[5];let p;return e[6]!==l.sessionId||e[7]!==f?(p=(0,c.jsx)(`div`,{className:`bg-background h-full min-h-0 min-w-0`,children:(0,c.jsx)(o,{session:f},l.sessionId)}),e[6]=l.sessionId,e[7]=f,e[8]=p):p=e[8],p}export{l as component};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/run-ByOu_fKi.js","assets/compiler-runtime-CLAvuQ-D.js","assets/rolldown-runtime-QTnfLwEv.js","assets/fallbacks-D1MIlTO6.js","assets/state-DipxiPcD.js","assets/-workbench-terminal-BXoM87zf.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{B as e,Fs as t,Is as n,Mt as r,Ot as i,nt as a,rt as o}from"./fallbacks-D1MIlTO6.js";import{t as s}from"./preload-helper-CjdClQve.js";var c=n(`/(home)/$worktree/run`)({component:t(()=>s(()=>import(`./run-ByOu_fKi.js`),__vite__mapDeps([0,1,2,3,4,5])),`component`),validateSearch:r(o({inactive:i(e),sessionId:a}))});export{c as t};
|