purplemux-improved 0.5.2 → 0.5.3
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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +69 -69
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +7 -21
- package/.next/standalone/.next/routes-manifest.json +7 -7
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__02xv7~4._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pg7_fw._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_pages-api_0mp1c0x.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_0-6-4gr._.js +2 -2
- package/.next/standalone/.next/server/chunks/src_lib_0bfz8tg._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_0bybf96._.js +2 -2
- package/.next/standalone/.next/server/chunks/src_lib_0e70lm~._.js +2 -2
- package/.next/standalone/.next/server/chunks/src_lib_0~0m7l8._.js +3 -3
- package/.next/standalone/.next/server/chunks/src_lib_10z0zpi._.js +3 -3
- package/.next/standalone/.next/server/chunks/src_lib_11q_ije._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_11wf1py._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_workspace-store_ts_0vqt073._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0vtc~z4._.js → [root-of-the-server]__0o8awmh._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0u.5ow5._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0~_rluj._.js → _0059b4o._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_1190squ._.js → _02invsz._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_10wet_j._.js → _02j9520._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0-w3tj9._.js → _05ml6cg._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_05olxum._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_064b9hu._.js +5 -5
- package/.next/standalone/.next/server/chunks/ssr/_07wt20b._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0_b3~d3._.js → _084qsmh._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_08vx_j-._.js +6 -6
- package/.next/standalone/.next/server/chunks/ssr/_0d67vca._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0eraxg9._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_04vwo8q._.js → _0ilxd4s._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0jss17t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0ofci7p._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0q4nv97._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0a.akhg._.js → _0vcyslc._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0sy436f._.js → _0yi73t0._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0z9eed4._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0~.pyem._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_11m23bw._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_12iupnk._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0hxmihd._.js → _13ha_i-._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_13p_yuf._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_020ffk6._.js +7 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_0j2..z3._.js +7 -0
- package/.next/standalone/.next/server/chunks/ssr/{src_components_00t92p_._.js → src_components_06-~ul0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_components_0377vog._.js → src_components_0_6iijk._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_components_07zb5pr._.js → src_components_0pai.m-._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_components_0i.w8vm._.js → src_components_0u595gy._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_components_features_workspace_terminal-page_tsx_0wuq-jl._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_use-browser-title_ts_0bw6.cb._.js +2 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_00ztu0a._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_workspace-store_ts_00x-rec._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +69 -69
- package/.next/standalone/.next/server/pages/_app/build-manifest.json +4 -4
- package/.next/standalone/.next/server/pages/_app/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/de/404.html +1 -1
- package/.next/standalone/.next/server/pages/de/500.html +1 -1
- package/.next/standalone/.next/server/pages/en/404.html +1 -1
- package/.next/standalone/.next/server/pages/en/500.html +1 -1
- package/.next/standalone/.next/server/pages/es/404.html +1 -1
- package/.next/standalone/.next/server/pages/es/500.html +1 -1
- package/.next/standalone/.next/server/pages/fr/404.html +1 -1
- package/.next/standalone/.next/server/pages/fr/500.html +1 -1
- package/.next/standalone/.next/server/pages/index/build-manifest.json +15 -15
- package/.next/standalone/.next/server/pages/index/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/index/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/pages/index.js +13 -13
- package/.next/standalone/.next/server/pages/index.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/ja/404.html +1 -1
- package/.next/standalone/.next/server/pages/ja/500.html +1 -1
- package/.next/standalone/.next/server/pages/ko/404.html +1 -1
- package/.next/standalone/.next/server/pages/ko/500.html +1 -1
- package/.next/standalone/.next/server/pages/login/build-manifest.json +2 -2
- package/.next/standalone/.next/server/pages/login/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/login.js +1 -1
- package/.next/standalone/.next/server/pages/login.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/pt-BR/404.html +1 -1
- package/.next/standalone/.next/server/pages/pt-BR/500.html +1 -1
- package/.next/standalone/.next/server/pages/reports/build-manifest.json +14 -14
- package/.next/standalone/.next/server/pages/reports/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/reports.js +10 -10
- package/.next/standalone/.next/server/pages/reports.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/ru/404.html +1 -1
- package/.next/standalone/.next/server/pages/ru/500.html +1 -1
- package/.next/standalone/.next/server/pages/stats/build-manifest.json +14 -14
- package/.next/standalone/.next/server/pages/stats/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/stats/react-loadable-manifest.json +6 -6
- package/.next/standalone/.next/server/pages/stats.js +12 -12
- package/.next/standalone/.next/server/pages/stats.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/tools-required/build-manifest.json +2 -2
- package/.next/standalone/.next/server/pages/tools-required/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/tools-required.js +1 -1
- package/.next/standalone/.next/server/pages/tools-required.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/tr/404.html +1 -1
- package/.next/standalone/.next/server/pages/tr/500.html +1 -1
- package/.next/standalone/.next/server/pages/webview/build-manifest.json +15 -15
- package/.next/standalone/.next/server/pages/webview/client-build-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/webview.js +10 -10
- package/.next/standalone/.next/server/pages/webview.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/zh-CN/404.html +1 -1
- package/.next/standalone/.next/server/pages/zh-CN/500.html +1 -1
- package/.next/standalone/.next/server/pages/zh-TW/404.html +1 -1
- package/.next/standalone/.next/server/pages/zh-TW/500.html +1 -1
- package/.next/standalone/.next/static/{On_wePGLL9YXlfIjczKYI → UHztd2pPm5tP-rfJo0yff}/_buildManifest.js +6 -6
- package/.next/standalone/.next/static/chunks/{0ufg~2sx5w0q6.js → 0-g3am_gzwzwd.js} +1 -1
- package/.next/standalone/.next/static/chunks/0.a6w~4mo~suj.js +2 -0
- package/.next/standalone/.next/static/chunks/0.d64vss.3awb.css +1 -0
- package/.next/standalone/.next/static/chunks/02ev50wluxvcx.js +1 -0
- package/.next/standalone/.next/static/chunks/{06w1--pdmty56.js → 049b5vs0i6rna.js} +2 -2
- package/.next/standalone/.next/static/chunks/{0svd2jz7l-n8i.js → 06rg~j6wmmytz.js} +2 -2
- package/.next/standalone/.next/static/chunks/{0ish~.lc4dqaa.js → 081jl5~o5h9du.js} +14 -14
- package/.next/standalone/.next/static/chunks/0_zjtcpi2jcwf.js +1 -0
- package/.next/standalone/.next/static/chunks/{05um_2_jf6u-o.js → 0atvxjqkwkugq.js} +1 -1
- package/.next/standalone/.next/static/chunks/0c7~xc2o50kjt.js +1 -0
- package/.next/standalone/.next/static/chunks/0e.mey7h6wj2b.js +1 -0
- package/.next/standalone/.next/static/chunks/0fl7n0tduqd.0.js +1 -0
- package/.next/standalone/.next/static/chunks/0h-f9j1n7wcx3.js +150 -0
- package/.next/standalone/.next/static/chunks/{01d14n3l-ybtl.js → 0i6s179mghaer.js} +2 -2
- package/.next/standalone/.next/static/chunks/0iahqhf-y5869.js +1 -0
- package/.next/standalone/.next/static/chunks/{0kpgr8k1uqb3_.js → 0iwh2lfx65m7p.js} +2 -2
- package/.next/standalone/.next/static/chunks/{083cd8-e1gu--.js → 0j04r3eihwb66.js} +2 -2
- package/.next/standalone/.next/static/chunks/{0ky~8c1u-ed8u.js → 0jganbk2suwn8.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0rno186pvdtz-.js → 0jnplj30cyvfh.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0k-f3k2jk1cqf.js → 0lbq6hdeuuzdx.js} +15 -15
- package/.next/standalone/.next/static/chunks/{0vtdtc3pmhuu-.js → 0ozj.0fasw2py.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0dzynjxwt0u-..js → 0q.z2axs6_a-m.js} +6 -6
- package/.next/standalone/.next/static/chunks/{0vrmd-9mba1~c.js → 0rtgpogmd~y_c.js} +14 -14
- package/.next/standalone/.next/static/chunks/{14uzf~8w~t4i3.js → 0tn-uaxyd_fvq.js} +15 -15
- package/.next/standalone/.next/static/chunks/{076w32tkf608u.js → 0u_~0xd2vsw7u.js} +1 -1
- package/.next/standalone/.next/static/chunks/0v9.cau2tvhow.js +1 -0
- package/.next/standalone/.next/static/chunks/0wemfqqeae_h1.js +13 -0
- package/.next/standalone/.next/static/chunks/{0xm__1-o56cs5.js → 0xvdvw-o4a13j.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0ep5k6xk05.ih.js → 0yf331j_dueg9.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0jb4mng6q_r35.js → 0ypg5k0qyvbqt.js} +1 -1
- package/.next/standalone/.next/static/chunks/0zefn_3i--_49.js +1 -0
- package/.next/standalone/.next/static/chunks/{0z7uk1lobx6w9.js → 0~8_rxg-~pc.f.js} +4 -4
- package/.next/standalone/.next/static/chunks/108_z_hy~82hp.js +1 -0
- package/.next/standalone/.next/static/chunks/10jc5_.djl2io.js +1 -0
- package/.next/standalone/.next/static/chunks/{086h6i-juasej.js → 146_~wm2dgy_g.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-0puk~e1j8~on3.js → turbopack-062s3oenu.cik.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-0tlap~o-h1ms2.js → turbopack-079qvmf.y3wb5.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-0.-80~ro-hloo.js → turbopack-0aj6sy.io9dz3.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-0hoib2z8ebbe..js → turbopack-0b92yc936hzvu.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-0pvadga.pxb8w.js → turbopack-0j~doma34nwgv.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-0u-uf-f.oh-ca.js → turbopack-13n362cn_9xg-.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-0dthsyrf8i0dg.js → turbopack-17hit5zepvc-9.js} +1 -1
- package/.next/standalone/messages/de/diff.json +8 -1
- package/.next/standalone/messages/de/notification.json +6 -0
- package/.next/standalone/messages/de/workspace.json +20 -0
- package/.next/standalone/messages/en/diff.json +8 -1
- package/.next/standalone/messages/en/notification.json +6 -0
- package/.next/standalone/messages/en/workspace.json +20 -0
- package/.next/standalone/messages/es/diff.json +8 -1
- package/.next/standalone/messages/es/notification.json +6 -0
- package/.next/standalone/messages/es/workspace.json +20 -0
- package/.next/standalone/messages/fr/diff.json +8 -1
- package/.next/standalone/messages/fr/notification.json +6 -0
- package/.next/standalone/messages/fr/workspace.json +20 -0
- package/.next/standalone/messages/ja/diff.json +8 -1
- package/.next/standalone/messages/ja/notification.json +6 -0
- package/.next/standalone/messages/ja/workspace.json +20 -0
- package/.next/standalone/messages/ko/diff.json +8 -1
- package/.next/standalone/messages/ko/notification.json +6 -0
- package/.next/standalone/messages/ko/workspace.json +20 -0
- package/.next/standalone/messages/pt-BR/diff.json +8 -1
- package/.next/standalone/messages/pt-BR/notification.json +6 -0
- package/.next/standalone/messages/pt-BR/workspace.json +20 -0
- package/.next/standalone/messages/ru/diff.json +8 -1
- package/.next/standalone/messages/ru/notification.json +6 -0
- package/.next/standalone/messages/ru/workspace.json +20 -0
- package/.next/standalone/messages/tr/diff.json +8 -1
- package/.next/standalone/messages/tr/notification.json +6 -0
- package/.next/standalone/messages/tr/workspace.json +20 -0
- package/.next/standalone/messages/zh-CN/diff.json +8 -1
- package/.next/standalone/messages/zh-CN/notification.json +6 -0
- package/.next/standalone/messages/zh-CN/workspace.json +20 -0
- package/.next/standalone/messages/zh-TW/diff.json +8 -1
- package/.next/standalone/messages/zh-TW/notification.json +6 -0
- package/.next/standalone/messages/zh-TW/workspace.json +20 -0
- package/.next/standalone/package.json +10 -4
- package/.next/standalone/server.js +1 -1
- package/bin/feature-commands.js +4 -4
- package/dist/server.js +44 -10
- package/package.json +10 -4
- package/.next/standalone/.next/server/chunks/ssr/_0-0n2jc._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_05oyq08._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0cu43h7._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0dbg67a._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0lgqh-j._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0urnl2~._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_12h1.4d._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_07i.2e~._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/node_modules_0cx6hl6._.js +0 -7
- package/.next/standalone/.next/static/chunks/0-kj.6-iswtbg.js +0 -150
- package/.next/standalone/.next/static/chunks/080eo5_ldwk3p.js +0 -1
- package/.next/standalone/.next/static/chunks/08y.1_n96kgfo.js +0 -1
- package/.next/standalone/.next/static/chunks/09oqlv_7-xd4j.js +0 -1
- package/.next/standalone/.next/static/chunks/0_l9a48xds5zi.js +0 -1
- package/.next/standalone/.next/static/chunks/0e0ppim1c2..1.js +0 -1
- package/.next/standalone/.next/static/chunks/0jw.t~mrlg7qe.js +0 -1
- package/.next/standalone/.next/static/chunks/0sf75lq1jkebs.js +0 -1
- package/.next/standalone/.next/static/chunks/0v.15sf3jc67_.js +0 -1
- package/.next/standalone/.next/static/chunks/0x5zj~zxcqph6.js +0 -1
- package/.next/standalone/.next/static/chunks/0z4hai42j2v6w.js +0 -1
- package/.next/standalone/.next/static/chunks/1262.lq7n7w2a.js +0 -13
- package/.next/standalone/.next/static/chunks/142pcflu2ao60.js +0 -1
- package/.next/standalone/.next/static/chunks/16ckq99o7tw~2.css +0 -1
- /package/.next/standalone/.next/static/{On_wePGLL9YXlfIjczKYI → UHztd2pPm5tP-rfJo0yff}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{On_wePGLL9YXlfIjczKYI → UHztd2pPm5tP-rfJo0yff}/_ssgManifest.js +0 -0
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
#${n} [data-state="hunk"] {user-select: none}
|
|
6
6
|
#${n} [data-state="widget"] {user-select: none}`}else a.current.textContent=""};return iQ.createElement("div",{className:"split-diff-view split-diff-view-wrap w-full"},iQ.createElement("div",{className:"diff-table-wrapper w-full",style:{[rG]:`${Math.round(d)}px`,fontFamily:"Menlo, Consolas, monospace",fontSize:`var(${rB})`}},iQ.createElement("style",{"data-select-style":!0,ref:a}),iQ.createElement("table",{className:"diff-table w-full table-fixed border-collapse border-spacing-0"},iQ.createElement("colgroup",null,iQ.createElement("col",{className:"diff-table-old-num-col",width:Math.round(d)}),iQ.createElement("col",{className:"diff-table-old-content-col"}),iQ.createElement("col",{className:"diff-table-new-num-col",width:Math.round(d)}),iQ.createElement("col",{className:"diff-table-new-content-col"})),iQ.createElement("thead",{className:"hidden"},iQ.createElement("tr",null,iQ.createElement("th",{scope:"col"},"old line number"),iQ.createElement("th",{scope:"col"},"old line content"),iQ.createElement("th",{scope:"col"},"new line number"),iQ.createElement("th",{scope:"col"},"new line content"))),iQ.createElement("tbody",{className:"diff-table-body leading-[1.6]",onMouseDownCapture:e=>{let n=e.target;if(n&&n instanceof HTMLElement&&"BUTTON"===n.nodeName)return void rP();let i=rU(n);if(!i||i===`diff-root${t.getId()}`)for(;n&&n instanceof HTMLElement;){let e=n.getAttribute("data-state"),t=n.getAttribute("data-side");if(t&&r.current!==D[t]&&(r.current=D[t],m(D[t]),rP()),e)if("extend"!==e&&"hunk"!==e&&"widget"!==e)return;else{void 0!==r.current&&(r.current=void 0,m(void 0),rP());return}n=n.parentElement}}},u.map(e=>iQ.createElement(iQ.Fragment,{key:e.index},iQ.createElement(sg,{index:e.index,lineNumber:e.lineNumber,diffFile:t}),iQ.createElement(sc,{index:e.index,lineNumber:e.lineNumber,diffFile:t,enableAddWidget:o,enableHighlight:l}),iQ.createElement(sh,{index:e.index,lineNumber:e.lineNumber,diffFile:t}),iQ.createElement(su,{index:e.index,lineNumber:e.lineNumber,diffFile:t}))),iQ.createElement(sg,{index:t.splitLineLength,lineNumber:t.splitLineLength,diffFile:t})))))});sE.displayName="DiffSplitViewWrap";let sS=e=>r_(()=>{let t=a5(void 0),n=a5(void 0);return{widgetSide:t,widgetLineNumber:n,setWidget:i=>{var a,r;let{side:s,lineNumber:o}=i,{renderWidgetLine:l}=(null==(r=null==(a=e.current)?void 0:a.getReadonlyState)?void 0:r.call(a))||{};"function"==typeof l&&(t.value=s,n.value=o)}}}),sb=(0,iQ.memo)(e=>{let{diffFile:t}=e,{useDiffContext:n}=rZ(),i=(0,iQ.useRef)(n);i.current=n;let{enableWrap:a,onCreateUseWidgetHook:r}=n.useShallowStableSelector(e=>({enableWrap:e.enableWrap,onCreateUseWidgetHook:e.onCreateUseWidgetHook})),s=(0,iQ.useMemo)(()=>sS(i),[]),o=(0,iQ.useMemo)(()=>({useWidget:s}),[s]);return(0,iQ.useEffect)(()=>{let{setWidget:e}=s.getReadonlyState();e({})},[t,s]),(0,iQ.useEffect)(()=>{null==r||r(s)},[s,r]),iQ.createElement(rJ.Provider,{value:o},a?iQ.createElement(sE,{diffFile:t}):iQ.createElement(so,{diffFile:t}))});sb.displayName="DiffSplitView";let sv=e=>{let{index:t,diffLine:n,rawLine:i,plainLine:a,syntaxLine:r,lineNumber:s,diffFile:o,setWidget:l,enableWrap:c,enableAddWidget:d,enableHighlight:u,onAddWidgetClick:m}=e;return iQ.createElement("tr",{"data-line":t,"data-state":"diff",className:"diff-line group"},iQ.createElement("td",{className:"diff-line-num sticky left-0 z-[1] w-[1%] min-w-[100px] select-none whitespace-nowrap pl-[10px] pr-[10px] text-right align-top",style:{color:`var(${rN})`,backgroundColor:`var(${rT})`,width:`calc(calc(var(${rG}) + 5px) * 2)`,maxWidth:`calc(calc(var(${rG}) + 5px) * 2)`,minWidth:`calc(calc(var(${rG}) + 5px) * 2)`}},d&&iQ.createElement(rV,{index:t-1,lineNumber:s,diffFile:o,side:D.old,onWidgetClick:m,onOpenAddWidget:(e,t)=>l({lineNumber:e,side:t})}),iQ.createElement("div",{className:"flex"},iQ.createElement("span",{"data-line-old-num":s,className:"inline-block w-[50%]"},s),iQ.createElement("span",{className:"w-[10px] shrink-0"}),iQ.createElement("span",{className:"inline-block w-[50%]"}))),iQ.createElement("td",{className:"diff-line-content pr-[10px] align-top",style:{backgroundColor:`var(${rS})`}},iQ.createElement(rK,{enableWrap:c,diffFile:o,enableHighlight:u,rawLine:i,diffLine:n,plainLine:a,syntaxLine:r})))},sT=e=>{let{index:t,diffLine:n,rawLine:i,plainLine:a,syntaxLine:r,lineNumber:s,diffFile:o,setWidget:l,enableWrap:c,enableAddWidget:d,enableHighlight:u,onAddWidgetClick:m}=e;return iQ.createElement("tr",{"data-line":t,"data-state":"diff",className:"diff-line group"},iQ.createElement("td",{className:"diff-line-num sticky left-0 z-[1] w-[1%] min-w-[100px] select-none whitespace-nowrap pl-[10px] pr-[10px] text-right align-top",style:{color:`var(${rN})`,backgroundColor:`var(${rv})`,width:`calc(calc(var(${rG}) + 5px) * 2)`,maxWidth:`calc(calc(var(${rG}) + 5px) * 2)`,minWidth:`calc(calc(var(${rG}) + 5px) * 2)`}},d&&iQ.createElement(rV,{index:t-1,lineNumber:s,diffFile:o,side:D.new,onWidgetClick:m,onOpenAddWidget:(e,t)=>l({lineNumber:e,side:t})}),iQ.createElement("div",{className:"flex"},iQ.createElement("span",{className:"inline-block w-[50%]"}),iQ.createElement("span",{className:"w-[10px] shrink-0"}),iQ.createElement("span",{"data-line-new-num":s,className:"inline-block w-[50%]"},s))),iQ.createElement("td",{className:"diff-line-content pr-[10px] align-top",style:{backgroundColor:`var(${rE})`}},iQ.createElement(rK,{enableWrap:c,diffFile:o,enableHighlight:u,rawLine:i,diffLine:n,plainLine:a,syntaxLine:r})))},sy=e=>{let{index:t,diffFile:n,lineNumber:i,enableWrap:a,enableAddWidget:r,enableHighlight:s}=e,o=n.getUnifiedLine(t),{useDiffContext:l}=rZ(),c=l.getReadonlyState().onAddWidgetClick,{useWidget:d}=r0(),u=d.getReadonlyState().setWidget,m=o.diff,_=iv(o.diff),p=o.value||"",g=o.diff,f=o.newLineNumber,h=o.oldLineNumber,E=f?n.getNewSyntaxLine(f):h?n.getOldSyntaxLine(h):void 0,S=f?n.getNewPlainLine(f):h?n.getOldPlainLine(h):void 0;return _?o.oldLineNumber?iQ.createElement(sv,{index:i,enableWrap:a,diffFile:n,rawLine:p,diffLine:g,setWidget:u,plainLine:S,syntaxLine:E,enableHighlight:s,enableAddWidget:r,lineNumber:o.oldLineNumber,onAddWidgetClick:function(){for(var e,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return null==(e=c.current)?void 0:e.call(c,...n)}}):iQ.createElement(sT,{index:i,enableWrap:a,rawLine:p,diffLine:g,diffFile:n,setWidget:u,plainLine:S,syntaxLine:E,enableHighlight:s,enableAddWidget:r,lineNumber:o.newLineNumber,onAddWidgetClick:function(){for(var e,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return null==(e=c.current)?void 0:e.call(c,...n)}}):iQ.createElement("tr",{"data-line":i,"data-state":o.diff?"diff":"plain",className:"diff-line group"},iQ.createElement("td",{className:"diff-line-num sticky left-0 z-[1] w-[1%] min-w-[100px] select-none whitespace-nowrap pl-[10px] pr-[10px] text-right align-top",style:{color:`var(${m?rN:rx})`,width:`calc(calc(var(${rG}) + 5px) * 2)`,maxWidth:`calc(calc(var(${rG}) + 5px) * 2)`,minWidth:`calc(calc(var(${rG}) + 5px) * 2)`,backgroundColor:m?`var(${rR})`:`var(${rC})`}},r&&m&&iQ.createElement(rV,{index:t,diffFile:n,lineNumber:o.newLineNumber,side:D.new,onWidgetClick:function(){for(var e,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return null==(e=c.current)?void 0:e.call(c,...n)},onOpenAddWidget:(e,t)=>u({lineNumber:e,side:t})}),iQ.createElement("div",{className:"flex opacity-[0.5]"},iQ.createElement("span",{"data-line-old-num":o.oldLineNumber,className:"inline-block w-[50%]"},o.oldLineNumber),iQ.createElement("span",{className:"w-[10px] shrink-0"}),iQ.createElement("span",{"data-line-new-num":o.newLineNumber,className:"inline-block w-[50%]"},o.newLineNumber))),iQ.createElement("td",{className:"diff-line-content pr-[10px] align-top",style:{backgroundColor:m?`var(${ry})`:`var(${rC})`}},iQ.createElement(rK,{enableWrap:a,diffFile:n,enableHighlight:s,rawLine:p,diffLine:g,plainLine:S,syntaxLine:E})))},sC=e=>{let{index:t,diffFile:n,lineNumber:i,enableWrap:a,enableHighlight:r,enableAddWidget:s}=e,o=n.getUnifiedLine(t);return(null==o?void 0:o.isHidden)?null:iQ.createElement(sy,{index:t,diffFile:n,lineNumber:i,enableWrap:a,enableHighlight:r,enableAddWidget:s})},sN=e=>{let{index:t,diffFile:n,lineNumber:i,enableWrap:a,oldLineExtend:r,newLineExtend:s}=e,{useDiffContext:o}=rZ(),l=o.useShallowStableSelector(e=>e.renderExtendLine),c=n.getUnifiedLine(t),d=r3({selector:".unified-diff-table-wrapper",enable:"function"==typeof l});return l?iQ.createElement("tr",{"data-line":`${i}-extend`,"data-state":"extend",className:"diff-line diff-line-extend"},iQ.createElement("td",{className:"diff-line-extend-content p-0 align-top",colSpan:2},iQ.createElement("div",{className:"diff-line-extend-wrapper sticky left-0 z-[1]",style:{width:d}},(!!a||d>0)&&(null==r?void 0:r.data)!==void 0&&(null==r?void 0:r.data)!==null&&(null==l?void 0:l({diffFile:n,side:D.old,lineNumber:c.oldLineNumber,data:r.data,onUpdate:n.notifyAll})),(!!a||d>0)&&(null==s?void 0:s.data)!==void 0&&(null==s?void 0:s.data)!==null&&(null==l?void 0:l({diffFile:n,side:D.new,lineNumber:c.newLineNumber,data:s.data,onUpdate:n.notifyAll}))))):null},sx=e=>{let{index:t,diffFile:n,lineNumber:i,enableWrap:a}=e,{useDiffContext:r}=rZ(),s=n.getUnifiedLine(t),{oldLineExtend:o,newLineExtend:l}=r((0,iQ.useCallback)(e=>{var t,n,i,a;return{oldLineExtend:null==(n=null==(t=e.extendData)?void 0:t.oldFile)?void 0:n[null==s?void 0:s.oldLineNumber],newLineExtend:null==(a=null==(i=e.extendData)?void 0:i.newFile)?void 0:a[null==s?void 0:s.newLineNumber]}},[s.oldLineNumber,s.newLineNumber]));return((null==o?void 0:o.data)||(null==l?void 0:l.data))&&s&&!s.isHidden?iQ.createElement(sN,{index:t,diffFile:n,lineNumber:i,enableWrap:a,oldLineExtend:o,newLineExtend:l}):null},sR=e=>{var t;let{index:n,diffFile:i,lineNumber:a}=e,r=i.getUnifiedHunkLine(n),s=i.getExpandEnabled(),{useDiffContext:o}=rZ(),l=o.useShallowStableSelector(e=>e.enableWrap),c=s&&r&&r.unifiedInfo,d=r&&r.unifiedInfo&&r.unifiedInfo.endHiddenIndex-r.unifiedInfo.startHiddenIndex<40,u=r&&r.isFirst,m=r&&r.isLast;return iQ.createElement("tr",{"data-line":`${a}-hunk`,"data-state":"hunk",className:"diff-line diff-line-hunk"},iQ.createElement("td",{className:"diff-line-hunk-action sticky left-0 w-[1%] min-w-[100px] select-none p-[1px]",style:{backgroundColor:`var(${rA})`,color:`var(${rN})`,width:`calc(calc(var(${rG}) + 5px) * 2)`,maxWidth:`calc(calc(var(${rG}) + 5px) * 2)`,minWidth:`calc(calc(var(${rG}) + 5px) * 2)`}},c?u?iQ.createElement("button",{className:"diff-widget-tooltip flex w-full cursor-pointer items-center justify-center rounded-[2px] py-[6px]",title:"Expand Up","data-title":"Expand Up",onClick:()=>i.onUnifiedHunkExpand("up",n)},iQ.createElement(r7,{className:"fill-current"})):m?iQ.createElement("button",{className:"diff-widget-tooltip flex w-full cursor-pointer items-center justify-center rounded-[2px] py-[6px]",title:"Expand Down","data-title":"Expand Down",onClick:()=>i.onUnifiedHunkExpand("down",n)},iQ.createElement(r6,{className:"fill-current"})):d?iQ.createElement("button",{className:"diff-widget-tooltip flex w-full cursor-pointer items-center justify-center rounded-[2px] py-[6px]",title:"Expand All","data-title":"Expand All",onClick:()=>i.onUnifiedHunkExpand("all",n)},iQ.createElement(r8,{className:"fill-current"})):iQ.createElement(iQ.Fragment,null,iQ.createElement("button",{className:"diff-widget-tooltip flex w-full cursor-pointer items-center justify-center rounded-[2px] py-[2px]",title:"Expand Down","data-title":"Expand Down",onClick:()=>i.onUnifiedHunkExpand("down",n)},iQ.createElement(r6,{className:"fill-current"})),iQ.createElement("button",{className:"diff-widget-tooltip flex w-full cursor-pointer items-center justify-center rounded-[2px] py-[2px]",title:"Expand Up","data-title":"Expand Up",onClick:()=>i.onUnifiedHunkExpand("up",n)},iQ.createElement(r7,{className:"fill-current"}))):iQ.createElement("div",{className:"min-h-[28px]"}," ")),iQ.createElement("td",{className:"diff-line-hunk-content pr-[10px] align-middle",style:{backgroundColor:`var(${rO})`}},iQ.createElement("div",{className:"pl-[1.5em]",style:{whiteSpace:l?"pre-wrap":"pre",wordBreak:l?"break-all":"initial",color:`var(${rI})`}},(null==(t=r.unifiedInfo)?void 0:t.plainText)||r.text)))},sO=e=>{let{index:t,diffFile:n,lineNumber:i}=e,a=n.getUnifiedHunkLine(t),r=a&&a.unifiedInfo&&a.unifiedInfo.startHiddenIndex<a.unifiedInfo.endHiddenIndex,s=a&&n._getIsPureDiffRender()&&!a.unifiedInfo;return r||s?iQ.createElement(sR,{index:t,diffFile:n,lineNumber:i}):null},sI=e=>{let{index:t,diffFile:n,lineNumber:i,enableWrap:a}=e,{useWidget:r}=r0(),s=r.getReadonlyState().setWidget,o=n.getUnifiedLine(t),l=()=>s({}),c=r.getReadonlyState().widgetSide,d=r.getReadonlyState().widgetLineNumber,u=o.oldLineNumber&&c===D.old&&d===o.oldLineNumber,m=o.newLineNumber&&c===D.new&&d===o.newLineNumber,{useDiffContext:_}=rZ(),p=_.useShallowStableSelector(e=>e.renderWidgetLine),g=r3({selector:".unified-diff-table-wrapper",enable:"function"==typeof p});return p?iQ.createElement("tr",{"data-line":`${i}-widget`,"data-state":"widget",className:"diff-line diff-line-widget"},iQ.createElement("td",{className:"diff-line-widget-content p-0",colSpan:2},iQ.createElement("div",{className:"diff-line-widget-wrapper sticky left-0 z-[1]",style:{width:g}},(!!a||g>0)&&u&&(null==p?void 0:p({diffFile:n,side:D.old,lineNumber:o.oldLineNumber,onClose:l})),(!!a||g>0)&&m&&(null==p?void 0:p({diffFile:n,side:D.new,lineNumber:o.newLineNumber,onClose:l}))))):null},sA=e=>{let{index:t,diffFile:n,lineNumber:i,enableWrap:a}=e,{useWidget:r}=r0();return r.useShallowSelector(iQ.useCallback(e=>{let i=e.widgetLineNumber,a=e.widgetSide,r=n.getUnifiedLine(t),s=r.oldLineNumber&&a===D.old&&i===r.oldLineNumber,o=r.newLineNumber&&a===D.new&&i===r.newLineNumber;return s||o},[n,t]),(e,t)=>e===t)?iQ.createElement(sI,{index:t,diffFile:n,lineNumber:i,enableWrap:a}):null},sw=(0,iQ.memo)(e=>{let{diffFile:t}=e,{useDiffContext:n}=rZ(),i=(0,iQ.useRef)(null),a=(0,iQ.useRef)(),r=(0,iQ.useRef)(n);r.current=n;let s=(0,iQ.useMemo)(()=>sS(r),[]),o=(0,iQ.useMemo)(()=>({useWidget:s}),[s]),{fontSize:l,enableWrap:c,enableHighlight:d,enableAddWidget:u,onCreateUseWidgetHook:m}=n.useShallowStableSelector(e=>({fontSize:e.fontSize,enableWrap:e.enableWrap,enableHighlight:e.enableHighlight,enableAddWidget:e.enableAddWidget,onCreateUseWidgetHook:e.onCreateUseWidgetHook}));(0,iK.useSyncExternalStore)(t.subscribe,t.getUpdateCount,t.getUpdateCount),(0,iQ.useEffect)(()=>{let{setWidget:e}=s.getReadonlyState();e({})},[t,s]),(0,iQ.useEffect)(()=>{null==m||m(s)},[s,m]);let _=Math.max(40,rY({text:Math.max(t.unifiedLineLength,t.fileLineLength).toString(),font:(0,iQ.useMemo)(()=>({fontSize:l+"px",fontFamily:"Menlo, Consolas, monospace"}),[l])})+10),p=iz(t),g=e=>{if(i.current)if(e){let e=`diff-root${t.getId()}`;i.current.textContent=`#${e} [data-state="extend"] {user-select: none}
|
|
7
7
|
#${e} [data-state="hunk"] {user-select: none}
|
|
8
|
-
#${e} [data-state="widget"] {user-select: none}`}else i.current.textContent=""};return iQ.createElement(rJ.Provider,{value:o},iQ.createElement("div",{className:`unified-diff-view ${c?"unified-diff-view-wrap":"unified-diff-view-normal"} w-full`},iQ.createElement("style",{"data-select-style":!0,ref:i}),iQ.createElement("div",{className:"unified-diff-table-wrapper diff-table-scroll-container w-full overflow-x-auto overflow-y-hidden",style:{[rG]:`${Math.round(_)}px`,fontFamily:"Menlo, Consolas, monospace",fontSize:`var(${rB})`}},iQ.createElement("table",{className:`unified-diff-table w-full border-collapse border-spacing-0 ${c?"table-fixed":""}`},iQ.createElement("colgroup",null,iQ.createElement("col",{className:"unified-diff-table-num-col"}),iQ.createElement("col",{className:"unified-diff-table-content-col"})),iQ.createElement("thead",{className:"hidden"},iQ.createElement("tr",null,iQ.createElement("th",{scope:"col"},"line number"),iQ.createElement("th",{scope:"col"},"line content"))),iQ.createElement("tbody",{className:"diff-table-body leading-[1.6]",onMouseDownCapture:e=>{let n=e.target;if(n&&n instanceof HTMLElement&&"BUTTON"===n.nodeName)return void rP();let i=rU(n);if(!i||i===`diff-root${t.getId()}`)for(;n&&n instanceof HTMLElement;){let e=n.getAttribute("data-state");if(e)if("extend"===e||"hunk"===e||"widget"===e){void 0!==a.current&&(a.current=void 0,g(void 0),rP());return}else{a.current!==D.new&&(a.current=D.new,g(D.new),rP());return}n=n.parentElement}}},p.map(e=>iQ.createElement(iQ.Fragment,{key:e.index},iQ.createElement(sO,{index:e.index,lineNumber:e.lineNumber,diffFile:t}),iQ.createElement(sC,{index:e.index,lineNumber:e.lineNumber,diffFile:t,enableWrap:c,enableHighlight:d,enableAddWidget:u}),iQ.createElement(sA,{index:e.index,lineNumber:e.lineNumber,diffFile:t,enableWrap:c}),iQ.createElement(sx,{index:e.index,lineNumber:e.lineNumber,diffFile:t,enableWrap:c}))),iQ.createElement(sO,{index:t.unifiedLineLength,lineNumber:t.unifiedLineLength,diffFile:t}))))))});sw.displayName="DiffUnifiedView",ij.name="@git-diff-view/react";let sD=(0,iQ.memo)(e=>{let{diffFile:t,className:n,style:i,wrapperRef:a,diffViewMode:r,diffViewWrap:s,diffViewFontSize:o,diffViewHighlight:l,renderWidgetLine:c,renderExtendLine:d,extendData:u,diffViewAddWidget:m,onAddWidgetClick:_,onCreateUseWidgetHook:p,isMounted:g}=e,f=(0,iQ.useMemo)(()=>t.getId(),[t]),h=(0,iQ.useMemo)(()=>{let t,n;return t=e,n=f,r_(()=>{var e,i;let a=a5(),r=a5(n),s=a5(t.diffViewMode),o=a5(t.isMounted),l=a5(t.diffViewWrap),c=a5(t.diffViewAddWidget),d=a5(t.diffViewHighlight),u=a5(t.diffViewFontSize),m=a5({oldFile:Object.assign({},null==(e=t.extendData)?void 0:e.oldFile),newFile:Object.assign({},null==(i=t.extendData)?void 0:i.newFile)}),_=a5(t.renderWidgetLine),p=a5(t.renderExtendLine),g=a5(t.onCreateUseWidgetHook),f={current:t.onAddWidgetClick};return{id:r,setId:e=>r.value=e,dom:a,setDom:e=>a.value=e,mode:s,setMode:e=>s.value=e,mounted:o,setMounted:e=>o.value=e,enableWrap:l,setEnableWrap:e=>l.value=e,enableAddWidget:c,setEnableAddWidget:e=>c.value=e,enableHighlight:d,setEnableHighlight:e=>d.value=e,fontSize:u,setFontSize:e=>u.value=e,extendData:m,setExtendData:e=>{let t=Object.keys(m.value.oldFile||{}),n=Object.keys(e.oldFile||{});for(let e of t)n.includes(e)||delete m.value.oldFile[e];for(let t of n)m.value.oldFile[t]=e.oldFile[t];let i=Object.keys(m.value.newFile||{}),a=Object.keys(e.newFile||{});for(let e of i)a.includes(e)||delete m.value.newFile[e];for(let t of a)m.value.newFile[t]=e.newFile[t]},renderWidgetLine:_,setRenderWidgetLine:e=>_.value=e,renderExtendLine:p,setRenderExtendLine:e=>p.value=e,onAddWidgetClick:f,setOnAddWidgetClick:e=>f.current=e.current,onCreateUseWidgetHook:g,setOnCreateUseWidgetHook:e=>g.value=e}})},[]);(0,iQ.useEffect)(()=>{let{id:e,setId:t,mode:n,setMode:i,mounted:a,setMounted:E,enableAddWidget:S,setEnableAddWidget:b,enableHighlight:v,setEnableHighlight:T,enableWrap:y,setEnableWrap:C,setExtendData:N,fontSize:x,setFontSize:R,onAddWidgetClick:O,setOnAddWidgetClick:I,renderExtendLine:A,setRenderExtendLine:w,renderWidgetLine:D,setRenderWidgetLine:L,onCreateUseWidgetHook:M,setOnCreateUseWidgetHook:k}=h.getReadonlyState();f&&f!==e&&t(f),r&&r!==n&&i(r),a!==g&&E(g),m!==S&&b(m),l!==v&&T(l),s!==y&&C(s),u&&N(u),o&&o!==x&&R(o),_!==O.current&&I({current:_}),p!==M&&k(p),d!==A&&w(d),c!==D&&L(c)},[h,o,l,r,s,m,f,g,c,d,u,_,p]),(0,iQ.useEffect)(()=>{h.getReadonlyState().setDom(null==a?void 0:a.current)},[h,a]);let E=(0,iQ.useMemo)(()=>({useDiffContext:h}),[h]);return iQ.createElement(rX.Provider,{value:E},iQ.createElement("div",{className:"diff-tailwindcss-wrapper","data-component":"git-diff-view","data-theme":t._getTheme()||"light","data-version":"0.1.3","data-highlighter":t._getHighlighterName(),ref:a},iQ.createElement("div",{className:"diff-style-root",style:{[rB]:o+"px"}},iQ.createElement("div",{id:g?`diff-root${f}`:void 0,className:"diff-view-wrapper"+(n?` ${n}`:""),style:i},r&eF.Split?iQ.createElement(sb,{diffFile:t}):iQ.createElement(sw,{diffFile:t})))))}),sL=(0,iQ.forwardRef)((e,t)=>{var n,i,a,r;let s,{registerHighlighter:o,data:l,diffViewTheme:c,diffFile:d}=e,u=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,i=Object.getOwnPropertySymbols(e);a<i.length;a++)0>t.indexOf(i[a])&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]]);return n}(e,["registerHighlighter","data","diffViewTheme","diffFile"]),m=(0,iQ.useMemo)(()=>{var e,t,n,i,a,r;if(d){let e=iW.createInstance({});return e._mergeFullBundle(d._getFullBundle()),e}return l?new iW((null==(e=null==l?void 0:l.oldFile)?void 0:e.fileName)||"",(null==(t=null==l?void 0:l.oldFile)?void 0:t.content)||"",(null==(n=null==l?void 0:l.newFile)?void 0:n.fileName)||"",(null==(i=null==l?void 0:l.newFile)?void 0:i.content)||"",(null==l?void 0:l.hunks)||[],(null==(a=null==l?void 0:l.oldFile)?void 0:a.fileLang)||"",(null==(r=null==l?void 0:l.newFile)?void 0:r.fileLang)||""):null},[l,d]),_=(0,iQ.useRef)(m),p=(0,iQ.useRef)();_.current&&_.current!==m&&(null==(i=(n=_.current).clear)||i.call(n),_.current=m);let g=(()=>{let[e,t]=(0,iQ.useState)(!1);return(0,iQ.useEffect)(()=>{t(!0)},[]),e})();return(0,iQ.useEffect)(()=>{if(d&&m)return d._addClonedInstance(m),()=>{d._delClonedInstance(m)}},[m,d]),(0,iQ.useEffect)(()=>{m&&(m.initTheme(c),m.initRaw(),m.buildSplitDiffLines(),m.buildUnifiedDiffLines())},[m,c]),(0,iQ.useEffect)(()=>{m&&e.diffViewHighlight&&(o?(o.name!==m._getHighlighterName()||o.type!==m._getHighlighterType()||"class"!==o.type)&&(m.initSyntax({registerHighlighter:o}),m.notifyAll()):(m._getIsCloned()||m._getHighlighterName()===ic.name)&&"class"===m._getHighlighterType()||(m.initSyntax(),m.notifyAll()))},[m,e.diffViewHighlight,o,c]),(0,iQ.useEffect)(()=>{if(!m)return;let e=()=>{var e,t;null==(e=p.current)||e.setAttribute("data-theme",m._getTheme()||"light"),null==(t=p.current)||t.setAttribute("data-highlighter",m._getHighlighterName())};return e(),m.subscribe(e)},[m,c]),(a=()=>{var e;return null==(e=null==m?void 0:m.clear)?void 0:e.call(m)},r=[m],(s=(0,iQ.useRef)(a)).current=a,(0,iQ.useEffect)(()=>s.current,r),(0,iQ.useImperativeHandle)(t,()=>({getDiffFileInstance:()=>m}),[m]),m)?iQ.createElement(sD,Object.assign({key:m.getId()},u,{diffFile:m,isMounted:g,wrapperRef:p,diffViewTheme:c,diffViewMode:u.diffViewMode||eF.SplitGitHub,diffViewFontSize:u.diffViewFontSize||14})):null});sL.displayName="DiffView",e.s(["DiffModeEnum",0,eF,"DiffView",0,sL],744391)},236495,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(352819),a=e.i(679935),r=e.i(53073),s=e.i(817908),o=e.i(517696),l=e.i(664783),c=e.i(760057),d=e.i(853560),u=e.i(5056),m=e.i(661059),_=e.i(909725),p=e.i(835838),g=e.i(48500),f=e.i(353533),h=e.i(199648),E=e.i(939310),S=e.i(569479),b=e.i(550292),v=e.i(13628),T=e.i(266231),y=e.i(452512),C=e.i(31050),N=e.i(488286),x=e.i(754731),R=e.i(458612),O=e.i(821954),I=e.i(698677),A=e.i(700599),w=e.i(603331),D=e.i(444957),L=e.i(377216),M=e.i(781641),k=e.i(744391),P=e.i(322966);let F=/^diff --git /,U=e=>"/dev/null"===e?"/dev/null":e.replace(/^[ab]\//,""),B={normal:11,large:13,"x-large":15},G=e=>{let{file:a,repoRoot:r,displayName:s,isCollapsed:o,onToggle:l,sessionName:c,oldRef:d,newRef:u,viewMode:m,theme:_,isMobile:p,diffFontSize:g}=e,f=(0,i.useTranslations)("terminal"),h=(0,C.default)(e=>e.editorPreset),E=(0,O.default)(r&&!a.isDeleted?{path:r.replace(/\/$/,"")+"/"+a.newName}:null),S=!a.isBinary&&a.hunks.length>0,b=(0,P.getLang)(s),[v,T]=(0,n.useState)(null),[y,N]=(0,n.useState)(!1),x=a.isNew||"/dev/null"===a.oldName?"":a.oldName,R=a.isDeleted||"/dev/null"===a.newName?"":a.newName;(0,n.useEffect)(()=>{if(o||y||!S||!x&&!R)return;let e=new AbortController,t=new URLSearchParams({session:c,oldRef:d,newRef:u});return x&&t.set("oldPath",x),R&&t.set("newPath",R),fetch(`/api/layout/file-content?${t.toString()}`,{signal:e.signal}).then(e=>e.ok?e.json():null).then(e=>{N(!0),!e||e.truncated||e.binary||T({oldContent:e.oldContent,newContent:e.newContent})}).catch(e=>{"AbortError"!==e.name&&N(!0)}),()=>e.abort()},[o,y,S,c,d,u,x,R]);let w=(0,n.useMemo)(()=>{var e;return S?{oldFile:{fileName:a.oldName,fileLang:b,content:v?.oldContent},newFile:{fileName:a.newName,fileLang:b,content:v?.newContent},hunks:[0===(e=a).hunks.length?"":[e.oldHeaderLine||`--- a/${e.oldName||e.newName}`,e.newHeaderLine||`+++ b/${e.newName||e.oldName}`,...e.hunks].join("\n")]}:null},[S,a,b,v]);return(0,t.jsxs)("div",{className:"overflow-hidden rounded border border-border bg-card",children:[(0,t.jsxs)("div",{className:"sticky top-0 z-10 flex items-center border-b border-border bg-secondary",children:[(0,t.jsxs)("button",{type:"button",onClick:l,"aria-expanded":!o,className:"flex min-w-0 flex-1 items-center gap-2 px-3 py-1.5 text-left hover:bg-accent",children:[o?(0,t.jsx)(L.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(D.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:s}),a.isNew&&(0,t.jsx)("span",{className:"rounded bg-ui-teal/15 px-1 text-[10px] text-ui-teal",children:"NEW"}),a.isDeleted&&(0,t.jsx)("span",{className:"rounded bg-ui-red/15 px-1 text-[10px] text-ui-red",children:"DEL"}),a.isRenamed&&(0,t.jsx)("span",{className:"rounded bg-ui-blue/15 px-1 text-[10px] text-ui-blue",children:"RENAME"}),(0,t.jsxs)("span",{className:"ml-auto flex items-center gap-2 text-[11px]",children:[a.additions>0&&(0,t.jsxs)("span",{className:"text-ui-teal",children:["+",a.additions]}),a.deletions>0&&(0,t.jsxs)("span",{className:"text-ui-red",children:["-",a.deletions]})]})]}),E&&(0,t.jsx)("button",{type:"button",className:"shrink-0 p-2 text-muted-foreground hover:text-foreground",title:f("openEditor"),"aria-label":f("openEditor")+": "+s,onClick:()=>(0,I.openEditorTarget)(E),children:(0,t.jsx)(A.EditorIcon,{preset:h,className:"h-3.5 w-3.5"})})]}),!o&&(w?(0,t.jsx)(k.DiffView,{data:w,diffViewMode:"unified"===m?k.DiffModeEnum.Unified:k.DiffModeEnum.Split,diffViewTheme:_,diffViewHighlight:!0,diffViewWrap:p,diffViewFontSize:g}):(0,t.jsx)("div",{className:"px-3 py-2 text-muted-foreground",children:a.isBinary?"Binary file":"No diff content"}))]})},j=e=>{let{diff:i,viewMode:a,sessionName:r,repoRoot:s,oldRef:o="HEAD",newRef:l="WORKTREE"}=e,{resolvedTheme:c}=(0,w.useTheme)(),d="light"===c?"light":"dark",u=(0,T.default)(),m=B[(0,C.default)(e=>e.fontSize)]??B.normal,[_,p]=(0,n.useState)(()=>new Set),g=(0,n.useCallback)(e=>{p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),f=(0,n.useMemo)(()=>i?(e=>{if(!e.trim())return[];let t=e.split("\n"),n=[],i=null,a=null,r=!1,s=()=>{i&&a&&i.hunks.push(a.join("\n")),a=null},o=()=>{s(),i&&n.push(i),i=null,r=!1};for(let e of t){if(F.test(e)){o(),i={oldName:"",newName:"",oldHeaderLine:"",newHeaderLine:"",hunks:[],additions:0,deletions:0,isBinary:!1,isNew:!1,isDeleted:!1,isRenamed:!1};continue}if(i){if(!r){e.startsWith("@@")?(r=!0,a=[e]):e.startsWith("--- ")?(i.oldHeaderLine=e,i.oldName=U(e.slice(4).trim())):e.startsWith("+++ ")?(i.newHeaderLine=e,i.newName=U(e.slice(4).trim())):e.startsWith("new file")?i.isNew=!0:e.startsWith("deleted file")?i.isDeleted=!0:e.startsWith("rename from")||e.startsWith("rename to")?i.isRenamed=!0:e.startsWith("Binary files")&&(i.isBinary=!0);continue}if(e.startsWith("@@")){s(),a=[e];continue}a&&(a.push(e),e.startsWith("+")&&!e.startsWith("+++")?i.additions+=1:e.startsWith("-")&&!e.startsWith("---")&&(i.deletions+=1))}}return o(),n})(i).map(e=>{let t=e.newName&&"/dev/null"!==e.newName?e.newName:e.oldName&&"/dev/null"!==e.oldName?e.oldName:"file";return{key:JSON.stringify([s,o,l,e.oldName,e.newName]),source:e,displayName:t}}):[],[i,s,o,l]),h=(0,n.useMemo)(()=>{let e=0,t=0;for(let n of f)e+=n.source.additions,t+=n.source.deletions;return{files:f.length,add:e,del:t}},[f]),E=u?"unified":a;return 0===f.length?null:(0,t.jsxs)("div",{className:"flex flex-col gap-2 p-2 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-1 text-[11px] text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(M.FileText,{className:"h-3 w-3"}),h.files]}),h.add>0&&(0,t.jsxs)("span",{className:"text-ui-teal",children:["+",h.add]}),h.del>0&&(0,t.jsxs)("span",{className:"text-ui-red",children:["-",h.del]})]}),f.map(e=>{let n=`${e.source.hunks.length}:${e.source.additions}:${e.source.deletions}`;return(0,t.jsx)(G,{file:e.source,repoRoot:s,displayName:e.displayName,isCollapsed:!_.has(e.key),onToggle:()=>g(e.key),sessionName:r,oldRef:o,newRef:l,viewMode:E,theme:d,isMobile:u,diffFontSize:m},`${e.key}@${n}`)})]})},Y=e=>{let{sessionName:a,refreshToken:r,viewMode:o,repoRoot:l}=e,c=(0,i.useTranslations)("diff"),[d,u]=(0,n.useState)([]),[m,_]=(0,n.useState)(null),[p,g]=(0,n.useState)(!0),[E,S]=(0,n.useState)(!1),[b,v]=(0,n.useState)(!0),[T,y]=(0,n.useState)(null),[C,O]=(0,n.useState)(null),[I,A]=(0,n.useState)(!1),w=(0,n.useRef)(null),D=(0,n.useRef)(null),L=(0,n.useCallback)(async(e,t)=>{let n=await fetch(`/api/layout/git-log?session=${a}&limit=50&skip=${e}`,{signal:t});return n.ok?n.json():null},[a]);(0,n.useEffect)(()=>{let e=new AbortController;return g(!0),L(0,e.signal).then(t=>{if(e.signal.aborted)return;if(!t){u([]),_(null),v(!1);return}let n=t.commits??[];u(n),_(t.upstreamHash??null),v(n.length>=50)}).catch(e=>{"AbortError"!==e.name&&(u([]),v(!1))}).finally(()=>{e.signal.aborted||g(!1)}),()=>e.abort()},[L,r]);let M=(0,n.useCallback)(async()=>{if(E||!b||p)return;S(!0);let e=new AbortController;try{let t=await L(d.length,e.signal);if(e.signal.aborted)return;if(!t)return void v(!1);let n=t.commits??[];u(e=>[...e,...n]),v(n.length>=50)}catch(e){"AbortError"!==e.name&&v(!1)}finally{S(!1)}},[d.length,L,b,p,E]);(0,n.useEffect)(()=>{let e=w.current,t=D.current;if(!e||!t)return;let n=new IntersectionObserver(e=>{e[0].isIntersecting&&M()},{root:e,rootMargin:"200px"});return n.observe(t),()=>n.disconnect()},[M]),(0,n.useEffect)(()=>{if(!T)return void O(null);let e=new AbortController;return A(!0),fetch(`/api/layout/commit-diff?session=${a}&hash=${T}`,{signal:e.signal}).then(e=>e.ok?e.json():null).then(t=>{e.signal.aborted||O(t)}).catch(e=>{"AbortError"!==e.name&&O(null)}).finally(()=>{e.signal.aborted||A(!1)}),()=>e.abort()},[a,T,r]);let k=(0,n.useMemo)(()=>{if(!m)return new Set;let e=new Set;for(let t of d){if(t.hash===m)break;e.add(t.hash)}return e},[d,m]);return(0,t.jsxs)("div",{className:"relative h-full",children:[T&&(0,t.jsxs)("div",{className:"absolute inset-0 z-10 flex flex-col bg-card",children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>y(null),className:"flex h-6 items-center gap-1 rounded px-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-foreground",title:c("back"),children:[(0,t.jsx)(N.ArrowLeft,{className:"h-3.5 w-3.5"}),c("back")]}),C&&(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 text-[11px]",children:[(0,t.jsx)("span",{className:"shrink-0 font-mono text-ui-purple",children:C.commit.shortHash}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground",children:"·"}),(0,t.jsx)("span",{className:"truncate text-foreground",title:C.commit.subject,children:C.commit.subject}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground",children:"·"}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground",title:C.commit.email,children:C.commit.author}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground",children:"·"}),(0,t.jsx)("span",{className:"shrink-0 tabular-nums text-muted-foreground",title:(0,R.absoluteTime)(C.commit.timestamp),children:(0,R.compactFromNow)(C.commit.timestamp)})]})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:I&&!C?(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)(h.default,{className:"h-5 w-5 text-muted-foreground"})}):C?C.diff?(0,t.jsx)(j,{repoRoot:l,diff:C.diff,viewMode:o,sessionName:a,oldRef:C.commit.parents[0]??"HEAD",newRef:C.commit.hash}):(0,t.jsx)("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:c("noChanges")}):(0,t.jsx)("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:c("commitNotFound")})})]}),(0,t.jsx)("div",{ref:w,className:"h-full overflow-auto",children:p?(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)(h.default,{className:"h-5 w-5 text-muted-foreground"})}):0===d.length?(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 text-muted-foreground",children:[(0,t.jsx)(s.GitBranch,{className:"h-10 w-10 opacity-20"}),(0,t.jsx)("span",{className:"text-sm",children:c("noCommits")})]})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex flex-col px-2 py-1 font-mono text-xs",children:d.map((e,n)=>{let i=0===n,a=k.has(e.hash),r=n===d.length-1;return(0,t.jsxs)("button",{type:"button",onClick:()=>y(e.hash),className:"group relative flex items-start gap-2 rounded px-2 py-1 text-left hover:bg-accent/40",children:[(0,t.jsxs)("div",{className:"relative flex w-4 shrink-0 flex-col items-center",children:[e.isMerge?(0,t.jsx)(x.GitMerge,{className:(0,f.cn)("mt-[3px] h-3 w-3",a?"text-ui-blue":"text-foreground/70")}):(0,t.jsx)("span",{className:(0,f.cn)("mt-[6px] h-1.5 w-1.5 rounded-full",a?"bg-ui-blue":"bg-foreground/50")}),!r&&(0,t.jsx)("span",{className:"mt-[2px] flex-1 border-l border-border"})]}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-baseline gap-2",children:[(0,t.jsx)("span",{className:"shrink-0 text-ui-purple",children:e.shortHash}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",title:e.subject,children:e.subject}),i&&(0,t.jsx)("span",{className:"shrink-0 rounded bg-accent px-1 text-[10px] text-foreground",children:"HEAD"}),a&&!i&&(0,t.jsx)("span",{className:"shrink-0 rounded bg-ui-blue/15 px-1 text-[10px] text-ui-blue",children:c("ahead")}),(0,t.jsx)("span",{className:"w-8 shrink-0 text-right tabular-nums text-muted-foreground",title:(0,R.absoluteTime)(e.timestamp),children:(0,R.compactFromNow)(e.timestamp)})]})]},e.hash)})}),b&&(0,t.jsx)("div",{ref:D,className:"flex h-10 items-center justify-center text-muted-foreground",children:E&&(0,t.jsx)(h.default,{className:"h-4 w-4"})})]})})]})};var H=e.i(167559),V=e.i(143100),$=e.i(296202),z=e.i(45124);let q=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return Object.assign(Error(t),{code:e})},W=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,a=new AbortController,r=!1,s=()=>a.abort(i?.reason);i?.aborted?s():i?.addEventListener("abort",s,{once:!0});let o=setTimeout(()=>{r=!0,a.abort()},15e4);try{let i=await fetch("/api/git/commit",{method:"POST",headers:{"Content-Type":"application/json"},signal:a.signal,body:JSON.stringify({session:e,action:t,...n})});if([408,504].includes(i.status))throw q("commit"===t?"commitUnknown":"generate"===t?"generateTimeout":"requestTimeout");let r=await i.json().catch(e=>{if(a.signal.aborted||!(e instanceof SyntaxError))throw e;return null});if(!i.ok){if(r&&"string"==typeof r.error)throw Object.assign(Error(r.error),{code:"string"==typeof r.code?r.code:void 0});throw q("commit"===t?"commitUnknown":"requestFailed")}if(!r||"object"!=typeof r)throw q("commit"===t?"commitUnknown":"requestFailed");return r}catch(e){if(i?.aborted)throw e;if(r)throw q("commit"===t?"commitUnknown":"generate"===t?"generateTimeout":"requestTimeout");if(e instanceof TypeError)throw q("commit"===t?"commitUnknown":"requestFailed");throw e}finally{clearTimeout(o),i?.removeEventListener("abort",s)}};function Q(e){let{sessionName:a,onClose:r,onCommitted:s}=e,o=(0,i.useTranslations)("diff.commit"),l=(0,H.useLocale)(),[c,d]=(0,n.useState)(null),[u,m]=(0,n.useState)(""),[_,p]=(0,n.useState)(""),[f,h]=(0,n.useState)("inspect"),S=(0,n.useRef)(!1),[b,T]=(0,n.useState)(!1),[y,C]=(0,n.useState)(!1),[N,x]=(0,n.useState)(null),[R,O]=(0,n.useState)(""),[I,A]=(0,n.useState)(null),w=(0,n.useRef)(!0);(0,n.useEffect)(()=>(w.current=!0,()=>{w.current=!1}),[]),(0,n.useEffect)(()=>{let e=new AbortController;return W(a,"inspect",{},e.signal).then(t=>{e.signal.aborted||d(t)}).catch(t=>{e.signal.aborted||x(t)}).finally(()=>{e.signal.aborted||h(null)}),()=>e.abort()},[a]);let D=async()=>{if(!S.current&&!f){S.current=!0,h("generate"),x(null),O(""),T(!1);try{let e=await W(a,"generate",{locale:l});w.current&&(d(e),m(e.title),p(e.body),C(e.truncated))}catch(e){w.current&&x(e)}finally{S.current=!1,w.current&&h(null)}}},L=async()=>{if(!S.current&&!f&&c&&u.trim()&&!I){S.current=!0,h("commit"),x(null),O("");try{let e=await W(a,"commit",{snapshot:c.snapshot,message:{title:u,body:_}});w.current&&(A(e),s())}catch(e){w.current&&(x(e),["changed","noChanges","operation","conflicts","detached","commitUnknown"].includes(e.code??"")&&d(null))}finally{S.current=!1,w.current&&h(null)}}};return(0,t.jsx)($.Dialog,{open:!0,onOpenChange:e=>{e||f||r()},children:(0,t.jsxs)($.DialogContent,{className:"max-h-[85dvh] overflow-y-auto sm:max-w-xl",showCloseButton:!f,children:[(0,t.jsxs)($.DialogHeader,{children:[(0,t.jsx)($.DialogTitle,{children:o("title")}),(0,t.jsx)($.DialogDescription,{children:o("description")})]}),N&&(0,t.jsx)("p",{role:"alert",className:"whitespace-pre-wrap break-all text-sm text-ui-red",children:N.code&&o.has(`errors.${N.code}`)?`${o(`errors.${N.code}`)}${"commitFailed"===N.code?`
|
|
9
|
-
${N.message}`:""}`:N.message}),R&&(0,t.jsx)("p",{role:"status",className:"text-sm",children:R}),
|
|
8
|
+
#${e} [data-state="widget"] {user-select: none}`}else i.current.textContent=""};return iQ.createElement(rJ.Provider,{value:o},iQ.createElement("div",{className:`unified-diff-view ${c?"unified-diff-view-wrap":"unified-diff-view-normal"} w-full`},iQ.createElement("style",{"data-select-style":!0,ref:i}),iQ.createElement("div",{className:"unified-diff-table-wrapper diff-table-scroll-container w-full overflow-x-auto overflow-y-hidden",style:{[rG]:`${Math.round(_)}px`,fontFamily:"Menlo, Consolas, monospace",fontSize:`var(${rB})`}},iQ.createElement("table",{className:`unified-diff-table w-full border-collapse border-spacing-0 ${c?"table-fixed":""}`},iQ.createElement("colgroup",null,iQ.createElement("col",{className:"unified-diff-table-num-col"}),iQ.createElement("col",{className:"unified-diff-table-content-col"})),iQ.createElement("thead",{className:"hidden"},iQ.createElement("tr",null,iQ.createElement("th",{scope:"col"},"line number"),iQ.createElement("th",{scope:"col"},"line content"))),iQ.createElement("tbody",{className:"diff-table-body leading-[1.6]",onMouseDownCapture:e=>{let n=e.target;if(n&&n instanceof HTMLElement&&"BUTTON"===n.nodeName)return void rP();let i=rU(n);if(!i||i===`diff-root${t.getId()}`)for(;n&&n instanceof HTMLElement;){let e=n.getAttribute("data-state");if(e)if("extend"===e||"hunk"===e||"widget"===e){void 0!==a.current&&(a.current=void 0,g(void 0),rP());return}else{a.current!==D.new&&(a.current=D.new,g(D.new),rP());return}n=n.parentElement}}},p.map(e=>iQ.createElement(iQ.Fragment,{key:e.index},iQ.createElement(sO,{index:e.index,lineNumber:e.lineNumber,diffFile:t}),iQ.createElement(sC,{index:e.index,lineNumber:e.lineNumber,diffFile:t,enableWrap:c,enableHighlight:d,enableAddWidget:u}),iQ.createElement(sA,{index:e.index,lineNumber:e.lineNumber,diffFile:t,enableWrap:c}),iQ.createElement(sx,{index:e.index,lineNumber:e.lineNumber,diffFile:t,enableWrap:c}))),iQ.createElement(sO,{index:t.unifiedLineLength,lineNumber:t.unifiedLineLength,diffFile:t}))))))});sw.displayName="DiffUnifiedView",ij.name="@git-diff-view/react";let sD=(0,iQ.memo)(e=>{let{diffFile:t,className:n,style:i,wrapperRef:a,diffViewMode:r,diffViewWrap:s,diffViewFontSize:o,diffViewHighlight:l,renderWidgetLine:c,renderExtendLine:d,extendData:u,diffViewAddWidget:m,onAddWidgetClick:_,onCreateUseWidgetHook:p,isMounted:g}=e,f=(0,iQ.useMemo)(()=>t.getId(),[t]),h=(0,iQ.useMemo)(()=>{let t,n;return t=e,n=f,r_(()=>{var e,i;let a=a5(),r=a5(n),s=a5(t.diffViewMode),o=a5(t.isMounted),l=a5(t.diffViewWrap),c=a5(t.diffViewAddWidget),d=a5(t.diffViewHighlight),u=a5(t.diffViewFontSize),m=a5({oldFile:Object.assign({},null==(e=t.extendData)?void 0:e.oldFile),newFile:Object.assign({},null==(i=t.extendData)?void 0:i.newFile)}),_=a5(t.renderWidgetLine),p=a5(t.renderExtendLine),g=a5(t.onCreateUseWidgetHook),f={current:t.onAddWidgetClick};return{id:r,setId:e=>r.value=e,dom:a,setDom:e=>a.value=e,mode:s,setMode:e=>s.value=e,mounted:o,setMounted:e=>o.value=e,enableWrap:l,setEnableWrap:e=>l.value=e,enableAddWidget:c,setEnableAddWidget:e=>c.value=e,enableHighlight:d,setEnableHighlight:e=>d.value=e,fontSize:u,setFontSize:e=>u.value=e,extendData:m,setExtendData:e=>{let t=Object.keys(m.value.oldFile||{}),n=Object.keys(e.oldFile||{});for(let e of t)n.includes(e)||delete m.value.oldFile[e];for(let t of n)m.value.oldFile[t]=e.oldFile[t];let i=Object.keys(m.value.newFile||{}),a=Object.keys(e.newFile||{});for(let e of i)a.includes(e)||delete m.value.newFile[e];for(let t of a)m.value.newFile[t]=e.newFile[t]},renderWidgetLine:_,setRenderWidgetLine:e=>_.value=e,renderExtendLine:p,setRenderExtendLine:e=>p.value=e,onAddWidgetClick:f,setOnAddWidgetClick:e=>f.current=e.current,onCreateUseWidgetHook:g,setOnCreateUseWidgetHook:e=>g.value=e}})},[]);(0,iQ.useEffect)(()=>{let{id:e,setId:t,mode:n,setMode:i,mounted:a,setMounted:E,enableAddWidget:S,setEnableAddWidget:b,enableHighlight:v,setEnableHighlight:T,enableWrap:y,setEnableWrap:C,setExtendData:N,fontSize:x,setFontSize:R,onAddWidgetClick:O,setOnAddWidgetClick:I,renderExtendLine:A,setRenderExtendLine:w,renderWidgetLine:D,setRenderWidgetLine:L,onCreateUseWidgetHook:M,setOnCreateUseWidgetHook:k}=h.getReadonlyState();f&&f!==e&&t(f),r&&r!==n&&i(r),a!==g&&E(g),m!==S&&b(m),l!==v&&T(l),s!==y&&C(s),u&&N(u),o&&o!==x&&R(o),_!==O.current&&I({current:_}),p!==M&&k(p),d!==A&&w(d),c!==D&&L(c)},[h,o,l,r,s,m,f,g,c,d,u,_,p]),(0,iQ.useEffect)(()=>{h.getReadonlyState().setDom(null==a?void 0:a.current)},[h,a]);let E=(0,iQ.useMemo)(()=>({useDiffContext:h}),[h]);return iQ.createElement(rX.Provider,{value:E},iQ.createElement("div",{className:"diff-tailwindcss-wrapper","data-component":"git-diff-view","data-theme":t._getTheme()||"light","data-version":"0.1.3","data-highlighter":t._getHighlighterName(),ref:a},iQ.createElement("div",{className:"diff-style-root",style:{[rB]:o+"px"}},iQ.createElement("div",{id:g?`diff-root${f}`:void 0,className:"diff-view-wrapper"+(n?` ${n}`:""),style:i},r&eF.Split?iQ.createElement(sb,{diffFile:t}):iQ.createElement(sw,{diffFile:t})))))}),sL=(0,iQ.forwardRef)((e,t)=>{var n,i,a,r;let s,{registerHighlighter:o,data:l,diffViewTheme:c,diffFile:d}=e,u=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,i=Object.getOwnPropertySymbols(e);a<i.length;a++)0>t.indexOf(i[a])&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]]);return n}(e,["registerHighlighter","data","diffViewTheme","diffFile"]),m=(0,iQ.useMemo)(()=>{var e,t,n,i,a,r;if(d){let e=iW.createInstance({});return e._mergeFullBundle(d._getFullBundle()),e}return l?new iW((null==(e=null==l?void 0:l.oldFile)?void 0:e.fileName)||"",(null==(t=null==l?void 0:l.oldFile)?void 0:t.content)||"",(null==(n=null==l?void 0:l.newFile)?void 0:n.fileName)||"",(null==(i=null==l?void 0:l.newFile)?void 0:i.content)||"",(null==l?void 0:l.hunks)||[],(null==(a=null==l?void 0:l.oldFile)?void 0:a.fileLang)||"",(null==(r=null==l?void 0:l.newFile)?void 0:r.fileLang)||""):null},[l,d]),_=(0,iQ.useRef)(m),p=(0,iQ.useRef)();_.current&&_.current!==m&&(null==(i=(n=_.current).clear)||i.call(n),_.current=m);let g=(()=>{let[e,t]=(0,iQ.useState)(!1);return(0,iQ.useEffect)(()=>{t(!0)},[]),e})();return(0,iQ.useEffect)(()=>{if(d&&m)return d._addClonedInstance(m),()=>{d._delClonedInstance(m)}},[m,d]),(0,iQ.useEffect)(()=>{m&&(m.initTheme(c),m.initRaw(),m.buildSplitDiffLines(),m.buildUnifiedDiffLines())},[m,c]),(0,iQ.useEffect)(()=>{m&&e.diffViewHighlight&&(o?(o.name!==m._getHighlighterName()||o.type!==m._getHighlighterType()||"class"!==o.type)&&(m.initSyntax({registerHighlighter:o}),m.notifyAll()):(m._getIsCloned()||m._getHighlighterName()===ic.name)&&"class"===m._getHighlighterType()||(m.initSyntax(),m.notifyAll()))},[m,e.diffViewHighlight,o,c]),(0,iQ.useEffect)(()=>{if(!m)return;let e=()=>{var e,t;null==(e=p.current)||e.setAttribute("data-theme",m._getTheme()||"light"),null==(t=p.current)||t.setAttribute("data-highlighter",m._getHighlighterName())};return e(),m.subscribe(e)},[m,c]),(a=()=>{var e;return null==(e=null==m?void 0:m.clear)?void 0:e.call(m)},r=[m],(s=(0,iQ.useRef)(a)).current=a,(0,iQ.useEffect)(()=>s.current,r),(0,iQ.useImperativeHandle)(t,()=>({getDiffFileInstance:()=>m}),[m]),m)?iQ.createElement(sD,Object.assign({key:m.getId()},u,{diffFile:m,isMounted:g,wrapperRef:p,diffViewTheme:c,diffViewMode:u.diffViewMode||eF.SplitGitHub,diffViewFontSize:u.diffViewFontSize||14})):null});sL.displayName="DiffView",e.s(["DiffModeEnum",0,eF,"DiffView",0,sL],744391)},236495,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(352819),a=e.i(679935),r=e.i(53073),s=e.i(817908),o=e.i(517696),l=e.i(664783),c=e.i(760057),d=e.i(853560),u=e.i(5056),m=e.i(661059),_=e.i(909725),p=e.i(835838),g=e.i(735299),f=e.i(353533),h=e.i(199648),E=e.i(939310),S=e.i(569479),b=e.i(550292),v=e.i(13628),T=e.i(266231),y=e.i(452512),C=e.i(31050),N=e.i(488286),x=e.i(754731),R=e.i(458612),O=e.i(821954),I=e.i(698677),A=e.i(700599),w=e.i(603331),D=e.i(444957),L=e.i(377216),M=e.i(781641),k=e.i(744391),P=e.i(322966);let F=/^diff --git /,U=e=>"/dev/null"===e?"/dev/null":e.replace(/^[ab]\//,""),B={normal:11,large:13,"x-large":15},G=e=>{let{file:a,repoRoot:r,displayName:s,isCollapsed:o,onToggle:l,sessionName:c,oldRef:d,newRef:u,viewMode:m,theme:_,isMobile:p,diffFontSize:g}=e,f=(0,i.useTranslations)("terminal"),h=(0,C.default)(e=>e.editorPreset),E=(0,O.default)(r&&!a.isDeleted?{path:r.replace(/\/$/,"")+"/"+a.newName}:null),S=!a.isBinary&&a.hunks.length>0,b=(0,P.getLang)(s),[v,T]=(0,n.useState)(null),[y,N]=(0,n.useState)(!1),x=a.isNew||"/dev/null"===a.oldName?"":a.oldName,R=a.isDeleted||"/dev/null"===a.newName?"":a.newName;(0,n.useEffect)(()=>{if(o||y||!S||!x&&!R)return;let e=new AbortController,t=new URLSearchParams({session:c,oldRef:d,newRef:u});return x&&t.set("oldPath",x),R&&t.set("newPath",R),fetch(`/api/layout/file-content?${t.toString()}`,{signal:e.signal}).then(e=>e.ok?e.json():null).then(e=>{N(!0),!e||e.truncated||e.binary||T({oldContent:e.oldContent,newContent:e.newContent})}).catch(e=>{"AbortError"!==e.name&&N(!0)}),()=>e.abort()},[o,y,S,c,d,u,x,R]);let w=(0,n.useMemo)(()=>{var e;return S?{oldFile:{fileName:a.oldName,fileLang:b,content:v?.oldContent},newFile:{fileName:a.newName,fileLang:b,content:v?.newContent},hunks:[0===(e=a).hunks.length?"":[e.oldHeaderLine||`--- a/${e.oldName||e.newName}`,e.newHeaderLine||`+++ b/${e.newName||e.oldName}`,...e.hunks].join("\n")]}:null},[S,a,b,v]);return(0,t.jsxs)("div",{className:"overflow-hidden rounded border border-border bg-card",children:[(0,t.jsxs)("div",{className:"sticky top-0 z-10 flex items-center border-b border-border bg-secondary",children:[(0,t.jsxs)("button",{type:"button",onClick:l,"aria-expanded":!o,className:"flex min-w-0 flex-1 items-center gap-2 px-3 py-1.5 text-left hover:bg-accent",children:[o?(0,t.jsx)(L.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(D.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:s}),a.isNew&&(0,t.jsx)("span",{className:"rounded bg-ui-teal/15 px-1 text-[10px] text-ui-teal",children:"NEW"}),a.isDeleted&&(0,t.jsx)("span",{className:"rounded bg-ui-red/15 px-1 text-[10px] text-ui-red",children:"DEL"}),a.isRenamed&&(0,t.jsx)("span",{className:"rounded bg-ui-blue/15 px-1 text-[10px] text-ui-blue",children:"RENAME"}),(0,t.jsxs)("span",{className:"ml-auto flex items-center gap-2 text-[11px]",children:[a.additions>0&&(0,t.jsxs)("span",{className:"text-ui-teal",children:["+",a.additions]}),a.deletions>0&&(0,t.jsxs)("span",{className:"text-ui-red",children:["-",a.deletions]})]})]}),E&&(0,t.jsx)("button",{type:"button",className:"shrink-0 p-2 text-muted-foreground hover:text-foreground",title:f("openEditor"),"aria-label":f("openEditor")+": "+s,onClick:()=>(0,I.openEditorTarget)(E),children:(0,t.jsx)(A.EditorIcon,{preset:h,className:"h-3.5 w-3.5"})})]}),!o&&(w?(0,t.jsx)(k.DiffView,{data:w,diffViewMode:"unified"===m?k.DiffModeEnum.Unified:k.DiffModeEnum.Split,diffViewTheme:_,diffViewHighlight:!0,diffViewWrap:p,diffViewFontSize:g}):(0,t.jsx)("div",{className:"px-3 py-2 text-muted-foreground",children:a.isBinary?"Binary file":"No diff content"}))]})},j=e=>{let{diff:i,viewMode:a,sessionName:r,repoRoot:s,oldRef:o="HEAD",newRef:l="WORKTREE"}=e,{resolvedTheme:c}=(0,w.useTheme)(),d="light"===c?"light":"dark",u=(0,T.default)(),m=B[(0,C.default)(e=>e.fontSize)]??B.normal,[_,p]=(0,n.useState)(()=>new Set),g=(0,n.useCallback)(e=>{p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),f=(0,n.useMemo)(()=>i?(e=>{if(!e.trim())return[];let t=e.split("\n"),n=[],i=null,a=null,r=!1,s=()=>{i&&a&&i.hunks.push(a.join("\n")),a=null},o=()=>{s(),i&&n.push(i),i=null,r=!1};for(let e of t){if(F.test(e)){o(),i={oldName:"",newName:"",oldHeaderLine:"",newHeaderLine:"",hunks:[],additions:0,deletions:0,isBinary:!1,isNew:!1,isDeleted:!1,isRenamed:!1};continue}if(i){if(!r){e.startsWith("@@")?(r=!0,a=[e]):e.startsWith("--- ")?(i.oldHeaderLine=e,i.oldName=U(e.slice(4).trim())):e.startsWith("+++ ")?(i.newHeaderLine=e,i.newName=U(e.slice(4).trim())):e.startsWith("new file")?i.isNew=!0:e.startsWith("deleted file")?i.isDeleted=!0:e.startsWith("rename from")||e.startsWith("rename to")?i.isRenamed=!0:e.startsWith("Binary files")&&(i.isBinary=!0);continue}if(e.startsWith("@@")){s(),a=[e];continue}a&&(a.push(e),e.startsWith("+")&&!e.startsWith("+++")?i.additions+=1:e.startsWith("-")&&!e.startsWith("---")&&(i.deletions+=1))}}return o(),n})(i).map(e=>{let t=e.newName&&"/dev/null"!==e.newName?e.newName:e.oldName&&"/dev/null"!==e.oldName?e.oldName:"file";return{key:JSON.stringify([s,o,l,e.oldName,e.newName]),source:e,displayName:t}}):[],[i,s,o,l]),h=(0,n.useMemo)(()=>{let e=0,t=0;for(let n of f)e+=n.source.additions,t+=n.source.deletions;return{files:f.length,add:e,del:t}},[f]),E=u?"unified":a;return 0===f.length?null:(0,t.jsxs)("div",{className:"flex flex-col gap-2 p-2 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-1 text-[11px] text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(M.FileText,{className:"h-3 w-3"}),h.files]}),h.add>0&&(0,t.jsxs)("span",{className:"text-ui-teal",children:["+",h.add]}),h.del>0&&(0,t.jsxs)("span",{className:"text-ui-red",children:["-",h.del]})]}),f.map(e=>{let n=`${e.source.hunks.length}:${e.source.additions}:${e.source.deletions}`;return(0,t.jsx)(G,{file:e.source,repoRoot:s,displayName:e.displayName,isCollapsed:!_.has(e.key),onToggle:()=>g(e.key),sessionName:r,oldRef:o,newRef:l,viewMode:E,theme:d,isMobile:u,diffFontSize:m},`${e.key}@${n}`)})]})},Y=e=>{let{sessionName:a,refreshToken:r,viewMode:o,repoRoot:l}=e,c=(0,i.useTranslations)("diff"),[d,u]=(0,n.useState)([]),[m,_]=(0,n.useState)(null),[p,g]=(0,n.useState)(!0),[E,S]=(0,n.useState)(!1),[b,v]=(0,n.useState)(!0),[T,y]=(0,n.useState)(null),[C,O]=(0,n.useState)(null),[I,A]=(0,n.useState)(!1),w=(0,n.useRef)(null),D=(0,n.useRef)(null),L=(0,n.useCallback)(async(e,t)=>{let n=await fetch(`/api/layout/git-log?session=${a}&limit=50&skip=${e}`,{signal:t});return n.ok?n.json():null},[a]);(0,n.useEffect)(()=>{let e=new AbortController;return g(!0),L(0,e.signal).then(t=>{if(e.signal.aborted)return;if(!t){u([]),_(null),v(!1);return}let n=t.commits??[];u(n),_(t.upstreamHash??null),v(n.length>=50)}).catch(e=>{"AbortError"!==e.name&&(u([]),v(!1))}).finally(()=>{e.signal.aborted||g(!1)}),()=>e.abort()},[L,r]);let M=(0,n.useCallback)(async()=>{if(E||!b||p)return;S(!0);let e=new AbortController;try{let t=await L(d.length,e.signal);if(e.signal.aborted)return;if(!t)return void v(!1);let n=t.commits??[];u(e=>[...e,...n]),v(n.length>=50)}catch(e){"AbortError"!==e.name&&v(!1)}finally{S(!1)}},[d.length,L,b,p,E]);(0,n.useEffect)(()=>{let e=w.current,t=D.current;if(!e||!t)return;let n=new IntersectionObserver(e=>{e[0].isIntersecting&&M()},{root:e,rootMargin:"200px"});return n.observe(t),()=>n.disconnect()},[M]),(0,n.useEffect)(()=>{if(!T)return void O(null);let e=new AbortController;return A(!0),fetch(`/api/layout/commit-diff?session=${a}&hash=${T}`,{signal:e.signal}).then(e=>e.ok?e.json():null).then(t=>{e.signal.aborted||O(t)}).catch(e=>{"AbortError"!==e.name&&O(null)}).finally(()=>{e.signal.aborted||A(!1)}),()=>e.abort()},[a,T,r]);let k=(0,n.useMemo)(()=>{if(!m)return new Set;let e=new Set;for(let t of d){if(t.hash===m)break;e.add(t.hash)}return e},[d,m]);return(0,t.jsxs)("div",{className:"relative h-full",children:[T&&(0,t.jsxs)("div",{className:"absolute inset-0 z-10 flex flex-col bg-card",children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>y(null),className:"flex h-6 items-center gap-1 rounded px-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-foreground",title:c("back"),children:[(0,t.jsx)(N.ArrowLeft,{className:"h-3.5 w-3.5"}),c("back")]}),C&&(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 text-[11px]",children:[(0,t.jsx)("span",{className:"shrink-0 font-mono text-ui-purple",children:C.commit.shortHash}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground",children:"·"}),(0,t.jsx)("span",{className:"truncate text-foreground",title:C.commit.subject,children:C.commit.subject}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground",children:"·"}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground",title:C.commit.email,children:C.commit.author}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground",children:"·"}),(0,t.jsx)("span",{className:"shrink-0 tabular-nums text-muted-foreground",title:(0,R.absoluteTime)(C.commit.timestamp),children:(0,R.compactFromNow)(C.commit.timestamp)})]})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:I&&!C?(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)(h.default,{className:"h-5 w-5 text-muted-foreground"})}):C?C.diff?(0,t.jsx)(j,{repoRoot:l,diff:C.diff,viewMode:o,sessionName:a,oldRef:C.commit.parents[0]??"HEAD",newRef:C.commit.hash}):(0,t.jsx)("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:c("noChanges")}):(0,t.jsx)("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:c("commitNotFound")})})]}),(0,t.jsx)("div",{ref:w,className:"h-full overflow-auto",children:p?(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)(h.default,{className:"h-5 w-5 text-muted-foreground"})}):0===d.length?(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 text-muted-foreground",children:[(0,t.jsx)(s.GitBranch,{className:"h-10 w-10 opacity-20"}),(0,t.jsx)("span",{className:"text-sm",children:c("noCommits")})]})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex flex-col px-2 py-1 font-mono text-xs",children:d.map((e,n)=>{let i=0===n,a=k.has(e.hash),r=n===d.length-1;return(0,t.jsxs)("button",{type:"button",onClick:()=>y(e.hash),className:"group relative flex items-start gap-2 rounded px-2 py-1 text-left hover:bg-accent/40",children:[(0,t.jsxs)("div",{className:"relative flex w-4 shrink-0 flex-col items-center",children:[e.isMerge?(0,t.jsx)(x.GitMerge,{className:(0,f.cn)("mt-[3px] h-3 w-3",a?"text-ui-blue":"text-foreground/70")}):(0,t.jsx)("span",{className:(0,f.cn)("mt-[6px] h-1.5 w-1.5 rounded-full",a?"bg-ui-blue":"bg-foreground/50")}),!r&&(0,t.jsx)("span",{className:"mt-[2px] flex-1 border-l border-border"})]}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-baseline gap-2",children:[(0,t.jsx)("span",{className:"shrink-0 text-ui-purple",children:e.shortHash}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",title:e.subject,children:e.subject}),i&&(0,t.jsx)("span",{className:"shrink-0 rounded bg-accent px-1 text-[10px] text-foreground",children:"HEAD"}),a&&!i&&(0,t.jsx)("span",{className:"shrink-0 rounded bg-ui-blue/15 px-1 text-[10px] text-ui-blue",children:c("ahead")}),(0,t.jsx)("span",{className:"w-8 shrink-0 text-right tabular-nums text-muted-foreground",title:(0,R.absoluteTime)(e.timestamp),children:(0,R.compactFromNow)(e.timestamp)})]})]},e.hash)})}),b&&(0,t.jsx)("div",{ref:D,className:"flex h-10 items-center justify-center text-muted-foreground",children:E&&(0,t.jsx)(h.default,{className:"h-4 w-4"})})]})})]})};var H=e.i(167559),V=e.i(143100),$=e.i(48500),z=e.i(296202),q=e.i(45124);let W=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return Object.assign(Error(t),{code:e})},Q=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,a=new AbortController,r=!1,s=()=>a.abort(i?.reason);i?.aborted?s():i?.addEventListener("abort",s,{once:!0});let o=setTimeout(()=>{r=!0,a.abort()},15e4);try{let i=await fetch("/api/git/commit",{method:"POST",headers:{"Content-Type":"application/json"},signal:a.signal,body:JSON.stringify({session:e,action:t,...n})});if([408,504].includes(i.status))throw W("commit"===t?"commitUnknown":"generate"===t?"generateTimeout":"requestTimeout");let r=await i.json().catch(e=>{if(a.signal.aborted||!(e instanceof SyntaxError))throw e;return null});if(!i.ok){if(r&&"string"==typeof r.error)throw Object.assign(Error(r.error),{code:"string"==typeof r.code?r.code:void 0});throw W("commit"===t?"commitUnknown":"requestFailed")}if(!r||"object"!=typeof r)throw W("commit"===t?"commitUnknown":"requestFailed");return r}catch(e){if(i?.aborted)throw e;if(r)throw W("commit"===t?"commitUnknown":"generate"===t?"generateTimeout":"requestTimeout");if(e instanceof TypeError)throw W("commit"===t?"commitUnknown":"requestFailed");throw e}finally{clearTimeout(o),i?.removeEventListener("abort",s)}};var K=e.i(490034),X=e.i(917138),Z=e.i(428533);function J(e){let{sessionName:a,directory:r,branch:s,head:o,onBusy:l}=e,c=(0,i.useTranslations)("diff.commit"),d=(0,K.default)(e=>e.workspaces).find(e=>a.startsWith(`pt-${e.id}-pane-`)),[u,m]=(0,n.useState)(null),[_,p]=(0,n.useState)(""),[g,f]=(0,n.useState)(!0),[h,E]=(0,n.useState)(0);return(0,n.useEffect)(()=>{if(!d){p(c("deliveryUnavailable")),f(!1);return}let e=new AbortController;return(async()=>{f(!0);try{let t=await fetch(`/api/workspace/worktrees?workspaceId=${encodeURIComponent(d.id)}`,{signal:e.signal}),n=await t.json();if(!t.ok)throw Error(n.error);let i=n.repositories.find(e=>e.worktrees.some(e=>e.directory===r&&e.workspaces.some(e=>e.id===d.id))),a=i?.worktrees.find(e=>e.directory===r&&e.workspaces.some(e=>e.id===d.id));if(!i||!a||a.head!==o||a.branch!==s)throw Error(c("deliveryUnavailable"));let l={repositoryId:i.id,directory:a.directory,head:a.head,branch:a.branch},u=await (0,X.requestWorktreeAction)(d.id,"inspectSync",{item:l},e.signal);if(u.head!==o||u.branch!==s)throw Error(c("deliveryUnavailable"));e.signal.aborted||(m({item:l,info:u}),p(""))}catch(t){e.signal.aborted||(m(null),p(t instanceof Error?t.message:String(t)))}finally{e.signal.aborted||f(!1)}})(),()=>e.abort()},[d,r,s,o,h,c]),(0,t.jsxs)("section",{className:"min-w-0 border-t pt-3",children:[(0,t.jsx)("h3",{className:"font-medium",children:c("deliveryNext")}),(0,t.jsx)("p",{className:"mt-1 break-all font-mono text-xs text-muted-foreground",children:r}),(0,t.jsxs)("p",{className:"mt-1 break-all text-sm",children:[s," · ",o.slice(0,8)]}),g&&(0,t.jsx)("p",{role:"status",className:"text-sm",children:c("deliveryLoading")}),_&&(0,t.jsx)("p",{role:"alert",className:"break-all text-sm text-muted-foreground",children:_}),u&&d&&(0,t.jsx)(Z.default,{workspaceId:d.id,item:u.item,info:u.info,disabled:g,onBusy:l,onDone:()=>E(e=>e+1)})]})}function ee(e){let{sessionName:a,repository:r,onClose:s,onCommitted:o}=e,l=(0,i.useTranslations)("diff.commit"),c=(0,H.useLocale)(),[d,u]=(0,n.useState)(null),[m,_]=(0,n.useState)(""),[p,g]=(0,n.useState)(""),[f,h]=(0,n.useState)("inspect"),S=(0,n.useRef)(!1),[b,T]=(0,n.useState)(!1),[y,C]=(0,n.useState)(!1),[N,x]=(0,n.useState)(null),[R,O]=(0,n.useState)(""),[I,A]=(0,n.useState)(null),[w,D]=(0,n.useState)(!1),[L,M]=(0,n.useState)(!1),k=(0,n.useRef)(!0);(0,n.useEffect)(()=>(k.current=!0,()=>{k.current=!1}),[]),(0,n.useEffect)(()=>{let e=new AbortController;return Q(a,"inspect",{},e.signal).then(t=>{e.signal.aborted||u(t)}).catch(t=>{e.signal.aborted||("noChanges"===t.code&&r?M(!0):x(t))}).finally(()=>{e.signal.aborted||h(null)}),()=>e.abort()},[a,r]);let P=async()=>{if(!S.current&&!f){S.current=!0,h("generate"),x(null),O(""),T(!1);try{let e=await Q(a,"generate",{locale:c});k.current&&(u(e),_(e.title),g(e.body),C(e.truncated))}catch(e){k.current&&x(e)}finally{S.current=!1,k.current&&h(null)}}},F=async()=>{if(!S.current&&!f&&d&&m.trim()&&!I){S.current=!0,h("commit"),x(null),O("");try{let e=await Q(a,"commit",{snapshot:d.snapshot,message:{title:m,body:p}});k.current&&(A(e),o())}catch(e){k.current&&(x(e),["changed","noChanges","operation","conflicts","detached","commitUnknown"].includes(e.code??"")&&u(null))}finally{S.current=!1,k.current&&h(null)}}};return(0,t.jsx)(z.Dialog,{open:!0,onOpenChange:e=>{e||f||w||s()},children:(0,t.jsxs)(z.DialogContent,{className:"max-h-[85dvh] overflow-y-auto sm:max-w-xl",showCloseButton:!f&&!w,children:[(0,t.jsxs)(z.DialogHeader,{children:[(0,t.jsx)(z.DialogTitle,{children:l("workflowTitle")}),(0,t.jsx)(z.DialogDescription,{children:l("workflowDescription")})]}),N&&(0,t.jsx)("p",{role:"alert",className:"whitespace-pre-wrap break-all text-sm text-ui-red",children:N.code&&l.has(`errors.${N.code}`)?`${l(`errors.${N.code}`)}${"commitFailed"===N.code?`
|
|
9
|
+
${N.message}`:""}`:N.message}),R&&(0,t.jsx)("p",{role:"status",className:"text-sm",children:R}),d&&(0,t.jsxs)("div",{className:"min-w-0 rounded border p-3 text-sm",children:[(0,t.jsx)("p",{className:"break-all font-mono text-xs",children:d.snapshot.directory}),(0,t.jsxs)("p",{className:"mt-1 break-all",children:[l("branch"),": ",d.snapshot.branch.replace(/^refs\/heads\//,"")]}),(0,t.jsxs)("details",{className:"mt-2",children:[(0,t.jsx)("summary",{children:l("changedFiles",{count:d.files.length})}),(0,t.jsx)("ul",{className:"mt-2 max-h-32 overflow-auto text-xs",children:d.files.map(e=>(0,t.jsx)("li",{className:"break-all font-mono",children:e},e))})]})]}),f&&(0,t.jsxs)("p",{role:"status",className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(V.Loader2,{className:"size-4 animate-spin"}),l("inspect"===f?"loading":"generate"===f?"generating":"committing")]}),y&&(0,t.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:l("truncated")}),I?(0,t.jsxs)("div",{role:"status",className:"rounded border p-3 text-sm",children:[(0,t.jsx)("p",{children:l("success",{hash:I.head.slice(0,8)})}),I.warning&&(0,t.jsx)("p",{role:"alert",className:"mt-2",children:l(`errors.${I.warning}`)}),I.output&&(0,t.jsx)("pre",{className:"mt-2 max-h-32 overflow-auto whitespace-pre-wrap break-all text-xs",children:I.output})]}):L?(0,t.jsx)("p",{role:"status",className:"text-sm",children:l("cleanPublish")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-sm",children:[l("subject"),(0,t.jsx)(q.Input,{value:m,maxLength:200,disabled:!!f,onChange:e=>_(e.target.value)})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-sm",children:[l("body"),(0,t.jsx)("textarea",{className:"min-h-32 rounded border bg-background p-2",value:p,maxLength:2e4,disabled:!!f,onChange:e=>g(e.target.value)})]}),b&&(0,t.jsxs)("div",{className:"rounded border p-3 text-sm",children:[(0,t.jsx)("p",{children:l("replaceConfirm")}),(0,t.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,t.jsx)(E.Button,{variant:"outline",disabled:!!f,onClick:()=>T(!1),children:l("cancel")}),(0,t.jsx)(E.Button,{disabled:!!f,onClick:()=>void P(),children:l("generate")})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(E.Button,{variant:"outline",disabled:!!f,onClick:()=>{m.trim()||p.trim()?T(!0):P()},children:[(0,t.jsx)($.WandSparkles,{className:"size-4"}),l("generate")]}),(0,t.jsx)(E.Button,{variant:"outline",disabled:!!f||!m.trim(),onClick:async()=>O(l(await (0,v.copyToClipboard)(`${m.trim()}${p.trim()?`
|
|
10
10
|
|
|
11
|
-
${
|
|
11
|
+
${p.trim()}`:""}`)?"copied":"copyFailed")),children:l("copy")}),(0,t.jsx)(E.Button,{disabled:!!f||!d||!m.trim(),onClick:()=>void F(),children:l("adoptAndCommit")})]})]}),I&&d&&(0,t.jsx)(J,{sessionName:a,directory:d.snapshot.directory,branch:d.snapshot.branch.replace(/^refs\/heads\//,""),head:I.head,onBusy:D}),L&&r&&(0,t.jsx)(J,{sessionName:a,directory:r.directory,branch:r.branch,head:r.head,onBusy:D}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(E.Button,{variant:"outline",disabled:!!f||w,onClick:s,children:l("close")})})]})})}let et=/^\/Users\/[^/]+(?=\/|$)/,en={"no-upstream":"syncErrorNoUpstream",auth:"syncErrorAuth",diverged:"syncErrorDiverged",rejected:"syncErrorRejected","local-changes":"syncErrorLocalChanges",timeout:"syncErrorTimeout",unknown:"syncErrorGeneric"},ei={"no-upstream":"agentPromptNoUpstream",auth:"agentPromptAuth",diverged:"agentPromptDiverged",rejected:"agentPromptRejected","local-changes":"agentPromptLocalChanges",timeout:"agentPromptTimeout",unknown:"agentPromptGeneric"};e.s(["default",0,e=>{let N,{sessionName:x,onSendToAgent:R,onClose:O,settings:I,onSettingsChange:A}=e,w=(0,i.useTranslations)("diff"),D=(0,i.useTranslations)("terminal"),L=(0,T.default)(),M=(0,C.default)(e=>e.gitAskProvider),[k,P]=(0,n.useState)(""),[F,U]=(0,n.useState)(null),[B,G]=(0,n.useState)(!0),[H,V]=(0,n.useState)(!1),[$,z]=(0,n.useState)(0),[q,W]=(0,n.useState)(0),[Q,K]=(0,n.useState)(""),[X,Z]=(0,n.useState)(null),[J,ea]=(0,n.useState)(!1),[er,es]=(0,n.useState)(0),[eo,el]=(0,n.useState)(null),[ec,ed]=(0,n.useState)(""),[eu,em]=(0,y.default)(),e_=I?.activeTab??"changes",[ep,eg]=(0,n.useState)(0),[ef,eh]=(0,n.useState)(!1),[eE,eS]=(0,n.useState)(!1),[eb,ev]=(0,n.useState)(),eT=(0,n.useRef)(0),ey=(0,n.useRef)(""),eC=(0,n.useRef)(0),eN=(0,n.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};G(!0),V(!1);try{let t=new URLSearchParams({session:x});e.remoteFetch&&t.set("fetch","true");let n=await fetch(`/api/layout/diff?${t}`);if(!n.ok)return;let i=await n.json();U(i.isGitRepo),i.isGitRepo&&(P(i.diff??""),z(i.ahead??0),W(i.behind??0),K(i.branch??""),Z(i.upstream??null),ea(!!i.isDetached),es(i.stash??0),el(i.headCommit??null),ed(i.repoRoot??""),ey.current=i.hash??"",i.fetched&&(eC.current=Date.now()))}finally{G(!1)}},[x]),ex=(0,n.useCallback)(async()=>{let e=Date.now()-eC.current>=18e4;try{let t=new URLSearchParams({session:x,hashOnly:"true"});e&&t.set("fetch","true");let n=await fetch(`/api/layout/diff?${t}`);if(!n.ok)return;let i=await n.json();if(!i.isGitRepo)return;i.fetched&&(eC.current=Date.now()),z(i.ahead??0),W(i.behind??0),i.hash&&i.hash!==ey.current&&V(!0)}catch{}},[x]),eR=(0,n.useCallback)(()=>{eN({remoteFetch:!0}),eg(e=>e+1)},[eN]),eO=(0,n.useCallback)(e=>{A?.({activeTab:e})},[A]),eI=(0,n.useCallback)(async()=>{if(!ef){eh(!0);try{let e=await fetch(`/api/git/sync?session=${x}`,{method:"POST"}),t=await e.json();if(!e.ok)return void a.toast.error(w("syncErrorGeneric"));if(t.ok){let{pulled:e,pushed:n}=t.summary??{pulled:0,pushed:0};if(0===e&&0===n)a.toast.success(w("syncUpToDate"));else{let t=[];e>0&&t.push(`↓${e}`),n>0&&t.push(`↑${n}`),a.toast.success(`${w("syncSuccess")} \xb7 ${t.join(" ")}`)}}else{let e=t.errorKind??"unknown",n=en[e],i=t.steps?.find(e=>!e.ok&&!e.skipped),r=i?.stderr??i?.stdout??"";a.toast.error(w(n),{duration:15e3,action:R?{label:w("codex"===M?"askCodex":"askClaude"),onClick:()=>{let n=ei[e],i=w(n,{branch:Q||"HEAD",upstream:t.upstream??""}),a=r.length>800?r.slice(0,800)+"\n...(truncated)":r,s=a?`${i}
|
|
12
12
|
|
|
13
13
|
\`\`\`
|
|
14
14
|
${a.trim()}
|
|
15
|
-
\`\`\``:i;R(s,M)}}:void 0})}ey(),eg(e=>e+1)}catch{a.toast.error(w("syncErrorGeneric"))}finally{eh(!1)}}},[x,ef,w,ey,R,M,J]),eO=(0,n.useCallback)(async()=>{ec&&(await (0,v.copyToClipboard)(ec)?a.toast.success(D("copyPaneSuccess"),{duration:1500}):a.toast.error(D("copyPaneCopyFailed")))},[ec,D]);if((0,n.useEffect)(()=>{ey().then(()=>eC())},[ey,eC]),(0,n.useEffect)(()=>{if(!1===F)return;eb.current=window.setInterval(eC,1e4);let e=()=>{"visible"===document.visibilityState&&eC()};return document.addEventListener("visibilitychange",e),()=>{window.clearInterval(eb.current),document.removeEventListener("visibilitychange",e)}},[F,eC]),B&&null===F)return(0,t.jsx)("div",{className:"flex h-full items-center justify-center bg-card",children:(0,t.jsx)(h.default,{className:"h-5 w-5 text-muted-foreground"})});if(!1===F)return(0,t.jsx)("div",{className:"flex h-full items-center justify-center bg-card",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 text-muted-foreground",children:[(0,t.jsx)(s.GitBranch,{className:"h-10 w-10 opacity-20"}),(0,t.jsx)("span",{className:"text-sm",children:w("notGitRepo")})]})});let eI=ei&&eo?`(detached @ ${eo.shortHash})`:J||"—",eA=$>0||q>0,ew=q>0&&0===$?d.ArrowDown:$>0&&0===q?c.ArrowUp:u.ArrowDownUp,eD=[q>0?`↓${q}`:"",$>0?`↑${$}`:""].filter(Boolean).join(" "),eL=ef?w("syncing"):eA?`${w("sync")} \xb7 ${eD}`:w("sync"),eM=ec?(N=ec.split("/").filter(Boolean))[N.length-1]||ec:"",ek=ec?(e=>{let t=e.replace(K,"~"),n=t.split("/").filter(Boolean),i=t.startsWith("~/"),a=t.startsWith("/");if(n.length<=4)return t;let r=i?n.slice(0,2).join("/"):a?`/${n[0]}`:n[0];return`${r}/.../${n.slice(-2).join("/")}`})(ec):"";return(0,t.jsxs)("div",{className:"flex h-full flex-col bg-card",children:[(0,t.jsxs)("div",{className:"flex shrink-0 flex-col border-b border-border",children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-2 py-1.5",children:[(0,t.jsx)(b.Tabs,{value:e_,onValueChange:e=>ex(e),className:"gap-0",children:(0,t.jsxs)(b.TabsList,{className:"h-7 w-auto min-w-40",children:[(0,t.jsx)(b.TabsTrigger,{value:"changes",className:"relative h-full flex-1 px-2.5 text-[11px] tracking-wide",children:w("tabChanges").toUpperCase()}),(0,t.jsx)(b.TabsTrigger,{value:"history",className:"relative h-full flex-1 px-2.5 text-[11px] tracking-wide",children:w("tabHistory").toUpperCase()})]})}),(0,t.jsx)(S.TooltipProvider,{children:(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:["changes"===e_&&(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(E.Button,{type:"button",variant:"ghost",size:"icon-sm",className:"h-7 w-7 text-muted-foreground"}),disabled:ef||B||ei,onClick:()=>eS(!0),"aria-label":w("commit.title"),children:(0,t.jsx)(g.WandSparkles,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:w("commit.title")})]}),"changes"===e_&&!L&&(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(E.Button,{type:"button",variant:"ghost",size:"icon-sm",className:"h-7 w-7 text-muted-foreground"}),onClick:()=>em("split"===eu?"unified":"split"),"aria-label":"split"===eu?w("lineByLine"):w("sideBySide"),children:"split"===eu?(0,t.jsx)(l.Rows2,{className:"h-3.5 w-3.5"}):(0,t.jsx)(o.Columns2,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"split"===eu?w("lineByLine"):w("sideBySide")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsxs)(S.TooltipTrigger,{render:(0,t.jsx)(E.Button,{type:"button",variant:"ghost",size:eA?"sm":"icon-sm",className:(0,f.cn)("h-7",eA?"px-2":"w-7 px-0",eA&&!ef?"bg-ui-blue/10 text-ui-blue hover:bg-ui-blue/15 hover:text-ui-blue":"text-muted-foreground")}),className:(0,f.cn)("disabled:opacity-50"),onClick:eR,disabled:ef||B,"aria-label":eL,children:[ef?(0,t.jsx)(h.default,{className:"h-3.5 w-3.5"}):(0,t.jsx)(ew,{className:"h-3.5 w-3.5"}),eA&&!ef&&(0,t.jsx)("span",{className:"font-mono text-[11px] leading-none",children:eD})]}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:eL})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsxs)(S.TooltipTrigger,{render:(0,t.jsx)(E.Button,{type:"button",variant:"ghost",size:"icon-sm",className:(0,f.cn)("h-7 w-7",H&&"changes"===e_?"bg-ui-blue/10 text-ui-blue hover:bg-ui-blue/15 hover:text-ui-blue":"text-muted-foreground")}),className:(0,f.cn)("relative disabled:opacity-50"),onClick:eN,disabled:B,"aria-label":w("refresh"),children:[(0,t.jsx)(r.RefreshCw,{className:(0,f.cn)("h-3.5 w-3.5",B&&"animate-spin")}),H&&"changes"===e_&&(0,t.jsx)("span",{className:"absolute right-1 top-1 h-1.5 w-1.5 rounded-full bg-ui-blue"})]}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:H&&"changes"===e_?`${w("hasChanges")} \xb7 ${w("refresh")}`:w("refresh")})]}),O&&(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(E.Button,{type:"button",variant:"ghost",size:"icon-sm",className:"h-7 w-7 text-muted-foreground"}),onClick:O,"aria-label":"Close Git",children:(0,t.jsx)(_.X,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"Close"})]})]})})]}),L&&ec&&(0,t.jsxs)("button",{type:"button",className:"flex min-h-8 min-w-0 items-center gap-2 border-b border-border/60 px-3 py-1.5 text-left text-xs text-muted-foreground active:bg-accent/60",onClick:eO,title:ec,"aria-label":ec,children:[(0,t.jsx)(p.Folder,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"min-w-0 truncate font-medium text-foreground",children:eM}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/50",children:"·"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px]",children:ek})]}),(0,t.jsxs)("div",{className:"flex min-h-9 min-w-0 items-center gap-2 px-3 py-2 text-xs",children:[(0,t.jsx)(s.GitBranch,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[(0,t.jsx)("span",{className:"truncate font-medium text-foreground",title:eI,children:eI}),et&&(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground",children:"→"}),et&&(0,t.jsx)("span",{className:"truncate text-muted-foreground",title:et,children:et})]}),($>0||q>0)&&(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-[11px]",children:[$>0&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-ui-blue",title:`${$} commit(s) to push`,children:[(0,t.jsx)(c.ArrowUp,{className:"h-3 w-3"}),$]}),q>0&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-claude-active",title:`${q} commit(s) to pull`,children:[(0,t.jsx)(d.ArrowDown,{className:"h-3 w-3"}),q]})]}),er>0&&(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-0.5 font-mono text-[11px] text-muted-foreground",title:`${er} stash(es)`,children:[(0,t.jsx)(m.Archive,{className:"h-3 w-3"}),er]})]})]}),eE&&(0,t.jsx)(Q,{sessionName:x,onClose:()=>eS(!1),onCommitted:()=>{ey(),eg(e=>e+1)}},x),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:"history"===e_?(0,t.jsx)(Y,{repoRoot:ec,sessionName:x,refreshToken:ep,viewMode:eu}):(0,t.jsxs)(t.Fragment,{children:[!k&&(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 text-muted-foreground",children:[(0,t.jsx)(s.GitBranch,{className:"h-10 w-10 opacity-20"}),(0,t.jsx)("span",{className:"text-sm",children:w("noChanges")})]})}),k&&(0,t.jsx)(j,{repoRoot:ec,diff:k,viewMode:eu,sessionName:x})]})})]})}],236495)},355327,635255,e=>{"use strict";var t=e.i(191788),n=e.i(745725),i=e.i(405334);let a=()=>!("u"<typeof document)&&"visible"===document.visibilityState&&window.matchMedia("(max-width: 768px), (pointer: coarse)").matches;e.s(["reloadForReconnectRecovery",0,e=>{try{sessionStorage.setItem("pmux-ws-hard-reload:reason",e)}catch{}window.location.reload()},"shouldPromptMobileReloadRecovery",0,a],635255);let r=[1e3,2e3,4e3,8e3,16e3];e.s(["default",0,function(){let{onData:e,onStdin:s,onConnected:o,onSessionEnded:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[c,d]=(0,t.useState)("disconnected"),[u,m]=(0,t.useState)(0),[_,p]=(0,t.useState)(null),g=(0,t.useRef)(null),f=(0,t.useRef)(null),h=(0,t.useRef)(null),E=(0,t.useRef)(0),S=(0,t.useRef)(""),b=(0,t.useRef)(0),v=(0,t.useRef)(null),T=(0,t.useRef)({onData:e,onStdin:s,onConnected:o,onSessionEnded:l}),y=(0,t.useRef)(()=>{});(0,t.useEffect)(()=>{T.current={onData:e,onStdin:s,onConnected:o,onSessionEnded:l}},[e,s,o,l]);let C=(0,t.useCallback)(()=>{f.current&&(clearInterval(f.current),f.current=null),h.current&&(clearTimeout(h.current),h.current=null)},[]),N=(0,t.useCallback)((e,t)=>{C(),g.current&&(g.current.close(),g.current=null),p(null),d(E.current>0?"reconnecting":"connecting");let s="https:"===location.protocol?"wss:":"ws:",o=(e=>{let t=`pt-ws-cid-${e}`;try{let e=sessionStorage.getItem(t);if(e)return e;let i=(0,n.nanoid)();return sessionStorage.setItem(t,i),i}catch{return(0,n.nanoid)()}})(e),l=v.current,c=l?`&cols=${l.cols}&rows=${l.rows}`:"",u=new WebSocket(`${s}//${location.host}/api/terminal?clientId=${o}&session=${e}&flowControl=1${c}`);u.binaryType="arraybuffer",g.current=u,u.onopen=()=>{b.current===t&&g.current===u&&(d("connected"),E.current=0,m(0),T.current.onConnected?.(),f.current=setInterval(()=>{u.readyState===WebSocket.OPEN&&u.send((0,i.encodeHeartbeat)())},3e4))},u.onmessage=e=>{if(b.current!==t||g.current!==u)return;let{type:n,payload:a}=(0,i.decodeMessage)(e.data);switch(n){case i.MSG_STDOUT:{let e=!1;T.current.onData?.(a,n=>{if(!e&&g.current===u&&b.current===t&&u.readyState===WebSocket.OPEN){if(e=!0,n)return void u.close(4e3,"Terminal output processing failed");try{u.send((0,i.encodeStdoutAck)(a.byteLength))}catch{u.close(4e3,"Terminal output acknowledgement failed")}}})}case i.MSG_HEARTBEAT:}},u.onclose=e=>{if(b.current===t&&g.current===u){if(C(),g.current=null,1e3===e.code){d("session-ended"),T.current.onSessionEnded?.();return}if(1011===e.code){p("session-not-found"),d("disconnected");return}if(1013===e.code){p("max-connections"),d("disconnected");return}if(E.current<5){let e=r[E.current]??16e3;E.current++,m(E.current),d("reconnecting"),h.current=setTimeout(()=>{y.current(S.current,t)},e)}else a()&&p("reconnect-exhausted"),d("disconnected")}},u.onerror=()=>{console.log("[terminal-ws] connection error")}},[C]);(0,t.useEffect)(()=>{y.current=N},[N]);let x=(0,t.useCallback)((e,t,n)=>{S.current=e,v.current=t&&n?{cols:t,rows:n}:null,E.current=0,m(0),b.current++,N(e,b.current)},[N]),R=(0,t.useCallback)(()=>{b.current++,C(),g.current&&(g.current.close(),g.current=null),S.current="",d("disconnected")},[C]),O=(0,t.useCallback)(()=>{S.current&&(E.current=0,m(0),b.current++,N(S.current,b.current))},[N]),I=(0,t.useCallback)(e=>{let t=g.current;t?.readyState===WebSocket.OPEN&&(t.send((0,i.encodeStdin)(e)),T.current.onStdin?.(e))},[]),A=(0,t.useCallback)(e=>{let t=g.current;t?.readyState===WebSocket.OPEN&&t.send((0,i.encodeWebStdin)(e))},[]),w=(0,t.useCallback)((e,t)=>{let n=g.current;n?.readyState===WebSocket.OPEN&&n.send((0,i.encodeResize)(e,t))},[]);return(0,t.useEffect)(()=>()=>{b.current++,C(),g.current&&(g.current.close(1e3),g.current=null)},[]),(0,t.useEffect)(()=>{let e=()=>{if("visible"!==document.visibilityState||!S.current)return;let e=g.current;e&&(e.readyState===WebSocket.OPEN||e.readyState===WebSocket.CONNECTING)||(E.current=0,m(0),b.current++,y.current(S.current,b.current))};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]),{status:c,retryCount:u,disconnectReason:_,connect:x,disconnect:R,reconnect:O,sendStdin:I,sendWebStdin:A,sendResize:w}}],355327)},756494,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(353533);let a=(0,n.forwardRef)((e,n)=>{let{className:a,minHeight:r}=e;return(0,t.jsx)("div",{className:(0,i.cn)("min-w-0 h-full w-full overflow-hidden p-2 flex flex-col justify-end",a),children:(0,t.jsx)("div",{ref:n,className:"min-w-0 h-full w-full overflow-hidden",style:r?{minHeight:r}:void 0})})});a.displayName="TerminalContainer",e.s(["default",0,a])},101114,482821,390618,e=>{"use strict";var t=e.i(391398),n=e.i(352819),i=e.i(939310);e.s(["default",0,e=>{let{onClose:a}=e,r=(0,n.useTranslations)("terminal");return(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b bg-card px-3 py-1 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"min-w-0 truncate",children:r("nativeCommandsHint")}),(0,t.jsx)(i.Button,{size:"sm",variant:"ghost",onClick:a,children:r("nativeCommandsReturn")})]})}],101114);var a=e.i(191788);let r=/Update available!\s+([0-9][^\s]*)\s+->\s+([0-9][^\s]*)/i,s=/Update now\s+\(runs `([^`]+)`\)/i,o=e=>{let t=e.replace(/\s+/g," ");if(/Update ran successfully! Please restart Codex\./i.test(t))return{status:"success",currentVersion:null,latestVersion:null,updateCommand:null};let n=t.match(r),i=/Release notes:/i.test(t)&&/Skip until next version/i.test(t);return n&&i?{status:/Updating Codex via `/i.test(t)?"updating":"prompt",currentVersion:n[1]??null,latestVersion:n[2]??null,updateCommand:t.match(s)?.[1]??null}:/Updating Codex via `/i.test(t)?{status:"updating",currentVersion:null,latestVersion:null,updateCommand:null}:null};e.s(["matchCodexUpdatePrompt",0,o],482821);let l=/^\s*›(?:\s*$|\s+(?!\d+\.)(?!\[[ x-]\])[^\n]*)$/m,c=/^\s*›?\s*Input disabled\./m,d=(e,t)=>{let n=t.trimEnd().split("\n").slice(-16),i=n.join("\n");if(/(?:esc(?:ape)?\s+(?:to\s+)?(?:cancel|go back|close|interrupt|stop)|(?:enter|↵)\s+(?:to\s+)?(?:select|confirm)|[↑↓].*(?:select|navigate))/i.test(i))return!1;let a="codex"===e?/^\s*›/:/^\s*❯/,r=[...n].reverse().find(e=>a.test(e));return!(!r||/^\s*[›❯]\s*(?:\/|\d+\.\s|\[[ x-]\])/.test(r))&&("codex"===e?(e=>{if(!e||o(e)?.status==="prompt"||c.test(e))return!1;let t=e.split("\n"),n=t.length;for(;n>0&&""===t[n-1].trim();)n-=1;if(0===n)return!1;let i=t.slice(Math.max(0,n-8),n).join("\n");return l.test(i)})(t):(e=>{let t=e.trimEnd().split("\n").slice(-14);if(/esc to (?:interrupt|cancel|stop)/i.test(t.join("\n")))return!1;let n=/^\s*[─━]{8,}\s*$/;return t.some((e,i)=>/^\s*❯(?:\s|$)/.test(e)&&i>0&&n.test(t[i-1])&&t.slice(i+1).some(e=>n.test(e)))})(t))};class u{provider;readContent;complete;interacted;submitted;timer;constructor(e,t,n){this.provider=e,this.readContent=t,this.complete=n,this.interacted=!1,this.submitted=!1}input(e){this.cancelPending(),["\r","\n","\x1b","\x03"].includes(e)&&(this.submitted=!0)}parsed(e){if(this.cancelPending(),!d(this.provider,e)){this.interacted=!0;return}(this.interacted||this.submitted)&&(this.timer=setTimeout(()=>{this.timer=void 0,d(this.provider,this.readContent())&&this.complete()},250))}cancelPending(){void 0!==this.timer&&clearTimeout(this.timer),this.timer=void 0}}e.s(["default",0,e=>{let{scopeKey:t,provider:n,getBufferText:i,sendStdin:r,focusTerminal:s,focusInput:o,revealTerminal:l}=e,[c,d]=(0,a.useState)(()=>new Set),m=(0,a.useRef)(new Map),_=(0,a.useRef)({scopeKey:t,focusInput:o}),p=(0,a.useRef)(null);(0,a.useEffect)(()=>{_.current={scopeKey:t,focusInput:o}},[t,o]),(0,a.useEffect)(()=>{let e=m.current;return()=>{for(let t of e.values())t.cancelPending()}},[]),(0,a.useEffect)(()=>()=>{p.current&&clearTimeout(p.current),m.current.get(t)?.cancelPending()},[t]);let g=(0,a.useCallback)(e=>{m.current.get(e)?.cancelPending(),m.current.delete(e),d(t=>{let n=new Set(t);return n.delete(e),n}),_.current.scopeKey===e&&(p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{_.current.scopeKey===e&&_.current.focusInput()},0))},[]),f=(0,a.useCallback)(e=>{/^\/[^\r\n]*$/.test(e)&&(m.current.get(t)?.cancelPending(),m.current.set(t,new u(n,i,()=>g(t))),d(e=>new Set(e).add(t)),l?.(),r(e),s(),p.current&&clearTimeout(p.current),p.current=setTimeout(s,180))},[t,n,i,g,r,s,l]),h=(0,a.useCallback)(()=>{c.has(t)&&(p.current&&clearTimeout(p.current),r("\x05\x15"),g(t))},[c,t,r,g]),E=(0,a.useCallback)(e=>m.current.get(t)?.input(e),[t]),S=(0,a.useCallback)(()=>{let e=m.current.get(t);e&&e.parsed(i())},[t,i]);return{active:c.has(t),open:f,close:h,onInput:E,onParsed:S}}],390618)},391046,e=>{"use strict";var t=e.i(391398),n=e.i(352819),i=e.i(586034),a=e.i(53073),r=e.i(199648),s=e.i(353533),o=e.i(939310),l=e.i(635255);e.s(["default",0,e=>{let{status:c,retryCount:d,disconnectReason:u,onReconnect:m}=e,_=(0,n.useTranslations)("connection"),p=(0,n.useTranslations)("common"),g="reconnect-exhausted"===u;return(0,t.jsxs)("div",{className:(0,s.cn)("absolute top-3 right-3 z-10 flex items-center gap-2 rounded-md bg-terminal-bg/90 px-3 py-2 text-sm transition-opacity duration-150","connected"!==c&&"session-ended"!==c?"animate-delayed-fade-in-long":"pointer-events-none opacity-0"),children:["connecting"===c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.default,{className:"h-3 w-3 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:_("connecting")})]}),"reconnecting"===c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.default,{className:"h-3 w-3 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:_("reconnecting",{count:d,max:5})})]}),"disconnected"===c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.WifiOff,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:_("max-connections"===u?"maxConnections":"pty-error"===u?"ptyError":"disconnected")}),(0,t.jsxs)(o.Button,{variant:"ghost",size:"sm",className:"ml-1 h-7 gap-1 px-2 text-foreground hover:text-foreground",onClick:g?()=>(0,l.reloadForReconnectRecovery)("terminal"):m,children:[(0,t.jsx)(a.RefreshCw,{className:"h-3 w-3"}),g?p("refresh"):_("reconnect")]})]})]})}])},646584,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(950323),a=e.i(399267);let r=async e=>{let t=await fetch(e);if(!t.ok)throw Error("Status line unavailable");return t.json()};e.s(["default",0,e=>{let{tabId:s,enabled:o,provider:l}=e,[c,d]=(0,n.useState)(null),u=(0,a.default)(e=>e.tabs[s]?.workspaceId),m=(0,a.default)(e=>e.tabs[s]?.agentSessionId),_=o&&u&&m?`/api/${l}/status-line?${new URLSearchParams({workspaceId:u,tabId:s,sessionId:m})}`:null,{data:p}=(0,i.default)(_,r,{refreshInterval:1e3,onSuccess:e=>{e.active&&null===e.text||d(e.text)}}),g=p?.text??c;return o&&m&&p?.active!==!1&&g?(0,t.jsx)("div",{"data-agent-status-line":l,className:"chat-content shrink-0 border-t px-3 py-1.5 font-mono text-[11px] text-muted-foreground",children:(0,t.jsx)("p",{className:"whitespace-pre-wrap break-words",children:g})}):null}])},231382,701412,e=>{"use strict";let t=(e,t)=>{let n=[],i=t.trim();for(let t=0;t<e.length;t++){let a=`${e[t].question}
|
|
15
|
+
\`\`\``:i;R(s,M)}}:void 0})}eN(),eg(e=>e+1)}catch{a.toast.error(w("syncErrorGeneric"))}finally{eh(!1)}}},[x,ef,w,eN,R,M,Q]),eA=(0,n.useCallback)(async()=>{ec&&(await (0,v.copyToClipboard)(ec)?a.toast.success(D("copyPaneSuccess"),{duration:1500}):a.toast.error(D("copyPaneCopyFailed")))},[ec,D]);if((0,n.useEffect)(()=>{eN().then(()=>ex())},[eN,ex]),(0,n.useEffect)(()=>{if(!1===F)return;eT.current=window.setInterval(ex,1e4);let e=()=>{"visible"===document.visibilityState&&ex()};return document.addEventListener("visibilitychange",e),()=>{window.clearInterval(eT.current),document.removeEventListener("visibilitychange",e)}},[F,ex]),B&&null===F)return(0,t.jsx)("div",{className:"flex h-full items-center justify-center bg-card",children:(0,t.jsx)(h.default,{className:"h-5 w-5 text-muted-foreground"})});if(!1===F)return(0,t.jsx)("div",{className:"flex h-full items-center justify-center bg-card",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 text-muted-foreground",children:[(0,t.jsx)(s.GitBranch,{className:"h-10 w-10 opacity-20"}),(0,t.jsx)("span",{className:"text-sm",children:w("notGitRepo")})]})});let ew=J&&eo?`(detached @ ${eo.shortHash})`:Q||"—",eD=$>0||q>0,eL=q>0&&0===$?d.ArrowDown:$>0&&0===q?c.ArrowUp:u.ArrowDownUp,eM=[q>0?`↓${q}`:"",$>0?`↑${$}`:""].filter(Boolean).join(" "),ek=ef?w("syncing"):eD?`${w("sync")} \xb7 ${eM}`:w("sync"),eP=ec?(N=ec.split("/").filter(Boolean))[N.length-1]||ec:"",eF=ec?(e=>{let t=e.replace(et,"~"),n=t.split("/").filter(Boolean),i=t.startsWith("~/"),a=t.startsWith("/");if(n.length<=4)return t;let r=i?n.slice(0,2).join("/"):a?`/${n[0]}`:n[0];return`${r}/.../${n.slice(-2).join("/")}`})(ec):"";return(0,t.jsxs)("div",{className:"flex h-full flex-col bg-card",children:[(0,t.jsxs)("div",{className:"flex shrink-0 flex-col border-b border-border",children:[(0,t.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-border px-2 py-1.5",children:[(0,t.jsx)(b.Tabs,{value:e_,onValueChange:e=>eO(e),className:"gap-0",children:(0,t.jsxs)(b.TabsList,{className:"h-7 w-auto min-w-40",children:[(0,t.jsx)(b.TabsTrigger,{value:"changes",className:"relative h-full flex-1 px-2.5 text-[11px] tracking-wide",children:w("tabChanges").toUpperCase()}),(0,t.jsx)(b.TabsTrigger,{value:"history",className:"relative h-full flex-1 px-2.5 text-[11px] tracking-wide",children:w("tabHistory").toUpperCase()})]})}),(0,t.jsx)(S.TooltipProvider,{children:(0,t.jsxs)("div",{className:"ml-auto flex max-w-full flex-wrap items-center justify-end gap-1",children:[(0,t.jsxs)(E.Button,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",disabled:ef||B||J||!F,onClick:()=>{ev(eo&&ec?{directory:ec,branch:Q,head:eo.hash}:void 0),eS(!0)},children:[(0,t.jsx)(g.GitPullRequest,{className:"h-3.5 w-3.5"}),w("commit.workflowButton")]}),"changes"===e_&&!L&&(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(E.Button,{type:"button",variant:"ghost",size:"icon-sm",className:"h-7 w-7 text-muted-foreground"}),onClick:()=>em("split"===eu?"unified":"split"),"aria-label":"split"===eu?w("lineByLine"):w("sideBySide"),children:"split"===eu?(0,t.jsx)(l.Rows2,{className:"h-3.5 w-3.5"}):(0,t.jsx)(o.Columns2,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"split"===eu?w("lineByLine"):w("sideBySide")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsxs)(S.TooltipTrigger,{render:(0,t.jsx)(E.Button,{type:"button",variant:"ghost",size:eD?"sm":"icon-sm",className:(0,f.cn)("h-7",eD?"px-2":"w-7 px-0",eD&&!ef?"bg-ui-blue/10 text-ui-blue hover:bg-ui-blue/15 hover:text-ui-blue":"text-muted-foreground")}),className:(0,f.cn)("disabled:opacity-50"),onClick:eI,disabled:ef||B,"aria-label":ek,children:[ef?(0,t.jsx)(h.default,{className:"h-3.5 w-3.5"}):(0,t.jsx)(eL,{className:"h-3.5 w-3.5"}),eD&&!ef&&(0,t.jsx)("span",{className:"font-mono text-[11px] leading-none",children:eM})]}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:ek})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsxs)(S.TooltipTrigger,{render:(0,t.jsx)(E.Button,{type:"button",variant:"ghost",size:"icon-sm",className:(0,f.cn)("h-7 w-7",H&&"changes"===e_?"bg-ui-blue/10 text-ui-blue hover:bg-ui-blue/15 hover:text-ui-blue":"text-muted-foreground")}),className:(0,f.cn)("relative disabled:opacity-50"),onClick:eR,disabled:B,"aria-label":w("refresh"),children:[(0,t.jsx)(r.RefreshCw,{className:(0,f.cn)("h-3.5 w-3.5",B&&"animate-spin")}),H&&"changes"===e_&&(0,t.jsx)("span",{className:"absolute right-1 top-1 h-1.5 w-1.5 rounded-full bg-ui-blue"})]}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:H&&"changes"===e_?`${w("hasChanges")} \xb7 ${w("refresh")}`:w("refresh")})]}),O&&(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(E.Button,{type:"button",variant:"ghost",size:"icon-sm",className:"h-7 w-7 text-muted-foreground"}),onClick:O,"aria-label":"Close Git",children:(0,t.jsx)(_.X,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{side:"bottom",children:"Close"})]})]})})]}),L&&ec&&(0,t.jsxs)("button",{type:"button",className:"flex min-h-8 min-w-0 items-center gap-2 border-b border-border/60 px-3 py-1.5 text-left text-xs text-muted-foreground active:bg-accent/60",onClick:eA,title:ec,"aria-label":ec,children:[(0,t.jsx)(p.Folder,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"min-w-0 truncate font-medium text-foreground",children:eP}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/50",children:"·"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px]",children:eF})]}),(0,t.jsxs)("div",{className:"flex min-h-9 min-w-0 items-center gap-2 px-3 py-2 text-xs",children:[(0,t.jsx)(s.GitBranch,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[(0,t.jsx)("span",{className:"truncate font-medium text-foreground",title:ew,children:ew}),X&&(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground",children:"→"}),X&&(0,t.jsx)("span",{className:"truncate text-muted-foreground",title:X,children:X})]}),($>0||q>0)&&(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-[11px]",children:[$>0&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-ui-blue",title:`${$} commit(s) to push`,children:[(0,t.jsx)(c.ArrowUp,{className:"h-3 w-3"}),$]}),q>0&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-claude-active",title:`${q} commit(s) to pull`,children:[(0,t.jsx)(d.ArrowDown,{className:"h-3 w-3"}),q]})]}),er>0&&(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-0.5 font-mono text-[11px] text-muted-foreground",title:`${er} stash(es)`,children:[(0,t.jsx)(m.Archive,{className:"h-3 w-3"}),er]})]})]}),eE&&(0,t.jsx)(ee,{sessionName:x,repository:eb,onClose:()=>eS(!1),onCommitted:()=>{eN(),eg(e=>e+1)}},x),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:"history"===e_?(0,t.jsx)(Y,{repoRoot:ec,sessionName:x,refreshToken:ep,viewMode:eu}):(0,t.jsxs)(t.Fragment,{children:[!k&&(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 text-muted-foreground",children:[(0,t.jsx)(s.GitBranch,{className:"h-10 w-10 opacity-20"}),(0,t.jsx)("span",{className:"text-sm",children:w("noChanges")})]})}),k&&(0,t.jsx)(j,{repoRoot:ec,diff:k,viewMode:eu,sessionName:x})]})})]})}],236495)},355327,635255,e=>{"use strict";var t=e.i(191788),n=e.i(745725),i=e.i(405334);let a=()=>!("u"<typeof document)&&"visible"===document.visibilityState&&window.matchMedia("(max-width: 768px), (pointer: coarse)").matches;e.s(["reloadForReconnectRecovery",0,e=>{try{sessionStorage.setItem("pmux-ws-hard-reload:reason",e)}catch{}window.location.reload()},"shouldPromptMobileReloadRecovery",0,a],635255);let r=[1e3,2e3,4e3,8e3,16e3];e.s(["default",0,function(){let{onData:e,onStdin:s,onConnected:o,onSessionEnded:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[c,d]=(0,t.useState)("disconnected"),[u,m]=(0,t.useState)(0),[_,p]=(0,t.useState)(null),g=(0,t.useRef)(null),f=(0,t.useRef)(null),h=(0,t.useRef)(null),E=(0,t.useRef)(0),S=(0,t.useRef)(""),b=(0,t.useRef)(0),v=(0,t.useRef)(null),T=(0,t.useRef)({onData:e,onStdin:s,onConnected:o,onSessionEnded:l}),y=(0,t.useRef)(()=>{});(0,t.useEffect)(()=>{T.current={onData:e,onStdin:s,onConnected:o,onSessionEnded:l}},[e,s,o,l]);let C=(0,t.useCallback)(()=>{f.current&&(clearInterval(f.current),f.current=null),h.current&&(clearTimeout(h.current),h.current=null)},[]),N=(0,t.useCallback)((e,t)=>{C(),g.current&&(g.current.close(),g.current=null),p(null),d(E.current>0?"reconnecting":"connecting");let s="https:"===location.protocol?"wss:":"ws:",o=(e=>{let t=`pt-ws-cid-${e}`;try{let e=sessionStorage.getItem(t);if(e)return e;let i=(0,n.nanoid)();return sessionStorage.setItem(t,i),i}catch{return(0,n.nanoid)()}})(e),l=v.current,c=l?`&cols=${l.cols}&rows=${l.rows}`:"",u=new WebSocket(`${s}//${location.host}/api/terminal?clientId=${o}&session=${e}&flowControl=1${c}`);u.binaryType="arraybuffer",g.current=u,u.onopen=()=>{b.current===t&&g.current===u&&(d("connected"),E.current=0,m(0),T.current.onConnected?.(),f.current=setInterval(()=>{u.readyState===WebSocket.OPEN&&u.send((0,i.encodeHeartbeat)())},3e4))},u.onmessage=e=>{if(b.current!==t||g.current!==u)return;let{type:n,payload:a}=(0,i.decodeMessage)(e.data);switch(n){case i.MSG_STDOUT:{let e=!1;T.current.onData?.(a,n=>{if(!e&&g.current===u&&b.current===t&&u.readyState===WebSocket.OPEN){if(e=!0,n)return void u.close(4e3,"Terminal output processing failed");try{u.send((0,i.encodeStdoutAck)(a.byteLength))}catch{u.close(4e3,"Terminal output acknowledgement failed")}}})}case i.MSG_HEARTBEAT:}},u.onclose=e=>{if(b.current===t&&g.current===u){if(C(),g.current=null,1e3===e.code){d("session-ended"),T.current.onSessionEnded?.();return}if(1011===e.code){p("session-not-found"),d("disconnected");return}if(1013===e.code){p("max-connections"),d("disconnected");return}if(E.current<5){let e=r[E.current]??16e3;E.current++,m(E.current),d("reconnecting"),h.current=setTimeout(()=>{y.current(S.current,t)},e)}else a()&&p("reconnect-exhausted"),d("disconnected")}},u.onerror=()=>{console.log("[terminal-ws] connection error")}},[C]);(0,t.useEffect)(()=>{y.current=N},[N]);let x=(0,t.useCallback)((e,t,n)=>{S.current=e,v.current=t&&n?{cols:t,rows:n}:null,E.current=0,m(0),b.current++,N(e,b.current)},[N]),R=(0,t.useCallback)(()=>{b.current++,C(),g.current&&(g.current.close(),g.current=null),S.current="",d("disconnected")},[C]),O=(0,t.useCallback)(()=>{S.current&&(E.current=0,m(0),b.current++,N(S.current,b.current))},[N]),I=(0,t.useCallback)(e=>{let t=g.current;t?.readyState===WebSocket.OPEN&&(t.send((0,i.encodeStdin)(e)),T.current.onStdin?.(e))},[]),A=(0,t.useCallback)(e=>{let t=g.current;t?.readyState===WebSocket.OPEN&&t.send((0,i.encodeWebStdin)(e))},[]),w=(0,t.useCallback)((e,t)=>{let n=g.current;n?.readyState===WebSocket.OPEN&&n.send((0,i.encodeResize)(e,t))},[]);return(0,t.useEffect)(()=>()=>{b.current++,C(),g.current&&(g.current.close(1e3),g.current=null)},[]),(0,t.useEffect)(()=>{let e=()=>{if("visible"!==document.visibilityState||!S.current)return;let e=g.current;e&&(e.readyState===WebSocket.OPEN||e.readyState===WebSocket.CONNECTING)||(E.current=0,m(0),b.current++,y.current(S.current,b.current))};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]),{status:c,retryCount:u,disconnectReason:_,connect:x,disconnect:R,reconnect:O,sendStdin:I,sendWebStdin:A,sendResize:w}}],355327)},756494,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(353533);let a=(0,n.forwardRef)((e,n)=>{let{className:a,minHeight:r}=e;return(0,t.jsx)("div",{className:(0,i.cn)("min-w-0 h-full w-full overflow-hidden p-2 flex flex-col justify-end",a),children:(0,t.jsx)("div",{ref:n,className:"min-w-0 h-full w-full overflow-hidden",style:r?{minHeight:r}:void 0})})});a.displayName="TerminalContainer",e.s(["default",0,a])},101114,482821,390618,e=>{"use strict";var t=e.i(391398),n=e.i(352819),i=e.i(939310);e.s(["default",0,e=>{let{onClose:a}=e,r=(0,n.useTranslations)("terminal");return(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b bg-card px-3 py-1 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"min-w-0 truncate",children:r("nativeCommandsHint")}),(0,t.jsx)(i.Button,{size:"sm",variant:"ghost",onClick:a,children:r("nativeCommandsReturn")})]})}],101114);var a=e.i(191788);let r=/Update available!\s+([0-9][^\s]*)\s+->\s+([0-9][^\s]*)/i,s=/Update now\s+\(runs `([^`]+)`\)/i,o=e=>{let t=e.replace(/\s+/g," ");if(/Update ran successfully! Please restart Codex\./i.test(t))return{status:"success",currentVersion:null,latestVersion:null,updateCommand:null};let n=t.match(r),i=/Release notes:/i.test(t)&&/Skip until next version/i.test(t);return n&&i?{status:/Updating Codex via `/i.test(t)?"updating":"prompt",currentVersion:n[1]??null,latestVersion:n[2]??null,updateCommand:t.match(s)?.[1]??null}:/Updating Codex via `/i.test(t)?{status:"updating",currentVersion:null,latestVersion:null,updateCommand:null}:null};e.s(["matchCodexUpdatePrompt",0,o],482821);let l=/^\s*›(?:\s*$|\s+(?!\d+\.)(?!\[[ x-]\])[^\n]*)$/m,c=/^\s*›?\s*Input disabled\./m,d=(e,t)=>{let n=t.trimEnd().split("\n").slice(-16),i=n.join("\n");if(/(?:esc(?:ape)?\s+(?:to\s+)?(?:cancel|go back|close|interrupt|stop)|(?:enter|↵)\s+(?:to\s+)?(?:select|confirm)|[↑↓].*(?:select|navigate))/i.test(i))return!1;let a="codex"===e?/^\s*›/:/^\s*❯/,r=[...n].reverse().find(e=>a.test(e));return!(!r||/^\s*[›❯]\s*(?:\/|\d+\.\s|\[[ x-]\])/.test(r))&&("codex"===e?(e=>{if(!e||o(e)?.status==="prompt"||c.test(e))return!1;let t=e.split("\n"),n=t.length;for(;n>0&&""===t[n-1].trim();)n-=1;if(0===n)return!1;let i=t.slice(Math.max(0,n-8),n).join("\n");return l.test(i)})(t):(e=>{let t=e.trimEnd().split("\n").slice(-14);if(/esc to (?:interrupt|cancel|stop)/i.test(t.join("\n")))return!1;let n=/^\s*[─━]{8,}\s*$/;return t.some((e,i)=>/^\s*❯(?:\s|$)/.test(e)&&i>0&&n.test(t[i-1])&&t.slice(i+1).some(e=>n.test(e)))})(t))};class u{provider;readContent;complete;interacted;submitted;timer;constructor(e,t,n){this.provider=e,this.readContent=t,this.complete=n,this.interacted=!1,this.submitted=!1}input(e){this.cancelPending(),["\r","\n","\x1b","\x03"].includes(e)&&(this.submitted=!0)}parsed(e){if(this.cancelPending(),!d(this.provider,e)){this.interacted=!0;return}(this.interacted||this.submitted)&&(this.timer=setTimeout(()=>{this.timer=void 0,d(this.provider,this.readContent())&&this.complete()},250))}cancelPending(){void 0!==this.timer&&clearTimeout(this.timer),this.timer=void 0}}e.s(["default",0,e=>{let{scopeKey:t,provider:n,getBufferText:i,sendStdin:r,focusTerminal:s,focusInput:o,revealTerminal:l}=e,[c,d]=(0,a.useState)(()=>new Set),m=(0,a.useRef)(new Map),_=(0,a.useRef)({scopeKey:t,focusInput:o}),p=(0,a.useRef)(null);(0,a.useEffect)(()=>{_.current={scopeKey:t,focusInput:o}},[t,o]),(0,a.useEffect)(()=>{let e=m.current;return()=>{for(let t of e.values())t.cancelPending()}},[]),(0,a.useEffect)(()=>()=>{p.current&&clearTimeout(p.current),m.current.get(t)?.cancelPending()},[t]);let g=(0,a.useCallback)(e=>{m.current.get(e)?.cancelPending(),m.current.delete(e),d(t=>{let n=new Set(t);return n.delete(e),n}),_.current.scopeKey===e&&(p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{_.current.scopeKey===e&&_.current.focusInput()},0))},[]),f=(0,a.useCallback)(e=>{/^\/[^\r\n]*$/.test(e)&&(m.current.get(t)?.cancelPending(),m.current.set(t,new u(n,i,()=>g(t))),d(e=>new Set(e).add(t)),l?.(),r(e),s(),p.current&&clearTimeout(p.current),p.current=setTimeout(s,180))},[t,n,i,g,r,s,l]),h=(0,a.useCallback)(()=>{c.has(t)&&(p.current&&clearTimeout(p.current),r("\x05\x15"),g(t))},[c,t,r,g]),E=(0,a.useCallback)(e=>m.current.get(t)?.input(e),[t]),S=(0,a.useCallback)(()=>{let e=m.current.get(t);e&&e.parsed(i())},[t,i]);return{active:c.has(t),open:f,close:h,onInput:E,onParsed:S}}],390618)},391046,e=>{"use strict";var t=e.i(391398),n=e.i(352819),i=e.i(586034),a=e.i(53073),r=e.i(199648),s=e.i(353533),o=e.i(939310),l=e.i(635255);e.s(["default",0,e=>{let{status:c,retryCount:d,disconnectReason:u,onReconnect:m}=e,_=(0,n.useTranslations)("connection"),p=(0,n.useTranslations)("common"),g="reconnect-exhausted"===u;return(0,t.jsxs)("div",{className:(0,s.cn)("absolute top-3 right-3 z-10 flex items-center gap-2 rounded-md bg-terminal-bg/90 px-3 py-2 text-sm transition-opacity duration-150","connected"!==c&&"session-ended"!==c?"animate-delayed-fade-in-long":"pointer-events-none opacity-0"),children:["connecting"===c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.default,{className:"h-3 w-3 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:_("connecting")})]}),"reconnecting"===c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.default,{className:"h-3 w-3 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:_("reconnecting",{count:d,max:5})})]}),"disconnected"===c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.WifiOff,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:_("max-connections"===u?"maxConnections":"pty-error"===u?"ptyError":"disconnected")}),(0,t.jsxs)(o.Button,{variant:"ghost",size:"sm",className:"ml-1 h-7 gap-1 px-2 text-foreground hover:text-foreground",onClick:g?()=>(0,l.reloadForReconnectRecovery)("terminal"):m,children:[(0,t.jsx)(a.RefreshCw,{className:"h-3 w-3"}),g?p("refresh"):_("reconnect")]})]})]})}])},646584,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(950323),a=e.i(399267);let r=async e=>{let t=await fetch(e);if(!t.ok)throw Error("Status line unavailable");return t.json()};e.s(["default",0,e=>{let{tabId:s,enabled:o,provider:l}=e,[c,d]=(0,n.useState)(null),u=(0,a.default)(e=>e.tabs[s]?.workspaceId),m=(0,a.default)(e=>e.tabs[s]?.agentSessionId),_=o&&u&&m?`/api/${l}/status-line?${new URLSearchParams({workspaceId:u,tabId:s,sessionId:m})}`:null,{data:p}=(0,i.default)(_,r,{refreshInterval:1e3,onSuccess:e=>{e.active&&null===e.text||d(e.text)}}),g=p?.text??c;return o&&m&&p?.active!==!1&&g?(0,t.jsx)("div",{"data-agent-status-line":l,className:"chat-content shrink-0 border-t px-3 py-1.5 font-mono text-[11px] text-muted-foreground",children:(0,t.jsx)("p",{className:"whitespace-pre-wrap break-words",children:g})}):null}])},231382,701412,e=>{"use strict";let t=(e,t)=>{let n=[],i=t.trim();for(let t=0;t<e.length;t++){let a=`${e[t].question}
|
|
16
16
|
`;if(!i.startsWith(a))return null;i=i.slice(a.length);let r=e[t+1],s=r?i.indexOf(`
|
|
17
17
|
|
|
18
18
|
${r.question}
|
|
19
19
|
`):i.length;if(s<0)return null;let o=i.slice(0,s).trim();if(!o)return null;n.push(o),i=r?i.slice(s+2):""}return n},n=e=>{let n=[...e],i=[];return e.forEach((e,a)=>{if("ask-user-question"===e.type&&"compose"===e.answerMode&&"pending"===e.status)i.push({entry:e,index:a});else if("user-message"===e.type&&!e.pending)for(let a=i.length-1;a>=0;a--){let r=i[a],s=t(r.entry.questions,e.text);if(s){n[r.index]={...r.entry,status:"success",answers:s},i.splice(a,1);break}}}),n};e.s(["formatQuestionAnswers",0,(e,t)=>e.map((e,n)=>`${e.question}
|
|
20
|
-
${t[n].trim()}`).join("\n\n"),"resolveAsyncQuestionAnswers",0,n],701412);var i=e.i(191788);let a=[1e3,2e3,4e3,8e3,16e3],r=new Map,s=(e,t,n)=>n?JSON.stringify([e,t,n]):null,o=e=>{e&&r.delete(e)},l=e=>e.replace(/\s+/g," ").trim(),c=e=>"user-message"===e.type&&!0===e.pending;e.s(["default",0,e=>{let{sessionName:t,agentSessionId:d,claudeSessionId:u,panelType:m,enabled:_,resumeCallbacks:p,onSync:g,getCliState:f}=e,h=JSON.stringify([m??"claude-code",t,d??u??null]),E=s(m??"claude-code",t,d??u),S=(0,i.useMemo)(()=>(e=>{if(!e)return;let t=r.get(e);if(t)return Date.now()-t.savedAt>=3e5?void r.delete(e):(r.delete(e),r.set(e,t),t.snapshot)})(E),[E]),[b,v]=(0,i.useState)(()=>S?.entries??[]),[T,y]=(0,i.useState)(null),[C,N]=(0,i.useState)(!0),[x,R]=(0,i.useState)(!1),[O,I]=(0,i.useState)(null),[A,w]=(0,i.useState)(!1),[D,L]=(0,i.useState)(()=>S?.sessionId??null),[M,k]=(0,i.useState)(()=>S?.summary),[P,F]=(0,i.useState)(()=>S?.meta),[U,B]=(0,i.useState)(()=>S?.stats??null),[G,j]=(0,i.useState)(null),Y=(0,i.useRef)(b);(0,i.useEffect)(()=>{Y.current=b},[b]);let H=(0,i.useRef)(null),V=(0,i.useRef)(0),$=(0,i.useRef)(!1),z=(0,i.useRef)(0),q=(0,i.useRef)(D),W=(0,i.useRef)(f);(0,i.useEffect)(()=>{W.current=f},[f]);let[Q,K]=(0,i.useState)(h),[X,Z]=(0,i.useState)(JSON.stringify([m??"claude-code",t])),J=JSON.stringify([m??"claude-code",t]);h!==Q&&K(h),(J!==X||h!==Q&&(d??u??null)!==D)&&(J===X&&o(s(m??"claude-code",t,q.current)),z.current++,Z(J),R(!1),y(null),N(!0),v(S?.entries??[]),I(null),w(!1),L(S?.sessionId??null),q.current=S?.sessionId??null,k(S?.summary),F(S?.meta),B(S?.stats??null),j(null),H.current=null,V.current=0);let ee=!x&&0===b.length;(0,i.useEffect)(()=>{x&&D&&((e,t)=>{if(!e)return;let n=t.entries.filter(e=>"user-message"!==e.type||!e.pending),i=n.findLastIndex(e=>"user-message"===e.type),a={...t,entries:n.slice(Math.max(0,i))};if(r.delete(e),0!==a.entries.length&&!(2*JSON.stringify(a).length>2097152))for(r.set(e,{snapshot:a,savedAt:Date.now()});r.size>12;)r.delete(r.keys().next().value)})(s(m??"claude-code",t,D),{entries:b,sessionId:D,summary:M,meta:P,stats:U})},[b,D,M,P,U,x,m,t]);let et=(0,i.useCallback)(()=>{o(s(m??"claude-code",t,q.current))},[m,t]),en=(0,i.useCallback)((e,n,i,a,r,l,d,u,_,p)=>{q.current&&q.current!==i&&o(s(m??"claude-code",t,q.current)),q.current=i||null,z.current++,R(!0),N(!0),v(t=>{let n=t.filter(c);return 0===n.length?e:[...e.map(e=>{if("user-message"!==e.type)return e;let t=e.text.trim(),i=n.findIndex(e=>e.text.trim()===t);if(-1===i)return e;let a=n[i];return n.splice(i,1),{...e,id:a.id}}),...n]}),V.current=l??0,w(d??!1),k(a),F(r),B(p??null),H.current=u??null,j(u??null),i?L(i):_||(L(null),y(!1)),I(null)},[m,t]),ei=(0,i.useCallback)(e=>{v(t=>{let n=[...t];for(let t of e){if("user-message"===t.type){let e=l(t.text),i=n.findIndex(t=>"user-message"===t.type&&t.pending&&(t.attachmentPlaceholder||l(t.text)===e));if(-1!==i){let e=n[i];n[i]={...t,id:e.id};continue}}if("tool-result"===t.type){let e=t.isError?"error":"success",i=n.findIndex(e=>"tool-call"===e.type&&e.toolUseId===t.toolUseId);if(-1!==i){let t=n[i];n[i]={...t,status:e}}else{let i=n.findIndex(e=>"ask-user-question"===e.type&&e.toolUseId===t.toolUseId);if(-1!==i){let a=n[i];n[i]={...a,status:e,answer:t.summary||void 0}}}}n.push(t)}return n})},[]),ea=(0,i.useCallback)((e,t)=>{let n=e.trim(),i=`pending-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;if(!n)return i;let a={id:i,type:"user-message",timestamp:Date.now(),text:n,pending:!0,attachmentPlaceholder:t?.attachmentPlaceholder};return v(e=>[...e,a]),t?.attachmentPlaceholder?setTimeout(()=>{v(e=>e.filter(e=>e.id!==i||"user-message"!==e.type||!0!==e.pending||!0!==e.attachmentPlaceholder))},6e4):t?.autoHide!==!1&&setTimeout(()=>{W.current?.()==="busy"&&(v(e=>e.some(e=>e.id!==i)?e.map(e=>e.id===i&&"user-message"===e.type&&!0===e.pending?{...e,fadingOut:!0}:e):e),setTimeout(()=>{v(e=>e.some(e=>e.id!==i)?e.filter(e=>e.id!==i||"user-message"!==e.type||!0!==e.pending):e)},200))},1e3),i},[]),er=(0,i.useCallback)(e=>{v(t=>t.filter(t=>t.id!==e||"user-message"!==t.type||!0!==t.pending))},[]),es=(0,i.useCallback)((e,t)=>{let n=q.current;if(("session-waiting"!==t||e&&e!==n)&&et(),q.current="session-ended"===t?null:e||("session-waiting"===t?n:null),"session-waiting"!==t&&z.current++,"session-ended"===t){H.current=null,j(null),L(null),y(!1),R(!0),v([]),k(void 0),F(void 0),B(null),w(!1);return}if("session-waiting"===t){e&&e!==n&&(z.current++,v(e=>e.filter(c)),R(!1),B(null),F(void 0),k(void 0),w(!1),H.current=null,j(null)),e?(y(!0),L(e)):y(!0);return}L(e||null),y(!0),v(e=>e.filter(c)),k(void 0),F(void 0),B(null),w(!1),R(!1)},[et]),eo=(0,i.useCallback)(e=>{e.sessionId===q.current&&B(e)},[]),el=(0,i.useCallback)(async()=>{if(!H.current||$.current||!A)return;if(V.current<=0)return void w(!1);$.current=!0;let e=z.current,t=H.current;try{let n=await fetch(`/api/timeline/entries?jsonlPath=${encodeURIComponent(t)}&beforeByte=${V.current}&mode=turn`);if(!n.ok)return;let i=await n.json();if(e!==z.current||t!==H.current)return;let a=i.entries;v(e=>[...a,...e]),V.current=i.startByteOffset,w(i.hasMore)}finally{$.current=!1}},[A]),ec=(0,i.useCallback)(e=>{"not-installed"===e.code?N(!1):console.warn(`[timeline] WebSocket error: ${e.code} — ${e.message}`)},[]),ed=(0,i.useRef)(p);(0,i.useEffect)(()=>{ed.current=p},[p]);let{status:eu,reconnect:em,sendResume:e_}=(e=>{let{sessionName:t,agentSessionId:n,claudeSessionId:r,panelType:s,enabled:o,onInit:l,onAppend:c,onSessionChanged:d,onStatsUpdate:u,onError:m,onResumeStarted:_,onResumeBlocked:p,onResumeError:g}=e,[f,h]=(0,i.useState)("disconnected"),[E,S]=(0,i.useState)(0),b=(0,i.useRef)(null),v=(0,i.useRef)(0),T=(0,i.useRef)(null),y=(0,i.useRef)(0),C=(0,i.useRef)({onInit:l,onAppend:c,onSessionChanged:d,onStatsUpdate:u,onError:m,onResumeStarted:_,onResumeBlocked:p,onResumeError:g});(0,i.useEffect)(()=>{C.current={onInit:l,onAppend:c,onSessionChanged:d,onStatsUpdate:u,onError:m,onResumeStarted:_,onResumeBlocked:p,onResumeError:g}},[l,c,d,u,m,_,p,g]);let N=(0,i.useRef)(()=>{}),x=(0,i.useCallback)(()=>{T.current&&(clearTimeout(T.current),T.current=null)},[]),R=(0,i.useCallback)(e=>{x(),b.current&&(b.current.close(),b.current=null),h(v.current>0?"reconnecting":"connecting");let i="https:"===location.protocol?"wss:":"ws:",o=new URLSearchParams({session:t}),l=n??r;l&&o.set("agentSessionId",l),s&&o.set("panelType",s);let c=new WebSocket(`${i}//${location.host}/api/timeline?${o}`);b.current=c,c.onopen=()=>{y.current===e&&(h("connected"),v.current=0)},c.onmessage=t=>{if(y.current===e)try{let e=JSON.parse(t.data);switch(e.type){case"timeline:init":C.current.onInit(e.entries,e.totalEntries,e.sessionId,e.summary,e.meta,e.startByteOffset,e.hasMore,e.jsonlPath,e.isClaudeStarting,e.sessionStats);break;case"timeline:append":C.current.onAppend(e.entries);break;case"timeline:session-changed":C.current.onSessionChanged(e.newSessionId,e.reason);break;case"timeline:stats-update":C.current.onStatsUpdate?.(e.sessionStats);break;case"timeline:error":C.current.onError?.({code:e.code,message:e.message});break;case"timeline:resume-started":C.current.onResumeStarted?.({sessionId:e.sessionId,jsonlPath:e.jsonlPath});break;case"timeline:resume-blocked":C.current.onResumeBlocked?.({reason:e.reason,processName:e.processName});break;case"timeline:resume-error":C.current.onResumeError?.({message:e.message})}}catch(e){console.log(`[timeline-ws] message parse error: ${e instanceof Error?e.message:e}`)}},c.onclose=()=>{if(y.current===e)if(x(),b.current=null,v.current<5){let t=a[v.current]??16e3;v.current++,h("reconnecting"),T.current=setTimeout(()=>{N.current(e)},t)}else h("disconnected")},c.onerror=()=>{console.log("[timeline-ws] connection error")}},[t,n,r,s,x]);(0,i.useEffect)(()=>{N.current=R},[R]),(0,i.useEffect)(()=>{if(!o){++y.current,x(),b.current&&(b.current.close(),b.current=null);return}v.current=0;let e=++y.current;return R(e),()=>{y.current=e+1,x(),b.current&&(b.current.readyState===WebSocket.OPEN&&b.current.send(JSON.stringify({type:"timeline:unsubscribe"})),b.current.close(1e3),b.current=null)}},[o,t,n,r,s,E]),(0,i.useEffect)(()=>{let e=()=>{if("visible"!==document.visibilityState||!o)return;let e=b.current;if(e&&(e.readyState===WebSocket.OPEN||e.readyState===WebSocket.CONNECTING))return;v.current=0;let t=++y.current;N.current(t)};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[o]);let O=(0,i.useCallback)(e=>{let t=b.current;t?.readyState===WebSocket.OPEN&&t.send(JSON.stringify({type:"timeline:subscribe",jsonlPath:e}))},[]),I=(0,i.useCallback)(()=>{let e=b.current;e?.readyState===WebSocket.OPEN&&e.send(JSON.stringify({type:"timeline:unsubscribe"}))},[]);return{status:f,subscribe:O,unsubscribe:I,reconnect:(0,i.useCallback)(()=>{S(e=>e+1)},[]),sendResume:(0,i.useCallback)((e,t)=>{let n=b.current;n?.readyState===WebSocket.OPEN&&n.send(JSON.stringify({type:"timeline:resume",sessionId:e,tmuxSession:t}))},[])}})({sessionName:t,agentSessionId:d,claudeSessionId:u,panelType:m,enabled:_,onInit:en,onAppend:ei,onSessionChanged:es,onStatsUpdate:eo,onError:ec,onResumeStarted:(0,i.useCallback)(e=>{et(),z.current++,q.current=e.sessionId,H.current=e.jsonlPath,j(e.jsonlPath),B(null),F(void 0),k(void 0),w(!1),L(e.sessionId),y(!0),v([]),R(!1),ed.current?.onResumeStarted?.(e)},[et]),onResumeBlocked:(0,i.useCallback)(e=>{ed.current?.onResumeBlocked?.(e)},[]),onResumeError:(0,i.useCallback)(e=>{ed.current?.onResumeError?.(e)},[])}),ep=(0,i.useCallback)(()=>{I(null),em()},[em]),eg=(0,i.useRef)(g);(0,i.useEffect)(()=>{eg.current=g},[g]),(0,i.useEffect)(()=>{eg.current?.({agentProcess:T,agentInstalled:C,isLoading:ee})},[T,C,ee]);let ef=(0,i.useMemo)(()=>(e=>{let t=new Map,n=new Set(e.flatMap(e=>"tool-result"===e.type&&e.isError?[e.toolUseId]:[])),i=0;for(let a of e){if("task-progress"!==a.type||a.toolUseId&&n.has(a.toolUseId))continue;if("replace"===a.action){let e=`${a.source}:`;for(let n of t.keys())n.startsWith(e)&&t.delete(n);for(let n of a.tasks??[])t.set(`${e}${n.taskId}`,{...n,taskId:`${e}${n.taskId}`});continue}"create"===a.action&&i++;let e=a.taskId||String(i),r=t.get(e);(r||a.subject)&&t.set(e,{taskId:e,subject:a.subject??r?.subject??"",description:a.description??r?.description,status:a.status})}return[...t.values()]})(b),[b]);return{entries:(0,i.useMemo)(()=>n(b),[b]),tasks:ef,sessionId:D,jsonlPath:G,sessionSummary:M,initMeta:P,sessionStats:U,agentProcess:T,agentInstalled:C,wsStatus:eu,isLoading:ee,error:O,loadMore:el,hasMore:A,retrySession:ep,sendResume:e_,addPendingUserMessage:ea,removePendingUserMessage:er}}],231382)},377181,e=>{"use strict";var t=e.i(191788);e.s(["default",0,(e,n)=>{let[i,a]=(0,t.useState)(null);return(0,t.useEffect)(()=>{if(!e)return;let t=setTimeout(()=>a({options:[],isBypassPrompt:!1}),5e3);return()=>{clearTimeout(t),a(null)}},[e]),(0,t.useEffect)(()=>{if(!i||i.options.length>0)return;let e=!1,t=()=>{fetch(`/api/tmux/permission-options?session=${encodeURIComponent(n)}`).then(e=>e.json()).then(t=>{let{options:n,isBypassPrompt:i}=t;!e&&n?.length&&a({options:n,isBypassPrompt:!!i})}).catch(()=>{})};t();let r=setInterval(t,3e3);return()=>{e=!0,clearInterval(r)}},[i,n]),i}])},418760,e=>{"use strict";var t=e.i(191788);e.s(["default",0,e=>{let{tmuxSession:n,enabled:i,cwd:a}=e,[r,s]=(0,t.useState)([]),[o,l]=(0,t.useState)(0),[c,d]=(0,t.useState)(!1),[u,m]=(0,t.useState)(!0),[_,p]=(0,t.useState)(!1),[g,f]=(0,t.useState)(null),h=(0,t.useRef)(!1),[E,S]=(0,t.useState)(n);n!==E&&(S(n),s([]),l(0),d(!1),m(!0),f(null));let b=(0,t.useRef)(a);b.current=a;let v=(0,t.useCallback)(async()=>{if(n){m(!0),f(null);try{let e=`/api/timeline/sessions?tmuxSession=${encodeURIComponent(n)}&limit=50&offset=0`;b.current&&(e+=`&cwd=${encodeURIComponent(b.current)}`);let t=await fetch(e);if(!t.ok)throw Error("세션 목록을 불러올 수 없습니다");let i=await t.json();s(i.sessions),l(i.total),d(i.hasMore)}catch(e){f(e instanceof Error?e.message:"세션 목록을 불러올 수 없습니다")}finally{m(!1)}}},[n]);(0,t.useEffect)(()=>{i&&v()},[i,v]);let T=(0,t.useRef)(a);(0,t.useEffect)(()=>{T.current!==a&&(T.current=a,i&&v())},[a,i,v]);let y=(0,t.useCallback)(async()=>{await v()},[v]),C=(0,t.useCallback)(async()=>{if(n&&!h.current&&c){h.current=!0,p(!0);try{let e=r.length,t=await fetch(`/api/timeline/sessions?tmuxSession=${encodeURIComponent(n)}&limit=50&offset=${e}`);if(!t.ok)return;let i=await t.json();s(e=>[...e,...i.sessions]),l(i.total),d(i.hasMore)}finally{h.current=!1,p(!1)}}},[n,c,r.length]);return{sessions:r,total:o,hasMore:c,isLoading:u,isLoadingMore:_,error:g,refetch:y,loadMore:C}}])},815435,e=>{"use strict";var t=e.i(191788),n=e.i(352819);let i=e=>{for(let t of e)if("user-message"===t.type)return t.text;return null},a=(e,t)=>{let n=0,i=0,a=null;for(let r of e)(void 0===t||!(r.timestamp<=t))&&(a=new Date(r.timestamp).toISOString(),"user-message"===r.type?n++:"assistant-message"===r.type&&i++);return{userCount:n,assistantCount:i,updatedAt:a}},r=(e,t)=>t?{...e,inputTokens:t.inputTokens??null,cachedInputTokens:t.cachedInputTokens??null,outputTokens:t.outputTokens??null,reasoningOutputTokens:t.reasoningOutputTokens??null,totalCost:t.cost??null,currentContextTokens:t.currentContextTokens||null,contextWindowSize:t.contextWindowSize||null,usedPercentage:t.usedPercentage??null,model:t.model??null,exceeds200k:t.exceeds200k??!1}:e,s=(e,s,o,l,c,d)=>{let u=(0,n.useTranslations)("session")("newSessionTitle");return(0,t.useMemo)(()=>{let t=((e,t,n,s,o,l)=>{let c={title:s,createdAt:null,updatedAt:null,fileSize:0,userCount:0,assistantCount:0,inputTokens:null,cachedInputTokens:null,outputTokens:null,reasoningOutputTokens:null,totalCost:null,currentContextTokens:null,contextWindowSize:null,usedPercentage:null,model:null,exceeds200k:!1},d=o??l??s;if(n){let{userCount:d,assistantCount:u,updatedAt:m}=a(e,n.lastTimestamp),_=n.customTitle??o??i(e)??l??s;return r({...c,title:_,createdAt:n.createdAt,updatedAt:m??n.updatedAt,fileSize:n.fileSize,userCount:n.userCount+d,assistantCount:n.assistantCount+u},t)}if(0===e.length)return r({...c,title:d},t);let{userCount:u,assistantCount:m,updatedAt:_}=a(e),p=o??i(e)??l??s,g=e[0].timestamp?new Date(e[0].timestamp).toISOString():null;return r({...c,title:p,createdAt:g,updatedAt:_,userCount:u,assistantCount:m},t)})(e,l,o,u,c,d);return s?{...t,title:s}:t},[e,s,o,l,u,c,d])};e.s(["default",0,(e,n,i,a,r,o)=>{let l=s(e,n,i,a,r,o),[c,d]=(0,t.useState)(!1);return{meta:l,isExpanded:c,toggleExpanded:(0,t.useCallback)(()=>{d(e=>!e)},[]),collapse:(0,t.useCallback)(()=>{d(!1)},[])}},"useSessionMetaCompute",0,s])},967086,541301,767708,650001,e=>{"use strict";var t=e.i(191788);e.s(["default",0,e=>{let[n,i]=(0,t.useState)(null),[a,r]=(0,t.useState)(!0),s=(0,t.useRef)(null),o=(0,t.useCallback)(async()=>{try{let t=await fetch(`/api/git/branch?tmuxSession=${encodeURIComponent(e)}`);if(!t.ok)return void i(null);let n=await t.json();i(n.branch??null)}catch{i(null)}finally{r(!1)}},[e]);return(0,t.useEffect)(()=>e?(r(!0),o(),s.current=setInterval(o,3e4),()=>{s.current&&(clearInterval(s.current),s.current=null)}):void r(!1),[e,o]),{branch:n,isLoading:a}}],967086),e.s(["default",0,function(e){let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],[i,a]=(0,t.useState)(null),[r,s]=(0,t.useState)(!0),o=(0,t.useRef)(null),l=(0,t.useCallback)(async()=>{try{let t=await fetch(`/api/git/status?tmuxSession=${encodeURIComponent(e)}`);if(!t.ok)return void a(null);let n=await t.json();a(n.status??null)}catch{a(null)}finally{s(!1)}},[e]);return(0,t.useEffect)(()=>e&&n?(s(!0),l(),o.current=setInterval(l,3e4),()=>{o.current&&(clearInterval(o.current),o.current=null)}):void s(!1),[e,n,l]),{status:i,isLoading:r}}],541301),e.s(["default",0,(e,n)=>{let[i,a]=(0,t.useState)(null);return(0,t.useEffect)(()=>{if(!n||!e)return;let t=new AbortController;return(async()=>{try{let n=await fetch(`/api/tmux/info?session=${encodeURIComponent(e)}`,{signal:t.signal});if(!n.ok)return;let i=await n.json();a(i)}catch{}})(),()=>t.abort()},[n,e]),i}],767708),e.s(["default",0,(e,n)=>{let[i,a]=(0,t.useState)(null);return(0,t.useEffect)(()=>{if(!n||!e)return;let t=!1,i=new AbortController;return fetch(`/api/timeline/message-counts?jsonlPath=${encodeURIComponent(e)}`,{signal:i.signal}).then(e=>e.ok?e.json():null).then(e=>{!t&&e&&a(e)}).catch(()=>{}),()=>{t=!0,i.abort()}},[e,n]),i}],650001)},441693,17122,74531,742921,273062,385459,165137,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(265524),a=e.i(352819),r=e.i(199648),s=e.i(939310),o=e.i(569479),l=e.i(319987),c=e.i(494834),d=e.i(143100),u=e.i(353533);let m=e=>{if("ArrowDown"===e.key){e.preventDefault();let t=e.currentTarget.closest("[data-session-row]")?.nextElementSibling?.querySelector("button");t?.focus()}else if("ArrowUp"===e.key){e.preventDefault();let t=e.currentTarget.closest("[data-session-row]")?.previousElementSibling?.querySelector("button");t?.focus()}},_=(0,n.memo)(e=>{let{session:n,isResuming:i,isDisabled:r,onSelect:s,onDeleted:o}=e,_=(0,a.useTranslations)("session"),p=(0,c.default)(n.lastActivityAt).format("MM/DD HH:mm"),g=((e,t)=>{let n=(0,c.default)(),i=(0,c.default)(e),a=n.diff(i,"minute");if(a<1)return t("justNow");if(a<60)return t("minutesAgo",{count:a});let r=n.diff(i,"hour");if(r<24)return t("hoursAgo",{count:r});let s=n.diff(i,"day");if(1===s)return t("yesterday");if(s<7)return t("daysAgo",{count:s});let o=n.diff(i,"week");if(o<4)return t("weeksAgo",{count:o});let l=n.diff(i,"month");return l<12?t("monthsAgo",{count:l}):t("yearsAgo",{count:n.diff(i,"year")})})(n.lastActivityAt,_),f=n.firstMessage||_("noMessage");return(0,t.jsx)(l.default,{provider:"claude",sessionId:n.sessionId,label:n.firstMessage,disabled:r,onDeleted:o,children:(0,t.jsxs)("button",{type:"button",className:(0,u.cn)("w-full cursor-pointer border-b border-border/50 py-3 pl-1 pr-10 text-left transition-colors hover:bg-claude-active/5",r&&!i&&"pointer-events-none opacity-50",i&&"bg-claude-active/5"),onClick:()=>s(n.sessionId),onKeyDown:m,disabled:r,"aria-label":_("sessionLabel",{message:f}),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs",children:[i?(0,t.jsx)(d.Loader2,{size:14,className:"shrink-0 animate-spin text-claude-active"}):(0,t.jsx)("span",{className:"inline-block h-1.5 w-1.5 shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:p})]}),(0,t.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:g})]}),(0,t.jsxs)("div",{className:"mt-1 flex items-center justify-between gap-2 pl-[12px]",children:[(0,t.jsx)("span",{className:"min-w-0 truncate text-sm font-medium text-left",children:f}),(0,t.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:_("turnCount",{count:n.turnCount})})]})]})})}),p=()=>(0,t.jsx)("div",{className:"flex flex-col",children:[1,2,3].map(e=>(0,t.jsxs)("div",{className:"border-b border-border/50 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{className:"h-3.5 w-24 animate-pulse rounded bg-muted"}),(0,t.jsx)("div",{className:"h-3.5 w-16 animate-pulse rounded bg-muted"})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-center justify-between pl-[18px]",children:[(0,t.jsx)("div",{className:"h-4 w-40 animate-pulse rounded bg-muted"}),(0,t.jsx)("div",{className:"h-3.5 w-8 animate-pulse rounded bg-muted"})]})]},e))}),g=e=>{let{error:n,retryLabel:i,onRetry:a}=e;return(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)("p",{className:"text-sm",children:n}),(0,t.jsx)(s.Button,{variant:"outline",size:"sm",onClick:a,children:i})]})};e.s(["default",0,e=>{let{sessions:l,isLoading:c,isLoadingMore:d,hasMore:u,error:m,resumingSessionId:f,onSelectSession:h,onRefresh:E,onLoadMore:S,onNewSession:b}=e,v=(0,a.useTranslations)("terminal"),T=(0,n.useRef)(null),y=(0,n.useCallback)(async()=>{await E(),T.current&&(T.current.scrollTop=0)},[E]),C=(0,n.useCallback)(()=>{let e=T.current;e&&u&&!d&&e.scrollTop+e.clientHeight>=e.scrollHeight-50&&S()},[u,d,S]),N=!!f;return(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-2",children:[(0,t.jsxs)("span",{className:"text-sm font-medium",children:[v("sessions"),l.length>0&&`(${l.length}${u?"+":""})`]}),b&&(0,t.jsxs)(s.Button,{variant:"outline",size:"sm",onClick:b,children:[(0,t.jsx)(i.Plus,{size:12}),v("newConversation")]})]}),c&&0===l.length?(0,t.jsx)(p,{}):m?(0,t.jsx)(g,{error:m,retryLabel:v("retryLoad"),onRetry:y}):(0,t.jsxs)("div",{ref:T,className:"flex-1 overflow-y-auto",onScroll:C,children:[(0,t.jsx)(o.TooltipProvider,{delay:300,children:l.map(e=>(0,t.jsx)(_,{session:e,isResuming:e.sessionId===f,isDisabled:N,onSelect:h,onDeleted:E},e.sessionId))}),d&&(0,t.jsx)("div",{className:"flex items-center justify-center py-3",children:(0,t.jsx)(r.default,{size:14,className:"text-muted-foreground"})})]})]})}],441693);var f=e.i(918703),h=e.i(909725);e.s(["default",0,e=>{let{onClose:n,onNewSession:r}=e,o=(0,a.useTranslations)("session.empty");return(0,t.jsxs)("div",{className:"relative flex h-full flex-col items-center justify-center gap-3 text-muted-foreground",children:[n&&(0,t.jsx)(s.Button,{variant:"ghost",size:"sm",className:"absolute top-2 right-2 h-7 w-7 p-0 text-muted-foreground",onClick:n,"aria-label":o("closeLabel"),children:(0,t.jsx)(h.X,{size:14})}),(0,t.jsx)(f.MessageSquare,{size:32,className:"opacity-50"}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:o("noSession")}),(0,t.jsx)("p",{className:"mt-1 text-xs opacity-70",children:o("startNewSession",{br:"\n"}).split("\n").map((e,n)=>(0,t.jsxs)("span",{children:[n>0&&(0,t.jsx)("br",{}),e]},n))})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[r&&(0,t.jsxs)(s.Button,{variant:"outline",size:"sm",onClick:r,children:[(0,t.jsx)(i.Plus,{size:14}),o("newConversation")]}),n&&(0,t.jsx)(s.Button,{variant:"ghost",size:"sm",onClick:n,children:o("close")})]})]})}],17122);var E=e.i(222564),S=e.i(749999),b=e.i(405137),v=e.i(646190);e.s(["default",0,e=>{let{icon:i,main:a,almostReady:r,subtitle:o,failed:l,failedHint:c,restartLabel:d,showTerminalLabel:m,className:_,almostReadyMs:p=2e3,errorThresholdMs:g,onRestart:f,onShowTerminal:h}=e,[T,y]=(0,n.useState)(0);return((0,n.useEffect)(()=>{let e=Date.now(),t=window.setInterval(()=>{y(Date.now()-e)},250);return()=>window.clearInterval(t)},[]),"number"==typeof g&&T>=g&&l&&c)?(0,t.jsxs)("div",{className:(0,u.cn)("flex h-full w-full flex-col items-center justify-center gap-4 px-6 text-center",_),role:"alert",children:[(0,t.jsx)(E.AlertCircle,{className:"h-8 w-8 text-destructive","aria-hidden":"true"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-base font-medium text-foreground",children:l}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:c})]}),(f||h)&&(0,t.jsxs)("div",{className:"flex gap-2",children:[f&&d&&(0,t.jsxs)(s.Button,{variant:"default",size:"sm",onClick:f,children:[(0,t.jsx)(S.RotateCcw,{className:"h-3.5 w-3.5"}),d]}),h&&m&&(0,t.jsxs)(s.Button,{variant:"outline",size:"sm",onClick:h,children:[(0,t.jsx)(b.TerminalSquare,{className:"h-3.5 w-3.5"}),m]})]})]}):(0,t.jsxs)("div",{className:(0,u.cn)("flex h-full w-full flex-col items-center justify-center gap-5 px-6",_),role:"status","aria-busy":"true",children:[i,(0,t.jsxs)("div",{className:"text-center","aria-live":"polite",children:[(0,t.jsx)("p",{className:"text-base font-medium text-foreground",children:T>=p&&r?r:a}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:o})]}),(0,t.jsxs)("div",{className:"flex w-full max-w-sm flex-col gap-2","aria-hidden":"true",children:[(0,t.jsx)(v.Skeleton,{className:"h-3 w-full"}),(0,t.jsx)(v.Skeleton,{className:"h-3 w-5/6"}),(0,t.jsx)(v.Skeleton,{className:"h-3 w-2/3"})]})]})}],74531);var T=e.i(205270);let y=(0,T.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);e.s(["ShieldAlert",0,y],742921);var C=e.i(679935);let N=async(e,t)=>{try{return(await fetch("/api/tmux/send-input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:e,input:String(t+1)})})).ok}catch{return!1}};e.s(["default",0,e=>{let{sessionName:i,options:r,fallback:s}=e,o=(0,a.useTranslations)("terminal"),[l,c]=(0,n.useState)(!1),d=async e=>{l||(c(!0),await N(i,e)||(c(!1),C.toast.error(o("bypassSendFailed"))))};return(0,t.jsxs)("div",{className:"mt-4 w-full max-w-xs rounded-lg border border-ui-amber/20 bg-ui-amber/5 px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-2.5 flex items-center gap-2 text-xs font-medium text-ui-amber",children:[(0,t.jsx)(y,{size:14}),(0,t.jsx)("span",{children:o("bypassPermissions")})]}),(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:r.map((e,n)=>(0,t.jsxs)("button",{disabled:l,onClick:()=>d(n),className:"flex items-center gap-2.5 rounded-md border border-border/50 px-3 py-2 text-left text-sm transition-colors hover:border-ui-amber/30 hover:bg-ui-amber/5 disabled:opacity-50",children:[(0,t.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded bg-muted text-xs font-medium text-muted-foreground",children:n+1}),(0,t.jsx)("span",{className:"font-medium",children:e.replace(/^\d+\.\s+/,"")})]},n))}),s&&(0,t.jsx)("div",{className:"mt-2 text-center",children:s})]})}],273062);let x=(0,T.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["ShieldCheck",0,x],385459);let R={claude:"Claude",codex:"Codex"};e.s(["default",0,e=>{let{folderPath:i,agent:r="claude",canRespond:s=!0,onRespond:o}=e,l=(0,a.useTranslations)("terminal"),[c,d]=(0,n.useState)(null),u=async e=>{if(!c&&s){d(e);try{await o(e)}finally{d(null)}}};return(0,t.jsxs)("div",{className:"mt-4 w-full max-w-md rounded-lg border border-ui-amber/20 bg-ui-amber/5 px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2 text-xs font-medium text-ui-amber",children:[(0,t.jsx)(x,{size:14}),(0,t.jsx)("span",{children:l("trustPromptTitle")})]}),(0,t.jsx)("div",{className:"mb-3 break-all rounded bg-background/50 px-2 py-1.5 text-xs font-mono text-foreground",children:i}),(0,t.jsx)("p",{className:"mb-3 text-xs text-muted-foreground",children:l("trustPromptDescription",{agentName:R[r]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("button",{disabled:null!==c||!s,onClick:()=>u("yes"),className:"flex items-center gap-2.5 rounded-md border border-border/50 px-3 py-2 text-left text-sm transition-colors hover:border-ui-amber/30 hover:bg-ui-amber/5 disabled:opacity-50",children:[(0,t.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded bg-muted text-xs font-medium text-muted-foreground",children:"1"}),(0,t.jsx)("span",{className:"font-medium",children:l("trustPromptYes")})]}),(0,t.jsxs)("button",{disabled:null!==c||!s,onClick:()=>u("no"),className:"flex items-center gap-2.5 rounded-md border border-border/50 px-3 py-2 text-left text-sm transition-colors hover:border-ui-amber/30 hover:bg-ui-amber/5 disabled:opacity-50",children:[(0,t.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded bg-muted text-xs font-medium text-muted-foreground",children:"2"}),(0,t.jsx)("span",{className:"font-medium",children:l("trustPromptNo")})]})]})]})}],165137)},140032,867202,536838,552797,817885,895764,457619,3812,623076,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(651175),a=e.i(821954),r=e.i(998234),s=e.i(698677);let o=(0,n.createContext)(void 0);e.s(["EditorCwdContext",0,o,"default",0,e=>{let{href:i,children:l,node:c,...d}=e,u=(0,n.useContext)(o),m=(0,r.parseEditorFileLink)(i??"",u),_=(0,a.default)(m);return _?(0,t.jsx)("a",{...d,href:_,onClick:e=>{e.preventDefault(),(0,s.openEditorTarget)(_)},children:l}):(0,t.jsx)("a",{...d,href:i?.startsWith("file:")?void 0:i,target:"_blank",rel:"noopener noreferrer",children:l})},"editorMarkdownUrlTransform",0,(e,t)=>"href"===t&&(0,r.parseEditorFileLink)(e,"/")?e:(0,i.defaultUrlTransform)(e)],140032);var l=e.i(205270);let c=(0,l.default)("octagon-x",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["OctagonX",0,c],867202);let d=(0,l.default)("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]);e.s(["ChevronsUp",0,d],536838);let u=(0,l.default)("message-square-more",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 11h.01",key:"z322tv"}],["path",{d:"M16 11h.01",key:"xkw8gn"}],["path",{d:"M8 11h.01",key:"1dfujw"}]]);e.s(["MessageSquareMore",0,u],552797);class m{diff(e,t){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"function"==typeof i?(n=i,i={}):"callback"in i&&(n=i.callback);let a=this.castInput(e,i),r=this.castInput(t,i),s=this.removeEmpty(this.tokenize(a,i)),o=this.removeEmpty(this.tokenize(r,i));return this.diffWithOptionsObj(s,o,i,n)}diffWithOptionsObj(e,t,n,i){var a;let r=e=>(e=this.postProcess(e,n),i)?void setTimeout(function(){i(e)},0):e,s=t.length,o=e.length,l=1,c=s+o;null!=n.maxEditLength&&(c=Math.min(c,n.maxEditLength));let d=null!=(a=n.timeout)?a:1/0,u=Date.now()+d,m=[{oldPos:-1,lastComponent:void 0}],_=this.extractCommon(m[0],t,e,0,n);if(m[0].oldPos+1>=o&&_+1>=s)return r(this.buildValues(m[0].lastComponent,t,e));let p=-1/0,g=1/0,f=()=>{for(let i=Math.max(p,-l);i<=Math.min(g,l);i+=2){let a,l=m[i-1],c=m[i+1];l&&(m[i-1]=void 0);let d=!1;if(c){let e=c.oldPos-i;d=c&&0<=e&&e<s}let u=l&&l.oldPos+1<o;if(!d&&!u){m[i]=void 0;continue}if(a=!u||d&&l.oldPos<c.oldPos?this.addToPath(c,!0,!1,0,n):this.addToPath(l,!1,!0,1,n),_=this.extractCommon(a,t,e,i,n),a.oldPos+1>=o&&_+1>=s)return r(this.buildValues(a.lastComponent,t,e))||!0;m[i]=a,a.oldPos+1>=o&&(g=Math.min(g,i-1)),_+1>=s&&(p=Math.max(p,i+1))}l++};if(i)!function e(){setTimeout(function(){if(l>c||Date.now()>u)return i(void 0);f()||e()},0)}();else for(;l<=c&&Date.now()<=u;){let e=f();if(e)return e}}addToPath(e,t,n,i,a){let r=e.lastComponent;return r&&!a.oneChangePerToken&&r.added===t&&r.removed===n?{oldPos:e.oldPos+i,lastComponent:{count:r.count+1,added:t,removed:n,previousComponent:r.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:t,removed:n,previousComponent:r}}}extractCommon(e,t,n,i,a){let r=t.length,s=n.length,o=e.oldPos,l=o-i,c=0;for(;l+1<r&&o+1<s&&this.equals(n[o+1],t[l+1],a);)l++,o++,c++,a.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!a.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=o,l}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let i,a=[];for(;e;)a.push(e),i=e.previousComponent,delete e.previousComponent,e=i;a.reverse();let r=a.length,s=0,o=0,l=0;for(;s<r;s++){let e=a[s];if(e.removed)e.value=this.join(n.slice(l,l+e.count)),l+=e.count;else{if(!e.added&&this.useLongestToken){let i=t.slice(o,o+e.count);i=i.map(function(e,t){let i=n[l+t];return i.length>e.length?i:e}),e.value=this.join(i)}else e.value=this.join(t.slice(o,o+e.count));o+=e.count,e.added||(l+=e.count)}}return a}}let _=new class extends m{constructor(){super(...arguments),this.tokenize=p}equals(e,t,n){return n.ignoreWhitespace?(n.newlineIsToken&&e.includes("\n")||(e=e.trim()),n.newlineIsToken&&t.includes("\n")||(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith("\n")&&(e=e.slice(0,-1)),t.endsWith("\n")&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function p(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));let n=[],i=e.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let e=0;e<i.length;e++){let a=i[e];e%2&&!t.newlineIsToken?n[n.length-1]+=a:n.push(a)}return n}e.s(["diffLines",0,function(e,t,n){return _.diff(e,t,n)}],817885);let g={damping:.7,stiffness:.05,mass:1.25},f=1e3/60,h=!1;function E(e,t){let i=(0,n.useCallback)(t=>(i.current=t,e(t)),t);return i}globalThis.document?.addEventListener("mousedown",()=>{h=!0}),globalThis.document?.addEventListener("mouseup",()=>{h=!1}),globalThis.document?.addEventListener("click",()=>{h=!1});let S=new Map;function b(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i={...g},a=!1;for(let e of t){if("instant"===e){a=!0;continue}"object"==typeof e&&(a=!1,i.damping=e.damping??i.damping,i.stiffness=e.stiffness??i.stiffness,i.mass=e.mass??i.mass)}let r=JSON.stringify(i);return S.has(r)||S.set(r,Object.freeze(i)),a?"instant":S.get(r)}e.s(["useStickToBottom",0,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,i]=(0,n.useState)(!1),[a,r]=(0,n.useState)(!1!==e.initial),[s,o]=(0,n.useState)(!1),l=(0,n.useRef)(null);l.current=e;let c=(0,n.useCallback)(()=>{if(!h)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(v.current)||v.current?.contains(t.commonAncestorContainer)},[]),d=(0,n.useCallback)(e=>{m.isAtBottom=e,r(e)},[]),u=(0,n.useCallback)(e=>{m.escapedFromLock=e,i(e)},[]),m=(0,n.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:a,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return v.current?.scrollTop??0},set scrollTop(scrollTop){v.current&&(v.current.scrollTop=scrollTop,m.ignoreScrollToTop=v.current.scrollTop)},get targetScrollTop(){if(!v.current||!T.current)return 0;return v.current.scrollHeight-1-v.current.clientHeight},get calculatedTargetScrollTop(){if(!v.current||!T.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let i=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:v.current,contentElement:T.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:i},requestAnimationFrame(()=>{n=void 0}),i},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=70}}},[]),_=(0,n.useCallback)(function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"string"==typeof t&&(t={animation:t}),t.preserveScrollPosition||d(!0);let n=Date.now()+(Number(t.wait)||0),i=b(l.current,t.animation),{ignoreEscapes:a=!1}=t,r=m.calculatedTargetScrollTop;t.duration instanceof Promise?t.duration.finally(()=>{e=Date.now()}):e=n+(t.duration??0);let s=async()=>{let t=new Promise(requestAnimationFrame).then(()=>{if(!m.isAtBottom)return m.animation=void 0,!1;let{scrollTop:o}=m,d=performance.now(),u=(d-(m.lastTick??d))/f;if(m.animation||(m.animation={behavior:i,promise:t,ignoreEscapes:a}),m.animation.behavior===i&&(m.lastTick=d),c()||n>Date.now())return s();if(o<Math.min(r,m.calculatedTargetScrollTop)){if(m.animation?.behavior===i){if("instant"===i)return m.scrollTop=m.calculatedTargetScrollTop,s();m.velocity=(i.damping*m.velocity+i.stiffness*m.scrollDifference)/i.mass,m.accumulated+=m.velocity*u,m.scrollTop+=m.accumulated,m.scrollTop!==o&&(m.accumulated=0)}return s()}return e>Date.now()?(r=m.calculatedTargetScrollTop,s()):(m.animation=void 0,m.scrollTop<m.calculatedTargetScrollTop)?_({animation:b(l.current,l.current.resize),ignoreEscapes:a,duration:Math.max(0,e-Date.now())||void 0}):m.isAtBottom});return t.then(e=>(requestAnimationFrame(()=>{m.animation||(m.lastTick=void 0,m.velocity=0)}),e))};return(!0!==t.wait&&(m.animation=void 0),m.animation?.behavior===i)?m.animation.promise:s()},[d,c,m]),p=(0,n.useCallback)(()=>{u(!0),d(!1)},[u,d]),g=(0,n.useCallback)(e=>{let{target:t}=e;if(t!==v.current)return;let{scrollTop:n,ignoreScrollToTop:i}=m,{lastScrollTop:a=n}=m;m.lastScrollTop=n,m.ignoreScrollToTop=void 0,i&&i>n&&(a=i),o(m.isNearBottom),setTimeout(()=>{if(m.resizeDifference||n===i)return;if(c()){u(!0),d(!1);return}let e=n>a,t=n<a;if(m.animation?.ignoreEscapes){m.scrollTop=a;return}t&&(u(!0),d(!1)),e&&u(!1),!m.escapedFromLock&&m.isNearBottom&&d(!0)},1)},[u,d,c,m]),S=(0,n.useCallback)(e=>{let{target:t,deltaY:n}=e,i=t;for(;!["scroll","auto"].includes(getComputedStyle(i).overflow);){if(!i.parentElement)return;i=i.parentElement}i===v.current&&n<0&&v.current.scrollHeight>v.current.clientHeight&&!m.animation?.ignoreEscapes&&(u(!0),d(!1))},[u,d,m]),v=E(e=>{v.current?.removeEventListener("scroll",g),v.current?.removeEventListener("wheel",S),e?.addEventListener("scroll",g,{passive:!0}),e?.addEventListener("wheel",S,{passive:!0})},[]),T=E(e=>{let t;m.resizeObserver?.disconnect(),e&&(m.resizeObserver=new ResizeObserver(e=>{let[n]=e,{height:i}=n.contentRect,a=i-(t??i);if(m.resizeDifference=a,m.scrollTop>m.targetScrollTop&&(m.scrollTop=m.targetScrollTop),o(m.isNearBottom),a>=0){let e=b(l.current,t?l.current.resize:l.current.initial);_({animation:e,wait:!0,preserveScrollPosition:!0,duration:"instant"===e?void 0:350})}else m.isNearBottom&&(u(!1),d(!0));t=i,requestAnimationFrame(()=>{setTimeout(()=>{m.resizeDifference===a&&(m.resizeDifference=0)},1)})}),m.resizeObserver?.observe(e))},[]);return{contentRef:T,scrollRef:v,scrollToBottom:_,stopScroll:p,isAtBottom:a||s,isNearBottom:s,escapedFromLock:t,state:m}}],895764);var v=e.i(352819),T=e.i(353533);let y=(0,n.memo)(e=>{let{entry:i}=e,a=(0,v.useTranslations)("timeline"),[r,s]=(0,n.useState)(!1),[o,l]=(0,n.useState)(i.pending),[c,d]=(0,n.useState)(!1),[u,m]=(0,n.useState)(!1),_=(0,n.useRef)(null);o!==i.pending&&(l(i.pending),s(!1)),(0,n.useEffect)(()=>{if(!i.pending)return;let e=setTimeout(()=>s(!0),3e3);return()=>clearTimeout(e)},[i.pending]),(0,n.useEffect)(()=>{let e=_.current;if(!e)return;let t=()=>m(e.scrollHeight-e.clientHeight>1);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[i.text,c]);let p=!0===i.fadingOut,g=i.pending&&r,f=i.images&&i.images.length>0,h=i.text.length>0,E=!c,S=u||c;return(0,t.jsx)("div",{className:"animate-in fade-in duration-150 flex justify-end",children:(0,t.jsxs)("div",{className:(0,T.cn)("bg-ui-blue/10 rounded-lg px-4 py-2.5 max-w-[85%] transition-opacity",p?"duration-200":"duration-500",p?"opacity-0":g&&"opacity-50"),children:[f&&(0,t.jsx)("div",{className:(0,T.cn)("flex flex-wrap gap-2",h&&"mb-2"),children:i.images.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>(e=>{let t=e.match(/^data:([^;]+);base64,(.+)$/);if(!t)return void window.open(e,"_blank","noopener,noreferrer");let[,n,i]=t,a=atob(i),r=new Uint8Array(a.length);for(let e=0;e<a.length;e++)r[e]=a.charCodeAt(e);let s=URL.createObjectURL(new Blob([r],{type:n}));window.open(s,"_blank","noopener,noreferrer"),setTimeout(()=>URL.revokeObjectURL(s),6e4)})(e),className:"cursor-zoom-in",children:(0,t.jsx)("img",{src:e,alt:"",className:"max-h-[200px] w-auto rounded-md object-contain",loading:"lazy"})},e))}),h&&(0,t.jsx)("p",{ref:_,className:(0,T.cn)("text-sm whitespace-pre-wrap break-words",E&&"line-clamp-6"),children:i.text}),h&&S&&(0,t.jsx)("button",{type:"button",onClick:()=>d(e=>!e),className:"text-xs mt-1.5 text-muted-foreground hover:underline",children:a(c?"collapseMessage":"expandMessage")})]})})});function C(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let i=0,a=n.indexOf(t);for(;-1!==a;)i++,a=n.indexOf(t,a+t.length);return i}e.s(["default",0,y],457619);var N=e.i(305400),x=e.i(733473),R=e.i(931188),O=e.i(443689);let I="phrasing",A=["autolink","link","image","label"];function w(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function D(e){this.config.enter.autolinkProtocol.call(this,e)}function L(e){this.config.exit.autolinkProtocol.call(this,e)}function M(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];(0,N.ok)("link"===t.type),t.url="http://"+this.sliceSerialize(e)}function k(e){this.config.exit.autolinkEmail.call(this,e)}function P(e){this.exit(e)}function F(e){!function(e,t,n){let i=(0,O.convert)((n||{}).ignore||[]),a=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],i=-1;for(;++i<n.length;){var a;let e=n[i];t.push(["string"==typeof(a=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(a),"g"):a,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),r=-1;for(;++r<a.length;)(0,R.visitParents)(e,"text",s);function s(e,t){let n,s=-1;for(;++s<t.length;){let e=t[s],a=n?n.children:void 0;if(i(e,a?a.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],i=a[r][0],s=a[r][1],o=0,l=n.children.indexOf(e),c=!1,d=[];i.lastIndex=0;let u=i.exec(e.value);for(;u;){let n=u.index,a={index:u.index,input:u.input,stack:[...t,e]},r=s(...u,a);if("string"==typeof r&&(r=r.length>0?{type:"text",value:r}:void 0),!1===r?i.lastIndex=n+1:(o!==n&&d.push({type:"text",value:e.value.slice(o,n)}),Array.isArray(r)?d.push(...r):r&&d.push(r),o=n+u[0].length,c=!0),!i.global)break;u=i.exec(e.value)}return c?(o<e.value.length&&d.push({type:"text",value:e.value.slice(o)}),n.children.splice(l,1,...d)):d=[e],l+d.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,U],[/(^|(?=[\u0000-\uFFFF])[\s\p{P}\p{S}])([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,B]],{ignore:["link","linkReference"]})}function U(e,t,n,i,a){let r,s="";if(!G(a))return!1;if(/^w/i.test(t)&&(n=t+n,t="",s="http://"),(r=n.split(".")).length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))return!1;let o=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")"),a=C(e,"("),r=C(e,")");for(;-1!==i&&a>r;)e+=n.slice(0,i+1),i=(n=n.slice(i+1)).indexOf(")"),r++;return[e,n]}(n+i);if(!o[0])return!1;let l={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function B(e,t,n,i,a){if(!G({...a,index:a.index+t.length},!0)||/[-\d_]$/.test(i))return!1;let r={type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]};return t?[{type:"text",value:t},r]:r}function G(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||(0,x.unicodeWhitespace)(n)||(0,x.unicodePunctuation)(n))&&(!t||47!==n)}var j=e.i(657699);function Y(){this.buffer()}function H(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function V(){this.buffer()}function $(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function z(e){let t=this.resume(),n=this.stack[this.stack.length-1];(0,N.ok)("footnoteReference"===n.type),n.identifier=(0,j.normalizeIdentifier)(this.sliceSerialize(e)).toLowerCase(),n.label=t}function q(e){this.exit(e)}function W(e){let t=this.resume(),n=this.stack[this.stack.length-1];(0,N.ok)("footnoteDefinition"===n.type),n.identifier=(0,j.normalizeIdentifier)(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Q(e){this.exit(e)}function K(e,t,n,i){let a=n.createTracker(i),r=a.move("[^"),s=n.enter("footnoteReference"),o=n.enter("reference");return r+=a.move(n.safe(n.associationId(e),{after:"]",before:r})),o(),s(),r+=a.move("]")}function X(e,t,n){return 0===t?e:Z(e,t,n)}function Z(e,t,n){return(n?"":" ")+e}K.peek=function(){return"["};let J=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function ee(e){this.enter({type:"delete",children:[]},e)}function et(e){this.exit(e)}function en(e,t,n,i){let a=n.createTracker(i),r=n.enter("strikethrough"),s=a.move("~~");return s+=n.containerPhrasing(e,{...a.current(),before:s,after:"~"}),s+=a.move("~~"),r(),s}function ei(e){return e.length}function ea(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:114*(82===t||114===t)}en.peek=function(){return"~"};var er=e.i(593822);e.i(869701);e.i(554792);function es(e,t,n){let i=e.value||"",a="`",r=-1;for(;RegExp("(^|[^`])"+a+"([^`]|$)").test(i);)a+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++r<n.unsafe.length;){let e,t=n.unsafe[r],a=n.compilePattern(t);if(t.atBreak)for(;e=a.exec(i);){let t=e.index;10===i.charCodeAt(t)&&13===i.charCodeAt(t-1)&&t--,i=i.slice(0,t)+" "+i.slice(e.index+1)}}return a+i+a}es.peek=function(){return"`"};(0,O.convert)(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let eo=function(e,t,n,i){let a=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),r=n.bulletCurrent||function(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(r=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+r);let s=r.length+1;("tab"===a||"mixed"===a&&(t&&"list"===t.type&&t.spread||e.spread))&&(s=4*Math.ceil(s/4));let o=n.createTracker(i);o.move(r+" ".repeat(s-r.length)),o.shift(s);let l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),function(e,t,n){return t?(n?"":" ".repeat(s))+e:(n?r:r+" ".repeat(s-r.length))+e});return l(),c};function el(e){let t=e._align;(0,N.ok)(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function ec(e){this.exit(e),this.data.inTable=void 0}function ed(e){this.enter({type:"tableRow",children:[]},e)}function eu(e){this.exit(e)}function em(e){this.enter({type:"tableCell",children:[]},e)}function e_(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ep));let n=this.stack[this.stack.length-1];(0,N.ok)("inlineCode"===n.type),n.value=t,this.exit(e)}function ep(e,t){return"|"===t?t:e}function eg(e){let t=this.stack[this.stack.length-2];(0,N.ok)("listItem"===t.type),t.checked="taskListCheckValueChecked"===e.type}function ef(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];(0,N.ok)("paragraph"===e.type);let n=e.children[0];if(n&&"text"===n.type){let i,a=t.children,r=-1;for(;++r<a.length;){let e=a[r];if("paragraph"===e.type){i=e;break}}i===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function eh(e,t,n,i){let a=e.children[0],r="boolean"==typeof e.checked&&a&&"paragraph"===a.type,s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(i);r&&o.move(s);let l=eo(e,t,n,{...i,...o.current()});return r&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+s})),l}var eE=e.i(383166);let eS={tokenize:function(e,t,n){let i=0;return function t(r){return(87===r||119===r)&&i<3?(i++,e.consume(r),t):46===r&&3===i?(e.consume(r),a):n(r)};function a(e){return null===e?n(e):t(e)}},partial:!0},eb={tokenize:function(e,t,n){let i,a,r;return s;function s(t){return 46===t||95===t?e.check(eT,l,o)(t):null===t||(0,x.markdownLineEndingOrSpace)(t)||(0,x.unicodeWhitespace)(t)||45!==t&&(0,x.unicodePunctuation)(t)?l(t):(r=!0,e.consume(t),s)}function o(t){return 95===t?i=!0:(a=i,i=void 0),e.consume(t),s}function l(e){return a||i||!r?n(e):t(e)}},partial:!0},ev={tokenize:function(e,t){let n=0,i=0;return a;function a(s){return 40===s?(n++,e.consume(s),a):41===s&&i<n?r(s):33===s||34===s||38===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||60===s||63===s||93===s||95===s||126===s?e.check(eT,t,r)(s):null===s||(0,x.markdownLineEndingOrSpace)(s)||(0,x.unicodeWhitespace)(s)?t(s):(e.consume(s),a)}function r(t){return 41===t&&i++,e.consume(t),a}},partial:!0},eT={tokenize:function(e,t,n){return i;function i(s){return 33===s||34===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||63===s||95===s||126===s?(e.consume(s),i):38===s?(e.consume(s),r):93===s?(e.consume(s),a):60===s||null===s||(0,x.markdownLineEndingOrSpace)(s)||(0,x.unicodeWhitespace)(s)?t(s):n(s)}function a(e){return null===e||40===e||91===e||(0,x.markdownLineEndingOrSpace)(e)||(0,x.unicodeWhitespace)(e)?t(e):i(e)}function r(t){return(0,x.asciiAlpha)(t)?function t(a){return 59===a?(e.consume(a),i):(0,x.asciiAlpha)(a)?(e.consume(a),t):n(a)}(t):n(t)}},partial:!0},ey={tokenize:function(e,t,n){return function(t){return e.consume(t),i};function i(e){return(0,x.asciiAlphanumeric)(e)?n(e):t(e)}},partial:!0},eC={name:"wwwAutolink",tokenize:function(e,t,n){let i=this;return function(t){return 87!==t&&119!==t||!eI.call(i,i.previous)||eL(i.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(eS,e.attempt(eb,e.attempt(ev,a),n),n)(t))};function a(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:eI},eN={name:"protocolAutolink",tokenize:function(e,t,n){let i=this,a="",r=!1;return function(t){return(72===t||104===t)&&eA.call(i,i.previous)&&!eL(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(t),e.consume(t),s):n(t)};function s(t){if((0,x.asciiAlpha)(t)&&a.length<5)return a+=String.fromCodePoint(t),e.consume(t),s;if(58===t){let n=a.toLowerCase();if("http"===n||"https"===n)return e.consume(t),o}return n(t)}function o(t){return 47===t?(e.consume(t),r)?l:(r=!0,o):n(t)}function l(t){return null===t||(0,x.asciiControl)(t)||(0,x.markdownLineEndingOrSpace)(t)||(0,x.unicodeWhitespace)(t)||(0,x.unicodePunctuation)(t)?n(t):e.attempt(eb,e.attempt(ev,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:eA},ex={name:"emailAutolink",tokenize:function(e,t,n){let i,a,r=this;return function(t){return!eD(t)||!ew.call(r,r.previous)||eL(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(i){return eD(i)?(e.consume(i),t):64===i?(e.consume(i),s):n(i)}(t))};function s(t){return 46===t?e.check(ey,l,o)(t):45===t||95===t||(0,x.asciiAlphanumeric)(t)?(a=!0,e.consume(t),s):l(t)}function o(t){return e.consume(t),i=!0,s}function l(s){return a&&i&&(0,x.asciiAlpha)(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(s)):n(s)}},previous:ew},eR={},eO=48;for(;eO<123;)eR[eO]=ex,58==++eO?eO=65:91===eO&&(eO=97);function eI(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||(0,x.markdownLineEndingOrSpace)(e)}function eA(e){return!(0,x.asciiAlpha)(e)}function ew(e){return!(47===e||eD(e))}function eD(e){return 43===e||45===e||46===e||95===e||(0,x.asciiAlphanumeric)(e)}function eL(e){let t=e.length,n=!1;for(;t--;){let i=e[t][1];if(("labelLink"===i.type||"labelImage"===i.type)&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}eR[43]=ex,eR[45]=ex,eR[46]=ex,eR[95]=ex,eR[72]=[ex,eN],eR[104]=[ex,eN],eR[87]=[ex,eC],eR[119]=[ex,eC];var eM=e.i(959323),ek=e.i(526912);let eP={tokenize:function(e,t,n){let i=this;return(0,ek.factorySpace)(e,function(e){let a=i.events[i.events.length-1];return a&&"gfmFootnoteDefinitionIndent"===a[1].type&&4===a[2].sliceSerialize(a[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function eF(e,t,n){let i,a=this,r=a.events.length,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);for(;r--;){let e=a.events[r][1];if("labelImage"===e.type){i=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(r){if(!i||!i._balanced)return n(r);let o=(0,j.normalizeIdentifier)(a.sliceSerialize({start:i.end,end:a.now()}));return 94===o.codePointAt(0)&&s.includes(o.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(r),e.exit("gfmFootnoteCallLabelMarker"),t(r)):n(r)}}function eU(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;let r={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},r.start),end:Object.assign({},r.end)},o=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...o),e}function eB(e,t,n){let i,a=this,r=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]),s=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),o};function o(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(o){if(s>999||93===o&&!i||null===o||91===o||(0,x.markdownLineEndingOrSpace)(o))return n(o);if(93===o){e.exit("chunkString");let i=e.exit("gfmFootnoteCallString");return r.includes((0,j.normalizeIdentifier)(a.sliceSerialize(i)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(o)}return(0,x.markdownLineEndingOrSpace)(o)||(i=!0),s++,e.consume(o),92===o?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),s++,l):l(t)}}function eG(e,t,n){let i,a,r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(o>999||93===t&&!a||null===t||91===t||(0,x.markdownLineEndingOrSpace)(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return i=(0,j.normalizeIdentifier)(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),u}return(0,x.markdownLineEndingOrSpace)(t)||(a=!0),o++,e.consume(t),92===t?d:c}function d(t){return 91===t||92===t||93===t?(e.consume(t),o++,c):c(t)}function u(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s.includes(i)||s.push(i),(0,ek.factorySpace)(e,m,"gfmFootnoteDefinitionWhitespace")):n(t)}function m(e){return t(e)}}function ej(e,t,n){return e.check(eM.blankLine,t,e.attempt(eP,t,n))}function eY(e){e.exit("gfmFootnoteDefinition")}var eH=e.i(847202),eV=e.i(433565);class e${constructor(){this.map=[]}add(e,t,n){!function(e,t,n,i){let a=0;if(0!==n||0!==i.length){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...i);return}a+=1}e.map.push([t,n,i])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let i=n.pop();for(;i;){for(let t of i)e.push(t);i=n.pop()}this.map.length=0}}function ez(e,t,n){let i,a=this,r=0,s=0;return function(e){let t=a.events.length-1;for(;t>-1;){let e=a.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let i=t>-1?a.events[t][1].type:null,r="tableHead"===i||"tableRow"===i?E:o;return r===E&&a.parser.lazy[a.now().line]?n(e):r(e)};function o(t){var n;return e.enter("tableHead"),e.enter("tableRow"),124===(n=t)||(i=!0,s+=1),l(n)}function l(t){return null===t?n(t):(0,x.markdownLineEnding)(t)?s>1?(s=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),u):n(t):(0,x.markdownSpace)(t)?(0,ek.factorySpace)(e,l,"whitespace")(t):(s+=1,i&&(i=!1,r+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),i=!0,l):(e.enter("data"),c(t))}function c(t){return null===t||124===t||(0,x.markdownLineEndingOrSpace)(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?d:c)}function d(t){return 92===t||124===t?(e.consume(t),c):c(t)}function u(t){return(a.interrupt=!1,a.parser.lazy[a.now().line])?n(t):(e.enter("tableDelimiterRow"),i=!1,(0,x.markdownSpace)(t))?(0,ek.factorySpace)(e,m,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):m(t)}function m(t){return 45===t||58===t?p(t):124===t?(i=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),_):n(t)}function _(t){return(0,x.markdownSpace)(t)?(0,ek.factorySpace)(e,p,"whitespace")(t):p(t)}function p(t){return 58===t?(s+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),g):45===t?(s+=1,g(t)):null===t||(0,x.markdownLineEnding)(t)?h(t):n(t)}function g(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),f):(e.exit("tableDelimiterFiller"),f(n))}(t)):n(t)}function f(t){return(0,x.markdownSpace)(t)?(0,ek.factorySpace)(e,h,"whitespace")(t):h(t)}function h(a){if(124===a)return m(a);if(null===a||(0,x.markdownLineEnding)(a))return i&&r===s?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(a)):n(a);return n(a)}function E(t){return e.enter("tableRow"),S(t)}function S(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),S):null===n||(0,x.markdownLineEnding)(n)?(e.exit("tableRow"),t(n)):(0,x.markdownSpace)(n)?(0,ek.factorySpace)(e,S,"whitespace")(n):(e.enter("data"),b(n))}function b(t){return null===t||124===t||(0,x.markdownLineEndingOrSpace)(t)?(e.exit("data"),S(t)):(e.consume(t),92===t?v:b)}function v(t){return 92===t||124===t?(e.consume(t),b):b(t)}}function eq(e,t){let n,i,a,r=-1,s=!0,o=0,l=[0,0,0,0],c=[0,0,0,0],d=!1,u=0,m=new e$;for(;++r<e.length;){let _=e[r],p=_[1];"enter"===_[0]?"tableHead"===p.type?(d=!1,0!==u&&(eQ(m,t,u,n,i),i=void 0,u=0),n={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},m.add(r,0,[["enter",n,t]])):"tableRow"===p.type||"tableDelimiterRow"===p.type?(s=!0,a=void 0,l=[0,0,0,0],c=[0,r+1,0,0],d&&(d=!1,i={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},m.add(r,0,[["enter",i,t]])),o="tableDelimiterRow"===p.type?2:i?3:1):o&&("data"===p.type||"tableDelimiterMarker"===p.type||"tableDelimiterFiller"===p.type)?(s=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],a=eW(m,t,l,o,void 0,a),l=[0,0,0,0]),c[2]=r)):"tableCellDivider"===p.type&&(s?s=!1:(0!==l[1]&&(c[0]=c[1],a=eW(m,t,l,o,void 0,a)),c=[(l=c)[1],r,0,0])):"tableHead"===p.type?(d=!0,u=r):"tableRow"===p.type||"tableDelimiterRow"===p.type?(u=r,0!==l[1]?(c[0]=c[1],a=eW(m,t,l,o,r,a)):0!==c[1]&&(a=eW(m,t,c,o,r,a)),o=0):o&&("data"===p.type||"tableDelimiterMarker"===p.type||"tableDelimiterFiller"===p.type)&&(c[3]=r)}for(0!==u&&eQ(m,t,u,n,i),m.consume(t.events),r=-1;++r<t.events.length;){let e=t.events[r];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,i=[];for(;t<e.length;){let a=e[t];if(n){if("enter"===a[0])"tableContent"===a[1].type&&i.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===a[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=i.length-1;i[e]="left"===i[e]?"center":"right"}}else if("tableDelimiterRow"===a[1].type)break}else"enter"===a[0]&&"tableDelimiterRow"===a[1].type&&(n=!0);t+=1}return i}(t.events,r))}return e}function eW(e,t,n,i,a,r){0!==n[0]&&(r.end=Object.assign({},eK(t.events,n[0])),e.add(n[0],0,[["exit",r,t]]));let s=eK(t.events,n[1]);if(r={type:1===i?"tableHeader":2===i?"tableDelimiter":"tableData",start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",r,t]]),0!==n[2]){let a=eK(t.events,n[2]),r=eK(t.events,n[3]),s={type:"tableContent",start:Object.assign({},a),end:Object.assign({},r)};if(e.add(n[2],0,[["enter",s,t]]),2!==i){let i=t.events[n[2]],a=t.events[n[3]];if(i[1].end=Object.assign({},a[1].end),i[1].type="chunkText",i[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,i=n[3]-n[2]-1;e.add(t,i,[])}}e.add(n[3]+1,0,[["exit",s,t]])}return void 0!==a&&(r.end=Object.assign({},eK(t.events,a)),e.add(a,0,[["exit",r,t]]),r=void 0),r}function eQ(e,t,n,i,a){let r=[],s=eK(t.events,n);a&&(a.end=Object.assign({},s),r.push(["exit",a,t])),i.end=Object.assign({},s),r.push(["exit",i,t]),e.add(n+1,0,r)}function eK(e,t){let n=e[t],i="enter"===n[0]?"start":"end";return n[1][i]}let eX={name:"tasklistCheck",tokenize:function(e,t,n){let i=this;return function(t){return null===i.previous&&i._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),a):n(t)};function a(t){return(0,x.markdownLineEndingOrSpace)(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),r):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),r):n(t)}function r(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(t)}function s(i){return(0,x.markdownLineEnding)(i)?t(i):(0,x.markdownSpace)(i)?e.check({tokenize:eZ},t,n)(i):n(i)}}};function eZ(e,t,n){return(0,ek.factorySpace)(e,function(e){return null===e?n(e):t(e)},"whitespace")}let eJ={};e.s(["default",0,function(e){var t;let n,i,a,r=e||eJ,s=this.data(),o=s.micromarkExtensions||(s.micromarkExtensions=[]),l=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),c=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);o.push((t=r,(0,eE.combineExtensions)([{text:eR},{document:{91:{name:"gfmFootnoteDefinition",tokenize:eG,continuation:{tokenize:ej},exit:eY}},text:{91:{name:"gfmFootnoteCall",tokenize:eB},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:eF,resolveTo:eU}}},(n=(t||{}).singleTilde,i={name:"strikethrough",tokenize:function(e,t,i){let a=this.previous,r=this.events,s=0;return function(o){return 126===a&&"characterEscape"!==r[r.length-1][1].type?i(o):(e.enter("strikethroughSequenceTemporary"),function r(o){let l=(0,er.classifyCharacter)(a);if(126===o)return s>1?i(o):(e.consume(o),s++,r);if(s<2&&!n)return i(o);let c=e.exit("strikethroughSequenceTemporary"),d=(0,er.classifyCharacter)(o);return c._open=!d||2===d&&!!l,c._close=!l||2===l&&!!d,t(o)}(o))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let i=n;for(;i--;)if("exit"===e[i][0]&&"strikethroughSequenceTemporary"===e[i][1].type&&e[i][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[i][1].end.offset-e[i][1].start.offset){e[n][1].type="strikethroughSequence",e[i][1].type="strikethroughSequence";let a={type:"strikethrough",start:Object.assign({},e[i][1].start),end:Object.assign({},e[n][1].end)},r={type:"strikethroughText",start:Object.assign({},e[i][1].end),end:Object.assign({},e[n][1].start)},s=[["enter",a,t],["enter",e[i][1],t],["exit",e[i][1],t],["enter",r,t]],o=t.parser.constructs.insideSpan.null;o&&(0,eH.splice)(s,s.length,0,(0,eV.resolveAll)(o,e.slice(i+1,n),t)),(0,eH.splice)(s,s.length,0,[["exit",r,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",a,t]]),(0,eH.splice)(e,i-1,n-i+3,s),n=i+s.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}},null==n&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:ez,resolveAll:eq}}},{text:{91:eX}}]))),l.push([{transforms:[F],enter:{literalAutolink:w,literalAutolinkEmail:D,literalAutolinkHttp:D,literalAutolinkWww:D},exit:{literalAutolink:P,literalAutolinkEmail:k,literalAutolinkHttp:L,literalAutolinkWww:M}},{enter:{gfmFootnoteCallString:Y,gfmFootnoteCall:H,gfmFootnoteDefinitionLabelString:V,gfmFootnoteDefinition:$},exit:{gfmFootnoteCallString:z,gfmFootnoteCall:q,gfmFootnoteDefinitionLabelString:W,gfmFootnoteDefinition:Q}},{canContainEols:["delete"],enter:{strikethrough:ee},exit:{strikethrough:et}},{enter:{table:el,tableData:em,tableHeader:em,tableRow:ed},exit:{codeText:e_,table:ec,tableData:eu,tableHeader:eu,tableRow:eu}},{exit:{taskListCheckValueChecked:eg,taskListCheckValueUnchecked:eg,paragraph:ef}}]),c.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:I,notInConstruct:A},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:I,notInConstruct:A},{character:":",before:"[ps]",after:"\\/",inConstruct:I,notInConstruct:A}]},(a=!1,r&&r.firstLineBlank&&(a=!0),{handlers:{footnoteDefinition:function(e,t,n,i){let r=n.createTracker(i),s=r.move("[^"),o=n.enter("footnoteDefinition"),l=n.enter("label");return s+=r.move(n.safe(n.associationId(e),{before:s,after:"]"})),l(),s+=r.move("]:"),e.children&&e.children.length>0&&(r.shift(4),s+=r.move((a?"\n":" ")+n.indentLines(n.containerFlow(e,r.current()),a?Z:X))),o(),s},footnoteReference:K},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:J}],handlers:{delete:en}},function(e){let t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,a=t.stringLength,r=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let i=es(e,t,n);return n.stack.includes("tableCell")&&(i=i.replace(/\|/g,"\\$&")),i},table:function(e,t,n,i){return o(function(e,t,n){let i=e.children,a=-1,r=[],s=t.enter("table");for(;++a<i.length;)r[a]=l(i[a],t,n);return s(),r}(e,n,i),e.align)},tableCell:s,tableRow:function(e,t,n,i){let a=o([l(e,n,i)]);return a.slice(0,a.indexOf("\n"))}}};function s(e,t,n,i){let a=n.enter("tableCell"),s=n.enter("phrasing"),o=n.containerPhrasing(e,{...i,before:r,after:r});return s(),a(),o}function o(e,t){return function(e,t){let n=t||{},i=(n.align||[]).concat(),a=n.stringLength||ei,r=[],s=[],o=[],l=[],c=0,d=-1;for(;++d<e.length;){let t=[],i=[],r=-1;for(e[d].length>c&&(c=e[d].length);++r<e[d].length;){var u;let s=null==(u=e[d][r])?"":String(u);if(!1!==n.alignDelimiters){let e=a(s);i[r]=e,(void 0===l[r]||e>l[r])&&(l[r]=e)}t.push(s)}s[d]=t,o[d]=i}let m=-1;if("object"==typeof i&&"length"in i)for(;++m<c;)r[m]=ea(i[m]);else{let e=ea(i);for(;++m<c;)r[m]=e}m=-1;let _=[],p=[];for(;++m<c;){let e=r[m],t="",i="";99===e?(t=":",i=":"):108===e?t=":":114===e&&(i=":");let a=!1===n.alignDelimiters?1:Math.max(1,l[m]-t.length-i.length),s=t+"-".repeat(a)+i;!1!==n.alignDelimiters&&((a=t.length+a+i.length)>l[m]&&(l[m]=a),p[m]=a),_[m]=s}s.splice(1,0,_),o.splice(1,0,p),d=-1;let g=[];for(;++d<s.length;){let e=s[d],t=o[d];m=-1;let i=[];for(;++m<c;){let a=e[m]||"",s="",o="";if(!1!==n.alignDelimiters){let e=l[m]-(t[m]||0),n=r[m];114===n?s=" ".repeat(e):99===n?e%2?(s=" ".repeat(e/2+.5),o=" ".repeat(e/2-.5)):o=s=" ".repeat(e/2):o=" ".repeat(e)}!1===n.delimiterStart||m||i.push("|"),!1!==n.padding&&(!1!==n.alignDelimiters||""!==a)&&(!1!==n.delimiterStart||m)&&i.push(" "),!1!==n.alignDelimiters&&i.push(s),i.push(a),!1!==n.alignDelimiters&&i.push(o),!1!==n.padding&&i.push(" "),(!1!==n.delimiterEnd||m!==c-1)&&i.push("|")}g.push(!1===n.delimiterEnd?i.join("").replace(/ +$/,""):i.join(""))}return g.join("\n")}(e,{align:t,alignDelimiters:i,padding:n,stringLength:a})}function l(e,t,n){let i=e.children,a=-1,r=[],o=t.enter("tableRow");for(;++a<i.length;)r[a]=s(i[a],e,t,n);return o(),r}}(r),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:eh}}]})}],3812);let e0=function(e,t,n){let i=(0,O.convert)(n);if(!e||!e.type||!e.children)throw Error("Expected parent node");if("number"==typeof t){if(t<0||t===1/0)throw Error("Expected positive finite number as index")}else if((t=e.children.indexOf(t))<0)throw Error("Expected child node or index");for(;++t<e.children.length;)if(i(e.children[t],t,e))return e.children[t]},e1=function(e){if(null==e)return e3;if("string"==typeof e){var t;return t=e,e2(function(e){return e.tagName===t})}if("object"==typeof e){var n=e;let t=[],i=-1;for(;++i<n.length;)t[i]=e1(n[i]);return e2(function(){for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];let a=-1;for(;++a<t.length;)if(t[a].apply(this,n))return!0;return!1})}if("function"==typeof e)return e2(e);throw Error("Expected function, string, or array as `test`")};function e2(e){return function(t,n,i){var a;return!!(null!==(a=t)&&"object"==typeof a&&"type"in a&&"tagName"in a&&e.call(this,t,"number"==typeof n?n:void 0,i||void 0))}}function e3(e){return!!(e&&"object"==typeof e&&"type"in e&&"element"===e.type&&"tagName"in e&&"string"==typeof e.tagName)}let e5=/\n/g,e4=/[\t ]+/g,e9=e1("br"),e6=e1(function(e){return"td"===e.tagName||"th"===e.tagName}),e7=e1("p"),e8=e1("tr"),te=e1(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",function(e){return!!(e.properties||{}).hidden},function(e){return"dialog"===e.tagName&&!(e.properties||{}).open}]),tt=e1(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function tn(e,t){let n,i=String(e.value),a=[],r=[],s=0;for(;s<=i.length;){e5.lastIndex=s;let e=e5.exec(i),n=e&&"index"in e?e.index:i.length;a.push(function(e,t,n){let i,a=[],r=0;for(;r<e.length;){e4.lastIndex=r;let n=e4.exec(e);i=n?n.index:e.length,r||i||!n||t||a.push(""),r!==i&&a.push(e.slice(r,i)),r=n?i+n[0].length:i}return r===i||n||a.push(""),a.join(" ")}(i.slice(s,n).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),0!==s||t.breakBefore,n!==i.length||t.breakAfter)),s=n+1}let o=-1;for(;++o<a.length;)8203===a[o].charCodeAt(a[o].length-1)||o<a.length-1&&8203===a[o+1].charCodeAt(0)?(r.push(a[o]),n=void 0):a[o]?("number"==typeof n&&r.push(n),r.push(a[o]),n=0):(0===o||o===a.length-1)&&r.push(0);return r}function ti(e,t){if("element"===e.type){let n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}e.s(["toText",0,function(e,t){let n,i="children"in e?e.children:[],a=tt(e),r=ti(e,{whitespace:(t||{}).whitespace||"normal",breakBefore:!1,breakAfter:!1}),s=[];("text"===e.type||"comment"===e.type)&&s.push(...tn(e,{whitespace:r,breakBefore:!0,breakAfter:!0}));let o=-1;for(;++o<i.length;)s.push(...function e(t,n,i){return"element"===t.type?function(t,n,i){let a,r,s=ti(t,i),o=t.children||[],l=-1,c=[];if(te(t))return c;for(e9(t)||e8(t)&&e0(n,t,e8)?r="\n":e7(t)?(a=2,r=2):tt(t)&&(a=1,r=1);++l<o.length;)c=c.concat(e(o[l],t,{whitespace:s,breakBefore:l?void 0:a,breakAfter:l<o.length-1?e9(o[l+1]):r}));return e6(t)&&e0(n,t,e6)&&c.push(" "),a&&c.unshift(a),r&&c.push(r),c}(t,n,i):"text"===t.type?"normal"===i.whitespace?tn(t,i):[String(t.value)]:[]}(i[o],e,{whitespace:r,breakBefore:o?void 0:a,breakAfter:o<i.length-1?e9(i[o+1]):a}));let l=[];for(o=-1;++o<s.length;){let e=s[o];"number"==typeof e?void 0!==n&&e>n&&(n=e):e&&(void 0!==n&&n>-1&&l.push("\n".repeat(n)||" "),n=-1,l.push(e))}return l.join("")}],623076)},865920,e=>{"use strict";var t=e.i(722322);e.s(["common",()=>t.grammars])},116925,30502,e=>{"use strict";var t=e.i(391398),n=e.i(140032),i=e.i(191788),a=e.i(407654),r=e.i(3812),s=e.i(623076),o=e.i(865920),l=e.i(914126),c=e.i(869701);let d={};function u(e){let t=e||d,n=t.aliases,i=t.detect||!1,a=t.languages||o.common,r=t.plainText,u=t.prefix,m=t.subset,_="hljs",p=(0,l.createLowlight)(a);if(n&&p.registerAlias(n),u){let e=u.indexOf("-");_=-1===e?u:u.slice(0,e)}return function(e,t){(0,c.visit)(e,"element",function(e,n,a){let o;if("code"!==e.tagName||!a||"element"!==a.type||"pre"!==a.tagName)return;let l=function(e){let t,n=e.properties.className,i=-1;if(Array.isArray(n)){for(;++i<n.length;){let e=String(n[i]);if("no-highlight"===e||"nohighlight"===e)return!1;t||"lang-"!==e.slice(0,5)||(t=e.slice(5)),t||"language-"!==e.slice(0,9)||(t=e.slice(9))}return t}}(e);if(!1===l||!l&&!i||l&&r&&r.includes(l))return;Array.isArray(e.properties.className)||(e.properties.className=[]),e.properties.className.includes(_)||e.properties.className.unshift(_);let c=(0,s.toText)(e,{whitespace:"pre"});try{o=l?p.highlight(l,c,{prefix:u}):p.highlightAuto(c,{prefix:u,subset:m})}catch(n){if(l&&/Unknown language/.test(n.message))return void t.message("Cannot highlight as `"+l+"`, it’s not registered",{ancestors:[a,e],cause:n,place:e.position,ruleId:"missing-language",source:"rehype-highlight"});throw n}!l&&o.data&&o.data.language&&e.properties.className.push("language-"+o.data.language),o.children.length>0&&(e.children=o.children)})}}e.s(["default",0,u],30502);let m=[r.default],_=[u],p={a:n.default},g=(0,i.memo)(e=>{let{entry:i}=e;return(0,t.jsx)("div",{className:"animate-in fade-in duration-150",children:(0,t.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none break-words text-sm [&_h1]:text-[1.6em] [&_h1]:mt-[1.4em] [&_h1]:mb-[0.6em] [&_pre]:bg-muted [&_pre]:rounded-md [&_pre]:p-3 [&_pre_code]:text-foreground [&_code]:text-[0.9em] [&_code.hljs]:text-[1em] [&_code]:font-normal [&_code]:font-mono [&_code::before]:content-none [&_code::after]:content-none",children:(0,t.jsx)(a.default,{remarkPlugins:m,rehypePlugins:_,components:p,urlTransform:n.editorMarkdownUrlTransform,children:i.markdown??""})})})});e.s(["default",0,g],116925)},901160,387561,912643,748486,865013,815226,864852,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(377216),a=e.i(353533),r=e.i(116925),s=e.i(352819),o=e.i(603331),l=e.i(744391),c=e.i(322966);class d{diff(e,t){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"function"==typeof i?(n=i,i={}):"callback"in i&&(n=i.callback);let a=this.castInput(e,i),r=this.castInput(t,i),s=this.removeEmpty(this.tokenize(a,i)),o=this.removeEmpty(this.tokenize(r,i));return this.diffWithOptionsObj(s,o,i,n)}diffWithOptionsObj(e,t,n,i){var a;let r=e=>(e=this.postProcess(e,n),i)?void setTimeout(function(){i(e)},0):e,s=t.length,o=e.length,l=1,c=s+o;null!=n.maxEditLength&&(c=Math.min(c,n.maxEditLength));let d=null!=(a=n.timeout)?a:1/0,u=Date.now()+d,m=[{oldPos:-1,lastComponent:void 0}],_=this.extractCommon(m[0],t,e,0,n);if(m[0].oldPos+1>=o&&_+1>=s)return r(this.buildValues(m[0].lastComponent,t,e));let p=-1/0,g=1/0,f=()=>{for(let i=Math.max(p,-l);i<=Math.min(g,l);i+=2){let a,l=m[i-1],c=m[i+1];l&&(m[i-1]=void 0);let d=!1;if(c){let e=c.oldPos-i;d=c&&0<=e&&e<s}let u=l&&l.oldPos+1<o;if(!d&&!u){m[i]=void 0;continue}if(a=!u||d&&l.oldPos<c.oldPos?this.addToPath(c,!0,!1,0,n):this.addToPath(l,!1,!0,1,n),_=this.extractCommon(a,t,e,i,n),a.oldPos+1>=o&&_+1>=s)return r(this.buildValues(a.lastComponent,t,e))||!0;m[i]=a,a.oldPos+1>=o&&(g=Math.min(g,i-1)),_+1>=s&&(p=Math.max(p,i+1))}l++};if(i)!function e(){setTimeout(function(){if(l>c||Date.now()>u)return i(void 0);f()||e()},0)}();else for(;l<=c&&Date.now()<=u;){let e=f();if(e)return e}}addToPath(e,t,n,i,a){let r=e.lastComponent;return r&&!a.oneChangePerToken&&r.added===t&&r.removed===n?{oldPos:e.oldPos+i,lastComponent:{count:r.count+1,added:t,removed:n,previousComponent:r.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:t,removed:n,previousComponent:r}}}extractCommon(e,t,n,i,a){let r=t.length,s=n.length,o=e.oldPos,l=o-i,c=0;for(;l+1<r&&o+1<s&&this.equals(n[o+1],t[l+1],a);)l++,o++,c++,a.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!a.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=o,l}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let i,a=[];for(;e;)a.push(e),i=e.previousComponent,delete e.previousComponent,e=i;a.reverse();let r=a.length,s=0,o=0,l=0;for(;s<r;s++){let e=a[s];if(e.removed)e.value=this.join(n.slice(l,l+e.count)),l+=e.count;else{if(!e.added&&this.useLongestToken){let i=t.slice(o,o+e.count);i=i.map(function(e,t){let i=n[l+t];return i.length>e.length?i:e}),e.value=this.join(i)}else e.value=this.join(t.slice(o,o+e.count));o+=e.count,e.added||(l+=e.count)}}return a}}let u=new class extends d{constructor(){super(...arguments),this.tokenize=m}equals(e,t,n){return n.ignoreWhitespace?(n.newlineIsToken&&e.includes("\n")||(e=e.trim()),n.newlineIsToken&&t.includes("\n")||(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith("\n")&&(e=e.slice(0,-1)),t.endsWith("\n")&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function m(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));let n=[],i=e.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let e=0;e<i.length;e++){let a=i[e];e%2&&!t.newlineIsToken?n[n.length-1]+=a:n.push(a)}return n}let _={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function p(e,t,n,i,a,r,s){var o;let l;void 0===(l=s?"function"==typeof s?{callback:s}:s:{}).context&&(l.context=4);let c=l.context;if(l.newlineIsToken)throw Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(!l.callback)return d(u.diff(n,i,l));{let{callback:e}=l;o=Object.assign(Object.assign({},l),{callback:t=>{e(d(t))}}),u.diff(n,i,o)}function d(n){if(!n)return;function i(e){return e.map(function(e){return" "+e})}n.push({value:"",lines:[]});let s=[],o=0,l=0,d=[],u=1,m=1;for(let e=0;e<n.length;e++){let t=n[e],a=t.lines||function(e){let t=e.endsWith("\n"),n=e.split("\n").map(e=>e+"\n");return t?n.pop():n.push(n.pop().slice(0,-1)),n}(t.value);if(t.lines=a,t.added||t.removed){if(!o){let t=n[e-1];o=u,l=m,t&&(o-=(d=c>0?i(t.lines.slice(-c)):[]).length,l-=d.length)}for(let e of a)d.push((t.added?"+":"-")+e);t.added?m+=a.length:u+=a.length}else{if(o)if(a.length<=2*c&&e<n.length-2)for(let e of i(a))d.push(e);else{let e=Math.min(a.length,c);for(let t of i(a.slice(0,e)))d.push(t);let t={oldStart:o,oldLines:u-o+e,newStart:l,newLines:m-l+e,lines:d};s.push(t),o=0,l=0,d=[]}u+=a.length,m+=a.length}}for(let e of s)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith("\n")?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,"\"),t++);return{oldFileName:e,newFileName:t,oldHeader:a,newHeader:r,hunks:s}}}function g(e,t){if(t||(t=_),Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders)throw Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(e=>g(e,t)).join("\n")}let n=[];t.includeIndex&&e.oldFileName==e.newFileName&&n.push("Index: "+e.oldFileName),t.includeUnderline&&n.push("==================================================================="),t.includeFileHeaders&&(n.push("--- "+e.oldFileName+(void 0===e.oldHeader?"":" "+e.oldHeader)),n.push("+++ "+e.newFileName+(void 0===e.newHeader?"":" "+e.newHeader)));for(let t=0;t<e.hunks.length;t++){let i=e.hunks[t];for(let e of(0===i.oldLines&&(i.oldStart-=1),0===i.newLines&&(i.newStart-=1),n.push("@@ -"+i.oldStart+","+i.oldLines+" +"+i.newStart+","+i.newLines+" @@"),i.lines))n.push(e)}return n.join("\n")+"\n"}c._cacheMap.name="@git-diff-view/file";var f=e.i(781641),h=e.i(73348),E=e.i(770643),S=e.i(21152),b=e.i(550309),v=e.i(399366),T=e.i(665263),y=e.i(878528),C=e.i(205270);let N=(0,C.default)("search-code",[["path",{d:"m13 13.5 2-2.5-2-2.5",key:"1rvxrh"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}],["path",{d:"M9 8.5 7 11l2 2.5",key:"6ffwbx"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);var x=e.i(266231),R=e.i(31050);let O={normal:11,large:13,"x-large":15},I={Read:f.FileText,Edit:h.FilePen,Write:E.FilePlus,Bash:S.Terminal,Grep:b.Search,Glob:b.Search,Agent:T.Users,WebSearch:y.Globe,WebFetch:y.Globe,ToolSearch:N},A=e=>{let{oldString:i,newString:a,filePath:r}=e,{resolvedTheme:s}=(0,o.useTheme)(),d="light"===s?"light":"dark",u=(0,x.default)(),m=O[(0,R.default)(e=>e.fontSize)]??O.normal,_=(0,n.useMemo)(()=>{let e,t=r?r.split("/").pop()||r:"file",n=(0,c.getLang)(t),s=(e=function(e,t,n,i,a){if("function"==typeof a&&(a={callback:a}),null==a?void 0:a.callback){let{callback:r}=a;p(e,t,n,i,"","",Object.assign(Object.assign({},a),{callback:e=>{e?r(g(e,a.headerOptions)):r(void 0)}}))}else{let r=p(e,t,n,i,"","",a);if(!r)return;return g(r,null==a?void 0:a.headerOptions)}}(t,t,i,a,{context:3}),new c.DiffFile(t,i,t,a,[e],n,n,void 0));return s.initTheme(d),s.init(),s.buildSplitDiffLines(),s.buildUnifiedDiffLines(),s},[i,a,r,d]);return(0,t.jsx)("div",{className:"diff-panel-content mt-1.5 overflow-hidden rounded border border-border text-xs",children:(0,t.jsx)(l.DiffView,{diffFile:_,diffViewMode:l.DiffModeEnum.Unified,diffViewTheme:d,diffViewHighlight:!0,diffViewWrap:u,diffViewFontSize:m})})},w=(0,n.memo)(e=>{var i;let r,{entry:o,result:l}=e,c=(0,s.useTranslations)("timeline"),[d,u]=(0,n.useState)(!1),m=o.diff&&(o.diff.oldString||o.diff.newString),_={pending:"text-ui-amber",success:"text-muted-foreground",error:"text-negative"}[o.status],p="pending"===o.status?"animate-pulse":"";return(0,t.jsxs)("div",{className:"py-1",children:[(0,t.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,t.jsx)("span",{className:(0,a.cn)("shrink-0 mt-0.5",_,p),children:(i=o.toolName,r=I[i]??v.Wrench,(0,t.jsx)(r,{size:12}))}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[o.input?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-xs font-mono break-all block",children:o.toolName}),(0,t.jsx)("pre",{className:"mt-1 max-h-80 overflow-auto rounded border border-border/40 bg-muted/40 p-2 text-xs font-mono whitespace-pre-wrap break-words",children:o.input})]}):(0,t.jsx)("span",{className:"text-xs font-mono break-all block",children:o.summary}),l&&(l.output||l.summary)&&!(m&&!l.isError)&&(0,t.jsx)("pre",{className:(0,a.cn)("mt-0.5 text-xs whitespace-pre-wrap break-words font-mono",l.output&&"max-h-80 overflow-auto rounded border border-border/40 bg-muted/40 p-2",l.isError?"text-negative/70":"text-muted-foreground/60"),children:l.output||l.summary})]})]}),m&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{className:"ml-4 mt-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>u(e=>!e),children:d?`▾ ${c("diffHide")}`:`▸ ${c("diffShow")}`}),d&&o.diff&&(0,t.jsx)("div",{className:"ml-4",children:(0,t.jsx)(A,{oldString:o.diff.oldString,newString:o.diff.newString,filePath:o.diff.filePath})})]})]})}),D=(0,n.memo)(e=>{let{toolCalls:r,toolResults:o}=e,l=(0,s.useTranslations)("timeline"),c=r.some(e=>"pending"===e.status),[d,u]=(0,n.useState)(c),m=(0,n.useMemo)(()=>new Map(o.map(e=>[e.toolUseId,e])),[o]),_=(()=>{let e,t;if(c)return l("commandsRunning",{count:r.length});let n=(e=new Set(r.map(e=>e.toolName)),t=[],(e.has("Read")||e.has("Grep")||e.has("Glob"))&&t.push("codeSearched"),(e.has("Edit")||e.has("Write"))&&t.push("codeEdited"),t).map(e=>l(e)),i=n.length>0?`, ${n.join(", ")}`:"";return`${l("commandsExecuted",{count:r.length})}${i}`})();return(0,t.jsxs)("div",{className:"animate-in fade-in duration-150",children:[(0,t.jsxs)("button",{className:"flex w-full items-center gap-1.5 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>u(e=>!e),children:[(0,t.jsx)(i.ChevronRight,{size:14,className:(0,a.cn)("shrink-0 transition-transform duration-150",d&&"rotate-90")}),(0,t.jsx)("span",{children:_})]}),d&&(0,t.jsx)("div",{className:"ml-[7px] mt-0.5 border-l border-border/40 pl-3",children:r.map(e=>(0,t.jsx)(w,{entry:e,result:m.get(e.toolUseId)},e.id))})]})});e.s(["default",0,D],387561);var L=e.i(140032);let M=(0,C.default)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);var k=e.i(609104),P=e.i(405137),F=e.i(189257),U=e.i(199648),B=e.i(407654),G=e.i(3812),j=e.i(30502),Y=e.i(679935),H=e.i(296202);let V=[G.default],$=[j.default],z={a:L.default},q=async e=>{try{let t=await fetch(`/api/tmux/plan-options?session=${encodeURIComponent(e)}`);if(!t.ok)return[];let n=await t.json();return Array.isArray(n.options)?n.options:[]}catch{return[]}},W=async(e,t)=>{try{return(await fetch("/api/tmux/send-input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:e,input:String(t+1)})})).ok}catch{return!1}},Q=(0,n.memo)(e=>{let{entry:i,sessionName:r}=e,o=(0,s.useTranslations)("timeline"),[l,c]=(0,n.useState)(!1),[d,u]=(0,n.useState)([]),[m,_]=(0,n.useState)(null),p=(i.markdown.split("\n").find(e=>e.replace(/^#+\s*/,"").trim())??"Plan").replace(/^#+\s*/,"").trim(),g="pending"===i.status,f="success"===i.status,h=g&&null===m&&!!r;(0,n.useEffect)(()=>{if(!g||!r)return;let e=!1;return(async()=>{if(await new Promise(e=>setTimeout(e,500)),e)return;let t=await q(r);!e&&t.length>0&&u(t)})(),()=>{e=!0}},[g,r]);let E=d.length>0?d:null,S=async e=>{!h||(_(e),await W(r,e)||(_(null),Y.toast.error(o("selectionFailed"))))};return(0,t.jsxs)("div",{className:"animate-in fade-in duration-150",children:[g?(0,t.jsxs)("div",{className:"rounded-lg border border-claude-active/20 bg-claude-active/5 px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-2.5 flex items-center gap-2 text-xs font-medium text-claude-active",children:[(0,t.jsx)(M,{size:14}),(0,t.jsx)("span",{children:o("planPendingLabel")}),(0,t.jsxs)("button",{type:"button",onClick:()=>c(!0),className:"ml-auto flex items-center gap-1 rounded-md border border-claude-active/30 bg-claude-active/10 px-2 py-0.5 text-claude-active transition-colors hover:bg-claude-active/20",children:[(0,t.jsx)(k.Eye,{size:12}),(0,t.jsx)("span",{children:o("planViewDetail")})]})]}),(0,t.jsx)("p",{className:"mb-3 text-sm",children:p}),E?(0,t.jsx)("div",{className:"mb-2.5 flex flex-col gap-1.5",children:E.map((e,n)=>{let i=m===n;return(0,t.jsxs)("button",{type:"button",disabled:!h,onClick:()=>S(n),className:(0,a.cn)("flex items-start gap-2.5 rounded-md border px-3 py-2 text-left text-sm transition-colors",i?"border-claude-active/40 bg-claude-active/10":null===m||i?"border-border/50":"border-border/30 opacity-50",h&&"cursor-pointer hover:border-claude-active/30 hover:bg-claude-active/5"),children:[(0,t.jsx)("span",{className:(0,a.cn)("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded text-xs font-medium",i?"bg-claude-active text-white":"bg-muted text-muted-foreground"),children:i&&!f?(0,t.jsx)(U.default,{size:10}):i?(0,t.jsx)(F.Check,{size:12}):n+1}),(0,t.jsx)("span",{className:"min-w-0 flex-1",children:e})]},n)})}):i.allowedPrompts&&i.allowedPrompts.length>0?(0,t.jsx)("div",{className:"mb-2.5 flex flex-col gap-1 text-xs text-muted-foreground",children:i.allowedPrompts.map((e,n)=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(P.TerminalSquare,{size:11,className:"shrink-0 text-claude-active/50"}),(0,t.jsx)("span",{className:"truncate",children:e.prompt})]},n))}):null,!E&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(P.TerminalSquare,{size:12}),(0,t.jsx)("span",{children:o("planApproveInTerminal")})]})]}):(0,t.jsxs)("button",{type:"button",onClick:()=>c(!0),className:"group flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-muted-foreground hover:bg-muted/50",children:[(0,t.jsx)(M,{size:14,className:"shrink-0 text-claude-active"}),(0,t.jsx)("span",{className:"shrink-0 font-semibold uppercase text-claude-active",children:"Plan"}),(0,t.jsx)("span",{className:"flex-1 truncate",children:p}),f&&(0,t.jsx)(F.Check,{size:12,className:"shrink-0 text-claude-active/60"}),(0,t.jsx)(k.Eye,{size:12,className:"shrink-0 opacity-0 transition-opacity group-hover:opacity-60"})]}),(0,t.jsx)(H.Dialog,{open:l,onOpenChange:c,children:(0,t.jsxs)(H.DialogContent,{className:"flex max-h-[80vh] flex-col sm:max-w-2xl",children:[(0,t.jsxs)(H.DialogHeader,{children:[(0,t.jsx)(H.DialogTitle,{children:p}),(0,t.jsx)(H.DialogDescription,{className:"sr-only",children:o("planDialogDescription")})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto overflow-x-hidden",children:(0,t.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none text-sm [&_pre]:overflow-x-auto [&_pre]:bg-muted [&_pre]:rounded-md [&_pre]:p-3 [&_pre_code]:text-foreground [&_code]:text-[0.9em] [&_code.hljs]:text-[1em] [&_code]:font-normal [&_code]:font-mono [&_code::before]:content-none [&_code::after]:content-none",children:(0,t.jsx)(B.default,{remarkPlugins:V,rehypePlugins:$,components:z,urlTransform:L.editorMarkdownUrlTransform,children:i.markdown})})})]})})]})});e.s(["default",0,Q],912643);let K=e=>{let{entry:n}=e;switch(n.type){case"assistant-message":return(0,t.jsx)(r.default,{entry:n});case"plan":return(0,t.jsx)(Q,{entry:n});default:return null}},X=(0,n.memo)(e=>{let{entry:r}=e,[s,o]=(0,n.useState)(!1),l=(0,n.useMemo)(()=>(e=>{let t=[],n=[],i=[],a=()=>{n.length>0&&(t.push({type:"tool-group",id:n[0].id,toolCalls:[...n],toolResults:[...i]}),n=[],i=[])};for(let r of e)"tool-call"===r.type?n.push(r):"tool-result"===r.type?i.push(r):("assistant-message"===r.type||"plan"===r.type)&&(a(),t.push({type:"entry",id:r.id,entry:r}));return a(),t})(r.entries),[r.entries]),c=l.length>0;return(0,t.jsxs)("div",{className:"animate-in fade-in duration-150",children:[(0,t.jsxs)("button",{className:(0,a.cn)("flex w-full items-center gap-1.5 py-1 text-xs text-muted-foreground transition-colors",c&&"hover:text-foreground"),onClick:()=>c&&o(e=>!e),disabled:!c,children:[(0,t.jsx)(i.ChevronRight,{size:14,className:(0,a.cn)("shrink-0 transition-transform duration-150",s&&"rotate-90")}),(0,t.jsx)("span",{children:r.description})]}),s&&(0,t.jsx)("div",{className:"ml-[7px] mt-0.5 border-l border-border/40 pl-3",children:l.map(e=>(0,t.jsx)("div",{className:"py-0.5",children:"tool-group"===e.type?(0,t.jsx)(D,{toolCalls:e.toolCalls,toolResults:e.toolResults}):(0,t.jsx)(K,{entry:e.entry})},e.id))})]})});e.s(["default",0,X],901160);var Z=e.i(803057),J=e.i(979195),ee=e.i(484862),et=e.i(815242);let en=(0,n.memo)(e=>{var r;let{entry:o}=e,l=(0,s.useTranslations)("timeline"),[c,d]=(0,n.useState)(!1),u="completed"===o.status,m=!!o.result;return(0,t.jsxs)("div",{className:"animate-in fade-in duration-150",children:[(0,t.jsxs)("button",{className:(0,a.cn)("flex w-full items-center gap-1.5 py-1 text-xs text-muted-foreground transition-colors",m&&"hover:text-foreground"),onClick:()=>m&&d(e=>!e),disabled:!m,children:[m?(0,t.jsx)(i.ChevronRight,{size:14,className:(0,a.cn)("shrink-0 transition-transform duration-150",c&&"rotate-90")}):u?(0,t.jsx)(Z.CheckCircle2,{size:14,className:"shrink-0 text-positive"}):(0,t.jsx)(J.XCircle,{size:14,className:"shrink-0 text-negative"}),(0,t.jsx)("span",{className:"text-left",children:o.summary}),o.usage?.durationMs!=null&&(0,t.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-1 text-[11px] text-muted-foreground/50",children:[(0,t.jsx)(ee.Clock,{size:10}),(r=o.usage.durationMs)<1e3?`${r}ms`:`${(r/1e3).toFixed(1)}s`]})]}),c&&o.result&&(0,t.jsx)("div",{className:"ml-[7px] mt-0.5 border-l border-border/40 pl-3",children:(0,t.jsxs)("div",{className:"rounded-md bg-muted/30 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[u?(0,t.jsx)(Z.CheckCircle2,{size:12,className:"mt-0.5 shrink-0 text-positive"}):(0,t.jsx)(J.XCircle,{size:12,className:"mt-0.5 shrink-0 text-negative"}),(0,t.jsx)("pre",{className:"min-w-0 flex-1 whitespace-pre-wrap break-words text-xs text-foreground/70",children:o.result})]}),o.usage?.toolUses!=null&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-1 text-[11px] text-muted-foreground/50",children:[(0,t.jsx)(et.Zap,{size:10}),(0,t.jsx)("span",{children:l("toolUsageCount",{count:o.usage.toolUses})})]})]})})]})});e.s(["default",0,en],748486);let ei=(0,C.default)("message-circle-question-mark",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var ea=e.i(399267),er=e.i(701412);let es="rounded-lg border border-claude-active/20 bg-claude-active/5 px-4 py-3",eo=(e,t,n)=>(0,a.cn)("flex items-start gap-2.5 rounded-md border px-3 py-2 text-left text-sm transition-colors","focus-within:ring-2 focus-within:ring-claude-active/40 focus-within:ring-offset-2 focus-within:ring-offset-background",e?"border-claude-active/40 bg-claude-active/10":t?"border-border/30 opacity-50":"border-border/50",n&&"cursor-pointer hover:border-claude-active/30 hover:bg-claude-active/5"),el=e=>{let{header:n,children:i}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mb-2.5 flex items-center gap-2 text-xs font-medium text-claude-active",children:[(0,t.jsx)(ei,{size:14}),(0,t.jsx)("span",{children:n})]}),(0,t.jsx)("p",{className:"mb-3 text-sm",children:i})]})},ec=e=>{let{option:n,index:i,selected:r,pending:s=!1}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":"true",className:(0,a.cn)("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded text-xs font-medium",r?"bg-claude-active text-white":"bg-muted text-muted-foreground"),children:s?(0,t.jsx)(U.default,{size:10}):r?(0,t.jsx)(F.Check,{size:12}):i+1}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"font-medium",children:n.label}),n.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:n.description})]})]})},ed=async(e,t)=>{try{return(await fetch("/api/tmux/send-input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:e,input:String(t+1)})})).ok}catch{return!1}},eu=e=>{let{entry:i,tabId:r,agentSessionId:o}=e,l=(0,s.useTranslations)("timeline"),[c,d]=(0,n.useState)({}),[u,m]=(0,n.useState)(null),[_,p]=(0,n.useState)(!1),g=(0,n.useRef)(!1),f=(0,ea.default)(e=>r?e.tabs[r]?.workspaceId:void 0),h=i.answers??u,E="success"===i.status||null!==h,S=i.questions.every((e,t)=>c[t]?.trim()),b=async()=>{if(!S||E||g.current||!r||!f||!o)return;g.current=!0,p(!0);let e=i.questions.map((e,t)=>c[t].trim());try{if(!(await fetch(`/api/input-queue?${new URLSearchParams({workspaceId:f,tabId:r})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"send-immediate",id:i.toolUseId,agentSessionId:o,text:(0,er.formatQuestionAnswers)(i.questions,e),attachments:[]})})).ok)throw Error("Answer submission failed");m(e)}catch{Y.toast.error(l("selectionFailed"))}finally{g.current=!1,p(!1)}};return(0,t.jsxs)("div",{className:(0,a.cn)("animate-in fade-in duration-150 space-y-3",es),children:[i.questions.map((e,n)=>{let a=h?.[n]??c[n],r=!!a&&!e.options.some(e=>e.label===a);return(0,t.jsxs)("fieldset",{className:"min-w-0",disabled:E||_,children:[(0,t.jsx)("legend",{className:"sr-only",children:e.question}),(0,t.jsx)(el,{header:e.header,children:e.question}),(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:e.options.map((e,r)=>{let s=a===e.label;return(0,t.jsxs)("label",{className:eo(s,E&&!s,!E&&!_),children:[(0,t.jsx)("input",{type:"radio",className:"sr-only",name:`${o}-${i.toolUseId}-${n}`,checked:s,onChange:()=>d(t=>({...t,[n]:e.label}))}),(0,t.jsx)(ec,{option:e,index:r,selected:s,pending:_&&s})]},e.label)})}),E?r&&(0,t.jsx)("p",{className:"mt-2 whitespace-pre-wrap break-words rounded-md border border-claude-active/40 bg-claude-active/10 px-3 py-2 text-sm",children:a}):(0,t.jsx)("input",{className:"mt-2 w-full rounded-md border border-border/50 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-claude-active/40","aria-label":e.question,value:c[n]??"",onChange:e=>d(t=>({...t,[n]:e.target.value}))})]},n)}),E?(0,t.jsxs)("p",{className:"flex items-center gap-1.5 text-xs text-claude-active",children:[(0,t.jsx)(F.Check,{size:14}),l("answerSubmitted")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",disabled:!S||!r||!f||!o||_,className:"flex items-center gap-2 rounded-md border border-claude-active/40 bg-claude-active/10 px-3 py-2 text-sm font-medium text-claude-active transition-colors hover:bg-claude-active/20 disabled:cursor-not-allowed disabled:opacity-50",onClick:b,children:[_&&(0,t.jsx)(U.default,{size:12}),l("submitAnswer")]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:l("submitAnswerHint")})]})]})},em=(0,n.memo)(e=>{let{entry:i,sessionName:a,tabId:r,agentSessionId:o}=e,l=(0,s.useTranslations)("timeline"),[c,d]=(0,n.useState)(null),u="success"===i.status,m=i.questions[0];if("compose"===i.answerMode)return(0,t.jsx)(eu,{entry:i,tabId:r,agentSessionId:o},`${o}:${i.toolUseId}`);if(!m)return null;let _=!u&&null===c&&!!a,p=async e=>{!_||(d(e),await ed(a,e)||(d(null),Y.toast.error(l("selectionFailed"))))};return(0,t.jsx)("div",{className:"animate-in fade-in duration-150",children:(0,t.jsxs)("div",{className:es,children:[(0,t.jsx)(el,{header:m.header,children:m.question}),(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:m.options.map((e,n)=>{let a=u?i.answer===e.label:c===n,r=c===n&&!u,s=(u||null!==c)&&!a;return(0,t.jsx)("button",{type:"button",disabled:!_,onClick:()=>p(n),className:eo(a,s,_),children:(0,t.jsx)(ec,{option:e,index:n,selected:a,pending:r})},n)})})]})})});e.s(["default",0,em],865013);var e_=e.i(444957),ep=e.i(798458),eg=e.i(909725);let ef=e=>{let{status:n}=e;return"completed"===n?(0,t.jsx)(Z.CheckCircle2,{size:14,className:"text-positive"}):"in_progress"===n?(0,t.jsx)("span",{className:"flex h-[14px] w-[14px] items-center justify-center",children:(0,t.jsx)("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-claude-active"})}):(0,t.jsx)("span",{className:"h-[14px] w-[14px] rounded-full border border-muted-foreground/40"})};e.s(["default",0,e=>{let{tasks:i,cliState:r}=e,o=(0,s.useTranslations)("timeline"),l=(0,s.useTranslations)("common"),c=i.filter(e=>"completed"===e.status).length,d=i.length>0&&c===i.length,u=i.some(e=>"in_progress"===e.status),[m,_]=(0,n.useState)(d),[p,g]=(0,n.useState)(!1),[f,h]=(0,n.useState)(i);i!==f&&((i.length!==f.length||i.some((e,t)=>f[t]?.status!==e.status))&&m&&_(!1),h(i)),(0,n.useEffect)(()=>{if(!d||"idle"!==r)return;let e=setTimeout(()=>_(!0),3e3);return()=>clearTimeout(e)},[d,r]);let E=m?i.find(e=>"in_progress"===e.status)?.subject??i.findLast(e=>"pending"===e.status)?.subject:void 0,S=d?"border-positive":u?"border-claude-active":"border-muted-foreground/40";return p?null:(0,t.jsxs)("div",{className:(0,a.cn)("sticky top-0 z-10 mx-4 mb-2 border-l-2 bg-muted/80 px-4 py-2","animate-in fade-in slide-in-from-top-1 duration-200",S),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("button",{type:"button",className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2",onClick:()=>_(e=>!e),"aria-expanded":!m,"aria-controls":"task-list",children:[d?(0,t.jsx)(Z.CheckCircle2,{size:14,className:"shrink-0 text-positive"}):(0,t.jsx)(ep.ListChecks,{size:14,className:"shrink-0 text-claude-active"}),(0,t.jsxs)("span",{className:"text-xs leading-none font-medium tabular-nums","aria-live":"polite",children:["TASK ",c," / ",i.length]}),m&&E&&(0,t.jsx)("span",{className:"ml-1 min-w-0 flex-1 truncate text-left text-xs text-muted-foreground",children:E}),(0,t.jsx)(e_.ChevronDown,{size:14,className:(0,a.cn)("shrink-0 text-muted-foreground transition-transform duration-200",m&&"-rotate-90")})]}),(0,t.jsx)("button",{type:"button",className:"flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center self-start rounded-sm text-muted-foreground hover:text-foreground",onClick:()=>g(!0),"aria-label":l("close"),children:(0,t.jsx)(eg.X,{size:12})})]}),(0,t.jsx)("div",{className:(0,a.cn)("grid transition-[grid-template-rows] duration-200",m?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:(0,t.jsx)("div",{className:"overflow-hidden",children:(0,t.jsx)("div",{id:"task-list",role:"list","aria-label":o("taskProgress"),className:"mt-1.5 max-h-[240px] overflow-y-auto",style:{scrollbarWidth:"thin"},children:i.map(e=>(0,t.jsxs)("div",{role:"listitem",className:"flex items-center gap-2 py-0.5",children:[(0,t.jsx)("span",{className:"flex h-[14px] w-[14px] shrink-0 items-center justify-center",children:(0,t.jsx)(ef,{status:e.status})}),(0,t.jsx)("span",{className:(0,a.cn)("min-w-0 truncate text-xs","completed"===e.status&&"text-muted-foreground line-through","in_progress"===e.status&&"font-medium text-foreground","pending"===e.status&&"text-muted-foreground"),children:e.subject})]},e.taskId))})})})]})}],815226);let eh=e=>{let{status:n}=e;return"completed"===n?(0,t.jsx)(Z.CheckCircle2,{size:12,className:"text-positive"}):"in_progress"===n?(0,t.jsx)("span",{className:"flex h-3 w-3 items-center justify-center",children:(0,t.jsx)("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-claude-active"})}):(0,t.jsx)("span",{className:"h-3 w-3 rounded-full border border-muted-foreground/40"})},eE=(0,n.memo)(e=>{let{entry:n}=e;if("replace"===n.action)return(0,t.jsx)("div",{className:"space-y-1 py-1",children:n.tasks?.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"mt-0.5 shrink-0",children:(0,t.jsx)(eh,{status:e.status})}),(0,t.jsx)("span",{children:e.subject})]},e.taskId))});let i="create"===n.action?n.subject:`Task ${n.taskId} \u2192 ${n.status}`;return(0,t.jsxs)("div",{className:"flex items-center gap-1.5 py-1",children:[(0,t.jsx)(eh,{status:n.status}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:i})]})});e.s(["default",0,eE],864852)},801230,601726,954996,42054,44158,333711,427285,835591,137073,e=>{"use strict";let t,n,i,a;var r,s=e.i(391398),o=e.i(853560),l=e.i(939310);e.s(["default",0,e=>{let{visible:t,onClick:n}=e;return t?(0,s.jsx)("div",{className:"absolute bottom-4 left-1/2 z-10 -translate-x-1/2",children:(0,s.jsx)(l.Button,{variant:"outline",size:"icon",className:"h-8 w-8 rounded-full",onClick:n,children:(0,s.jsx)(o.ArrowDown,{size:14})})}):null}],801230);var c=e.i(191788),d=e.i(350461);let u=(0,c.createContext)({});function m(e){let t=(0,c.useRef)(null);return null===t.current&&(t.current=e()),t.current}let _="u">typeof window?c.useLayoutEffect:c.useEffect,p=(0,c.createContext)(null);function g(e){return"object"==typeof e&&null!==e}function f(e){return g(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}var h=c;let E=(0,c.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function S(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class b extends h.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(f(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){let e=t.offsetParent,n=f(e)&&e.offsetWidth||0,i=f(e)&&e.offsetHeight||0,a=getComputedStyle(t),r=this.props.sizeRef.current;r.height=parseFloat(a.height),r.width=parseFloat(a.width),r.top=t.offsetTop,r.left=t.offsetLeft,r.right=n-r.width-r.left,r.bottom=i-r.height-r.top}return null}componentDidUpdate(){}render(){return this.props.children}}function v(e){let{children:t,isPresent:n,anchorX:i,anchorY:a,root:r,pop:o}=e,l=(0,h.useId)(),d=(0,h.useRef)(null),u=(0,h.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:m}=(0,h.useContext)(E),_=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useCallback(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{let n=!1,i=t.map(t=>{let i=S(t,e);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let e=0;e<i.length;e++){let n=i[e];"function"==typeof n?n():S(t[e],null)}}}}(...t),t)}(d,t.props?.ref??t?.ref);return(0,h.useInsertionEffect)(()=>{let{width:e,height:t,top:s,left:c,right:_,bottom:p}=u.current;if(n||!1===o||!d.current||!e||!t)return;let g="left"===i?`left: ${c}`:`right: ${_}`,f="bottom"===a?`bottom: ${p}`:`top: ${s}`;d.current.dataset.motionPopId=l;let h=document.createElement("style");m&&(h.nonce=m);let E=r??document.head;return E.appendChild(h),h.sheet&&h.sheet.insertRule(`
|
|
20
|
+
${t[n].trim()}`).join("\n\n"),"resolveAsyncQuestionAnswers",0,n],701412);var i=e.i(191788);let a=[1e3,2e3,4e3,8e3,16e3],r=new Map,s=(e,t,n)=>n?JSON.stringify([e,t,n]):null,o=e=>{e&&r.delete(e)},l=e=>e.replace(/\s+/g," ").trim(),c=e=>"user-message"===e.type&&!0===e.pending;e.s(["default",0,e=>{let{sessionName:t,agentSessionId:d,claudeSessionId:u,panelType:m,enabled:_,resumeCallbacks:p,onSync:g,getCliState:f}=e,h=JSON.stringify([m??"claude-code",t,d??u??null]),E=s(m??"claude-code",t,d??u),S=(0,i.useMemo)(()=>(e=>{if(!e)return;let t=r.get(e);if(t)return Date.now()-t.savedAt>=3e5?void r.delete(e):(r.delete(e),r.set(e,t),t.snapshot)})(E),[E]),[b,v]=(0,i.useState)(()=>S?.entries??[]),[T,y]=(0,i.useState)(null),[C,N]=(0,i.useState)(!0),[x,R]=(0,i.useState)(!1),[O,I]=(0,i.useState)(null),[A,w]=(0,i.useState)(!1),[D,L]=(0,i.useState)(()=>S?.sessionId??null),[M,k]=(0,i.useState)(()=>S?.summary),[P,F]=(0,i.useState)(()=>S?.meta),[U,B]=(0,i.useState)(()=>S?.stats??null),[G,j]=(0,i.useState)(null),Y=(0,i.useRef)(b);(0,i.useEffect)(()=>{Y.current=b},[b]);let H=(0,i.useRef)(null),V=(0,i.useRef)(0),$=(0,i.useRef)(!1),z=(0,i.useRef)(0),q=(0,i.useRef)(D),W=(0,i.useRef)(f);(0,i.useEffect)(()=>{W.current=f},[f]);let[Q,K]=(0,i.useState)(h),[X,Z]=(0,i.useState)(JSON.stringify([m??"claude-code",t])),J=JSON.stringify([m??"claude-code",t]);h!==Q&&K(h),(J!==X||h!==Q&&(d??u??null)!==D)&&(J===X&&o(s(m??"claude-code",t,q.current)),z.current++,Z(J),R(!1),y(null),N(!0),v(S?.entries??[]),I(null),w(!1),L(S?.sessionId??null),q.current=S?.sessionId??null,k(S?.summary),F(S?.meta),B(S?.stats??null),j(null),H.current=null,V.current=0);let ee=!x&&0===b.length;(0,i.useEffect)(()=>{x&&D&&((e,t)=>{if(!e)return;let n=t.entries.filter(e=>"user-message"!==e.type||!e.pending),i=n.findLastIndex(e=>"user-message"===e.type),a={...t,entries:n.slice(Math.max(0,i))};if(r.delete(e),0!==a.entries.length&&!(2*JSON.stringify(a).length>2097152))for(r.set(e,{snapshot:a,savedAt:Date.now()});r.size>12;)r.delete(r.keys().next().value)})(s(m??"claude-code",t,D),{entries:b,sessionId:D,summary:M,meta:P,stats:U})},[b,D,M,P,U,x,m,t]);let et=(0,i.useCallback)(()=>{o(s(m??"claude-code",t,q.current))},[m,t]),en=(0,i.useCallback)((e,n,i,a,r,l,d,u,_,p)=>{q.current&&q.current!==i&&o(s(m??"claude-code",t,q.current)),q.current=i||null,z.current++,R(!0),N(!0),v(t=>{let n=t.filter(c);return 0===n.length?e:[...e.map(e=>{if("user-message"!==e.type)return e;let t=e.text.trim(),i=n.findIndex(e=>e.text.trim()===t);if(-1===i)return e;let a=n[i];return n.splice(i,1),{...e,id:a.id}}),...n]}),V.current=l??0,w(d??!1),k(a),F(r),B(p??null),H.current=u??null,j(u??null),i?L(i):_||(L(null),y(!1)),I(null)},[m,t]),ei=(0,i.useCallback)(e=>{v(t=>{let n=[...t];for(let t of e){if("user-message"===t.type){let e=l(t.text),i=n.findIndex(t=>"user-message"===t.type&&t.pending&&(t.attachmentPlaceholder||l(t.text)===e));if(-1!==i){let e=n[i];n[i]={...t,id:e.id};continue}}if("tool-result"===t.type){let e=t.isError?"error":"success",i=n.findIndex(e=>"tool-call"===e.type&&e.toolUseId===t.toolUseId);if(-1!==i){let t=n[i];n[i]={...t,status:e}}else{let i=n.findIndex(e=>"ask-user-question"===e.type&&e.toolUseId===t.toolUseId);if(-1!==i){let a=n[i];n[i]={...a,status:e,answer:t.summary||void 0}}}}n.push(t)}return n})},[]),ea=(0,i.useCallback)((e,t)=>{let n=e.trim(),i=`pending-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;if(!n)return i;let a={id:i,type:"user-message",timestamp:Date.now(),text:n,pending:!0,attachmentPlaceholder:t?.attachmentPlaceholder};return v(e=>[...e,a]),t?.attachmentPlaceholder?setTimeout(()=>{v(e=>e.filter(e=>e.id!==i||"user-message"!==e.type||!0!==e.pending||!0!==e.attachmentPlaceholder))},6e4):t?.autoHide!==!1&&setTimeout(()=>{W.current?.()==="busy"&&(v(e=>e.some(e=>e.id!==i)?e.map(e=>e.id===i&&"user-message"===e.type&&!0===e.pending?{...e,fadingOut:!0}:e):e),setTimeout(()=>{v(e=>e.some(e=>e.id!==i)?e.filter(e=>e.id!==i||"user-message"!==e.type||!0!==e.pending):e)},200))},1e3),i},[]),er=(0,i.useCallback)(e=>{v(t=>t.filter(t=>t.id!==e||"user-message"!==t.type||!0!==t.pending))},[]),es=(0,i.useCallback)((e,t)=>{let n=q.current;if(("session-waiting"!==t||e&&e!==n)&&et(),q.current="session-ended"===t?null:e||("session-waiting"===t?n:null),"session-waiting"!==t&&z.current++,"session-ended"===t){H.current=null,j(null),L(null),y(!1),R(!0),v([]),k(void 0),F(void 0),B(null),w(!1);return}if("session-waiting"===t){e&&e!==n&&(z.current++,v(e=>e.filter(c)),R(!1),B(null),F(void 0),k(void 0),w(!1),H.current=null,j(null)),e?(y(!0),L(e)):y(!0);return}L(e||null),y(!0),v(e=>e.filter(c)),k(void 0),F(void 0),B(null),w(!1),R(!1)},[et]),eo=(0,i.useCallback)(e=>{e.sessionId===q.current&&B(e)},[]),el=(0,i.useCallback)(async()=>{if(!H.current||$.current||!A)return;if(V.current<=0)return void w(!1);$.current=!0;let e=z.current,t=H.current;try{let n=await fetch(`/api/timeline/entries?jsonlPath=${encodeURIComponent(t)}&beforeByte=${V.current}&mode=turn`);if(!n.ok)return;let i=await n.json();if(e!==z.current||t!==H.current)return;let a=i.entries;v(e=>[...a,...e]),V.current=i.startByteOffset,w(i.hasMore)}finally{$.current=!1}},[A]),ec=(0,i.useCallback)(e=>{"not-installed"===e.code?N(!1):console.warn(`[timeline] WebSocket error: ${e.code} — ${e.message}`)},[]),ed=(0,i.useRef)(p);(0,i.useEffect)(()=>{ed.current=p},[p]);let{status:eu,reconnect:em,sendResume:e_}=(e=>{let{sessionName:t,agentSessionId:n,claudeSessionId:r,panelType:s,enabled:o,onInit:l,onAppend:c,onSessionChanged:d,onStatsUpdate:u,onError:m,onResumeStarted:_,onResumeBlocked:p,onResumeError:g}=e,[f,h]=(0,i.useState)("disconnected"),[E,S]=(0,i.useState)(0),b=(0,i.useRef)(null),v=(0,i.useRef)(0),T=(0,i.useRef)(null),y=(0,i.useRef)(0),C=(0,i.useRef)({onInit:l,onAppend:c,onSessionChanged:d,onStatsUpdate:u,onError:m,onResumeStarted:_,onResumeBlocked:p,onResumeError:g});(0,i.useEffect)(()=>{C.current={onInit:l,onAppend:c,onSessionChanged:d,onStatsUpdate:u,onError:m,onResumeStarted:_,onResumeBlocked:p,onResumeError:g}},[l,c,d,u,m,_,p,g]);let N=(0,i.useRef)(()=>{}),x=(0,i.useCallback)(()=>{T.current&&(clearTimeout(T.current),T.current=null)},[]),R=(0,i.useCallback)(e=>{x(),b.current&&(b.current.close(),b.current=null),h(v.current>0?"reconnecting":"connecting");let i="https:"===location.protocol?"wss:":"ws:",o=new URLSearchParams({session:t}),l=n??r;l&&o.set("agentSessionId",l),s&&o.set("panelType",s);let c=new WebSocket(`${i}//${location.host}/api/timeline?${o}`);b.current=c,c.onopen=()=>{y.current===e&&(h("connected"),v.current=0)},c.onmessage=t=>{if(y.current===e)try{let e=JSON.parse(t.data);switch(e.type){case"timeline:init":C.current.onInit(e.entries,e.totalEntries,e.sessionId,e.summary,e.meta,e.startByteOffset,e.hasMore,e.jsonlPath,e.isClaudeStarting,e.sessionStats);break;case"timeline:append":C.current.onAppend(e.entries);break;case"timeline:session-changed":C.current.onSessionChanged(e.newSessionId,e.reason);break;case"timeline:stats-update":C.current.onStatsUpdate?.(e.sessionStats);break;case"timeline:error":C.current.onError?.({code:e.code,message:e.message});break;case"timeline:resume-started":C.current.onResumeStarted?.({sessionId:e.sessionId,jsonlPath:e.jsonlPath});break;case"timeline:resume-blocked":C.current.onResumeBlocked?.({reason:e.reason,processName:e.processName});break;case"timeline:resume-error":C.current.onResumeError?.({message:e.message})}}catch(e){console.log(`[timeline-ws] message parse error: ${e instanceof Error?e.message:e}`)}},c.onclose=()=>{if(y.current===e)if(x(),b.current=null,v.current<5){let t=a[v.current]??16e3;v.current++,h("reconnecting"),T.current=setTimeout(()=>{N.current(e)},t)}else h("disconnected")},c.onerror=()=>{console.log("[timeline-ws] connection error")}},[t,n,r,s,x]);(0,i.useEffect)(()=>{N.current=R},[R]),(0,i.useEffect)(()=>{if(!o){++y.current,x(),b.current&&(b.current.close(),b.current=null);return}v.current=0;let e=++y.current;return R(e),()=>{y.current=e+1,x(),b.current&&(b.current.readyState===WebSocket.OPEN&&b.current.send(JSON.stringify({type:"timeline:unsubscribe"})),b.current.close(1e3),b.current=null)}},[o,t,n,r,s,E]),(0,i.useEffect)(()=>{let e=()=>{if("visible"!==document.visibilityState||!o)return;let e=b.current;if(e&&(e.readyState===WebSocket.OPEN||e.readyState===WebSocket.CONNECTING))return;v.current=0;let t=++y.current;N.current(t)};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[o]);let O=(0,i.useCallback)(e=>{let t=b.current;t?.readyState===WebSocket.OPEN&&t.send(JSON.stringify({type:"timeline:subscribe",jsonlPath:e}))},[]),I=(0,i.useCallback)(()=>{let e=b.current;e?.readyState===WebSocket.OPEN&&e.send(JSON.stringify({type:"timeline:unsubscribe"}))},[]);return{status:f,subscribe:O,unsubscribe:I,reconnect:(0,i.useCallback)(()=>{S(e=>e+1)},[]),sendResume:(0,i.useCallback)((e,t)=>{let n=b.current;n?.readyState===WebSocket.OPEN&&n.send(JSON.stringify({type:"timeline:resume",sessionId:e,tmuxSession:t}))},[])}})({sessionName:t,agentSessionId:d,claudeSessionId:u,panelType:m,enabled:_,onInit:en,onAppend:ei,onSessionChanged:es,onStatsUpdate:eo,onError:ec,onResumeStarted:(0,i.useCallback)(e=>{et(),z.current++,q.current=e.sessionId,H.current=e.jsonlPath,j(e.jsonlPath),B(null),F(void 0),k(void 0),w(!1),L(e.sessionId),y(!0),v([]),R(!1),ed.current?.onResumeStarted?.(e)},[et]),onResumeBlocked:(0,i.useCallback)(e=>{ed.current?.onResumeBlocked?.(e)},[]),onResumeError:(0,i.useCallback)(e=>{ed.current?.onResumeError?.(e)},[])}),ep=(0,i.useCallback)(()=>{I(null),em()},[em]),eg=(0,i.useRef)(g);(0,i.useEffect)(()=>{eg.current=g},[g]),(0,i.useEffect)(()=>{eg.current?.({agentProcess:T,agentInstalled:C,isLoading:ee})},[T,C,ee]);let ef=(0,i.useMemo)(()=>(e=>{let t=new Map,n=new Set(e.flatMap(e=>"tool-result"===e.type&&e.isError?[e.toolUseId]:[])),i=0;for(let a of e){if("task-progress"!==a.type||a.toolUseId&&n.has(a.toolUseId))continue;if("replace"===a.action){let e=`${a.source}:`;for(let n of t.keys())n.startsWith(e)&&t.delete(n);for(let n of a.tasks??[])t.set(`${e}${n.taskId}`,{...n,taskId:`${e}${n.taskId}`});continue}"create"===a.action&&i++;let e=a.taskId||String(i),r=t.get(e);(r||a.subject)&&t.set(e,{taskId:e,subject:a.subject??r?.subject??"",description:a.description??r?.description,status:a.status})}return[...t.values()]})(b),[b]);return{entries:(0,i.useMemo)(()=>n(b),[b]),tasks:ef,sessionId:D,jsonlPath:G,sessionSummary:M,initMeta:P,sessionStats:U,agentProcess:T,agentInstalled:C,wsStatus:eu,isLoading:ee,error:O,loadMore:el,hasMore:A,retrySession:ep,sendResume:e_,addPendingUserMessage:ea,removePendingUserMessage:er}}],231382)},377181,e=>{"use strict";var t=e.i(191788);e.s(["default",0,(e,n)=>{let[i,a]=(0,t.useState)(null);return(0,t.useEffect)(()=>{if(!e)return;let t=setTimeout(()=>a({options:[],isBypassPrompt:!1}),5e3);return()=>{clearTimeout(t),a(null)}},[e]),(0,t.useEffect)(()=>{if(!i||i.options.length>0)return;let e=!1,t=()=>{fetch(`/api/tmux/permission-options?session=${encodeURIComponent(n)}`).then(e=>e.json()).then(t=>{let{options:n,isBypassPrompt:i}=t;!e&&n?.length&&a({options:n,isBypassPrompt:!!i})}).catch(()=>{})};t();let r=setInterval(t,3e3);return()=>{e=!0,clearInterval(r)}},[i,n]),i}])},418760,e=>{"use strict";var t=e.i(191788);e.s(["default",0,e=>{let{tmuxSession:n,enabled:i,cwd:a}=e,[r,s]=(0,t.useState)([]),[o,l]=(0,t.useState)(0),[c,d]=(0,t.useState)(!1),[u,m]=(0,t.useState)(!0),[_,p]=(0,t.useState)(!1),[g,f]=(0,t.useState)(null),h=(0,t.useRef)(!1),[E,S]=(0,t.useState)(n);n!==E&&(S(n),s([]),l(0),d(!1),m(!0),f(null));let b=(0,t.useRef)(a);b.current=a;let v=(0,t.useCallback)(async()=>{if(n){m(!0),f(null);try{let e=`/api/timeline/sessions?tmuxSession=${encodeURIComponent(n)}&limit=50&offset=0`;b.current&&(e+=`&cwd=${encodeURIComponent(b.current)}`);let t=await fetch(e);if(!t.ok)throw Error("세션 목록을 불러올 수 없습니다");let i=await t.json();s(i.sessions),l(i.total),d(i.hasMore)}catch(e){f(e instanceof Error?e.message:"세션 목록을 불러올 수 없습니다")}finally{m(!1)}}},[n]);(0,t.useEffect)(()=>{i&&v()},[i,v]);let T=(0,t.useRef)(a);(0,t.useEffect)(()=>{T.current!==a&&(T.current=a,i&&v())},[a,i,v]);let y=(0,t.useCallback)(async()=>{await v()},[v]),C=(0,t.useCallback)(async()=>{if(n&&!h.current&&c){h.current=!0,p(!0);try{let e=r.length,t=await fetch(`/api/timeline/sessions?tmuxSession=${encodeURIComponent(n)}&limit=50&offset=${e}`);if(!t.ok)return;let i=await t.json();s(e=>[...e,...i.sessions]),l(i.total),d(i.hasMore)}finally{h.current=!1,p(!1)}}},[n,c,r.length]);return{sessions:r,total:o,hasMore:c,isLoading:u,isLoadingMore:_,error:g,refetch:y,loadMore:C}}])},815435,e=>{"use strict";var t=e.i(191788),n=e.i(352819);let i=e=>{for(let t of e)if("user-message"===t.type)return t.text;return null},a=(e,t)=>{let n=0,i=0,a=null;for(let r of e)(void 0===t||!(r.timestamp<=t))&&(a=new Date(r.timestamp).toISOString(),"user-message"===r.type?n++:"assistant-message"===r.type&&i++);return{userCount:n,assistantCount:i,updatedAt:a}},r=(e,t)=>t?{...e,inputTokens:t.inputTokens??null,cachedInputTokens:t.cachedInputTokens??null,outputTokens:t.outputTokens??null,reasoningOutputTokens:t.reasoningOutputTokens??null,totalCost:t.cost??null,currentContextTokens:t.currentContextTokens||null,contextWindowSize:t.contextWindowSize||null,usedPercentage:t.usedPercentage??null,model:t.model??null,exceeds200k:t.exceeds200k??!1}:e,s=(e,s,o,l,c,d)=>{let u=(0,n.useTranslations)("session")("newSessionTitle");return(0,t.useMemo)(()=>{let t=((e,t,n,s,o,l)=>{let c={title:s,createdAt:null,updatedAt:null,fileSize:0,userCount:0,assistantCount:0,inputTokens:null,cachedInputTokens:null,outputTokens:null,reasoningOutputTokens:null,totalCost:null,currentContextTokens:null,contextWindowSize:null,usedPercentage:null,model:null,exceeds200k:!1},d=o??l??s;if(n){let{userCount:d,assistantCount:u,updatedAt:m}=a(e,n.lastTimestamp),_=n.customTitle??o??i(e)??l??s;return r({...c,title:_,createdAt:n.createdAt,updatedAt:m??n.updatedAt,fileSize:n.fileSize,userCount:n.userCount+d,assistantCount:n.assistantCount+u},t)}if(0===e.length)return r({...c,title:d},t);let{userCount:u,assistantCount:m,updatedAt:_}=a(e),p=o??i(e)??l??s,g=e[0].timestamp?new Date(e[0].timestamp).toISOString():null;return r({...c,title:p,createdAt:g,updatedAt:_,userCount:u,assistantCount:m},t)})(e,l,o,u,c,d);return s?{...t,title:s}:t},[e,s,o,l,u,c,d])};e.s(["default",0,(e,n,i,a,r,o)=>{let l=s(e,n,i,a,r,o),[c,d]=(0,t.useState)(!1);return{meta:l,isExpanded:c,toggleExpanded:(0,t.useCallback)(()=>{d(e=>!e)},[]),collapse:(0,t.useCallback)(()=>{d(!1)},[])}},"useSessionMetaCompute",0,s])},967086,541301,767708,650001,e=>{"use strict";var t=e.i(191788);e.s(["default",0,e=>{let[n,i]=(0,t.useState)(null),[a,r]=(0,t.useState)(!0),s=(0,t.useRef)(null),o=(0,t.useCallback)(async()=>{try{let t=await fetch(`/api/git/branch?tmuxSession=${encodeURIComponent(e)}`);if(!t.ok)return void i(null);let n=await t.json();i(n.branch??null)}catch{i(null)}finally{r(!1)}},[e]);return(0,t.useEffect)(()=>e?(r(!0),o(),s.current=setInterval(o,3e4),()=>{s.current&&(clearInterval(s.current),s.current=null)}):void r(!1),[e,o]),{branch:n,isLoading:a}}],967086),e.s(["default",0,function(e){let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],[i,a]=(0,t.useState)(null),[r,s]=(0,t.useState)(!0),o=(0,t.useRef)(null),l=(0,t.useCallback)(async()=>{try{let t=await fetch(`/api/git/status?tmuxSession=${encodeURIComponent(e)}`);if(!t.ok)return void a(null);let n=await t.json();a(n.status??null)}catch{a(null)}finally{s(!1)}},[e]);return(0,t.useEffect)(()=>e&&n?(s(!0),l(),o.current=setInterval(l,3e4),()=>{o.current&&(clearInterval(o.current),o.current=null)}):void s(!1),[e,n,l]),{status:i,isLoading:r}}],541301),e.s(["default",0,(e,n)=>{let[i,a]=(0,t.useState)(null);return(0,t.useEffect)(()=>{if(!n||!e)return;let t=new AbortController;return(async()=>{try{let n=await fetch(`/api/tmux/info?session=${encodeURIComponent(e)}`,{signal:t.signal});if(!n.ok)return;let i=await n.json();a(i)}catch{}})(),()=>t.abort()},[n,e]),i}],767708),e.s(["default",0,(e,n)=>{let[i,a]=(0,t.useState)(null);return(0,t.useEffect)(()=>{if(!n||!e)return;let t=!1,i=new AbortController;return fetch(`/api/timeline/message-counts?jsonlPath=${encodeURIComponent(e)}`,{signal:i.signal}).then(e=>e.ok?e.json():null).then(e=>{!t&&e&&a(e)}).catch(()=>{}),()=>{t=!0,i.abort()}},[e,n]),i}],650001)},441693,17122,74531,742921,273062,385459,165137,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(265524),a=e.i(352819),r=e.i(199648),s=e.i(939310),o=e.i(569479),l=e.i(319987),c=e.i(494834),d=e.i(143100),u=e.i(353533),m=e.i(490034);let _=e=>{if("ArrowDown"===e.key){e.preventDefault();let t=e.currentTarget.closest("[data-session-row]")?.nextElementSibling?.querySelector("button");t?.focus()}else if("ArrowUp"===e.key){e.preventDefault();let t=e.currentTarget.closest("[data-session-row]")?.previousElementSibling?.querySelector("button");t?.focus()}},p=(0,n.memo)(e=>{let{session:n,isResuming:i,isDisabled:r,onSelect:s,onDeleted:o}=e,p=(0,a.useTranslations)("session"),g=(0,m.default)(e=>e.sessionWorkflow.titles?.[`claude:${n.sessionId}`]),f=(0,c.default)(n.lastActivityAt).format("MM/DD HH:mm"),h=((e,t)=>{let n=(0,c.default)(),i=(0,c.default)(e),a=n.diff(i,"minute");if(a<1)return t("justNow");if(a<60)return t("minutesAgo",{count:a});let r=n.diff(i,"hour");if(r<24)return t("hoursAgo",{count:r});let s=n.diff(i,"day");if(1===s)return t("yesterday");if(s<7)return t("daysAgo",{count:s});let o=n.diff(i,"week");if(o<4)return t("weeksAgo",{count:o});let l=n.diff(i,"month");return l<12?t("monthsAgo",{count:l}):t("yearsAgo",{count:n.diff(i,"year")})})(n.lastActivityAt,p),E=g||n.firstMessage||p("noMessage");return(0,t.jsx)(l.default,{provider:"claude",sessionId:n.sessionId,label:n.firstMessage,disabled:r,onDeleted:o,children:(0,t.jsxs)("button",{type:"button",className:(0,u.cn)("w-full cursor-pointer border-b border-border/50 py-3 pl-1 pr-10 text-left transition-colors hover:bg-claude-active/5",r&&!i&&"pointer-events-none opacity-50",i&&"bg-claude-active/5"),onClick:()=>s(n.sessionId),onKeyDown:_,disabled:r,"aria-label":p("sessionLabel",{message:E}),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs",children:[i?(0,t.jsx)(d.Loader2,{size:14,className:"shrink-0 animate-spin text-claude-active"}):(0,t.jsx)("span",{className:"inline-block h-1.5 w-1.5 shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:f})]}),(0,t.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:h})]}),(0,t.jsxs)("div",{className:"mt-1 flex items-center justify-between gap-2 pl-[12px]",children:[(0,t.jsx)("span",{className:"min-w-0 truncate text-sm font-medium text-left",children:E}),(0,t.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:p("turnCount",{count:n.turnCount})})]})]})})}),g=()=>(0,t.jsx)("div",{className:"flex flex-col",children:[1,2,3].map(e=>(0,t.jsxs)("div",{className:"border-b border-border/50 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{className:"h-3.5 w-24 animate-pulse rounded bg-muted"}),(0,t.jsx)("div",{className:"h-3.5 w-16 animate-pulse rounded bg-muted"})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-center justify-between pl-[18px]",children:[(0,t.jsx)("div",{className:"h-4 w-40 animate-pulse rounded bg-muted"}),(0,t.jsx)("div",{className:"h-3.5 w-8 animate-pulse rounded bg-muted"})]})]},e))}),f=e=>{let{error:n,retryLabel:i,onRetry:a}=e;return(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)("p",{className:"text-sm",children:n}),(0,t.jsx)(s.Button,{variant:"outline",size:"sm",onClick:a,children:i})]})};e.s(["default",0,e=>{let{sessions:l,isLoading:c,isLoadingMore:d,hasMore:u,error:m,resumingSessionId:_,onSelectSession:h,onRefresh:E,onLoadMore:S,onNewSession:b}=e,v=(0,a.useTranslations)("terminal"),T=(0,n.useRef)(null),y=(0,n.useCallback)(async()=>{await E(),T.current&&(T.current.scrollTop=0)},[E]),C=(0,n.useCallback)(()=>{let e=T.current;e&&u&&!d&&e.scrollTop+e.clientHeight>=e.scrollHeight-50&&S()},[u,d,S]),N=!!_;return(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-2",children:[(0,t.jsxs)("span",{className:"text-sm font-medium",children:[v("sessions"),l.length>0&&`(${l.length}${u?"+":""})`]}),b&&(0,t.jsxs)(s.Button,{variant:"outline",size:"sm",onClick:b,children:[(0,t.jsx)(i.Plus,{size:12}),v("newConversation")]})]}),c&&0===l.length?(0,t.jsx)(g,{}):m?(0,t.jsx)(f,{error:m,retryLabel:v("retryLoad"),onRetry:y}):(0,t.jsxs)("div",{ref:T,className:"flex-1 overflow-y-auto",onScroll:C,children:[(0,t.jsx)(o.TooltipProvider,{delay:300,children:l.map(e=>(0,t.jsx)(p,{session:e,isResuming:e.sessionId===_,isDisabled:N,onSelect:h,onDeleted:E},e.sessionId))}),d&&(0,t.jsx)("div",{className:"flex items-center justify-center py-3",children:(0,t.jsx)(r.default,{size:14,className:"text-muted-foreground"})})]})]})}],441693);var h=e.i(918703),E=e.i(909725);e.s(["default",0,e=>{let{onClose:n,onNewSession:r}=e,o=(0,a.useTranslations)("session.empty");return(0,t.jsxs)("div",{className:"relative flex h-full flex-col items-center justify-center gap-3 text-muted-foreground",children:[n&&(0,t.jsx)(s.Button,{variant:"ghost",size:"sm",className:"absolute top-2 right-2 h-7 w-7 p-0 text-muted-foreground",onClick:n,"aria-label":o("closeLabel"),children:(0,t.jsx)(E.X,{size:14})}),(0,t.jsx)(h.MessageSquare,{size:32,className:"opacity-50"}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:o("noSession")}),(0,t.jsx)("p",{className:"mt-1 text-xs opacity-70",children:o("startNewSession",{br:"\n"}).split("\n").map((e,n)=>(0,t.jsxs)("span",{children:[n>0&&(0,t.jsx)("br",{}),e]},n))})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[r&&(0,t.jsxs)(s.Button,{variant:"outline",size:"sm",onClick:r,children:[(0,t.jsx)(i.Plus,{size:14}),o("newConversation")]}),n&&(0,t.jsx)(s.Button,{variant:"ghost",size:"sm",onClick:n,children:o("close")})]})]})}],17122);var S=e.i(222564),b=e.i(749999),v=e.i(405137),T=e.i(646190);e.s(["default",0,e=>{let{icon:i,main:a,almostReady:r,subtitle:o,failed:l,failedHint:c,restartLabel:d,showTerminalLabel:m,className:_,almostReadyMs:p=2e3,errorThresholdMs:g,onRestart:f,onShowTerminal:h}=e,[E,y]=(0,n.useState)(0);return((0,n.useEffect)(()=>{let e=Date.now(),t=window.setInterval(()=>{y(Date.now()-e)},250);return()=>window.clearInterval(t)},[]),"number"==typeof g&&E>=g&&l&&c)?(0,t.jsxs)("div",{className:(0,u.cn)("flex h-full w-full flex-col items-center justify-center gap-4 px-6 text-center",_),role:"alert",children:[(0,t.jsx)(S.AlertCircle,{className:"h-8 w-8 text-destructive","aria-hidden":"true"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-base font-medium text-foreground",children:l}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:c})]}),(f||h)&&(0,t.jsxs)("div",{className:"flex gap-2",children:[f&&d&&(0,t.jsxs)(s.Button,{variant:"default",size:"sm",onClick:f,children:[(0,t.jsx)(b.RotateCcw,{className:"h-3.5 w-3.5"}),d]}),h&&m&&(0,t.jsxs)(s.Button,{variant:"outline",size:"sm",onClick:h,children:[(0,t.jsx)(v.TerminalSquare,{className:"h-3.5 w-3.5"}),m]})]})]}):(0,t.jsxs)("div",{className:(0,u.cn)("flex h-full w-full flex-col items-center justify-center gap-5 px-6",_),role:"status","aria-busy":"true",children:[i,(0,t.jsxs)("div",{className:"text-center","aria-live":"polite",children:[(0,t.jsx)("p",{className:"text-base font-medium text-foreground",children:E>=p&&r?r:a}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:o})]}),(0,t.jsxs)("div",{className:"flex w-full max-w-sm flex-col gap-2","aria-hidden":"true",children:[(0,t.jsx)(T.Skeleton,{className:"h-3 w-full"}),(0,t.jsx)(T.Skeleton,{className:"h-3 w-5/6"}),(0,t.jsx)(T.Skeleton,{className:"h-3 w-2/3"})]})]})}],74531);var y=e.i(205270);let C=(0,y.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);e.s(["ShieldAlert",0,C],742921);var N=e.i(679935);let x=async(e,t)=>{try{return(await fetch("/api/tmux/send-input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:e,input:String(t+1)})})).ok}catch{return!1}};e.s(["default",0,e=>{let{sessionName:i,options:r,fallback:s}=e,o=(0,a.useTranslations)("terminal"),[l,c]=(0,n.useState)(!1),d=async e=>{l||(c(!0),await x(i,e)||(c(!1),N.toast.error(o("bypassSendFailed"))))};return(0,t.jsxs)("div",{className:"mt-4 w-full max-w-xs rounded-lg border border-ui-amber/20 bg-ui-amber/5 px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-2.5 flex items-center gap-2 text-xs font-medium text-ui-amber",children:[(0,t.jsx)(C,{size:14}),(0,t.jsx)("span",{children:o("bypassPermissions")})]}),(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:r.map((e,n)=>(0,t.jsxs)("button",{disabled:l,onClick:()=>d(n),className:"flex items-center gap-2.5 rounded-md border border-border/50 px-3 py-2 text-left text-sm transition-colors hover:border-ui-amber/30 hover:bg-ui-amber/5 disabled:opacity-50",children:[(0,t.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded bg-muted text-xs font-medium text-muted-foreground",children:n+1}),(0,t.jsx)("span",{className:"font-medium",children:e.replace(/^\d+\.\s+/,"")})]},n))}),s&&(0,t.jsx)("div",{className:"mt-2 text-center",children:s})]})}],273062);let R=(0,y.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["ShieldCheck",0,R],385459);let O={claude:"Claude",codex:"Codex"};e.s(["default",0,e=>{let{folderPath:i,agent:r="claude",canRespond:s=!0,onRespond:o}=e,l=(0,a.useTranslations)("terminal"),[c,d]=(0,n.useState)(null),u=async e=>{if(!c&&s){d(e);try{await o(e)}finally{d(null)}}};return(0,t.jsxs)("div",{className:"mt-4 w-full max-w-md rounded-lg border border-ui-amber/20 bg-ui-amber/5 px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2 text-xs font-medium text-ui-amber",children:[(0,t.jsx)(R,{size:14}),(0,t.jsx)("span",{children:l("trustPromptTitle")})]}),(0,t.jsx)("div",{className:"mb-3 break-all rounded bg-background/50 px-2 py-1.5 text-xs font-mono text-foreground",children:i}),(0,t.jsx)("p",{className:"mb-3 text-xs text-muted-foreground",children:l("trustPromptDescription",{agentName:O[r]})}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("button",{disabled:null!==c||!s,onClick:()=>u("yes"),className:"flex items-center gap-2.5 rounded-md border border-border/50 px-3 py-2 text-left text-sm transition-colors hover:border-ui-amber/30 hover:bg-ui-amber/5 disabled:opacity-50",children:[(0,t.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded bg-muted text-xs font-medium text-muted-foreground",children:"1"}),(0,t.jsx)("span",{className:"font-medium",children:l("trustPromptYes")})]}),(0,t.jsxs)("button",{disabled:null!==c||!s,onClick:()=>u("no"),className:"flex items-center gap-2.5 rounded-md border border-border/50 px-3 py-2 text-left text-sm transition-colors hover:border-ui-amber/30 hover:bg-ui-amber/5 disabled:opacity-50",children:[(0,t.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded bg-muted text-xs font-medium text-muted-foreground",children:"2"}),(0,t.jsx)("span",{className:"font-medium",children:l("trustPromptNo")})]})]})]})}],165137)},140032,867202,536838,552797,817885,895764,457619,3812,623076,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(651175),a=e.i(821954),r=e.i(998234),s=e.i(698677);let o=(0,n.createContext)(void 0);e.s(["EditorCwdContext",0,o,"default",0,e=>{let{href:i,children:l,node:c,...d}=e,u=(0,n.useContext)(o),m=(0,r.parseEditorFileLink)(i??"",u),_=(0,a.default)(m);return _?(0,t.jsx)("a",{...d,href:_,onClick:e=>{e.preventDefault(),(0,s.openEditorTarget)(_)},children:l}):(0,t.jsx)("a",{...d,href:i?.startsWith("file:")?void 0:i,target:"_blank",rel:"noopener noreferrer",children:l})},"editorMarkdownUrlTransform",0,(e,t)=>"href"===t&&(0,r.parseEditorFileLink)(e,"/")?e:(0,i.defaultUrlTransform)(e)],140032);var l=e.i(205270);let c=(0,l.default)("octagon-x",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["OctagonX",0,c],867202);let d=(0,l.default)("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]);e.s(["ChevronsUp",0,d],536838);let u=(0,l.default)("message-square-more",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 11h.01",key:"z322tv"}],["path",{d:"M16 11h.01",key:"xkw8gn"}],["path",{d:"M8 11h.01",key:"1dfujw"}]]);e.s(["MessageSquareMore",0,u],552797);class m{diff(e,t){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"function"==typeof i?(n=i,i={}):"callback"in i&&(n=i.callback);let a=this.castInput(e,i),r=this.castInput(t,i),s=this.removeEmpty(this.tokenize(a,i)),o=this.removeEmpty(this.tokenize(r,i));return this.diffWithOptionsObj(s,o,i,n)}diffWithOptionsObj(e,t,n,i){var a;let r=e=>(e=this.postProcess(e,n),i)?void setTimeout(function(){i(e)},0):e,s=t.length,o=e.length,l=1,c=s+o;null!=n.maxEditLength&&(c=Math.min(c,n.maxEditLength));let d=null!=(a=n.timeout)?a:1/0,u=Date.now()+d,m=[{oldPos:-1,lastComponent:void 0}],_=this.extractCommon(m[0],t,e,0,n);if(m[0].oldPos+1>=o&&_+1>=s)return r(this.buildValues(m[0].lastComponent,t,e));let p=-1/0,g=1/0,f=()=>{for(let i=Math.max(p,-l);i<=Math.min(g,l);i+=2){let a,l=m[i-1],c=m[i+1];l&&(m[i-1]=void 0);let d=!1;if(c){let e=c.oldPos-i;d=c&&0<=e&&e<s}let u=l&&l.oldPos+1<o;if(!d&&!u){m[i]=void 0;continue}if(a=!u||d&&l.oldPos<c.oldPos?this.addToPath(c,!0,!1,0,n):this.addToPath(l,!1,!0,1,n),_=this.extractCommon(a,t,e,i,n),a.oldPos+1>=o&&_+1>=s)return r(this.buildValues(a.lastComponent,t,e))||!0;m[i]=a,a.oldPos+1>=o&&(g=Math.min(g,i-1)),_+1>=s&&(p=Math.max(p,i+1))}l++};if(i)!function e(){setTimeout(function(){if(l>c||Date.now()>u)return i(void 0);f()||e()},0)}();else for(;l<=c&&Date.now()<=u;){let e=f();if(e)return e}}addToPath(e,t,n,i,a){let r=e.lastComponent;return r&&!a.oneChangePerToken&&r.added===t&&r.removed===n?{oldPos:e.oldPos+i,lastComponent:{count:r.count+1,added:t,removed:n,previousComponent:r.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:t,removed:n,previousComponent:r}}}extractCommon(e,t,n,i,a){let r=t.length,s=n.length,o=e.oldPos,l=o-i,c=0;for(;l+1<r&&o+1<s&&this.equals(n[o+1],t[l+1],a);)l++,o++,c++,a.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!a.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=o,l}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let i,a=[];for(;e;)a.push(e),i=e.previousComponent,delete e.previousComponent,e=i;a.reverse();let r=a.length,s=0,o=0,l=0;for(;s<r;s++){let e=a[s];if(e.removed)e.value=this.join(n.slice(l,l+e.count)),l+=e.count;else{if(!e.added&&this.useLongestToken){let i=t.slice(o,o+e.count);i=i.map(function(e,t){let i=n[l+t];return i.length>e.length?i:e}),e.value=this.join(i)}else e.value=this.join(t.slice(o,o+e.count));o+=e.count,e.added||(l+=e.count)}}return a}}let _=new class extends m{constructor(){super(...arguments),this.tokenize=p}equals(e,t,n){return n.ignoreWhitespace?(n.newlineIsToken&&e.includes("\n")||(e=e.trim()),n.newlineIsToken&&t.includes("\n")||(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith("\n")&&(e=e.slice(0,-1)),t.endsWith("\n")&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function p(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));let n=[],i=e.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let e=0;e<i.length;e++){let a=i[e];e%2&&!t.newlineIsToken?n[n.length-1]+=a:n.push(a)}return n}e.s(["diffLines",0,function(e,t,n){return _.diff(e,t,n)}],817885);let g={damping:.7,stiffness:.05,mass:1.25},f=1e3/60,h=!1;function E(e,t){let i=(0,n.useCallback)(t=>(i.current=t,e(t)),t);return i}globalThis.document?.addEventListener("mousedown",()=>{h=!0}),globalThis.document?.addEventListener("mouseup",()=>{h=!1}),globalThis.document?.addEventListener("click",()=>{h=!1});let S=new Map;function b(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i={...g},a=!1;for(let e of t){if("instant"===e){a=!0;continue}"object"==typeof e&&(a=!1,i.damping=e.damping??i.damping,i.stiffness=e.stiffness??i.stiffness,i.mass=e.mass??i.mass)}let r=JSON.stringify(i);return S.has(r)||S.set(r,Object.freeze(i)),a?"instant":S.get(r)}e.s(["useStickToBottom",0,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,i]=(0,n.useState)(!1),[a,r]=(0,n.useState)(!1!==e.initial),[s,o]=(0,n.useState)(!1),l=(0,n.useRef)(null);l.current=e;let c=(0,n.useCallback)(()=>{if(!h)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(v.current)||v.current?.contains(t.commonAncestorContainer)},[]),d=(0,n.useCallback)(e=>{m.isAtBottom=e,r(e)},[]),u=(0,n.useCallback)(e=>{m.escapedFromLock=e,i(e)},[]),m=(0,n.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:a,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return v.current?.scrollTop??0},set scrollTop(scrollTop){v.current&&(v.current.scrollTop=scrollTop,m.ignoreScrollToTop=v.current.scrollTop)},get targetScrollTop(){if(!v.current||!T.current)return 0;return v.current.scrollHeight-1-v.current.clientHeight},get calculatedTargetScrollTop(){if(!v.current||!T.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let i=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:v.current,contentElement:T.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:i},requestAnimationFrame(()=>{n=void 0}),i},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=70}}},[]),_=(0,n.useCallback)(function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"string"==typeof t&&(t={animation:t}),t.preserveScrollPosition||d(!0);let n=Date.now()+(Number(t.wait)||0),i=b(l.current,t.animation),{ignoreEscapes:a=!1}=t,r=m.calculatedTargetScrollTop;t.duration instanceof Promise?t.duration.finally(()=>{e=Date.now()}):e=n+(t.duration??0);let s=async()=>{let t=new Promise(requestAnimationFrame).then(()=>{if(!m.isAtBottom)return m.animation=void 0,!1;let{scrollTop:o}=m,d=performance.now(),u=(d-(m.lastTick??d))/f;if(m.animation||(m.animation={behavior:i,promise:t,ignoreEscapes:a}),m.animation.behavior===i&&(m.lastTick=d),c()||n>Date.now())return s();if(o<Math.min(r,m.calculatedTargetScrollTop)){if(m.animation?.behavior===i){if("instant"===i)return m.scrollTop=m.calculatedTargetScrollTop,s();m.velocity=(i.damping*m.velocity+i.stiffness*m.scrollDifference)/i.mass,m.accumulated+=m.velocity*u,m.scrollTop+=m.accumulated,m.scrollTop!==o&&(m.accumulated=0)}return s()}return e>Date.now()?(r=m.calculatedTargetScrollTop,s()):(m.animation=void 0,m.scrollTop<m.calculatedTargetScrollTop)?_({animation:b(l.current,l.current.resize),ignoreEscapes:a,duration:Math.max(0,e-Date.now())||void 0}):m.isAtBottom});return t.then(e=>(requestAnimationFrame(()=>{m.animation||(m.lastTick=void 0,m.velocity=0)}),e))};return(!0!==t.wait&&(m.animation=void 0),m.animation?.behavior===i)?m.animation.promise:s()},[d,c,m]),p=(0,n.useCallback)(()=>{u(!0),d(!1)},[u,d]),g=(0,n.useCallback)(e=>{let{target:t}=e;if(t!==v.current)return;let{scrollTop:n,ignoreScrollToTop:i}=m,{lastScrollTop:a=n}=m;m.lastScrollTop=n,m.ignoreScrollToTop=void 0,i&&i>n&&(a=i),o(m.isNearBottom),setTimeout(()=>{if(m.resizeDifference||n===i)return;if(c()){u(!0),d(!1);return}let e=n>a,t=n<a;if(m.animation?.ignoreEscapes){m.scrollTop=a;return}t&&(u(!0),d(!1)),e&&u(!1),!m.escapedFromLock&&m.isNearBottom&&d(!0)},1)},[u,d,c,m]),S=(0,n.useCallback)(e=>{let{target:t,deltaY:n}=e,i=t;for(;!["scroll","auto"].includes(getComputedStyle(i).overflow);){if(!i.parentElement)return;i=i.parentElement}i===v.current&&n<0&&v.current.scrollHeight>v.current.clientHeight&&!m.animation?.ignoreEscapes&&(u(!0),d(!1))},[u,d,m]),v=E(e=>{v.current?.removeEventListener("scroll",g),v.current?.removeEventListener("wheel",S),e?.addEventListener("scroll",g,{passive:!0}),e?.addEventListener("wheel",S,{passive:!0})},[]),T=E(e=>{let t;m.resizeObserver?.disconnect(),e&&(m.resizeObserver=new ResizeObserver(e=>{let[n]=e,{height:i}=n.contentRect,a=i-(t??i);if(m.resizeDifference=a,m.scrollTop>m.targetScrollTop&&(m.scrollTop=m.targetScrollTop),o(m.isNearBottom),a>=0){let e=b(l.current,t?l.current.resize:l.current.initial);_({animation:e,wait:!0,preserveScrollPosition:!0,duration:"instant"===e?void 0:350})}else m.isNearBottom&&(u(!1),d(!0));t=i,requestAnimationFrame(()=>{setTimeout(()=>{m.resizeDifference===a&&(m.resizeDifference=0)},1)})}),m.resizeObserver?.observe(e))},[]);return{contentRef:T,scrollRef:v,scrollToBottom:_,stopScroll:p,isAtBottom:a||s,isNearBottom:s,escapedFromLock:t,state:m}}],895764);var v=e.i(352819),T=e.i(353533);let y=(0,n.memo)(e=>{let{entry:i}=e,a=(0,v.useTranslations)("timeline"),[r,s]=(0,n.useState)(!1),[o,l]=(0,n.useState)(i.pending),[c,d]=(0,n.useState)(!1),[u,m]=(0,n.useState)(!1),_=(0,n.useRef)(null);o!==i.pending&&(l(i.pending),s(!1)),(0,n.useEffect)(()=>{if(!i.pending)return;let e=setTimeout(()=>s(!0),3e3);return()=>clearTimeout(e)},[i.pending]),(0,n.useEffect)(()=>{let e=_.current;if(!e)return;let t=()=>m(e.scrollHeight-e.clientHeight>1);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[i.text,c]);let p=!0===i.fadingOut,g=i.pending&&r,f=i.images&&i.images.length>0,h=i.text.length>0,E=!c,S=u||c;return(0,t.jsx)("div",{className:"animate-in fade-in duration-150 flex justify-end",children:(0,t.jsxs)("div",{className:(0,T.cn)("bg-ui-blue/10 rounded-lg px-4 py-2.5 max-w-[85%] transition-opacity",p?"duration-200":"duration-500",p?"opacity-0":g&&"opacity-50"),children:[f&&(0,t.jsx)("div",{className:(0,T.cn)("flex flex-wrap gap-2",h&&"mb-2"),children:i.images.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>(e=>{let t=e.match(/^data:([^;]+);base64,(.+)$/);if(!t)return void window.open(e,"_blank","noopener,noreferrer");let[,n,i]=t,a=atob(i),r=new Uint8Array(a.length);for(let e=0;e<a.length;e++)r[e]=a.charCodeAt(e);let s=URL.createObjectURL(new Blob([r],{type:n}));window.open(s,"_blank","noopener,noreferrer"),setTimeout(()=>URL.revokeObjectURL(s),6e4)})(e),className:"cursor-zoom-in",children:(0,t.jsx)("img",{src:e,alt:"",className:"max-h-[200px] w-auto rounded-md object-contain",loading:"lazy"})},e))}),h&&(0,t.jsx)("p",{ref:_,className:(0,T.cn)("text-sm whitespace-pre-wrap break-words",E&&"line-clamp-6"),children:i.text}),h&&S&&(0,t.jsx)("button",{type:"button",onClick:()=>d(e=>!e),className:"text-xs mt-1.5 text-muted-foreground hover:underline",children:a(c?"collapseMessage":"expandMessage")})]})})});function C(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let i=0,a=n.indexOf(t);for(;-1!==a;)i++,a=n.indexOf(t,a+t.length);return i}e.s(["default",0,y],457619);var N=e.i(305400),x=e.i(733473),R=e.i(931188),O=e.i(443689);let I="phrasing",A=["autolink","link","image","label"];function w(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function D(e){this.config.enter.autolinkProtocol.call(this,e)}function L(e){this.config.exit.autolinkProtocol.call(this,e)}function M(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];(0,N.ok)("link"===t.type),t.url="http://"+this.sliceSerialize(e)}function k(e){this.config.exit.autolinkEmail.call(this,e)}function P(e){this.exit(e)}function F(e){!function(e,t,n){let i=(0,O.convert)((n||{}).ignore||[]),a=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],i=-1;for(;++i<n.length;){var a;let e=n[i];t.push(["string"==typeof(a=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(a),"g"):a,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),r=-1;for(;++r<a.length;)(0,R.visitParents)(e,"text",s);function s(e,t){let n,s=-1;for(;++s<t.length;){let e=t[s],a=n?n.children:void 0;if(i(e,a?a.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],i=a[r][0],s=a[r][1],o=0,l=n.children.indexOf(e),c=!1,d=[];i.lastIndex=0;let u=i.exec(e.value);for(;u;){let n=u.index,a={index:u.index,input:u.input,stack:[...t,e]},r=s(...u,a);if("string"==typeof r&&(r=r.length>0?{type:"text",value:r}:void 0),!1===r?i.lastIndex=n+1:(o!==n&&d.push({type:"text",value:e.value.slice(o,n)}),Array.isArray(r)?d.push(...r):r&&d.push(r),o=n+u[0].length,c=!0),!i.global)break;u=i.exec(e.value)}return c?(o<e.value.length&&d.push({type:"text",value:e.value.slice(o)}),n.children.splice(l,1,...d)):d=[e],l+d.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,U],[/(^|(?=[\u0000-\uFFFF])[\s\p{P}\p{S}])([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,B]],{ignore:["link","linkReference"]})}function U(e,t,n,i,a){let r,s="";if(!G(a))return!1;if(/^w/i.test(t)&&(n=t+n,t="",s="http://"),(r=n.split(".")).length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))return!1;let o=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")"),a=C(e,"("),r=C(e,")");for(;-1!==i&&a>r;)e+=n.slice(0,i+1),i=(n=n.slice(i+1)).indexOf(")"),r++;return[e,n]}(n+i);if(!o[0])return!1;let l={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function B(e,t,n,i,a){if(!G({...a,index:a.index+t.length},!0)||/[-\d_]$/.test(i))return!1;let r={type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]};return t?[{type:"text",value:t},r]:r}function G(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||(0,x.unicodeWhitespace)(n)||(0,x.unicodePunctuation)(n))&&(!t||47!==n)}var j=e.i(657699);function Y(){this.buffer()}function H(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function V(){this.buffer()}function $(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function z(e){let t=this.resume(),n=this.stack[this.stack.length-1];(0,N.ok)("footnoteReference"===n.type),n.identifier=(0,j.normalizeIdentifier)(this.sliceSerialize(e)).toLowerCase(),n.label=t}function q(e){this.exit(e)}function W(e){let t=this.resume(),n=this.stack[this.stack.length-1];(0,N.ok)("footnoteDefinition"===n.type),n.identifier=(0,j.normalizeIdentifier)(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Q(e){this.exit(e)}function K(e,t,n,i){let a=n.createTracker(i),r=a.move("[^"),s=n.enter("footnoteReference"),o=n.enter("reference");return r+=a.move(n.safe(n.associationId(e),{after:"]",before:r})),o(),s(),r+=a.move("]")}function X(e,t,n){return 0===t?e:Z(e,t,n)}function Z(e,t,n){return(n?"":" ")+e}K.peek=function(){return"["};let J=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function ee(e){this.enter({type:"delete",children:[]},e)}function et(e){this.exit(e)}function en(e,t,n,i){let a=n.createTracker(i),r=n.enter("strikethrough"),s=a.move("~~");return s+=n.containerPhrasing(e,{...a.current(),before:s,after:"~"}),s+=a.move("~~"),r(),s}function ei(e){return e.length}function ea(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:114*(82===t||114===t)}en.peek=function(){return"~"};var er=e.i(593822);e.i(869701);e.i(554792);function es(e,t,n){let i=e.value||"",a="`",r=-1;for(;RegExp("(^|[^`])"+a+"([^`]|$)").test(i);)a+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++r<n.unsafe.length;){let e,t=n.unsafe[r],a=n.compilePattern(t);if(t.atBreak)for(;e=a.exec(i);){let t=e.index;10===i.charCodeAt(t)&&13===i.charCodeAt(t-1)&&t--,i=i.slice(0,t)+" "+i.slice(e.index+1)}}return a+i+a}es.peek=function(){return"`"};(0,O.convert)(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let eo=function(e,t,n,i){let a=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),r=n.bulletCurrent||function(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(r=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+r);let s=r.length+1;("tab"===a||"mixed"===a&&(t&&"list"===t.type&&t.spread||e.spread))&&(s=4*Math.ceil(s/4));let o=n.createTracker(i);o.move(r+" ".repeat(s-r.length)),o.shift(s);let l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),function(e,t,n){return t?(n?"":" ".repeat(s))+e:(n?r:r+" ".repeat(s-r.length))+e});return l(),c};function el(e){let t=e._align;(0,N.ok)(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function ec(e){this.exit(e),this.data.inTable=void 0}function ed(e){this.enter({type:"tableRow",children:[]},e)}function eu(e){this.exit(e)}function em(e){this.enter({type:"tableCell",children:[]},e)}function e_(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ep));let n=this.stack[this.stack.length-1];(0,N.ok)("inlineCode"===n.type),n.value=t,this.exit(e)}function ep(e,t){return"|"===t?t:e}function eg(e){let t=this.stack[this.stack.length-2];(0,N.ok)("listItem"===t.type),t.checked="taskListCheckValueChecked"===e.type}function ef(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];(0,N.ok)("paragraph"===e.type);let n=e.children[0];if(n&&"text"===n.type){let i,a=t.children,r=-1;for(;++r<a.length;){let e=a[r];if("paragraph"===e.type){i=e;break}}i===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function eh(e,t,n,i){let a=e.children[0],r="boolean"==typeof e.checked&&a&&"paragraph"===a.type,s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(i);r&&o.move(s);let l=eo(e,t,n,{...i,...o.current()});return r&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+s})),l}var eE=e.i(383166);let eS={tokenize:function(e,t,n){let i=0;return function t(r){return(87===r||119===r)&&i<3?(i++,e.consume(r),t):46===r&&3===i?(e.consume(r),a):n(r)};function a(e){return null===e?n(e):t(e)}},partial:!0},eb={tokenize:function(e,t,n){let i,a,r;return s;function s(t){return 46===t||95===t?e.check(eT,l,o)(t):null===t||(0,x.markdownLineEndingOrSpace)(t)||(0,x.unicodeWhitespace)(t)||45!==t&&(0,x.unicodePunctuation)(t)?l(t):(r=!0,e.consume(t),s)}function o(t){return 95===t?i=!0:(a=i,i=void 0),e.consume(t),s}function l(e){return a||i||!r?n(e):t(e)}},partial:!0},ev={tokenize:function(e,t){let n=0,i=0;return a;function a(s){return 40===s?(n++,e.consume(s),a):41===s&&i<n?r(s):33===s||34===s||38===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||60===s||63===s||93===s||95===s||126===s?e.check(eT,t,r)(s):null===s||(0,x.markdownLineEndingOrSpace)(s)||(0,x.unicodeWhitespace)(s)?t(s):(e.consume(s),a)}function r(t){return 41===t&&i++,e.consume(t),a}},partial:!0},eT={tokenize:function(e,t,n){return i;function i(s){return 33===s||34===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||63===s||95===s||126===s?(e.consume(s),i):38===s?(e.consume(s),r):93===s?(e.consume(s),a):60===s||null===s||(0,x.markdownLineEndingOrSpace)(s)||(0,x.unicodeWhitespace)(s)?t(s):n(s)}function a(e){return null===e||40===e||91===e||(0,x.markdownLineEndingOrSpace)(e)||(0,x.unicodeWhitespace)(e)?t(e):i(e)}function r(t){return(0,x.asciiAlpha)(t)?function t(a){return 59===a?(e.consume(a),i):(0,x.asciiAlpha)(a)?(e.consume(a),t):n(a)}(t):n(t)}},partial:!0},ey={tokenize:function(e,t,n){return function(t){return e.consume(t),i};function i(e){return(0,x.asciiAlphanumeric)(e)?n(e):t(e)}},partial:!0},eC={name:"wwwAutolink",tokenize:function(e,t,n){let i=this;return function(t){return 87!==t&&119!==t||!eI.call(i,i.previous)||eL(i.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(eS,e.attempt(eb,e.attempt(ev,a),n),n)(t))};function a(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:eI},eN={name:"protocolAutolink",tokenize:function(e,t,n){let i=this,a="",r=!1;return function(t){return(72===t||104===t)&&eA.call(i,i.previous)&&!eL(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(t),e.consume(t),s):n(t)};function s(t){if((0,x.asciiAlpha)(t)&&a.length<5)return a+=String.fromCodePoint(t),e.consume(t),s;if(58===t){let n=a.toLowerCase();if("http"===n||"https"===n)return e.consume(t),o}return n(t)}function o(t){return 47===t?(e.consume(t),r)?l:(r=!0,o):n(t)}function l(t){return null===t||(0,x.asciiControl)(t)||(0,x.markdownLineEndingOrSpace)(t)||(0,x.unicodeWhitespace)(t)||(0,x.unicodePunctuation)(t)?n(t):e.attempt(eb,e.attempt(ev,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:eA},ex={name:"emailAutolink",tokenize:function(e,t,n){let i,a,r=this;return function(t){return!eD(t)||!ew.call(r,r.previous)||eL(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(i){return eD(i)?(e.consume(i),t):64===i?(e.consume(i),s):n(i)}(t))};function s(t){return 46===t?e.check(ey,l,o)(t):45===t||95===t||(0,x.asciiAlphanumeric)(t)?(a=!0,e.consume(t),s):l(t)}function o(t){return e.consume(t),i=!0,s}function l(s){return a&&i&&(0,x.asciiAlpha)(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(s)):n(s)}},previous:ew},eR={},eO=48;for(;eO<123;)eR[eO]=ex,58==++eO?eO=65:91===eO&&(eO=97);function eI(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||(0,x.markdownLineEndingOrSpace)(e)}function eA(e){return!(0,x.asciiAlpha)(e)}function ew(e){return!(47===e||eD(e))}function eD(e){return 43===e||45===e||46===e||95===e||(0,x.asciiAlphanumeric)(e)}function eL(e){let t=e.length,n=!1;for(;t--;){let i=e[t][1];if(("labelLink"===i.type||"labelImage"===i.type)&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}eR[43]=ex,eR[45]=ex,eR[46]=ex,eR[95]=ex,eR[72]=[ex,eN],eR[104]=[ex,eN],eR[87]=[ex,eC],eR[119]=[ex,eC];var eM=e.i(959323),ek=e.i(526912);let eP={tokenize:function(e,t,n){let i=this;return(0,ek.factorySpace)(e,function(e){let a=i.events[i.events.length-1];return a&&"gfmFootnoteDefinitionIndent"===a[1].type&&4===a[2].sliceSerialize(a[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function eF(e,t,n){let i,a=this,r=a.events.length,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);for(;r--;){let e=a.events[r][1];if("labelImage"===e.type){i=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(r){if(!i||!i._balanced)return n(r);let o=(0,j.normalizeIdentifier)(a.sliceSerialize({start:i.end,end:a.now()}));return 94===o.codePointAt(0)&&s.includes(o.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(r),e.exit("gfmFootnoteCallLabelMarker"),t(r)):n(r)}}function eU(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;let r={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},r.start),end:Object.assign({},r.end)},o=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...o),e}function eB(e,t,n){let i,a=this,r=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]),s=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),o};function o(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(o){if(s>999||93===o&&!i||null===o||91===o||(0,x.markdownLineEndingOrSpace)(o))return n(o);if(93===o){e.exit("chunkString");let i=e.exit("gfmFootnoteCallString");return r.includes((0,j.normalizeIdentifier)(a.sliceSerialize(i)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(o)}return(0,x.markdownLineEndingOrSpace)(o)||(i=!0),s++,e.consume(o),92===o?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),s++,l):l(t)}}function eG(e,t,n){let i,a,r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(o>999||93===t&&!a||null===t||91===t||(0,x.markdownLineEndingOrSpace)(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return i=(0,j.normalizeIdentifier)(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),u}return(0,x.markdownLineEndingOrSpace)(t)||(a=!0),o++,e.consume(t),92===t?d:c}function d(t){return 91===t||92===t||93===t?(e.consume(t),o++,c):c(t)}function u(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s.includes(i)||s.push(i),(0,ek.factorySpace)(e,m,"gfmFootnoteDefinitionWhitespace")):n(t)}function m(e){return t(e)}}function ej(e,t,n){return e.check(eM.blankLine,t,e.attempt(eP,t,n))}function eY(e){e.exit("gfmFootnoteDefinition")}var eH=e.i(847202),eV=e.i(433565);class e${constructor(){this.map=[]}add(e,t,n){!function(e,t,n,i){let a=0;if(0!==n||0!==i.length){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...i);return}a+=1}e.map.push([t,n,i])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let i=n.pop();for(;i;){for(let t of i)e.push(t);i=n.pop()}this.map.length=0}}function ez(e,t,n){let i,a=this,r=0,s=0;return function(e){let t=a.events.length-1;for(;t>-1;){let e=a.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let i=t>-1?a.events[t][1].type:null,r="tableHead"===i||"tableRow"===i?E:o;return r===E&&a.parser.lazy[a.now().line]?n(e):r(e)};function o(t){var n;return e.enter("tableHead"),e.enter("tableRow"),124===(n=t)||(i=!0,s+=1),l(n)}function l(t){return null===t?n(t):(0,x.markdownLineEnding)(t)?s>1?(s=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),u):n(t):(0,x.markdownSpace)(t)?(0,ek.factorySpace)(e,l,"whitespace")(t):(s+=1,i&&(i=!1,r+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),i=!0,l):(e.enter("data"),c(t))}function c(t){return null===t||124===t||(0,x.markdownLineEndingOrSpace)(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?d:c)}function d(t){return 92===t||124===t?(e.consume(t),c):c(t)}function u(t){return(a.interrupt=!1,a.parser.lazy[a.now().line])?n(t):(e.enter("tableDelimiterRow"),i=!1,(0,x.markdownSpace)(t))?(0,ek.factorySpace)(e,m,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):m(t)}function m(t){return 45===t||58===t?p(t):124===t?(i=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),_):n(t)}function _(t){return(0,x.markdownSpace)(t)?(0,ek.factorySpace)(e,p,"whitespace")(t):p(t)}function p(t){return 58===t?(s+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),g):45===t?(s+=1,g(t)):null===t||(0,x.markdownLineEnding)(t)?h(t):n(t)}function g(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),f):(e.exit("tableDelimiterFiller"),f(n))}(t)):n(t)}function f(t){return(0,x.markdownSpace)(t)?(0,ek.factorySpace)(e,h,"whitespace")(t):h(t)}function h(a){if(124===a)return m(a);if(null===a||(0,x.markdownLineEnding)(a))return i&&r===s?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(a)):n(a);return n(a)}function E(t){return e.enter("tableRow"),S(t)}function S(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),S):null===n||(0,x.markdownLineEnding)(n)?(e.exit("tableRow"),t(n)):(0,x.markdownSpace)(n)?(0,ek.factorySpace)(e,S,"whitespace")(n):(e.enter("data"),b(n))}function b(t){return null===t||124===t||(0,x.markdownLineEndingOrSpace)(t)?(e.exit("data"),S(t)):(e.consume(t),92===t?v:b)}function v(t){return 92===t||124===t?(e.consume(t),b):b(t)}}function eq(e,t){let n,i,a,r=-1,s=!0,o=0,l=[0,0,0,0],c=[0,0,0,0],d=!1,u=0,m=new e$;for(;++r<e.length;){let _=e[r],p=_[1];"enter"===_[0]?"tableHead"===p.type?(d=!1,0!==u&&(eQ(m,t,u,n,i),i=void 0,u=0),n={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},m.add(r,0,[["enter",n,t]])):"tableRow"===p.type||"tableDelimiterRow"===p.type?(s=!0,a=void 0,l=[0,0,0,0],c=[0,r+1,0,0],d&&(d=!1,i={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},m.add(r,0,[["enter",i,t]])),o="tableDelimiterRow"===p.type?2:i?3:1):o&&("data"===p.type||"tableDelimiterMarker"===p.type||"tableDelimiterFiller"===p.type)?(s=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],a=eW(m,t,l,o,void 0,a),l=[0,0,0,0]),c[2]=r)):"tableCellDivider"===p.type&&(s?s=!1:(0!==l[1]&&(c[0]=c[1],a=eW(m,t,l,o,void 0,a)),c=[(l=c)[1],r,0,0])):"tableHead"===p.type?(d=!0,u=r):"tableRow"===p.type||"tableDelimiterRow"===p.type?(u=r,0!==l[1]?(c[0]=c[1],a=eW(m,t,l,o,r,a)):0!==c[1]&&(a=eW(m,t,c,o,r,a)),o=0):o&&("data"===p.type||"tableDelimiterMarker"===p.type||"tableDelimiterFiller"===p.type)&&(c[3]=r)}for(0!==u&&eQ(m,t,u,n,i),m.consume(t.events),r=-1;++r<t.events.length;){let e=t.events[r];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,i=[];for(;t<e.length;){let a=e[t];if(n){if("enter"===a[0])"tableContent"===a[1].type&&i.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===a[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=i.length-1;i[e]="left"===i[e]?"center":"right"}}else if("tableDelimiterRow"===a[1].type)break}else"enter"===a[0]&&"tableDelimiterRow"===a[1].type&&(n=!0);t+=1}return i}(t.events,r))}return e}function eW(e,t,n,i,a,r){0!==n[0]&&(r.end=Object.assign({},eK(t.events,n[0])),e.add(n[0],0,[["exit",r,t]]));let s=eK(t.events,n[1]);if(r={type:1===i?"tableHeader":2===i?"tableDelimiter":"tableData",start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",r,t]]),0!==n[2]){let a=eK(t.events,n[2]),r=eK(t.events,n[3]),s={type:"tableContent",start:Object.assign({},a),end:Object.assign({},r)};if(e.add(n[2],0,[["enter",s,t]]),2!==i){let i=t.events[n[2]],a=t.events[n[3]];if(i[1].end=Object.assign({},a[1].end),i[1].type="chunkText",i[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,i=n[3]-n[2]-1;e.add(t,i,[])}}e.add(n[3]+1,0,[["exit",s,t]])}return void 0!==a&&(r.end=Object.assign({},eK(t.events,a)),e.add(a,0,[["exit",r,t]]),r=void 0),r}function eQ(e,t,n,i,a){let r=[],s=eK(t.events,n);a&&(a.end=Object.assign({},s),r.push(["exit",a,t])),i.end=Object.assign({},s),r.push(["exit",i,t]),e.add(n+1,0,r)}function eK(e,t){let n=e[t],i="enter"===n[0]?"start":"end";return n[1][i]}let eX={name:"tasklistCheck",tokenize:function(e,t,n){let i=this;return function(t){return null===i.previous&&i._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),a):n(t)};function a(t){return(0,x.markdownLineEndingOrSpace)(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),r):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),r):n(t)}function r(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(t)}function s(i){return(0,x.markdownLineEnding)(i)?t(i):(0,x.markdownSpace)(i)?e.check({tokenize:eZ},t,n)(i):n(i)}}};function eZ(e,t,n){return(0,ek.factorySpace)(e,function(e){return null===e?n(e):t(e)},"whitespace")}let eJ={};e.s(["default",0,function(e){var t;let n,i,a,r=e||eJ,s=this.data(),o=s.micromarkExtensions||(s.micromarkExtensions=[]),l=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),c=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);o.push((t=r,(0,eE.combineExtensions)([{text:eR},{document:{91:{name:"gfmFootnoteDefinition",tokenize:eG,continuation:{tokenize:ej},exit:eY}},text:{91:{name:"gfmFootnoteCall",tokenize:eB},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:eF,resolveTo:eU}}},(n=(t||{}).singleTilde,i={name:"strikethrough",tokenize:function(e,t,i){let a=this.previous,r=this.events,s=0;return function(o){return 126===a&&"characterEscape"!==r[r.length-1][1].type?i(o):(e.enter("strikethroughSequenceTemporary"),function r(o){let l=(0,er.classifyCharacter)(a);if(126===o)return s>1?i(o):(e.consume(o),s++,r);if(s<2&&!n)return i(o);let c=e.exit("strikethroughSequenceTemporary"),d=(0,er.classifyCharacter)(o);return c._open=!d||2===d&&!!l,c._close=!l||2===l&&!!d,t(o)}(o))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let i=n;for(;i--;)if("exit"===e[i][0]&&"strikethroughSequenceTemporary"===e[i][1].type&&e[i][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[i][1].end.offset-e[i][1].start.offset){e[n][1].type="strikethroughSequence",e[i][1].type="strikethroughSequence";let a={type:"strikethrough",start:Object.assign({},e[i][1].start),end:Object.assign({},e[n][1].end)},r={type:"strikethroughText",start:Object.assign({},e[i][1].end),end:Object.assign({},e[n][1].start)},s=[["enter",a,t],["enter",e[i][1],t],["exit",e[i][1],t],["enter",r,t]],o=t.parser.constructs.insideSpan.null;o&&(0,eH.splice)(s,s.length,0,(0,eV.resolveAll)(o,e.slice(i+1,n),t)),(0,eH.splice)(s,s.length,0,[["exit",r,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",a,t]]),(0,eH.splice)(e,i-1,n-i+3,s),n=i+s.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}},null==n&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:ez,resolveAll:eq}}},{text:{91:eX}}]))),l.push([{transforms:[F],enter:{literalAutolink:w,literalAutolinkEmail:D,literalAutolinkHttp:D,literalAutolinkWww:D},exit:{literalAutolink:P,literalAutolinkEmail:k,literalAutolinkHttp:L,literalAutolinkWww:M}},{enter:{gfmFootnoteCallString:Y,gfmFootnoteCall:H,gfmFootnoteDefinitionLabelString:V,gfmFootnoteDefinition:$},exit:{gfmFootnoteCallString:z,gfmFootnoteCall:q,gfmFootnoteDefinitionLabelString:W,gfmFootnoteDefinition:Q}},{canContainEols:["delete"],enter:{strikethrough:ee},exit:{strikethrough:et}},{enter:{table:el,tableData:em,tableHeader:em,tableRow:ed},exit:{codeText:e_,table:ec,tableData:eu,tableHeader:eu,tableRow:eu}},{exit:{taskListCheckValueChecked:eg,taskListCheckValueUnchecked:eg,paragraph:ef}}]),c.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:I,notInConstruct:A},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:I,notInConstruct:A},{character:":",before:"[ps]",after:"\\/",inConstruct:I,notInConstruct:A}]},(a=!1,r&&r.firstLineBlank&&(a=!0),{handlers:{footnoteDefinition:function(e,t,n,i){let r=n.createTracker(i),s=r.move("[^"),o=n.enter("footnoteDefinition"),l=n.enter("label");return s+=r.move(n.safe(n.associationId(e),{before:s,after:"]"})),l(),s+=r.move("]:"),e.children&&e.children.length>0&&(r.shift(4),s+=r.move((a?"\n":" ")+n.indentLines(n.containerFlow(e,r.current()),a?Z:X))),o(),s},footnoteReference:K},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:J}],handlers:{delete:en}},function(e){let t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,a=t.stringLength,r=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let i=es(e,t,n);return n.stack.includes("tableCell")&&(i=i.replace(/\|/g,"\\$&")),i},table:function(e,t,n,i){return o(function(e,t,n){let i=e.children,a=-1,r=[],s=t.enter("table");for(;++a<i.length;)r[a]=l(i[a],t,n);return s(),r}(e,n,i),e.align)},tableCell:s,tableRow:function(e,t,n,i){let a=o([l(e,n,i)]);return a.slice(0,a.indexOf("\n"))}}};function s(e,t,n,i){let a=n.enter("tableCell"),s=n.enter("phrasing"),o=n.containerPhrasing(e,{...i,before:r,after:r});return s(),a(),o}function o(e,t){return function(e,t){let n=t||{},i=(n.align||[]).concat(),a=n.stringLength||ei,r=[],s=[],o=[],l=[],c=0,d=-1;for(;++d<e.length;){let t=[],i=[],r=-1;for(e[d].length>c&&(c=e[d].length);++r<e[d].length;){var u;let s=null==(u=e[d][r])?"":String(u);if(!1!==n.alignDelimiters){let e=a(s);i[r]=e,(void 0===l[r]||e>l[r])&&(l[r]=e)}t.push(s)}s[d]=t,o[d]=i}let m=-1;if("object"==typeof i&&"length"in i)for(;++m<c;)r[m]=ea(i[m]);else{let e=ea(i);for(;++m<c;)r[m]=e}m=-1;let _=[],p=[];for(;++m<c;){let e=r[m],t="",i="";99===e?(t=":",i=":"):108===e?t=":":114===e&&(i=":");let a=!1===n.alignDelimiters?1:Math.max(1,l[m]-t.length-i.length),s=t+"-".repeat(a)+i;!1!==n.alignDelimiters&&((a=t.length+a+i.length)>l[m]&&(l[m]=a),p[m]=a),_[m]=s}s.splice(1,0,_),o.splice(1,0,p),d=-1;let g=[];for(;++d<s.length;){let e=s[d],t=o[d];m=-1;let i=[];for(;++m<c;){let a=e[m]||"",s="",o="";if(!1!==n.alignDelimiters){let e=l[m]-(t[m]||0),n=r[m];114===n?s=" ".repeat(e):99===n?e%2?(s=" ".repeat(e/2+.5),o=" ".repeat(e/2-.5)):o=s=" ".repeat(e/2):o=" ".repeat(e)}!1===n.delimiterStart||m||i.push("|"),!1!==n.padding&&(!1!==n.alignDelimiters||""!==a)&&(!1!==n.delimiterStart||m)&&i.push(" "),!1!==n.alignDelimiters&&i.push(s),i.push(a),!1!==n.alignDelimiters&&i.push(o),!1!==n.padding&&i.push(" "),(!1!==n.delimiterEnd||m!==c-1)&&i.push("|")}g.push(!1===n.delimiterEnd?i.join("").replace(/ +$/,""):i.join(""))}return g.join("\n")}(e,{align:t,alignDelimiters:i,padding:n,stringLength:a})}function l(e,t,n){let i=e.children,a=-1,r=[],o=t.enter("tableRow");for(;++a<i.length;)r[a]=s(i[a],e,t,n);return o(),r}}(r),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:eh}}]})}],3812);let e0=function(e,t,n){let i=(0,O.convert)(n);if(!e||!e.type||!e.children)throw Error("Expected parent node");if("number"==typeof t){if(t<0||t===1/0)throw Error("Expected positive finite number as index")}else if((t=e.children.indexOf(t))<0)throw Error("Expected child node or index");for(;++t<e.children.length;)if(i(e.children[t],t,e))return e.children[t]},e1=function(e){if(null==e)return e3;if("string"==typeof e){var t;return t=e,e2(function(e){return e.tagName===t})}if("object"==typeof e){var n=e;let t=[],i=-1;for(;++i<n.length;)t[i]=e1(n[i]);return e2(function(){for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];let a=-1;for(;++a<t.length;)if(t[a].apply(this,n))return!0;return!1})}if("function"==typeof e)return e2(e);throw Error("Expected function, string, or array as `test`")};function e2(e){return function(t,n,i){var a;return!!(null!==(a=t)&&"object"==typeof a&&"type"in a&&"tagName"in a&&e.call(this,t,"number"==typeof n?n:void 0,i||void 0))}}function e3(e){return!!(e&&"object"==typeof e&&"type"in e&&"element"===e.type&&"tagName"in e&&"string"==typeof e.tagName)}let e5=/\n/g,e4=/[\t ]+/g,e9=e1("br"),e6=e1(function(e){return"td"===e.tagName||"th"===e.tagName}),e7=e1("p"),e8=e1("tr"),te=e1(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",function(e){return!!(e.properties||{}).hidden},function(e){return"dialog"===e.tagName&&!(e.properties||{}).open}]),tt=e1(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function tn(e,t){let n,i=String(e.value),a=[],r=[],s=0;for(;s<=i.length;){e5.lastIndex=s;let e=e5.exec(i),n=e&&"index"in e?e.index:i.length;a.push(function(e,t,n){let i,a=[],r=0;for(;r<e.length;){e4.lastIndex=r;let n=e4.exec(e);i=n?n.index:e.length,r||i||!n||t||a.push(""),r!==i&&a.push(e.slice(r,i)),r=n?i+n[0].length:i}return r===i||n||a.push(""),a.join(" ")}(i.slice(s,n).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),0!==s||t.breakBefore,n!==i.length||t.breakAfter)),s=n+1}let o=-1;for(;++o<a.length;)8203===a[o].charCodeAt(a[o].length-1)||o<a.length-1&&8203===a[o+1].charCodeAt(0)?(r.push(a[o]),n=void 0):a[o]?("number"==typeof n&&r.push(n),r.push(a[o]),n=0):(0===o||o===a.length-1)&&r.push(0);return r}function ti(e,t){if("element"===e.type){let n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}e.s(["toText",0,function(e,t){let n,i="children"in e?e.children:[],a=tt(e),r=ti(e,{whitespace:(t||{}).whitespace||"normal",breakBefore:!1,breakAfter:!1}),s=[];("text"===e.type||"comment"===e.type)&&s.push(...tn(e,{whitespace:r,breakBefore:!0,breakAfter:!0}));let o=-1;for(;++o<i.length;)s.push(...function e(t,n,i){return"element"===t.type?function(t,n,i){let a,r,s=ti(t,i),o=t.children||[],l=-1,c=[];if(te(t))return c;for(e9(t)||e8(t)&&e0(n,t,e8)?r="\n":e7(t)?(a=2,r=2):tt(t)&&(a=1,r=1);++l<o.length;)c=c.concat(e(o[l],t,{whitespace:s,breakBefore:l?void 0:a,breakAfter:l<o.length-1?e9(o[l+1]):r}));return e6(t)&&e0(n,t,e6)&&c.push(" "),a&&c.unshift(a),r&&c.push(r),c}(t,n,i):"text"===t.type?"normal"===i.whitespace?tn(t,i):[String(t.value)]:[]}(i[o],e,{whitespace:r,breakBefore:o?void 0:a,breakAfter:o<i.length-1?e9(i[o+1]):a}));let l=[];for(o=-1;++o<s.length;){let e=s[o];"number"==typeof e?void 0!==n&&e>n&&(n=e):e&&(void 0!==n&&n>-1&&l.push("\n".repeat(n)||" "),n=-1,l.push(e))}return l.join("")}],623076)},865920,e=>{"use strict";var t=e.i(722322);e.s(["common",()=>t.grammars])},116925,30502,e=>{"use strict";var t=e.i(391398),n=e.i(140032),i=e.i(191788),a=e.i(407654),r=e.i(3812),s=e.i(623076),o=e.i(865920),l=e.i(914126),c=e.i(869701);let d={};function u(e){let t=e||d,n=t.aliases,i=t.detect||!1,a=t.languages||o.common,r=t.plainText,u=t.prefix,m=t.subset,_="hljs",p=(0,l.createLowlight)(a);if(n&&p.registerAlias(n),u){let e=u.indexOf("-");_=-1===e?u:u.slice(0,e)}return function(e,t){(0,c.visit)(e,"element",function(e,n,a){let o;if("code"!==e.tagName||!a||"element"!==a.type||"pre"!==a.tagName)return;let l=function(e){let t,n=e.properties.className,i=-1;if(Array.isArray(n)){for(;++i<n.length;){let e=String(n[i]);if("no-highlight"===e||"nohighlight"===e)return!1;t||"lang-"!==e.slice(0,5)||(t=e.slice(5)),t||"language-"!==e.slice(0,9)||(t=e.slice(9))}return t}}(e);if(!1===l||!l&&!i||l&&r&&r.includes(l))return;Array.isArray(e.properties.className)||(e.properties.className=[]),e.properties.className.includes(_)||e.properties.className.unshift(_);let c=(0,s.toText)(e,{whitespace:"pre"});try{o=l?p.highlight(l,c,{prefix:u}):p.highlightAuto(c,{prefix:u,subset:m})}catch(n){if(l&&/Unknown language/.test(n.message))return void t.message("Cannot highlight as `"+l+"`, it’s not registered",{ancestors:[a,e],cause:n,place:e.position,ruleId:"missing-language",source:"rehype-highlight"});throw n}!l&&o.data&&o.data.language&&e.properties.className.push("language-"+o.data.language),o.children.length>0&&(e.children=o.children)})}}e.s(["default",0,u],30502);let m=[r.default],_=[u],p={a:n.default},g=(0,i.memo)(e=>{let{entry:i}=e;return(0,t.jsx)("div",{className:"animate-in fade-in duration-150",children:(0,t.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none break-words text-sm [&_h1]:text-[1.6em] [&_h1]:mt-[1.4em] [&_h1]:mb-[0.6em] [&_pre]:bg-muted [&_pre]:rounded-md [&_pre]:p-3 [&_pre_code]:text-foreground [&_code]:text-[0.9em] [&_code.hljs]:text-[1em] [&_code]:font-normal [&_code]:font-mono [&_code::before]:content-none [&_code::after]:content-none",children:(0,t.jsx)(a.default,{remarkPlugins:m,rehypePlugins:_,components:p,urlTransform:n.editorMarkdownUrlTransform,children:i.markdown??""})})})});e.s(["default",0,g],116925)},901160,387561,912643,748486,865013,815226,864852,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(377216),a=e.i(353533),r=e.i(116925),s=e.i(352819),o=e.i(603331),l=e.i(744391),c=e.i(322966);class d{diff(e,t){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"function"==typeof i?(n=i,i={}):"callback"in i&&(n=i.callback);let a=this.castInput(e,i),r=this.castInput(t,i),s=this.removeEmpty(this.tokenize(a,i)),o=this.removeEmpty(this.tokenize(r,i));return this.diffWithOptionsObj(s,o,i,n)}diffWithOptionsObj(e,t,n,i){var a;let r=e=>(e=this.postProcess(e,n),i)?void setTimeout(function(){i(e)},0):e,s=t.length,o=e.length,l=1,c=s+o;null!=n.maxEditLength&&(c=Math.min(c,n.maxEditLength));let d=null!=(a=n.timeout)?a:1/0,u=Date.now()+d,m=[{oldPos:-1,lastComponent:void 0}],_=this.extractCommon(m[0],t,e,0,n);if(m[0].oldPos+1>=o&&_+1>=s)return r(this.buildValues(m[0].lastComponent,t,e));let p=-1/0,g=1/0,f=()=>{for(let i=Math.max(p,-l);i<=Math.min(g,l);i+=2){let a,l=m[i-1],c=m[i+1];l&&(m[i-1]=void 0);let d=!1;if(c){let e=c.oldPos-i;d=c&&0<=e&&e<s}let u=l&&l.oldPos+1<o;if(!d&&!u){m[i]=void 0;continue}if(a=!u||d&&l.oldPos<c.oldPos?this.addToPath(c,!0,!1,0,n):this.addToPath(l,!1,!0,1,n),_=this.extractCommon(a,t,e,i,n),a.oldPos+1>=o&&_+1>=s)return r(this.buildValues(a.lastComponent,t,e))||!0;m[i]=a,a.oldPos+1>=o&&(g=Math.min(g,i-1)),_+1>=s&&(p=Math.max(p,i+1))}l++};if(i)!function e(){setTimeout(function(){if(l>c||Date.now()>u)return i(void 0);f()||e()},0)}();else for(;l<=c&&Date.now()<=u;){let e=f();if(e)return e}}addToPath(e,t,n,i,a){let r=e.lastComponent;return r&&!a.oneChangePerToken&&r.added===t&&r.removed===n?{oldPos:e.oldPos+i,lastComponent:{count:r.count+1,added:t,removed:n,previousComponent:r.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:t,removed:n,previousComponent:r}}}extractCommon(e,t,n,i,a){let r=t.length,s=n.length,o=e.oldPos,l=o-i,c=0;for(;l+1<r&&o+1<s&&this.equals(n[o+1],t[l+1],a);)l++,o++,c++,a.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!a.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=o,l}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let i,a=[];for(;e;)a.push(e),i=e.previousComponent,delete e.previousComponent,e=i;a.reverse();let r=a.length,s=0,o=0,l=0;for(;s<r;s++){let e=a[s];if(e.removed)e.value=this.join(n.slice(l,l+e.count)),l+=e.count;else{if(!e.added&&this.useLongestToken){let i=t.slice(o,o+e.count);i=i.map(function(e,t){let i=n[l+t];return i.length>e.length?i:e}),e.value=this.join(i)}else e.value=this.join(t.slice(o,o+e.count));o+=e.count,e.added||(l+=e.count)}}return a}}let u=new class extends d{constructor(){super(...arguments),this.tokenize=m}equals(e,t,n){return n.ignoreWhitespace?(n.newlineIsToken&&e.includes("\n")||(e=e.trim()),n.newlineIsToken&&t.includes("\n")||(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith("\n")&&(e=e.slice(0,-1)),t.endsWith("\n")&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function m(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));let n=[],i=e.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let e=0;e<i.length;e++){let a=i[e];e%2&&!t.newlineIsToken?n[n.length-1]+=a:n.push(a)}return n}let _={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function p(e,t,n,i,a,r,s){var o;let l;void 0===(l=s?"function"==typeof s?{callback:s}:s:{}).context&&(l.context=4);let c=l.context;if(l.newlineIsToken)throw Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(!l.callback)return d(u.diff(n,i,l));{let{callback:e}=l;o=Object.assign(Object.assign({},l),{callback:t=>{e(d(t))}}),u.diff(n,i,o)}function d(n){if(!n)return;function i(e){return e.map(function(e){return" "+e})}n.push({value:"",lines:[]});let s=[],o=0,l=0,d=[],u=1,m=1;for(let e=0;e<n.length;e++){let t=n[e],a=t.lines||function(e){let t=e.endsWith("\n"),n=e.split("\n").map(e=>e+"\n");return t?n.pop():n.push(n.pop().slice(0,-1)),n}(t.value);if(t.lines=a,t.added||t.removed){if(!o){let t=n[e-1];o=u,l=m,t&&(o-=(d=c>0?i(t.lines.slice(-c)):[]).length,l-=d.length)}for(let e of a)d.push((t.added?"+":"-")+e);t.added?m+=a.length:u+=a.length}else{if(o)if(a.length<=2*c&&e<n.length-2)for(let e of i(a))d.push(e);else{let e=Math.min(a.length,c);for(let t of i(a.slice(0,e)))d.push(t);let t={oldStart:o,oldLines:u-o+e,newStart:l,newLines:m-l+e,lines:d};s.push(t),o=0,l=0,d=[]}u+=a.length,m+=a.length}}for(let e of s)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith("\n")?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,"\"),t++);return{oldFileName:e,newFileName:t,oldHeader:a,newHeader:r,hunks:s}}}function g(e,t){if(t||(t=_),Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders)throw Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(e=>g(e,t)).join("\n")}let n=[];t.includeIndex&&e.oldFileName==e.newFileName&&n.push("Index: "+e.oldFileName),t.includeUnderline&&n.push("==================================================================="),t.includeFileHeaders&&(n.push("--- "+e.oldFileName+(void 0===e.oldHeader?"":" "+e.oldHeader)),n.push("+++ "+e.newFileName+(void 0===e.newHeader?"":" "+e.newHeader)));for(let t=0;t<e.hunks.length;t++){let i=e.hunks[t];for(let e of(0===i.oldLines&&(i.oldStart-=1),0===i.newLines&&(i.newStart-=1),n.push("@@ -"+i.oldStart+","+i.oldLines+" +"+i.newStart+","+i.newLines+" @@"),i.lines))n.push(e)}return n.join("\n")+"\n"}c._cacheMap.name="@git-diff-view/file";var f=e.i(781641),h=e.i(73348),E=e.i(770643),S=e.i(21152),b=e.i(550309),v=e.i(399366),T=e.i(665263),y=e.i(878528),C=e.i(205270);let N=(0,C.default)("search-code",[["path",{d:"m13 13.5 2-2.5-2-2.5",key:"1rvxrh"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}],["path",{d:"M9 8.5 7 11l2 2.5",key:"6ffwbx"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);var x=e.i(266231),R=e.i(31050);let O={normal:11,large:13,"x-large":15},I={Read:f.FileText,Edit:h.FilePen,Write:E.FilePlus,Bash:S.Terminal,Grep:b.Search,Glob:b.Search,Agent:T.Users,WebSearch:y.Globe,WebFetch:y.Globe,ToolSearch:N},A=e=>{let{oldString:i,newString:a,filePath:r}=e,{resolvedTheme:s}=(0,o.useTheme)(),d="light"===s?"light":"dark",u=(0,x.default)(),m=O[(0,R.default)(e=>e.fontSize)]??O.normal,_=(0,n.useMemo)(()=>{let e,t=r?r.split("/").pop()||r:"file",n=(0,c.getLang)(t),s=(e=function(e,t,n,i,a){if("function"==typeof a&&(a={callback:a}),null==a?void 0:a.callback){let{callback:r}=a;p(e,t,n,i,"","",Object.assign(Object.assign({},a),{callback:e=>{e?r(g(e,a.headerOptions)):r(void 0)}}))}else{let r=p(e,t,n,i,"","",a);if(!r)return;return g(r,null==a?void 0:a.headerOptions)}}(t,t,i,a,{context:3}),new c.DiffFile(t,i,t,a,[e],n,n,void 0));return s.initTheme(d),s.init(),s.buildSplitDiffLines(),s.buildUnifiedDiffLines(),s},[i,a,r,d]);return(0,t.jsx)("div",{className:"diff-panel-content mt-1.5 overflow-hidden rounded border border-border text-xs",children:(0,t.jsx)(l.DiffView,{diffFile:_,diffViewMode:l.DiffModeEnum.Unified,diffViewTheme:d,diffViewHighlight:!0,diffViewWrap:u,diffViewFontSize:m})})},w=(0,n.memo)(e=>{var i;let r,{entry:o,result:l}=e,c=(0,s.useTranslations)("timeline"),[d,u]=(0,n.useState)(!1),m=o.diff&&(o.diff.oldString||o.diff.newString),_={pending:"text-ui-amber",success:"text-muted-foreground",error:"text-negative"}[o.status],p="pending"===o.status?"animate-pulse":"";return(0,t.jsxs)("div",{className:"py-1",children:[(0,t.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,t.jsx)("span",{className:(0,a.cn)("shrink-0 mt-0.5",_,p),children:(i=o.toolName,r=I[i]??v.Wrench,(0,t.jsx)(r,{size:12}))}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[o.input?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-xs font-mono break-all block",children:o.toolName}),(0,t.jsx)("pre",{className:"mt-1 max-h-80 overflow-auto rounded border border-border/40 bg-muted/40 p-2 text-xs font-mono whitespace-pre-wrap break-words",children:o.input})]}):(0,t.jsx)("span",{className:"text-xs font-mono break-all block",children:o.summary}),l&&(l.output||l.summary)&&!(m&&!l.isError)&&(0,t.jsx)("pre",{className:(0,a.cn)("mt-0.5 text-xs whitespace-pre-wrap break-words font-mono",l.output&&"max-h-80 overflow-auto rounded border border-border/40 bg-muted/40 p-2",l.isError?"text-negative/70":"text-muted-foreground/60"),children:l.output||l.summary})]})]}),m&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{className:"ml-4 mt-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>u(e=>!e),children:d?`▾ ${c("diffHide")}`:`▸ ${c("diffShow")}`}),d&&o.diff&&(0,t.jsx)("div",{className:"ml-4",children:(0,t.jsx)(A,{oldString:o.diff.oldString,newString:o.diff.newString,filePath:o.diff.filePath})})]})]})}),D=(0,n.memo)(e=>{let{toolCalls:r,toolResults:o}=e,l=(0,s.useTranslations)("timeline"),c=r.some(e=>"pending"===e.status),[d,u]=(0,n.useState)(c),m=(0,n.useMemo)(()=>new Map(o.map(e=>[e.toolUseId,e])),[o]),_=(()=>{let e,t;if(c)return l("commandsRunning",{count:r.length});let n=(e=new Set(r.map(e=>e.toolName)),t=[],(e.has("Read")||e.has("Grep")||e.has("Glob"))&&t.push("codeSearched"),(e.has("Edit")||e.has("Write"))&&t.push("codeEdited"),t).map(e=>l(e)),i=n.length>0?`, ${n.join(", ")}`:"";return`${l("commandsExecuted",{count:r.length})}${i}`})();return(0,t.jsxs)("div",{className:"animate-in fade-in duration-150",children:[(0,t.jsxs)("button",{className:"flex w-full items-center gap-1.5 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>u(e=>!e),children:[(0,t.jsx)(i.ChevronRight,{size:14,className:(0,a.cn)("shrink-0 transition-transform duration-150",d&&"rotate-90")}),(0,t.jsx)("span",{children:_})]}),d&&(0,t.jsx)("div",{className:"ml-[7px] mt-0.5 border-l border-border/40 pl-3",children:r.map(e=>(0,t.jsx)(w,{entry:e,result:m.get(e.toolUseId)},e.id))})]})});e.s(["default",0,D],387561);var L=e.i(140032);let M=(0,C.default)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);var k=e.i(609104),P=e.i(405137),F=e.i(189257),U=e.i(199648),B=e.i(407654),G=e.i(3812),j=e.i(30502),Y=e.i(679935),H=e.i(296202);let V=[G.default],$=[j.default],z={a:L.default},q=async e=>{try{let t=await fetch(`/api/tmux/plan-options?session=${encodeURIComponent(e)}`);if(!t.ok)return[];let n=await t.json();return Array.isArray(n.options)?n.options:[]}catch{return[]}},W=async(e,t)=>{try{return(await fetch("/api/tmux/send-input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:e,input:String(t+1)})})).ok}catch{return!1}},Q=(0,n.memo)(e=>{let{entry:i,sessionName:r}=e,o=(0,s.useTranslations)("timeline"),[l,c]=(0,n.useState)(!1),[d,u]=(0,n.useState)([]),[m,_]=(0,n.useState)(null),p=(i.markdown.split("\n").find(e=>e.replace(/^#+\s*/,"").trim())??"Plan").replace(/^#+\s*/,"").trim(),g="pending"===i.status,f="success"===i.status,h=g&&null===m&&!!r;(0,n.useEffect)(()=>{if(!g||!r)return;let e=!1;return(async()=>{if(await new Promise(e=>setTimeout(e,500)),e)return;let t=await q(r);!e&&t.length>0&&u(t)})(),()=>{e=!0}},[g,r]);let E=d.length>0?d:null,S=async e=>{!h||(_(e),await W(r,e)||(_(null),Y.toast.error(o("selectionFailed"))))};return(0,t.jsxs)("div",{className:"animate-in fade-in duration-150",children:[g?(0,t.jsxs)("div",{className:"rounded-lg border border-claude-active/20 bg-claude-active/5 px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-2.5 flex items-center gap-2 text-xs font-medium text-claude-active",children:[(0,t.jsx)(M,{size:14}),(0,t.jsx)("span",{children:o("planPendingLabel")}),(0,t.jsxs)("button",{type:"button",onClick:()=>c(!0),className:"ml-auto flex items-center gap-1 rounded-md border border-claude-active/30 bg-claude-active/10 px-2 py-0.5 text-claude-active transition-colors hover:bg-claude-active/20",children:[(0,t.jsx)(k.Eye,{size:12}),(0,t.jsx)("span",{children:o("planViewDetail")})]})]}),(0,t.jsx)("p",{className:"mb-3 text-sm",children:p}),E?(0,t.jsx)("div",{className:"mb-2.5 flex flex-col gap-1.5",children:E.map((e,n)=>{let i=m===n;return(0,t.jsxs)("button",{type:"button",disabled:!h,onClick:()=>S(n),className:(0,a.cn)("flex items-start gap-2.5 rounded-md border px-3 py-2 text-left text-sm transition-colors",i?"border-claude-active/40 bg-claude-active/10":null===m||i?"border-border/50":"border-border/30 opacity-50",h&&"cursor-pointer hover:border-claude-active/30 hover:bg-claude-active/5"),children:[(0,t.jsx)("span",{className:(0,a.cn)("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded text-xs font-medium",i?"bg-claude-active text-white":"bg-muted text-muted-foreground"),children:i&&!f?(0,t.jsx)(U.default,{size:10}):i?(0,t.jsx)(F.Check,{size:12}):n+1}),(0,t.jsx)("span",{className:"min-w-0 flex-1",children:e})]},n)})}):i.allowedPrompts&&i.allowedPrompts.length>0?(0,t.jsx)("div",{className:"mb-2.5 flex flex-col gap-1 text-xs text-muted-foreground",children:i.allowedPrompts.map((e,n)=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(P.TerminalSquare,{size:11,className:"shrink-0 text-claude-active/50"}),(0,t.jsx)("span",{className:"truncate",children:e.prompt})]},n))}):null,!E&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(P.TerminalSquare,{size:12}),(0,t.jsx)("span",{children:o("planApproveInTerminal")})]})]}):(0,t.jsxs)("button",{type:"button",onClick:()=>c(!0),className:"group flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-muted-foreground hover:bg-muted/50",children:[(0,t.jsx)(M,{size:14,className:"shrink-0 text-claude-active"}),(0,t.jsx)("span",{className:"shrink-0 font-semibold uppercase text-claude-active",children:"Plan"}),(0,t.jsx)("span",{className:"flex-1 truncate",children:p}),f&&(0,t.jsx)(F.Check,{size:12,className:"shrink-0 text-claude-active/60"}),(0,t.jsx)(k.Eye,{size:12,className:"shrink-0 opacity-0 transition-opacity group-hover:opacity-60"})]}),(0,t.jsx)(H.Dialog,{open:l,onOpenChange:c,children:(0,t.jsxs)(H.DialogContent,{className:"flex max-h-[80vh] flex-col sm:max-w-2xl",children:[(0,t.jsxs)(H.DialogHeader,{children:[(0,t.jsx)(H.DialogTitle,{children:p}),(0,t.jsx)(H.DialogDescription,{className:"sr-only",children:o("planDialogDescription")})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto overflow-x-hidden",children:(0,t.jsx)("div",{className:"prose prose-sm dark:prose-invert max-w-none text-sm [&_pre]:overflow-x-auto [&_pre]:bg-muted [&_pre]:rounded-md [&_pre]:p-3 [&_pre_code]:text-foreground [&_code]:text-[0.9em] [&_code.hljs]:text-[1em] [&_code]:font-normal [&_code]:font-mono [&_code::before]:content-none [&_code::after]:content-none",children:(0,t.jsx)(B.default,{remarkPlugins:V,rehypePlugins:$,components:z,urlTransform:L.editorMarkdownUrlTransform,children:i.markdown})})})]})})]})});e.s(["default",0,Q],912643);let K=e=>{let{entry:n}=e;switch(n.type){case"assistant-message":return(0,t.jsx)(r.default,{entry:n});case"plan":return(0,t.jsx)(Q,{entry:n});default:return null}},X=(0,n.memo)(e=>{let{entry:r}=e,[s,o]=(0,n.useState)(!1),l=(0,n.useMemo)(()=>(e=>{let t=[],n=[],i=[],a=()=>{n.length>0&&(t.push({type:"tool-group",id:n[0].id,toolCalls:[...n],toolResults:[...i]}),n=[],i=[])};for(let r of e)"tool-call"===r.type?n.push(r):"tool-result"===r.type?i.push(r):("assistant-message"===r.type||"plan"===r.type)&&(a(),t.push({type:"entry",id:r.id,entry:r}));return a(),t})(r.entries),[r.entries]),c=l.length>0;return(0,t.jsxs)("div",{className:"animate-in fade-in duration-150",children:[(0,t.jsxs)("button",{className:(0,a.cn)("flex w-full items-center gap-1.5 py-1 text-xs text-muted-foreground transition-colors",c&&"hover:text-foreground"),onClick:()=>c&&o(e=>!e),disabled:!c,children:[(0,t.jsx)(i.ChevronRight,{size:14,className:(0,a.cn)("shrink-0 transition-transform duration-150",s&&"rotate-90")}),(0,t.jsx)("span",{children:r.description})]}),s&&(0,t.jsx)("div",{className:"ml-[7px] mt-0.5 border-l border-border/40 pl-3",children:l.map(e=>(0,t.jsx)("div",{className:"py-0.5",children:"tool-group"===e.type?(0,t.jsx)(D,{toolCalls:e.toolCalls,toolResults:e.toolResults}):(0,t.jsx)(K,{entry:e.entry})},e.id))})]})});e.s(["default",0,X],901160);var Z=e.i(803057),J=e.i(979195),ee=e.i(484862),et=e.i(815242);let en=(0,n.memo)(e=>{var r;let{entry:o}=e,l=(0,s.useTranslations)("timeline"),[c,d]=(0,n.useState)(!1),u="completed"===o.status,m=!!o.result;return(0,t.jsxs)("div",{className:"animate-in fade-in duration-150",children:[(0,t.jsxs)("button",{className:(0,a.cn)("flex w-full items-center gap-1.5 py-1 text-xs text-muted-foreground transition-colors",m&&"hover:text-foreground"),onClick:()=>m&&d(e=>!e),disabled:!m,children:[m?(0,t.jsx)(i.ChevronRight,{size:14,className:(0,a.cn)("shrink-0 transition-transform duration-150",c&&"rotate-90")}):u?(0,t.jsx)(Z.CheckCircle2,{size:14,className:"shrink-0 text-positive"}):(0,t.jsx)(J.XCircle,{size:14,className:"shrink-0 text-negative"}),(0,t.jsx)("span",{className:"text-left",children:o.summary}),o.usage?.durationMs!=null&&(0,t.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-1 text-[11px] text-muted-foreground/50",children:[(0,t.jsx)(ee.Clock,{size:10}),(r=o.usage.durationMs)<1e3?`${r}ms`:`${(r/1e3).toFixed(1)}s`]})]}),c&&o.result&&(0,t.jsx)("div",{className:"ml-[7px] mt-0.5 border-l border-border/40 pl-3",children:(0,t.jsxs)("div",{className:"rounded-md bg-muted/30 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[u?(0,t.jsx)(Z.CheckCircle2,{size:12,className:"mt-0.5 shrink-0 text-positive"}):(0,t.jsx)(J.XCircle,{size:12,className:"mt-0.5 shrink-0 text-negative"}),(0,t.jsx)("pre",{className:"min-w-0 flex-1 whitespace-pre-wrap break-words text-xs text-foreground/70",children:o.result})]}),o.usage?.toolUses!=null&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-1 text-[11px] text-muted-foreground/50",children:[(0,t.jsx)(et.Zap,{size:10}),(0,t.jsx)("span",{children:l("toolUsageCount",{count:o.usage.toolUses})})]})]})})]})});e.s(["default",0,en],748486);let ei=(0,C.default)("message-circle-question-mark",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var ea=e.i(399267),er=e.i(701412);let es="rounded-lg border border-claude-active/20 bg-claude-active/5 px-4 py-3",eo=(e,t,n)=>(0,a.cn)("flex items-start gap-2.5 rounded-md border px-3 py-2 text-left text-sm transition-colors","focus-within:ring-2 focus-within:ring-claude-active/40 focus-within:ring-offset-2 focus-within:ring-offset-background",e?"border-claude-active/40 bg-claude-active/10":t?"border-border/30 opacity-50":"border-border/50",n&&"cursor-pointer hover:border-claude-active/30 hover:bg-claude-active/5"),el=e=>{let{header:n,children:i}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mb-2.5 flex items-center gap-2 text-xs font-medium text-claude-active",children:[(0,t.jsx)(ei,{size:14}),(0,t.jsx)("span",{children:n})]}),(0,t.jsx)("p",{className:"mb-3 text-sm",children:i})]})},ec=e=>{let{option:n,index:i,selected:r,pending:s=!1}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":"true",className:(0,a.cn)("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded text-xs font-medium",r?"bg-claude-active text-white":"bg-muted text-muted-foreground"),children:s?(0,t.jsx)(U.default,{size:10}):r?(0,t.jsx)(F.Check,{size:12}):i+1}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"font-medium",children:n.label}),n.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:n.description})]})]})},ed=async(e,t)=>{try{return(await fetch("/api/tmux/send-input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:e,input:String(t+1)})})).ok}catch{return!1}},eu=e=>{let{entry:i,tabId:r,agentSessionId:o}=e,l=(0,s.useTranslations)("timeline"),[c,d]=(0,n.useState)({}),[u,m]=(0,n.useState)(null),[_,p]=(0,n.useState)(!1),g=(0,n.useRef)(!1),f=(0,ea.default)(e=>r?e.tabs[r]?.workspaceId:void 0),h=i.answers??u,E="success"===i.status||null!==h,S=i.questions.every((e,t)=>c[t]?.trim()),b=async()=>{if(!S||E||g.current||!r||!f||!o)return;g.current=!0,p(!0);let e=i.questions.map((e,t)=>c[t].trim());try{if(!(await fetch(`/api/input-queue?${new URLSearchParams({workspaceId:f,tabId:r})}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"send-immediate",id:i.toolUseId,agentSessionId:o,text:(0,er.formatQuestionAnswers)(i.questions,e),attachments:[]})})).ok)throw Error("Answer submission failed");m(e)}catch{Y.toast.error(l("selectionFailed"))}finally{g.current=!1,p(!1)}};return(0,t.jsxs)("div",{className:(0,a.cn)("animate-in fade-in duration-150 space-y-3",es),children:[i.questions.map((e,n)=>{let a=h?.[n]??c[n],r=!!a&&!e.options.some(e=>e.label===a);return(0,t.jsxs)("fieldset",{className:"min-w-0",disabled:E||_,children:[(0,t.jsx)("legend",{className:"sr-only",children:e.question}),(0,t.jsx)(el,{header:e.header,children:e.question}),(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:e.options.map((e,r)=>{let s=a===e.label;return(0,t.jsxs)("label",{className:eo(s,E&&!s,!E&&!_),children:[(0,t.jsx)("input",{type:"radio",className:"sr-only",name:`${o}-${i.toolUseId}-${n}`,checked:s,onChange:()=>d(t=>({...t,[n]:e.label}))}),(0,t.jsx)(ec,{option:e,index:r,selected:s,pending:_&&s})]},e.label)})}),E?r&&(0,t.jsx)("p",{className:"mt-2 whitespace-pre-wrap break-words rounded-md border border-claude-active/40 bg-claude-active/10 px-3 py-2 text-sm",children:a}):(0,t.jsx)("input",{className:"mt-2 w-full rounded-md border border-border/50 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-claude-active/40","aria-label":e.question,value:c[n]??"",onChange:e=>d(t=>({...t,[n]:e.target.value}))})]},n)}),E?(0,t.jsxs)("p",{className:"flex items-center gap-1.5 text-xs text-claude-active",children:[(0,t.jsx)(F.Check,{size:14}),l("answerSubmitted")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",disabled:!S||!r||!f||!o||_,className:"flex items-center gap-2 rounded-md border border-claude-active/40 bg-claude-active/10 px-3 py-2 text-sm font-medium text-claude-active transition-colors hover:bg-claude-active/20 disabled:cursor-not-allowed disabled:opacity-50",onClick:b,children:[_&&(0,t.jsx)(U.default,{size:12}),l("submitAnswer")]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:l("submitAnswerHint")})]})]})},em=(0,n.memo)(e=>{let{entry:i,sessionName:a,tabId:r,agentSessionId:o}=e,l=(0,s.useTranslations)("timeline"),[c,d]=(0,n.useState)(null),u="success"===i.status,m=i.questions[0];if("compose"===i.answerMode)return(0,t.jsx)(eu,{entry:i,tabId:r,agentSessionId:o},`${o}:${i.toolUseId}`);if(!m)return null;let _=!u&&null===c&&!!a,p=async e=>{!_||(d(e),await ed(a,e)||(d(null),Y.toast.error(l("selectionFailed"))))};return(0,t.jsx)("div",{className:"animate-in fade-in duration-150",children:(0,t.jsxs)("div",{className:es,children:[(0,t.jsx)(el,{header:m.header,children:m.question}),(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:m.options.map((e,n)=>{let a=u?i.answer===e.label:c===n,r=c===n&&!u,s=(u||null!==c)&&!a;return(0,t.jsx)("button",{type:"button",disabled:!_,onClick:()=>p(n),className:eo(a,s,_),children:(0,t.jsx)(ec,{option:e,index:n,selected:a,pending:r})},n)})})]})})});e.s(["default",0,em],865013);var e_=e.i(444957),ep=e.i(798458),eg=e.i(909725);let ef=e=>{let{status:n}=e;return"completed"===n?(0,t.jsx)(Z.CheckCircle2,{size:14,className:"text-positive"}):"in_progress"===n?(0,t.jsx)("span",{className:"flex h-[14px] w-[14px] items-center justify-center",children:(0,t.jsx)("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-claude-active"})}):(0,t.jsx)("span",{className:"h-[14px] w-[14px] rounded-full border border-muted-foreground/40"})};e.s(["default",0,e=>{let{tasks:i,cliState:r}=e,o=(0,s.useTranslations)("timeline"),l=(0,s.useTranslations)("common"),c=i.filter(e=>"completed"===e.status).length,d=i.length>0&&c===i.length,u=i.some(e=>"in_progress"===e.status),[m,_]=(0,n.useState)(d),[p,g]=(0,n.useState)(!1),[f,h]=(0,n.useState)(i);i!==f&&((i.length!==f.length||i.some((e,t)=>f[t]?.status!==e.status))&&m&&_(!1),h(i)),(0,n.useEffect)(()=>{if(!d||"idle"!==r)return;let e=setTimeout(()=>_(!0),3e3);return()=>clearTimeout(e)},[d,r]);let E=m?i.find(e=>"in_progress"===e.status)?.subject??i.findLast(e=>"pending"===e.status)?.subject:void 0,S=d?"border-positive":u?"border-claude-active":"border-muted-foreground/40";return p?null:(0,t.jsxs)("div",{className:(0,a.cn)("sticky top-0 z-10 mx-4 mb-2 border-l-2 bg-muted/80 px-4 py-2","animate-in fade-in slide-in-from-top-1 duration-200",S),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("button",{type:"button",className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2",onClick:()=>_(e=>!e),"aria-expanded":!m,"aria-controls":"task-list",children:[d?(0,t.jsx)(Z.CheckCircle2,{size:14,className:"shrink-0 text-positive"}):(0,t.jsx)(ep.ListChecks,{size:14,className:"shrink-0 text-claude-active"}),(0,t.jsxs)("span",{className:"text-xs leading-none font-medium tabular-nums","aria-live":"polite",children:["TASK ",c," / ",i.length]}),m&&E&&(0,t.jsx)("span",{className:"ml-1 min-w-0 flex-1 truncate text-left text-xs text-muted-foreground",children:E}),(0,t.jsx)(e_.ChevronDown,{size:14,className:(0,a.cn)("shrink-0 text-muted-foreground transition-transform duration-200",m&&"-rotate-90")})]}),(0,t.jsx)("button",{type:"button",className:"flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center self-start rounded-sm text-muted-foreground hover:text-foreground",onClick:()=>g(!0),"aria-label":l("close"),children:(0,t.jsx)(eg.X,{size:12})})]}),(0,t.jsx)("div",{className:(0,a.cn)("grid transition-[grid-template-rows] duration-200",m?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:(0,t.jsx)("div",{className:"overflow-hidden",children:(0,t.jsx)("div",{id:"task-list",role:"list","aria-label":o("taskProgress"),className:"mt-1.5 max-h-[240px] overflow-y-auto",style:{scrollbarWidth:"thin"},children:i.map(e=>(0,t.jsxs)("div",{role:"listitem",className:"flex items-center gap-2 py-0.5",children:[(0,t.jsx)("span",{className:"flex h-[14px] w-[14px] shrink-0 items-center justify-center",children:(0,t.jsx)(ef,{status:e.status})}),(0,t.jsx)("span",{className:(0,a.cn)("min-w-0 truncate text-xs","completed"===e.status&&"text-muted-foreground line-through","in_progress"===e.status&&"font-medium text-foreground","pending"===e.status&&"text-muted-foreground"),children:e.subject})]},e.taskId))})})})]})}],815226);let eh=e=>{let{status:n}=e;return"completed"===n?(0,t.jsx)(Z.CheckCircle2,{size:12,className:"text-positive"}):"in_progress"===n?(0,t.jsx)("span",{className:"flex h-3 w-3 items-center justify-center",children:(0,t.jsx)("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-claude-active"})}):(0,t.jsx)("span",{className:"h-3 w-3 rounded-full border border-muted-foreground/40"})},eE=(0,n.memo)(e=>{let{entry:n}=e;if("replace"===n.action)return(0,t.jsx)("div",{className:"space-y-1 py-1",children:n.tasks?.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"mt-0.5 shrink-0",children:(0,t.jsx)(eh,{status:e.status})}),(0,t.jsx)("span",{children:e.subject})]},e.taskId))});let i="create"===n.action?n.subject:`Task ${n.taskId} \u2192 ${n.status}`;return(0,t.jsxs)("div",{className:"flex items-center gap-1.5 py-1",children:[(0,t.jsx)(eh,{status:n.status}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:i})]})});e.s(["default",0,eE],864852)},801230,601726,954996,42054,44158,333711,427285,835591,137073,e=>{"use strict";let t,n,i,a;var r,s=e.i(391398),o=e.i(853560),l=e.i(939310);e.s(["default",0,e=>{let{visible:t,onClick:n}=e;return t?(0,s.jsx)("div",{className:"absolute bottom-4 left-1/2 z-10 -translate-x-1/2",children:(0,s.jsx)(l.Button,{variant:"outline",size:"icon",className:"h-8 w-8 rounded-full",onClick:n,children:(0,s.jsx)(o.ArrowDown,{size:14})})}):null}],801230);var c=e.i(191788),d=e.i(350461);let u=(0,c.createContext)({});function m(e){let t=(0,c.useRef)(null);return null===t.current&&(t.current=e()),t.current}let _="u">typeof window?c.useLayoutEffect:c.useEffect,p=(0,c.createContext)(null);function g(e){return"object"==typeof e&&null!==e}function f(e){return g(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}var h=c;let E=(0,c.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function S(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class b extends h.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(f(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){let e=t.offsetParent,n=f(e)&&e.offsetWidth||0,i=f(e)&&e.offsetHeight||0,a=getComputedStyle(t),r=this.props.sizeRef.current;r.height=parseFloat(a.height),r.width=parseFloat(a.width),r.top=t.offsetTop,r.left=t.offsetLeft,r.right=n-r.width-r.left,r.bottom=i-r.height-r.top}return null}componentDidUpdate(){}render(){return this.props.children}}function v(e){let{children:t,isPresent:n,anchorX:i,anchorY:a,root:r,pop:o}=e,l=(0,h.useId)(),d=(0,h.useRef)(null),u=(0,h.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:m}=(0,h.useContext)(E),_=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useCallback(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{let n=!1,i=t.map(t=>{let i=S(t,e);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let e=0;e<i.length;e++){let n=i[e];"function"==typeof n?n():S(t[e],null)}}}}(...t),t)}(d,t.props?.ref??t?.ref);return(0,h.useInsertionEffect)(()=>{let{width:e,height:t,top:s,left:c,right:_,bottom:p}=u.current;if(n||!1===o||!d.current||!e||!t)return;let g="left"===i?`left: ${c}`:`right: ${_}`,f="bottom"===a?`bottom: ${p}`:`top: ${s}`;d.current.dataset.motionPopId=l;let h=document.createElement("style");m&&(h.nonce=m);let E=r??document.head;return E.appendChild(h),h.sheet&&h.sheet.insertRule(`
|
|
21
21
|
[data-motion-pop-id="${l}"] {
|
|
22
22
|
position: absolute !important;
|
|
23
23
|
width: ${e}px !important;
|
|
@@ -25,7 +25,7 @@ ${t[n].trim()}`).join("\n\n"),"resolveAsyncQuestionAnswers",0,n],701412);var i=e
|
|
|
25
25
|
${g}px !important;
|
|
26
26
|
${f}px !important;
|
|
27
27
|
}
|
|
28
|
-
`),()=>{d.current?.removeAttribute("data-motion-pop-id"),E.contains(h)&&E.removeChild(h)}},[n]),(0,s.jsx)(b,{isPresent:n,childRef:d,sizeRef:u,pop:o,children:!1===o?t:h.cloneElement(t,{ref:_})})}let T=e=>{let{children:t,initial:n,isPresent:i,onExitComplete:a,custom:r,presenceAffectsLayout:o,mode:l,anchorX:d,anchorY:u,root:_}=e,g=m(y),f=(0,c.useId)(),h=!0,E=(0,c.useMemo)(()=>(h=!1,{id:f,initial:n,isPresent:i,custom:r,onExitComplete:e=>{for(let t of(g.set(e,!0),g.values()))if(!t)return;a&&a()},register:e=>(g.set(e,!1),()=>g.delete(e))}),[i,g,a]);return o&&h&&(E={...E}),(0,c.useMemo)(()=>{g.forEach((e,t)=>g.set(t,!1))},[i]),c.useEffect(()=>{i||g.size||!a||a()},[i]),t=(0,s.jsx)(v,{pop:"popLayout"===l,isPresent:i,anchorX:d,anchorY:u,root:_,children:t}),(0,s.jsx)(p.Provider,{value:E,children:t})};function y(){return new Map}function C(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=(0,c.useContext)(p);if(null===t)return[!0,null];let{isPresent:n,onExitComplete:i,register:a}=t,r=(0,c.useId)();(0,c.useEffect)(()=>{if(e)return a(r)},[e]);let s=(0,c.useCallback)(()=>e&&i&&i(r),[r,i,e]);return!n&&i?[!1,s]:[!0]}let N=e=>e.key||"";function x(e){let t=[];return c.Children.forEach(e,e=>{(0,c.isValidElement)(e)&&t.push(e)}),t}let R=e=>{let{children:t,custom:n,initial:i=!0,onExitComplete:a,presenceAffectsLayout:r=!0,mode:o="sync",propagate:l=!1,anchorX:d="left",anchorY:p="top",root:g}=e,[f,h]=C(l),E=(0,c.useMemo)(()=>x(t),[t]),S=l&&!f?[]:E.map(N),b=(0,c.useRef)(!0),v=(0,c.useRef)(E),y=m(()=>new Map),R=(0,c.useRef)(new Set),[O,I]=(0,c.useState)(E),[A,w]=(0,c.useState)(E);_(()=>{b.current=!1,v.current=E;for(let e=0;e<A.length;e++){let t=N(A[e]);S.includes(t)?(y.delete(t),R.current.delete(t)):!0!==y.get(t)&&y.set(t,!1)}},[A,S.length,S.join("-")]);let D=[];if(E!==O){let e=[...E];for(let t=0;t<A.length;t++){let n=A[t],i=N(n);S.includes(i)||(e.splice(t,0,n),D.push(n))}return"wait"===o&&D.length&&(e=D),w(x(e)),I(E),null}let{forceRender:L}=(0,c.useContext)(u);return(0,s.jsx)(s.Fragment,{children:A.map(e=>{let t=N(e),c=(!l||!!f)&&(E===A||S.includes(t));return(0,s.jsx)(T,{isPresent:c,initial:(!b.current||!!i)&&void 0,custom:n,presenceAffectsLayout:r,mode:o,root:g,onExitComplete:c?void 0:()=>{if(R.current.has(t)||!y.has(t))return;R.current.add(t),y.set(t,!0);let e=!0;y.forEach(t=>{t||(e=!1)}),e&&(L?.(),w(v.current),l&&h?.(),a&&a())},anchorX:d,anchorY:p,children:e},t)})})},O=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],I=new Set(O),A=(e,t,n)=>n>t?t:n<e?e:n,w={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},D={...w,transform:e=>A(0,1,e)},L={...w,default:1},M=e=>Math.round(1e5*e)/1e5,k=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,P=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,F=(e,t)=>n=>!!("string"==typeof n&&P.test(n)&&n.startsWith(e)||t&&null!=n&&Object.prototype.hasOwnProperty.call(n,t)),U=(e,t,n)=>i=>{if("string"!=typeof i)return i;let[a,r,s,o]=i.match(k);return{[e]:parseFloat(a),[t]:parseFloat(r),[n]:parseFloat(s),alpha:void 0!==o?parseFloat(o):1}},B={...w,transform:e=>Math.round(A(0,255,e))},G={test:F("rgb","red"),parse:U("red","green","blue"),transform:e=>{let{red:t,green:n,blue:i,alpha:a=1}=e;return"rgba("+B.transform(t)+", "+B.transform(n)+", "+B.transform(i)+", "+M(D.transform(a))+")"}},j={test:F("#"),parse:function(e){let t="",n="",i="",a="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),a=e.substring(4,5),t+=t,n+=n,i+=i,a+=a),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:a?parseInt(a,16)/255:1}},transform:G.transform},Y=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),H=Y("deg"),V=Y("%"),$=Y("px"),z=Y("vh"),q=Y("vw"),W={...V,parse:e=>V.parse(e)/100,transform:e=>V.transform(100*e)},Q={test:F("hsl","hue"),parse:U("hue","saturation","lightness"),transform:e=>{let{hue:t,saturation:n,lightness:i,alpha:a=1}=e;return"hsla("+Math.round(t)+", "+V.transform(M(n))+", "+V.transform(M(i))+", "+M(D.transform(a))+")"}},K={test:e=>G.test(e)||j.test(e)||Q.test(e),parse:e=>G.test(e)?G.parse(e):Q.test(e)?Q.parse(e):j.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?G.transform(e):Q.transform(e),getAnimatableNone:e=>{let t=K.parse(e);return t.alpha=0,K.transform(t)}},X=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Z="number",J="color",ee=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function et(e){let t=e.toString(),n=[],i={color:[],number:[],var:[]},a=[],r=0,s=t.replace(ee,e=>(K.test(e)?(i.color.push(r),a.push(J),n.push(K.parse(e))):e.startsWith("var(")?(i.var.push(r),a.push("var"),n.push(e)):(i.number.push(r),a.push(Z),n.push(parseFloat(e))),++r,"${}")).split("${}");return{values:n,split:s,indexes:i,types:a}}function en(e){let{split:t,types:n}=e,i=t.length;return e=>{let a="";for(let r=0;r<i;r++)if(a+=t[r],void 0!==e[r]){let t=n[r];t===Z?a+=M(e[r]):t===J?a+=K.transform(e[r]):a+=e[r]}return a}}let ei={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(k)?.length||0)+(e.match(X)?.length||0)>0},parse:function(e){return et(e).values},createTransformer:function(e){return en(et(e))},getAnimatableNone:function(e){let t=et(e);return en(t)(t.values.map((e,n)=>((e,t)=>"number"==typeof e?t?.trim().endsWith("/")?e:0:"number"==typeof e?0:K.test(e)?K.getAnimatableNone(e):e)(e,t.split[n])))}},ea=new Set(["brightness","contrast","saturate","opacity"]);function er(e){let[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[i]=n.match(k)||[];if(!i)return e;let a=n.replace(i,""),r=+!!ea.has(t);return i!==n&&(r*=100),t+"("+r+a+")"}let es=/\b([a-z-]*)\(.*?\)/gu,eo={...ei,getAnimatableNone:e=>{let t=e.match(es);return t?t.map(er).join(" "):e}},el={...ei,getAnimatableNone:e=>{let t=ei.parse(e);return ei.createTransformer(e)(t.map(e=>"number"==typeof e?0:"object"==typeof e?{...e,alpha:1}:e))}},ec={...w,transform:Math.round},ed={borderWidth:$,borderTopWidth:$,borderRightWidth:$,borderBottomWidth:$,borderLeftWidth:$,borderRadius:$,borderTopLeftRadius:$,borderTopRightRadius:$,borderBottomRightRadius:$,borderBottomLeftRadius:$,width:$,maxWidth:$,height:$,maxHeight:$,top:$,right:$,bottom:$,left:$,inset:$,insetBlock:$,insetBlockStart:$,insetBlockEnd:$,insetInline:$,insetInlineStart:$,insetInlineEnd:$,padding:$,paddingTop:$,paddingRight:$,paddingBottom:$,paddingLeft:$,paddingBlock:$,paddingBlockStart:$,paddingBlockEnd:$,paddingInline:$,paddingInlineStart:$,paddingInlineEnd:$,margin:$,marginTop:$,marginRight:$,marginBottom:$,marginLeft:$,marginBlock:$,marginBlockStart:$,marginBlockEnd:$,marginInline:$,marginInlineStart:$,marginInlineEnd:$,fontSize:$,backgroundPositionX:$,backgroundPositionY:$,rotate:H,rotateX:H,rotateY:H,rotateZ:H,scale:L,scaleX:L,scaleY:L,scaleZ:L,skew:H,skewX:H,skewY:H,distance:$,translateX:$,translateY:$,translateZ:$,x:$,y:$,z:$,perspective:$,transformPerspective:$,opacity:D,originX:W,originY:W,originZ:$,zIndex:ec,fillOpacity:D,strokeOpacity:D,numOctaves:ec},eu={...ed,color:K,backgroundColor:K,outlineColor:K,fill:K,stroke:K,borderColor:K,borderTopColor:K,borderRightColor:K,borderBottomColor:K,borderLeftColor:K,filter:eo,WebkitFilter:eo,mask:el,WebkitMask:el},em=e=>eu[e],e_=()=>({translate:0,scale:1,origin:0,originPoint:0}),ep=()=>({x:e_(),y:e_()}),eg=()=>({min:0,max:0}),ef=()=>({x:eg(),y:eg()}),eh=e=>!!(e&&e.getVelocity),eE=new Set(["width","height","top","left","right","bottom",...O]),eS=e=>t=>t.test(e),eb=[w,$,V,H,q,z,{test:e=>"auto"===e,parse:e=>e}],ev=e=>eb.find(eS(e)),eT=()=>{},ey=()=>{};d.default;let eC=e=>t=>"string"==typeof t&&t.startsWith(e),eN=eC("--"),ex=eC("var(--"),eR=e=>!!ex(e)&&eO.test(e.split("/*")[0].trim()),eO=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function eI(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}let eA=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,ew=e=>180*e/Math.PI,eD=e=>eM(ew(Math.atan2(e[1],e[0]))),eL={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:eD,rotateZ:eD,skewX:e=>ew(Math.atan(e[1])),skewY:e=>ew(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},eM=e=>((e%=360)<0&&(e+=360),e),ek=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),eP=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),eF={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ek,scaleY:eP,scale:e=>(ek(e)+eP(e))/2,rotateX:e=>eM(ew(Math.atan2(e[6],e[5]))),rotateY:e=>eM(ew(Math.atan2(-e[2],e[0]))),rotateZ:eD,rotate:eD,skewX:e=>ew(Math.atan(e[4])),skewY:e=>ew(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function eU(e){return+!!e.includes("scale")}function eB(e,t){let n,i;if(!e||"none"===e)return eU(t);let a=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(a)n=eF,i=a;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=eL,i=t}if(!i)return eU(t);let r=n[t],s=i[1].split(",").map(eG);return"function"==typeof r?r(s):s[r]}function eG(e){return parseFloat(e.trim())}let ej=e=>e===w||e===$,eY=new Set(["x","y","z"]),eH=O.filter(e=>!eY.has(e)),eV={width:(e,t)=>{let{x:n}=e,{paddingLeft:i="0",paddingRight:a="0",boxSizing:r}=t,s=n.max-n.min;return"border-box"===r?s:s-parseFloat(i)-parseFloat(a)},height:(e,t)=>{let{y:n}=e,{paddingTop:i="0",paddingBottom:a="0",boxSizing:r}=t,s=n.max-n.min;return"border-box"===r?s:s-parseFloat(i)-parseFloat(a)},top:(e,t)=>{let{top:n}=t;return parseFloat(n)},left:(e,t)=>{let{left:n}=t;return parseFloat(n)},bottom:(e,t)=>{let{y:n}=e,{top:i}=t;return parseFloat(i)+(n.max-n.min)},right:(e,t)=>{let{x:n}=e,{left:i}=t;return parseFloat(i)+(n.max-n.min)},x:(e,t)=>{let{transform:n}=t;return eB(n,"x")},y:(e,t)=>{let{transform:n}=t;return eB(n,"y")}};eV.translateX=eV.x,eV.translateY=eV.y;let e$=e=>e,ez={},eq=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function eW(e,t){let n=!1,i=!0,a={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,s=eq.reduce((e,n)=>(e[n]=function(e,t){let n=new Set,i=new Set,a=!1,r=!1,s=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1},l=0;function c(t){s.has(t)&&(d.schedule(t),e()),l++,t(o)}let d={schedule:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=r&&a?n:i;return t&&s.add(e),o.add(e),e},cancel:e=>{i.delete(e),s.delete(e)},process:e=>{if(o=e,a){r=!0;return}a=!0;let s=n;n=i,i=s,n.forEach(c),t,l=0,n.clear(),a=!1,r&&(r=!1,d.process(e))}};return d}(r,t?n:void 0),e),{}),{setup:o,read:l,resolveKeyframes:c,preUpdate:d,update:u,preRender:m,render:_,postRender:p}=s,g=()=>{let r=ez.useManualTiming,s=r?a.timestamp:performance.now();n=!1,r||(a.delta=i?1e3/60:Math.max(Math.min(s-a.timestamp,40),1)),a.timestamp=s,a.isProcessing=!0,o.process(a),l.process(a),c.process(a),d.process(a),u.process(a),m.process(a),_.process(a),p.process(a),a.isProcessing=!1,n&&t&&(i=!1,e(g))};return{schedule:eq.reduce((t,r)=>{let o=s[r];return t[r]=function(t){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!n&&(n=!0,i=!0,a.isProcessing||e(g)),o.schedule(t,r,s)},t},{}),cancel:e=>{for(let t=0;t<eq.length;t++)s[eq[t]].cancel(e)},state:a,steps:s}}let{schedule:eQ,cancel:eK,state:eX,steps:eZ}=eW("u">typeof requestAnimationFrame?requestAnimationFrame:e$,!0),eJ=new Set,e0=!1,e1=!1,e2=!1;function e3(){if(e1){let e=Array.from(eJ).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t,i=(t=[],eH.forEach(n=>{let i=e.getValue(n);void 0!==i&&(t.push([n,i.get()]),i.set(+!!n.startsWith("scale")))}),t);i.length&&(n.set(e,i),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(t=>{let[n,i]=t;e.getValue(n)?.set(i)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}e1=!1,e0=!1,eJ.forEach(e=>e.complete(e2)),eJ.clear()}function e5(){eJ.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(e1=!0)})}class e4{constructor(e,t,n,i,a,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=i,this.element=a,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(eJ.add(this),e0||(e0=!0,eQ.read(e5),eQ.resolveKeyframes(e3))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:i}=this;if(null===e[0]){let a=i?.get(),r=e[e.length-1];if(void 0!==a)e[0]=a;else if(n&&t){let i=n.readValue(t,r);null!=i&&(e[0]=i)}void 0===e[0]&&(e[0]=r),i&&void 0===a&&i.set(e[0])}for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),eJ.delete(this)}cancel(){"scheduled"===this.state&&(eJ.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}let e9=new Set([eo,el]);function e6(e,t){let n=em(e);return e9.has(n)||(n=ei),n.getAnimatableNone?n.getAnimatableNone(t):void 0}let e7=new Set(["auto","none","0"]);class e8 extends e4{constructor(e,t,n,i,a){super(e,t,n,i,a,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let i=e[n];if("string"==typeof i&&eR(i=i.trim())){let a=function e(t,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;ey(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[a,r]=function(e){let t=eA.exec(e);if(!t)return[,];let[,n,i,a]=t;return[`--${n??i}`,a]}(t);if(!a)return;let s=window.getComputedStyle(n).getPropertyValue(a);if(s){let e=s.trim();return/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e)?parseFloat(e):e}return eR(r)?e(r,n,i+1):r}(i,t.current);void 0!==a&&(e[n]=a),n===e.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!eE.has(n)||2!==e.length)return;let[i,a]=e,r=ev(i),s=ev(a);if(eI(i)!==eI(a)&&eV[n]){this.needsMeasurement=!0;return}if(r!==s)if(ej(r)&&ej(s))for(let t=0;t<e.length;t++){let n=e[t];"string"==typeof n&&(e[t]=parseFloat(n))}else eV[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(null===e[t]||function(e){if("number"==typeof e)return 0===e;if(null===e)return!0;return"none"===e||"0"===e||/^0[^.\s]+$/u.test(e)}(e[t]))&&n.push(t);n.length&&function(e,t,n){let i,a=0;for(;a<e.length&&!i;){let t=e[a];"string"==typeof t&&!e7.has(t)&&et(t).values.length&&(i=e[a]),a++}if(i&&n)for(let a of t)e[a]=e6(n,i)}(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=eV[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let i=t[t.length-1];void 0!==i&&e.getValue(n,i).jump(i,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let i=e.getValue(t);i&&i.jump(this.measuredOrigin,!1);let a=n.length-1,r=n[a];n[a]=eV[t](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(t=>{let[n,i]=t;e.getValue(n).set(i)}),this.resolveNoneKeyframes()}}let te=e=>1e3*e;function tt(e,t){-1===e.indexOf(t)&&e.push(t)}function tn(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}class ti{constructor(){this.subscriptions=[]}add(e){return tt(this.subscriptions,e),()=>tn(this.subscriptions,e)}notify(e,t,n){let i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](e,t,n);else for(let a=0;a<i;a++){let i=this.subscriptions[a];i&&i(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function ta(e,t,n){t.startsWith("--")?e.style.setProperty(t,n):e.style[t]=n}function tr(e){let t;return()=>(void 0===t&&(t=e()),t)}let ts={};function to(e,t){let n=tr(e);return()=>ts[t]??n()}let tl=to(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),tc=e=>null!==e;function td(e,t,n){let{repeat:i,repeatType:a="loop"}=t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=e.filter(tc),o=r<0||i&&"loop"!==a&&i%2==1?0:s.length-1;return o&&void 0!==n?n:s[o]}class tu{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}let tm={layout:0,mainThread:0,waapi:0},t_=e=>Array.isArray(e)&&"number"==typeof e[0],tp=to(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),tg=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,i="",a=Math.max(Math.round(t/n),2);for(let t=0;t<a;t++)i+=Math.round(1e4*e(t/(a-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},tf=e=>{let[t,n,i,a]=e;return`cubic-bezier(${t}, ${n}, ${i}, ${a})`},th={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:tf([0,.65,.55,1]),circOut:tf([.55,0,1,.45]),backIn:tf([.31,.01,.66,-.59]),backOut:tf([.33,1.53,.69,.99])};function tE(e){return"function"==typeof e&&"applyToOptions"in e}class tS extends tu{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:n,keyframes:i,pseudoElement:a,allowFlatten:r=!1,finalKeyframe:s,onComplete:o}=e;this.isPseudoElement=!!a,this.allowFlatten=r,this.options=e,ey("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function(e){let{type:t,...n}=e;return tE(t)&&tp()?t.applyToOptions(n):(n.duration??(n.duration=300),n.ease??(n.ease="easeOut"),n)}(e);this.animation=function(e,t,n){let{delay:i=0,duration:a=300,repeat:r=0,repeatType:s="loop",ease:o="easeOut",times:l}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,d={[t]:n};l&&(d.offset=l);let u=function e(t,n){if(t)return"function"==typeof t?tp()?tg(t,n):"ease-out":t_(t)?tf(t):Array.isArray(t)?t.map(t=>e(t,n)||th.easeOut):th[t]}(o,a);Array.isArray(u)&&(d.easing=u);let m={delay:i,duration:a,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:"reverse"===s?"alternate":"normal"};c&&(m.pseudoElement=c);let _=e.animate(d,m);return _}(t,n,i,l,a),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){let e=td(i,this.options,s,this.speed);this.updateMotionValue&&this.updateMotionValue(e),ta(t,n,e),this.animation.cancel()}o?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){return Number(this.animation.effect?.getComputedTiming?.().duration||0)/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return(Number(this.animation.currentTime)||0)/1e3}set time(e){let t=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=te(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline(e){let{timeline:t,rangeStart:n,rangeEnd:i,observe:a}=e;return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&tl())?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),e$):a(this)}}let tb=new Set(["opacity","clipPath","filter","transform"]),{schedule:tv}=eW(queueMicrotask,!1);function tT(){t=void 0}let ty={now:()=>(void 0===t&&ty.set(eX.isProcessing||ez.useManualTiming?eX.timestamp:performance.now()),t),set:e=>{t=e,queueMicrotask(tT)}};class tC{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=ty.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=ty.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.current;this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new ti);let n=this.events[e].add(t);return"change"===e?()=>{n(),eQ.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return a&&a.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var e;let t=ty.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;let n=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e=parseFloat(this.current)-parseFloat(this.prevFrameValue),n?1e3/n*e:0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function tN(e,t){return new tC(e,t)}let tx=[...eb,K,ei],tR=new WeakMap;function tO(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function tI(e){return"string"==typeof e||Array.isArray(e)}let tA=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],tw=["initial",...tA];function tD(e){return tO(e.animate)||tw.some(t=>tI(e[t]))}function tL(e){return!!(tD(e)||e.variants)}let tM={current:null},tk={current:!1},tP="u">typeof window;function tF(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function tU(e,t,n,i){if("function"==typeof t){let[a,r]=tF(i);t=t(void 0!==n?n:e.custom,a,r)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){let[a,r]=tF(i);t=t(void 0!==n?n:e.custom,a,r)}return t}let tB=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],tG={};class tj{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:r,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=e4,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=ty.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,eQ.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=t.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=o,this.blockInitialAnimation=!!r,this.isControllingVariants=tD(t),this.isVariantNode=tL(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==l[e]&&eh(t)&&t.set(l[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,tR.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(tk.current||function(){if(tk.current=!0,tP)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>tM.current=e.matches;e.addEventListener("change",t),t()}else tM.current=!1}(),this.shouldReduceMotion=tM.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){for(let e in this.projection&&this.projection.unmount(),eK(this.notifyUpdate),eK(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){let n;if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&tb.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:i,times:a,ease:r,duration:s}=t.accelerate,o=new tS({element:this.current,name:e,keyframes:i,times:a,ease:r,duration:te(s)}),l=n(o);this.valueSubscriptions.set(e,()=>{l(),o.cancel()});return}let i=I.has(e);i&&this.onBindTransform&&this.onBindTransform();let a=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&eQ.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});"u">typeof window&&window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{a(),n&&n(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in tG){let t=tG[e];if(!t)continue;let{isEnabled:n,Feature:i}=t;if(!this.features[e]&&i&&n(this.props)&&(this.features[e]=new i(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ef()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<tB.length;t++){let n=tB[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let i=e["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(e,t,n){for(let i in t){let a=t[i],r=n[i];if(eh(a))e.addValue(i,a);else if(eh(r))e.addValue(i,tN(a,{owner:e}));else if(r!==a)if(e.hasValue(i)){let t=e.getValue(i);!0===t.liveStyle?t.jump(a):t.hasAnimated||t.set(a)}else{let t=e.getStaticValue(i);e.addValue(i,tN(void 0!==t?t:a,{owner:e}))}}for(let i in n)void 0===t[i]&&e.removeValue(i);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=tN(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];if(null!=n){let i,a;if("string"==typeof n&&(i=n,/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(i)||(a=n,/^0[^.\s]+$/u.test(a))))n=parseFloat(n);else{let i;i=n,!tx.find(eS(i))&&ei.test(t)&&(n=e6(e,t))}this.setBaseTarget(e,eh(n)?n.get():n)}return eh(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let t,{initial:n}=this.props;if("string"==typeof n||"object"==typeof n){let i=tU(this.props,n,this.presenceContext?.custom);i&&(t=i[e])}if(n&&void 0!==t)return t;let i=this.getBaseTargetFromProps(this.props,e);return void 0===i||eh(i)?void 0!==this.initialValues[e]&&void 0===t?void 0:this.baseTarget[e]:i}on(e,t){return this.events[e]||(this.events[e]=new ti),this.events[e].add(t)}notify(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){tv.render(this.render)}}class tY extends tj{constructor(){super(...arguments),this.KeyframeResolver=e8}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,t){let{vars:n,style:i}=t;delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;eh(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}function tH(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}let tV=(e,t)=>t&&"number"==typeof e?t.transform(e):e,t$={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tz=O.length;function tq(e,t,n){let{style:i,vars:a,transformOrigin:r}=e,s=!1,o=!1;for(let e in t){let n=t[e];if(I.has(e)){s=!0;continue}if(eN(e)){a[e]=n;continue}{let t=tV(n,ed[e]);e.startsWith("origin")?(o=!0,r[e]=t):i[e]=t}}if(!t.transform&&(s||n?i.transform=function(e,t,n){let i="",a=!0;for(let r=0;r<tz;r++){let s=O[r],o=e[s];if(void 0===o)continue;let l=!0;if("number"==typeof o)l=o===+!!s.startsWith("scale");else{let e=parseFloat(o);l=s.startsWith("scale")?1===e:0===e}if(!l||n){let e=tV(o,ed[s]);if(!l){a=!1;let t=t$[s]||s;i+=`${t}(${e}) `}n&&(t[s]=e)}}return i=i.trim(),n?i=n(t,a?"":i):a&&(i="none"),i}(t,e.transform,n):i.transform&&(i.transform="none")),o){let{originX:e="50%",originY:t="50%",originZ:n=0}=r;i.transformOrigin=`${e} ${t} ${n}`}}let tW={offset:"stroke-dashoffset",array:"stroke-dasharray"},tQ={offset:"strokeDashoffset",array:"strokeDasharray"},tK=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function tX(e,t,n,i,a){let{attrX:r,attrY:s,attrScale:o,pathLength:l,pathSpacing:c=1,pathOffset:d=0,...u}=t;if(tq(e,u,i),n){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:m,style:_}=e;for(let e of(m.transform&&(_.transform=m.transform,delete m.transform),(_.transform||m.transformOrigin)&&(_.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),_.transform&&(_.transformBox=a?.transformBox??"fill-box",delete m.transformBox),tK))void 0!==m[e]&&(_[e]=m[e],delete m[e]);void 0!==r&&(m.x=r),void 0!==s&&(m.y=s),void 0!==o&&(m.scale=o),void 0!==l&&function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=!(arguments.length>4)||void 0===arguments[4]||arguments[4];e.pathLength=1;let r=a?tW:tQ;e[r.offset]=`${-i}`,e[r.array]=`${t} ${n}`}(m,l,c,d,!1)}let tZ=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),tJ=e=>"string"==typeof e&&"svg"===e.toLowerCase();function t0(e,t,n,i){let a,{style:r,vars:s}=t,o=e.style;for(a in r)o[a]=r[a];for(a in i?.applyProjectionStyles(o,n),s)o.setProperty(a,s[a])}function t1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let t2={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e)if(!$.test(e))return e;else e=parseFloat(e);let n=t1(e,t.target.x),i=t1(e,t.target.y);return`${n}% ${i}%`}},t3=(e,t,n)=>e+(t-e)*n,t5={borderRadius:{...t2,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:t2,borderTopRightRadius:t2,borderBottomLeftRadius:t2,borderBottomRightRadius:t2,boxShadow:{correct:(e,t)=>{let{treeScale:n,projectionDelta:i}=t,a=ei.parse(e);if(a.length>5)return e;let r=ei.createTransformer(e),s=+("number"!=typeof a[0]),o=i.x.scale*n.x,l=i.y.scale*n.y;a[0+s]/=o,a[1+s]/=l;let c=t3(o,l,.5);return"number"==typeof a[2+s]&&(a[2+s]/=c),"number"==typeof a[3+s]&&(a[3+s]/=c),r(a)}}};function t4(e,t){let{layout:n,layoutId:i}=t;return I.has(e)||e.startsWith("origin")||(n||void 0!==i)&&(!!t5[e]||"opacity"===e)}function t9(e,t,n){let i=e.style,a=t?.style,r={};if(!i)return r;for(let t in i)(eh(i[t])||a&&eh(a[t])||t4(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(r[t]=i[t]);return r}function t6(e,t,n){let i=t9(e,t,n);for(let n in e)(eh(e[n])||eh(t[n]))&&(i[-1!==O.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return i}class t7 extends tY{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ef}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(I.has(t)){let e=em(t);return e&&e.default||0}return t=tZ.has(t)?t:tH(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return t6(e,t,n)}build(e,t,n){tX(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,i){for(let n in t0(e,t,void 0,i),t.attrs)e.setAttribute(tZ.has(n)?n:tH(n),t.attrs[n])}mount(e){this.isSVGTag=tJ(e.tagName),super.mount(e)}}function t8(e){let{top:t,left:n,right:i,bottom:a}=e;return{x:{min:n,max:i},y:{min:t,max:a}}}function ne(e){return void 0===e||1===e}function nt(e){let{scale:t,scaleX:n,scaleY:i}=e;return!ne(t)||!ne(n)||!ne(i)}function nn(e){return nt(e)||ni(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ni(e){var t,n;return(t=e.x)&&"0%"!==t||(n=e.y)&&"0%"!==n}function na(e,t,n,i,a){return void 0!==a&&(e=i+a*(e-i)),i+n*(e-i)+t}function nr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;e.min=na(e.min,t,n,i,a),e.max=na(e.max,t,n,i,a)}function ns(e,t){let{x:n,y:i}=t;nr(e.x,n.translate,n.scale,n.originPoint),nr(e.y,i.translate,i.scale,i.originPoint)}function no(e,t){e.min+=t,e.max+=t}function nl(e,t,n,i){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,r=t3(e.min,e.max,a);nr(e,t,n,r,i)}function nc(e,t){return"string"==typeof e?parseFloat(e)/100*(t.max-t.min):e}function nd(e,t,n){let i=n??e;nl(e.x,nc(t.x,i.x),t.scaleX,t.scale,t.originX),nl(e.y,nc(t.y,i.y),t.scaleY,t.scale,t.originY)}function nu(e,t){return t8(function(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(e.getBoundingClientRect(),t))}class nm extends tY{constructor(){super(...arguments),this.type="html",this.renderInstance=t0}readValueFromInstance(e,t){if(I.has(t))return this.projection?.isProjecting?eU(t):((e,t)=>{let{transform:n="none"}=getComputedStyle(e);return eB(n,t)})(e,t);{let n=window.getComputedStyle(e),i=(eN(t)?n.getPropertyValue(t):n[t])||0;return"string"==typeof i?i.trim():i}}measureInstanceViewportBox(e,t){let{transformPagePoint:n}=t;return nu(e,n)}build(e,t,n){tq(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return t9(e,t,n)}}let n_=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function np(e){if("string"!=typeof e||e.includes("-"));else if(n_.indexOf(e)>-1||/[A-Z]/u.test(e))return!0;return!1}let ng=(0,c.createContext)({strict:!1}),nf=(0,c.createContext)({});function nh(e){return Array.isArray(e)?e.join(" "):e}let nE=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function nS(e,t,n){for(let i in t)eh(t[i])||t4(i,n)||(e[i]=t[i])}let nb=()=>({...nE(),attrs:{}}),nv=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function nT(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||nv.has(e)}let ny=e=>!nT(e);try{r=(()=>{let e=Error("Cannot find module '@emotion/is-prop-valid'");throw e.code="MODULE_NOT_FOUND",e})().default,"function"==typeof r&&(ny=e=>e.startsWith("on")?!nT(e):r(e))}catch{}function nC(e){return eh(e)?e.get():e}let nN=e=>(t,n)=>{let i=(0,c.useContext)(nf),a=(0,c.useContext)(p),r=()=>(function(e,t,n,i){let{scrapeMotionValuesFromProps:a,createRenderState:r}=e;return{latestValues:function(e,t,n,i){let a={},r=i(e,{});for(let e in r)a[e]=nC(r[e]);let{initial:s,animate:o}=e,l=tD(e),c=tL(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===o&&(o=t.animate));let d=!!n&&!1===n.initial,u=(d=d||!1===s)?o:s;if(u&&"boolean"!=typeof u&&!tO(u)){let t=Array.isArray(u)?u:[u];for(let n=0;n<t.length;n++){let i=tU(e,t[n]);if(i){let{transitionEnd:e,transition:t,...n}=i;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=d?t.length-1:0;t=t[e]}null!==t&&(a[e]=t)}for(let t in e)a[t]=e[t]}}}return a}(t,n,i,a),renderState:r()}})(e,t,i,a);return n?r():m(r)},nx=nN({scrapeMotionValuesFromProps:t9,createRenderState:nE}),nR=nN({scrapeMotionValuesFromProps:t6,createRenderState:nb}),nO={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},nI=!1;function nA(){return!function(){if(nI)return;let e={};for(let t in nO)e[t]={isEnabled:e=>nO[t].some(t=>!!e[t])};tG=e,nI=!0}(),tG}let nw=Symbol.for("motionComponentSymbol"),nD="data-"+tH("framerAppearId"),nL=(0,c.createContext)({});function nM(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function nk(e){let{forwardMotionProps:t=!1,type:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;i&&function(e){let t=nA();for(let n in e)t[n]={...t[n],...e[n]};tG=t}(i);let r=n?"svg"===n:np(e),o=r?nR:nx;function l(n,i){var l;let d,m,g,f={...(0,c.useContext)(E),...n,layoutId:function(e){let{layoutId:t}=e,n=(0,c.useContext)(u).id;return n&&void 0!==t?n+"-"+t:t}(n)},{isStatic:h}=f,S=function(e){let{initial:t,animate:n}=function(e,t){if(tD(e)){let{initial:t,animate:n}=e;return{initial:!1===t||tI(t)?t:void 0,animate:tI(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,c.useContext)(nf));return(0,c.useMemo)(()=>({initial:t,animate:n}),[nh(t),nh(n)])}(n),b=o(n,h);if(!h&&"u">typeof window){(0,c.useContext)(ng).strict;let t=function(e){let{drag:t,layout:n}=nA();if(!t&&!n)return{};let i={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(f);d=t.MeasureLayout,S.visualElement=function(e,t,n,i,a,r){let{visualElement:s}=(0,c.useContext)(nf),o=(0,c.useContext)(ng),l=(0,c.useContext)(p),d=(0,c.useContext)(E),u=d.reducedMotion,m=d.skipAnimations,g=(0,c.useRef)(null),f=(0,c.useRef)(!1);i=i||o.renderer,!g.current&&i&&(g.current=i(e,{visualState:t,parent:s,props:n,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u,skipAnimations:m,isSVG:r}),f.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));let h=g.current,S=(0,c.useContext)(nL);h&&!h.projection&&a&&("html"===h.type||"svg"===h.type)&&function(e,t,n,i){let{layoutId:a,layout:r,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:c,layoutAnchor:d,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:function e(t){if(t)return!1!==t.options.allowProjection?t.projection:e(t.parent)}(e.parent)),e.projection.setOptions({layoutId:a,layout:r,alwaysMeasureLayout:!!s||o&&nM(o),visualElement:e,animationType:"string"==typeof r?r:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:l,layoutRoot:c,layoutAnchor:d})}(g.current,n,a,S);let b=(0,c.useRef)(!1);(0,c.useInsertionEffect)(()=>{h&&b.current&&h.update(n,l)});let v=n[nD],T=(0,c.useRef)(!!v&&"u">typeof window&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return _(()=>{f.current=!0,h&&(b.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),T.current&&h.animationState&&h.animationState.animateChanges())}),(0,c.useEffect)(()=>{h&&(!T.current&&h.animationState&&h.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),T.current=!1),h.enteringChildren=void 0)}),h}(e,b,f,a,t.ProjectionNode,r)}return(0,s.jsxs)(nf.Provider,{value:S,children:[d&&S.visualElement?(0,s.jsx)(d,{visualElement:S.visualElement,...f}):null,function(e,t,n,i,a){let{latestValues:r}=i,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=arguments.length>6?arguments[6]:void 0,l=(o??np(e)?function(e,t,n,i){let a=(0,c.useMemo)(()=>{let n=nb();return tX(n,t,tJ(i),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};nS(t,e.style,e),a.style={...t,...a.style}}return a}:function(e,t){let n,i,a={},r=(n=e.style||{},nS(i={},n,e),Object.assign(i,function(e,t){let{transformTemplate:n}=e;return(0,c.useMemo)(()=>{let e=nE();return tq(e,t,n),Object.assign({},e.vars,e.style)},[t])}(e,t)),i);return e.drag&&!1!==e.dragListener&&(a.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":`pan-${"x"===e.drag?"y":"x"}`),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(a.tabIndex=0),a.style=r,a})(t,r,a,e),d=function(e,t,n){let i={};for(let a in e)("values"!==a||"object"!=typeof e.values)&&!eh(e[a])&&(ny(a)||!0===n&&nT(a)||!t&&!nT(a)||e.draggable&&a.startsWith("onDrag"))&&(i[a]=e[a]);return i}(t,"string"==typeof e,s),u=e!==c.Fragment?{...d,...l,ref:n}:{},{children:m}=t,_=(0,c.useMemo)(()=>eh(m)?m.get():m,[m]);return(0,c.createElement)(e,{...u,children:_})}(e,n,(l=S.visualElement,m=(0,c.useRef)(i),(0,c.useInsertionEffect)(()=>{m.current=i}),g=(0,c.useRef)(null),(0,c.useCallback)(e=>{e&&b.onMount?.(e);let t=m.current;if("function"==typeof t)if(e){let n=t(e);"function"==typeof n&&(g.current=n)}else g.current?(g.current(),g.current=null):t(e);else t&&(t.current=e);l&&(e?l.mount(e):l.unmount())},[l])),b,h,t,r)]})}l.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;let d=(0,c.forwardRef)(l);return d[nw]=e,d}class nP{constructor(e){this.isMounted=!1,this.node=e}update(){}}function nF(e,t,n){let i=e.getProps();return tU(i,t,void 0!==n?n:i.custom,e)}function nU(e,t){if(e?.inherit&&t){let{inherit:n,...i}=e;return{...t,...i}}return e}function nB(e,t){let n=e?.[t]??e?.default??e;return n!==e?nU(n,e):n}let nG=e=>Array.isArray(e);function nj(e,t){let n=e.getValue("willChange");if(eh(n)&&n.add)return n.add(t);if(!n&&ez.WillChange){let n=new ez.WillChange("auto");e.addValue("willChange",n),n.add(t)}}let nY=(e,t)=>n=>t(e(n)),nH=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(nY)};function nV(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function n$(e,t){return n=>n>0?t:e}let nz=(e,t,n)=>{let i=e*e,a=n*(t*t-i)+i;return a<0?0:Math.sqrt(a)},nq=[j,G,Q];function nW(e){let t=nq.find(t=>t.test(e));if(eT(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===Q&&(n=function(e){let{hue:t,saturation:n,lightness:i,alpha:a}=e;t/=360,i/=100;let r=0,s=0,o=0;if(n/=100){let e=i<.5?i*(1+n):i+n-i*n,a=2*i-e;r=nV(a,e,t+1/3),s=nV(a,e,t),o=nV(a,e,t-1/3)}else r=s=o=i;return{red:Math.round(255*r),green:Math.round(255*s),blue:Math.round(255*o),alpha:a}}(n)),n}let nQ=(e,t)=>{let n=nW(e),i=nW(t);if(!n||!i)return n$(e,t);let a={...n};return e=>(a.red=nz(n.red,i.red,e),a.green=nz(n.green,i.green,e),a.blue=nz(n.blue,i.blue,e),a.alpha=t3(n.alpha,i.alpha,e),G.transform(a))},nK=new Set(["none","hidden"]);function nX(e,t){return n=>t3(e,t,n)}function nZ(e){return"number"==typeof e?nX:"string"==typeof e?eR(e)?n$:K.test(e)?nQ:n1:Array.isArray(e)?nJ:"object"==typeof e?K.test(e)?nQ:n0:n$}function nJ(e,t){let n=[...e],i=n.length,a=e.map((e,n)=>nZ(e)(e,t[n]));return e=>{for(let t=0;t<i;t++)n[t]=a[t](e);return n}}function n0(e,t){let n={...e,...t},i={};for(let a in n)void 0!==e[a]&&void 0!==t[a]&&(i[a]=nZ(e[a])(e[a],t[a]));return e=>{for(let t in i)n[t]=i[t](e);return n}}let n1=(e,t)=>{let n=ei.createTransformer(t),i=et(e),a=et(t);if(!(i.indexes.var.length===a.indexes.var.length&&i.indexes.color.length===a.indexes.color.length&&i.indexes.number.length>=a.indexes.number.length))return eT(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),n$(e,t);if(nK.has(e)&&!a.values.length||nK.has(t)&&!i.values.length)return nK.has(e)?n=>n<=0?e:t:n=>n>=1?t:e;return nH(nJ(function(e,t){let n=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){let r=t.types[a],s=e.indexes[r][i[r]],o=e.values[s]??0;n[a]=o,i[r]++}return n}(i,a),a.values),n)};function n2(e,t,n){return"number"==typeof e&&"number"==typeof t&&"number"==typeof n?t3(e,t,n):nZ(e)(e,t)}let n3=e=>{let t=t=>{let{timestamp:n}=t;return e(n)};return{start:function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return eQ.update(t,e)},stop:()=>eK(t),now:()=>eX.isProcessing?eX.timestamp:ty.now()}};function n5(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}let n4=.01,n9=2,n6=.005,n7=.5;function n8(e,t){return e*Math.sqrt(1-t*t)}let ie=["duration","bounce"],it=["stiffness","damping","mass"];function ii(e,t){return t.some(t=>void 0!==e[t])}function ia(){let e,t,n,i,a,r,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.3,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.3,l="object"!=typeof s?{visualDuration:s,keyframes:[0,1],bounce:o}:s,{restSpeed:c,restDelta:d}=l,u=l.keyframes[0],m=l.keyframes[l.keyframes.length-1],_={done:!1,value:u},{stiffness:p,damping:g,mass:f,duration:h,velocity:E,isResolvedFromDuration:S}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!ii(e,it)&&ii(e,ie))if(t.velocity=0,e.visualDuration){let n=2*Math.PI/(1.2*e.visualDuration),i=n*n,a=2*A(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:1,stiffness:i,damping:a}}else{let n=function(e){let t,n,{duration:i=800,bounce:a=.3,velocity:r=0,mass:s=1}=e;eT(i<=te(10),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-a;o=A(.05,1,o),i=A(.01,10,i/1e3),o<1?(t=e=>{let t=e*o,n=t*i;return .001-(t-r)/n8(e,o)*Math.exp(-n)},n=e=>{let n=e*o*i,a=Math.pow(o,2)*Math.pow(e,2)*i,s=Math.exp(-n),l=n8(Math.pow(e,2),o);return(n*r+r-a)*s*(-t(e)+.001>0?-1:1)/l}):(t=e=>-.001+Math.exp(-e*i)*((e-r)*i+1),n=e=>i*i*(r-e)*Math.exp(-e*i));let l=function(e,t,n){let i=n;for(let n=1;n<12;n++)i-=e(i)/t(i);return i}(t,n,5/i);if(i=te(i),isNaN(l))return{stiffness:100,damping:10,duration:i};{let e=Math.pow(l,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:i}}}({...e,velocity:0});(t={...t,...n,mass:1}).isResolvedFromDuration=!0}return t}({...l,velocity:-((l.velocity||0)/1e3)}),b=E||0,v=g/(2*Math.sqrt(p*f)),T=m-u,y=Math.sqrt(p/f)/1e3,C=5>Math.abs(T);if(c||(c=C?n4:n9),d||(d=C?n6:n7),v<1)n=n8(y,v),i=(b+v*y*T)/n,e=e=>m-Math.exp(-v*y*e)*(i*Math.sin(n*e)+T*Math.cos(n*e)),a=v*y*i+T*n,r=v*y*T-i*n,t=e=>Math.exp(-v*y*e)*(a*Math.sin(n*e)+r*Math.cos(n*e));else if(1===v){e=e=>m-Math.exp(-y*e)*(T+(b+y*T)*e);let n=b+y*T;t=e=>Math.exp(-y*e)*(y*n*e-b)}else{let n=y*Math.sqrt(v*v-1);e=e=>{let t=Math.exp(-v*y*e),i=Math.min(n*e,300);return m-t*((b+v*y*T)*Math.sinh(i)+n*T*Math.cosh(i))/n};let i=(b+v*y*T)/n,a=v*y*i-T*n,r=v*y*T-i*n;t=e=>{let t=Math.exp(-v*y*e),i=Math.min(n*e,300);return t*(a*Math.sinh(i)+r*Math.cosh(i))}}let N={calculatedDuration:S&&h||null,velocity:e=>te(t(e)),next:s=>{if(!S&&v<1){let e=Math.exp(-v*y*s),t=Math.sin(n*s),o=Math.cos(n*s),l=m-e*(i*t+T*o);return _.done=Math.abs(te(e*(a*t+r*o)))<=c&&Math.abs(m-l)<=d,_.value=_.done?m:l,_}let o=e(s);return S?_.done=s>=h:_.done=Math.abs(te(t(s)))<=c&&Math.abs(m-o)<=d,_.value=_.done?m:o,_},toString:()=>{let e=Math.min(n5(N),2e4),t=tg(t=>N.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return N}function ir(e,t,n){var i,a;let r=Math.max(t-5,0);return i=n-e(r),(a=t-r)?1e3/a*i:0}function is(e){let t,n,{keyframes:i,velocity:a=0,power:r=.8,timeConstant:s=325,bounceDamping:o=10,bounceStiffness:l=500,modifyTarget:c,min:d,max:u,restDelta:m=.5,restSpeed:_}=e,p=i[0],g={done:!1,value:p},f=r*a,h=p+f,E=void 0===c?h:c(h);E!==h&&(f=E-p);let S=e=>-f*Math.exp(-e/s),b=e=>E+S(e),v=e=>{let t=S(e),n=b(e);g.done=Math.abs(t)<=m,g.value=g.done?E:n},T=e=>{let i;if(i=g.value,void 0!==d&&i<d||void 0!==u&&i>u){var a;t=e,n=ia({keyframes:[g.value,(a=g.value,void 0===d?u:void 0===u||Math.abs(d-a)<Math.abs(u-a)?d:u)],velocity:ir(b,e,g.value),damping:o,stiffness:l,restDelta:m,restSpeed:_})}};return T(0),{calculatedDuration:null,next:e=>{let i=!1;return(n||void 0!==t||(i=!0,v(e),T(e)),void 0!==t&&e>=t)?n.next(e-t):(i||v(e),g)}}}ia.applyToOptions=e=>{let t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=arguments.length>2?arguments[2]:void 0,i=n({...e,keyframes:[0,t]}),a=Math.min(n5(i),2e4);return{type:"keyframes",ease:e=>i.next(a*e).value/t,duration:a/1e3}}(e,100,ia);return e.ease=t.ease,e.duration=te(t.duration),e.type="keyframes",e};let io=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function il(e,t,n,i){return e===t&&n===i?e$:a=>0===a||1===a?a:io(function(e,t,n,i,a){let r,s,o=0;do(r=io(s=t+(n-t)/2,i,a)-e)>0?n=s:t=s;while(Math.abs(r)>1e-7&&++o<12)return s}(a,0,1,e,n),t,i)}let ic=il(.42,0,1,1),id=il(0,0,.58,1),iu=il(.42,0,.58,1),im=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,i_=e=>t=>1-e(1-t),ip=il(.33,1.53,.69,.99),ig=i_(ip),ih=im(ig),iE=e=>e>=1?1:(e*=2)<1?.5*ig(e):.5*(2-Math.pow(2,-10*(e-1))),iS=e=>1-Math.sin(Math.acos(e)),ib=i_(iS),iv=im(iS),iT={linear:e$,easeIn:ic,easeInOut:iu,easeOut:id,circIn:iS,circInOut:iv,circOut:ib,backIn:ig,backInOut:ih,backOut:ip,anticipate:iE},iy=e=>{if(t_(e)){ey(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,n,i,a]=e;return il(t,n,i,a)}return"string"==typeof e?(ey(void 0!==iT[e],`Invalid easing type '${e}'`,"invalid-easing-type"),iT[e]):e},iC=(e,t,n)=>{let i=t-e;return 0===i?1:(n-e)/i};function iN(e){var t;let n,{duration:i=300,keyframes:a,times:r,ease:s="easeInOut"}=e,o=Array.isArray(s)&&"number"!=typeof s[0]?s.map(iy):iy(s),l={done:!1,value:a[0]},c=function(e,t){let{clamp:n=!0,ease:i,mixer:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.length;if(ey(r===t.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>t[0];if(2===r&&t[0]===t[1])return()=>t[1];let s=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());let o=function(e,t,n){let i=[],a=n||ez.mix||n2,r=e.length-1;for(let n=0;n<r;n++){let r=a(e[n],e[n+1]);t&&(r=nH(Array.isArray(t)?t[n]||e$:t,r)),i.push(r)}return i}(t,i,a),l=o.length,c=n=>{if(s&&n<e[0])return t[0];let i=0;if(l>1)for(;i<e.length-2&&!(n<e[i+1]);i++);let a=iC(e[i],e[i+1],n);return o[i](a)};return n?t=>c(A(e[0],e[r-1],t)):c}((t=r&&r.length===a.length?r:(!function(e,t){let n=e[e.length-1];for(let i=1;i<=t;i++){let a=iC(0,t,i);e.push(t3(n,1,a))}}(n=[0],a.length-1),n),t.map(e=>e*i)),a,{ease:Array.isArray(o)?o:a.map(()=>o||iu).splice(0,a.length-1)});return{calculatedDuration:i,next:e=>(l.value=c(e),l.done=e>=i,l)}}let ix={decay:is,inertia:is,tween:iN,keyframes:iN,spring:ia};function iR(e){"string"==typeof e.type&&(e.type=ix[e.type])}let iO=e=>e/100;class iI extends tu{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==ty.now()&&this.tick(ty.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},tm.mainThread++,this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){let{options:e}=this;iR(e);let{type:t=iN,repeat:n=0,repeatDelay:i=0,repeatType:a,velocity:r=0}=e,{keyframes:s}=e,o=t||iN;o!==iN&&"number"!=typeof s[0]&&(this.mixKeyframes=nH(iO,n2(s[0],s[1])),s=[0,100]);let l=o({...e,keyframes:s});"mirror"===a&&(this.mirroredGenerator=o({...e,keyframes:[...s].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=n5(l));let{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e){let t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{generator:i,totalDuration:a,mixKeyframes:r,mirroredGenerator:s,resolvedDuration:o,calculatedDuration:l}=this;if(null===this.startTime)return i.next(0);let{delay:c=0,keyframes:d,repeat:u,repeatType:m,repeatDelay:_,type:p,onUpdate:g,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-a/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);let h=this.currentTime-c*(this.playbackSpeed>=0?1:-1),E=this.playbackSpeed>=0?h<0:h>a;this.currentTime=Math.max(h,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=a);let S=this.currentTime,b=i;if(u){let e=Math.min(this.currentTime,a)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,(t=Math.min(t,u+1))%2&&("reverse"===m?(n=1-n,_&&(n-=_/o)):"mirror"===m&&(b=s)),S=A(0,1,n)*o}E?(this.delayState.value=d[0],t=this.delayState):t=b.next(S),r&&!E&&(t.value=r(t.value));let{done:v}=t;E||null===l||(v=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);let T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&v);return T&&p!==is&&(t.value=td(d,this.options,f,this.speed)),g&&g(t.value),T&&this.finish(),t}then(e,t){return this.finished.then(e,t)}get duration(){return this.calculatedDuration/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return this.currentTime/1e3}set time(e){e=te(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return ir(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(ty.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:e=n3,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();let n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=t??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ty.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,tm.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}let iA={anticipate:iE,backInOut:ih,circInOut:iv};class iw extends tS{constructor(e){!function(e){"string"==typeof e.ease&&e.ease in iA&&(e.ease=iA[e.ease])}(e),iR(e),super(e),void 0!==e.startTime&&!1!==e.autoplay&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:i,element:a,...r}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);let s=new iI({...r,autoplay:!1}),o=Math.max(10,ty.now()-this.startTime),l=A(0,10,o-10),c=s.sample(o).value,{name:d}=this.options;a&&d&&ta(a,d,c),t.setWithVelocity(s.sample(Math.max(0,o-l)).value,c,l),s.stop()}}let iD=(e,t)=>"zIndex"!==t&&!!("number"==typeof e||Array.isArray(e)||"string"==typeof e&&(ei.test(e)||"0"===e)&&!e.startsWith("url("));function iL(e){e.duration=0,e.type="keyframes"}let iM=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/,ik=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),iP=tr(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class iF extends tu{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:r="loop",keyframes:s,name:o,motionValue:l,element:c,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ty.now();const u={autoplay:e,delay:t,type:n,repeat:i,repeatDelay:a,repeatType:r,name:o,motionValue:l,element:c,...d},m=c?.KeyframeResolver||e4;this.keyframeResolver=new m(s,(e,t,n)=>this.onKeyframesResolved(e,t,u,!n),o,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,i){let a;this.keyframeResolver=void 0;let{name:r,type:s,velocity:o,delay:l,isHandoff:c,onUpdate:d}=n;this.resolvedAt=ty.now();let u=!0;!function(e,t,n,i){let a=e[0];if(null===a)return!1;if("display"===t||"visibility"===t)return!0;let r=e[e.length-1],s=iD(a,t),o=iD(r,t);return eT(s===o,`You are trying to animate ${t} from "${a}" to "${r}". "${s?r:a}" is not an animatable value.`,"value-not-animatable"),!!s&&!!o&&(function(e){let t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||tE(n))&&i)}(e,r,s,o)&&(u=!1,(ez.instantAnimations||!l)&&d?.(td(e,n,t)),e[0]=e[e.length-1],iL(n),n.repeat=0);let m={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},_=u&&!c&&function(e){let{motionValue:t,name:n,repeatDelay:i,repeatType:a,damping:r,type:s,keyframes:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:c}=t.owner.getProps();return iP()&&n&&(tb.has(n)||ik.has(n)&&function(e){for(let t=0;t<e.length;t++)if("string"==typeof e[t]&&iM.test(e[t]))return!0;return!1}(o))&&("transform"!==n||!c)&&!l&&!i&&"mirror"!==a&&0!==r&&"inertia"!==s}(m),p=m.motionValue?.owner?.current;if(_)try{a=new iw({...m,element:p})}catch{a=new iI(m)}else a=new iI(m);a.finished.then(()=>{this.notifyFinished()}).catch(e$),this.pendingTimeline&&(this.stopTimeline=a.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=a}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),e2=!0,e5(),e3(),e2=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let iU={type:"spring",stiffness:500,damping:25,restSpeed:10},iB={type:"keyframes",duration:.8},iG={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ij=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]),iY=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0;return s=>{let o=nB(i,e)||{},l=o.delay||i.delay||0,{elapsed:c=0}=i;c-=te(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-c,onUpdate:e=>{t.set(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{s(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:r?void 0:a};!function(e){for(let t in e)if(!ij.has(t))return!0;return!1}(o)&&Object.assign(d,((e,t)=>{let{keyframes:n}=t;return n.length>2?iB:I.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===n[1]?2*Math.sqrt(550):30,restSpeed:10}:iU:iG})(e,d)),d.duration&&(d.duration=te(d.duration)),d.repeatDelay&&(d.repeatDelay=te(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let u=!1;if(!1!==d.type&&(0!==d.duration||d.repeatDelay)||(iL(d),0===d.delay&&(u=!0)),(ez.instantAnimations||ez.skipAnimations||a?.shouldSkipAnimations)&&(u=!0,iL(d),d.delay=0),d.allowFlatten=!o.type&&!o.ease,u&&!r&&void 0!==t.get()){let e=td(d.keyframes,o);if(void 0!==e)return void eQ.update(()=>{d.onUpdate(e),d.onComplete()})}return o.isSync?new iI(d):new iF(d)}};function iH(e,t){let{delay:n=0,transitionOverride:i,type:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{transition:r,transitionEnd:s,...o}=t,l=e.getDefaultTransition();r=r?nU(r,l):l;let c=r?.reduceMotion;i&&(r=i);let d=[],u=a&&e.animationState&&e.animationState.getState()[a];for(let t in o){let i=e.getValue(t,e.latestValues[t]??null),a=o[t];if(void 0===a||u&&function(e,t){let{protectedKeys:n,needsAnimating:i}=e,a=n.hasOwnProperty(t)&&!0!==i[t];return i[t]=!1,a}(u,t))continue;let s={delay:n,...nB(r||{},t)},l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(a)&&a===l&&!s.velocity){eQ.update(()=>i.set(a));continue}let m=!1;if(window.MotionHandoffAnimation){let n=e.props[nD];if(n){let e=window.MotionHandoffAnimation(n,t,eQ);null!==e&&(s.startTime=e,m=!0)}}nj(e,t);let _=c??e.shouldReduceMotion;i.start(iY(t,i,a,_&&eE.has(t)?{type:!1}:s,e,m));let p=i.animation;p&&d.push(p)}if(s){let t=()=>eQ.update(()=>{s&&function(e,t){let{transitionEnd:n={},transition:i={},...a}=nF(e,t)||{};for(let t in a={...a,...n}){var r;let n=nG(r=a[t])?r[r.length-1]||0:r;e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,tN(n))}}(e,s)});d.length?Promise.all(d).then(t):t()}return d}function iV(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),s=e.size,o=(s-1)*i;return"function"==typeof n?n(r,s):1===a?r*i:o-r*i}function i$(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=nF(e,t,"exit"===n.type?e.presenceContext?.custom:void 0),{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);let r=i?()=>Promise.all(iH(e,i,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,{delayChildren:r=0,staggerChildren:s,staggerDirection:o}=a;return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6?arguments[6]:void 0,o=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),o.push(i$(l,t,{...s,delay:n+("function"==typeof i?0:i)+iV(e.variantChildren,l,i,a,r)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(o)}(e,t,i,r,s,o,n)}:()=>Promise.resolve(),{when:o}=a;if(!o)return Promise.all([r(),s(n.delay)]);{let[e,t]="beforeChildren"===o?[r,s]:[s,r];return e().then(()=>t())}}let iz=tw.length;function iq(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}let iW=[...tA].reverse(),iQ=tA.length;function iK(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function iX(){return{animate:iK(!0),whileInView:iK(),whileHover:iK(),whileTap:iK(),whileDrag:iK(),whileFocus:iK(),exit:iK()}}let iZ=0;function iJ(e){return[e("x"),e("y")]}function i0(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{passive:!0};return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}let i1={x:!1,y:!1};function i2(e){return e.max-e.min}function i3(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;e.origin=i,e.originPoint=t3(t.min,t.max,e.origin),e.scale=i2(n)/i2(t),e.translate=t3(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function i5(e,t,n,i){i3(e.x,t.x,n.x,i?i.originX:void 0),i3(e.y,t.y,n.y,i?i.originY:void 0)}function i4(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;e.min=(i?t3(n.min,n.max,i):n.min)+t.min,e.max=e.min+i2(t)}function i9(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=i?t3(n.min,n.max,i):n.min;e.min=t.min-a,e.max=e.min+i2(t)}function i6(e,t,n,i){i9(e.x,t.x,n.x,i?.x),i9(e.y,t.y,n.y,i?.y)}function i7(e){return g(e)&&"ownerSVGElement"in e}function i8(e,t,n){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){let i=document;t&&(i=t.current);let a=n?.[e]??i.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(e=>null!=e)}let ae=new WeakMap,at=(e,t,n)=>(i,a)=>a&&a[0]?a[0][e+"Size"]:i7(i)&&"getBBox"in i?i.getBBox()[t]:i[n],an=at("inline","width","offsetWidth"),ai=at("block","height","offsetHeight");function aa(e){let{target:t,borderBoxSize:n}=e;ae.get(t)?.forEach(e=>{e(t,{get width(){return an(t,n)},get height(){return ai(t,n)}})})}function ar(e){e.forEach(aa)}let as=new Set;function ao(e,t){let a;return"function"==typeof e?(as.add(e),i||(i=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};as.forEach(t=>t(e))},window.addEventListener("resize",i)),()=>{as.delete(e),as.size||"function"!=typeof i||(window.removeEventListener("resize",i),i=void 0)}):(!n&&"u">typeof ResizeObserver&&(n=new ResizeObserver(ar)),(a=i8(e)).forEach(e=>{let i=ae.get(e);i||(i=new Set,ae.set(e,i)),i.add(t),n?.observe(e)}),()=>{a.forEach(e=>{let i=ae.get(e);i?.delete(t),i?.size||n?.unobserve(e)})})}let al=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),ac=new Set(["INPUT","SELECT","TEXTAREA"]),ad=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function au(e){return{point:{x:e.pageX,y:e.pageY}}}function am(e,t,n,i){return i0(e,t,e=>ad(e)&&n(e,au(e)),i)}let a_=e=>{let{current:t}=e;return t?t.ownerDocument.defaultView:null},ap=(e,t)=>Math.abs(e-t),ag=new Set(["auto","scroll"]);class af{constructor(e,t,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:a=!1,distanceThreshold:r=3,element:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{var e,t;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ah(this.lastRawMoveEventInfo,this.transformPagePoint));let n=aS(this.lastMoveEventInfo,this.history),i=null!==this.startEvent,a=(e=n.offset,t={x:0,y:0},Math.sqrt(ap(e.x,t.x)**2+ap(e.y,t.y)**2)>=this.distanceThreshold);if(!i&&!a)return;let{point:r}=n,{timestamp:s}=eX;this.history.push({...r,timestamp:s});let{onStart:o,onMove:l}=this.handlers;i||(o&&o(this.lastMoveEvent,n),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,n)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=ah(t,this.transformPagePoint),eQ.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:i,resumeAnimation:a}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&a&&a(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let r=aS("pointercancel"===e.type?this.lastMoveEventInfo:ah(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,r),i&&i(e,r)},!ad(e))return;this.dragSnapToOrigin=a,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=r,this.contextWindow=i||window;const o=ah(au(e),this.transformPagePoint),{point:l}=o,{timestamp:c}=eX;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=t;d&&d(e,aS(o,this.history)),this.removeListeners=nH(am(this.contextWindow,"pointermove",this.handlePointerMove),am(this.contextWindow,"pointerup",this.handlePointerUp),am(this.contextWindow,"pointercancel",this.handlePointerUp)),s&&this.startScrollTracking(s)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(ag.has(e.overflowX)||ag.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},a={x:i.x-t.x,y:i.y-t.y};(0!==a.x||0!==a.y)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(e,i),eQ.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),eK(this.updatePoint)}}function ah(e,t){return t?{point:t(e.point)}:e}function aE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function aS(e,t){let{point:n}=e;return{point:n,delta:aE(n,ab(t)),offset:aE(n,t[0]),velocity:function(e){if(e.length<2)return{x:0,y:0};let t=e.length-1,n=null,i=ab(e);for(;t>=0&&(n=e[t],!(i.timestamp-n.timestamp>te(.1)));)t--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&i.timestamp-n.timestamp>2*te(.1)&&(n=e[1]);let a=(i.timestamp-n.timestamp)/1e3;if(0===a)return{x:0,y:0};let r={x:(i.x-n.x)/a,y:(i.y-n.y)/a};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}(t)}}function ab(e){return e[e.length-1]}function av(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function aT(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,i]=[i,n]),{min:n,max:i}}function ay(e,t,n){return{min:aC(e,t),max:aC(e,n)}}function aC(e,t){return"number"==typeof e?e:e[t]||0}let aN=new WeakMap;class ax{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ef(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e){let{snapToCursor:t=!1,distanceThreshold:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;let a=e=>{t&&this.snapToCursor(au(e).point),this.stopAnimation()},r=(e,t)=>{let{drag:n,dragPropagation:i,onDragStart:a}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){if("x"===e||"y"===e)if(i1[e])return null;else return i1[e]=!0,()=>{i1[e]=!1};return i1.x||i1.y?null:(i1.x=i1.y=!0,()=>{i1.x=i1.y=!1})}(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),iJ(e=>{let t=this.getAxisMotionValue(e).get()||0;if(V.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let i=n.layout.layoutBox[e];i&&(t=i2(i)*(parseFloat(t)/100))}}this.originPoint[e]=t}),a&&eQ.update(()=>a(e,t),!1,!0),nj(this.visualElement,"transform");let{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:i,onDirectionLock:a,onDrag:r}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:s}=t;if(i&&null===this.currentDirection){this.currentDirection=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(s),null!==this.currentDirection&&a&&a(this.currentDirection);return}this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),r&&eQ.update(()=>r(e,t),!1,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new af(e,{onSessionStart:a,onStart:r,onMove:s,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:a_(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!n)return;let{velocity:r}=i;this.startAnimation(r);let{onDragEnd:s}=this.getProps();s&&eQ.postRender(()=>s(n,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:i}=this.getProps();if(!n||!aO(e,i,this.currentDirection))return;let a=this.getAxisMotionValue(e),r=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(r=function(e,t,n){let{min:i,max:a}=t;return void 0!==i&&e<i?e=n?t3(i,e,n.min):Math.max(e,i):void 0!==a&&e>a&&(e=n?t3(a,e,n.max):Math.min(e,a)),e}(r,this.constraints[e],this.elastic[e])),a.set(r)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&nM(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=function(e,t){let{top:n,left:i,bottom:a,right:r}=t;return{x:av(e.x,i,r),y:av(e.y,n,a)}}(n.layoutBox,e):this.constraints=!1,this.elastic=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.35;return!1===e?e=0:!0===e&&(e=.35),{x:ay(e,"left","right"),y:ay(e,"top","bottom")}}(t),i!==this.constraints&&!nM(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&iJ(e=>{var t,i;let a;!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=(t=n.layoutBox[e],i=this.constraints[e],a={},void 0!==i.min&&(a.min=i.min-t.min),void 0!==i.max&&(a.max=i.max-t.min),a))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!nM(t))return!1;let i=t.current;ey(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:a}=this.visualElement;if(!a||!a.layout)return!1;let r=function(e,t,n){let i=nu(e,n),{scroll:a}=t;return a&&(no(i.x,a.offset.x),no(i.y,a.offset.y)),i}(i,a.root,this.visualElement.getTransformPagePoint()),s=(e=a.layout.layoutBox,{x:aT(e.x,r.x),y:aT(e.y,r.y)});if(n){let e=n(function(e){let{x:t,y:n}=e;return{top:n.min,right:t.max,bottom:n.max,left:t.min}}(s));this.hasMutatedConstraints=!!e,e&&(s=t8(e))}return s}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:i,dragTransition:a,dragSnapToOrigin:r,onDragTransitionEnd:s}=this.getProps(),o=this.constraints||{};return Promise.all(iJ(s=>{if(!aO(s,t,this.currentDirection))return;let l=o&&o[s]||{};(!0===r||r===s)&&(l={min:0,max:0});let c={type:"inertia",velocity:n?e[s]:0,bounceStiffness:i?200:1e6,bounceDamping:i?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...a,...l};return this.startAxisValueAnimation(s,c)})).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return nj(this.visualElement,e),n.start(iY(e,n,0,t,this.visualElement,!1))}stopAnimation(){iJ(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){iJ(t=>{let{drag:n}=this.getProps();if(!aO(t,n,this.currentDirection))return;let{projection:i}=this.visualElement,a=this.getAxisMotionValue(t);if(i&&i.layout){let{min:n,max:r}=i.layout.layoutBox[t],s=a.get()||0;a.set(e[t]-t3(n,r,.5)+s)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!nM(t)||!n||!this.constraints)return;this.stopAnimation();let i={x:0,y:0};iJ(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){var n,a;let r,s,o,l=t.get();i[e]=(n={min:l,max:l},a=this.constraints[e],r=.5,s=i2(n),(o=i2(a))>s?r=iC(a.min,a.max-s,n.min):s>o&&(r=iC(n.min,n.max-o,a.min)),A(0,1,r))}});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),iJ(t=>{if(!aO(t,e,null))return;let n=this.getAxisMotionValue(t),{min:a,max:r}=this.constraints[t];n.set(t3(a,r,i[t]))}),this.visualElement.render()}addListeners(){let e;if(!this.visualElement.current)return;aN.set(this.visualElement,this);let t=this.visualElement.current,n=am(t,"pointerdown",e=>{let{drag:n,dragListener:i=!0}=this.getProps(),a=e.target,r=a!==t&&(ac.has(a.tagName)||!0===a.isContentEditable);n&&i&&!r&&this.start(e)}),i=()=>{var n,i,a;let r,s,{dragConstraints:o}=this.getProps();nM(o)&&o.current&&(this.constraints=this.resolveRefConstraints(),e||(n=t,i=o.current,r=ao(n,aR(a=()=>this.scalePositionWithinConstraints())),s=ao(i,aR(a)),e=()=>{r(),s()}))},{projection:a}=this.visualElement,r=a.addEventListener("measure",i);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),eQ.read(i);let s=i0(window,"resize",()=>this.scalePositionWithinConstraints()),o=a.addEventListener("didUpdate",e=>{let{delta:t,hasLayoutChanged:n}=e;this.isDragging&&n&&(iJ(e=>{let n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),n(),r(),o&&o(),e&&e()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:r=.35,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:i,dragConstraints:a,dragElastic:r,dragMomentum:s}}}function aR(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function aO(e,t,n){return(!0===t||t===e)&&(null===n||n===e)}let aI=e=>(t,n)=>{e&&eQ.update(()=>e(t,n),!1,!0)},aA={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var aw=c;let aD=!1;class aL extends aw.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:i}=this.props,{projection:a}=e;a&&(t.group&&t.group.add(a),n&&n.register&&i&&n.register(a),aD&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),aA.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:i,isPresent:a}=this.props,{projection:r}=n;return r&&(r.isPresent=a,e.layoutDependency!==t&&r.setOptions({...r.options,layoutDependency:t}),aD=!0,i||e.layoutDependency!==t||void 0===t||e.isPresent!==a?r.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?r.promote():r.relegate()||eQ.postRender(()=>{let e=r.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),tv.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:i}=e;aD=!0,i&&(i.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function aM(e){let[t,n]=C(),i=(0,aw.useContext)(u);return(0,s.jsx)(aL,{...e,layoutGroup:i,switchLayoutGroup:(0,aw.useContext)(nL),isPresent:t,safeToRemove:n})}let ak=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],aP=ak.length,aF=e=>"string"==typeof e?parseFloat(e):e,aU=e=>"number"==typeof e||$.test(e);function aB(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let aG=aY(0,.5,ib),aj=aY(.5,.95,e$);function aY(e,t,n){return i=>i<e?0:i>t?1:n(iC(e,t,i))}function aH(e,t){e.min=t.min,e.max=t.max}function aV(e,t){aH(e.x,t.x),aH(e.y,t.y)}function a$(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function az(e,t,n,i,a){return e-=t,e=i+1/n*(e-i),void 0!==a&&(e=i+1/a*(e-i)),e}function aq(e,t,n,i,a){let[r,s,o]=n;!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,a=arguments.length>4?arguments[4]:void 0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:e;if(V.test(t)&&(t=parseFloat(t),t=t3(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let o=t3(r.min,r.max,i);e===r&&(o-=t),e.min=az(e.min,t,n,o,a),e.max=az(e.max,t,n,o,a)}(e,t[r],t[s],t[o],t.scale,i,a)}let aW=["x","scaleX","originX"],aQ=["y","scaleY","originY"];function aK(e,t,n,i){aq(e.x,t,aW,n?n.x:void 0,i?i.x:void 0),aq(e.y,t,aQ,n?n.y:void 0,i?i.y:void 0)}function aX(e){return 0===e.translate&&1===e.scale}function aZ(e){return aX(e.x)&&aX(e.y)}function aJ(e,t){return e.min===t.min&&e.max===t.max}function a0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function a1(e,t){return a0(e.x,t.x)&&a0(e.y,t.y)}function a2(e){return i2(e.x)/i2(e.y)}function a3(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class a5{constructor(){this.members=[]}add(e){tt(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let i=n.instance;i&&!1!==i.isConnected||n.snapshot||(tn(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(tn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(!1!==e.isPresent&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:i}=n.options,{layoutDependency:a}=e.options;(void 0===i||i!==a)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),!1===e.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}let a4=(e,t)=>e.depth-t.depth;class a9{constructor(){this.children=[],this.isDirty=!1}add(e){tt(this.children,e),this.isDirty=!0}remove(e){tn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(a4),this.isDirty=!1,this.children.forEach(e)}}let a6=["","X","Y","Z"],a7=0;function a8(e,t,n,i){let{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),i&&(i[e]=0))}function re(e){let{attachResizeListener:t,defaultParent:n,measureScroll:i,checkIsScrollRoot:a,resetTransform:r}=e;return class{constructor(e={},t=n?.()){this.id=a7++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(ri),this.nodes.forEach(rm),this.nodes.forEach(r_),this.nodes.forEach(ra)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=t?t.root||t:this,this.path=t?[...t.path,t]:[],this.parent=t,this.depth=t?t.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new a9)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ti),this.eventHandlers.get(e).add(t)}notifyListeners(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];let a=this.eventHandlers.get(e);a&&a.notify(...n)}hasListeners(e){return this.eventHandlers.has(e)}mount(e){if(this.instance)return;this.isSVG=i7(e)&&!(i7(e)&&"svg"===e.tagName),this.instance=e;let{layoutId:n,layout:i,visualElement:a}=this.options;if(a&&!a.current&&a.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||n)&&(this.isLayoutDirty=!0),t){let n,i=0,a=()=>this.root.updateBlockedByResize=!1;eQ.read(()=>{i=window.innerWidth}),t(e,()=>{let e=window.innerWidth;if(e!==i){let t,r;i=e,this.root.updateBlockedByResize=!0,n&&n(),t=ty.now(),r=e=>{let{timestamp:n}=e,i=n-t;i>=250&&(eK(r),a(i-250))},eQ.setup(r,!0),n=()=>eK(r),aA.hasAnimatedSinceResize&&(aA.hasAnimatedSinceResize=!1,this.nodes.forEach(ru))}})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&a&&(n||i)&&this.addEventListener("didUpdate",e=>{let{delta:t,hasLayoutChanged:n,hasRelativeLayoutChanged:i,layout:r}=e;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let s=this.options.transition||a.getDefaultTransition()||rS,{onLayoutAnimationStart:o,onLayoutAnimationComplete:l}=a.getProps(),c=!this.targetLayout||!a1(this.targetLayout,r),d=!n&&i;if(this.options.layoutRoot||this.resumeFrom||d||n&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let e={...nB(s,"layout"),onPlay:o,onComplete:l};(a.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,d)}else n||ru(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),eK(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(rp),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function e(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;let{visualElement:n}=t.options;if(!n)return;let i=n.props[nD];if(window.MotionHasOptimisedAnimation(i,"transform")){let{layout:e,layoutId:n}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",eQ,!(e||n))}let{parent:a}=t;a&&!a.hasCheckedOptimisedAppear&&e(a)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,("string"==typeof t.latestValues.x||"string"==typeof t.latestValues.y)&&(t.isLayoutDirty=!0),t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;let i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(ro),this.nodes.forEach(rs);return}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(rl);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(rc),this.nodes.forEach(rd),this.nodes.forEach(rt),this.nodes.forEach(rn)):this.nodes.forEach(rl),this.clearAllSnapshots();let e=ty.now();eX.delta=A(0,1e3/60,e-eX.timestamp),eX.timestamp=e,eX.isProcessing=!0,eZ.update.process(eX),eZ.preRender.process(eX),eZ.render.process(eX),eX.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tv.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(rr),this.sharedNodes.forEach(rg)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,eQ.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){eQ.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||i2(this.snapshot.measuredBox.x)||i2(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=ef()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"measure",t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=a(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!r)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!aZ(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,a=i!==this.prevTransformTemplateValue;e&&this.instance&&(t||nn(this.latestValues)||a)&&(r(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(){var e;let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0],n=this.measurePageBox(),i=this.removeElementScroll(n);return t&&(i=this.removeTransform(i)),rT((e=i).x),rT(e.y),{animationId:this.root.animationId,measuredBox:n,layoutBox:i,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return ef();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(rC))){let{scroll:e}=this.root;e&&(no(t.x,e.offset.x),no(t.y,e.offset.y))}return t}removeElementScroll(e){let t=ef();if(aV(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let i=this.path[n],{scroll:a,options:r}=i;i!==this.root&&a&&r.layoutScroll&&(a.wasRoot&&aV(t,e),no(t.x,a.offset.x),no(t.y,a.offset.y))}return t}applyTransform(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,i=n||ef();aV(i,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(no(i.x,-n.scroll.offset.x),no(i.y,-n.scroll.offset.y)),nn(n.latestValues)&&nd(i,n.latestValues,n.layout?.layoutBox)}return nn(this.latestValues)&&nd(i,this.latestValues,this.layout?.layoutBox),i}removeTransform(e){let t=ef();aV(t,e);for(let e=0;e<this.path.length;e++){let n,i=this.path[e];nn(i.latestValues)&&(i.instance&&(nt(i.latestValues)&&i.updateSnapshot(),aV(n=ef(),i.measurePageBox())),aK(t,i.latestValues,i.snapshot?.layoutBox,n))}return nn(this.latestValues)&&aK(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==eX.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=t.isSharedProjectionDirty);let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:i,layoutId:a}=this.options;if(!this.layout||!(i||a))return;this.resolvedRelativeTargetAt=eX.timestamp;let r=this.getClosestProjectingParent();if(r&&this.linkedParentVersion!==r.layoutVersion&&!r.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&r&&r.layout?this.createRelativeTarget(r,this.layout.layoutBox,r.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=ef(),this.targetWithTransforms=ef()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var s,o,l,c;this.forceRelativeParentToResolveTarget(),s=this.target,o=this.relativeTarget,l=this.relativeParent.target,c=this.options.layoutAnchor||void 0,i4(s.x,o.x,l.x,c?.x),i4(s.y,o.y,l.y,c?.y)}else this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):aV(this.target,this.layout.layoutBox),ns(this.target,this.targetDelta)):aV(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&r&&!!r.resumingFrom==!!this.resumingFrom&&!r.options.layoutScroll&&r.target&&1!==this.animationProgress?this.createRelativeTarget(r,this.target,r.target):this.relativeParent=this.relativeTarget=void 0)}}getClosestProjectingParent(){if(!(!this.parent||nt(this.parent.latestValues)||ni(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ef(),this.relativeTargetOrigin=ef(),i6(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),aV(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===eX.timestamp&&(n=!1),n)return;let{layout:i,layoutId:a}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(i||a))return;aV(this.layoutCorrected,this.layout.layoutBox);let r=this.treeScale.x,s=this.treeScale.y;!function(e,t,n){let i,a,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=n.length;if(s){t.x=t.y=1;for(let o=0;o<s;o++){a=(i=n[o]).projectionDelta;let{visualElement:s}=i.options;(!s||!s.props.style||"contents"!==s.props.style.display)&&(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(no(e.x,-i.scroll.offset.x),no(e.y,-i.scroll.offset.y)),a&&(t.x*=a.x.scale,t.y*=a.y.scale,ns(e,a)),r&&nn(i.latestValues)&&nd(e,i.latestValues,i.layout?.layoutBox))}t.x<1.0000000000001&&t.x>.999999999999&&(t.x=1),t.y<1.0000000000001&&t.y>.999999999999&&(t.y=1)}}(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=ef());let{target:o}=e;if(!o){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(a$(this.prevProjectionDelta.x,this.projectionDelta.x),a$(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),i5(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.treeScale.x===r&&this.treeScale.y===s&&a3(this.projectionDelta.x,this.prevProjectionDelta.x)&&a3(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ep(),this.projectionDelta=ep(),this.projectionDeltaWithTransform=ep()}setAnimationOrigin(e){let t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.snapshot,a=i?i.latestValues:{},r={...this.latestValues},s=ep();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!n;let o=ef(),l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),d=!c||c.members.length<=1,u=!!(l&&!d&&!0===this.options.crossfade&&!this.path.some(rE));this.animationProgress=0,this.mixTargetDelta=n=>{let i=n/1e3;if(rf(s.x,e.x,i),rf(s.y,e.y,i),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var c,m,_,p,g,f;i6(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),_=this.relativeTarget,p=this.relativeTargetOrigin,g=o,f=i,rh(_.x,p.x,g.x,f),rh(_.y,p.y,g.y,f),t&&(c=this.relativeTarget,m=t,aJ(c.x,m.x)&&aJ(c.y,m.y))&&(this.isProjectionDirty=!1),t||(t=ef()),aV(t,this.relativeTarget)}l&&(this.animationValues=r,function(e,t,n,i,a,r){a?(e.opacity=t3(0,n.opacity??1,aG(i)),e.opacityExit=t3(t.opacity??1,0,aj(i))):r&&(e.opacity=t3(t.opacity??1,n.opacity??1,i));for(let a=0;a<aP;a++){let r=ak[a],s=aB(t,r),o=aB(n,r);(void 0!==s||void 0!==o)&&(s||(s=0),o||(o=0),0===s||0===o||aU(s)===aU(o)?(e[r]=Math.max(t3(aF(s),aF(o),i),0),(V.test(o)||V.test(s))&&(e[r]+="%")):e[r]=o)}(t.rotate||n.rotate)&&(e.rotate=t3(t.rotate||0,n.rotate||0,i))}(r,a,this.latestValues,i,u,d)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(eK(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=eQ.update(()=>{var t,n,i;let a;aA.hasAnimatedSinceResize=!0,tm.layout++,this.motionValue||(this.motionValue=tN(0)),this.motionValue.jump(0,!1),this.currentAnimation=(t=this.motionValue,n=[0,1e3],i={...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{tm.layout--},onComplete:()=>{tm.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}},(a=eh(t)?t:tN(t)).start(iY("",a,n,i)),a.animation),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:i,latestValues:a}=e;if(t&&n&&i){if(this!==e&&this.layout&&i&&ry(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||ef();let t=i2(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let i=i2(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+i}aV(t,n),nd(t,a),i5(this.projectionDeltaWithTransform,this.layoutCorrected,t,a)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new a5),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote(){let{needsReset:e,transition:t,preserveFollowOpacity:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.getStack();i&&i.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let i={};n.z&&a8("z",e,i,this.animationValues);for(let t=0;t<a6.length;t++)a8(`rotate${a6[t]}`,e,i,this.animationValues),a8(`skew${a6[t]}`,e,i,this.animationValues);for(let t in e.render(),i)e.setStaticValue(t,i[t]),this.animationValues&&(this.animationValues[t]=i[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility="hidden";return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=nC(t?.pointerEvents)||"",e.transform=n?n(this.latestValues,""):"none";return}let i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=nC(t?.pointerEvents)||""),this.hasProjected&&!nn(this.latestValues)&&(e.transform=n?n({},""):"none",this.hasProjected=!1);return}e.visibility="";let a=i.animationValues||i.latestValues;this.applyTransformsToTarget();let r=function(e,t,n){let i="",a=e.x.translate/t.x,r=e.y.translate/t.y,s=n?.z||0;if((a||r||s)&&(i=`translate3d(${a}px, ${r}px, ${s}px) `),(1!==t.x||1!==t.y)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:a,rotateY:r,skewX:s,skewY:o}=n;e&&(i=`perspective(${e}px) ${i}`),t&&(i+=`rotate(${t}deg) `),a&&(i+=`rotateX(${a}deg) `),r&&(i+=`rotateY(${r}deg) `),s&&(i+=`skewX(${s}deg) `),o&&(i+=`skewY(${o}deg) `)}let o=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==o||1!==l)&&(i+=`scale(${o}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,a);n&&(r=n(a,r)),e.transform=r;let{x:s,y:o}=this.projectionDelta;for(let t in e.transformOrigin=`${100*s.origin}% ${100*o.origin}% 0`,i.animationValues?e.opacity=i===this?a.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:e.opacity=i===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0,t5){if(void 0===a[t])continue;let{correct:n,applyTo:s,isCSSVariable:o}=t5[t],l="none"===r?a[t]:n(a[t],i);if(s){let t=s.length;for(let n=0;n<t;n++)e[s[n]]=l}else o?this.options.visualElement.renderState.vars[t]=l:e[t]=l}this.options.layoutId&&(e.pointerEvents=i===this?nC(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(rs),this.root.sharedNodes.clear()}}}function rt(e){e.updateLayout()}function rn(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:n,measuredBox:i}=e.layout,{animationType:a}=e.options,r=t.source!==e.layout.source;if("size"===a)iJ(e=>{let i=r?t.measuredBox[e]:t.layoutBox[e],a=i2(i);i.min=n[e].min,i.max=i.min+a});else if("x"===a||"y"===a){let e="x"===a?"y":"x";aH(r?t.measuredBox[e]:t.layoutBox[e],n[e])}else ry(a,t.layoutBox,n)&&iJ(i=>{let a=r?t.measuredBox[i]:t.layoutBox[i],s=i2(n[i]);a.max=a.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[i].max=e.relativeTarget[i].min+s)});let s=ep();i5(s,n,t.layoutBox);let o=ep();r?i5(o,e.applyTransform(i,!0),t.measuredBox):i5(o,n,t.layoutBox);let l=!aZ(s),c=!1;if(!e.resumeFrom){let i=e.getClosestProjectingParent();if(i&&!i.resumeFrom){let{snapshot:a,layout:r}=i;if(a&&r){let s=e.options.layoutAnchor||void 0,o=ef();i6(o,t.layoutBox,a.layoutBox,s);let l=ef();i6(l,n,r.layoutBox,s),a1(o,l)||(c=!0),i.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=o,e.relativeParent=i)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:o,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function ri(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function ra(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function rr(e){e.clearSnapshot()}function rs(e){e.clearMeasurements()}function ro(e){e.isLayoutDirty=!0,e.updateLayout()}function rl(e){e.isLayoutDirty=!1}function rc(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function rd(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ru(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rm(e){e.resolveTargetDelta()}function r_(e){e.calcProjection()}function rp(e){e.resetSkewAndRotation()}function rg(e){e.removeLeadSnapshot()}function rf(e,t,n){e.translate=t3(t.translate,0,n),e.scale=t3(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function rh(e,t,n,i){e.min=t3(t.min,n.min,i),e.max=t3(t.max,n.max,i)}function rE(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let rS={duration:.45,ease:[.4,0,.1,1]},rb=e=>"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),rv=rb("applewebkit/")&&!rb("chrome/")?Math.round:e$;function rT(e){e.min=rv(e.min),e.max=rv(e.max)}function ry(e,t,n){return"position"===e||"preserve-aspect"===e&&!(.2>=Math.abs(a2(t)-a2(n)))}function rC(e){return e!==e.root&&e.scroll?.wasRoot}let rN=re({attachResizeListener:(e,t)=>i0(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),rx={current:void 0},rR=re({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!rx.current){let e=new rN({});e.mount(window),e.setOptions({layoutScroll:!0}),rx.current=e}return rx.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position});function rO(e,t){let n=i8(e),i=new AbortController;return[n,{passive:!0,...t,signal:i.signal},()=>i.abort()]}function rI(e,t,n){let{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover","Start"===n);let a=i["onHover"+n];a&&eQ.postRender(()=>a(t,au(t)))}let rA=(e,t)=>!!t&&(e===t||rA(e,t.parentElement)),rw=new WeakSet;function rD(e){return t=>{"Enter"===t.key&&e(t)}}function rL(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function rM(e){return ad(e)&&!(i1.x||i1.y)}let rk=new WeakSet;function rP(e,t,n){let{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap","Start"===n);let a=i["onTap"+("End"===n?"":n)];a&&eQ.postRender(()=>a(t,au(t)))}let rF=new WeakMap,rU=new WeakMap,rB=e=>{let t=rF.get(e.target);t&&t(e)},rG=e=>{e.forEach(rB)},rj={some:0,all:1},rY=function(e,t){if("u"<typeof Proxy)return nk;let n=new Map,i=(n,i)=>nk(n,i,e,t);return new Proxy((e,t)=>i(e,t),{get:(a,r)=>"create"===r?i:(n.has(r)||n.set(r,nk(r,void 0,e,t)),n.get(r))})}({animation:{Feature:class extends nP{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(t=>{let{animation:n,options:i}=t;return function(e,t){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e.notify("AnimationStart",t),Array.isArray(t))n=Promise.all(t.map(t=>i$(e,t,i)));else if("string"==typeof t)n=i$(e,t,i);else{let a="function"==typeof t?nF(e,t,i.custom):t;n=Promise.all(iH(e,a,i))}return n.then(()=>{e.notify("AnimationComplete",t)})}(e,n,i)})),n=iX(),i=!0,a=!1,r=t=>(n,i)=>{let a=nF(e,i,"exit"===t?e.presenceContext?.custom:void 0);if(a){let{transition:e,transitionEnd:t,...i}=a;n={...n,...i,...t}}return n};function s(s){let{props:o}=e,l=function e(t){if(!t)return;if(!t.isControllingVariants){let n=t.parent&&e(t.parent)||{};return void 0!==t.props.initial&&(n.initial=t.props.initial),n}let n={};for(let e=0;e<iz;e++){let i=tw[e],a=t.props[i];(tI(a)||!1===a)&&(n[i]=a)}return n}(e.parent)||{},c=[],d=new Set,u={},m=1/0;for(let t=0;t<iQ;t++){var _,p;let g=iW[t],f=n[g],h=void 0!==o[g]?o[g]:l[g],E=tI(h),S=g===s?f.isActive:null;!1===S&&(m=t);let b=h===l[g]&&h!==o[g]&&E;if(b&&(i||a)&&e.manuallyAnimateOnMount&&(b=!1),f.protectedKeys={...u},!f.isActive&&null===S||!h&&!f.prevProp||tO(h)||"boolean"==typeof h)continue;if("exit"===g&&f.isActive&&!0!==S){f.prevResolvedValues&&(u={...u,...f.prevResolvedValues});continue}let v=(_=f.prevProp,"string"==typeof(p=h)?p!==_:!!Array.isArray(p)&&!iq(p,_)),T=v||g===s&&f.isActive&&!b&&E||t>m&&E,y=!1,C=Array.isArray(h)?h:[h],N=C.reduce(r(g),{});!1===S&&(N={});let{prevResolvedValues:x={}}=f,R={...x,...N},O=t=>{T=!0,d.has(t)&&(y=!0,d.delete(t)),f.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in R){let t=N[e],n=x[e];if(!u.hasOwnProperty(e))(nG(t)&&nG(n)?iq(t,n):t===n)?void 0!==t&&d.has(e)?O(e):f.protectedKeys[e]=!0:null!=t?O(e):d.add(e)}f.prevProp=h,f.prevResolvedValues=N,f.isActive&&(u={...u,...N}),(i||a)&&e.blockInitialAnimation&&(T=!1);let I=b&&v,A=!I||y;T&&A&&c.push(...C.map(t=>{let n={type:g};if("string"==typeof t&&(i||a)&&!I&&e.manuallyAnimateOnMount&&e.parent){let{parent:i}=e,a=nF(i,t);if(i.enteringChildren&&a){let{delayChildren:t}=a.transition||{};n.delay=iV(i.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(d.size){let t={};if("boolean"!=typeof o.initial){let n=nF(e,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(t.transition=n.transition)}d.forEach(n=>{let i=e.getBaseTarget(n),a=e.getValue(n);a&&(a.liveStyle=!0),t[n]=i??null}),c.push({animation:t})}let g=!!c.length;return i&&(!1===o.initial||o.initial===o.animate)&&!e.manuallyAnimateOnMount&&(g=!1),i=!1,a=!1,g?t(c):Promise.resolve()}return{animateChanges:s,setActive:function(t,i){if(n[t].isActive===i)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,i)),n[t].isActive=i;let a=s(t);for(let e in n)n[e].protectedKeys={};return a},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=iX(),a=!0}}}(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();tO(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends nP{constructor(){super(...arguments),this.id=iZ++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&!1===n){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if("string"==typeof e){let n=nF(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...i}=n;for(let e in i)this.node.getValue(e)?.jump(i[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}let i=this.node.animationState.setActive("exit",!e);t&&!e&&i.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}},inView:{Feature:class extends nP{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var e;let t;this.stopObserver?.();let{viewport:n={}}=this.node.getProps(),{root:i,margin:a,amount:r="some",once:s}=n,o={root:i?i.current:void 0,rootMargin:a,threshold:"number"==typeof r?r:rj[r]},l=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,s&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),a=t?n:i;a&&a(e)};this.stopObserver=(e=this.node.current,t=function(e){let{root:t,...n}=e,i=t||document;rU.has(i)||rU.set(i,{});let a=rU.get(i),r=JSON.stringify(n);return a[r]||(a[r]=new IntersectionObserver(rG,{root:t,...n})),a[r]}(o),rF.set(e,l),t.observe(e),()=>{rF.delete(e),t.unobserve(e)})}mount(){this.startObserver()}update(){if("u"<typeof IntersectionObserver)return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function(e){let{viewport:t={}}=e,{viewport:n={}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e=>t[e]!==n[e]}(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends nP{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},[i,a,r]=rO(e,n),s=e=>{let i=e.currentTarget;if(!rM(e)||rk.has(e))return;rw.add(i),n.stopPropagation&&rk.add(e);let r=t(i,e),s=(e,t)=>{window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",l),rw.has(i)&&rw.delete(i),rM(e)&&"function"==typeof r&&r(e,{success:t})},o=e=>{s(e,i===window||i===document||n.useGlobalTarget||rA(i,e.target))},l=e=>{s(e,!1)};window.addEventListener("pointerup",o,a),window.addEventListener("pointercancel",l,a)};return i.forEach(e=>{((n.useGlobalTarget?window:e).addEventListener("pointerdown",s,a),f(e))&&(e.addEventListener("focus",e=>((e,t)=>{let n=e.currentTarget;if(!n)return;let i=rD(()=>{if(rw.has(n))return;rL(n,"down");let e=rD(()=>{rL(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>rL(n,"cancel"),t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)})(e,a)),al.has(e.tagName)||!0===e.isContentEditable||e.hasAttribute("tabindex")||(e.tabIndex=0))}),r}(e,(e,t)=>(rP(this.node,t,"Start"),(e,t)=>{let{success:n}=t;return rP(this.node,e,n?"End":"Cancel")}),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}}},focus:{Feature:class extends nP{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=nH(i0(this.node.current,"focus",()=>this.onFocus()),i0(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends nP{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},[i,a,r]=rO(e,n);return i.forEach(e=>{let n,i=!1,r=!1,s=t=>{n&&(n(t),n=void 0),e.removeEventListener("pointerleave",l)},o=e=>{i=!1,window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",o),r&&(r=!1,s(e))},l=e=>{if("touch"!==e.pointerType){if(i){r=!0;return}s(e)}};e.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||i1.x||i1.y)return;r=!1;let s=t(e,i);"function"==typeof s&&(n=s,e.addEventListener("pointerleave",l,a))},a),e.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",o,a),window.addEventListener("pointercancel",o,a)},a)}),r}(e,(e,t)=>(rI(this.node,t,"Start"),e=>rI(this.node,e,"End"))))}unmount(){}}},pan:{Feature:class extends nP{constructor(){super(...arguments),this.removePointerDownListener=e$}onPointerDown(e){this.session=new af(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:a_(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:aI(e),onStart:aI(t),onMove:aI(n),onEnd:(e,t)=>{delete this.session,i&&eQ.postRender(()=>i(e,t))}}}mount(){this.removePointerDownListener=am(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends nP{constructor(e){super(e),this.removeGroupControls=e$,this.removeListeners=e$,this.controls=new ax(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||e$}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:rR,MeasureLayout:aM},layout:{ProjectionNode:rR,MeasureLayout:aM}},(e,t)=>t.isSVG??np(e)?new t7(t):new nm(t,{allowProjection:e!==c.Fragment}));var rH=e.i(352819),rV=e.i(385459),r$=e.i(742921),rz=e.i(143100),rq=e.i(679935),rW=e.i(353533),rQ=e.i(399267),rK=e.i(3450);let rX=["Yes","Yes,","No","Accept","Decline","Open System Settings","Try again","Use this","Continue without","Resume from summary","Resume full session","Continue this conversation","Send message as","Don't ask me again"],rZ=/^\s*(?:[❯›>]\s+)?(.+)$/,rJ=/^\s*[❯›>]\s+/,r0=/^(\d+)\.\s+/,r1=/^\s*([❯›>])?\s*(?:[↓↑]\s*)?(\d+)\.?\s*(\S.*)$/,r2=/^[\s─━\-]+$/,r3=e=>e.replace(r0,""),r5=e=>e.match(r0)?.[1]??null,r4=(e,t)=>e.some(e=>r3(e).startsWith(t)),r9=e=>e.match(/^\s*/)?.[0].length??0,r6=e=>e.trim().replace(/^[☐☑]\s*/,"").trim(),r7=e=>/^[\s]*[☐☑]\s*\S/.test(e),r8=/^(Yes,\s*and\s+don[\u2019']?t\s+ask)\s*:\s*(.+)$/,se=e=>!(e.length<2)&&(r4(e,"Yes")&&r4(e,"No")||r4(e,"Accept")&&r4(e,"Decline")||r4(e,"Open System Settings")||r4(e,"Use this")&&r4(e,"Continue without")||r4(e,"Resume from summary")&&r4(e,"Resume full session")||r4(e,"Continue this conversation")&&r4(e,"Send message as")),st=(e,t,n)=>({...e,...((e,t)=>{if(t<=0)return{};let n=t-1;for(;n>=0&&(!e[n].trim()||r2.test(e[n]));)n-=1;let i=[];for(;n>=0&&e[n].trim()&&!r2.test(e[n]);)i.unshift(r6(e[n])),n-=1;for(;n>=0&&(!e[n].trim()||r2.test(e[n]));)n-=1;let a=[],r=[];for(;n>=0&&e[n].trim()&&!r2.test(e[n]);)r.unshift(e[n]),a.unshift(r6(e[n])),n-=1;let s=i.join("\n").trim(),o=r.some(r7)?a.join("\n").trim():"";return{...o&&{title:o},...s&&{request:s}}})(t,n)});e.s(["optionNumber",0,r5,"parsePermissionOptions",0,e=>{let t=e.split("\n"),n=(e=>{let t=[],n=[],i=0,a=1,r=0,s=-1,o=()=>{n.length>=2&&t.push({rawOptions:n.slice(),focusedIndex:i,optionStartIndex:s}),n=[],i=0,a=1,r=0,s=-1};for(let t=0;t<e.length;t+=1){let l=e[t];if(!l.trim())continue;let c=l.match(r1);if(c){let e=c[1],d=Number(c[2]),u=c[3].trim();if(u.length>0){if(1===d){o(),n.push(u),e&&(i=0),r=r9(l),s=t,a=2;continue}if(d===a){e&&(i=n.length),n.push(u),r=r9(l),a+=1;continue}}}if(n.length>0){if(r9(l)>r){n[n.length-1]+=l.trimStart();continue}if(/^\s+\S/.test(l))continue;o()}}o();let l=t[t.length-1];return l?{...st({options:l.rawOptions.map((e,t)=>{let n;return`${t+1}. ${(n=e.match(r8))?`${n[1]} again for: ${n[2].trim()}`:/^Yes(?![,\s]|$)/.test(e)?"Yes":/^No(?![,\s]|$)/.test(e)?"No":e}`}),focusedIndex:l.focusedIndex},e,l.optionStartIndex)}:{options:[],focusedIndex:0}})(t);if(n.options.length>=2&&se(n.options))return n;let i=(e=>{let t=[],n=0,i=-1,a=!1,r=0;for(let s=0;s<e.length;s+=1){let o=e[s];if(!o.trim()){if(a)break;continue}let l=rJ.test(o),c=/^\s+\S/.test(o);if(!l&&!c){if(a&&/^[a-z]/.test(o.trim())){t[t.length-1]+=o.trim();continue}if(a)break;continue}let d=o.match(rZ);if(!d)continue;let u=d[1].trim(),m=r3(u);rX.some(e=>m.startsWith(e))?(0===t.length&&(i=s),l&&(n=t.length),t.push(u),a=!0,r=r9(o)):a&&!l&&r9(o)>r&&(t[t.length-1]+=o.trim())}return st({options:t,focusedIndex:n},e,i)})(t);return se(i.options)?i:{options:[],focusedIndex:0}},"stripNumberPrefix",0,r3],601726);let sn={options:[]},si=async e=>{try{let t=await fetch(`/api/tmux/permission-options?session=${encodeURIComponent(e)}`);if(!t.ok)return sn;let n=await t.json();return{title:"string"==typeof n.title?n.title:void 0,request:"string"==typeof n.request?n.request:void 0,options:Array.isArray(n.options)?n.options:[]}}catch{return sn}},sa=async(e,t,n)=>{try{return(await fetch("/api/tmux/send-input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:e,input:r5(n)??String(t+1)})})).ok}catch{return!1}},sr=[500,1e3,2e3,4e3],ss={initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4,scale:.98},transition:{duration:.18,ease:[.2,.8,.2,1]}},so=(0,c.memo)(e=>{let{sessionName:t,tabId:n,silent:i=!1}=e,a=(0,rH.useTranslations)("timeline"),[r,o]=(0,c.useState)(null),[l,d]=(0,c.useState)(sn),[u,m]=(0,c.useState)("loading"),[_,p]=(0,c.useState)(!1),g=(0,rQ.default)(e=>n?e.tabs[n]?.cliState:void 0),f=(0,rQ.default)(e=>n?e.tabs[n]?.lastEvent?.seq:void 0);(0,c.useEffect)(()=>{let e=!1,n=null;o(null),d(sn),m("loading"),p(!1);let a=i?0:sr.length,r=async i=>{let s=await si(t);if(!e){if(s.options.length>0){d(s),m("ready");return}if(i>=a)return void m("failed");n=setTimeout(()=>r(i+1),sr[i])}};return r(0),()=>{e=!0,n&&clearTimeout(n)}},[t,g,f,i]);let h=null===r,E=(0,c.useCallback)(async e=>{if(null===r){if(o(e),!await sa(t,e,l.options[e]??"")){o(null),rq.toast.error(a("selectionFailed"));return}n&&void 0!==f&&(0,rK.ackNotificationInput)(n,f),p(!0)}},[t,r,l.options,a,n,f]);return(0,s.jsx)(R,{initial:!1,children:_?null:"loading"===u?i?null:(0,s.jsx)(rY.div,{...ss,className:"mt-2",children:(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-claude-active/20 bg-claude-active/5 px-4 py-3 text-xs text-claude-active",children:[(0,s.jsx)(rz.Loader2,{size:14,className:"animate-spin"}),(0,s.jsx)("span",{children:a("permissionLoading")})]})},"loading"):"failed"===u?i?null:(0,s.jsx)(rY.div,{...ss,className:"mt-2",children:(0,s.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-amber-500/30 bg-amber-500/5 px-4 py-3 text-xs text-amber-600 dark:text-amber-400",children:[(0,s.jsx)(r$.ShieldAlert,{size:14,className:"mt-0.5 shrink-0"}),(0,s.jsx)("span",{children:a("permissionParseFailed")})]})},"failed"):(0,s.jsx)(rY.div,{...ss,className:"mt-2",children:(0,s.jsxs)("div",{className:"rounded-lg border border-claude-active/20 bg-claude-active/5 px-4 py-3",children:[(0,s.jsxs)("div",{className:"mb-2.5 flex items-center gap-2 text-xs font-medium text-claude-active",children:[(0,s.jsx)(rV.ShieldCheck,{size:14}),(0,s.jsx)("span",{children:l.title||a("permissionRequired")})]}),l.request&&(0,s.jsx)("p",{className:"mb-3 whitespace-pre-wrap text-sm leading-relaxed text-foreground",children:l.request}),(0,s.jsx)("div",{className:"flex flex-col gap-1.5",children:l.options.map((e,t)=>{let n=r===t,i=null!==r&&!n;return(0,s.jsxs)("button",{type:"button",disabled:!h,onClick:()=>E(t),className:(0,rW.cn)("flex items-start gap-2.5 rounded-md border px-3 py-2 text-left text-sm transition-colors",n?"border-claude-active/40 bg-claude-active/10":i?"border-border/30 opacity-50":"border-border/50",h&&"cursor-pointer hover:border-claude-active/30 hover:bg-claude-active/5"),children:[(0,s.jsx)("span",{className:(0,rW.cn)("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded text-xs font-medium",n?"bg-claude-active text-white":"bg-muted text-muted-foreground"),children:t+1}),(0,s.jsx)("span",{className:"min-w-0 flex-1 font-medium",children:r3(e)})]},t)})})]})},"ready")})});e.s(["default",0,so],954996);var sl=e.i(222564),sc=e.i(189257),sd=e.i(909725);let su={exec:"Exec","apply-patch":"ApplyPatch",permissions:"Permissions"},sm={pending:"text-ui-amber",success:"text-ui-teal",error:"text-negative"},s_=(0,c.memo)(e=>{var t;let{entry:n}=e,i=su[n.approvalKind],a=sm[n.status],r="pending"===n.status?"animate-pulse":"",o="success"===(t=n.status)?{text:"승인됨",Icon:sc.Check,tone:"text-ui-teal"}:"error"===t?{text:"거부됨",Icon:sd.X,tone:"text-negative"}:{text:"대기 중",Icon:null,tone:"text-ui-amber"},l=o.Icon;return(0,s.jsx)("div",{className:"animate-in fade-in py-1 duration-150",role:"article",children:(0,s.jsxs)("div",{className:"rounded-md border border-ui-blue/30 bg-ui-blue/5 px-3 py-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(sl.AlertCircle,{size:14,className:(0,rW.cn)("shrink-0",a,r)}),(0,s.jsx)("span",{className:"text-xs font-medium text-foreground/90",children:"권한 요청"}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",i,")"]})]}),n.command&&(0,s.jsxs)("div",{className:"mt-1.5 ml-0.5 break-all font-mono text-xs text-foreground/90",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"$ "}),n.command]}),n.cwd&&(0,s.jsxs)("div",{className:"mt-0.5 ml-0.5 break-all font-mono text-[11px] text-muted-foreground/70",children:["cwd: ",n.cwd]}),n.patches&&n.patches.length>0&&(0,s.jsx)("div",{className:"mt-1.5 ml-0.5 space-y-0.5",children:n.patches.map((e,t)=>(0,s.jsxs)("div",{className:"break-all font-mono text-[11px]",children:[(0,s.jsx)("span",{className:"text-foreground/90",children:e.path}),e.status&&(0,s.jsxs)("span",{className:"ml-1.5 text-muted-foreground/60",children:["(",e.status,")"]})]},`${e.path}-${t}`))}),n.permissions&&n.permissions.length>0&&(0,s.jsx)("div",{className:"mt-1.5 ml-0.5 flex flex-wrap gap-1",children:n.permissions.map((e,t)=>(0,s.jsx)("span",{className:"rounded-sm bg-muted/60 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e},`${e}-${t}`))}),(0,s.jsxs)("div",{className:(0,rW.cn)("mt-2 flex items-center gap-1 text-xs",o.tone),children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"결과:"}),l&&(0,s.jsx)(l,{size:12}),(0,s.jsx)("span",{children:o.text})]})]})})});e.s(["default",0,s_],42054);var sp=e.i(444957),sg=e.i(377216),sf=e.i(21152);let sh={pending:"text-ui-amber",success:"text-muted-foreground",error:"text-negative"},sE=(0,c.memo)(e=>{let{entry:t}=e,[n,i]=(0,c.useState)(!1),a=t.stdout??"",r=t.stderr??"",o=a.length>0||r.length>0,l=(e=>{if(null==e||!Number.isFinite(e))return null;if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;return t<60?`${t.toFixed(1)}s`:`${Math.floor(t/60)}m ${Math.round(t%60)}s`})(t.durationMs),d=t.parsedCommand??t.command,u=sh[t.status],m="pending"===t.status?"animate-pulse":"";return(0,s.jsxs)("div",{className:"animate-in fade-in py-1 duration-150",role:"article",children:[(0,s.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,s.jsx)(sf.Terminal,{size:12,className:(0,rW.cn)("mt-0.5 shrink-0",u,m)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"text-xs font-mono break-all",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"$ "}),(0,s.jsx)("span",{children:d})]}),(0,s.jsxs)("div",{className:"mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground/70",children:[null!=t.exitCode&&(0,s.jsxs)("span",{className:0===t.exitCode?"":"text-negative",children:["exit ",t.exitCode]}),l&&(0,s.jsxs)("span",{children:["· ",l]}),t.truncated&&(0,s.jsx)("span",{children:"· truncated"})]})]})]}),o&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),"aria-expanded":n,className:"ml-4 mt-1 inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground",children:[n?(0,s.jsx)(sp.ChevronDown,{size:10}):(0,s.jsx)(sg.ChevronRight,{size:10}),(0,s.jsx)("span",{children:n?"출력 숨기기":"출력 보기"})]}),n&&(0,s.jsxs)("div",{className:"ml-4 mt-1.5 max-h-[320px] overflow-auto rounded border border-border/40 bg-muted/40 p-2 font-mono text-[11px]",children:[a&&(0,s.jsx)("pre",{className:"whitespace-pre-wrap break-words text-foreground/90",children:a}),r&&(0,s.jsx)("pre",{className:"mt-2 whitespace-pre-wrap break-words text-negative/80",children:r})]})]})]})});e.s(["default",0,sE],44158);var sS=e.i(878528);let sb={pending:"text-ui-amber",success:"text-ui-teal",error:"text-negative"},sv=(0,c.memo)(e=>{let{entry:t}=e,n=sb[t.status],i="pending"===t.status?"animate-pulse":"",a=t.resultsSummary??(null!=t.resultCount?`${t.resultCount} results`:null);return(0,s.jsx)("div",{className:"animate-in fade-in py-1 duration-150",role:"article",children:(0,s.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,s.jsx)(sS.Globe,{size:12,className:(0,rW.cn)("mt-0.5 shrink-0",n,i)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"text-xs",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"웹 검색"}),t.query&&(0,s.jsxs)("span",{className:"ml-1.5 font-mono text-foreground/90 break-all",children:["“",t.query,"”"]})]}),a&&(0,s.jsx)("p",{className:"mt-0.5 text-[11px] text-muted-foreground/70",children:a})]})]})})});e.s(["default",0,sv],333711);var sT=e.i(205270);let sy=(0,sT.default)("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]),sC={pending:"text-ui-amber",success:"text-ui-purple",error:"text-negative"},sN=(0,c.memo)(e=>{let{entry:t}=e,[n,i]=(0,c.useState)(!1),a=sC[t.status],r="pending"===t.status?"animate-pulse":"",o=!!(t.argumentsSummary||t.resultSummary);return(0,s.jsx)("div",{className:"animate-in fade-in py-1 duration-150",role:"article",children:(0,s.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,s.jsx)(sy,{size:12,className:(0,rW.cn)("mt-0.5 shrink-0",a,r)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-1.5 text-xs",children:[(0,s.jsx)("span",{className:"font-medium text-foreground/90",children:"MCP"}),(0,s.jsx)("span",{className:"text-muted-foreground",children:"·"}),(0,s.jsx)("span",{className:"font-mono text-foreground/80",children:t.server||"?"}),(0,s.jsx)("span",{className:"text-muted-foreground/60",children:"/"}),(0,s.jsx)("span",{className:"font-mono text-foreground/80 break-all",children:t.tool})]}),o&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),"aria-expanded":n,className:"mt-1 inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground",children:[n?(0,s.jsx)(sp.ChevronDown,{size:10}):(0,s.jsx)(sg.ChevronRight,{size:10}),(0,s.jsx)("span",{children:n?"숨기기":"자세히 보기"})]}),n&&(0,s.jsxs)("div",{className:"mt-1.5 space-y-1 rounded border border-border/40 bg-muted/40 p-2 font-mono text-[11px]",children:[t.argumentsSummary&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-muted-foreground/70",children:"arguments"}),(0,s.jsx)("div",{className:"whitespace-pre-wrap break-words text-foreground/90",children:t.argumentsSummary})]}),t.resultSummary&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-muted-foreground/70",children:"result"}),(0,s.jsx)("div",{className:"whitespace-pre-wrap break-words text-foreground/90",children:t.resultSummary})]})]})]})]})]})})});e.s(["default",0,sN],427285);var sx=e.i(806542),sx=sx,sR=e.i(770643);let sO=(0,sT.default)("file-x",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14.5 12.5-5 5",key:"b62r18"}],["path",{d:"m9.5 12.5 5 5",key:"1rk7el"}]]);var sI=e.i(73348);let sA={pending:"text-ui-amber",success:"text-ui-teal",error:"text-negative"},sw=e=>{let t,n,i,{file:a}=e,r=(t=(a.status??"").toLowerCase()).includes("add")||t.includes("create")?"create":t.includes("delete")||t.includes("remove")?"delete":t.includes("update")||t.includes("modify")?"modify":t||"";return(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-[11px]",children:[(n=(a.status??"").toLowerCase(),i="shrink-0 text-muted-foreground/70",n.includes("add")||n.includes("create")?(0,s.jsx)(sR.FilePlus,{size:11,className:i}):n.includes("delete")||n.includes("remove")?(0,s.jsx)(sO,{size:11,className:i}):n.includes("update")||n.includes("modify")?(0,s.jsx)(sI.FilePen,{size:11,className:i}):(0,s.jsx)(sx.default,{size:11,className:i})),(0,s.jsx)("span",{className:"font-mono break-all text-foreground/90",children:a.path}),r&&(0,s.jsxs)("span",{className:"shrink-0 text-muted-foreground/60",children:["(",r,")"]})]})},sD=(0,c.memo)(e=>{let{entry:t}=e,[n,i]=(0,c.useState)(!1),a=sA[t.status],r="pending"===t.status?"animate-pulse":"",o=t.files.length,l=!1!==t.success;return(0,s.jsx)("div",{className:"animate-in fade-in py-1 duration-150",role:"article",children:(0,s.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,s.jsx)(sx.default,{size:12,className:(0,rW.cn)("mt-0.5 shrink-0",a,r)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"text-xs",children:[(0,s.jsx)("span",{className:"font-medium text-foreground/90",children:"Patch"}),(0,s.jsx)("span",{className:"ml-1.5 text-muted-foreground",children:o>0?`${o}개 파일 수정`:"파일 정보 없음"}),(0,s.jsx)("span",{className:"ml-1.5 text-muted-foreground/60",children:"·"}),(0,s.jsx)("span",{className:(0,rW.cn)("ml-1.5",l?"text-muted-foreground":"text-negative"),children:"pending"===t.status?"진행 중":l?"성공":"실패"})]}),o>0&&(0,s.jsx)("div",{className:"mt-1 ml-0.5 space-y-0.5",children:t.files.map((e,t)=>(0,s.jsx)(sw,{file:e},`${e.path}-${t}`))}),t.diff&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),"aria-expanded":n,className:"mt-1 inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground",children:[n?(0,s.jsx)(sp.ChevronDown,{size:10}):(0,s.jsx)(sg.ChevronRight,{size:10}),(0,s.jsx)("span",{children:n?"Diff 숨기기":"Diff 보기"})]}),n&&(0,s.jsx)("div",{className:"mt-1.5 max-h-[400px] overflow-auto rounded border border-border/40 bg-muted/40 p-2 font-mono text-[11px]",children:(0,s.jsx)("pre",{className:"whitespace-pre-wrap break-words text-foreground/90",children:t.diff})})]})]})]})})});e.s(["default",0,sD],835591);let sL=(0,sT.default)("combine",[["path",{d:"M14 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"1l7d7l"}],["path",{d:"M19 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"9955pe"}],["path",{d:"m7 15 3 3",key:"4hkfgk"}],["path",{d:"m7 21 3-3H5a2 2 0 0 1-2-2v-2",key:"1xljwe"}],["rect",{x:"14",y:"14",width:"7",height:"7",rx:"1",key:"1cdgtw"}],["rect",{x:"3",y:"3",width:"7",height:"7",rx:"1",key:"zi3rio"}]]),sM=e=>null==e?"?":e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e),sk=(0,c.memo)(e=>{let{entry:t}=e,n=(0,rH.useTranslations)("timeline"),i=t.beforeTokens,a=t.afterTokens,r=null!=i&&null!=a&&i>0?Math.round((i-a)/i*100):null;return(0,s.jsxs)("div",{className:"animate-in fade-in flex items-center gap-1.5 py-1 text-xs text-muted-foreground/70 duration-150",children:[(0,s.jsx)(sL,{size:12,className:"shrink-0"}),(0,s.jsx)("span",{children:n("contextCompacted")}),null!=i&&null!=a&&(0,s.jsxs)("span",{className:"tabular-nums",children:[sM(i)," → ",sM(a)," tokens",null!=r&&r>0&&(0,s.jsxs)("span",{className:"ml-1 text-muted-foreground/60",children:["(-",r,"%)"]})]})]})});e.s(["default",0,sk],137073)},87093,e=>{"use strict";var t=e.i(391398),n=e.i(140032),i=e.i(453783),a=e.i(191788),r=e.i(352819),s=e.i(21152),o=e.i(53073),l=e.i(867202),c=e.i(709532),d=e.i(536838),u=e.i(552797),m=e.i(817885),_=e.i(199648),p=e.i(895764),g=e.i(939310),f=e.i(457619),h=e.i(116925),E=e.i(901160),S=e.i(748486),b=e.i(387561),v=e.i(912643),T=e.i(865013),y=e.i(815226),C=e.i(864852),N=e.i(801230),x=e.i(954996),R=e.i(42054),O=e.i(44158),I=e.i(333711),A=e.i(427285),w=e.i(835591),D=e.i(137073),L=e.i(880179),M=e.i(444957),k=e.i(377216),P=e.i(470656),F=e.i(586034),U=e.i(979195),B=e.i(353533);let G={error:{Icon:U.XCircle,label:"Error",containerClass:"border-negative/40 bg-negative/5",iconClass:"text-negative",labelClass:"text-negative"},warning:{Icon:L.AlertTriangle,label:"Warning",containerClass:"border-ui-amber/40 bg-ui-amber/5",iconClass:"text-ui-amber",labelClass:"text-ui-amber"},"stream-error":{Icon:F.WifiOff,label:"Stream error",containerClass:"border-ui-amber/40 bg-ui-amber/5",iconClass:"text-ui-amber",labelClass:"text-ui-amber"},"guardian-warning":{Icon:P.Shield,label:"Guardian",containerClass:"border-ui-purple/40 bg-ui-purple/5",iconClass:"text-ui-purple",labelClass:"text-ui-purple"}},j=(0,a.memo)(e=>{let{entry:n}=e,i=G[n.severity],r=i.Icon,s=n.message??"",o=s.length>200||s.includes("\n"),[l,c]=(0,a.useState)(!1),d=o&&!l?s.slice(0,200)+"…":s;return(0,t.jsx)("div",{className:"animate-in fade-in py-1 duration-150",role:"alert",children:(0,t.jsx)("div",{className:(0,B.cn)("rounded-md border px-3 py-2",i.containerClass),children:(0,t.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,t.jsx)(r,{size:14,className:(0,B.cn)("mt-0.5 shrink-0",i.iconClass)}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:(0,B.cn)("text-xs font-medium",i.labelClass),children:i.label}),"stream-error"===n.severity&&n.retryStatus&&(0,t.jsx)("span",{className:"rounded-sm bg-ui-amber/15 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-ui-amber",children:n.retryStatus}),n.errorCode&&(0,t.jsx)("span",{className:"rounded-sm bg-muted/60 px-1.5 py-0.5 text-[10px] font-mono text-muted-foreground",children:n.errorCode})]}),(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-xs text-foreground/90",children:d}),o&&(0,t.jsxs)("button",{type:"button",onClick:()=>c(e=>!e),"aria-expanded":l,className:"mt-1 inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground",children:[l?(0,t.jsx)(M.ChevronDown,{size:10}):(0,t.jsx)(k.ChevronRight,{size:10}),(0,t.jsx)("span",{children:l?"접기":"자세히 보기"})]})]})]})})})});var Y=e.i(635255);let H=(e,t)=>{let n=e.getBoundingClientRect(),i=t.getBoundingClientRect();return n.top-i.top+t.scrollTop},V=e=>{let{since:n}=e,[i,r]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=()=>r(Math.max(0,Math.floor((Date.now()-n)/1e3)));e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[n]);let s=String(Math.floor(i/60)).padStart(2,"0"),o=String(i%60).padStart(2,"0");return(0,t.jsxs)("span",{className:"tabular-nums",children:[s,":",o]})},$=(e,t)=>({calls:[e],results:t?[t]:[]}),z=/^\*\*\*\s+(Add|Update|Delete)\s+File:\s+(.+?)\s*$/i,q=/^\*\*\*\s+Move to:\s+(.+?)\s*$/i,W=e=>{switch(e.type){case"exec-command-stream":let t,n,i,a;return t=e.parsedCommand??e.command,i=(n=(e=>{let t=e.trim();if(!t)return"";let n=t.split("\n");return n.length>1?`${n.length} lines`:t.slice(0,100)})("error"===e.status&&e.stderr||e.stdout)).match(/^(\d+) lines$/),a="success"===e.status&&i?`$ ${t} → ${i[1]} lines`:`$ ${t}`,$({id:e.id,type:"tool-call",timestamp:e.timestamp,toolUseId:e.callId,toolName:"Bash",summary:a,status:e.status},n&&!i?{id:`${e.id}:result`,type:"tool-result",timestamp:e.timestamp,toolUseId:e.callId,isError:"error"===e.status,summary:n}:void 0);case"web-search":let r;return r=e.resultsSummary??(null!=e.resultCount?`${e.resultCount} results`:""),$({id:e.id,type:"tool-call",timestamp:e.timestamp,toolUseId:e.callId,toolName:"WebSearch",summary:e.query?`WebSearch "${e.query}"`:"WebSearch",status:e.status},r?{id:`${e.id}:result`,type:"tool-result",timestamp:e.timestamp,toolUseId:e.callId,isError:"error"===e.status,summary:r}:void 0);case"mcp-tool-call":return $({id:e.id,type:"tool-call",timestamp:e.timestamp,toolUseId:e.callId,toolName:"MCP",summary:`MCP ${e.server||"?"}/${e.tool||"?"}`,status:e.status},e.resultSummary?{id:`${e.id}:result`,type:"tool-result",timestamp:e.timestamp,toolUseId:e.callId,isError:"error"===e.status,summary:e.resultSummary}:void 0);case"patch-apply":let s=(e=>{if(!e)return[];let t=[],n=null,i=()=>{n&&((n.oldLines.length>0||n.newLines.length>0||n.added>0||n.removed>0)&&t.push(n),n=null)};for(let t of e.split("\n")){let e=t.match(z);if(e){i(),n={status:e[1].toLowerCase(),filePath:e[2],oldLines:[],newLines:[],added:0,removed:0};continue}if(!n)continue;let a=t.match(q);if(a){n.filePath=a[1];continue}if(t.startsWith("@@")||t.startsWith("***"))continue;let r=t[0],s=t.slice(1);"+"===r?(n.newLines.push(s),n.added+=1):"-"===r?(n.oldLines.push(s),n.removed+=1):" "===r&&(n.oldLines.push(s),n.newLines.push(s))}return i(),t.map(e=>{let t=e.oldLines.join("\n"),n=e.newLines.join("\n"),{added:i,removed:a}=((e,t)=>{let n=0,i=0;for(let a of(0,m.diffLines)(e,t)){let e=a.count??0;a.added?n+=e:a.removed&&(i+=e)}return{added:n,removed:i}})(t,n);return{filePath:e.filePath,status:e.status,oldString:t,newString:n,added:i,removed:a}})})(e.diff);if(s.length>0)return{calls:s.map((t,n)=>{let i;return{id:`${e.id}:${n}`,type:"tool-call",timestamp:e.timestamp,toolUseId:`${e.callId}:${n}`,toolName:"Edit",summary:`${(i=t.status.toLowerCase()).includes("add")||i.includes("create")?"Create":i.includes("delete")||i.includes("remove")?"Delete":"Update"} ${t.filePath} (+${t.added}, -${t.removed})`,filePath:t.filePath,diff:{filePath:t.filePath,oldString:t.oldString,newString:t.newString},status:e.status}}),results:[]};let o=e.files.length;if(0===o&&"success"===e.status)return{calls:[],results:[]};let l=0===o?"files":1===o?e.files[0].path:`${o} ${1===o?"file":"files"}`;return $({id:e.id,type:"tool-call",timestamp:e.timestamp,toolUseId:e.callId,toolName:"Edit",summary:`Patch ${l}`,status:e.status});default:return null}},Q=()=>{let e=(0,r.useTranslations)("timeline");return(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1.5 py-1 text-xs text-muted-foreground/60",children:[(0,t.jsx)(l.OctagonX,{size:12}),(0,t.jsx)("span",{children:e("requestCancelled")})]})},K=()=>{let e=(0,r.useTranslations)("timeline");return(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1.5 py-1 text-xs text-muted-foreground/60",children:[(0,t.jsx)(c.LogOut,{size:12}),(0,t.jsx)("span",{children:e("sessionExit")})]})},X=e=>{let{entry:n,sessionName:i,tabId:a,sessionId:r}=e;switch(n.type){case"user-message":return(0,t.jsx)(f.default,{entry:n});case"assistant-message":return(0,t.jsx)(h.default,{entry:n});case"agent-group":return(0,t.jsx)(E.default,{entry:n});case"task-notification":return(0,t.jsx)(S.default,{entry:n});case"plan":return(0,t.jsx)(v.default,{entry:n,sessionName:i});case"ask-user-question":return(0,t.jsx)(T.default,{entry:n,sessionName:i,tabId:a,agentSessionId:r});case"task-progress":return(0,t.jsx)(C.default,{entry:n});case"interrupt":return(0,t.jsx)(Q,{});case"session-exit":return(0,t.jsx)(K,{});case"approval-request":return(0,t.jsx)(R.default,{entry:n});case"exec-command-stream":return(0,t.jsx)(O.default,{entry:n});case"web-search":return(0,t.jsx)(I.default,{entry:n});case"mcp-tool-call":return(0,t.jsx)(A.default,{entry:n});case"patch-apply":return(0,t.jsx)(w.default,{entry:n});case"context-compacted":return(0,t.jsx)(D.default,{entry:n});case"reasoning-summary":default:return null;case"error-notice":return(0,t.jsx)(j,{entry:n})}},Z=()=>(0,t.jsx)("div",{className:"chat-content",children:(0,t.jsx)("div",{className:"animate-delayed-fade-in flex flex-col gap-4 p-4",children:[48,36,40].map((e,n)=>(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("div",{className:"h-4 animate-pulse rounded bg-claude-active/20",style:{width:`${e}%`}}),(0,t.jsx)("div",{className:"h-4 animate-pulse rounded bg-claude-active/20",style:{width:`${e-10}%`}})]},n))})}),J=e=>{let{error:n,onRetry:i,showRefresh:a}=e,l=(0,r.useTranslations)("timeline"),c=(0,r.useTranslations)("common");return(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(s.Terminal,{size:32,className:"opacity-40"}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:l("connectionError")}),(0,t.jsx)("p",{className:"mt-1 text-xs",children:n})]}),(0,t.jsxs)(g.Button,{variant:"outline",size:"xs",onClick:i,children:[(0,t.jsx)(o.RefreshCw,{size:12}),c("retry")]}),a&&(0,t.jsxs)(g.Button,{variant:"ghost",size:"xs",onClick:()=>(0,Y.reloadForReconnectRecovery)("timeline"),children:[(0,t.jsx)(o.RefreshCw,{size:12}),c("refresh")]})]})},ee=()=>{let e=(0,r.useTranslations)("timeline");return(0,t.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-3 z-10 flex justify-center",children:(0,t.jsxs)("div",{className:"pointer-events-auto flex items-center gap-1.5 rounded-full bg-muted px-3 py-1 text-xs text-muted-foreground shadow-sm",children:[(0,t.jsx)(_.default,{size:10}),e("reconnecting")]})})},et=e=>{let{onRetry:n}=e,i=(0,r.useTranslations)("timeline"),a=(0,r.useTranslations)("common");return(0,t.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-3 z-10 flex justify-center",children:(0,t.jsxs)("div",{className:"pointer-events-auto flex items-center gap-1.5 rounded-full bg-muted px-3 py-1 text-xs text-muted-foreground shadow-sm",children:[(0,t.jsx)("span",{children:i("connectionFailed")}),(0,t.jsx)(g.Button,{variant:"outline",size:"xs",className:"h-5 rounded-full px-2 text-xs",onClick:n,children:a("retry")})]})})},en=()=>{let e=(0,r.useTranslations)("timeline");return(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(u.MessageSquareMore,{size:32,className:"opacity-40"}),(0,t.jsx)("p",{className:"text-xs",children:e("emptyRunning")})]})};e.s(["default",0,e=>{let{entries:s,tasks:o,sessionId:l,sessionName:c,tabId:u,cwd:m,initMeta:f,sessionStats:h,cliState:E,compactingSince:S,wsStatus:v,isLoading:T,error:C,onRetry:R,onLoadMore:O,hasMore:I,scrollToBottomRef:A}=e,w=(0,r.useTranslations)("timeline"),D=(0,i.default)(e=>u?e.metadata[u]?.cwd:void 0),L="needs-input"===E,M=null!=S&&Date.now()-S<6e4,k=(0,a.useRef)(null),P=(0,a.useRef)(null),F=(0,a.useRef)(null),U=(0,a.useRef)(!1),B=(0,a.useRef)(!1),G=(0,a.useRef)(!1),{scrollRef:j,contentRef:$,scrollToBottom:z}=(0,p.useStickToBottom)({resize:{damping:.8,stiffness:.05},initial:"instant",targetScrollTop:(e,t)=>{let{scrollElement:n}=t,i=k.current;return i?H(i,n)-12:e}}),[q,Q]=(0,a.useState)(null),[K,ei]=(0,a.useState)(0),[ea,er]=(0,a.useState)(!0),[es,eo]=(0,a.useState)(l),[el,ec]=(0,a.useState)(!1),ed=s.some(e=>"user-message"===e.type&&!0===e.pending);es!==l&&(eo(l),ed||(er(!0),Q(null)),U.current=!1,B.current=!1,G.current=!1),(0,a.useEffect)(()=>{if(A)return A.current=()=>{U.current=!0,z("smooth"),setTimeout(()=>z("smooth"),300)},()=>{A.current=void 0}},[A,z]);let eu=(0,a.useMemo)(()=>(e=>{let t=[],n=[],i=[],a=()=>{n.length>0&&(t.push({type:"tool-group",id:n[0].id,toolCalls:[...n],toolResults:[...i]}),n=[],i=[])};for(let r of e)if("tool-call"===r.type)n.push(r);else if("tool-result"===r.type)i.push(r);else{let e=W(r);if(e){n.push(...e.calls),i.push(...e.results);continue}a(),t.push({type:"entry",id:r.id,entry:r})}return a(),t})(s),[s]),em=eu.length>0,e_=(0,a.useMemo)(()=>eu.findLast(e=>"entry"===e.type&&"user-message"===e.entry.type)?.id??null,[eu]);(0,a.useEffect)(()=>{if(U.current&&e_&&e_!==q){Q(e_),U.current=!1;return}q&&e_&&e_!==q&&(s.some(e=>e.id===q)||Q(e_))},[e_,q,s]);let[ep,eg]=(0,a.useState)(!1),ef=h?.currentContextTokens??0,eh=`${E}:${ef}:${f?.lastTimestamp??0}:${c??""}`;(0,a.useEffect)(()=>{if("idle"!==E||!f||!c||ef<1e5||!f.lastTimestamp)return void eg(!1);let e=()=>{eg((Date.now()-f.lastTimestamp)/6e4>=70)};e();let t=setInterval(e,6e4);return()=>clearInterval(t)},[eh]),(0,a.useEffect)(()=>{ea&&s.length>0&&(z("instant"),requestAnimationFrame(()=>er(!1)))},[ea,s.length,z]);let eE=(0,a.useCallback)(()=>{let e=j.current,t=k.current,n=P.current;if(!e||!t||!n)return;let i=t.offsetTop+t.offsetHeight,a=Math.max(0,n.offsetTop-i),r=Math.max(0,e.clientHeight-t.offsetHeight-12-a);ei(e=>e===r?e:r)},[j]),eS=(0,a.useCallback)(()=>{let e=j.current,t=k.current,n=P.current;if(!e||!t||!n)return;let i=n.offsetHeight;if(0===i)return;let a=e.scrollTop,r=t.offsetTop+t.offsetHeight,s=Math.max(0,n.offsetTop-r),o=Math.max(0,e.clientHeight-t.offsetHeight-12-s),l=a>=Math.max(0,H(t,e)-12)-2?o:0;if(i<=l)return;let c=Math.min(i-l,Math.max(0,e.scrollHeight-e.clientHeight-a));c<=0||ei(i-c)},[j]),eb=(0,a.useCallback)(()=>{q&&"busy"!==E&&(G.current=!0,requestAnimationFrame(()=>{eS(),setTimeout(eS,300)}))},[q,E,eS]);(0,a.useLayoutEffect)(()=>{(B.current=!1,G.current=!1,q)?eE():ei(0)},[q,eE]),(0,a.useEffect)(()=>{let e=j.current;if(!e)return;let t=new ResizeObserver(()=>eE());return t.observe(e),()=>t.disconnect()},[j,eE]),(0,a.useEffect)(()=>{let e=$.current;if(!e)return;let t=new ResizeObserver(()=>{G.current&&eS()});return t.observe(e),()=>t.disconnect()},[$,eS]),(0,a.useEffect)(()=>{if(q){if("busy"===E){B.current=!0,G.current=!1;return}if(B.current)B.current=!1,G.current=!0;else if(!G.current){let e=s.findLastIndex(e=>e.id===q);e>=0&&s.length>e+1&&(G.current=!0)}G.current&&eS()}},[E,q,s,eS]),(0,a.useEffect)(()=>{let e=()=>{"hidden"!==document.visibilityState&&eb()};return document.addEventListener("visibilitychange",e),window.addEventListener("focus",e),window.addEventListener("pageshow",e),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("focus",e),window.removeEventListener("pageshow",e)}},[eb]);let ev=!T&&!C&&em&&!ea;(0,a.useEffect)(()=>{if(!ev)return;let e=j.current,t=F.current;if(!e||!t)return;let n=new IntersectionObserver(e=>{let[t]=e;if(t.isIntersecting)return void ec(!1);let n=t.rootBounds,i=t.boundingClientRect;ec(!!n&&i.top>=n.bottom)},{root:e,threshold:0,rootMargin:"0px 0px 4px 0px"});return n.observe(t),()=>n.disconnect()},[ev,j]);let eT=(0,a.useRef)(!1),[ey,eC]=(0,a.useState)(!1),eN="u">typeof CSS&&!CSS.supports?.("overflow-anchor","auto"),ex=(0,a.useRef)(null),eR=(0,a.useCallback)(()=>{if(I&&!eT.current){if(eT.current=!0,eC(!0),eN){let e=j.current;e&&(ex.current={scrollHeight:e.scrollHeight})}O().finally(()=>{eT.current=!1,eC(!1)})}},[I,O,j,eN]);return((0,a.useLayoutEffect)(()=>{if(!eN)return;let e=ex.current,t=j.current;if(!e||!t||ey)return;let n=t.scrollHeight-e.scrollHeight;n>0&&(t.scrollTop+=n),ex.current=null},[ey,j,eN]),T&&"disconnected"===v)?(0,t.jsx)(J,{error:w("connectionFailed"),onRetry:R,showRefresh:(0,Y.shouldPromptMobileReloadRecovery)()}):T?(0,t.jsx)(Z,{}):C?(0,t.jsx)(J,{error:C,onRetry:R}):em?(0,t.jsxs)("div",{className:"relative flex h-full flex-col",children:[(0,t.jsx)("div",{ref:j,className:"flex-1 overflow-y-auto py-2 transition-opacity",style:{opacity:+!ea,transitionDuration:"300ms"},tabIndex:0,role:"log","aria-label":w("timelineAria"),children:(0,t.jsxs)("div",{ref:$,className:"region-typography-messages chat-content",children:[I&&!ey&&(0,t.jsx)("div",{className:"flex justify-center py-2",children:(0,t.jsxs)(g.Button,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground",onClick:eR,children:[(0,t.jsx)(d.ChevronsUp,{size:12,className:"mr-1"}),w("loadMore")]})}),ey&&(0,t.jsx)("div",{className:"flex flex-col gap-3 px-4 py-3",children:[44,32,48].map((e,n)=>(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("div",{className:"h-3.5 animate-pulse rounded bg-muted/60",style:{width:`${e}%`}}),(0,t.jsx)("div",{className:"h-3.5 animate-pulse rounded bg-muted/60",style:{width:`${e-12}%`}})]},n))}),o.length>0&&(0,t.jsx)(y.default,{tasks:o,cliState:E}),(0,t.jsx)(n.EditorCwdContext.Provider,{value:D||m,children:eu.map(e=>(0,t.jsx)("div",{ref:e.id===q?k:void 0,className:"px-4 py-1.5",children:"tool-group"===e.type?(0,t.jsx)(b.default,{toolCalls:e.toolCalls,toolResults:e.toolResults}):(0,t.jsx)(X,{entry:e.entry,sessionName:c,tabId:u,sessionId:l})},e.id))}),(ep||L)&&c&&(0,t.jsx)("div",{className:"px-4 py-1.5",children:(0,t.jsx)(x.default,{sessionName:c,tabId:u,silent:ep&&!L})}),"busy"===E&&!L&&(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground",children:[(0,t.jsx)(_.default,{size:10,className:"text-claude-active"}),(0,t.jsx)(V,{since:s[s.length-1].timestamp})]}),M&&(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground",children:[(0,t.jsx)(_.default,{size:10,className:"text-claude-active"}),(0,t.jsx)("span",{children:w("contextCompacting")})]}),(0,t.jsx)("div",{ref:F,"aria-hidden":!0,style:{height:0,overflowAnchor:"none"}}),(0,t.jsx)("div",{ref:P,"aria-hidden":!0,style:{height:K,overflowAnchor:"none"}})]})}),"reconnecting"===v&&(0,t.jsx)(ee,{}),"disconnected"===v&&(0,t.jsx)(et,{onRetry:R}),(0,t.jsx)(N.default,{visible:el,onClick:()=>{let e=j.current;if(!e)return;let t=P.current?.offsetHeight??0;e.scrollTo({top:e.scrollHeight-t,behavior:"smooth"})}})]}):(0,t.jsx)(en,{})}],87093)},815075,905461,704595,577077,456255,173722,e=>{"use strict";var t=e.i(205270);let n=(0,t.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["Paperclip",0,n],815075);let i=(0,t.default)("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);e.s(["SendHorizontal",0,i],905461);var a=e.i(950323);let r={messages:[],sending:!1,error:null},s=async e=>{try{let t=await e.json();if(t&&"string"==typeof t.error&&t.error.length>0)return t.error}catch{}return`${e.status} ${e.statusText||"request failed"}`},o=async(e,t)=>{let n=await fetch(e,t);if(!n.ok)throw Error(await s(n));return n.json()};e.s(["default",0,(e,t)=>{let n=e&&t?`/api/input-queue?${new URLSearchParams({workspaceId:e,tabId:t})}`:null,{data:i,mutate:s}=(0,a.default)(n,o,{refreshInterval:1e3}),l=async(e,t)=>{if(!n)throw Error("Missing queue target");let i=await o(n,{method:e,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});await s(i,!1)};return{...i??r,enqueue:e=>l("POST",e),submitNow:()=>l("POST",{action:"submit-now"}),remove:e=>l("DELETE",{id:e})}}],704595);var l=e.i(191788),c=e.i(117653),d=e.i(505888),u=e.i(745725);let m={entries:[],isLoading:!1,isError:!1},_=(e,t)=>e.byWsId[t]??m,p=(0,d.create)((e,t)=>({byWsId:{},fetchHistory:async t=>{e(e=>({byWsId:{...e.byWsId,[t]:{..._(e,t),isLoading:!0,isError:!1}}}));try{let n=await fetch(`/api/message-history?wsId=${encodeURIComponent(t)}`);if(!n.ok)throw Error("fetch failed");let i=await n.json();e(e=>({byWsId:{...e.byWsId,[t]:{entries:i.entries,isLoading:!1,isError:!1}}}))}catch{e(e=>({byWsId:{...e.byWsId,[t]:{..._(e,t),isLoading:!1,isError:!0}}}))}},addHistory:async(t,n)=>{let i=n.trim();if(!i||i.startsWith("/"))return;let a=`temp-${(0,u.nanoid)()}`,r={id:a,message:i,sentAt:new Date().toISOString()};e(e=>{let n=_(e,t),a=[r,...n.entries.filter(e=>e.message!==i)];return{byWsId:{...e.byWsId,[t]:{...n,entries:a.length>500?a.slice(0,500):a}}}});try{let n=await fetch("/api/message-history",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({wsId:t,message:i})});if(n.ok){let i=await n.json();e(e=>{let n=_(e,t);return{byWsId:{...e.byWsId,[t]:{...n,entries:n.entries.map(e=>e.id===a?i.entry:e)}}}})}}catch{}},deleteHistory:async(n,i)=>{let a=_(t(),n).entries;e(e=>{let t=_(e,n);return{byWsId:{...e.byWsId,[n]:{...t,entries:t.entries.filter(e=>e.id!==i)}}}});try{if(!(await fetch("/api/message-history",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({wsId:n,id:i})})).ok)throw Error("delete failed")}catch{e(e=>({byWsId:{...e.byWsId,[n]:{..._(e,n),entries:a}}}))}}}));e.s(["default",0,e=>{let{wsId:t}=e,{entries:n,isLoading:i,isError:a}=p((0,c.useShallow)(e=>t?e.byWsId[t]??m:m)),r=p(e=>e.fetchHistory),s=p(e=>e.addHistory),o=p(e=>e.deleteHistory),d=(0,l.useCallback)(async()=>{t&&await r(t)},[t,r]),u=(0,l.useCallback)(async e=>{t&&await s(t,e)},[t,s]),_=(0,l.useCallback)(async e=>{t&&await o(t,e)},[t,o]);return(0,l.useEffect)(()=>{t&&r(t)},[t,r]),{entries:n,isLoading:i,isError:a,fetchHistory:d,addHistory:u,deleteHistory:_}}],577077);var g=e.i(391398),f=e.i(352819),h=e.i(212283);e.s(["default",0,e=>{let{open:t,onOpenChange:n,onConfirm:i}=e,a=(0,f.useTranslations)("terminal"),r=(0,f.useTranslations)("common");return(0,g.jsx)(h.AlertDialog,{open:t,onOpenChange:n,children:(0,g.jsxs)(h.AlertDialogContent,{children:[(0,g.jsxs)(h.AlertDialogHeader,{children:[(0,g.jsx)(h.AlertDialogTitle,{children:a("interruptTitle")}),(0,g.jsx)(h.AlertDialogDescription,{children:a("interruptDescription")})]}),(0,g.jsxs)(h.AlertDialogFooter,{children:[(0,g.jsx)(h.AlertDialogCancel,{children:r("cancel")}),(0,g.jsx)(h.AlertDialogAction,{variant:"destructive",onClick:()=>{i(),n(!1)},children:a("interruptConfirm")})]})]})})}],456255);var E=e.i(494834),S=e.i(909725),b=e.i(939310),v=e.i(348370),T=e.i(978094);e.s(["default",0,e=>{let{open:t,onOpenChange:n,entries:i,isLoading:a,isError:r,onFetch:s,onSelect:o,onDelete:c,trigger:d}=e,u=(0,f.useTranslations)("messageHistory"),[m,_]=(0,l.useState)(""),[p,h]=(0,l.useState)(!1);return t!==p&&(h(t),t&&_("")),(0,l.useEffect)(()=>{t&&s()},[t,s]),(0,g.jsxs)(v.Popover,{open:t,onOpenChange:n,children:[(0,g.jsx)(v.PopoverTrigger,{render:d}),(0,g.jsx)(v.PopoverContent,{side:"top",align:"start",sideOffset:8,className:"w-80 p-0",children:(0,g.jsxs)(T.Command,{className:"rounded-lg",shouldFilter:!0,children:[(0,g.jsx)(T.CommandInput,{placeholder:u("searchPlaceholder"),value:m,onValueChange:_}),(0,g.jsx)(T.CommandList,{className:"max-h-[300px]",children:a&&0===i.length?(0,g.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:u("loading")}):r?(0,g.jsxs)("div",{className:"flex flex-col items-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,g.jsx)("span",{children:u("fetchError")}),(0,g.jsx)(b.Button,{variant:"outline",size:"sm",onClick:s,children:u("retry")})]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(T.CommandEmpty,{children:m?u("noSearchResults"):u("noHistory")}),(0,g.jsx)(T.CommandGroup,{children:i.map(e=>(0,g.jsxs)(T.CommandItem,{value:e.message,onSelect:()=>{o(e.message),n(!1)},className:"group [&>svg.ml-auto]:hidden",children:[(0,g.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm",children:e.message.split("\n")[0]}),(0,g.jsx)("span",{className:"ml-2 shrink-0 text-xs text-muted-foreground whitespace-nowrap",children:(0,E.default)(e.sentAt).fromNow()}),(0,g.jsx)("button",{type:"button",className:"ml-1 shrink-0 rounded p-0.5 opacity-0 transition-opacity hover:bg-muted group-hover:opacity-100",onClick:t=>{var n;return n=e.id,void(t.stopPropagation(),t.preventDefault(),c(n))},"aria-label":u("deleteLabel"),children:(0,g.jsx)(S.X,{className:"size-3"})})]},e.id))})]})})]})})]})}],173722)},148141,483241,624306,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(352819),a=e.i(745725),r=e.i(679935),s=e.i(727487),o=e.i(340522),l=e.i(143100),c=e.i(815075),d=e.i(905461),u=e.i(30349),m=e.i(909725),_=e.i(353533),p=e.i(939310),g=e.i(358915),f=e.i(704595),h=e.i(733456),E=e.i(577077),S=e.i(535099),b=e.i(456255),v=e.i(484862),T=e.i(173722),y=e.i(494834),C=e.i(57098),N=e.i(978094);let x=e=>{let{open:a,onOpenChange:r,entries:s,isLoading:o,isError:l,onFetch:c,onSelect:d,onDelete:u,trigger:_}=e,g=(0,i.useTranslations)("messageHistory"),[f,h]=(0,n.useState)(""),[E,S]=(0,n.useState)(!1);return a!==E&&(S(a),a&&h("")),(0,n.useEffect)(()=>{a&&c()},[a,c]),(0,t.jsxs)(C.Drawer,{open:a,onOpenChange:r,children:[(0,t.jsx)(C.DrawerTrigger,{asChild:!0,children:_}),(0,t.jsxs)(C.DrawerContent,{className:"max-h-[60vh]",children:[(0,t.jsx)(C.DrawerHeader,{className:"sr-only",children:(0,t.jsx)(C.DrawerTitle,{children:g("title")})}),(0,t.jsxs)(N.Command,{className:"rounded-none",shouldFilter:!0,children:[(0,t.jsx)("div",{className:"p-2 pb-0",children:(0,t.jsx)(N.CommandInput,{placeholder:g("searchPlaceholder"),value:f,onValueChange:h})}),(0,t.jsx)(N.CommandList,{className:"max-h-[50vh] p-2","data-vaul-no-drag":!0,children:o&&0===s.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:g("loading")}):l?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:g("fetchError")}),(0,t.jsx)(p.Button,{variant:"outline",size:"sm",onClick:c,children:g("retry")})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.CommandEmpty,{children:f?g("noSearchResults"):g("noHistory")}),(0,t.jsx)(N.CommandGroup,{children:s.map(e=>(0,t.jsxs)(N.CommandItem,{value:e.message,onSelect:()=>{d(e.message),r(!1)},className:"group min-h-[44px] [&>svg.ml-auto]:hidden",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm",children:e.message.split("\n")[0]}),(0,t.jsx)("span",{className:"ml-2 shrink-0 text-xs text-muted-foreground whitespace-nowrap",children:(0,y.default)(e.sentAt).fromNow()}),(0,t.jsx)("button",{type:"button",className:"ml-1 shrink-0 rounded p-0.5 hover:bg-muted",onClick:t=>{var n;return n=e.id,void(t.stopPropagation(),t.preventDefault(),u(n))},"aria-label":g("deleteLabel"),children:(0,t.jsx)(m.X,{className:"size-3"})})]},e.id))})]})})]})]})]})},R=e=>{let{entries:a,isLoading:r,isError:s,disabled:o,onFetch:l,onSelect:c,onDelete:d,onClose:u}=e,m=(0,i.useTranslations)("terminal"),[g,f]=(0,n.useState)(!1),E=(0,h.default)(),S=0===a.length&&!r,b={open:g,onOpenChange:e=>{f(e),e||u?.()},entries:a,isLoading:r,isError:s,onFetch:l,onSelect:e=>{c(e),f(!1)},onDelete:d,trigger:(0,t.jsx)(p.Button,{variant:"ghost",size:"sm",className:(0,_.cn)("h-7 w-7 shrink-0 self-end p-0 text-muted-foreground hover:text-foreground hover:bg-muted",(o||S)&&"opacity-50 pointer-events-none"),disabled:o||S,"aria-label":m("messageHistory"),children:(0,t.jsx)(v.Clock,{size:16})})};return E?(0,t.jsx)(x,{...b}):(0,t.jsx)(T.default,{...b})},O=new Set(["image/png","image/jpeg","image/gif","image/webp"]),I=new Set(["image/jpeg","image/webp"]),A=e=>O.has(e.type??""),w=async e=>{let t;if(!I.has(e.type)||"function"!=typeof createImageBitmap)return e;try{t=await createImageBitmap(e,{imageOrientation:"from-image"})}catch{return e}try{let n=document.createElement("canvas");n.width=t.width,n.height=t.height;let i=n.getContext("2d");if(!i)return e;i.drawImage(t,0,0);let a=await new Promise(t=>n.toBlob(t,e.type,.92));if(!a)return e;return new File([a],e.name,{type:e.type,lastModified:e.lastModified})}finally{t.close?.()}},D=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!A(e))throw Error(`Unsupported image type: ${e.type}`);if(e.size>0xa00000)throw Error("Image exceeds 10485760 bytes");let n=await w(e),i=n.size<=0xa00000?n:e,a={"Content-Type":i.type,"X-Pmux-Filename":encodeURIComponent(i.name||"image")};t.wsId&&(a["X-Pmux-Ws-Id"]=t.wsId),t.tabId&&(a["X-Pmux-Tab-Id"]=t.tabId);let r=await fetch("/api/upload-image",{method:"POST",headers:a,body:i});if(!r.ok)throw Error((await r.json().catch(()=>({}))).error??`Upload failed (${r.status})`);return await r.json()};e.s(["isImageFile",0,A,"uploadImage",0,D],483241);let L=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.size>0x3200000)throw Error("File exceeds 52428800 bytes");let n={"Content-Type":e.type||"application/octet-stream","X-Pmux-Filename":encodeURIComponent(e.name||"file")};t.wsId&&(n["X-Pmux-Ws-Id"]=t.wsId),t.tabId&&(n["X-Pmux-Tab-Id"]=t.tabId);let i=await fetch("/api/upload-file",{method:"POST",headers:n,body:e});if(!i.ok)throw Error((await i.json().catch(()=>({}))).error??`Upload failed (${i.status})`);return await i.json()},M=e=>`pt-attachment-draft:${e}`;e.s(["default",0,e=>{let{tabId:v,wsId:T,agentSessionId:y,provider:C="claude",cliState:N,sendStdin:x,terminalWsConnected:O,visible:I,focusTerminal:w,focusInputRef:k,setInputValueRef:P,maxRows:F=5,onRestartSession:U,onNativeCommands:B,nativeCommandsActive:G=!1,onSend:j,onOptimisticSend:Y,attachFilesRef:H}=e,V=(0,i.useTranslations)("terminal"),$=(0,i.useTranslations)("common"),z="codex"===C,{entries:q,isLoading:W,isError:Q,fetchHistory:K,addHistory:X,deleteHistory:Z}=(0,E.default)({wsId:T}),J=(0,h.default)(),ee=(0,n.useCallback)(e=>{X(e),Y?.(e)},[X,Y]),{value:et,setValue:en,mode:ei,canSend:ea,send:er,interrupt:es,textareaRef:eo,focusInput:el}=(0,g.default)(N,x,O,{tabId:v,onRestartSession:U,onMessageSent:ee,disabledMessage:z?V("codexInactiveMessage"):V("inputDisabledPlaceholder"),submitDelayMs:250}),ec=(0,f.default)(T,v),ed=(0,n.useRef)(!1),[eu,em]=(0,n.useState)(!1),[e_,ep]=(0,n.useState)(!1),[eg,ef]=(0,n.useState)(!1),[eh,eE]=(0,n.useState)(!1),[eS,eb]=(0,n.useState)(!1),[ev,eT]=(0,n.useState)([]),ey=(0,n.useRef)(null),eC=(0,n.useRef)(null),eN=(0,n.useRef)([]),ex=(0,n.useCallback)(e=>{let t="function"==typeof e?e(eN.current):e;eN.current=t;if(v)try{t.length?localStorage.setItem(M(v),JSON.stringify(t)):localStorage.removeItem(M(v))}catch{}eT(t)},[v]);(0,n.useEffect)(()=>{let e=(e=>{if(!e)return[];try{let t=JSON.parse(localStorage.getItem(M(e))??"[]");if(!Array.isArray(t))return[];return t.filter(e=>e&&"string"==typeof e.id&&"string"==typeof e.path&&"string"==typeof e.filename&&"string"==typeof e.thumbnail&&e.thumbnail.startsWith("/api/uploads/"))}catch{return[]}})(v);eN.current=e,eT(e)},[v]),(0,n.useEffect)(()=>{eN.current=ev},[ev]),(0,n.useEffect)(()=>()=>{eN.current.forEach(e=>URL.revokeObjectURL(e.thumbnail))},[]),(0,n.useEffect)(()=>(k.current=el,P.current=en,()=>{k.current=void 0,P.current=void 0}),[el,k,en,P]),(0,n.useEffect)(()=>{I||en("")},[I,en]);let eR=(0,n.useCallback)(()=>{let e=eo.current;if(!e||(e.style.height="auto",!et))return;let t=20*F+16;e.style.height=`${Math.min(e.scrollHeight,t)}px`},[eo,F,et]);(0,n.useEffect)(()=>{eR()},[et,eR]);let eO=async()=>{if(!ea||G||ed.current||eg)return;let e=et.trim();if(!e&&!ev.length)return;if(!ev.length&&["/new","/clear"].includes(e.toLowerCase()))return void er();ed.current=!0,eE(!0);let t=[...ev];try{await ec.enqueue({id:(0,a.nanoid)(),text:et,attachments:t.map(e=>{let{path:t,filename:n}=e;return{path:t,filename:n}})}),eo.current?.value===et&&(en(""),v&&(0,g.clearInputDraft)(v)),ex(e=>e.filter(e=>!t.some(t=>t.id===e.id))),t.forEach(e=>URL.revokeObjectURL(e.thumbnail)),e&&!e.startsWith("/")&&X(e),y&&(0,S.registerPushTarget)(y),j?.()}catch(e){r.toast.error(e instanceof Error&&e.message?e.message:V("queueRequestFailed"))}finally{ed.current=!1,eE(!1)}},eI=async()=>{if(!ed.current){ed.current=!0,eE(!0);try{await ec.submitNow(),j?.()}catch(e){r.toast.error(e instanceof Error&&e.message?e.message:V("queueRequestFailed"))}finally{ed.current=!1,eE(!1)}}},eA=e=>!!B&&!!ea&&"needs-input"!==N&&"unknown"!==N&&!ev.length&&(ec.messages.length||ec.sending||eh?(r.toast.info(V("nativeCommandsQueuePending")),!1):(B(e),en(""),v&&(0,g.clearInputDraft)(v),!0)),ew=(0,n.useCallback)(e=>{en(e)},[en]),eD=(0,n.useCallback)(()=>{setTimeout(()=>eo.current?.focus(),0)},[eo]),eL=(0,n.useCallback)(e=>{ex(t=>{let n=t.find(t=>t.id===e);return n&&URL.revokeObjectURL(n.thumbnail),t.filter(t=>t.id!==e)})},[ex]),eM=(0,n.useCallback)(e=>{let t=eo.current;if(!t)return;let n=t.value,i="u">typeof document&&document.activeElement===t,a=i?t.selectionStart??n.length:n.length,r=i?t.selectionEnd??n.length:n.length,s=n.slice(0,a),o=n.slice(r),l=s.length>0&&!/\s$/.test(s)?" ":"",c=0!==o.length&&/^\s/.test(o)?"":" ",d=`${l}${e}${c}`;en(`${s}${d}${o}`),requestAnimationFrame(()=>{let e=eo.current;if(!e)return;let t=s.length+d.length;e.setSelectionRange(t,t),e.focus()})},[en,eo]),ek=(0,n.useCallback)(async e=>{if(0===e.length)return;let t=Math.max(0,20-eN.current.length);if(0===t)return void r.toast.error(V("attachmentLimitReached",{max:20}));let n=e.slice(0,t);n.length<e.length&&r.toast.warning(V("attachmentLimitReached",{max:20}));let i=(await Promise.all(n.map(async e=>({file:e,result:await D(e,{wsId:T,tabId:v})})))).map(e=>{let{file:t,result:n}=e;return{id:(0,a.nanoid)(),path:n.path,filename:t.name||"image",thumbnail:n.url||URL.createObjectURL(t)}});ex(e=>[...e,...i])},[T,v,V,ex]),eP=(0,n.useCallback)(async e=>{if(0===e.length)return;let t=(await Promise.all(e.map(e=>L(e,{wsId:T,tabId:v})))).map(e=>e.path).join(" ");t.length>0&&eM(t)},[T,v,eM]),eF=(0,n.useCallback)(async e=>{if(0===e.length)return!1;let t=e.filter(A),n=e.filter(e=>!A(e));if(0===t.length&&0===n.length)return!1;ef(!0);try{await Promise.all([ek(t),eP(n)])}catch(e){r.toast.error(e instanceof Error?e.message:"Upload failed")}finally{ef(!1)}return!0},[ek,eP]),eU=(0,n.useCallback)(()=>{eC.current?.click()},[]);(0,n.useEffect)(()=>{if(H)return H.current=eF,()=>{H.current===eF&&(H.current=void 0)}},[H,eF]);let eB=(0,n.useCallback)(async e=>{let t=e.target.files;t&&0!==t.length&&(await eF(Array.from(t)),e.target.value="")},[eF]),eG=(0,n.useCallback)(async e=>{let t=e.clipboardData?.files;if(!t||0===t.length)return;let n=Array.from(t);0!==n.length&&(e.preventDefault(),await eF(n))},[eF]),ej=(0,n.useCallback)(e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy",eS||eb(!0))},[eS]),eY=(0,n.useCallback)(e=>{e.currentTarget.contains(e.relatedTarget)||eb(!1)},[]),eH=(0,n.useCallback)(async e=>{e.dataTransfer.files&&0!==e.dataTransfer.files.length&&(e.preventDefault(),e.stopPropagation(),eb(!1),await eF(Array.from(e.dataTransfer.files)))},[eF]),eV="disabled"===ei,e$=eV||G,ez=et.trim().length>0,eq=ev.length>0,eW=ea&&!G&&(ez||eq)&&!eh&&!eg;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:(0,_.cn)("region-typography-input relative grid",I?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:[(0,t.jsx)("div",{className:(0,_.cn)("pointer-events-none absolute bottom-full left-0 right-0 transition-opacity duration-300",eV&&I?"opacity-100":"opacity-0"),"aria-hidden":!eV||!I,children:(0,t.jsx)("div",{className:"chat-content px-3 pb-1",children:(0,t.jsxs)("div",{className:"grid grid-cols-[1fr_auto_1fr] items-center px-2 text-[11px] text-muted-foreground/70",children:[(0,t.jsx)(l.Loader2,{size:10,className:"mr-1.5 justify-self-end animate-spin"}),(0,t.jsx)("span",{children:V("connecting")}),(0,t.jsx)("span",{})]})})}),(0,t.jsx)("div",{className:"overflow-hidden",children:(0,t.jsx)("div",{className:"chat-content px-3 pt-0 pb-0 animate-in fade-in duration-150",children:(0,t.jsxs)("div",{ref:ey,className:(0,_.cn)("relative z-10 flex flex-col gap-2 rounded-lg border px-3 py-2 transition-colors duration-150",e_?"border-ring bg-background":"border-border bg-black/5 dark:bg-white/5",eS&&"border-ring bg-accent/40"),onFocusCapture:()=>ep(!0),onBlurCapture:()=>ep(!1),onDragOver:ej,onDragLeave:eY,onDrop:eH,children:[eq&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:ev.map(e=>(0,t.jsxs)("div",{className:"group relative h-14 w-14 overflow-hidden rounded-md border border-border bg-background",title:e.filename,children:[(0,t.jsx)("img",{src:e.thumbnail,alt:e.filename,className:"h-full w-full object-cover"}),(0,t.jsx)("button",{type:"button",onClick:()=>eL(e.id),className:(0,_.cn)("absolute flex text-background transition-opacity group-hover:opacity-100 focus:opacity-100",J?"right-0 top-0 h-11 w-11 items-start justify-end p-1 opacity-100":"right-0.5 top-0.5 h-4 w-4 items-center justify-center opacity-0"),"aria-label":`${$("delete")}: ${e.filename}`,children:(0,t.jsx)("span",{className:(0,_.cn)("flex items-center justify-center rounded-full bg-foreground/70 hover:bg-foreground",J?"h-6 w-6":"h-4 w-4"),children:(0,t.jsx)(m.X,{size:J?14:10})})})]},e.id))}),(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsxs)("div",{className:"flex items-end",children:[(0,t.jsx)(R,{entries:q,isLoading:W,isError:Q,disabled:e$,onFetch:K,onSelect:ew,onDelete:Z,onClose:eD}),(0,t.jsx)("input",{ref:eC,type:"file",multiple:!0,className:"hidden",onChange:eB}),(0,t.jsx)(p.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 shrink-0 p-0 text-muted-foreground hover:text-foreground",onClick:eU,disabled:e$||eg,"aria-label":V("attachAriaLabel"),title:V("attachAriaLabel"),children:eg?(0,t.jsx)(l.Loader2,{size:14,className:"animate-spin"}):(0,t.jsx)(c.Paperclip,{size:14})})]}),(0,t.jsx)("textarea",{ref:eo,disabled:G,value:et,onChange:e=>{let t=e.target.value;!et&&"/"===t&&!e.nativeEvent.isComposing&&eA(t)||en(t)},onKeyDown:e=>{if(!e.nativeEvent.isComposing&&229!==e.keyCode){if("Escape"===e.key){e.preventDefault(),eo.current?.blur(),w();return}if("Enter"===e.key&&!J){if(e.shiftKey)return;e.preventDefault(),eO();return}}},onPaste:eG,placeholder:V(G?"nativeCommandsHint":"inputPlaceholder"),"aria-label":z?V("codexInputAriaLabel"):V("inputAriaLabel"),className:"flex-1 resize-none bg-transparent py-1 text-sm text-foreground outline-none placeholder:text-muted-foreground",rows:1,style:{lineHeight:"20px",maxHeight:`${20*F+16}px`,overflowY:"auto"}}),"interrupt"!==ei||ez||eq||eh?(0,t.jsx)(p.Button,{variant:"ghost",size:"sm",className:(0,_.cn)("h-7 w-7 shrink-0 p-0 text-muted-foreground hover:text-foreground",eW&&(z?"text-foreground":"text-claude-active"),!eW&&"opacity-30"),onClick:()=>{eO(),J?eo.current?.blur():eo.current?.focus()},disabled:!eW,"aria-label":V("queueSend"),title:V("queueSend"),children:eh?(0,t.jsx)(l.Loader2,{size:14,className:"animate-spin"}):e$?(0,t.jsx)(s.Ban,{size:14}):(0,t.jsx)(d.SendHorizontal,{size:16})}):(0,t.jsx)(p.Button,{variant:"ghost",size:"sm",className:(0,_.cn)("h-7 w-7 shrink-0 p-0 text-ui-red hover:text-ui-red/80",!ea&&"opacity-30"),onClick:()=>{em(!0)},disabled:!ea,"aria-label":V("interruptAriaLabel"),children:(0,t.jsx)(u.Square,{size:14,fill:"currentColor"})})]}),B&&/^\/[^\r\n]*$/.test(et)&&(0,t.jsx)(p.Button,{variant:"ghost",size:"sm",className:"self-start text-xs",onClick:()=>eA(et),disabled:!ea||"needs-input"===N||"unknown"===N||eq,children:V("nativeCommandsOpen")}),ec.messages.length>0&&(0,t.jsxs)("div",{className:"border-t border-border pt-2",children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",role:"status",children:[(0,t.jsx)(o.Clock3,{size:12}),V("queuedCount",{count:ec.messages.length})]}),(0,t.jsxs)(p.Button,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:eI,disabled:!ea||G||eh||ec.sending||"unknown"===N||"sessionChanged"===ec.error,title:V("submitQueuedNowHint"),children:[ec.sending?(0,t.jsx)(l.Loader2,{size:12,className:"animate-spin"}):(0,t.jsx)(d.SendHorizontal,{size:12}),V("submitQueuedNow")]})]}),(0,t.jsx)("ul",{className:"max-h-28 overflow-y-auto",children:ec.messages.map((e,n)=>(0,t.jsxs)("li",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",title:e.text,children:e.text||e.attachments.map(e=>e.filename).join(", ")}),(0,t.jsx)("button",{type:"button",className:"p-1 hover:text-foreground disabled:opacity-30",disabled:ec.sending&&0===n,"aria-label":V("cancelQueuedMessage"),onClick:()=>{ec.remove(e.id).catch(e=>r.toast.error(e instanceof Error&&e.message?e.message:V("queueRequestFailed")))},children:(0,t.jsx)(m.X,{size:12})})]},e.id))}),ec.error&&(0,t.jsx)("p",{className:"mt-1 text-xs text-ui-red",role:"alert",children:V("sessionChanged"===ec.error?"queueSessionChanged":"queueSendFailed")})]})]})})})]}),(0,t.jsx)(b.default,{open:eu,onOpenChange:em,onConfirm:()=>{es()}})]})}],148141),e.s(["default",0,e=>{let{prompts:a,visible:r,onSelect:s}=e,o=(0,i.useTranslations)("terminal"),l=(0,n.useRef)(null),c=a.length>0,d=(0,n.useCallback)(e=>{s(e)},[s]),u=(0,n.useCallback)(e=>{let t=l.current?.querySelectorAll("[data-quick-prompt]");if(!t?.length)return;let n=Array.from(t).findIndex(e=>e===document.activeElement),i=-1;"ArrowRight"===e.key?(e.preventDefault(),i=n<t.length-1?n+1:0):"ArrowLeft"===e.key&&(e.preventDefault(),i=n>0?n-1:t.length-1),i>=0&&t[i].focus()},[]);return r&&c?(0,t.jsx)("div",{ref:l,role:"toolbar","aria-label":o("quickPrompts"),className:"chat-content mt-1 flex justify-start gap-2 overflow-x-auto px-3 py-1.5 scrollbar-none animate-in fade-in duration-150",onKeyDown:u,children:a.map(e=>(0,t.jsx)(p.Button,{"data-quick-prompt":e.id,variant:"outline",size:"sm",tabIndex:0,className:"shrink-0 rounded-full px-3 py-1 text-xs text-muted-foreground hover:border-foreground/30 hover:text-foreground",onClick:()=>d(e.prompt),children:e.name},e.id))}):null}],624306)},706140,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(352819),a=e.i(494834),r=e.i(817908),s=e.i(932268),o=e.i(205270);let l=(0,o.default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);var c=e.i(73348);let d=(0,o.default)("file-question-mark",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);var u=e.i(760057),m=e.i(853560),_=e.i(661059),p=e.i(26857),g=e.i(189257),f=e.i(569479),h=e.i(353533),E=e.i(316484),S=e.i(13628);let b={ok:"text-muted-foreground",warn:"text-ui-amber",danger:"text-ui-red",critical:"text-ui-red"},v=2*Math.PI*4.5,T=e=>{let{percentage:n,currentTokens:a,windowSize:r}=e,s=(0,i.useTranslations)("session.meta"),o=Math.max(0,Math.min(100,n)),l=o>=92?"critical":o>=80?"danger":o>=50?"warn":"ok",c=b[l],d=null!==a&&null!==r?`${(0,E.formatTokenCount)(a)} / ${(0,E.formatTokenCount)(r)} (${Math.round(o)}%)`:`${Math.round(o)}%`,u="critical"===l||"danger"===l?s("contextHintRed"):"warn"===l?s("contextHintAmber"):null;return(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsxs)(f.TooltipTrigger,{className:(0,h.cn)("inline-flex shrink-0 items-center gap-1 font-mono",c,"critical"===l&&"animate-pulse"),children:[(0,t.jsxs)("svg",{width:12,height:12,viewBox:"0 0 12 12",className:"shrink-0 -rotate-90","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:6,cy:6,r:4.5,fill:"none",stroke:"currentColor",strokeOpacity:.2,strokeWidth:1.75}),(0,t.jsx)("circle",{cx:6,cy:6,r:4.5,fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeDasharray:v,strokeDashoffset:v*(1-o/100),strokeLinecap:"round"})]}),(0,t.jsxs)("span",{children:[Math.round(o),"%"]})]}),(0,t.jsx)(f.TooltipContent,{side:"bottom",children:(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 text-xs",children:[(0,t.jsx)("span",{className:"font-mono",children:d}),u&&(0,t.jsx)("span",{className:"text-muted-foreground",children:u})]})})]})},y=e=>{let{text:i,className:a}=e,[r,s]=(0,n.useState)(!1),o=async e=>{e.stopPropagation(),await (0,S.copyToClipboard)(i)&&(s(!0),setTimeout(()=>s(!1),1500))};return(0,t.jsx)("button",{type:"button",onClick:o,className:(0,h.cn)("inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/50 hover:text-foreground",a),"aria-label":"Copy",children:r?(0,t.jsx)(g.Check,{size:11,className:"text-positive"}):(0,t.jsx)(p.Copy,{size:11})})},C=()=>(0,t.jsx)("span",{className:"mx-1.5 text-muted-foreground/50",children:"·"}),N=e=>{let{text:i,className:a,breakAll:r=!1}=e,[s,o]=(0,n.useState)(!1);return(0,t.jsx)("button",{type:"button",onClick:()=>o(e=>!e),className:(0,h.cn)("min-w-0 cursor-pointer text-left",!s&&"truncate",s&&(r?"whitespace-pre-wrap break-all":"whitespace-pre-wrap break-words"),a),title:s?void 0:i,children:i})};e.s(["MetaCompact",0,e=>{let{title:n,totalCost:i,branch:a,usedPercentage:s,currentContextTokens:o,contextWindowSize:l}=e,c=n.length>30?`${n.slice(0,30)}…`:n,d=null!==o&&null!==l&&l>0,u=s??(d?o/l*100:null);return(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center text-xs",children:[(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{className:"max-w-[200px] truncate text-sm font-medium text-foreground",children:c}),n.length>30&&(0,t.jsx)(f.TooltipContent,{side:"bottom",className:"max-w-[300px]",children:(0,t.jsx)("p",{className:"text-xs",children:n})})]}),a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C,{}),(0,t.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,t.jsx)(r.GitBranch,{size:12,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono",children:a})]})]}),null!==i&&i>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C,{}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground",children:(0,E.formatCost)(i)})]}),null!==u&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C,{}),(0,t.jsx)(T,{percentage:u,currentTokens:o,windowSize:l})]})]})},"MetaDetail",0,e=>{let{title:n,sessionId:o,createdAt:p,updatedAt:g,fileSize:h,userCount:S,assistantCount:b,toolCount:v,toolBreakdown:T,inputTokens:C,cachedInputTokens:x=null,outputTokens:R,reasoningOutputTokens:O=null,totalCost:I,currentContextTokens:A,contextWindowSize:w,usedPercentage:D,model:L,branch:M,isBranchLoading:k,gitStatus:P,tmuxInfo:F}=e,U=(0,i.useTranslations)("session.meta"),B=p?(0,a.default)(p).fromNow():"",G=g?(0,a.default)(g).fromNow():"",j=null!==C&&null!==R,Y=j?[U("inputOutput",{input:(0,E.formatTokenDetail)(C),output:(0,E.formatTokenDetail)(R)}),null!==x&&x>0?U("cachedTokens",{count:(0,E.formatTokenDetail)(x)}):null,null!==O&&O>0?U("reasoningTokens",{count:(0,E.formatTokenDetail)(O)}):null].filter(Boolean).join(" / "):"";return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-1",children:[(0,t.jsx)("span",{className:"truncate font-mono text-xs text-muted-foreground/50",children:o}),o&&(0,t.jsx)(y,{text:o})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[k&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground/50",children:"..."}),!k&&M&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,t.jsx)(r.GitBranch,{size:12}),(0,t.jsx)("span",{className:"font-mono text-xs",children:M})]})]})]}),(0,t.jsx)(N,{text:n,className:"text-sm font-medium text-foreground"}),(0,t.jsxs)("div",{className:"mt-1 flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("message")}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[U("userAssistant",{userCount:S,assistantCount:b}),null!==v&&v>0&&(0,t.jsxs)(t.Fragment,{children:[" / ",(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{className:"cursor-default",children:U("toolsCount",{count:v})}),T&&Object.keys(T).length>0&&(0,t.jsx)(f.TooltipContent,{side:"bottom",children:(0,t.jsx)("div",{className:"flex flex-col gap-0.5 font-mono text-xs",children:Object.entries(T).sort((e,t)=>{let[,n]=e,[,i]=t;return i-n}).map(e=>{let[n,i]=e;return(0,t.jsxs)("div",{className:"flex justify-between gap-4",children:[(0,t.jsx)("span",{children:n}),(0,t.jsx)("span",{className:"text-muted-foreground",children:i})]},n)})})})]})]})]})]}),j&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("tokens")}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:Y})]}),null!==A&&null!==w&&w>0&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("context")}),(0,t.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[(0,E.formatTokenCount)(A)," / ",(0,E.formatTokenCount)(w),null!==D?` (${D}%)`:""]})]}),null!==I&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("cost")}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:(0,E.formatCost)(I)})]}),L&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("model")}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:L})]}),p&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("created")}),(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsxs)(f.TooltipTrigger,{className:"text-xs text-muted-foreground",children:[(0,a.default)(p).format("MM/DD HH:mm")," (",B,")"]}),(0,t.jsx)(f.TooltipContent,{side:"bottom",children:(0,t.jsx)("p",{className:"text-xs",children:(0,a.default)(p).format("YYYY-MM-DD HH:mm:ss")})})]})]}),g&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("updated")}),(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsxs)(f.TooltipTrigger,{className:"text-xs text-muted-foreground",children:[(0,a.default)(g).format("MM/DD HH:mm")," (",G,")"]}),(0,t.jsx)(f.TooltipContent,{side:"bottom",children:(0,t.jsx)("p",{className:"text-xs",children:(0,a.default)(g).format("YYYY-MM-DD HH:mm:ss")})})]})]}),h>0&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:"JSONL"}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:0===h?"0 B":h<1024?`${h} B`:h<1048576?`${(h/1024).toFixed(1)} KB`:`${(h/1048576).toFixed(1)} MB`})]})]}),F&&(0,t.jsx)("div",{className:"mt-1 border-t border-border pt-2",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[F.cwd&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("path")}),(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{className:"min-w-0 truncate font-mono text-xs text-muted-foreground",children:(e=>{{let t=e.match(/^\/Users\/[^/]+(.*)$/);if(t)return`~${t[1]}`}return e})(F.cwd)}),(0,t.jsx)(f.TooltipContent,{side:"bottom",children:(0,t.jsx)("p",{className:"text-xs",children:F.cwd})})]})]}),(F.lastCommand||F.command)&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("process")}),(0,t.jsx)(N,{text:F.lastCommand??F.command,className:"flex-1 font-mono text-xs text-muted-foreground",breakAll:!0})]}),F.pid&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:"PID"}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:F.pid})]}),F.width&&F.height&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("size")}),(0,t.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[F.width," × ",F.height]})]}),(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("session")}),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-1",children:[(0,t.jsx)("span",{className:"min-w-0 truncate font-mono text-xs text-muted-foreground",children:F.sessionName}),(0,t.jsx)(y,{text:F.sessionName})]})]})]})}),P&&(0,t.jsx)("div",{className:"mt-1 border-t border-border pt-2",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:"Git"}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-0.5",children:[M&&(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-muted-foreground",children:[(0,t.jsx)(r.GitBranch,{size:11}),M]}),P.staged>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-ui-green",children:[(0,t.jsx)(l,{size:11}),P.staged," staged"]}),P.modified>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-ui-amber",children:[(0,t.jsx)(c.FilePen,{size:11}),P.modified," modified",(P.insertions>0||P.deletions>0)&&(0,t.jsxs)("span",{className:"text-muted-foreground/70",children:["(",(0,t.jsxs)("span",{className:"text-ui-green",children:["+",P.insertions]})," ",(0,t.jsxs)("span",{className:"text-ui-red",children:["-",P.deletions]}),")"]})]}),P.untracked>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-muted-foreground",children:[(0,t.jsx)(d,{size:11}),P.untracked," untracked"]}),P.ahead>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-ui-blue",children:[(0,t.jsx)(u.ArrowUp,{size:11}),P.ahead," ahead"]}),P.behind>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-claude-active",children:[(0,t.jsx)(m.ArrowDown,{size:11}),P.behind," behind"]}),P.stash>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-muted-foreground",children:[(0,t.jsx)(_.Archive,{size:11}),P.stash," stash"]}),0===P.staged&&0===P.modified&&0===P.untracked&&0===P.ahead&&0===P.behind&&0===P.stash&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground/50",children:"clean"})]})]}),P.recentCommits&&P.recentCommits.length>0&&(0,t.jsx)("div",{className:"flex flex-col gap-0.5",children:P.recentCommits.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(s.GitCommit,{size:11,className:"shrink-0 text-muted-foreground/60"}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-ui-amber",children:e.shortHash}),(0,t.jsx)("span",{className:"min-w-0 max-w-[80px] shrink-0 truncate font-mono text-ui-blue",children:e.author}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground/60",children:(0,a.default)(e.timestamp).fromNow(!0)}),e.isMerge?(0,t.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground/60",children:"merge"}):(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-muted-foreground/60",children:[e.filesChanged>0&&(0,t.jsxs)("span",{children:[e.filesChanged,"F"]}),e.insertions>0&&(0,t.jsxs)("span",{className:"text-ui-green",children:["+",e.insertions]}),e.deletions>0&&(0,t.jsxs)("span",{className:"text-ui-red",children:["-",e.deletions]})]}),(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{className:"min-w-0 truncate text-muted-foreground",children:e.subject}),(0,t.jsx)(f.TooltipContent,{side:"bottom",className:"max-w-[400px]",children:(0,t.jsx)("p",{className:"text-xs",children:e.subject})})]})]},e.hash))})]})})]})}],706140)},224050,695813,672432,326287,e=>{"use strict";var t=e.i(950323);e.i(80784);var n=e.i(191788);let i=async e=>{let t=await fetch(e);if(!t.ok)throw Error(`request-failed-${t.status}`);return await t.json()};e.s(["useCodexSessions",0,(e,a)=>{let r=a&&e?`/api/codex/sessions?cwd=${encodeURIComponent(e)}`:null,{data:s,error:o,isLoading:l,isValidating:c,mutate:d}=(0,t.default)(r,i,{revalidateOnFocus:!1,dedupingInterval:3e4,keepPreviousData:!0}),u=(0,n.useCallback)(async()=>{await d()},[d]);return{sessions:s?.sessions??[],isLoading:!!r&&l,isValidating:c,error:o??null,refresh:u}}],224050);var a=e.i(391398),r=e.i(352819),s=e.i(413646),o=e.i(74531);e.s(["default",0,e=>{let{className:t,onRestart:n,onShowTerminal:i}=e,l=(0,r.useTranslations)("terminal");return(0,a.jsx)(o.default,{icon:(0,a.jsx)(s.default,{size:32,className:"text-foreground motion-safe:animate-spin motion-reduce:opacity-70 [animation-duration:1.5s]"}),main:l("codexBootMain"),almostReady:l("codexBootAlmostReady"),subtitle:l("codexBootSubtitle"),failed:l("codexBootFailed"),failedHint:l("codexBootFailedHint"),restartLabel:l("codexBootRestart"),showTerminalLabel:l("codexBootShowTerminal"),className:t,almostReadyMs:3e3,errorThresholdMs:1e4,onRestart:n,onShowTerminal:i})}],695813);var l=e.i(803057),c=e.i(883210),d=e.i(143100),u=e.i(939310);e.s(["default",0,e=>{let{prompt:t,onRespond:n}=e,i=(0,r.useTranslations)("terminal"),o=t.currentVersion&&t.latestVersion?i("codexUpdateVersion",{current:t.currentVersion,latest:t.latestVersion}):null;return(0,a.jsxs)("div",{className:"flex w-full max-w-md flex-col gap-4 rounded-lg border border-border bg-background p-4 text-left shadow-sm",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-border bg-muted",children:(0,a.jsx)(s.default,{size:18})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-foreground",children:i("codexUpdateTitle")}),o&&(0,a.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o}),(0,a.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:i("success"===t.status?"codexUpdateSuccess":"updating"===t.status?"codexUpdateRunning":"codexUpdateDescription")}),t.updateCommand&&"prompt"===t.status&&(0,a.jsx)("p",{className:"mt-2 break-all rounded-md bg-muted px-2 py-1 font-mono text-[11px] text-muted-foreground",children:t.updateCommand})]})]}),"prompt"===t.status&&(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto_auto]",children:[(0,a.jsxs)(u.Button,{size:"sm",onClick:()=>n("update"),children:[(0,a.jsx)(c.Download,{className:"h-3.5 w-3.5"}),i("codexUpdateNow")]}),(0,a.jsx)(u.Button,{size:"sm",variant:"outline",onClick:()=>n("skip"),children:i("codexUpdateSkip")}),(0,a.jsx)(u.Button,{size:"sm",variant:"ghost",onClick:()=>n("skip-version"),children:i("codexUpdateSkipVersion")})]}),"updating"===t.status&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,a.jsx)(d.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),i("codexUpdateRunningHint")]}),"success"===t.status&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,a.jsx)(l.CheckCircle2,{className:"h-3.5 w-3.5 text-green-600"}),i("codexUpdateRestarting")]})]})}],672432);var m=e.i(319987),_=e.i(494834),p=e.i(222564),g=e.i(265524),f=e.i(353533);let h=(0,n.memo)(e=>{let{session:t,isResuming:n,isDisabled:i,onSelect:r,onDeleted:s,noMessageLabel:o,tSession:l,tTime:c}=e,u=t.lastActivityAt||t.startedAt,p=(0,_.default)(u).format("MM/DD HH:mm"),g=((e,t)=>{let n=(0,_.default)(),i=(0,_.default)(e),a=n.diff(i,"minute");if(a<1)return t("justNow");if(a<60)return t("minutesAgo",{count:a});let r=n.diff(i,"hour");if(r<24)return t("hoursAgo",{count:r});let s=n.diff(i,"day");if(1===s)return t("yesterday");if(s<7)return t("daysAgo",{count:s});let o=n.diff(i,"week");if(o<4)return t("weeksAgo",{count:o});let l=n.diff(i,"month");return l<12?t("monthsAgo",{count:l}):t("yearsAgo",{count:n.diff(i,"year")})})(u,c),h=t.firstUserMessage?.trim()||o,E=l("turnCount",{count:t.turnCount}),S=[h,p,g,E].filter(Boolean).join(" · ");return(0,a.jsx)(m.default,{provider:"codex",sessionId:t.sessionId,label:t.firstUserMessage,disabled:i,onDeleted:s,children:(0,a.jsxs)("button",{type:"button","aria-label":S,disabled:i,onClick:()=>r(t),className:(0,f.cn)("w-full cursor-pointer border-b border-border/50 py-3 pl-1 pr-10 text-left transition-colors","hover:bg-claude-active/5 focus-visible:bg-claude-active/5 focus:outline-none",n&&"bg-claude-active/5",i&&!n&&"pointer-events-none opacity-50"),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs",children:[n?(0,a.jsx)(d.Loader2,{size:14,className:"shrink-0 animate-spin text-claude-active"}):(0,a.jsx)("span",{className:"inline-block h-1.5 w-1.5 shrink-0"}),(0,a.jsx)("span",{className:"text-muted-foreground",children:p})]}),(0,a.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:g})]}),(0,a.jsxs)("div",{className:"mt-1 flex items-center justify-between gap-2 pl-[12px]",children:[(0,a.jsx)("span",{className:"min-w-0 truncate text-left text-sm font-medium",children:h}),(0,a.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:E})]})]})})});h.displayName="CodexSessionItem";let E=()=>(0,a.jsx)("div",{className:"flex flex-col",children:[1,2,3].map(e=>(0,a.jsxs)("div",{className:"border-b border-border/50 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("div",{className:"h-3.5 w-24 animate-pulse rounded bg-muted"}),(0,a.jsx)("div",{className:"h-3.5 w-16 animate-pulse rounded bg-muted"})]}),(0,a.jsxs)("div",{className:"mt-2 flex items-center justify-between pl-[18px]",children:[(0,a.jsx)("div",{className:"h-4 w-40 animate-pulse rounded bg-muted"}),(0,a.jsx)("div",{className:"h-3.5 w-20 animate-pulse rounded bg-muted"})]})]},e))});e.s(["default",0,e=>{let{sessions:t,isLoading:i,error:o,resumingSessionId:l,onSelectSession:c,onRefresh:d,onNewSession:m,className:_}=e,S=(0,r.useTranslations)("terminal"),b=(0,r.useTranslations)("session"),v=(0,n.useRef)(null),T=(0,n.useCallback)(async()=>{await d(),v.current&&(v.current.scrollTop=0)},[d]),y=!!l;return(0,a.jsxs)("div",{className:(0,f.cn)("flex h-full flex-col",_),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-2",children:[(0,a.jsxs)("span",{className:"text-sm font-medium",children:[S("codexSessionList"),t.length>0&&`(${t.length})`]}),m&&(0,a.jsxs)(u.Button,{variant:"outline",size:"sm",onClick:m,children:[(0,a.jsx)(g.Plus,{size:12}),S("newConversation")]})]}),i&&0===t.length?(0,a.jsx)(E,{}):o?(0,a.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,a.jsx)(p.AlertCircle,{size:24,className:"text-ui-red"}),(0,a.jsx)("p",{className:"text-sm",children:o}),(0,a.jsx)(u.Button,{variant:"outline",size:"sm",onClick:T,children:S("codexRetry")})]}):0===t.length?(0,a.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 px-6 py-10 text-center",children:[(0,a.jsx)(s.default,{size:40,className:"text-muted-foreground/50"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:S("codexSessionsEmpty")}),m&&(0,a.jsxs)(u.Button,{size:"sm",onClick:m,children:[(0,a.jsx)(g.Plus,{className:"h-3.5 w-3.5"}),S("codexNewConversation")]})]}):(0,a.jsx)("div",{ref:v,className:"flex-1 overflow-y-auto",children:t.map(e=>(0,a.jsx)(h,{session:e,isResuming:e.sessionId===l,isDisabled:y,onSelect:c,onDeleted:d,noMessageLabel:b("noMessage"),tSession:b,tTime:b},e.jsonlPath))})]})}],326287)},204360,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(199648),a=e.i(353533),r=e.i(418760),s=e.i(224050);let o=e=>({provider:"claude",sessionId:e.sessionId,key:`claude:${e.sessionId}`,startedAt:e.startedAt,lastActivityAt:e.lastActivityAt,firstMessage:e.firstMessage||null,turnCount:e.turnCount}),l=e=>({provider:"codex",sessionId:e.sessionId,key:`codex:${e.jsonlPath}`,startedAt:new Date(e.startedAt).toISOString(),lastActivityAt:new Date(e.lastActivityAt||e.startedAt).toISOString(),firstMessage:e.firstUserMessage,turnCount:e.turnCount});var c=e.i(319987),d=e.i(143100),u=e.i(265524),m=e.i(352819),_=e.i(494834),p=e.i(939310),g=e.i(714233),f=e.i(413646);let h=e=>{if("ArrowDown"===e.key){e.preventDefault();let t=e.currentTarget.closest("[data-session-row]")?.nextElementSibling?.querySelector("button");t?.focus()}else if("ArrowUp"===e.key){e.preventDefault();let t=e.currentTarget.closest("[data-session-row]")?.previousElementSibling?.querySelector("button");t?.focus()}},E=()=>(0,t.jsx)("div",{className:"flex flex-col",children:[1,2,3].map(e=>(0,t.jsxs)("div",{className:"border-b border-border/50 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{className:"h-3.5 w-24 animate-pulse rounded bg-muted"}),(0,t.jsx)("div",{className:"h-3.5 w-16 animate-pulse rounded bg-muted"})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-center justify-between pl-[18px]",children:[(0,t.jsx)("div",{className:"h-4 w-40 animate-pulse rounded bg-muted"}),(0,t.jsx)("div",{className:"h-3.5 w-8 animate-pulse rounded bg-muted"})]})]},e))}),S=e=>{let{provider:n}=e;return"codex"===n?(0,t.jsx)(f.default,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,t.jsx)(g.default,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})},b=(0,n.memo)(e=>{let{session:n,isResuming:i,isDisabled:r,onSelect:s,onDeleted:o,noMessageLabel:l,tSession:u}=e,m=(0,_.default)(n.lastActivityAt).format("MM/DD HH:mm"),p=((e,t)=>{let n=(0,_.default)(),i=(0,_.default)(e),a=n.diff(i,"minute");if(a<1)return t("justNow");if(a<60)return t("minutesAgo",{count:a});let r=n.diff(i,"hour");if(r<24)return t("hoursAgo",{count:r});let s=n.diff(i,"day");if(1===s)return t("yesterday");if(s<7)return t("daysAgo",{count:s});let o=n.diff(i,"week");if(o<4)return t("weeksAgo",{count:o});let l=n.diff(i,"month");return l<12?t("monthsAgo",{count:l}):t("yearsAgo",{count:n.diff(i,"year")})})(n.lastActivityAt,u),g=n.firstMessage?.trim()||l,f="codex"===n.provider?"Codex":"Claude";return(0,t.jsx)(c.default,{provider:n.provider,sessionId:n.sessionId,label:n.firstMessage,disabled:r,onDeleted:o,children:(0,t.jsxs)("button",{type:"button",className:(0,a.cn)("w-full cursor-pointer border-b border-border/50 py-3 pl-3 pr-10 text-left transition-colors","hover:bg-claude-active/5 focus-visible:bg-claude-active/5 focus:outline-none",r&&!i&&"pointer-events-none opacity-50",i&&"bg-claude-active/5"),onClick:()=>s(n),onKeyDown:h,disabled:r,"aria-label":`${f}: ${g}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs",children:[i?(0,t.jsx)(d.Loader2,{size:14,className:"shrink-0 animate-spin text-claude-active"}):(0,t.jsx)(S,{provider:n.provider}),(0,t.jsx)("span",{className:"text-muted-foreground",children:m})]}),(0,t.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:p})]}),(0,t.jsxs)("div",{className:"mt-1 flex items-center justify-between gap-2 pl-5",children:[(0,t.jsx)("span",{className:"min-w-0 truncate text-left text-sm font-medium",children:g}),(0,t.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:u("turnCount",{count:n.turnCount})})]})]})})});b.displayName="AgentSessionItem";let v=e=>{let{sessions:r,isLoading:s,isLoadingMore:o,hasMore:l,error:c,resumingSessionKey:d,onSelectSession:_,onRefresh:g,onLoadMore:f,onNewSession:h,onNewClaudeSession:S,onNewCodexSession:v}=e,T=(0,m.useTranslations)("terminal"),y=(0,m.useTranslations)("session"),C=(0,n.useRef)(null),[N,x]=(0,n.useState)("all"),R=(0,n.useCallback)(async()=>{await g(),C.current&&(C.current.scrollTop=0)},[g]),O=(0,n.useCallback)(()=>{let e=C.current;e&&l&&!o&&e.scrollTop+e.clientHeight>=e.scrollHeight-50&&f()},[l,o,f]),I=!!d,A="codex"===c?T("codexSessionsLoadFailed"):c,w=(0,n.useMemo)(()=>r.filter(e=>"all"===N||e.provider===N),[N,r]),D=[{key:"all",label:T("sessions")},{key:"claude",label:"Claude"},{key:"codex",label:"Codex"}];return(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b px-4 py-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsxs)("span",{className:"text-sm font-medium",children:[T("sessions"),r.length>0&&`(${r.length}${l?"+":""})`]}),(0,t.jsx)("div",{className:"flex h-7 items-center rounded-md border border-border p-0.5",children:D.map(e=>(0,t.jsx)("button",{type:"button",className:(0,a.cn)("h-6 rounded px-2 text-xs text-muted-foreground transition-colors",N===e.key&&"bg-accent text-foreground"),onClick:()=>x(e.key),children:e.label},e.key))})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[S&&(0,t.jsxs)(p.Button,{variant:"outline",size:"sm",onClick:S,children:[(0,t.jsx)(u.Plus,{size:12}),"Claude"]}),v&&(0,t.jsxs)(p.Button,{variant:"outline",size:"sm",onClick:v,children:[(0,t.jsx)(u.Plus,{size:12}),"Codex"]}),h&&!S&&!v&&(0,t.jsxs)(p.Button,{variant:"outline",size:"sm",onClick:h,children:[(0,t.jsx)(u.Plus,{size:12}),T("newConversation")]})]})]}),s&&0===r.length?(0,t.jsx)(E,{}):A?(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)("p",{className:"text-sm",children:A}),(0,t.jsx)(p.Button,{variant:"outline",size:"sm",onClick:R,children:T("retryLoad")})]}):(0,t.jsxs)("div",{ref:C,className:"flex-1 overflow-y-auto",onScroll:O,children:[0===w.length?(0,t.jsx)("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:y("empty.noSession")}):w.map(e=>(0,t.jsx)(b,{session:e,isResuming:e.key===d,isDisabled:I,onSelect:_,onDeleted:g,noMessageLabel:y("noMessage"),tSession:y},e.key)),o&&(0,t.jsx)("div",{className:"flex items-center justify-center py-3",children:(0,t.jsx)(i.default,{size:14,className:"text-muted-foreground"})})]})]})};e.s(["default",0,e=>{let{sessionName:c,cwd:d,className:u,onSelectSession:m,onNewClaudeSession:_,onNewCodexSession:p}=e,[g,f]=(0,n.useState)(null),h=(0,n.useRef)(!0),{sessions:E,isLoading:S,isLoadingMore:b,hasMore:T,error:y,refetch:C,loadMore:N}=(e=>{let{tmuxSession:t,enabled:i,cwd:a}=e,c=(0,r.default)({tmuxSession:t,enabled:i,cwd:a}),d=(0,s.useCodexSessions)(a,i&&!!a),u=(0,n.useMemo)(()=>{let e=[...c.sessions.map(o),...d.sessions.map(l)];return e.sort((e,t)=>new Date(t.lastActivityAt).getTime()-new Date(e.lastActivityAt).getTime()),e},[c.sessions,d.sessions]),m=(0,n.useCallback)(async()=>{await Promise.all([c.refetch(),d.refresh()])},[c,d]);return{sessions:u,isLoading:c.isLoading||d.isLoading,isLoadingMore:c.isLoadingMore,hasMore:c.hasMore,error:c.error||(d.error?"codex":null),refetch:m,loadMore:c.loadMore}})({tmuxSession:c,enabled:!!c,cwd:d});(0,n.useEffect)(()=>(h.current=!0,()=>{h.current=!1}),[]);let x=(0,n.useCallback)(e=>{g||(f(e.key),Promise.resolve(m(e)).finally(()=>{h.current&&f(t=>t===e.key?null:t)}))},[m,g]);return S&&0===E.length?(0,t.jsx)("div",{className:(0,a.cn)("flex h-full w-full flex-col items-center justify-center bg-card",u),children:(0,t.jsx)(i.default,{className:"h-4 w-4 text-muted-foreground"})}):(0,t.jsx)("div",{className:(0,a.cn)("h-full w-full bg-card",u),children:(0,t.jsx)(v,{sessions:E,isLoading:S,isLoadingMore:b,hasMore:T,error:y,resumingSessionKey:g,onSelectSession:x,onRefresh:C,onLoadMore:N,onNewClaudeSession:_,onNewCodexSession:p})})}],204360)},104905,e=>{"use strict";let t="__CTRL__",n="__SHIFT__",i=[{label:"Tab",value:" "},{label:"Esc",value:"\x1b"},{label:"Ctrl",value:t},{label:"Shift",value:n},{label:"",value:"\r",nerd:!0},{label:"",value:"\x1b[A",nerd:!0},{label:"",value:"\x1b[B",nerd:!0},{label:"",value:"\x1b[D",nerd:!0},{label:"",value:"\x1b[C",nerd:!0},{label:"",value:"|",nerd:!0,rotate:!0},{label:"",value:"~",nerd:!0}];e.s(["CTRL_TOGGLE",0,t,"SHIFT_TOGGLE",0,n,"TERMINAL_KEYS",0,i,"toCtrlChar",0,e=>{if(1!==e.length)return null;let t=e.toLowerCase().charCodeAt(0);return t>=97&&t<=122?String.fromCharCode(t-96):null}])},196755,750147,732859,1398,e=>{"use strict";var t=e.i(391398),n=e.i(909725),i=e.i(352819),a=e.i(939310),r=e.i(353533);e.s(["default",0,e=>{let{modeName:s,onSwitch:o,onDismiss:l,className:c}=e,d=(0,i.useTranslations)("terminal"),u=(0,i.useTranslations)("common");return(0,t.jsxs)("div",{className:(0,r.cn)("absolute right-3 bottom-3 z-20 flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 shadow-lg animate-[fadeIn_200ms_ease-out]",c),children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:d("switchToAgentMode",{name:s})}),(0,t.jsx)(a.Button,{variant:"default",size:"sm",className:"h-6 px-2 text-[11px]",onClick:o,children:d("switchMode")}),(0,t.jsx)("button",{className:"flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground",onClick:l,"aria-label":u("close"),children:(0,t.jsx)(n.X,{className:"h-3.5 w-3.5"})})]})}],196755);var s=e.i(191788),o=e.i(601726);let l=/Quick safety check|Do you trust the contents of this directory/i,c=/(\/[^\s│]+)/,d=e=>{let t;if(!l.test(e))return null;let n=e.split("\n").map(e=>e.replace(/^\s*[│┃]/,"").replace(/[│┃]\s*$/,"")),i=-1,a=-1;for(let e=0;e<n.length;e++)l.test(n[e])&&(a=i,i=e);if(i<0)return null;let r=/Quick safety check/i.test(n[i])?"claude":"codex",s=n.slice(a+1,i);if(!(t="claude"===r?s.slice(-6).reverse().map(e=>e.match(c)?.[1]).find(Boolean):s.map(e=>e.match(/repository root:\s*(\/\S+)/i)?.[1]).find(Boolean)??s.map(e=>e.match(/You are in\s+(\/\S+)/i)?.[1]).find(Boolean)))return null;let d=n.slice(i).join("\n"),u=(0,o.parsePermissionOptions)(d),m=u.options.map(e=>{let t;return t=(0,o.stripNumberPrefix)(e).replace(/\s/g,""),("claude"===r?/^Yes,Itrustthisfolder/i:/^Yes,continue/i).test(t)?"yes":("claude"===r?/^No,exit/i:/^No,quit/i).test(t)?"no":null}),_=m.indexOf("yes"),p=m.indexOf("no");if(2!==u.options.length||_<0||p<0)return null;let g=(0,o.optionNumber)(u.options[_]),f=(0,o.optionNumber)(u.options[p]);if(g&&f)return{agent:r,folderPath:t,selection:{mode:"numbered",yesKey:g,noKey:f}};let h=m[u.focusedIndex],E=/^\s*[❯›>]\s+(?:Yes,|No,)/im.test(d);return{agent:r,folderPath:t,selection:h&&E?{mode:"navigation",selectedAnswer:h,yesIsFirst:_<p}:{mode:"unavailable"}}};e.s(["default",0,e=>{let{enabled:t,scopeKey:n=null,getBufferText:i,sendStdin:a}=e,[r,o]=(0,s.useState)(null),l=(0,s.useRef)(null),c=(0,s.useRef)(null),u=(0,s.useRef)({enabled:t,scopeKey:n,getBufferText:i});(0,s.useEffect)(()=>{u.current={enabled:t,scopeKey:n,getBufferText:i}},[t,n,i]);let m=(0,s.useCallback)(()=>{u.current.enabled&&!l.current&&(l.current=setTimeout(()=>{l.current=null;let e=u.current;if(!e.enabled)return;let t=d(e.getBufferText());o(n=>t?n?.scopeKey===e.scopeKey&&n.prompt.folderPath===t.folderPath&&n.prompt.agent===t.agent&&n.prompt.selection.mode===t.selection.mode?n:{scopeKey:e.scopeKey,prompt:t}:null)},200))},[]);(0,s.useEffect)(()=>(m(),()=>{l.current&&clearTimeout(l.current),l.current=null,c.current&&(clearTimeout(c.current.timer),c.current.resolve(!1),c.current=null)}),[t,n,m]);let _=t&&r?.scopeKey===n?r.prompt:null,p=(0,s.useCallback)(async e=>{let t=u.current;if(!_||!t.enabled||t.scopeKey!==n||c.current)return;let i=d(t.getBufferText());if(!i||i.agent!==_.agent||i.folderPath!==_.folderPath)return;let r=((e,t)=>{let{selection:n}=e;if("unavailable"===n.mode)return[];if("numbered"===n.mode){let i="yes"===t?n.yesKey:n.noKey;return"codex"===e.agent?[i]:[i,"\r"]}return t===n.selectedAnswer?["\r"]:[("yes"===t?n.yesIsFirst:!n.yesIsFirst)?"\x1b[A":"\x1b[B","\r"]})(i,e);if(r.length){if(a(r[0]),r.length>1){let t=await new Promise(e=>{let t=setTimeout(()=>{c.current=null,e(!0)},80);c.current={timer:t,resolve:e}}),s=u.current;if(!t||!s.enabled||s.scopeKey!==n)return;let o=d(s.getBufferText());if(!o||o.agent!==i.agent||o.folderPath!==i.folderPath||"navigation"===i.selection.mode&&("navigation"!==o.selection.mode||o.selection.selectedAnswer!==e))return;a(r[1])}o(null)}},[_,n,a]);return{trustPrompt:_,onTerminalData:m,onTrustResponse:p}}],750147);var u=e.i(482821);e.s(["default",0,e=>{let{enabled:t,scopeKey:n,getBufferText:i,sendStdin:a,onUpdated:r}=e,[o,l]=(0,s.useState)({scopeKey:null,prompt:null}),c=(0,s.useRef)(!1),d=(0,s.useRef)(n??null),m=(0,s.useRef)(null),_=(0,s.useRef)(null),p=(0,s.useRef)(!1),g=(0,s.useRef)(i),f=(0,s.useRef)(r);(0,s.useEffect)(()=>{g.current=i},[i]),(0,s.useEffect)(()=>{f.current=r},[r]),(0,s.useEffect)(()=>{d.current=n??null},[n]);let h=(0,s.useCallback)(()=>{c.current&&!m.current&&(m.current=setTimeout(()=>{if(m.current=null,!c.current)return;let e=(0,u.matchCodexUpdatePrompt)(g.current()),t=d.current;l(n=>{let i=n.scopeKey===t?n.prompt:null;return e?("success"!==e.status||p.current||(p.current=!0,_.current=setTimeout(()=>{_.current=null,f.current?.()},700)),i&&i.status===e.status&&i.currentVersion===e.currentVersion&&i.latestVersion===e.latestVersion&&i.updateCommand===e.updateCommand)?n:{scopeKey:t,prompt:e}:i?.status==="prompt"?n:{scopeKey:t,prompt:null}})},200))},[]);(0,s.useEffect)(()=>{let e=c.current;if(c.current=t,!t){m.current&&(clearTimeout(m.current),m.current=null),p.current=!1;return}e||h()},[t,h]),(0,s.useEffect)(()=>()=>{m.current&&clearTimeout(m.current),_.current&&clearTimeout(_.current)},[]);let E=(0,s.useCallback)(e=>{if("update"===e){l(e=>e.prompt?{...e,prompt:{...e.prompt,status:"updating"}}:e),a("1\r");return}l({scopeKey:d.current,prompt:null}),a("skip"===e?"2\r":"3\r")},[a]),S=o.scopeKey===(n??null)?o.prompt:null;return{updatePrompt:t?S:null,onTerminalData:h,onRespond:E}}],732859);var m=e.i(518829),_=e.i(815016),p=e.i(212283);let g=async()=>{try{let e=await fetch("/api/preflight/runtime",{method:"POST"});if(!e.ok)return null;return await e.json()}catch{return null}};e.s(["useAgentInstallCheck",0,()=>{let e=(0,i.useTranslations)("toolsRequired"),n=(0,i.useTranslations)("common"),[a,r]=(0,s.useState)(null),[o,l]=(0,s.useState)(!1),[c,d]=(0,s.useState)(null),u=(0,s.useCallback)(async t=>{let i=await g();return i?("codex"===t?!!i.codex.installed:!!i.claude.installed)||("codex"===t?d({title:e("codexMissingTitle"),description:e("codexMissingDescription"),confirmLabel:e("codexInstallGuide"),action:"guide"}):i.claude.binaryPath?d({title:e("agentPathPromptTitle"),description:e("agentPathPromptDescription"),confirmLabel:e("fixClaudePath"),action:"install",command:"claude-path",label:e("fixClaudePath")}):d({title:e("agentInstallPromptTitle"),description:e("agentInstallPromptDescription"),confirmLabel:e("installClaude"),action:"install",command:"claude",label:e("installClaude")}),!1):(d({title:e("preflightFailedTitle"),description:e("preflightFailedDescription"),confirmLabel:n("close")}),!1)},[e,n]),f=(0,s.useCallback)(()=>{if(!c?.action)return void d(null);if("guide"===c.action){d(null),l(!0);return}c.command&&c.label&&r({command:c.command,label:c.label}),d(null)},[c]);return{ensureAgentInstalled:u,installDialogs:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.AlertDialog,{open:!!c,onOpenChange:e=>{e||d(null)},children:(0,t.jsxs)(p.AlertDialogContent,{children:[(0,t.jsxs)(p.AlertDialogHeader,{children:[(0,t.jsx)(p.AlertDialogTitle,{children:c?.title}),(0,t.jsx)(p.AlertDialogDescription,{children:c?.description})]}),(0,t.jsxs)(p.AlertDialogFooter,{children:[c?.action&&(0,t.jsx)(p.AlertDialogCancel,{onClick:()=>d(null),children:n("cancel")}),(0,t.jsx)(p.AlertDialogAction,{onClick:f,children:c?.confirmLabel??n("confirm")})]})]})}),a&&(0,t.jsx)(m.default,{open:!0,onOpenChange:()=>r(null),command:a.command,label:a.label,reloadOnClose:!1}),(0,t.jsx)(_.default,{open:o,onOpenChange:l})]})}}],1398)},828324,827294,530417,e=>{"use strict";var t=e.i(983040);String.raw`
|
|
28
|
+
`),()=>{d.current?.removeAttribute("data-motion-pop-id"),E.contains(h)&&E.removeChild(h)}},[n]),(0,s.jsx)(b,{isPresent:n,childRef:d,sizeRef:u,pop:o,children:!1===o?t:h.cloneElement(t,{ref:_})})}let T=e=>{let{children:t,initial:n,isPresent:i,onExitComplete:a,custom:r,presenceAffectsLayout:o,mode:l,anchorX:d,anchorY:u,root:_}=e,g=m(y),f=(0,c.useId)(),h=!0,E=(0,c.useMemo)(()=>(h=!1,{id:f,initial:n,isPresent:i,custom:r,onExitComplete:e=>{for(let t of(g.set(e,!0),g.values()))if(!t)return;a&&a()},register:e=>(g.set(e,!1),()=>g.delete(e))}),[i,g,a]);return o&&h&&(E={...E}),(0,c.useMemo)(()=>{g.forEach((e,t)=>g.set(t,!1))},[i]),c.useEffect(()=>{i||g.size||!a||a()},[i]),t=(0,s.jsx)(v,{pop:"popLayout"===l,isPresent:i,anchorX:d,anchorY:u,root:_,children:t}),(0,s.jsx)(p.Provider,{value:E,children:t})};function y(){return new Map}function C(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=(0,c.useContext)(p);if(null===t)return[!0,null];let{isPresent:n,onExitComplete:i,register:a}=t,r=(0,c.useId)();(0,c.useEffect)(()=>{if(e)return a(r)},[e]);let s=(0,c.useCallback)(()=>e&&i&&i(r),[r,i,e]);return!n&&i?[!1,s]:[!0]}let N=e=>e.key||"";function x(e){let t=[];return c.Children.forEach(e,e=>{(0,c.isValidElement)(e)&&t.push(e)}),t}let R=e=>{let{children:t,custom:n,initial:i=!0,onExitComplete:a,presenceAffectsLayout:r=!0,mode:o="sync",propagate:l=!1,anchorX:d="left",anchorY:p="top",root:g}=e,[f,h]=C(l),E=(0,c.useMemo)(()=>x(t),[t]),S=l&&!f?[]:E.map(N),b=(0,c.useRef)(!0),v=(0,c.useRef)(E),y=m(()=>new Map),R=(0,c.useRef)(new Set),[O,I]=(0,c.useState)(E),[A,w]=(0,c.useState)(E);_(()=>{b.current=!1,v.current=E;for(let e=0;e<A.length;e++){let t=N(A[e]);S.includes(t)?(y.delete(t),R.current.delete(t)):!0!==y.get(t)&&y.set(t,!1)}},[A,S.length,S.join("-")]);let D=[];if(E!==O){let e=[...E];for(let t=0;t<A.length;t++){let n=A[t],i=N(n);S.includes(i)||(e.splice(t,0,n),D.push(n))}return"wait"===o&&D.length&&(e=D),w(x(e)),I(E),null}let{forceRender:L}=(0,c.useContext)(u);return(0,s.jsx)(s.Fragment,{children:A.map(e=>{let t=N(e),c=(!l||!!f)&&(E===A||S.includes(t));return(0,s.jsx)(T,{isPresent:c,initial:(!b.current||!!i)&&void 0,custom:n,presenceAffectsLayout:r,mode:o,root:g,onExitComplete:c?void 0:()=>{if(R.current.has(t)||!y.has(t))return;R.current.add(t),y.set(t,!0);let e=!0;y.forEach(t=>{t||(e=!1)}),e&&(L?.(),w(v.current),l&&h?.(),a&&a())},anchorX:d,anchorY:p,children:e},t)})})},O=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],I=new Set(O),A=(e,t,n)=>n>t?t:n<e?e:n,w={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},D={...w,transform:e=>A(0,1,e)},L={...w,default:1},M=e=>Math.round(1e5*e)/1e5,k=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,P=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,F=(e,t)=>n=>!!("string"==typeof n&&P.test(n)&&n.startsWith(e)||t&&null!=n&&Object.prototype.hasOwnProperty.call(n,t)),U=(e,t,n)=>i=>{if("string"!=typeof i)return i;let[a,r,s,o]=i.match(k);return{[e]:parseFloat(a),[t]:parseFloat(r),[n]:parseFloat(s),alpha:void 0!==o?parseFloat(o):1}},B={...w,transform:e=>Math.round(A(0,255,e))},G={test:F("rgb","red"),parse:U("red","green","blue"),transform:e=>{let{red:t,green:n,blue:i,alpha:a=1}=e;return"rgba("+B.transform(t)+", "+B.transform(n)+", "+B.transform(i)+", "+M(D.transform(a))+")"}},j={test:F("#"),parse:function(e){let t="",n="",i="",a="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),a=e.substring(4,5),t+=t,n+=n,i+=i,a+=a),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:a?parseInt(a,16)/255:1}},transform:G.transform},Y=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),H=Y("deg"),V=Y("%"),$=Y("px"),z=Y("vh"),q=Y("vw"),W={...V,parse:e=>V.parse(e)/100,transform:e=>V.transform(100*e)},Q={test:F("hsl","hue"),parse:U("hue","saturation","lightness"),transform:e=>{let{hue:t,saturation:n,lightness:i,alpha:a=1}=e;return"hsla("+Math.round(t)+", "+V.transform(M(n))+", "+V.transform(M(i))+", "+M(D.transform(a))+")"}},K={test:e=>G.test(e)||j.test(e)||Q.test(e),parse:e=>G.test(e)?G.parse(e):Q.test(e)?Q.parse(e):j.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?G.transform(e):Q.transform(e),getAnimatableNone:e=>{let t=K.parse(e);return t.alpha=0,K.transform(t)}},X=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Z="number",J="color",ee=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function et(e){let t=e.toString(),n=[],i={color:[],number:[],var:[]},a=[],r=0,s=t.replace(ee,e=>(K.test(e)?(i.color.push(r),a.push(J),n.push(K.parse(e))):e.startsWith("var(")?(i.var.push(r),a.push("var"),n.push(e)):(i.number.push(r),a.push(Z),n.push(parseFloat(e))),++r,"${}")).split("${}");return{values:n,split:s,indexes:i,types:a}}function en(e){let{split:t,types:n}=e,i=t.length;return e=>{let a="";for(let r=0;r<i;r++)if(a+=t[r],void 0!==e[r]){let t=n[r];t===Z?a+=M(e[r]):t===J?a+=K.transform(e[r]):a+=e[r]}return a}}let ei={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(k)?.length||0)+(e.match(X)?.length||0)>0},parse:function(e){return et(e).values},createTransformer:function(e){return en(et(e))},getAnimatableNone:function(e){let t=et(e);return en(t)(t.values.map((e,n)=>((e,t)=>"number"==typeof e?t?.trim().endsWith("/")?e:0:"number"==typeof e?0:K.test(e)?K.getAnimatableNone(e):e)(e,t.split[n])))}},ea=new Set(["brightness","contrast","saturate","opacity"]);function er(e){let[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[i]=n.match(k)||[];if(!i)return e;let a=n.replace(i,""),r=+!!ea.has(t);return i!==n&&(r*=100),t+"("+r+a+")"}let es=/\b([a-z-]*)\(.*?\)/gu,eo={...ei,getAnimatableNone:e=>{let t=e.match(es);return t?t.map(er).join(" "):e}},el={...ei,getAnimatableNone:e=>{let t=ei.parse(e);return ei.createTransformer(e)(t.map(e=>"number"==typeof e?0:"object"==typeof e?{...e,alpha:1}:e))}},ec={...w,transform:Math.round},ed={borderWidth:$,borderTopWidth:$,borderRightWidth:$,borderBottomWidth:$,borderLeftWidth:$,borderRadius:$,borderTopLeftRadius:$,borderTopRightRadius:$,borderBottomRightRadius:$,borderBottomLeftRadius:$,width:$,maxWidth:$,height:$,maxHeight:$,top:$,right:$,bottom:$,left:$,inset:$,insetBlock:$,insetBlockStart:$,insetBlockEnd:$,insetInline:$,insetInlineStart:$,insetInlineEnd:$,padding:$,paddingTop:$,paddingRight:$,paddingBottom:$,paddingLeft:$,paddingBlock:$,paddingBlockStart:$,paddingBlockEnd:$,paddingInline:$,paddingInlineStart:$,paddingInlineEnd:$,margin:$,marginTop:$,marginRight:$,marginBottom:$,marginLeft:$,marginBlock:$,marginBlockStart:$,marginBlockEnd:$,marginInline:$,marginInlineStart:$,marginInlineEnd:$,fontSize:$,backgroundPositionX:$,backgroundPositionY:$,rotate:H,rotateX:H,rotateY:H,rotateZ:H,scale:L,scaleX:L,scaleY:L,scaleZ:L,skew:H,skewX:H,skewY:H,distance:$,translateX:$,translateY:$,translateZ:$,x:$,y:$,z:$,perspective:$,transformPerspective:$,opacity:D,originX:W,originY:W,originZ:$,zIndex:ec,fillOpacity:D,strokeOpacity:D,numOctaves:ec},eu={...ed,color:K,backgroundColor:K,outlineColor:K,fill:K,stroke:K,borderColor:K,borderTopColor:K,borderRightColor:K,borderBottomColor:K,borderLeftColor:K,filter:eo,WebkitFilter:eo,mask:el,WebkitMask:el},em=e=>eu[e],e_=()=>({translate:0,scale:1,origin:0,originPoint:0}),ep=()=>({x:e_(),y:e_()}),eg=()=>({min:0,max:0}),ef=()=>({x:eg(),y:eg()}),eh=e=>!!(e&&e.getVelocity),eE=new Set(["width","height","top","left","right","bottom",...O]),eS=e=>t=>t.test(e),eb=[w,$,V,H,q,z,{test:e=>"auto"===e,parse:e=>e}],ev=e=>eb.find(eS(e)),eT=()=>{},ey=()=>{};d.default;let eC=e=>t=>"string"==typeof t&&t.startsWith(e),eN=eC("--"),ex=eC("var(--"),eR=e=>!!ex(e)&&eO.test(e.split("/*")[0].trim()),eO=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function eI(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}let eA=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,ew=e=>180*e/Math.PI,eD=e=>eM(ew(Math.atan2(e[1],e[0]))),eL={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:eD,rotateZ:eD,skewX:e=>ew(Math.atan(e[1])),skewY:e=>ew(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},eM=e=>((e%=360)<0&&(e+=360),e),ek=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),eP=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),eF={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ek,scaleY:eP,scale:e=>(ek(e)+eP(e))/2,rotateX:e=>eM(ew(Math.atan2(e[6],e[5]))),rotateY:e=>eM(ew(Math.atan2(-e[2],e[0]))),rotateZ:eD,rotate:eD,skewX:e=>ew(Math.atan(e[4])),skewY:e=>ew(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function eU(e){return+!!e.includes("scale")}function eB(e,t){let n,i;if(!e||"none"===e)return eU(t);let a=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(a)n=eF,i=a;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=eL,i=t}if(!i)return eU(t);let r=n[t],s=i[1].split(",").map(eG);return"function"==typeof r?r(s):s[r]}function eG(e){return parseFloat(e.trim())}let ej=e=>e===w||e===$,eY=new Set(["x","y","z"]),eH=O.filter(e=>!eY.has(e)),eV={width:(e,t)=>{let{x:n}=e,{paddingLeft:i="0",paddingRight:a="0",boxSizing:r}=t,s=n.max-n.min;return"border-box"===r?s:s-parseFloat(i)-parseFloat(a)},height:(e,t)=>{let{y:n}=e,{paddingTop:i="0",paddingBottom:a="0",boxSizing:r}=t,s=n.max-n.min;return"border-box"===r?s:s-parseFloat(i)-parseFloat(a)},top:(e,t)=>{let{top:n}=t;return parseFloat(n)},left:(e,t)=>{let{left:n}=t;return parseFloat(n)},bottom:(e,t)=>{let{y:n}=e,{top:i}=t;return parseFloat(i)+(n.max-n.min)},right:(e,t)=>{let{x:n}=e,{left:i}=t;return parseFloat(i)+(n.max-n.min)},x:(e,t)=>{let{transform:n}=t;return eB(n,"x")},y:(e,t)=>{let{transform:n}=t;return eB(n,"y")}};eV.translateX=eV.x,eV.translateY=eV.y;let e$=e=>e,ez={},eq=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function eW(e,t){let n=!1,i=!0,a={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,s=eq.reduce((e,n)=>(e[n]=function(e,t){let n=new Set,i=new Set,a=!1,r=!1,s=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1},l=0;function c(t){s.has(t)&&(d.schedule(t),e()),l++,t(o)}let d={schedule:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=r&&a?n:i;return t&&s.add(e),o.add(e),e},cancel:e=>{i.delete(e),s.delete(e)},process:e=>{if(o=e,a){r=!0;return}a=!0;let s=n;n=i,i=s,n.forEach(c),t,l=0,n.clear(),a=!1,r&&(r=!1,d.process(e))}};return d}(r,t?n:void 0),e),{}),{setup:o,read:l,resolveKeyframes:c,preUpdate:d,update:u,preRender:m,render:_,postRender:p}=s,g=()=>{let r=ez.useManualTiming,s=r?a.timestamp:performance.now();n=!1,r||(a.delta=i?1e3/60:Math.max(Math.min(s-a.timestamp,40),1)),a.timestamp=s,a.isProcessing=!0,o.process(a),l.process(a),c.process(a),d.process(a),u.process(a),m.process(a),_.process(a),p.process(a),a.isProcessing=!1,n&&t&&(i=!1,e(g))};return{schedule:eq.reduce((t,r)=>{let o=s[r];return t[r]=function(t){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!n&&(n=!0,i=!0,a.isProcessing||e(g)),o.schedule(t,r,s)},t},{}),cancel:e=>{for(let t=0;t<eq.length;t++)s[eq[t]].cancel(e)},state:a,steps:s}}let{schedule:eQ,cancel:eK,state:eX,steps:eZ}=eW("u">typeof requestAnimationFrame?requestAnimationFrame:e$,!0),eJ=new Set,e0=!1,e1=!1,e2=!1;function e3(){if(e1){let e=Array.from(eJ).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t,i=(t=[],eH.forEach(n=>{let i=e.getValue(n);void 0!==i&&(t.push([n,i.get()]),i.set(+!!n.startsWith("scale")))}),t);i.length&&(n.set(e,i),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(t=>{let[n,i]=t;e.getValue(n)?.set(i)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}e1=!1,e0=!1,eJ.forEach(e=>e.complete(e2)),eJ.clear()}function e5(){eJ.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(e1=!0)})}class e4{constructor(e,t,n,i,a,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=i,this.element=a,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(eJ.add(this),e0||(e0=!0,eQ.read(e5),eQ.resolveKeyframes(e3))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:i}=this;if(null===e[0]){let a=i?.get(),r=e[e.length-1];if(void 0!==a)e[0]=a;else if(n&&t){let i=n.readValue(t,r);null!=i&&(e[0]=i)}void 0===e[0]&&(e[0]=r),i&&void 0===a&&i.set(e[0])}for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),eJ.delete(this)}cancel(){"scheduled"===this.state&&(eJ.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}let e9=new Set([eo,el]);function e6(e,t){let n=em(e);return e9.has(n)||(n=ei),n.getAnimatableNone?n.getAnimatableNone(t):void 0}let e7=new Set(["auto","none","0"]);class e8 extends e4{constructor(e,t,n,i,a){super(e,t,n,i,a,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let i=e[n];if("string"==typeof i&&eR(i=i.trim())){let a=function e(t,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;ey(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[a,r]=function(e){let t=eA.exec(e);if(!t)return[,];let[,n,i,a]=t;return[`--${n??i}`,a]}(t);if(!a)return;let s=window.getComputedStyle(n).getPropertyValue(a);if(s){let e=s.trim();return/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e)?parseFloat(e):e}return eR(r)?e(r,n,i+1):r}(i,t.current);void 0!==a&&(e[n]=a),n===e.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!eE.has(n)||2!==e.length)return;let[i,a]=e,r=ev(i),s=ev(a);if(eI(i)!==eI(a)&&eV[n]){this.needsMeasurement=!0;return}if(r!==s)if(ej(r)&&ej(s))for(let t=0;t<e.length;t++){let n=e[t];"string"==typeof n&&(e[t]=parseFloat(n))}else eV[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(null===e[t]||function(e){if("number"==typeof e)return 0===e;if(null===e)return!0;return"none"===e||"0"===e||/^0[^.\s]+$/u.test(e)}(e[t]))&&n.push(t);n.length&&function(e,t,n){let i,a=0;for(;a<e.length&&!i;){let t=e[a];"string"==typeof t&&!e7.has(t)&&et(t).values.length&&(i=e[a]),a++}if(i&&n)for(let a of t)e[a]=e6(n,i)}(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=eV[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let i=t[t.length-1];void 0!==i&&e.getValue(n,i).jump(i,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let i=e.getValue(t);i&&i.jump(this.measuredOrigin,!1);let a=n.length-1,r=n[a];n[a]=eV[t](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(t=>{let[n,i]=t;e.getValue(n).set(i)}),this.resolveNoneKeyframes()}}let te=e=>1e3*e;function tt(e,t){-1===e.indexOf(t)&&e.push(t)}function tn(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}class ti{constructor(){this.subscriptions=[]}add(e){return tt(this.subscriptions,e),()=>tn(this.subscriptions,e)}notify(e,t,n){let i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](e,t,n);else for(let a=0;a<i;a++){let i=this.subscriptions[a];i&&i(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function ta(e,t,n){t.startsWith("--")?e.style.setProperty(t,n):e.style[t]=n}function tr(e){let t;return()=>(void 0===t&&(t=e()),t)}let ts={};function to(e,t){let n=tr(e);return()=>ts[t]??n()}let tl=to(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),tc=e=>null!==e;function td(e,t,n){let{repeat:i,repeatType:a="loop"}=t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=e.filter(tc),o=r<0||i&&"loop"!==a&&i%2==1?0:s.length-1;return o&&void 0!==n?n:s[o]}class tu{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}let tm={layout:0,mainThread:0,waapi:0},t_=e=>Array.isArray(e)&&"number"==typeof e[0],tp=to(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),tg=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,i="",a=Math.max(Math.round(t/n),2);for(let t=0;t<a;t++)i+=Math.round(1e4*e(t/(a-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},tf=e=>{let[t,n,i,a]=e;return`cubic-bezier(${t}, ${n}, ${i}, ${a})`},th={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:tf([0,.65,.55,1]),circOut:tf([.55,0,1,.45]),backIn:tf([.31,.01,.66,-.59]),backOut:tf([.33,1.53,.69,.99])};function tE(e){return"function"==typeof e&&"applyToOptions"in e}class tS extends tu{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:n,keyframes:i,pseudoElement:a,allowFlatten:r=!1,finalKeyframe:s,onComplete:o}=e;this.isPseudoElement=!!a,this.allowFlatten=r,this.options=e,ey("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function(e){let{type:t,...n}=e;return tE(t)&&tp()?t.applyToOptions(n):(n.duration??(n.duration=300),n.ease??(n.ease="easeOut"),n)}(e);this.animation=function(e,t,n){let{delay:i=0,duration:a=300,repeat:r=0,repeatType:s="loop",ease:o="easeOut",times:l}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,d={[t]:n};l&&(d.offset=l);let u=function e(t,n){if(t)return"function"==typeof t?tp()?tg(t,n):"ease-out":t_(t)?tf(t):Array.isArray(t)?t.map(t=>e(t,n)||th.easeOut):th[t]}(o,a);Array.isArray(u)&&(d.easing=u);let m={delay:i,duration:a,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:"reverse"===s?"alternate":"normal"};c&&(m.pseudoElement=c);let _=e.animate(d,m);return _}(t,n,i,l,a),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){let e=td(i,this.options,s,this.speed);this.updateMotionValue&&this.updateMotionValue(e),ta(t,n,e),this.animation.cancel()}o?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){return Number(this.animation.effect?.getComputedTiming?.().duration||0)/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return(Number(this.animation.currentTime)||0)/1e3}set time(e){let t=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=te(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline(e){let{timeline:t,rangeStart:n,rangeEnd:i,observe:a}=e;return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&tl())?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),e$):a(this)}}let tb=new Set(["opacity","clipPath","filter","transform"]),{schedule:tv}=eW(queueMicrotask,!1);function tT(){t=void 0}let ty={now:()=>(void 0===t&&ty.set(eX.isProcessing||ez.useManualTiming?eX.timestamp:performance.now()),t),set:e=>{t=e,queueMicrotask(tT)}};class tC{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=ty.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=ty.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.current;this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new ti);let n=this.events[e].add(t);return"change"===e?()=>{n(),eQ.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return a&&a.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var e;let t=ty.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;let n=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e=parseFloat(this.current)-parseFloat(this.prevFrameValue),n?1e3/n*e:0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function tN(e,t){return new tC(e,t)}let tx=[...eb,K,ei],tR=new WeakMap;function tO(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function tI(e){return"string"==typeof e||Array.isArray(e)}let tA=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],tw=["initial",...tA];function tD(e){return tO(e.animate)||tw.some(t=>tI(e[t]))}function tL(e){return!!(tD(e)||e.variants)}let tM={current:null},tk={current:!1},tP="u">typeof window;function tF(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function tU(e,t,n,i){if("function"==typeof t){let[a,r]=tF(i);t=t(void 0!==n?n:e.custom,a,r)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){let[a,r]=tF(i);t=t(void 0!==n?n:e.custom,a,r)}return t}let tB=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],tG={};class tj{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:r,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=e4,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=ty.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,eQ.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=t.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=o,this.blockInitialAnimation=!!r,this.isControllingVariants=tD(t),this.isVariantNode=tL(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==l[e]&&eh(t)&&t.set(l[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,tR.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(tk.current||function(){if(tk.current=!0,tP)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>tM.current=e.matches;e.addEventListener("change",t),t()}else tM.current=!1}(),this.shouldReduceMotion=tM.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){for(let e in this.projection&&this.projection.unmount(),eK(this.notifyUpdate),eK(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){let n;if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&tb.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:i,times:a,ease:r,duration:s}=t.accelerate,o=new tS({element:this.current,name:e,keyframes:i,times:a,ease:r,duration:te(s)}),l=n(o);this.valueSubscriptions.set(e,()=>{l(),o.cancel()});return}let i=I.has(e);i&&this.onBindTransform&&this.onBindTransform();let a=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&eQ.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});"u">typeof window&&window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{a(),n&&n(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in tG){let t=tG[e];if(!t)continue;let{isEnabled:n,Feature:i}=t;if(!this.features[e]&&i&&n(this.props)&&(this.features[e]=new i(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ef()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<tB.length;t++){let n=tB[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let i=e["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(e,t,n){for(let i in t){let a=t[i],r=n[i];if(eh(a))e.addValue(i,a);else if(eh(r))e.addValue(i,tN(a,{owner:e}));else if(r!==a)if(e.hasValue(i)){let t=e.getValue(i);!0===t.liveStyle?t.jump(a):t.hasAnimated||t.set(a)}else{let t=e.getStaticValue(i);e.addValue(i,tN(void 0!==t?t:a,{owner:e}))}}for(let i in n)void 0===t[i]&&e.removeValue(i);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=tN(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];if(null!=n){let i,a;if("string"==typeof n&&(i=n,/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(i)||(a=n,/^0[^.\s]+$/u.test(a))))n=parseFloat(n);else{let i;i=n,!tx.find(eS(i))&&ei.test(t)&&(n=e6(e,t))}this.setBaseTarget(e,eh(n)?n.get():n)}return eh(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let t,{initial:n}=this.props;if("string"==typeof n||"object"==typeof n){let i=tU(this.props,n,this.presenceContext?.custom);i&&(t=i[e])}if(n&&void 0!==t)return t;let i=this.getBaseTargetFromProps(this.props,e);return void 0===i||eh(i)?void 0!==this.initialValues[e]&&void 0===t?void 0:this.baseTarget[e]:i}on(e,t){return this.events[e]||(this.events[e]=new ti),this.events[e].add(t)}notify(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){tv.render(this.render)}}class tY extends tj{constructor(){super(...arguments),this.KeyframeResolver=e8}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,t){let{vars:n,style:i}=t;delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;eh(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}function tH(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}let tV=(e,t)=>t&&"number"==typeof e?t.transform(e):e,t$={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tz=O.length;function tq(e,t,n){let{style:i,vars:a,transformOrigin:r}=e,s=!1,o=!1;for(let e in t){let n=t[e];if(I.has(e)){s=!0;continue}if(eN(e)){a[e]=n;continue}{let t=tV(n,ed[e]);e.startsWith("origin")?(o=!0,r[e]=t):i[e]=t}}if(!t.transform&&(s||n?i.transform=function(e,t,n){let i="",a=!0;for(let r=0;r<tz;r++){let s=O[r],o=e[s];if(void 0===o)continue;let l=!0;if("number"==typeof o)l=o===+!!s.startsWith("scale");else{let e=parseFloat(o);l=s.startsWith("scale")?1===e:0===e}if(!l||n){let e=tV(o,ed[s]);if(!l){a=!1;let t=t$[s]||s;i+=`${t}(${e}) `}n&&(t[s]=e)}}return i=i.trim(),n?i=n(t,a?"":i):a&&(i="none"),i}(t,e.transform,n):i.transform&&(i.transform="none")),o){let{originX:e="50%",originY:t="50%",originZ:n=0}=r;i.transformOrigin=`${e} ${t} ${n}`}}let tW={offset:"stroke-dashoffset",array:"stroke-dasharray"},tQ={offset:"strokeDashoffset",array:"strokeDasharray"},tK=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function tX(e,t,n,i,a){let{attrX:r,attrY:s,attrScale:o,pathLength:l,pathSpacing:c=1,pathOffset:d=0,...u}=t;if(tq(e,u,i),n){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:m,style:_}=e;for(let e of(m.transform&&(_.transform=m.transform,delete m.transform),(_.transform||m.transformOrigin)&&(_.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),_.transform&&(_.transformBox=a?.transformBox??"fill-box",delete m.transformBox),tK))void 0!==m[e]&&(_[e]=m[e],delete m[e]);void 0!==r&&(m.x=r),void 0!==s&&(m.y=s),void 0!==o&&(m.scale=o),void 0!==l&&function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=!(arguments.length>4)||void 0===arguments[4]||arguments[4];e.pathLength=1;let r=a?tW:tQ;e[r.offset]=`${-i}`,e[r.array]=`${t} ${n}`}(m,l,c,d,!1)}let tZ=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),tJ=e=>"string"==typeof e&&"svg"===e.toLowerCase();function t0(e,t,n,i){let a,{style:r,vars:s}=t,o=e.style;for(a in r)o[a]=r[a];for(a in i?.applyProjectionStyles(o,n),s)o.setProperty(a,s[a])}function t1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let t2={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e)if(!$.test(e))return e;else e=parseFloat(e);let n=t1(e,t.target.x),i=t1(e,t.target.y);return`${n}% ${i}%`}},t3=(e,t,n)=>e+(t-e)*n,t5={borderRadius:{...t2,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:t2,borderTopRightRadius:t2,borderBottomLeftRadius:t2,borderBottomRightRadius:t2,boxShadow:{correct:(e,t)=>{let{treeScale:n,projectionDelta:i}=t,a=ei.parse(e);if(a.length>5)return e;let r=ei.createTransformer(e),s=+("number"!=typeof a[0]),o=i.x.scale*n.x,l=i.y.scale*n.y;a[0+s]/=o,a[1+s]/=l;let c=t3(o,l,.5);return"number"==typeof a[2+s]&&(a[2+s]/=c),"number"==typeof a[3+s]&&(a[3+s]/=c),r(a)}}};function t4(e,t){let{layout:n,layoutId:i}=t;return I.has(e)||e.startsWith("origin")||(n||void 0!==i)&&(!!t5[e]||"opacity"===e)}function t9(e,t,n){let i=e.style,a=t?.style,r={};if(!i)return r;for(let t in i)(eh(i[t])||a&&eh(a[t])||t4(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(r[t]=i[t]);return r}function t6(e,t,n){let i=t9(e,t,n);for(let n in e)(eh(e[n])||eh(t[n]))&&(i[-1!==O.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return i}class t7 extends tY{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ef}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(I.has(t)){let e=em(t);return e&&e.default||0}return t=tZ.has(t)?t:tH(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return t6(e,t,n)}build(e,t,n){tX(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,i){for(let n in t0(e,t,void 0,i),t.attrs)e.setAttribute(tZ.has(n)?n:tH(n),t.attrs[n])}mount(e){this.isSVGTag=tJ(e.tagName),super.mount(e)}}function t8(e){let{top:t,left:n,right:i,bottom:a}=e;return{x:{min:n,max:i},y:{min:t,max:a}}}function ne(e){return void 0===e||1===e}function nt(e){let{scale:t,scaleX:n,scaleY:i}=e;return!ne(t)||!ne(n)||!ne(i)}function nn(e){return nt(e)||ni(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ni(e){var t,n;return(t=e.x)&&"0%"!==t||(n=e.y)&&"0%"!==n}function na(e,t,n,i,a){return void 0!==a&&(e=i+a*(e-i)),i+n*(e-i)+t}function nr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;e.min=na(e.min,t,n,i,a),e.max=na(e.max,t,n,i,a)}function ns(e,t){let{x:n,y:i}=t;nr(e.x,n.translate,n.scale,n.originPoint),nr(e.y,i.translate,i.scale,i.originPoint)}function no(e,t){e.min+=t,e.max+=t}function nl(e,t,n,i){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,r=t3(e.min,e.max,a);nr(e,t,n,r,i)}function nc(e,t){return"string"==typeof e?parseFloat(e)/100*(t.max-t.min):e}function nd(e,t,n){let i=n??e;nl(e.x,nc(t.x,i.x),t.scaleX,t.scale,t.originX),nl(e.y,nc(t.y,i.y),t.scaleY,t.scale,t.originY)}function nu(e,t){return t8(function(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(e.getBoundingClientRect(),t))}class nm extends tY{constructor(){super(...arguments),this.type="html",this.renderInstance=t0}readValueFromInstance(e,t){if(I.has(t))return this.projection?.isProjecting?eU(t):((e,t)=>{let{transform:n="none"}=getComputedStyle(e);return eB(n,t)})(e,t);{let n=window.getComputedStyle(e),i=(eN(t)?n.getPropertyValue(t):n[t])||0;return"string"==typeof i?i.trim():i}}measureInstanceViewportBox(e,t){let{transformPagePoint:n}=t;return nu(e,n)}build(e,t,n){tq(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return t9(e,t,n)}}let n_=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function np(e){if("string"!=typeof e||e.includes("-"));else if(n_.indexOf(e)>-1||/[A-Z]/u.test(e))return!0;return!1}let ng=(0,c.createContext)({strict:!1}),nf=(0,c.createContext)({});function nh(e){return Array.isArray(e)?e.join(" "):e}let nE=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function nS(e,t,n){for(let i in t)eh(t[i])||t4(i,n)||(e[i]=t[i])}let nb=()=>({...nE(),attrs:{}}),nv=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function nT(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||nv.has(e)}let ny=e=>!nT(e);try{r=(()=>{let e=Error("Cannot find module '@emotion/is-prop-valid'");throw e.code="MODULE_NOT_FOUND",e})().default,"function"==typeof r&&(ny=e=>e.startsWith("on")?!nT(e):r(e))}catch{}function nC(e){return eh(e)?e.get():e}let nN=e=>(t,n)=>{let i=(0,c.useContext)(nf),a=(0,c.useContext)(p),r=()=>(function(e,t,n,i){let{scrapeMotionValuesFromProps:a,createRenderState:r}=e;return{latestValues:function(e,t,n,i){let a={},r=i(e,{});for(let e in r)a[e]=nC(r[e]);let{initial:s,animate:o}=e,l=tD(e),c=tL(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===o&&(o=t.animate));let d=!!n&&!1===n.initial,u=(d=d||!1===s)?o:s;if(u&&"boolean"!=typeof u&&!tO(u)){let t=Array.isArray(u)?u:[u];for(let n=0;n<t.length;n++){let i=tU(e,t[n]);if(i){let{transitionEnd:e,transition:t,...n}=i;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=d?t.length-1:0;t=t[e]}null!==t&&(a[e]=t)}for(let t in e)a[t]=e[t]}}}return a}(t,n,i,a),renderState:r()}})(e,t,i,a);return n?r():m(r)},nx=nN({scrapeMotionValuesFromProps:t9,createRenderState:nE}),nR=nN({scrapeMotionValuesFromProps:t6,createRenderState:nb}),nO={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},nI=!1;function nA(){return!function(){if(nI)return;let e={};for(let t in nO)e[t]={isEnabled:e=>nO[t].some(t=>!!e[t])};tG=e,nI=!0}(),tG}let nw=Symbol.for("motionComponentSymbol"),nD="data-"+tH("framerAppearId"),nL=(0,c.createContext)({});function nM(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function nk(e){let{forwardMotionProps:t=!1,type:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;i&&function(e){let t=nA();for(let n in e)t[n]={...t[n],...e[n]};tG=t}(i);let r=n?"svg"===n:np(e),o=r?nR:nx;function l(n,i){var l;let d,m,g,f={...(0,c.useContext)(E),...n,layoutId:function(e){let{layoutId:t}=e,n=(0,c.useContext)(u).id;return n&&void 0!==t?n+"-"+t:t}(n)},{isStatic:h}=f,S=function(e){let{initial:t,animate:n}=function(e,t){if(tD(e)){let{initial:t,animate:n}=e;return{initial:!1===t||tI(t)?t:void 0,animate:tI(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,c.useContext)(nf));return(0,c.useMemo)(()=>({initial:t,animate:n}),[nh(t),nh(n)])}(n),b=o(n,h);if(!h&&"u">typeof window){(0,c.useContext)(ng).strict;let t=function(e){let{drag:t,layout:n}=nA();if(!t&&!n)return{};let i={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(f);d=t.MeasureLayout,S.visualElement=function(e,t,n,i,a,r){let{visualElement:s}=(0,c.useContext)(nf),o=(0,c.useContext)(ng),l=(0,c.useContext)(p),d=(0,c.useContext)(E),u=d.reducedMotion,m=d.skipAnimations,g=(0,c.useRef)(null),f=(0,c.useRef)(!1);i=i||o.renderer,!g.current&&i&&(g.current=i(e,{visualState:t,parent:s,props:n,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u,skipAnimations:m,isSVG:r}),f.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));let h=g.current,S=(0,c.useContext)(nL);h&&!h.projection&&a&&("html"===h.type||"svg"===h.type)&&function(e,t,n,i){let{layoutId:a,layout:r,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:c,layoutAnchor:d,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:function e(t){if(t)return!1!==t.options.allowProjection?t.projection:e(t.parent)}(e.parent)),e.projection.setOptions({layoutId:a,layout:r,alwaysMeasureLayout:!!s||o&&nM(o),visualElement:e,animationType:"string"==typeof r?r:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:l,layoutRoot:c,layoutAnchor:d})}(g.current,n,a,S);let b=(0,c.useRef)(!1);(0,c.useInsertionEffect)(()=>{h&&b.current&&h.update(n,l)});let v=n[nD],T=(0,c.useRef)(!!v&&"u">typeof window&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return _(()=>{f.current=!0,h&&(b.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),T.current&&h.animationState&&h.animationState.animateChanges())}),(0,c.useEffect)(()=>{h&&(!T.current&&h.animationState&&h.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),T.current=!1),h.enteringChildren=void 0)}),h}(e,b,f,a,t.ProjectionNode,r)}return(0,s.jsxs)(nf.Provider,{value:S,children:[d&&S.visualElement?(0,s.jsx)(d,{visualElement:S.visualElement,...f}):null,function(e,t,n,i,a){let{latestValues:r}=i,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=arguments.length>6?arguments[6]:void 0,l=(o??np(e)?function(e,t,n,i){let a=(0,c.useMemo)(()=>{let n=nb();return tX(n,t,tJ(i),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};nS(t,e.style,e),a.style={...t,...a.style}}return a}:function(e,t){let n,i,a={},r=(n=e.style||{},nS(i={},n,e),Object.assign(i,function(e,t){let{transformTemplate:n}=e;return(0,c.useMemo)(()=>{let e=nE();return tq(e,t,n),Object.assign({},e.vars,e.style)},[t])}(e,t)),i);return e.drag&&!1!==e.dragListener&&(a.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":`pan-${"x"===e.drag?"y":"x"}`),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(a.tabIndex=0),a.style=r,a})(t,r,a,e),d=function(e,t,n){let i={};for(let a in e)("values"!==a||"object"!=typeof e.values)&&!eh(e[a])&&(ny(a)||!0===n&&nT(a)||!t&&!nT(a)||e.draggable&&a.startsWith("onDrag"))&&(i[a]=e[a]);return i}(t,"string"==typeof e,s),u=e!==c.Fragment?{...d,...l,ref:n}:{},{children:m}=t,_=(0,c.useMemo)(()=>eh(m)?m.get():m,[m]);return(0,c.createElement)(e,{...u,children:_})}(e,n,(l=S.visualElement,m=(0,c.useRef)(i),(0,c.useInsertionEffect)(()=>{m.current=i}),g=(0,c.useRef)(null),(0,c.useCallback)(e=>{e&&b.onMount?.(e);let t=m.current;if("function"==typeof t)if(e){let n=t(e);"function"==typeof n&&(g.current=n)}else g.current?(g.current(),g.current=null):t(e);else t&&(t.current=e);l&&(e?l.mount(e):l.unmount())},[l])),b,h,t,r)]})}l.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;let d=(0,c.forwardRef)(l);return d[nw]=e,d}class nP{constructor(e){this.isMounted=!1,this.node=e}update(){}}function nF(e,t,n){let i=e.getProps();return tU(i,t,void 0!==n?n:i.custom,e)}function nU(e,t){if(e?.inherit&&t){let{inherit:n,...i}=e;return{...t,...i}}return e}function nB(e,t){let n=e?.[t]??e?.default??e;return n!==e?nU(n,e):n}let nG=e=>Array.isArray(e);function nj(e,t){let n=e.getValue("willChange");if(eh(n)&&n.add)return n.add(t);if(!n&&ez.WillChange){let n=new ez.WillChange("auto");e.addValue("willChange",n),n.add(t)}}let nY=(e,t)=>n=>t(e(n)),nH=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(nY)};function nV(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function n$(e,t){return n=>n>0?t:e}let nz=(e,t,n)=>{let i=e*e,a=n*(t*t-i)+i;return a<0?0:Math.sqrt(a)},nq=[j,G,Q];function nW(e){let t=nq.find(t=>t.test(e));if(eT(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===Q&&(n=function(e){let{hue:t,saturation:n,lightness:i,alpha:a}=e;t/=360,i/=100;let r=0,s=0,o=0;if(n/=100){let e=i<.5?i*(1+n):i+n-i*n,a=2*i-e;r=nV(a,e,t+1/3),s=nV(a,e,t),o=nV(a,e,t-1/3)}else r=s=o=i;return{red:Math.round(255*r),green:Math.round(255*s),blue:Math.round(255*o),alpha:a}}(n)),n}let nQ=(e,t)=>{let n=nW(e),i=nW(t);if(!n||!i)return n$(e,t);let a={...n};return e=>(a.red=nz(n.red,i.red,e),a.green=nz(n.green,i.green,e),a.blue=nz(n.blue,i.blue,e),a.alpha=t3(n.alpha,i.alpha,e),G.transform(a))},nK=new Set(["none","hidden"]);function nX(e,t){return n=>t3(e,t,n)}function nZ(e){return"number"==typeof e?nX:"string"==typeof e?eR(e)?n$:K.test(e)?nQ:n1:Array.isArray(e)?nJ:"object"==typeof e?K.test(e)?nQ:n0:n$}function nJ(e,t){let n=[...e],i=n.length,a=e.map((e,n)=>nZ(e)(e,t[n]));return e=>{for(let t=0;t<i;t++)n[t]=a[t](e);return n}}function n0(e,t){let n={...e,...t},i={};for(let a in n)void 0!==e[a]&&void 0!==t[a]&&(i[a]=nZ(e[a])(e[a],t[a]));return e=>{for(let t in i)n[t]=i[t](e);return n}}let n1=(e,t)=>{let n=ei.createTransformer(t),i=et(e),a=et(t);if(!(i.indexes.var.length===a.indexes.var.length&&i.indexes.color.length===a.indexes.color.length&&i.indexes.number.length>=a.indexes.number.length))return eT(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),n$(e,t);if(nK.has(e)&&!a.values.length||nK.has(t)&&!i.values.length)return nK.has(e)?n=>n<=0?e:t:n=>n>=1?t:e;return nH(nJ(function(e,t){let n=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){let r=t.types[a],s=e.indexes[r][i[r]],o=e.values[s]??0;n[a]=o,i[r]++}return n}(i,a),a.values),n)};function n2(e,t,n){return"number"==typeof e&&"number"==typeof t&&"number"==typeof n?t3(e,t,n):nZ(e)(e,t)}let n3=e=>{let t=t=>{let{timestamp:n}=t;return e(n)};return{start:function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return eQ.update(t,e)},stop:()=>eK(t),now:()=>eX.isProcessing?eX.timestamp:ty.now()}};function n5(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}let n4=.01,n9=2,n6=.005,n7=.5;function n8(e,t){return e*Math.sqrt(1-t*t)}let ie=["duration","bounce"],it=["stiffness","damping","mass"];function ii(e,t){return t.some(t=>void 0!==e[t])}function ia(){let e,t,n,i,a,r,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.3,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.3,l="object"!=typeof s?{visualDuration:s,keyframes:[0,1],bounce:o}:s,{restSpeed:c,restDelta:d}=l,u=l.keyframes[0],m=l.keyframes[l.keyframes.length-1],_={done:!1,value:u},{stiffness:p,damping:g,mass:f,duration:h,velocity:E,isResolvedFromDuration:S}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!ii(e,it)&&ii(e,ie))if(t.velocity=0,e.visualDuration){let n=2*Math.PI/(1.2*e.visualDuration),i=n*n,a=2*A(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:1,stiffness:i,damping:a}}else{let n=function(e){let t,n,{duration:i=800,bounce:a=.3,velocity:r=0,mass:s=1}=e;eT(i<=te(10),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-a;o=A(.05,1,o),i=A(.01,10,i/1e3),o<1?(t=e=>{let t=e*o,n=t*i;return .001-(t-r)/n8(e,o)*Math.exp(-n)},n=e=>{let n=e*o*i,a=Math.pow(o,2)*Math.pow(e,2)*i,s=Math.exp(-n),l=n8(Math.pow(e,2),o);return(n*r+r-a)*s*(-t(e)+.001>0?-1:1)/l}):(t=e=>-.001+Math.exp(-e*i)*((e-r)*i+1),n=e=>i*i*(r-e)*Math.exp(-e*i));let l=function(e,t,n){let i=n;for(let n=1;n<12;n++)i-=e(i)/t(i);return i}(t,n,5/i);if(i=te(i),isNaN(l))return{stiffness:100,damping:10,duration:i};{let e=Math.pow(l,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:i}}}({...e,velocity:0});(t={...t,...n,mass:1}).isResolvedFromDuration=!0}return t}({...l,velocity:-((l.velocity||0)/1e3)}),b=E||0,v=g/(2*Math.sqrt(p*f)),T=m-u,y=Math.sqrt(p/f)/1e3,C=5>Math.abs(T);if(c||(c=C?n4:n9),d||(d=C?n6:n7),v<1)n=n8(y,v),i=(b+v*y*T)/n,e=e=>m-Math.exp(-v*y*e)*(i*Math.sin(n*e)+T*Math.cos(n*e)),a=v*y*i+T*n,r=v*y*T-i*n,t=e=>Math.exp(-v*y*e)*(a*Math.sin(n*e)+r*Math.cos(n*e));else if(1===v){e=e=>m-Math.exp(-y*e)*(T+(b+y*T)*e);let n=b+y*T;t=e=>Math.exp(-y*e)*(y*n*e-b)}else{let n=y*Math.sqrt(v*v-1);e=e=>{let t=Math.exp(-v*y*e),i=Math.min(n*e,300);return m-t*((b+v*y*T)*Math.sinh(i)+n*T*Math.cosh(i))/n};let i=(b+v*y*T)/n,a=v*y*i-T*n,r=v*y*T-i*n;t=e=>{let t=Math.exp(-v*y*e),i=Math.min(n*e,300);return t*(a*Math.sinh(i)+r*Math.cosh(i))}}let N={calculatedDuration:S&&h||null,velocity:e=>te(t(e)),next:s=>{if(!S&&v<1){let e=Math.exp(-v*y*s),t=Math.sin(n*s),o=Math.cos(n*s),l=m-e*(i*t+T*o);return _.done=Math.abs(te(e*(a*t+r*o)))<=c&&Math.abs(m-l)<=d,_.value=_.done?m:l,_}let o=e(s);return S?_.done=s>=h:_.done=Math.abs(te(t(s)))<=c&&Math.abs(m-o)<=d,_.value=_.done?m:o,_},toString:()=>{let e=Math.min(n5(N),2e4),t=tg(t=>N.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return N}function ir(e,t,n){var i,a;let r=Math.max(t-5,0);return i=n-e(r),(a=t-r)?1e3/a*i:0}function is(e){let t,n,{keyframes:i,velocity:a=0,power:r=.8,timeConstant:s=325,bounceDamping:o=10,bounceStiffness:l=500,modifyTarget:c,min:d,max:u,restDelta:m=.5,restSpeed:_}=e,p=i[0],g={done:!1,value:p},f=r*a,h=p+f,E=void 0===c?h:c(h);E!==h&&(f=E-p);let S=e=>-f*Math.exp(-e/s),b=e=>E+S(e),v=e=>{let t=S(e),n=b(e);g.done=Math.abs(t)<=m,g.value=g.done?E:n},T=e=>{let i;if(i=g.value,void 0!==d&&i<d||void 0!==u&&i>u){var a;t=e,n=ia({keyframes:[g.value,(a=g.value,void 0===d?u:void 0===u||Math.abs(d-a)<Math.abs(u-a)?d:u)],velocity:ir(b,e,g.value),damping:o,stiffness:l,restDelta:m,restSpeed:_})}};return T(0),{calculatedDuration:null,next:e=>{let i=!1;return(n||void 0!==t||(i=!0,v(e),T(e)),void 0!==t&&e>=t)?n.next(e-t):(i||v(e),g)}}}ia.applyToOptions=e=>{let t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=arguments.length>2?arguments[2]:void 0,i=n({...e,keyframes:[0,t]}),a=Math.min(n5(i),2e4);return{type:"keyframes",ease:e=>i.next(a*e).value/t,duration:a/1e3}}(e,100,ia);return e.ease=t.ease,e.duration=te(t.duration),e.type="keyframes",e};let io=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function il(e,t,n,i){return e===t&&n===i?e$:a=>0===a||1===a?a:io(function(e,t,n,i,a){let r,s,o=0;do(r=io(s=t+(n-t)/2,i,a)-e)>0?n=s:t=s;while(Math.abs(r)>1e-7&&++o<12)return s}(a,0,1,e,n),t,i)}let ic=il(.42,0,1,1),id=il(0,0,.58,1),iu=il(.42,0,.58,1),im=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,i_=e=>t=>1-e(1-t),ip=il(.33,1.53,.69,.99),ig=i_(ip),ih=im(ig),iE=e=>e>=1?1:(e*=2)<1?.5*ig(e):.5*(2-Math.pow(2,-10*(e-1))),iS=e=>1-Math.sin(Math.acos(e)),ib=i_(iS),iv=im(iS),iT={linear:e$,easeIn:ic,easeInOut:iu,easeOut:id,circIn:iS,circInOut:iv,circOut:ib,backIn:ig,backInOut:ih,backOut:ip,anticipate:iE},iy=e=>{if(t_(e)){ey(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,n,i,a]=e;return il(t,n,i,a)}return"string"==typeof e?(ey(void 0!==iT[e],`Invalid easing type '${e}'`,"invalid-easing-type"),iT[e]):e},iC=(e,t,n)=>{let i=t-e;return 0===i?1:(n-e)/i};function iN(e){var t;let n,{duration:i=300,keyframes:a,times:r,ease:s="easeInOut"}=e,o=Array.isArray(s)&&"number"!=typeof s[0]?s.map(iy):iy(s),l={done:!1,value:a[0]},c=function(e,t){let{clamp:n=!0,ease:i,mixer:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.length;if(ey(r===t.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>t[0];if(2===r&&t[0]===t[1])return()=>t[1];let s=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());let o=function(e,t,n){let i=[],a=n||ez.mix||n2,r=e.length-1;for(let n=0;n<r;n++){let r=a(e[n],e[n+1]);t&&(r=nH(Array.isArray(t)?t[n]||e$:t,r)),i.push(r)}return i}(t,i,a),l=o.length,c=n=>{if(s&&n<e[0])return t[0];let i=0;if(l>1)for(;i<e.length-2&&!(n<e[i+1]);i++);let a=iC(e[i],e[i+1],n);return o[i](a)};return n?t=>c(A(e[0],e[r-1],t)):c}((t=r&&r.length===a.length?r:(!function(e,t){let n=e[e.length-1];for(let i=1;i<=t;i++){let a=iC(0,t,i);e.push(t3(n,1,a))}}(n=[0],a.length-1),n),t.map(e=>e*i)),a,{ease:Array.isArray(o)?o:a.map(()=>o||iu).splice(0,a.length-1)});return{calculatedDuration:i,next:e=>(l.value=c(e),l.done=e>=i,l)}}let ix={decay:is,inertia:is,tween:iN,keyframes:iN,spring:ia};function iR(e){"string"==typeof e.type&&(e.type=ix[e.type])}let iO=e=>e/100;class iI extends tu{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==ty.now()&&this.tick(ty.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},tm.mainThread++,this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){let{options:e}=this;iR(e);let{type:t=iN,repeat:n=0,repeatDelay:i=0,repeatType:a,velocity:r=0}=e,{keyframes:s}=e,o=t||iN;o!==iN&&"number"!=typeof s[0]&&(this.mixKeyframes=nH(iO,n2(s[0],s[1])),s=[0,100]);let l=o({...e,keyframes:s});"mirror"===a&&(this.mirroredGenerator=o({...e,keyframes:[...s].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=n5(l));let{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e){let t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{generator:i,totalDuration:a,mixKeyframes:r,mirroredGenerator:s,resolvedDuration:o,calculatedDuration:l}=this;if(null===this.startTime)return i.next(0);let{delay:c=0,keyframes:d,repeat:u,repeatType:m,repeatDelay:_,type:p,onUpdate:g,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-a/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);let h=this.currentTime-c*(this.playbackSpeed>=0?1:-1),E=this.playbackSpeed>=0?h<0:h>a;this.currentTime=Math.max(h,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=a);let S=this.currentTime,b=i;if(u){let e=Math.min(this.currentTime,a)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,(t=Math.min(t,u+1))%2&&("reverse"===m?(n=1-n,_&&(n-=_/o)):"mirror"===m&&(b=s)),S=A(0,1,n)*o}E?(this.delayState.value=d[0],t=this.delayState):t=b.next(S),r&&!E&&(t.value=r(t.value));let{done:v}=t;E||null===l||(v=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);let T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&v);return T&&p!==is&&(t.value=td(d,this.options,f,this.speed)),g&&g(t.value),T&&this.finish(),t}then(e,t){return this.finished.then(e,t)}get duration(){return this.calculatedDuration/1e3}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+e/1e3}get time(){return this.currentTime/1e3}set time(e){e=te(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return ir(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(ty.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:e=n3,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();let n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=t??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ty.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,tm.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}let iA={anticipate:iE,backInOut:ih,circInOut:iv};class iw extends tS{constructor(e){!function(e){"string"==typeof e.ease&&e.ease in iA&&(e.ease=iA[e.ease])}(e),iR(e),super(e),void 0!==e.startTime&&!1!==e.autoplay&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:i,element:a,...r}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);let s=new iI({...r,autoplay:!1}),o=Math.max(10,ty.now()-this.startTime),l=A(0,10,o-10),c=s.sample(o).value,{name:d}=this.options;a&&d&&ta(a,d,c),t.setWithVelocity(s.sample(Math.max(0,o-l)).value,c,l),s.stop()}}let iD=(e,t)=>"zIndex"!==t&&!!("number"==typeof e||Array.isArray(e)||"string"==typeof e&&(ei.test(e)||"0"===e)&&!e.startsWith("url("));function iL(e){e.duration=0,e.type="keyframes"}let iM=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/,ik=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),iP=tr(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class iF extends tu{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:r="loop",keyframes:s,name:o,motionValue:l,element:c,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ty.now();const u={autoplay:e,delay:t,type:n,repeat:i,repeatDelay:a,repeatType:r,name:o,motionValue:l,element:c,...d},m=c?.KeyframeResolver||e4;this.keyframeResolver=new m(s,(e,t,n)=>this.onKeyframesResolved(e,t,u,!n),o,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,i){let a;this.keyframeResolver=void 0;let{name:r,type:s,velocity:o,delay:l,isHandoff:c,onUpdate:d}=n;this.resolvedAt=ty.now();let u=!0;!function(e,t,n,i){let a=e[0];if(null===a)return!1;if("display"===t||"visibility"===t)return!0;let r=e[e.length-1],s=iD(a,t),o=iD(r,t);return eT(s===o,`You are trying to animate ${t} from "${a}" to "${r}". "${s?r:a}" is not an animatable value.`,"value-not-animatable"),!!s&&!!o&&(function(e){let t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||tE(n))&&i)}(e,r,s,o)&&(u=!1,(ez.instantAnimations||!l)&&d?.(td(e,n,t)),e[0]=e[e.length-1],iL(n),n.repeat=0);let m={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},_=u&&!c&&function(e){let{motionValue:t,name:n,repeatDelay:i,repeatType:a,damping:r,type:s,keyframes:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:c}=t.owner.getProps();return iP()&&n&&(tb.has(n)||ik.has(n)&&function(e){for(let t=0;t<e.length;t++)if("string"==typeof e[t]&&iM.test(e[t]))return!0;return!1}(o))&&("transform"!==n||!c)&&!l&&!i&&"mirror"!==a&&0!==r&&"inertia"!==s}(m),p=m.motionValue?.owner?.current;if(_)try{a=new iw({...m,element:p})}catch{a=new iI(m)}else a=new iI(m);a.finished.then(()=>{this.notifyFinished()}).catch(e$),this.pendingTimeline&&(this.stopTimeline=a.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=a}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),e2=!0,e5(),e3(),e2=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let iU={type:"spring",stiffness:500,damping:25,restSpeed:10},iB={type:"keyframes",duration:.8},iG={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ij=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]),iY=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0;return s=>{let o=nB(i,e)||{},l=o.delay||i.delay||0,{elapsed:c=0}=i;c-=te(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-c,onUpdate:e=>{t.set(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{s(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:r?void 0:a};!function(e){for(let t in e)if(!ij.has(t))return!0;return!1}(o)&&Object.assign(d,((e,t)=>{let{keyframes:n}=t;return n.length>2?iB:I.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===n[1]?2*Math.sqrt(550):30,restSpeed:10}:iU:iG})(e,d)),d.duration&&(d.duration=te(d.duration)),d.repeatDelay&&(d.repeatDelay=te(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let u=!1;if(!1!==d.type&&(0!==d.duration||d.repeatDelay)||(iL(d),0===d.delay&&(u=!0)),(ez.instantAnimations||ez.skipAnimations||a?.shouldSkipAnimations)&&(u=!0,iL(d),d.delay=0),d.allowFlatten=!o.type&&!o.ease,u&&!r&&void 0!==t.get()){let e=td(d.keyframes,o);if(void 0!==e)return void eQ.update(()=>{d.onUpdate(e),d.onComplete()})}return o.isSync?new iI(d):new iF(d)}};function iH(e,t){let{delay:n=0,transitionOverride:i,type:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{transition:r,transitionEnd:s,...o}=t,l=e.getDefaultTransition();r=r?nU(r,l):l;let c=r?.reduceMotion;i&&(r=i);let d=[],u=a&&e.animationState&&e.animationState.getState()[a];for(let t in o){let i=e.getValue(t,e.latestValues[t]??null),a=o[t];if(void 0===a||u&&function(e,t){let{protectedKeys:n,needsAnimating:i}=e,a=n.hasOwnProperty(t)&&!0!==i[t];return i[t]=!1,a}(u,t))continue;let s={delay:n,...nB(r||{},t)},l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(a)&&a===l&&!s.velocity){eQ.update(()=>i.set(a));continue}let m=!1;if(window.MotionHandoffAnimation){let n=e.props[nD];if(n){let e=window.MotionHandoffAnimation(n,t,eQ);null!==e&&(s.startTime=e,m=!0)}}nj(e,t);let _=c??e.shouldReduceMotion;i.start(iY(t,i,a,_&&eE.has(t)?{type:!1}:s,e,m));let p=i.animation;p&&d.push(p)}if(s){let t=()=>eQ.update(()=>{s&&function(e,t){let{transitionEnd:n={},transition:i={},...a}=nF(e,t)||{};for(let t in a={...a,...n}){var r;let n=nG(r=a[t])?r[r.length-1]||0:r;e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,tN(n))}}(e,s)});d.length?Promise.all(d).then(t):t()}return d}function iV(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),s=e.size,o=(s-1)*i;return"function"==typeof n?n(r,s):1===a?r*i:o-r*i}function i$(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=nF(e,t,"exit"===n.type?e.presenceContext?.custom:void 0),{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);let r=i?()=>Promise.all(iH(e,i,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,{delayChildren:r=0,staggerChildren:s,staggerDirection:o}=a;return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6?arguments[6]:void 0,o=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),o.push(i$(l,t,{...s,delay:n+("function"==typeof i?0:i)+iV(e.variantChildren,l,i,a,r)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(o)}(e,t,i,r,s,o,n)}:()=>Promise.resolve(),{when:o}=a;if(!o)return Promise.all([r(),s(n.delay)]);{let[e,t]="beforeChildren"===o?[r,s]:[s,r];return e().then(()=>t())}}let iz=tw.length;function iq(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}let iW=[...tA].reverse(),iQ=tA.length;function iK(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function iX(){return{animate:iK(!0),whileInView:iK(),whileHover:iK(),whileTap:iK(),whileDrag:iK(),whileFocus:iK(),exit:iK()}}let iZ=0;function iJ(e){return[e("x"),e("y")]}function i0(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{passive:!0};return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}let i1={x:!1,y:!1};function i2(e){return e.max-e.min}function i3(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;e.origin=i,e.originPoint=t3(t.min,t.max,e.origin),e.scale=i2(n)/i2(t),e.translate=t3(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function i5(e,t,n,i){i3(e.x,t.x,n.x,i?i.originX:void 0),i3(e.y,t.y,n.y,i?i.originY:void 0)}function i4(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;e.min=(i?t3(n.min,n.max,i):n.min)+t.min,e.max=e.min+i2(t)}function i9(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=i?t3(n.min,n.max,i):n.min;e.min=t.min-a,e.max=e.min+i2(t)}function i6(e,t,n,i){i9(e.x,t.x,n.x,i?.x),i9(e.y,t.y,n.y,i?.y)}function i7(e){return g(e)&&"ownerSVGElement"in e}function i8(e,t,n){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){let i=document;t&&(i=t.current);let a=n?.[e]??i.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(e=>null!=e)}let ae=new WeakMap,at=(e,t,n)=>(i,a)=>a&&a[0]?a[0][e+"Size"]:i7(i)&&"getBBox"in i?i.getBBox()[t]:i[n],an=at("inline","width","offsetWidth"),ai=at("block","height","offsetHeight");function aa(e){let{target:t,borderBoxSize:n}=e;ae.get(t)?.forEach(e=>{e(t,{get width(){return an(t,n)},get height(){return ai(t,n)}})})}function ar(e){e.forEach(aa)}let as=new Set;function ao(e,t){let a;return"function"==typeof e?(as.add(e),i||(i=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};as.forEach(t=>t(e))},window.addEventListener("resize",i)),()=>{as.delete(e),as.size||"function"!=typeof i||(window.removeEventListener("resize",i),i=void 0)}):(!n&&"u">typeof ResizeObserver&&(n=new ResizeObserver(ar)),(a=i8(e)).forEach(e=>{let i=ae.get(e);i||(i=new Set,ae.set(e,i)),i.add(t),n?.observe(e)}),()=>{a.forEach(e=>{let i=ae.get(e);i?.delete(t),i?.size||n?.unobserve(e)})})}let al=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),ac=new Set(["INPUT","SELECT","TEXTAREA"]),ad=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function au(e){return{point:{x:e.pageX,y:e.pageY}}}function am(e,t,n,i){return i0(e,t,e=>ad(e)&&n(e,au(e)),i)}let a_=e=>{let{current:t}=e;return t?t.ownerDocument.defaultView:null},ap=(e,t)=>Math.abs(e-t),ag=new Set(["auto","scroll"]);class af{constructor(e,t,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:a=!1,distanceThreshold:r=3,element:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{var e,t;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ah(this.lastRawMoveEventInfo,this.transformPagePoint));let n=aS(this.lastMoveEventInfo,this.history),i=null!==this.startEvent,a=(e=n.offset,t={x:0,y:0},Math.sqrt(ap(e.x,t.x)**2+ap(e.y,t.y)**2)>=this.distanceThreshold);if(!i&&!a)return;let{point:r}=n,{timestamp:s}=eX;this.history.push({...r,timestamp:s});let{onStart:o,onMove:l}=this.handlers;i||(o&&o(this.lastMoveEvent,n),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,n)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=ah(t,this.transformPagePoint),eQ.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:i,resumeAnimation:a}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&a&&a(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let r=aS("pointercancel"===e.type?this.lastMoveEventInfo:ah(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,r),i&&i(e,r)},!ad(e))return;this.dragSnapToOrigin=a,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=r,this.contextWindow=i||window;const o=ah(au(e),this.transformPagePoint),{point:l}=o,{timestamp:c}=eX;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=t;d&&d(e,aS(o,this.history)),this.removeListeners=nH(am(this.contextWindow,"pointermove",this.handlePointerMove),am(this.contextWindow,"pointerup",this.handlePointerUp),am(this.contextWindow,"pointercancel",this.handlePointerUp)),s&&this.startScrollTracking(s)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(ag.has(e.overflowX)||ag.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},a={x:i.x-t.x,y:i.y-t.y};(0!==a.x||0!==a.y)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(e,i),eQ.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),eK(this.updatePoint)}}function ah(e,t){return t?{point:t(e.point)}:e}function aE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function aS(e,t){let{point:n}=e;return{point:n,delta:aE(n,ab(t)),offset:aE(n,t[0]),velocity:function(e){if(e.length<2)return{x:0,y:0};let t=e.length-1,n=null,i=ab(e);for(;t>=0&&(n=e[t],!(i.timestamp-n.timestamp>te(.1)));)t--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&i.timestamp-n.timestamp>2*te(.1)&&(n=e[1]);let a=(i.timestamp-n.timestamp)/1e3;if(0===a)return{x:0,y:0};let r={x:(i.x-n.x)/a,y:(i.y-n.y)/a};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}(t)}}function ab(e){return e[e.length-1]}function av(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function aT(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,i]=[i,n]),{min:n,max:i}}function ay(e,t,n){return{min:aC(e,t),max:aC(e,n)}}function aC(e,t){return"number"==typeof e?e:e[t]||0}let aN=new WeakMap;class ax{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ef(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e){let{snapToCursor:t=!1,distanceThreshold:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;let a=e=>{t&&this.snapToCursor(au(e).point),this.stopAnimation()},r=(e,t)=>{let{drag:n,dragPropagation:i,onDragStart:a}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){if("x"===e||"y"===e)if(i1[e])return null;else return i1[e]=!0,()=>{i1[e]=!1};return i1.x||i1.y?null:(i1.x=i1.y=!0,()=>{i1.x=i1.y=!1})}(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),iJ(e=>{let t=this.getAxisMotionValue(e).get()||0;if(V.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let i=n.layout.layoutBox[e];i&&(t=i2(i)*(parseFloat(t)/100))}}this.originPoint[e]=t}),a&&eQ.update(()=>a(e,t),!1,!0),nj(this.visualElement,"transform");let{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:i,onDirectionLock:a,onDrag:r}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:s}=t;if(i&&null===this.currentDirection){this.currentDirection=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(s),null!==this.currentDirection&&a&&a(this.currentDirection);return}this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),r&&eQ.update(()=>r(e,t),!1,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new af(e,{onSessionStart:a,onStart:r,onMove:s,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:a_(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!n)return;let{velocity:r}=i;this.startAnimation(r);let{onDragEnd:s}=this.getProps();s&&eQ.postRender(()=>s(n,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:i}=this.getProps();if(!n||!aO(e,i,this.currentDirection))return;let a=this.getAxisMotionValue(e),r=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(r=function(e,t,n){let{min:i,max:a}=t;return void 0!==i&&e<i?e=n?t3(i,e,n.min):Math.max(e,i):void 0!==a&&e>a&&(e=n?t3(a,e,n.max):Math.min(e,a)),e}(r,this.constraints[e],this.elastic[e])),a.set(r)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&nM(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=function(e,t){let{top:n,left:i,bottom:a,right:r}=t;return{x:av(e.x,i,r),y:av(e.y,n,a)}}(n.layoutBox,e):this.constraints=!1,this.elastic=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.35;return!1===e?e=0:!0===e&&(e=.35),{x:ay(e,"left","right"),y:ay(e,"top","bottom")}}(t),i!==this.constraints&&!nM(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&iJ(e=>{var t,i;let a;!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=(t=n.layoutBox[e],i=this.constraints[e],a={},void 0!==i.min&&(a.min=i.min-t.min),void 0!==i.max&&(a.max=i.max-t.min),a))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!nM(t))return!1;let i=t.current;ey(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:a}=this.visualElement;if(!a||!a.layout)return!1;let r=function(e,t,n){let i=nu(e,n),{scroll:a}=t;return a&&(no(i.x,a.offset.x),no(i.y,a.offset.y)),i}(i,a.root,this.visualElement.getTransformPagePoint()),s=(e=a.layout.layoutBox,{x:aT(e.x,r.x),y:aT(e.y,r.y)});if(n){let e=n(function(e){let{x:t,y:n}=e;return{top:n.min,right:t.max,bottom:n.max,left:t.min}}(s));this.hasMutatedConstraints=!!e,e&&(s=t8(e))}return s}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:i,dragTransition:a,dragSnapToOrigin:r,onDragTransitionEnd:s}=this.getProps(),o=this.constraints||{};return Promise.all(iJ(s=>{if(!aO(s,t,this.currentDirection))return;let l=o&&o[s]||{};(!0===r||r===s)&&(l={min:0,max:0});let c={type:"inertia",velocity:n?e[s]:0,bounceStiffness:i?200:1e6,bounceDamping:i?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...a,...l};return this.startAxisValueAnimation(s,c)})).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return nj(this.visualElement,e),n.start(iY(e,n,0,t,this.visualElement,!1))}stopAnimation(){iJ(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){iJ(t=>{let{drag:n}=this.getProps();if(!aO(t,n,this.currentDirection))return;let{projection:i}=this.visualElement,a=this.getAxisMotionValue(t);if(i&&i.layout){let{min:n,max:r}=i.layout.layoutBox[t],s=a.get()||0;a.set(e[t]-t3(n,r,.5)+s)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!nM(t)||!n||!this.constraints)return;this.stopAnimation();let i={x:0,y:0};iJ(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){var n,a;let r,s,o,l=t.get();i[e]=(n={min:l,max:l},a=this.constraints[e],r=.5,s=i2(n),(o=i2(a))>s?r=iC(a.min,a.max-s,n.min):s>o&&(r=iC(n.min,n.max-o,a.min)),A(0,1,r))}});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),iJ(t=>{if(!aO(t,e,null))return;let n=this.getAxisMotionValue(t),{min:a,max:r}=this.constraints[t];n.set(t3(a,r,i[t]))}),this.visualElement.render()}addListeners(){let e;if(!this.visualElement.current)return;aN.set(this.visualElement,this);let t=this.visualElement.current,n=am(t,"pointerdown",e=>{let{drag:n,dragListener:i=!0}=this.getProps(),a=e.target,r=a!==t&&(ac.has(a.tagName)||!0===a.isContentEditable);n&&i&&!r&&this.start(e)}),i=()=>{var n,i,a;let r,s,{dragConstraints:o}=this.getProps();nM(o)&&o.current&&(this.constraints=this.resolveRefConstraints(),e||(n=t,i=o.current,r=ao(n,aR(a=()=>this.scalePositionWithinConstraints())),s=ao(i,aR(a)),e=()=>{r(),s()}))},{projection:a}=this.visualElement,r=a.addEventListener("measure",i);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),eQ.read(i);let s=i0(window,"resize",()=>this.scalePositionWithinConstraints()),o=a.addEventListener("didUpdate",e=>{let{delta:t,hasLayoutChanged:n}=e;this.isDragging&&n&&(iJ(e=>{let n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),n(),r(),o&&o(),e&&e()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:r=.35,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:i,dragConstraints:a,dragElastic:r,dragMomentum:s}}}function aR(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function aO(e,t,n){return(!0===t||t===e)&&(null===n||n===e)}let aI=e=>(t,n)=>{e&&eQ.update(()=>e(t,n),!1,!0)},aA={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var aw=c;let aD=!1;class aL extends aw.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:i}=this.props,{projection:a}=e;a&&(t.group&&t.group.add(a),n&&n.register&&i&&n.register(a),aD&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),aA.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:i,isPresent:a}=this.props,{projection:r}=n;return r&&(r.isPresent=a,e.layoutDependency!==t&&r.setOptions({...r.options,layoutDependency:t}),aD=!0,i||e.layoutDependency!==t||void 0===t||e.isPresent!==a?r.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?r.promote():r.relegate()||eQ.postRender(()=>{let e=r.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),tv.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:i}=e;aD=!0,i&&(i.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function aM(e){let[t,n]=C(),i=(0,aw.useContext)(u);return(0,s.jsx)(aL,{...e,layoutGroup:i,switchLayoutGroup:(0,aw.useContext)(nL),isPresent:t,safeToRemove:n})}let ak=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],aP=ak.length,aF=e=>"string"==typeof e?parseFloat(e):e,aU=e=>"number"==typeof e||$.test(e);function aB(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let aG=aY(0,.5,ib),aj=aY(.5,.95,e$);function aY(e,t,n){return i=>i<e?0:i>t?1:n(iC(e,t,i))}function aH(e,t){e.min=t.min,e.max=t.max}function aV(e,t){aH(e.x,t.x),aH(e.y,t.y)}function a$(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function az(e,t,n,i,a){return e-=t,e=i+1/n*(e-i),void 0!==a&&(e=i+1/a*(e-i)),e}function aq(e,t,n,i,a){let[r,s,o]=n;!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,a=arguments.length>4?arguments[4]:void 0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:e;if(V.test(t)&&(t=parseFloat(t),t=t3(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let o=t3(r.min,r.max,i);e===r&&(o-=t),e.min=az(e.min,t,n,o,a),e.max=az(e.max,t,n,o,a)}(e,t[r],t[s],t[o],t.scale,i,a)}let aW=["x","scaleX","originX"],aQ=["y","scaleY","originY"];function aK(e,t,n,i){aq(e.x,t,aW,n?n.x:void 0,i?i.x:void 0),aq(e.y,t,aQ,n?n.y:void 0,i?i.y:void 0)}function aX(e){return 0===e.translate&&1===e.scale}function aZ(e){return aX(e.x)&&aX(e.y)}function aJ(e,t){return e.min===t.min&&e.max===t.max}function a0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function a1(e,t){return a0(e.x,t.x)&&a0(e.y,t.y)}function a2(e){return i2(e.x)/i2(e.y)}function a3(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class a5{constructor(){this.members=[]}add(e){tt(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let i=n.instance;i&&!1!==i.isConnected||n.snapshot||(tn(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(tn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(!1!==e.isPresent&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:i}=n.options,{layoutDependency:a}=e.options;(void 0===i||i!==a)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),!1===e.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}let a4=(e,t)=>e.depth-t.depth;class a9{constructor(){this.children=[],this.isDirty=!1}add(e){tt(this.children,e),this.isDirty=!0}remove(e){tn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(a4),this.isDirty=!1,this.children.forEach(e)}}let a6=["","X","Y","Z"],a7=0;function a8(e,t,n,i){let{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),i&&(i[e]=0))}function re(e){let{attachResizeListener:t,defaultParent:n,measureScroll:i,checkIsScrollRoot:a,resetTransform:r}=e;return class{constructor(e={},t=n?.()){this.id=a7++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(ri),this.nodes.forEach(rm),this.nodes.forEach(r_),this.nodes.forEach(ra)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=t?t.root||t:this,this.path=t?[...t.path,t]:[],this.parent=t,this.depth=t?t.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new a9)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ti),this.eventHandlers.get(e).add(t)}notifyListeners(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];let a=this.eventHandlers.get(e);a&&a.notify(...n)}hasListeners(e){return this.eventHandlers.has(e)}mount(e){if(this.instance)return;this.isSVG=i7(e)&&!(i7(e)&&"svg"===e.tagName),this.instance=e;let{layoutId:n,layout:i,visualElement:a}=this.options;if(a&&!a.current&&a.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||n)&&(this.isLayoutDirty=!0),t){let n,i=0,a=()=>this.root.updateBlockedByResize=!1;eQ.read(()=>{i=window.innerWidth}),t(e,()=>{let e=window.innerWidth;if(e!==i){let t,r;i=e,this.root.updateBlockedByResize=!0,n&&n(),t=ty.now(),r=e=>{let{timestamp:n}=e,i=n-t;i>=250&&(eK(r),a(i-250))},eQ.setup(r,!0),n=()=>eK(r),aA.hasAnimatedSinceResize&&(aA.hasAnimatedSinceResize=!1,this.nodes.forEach(ru))}})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&a&&(n||i)&&this.addEventListener("didUpdate",e=>{let{delta:t,hasLayoutChanged:n,hasRelativeLayoutChanged:i,layout:r}=e;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let s=this.options.transition||a.getDefaultTransition()||rS,{onLayoutAnimationStart:o,onLayoutAnimationComplete:l}=a.getProps(),c=!this.targetLayout||!a1(this.targetLayout,r),d=!n&&i;if(this.options.layoutRoot||this.resumeFrom||d||n&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let e={...nB(s,"layout"),onPlay:o,onComplete:l};(a.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,d)}else n||ru(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),eK(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(rp),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function e(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;let{visualElement:n}=t.options;if(!n)return;let i=n.props[nD];if(window.MotionHasOptimisedAnimation(i,"transform")){let{layout:e,layoutId:n}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",eQ,!(e||n))}let{parent:a}=t;a&&!a.hasCheckedOptimisedAppear&&e(a)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,("string"==typeof t.latestValues.x||"string"==typeof t.latestValues.y)&&(t.isLayoutDirty=!0),t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;let i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(ro),this.nodes.forEach(rs);return}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(rl);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(rc),this.nodes.forEach(rd),this.nodes.forEach(rt),this.nodes.forEach(rn)):this.nodes.forEach(rl),this.clearAllSnapshots();let e=ty.now();eX.delta=A(0,1e3/60,e-eX.timestamp),eX.timestamp=e,eX.isProcessing=!0,eZ.update.process(eX),eZ.preRender.process(eX),eZ.render.process(eX),eX.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tv.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(rr),this.sharedNodes.forEach(rg)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,eQ.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){eQ.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||i2(this.snapshot.measuredBox.x)||i2(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=ef()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"measure",t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=a(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!r)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!aZ(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,a=i!==this.prevTransformTemplateValue;e&&this.instance&&(t||nn(this.latestValues)||a)&&(r(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(){var e;let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0],n=this.measurePageBox(),i=this.removeElementScroll(n);return t&&(i=this.removeTransform(i)),rT((e=i).x),rT(e.y),{animationId:this.root.animationId,measuredBox:n,layoutBox:i,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return ef();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(rC))){let{scroll:e}=this.root;e&&(no(t.x,e.offset.x),no(t.y,e.offset.y))}return t}removeElementScroll(e){let t=ef();if(aV(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let i=this.path[n],{scroll:a,options:r}=i;i!==this.root&&a&&r.layoutScroll&&(a.wasRoot&&aV(t,e),no(t.x,a.offset.x),no(t.y,a.offset.y))}return t}applyTransform(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,i=n||ef();aV(i,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(no(i.x,-n.scroll.offset.x),no(i.y,-n.scroll.offset.y)),nn(n.latestValues)&&nd(i,n.latestValues,n.layout?.layoutBox)}return nn(this.latestValues)&&nd(i,this.latestValues,this.layout?.layoutBox),i}removeTransform(e){let t=ef();aV(t,e);for(let e=0;e<this.path.length;e++){let n,i=this.path[e];nn(i.latestValues)&&(i.instance&&(nt(i.latestValues)&&i.updateSnapshot(),aV(n=ef(),i.measurePageBox())),aK(t,i.latestValues,i.snapshot?.layoutBox,n))}return nn(this.latestValues)&&aK(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==eX.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=t.isSharedProjectionDirty);let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:i,layoutId:a}=this.options;if(!this.layout||!(i||a))return;this.resolvedRelativeTargetAt=eX.timestamp;let r=this.getClosestProjectingParent();if(r&&this.linkedParentVersion!==r.layoutVersion&&!r.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&r&&r.layout?this.createRelativeTarget(r,this.layout.layoutBox,r.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=ef(),this.targetWithTransforms=ef()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var s,o,l,c;this.forceRelativeParentToResolveTarget(),s=this.target,o=this.relativeTarget,l=this.relativeParent.target,c=this.options.layoutAnchor||void 0,i4(s.x,o.x,l.x,c?.x),i4(s.y,o.y,l.y,c?.y)}else this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):aV(this.target,this.layout.layoutBox),ns(this.target,this.targetDelta)):aV(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&r&&!!r.resumingFrom==!!this.resumingFrom&&!r.options.layoutScroll&&r.target&&1!==this.animationProgress?this.createRelativeTarget(r,this.target,r.target):this.relativeParent=this.relativeTarget=void 0)}}getClosestProjectingParent(){if(!(!this.parent||nt(this.parent.latestValues)||ni(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ef(),this.relativeTargetOrigin=ef(),i6(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),aV(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===eX.timestamp&&(n=!1),n)return;let{layout:i,layoutId:a}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(i||a))return;aV(this.layoutCorrected,this.layout.layoutBox);let r=this.treeScale.x,s=this.treeScale.y;!function(e,t,n){let i,a,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=n.length;if(s){t.x=t.y=1;for(let o=0;o<s;o++){a=(i=n[o]).projectionDelta;let{visualElement:s}=i.options;(!s||!s.props.style||"contents"!==s.props.style.display)&&(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(no(e.x,-i.scroll.offset.x),no(e.y,-i.scroll.offset.y)),a&&(t.x*=a.x.scale,t.y*=a.y.scale,ns(e,a)),r&&nn(i.latestValues)&&nd(e,i.latestValues,i.layout?.layoutBox))}t.x<1.0000000000001&&t.x>.999999999999&&(t.x=1),t.y<1.0000000000001&&t.y>.999999999999&&(t.y=1)}}(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=ef());let{target:o}=e;if(!o){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(a$(this.prevProjectionDelta.x,this.projectionDelta.x),a$(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),i5(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.treeScale.x===r&&this.treeScale.y===s&&a3(this.projectionDelta.x,this.prevProjectionDelta.x)&&a3(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ep(),this.projectionDelta=ep(),this.projectionDeltaWithTransform=ep()}setAnimationOrigin(e){let t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.snapshot,a=i?i.latestValues:{},r={...this.latestValues},s=ep();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!n;let o=ef(),l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),d=!c||c.members.length<=1,u=!!(l&&!d&&!0===this.options.crossfade&&!this.path.some(rE));this.animationProgress=0,this.mixTargetDelta=n=>{let i=n/1e3;if(rf(s.x,e.x,i),rf(s.y,e.y,i),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var c,m,_,p,g,f;i6(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),_=this.relativeTarget,p=this.relativeTargetOrigin,g=o,f=i,rh(_.x,p.x,g.x,f),rh(_.y,p.y,g.y,f),t&&(c=this.relativeTarget,m=t,aJ(c.x,m.x)&&aJ(c.y,m.y))&&(this.isProjectionDirty=!1),t||(t=ef()),aV(t,this.relativeTarget)}l&&(this.animationValues=r,function(e,t,n,i,a,r){a?(e.opacity=t3(0,n.opacity??1,aG(i)),e.opacityExit=t3(t.opacity??1,0,aj(i))):r&&(e.opacity=t3(t.opacity??1,n.opacity??1,i));for(let a=0;a<aP;a++){let r=ak[a],s=aB(t,r),o=aB(n,r);(void 0!==s||void 0!==o)&&(s||(s=0),o||(o=0),0===s||0===o||aU(s)===aU(o)?(e[r]=Math.max(t3(aF(s),aF(o),i),0),(V.test(o)||V.test(s))&&(e[r]+="%")):e[r]=o)}(t.rotate||n.rotate)&&(e.rotate=t3(t.rotate||0,n.rotate||0,i))}(r,a,this.latestValues,i,u,d)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(eK(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=eQ.update(()=>{var t,n,i;let a;aA.hasAnimatedSinceResize=!0,tm.layout++,this.motionValue||(this.motionValue=tN(0)),this.motionValue.jump(0,!1),this.currentAnimation=(t=this.motionValue,n=[0,1e3],i={...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{tm.layout--},onComplete:()=>{tm.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}},(a=eh(t)?t:tN(t)).start(iY("",a,n,i)),a.animation),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:i,latestValues:a}=e;if(t&&n&&i){if(this!==e&&this.layout&&i&&ry(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||ef();let t=i2(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let i=i2(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+i}aV(t,n),nd(t,a),i5(this.projectionDeltaWithTransform,this.layoutCorrected,t,a)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new a5),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote(){let{needsReset:e,transition:t,preserveFollowOpacity:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.getStack();i&&i.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let i={};n.z&&a8("z",e,i,this.animationValues);for(let t=0;t<a6.length;t++)a8(`rotate${a6[t]}`,e,i,this.animationValues),a8(`skew${a6[t]}`,e,i,this.animationValues);for(let t in e.render(),i)e.setStaticValue(t,i[t]),this.animationValues&&(this.animationValues[t]=i[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility="hidden";return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=nC(t?.pointerEvents)||"",e.transform=n?n(this.latestValues,""):"none";return}let i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=nC(t?.pointerEvents)||""),this.hasProjected&&!nn(this.latestValues)&&(e.transform=n?n({},""):"none",this.hasProjected=!1);return}e.visibility="";let a=i.animationValues||i.latestValues;this.applyTransformsToTarget();let r=function(e,t,n){let i="",a=e.x.translate/t.x,r=e.y.translate/t.y,s=n?.z||0;if((a||r||s)&&(i=`translate3d(${a}px, ${r}px, ${s}px) `),(1!==t.x||1!==t.y)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:a,rotateY:r,skewX:s,skewY:o}=n;e&&(i=`perspective(${e}px) ${i}`),t&&(i+=`rotate(${t}deg) `),a&&(i+=`rotateX(${a}deg) `),r&&(i+=`rotateY(${r}deg) `),s&&(i+=`skewX(${s}deg) `),o&&(i+=`skewY(${o}deg) `)}let o=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==o||1!==l)&&(i+=`scale(${o}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,a);n&&(r=n(a,r)),e.transform=r;let{x:s,y:o}=this.projectionDelta;for(let t in e.transformOrigin=`${100*s.origin}% ${100*o.origin}% 0`,i.animationValues?e.opacity=i===this?a.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:e.opacity=i===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0,t5){if(void 0===a[t])continue;let{correct:n,applyTo:s,isCSSVariable:o}=t5[t],l="none"===r?a[t]:n(a[t],i);if(s){let t=s.length;for(let n=0;n<t;n++)e[s[n]]=l}else o?this.options.visualElement.renderState.vars[t]=l:e[t]=l}this.options.layoutId&&(e.pointerEvents=i===this?nC(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(rs),this.root.sharedNodes.clear()}}}function rt(e){e.updateLayout()}function rn(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:n,measuredBox:i}=e.layout,{animationType:a}=e.options,r=t.source!==e.layout.source;if("size"===a)iJ(e=>{let i=r?t.measuredBox[e]:t.layoutBox[e],a=i2(i);i.min=n[e].min,i.max=i.min+a});else if("x"===a||"y"===a){let e="x"===a?"y":"x";aH(r?t.measuredBox[e]:t.layoutBox[e],n[e])}else ry(a,t.layoutBox,n)&&iJ(i=>{let a=r?t.measuredBox[i]:t.layoutBox[i],s=i2(n[i]);a.max=a.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[i].max=e.relativeTarget[i].min+s)});let s=ep();i5(s,n,t.layoutBox);let o=ep();r?i5(o,e.applyTransform(i,!0),t.measuredBox):i5(o,n,t.layoutBox);let l=!aZ(s),c=!1;if(!e.resumeFrom){let i=e.getClosestProjectingParent();if(i&&!i.resumeFrom){let{snapshot:a,layout:r}=i;if(a&&r){let s=e.options.layoutAnchor||void 0,o=ef();i6(o,t.layoutBox,a.layoutBox,s);let l=ef();i6(l,n,r.layoutBox,s),a1(o,l)||(c=!0),i.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=o,e.relativeParent=i)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:o,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function ri(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function ra(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function rr(e){e.clearSnapshot()}function rs(e){e.clearMeasurements()}function ro(e){e.isLayoutDirty=!0,e.updateLayout()}function rl(e){e.isLayoutDirty=!1}function rc(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function rd(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ru(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rm(e){e.resolveTargetDelta()}function r_(e){e.calcProjection()}function rp(e){e.resetSkewAndRotation()}function rg(e){e.removeLeadSnapshot()}function rf(e,t,n){e.translate=t3(t.translate,0,n),e.scale=t3(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function rh(e,t,n,i){e.min=t3(t.min,n.min,i),e.max=t3(t.max,n.max,i)}function rE(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let rS={duration:.45,ease:[.4,0,.1,1]},rb=e=>"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),rv=rb("applewebkit/")&&!rb("chrome/")?Math.round:e$;function rT(e){e.min=rv(e.min),e.max=rv(e.max)}function ry(e,t,n){return"position"===e||"preserve-aspect"===e&&!(.2>=Math.abs(a2(t)-a2(n)))}function rC(e){return e!==e.root&&e.scroll?.wasRoot}let rN=re({attachResizeListener:(e,t)=>i0(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),rx={current:void 0},rR=re({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!rx.current){let e=new rN({});e.mount(window),e.setOptions({layoutScroll:!0}),rx.current=e}return rx.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position});function rO(e,t){let n=i8(e),i=new AbortController;return[n,{passive:!0,...t,signal:i.signal},()=>i.abort()]}function rI(e,t,n){let{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover","Start"===n);let a=i["onHover"+n];a&&eQ.postRender(()=>a(t,au(t)))}let rA=(e,t)=>!!t&&(e===t||rA(e,t.parentElement)),rw=new WeakSet;function rD(e){return t=>{"Enter"===t.key&&e(t)}}function rL(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function rM(e){return ad(e)&&!(i1.x||i1.y)}let rk=new WeakSet;function rP(e,t,n){let{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap","Start"===n);let a=i["onTap"+("End"===n?"":n)];a&&eQ.postRender(()=>a(t,au(t)))}let rF=new WeakMap,rU=new WeakMap,rB=e=>{let t=rF.get(e.target);t&&t(e)},rG=e=>{e.forEach(rB)},rj={some:0,all:1},rY=function(e,t){if("u"<typeof Proxy)return nk;let n=new Map,i=(n,i)=>nk(n,i,e,t);return new Proxy((e,t)=>i(e,t),{get:(a,r)=>"create"===r?i:(n.has(r)||n.set(r,nk(r,void 0,e,t)),n.get(r))})}({animation:{Feature:class extends nP{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(t=>{let{animation:n,options:i}=t;return function(e,t){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e.notify("AnimationStart",t),Array.isArray(t))n=Promise.all(t.map(t=>i$(e,t,i)));else if("string"==typeof t)n=i$(e,t,i);else{let a="function"==typeof t?nF(e,t,i.custom):t;n=Promise.all(iH(e,a,i))}return n.then(()=>{e.notify("AnimationComplete",t)})}(e,n,i)})),n=iX(),i=!0,a=!1,r=t=>(n,i)=>{let a=nF(e,i,"exit"===t?e.presenceContext?.custom:void 0);if(a){let{transition:e,transitionEnd:t,...i}=a;n={...n,...i,...t}}return n};function s(s){let{props:o}=e,l=function e(t){if(!t)return;if(!t.isControllingVariants){let n=t.parent&&e(t.parent)||{};return void 0!==t.props.initial&&(n.initial=t.props.initial),n}let n={};for(let e=0;e<iz;e++){let i=tw[e],a=t.props[i];(tI(a)||!1===a)&&(n[i]=a)}return n}(e.parent)||{},c=[],d=new Set,u={},m=1/0;for(let t=0;t<iQ;t++){var _,p;let g=iW[t],f=n[g],h=void 0!==o[g]?o[g]:l[g],E=tI(h),S=g===s?f.isActive:null;!1===S&&(m=t);let b=h===l[g]&&h!==o[g]&&E;if(b&&(i||a)&&e.manuallyAnimateOnMount&&(b=!1),f.protectedKeys={...u},!f.isActive&&null===S||!h&&!f.prevProp||tO(h)||"boolean"==typeof h)continue;if("exit"===g&&f.isActive&&!0!==S){f.prevResolvedValues&&(u={...u,...f.prevResolvedValues});continue}let v=(_=f.prevProp,"string"==typeof(p=h)?p!==_:!!Array.isArray(p)&&!iq(p,_)),T=v||g===s&&f.isActive&&!b&&E||t>m&&E,y=!1,C=Array.isArray(h)?h:[h],N=C.reduce(r(g),{});!1===S&&(N={});let{prevResolvedValues:x={}}=f,R={...x,...N},O=t=>{T=!0,d.has(t)&&(y=!0,d.delete(t)),f.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in R){let t=N[e],n=x[e];if(!u.hasOwnProperty(e))(nG(t)&&nG(n)?iq(t,n):t===n)?void 0!==t&&d.has(e)?O(e):f.protectedKeys[e]=!0:null!=t?O(e):d.add(e)}f.prevProp=h,f.prevResolvedValues=N,f.isActive&&(u={...u,...N}),(i||a)&&e.blockInitialAnimation&&(T=!1);let I=b&&v,A=!I||y;T&&A&&c.push(...C.map(t=>{let n={type:g};if("string"==typeof t&&(i||a)&&!I&&e.manuallyAnimateOnMount&&e.parent){let{parent:i}=e,a=nF(i,t);if(i.enteringChildren&&a){let{delayChildren:t}=a.transition||{};n.delay=iV(i.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(d.size){let t={};if("boolean"!=typeof o.initial){let n=nF(e,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(t.transition=n.transition)}d.forEach(n=>{let i=e.getBaseTarget(n),a=e.getValue(n);a&&(a.liveStyle=!0),t[n]=i??null}),c.push({animation:t})}let g=!!c.length;return i&&(!1===o.initial||o.initial===o.animate)&&!e.manuallyAnimateOnMount&&(g=!1),i=!1,a=!1,g?t(c):Promise.resolve()}return{animateChanges:s,setActive:function(t,i){if(n[t].isActive===i)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,i)),n[t].isActive=i;let a=s(t);for(let e in n)n[e].protectedKeys={};return a},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=iX(),a=!0}}}(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();tO(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends nP{constructor(){super(...arguments),this.id=iZ++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&!1===n){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if("string"==typeof e){let n=nF(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...i}=n;for(let e in i)this.node.getValue(e)?.jump(i[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}let i=this.node.animationState.setActive("exit",!e);t&&!e&&i.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}},inView:{Feature:class extends nP{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var e;let t;this.stopObserver?.();let{viewport:n={}}=this.node.getProps(),{root:i,margin:a,amount:r="some",once:s}=n,o={root:i?i.current:void 0,rootMargin:a,threshold:"number"==typeof r?r:rj[r]},l=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,s&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),a=t?n:i;a&&a(e)};this.stopObserver=(e=this.node.current,t=function(e){let{root:t,...n}=e,i=t||document;rU.has(i)||rU.set(i,{});let a=rU.get(i),r=JSON.stringify(n);return a[r]||(a[r]=new IntersectionObserver(rG,{root:t,...n})),a[r]}(o),rF.set(e,l),t.observe(e),()=>{rF.delete(e),t.unobserve(e)})}mount(){this.startObserver()}update(){if("u"<typeof IntersectionObserver)return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function(e){let{viewport:t={}}=e,{viewport:n={}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e=>t[e]!==n[e]}(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends nP{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},[i,a,r]=rO(e,n),s=e=>{let i=e.currentTarget;if(!rM(e)||rk.has(e))return;rw.add(i),n.stopPropagation&&rk.add(e);let r=t(i,e),s=(e,t)=>{window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",l),rw.has(i)&&rw.delete(i),rM(e)&&"function"==typeof r&&r(e,{success:t})},o=e=>{s(e,i===window||i===document||n.useGlobalTarget||rA(i,e.target))},l=e=>{s(e,!1)};window.addEventListener("pointerup",o,a),window.addEventListener("pointercancel",l,a)};return i.forEach(e=>{((n.useGlobalTarget?window:e).addEventListener("pointerdown",s,a),f(e))&&(e.addEventListener("focus",e=>((e,t)=>{let n=e.currentTarget;if(!n)return;let i=rD(()=>{if(rw.has(n))return;rL(n,"down");let e=rD(()=>{rL(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>rL(n,"cancel"),t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)})(e,a)),al.has(e.tagName)||!0===e.isContentEditable||e.hasAttribute("tabindex")||(e.tabIndex=0))}),r}(e,(e,t)=>(rP(this.node,t,"Start"),(e,t)=>{let{success:n}=t;return rP(this.node,e,n?"End":"Cancel")}),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}}},focus:{Feature:class extends nP{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=nH(i0(this.node.current,"focus",()=>this.onFocus()),i0(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends nP{mount(){let{current:e}=this.node;e&&(this.unmount=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},[i,a,r]=rO(e,n);return i.forEach(e=>{let n,i=!1,r=!1,s=t=>{n&&(n(t),n=void 0),e.removeEventListener("pointerleave",l)},o=e=>{i=!1,window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",o),r&&(r=!1,s(e))},l=e=>{if("touch"!==e.pointerType){if(i){r=!0;return}s(e)}};e.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||i1.x||i1.y)return;r=!1;let s=t(e,i);"function"==typeof s&&(n=s,e.addEventListener("pointerleave",l,a))},a),e.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",o,a),window.addEventListener("pointercancel",o,a)},a)}),r}(e,(e,t)=>(rI(this.node,t,"Start"),e=>rI(this.node,e,"End"))))}unmount(){}}},pan:{Feature:class extends nP{constructor(){super(...arguments),this.removePointerDownListener=e$}onPointerDown(e){this.session=new af(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:a_(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:aI(e),onStart:aI(t),onMove:aI(n),onEnd:(e,t)=>{delete this.session,i&&eQ.postRender(()=>i(e,t))}}}mount(){this.removePointerDownListener=am(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends nP{constructor(e){super(e),this.removeGroupControls=e$,this.removeListeners=e$,this.controls=new ax(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||e$}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:rR,MeasureLayout:aM},layout:{ProjectionNode:rR,MeasureLayout:aM}},(e,t)=>t.isSVG??np(e)?new t7(t):new nm(t,{allowProjection:e!==c.Fragment}));var rH=e.i(352819),rV=e.i(385459),r$=e.i(742921),rz=e.i(143100),rq=e.i(679935),rW=e.i(353533),rQ=e.i(399267),rK=e.i(3450);let rX=["Yes","Yes,","No","Accept","Decline","Open System Settings","Try again","Use this","Continue without","Resume from summary","Resume full session","Continue this conversation","Send message as","Don't ask me again"],rZ=/^\s*(?:[❯›>]\s+)?(.+)$/,rJ=/^\s*[❯›>]\s+/,r0=/^(\d+)\.\s+/,r1=/^\s*([❯›>])?\s*(?:[↓↑]\s*)?(\d+)\.?\s*(\S.*)$/,r2=/^[\s─━\-]+$/,r3=e=>e.replace(r0,""),r5=e=>e.match(r0)?.[1]??null,r4=(e,t)=>e.some(e=>r3(e).startsWith(t)),r9=e=>e.match(/^\s*/)?.[0].length??0,r6=e=>e.trim().replace(/^[☐☑]\s*/,"").trim(),r7=e=>/^[\s]*[☐☑]\s*\S/.test(e),r8=/^(Yes,\s*and\s+don[\u2019']?t\s+ask)\s*:\s*(.+)$/,se=e=>!(e.length<2)&&(r4(e,"Yes")&&r4(e,"No")||r4(e,"Accept")&&r4(e,"Decline")||r4(e,"Open System Settings")||r4(e,"Use this")&&r4(e,"Continue without")||r4(e,"Resume from summary")&&r4(e,"Resume full session")||r4(e,"Continue this conversation")&&r4(e,"Send message as")),st=(e,t,n)=>({...e,...((e,t)=>{if(t<=0)return{};let n=t-1;for(;n>=0&&(!e[n].trim()||r2.test(e[n]));)n-=1;let i=[];for(;n>=0&&e[n].trim()&&!r2.test(e[n]);)i.unshift(r6(e[n])),n-=1;for(;n>=0&&(!e[n].trim()||r2.test(e[n]));)n-=1;let a=[],r=[];for(;n>=0&&e[n].trim()&&!r2.test(e[n]);)r.unshift(e[n]),a.unshift(r6(e[n])),n-=1;let s=i.join("\n").trim(),o=r.some(r7)?a.join("\n").trim():"";return{...o&&{title:o},...s&&{request:s}}})(t,n)});e.s(["optionNumber",0,r5,"parsePermissionOptions",0,e=>{let t=e.split("\n"),n=(e=>{let t=[],n=[],i=0,a=1,r=0,s=-1,o=()=>{n.length>=2&&t.push({rawOptions:n.slice(),focusedIndex:i,optionStartIndex:s}),n=[],i=0,a=1,r=0,s=-1};for(let t=0;t<e.length;t+=1){let l=e[t];if(!l.trim())continue;let c=l.match(r1);if(c){let e=c[1],d=Number(c[2]),u=c[3].trim();if(u.length>0){if(1===d){o(),n.push(u),e&&(i=0),r=r9(l),s=t,a=2;continue}if(d===a){e&&(i=n.length),n.push(u),r=r9(l),a+=1;continue}}}if(n.length>0){if(r9(l)>r){n[n.length-1]+=l.trimStart();continue}if(/^\s+\S/.test(l))continue;o()}}o();let l=t[t.length-1];return l?{...st({options:l.rawOptions.map((e,t)=>{let n;return`${t+1}. ${(n=e.match(r8))?`${n[1]} again for: ${n[2].trim()}`:/^Yes(?![,\s]|$)/.test(e)?"Yes":/^No(?![,\s]|$)/.test(e)?"No":e}`}),focusedIndex:l.focusedIndex},e,l.optionStartIndex)}:{options:[],focusedIndex:0}})(t);if(n.options.length>=2&&se(n.options))return n;let i=(e=>{let t=[],n=0,i=-1,a=!1,r=0;for(let s=0;s<e.length;s+=1){let o=e[s];if(!o.trim()){if(a)break;continue}let l=rJ.test(o),c=/^\s+\S/.test(o);if(!l&&!c){if(a&&/^[a-z]/.test(o.trim())){t[t.length-1]+=o.trim();continue}if(a)break;continue}let d=o.match(rZ);if(!d)continue;let u=d[1].trim(),m=r3(u);rX.some(e=>m.startsWith(e))?(0===t.length&&(i=s),l&&(n=t.length),t.push(u),a=!0,r=r9(o)):a&&!l&&r9(o)>r&&(t[t.length-1]+=o.trim())}return st({options:t,focusedIndex:n},e,i)})(t);return se(i.options)?i:{options:[],focusedIndex:0}},"stripNumberPrefix",0,r3],601726);let sn={options:[]},si=async e=>{try{let t=await fetch(`/api/tmux/permission-options?session=${encodeURIComponent(e)}`);if(!t.ok)return sn;let n=await t.json();return{title:"string"==typeof n.title?n.title:void 0,request:"string"==typeof n.request?n.request:void 0,options:Array.isArray(n.options)?n.options:[]}}catch{return sn}},sa=async(e,t,n)=>{try{return(await fetch("/api/tmux/send-input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:e,input:r5(n)??String(t+1)})})).ok}catch{return!1}},sr=[500,1e3,2e3,4e3],ss={initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4,scale:.98},transition:{duration:.18,ease:[.2,.8,.2,1]}},so=(0,c.memo)(e=>{let{sessionName:t,tabId:n,silent:i=!1}=e,a=(0,rH.useTranslations)("timeline"),[r,o]=(0,c.useState)(null),[l,d]=(0,c.useState)(sn),[u,m]=(0,c.useState)("loading"),[_,p]=(0,c.useState)(!1),g=(0,rQ.default)(e=>n?e.tabs[n]?.cliState:void 0),f=(0,rQ.default)(e=>n?e.tabs[n]?.lastEvent?.seq:void 0);(0,c.useEffect)(()=>{let e=!1,n=null;o(null),d(sn),m("loading"),p(!1);let a=i?0:sr.length,r=async i=>{let s=await si(t);if(!e){if(s.options.length>0){d(s),m("ready");return}if(i>=a)return void m("failed");n=setTimeout(()=>r(i+1),sr[i])}};return r(0),()=>{e=!0,n&&clearTimeout(n)}},[t,g,f,i]);let h=null===r,E=(0,c.useCallback)(async e=>{if(null===r){if(o(e),!await sa(t,e,l.options[e]??"")){o(null),rq.toast.error(a("selectionFailed"));return}n&&void 0!==f&&(0,rK.ackNotificationInput)(n,f),p(!0)}},[t,r,l.options,a,n,f]);return(0,s.jsx)(R,{initial:!1,children:_?null:"loading"===u?i?null:(0,s.jsx)(rY.div,{...ss,className:"mt-2",children:(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-claude-active/20 bg-claude-active/5 px-4 py-3 text-xs text-claude-active",children:[(0,s.jsx)(rz.Loader2,{size:14,className:"animate-spin"}),(0,s.jsx)("span",{children:a("permissionLoading")})]})},"loading"):"failed"===u?i?null:(0,s.jsx)(rY.div,{...ss,className:"mt-2",children:(0,s.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-amber-500/30 bg-amber-500/5 px-4 py-3 text-xs text-amber-600 dark:text-amber-400",children:[(0,s.jsx)(r$.ShieldAlert,{size:14,className:"mt-0.5 shrink-0"}),(0,s.jsx)("span",{children:a("permissionParseFailed")})]})},"failed"):(0,s.jsx)(rY.div,{...ss,className:"mt-2",children:(0,s.jsxs)("div",{className:"rounded-lg border border-claude-active/20 bg-claude-active/5 px-4 py-3",children:[(0,s.jsxs)("div",{className:"mb-2.5 flex items-center gap-2 text-xs font-medium text-claude-active",children:[(0,s.jsx)(rV.ShieldCheck,{size:14}),(0,s.jsx)("span",{children:l.title||a("permissionRequired")})]}),l.request&&(0,s.jsx)("p",{className:"mb-3 whitespace-pre-wrap text-sm leading-relaxed text-foreground",children:l.request}),(0,s.jsx)("div",{className:"flex flex-col gap-1.5",children:l.options.map((e,t)=>{let n=r===t,i=null!==r&&!n;return(0,s.jsxs)("button",{type:"button",disabled:!h,onClick:()=>E(t),className:(0,rW.cn)("flex items-start gap-2.5 rounded-md border px-3 py-2 text-left text-sm transition-colors",n?"border-claude-active/40 bg-claude-active/10":i?"border-border/30 opacity-50":"border-border/50",h&&"cursor-pointer hover:border-claude-active/30 hover:bg-claude-active/5"),children:[(0,s.jsx)("span",{className:(0,rW.cn)("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded text-xs font-medium",n?"bg-claude-active text-white":"bg-muted text-muted-foreground"),children:t+1}),(0,s.jsx)("span",{className:"min-w-0 flex-1 font-medium",children:r3(e)})]},t)})})]})},"ready")})});e.s(["default",0,so],954996);var sl=e.i(222564),sc=e.i(189257),sd=e.i(909725);let su={exec:"Exec","apply-patch":"ApplyPatch",permissions:"Permissions"},sm={pending:"text-ui-amber",success:"text-ui-teal",error:"text-negative"},s_=(0,c.memo)(e=>{var t;let{entry:n}=e,i=su[n.approvalKind],a=sm[n.status],r="pending"===n.status?"animate-pulse":"",o="success"===(t=n.status)?{text:"승인됨",Icon:sc.Check,tone:"text-ui-teal"}:"error"===t?{text:"거부됨",Icon:sd.X,tone:"text-negative"}:{text:"대기 중",Icon:null,tone:"text-ui-amber"},l=o.Icon;return(0,s.jsx)("div",{className:"animate-in fade-in py-1 duration-150",role:"article",children:(0,s.jsxs)("div",{className:"rounded-md border border-ui-blue/30 bg-ui-blue/5 px-3 py-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(sl.AlertCircle,{size:14,className:(0,rW.cn)("shrink-0",a,r)}),(0,s.jsx)("span",{className:"text-xs font-medium text-foreground/90",children:"권한 요청"}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",i,")"]})]}),n.command&&(0,s.jsxs)("div",{className:"mt-1.5 ml-0.5 break-all font-mono text-xs text-foreground/90",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"$ "}),n.command]}),n.cwd&&(0,s.jsxs)("div",{className:"mt-0.5 ml-0.5 break-all font-mono text-[11px] text-muted-foreground/70",children:["cwd: ",n.cwd]}),n.patches&&n.patches.length>0&&(0,s.jsx)("div",{className:"mt-1.5 ml-0.5 space-y-0.5",children:n.patches.map((e,t)=>(0,s.jsxs)("div",{className:"break-all font-mono text-[11px]",children:[(0,s.jsx)("span",{className:"text-foreground/90",children:e.path}),e.status&&(0,s.jsxs)("span",{className:"ml-1.5 text-muted-foreground/60",children:["(",e.status,")"]})]},`${e.path}-${t}`))}),n.permissions&&n.permissions.length>0&&(0,s.jsx)("div",{className:"mt-1.5 ml-0.5 flex flex-wrap gap-1",children:n.permissions.map((e,t)=>(0,s.jsx)("span",{className:"rounded-sm bg-muted/60 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e},`${e}-${t}`))}),(0,s.jsxs)("div",{className:(0,rW.cn)("mt-2 flex items-center gap-1 text-xs",o.tone),children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"결과:"}),l&&(0,s.jsx)(l,{size:12}),(0,s.jsx)("span",{children:o.text})]})]})})});e.s(["default",0,s_],42054);var sp=e.i(444957),sg=e.i(377216),sf=e.i(21152);let sh={pending:"text-ui-amber",success:"text-muted-foreground",error:"text-negative"},sE=(0,c.memo)(e=>{let{entry:t}=e,[n,i]=(0,c.useState)(!1),a=t.stdout??"",r=t.stderr??"",o=a.length>0||r.length>0,l=(e=>{if(null==e||!Number.isFinite(e))return null;if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;return t<60?`${t.toFixed(1)}s`:`${Math.floor(t/60)}m ${Math.round(t%60)}s`})(t.durationMs),d=t.parsedCommand??t.command,u=sh[t.status],m="pending"===t.status?"animate-pulse":"";return(0,s.jsxs)("div",{className:"animate-in fade-in py-1 duration-150",role:"article",children:[(0,s.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,s.jsx)(sf.Terminal,{size:12,className:(0,rW.cn)("mt-0.5 shrink-0",u,m)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"text-xs font-mono break-all",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"$ "}),(0,s.jsx)("span",{children:d})]}),(0,s.jsxs)("div",{className:"mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground/70",children:[null!=t.exitCode&&(0,s.jsxs)("span",{className:0===t.exitCode?"":"text-negative",children:["exit ",t.exitCode]}),l&&(0,s.jsxs)("span",{children:["· ",l]}),t.truncated&&(0,s.jsx)("span",{children:"· truncated"})]})]})]}),o&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),"aria-expanded":n,className:"ml-4 mt-1 inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground",children:[n?(0,s.jsx)(sp.ChevronDown,{size:10}):(0,s.jsx)(sg.ChevronRight,{size:10}),(0,s.jsx)("span",{children:n?"출력 숨기기":"출력 보기"})]}),n&&(0,s.jsxs)("div",{className:"ml-4 mt-1.5 max-h-[320px] overflow-auto rounded border border-border/40 bg-muted/40 p-2 font-mono text-[11px]",children:[a&&(0,s.jsx)("pre",{className:"whitespace-pre-wrap break-words text-foreground/90",children:a}),r&&(0,s.jsx)("pre",{className:"mt-2 whitespace-pre-wrap break-words text-negative/80",children:r})]})]})]})});e.s(["default",0,sE],44158);var sS=e.i(878528);let sb={pending:"text-ui-amber",success:"text-ui-teal",error:"text-negative"},sv=(0,c.memo)(e=>{let{entry:t}=e,n=sb[t.status],i="pending"===t.status?"animate-pulse":"",a=t.resultsSummary??(null!=t.resultCount?`${t.resultCount} results`:null);return(0,s.jsx)("div",{className:"animate-in fade-in py-1 duration-150",role:"article",children:(0,s.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,s.jsx)(sS.Globe,{size:12,className:(0,rW.cn)("mt-0.5 shrink-0",n,i)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"text-xs",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"웹 검색"}),t.query&&(0,s.jsxs)("span",{className:"ml-1.5 font-mono text-foreground/90 break-all",children:["“",t.query,"”"]})]}),a&&(0,s.jsx)("p",{className:"mt-0.5 text-[11px] text-muted-foreground/70",children:a})]})]})})});e.s(["default",0,sv],333711);var sT=e.i(205270);let sy=(0,sT.default)("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]),sC={pending:"text-ui-amber",success:"text-ui-purple",error:"text-negative"},sN=(0,c.memo)(e=>{let{entry:t}=e,[n,i]=(0,c.useState)(!1),a=sC[t.status],r="pending"===t.status?"animate-pulse":"",o=!!(t.argumentsSummary||t.resultSummary);return(0,s.jsx)("div",{className:"animate-in fade-in py-1 duration-150",role:"article",children:(0,s.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,s.jsx)(sy,{size:12,className:(0,rW.cn)("mt-0.5 shrink-0",a,r)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-1.5 text-xs",children:[(0,s.jsx)("span",{className:"font-medium text-foreground/90",children:"MCP"}),(0,s.jsx)("span",{className:"text-muted-foreground",children:"·"}),(0,s.jsx)("span",{className:"font-mono text-foreground/80",children:t.server||"?"}),(0,s.jsx)("span",{className:"text-muted-foreground/60",children:"/"}),(0,s.jsx)("span",{className:"font-mono text-foreground/80 break-all",children:t.tool})]}),o&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),"aria-expanded":n,className:"mt-1 inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground",children:[n?(0,s.jsx)(sp.ChevronDown,{size:10}):(0,s.jsx)(sg.ChevronRight,{size:10}),(0,s.jsx)("span",{children:n?"숨기기":"자세히 보기"})]}),n&&(0,s.jsxs)("div",{className:"mt-1.5 space-y-1 rounded border border-border/40 bg-muted/40 p-2 font-mono text-[11px]",children:[t.argumentsSummary&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-muted-foreground/70",children:"arguments"}),(0,s.jsx)("div",{className:"whitespace-pre-wrap break-words text-foreground/90",children:t.argumentsSummary})]}),t.resultSummary&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-muted-foreground/70",children:"result"}),(0,s.jsx)("div",{className:"whitespace-pre-wrap break-words text-foreground/90",children:t.resultSummary})]})]})]})]})]})})});e.s(["default",0,sN],427285);var sx=e.i(806542),sx=sx,sR=e.i(770643);let sO=(0,sT.default)("file-x",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14.5 12.5-5 5",key:"b62r18"}],["path",{d:"m9.5 12.5 5 5",key:"1rk7el"}]]);var sI=e.i(73348);let sA={pending:"text-ui-amber",success:"text-ui-teal",error:"text-negative"},sw=e=>{let t,n,i,{file:a}=e,r=(t=(a.status??"").toLowerCase()).includes("add")||t.includes("create")?"create":t.includes("delete")||t.includes("remove")?"delete":t.includes("update")||t.includes("modify")?"modify":t||"";return(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-[11px]",children:[(n=(a.status??"").toLowerCase(),i="shrink-0 text-muted-foreground/70",n.includes("add")||n.includes("create")?(0,s.jsx)(sR.FilePlus,{size:11,className:i}):n.includes("delete")||n.includes("remove")?(0,s.jsx)(sO,{size:11,className:i}):n.includes("update")||n.includes("modify")?(0,s.jsx)(sI.FilePen,{size:11,className:i}):(0,s.jsx)(sx.default,{size:11,className:i})),(0,s.jsx)("span",{className:"font-mono break-all text-foreground/90",children:a.path}),r&&(0,s.jsxs)("span",{className:"shrink-0 text-muted-foreground/60",children:["(",r,")"]})]})},sD=(0,c.memo)(e=>{let{entry:t}=e,[n,i]=(0,c.useState)(!1),a=sA[t.status],r="pending"===t.status?"animate-pulse":"",o=t.files.length,l=!1!==t.success;return(0,s.jsx)("div",{className:"animate-in fade-in py-1 duration-150",role:"article",children:(0,s.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,s.jsx)(sx.default,{size:12,className:(0,rW.cn)("mt-0.5 shrink-0",a,r)}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"text-xs",children:[(0,s.jsx)("span",{className:"font-medium text-foreground/90",children:"Patch"}),(0,s.jsx)("span",{className:"ml-1.5 text-muted-foreground",children:o>0?`${o}개 파일 수정`:"파일 정보 없음"}),(0,s.jsx)("span",{className:"ml-1.5 text-muted-foreground/60",children:"·"}),(0,s.jsx)("span",{className:(0,rW.cn)("ml-1.5",l?"text-muted-foreground":"text-negative"),children:"pending"===t.status?"진행 중":l?"성공":"실패"})]}),o>0&&(0,s.jsx)("div",{className:"mt-1 ml-0.5 space-y-0.5",children:t.files.map((e,t)=>(0,s.jsx)(sw,{file:e},`${e.path}-${t}`))}),t.diff&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),"aria-expanded":n,className:"mt-1 inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground",children:[n?(0,s.jsx)(sp.ChevronDown,{size:10}):(0,s.jsx)(sg.ChevronRight,{size:10}),(0,s.jsx)("span",{children:n?"Diff 숨기기":"Diff 보기"})]}),n&&(0,s.jsx)("div",{className:"mt-1.5 max-h-[400px] overflow-auto rounded border border-border/40 bg-muted/40 p-2 font-mono text-[11px]",children:(0,s.jsx)("pre",{className:"whitespace-pre-wrap break-words text-foreground/90",children:t.diff})})]})]})]})})});e.s(["default",0,sD],835591);let sL=(0,sT.default)("combine",[["path",{d:"M14 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"1l7d7l"}],["path",{d:"M19 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"9955pe"}],["path",{d:"m7 15 3 3",key:"4hkfgk"}],["path",{d:"m7 21 3-3H5a2 2 0 0 1-2-2v-2",key:"1xljwe"}],["rect",{x:"14",y:"14",width:"7",height:"7",rx:"1",key:"1cdgtw"}],["rect",{x:"3",y:"3",width:"7",height:"7",rx:"1",key:"zi3rio"}]]),sM=e=>null==e?"?":e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e),sk=(0,c.memo)(e=>{let{entry:t}=e,n=(0,rH.useTranslations)("timeline"),i=t.beforeTokens,a=t.afterTokens,r=null!=i&&null!=a&&i>0?Math.round((i-a)/i*100):null;return(0,s.jsxs)("div",{className:"animate-in fade-in flex items-center gap-1.5 py-1 text-xs text-muted-foreground/70 duration-150",children:[(0,s.jsx)(sL,{size:12,className:"shrink-0"}),(0,s.jsx)("span",{children:n("contextCompacted")}),null!=i&&null!=a&&(0,s.jsxs)("span",{className:"tabular-nums",children:[sM(i)," → ",sM(a)," tokens",null!=r&&r>0&&(0,s.jsxs)("span",{className:"ml-1 text-muted-foreground/60",children:["(-",r,"%)"]})]})]})});e.s(["default",0,sk],137073)},87093,e=>{"use strict";var t=e.i(391398),n=e.i(140032),i=e.i(453783),a=e.i(191788),r=e.i(352819),s=e.i(21152),o=e.i(53073),l=e.i(867202),c=e.i(709532),d=e.i(536838),u=e.i(552797),m=e.i(817885),_=e.i(199648),p=e.i(895764),g=e.i(939310),f=e.i(457619),h=e.i(116925),E=e.i(901160),S=e.i(748486),b=e.i(387561),v=e.i(912643),T=e.i(865013),y=e.i(815226),C=e.i(864852),N=e.i(801230),x=e.i(954996),R=e.i(42054),O=e.i(44158),I=e.i(333711),A=e.i(427285),w=e.i(835591),D=e.i(137073),L=e.i(880179),M=e.i(444957),k=e.i(377216),P=e.i(470656),F=e.i(586034),U=e.i(979195),B=e.i(353533);let G={error:{Icon:U.XCircle,label:"Error",containerClass:"border-negative/40 bg-negative/5",iconClass:"text-negative",labelClass:"text-negative"},warning:{Icon:L.AlertTriangle,label:"Warning",containerClass:"border-ui-amber/40 bg-ui-amber/5",iconClass:"text-ui-amber",labelClass:"text-ui-amber"},"stream-error":{Icon:F.WifiOff,label:"Stream error",containerClass:"border-ui-amber/40 bg-ui-amber/5",iconClass:"text-ui-amber",labelClass:"text-ui-amber"},"guardian-warning":{Icon:P.Shield,label:"Guardian",containerClass:"border-ui-purple/40 bg-ui-purple/5",iconClass:"text-ui-purple",labelClass:"text-ui-purple"}},j=(0,a.memo)(e=>{let{entry:n}=e,i=G[n.severity],r=i.Icon,s=n.message??"",o=s.length>200||s.includes("\n"),[l,c]=(0,a.useState)(!1),d=o&&!l?s.slice(0,200)+"…":s;return(0,t.jsx)("div",{className:"animate-in fade-in py-1 duration-150",role:"alert",children:(0,t.jsx)("div",{className:(0,B.cn)("rounded-md border px-3 py-2",i.containerClass),children:(0,t.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,t.jsx)(r,{size:14,className:(0,B.cn)("mt-0.5 shrink-0",i.iconClass)}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:(0,B.cn)("text-xs font-medium",i.labelClass),children:i.label}),"stream-error"===n.severity&&n.retryStatus&&(0,t.jsx)("span",{className:"rounded-sm bg-ui-amber/15 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-ui-amber",children:n.retryStatus}),n.errorCode&&(0,t.jsx)("span",{className:"rounded-sm bg-muted/60 px-1.5 py-0.5 text-[10px] font-mono text-muted-foreground",children:n.errorCode})]}),(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-xs text-foreground/90",children:d}),o&&(0,t.jsxs)("button",{type:"button",onClick:()=>c(e=>!e),"aria-expanded":l,className:"mt-1 inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground",children:[l?(0,t.jsx)(M.ChevronDown,{size:10}):(0,t.jsx)(k.ChevronRight,{size:10}),(0,t.jsx)("span",{children:l?"접기":"자세히 보기"})]})]})]})})})});var Y=e.i(635255);let H=(e,t)=>{let n=e.getBoundingClientRect(),i=t.getBoundingClientRect();return n.top-i.top+t.scrollTop},V=e=>{let{since:n}=e,[i,r]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=()=>r(Math.max(0,Math.floor((Date.now()-n)/1e3)));e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[n]);let s=String(Math.floor(i/60)).padStart(2,"0"),o=String(i%60).padStart(2,"0");return(0,t.jsxs)("span",{className:"tabular-nums",children:[s,":",o]})},$=(e,t)=>({calls:[e],results:t?[t]:[]}),z=/^\*\*\*\s+(Add|Update|Delete)\s+File:\s+(.+?)\s*$/i,q=/^\*\*\*\s+Move to:\s+(.+?)\s*$/i,W=e=>{switch(e.type){case"exec-command-stream":let t,n,i,a;return t=e.parsedCommand??e.command,i=(n=(e=>{let t=e.trim();if(!t)return"";let n=t.split("\n");return n.length>1?`${n.length} lines`:t.slice(0,100)})("error"===e.status&&e.stderr||e.stdout)).match(/^(\d+) lines$/),a="success"===e.status&&i?`$ ${t} → ${i[1]} lines`:`$ ${t}`,$({id:e.id,type:"tool-call",timestamp:e.timestamp,toolUseId:e.callId,toolName:"Bash",summary:a,status:e.status},n&&!i?{id:`${e.id}:result`,type:"tool-result",timestamp:e.timestamp,toolUseId:e.callId,isError:"error"===e.status,summary:n}:void 0);case"web-search":let r;return r=e.resultsSummary??(null!=e.resultCount?`${e.resultCount} results`:""),$({id:e.id,type:"tool-call",timestamp:e.timestamp,toolUseId:e.callId,toolName:"WebSearch",summary:e.query?`WebSearch "${e.query}"`:"WebSearch",status:e.status},r?{id:`${e.id}:result`,type:"tool-result",timestamp:e.timestamp,toolUseId:e.callId,isError:"error"===e.status,summary:r}:void 0);case"mcp-tool-call":return $({id:e.id,type:"tool-call",timestamp:e.timestamp,toolUseId:e.callId,toolName:"MCP",summary:`MCP ${e.server||"?"}/${e.tool||"?"}`,status:e.status},e.resultSummary?{id:`${e.id}:result`,type:"tool-result",timestamp:e.timestamp,toolUseId:e.callId,isError:"error"===e.status,summary:e.resultSummary}:void 0);case"patch-apply":let s=(e=>{if(!e)return[];let t=[],n=null,i=()=>{n&&((n.oldLines.length>0||n.newLines.length>0||n.added>0||n.removed>0)&&t.push(n),n=null)};for(let t of e.split("\n")){let e=t.match(z);if(e){i(),n={status:e[1].toLowerCase(),filePath:e[2],oldLines:[],newLines:[],added:0,removed:0};continue}if(!n)continue;let a=t.match(q);if(a){n.filePath=a[1];continue}if(t.startsWith("@@")||t.startsWith("***"))continue;let r=t[0],s=t.slice(1);"+"===r?(n.newLines.push(s),n.added+=1):"-"===r?(n.oldLines.push(s),n.removed+=1):" "===r&&(n.oldLines.push(s),n.newLines.push(s))}return i(),t.map(e=>{let t=e.oldLines.join("\n"),n=e.newLines.join("\n"),{added:i,removed:a}=((e,t)=>{let n=0,i=0;for(let a of(0,m.diffLines)(e,t)){let e=a.count??0;a.added?n+=e:a.removed&&(i+=e)}return{added:n,removed:i}})(t,n);return{filePath:e.filePath,status:e.status,oldString:t,newString:n,added:i,removed:a}})})(e.diff);if(s.length>0)return{calls:s.map((t,n)=>{let i;return{id:`${e.id}:${n}`,type:"tool-call",timestamp:e.timestamp,toolUseId:`${e.callId}:${n}`,toolName:"Edit",summary:`${(i=t.status.toLowerCase()).includes("add")||i.includes("create")?"Create":i.includes("delete")||i.includes("remove")?"Delete":"Update"} ${t.filePath} (+${t.added}, -${t.removed})`,filePath:t.filePath,diff:{filePath:t.filePath,oldString:t.oldString,newString:t.newString},status:e.status}}),results:[]};let o=e.files.length;if(0===o&&"success"===e.status)return{calls:[],results:[]};let l=0===o?"files":1===o?e.files[0].path:`${o} ${1===o?"file":"files"}`;return $({id:e.id,type:"tool-call",timestamp:e.timestamp,toolUseId:e.callId,toolName:"Edit",summary:`Patch ${l}`,status:e.status});default:return null}},Q=()=>{let e=(0,r.useTranslations)("timeline");return(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1.5 py-1 text-xs text-muted-foreground/60",children:[(0,t.jsx)(l.OctagonX,{size:12}),(0,t.jsx)("span",{children:e("requestCancelled")})]})},K=()=>{let e=(0,r.useTranslations)("timeline");return(0,t.jsxs)("div",{className:"flex items-center justify-end gap-1.5 py-1 text-xs text-muted-foreground/60",children:[(0,t.jsx)(c.LogOut,{size:12}),(0,t.jsx)("span",{children:e("sessionExit")})]})},X=e=>{let{entry:n,sessionName:i,tabId:a,sessionId:r}=e;switch(n.type){case"user-message":return(0,t.jsx)(f.default,{entry:n});case"assistant-message":return(0,t.jsx)(h.default,{entry:n});case"agent-group":return(0,t.jsx)(E.default,{entry:n});case"task-notification":return(0,t.jsx)(S.default,{entry:n});case"plan":return(0,t.jsx)(v.default,{entry:n,sessionName:i});case"ask-user-question":return(0,t.jsx)(T.default,{entry:n,sessionName:i,tabId:a,agentSessionId:r});case"task-progress":return(0,t.jsx)(C.default,{entry:n});case"interrupt":return(0,t.jsx)(Q,{});case"session-exit":return(0,t.jsx)(K,{});case"approval-request":return(0,t.jsx)(R.default,{entry:n});case"exec-command-stream":return(0,t.jsx)(O.default,{entry:n});case"web-search":return(0,t.jsx)(I.default,{entry:n});case"mcp-tool-call":return(0,t.jsx)(A.default,{entry:n});case"patch-apply":return(0,t.jsx)(w.default,{entry:n});case"context-compacted":return(0,t.jsx)(D.default,{entry:n});case"reasoning-summary":default:return null;case"error-notice":return(0,t.jsx)(j,{entry:n})}},Z=()=>(0,t.jsx)("div",{className:"chat-content",children:(0,t.jsx)("div",{className:"animate-delayed-fade-in flex flex-col gap-4 p-4",children:[48,36,40].map((e,n)=>(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("div",{className:"h-4 animate-pulse rounded bg-claude-active/20",style:{width:`${e}%`}}),(0,t.jsx)("div",{className:"h-4 animate-pulse rounded bg-claude-active/20",style:{width:`${e-10}%`}})]},n))})}),J=e=>{let{error:n,onRetry:i,showRefresh:a}=e,l=(0,r.useTranslations)("timeline"),c=(0,r.useTranslations)("common");return(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(s.Terminal,{size:32,className:"opacity-40"}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:l("connectionError")}),(0,t.jsx)("p",{className:"mt-1 text-xs",children:n})]}),(0,t.jsxs)(g.Button,{variant:"outline",size:"xs",onClick:i,children:[(0,t.jsx)(o.RefreshCw,{size:12}),c("retry")]}),a&&(0,t.jsxs)(g.Button,{variant:"ghost",size:"xs",onClick:()=>(0,Y.reloadForReconnectRecovery)("timeline"),children:[(0,t.jsx)(o.RefreshCw,{size:12}),c("refresh")]})]})},ee=()=>{let e=(0,r.useTranslations)("timeline");return(0,t.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-3 z-10 flex justify-center",children:(0,t.jsxs)("div",{className:"pointer-events-auto flex items-center gap-1.5 rounded-full bg-muted px-3 py-1 text-xs text-muted-foreground shadow-sm",children:[(0,t.jsx)(_.default,{size:10}),e("reconnecting")]})})},et=e=>{let{onRetry:n}=e,i=(0,r.useTranslations)("timeline"),a=(0,r.useTranslations)("common");return(0,t.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-3 z-10 flex justify-center",children:(0,t.jsxs)("div",{className:"pointer-events-auto flex items-center gap-1.5 rounded-full bg-muted px-3 py-1 text-xs text-muted-foreground shadow-sm",children:[(0,t.jsx)("span",{children:i("connectionFailed")}),(0,t.jsx)(g.Button,{variant:"outline",size:"xs",className:"h-5 rounded-full px-2 text-xs",onClick:n,children:a("retry")})]})})},en=()=>{let e=(0,r.useTranslations)("timeline");return(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(u.MessageSquareMore,{size:32,className:"opacity-40"}),(0,t.jsx)("p",{className:"text-xs",children:e("emptyRunning")})]})};e.s(["default",0,e=>{let{entries:s,tasks:o,sessionId:l,sessionName:c,tabId:u,cwd:m,initMeta:f,sessionStats:h,cliState:E,compactingSince:S,wsStatus:v,isLoading:T,error:C,onRetry:R,onLoadMore:O,hasMore:I,scrollToBottomRef:A}=e,w=(0,r.useTranslations)("timeline"),D=(0,i.default)(e=>u?e.metadata[u]?.cwd:void 0),L="needs-input"===E,M=null!=S&&Date.now()-S<6e4,k=(0,a.useRef)(null),P=(0,a.useRef)(null),F=(0,a.useRef)(null),U=(0,a.useRef)(!1),B=(0,a.useRef)(!1),G=(0,a.useRef)(!1),{scrollRef:j,contentRef:$,scrollToBottom:z}=(0,p.useStickToBottom)({resize:{damping:.8,stiffness:.05},initial:"instant",targetScrollTop:(e,t)=>{let{scrollElement:n}=t,i=k.current;return i?H(i,n)-12:e}}),[q,Q]=(0,a.useState)(null),[K,ei]=(0,a.useState)(0),[ea,er]=(0,a.useState)(!0),[es,eo]=(0,a.useState)(l),[el,ec]=(0,a.useState)(!1),ed=s.some(e=>"user-message"===e.type&&!0===e.pending);es!==l&&(eo(l),ed||(er(!0),Q(null)),U.current=!1,B.current=!1,G.current=!1),(0,a.useEffect)(()=>{if(A)return A.current=()=>{U.current=!0,z("smooth"),setTimeout(()=>z("smooth"),300)},()=>{A.current=void 0}},[A,z]);let eu=(0,a.useMemo)(()=>(e=>{let t=[],n=[],i=[],a=()=>{n.length>0&&(t.push({type:"tool-group",id:n[0].id,toolCalls:[...n],toolResults:[...i]}),n=[],i=[])};for(let r of e)if("tool-call"===r.type)n.push(r);else if("tool-result"===r.type)i.push(r);else{let e=W(r);if(e){n.push(...e.calls),i.push(...e.results);continue}a(),t.push({type:"entry",id:r.id,entry:r})}return a(),t})(s),[s]),em=eu.length>0,e_=(0,a.useMemo)(()=>eu.findLast(e=>"entry"===e.type&&"user-message"===e.entry.type)?.id??null,[eu]);(0,a.useEffect)(()=>{if(U.current&&e_&&e_!==q){Q(e_),U.current=!1;return}q&&e_&&e_!==q&&(s.some(e=>e.id===q)||Q(e_))},[e_,q,s]);let[ep,eg]=(0,a.useState)(!1),ef=h?.currentContextTokens??0,eh=`${E}:${ef}:${f?.lastTimestamp??0}:${c??""}`;(0,a.useEffect)(()=>{if("idle"!==E||!f||!c||ef<1e5||!f.lastTimestamp)return void eg(!1);let e=()=>{eg((Date.now()-f.lastTimestamp)/6e4>=70)};e();let t=setInterval(e,6e4);return()=>clearInterval(t)},[eh]),(0,a.useEffect)(()=>{ea&&s.length>0&&(z("instant"),requestAnimationFrame(()=>er(!1)))},[ea,s.length,z]);let eE=(0,a.useCallback)(()=>{let e=j.current,t=k.current,n=P.current;if(!e||!t||!n)return;let i=t.offsetTop+t.offsetHeight,a=Math.max(0,n.offsetTop-i),r=Math.max(0,e.clientHeight-t.offsetHeight-12-a);ei(e=>e===r?e:r)},[j]),eS=(0,a.useCallback)(()=>{let e=j.current,t=k.current,n=P.current;if(!e||!t||!n)return;let i=n.offsetHeight;if(0===i)return;let a=e.scrollTop,r=t.offsetTop+t.offsetHeight,s=Math.max(0,n.offsetTop-r),o=Math.max(0,e.clientHeight-t.offsetHeight-12-s),l=a>=Math.max(0,H(t,e)-12)-2?o:0;if(i<=l)return;let c=Math.min(i-l,Math.max(0,e.scrollHeight-e.clientHeight-a));c<=0||ei(i-c)},[j]),eb=(0,a.useCallback)(()=>{q&&"busy"!==E&&(G.current=!0,requestAnimationFrame(()=>{eS(),setTimeout(eS,300)}))},[q,E,eS]);(0,a.useLayoutEffect)(()=>{(B.current=!1,G.current=!1,q)?eE():ei(0)},[q,eE]),(0,a.useEffect)(()=>{let e=j.current;if(!e)return;let t=new ResizeObserver(()=>eE());return t.observe(e),()=>t.disconnect()},[j,eE]),(0,a.useEffect)(()=>{let e=$.current;if(!e)return;let t=new ResizeObserver(()=>{G.current&&eS()});return t.observe(e),()=>t.disconnect()},[$,eS]),(0,a.useEffect)(()=>{if(q){if("busy"===E){B.current=!0,G.current=!1;return}if(B.current)B.current=!1,G.current=!0;else if(!G.current){let e=s.findLastIndex(e=>e.id===q);e>=0&&s.length>e+1&&(G.current=!0)}G.current&&eS()}},[E,q,s,eS]),(0,a.useEffect)(()=>{let e=()=>{"hidden"!==document.visibilityState&&eb()};return document.addEventListener("visibilitychange",e),window.addEventListener("focus",e),window.addEventListener("pageshow",e),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("focus",e),window.removeEventListener("pageshow",e)}},[eb]);let ev=!T&&!C&&em&&!ea;(0,a.useEffect)(()=>{if(!ev)return;let e=j.current,t=F.current;if(!e||!t)return;let n=new IntersectionObserver(e=>{let[t]=e;if(t.isIntersecting)return void ec(!1);let n=t.rootBounds,i=t.boundingClientRect;ec(!!n&&i.top>=n.bottom)},{root:e,threshold:0,rootMargin:"0px 0px 4px 0px"});return n.observe(t),()=>n.disconnect()},[ev,j]);let eT=(0,a.useRef)(!1),[ey,eC]=(0,a.useState)(!1),eN="u">typeof CSS&&!CSS.supports?.("overflow-anchor","auto"),ex=(0,a.useRef)(null),eR=(0,a.useCallback)(()=>{if(I&&!eT.current){if(eT.current=!0,eC(!0),eN){let e=j.current;e&&(ex.current={scrollHeight:e.scrollHeight})}O().finally(()=>{eT.current=!1,eC(!1)})}},[I,O,j,eN]);return((0,a.useLayoutEffect)(()=>{if(!eN)return;let e=ex.current,t=j.current;if(!e||!t||ey)return;let n=t.scrollHeight-e.scrollHeight;n>0&&(t.scrollTop+=n),ex.current=null},[ey,j,eN]),T&&"disconnected"===v)?(0,t.jsx)(J,{error:w("connectionFailed"),onRetry:R,showRefresh:(0,Y.shouldPromptMobileReloadRecovery)()}):T?(0,t.jsx)(Z,{}):C?(0,t.jsx)(J,{error:C,onRetry:R}):em?(0,t.jsxs)("div",{className:"relative flex h-full flex-col",children:[(0,t.jsx)("div",{ref:j,className:"flex-1 overflow-y-auto py-2 transition-opacity",style:{opacity:+!ea,transitionDuration:"300ms"},tabIndex:0,role:"log","aria-label":w("timelineAria"),children:(0,t.jsxs)("div",{ref:$,className:"region-typography-messages chat-content",children:[I&&!ey&&(0,t.jsx)("div",{className:"flex justify-center py-2",children:(0,t.jsxs)(g.Button,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground",onClick:eR,children:[(0,t.jsx)(d.ChevronsUp,{size:12,className:"mr-1"}),w("loadMore")]})}),ey&&(0,t.jsx)("div",{className:"flex flex-col gap-3 px-4 py-3",children:[44,32,48].map((e,n)=>(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)("div",{className:"h-3.5 animate-pulse rounded bg-muted/60",style:{width:`${e}%`}}),(0,t.jsx)("div",{className:"h-3.5 animate-pulse rounded bg-muted/60",style:{width:`${e-12}%`}})]},n))}),o.length>0&&(0,t.jsx)(y.default,{tasks:o,cliState:E}),(0,t.jsx)(n.EditorCwdContext.Provider,{value:D||m,children:eu.map(e=>(0,t.jsx)("div",{ref:e.id===q?k:void 0,className:"px-4 py-1.5",children:"tool-group"===e.type?(0,t.jsx)(b.default,{toolCalls:e.toolCalls,toolResults:e.toolResults}):(0,t.jsx)(X,{entry:e.entry,sessionName:c,tabId:u,sessionId:l})},e.id))}),(ep||L)&&c&&(0,t.jsx)("div",{className:"px-4 py-1.5",children:(0,t.jsx)(x.default,{sessionName:c,tabId:u,silent:ep&&!L})}),"busy"===E&&!L&&(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground",children:[(0,t.jsx)(_.default,{size:10,className:"text-claude-active"}),(0,t.jsx)(V,{since:s[s.length-1].timestamp})]}),M&&(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground",children:[(0,t.jsx)(_.default,{size:10,className:"text-claude-active"}),(0,t.jsx)("span",{children:w("contextCompacting")})]}),(0,t.jsx)("div",{ref:F,"aria-hidden":!0,style:{height:0,overflowAnchor:"none"}}),(0,t.jsx)("div",{ref:P,"aria-hidden":!0,style:{height:K,overflowAnchor:"none"}})]})}),"reconnecting"===v&&(0,t.jsx)(ee,{}),"disconnected"===v&&(0,t.jsx)(et,{onRetry:R}),(0,t.jsx)(N.default,{visible:el,onClick:()=>{let e=j.current;if(!e)return;let t=P.current?.offsetHeight??0;e.scrollTo({top:e.scrollHeight-t,behavior:"smooth"})}})]}):(0,t.jsx)(en,{})}],87093)},815075,905461,704595,577077,456255,173722,e=>{"use strict";var t=e.i(205270);let n=(0,t.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["Paperclip",0,n],815075);let i=(0,t.default)("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);e.s(["SendHorizontal",0,i],905461);var a=e.i(950323);let r={messages:[],sending:!1,error:null},s=async e=>{try{let t=await e.json();if(t&&"string"==typeof t.error&&t.error.length>0)return t.error}catch{}return`${e.status} ${e.statusText||"request failed"}`},o=async(e,t)=>{let n=await fetch(e,t);if(!n.ok)throw Error(await s(n));return n.json()};e.s(["default",0,(e,t)=>{let n=e&&t?`/api/input-queue?${new URLSearchParams({workspaceId:e,tabId:t})}`:null,{data:i,mutate:s}=(0,a.default)(n,o,{refreshInterval:1e3}),l=async(e,t)=>{if(!n)throw Error("Missing queue target");let i=await o(n,{method:e,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});await s(i,!1)};return{...i??r,enqueue:e=>l("POST",e),submitNow:()=>l("POST",{action:"submit-now"}),remove:e=>l("DELETE",{id:e})}}],704595);var l=e.i(191788),c=e.i(117653),d=e.i(505888),u=e.i(745725);let m={entries:[],isLoading:!1,isError:!1},_=(e,t)=>e.byWsId[t]??m,p=(0,d.create)((e,t)=>({byWsId:{},fetchHistory:async t=>{e(e=>({byWsId:{...e.byWsId,[t]:{..._(e,t),isLoading:!0,isError:!1}}}));try{let n=await fetch(`/api/message-history?wsId=${encodeURIComponent(t)}`);if(!n.ok)throw Error("fetch failed");let i=await n.json();e(e=>({byWsId:{...e.byWsId,[t]:{entries:i.entries,isLoading:!1,isError:!1}}}))}catch{e(e=>({byWsId:{...e.byWsId,[t]:{..._(e,t),isLoading:!1,isError:!0}}}))}},addHistory:async(t,n)=>{let i=n.trim();if(!i||i.startsWith("/"))return;let a=`temp-${(0,u.nanoid)()}`,r={id:a,message:i,sentAt:new Date().toISOString()};e(e=>{let n=_(e,t),a=[r,...n.entries.filter(e=>e.message!==i)];return{byWsId:{...e.byWsId,[t]:{...n,entries:a.length>500?a.slice(0,500):a}}}});try{let n=await fetch("/api/message-history",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({wsId:t,message:i})});if(n.ok){let i=await n.json();e(e=>{let n=_(e,t);return{byWsId:{...e.byWsId,[t]:{...n,entries:n.entries.map(e=>e.id===a?i.entry:e)}}}})}}catch{}},deleteHistory:async(n,i)=>{let a=_(t(),n).entries;e(e=>{let t=_(e,n);return{byWsId:{...e.byWsId,[n]:{...t,entries:t.entries.filter(e=>e.id!==i)}}}});try{if(!(await fetch("/api/message-history",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({wsId:n,id:i})})).ok)throw Error("delete failed")}catch{e(e=>({byWsId:{...e.byWsId,[n]:{..._(e,n),entries:a}}}))}}}));e.s(["default",0,e=>{let{wsId:t}=e,{entries:n,isLoading:i,isError:a}=p((0,c.useShallow)(e=>t?e.byWsId[t]??m:m)),r=p(e=>e.fetchHistory),s=p(e=>e.addHistory),o=p(e=>e.deleteHistory),d=(0,l.useCallback)(async()=>{t&&await r(t)},[t,r]),u=(0,l.useCallback)(async e=>{t&&await s(t,e)},[t,s]),_=(0,l.useCallback)(async e=>{t&&await o(t,e)},[t,o]);return(0,l.useEffect)(()=>{t&&r(t)},[t,r]),{entries:n,isLoading:i,isError:a,fetchHistory:d,addHistory:u,deleteHistory:_}}],577077);var g=e.i(391398),f=e.i(352819),h=e.i(212283);e.s(["default",0,e=>{let{open:t,onOpenChange:n,onConfirm:i}=e,a=(0,f.useTranslations)("terminal"),r=(0,f.useTranslations)("common");return(0,g.jsx)(h.AlertDialog,{open:t,onOpenChange:n,children:(0,g.jsxs)(h.AlertDialogContent,{children:[(0,g.jsxs)(h.AlertDialogHeader,{children:[(0,g.jsx)(h.AlertDialogTitle,{children:a("interruptTitle")}),(0,g.jsx)(h.AlertDialogDescription,{children:a("interruptDescription")})]}),(0,g.jsxs)(h.AlertDialogFooter,{children:[(0,g.jsx)(h.AlertDialogCancel,{children:r("cancel")}),(0,g.jsx)(h.AlertDialogAction,{variant:"destructive",onClick:()=>{i(),n(!1)},children:a("interruptConfirm")})]})]})})}],456255);var E=e.i(494834),S=e.i(909725),b=e.i(939310),v=e.i(348370),T=e.i(978094);e.s(["default",0,e=>{let{open:t,onOpenChange:n,entries:i,isLoading:a,isError:r,onFetch:s,onSelect:o,onDelete:c,trigger:d}=e,u=(0,f.useTranslations)("messageHistory"),[m,_]=(0,l.useState)(""),[p,h]=(0,l.useState)(!1);return t!==p&&(h(t),t&&_("")),(0,l.useEffect)(()=>{t&&s()},[t,s]),(0,g.jsxs)(v.Popover,{open:t,onOpenChange:n,children:[(0,g.jsx)(v.PopoverTrigger,{render:d}),(0,g.jsx)(v.PopoverContent,{side:"top",align:"start",sideOffset:8,className:"w-80 p-0",children:(0,g.jsxs)(T.Command,{className:"rounded-lg",shouldFilter:!0,children:[(0,g.jsx)(T.CommandInput,{placeholder:u("searchPlaceholder"),value:m,onValueChange:_}),(0,g.jsx)(T.CommandList,{className:"max-h-[300px]",children:a&&0===i.length?(0,g.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:u("loading")}):r?(0,g.jsxs)("div",{className:"flex flex-col items-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,g.jsx)("span",{children:u("fetchError")}),(0,g.jsx)(b.Button,{variant:"outline",size:"sm",onClick:s,children:u("retry")})]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(T.CommandEmpty,{children:m?u("noSearchResults"):u("noHistory")}),(0,g.jsx)(T.CommandGroup,{children:i.map(e=>(0,g.jsxs)(T.CommandItem,{value:e.message,onSelect:()=>{o(e.message),n(!1)},className:"group [&>svg.ml-auto]:hidden",children:[(0,g.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm",children:e.message.split("\n")[0]}),(0,g.jsx)("span",{className:"ml-2 shrink-0 text-xs text-muted-foreground whitespace-nowrap",children:(0,E.default)(e.sentAt).fromNow()}),(0,g.jsx)("button",{type:"button",className:"ml-1 shrink-0 rounded p-0.5 opacity-0 transition-opacity hover:bg-muted group-hover:opacity-100",onClick:t=>{var n;return n=e.id,void(t.stopPropagation(),t.preventDefault(),c(n))},"aria-label":u("deleteLabel"),children:(0,g.jsx)(S.X,{className:"size-3"})})]},e.id))})]})})]})})]})}],173722)},148141,483241,624306,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(352819),a=e.i(745725),r=e.i(679935),s=e.i(727487),o=e.i(340522),l=e.i(143100),c=e.i(815075),d=e.i(905461),u=e.i(30349),m=e.i(909725),_=e.i(353533),p=e.i(939310),g=e.i(358915),f=e.i(704595),h=e.i(733456),E=e.i(577077),S=e.i(535099),b=e.i(456255),v=e.i(484862),T=e.i(173722),y=e.i(494834),C=e.i(57098),N=e.i(978094);let x=e=>{let{open:a,onOpenChange:r,entries:s,isLoading:o,isError:l,onFetch:c,onSelect:d,onDelete:u,trigger:_}=e,g=(0,i.useTranslations)("messageHistory"),[f,h]=(0,n.useState)(""),[E,S]=(0,n.useState)(!1);return a!==E&&(S(a),a&&h("")),(0,n.useEffect)(()=>{a&&c()},[a,c]),(0,t.jsxs)(C.Drawer,{open:a,onOpenChange:r,children:[(0,t.jsx)(C.DrawerTrigger,{asChild:!0,children:_}),(0,t.jsxs)(C.DrawerContent,{className:"max-h-[60vh]",children:[(0,t.jsx)(C.DrawerHeader,{className:"sr-only",children:(0,t.jsx)(C.DrawerTitle,{children:g("title")})}),(0,t.jsxs)(N.Command,{className:"rounded-none",shouldFilter:!0,children:[(0,t.jsx)("div",{className:"p-2 pb-0",children:(0,t.jsx)(N.CommandInput,{placeholder:g("searchPlaceholder"),value:f,onValueChange:h})}),(0,t.jsx)(N.CommandList,{className:"max-h-[50vh] p-2","data-vaul-no-drag":!0,children:o&&0===s.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:g("loading")}):l?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:g("fetchError")}),(0,t.jsx)(p.Button,{variant:"outline",size:"sm",onClick:c,children:g("retry")})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.CommandEmpty,{children:f?g("noSearchResults"):g("noHistory")}),(0,t.jsx)(N.CommandGroup,{children:s.map(e=>(0,t.jsxs)(N.CommandItem,{value:e.message,onSelect:()=>{d(e.message),r(!1)},className:"group min-h-[44px] [&>svg.ml-auto]:hidden",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm",children:e.message.split("\n")[0]}),(0,t.jsx)("span",{className:"ml-2 shrink-0 text-xs text-muted-foreground whitespace-nowrap",children:(0,y.default)(e.sentAt).fromNow()}),(0,t.jsx)("button",{type:"button",className:"ml-1 shrink-0 rounded p-0.5 hover:bg-muted",onClick:t=>{var n;return n=e.id,void(t.stopPropagation(),t.preventDefault(),u(n))},"aria-label":g("deleteLabel"),children:(0,t.jsx)(m.X,{className:"size-3"})})]},e.id))})]})})]})]})]})},R=e=>{let{entries:a,isLoading:r,isError:s,disabled:o,onFetch:l,onSelect:c,onDelete:d,onClose:u}=e,m=(0,i.useTranslations)("terminal"),[g,f]=(0,n.useState)(!1),E=(0,h.default)(),S=0===a.length&&!r,b={open:g,onOpenChange:e=>{f(e),e||u?.()},entries:a,isLoading:r,isError:s,onFetch:l,onSelect:e=>{c(e),f(!1)},onDelete:d,trigger:(0,t.jsx)(p.Button,{variant:"ghost",size:"sm",className:(0,_.cn)("h-7 w-7 shrink-0 self-end p-0 text-muted-foreground hover:text-foreground hover:bg-muted",(o||S)&&"opacity-50 pointer-events-none"),disabled:o||S,"aria-label":m("messageHistory"),children:(0,t.jsx)(v.Clock,{size:16})})};return E?(0,t.jsx)(x,{...b}):(0,t.jsx)(T.default,{...b})},O=new Set(["image/png","image/jpeg","image/gif","image/webp"]),I=new Set(["image/jpeg","image/webp"]),A=e=>O.has(e.type??""),w=async e=>{let t;if(!I.has(e.type)||"function"!=typeof createImageBitmap)return e;try{t=await createImageBitmap(e,{imageOrientation:"from-image"})}catch{return e}try{let n=document.createElement("canvas");n.width=t.width,n.height=t.height;let i=n.getContext("2d");if(!i)return e;i.drawImage(t,0,0);let a=await new Promise(t=>n.toBlob(t,e.type,.92));if(!a)return e;return new File([a],e.name,{type:e.type,lastModified:e.lastModified})}finally{t.close?.()}},D=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!A(e))throw Error(`Unsupported image type: ${e.type}`);if(e.size>0xa00000)throw Error("Image exceeds 10485760 bytes");let n=await w(e),i=n.size<=0xa00000?n:e,a={"Content-Type":i.type,"X-Pmux-Filename":encodeURIComponent(i.name||"image")};t.wsId&&(a["X-Pmux-Ws-Id"]=t.wsId),t.tabId&&(a["X-Pmux-Tab-Id"]=t.tabId);let r=await fetch("/api/upload-image",{method:"POST",headers:a,body:i});if(!r.ok)throw Error((await r.json().catch(()=>({}))).error??`Upload failed (${r.status})`);return await r.json()};e.s(["isImageFile",0,A,"uploadImage",0,D],483241);let L=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.size>0x3200000)throw Error("File exceeds 52428800 bytes");let n={"Content-Type":e.type||"application/octet-stream","X-Pmux-Filename":encodeURIComponent(e.name||"file")};t.wsId&&(n["X-Pmux-Ws-Id"]=t.wsId),t.tabId&&(n["X-Pmux-Tab-Id"]=t.tabId);let i=await fetch("/api/upload-file",{method:"POST",headers:n,body:e});if(!i.ok)throw Error((await i.json().catch(()=>({}))).error??`Upload failed (${i.status})`);return await i.json()},M=e=>`pt-attachment-draft:${e}`;e.s(["default",0,e=>{let{tabId:v,wsId:T,agentSessionId:y,provider:C="claude",cliState:N,sendStdin:x,terminalWsConnected:O,visible:I,focusTerminal:w,focusInputRef:k,setInputValueRef:P,maxRows:F=5,onRestartSession:U,onNativeCommands:B,nativeCommandsActive:G=!1,onSend:j,onOptimisticSend:Y,attachFilesRef:H}=e,V=(0,i.useTranslations)("terminal"),$=(0,i.useTranslations)("common"),z="codex"===C,{entries:q,isLoading:W,isError:Q,fetchHistory:K,addHistory:X,deleteHistory:Z}=(0,E.default)({wsId:T}),J=(0,h.default)(),ee=(0,n.useCallback)(e=>{X(e),Y?.(e)},[X,Y]),{value:et,setValue:en,mode:ei,canSend:ea,send:er,interrupt:es,textareaRef:eo,focusInput:el}=(0,g.default)(N,x,O,{tabId:v,onRestartSession:U,onMessageSent:ee,disabledMessage:z?V("codexInactiveMessage"):V("inputDisabledPlaceholder"),submitDelayMs:250}),ec=(0,f.default)(T,v),ed=(0,n.useRef)(!1),[eu,em]=(0,n.useState)(!1),[e_,ep]=(0,n.useState)(!1),[eg,ef]=(0,n.useState)(!1),[eh,eE]=(0,n.useState)(!1),[eS,eb]=(0,n.useState)(!1),[ev,eT]=(0,n.useState)([]),ey=(0,n.useRef)(null),eC=(0,n.useRef)(null),eN=(0,n.useRef)([]),ex=(0,n.useCallback)(e=>{let t="function"==typeof e?e(eN.current):e;eN.current=t;if(v)try{t.length?localStorage.setItem(M(v),JSON.stringify(t)):localStorage.removeItem(M(v))}catch{}eT(t)},[v]);(0,n.useEffect)(()=>{let e=(e=>{if(!e)return[];try{let t=JSON.parse(localStorage.getItem(M(e))??"[]");if(!Array.isArray(t))return[];return t.filter(e=>e&&"string"==typeof e.id&&"string"==typeof e.path&&"string"==typeof e.filename&&"string"==typeof e.thumbnail&&e.thumbnail.startsWith("/api/uploads/"))}catch{return[]}})(v);eN.current=e,eT(e)},[v]),(0,n.useEffect)(()=>{eN.current=ev},[ev]),(0,n.useEffect)(()=>()=>{eN.current.forEach(e=>URL.revokeObjectURL(e.thumbnail))},[]),(0,n.useEffect)(()=>(k.current=el,P.current=en,()=>{k.current=void 0,P.current=void 0}),[el,k,en,P]),(0,n.useEffect)(()=>{I||en("")},[I,en]);let eR=(0,n.useCallback)(()=>{let e=eo.current;if(!e||(e.style.height="auto",!et))return;let t=20*F+16;e.style.height=`${Math.min(e.scrollHeight,t)}px`},[eo,F,et]);(0,n.useEffect)(()=>{eR()},[et,eR]);let eO=async()=>{if(!ea||G||ed.current||eg)return;let e=et.trim();if(!e&&!ev.length)return;if(!ev.length&&["/new","/clear"].includes(e.toLowerCase()))return void er();ed.current=!0,eE(!0);let t=[...ev];try{await ec.enqueue({id:(0,a.nanoid)(),text:et,attachments:t.map(e=>{let{path:t,filename:n}=e;return{path:t,filename:n}})}),eo.current?.value===et&&(en(""),v&&(0,g.clearInputDraft)(v)),ex(e=>e.filter(e=>!t.some(t=>t.id===e.id))),t.forEach(e=>URL.revokeObjectURL(e.thumbnail)),e&&!e.startsWith("/")&&X(e),y&&(0,S.registerPushTarget)(y),j?.()}catch(e){r.toast.error(e instanceof Error&&e.message?e.message:V("queueRequestFailed"))}finally{ed.current=!1,eE(!1)}},eI=async()=>{if(!ed.current){ed.current=!0,eE(!0);try{await ec.submitNow(),j?.()}catch(e){r.toast.error(e instanceof Error&&e.message?e.message:V("queueRequestFailed"))}finally{ed.current=!1,eE(!1)}}},eA=e=>!!B&&!!ea&&"needs-input"!==N&&"unknown"!==N&&!ev.length&&(ec.messages.length||ec.sending||eh?(r.toast.info(V("nativeCommandsQueuePending")),!1):(B(e),en(""),v&&(0,g.clearInputDraft)(v),!0)),ew=(0,n.useCallback)(e=>{en(e)},[en]),eD=(0,n.useCallback)(()=>{setTimeout(()=>eo.current?.focus(),0)},[eo]),eL=(0,n.useCallback)(e=>{ex(t=>{let n=t.find(t=>t.id===e);return n&&URL.revokeObjectURL(n.thumbnail),t.filter(t=>t.id!==e)})},[ex]),eM=(0,n.useCallback)(e=>{let t=eo.current;if(!t)return;let n=t.value,i="u">typeof document&&document.activeElement===t,a=i?t.selectionStart??n.length:n.length,r=i?t.selectionEnd??n.length:n.length,s=n.slice(0,a),o=n.slice(r),l=s.length>0&&!/\s$/.test(s)?" ":"",c=0!==o.length&&/^\s/.test(o)?"":" ",d=`${l}${e}${c}`;en(`${s}${d}${o}`),requestAnimationFrame(()=>{let e=eo.current;if(!e)return;let t=s.length+d.length;e.setSelectionRange(t,t),e.focus()})},[en,eo]),ek=(0,n.useCallback)(async e=>{if(0===e.length)return;let t=Math.max(0,20-eN.current.length);if(0===t)return void r.toast.error(V("attachmentLimitReached",{max:20}));let n=e.slice(0,t);n.length<e.length&&r.toast.warning(V("attachmentLimitReached",{max:20}));let i=(await Promise.all(n.map(async e=>({file:e,result:await D(e,{wsId:T,tabId:v})})))).map(e=>{let{file:t,result:n}=e;return{id:(0,a.nanoid)(),path:n.path,filename:t.name||"image",thumbnail:n.url||URL.createObjectURL(t)}});ex(e=>[...e,...i])},[T,v,V,ex]),eP=(0,n.useCallback)(async e=>{if(0===e.length)return;let t=(await Promise.all(e.map(e=>L(e,{wsId:T,tabId:v})))).map(e=>e.path).join(" ");t.length>0&&eM(t)},[T,v,eM]),eF=(0,n.useCallback)(async e=>{if(0===e.length)return!1;let t=e.filter(A),n=e.filter(e=>!A(e));if(0===t.length&&0===n.length)return!1;ef(!0);try{await Promise.all([ek(t),eP(n)])}catch(e){r.toast.error(e instanceof Error?e.message:"Upload failed")}finally{ef(!1)}return!0},[ek,eP]),eU=(0,n.useCallback)(()=>{eC.current?.click()},[]);(0,n.useEffect)(()=>{if(H)return H.current=eF,()=>{H.current===eF&&(H.current=void 0)}},[H,eF]);let eB=(0,n.useCallback)(async e=>{let t=e.target.files;t&&0!==t.length&&(await eF(Array.from(t)),e.target.value="")},[eF]),eG=(0,n.useCallback)(async e=>{let t=e.clipboardData?.files;if(!t||0===t.length)return;let n=Array.from(t);0!==n.length&&(e.preventDefault(),await eF(n))},[eF]),ej=(0,n.useCallback)(e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy",eS||eb(!0))},[eS]),eY=(0,n.useCallback)(e=>{e.currentTarget.contains(e.relatedTarget)||eb(!1)},[]),eH=(0,n.useCallback)(async e=>{e.dataTransfer.files&&0!==e.dataTransfer.files.length&&(e.preventDefault(),e.stopPropagation(),eb(!1),await eF(Array.from(e.dataTransfer.files)))},[eF]),eV="disabled"===ei,e$=eV||G,ez=et.trim().length>0,eq=ev.length>0,eW=ea&&!G&&(ez||eq)&&!eh&&!eg;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:(0,_.cn)("region-typography-input relative grid",I?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:[(0,t.jsx)("div",{className:(0,_.cn)("pointer-events-none absolute bottom-full left-0 right-0 transition-opacity duration-300",eV&&I?"opacity-100":"opacity-0"),"aria-hidden":!eV||!I,children:(0,t.jsx)("div",{className:"chat-content px-3 pb-1",children:(0,t.jsxs)("div",{className:"grid grid-cols-[1fr_auto_1fr] items-center px-2 text-[11px] text-muted-foreground/70",children:[(0,t.jsx)(l.Loader2,{size:10,className:"mr-1.5 justify-self-end animate-spin"}),(0,t.jsx)("span",{children:V("connecting")}),(0,t.jsx)("span",{})]})})}),(0,t.jsx)("div",{className:"overflow-hidden",children:(0,t.jsx)("div",{className:"chat-content px-3 pt-0 pb-0 animate-in fade-in duration-150",children:(0,t.jsxs)("div",{ref:ey,className:(0,_.cn)("relative z-10 flex flex-col gap-2 rounded-lg border px-3 py-2 transition-colors duration-150",e_?"border-ring bg-background":"border-border bg-black/5 dark:bg-white/5",eS&&"border-ring bg-accent/40"),onFocusCapture:()=>ep(!0),onBlurCapture:()=>ep(!1),onDragOver:ej,onDragLeave:eY,onDrop:eH,children:[eq&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:ev.map(e=>(0,t.jsxs)("div",{className:"group relative h-14 w-14 overflow-hidden rounded-md border border-border bg-background",title:e.filename,children:[(0,t.jsx)("img",{src:e.thumbnail,alt:e.filename,className:"h-full w-full object-cover"}),(0,t.jsx)("button",{type:"button",onClick:()=>eL(e.id),className:(0,_.cn)("absolute flex text-background transition-opacity group-hover:opacity-100 focus:opacity-100",J?"right-0 top-0 h-11 w-11 items-start justify-end p-1 opacity-100":"right-0.5 top-0.5 h-4 w-4 items-center justify-center opacity-0"),"aria-label":`${$("delete")}: ${e.filename}`,children:(0,t.jsx)("span",{className:(0,_.cn)("flex items-center justify-center rounded-full bg-foreground/70 hover:bg-foreground",J?"h-6 w-6":"h-4 w-4"),children:(0,t.jsx)(m.X,{size:J?14:10})})})]},e.id))}),(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsxs)("div",{className:"flex items-end",children:[(0,t.jsx)(R,{entries:q,isLoading:W,isError:Q,disabled:e$,onFetch:K,onSelect:ew,onDelete:Z,onClose:eD}),(0,t.jsx)("input",{ref:eC,type:"file",multiple:!0,className:"hidden",onChange:eB}),(0,t.jsx)(p.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 shrink-0 p-0 text-muted-foreground hover:text-foreground",onClick:eU,disabled:e$||eg,"aria-label":V("attachAriaLabel"),title:V("attachAriaLabel"),children:eg?(0,t.jsx)(l.Loader2,{size:14,className:"animate-spin"}):(0,t.jsx)(c.Paperclip,{size:14})})]}),(0,t.jsx)("textarea",{ref:eo,disabled:G,value:et,onChange:e=>{let t=e.target.value;!et&&"/"===t&&!e.nativeEvent.isComposing&&eA(t)||en(t)},onKeyDown:e=>{if(!e.nativeEvent.isComposing&&229!==e.keyCode){if("Escape"===e.key){e.preventDefault(),eo.current?.blur(),w();return}if("Enter"===e.key&&!J){if(e.shiftKey)return;e.preventDefault(),eO();return}}},onPaste:eG,placeholder:V(G?"nativeCommandsHint":"inputPlaceholder"),"aria-label":z?V("codexInputAriaLabel"):V("inputAriaLabel"),className:"flex-1 resize-none bg-transparent py-1 text-sm text-foreground outline-none placeholder:text-muted-foreground",rows:1,style:{lineHeight:"20px",maxHeight:`${20*F+16}px`,overflowY:"auto"}}),"interrupt"!==ei||ez||eq||eh?(0,t.jsx)(p.Button,{variant:"ghost",size:"sm",className:(0,_.cn)("h-7 w-7 shrink-0 p-0 text-muted-foreground hover:text-foreground",eW&&(z?"text-foreground":"text-claude-active"),!eW&&"opacity-30"),onClick:()=>{eO(),J?eo.current?.blur():eo.current?.focus()},disabled:!eW,"aria-label":V("queueSend"),title:V("queueSend"),children:eh?(0,t.jsx)(l.Loader2,{size:14,className:"animate-spin"}):e$?(0,t.jsx)(s.Ban,{size:14}):(0,t.jsx)(d.SendHorizontal,{size:16})}):(0,t.jsx)(p.Button,{variant:"ghost",size:"sm",className:(0,_.cn)("h-7 w-7 shrink-0 p-0 text-ui-red hover:text-ui-red/80",!ea&&"opacity-30"),onClick:()=>{em(!0)},disabled:!ea,"aria-label":V("interruptAriaLabel"),children:(0,t.jsx)(u.Square,{size:14,fill:"currentColor"})})]}),B&&/^\/[^\r\n]*$/.test(et)&&(0,t.jsx)(p.Button,{variant:"ghost",size:"sm",className:"self-start text-xs",onClick:()=>eA(et),disabled:!ea||"needs-input"===N||"unknown"===N||eq,children:V("nativeCommandsOpen")}),ec.messages.length>0&&(0,t.jsxs)("div",{className:"border-t border-border pt-2",children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",role:"status",children:[(0,t.jsx)(o.Clock3,{size:12}),V("queuedCount",{count:ec.messages.length})]}),(0,t.jsxs)(p.Button,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:eI,disabled:!ea||G||eh||ec.sending||"unknown"===N||"sessionChanged"===ec.error,title:V("submitQueuedNowHint"),children:[ec.sending?(0,t.jsx)(l.Loader2,{size:12,className:"animate-spin"}):(0,t.jsx)(d.SendHorizontal,{size:12}),V("submitQueuedNow")]})]}),(0,t.jsx)("ul",{className:"max-h-28 overflow-y-auto",children:ec.messages.map((e,n)=>(0,t.jsxs)("li",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",title:e.text,children:e.text||e.attachments.map(e=>e.filename).join(", ")}),(0,t.jsx)("button",{type:"button",className:"p-1 hover:text-foreground disabled:opacity-30",disabled:ec.sending&&0===n,"aria-label":V("cancelQueuedMessage"),onClick:()=>{ec.remove(e.id).catch(e=>r.toast.error(e instanceof Error&&e.message?e.message:V("queueRequestFailed")))},children:(0,t.jsx)(m.X,{size:12})})]},e.id))}),ec.error&&(0,t.jsx)("p",{className:"mt-1 text-xs text-ui-red",role:"alert",children:V("sessionChanged"===ec.error?"queueSessionChanged":"queueSendFailed")})]})]})})})]}),(0,t.jsx)(b.default,{open:eu,onOpenChange:em,onConfirm:()=>{es()}})]})}],148141),e.s(["default",0,e=>{let{prompts:a,visible:r,onSelect:s}=e,o=(0,i.useTranslations)("terminal"),l=(0,n.useRef)(null),c=a.length>0,d=(0,n.useCallback)(e=>{s(e)},[s]),u=(0,n.useCallback)(e=>{let t=l.current?.querySelectorAll("[data-quick-prompt]");if(!t?.length)return;let n=Array.from(t).findIndex(e=>e===document.activeElement),i=-1;"ArrowRight"===e.key?(e.preventDefault(),i=n<t.length-1?n+1:0):"ArrowLeft"===e.key&&(e.preventDefault(),i=n>0?n-1:t.length-1),i>=0&&t[i].focus()},[]);return r&&c?(0,t.jsx)("div",{ref:l,role:"toolbar","aria-label":o("quickPrompts"),className:"chat-content mt-1 flex justify-start gap-2 overflow-x-auto px-3 py-1.5 scrollbar-none animate-in fade-in duration-150",onKeyDown:u,children:a.map(e=>(0,t.jsx)(p.Button,{"data-quick-prompt":e.id,variant:"outline",size:"sm",tabIndex:0,className:"shrink-0 rounded-full px-3 py-1 text-xs text-muted-foreground hover:border-foreground/30 hover:text-foreground",onClick:()=>d(e.prompt),children:e.name},e.id))}):null}],624306)},706140,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(352819),a=e.i(494834),r=e.i(817908),s=e.i(932268),o=e.i(205270);let l=(0,o.default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);var c=e.i(73348);let d=(0,o.default)("file-question-mark",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);var u=e.i(760057),m=e.i(853560),_=e.i(661059),p=e.i(26857),g=e.i(189257),f=e.i(569479),h=e.i(353533),E=e.i(316484),S=e.i(13628);let b={ok:"text-muted-foreground",warn:"text-ui-amber",danger:"text-ui-red",critical:"text-ui-red"},v=2*Math.PI*4.5,T=e=>{let{percentage:n,currentTokens:a,windowSize:r}=e,s=(0,i.useTranslations)("session.meta"),o=Math.max(0,Math.min(100,n)),l=o>=92?"critical":o>=80?"danger":o>=50?"warn":"ok",c=b[l],d=null!==a&&null!==r?`${(0,E.formatTokenCount)(a)} / ${(0,E.formatTokenCount)(r)} (${Math.round(o)}%)`:`${Math.round(o)}%`,u="critical"===l||"danger"===l?s("contextHintRed"):"warn"===l?s("contextHintAmber"):null;return(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsxs)(f.TooltipTrigger,{className:(0,h.cn)("inline-flex shrink-0 items-center gap-1 font-mono",c,"critical"===l&&"animate-pulse"),children:[(0,t.jsxs)("svg",{width:12,height:12,viewBox:"0 0 12 12",className:"shrink-0 -rotate-90","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:6,cy:6,r:4.5,fill:"none",stroke:"currentColor",strokeOpacity:.2,strokeWidth:1.75}),(0,t.jsx)("circle",{cx:6,cy:6,r:4.5,fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeDasharray:v,strokeDashoffset:v*(1-o/100),strokeLinecap:"round"})]}),(0,t.jsxs)("span",{children:[Math.round(o),"%"]})]}),(0,t.jsx)(f.TooltipContent,{side:"bottom",children:(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 text-xs",children:[(0,t.jsx)("span",{className:"font-mono",children:d}),u&&(0,t.jsx)("span",{className:"text-muted-foreground",children:u})]})})]})},y=e=>{let{text:i,className:a}=e,[r,s]=(0,n.useState)(!1),o=async e=>{e.stopPropagation(),await (0,S.copyToClipboard)(i)&&(s(!0),setTimeout(()=>s(!1),1500))};return(0,t.jsx)("button",{type:"button",onClick:o,className:(0,h.cn)("inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/50 hover:text-foreground",a),"aria-label":"Copy",children:r?(0,t.jsx)(g.Check,{size:11,className:"text-positive"}):(0,t.jsx)(p.Copy,{size:11})})},C=()=>(0,t.jsx)("span",{className:"mx-1.5 text-muted-foreground/50",children:"·"}),N=e=>{let{text:i,className:a,breakAll:r=!1}=e,[s,o]=(0,n.useState)(!1);return(0,t.jsx)("button",{type:"button",onClick:()=>o(e=>!e),className:(0,h.cn)("min-w-0 cursor-pointer text-left",!s&&"truncate",s&&(r?"whitespace-pre-wrap break-all":"whitespace-pre-wrap break-words"),a),title:s?void 0:i,children:i})};e.s(["MetaCompact",0,e=>{let{title:n,totalCost:i,branch:a,usedPercentage:s,currentContextTokens:o,contextWindowSize:l}=e,c=n.length>30?`${n.slice(0,30)}…`:n,d=null!==o&&null!==l&&l>0,u=s??(d?o/l*100:null);return(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center text-xs",children:[(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{className:"max-w-[200px] truncate text-sm font-medium text-foreground",children:c}),n.length>30&&(0,t.jsx)(f.TooltipContent,{side:"bottom",className:"max-w-[300px]",children:(0,t.jsx)("p",{className:"text-xs",children:n})})]}),a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C,{}),(0,t.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,t.jsx)(r.GitBranch,{size:12,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono",children:a})]})]}),null!==i&&i>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C,{}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground",children:(0,E.formatCost)(i)})]}),null!==u&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C,{}),(0,t.jsx)(T,{percentage:u,currentTokens:o,windowSize:l})]})]})},"MetaDetail",0,e=>{let{title:n,sessionId:o,createdAt:p,updatedAt:g,fileSize:h,userCount:S,assistantCount:b,toolCount:v,toolBreakdown:T,inputTokens:C,cachedInputTokens:x=null,outputTokens:R,reasoningOutputTokens:O=null,totalCost:I,currentContextTokens:A,contextWindowSize:w,usedPercentage:D,model:L,branch:M,isBranchLoading:k,gitStatus:P,tmuxInfo:F}=e,U=(0,i.useTranslations)("session.meta"),B=p?(0,a.default)(p).fromNow():"",G=g?(0,a.default)(g).fromNow():"",j=null!==C&&null!==R,Y=j?[U("inputOutput",{input:(0,E.formatTokenDetail)(C),output:(0,E.formatTokenDetail)(R)}),null!==x&&x>0?U("cachedTokens",{count:(0,E.formatTokenDetail)(x)}):null,null!==O&&O>0?U("reasoningTokens",{count:(0,E.formatTokenDetail)(O)}):null].filter(Boolean).join(" / "):"";return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-1",children:[(0,t.jsx)("span",{className:"truncate font-mono text-xs text-muted-foreground/50",children:o}),o&&(0,t.jsx)(y,{text:o})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[k&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground/50",children:"..."}),!k&&M&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,t.jsx)(r.GitBranch,{size:12}),(0,t.jsx)("span",{className:"font-mono text-xs",children:M})]})]})]}),(0,t.jsx)(N,{text:n,className:"text-sm font-medium text-foreground"}),(0,t.jsxs)("div",{className:"mt-1 flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("message")}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[U("userAssistant",{userCount:S,assistantCount:b}),null!==v&&v>0&&(0,t.jsxs)(t.Fragment,{children:[" / ",(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{className:"cursor-default",children:U("toolsCount",{count:v})}),T&&Object.keys(T).length>0&&(0,t.jsx)(f.TooltipContent,{side:"bottom",children:(0,t.jsx)("div",{className:"flex flex-col gap-0.5 font-mono text-xs",children:Object.entries(T).sort((e,t)=>{let[,n]=e,[,i]=t;return i-n}).map(e=>{let[n,i]=e;return(0,t.jsxs)("div",{className:"flex justify-between gap-4",children:[(0,t.jsx)("span",{children:n}),(0,t.jsx)("span",{className:"text-muted-foreground",children:i})]},n)})})})]})]})]})]}),j&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("tokens")}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:Y})]}),null!==A&&null!==w&&w>0&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("context")}),(0,t.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[(0,E.formatTokenCount)(A)," / ",(0,E.formatTokenCount)(w),null!==D?` (${D}%)`:""]})]}),null!==I&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("cost")}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:(0,E.formatCost)(I)})]}),L&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("model")}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:L})]}),p&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("created")}),(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsxs)(f.TooltipTrigger,{className:"text-xs text-muted-foreground",children:[(0,a.default)(p).format("MM/DD HH:mm")," (",B,")"]}),(0,t.jsx)(f.TooltipContent,{side:"bottom",children:(0,t.jsx)("p",{className:"text-xs",children:(0,a.default)(p).format("YYYY-MM-DD HH:mm:ss")})})]})]}),g&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("updated")}),(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsxs)(f.TooltipTrigger,{className:"text-xs text-muted-foreground",children:[(0,a.default)(g).format("MM/DD HH:mm")," (",G,")"]}),(0,t.jsx)(f.TooltipContent,{side:"bottom",children:(0,t.jsx)("p",{className:"text-xs",children:(0,a.default)(g).format("YYYY-MM-DD HH:mm:ss")})})]})]}),h>0&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:"JSONL"}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:0===h?"0 B":h<1024?`${h} B`:h<1048576?`${(h/1024).toFixed(1)} KB`:`${(h/1048576).toFixed(1)} MB`})]})]}),F&&(0,t.jsx)("div",{className:"mt-1 border-t border-border pt-2",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[F.cwd&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("path")}),(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{className:"min-w-0 truncate font-mono text-xs text-muted-foreground",children:(e=>{{let t=e.match(/^\/Users\/[^/]+(.*)$/);if(t)return`~${t[1]}`}return e})(F.cwd)}),(0,t.jsx)(f.TooltipContent,{side:"bottom",children:(0,t.jsx)("p",{className:"text-xs",children:F.cwd})})]})]}),(F.lastCommand||F.command)&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("process")}),(0,t.jsx)(N,{text:F.lastCommand??F.command,className:"flex-1 font-mono text-xs text-muted-foreground",breakAll:!0})]}),F.pid&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:"PID"}),(0,t.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:F.pid})]}),F.width&&F.height&&(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("size")}),(0,t.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[F.width," × ",F.height]})]}),(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:U("session")}),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-1",children:[(0,t.jsx)("span",{className:"min-w-0 truncate font-mono text-xs text-muted-foreground",children:F.sessionName}),(0,t.jsx)(y,{text:F.sessionName})]})]})]})}),P&&(0,t.jsx)("div",{className:"mt-1 border-t border-border pt-2",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-muted-foreground/70",children:"Git"}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-0.5",children:[M&&(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-muted-foreground",children:[(0,t.jsx)(r.GitBranch,{size:11}),M]}),P.staged>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-ui-green",children:[(0,t.jsx)(l,{size:11}),P.staged," staged"]}),P.modified>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-ui-amber",children:[(0,t.jsx)(c.FilePen,{size:11}),P.modified," modified",(P.insertions>0||P.deletions>0)&&(0,t.jsxs)("span",{className:"text-muted-foreground/70",children:["(",(0,t.jsxs)("span",{className:"text-ui-green",children:["+",P.insertions]})," ",(0,t.jsxs)("span",{className:"text-ui-red",children:["-",P.deletions]}),")"]})]}),P.untracked>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-muted-foreground",children:[(0,t.jsx)(d,{size:11}),P.untracked," untracked"]}),P.ahead>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-ui-blue",children:[(0,t.jsx)(u.ArrowUp,{size:11}),P.ahead," ahead"]}),P.behind>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-claude-active",children:[(0,t.jsx)(m.ArrowDown,{size:11}),P.behind," behind"]}),P.stash>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 font-mono text-xs text-muted-foreground",children:[(0,t.jsx)(_.Archive,{size:11}),P.stash," stash"]}),0===P.staged&&0===P.modified&&0===P.untracked&&0===P.ahead&&0===P.behind&&0===P.stash&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground/50",children:"clean"})]})]}),P.recentCommits&&P.recentCommits.length>0&&(0,t.jsx)("div",{className:"flex flex-col gap-0.5",children:P.recentCommits.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(s.GitCommit,{size:11,className:"shrink-0 text-muted-foreground/60"}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-ui-amber",children:e.shortHash}),(0,t.jsx)("span",{className:"min-w-0 max-w-[80px] shrink-0 truncate font-mono text-ui-blue",children:e.author}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground/60",children:(0,a.default)(e.timestamp).fromNow(!0)}),e.isMerge?(0,t.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground/60",children:"merge"}):(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5 font-mono text-muted-foreground/60",children:[e.filesChanged>0&&(0,t.jsxs)("span",{children:[e.filesChanged,"F"]}),e.insertions>0&&(0,t.jsxs)("span",{className:"text-ui-green",children:["+",e.insertions]}),e.deletions>0&&(0,t.jsxs)("span",{className:"text-ui-red",children:["-",e.deletions]})]}),(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{className:"min-w-0 truncate text-muted-foreground",children:e.subject}),(0,t.jsx)(f.TooltipContent,{side:"bottom",className:"max-w-[400px]",children:(0,t.jsx)("p",{className:"text-xs",children:e.subject})})]})]},e.hash))})]})})]})}],706140)},224050,695813,672432,326287,e=>{"use strict";var t=e.i(950323);e.i(80784);var n=e.i(191788);let i=async e=>{let t=await fetch(e);if(!t.ok)throw Error(`request-failed-${t.status}`);return await t.json()};e.s(["useCodexSessions",0,(e,a)=>{let r=a&&e?`/api/codex/sessions?cwd=${encodeURIComponent(e)}`:null,{data:s,error:o,isLoading:l,isValidating:c,mutate:d}=(0,t.default)(r,i,{revalidateOnFocus:!1,dedupingInterval:3e4,keepPreviousData:!0}),u=(0,n.useCallback)(async()=>{await d()},[d]);return{sessions:s?.sessions??[],isLoading:!!r&&l,isValidating:c,error:o??null,refresh:u}}],224050);var a=e.i(391398),r=e.i(352819),s=e.i(413646),o=e.i(74531);e.s(["default",0,e=>{let{className:t,onRestart:n,onShowTerminal:i}=e,l=(0,r.useTranslations)("terminal");return(0,a.jsx)(o.default,{icon:(0,a.jsx)(s.default,{size:32,className:"text-foreground motion-safe:animate-spin motion-reduce:opacity-70 [animation-duration:1.5s]"}),main:l("codexBootMain"),almostReady:l("codexBootAlmostReady"),subtitle:l("codexBootSubtitle"),failed:l("codexBootFailed"),failedHint:l("codexBootFailedHint"),restartLabel:l("codexBootRestart"),showTerminalLabel:l("codexBootShowTerminal"),className:t,almostReadyMs:3e3,errorThresholdMs:1e4,onRestart:n,onShowTerminal:i})}],695813);var l=e.i(803057),c=e.i(883210),d=e.i(143100),u=e.i(939310);e.s(["default",0,e=>{let{prompt:t,onRespond:n}=e,i=(0,r.useTranslations)("terminal"),o=t.currentVersion&&t.latestVersion?i("codexUpdateVersion",{current:t.currentVersion,latest:t.latestVersion}):null;return(0,a.jsxs)("div",{className:"flex w-full max-w-md flex-col gap-4 rounded-lg border border-border bg-background p-4 text-left shadow-sm",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-border bg-muted",children:(0,a.jsx)(s.default,{size:18})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-foreground",children:i("codexUpdateTitle")}),o&&(0,a.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o}),(0,a.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:i("success"===t.status?"codexUpdateSuccess":"updating"===t.status?"codexUpdateRunning":"codexUpdateDescription")}),t.updateCommand&&"prompt"===t.status&&(0,a.jsx)("p",{className:"mt-2 break-all rounded-md bg-muted px-2 py-1 font-mono text-[11px] text-muted-foreground",children:t.updateCommand})]})]}),"prompt"===t.status&&(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto_auto]",children:[(0,a.jsxs)(u.Button,{size:"sm",onClick:()=>n("update"),children:[(0,a.jsx)(c.Download,{className:"h-3.5 w-3.5"}),i("codexUpdateNow")]}),(0,a.jsx)(u.Button,{size:"sm",variant:"outline",onClick:()=>n("skip"),children:i("codexUpdateSkip")}),(0,a.jsx)(u.Button,{size:"sm",variant:"ghost",onClick:()=>n("skip-version"),children:i("codexUpdateSkipVersion")})]}),"updating"===t.status&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,a.jsx)(d.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),i("codexUpdateRunningHint")]}),"success"===t.status&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,a.jsx)(l.CheckCircle2,{className:"h-3.5 w-3.5 text-green-600"}),i("codexUpdateRestarting")]})]})}],672432);var m=e.i(319987),_=e.i(494834),p=e.i(222564),g=e.i(265524),f=e.i(353533),h=e.i(490034);let E=(0,n.memo)(e=>{let{session:t,isResuming:n,isDisabled:i,onSelect:r,onDeleted:s,noMessageLabel:o,tSession:l,tTime:c}=e,u=t.lastActivityAt||t.startedAt,p=(0,_.default)(u).format("MM/DD HH:mm"),g=((e,t)=>{let n=(0,_.default)(),i=(0,_.default)(e),a=n.diff(i,"minute");if(a<1)return t("justNow");if(a<60)return t("minutesAgo",{count:a});let r=n.diff(i,"hour");if(r<24)return t("hoursAgo",{count:r});let s=n.diff(i,"day");if(1===s)return t("yesterday");if(s<7)return t("daysAgo",{count:s});let o=n.diff(i,"week");if(o<4)return t("weeksAgo",{count:o});let l=n.diff(i,"month");return l<12?t("monthsAgo",{count:l}):t("yearsAgo",{count:n.diff(i,"year")})})(u,c),E=(0,h.default)(e=>e.sessionWorkflow.titles?.[`codex:${t.sessionId}`])||t.firstUserMessage?.trim()||o,S=l("turnCount",{count:t.turnCount}),b=[E,p,g,S].filter(Boolean).join(" · ");return(0,a.jsx)(m.default,{provider:"codex",sessionId:t.sessionId,label:t.firstUserMessage,disabled:i,onDeleted:s,children:(0,a.jsxs)("button",{type:"button","aria-label":b,disabled:i,onClick:()=>r(t),className:(0,f.cn)("w-full cursor-pointer border-b border-border/50 py-3 pl-1 pr-10 text-left transition-colors","hover:bg-claude-active/5 focus-visible:bg-claude-active/5 focus:outline-none",n&&"bg-claude-active/5",i&&!n&&"pointer-events-none opacity-50"),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-xs",children:[n?(0,a.jsx)(d.Loader2,{size:14,className:"shrink-0 animate-spin text-claude-active"}):(0,a.jsx)("span",{className:"inline-block h-1.5 w-1.5 shrink-0"}),(0,a.jsx)("span",{className:"text-muted-foreground",children:p})]}),(0,a.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:g})]}),(0,a.jsxs)("div",{className:"mt-1 flex items-center justify-between gap-2 pl-[12px]",children:[(0,a.jsx)("span",{className:"min-w-0 truncate text-left text-sm font-medium",children:E}),(0,a.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:S})]})]})})});E.displayName="CodexSessionItem";let S=()=>(0,a.jsx)("div",{className:"flex flex-col",children:[1,2,3].map(e=>(0,a.jsxs)("div",{className:"border-b border-border/50 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("div",{className:"h-3.5 w-24 animate-pulse rounded bg-muted"}),(0,a.jsx)("div",{className:"h-3.5 w-16 animate-pulse rounded bg-muted"})]}),(0,a.jsxs)("div",{className:"mt-2 flex items-center justify-between pl-[18px]",children:[(0,a.jsx)("div",{className:"h-4 w-40 animate-pulse rounded bg-muted"}),(0,a.jsx)("div",{className:"h-3.5 w-20 animate-pulse rounded bg-muted"})]})]},e))});e.s(["default",0,e=>{let{sessions:t,isLoading:i,error:o,resumingSessionId:l,onSelectSession:c,onRefresh:d,onNewSession:m,className:_}=e,h=(0,r.useTranslations)("terminal"),b=(0,r.useTranslations)("session"),v=(0,n.useRef)(null),T=(0,n.useCallback)(async()=>{await d(),v.current&&(v.current.scrollTop=0)},[d]),y=!!l;return(0,a.jsxs)("div",{className:(0,f.cn)("flex h-full flex-col",_),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-2",children:[(0,a.jsxs)("span",{className:"text-sm font-medium",children:[h("codexSessionList"),t.length>0&&`(${t.length})`]}),m&&(0,a.jsxs)(u.Button,{variant:"outline",size:"sm",onClick:m,children:[(0,a.jsx)(g.Plus,{size:12}),h("newConversation")]})]}),i&&0===t.length?(0,a.jsx)(S,{}):o?(0,a.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,a.jsx)(p.AlertCircle,{size:24,className:"text-ui-red"}),(0,a.jsx)("p",{className:"text-sm",children:o}),(0,a.jsx)(u.Button,{variant:"outline",size:"sm",onClick:T,children:h("codexRetry")})]}):0===t.length?(0,a.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 px-6 py-10 text-center",children:[(0,a.jsx)(s.default,{size:40,className:"text-muted-foreground/50"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:h("codexSessionsEmpty")}),m&&(0,a.jsxs)(u.Button,{size:"sm",onClick:m,children:[(0,a.jsx)(g.Plus,{className:"h-3.5 w-3.5"}),h("codexNewConversation")]})]}):(0,a.jsx)("div",{ref:v,className:"flex-1 overflow-y-auto",children:t.map(e=>(0,a.jsx)(E,{session:e,isResuming:e.sessionId===l,isDisabled:y,onSelect:c,onDeleted:d,noMessageLabel:b("noMessage"),tSession:b,tTime:b},e.jsonlPath))})]})}],326287)},204360,e=>{"use strict";var t=e.i(391398),n=e.i(191788),i=e.i(199648),a=e.i(353533),r=e.i(418760),s=e.i(224050);let o=e=>({provider:"claude",sessionId:e.sessionId,key:`claude:${e.sessionId}`,startedAt:e.startedAt,lastActivityAt:e.lastActivityAt,firstMessage:e.firstMessage||null,turnCount:e.turnCount}),l=e=>({provider:"codex",sessionId:e.sessionId,key:`codex:${e.jsonlPath}`,startedAt:new Date(e.startedAt).toISOString(),lastActivityAt:new Date(e.lastActivityAt||e.startedAt).toISOString(),firstMessage:e.firstUserMessage,turnCount:e.turnCount});var c=e.i(319987),d=e.i(143100),u=e.i(265524),m=e.i(352819),_=e.i(494834),p=e.i(939310),g=e.i(714233),f=e.i(413646),h=e.i(490034);let E=e=>{if("ArrowDown"===e.key){e.preventDefault();let t=e.currentTarget.closest("[data-session-row]")?.nextElementSibling?.querySelector("button");t?.focus()}else if("ArrowUp"===e.key){e.preventDefault();let t=e.currentTarget.closest("[data-session-row]")?.previousElementSibling?.querySelector("button");t?.focus()}},S=()=>(0,t.jsx)("div",{className:"flex flex-col",children:[1,2,3].map(e=>(0,t.jsxs)("div",{className:"border-b border-border/50 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{className:"h-3.5 w-24 animate-pulse rounded bg-muted"}),(0,t.jsx)("div",{className:"h-3.5 w-16 animate-pulse rounded bg-muted"})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-center justify-between pl-[18px]",children:[(0,t.jsx)("div",{className:"h-4 w-40 animate-pulse rounded bg-muted"}),(0,t.jsx)("div",{className:"h-3.5 w-8 animate-pulse rounded bg-muted"})]})]},e))}),b=e=>{let{provider:n}=e;return"codex"===n?(0,t.jsx)(f.default,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,t.jsx)(g.default,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})},v=(0,n.memo)(e=>{let{session:n,isResuming:i,isDisabled:r,onSelect:s,onDeleted:o,noMessageLabel:l,tSession:u}=e,m=(0,_.default)(n.lastActivityAt).format("MM/DD HH:mm"),p=((e,t)=>{let n=(0,_.default)(),i=(0,_.default)(e),a=n.diff(i,"minute");if(a<1)return t("justNow");if(a<60)return t("minutesAgo",{count:a});let r=n.diff(i,"hour");if(r<24)return t("hoursAgo",{count:r});let s=n.diff(i,"day");if(1===s)return t("yesterday");if(s<7)return t("daysAgo",{count:s});let o=n.diff(i,"week");if(o<4)return t("weeksAgo",{count:o});let l=n.diff(i,"month");return l<12?t("monthsAgo",{count:l}):t("yearsAgo",{count:n.diff(i,"year")})})(n.lastActivityAt,u),g=(0,h.default)(e=>e.sessionWorkflow.titles?.[`${n.provider}:${n.sessionId}`])||n.firstMessage?.trim()||l,f="codex"===n.provider?"Codex":"Claude";return(0,t.jsx)(c.default,{provider:n.provider,sessionId:n.sessionId,label:n.firstMessage,disabled:r,onDeleted:o,children:(0,t.jsxs)("button",{type:"button",className:(0,a.cn)("w-full cursor-pointer border-b border-border/50 py-3 pl-3 pr-10 text-left transition-colors","hover:bg-claude-active/5 focus-visible:bg-claude-active/5 focus:outline-none",r&&!i&&"pointer-events-none opacity-50",i&&"bg-claude-active/5"),onClick:()=>s(n),onKeyDown:E,disabled:r,"aria-label":`${f}: ${g}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs",children:[i?(0,t.jsx)(d.Loader2,{size:14,className:"shrink-0 animate-spin text-claude-active"}):(0,t.jsx)(b,{provider:n.provider}),(0,t.jsx)("span",{className:"text-muted-foreground",children:m})]}),(0,t.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:p})]}),(0,t.jsxs)("div",{className:"mt-1 flex items-center justify-between gap-2 pl-5",children:[(0,t.jsx)("span",{className:"min-w-0 truncate text-left text-sm font-medium",children:g}),(0,t.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:u("turnCount",{count:n.turnCount})})]})]})})});v.displayName="AgentSessionItem";let T=e=>{let{sessions:r,isLoading:s,isLoadingMore:o,hasMore:l,error:c,resumingSessionKey:d,onSelectSession:_,onRefresh:g,onLoadMore:f,onNewSession:h,onNewClaudeSession:E,onNewCodexSession:b}=e,T=(0,m.useTranslations)("terminal"),y=(0,m.useTranslations)("session"),C=(0,n.useRef)(null),[N,x]=(0,n.useState)("all"),R=(0,n.useCallback)(async()=>{await g(),C.current&&(C.current.scrollTop=0)},[g]),O=(0,n.useCallback)(()=>{let e=C.current;e&&l&&!o&&e.scrollTop+e.clientHeight>=e.scrollHeight-50&&f()},[l,o,f]),I=!!d,A="codex"===c?T("codexSessionsLoadFailed"):c,w=(0,n.useMemo)(()=>r.filter(e=>"all"===N||e.provider===N),[N,r]),D=[{key:"all",label:T("sessions")},{key:"claude",label:"Claude"},{key:"codex",label:"Codex"}];return(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b px-4 py-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsxs)("span",{className:"text-sm font-medium",children:[T("sessions"),r.length>0&&`(${r.length}${l?"+":""})`]}),(0,t.jsx)("div",{className:"flex h-7 items-center rounded-md border border-border p-0.5",children:D.map(e=>(0,t.jsx)("button",{type:"button",className:(0,a.cn)("h-6 rounded px-2 text-xs text-muted-foreground transition-colors",N===e.key&&"bg-accent text-foreground"),onClick:()=>x(e.key),children:e.label},e.key))})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[E&&(0,t.jsxs)(p.Button,{variant:"outline",size:"sm",onClick:E,children:[(0,t.jsx)(u.Plus,{size:12}),"Claude"]}),b&&(0,t.jsxs)(p.Button,{variant:"outline",size:"sm",onClick:b,children:[(0,t.jsx)(u.Plus,{size:12}),"Codex"]}),h&&!E&&!b&&(0,t.jsxs)(p.Button,{variant:"outline",size:"sm",onClick:h,children:[(0,t.jsx)(u.Plus,{size:12}),T("newConversation")]})]})]}),s&&0===r.length?(0,t.jsx)(S,{}):A?(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)("p",{className:"text-sm",children:A}),(0,t.jsx)(p.Button,{variant:"outline",size:"sm",onClick:R,children:T("retryLoad")})]}):(0,t.jsxs)("div",{ref:C,className:"flex-1 overflow-y-auto",onScroll:O,children:[0===w.length?(0,t.jsx)("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:y("empty.noSession")}):w.map(e=>(0,t.jsx)(v,{session:e,isResuming:e.key===d,isDisabled:I,onSelect:_,onDeleted:g,noMessageLabel:y("noMessage"),tSession:y},e.key)),o&&(0,t.jsx)("div",{className:"flex items-center justify-center py-3",children:(0,t.jsx)(i.default,{size:14,className:"text-muted-foreground"})})]})]})};e.s(["default",0,e=>{let{sessionName:c,cwd:d,className:u,onSelectSession:m,onNewClaudeSession:_,onNewCodexSession:p}=e,[g,f]=(0,n.useState)(null),h=(0,n.useRef)(!0),{sessions:E,isLoading:S,isLoadingMore:b,hasMore:v,error:y,refetch:C,loadMore:N}=(e=>{let{tmuxSession:t,enabled:i,cwd:a}=e,c=(0,r.default)({tmuxSession:t,enabled:i,cwd:a}),d=(0,s.useCodexSessions)(a,i&&!!a),u=(0,n.useMemo)(()=>{let e=[...c.sessions.map(o),...d.sessions.map(l)];return e.sort((e,t)=>new Date(t.lastActivityAt).getTime()-new Date(e.lastActivityAt).getTime()),e},[c.sessions,d.sessions]),m=(0,n.useCallback)(async()=>{await Promise.all([c.refetch(),d.refresh()])},[c,d]);return{sessions:u,isLoading:c.isLoading||d.isLoading,isLoadingMore:c.isLoadingMore,hasMore:c.hasMore,error:c.error||(d.error?"codex":null),refetch:m,loadMore:c.loadMore}})({tmuxSession:c,enabled:!!c,cwd:d});(0,n.useEffect)(()=>(h.current=!0,()=>{h.current=!1}),[]);let x=(0,n.useCallback)(e=>{g||(f(e.key),Promise.resolve(m(e)).finally(()=>{h.current&&f(t=>t===e.key?null:t)}))},[m,g]);return S&&0===E.length?(0,t.jsx)("div",{className:(0,a.cn)("flex h-full w-full flex-col items-center justify-center bg-card",u),children:(0,t.jsx)(i.default,{className:"h-4 w-4 text-muted-foreground"})}):(0,t.jsx)("div",{className:(0,a.cn)("h-full w-full bg-card",u),children:(0,t.jsx)(T,{sessions:E,isLoading:S,isLoadingMore:b,hasMore:v,error:y,resumingSessionKey:g,onSelectSession:x,onRefresh:C,onLoadMore:N,onNewClaudeSession:_,onNewCodexSession:p})})}],204360)},104905,e=>{"use strict";let t="__CTRL__",n="__SHIFT__",i=[{label:"Tab",value:" "},{label:"Esc",value:"\x1b"},{label:"Ctrl",value:t},{label:"Shift",value:n},{label:"",value:"\r",nerd:!0},{label:"",value:"\x1b[A",nerd:!0},{label:"",value:"\x1b[B",nerd:!0},{label:"",value:"\x1b[D",nerd:!0},{label:"",value:"\x1b[C",nerd:!0},{label:"",value:"|",nerd:!0,rotate:!0},{label:"",value:"~",nerd:!0}];e.s(["CTRL_TOGGLE",0,t,"SHIFT_TOGGLE",0,n,"TERMINAL_KEYS",0,i,"toCtrlChar",0,e=>{if(1!==e.length)return null;let t=e.toLowerCase().charCodeAt(0);return t>=97&&t<=122?String.fromCharCode(t-96):null}])},196755,750147,732859,1398,e=>{"use strict";var t=e.i(391398),n=e.i(909725),i=e.i(352819),a=e.i(939310),r=e.i(353533);e.s(["default",0,e=>{let{modeName:s,onSwitch:o,onDismiss:l,className:c}=e,d=(0,i.useTranslations)("terminal"),u=(0,i.useTranslations)("common");return(0,t.jsxs)("div",{className:(0,r.cn)("absolute right-3 bottom-3 z-20 flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 shadow-lg animate-[fadeIn_200ms_ease-out]",c),children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:d("switchToAgentMode",{name:s})}),(0,t.jsx)(a.Button,{variant:"default",size:"sm",className:"h-6 px-2 text-[11px]",onClick:o,children:d("switchMode")}),(0,t.jsx)("button",{className:"flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground",onClick:l,"aria-label":u("close"),children:(0,t.jsx)(n.X,{className:"h-3.5 w-3.5"})})]})}],196755);var s=e.i(191788),o=e.i(601726);let l=/Quick safety check|Do you trust the contents of this directory/i,c=/(\/[^\s│]+)/,d=e=>{let t;if(!l.test(e))return null;let n=e.split("\n").map(e=>e.replace(/^\s*[│┃]/,"").replace(/[│┃]\s*$/,"")),i=-1,a=-1;for(let e=0;e<n.length;e++)l.test(n[e])&&(a=i,i=e);if(i<0)return null;let r=/Quick safety check/i.test(n[i])?"claude":"codex",s=n.slice(a+1,i);if(!(t="claude"===r?s.slice(-6).reverse().map(e=>e.match(c)?.[1]).find(Boolean):s.map(e=>e.match(/repository root:\s*(\/\S+)/i)?.[1]).find(Boolean)??s.map(e=>e.match(/You are in\s+(\/\S+)/i)?.[1]).find(Boolean)))return null;let d=n.slice(i).join("\n"),u=(0,o.parsePermissionOptions)(d),m=u.options.map(e=>{let t;return t=(0,o.stripNumberPrefix)(e).replace(/\s/g,""),("claude"===r?/^Yes,Itrustthisfolder/i:/^Yes,continue/i).test(t)?"yes":("claude"===r?/^No,exit/i:/^No,quit/i).test(t)?"no":null}),_=m.indexOf("yes"),p=m.indexOf("no");if(2!==u.options.length||_<0||p<0)return null;let g=(0,o.optionNumber)(u.options[_]),f=(0,o.optionNumber)(u.options[p]);if(g&&f)return{agent:r,folderPath:t,selection:{mode:"numbered",yesKey:g,noKey:f}};let h=m[u.focusedIndex],E=/^\s*[❯›>]\s+(?:Yes,|No,)/im.test(d);return{agent:r,folderPath:t,selection:h&&E?{mode:"navigation",selectedAnswer:h,yesIsFirst:_<p}:{mode:"unavailable"}}};e.s(["default",0,e=>{let{enabled:t,scopeKey:n=null,getBufferText:i,sendStdin:a}=e,[r,o]=(0,s.useState)(null),l=(0,s.useRef)(null),c=(0,s.useRef)(null),u=(0,s.useRef)({enabled:t,scopeKey:n,getBufferText:i});(0,s.useEffect)(()=>{u.current={enabled:t,scopeKey:n,getBufferText:i}},[t,n,i]);let m=(0,s.useCallback)(()=>{u.current.enabled&&!l.current&&(l.current=setTimeout(()=>{l.current=null;let e=u.current;if(!e.enabled)return;let t=d(e.getBufferText());o(n=>t?n?.scopeKey===e.scopeKey&&n.prompt.folderPath===t.folderPath&&n.prompt.agent===t.agent&&n.prompt.selection.mode===t.selection.mode?n:{scopeKey:e.scopeKey,prompt:t}:null)},200))},[]);(0,s.useEffect)(()=>(m(),()=>{l.current&&clearTimeout(l.current),l.current=null,c.current&&(clearTimeout(c.current.timer),c.current.resolve(!1),c.current=null)}),[t,n,m]);let _=t&&r?.scopeKey===n?r.prompt:null,p=(0,s.useCallback)(async e=>{let t=u.current;if(!_||!t.enabled||t.scopeKey!==n||c.current)return;let i=d(t.getBufferText());if(!i||i.agent!==_.agent||i.folderPath!==_.folderPath)return;let r=((e,t)=>{let{selection:n}=e;if("unavailable"===n.mode)return[];if("numbered"===n.mode){let i="yes"===t?n.yesKey:n.noKey;return"codex"===e.agent?[i]:[i,"\r"]}return t===n.selectedAnswer?["\r"]:[("yes"===t?n.yesIsFirst:!n.yesIsFirst)?"\x1b[A":"\x1b[B","\r"]})(i,e);if(r.length){if(a(r[0]),r.length>1){let t=await new Promise(e=>{let t=setTimeout(()=>{c.current=null,e(!0)},80);c.current={timer:t,resolve:e}}),s=u.current;if(!t||!s.enabled||s.scopeKey!==n)return;let o=d(s.getBufferText());if(!o||o.agent!==i.agent||o.folderPath!==i.folderPath||"navigation"===i.selection.mode&&("navigation"!==o.selection.mode||o.selection.selectedAnswer!==e))return;a(r[1])}o(null)}},[_,n,a]);return{trustPrompt:_,onTerminalData:m,onTrustResponse:p}}],750147);var u=e.i(482821);e.s(["default",0,e=>{let{enabled:t,scopeKey:n,getBufferText:i,sendStdin:a,onUpdated:r}=e,[o,l]=(0,s.useState)({scopeKey:null,prompt:null}),c=(0,s.useRef)(!1),d=(0,s.useRef)(n??null),m=(0,s.useRef)(null),_=(0,s.useRef)(null),p=(0,s.useRef)(!1),g=(0,s.useRef)(i),f=(0,s.useRef)(r);(0,s.useEffect)(()=>{g.current=i},[i]),(0,s.useEffect)(()=>{f.current=r},[r]),(0,s.useEffect)(()=>{d.current=n??null},[n]);let h=(0,s.useCallback)(()=>{c.current&&!m.current&&(m.current=setTimeout(()=>{if(m.current=null,!c.current)return;let e=(0,u.matchCodexUpdatePrompt)(g.current()),t=d.current;l(n=>{let i=n.scopeKey===t?n.prompt:null;return e?("success"!==e.status||p.current||(p.current=!0,_.current=setTimeout(()=>{_.current=null,f.current?.()},700)),i&&i.status===e.status&&i.currentVersion===e.currentVersion&&i.latestVersion===e.latestVersion&&i.updateCommand===e.updateCommand)?n:{scopeKey:t,prompt:e}:i?.status==="prompt"?n:{scopeKey:t,prompt:null}})},200))},[]);(0,s.useEffect)(()=>{let e=c.current;if(c.current=t,!t){m.current&&(clearTimeout(m.current),m.current=null),p.current=!1;return}e||h()},[t,h]),(0,s.useEffect)(()=>()=>{m.current&&clearTimeout(m.current),_.current&&clearTimeout(_.current)},[]);let E=(0,s.useCallback)(e=>{if("update"===e){l(e=>e.prompt?{...e,prompt:{...e.prompt,status:"updating"}}:e),a("1\r");return}l({scopeKey:d.current,prompt:null}),a("skip"===e?"2\r":"3\r")},[a]),S=o.scopeKey===(n??null)?o.prompt:null;return{updatePrompt:t?S:null,onTerminalData:h,onRespond:E}}],732859);var m=e.i(518829),_=e.i(815016),p=e.i(212283);let g=async()=>{try{let e=await fetch("/api/preflight/runtime",{method:"POST"});if(!e.ok)return null;return await e.json()}catch{return null}};e.s(["useAgentInstallCheck",0,()=>{let e=(0,i.useTranslations)("toolsRequired"),n=(0,i.useTranslations)("common"),[a,r]=(0,s.useState)(null),[o,l]=(0,s.useState)(!1),[c,d]=(0,s.useState)(null),u=(0,s.useCallback)(async t=>{let i=await g();return i?("codex"===t?!!i.codex.installed:!!i.claude.installed)||("codex"===t?d({title:e("codexMissingTitle"),description:e("codexMissingDescription"),confirmLabel:e("codexInstallGuide"),action:"guide"}):i.claude.binaryPath?d({title:e("agentPathPromptTitle"),description:e("agentPathPromptDescription"),confirmLabel:e("fixClaudePath"),action:"install",command:"claude-path",label:e("fixClaudePath")}):d({title:e("agentInstallPromptTitle"),description:e("agentInstallPromptDescription"),confirmLabel:e("installClaude"),action:"install",command:"claude",label:e("installClaude")}),!1):(d({title:e("preflightFailedTitle"),description:e("preflightFailedDescription"),confirmLabel:n("close")}),!1)},[e,n]),f=(0,s.useCallback)(()=>{if(!c?.action)return void d(null);if("guide"===c.action){d(null),l(!0);return}c.command&&c.label&&r({command:c.command,label:c.label}),d(null)},[c]);return{ensureAgentInstalled:u,installDialogs:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.AlertDialog,{open:!!c,onOpenChange:e=>{e||d(null)},children:(0,t.jsxs)(p.AlertDialogContent,{children:[(0,t.jsxs)(p.AlertDialogHeader,{children:[(0,t.jsx)(p.AlertDialogTitle,{children:c?.title}),(0,t.jsx)(p.AlertDialogDescription,{children:c?.description})]}),(0,t.jsxs)(p.AlertDialogFooter,{children:[c?.action&&(0,t.jsx)(p.AlertDialogCancel,{onClick:()=>d(null),children:n("cancel")}),(0,t.jsx)(p.AlertDialogAction,{onClick:f,children:c?.confirmLabel??n("confirm")})]})]})}),a&&(0,t.jsx)(m.default,{open:!0,onOpenChange:()=>r(null),command:a.command,label:a.label,reloadOnClose:!1}),(0,t.jsx)(_.default,{open:o,onOpenChange:l})]})}}],1398)},828324,827294,530417,e=>{"use strict";var t=e.i(983040);String.raw`
|
|
29
29
|
const fs = require('node:fs');
|
|
30
30
|
const path = require('node:path');
|
|
31
31
|
const os = require('node:os');
|