codeharden 2026.1122.2133 → 2026.1122.2302
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/README.md +48 -3
- package/dist/{args-B0i5tyjE.js → args-BJ0ric8X.js} +5 -5
- package/dist/args-BJ0ric8X.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/{commands-CvAvyECH.js → commands-BPobEsBP.js} +33 -14
- package/dist/commands-BPobEsBP.js.map +1 -0
- package/dist/{env-wDgRchH9.js → env-CMkse2o0.js} +2 -2
- package/dist/{env-wDgRchH9.js.map → env-CMkse2o0.js.map} +1 -1
- package/dist/{harden-channel-2IT0Y7p3.js → harden-channel-D7h06kQ_.js} +41 -3
- package/dist/harden-channel-D7h06kQ_.js.map +1 -0
- package/dist/{launcher-D17oQovS.js → launcher-CvQZcEIC.js} +3 -3
- package/dist/launcher-CvQZcEIC.js.map +1 -0
- package/dist/{lock-DxXcNd2w.js → lock-iovTSSb0.js} +2 -2
- package/dist/{lock-DxXcNd2w.js.map → lock-iovTSSb0.js.map} +1 -1
- package/dist/{main-BRHfJHGf.js → main-BFo94KOF.js} +6 -6
- package/dist/{main-BRHfJHGf.js.map → main-BFo94KOF.js.map} +1 -1
- package/dist/{main-CJdbWeA_.js → main-B_ui4G93.js} +3 -3
- package/dist/{main-CJdbWeA_.js.map → main-B_ui4G93.js.map} +1 -1
- package/dist/{mediaType-e66mt7Cb.js → mediaType-DHbUOwRj.js} +2 -2
- package/dist/{mediaType-e66mt7Cb.js.map → mediaType-DHbUOwRj.js.map} +1 -1
- package/dist/{runner-CKo8zFVx.js → runner-agAgr2qn.js} +5 -5
- package/dist/{runner-CKo8zFVx.js.map → runner-agAgr2qn.js.map} +1 -1
- package/dist/{runner-link-CGefyJ5U.js → runner-link-B7SsTYaz.js} +3 -3
- package/dist/{runner-link-CGefyJ5U.js.map → runner-link-B7SsTYaz.js.map} +1 -1
- package/dist/runner.js +1 -1
- package/dist/{server-test-aa-ENBUk.js → server-test-Cad_bM68.js} +4 -4
- package/dist/{server-test-aa-ENBUk.js.map → server-test-Cad_bM68.js.map} +1 -1
- package/dist/{src-CwV8i4Mj.js → src-BPcdaWEw.js} +4 -6
- package/dist/{src-CwV8i4Mj.js.map → src-BPcdaWEw.js.map} +1 -1
- package/dist/web/assets/{add-project-dialog-VBi3WXnh.js → add-project-dialog-BHbgORVh.js} +1 -1
- package/dist/web/assets/{agent-tabs-BNgrQWDq.js → agent-tabs-B6uUKAXD.js} +1 -1
- package/dist/web/assets/{agents-Ir1aHz-I.js → agents-NbcZbVrc.js} +1 -1
- package/dist/web/assets/{api-jkvqht5P.js → api-B9OffDXw.js} +1 -1
- package/dist/web/assets/{api-B620HpC2.js → api-yvn34iKU.js} +27 -27
- package/dist/web/assets/{archived-sessions-D4fJHB37.js → archived-sessions-C1-stU7x.js} +1 -1
- package/dist/web/assets/{automation-B91XTDIM.js → automation-Co7V1tcW.js} +1 -1
- package/dist/web/assets/{automation-new-CN7YhryW.js → automation-new-hCV8HoK1.js} +1 -1
- package/dist/web/assets/{automations-CLzVG-zc.js → automations-7GJxGbPp.js} +1 -1
- package/dist/web/assets/{composer-Dd8joSgj.js → composer-B1tdNGSi.js} +1 -1
- package/dist/web/assets/{conflict-card-BN9kNMVL.js → conflict-card-Bx8tT_d5.js} +1 -1
- package/dist/web/assets/{dialog-Dyw3b_Tu.js → dialog-Cvj_lHPY.js} +1 -1
- package/dist/web/assets/{diff-panel-CQ2XZMk2.js → diff-panel-BHhM9z93.js} +1 -1
- package/dist/web/assets/{draft-BmnE6-7J.js → draft-JkaN3nCS.js} +1 -1
- package/dist/web/assets/{dropdown-menu-C4XI7F63.js → dropdown-menu-Bflkx6wY.js} +1 -1
- package/dist/web/assets/{engines-Chq2ih3x.js → engines-pLQJYIu_.js} +1 -1
- package/dist/web/assets/{factory-BBYEYI9i.js → factory-DVCs5zxg.js} +1 -1
- package/dist/web/assets/{factory-columns-CtJOpFim.js → factory-columns-DExb6gW2.js} +1 -1
- package/dist/web/assets/{factory-item-BjydL6AH.js → factory-item-efMFkxnv.js} +1 -1
- package/dist/web/assets/{factory-view-BU2AKcD8.js → factory-view-Cot7flHA.js} +1 -1
- package/dist/web/assets/{files-panel-B6_6pSo9.js → files-panel-BIkR_seN.js} +1 -1
- package/dist/web/assets/{floor-scene-DCpEq0j7.js → floor-scene-DGy8i_5R.js} +1 -1
- package/dist/web/assets/{form-bits-BSfnSmQ7.js → form-bits-5XojWhBG.js} +1 -1
- package/dist/web/assets/{format-D1ma_o2D.js → format-D3kairnQ.js} +1 -1
- package/dist/web/assets/{home-_m_Aihwv.js → home-BtFPGjza.js} +1 -1
- package/dist/web/assets/{inbox-FDD5FMWW.js → inbox-CUPkJ4WC.js} +1 -1
- package/dist/web/assets/{index-BkpVvQrC.js → index-C0C9GyeX.js} +4 -4
- package/dist/web/assets/{item-parts-BhDFWsT1.js → item-parts-DZ3TQad4.js} +1 -1
- package/dist/web/assets/{kill-switch-Dvqaozhz.js → kill-switch-BDAFCjui.js} +1 -1
- package/dist/web/assets/{label-DcWfyglU.js → label-Bm_8Eqe2.js} +1 -1
- package/dist/web/assets/{local-whisper-test-DPTOEA1M.js → local-whisper-test-CqGlAOvK.js} +1 -1
- package/dist/web/assets/{markdown-ad2jia51.js → markdown-DGHfubu-.js} +1 -1
- package/dist/web/assets/{mobile-nav-D8FZcJzG.js → mobile-nav-CrjrDJZ5.js} +1 -1
- package/dist/web/assets/{model-picker-4yoJPkRY.js → model-picker-DnKv2cbc.js} +1 -1
- package/dist/web/assets/{new-session-ddLbjOoZ.js → new-session-Bc93-xJK.js} +1 -1
- package/dist/web/assets/{new-session-GpxXZWbB.js → new-session-CUpOffXI.js} +1 -1
- package/dist/web/assets/{new-session-CwbgcYzY.js → new-session-DVYesr8z.js} +1 -1
- package/dist/web/assets/{now-next-D-6j1g_S.js → now-next-x8fwFm7p.js} +1 -1
- package/dist/web/assets/{on-demand-Cvu5D9uT.js → on-demand-Cvi90jRi.js} +2 -2
- package/dist/web/assets/{open-pr-controls--EtUvzD2.js → open-pr-controls-CYypJCKQ.js} +1 -1
- package/dist/web/assets/{orchestration-pknfiYFr.js → orchestration-BZj0HlxR.js} +1 -1
- package/dist/web/assets/{page-header-BqPf-jRo.js → page-header-t9HzSrxd.js} +1 -1
- package/dist/web/assets/{pm-fMuSJMPP.js → pm-DJfHcB90.js} +1 -1
- package/dist/web/assets/{popover-OrzLEhHL.js → popover-BqwWmyWQ.js} +1 -1
- package/dist/web/assets/{pr-details-BBVM9Kll.js → pr-details-1hhbiFWa.js} +1 -1
- package/dist/web/assets/{project-ws85aDq4.js → project-dy2_DT0H.js} +1 -1
- package/dist/web/assets/{question-card-4aNx5IRX.js → question-card-ldxLXNS_.js} +1 -1
- package/dist/web/assets/{remote-check-BAPXUznK.js → remote-check-CQktPgyp.js} +2 -2
- package/dist/web/assets/{reports-BZj5_wsp.js → reports-D0GAsXFv.js} +1 -1
- package/dist/web/assets/{role-chat-CeJXMsYB.js → role-chat-nIyzM-vQ.js} +1 -1
- package/dist/web/assets/{run-conflict-CPr9OWa3.js → run-conflict-BlgKVpOG.js} +1 -1
- package/dist/web/assets/{runs-table-DpBJ4ZeQ.js → runs-table-DMPF5_D6.js} +1 -1
- package/dist/web/assets/{search-BFTvT67N.js → search-gwjIEGis.js} +1 -1
- package/dist/web/assets/{search-Da3B5-lr.js → search-hK5b8Xwb.js} +1 -1
- package/dist/web/assets/{select-B4LGxZQI.js → select-B1ES0hhy.js} +1 -1
- package/dist/web/assets/{session-_62x2rSZ.js → session-CPUTlq1O.js} +1 -1
- package/dist/web/assets/{settings-CUYuBL-5.js → settings-DRd0b0Kz.js} +1 -1
- package/dist/web/assets/{settings-ui-Ux8rPFol.js → settings-ui-Bc6ymtc_.js} +1 -1
- package/dist/web/assets/{setup-BKOOV6vX.js → setup-Bn2CFYAt.js} +1 -1
- package/dist/web/assets/{shallow-CbfSRfYC.js → shallow-BUNpybIA.js} +1 -1
- package/dist/web/assets/{spec-approval-9S-jPMrI.js → spec-approval-CmC6QBSh.js} +1 -1
- package/dist/web/assets/{spot-check-actions-5CmYjt8A.js → spot-check-actions-DzMUED1O.js} +1 -1
- package/dist/web/assets/{spot-checks-BadmkHuG.js → spot-checks-CDZxwwu0.js} +1 -1
- package/dist/web/assets/{storeys-OlWmOmqA.js → storeys-BEgFUsix.js} +1 -1
- package/dist/web/assets/{switch-DuBpF2_h.js → switch-BHplnCdo.js} +1 -1
- package/dist/web/assets/{terminal-view-ChO1pNp0.js → terminal-view-WNT8FI6K.js} +1 -1
- package/dist/web/assets/{theme-DsW-i9mD.js → theme-3eeE0sp4.js} +1 -1
- package/dist/web/assets/{thread-view-CPlJsMhl.js → thread-view-AQKzJlKb.js} +1 -1
- package/dist/web/assets/{update-banner-CNYd8gAf.js → update-banner-CZGRgiG8.js} +1 -1
- package/dist/web/assets/{updates-CQZDqpFF.js → updates-4l7pwDq1.js} +1 -1
- package/dist/web/assets/{use-retry-item-CWwb3JGo.js → use-retry-item-3n4BD_3J.js} +1 -1
- package/dist/web/assets/{vision-7gkgZ-Ap.js → vision-Z1sLHr_c.js} +1 -1
- package/dist/web/assets/{wip-chip-D5-cZcfN.js → wip-chip-DXwuAo3A.js} +1 -1
- package/dist/web/index.html +34 -34
- package/package.json +1 -1
- package/dist/args-B0i5tyjE.js.map +0 -1
- package/dist/commands-CvAvyECH.js.map +0 -1
- package/dist/harden-channel-2IT0Y7p3.js.map +0 -1
- package/dist/launcher-D17oQovS.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Ct as t,St as n,i as r}from"./api-B620HpC2.js";import{n as i,t as a}from"./jsx-runtime-C3cWAN_r.js";import{j as o,m as s,yt as c}from"./format-D1ma_o2D.js";import{t as l}from"./dist-wxbqfqV1.js";import{$n as u,F as d,M as f,P as p,Zn as m,bt as h,kt as g,n as _,pr as v,st as y}from"./icons-COCLuOtb.js";import{t as b}from"./markdown-ad2jia51.js";import{t as x}from"./textarea-gD4G5Znx.js";import{t as S}from"./input-CPpbtC2H.js";var C=e(i(),1),w=a();function T({item:e,sessionId:t,compact:n=!1,plan:i}){let a=r(),[d,f]=(0,C.useState)(null),p=c({mutationFn:({decision:n,message:r})=>a.respond(t,e.requestId,{kind:`approval`,decision:n,...r?{message:r}:{}}),onError:e=>o.error(`Couldn't send the decision`,{description:e.message})});if(e.status!==`in_progress`){let t=e.decision!==void 0&&e.decision!==`deny`;return(0,w.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-card/50 px-3 py-2 text-[13px] text-muted-foreground`,children:[(0,w.jsx)(t?u:m,{className:l(`size-4 shrink-0`,t?`text-status-done`:`text-muted-foreground`)}),(0,w.jsx)(`span`,{className:`min-w-0 truncate`,children:t?`Plan approved`:e.decision?`Kept planning`:`Plan review cancelled`}),e.decidedBy&&e.decidedBy!==`user`&&(0,w.jsxs)(`span`,{className:`ml-auto shrink-0 text-2xs`,children:[`by `,e.decidedBy]})]})}let h=p.isPending||p.isSuccess,g=()=>p.mutate({decision:`deny`,message:d?.trim()});return(0,w.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-primary/30 bg-card shadow-[0_0_0_4px] shadow-primary/[0.06] animate-rise`,"data-testid":`plan-approval`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-primary/15 bg-primary/[0.07] px-3.5 py-2`,children:[(0,w.jsx)(u,{className:`size-4 text-primary`}),(0,w.jsx)(`span`,{className:`text-2xs font-semibold tracking-wider text-primary uppercase`,children:`Plan ready`})]}),(0,w.jsxs)(`div`,{className:`space-y-2.5 px-3.5 py-3 wrap-break-word`,children:[(0,w.jsx)(`p`,{className:`text-[14px] font-medium`,children:`Start implementing this plan?`}),!n&&(0,w.jsx)(`p`,{className:`text-[13px] leading-relaxed text-muted-foreground`,children:`Approve to let the agent make the changes with this session's permissions, or keep it planning and say what to change.`}),n&&i&&(0,w.jsx)(`div`,{className:`max-h-48 overflow-y-auto rounded-lg border border-border bg-surface px-3 py-2 scroll-thin`,children:(0,w.jsx)(b,{children:i})}),d!==null&&(0,w.jsx)(x,{autoFocus:!0,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&!h&&(e.preventDefault(),g())},placeholder:`What should change in the plan? (optional)`,"aria-label":`Feedback on the plan`,className:`min-h-20 text-[13px]`}),(0,w.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 pt-0.5`,children:d===null?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(s,{size:`sm`,disabled:h,onClick:()=>p.mutate({decision:`allow_once`}),children:[(0,w.jsx)(v,{}),` Approve plan`]}),(0,w.jsxs)(s,{size:`sm`,variant:`outline`,disabled:h,onClick:()=>f(``),children:[(0,w.jsx)(y,{}),` Keep planning`]})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(s,{size:`sm`,disabled:h,onClick:g,children:[(0,w.jsx)(y,{}),` Keep planning`]}),(0,w.jsx)(s,{size:`sm`,variant:`ghost`,disabled:h,className:`text-muted-foreground`,onClick:()=>f(null),children:`Cancel`})]})})]})]})}var E={command:`Command`,file_change:`File change`,outside_worktree:`Outside the worktree`,network:`Network access`,git_destructive:`Destructive git`,secrets:`Secrets access`,tool:`Tool`,plan:`Plan`,other:`Action`},D={allow_once:`Approved once`,allow_session:`Always allowed this session`,deny:`Denied`};function O({item:e,sessionId:t,compact:n=!1,plan:r}){return e.action===`plan`?(0,w.jsx)(T,{item:e,sessionId:t,compact:n,plan:r}):(0,w.jsx)(k,{item:e,sessionId:t,compact:n})}function k({item:e,sessionId:t,compact:n}){let i=r(),a=e.status===`in_progress`,u=c({mutationFn:n=>i.respond(t,e.requestId,{kind:`approval`,decision:n}),onError:e=>o.error(`Couldn't send the decision`,{description:e.message})});if(!a){let t=e.decision===`deny`||e.status===`declined`;return(0,w.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-card/50 px-3 py-2 text-[13px] text-muted-foreground`,children:[(0,w.jsx)(t?f:d,{className:l(`size-4 shrink-0`,t?`text-status-failed`:`text-status-done`)}),(0,w.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title}),(0,w.jsxs)(`span`,{className:`ml-auto shrink-0 text-2xs`,children:[e.decision?D[e.decision]:`Cancelled`,e.decidedBy&&e.decidedBy!==`user`?` by ${e.decidedBy}`:``]})]})}let m=u.isPending||u.isSuccess,h=A(e);return(0,w.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-status-waiting/30 bg-card shadow-[0_0_0_4px] shadow-status-waiting/[0.06] animate-rise`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-status-waiting/15 bg-status-waiting/[0.07] px-3.5 py-2`,children:[(0,w.jsx)(p,{className:`size-4 text-status-waiting`}),(0,w.jsx)(`span`,{className:`text-2xs font-semibold tracking-wider text-status-waiting uppercase`,children:`Approval needed`}),(0,w.jsx)(`span`,{className:`ml-auto rounded-full border border-status-waiting/25 px-2 py-px text-3xs text-status-waiting/90`,children:E[e.action]})]}),(0,w.jsxs)(`div`,{className:`space-y-2.5 px-3.5 py-3 wrap-break-word`,children:[(0,w.jsx)(`p`,{className:`text-[14px] font-medium`,children:e.title}),e.reason&&!n&&(0,w.jsx)(`p`,{className:`text-[13px] leading-relaxed text-muted-foreground`,children:e.reason}),e.command&&(0,w.jsxs)(`pre`,{className:`overflow-x-auto rounded-lg border border-border bg-surface px-3 py-2 font-mono text-[12px] text-foreground/90 scroll-thin`,children:[(0,w.jsx)(`span`,{className:`text-primary/80 select-none`,children:`$ `}),e.command]}),e.paths&&e.paths.length>0&&(0,w.jsx)(`div`,{className:`font-mono text-2xs text-muted-foreground`,children:e.paths.join(` · `)}),e.url&&(0,w.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`block truncate font-mono text-[12px] text-primary underline-offset-2 hover:underline`,children:e.url}),!n&&h&&(0,w.jsx)(`pre`,{className:`max-h-40 overflow-auto rounded-lg border border-border bg-surface px-3 py-2 font-mono text-[12px] text-foreground/90 scroll-thin`,children:h}),(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-0.5`,children:[e.options.includes(`allow_once`)&&(0,w.jsxs)(s,{size:`sm`,disabled:m,onClick:()=>u.mutate(`allow_once`),children:[(0,w.jsx)(v,{}),` Approve`]}),e.options.includes(`allow_session`)&&(0,w.jsx)(s,{size:`sm`,variant:`outline`,disabled:m,onClick:()=>u.mutate(`allow_session`),children:`Always allow this session`}),e.options.includes(`deny`)&&(0,w.jsx)(s,{size:`sm`,variant:`ghost`,disabled:m,className:`text-muted-foreground hover:text-status-failed`,onClick:()=>u.mutate(`deny`),children:`Deny`}),!n&&e.cwd&&(0,w.jsx)(`span`,{className:`ml-auto truncate font-mono text-3xs text-muted-foreground/70`,children:e.cwd})]})]})]})}function A(e){let t=e.toolInput;if(e.action===`tool`&&t!=null&&(typeof t!=`object`||Object.keys(t).length!==0))return JSON.stringify(t,null,2)}function j({item:e,sessionId:i}){let a=r(),u=(0,C.useId)(),[d,f]=(0,C.useState)({}),[p,m]=(0,C.useState)({}),h=e.status===`in_progress`,_=c({mutationFn:t=>a.respond(i,e.requestId,t),onError:e=>o.error(`Couldn't send your answer`,{description:e.message})});if(!h)return(0,w.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-border bg-card/50 px-3 py-2.5 text-[13px]`,children:[e.questions.map(t=>(0,w.jsx)(M,{question:t,answers:e.answers?.[t.id]??[],status:e.status},t.id)),e.decidedBy===`pm`&&(0,w.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:`Answered by the project manager`}),e.status===`cancelled`&&(0,w.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:e.mcpServer?`Dismissed: nothing was sent to ${e.mcpServer}`:`Dismissed`}),e.status===`declined`&&(0,w.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:e.mcpServer?`Declined: ${e.mcpServer} got no data`:`Declined`})]});let y=(e,t,n)=>f(r=>{let i=r[e]??[],a=n?i.includes(t)?i.filter(e=>e!==t):[...i,t]:[t];return{...r,[e]:a}}),b=()=>Object.fromEntries(e.questions.map(e=>{let t=p[e.id]?.trim();return[e.id,[...d[e.id]??[],...t?[t]:[]]]})),x=e.questions.every(e=>(b()[e.id]?.length??0)>0),T=e=>{let r=p[e.id]?.trim();if(e.format&&r&&t(r,e.format)===void 0)return`Enter ${n(e.format)}, like ${e.format===`integer`?`3 or 1,000`:`2.5 or 1,000`}`},E=e.questions.some(e=>T(e)!==void 0);return(0,w.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-chart-2/30 bg-card animate-rise`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-chart-2/15 bg-chart-2/[0.07] px-3.5 py-2`,children:[(0,w.jsx)(g,{className:`size-4 text-chart-2`}),(0,w.jsx)(`span`,{className:`text-2xs font-semibold tracking-wider text-chart-2 uppercase`,children:e.questions.length>1?`${e.questions.length} questions`:`Question`})]}),(0,w.jsx)(`div`,{className:`divide-y divide-border`,children:e.questions.map((e,t)=>(0,w.jsxs)(`section`,{className:`min-w-0 space-y-2 px-3.5 py-3`,"aria-label":e.question,children:[(0,w.jsxs)(`p`,{className:`mb-2 text-[14px] font-medium wrap-break-word`,children:[e.header&&(0,w.jsx)(`span`,{className:`mr-2 inline-block max-w-full rounded bg-muted px-1.5 py-px text-3xs font-medium text-muted-foreground uppercase`,children:e.header}),e.question]}),(0,w.jsx)(`div`,{className:`grid grid-cols-1 gap-1`,children:e.options.map((n,r)=>{let i=d[e.id]?.includes(n.label)??!1;return(0,w.jsxs)(`button`,{type:`button`,onClick:()=>y(e.id,n.label,e.multiSelect),"aria-pressed":i,className:l(`flex min-w-0 items-start gap-2.5 rounded-lg border px-2.5 py-2 text-left transition-colors`,i?`border-chart-2/50 bg-chart-2/[0.08]`:`border-border hover:bg-accent/50`),children:[(0,w.jsx)(`span`,{className:l(`mt-0.5 flex size-4 shrink-0 items-center justify-center border transition-colors`,e.multiSelect?`rounded-[4px]`:`rounded-full`,i?`border-chart-2 bg-chart-2 text-background`:`border-input`),children:i&&(0,w.jsx)(v,{className:`size-3`,strokeWidth:3})}),(0,w.jsxs)(`span`,{className:`min-w-0 flex-1 wrap-break-word`,children:[(0,w.jsx)(`span`,{className:`block text-[13px]`,children:n.label}),n.description&&(0,w.jsx)(`span`,{className:`block text-2xs text-muted-foreground`,children:n.description})]}),(0,w.jsx)(`span`,{className:`shrink-0 text-3xs text-muted-foreground/60 tabular-nums`,children:t===0?r+1:``})]},n.label)})}),e.allowFreeText&&(0,w.jsx)(S,{placeholder:e.format?`Type ${n(e.format)}…`:`Or type your own answer…`,value:p[e.id]??``,onChange:t=>m(n=>({...n,[e.id]:t.target.value})),"aria-invalid":T(e)!==void 0,"aria-describedby":T(e)?`${u}-${t}`:void 0,className:`h-8 text-[13px]`}),T(e)&&(0,w.jsx)(`p`,{id:`${u}-${t}`,className:`text-2xs text-destructive`,children:T(e)})]},e.id))}),(0,w.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t border-border bg-muted/30 px-3.5 py-2`,children:[(0,w.jsx)(`span`,{className:`mr-auto text-2xs text-muted-foreground`,children:e.mcpServer?`Your answers go to ${e.mcpServer}. The agent waits until you answer or dismiss.`:`The agent is paused until you answer.`}),e.mcpServer&&(0,w.jsx)(s,{size:`sm`,variant:`ghost`,disabled:_.isPending||_.isSuccess,className:`text-muted-foreground`,onClick:()=>_.mutate({kind:`cancel`}),children:`Dismiss`}),(0,w.jsx)(s,{size:`sm`,disabled:!x||E||_.isPending||_.isSuccess,onClick:()=>_.mutate({kind:`answer`,answers:b()}),children:`Send answer`})]})]})}function M({question:e,answers:t,status:n}){let r=(0,C.useRef)(null),i=(0,C.useRef)(null),[a,o]=(0,C.useState)(!1),[s,c]=(0,C.useState)(!1);(0,C.useLayoutEffect)(()=>{if(a)return;let e=[r.current,i.current].filter(e=>e!==null),t=()=>c(e.some(e=>e.scrollHeight>e.clientHeight+1));t();let n=new ResizeObserver(t);for(let t of e)n.observe(t);return()=>n.disconnect()},[a]);let u=t=>e.options.some(e=>e.label===t),d=t.filter(u),f=t.filter(e=>!u(e)),p=n===`completed`?v:n===`declined`?_:h;return(0,w.jsxs)(`div`,{className:`flex gap-2`,children:[(0,w.jsx)(p,{className:l(`mt-0.5 size-3.5 shrink-0`,p===v?`text-status-done`:`text-muted-foreground`)}),(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,w.jsx)(`p`,{ref:r,className:l(`min-w-0 wrap-break-word text-muted-foreground`,!a&&`line-clamp-3`),children:e.question}),(0,w.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,w.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground`,children:`→`}),(0,w.jsxs)(`p`,{ref:i,className:l(`min-w-0 font-medium whitespace-pre-wrap wrap-break-word`,!a&&`line-clamp-4`),children:[t.length===0&&`—`,d.map((e,t)=>(0,w.jsxs)(`span`,{children:[t>0&&(0,w.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`, `}),e]},e)),f.map((e,t)=>(0,w.jsxs)(`span`,{children:[(d.length>0||t>0)&&`
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Ct as t,St as n,i as r}from"./api-yvn34iKU.js";import{n as i,t as a}from"./jsx-runtime-C3cWAN_r.js";import{j as o,m as s,yt as c}from"./format-D3kairnQ.js";import{t as l}from"./dist-wxbqfqV1.js";import{$n as u,F as d,M as f,P as p,Zn as m,bt as h,kt as g,n as _,pr as v,st as y}from"./icons-COCLuOtb.js";import{t as b}from"./markdown-DGHfubu-.js";import{t as x}from"./textarea-gD4G5Znx.js";import{t as S}from"./input-CPpbtC2H.js";var C=e(i(),1),w=a();function T({item:e,sessionId:t,compact:n=!1,plan:i}){let a=r(),[d,f]=(0,C.useState)(null),p=c({mutationFn:({decision:n,message:r})=>a.respond(t,e.requestId,{kind:`approval`,decision:n,...r?{message:r}:{}}),onError:e=>o.error(`Couldn't send the decision`,{description:e.message})});if(e.status!==`in_progress`){let t=e.decision!==void 0&&e.decision!==`deny`;return(0,w.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-card/50 px-3 py-2 text-[13px] text-muted-foreground`,children:[(0,w.jsx)(t?u:m,{className:l(`size-4 shrink-0`,t?`text-status-done`:`text-muted-foreground`)}),(0,w.jsx)(`span`,{className:`min-w-0 truncate`,children:t?`Plan approved`:e.decision?`Kept planning`:`Plan review cancelled`}),e.decidedBy&&e.decidedBy!==`user`&&(0,w.jsxs)(`span`,{className:`ml-auto shrink-0 text-2xs`,children:[`by `,e.decidedBy]})]})}let h=p.isPending||p.isSuccess,g=()=>p.mutate({decision:`deny`,message:d?.trim()});return(0,w.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-primary/30 bg-card shadow-[0_0_0_4px] shadow-primary/[0.06] animate-rise`,"data-testid":`plan-approval`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-primary/15 bg-primary/[0.07] px-3.5 py-2`,children:[(0,w.jsx)(u,{className:`size-4 text-primary`}),(0,w.jsx)(`span`,{className:`text-2xs font-semibold tracking-wider text-primary uppercase`,children:`Plan ready`})]}),(0,w.jsxs)(`div`,{className:`space-y-2.5 px-3.5 py-3 wrap-break-word`,children:[(0,w.jsx)(`p`,{className:`text-[14px] font-medium`,children:`Start implementing this plan?`}),!n&&(0,w.jsx)(`p`,{className:`text-[13px] leading-relaxed text-muted-foreground`,children:`Approve to let the agent make the changes with this session's permissions, or keep it planning and say what to change.`}),n&&i&&(0,w.jsx)(`div`,{className:`max-h-48 overflow-y-auto rounded-lg border border-border bg-surface px-3 py-2 scroll-thin`,children:(0,w.jsx)(b,{children:i})}),d!==null&&(0,w.jsx)(x,{autoFocus:!0,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&!h&&(e.preventDefault(),g())},placeholder:`What should change in the plan? (optional)`,"aria-label":`Feedback on the plan`,className:`min-h-20 text-[13px]`}),(0,w.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 pt-0.5`,children:d===null?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(s,{size:`sm`,disabled:h,onClick:()=>p.mutate({decision:`allow_once`}),children:[(0,w.jsx)(v,{}),` Approve plan`]}),(0,w.jsxs)(s,{size:`sm`,variant:`outline`,disabled:h,onClick:()=>f(``),children:[(0,w.jsx)(y,{}),` Keep planning`]})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(s,{size:`sm`,disabled:h,onClick:g,children:[(0,w.jsx)(y,{}),` Keep planning`]}),(0,w.jsx)(s,{size:`sm`,variant:`ghost`,disabled:h,className:`text-muted-foreground`,onClick:()=>f(null),children:`Cancel`})]})})]})]})}var E={command:`Command`,file_change:`File change`,outside_worktree:`Outside the worktree`,network:`Network access`,git_destructive:`Destructive git`,secrets:`Secrets access`,tool:`Tool`,plan:`Plan`,other:`Action`},D={allow_once:`Approved once`,allow_session:`Always allowed this session`,deny:`Denied`};function O({item:e,sessionId:t,compact:n=!1,plan:r}){return e.action===`plan`?(0,w.jsx)(T,{item:e,sessionId:t,compact:n,plan:r}):(0,w.jsx)(k,{item:e,sessionId:t,compact:n})}function k({item:e,sessionId:t,compact:n}){let i=r(),a=e.status===`in_progress`,u=c({mutationFn:n=>i.respond(t,e.requestId,{kind:`approval`,decision:n}),onError:e=>o.error(`Couldn't send the decision`,{description:e.message})});if(!a){let t=e.decision===`deny`||e.status===`declined`;return(0,w.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-card/50 px-3 py-2 text-[13px] text-muted-foreground`,children:[(0,w.jsx)(t?f:d,{className:l(`size-4 shrink-0`,t?`text-status-failed`:`text-status-done`)}),(0,w.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title}),(0,w.jsxs)(`span`,{className:`ml-auto shrink-0 text-2xs`,children:[e.decision?D[e.decision]:`Cancelled`,e.decidedBy&&e.decidedBy!==`user`?` by ${e.decidedBy}`:``]})]})}let m=u.isPending||u.isSuccess,h=A(e);return(0,w.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-status-waiting/30 bg-card shadow-[0_0_0_4px] shadow-status-waiting/[0.06] animate-rise`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-status-waiting/15 bg-status-waiting/[0.07] px-3.5 py-2`,children:[(0,w.jsx)(p,{className:`size-4 text-status-waiting`}),(0,w.jsx)(`span`,{className:`text-2xs font-semibold tracking-wider text-status-waiting uppercase`,children:`Approval needed`}),(0,w.jsx)(`span`,{className:`ml-auto rounded-full border border-status-waiting/25 px-2 py-px text-3xs text-status-waiting/90`,children:E[e.action]})]}),(0,w.jsxs)(`div`,{className:`space-y-2.5 px-3.5 py-3 wrap-break-word`,children:[(0,w.jsx)(`p`,{className:`text-[14px] font-medium`,children:e.title}),e.reason&&!n&&(0,w.jsx)(`p`,{className:`text-[13px] leading-relaxed text-muted-foreground`,children:e.reason}),e.command&&(0,w.jsxs)(`pre`,{className:`overflow-x-auto rounded-lg border border-border bg-surface px-3 py-2 font-mono text-[12px] text-foreground/90 scroll-thin`,children:[(0,w.jsx)(`span`,{className:`text-primary/80 select-none`,children:`$ `}),e.command]}),e.paths&&e.paths.length>0&&(0,w.jsx)(`div`,{className:`font-mono text-2xs text-muted-foreground`,children:e.paths.join(` · `)}),e.url&&(0,w.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`block truncate font-mono text-[12px] text-primary underline-offset-2 hover:underline`,children:e.url}),!n&&h&&(0,w.jsx)(`pre`,{className:`max-h-40 overflow-auto rounded-lg border border-border bg-surface px-3 py-2 font-mono text-[12px] text-foreground/90 scroll-thin`,children:h}),(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-0.5`,children:[e.options.includes(`allow_once`)&&(0,w.jsxs)(s,{size:`sm`,disabled:m,onClick:()=>u.mutate(`allow_once`),children:[(0,w.jsx)(v,{}),` Approve`]}),e.options.includes(`allow_session`)&&(0,w.jsx)(s,{size:`sm`,variant:`outline`,disabled:m,onClick:()=>u.mutate(`allow_session`),children:`Always allow this session`}),e.options.includes(`deny`)&&(0,w.jsx)(s,{size:`sm`,variant:`ghost`,disabled:m,className:`text-muted-foreground hover:text-status-failed`,onClick:()=>u.mutate(`deny`),children:`Deny`}),!n&&e.cwd&&(0,w.jsx)(`span`,{className:`ml-auto truncate font-mono text-3xs text-muted-foreground/70`,children:e.cwd})]})]})]})}function A(e){let t=e.toolInput;if(e.action===`tool`&&t!=null&&(typeof t!=`object`||Object.keys(t).length!==0))return JSON.stringify(t,null,2)}function j({item:e,sessionId:i}){let a=r(),u=(0,C.useId)(),[d,f]=(0,C.useState)({}),[p,m]=(0,C.useState)({}),h=e.status===`in_progress`,_=c({mutationFn:t=>a.respond(i,e.requestId,t),onError:e=>o.error(`Couldn't send your answer`,{description:e.message})});if(!h)return(0,w.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-border bg-card/50 px-3 py-2.5 text-[13px]`,children:[e.questions.map(t=>(0,w.jsx)(M,{question:t,answers:e.answers?.[t.id]??[],status:e.status},t.id)),e.decidedBy===`pm`&&(0,w.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:`Answered by the project manager`}),e.status===`cancelled`&&(0,w.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:e.mcpServer?`Dismissed: nothing was sent to ${e.mcpServer}`:`Dismissed`}),e.status===`declined`&&(0,w.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:e.mcpServer?`Declined: ${e.mcpServer} got no data`:`Declined`})]});let y=(e,t,n)=>f(r=>{let i=r[e]??[],a=n?i.includes(t)?i.filter(e=>e!==t):[...i,t]:[t];return{...r,[e]:a}}),b=()=>Object.fromEntries(e.questions.map(e=>{let t=p[e.id]?.trim();return[e.id,[...d[e.id]??[],...t?[t]:[]]]})),x=e.questions.every(e=>(b()[e.id]?.length??0)>0),T=e=>{let r=p[e.id]?.trim();if(e.format&&r&&t(r,e.format)===void 0)return`Enter ${n(e.format)}, like ${e.format===`integer`?`3 or 1,000`:`2.5 or 1,000`}`},E=e.questions.some(e=>T(e)!==void 0);return(0,w.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-chart-2/30 bg-card animate-rise`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-chart-2/15 bg-chart-2/[0.07] px-3.5 py-2`,children:[(0,w.jsx)(g,{className:`size-4 text-chart-2`}),(0,w.jsx)(`span`,{className:`text-2xs font-semibold tracking-wider text-chart-2 uppercase`,children:e.questions.length>1?`${e.questions.length} questions`:`Question`})]}),(0,w.jsx)(`div`,{className:`divide-y divide-border`,children:e.questions.map((e,t)=>(0,w.jsxs)(`section`,{className:`min-w-0 space-y-2 px-3.5 py-3`,"aria-label":e.question,children:[(0,w.jsxs)(`p`,{className:`mb-2 text-[14px] font-medium wrap-break-word`,children:[e.header&&(0,w.jsx)(`span`,{className:`mr-2 inline-block max-w-full rounded bg-muted px-1.5 py-px text-3xs font-medium text-muted-foreground uppercase`,children:e.header}),e.question]}),(0,w.jsx)(`div`,{className:`grid grid-cols-1 gap-1`,children:e.options.map((n,r)=>{let i=d[e.id]?.includes(n.label)??!1;return(0,w.jsxs)(`button`,{type:`button`,onClick:()=>y(e.id,n.label,e.multiSelect),"aria-pressed":i,className:l(`flex min-w-0 items-start gap-2.5 rounded-lg border px-2.5 py-2 text-left transition-colors`,i?`border-chart-2/50 bg-chart-2/[0.08]`:`border-border hover:bg-accent/50`),children:[(0,w.jsx)(`span`,{className:l(`mt-0.5 flex size-4 shrink-0 items-center justify-center border transition-colors`,e.multiSelect?`rounded-[4px]`:`rounded-full`,i?`border-chart-2 bg-chart-2 text-background`:`border-input`),children:i&&(0,w.jsx)(v,{className:`size-3`,strokeWidth:3})}),(0,w.jsxs)(`span`,{className:`min-w-0 flex-1 wrap-break-word`,children:[(0,w.jsx)(`span`,{className:`block text-[13px]`,children:n.label}),n.description&&(0,w.jsx)(`span`,{className:`block text-2xs text-muted-foreground`,children:n.description})]}),(0,w.jsx)(`span`,{className:`shrink-0 text-3xs text-muted-foreground/60 tabular-nums`,children:t===0?r+1:``})]},n.label)})}),e.allowFreeText&&(0,w.jsx)(S,{placeholder:e.format?`Type ${n(e.format)}…`:`Or type your own answer…`,value:p[e.id]??``,onChange:t=>m(n=>({...n,[e.id]:t.target.value})),"aria-invalid":T(e)!==void 0,"aria-describedby":T(e)?`${u}-${t}`:void 0,className:`h-8 text-[13px]`}),T(e)&&(0,w.jsx)(`p`,{id:`${u}-${t}`,className:`text-2xs text-destructive`,children:T(e)})]},e.id))}),(0,w.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t border-border bg-muted/30 px-3.5 py-2`,children:[(0,w.jsx)(`span`,{className:`mr-auto text-2xs text-muted-foreground`,children:e.mcpServer?`Your answers go to ${e.mcpServer}. The agent waits until you answer or dismiss.`:`The agent is paused until you answer.`}),e.mcpServer&&(0,w.jsx)(s,{size:`sm`,variant:`ghost`,disabled:_.isPending||_.isSuccess,className:`text-muted-foreground`,onClick:()=>_.mutate({kind:`cancel`}),children:`Dismiss`}),(0,w.jsx)(s,{size:`sm`,disabled:!x||E||_.isPending||_.isSuccess,onClick:()=>_.mutate({kind:`answer`,answers:b()}),children:`Send answer`})]})]})}function M({question:e,answers:t,status:n}){let r=(0,C.useRef)(null),i=(0,C.useRef)(null),[a,o]=(0,C.useState)(!1),[s,c]=(0,C.useState)(!1);(0,C.useLayoutEffect)(()=>{if(a)return;let e=[r.current,i.current].filter(e=>e!==null),t=()=>c(e.some(e=>e.scrollHeight>e.clientHeight+1));t();let n=new ResizeObserver(t);for(let t of e)n.observe(t);return()=>n.disconnect()},[a]);let u=t=>e.options.some(e=>e.label===t),d=t.filter(u),f=t.filter(e=>!u(e)),p=n===`completed`?v:n===`declined`?_:h;return(0,w.jsxs)(`div`,{className:`flex gap-2`,children:[(0,w.jsx)(p,{className:l(`mt-0.5 size-3.5 shrink-0`,p===v?`text-status-done`:`text-muted-foreground`)}),(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,w.jsx)(`p`,{ref:r,className:l(`min-w-0 wrap-break-word text-muted-foreground`,!a&&`line-clamp-3`),children:e.question}),(0,w.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,w.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground`,children:`→`}),(0,w.jsxs)(`p`,{ref:i,className:l(`min-w-0 font-medium whitespace-pre-wrap wrap-break-word`,!a&&`line-clamp-4`),children:[t.length===0&&`—`,d.map((e,t)=>(0,w.jsxs)(`span`,{children:[t>0&&(0,w.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`, `}),e]},e)),f.map((e,t)=>(0,w.jsxs)(`span`,{children:[(d.length>0||t>0)&&`
|
|
2
2
|
`,e]},t))]})]})]}),(s||a)&&(0,w.jsx)(`button`,{type:`button`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`mt-0.5 text-2xs text-muted-foreground transition-colors hover:text-foreground`,children:a?`Show less`:`Show more`})]})]})}export{O as n,j as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{P as t,i as n,jt as r}from"./api-yvn34iKU.js";import{n as i,t as a}from"./jsx-runtime-C3cWAN_r.js";import{j as o,m as s,yt as c}from"./format-D3kairnQ.js";import{A as l,M as u,N as d,P as f,j as p}from"./mobile-nav-CrjrDJZ5.js";import{t as m}from"./dist-wxbqfqV1.js";import{Rt as h,Vn as g,X as _,m as v,rr as y,wr as b}from"./icons-COCLuOtb.js";import{t as x}from"./markdown-DGHfubu-.js";var S=e(i(),1),C=`# How the factory loop works
|
|
2
2
|
|
|
3
3
|
What the software factory and the dark factory do between the events you see: when work starts, how pull requests merge, what "Loop building" means, and what still comes to you. Every number here is the default; most can be changed in the factory **Settings**. For the full reference (every setting, merge check and API route) see [The software factory and the dark factory](software-factory.md).
|
|
4
4
|
|
|
@@ -339,4 +339,4 @@ The limits that shape the loop:
|
|
|
339
339
|
`).split(`
|
|
340
340
|
`)){T.test(a)&&(i=!i);let e=i?void 0:/^# (.+)$/.exec(a)?.[1],o=i?void 0:/^## (.+)$/.exec(a)?.[1];e&&!t&&r.length===0?t=e.trim():o?r.push({title:o.trim(),lines:[]}):(r.at(-1)?.lines??n).push(a)}return{title:t,intro:n.join(`
|
|
341
341
|
`).trim(),sections:r.map(e=>({id:w(e.title),title:e.title,body:e.lines.join(`
|
|
342
|
-
`).trim()}))}}var D=
|
|
342
|
+
`).trim()}))}}var D=t(),O=/\]\((?!#|[a-z][a-z0-9+.-]*:)(?:\.\/)?([^)\s]+)\)/gi;function k(e){return e.replace(O,(e,t)=>`](${D}${t})`)}var A=E(k(C)),j={intake:`intake-and-classification`,type:`agent-slots-and-priority`,building:`reproduce-or-analyze-then-implement`,reviewing:`review`,merge:`the-merge-queue`,merged:`watching-main-after-a-merge`,needsYou:`what-needs-you`};function M(e){return e.startsWith(`#`)?{kind:`anchor`,id:e.slice(1)}:{kind:`external`,url:e}}var N=r()(e=>({open:!1,section:null,show:t=>e({open:!0,section:t??null}),hide:()=>e({open:!1})})),P=a(),F=e=>`factory-guide-${e}`,I=`factory-guide-contents`;function L(e,t=`smooth`){let n=document.getElementById(e===I?e:F(e));if(!n)return;let r=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;n.scrollIntoView?.({block:`start`,behavior:r?`auto`:t})}var R=e=>e?e.type===`text`?e.value??``:(e.children??[]).map(R).join(``):``;function z({href:e=``,children:t,node:n,...r}){let i=M(e);return i.kind===`anchor`?(0,P.jsx)(`a`,{...r,href:`#${i.id}`,"data-streamdown":`link`,onClick:e=>{e.preventDefault(),L(i.id)},children:t}):(0,P.jsx)(`a`,{...r,href:i.url,target:`_blank`,rel:`noreferrer`,"data-streamdown":`link`,children:t})}function B({children:e,node:t,...n}){let r=w(R(t));return(0,P.jsx)(`h3`,{...n,id:F(r),className:`scroll-mt-3`,children:e})}var V={components:{a:z,h3:B},controls:!1,lineNumbers:!1,tableMaxHeight:0,codeBlockMaxHeight:0};function H({sections:e,className:t}){return(0,P.jsx)(`ol`,{className:m(`space-y-0.5 text-[13px]`,t),children:e.map((e,t)=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`a`,{href:`#${e.id}`,onClick:t=>{t.preventDefault(),L(e.id)},className:`flex gap-2 rounded-md px-2 py-1 text-muted-foreground hover:bg-muted hover:text-foreground`,children:[(0,P.jsx)(`span`,{className:`w-4 shrink-0 text-right tabular-nums text-muted-foreground/60`,children:t+1}),(0,P.jsx)(`span`,{className:`min-w-0`,children:e.title})]})},e.id))})}function U(){let e=N(e=>e.open),t=N(e=>e.section),n=N(e=>e.hide),r=A;return(0,S.useEffect)(()=>{if(!e||!t)return;let n=requestAnimationFrame(()=>L(t,`auto`));return()=>cancelAnimationFrame(n)},[e,t]),(0,P.jsx)(l,{open:e,onOpenChange:e=>!e&&n(),children:(0,P.jsxs)(p,{side:`right`,className:`gap-0 p-0 data-[side=right]:w-full data-[side=right]:sm:max-w-3xl`,"data-testid":`factory-guide`,children:[(0,P.jsxs)(d,{className:`shrink-0 border-b border-border pr-12`,children:[(0,P.jsxs)(f,{className:`flex items-center gap-2 text-[15px]`,children:[(0,P.jsx)(b,{className:`size-4 shrink-0 text-primary`,"aria-hidden":!0}),r.title]}),(0,P.jsxs)(u,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-2xs`,children:[(0,P.jsx)(`span`,{children:`The software factory and the dark factory, step by step.`}),(0,P.jsxs)(`a`,{href:`${D}factory-loop.md`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-primary hover:underline`,children:[(0,P.jsx)(g,{className:`size-3`,"aria-hidden":!0}),` In the docs`]}),(0,P.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 text-primary hover:underline md:hidden`,onClick:()=>L(I),children:[(0,P.jsx)(h,{className:`size-3`,"aria-hidden":!0}),` Contents`]})]})]}),(0,P.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,P.jsx)(`nav`,{"aria-label":`Contents`,className:`hidden w-56 shrink-0 overflow-y-auto border-r border-border p-2 scroll-thin md:block`,children:(0,P.jsx)(H,{sections:r.sections})}),(0,P.jsxs)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto px-4 pt-3 pb-12 scroll-thin sm:px-6`,"data-testid":`factory-guide-body`,children:[r.intro&&(0,P.jsx)(x,{options:V,className:`factory-guide`,children:r.intro}),(0,P.jsxs)(`nav`,{id:I,"aria-label":`Contents`,className:`mt-4 scroll-mt-3 rounded-lg border border-border bg-surface p-2 md:hidden`,children:[(0,P.jsx)(`div`,{className:`px-2 pb-1 text-3xs tracking-wider text-muted-foreground uppercase`,children:`Contents`}),(0,P.jsx)(H,{sections:r.sections})]}),r.sections.map(e=>(0,P.jsxs)(`section`,{id:F(e.id),"aria-labelledby":`${F(e.id)}-title`,className:`scroll-mt-3 pt-6`,"data-testid":`factory-guide-section`,children:[(0,P.jsx)(`h2`,{id:`${F(e.id)}-title`,className:`border-b border-border pb-1.5 text-[17px] font-semibold tracking-tight`,children:e.title}),(0,P.jsx)(x,{options:V,className:`factory-guide mt-3`,children:e.body})]},e.id))]})]})]})})}function W({section:e,className:t}){let n=N(e=>e.show);return(0,P.jsxs)(s,{size:`sm`,variant:`ghost`,onClick:()=>n(e),title:`How the factory loop works`,"aria-label":`How it works`,className:t,"data-testid":`factory-guide-open`,children:[(0,P.jsx)(y,{}),(0,P.jsx)(`span`,{className:`hidden sm:inline`,children:`How it works`})]})}function G({section:e,children:t,className:n}){let r=N(e=>e.show);return(0,P.jsx)(`button`,{type:`button`,onClick:()=>r(e),className:m(`text-primary/90 underline decoration-primary/30 underline-offset-2 hover:text-primary hover:decoration-primary`,n),"data-testid":`factory-guide-link`,children:t})}var K=e=>e.outcome===`github_connected`||e.outcome===`github_changed`;function q({projectId:e,layout:t=`stacked`,className:r}){let i=n(),a=c({mutationFn:()=>i.refreshProject(e),onSuccess:e=>{K(e)&&e.changed&&o.success(e.message)}}),l=a.data,u=a.isError?`Couldn't check: ${a.error.message}`:l?.message;return(0,P.jsxs)(`span`,{className:m(`flex gap-1.5`,t===`stacked`?`flex-col items-center`:`flex-wrap items-center`,r),children:[(0,P.jsxs)(s,{size:`xs`,variant:`outline`,onClick:()=>a.mutate(),disabled:a.isPending,"data-testid":`check-remote`,children:[(0,P.jsx)(_,{className:m(a.isPending&&`animate-spin`)}),a.isPending?`Checking…`:`Check again`]}),(0,P.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:m(`text-2xs`,a.isError?`text-status-failed`:l&&K(l)?`text-status-done`:`text-muted-foreground`),children:u})]})}function J({project:e}){let t=n(),r=c({mutationFn:()=>t.disconnectGithub(e.id),onSuccess:()=>o.success(`${e.name} is now a local-only project`),onError:e=>o.error(`Couldn't disconnect GitHub`,{description:e.message})});if(e.kind!==`github`||!e.remoteWarning)return null;let{owner:i,repo:a}=e.github,{remoteUrl:l}=e.remoteWarning;return(0,P.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-3 rounded-xl border border-status-waiting/30 bg-status-waiting/10 px-4 py-3`,"data-testid":`remote-warning`,children:[(0,P.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-status-waiting`}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,P.jsx)(`p`,{className:`text-[13px] font-medium`,children:`The GitHub remote is missing`}),(0,P.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[l?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`code`,{className:`font-mono`,children:`origin`}),` now points to`,` `,(0,P.jsx)(`code`,{className:`font-mono`,children:l})]}):(0,P.jsxs)(P.Fragment,{children:[`This folder has no GitHub `,(0,P.jsx)(`code`,{className:`font-mono`,children:`origin`}),` any more`]}),`, so CodeDen still uses `,i,`/`,a,` for issues and pull requests. Restore the remote and check again, or make the project local-only (synced issues and PRs are kept).`]}),(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:[(0,P.jsx)(q,{projectId:e.id,layout:`inline`}),(0,P.jsx)(s,{size:`xs`,variant:`ghost`,onClick:()=>r.mutate(),disabled:r.isPending,children:`Make local-only`})]})]})]})}export{U as a,G as i,J as n,j as o,W as r,q as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./rolldown-runtime-XKyaHtl9.js";import{Er as r,Nr as i,Or as a,Wn as o,Yt as s,_r as c,cn as l,gr as u,h as d,hn as f,i as p,m,mt as h,n as g,ot as _,tt as v,un as y,x as b}from"./icons-COCLuOtb.js";import{n as x,t as S}from"./jsx-runtime-C3cWAN_r.js";import{a as C,t as w}from"./bits-B2GRjm37.js";import{D as T,E,f as D,j as O,m as k,n as A}from"./format-D1ma_o2D.js";import{t as ee}from"./skeleton-D8Sbd2jT.js";import{a as j,c as M,i as te,l as ne,n as re,s as ie}from"./api-jkvqht5P.js";import{r as ae}from"./theme-DsW-i9mD.js";import{a as oe,c as se,f as ce,i as le,l as ue,m as de,n as fe,o as pe,p as me,r as he,s as ge,t as _e}from"./format-CPIs7kVL.js";import{t as ve}from"./number-field-Bzzs0k9i.js";import{a as ye,i as be,n as xe,r as Se,t as Ce}from"./select-B4LGxZQI.js";import{t as we}from"./dist-wxbqfqV1.js";import{a as Te,c as Ee,l as De,n as Oe,r as ke,t as Ae}from"./dialog-Dyw3b_Tu.js";import{t as je}from"./input-CPpbtC2H.js";import{a as Me,i as Ne,n as Pe,o as Fe,r as Ie,t as Le}from"./table-ByDILCrJ.js";import{t as Re}from"./label-DcWfyglU.js";import{n as ze,r as Be,t as Ve}from"./popover-OrzLEhHL.js";import{L as He}from"./dropdown-menu-C4XI7F63.js";import{t as Ue}from"./page-header-BqPf-jRo.js";import{n as We,t as N}from"./clsx-BxLRjTE8.js";import{U as Ge}from"./mobile-nav-D8FZcJzG.js";var P=t(x(),1),Ke=[{light:`#2a78d6`,dark:`#3987e5`},{light:`#eb6834`,dark:`#d95926`},{light:`#1baf7a`,dark:`#199e70`},{light:`#eda100`,dark:`#c98500`},{light:`#e87ba4`,dark:`#d55181`},{light:`#008300`,dark:`#008300`},{light:`#6250d6`,dark:`#9085e9`},{light:`#e34948`,dark:`#e66767`}],qe={light:`#a3a29c`,dark:`#6b6a65`},Je={codex:0,claude:1,opencode:2,cursor:3,gemini:4};function Ye(e){let t=new Map,n=new Set;for(let r of e){let e=Je[r];e!==void 0&&!n.has(e)&&(t.set(r,e),n.add(e))}let r=0;for(let i of e)if(!(t.has(i)||i===`__other`)){for(;n.has(r)&&r<Ke.length;)r++;if(r>=Ke.length)break;t.set(i,r),n.add(r)}return t}function Xe(e){return`s${e}`}function Ze(e){let t=Ye(e.map(e=>e.key)),n={};return e.forEach((e,r)=>{let i=t.get(e.key),a=e.key===`__other`||i===void 0?qe:Ke[i]??qe;n[Xe(r)]={label:e.label,theme:a}}),n}var F=S();function Qe({report:e}){let t=ae(),{manualCostUsd:n,automationCostUsd:r,factoryCostUsd:i,byAutomation:a}=e.automations,o=n+r+i,s=[{label:`Interactive`,value:n,color:Ke[0]?.[t]},{label:`Automations`,value:r,color:Ke[2]?.[t]},{label:`Factory`,value:i,color:Ke[6]?.[t]}];return(0,F.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-4 py-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(p,{className:`size-4 text-muted-foreground`}),(0,F.jsx)(`h3`,{className:`text-sm font-medium`,children:`Automation and factory spend`})]}),(0,F.jsx)(`div`,{className:`mt-3 flex h-2.5 gap-0.5 overflow-hidden rounded-full bg-muted`,children:o>0&&s.map(e=>e.value>0?(0,F.jsx)(`div`,{className:`h-full first:rounded-l-full last:rounded-r-full`,style:{width:`${e.value/o*100}%`,background:e.color},title:`${e.label}: ${pe(e.value)}`},e.label):null)}),(0,F.jsx)(`div`,{className:`mt-2 grid grid-cols-3 gap-2`,children:s.map(e=>(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 text-2xs text-muted-foreground`,children:[(0,F.jsx)(`span`,{className:`size-2 rounded-[3px]`,style:{background:e.color}}),e.label]}),(0,F.jsxs)(`div`,{className:`text-sm font-medium tabular-nums`,children:[pe(e.value),` `,(0,F.jsx)(`span`,{className:`text-2xs font-normal text-muted-foreground`,children:ge(o>0?e.value/o:null)})]})]},e.label))}),a.length>0?(0,F.jsx)(`ul`,{className:`mt-3 space-y-1.5 border-t border-border pt-3 text-xs`,children:a.slice(0,6).map(e=>(0,F.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`truncate`,children:e.name}),(0,F.jsxs)(`span`,{className:`text-2xs text-muted-foreground`,children:[e.sessions,` `,e.sessions===1?`run`:`runs`]}),(0,F.jsx)(`span`,{className:`ml-auto font-mono tabular-nums`,children:pe(e.costUsd)})]},e.automationId))}):(0,F.jsx)(`p`,{className:`mt-3 border-t border-border pt-3 text-2xs text-muted-foreground`,children:`No automation runs in this range.`})]})}var $e={ok:`bg-status-done`,warning:`bg-status-waiting`,exceeded:`bg-status-failed`},et={ok:`On track`,warning:`Near the limit`,exceeded:`Over the limit`};function tt({status:e,scope:t,onDelete:n}){let{budget:r,spentUsd:i,percent:a,state:o}=e;return(0,F.jsxs)(`div`,{className:`space-y-1.5 py-3`,"data-testid":`budget-row`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,F.jsx)(`span`,{className:`font-medium`,children:t}),(0,F.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,r.period===`daily`?`per day`:`per month`,` · alert at `,r.warnAtPercent,`%`]}),(0,F.jsx)(`span`,{className:we(`ml-auto text-2xs`,o===`ok`?`text-muted-foreground`:`font-medium text-foreground`),children:et[o]}),(0,F.jsx)(k,{variant:`ghost`,size:`icon-xs`,"aria-label":`Delete ${t} budget`,onClick:n,children:(0,F.jsx)(d,{})})]}),(0,F.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-muted`,children:(0,F.jsx)(`div`,{className:we(`h-full rounded-full`,$e[o]),style:{width:`${Math.min(100,a)}%`}})}),(0,F.jsxs)(`div`,{className:`text-2xs text-muted-foreground tabular-nums`,children:[pe(i),` of `,pe(r.limitUsd),` (`,Math.round(a),`%)`]})]})}function nt(){let e=re(),t=ne(),n=j(),i=E().data?.projects,[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(`all`),[l,u]=(0,P.useState)(`daily`),[d,f]=(0,P.useState)(25),[p,m]=(0,P.useState)(80),h=t.data?.settings,g=e=>e?i?i.find(t=>t.id===e)?.name??`Deleted project`:`…`:`All projects`,_=(e,t)=>n.mutate(e,{onSuccess:()=>O.success(t),onError:e=>O.error(e.message)}),y=()=>{if(!h)return;if(!(d>0)){O.error(`Enter a limit above $0`);return}let e={id:`budget-${Date.now().toString(36)}`,projectId:s===`all`?null:s,period:l,limitUsd:d,warnAtPercent:p,enabled:!0};_({...h,budgets:[...h.budgets,e]},`Budget added`),o(!1)},b=e.data?.budgets??[];return(0,F.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-4 py-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(r,{className:`size-4 text-muted-foreground`}),(0,F.jsx)(`h3`,{className:`text-sm font-medium`,children:`Budgets and alerts`}),!a&&(0,F.jsxs)(k,{variant:`outline`,size:`xs`,className:`ml-auto`,onClick:()=>o(!0),disabled:!h,children:[(0,F.jsx)(v,{}),` Add budget`]})]}),(0,F.jsx)(`p`,{className:`mt-1 text-2xs text-muted-foreground`,children:`Crossing the alert level or the limit puts an item in your inbox and sends a notification. Factory limits enforce the same figures.`}),e.data&&b.length===0&&!a&&(0,F.jsx)(`p`,{className:`py-4 text-xs text-muted-foreground`,children:`No budgets yet.`}),(0,F.jsx)(`div`,{className:`divide-y divide-border`,children:b.map(e=>(0,F.jsx)(tt,{status:e,scope:g(e.budget.projectId),onDelete:()=>h&&_({...h,budgets:h.budgets.filter(t=>t.id!==e.budget.id)},`Budget removed`)},e.budget.id))}),a&&(0,F.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-2 border-t border-border pt-3 text-xs md:grid-cols-[1.4fr_1fr_1fr_1fr_auto]`,children:[(0,F.jsxs)(Ce,{value:s,onValueChange:c,children:[(0,F.jsx)(be,{size:`sm`,"aria-label":`Scope`,className:`w-full`,children:(0,F.jsx)(ye,{})}),(0,F.jsxs)(xe,{children:[(0,F.jsx)(Se,{value:`all`,children:`All projects`}),i?.map(e=>(0,F.jsx)(Se,{value:e.id,children:e.name},e.id))]})]}),(0,F.jsxs)(Ce,{value:l,onValueChange:e=>u(e),children:[(0,F.jsx)(be,{size:`sm`,"aria-label":`Period`,className:`w-full`,children:(0,F.jsx)(ye,{})}),(0,F.jsxs)(xe,{children:[(0,F.jsx)(Se,{value:`daily`,children:`Per day`}),(0,F.jsx)(Se,{value:`monthly`,children:`Per month`})]})]}),(0,F.jsx)(ve,{"aria-label":`Limit in USD`,decimal:!0,min:0,className:`h-7`,value:d,onChange:f,placeholder:`Limit $`}),(0,F.jsx)(ve,{"aria-label":`Alert at percent`,min:1,max:100,className:`h-7`,value:p,onChange:m,placeholder:`Alert %`}),(0,F.jsxs)(`div`,{className:`col-span-2 flex justify-end gap-1 md:col-span-1`,children:[(0,F.jsx)(k,{size:`sm`,variant:`ghost`,onClick:()=>o(!1),children:`Cancel`}),(0,F.jsx)(k,{size:`sm`,onClick:y,disabled:n.isPending,children:`Save`})]})]})]})}var rt=[[`inputPerMTok`,`Input`],[`outputPerMTok`,`Output`],[`cacheReadPerMTok`,`Cache read`],[`cacheWritePerMTok`,`Cache write`]],it={provider:`claude`,model:``,inputPerMTok:null,outputPerMTok:null,cacheReadPerMTok:null,cacheWritePerMTok:null};function at(){let e=ne(),t=j(),[n,r]=(0,P.useState)(it),i=e.data?.settings,a=i?.prices??[],o=e.data?.bundledPrices??[],s=new Set(a.map(e=>`${e.provider}:${e.model}`)),c=(e,n)=>{i&&t.mutate({...i,prices:e},{onSuccess:()=>O.success(n),onError:e=>O.error(e.message)})},l=()=>{if(!n.model.trim()){O.error(`Enter a model id`);return}let e={provider:n.provider.trim(),model:n.model.trim(),inputPerMTok:n.inputPerMTok??0,outputPerMTok:n.outputPerMTok??0,cacheReadPerMTok:n.cacheReadPerMTok??0,cacheWritePerMTok:n.cacheWritePerMTok??0,asOf:le()},t=a.filter(t=>t.provider!==e.provider||t.model!==e.model);c([...t,e],`Price for ${e.model} saved`),r(it)},u=e=>r({provider:e.provider,model:e.model,inputPerMTok:e.inputPerMTok,outputPerMTok:e.outputPerMTok,cacheReadPerMTok:e.cacheReadPerMTok,cacheWritePerMTok:e.cacheWritePerMTok}),f=(e,t)=>(0,F.jsxs)(Fe,{children:[(0,F.jsx)(Ie,{className:`py-1.5 text-muted-foreground`,children:_e[e.provider]??e.provider}),(0,F.jsxs)(Ie,{className:`py-1.5 font-mono`,children:[e.model,!t&&s.has(`${e.provider}:${e.model}`)&&(0,F.jsx)(`span`,{className:`ml-1.5 text-2xs text-muted-foreground`,children:`(overridden)`})]}),rt.map(([t])=>(0,F.jsxs)(Ie,{className:`py-1.5 text-right font-mono tabular-nums`,children:[`$`,e[t]]},t)),(0,F.jsx)(Ie,{className:`py-1.5 text-right text-2xs text-muted-foreground`,children:e.asOf}),(0,F.jsx)(Ie,{className:`py-1.5 text-right`,children:t?(0,F.jsx)(k,{variant:`ghost`,size:`icon-xs`,"aria-label":`Remove ${e.model} override`,onClick:()=>c(a.filter(t=>t!==e),`Override removed`),children:(0,F.jsx)(d,{})}):(0,F.jsx)(k,{variant:`ghost`,size:`icon-xs`,"aria-label":`Override ${e.model}`,onClick:()=>u(e),children:(0,F.jsx)(_,{})})})]},`${t?`o`:`b`}:${e.provider}:${e.model}`);return(0,F.jsxs)(Ae,{children:[(0,F.jsx)(De,{asChild:!0,children:(0,F.jsxs)(k,{variant:`outline`,size:`sm`,className:`h-8 gap-1.5 text-xs`,children:[(0,F.jsx)(b,{className:`size-3.5`}),` Prices`]})}),(0,F.jsxs)(Oe,{className:`max-h-[85vh] overflow-y-auto sm:max-w-3xl`,children:[(0,F.jsxs)(Te,{children:[(0,F.jsx)(Ee,{children:`Model prices`}),(0,F.jsx)(ke,{children:`USD per million tokens. Estimated costs use these when a provider reports no cost (Codex always, Claude never). List prices are bundled with the date they were checked; your overrides win.`})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 rounded-lg border border-border p-3 text-xs md:grid-cols-7`,children:[(0,F.jsx)(je,{"aria-label":`Provider`,className:`h-7`,value:n.provider,onChange:e=>r({...n,provider:e.target.value}),placeholder:`provider`}),(0,F.jsx)(je,{"aria-label":`Model id`,className:`col-span-2 h-7 font-mono`,value:n.model,onChange:e=>r({...n,model:e.target.value}),placeholder:`model id`}),rt.map(([e,t])=>(0,F.jsx)(ve,{"aria-label":`${t} per million tokens`,decimal:!0,optional:!0,min:0,className:`h-7`,value:n[e],onChange:t=>r(n=>({...n,[e]:t})),placeholder:t},e)),(0,F.jsx)(`div`,{className:`col-span-3 flex justify-end md:col-span-7`,children:(0,F.jsx)(k,{size:`sm`,onClick:l,disabled:t.isPending||!i,children:`Save price`})})]}),(0,F.jsxs)(Le,{className:`text-xs`,children:[(0,F.jsx)(Me,{children:(0,F.jsxs)(Fe,{className:`hover:bg-transparent`,children:[(0,F.jsx)(Ne,{className:`h-8 text-2xs`,children:`Provider`}),(0,F.jsx)(Ne,{className:`h-8 text-2xs`,children:`Model`}),rt.map(([e,t])=>(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:t},e)),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Checked`}),(0,F.jsx)(Ne,{className:`h-8 w-8`})]})}),(0,F.jsxs)(Pe,{children:[a.map(e=>f(e,!0)),o.map(e=>f(e,!1))]})]})]})]})}var ot=[{id:`today`,label:`Today`,days:1},{id:`7d`,label:`7 days`,days:7},{id:`30d`,label:`30 days`,days:30},{id:`90d`,label:`90 days`,days:90}];function st(e,t=le()){let n=ot.find(t=>t.id===e)?.days??30;return{preset:e,from:se(t,-(n-1)),to:t}}function ct({value:e,onChange:t}){let[n,r]=(0,P.useState)(!1),[i,a]=(0,P.useState)(e.from),[o,s]=(0,P.useState)(e.to),l=!!(i&&o&&i<=o);return(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(`fieldset`,{"aria-label":`Time range`,className:`flex items-center gap-0.5 rounded-lg border border-border bg-card/50 p-0.5 text-xs`,children:ot.map(n=>(0,F.jsx)(`button`,{type:`button`,"aria-pressed":e.preset===n.id,onClick:()=>t(st(n.id)),className:we(`h-7 rounded-md px-2.5 whitespace-nowrap text-muted-foreground transition-colors hover:text-foreground`,e.preset===n.id&&`bg-accent text-foreground`),children:n.label},n.id))}),(0,F.jsxs)(Ve,{open:n,onOpenChange:t=>{r(t),t&&(a(e.from),s(e.to))},children:[(0,F.jsx)(Be,{asChild:!0,children:(0,F.jsxs)(k,{variant:`outline`,size:`sm`,"aria-pressed":e.preset===`custom`,className:we(`h-8 gap-1.5 text-xs`,e.preset===`custom`&&`bg-accent`),children:[(0,F.jsx)(c,{className:`size-3.5`}),e.preset===`custom`?`${ue(e.from)} – ${ue(e.to)}`:`Custom`]})}),(0,F.jsxs)(ze,{align:`end`,className:`w-64 space-y-3`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(Re,{htmlFor:`usage-from`,className:`text-2xs`,children:`From`}),(0,F.jsx)(je,{id:`usage-from`,type:`date`,value:i,max:o,onChange:e=>a(e.target.value)})]}),(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(Re,{htmlFor:`usage-to`,className:`text-2xs`,children:`To`}),(0,F.jsx)(je,{id:`usage-to`,type:`date`,value:o,min:i,max:le(),onChange:e=>s(e.target.value)})]})]}),(0,F.jsx)(k,{size:`sm`,className:`w-full`,disabled:!l,onClick:()=>{t({preset:`custom`,from:i,to:o}),r(!1)},children:`Apply range`})]})]})]})}function lt(e,t){return e.stale?`stale`:e.status===`limited`||(e.usedPercent??0)>=100?`limited`:e.status===`warning`||(e.usedPercent??0)>=t?`warning`:`ok`}var ut={ok:`bg-status-running`,warning:`bg-status-waiting`,limited:`bg-status-failed`,stale:`bg-muted-foreground/40`};function dt(e){return e===null?`—`:e>0&&e<1?`<1%`:`${Math.round(e)}%`}var ft={ok:`Within limit`,warning:`Close to the limit`,limited:`Limit reached`};function pt(e,t){return t===`stale`?`reset since`:e.usedPercent===null?ft[e.status]:t===`limited`?`Limit reached`:`${dt(e.usedPercent)} used`}function mt({w:e,warnPercent:t}){let n=lt(e,t),r=e.usedPercent,i=(r===null?null:e.usedPercentAt)??e.observedAt;return(0,F.jsxs)(`div`,{className:`space-y-1.5`,"data-testid":`limit-window`,"data-tone":n,children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2 text-xs`,children:[(0,F.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,F.jsxs)(`span`,{className:we(`inline-flex items-center gap-1 tabular-nums`,n===`stale`?`text-muted-foreground`:`text-foreground`),children:[n===`warning`&&(0,F.jsx)(m,{className:`size-3 text-status-waiting`}),n===`limited`&&(0,F.jsx)(h,{className:`size-3 text-status-failed`}),pt(e,n)]})]}),r!==null&&(0,F.jsx)(`div`,{role:`meter`,"aria-label":`${e.label} used`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r),className:`h-2 overflow-hidden rounded-full bg-muted`,children:(0,F.jsx)(`div`,{className:we(`h-full rounded-full transition-[width]`,ut[n]),style:{width:`${n===`stale`?0:Math.max(r,r>0?2:0)}%`}})}),(0,F.jsxs)(`div`,{className:`flex justify-between gap-2 text-2xs text-muted-foreground`,children:[(0,F.jsx)(`span`,{children:e.resetsAt?n===`stale`?`Reset ${A(e.resetsAt)}`:`Resets ${D(e.resetsAt)}`:`Reset time not reported`}),(0,F.jsxs)(`span`,{title:new Date(i).toLocaleString(),children:[`as of `,A(i)]})]})]})}function ht({data:e}){let t=e?.windows??[],n=[...new Set(t.map(e=>e.provider))];return!e||n.length===0?(0,F.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-dashed border-border p-4 text-xs text-muted-foreground`,children:[(0,F.jsx)(f,{className:`mt-0.5 size-4 shrink-0`}),(0,F.jsx)(`p`,{children:`No limit readings yet. Claude reports its 5-hour and weekly windows while it runs, and Codex sends a snapshot with each turn, so they appear after the next session. API keys pay per token and have no such windows.`})]}):(0,F.jsx)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] gap-3 md:grid-cols-2`,children:n.map(n=>{let r=e.billing[n];return(0,F.jsxs)(`div`,{className:`space-y-4 rounded-xl border border-border bg-card p-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(C,{provider:n,className:`size-5 text-[10px]`}),(0,F.jsx)(`span`,{className:`text-sm font-medium`,children:_e[n]??n}),(0,F.jsx)(`span`,{className:`ml-auto text-2xs text-muted-foreground`,children:r===`subscription`?`Subscription login`:r===`api`?`API key`:`Login type unknown`})]}),t.filter(e=>e.provider===n).map(t=>(0,F.jsx)(mt,{w:t,warnPercent:e.warnPercent},t.windowId))]},n)})})}var gt={user:`You`,orchestrator:`Orchestrator`,pm:`PM`,automation:`Automation`,factory:`Factory`};function _t({sessions:e,empty:t=`No sessions in this range.`,limit:n=10}){return e.length===0?(0,F.jsx)(`p`,{className:`py-8 text-center text-xs text-muted-foreground`,children:t}):(0,F.jsxs)(Le,{className:`text-xs`,"data-testid":`top-sessions`,children:[(0,F.jsx)(Me,{children:(0,F.jsxs)(Fe,{className:`hover:bg-transparent`,children:[(0,F.jsx)(Ne,{className:`h-8 text-2xs`,children:`Session`}),(0,F.jsx)(Ne,{className:`h-8 text-2xs`,children:`Model`}),(0,F.jsx)(Ne,{className:`h-8 text-2xs`,children:`Started by`}),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Turns`}),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Tokens`}),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Cost`})]})}),(0,F.jsx)(Pe,{children:e.slice(0,n).map(e=>(0,F.jsxs)(Fe,{children:[(0,F.jsxs)(Ie,{className:`max-w-80 py-2`,children:[(0,F.jsx)(He,{to:`/sessions/$sessionId`,params:{sessionId:e.sessionId},className:`block truncate font-medium hover:underline`,children:e.title}),(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5 text-2xs text-muted-foreground`,children:[e.projectName??(e.role===`orchestrator`?`Orchestrator`:`No project`),(0,F.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),A(e.lastAt),e.pr&&(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,F.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),e.pr.state===`merged`?(0,F.jsx)(y,{className:`size-3 text-status-done`}):(0,F.jsx)(l,{className:`size-3`}),`#`,e.pr.number]})]})]}),(0,F.jsx)(Ie,{className:`py-2`,children:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-mono text-2xs text-muted-foreground`,children:[(0,F.jsx)(C,{provider:e.provider,className:`size-3.5 text-[8px]`}),e.model]})}),(0,F.jsx)(Ie,{className:`py-2 text-muted-foreground`,children:gt[e.source]}),(0,F.jsx)(Ie,{className:`py-2 text-right text-muted-foreground tabular-nums`,children:e.turns}),(0,F.jsx)(Ie,{className:`py-2 text-right text-muted-foreground tabular-nums`,children:ce(e.tokens)}),(0,F.jsx)(Ie,{className:`py-2 text-right font-mono font-medium tabular-nums`,children:pe(e.costUsd,e.estimated)})]},e.sessionId))})]})}function vt({label:e,value:t,sub:n,delta:r,testId:o}){return(0,F.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-card px-4 py-3`,children:[(0,F.jsx)(`div`,{className:`flex items-center gap-1.5 text-2xs text-muted-foreground`,children:e}),(0,F.jsxs)(`div`,{className:`mt-1 flex items-baseline gap-2`,children:[(0,F.jsx)(`span`,{"data-testid":o,className:`truncate text-2xl font-semibold tabular-nums`,children:t}),r&&(0,F.jsxs)(`span`,{title:`Compared with the previous period of the same length`,className:`inline-flex items-center text-2xs text-muted-foreground tabular-nums`,children:[r.up?(0,F.jsx)(a,{className:`size-3`}):(0,F.jsx)(i,{className:`size-3`}),r.text]})]}),(0,F.jsx)(`div`,{className:`mt-0.5 truncate text-2xs text-muted-foreground tabular-nums`,children:n})]})}function yt({report:e}){let t=e.totals,n=e.previousTotals,r=t.estimatedCostUsd>0,i=he(e.billing),a=t.costUsd/Math.max(1,e.days.length);return(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-5`,children:[(0,F.jsx)(vt,{testId:`usage-total`,label:(0,F.jsxs)(F.Fragment,{children:[i?`API-equivalent cost`:`Spend`,i&&(0,F.jsx)(`span`,{className:`rounded border border-border px-1 text-3xs`,title:`You use a subscription login: this is what the same work would cost on API credits, not your bill.`,children:`subscription`})]}),value:pe(t.costUsd,r),delta:de(t.costUsd,n.costUsd),sub:r?`${pe(a)}/day · ${pe(t.estimatedCostUsd)} estimated`:`${pe(a)} a day on average`}),(0,F.jsx)(vt,{testId:`usage-tokens`,label:`Tokens`,value:ce(me(t)),delta:de(me(t),me(n)),sub:`${ce(t.inputTokens)} in · ${ce(t.outputTokens)} out · ${ce(t.cacheReadTokens)} cached`}),(0,F.jsx)(vt,{label:`Cache hit rate`,value:ge(t.cacheHitRate),sub:`${ce(t.cacheWriteTokens)} written to cache`}),(0,F.jsx)(vt,{label:`Per session`,value:e.averages.perSessionUsd===null?`—`:pe(e.averages.perSessionUsd,r),sub:`${t.sessions.toLocaleString(`en-US`)} sessions · ${t.turns.toLocaleString(`en-US`)} turns`}),(0,F.jsx)(vt,{label:`Per merged PR`,value:e.averages.perMergedPrUsd===null?`—`:pe(e.averages.perMergedPrUsd),sub:e.averages.mergedPrs>0?`${e.averages.mergedPrs} merged PRs`:`No merged PRs in range`})]})}function bt({report:e,className:t}){return e.totals.unpricedTurns===0?null:(0,F.jsxs)(`p`,{className:we(`text-2xs text-muted-foreground`,t),children:[e.totals.unpricedTurns,` turns ran on models with no price and no reported cost; their tokens are counted but cost $0. Add a price under Prices.`]})}var xt={provider:`Provider`,model:`Model`,project:`Project`,role:`Role`,source:`Started by`};function St({report:e,dimension:t,onPick:n}){let r=ae(),i=e.series[t],a=Ye(i.map(e=>e.key)),o=e.totals.costUsd;return i.length===0?(0,F.jsx)(`p`,{className:`py-8 text-center text-xs text-muted-foreground`,children:`No usage in this range.`}):(0,F.jsxs)(Le,{className:`text-xs`,children:[(0,F.jsx)(Me,{children:(0,F.jsxs)(Fe,{className:`hover:bg-transparent`,children:[(0,F.jsx)(Ne,{className:`h-8 text-2xs`,children:xt[t]}),(0,F.jsx)(Ne,{className:`h-8 w-[28%] text-2xs`,children:`Share of spend`}),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Cost`}),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Tokens`}),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Turns`}),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Sessions`})]})}),(0,F.jsx)(Pe,{children:i.map(e=>{let t=a.get(e.key),i=e.key===`__other`||t===void 0?qe[r]:Ke[t]?.[r]??qe[r],s=o>0?e.costUsd/o:0,c=!!n&&e.key!==`__other`&&e.key!==``;return(0,F.jsxs)(Fe,{className:c?`cursor-pointer`:void 0,onClick:c?()=>n?.(e.key):void 0,title:c?`Show only ${e.label}`:void 0,children:[(0,F.jsx)(Ie,{className:`max-w-56 py-2`,children:(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`size-2.5 shrink-0 rounded-[3px]`,style:{background:i}}),(0,F.jsx)(`span`,{className:`truncate font-medium`,children:e.label})]})}),(0,F.jsx)(Ie,{className:`py-2`,children:(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`h-1.5 flex-1 overflow-hidden rounded-full bg-muted`,children:(0,F.jsx)(`span`,{className:`block h-full rounded-full`,style:{width:`${Math.max(s*100,s>0?1.5:0)}%`,background:i}})}),(0,F.jsx)(`span`,{className:`w-9 text-right text-muted-foreground tabular-nums`,children:ge(s)})]})}),(0,F.jsx)(Ie,{className:`py-2 text-right font-mono tabular-nums`,children:pe(e.costUsd,e.estimatedCostUsd>0)}),(0,F.jsx)(Ie,{className:`py-2 text-right text-muted-foreground tabular-nums`,children:ce(e.tokens)}),(0,F.jsx)(Ie,{className:`py-2 text-right text-muted-foreground tabular-nums`,children:e.turns.toLocaleString(`en-US`)}),(0,F.jsx)(Ie,{className:`py-2 text-right text-muted-foreground tabular-nums`,children:e.sessions.toLocaleString(`en-US`)})]},e.key)})})]})}var Ct=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function wt(e){return typeof e==`string`&&Ct.includes(e)}var Tt=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function Et(e){return typeof e==`string`&&Tt.has(e)}function Dt(e){return typeof e==`string`&&e.startsWith(`data-`)}function Ot(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Et(n)||Dt(n))&&(t[n]=e[n]);return t}function kt(e){if(e==null)return null;if((0,P.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return Ot(t)}return typeof e==`object`&&!Array.isArray(e)?Ot(e):null}function At(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Et(n)||Dt(n)||wt(n))&&(t[n]=e[n]);return t}var jt=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function Mt(){return Mt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mt.apply(null,arguments)}function Nt(e,t){if(e==null)return{};var n,r,i=Pt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Pt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ft=(0,P.forwardRef)((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:s,title:c,desc:l}=e,u=Nt(e,jt),d=a||{width:r,height:i,x:0,y:0},f=N(`recharts-surface`,o);return P.createElement(`svg`,Mt({},At(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),P.createElement(`title`,null,c),P.createElement(`desc`,null,l),n)}),It=[`children`,`className`];function Lt(){return Lt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lt.apply(null,arguments)}function Rt(e,t){if(e==null)return{};var n,r,i=zt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Bt=P.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Rt(e,It),a=N(`recharts-layer`,r);return P.createElement(`g`,Lt({className:a},At(i),{ref:t}),n)}),Vt=(0,P.createContext)(null),Ht=()=>(0,P.useContext)(Vt),Ut=Math.PI,Wt=2*Ut,Gt=1e-6,Kt=Wt-Gt;function qt(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Jt(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return qt;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}function Yt(e,t,n,r){return e===n&&t===r}function Xt(e){let t=Math.floor(e);if(!(t<=15))return Yt;let n=10**t,r=function(e){return Math.round(e*n)};return function(e,t,n,i){return r(e)===r(n)&&r(t)===r(i)}}var Zt=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?qt:Jt(e),this._equal=e==null?Yt:Xt(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>Gt){if(!(Math.abs(u*s-c*l)>Gt)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((Ut-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Gt&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;if(this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Gt||Math.abs(this._y1-l)>Gt)&&this._append`L${c},${l}`,n){if(d<0&&(d=d%Wt+Wt),d>Kt)this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`;else if(d>Gt){let a=e+n*Math.cos(i),o=t+n*Math.sin(i);if(d>=Ut&&this._equal(c,l,a,o)){d/=2;let i=r+d;this._append`A${n},${n},0,${+(d>=Ut)},${u},${e+n*Math.cos(i)},${t+n*Math.sin(i)}`}this._append`A${n},${n},0,${+(d>=Ut)},${u},${this._x1=a},${this._y1=o}`}}}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};Zt.prototype;function I(e){return function(){return e}}var Qt=Math.cos,$t=Math.sin,en=Math.sqrt,tn=1e-12,nn=Math.PI;nn/2;var rn=2*nn;function an(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Zt(t)}Array.prototype.slice;function on(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function sn(e){this._context=e}sn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function cn(e){return new sn(e)}function ln(e){return e[0]}function un(e){return e[1]}function dn(e,t){var n=I(!0),r=null,i=cn,a=null,o=an(s);e=typeof e==`function`?e:e===void 0?ln:I(e),t=typeof t==`function`?t:t===void 0?un:I(t);function s(s){var c,l=(s=on(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:I(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:I(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:I(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function fn(e,t,n){var r=null,i=I(!0),a=null,o=cn,s=null,c=an(l);e=typeof e==`function`?e:e===void 0?ln:I(+e),t=typeof t==`function`?t:I(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?un:I(+n);function l(l){var u,d,f,p=(l=on(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h){if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return dn().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:I(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:I(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:I(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:I(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:I(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:I(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:I(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}mn(cn);function pn(e){this._curve=e}pn.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function mn(e){function t(t){return new pn(e(t))}return t._curve=e,t}var hn=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function gn(e){return new hn(e,!0)}function _n(e){return new hn(e,!1)}en(3);var vn={draw(e,t){let n=en(t/nn);e.moveTo(n,0),e.arc(0,0,n,0,rn)}},yn={draw(e,t){let n=en(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},bn=en(1/3),xn=bn*2,Sn={draw(e,t){let n=en(t/xn),r=n*bn;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Cn={draw(e,t){let n=en(t),r=-n/2;e.rect(r,r,n,n)}},wn=.8908130915292852,Tn=$t(nn/10)/$t(7*nn/10),En=$t(rn/10)*Tn,Dn=-Qt(rn/10)*Tn,On={draw(e,t){let n=en(t*wn),r=En*n,i=Dn*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=rn*t/5,o=Qt(a),s=$t(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},kn=en(3),An={draw(e,t){let n=-en(t/(kn*3));e.moveTo(0,n*2),e.lineTo(-kn*n,-n),e.lineTo(kn*n,-n),e.closePath()}};en(3);var jn=-.5,Mn=en(3)/2,Nn=1/en(12),Pn=(Nn/2+1)*3,Fn={draw(e,t){let n=en(t/Pn),r=n/2,i=n*Nn,a=r,o=n*Nn+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(jn*r-Mn*i,Mn*r+jn*i),e.lineTo(jn*a-Mn*o,Mn*a+jn*o),e.lineTo(jn*s-Mn*c,Mn*s+jn*c),e.lineTo(jn*r+Mn*i,jn*i-Mn*r),e.lineTo(jn*a+Mn*o,jn*o-Mn*a),e.lineTo(jn*s+Mn*c,jn*c-Mn*s),e.closePath()}};function In(e,t){let n=null,r=an(i);e=typeof e==`function`?e:I(e||vn),t=typeof t==`function`?t:I(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:I(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:I(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function Ln(){}function Rn(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function zn(e){this._context=e}zn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Rn(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Rn(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bn(e){return new zn(e)}function Vn(e){this._context=e}Vn.prototype={areaStart:Ln,areaEnd:Ln,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Rn(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Hn(e){return new Vn(e)}function Un(e){this._context=e}Un.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Rn(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Wn(e){return new Un(e)}function Gn(e,t){this._basis=new zn(e),this._beta=t}Gn.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}},(function e(t){function n(e){return t===1?new zn(e):new Gn(e,t)}return n.beta=function(t){return e(+t)},n})(.85);function Kn(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function qn(e,t){this._context=e,this._k=(1-t)/6}qn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Kn(this,this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Kn(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function e(t){function n(e){return new qn(e,t)}return n.tension=function(t){return e(+t)},n})(0);function Jn(e,t){this._context=e,this._k=(1-t)/6}Jn.prototype={areaStart:Ln,areaEnd:Ln,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Kn(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function e(t){function n(e){return new Jn(e,t)}return n.tension=function(t){return e(+t)},n})(0);function Yn(e,t){this._context=e,this._k=(1-t)/6}Yn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Kn(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function e(t){function n(e){return new Yn(e,t)}return n.tension=function(t){return e(+t)},n})(0);function Xn(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>tn){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>tn){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function Zn(e,t){this._context=e,this._alpha=t}Zn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Xn(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function e(t){function n(e){return t?new Zn(e,t):new qn(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function Qn(e,t){this._context=e,this._alpha=t}Qn.prototype={areaStart:Ln,areaEnd:Ln,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Xn(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function e(t){function n(e){return t?new Qn(e,t):new Jn(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function $n(e,t){this._context=e,this._alpha=t}$n.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Xn(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function e(t){function n(e){return t?new $n(e,t):new Yn(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function er(e){this._context=e}er.prototype={areaStart:Ln,areaEnd:Ln,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function tr(e){return new er(e)}function nr(e){return e<0?-1:1}function rr(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(nr(a)+nr(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function ir(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ar(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function or(e){this._context=e}or.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ar(this,this._t0,ir(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ar(this,ir(this,n=rr(this,e,t)),n);break;default:ar(this,this._t0,n=rr(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function sr(e){this._context=new cr(e)}(sr.prototype=Object.create(or.prototype)).point=function(e,t){or.prototype.point.call(this,t,e)};function cr(e){this._context=e}cr.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function lr(e){return new or(e)}function ur(e){return new sr(e)}function dr(e){this._context=e}dr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=fr(e),i=fr(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o])}(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function fr(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function pr(e){return new dr(e)}function mr(e,t){this._context=e,this._t=t}mr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function hr(e){return new mr(e,.5)}function gr(e){return new mr(e,0)}function _r(e){return new mr(e,1)}function vr(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function yr(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function br(e,t){return e[t]}function xr(e){let t=[];return t.key=e,t}function Sr(){var e=I([]),t=yr,n=vr,r=br;function i(i){var a=Array.from(e.apply(this,arguments),xr),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=on(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:I(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:I(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?yr:typeof e==`function`?e:I(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??vr,i):n},i}function Cr(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}vr(e,t)}}function wr(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}vr(e,t)}}function Tr(e,t){if((o=e.length)>0&&(a=(i=e[t[0]]).length)>0){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,vr(e,t)}}function Er(e){return e===`__proto__`}var Dr=Object.prototype.hasOwnProperty;function Or(e,t){return Dr.call(e,t)}var kr=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function Ar(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:kr.test(e);default:return!1}}function jr(e){var t;return typeof e==`string`||typeof e==`symbol`?e:Object.is(e==null||(t=e.valueOf)==null?void 0:t.call(e),-0)?`-0`:String(e)}function Mr(e){return typeof e==`symbol`||e instanceof Symbol}function Nr(e){if(typeof e==`string`)return e;if(Array.isArray(e)){let t=``;for(let n=0;n<e.length;n++)n>0&&(t+=`,`),t+=Nr(e[n]);return t}if(Mr(e))return e.toString();let t=e+``;return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function Pr(e){return e==null?``:Nr(e)}function Fr(e){if(Array.isArray(e))return e.map(jr);if(typeof e==`symbol`)return[e];e=Pr(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1,s=!1,c=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let l=e[r];if(a)l===`\\`&&r+1<n?(r++,i+=e[r]):l===a?a=``:i+=l;else if(o){if(l===`"`||l===`'`)a=l,s=!0;else if(l===`]`){if(o=!1,!s&&i.includes(`.`)&&!c.test(i)){let e=i.split(`.`);for(let n=0;n<e.length;n++)e[n]!==``&&t.push(e[n])}else t.push(i);i=``}else i+=l}else if(l===`[`)o=!0,s=!1,i&&=(t.push(i),``);else if(l===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=l;r++}return i&&t.push(i),t}function Ir(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(Er(t))return n;let r=e[t];return r===void 0?Ar(t)&&!Or(e,t)?Ir(e,Fr(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=jr(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return Lr(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),Er(t))return n;let r=e[t];return r===void 0?n:r}}}function Lr(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||Er(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}var Rr=4;function zr(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:Rr),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function L(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+zr(i)+n},``)}var Br=e=>e===0?0:e>0?1:-1,Vr=e=>typeof e==`number`&&e!=+e,Hr=e=>typeof e==`string`&&e.indexOf(`%`)===e.length-1,R=e=>(typeof e==`number`||e instanceof Number)&&!Vr(e),Ur=e=>R(e)||typeof e==`string`,Wr=0,Gr=e=>{var t=++Wr;return`${e||``}${t}`},Kr=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!R(e)&&typeof e!=`string`)return n;var i;if(Hr(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return Vr(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},qr=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Jr(e,t,n){return R(e)&&R(t)?zr(e+n*(t-e)):t}function Yr(e,t,n){if(e&&e.length)return e.find(e=>e&&(typeof t==`function`?t(e):Ir(e,t))===n)}var z=e=>e==null,Xr=e=>z(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function Zr(e){return e!=null}function Qr(){}var $r=[`type`,`size`,`sizeType`];function ei(){return ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ei.apply(null,arguments)}function ti(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ni(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ti(Object(n),!0).forEach(function(t){ri(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ti(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ri(e,t,n){return(t=ii(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ii(e){var t=ai(e,`string`);return typeof t==`symbol`?t:t+``}function ai(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function oi(e,t){if(e==null)return{};var n,r,i=si(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function si(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ci={symbolCircle:vn,symbolCross:yn,symbolDiamond:Sn,symbolSquare:Cn,symbolStar:On,symbolTriangle:An,symbolWye:Fn},li=Math.PI/180,ui=e=>ci[`symbol${Xr(e)}`]||vn,di=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*li;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},fi=(e,t)=>{ci[`symbol${Xr(e)}`]=t},pi=e=>{var{type:t=`circle`,size:n=64,sizeType:r=`area`}=e,i=ni(ni({},oi(e,$r)),{},{type:t,size:n,sizeType:r}),a=`circle`;typeof t==`string`&&(a=t);var o=()=>{var e=ui(a),t=In().type(e).size(di(n,r,a))();if(t!==null)return t},{className:s,cx:c,cy:l}=i,u=At(i);return R(c)&&R(l)&&R(n)?P.createElement(`path`,ei({},u,{className:N(`recharts-symbols`,s),transform:`translate(${c}, ${l})`,d:o()})):null};pi.registerSymbol=fi;var mi=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,hi=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,P.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{wt(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},gi=(e,t,n)=>r=>(e(t,n,r),null),_i=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];wt(i)&&typeof a==`function`&&(r||={},r[i]=gi(a,t,n))}),r};function vi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vi(Object(n),!0).forEach(function(t){bi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bi(e,t,n){return(t=xi(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xi(e){var t=Si(e,`string`);return typeof t==`symbol`?t:t+``}function Si(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ci(e,t){var n=yi({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function wi(){return wi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wi.apply(null,arguments)}function Ti(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ei(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ti(Object(n),!0).forEach(function(t){Di(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ti(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Di(e,t,n){return(t=Oi(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oi(e){var t=ki(e,`string`);return typeof t==`symbol`?t:t+``}function ki(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Ai=32,ji={align:`center`,iconSize:14,inactiveColor:`#ccc`,layout:`horizontal`,verticalAlign:`middle`,labelStyle:{}};function Mi(e){if(typeof e==`object`&&e&&`strokeDasharray`in e)return String(e.strokeDasharray)}function Ni(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Ai/2,a=Ai/6,o=Ai/3,s=t.inactive?r:t.color,c=n??t.type;if(c===`none`)return null;if(c===`plainline`)return P.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:s,strokeDasharray:Mi(t.payload),x1:0,y1:i,x2:Ai,y2:i,className:`recharts-legend-icon`});if(c===`line`)return P.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:s,d:`M0,${i}h${o}
|
|
1
|
+
import{n as e,r as t,t as n}from"./rolldown-runtime-XKyaHtl9.js";import{Er as r,Nr as i,Or as a,Wn as o,Yt as s,_r as c,cn as l,gr as u,h as d,hn as f,i as p,m,mt as h,n as g,ot as _,tt as v,un as y,x as b}from"./icons-COCLuOtb.js";import{n as x,t as S}from"./jsx-runtime-C3cWAN_r.js";import{a as C,t as w}from"./bits-B2GRjm37.js";import{D as T,E,f as D,j as O,m as k,n as A}from"./format-D3kairnQ.js";import{t as ee}from"./skeleton-D8Sbd2jT.js";import{a as j,c as M,i as te,l as ne,n as re,s as ie}from"./api-B9OffDXw.js";import{r as ae}from"./theme-3eeE0sp4.js";import{a as oe,c as se,f as ce,i as le,l as ue,m as de,n as fe,o as pe,p as me,r as he,s as ge,t as _e}from"./format-CPIs7kVL.js";import{t as ve}from"./number-field-Bzzs0k9i.js";import{a as ye,i as be,n as xe,r as Se,t as Ce}from"./select-B1ES0hhy.js";import{t as we}from"./dist-wxbqfqV1.js";import{a as Te,c as Ee,l as De,n as Oe,r as ke,t as Ae}from"./dialog-Cvj_lHPY.js";import{t as je}from"./input-CPpbtC2H.js";import{a as Me,i as Ne,n as Pe,o as Fe,r as Ie,t as Le}from"./table-ByDILCrJ.js";import{t as Re}from"./label-Bm_8Eqe2.js";import{n as ze,r as Be,t as Ve}from"./popover-BqwWmyWQ.js";import{L as He}from"./dropdown-menu-Bflkx6wY.js";import{t as Ue}from"./page-header-t9HzSrxd.js";import{n as We,t as N}from"./clsx-BxLRjTE8.js";import{U as Ge}from"./mobile-nav-CrjrDJZ5.js";var P=t(x(),1),Ke=[{light:`#2a78d6`,dark:`#3987e5`},{light:`#eb6834`,dark:`#d95926`},{light:`#1baf7a`,dark:`#199e70`},{light:`#eda100`,dark:`#c98500`},{light:`#e87ba4`,dark:`#d55181`},{light:`#008300`,dark:`#008300`},{light:`#6250d6`,dark:`#9085e9`},{light:`#e34948`,dark:`#e66767`}],qe={light:`#a3a29c`,dark:`#6b6a65`},Je={codex:0,claude:1,opencode:2,cursor:3,gemini:4};function Ye(e){let t=new Map,n=new Set;for(let r of e){let e=Je[r];e!==void 0&&!n.has(e)&&(t.set(r,e),n.add(e))}let r=0;for(let i of e)if(!(t.has(i)||i===`__other`)){for(;n.has(r)&&r<Ke.length;)r++;if(r>=Ke.length)break;t.set(i,r),n.add(r)}return t}function Xe(e){return`s${e}`}function Ze(e){let t=Ye(e.map(e=>e.key)),n={};return e.forEach((e,r)=>{let i=t.get(e.key),a=e.key===`__other`||i===void 0?qe:Ke[i]??qe;n[Xe(r)]={label:e.label,theme:a}}),n}var F=S();function Qe({report:e}){let t=ae(),{manualCostUsd:n,automationCostUsd:r,factoryCostUsd:i,byAutomation:a}=e.automations,o=n+r+i,s=[{label:`Interactive`,value:n,color:Ke[0]?.[t]},{label:`Automations`,value:r,color:Ke[2]?.[t]},{label:`Factory`,value:i,color:Ke[6]?.[t]}];return(0,F.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-4 py-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(p,{className:`size-4 text-muted-foreground`}),(0,F.jsx)(`h3`,{className:`text-sm font-medium`,children:`Automation and factory spend`})]}),(0,F.jsx)(`div`,{className:`mt-3 flex h-2.5 gap-0.5 overflow-hidden rounded-full bg-muted`,children:o>0&&s.map(e=>e.value>0?(0,F.jsx)(`div`,{className:`h-full first:rounded-l-full last:rounded-r-full`,style:{width:`${e.value/o*100}%`,background:e.color},title:`${e.label}: ${pe(e.value)}`},e.label):null)}),(0,F.jsx)(`div`,{className:`mt-2 grid grid-cols-3 gap-2`,children:s.map(e=>(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 text-2xs text-muted-foreground`,children:[(0,F.jsx)(`span`,{className:`size-2 rounded-[3px]`,style:{background:e.color}}),e.label]}),(0,F.jsxs)(`div`,{className:`text-sm font-medium tabular-nums`,children:[pe(e.value),` `,(0,F.jsx)(`span`,{className:`text-2xs font-normal text-muted-foreground`,children:ge(o>0?e.value/o:null)})]})]},e.label))}),a.length>0?(0,F.jsx)(`ul`,{className:`mt-3 space-y-1.5 border-t border-border pt-3 text-xs`,children:a.slice(0,6).map(e=>(0,F.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`truncate`,children:e.name}),(0,F.jsxs)(`span`,{className:`text-2xs text-muted-foreground`,children:[e.sessions,` `,e.sessions===1?`run`:`runs`]}),(0,F.jsx)(`span`,{className:`ml-auto font-mono tabular-nums`,children:pe(e.costUsd)})]},e.automationId))}):(0,F.jsx)(`p`,{className:`mt-3 border-t border-border pt-3 text-2xs text-muted-foreground`,children:`No automation runs in this range.`})]})}var $e={ok:`bg-status-done`,warning:`bg-status-waiting`,exceeded:`bg-status-failed`},et={ok:`On track`,warning:`Near the limit`,exceeded:`Over the limit`};function tt({status:e,scope:t,onDelete:n}){let{budget:r,spentUsd:i,percent:a,state:o}=e;return(0,F.jsxs)(`div`,{className:`space-y-1.5 py-3`,"data-testid":`budget-row`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,F.jsx)(`span`,{className:`font-medium`,children:t}),(0,F.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,r.period===`daily`?`per day`:`per month`,` · alert at `,r.warnAtPercent,`%`]}),(0,F.jsx)(`span`,{className:we(`ml-auto text-2xs`,o===`ok`?`text-muted-foreground`:`font-medium text-foreground`),children:et[o]}),(0,F.jsx)(k,{variant:`ghost`,size:`icon-xs`,"aria-label":`Delete ${t} budget`,onClick:n,children:(0,F.jsx)(d,{})})]}),(0,F.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-muted`,children:(0,F.jsx)(`div`,{className:we(`h-full rounded-full`,$e[o]),style:{width:`${Math.min(100,a)}%`}})}),(0,F.jsxs)(`div`,{className:`text-2xs text-muted-foreground tabular-nums`,children:[pe(i),` of `,pe(r.limitUsd),` (`,Math.round(a),`%)`]})]})}function nt(){let e=re(),t=ne(),n=j(),i=E().data?.projects,[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(`all`),[l,u]=(0,P.useState)(`daily`),[d,f]=(0,P.useState)(25),[p,m]=(0,P.useState)(80),h=t.data?.settings,g=e=>e?i?i.find(t=>t.id===e)?.name??`Deleted project`:`…`:`All projects`,_=(e,t)=>n.mutate(e,{onSuccess:()=>O.success(t),onError:e=>O.error(e.message)}),y=()=>{if(!h)return;if(!(d>0)){O.error(`Enter a limit above $0`);return}let e={id:`budget-${Date.now().toString(36)}`,projectId:s===`all`?null:s,period:l,limitUsd:d,warnAtPercent:p,enabled:!0};_({...h,budgets:[...h.budgets,e]},`Budget added`),o(!1)},b=e.data?.budgets??[];return(0,F.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-4 py-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(r,{className:`size-4 text-muted-foreground`}),(0,F.jsx)(`h3`,{className:`text-sm font-medium`,children:`Budgets and alerts`}),!a&&(0,F.jsxs)(k,{variant:`outline`,size:`xs`,className:`ml-auto`,onClick:()=>o(!0),disabled:!h,children:[(0,F.jsx)(v,{}),` Add budget`]})]}),(0,F.jsx)(`p`,{className:`mt-1 text-2xs text-muted-foreground`,children:`Crossing the alert level or the limit puts an item in your inbox and sends a notification. Factory limits enforce the same figures.`}),e.data&&b.length===0&&!a&&(0,F.jsx)(`p`,{className:`py-4 text-xs text-muted-foreground`,children:`No budgets yet.`}),(0,F.jsx)(`div`,{className:`divide-y divide-border`,children:b.map(e=>(0,F.jsx)(tt,{status:e,scope:g(e.budget.projectId),onDelete:()=>h&&_({...h,budgets:h.budgets.filter(t=>t.id!==e.budget.id)},`Budget removed`)},e.budget.id))}),a&&(0,F.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-2 border-t border-border pt-3 text-xs md:grid-cols-[1.4fr_1fr_1fr_1fr_auto]`,children:[(0,F.jsxs)(Ce,{value:s,onValueChange:c,children:[(0,F.jsx)(be,{size:`sm`,"aria-label":`Scope`,className:`w-full`,children:(0,F.jsx)(ye,{})}),(0,F.jsxs)(xe,{children:[(0,F.jsx)(Se,{value:`all`,children:`All projects`}),i?.map(e=>(0,F.jsx)(Se,{value:e.id,children:e.name},e.id))]})]}),(0,F.jsxs)(Ce,{value:l,onValueChange:e=>u(e),children:[(0,F.jsx)(be,{size:`sm`,"aria-label":`Period`,className:`w-full`,children:(0,F.jsx)(ye,{})}),(0,F.jsxs)(xe,{children:[(0,F.jsx)(Se,{value:`daily`,children:`Per day`}),(0,F.jsx)(Se,{value:`monthly`,children:`Per month`})]})]}),(0,F.jsx)(ve,{"aria-label":`Limit in USD`,decimal:!0,min:0,className:`h-7`,value:d,onChange:f,placeholder:`Limit $`}),(0,F.jsx)(ve,{"aria-label":`Alert at percent`,min:1,max:100,className:`h-7`,value:p,onChange:m,placeholder:`Alert %`}),(0,F.jsxs)(`div`,{className:`col-span-2 flex justify-end gap-1 md:col-span-1`,children:[(0,F.jsx)(k,{size:`sm`,variant:`ghost`,onClick:()=>o(!1),children:`Cancel`}),(0,F.jsx)(k,{size:`sm`,onClick:y,disabled:n.isPending,children:`Save`})]})]})]})}var rt=[[`inputPerMTok`,`Input`],[`outputPerMTok`,`Output`],[`cacheReadPerMTok`,`Cache read`],[`cacheWritePerMTok`,`Cache write`]],it={provider:`claude`,model:``,inputPerMTok:null,outputPerMTok:null,cacheReadPerMTok:null,cacheWritePerMTok:null};function at(){let e=ne(),t=j(),[n,r]=(0,P.useState)(it),i=e.data?.settings,a=i?.prices??[],o=e.data?.bundledPrices??[],s=new Set(a.map(e=>`${e.provider}:${e.model}`)),c=(e,n)=>{i&&t.mutate({...i,prices:e},{onSuccess:()=>O.success(n),onError:e=>O.error(e.message)})},l=()=>{if(!n.model.trim()){O.error(`Enter a model id`);return}let e={provider:n.provider.trim(),model:n.model.trim(),inputPerMTok:n.inputPerMTok??0,outputPerMTok:n.outputPerMTok??0,cacheReadPerMTok:n.cacheReadPerMTok??0,cacheWritePerMTok:n.cacheWritePerMTok??0,asOf:le()},t=a.filter(t=>t.provider!==e.provider||t.model!==e.model);c([...t,e],`Price for ${e.model} saved`),r(it)},u=e=>r({provider:e.provider,model:e.model,inputPerMTok:e.inputPerMTok,outputPerMTok:e.outputPerMTok,cacheReadPerMTok:e.cacheReadPerMTok,cacheWritePerMTok:e.cacheWritePerMTok}),f=(e,t)=>(0,F.jsxs)(Fe,{children:[(0,F.jsx)(Ie,{className:`py-1.5 text-muted-foreground`,children:_e[e.provider]??e.provider}),(0,F.jsxs)(Ie,{className:`py-1.5 font-mono`,children:[e.model,!t&&s.has(`${e.provider}:${e.model}`)&&(0,F.jsx)(`span`,{className:`ml-1.5 text-2xs text-muted-foreground`,children:`(overridden)`})]}),rt.map(([t])=>(0,F.jsxs)(Ie,{className:`py-1.5 text-right font-mono tabular-nums`,children:[`$`,e[t]]},t)),(0,F.jsx)(Ie,{className:`py-1.5 text-right text-2xs text-muted-foreground`,children:e.asOf}),(0,F.jsx)(Ie,{className:`py-1.5 text-right`,children:t?(0,F.jsx)(k,{variant:`ghost`,size:`icon-xs`,"aria-label":`Remove ${e.model} override`,onClick:()=>c(a.filter(t=>t!==e),`Override removed`),children:(0,F.jsx)(d,{})}):(0,F.jsx)(k,{variant:`ghost`,size:`icon-xs`,"aria-label":`Override ${e.model}`,onClick:()=>u(e),children:(0,F.jsx)(_,{})})})]},`${t?`o`:`b`}:${e.provider}:${e.model}`);return(0,F.jsxs)(Ae,{children:[(0,F.jsx)(De,{asChild:!0,children:(0,F.jsxs)(k,{variant:`outline`,size:`sm`,className:`h-8 gap-1.5 text-xs`,children:[(0,F.jsx)(b,{className:`size-3.5`}),` Prices`]})}),(0,F.jsxs)(Oe,{className:`max-h-[85vh] overflow-y-auto sm:max-w-3xl`,children:[(0,F.jsxs)(Te,{children:[(0,F.jsx)(Ee,{children:`Model prices`}),(0,F.jsx)(ke,{children:`USD per million tokens. Estimated costs use these when a provider reports no cost (Codex always, Claude never). List prices are bundled with the date they were checked; your overrides win.`})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 rounded-lg border border-border p-3 text-xs md:grid-cols-7`,children:[(0,F.jsx)(je,{"aria-label":`Provider`,className:`h-7`,value:n.provider,onChange:e=>r({...n,provider:e.target.value}),placeholder:`provider`}),(0,F.jsx)(je,{"aria-label":`Model id`,className:`col-span-2 h-7 font-mono`,value:n.model,onChange:e=>r({...n,model:e.target.value}),placeholder:`model id`}),rt.map(([e,t])=>(0,F.jsx)(ve,{"aria-label":`${t} per million tokens`,decimal:!0,optional:!0,min:0,className:`h-7`,value:n[e],onChange:t=>r(n=>({...n,[e]:t})),placeholder:t},e)),(0,F.jsx)(`div`,{className:`col-span-3 flex justify-end md:col-span-7`,children:(0,F.jsx)(k,{size:`sm`,onClick:l,disabled:t.isPending||!i,children:`Save price`})})]}),(0,F.jsxs)(Le,{className:`text-xs`,children:[(0,F.jsx)(Me,{children:(0,F.jsxs)(Fe,{className:`hover:bg-transparent`,children:[(0,F.jsx)(Ne,{className:`h-8 text-2xs`,children:`Provider`}),(0,F.jsx)(Ne,{className:`h-8 text-2xs`,children:`Model`}),rt.map(([e,t])=>(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:t},e)),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Checked`}),(0,F.jsx)(Ne,{className:`h-8 w-8`})]})}),(0,F.jsxs)(Pe,{children:[a.map(e=>f(e,!0)),o.map(e=>f(e,!1))]})]})]})]})}var ot=[{id:`today`,label:`Today`,days:1},{id:`7d`,label:`7 days`,days:7},{id:`30d`,label:`30 days`,days:30},{id:`90d`,label:`90 days`,days:90}];function st(e,t=le()){let n=ot.find(t=>t.id===e)?.days??30;return{preset:e,from:se(t,-(n-1)),to:t}}function ct({value:e,onChange:t}){let[n,r]=(0,P.useState)(!1),[i,a]=(0,P.useState)(e.from),[o,s]=(0,P.useState)(e.to),l=!!(i&&o&&i<=o);return(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(`fieldset`,{"aria-label":`Time range`,className:`flex items-center gap-0.5 rounded-lg border border-border bg-card/50 p-0.5 text-xs`,children:ot.map(n=>(0,F.jsx)(`button`,{type:`button`,"aria-pressed":e.preset===n.id,onClick:()=>t(st(n.id)),className:we(`h-7 rounded-md px-2.5 whitespace-nowrap text-muted-foreground transition-colors hover:text-foreground`,e.preset===n.id&&`bg-accent text-foreground`),children:n.label},n.id))}),(0,F.jsxs)(Ve,{open:n,onOpenChange:t=>{r(t),t&&(a(e.from),s(e.to))},children:[(0,F.jsx)(Be,{asChild:!0,children:(0,F.jsxs)(k,{variant:`outline`,size:`sm`,"aria-pressed":e.preset===`custom`,className:we(`h-8 gap-1.5 text-xs`,e.preset===`custom`&&`bg-accent`),children:[(0,F.jsx)(c,{className:`size-3.5`}),e.preset===`custom`?`${ue(e.from)} – ${ue(e.to)}`:`Custom`]})}),(0,F.jsxs)(ze,{align:`end`,className:`w-64 space-y-3`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(Re,{htmlFor:`usage-from`,className:`text-2xs`,children:`From`}),(0,F.jsx)(je,{id:`usage-from`,type:`date`,value:i,max:o,onChange:e=>a(e.target.value)})]}),(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(Re,{htmlFor:`usage-to`,className:`text-2xs`,children:`To`}),(0,F.jsx)(je,{id:`usage-to`,type:`date`,value:o,min:i,max:le(),onChange:e=>s(e.target.value)})]})]}),(0,F.jsx)(k,{size:`sm`,className:`w-full`,disabled:!l,onClick:()=>{t({preset:`custom`,from:i,to:o}),r(!1)},children:`Apply range`})]})]})]})}function lt(e,t){return e.stale?`stale`:e.status===`limited`||(e.usedPercent??0)>=100?`limited`:e.status===`warning`||(e.usedPercent??0)>=t?`warning`:`ok`}var ut={ok:`bg-status-running`,warning:`bg-status-waiting`,limited:`bg-status-failed`,stale:`bg-muted-foreground/40`};function dt(e){return e===null?`—`:e>0&&e<1?`<1%`:`${Math.round(e)}%`}var ft={ok:`Within limit`,warning:`Close to the limit`,limited:`Limit reached`};function pt(e,t){return t===`stale`?`reset since`:e.usedPercent===null?ft[e.status]:t===`limited`?`Limit reached`:`${dt(e.usedPercent)} used`}function mt({w:e,warnPercent:t}){let n=lt(e,t),r=e.usedPercent,i=(r===null?null:e.usedPercentAt)??e.observedAt;return(0,F.jsxs)(`div`,{className:`space-y-1.5`,"data-testid":`limit-window`,"data-tone":n,children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2 text-xs`,children:[(0,F.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,F.jsxs)(`span`,{className:we(`inline-flex items-center gap-1 tabular-nums`,n===`stale`?`text-muted-foreground`:`text-foreground`),children:[n===`warning`&&(0,F.jsx)(m,{className:`size-3 text-status-waiting`}),n===`limited`&&(0,F.jsx)(h,{className:`size-3 text-status-failed`}),pt(e,n)]})]}),r!==null&&(0,F.jsx)(`div`,{role:`meter`,"aria-label":`${e.label} used`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r),className:`h-2 overflow-hidden rounded-full bg-muted`,children:(0,F.jsx)(`div`,{className:we(`h-full rounded-full transition-[width]`,ut[n]),style:{width:`${n===`stale`?0:Math.max(r,r>0?2:0)}%`}})}),(0,F.jsxs)(`div`,{className:`flex justify-between gap-2 text-2xs text-muted-foreground`,children:[(0,F.jsx)(`span`,{children:e.resetsAt?n===`stale`?`Reset ${A(e.resetsAt)}`:`Resets ${D(e.resetsAt)}`:`Reset time not reported`}),(0,F.jsxs)(`span`,{title:new Date(i).toLocaleString(),children:[`as of `,A(i)]})]})]})}function ht({data:e}){let t=e?.windows??[],n=[...new Set(t.map(e=>e.provider))];return!e||n.length===0?(0,F.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-dashed border-border p-4 text-xs text-muted-foreground`,children:[(0,F.jsx)(f,{className:`mt-0.5 size-4 shrink-0`}),(0,F.jsx)(`p`,{children:`No limit readings yet. Claude reports its 5-hour and weekly windows while it runs, and Codex sends a snapshot with each turn, so they appear after the next session. API keys pay per token and have no such windows.`})]}):(0,F.jsx)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] gap-3 md:grid-cols-2`,children:n.map(n=>{let r=e.billing[n];return(0,F.jsxs)(`div`,{className:`space-y-4 rounded-xl border border-border bg-card p-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(C,{provider:n,className:`size-5 text-[10px]`}),(0,F.jsx)(`span`,{className:`text-sm font-medium`,children:_e[n]??n}),(0,F.jsx)(`span`,{className:`ml-auto text-2xs text-muted-foreground`,children:r===`subscription`?`Subscription login`:r===`api`?`API key`:`Login type unknown`})]}),t.filter(e=>e.provider===n).map(t=>(0,F.jsx)(mt,{w:t,warnPercent:e.warnPercent},t.windowId))]},n)})})}var gt={user:`You`,orchestrator:`Orchestrator`,pm:`PM`,automation:`Automation`,factory:`Factory`};function _t({sessions:e,empty:t=`No sessions in this range.`,limit:n=10}){return e.length===0?(0,F.jsx)(`p`,{className:`py-8 text-center text-xs text-muted-foreground`,children:t}):(0,F.jsxs)(Le,{className:`text-xs`,"data-testid":`top-sessions`,children:[(0,F.jsx)(Me,{children:(0,F.jsxs)(Fe,{className:`hover:bg-transparent`,children:[(0,F.jsx)(Ne,{className:`h-8 text-2xs`,children:`Session`}),(0,F.jsx)(Ne,{className:`h-8 text-2xs`,children:`Model`}),(0,F.jsx)(Ne,{className:`h-8 text-2xs`,children:`Started by`}),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Turns`}),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Tokens`}),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Cost`})]})}),(0,F.jsx)(Pe,{children:e.slice(0,n).map(e=>(0,F.jsxs)(Fe,{children:[(0,F.jsxs)(Ie,{className:`max-w-80 py-2`,children:[(0,F.jsx)(He,{to:`/sessions/$sessionId`,params:{sessionId:e.sessionId},className:`block truncate font-medium hover:underline`,children:e.title}),(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5 text-2xs text-muted-foreground`,children:[e.projectName??(e.role===`orchestrator`?`Orchestrator`:`No project`),(0,F.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),A(e.lastAt),e.pr&&(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,F.jsx)(`span`,{className:`text-muted-foreground/50`,children:`·`}),e.pr.state===`merged`?(0,F.jsx)(y,{className:`size-3 text-status-done`}):(0,F.jsx)(l,{className:`size-3`}),`#`,e.pr.number]})]})]}),(0,F.jsx)(Ie,{className:`py-2`,children:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-mono text-2xs text-muted-foreground`,children:[(0,F.jsx)(C,{provider:e.provider,className:`size-3.5 text-[8px]`}),e.model]})}),(0,F.jsx)(Ie,{className:`py-2 text-muted-foreground`,children:gt[e.source]}),(0,F.jsx)(Ie,{className:`py-2 text-right text-muted-foreground tabular-nums`,children:e.turns}),(0,F.jsx)(Ie,{className:`py-2 text-right text-muted-foreground tabular-nums`,children:ce(e.tokens)}),(0,F.jsx)(Ie,{className:`py-2 text-right font-mono font-medium tabular-nums`,children:pe(e.costUsd,e.estimated)})]},e.sessionId))})]})}function vt({label:e,value:t,sub:n,delta:r,testId:o}){return(0,F.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-card px-4 py-3`,children:[(0,F.jsx)(`div`,{className:`flex items-center gap-1.5 text-2xs text-muted-foreground`,children:e}),(0,F.jsxs)(`div`,{className:`mt-1 flex items-baseline gap-2`,children:[(0,F.jsx)(`span`,{"data-testid":o,className:`truncate text-2xl font-semibold tabular-nums`,children:t}),r&&(0,F.jsxs)(`span`,{title:`Compared with the previous period of the same length`,className:`inline-flex items-center text-2xs text-muted-foreground tabular-nums`,children:[r.up?(0,F.jsx)(a,{className:`size-3`}):(0,F.jsx)(i,{className:`size-3`}),r.text]})]}),(0,F.jsx)(`div`,{className:`mt-0.5 truncate text-2xs text-muted-foreground tabular-nums`,children:n})]})}function yt({report:e}){let t=e.totals,n=e.previousTotals,r=t.estimatedCostUsd>0,i=he(e.billing),a=t.costUsd/Math.max(1,e.days.length);return(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-5`,children:[(0,F.jsx)(vt,{testId:`usage-total`,label:(0,F.jsxs)(F.Fragment,{children:[i?`API-equivalent cost`:`Spend`,i&&(0,F.jsx)(`span`,{className:`rounded border border-border px-1 text-3xs`,title:`You use a subscription login: this is what the same work would cost on API credits, not your bill.`,children:`subscription`})]}),value:pe(t.costUsd,r),delta:de(t.costUsd,n.costUsd),sub:r?`${pe(a)}/day · ${pe(t.estimatedCostUsd)} estimated`:`${pe(a)} a day on average`}),(0,F.jsx)(vt,{testId:`usage-tokens`,label:`Tokens`,value:ce(me(t)),delta:de(me(t),me(n)),sub:`${ce(t.inputTokens)} in · ${ce(t.outputTokens)} out · ${ce(t.cacheReadTokens)} cached`}),(0,F.jsx)(vt,{label:`Cache hit rate`,value:ge(t.cacheHitRate),sub:`${ce(t.cacheWriteTokens)} written to cache`}),(0,F.jsx)(vt,{label:`Per session`,value:e.averages.perSessionUsd===null?`—`:pe(e.averages.perSessionUsd,r),sub:`${t.sessions.toLocaleString(`en-US`)} sessions · ${t.turns.toLocaleString(`en-US`)} turns`}),(0,F.jsx)(vt,{label:`Per merged PR`,value:e.averages.perMergedPrUsd===null?`—`:pe(e.averages.perMergedPrUsd),sub:e.averages.mergedPrs>0?`${e.averages.mergedPrs} merged PRs`:`No merged PRs in range`})]})}function bt({report:e,className:t}){return e.totals.unpricedTurns===0?null:(0,F.jsxs)(`p`,{className:we(`text-2xs text-muted-foreground`,t),children:[e.totals.unpricedTurns,` turns ran on models with no price and no reported cost; their tokens are counted but cost $0. Add a price under Prices.`]})}var xt={provider:`Provider`,model:`Model`,project:`Project`,role:`Role`,source:`Started by`};function St({report:e,dimension:t,onPick:n}){let r=ae(),i=e.series[t],a=Ye(i.map(e=>e.key)),o=e.totals.costUsd;return i.length===0?(0,F.jsx)(`p`,{className:`py-8 text-center text-xs text-muted-foreground`,children:`No usage in this range.`}):(0,F.jsxs)(Le,{className:`text-xs`,children:[(0,F.jsx)(Me,{children:(0,F.jsxs)(Fe,{className:`hover:bg-transparent`,children:[(0,F.jsx)(Ne,{className:`h-8 text-2xs`,children:xt[t]}),(0,F.jsx)(Ne,{className:`h-8 w-[28%] text-2xs`,children:`Share of spend`}),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Cost`}),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Tokens`}),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Turns`}),(0,F.jsx)(Ne,{className:`h-8 text-right text-2xs`,children:`Sessions`})]})}),(0,F.jsx)(Pe,{children:i.map(e=>{let t=a.get(e.key),i=e.key===`__other`||t===void 0?qe[r]:Ke[t]?.[r]??qe[r],s=o>0?e.costUsd/o:0,c=!!n&&e.key!==`__other`&&e.key!==``;return(0,F.jsxs)(Fe,{className:c?`cursor-pointer`:void 0,onClick:c?()=>n?.(e.key):void 0,title:c?`Show only ${e.label}`:void 0,children:[(0,F.jsx)(Ie,{className:`max-w-56 py-2`,children:(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`size-2.5 shrink-0 rounded-[3px]`,style:{background:i}}),(0,F.jsx)(`span`,{className:`truncate font-medium`,children:e.label})]})}),(0,F.jsx)(Ie,{className:`py-2`,children:(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`h-1.5 flex-1 overflow-hidden rounded-full bg-muted`,children:(0,F.jsx)(`span`,{className:`block h-full rounded-full`,style:{width:`${Math.max(s*100,s>0?1.5:0)}%`,background:i}})}),(0,F.jsx)(`span`,{className:`w-9 text-right text-muted-foreground tabular-nums`,children:ge(s)})]})}),(0,F.jsx)(Ie,{className:`py-2 text-right font-mono tabular-nums`,children:pe(e.costUsd,e.estimatedCostUsd>0)}),(0,F.jsx)(Ie,{className:`py-2 text-right text-muted-foreground tabular-nums`,children:ce(e.tokens)}),(0,F.jsx)(Ie,{className:`py-2 text-right text-muted-foreground tabular-nums`,children:e.turns.toLocaleString(`en-US`)}),(0,F.jsx)(Ie,{className:`py-2 text-right text-muted-foreground tabular-nums`,children:e.sessions.toLocaleString(`en-US`)})]},e.key)})})]})}var Ct=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function wt(e){return typeof e==`string`&&Ct.includes(e)}var Tt=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function Et(e){return typeof e==`string`&&Tt.has(e)}function Dt(e){return typeof e==`string`&&e.startsWith(`data-`)}function Ot(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Et(n)||Dt(n))&&(t[n]=e[n]);return t}function kt(e){if(e==null)return null;if((0,P.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return Ot(t)}return typeof e==`object`&&!Array.isArray(e)?Ot(e):null}function At(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Et(n)||Dt(n)||wt(n))&&(t[n]=e[n]);return t}var jt=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function Mt(){return Mt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mt.apply(null,arguments)}function Nt(e,t){if(e==null)return{};var n,r,i=Pt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Pt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ft=(0,P.forwardRef)((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:s,title:c,desc:l}=e,u=Nt(e,jt),d=a||{width:r,height:i,x:0,y:0},f=N(`recharts-surface`,o);return P.createElement(`svg`,Mt({},At(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),P.createElement(`title`,null,c),P.createElement(`desc`,null,l),n)}),It=[`children`,`className`];function Lt(){return Lt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lt.apply(null,arguments)}function Rt(e,t){if(e==null)return{};var n,r,i=zt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Bt=P.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Rt(e,It),a=N(`recharts-layer`,r);return P.createElement(`g`,Lt({className:a},At(i),{ref:t}),n)}),Vt=(0,P.createContext)(null),Ht=()=>(0,P.useContext)(Vt),Ut=Math.PI,Wt=2*Ut,Gt=1e-6,Kt=Wt-Gt;function qt(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Jt(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return qt;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}function Yt(e,t,n,r){return e===n&&t===r}function Xt(e){let t=Math.floor(e);if(!(t<=15))return Yt;let n=10**t,r=function(e){return Math.round(e*n)};return function(e,t,n,i){return r(e)===r(n)&&r(t)===r(i)}}var Zt=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?qt:Jt(e),this._equal=e==null?Yt:Xt(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>Gt){if(!(Math.abs(u*s-c*l)>Gt)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((Ut-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Gt&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;if(this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Gt||Math.abs(this._y1-l)>Gt)&&this._append`L${c},${l}`,n){if(d<0&&(d=d%Wt+Wt),d>Kt)this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`;else if(d>Gt){let a=e+n*Math.cos(i),o=t+n*Math.sin(i);if(d>=Ut&&this._equal(c,l,a,o)){d/=2;let i=r+d;this._append`A${n},${n},0,${+(d>=Ut)},${u},${e+n*Math.cos(i)},${t+n*Math.sin(i)}`}this._append`A${n},${n},0,${+(d>=Ut)},${u},${this._x1=a},${this._y1=o}`}}}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};Zt.prototype;function I(e){return function(){return e}}var Qt=Math.cos,$t=Math.sin,en=Math.sqrt,tn=1e-12,nn=Math.PI;nn/2;var rn=2*nn;function an(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Zt(t)}Array.prototype.slice;function on(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function sn(e){this._context=e}sn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function cn(e){return new sn(e)}function ln(e){return e[0]}function un(e){return e[1]}function dn(e,t){var n=I(!0),r=null,i=cn,a=null,o=an(s);e=typeof e==`function`?e:e===void 0?ln:I(e),t=typeof t==`function`?t:t===void 0?un:I(t);function s(s){var c,l=(s=on(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:I(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:I(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:I(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function fn(e,t,n){var r=null,i=I(!0),a=null,o=cn,s=null,c=an(l);e=typeof e==`function`?e:e===void 0?ln:I(+e),t=typeof t==`function`?t:I(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?un:I(+n);function l(l){var u,d,f,p=(l=on(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h){if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return dn().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:I(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:I(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:I(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:I(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:I(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:I(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:I(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}mn(cn);function pn(e){this._curve=e}pn.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function mn(e){function t(t){return new pn(e(t))}return t._curve=e,t}var hn=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function gn(e){return new hn(e,!0)}function _n(e){return new hn(e,!1)}en(3);var vn={draw(e,t){let n=en(t/nn);e.moveTo(n,0),e.arc(0,0,n,0,rn)}},yn={draw(e,t){let n=en(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},bn=en(1/3),xn=bn*2,Sn={draw(e,t){let n=en(t/xn),r=n*bn;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Cn={draw(e,t){let n=en(t),r=-n/2;e.rect(r,r,n,n)}},wn=.8908130915292852,Tn=$t(nn/10)/$t(7*nn/10),En=$t(rn/10)*Tn,Dn=-Qt(rn/10)*Tn,On={draw(e,t){let n=en(t*wn),r=En*n,i=Dn*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=rn*t/5,o=Qt(a),s=$t(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},kn=en(3),An={draw(e,t){let n=-en(t/(kn*3));e.moveTo(0,n*2),e.lineTo(-kn*n,-n),e.lineTo(kn*n,-n),e.closePath()}};en(3);var jn=-.5,Mn=en(3)/2,Nn=1/en(12),Pn=(Nn/2+1)*3,Fn={draw(e,t){let n=en(t/Pn),r=n/2,i=n*Nn,a=r,o=n*Nn+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(jn*r-Mn*i,Mn*r+jn*i),e.lineTo(jn*a-Mn*o,Mn*a+jn*o),e.lineTo(jn*s-Mn*c,Mn*s+jn*c),e.lineTo(jn*r+Mn*i,jn*i-Mn*r),e.lineTo(jn*a+Mn*o,jn*o-Mn*a),e.lineTo(jn*s+Mn*c,jn*c-Mn*s),e.closePath()}};function In(e,t){let n=null,r=an(i);e=typeof e==`function`?e:I(e||vn),t=typeof t==`function`?t:I(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:I(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:I(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function Ln(){}function Rn(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function zn(e){this._context=e}zn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Rn(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Rn(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bn(e){return new zn(e)}function Vn(e){this._context=e}Vn.prototype={areaStart:Ln,areaEnd:Ln,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Rn(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Hn(e){return new Vn(e)}function Un(e){this._context=e}Un.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Rn(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Wn(e){return new Un(e)}function Gn(e,t){this._basis=new zn(e),this._beta=t}Gn.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}},(function e(t){function n(e){return t===1?new zn(e):new Gn(e,t)}return n.beta=function(t){return e(+t)},n})(.85);function Kn(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function qn(e,t){this._context=e,this._k=(1-t)/6}qn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Kn(this,this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Kn(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function e(t){function n(e){return new qn(e,t)}return n.tension=function(t){return e(+t)},n})(0);function Jn(e,t){this._context=e,this._k=(1-t)/6}Jn.prototype={areaStart:Ln,areaEnd:Ln,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Kn(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function e(t){function n(e){return new Jn(e,t)}return n.tension=function(t){return e(+t)},n})(0);function Yn(e,t){this._context=e,this._k=(1-t)/6}Yn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Kn(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function e(t){function n(e){return new Yn(e,t)}return n.tension=function(t){return e(+t)},n})(0);function Xn(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>tn){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>tn){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function Zn(e,t){this._context=e,this._alpha=t}Zn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Xn(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function e(t){function n(e){return t?new Zn(e,t):new qn(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function Qn(e,t){this._context=e,this._alpha=t}Qn.prototype={areaStart:Ln,areaEnd:Ln,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Xn(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function e(t){function n(e){return t?new Qn(e,t):new Jn(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function $n(e,t){this._context=e,this._alpha=t}$n.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Xn(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function e(t){function n(e){return t?new $n(e,t):new Yn(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function er(e){this._context=e}er.prototype={areaStart:Ln,areaEnd:Ln,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function tr(e){return new er(e)}function nr(e){return e<0?-1:1}function rr(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(nr(a)+nr(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function ir(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ar(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function or(e){this._context=e}or.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ar(this,this._t0,ir(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ar(this,ir(this,n=rr(this,e,t)),n);break;default:ar(this,this._t0,n=rr(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function sr(e){this._context=new cr(e)}(sr.prototype=Object.create(or.prototype)).point=function(e,t){or.prototype.point.call(this,t,e)};function cr(e){this._context=e}cr.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function lr(e){return new or(e)}function ur(e){return new sr(e)}function dr(e){this._context=e}dr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=fr(e),i=fr(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o])}(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function fr(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function pr(e){return new dr(e)}function mr(e,t){this._context=e,this._t=t}mr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function hr(e){return new mr(e,.5)}function gr(e){return new mr(e,0)}function _r(e){return new mr(e,1)}function vr(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function yr(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function br(e,t){return e[t]}function xr(e){let t=[];return t.key=e,t}function Sr(){var e=I([]),t=yr,n=vr,r=br;function i(i){var a=Array.from(e.apply(this,arguments),xr),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=on(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:I(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:I(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?yr:typeof e==`function`?e:I(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??vr,i):n},i}function Cr(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}vr(e,t)}}function wr(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}vr(e,t)}}function Tr(e,t){if((o=e.length)>0&&(a=(i=e[t[0]]).length)>0){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,vr(e,t)}}function Er(e){return e===`__proto__`}var Dr=Object.prototype.hasOwnProperty;function Or(e,t){return Dr.call(e,t)}var kr=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function Ar(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:kr.test(e);default:return!1}}function jr(e){var t;return typeof e==`string`||typeof e==`symbol`?e:Object.is(e==null||(t=e.valueOf)==null?void 0:t.call(e),-0)?`-0`:String(e)}function Mr(e){return typeof e==`symbol`||e instanceof Symbol}function Nr(e){if(typeof e==`string`)return e;if(Array.isArray(e)){let t=``;for(let n=0;n<e.length;n++)n>0&&(t+=`,`),t+=Nr(e[n]);return t}if(Mr(e))return e.toString();let t=e+``;return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function Pr(e){return e==null?``:Nr(e)}function Fr(e){if(Array.isArray(e))return e.map(jr);if(typeof e==`symbol`)return[e];e=Pr(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1,s=!1,c=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let l=e[r];if(a)l===`\\`&&r+1<n?(r++,i+=e[r]):l===a?a=``:i+=l;else if(o){if(l===`"`||l===`'`)a=l,s=!0;else if(l===`]`){if(o=!1,!s&&i.includes(`.`)&&!c.test(i)){let e=i.split(`.`);for(let n=0;n<e.length;n++)e[n]!==``&&t.push(e[n])}else t.push(i);i=``}else i+=l}else if(l===`[`)o=!0,s=!1,i&&=(t.push(i),``);else if(l===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=l;r++}return i&&t.push(i),t}function Ir(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(Er(t))return n;let r=e[t];return r===void 0?Ar(t)&&!Or(e,t)?Ir(e,Fr(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=jr(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return Lr(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),Er(t))return n;let r=e[t];return r===void 0?n:r}}}function Lr(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||Er(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}var Rr=4;function zr(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:Rr),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function L(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+zr(i)+n},``)}var Br=e=>e===0?0:e>0?1:-1,Vr=e=>typeof e==`number`&&e!=+e,Hr=e=>typeof e==`string`&&e.indexOf(`%`)===e.length-1,R=e=>(typeof e==`number`||e instanceof Number)&&!Vr(e),Ur=e=>R(e)||typeof e==`string`,Wr=0,Gr=e=>{var t=++Wr;return`${e||``}${t}`},Kr=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!R(e)&&typeof e!=`string`)return n;var i;if(Hr(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return Vr(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},qr=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Jr(e,t,n){return R(e)&&R(t)?zr(e+n*(t-e)):t}function Yr(e,t,n){if(e&&e.length)return e.find(e=>e&&(typeof t==`function`?t(e):Ir(e,t))===n)}var z=e=>e==null,Xr=e=>z(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function Zr(e){return e!=null}function Qr(){}var $r=[`type`,`size`,`sizeType`];function ei(){return ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ei.apply(null,arguments)}function ti(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ni(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ti(Object(n),!0).forEach(function(t){ri(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ti(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ri(e,t,n){return(t=ii(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ii(e){var t=ai(e,`string`);return typeof t==`symbol`?t:t+``}function ai(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function oi(e,t){if(e==null)return{};var n,r,i=si(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function si(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ci={symbolCircle:vn,symbolCross:yn,symbolDiamond:Sn,symbolSquare:Cn,symbolStar:On,symbolTriangle:An,symbolWye:Fn},li=Math.PI/180,ui=e=>ci[`symbol${Xr(e)}`]||vn,di=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*li;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},fi=(e,t)=>{ci[`symbol${Xr(e)}`]=t},pi=e=>{var{type:t=`circle`,size:n=64,sizeType:r=`area`}=e,i=ni(ni({},oi(e,$r)),{},{type:t,size:n,sizeType:r}),a=`circle`;typeof t==`string`&&(a=t);var o=()=>{var e=ui(a),t=In().type(e).size(di(n,r,a))();if(t!==null)return t},{className:s,cx:c,cy:l}=i,u=At(i);return R(c)&&R(l)&&R(n)?P.createElement(`path`,ei({},u,{className:N(`recharts-symbols`,s),transform:`translate(${c}, ${l})`,d:o()})):null};pi.registerSymbol=fi;var mi=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,hi=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,P.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{wt(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},gi=(e,t,n)=>r=>(e(t,n,r),null),_i=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];wt(i)&&typeof a==`function`&&(r||={},r[i]=gi(a,t,n))}),r};function vi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vi(Object(n),!0).forEach(function(t){bi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bi(e,t,n){return(t=xi(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xi(e){var t=Si(e,`string`);return typeof t==`symbol`?t:t+``}function Si(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ci(e,t){var n=yi({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function wi(){return wi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wi.apply(null,arguments)}function Ti(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ei(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ti(Object(n),!0).forEach(function(t){Di(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ti(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Di(e,t,n){return(t=Oi(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oi(e){var t=ki(e,`string`);return typeof t==`symbol`?t:t+``}function ki(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Ai=32,ji={align:`center`,iconSize:14,inactiveColor:`#ccc`,layout:`horizontal`,verticalAlign:`middle`,labelStyle:{}};function Mi(e){if(typeof e==`object`&&e&&`strokeDasharray`in e)return String(e.strokeDasharray)}function Ni(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Ai/2,a=Ai/6,o=Ai/3,s=t.inactive?r:t.color,c=n??t.type;if(c===`none`)return null;if(c===`plainline`)return P.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:s,strokeDasharray:Mi(t.payload),x1:0,y1:i,x2:Ai,y2:i,className:`recharts-legend-icon`});if(c===`line`)return P.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:s,d:`M0,${i}h${o}
|
|
2
2
|
A${a},${a},0,1,1,${2*o},${i}
|
|
3
3
|
H${Ai}M${2*o},${i}
|
|
4
4
|
A${a},${a},0,1,1,${o},${i}`,className:`recharts-legend-icon`});if(c===`rect`)return P.createElement(`path`,{stroke:`none`,fill:s,d:`M0,${Ai/8}h${Ai}v${Ai*3/4}h${-Ai}z`,className:`recharts-legend-icon`});if(P.isValidElement(t.legendIcon)){var l=Ei({},t);return delete l.legendIcon,P.cloneElement(t.legendIcon,l)}return P.createElement(pi,{fill:s,cx:i,cy:i,size:Ai,sizeType:`diameter`,type:c})}function Pi(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:s}=e,c={x:0,y:0,width:Ai,height:Ai},l={display:r===`horizontal`?`inline-block`:`block`,marginRight:10},u={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return t.map((t,r)=>{var d=t.formatter||i,f=N({"recharts-legend-item":!0,[`legend-item-${r}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var p=typeof s==`object`?Ei({},s):{};p.color=t.inactive?a:p.color||t.color;var m=d?d(t.value,t,r):t.value;return P.createElement(`li`,wi({className:f,style:l,key:`legend-item-${r}`},_i(e,t,r)),P.createElement(Ft,{width:n,height:n,viewBox:c,style:u,"aria-label":`${m} legend icon`},P.createElement(Ni,{data:t,iconType:o,inactiveColor:a})),P.createElement(`span`,{className:`recharts-legend-item-text`,style:p},m))})}var Fi=e=>{var t=Ci(e,ji),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r===`horizontal`?i:`left`};return P.createElement(`ul`,{className:`recharts-default-legend`,style:a},P.createElement(Pi,wi({},t,{payload:n})))};function Ii(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function Li(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function Ri(e){return e}function zi(e){return Number.isSafeInteger(e)&&e>=0}function Bi(e){return e!=null&&typeof e!=`function`&&zi(e.length)}function Vi(e){return function(t){return Ir(t,e)}}function Hi(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function Ui(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Wi=`[object RegExp]`,Gi=`[object String]`,Ki=`[object Number]`,qi=`[object Boolean]`,Ji=`[object Arguments]`,Yi=`[object Symbol]`,Xi=`[object Date]`,Zi=`[object Map]`,Qi=`[object Set]`,$i=`[object Array]`,ea=`[object ArrayBuffer]`,ta=`[object Object]`,na=`[object DataView]`,ra=`[object Uint8Array]`,ia=`[object Uint8ClampedArray]`,aa=`[object Uint16Array]`,oa=`[object Uint32Array]`,sa=`[object Int8Array]`,ca=`[object Int16Array]`,la=`[object Int32Array]`,ua=`[object Float32Array]`,da=`[object Float64Array]`;function fa(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function pa(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function ma(e,t,n){return typeof n==`function`?ha(e,t,function e(t,r,i,a,o,s){let c=n(t,r,i,a,o,s);return c===void 0?ha(t,r,e,s,!1):!!c},new Map,!0):ma(e,t,()=>void 0)}function ha(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case`object`:return ga(e,t,n,r,i);case`function`:return Object.keys(t).length>0?ha(e,Object.assign({},t),n,r,i):fa(e,t);default:return pa(e)&&i?typeof t!=`string`||t===``:fa(e,t)}}function ga(e,t,n,r,i=!1){if(t==null)return!0;if(Array.isArray(t))return va(e,t,n,r);if(t instanceof Map)return _a(e,t,n,r);if(t instanceof Set)return ya(e,t,n,r);let a=Object.keys(t);if(e==null)return i&&a.length===0;if(i)Hi(e)&&(e=Object(e));else{if(Ui(t)===`[object Error]`)return Ui(e)===`[object Error]`&&e.name===t.name&&e.message===t.message;let n=Ui(e);if(n!==`[object Object]`&&n!==`[object Arguments]`)return!1}if(a.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let i=0;i<a.length;i++){let o=a[i];if(!(o in e)||t[o]===void 0&&e[o]!==void 0||t[o]===null&&e[o]!==null||!n(e[o],t[o],o,e,t,r))return!1}return!0}finally{r?.delete(t)}}function _a(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function va(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function ya(e,t,n,r){return t.size===0||e instanceof Set&&va([...e],[...t],n,r)}function ba(e,t){return ma(e,t,()=>void 0)}function xa(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}var Sa=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function Ca(e){return Sa.Buffer!==void 0&&Sa.Buffer.isBuffer(e)}function wa(e){return Ca(e)}function Ta(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ea(e){return Ta(e)}function Da(e,t){return Oa(e,void 0,e,new Map,t)}function Oa(e,t,n,r,i){if(i!=null){let a=i(e,t,n,r);if(a!==void 0)return a}if(Hi(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=Oa(e[a],a,n,r,i);return Or(e,`index`)&&(t.index=e.index),Or(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;return r.set(e,t),e.forEach((e,a)=>{t.set(a,Oa(e,a,n,r,i))}),t}if(e instanceof Set){let t=new Set;return r.set(e,t),e.forEach(e=>{t.add(Oa(e,void 0,n,r,i))}),t}if(wa(e))return e.subarray();if(Ea(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=Oa(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),ka(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),ka(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),ka(t,e,n,r,i),t}let a=Ui(e);if(a===`[object Error]`)return e===n?{}:e;switch(a){case Ki:case Gi:case qi:{let t=new e.constructor(e.valueOf());return r.set(e,t),ka(t,e,n,r,i),t}case Ji:{let t={};return r.set(e,t),ka(t,e,n,r,i),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}}if(typeof e==`object`&&Aa(a)){let t=a===`[object Object]`&&typeof e.constructor!=`function`?{}:Object.create(Object.getPrototypeOf(e));return r.set(e,t),ka(t,e,n,r,i),t}return e}function ka(e,t,n,r,i){let a=[...Object.keys(t),...xa(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=Oa(t[s],s,n,r,i))}}function Aa(e){switch(e){case Ji:case $i:case ea:case na:case qi:case Xi:case ua:case da:case sa:case ca:case la:case Zi:case Ki:case ta:case Wi:case Qi:case Gi:case Yi:case ra:case ia:case aa:case oa:return!0;default:return!1}}function ja(e){return Da(e)}function Ma(e){return e=ja(e),t=>ba(t,e)}var Na=/^(?:0|[1-9]\d*)$/;function Pa(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return Na.test(e)}}function Fa(e){return typeof e==`object`&&!!e&&Ui(e)===`[object Arguments]`}function Ia(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&Ar(t)&&!(t in Object(e))?Fr(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=jr(n[e]);if((r==null||!Or(r,t))&&!((Array.isArray(r)||Fa(r))&&Pa(t)&&Number(t)<r.length))return!1;r=r[t]}return!0}function La(e,t){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=jr(e)}return t=ja(t),function(n){let r=Ir(n,e);return r===void 0?Ia(n,e):t===void 0?r===void 0:ba(r,t)}}function Ra(e){if(e==null)return Ri;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?La(e[0],e[1]):Ma(e);default:return Vi(e)}}function za(e){return e===0?0:e}function Ba(e,t=Ri){return Bi(e)?Ii(Array.from(e),Li(Ra(t),1)).map(za):[]}function Va(e,t,n){return t===!0?Ba(e,n):typeof t==`function`?Ba(e,t):e}var Ha=(0,P.createContext)(null),Ua=Ge(),Wa=e=>e,B=()=>{var e=(0,P.useContext)(Ha);return e?e.store.dispatch:Wa},Ga=()=>{},Ka=()=>Ga,qa=(e,t)=>e===t;function V(e){var t=(0,P.useContext)(Ha),n=(0,P.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:Ga,[t,e]);return(0,Ua.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:Ka,t?t.store.getState:Ga,t?t.store.getState:Ga,n,qa)}function Ja(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function Ya(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function Xa(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var Za=e=>Array.isArray(e)?e:[e];function Qa(e){let t=Array.isArray(e[0])?e[0]:e;return Xa(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function $a(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var eo=class{constructor(e){this.value=e}deref(){return this.value}},to=typeof WeakRef<`u`?WeakRef:eo,no=0,ro=1;function io(){return{s:no,v:void 0,o:null,p:null}}function ao(e,t={}){let n=io(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=io(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=io(),e.set(n,t)):t=r}}let s=t,c;if(t.s===ro)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new to(c):c}return s.s=ro,s.v=c,c}return o.clearCache=()=>{n=io(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function oo(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),Ja(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=ao,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=Za(c),p=Za(u),m=Qa(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=$a(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var H=oo(ao),so=Object.assign((e,t=H)=>{Ya(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>so});function co(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}function lo(e,t,n){return pa(n)&&(typeof t==`number`&&Bi(n)&&Pa(t)&&t<n.length||typeof t==`string`&&t in n)?fa(n[t],e):!1}function uo(e){let t=Object.keys(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n}function fo(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}var po=(e,t,n)=>{if(e!==t){let r=fo(e),i=fo(t);if(r===i&&r===0){if(e<t)return n===`desc`?1:-1;if(e>t)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0},mo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ho=/^\w*$/;function go(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||Mr(e)?!0:typeof e==`string`&&(ho.test(e)||!mo.test(e))||t!=null&&Or(t,e)}function _o(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=Bi(e)?Array.from(e):uo(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e,r=0;for(;r<t.length&&n!=null;++r)n=n[t[r]];return r>0&&r===t.length?n:void 0},a=(e,t)=>{if(e==null)return t;if(t!=null)return typeof e==`object`&&`key`in e?Or(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):t[e]},o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||go(e)?e:{key:e,path:Fr(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;r<o.length;r++){let i=po(e.criteria[r],t.criteria[r],n[r]);if(i!==0)return i}return 0}).map(e=>e.original)}function vo(e,...t){let n=t.length;return n>1&&lo(e,t[0],t[1])?t=[]:n>2&&lo(t[0],t[1],t[2])&&(t=[t[0]]),_o(e,co(t),[`asc`])}var yo=e=>e.legend.settings,bo=e=>e.legend.size,xo=H([e=>e.legend.payload,yo],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?vo(r,n):r});function So(){return V(xo)}var Co=1;function wo(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=(0,P.useState)({height:0,left:0,top:0,width:0});return[t,(0,P.useCallback)(e=>{if(e!=null){var r=e.getBoundingClientRect(),i={height:r.height,left:r.left,top:r.top,width:r.width};(Math.abs(i.height-t.height)>Co||Math.abs(i.left-t.left)>Co||Math.abs(i.top-t.top)>Co||Math.abs(i.width-t.width)>Co)&&n({height:i.height,left:i.left,top:i.top,width:i.width})}},[t.width,t.height,t.top,t.left,...e])]}function To(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Eo=typeof Symbol==`function`&&Symbol.observable||`@@observable`,Do=()=>Math.random().toString(36).substring(7).split(``).join(`.`),Oo={INIT:`@@redux/INIT${Do()}`,REPLACE:`@@redux/REPLACE${Do()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Do()}`};function ko(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Ao(e,t,n){if(typeof e!=`function`)throw Error(To(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(To(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(To(1));return n(Ao)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(To(3));return i}function d(e){if(typeof e!=`function`)throw Error(To(4));if(c)throw Error(To(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(To(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!ko(e))throw Error(To(7));if(e.type===void 0)throw Error(To(8));if(typeof e.type!=`string`)throw Error(To(17));if(c)throw Error(To(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(To(10));r=e,f({type:Oo.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(To(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[Eo](){return this}}}return f({type:Oo.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[Eo]:m}}function jo(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:Oo.INIT})===void 0)throw Error(To(12));if(n(void 0,{type:Oo.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(To(13))})}function Mo(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{jo(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(To(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function No(...e){return e.length===0?e=>e:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function Po(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(To(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=No(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function Fo(e){return ko(e)&&`type`in e&&typeof e.type==`string`}var Io=Symbol.for(`immer-nothing`),Lo=Symbol.for(`immer-draftable`),Ro=Symbol.for(`immer-state`);function zo(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Bo=Object,Vo=Bo.getPrototypeOf,Ho=`constructor`,Uo=`prototype`,Wo=`configurable`,Go=`enumerable`,Ko=`writable`,qo=`value`,Jo=e=>!!e&&!!e[Ro];function Yo(e){return e?Qo(e)||as(e)||!!e[Lo]||!!e[Ho]?.[Lo]||os(e)||ss(e):!1}var Xo=Bo[Uo][Ho].toString(),Zo=new WeakMap;function Qo(e){if(!e||!cs(e))return!1;let t=Vo(e);if(t===null||t===Bo[Uo])return!0;let n=Bo.hasOwnProperty.call(t,Ho)&&t[Ho];if(n===Object)return!0;if(!ls(n))return!1;let r=Zo.get(n);return r===void 0&&(r=Function.toString.call(n),Zo.set(n,r)),r===Xo}function $o(e,t,n=!0){es(e)===0?(n?Reflect.ownKeys(e):Bo.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function es(e){let t=e[Ro];return t?t.type_:as(e)?1:os(e)?2:ss(e)?3:0}var ts=(e,t,n=es(e))=>n===2?e.has(t):Bo[Uo].hasOwnProperty.call(e,t),ns=(e,t,n=es(e))=>n===2?e.get(t):e[t],rs=(e,t,n,r=es(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function is(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var as=Array.isArray,os=e=>e instanceof Map,ss=e=>e instanceof Set,cs=e=>typeof e==`object`,ls=e=>typeof e==`function`,us=e=>typeof e==`boolean`;function ds(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var fs=e=>e.copy_||e.base_,ps=e=>e.modified_?e.copy_:e.base_;function ms(e,t){if(os(e))return new Map(e);if(ss(e))return new Set(e);if(as(e))return Array[Uo].slice.call(e);let n=Qo(e);if(t===!0||t===`class_only`&&!n){let t=Bo.getOwnPropertyDescriptors(e);delete t[Ro];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[Ko]===!1&&(a[Ko]=!0,a[Wo]=!0),(a.get||a.set)&&(t[i]={[Wo]:!0,[Ko]:!0,[Go]:a[Go],[qo]:e[i]})}return Bo.create(Vo(e),t)}{let t=Vo(e);if(t!==null&&n)return{...e};let r=Bo.create(t);return Bo.assign(r,e)}}function hs(e,t=!1){return vs(e)||Jo(e)||!Yo(e)||(es(e)>1&&Bo.defineProperties(e,{set:_s,add:_s,clear:_s,delete:_s}),Bo.freeze(e),t&&$o(e,(e,t)=>{hs(t,!0)},!1)),e}function gs(){zo(2)}var _s={[qo]:gs};function vs(e){return e===null||!cs(e)||Bo.isFrozen(e)}var ys=`MapSet`,bs=`Patches`,xs=`ArrayMethods`,Ss={};function Cs(e){let t=Ss[e];return t||zo(0,e),t}var ws=e=>!!Ss[e],Ts,Es=()=>Ts,Ds=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:ws(ys)?Cs(ys):void 0,arrayMethodsPlugin_:ws(xs)?Cs(xs):void 0});function Os(e,t){t&&(e.patchPlugin_=Cs(bs),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ks(e){As(e),e.drafts_.forEach(Ms),e.drafts_=null}function As(e){e===Ts&&(Ts=e.parent_)}var js=e=>Ts=Ds(Ts,e);function Ms(e){let t=e[Ro];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Ns(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[Ro].modified_&&(ks(t),zo(4)),Yo(e)&&(e=Ps(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[Ro].base_,e,t)}else e=Ps(t,n);return Fs(t,e,!0),ks(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===Io?void 0:e}function Ps(e,t){if(vs(t))return t;let n=t[Ro];if(!n)return Us(t,e.handledSet_,e);if(!Ls(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);Vs(n,e)}return n.copy_}function Fs(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&hs(t,n)}function Is(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Ls=(e,t)=>e.scope_===t,Rs=[];function zs(e,t,n,r){let i=fs(e),a=e.type_;if(r!==void 0&&ns(i,r,a)===t){rs(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;$o(i,(e,n)=>{if(Jo(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??Rs;for(let e of o)rs(i,e,n,a)}function Bs(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!Ls(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=ps(i);zs(e,i.draft_??i,a,n),Vs(i,r)})}function Vs(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}Is(e)}}function Hs(e,t,n){let{scope_:r}=e;if(Jo(n)){let i=n[Ro];Ls(i,r)&&i.callbacks_.push(function(){Qs(e),zs(e,n,ps(i),t)})}else Yo(n)&&e.callbacks_.push(function(){let i=fs(e);e.type_===3?i.has(n)&&Us(n,r.handledSet_,r):ns(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Us(ns(e.copy_,t,e.type_),r.handledSet_,r)})}function Us(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Jo(e)||t.has(e)||!Yo(e)||vs(e)||(t.add(e),$o(e,(r,i)=>{if(Jo(i)){let t=i[Ro];Ls(t,n)&&(rs(e,r,ps(t),e.type_),Is(t))}else Yo(i)&&Us(i,t,n)})),e}function Ws(e,t){let n=as(e),r={type_:+!!n,scope_:t?t.scope_:Es(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=Gs;n&&(i=[r],a=Ks);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var Gs={get(e,t){if(t===Ro)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=fs(e);if(!ts(i,t,e.type_))return Ys(e,i,t);let a=i[t];if(e.finalized_||!Yo(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&ds(t))return a;if(a===qs(e.base_,t)||Js(e,t,a)){Qs(e);let n=e.type_===1?+t:t,r=ec(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in fs(e)},ownKeys(e){return Reflect.ownKeys(fs(e))},set(e,t,n){let r=Xs(fs(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=qs(fs(e),t),i=r?.[Ro];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.delete(t),!0;if(is(n,r)&&(n!==void 0||ts(e.base_,t,e.type_)))return!0;Qs(e),Zs(e)}return e.copy_[t]===n&&(n!==void 0||ts(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Hs(e,t,n)),!0},deleteProperty(e,t){return Qs(e),qs(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Zs(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=fs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Ko]:!0,[Wo]:e.type_!==1||t!==`length`,[Go]:r[Go],[qo]:n[t]}},defineProperty(){zo(11)},getPrototypeOf(e){return Vo(e.base_)},setPrototypeOf(){zo(12)}},Ks={};for(let e in Gs){let t=Gs[e];Ks[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}Ks.deleteProperty=function(e,t){return Ks.set.call(this,e,t,void 0)},Ks.set=function(e,t,n){return Gs.set.call(this,e[0],t,n,e[0])};function qs(e,t){let n=e[Ro];return(n?fs(n):e)[t]}function Js(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||!Yo(n)||n[Ro]?!1:e.baseRefs_.has(n)}function Ys(e,t,n){let r=Xs(t,n);return r?qo in r?r[qo]:r.get?.call(e.draft_):void 0}function Xs(e,t){if(!(t in e))return;let n=Vo(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Vo(n)}}function Zs(e){e.modified_||(e.modified_=!0,e.parent_&&Zs(e.parent_))}function Qs(e){e.copy_||=(e.assigned_=new Map,ms(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var $s=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(ls(e)&&!ls(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}ls(t)||zo(6),n!==void 0&&!ls(n)&&zo(7);let r;if(Yo(e)){let i=js(this),a=ec(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?ks(i):As(i)}return Os(i,n),Ns(r,i)}if(!e||!cs(e)){if(r=t(e),r===void 0&&(r=e),r===Io&&(r=void 0),this.autoFreeze_&&hs(r,!0),n){let t=[],i=[];Cs(bs).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}zo(1,e)},this.produceWithPatches=(e,t)=>{if(ls(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},us(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),us(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),us(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Yo(e)||zo(8),Jo(e)&&(e=tc(e));let t=js(this),n=ec(t,e,void 0);return n[Ro].isManual_=!0,As(t),n}finishDraft(e,t){let n=e&&e[Ro];n&&n.isManual_||zo(9);let{scope_:r}=n;return Os(r,t),Ns(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=Cs(bs).applyPatches_;return Jo(e)?r(e,t):this.produce(e,e=>r(e,t))}};function ec(e,t,n,r){let[i,a]=os(t)?Cs(ys).proxyMap_(t,n):ss(t)?Cs(ys).proxySet_(t,n):Ws(t,n);return(n?.scope_??Es()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?Bs(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function tc(e){return Jo(e)||zo(10,e),nc(e)}function nc(e){if(!Yo(e)||vs(e))return e;let t=e[Ro],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ms(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=ms(e,!0);let i=n;return ss(n)&&(n=new Set),$o(i,(e,t)=>{rs(n,e,nc(t))},r),t&&(t.finalized_=!1),n}globalThis.Iterator?.from;var rc=new $s().produce;function ic(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var ac=ic(),oc=ic,sc=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?No:No.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function cc(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(gl(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>t!=null&&t.type===e&&Fo(t),n}var lc=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function uc(e){return Yo(e)?rc(e,()=>{}):e}function dc(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function fc(e){return typeof e==`boolean`}var pc=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new lc;return t&&(fc(t)?a.push(ac):a.push(oc(t.extraArgument))),a},mc=`RTK_autoBatch`,U=()=>e=>({payload:e,meta:{[mc]:!0}}),hc=e=>t=>{setTimeout(t,e)},gc=(e,t,n)=>r=>{let i=!1,a,o,s=()=>{i||(i=!0,t?.(a),clearTimeout(o),r())};a=e(s),o=setTimeout(s,n)},_c=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?gc(window.requestAnimationFrame,window.cancelAnimationFrame,100):hc(10):e.type===`callback`?e.queueNotification:hc(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[mc],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},vc=e=>function(t){let{autoBatch:n=!0}=t??{},r=new lc(e);return n&&r.push(_c(typeof n==`object`?n:void 0)),r};function yc(e){let t=pc(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(ko(n))c=Mo(n);else throw Error(gl(1));let l;l=typeof r==`function`?r(t):t();let u=No;i&&(u=sc({trace:!1,...typeof i==`object`&&i}));let d=vc(Po(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return Ao(c,o,p)}function bc(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(gl(28));if(r in t)throw Error(gl(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function xc(e){return typeof e==`function`}function Sc(e,t){let[n,r,i]=bc(t),a;if(xc(e))a=()=>uc(e());else{let t=uc(e);a=()=>t}function o(e,t,n){if(Jo(e)){let r=t(e,n);return r===void 0?e:r}if(Yo(e))return rc(e,e=>t(e,n));{let r=t(e,n);if(r===void 0){if(e===null)return e;throw Error(gl(9))}return r}}function s(e=a(),t){let s=n[t.type],c;for(let{matcher:e,reducer:n}of r)e(t)&&n&&(c??=[]).push(n);if(!s&&!c)return i?o(e,i,t):e;if(s&&(e=o(e,s,t)),c)for(let n of c)e=o(e,n,t);return e}return s.getInitialState=a,s}var Cc=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,wc=(e=21)=>{let t=``,n=e;for(;n--;)t+=Cc[Math.random()*64|0];return t},Tc=Symbol.for(`rtk-slice-createasyncthunk`);function Ec(e,t){return`${e}/${t}`}function Dc({creators:e}={}){let t=e?.asyncThunk?.[Tc];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(gl(11));let i=(typeof e.reducers==`function`?e.reducers(Ac()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(gl(12));if(n in o.sliceCaseReducersByType)throw Error(gl(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:Ec(n,r),createNotation:typeof e.reducers==`function`};Mc(a)?Pc(o,a,s,t):jc(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?bc(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return Sc(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=dc(d,r,m)),i}function i(t=l){return dc(dc(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=Oc(a,t,()=>dc(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function Oc(e,t,n,r){function i(i,...a){let o=t(i);return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var kc=Dc();function Ac(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function jc({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!Nc(r))throw Error(gl(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?cc(e,o):cc(e))}function Mc(e){return e._reducerDefinitionType===`asyncThunk`}function Nc(e){return e._reducerDefinitionType===`reducerWithPrepare`}function Pc({type:e,reducerName:t},n,r,i){if(!i)throw Error(gl(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||Fc,pending:s||Fc,rejected:c||Fc,settled:l||Fc})}function Fc(){}var Ic=`task`,Lc=`listener`,Rc=`completed`,zc=`cancelled`,Bc=`task-${zc}`,Vc=`task-${Rc}`,Hc=`${Lc}-${zc}`,Uc=`${Lc}-${Rc}`,Wc=class{code;name=`TaskAbortError`;message;constructor(e){this.code=e,this.message=`${Ic} ${zc} (reason: ${e})`}},Gc=(e,t)=>{if(typeof e!=`function`)throw TypeError(gl(32))},Kc=()=>{},qc=(e,t=Kc)=>(e.catch(t),e),Jc=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),Yc=e=>{if(e.aborted)throw new Wc(e.reason)};function Xc(e,t){let n=Kc;return new Promise((r,i)=>{let a=()=>i(new Wc(e.reason));e.aborted?a():(n=Jc(e,a),t.finally(()=>n()).then(r,i))}).finally(()=>{n=Kc})}var Zc=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof Wc?`cancelled`:`rejected`,error:e}}finally{t?.()}},Qc=e=>t=>qc(Xc(e,t).then(t=>(Yc(e),t))),$c=e=>{let t=Qc(e);return e=>{let n;return qc(t(new Promise(t=>{n=setTimeout(t,e)})).finally(()=>clearTimeout(n)))}},{assign:el}=Object,tl={},nl=`listenerMiddleware`,rl=(e,t)=>{let n=t=>Jc(e,()=>t.abort(e.reason));return(r,i)=>{Gc(r,`taskExecutor`);let a=new AbortController;n(a);let o=Zc(async()=>{Yc(e),Yc(a.signal);let t=await r({pause:Qc(a.signal),delay:$c(a.signal),signal:a.signal});return Yc(a.signal),t},()=>a.abort(Vc));return i?.autoJoin&&t.push(o.catch(Kc)),{result:Qc(e)(o),cancel(){a.abort(Bc)}}}},il=(e,t)=>{let n=async(n,r)=>{Yc(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})],o;r!=null&&a.push(new Promise(e=>{o=setTimeout(e,r,null)}));try{let e=await Xc(t,Promise.race(a));return Yc(t),e}finally{clearTimeout(o),i()}};return((e,t)=>qc(n(e,t)))},al=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=cc(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(gl(21));return Gc(a,`options.listener`),{predicate:i,type:t,effect:a}},ol=el(e=>{let{type:t,predicate:n,effect:r}=al(e);return{id:wc(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(gl(22))}}},{withTypes:()=>ol}),sl=(e,t)=>{let{type:n,effect:r,predicate:i}=al(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},cl=e=>{e.pending.forEach(e=>{e.abort(Hc)})},ll=(e,t)=>()=>{for(let e of t.keys())cl(e);e.clear()},ul=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},dl=el(cc(`${nl}/add`),{withTypes:()=>dl}),fl=cc(`${nl}/removeAll`),pl=el(cc(`${nl}/remove`),{withTypes:()=>pl}),ml=(...e)=>{console.error(`${nl}/error`,...e)},hl=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=ml}=e;Gc(o,`onError`);let s,c=()=>{if(!s){let e=Array.from(t.values()),n=new Set,r=!1;for(let t of e)typeof t.type==`string`?n.add(t.type):r=!0;s={entries:e,types:n,anyType:r}}return s},l=e=>{t.has(e.id)||(t.set(e.id,e),s=void 0)},u=e=>(e.unsubscribe=()=>{t.delete(e.id)&&(s=void 0)},l(e),t=>{e.unsubscribe(),t?.cancelActive&&cl(e)}),d=(e=>{let n=sl(t,e)??ol(e);return u(n)});el(d,{withTypes:()=>d});let f=e=>{let n=sl(t,e);return n&&(n.unsubscribe(),e.cancelActive&&cl(n)),!!n};el(f,{withTypes:()=>f});let p=async(e,t,n,s)=>{let c=new AbortController,u=il(d,c.signal),f=[];try{e.pending.add(c),r(e),await Promise.resolve(e.effect(t,el({},n,{getOriginalState:s,condition:(e,t)=>u(e,t).then(Boolean),take:u,delay:$c(c.signal),pause:Qc(c.signal),extra:a,signal:c.signal,fork:rl(c.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{l(e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==c&&(e.abort(Hc),n.delete(e))})},cancel:()=>{c.abort(Hc),e.pending.delete(c)},throwIfCancelled:()=>{Yc(c.signal)}})))}catch(e){e instanceof Wc||ul(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),c.abort(Uc),i(e),e.pending.delete(c)}},m=ll(t,n),h=()=>{m(),s=void 0};return{middleware:e=>t=>n=>{if(!Fo(n))return t(n);if(dl.match(n))return d(n.payload);if(fl.match(n)){h();return}if(pl.match(n))return f(n.payload);let r=e.getState(),i=()=>{if(r===tl)throw Error(gl(23));return r},a;try{a=t(n);let{entries:s,types:l,anyType:u}=c();if(u||l.has(n.type)){let t=e.getState();for(let a of s){if(typeof a.type==`string`&&a.type!==n.type)continue;let s=!1;try{s=a.predicate(n,t,r)}catch(e){s=!1,ul(o,e,{raisedBy:`predicate`})}s&&p(a,n,e,i)}}}finally{r=tl}return a},startListening:d,stopListening:f,clearListeners:h}};function gl(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var _l=kc({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),{setMargin:vl,setLayout:yl,setChartSize:bl,setScale:xl}=_l.actions,Sl=_l.reducer;function Cl(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function W(e){return Number.isFinite(e)}function wl(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function Tl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function El(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Tl(Object(n),!0).forEach(function(t){Dl(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Dl(e,t,n){return(t=Ol(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ol(e){var t=kl(e,`string`);return typeof t==`symbol`?t:t+``}function kl(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Al(e,t,n){return z(e)||z(t)?n:Ur(t)?Ir(e,t,n):typeof t==`function`?t(e):n}var jl=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:s}=t;if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&R(e[a]))return El(El({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&R(e[o]))return El(El({},e),{},{[o]:e[o]+(i||0)})}return e},Ml=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,Nl=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},Pl=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:s,isCategorical:c,categoricalDomain:l,tickCount:u,ticks:d,niceTicks:f,axisType:p}=e;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?Br(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return W(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(Zr):c&&l?l.map((e,t)=>{var n=o.map(e);return W(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(Zr):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return W(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(Zr):o.domain().map((e,t)=>{var n=o.map(e);return W(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(Zr)},Fl=(e,t)=>{if(!t||t.length!==2||!R(t[0])||!R(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!R(e[0])||e[0]<n)&&(i[0]=n),(!R(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},Il={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0,o=0;o<t;++o){var s=e[o]?.[r];if(s!=null){var c=s[1],l=s[0],u=Vr(c)?l:c;u>=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:Cr,none:vr,silhouette:wr,wiggle:Tr,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0;a<t;++a){var o=e[a]?.[r];if(o!=null){var s=Vr(o[1])?o[0]:o[1];s>=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},Ll=(e,t,n)=>{var r=Il[n]??vr,i=Sr().keys(t).value((e,t)=>Number(Al(e,t,0))).order(yr).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=Al(e[i],t[r],0);Array.isArray(a)&&a.length===2&&R(a[0])&&R(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function Rl(e){return e==null?void 0:String(e)}var zl=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:o}=e;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=Al(a,t.dataKey,t.scale.domain()[o]);if(z(s))return null;var c=t.scale.map(s);return R(c)?c-i/2+r:null},Bl=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},Vl=e=>{var t=e.flat(2).filter(R);return[Math.min(...t),Math.max(...t)]},Hl=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Ul=(e,t,n)=>{if(e!=null)return Hl(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,s=o.reduce((e,r)=>{var i=Vl(Cl(r,t,n));return!W(i[0])||!W(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(s[0],r[0]),Math.max(s[1],r[1])]},[1/0,-1/0]))},Wl=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Gl=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Kl=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=vo(t,e=>e.coordinate),a=1/0,o=1,s=i.length;o<s;o++){var c=i[o],l=i[o-1];a=Math.min((c?.coordinate||0)-(l?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function ql(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return El(El({},t),{},{dataKey:n,payload:r,value:i,name:a})}function Jl(e,t){if(e)return String(e);if(typeof t==`string`)return t}var Yl=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},Xl=(e,t)=>t===`centric`?e.angle:e.radius,Zl=e=>e.layout.width,Ql=e=>e.layout.height,$l=e=>e.layout.scale,eu=e=>e.layout.margin,tu=H(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),nu=H(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),ru=`data-recharts-item-index`;function iu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function au(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?iu(Object(n),!0).forEach(function(t){ou(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ou(e,t,n){return(t=su(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function su(e){var t=cu(e,`string`);return typeof t==`symbol`?t:t+``}function cu(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var lu=e=>e.brush.height;function uu(e){return nu(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function du(e){return nu(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function fu(e){return tu(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+t.height:e,0)}function pu(e){return tu(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+t.height:e,0)}var mu=H([Zl,Ql,eu,lu,uu,du,fu,pu,yo,bo],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=au(au({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=jl(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return au(au({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),hu=H(mu,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),gu=H(Zl,Ql,(e,t)=>({x:0,y:0,width:e,height:t})),_u=(0,P.createContext)(null),vu=()=>(0,P.useContext)(_u)!=null,yu=e=>e.brush,bu=H([yu,mu,eu],(e,t,n)=>({height:e.height,x:R(e.x)?e.x:t.left,y:R(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:R(e.width)?e.width:t.width}));function xu(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function Su(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=xu(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?((r||i)&&(s=e.apply(this,t)),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function Cu(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return Su(e,t,{leading:r,maxWait:t,trailing:i})}var wu=function(e,t){var n=[...arguments].slice(2);if(typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e)){if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}}},Tu={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},Eu=(e,t,n)=>{var{width:r=Tu.width,height:i=Tu.height,aspect:a,maxHeight:o}=n,s=Hr(r)?e:Number(r),c=Hr(i)?t:Number(i);return a&&a>0&&(s?c=s/a:c&&(s=c*a),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:s,calculatedHeight:c}},Du={width:0,height:0,overflow:`visible`},Ou={width:0,overflowX:`visible`},ku={height:0,overflowY:`visible`},Au={},ju=e=>{var{width:t,height:n}=e,r=Hr(t),i=Hr(n);return r&&i?Du:r?Ou:i?ku:Au};function Mu(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=Tu.width,a=Tu.height):i===void 0?i=r&&r>0?void 0:Tu.width:a===void 0&&(a=r&&r>0?void 0:Tu.height),{width:i,height:a}}function Nu(){return Nu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nu.apply(null,arguments)}function Pu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Fu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Pu(Object(n),!0).forEach(function(t){Iu(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Iu(e,t,n){return(t=Lu(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lu(e){var t=Ru(e,`string`);return typeof t==`symbol`?t:t+``}function Ru(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var zu=(0,P.createContext)(Tu.initialDimension);function Bu(e){return wl(e.width)&&wl(e.height)}function Vu(e){var{children:t,width:n,height:r}=e,i=(0,P.useMemo)(()=>({width:n,height:r}),[n,r]);return Bu(i)?P.createElement(zu.Provider,{value:i},t):null}var Hu=()=>(0,P.useContext)(zu),Uu=(0,P.forwardRef)((e,t)=>{var{aspect:n,initialDimension:r=Tu.initialDimension,width:i,height:a,minWidth:o=Tu.minWidth,minHeight:s,maxHeight:c,children:l,debounce:u=Tu.debounce,id:d,className:f,onResize:p,style:m={}}=e,h=(0,P.useRef)(null),g=(0,P.useRef)();g.current=p,(0,P.useImperativeHandle)(t,()=>h.current);var[_,v]=(0,P.useState)({containerWidth:r.width,containerHeight:r.height}),y=(0,P.useCallback)((e,t)=>{v(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,P.useEffect)(()=>{if(h.current==null||typeof ResizeObserver>`u`)return Qr;var e=e=>{var t,n=e[0];if(n!=null){var{width:r,height:i}=n.contentRect;y(r,i),(t=g.current)==null||t.call(g,r,i)}};u>0&&(e=Cu(e,u,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),{width:n,height:r}=h.current.getBoundingClientRect();return y(n,r),t.observe(h.current),()=>{t.disconnect()}},[y,u]);var{containerWidth:b,containerHeight:x}=_;wu(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var{calculatedWidth:S,calculatedHeight:C}=Eu(b,x,{width:i,height:a,aspect:n,maxHeight:c});return wu(S!=null&&S>0||C!=null&&C>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,j as t,m as n,y as r,yt as i}from"./format-
|
|
1
|
+
import{D as e,j as t,m as n,y as r,yt as i}from"./format-D3kairnQ.js";import{Dr as a}from"./icons-COCLuOtb.js";import{c as o,f as s,l as c,m as l,u}from"./new-session-CUpOffXI.js";import{t as d}from"./mobile-nav-CrjrDJZ5.js";import{d as f,f as p,t as m}from"./thread-view-AQKzJlKb.js";import{i as h}from"./api-yvn34iKU.js";import{r as g,t as _}from"./composer-B1tdNGSi.js";import{t as v}from"./jsx-runtime-C3cWAN_r.js";var y=v(),b=(e,t)=>e===`orchestrator`?`role:orchestrator`:`role:pm:${t}`;function x(t,n){return e(e=>{let r=t===`orchestrator`?e.roleSessions?.orchestrator:e.roleSessions?.pms[n??``];return(r?e.sessions.find(e=>e.id===r&&!e.archivedAt):void 0)||e.sessions.filter(e=>e.role===t&&!e.archivedAt&&(t===`orchestrator`||e.projectId===n)).sort((e,t)=>Date.parse(t.updatedAt)-Date.parse(e.updatedAt))[0]},void 0)}function S({kind:e,projectId:r}){let d=h(),f=b(e,r),p=g(e=>_(e,f)),{setText:m,clear:v}=g.getState(),x=i({mutationFn:t=>d.orchestration.send(e,r,t),onMutate:()=>v(f),onError:(e,n)=>{m(f,n.text),t.error(`Message not sent`,{description:e.message})}}),S=c(p),C=()=>{S&&x.mutate({text:p.text.trim(),attachments:l(p.attachments)})};return(0,y.jsx)(o,{draftKey:f,placeholder:u[e],onKeyDown:e=>{s(e)&&(e.preventDefault(),C())},options:(0,y.jsxs)(`span`,{className:`px-2 text-2xs text-muted-foreground`,children:[`The first message starts the `,e===`orchestrator`?`orchestrator`:`PM`,`.`]}),children:(0,y.jsx)(n,{size:`icon-sm`,className:`rounded-full transition-transform hover:scale-105`,onClick:C,disabled:!S||x.isPending,"aria-label":`Send`,children:(0,y.jsx)(a,{})})})}function C({kind:e,projectId:t,empty:n}){let i=x(e,t),a=r(t);return i?(0,y.jsx)(m,{sessionId:i.id,empty:n(i.id)}):(0,y.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-testid":`role-chat-start`,children:[(0,y.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-2.5 border-b border-border px-4`,children:[(0,y.jsx)(d,{}),(0,y.jsx)(p,{role:e}),(0,y.jsx)(`h1`,{className:`truncate text-[14px] font-medium`,children:e===`orchestrator`?`Orchestrator`:`${a?.name??`Project`} · Project manager`}),(0,y.jsx)(`span`,{className:`text-2xs text-muted-foreground`,children:`Not started`}),(0,y.jsx)(f,{className:`ml-auto`})]}),(0,y.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:n(b(e,t))}),(0,y.jsx)(S,{kind:e,projectId:t})]})}export{S as n,x as r,C as t};
|